text:
.class Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;
.super Lcom/android/internal/util/State;
.source "WifiStateMachine.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/net/wifi/WifiStateMachine;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = "SupplicantStartingState"
.end annotation

# instance fields
.field final synthetic this$0:Landroid/net/wifi/WifiStateMachine;

# direct methods
.method constructor <init>(Landroid/net/wifi/WifiStateMachine;)V
    .locals 0
    .parameter

    .prologue
    .line 3386
    iput-object p1, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    invoke-direct {p0}, Lcom/android/internal/util/State;-><init>()V

    return-void
.end method

.method private initializeWpsDetails()V
    .locals 4

    .prologue
    .line 3395
    const-string v1, "ro.product.name"

    const-string v2, ""

    invoke-static {v1, v2}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 3396
    .local v0, detail:Ljava/lang/String;
    iget-object v1, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mWifiNative:Landroid/net/wifi/WifiNative;
    invoke-static {v1}, Landroid/net/wifi/WifiStateMachine;->access$400(Landroid/net/wifi/WifiStateMachine;)Landroid/net/wifi/WifiNative;

    move-result-object v1

    invoke-virtual {v1, v0}, Landroid/net/wifi/WifiNative;->setDeviceName(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 3397
    iget-object v1, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "Failed to set device name "

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

    move-result-object v2

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

    move-result-object v2

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

    move-result-object v2

    #calls: Landroid/net/wifi/WifiStateMachine;->loge(Ljava/lang/String;)V
    invoke-static {v1, v2}, Landroid/net/wifi/WifiStateMachine;->access$700(Landroid/net/wifi/WifiStateMachine;Ljava/lang/String;)V

    .line 3399
    :cond_0
    const-string v1, "ro.product.manufacturer"

    const-string v2, ""

    invoke-static {v1, v2}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 3400
    iget-object v1, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mWifiNative:Landroid/net/wifi/WifiNative;
    invoke-static {v1}, Landroid/net/wifi/WifiStateMachine;->access$400(Landroid/net/wifi/WifiStateMachine;)Landroid/net/wifi/WifiNative;

    move-result-object v1

    invoke-virtual {v1, v0}, Landroid/net/wifi/WifiNative;->setManufacturer(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_1

    .line 3401
    iget-object v1, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "Failed to set manufacturer "

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

    move-result-object v2

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

    move-result-object v2

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

    move-result-object v2

    #calls: Landroid/net/wifi/WifiStateMachine;->loge(Ljava/lang/String;)V
    invoke-static {v1, v2}, Landroid/net/wifi/WifiStateMachine;->access$700(Landroid/net/wifi/WifiStateMachine;Ljava/lang/String;)V

    .line 3403
    :cond_1
    const-string v1, "ro.product.model"

    const-string v2, ""

    invoke-static {v1, v2}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 3404
    iget-object v1, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mWifiNative:Landroid/net/wifi/WifiNative;
    invoke-static {v1}, Landroid/net/wifi/WifiStateMachine;->access$400(Landroid/net/wifi/WifiStateMachine;)Landroid/net/wifi/WifiNative;

    move-result-object v1

    invoke-virtual {v1, v0}, Landroid/net/wifi/WifiNative;->setModelName(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_2

    .line 3405
    iget-object v1, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "Failed to set model name "

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

    move-result-object v2

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

    move-result-object v2

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

    move-result-object v2

    #calls: Landroid/net/wifi/WifiStateMachine;->loge(Ljava/lang/String;)V
    invoke-static {v1, v2}, Landroid/net/wifi/WifiStateMachine;->access$700(Landroid/net/wifi/WifiStateMachine;Ljava/lang/String;)V

    .line 3407
    :cond_2
    const-string v1, "ro.product.model"

    const-string v2, ""

    invoke-static {v1, v2}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 3408
    iget-object v1, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mWifiNative:Landroid/net/wifi/WifiNative;
    invoke-static {v1}, Landroid/net/wifi/WifiStateMachine;->access$400(Landroid/net/wifi/WifiStateMachine;)Landroid/net/wifi/WifiNative;

    move-result-object v1

    invoke-virtual {v1, v0}, Landroid/net/wifi/WifiNative;->setModelNumber(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_3

    .line 3409
    iget-object v1, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "Failed to set model number "

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

    move-result-object v2

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

    move-result-object v2

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

    move-result-object v2

    #calls: Landroid/net/wifi/WifiStateMachine;->loge(Ljava/lang/String;)V
    invoke-static {v1, v2}, Landroid/net/wifi/WifiStateMachine;->access$700(Landroid/net/wifi/WifiStateMachine;Ljava/lang/String;)V

    .line 3411
    :cond_3
    const-string v1, "ro.serialno"

    const-string v2, ""

    invoke-static {v1, v2}, Landroid/os/SystemProperties;->get(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 3412
    iget-object v1, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mWifiNative:Landroid/net/wifi/WifiNative;
    invoke-static {v1}, Landroid/net/wifi/WifiStateMachine;->access$400(Landroid/net/wifi/WifiStateMachine;)Landroid/net/wifi/WifiNative;

    move-result-object v1

    invoke-virtual {v1, v0}, Landroid/net/wifi/WifiNative;->setSerialNumber(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_4

    .line 3413
    iget-object v1, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "Failed to set serial number "

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

    move-result-object v2

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

    move-result-object v2

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

    move-result-object v2

    #calls: Landroid/net/wifi/WifiStateMachine;->loge(Ljava/lang/String;)V
    invoke-static {v1, v2}, Landroid/net/wifi/WifiStateMachine;->access$700(Landroid/net/wifi/WifiStateMachine;Ljava/lang/String;)V

    .line 3415
    :cond_4
    iget-object v1, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mWifiNative:Landroid/net/wifi/WifiNative;
    invoke-static {v1}, Landroid/net/wifi/WifiStateMachine;->access$400(Landroid/net/wifi/WifiStateMachine;)Landroid/net/wifi/WifiNative;

    move-result-object v1

    const-string v2, "physical_display virtual_push_button keypad"

    invoke-virtual {v1, v2}, Landroid/net/wifi/WifiNative;->setConfigMethods(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_5

    .line 3416
    iget-object v1, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    const-string v2, "Failed to set WPS config methods"

    #calls: Landroid/net/wifi/WifiStateMachine;->loge(Ljava/lang/String;)V
    invoke-static {v1, v2}, Landroid/net/wifi/WifiStateMachine;->access$700(Landroid/net/wifi/WifiStateMachine;Ljava/lang/String;)V

    .line 3418
    :cond_5
    iget-object v1, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mWifiNative:Landroid/net/wifi/WifiNative;
    invoke-static {v1}, Landroid/net/wifi/WifiStateMachine;->access$400(Landroid/net/wifi/WifiStateMachine;)Landroid/net/wifi/WifiNative;

    move-result-object v1

    iget-object v2, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mPrimaryDeviceType:Ljava/lang/String;
    invoke-static {v2}, Landroid/net/wifi/WifiStateMachine;->access$4900(Landroid/net/wifi/WifiStateMachine;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/net/wifi/WifiNative;->setDeviceType(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_6

    .line 3419
    iget-object v1, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "Failed to set primary device type "

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

    move-result-object v2

    iget-object v3, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mPrimaryDeviceType:Ljava/lang/String;
    invoke-static {v3}, Landroid/net/wifi/WifiStateMachine;->access$4900(Landroid/net/wifi/WifiStateMachine;)Ljava/lang/String;

    move-result-object v3

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

    move-result-object v2

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

    move-result-object v2

    #calls: Landroid/net/wifi/WifiStateMachine;->loge(Ljava/lang/String;)V
    invoke-static {v1, v2}, Landroid/net/wifi/WifiStateMachine;->access$700(Landroid/net/wifi/WifiStateMachine;Ljava/lang/String;)V

    .line 3421
    :cond_6
    return-void
.end method

# virtual methods
.method public enter()V
    .locals 3

    .prologue
    .line 3389
    invoke-static {}, Landroid/net/wifi/WifiStateMachine;->access$300()Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    new-instance v1, Ljava/lang/StringBuilder;

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

    invoke-virtual {p0}, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->getName()Ljava/lang/String;

    move-result-object v2

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

    move-result-object v1

    const-string v2, "\n"

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

    move-result-object v1

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

    move-result-object v1

    #calls: Landroid/net/wifi/WifiStateMachine;->log(Ljava/lang/String;)V
    invoke-static {v0, v1}, Landroid/net/wifi/WifiStateMachine;->access$800(Landroid/net/wifi/WifiStateMachine;Ljava/lang/String;)V

    .line 3390
    :cond_0
    const v0, 0xc365

    invoke-virtual {p0}, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->getName()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/EventLog;->writeEvent(ILjava/lang/String;)I

    .line 3391
    return-void
.end method

.method public processMessage(Landroid/os/Message;)Z
    .locals 8
    .parameter "message"

    .prologue
    const/4 v7, -0x1

    const/4 v3, 0x1

    const/4 v1, 0x0

    .line 3425
    invoke-static {}, Landroid/net/wifi/WifiStateMachine;->access$300()Z

    move-result v4

    if-eqz v4, :cond_0

    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    new-instance v5, Ljava/lang/StringBuilder;

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

    invoke-virtual {p0}, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->getName()Ljava/lang/String;

    move-result-object v6

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

    move-result-object v5

    invoke-virtual {p1}, Landroid/os/Message;->toString()Ljava/lang/String;

    move-result-object v6

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

    move-result-object v5

    const-string v6, "\n"

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

    move-result-object v5

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

    move-result-object v5

    #calls: Landroid/net/wifi/WifiStateMachine;->log(Ljava/lang/String;)V
    invoke-static {v4, v5}, Landroid/net/wifi/WifiStateMachine;->access$800(Landroid/net/wifi/WifiStateMachine;Ljava/lang/String;)V

    .line 3426
    :cond_0
    iget v4, p1, Landroid/os/Message;->what:I

    sparse-switch v4, :sswitch_data_0

    .line 3530
    :goto_0
    return v1

    .line 3428
    :sswitch_0
    invoke-static {}, Landroid/net/wifi/WifiStateMachine;->access$300()Z

    move-result v4

    if-eqz v4, :cond_1

    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    const-string v5, "Supplicant connection established"

    #calls: Landroid/net/wifi/WifiStateMachine;->log(Ljava/lang/String;)V
    invoke-static {v4, v5}, Landroid/net/wifi/WifiStateMachine;->access$800(Landroid/net/wifi/WifiStateMachine;Ljava/lang/String;)V

    .line 3429
    :cond_1
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mP2pSupported:Z
    invoke-static {v4}, Landroid/net/wifi/WifiStateMachine;->access$5000(Landroid/net/wifi/WifiStateMachine;)Z

    move-result v4

    if-eqz v4, :cond_2

    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mWifiP2pChannel:Lcom/android/internal/util/AsyncChannel;
    invoke-static {v4}, Landroid/net/wifi/WifiStateMachine;->access$1400(Landroid/net/wifi/WifiStateMachine;)Lcom/android/internal/util/AsyncChannel;

    move-result-object v4

    const v5, 0x20083

    invoke-virtual {v4, v5}, Lcom/android/internal/util/AsyncChannel;->sendMessage(I)V

    .line 3431
    :cond_2
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    const/4 v5, 0x3

    #calls: Landroid/net/wifi/WifiStateMachine;->setWifiState(I)V
    invoke-static {v4, v5}, Landroid/net/wifi/WifiStateMachine;->access$3000(Landroid/net/wifi/WifiStateMachine;I)V

    .line 3432
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #setter for: Landroid/net/wifi/WifiStateMachine;->mSupplicantRestartCount:I
    invoke-static {v4, v1}, Landroid/net/wifi/WifiStateMachine;->access$5102(Landroid/net/wifi/WifiStateMachine;I)I

    .line 3448
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mContext:Landroid/content/Context;
    invoke-static {v4}, Landroid/net/wifi/WifiStateMachine;->access$2100(Landroid/net/wifi/WifiStateMachine;)Landroid/content/Context;

    move-result-object v4

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

    move-result-object v4

    const-string v5, "wifi_cmcc_manual"

    invoke-static {v4, v5, v1}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

    move-result v4

    if-eqz v4, :cond_3

    move v1, v3

    .line 3450
    .local v1, cmccManualConnect:Z
    :cond_3
    new-instance v2, Landroid/os/Message;

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

    .line 3451
    .local v2, msg:Landroid/os/Message;
    const/16 v4, 0xf

    iput v4, v2, Landroid/os/Message;->what:I

    .line 3453
    new-instance v0, Landroid/os/Bundle;

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

    .line 3454
    .local v0, args:Landroid/os/Bundle;
    const-string v4, "enable"

    invoke-virtual {v0, v4, v1}, Landroid/os/Bundle;->putBoolean(Ljava/lang/String;Z)V

    .line 3455
    iput-object v0, v2, Landroid/os/Message;->obj:Ljava/lang/Object;

    .line 3457
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    invoke-virtual {v4, v2}, Landroid/net/wifi/WifiStateMachine;->callSECApi(Landroid/os/Message;)I

    .line 3477
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mSupplicantStateTracker:Landroid/net/wifi/SupplicantStateTracker;
    invoke-static {v4}, Landroid/net/wifi/WifiStateMachine;->access$5200(Landroid/net/wifi/WifiStateMachine;)Landroid/net/wifi/SupplicantStateTracker;

    move-result-object v4

    const v5, 0x2006f

    invoke-virtual {v4, v5}, Landroid/net/wifi/SupplicantStateTracker;->sendMessage(I)V

    .line 3479
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    const/4 v5, 0x0

    #setter for: Landroid/net/wifi/WifiStateMachine;->mLastBssid:Ljava/lang/String;
    invoke-static {v4, v5}, Landroid/net/wifi/WifiStateMachine;->access$5302(Landroid/net/wifi/WifiStateMachine;Ljava/lang/String;)Ljava/lang/String;

    .line 3480
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #setter for: Landroid/net/wifi/WifiStateMachine;->mLastNetworkId:I
    invoke-static {v4, v7}, Landroid/net/wifi/WifiStateMachine;->access$5402(Landroid/net/wifi/WifiStateMachine;I)I

    .line 3481
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #setter for: Landroid/net/wifi/WifiStateMachine;->mLastSignalLevel:I
    invoke-static {v4, v7}, Landroid/net/wifi/WifiStateMachine;->access$5502(Landroid/net/wifi/WifiStateMachine;I)I

    .line 3483
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mWifiInfo:Landroid/net/wifi/WifiInfo;
    invoke-static {v4}, Landroid/net/wifi/WifiStateMachine;->access$5600(Landroid/net/wifi/WifiStateMachine;)Landroid/net/wifi/WifiInfo;

    move-result-object v4

    iget-object v5, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mWifiNative:Landroid/net/wifi/WifiNative;
    invoke-static {v5}, Landroid/net/wifi/WifiStateMachine;->access$400(Landroid/net/wifi/WifiStateMachine;)Landroid/net/wifi/WifiNative;

    move-result-object v5

    invoke-virtual {v5}, Landroid/net/wifi/WifiNative;->getMacAddress()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Landroid/net/wifi/WifiInfo;->setMacAddress(Ljava/lang/String;)V

    .line 3484
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mWifiConfigStore:Landroid/net/wifi/WifiConfigStore;
    invoke-static {v4}, Landroid/net/wifi/WifiStateMachine;->access$200(Landroid/net/wifi/WifiStateMachine;)Landroid/net/wifi/WifiConfigStore;

    move-result-object v4

    invoke-virtual {v4}, Landroid/net/wifi/WifiConfigStore;->initialize()V

    .line 3485
    invoke-direct {p0}, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->initializeWpsDetails()V

    .line 3487
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mSkipScanAssoc:Z
    invoke-static {v4}, Landroid/net/wifi/WifiStateMachine;->access$5700(Landroid/net/wifi/WifiStateMachine;)Z

    move-result v4

    if-eqz v4, :cond_4

    .line 3488
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    const-string v5, "SkipScanAssoc WiFi enabled for P2P function. In this case, Skip scan and assoc for p2p connection"

    #calls: Landroid/net/wifi/WifiStateMachine;->logi(Ljava/lang/String;)V
    invoke-static {v4, v5}, Landroid/net/wifi/WifiStateMachine;->access$5800(Landroid/net/wifi/WifiStateMachine;Ljava/lang/String;)V

    .line 3493
    :goto_1
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #calls: Landroid/net/wifi/WifiStateMachine;->sendSupplicantConnectionChangedBroadcast(Z)V
    invoke-static {v4, v3}, Landroid/net/wifi/WifiStateMachine;->access$5900(Landroid/net/wifi/WifiStateMachine;Z)V

    .line 3494
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    iget-object v5, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mDriverStartedState:Lcom/android/internal/util/State;
    invoke-static {v5}, Landroid/net/wifi/WifiStateMachine;->access$6000(Landroid/net/wifi/WifiStateMachine;)Lcom/android/internal/util/State;

    move-result-object v5

    #calls: Landroid/net/wifi/WifiStateMachine;->transitionTo(Lcom/android/internal/util/IState;)V
    invoke-static {v4, v5}, Landroid/net/wifi/WifiStateMachine;->access$6100(Landroid/net/wifi/WifiStateMachine;Lcom/android/internal/util/IState;)V

    .end local v0           #args:Landroid/os/Bundle;
    .end local v1           #cmccManualConnect:Z
    .end local v2           #msg:Landroid/os/Message;
    :goto_2
    move v1, v3

    .line 3530
    goto/16 :goto_0

    .line 3490
    .restart local v0       #args:Landroid/os/Bundle;
    .restart local v1       #cmccManualConnect:Z
    .restart local v2       #msg:Landroid/os/Message;
    :cond_4
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mWifiNative:Landroid/net/wifi/WifiNative;
    invoke-static {v4}, Landroid/net/wifi/WifiStateMachine;->access$400(Landroid/net/wifi/WifiStateMachine;)Landroid/net/wifi/WifiNative;

    move-result-object v4

    const/16 v5, 0xd

    invoke-virtual {v4, v5, v3}, Landroid/net/wifi/WifiNative;->callSECApiBoolean(IZ)I

    goto :goto_1

    .line 3497
    .end local v0           #args:Landroid/os/Bundle;
    .end local v1           #cmccManualConnect:Z
    .end local v2           #msg:Landroid/os/Message;
    :sswitch_1
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    invoke-static {v4}, Landroid/net/wifi/WifiStateMachine;->access$5104(Landroid/net/wifi/WifiStateMachine;)I

    move-result v4

    const/4 v5, 0x5

    if-gt v4, v5, :cond_5

    .line 3498
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    const-string v5, "Failed to setup control channel, restart supplicant"

    #calls: Landroid/net/wifi/WifiStateMachine;->loge(Ljava/lang/String;)V
    invoke-static {v4, v5}, Landroid/net/wifi/WifiStateMachine;->access$700(Landroid/net/wifi/WifiStateMachine;Ljava/lang/String;)V

    .line 3499
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mWifiNative:Landroid/net/wifi/WifiNative;
    invoke-static {v4}, Landroid/net/wifi/WifiStateMachine;->access$400(Landroid/net/wifi/WifiStateMachine;)Landroid/net/wifi/WifiNative;

    invoke-static {}, Landroid/net/wifi/WifiNative;->killSupplicant()Z

    .line 3500
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    iget-object v5, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mDriverLoadedState:Lcom/android/internal/util/State;
    invoke-static {v5}, Landroid/net/wifi/WifiStateMachine;->access$2400(Landroid/net/wifi/WifiStateMachine;)Lcom/android/internal/util/State;

    move-result-object v5

    #calls: Landroid/net/wifi/WifiStateMachine;->transitionTo(Lcom/android/internal/util/IState;)V
    invoke-static {v4, v5}, Landroid/net/wifi/WifiStateMachine;->access$6200(Landroid/net/wifi/WifiStateMachine;Lcom/android/internal/util/IState;)V

    .line 3501
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    const v5, 0x2000b

    const-wide/16 v6, 0x1388

    invoke-virtual {v4, v5, v6, v7}, Landroid/net/wifi/WifiStateMachine;->sendMessageDelayed(IJ)V

    goto :goto_2

    .line 3503
    :cond_5
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    new-instance v5, Ljava/lang/StringBuilder;

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

    const-string v6, "Failed "

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

    move-result-object v5

    iget-object v6, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mSupplicantRestartCount:I
    invoke-static {v6}, Landroid/net/wifi/WifiStateMachine;->access$5100(Landroid/net/wifi/WifiStateMachine;)I

    move-result v6

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, " times to start supplicant, unload driver"

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

    move-result-object v5

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

    move-result-object v5

    #calls: Landroid/net/wifi/WifiStateMachine;->loge(Ljava/lang/String;)V
    invoke-static {v4, v5}, Landroid/net/wifi/WifiStateMachine;->access$700(Landroid/net/wifi/WifiStateMachine;Ljava/lang/String;)V

    .line 3505
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #setter for: Landroid/net/wifi/WifiStateMachine;->mSupplicantRestartCount:I
    invoke-static {v4, v1}, Landroid/net/wifi/WifiStateMachine;->access$5102(Landroid/net/wifi/WifiStateMachine;I)I

    .line 3506
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    iget-object v5, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #getter for: Landroid/net/wifi/WifiStateMachine;->mDriverLoadedState:Lcom/android/internal/util/State;
    invoke-static {v5}, Landroid/net/wifi/WifiStateMachine;->access$2400(Landroid/net/wifi/WifiStateMachine;)Lcom/android/internal/util/State;

    move-result-object v5

    #calls: Landroid/net/wifi/WifiStateMachine;->transitionTo(Lcom/android/internal/util/IState;)V
    invoke-static {v4, v5}, Landroid/net/wifi/WifiStateMachine;->access$6300(Landroid/net/wifi/WifiStateMachine;Lcom/android/internal/util/IState;)V

    .line 3507
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    iget-object v5, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    const v6, 0x20002

    const/4 v7, 0x4

    invoke-virtual {v5, v6, v7, v1}, Landroid/net/wifi/WifiStateMachine;->obtainMessage(III)Landroid/os/Message;

    move-result-object v5

    invoke-virtual {v4, v5}, Landroid/net/wifi/WifiStateMachine;->sendMessage(Landroid/os/Message;)V

    goto :goto_2

    .line 3525
    :sswitch_2
    iget-object v4, p0, Landroid/net/wifi/WifiStateMachine$SupplicantStartingState;->this$0:Landroid/net/wifi/WifiStateMachine;

    #calls: Landroid/net/wifi/WifiStateMachine;->deferMessage(Landroid/os/Message;)V
    invoke-static {v4, p1}, Landroid/net/wifi/WifiStateMachine;->access$6400(Landroid/net/wifi/WifiStateMachine;Landroid/os/Message;)V

    goto/16 :goto_2

    .line 3426
    :sswitch_data_0
    .sparse-switch
        0x20001 -> :sswitch_2
        0x20002 -> :sswitch_2
        0x2000b -> :sswitch_2
        0x2000c -> :sswitch_2
        0x2000d -> :sswitch_2
        0x2000e -> :sswitch_2
        0x20015 -> :sswitch_2
        0x20018 -> :sswitch_2
        0x20048 -> :sswitch_2
        0x20049 -> :sswitch_2
        0x20050 -> :sswitch_2
        0x20054 -> :sswitch_2
        0x20055 -> :sswitch_2
        0x2005a -> :sswitch_2
        0x20097 -> :sswitch_2
        0x24001 -> :sswitch_0
        0x24002 -> :sswitch_1
    .end sparse-switch
.end method


text:
import { Dispatch, Middleware, MiddlewareAPI } from 'redux';
import thunk, { ThunkMiddleware } from 'redux-thunk';
import { AnyAction, configureStore, EnhancedStore, Reducer, getDefaultMiddleware } from '@reduxjs/toolkit';

import { StoreState } from '../../../types';
import { setStore } from '../../../store/store';

export interface ReduxTesterGiven<State> {
  givenRootReducer: (rootReducer: Reducer<State>) => ReduxTesterWhen<State>;
}

export interface ReduxTesterWhen<State> {
  whenActionIsDispatched: (
    action: any,
    clearPreviousActions?: boolean
  ) => ReduxTesterWhen<State> & ReduxTesterThen<State>;
  whenAsyncActionIsDispatched: (
    action: any,
    clearPreviousActions?: boolean
  ) => Promise<ReduxTesterWhen<State> & ReduxTesterThen<State>>;
}

export interface ReduxTesterThen<State> {
  thenDispatchedActionsShouldEqual: (...dispatchedActions: AnyAction[]) => ReduxTesterWhen<State>;
  thenDispatchedActionsPredicateShouldEqual: (
    predicate: (dispatchedActions: AnyAction[]) => boolean
  ) => ReduxTesterWhen<State>;
  thenNoActionsWhereDispatched: () => ReduxTesterWhen<State>;
}

export interface ReduxTesterArguments<State> {
  preloadedState?: State;
  debug?: boolean;
}

export const reduxTester = <State>(args?: ReduxTesterArguments<State>): ReduxTesterGiven<State> => {
  const dispatchedActions: AnyAction[] = [];
  const logActionsMiddleWare: Middleware<{}, Partial<StoreState>> = (
    store: MiddlewareAPI<Dispatch, Partial<StoreState>>
  ) => (next: Dispatch) => (action: AnyAction) => {
    // filter out thunk actions
    if (action && typeof action !== 'function') {
      dispatchedActions.push(action);
    }

    return next(action);
  };

  const preloadedState = args?.preloadedState ?? (({} as unknown) as State);
  const debug = args?.debug ?? false;
  let store: EnhancedStore<State> | null = null;

  const defaultMiddleware = getDefaultMiddleware<State>({
    thunk: false,
    serializableCheck: false,
    immutableCheck: false,
  } as any);

  const givenRootReducer = (rootReducer: Reducer<State>): ReduxTesterWhen<State> => {
    store = configureStore<State>({
      reducer: rootReducer,
      middleware: [...defaultMiddleware, logActionsMiddleWare, thunk] as [ThunkMiddleware<State>],
      preloadedState,
    });

    setStore(store as any);

    return instance;
  };

  const whenActionIsDispatched = (
    action: any,
    clearPreviousActions?: boolean
  ): ReduxTesterWhen<State> & ReduxTesterThen<State> => {
    if (clearPreviousActions) {
      dispatchedActions.length = 0;
    }

    if (store === null) {
      throw new Error('Store was not setup properly');
    }

    store.dispatch(action);
    return instance;
  };

  const whenAsyncActionIsDispatched = async (
    action: any,
    clearPreviousActions?: boolean
  ): Promise<ReduxTesterWhen<State> & ReduxTesterThen<State>> => {
    if (clearPreviousActions) {
      dispatchedActions.length = 0;
    }

    if (store === null) {
      throw new Error('Store was not setup properly');
    }

    await store.dispatch(action);
    return instance;
  };

  const thenDispatchedActionsShouldEqual = (...actions: AnyAction[]): ReduxTesterWhen<State> => {
    if (debug) {
      console.log('Dispatched Actions', JSON.stringify(dispatchedActions, null, 2));
    }

    if (!actions.length) {
      throw new Error('thenDispatchedActionShouldEqual has to be called with at least one action');
    }

    expect(dispatchedActions).toEqual(actions);
    return instance;
  };

  const thenDispatchedActionsPredicateShouldEqual = (
    predicate: (dispatchedActions: AnyAction[]) => boolean
  ): ReduxTesterWhen<State> => {
    if (debug) {
      console.log('Dispatched Actions', JSON.stringify(dispatchedActions, null, 2));
    }

    expect(predicate(dispatchedActions)).toBe(true);
    return instance;
  };

  const thenNoActionsWhereDispatched = (): ReduxTesterWhen<State> => {
    if (debug) {
      console.log('Dispatched Actions', JSON.stringify(dispatchedActions, null, 2));
    }

    expect(dispatchedActions.length).toBe(0);
    return instance;
  };

  const instance = {
    givenRootReducer,
    whenActionIsDispatched,
    whenAsyncActionIsDispatched,
    thenDispatchedActionsShouldEqual,
    thenDispatchedActionsPredicateShouldEqual,
    thenNoActionsWhereDispatched,
  };

  return instance;
};

redpajama_set_name: RedPajamaGithub


text:
lldb
====

Package lldb implements a low level database engine.

Installation: $ go get github.com/cznic/lldb

Documentation: [godoc.org/github.com/cznic/lldb](http://godoc.org/github.com/cznic/lldb)


text:
package org.jsecurity.authz;

/**
 * Thrown to indicate a requested operation or access to a requested resource is not allowed.
 *
 * @author Les Hazlewood
 * @since 0.1
 */
public class UnauthorizedException extends AuthorizationException {

    /**
     * Creates a new UnauthorizedException.
     */
    public UnauthorizedException() {
        super();
    }

    /**
     * Constructs a new UnauthorizedException.
     *
     * @param message the reason for the exception
     */
    public UnauthorizedException(String message) {
        super(message);
    }

    /**
     * Constructs a new UnauthorizedException.
     *
     * @param cause the underlying Throwable that caused this exception to be thrown.
     */
    public UnauthorizedException(Throwable cause) {
        super(cause);
    }

    /**
     * Constructs a new UnauthorizedException.
     *
     * @param message the reason for the exception
     * @param cause   the underlying Throwable that caused this exception to be thrown.
     */
    public UnauthorizedException(String message, Throwable cause) {
        super(message, cause);
    }
}


text:
"""Copyright 2014 Cyrus Dasadia

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import logging
import re
import requests
import simplejson
from cito_engine.models import EventAction, EventActionCounter

def dispatcher_dry_run(event, event_action):
    logger = logging.getLogger('main')
    dry_run_result = ''
    plugin_parameters_json = event_action.pluginParameters
    plugin_parameters_json = re.sub('"__EVENTID__"', simplejson.dumps(unicode(event.id)), plugin_parameters_json)
    plugin_parameters_json = re.sub('"__INCIDENTID__"', simplejson.dumps('test_incident_id'), plugin_parameters_json)
    plugin_parameters_json = re.sub('"__ELEMENT__"', simplejson.dumps('test_element_name'), plugin_parameters_json)
    plugin_parameters_json = re.sub('"__MESSAGE__"', simplejson.dumps('test_message'), plugin_parameters_json)
    plugin_json = '{"plugin": %s, "parameters": %s}' % (simplejson.dumps(event_action.plugin.name), plugin_parameters_json)
    logger.debug('Test sent to %s \n %s' % (event_action.plugin.server, plugin_json))
    try:
        response = requests.post(event_action.plugin.server.url+'/runplugin', data=plugin_json,
                                 verify=event_action.plugin.server.ssl_verify)
        dry_run_result = response.text
    except Exception as e:
        dry_run_result = "Error executing Plugin:%s: reason:%s" % (event_action.plugin.name, e)
    finally:
        return dry_run_result

def update_eventaction_counters(incident, timer_value=0):
    try:
        event_actions = EventAction.objects.filter(event=incident.event, isEnabled=True)
    except EventAction.DoesNotExist:
        return

    for event_action in event_actions:
        event_action_counter, create = EventActionCounter.objects.get_or_create(incident=incident,
                                                                                event_action=event_action)
        if not create:
            event_action_counter.update_counters(timer_value=timer_value)
    return


text:
function Xaligned=alignSpikes(X)
% function Xaligned=alignSpikes(X)
%
% This function aligns spikes by their minimum point. This minimum is
% shifted to the most common minimum point.
%
% It has one return, which is the aligned versions of the spikes.  Unknown
% values are listed as NaNs.
%
% 10/4/12
% David Carlson
% david.carlson (at) duke.edu
[P,N]=size(X);
if N<P
    X=X';
    [P,N]=size(X);
end
[minval,minloc]=min(X);

loc=mode(minloc);
Xaligned=zeros(P,N);
for n=1:N
    if minloc(n)<=loc;
        adj=loc-minloc(n);
        Xaligned(adj+1:end,n)=X(1:end-adj,n);
        Xaligned(1:adj-1,n)=nan;
    else
        adj=minloc(n)-loc;
        Xaligned(1:end-adj,n)=X(adj+1:end,n);
        Xaligned(end-adj+1:end,n)=nan;
    end
end


text:
module Fog
  module Compute
    class Cloudstack

      class Real
        # Deletes a detached disk volume.
        #
        # {CloudStack API Reference}[http://cloudstack.apache.org/docs/api/apidocs-4.3/root_admin/deleteVolume.html]
        def delete_volume(id, options={})
          options.merge!(
            'command' => 'deleteVolume',
            'id' => id
          )
          request(options)
        end
      end

      class Mock
        def delete_volume(options={})
          volume_id = options['id']
          if self.data[:volumes][volume_id]
            self.data[:volumes].delete(volume_id)
            {
              "deletevolumeresponse" => {
                "success" => "true"
              }
            }
          else # FIXME: mayhaps
            self.data[:volumes].delete(volume_id)
            {
              "deletevolumeresponse" => {
                "success" => "false"
              }
            }
          end
        end
      end
    end
  end
end


text:
// This is an open source non-commercial project. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com

/* CellCollection.cs --
 * Ars Magna project, http://arsmagna.ru
 * -------------------------------------------------------
 * Status: poor
 */

#region Using directives

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Xml.Serialization;

using AM;
using AM.Logging;
using AM.Runtime;

using CodeJam;

using JetBrains.Annotations;

using MoonSharp.Interpreter;

using Newtonsoft.Json;

#endregion

namespace ManagedIrbis.Reports
{
    /// <summary>
    ///
    /// </summary>
    [PublicAPI]
    [MoonSharpUserData]
    public sealed class CellCollection
        : Collection<ReportCell>,
        IHandmadeSerializable,
        IReadOnly<CellCollection>,
        IVerifiable,
        IDisposable
    {
        #region Properties

        /// <summary>
        /// Band.
        /// </summary>
        [CanBeNull]
        [XmlIgnore]
        [JsonIgnore]
        public ReportBand Band { get; internal set; }

        /// <summary>
        /// Record.
        /// </summary>
        [CanBeNull]
        [XmlIgnore]
        [JsonIgnore]
        public IrbisReport Report { get; internal set; }

        #endregion

        #region Private members

        // ReSharper disable InconsistentNaming

        internal CellCollection SetReport
            (
                IrbisReport report
            )
        {
            Report = report;

            foreach (ReportCell cell in this)
            {
                cell.Report = report;
            }

            return this;
        }

        // ReSharper restore InconsistentNaming

        #endregion

        #region Public methods

        /// <summary>
        /// Add range of <see cref="RecordField"/>s.
        /// </summary>
        public void AddRange
            (
                [NotNull] IEnumerable<ReportCell> cells
            )
        {
            ThrowIfReadOnly();
            Code.NotNull(cells, "cells");

            foreach (ReportCell cell in cells)
            {
                Add(cell);
            }
        }

        /// <summary>
        /// Создание клона коллекции.
        /// </summary>
        [NotNull]
        public CellCollection Clone()
        {
            CellCollection result = new CellCollection
            {
                Band = Band,
                Report = Report
            };

            foreach (ReportCell cell in this)
            {
                ReportCell clone = cell.Clone();
                clone.Report = Report;
                result.Add(clone);
            }

            return result;
        }

        /// <summary>
        /// Find first occurrence of the field with given predicate.
        /// </summary>
        [CanBeNull]
        public ReportCell Find
            (
                [NotNull] Predicate<ReportCell> predicate
            )
        {
            Code.NotNull(predicate, "predicate");

            return this.FirstOrDefault(cell => predicate(cell));
        }

        /// <summary>
        /// Find all occurrences of the field
        /// with given predicate.
        /// </summary>
        [NotNull]
        [ItemNotNull]
        public ReportCell[] FindAll
            (
                [NotNull] Predicate<ReportCell> predicate
            )
        {
            Code.NotNull(predicate, "predicate");

            return this.Where(cell => predicate(cell)).ToArray();
        }

        #endregion

        #region Collection<T> members

        /// <inheritdoc cref="Collection{T}.ClearItems" />
        protected override void ClearItems()
        {
            ThrowIfReadOnly();

            foreach (ReportCell cell in this)
            {
                cell.Band = null;
                cell.Report = null;
            }

            base.ClearItems();
        }

        /// <inheritdoc cref="Collection{T}.InsertItem" />
        protected override void InsertItem
            (
                int index,
                ReportCell item
            )
        {
            ThrowIfReadOnly();
            Code.NotNull(item, "item");

            item.Band = Band;
            item.Report = Report;

            base.InsertItem(index, item);
        }

        /// <inheritdoc cref="Collection{T}.RemoveItem" />
        protected override void RemoveItem
            (
                int index
            )
        {
            ThrowIfReadOnly();

            if (index >= 0 && index < Count)
            {
                ReportCell cell  = this[index];
                if (!ReferenceEquals(cell, null))
                {
                    cell.Band = null;
                    cell.Report = null;
                }
            }

            base.RemoveItem(index);
        }

        /// <inheritdoc cref="Collection{T}.SetItem" />
        protected override void SetItem
            (
                int index,
                ReportCell item
            )
        {
            ThrowIfReadOnly();
            Code.NotNull(item, "item");

            item.Band = Band;
            item.Report = Report;

            base.SetItem(index, item);
        }

        #endregion

        #region IHandmadeSerializable members

        /// <inheritdoc cref="IHandmadeSerializable.RestoreFromStream" />
        public void RestoreFromStream
            (
                BinaryReader reader
            )
        {
            ThrowIfReadOnly();
            Code.NotNull(reader, "reader");

            // TODO implement

            ClearItems();
            //RecordField[] array = reader.ReadArray<RecordField>();
            //AddRange(array);

            Log.Error
                (
                    "CellCollection::RestoreFromStream: "
                    + "not implemented"
                );

            throw new NotImplementedException();
        }

        /// <inheritdoc cref="IHandmadeSerializable.SaveToStream" />
        public void SaveToStream
            (
                BinaryWriter writer
            )
        {
            Code.NotNull(writer, "writer");

            // TODO implement

            //writer.WriteArray(this.ToArray());

            Log.Error
                (
                    "CellCollection::SaveToStream: "
                    + "not implemented"
                );

            throw new NotImplementedException();
        }

        #endregion

        #region IReadOnly<T> members

        internal bool _readOnly;

        /// <inheritdoc cref="IReadOnly{T}.ReadOnly" />
        public bool ReadOnly { get { return _readOnly; } }

        /// <inheritdoc cref="IReadOnly{T}.AsReadOnly" />
        public CellCollection AsReadOnly()
        {
            CellCollection result = Clone();
            result.SetReadOnly();

            return result;
        }

        /// <inheritdoc cref="IReadOnly{T}.SetReadOnly" />
        public void SetReadOnly()
        {
            _readOnly = true;
        }

        /// <inheritdoc cref="IReadOnly{T}.ThrowIfReadOnly" />
        public void ThrowIfReadOnly()
        {
            if (ReadOnly)
            {
                Log.Error
                    (
                        "CellCollection::ThrowIfReadOnly"
                    );

                throw new ReadOnlyException();
            }
        }

        #endregion

        #region IVerifiable members

        /// <inheritdoc cref="IVerifiable.Verify"/>
        public bool Verify
            (
                bool throwOnError
            )
        {
            Verifier<CellCollection> verifier
                = new Verifier<CellCollection>(this, throwOnError);

            foreach (ReportCell cell in this)
            {
                verifier.VerifySubObject(cell, "cell");
            }

            return verifier.Result;
        }

        #endregion

        #region IDisposable members

        /// <inheritdoc cref="IDisposable.Dispose"/>
        public void Dispose()
        {
            foreach (ReportCell cell in this)
            {
                cell.Dispose();
            }
        }

        #endregion
    }
}


text:
package ${package};

import java.util.HashMap;
import java.util.Map;

import javax.annotation.PostConstruct;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;

import org.cometd.bayeux.server.BayeuxServer;
import org.cometd.bayeux.server.ServerMessage;
import org.cometd.bayeux.server.ServerSession;
import org.cometd.annotation.Listener;
import org.cometd.annotation.Service;
import org.cometd.annotation.Session;

@Named
@Singleton
@Service("helloService")
public class HelloService
{
    @Inject
    private BayeuxServer bayeux;
    @Session
    private ServerSession serverSession;

    @PostConstruct
    public void init()
    {
    }

    @Listener("/service/hello")
    public void processHello(ServerSession remote, ServerMessage message)
    {
        Map<String, Object> input = message.getDataAsMap();
        String name = (String)input.get("name");

        Map<String, Object> output = new HashMap<>();
        output.put("greeting", "Hello, " + name);
        remote.deliver(serverSession, "/hello", output);
    }
}


text:
from .class_logger import ClassLogger  # noqa: F401
from .config import get_logger  # noqa: F401
from .logger_decorator import enable_logging, disable_logging  # noqa: F401

__all__ = [
    "ClassLogger",
    "get_logger",
    "enable_logging",
    "disable_logging",
]


text:
/)
{
    D3D12SM6WaveIntrinsics sample(1200, 900, L"");
    auto viewProvider = ref new ViewProvider(reinterpret_cast<UINT_PTR>(&sample));

    Windows::ApplicationModel::Core::CoreApplication::Run(viewProvider);
    return 0;
}


text:
package fr.rjoakim.android.jonetouch.util;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.List;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.common.primitives.Ints;
import com.google.common.primitives.Longs;

import fr.rjoakim.android.jonetouch.bean.Action;
import fr.rjoakim.android.jonetouch.bean.ActionScript;
import fr.rjoakim.android.jonetouch.bean.Authentication;
import fr.rjoakim.android.jonetouch.bean.AuthenticationTypeEnum;
import fr.rjoakim.android.jonetouch.bean.MyAuthentication;
import fr.rjoakim.android.jonetouch.bean.NoAuthentication;
import fr.rjoakim.android.jonetouch.bean.SSHAuthenticationPassword;
import fr.rjoakim.android.jonetouch.bean.Server;
import fr.rjoakim.android.jonetouch.dialog.bean.BackupXmlParse;

public class XMLReaderUtils extends XMLParserUtils {

	public static BackupXmlParse parse(String xml, MyAuthentication myAuthentication, String key,
			boolean isParseServers, boolean isParseActions) throws XMLParserUtilsException {

		try {
			DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
			DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
			Document document = dBuilder.parse(new ByteArrayInputStream(xml.getBytes()));
			document.getDocumentElement().normalize();

			checkBackupFormat(document);
			boolean isEncrypt =
					isEncryptBackupPassword(document.getDocumentElement());

			List<Server> servers = Lists.newArrayList();
			List<Action> actions = Lists.newArrayList();

			if (isParseServers) {
				parseServersElements(document,
						myAuthentication, key, servers, isEncrypt);
			}

			if (isParseActions) {
				parseActionsElements(document, actions);
			}

			return new BackupXmlParse(servers, actions);
		} catch (ParserConfigurationException e) {
			throw new XMLParserUtilsException(e.getMessage(), e);
		} catch (SAXException e) {
			throw new XMLParserUtilsException(e.getMessage(), e);
		} catch (IOException e) {
			throw new XMLParserUtilsException(e.getMessage(), e);
		}
	}

	private static boolean isEncryptBackupPassword(Element parent) {
		String value = getRequiredAttribute(parent, AUTHENTICATION);
		return value.equals(ENCRYPT);
	}

	private static void parseServersElements(Document document,
			MyAuthentication myAuthentication, String key, List<Server> servers,
			boolean isEncrypt) throws XMLParserUtilsException {

		NodeList serversNodeList = document.getElementsByTagName(SERVER);
		for (int cpt = 0; cpt < serversNodeList.getLength(); cpt++) {

			Node serverNode = serversNodeList.item(cpt);
			if (serverNode.getNodeType() == Node.ELEMENT_NODE) {

				Element serverElement = (Element) serverNode;

				long id = getRequiredLongAttribute(serverElement, DATABASE_ID);
				int port = getRequiredIntAttribute(serverElement, PORT);

				String title = getRequiredElementValue(serverElement, TITLE);
				String hostname = getRequiredElementValue(serverElement, HOSTNAME);
				String description = getRequiredElementValue(serverElement, DESCRIPTION);
				Authentication authentication = parseAuthenticationElement(serverElement, myAuthentication, key, isEncrypt);

				servers.add(new Server(
						id, title, hostname, port, description, authentication));
			}
		}
	}

	private static Authentication parseAuthenticationElement(Element serverElement,
			MyAuthentication myAuthentication, String key, boolean isEncrypt) throws XMLParserUtilsException {

		Element serverAuthentication = getRequiredElement(serverElement, AUTHENTICATION);
		long type = getRequiredLongAttribute(serverAuthentication, TYPE);
		AuthenticationTypeEnum authenticationTypeEnum = AuthenticationTypeEnum.fromId(type);
		Authentication authentication = null;
		switch (authenticationTypeEnum) {
		case NO_AUTHENTICATION:
			authentication = new NoAuthentication(
					getRequiredElementValue(serverElement, LOGIN), null);
			break;
		case SSH_AUTHENTICATION_PASSWORD:
			authentication = parseSSHAuthenticationPasword(
					serverElement, myAuthentication, key, isEncrypt);

			break;
		default :
			throw new XMLParserUtilsException("authentication field is required.");
		}
		return authentication;
	}

	private static Authentication parseSSHAuthenticationPasword(Element serverElement,
			MyAuthentication myAuthentication, String key, boolean isEncrypt) throws XMLParserUtilsException {

		String passwordValue = getRequiredElementValue(serverElement, PASSWORD);
		String newPwd = getPassword(key, isEncrypt, passwordValue);
		String pwdEncoded = encryptPassword(myAuthentication, newPwd);
		String login = getRequiredElementValue(serverElement, LOGIN);
		return new SSHAuthenticationPassword(login, pwdEncoded, null);
	}

	private static String encryptPassword(MyAuthentication myAuthentication, String newPwd) {
		String pwdEncoded = "";
		try {
			pwdEncoded = CryptographyUtils.encrypt(newPwd, myAuthentication.getKey());
		} catch (CryptographyException e) {
			pwdEncoded = "error decrypt password";
		}
		return pwdEncoded;
	}

	private static String getPassword(String key,
			boolean isEncrypt, String password) {

		String newPwd = password;
		if (isEncrypt) {
			 try {
				 if (!Strings.isNullOrEmpty(key)) {
					 newPwd = CryptographyUtils.decrypt(password, key);
				 }
			} catch (CryptographyException e) {
				newPwd = "error decrypt password";
			}
		}
		return newPwd;
	}

	private static long getRequiredLongAttribute(Element parent, String name) throws XMLParserUtilsException {
		Long value =  getOptionalLongAttribute(parent, name);
		if (value != null) {
			return value.longValue();
		}
		throw new XMLParserUtilsException(name  + " field is required.");
	}

	private static Long getOptionalLongAttribute(Element parent, String name) {
		return Longs.tryParse(parent.getAttribute(name));
	}

	private static int getRequiredIntAttribute(Element parent, String name) throws XMLParserUtilsException {
		Integer value = Ints.tryParse(parent.getAttribute(name));
		if (value != null) {
			return value.intValue();
		}
		throw new XMLParserUtilsException(name  + " field is required.");
	}

	private static String getRequiredAttribute(Element parent, String name) {
		String value = parent.getAttribute(name);
		Preconditions.checkNotNull(value, name + " field is required");
		return value;
	}

	private static String getRequiredElementValue(Element parent, String name) throws XMLParserUtilsException {
		NodeList nodeList = parent.getElementsByTagName(name);
		Node node = nodeList.item(0);
		if (node.getNodeType() == Node.ELEMENT_NODE) {
			Element element = (Element) node;
			return element.getTextContent();
		}
		throw new XMLParserUtilsException(name + " field is required.");
	}

	private static Element getRequiredElement(Element parent, String name) throws XMLParserUtilsException {
		NodeList nodeList = parent.getElementsByTagName(name);
		Node node = nodeList.item(0);
		if (node.getNodeType() == Node.ELEMENT_NODE) {
			return (Element) node;
		}
		throw new XMLParserUtilsException(name + " field is required.");
	}

	private static void parseActionsElements(Document document, List<Action> actions) throws XMLParserUtilsException {
		NodeList actionsNodeList = document.getElementsByTagName(ACTION);
		for (int cpt = 0; cpt < actionsNodeList.getLength(); cpt++) {

			Node actionNode = actionsNodeList.item(cpt);
			if (actionNode.getNodeType() == Node.ELEMENT_NODE) {

				Element actionElement = (Element) actionNode;

				String backgroundHexColor = getRequiredAttribute(actionElement, BACKGROUND_COLOR);
				Long serverId = getOptionalLongAttribute(actionElement, SERVER_ID);
				String title = getRequiredElementValue(actionElement, TITLE);
				String description = getRequiredElementValue(actionElement, DESCRIPTION);

				List<ActionScript> actionScripts = Lists.newArrayList();
				parseActionScriptsElements(actionElement, actionScripts);
				actions.add(new Action(
						-1, title, description,
						backgroundHexColor, serverId, actionScripts));
			}
		}
	}

	private static void parseActionScriptsElements(
			Element actionElement, List<ActionScript> actionScripts) {

		NodeList actionScriptsNodeList = actionElement.getElementsByTagName(SCRIPT);
		for (int cpt = 0; cpt < actionScriptsNodeList.getLength(); cpt++) {

			Node scriptNode = actionScriptsNodeList.item(cpt);
			if (scriptNode.getNodeType() == Node.ELEMENT_NODE) {

				Element scriptElement = (Element) scriptNode;
				String script = scriptElement.getTextContent();
				actionScripts.add(new ActionScript(-1, script));
			}
		}
	}

	private static void checkBackupFormat(Document document) throws XMLParserUtilsException {
		String name = document.getDocumentElement().getAttribute(NAME);
		String authentication = document.getDocumentElement().getAttribute(AUTHENTICATION);

		try {
			Preconditions.checkArgument(!Strings.isNullOrEmpty(name), "name field is required");
			Preconditions.checkArgument(!Strings.isNullOrEmpty(authentication), "authentication field is required");
			Preconditions.checkArgument(name.equals(BACKUP), "name is not equals to " + BACKUP);
		} catch(IllegalArgumentException ex) {
			throw new XMLParserUtilsException(ex.getMessage(), ex);
		}

		if (!authentication.equals(ENCRYPT) && !authentication.equals(DECRYPT)) {
			throw new XMLParserUtilsException("authentication field wrong format.");
		}
	}
}


text:
    <meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
    <title>ArrayBackedTileMap</title>
    <link href="../../../images/logo-icon.svg" rel="icon" type="image/svg">

    <link href="../../../styles/style.css" rel="Stylesheet">
    <link href="../../../styles/logo-styles.css" rel="Stylesheet">
    <link href="../../../styles/jetbrains-mono.css" rel="Stylesheet">
    <link href="../../../styles/main.css" rel="Stylesheet">

zircon.core/org.hexworks.zircon.internal.graphics/ArrayBackedTileMap/ArrayBackedTileMap

<button class="platform-tag platform-selector common-like" data-active="" data-filter=":zircon.core:dokkaHtml/commonMain">common</button>

Array<wbr></wbr>Backed<wbr></wbr>Tile<wbr></wbr>Map

fun ArrayBackedTileMap(dimensions: Size, arr: Array<Map.Entry<Position, Tile>?>)
Content copied to clipboard

Sources

<a data-name="%5Borg.hexworks.zircon.internal.graphics%2FArrayBackedTileMap%2FArrayBackedTileMap%2F%23org.hexworks.zircon.api.data.Size%23kotlin.Array%5Bkotlin.collections.Map.Entry%5Borg.hexworks.zircon.api.data.Position%2Corg.hexworks.zircon.api.data.Tile%5D%3F%5D%2FPointingToDeclaration%2F%5D%2FSource%2F-755115832" anchor-label="https://github.com/Hexworks/zircon/tree/master/zircon.core/src/commonMain/kotlin/org/hexworks/zircon/internal/graphics/ArrayBackedTileMap.kt#L7" id="%5Borg.hexworks.zircon.internal.graphics%2FArrayBackedTileMap%2FArrayBackedTileMap%2F%23org.hexworks.zircon.api.data.Size%23kotlin.Array%5Bkotlin.collections.Map.Entry%5Borg.hexworks.zircon.api.data.Position%2Corg.hexworks.zircon.api.data.Tile%5D%3F%5D%2FPointingToDeclaration%2F%5D%2FSource%2F-755115832" data-filterable-set=":zircon.core:dokkaHtml/commonMain">

(source)

Link copied to clipboard

© 2020 CopyrightSponsored and developed by dokka


text:
<!doctype html>

    <title>Code coverage report for system/public/controllers/index.js</title>
    <meta charset="utf-8">

    <link rel="stylesheet" href="../../../prettify.css">

Code coverage report for system/public/controllers/index.js

        Statements: 50% (5 / 10)

        Branches: 0% (0 / 4)

        Functions: 33.33% (1 / 3)

        Lines: 50% (5 / 10)

        Ignored: none

All files » system/public/controllers/ » index.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

1

1
1

1

1

'use strict';

angular.module('mean.system').controller('IndexController', ['$scope', 'Global',
  function($scope, Global) {
    $scope.global = Global;
    $scope.sites = {
      'makeapoint':{
        'name':'makeapoint',
        'text':'Makeapoint is a platform to craft and fine-tune ideas and messages providing a graphical experience which brough an offline methodlogy online',
        'author':'Linnovate',
        'link':'http://www.linnovate.net',
        'image':'/theme/assets/img/makeapoint.png'
      },
      'intranet':{
        'name':'Intranet',
        'text':'Enterpintranet',
        'author':'qed42',
        'link':'http://www.qed42.com',
        'image':''
      }
    };
    $scope.packages = {
      'gmap':{
        'name':'gmap',
        'text':'gmap lets you add geographical information to your applications objects',
        'author':'linnovate',
        'link':'http://www.qed42.com',
        'image':'/theme/assets/img/gmap.png'
      },
      'upload':{
        'name':'Upload',
        'text':'hello text',
        'author':'Linnovate',
        'link':'http://www.linnovate.net',
        'image':'http://cdn.designbyhumans.com/pictures/blog/09-2013/pop-culture-cats/Pop_Culture_Cats_Hamilton_Hipster.jpg'
      },
      'socket':{
        'name':'Socket',
        'text':'Socket.io support',
        'author':'Linnovate',
        'link':'http://www.linnovate.net',
        'image':'http://cdn.designbyhumans.com/pictures/blog/09-2013/pop-culture-cats/Pop_Culture_Cats_Hamilton_Hipster.jpg'
      }
    };

    $scope.$watch(function () {
      for (var i = 0; i < $scope.sites.length; i+=1) {
        if ($scope.sites[i].active) {
          return $scope.sites[i];
        }
      }
    }, function (currentSlide, previousSlide) {
      if (currentSlide !== previousSlide) {
        console.log('currentSlide:', currentSlide);
      }
    });
  }
]);

Generated by istanbul at Tue Dec 02 2014 04:25:29 GMT-0800 (PST)


text:
namespace performance_manager {

namespace {

class PageAggregatorTest : public GraphTestHarness {
 public:
  void SetUp() override {
    GraphTestHarness::SetUp();
    graph()->PassToGraph(std::make_unique<PageAggregator>());
  }
};

}  // namespace

TEST_F(PageAggregatorTest, WebLocksAggregation) {
  // Creates a page containing 2 frames.
  auto process = CreateNode<ProcessNodeImpl>();
  auto page = CreateNode<PageNodeImpl>();
  TestNodeWrapper<FrameNodeImpl> frame_0 =
      graph()->CreateFrameNodeAutoId(process.get(), page.get());
  TestNodeWrapper<FrameNodeImpl> frame_1 =
      graph()->CreateFrameNodeAutoId(process.get(), page.get());

  // By default the page shouldn't hold any WebLock.
  EXPECT_FALSE(page->is_holding_weblock());

  // |frame_0| now holds a WebLock, the corresponding property should be set on
  // the page node.
  frame_0->SetIsHoldingWebLock(true);
  EXPECT_TRUE(page->is_holding_weblock());

  // |frame_1| also holding a WebLock shouldn't affect the page property.
  frame_1->SetIsHoldingWebLock(true);
  EXPECT_TRUE(page->is_holding_weblock());

  // |frame_1| still holds a WebLock after this.
  frame_0->SetIsHoldingWebLock(false);
  EXPECT_TRUE(page->is_holding_weblock());

  // Destroying |frame_1| without explicitly releasing the WebLock it's
  // holding should update the corresponding page property.
  frame_1.reset();
  EXPECT_FALSE(page->is_holding_weblock());
}

TEST_F(PageAggregatorTest, IndexedDBLocksAggregation) {
  // Creates a page containing 2 frames.
  auto process = CreateNode<ProcessNodeImpl>();
  auto page = CreateNode<PageNodeImpl>();
  TestNodeWrapper<FrameNodeImpl> frame_0 =
      graph()->CreateFrameNodeAutoId(process.get(), page.get());
  TestNodeWrapper<FrameNodeImpl> frame_1 =
      graph()->CreateFrameNodeAutoId(process.get(), page.get());

  // By default the page shouldn't hold any IndexedDB lock.
  EXPECT_FALSE(page->is_holding_indexeddb_lock());

  // |frame_0| now holds an IndexedDB lock, the corresponding property should be
  // set on the page node.
  frame_0->SetIsHoldingIndexedDBLock(true);
  EXPECT_TRUE(page->is_holding_indexeddb_lock());

  // |frame_1| also holding an IndexedDB lock shouldn't affect the page
  // property.
  frame_1->SetIsHoldingIndexedDBLock(true);
  EXPECT_TRUE(page->is_holding_indexeddb_lock());

  // |frame_1| still holds an IndexedDB lock after this.
  frame_0->SetIsHoldingIndexedDBLock(false);
  EXPECT_TRUE(page->is_holding_indexeddb_lock());

  // Destroying |frame_1| without explicitly releasing the IndexedDB lock it's
  // holding should update the corresponding page property.
  frame_1.reset();
  EXPECT_FALSE(page->is_holding_indexeddb_lock());
}

}  // namespace performance_manager


text:
class MoveWirePointES : public edit_state
{
	typedef edit_state base;

	wire* const _wire;
	size_t const _pointIndex;
	wire_end const _initialPoint;
	POINT _first_down_location;

	enum substate
	{
		waiting_first_down,
		waiting_first_up,
		waiting_second_down,
		waiting_second_up,
		down,
	};

	substate _substate = waiting_first_down;

public:
	MoveWirePointES (const edit_state_deps& deps, wire* wire, size_t pointIndex)
		: base(deps), _wire(wire), _pointIndex(pointIndex), _initialPoint(wire->points()[pointIndex])
	{ }

	virtual bool completed() const override final { return _substate == down; }

	virtual void process_mouse_button_down (edge::mouse_button button, UINT modifierKeysDown, const mouse_location& location) override final
	{
		base::process_mouse_button_down (button, modifierKeysDown, location);

		if (button != edge::mouse_button::left)
			return;

		if (_substate == waiting_first_down)
		{
			_first_down_location = location.pt;
			_substate  = waiting_first_up;
		}
	}

	virtual void process_mouse_move (const mouse_location& location) override
	{
		base::process_mouse_move(location);

		auto port = _ew->GetCPAt (location.d, SnapDistance);
		if (port != nullptr)
		{
			auto alreadyConnectedWire = _project->GetWireConnectedToPort(port);
			if (alreadyConnectedWire.first == nullptr)
				_wire->set_point(_pointIndex, port);
		}
		else
			_wire->set_point(_pointIndex, location.w);

		if (_substate == waiting_first_up)
		{
			RECT rc = { _first_down_location.x, _first_down_location.y, _first_down_location.x, _first_down_location.y };
			InflateRect (&rc, GetSystemMetrics(SM_CXDRAG), GetSystemMetrics(SM_CYDRAG));
			if (!PtInRect(&rc, location.pt))
				_substate = waiting_second_up;
		}
	}

	virtual void process_mouse_button_up (edge::mouse_button button, UINT modifierKeysDown, const mouse_location& location) override final
	{
		if (_substate == waiting_second_up)
		{
			_project->SetChangedFlag(true);
			_substate = down;
		}
	}

	virtual std::optional<LRESULT> process_key_or_syskey_down (UINT virtualKey, UINT modifierKeys) override final
	{
		if (virtualKey == VK_ESCAPE)
		{
			_wire->set_point(_pointIndex, _initialPoint);
			_substate = down;
			return 0;
		}

		return std::nullopt;
	}

	virtual void render (ID2D1DeviceContext* rt) override final
	{
		auto& point = _wire->points()[_pointIndex];
		if (std::holds_alternative<connected_wire_end>(point))
			_ew->RenderSnapRect (rt, std::get<connected_wire_end>(point)->GetCPLocation());
	}

	virtual HCURSOR cursor() const override final { return LoadCursor(nullptr, IDC_CROSS); }
};

std::unique_ptr<edit_state> CreateStateMoveWirePoint (const edit_state_deps& deps, wire* wire, size_t pointIndex)
{
	return std::unique_ptr<edit_state>(new MoveWirePointES(deps, wire, pointIndex));
}


text:
/**
 * Support and FAQ: visit Atmel Support
 */

#ifndef _CONF_USB_H_
#define _CONF_USB_H_

#include "compiler.h"

/**
 * USB Device Configuration
 * @{
 */

/* ! Device definition (mandatory) */

#define  USB_DEVICE_VENDOR_ID             USB_VID_ATMEL
#define  USB_DEVICE_PRODUCT_ID            0x2437
#define  USB_DEVICE_MAJOR_VERSION         1
#define  USB_DEVICE_MINOR_VERSION         0
#define  USB_DEVICE_POWER                 100 /* Consumption on Vbus line (mA) */
#define  USB_DEVICE_ATTR \
	(USB_CONFIG_ATTR_REMOTE_WAKEUP | USB_CONFIG_ATTR_SELF_POWERED)
/* (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_BUS_POWERED) */
/* (USB_CONFIG_ATTR_SELF_POWERED) */
/* (USB_CONFIG_ATTR_BUS_POWERED) */

/* ! USB Device string definitions (Optional) */
#define  USB_DEVICE_MANUFACTURE_NAME      "ATMEL ASF"
#define  USB_DEVICE_PRODUCT_NAME          "HID Gamepad"
#define  USB_DEVICE_SERIAL_NAME           "123123123123" /* Disk SN for MSC */

/**
 * Device speeds support
 * @{
 */

/* ! To define a Low speed device */
#define  USB_DEVICE_LOW_SPEED

/* ! To authorize the High speed */
#if (UC3A3 || UC3A4)
#  define  USB_DEVICE_HS_SUPPORT
#elif (SAM3XA || SAM3U)
#  define  USB_DEVICE_HS_SUPPORT
#endif
/* @} */

/**
 * USB Device Callbacks definitions (Optional)
 * @{
 */
#define  UDC_VBUS_EVENT(b_vbus_high)
#define  UDC_SOF_EVENT()
#define  UDC_SUSPEND_EVENT()
#define  UDC_RESUME_EVENT()
/* ! Mandatory when USB_DEVICE_ATTR authorizes remote wakeup feature */
#define  UDC_REMOTEWAKEUP_ENABLE()
#define  UDC_REMOTEWAKEUP_DISABLE()
/* ! When a extra string descriptor must be supported */
/* ! other than manufacturer, product and serial string */
/* #define  UDC_GET_EXTRA_STRING() */
/* @} */

/**
 * USB Device low level configuration
 * When only one interface is used, these configurations are defined by the
 *class module.
 * For composite device, these configuration must be defined here
 * @{
 */
/* ! Control endpoint size */
#define  USB_DEVICE_EP_CTRL_SIZE       8

/* ! Two interfaces for this device (CDC + MSC + HID mouse + HID keyboard) */
#define  USB_DEVICE_NB_INTERFACE       1

/* ! 7 endpoints used by HID mouse, HID keyboard, CDC and MSC interfaces */
/* ! but an IN and OUT endpoints can be defined with the same number on XMEGA,
 * thus 5 */
/* (7 | USB_EP_DIR_IN)  // CDC Notify endpoint */
/* (6 | USB_EP_DIR_IN)  // CDC TX */
/* (5 | USB_EP_DIR_OUT) // CDC RX */
/* (1 | USB_EP_DIR_IN)  // MSC IN */
/* (2 | USB_EP_DIR_OUT) // MSC OUT */
/* (3 | USB_EP_DIR_IN)  // HID mouse report */
/* (4 | USB_EP_DIR_IN)  // HID keyboard report */
#define  USB_DEVICE_MAX_EP             1
#  if SAM3XA && defined(USB_DEVICE_HS_SUPPORT)
/* In HS mode, size of bulk endpoints are 512 */
/* If CDC and MSC endpoints all uses 2 banks, DPRAM is not enough: 4 bulk */
/* endpoints requires 4K bytes. So reduce the number of banks of CDC bulk */
/* endpoints to use less DPRAM. Keep MSC setting to keep MSC performance. */
#     define  UDD_BULK_NB_BANK(ep) ((ep == 5 || ep == 6) ? 1 : 2)
#  endif
/* @} */

/* @} */

/**
 * USB Interface Configuration
 * @{
 */

/**
 * Configuration of HID Keyboard interface
 * @{
 */
/* ! Interface callback definition */
#define  UDI_HID_GPD_ENABLE_EXT()      main_kbd_enable()
#define  UDI_HID_GPD_DISABLE_EXT()     main_kbd_disable()
#define  UDI_HID_GPD_CHANGE_LED(value)

/* ! Enable id string of interface to add an extra USB string */
/* #define  UDI_HID_KBD_STRING_ID            0 */

/**
 * USB HID Keyboard low level configuration
 * In standalone these configurations are defined by the HID Keyboard module.
 * For composite device, these configuration must be defined here
 * @{
 */
/* ! Endpoint numbers definition */
#define  UDI_HID_GPD_EP_IN           (1 | USB_EP_DIR_IN)

/* ! Interface number */
#define  UDI_HID_GPD_IFACE_NUMBER    0
/* @} */
/* @} */

/* @} */

/**
 * Description of Composite Device
 * @{
 */
/* ! USB Interfaces descriptor structure */
#define UDI_COMPOSITE_DESC_T \
	udi_hid_gpd_desc_t udi_hid_gpd

/* ! USB Interfaces descriptor value for Full Speed */
#define UDI_COMPOSITE_DESC_FS \
	.udi_hid_gpd   = UDI_HID_GPD_DESC

/* ! USB Interfaces descriptor value for High Speed */
#define UDI_COMPOSITE_DESC_HS \
	.udi_hid_gpd   = UDI_HID_GPD_DESC

/* ! USB Interface APIs */
#define UDI_COMPOSITE_API \
	& udi_api_hid_gpd
/* @} */

/**
 * USB Device Driver Configuration
 * @{
 */
/* @} */

/* ! The includes of classes and other headers must be done at the end of this
 * file to avoid compile error */
/* #include "udi_cdc.h" */
/* #include "udi_msc.h" */
/* #include "udi_hid_mouse.h" */
#include "udi_hid_gpd.h"
#include "app_config.h"

#endif /* _CONF_USB_H_ */


text:
package org.springframework.cloud.retrofit;

import java.util.Collections;
import java.util.Map;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

import okhttp3.OkHttpClient;
import retrofit2.CallAdapter;
import retrofit2.Converter;
import retrofit2.Retrofit;

/**
 * @author Spencer Gibb
 */
class RetrofitClientFactoryBean implements FactoryBean<Object>, InitializingBean,
		ApplicationContextAware {
	/***********************************
	 * WARNING! Nothing in this class should be @Autowired. It causes NPEs because of some lifecycle race condition.
	 ***********************************/

	private Class<?> type;

	private String name;

	private String url;

	private ApplicationContext applicationContext;

	@Override
	public void afterPropertiesSet() throws Exception {
		Assert.hasText(this.name, "Name must be set");
	}

	public Class<?> getType() {
		return type;
	}

	public void setType(Class<?> type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Override
	public void setApplicationContext(ApplicationContext context) throws BeansException {
		this.applicationContext = context;
	}

	protected Retrofit.Builder retrofit(RetrofitContext context) {
		Retrofit.Builder builder = get(context, Retrofit.Builder.class);

		OkHttpClient httpClient = getOptional(context, OkHttpClient.class);
		if (httpClient != null) {
			builder.client(httpClient);
		}

		Map<String, Converter.Factory> converterFactories = getInstances(context, Converter.Factory.class);
		converterFactories.values().forEach(builder::addConverterFactory);

		Map<String, CallAdapter.Factory> callAdapterFactories = getInstances(context, CallAdapter.Factory.class);
		callAdapterFactories.values().forEach(builder::addCallAdapterFactory);

		builder.validateEagerly(true); //TODO: allow customization

		return builder;
	}

	protected <T> Map<String, T> getInstances(RetrofitContext context, Class<T> type) {
		Map<String, T> instances = context.getInstances(this.name, type);
		if (instances == null) {
			return Collections.emptyMap();
		}
		return instances;
	}

	protected <T> T get(RetrofitContext context, Class<T> type) {
		T instance = context.getInstance(this.name, type);
		if (instance == null) {
			throw new IllegalStateException("No bean found of type " + type + " for "
					+ this.name);
		}
		return instance;
	}

	protected <T> T getOptional(RetrofitContext context, Class<T> type) {
		return context.getInstance(this.name, type);
	}

	/*protected <T> T loadBalance(Retrofit.Builder builder, RetrofitContext context,
			HardCodedTarget<T> target) {
		Client client = getOptional(context, Client.class);
		if (client != null) {
			builder.client(client);
			Targeter targeter = get(context, Targeter.class);
			return targeter.target(this, builder, context, target);
		}

		throw new IllegalStateException(
				"No Retrofit Client for loadBalancing defined. Did you forget to include spring-cloud-starter-ribbon?");
	}*/

	@Override
	public Object getObject() throws Exception {
		RetrofitContext context = applicationContext.getBean(RetrofitContext.class);

		Retrofit.Builder builder = retrofit(context);

		if (!StringUtils.hasText(this.url)) {
			String url;
			if (!this.name.startsWith("http")) {
				url = "http://" + this.name;
			}
			else {
				url = this.name;
			}
			throw new UnsupportedOperationException("retrofit loadbalancing is not implemented");
			//return loadBalance(builder, context, new HardCodedTarget<>(this.type,
			//		this.name, url));
		}
		if (StringUtils.hasText(this.url) && !this.url.startsWith("http")) {
			this.url = "http://" + this.url;
		}

		/*Client client = getOptional(context, Client.class);
		if (client != null) {
			if (client instanceof LoadBalancerRetrofitClient) {
				// not lod balancing because we have a url,
				// but ribbon is on the classpath, so unwrap
				client = ((LoadBalancerRetrofitClient)client).getDelegate();
			}
			builder.client(client);
		}
		Targeter targeter = get(context, Targeter.class);
		return targeter.target(this, builder, context, new HardCodedTarget<>(
				this.type, this.name, url));*/

		builder.baseUrl(this.url);
		Retrofit retrofit = builder.build();

		// add retrofit to this.names context as a bean
		AnnotationConfigApplicationContext applicationContext = context.getContext(this.name);
		applicationContext.registerBean(Retrofit.class, () -> retrofit);

		return retrofit.create(this.type);
	}

	@Override
	public Class<?> getObjectType() {
		return this.type;
	}

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

}


text:
<?php

/**
 * PHPCompatibility_Sniffs_PHP_LongArraysSniff.
 *
 * Marks the use of HTTP_*_VARS as deprecated
 *
 * PHP version 5.3
 *
 * @category  PHP
 * @package   PHPCompatibility
 * @author    Ben Selby <bselby@plus.net>
 * @copyright 2012 Ben Selby
 */
class PHPCompatibility_Sniffs_PHP_LongArraysSniff extends PHPCompatibility_Sniff
{
    /**
     * Array of HTTP_*_VARS that are now deprecated
     *
     * @var array
     */
    protected $deprecated = array(
        'HTTP_POST_VARS',
        'HTTP_GET_VARS',
        'HTTP_ENV_VARS',
        'HTTP_SERVER_VARS',
        'HTTP_COOKIE_VARS',
        'HTTP_SESSION_VARS',
        'HTTP_POST_FILES'
    );

    /**
     * Returns an array of tokens this test wants to listen for.
     *
     * @return array
     */
    public function register()
    {
        return array(T_VARIABLE);
    }

    /**
     * Processes this test, when one of its tokens is encountered.
     *
     * @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
     * @param int                  $stackPtr  The position of the current token in the
     *                                        stack passed in $tokens.
     *
     * @return void
     */
    public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
    {
        if ($this->supportsAbove('5.3') === false) {
            return;
        }

        $tokens = $phpcsFile->getTokens();

        // Check if the variable name is in our blacklist.
        if (in_array(substr($tokens[$stackPtr]['content'], 1), $this->deprecated, true) === false) {
            return;
        }

        if ($this->inClassScope($phpcsFile, $stackPtr, false) === true) {
            /*
             * Check for class property definitions.
             */
            $properties = array();
            try {
                $properties = $phpcsFile->getMemberProperties($stackPtr);
            } catch ( PHP_CodeSniffer_Exception $e) {
                // If it's not an expected exception, throw it.
                if ($e->getMessage() !== '$stackPtr is not a class member var') {
                    throw $e;
                }
            }

            if (isset($properties['scope'])) {
                // Ok, so this was a class property declaration, not our concern.
                return;
            }

            /*
             * Check for static usage of class properties shadowing the long arrays.
             */
            $prevToken = $phpcsFile->findPrevious(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr - 1), null, true, null, true);
            if ($tokens[$prevToken]['code'] === T_DOUBLE_COLON) {
                return;
            }
        }

        // Still here, so throw an error/warning.
        $error   = "The use of long predefined variables has been deprecated in 5.3%s; Found '%s'";
        $isError = $this->supportsAbove('5.4');
        $data    = array(
            ($isError ? ' and removed in 5.4' : ''),
            $tokens[$stackPtr]['content']
        );

        if ($isError === true) {
            $phpcsFile->addError($error, $stackPtr, 'Found', $data);
        } else {
            $phpcsFile->addWarning($error, $stackPtr, 'Found', $data);
        }
    }
}


text:
// Copyright 2009 The Go Authors.  All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

#include <pthread.h>
#include <string.h>
#include "libcgo.h"

static void *threadentry(void*);

static void
xinitcgo(G *g)
{
	pthread_attr_t attr;
	size_t size;

	pthread_attr_init(&attr);
	pthread_attr_getstacksize(&attr, &size);
	g->stackguard = (uintptr)&attr - size + 4096;
	pthread_attr_destroy(&attr);
}

void (*initcgo)(G*) = xinitcgo;

void
libcgo_sys_thread_start(ThreadStart *ts)
{
	pthread_attr_t attr;
	pthread_t p;
	size_t size;
	int err;

	// Not sure why the memset is necessary here,
	// but without it, we get a bogus stack size
	// out of pthread_attr_getstacksize.  C'est la Linux.
	memset(&attr, 0, sizeof attr);
	pthread_attr_init(&attr);
	size = 0;
	pthread_attr_getstacksize(&attr, &size);
	ts->g->stackguard = size;
	err = pthread_create(&p, &attr, threadentry, ts);
	if (err != 0) {
		fprintf(stderr, "runtime/cgo: pthread_create failed: %s\n", strerror(err));
		abort();
	}
}

static void*
threadentry(void *v)
{
	ThreadStart ts;

	ts = *(ThreadStart*)v;
	free(v);

	ts.g->stackbase = (uintptr)&ts;

	/*
	 * libcgo_sys_thread_start set stackguard to stack size;
	 * change to actual guard pointer.
	 */
	ts.g->stackguard = (uintptr)&ts - ts.g->stackguard + 4096;

	/*
	 * Set specific keys.  On Linux/ELF, the thread local storage
	 * is just before %gs:0.  Our dynamic 8.out's reserve 8 bytes
	 * for the two words g and m at %gs:-8 and %gs:-4.
	 * Xen requires us to access those words indirect from %gs:0
	 * which points at itself.
	 */
	asm volatile (
		"movl %%gs:0, %%eax\n"		// MOVL 0(GS), tmp
		"movl %0, -8(%%eax)\n"	// MOVL g, -8(GS)
		"movl %1, -4(%%eax)\n"	// MOVL m, -4(GS)
		:: "r"(ts.g), "r"(ts.m) : "%eax"
	);

	crosscall_386(ts.fn);
	return nil;
}


text:
layout: page
title: Community
---

* TOC
{:toc}

# Upcoming talks

* 2017/10/30–31 [DataEngConf NYC](http://www.dataengconf.com/) (New York City, USA)
  * Don't optimize my queries, optimimze my data! (Julian Hyde)

# Project Members

Name (Apache ID) | Github | Org | Role
:--------------- | :----- | :-- | :---
{% for c in site.data.contributors %}{% if c.homepage %}{{ c.name }}{% else %}{{ c.name }}{% endif %} ({{ c.apacheId }}) |  | {{ c.org }} | {{ c.role }}
{% endfor %}

# Mailing Lists

There are several mailing lists for Calcite:

* [dev@calcite.apache.org](mailto:dev@calcite.apache.org) — Development discussions
  [[archive](https://mail-archives.apache.org/mod_mbox/calcite-dev/)]
* [issues@calcite.apache.org](mailto:issues@calcite.apache.org) — Bug tracking
  [[archive](https://mail-archives.apache.org/mod_mbox/calcite-issues/)]
* [commits@calcite.apache.org](mailto:commits@calcite.apache.org) — Git tracking
  [[archive](https://mail-archives.apache.org/mod_mbox/calcite-commits/)]

You can subscribe to the lists by sending email to
*{list}*-subscribe@calcite.apache.org and unsubscribe by sending email to
*{list}*-unsubscribe@calcite.apache.org (where *{list}* is either "dev", "issues", or "commits").

# Help

Need help with Calcite? Try these resources:

* **Mailing Lists**.
  The best option is to send email to the developers list
  [dev@calcite.apache.org](mailto:dev@calcite.apache.org). All
  of the historic traffic is available in the
  [archive](http://mail-archives.apache.org/mod_mbox/calcite-dev/). To
  subscribe to the user list, please send email to
  [dev-subscribe@calcite.apache.org](mailto:dev-subscribe@calcite.apache.org).
* **Bug Reports**.
  Please file any issues you encounter or fixes you'd like on the
  [Calcite Jira](https://issues.apache.org/jira/browse/CALCITE). We welcome
  patches and pull-requests!
* **StackOverflow**.
  [StackOverflow](http://stackoverflow.com/questions/tagged/calcite) is a wonderful resource for
  any developer. Take a look over there to see if someone has answered
  your question.
* **Browse the code**.
  One of the advantages of open source software is that you can browse the code.
  The code is available on [github](https://github.com/apache/calcite/tree/master).

# Talks

Want to learn more about Calcite?

Watch some presentations and read through some slide decks about
Calcite, or attend one of the [upcoming talks](#upcoming-talks).

## Apache Calcite: One planner fits all

Voted [Best Lightning Talk at XLDB-2015](http://www.xldb.org/archives/2015/05/best-lightning-talks-selected/);
[[video](https://www.youtube.com/watch?v=5_MyORYjq3w)],
[[slides](http://www.slideshare.net/julianhyde/apache-calcite-one-planner-fits-all)].

{% oembed https://www.youtube.com/watch?v=5_MyORYjq3w %}

## Streaming SQL

At Hadoop Summit, San Jose, CA, 2016
[[video](https://www.youtube.com/watch?v=b7HENkvd1uU)],
[[slides](http://www.slideshare.net/julianhyde/streaming-sql-63554778)],
[[pdf](https://github.com/julianhyde/share/blob/master/slides/calcite-streaming-sql-san-jose-2016.pdf?raw=true)].

{% oembed https://www.youtube.com/watch?v=b7HENkvd1uU %}

## Cost-based Query Optimization in Apache Phoenix using Apache Calcite

At Hadoop Summit, San Jose, CA, 2016
[[video](https://www.youtube.com/watch?v=gz9X7JD8BAU)],
[[slides](http://www.slideshare.net/julianhyde/costbased-query-optimization-in-apache-phoenix-using-apache-calcite)],
[[pdf](https://github.com/julianhyde/share/blob/master/slides/phoenix-on-calcite-hadoop-summit-2016.pdf?raw=true)].

{% oembed https://www.youtube.com/watch?v=gz9X7JD8BAU %}

## Planning with Polyalgebra: Bringing together relational, complex and machine learning algebra

As Hadoop Summit, Dublin, 2016
[[video](https://www.youtube.com/watch?v=fHZqbe3iPMc)],
[[slides](http://www.slideshare.net/julianhyde/planning-with-polyalgebra-bringing-together-relational-complex-and-machine-learning-algebra)].

{% oembed https://www.youtube.com/watch?v=fHZqbe3iPMc %}

## More talks

* Why you care about relational algebra (even though you didn't know it) (Washington DC, 2015)
* Cost-based optimization in Hive 0.14 (Seattle, 2014)
* Discardable, in-memory materialized query for Hadoop (video) (Hadoop Summit, 2014)
* SQL Now! (NoSQL Now! conference, 2013)
* Drill / SQL / Optiq (2013)
* How to integrate Splunk with any data solution (Splunk User Conference, 2012)


text:
package examples;

import junit.framework.*;

/**
 * This class implements JUnit tests for the following classes:
 *
 *     BasicCognitiveModelLiteExample
 *
 * @author Justin Basilico
 * @since  2.0
 */
public class BasicCognitiveModelLiteExampleTest
    extends TestCase
{
    /**
     * Creates a new BasicCognitiveModelLiteExampleTest.
     */
    public BasicCognitiveModelLiteExampleTest(
        String testName)
    {
        super(testName);
    }

    /**
     * Test of main method, of class examples.BasicCognitiveModelLiteExample.
     */
    public void testMain()
    {
        // This makes sure that the example code runs.
        String[] arguments = new String[0];
        BasicCognitiveModelLiteExample.main(arguments);
    }
}


text:
const lessTest = require('./less-test')
const lessTester = lessTest()
const path = require('path')
const stylize = require('./stylize')

function getErrorPathReplacementFunction(dir) {
  return (input, baseDir) =>
    input
      .replace(/\{path\}/g, path.join(process.cwd(), baseDir, `${dir}/`))
      .replace(/\{node\}/g, '')
      .replace(/\{\/node\}/g, '')
      .replace(/\{pathrel\}/g, path.join(baseDir, `${dir}/`))
      .replace(/\{pathhref\}/g, '')
      .replace(/\{404status\}/g, '')
      .replace(/\r\n/g, '\n')
}

console.log(`\n${stylize('Less', 'underline')}\n`)
lessTester.prepBomTest()
lessTester.runTestSet({ strictMath: true, relativeUrls: true, silent: true })
lessTester.runTestSet(
  { strictMath: true, strictUnits: true },
  'errors/',
  lessTester.testErrors,
  null,
  getErrorPathReplacementFunction('errors')
)
lessTester.runTestSet(
  { strictMath: true, strictUnits: true, javascriptEnabled: false },
  'no-js-errors/',
  lessTester.testErrors,
  null,
  getErrorPathReplacementFunction('no-js-errors')
)
lessTester.runTestSet(
  { strictMath: true, dumpLineNumbers: 'comments' },
  'debug/',
  null,
  name => `${name}-comments`
)
lessTester.runTestSet(
  { strictMath: true, dumpLineNumbers: 'mediaquery' },
  'debug/',
  null,
  name => `${name}-mediaquery`
)
lessTester.runTestSet(
  { strictMath: true, dumpLineNumbers: 'all' },
  'debug/',
  null,
  name => `${name}-all`
)
lessTester.runTestSet(
  { strictMath: true, relativeUrls: false, rootpath: 'folder (1)/' },
  'static-urls/'
)
lessTester.runTestSet({ strictMath: true, compress: true }, 'compression/')
lessTester.runTestSet({ strictMath: true, strictUnits: true }, 'strict-units/')
lessTester.runTestSet({}, 'legacy/')
lessTester.runTestSet(
  { strictMath: true, strictUnits: true, sourceMap: true, globalVars: true },
  'sourcemaps/',
  lessTester.testSourcemap,
  null,
  null,
  (filename, type, baseFolder) => {
    if (type === 'vars') {
      return `${path.join(baseFolder, filename)}.json`
    }
    return `${path.join('test/sourcemaps', filename)}.json`
  }
)
lessTester.runTestSet(
  {
    strictMath: true,
    strictUnits: true,
    sourceMap: { sourceMapFileInline: true },
  },
  'sourcemaps-empty/',
  lessTester.testEmptySourcemap
)
lessTester.runTestSet(
  { globalVars: true, banner: '/**\n  * Test\n  */\n' },
  'globalVars/',
  null,
  null,
  null,
  (name, type, baseFolder) => `${path.join(baseFolder, name)}.json`
)
lessTester.runTestSet(
  { modifyVars: true },
  'modifyVars/',
  null,
  null,
  null,
  (name, type, baseFolder) => `${path.join(baseFolder, name)}.json`
)
lessTester.runTestSet({ urlArgs: '424242' }, 'url-args/')
lessTester.runTestSet(
  { paths: ['test/data/', 'test/less/import/'] },
  'include-path/'
)
lessTester.runTestSet({ paths: 'test/data/' }, 'include-path-string/')
lessTester.runTestSet(
  { plugin: 'test/plugins/postprocess/' },
  'postProcessorPlugin/'
)
lessTester.runTestSet(
  { plugin: 'test/plugins/preprocess/' },
  'preProcessorPlugin/'
)
lessTester.runTestSet({ plugin: 'test/plugins/visitor/' }, 'visitorPlugin/')
lessTester.runTestSet(
  { plugin: 'test/plugins/filemanager/' },
  'filemanagerPlugin/'
)
lessTester.runTestSet({}, 'no-strict-math/')
lessTester.runTestSet({ simplify: true }, 'simplify/')
lessTester.testSyncronous({ syncImport: true }, 'import')
lessTester.testSyncronous({ syncImport: true }, 'css')
lessTester.testNoOptions()
lessTester.finished().then(() => {
  /***
   * TODO: Some of these test cant be run in browser
   */
  const browserTester = lessTest(require('../dist/less.min'))
  console.log(`\n${stylize('Less browser', 'underline')}\n`)
  browserTester.prepBomTest()
  browserTester.runTestSet({
    strictMath: true,
    relativeUrls: true,
    silent: true,
  })
  browserTester.runTestSet(
    { strictMath: true, strictUnits: true },
    'errors/',
    browserTester.testErrors,
    null,
    getErrorPathReplacementFunction('errors')
  )
  browserTester.runTestSet(
    { strictMath: true, strictUnits: true, javascriptEnabled: false },
    'no-js-errors/',
    browserTester.testErrors,
    null,
    getErrorPathReplacementFunction('no-js-errors')
  )
  browserTester.runTestSet(
    { strictMath: true, dumpLineNumbers: 'comments' },
    'debug/',
    null,
    name => `${name}-comments`
  )
  browserTester.runTestSet(
    { strictMath: true, dumpLineNumbers: 'mediaquery' },
    'debug/',
    null,
    name => `${name}-mediaquery`
  )
  browserTester.runTestSet(
    { strictMath: true, dumpLineNumbers: 'all' },
    'debug/',
    null,
    name => `${name}-all`
  )
  browserTester.runTestSet(
    { strictMath: true, relativeUrls: false, rootpath: 'folder (1)/' },
    'static-urls/'
  )
  browserTester.runTestSet({ strictMath: true, compress: true }, 'compression/')
  browserTester.runTestSet(
    { strictMath: true, strictUnits: true },
    'strict-units/'
  )
  browserTester.runTestSet({}, 'legacy/')
  browserTester.runTestSet(
    { strictMath: true, strictUnits: true, sourceMap: true, globalVars: true },
    'sourcemaps/',
    browserTester.testSourcemap,
    null,
    null,
    (filename, type, baseFolder) => {
      if (type === 'vars') {
        return `${path.join(baseFolder, filename)}.json`
      }
      return `${path.join('test/sourcemaps', filename)}.json`
    }
  )
  browserTester.runTestSet(
    {
      strictMath: true,
      strictUnits: true,
      sourceMap: { sourceMapFileInline: true },
    },
    'sourcemaps-empty/',
    browserTester.testEmptySourcemap
  )
  browserTester.runTestSet(
    { globalVars: true, banner: '/**\n  * Test\n  */\n' },
    'globalVars/',
    null,
    null,
    null,
    (name, type, baseFolder) => `${path.join(baseFolder, name)}.json`
  )
  browserTester.runTestSet(
    { modifyVars: true },
    'modifyVars/',
    null,
    null,
    null,
    (name, type, baseFolder) => `${path.join(baseFolder, name)}.json`
  )
  browserTester.runTestSet({ urlArgs: '424242' }, 'url-args/')
  browserTester.runTestSet(
    { paths: ['test/data/', 'test/less/import/'] },
    'include-path/'
  )
  browserTester.runTestSet({ paths: 'test/data/' }, 'include-path-string/')
  browserTester.runTestSet(
    { plugin: 'test/plugins/postprocess/' },
    'postProcessorPlugin/'
  )
  browserTester.runTestSet(
    { plugin: 'test/plugins/preprocess/' },
    'preProcessorPlugin/'
  )
  browserTester.runTestSet(
    { plugin: 'test/plugins/visitor/' },
    'visitorPlugin/'
  )
  browserTester.runTestSet(
    { plugin: 'test/plugins/filemanager/' },
    'filemanagerPlugin/'
  )
  browserTester.runTestSet({}, 'no-strict-math/')
  browserTester.runTestSet({ simplify: true }, 'simplify/')
  browserTester.testSyncronous({ syncImport: true }, 'import')
  browserTester.testSyncronous({ syncImport: true }, 'css')
  browserTester.testNoOptions()
  browserTester.finished().catch()
})


text:
package info.eivanov.weatherforecastr.di.components;

import javax.inject.Singleton;

import dagger.Component;
import info.eivanov.weatherforecastr.activities.MainActivity;
import info.eivanov.weatherforecastr.activities.SplashActivity;
import info.eivanov.weatherforecastr.di.modules.ApplicationModule;
import info.eivanov.weatherforecastr.di.modules.NetworkModule;
import info.eivanov.weatherforecastr.di.modules.RepositoryModule;
import info.eivanov.weatherforecastr.repository.CurrentLocationsRepo;
import info.eivanov.weatherforecastr.repository.GetWeatherInfoRepo;

/**
 * Created by killer on 8/30/17.
 */
@Singleton
@Component(modules = {ApplicationModule.class, NetworkModule.class, RepositoryModule.class})
public interface ApplicationComponent {

    CurrentLocationsRepo getCurrentLocationRepo();

    GetWeatherInfoRepo getWeatherRepo();

    void inject(SplashActivity activity);

    void inject(MainActivity activity);

}