text:
.class public Lcom/android/server/notification/NextAlarmConditionProvider;
.super Landroid/service/notification/ConditionProviderService;
.source "NextAlarmConditionProvider.java"

# static fields
.field private static final BAD_CONDITION:J = -0x1L

.field public static final COMPONENT:Landroid/content/ComponentName;

.field private static final DEBUG:Z

.field private static final HOURS:J = 0x36ee80L

.field private static final MINUTES:J = 0xea60L

.field private static final SECONDS:J = 0x3e8L

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

# instance fields
.field private mConnected:Z

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

.field private mLookaheadThreshold:J

.field private mRequesting:Z

.field private final mSubscriptions:Landroid/util/ArraySet;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Landroid/util/ArraySet",
            "<",
            "Landroid/net/Uri;",
            ">;"
        }
    .end annotation
.end field

.field private final mTracker:Lcom/android/server/notification/NextAlarmTracker;

.field private final mTrackerCallback:Lcom/android/server/notification/NextAlarmTracker$Callback;

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

    .prologue
    .line 51
    const-string v0, "NextAlarmConditions"

    const/4 v1, 0x3

    invoke-static {v0, v1}, Landroid/util/Log;->isLoggable(Ljava/lang/String;I)Z

    move-result v0

    sput-boolean v0, Lcom/android/server/notification/NextAlarmConditionProvider;->DEBUG:Z

    .line 59
    new-instance v0, Landroid/content/ComponentName;

    const-string v1, "android"

    const-class v2, Lcom/android/server/notification/NextAlarmConditionProvider;

    invoke-virtual {v2}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v0, v1, v2}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    sput-object v0, Lcom/android/server/notification/NextAlarmConditionProvider;->COMPONENT:Landroid/content/ComponentName;

    return-void
.end method

.method public constructor <init>(Lcom/android/server/notification/NextAlarmTracker;)V
    .locals 2
    .param p1, "tracker"    # Lcom/android/server/notification/NextAlarmTracker;

    .prologue
    .line 70
    invoke-direct {p0}, Landroid/service/notification/ConditionProviderService;-><init>()V

    .line 62
    iput-object p0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mContext:Landroid/content/Context;

    .line 64
    new-instance v0, Landroid/util/ArraySet;

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

    iput-object v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mSubscriptions:Landroid/util/ArraySet;

    .line 218
    new-instance v0, Lcom/android/server/notification/NextAlarmConditionProvider$1;

    invoke-direct {v0, p0}, Lcom/android/server/notification/NextAlarmConditionProvider$1;-><init>(Lcom/android/server/notification/NextAlarmConditionProvider;)V

    iput-object v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mTrackerCallback:Lcom/android/server/notification/NextAlarmTracker$Callback;

    .line 71
    sget-boolean v0, Lcom/android/server/notification/NextAlarmConditionProvider;->DEBUG:Z

    if-eqz v0, :cond_0

    const-string v0, "NextAlarmConditions"

    const-string v1, "new NextAlarmConditionProvider()"

    invoke-static {v0, v1}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 72
    :cond_0
    iput-object p1, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mTracker:Lcom/android/server/notification/NextAlarmTracker;

    .line 73
    return-void
.end method

.method static synthetic access$000(Lcom/android/server/notification/NextAlarmConditionProvider;Landroid/app/AlarmManager$AlarmClockInfo;JZ)V
    .locals 0
    .param p0, "x0"    # Lcom/android/server/notification/NextAlarmConditionProvider;
    .param p1, "x1"    # Landroid/app/AlarmManager$AlarmClockInfo;
    .param p2, "x2"    # J
    .param p4, "x3"    # Z

    .prologue
    .line 49
    invoke-direct {p0, p1, p2, p3, p4}, Lcom/android/server/notification/NextAlarmConditionProvider;->onEvaluate(Landroid/app/AlarmManager$AlarmClockInfo;JZ)V

    return-void
.end method

.method private isWithinLookaheadThreshold(Landroid/app/AlarmManager$AlarmClockInfo;)Z
    .locals 10
    .param p1, "alarm"    # Landroid/app/AlarmManager$AlarmClockInfo;

    .prologue
    const-wide/16 v8, 0x0

    const/4 v2, 0x0

    .line 135
    if-nez p1, :cond_1

    .line 137
    :cond_0
    :goto_0
    return v2

    .line 136
    :cond_1
    invoke-static {p1}, Lcom/android/server/notification/NextAlarmTracker;->getEarlyTriggerTime(Landroid/app/AlarmManager$AlarmClockInfo;)J

    move-result-wide v4

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v6

    sub-long v0, v4, v6

    .line 137
    .local v0, "delta":J
    cmp-long v3, v0, v8

    if-lez v3, :cond_0

    iget-wide v4, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mLookaheadThreshold:J

    cmp-long v3, v4, v8

    if-lez v3, :cond_2

    iget-wide v4, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mLookaheadThreshold:J

    cmp-long v3, v0, v4

    if-gez v3, :cond_0

    :cond_2
    const/4 v2, 0x1

    goto :goto_0
.end method

.method private newConditionId(Landroid/app/AlarmManager$AlarmClockInfo;)Landroid/net/Uri;
    .locals 4
    .param p1, "nextAlarm"    # Landroid/app/AlarmManager$AlarmClockInfo;

    .prologue
    .line 151
    new-instance v0, Landroid/net/Uri$Builder;

    invoke-direct {v0}, Landroid/net/Uri$Builder;-><init>()V

    const-string v1, "condition"

    invoke-virtual {v0, v1}, Landroid/net/Uri$Builder;->scheme(Ljava/lang/String;)Landroid/net/Uri$Builder;

    move-result-object v0

    const-string v1, "android"

    invoke-virtual {v0, v1}, Landroid/net/Uri$Builder;->authority(Ljava/lang/String;)Landroid/net/Uri$Builder;

    move-result-object v0

    const-string v1, "next_alarm"

    invoke-virtual {v0, v1}, Landroid/net/Uri$Builder;->appendPath(Ljava/lang/String;)Landroid/net/Uri$Builder;

    move-result-object v0

    iget-object v1, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mTracker:Lcom/android/server/notification/NextAlarmTracker;

    invoke-virtual {v1}, Lcom/android/server/notification/NextAlarmTracker;->getCurrentUserId()I

    move-result v1

    invoke-static {v1}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/net/Uri$Builder;->appendPath(Ljava/lang/String;)Landroid/net/Uri$Builder;

    move-result-object v0

    invoke-virtual {p1}, Landroid/app/AlarmManager$AlarmClockInfo;->getTriggerTime()J

    move-result-wide v2

    invoke-static {v2, v3}, Ljava/lang/Long;->toString(J)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/net/Uri$Builder;->appendPath(Ljava/lang/String;)Landroid/net/Uri$Builder;

    move-result-object v0

    invoke-virtual {v0}, Landroid/net/Uri$Builder;->build()Landroid/net/Uri;

    move-result-object v0

    return-object v0
.end method

.method private notifyCondition(Landroid/net/Uri;Landroid/app/AlarmManager$AlarmClockInfo;ILjava/lang/String;)V
    .locals 8
    .param p1, "id"    # Landroid/net/Uri;
    .param p2, "alarm"    # Landroid/app/AlarmManager$AlarmClockInfo;
    .param p3, "state"    # I
    .param p4, "reason"    # Ljava/lang/String;

    .prologue
    const/4 v7, 0x1

    const/4 v5, 0x0

    .line 141
    if-nez p2, :cond_1

    const-string v4, ""

    .line 142
    .local v4, "formattedAlarm":Ljava/lang/String;
    :goto_0
    sget-boolean v0, Lcom/android/server/notification/NextAlarmConditionProvider;->DEBUG:Z

    if-eqz v0, :cond_0

    const-string v0, "NextAlarmConditions"

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "notifyCondition "

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

    move-result-object v1

    invoke-static {p3}, Landroid/service/notification/Condition;->stateToString(I)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, " alarm="

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

    move-result-object v1

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

    move-result-object v1

    const-string v2, " reason="

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

    move-result-object v1

    invoke-virtual {v1, p4}, 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

    invoke-static {v0, v1}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 144
    :cond_0
    new-instance v0, Landroid/service/notification/Condition;

    iget-object v1, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mContext:Landroid/content/Context;

    const v2, 0x104069a

    new-array v3, v7, [Ljava/lang/Object;

    aput-object v4, v3, v5

    invoke-virtual {v1, v2, v3}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v2

    iget-object v1, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mContext:Landroid/content/Context;

    const v3, 0x104069b

    invoke-virtual {v1, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v3

    move-object v1, p1

    move v6, p3

    invoke-direct/range {v0 .. v7}, Landroid/service/notification/Condition;-><init>(Landroid/net/Uri;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;III)V

    invoke-virtual {p0, v0}, Lcom/android/server/notification/NextAlarmConditionProvider;->notifyCondition(Landroid/service/notification/Condition;)V

    .line 148
    return-void

    .line 141
    .end local v4    # "formattedAlarm":Ljava/lang/String;
    :cond_1
    iget-object v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mTracker:Lcom/android/server/notification/NextAlarmTracker;

    invoke-virtual {v0, p2}, Lcom/android/server/notification/NextAlarmTracker;->formatAlarm(Landroid/app/AlarmManager$AlarmClockInfo;)Ljava/lang/String;

    move-result-object v4

    goto :goto_0
.end method

.method private onEvaluate(Landroid/app/AlarmManager$AlarmClockInfo;JZ)V
    .locals 16
    .param p1, "nextAlarm"    # Landroid/app/AlarmManager$AlarmClockInfo;
    .param p2, "wakeupTime"    # J
    .param p4, "booted"    # Z

    .prologue
    .line 180
    invoke-direct/range {p0 .. p1}, Lcom/android/server/notification/NextAlarmConditionProvider;->isWithinLookaheadThreshold(Landroid/app/AlarmManager$AlarmClockInfo;)Z

    move-result v7

    .line 181
    .local v7, "withinThreshold":Z
    if-eqz p1, :cond_3

    invoke-virtual/range {p1 .. p1}, Landroid/app/AlarmManager$AlarmClockInfo;->getTriggerTime()J

    move-result-wide v8

    .line 182
    .local v8, "nextAlarmTime":J
    :goto_0
    sget-boolean v12, Lcom/android/server/notification/NextAlarmConditionProvider;->DEBUG:Z

    if-eqz v12, :cond_0

    const-string v12, "NextAlarmConditions"

    new-instance v13, Ljava/lang/StringBuilder;

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

    const-string v14, "onEvaluate mSubscriptions="

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

    move-result-object v13

    move-object/from16 v0, p0

    iget-object v14, v0, Lcom/android/server/notification/NextAlarmConditionProvider;->mSubscriptions:Landroid/util/ArraySet;

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

    move-result-object v13

    const-string v14, " nextAlarmTime="

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

    move-result-object v13

    move-object/from16 v0, p0

    iget-object v14, v0, Lcom/android/server/notification/NextAlarmConditionProvider;->mTracker:Lcom/android/server/notification/NextAlarmTracker;

    invoke-virtual {v14, v8, v9}, Lcom/android/server/notification/NextAlarmTracker;->formatAlarmDebug(J)Ljava/lang/String;

    move-result-object v14

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

    move-result-object v13

    const-string v14, " nextAlarmWakeup="

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

    move-result-object v13

    move-object/from16 v0, p0

    iget-object v14, v0, Lcom/android/server/notification/NextAlarmConditionProvider;->mTracker:Lcom/android/server/notification/NextAlarmTracker;

    move-wide/from16 v0, p2

    invoke-virtual {v14, v0, v1}, Lcom/android/server/notification/NextAlarmTracker;->formatAlarmDebug(J)Ljava/lang/String;

    move-result-object v14

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

    move-result-object v13

    const-string v14, " withinThreshold="

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

    move-result-object v13

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

    move-result-object v13

    const-string v14, " booted="

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

    move-result-object v13

    move/from16 v0, p4

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

    move-result-object v13

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

    move-result-object v13

    invoke-static {v12, v13}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I

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

    iget-object v3, v0, Lcom/android/server/notification/NextAlarmConditionProvider;->mSubscriptions:Landroid/util/ArraySet;

    .line 189
    .local v3, "conditions":Landroid/util/ArraySet;, "Landroid/util/ArraySet<Landroid/net/Uri;>;"
    move-object/from16 v0, p0

    iget-boolean v12, v0, Lcom/android/server/notification/NextAlarmConditionProvider;->mRequesting:Z

    if-eqz v12, :cond_1

    if-eqz p1, :cond_1

    if-eqz v7, :cond_1

    .line 190
    invoke-direct/range {p0 .. p1}, Lcom/android/server/notification/NextAlarmConditionProvider;->newConditionId(Landroid/app/AlarmManager$AlarmClockInfo;)Landroid/net/Uri;

    move-result-object v6

    .line 191
    .local v6, "id":Landroid/net/Uri;
    invoke-virtual {v3, v6}, Landroid/util/ArraySet;->contains(Ljava/lang/Object;)Z

    move-result v12

    if-nez v12, :cond_1

    .line 192
    new-instance v4, Landroid/util/ArraySet;

    invoke-direct {v4, v3}, Landroid/util/ArraySet;-><init>(Landroid/util/ArraySet;)V

    .line 193
    .end local v3    # "conditions":Landroid/util/ArraySet;, "Landroid/util/ArraySet<Landroid/net/Uri;>;"
    .local v4, "conditions":Landroid/util/ArraySet;, "Landroid/util/ArraySet<Landroid/net/Uri;>;"
    invoke-virtual {v4, v6}, Landroid/util/ArraySet;->add(Ljava/lang/Object;)Z

    move-object v3, v4

    .line 196
    .end local v4    # "conditions":Landroid/util/ArraySet;, "Landroid/util/ArraySet<Landroid/net/Uri;>;"
    .end local v6    # "id":Landroid/net/Uri;
    .restart local v3    # "conditions":Landroid/util/ArraySet;, "Landroid/util/ArraySet<Landroid/net/Uri;>;"
    :cond_1
    invoke-virtual {v3}, Landroid/util/ArraySet;->iterator()Ljava/util/Iterator;

    move-result-object v5

    .local v5, "i$":Ljava/util/Iterator;
    :cond_2
    :goto_1
    invoke-interface {v5}, Ljava/util/Iterator;->hasNext()Z

    move-result v12

    if-eqz v12, :cond_8

    invoke-interface {v5}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/net/Uri;

    .line 197
    .local v2, "conditionId":Landroid/net/Uri;
    move-object/from16 v0, p0

    invoke-direct {v0, v2}, Lcom/android/server/notification/NextAlarmConditionProvider;->tryParseNextAlarmCondition(Landroid/net/Uri;)J

    move-result-wide v10

    .line 198
    .local v10, "time":J
    const-wide/16 v12, -0x1

    cmp-long v12, v10, v12

    if-nez v12, :cond_4

    .line 199
    const/4 v12, 0x0

    const-string v13, "badCondition"

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    invoke-direct {v0, v2, v1, v12, v13}, Lcom/android/server/notification/NextAlarmConditionProvider;->notifyCondition(Landroid/net/Uri;Landroid/app/AlarmManager$AlarmClockInfo;ILjava/lang/String;)V

    goto :goto_1

    .line 181
    .end local v2    # "conditionId":Landroid/net/Uri;
    .end local v3    # "conditions":Landroid/util/ArraySet;, "Landroid/util/ArraySet<Landroid/net/Uri;>;"
    .end local v5    # "i$":Ljava/util/Iterator;
    .end local v8    # "nextAlarmTime":J
    .end local v10    # "time":J
    :cond_3
    const-wide/16 v8, 0x0

    goto/16 :goto_0

    .line 200
    .restart local v2    # "conditionId":Landroid/net/Uri;
    .restart local v3    # "conditions":Landroid/util/ArraySet;, "Landroid/util/ArraySet<Landroid/net/Uri;>;"
    .restart local v5    # "i$":Ljava/util/Iterator;
    .restart local v8    # "nextAlarmTime":J
    .restart local v10    # "time":J
    :cond_4
    if-nez p4, :cond_5

    .line 202
    move-object/from16 v0, p0

    iget-object v12, v0, Lcom/android/server/notification/NextAlarmConditionProvider;->mSubscriptions:Landroid/util/ArraySet;

    invoke-virtual {v12, v2}, Landroid/util/ArraySet;->contains(Ljava/lang/Object;)Z

    move-result v12

    if-eqz v12, :cond_2

    .line 203
    const/4 v12, 0x2

    const-string v13, "!booted"

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    invoke-direct {v0, v2, v1, v12, v13}, Lcom/android/server/notification/NextAlarmConditionProvider;->notifyCondition(Landroid/net/Uri;Landroid/app/AlarmManager$AlarmClockInfo;ILjava/lang/String;)V

    goto :goto_1

    .line 205
    :cond_5
    cmp-long v12, v10, v8

    if-eqz v12, :cond_6

    .line 207
    const/4 v12, 0x0

    const-string v13, "changed"

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    invoke-direct {v0, v2, v1, v12, v13}, Lcom/android/server/notification/NextAlarmConditionProvider;->notifyCondition(Landroid/net/Uri;Landroid/app/AlarmManager$AlarmClockInfo;ILjava/lang/String;)V

    goto :goto_1

    .line 208
    :cond_6
    if-nez v7, :cond_7

    .line 210
    const/4 v12, 0x0

    const-string v13, "!within"

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    invoke-direct {v0, v2, v1, v12, v13}, Lcom/android/server/notification/NextAlarmConditionProvider;->notifyCondition(Landroid/net/Uri;Landroid/app/AlarmManager$AlarmClockInfo;ILjava/lang/String;)V

    goto :goto_1

    .line 213
    :cond_7
    const/4 v12, 0x1

    const-string v13, "within"

    move-object/from16 v0, p0

    move-object/from16 v1, p1

    invoke-direct {v0, v2, v1, v12, v13}, Lcom/android/server/notification/NextAlarmConditionProvider;->notifyCondition(Landroid/net/Uri;Landroid/app/AlarmManager$AlarmClockInfo;ILjava/lang/String;)V

    goto :goto_1

    .line 216
    .end local v2    # "conditionId":Landroid/net/Uri;
    .end local v10    # "time":J
    :cond_8
    return-void
.end method

.method private static tryParseLong(Ljava/lang/String;J)J
    .locals 3
    .param p0, "value"    # Ljava/lang/String;
    .param p1, "defValue"    # J

    .prologue
    .line 171
    invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 175
    .end local p1    # "defValue":J
    :goto_0
    return-wide p1

    .line 173
    .restart local p1    # "defValue":J
    :cond_0
    :try_start_0
    invoke-static {p0}, Ljava/lang/Long;->valueOf(Ljava/lang/String;)Ljava/lang/Long;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/Long;->longValue()J
    :try_end_0
    .catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-wide p1

    goto :goto_0

    .line 174
    :catch_0
    move-exception v0

    .line 175
    .local v0, "e":Ljava/lang/NumberFormatException;
    goto :goto_0
.end method

.method private tryParseNextAlarmCondition(Landroid/net/Uri;)J
    .locals 4
    .param p1, "conditionId"    # Landroid/net/Uri;

    .prologue
    const-wide/16 v2, -0x1

    .line 160
    if-eqz p1, :cond_0

    invoke-virtual {p1}, Landroid/net/Uri;->getScheme()Ljava/lang/String;

    move-result-object v0

    const-string v1, "condition"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {p1}, Landroid/net/Uri;->getAuthority()Ljava/lang/String;

    move-result-object v0

    const-string v1, "android"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {p1}, Landroid/net/Uri;->getPathSegments()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    const/4 v1, 0x3

    if-ne v0, v1, :cond_0

    invoke-virtual {p1}, Landroid/net/Uri;->getPathSegments()Ljava/util/List;

    move-result-object v0

    const/4 v1, 0x0

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    const-string v1, "next_alarm"

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {p1}, Landroid/net/Uri;->getPathSegments()Ljava/util/List;

    move-result-object v0

    const/4 v1, 0x1

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    iget-object v1, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mTracker:Lcom/android/server/notification/NextAlarmTracker;

    invoke-virtual {v1}, Lcom/android/server/notification/NextAlarmTracker;->getCurrentUserId()I

    move-result v1

    invoke-static {v1}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {p1}, Landroid/net/Uri;->getPathSegments()Ljava/util/List;

    move-result-object v0

    const/4 v1, 0x2

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-static {v0, v2, v3}, Lcom/android/server/notification/NextAlarmConditionProvider;->tryParseLong(Ljava/lang/String;J)J

    move-result-wide v0

    :goto_0
    return-wide v0

    :cond_0
    move-wide v0, v2

    goto :goto_0
.end method

# virtual methods
.method public asInterface()Landroid/service/notification/IConditionProvider;
    .locals 1

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

    invoke-virtual {p0, v0}, Lcom/android/server/notification/NextAlarmConditionProvider;->onBind(Landroid/content/Intent;)Landroid/os/IBinder;

    move-result-object v0

    check-cast v0, Landroid/service/notification/IConditionProvider;

    return-object v0
.end method

.method public attachBase(Landroid/content/Context;)V
    .locals 0
    .param p1, "base"    # Landroid/content/Context;

    .prologue
    .line 127
    invoke-virtual {p0, p1}, Lcom/android/server/notification/NextAlarmConditionProvider;->attachBaseContext(Landroid/content/Context;)V

    .line 128
    return-void
.end method

.method public dump(Ljava/io/PrintWriter;Lcom/android/server/notification/NotificationManagerService$DumpFilter;)V
    .locals 2
    .param p1, "pw"    # Ljava/io/PrintWriter;
    .param p2, "filter"    # Lcom/android/server/notification/NotificationManagerService$DumpFilter;

    .prologue
    .line 76
    const-string v0, "    NextAlarmConditionProvider:"

    invoke-virtual {p1, v0}, Ljava/io/PrintWriter;->println(Ljava/lang/String;)V

    .line 77
    const-string v0, "      mConnected="

    invoke-virtual {p1, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    iget-boolean v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mConnected:Z

    invoke-virtual {p1, v0}, Ljava/io/PrintWriter;->println(Z)V

    .line 78
    const-string v0, "      mLookaheadThreshold="

    invoke-virtual {p1, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    iget-wide v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mLookaheadThreshold:J

    invoke-virtual {p1, v0, v1}, Ljava/io/PrintWriter;->print(J)V

    .line 79
    const-string v0, " ("

    invoke-virtual {p1, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    iget-wide v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mLookaheadThreshold:J

    invoke-static {v0, v1, p1}, Landroid/util/TimeUtils;->formatDuration(JLjava/io/PrintWriter;)V

    const-string v0, ")"

    invoke-virtual {p1, v0}, Ljava/io/PrintWriter;->println(Ljava/lang/String;)V

    .line 80
    const-string v0, "      mSubscriptions="

    invoke-virtual {p1, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    iget-object v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mSubscriptions:Landroid/util/ArraySet;

    invoke-virtual {p1, v0}, Ljava/io/PrintWriter;->println(Ljava/lang/Object;)V

    .line 81
    const-string v0, "      mRequesting="

    invoke-virtual {p1, v0}, Ljava/io/PrintWriter;->print(Ljava/lang/String;)V

    iget-boolean v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mRequesting:Z

    invoke-virtual {p1, v0}, Ljava/io/PrintWriter;->println(Z)V

    .line 82
    return-void
.end method

.method public onConnected()V
    .locals 4

    .prologue
    .line 86
    sget-boolean v0, Lcom/android/server/notification/NextAlarmConditionProvider;->DEBUG:Z

    if-eqz v0, :cond_0

    const-string v0, "NextAlarmConditions"

    const-string v1, "onConnected"

    invoke-static {v0, v1}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 87
    :cond_0
    iget-object v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mContext:Landroid/content/Context;

    const-string v1, "nextalarm.condition.lookahead"

    const v2, 0x10e007d

    invoke-static {v0, v1, v2}, Lcom/android/server/notification/PropConfig;->getInt(Landroid/content/Context;Ljava/lang/String;I)I

    move-result v0

    int-to-long v0, v0

    const-wide/32 v2, 0x36ee80

    mul-long/2addr v0, v2

    iput-wide v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mLookaheadThreshold:J

    .line 89
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mConnected:Z

    .line 90
    iget-object v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mTracker:Lcom/android/server/notification/NextAlarmTracker;

    iget-object v1, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mTrackerCallback:Lcom/android/server/notification/NextAlarmTracker$Callback;

    invoke-virtual {v0, v1}, Lcom/android/server/notification/NextAlarmTracker;->addCallback(Lcom/android/server/notification/NextAlarmTracker$Callback;)V

    .line 91
    return-void
.end method

.method public onDestroy()V
    .locals 2

    .prologue
    .line 95
    invoke-super {p0}, Landroid/service/notification/ConditionProviderService;->onDestroy()V

    .line 96
    sget-boolean v0, Lcom/android/server/notification/NextAlarmConditionProvider;->DEBUG:Z

    if-eqz v0, :cond_0

    const-string v0, "NextAlarmConditions"

    const-string v1, "onDestroy"

    invoke-static {v0, v1}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 97
    :cond_0
    iget-object v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mTracker:Lcom/android/server/notification/NextAlarmTracker;

    iget-object v1, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mTrackerCallback:Lcom/android/server/notification/NextAlarmTracker$Callback;

    invoke-virtual {v0, v1}, Lcom/android/server/notification/NextAlarmTracker;->removeCallback(Lcom/android/server/notification/NextAlarmTracker$Callback;)V

    .line 98
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mConnected:Z

    .line 99
    return-void
.end method

.method public onRequestConditions(I)V
    .locals 3
    .param p1, "relevance"    # I

    .prologue
    .line 103
    sget-boolean v0, Lcom/android/server/notification/NextAlarmConditionProvider;->DEBUG:Z

    if-eqz v0, :cond_0

    const-string v0, "NextAlarmConditions"

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "onRequestConditions relevance="

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

    move-result-object v1

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

    move-result-object v1

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

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 104
    :cond_0
    iget-boolean v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mConnected:Z

    if-nez v0, :cond_1

    .line 107
    :goto_0
    return-void

    .line 105
    :cond_1
    and-int/lit8 v0, p1, 0x1

    if-eqz v0, :cond_2

    const/4 v0, 0x1

    :goto_1
    iput-boolean v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mRequesting:Z

    .line 106
    iget-object v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mTracker:Lcom/android/server/notification/NextAlarmTracker;

    invoke-virtual {v0}, Lcom/android/server/notification/NextAlarmTracker;->evaluate()V

    goto :goto_0

    .line 105
    :cond_2
    const/4 v0, 0x0

    goto :goto_1
.end method

.method public onSubscribe(Landroid/net/Uri;)V
    .locals 4
    .param p1, "conditionId"    # Landroid/net/Uri;

    .prologue
    .line 111
    sget-boolean v0, Lcom/android/server/notification/NextAlarmConditionProvider;->DEBUG:Z

    if-eqz v0, :cond_0

    const-string v0, "NextAlarmConditions"

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "onSubscribe "

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

    move-result-object v1

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

    move-result-object v1

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

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 112
    :cond_0
    invoke-direct {p0, p1}, Lcom/android/server/notification/NextAlarmConditionProvider;->tryParseNextAlarmCondition(Landroid/net/Uri;)J

    move-result-wide v0

    const-wide/16 v2, -0x1

    cmp-long v0, v0, v2

    if-nez v0, :cond_1

    .line 113
    const/4 v0, 0x0

    const/4 v1, 0x0

    const-string v2, "badCondition"

    invoke-direct {p0, p1, v0, v1, v2}, Lcom/android/server/notification/NextAlarmConditionProvider;->notifyCondition(Landroid/net/Uri;Landroid/app/AlarmManager$AlarmClockInfo;ILjava/lang/String;)V

    .line 118
    :goto_0
    return-void

    .line 116
    :cond_1
    iget-object v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mSubscriptions:Landroid/util/ArraySet;

    invoke-virtual {v0, p1}, Landroid/util/ArraySet;->add(Ljava/lang/Object;)Z

    .line 117
    iget-object v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mTracker:Lcom/android/server/notification/NextAlarmTracker;

    invoke-virtual {v0}, Lcom/android/server/notification/NextAlarmTracker;->evaluate()V

    goto :goto_0
.end method

.method public onUnsubscribe(Landroid/net/Uri;)V
    .locals 3
    .param p1, "conditionId"    # Landroid/net/Uri;

    .prologue
    .line 122
    sget-boolean v0, Lcom/android/server/notification/NextAlarmConditionProvider;->DEBUG:Z

    if-eqz v0, :cond_0

    const-string v0, "NextAlarmConditions"

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "onUnsubscribe "

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

    move-result-object v1

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

    move-result-object v1

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

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 123
    :cond_0
    iget-object v0, p0, Lcom/android/server/notification/NextAlarmConditionProvider;->mSubscriptions:Landroid/util/ArraySet;

    invoke-virtual {v0, p1}, Landroid/util/ArraySet;->remove(Ljava/lang/Object;)Z

    .line 124
    return-void
.end method


text:
import fetch from '@/utils/fetch'

export function listDiscoveryRequest() {

  return fetch({
    url: '/discovery/list',
    method: 'get'
  })
}

export function addDiscoveryRequest(data) {
  return fetch({
    url: '/discovery/add',
    method: 'post',
    data
  })
}

export function removeDiscoveryRequest(data) {
  return fetch({
    url: '/discovery/remove',
    method: 'post',
    data
  })
}

export function updateDiscoveryRequest(data) {
  return fetch({
    url: '/discovery/update',
    method: 'post',
    data
  })
}

redpajama_set_name: RedPajamaGithub


text:
"""Executable and reusable sample for retrieving information about a subject.

A subject can be an analyst or an Identity Provider (IdP) group.

API reference:
https://cloud.google.com/chronicle/docs/reference/rbac-api#getsubject
"""

import argparse
import json
import sys
from typing import Any, Mapping
from typing import Optional
from typing import Sequence

from google.auth.transport import requests

from common import chronicle_auth
from common import regions

CHRONICLE_API_BASE_URL = "https://backstory.googleapis.com"

def initialize_command_line_args(
    args: Optional[Sequence[str]] = None) -> Optional[argparse.Namespace]:
  """Initializes and checks all the command-line arguments."""
  parser = argparse.ArgumentParser()
  chronicle_auth.add_argument_credentials_file(parser)
  regions.add_argument_region(parser)
  parser.add_argument(
      "-n", "--name", type=str, required=True, help="subject ID")

  # No sanity checks for the command-line arguments here. The subject name
  # argument converts the provide input into a string and accepts a wide range
  # of values. If the subject name isn't passed in, the error will be thrown
  # from the argparse library.

  return parser.parse_args(args)

def get_subject(http_session: requests.AuthorizedSession,
                name: str) -> Mapping[str, Sequence[Any]]:
  """Retrieves information about a subject.

  Args:
    http_session: Authorized session for HTTP requests.
    name: The ID of the subject to retrieve information about.

  Returns:
    Information about the requested subject in the form:
    {
      "subject": {
        "name": "test@test.com",
        "type": "SUBJECT_TYPE_ANALYST",
        "roles": [
          {
            "name": "Test",
            "title": "Test role",
            "description": "The Test role",
            "createTime": "yyyy-mm-ddThh:mm:ss.ssssssZ",
            "isDefault": false,
            "permissions": [
              {
                "name": "Test",
                "title": "Test permission",
                "description": "The Test permission",
                "createTime": "yyyy-mm-ddThh:mm:ss.ssssssZ",
              },
              ...
            ]
          },
          ...
        ]
      }
    }

  Raises:
    requests.exceptions.HTTPError: HTTP request resulted in an error
      (response.status_code >= 400).
  """
  url = f"{CHRONICLE_API_BASE_URL}/v1/subjects/{name}"
  response = http_session.request("GET", url)

  if response.status_code >= 400:
    print(response.text)
  response.raise_for_status()
  return response.json()

if __name__ == "__main__":
  cli = initialize_command_line_args()
  if not cli:
    sys.exit(1)  # A sanity check failed.

  CHRONICLE_API_BASE_URL = regions.url(CHRONICLE_API_BASE_URL, cli.region)
  session = chronicle_auth.initialize_http_session(cli.credentials_file)
  print(json.dumps(get_subject(session, cli.name), indent=2))


text:
Secure Shared Store
Michael Schornak
Georgia Tech CS6238 Fall 2016

To Build:

	Unpack tarball, cd into it and

	make

Unit Tests:

	To run server: ./logserver.sh
	To run client: ./logclient.sh
	These will produce server.log and client.log.  At the end of client.log is printed the number of results seen which were not expected. (The number of true errors.)
	We expect this number to be zero.

To Run:

	Example invocations for user 1 and user 2 are contained in the scripts directory.


text:
<?xml version="1.0" encoding="UTF-8"?>
<workingSetManager>
<workingSet aggregate="true" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1417886876423_0" label="Window Working Set" name="Aggregate for window 1417886876422"/>
</workingSetManager>


text:
using Lykke.Service.EthereumCore.AzureRepositories;
using Common.Log;
using Lykke.Service.EthereumCore.Core;
using Lykke.Service.EthereumCore.Core.Repositories;
using Lykke.Service.EthereumCore.Core.Settings;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Nethereum.RPC.Eth.DTOs;
using Nethereum.Web3;
using Newtonsoft.Json;
using Lykke.Service.EthereumCore.Services;
using Lykke.Service.EthereumCore.Services.Coins.Models;
using Lykke.Service.EthereumCore.Services.New.Models;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Threading.Tasks;
using Lykke.Service.RabbitMQ;
using Lykke.SettingsReader;
using Autofac;
using Autofac.Extensions.DependencyInjection;
using EthereumSamuraiApiCaller;
using EthereumSamuraiApiCaller.Models;

namespace TransactionResubmit
{
    class Program
    {
        static IContainer ServiceProvider;
        static void Main(string[] args)
        {
            var settings = GetCurrentSettings();
            var log = new LogToConsole();
            ContainerBuilder builder = new ContainerBuilder();
            IServiceCollection collection = new Microsoft.Extensions.DependencyInjection.ServiceCollection();
            collection.AddSingleton<IBaseSettings>(settings.CurrentValue.EthereumCore);
            collection.AddSingleton<ISlackNotificationSettings>(settings.CurrentValue.SlackNotifications);
            collection.RegisterServices();
            RegisterReposExt.RegisterAzureStorages(builder, settings.Nested(x => x.EthereumCore), settings.Nested(x => x.SlackNotifications), log);
            RegisterReposExt.RegisterAzureQueues(builder, settings.Nested(x => x.EthereumCore.Db.DataConnString), settings.Nested(x => x.SlackNotifications));
            RegisterRabbitQueueEx.RegisterRabbitQueue(collection, settings.Nested(x => x.EthereumCore.RabbitMq),
                settings.Nested(x => x.EthereumCore.Db.DataConnString), log);
            RegisterDependency.RegisterServices(builder);
            builder.Populate(collection);
            ServiceProvider = builder.Build();
            ServiceProvider.ActivateRequestInterceptor();

            var web3 = ServiceProvider.Resolve<Web3>();

            try
            {
                var blockNumber = web3.Eth.Blocks.GetBlockNumber.SendRequestAsync().Result;
                Console.WriteLine($"RPC Works! {blockNumber.Value.ToString()}");
            }
            catch (Exception e)
            {
                Console.WriteLine($"Rpc does not work at all! {e.Message}");
            }
                Console.WriteLine($"Type 0 to exit");
            Console.WriteLine($"Type 1 to SHOW pending Transactions");
            Console.WriteLine($"Type 2 to REPEAT all operation without hash");
            Console.WriteLine($"Type 3 to CHECK pending operations");
            Console.WriteLine($"Type 4 to SCAN transfer contracts for issues");
            Console.WriteLine($"Type 5 to REASSIGN contracts");
            Console.WriteLine($"Type 6 to List all sucesful coin events");
            Console.WriteLine($"Type 7 to RESUBMIT all succesful coin events(except cashin)");
            Console.WriteLine($"Type 8 to RESUBMIT all cashin coin events");
            Console.WriteLine($"Type 9 to REMOVE DUPLICATE user transfer wallet locks");
            Console.WriteLine($"Type 10 to move from pending-poison to processing");
            Console.WriteLine($"Type 11 to PUT EVERYTHING IN PENDING WITH zero dequeue count");
            Console.WriteLine($"Type 20 to init starting point for lykkepay indexing");
            var command = "";

            do
            {
                command = Console.ReadLine();
                switch (command)
                {
                    case "1":
                        ShowPendingTransactionsAmount();
                        break;
                    case "2":
                        OperationResubmit();
                        break;
                    case "3":
                        OperationCheck();
                        break;
                    case "4":
                        GetAllFailedAssignments();
                        break;
                    case "5":
                        StartReassignment();
                        break;
                    case "6":
                        ListUnPublishedCoinEvents();
                        break;
                    case "7":
                        ResubmittUnPublishedCoinEventsWithMatches();
                        break;
                    case "8":
                        ResubmittUnPublishedCoinEventsCashinOnly();
                        break;
                    case "9":
                        RemoveDuplicateUserTransferWallets();
                        break;
                    case "10":
                        MoveFromPoisonToProcessing();
                        break;
                    case "11":
                        MoveFromPendingAndPoisonToProcessing();
                        break;
                    case "20":
                        InitIndexStartForLykkePay();
                        break;
                    default:
                        break;
                }
            }
            while (command != "0");

            Console.WriteLine("Exited");
        }

        private static void InitIndexStartForLykkePay()
        {
            try
            {
                Console.WriteLine("Are you sure?: Y/N");
                var input = Console.ReadLine();
                if (input.ToLower() != "y")
                {
                    Console.WriteLine("Cancel");
                    return;
                }
                Console.WriteLine("Started");

                var partition = "LykkePay_ERC20_HOTWALLET";
                var repo = ServiceProvider.Resolve<IBlockSyncedByHashRepository>();
                var contractService = ServiceProvider.Resolve<IContractService>();
                var indexerApi = ServiceProvider.Resolve<IEthereumSamuraiAPI>();
                var lastSyncedBlockNumber = repo.GetLastSyncedAsync(partition)?.Result;
                if (lastSyncedBlockNumber == null ||
                    !BigInteger.TryParse(lastSyncedBlockNumber.BlockNumber, out var lastSynced))
                {
                    Console.WriteLine("Creating starting point");
                    var currentBlock = contractService.GetCurrentBlock().Result - 50000;
                    var blockCurrent = indexerApi.ApiBlockNumberByBlockNumberGetAsync((long)currentBlock).Result as BlockResponse;
                    var previous = indexerApi.ApiBlockNumberByBlockNumberGetAsync((long)currentBlock - 1).Result as BlockResponse;
                    if (blockCurrent == null)
                        throw new Exception("Not yet indexed. Indexer issue");

                    repo.InsertAsync(new BlockSyncedByHash()
                    {
                        BlockNumber = previous.Number.ToString(),
                        BlockHash = previous.BlockHash,
                        Partition = partition
                    }).Wait();

                    repo.InsertAsync(new BlockSyncedByHash()
                    {
                        BlockNumber = blockCurrent.Number.ToString(),
                        BlockHash = blockCurrent.BlockHash,
                        Partition = partition
                    }).Wait();
                }
                else
                {
                    Console.WriteLine("Index already created");
                }

                Console.WriteLine("All Processed");
            }
            catch (Exception e)
            {
                Console.WriteLine("Error " + e.Message + " " + e.StackTrace);
            }
        }

        private static void MoveFromPendingAndPoisonToProcessing()
        {
            try
            {
                Console.WriteLine("Are you sure?: Y/N");
                var input = Console.ReadLine();
                if (input.ToLower() != "y")
                {
                    Console.WriteLine("Cancel");
                    return;
                }
                Console.WriteLine("Started");

                MoveToPendingOperationQueue(Constants.PendingOperationsQueue);

                Console.WriteLine("Pendin processed");
                Console.WriteLine("Waiting for poison");

                MoveToPendingOperationQueue(Constants.PendingOperationsQueue + "-poison");

                Console.WriteLine("All Processed");
            }
            catch (Exception e)
            {

            }
        }

        private static void MoveToPendingOperationQueue(string fromQueue)
        {
            var queueFactory = ServiceProvider.Resolve<IQueueFactory>();
            var queuePoison = queueFactory.Build(fromQueue);
            var queue = queueFactory.Build(Constants.PendingOperationsQueue);
            var count = queuePoison.Count().Result;
            for (int i = 0; i < count; i++)
            {
                var message = queuePoison.GetRawMessageAsync().Result;

                OperationHashMatchMessage newMessage = JsonConvert.DeserializeObject<OperationHashMatchMessage>(message.AsString);
                newMessage.DequeueCount = 0;
                queue.PutRawMessageAsync(message.AsString).Wait();
                queuePoison.FinishRawMessageAsync(message).Wait();
            }
        }

        private static void MoveFromPoisonToProcessing()
        {
            try
            {
                Console.WriteLine("Are you sure?: Y/N");
                var input = Console.ReadLine();
                if (input.ToLower() != "y")
                {
                    Console.WriteLine("Cancel");
                    return;
                }
                Console.WriteLine("Started");

                var queueFactory = ServiceProvider.Resolve<IQueueFactory>();
                var queuePoison = queueFactory.Build(Constants.PendingOperationsQueue + "-poison");
                var queue = queueFactory.Build(Constants.PendingOperationsQueue);
                var count = queuePoison.Count().Result;
                for (int i = 0; i < count; i++)
                {
                    var message = queuePoison.GetRawMessageAsync().Result;

                    OperationHashMatchMessage newMessage = JsonConvert.DeserializeObject<OperationHashMatchMessage>(message.AsString);

                    queue.PutRawMessageAsync(message.AsString).Wait();
                    queuePoison.FinishRawMessageAsync(message);
                }

                Console.WriteLine("All Processed");
            }
            catch (Exception e)
            {

            }
        }

        private static void ShowPendingTransactionsAmount()
        {
            var web3 = ServiceProvider.Resolve<Web3>();
            var block = web3.Eth.Blocks.GetBlockWithTransactionsByNumber.SendRequestAsync(BlockParameter.CreatePending()).Result;
            var transactionsCount = block.Transactions.Count();

            Console.WriteLine($"Transactions Count = {transactionsCount}");
        }

        private static void RemoveDuplicateUserTransferWallets()
        {
            try
            {
                Console.WriteLine("Are you sure?: Y/N");
                var input = Console.ReadLine();
                if (input.ToLower() != "y")
                {
                    Console.WriteLine("Cancel");
                    return;
                }
                Console.WriteLine("Started");

                var userTransferWalletRepository = ServiceProvider.Resolve<IUserTransferWalletRepository>();
                var userTransferWallets = userTransferWalletRepository.GetAllAsync().Result;

                foreach (var wallet in userTransferWallets)
                {
                    if (wallet.UserAddress != wallet.UserAddress.ToLower())
                    {
                        Console.WriteLine($"Deleting {wallet.UserAddress}");
                        userTransferWalletRepository.DeleteAsync(wallet.UserAddress, wallet.TransferContractAddress).Wait();
                    }
                }

                Console.WriteLine("All Processed");
            }
            catch (Exception e)
            {

            }
        }

        private static void ResubmittUnPublishedCoinEventsCashinOnly()
        {
            try
            {
                Console.WriteLine("Are you sure?: Y/N");
                var input = Console.ReadLine();
                if (input.ToLower() != "y")
                {
                    Console.WriteLine("Cancel");
                    return;
                }
                Console.WriteLine("Started");

                var queueFactory = ServiceProvider.Resolve<IQueueFactory>();
                var queue = queueFactory.Build(Constants.TransactionMonitoringQueue);
                var coinEventRepo = ServiceProvider.Resolve<ICoinEventRepository>();
                var trService = ServiceProvider.Resolve<IEthereumTransactionService>();
                var settings = ServiceProvider.Resolve<IBaseSettings>();
                var events = coinEventRepo.GetAll().Result.Where(x => !string.IsNullOrEmpty(x.OperationId) && x.CoinEventType == CoinEventType.CashinStarted).ToList();
                if (events != null)
                {
                    foreach (var @event in events)
                    {
                        if (@event != null && trService.IsTransactionExecuted(@event.TransactionHash, settings.GasForCoinTransaction).Result)
                        {
                            Console.WriteLine($"Unpublished transaction {@event.TransactionHash}");
                            queue.PutRawMessageAsync(Newtonsoft.Json.JsonConvert.SerializeObject(new CoinTransactionMessage()
                            {
                                TransactionHash = @event.TransactionHash,
                                OperationId = "",
                                LastError = "FROM_CONSOLE_CASHIN",
                                PutDateTime = DateTime.UtcNow })).Wait();
                        }
                    }
                }

                Console.WriteLine("All Processed");
            }
            catch (Exception e)
            {

            }
        }

        private static void ResubmittUnPublishedCoinEventsWithMatches()
        {
            try
            {
                Console.WriteLine("Are you sure?: Y/N");
                var input = Console.ReadLine();
                if (input.ToLower() != "y")
                {
                    Console.WriteLine("Cancel");
                    return;
                }
                Console.WriteLine("Started");

                var queueFactory = ServiceProvider.Resolve<IQueueFactory>();
                var queue = queueFactory.Build(Constants.TransactionMonitoringQueue);
                var coinEventRepo = ServiceProvider.Resolve<ICoinEventRepository>();
                var opRepo = ServiceProvider.Resolve<IOperationToHashMatchRepository>();
                var trService = ServiceProvider.Resolve<IEthereumTransactionService>();
                var events = coinEventRepo.GetAll().Result.Where(x => !string.IsNullOrEmpty(x.OperationId));
                var allCoinEvents = events.ToLookup(x => x.OperationId);
                var settings = ServiceProvider.Resolve<IBaseSettings>();
                opRepo.ProcessAllAsync((matches) =>
                {
                    foreach (var match in matches)
                    {
                        if (string.IsNullOrEmpty(match.TransactionHash) || !trService.IsTransactionExecuted(match.TransactionHash, settings.GasForCoinTransaction).Result)
                        {
                            var coinEvents = allCoinEvents[match.OperationId]?.OrderByDescending(x => x.EventTime);
                            if (coinEvents != null)
                            {
                                foreach (var @event in coinEvents)
                                {
                                    if (@event != null && trService.IsTransactionExecuted(@event.TransactionHash, settings.GasForCoinTransaction).Result)
                                    {
                                        Console.WriteLine($"Unpublished transaction {@event.TransactionHash}");
                                        queue.PutRawMessageAsync(Newtonsoft.Json.JsonConvert.SerializeObject(new CoinTransactionMessage() { TransactionHash = @event.TransactionHash, OperationId = match.OperationId, LastError = "FROM_CONSOLE", PutDateTime = DateTime.UtcNow })).Wait();
                                        break;
                                    }
                                }
                            }
                        }
                    }

                    return Task.FromResult(0);
                }).Wait();

                Console.WriteLine("All Processed");
            }
            catch (Exception e)
            {

            }
        }

        private static void ListUnPublishedCoinEvents()
        {
            try
            {
                List<string> allUnpublishedEvents = new List<string>();
                var coinEventRepo = ServiceProvider.Resolve<ICoinEventRepository>();
                var opRepo = ServiceProvider.Resolve<IOperationToHashMatchRepository>();
                var trService = ServiceProvider.Resolve<IEthereumTransactionService>();
                var events = coinEventRepo.GetAll().Result.Where(x => !string.IsNullOrEmpty(x.OperationId));
                var allCoinEvents = events.ToLookup(x => x.OperationId);
                var settings = ServiceProvider.Resolve<IBaseSettings>();
                opRepo.ProcessAllAsync((matches) =>
                {
                    foreach (var match in matches)
                    {
                        if (string.IsNullOrEmpty(match.TransactionHash) || !trService.IsTransactionExecuted(match.TransactionHash, settings.GasForCoinTransaction).Result)
                        {
                            var coinEvents = allCoinEvents[match.OperationId]?.OrderByDescending(x => x.EventTime);
                            if (coinEvents != null)
                            {
                                foreach (var @event in coinEvents)
                                {
                                    if (@event != null && trService.IsTransactionExecuted(@event.TransactionHash, settings.GasForCoinTransaction).Result)
                                    {
                                        Console.WriteLine($"Unpublished transaction {@event.TransactionHash}");
                                        allUnpublishedEvents.Add(@event.TransactionHash);
                                        break;
                                    }
                                }
                            }

                        }
                    }

                    return Task.FromResult(0);
                }).Wait();

                Console.WriteLine("All has been processed");
                File.WriteAllText("listUnPublishedCoinEvents.txt", Newtonsoft.Json.JsonConvert.SerializeObject(allUnpublishedEvents));
            }
            catch (Exception e)
            {

            }
        }

        private static void StartReassignment()
        {
            try
            {
                Console.WriteLine("Are you sure?: Y/N");
                var input = Console.ReadLine();
                if (input.ToLower() != "y")
                {
                    Console.WriteLine("Cancel Reassignment");
                    return;
                }
                Console.WriteLine("Reassignment started");

                List<string> allTransferContracts = new List<string>();
                var trService = ServiceProvider.Resolve<IEthereumTransactionService>();
                var transferRepo = ServiceProvider.Resolve<ITransferContractRepository>();
                var assignmentService = ServiceProvider.Resolve<ITransferContractUserAssignmentQueueService>();
                var transferContractService = ServiceProvider.Resolve<ITransferContractService>();

                transferRepo.ProcessAllAsync((contract) =>
                {
                    var currentUser = transferContractService.GetTransferAddressUser(contract.CoinAdapterAddress, contract.ContractAddress).Result;
                    if (string.IsNullOrEmpty(currentUser) || currentUser == Constants.EmptyEthereumAddress)
                    {
                        assignmentService.PushContract(new TransferContractUserAssignment()
                        {
                            CoinAdapterAddress = contract.CoinAdapterAddress,
                            TransferContractAddress = contract.ContractAddress,
                            UserAddress = contract.UserAddress,
                            PutDateTime = DateTime.UtcNow
                        });
                        Console.WriteLine($"Reassign - {contract.ContractAddress} - -_-");
                        allTransferContracts.Add(contract.ContractAddress);
                    };

                    return Task.FromResult(0);
                }).Wait();

                File.WriteAllText("report.txt", Newtonsoft.Json.JsonConvert.SerializeObject(allTransferContracts));
                Console.WriteLine("Reassignment completed");
            }
            catch (Exception e)
            {
                Console.WriteLine($"Error during check: {e.Message} - {e.StackTrace}");
            }
        }

        private static void GetAllFailedAssignments()
        {
            try
            {
                List<string> allTransferContracts = new List<string>();
                var trService = ServiceProvider.Resolve<IEthereumTransactionService>();
                var transferRepo = ServiceProvider.Resolve<ITransferContractRepository>();
                var transferContractService = ServiceProvider.Resolve<ITransferContractService>();
                transferRepo.ProcessAllAsync((contract) =>
                {
                    var currentUser = transferContractService.GetTransferAddressUser(contract.CoinAdapterAddress, contract.ContractAddress).Result;
                    if (string.IsNullOrEmpty(currentUser) || currentUser == Constants.EmptyEthereumAddress)
                    {
                        Console.WriteLine($"Broken - {contract.ContractAddress} - X_X");
                        allTransferContracts.Add(contract.ContractAddress);
                    }

                    return Task.FromResult(0);
                }).Wait();

                File.WriteAllText("report.txt", Newtonsoft.Json.JsonConvert.SerializeObject(allTransferContracts));

            }
            catch (Exception e)
            {
                Console.WriteLine($"Error during check: {e.Message} - {e.StackTrace}");
            }
        }

        private static void TransactionResubmitTransaction()
        {
            try
            {
                var pendingOperationService = ServiceProvider.Resolve<IPendingOperationService>();
                ResubmitModel resubmitModel;
                Console.WriteLine("ResubmittingStarted");
                using (var streamRead = File.OpenRead(Path.Combine(Directory.GetCurrentDirectory(), "TransactionsForResubmit.json")))
                using (var stream = new StreamReader(streamRead))
                {
                    string content = stream.ReadToEnd();
                    resubmitModel = Newtonsoft.Json.JsonConvert.DeserializeObject<ResubmitModel>(content);
                }

                foreach (var item in resubmitModel.Transactions)
                {
                    var amount = (BigInteger.Parse(item.Amount) + 1);
                    Console.WriteLine($"Amount updated to {amount.ToString()}");
                    Console.WriteLine($"Performing {item.OperationType}");
                    switch (item.OperationType)
                    {
                        case OperationTypes.Cashout:
                            pendingOperationService.CashOut(item.Id, item.CoinAdapterAddress, item.FromAddress, item.ToAddress, amount, item.SignFrom ?? "").Wait();
                            break;
                        case OperationTypes.Transfer:
                            pendingOperationService.Transfer(item.Id, item.CoinAdapterAddress, item.FromAddress, item.ToAddress, amount, item.SignFrom ?? "").Wait();
                            break;
                        case OperationTypes.TransferWithChange:
                            var change = BigInteger.Parse(item.Change);
                            pendingOperationService.TransferWithChange(item.Id, item.CoinAdapterAddress, item.FromAddress, item.ToAddress, amount, item.SignFrom ?? "", change, item.SignTo ?? "").Wait();
                            break;
                        default:
                            throw new Exception("Specify operation Type");

                    }
                    Console.WriteLine("Operation resubmitted");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine($"{e.Message}, {e.StackTrace}");
            }
            Console.WriteLine();
        }

        private static void HashResubmit()
        {
            var queueFactory = ServiceProvider.Resolve<IQueueFactory>();
            var queue = queueFactory.Build(Constants.TransactionMonitoringQueue);
            RabbitList resubmitModel;
            using (var streamRead = File.OpenRead(Path.Combine(Directory.GetCurrentDirectory(), "HashForResubmit.json")))
            using (var stream = new StreamReader(streamRead))
            {
                string content = stream.ReadToEnd();
                resubmitModel = Newtonsoft.Json.JsonConvert.DeserializeObject<RabbitList>(content);
            }

            Console.WriteLine("ResubmittingStarted");
            resubmitModel.Transactions.ForEach(tr =>
            {
                queue.PutRawMessageAsync(Newtonsoft.Json.JsonConvert.SerializeObject(new CoinTransactionMessage() { TransactionHash = tr.TransactionHash, PutDateTime = DateTime.UtcNow })).Wait();
            });
        }

        private static void OperationCheck()
        {
            try
            {
                var list = new List<string>();
                Console.WriteLine("CheckingOperation");
                IEthereumTransactionService coinTransactionService = ServiceProvider.Resolve<IEthereumTransactionService>();
                var operationToHashMatchRepository = ServiceProvider.Resolve<IOperationToHashMatchRepository>();
                var settings = ServiceProvider.Resolve<IBaseSettings>();
                operationToHashMatchRepository.ProcessAllAsync((items) =>
                {
                    foreach (var item in items)
                    {
                        if (string.IsNullOrEmpty(item.TransactionHash) || !coinTransactionService.IsTransactionExecuted(item.TransactionHash, settings.GasForCoinTransaction).Result)
                        {
                            Console.WriteLine($"Operation is dead {item.OperationId}");
                            list.Add(item.OperationId);
                        }
                    }
                    return Task.FromResult(0);
                }).Wait();

                File.WriteAllText("reportOperations.txt", Newtonsoft.Json.JsonConvert.SerializeObject(list));
                Console.WriteLine("Report completed");
            }
            catch (Exception e)
            {
                Console.WriteLine($"{e.Message}, {e.StackTrace}");
            }
            Console.WriteLine();
        }

        private static void OperationResubmit()
        {
            try
            {
                Console.WriteLine("Are you sure?: Y/N");
                var input = Console.ReadLine();
                if (input.ToLower() != "y")
                {
                    Console.WriteLine("Cancel Resubmit");
                    return;
                }

                var queueFactory = ServiceProvider.Resolve<IQueueFactory>();
                IEthereumTransactionService coinTransactionService = ServiceProvider.Resolve<IEthereumTransactionService>();
                var queue = queueFactory.Build(Constants.PendingOperationsQueue);
                var operationToHashMatchRepository = ServiceProvider.Resolve<IOperationToHashMatchRepository>();
                var settings = ServiceProvider.Resolve<IBaseSettings>();
                operationToHashMatchRepository.ProcessAllAsync((items) =>
                {
                    foreach (var item in items)
                    {
                        if (string.IsNullOrEmpty(item.TransactionHash) || !coinTransactionService.IsTransactionExecuted(item.TransactionHash, settings.GasForCoinTransaction).Result)
                        {
                            Console.WriteLine($"Resubmitting {item.OperationId}");
                            queue.PutRawMessageAsync(Newtonsoft.Json.JsonConvert.SerializeObject(new OperationHashMatchMessage() { OperationId = item.OperationId })).Wait();
                        }
                    }
                    return Task.FromResult(0);
                }).Wait();

                Console.WriteLine("Resubmitted");
            }
            catch (Exception e)
            {
                Console.WriteLine($"{e.Message}, {e.StackTrace}");
            }
            Console.WriteLine();
        }

        static IReloadingManager<AppSettings> GetCurrentSettings()
        {
            FileInfo fi = new FileInfo(System.Reflection.Assembly.GetEntryAssembly().Location);
            var location = Path.Combine(fi.DirectoryName, "..", "..", "..");
            var builder = new ConfigurationBuilder()
                .SetBasePath(location)
                .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                .AddEnvironmentVariables();
            var configuration = builder.Build();
            var settings = configuration.LoadSettings<AppSettings>();

            return settings;
        }

    }
}


text:
//
//  BFBranchTransportView.h
//  OpenShop
//
//  Created by Jirka Apps
//  Copyright (c) 2015 Business Factory. All rights reserved.
//

@import UIKit;
#import "BFAppStructure.h"
#import "BFDimControl.h"

NS_ASSUME_NONNULL_BEGIN

/**
 * `BFBranchTransportView` represents shop branch transport option.
 */
IB_DESIGNABLE
@interface BFBranchTransportView : UIView

/**
 * The transport option index.
 */
@property (nonatomic, assign) IBInspectable NSInteger transportIndex;
/**
 * The transport option icon.
 */
@property (nonatomic, weak) IBOutlet UIImageView *icon;
/**
 * The transport option description.
 */
@property (nonatomic, weak) IBOutlet UILabel *descriptionLabel;

/**
 * Sets transport option visibility.
 *
 * @param visible The option visibility.
 */
- (void)setVisibility:(BOOL)visible;
/**
 * Transport option view did load from nib.
 */
- (void)didLoad;

@end

NS_ASSUME_NONNULL_END


text:
import { TOUR_INIT } from 'shared/actions/tour';
import { execSetTour } from 'shared/actions/execute';

export default store => next => action => {
  const nextAction = next(action);
  if (action.type === TOUR_INIT) {
    const { imp, tour } = store.getState();

    if (typeof imp.solution === 'function') {
      store.dispatch(execSetTour(imp.solution(tour.moves[0])));
    }
  }
  return nextAction;
};


text:
package pl.aszczepanski.aulos;

import java.util.ArrayList;

/**
 * Created by aszczepanski on 04.04.2017.
 */

public class PagingObject<T> {
    private ArrayList<T> items = new ArrayList<>();
    private String next;
    private int limit;
    private int total;

    public ArrayList<T> getItems() {
        return items;
    }

    public String getNext() {
        return next;
    }

    public int getTotal() {
        return total;
    }

    public int getLimit() {
        return limit;
    }
}


text:
package com.github.gserv.serv.wx.service;

import javax.annotation.Resource;

import com.github.gserv.serv.wx.service.manager.WxServiceManager;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.github.gserv.serv.wx.support.WxApiInvorkException;
import com.github.gserv.serv.wx.support.api.jssdk.WxApiJsTicketService;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "/com/github/gserv/serv/wx/applicationContext-wx-server-single.xml")
public class TestWxApiJsTicketService {

//	@Resource
	private WxApiJsTicketService wxApiJsTicketService;

	@Resource
	private WxServiceManager wxServiceManager;

	@Test
	public void test() throws WxApiInvorkException {
		wxApiJsTicketService = wxServiceManager.getWxService(WxApiJsTicketService.class);
		System.out.println(wxApiJsTicketService.jsTicket());
		System.out.println(wxApiJsTicketService.jsTicket());
	}

}


text:
using CommandLine;

namespace TeamCityConsole.Options
{
    [Verb(Verbs.DeleteClonedBuildChain, HelpText = "Deletes cloned build chain.")]
    public class DeleteClonedBuildChainOptions
    {
        [Option('c', "BuildConfigId", Required = true, HelpText = "Configuration Id.")]
        public string BuildConfigId { get; set; }

        [Option('s', "Simulate", Required = false, HelpText = "Simulate the delete function.")]
        public bool Simulate { get; set; }
    }
}


text:
package io.seata.sqlparser.struct;

/**
 * The sequence able.
 *
 * @author jsbxyyx
 */
public interface Sequenceable {

    /**
     * get sequence sql.
     *
     * @param expr the expr
     * @return sequence sql
     */
    String getSequenceSql(SqlSequenceExpr expr);

}


text:
using System.Runtime.CompilerServices;

namespace System.Html.Media.Graphics.SVG {
	[IgnoreNamespace, Imported(ObeysTypeSystem = true)]
	public partial class SVGFETurbulenceElement : SVGElement {
		internal SVGFETurbulenceElement() {
		}

		public void AddEventListener(string type, HtmlEventHandlerWithTarget<SVGFETurbulenceElement> listener) {
		}

		public void AddEventListener(string type, HtmlEventHandlerWithTarget<SVGFETurbulenceElement> listener, bool capture) {
		}

		public void AddEventListener(SVGFETurbulenceElementEvents type, Action listener) {
		}

		public void AddEventListener(SVGFETurbulenceElementEvents type, Action listener, bool capture) {
		}

		public void AddEventListener(SVGFETurbulenceElementEvents type, HtmlEventHandler listener) {
		}

		public void AddEventListener(SVGFETurbulenceElementEvents type, HtmlEventHandler listener, bool capture) {
		}

		public void AddEventListener(SVGFETurbulenceElementEvents type, HtmlEventHandlerWithTarget<SVGFETurbulenceElement> listener) {
		}

		public void AddEventListener(SVGFETurbulenceElementEvents type, HtmlEventHandlerWithTarget<SVGFETurbulenceElement> listener, bool capture) {
		}

		public void AddEventListener(SVGFETurbulenceElementEvents type, IEventListener listener) {
		}

		public void AddEventListener(SVGFETurbulenceElementEvents type, IEventListener listener, bool capture) {
		}

		[IntrinsicProperty]
		public SVGAnimatedNumber BaseFrequencyX {
			get {
				return default(SVGAnimatedNumber);
			}
		}

		[IntrinsicProperty]
		public SVGAnimatedNumber BaseFrequencyY {
			get {
				return default(SVGAnimatedNumber);
			}
		}

		[IntrinsicProperty]
		public SVGAnimatedLength Height {
			get {
				return default(SVGAnimatedLength);
			}
		}

		[IntrinsicProperty]
		public SVGAnimatedInteger NumOctaves {
			get {
				return default(SVGAnimatedInteger);
			}
		}

		public void RemoveEventListener(string type, HtmlEventHandlerWithTarget<SVGFETurbulenceElement> listener) {
		}

		public void RemoveEventListener(string type, HtmlEventHandlerWithTarget<SVGFETurbulenceElement> listener, bool capture) {
		}

		public void RemoveEventListener(SVGFETurbulenceElementEvents type, Action listener) {
		}

		public void RemoveEventListener(SVGFETurbulenceElementEvents type, Action listener, bool capture) {
		}

		public void RemoveEventListener(SVGFETurbulenceElementEvents type, HtmlEventHandler listener) {
		}

		public void RemoveEventListener(SVGFETurbulenceElementEvents type, HtmlEventHandler listener, bool capture) {
		}

		public void RemoveEventListener(SVGFETurbulenceElementEvents type, HtmlEventHandlerWithTarget<SVGFETurbulenceElement> listener) {
		}

		public void RemoveEventListener(SVGFETurbulenceElementEvents type, HtmlEventHandlerWithTarget<SVGFETurbulenceElement> listener, bool capture) {
		}

		public void RemoveEventListener(SVGFETurbulenceElementEvents type, IEventListener listener) {
		}

		public void RemoveEventListener(SVGFETurbulenceElementEvents type, IEventListener listener, bool capture) {
		}

		[IntrinsicProperty]
		public SVGAnimatedString Result {
			get {
				return default(SVGAnimatedString);
			}
		}

		[IntrinsicProperty]
		public SVGAnimatedNumber Seed {
			get {
				return default(SVGAnimatedNumber);
			}
		}

		[IntrinsicProperty]
		public SVGAnimatedEnumeration<SVGFEStitchType> StitchTiles {
			get {
				return default(SVGAnimatedEnumeration<SVGFEStitchType>);
			}
		}

		[ScriptName("SVG_STITCHTYPE_NOSTITCH")]
		public const ushort SVG_STITCHTYPE_NOSTITCH = 2;

		[ScriptName("SVG_STITCHTYPE_STITCH")]
		public const ushort SVG_STITCHTYPE_STITCH = 1;

		[ScriptName("SVG_STITCHTYPE_UNKNOWN")]
		public const ushort SVG_STITCHTYPE_UNKNOWN = 0;

		[ScriptName("SVG_TURBULENCE_TYPE_FRACTALNOISE")]
		public const ushort SVG_TURBULENCE_TYPE_FRACTALNOISE = 1;

		[ScriptName("SVG_TURBULENCE_TYPE_TURBULENCE")]
		public const ushort SVG_TURBULENCE_TYPE_TURBULENCE = 2;

		[ScriptName("SVG_TURBULENCE_TYPE_UNKNOWN")]
		public const ushort SVG_TURBULENCE_TYPE_UNKNOWN = 0;

		[IntrinsicProperty]
		public SVGAnimatedEnumeration<SVGFETurbulenceType> Type {
			get {
				return default(SVGAnimatedEnumeration<SVGFETurbulenceType>);
			}
		}

		[IntrinsicProperty]
		public SVGAnimatedLength Width {
			get {
				return default(SVGAnimatedLength);
			}
		}

		[IntrinsicProperty]
		public SVGAnimatedLength X {
			get {
				return default(SVGAnimatedLength);
			}
		}

		[IntrinsicProperty]
		public SVGAnimatedLength Y {
			get {
				return default(SVGAnimatedLength);
			}
		}
	}
}


text:
require 'csv'
require 'roo'
require_relative './job'
require_relative './csv_normalizer'

module CartoDB
  module Importer2
    class Excel2Csv
      def self.supported?(extension)
        extension == ".#{@format}"
      end #self.supported?

      def initialize(supported_format, filepath, job=nil)
        @format = "#{supported_format.downcase}"
        @filepath = filepath
        @job      = job || Job.new
      end #initialize

      def run
        job.log "Converting #{@format.upcase} to CSV"
        spreadsheet = Roo::Spreadsheet.open(filepath)

        spreadsheet = remove_newlines(spreadsheet)

        # Can be check locally using wc -l ... (converted_filepath)
        job.log "Orig file: #{filepath}\nTemp destination: #{converted_filepath}"
        spreadsheet.to_csv(converted_filepath)
        normalizer = CsvNormalizer.new(converted_filepath, job)
        # Roo gem is not exporting always correctly when source Excel has atypical UTF-8 characters
        normalizer.force_normalize
        normalizer.run
        self
      end #run

      def converted_filepath
        File.join(
          File.dirname(filepath),
          File.basename(filepath, File.extname(filepath))
        ) + '.csv'
      end #converted_filepath

      protected

      def remove_newlines(spreadsheet)
        job.log 'Removing newlines...'
        spreadsheet.default_sheet = spreadsheet.sheets.first
        job.log 'Processing first sheet'

        job.log 'Calculating columns (this can take long as will scan the full document)'
        col_count = spreadsheet.sheet(0).last_column
        job.log 'Calculating rows'
        row_count = spreadsheet.sheet(0).last_row

        for row_index in 1..row_count
          for col_index in 1..col_count
            if spreadsheet.celltype(row_index, col_index) == :string
              current_value = spreadsheet.cell(row_index,col_index)
              # As we are going to export to CSV, remove newlines or will cause problems (even being quoted)
              if current_value.index("\n") != nil
                spreadsheet.set(row_index, col_index, current_value.gsub("\n",''))
              end
            end
          end
        end

        job.log 'Newlines removed'
        spreadsheet
      rescue NoMethodError
        raise XLSXFormatError
      end #remove_newlines

      attr_reader :filepath, :job
    end #Excel2Csv
  end # Importer2
end # CartoDB


text:
/****************************************************************************
 * Included Files
 ****************************************************************************/

#include <nuttx/config.h>

#include <sys/types.h>
#include <debug.h>

#include <nuttx/arch.h>
#include <nuttx/board.h>
#include <arch/board/board.h>

#include "up_arch.h"
#include "up_internal.h"

/****************************************************************************
 * Private Definitions
 ****************************************************************************/

/****************************************************************************
 * Private Data
 ****************************************************************************/

/****************************************************************************
 * Private Functions
 ****************************************************************************/

/****************************************************************************
 * Public Functions
 ****************************************************************************/

/****************************************************************************
 * Name: up_allocate_heap
 *
 * Description:
 *   This function will be called to dynamically set aside the heap region.
 *
 *   For the kernel build (CONFIG_BUILD_KERNEL=y) with both kernel- and
 *   user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the
 *   size of the unprotected, user-space heap.
 *
 *   If a protected kernel-space heap is provided, the kernel heap must be
 *   allocated (and protected) by an analogous up_allocate_kheap().
 *
 ****************************************************************************/

void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
{
  board_led_on(LED_HEAPALLOCATE);
  *heap_start = (FAR void*)g_idle_topstack;
  *heap_size = CONFIG_RAM_END - g_idle_topstack;
}