text:
.class public Landroid/support/v4/content/LocalBroadcastManager;
.super Ljava/lang/Object;
.source "LocalBroadcastManager.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;,
        Landroid/support/v4/content/LocalBroadcastManager$BroadcastRecord;
    }
.end annotation

# static fields
.field private static final DEBUG:Z = false

.field static final MSG_EXEC_PENDING_BROADCASTS:I = 0x1

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

.field private static mInstance:Landroid/support/v4/content/LocalBroadcastManager;

.field private static final mLock:Ljava/lang/Object;

# instance fields
.field private final mActions:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/util/ArrayList",
            "<",
            "Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;",
            ">;>;"
        }
    .end annotation
.end field

.field private final mAppContext:Landroid/content/Context;

.field private final mHandler:Landroid/os/Handler;

.field private final mPendingBroadcasts:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Landroid/support/v4/content/LocalBroadcastManager$BroadcastRecord;",
            ">;"
        }
    .end annotation
.end field

.field private final mReceivers:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Landroid/content/BroadcastReceiver;",
            "Ljava/util/ArrayList",
            "<",
            "Landroid/content/IntentFilter;",
            ">;>;"
        }
    .end annotation
.end field

# direct methods
.method static synthetic -wrap0(Landroid/support/v4/content/LocalBroadcastManager;)V
    .locals 0

    invoke-direct {p0}, Landroid/support/v4/content/LocalBroadcastManager;->executePendingBroadcasts()V

    return-void
.end method

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

    .prologue
    .line 96
    new-instance v0, Ljava/lang/Object;

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

    sput-object v0, Landroid/support/v4/content/LocalBroadcastManager;->mLock:Ljava/lang/Object;

    .line 46
    return-void
.end method

.method private constructor <init>(Landroid/content/Context;)V
    .locals 2
    .param p1, "context"    # Landroid/content/Context;

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

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

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

    .line 84
    iput-object v0, p0, Landroid/support/v4/content/LocalBroadcastManager;->mReceivers:Ljava/util/HashMap;

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

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

    .line 86
    iput-object v0, p0, Landroid/support/v4/content/LocalBroadcastManager;->mActions:Ljava/util/HashMap;

    .line 90
    new-instance v0, Ljava/util/ArrayList;

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

    .line 89
    iput-object v0, p0, Landroid/support/v4/content/LocalBroadcastManager;->mPendingBroadcasts:Ljava/util/ArrayList;

    .line 109
    iput-object p1, p0, Landroid/support/v4/content/LocalBroadcastManager;->mAppContext:Landroid/content/Context;

    .line 110
    new-instance v0, Landroid/support/v4/content/LocalBroadcastManager$1;

    invoke-virtual {p1}, Landroid/content/Context;->getMainLooper()Landroid/os/Looper;

    move-result-object v1

    invoke-direct {v0, p0, v1}, Landroid/support/v4/content/LocalBroadcastManager$1;-><init>(Landroid/support/v4/content/LocalBroadcastManager;Landroid/os/Looper;)V

    iput-object v0, p0, Landroid/support/v4/content/LocalBroadcastManager;->mHandler:Landroid/os/Handler;

    .line 108
    return-void
.end method

.method private executePendingBroadcasts()V
    .locals 8

    .prologue
    .line 284
    :cond_0
    const/4 v2, 0x0

    .line 285
    .local v2, "brs":[Landroid/support/v4/content/LocalBroadcastManager$BroadcastRecord;
    iget-object v6, p0, Landroid/support/v4/content/LocalBroadcastManager;->mReceivers:Ljava/util/HashMap;

    monitor-enter v6

    .line 286
    :try_start_0
    iget-object v5, p0, Landroid/support/v4/content/LocalBroadcastManager;->mPendingBroadcasts:Ljava/util/ArrayList;

    invoke-virtual {v5}, Ljava/util/ArrayList;->size()I
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    move-result v0

    .line 287
    .local v0, "N":I
    if-gtz v0, :cond_1

    monitor-exit v6

    .line 288
    return-void

    .line 290
    :cond_1
    :try_start_1
    new-array v2, v0, [Landroid/support/v4/content/LocalBroadcastManager$BroadcastRecord;

    .line 291
    .local v2, "brs":[Landroid/support/v4/content/LocalBroadcastManager$BroadcastRecord;
    iget-object v5, p0, Landroid/support/v4/content/LocalBroadcastManager;->mPendingBroadcasts:Ljava/util/ArrayList;

    invoke-virtual {v5, v2}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    .line 292
    iget-object v5, p0, Landroid/support/v4/content/LocalBroadcastManager;->mPendingBroadcasts:Ljava/util/ArrayList;

    invoke-virtual {v5}, Ljava/util/ArrayList;->clear()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    monitor-exit v6

    .line 294
    const/4 v3, 0x0

    .local v3, "i":I
    :goto_0
    array-length v5, v2

    if-ge v3, v5, :cond_0

    .line 295
    aget-object v1, v2, v3

    .line 296
    .local v1, "br":Landroid/support/v4/content/LocalBroadcastManager$BroadcastRecord;
    const/4 v4, 0x0

    .local v4, "j":I
    :goto_1
    iget-object v5, v1, Landroid/support/v4/content/LocalBroadcastManager$BroadcastRecord;->receivers:Ljava/util/ArrayList;

    invoke-virtual {v5}, Ljava/util/ArrayList;->size()I

    move-result v5

    if-ge v4, v5, :cond_2

    .line 297
    iget-object v5, v1, Landroid/support/v4/content/LocalBroadcastManager$BroadcastRecord;->receivers:Ljava/util/ArrayList;

    invoke-virtual {v5, v4}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;

    iget-object v5, v5, Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;->receiver:Landroid/content/BroadcastReceiver;

    iget-object v6, p0, Landroid/support/v4/content/LocalBroadcastManager;->mAppContext:Landroid/content/Context;

    iget-object v7, v1, Landroid/support/v4/content/LocalBroadcastManager$BroadcastRecord;->intent:Landroid/content/Intent;

    invoke-virtual {v5, v6, v7}, Landroid/content/BroadcastReceiver;->onReceive(Landroid/content/Context;Landroid/content/Intent;)V

    .line 296
    add-int/lit8 v4, v4, 0x1

    goto :goto_1

    .line 285
    .end local v0    # "N":I
    .end local v1    # "br":Landroid/support/v4/content/LocalBroadcastManager$BroadcastRecord;
    .end local v2    # "brs":[Landroid/support/v4/content/LocalBroadcastManager$BroadcastRecord;
    .end local v3    # "i":I
    .end local v4    # "j":I
    :catchall_0
    move-exception v5

    monitor-exit v6

    throw v5

    .line 294
    .restart local v0    # "N":I
    .restart local v1    # "br":Landroid/support/v4/content/LocalBroadcastManager$BroadcastRecord;
    .restart local v2    # "brs":[Landroid/support/v4/content/LocalBroadcastManager$BroadcastRecord;
    .restart local v3    # "i":I
    .restart local v4    # "j":I
    :cond_2
    add-int/lit8 v3, v3, 0x1

    goto :goto_0
.end method

.method public static getInstance(Landroid/content/Context;)Landroid/support/v4/content/LocalBroadcastManager;
    .locals 3
    .param p0, "context"    # Landroid/content/Context;

    .prologue
    .line 100
    sget-object v1, Landroid/support/v4/content/LocalBroadcastManager;->mLock:Ljava/lang/Object;

    monitor-enter v1

    .line 101
    :try_start_0
    sget-object v0, Landroid/support/v4/content/LocalBroadcastManager;->mInstance:Landroid/support/v4/content/LocalBroadcastManager;

    if-nez v0, :cond_0

    .line 102
    new-instance v0, Landroid/support/v4/content/LocalBroadcastManager;

    invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v2

    invoke-direct {v0, v2}, Landroid/support/v4/content/LocalBroadcastManager;-><init>(Landroid/content/Context;)V

    sput-object v0, Landroid/support/v4/content/LocalBroadcastManager;->mInstance:Landroid/support/v4/content/LocalBroadcastManager;

    .line 104
    :cond_0
    sget-object v0, Landroid/support/v4/content/LocalBroadcastManager;->mInstance:Landroid/support/v4/content/LocalBroadcastManager;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit v1

    return-object v0

    .line 100
    :catchall_0
    move-exception v0

    monitor-exit v1

    throw v0
.end method

# virtual methods
.method public registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)V
    .locals 7
    .param p1, "receiver"    # Landroid/content/BroadcastReceiver;
    .param p2, "filter"    # Landroid/content/IntentFilter;

    .prologue
    .line 134
    iget-object v6, p0, Landroid/support/v4/content/LocalBroadcastManager;->mReceivers:Ljava/util/HashMap;

    monitor-enter v6

    .line 135
    :try_start_0
    new-instance v2, Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;

    invoke-direct {v2, p2, p1}, Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;-><init>(Landroid/content/IntentFilter;Landroid/content/BroadcastReceiver;)V

    .line 136
    .local v2, "entry":Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;
    iget-object v5, p0, Landroid/support/v4/content/LocalBroadcastManager;->mReceivers:Ljava/util/HashMap;

    invoke-virtual {v5, p1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/util/ArrayList;

    .line 137
    .local v3, "filters":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/content/IntentFilter;>;"
    if-nez v3, :cond_0

    .line 138
    new-instance v3, Ljava/util/ArrayList;

    .end local v3    # "filters":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/content/IntentFilter;>;"
    const/4 v5, 0x1

    invoke-direct {v3, v5}, Ljava/util/ArrayList;-><init>(I)V

    .line 139
    .restart local v3    # "filters":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/content/IntentFilter;>;"
    iget-object v5, p0, Landroid/support/v4/content/LocalBroadcastManager;->mReceivers:Ljava/util/HashMap;

    invoke-virtual {v5, p1, v3}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 141
    :cond_0
    invoke-virtual {v3, p2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 142
    const/4 v4, 0x0

    .local v4, "i":I
    :goto_0
    invoke-virtual {p2}, Landroid/content/IntentFilter;->countActions()I

    move-result v5

    if-ge v4, v5, :cond_2

    .line 143
    invoke-virtual {p2, v4}, Landroid/content/IntentFilter;->getAction(I)Ljava/lang/String;

    move-result-object v0

    .line 144
    .local v0, "action":Ljava/lang/String;
    iget-object v5, p0, Landroid/support/v4/content/LocalBroadcastManager;->mActions:Ljava/util/HashMap;

    invoke-virtual {v5, v0}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/util/ArrayList;

    .line 145
    .local v1, "entries":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;>;"
    if-nez v1, :cond_1

    .line 146
    new-instance v1, Ljava/util/ArrayList;

    .end local v1    # "entries":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;>;"
    const/4 v5, 0x1

    invoke-direct {v1, v5}, Ljava/util/ArrayList;-><init>(I)V

    .line 147
    .restart local v1    # "entries":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;>;"
    iget-object v5, p0, Landroid/support/v4/content/LocalBroadcastManager;->mActions:Ljava/util/HashMap;

    invoke-virtual {v5, v0, v1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 149
    :cond_1
    invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 142
    add-int/lit8 v4, v4, 0x1

    goto :goto_0

    .end local v0    # "action":Ljava/lang/String;
    .end local v1    # "entries":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;>;"
    :cond_2
    monitor-exit v6

    .line 133
    return-void

    .line 134
    .end local v2    # "entry":Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;
    .end local v3    # "filters":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/content/IntentFilter;>;"
    .end local v4    # "i":I
    :catchall_0
    move-exception v5

    monitor-exit v6

    throw v5
.end method

.method public sendBroadcast(Landroid/content/Intent;)Z
    .locals 17
    .param p1, "intent"    # Landroid/content/Intent;

    .prologue
    .line 201
    move-object/from16 v0, p0

    iget-object v15, v0, Landroid/support/v4/content/LocalBroadcastManager;->mReceivers:Ljava/util/HashMap;

    monitor-enter v15

    .line 202
    :try_start_0
    invoke-virtual/range {p1 .. p1}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v2

    .line 204
    .local v2, "action":Ljava/lang/String;
    move-object/from16 v0, p0

    iget-object v1, v0, Landroid/support/v4/content/LocalBroadcastManager;->mAppContext:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v1

    .line 203
    move-object/from16 v0, p1

    invoke-virtual {v0, v1}, Landroid/content/Intent;->resolveTypeIfNeeded(Landroid/content/ContentResolver;)Ljava/lang/String;

    move-result-object v3

    .line 205
    .local v3, "type":Ljava/lang/String;
    invoke-virtual/range {p1 .. p1}, Landroid/content/Intent;->getData()Landroid/net/Uri;

    move-result-object v5

    .line 206
    .local v5, "data":Landroid/net/Uri;
    invoke-virtual/range {p1 .. p1}, Landroid/content/Intent;->getScheme()Ljava/lang/String;

    move-result-object v4

    .line 207
    .local v4, "scheme":Ljava/lang/String;
    invoke-virtual/range {p1 .. p1}, Landroid/content/Intent;->getCategories()Ljava/util/Set;

    move-result-object v6

    .line 210
    .local v6, "categories":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/String;>;"
    invoke-virtual/range {p1 .. p1}, Landroid/content/Intent;->getFlags()I

    move-result v1

    and-int/lit8 v1, v1, 0x8

    if-eqz v1, :cond_4

    const/4 v8, 0x1

    .line 211
    .local v8, "debug":Z
    :goto_0
    if-eqz v8, :cond_0

    .line 212
    const-string/jumbo v1, "LocalBroadcastManager"

    new-instance v7, Ljava/lang/StringBuilder;

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

    const-string/jumbo v16, "Resolving type "

    move-object/from16 v0, v16

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

    move-result-object v7

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

    move-result-object v7

    const-string/jumbo v16, " scheme "

    move-object/from16 v0, v16

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

    move-result-object v7

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

    move-result-object v7

    .line 213
    const-string/jumbo v16, " of intent "

    .line 212
    move-object/from16 v0, v16

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

    move-result-object v7

    move-object/from16 v0, p1

    invoke-virtual {v7, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v7

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

    move-result-object v7

    .line 211
    invoke-static {v1, v7}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 215
    :cond_0
    move-object/from16 v0, p0

    iget-object v1, v0, Landroid/support/v4/content/LocalBroadcastManager;->mActions:Ljava/util/HashMap;

    invoke-virtual/range {p1 .. p1}, Landroid/content/Intent;->getAction()Ljava/lang/String;

    move-result-object v7

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

    move-result-object v9

    check-cast v9, Ljava/util/ArrayList;

    .line 216
    .local v9, "entries":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;>;"
    if-eqz v9, :cond_c

    .line 217
    if-eqz v8, :cond_1

    const-string/jumbo v1, "LocalBroadcastManager"

    new-instance v7, Ljava/lang/StringBuilder;

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

    const-string/jumbo v16, "Action list: "

    move-object/from16 v0, v16

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

    move-result-object v7

    invoke-virtual {v7, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v7

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

    move-result-object v7

    invoke-static {v1, v7}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 219
    :cond_1
    const/4 v14, 0x0

    .line 220
    .local v14, "receivers":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;>;"
    const/4 v10, 0x0

    .end local v14    # "receivers":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;>;"
    .local v10, "i":I
    :goto_1
    invoke-virtual {v9}, Ljava/util/ArrayList;->size()I

    move-result v1

    if-ge v10, v1, :cond_9

    .line 221
    invoke-virtual {v9, v10}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v13

    check-cast v13, Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;

    .line 222
    .local v13, "receiver":Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;
    if-eqz v8, :cond_2

    const-string/jumbo v1, "LocalBroadcastManager"

    new-instance v7, Ljava/lang/StringBuilder;

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

    const-string/jumbo v16, "Matching against filter "

    move-object/from16 v0, v16

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

    move-result-object v7

    iget-object v0, v13, Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;->filter:Landroid/content/IntentFilter;

    move-object/from16 v16, v0

    move-object/from16 v0, v16

    invoke-virtual {v7, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v7

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

    move-result-object v7

    invoke-static {v1, v7}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 224
    :cond_2
    iget-boolean v1, v13, Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;->broadcasting:Z

    if-eqz v1, :cond_5

    .line 225
    if-eqz v8, :cond_3

    .line 226
    const-string/jumbo v1, "LocalBroadcastManager"

    const-string/jumbo v7, "  Filter\'s target already added"

    invoke-static {v1, v7}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 220
    :cond_3
    :goto_2
    add-int/lit8 v10, v10, 0x1

    goto :goto_1

    .line 210
    .end local v8    # "debug":Z
    .end local v9    # "entries":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;>;"
    .end local v10    # "i":I
    .end local v13    # "receiver":Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;
    :cond_4
    const/4 v8, 0x0

    .restart local v8    # "debug":Z
    goto/16 :goto_0

    .line 231
    .restart local v9    # "entries":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;>;"
    .restart local v10    # "i":I
    .restart local v13    # "receiver":Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;
    :cond_5
    iget-object v1, v13, Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;->filter:Landroid/content/IntentFilter;

    .line 232
    const-string/jumbo v7, "LocalBroadcastManager"

    .line 231
    invoke-virtual/range {v1 .. v7}, Landroid/content/IntentFilter;->match(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/net/Uri;Ljava/util/Set;Ljava/lang/String;)I

    move-result v11

    .line 233
    .local v11, "match":I
    if-ltz v11, :cond_8

    .line 234
    if-eqz v8, :cond_6

    const-string/jumbo v1, "LocalBroadcastManager"

    new-instance v7, Ljava/lang/StringBuilder;

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

    const-string/jumbo v16, "  Filter matched!  match=0x"

    move-object/from16 v0, v16

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

    move-result-object v7

    .line 235
    invoke-static {v11}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v16

    .line 234
    move-object/from16 v0, v16

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

    move-result-object v7

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

    move-result-object v7

    invoke-static {v1, v7}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 236
    :cond_6
    if-nez v14, :cond_7

    .line 237
    new-instance v14, Ljava/util/ArrayList;

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

    .line 239
    :cond_7
    invoke-virtual {v14, v13}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 240
    const/4 v1, 0x1

    iput-boolean v1, v13, Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;->broadcasting:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_2

    .line 201
    .end local v2    # "action":Ljava/lang/String;
    .end local v3    # "type":Ljava/lang/String;
    .end local v4    # "scheme":Ljava/lang/String;
    .end local v5    # "data":Landroid/net/Uri;
    .end local v6    # "categories":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/String;>;"
    .end local v8    # "debug":Z
    .end local v9    # "entries":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;>;"
    .end local v10    # "i":I
    .end local v11    # "match":I
    .end local v13    # "receiver":Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;
    :catchall_0
    move-exception v1

    monitor-exit v15

    throw v1

    .line 242
    .restart local v2    # "action":Ljava/lang/String;
    .restart local v3    # "type":Ljava/lang/String;
    .restart local v4    # "scheme":Ljava/lang/String;
    .restart local v5    # "data":Landroid/net/Uri;
    .restart local v6    # "categories":Ljava/util/Set;, "Ljava/util/Set<Ljava/lang/String;>;"
    .restart local v8    # "debug":Z
    .restart local v9    # "entries":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;>;"
    .restart local v10    # "i":I
    .restart local v11    # "match":I
    .restart local v13    # "receiver":Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;
    :cond_8
    if-eqz v8, :cond_3

    .line 244
    packed-switch v11, :pswitch_data_0

    .line 249
    :try_start_1
    const-string/jumbo v12, "unknown reason"

    .line 251
    .local v12, "reason":Ljava/lang/String;
    :goto_3
    const-string/jumbo v1, "LocalBroadcastManager"

    new-instance v7, Ljava/lang/StringBuilder;

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

    const-string/jumbo v16, "  Filter did not match: "

    move-object/from16 v0, v16

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

    move-result-object v7

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

    move-result-object v7

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

    move-result-object v7

    invoke-static {v1, v7}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_2

    .line 245
    .end local v12    # "reason":Ljava/lang/String;
    :pswitch_0
    const-string/jumbo v12, "action"

    .restart local v12    # "reason":Ljava/lang/String;
    goto :goto_3

    .line 246
    .end local v12    # "reason":Ljava/lang/String;
    :pswitch_1
    const-string/jumbo v12, "category"

    .restart local v12    # "reason":Ljava/lang/String;
    goto :goto_3

    .line 247
    .end local v12    # "reason":Ljava/lang/String;
    :pswitch_2
    const-string/jumbo v12, "data"

    .restart local v12    # "reason":Ljava/lang/String;
    goto :goto_3

    .line 248
    .end local v12    # "reason":Ljava/lang/String;
    :pswitch_3
    const-string/jumbo v12, "type"

    .restart local v12    # "reason":Ljava/lang/String;
    goto :goto_3

    .line 256
    .end local v11    # "match":I
    .end local v12    # "reason":Ljava/lang/String;
    .end local v13    # "receiver":Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;
    :cond_9
    if-eqz v14, :cond_c

    .line 257
    const/4 v10, 0x0

    :goto_4
    invoke-virtual {v14}, Ljava/util/ArrayList;->size()I

    move-result v1

    if-ge v10, v1, :cond_a

    .line 258
    invoke-virtual {v14, v10}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;

    const/4 v7, 0x0

    iput-boolean v7, v1, Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;->broadcasting:Z

    .line 257
    add-int/lit8 v10, v10, 0x1

    goto :goto_4

    .line 260
    :cond_a
    move-object/from16 v0, p0

    iget-object v1, v0, Landroid/support/v4/content/LocalBroadcastManager;->mPendingBroadcasts:Ljava/util/ArrayList;

    new-instance v7, Landroid/support/v4/content/LocalBroadcastManager$BroadcastRecord;

    move-object/from16 v0, p1

    invoke-direct {v7, v0, v14}, Landroid/support/v4/content/LocalBroadcastManager$BroadcastRecord;-><init>(Landroid/content/Intent;Ljava/util/ArrayList;)V

    invoke-virtual {v1, v7}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 261
    move-object/from16 v0, p0

    iget-object v1, v0, Landroid/support/v4/content/LocalBroadcastManager;->mHandler:Landroid/os/Handler;

    const/4 v7, 0x1

    invoke-virtual {v1, v7}, Landroid/os/Handler;->hasMessages(I)Z

    move-result v1

    if-nez v1, :cond_b

    .line 262
    move-object/from16 v0, p0

    iget-object v1, v0, Landroid/support/v4/content/LocalBroadcastManager;->mHandler:Landroid/os/Handler;

    const/4 v7, 0x1

    invoke-virtual {v1, v7}, Landroid/os/Handler;->sendEmptyMessage(I)Z
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 264
    :cond_b
    const/4 v1, 0x1

    monitor-exit v15

    return v1

    .end local v10    # "i":I
    :cond_c
    monitor-exit v15

    .line 268
    const/4 v1, 0x0

    return v1

    .line 244
    :pswitch_data_0
    .packed-switch -0x4
        :pswitch_1
        :pswitch_0
        :pswitch_2
        :pswitch_3
    .end packed-switch
.end method

.method public sendBroadcastSync(Landroid/content/Intent;)V
    .locals 1
    .param p1, "intent"    # Landroid/content/Intent;

    .prologue
    .line 277
    invoke-virtual {p0, p1}, Landroid/support/v4/content/LocalBroadcastManager;->sendBroadcast(Landroid/content/Intent;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 278
    invoke-direct {p0}, Landroid/support/v4/content/LocalBroadcastManager;->executePendingBroadcasts()V

    .line 276
    :cond_0
    return-void
.end method

.method public unregisterReceiver(Landroid/content/BroadcastReceiver;)V
    .locals 9
    .param p1, "receiver"    # Landroid/content/BroadcastReceiver;

    .prologue
    .line 164
    iget-object v8, p0, Landroid/support/v4/content/LocalBroadcastManager;->mReceivers:Ljava/util/HashMap;

    monitor-enter v8

    .line 165
    :try_start_0
    iget-object v7, p0, Landroid/support/v4/content/LocalBroadcastManager;->mReceivers:Ljava/util/HashMap;

    invoke-virtual {v7, p1}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/ArrayList;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 166
    .local v2, "filters":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/content/IntentFilter;>;"
    if-nez v2, :cond_0

    monitor-exit v8

    .line 167
    return-void

    .line 169
    :cond_0
    const/4 v3, 0x0

    .local v3, "i":I
    :goto_0
    :try_start_1
    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v7

    if-ge v3, v7, :cond_5

    .line 170
    invoke-virtual {v2, v3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/content/IntentFilter;

    .line 171
    .local v1, "filter":Landroid/content/IntentFilter;
    const/4 v4, 0x0

    .local v4, "j":I
    :goto_1
    invoke-virtual {v1}, Landroid/content/IntentFilter;->countActions()I

    move-result v7

    if-ge v4, v7, :cond_4

    .line 172
    invoke-virtual {v1, v4}, Landroid/content/IntentFilter;->getAction(I)Ljava/lang/String;

    move-result-object v0

    .line 173
    .local v0, "action":Ljava/lang/String;
    iget-object v7, p0, Landroid/support/v4/content/LocalBroadcastManager;->mActions:Ljava/util/HashMap;

    invoke-virtual {v7, v0}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/util/ArrayList;

    .line 174
    .local v6, "receivers":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;>;"
    if-eqz v6, :cond_3

    .line 175
    const/4 v5, 0x0

    .local v5, "k":I
    :goto_2
    invoke-virtual {v6}, Ljava/util/ArrayList;->size()I

    move-result v7

    if-ge v5, v7, :cond_2

    .line 176
    invoke-virtual {v6, v5}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v7

    check-cast v7, Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;

    iget-object v7, v7, Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;->receiver:Landroid/content/BroadcastReceiver;

    if-ne v7, p1, :cond_1

    .line 177
    invoke-virtual {v6, v5}, Ljava/util/ArrayList;->remove(I)Ljava/lang/Object;

    .line 178
    add-int/lit8 v5, v5, -0x1

    .line 175
    :cond_1
    add-int/lit8 v5, v5, 0x1

    goto :goto_2

    .line 181
    :cond_2
    invoke-virtual {v6}, Ljava/util/ArrayList;->size()I

    move-result v7

    if-gtz v7, :cond_3

    .line 182
    iget-object v7, p0, Landroid/support/v4/content/LocalBroadcastManager;->mActions:Ljava/util/HashMap;

    invoke-virtual {v7, v0}, Ljava/util/HashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 171
    .end local v5    # "k":I
    :cond_3
    add-int/lit8 v4, v4, 0x1

    goto :goto_1

    .line 169
    .end local v0    # "action":Ljava/lang/String;
    .end local v6    # "receivers":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/support/v4/content/LocalBroadcastManager$ReceiverRecord;>;"
    :cond_4
    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    .end local v1    # "filter":Landroid/content/IntentFilter;
    .end local v4    # "j":I
    :cond_5
    monitor-exit v8

    .line 163
    return-void

    .line 164
    .end local v2    # "filters":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Landroid/content/IntentFilter;>;"
    .end local v3    # "i":I
    :catchall_0
    move-exception v7

    monitor-exit v8

    throw v7
.end method


text:
package com.google.template.soy.passes;

import com.google.common.base.Preconditions;
import com.google.template.soy.basetree.Node;
import com.google.template.soy.basetree.NodeVisitor;
import com.google.template.soy.basetree.SyntaxVersion;
import com.google.template.soy.basetree.SyntaxVersionUpperBound;
import com.google.template.soy.error.ErrorReporter;
import com.google.template.soy.error.SoyErrorKind;
import com.google.template.soy.exprtree.FunctionNode;
import com.google.template.soy.shared.internal.BuiltinFunction;
import com.google.template.soy.soytree.SoyFileNode;
import com.google.template.soy.soytree.SoyTreeUtils;
import com.google.template.soy.soytree.TemplateNode;

/**
 * Reports syntax version errors for unparsed expressions and {@link SyntaxVersionUpperBound}s that
 * aren't compatible with a required version.
 *
 */
final class ReportSyntaxVersionErrors {

  private static final SoyErrorKind SYNTAX_VERSION_OUT_OF_BOUNDS = SoyErrorKind.of("{0}: {1}");

  private final SyntaxVersion requiredSyntaxVersion;
  private final ErrorReporter errorReporter;
  private final String errorPreamble;

  /**
   * @param requiredSyntaxVersion The required minimum syntax version to check for.
   * @param isDeclared True if the required syntax version that we're checking for is user-declared.
   *     False if it is inferred.
   * @param errorReporter For reporting errors.
   */
  ReportSyntaxVersionErrors(
      SyntaxVersion requiredSyntaxVersion, boolean isDeclared, ErrorReporter errorReporter) {
    this.errorReporter = errorReporter;
    this.requiredSyntaxVersion = requiredSyntaxVersion;
    this.errorPreamble =
        (requiredSyntaxVersion == SyntaxVersion.V1_0)
            ? "incorrect v1 syntax"
            : ((isDeclared ? "declared" : "inferred")
                + " syntax version "
                + requiredSyntaxVersion
                + " not satisfied");
  }

  public void report(SoyFileNode node) {
    for (final TemplateNode template : node.getChildren()) {
      SoyTreeUtils.visitAllNodes(
          template,
          new NodeVisitor<Node, Boolean>() {
            @Override
            public Boolean exec(Node node) {
              visitNode(template, node);
              return true; // keep visiting
            }
          });
    }
  }

  private void visitNode(TemplateNode template, Node node) {
    if (!node.couldHaveSyntaxVersionAtLeast(requiredSyntaxVersion)) {
      SyntaxVersionUpperBound syntaxVersionBound = node.getSyntaxVersionUpperBound();
      Preconditions.checkNotNull(syntaxVersionBound);
      errorReporter.report(
          node.getSourceLocation(),
          SYNTAX_VERSION_OUT_OF_BOUNDS,
          errorPreamble,
          syntaxVersionBound.reasonStr);
    }
    if (node instanceof FunctionNode) {
      String functionName = ((FunctionNode) node).getFunctionName();
      if (functionName.equals(BuiltinFunction.V1_EXPRESSION.getName())
          && template.couldHaveSyntaxVersionAtLeast(SyntaxVersion.V2_0)) {
        errorReporter.report(
            node.getSourceLocation(),
            SYNTAX_VERSION_OUT_OF_BOUNDS,
            errorPreamble,
            "The v1Expression function can only be used in templates marked with the "
                + "deprecatedV1=\"true\" attribute");
      }
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
<style>
	html { overflow: hidden; }
	body {
		font: 14pt Arial, sans-serif;
		background: lightgrey;
		display: flex;
		flex-direction: column;
		height: 100vh;
		width: 100%;
		margin: 0 0;
	}

	canvas {
		display: inline-block;
		background: #202020;
		width: 95%;
		height: 45%;
		box-shadow: 0px 0px 10px blue;
	}
	#controls {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-around;
		height: 20%;
		width: 100%;
	}
	#record { height: 15vh; }
	#record.recording {
		background: red;
		background: -webkit-radial-gradient(center, ellipse cover, #ff0000 0%,lightgrey 75%,lightgrey 100%,#7db9e8 100%);
		background: -moz-radial-gradient(center, ellipse cover, #ff0000 0%,lightgrey 75%,lightgrey 100%,#7db9e8 100%);
		background: radial-gradient(center, ellipse cover, #ff0000 0%,lightgrey 75%,lightgrey 100%,#7db9e8 100%);
	}
	#save, #save img { height: 10vh; }
	#save { opacity: 0.25;}
	#save[download] { opacity: 1;}
	#viz {
		height: 80%;
		width: 100%;
		display: flex;
		flex-direction: column;
		justify-content: space-around;
		align-items: center;
	}
	@media (orientation: landscape) {
		body { flex-direction: row;}
		#controls { flex-direction: column; height: 100%; width: 10%;}
		#viz { height: 100%; width: 90%;}
	}

	</style>


text:
include ../../run-make-fulldeps/tools.mk

# ignore-none no-std is not supported
# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for 'std'

# Ensure that modifying a crate on disk (without recompiling it)
# does not cause ICEs in downstream crates.
# Previously, we would call `SourceMap.guess_head_span` on a span
# from an external crate, which would cause us to read an upstream
# source file from disk during compilation of a downstream crate
# See #86480 for more details

INCR=$(TMPDIR)/incr

all:
	cp first_crate.rs second_crate.rs $(TMPDIR)
	$(RUSTC) $(TMPDIR)/first_crate.rs  -C incremental=$(INCR) --target $(TARGET) --crate-type lib
	$(RUSTC) $(TMPDIR)/second_crate.rs -C incremental=$(INCR) --target $(TARGET)  --extern first-crate=$(TMPDIR) --crate-type lib
	rm $(TMPDIR)/first_crate.rs
	$(RUSTC) $(TMPDIR)/second_crate.rs  -C incremental=$(INCR) --target $(TARGET) --cfg second_run --crate-type lib


text:
<?php

namespace Acme\HelloBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * EidrReviewCriteriaSubsection
 *
 * @ORM\Table(name="eidr_review_criteria_subsection", indexes={@ORM\Index(name="fk_EIDR_Review_Criteria_Subsection_EIDR_Review_Criteria1_idx", columns={"criteria_number"})})
 * @ORM\Entity
 */
class EidrReviewCriteriaSubsection
{
    /**
     * @var string
     *
     * @ORM\Column(name="criteria_question", type="string", length=10000, nullable=false)
     */
    private $criteriaQuestion;

    /**
     * @var integer
     *
     * @ORM\Column(name="criteria_subsection_number", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $criteriaSubsectionNumber;

    /**
     * @var \Acme\HelloBundle\Entity\EidrReviewCriteria
     *
     * @ORM\ManyToOne(targetEntity="Acme\HelloBundle\Entity\EidrReviewCriteria")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="criteria_number", referencedColumnName="criteria_number")
     * })
     */
    private $criteriaNumber;

    /**
     * Set criteriaQuestion
     *
     * @param string $criteriaQuestion
     * @return EidrReviewCriteriaSubsection
     */
    public function setCriteriaQuestion($criteriaQuestion)
    {
        $this->criteriaQuestion = $criteriaQuestion;

        return $this;
    }

    /**
     * Get criteriaQuestion
     *
     * @return string
     */
    public function getCriteriaQuestion()
    {
        return $this->criteriaQuestion;
    }

    /**
     * Get criteriaSubsectionNumber
     *
     * @return integer
     */
    public function getCriteriaSubsectionNumber()
    {
        return $this->criteriaSubsectionNumber;
    }

    /**
     * Set criteriaNumber
     *
     * @param \Acme\HelloBundle\Entity\EidrReviewCriteria $criteriaNumber
     * @return EidrReviewCriteriaSubsection
     */
    public function setCriteriaNumber(\Acme\HelloBundle\Entity\EidrReviewCriteria $criteriaNumber = null)
    {
        $this->criteriaNumber = $criteriaNumber;

        return $this;
    }

    /**
     * Get criteriaNumber
     *
     * @return \Acme\HelloBundle\Entity\EidrReviewCriteria
     */
    public function getCriteriaNumber()
    {
        return $this->criteriaNumber;
    }
}


text:
eduID Sign Up
=============

This is the eduID Sign Up application.

The documentation for this application is located at the docs directory.


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using AdvUtils;

namespace Txt2Vec
{
    public class Shrink
    {
        public void Run(string strModelFileName, string strNewModelFileName, string strDictFileName)
        {
            string strLine = null;

            //Load lexical dictionary
            Logger.WriteLine("Load lexical dictionary...");
            StreamReader sr = new StreamReader(strDictFileName);
            HashSet<string> setTerm = new HashSet<string>();
            while ((strLine = sr.ReadLine()) != null)
            {
                string[] items = strLine.Split('\t');
                setTerm.Add(items[0]);
            }
            sr.Close();

            //Load raw model
            Logger.WriteLine("Loading raw model...");
            sr = new StreamReader(strModelFileName);
            BinaryReader br = new BinaryReader(sr.BaseStream);

            int words = br.ReadInt32();
            int size = br.ReadInt32();
            int vqSize = br.ReadInt32();

            Logger.WriteLine("vocabulary size: {0}, vector size: {1}, VQ size: {2}", words, size, vqSize);
            if (vqSize != 0)
            {
                Logger.WriteLine(Logger.Level.err, "Currently, we don't support to shrink vector quantization model.");
                return;
            }

            Dictionary<string, int> vocab = new Dictionary<string, int>();
            Dictionary<int, string> rev_vocab = new Dictionary<int, string>();
            List<string> termList = new List<string>();
            double []M = new double[words * size];

            int newwords = 0;
            for (int b = 0; b < words; b++)
            {
                string strTerm = br.ReadString();
                if (setTerm.Contains(strTerm) == true)
                {
                    termList.Add(strTerm);
                    for (int a = 0; a < size; a++)
                    {
                        M[a + newwords * size] = br.ReadSingle();
                    }
                    newwords++;
                }
                else
                {
                    //Skip the vectors of this word
                    for (int a = 0; a < size; a++)
                    {
                        br.ReadSingle();
                    }
                }
            }
            sr.Close();

            //Save the shrinked model
            Logger.WriteLine("Saving shrinked model...");
            StreamWriter sw = new StreamWriter(strNewModelFileName);
            BinaryWriter bw = new BinaryWriter(sw.BaseStream);

            bw.Write(newwords);
            bw.Write(size);
            bw.Write(vqSize);

            for (int i = 0; i < newwords; i++)
            {
                bw.Write(termList[i]);
                for (int j = 0; j < size; j++)
                {
                    bw.Write((float)M[j + i * size]);
                }
            }
            sw.Close();
        }
    }
}


text:
import json
import os
import six
import urllib
import yaml

from heatclient.common import utils
from heatclient.openstack.common.py3kcompat import urlutils

import heatclient.exc as exc

def _set_template_fields(hc, args, fields):
    if args.template_file:
        tpl = open(args.template_file).read()
        if tpl.startswith('{'):
            fields['template'] = json.loads(tpl)
        else:
            fields['template'] = tpl
    elif args.template_url:
        fields['template_url'] = args.template_url
    elif args.template_object:
        template_body = hc.raw_request('GET', args.template_object)
        if template_body:
            fields['template'] = json.loads(template_body)
        else:
            raise exc.CommandError('Could not fetch template from %s'
                                   % args.template_object)
    else:
        raise exc.CommandError('Need to specify exactly one of '
                               '--template-file, --template-url '
                               'or --template-object')

def _get_file_contents(resource_registry, fields, base_url='',
                       ignore_if=None):
    for key, value in iter(resource_registry.items()):
        if ignore_if and ignore_if(key, value):
            continue

        if base_url != '' and not base_url.endswith('/'):
            base_url = base_url + '/'
        str_url = base_url + value
        try:
            fields['files'][str_url] = urlutils.urlopen(str_url).read()
        except urlutils.URLError:
            raise exc.CommandError('Could not fetch %s from the environment'
                                   % str_url)
        resource_registry[key] = str_url

def _prepare_environment_file(environment_file):
    environment_dir = os.path.dirname(os.path.abspath(environment_file))
    environment_url = urlutils.urljoin(
        'file:', urllib.pathname2url(environment_dir))

    raw_env = open(environment_file).read()
    env = yaml.safe_load(raw_env)
    return environment_url, env

def _process_environment_and_files(args, fields):
    if not args.environment_file:
        return

    environment_url, env = _prepare_environment_file(args.environment_file)
    _resolve_environment_urls(fields, environment_url, env)

def _resolve_environment_urls(fields, environment_url, env):
    fields['environment'] = env
    fields['files'] = {}

    rr = env.get('resource_registry', {})
    base_url = rr.get('base_url', environment_url)

    def ignore_if(key, value):
        if key == 'base_url':
            return True
        if isinstance(value, dict):
            return True
        if '::' in value:
            # Built in providers like: "X::Compute::Server"
            # don't need downloading.
            return True

    _get_file_contents(rr, fields, base_url, ignore_if)

    for res_name, res_dict in iter(rr.get('resources', {}).items()):
        res_base_url = res_dict.get('base_url', base_url)
        _get_file_contents(res_dict, fields, res_base_url, ignore_if)

@utils.arg('-f', '--template-file', metavar='<FILE>',
           help='Path to the template.')
@utils.arg('-e', '--environment-file', metavar='<FILE>',
           help='Path to the environment.')
@utils.arg('-u', '--template-url', metavar='<URL>',
           help='URL of template.')
@utils.arg('-o', '--template-object', metavar='<URL>',
           help='URL to retrieve template object (e.g from swift)')
@utils.arg('-c', '--create-timeout', metavar='<TIMEOUT>',
           default=60, type=int,
           help='Stack creation timeout in minutes. Default: 60')
@utils.arg('-r', '--enable-rollback', default=False, action="store_true",
           help='Enable rollback on create/update failure')
@utils.arg('-P', '--parameters', metavar='<KEY1=VALUE1;KEY2=VALUE2...>',
           help='Parameter values used to create the stack. '
           'This can be specified multiple times, or once with parameters '
           'separated by semicolon.',
           action='append')
@utils.arg('name', metavar='<STACK_NAME>',
           help='Name of the stack to create.')
def do_create(hc, args):
    '''DEPRECATED! Use stack-create instead.'''
    do_stack_create(hc, args)

@utils.arg('-f', '--template-file', metavar='<FILE>',
           help='Path to the template.')
@utils.arg('-e', '--environment-file', metavar='<FILE>',
           help='Path to the environment.')
@utils.arg('-u', '--template-url', metavar='<URL>',
           help='URL of template.')
@utils.arg('-o', '--template-object', metavar='<URL>',
           help='URL to retrieve template object (e.g from swift)')
@utils.arg('-c', '--create-timeout', metavar='<TIMEOUT>',
           default=60, type=int,
           help='Stack creation timeout in minutes. Default: 60')
@utils.arg('-r', '--enable-rollback', default=False, action="store_true",
           help='Enable rollback on create/update failure')
@utils.arg('-P', '--parameters', metavar='<KEY1=VALUE1;KEY2=VALUE2...>',
           help='Parameter values used to create the stack. '
           'This can be specified multiple times, or once with parameters '
           'separated by semicolon.',
           action='append')
@utils.arg('name', metavar='<STACK_NAME>',
           help='Name of the stack to create.')
def do_stack_create(hc, args):
    '''Create the stack.'''
    fields = {'stack_name': args.name,
              'timeout_mins': args.create_timeout,
              'disable_rollback': not(args.enable_rollback),
              'parameters': utils.format_parameters(args.parameters)}
    _set_template_fields(hc, args, fields)
    _process_environment_and_files(args, fields)

    hc.stacks.create(**fields)
    do_stack_list(hc)

@utils.arg('id', metavar='<NAME or ID>',
           help='Name or ID of stack to delete.')
@utils.arg('output', metavar='<OUTPUT_NAME>',
           help='Name of the output to retrieve.')
def do_output_show(hc, args):
    '''Show the value of a single output.'''
    fields = {'stack_id': args.id}
    try:
        stack = hc.stacks.get(**fields)
        outputs = stack.to_dict()['outputs']
        for output in outputs:
            if output['output_key'] == args.output:
                val = output['output_value']
                if isinstance(val, six.string_types):
                    print val
                else:
                    print utils.json_formatter(val)
                break
        else:
            raise KeyError(args.output)
    except exc.HTTPNotFound:
        raise exc.CommandError('Stack not found: %s' % args.id)
    except KeyError:
        raise exc.CommandError('Output not found: %s' % args.output)

@utils.arg('id', metavar='<NAME or ID>',
           help='Name or ID of stack for which to retrieve outputs.')
def do_output_list(hc, args):
    '''List the available outputs for a given stack.'''
    fields = {'stack_id': args.id}
    try:
        stack = hc.stacks.get(**fields)
    except exc.HTTPNotFound:
        raise exc.CommandError('Stack not found: %s' % args.id)
    else:
        formatters = {
            'Output name': lambda x: x['key'],
            'Output value': utils.scalar_or_json_formatter,
        }

        if 'outputs' in stack.to_dict():
            outputs = [{'key': output['output_key'],
                        'value': output['output_value']}
                       for output in stack.to_dict()['outputs']]
            utils.print_list(outputs, ['Output name', 'Output value'],
                             sortby=0,
                             formatters=formatters)

@utils.arg('id', metavar='<NAME or ID>', help='Name or ID of stack to delete.')
def do_delete(hc, args):
    '''DEPRECATED! Use stack-delete instead.'''
    do_stack_delete(hc, args)

@utils.arg('id', metavar='<NAME or ID>', help='Name or ID of stack to delete.')
def do_stack_delete(hc, args):
    '''Delete the stack.'''
    fields = {'stack_id': args.id}
    try:
        hc.stacks.delete(**fields)
    except exc.HTTPNotFound:
        raise exc.CommandError('Stack not found: %s' % args.id)
    else:
        do_stack_list(hc)

@utils.arg('id', metavar='<NAME or ID>',
           help='Name or ID of stack to suspend.')
def do_action_suspend(hc, args):
    '''Suspend the stack.'''
    fields = {'stack_id': args.id}
    try:
        hc.actions.suspend(**fields)
    except exc.HTTPNotFound:
        raise exc.CommandError('Stack not found: %s' % args.id)
    else:
        do_stack_list(hc)

@utils.arg('id', metavar='<NAME or ID>', help='Name or ID of stack to resume.')
def do_action_resume(hc, args):
    '''Resume the stack.'''
    fields = {'stack_id': args.id}
    try:
        hc.actions.resume(**fields)
    except exc.HTTPNotFound:
        raise exc.CommandError('Stack not found: %s' % args.id)
    else:
        do_stack_list(hc)

@utils.arg('id', metavar='<NAME or ID>',
           help='Name or ID of stack to describe.')
def do_describe(hc, args):
    '''DEPRECATED! Use stack-show instead.'''
    do_stack_show(hc, args)

@utils.arg('id', metavar='<NAME or ID>',
           help='Name or ID of stack to describe.')
def do_stack_show(hc, args):
    '''Describe the stack.'''
    fields = {'stack_id': args.id}
    try:
        stack = hc.stacks.get(**fields)
    except exc.HTTPNotFound:
        raise exc.CommandError('Stack not found: %s' % args.id)
    else:
        formatters = {
            'description': utils.text_wrap_formatter,
            'template_description': utils.text_wrap_formatter,
            'stack_status_reason': utils.text_wrap_formatter,
            'parameters': utils.json_formatter,
            'outputs': utils.json_formatter,
            'links': utils.link_formatter
        }
        utils.print_dict(stack.to_dict(), formatters=formatters)

@utils.arg('-f', '--template-file', metavar='<FILE>',
           help='Path to the template.')
@utils.arg('-e', '--environment-file', metavar='<FILE>',
           help='Path to the environment.')
@utils.arg('-u', '--template-url', metavar='<URL>',
           help='URL of template.')
@utils.arg('-o', '--template-object', metavar='<URL>',
           help='URL to retrieve template object (e.g from swift)')
@utils.arg('-P', '--parameters', metavar='<KEY1=VALUE1;KEY2=VALUE2...>',
           help='Parameter values used to create the stack. '
           'This can be specified multiple times, or once with parameters '
           'separated by semicolon.',
           action='append')
@utils.arg('id', metavar='<NAME or ID>',
           help='Name or ID of stack to update.')
def do_update(hc, args):
    '''DEPRECATED! Use stack-update instead.'''
    do_stack_update(hc, args)

@utils.arg('-f', '--template-file', metavar='<FILE>',
           help='Path to the template.')
@utils.arg('-e', '--environment-file', metavar='<FILE>',
           help='Path to the environment.')
@utils.arg('-u', '--template-url', metavar='<URL>',
           help='URL of template.')
@utils.arg('-o', '--template-object', metavar='<URL>',
           help='URL to retrieve template object (e.g from swift)')
@utils.arg('-P', '--parameters', metavar='<KEY1=VALUE1;KEY2=VALUE2...>',
           help='Parameter values used to create the stack. '
           'This can be specified multiple times, or once with parameters '
           'separated by semicolon.',
           action='append')
@utils.arg('id', metavar='<NAME or ID>',
           help='Name or ID of stack to update.')
def do_stack_update(hc, args):
    '''Update the stack.'''
    fields = {'stack_id': args.id,
              'parameters': utils.format_parameters(args.parameters)}
    _set_template_fields(hc, args, fields)
    _process_environment_and_files(args, fields)

    hc.stacks.update(**fields)
    do_list(hc)

def do_list(hc, args={}):
    '''DEPRECATED! Use stack-list instead.'''
    do_stack_list(hc, args)

def do_stack_list(hc, args={}):
    '''List the user's stacks.'''
    kwargs = {}
    stacks = hc.stacks.list(**kwargs)
    fields = ['id', 'stack_name', 'stack_status', 'creation_time']
    utils.print_list(stacks, fields, sortby=3)

@utils.arg('id', metavar='<NAME or ID>',
           help='Name or ID of stack to get the template for.')
def do_gettemplate(hc, args):
    '''DEPRECATED! Use template-show instead.'''
    do_template_show(hc, args)

@utils.arg('id', metavar='<NAME or ID>',
           help='Name or ID of stack to get the template for.')
def do_template_show(hc, args):
    '''Get the template for the specified stack.'''
    fields = {'stack_id': args.id}
    try:
        template = hc.stacks.template(**fields)
    except exc.HTTPNotFound:
        raise exc.CommandError('Stack not found: %s' % args.id)
    else:
        if 'heat_template_version' in template:
            print yaml.safe_dump(template, indent=2)
        else:
            print json.dumps(template, indent=2)

@utils.arg('-u', '--template-url', metavar='<URL>',
           help='URL of template.')
@utils.arg('-f', '--template-file', metavar='<FILE>',
           help='Path to the template.')
@utils.arg('-e', '--environment-file', metavar='<FILE>',
           help='Path to the environment.')
@utils.arg('-o', '--template-object', metavar='<URL>',
           help='URL to retrieve template object (e.g from swift)')
@utils.arg('-P', '--parameters', metavar='<KEY1=VALUE1;KEY2=VALUE2...>',
           help='Parameter values to validate. '
           'This can be specified multiple times, or once with parameters '
           'separated by semicolon.',
           action='append')
def do_validate(hc, args):
    '''DEPRECATED! Use template-validate instead.'''
    do_template_validate(hc, args)

@utils.arg('-u', '--template-url', metavar='<URL>',
           help='URL of template.')
@utils.arg('-f', '--template-file', metavar='<FILE>',
           help='Path to the template.')
@utils.arg('-e', '--environment-file', metavar='<FILE>',
           help='Path to the environment.')
@utils.arg('-o', '--template-object', metavar='<URL>',
           help='URL to retrieve template object (e.g from swift)')
@utils.arg('-P', '--parameters', metavar='<KEY1=VALUE1;KEY2=VALUE2...>',
           help='Parameter values to validate. '
           'This can be specified multiple times, or once with parameters '
           'separated by semicolon.',
           action='append')
def do_template_validate(hc, args):
    '''Validate a template with parameters.'''
    fields = {'parameters': utils.format_parameters(args.parameters)}
    _set_template_fields(hc, args, fields)
    _process_environment_and_files(args, fields)

    validation = hc.stacks.validate(**fields)
    print json.dumps(validation, indent=2)

@utils.arg('id', metavar='<NAME or ID>',
           help='Name or ID of stack to show the resources for.')
def do_resource_list(hc, args):
    '''Show list of resources belonging to a stack.'''
    fields = {'stack_id': args.id}
    try:
        resources = hc.resources.list(**fields)
    except exc.HTTPNotFound:
        raise exc.CommandError('Stack not found: %s' % args.id)
    else:
        fields = ['resource_type', 'resource_status', 'updated_time']
        if len(resources) >= 1:
            if hasattr(resources[0], 'resource_name'):
                fields.insert(0, 'resource_name')
            else:
                fields.insert(0, 'logical_resource_id')

        utils.print_list(resources, fields, sortby=3)

@utils.arg('id', metavar='<NAME or ID>',
           help='Name or ID of stack to show the resource for.')
@utils.arg('resource', metavar='<RESOURCE>',
           help='Name of the resource to show the details for.')
def do_resource(hc, args):
    '''DEPRECATED! Use resource-show instead.'''
    do_resource_show(hc, args)

@utils.arg('id', metavar='<NAME or ID>',
           help='Name or ID of stack to show the resource for.')
@utils.arg('resource', metavar='<RESOURCE>',
           help='Name of the resource to show the details for.')
def do_resource_show(hc, args):
    '''Describe the resource.'''
    fields = {'stack_id': args.id,
              'resource_name': args.resource}
    try:
        resource = hc.resources.get(**fields)
    except exc.HTTPNotFound:
        raise exc.CommandError('Stack or resource not found: %s %s' %
                               (args.id, args.resource))
    else:
        formatters = {
            'links': utils.link_formatter,
            'required_by': utils.newline_list_formatter
        }
        utils.print_dict(resource.to_dict(), formatters=formatters)

@utils.arg('resource', metavar='<RESOURCE>',
           help='Name of the resource to generate a template for.')
@utils.arg('-F', '--format', metavar='<FORMAT>',
           help="The template output format. %s" % utils.supported_formats)
def do_resource_template(hc, args):
    '''Generate a template based on a resource.'''
    fields = {'resource_name': args.resource}
    try:
        template = hc.resources.generate_template(**fields)
    except exc.HTTPNotFound:
        raise exc.CommandError('Resource %s not found.' % args.resource)
    else:
        if args.format:
            print utils.format_output(template, format=args.format)
        else:
            print utils.format_output(template)

@utils.arg('id', metavar='<NAME or ID>',
           help='Name or ID of stack to show the resource metadata for.')
@utils.arg('resource', metavar='<RESOURCE>',
           help='Name of the resource to show the metadata for.')
def do_resource_metadata(hc, args):
    '''List resource metadata.'''
    fields = {'stack_id': args.id,
              'resource_name': args.resource}
    try:
        metadata = hc.resources.metadata(**fields)
    except exc.HTTPNotFound:
        raise exc.CommandError('Stack or resource not found: %s %s' %
                               (args.id, args.resource))
    else:
        print json.dumps(metadata, indent=2)

@utils.arg('id', metavar='<NAME or ID>',
           help='Name or ID of stack to show the events for.')
@utils.arg('-r', '--resource', metavar='<RESOURCE>',
           help='Name of the resource to filter events by')
def do_event_list(hc, args):
    '''List events for a stack.'''
    fields = {'stack_id': args.id,
              'resource_name': args.resource}
    try:
        events = hc.events.list(**fields)
    except exc.HTTPNotFound:
        raise exc.CommandError('Stack not found: %s' % args.id)
    else:
        fields = ['id', 'resource_status_reason',
                  'resource_status', 'event_time']
        if len(events) >= 1:
            if hasattr(events[0], 'resource_name'):
                fields.insert(0, 'resource_name')
            else:
                fields.insert(0, 'logical_resource_id')
        utils.print_list(events, fields)

@utils.arg('id', metavar='<NAME or ID>',
           help='Name or ID of stack to show the events for.')
@utils.arg('resource', metavar='<RESOURCE>',
           help='Name of the resource the event belongs to.')
@utils.arg('event', metavar='<EVENT>',
           help='ID of event to display details for')
def do_event(hc, args):
    '''DEPRECATED! Use event-show instead.'''
    do_event_show(hc, args)

@utils.arg('id', metavar='<NAME or ID>',
           help='Name or ID of stack to show the events for.')
@utils.arg('resource', metavar='<RESOURCE>',
           help='Name of the resource the event belongs to.')
@utils.arg('event', metavar='<EVENT>',
           help='ID of event to display details for')
def do_event_show(hc, args):
    '''Describe the event.'''
    fields = {'stack_id': args.id,
              'resource_name': args.resource,
              'event_id': args.event}
    try:
        event = hc.events.get(**fields)
    except exc.HTTPNotFound as ex:
        # it could be the stack/resource/or event that is not found
        # just use the message that the server sent us.
        raise exc.CommandError(str(ex))
    else:
        formatters = {
            'links': utils.link_formatter,
            'resource_properties': utils.json_formatter
        }
        utils.print_dict(event.to_dict(), formatters=formatters)


text:
import webpack from "webpack";
import path from "path";
import { extensions } from "interpret";
import { smart as smartMerge } from "webpack-merge";

import { DEVELOPMENT, PRODUCTION, SCSS } from "../constants";
import { exists, resolveExternal, formatError } from "../utils";
import { registerCompiler, logger } from "./support";

const PLUGINS = {
  common: [
    "ProgressBar",
    "NoErrors",
    "LoaderOptions",
    "Define",
    "ExtractText",
    "Html",
    "Favicons",
  ],
  server: [
    "HotModuleReplacement"
  ],
  [DEVELOPMENT]: [
    "Visualizer"
  ],
  [PRODUCTION]: [
    "Clean",
    "CommonsChunk",
    "HashedModuleIds",
    "InlineManifest",
    "UglifyJs",
    "Imagemin",
    "Offline"
  ]
};

const LOADERS = [
  "json",
  "static"
];

export default class Bundler {
  constructor(options) {
    this.options = options;

    this.plugins = [
      ...PLUGINS.common,
      ...(PLUGINS[options.env] || PLUGINS[DEVELOPMENT]),
      ...(options.server ? PLUGINS.server : [])
    ];

    this.loaders = [
      ...LOADERS,
      Symbol.keyFor(options.lang),
      Symbol.keyFor(options.styles || SCSS)
    ];
  }

  run() {
    this.init().then(compiler => compiler.run(logger));
  }

  watch(watchOptions) {
    this.init().then(compiler => compiler.watch(watchOptions, logger));
  }

  async init() {
    try {
      const internalConfig = await this.loadInternalConfig();
      const externalConfig = await this.loadExternalConfig();

      this.config = smartMerge(internalConfig, externalConfig || {});
      this.compiler = webpack(this.config);

      return this.compiler;
    } catch (error) {
      console.error(formatError(error));
    }
  }

  async loadInternalConfig(loaders, plugins) {
    const [pluginsConfig, loadersConfig, { default: baseConfig }] = await Promise.all([
      this.loadConfigPartials("./plugins", this.plugins),
      this.loadConfigPartials("./loaders", this.loaders),
      System.import("./base")
    ]);

    return baseConfig(this.options, { pluginsConfig, loadersConfig });
  }

  async loadConfigPartials(dir, partialModules) {
    let configPartials = [];
    let partials = await Promise.all(
      partialModules.map(name => System.import(path.join(__dirname, dir, name)))
    );

    for (let { default: partial } of partials) {
      let configPartial = await partial(this.options);
      if (configPartial) configPartials = configPartials.concat(configPartial);
    }

    return configPartials;
  }

  async loadExternalConfig() {
    const DEFAULT_CONFIG_FILES = ["webpack.config", "webpackfile"];

    const EXTNAMES = Object.keys(extensions).sort((a, b) => {
      return a == ".js" ? -1 : b == ".js" ? 1 : a.length - b.length;
    });

    let configFile;

    if (this.options.config) {
      let filename = resolveExternal(this.options.config);
      let extname = EXTNAMES.find(e => filename.endsWith(e)) || path.extname(filename);

      configFile = { filename, extname };
    } else {
      DEFAULT_CONFIG_FILES.some(basename => EXTNAMES.some(extname => {
        let filename = resolveExternal(basename + extname);

        if (exists(filename)) {
          configFile = { filename, extname };
          return true;
        }
      }));
    }

    if (!configFile) return;

    await registerCompiler(extensions[configFile.extname]);

    let externalConfig = await System.import(configFile.filename);
    // Check, is external config file is ES6 module
    externalConfig = externalConfig && externalConfig.default || externalConfig;
    /**
     * Just like in the Webpack, external config can export function which
     * accepts options passed to CLI. When no options passed via CLI,
     * internal options object will be passed.
     */
    externalConfig = typeof externalConfig === "function" && externalConfig(this.options.options || this.options);

    if (!externalConfig || typeof externalConfig !== "object") {
      throw new Error("Config did not export an object or a function returning an object.");
    }

    return externalConfig;
  }
}


text:
require File.expand_path('../../spec_helper', __FILE__)

describe "Coverage" do
  def drop_profiler_tables
    %w(plsql_profiler_data plsql_profiler_units plsql_profiler_runs).each do |table_name|
      plsql.execute "drop table #{table_name} cascade constraints" rescue nil
    end
  end

  before(:all) do
    PLSQL::Coverage.reset_cache

    plsql.connect! CONNECTION_PARAMS
    plsql.execute "ALTER SESSION SET PLSQL_OPTIMIZE_LEVEL=1"
    drop_profiler_tables
    @source = <<-SQL
CREATE OR REPLACE FUNCTION test_profiler RETURN VARCHAR2 IS

-- A comment before executed code
BEGIN
  RETURN 'test_profiler';
  -- A dummy empty line follows

EXCEPTION
  WHEN OTHERS THEN
    -- We should never reach here
    RETURN 'others';
END;
    SQL
    plsql.execute @source

    @coverage_data = {
      DATABASE_USER.upcase => {
        "TEST_PROFILER" => {
          1=>1,
          4=>1,
          5=>1,
          8=>0,
          9=>0,
          11=>0,
          12=>1
        }
      }
    }

    FileUtils.rm_rf(destination_root)
    @directory = File.join(destination_root, 'coverage')
  end

  after(:all) do
    plsql.execute "DROP FUNCTION test_profiler" rescue nil
    drop_profiler_tables
  end

  describe "start" do
    before(:all) do
      @start_result = PLSQL::Coverage.start
    end

    it "should start coverage collection" do
      expect(@start_result).to be_truthy
    end

    it "should create profiler tables" do
      %w(plsql_profiler_data plsql_profiler_units plsql_profiler_runs).each do |table_name|
        expect(plsql.send(table_name)).to be_a(PLSQL::Table)
      end
    end

    it "should start collecting profiler data" do
      expect(plsql.plsql_profiler_runs.all).not_to be_empty
    end

  end

  describe "stop" do
    before(:all) do
      PLSQL::Coverage.start
      plsql.test_profiler
      @stop_result = PLSQL::Coverage.stop
    end

    it "should stop coverage collection" do
      expect(@stop_result).to be_truthy
    end

    it "should populate profiler data table" do
      expect(plsql.plsql_profiler_data.all).not_to be_empty
    end

  end

  describe "cleanup" do
    before(:each) do
      PLSQL::Coverage.start
      plsql.test_profiler
      PLSQL::Coverage.stop
    end

    it "should drop profiler tables" do
      expect(PLSQL::Coverage.cleanup).to be_truthy
      %w(plsql_profiler_data plsql_profiler_units plsql_profiler_runs).each do |table_name|
        expect(PLSQL::Table.find(plsql, table_name.to_sym)).to be_nil
      end
    end

    it "should delete profiler table data when profiler tables already were present" do
      # simulate that profiler tables were already present
      PLSQL::Coverage.reset_cache
      expect {
        PLSQL::Coverage.start
        plsql.test_profiler
        PLSQL::Coverage.stop
        PLSQL::Coverage.cleanup
      }.not_to change {
        [plsql.plsql_profiler_data.all, plsql.plsql_profiler_units.all, plsql.plsql_profiler_runs.all]
      }
    end
  end

  describe "get coverage data" do
    before(:all) do
      PLSQL::Coverage.start
      plsql.test_profiler
      PLSQL::Coverage.stop
    end

    it "should get profiler run results" do
      expect(PLSQL::Coverage.find.coverage_data).to eq(@coverage_data)
    end

    it "should not get ignored schemas" do
      expect(PLSQL::Coverage.find.coverage_data(:ignore_schemas => [DATABASE_USER])).to be_empty
    end

    it "should get only objects with like condition" do
      expect(PLSQL::Coverage.find.coverage_data(:like => "#{DATABASE_USER}.test%")).to eq(@coverage_data)
    end

    it "should not get objects not matching like condition" do
      expect(PLSQL::Coverage.find.coverage_data(:like => "#{DATABASE_USER}.none%")).to be_empty
    end

  end

  describe "generate" do
    def adjust_test_coverage
      @test_coverage = @coverage_data[DATABASE_USER.upcase]['TEST_PROFILER'].dup
      @test_coverage.delete(1) if @test_coverage[1] == 0 && @source.split("\n")[0] =~ /^CREATE OR REPLACE (.*)$/
    end

    def expected_coverages
      total_lines = @source.split("\n").size
      uncovered_lines = @test_coverage.count{|k,v| v==0}
      executed_lines = @test_coverage.count{|k,v| v>0}
      total_coverage_pct = '%.2f' % ((total_lines - uncovered_lines).to_f / total_lines * 100) + '%'
      code_coverage_pct = '%.2f' % (executed_lines.to_f / (executed_lines + uncovered_lines) * 100) + '%'
      [total_coverage_pct, code_coverage_pct]
    end

    before(:all) do
      PLSQL::Coverage.start
      plsql.test_profiler
      PLSQL::Coverage.stop
      PLSQL::Coverage.report(:directory => @directory)

      adjust_test_coverage
    end

    after(:all) do
      PLSQL::Coverage.cleanup
    end

    describe "details report" do
      before(:all) do
        @details_doc = Nokogiri::HTML(File.read(File.join(@directory, "#{DATABASE_USER.upcase}-TEST_PROFILER.html")))
      end

      it "should generate HTML table with source lines" do
        @source.split("\n").each_with_index do |line, i|
          if i == 0 && line =~ /^CREATE OR REPLACE (.*)$/
            line = $1
          end
          line.chomp!

          # line should be present
          a = @details_doc.at_css("table.details a[name=\"line#{i+1}\"]")
          expect(a).not_to be_nil

          doc_line = a.parent.children[1]
          doc_line_text = doc_line ? doc_line.text : ""

          # source text should be present
          expect(doc_line_text).to eq(line)

          # table row should have correct class according to coverage data
          tr = a.ancestors('tr')[0]
          expect(tr.attr('class')).to eq(case @test_coverage[i+1]
            when nil
              'inferred'
            when 0
              'uncovered'
            else
              'marked'
            end)
        end
      end

      it "should generate HTML table with coverage percentage" do
        expect(@details_doc.css("table.report div.percent_graph_legend").map{|div| div.text}).to eq(expected_coverages)
      end

    end

    describe "index report" do
      before(:all) do
        @index_doc = Nokogiri::HTML(File.read(File.join(@directory, "index.html")))
      end

      it "should generate HTML table with coverage percentage" do
        expect(@index_doc.css("table.report tbody tr:contains('HR.TEST_PROFILER') div.percent_graph_legend").map{|div| div.text}).to eq(expected_coverages)
        expect(@index_doc.css("table.report tfoot div.percent_graph_legend").map{|div| div.text}).to eq(expected_coverages)
      end

    end

  end

  describe "using other connection" do
    before(:all) do
      plsql.logoff
      plsql(:other).connect! CONNECTION_PARAMS

      PLSQL::Coverage.start(:other)
      plsql(:other).test_profiler
      PLSQL::Coverage.stop(:other)
    end

    after(:all) do
      plsql(:other).execute "DROP FUNCTION test_profiler" rescue nil
      PLSQL::Coverage.cleanup(:other)
    end

    it "should start collecting profiler data" do
      expect(plsql(:other).plsql_profiler_runs.all).not_to be_empty
    end

    it "should populate profiler data table" do
      expect(plsql(:other).plsql_profiler_data.all).not_to be_empty
    end

    it "should get profiler run results" do
      expect(PLSQL::Coverage.find(:other).coverage_data).to eq(@coverage_data)
    end

    it "should generate reports" do
      PLSQL::Coverage.report :other, :directory => File.join(@directory, 'other')
      expect(File.file?(File.join(@directory, 'other/index.html'))).to be_truthy
    end
  end

end


text:
require "cbuassets/version"

module Cbuassets
  module Rails
      class Engine < ::Rails::Engine
      end
    end
end


text:
using System;
using System.Collections.Generic;

namespace FogCreek.Wasabi.AST
{

    public class CComment : CStatement
    {
        private String commentString;

        public CComment(CToken token, String com)
            : base(token)
        {
            commentString = com;
        }

        public string Text
        {
            get { return commentString; }
        }

        public override void Accept(IVisitor visitor)
        {
            visitor.VisitComment(this);
        }
    }
}


text:
package com.mauriciotogneri.jan.compiler.syntactic.states;

import com.mauriciotogneri.jan.compiler.lexical.Token;
import com.mauriciotogneri.jan.compiler.lexical.Token.Type;
import com.mauriciotogneri.jan.compiler.syntactic.State;
import com.mauriciotogneri.jan.compiler.syntactic.SyntacticException;
import com.mauriciotogneri.jan.kernel.Expression;
import com.mauriciotogneri.jan.kernel.Function;
import com.mauriciotogneri.jan.kernel.Program;

public class AnonymousExpressionStartState extends State
{
	private final Function function;
	private final Expression expression;

	public AnonymousExpressionStartState(Program program, Function function, Expression expression)
	{
		super(program);

		this.function = function;
		this.expression = expression;
	}

	@Override
	public State process(Token token)
	{
		if (token.type.isSeparator())
		{
			return this;
		}
		else if (token.type.isExpressionToken())
		{
			expression.addElement(token);

			return new AnonymousExpressionEndState(getProgram(), function, expression);
		}
		else if (token.type == Type.NEW_LINE)
		{
			if (expression.isEmpty())
			{
				throw new SyntacticException("Anonymous function is empty", token);
			}

			function.addExpression(expression);
			addFunction(function);

			return new InitialState(getProgram());
		}
		else
		{
			throw new SyntacticException(token);
		}
	}
}


text:
from sys import exit

#####
# ET modules.
#####
from et_rdbms import insert_category, insert_expense
from et_validations import is_valid_amount, is_valid_YYYYMMDD
#############################################################################
def insert_category_transaction(db_name, transaction):

    code = transaction[2]
    parent_code = transaction[3]
    desc = transaction[4]

    insert_category(db_name, code, desc, parent_code)
#############################################################################
def insert_expense_transaction(db_name, transaction):

    incurred_date = transaction[2]
    amount = transaction[3]
    category_code = transaction[4]
    desc = transaction[5]

    insert_expense(db_name, incurred_date, amount, category_code, desc)

#############################################################################
if __name__ == "__main__":
    exit()
#############################################################################


text:
PAYLOAD_CONFIRM = 'PAYLOAD_CONFIRM'
PAYLOAD_FIX = 'PAYLOAD_FIX'
PAYLOAD_CANCEL = 'PAYLOAD_CANCEL'
PAYLOAD_MORE = 'PAYLOAD_MORE'
PAYLOAD_PICTURE = 'PAYLOAD_PICTURE'
PAYLOAD_RECIPE = 'PAYLOAD_RECIPE'
PAYLOAD_WHERE_TO_BUY = 'PAYLOAD_WHERE_TO_BUY'


text:
/*
 * Bootstrap
 *
 */

var ngSchedule = angular.module('ngSchedule', ['ngSanitize']);

/*
 * Configuration
 *
 * urls: sets urls used across the app
 * urls.api: sets the url to hit for schedule & session data
 * urls.speakers: this will form part of the url passed to getSpeakerURL function
 * example: urls.speakers + speaker.slug -> /speakers/warren-ellis
 * urls.tracks: same as above but for tracks
 *
 * cellCSS: these are classes added for special cells
 * if_panel: a session which is a panel
 * if_full: a session which is fully booked
 * if_break: a cell forming a break
 * if_empty: empty cell, used to fill gaps in tracks not having a session
 * sfor a given time
 */

ngSchedule.value('urls', {
  api: 'http://econsultancy.com/events/funnel.json',
  speakers: '/speakers/',
  tracks: '/tracks/'
});

ngSchedule.value('cellCSS', {
  if_full: 'ngs-cell--full',
  if_break: 'ngs-cell--break',
  if_empty: 'ngs-cell--empty'
});

/*
 *  Controllers
 *
 */

ngSchedule.controller(
  'ScheduleCtrl',
  ['$rootScope', '$scope', 'urls', 'cellCSS', '$http', '$filter', 'dataUtil', '$timeout',
  function ($rootScope, $scope, urls, cellCSS, $http, $filter, dataUtil, $timeout) {
    var rows, tracks;

    // Get schedule data
    $http
      .jsonp(urls.api + '?include=schedule&callback=JSON_CALLBACK')
      .success(function (data) {

        // Get tracks data and sort by position
        tracks = dataUtil.sortTracks(data.tracks);

        // Create rows from data and sorted tracks
        rows = dataUtil.createRows(data, tracks);

        // Expose collections to template
        $scope.rows = rows;
        $scope.tracks = tracks;

        $scope.showSpinner = false;
      }
    );

    // Show spinner while we load the schedule and don't show session container
    $scope.showSpinner = true;
    $scope.showSession = false;

    // Set classes for a cell
    $scope.getCellClasses = function (cell) {
      var classes = {};

      classes[cellCSS.if_full] = cell.is_full;
      classes[cellCSS.if_break] = !cell.slug && !cell.empty_cell;
      classes[cellCSS.if_empty] = cell.empty_cell;

      return classes;
    };

    // Gets passed in sessions detail
    $scope.displaySession = function (cell) {
      var url = urls.api.slice(0, -5) +
                '/tracks/' +
                cell.track_slug +
                '/sessions/' +
                cell.slug +
                '.json?callback=JSON_CALLBACK';

      $scope.showSpinner = true;

      $http.jsonp(url).success(function (data){

        $scope.session = data;
        $scope.speakers = $scope.session.speakers;
        $rootScope.packshotsLoading = countPackshots(data.speakers);

        if ($scope.speakers.length < 1) {
          $rootScope.packshotsLoading = 0;
          $scope.sessionReady();
        }

        function countPackshots (data) {
          return _.pluck(data, 'image_packshot_url').length;
        }
      });
    }

    $scope.sessionReady = function () {
      $scope.showOverlay = true;
      $scope.showSpinner = false;

      // If this is not delayed, the CSS animation does not kick in
      // Angular unstable branch has ng-animate which could replace this
      $timeout(function(){
        $scope.showSession = true;
      }, 100);
    }

    $scope.getBrands = function (cell) {
      // For some reason chaining here with lodash causes 'undefined method or
      // property' error in IE8
      var brands = _.pluck(cell.speakers, 'company_name');
      brands = _.uniq(brands);
      return brands.join(', ');
    }

    // Clear session data (triggers ng-hide for the div containing the
    // data so it becomes hidden)
    $scope.closeOverlay = function () {
      if (!$scope.session) return;
      $scope.session = '';
      $scope.showOverlay = false;
      $scope.showSession = false;
    };

    // Helpers for creating URL's
    $scope.createSpeakerURL = function (speakerName) {
      if (!speakerName) return;
      return urls.speakers + ($filter('lowercase')(speakerName)).replace(/\s/, '-');
    };

    $scope.createTrackURL = function (trackSlug) {
      if (!trackSlug) return;
      return urls.tracks + trackSlug;
    };

  }]
);

/*
 * dataUtil
 * Helpers for building the data structure
 *
 */

ngSchedule.factory('dataUtil', function () {
  return {
    // Sort tracks by the position property
    sortTracks: function sortTracks (tracks) {
      var tracksByName = _.sortBy(tracks, 'name');
      return _.sortBy(tracksByName, function(item) {
        return item['position'] || 1000000;
      });
    },

    // Normalize the data
    createRows: function createRows (data, tracks) {
      var schedule,
          sessions = normalizeDates(data.sessions),
          breaks = data.breaks,
          trackNames = _.pluck(tracks, 'name'),
          tracksLength = tracks.length;

      // Because we are grouping by starts_at, we need a consistent
      // representation of time. We extract the hours and minutes as
      // the rest is not needed.
      function normalizeDates (sessions) {
        _.map(sessions, function (session) {
          session.starts_at = session.starts_at.slice(11, 16);
          session.ends_at = session.ends_at.slice(11, 16);
        });
        return sessions;
      }

      // Some tracks have don't have a session for
      // every cell, so we add empty cells to preserve track columns
      function addMissingCells (rows) {
        return _.each(rows, function (row) {
          var missingCells;

          // Check if the row is not a break and has empty cells
          if (row[0].slug && row.length < tracksLength) {

            // Find tracks for missing cells
            missingCells = _.difference(trackNames, _.pluck(row, 'track_name'));

            // Add missing cells
            _.each(missingCells, function (missingCell) {
              row.push({ track_name: missingCell, empty_cell: true, slug: 'empty' });
            });

            // Sort row alphabetically by track_name
            row.sort(function (a, b) {
              return (a.track_name).localeCompare(b.track_name);
            });
          }
        });
      }

      // Sort cells so they align with their respective tracks
      function sortRows (schedule, tracks) {
        var sortedSchedule = {};

        _.each(schedule, function (row, time) {
          var sortedRow = [];

          // If break, bail out
          if (!row[0].slug) {
            sortedSchedule[time] = row;
            return;
          }

          _.each(trackNames, function (trackName, index) {
            sortedRow[index] = _.find(row, { track_name: trackName });
          });

          sortedSchedule[time] = sortedRow;
        });

        return sortedSchedule;
      }

      // Broke this up to make it more readable
      schedule = _.groupBy(sessions.concat(breaks), 'starts_at');
      schedule = addMissingCells(schedule);
      schedule = sortRows(schedule, tracks);

      return schedule;
    }
  }
});

/*
 * Directives
 *
 */

ngSchedule.directive('cell', function () {
  return {
    restrict: 'A',
    replace: true,
    transclude: true,
    link: function ($scope, el, attrs) {
      var title,
          cell = $scope.cell,
          isBreak = !$scope.cell.slug,
          isEmptyCell = $scope.cell.empty_cell;

      // If cell is a break, clear contents and add break class and title
      if (isBreak && !isEmptyCell) {
        el.html('');
        el.text(cell.title);
      }
      // Else just clear contents and add empty class - it's a dummy cell
      else if (isEmptyCell) {
        el.html('');
      }
    },
    template: '<div ng-transclude ng-class="getCellClasses(cell)"></div>'
  };
});

ngSchedule.directive('ready',
  ['$rootScope', function ($rootScope){
  return {
    restrict: 'A',
    link: function (scope, el, att) {
      el.bind("load", function (e){
        $rootScope.packshotsLoading--;
        if ($rootScope.packshotsLoading === 0) {
          scope.sessionReady();
          scope.$apply();
        }
      });
      el.bind("error", function (e){
        $rootScope.packshotsLoading--;
        el.addClass('ngs-hide-image');
        if ($rootScope.packshotsLoading === 0) {
          scope.sessionReady();
          scope.$apply();
        }
      });
    }
  }
}]);

/*
 * Filters
 *
 */

ngSchedule.filter('truncate', function () {
  return function (text, length, end) {
    if (isNaN(length)) length = 10;

    if (end === undefined) end = "...";

    if (!text) return;

    if (text.length <= length || text.length - end.length <= length) {
        return text;
    } else {
      return String(text).substring(0, length-end.length) + end;
    }
  };
});


text:
using System;
using System.Collections.Generic;
using System.Linq;
using IndexReader = Lucene.Net.Index.IndexReader;
using Term = Lucene.Net.Index.Term;
using BooleanClause = Lucene.Net.Search.BooleanClause;
using BooleanQuery = Lucene.Net.Search.BooleanQuery;
using DisjunctionMaxQuery = Lucene.Net.Search.DisjunctionMaxQuery;
using FilteredQuery = Lucene.Net.Search.FilteredQuery;
using MultiPhraseQuery = Lucene.Net.Search.MultiPhraseQuery;
using PhraseQuery = Lucene.Net.Search.PhraseQuery;
using Query = Lucene.Net.Search.Query;
using TermQuery = Lucene.Net.Search.TermQuery;
using SpanNearQuery = Lucene.Net.Search.Spans.SpanNearQuery;
using SpanOrQuery = Lucene.Net.Search.Spans.SpanOrQuery;
using SpanQuery = Lucene.Net.Search.Spans.SpanQuery;
using SpanTermQuery = Lucene.Net.Search.Spans.SpanTermQuery;

namespace Lucene.Net.Search.Payloads
{

	///  Experimental class to get set of payloads for most standard Lucene queries.
	/// Operates like Highlighter - IndexReader should only contain doc of interest,
	/// best to use MemoryIndex.
	///
	///

	///
	/// WARNING: The status of the Payloads feature is experimental.
	/// The APIs introduced here might change in the future and will not be
	/// supported anymore in such a case.
	///
	///
	public class PayloadSpanUtil
	{
		private IndexReader reader;

		/// <param name="reader">that contains doc with payloads to extract
		/// </param>
		public PayloadSpanUtil(IndexReader reader)
		{
			this.reader = reader;
		}

		///  Query should be rewritten for wild/fuzzy support.
		///
		///
		/// <param name="query">
		/// </param>
		/// <returns> payloads Collection
		/// </returns>
		/// <throws>  IOException </throws>
		public virtual ICollection<byte[]> GetPayloadsForQuery(Query query)
		{
			ICollection<byte[]> payloads = new List<byte[]>();
			QueryToSpanQuery(query, payloads);
			return payloads;
		}

		private void  QueryToSpanQuery(Query query, ICollection<byte[]> payloads)
		{
			if (query is BooleanQuery)
			{
				BooleanClause[] queryClauses = ((BooleanQuery) query).GetClauses();

				for (int i = 0; i < queryClauses.Length; i++)
				{
                    if (!queryClauses[i].IsProhibited)
					{
						QueryToSpanQuery(queryClauses[i].Query, payloads);
					}
				}
			}
			else if (query is PhraseQuery)
			{
				Term[] phraseQueryTerms = ((PhraseQuery) query).GetTerms();
				SpanQuery[] clauses = new SpanQuery[phraseQueryTerms.Length];
				for (int i = 0; i < phraseQueryTerms.Length; i++)
				{
					clauses[i] = new SpanTermQuery(phraseQueryTerms[i]);
				}

				int slop = ((PhraseQuery) query).Slop;
				bool inorder = false;

				if (slop == 0)
				{
					inorder = true;
				}

				SpanNearQuery sp = new SpanNearQuery(clauses, slop, inorder);
				sp.Boost = query.Boost;
				GetPayloads(payloads, sp);
			}
			else if (query is TermQuery)
			{
				SpanTermQuery stq = new SpanTermQuery(((TermQuery) query).Term);
				stq.Boost = query.Boost;
				GetPayloads(payloads, stq);
			}
			else if (query is SpanQuery)
			{
				GetPayloads(payloads, (SpanQuery) query);
			}
			else if (query is FilteredQuery)
			{
				QueryToSpanQuery(((FilteredQuery) query).Query, payloads);
			}
			else if (query is DisjunctionMaxQuery)
			{

                for (IEnumerator<Query> iterator = ((DisjunctionMaxQuery)query).GetEnumerator(); iterator.MoveNext(); )
                {
                    QueryToSpanQuery(iterator.Current, payloads);
                }
			}
			else if (query is MultiPhraseQuery)
			{
				MultiPhraseQuery mpq = (MultiPhraseQuery) query;
				System.Collections.Generic.IList<Term[]> termArrays = mpq.GetTermArrays();
				int[] positions = mpq.GetPositions();
				if (positions.Length > 0)
				{

					int maxPosition = positions[positions.Length - 1];
					for (int i = 0; i < positions.Length - 1; ++i)
					{
						if (positions[i] > maxPosition)
						{
							maxPosition = positions[i];
						}
					}

                    IList<Query>[] disjunctLists = new IList<Query>[maxPosition + 1];
					int distinctPositions = 0;

					for (int i = 0; i < termArrays.Count; ++i)
					{
						Term[] termArray = termArrays[i];
						IList<Query> disjuncts = disjunctLists[positions[i]];
						if (disjuncts == null)
						{
							disjuncts = (disjunctLists[positions[i]] = new List<Query>(termArray.Length));
							++distinctPositions;
						}
						foreach(Term term in termArray)
						{
							disjuncts.Add(new SpanTermQuery(term));
						}
					}

					int positionGaps = 0;
					int position = 0;
					SpanQuery[] clauses = new SpanQuery[distinctPositions];
					for (int i = 0; i < disjunctLists.Length; ++i)
					{
						IList<Query> disjuncts = disjunctLists[i];
						if (disjuncts != null)
						{
                            clauses[position++] = new SpanOrQuery((SpanQuery[]) (disjuncts.ToArray()));
						}
						else
						{
							++positionGaps;
						}
					}

					int slop = mpq.Slop;
					bool inorder = (slop == 0);

					SpanNearQuery sp = new SpanNearQuery(clauses, slop + positionGaps, inorder);
					sp.Boost = query.Boost;
					GetPayloads(payloads, sp);
				}
			}
		}

		private void  GetPayloads(ICollection<byte[]> payloads, SpanQuery query)
		{
			Spans.Spans spans = query.GetSpans(reader);

			while (spans.Next() == true)
			{
				if (spans.IsPayloadAvailable())
				{
                    ICollection<byte[]> payload = spans.GetPayload();
                    foreach (byte[] bytes in payload)
                    {
                        payloads.Add(bytes);
                    }
				}
			}
		}
	}
}


text:
package main

import (
	"fmt"
	"os"
	"path/filepath"
)

//GetMyPath returns the static root path
func GetMyPath(envname, dirname string) string {
	if path := os.Getenv(envname); len(path) != 0 {
		return path
	}
	if path := os.Getenv("GOPATH"); len(path) != 0 {
		spath := filepath.Join(path, "src", "github.com", "FairyDevicesRD", "morant", dirname)
		if _, err := os.Stat(spath); err == nil {
			return spath
		}
	}
	return ""
}

//GetStaticRootPath returns the static root path
func GetStaticRootPath() string {
	return GetMyPath("MORANT_STATIC", "static")
}

//GetViewRootPath returns the view root path
func GetViewRootPath() string {
	return GetMyPath("MORANT_VIEW", "view")
}

//PrintDefaultPath prints default paths
func PrintDefaultPath() {
	fmt.Printf("Default Path:\n")
	fmt.Printf("  Static root path: %s\n", GetStaticRootPath())
	fmt.Printf("  View   root path: %s\n", GetViewRootPath())
}


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

<title>Z-Index</title>
<meta name="date" content="2015-01-08">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G H I K L M N O P R S T U V W Z

Z

zoom(int) - Static method in class vue.DrawPanel

zoomX(int) - Static method in class vue.DrawPanel

zoomY(int) - Static method in class vue.DrawPanel

A B C D E F G H I K L M N O P R S T U V W Z

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
package gov.samhsa.consent2share.hl7;

/**
 * The Interface Hl7v3Transformer.
 */
public interface Hl7v3Transformer {

	/** The Constant XSLT_PATIENT_DTO_TO_PIX_ADD. */
	public final static String XSLT_PATIENT_DTO_TO_PIX_ADD = "patientDtoHl7v3PixAdd.xsl";

	/** The Constant XSLT_PATIENT_DTO_TO_PIX_UPDATE. */
	public final static String XSLT_PATIENT_DTO_TO_PIX_UPDATE = "patientDtoHl7v3PixUpdate.xsl";

	/** The Constant XSLT_C32_TO_PIX_ADD. */
	public final static String XSLT_C32_TO_PIX_ADD = "c32ToHl7v3PixAdd.xsl";

	/** The Constant XSLT_C32_TO_PIX_UPDATE. */
	public final static String XSLT_C32_TO_PIX_UPDATE = "c32ToHl7v3PixUpdate.xsl";

	/** The Constant XSLT_C32_TO_PIX_QUERY. */
	public final static String XSLT_C32_TO_PIX_QUERY = "c32ToHl7v3PixQuery.xsl";

	/** The Constant XML_PIX_QUERY. */
	public final static String XML_PIX_QUERY = "Hl7v3PixQuery.xml";

	/**
	 * Transform to hl7v3 pix xml.
	 *
	 * @param xml
	 *            the xml
	 * @param XSLTURI
	 *            the xslturi
	 * @return the string
	 * @throws Hl7v3TransformerException
	 *             the hl7v3 transformer exception
	 */
	public String transformToHl7v3PixXml(String xml, String XSLTURI)
			throws Hl7v3TransformerException;

	/**
	 * Transform c32 to green ccd.
	 *
	 * @param mrn
	 *            the medical record no of patient
	 * @param mrnDomain
	 *            the eHRdomain id
	 * @param xsltUri
	 *            the xsl for pixquery
	 * @return the string
	 * @throws Hl7v3TransformerException
	 *             the hl7v3 transformer exception
	 */
	public String getPixQueryXml(String mrn, String mrnDomain, String xsltUri)
			throws Hl7v3TransformerException;
}


text:
using System;

namespace Refactorizer.VSIX.Exception
{
    internal class NoSolutionOpenException : System.Exception
    {
    }
}


text:
cask "backblaze" do
  version "8.0.1.588"
  sha256 :no_check

  url "https://secure.backblaze.com/mac/install_backblaze.dmg"
  name "Backblaze"
  desc "Data backup and storage service"
  homepage "https://backblaze.com/"

  livecheck do
    url "https://secure.backblaze.com/api/clientversion.xml"
    regex(/mac[._-]version=.*?(\d+(?:\.\d+)+)/i)
  end

  auto_updates true

  installer manual: "Backblaze Installer.app"

  uninstall launchctl: [
    "com.backblaze.bzbmenu",
    "com.backblaze.bzserv",
  ],
            delete:    [
              "#{appdir}/Backblaze.app",
              "/Library/Logs/DiagnosticReports/bzbmenu_*.*_resource.diag",
              "/Library/PreferencePanes/BackblazeBackup.prefPane",
            ]

  zap trash: [
    "/Library/Backblaze.bzpkg",
    "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.backblaze.*.sfl*",
    "~/Library/Logs/BackblazeGUIInstaller",
    "~/Library/Preferences/com.backblaze.bzbmenu.plist",
  ]
end


text:
namespace Sitecore.FakeDb.Pipelines.AddDbItem
{
  using Sitecore.Data;

  public class SetParent
  {
    public virtual void Process(AddDbItemArgs args)
    {
      var item = args.DbItem;

      if (!ID.IsNullOrEmpty(item.ParentID))
      {
        return;
      }

      if (item.TemplateID == TemplateIDs.Template)
      {
        item.ParentID = ItemIDs.TemplateRoot;
        return;
      }

      if (item.TemplateID == TemplateIDs.BranchTemplate)
      {
        item.ParentID = ItemIDs.BranchesRoot;
        return;
      }

      item.ParentID = item is DbTemplate ? args.DefaultTemplateRoot : args.DefaultItemRoot;
    }
  }
}


text:
"""
Verifies build of an executable with C++ define specified by a gyp define, and
the use of the environment during regeneration when the gyp file changes.
"""

import os
import TestGyp

# Regenerating build files when a gyp file changes is currently only supported
# by the make generator.
test = TestGyp.TestGyp(formats=['make'])

try:
  os.environ['GYP_DEFINES'] = 'value=50'
  test.run_gyp('defines.gyp')
finally:
  # We clear the environ after calling gyp.  When the auto-regeneration happens,
  # the same define should be reused anyway.  Reset to empty string first in
  # case the platform doesn't support unsetenv.
  os.environ['GYP_DEFINES'] = ''
  del os.environ['GYP_DEFINES']

test.build('defines.gyp')

expect = """\
FOO is defined
VALUE is 1
2*PAREN_VALUE is 12
HASH_VALUE is a#1
"""
test.run_built_executable('defines', stdout=expect)

# Sleep so that the changed gyp file will have a newer timestamp than the
# previously generated build files.
test.sleep()
test.write('defines.gyp', test.read('defines-env.gyp'))

test.build('defines.gyp', test.ALL)

expect = """\
VALUE is 50
"""
test.run_built_executable('defines', stdout=expect)

test.pass_test()


text:
from reggae.build import Target, Build

target = Target("foo", "dmd -offoo foo.d", [Target("foo.d")])
build = Build([target])