text:
.class public final Landroid/util/Log;
.super Ljava/lang/Object;
.source "Log.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/util/Log$1;,
        Landroid/util/Log$ImmediateLogWriter;,
        Landroid/util/Log$NoPreloadHolder;,
        Landroid/util/Log$TerribleFailure;,
        Landroid/util/Log$TerribleFailureHandler;
    }
.end annotation

# static fields
.field public static final ASSERT:I = 0x7

.field public static final DEBUG:I = 0x3

.field public static final ERROR:I = 0x6

.field public static final INFO:I = 0x4

.field public static final LOG_ID_CRASH:I = 0x4

.field public static final LOG_ID_EVENTS:I = 0x2

.field public static final LOG_ID_MAIN:I = 0x0

.field public static final LOG_ID_RADIO:I = 0x1

.field public static final LOG_ID_SYSTEM:I = 0x3

.field public static final VERBOSE:I = 0x2

.field public static final WARN:I = 0x5

.field private static sWtfHandler:Landroid/util/Log$TerribleFailureHandler;

# direct methods
.method static synthetic -wrap0()I
    .locals 1

    invoke-static {}, Landroid/util/Log;->logger_entry_max_payload_native()I

    move-result v0

    return v0
.end method

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

    new-instance v0, Landroid/util/Log$1;

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

    sput-object v0, Landroid/util/Log;->sWtfHandler:Landroid/util/Log$TerribleFailureHandler;

    return-void
.end method

.method private constructor <init>()V
    .locals 0

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

    return-void
.end method

.method public static d(Ljava/lang/String;Ljava/lang/String;)I
    .locals 2

    const/4 v0, 0x0

    const/4 v1, 0x3

    invoke-static {v0, v1, p0, p1}, Landroid/util/Log;->println_native(IILjava/lang/String;Ljava/lang/String;)I

    move-result v0

    return v0
.end method

.method public static d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 2

    const/4 v0, 0x0

    const/4 v1, 0x3

    invoke-static {v0, v1, p0, p1, p2}, Landroid/util/Log;->printlns(IILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    move-result v0

    return v0
.end method

.method public static e(Ljava/lang/String;Ljava/lang/String;)I
    .locals 2

    const/4 v0, 0x0

    const/4 v1, 0x6

    invoke-static {v0, v1, p0, p1}, Landroid/util/Log;->println_native(IILjava/lang/String;Ljava/lang/String;)I

    move-result v0

    return v0
.end method

.method public static e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 2

    const/4 v0, 0x0

    const/4 v1, 0x6

    invoke-static {v0, v1, p0, p1, p2}, Landroid/util/Log;->printlns(IILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    move-result v0

    return v0
.end method

.method public static getStackTraceString(Ljava/lang/Throwable;)Ljava/lang/String;
    .locals 5

    if-nez p0, :cond_0

    const-string/jumbo v3, ""

    return-object v3

    :cond_0
    move-object v2, p0

    :goto_0
    if-eqz v2, :cond_2

    instance-of v3, v2, Ljava/net/UnknownHostException;

    if-eqz v3, :cond_1

    const-string/jumbo v3, ""

    return-object v3

    :cond_1
    invoke-virtual {v2}, Ljava/lang/Throwable;->getCause()Ljava/lang/Throwable;

    move-result-object v2

    goto :goto_0

    :cond_2
    new-instance v1, Ljava/io/StringWriter;

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

    new-instance v0, Lcom/android/internal/util/FastPrintWriter;

    const/4 v3, 0x0

    const/16 v4, 0x100

    invoke-direct {v0, v1, v3, v4}, Lcom/android/internal/util/FastPrintWriter;-><init>(Ljava/io/Writer;ZI)V

    invoke-virtual {p0, v0}, Ljava/lang/Throwable;->printStackTrace(Ljava/io/PrintWriter;)V

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

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

    move-result-object v3

    return-object v3
.end method

.method public static i(Ljava/lang/String;Ljava/lang/String;)I
    .locals 2

    const/4 v0, 0x0

    const/4 v1, 0x4

    invoke-static {v0, v1, p0, p1}, Landroid/util/Log;->println_native(IILjava/lang/String;Ljava/lang/String;)I

    move-result v0

    return v0
.end method

.method public static i(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 2

    const/4 v0, 0x0

    const/4 v1, 0x4

    invoke-static {v0, v1, p0, p1, p2}, Landroid/util/Log;->printlns(IILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    move-result v0

    return v0
.end method

.method public static native isLoggable(Ljava/lang/String;I)Z
.end method

.method private static native logger_entry_max_payload_native()I
.end method

.method public static println(ILjava/lang/String;Ljava/lang/String;)I
    .locals 1

    const/4 v0, 0x0

    invoke-static {v0, p0, p1, p2}, Landroid/util/Log;->println_native(IILjava/lang/String;Ljava/lang/String;)I

    move-result v0

    return v0
.end method

.method public static native println_native(IILjava/lang/String;Ljava/lang/String;)I
.end method

.method public static printlns(IILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 6

    new-instance v2, Landroid/util/Log$ImmediateLogWriter;

    invoke-direct {v2, p0, p1, p2}, Landroid/util/Log$ImmediateLogWriter;-><init>(IILjava/lang/String;)V

    sget v4, Landroid/util/Log$NoPreloadHolder;->LOGGER_ENTRY_MAX_PAYLOAD:I

    add-int/lit8 v5, v4, -0x2

    if-eqz p2, :cond_2

    invoke-virtual {p2}, Ljava/lang/String;->length()I

    move-result v4

    :goto_0
    sub-int v4, v5, v4

    add-int/lit8 v0, v4, -0x20

    const/16 v4, 0x64

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

    move-result v0

    new-instance v1, Lcom/android/internal/util/LineBreakBufferedWriter;

    invoke-direct {v1, v2, v0}, Lcom/android/internal/util/LineBreakBufferedWriter;-><init>(Ljava/io/Writer;I)V

    invoke-virtual {v1, p3}, Lcom/android/internal/util/LineBreakBufferedWriter;->println(Ljava/lang/String;)V

    if-eqz p4, :cond_1

    move-object v3, p4

    :goto_1
    if-eqz v3, :cond_0

    instance-of v4, v3, Ljava/net/UnknownHostException;

    if-eqz v4, :cond_3

    :cond_0
    :goto_2
    if-nez v3, :cond_1

    invoke-virtual {p4, v1}, Ljava/lang/Throwable;->printStackTrace(Ljava/io/PrintWriter;)V

    :cond_1
    invoke-virtual {v1}, Lcom/android/internal/util/LineBreakBufferedWriter;->flush()V

    invoke-virtual {v2}, Landroid/util/Log$ImmediateLogWriter;->getWritten()I

    move-result v4

    return v4

    :cond_2
    const/4 v4, 0x0

    goto :goto_0

    :cond_3
    instance-of v4, v3, Landroid/os/DeadSystemException;

    if-eqz v4, :cond_4

    const-string/jumbo v4, "DeadSystemException: The system died; earlier logs will point to the root cause"

    invoke-virtual {v1, v4}, Lcom/android/internal/util/LineBreakBufferedWriter;->println(Ljava/lang/String;)V

    goto :goto_2

    :cond_4
    invoke-virtual {v3}, Ljava/lang/Throwable;->getCause()Ljava/lang/Throwable;

    move-result-object v3

    goto :goto_1
.end method

.method public static secD(Ljava/lang/String;Ljava/lang/String;)I
    .locals 1

    sget-boolean v0, Landroid/util/secutil/LogSwitcher;->isShowingSecDLog:Z

    if-eqz v0, :cond_0

    invoke-static {p0, p1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    move-result v0

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public static secD(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 1

    sget-boolean v0, Landroid/util/secutil/LogSwitcher;->isShowingSecDLog:Z

    if-eqz v0, :cond_0

    invoke-static {p0, p1, p2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    move-result v0

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public static secE(Ljava/lang/String;Ljava/lang/String;)I
    .locals 1

    sget-boolean v0, Landroid/util/secutil/LogSwitcher;->isShowingSecELog:Z

    if-eqz v0, :cond_0

    invoke-static {p0, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    move-result v0

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public static secE(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 1

    sget-boolean v0, Landroid/util/secutil/LogSwitcher;->isShowingSecELog:Z

    if-eqz v0, :cond_0

    invoke-static {p0, p1, p2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    move-result v0

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public static secI(Ljava/lang/String;Ljava/lang/String;)I
    .locals 1

    sget-boolean v0, Landroid/util/secutil/LogSwitcher;->isShowingSecILog:Z

    if-eqz v0, :cond_0

    invoke-static {p0, p1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    move-result v0

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public static secI(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 1

    sget-boolean v0, Landroid/util/secutil/LogSwitcher;->isShowingSecILog:Z

    if-eqz v0, :cond_0

    invoke-static {p0, p1, p2}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    move-result v0

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public static secV(Ljava/lang/String;Ljava/lang/String;)I
    .locals 1

    sget-boolean v0, Landroid/util/secutil/LogSwitcher;->isShowingSecVLog:Z

    if-eqz v0, :cond_0

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

    move-result v0

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public static secV(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 1

    sget-boolean v0, Landroid/util/secutil/LogSwitcher;->isShowingSecVLog:Z

    if-eqz v0, :cond_0

    invoke-static {p0, p1, p2}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    move-result v0

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public static secW(Ljava/lang/String;Ljava/lang/String;)I
    .locals 1

    sget-boolean v0, Landroid/util/secutil/LogSwitcher;->isShowingSecWLog:Z

    if-eqz v0, :cond_0

    invoke-static {p0, p1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I

    move-result v0

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public static secW(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 1

    sget-boolean v0, Landroid/util/secutil/LogSwitcher;->isShowingSecWLog:Z

    if-eqz v0, :cond_0

    invoke-static {p0, p1, p2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    move-result v0

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public static secW(Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 1

    sget-boolean v0, Landroid/util/secutil/LogSwitcher;->isShowingSecWLog:Z

    if-eqz v0, :cond_0

    invoke-static {p0, p1}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/Throwable;)I

    move-result v0

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public static secWtf(Ljava/lang/String;Ljava/lang/String;)I
    .locals 1

    sget-boolean v0, Landroid/util/secutil/LogSwitcher;->isShowingSecWtfLog:Z

    if-eqz v0, :cond_0

    invoke-static {p0, p1}, Landroid/util/Log;->wtf(Ljava/lang/String;Ljava/lang/String;)I

    move-result v0

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public static secWtf(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 1

    sget-boolean v0, Landroid/util/secutil/LogSwitcher;->isShowingSecWtfLog:Z

    if-eqz v0, :cond_0

    invoke-static {p0, p1, p2}, Landroid/util/Log;->wtf(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    move-result v0

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public static secWtf(Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 1

    sget-boolean v0, Landroid/util/secutil/LogSwitcher;->isShowingSecWtfLog:Z

    if-eqz v0, :cond_0

    invoke-static {p0, p1}, Landroid/util/Log;->wtf(Ljava/lang/String;Ljava/lang/Throwable;)I

    move-result v0

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public static secWtfStack(Ljava/lang/String;Ljava/lang/String;)I
    .locals 1

    sget-boolean v0, Landroid/util/secutil/LogSwitcher;->isShowingSecWtfLog:Z

    if-eqz v0, :cond_0

    invoke-static {p0, p1}, Landroid/util/Log;->wtfStack(Ljava/lang/String;Ljava/lang/String;)I

    move-result v0

    return v0

    :cond_0
    const/4 v0, 0x0

    return v0
.end method

.method public static setWtfHandler(Landroid/util/Log$TerribleFailureHandler;)Landroid/util/Log$TerribleFailureHandler;
    .locals 3

    if-nez p0, :cond_0

    new-instance v1, Ljava/lang/NullPointerException;

    const-string/jumbo v2, "handler == null"

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

    throw v1

    :cond_0
    sget-object v0, Landroid/util/Log;->sWtfHandler:Landroid/util/Log$TerribleFailureHandler;

    sput-object p0, Landroid/util/Log;->sWtfHandler:Landroid/util/Log$TerribleFailureHandler;

    return-object v0
.end method

.method public static v(Ljava/lang/String;Ljava/lang/String;)I
    .locals 2

    const/4 v0, 0x0

    const/4 v1, 0x2

    invoke-static {v0, v1, p0, p1}, Landroid/util/Log;->println_native(IILjava/lang/String;Ljava/lang/String;)I

    move-result v0

    return v0
.end method

.method public static v(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 2

    const/4 v0, 0x0

    const/4 v1, 0x2

    invoke-static {v0, v1, p0, p1, p2}, Landroid/util/Log;->printlns(IILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    move-result v0

    return v0
.end method

.method public static w(Ljava/lang/String;Ljava/lang/String;)I
    .locals 2

    const/4 v0, 0x0

    const/4 v1, 0x5

    invoke-static {v0, v1, p0, p1}, Landroid/util/Log;->println_native(IILjava/lang/String;Ljava/lang/String;)I

    move-result v0

    return v0
.end method

.method public static w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 2

    const/4 v0, 0x0

    const/4 v1, 0x5

    invoke-static {v0, v1, p0, p1, p2}, Landroid/util/Log;->printlns(IILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    move-result v0

    return v0
.end method

.method public static w(Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 3

    const-string/jumbo v0, ""

    const/4 v1, 0x0

    const/4 v2, 0x5

    invoke-static {v1, v2, p0, v0, p1}, Landroid/util/Log;->printlns(IILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    move-result v0

    return v0
.end method

.method static wtf(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;ZZ)I
    .locals 3

    new-instance v1, Landroid/util/Log$TerribleFailure;

    invoke-direct {v1, p2, p3}, Landroid/util/Log$TerribleFailure;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    if-eqz p4, :cond_0

    move-object p3, v1

    :cond_0
    const/4 v2, 0x6

    invoke-static {p0, v2, p1, p2, p3}, Landroid/util/Log;->printlns(IILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    move-result v0

    sget-object v2, Landroid/util/Log;->sWtfHandler:Landroid/util/Log$TerribleFailureHandler;

    invoke-interface {v2, p1, v1, p5}, Landroid/util/Log$TerribleFailureHandler;->onTerribleFailure(Ljava/lang/String;Landroid/util/Log$TerribleFailure;Z)V

    return v0
.end method

.method public static wtf(Ljava/lang/String;Ljava/lang/String;)I
    .locals 6

    const/4 v0, 0x0

    const/4 v3, 0x0

    move-object v1, p0

    move-object v2, p1

    move v4, v0

    move v5, v0

    invoke-static/range {v0 .. v5}, Landroid/util/Log;->wtf(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;ZZ)I

    move-result v0

    return v0
.end method

.method public static wtf(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 6

    const/4 v0, 0x0

    move-object v1, p0

    move-object v2, p1

    move-object v3, p2

    move v4, v0

    move v5, v0

    invoke-static/range {v0 .. v5}, Landroid/util/Log;->wtf(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;ZZ)I

    move-result v0

    return v0
.end method

.method public static wtf(Ljava/lang/String;Ljava/lang/Throwable;)I
    .locals 6

    const/4 v0, 0x0

    invoke-virtual {p1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;

    move-result-object v2

    move-object v1, p0

    move-object v3, p1

    move v4, v0

    move v5, v0

    invoke-static/range {v0 .. v5}, Landroid/util/Log;->wtf(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;ZZ)I

    move-result v0

    return v0
.end method

.method static wtfQuiet(ILjava/lang/String;Ljava/lang/String;Z)V
    .locals 2

    new-instance v0, Landroid/util/Log$TerribleFailure;

    const/4 v1, 0x0

    invoke-direct {v0, p2, v1}, Landroid/util/Log$TerribleFailure;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    sget-object v1, Landroid/util/Log;->sWtfHandler:Landroid/util/Log$TerribleFailureHandler;

    invoke-interface {v1, p1, v0, p3}, Landroid/util/Log$TerribleFailureHandler;->onTerribleFailure(Ljava/lang/String;Landroid/util/Log$TerribleFailure;Z)V

    return-void
.end method

.method public static wtfStack(Ljava/lang/String;Ljava/lang/String;)I
    .locals 6

    const/4 v0, 0x0

    const/4 v3, 0x0

    const/4 v4, 0x1

    move-object v1, p0

    move-object v2, p1

    move v5, v0

    invoke-static/range {v0 .. v5}, Landroid/util/Log;->wtf(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;ZZ)I

    move-result v0

    return v0
.end method


text:
package io.sundr.codegen.api;

import java.io.IOException;
import java.io.Writer;
import java.util.HashSet;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;

import io.sundr.utils.Predicates;

public class CodeGenerator<T> {

  private final Class<T> type;
  private final Function<T, Writer> output;
  private final Function<T, String> identifier;
  private final Function<T, String> renderer;
  private final Predicate<T> skip;
  private final Consumer<T> onSkip;

  private final Consumer<T> ignore = t -> {
  };
  private final Set<String> generated = new HashSet<>();

  public static class Builder<T> {

    private final Class<T> type;
    private final Function<T, Writer> output;
    private final Function<T, String> identifier;
    private final Function<T, String> renderer;
    private final Predicate<T> skip;
    private final Consumer<T> onSkip;

    private Builder(Class<T> type) {
      this(type, null, null, null, null, null);
    }

    private Builder(Class<T> type, Function<T, Writer> output, Function<T, String> identifier, Function<T, String> renderer,
        Predicate<T> skip,
        Consumer<T> onSkip) {
      this.type = type;
      this.output = output;
      this.identifier = identifier;
      this.renderer = renderer;
      this.skip = skip;
      this.onSkip = onSkip;
    }

    public Builder<T> withOutput(Output<T> output) {
      return withOutput(output.getFunction());
    }

    public Builder<T> withOutput(Function<T, Writer> output) {
      return new Builder<>(type, output, identifier, renderer, skip, onSkip);
    }

    public Builder<T> withIdentifier(Identifier<T> identifier) {
      return withIdentifier(identifier.getFunction());
    }

    public Builder<T> withIdentifier(Function<T, String> identifier) {
      return new Builder<>(type, output, identifier, renderer, skip, onSkip);
    }

    public Builder<T> withRenderer(Renderer<T> renderer) {
      return withRenderer(renderer.getFunction());
    }

    public Builder<T> withRenderer(Function<T, String> renderer) {
      return new Builder<>(type, output, identifier, renderer, skip, onSkip);
    }

    public Builder<T> skipping(Predicate<T> skip) {
      return new Builder<>(type, output, identifier, renderer, skip, onSkip);
    }

    public CodeGenerator<T> build() {
      return new CodeGenerator<>(type, output, identifier, renderer, skip, onSkip);
    }

    public boolean generate(T... items) {
      return build().generate(items);
    }
  }

  private CodeGenerator(Class<T> type, Function<T, Writer> output, Function<T, String> identifier, Function<T, String> renderer,
      Predicate<T> skip, Consumer<T> onSkip) {
    this.type = type;
    this.output = output != null ? output : new SystemOutput<T>().getFunction();
    this.identifier = identifier != null ? identifier
        : Identifiers.findIdentifier(type).map(Identifier::getFunction).orElse(o -> String.valueOf(o.hashCode()));
    this.renderer = renderer != null ? renderer
        : Renderers.findRenderer(type).map(Renderer::getFunction)
            .orElseThrow(() -> new IllegalStateException("Renderer should not be null."));
    this.skip = skip != null ? skip : Predicates.distinct(t -> this.identifier.apply(t));
    this.onSkip = onSkip != null ? onSkip : ignore;
  }

  public static <T> Builder<T> newGenerator(Class<T> type) {
    return new Builder<T>(type);
  }

  /**
   * Generate one or more items
   *
   * @param items the items to generate
   * @return true if generation was succesful, false otherwise
   */
  public boolean generate(T... items) {
    //Function like skip, onSkip, writer etc may need to access the specified Identifier.
    //So, let's wrap all code that may need the identifier into a lambda and ensure that the Identifiers is accessible to the lambda
    //using Indentifiers.getIdentifier().
    return Identifiers.withIdentifier(identifier).call(() -> {
      for (T item : items) {
        String id = identifier.apply(item);
        if (skip.test(item)) {
          onSkip.accept(item);
          continue;
        }
        //Only generate each file once ...
        if (generated.contains(id)) {
          continue;
        }
        try (Writer writer = output.apply(item)) {
          writer.write(renderer.apply(item));
          generated.add(id);
        } catch (IOException e) {
          return false;
        }
      }
      return true;
    });

  }
}

redpajama_set_name: RedPajamaGithub


text:
package com.google.api.ads.adwords.jaxws.v201509.cm;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 *
 *             Use verticals to target or exclude placements in the Google Display Network
 *             based on the category into which the placement falls (for example, "Pets &
 *             Animals/Pets/Dogs").
 *             View the complete list
 *             of available vertical categories.
 *             This is enabled for AdX.
 *
 *
 *
Java class for Vertical complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="Vertical">
 *   <complexContent>
 *     <extension base="{https://adwords.google.com/api/adwords/cm/v201509}Criterion">
 *       <sequence>
 *         <element name="verticalId" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
 *         <element name="verticalParentId" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
 *         <element name="path" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Vertical", propOrder = {
    "verticalId",
    "verticalParentId",
    "path"
})
public class Vertical
    extends Criterion
{

    protected Long verticalId;
    protected Long verticalParentId;
    protected List<String> path;

    /**
     * Gets the value of the verticalId property.
     *
     * @return
     *     possible object is
     *     {@link Long }
     *
     */
    public Long getVerticalId() {
        return verticalId;
    }

    /**
     * Sets the value of the verticalId property.
     *
     * @param value
     *     allowed object is
     *     {@link Long }
     *
     */
    public void setVerticalId(Long value) {
        this.verticalId = value;
    }

    /**
     * Gets the value of the verticalParentId property.
     *
     * @return
     *     possible object is
     *     {@link Long }
     *
     */
    public Long getVerticalParentId() {
        return verticalParentId;
    }

    /**
     * Sets the value of the verticalParentId property.
     *
     * @param value
     *     allowed object is
     *     {@link Long }
     *
     */
    public void setVerticalParentId(Long value) {
        this.verticalParentId = value;
    }

    /**
     * Gets the value of the path property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the path property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getPath().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link String }
     *
     *
     */
    public List<String> getPath() {
        if (path == null) {
            path = new ArrayList<String>();
        }
        return this.path;
    }

}


text:
import { Session } from "./Session";
import { Visitor } from "./Visitor";

export class SessionAggregate {
    private _session: Session;
    private _visitor: Visitor;

    static createNewSessionAndVisitor(): SessionAggregate {
        let currentDate: Date = new Date();
        let session: Session = Session.createNewSession(currentDate);
        let visitor: Visitor = Visitor.createNewVisitor(currentDate);

        return new SessionAggregate(session, visitor);
    }

    static createNewSessionForExistingVisitor(visitor: Visitor): SessionAggregate {
        let currentDate: Date = new Date();
        let session: Session = Session.createNewSession(currentDate);
        visitor.updateLastVisit(currentDate);

        return new SessionAggregate(session, visitor);
    }

    static getExistingSession(visitor: Visitor, session: Session): SessionAggregate {
        let currentDate: Date = new Date();
        visitor.updateLastVisit(currentDate);
        session.renewSession(currentDate);

        return new SessionAggregate(session, visitor);
    }

    constructor(session: Session, visitor: Visitor) {
        this._session = session;
        this._visitor = visitor;
    }

    get session(): Session {
        return this._session;
    }

    get visitor(): Visitor {
        return this._visitor;
    }
}


text:
var serialize = require('serialize-javascript');
var debug = require('debug')('stateHelper');
/*
 * Share state with the client by injecting Context into the App object
 *
 * @method shareState
 * @param {Object} application
 * @param {Object} application context
 * @return {String}
 */
function shareState( application, context ) {
    debug(application.getAppComponent());

    var state = application.dehydrate(context);
    var serializedState = serialize(state);

    return '(function (root) {\n' +
        'root.App || (root.App = {});\n' +
        'root.App.Context = ' + serializedState +
        ';\n }(this));';
}

exports.shareState = shareState;


text:
package com.facebook.buck.core.util.immutables;

import com.fasterxml.jackson.databind.annotation.JsonNaming;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.immutables.value.Value;

/**
 * Value-style objects.
 *
 *
The generated immutable will be package private only so that the immutable generated class is
 * not used. The declaring interface/abstract class should re-expose constructors as appropriate
 * (like auto-value). It is intended that all users of the immutable ever only refer to the
 * interface/abstract class so that the underlying immmutable implementation can change freely.
 *
 *
Value-style objects have all attributes as "of" constructor parameters, do not have builders,
 * "with" methods, "copy" methods.
 *
 *
When using this annotation, it's unnecessary to explicitly use @Value.Immutable.
 *
 *
If the Value.Immutable behavior needs to be customized, you must explicitly set the values set
 * in the defaults here (otherwise a linter will yell at you).
 *
 * @see Immutable user guide
 */
@Value.Style(
    get = {"is*", "get*"},
    init = "set*",
    of = "ofImpl",
    visibility = Value.Style.ImplementationVisibility.PACKAGE,
    allParameters = true,
    defaults = @Value.Immutable(builder = false, copy = false, prehash = false),
    forceJacksonPropertyNames = false,
    additionalJsonAnnotations = {JsonNaming.class})
@Target({ElementType.TYPE, ElementType.PACKAGE, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface BuckStyleValue {}


text:
#ifndef CPPUNIT_EXTENSIONS_TESTSUITEFACTORY_H
#define CPPUNIT_EXTENSIONS_TESTSUITEFACTORY_H

#include <cppunit/extensions/TestFactory.h>

CPPUNIT_NS_BEGIN

  class Test;

  /*! \brief TestFactory for TestFixture that implements a static suite() method.
   * \see AutoRegisterSuite.
   */
  template<class TestCaseType>
  class TestSuiteFactory : public TestFactory
  {
  public:
    virtual Test *makeTest()
    {
      return TestCaseType::suite();
    }
  };

CPPUNIT_NS_END

#endif  // CPPUNIT_EXTENSIONS_TESTSUITEFACTORY_H


text:
<!DOCTYPE html>

    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/default.css">
    <link rel="stylesheet" href="../styles/main.css">

Namespace Dacs7.Communication

Classes

ClientSocketConfiguration

Interfaces

IConfiguration

ISocketConfiguration


text:
import mxnet as mx
from benchmark.opperf.utils.benchmark_utils import run_op_benchmarks
from benchmark.opperf.utils.op_registry_utils import get_all_sorting_searching_operators

""" Performance benchmark tests for MXNet NDArray Sorting and Searching Operations
1. sort
2. argsort
3. topk
4. argmax
5. argmin
"""

def run_sorting_searching_operators_benchmarks(ctx=mx.cpu(), dtype='float32', profiler='native', warmup=25, runs=100):
    """Runs benchmarks with the given context and precision (dtype)for all the sorting and searching
    operators in MXNet.

    Parameters
    ----------
    ctx: mx.ctx
        Context to run benchmarks
    dtype: str, default 'float32'
        Precision to use for benchmarks
    profiler: str, default 'native'
        Type of Profiler to use (native/python)
    warmup: int, default 25
        Number of times to run for warmup
    runs: int, default 100
        Number of runs to capture benchmark results

    Returns
    -------
    Dictionary of results. Key -> Name of the operator, Value -> Benchmark results.

    """
    # Fetch all Random Sampling Operators
    mx_sort_search_ops = get_all_sorting_searching_operators()
    # Run benchmarks
    mx_sort_search_op_results = run_op_benchmarks(mx_sort_search_ops, dtype, ctx, profiler, warmup, runs)
    return mx_sort_search_op_results


text:
SampleClass::SampleClass(char* pc)
{
	delete[] pc;
}

SampleClass::~SampleClass()
{
}

void SampleClass::methodWithFalsePositive()
{
	char* buf = new char[10];

	// This is a false positive defect "error:memleak:Memory leak: buf"
	gList.push_back(new (std::nothrow) SampleClass(buf));
}


text:
<!doctype html>

<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>

<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

  <link rel="stylesheet" type="text/css" href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5"/>

<link rel="stylesheet" type="text/css" href="/css/main.css?v=0.4.5.1"/>

    <meta name="description" content="Keep Learning" />

  <meta name="keywords" content="技术点滴," />

  <link rel="shorticon icon" type="image/x-icon" href="/favicon.ico?v=0.4.5.1" />

<meta name="description" content="URIs, URLs, and URNs
首先,URI,是uniform resource identifier,统一资源标识符,用来唯一的标识一个资源。
而URL是uniform resource locator,统一资源定位器,它是一种具体的URI,即URL可以用来标识一个资源,而且还指明了如何locate这个资源。
而URN,uniform resource name,统一资源命名,是通过名">
<meta property="og:type" content="article">
<meta property="og:title" content="URI和URL的区别">
<meta property="og:url" content="http://cyan-blue.github.io/2015/10/12/2015/10/12/technology/index.html">
<meta property="og:site_name" content="Yann's Blog">
<meta property="og:description" content="URIs, URLs, and URNs
首先,URI,是uniform resource identifier,统一资源标识符,用来唯一的标识一个资源。
而URL是uniform resource locator,统一资源定位器,它是一种具体的URI,即URL可以用来标识一个资源,而且还指明了如何locate这个资源。
而URN,uniform resource name,统一资源命名,是通过名">
<meta property="og:updated_time" content="2016-09-16T14:44:49.245Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="URI和URL的区别">
<meta name="twitter:description" content="URIs, URLs, and URNs
首先,URI,是uniform resource identifier,统一资源标识符,用来唯一的标识一个资源。
而URL是uniform resource locator,统一资源定位器,它是一种具体的URI,即URL可以用来标识一个资源,而且还指明了如何locate这个资源。
而URN,uniform resource name,统一资源命名,是通过名">

  <title> URI和URL的区别 | Yann's Blog </title>

      Yann's Blog

        Walk steps step by step

  <button>

  </button>

            首页

            分类

            归档

            标签

            留言

            关于

            <a title="把这个链接拖到你的Chrome收藏夹工具栏中" href='javascript:(function() {
            function c() {
                var e = document.createElement("link");
                e.setAttribute("type", "text/css");
                e.setAttribute("rel", "stylesheet");
                e.setAttribute("href", f);
                e.setAttribute("class", l);
                document.body.appendChild(e)
            }

            function h() {
                var e = document.getElementsByClassName(l);
                for (var t = 0; t < e.length; t++) {
                    document.body.removeChild(e[t])
                }
            }

            function p() {
                var e = document.createElement("div");
                e.setAttribute("class", a);
                document.body.appendChild(e);
                setTimeout(function() {
                    document.body.removeChild(e)
                }, 100)
            }

            function d(e) {
                return {
                    height : e.offsetHeight,
                    width : e.offsetWidth
                }
            }

            function v(i) {
                var s = d(i);
                return s.height > e && s.height < n && s.width > t && s.width < r
            }

            function m(e) {
                var t = e;
                var n = 0;
                while (!!t) {
                    n += t.offsetTop;
                    t = t.offsetParent
                }
                return n
            }

            function g() {
                var e = document.documentElement;
                if (!!window.innerWidth) {
                    return window.innerHeight
                } else if (e && !isNaN(e.clientHeight)) {
                    return e.clientHeight
                }
                return 0
            }

            function y() {
                if (window.pageYOffset) {
                    return window.pageYOffset
                }
                return Math.max(document.documentElement.scrollTop, document.body.scrollTop)
            }

            function E(e) {
                var t = m(e);
                return t >= w && t <= b + w
            }

            function S() {
                var e = document.createElement("audio");
                e.setAttribute("class", l);
                e.src = i;
                e.loop = false;
                e.addEventListener("canplay", function() {
                    setTimeout(function() {
                        x(k)
                    }, 500);
                    setTimeout(function() {
                        N();
                        p();
                        for (var e = 0; e < O.length; e++) {
                            T(O[e])
                        }
                    }, 15500)
                }, true);
                e.addEventListener("ended", function() {
                    N();
                    h()
                }, true);
                e.innerHTML = "
If you are reading this, it is because your browser does not support the audio element. We recommend that you get a new browser.

";
                document.body.appendChild(e);
                e.play()
            }

            function x(e) {
                e.className += " " + s + " " + o
            }

            function T(e) {
                e.className += " " + s + " " + u[Math.floor(Math.random() * u.length)]
            }

            function N() {
                var e = document.getElementsByClassName(s);
                var t = new RegExp("\\b" + s + "\\b");
                for (var n = 0; n < e.length; ) {
                    e[n].className = e[n].className.replace(t, "")
                }
            }

            var e = 30;
            var t = 30;
            var n = 350;
            var r = 350;
            var i = "//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake.mp3";
            var s = "mw-harlem_shake_me";
            var o = "im_first";
            var u = ["im_drunk", "im_baked", "im_trippin", "im_blown"];
            var a = "mw-strobe_light";
            var f = "//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake-style.css";
            var l = "mw_added_css";
            var b = g();
            var w = y();
            var C = document.getElementsByTagName("*");
            var k = null;
            for (var L = 0; L < C.length; L++) {
                var A = C[L];
                if (v(A)) {
                    if (E(A)) {
                        k = A;
                        break
                    }
                }
            }
            if (A === null) {
                console.warn("Could not find a node of the right size. Please try a different page.");
                return
            }
            c();
            S();
            var O = [];
            for (var L = 0; L < C.length; L++) {
                var A = C[L];
                if (v(A)) {
                    O.push(A)
                }
            }
        })()'>High一下

              URI和URL的区别

          发表于
          <time itemprop="dateCreated" datetime="2015-10-12T20:36:45+08:00" content="2015-10-12">
            2015-10-12
          </time>

              |   分类于

                  技术点滴

                |

URIs, URLs, and URNs

首先,URI,是uniform resource identifier,统一资源标识符,用来唯一的标识一个资源。

而URL是uniform resource locator,统一资源定位器,它是一种具体的URI,即URL可以用来标识一个资源,而且还指明了如何locate这个资源。

而URN,uniform resource name,统一资源命名,是通过名字来标识资源,比如mailto:java-net@java.sun.com。
也就是说,URI是以一种抽象的,高层次概念定义统一资源标识,而URL和URN则是具体的资源标识的方式。URL和URN都是一种URI。

            #技术点滴

              python 问题

              Django 问题收集

            文章目录

            站点概览

Yann

Keep Learning

              48
              日志

              17
              分类

              19
              标签

                GitHub

                CSDN

                StackOverFlow

1. URIs, URLs, and URNs

  ©    2015 -
  2016

  Yann

  由 Hexo 强力驱动

  主题 -

    NexT.Mist


text:
/*
From: http://blog.golang.org/defer-panic-and-recover

"Panic is a built-in function that stops the ordinary flow of control and begins panicking. When the function F calls panic, execution of F stops, any deferred functions in F are executed normally, and then F returns to its caller."

"Recover is a built-in function that regains control of a panicking goroutine. Recover is only useful inside deferred functions. During normal execution, a call to recover will return nil and have no other effect. If the current goroutine is panicking, a call to recover will capture the value given to panic and resume normal execution."

The function g takes the int i, and panics if i is greater than 3, or else it calls itself with the argument i+1. The function f defers a function that calls recover and prints the recovered value (if it is non-nil).
*/

package main

import "fmt"

func main() {
	f()
	fmt.Println("Returned normally from f.")
}

func f() {
	defer func() {
		if r := recover(); r != nil {
			fmt.Println("Recovered in f", r)
		}
	}()
	fmt.Println("Calling g.")
	g(0)
	fmt.Println("Returned normally from g.")
}

func g(i int) {
	if i > 3 {
		fmt.Println("Panicking!")
		panic(fmt.Sprintf("%v", i))
	}
	defer fmt.Println("Defer in g", i)
	fmt.Println("Printing in g", i)
	g(i + 1)
}


text:
package com.fsck.k9.helper;

public final class EmailHelper {
    private EmailHelper() {}

    public static String getDomainFromEmailAddress(String email) {
        int separatorIndex = email.lastIndexOf('@');
        if (separatorIndex == -1 || separatorIndex + 1 == email.length()) {
            return null;
        }

        return email.substring(separatorIndex + 1);
    }
}


text:
package com.google.android.libraries.mobiledatadownload.file.samples;

import android.net.Uri;
import com.google.android.libraries.mobiledatadownload.file.backends.JavaFileBackend;
import com.google.android.libraries.mobiledatadownload.file.spi.Backend;
import com.google.android.libraries.mobiledatadownload.file.spi.ForwardingBackend;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

/** An example backend that wraps another backend and a transform. Encodes all data as base64. */
public class Base64Backend extends ForwardingBackend {
  private final Base64Transform base64 = new Base64Transform();
  private final Backend javaBackend = new JavaFileBackend();

  @Override
  protected Backend delegate() {
    return javaBackend;
  }

  @Override
  public String name() {
    return "base64";
  }

  @Override
  public InputStream openForRead(Uri uri) throws IOException {
    return base64.wrapForRead(uri, super.openForRead(uri));
  }

  @Override
  public OutputStream openForWrite(Uri uri) throws IOException {
    return base64.wrapForWrite(uri, super.openForWrite(uri));
  }

  @Override
  public OutputStream openForAppend(Uri uri) throws IOException {
    return base64.wrapForAppend(uri, super.openForAppend(uri));
  }
}


text:
package com.base.engine.components;

import com.base.engine.core.CoreEngine;
import com.base.engine.core.GameObject;
import com.base.engine.core.RenderingEngine;
import com.base.engine.core.Transform;
import com.base.engine.rendering.Shader;

public abstract class GameComponent {

    private GameObject parent;

    public void input(float delta) {
    }

    public void update(float delta) {
    }

    public void render(Shader shader, RenderingEngine renderingEngine) {
    }

    public void setParent(GameObject parent) {
        this.parent = parent;
    }

    public Transform getTransform() {
        return parent.getTransform();
    }

    public void addToEngine(CoreEngine engine) {
    }

}


text:
<?php
defined('C5_EXECUTE') or die("Access Denied.");
class BlockTypePermissionAccess extends Concrete5_Model_BlockTypePermissionAccess {

}


text:
export default options => `

Teams

Doesn't have to be for everyone.

                  1.- Backend to frontend

I like backend languages like Java, C#. I want to learn JavaScript but don't lose some things that I like from my languages.

                  2.- Advanced frontend developer

I consider that I know a lot about frontend and JavaScript I start feelking that I need something more, without stop doing JavaScript.

                  3.- !Beginner

I'm a beginner programmer, I want to learn JavaScript. Probably start with TypeScript is not the best decision, if you want to be a frontend dev, learn JavaScript first :)

`;


text:
require("babel-register")();

var configure = require('./lib').configure;
configure({
  url: (
    process.env.TEST_MONGO_ADDR
    ? process.env.TEST_MONGO_ADDR
    : 'mongodb://10.211.55.5/mars_mongo_tests'
  )
});


text:
layout: page
title: "Frank Hsiao"
comments: true
description: "blanks"
keywords: "Frank Hsiao,CU,Boulder"
---
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script>
<!-- <script src="../assets/js/highcharts.js"></script> -->
<style type="text/css">@font-face {
	font-family: "Bebas Neue";
	src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype");
	}
	h1.Bebas {
		font-family: "Bebas Neue", Verdana, Tahoma;
	}
</style>
</head>

#### TEACHING INFORMATION

**College**: College of Arts and Sciences

**Classes taught**: ECON 4838

#### ECON 4838: MICROCOMPUTER APPS/ECON

**Terms taught**: Fall 2006, Fall 2006, Fall 2007, Spring 2009

**Instructor rating**: 4.35

**Standard deviation in instructor rating**: 0.44

**Average grade** (4.0 scale): 2.73

**Standard deviation in grades** (4.0 scale): 0.21

**Average workload** (raw): 2.49

**Standard deviation in workload** (raw): 0.12


text:
<?php

/**
 * @author Michael Slyshkin <m.slyshkin@gmail.com>
 */

namespace RsORMTest\Query\Engine\MySQL\Argument;

use RsORMTest;
use RsORM\Query\Engine\MySQL\Argument;

class AnyTest extends RsORMTest\Base {

    public function test() {
        $any = new Argument\Any();
        $this->assertSame("*", $any->prepare());
    }

}


text:
layout: post
title: Three weeks in the USA
tags: holiday
---

I'm writing this flying from Austin to London. The past three weeks in the US has been amazing. Highlights include: Exploring the many faces of LA, flamingo and ostrich feeding, walking the Vegas strip, joshua tree under the stars, warming up pizza in a sun oven, spotting elk and chipmunks in the grand canyon, frozen margaritas, tacos, a shrimp boil, and tacos.

Tacos.

Thanks to everyone who made Emma and I feel welcome and super happy. I feel spoilt with kindness.

In other news, the timing of this flight overlaps with the FA cup final! The suspense is killing me!


text:
/** Explanation:
 * https://leetcode.com/problems/generate-random-point-in-a-circle/discuss/154037/Polar-Coordinates-10-lines
 */

class Solution {
    double r, cx, cy;

    public Solution(double radius, double x_center, double y_center) {
        this.r = radius;
        this.cx = x_center;
        this.cy = y_center;
    }

    public double[] randPoint() {
        double rr = Math.sqrt(Math.random()) * r;
        double theta = Math.random() * Math.PI * 2.0;
        double px = cx + rr * Math.cos(theta);
        double py = cy + rr * Math.sin(theta);
        return new double[]{px, py};
    }
}


text:
{% extends "layout.html" %} {% block brand %} {% include "includes/v2/brandChange.html" %} {% endblock %} {% block content
%} {% include "includes/v2/navV5.html" %}

          Choose reasons to add to skill set

        <form class="form" action="agentEdit" method="post">

                <fieldset>

                  <legend>

Select reasons to add to skill set

                  </legend>

                    <input id="All" name="enquiry-reason" type="checkbox" value="All"  {{ ('enquiry-reason','All') }}>
                    All

or

                      <input id="Deductions" name="enquiry-reason" type="checkbox" value="Deductions" {{ ('enquiry-reason',' Deductions') }}>
                      Deductions

                    <input id="request for a letter " name="enquiry-reason" type="checkbox" value="request for a letter " {{ ('enquiry-reason','request for a letter ') }}>
                    request for a letter

                      <input id="clerical" name="enquiry-reason" type="checkbox" value="clerical" {{ checked('enquiry-reason','clerical') }}>
                      clerical

                        <input id="Post query " name="enquiry-reason" type="checkbox" value="Post query " {{ checked('enquiry-reason','Post query ') }}>
                        Post query

                          <input id="Appointment query " name="enquiry-reason" type="checkbox" value="Appointment query " {{ checked('enquiry-reason','Appointment query ') }}>
                          Appointment query

                            <input id="Hardship" name="enquiry-reason" type="checkbox" value="Hardship" {{ checked('enquiry-reason','Hardship') }}>
                            Hardship

                              <input id="More information required " name="enquiry-reason" type="checkbox" value="More information required " {{ checked('enquiry-reason','More information required ') }}>
                              More information required

                              <input id="Joint claim" name="enquiry-reason" type="checkbox" value="Joint claim" {{ checked('enquiry-reason','Joint claim') }}>
                              Joint claim

                          <input id="Payment Query" name="enquiry-reason" type="checkbox" value="Payment Query" {{ checked('enquiry-reason','Payment Query') }}>
                          Payment Query

                            <input id="Signing query " name="enquiry-reason" type="checkbox" value="Signing query " {{ checked('enquiry-reason','Signing query ') }}>
                            Signing query

                              <input id="Part time work " name="enquiry-reason" type="checkbox" value="Part time work " {{ checked('enquiry-reason','Part time work ') }}>
                              Part time work

                                <input id="Progress chasing " name="enquiry-reason" type="checkbox" value="Progress chasing " {{ checked('enquiry-reason','Progress chasing ') }}>
                                Progress chasing

                </fieldset>

              <input class="button" type="submit" value="Continue">

        </form>

</form>

{% endblock %}


text:
The package contains the Groovy 2.4.7 release. Install this SEU-as-code package
using the following dependency:
```groovy
dependencies {
	  software 'org.groovy-lang:groovy:2.4.7'
}
```


text:
package com.antonioleiva.sunmoonstar;

import android.app.Dialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import com.antonioeiva.sunmoonstar.adapter.WiFiScanAdapter;
import com.general.AppPrefrence;
import com.general.DensityConvert;

import java.util.HashMap;
import java.util.List;

/**
 * Created by ShihYi on 15/9/12.
 */
public class Add_DeviceActivity extends BaseActivtiy {
    private String mBackClassName = null;
    private String mNowClassName = null;
    private WifiManager mWifiManger = null;
    private List<ScanResult> mWifiResult = null;
    private WifiScanReceiver mWifiScanReceiver = null;
    private WifiChangeReceiver mWifiChangeReceiver = null;
    private CountDownTimer mWiFiCountDownTimer = null;
    private HashMap<String, ScanResult> mWiFiMap = null;
    private ListView lvWifiScan = null;
    private ScanResult mScanResult = null;
    private Button btnNextStep = null;
    private boolean isFirstScan = true;
    private WifiConfiguration mWifiConfiguration = null;
    private WifiConfiguration mOriginWifiConfig = null;
    private boolean isConnectSuccess = false;
    private boolean isRollBack = false;
    private Context mContext = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.connect_device_ap_layout);

        findViews();
        setUIfuntion();
        initValues();
        callApiMethod();

        setActionBarForBack(mNowClassName, mBackClassName);
    }

    @Override
    void findViews() {
        lvWifiScan = (ListView) findViewById(R.id.listWifiScan);
        btnNextStep = (Button) findViewById(R.id.btnNextStep);
    }

    @Override
    void setUIfuntion() {
        btnNextStep.setOnClickListener(new NextStepClick());
    }

    @Override
    void initValues() {
        mContext = Add_DeviceActivity.this;
        mBackClassName = getBackClassName();
        mNowClassName = getNowClassName();

        mWifiManger = (WifiManager) getSystemService(Context.WIFI_SERVICE);
        List<WifiConfiguration> listWifiConfiguration = mWifiManger.getConfiguredNetworks();

//        Log.e("mWifiManger.isWifiEnabled()", "wifiEnabled:" + mWifiManger.isWifiEnabled());
        if (!mWifiManger.isWifiEnabled()) {
            Toast.makeText(this, getString(R.string.open_wifi), Toast.LENGTH_SHORT).show();
            startActivity(new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS));
            overridePendingTransition(R.anim.in_from_right, R.anim.out_to_left);
        } else {
            for (int i = 0; i < listWifiConfiguration.size(); i++) {
                if (mWifiManger.getConnectionInfo().getSSID().equals(listWifiConfiguration.get(i).SSID)) {
                    mOriginWifiConfig = listWifiConfiguration.get(i);
                }
            }

        }

        mWifiScanReceiver = new WifiScanReceiver();
        mWifiChangeReceiver = new WifiChangeReceiver();

    }

    @Override
    void callApiMethod() {

    }

    @Override
    protected void onResume() {
        super.onResume();
        isFirstScan = true;
        //isRollBack = false;
        registerReceiver(mWifiScanReceiver, new IntentFilter(
                WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));

        IntentFilter filter = new IntentFilter();
        filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
        filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
        registerReceiver(mWifiChangeReceiver, filter);

        if (!mWifiManger.isWifiEnabled()) {
            Toast.makeText(this, getString(R.string.open_wifi), Toast.LENGTH_SHORT).show();
            startActivity(new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS));
            overridePendingTransition(R.anim.in_from_right, R.anim.out_to_left);
        } else {
            boolean mSuccess = false;
            mSuccess = mWifiManger.startScan();
//        Log.e("WifiChangeReceiver", "scan result :" + mSuccess);
            showProgressDialog("Scan WiFi...");
        }

    }

    @Override
    protected void onPause() {
        super.onPause();
        dismissProgressDialog();
        unregisterReceiver(mWifiScanReceiver);
        unregisterReceiver(mWifiChangeReceiver);

    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                onBackPressed();
                return true;
        }

        return super.onOptionsItemSelected(item);
    }

    /**
     * after scaning the wifi , the receiver can receive "WifiManager.SCAN_RESULTS_AVAILABLE_ACTION"
     */
    class WifiScanReceiver extends BroadcastReceiver {
        @Override
        public void onReceive(Context context, Intent intent) {
            // TODO Auto-generated method stub
            // isFirstScan --> it ensures that receiver receives the broadcast once.
            if (isFirstScan) {
                dismissProgressDialog();
                mWiFiMap = new HashMap<String, ScanResult>();
                mWifiResult = mWifiManger.getScanResults();
                int mScanSize = mWifiResult.size();
                String mSSID = null;
                int mRSSI = 0;
                for (int i = 0; i < mScanSize; i++) {
                    if (mWifiResult.get(i).SSID.length() > 6 && mWifiResult.get(i).SSID.substring(0, 6).equals("iBadge")) {
                        mSSID = mWifiResult.get(i).SSID;
                        mRSSI = mWifiResult.get(i).level;
                        /**
                         * mWiFiMap only saves the wifi result that have the better level(RSSI)
                         */
                        if (!mWiFiMap.containsKey(mSSID)) {
                            mWiFiMap.put(mSSID, mWifiResult.get(i));
                        } else {
                            if (mWiFiMap.get(mSSID).level > mRSSI) {
                                mWiFiMap.put(mSSID, mWifiResult.get(i));
                            }
                        }
                    }
                }
                lvWifiScan.setAdapter(new WiFiScanAdapter(Add_DeviceActivity.this, mWiFiMap));
                lvWifiScan.setOnItemClickListener(new WifiListViewListener());
                isFirstScan = false;
            }

        }
    }

    class WifiChangeReceiver extends BroadcastReceiver {
        @Override
        public void onReceive(Context context, Intent intent) {
            // TODO Auto-generated method
            if (intent.getAction().equals(WifiManager.WIFI_STATE_CHANGED_ACTION)) {
                int wifiState = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, 0);
                switch (wifiState) {
                    case WifiManager.WIFI_STATE_DISABLED:
                        dismissProgressDialog();
                        showDialogOK("WiFi disconnect", "Please check your wifi");
                        break;
                    case WifiManager.WIFI_STATE_ENABLED:
                        showProgressDialog("Scan WiFi...");
                        break;
                }
            }
            /**
             * the receiver can receive "android.net.conn.CONNECTIVITY_CHANGE" many times
             *  and disconnect the original wifi in middle of changing new wifi.
             */
            if (intent.getAction().equals("android.net.conn.CONNECTIVITY_CHANGE") && !isRollBack) {
                if (mScanResult != null) {
                    Log.e("WifiChangeReceiver", " CONNECTIVITY_CHANGE want to connect SSID :" + AppPrefrence.getDeviceWiFiAP(mContext) + "connect ssid : " + mWifiManger.getConnectionInfo().getSSID() + " check wifi status : " + checkConnectState() + " ,isConnectSuccess :" + isConnectSuccess);
                    if (mWifiManger.getConnectionInfo().getSSID().equals("\"" + AppPrefrence.getDeviceWiFiAP(mContext) + "\"") && (checkConnectState() == 2 || checkConnectState() == 0) && !isConnectSuccess) {

                        showDialogOK("Connect " + mScanResult.SSID, "Success!");
                        if (mWiFiCountDownTimer != null) {
                            mWiFiCountDownTimer.cancel();
                        }
                        isConnectSuccess = true;
                        dismissProgressDialog();
                    } else if (!mWifiManger.getConnectionInfo().getSSID().equals("\"" + AppPrefrence.getDeviceWiFiAP(mContext) + "\"") && (checkConnectState() == 2 || checkConnectState() == 0)) {
                        int res = mWifiManger.addNetwork(mWifiConfiguration);
                        boolean mCheckConnect = mWifiManger.enableNetwork(res, true);
                    }
                }
            }
        }
    }

    class WifiListViewListener implements AdapterView.OnItemClickListener {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            mScanResult = (ScanResult) parent.getItemAtPosition(position);
//            Log.e("SSID",mScanResult.SSID);
//            Log.e("SSID",mOriginWifiConfig.SSID);
            if (mOriginWifiConfig.SSID.equals("\"" + mScanResult.SSID + "\"")) {
                Toast.makeText(Add_DeviceActivity.this, "You have connected " + mScanResult.SSID + " already", Toast.LENGTH_LONG).show();
            } else {

                mWifiConfiguration = new WifiConfiguration();

                mWiFiCountDownTimer = new CountDownTimer(50000, 1000) {

                    @Override
                    public void onFinish() {
                        // TODO Auto-generated method stub
                        showDialogOK("Connect " + mScanResult.SSID, "Connect Time out");

                        dismissProgressDialog();

                    }

                    @Override
                    public void onTick(long millisUntilFinished) {
                        // TODO Auto-generated method stub
                        Log.e("WifiChangeReceiver", "over time : " + millisUntilFinished / 1000);
                        if (millisUntilFinished / 1000 < 15) {
                            //recover to original wifi
                            int res = mWifiManger.addNetwork(mOriginWifiConfig);
                            boolean mCheckConnect = mWifiManger.enableNetwork(res, true);
                            isRollBack = true;
                        }
                    }

                };

                isConnectSuccess = false;
                isRollBack = false;
                if (mScanResult.capabilities.contains("WPA2") || mScanResult.capabilities.contains("WPS")) {
                    /**
                     * the [WPA2] indicates that it needs to key the password of the wifi.
                     * shows the dialog and asks the user to key the password.
                     */
                    final Dialog mDialog = new Dialog(Add_DeviceActivity.this, R.style.MessageDialog);
                    View mView = LayoutInflater.from(Add_DeviceActivity.this).inflate(R.layout.wifi_pw_layout, null);
                    WindowManager.LayoutParams mDialogParams = new WindowManager.LayoutParams();
                    mDialogParams.copyFrom(mDialog.getWindow().getAttributes());
                    mDialogParams.width = (int) ((720 * DensityConvert.mMagnificationWidth) * 0.9f);
                    mDialogParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
                    mDialog.setContentView(mView, mDialogParams);
                    TextView txtDialogTitle = (TextView) mDialog.findViewById(R.id.txtDialogTitle);
                    final EditText txtWiFiPW = (EditText) mDialog.findViewById(R.id.txtWiFiPW);
                    Button btnWiFiPW = (Button) mDialog.findViewById(R.id.btnWiFiPW);

                    txtDialogTitle.setText("The Password of " + mScanResult.SSID);
                    btnWiFiPW.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            if (TextUtils.isEmpty(txtWiFiPW.getText().toString())) {
                                txtWiFiPW.setError("Please key the Password");
                            } else {
                                AppPrefrence.saveDeviceWiFiAP(mContext, mScanResult.SSID);
                                AppPrefrence.saveDeviceWiFiAPPW(mContext, txtWiFiPW.getText().toString());
//                            mWifiConfiguration.SSID = "\"" + mScanResult.SSID + "\"";
//                            mWifiConfiguration.preSharedKey = "\"" + txtWiFiPW.getText().toString() + "\"";
//                            Log.e("WifiChangeReceiver", " the pw of wifi is " + mWifiConfiguration.preSharedKey);
//                            mWifiConfiguration.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);
//                            mWifiConfiguration.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
//                            mWifiConfiguration.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
//                            mWifiConfiguration.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
//                            mWifiConfiguration.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
//                            mWifiConfiguration.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
//                            mWifiConfiguration.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
//                            mWifiConfiguration.status = WifiConfiguration.Status.ENABLED;
                                mWifiConfiguration = getNewWiFiConfig(mScanResult.SSID, txtWiFiPW.getText().toString(), mScanResult.capabilities);
                                int res = mWifiManger.addNetwork(mWifiConfiguration);
                                boolean mCheckConnect = mWifiManger.enableNetwork(res, true);
                                Log.e("WifiChangeReceiver", " connect SSID :" + mScanResult.SSID + " , PW:" + txtWiFiPW.getText().toString() + " , result :" + mCheckConnect);
                                if (mCheckConnect == true) {
                                    mWifiManger.setWifiEnabled(true);
                                    showProgressDialog("Connect " + mScanResult.SSID + "...");
                                    if (mWiFiCountDownTimer != null) {
                                        mWiFiCountDownTimer.cancel();
                                        mWiFiCountDownTimer.start();
                                    }
                                } else {
                                    showDialogOK("Connect " + mScanResult.SSID, "Connect Failed...");
                                    if (mWiFiCountDownTimer != null) {
                                        mWiFiCountDownTimer.cancel();
                                    }
                                    dismissProgressDialog();
                                }

                                mDialog.dismiss();
                            }
                        }
                    });

                    mDialog.show();

                } else {
                    /**
                     * the [EES] indicates that it does not need to key the password of the wifi
                     */
                    AppPrefrence.saveDeviceWiFiAP(mContext, mScanResult.SSID);
                    AppPrefrence.removeKey(mContext, "DEVICE_WIFI_AP_PW");
                    mWifiConfiguration = getNewWiFiConfig(mScanResult.SSID, "", mScanResult.capabilities);
                    int res = mWifiManger.addNetwork(mWifiConfiguration);
                    boolean mCheckConnect = mWifiManger.enableNetwork(res, true);
                    if (mCheckConnect == true) {
                        mWifiManger.setWifiEnabled(true);
                        showProgressDialog("Connect " + mScanResult.SSID + "...");
                        if (mWiFiCountDownTimer != null) {
                            mWiFiCountDownTimer.cancel();
                            mWiFiCountDownTimer.start();
                        }
                    } else {
                        showDialogOK("Connect " + mScanResult.SSID, "Connect Failed...");
                        if (mWiFiCountDownTimer != null) {
                            mWiFiCountDownTimer.cancel();
                        }
                        dismissProgressDialog();
                    }

                }
            }
        }
    }

    private class NextStepClick implements View.OnClickListener {

        @Override
        public void onClick(View v) {
            //mWifiManger.getConnectionInfo().getSSID() = "iBadge.....",thus it needs to substring(1, 7)
            if (mWifiManger.getConnectionInfo().getSSID().length() > 7 && mWifiManger.getConnectionInfo().getSSID().substring(1, 7).equals("iBadge")) {
                replaceActivity(Add_DeviceActivity.this, Configure_Device_WANActivity.class);

            } else {
                Toast.makeText(Add_DeviceActivity.this, "Please choose iBadgeDemoAP_xx-xx-xx-xx-x…", Toast.LENGTH_LONG).show();
            }
        }
    }
}


text:
package de.longri.cachebox3.events;

/**
 * Created by Longri on 25.04.2017.
 */
public interface ImportProgressChangedListener {

    void progressChanged(ImportProgressChangedEvent event);

}


text:
'use strict';

const rule = require('../lib/check_component_naming.js');
const ruleTester = new (require('eslint').RuleTester)({
  parserOptions: {ecmaVersion: 9, sourceType: 'module'},
  parser: require.resolve('@typescript-eslint/parser'),
});

ruleTester.run('check_component_naming', rule, {
  valid: [
    {
      code: `export class Foo extends HTMLElement {
        static readonly litTagName = LitHtml.literal\`devtools-foo\`
      }

      ComponentHelpers.CustomElements.defineComponent('devtools-foo', Foo);

      declare global {
        interface HTMLElementTagNameMap {
          'devtools-foo': Foo
        }
      }`,
      filename: 'front_end/ui/components/Foo.ts'
    },
    {
      // Multiple components in one file is valid.
      code: `export class Foo extends HTMLElement {
        static readonly litTagName = LitHtml.literal\`devtools-foo\`
      }

      export class Bar extends HTMLElement {
        static readonly litTagName = LitHtml.literal\`devtools-bar\`
      }

      ComponentHelpers.CustomElements.defineComponent('devtools-bar', Bar);
      ComponentHelpers.CustomElements.defineComponent('devtools-foo', Foo);

      declare global {
        interface HTMLElementTagNameMap {
          'devtools-foo': Foo
          'devtools-bar': Bar
        }
      }`,
      filename: 'front_end/ui/components/Foo.ts'
    },
    {
      code: `export class Foo extends HTMLElement {
        static readonly litTagName = LitHtml.literal\`devtools-foo\`
      }

      defineComponent('devtools-foo', Foo);

      declare global {
        interface HTMLElementTagNameMap {
          'devtools-foo': Foo
        }
      }`,
      filename: 'front_end/ui/components/Foo.ts'
    }
  ],
  invalid: [
    // Missing static litTagName
    {
      code: `export class Foo extends HTMLElement {
      }

      ComponentHelpers.CustomElements.defineComponent('devtools-not-foo', Foo);

      declare global {
        interface HTMLElementTagNameMap {
          'devtools-foo': Foo
        }
      }`,
      filename: 'front_end/ui/components/Foo.ts',
      errors: [{messageId: 'noStaticTagName'}]
    },
    // static is not a string
    {
      code: `export class Foo extends HTMLElement {
        static readonly litTagName = LitHtml.literal\`\${someVar}\`
      }

      ComponentHelpers.CustomElements.defineComponent('devtools-foo', Foo);

      declare global {
        interface HTMLElementTagNameMap {
          'devtools-foo': Foo
        }
      }`,
      filename: 'front_end/ui/components/Foo.ts',
      errors: [{
        messageId: 'staticLiteralInvalid'

      }]
    },
    // Static is not readonly
    {
      code: `export class Foo extends HTMLElement {
        static litTagName = LitHtml.literal\`devtools-foo\`;
      }

      ComponentHelpers.CustomElements.defineComponent('devtools-foo', Foo);

      declare global {
        interface HTMLElementTagNameMap {
          'devtools-foo': Foo
        }
      }`,
      filename: 'front_end/ui/components/Foo.ts',
      errors: [{
        messageId: 'staticLiteralNotReadonly'

      }]
    },
    // defineComponent call uses wrong name
    {
      code: `export class Foo extends HTMLElement {
        static readonly litTagName = LitHtml.literal\`devtools-foo\`
      }

      ComponentHelpers.CustomElements.defineComponent('devtools-not-foo', Foo);

      declare global {
        interface HTMLElementTagNameMap {
          'devtools-foo': Foo
        }
      }`,
      filename: 'front_end/ui/components/Foo.ts',
      errors: [{messageId: 'noDefineCall'}]
    },
    // defineComponent call uses non literal
    {
      code: `export class Foo extends HTMLElement {
        static readonly litTagName = LitHtml.literal\`devtools-foo\`
      }

      const name = 'devtools-foo';
      ComponentHelpers.CustomElements.defineComponent(name, Foo);

      declare global {
        interface HTMLElementTagNameMap {
          'devtools-foo': Foo
        }
      }`,
      filename: 'front_end/ui/components/Foo.ts',
      errors: [{
        messageId: 'defineCallNonLiteral'

      }]
    },
    // defineComponent call missing
    {
      code: `export class Foo extends HTMLElement {
        static readonly litTagName = LitHtml.literal\`devtools-foo\`
      }

      declare global {
        interface HTMLElementTagNameMap {
          'devtools-foo': Foo
        }
      }`,
      filename: 'front_end/ui/components/Foo.ts',
      errors: [{
        messageId: 'noDefineCall'

      }]
    },
    // TS interface is incorrect
    {
      code: `export class Foo extends HTMLElement {
        static readonly litTagName = LitHtml.literal\`devtools-foo\`
      }

      ComponentHelpers.CustomElements.defineComponent('devtools-foo', Foo);

      declare global {
        interface HTMLElementTagNameMap {
          'devtools-not-foo': Foo
        }
      }`,
      filename: 'front_end/ui/components/Foo.ts',
      errors: [{messageId: 'noTSInterface'}]
    },
    // TS interface is missing
    {
      code: `export class Foo extends HTMLElement {
        static readonly litTagName = LitHtml.literal\`devtools-foo\`
      }

      ComponentHelpers.CustomElements.defineComponent('devtools-foo', Foo);`,
      filename: 'front_end/ui/components/Foo.ts',
      errors: [{messageId: 'noTSInterface', data: {tagName: 'devtools-foo'}}]
    },
    {
      // Not using LitHtml.literal
      code: `export class Foo extends HTMLElement {
        static readonly litTagName = 'devtools-foo';
      }

      ComponentHelpers.CustomElements.defineComponent('devtools-foo', Foo);

      declare global {
        interface HTMLElementTagNameMap {
          'devtools-foo': Foo
        }
      }`,
      filename: 'front_end/ui/components/Foo.ts',
      errors: [{messageId: 'litTagNameNotLiteral'}]
    },
    {
      // Multiple components in one file is valid.
      // But here devtools-foo is fine, but devtools-bar is missing a define call
      code: `export class Foo extends HTMLElement {
        static readonly litTagName = LitHtml.literal\`devtools-foo\`
      }

      export class Bar extends HTMLElement {
        static readonly litTagName = LitHtml.literal\`devtools-bar\`
      }

      ComponentHelpers.CustomElements.defineComponent('devtools-foo', Foo);

      declare global {
        interface HTMLElementTagNameMap {
          'devtools-foo': Foo
          'devtools-bar': Bar
        }
      }`,
      filename: 'front_end/ui/components/Foo.ts',
      errors: [{messageId: 'noDefineCall', data: {tagName: 'devtools-bar'}}]
    },
    {
      // Multiple components in one file is valid.
      // But here devtools-foo is fine, but devtools-bar has the wrong static tag name
      code: `export class Foo extends HTMLElement {
        static readonly litTagName = LitHtml.literal\`devtools-foo\`
      }

      export class Bar extends HTMLElement {
        static readonly litTagName = LitHtml.literal\`devtools-foo\`
      }

      ComponentHelpers.CustomElements.defineComponent('devtools-foo', Foo);
      ComponentHelpers.CustomElements.defineComponent('devtools-bar', Foo);

      declare global {
        interface HTMLElementTagNameMap {
          'devtools-foo': Foo
          'devtools-bar': Bar
        }
      }`,
      filename: 'front_end/ui/components/Foo.ts',
      errors: [{messageId: 'duplicateStaticLitTagName', data: {tagName: 'devtools-foo'}}]
    },
  ]
});


text:
require 'dotenv'

require_relative './lib/db/redismanager'
require_relative './lib/wechat/wechatqueueprocessor'

$ROOT_PATH = File.dirname(__FILE__)

# Load .env files for local development (DO NOT push it to production!)
Dotenv.load("#{$ROOT_PATH}/../.env")

# Create a DatabaseManager instance
db_manager = RedisManager.new(ENV['REDIS_URL'])

# Get a queued message
queued_message = db_manager.fetch_queued_message

# Process the queued message
if queued_message
  queue_processor = WeChatQueueProcessor.new(ENV['WECHAT_APPID'], ENV['WECHAT_APPSECRET'])
  queue_processor.process_message(queued_message)
end


text:
	<title>repetition/enum_trailing.hpp</title>
	<link rel="stylesheet" type="text/css" href="../../styles.css">

		The repetition/enum_trailing.hpp header defines a construct that produces a comma-separated list with a leading comma.

Usage

			#include <boost/preprocessor/repetition/enum_trailing.hpp>

Contents

BOOST_PP_ENUM_TRAILING

BOOST_PP_ENUM_TRAILING_z

		© Copyright Housemarque Oy 2002

© Copyright Paul Mensonides 2002

Distributed under the Boost Software License, Version 1.0. (See
		accompanying file LICENSE_1_0.txt or
		copy at www.boost.org/LICENSE_1_0.txt)