text:
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

function main(
  datasetId = 'my_dataset', // Existing dataset ID
  tableId = 'my_existing_view' // Existing view ID
) {
  // [START bigquery_update_view_query]
  // Import the Google Cloud client library and create a client
  const {BigQuery} = require('@google-cloud/bigquery');
  const bigquery = new BigQuery();

  async function updateViewQuery() {
    // Updates a view named "my_existing_view" in "my_dataset".

    /**
     * TODO(developer): Uncomment the following lines before running the sample.
     */
    // const datasetId = "my_existing_dataset"
    // const tableId = "my_existing_table"
    const dataset = await bigquery.dataset(datasetId);

    // This example updates a view into the USA names dataset to include state.
    const newViewQuery = `SELECT name, state
    FROM \`bigquery-public-data.usa_names.usa_1910_current\`
    LIMIT 10`;

    // Retrieve existing view
    const [view] = await dataset.table(tableId).get();

    // Retrieve existing view metadata
    const [metadata] = await view.getMetadata();

    // Update view query
    metadata.view = newViewQuery;

    // Set metadata
    await view.setMetadata(metadata);

    console.log(`View ${tableId} updated.`);
  }
  // [END bigquery_update_view_query]
  updateViewQuery();
}
main(...process.argv.slice(2));


text:
package ru.stqa.pft.sandbox;

/**
 * Created by admin on 19.11.2016.
 */
public class Square {

    public double l;

    public Square(double l){
        this.l=l;
    }
    public double area(){
        return this.l*this.l;
    }
}

redpajama_set_name: RedPajamaGithub


text: An in-memory library. INE5603/UFSC


text:
.class final Landroid/graphics/drawable/GradientDrawable$GradientState;
.super Landroid/graphics/drawable/Drawable$ConstantState;
.source "GradientDrawable.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/graphics/drawable/GradientDrawable;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x18
    name = "GradientState"
.end annotation

# instance fields
.field private mCenterX:F

.field private mCenterY:F

.field public mChangingConfigurations:I

.field public mColors:[I

.field public mGradient:I

.field private mGradientRadius:F

.field public mHasSolidColor:Z

.field public mHeight:I

.field public mInnerRadius:I

.field public mInnerRadiusRatio:F

.field public mOrientation:Landroid/graphics/drawable/GradientDrawable$Orientation;

.field public mPadding:Landroid/graphics/Rect;

.field public mPositions:[F

.field public mRadius:F

.field public mRadiusArray:[F

.field public mShape:I

.field public mSolidColor:I

.field public mStrokeColor:I

.field public mStrokeDashGap:F

.field public mStrokeDashWidth:F

.field public mStrokeWidth:I

.field public mTempColors:[I

.field public mTempPositions:[F

.field public mThickness:I

.field public mThicknessRatio:F

.field private mUseLevel:Z

.field private mUseLevelForShape:Z

.field public mWidth:I

# direct methods
.method constructor <init>()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    const/4 v1, -0x1

    const/high16 v0, 0x3f00

    .line 916
    invoke-direct {p0}, Landroid/graphics/drawable/Drawable$ConstantState;-><init>()V

    .line 887
    iput v2, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mShape:I

    .line 888
    iput v2, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mGradient:I

    .line 896
    iput v1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeWidth:I

    .line 903
    iput v1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mWidth:I

    .line 904
    iput v1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mHeight:I

    .line 909
    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mCenterX:F

    .line 910
    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mCenterY:F

    .line 911
    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mGradientRadius:F

    .line 917
    sget-object v0, Landroid/graphics/drawable/GradientDrawable$Orientation;->TOP_BOTTOM:Landroid/graphics/drawable/GradientDrawable$Orientation;

    iput-object v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mOrientation:Landroid/graphics/drawable/GradientDrawable$Orientation;

    .line 918
    return-void
.end method

.method public constructor <init>(Landroid/graphics/drawable/GradientDrawable$GradientState;)V
    .locals 3
    .parameter "state"

    .prologue
    const/4 v2, 0x0

    const/4 v1, -0x1

    const/high16 v0, 0x3f00

    .line 925
    invoke-direct {p0}, Landroid/graphics/drawable/Drawable$ConstantState;-><init>()V

    .line 887
    iput v2, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mShape:I

    .line 888
    iput v2, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mGradient:I

    .line 896
    iput v1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeWidth:I

    .line 903
    iput v1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mWidth:I

    .line 904
    iput v1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mHeight:I

    .line 909
    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mCenterX:F

    .line 910
    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mCenterY:F

    .line 911
    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mGradientRadius:F

    .line 926
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mChangingConfigurations:I

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mChangingConfigurations:I

    .line 927
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mShape:I

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mShape:I

    .line 928
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mGradient:I

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mGradient:I

    .line 929
    iget-object v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mOrientation:Landroid/graphics/drawable/GradientDrawable$Orientation;

    iput-object v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mOrientation:Landroid/graphics/drawable/GradientDrawable$Orientation;

    .line 930
    iget-object v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mColors:[I

    if-eqz v0, :cond_0

    .line 931
    iget-object v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mColors:[I

    invoke-virtual {v0}, [I->clone()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [I

    iput-object v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mColors:[I

    .line 933
    :cond_0
    iget-object v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mPositions:[F

    if-eqz v0, :cond_1

    .line 934
    iget-object v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mPositions:[F

    invoke-virtual {v0}, [F->clone()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [F

    iput-object v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mPositions:[F

    .line 936
    :cond_1
    iget-boolean v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mHasSolidColor:Z

    iput-boolean v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mHasSolidColor:Z

    .line 937
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mSolidColor:I

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mSolidColor:I

    .line 938
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeWidth:I

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeWidth:I

    .line 939
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeColor:I

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeColor:I

    .line 940
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeDashWidth:F

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeDashWidth:F

    .line 941
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeDashGap:F

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeDashGap:F

    .line 942
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mRadius:F

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mRadius:F

    .line 943
    iget-object v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mRadiusArray:[F

    if-eqz v0, :cond_2

    .line 944
    iget-object v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mRadiusArray:[F

    invoke-virtual {v0}, [F->clone()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [F

    iput-object v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mRadiusArray:[F

    .line 946
    :cond_2
    iget-object v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mPadding:Landroid/graphics/Rect;

    if-eqz v0, :cond_3

    .line 947
    new-instance v0, Landroid/graphics/Rect;

    iget-object v1, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mPadding:Landroid/graphics/Rect;

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

    iput-object v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mPadding:Landroid/graphics/Rect;

    .line 949
    :cond_3
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mWidth:I

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mWidth:I

    .line 950
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mHeight:I

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mHeight:I

    .line 951
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mInnerRadiusRatio:F

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mInnerRadiusRatio:F

    .line 952
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mThicknessRatio:F

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mThicknessRatio:F

    .line 953
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mInnerRadius:I

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mInnerRadius:I

    .line 954
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mThickness:I

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mThickness:I

    .line 955
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mCenterX:F

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mCenterX:F

    .line 956
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mCenterY:F

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mCenterY:F

    .line 957
    iget v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mGradientRadius:F

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mGradientRadius:F

    .line 958
    iget-boolean v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mUseLevel:Z

    iput-boolean v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mUseLevel:Z

    .line 959
    iget-boolean v0, p1, Landroid/graphics/drawable/GradientDrawable$GradientState;->mUseLevelForShape:Z

    iput-boolean v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mUseLevelForShape:Z

    .line 960
    return-void
.end method

.method constructor <init>(Landroid/graphics/drawable/GradientDrawable$Orientation;[I)V
    .locals 3
    .parameter "orientation"
    .parameter "colors"

    .prologue
    const/4 v2, 0x0

    const/4 v1, -0x1

    const/high16 v0, 0x3f00

    .line 920
    invoke-direct {p0}, Landroid/graphics/drawable/Drawable$ConstantState;-><init>()V

    .line 887
    iput v2, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mShape:I

    .line 888
    iput v2, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mGradient:I

    .line 896
    iput v1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeWidth:I

    .line 903
    iput v1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mWidth:I

    .line 904
    iput v1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mHeight:I

    .line 909
    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mCenterX:F

    .line 910
    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mCenterY:F

    .line 911
    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mGradientRadius:F

    .line 921
    iput-object p1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mOrientation:Landroid/graphics/drawable/GradientDrawable$Orientation;

    .line 922
    iput-object p2, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mColors:[I

    .line 923
    return-void
.end method

.method static synthetic access$000(Landroid/graphics/drawable/GradientDrawable$GradientState;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 885
    iget-boolean v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mUseLevel:Z

    return v0
.end method

.method static synthetic access$002(Landroid/graphics/drawable/GradientDrawable$GradientState;Z)Z
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 885
    iput-boolean p1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mUseLevel:Z

    return p1
.end method

.method static synthetic access$100(Landroid/graphics/drawable/GradientDrawable$GradientState;)Z
    .locals 1
    .parameter "x0"

    .prologue
    .line 885
    iget-boolean v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mUseLevelForShape:Z

    return v0
.end method

.method static synthetic access$102(Landroid/graphics/drawable/GradientDrawable$GradientState;Z)Z
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 885
    iput-boolean p1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mUseLevelForShape:Z

    return p1
.end method

.method static synthetic access$200(Landroid/graphics/drawable/GradientDrawable$GradientState;)F
    .locals 1
    .parameter "x0"

    .prologue
    .line 885
    iget v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mCenterX:F

    return v0
.end method

.method static synthetic access$202(Landroid/graphics/drawable/GradientDrawable$GradientState;F)F
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 885
    iput p1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mCenterX:F

    return p1
.end method

.method static synthetic access$300(Landroid/graphics/drawable/GradientDrawable$GradientState;)F
    .locals 1
    .parameter "x0"

    .prologue
    .line 885
    iget v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mCenterY:F

    return v0
.end method

.method static synthetic access$302(Landroid/graphics/drawable/GradientDrawable$GradientState;F)F
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 885
    iput p1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mCenterY:F

    return p1
.end method

.method static synthetic access$400(Landroid/graphics/drawable/GradientDrawable$GradientState;)F
    .locals 1
    .parameter "x0"

    .prologue
    .line 885
    iget v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mGradientRadius:F

    return v0
.end method

.method static synthetic access$402(Landroid/graphics/drawable/GradientDrawable$GradientState;F)F
    .locals 0
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 885
    iput p1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mGradientRadius:F

    return p1
.end method

# virtual methods
.method public getChangingConfigurations()I
    .locals 1

    .prologue
    .line 974
    iget v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mChangingConfigurations:I

    return v0
.end method

.method public newDrawable()Landroid/graphics/drawable/Drawable;
    .locals 2

    .prologue
    .line 964
    new-instance v0, Landroid/graphics/drawable/GradientDrawable;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Landroid/graphics/drawable/GradientDrawable;-><init>(Landroid/graphics/drawable/GradientDrawable$GradientState;Landroid/graphics/drawable/GradientDrawable$1;)V

    return-object v0
.end method

.method public newDrawable(Landroid/content/res/Resources;)Landroid/graphics/drawable/Drawable;
    .locals 2
    .parameter "res"

    .prologue
    .line 969
    new-instance v0, Landroid/graphics/drawable/GradientDrawable;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Landroid/graphics/drawable/GradientDrawable;-><init>(Landroid/graphics/drawable/GradientDrawable$GradientState;Landroid/graphics/drawable/GradientDrawable$1;)V

    return-object v0
.end method

.method public setCornerRadii([F)V
    .locals 1
    .parameter "radii"

    .prologue
    .line 1017
    iput-object p1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mRadiusArray:[F

    .line 1018
    if-nez p1, :cond_0

    .line 1019
    const/4 v0, 0x0

    iput v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mRadius:F

    .line 1021
    :cond_0
    return-void
.end method

.method public setCornerRadius(F)V
    .locals 1
    .parameter "radius"

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

    cmpg-float v0, p1, v0

    if-gez v0, :cond_0

    .line 1010
    const/4 p1, 0x0

    .line 1012
    :cond_0
    iput p1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mRadius:F

    .line 1013
    const/4 v0, 0x0

    iput-object v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mRadiusArray:[F

    .line 1014
    return-void
.end method

.method public setGradientCenter(FF)V
    .locals 0
    .parameter "x"
    .parameter "y"

    .prologue
    .line 986
    iput p1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mCenterX:F

    .line 987
    iput p2, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mCenterY:F

    .line 988
    return-void
.end method

.method public setGradientRadius(F)V
    .locals 0
    .parameter "gradientRadius"

    .prologue
    .line 1029
    iput p1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mGradientRadius:F

    .line 1030
    return-void
.end method

.method public setGradientType(I)V
    .locals 0
    .parameter "gradient"

    .prologue
    .line 982
    iput p1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mGradient:I

    .line 983
    return-void
.end method

.method public setShape(I)V
    .locals 0
    .parameter "shape"

    .prologue
    .line 978
    iput p1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mShape:I

    .line 979
    return-void
.end method

.method public setSize(II)V
    .locals 0
    .parameter "width"
    .parameter "height"

    .prologue
    .line 1024
    iput p1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mWidth:I

    .line 1025
    iput p2, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mHeight:I

    .line 1026
    return-void
.end method

.method public setSolidColor(I)V
    .locals 1
    .parameter "argb"

    .prologue
    .line 991
    const/4 v0, 0x1

    iput-boolean v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mHasSolidColor:Z

    .line 992
    iput p1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mSolidColor:I

    .line 993
    const/4 v0, 0x0

    iput-object v0, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mColors:[I

    .line 994
    return-void
.end method

.method public setStroke(II)V
    .locals 0
    .parameter "width"
    .parameter "color"

    .prologue
    .line 997
    iput p1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeWidth:I

    .line 998
    iput p2, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeColor:I

    .line 999
    return-void
.end method

.method public setStroke(IIFF)V
    .locals 0
    .parameter "width"
    .parameter "color"
    .parameter "dashWidth"
    .parameter "dashGap"

    .prologue
    .line 1002
    iput p1, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeWidth:I

    .line 1003
    iput p2, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeColor:I

    .line 1004
    iput p3, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeDashWidth:F

    .line 1005
    iput p4, p0, Landroid/graphics/drawable/GradientDrawable$GradientState;->mStrokeDashGap:F

    .line 1006
    return-void
.end method


text:
package com.cadasta.murad.backend.processor.questionnaire;

import com.cadasta.murad.models.questionnaires.Questionnaire;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
 * Created by m-murad on 08/09/17.
 */

public class QuestionnaireResponseProcessor implements Callback<Questionnaire> {
    @Override
    public void onResponse(Call<Questionnaire> call, Response<Questionnaire> response) {

    }

    @Override
    public void onFailure(Call<Questionnaire> call, Throwable t) {

    }
}


text:
package com.zheng.pay.rpc.api;

import com.zheng.common.base.BaseService;
import com.zheng.pay.dao.model.PayPay;
import com.zheng.pay.dao.model.PayPayExample;

/**
* PayPayService接口
* Created by shuzheng on 2017/3/29.
*/
public interface PayPayService extends BaseService<PayPay, PayPayExample> {

}


text:
package com.amazonaws.services.directory.model;

import javax.annotation.Generated;

/**
 *
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum UpdateType {

    OS("OS");

    private String value;

    private UpdateType(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return UpdateType corresponding to the value
     *
     * @throws IllegalArgumentException
     *         If the specified value does not map to one of the known values in this enum.
     */
    public static UpdateType fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (UpdateType enumEntry : UpdateType.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
require 'pathname'
require Pathname.new(__FILE__).dirname.dirname.expand_path + 'corosync'

Puppet::Type.type(:cs_colocation).provide(:crm, :parent => Puppet::Provider::Corosync) do
  desc 'Specific provider for a rather specific type since I currently have no plan to
        abstract corosync/pacemaker vs. keepalived.  This provider will check the state
        of current primitive colocations on the system; add, delete, or adjust various
        aspects.'

  # Path to the crm binary for interacting with the cluster configuration.
  # Decided to just go with relative.
  commands :crm => 'crm'
  commands :crm_attribute => 'crm_attribute'

  def self.instances

    block_until_ready

    instances = []

    cmd = [ command(:crm), 'configure', 'show', 'xml' ]
    raw, status = Puppet::Util::SUIDManager.run_and_capture(cmd)
    doc = REXML::Document.new(raw)

    doc.root.elements['configuration'].elements['constraints'].each_element('rsc_colocation') do |e|
      items = e.attributes

      if items['rsc-role']
        rsc = "#{items['rsc']}:#{items['rsc-role']}"
      else
        rsc = items['rsc']
      end

      if items ['with-rsc-role']
        with_rsc = "#{items['with-rsc']}:#{items['with-rsc-role']}"
      else
        with_rsc = items['with-rsc']
      end

      # Sorting the array of primitives because order doesn't matter so someone
      # switching the order around shouldn't generate an event.
      colocation_instance = {
        :name       => items['id'],
        :ensure     => :present,
        :primitives => [rsc, with_rsc].sort,
        :score      => items['score'],
        :provider   => self.name
      }
      instances << new(colocation_instance)
    end
    instances
  end

  # Create just adds our resource to the property_hash and flush will take care
  # of actually doing the work.
  def create
    @property_hash = {
      :name       => @resource[:name],
      :ensure     => :present,
      :primitives => @resource[:primitives],
      :score      => @resource[:score],
      :cib        => @resource[:cib],
    }
  end

  # Unlike create we actually immediately delete the item.
  def destroy
    debug('Revmoving colocation')
    crm('configure', 'delete', @resource[:name])
    @property_hash.clear
  end

  # Getter that obtains the primitives array for us that should have
  # been populated by prefetch or instances (depends on if your using
  # puppet resource or not).
  def primitives
    @property_hash[:primitives]
  end

  # Getter that obtains the our score that should have been populated by
  # prefetch or instances (depends on if your using puppet resource or not).
  def score
    @property_hash[:score]
  end

  # Our setters for the primitives array and score.  Setters are used when the
  # resource already exists so we just update the current value in the property
  # hash and doing this marks it to be flushed.
  def primitives=(should)
    @property_hash[:primitives] = should.sort
  end

  def score=(should)
    @property_hash[:score] = should
  end

  # Flush is triggered on anything that has been detected as being
  # modified in the property_hash.  It generates a temporary file with
  # the updates that need to be made.  The temporary file is then used
  # as stdin for the crm command.
  def flush
    unless @property_hash.empty?
      updated = "colocation "
      updated << "#{@property_hash[:name]} #{@property_hash[:score]}: #{@property_hash[:primitives].join(' ')}"
      Tempfile.open('puppet_crm_update') do |tmpfile|
        tmpfile.write(updated)
        tmpfile.flush
        ENV["CIB_shadow"] = @resource[:cib]
        crm('configure', 'load', 'update', tmpfile.path.to_s)
      end
    end
  end
end


text:
package com.opengamma.financial.convention;

import static org.testng.Assert.assertEquals;

import java.util.Arrays;
import java.util.Collections;
import java.util.Set;

import org.testng.annotations.Test;

import com.opengamma.analytics.financial.instrument.annuity.CompoundingMethod;
import com.opengamma.analytics.financial.instrument.annuity.DateRelativeTo;
import com.opengamma.analytics.financial.instrument.annuity.OffsetType;
import com.opengamma.core.id.ExternalSchemes;
import com.opengamma.financial.AbstractBeanTestCase;
import com.opengamma.financial.convention.businessday.BusinessDayConvention;
import com.opengamma.financial.convention.businessday.BusinessDayConventions;
import com.opengamma.financial.convention.daycount.DayCount;
import com.opengamma.financial.convention.daycount.DayCounts;
import com.opengamma.financial.convention.frequency.Frequency;
import com.opengamma.financial.convention.frequency.SimpleFrequency;
import com.opengamma.financial.convention.rolldate.RollConvention;
import com.opengamma.financial.security.swap.FloatingRateType;
import com.opengamma.id.ExternalId;
import com.opengamma.id.ExternalIdBundle;
import com.opengamma.util.i18n.Country;
import com.opengamma.util.test.TestGroup;

/**
 * Tests for {@link FloatingInterestRateSwapLegConvention}.
 */
@Test(groups = TestGroup.UNIT)
public class FloatingInterestRateSwapLegConventionTest extends AbstractBeanTestCase {
  private static final String NAME = "name";
  private static final ExternalIdBundle EIDS = ExternalIdBundle.of("eid", "1");
  private static final Set<ExternalId> PAYMENT_CALENDARS = Collections.singleton(ExternalSchemes.countryRegionId(Country.US));
  private static final Set<ExternalId> CALCULATION_CALENDARS = Collections.singleton(ExternalSchemes.countryRegionId(Country.GB));
  private static final Set<ExternalId> MATURITY_CALENDARS = Collections.singleton(ExternalSchemes.countryRegionId(Country.EU));
  private static final BusinessDayConvention PAYMENT_BDC = BusinessDayConventions.FOLLOWING;
  private static final BusinessDayConvention CALCULATION_BDC = BusinessDayConventions.MODIFIED_FOLLOWING;
  private static final BusinessDayConvention MATURITY_BDC = BusinessDayConventions.MODIFIED_PRECEDING;
  private static final DayCount DC = DayCounts.ACT_360;
  private static final Frequency PAYMENT_FREQUENCY = SimpleFrequency.ANNUAL;
  private static final Frequency CALCULATION_FREQUENCY = SimpleFrequency.BIMONTHLY;
  private static final DateRelativeTo PAYMENT_RELATIVE_TO = DateRelativeTo.END;
  private static final boolean ADJUSTED_ACCRUAL = true;
  private static final int SETTLEMENT_DAYS = 2;
  private static final RollConvention ROLL_CONVENTION = RollConvention.EIGHT;
  private static final CompoundingMethod COMPOUNDING_METHOD = CompoundingMethod.FLAT;
  private static final FloatingRateType RATE_TYPE = FloatingRateType.IBOR;
  private static final Set<ExternalId> FIXING_CALENDARS = Collections.singleton(ExternalSchemes.countryRegionId(Country.AR));
  private static final BusinessDayConvention FIXING_BDC = BusinessDayConventions.PRECEDING;
  private static final OffsetType SETTLEMENT_DAY_TYPE = OffsetType.CALENDAR;
  private static final Frequency RESET_FREQUENCY = SimpleFrequency.BIWEEKLY;
  private static final Set<ExternalId> RESET_CALENDARS = Collections.singleton(ExternalSchemes.countryRegionId(Country.AU));
  private static final BusinessDayConvention RESET_BDC = BusinessDayConventions.NONE;
  private static final DateRelativeTo RESET_RELATIVE_TO = DateRelativeTo.END;
  private static final int PAYMENT_LAG = 3;
  private static final FloatingInterestRateSwapLegConvention CONVENTION = new FloatingInterestRateSwapLegConvention(NAME, EIDS, PAYMENT_CALENDARS,
      CALCULATION_CALENDARS, MATURITY_CALENDARS, PAYMENT_BDC, CALCULATION_BDC, MATURITY_BDC, DC, PAYMENT_FREQUENCY, CALCULATION_FREQUENCY, PAYMENT_RELATIVE_TO,
      ADJUSTED_ACCRUAL, SETTLEMENT_DAYS, ROLL_CONVENTION, COMPOUNDING_METHOD, RATE_TYPE, FIXING_CALENDARS, FIXING_BDC, SETTLEMENT_DAY_TYPE, RESET_FREQUENCY,
      RESET_CALENDARS, RESET_BDC, RESET_RELATIVE_TO, PAYMENT_LAG);

  @Override
  public JodaBeanProperties<FloatingInterestRateSwapLegConvention> getJodaBeanProperties() {
    return new JodaBeanProperties<>(FloatingInterestRateSwapLegConvention.class,
        Arrays.asList("name", "externalIdBundle", "paymentCalendars", "calculationCalendars", "maturityCalendars", "paymentDayConvention",
            "calculationBusinessDayConvention", "maturityBusinessDayConvention", "dayCountConvention", "paymentFrequency", "calculationFrequency",
            "paymentRelativeTo", "adjustedAccrual", "settlementDays", "rollConvention", "compoundingMethod", "rateType", "fixingCalendars",
            "fixingBusinessDayConvention", "settlementDayType", "resetFrequency", "resetCalendars", "resetBusinessDayConvention", "resetRelativeTo",
            "paymentLag"),
        Arrays.<Object> asList(NAME, EIDS, PAYMENT_CALENDARS, CALCULATION_CALENDARS, MATURITY_CALENDARS, PAYMENT_BDC, CALCULATION_BDC, MATURITY_BDC, DC,
            PAYMENT_FREQUENCY, CALCULATION_FREQUENCY, PAYMENT_RELATIVE_TO, ADJUSTED_ACCRUAL, SETTLEMENT_DAYS, ROLL_CONVENTION, COMPOUNDING_METHOD, RATE_TYPE,
            FIXING_CALENDARS, FIXING_BDC, SETTLEMENT_DAY_TYPE, RESET_FREQUENCY, RESET_CALENDARS, RESET_BDC, RESET_RELATIVE_TO, PAYMENT_LAG),
        Arrays.<Object> asList("other", ExternalIdBundle.of("eid", "2"), CALCULATION_CALENDARS, MATURITY_CALENDARS, PAYMENT_CALENDARS, CALCULATION_BDC,
            MATURITY_BDC, PAYMENT_BDC, DayCounts.ACT_365, CALCULATION_FREQUENCY, PAYMENT_FREQUENCY, DateRelativeTo.START, !ADJUSTED_ACCRUAL,
            SETTLEMENT_DAYS + 1, RollConvention.EIGHTEEN, CompoundingMethod.NONE, FloatingRateType.CMS, RESET_CALENDARS, RESET_BDC, OffsetType.BUSINESS,
            PAYMENT_FREQUENCY, FIXING_CALENDARS, FIXING_BDC, DateRelativeTo.START, PAYMENT_LAG + 1));
  }

  /**
   * Tests the returned type.
   */
  public void testType() {
    assertEquals(CONVENTION.getConventionType(), FloatingInterestRateSwapLegConvention.TYPE);
  }

  /**
   * Tests that the accept() method visits the right method.
   */
  public void testVisitor() {
    assertEquals(CONVENTION.accept(TestVisitor.INSTANCE), "visited");
  }

  /**
   *
   */
  private static final class TestVisitor extends FinancialConventionVisitorAdapter<String> {
    public static final TestVisitor INSTANCE = new TestVisitor();

    private TestVisitor() {
    }

    @Override
    public String visitFloatingInterestRateSwapLegConvention(final FloatingInterestRateSwapLegConvention convention) {
      return "visited";
    }

  }

}


text:
using July.Ioc.Conventions;
using System;
using System.Collections.Generic;
using System.Text;

namespace July.Ioc
{
    public class IocConventionOptions
    {
        public List<IConventionRegister> ConventionRegisters { get; private set; }

        public IocConventionOptions()
        {
            ConventionRegisters = new List<IConventionRegister>();
        }

        internal static IocConventionOptions Default
        {
            get
            {
                var options = new IocConventionOptions();

                options.ConventionRegisters.Add(new ComponentRegister());
                options.ConventionRegisters.Add(new LifetimeEventsRegister());
                options.ConventionRegisters.Add(new AspectRegister());
                options.ConventionRegisters.Add(new EventHandlerRegister());

                return options;
            }
        }
    }
}


text:
require 'test_helper'

class GroupedPaginationTest < ActiveSupport::TestCase

  fixtures :all

  def setup
    Person.find(:all).each {|p| p.save! if p.valid?} #required to force the before_save callback to set the first_letter, we can ignore those that aren't valid
  end

  def test_first_letter
    p=Person.find_by_last_name("Aardvark")
    assert_not_nil p
    assert_not_nil p.first_letter
    assert_equal "A", p.first_letter
  end

  def test_pages_accessor
    pages = Person.pages
    assert pages.length>1
    ("A".."Z").to_a.each{|letter| assert pages.include?(letter)}
  end

  def test_first_letter_ignore_space
    inv=Factory :investigation, :title=>" Inv"
    assert_equal "I",inv.first_letter
  end

  def test_latest_limit
    assert_equal Seek::Config.limit_latest,Person.latest_limit
    assert_equal Seek::Config.limit_latest,Project.latest_limit
    assert_equal Seek::Config.limit_latest,Institution.latest_limit
    assert_equal Seek::Config.limit_latest,Investigation.latest_limit
    assert_equal Seek::Config.limit_latest,Study.latest_limit
    assert_equal Seek::Config.limit_latest,Experiment.latest_limit
    assert_equal Seek::Config.limit_latest,DataFile.latest_limit
    assert_equal Seek::Config.limit_latest,Model.latest_limit
    assert_equal Seek::Config.limit_latest,Protocol.latest_limit
    assert_equal Seek::Config.limit_latest,Publication.latest_limit
    assert_equal Seek::Config.limit_latest,Event.latest_limit
  end

  def test_paginate_no_options
    @people=Person.paginate :default_page=>"first"
    assert_equal(("A".."Z").to_a, @people.pages)
    assert @people.size>0
    assert_equal "A", @people.page
    assert_not_nil @people.page_totals
    assert_equal @people.size, @people.page_totals["A"]

    @people.each do |p|
      assert_equal "A", p.first_letter
    end
  end

  def test_paginate_by_page
    @people=Person.paginate :page=>"B"
    assert_equal(("A".."Z").to_a, @people.pages)
    assert @people.size>0
    assert_equal "B", @people.page
    assert_equal @people.size, @people.page_totals["B"]
    @people.each do |p|
      assert_equal "B", p.first_letter
    end
  end

  def test_sql_injection
    @people=Person.paginate :page=>"A or first_letter='B'"
    assert_equal 0,@people.size
    assert_equal(("A".."Z").to_a, @people.pages)
    assert_equal "A or first_letter='B'", @people.page
  end

  def test_handle_oslash
    p=Person.new(:last_name=>"Øyvind", :email=>"sdfkjhsdfkjhsdf@email.com")
    assert p.save
    assert_equal "O", p.first_letter
  end

  def test_handle_umlaut
    p=Person.new(:last_name=>"Ümlaut", :email=>"sdfkjhsdfkjhsdf@email.com")
    assert p.save
    assert_equal "U", p.first_letter
  end

  def test_handle_accent
    p=Person.new(:last_name=>"Ýiggle", :email=>"sdfkjhsdfkjhsdf@email.com")
    assert p.save
    assert_equal "Y", p.first_letter
  end

  def test_extra_conditions_as_array
    @people=Person.paginate :page=>"A",:conditions=>["last_name = ?","Aardvark"]
    assert_equal 1,@people.size
    assert(@people.page_totals.select do |k, v|
      k!="A" && v>0
    end.empty?,"All of the page totals should be 0")

    @people=Person.paginate :page=>"B",:conditions=>["last_name = ?","Aardvark"]
    assert_equal 0,@people.size
    assert_equal 1,@people.page_totals["A"]
  end

  #should jump to the first page that has content if :page=> isn't defined. Will use first page if no content is available
  def test_jump_to_first_page_with_content
    #delete those with A
    Person.find(:all,:conditions=>["first_letter = ?","A"]).each {|p| p.destroy }
    @people=Person.paginate :default_page=>"first"
    assert @people.size>0
    assert_equal "B",@people.page

    @people=Person.paginate :page=>"A"
    assert_equal 0,@people.size
    assert_equal "A",@people.page

    #delete every person, and check it still returns the first page with empty content
    Person.find(:all).each{|x| x.destroy}
    @people=Person.paginate :default_page=>"first"
    assert_equal 0,@people.size
    assert_equal "A",@people.page

  end

  def test_default_page_accessor
    assert Person.default_page == "latest" || Person.default_page == "all"
  end

  def test_extra_condition_as_array_direct
    @people=Person.paginate :page=>"A",:conditions=>["last_name = 'Aardvark'"]
    assert_equal 1,@people.size
    assert(@people.page_totals.select do |k, v|
      k!="A" && v>0
    end.empty?,"All of the page totals should be 0")

    @people=Person.paginate :page=>"B",:conditions=>["last_name = 'Aardvark'"]
    assert_equal 0,@people.size
    assert_equal 1,@people.page_totals["A"]

  end

  def test_extra_condition_as_string
    @people=Person.paginate :page=>"A",:conditions=>"last_name = 'Aardvark'"
    assert_equal 1,@people.size
    assert(@people.page_totals.select do |k, v|
      k!="A" && v>0
    end.empty?,"All of the page totals should be 0")

    @people=Person.paginate :page=>"B",:conditions=>"last_name = 'Aardvark'"
    assert_equal 0,@people.size
    assert_equal 1,@people.page_totals["A"]

  end

  def test_condition_as_hash
    @people=Person.paginate :page=>"A",:conditions=>{:last_name=>"Aardvark"}
    assert_equal 1,@people.size
    assert(@people.page_totals.select do |k, v|
      k!="A" && v>0
    end.empty?,"All of the page totals should be 0")

    @people=Person.paginate :page=>"B",:conditions=>{:last_name => "Aardvark"}
    assert_equal 0,@people.size
    assert_equal 1,@people.page_totals["A"]
  end

  def test_order_by
    @people=Person.paginate :page=>"A",:order=>"last_name ASC"
    assert @people.size>0
    assert_equal "A", @people.page
    assert_equal people(:person_for_default_page),@people.first

    @people=Person.paginate :page=>"A",:order=>"last_name DESC"
    assert @people.size>0
    assert_equal "A", @people.page
    assert_equal people(:person_for_pagination_order_test),@people.first
  end

  def test_show_all
    @people=Person.paginate :page=>"all"
    assert_equal Person.all.size, @people.size
  end

  def test_post_fetch_pagination
    protocols = Protocol.all
    protocols.each {|s| User.current_user = s.contributor; s.save if s.valid?} #Set first letters
    result = Protocol.paginate_after_fetch(protocols)
    assert !result.empty? #Check there's something on the first page
  end

  test "pagination for default page using rails-setting plugin" do
    @people=Person.paginate
    assert_equal @people.page, Seek::Config.default_page("people")
    @projects=Project.paginate
    assert_equal @projects.page, Seek::Config.default_page("projects")
    @institutions=Institution.paginate
    assert_equal @institutions.page, Seek::Config.default_pages[:institutions]
    @investigations=Investigation.paginate
    assert_equal @investigations.page, Seek::Config.default_pages[:investigations]
    @studies=Study.paginate
    assert_equal @studies.page, Seek::Config.default_pages[:studies]
    @experiments=Experiment.paginate
    assert_equal @experiments.page, Seek::Config.default_pages[:experiments]
    @data_files=DataFile.paginate
    assert_equal @data_files.page, Seek::Config.default_pages[:data_files]
    @models=Model.paginate
    assert_equal @models.page, Seek::Config.default_page("models")
    @protocols=Protocol.paginate
    assert_equal @protocols.page, Seek::Config.default_pages[:protocols]
    @publications=Publication.paginate
    assert_equal @publications.page, Seek::Config.default_pages[:publications]
    @events=Event.paginate
    assert_equal @events.page, Seek::Config.default_pages[:events]

    @specimens=Specimen.paginate
    assert_equal @specimens.page, Seek::Config.default_pages[:specimens]

  end

end


text:
package org.apache.wicket.core.request.resource;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;

import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Locale;

import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.request.Url;
import org.apache.wicket.request.resource.IResource;
import org.apache.wicket.request.resource.JavaScriptResourceReference;
import org.apache.wicket.request.resource.ResourceReference;
import org.apache.wicket.request.resource.UrlResourceReference;
import org.apache.wicket.request.resource.caching.IStaticCacheableResource;
import org.apache.wicket.resource.bundles.ConcatBundleResource;
import org.apache.wicket.resource.bundles.ResourceBundleReference;
import org.apache.wicket.util.resource.AbstractResourceStream;
import org.apache.wicket.util.resource.IResourceStream;
import org.apache.wicket.util.resource.ResourceStreamNotFoundException;
import org.apache.wicket.util.tester.WicketTestCase;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

/**
 * Test cases for resource bundles
 *
 * @author papegaaij
 */
class ResouceBundleTest extends WicketTestCase
{
	@BeforeEach
	void before()
	{
		tester.getSession().setLocale(Locale.ENGLISH);
	}

	/**
	 * Tests the concatenation of 2 javascript files
	 */
	@Test
	void concatBundle()
	{
		ConcatBundleResource bundle = new ConcatBundleResource(Arrays.asList(
			JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(
				ResouceBundleTest.class, "a.js")),
			JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(
				ResouceBundleTest.class, "b.js"))));

		tester.startResource(bundle);
		assertEquals("//a// b.js", tester.getLastResponseAsString().trim());
	}

	/**
	 * WICKET-6720 do not concat eagerly
	 */
	@Test
	void concatBundleLastModified()
	{
		final Instant lastModified = Instant.now();

		ConcatBundleResource bundle = new ConcatBundleResource(Arrays.asList(
			JavaScriptHeaderItem.forReference(new ResourceReference("foo") {
				public IResource getResource() {
					return new IStaticCacheableResource()
					{
						@Override
						public void respond(Attributes attributes)
						{
							fail();
						}

						@Override
						public boolean isCachingEnabled()
						{
							return true;
						}

						@Override
						public Serializable getCacheKey()
						{
							return "";
						}

						@Override
						public IResourceStream getResourceStream()
						{
							return new AbstractResourceStream()
							{

								@Override
								public Instant lastModifiedTime()
								{
									return lastModified;
								}

								@Override
								public InputStream getInputStream() throws ResourceStreamNotFoundException
								{
									return fail();
								}

								@Override
								public void close() throws IOException
								{
									fail();
								}
							};
						}
					};
				}
			})));

		assertEquals(lastModified, bundle.getResourceStream().lastModifiedTime());
	}

	/**
	 * Tests the replacement of provided resources by their bundle
	 *
	 * @throws Exception
	 */
	@Test
	void providedResource() throws Exception
	{
		tester.getApplication()
			.getResourceBundles()
			.addJavaScriptBundle(ResouceBundleTest.class, "ab.js",
				new JavaScriptResourceReference(ResouceBundleTest.class, "a.js"),
				new JavaScriptResourceReference(ResouceBundleTest.class, "b.js"));

		executeTest(BundlesPage.class, "BundlesPage_result.html");
	}

	/**
	 * Tests the replacement of provided resources by their bundle with defer option
	 *
	 * @throws Exception
	 */
	@Test
	void providedResourceWithDefer() throws Exception
	{
		tester.getApplication()
		.getResourceBundles()
		.addJavaScriptBundle(ResouceBundleTest.class, "ab.js", true,
			new JavaScriptResourceReference(ResouceBundleTest.class, "a.js"),
			new JavaScriptResourceReference(ResouceBundleTest.class, "b.js"));

		executeTest(BundlesPage.class, "BundlesPage_result_defer.html");
	}

	/**
	 * Tests an external resource bundle
	 *
	 * @throws Exception
	 */
	@Test
	void externalBundle() throws Exception
	{
		ResourceBundleReference bundle = new ResourceBundleReference(
			new UrlResourceReference(
				Url.parse("http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js")));
		bundle.addProvidedResources(
			JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(
				ResouceBundleTest.class, "a.js")),
			JavaScriptHeaderItem.forReference(new JavaScriptResourceReference(
				ResouceBundleTest.class, "b.js")));

		tester.getApplication()
			.getResourceBundles()
			.addBundle(JavaScriptHeaderItem.forReference(bundle));

		executeTest(BundlesPage.class, "BundlesPage_ext_result.html");
	}
}


text:
package scalaprops

import sbt.testing._
import scalaprops.internal._
import scala.collection.mutable.ArrayBuffer
import scala.reflect.NameTransformer

object ScalapropsRunner {
  def testFieldNames(clazz: Class[_]): Array[String] =
    Scalaprops.testFieldNames(clazz)

  private[this] def invokeProperty(clazz: Class[_], obj: Scalaprops): List[(String, Property)] =
    Scalaprops
      .findTestFields(clazz, classOf[Property])
      .map { method =>
        val p = method.invoke(obj).asInstanceOf[Property]
        NameTransformer.decode(method.getName) -> p
      }
      .toList

  private[this] def invokeProperties(clazz: Class[_], obj: Scalaprops): List[Properties[Any]] =
    Scalaprops
      .findTestFields(clazz, classOf[Properties[_]])
      .map { method =>
        val methodName = NameTransformer.decode(method.getName)
        val props = method.invoke(obj).asInstanceOf[Properties[Any]].props
        Properties.noSort[Any](
          Tree.Node(
            methodName -> Option.empty,
            props #:: Stream.empty
          )
        )
      }
      .toList

  private[scalaprops] def allProps(
    clazz: Class[_],
    obj: Scalaprops,
    only: List[String],
    logger: Logger
  ): Properties[_] = {
    val tests0 = invokeProperty(clazz, obj).map { case (name, p) =>
      p.toProperties[Any](name)
    } ::: invokeProperties(clazz, obj)

    val tests = only match {
      case names @ (_ :: _) =>
        ScalapropsTaskImpl.filterTests(
          objName = clazz.getCanonicalName.dropRight(1),
          names = names,
          tests = tests0,
          logger = logger
        )
      case _ =>
        tests0
    }

    Properties.noSort[Any](
      Tree.Node(
        clazz.getName -> Option.empty,
        obj.transformProperties(tests).map(_.props).toStream
      )
    )
  }

  private[scalaprops] def getTestObject(
    fingerprint: Fingerprint,
    testClassName: String,
    testClassLoader: ClassLoader
  ): Scalaprops = {
    val clazz = testClassLoader.loadClass(testClassName + "$")
    clazz.getDeclaredField("MODULE$").get(null).asInstanceOf[Scalaprops]
  }

  private[scalaprops] def findTests(
    fingerprint: Fingerprint,
    testClassName: String,
    testClassLoader: ClassLoader,
    only: List[String],
    logger: Logger
  ): Properties[_] = {
    val clazz = testClassLoader.loadClass(testClassName + "$")
    val obj = getTestObject(fingerprint, testClassName, testClassLoader)
    allProps(clazz, obj, only, logger)
  }
}

final class ScalapropsRunner(
  override val args: Array[String],
  override val remoteArgs: Array[String],
  testClassLoader: ClassLoader
) extends Runner {
  private[this] val status = TestStatus()

  private[this] val results = ArrayBuffer.empty[TestResult]
  private[this] val arguments = Arguments.parse(args.toList)

  override def tasks(taskDefs: Array[TaskDef]) =
    taskDefs.map { taskDef =>
      new ScalapropsTaskImpl(
        taskDef0 = taskDef,
        testClassLoader = testClassLoader,
        args = args,
        arguments = arguments,
        results = results,
        status = status
      )
    }

  override def done() = {
    s"""done
Total test count: ${status.all}
Failed ${status.failure}, Errors ${status.error}, Passed ${status.success}, Ignored ${status.ignored}
""" + TestResult.formatResults(results, arguments.showDuration)
  }
}


text:
import { Log } from './Log.js';
import { MetadataService } from './MetadataService.js';
import { Global } from './Global.js';

const AccessTokenTypeHint = "access_token";
const RefreshTokenTypeHint = "refresh_token";

export class TokenRevocationClient {
    constructor(settings, XMLHttpRequestCtor = Global.XMLHttpRequest, MetadataServiceCtor = MetadataService) {
        if (!settings) {
            Log.error("TokenRevocationClient.ctor: No settings provided");
            throw new Error("No settings provided.");
        }

        this._settings = settings;
        this._XMLHttpRequestCtor = XMLHttpRequestCtor;
        this._metadataService = new MetadataServiceCtor(this._settings);
    }

    revoke(token, required, type = "access_token") {
        if (!token) {
            Log.error("TokenRevocationClient.revoke: No token provided");
            throw new Error("No token provided.");
        }

        if (type !== AccessTokenTypeHint && type != RefreshTokenTypeHint) {
            Log.error("TokenRevocationClient.revoke: Invalid token type");
            throw new Error("Invalid token type.");
        }

        return this._metadataService.getRevocationEndpoint().then(url => {
            if (!url) {
                if (required) {
                    Log.error("TokenRevocationClient.revoke: Revocation not supported");
                    throw new Error("Revocation not supported");
                }

                // not required, so don't error and just return
                return;
            }

            Log.debug("TokenRevocationClient.revoke: Revoking " + type);
            var client_id = this._settings.client_id;
            var client_secret = this._settings.client_secret;
            return this._revoke(url, client_id, client_secret, token, type);
        });
    }

    _revoke(url, client_id, client_secret, token, type) {

        return new Promise((resolve, reject) => {

            var xhr = new this._XMLHttpRequestCtor();
            xhr.open("POST", url);

            xhr.onload = () => {
                Log.debug("TokenRevocationClient.revoke: HTTP response received, status", xhr.status);

                if (xhr.status === 200) {
                    resolve();
                }
                else {
                    reject(Error(xhr.statusText + " (" + xhr.status + ")"));
                }
            };
            xhr.onerror = () => {
                Log.debug("TokenRevocationClient.revoke: Network Error.")
                reject("Network Error");
            };

            var body = "client_id=" + encodeURIComponent(client_id);
            if (client_secret) {
                body += "&client_secret=" + encodeURIComponent(client_secret);
            }
            body += "&token_type_hint=" + encodeURIComponent(type);
            body += "&token=" + encodeURIComponent(token);

            xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            xhr.send(body);
        });
    }
}


text:
package io.github.silencio_app.silencio;

import java.net.CookieManager;
import java.net.HttpCookie;
import java.net.HttpURLConnection;
import java.util.List;
import java.util.Map;

/**
 * Created by vipin on 25/11/16.
 */
public class io {

    public static CookieManager getCookiesFromURLConnection(HttpURLConnection urlConnection){
        Map<String,List<String >> headers= urlConnection.getHeaderFields();
        CookieManager cookieManager=new CookieManager();
        List<String> cookiesHeader=headers.get("Set-Cookie");

        if(cookiesHeader!=null){
            for(String cookie: cookiesHeader){
                cookieManager.getCookieStore().add(null, HttpCookie.parse(cookie).get(0));
            }
        }
        return cookieManager;
    }
}


text:
#include "config.h"
#include "FontGlyphs.h"

#include "Font.h"
#include "FontCache.h"
#include "SegmentedFontData.h"
#include <wtf/unicode/Unicode.h>

namespace WebCore {

FontGlyphs::FontGlyphs(PassRefPtr<FontSelector> fontSelector)
    : m_pageZero(0)
    , m_cachedPrimarySimpleFontData(0)
    , m_fontSelector(fontSelector)
    , m_fontSelectorVersion(m_fontSelector ? m_fontSelector->version() : 0)
    , m_familyIndex(0)
    , m_generation(fontCache()->generation())
    , m_pitch(UnknownPitch)
    , m_loadingCustomFonts(false)
    , m_isForPlatformFont(false)
{
}

FontGlyphs::FontGlyphs(const FontPlatformData& platformData)
    : m_pageZero(0)
    , m_cachedPrimarySimpleFontData(0)
    , m_fontSelector(0)
    , m_fontSelectorVersion(0)
    , m_familyIndex(cAllFamiliesScanned)
    , m_generation(fontCache()->generation())
    , m_pitch(UnknownPitch)
    , m_loadingCustomFonts(false)
    , m_isForPlatformFont(true)
{
    RefPtr<FontData> fontData = fontCache()->getCachedFontData(&platformData);
    m_realizedFontData.append(fontData.release());
}

void FontGlyphs::releaseFontData()
{
    unsigned numFonts = m_realizedFontData.size();
    for (unsigned i = 0; i < numFonts; ++i) {
        if (m_realizedFontData[i]->isCustomFont())
            continue;
        ASSERT(!m_realizedFontData[i]->isSegmented());
        fontCache()->releaseFontData(static_cast<const SimpleFontData*>(m_realizedFontData[i].get()));
    }
}

void FontGlyphs::determinePitch(const FontDescription& description) const
{
    const FontData* fontData = primaryFontData(description);
    if (!fontData->isSegmented())
        m_pitch = static_cast<const SimpleFontData*>(fontData)->pitch();
    else {
        const SegmentedFontData* segmentedFontData = static_cast<const SegmentedFontData*>(fontData);
        unsigned numRanges = segmentedFontData->numRanges();
        if (numRanges == 1)
            m_pitch = segmentedFontData->rangeAt(0).fontData()->pitch();
        else
            m_pitch = VariablePitch;
    }
}

const FontData* FontGlyphs::realizeFontDataAt(const FontDescription& description, unsigned realizedFontIndex) const
{
    if (realizedFontIndex < m_realizedFontData.size())
        return m_realizedFontData[realizedFontIndex].get(); // This fallback font is already in our list.

    // Make sure we're not passing in some crazy value here.
    ASSERT(realizedFontIndex == m_realizedFontData.size());

    if (m_familyIndex == cAllFamiliesScanned)
        return 0;

    // Ask the font cache for the font data.
    // We are obtaining this font for the first time. We keep track of the families we've looked at before
    // in |m_familyIndex|, so that we never scan the same spot in the list twice. getFontData will adjust our
    // |m_familyIndex| as it scans for the right font to make.
    ASSERT(fontCache()->generation() == m_generation);
    RefPtr<FontData> result = fontCache()->getFontData(description, m_familyIndex, m_fontSelector.get());
    if (result) {
        m_realizedFontData.append(result);
        if (result->isLoading())
            m_loadingCustomFonts = true;
    }
    return result.get();
}

static inline bool isInRange(UChar32 character, UChar32 lowerBound, UChar32 upperBound)
{
    return character >= lowerBound && character <= upperBound;
}

static bool shouldIgnoreRotation(UChar32 character)
{
    if (character == 0x000A7 || character == 0x000A9 || character == 0x000AE)
        return true;

    if (character == 0x000B6 || character == 0x000BC || character == 0x000BD || character == 0x000BE)
        return true;

    if (isInRange(character, 0x002E5, 0x002EB))
        return true;

    if (isInRange(character, 0x01100, 0x011FF) || isInRange(character, 0x01401, 0x0167F) || isInRange(character, 0x01800, 0x018FF))
        return true;

    if (character == 0x02016 || character == 0x02018 || character == 0x02019 || character == 0x02020 || character == 0x02021
        || character == 0x2030 || character == 0x02031)
        return true;

    if (isInRange(character, 0x0203B, 0x0203D) || character == 0x02042 || character == 0x02044 || character == 0x02047
        || character == 0x02048 || character == 0x02049 || character == 0x2051)
        return true;

    if (isInRange(character, 0x02065, 0x02069) || isInRange(character, 0x020DD, 0x020E0)
        || isInRange(character, 0x020E2, 0x020E4) || isInRange(character, 0x02100, 0x02117)
        || isInRange(character, 0x02119, 0x02131) || isInRange(character, 0x02133, 0x0213F))
        return true;

    if (isInRange(character, 0x02145, 0x0214A) || character == 0x0214C || character == 0x0214D
        || isInRange(character, 0x0214F, 0x0218F))
        return true;

    if (isInRange(character, 0x02300, 0x02307) || isInRange(character, 0x0230C, 0x0231F)
        || isInRange(character, 0x02322, 0x0232B) || isInRange(character, 0x0237D, 0x0239A)
        || isInRange(character, 0x023B4, 0x023B6) || isInRange(character, 0x023BA, 0x023CF)
        || isInRange(character, 0x023D1, 0x023DB) || isInRange(character, 0x023E2, 0x024FF))
        return true;

    if (isInRange(character, 0x025A0, 0x02619) || isInRange(character, 0x02620, 0x02767)
        || isInRange(character, 0x02776, 0x02793) || isInRange(character, 0x02B12, 0x02B2F)
        || isInRange(character, 0x02B4D, 0x02BFF) || isInRange(character, 0x02E80, 0x03007))
        return true;

    if (character == 0x03012 || character == 0x03013 || isInRange(character, 0x03020, 0x0302F)
        || isInRange(character, 0x03031, 0x0309F) || isInRange(character, 0x030A1, 0x030FB)
        || isInRange(character, 0x030FD, 0x0A4CF))
        return true;

    if (isInRange(character, 0x0A840, 0x0A87F) || isInRange(character, 0x0A960, 0x0A97F)
        || isInRange(character, 0x0AC00, 0x0D7FF) || isInRange(character, 0x0E000, 0x0FAFF))
        return true;

    if (isInRange(character, 0x0FE10, 0x0FE1F) || isInRange(character, 0x0FE30, 0x0FE48)
        || isInRange(character, 0x0FE50, 0x0FE57) || isInRange(character, 0x0FE5F, 0x0FE62)
        || isInRange(character, 0x0FE67, 0x0FE6F))
        return true;

    if (isInRange(character, 0x0FF01, 0x0FF07) || isInRange(character, 0x0FF0A, 0x0FF0C)
        || isInRange(character, 0x0FF0E, 0x0FF19) || isInRange(character, 0x0FF1F, 0x0FF3A))
        return true;

    if (character == 0x0FF3C || character == 0x0FF3E)
        return true;

    if (isInRange(character, 0x0FF40, 0x0FF5A) || isInRange(character, 0x0FFE0, 0x0FFE2)
        || isInRange(character, 0x0FFE4, 0x0FFE7) || isInRange(character, 0x0FFF0, 0x0FFF8)
        || character == 0x0FFFD)
        return true;

    if (isInRange(character, 0x13000, 0x1342F) || isInRange(character, 0x1B000, 0x1B0FF)
        || isInRange(character, 0x1D000, 0x1D1FF) || isInRange(character, 0x1D300, 0x1D37F)
        || isInRange(character, 0x1F000, 0x1F64F) || isInRange(character, 0x1F680, 0x1F77F))
        return true;

    if (isInRange(character, 0x20000, 0x2FFFD) || isInRange(character, 0x30000, 0x3FFFD))
        return true;

    return false;
}

static inline std::pair<GlyphData, GlyphPage*> glyphDataAndPageForCJKCharacterWithoutSyntheticItalic(UChar32 character, GlyphData& data, GlyphPage* page, unsigned pageNumber)
{
    RefPtr<SimpleFontData> nonItalicFontData = data.fontData->nonSyntheticItalicFontData();
    GlyphPageTreeNode* nonItalicNode = GlyphPageTreeNode::getRootChild(nonItalicFontData.get(), pageNumber);
    GlyphPage* nonItalicPage = nonItalicNode->page();
    if (nonItalicPage) {
        GlyphData nonItalicData = nonItalicPage->glyphDataForCharacter(character);
        if (nonItalicData.fontData)
            return std::make_pair(nonItalicData, nonItalicPage);
    }
    return std::make_pair(data, page);
}

static inline std::pair<GlyphData, GlyphPage*> glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(UChar32 character, NonCJKGlyphOrientation orientation, GlyphData& data, GlyphPage* page, unsigned pageNumber)
{
    if (orientation == NonCJKGlyphOrientationUpright || shouldIgnoreRotation(character)) {
        RefPtr<SimpleFontData> uprightFontData = data.fontData->uprightOrientationFontData();
        GlyphPageTreeNode* uprightNode = GlyphPageTreeNode::getRootChild(uprightFontData.get(), pageNumber);
        GlyphPage* uprightPage = uprightNode->page();
        if (uprightPage) {
            GlyphData uprightData = uprightPage->glyphDataForCharacter(character);
            // If the glyphs are the same, then we know we can just use the horizontal glyph rotated vertically to be upright.
            if (data.glyph == uprightData.glyph)
                return std::make_pair(data, page);
            // The glyphs are distinct, meaning that the font has a vertical-right glyph baked into it. We can't use that
            // glyph, so we fall back to the upright data and use the horizontal glyph.
            if (uprightData.fontData)
                return std::make_pair(uprightData, uprightPage);
        }
    } else if (orientation == NonCJKGlyphOrientationVerticalRight) {
        RefPtr<SimpleFontData> verticalRightFontData = data.fontData->verticalRightOrientationFontData();
        GlyphPageTreeNode* verticalRightNode = GlyphPageTreeNode::getRootChild(verticalRightFontData.get(), pageNumber);
        GlyphPage* verticalRightPage = verticalRightNode->page();
        if (verticalRightPage) {
            GlyphData verticalRightData = verticalRightPage->glyphDataForCharacter(character);
            // If the glyphs are distinct, we will make the assumption that the font has a vertical-right glyph baked
            // into it.
            if (data.glyph != verticalRightData.glyph)
                return std::make_pair(data, page);
            // The glyphs are identical, meaning that we should just use the horizontal glyph.
            if (verticalRightData.fontData)
                return std::make_pair(verticalRightData, verticalRightPage);
        }
    }
    return std::make_pair(data, page);
}

std::pair<GlyphData, GlyphPage*> FontGlyphs::glyphDataAndPageForCharacter(const FontDescription& description, UChar32 c, bool mirror, FontDataVariant variant) const
{
    ASSERT(isMainThread());

    if (variant == AutoVariant) {
        if (description.smallCaps() && !primarySimpleFontData(description)->isSVGFont()) {
            UChar32 upperC = WTF::Unicode::toUpper(c);
            if (upperC != c) {
                c = upperC;
                variant = SmallCapsVariant;
            } else
                variant = NormalVariant;
        } else
            variant = NormalVariant;
    }

    if (mirror)
        c = WTF::Unicode::mirroredChar(c);

    unsigned pageNumber = (c / GlyphPage::size);

    GlyphPageTreeNode* node = pageNumber ? m_pages.get(pageNumber) : m_pageZero;
    if (!node) {
        node = GlyphPageTreeNode::getRootChild(realizeFontDataAt(description, 0), pageNumber);
        if (pageNumber)
            m_pages.set(pageNumber, node);
        else
            m_pageZero = node;
    }

    GlyphPage* page = 0;
    if (variant == NormalVariant) {
        // Fastest loop, for the common case (normal variant).
        while (true) {
            page = node->page();
            if (page) {
                GlyphData data = page->glyphDataForCharacter(c);
                if (data.fontData && (data.fontData->platformData().orientation() == Horizontal || data.fontData->isTextOrientationFallback()))
                    return std::make_pair(data, page);

                if (data.fontData) {
                    if (Font::isCJKIdeographOrSymbol(c)) {
                        if (!data.fontData->hasVerticalGlyphs()) {
                            // Use the broken ideograph font data. The broken ideograph font will use the horizontal width of glyphs
                            // to make sure you get a square (even for broken glyphs like symbols used for punctuation).
                            variant = BrokenIdeographVariant;
                            break;
                        }
#if PLATFORM(MAC)
                        else if (data.fontData->platformData().syntheticOblique())
                            return glyphDataAndPageForCJKCharacterWithoutSyntheticItalic(c, data, page, pageNumber);
#endif
                    } else
                        return glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data, page, pageNumber);

                    return std::make_pair(data, page);
                }

                if (node->isSystemFallback())
                    break;
            }

            node = node->getChild(realizeFontDataAt(description, node->level()), pageNumber);
            if (pageNumber)
                m_pages.set(pageNumber, node);
            else
                m_pageZero = node;
        }
    }
    if (variant != NormalVariant) {
        while (true) {
            page = node->page();
            if (page) {
                GlyphData data = page->glyphDataForCharacter(c);
                if (data.fontData) {
                    // The variantFontData function should not normally return 0.
                    // But if it does, we will just render the capital letter big.
                    RefPtr<SimpleFontData> variantFontData = data.fontData->variantFontData(description, variant);
                    if (!variantFontData)
                        return std::make_pair(data, page);

                    GlyphPageTreeNode* variantNode = GlyphPageTreeNode::getRootChild(variantFontData.get(), pageNumber);
                    GlyphPage* variantPage = variantNode->page();
                    if (variantPage) {
                        GlyphData data = variantPage->glyphDataForCharacter(c);
                        if (data.fontData)
                            return std::make_pair(data, variantPage);
                    }

                    // Do not attempt system fallback off the variantFontData. This is the very unlikely case that
                    // a font has the lowercase character but the small caps font does not have its uppercase version.
                    return std::make_pair(variantFontData->missingGlyphData(), page);
                }

                if (node->isSystemFallback())
                    break;
            }

            node = node->getChild(realizeFontDataAt(description, node->level()), pageNumber);
            if (pageNumber)
                m_pages.set(pageNumber, node);
            else
                m_pageZero = node;
        }
    }

    ASSERT(page);
    ASSERT(node->isSystemFallback());

    // System fallback is character-dependent. When we get here, we
    // know that the character in question isn't in the system fallback
    // font's glyph page. Try to lazily create it here.
    UChar codeUnits[2];
    int codeUnitsLength;
    if (c <= 0xFFFF) {
        codeUnits[0] = Font::normalizeSpaces(c);
        codeUnitsLength = 1;
    } else {
        codeUnits[0] = U16_LEAD(c);
        codeUnits[1] = U16_TRAIL(c);
        codeUnitsLength = 2;
    }
    const SimpleFontData* originalFontData = primaryFontData(description)->fontDataForCharacter(c);
    RefPtr<SimpleFontData> characterFontData = fontCache()->systemFallbackForCharacters(description, originalFontData, m_isForPlatformFont, codeUnits, codeUnitsLength);
    if (characterFontData) {
        if (characterFontData->platformData().orientation() == Vertical && !characterFontData->hasVerticalGlyphs() && Font::isCJKIdeographOrSymbol(c))
            variant = BrokenIdeographVariant;
        if (variant != NormalVariant)
            characterFontData = characterFontData->variantFontData(description, variant);
    }
    if (characterFontData) {
        // Got the fallback glyph and font.
        GlyphPage* fallbackPage = GlyphPageTreeNode::getRootChild(characterFontData.get(), pageNumber)->page();
        GlyphData data = fallbackPage && fallbackPage->fontDataForCharacter(c) ? fallbackPage->glyphDataForCharacter(c) : characterFontData->missingGlyphData();
        // Cache it so we don't have to do system fallback again next time.
        if (variant == NormalVariant) {
#if OS(WINCE)
            // missingGlyphData returns a null character, which is not suitable for GDI to display.
            // Also, sometimes we cannot map a font for the character on WINCE, but GDI can still
            // display the character, probably because the font package is not installed correctly.
            // So we just always set the glyph to be same as the character, and let GDI solve it.
            page->setGlyphDataForCharacter(c, c, characterFontData.get());
            characterFontData->setMaxGlyphPageTreeLevel(std::max(characterFontData->maxGlyphPageTreeLevel(), node->level()));
            return std::make_pair(page->glyphDataForCharacter(c), page);
#else
            page->setGlyphDataForCharacter(c, data.glyph, data.fontData);
            data.fontData->setMaxGlyphPageTreeLevel(std::max(data.fontData->maxGlyphPageTreeLevel(), node->level()));
            if (!Font::isCJKIdeographOrSymbol(c) && data.fontData->platformData().orientation() != Horizontal && !data.fontData->isTextOrientationFallback())
                return glyphDataAndPageForNonCJKCharacterWithGlyphOrientation(c, description.nonCJKGlyphOrientation(), data, fallbackPage, pageNumber);
#endif
        }
        return std::make_pair(data, page);
    }

    // Even system fallback can fail; use the missing glyph in that case.
    // FIXME: It would be nicer to use the missing glyph from the last resort font instead.
    GlyphData data = primarySimpleFontData(description)->missingGlyphData();
    if (variant == NormalVariant) {
#if OS(WINCE)
        // See comment about WINCE GDI handling near setGlyphDataForCharacter above.
        page->setGlyphDataForCharacter(c, c, data.fontData);
        data.fontData->setMaxGlyphPageTreeLevel(std::max(data.fontData->maxGlyphPageTreeLevel(), node->level()));
        return std::make_pair(page->glyphDataForCharacter(c), page);
#else
        page->setGlyphDataForCharacter(c, data.glyph, data.fontData);
        data.fontData->setMaxGlyphPageTreeLevel(std::max(data.fontData->maxGlyphPageTreeLevel(), node->level()));
#endif
    }
    return std::make_pair(data, page);
}

}


text:
"""
unit tests for cmepy.models sub-package
"""

import unittest

# models will automatically validated once instantiated,
# so it should be sufficient to instantiate them for testing
# purposes

class ModelTests(unittest.TestCase):
    def test_burr08_models(self):
        from cmepy.models import burr08
        m = burr08.create_model()
        phi = burr08.create_time_dependencies()

    def test_catalytic_reaction_models(self):
        from cmepy.models import catalytic_reaction
        initial_counts = { 'A' : 20, 'D' : 15 }
        m = catalytic_reaction.create_model(**initial_counts)
        states = set(catalytic_reaction.gen_states(**initial_counts))

    def test_dsmts_models(self):
        from cmepy.models import dsmts
        m = dsmts.DSMTS_001_01

    def test_dual_enzymatic_models(self):
        from cmepy.models import dual_enzymatic
        m = dual_enzymatic.create_model()
        states = set(dual_enzymatic.gen_states())

    def test_gou07_models(self):
        from cmepy.models import gou07
        m1 = gou07.create_model_uni_dim()
        m2 = gou07.create_model_quad_autocat()
        m3 = gou07.create_model_quad_autocat(fixed_s = False)

    def test_michaelis_menten_models(self):
        from cmepy.models import michaelis_menten
        m = michaelis_menten.create_model_michaelis_menten()

    def test_mono_molecular_models(self):
        from cmepy.models import mono_molecular
        m1 = mono_molecular.A2B2A
        m2 = mono_molecular.A2B2C

    def test_munk08_models(self):
        from cmepy.models import munk08
        m = munk08.create_model_gene_toggle()

    def test_pap_pili_models(self):
        from cmepy.models import pap_pili
        m = pap_pili.create_model()
        states = set(pap_pili.gen_states())

    def test_transcription_regulation_models(self):
        from cmepy.models import transcription_regulation
        m = transcription_regulation.create_model()
        phi = transcription_regulation.create_time_dependencies()

def suite():
    suite = unittest.TestLoader().loadTestsFromTestCase(ModelTests)
    return suite

def main():
    unittest.run(ModelTests)

if __name__ == '__main__':
    main()


text:
using Oracle.DataAccess.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OrionEscritorio
{
    class TMotivo
    {
        public static List<Motivos> listarMotivo()
        {
            List<Motivos> lista = new List<Motivos>();
            OracleConnection conexion = Conexion.abrirConexion();//Singleton
            OracleCommand orden = new OracleCommand(string.Format("SELECT * FROM MOTIVO"), conexion);
            OracleDataReader lector = orden.ExecuteReader();
            while (lector.Read())
            {
                Motivos motivo = new Motivos();

                motivo.idMotivo  = lector.GetInt32(0);
                motivo.nombre = lector.GetString(1);
                motivo.descripcion = lector.GetString(2);
                //motivo.permiso_id = lector.GetInt32(3);

                lista.Add(motivo);
            }
            return lista;
        }

        public int ingresarMotivo(Motivos motivo)
        {
            int resp = 0;
            OracleConnection conexion = Conexion.abrirConexion();
            OracleCommand orden = new OracleCommand(string.Format("INSERT INTO MOTIVO(ID_MOTIVO, NOMBRE_MOTIVO, DESCRIPCION_MOTIVO, PERMISO_ID_PERMISO) VALUES('{0}', '{1}', '{2}', NULL)", motivo.idMotivo, motivo.nombre, motivo.descripcion), conexion);
            resp = orden.ExecuteNonQuery();
            conexion.Close();
            return resp;
        }

        public int modificarMotivo(Motivos motivo)
        {
            int resp = 0;
            OracleConnection conexion = Conexion.abrirConexion();//Singleton
            OracleCommand orden = new OracleCommand(string.Format("UPDATE MOTIVO SET NOMBRE_MOTIVO='{0}',DESCRIPCION_MOTIVO={1} WHERE ID_MOTIVO='{2}'", motivo.nombre, motivo.descripcion, motivo.idMotivo), conexion);
            resp = orden.ExecuteNonQuery();
            conexion.Close();
            return resp;
        }

        public int eliminarMotivo(int idMotivo)
        {
            int resp = 0;
            OracleConnection conexion = Conexion.abrirConexion();//Singleton
            OracleCommand orden = new OracleCommand(string.Format("DELETE FROM MOTIVO WHERE ID_MOTIVO='{0}'", idMotivo), conexion);
            resp = orden.ExecuteNonQuery();
            conexion.Close();
            return resp;
        }

        //Queries
        public Motivos buscarMotivo(int idMotivo)
        {
            Motivos motivo = new Motivos();
            OracleConnection conexion = Conexion.abrirConexion();
            OracleCommand orden = new OracleCommand(String.Format("SELECT * FROM MOTIVO WHERE ID_MOTIVO=@idMotivo"), conexion);
            orden.Parameters.Add("@ID_MOTIVO", idMotivo);
            OracleDataReader lector = orden.ExecuteReader();
            if (lector.Read())
            {
                motivo.idMotivo = lector.GetInt32(0);
                motivo.nombre = lector.GetString(1);
                motivo.descripcion = lector.GetString(2);
                //motivo.permiso_id = lector.GetInt32(3);

            }
            conexion.Close();
            return motivo;
        }

    }
}


text:
<?php

declare(strict_types=1);

namespace App\CloudModule\Forms;

use App\CloudModule\Model\BluemixManager;
use App\CloudModule\Presenters\BluemixPresenter;
use App\ConfigModule\Model\BaseServiceManager;
use App\ConfigModule\Model\InstanceManager;
use App\Forms\FormFactory;
use App\ServiceModule\Model\ServiceManager;
use Nette;
use Nette\Application\UI\Form;
use Nette\Forms\Controls\SubmitButton;
use Nette\IOException;
use Nette\Utils\ArrayHash;

/**
 * Form for creating MQTT instance and Base service for IBM Bluemíx
 */
class CloudBluemixMqttFormFactory {

	use Nette\SmartObject;

	/**
	 * @var BluemixManager IBM Bluemix manager
	 */
	private $cloudManager;

	/**
	 * @var BaseServiceManager Base service manager
	 */
	private $baseService;

	/**
	 * @var InstanceManager MQTT instance manager
	 */
	private $manager;

	/**
	 * @var FormFactory Generic form factory
	 */
	private $factory;

	/**
	 * @var ServiceManager Service manager
	 */
	private $serviceManager;

	/**
	 * Constructor
	 * @param BluemixManager $bluemix IBM Bluemix manager
	 * @param BaseServiceManager $baseService Base service manager\n
	 * @param InstanceManager $manager MQTT instance manager
	 * @param FormFactory $factory Generic form factory
	 * @param ServiceManager $serviceManager Service manager
	 */
	public function __construct(BluemixManager $bluemix, BaseServiceManager $baseService, InstanceManager $manager, FormFactory $factory, ServiceManager $serviceManager) {
		$this->cloudManager = $bluemix;
		$this->baseService = $baseService;
		$this->manager = $manager;
		$this->factory = $factory;
		$this->serviceManager = $serviceManager;
	}

	/**
	 * Create MQTT configuration form
	 * @param BluemixPresenter $presenter IBM Bluemix presenter
	 * @return Form MQTT configuration form
	 */
	public function create(BluemixPresenter $presenter): Form {
		$form = $this->factory->create();
		$form->setTranslator($form->getTranslator()->domain('cloud.ibmBluemix.form'));
		$fileName = 'MqttMessaging';
		$this->manager->setFileName($fileName);
		$form->addText('organizationId', 'organizationId')->setRequired();
		$form->addText('deviceType', 'deviceType')->setRequired();
		$form->addText('deviceId', 'deviceId')->setRequired();
		$form->addText('token', 'token')->setRequired();
		$form->addText('eventId', 'eventId')->setRequired()->setDefaultValue('iqrf');
		$form->addSubmit('save', 'save')
				->onClick[] = function (SubmitButton $button) use ($presenter) {
			$values = $button->getForm()->getValues();
			$this->save($values, $presenter);
		};
		$form->addSubmit('save_restart', 'save_restart')
				->onClick[] = function (SubmitButton $button) use ($presenter) {
			$values = $button->getForm()->getValues();
			$this->save($values, $presenter, true);
		};
		$form->addProtection('core.errors.form-timeout');
		return $form;
	}

	/**
	 * Create the base service and MQTT interface
	 * @param ArrayHash $values Values from the form
	 * @param BluemixPresenter $presenter IBM Bluemix presenter
	 * @param bool $needRestart Is restart needed?
	 */
	public function save(ArrayHash $values, BluemixPresenter $presenter, bool $needRestart = false) {
		try {
			$mqttInterface = $this->cloudManager->createMqttInterface($values);
			$baseService = $this->cloudManager->createBaseService();
			$this->baseService->add($baseService);
			$this->manager->add($mqttInterface);
		} catch (IOException $e) {
			$presenter->flashMessage('IQRF Daemon\'s configuration files not found.', 'danger');
		}
		if ($needRestart) {
			try {
				$this->serviceManager->restart();
				$presenter->flashMessage('service.actions.restart.message', 'info');
			} catch (NotSupportedInitSystemException $e) {
				$presenter->flashMessage('service.errors.unsupportedInit', 'danger');
			}
		}
		$presenter->redirect(':Config:Mqtt:default');
	}

}


text:
namespace iceberg
{
    enum ICEBERGAPI collisionTypes
    {
        COLLIDE_NOTHING = 0,
        COLLIDE_GROUND = 1,
        COLLIDE_OBJECT = 2
    };

    class ICEBERGAPI PhysicsManager
    {
    public:
        PhysicsManager();
        ~PhysicsManager();

        void AddRigidBody(btCollisionShape* collisionShape,
            btVector3* origin = new btVector3(0, 0, 0),
            btScalar* mass = new btScalar(0),
            btScalar* restitution = new btScalar(1.0f),
            btVector3* inertia = new btVector3(0.0f, 0.0f, 0.0f),
            bool kinematic = false) const;

        glm::mat4 GetModelMatrixAtIndex(int index) const;
        int GetNumObjects() const;

        void Update(Game *game) const;

        void ApplyForceAtIndex(btVector3* force, int index) const;

    private:

        btBroadphaseInterface* broadphase;
        btDefaultCollisionConfiguration* collisionConfiguration;
        btCollisionDispatcher* dispatcher;
        btSequentialImpulseConstraintSolver* solver;
        btDiscreteDynamicsWorld* dynamicsWorld;
    };
}
#endif


text:
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
 *  (C) 2001 by Argonne National Laboratory.
 *      See COPYRIGHT in top-level directory.
 */

#include "mpidimpl.h"

/* FIXME - HOMOGENEOUS SYSTEMS ONLY -- no data conversion is performed */

/*
 * MPID_Send()
 */
#undef FUNCNAME
#define FUNCNAME MPID_Send
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_Send(const void * buf, int count, MPI_Datatype datatype, int rank,
	      int tag, MPID_Comm * comm, int context_offset,
	      MPID_Request ** request)
{
    MPIDI_msg_sz_t data_sz;
    int dt_contig;
    MPI_Aint dt_true_lb;
    MPID_Datatype * dt_ptr;
    MPID_Request * sreq = NULL;
    MPIDI_VC_t * vc;
#if defined(MPID_USE_SEQUENCE_NUMBERS)
    MPID_Seqnum_t seqnum;
#endif
    int mpi_errno = MPI_SUCCESS;
    MPIDI_STATE_DECL(MPID_STATE_MPID_SEND);

    MPIDI_FUNC_ENTER(MPID_STATE_MPID_SEND);

    MPIU_DBG_MSG_FMT(CH3_OTHER,VERBOSE,(MPIU_DBG_FDEST,
                "rank=%d, tag=%d, context=%d",
		rank, tag, comm->context_id + context_offset));

    if (rank == comm->rank && comm->comm_kind != MPID_INTERCOMM)
    {
	mpi_errno = MPIDI_Isend_self(buf, count, datatype, rank, tag, comm,
				     context_offset, MPIDI_REQUEST_TYPE_SEND,
				     &sreq);

	/* In the single threaded case, sending to yourself will cause
	   deadlock.  Note that in the runtime-thread case, this check
	   will not be made (long-term FIXME) */
#       ifndef MPICH_IS_THREADED
	{
	    if (sreq != NULL && sreq->cc != 0) {
		MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,
				    "**dev|selfsenddeadlock");
	    }
	}
#	endif
	if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); }
	goto fn_exit;
    }

    if (rank == MPI_PROC_NULL)
    {
	goto fn_exit;
    }

    MPIDI_Comm_get_vc_set_active(comm, rank, &vc);

#ifdef ENABLE_COMM_OVERRIDES
    if (vc->comm_ops && vc->comm_ops->send)
    {
	mpi_errno = vc->comm_ops->send( vc, buf, count, datatype, rank, tag, comm, context_offset, &sreq);
	goto fn_exit;
    }
#endif

    MPIDI_Datatype_get_info(count, datatype, dt_contig, data_sz, dt_ptr,
			    dt_true_lb);

    if (data_sz == 0)
    {
	MPIDI_CH3_Pkt_t upkt;
	MPIDI_CH3_Pkt_eager_send_t * const eager_pkt = &upkt.eager_send;

	MPIU_DBG_MSG(CH3_OTHER,VERBOSE,"sending zero length message");
	MPIDI_Pkt_init(eager_pkt, MPIDI_CH3_PKT_EAGER_SEND);
	eager_pkt->match.parts.rank = comm->rank;
	eager_pkt->match.parts.tag = tag;
	eager_pkt->match.parts.context_id = comm->context_id + context_offset;
	eager_pkt->sender_req_id = MPI_REQUEST_NULL;
	eager_pkt->data_sz = 0;

	MPIDI_VC_FAI_send_seqnum(vc, seqnum);
	MPIDI_Pkt_set_seqnum(eager_pkt, seqnum);

	MPIU_THREAD_CS_ENTER(CH3COMM,vc);
	mpi_errno = MPIU_CALL(MPIDI_CH3,iStartMsg(vc, eager_pkt,
						  sizeof(*eager_pkt), &sreq));
	MPIU_THREAD_CS_EXIT(CH3COMM,vc);
	/* --BEGIN ERROR HANDLING-- */
	if (mpi_errno != MPI_SUCCESS)
	{
	    MPIU_ERR_SETANDJUMP(mpi_errno,MPI_ERR_OTHER,"**ch3|eagermsg");
	}
	/* --END ERROR HANDLING-- */
	if (sreq != NULL)
	{
	    MPIDI_Request_set_seqnum(sreq, seqnum);
	    MPIDI_Request_set_type(sreq, MPIDI_REQUEST_TYPE_SEND);
	    /* sreq->comm = comm;
	      MPIR_Comm_add_ref(comm); -- not necessary for blocking functions */
	}

	goto fn_exit;
    }

    /* FIXME: flow control: limit number of outstanding eager messsages
       containing data and need to be buffered by the receiver */
#ifdef USE_EAGER_SHORT
    if (dt_contig && data_sz <= MPIDI_EAGER_SHORT_SIZE) {
	mpi_errno = MPIDI_CH3_EagerContigShortSend( &sreq,
					       MPIDI_CH3_PKT_EAGERSHORT_SEND,
					       (char *)buf + dt_true_lb,
					       data_sz, rank, tag, comm,
					       context_offset );
    }
    else
#endif
    if (data_sz + sizeof(MPIDI_CH3_Pkt_eager_send_t) <=
	vc->eager_max_msg_sz) {
	if (dt_contig) {
 	    mpi_errno = MPIDI_CH3_EagerContigSend( &sreq,
						   MPIDI_CH3_PKT_EAGER_SEND,
						   (char *)buf + dt_true_lb,
						   data_sz, rank, tag, comm,
						   context_offset );
	}
	else {
	    MPIDI_Request_create_sreq(sreq, mpi_errno, goto fn_exit);
	    MPIDI_Request_set_type(sreq, MPIDI_REQUEST_TYPE_SEND);
	    mpi_errno = MPIDI_CH3_EagerNoncontigSend( &sreq,
                                                      MPIDI_CH3_PKT_EAGER_SEND,
                                                      buf, count, datatype,
                                                      data_sz, rank, tag,
                                                      comm, context_offset );
	}
    }
    else {
	MPIDI_Request_create_sreq(sreq, mpi_errno, goto fn_exit);
	MPIDI_Request_set_type(sreq, MPIDI_REQUEST_TYPE_SEND);
	mpi_errno = vc->rndvSend_fn( &sreq, buf, count, datatype, dt_contig,
                                     data_sz, dt_true_lb, rank, tag, comm,
                                     context_offset );
	/* Note that we don't increase the ref count on the datatype
	   because this is a blocking call, and the calling routine
	   must wait until sreq completes */
    }

 fn_fail:
 fn_exit:
    *request = sreq;

    MPIU_DBG_STMT(CH3_OTHER,VERBOSE,
    {
	if (mpi_errno == MPI_SUCCESS) {
	    if (sreq) {
		MPIU_DBG_MSG_P(CH3_OTHER,VERBOSE,
			 "request allocated, handle=0x%08x", sreq->handle);
	    }
	    else
	    {
		MPIU_DBG_MSG(CH3_OTHER,VERBOSE,
			     "operation complete, no requests allocated");
	    }
	}
    }
		  );

    MPIDI_FUNC_EXIT(MPID_STATE_MPID_SEND);
    return mpi_errno;
}


text:
<?php

namespace Event\EventBundle\Controller\Backend;

use Symfony\Component\HttpFoundation\Request;
use Event\EventBundle\Controller\Controller;
use Event\EventBundle\Entity\Speech;
use Event\EventBundle\Entity\Translation\SpeechTranslation;
use Event\EventBundle\Form\Type\SpeechType;

class SpeechController extends Controller
{
    public function indexAction()
    {
        return $this->render('EventEventBundle:Backend/Speech:index.html.twig', array(
            'speeches' => $this->getRepository('EventEventBundle:Speech')->findAll()
        ));
    }

    public function manageAction(Request $request, $id = null)
    {
        if ($id === null) {
            $entity = new Speech();
            $entity = $this->initObjectLocales($entity, new SpeechTranslation());
        } else {
            $entity = $this->findOr404('EventEventBundle:Speech', $id);
        }

        $form = $this->createForm(new SpeechType(), $entity);

        if ($request->getMethod() === 'POST') {
            $form->submit($request);

            if ($form->isValid()) {
                $this->getManager()->persist($entity);
                $this->getManager()->flush();

                $this->setSuccessFlash(sprintf('Speech %s updated.', $entity->getTitle()));

                return $this->redirectToRoute('backend_speech');
            }
        }

        return $this->render('EventEventBundle:Backend/Speech:manage.html.twig', [
            'speech' => $entity,
            'form' => $form->createView()
        ]);
    }

    public function deleteAction($id)
    {
        $this->isGrantedAdmin();

        $entity = $this->findOr404('EventEventBundle:Speech', $id);
        $this->getManager()->remove($entity);
        $this->getManager()->flush();

        $this->setSuccessFlash('Speech deleted.');

        return $this->redirectToRoute('backend_speech');
    }
}


text:
var gulp = require('gulp'),

    sass = require('gulp-ruby-sass')
,
    notify = require("gulp-notify")
,
    minify = require('gulp-minify-css');
    uglify  = require('gulp-uglify'),
    concat = require('gulp-concat'),
    rename = require('gulp-rename'),
    convert = require('gulp-sass'),
    bower = require('gulp-bower');

var config = {

    sassPath: './resources/sass',

    bowerDir: './bower_components'

};

gulp.task('bower', function () {

    return bower()

        .pipe(gulp.dest(config.bowerDir))

});

gulp.task('css', function() {

    return gulp.src(config.sassPath + '/app.scss')

        .pipe(sass({

            style: 'compressed',

            loadPath: [

                config.sassPath

            ]

        })

        .on("error", notify.onError(function (error) {
            return "Error: " + error.message;
        })))

        .pipe(gulp.dest('./build/css'));

});

gulp.task('taboga', ['js'], function () {
    return  gulp.src('./resources/**/app.scss')
        .pipe(convert().on('error', convert.logError))
        .pipe(rename('taboga.css'))
        .pipe(gulp.dest('./build/css'));
});

gulp.task('js', ['bower'], function () {
    return gulp.src('./bower_components/bootstrap-sass-official/assets/javascripts/bootstrap.js')
        .pipe(uglify())
        .pipe(rename('bootstrap.min.js'))
        .pipe(gulp.dest('./build/js'));
});

gulp.task('styles', function () {
    return gulp.src('./build/css/taboga.css')
        .pipe(minify({compatibility: 'ie8'}))
        .pipe(rename({
            suffix: '.min'
        }))
        .pipe(gulp.dest('./build/css'));
});

gulp.task('scripts', function () {
    return gulp.src('./resources/js/taboga.js')
        .pipe(uglify())
        .pipe(rename('taboga.min.js'))
        .pipe(gulp.dest('./build/js'));
});

// Rerun the task when a file changes

gulp.task('watch', function () {

    gulp.watch(config.sassPath + '/**/*.scss', ['css', 'taboga']);

});

gulp.task('default', ['bower', 'css', 'taboga', 'js', 'styles', 'scripts']);


text:
#import <iWorkImport/GQDTDateFormat.h>

@interface GQDTDateFormat (Private)
- (int)readAttributesFromReader:(struct _xmlTextReader *)arg1;
@end


text:
var _ = require('underscore');

module.exports = function(type) {
    if(type == "database") {
        return {
            datasource: "database",
            dbtype: global.environment.dbtype,
            tileRoute: '/database/:dbname/table/:table/:z/:x/:y.*',
            grainstore: {datasource: global.environment.datasource},
            parameterParser: function(req, callback){
                req.params.interactivity = null;

                req.params.sql = "SELECT * FROM " + req.params.table;

                req.params =  _.extend({}, req.params);
                _.extend(req.params, req.query);

                callback(null,req);
            }
        }
    } else {
        return {
            datasource: type,
            tileRoute: '/'+type+'/:pathname/:z/:x/:y.*',
            parameterParser: function(req, callback){
                req.params.interactivity = null;

                req.params.pathname = "./test/fixtures/" + req.params.pathname;

                req.params =  _.extend({}, req.params);
                _.extend(req.params, req.query);

                callback(null,req);
            }
        }
    }
};


text:
JSONAPI.configure do |config|
  config.default_paginator = :paged

  config.default_page_size = 10
  config.maximum_page_size = 4000

  config.top_level_meta_include_record_count = true
  config.top_level_meta_record_count_key = :record_count

  # config.top_level_meta_include_page_count = true
  # config.top_level_meta_page_count_key = :page_count
end


text:
typedef uint32_t CustomIntType;

#endif  // BUILD_RUST_TESTS_TEST_MIXED_SOURCE_SET_DEPENDENCY_HEADER_H_