text:
.class public Landroid/widget/EdgeEffect;
.super Ljava/lang/Object;
.source "EdgeEffect.java"

# static fields
.field private static final EPSILON:F = 0.001f

.field private static final HELD_EDGE_SCALE_Y:F = 0.5f

.field private static final MAX_ALPHA:F = 1.0f

.field private static final MAX_GLOW_HEIGHT:F = 4.0f

.field private static final MAX_VELOCITY:I = 0x2710

.field private static final MIN_VELOCITY:I = 0x64

.field private static final MIN_WIDTH:I = 0x12c

.field private static final PULL_DECAY_TIME:I = 0x3e8

.field private static final PULL_DISTANCE_ALPHA_GLOW_FACTOR:F = 1.1f

.field private static final PULL_DISTANCE_EDGE_FACTOR:I = 0x7

.field private static final PULL_DISTANCE_GLOW_FACTOR:I = 0x7

.field private static final PULL_EDGE_BEGIN:F = 0.6f

.field private static final PULL_GLOW_BEGIN:F = 1.0f

.field private static final PULL_TIME:I = 0xa7

.field private static final RECEDE_TIME:I = 0x3e8

.field private static final STATE_ABSORB:I = 0x2

.field private static final STATE_IDLE:I = 0x0

.field private static final STATE_PULL:I = 0x1

.field private static final STATE_PULL_DECAY:I = 0x4

.field private static final STATE_RECEDE:I = 0x3

.field private static final TAG:Ljava/lang/String; = "EdgeEffect"

.field private static final VELOCITY_EDGE_FACTOR:I = 0x8

.field private static final VELOCITY_GLOW_FACTOR:I = 0xc

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

.field private mDuration:F

.field private final mEdge:Landroid/graphics/drawable/Drawable;

.field private mEdgeAlpha:F

.field private mEdgeAlphaFinish:F

.field private mEdgeAlphaStart:F

.field private final mEdgeHeight:I

.field private mEdgeScaleY:F

.field private mEdgeScaleYFinish:F

.field private mEdgeScaleYStart:F

.field private final mGlow:Landroid/graphics/drawable/Drawable;

.field private mGlowAlpha:F

.field private mGlowAlphaFinish:F

.field private mGlowAlphaStart:F

.field private final mGlowHeight:I

.field private mGlowScaleY:F

.field private mGlowScaleYFinish:F

.field private mGlowScaleYStart:F

.field private final mGlowWidth:I

.field private mHeight:I

.field private final mInterpolator:Landroid/view/animation/Interpolator;

.field private final mMaxEffectHeight:I

.field private final mMinWidth:I

.field private mPullDistance:F

.field private mStartTime:J

.field private mState:I

.field private mWidth:I

.field private mX:I

.field private mY:I

# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 6
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    const/high16 v5, 0x40800000    # 4.0f

    const/high16 v4, 0x3f000000    # 0.5f

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

    .line 122
    const/4 v2, 0x0

    iput v2, p0, Landroid/widget/EdgeEffect;->mState:I

    .line 126
    new-instance v2, Landroid/graphics/Rect;

    invoke-direct {v2}, Landroid/graphics/Rect;-><init>()V

    iput-object v2, p0, Landroid/widget/EdgeEffect;->mBounds:Landroid/graphics/Rect;

    .line 138
    invoke-virtual {p1}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    .line 139
    .local v1, "res":Landroid/content/res/Resources;
    const v2, 0x10807a7

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v2

    iput-object v2, p0, Landroid/widget/EdgeEffect;->mEdge:Landroid/graphics/drawable/Drawable;

    .line 140
    const v2, 0x10807a8

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v2

    iput-object v2, p0, Landroid/widget/EdgeEffect;->mGlow:Landroid/graphics/drawable/Drawable;

    .line 142
    iget-object v2, p0, Landroid/widget/EdgeEffect;->mEdge:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v2}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I

    move-result v2

    iput v2, p0, Landroid/widget/EdgeEffect;->mEdgeHeight:I

    .line 147
    const/4 v0, 0x6

    .line 148
    .local v0, "factor":I
    iget-object v2, p0, Landroid/widget/EdgeEffect;->mGlow:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v2}, Landroid/graphics/drawable/Drawable;->getIntrinsicHeight()I

    move-result v2

    mul-int/lit8 v2, v2, 0x6

    iput v2, p0, Landroid/widget/EdgeEffect;->mGlowHeight:I

    .line 149
    iget-object v2, p0, Landroid/widget/EdgeEffect;->mGlow:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v2}, Landroid/graphics/drawable/Drawable;->getIntrinsicWidth()I

    move-result v2

    mul-int/lit8 v2, v2, 0x6

    iput v2, p0, Landroid/widget/EdgeEffect;->mGlowWidth:I

    .line 152
    iget v2, p0, Landroid/widget/EdgeEffect;->mGlowHeight:I

    int-to-float v2, v2

    mul-float/2addr v2, v5

    iget v3, p0, Landroid/widget/EdgeEffect;->mGlowHeight:I

    int-to-float v3, v3

    mul-float/2addr v2, v3

    iget v3, p0, Landroid/widget/EdgeEffect;->mGlowWidth:I

    int-to-float v3, v3

    div-float/2addr v2, v3

    const v3, 0x3f19999a    # 0.6f

    mul-float/2addr v2, v3

    iget v3, p0, Landroid/widget/EdgeEffect;->mGlowHeight:I

    int-to-float v3, v3

    mul-float/2addr v3, v5

    invoke-static {v2, v3}, Ljava/lang/Math;->min(FF)F

    move-result v2

    add-float/2addr v2, v4

    float-to-int v2, v2

    iput v2, p0, Landroid/widget/EdgeEffect;->mMaxEffectHeight:I

    .line 156
    invoke-virtual {v1}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v2

    iget v2, v2, Landroid/util/DisplayMetrics;->density:F

    const/high16 v3, 0x43960000    # 300.0f

    mul-float/2addr v2, v3

    add-float/2addr v2, v4

    float-to-int v2, v2

    iput v2, p0, Landroid/widget/EdgeEffect;->mMinWidth:I

    .line 157
    new-instance v2, Landroid/view/animation/DecelerateInterpolator;

    invoke-direct {v2}, Landroid/view/animation/DecelerateInterpolator;-><init>()V

    iput-object v2, p0, Landroid/widget/EdgeEffect;->mInterpolator:Landroid/view/animation/Interpolator;

    .line 158
    return-void
.end method

.method private update()V
    .locals 12

    .prologue
    const/4 v11, 0x3

    const/high16 v10, 0x447a0000    # 1000.0f

    const/high16 v9, 0x3f800000    # 1.0f

    const/4 v8, 0x0

    .line 388
    invoke-static {}, Landroid/view/animation/AnimationUtils;->currentAnimationTimeMillis()J

    move-result-wide v3

    .line 389
    .local v3, "time":J
    iget-wide v5, p0, Landroid/widget/EdgeEffect;->mStartTime:J

    sub-long v5, v3, v5

    long-to-float v5, v5

    iget v6, p0, Landroid/widget/EdgeEffect;->mDuration:F

    div-float/2addr v5, v6

    invoke-static {v5, v9}, Ljava/lang/Math;->min(FF)F

    move-result v2

    .line 391
    .local v2, "t":F
    iget-object v5, p0, Landroid/widget/EdgeEffect;->mInterpolator:Landroid/view/animation/Interpolator;

    invoke-interface {v5, v2}, Landroid/view/animation/Interpolator;->getInterpolation(F)F

    move-result v1

    .line 393
    .local v1, "interp":F
    iget v5, p0, Landroid/widget/EdgeEffect;->mEdgeAlphaStart:F

    iget v6, p0, Landroid/widget/EdgeEffect;->mEdgeAlphaFinish:F

    iget v7, p0, Landroid/widget/EdgeEffect;->mEdgeAlphaStart:F

    sub-float/2addr v6, v7

    mul-float/2addr v6, v1

    add-float/2addr v5, v6

    iput v5, p0, Landroid/widget/EdgeEffect;->mEdgeAlpha:F

    .line 394
    iget v5, p0, Landroid/widget/EdgeEffect;->mEdgeScaleYStart:F

    iget v6, p0, Landroid/widget/EdgeEffect;->mEdgeScaleYFinish:F

    iget v7, p0, Landroid/widget/EdgeEffect;->mEdgeScaleYStart:F

    sub-float/2addr v6, v7

    mul-float/2addr v6, v1

    add-float/2addr v5, v6

    iput v5, p0, Landroid/widget/EdgeEffect;->mEdgeScaleY:F

    .line 395
    iget v5, p0, Landroid/widget/EdgeEffect;->mGlowAlphaStart:F

    iget v6, p0, Landroid/widget/EdgeEffect;->mGlowAlphaFinish:F

    iget v7, p0, Landroid/widget/EdgeEffect;->mGlowAlphaStart:F

    sub-float/2addr v6, v7

    mul-float/2addr v6, v1

    add-float/2addr v5, v6

    iput v5, p0, Landroid/widget/EdgeEffect;->mGlowAlpha:F

    .line 396
    iget v5, p0, Landroid/widget/EdgeEffect;->mGlowScaleYStart:F

    iget v6, p0, Landroid/widget/EdgeEffect;->mGlowScaleYFinish:F

    iget v7, p0, Landroid/widget/EdgeEffect;->mGlowScaleYStart:F

    sub-float/2addr v6, v7

    mul-float/2addr v6, v1

    add-float/2addr v5, v6

    iput v5, p0, Landroid/widget/EdgeEffect;->mGlowScaleY:F

    .line 398
    const v5, 0x3f7fbe77    # 0.999f

    cmpl-float v5, v2, v5

    if-ltz v5, :cond_0

    .line 399
    iget v5, p0, Landroid/widget/EdgeEffect;->mState:I

    packed-switch v5, :pswitch_data_0

    .line 448
    :cond_0
    :goto_0
    return-void

    .line 401
    :pswitch_0
    iput v11, p0, Landroid/widget/EdgeEffect;->mState:I

    .line 402
    invoke-static {}, Landroid/view/animation/AnimationUtils;->currentAnimationTimeMillis()J

    move-result-wide v5

    iput-wide v5, p0, Landroid/widget/EdgeEffect;->mStartTime:J

    .line 403
    iput v10, p0, Landroid/widget/EdgeEffect;->mDuration:F

    .line 405
    iget v5, p0, Landroid/widget/EdgeEffect;->mEdgeAlpha:F

    iput v5, p0, Landroid/widget/EdgeEffect;->mEdgeAlphaStart:F

    .line 406
    iget v5, p0, Landroid/widget/EdgeEffect;->mEdgeScaleY:F

    iput v5, p0, Landroid/widget/EdgeEffect;->mEdgeScaleYStart:F

    .line 407
    iget v5, p0, Landroid/widget/EdgeEffect;->mGlowAlpha:F

    iput v5, p0, Landroid/widget/EdgeEffect;->mGlowAlphaStart:F

    .line 408
    iget v5, p0, Landroid/widget/EdgeEffect;->mGlowScaleY:F

    iput v5, p0, Landroid/widget/EdgeEffect;->mGlowScaleYStart:F

    .line 411
    iput v8, p0, Landroid/widget/EdgeEffect;->mEdgeAlphaFinish:F

    .line 412
    iput v8, p0, Landroid/widget/EdgeEffect;->mEdgeScaleYFinish:F

    .line 413
    iput v8, p0, Landroid/widget/EdgeEffect;->mGlowAlphaFinish:F

    .line 414
    iput v8, p0, Landroid/widget/EdgeEffect;->mGlowScaleYFinish:F

    goto :goto_0

    .line 417
    :pswitch_1
    const/4 v5, 0x4

    iput v5, p0, Landroid/widget/EdgeEffect;->mState:I

    .line 418
    invoke-static {}, Landroid/view/animation/AnimationUtils;->currentAnimationTimeMillis()J

    move-result-wide v5

    iput-wide v5, p0, Landroid/widget/EdgeEffect;->mStartTime:J

    .line 419
    iput v10, p0, Landroid/widget/EdgeEffect;->mDuration:F

    .line 421
    iget v5, p0, Landroid/widget/EdgeEffect;->mEdgeAlpha:F

    iput v5, p0, Landroid/widget/EdgeEffect;->mEdgeAlphaStart:F

    .line 422
    iget v5, p0, Landroid/widget/EdgeEffect;->mEdgeScaleY:F

    iput v5, p0, Landroid/widget/EdgeEffect;->mEdgeScaleYStart:F

    .line 423
    iget v5, p0, Landroid/widget/EdgeEffect;->mGlowAlpha:F

    iput v5, p0, Landroid/widget/EdgeEffect;->mGlowAlphaStart:F

    .line 424
    iget v5, p0, Landroid/widget/EdgeEffect;->mGlowScaleY:F

    iput v5, p0, Landroid/widget/EdgeEffect;->mGlowScaleYStart:F

    .line 427
    iput v8, p0, Landroid/widget/EdgeEffect;->mEdgeAlphaFinish:F

    .line 428
    iput v8, p0, Landroid/widget/EdgeEffect;->mEdgeScaleYFinish:F

    .line 429
    iput v8, p0, Landroid/widget/EdgeEffect;->mGlowAlphaFinish:F

    .line 430
    iput v8, p0, Landroid/widget/EdgeEffect;->mGlowScaleYFinish:F

    goto :goto_0

    .line 435
    :pswitch_2
    iget v5, p0, Landroid/widget/EdgeEffect;->mGlowScaleYFinish:F

    cmpl-float v5, v5, v8

    if-eqz v5, :cond_1

    iget v5, p0, Landroid/widget/EdgeEffect;->mGlowScaleYFinish:F

    iget v6, p0, Landroid/widget/EdgeEffect;->mGlowScaleYFinish:F

    mul-float/2addr v5, v6

    div-float v0, v9, v5

    .line 438
    .local v0, "factor":F
    :goto_1
    iget v5, p0, Landroid/widget/EdgeEffect;->mEdgeScaleYStart:F

    iget v6, p0, Landroid/widget/EdgeEffect;->mEdgeScaleYFinish:F

    iget v7, p0, Landroid/widget/EdgeEffect;->mEdgeScaleYStart:F

    sub-float/2addr v6, v7

    mul-float/2addr v6, v1

    mul-float/2addr v6, v0

    add-float/2addr v5, v6

    iput v5, p0, Landroid/widget/EdgeEffect;->mEdgeScaleY:F

    .line 441
    iput v11, p0, Landroid/widget/EdgeEffect;->mState:I

    goto :goto_0

    .line 435
    .end local v0    # "factor":F
    :cond_1
    const v0, 0x7f7fffff    # Float.MAX_VALUE

    goto :goto_1

    .line 444
    :pswitch_3
    const/4 v5, 0x0

    iput v5, p0, Landroid/widget/EdgeEffect;->mState:I

    goto :goto_0

    .line 399
    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_1
        :pswitch_0
        :pswitch_3
        :pswitch_2
    .end packed-switch
.end method

# virtual methods
.method public draw(Landroid/graphics/Canvas;)Z
    .locals 11
    .param p1, "canvas"    # Landroid/graphics/Canvas;

    .prologue
    const/high16 v10, 0x437f0000    # 255.0f

    const/high16 v9, 0x3f800000    # 1.0f

    const/4 v8, 0x0

    const/4 v4, 0x0

    .line 337
    invoke-direct {p0}, Landroid/widget/EdgeEffect;->update()V

    .line 339
    iget-object v5, p0, Landroid/widget/EdgeEffect;->mGlow:Landroid/graphics/drawable/Drawable;

    iget v6, p0, Landroid/widget/EdgeEffect;->mGlowAlpha:F

    invoke-static {v6, v9}, Ljava/lang/Math;->min(FF)F

    move-result v6

    invoke-static {v8, v6}, Ljava/lang/Math;->max(FF)F

    move-result v6

    mul-float/2addr v6, v10

    float-to-int v6, v6

    invoke-virtual {v5, v6}, Landroid/graphics/drawable/Drawable;->setAlpha(I)V

    .line 341
    iget v5, p0, Landroid/widget/EdgeEffect;->mGlowHeight:I

    int-to-float v5, v5

    iget v6, p0, Landroid/widget/EdgeEffect;->mGlowScaleY:F

    mul-float/2addr v5, v6

    iget v6, p0, Landroid/widget/EdgeEffect;->mGlowHeight:I

    int-to-float v6, v6

    mul-float/2addr v5, v6

    iget v6, p0, Landroid/widget/EdgeEffect;->mGlowWidth:I

    int-to-float v6, v6

    div-float/2addr v5, v6

    const v6, 0x3f19999a    # 0.6f

    mul-float/2addr v5, v6

    iget v6, p0, Landroid/widget/EdgeEffect;->mGlowHeight:I

    int-to-float v6, v6

    const/high16 v7, 0x40800000    # 4.0f

    mul-float/2addr v6, v7

    invoke-static {v5, v6}, Ljava/lang/Math;->min(FF)F

    move-result v5

    float-to-int v2, v5

    .line 344
    .local v2, "glowBottom":I
    iget v5, p0, Landroid/widget/EdgeEffect;->mWidth:I

    iget v6, p0, Landroid/widget/EdgeEffect;->mMinWidth:I

    if-ge v5, v6, :cond_2

    .line 346
    iget v5, p0, Landroid/widget/EdgeEffect;->mWidth:I

    iget v6, p0, Landroid/widget/EdgeEffect;->mMinWidth:I

    sub-int/2addr v5, v6

    div-int/lit8 v3, v5, 0x2

    .line 347
    .local v3, "glowLeft":I
    iget-object v5, p0, Landroid/widget/EdgeEffect;->mGlow:Landroid/graphics/drawable/Drawable;

    iget v6, p0, Landroid/widget/EdgeEffect;->mWidth:I

    sub-int/2addr v6, v3

    invoke-virtual {v5, v3, v4, v6, v2}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    .line 353
    .end local v3    # "glowLeft":I
    :goto_0
    iget-object v5, p0, Landroid/widget/EdgeEffect;->mGlow:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v5, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    .line 355
    iget-object v5, p0, Landroid/widget/EdgeEffect;->mEdge:Landroid/graphics/drawable/Drawable;

    iget v6, p0, Landroid/widget/EdgeEffect;->mEdgeAlpha:F

    invoke-static {v6, v9}, Ljava/lang/Math;->min(FF)F

    move-result v6

    invoke-static {v8, v6}, Ljava/lang/Math;->max(FF)F

    move-result v6

    mul-float/2addr v6, v10

    float-to-int v6, v6

    invoke-virtual {v5, v6}, Landroid/graphics/drawable/Drawable;->setAlpha(I)V

    .line 357
    iget v5, p0, Landroid/widget/EdgeEffect;->mEdgeHeight:I

    int-to-float v5, v5

    iget v6, p0, Landroid/widget/EdgeEffect;->mEdgeScaleY:F

    mul-float/2addr v5, v6

    float-to-int v0, v5

    .line 358
    .local v0, "edgeBottom":I
    iget v5, p0, Landroid/widget/EdgeEffect;->mWidth:I

    iget v6, p0, Landroid/widget/EdgeEffect;->mMinWidth:I

    if-ge v5, v6, :cond_3

    .line 360
    iget v5, p0, Landroid/widget/EdgeEffect;->mWidth:I

    iget v6, p0, Landroid/widget/EdgeEffect;->mMinWidth:I

    sub-int/2addr v5, v6

    div-int/lit8 v1, v5, 0x2

    .line 361
    .local v1, "edgeLeft":I
    iget-object v5, p0, Landroid/widget/EdgeEffect;->mEdge:Landroid/graphics/drawable/Drawable;

    iget v6, p0, Landroid/widget/EdgeEffect;->mWidth:I

    sub-int/2addr v6, v1

    invoke-virtual {v5, v1, v4, v6, v0}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    .line 366
    .end local v1    # "edgeLeft":I
    :goto_1
    iget-object v5, p0, Landroid/widget/EdgeEffect;->mEdge:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v5, p1}, Landroid/graphics/drawable/Drawable;->draw(Landroid/graphics/Canvas;)V

    .line 368
    iget v5, p0, Landroid/widget/EdgeEffect;->mState:I

    const/4 v6, 0x3

    if-ne v5, v6, :cond_0

    if-nez v2, :cond_0

    if-nez v0, :cond_0

    .line 369
    iput v4, p0, Landroid/widget/EdgeEffect;->mState:I

    .line 372
    :cond_0
    iget v5, p0, Landroid/widget/EdgeEffect;->mState:I

    if-eqz v5, :cond_1

    const/4 v4, 0x1

    :cond_1
    return v4

    .line 350
    .end local v0    # "edgeBottom":I
    :cond_2
    iget-object v5, p0, Landroid/widget/EdgeEffect;->mGlow:Landroid/graphics/drawable/Drawable;

    iget v6, p0, Landroid/widget/EdgeEffect;->mWidth:I

    invoke-virtual {v5, v4, v4, v6, v2}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    goto :goto_0

    .line 364
    .restart local v0    # "edgeBottom":I
    :cond_3
    iget-object v5, p0, Landroid/widget/EdgeEffect;->mEdge:Landroid/graphics/drawable/Drawable;

    iget v6, p0, Landroid/widget/EdgeEffect;->mWidth:I

    invoke-virtual {v5, v4, v4, v6, v0}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    goto :goto_1
.end method

.method public finish()V
    .locals 1

    .prologue
    .line 199
    const/4 v0, 0x0

    iput v0, p0, Landroid/widget/EdgeEffect;->mState:I

    .line 200
    return-void
.end method

.method public getBounds(Z)Landroid/graphics/Rect;
    .locals 4
    .param p1, "reverse"    # Z

    .prologue
    const/4 v0, 0x0

    .line 381
    iget-object v1, p0, Landroid/widget/EdgeEffect;->mBounds:Landroid/graphics/Rect;

    iget v2, p0, Landroid/widget/EdgeEffect;->mWidth:I

    iget v3, p0, Landroid/widget/EdgeEffect;->mMaxEffectHeight:I

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

    .line 382
    iget-object v1, p0, Landroid/widget/EdgeEffect;->mBounds:Landroid/graphics/Rect;

    iget v2, p0, Landroid/widget/EdgeEffect;->mX:I

    iget v3, p0, Landroid/widget/EdgeEffect;->mY:I

    if-eqz p1, :cond_0

    iget v0, p0, Landroid/widget/EdgeEffect;->mMaxEffectHeight:I

    :cond_0
    sub-int v0, v3, v0

    invoke-virtual {v1, v2, v0}, Landroid/graphics/Rect;->offset(II)V

    .line 384
    iget-object v0, p0, Landroid/widget/EdgeEffect;->mBounds:Landroid/graphics/Rect;

    return-object v0
.end method

.method public isFinished()Z
    .locals 1

    .prologue
    .line 191
    iget v0, p0, Landroid/widget/EdgeEffect;->mState:I

    if-nez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public onAbsorb(I)V
    .locals 5
    .param p1, "velocity"    # I

    .prologue
    const/high16 v4, 0x3f800000    # 1.0f

    const/4 v3, 0x0

    .line 293
    const/4 v0, 0x2

    iput v0, p0, Landroid/widget/EdgeEffect;->mState:I

    .line 294
    const/16 v0, 0x64

    invoke-static {p1}, Ljava/lang/Math;->abs(I)I

    move-result v1

    invoke-static {v0, v1}, Ljava/lang/Math;->max(II)I

    move-result v0

    const/16 v1, 0x2710

    invoke-static {v0, v1}, Ljava/lang/Math;->min(II)I

    move-result p1

    .line 296
    invoke-static {}, Landroid/view/animation/AnimationUtils;->currentAnimationTimeMillis()J

    move-result-wide v0

    iput-wide v0, p0, Landroid/widget/EdgeEffect;->mStartTime:J

    .line 297
    const v0, 0x3e19999a    # 0.15f

    int-to-float v1, p1

    const v2, 0x3ca3d70a    # 0.02f

    mul-float/2addr v1, v2

    add-float/2addr v0, v1

    iput v0, p0, Landroid/widget/EdgeEffect;->mDuration:F

    .line 301
    iput v3, p0, Landroid/widget/EdgeEffect;->mEdgeAlphaStart:F

    .line 302
    iput v3, p0, Landroid/widget/EdgeEffect;->mEdgeScaleYStart:F

    iput v3, p0, Landroid/widget/EdgeEffect;->mEdgeScaleY:F

    .line 305
    const v0, 0x3e99999a    # 0.3f

    iput v0, p0, Landroid/widget/EdgeEffect;->mGlowAlphaStart:F

    .line 306
    iput v3, p0, Landroid/widget/EdgeEffect;->mGlowScaleYStart:F

    .line 310
    const/4 v0, 0x0

    mul-int/lit8 v1, p1, 0x8

    const/4 v2, 0x1

    invoke-static {v1, v2}, Ljava/lang/Math;->min(II)I

    move-result v1

    invoke-static {v0, v1}, Ljava/lang/Math;->max(II)I

    move-result v0

    int-to-float v0, v0

    iput v0, p0, Landroid/widget/EdgeEffect;->mEdgeAlphaFinish:F

    .line 312
    const/high16 v0, 0x3f000000    # 0.5f

    mul-int/lit8 v1, p1, 0x8

    int-to-float v1, v1

    invoke-static {v1, v4}, Ljava/lang/Math;->min(FF)F

    move-result v1

    invoke-static {v0, v1}, Ljava/lang/Math;->max(FF)F

    move-result v0

    iput v0, p0, Landroid/widget/EdgeEffect;->mEdgeScaleYFinish:F

    .line 319
    const v0, 0x3ccccccd    # 0.025f

    div-int/lit8 v1, p1, 0x64

    mul-int/2addr v1, p1

    int-to-float v1, v1

    const v2, 0x391d4952    # 1.5E-4f

    mul-float/2addr v1, v2

    add-float/2addr v0, v1

    const/high16 v1, 0x3fe00000    # 1.75f

    invoke-static {v0, v1}, Ljava/lang/Math;->min(FF)F

    move-result v0

    iput v0, p0, Landroid/widget/EdgeEffect;->mGlowScaleYFinish:F

    .line 321
    iget v0, p0, Landroid/widget/EdgeEffect;->mGlowAlphaStart:F

    mul-int/lit8 v1, p1, 0xc

    int-to-float v1, v1

    const v2, 0x3727c5ac    # 1.0E-5f

    mul-float/2addr v1, v2

    invoke-static {v1, v4}, Ljava/lang/Math;->min(FF)F

    move-result v1

    invoke-static {v0, v1}, Ljava/lang/Math;->max(FF)F

    move-result v0

    iput v0, p0, Landroid/widget/EdgeEffect;->mGlowAlphaFinish:F

    .line 323
    return-void
.end method

.method public onPull(F)V
    .locals 10
    .param p1, "deltaDistance"    # F

    .prologue
    const/4 v6, 0x1

    const/high16 v9, 0x40e00000    # 7.0f

    const/high16 v8, 0x3f800000    # 1.0f

    const/4 v7, 0x0

    .line 213
    invoke-static {}, Landroid/view/animation/AnimationUtils;->currentAnimationTimeMillis()J

    move-result-wide v2

    .line 214
    .local v2, "now":J
    iget v4, p0, Landroid/widget/EdgeEffect;->mState:I

    const/4 v5, 0x4

    if-ne v4, v5, :cond_0

    iget-wide v4, p0, Landroid/widget/EdgeEffect;->mStartTime:J

    sub-long v4, v2, v4

    long-to-float v4, v4

    iget v5, p0, Landroid/widget/EdgeEffect;->mDuration:F

    cmpg-float v4, v4, v5

    if-gez v4, :cond_0

    .line 252
    :goto_0
    return-void

    .line 217
    :cond_0
    iget v4, p0, Landroid/widget/EdgeEffect;->mState:I

    if-eq v4, v6, :cond_1

    .line 218
    iput v8, p0, Landroid/widget/EdgeEffect;->mGlowScaleY:F

    .line 220
    :cond_1
    iput v6, p0, Landroid/widget/EdgeEffect;->mState:I

    .line 222
    iput-wide v2, p0, Landroid/widget/EdgeEffect;->mStartTime:J

    .line 223
    const/high16 v4, 0x43270000    # 167.0f

    iput v4, p0, Landroid/widget/EdgeEffect;->mDuration:F

    .line 225
    iget v4, p0, Landroid/widget/EdgeEffect;->mPullDistance:F

    add-float/2addr v4, p1

    iput v4, p0, Landroid/widget/EdgeEffect;->mPullDistance:F

    .line 226
    iget v4, p0, Landroid/widget/EdgeEffect;->mPullDistance:F

    invoke-static {v4}, Ljava/lang/Math;->abs(F)F

    move-result v0

    .line 228
    .local v0, "distance":F
    const v4, 0x3f19999a    # 0.6f

    invoke-static {v0, v8}, Ljava/lang/Math;->min(FF)F

    move-result v5

    invoke-static {v4, v5}, Ljava/lang/Math;->max(FF)F

    move-result v4

    iput v4, p0, Landroid/widget/EdgeEffect;->mEdgeAlphaStart:F

    iput v4, p0, Landroid/widget/EdgeEffect;->mEdgeAlpha:F

    .line 229
    const/high16 v4, 0x3f000000    # 0.5f

    mul-float v5, v0, v9

    invoke-static {v5, v8}, Ljava/lang/Math;->min(FF)F

    move-result v5

    invoke-static {v4, v5}, Ljava/lang/Math;->max(FF)F

    move-result v4

    iput v4, p0, Landroid/widget/EdgeEffect;->mEdgeScaleYStart:F

    iput v4, p0, Landroid/widget/EdgeEffect;->mEdgeScaleY:F

    .line 232
    iget v4, p0, Landroid/widget/EdgeEffect;->mGlowAlpha:F

    invoke-static {p1}, Ljava/lang/Math;->abs(F)F

    move-result v5

    const v6, 0x3f8ccccd    # 1.1f

    mul-float/2addr v5, v6

    add-float/2addr v4, v5

    invoke-static {v8, v4}, Ljava/lang/Math;->min(FF)F

    move-result v4

    iput v4, p0, Landroid/widget/EdgeEffect;->mGlowAlphaStart:F

    iput v4, p0, Landroid/widget/EdgeEffect;->mGlowAlpha:F

    .line 236
    invoke-static {p1}, Ljava/lang/Math;->abs(F)F

    move-result v1

    .line 237
    .local v1, "glowChange":F
    cmpl-float v4, p1, v7

    if-lez v4, :cond_2

    iget v4, p0, Landroid/widget/EdgeEffect;->mPullDistance:F

    cmpg-float v4, v4, v7

    if-gez v4, :cond_2

    .line 238
    neg-float v1, v1

    .line 240
    :cond_2
    iget v4, p0, Landroid/widget/EdgeEffect;->mPullDistance:F

    cmpl-float v4, v4, v7

    if-nez v4, :cond_3

    .line 241
    iput v7, p0, Landroid/widget/EdgeEffect;->mGlowScaleY:F

    .line 245
    :cond_3
    const/high16 v4, 0x40800000    # 4.0f

    iget v5, p0, Landroid/widget/EdgeEffect;->mGlowScaleY:F

    mul-float v6, v1, v9

    add-float/2addr v5, v6

    invoke-static {v7, v5}, Ljava/lang/Math;->max(FF)F

    move-result v5

    invoke-static {v4, v5}, Ljava/lang/Math;->min(FF)F

    move-result v4

    iput v4, p0, Landroid/widget/EdgeEffect;->mGlowScaleYStart:F

    iput v4, p0, Landroid/widget/EdgeEffect;->mGlowScaleY:F

    .line 248
    iget v4, p0, Landroid/widget/EdgeEffect;->mEdgeAlpha:F

    iput v4, p0, Landroid/widget/EdgeEffect;->mEdgeAlphaFinish:F

    .line 249
    iget v4, p0, Landroid/widget/EdgeEffect;->mEdgeScaleY:F

    iput v4, p0, Landroid/widget/EdgeEffect;->mEdgeScaleYFinish:F

    .line 250
    iget v4, p0, Landroid/widget/EdgeEffect;->mGlowAlpha:F

    iput v4, p0, Landroid/widget/EdgeEffect;->mGlowAlphaFinish:F

    .line 251
    iget v4, p0, Landroid/widget/EdgeEffect;->mGlowScaleY:F

    iput v4, p0, Landroid/widget/EdgeEffect;->mGlowScaleYFinish:F

    goto/16 :goto_0
.end method

.method public onRelease()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 261
    iput v2, p0, Landroid/widget/EdgeEffect;->mPullDistance:F

    .line 263
    iget v0, p0, Landroid/widget/EdgeEffect;->mState:I

    const/4 v1, 0x1

    if-eq v0, v1, :cond_0

    iget v0, p0, Landroid/widget/EdgeEffect;->mState:I

    const/4 v1, 0x4

    if-eq v0, v1, :cond_0

    .line 280
    :goto_0
    return-void

    .line 267
    :cond_0
    const/4 v0, 0x3

    iput v0, p0, Landroid/widget/EdgeEffect;->mState:I

    .line 268
    iget v0, p0, Landroid/widget/EdgeEffect;->mEdgeAlpha:F

    iput v0, p0, Landroid/widget/EdgeEffect;->mEdgeAlphaStart:F

    .line 269
    iget v0, p0, Landroid/widget/EdgeEffect;->mEdgeScaleY:F

    iput v0, p0, Landroid/widget/EdgeEffect;->mEdgeScaleYStart:F

    .line 270
    iget v0, p0, Landroid/widget/EdgeEffect;->mGlowAlpha:F

    iput v0, p0, Landroid/widget/EdgeEffect;->mGlowAlphaStart:F

    .line 271
    iget v0, p0, Landroid/widget/EdgeEffect;->mGlowScaleY:F

    iput v0, p0, Landroid/widget/EdgeEffect;->mGlowScaleYStart:F

    .line 273
    iput v2, p0, Landroid/widget/EdgeEffect;->mEdgeAlphaFinish:F

    .line 274
    iput v2, p0, Landroid/widget/EdgeEffect;->mEdgeScaleYFinish:F

    .line 275
    iput v2, p0, Landroid/widget/EdgeEffect;->mGlowAlphaFinish:F

    .line 276
    iput v2, p0, Landroid/widget/EdgeEffect;->mGlowScaleYFinish:F

    .line 278
    invoke-static {}, Landroid/view/animation/AnimationUtils;->currentAnimationTimeMillis()J

    move-result-wide v0

    iput-wide v0, p0, Landroid/widget/EdgeEffect;->mStartTime:J

    .line 279
    const/high16 v0, 0x447a0000    # 1000.0f

    iput v0, p0, Landroid/widget/EdgeEffect;->mDuration:F

    goto :goto_0
.end method

.method setPosition(II)V
    .locals 0
    .param p1, "x"    # I
    .param p2, "y"    # I

    .prologue
    .line 179
    iput p1, p0, Landroid/widget/EdgeEffect;->mX:I

    .line 180
    iput p2, p0, Landroid/widget/EdgeEffect;->mY:I

    .line 181
    return-void
.end method

.method public setSize(II)V
    .locals 0
    .param p1, "width"    # I
    .param p2, "height"    # I

    .prologue
    .line 167
    iput p1, p0, Landroid/widget/EdgeEffect;->mWidth:I

    .line 168
    iput p2, p0, Landroid/widget/EdgeEffect;->mHeight:I

    .line 169
    return-void
.end method


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Herb. Fr. 11: tab. 513 (1791)

#### Original name
Agaricus tessulatus Bull., 1791

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
@import url(http://fonts.googleapis.com/css?family=Lato:300,400,700);
*, *:after, *::before {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}
body {
	font-family: 'Lato', Arial, sans-serif;
	overflow: hidden;
	 background: #2980b9;
    background: #000;
}

a,
a:focus {
	outline: none;
}
/* unvisited link */
a:link {text-decoration: none;}
/* visited link */
a:visited {text-decoration: none;}
/* mouse over link */
a:hover {text-decoration: none;}
/* selected link */
a:active {text-decoration: none;}

@media screen and (max-width: 30em) {
	body {
		font-size: 90%;
	}
}

@media screen and (max-height: 29em) {
	.container {
		height: auto;
	}
}

/* Post and page style
--------------------------------------------------------------*/
.type-post,#main-nav-wrapper,nav {
  -webkit-box-shadow: 0 4px 15px -5px #555;
  box-shadow: 0 4px 15px -5px #555;
}
.type-post,.type-page,.type-attachment,#post-area .post {
  border-right: 1px solid #dbdbdb;
  border-bottom: 1px solid #dbdbdb;
}
.type-post,.type-page,.type-attachment {
  width: 750px;
  background: #fff;
  margin-right: 10px;
  margin-top: 15px;
  float: left;
}
.type-post {
  position: relative;
}
.pinbin-image img {
  z-index: 5;
}
.pinbin-category {
  position: absolute;
  width: auto;
  background: #000;
  zoom: 1;
  filter: alpha(opacity=70);
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)";
  filter: alpha(opacity=70);
  opacity: 0.7;
  margin-top: -36px;
  z-index: 1;
  height: 30px;
  overflow: hidden;
  left: 0;
}
.pinbin-category p {
  margin: 0;
  padding: 0;
  line-height: 30px;
  padding-left: 20px;
  padding-right: 40px;
  color: #fff;
  font-style: italic;
}
.pinbin-category a {
  color: #fff;
  font-style: italic;
  text-decoration: none;
}
.pinbin-category a:hover {
  color: #777;
  text-decoration: none;
}
.pinbin-copy {
  padding: 20px 8%;
}
.pinbin-meta {
  width: 100%;
  display: inline-block;
  color: #8e8e8e;
  font-size: 11px;
  margin-bottom: 10px;
  padding-bottom: 0px;
  border-bottom: 1px dotted #cccccc;
}
.size-full {
  max-width: 100%;
  height: inherit;
}
#post-area .sticky {
  background: #ececec !important;
}
#post-area .sticky:hover {
  background: #fff !important;
}
/* Post style on frontpage
--------------------------------------------------------------*/
#post-area .post {
  width: 300px;
  background: #FFF;
  margin-right: 10px;
  margin-top: 15px;
}
#post-area .post .pinbin-copy {
  padding-top: 10px;
  padding-bottom: 10px;
  overflow: hidden;
  clear: both;
  width: 250px;
}
#post-area .post .pinbin-date {
  width: 115px;
  color: #8e8e8e;
  font-size: 11px;
  border-bottom: 1px dotted #cccccc;
  padding-bottom: 0;
  padding-top: 0;
}
#post-area .post .pinbin-link a {
  text-decoration: none;
  background: #444;
  padding: 5px 10px;
  color: #fafafa;
  font-size: 12px;
  float: right;
  cursor: pointer;
  position: absolute;
  margin-left: 245px;
  margin-top: -15px;
}
#post-area .post .pinbin-link a:hover {
  background: #777;
}
#post-area .post .pinbin-link a,.post-next a,.post-prev a,.post-next a,.post-prev a {
  -webkit-transition: background 0.3s linear;
  -moz-transition: background 0.3s linear;
  -o-transition: background 0.3s linear;
  -ms-transition: background 0.3s linear;
  transition: background 0.3s linear;
}


text:
namespace CompositeExample
{
    internal class Program
    {
        private static void Main()
        {
            var rootComposite = new CompositeElementA("root compElementA");

            var firstComposite1 = new CompositeElementA("first compElementA");
            rootComposite.AddComponent(firstComposite1);
            var firstComposite2 = new CompositeElementB("first compElementB");
            rootComposite.AddComponent(firstComposite2);

            var secondaryComposite1 = new CompositeElementA("secondary compElementA");
            firstComposite1.AddComponent(secondaryComposite1);
            var secondarySimple1 = new SimpleElementA("secondary simpleElementA");
            firstComposite2.AddComponent(secondarySimple1);

            rootComposite.getDetails(0);
        }
    }
}


text:
@implementation ZBInvoicesAPI

static NSString *invoiceURL = @"/invoices";

-(ZBInvoicesAPI *)initZBInvoicesAPI:(NSString *)auth_token :(NSString *)organization_id
{
    @autoreleasepool
    {
        self = [super init];
        self -> _authToken = auth_token;
        self -> _organizationID = organization_id;

        return self;
    }
}

-(ZBInvoiceList *) getInvoices:(NSMutableDictionary *)parameter
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];
    if(parameter != nil && [parameter count] > 0)
    {
        [queryParam addEntriesFromDictionary: parameter];
    }
    NSString *responseString = [ZBHTTPClient getUrl:invoiceURL QueryParameter: queryParam];

    return [ZBInvoiceParser getInvoices: responseString];
}

-(ZBInvoice *) getInvoice:(NSString *)invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];
    [queryParam setValue:@"json" forKey:@"accept"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@", invoice_id];
    NSString *responseString = [ZBHTTPClient getUrl: urlString QueryParameter: queryParam];

    return [ZBInvoiceParser getInvoice: responseString];
}

-(NSFileWrapper *)getInvoiceAsPDF:(NSString *)invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];
    [queryParam setValue:@"pdf" forKey:@"accept"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@", invoice_id];

    return [ZBHTTPClient getFileFromUrl: urlString QueryParameter: queryParam];
}

-(NSString *)getInvoiceAsHTML:(NSString *)invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];
    [queryParam setValue:@"html" forKey:@"accept"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@", invoice_id];
    return [ZBHTTPClient getUrl: urlString QueryParameter: queryParam];
}

-(ZBInvoice *)createInvoice:(ZBInvoice *)new_invoice :(BOOL)send_invoice_to_customer :(BOOL)ignore_auto_number_generation
{
    NSError *error;
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];

    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];
    [requestParam setValue:_organizationID forKey:@"organization_id"];
    [requestParam setValue:(send_invoice_to_customer)?@"true":@"false" forKey:@"send"];
    [requestParam setValue:(ignore_auto_number_generation)?@"true":@"false" forKey:@"ignore_auto_number_generation"];

    NSData *invoiceData = [NSJSONSerialization dataWithJSONObject:[new_invoice toJSON] options:0 error:&error];
    [requestParam setValue:[[NSString alloc] initWithData: invoiceData encoding:NSUTF8StringEncoding] forKey:@"JSONString"];

    NSString *responseString = [ZBHTTPClient postUrl: invoiceURL QueryParameter: queryParam RequestBody: requestParam];

    return [ZBInvoiceParser getInvoice: responseString];
}

-(ZBInvoice *)updateInvoice:(ZBInvoice *)update_invoice : (BOOL) ignore_auto_number_generation
{
    NSError *error;
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];

    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];
    [requestParam setValue:_organizationID forKey:@"organization_id"];
    [requestParam setValue:(ignore_auto_number_generation)?@"true":@"false" forKey:@"ignore_auto_number_generation"];

    NSData *invoiceData = [NSJSONSerialization dataWithJSONObject:[update_invoice toJSON] options:0 error:&error];
    [requestParam setValue:[[NSString alloc] initWithData: invoiceData encoding:NSUTF8StringEncoding] forKey:@"JSONString"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@",[update_invoice getID]];
    NSString *responseString = [ZBHTTPClient putUrl: urlString QueryParameter: queryParam RequestBody: requestParam];

    return [ZBInvoiceParser getInvoice: responseString];
}

-(NSString *)deleteInvoice:(NSString *)invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@", invoice_id];
    NSString *responseString = [ZBHTTPClient deleteUrl: urlString QueryParameter: queryParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(NSString *)markAsInvoiceSent:(NSString *)invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];
    [requestParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/status/sent", invoice_id];
    NSString *responseString = [ZBHTTPClient postUrl: urlString QueryParameter: queryParam RequestBody: requestParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(NSString *)markAsInvoiceVoid:(NSString *)invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];
    [requestParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/status/void", invoice_id];
    NSString *responseString = [ZBHTTPClient postUrl: urlString QueryParameter: queryParam RequestBody: requestParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(NSString *)markAsInvoiceDraft:(NSString *)invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];
    [requestParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/status/draft", invoice_id];
    NSString *responseString = [ZBHTTPClient postUrl: urlString QueryParameter: queryParam RequestBody: requestParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(NSString *)sendEmailInvoice:(NSString *)invoice_id :(ZBEMail *)email :(NSMutableDictionary *)parameter
{
    NSError *error;
    NSMutableDictionary *attachmentParam = [[NSMutableDictionary alloc] init];
    if(email != nil && [email getAttachments] != nil && [[email getAttachments] count] > 0)
    {
        [attachmentParam setValue:[email getAttachments] forKey:@"attachments"];
    }

    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];
    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];
    if(parameter != nil && [parameter count] > 0)
    {
        [requestParam addEntriesFromDictionary: parameter];
    }
    if(email != nil)
    {
        NSData *emailJSONData = [NSJSONSerialization dataWithJSONObject: [email toJSON] options:0 error:&error];
        [requestParam setValue:[[NSString alloc] initWithData: emailJSONData encoding:NSUTF8StringEncoding] forKey:@"JSONString"];
    }

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/email", invoice_id];
    NSString *responseString = [ZBHTTPClient postUrl: urlString QueryParameter: queryParam RequestBody: requestParam Files: attachmentParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(NSString *) sendEmailInvoices:(NSMutableArray *)invoice_ids :(NSMutableArray *)contacts
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];

    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];
    [requestParam setValue:_organizationID forKey:@"organization_id"];
    [queryParam setValue:[invoice_ids componentsJoinedByString:@","] forKey:@"invoice_ids"];
    if(contacts != nil && [contacts count] > 0)
    {
        NSError *error;
        NSData *contactJSONData = [NSJSONSerialization dataWithJSONObject: @{@"contacts":contacts} options:0 error:&error];
        [requestParam setValue:[[NSString alloc] initWithData: contactJSONData encoding:NSUTF8StringEncoding] forKey:@"JSONString"];
    }
    NSString *urlString = [invoiceURL stringByAppendingString:@"/email"];
    NSString *responseString = [ZBHTTPClient postUrl: urlString QueryParameter: queryParam RequestBody: requestParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(ZBEMail *) getInvoiceEmailContent:(NSString *)invoice_id :(NSString *)email_template_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];
    if(email_template_id != nil)
    {
        [queryParam setValue: email_template_id forKey:@"email_template_id"];
    }
    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/email", invoice_id];
    NSString *responseString = [ZBHTTPClient getUrl: urlString QueryParameter: queryParam];

    return [ZBInvoiceParser getEMail: responseString];
}

-(NSString *)sendPaymentRemainder:(NSString *)invoice_id :(ZBEMail *)email :(BOOL)send_customer_statement
{
    NSError *error;
    NSMutableDictionary *attachmentParam = [[NSMutableDictionary alloc] init];
    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];

    if(email != nil)
    {
        NSData *emailJSONData = [NSJSONSerialization dataWithJSONObject: [email toJSON] options:0 error:&error];
        [requestParam setValue: [[NSString alloc] initWithData:emailJSONData encoding:NSUTF8StringEncoding] forKey:@"JSONString"];
        if([email getAttachments] != nil && [[email getAttachments] count] > 0)
        {
            [attachmentParam setValue:[email getAttachments] forKey:@"attachments"];
        }
    }
    [requestParam setValue:(send_customer_statement)?@"true":@"false" forKey:@"send_customer_statement"];

    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];
    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/paymentreminder", invoice_id];
    NSString *responseString = [ZBHTTPClient postUrl:urlString QueryParameter: queryParam RequestBody: requestParam Files: attachmentParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(NSString *)sendBulkPaymentRemainder:(NSMutableArray *)invoice_ids
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];
    [requestParam setValue:_organizationID forKey:@"organization_id"];
    [requestParam setValue:[invoice_ids componentsJoinedByString:@","] forKey:@"invoice_ids"];

    NSString *urlString = [invoiceURL stringByAppendingString:@"/paymentreminder"];
    NSString *responseString = [ZBHTTPClient postUrl: urlString QueryParameter: queryParam RequestBody: requestParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(ZBEMail *)getPaymentRemainderEmailContent:(NSString *)invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/paymentreminder", invoice_id];
    NSString *responseString = [ZBHTTPClient getUrl: urlString QueryParameter: queryParam];

    return [ZBInvoiceParser getEMail: responseString];
}

-(NSFileWrapper *) exportInvoices:(NSMutableArray *)invoice_ids
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];
    [queryParam setValue:[invoice_ids componentsJoinedByString:@","] forKey:@"invoice_ids"];
    NSString *urlString = [invoiceURL stringByAppendingString:@"/pdf"];

    return [ZBHTTPClient getFileFromUrl:urlString QueryParameter: queryParam];
}

-(NSFileWrapper *) printInvoices:(NSMutableArray *)invoice_ids
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];
    [queryParam setValue:[invoice_ids componentsJoinedByString:@","] forKey:@"invoice_ids"];
    NSString *urlString = [invoiceURL stringByAppendingString:@"/print"];

    return [ZBHTTPClient getFileFromUrl:urlString QueryParameter: queryParam];
}

-(NSString *)disablePaymentRemainder:(NSString *)invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    NSMutableDictionary *requetParam = [[NSMutableDictionary alloc] init];
    [requetParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/paymentreminder/disable", invoice_id];
    NSString *responseString = [ZBHTTPClient postUrl: urlString QueryParameter: queryParam RequestBody: requetParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(NSString *)enablePaymentRemainder:(NSString *)invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    NSMutableDictionary *requetParam = [[NSMutableDictionary alloc] init];
    [requetParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/paymentreminder/enable", invoice_id];
    NSString *responseString = [ZBHTTPClient postUrl: urlString QueryParameter: queryParam RequestBody: requetParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(NSString *)writeOffInvoice:(NSString *)invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    NSMutableDictionary *requetParam = [[NSMutableDictionary alloc] init];
    [requetParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/writeoff", invoice_id];
    NSString *responseString = [ZBHTTPClient postUrl: urlString QueryParameter: queryParam RequestBody: requetParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(NSString *)cancelWriteOffInvoice:(NSString *)invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    NSMutableDictionary *requetParam = [[NSMutableDictionary alloc] init];
    [requetParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/writeoff/cancel", invoice_id];
    NSString *responseString = [ZBHTTPClient postUrl: urlString QueryParameter: queryParam RequestBody: requetParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(NSString *) updateBillingAddress:(NSString *)invoice_id :(BOOL)isUpdateCustomer :(ZBAddress *)address
{
    NSError *error;
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];

    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];
    [requestParam setValue:_organizationID forKey:@"organization_id"];

    NSMutableDictionary *addressJSON = [address toJSON];
    [addressJSON setValue:@(isUpdateCustomer) forKey:@"is_update_customer"];

    NSData *addressJSONData = [NSJSONSerialization dataWithJSONObject: addressJSON options:0 error:&error];
    [requestParam setValue: [[NSString alloc] initWithData:addressJSONData encoding:NSUTF8StringEncoding] forKey:@"JSONString"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/address/billing", invoice_id];
    NSString *responseString = [ZBHTTPClient putUrl:urlString QueryParameter: queryParam RequestBody: requestParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(NSString *) updateShippingAddress:(NSString *)invoice_id :(BOOL)isUpdateCustomer :(ZBAddress *)address
{
    NSError *error;
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];

    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];
    [requestParam setValue:_organizationID forKey:@"organization_id"];

    NSMutableDictionary *addressJSON = [address toJSON];
    [addressJSON setValue:@(isUpdateCustomer) forKey:@"is_update_customer"];

    NSData *addressJSONData = [NSJSONSerialization dataWithJSONObject: addressJSON options:0 error:&error];
    [requestParam setValue: [[NSString alloc] initWithData:addressJSONData encoding:NSUTF8StringEncoding] forKey:@"JSONString"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/address/shipping", invoice_id];
    NSString *responseString = [ZBHTTPClient putUrl:urlString QueryParameter: queryParam RequestBody: requestParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(ZBTemplateList *) getInvoiceTemplates
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingString:@"/templates"];
    NSString *responseString = [ZBHTTPClient getUrl: urlString QueryParameter: queryParam];

    return [ZBInvoiceParser getInvoiceTemplates: responseString];
}

-(NSString *) updateInvoiceTemplate:(NSString *)invoice_id :(NSString *)template_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];

    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];
    [requestParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/templates/%@", invoice_id, template_id];
    NSString *responseString = [ZBHTTPClient putUrl:urlString QueryParameter: queryParam RequestBody: requestParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(ZBInvoicePaymentList *)getInvoicePayments:(NSString *)invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/payments", invoice_id];
    NSString *responseString = [ZBHTTPClient getUrl: urlString QueryParameter: queryParam];

    return [ZBInvoiceParser getInvoicePayments: responseString];
}

-(ZBInvoiceCreditList *) getInvoicesCredits:(NSString *)invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/creditsapplied", invoice_id];
    NSString *responseString = [ZBHTTPClient getUrl: urlString QueryParameter: queryParam];

    return [ZBInvoiceParser getInvoicesCredits: responseString];
}

-(NSMutableDictionary *)applyCredits:(NSString *)invoice_id :(NSMutableArray *)invoice_payments :(NSMutableArray *)invoice_credits
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];
    [requestParam setValue:_organizationID forKey:@"organization_id"];

    NSMutableDictionary *requestBody = [[NSMutableDictionary alloc] init];
    if(invoice_payments != nil && [invoice_payments count] > 0)
    {
        NSMutableArray *invoicePaymentArray = [[NSMutableArray alloc] init];
        for(ZBInvoicePayment *invoicePayment in invoice_payments)
        {
            [invoicePaymentArray addObject:[invoicePayment toJSON]];
        }
        [requestBody setValue: invoicePaymentArray forKey:@"invoice_payments"];
    }
    if(invoice_credits != nil && [invoice_credits count] > 0)
    {
        NSMutableArray *invoiceCreditArray = [[NSMutableArray alloc] init];
        for(ZBInvoiceCredit *invoiceCredit in invoice_credits)
        {
            [invoiceCreditArray addObject:[invoiceCredit toJSON]];
        }
        [requestBody setValue: invoiceCreditArray forKey:@"apply_creditnotes"];
    }
    if([requestBody count] > 0)
    {
        NSError *error;
        NSData *bodyData = [NSJSONSerialization dataWithJSONObject: requestBody options:0 error:&error];
        [requestParam setValue:[[NSString alloc] initWithData: bodyData encoding:NSUTF8StringEncoding] forKey:@"JSONString"];
    }

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/credits", invoice_id];
    NSString *responseString = [ZBHTTPClient postUrl: urlString QueryParameter: queryParam RequestBody: requestParam];

    return [ZBInvoiceParser getAppliedCredits: responseString];
}

-(NSString *)deletePayment:(NSString *)invoice_id :(NSString *)invoice_payment_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/payments/%@", invoice_id, invoice_payment_id];
    NSString *responseString = [ZBHTTPClient deleteUrl: urlString QueryParameter: queryParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(NSString *)deleteAppliedCredit:(NSString *)invoice_id :(NSString *)creditnotes_invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/creditsapplied/%@", invoice_id, creditnotes_invoice_id];
    NSString *responseString = [ZBHTTPClient deleteUrl: urlString QueryParameter: queryParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(NSFileWrapper *)getInvoiceAttachment:(NSString *)invoice_id :(BOOL)preview
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];
    [queryParam setValue:(preview)?@"true":@"false" forKey:@"preview"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/attachment", invoice_id];

    return [ZBHTTPClient getFileFromUrl: urlString QueryParameter: queryParam];
}

-(NSString *)addAttachment:(NSString *)invoice_id :(BOOL)can_send_in_mail :(NSString *)fileFullPath
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];

    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];
    [requestParam setValue:(can_send_in_mail)?@"true":@"false" forKey:@"can_send_in_mail"];

    NSMutableDictionary *attachmentParam = [[NSMutableDictionary alloc] init];
    if(fileFullPath != nil && ![fileFullPath isEqual:@""])
    {
        [attachmentParam setValue:(NSMutableArray *)@[fileFullPath] forKey:@"attachment"];
    }

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/attachment", invoice_id];
    NSString *responseString = [ZBHTTPClient postUrl:urlString QueryParameter: queryParam RequestBody: requestParam Files: attachmentParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(NSString *)updateAttachmentPreference:(NSString *)invoice_id :(BOOL)can_send_in_mail
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];
    [requestParam setValue:_organizationID forKey:@"organization_id"];
    [requestParam setValue:(can_send_in_mail)?@"true":@"false" forKey:@"can_send_in_mail"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/attachment", invoice_id];
    NSString *responseString = [ZBHTTPClient putUrl: urlString QueryParameter: queryParam RequestBody: requestParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(NSString *)deleteAttachment:(NSString *)invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/attachment", invoice_id];
    NSString *responseString = [ZBHTTPClient deleteUrl: urlString QueryParameter: queryParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(NSString *)deleteExpenseReceipt:(NSString *)expense_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/expenses/%@/receipt", expense_id];
    NSString *responseString = [ZBHTTPClient deleteUrl: urlString QueryParameter: queryParam];

    return [ZBCommonParser getResponseMessgage: responseString];
}

-(ZBCommentList *) getComments:(NSString *) invoice_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/comments", invoice_id];
    NSString *responseString = [ZBHTTPClient getUrl: urlString QueryParameter: queryParam];

    return [ZBCommonParser getComments: responseString];
}

-(ZBComment *) addComment:(NSString *)invoice_id :(NSString *)description :(NSString *) payment_expected_date :(BOOL)show_comment_to_clients
{
    NSError *error;
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];

    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];
    [requestParam setValue:_organizationID forKey:@"organization_id"];

    NSMutableDictionary *bodyParam = [[NSMutableDictionary alloc] init];
    [bodyParam setValue:description forKey:@"description"];
    [bodyParam setValue:payment_expected_date forKey:@"payment_expected_date"];
    [bodyParam setValue:@(show_comment_to_clients) forKey:@"show_comment_to_clients"];

    NSData *bodyData = [NSJSONSerialization dataWithJSONObject: bodyParam options:0 error:&error];
    [requestParam setValue:[[NSString alloc] initWithData: bodyData encoding:NSUTF8StringEncoding] forKey:@"JSONString"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/comments", invoice_id];
    NSString *responseString = [ZBHTTPClient postUrl: urlString QueryParameter: queryParam RequestBody: requestParam];

    return [ZBCommonParser getComment: responseString];
}

-(ZBComment *) updateComment:(NSString *)invoice_id :(NSString *)comment_id :(NSString *)description :(BOOL)show_comment_to_clients
{
    NSError *error;
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];

    NSMutableDictionary *requestParam = [[NSMutableDictionary alloc] init];
    [requestParam setValue:_organizationID forKey:@"organization_id"];

    NSMutableDictionary *bodyParam = [[NSMutableDictionary alloc] init];
    [bodyParam setValue:description forKey:@"description"];
    [bodyParam setValue:@(show_comment_to_clients) forKey:@"show_comment_to_clients"];

    NSData *bodyData = [NSJSONSerialization dataWithJSONObject: bodyParam options:0 error:&error];
    [requestParam setValue:[[NSString alloc] initWithData: bodyData encoding:NSUTF8StringEncoding] forKey:@"JSONString"];

    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/comments/%@", invoice_id, comment_id];
    NSString *responseString = [ZBHTTPClient putUrl: urlString QueryParameter: queryParam RequestBody: requestParam];

    return [ZBCommonParser getComment: responseString];
}

-(NSString *) deleteComment:(NSString *)invoice_id :(NSString *)comment_id
{
    NSMutableDictionary *queryParam = [[NSMutableDictionary alloc] init];
    [queryParam setValue:_authToken forKey:@"authtoken"];
    [queryParam setValue:_organizationID forKey:@"organization_id"];
    NSString *urlString = [invoiceURL stringByAppendingFormat:@"/%@/comments/%@", invoice_id, comment_id];
    NSString *responseString = [ZBHTTPClient deleteUrl:urlString QueryParameter: queryParam];

    return [ZBCommonParser getResponseMessgage:responseString];
}

@end


text:
<?xml version="1.0" encoding="UTF-8"?>

<rootTag>
  <Award>
    <AwardTitle>Graduate research Fellowship Program (GRFP)</AwardTitle>
    <AwardEffectiveDate>08/01/2016</AwardEffectiveDate>
    <AwardExpirationDate>07/31/2021</AwardExpirationDate>
    <AwardAmount>46000</AwardAmount>
    <AwardInstrument>
      <Value>Fellowship</Value>
    </AwardInstrument>
    <Organization>
      11010101
      <Directorate>
        <LongName>Direct For Education and Human Resources</LongName>
      </Directorate>
      <Division>
        <LongName>Division Of Graduate Education</LongName>
      </Division>
    </Organization>
    <ProgramOfficer>
      <SignBlockName>Gisele T. Muller-Parker</SignBlockName>
    </ProgramOfficer>
    <AbstractNarration>The National Science Foundation (NSF) Graduate Research Fellowship Program (GRFP) is a highly competitive, federal fellowship program. GRFP helps ensure the vitality and diversity of the scientific and engineering workforce of the United States. The program recognizes and supports outstanding graduate students who are pursuing research-based master's and doctoral degrees in science, technology, engineering, and mathematics (STEM) and in STEM education. The GRFP provides three years of financial support for the graduate education of individuals who have demonstrated their potential for significant research achievements in STEM and STEM education. This award supports the NSF Graduate Fellows pursuing graduate education at this GRFP institution.</AbstractNarration>
    <MinAmdLetterDate>07/18/2016</MinAmdLetterDate>
    <MaxAmdLetterDate>07/18/2016</MaxAmdLetterDate>
    <ARRAAmount/>
    <AwardID>1645420</AwardID>
    <Investigator>
      <FirstName>James</FirstName>
      <LastName>Quick</LastName>
      <EmailAddress>jquick@smu.edu</EmailAddress>
      <StartDate>07/18/2016</StartDate>
      <EndDate/>
      <RoleCode>Principal Investigator</RoleCode>
    </Investigator>
    <Institution>
      <Name>Southern Methodist University</Name>
      <CityName>Dallas</CityName>
      <ZipCode>752750302</ZipCode>
      <PhoneNumber>2147682030</PhoneNumber>
      <StreetAddress>6425 BOAZ</StreetAddress>
      <CountryName>United States</CountryName>
      <StateName>Texas</StateName>
      <StateCode>TX</StateCode>
    </Institution>
    <ProgramElement>
      7172
      <Text>GRADUATE RESEARCH FELLOWSHIPS</Text>
    </ProgramElement>
    <ProgramReference>
      7172
      <Text>GRADUATE FELLOWSHIPS</Text>
    </ProgramReference>
    <ProgramReference>
      9179
      <Text>GRADUATE INVOLVEMENT</Text>
    </ProgramReference>
    <ProgramReference>
      SMET
      <Text>SCIENCE, MATH, ENG & TECH EDUCATION</Text>
    </ProgramReference>
  </Award>
</rootTag>


text:
Hourglass is a framework for incrementally processing partitioned data sets in Hadoop.

## Quick Start Example

Let's walk through a use case where Hourglass is helpful.  Suppose that we have a website that tracks a particular event,
and for each event a member ID is recorded.  These events are collected and stored in HDFS in Avro under paths having the
format /data/event/yyyy/MM/dd.  Suppose for this example our Avro schema is:

```json
{
  "type" : "record",
  "name" : "ExampleEvent",
  "namespace" : "datafu.hourglass.test",
  "fields" : [ {
    "name" : "id",
    "type" : "long",
    "doc" : "ID"
  } ]
}
```

Suppose that the goal is to count how many times this event has occurred per member over the entire history and produce
a daily report summarizing these counts.  One solution is to simply consume all data under /data/event each day and
aggregate by member ID.  However, most of the data is the same day to day.  The only difference is that each day a new
day of data appears in HDFS.  So while this solution works, it is wasteful.  Wouldn't it be better if we could merge
the previous result with the new data?  With Hourglass you can.

To continue our example, let's say there are two days of data currently available, 2013/03/15 and 2013/03/16, and that
their contents are:

```
2013/03/15:
{"id": 1}
{"id": 1}
{"id": 1}
{"id": 2}
{"id": 3}
{"id": 3}

2013/03/16:
{"id": 1}
{"id": 1}
{"id": 2}
{"id": 2}
{"id": 3}
```

Let's aggregate the counts by member ID using Hourglass.  To perform the aggregation we will use `PartitionCollapsingIncrementalJob`,
which essentially takes a partitioned data set like the one we have and collapses all the partitions together into a single output.

```Java
PartitionCollapsingIncrementalJob job = new PartitionCollapsingIncrementalJob(Example.class);
```

Next we will define the schemas for the key and value used by the job.  The key affects how data is grouped in the reducer when
we perform the aggregation.  In this case it will be the member ID.  The value is the piece of data being aggregated, which will
be an integer representing the count in this case.  Hourglass uses Avro for its data types.  Let's define the schemas:

```Java
final String namespace = "com.example";

final Schema keySchema = Schema.createRecord("Key",null,namespace,false);
keySchema.setFields(Arrays.asList(new Field("member_id",Schema.create(Type.LONG),null,null)));
final String keySchemaString = keySchema.toString(true);

final Schema valueSchema = Schema.createRecord("Value",null,namespace,false);
valueSchema.setFields(Arrays.asList(new Field("count",Schema.create(Type.INT),null,null)));
final String valueSchemaString = valueSchema.toString(true);
```

This produces schemas having the following representation:

```json
{
  "type" : "record",
  "name" : "Key",
  "namespace" : "com.example",
  "fields" : [ {
    "name" : "member_id",
    "type" : "long"
  } ]
}

{
  "type" : "record",
  "name" : "Value",
  "namespace" : "com.example",
  "fields" : [ {
    "name" : "count",
    "type" : "int"
  } ]
}
```

Now we can tell the job what our schemas are.  Hourglass allows two different value types.  One is the intermediate value type
that is output by the mapper and combiner.  The other is the output value type, the output of the reducer.  In this case we
will use the same value type for each.

```Java
job.setKeySchema(keySchema);
job.setIntermediateValueSchema(valueSchema);
job.setOutputValueSchema(valueSchema);
```

Next we will tell Hourglass where to find the data, where to write the data, and that we want to reuse the previous output.

```Java
job.setInputPaths(Arrays.asList(new Path("/data/event")));
job.setOutputPath(new Path("/output"));
job.setReusePreviousOutput(true);
```

Now let's get into some application logic.  The mapper will produce a key-value pair from each record consisting of
the member ID and a count, which for each input record will just be `1`.

```Java
job.setMapper(new Mapper<GenericRecord,GenericRecord,GenericRecord>()
{
  private transient Schema kSchema;
  private transient Schema vSchema;

  @Override
  public void map(GenericRecord input,
                  KeyValueCollector<GenericRecord, GenericRecord> collector) throws IOException,
      InterruptedException
  {
    if (kSchema == null) kSchema = new Schema.Parser().parse(keySchemaString);
    if (vSchema == null) vSchema = new Schema.Parser().parse(valueSchemaString);
    GenericRecord key = new GenericData.Record(kSchema);
    key.put("member_id", input.get("id"));
    GenericRecord value = new GenericData.Record(vSchema);
    value.put("count", 1);
    collector.collect(key,value);
  }
});
```

An accumulator is responsible for aggregating this data.  Records will be grouped by member and then passed to the accumulator
one-by-one.  The accumulator keeps a running count and adds each input count to it.  When all data has been passed to it
the `getFinal()` method will be called, which returns the output record containing the count.

```Java
job.setReducerAccumulator(new Accumulator<GenericRecord,GenericRecord>()
{
  private transient int count;
  private transient Schema vSchema;

  @Override
  public void accumulate(GenericRecord value)
  {
    this.count += (Integer)value.get("count");
  }

  @Override
  public GenericRecord getFinal()
  {
    if (vSchema == null) vSchema = new Schema.Parser().parse(valueSchemaString);
    GenericRecord output = new GenericData.Record(vSchema);
    output.put("count", count);
    return output;
  }

  @Override
  public void cleanup()
  {
    this.count = 0;
  }
});
```

Since the intermediate and output values have the same schema, the accumulator can also be used for the combiner,
so let's indicate that we want it to be used for that:

```Java
job.setCombinerAccumulator(job.getReducerAccumulator());
job.setUseCombiner(true);
```

Finally, we run the job.

```Java
job.run();
```

When we inspect the output we find that the counts match what we expect:

```
{"key": {"member_id": 1}, "value": {"count": 5}}
{"key": {"member_id": 2}, "value": {"count": 3}}
{"key": {"member_id": 3}, "value": {"count": 3}}
```

Now suppose that a new day of data becomes available:

```
2013/03/17:
{"id": 1}
{"id": 1}
{"id": 2}
{"id": 2}
{"id": 2}
{"id": 3}
{"id": 3}
```

Let's run the job again.
Since Hourglass already has a result for the previous day, it consumes the new day of input and the previous output, rather
than all the input data it already processed.  The previous output is passed to the accumulator implementation where it is
aggregated with the new data.  This produces the output we expect:

```json
{"key": {"member_id": 1}, "value": {"count": 7}}
{"key": {"member_id": 2}, "value": {"count": 6}}
{"key": {"member_id": 3}, "value": {"count": 5}}
```

In this example we only have a few days of input data, so the impact of incrementally processing the new data is small.
However, as the size of the input data grows, the benefit of incrementally processing data becomes very significant.

## Motivation

Data sets that are temporal in nature very often are stored in such a way that each directory corresponds to a separate
time range.  For example, one convention could be to divide the data by day.  One benefit of a partitioning scheme such
as this is that it makes it possible to consume a subset of the data for specific time ranges, instead of consuming
the entire data set.

Very often computations on data such as this are performed daily over sliding windows.  For example, a metric of interest
may be the last time each member logged into the site.  The most straightforward implementation is to consume all login events
across all days.  This is inefficient however since day-to-day the input data is mostly the same.
A more efficient solution is to merge the previous output with new data since the last run.  As a result there is less
data to process.  Another metric of interest may be the number of pages viewed per member over the last 30 days.
A straightforward implementation is to consume the page view data over the last 30 days each time the job runs.
However, again, the input data is mostly the same day-to-day.
Instead, given the previous output of the job, the new output can be produced by adding the new data and subtracting the old data.

Although these incremental jobs are conceptually easy to understand, the implementations can be complex.
Hourglass defines an easy-to-use programming model and provides jobs for incrementally processing partitioned data as just described.
It handles the underlying details and complexity of an incremental system so that programmers can focus on
application logic.

## Capabilities

Hourglass uses Avro for input, intermediate, and output data.  Input data must be partitioned by day according to the
naming convention yyyy/MM/dd.  Joining multiple inputs is supported.

Hourglass provides two types of jobs: partition-preserving and partition-collapsing.  A *partition-preserving* job
consumes input data partitioned by day and produces output data partitioned by day. This is equivalent to running a
MapReduce job for each individual day of input data, but much more efficient.  It compares the input data against
the existing output data and only processes input data with no corresponding output. A *partition-collapsing* job
consumes input data partitioned by day and produces a single output.  What distinguishes this job from a standard
MapReduce job is that it can reuse the previous output.  This enables it to process data much more efficiently.
Rather than consuming all input data on each run, it can consume only the new data since the previous run and
merges it with the previous output.  Since the partition-preserving job output partitioned data, the two jobs
can be chained together.

Given these two jobs, processing data over sliding windows can be done much more efficiently.  There are two types
of sliding windows that are of particular interest that can be implemented using Hourglass.
A *fixed-start* sliding window has a start date that remains the same over multiple runs and an end date that is
flexible, where the end date advances forward as new input data becomes available.
A *fixed-length* sliding window has a window length that remains the same over multiple runs and flexible start
and end dates, where the start and end advance forward as new input data becomes available.
Hourglass makes defining these sliding windows easy.

An example of a fixed-start sliding window problem is computing the last login time for all members of a website
using a login event that records the login time.  This could be solved efficiently by using a partition-collapsing
job, which is capable of reusing the previous output and merging it with new login data as it arrives.

An example of a fixed-length sliding window problem is computing the pages viewed per member of the last 30 days
using a page-view event.  This could also be solved efficiently using a partition-collapsing job, which is
capable of reusing the previous output and merging it with the new page-view data while subtracting off the old
page-view data.

For some problems it is not possible to subtract off the oldest day of data for a fixed-length sliding window problem.
For example, suppose the goal is to estimate the distinct number of members who have logged into a website in the last
30 days using a login event that records the member ID.  A HyperLogLog counter could be used to estimate the cardinality.
The internal data for this counter could be serialized to bytes and stored as output alongside the estimated count.
However, although multiple HyperLogLog counters can be merged together, they cannot be subtracted or unmerged.
In other words the operation is not reversible.  So a partition-collapsing job by itself could not be used.
However we could chain together a partition-preserving and partition-collapsing job.  The first job would estimate cardinality
per day and store the value with the counter's byte representation.  The second job would merge the per day counters
together to produce the estimate over the full 30 day window.  This makes the computation extremely efficient.

## Programming Model

To implement an incremental job, a developer must specify Avro schemas for the key, intermediate value, and output value types.
The key and intermediate value types are used for the output of the mapper and an optional combiner.  The key and output value
types are used for the output of the reducer.  The input schemas are automatically determined by the job by inspecting the
input data.

A developer must also define their application logic through interfaces that are based on the MapReduce programming model.
The mapper is defined through a *Mapper* interface, which given a record produces zero or more key-value pairs.
The key-value pairs must conform to the key and intermediate value schemas just mentioned.

Reduce is defined through an *Accumulator* interface, which is passed all the records for a given key and then returns
the final result.  Both the combiner and reducer use an Accumulator for the reduce functionality.
This is similar to the standard reduce function of MapReduce.  The key difference is that
no more than one record can be returned.  The input records to the Accumulator are of the intermediate value type;
the ouput is of the output value type.

If the intermediate and output value types are the same then the Accumulator can
naturally be used to merge the new input data with the previous output.  However if they are different then a class implementing
the *Merge* interface must be provided.  Merge is a a binary operation on two records of the output value type that returns a
record as a result.

The other case where an implementation of Merge must be provided is when output is reused for a partition-collapsing job
over a fixed-length sliding window.  Merge in this case is used to essentially subtract old output from the current output.

## Contribute

The source code is available under the Apache 2.0 license.  Contributions are welcome.


text:
package com.intersys.bolt;

	// Begin imports

import static org.junit.Assert.fail;

import java.io.ByteArrayOutputStream;
import java.io.ObjectOutputStream;
import java.util.HashMap;

import org.junit.Test;

import backtype.storm.task.OutputCollector;

import com.intersys.bean.*;
import com.intersys.mock.*;

	// End imports

public class NewAccountProcessorBoltTest  {

		// Begin declarations

		// End declarations

	@Test
	public void testSerialization() {

//		try {
//			new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(new NewAccountProcessorBolt() );
//		} catch (Throwable t) {
//			fail("Class NewAccountProcessorBoltLogic is not serializable");
//		}

	}

	@Test
	public void testReadFromNewAccounts() {

		// Begin testReadFromNewAccounts logic

//		HashMap<String,Object> config = new HashMap<String,Object>();
//		MockedBoltOutputCollector collector = new MockedBoltOutputCollector();
//
//		MockedTuple tuple = new MockedTuple("NewAccounts", Account.sample().asValues());
//		NewAccountProcessorBolt bolt = new NewAccountProcessorBolt();

//		bolt.prepare(config,null,new OutputCollector(collector));
//		bolt.execute(tuple);
//		bolt.cleanup()

			// Validate execution side effects by interrogating collector

		// End testReadFromNewAccounts logic

	}

// Begin custom methods

// End custom methods

}


text:
/**@file tmsrp_header_Content_Type.h
 * @brief MSRP header 'Content-Type'.
 *
 * @author Mamadou Diop <diopmamadou(at)doubango.org>
 *

 */
#ifndef _TMSRP_HEADER_CONTENT_TYPE_H_
#define _TMSRP_HEADER_CONTENT_TYPE_H_

#include "tinymsrp_config.h"
#include "tinymsrp/headers/tmsrp_header.h"

TMSRP_BEGIN_DECLS

#define TMSRP_HEADER_CONTENT_TYPE_VA_ARGS(type)			tmsrp_header_Content_Type_def_t, (const char*)type

////////////////////////////////////////////////////////////////////////////////////////////////////
/// @struct
///
/// @brief	MSRP header 'Content-Type'.
/// @author	Mamadou
/// @date	12/3/2009
///
/// @par ABNF= Content-Type	=  	 "Content-Type:" SP media-type
/// media-type	= 	type "/" subtype *( ";" gen-param )
/// type	= 	token
/// subtype	= 	token
/// gen-param	= 	pname [ "=" pval ]
/// pname	= 	token
/// pval	= 	token / quoted-string
///
////////////////////////////////////////////////////////////////////////////////////////////////////
typedef struct tmsrp_header_Content_Type_s
{
	TMSRP_DECLARE_HEADER;

	char* value;
	tsk_params_L_t *params;
}
tmsrp_header_Content_Type_t;

TINYMSRP_API tmsrp_header_Content_Type_t* tmsrp_header_Content_Type_create(const char* type);
TINYMSRP_API tmsrp_header_Content_Type_t* tmsrp_header_Content_Type_create_null();

TINYMSRP_API tmsrp_header_Content_Type_t *tmsrp_header_Content_Type_parse(const char *data, tsk_size_t size);

TINYMSRP_GEXTERN const tsk_object_def_t *tmsrp_header_Content_Type_def_t;

TMSRP_END_DECLS

#endif /* _TMSRP_HEADER_CONTENT_TYPE_H_ */


text:
<resources>
    <declare-styleable name="ConstrainedFrameLayout">
        <attr name="worksRatioHorizontal" format="integer"/>
        <attr name="worksRatioVertical" format="integer"/>
        <attr name="worksKeep" format="enum">
            <enum name="width" value="1"/>
            <enum name="height" value="2"/>
        </attr>
    </declare-styleable>
    <declare-styleable name="AnimatedImageView">
        <attr name="worksAnim" format="reference"/>
    </declare-styleable>
</resources>


text:
import * as vscode from 'vscode';

import { diagramsOf } from '../diagram/tools';
import { exportDiagrams } from './exportDiagrams';

export interface FileAndFormat {
    uri: vscode.Uri;
    format: string;
}

/**
 * export diagrams of a vscode.Uri to file
 * @param file the uri and format to export.
 * @param bar display prcessing message in bar if it's given.
 * @returns Promise<Buffer[][]>. A promise of Buffer[digrams][pages] array
 */
export async function exportFile(file: FileAndFormat, bar?: vscode.StatusBarItem): Promise<Buffer[][]> {
    let doc = await vscode.workspace.openTextDocument(file.uri);
    let diagrams = diagramsOf(doc);
    if (!diagrams.length) return Promise.resolve(<Buffer[][]>[]);
    return exportDiagrams(diagrams, file.format, bar);
}


text:
;(function($){

    var objects = {};

    $.editlive.sync = function() {
        $('editlive').each(function(){
            var el = $(this);
            if (el.attr('app-label') && el.attr('module-name') && el.attr('field-name') && el.attr('object-id')) {
                var model = el.attr('app-label') +'.'+ el.attr('module-name');
                if (!objects[model]) objects[model] = [];
                objects[model].push({
                    app_label: el.attr('app-label'),
                    field_name: el.attr('field-name'),
                    //field_type: el.data('type'),
                    rendered_value: el.attr('rendered-value'),
                    object_id: el.attr('object-id'),
                    template_filters: el.attr('template_filters'),
                    module_name: el.attr('module-name'),
                    formset: el.attr('formset'),
                    value: $('#'+ el.data('field-id')).val()
                    //data: el.data()
                });
            }
        });
    };

    var synched = function(data) {
        console.log(data);
    }

    $.editlive.do_sync = function() {
        Dajaxice.editlive.sync(synched, objects);
    };

    $(function(){
        $.editlive.sync();
    });
})(jQuery);


text:
<?php
/**
 * @package    Sds
 * @license    MIT
 */
namespace Sds\DojoModule\Tools;

use Zend\Json\Json;

/**
 *
 * @since   1.0
 * @version $Revision$
 * @author  Tim Roediger <superdweebie@gmail.com>
 */
class ProfileGenerator
{
    public static function generate(array $config, $profilePath = null)
    {
        $buildConfig = $config['build'];
        $packages = array();

        foreach($buildConfig['packages'] as $name => $path){
            $packages[] = array(
                'name' => $name,
                'location' => $path
            );
        }

        $profile = $buildConfig;
        unset($profile['profilePath']);
        $profile['packages'] = $packages;

        $profile =Json::prettyPrint(Json::encode($profile));
        $profile = str_replace('<profile>', $profile, file_get_contents(__DIR__ . '/Profile.js.template'));

        if (!isset($profilePath)) {
            $profilePath = $buildConfig['profilePath'];
        }

        if (file_put_contents($profilePath, $profile)){
            return array($profile, $profilePath);
        } else {
            return array(null, $profilePath);
        }
    }
}


text:
\documentclass[a4paper]{article}
\usepackage[pdftex]{graphicx}
\usepackage{enumitem}
\setdescription{leftmargin=\parindent,labelindent=20mm}

\title{{\bf Medical Store Management System}\\Phase-4}
\author{Shikhar Sharma\\10682\\shikhars@iitk.ac.in\\\\CS315 Course Project\\IIT Kanpur}

\begin{document}

\maketitle
\tableofcontents

\newpage
\section{Implementation Details}
	The project has been implemented using PHP and MySQL. The front end starts with a login screen. Thee roles have been created as described in the previous reports. The details of each of these are given below.
	\subsection{Receptionist}
		The receptionist is allowed to carry out purchase and sell transactions. For purchasing, the front-end requires the receptionist to fill out details regarding the medicine and supplier. The transacting receptionist's id is also recorded into the database. The fields have been marked as required and some even have a pattern matching mechanism implemented using HTML5 form validation instead of using JavaScript. For selling, the receptionist can select a maximum of five medicines per bill using a drop down list. This maximum limit was just set by me and can easily be changed to meet the store's needs.
	\subsection{Owner}
		The owner's front-end first displays the contents of some of the database tables which are relevant to the owner. He can get the store inventory information using these tables. He can see detailed information about an order/sale by viewing its bill. Also, he can view the store's profit between two selected dates.
	\subsection{Administrator}
		The administrator's front end allows him to directly run queries on the database.

\section{Changes To Previous Phases' Reports}
	\subsection{Phase 1}
		Logging has not been implemented in the project. The functions of the roles have been changed suitably in some places so that the system remains tamper-proof. This has been done assuming that the administrator knows all the passwords and that the owner also knows all the passwords with perhaps the exception of the administrator's.
	\subsection{Phase 2}
		In the table Medicine, 'buy\_timestamp' and 'expiry\_date' have also been added to the primary key.
	\subsection{Phase 3}
		No changes have been made to Phase 3.

\section{Previous Reports}
	The previous reports have also been kept in this folder for reference.
\end{document}