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

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Landroid/text/BidiFormatter$Builder;,
        Landroid/text/BidiFormatter$DirectionalityEstimator;
    }
.end annotation

# static fields
.field private static final DEFAULT_FLAGS:I = 0x2

.field private static final DEFAULT_LTR_INSTANCE:Landroid/text/BidiFormatter;

.field private static final DEFAULT_RTL_INSTANCE:Landroid/text/BidiFormatter;

.field private static DEFAULT_TEXT_DIRECTION_HEURISTIC:Landroid/text/TextDirectionHeuristic; = null

.field private static final DIR_LTR:I = -0x1

.field private static final DIR_RTL:I = 0x1

.field private static final DIR_UNKNOWN:I = 0x0

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

.field private static final FLAG_STEREO_RESET:I = 0x2

.field private static final LRE:C = '\u202a'

.field private static final LRM:C = '\u200e'

.field private static final LRM_STRING:Ljava/lang/String;

.field private static final PDF:C = '\u202c'

.field private static final RLE:C = '\u202b'

.field private static final RLM:C = '\u200f'

.field private static final RLM_STRING:Ljava/lang/String;

# instance fields
.field private final mDefaultTextDirectionHeuristic:Landroid/text/TextDirectionHeuristic;

.field private final mFlags:I

.field private final mIsRtlContext:Z

# direct methods
.method static synthetic -get0()Landroid/text/BidiFormatter;
    .locals 1

    sget-object v0, Landroid/text/BidiFormatter;->DEFAULT_LTR_INSTANCE:Landroid/text/BidiFormatter;

    return-object v0
.end method

.method static synthetic -get1()Landroid/text/BidiFormatter;
    .locals 1

    sget-object v0, Landroid/text/BidiFormatter;->DEFAULT_RTL_INSTANCE:Landroid/text/BidiFormatter;

    return-object v0
.end method

.method static synthetic -get2()Landroid/text/TextDirectionHeuristic;
    .locals 1

    sget-object v0, Landroid/text/BidiFormatter;->DEFAULT_TEXT_DIRECTION_HEURISTIC:Landroid/text/TextDirectionHeuristic;

    return-object v0
.end method

.method static synthetic -wrap0(Ljava/util/Locale;)Z
    .locals 1
    .param p0, "locale"    # Ljava/util/Locale;

    .prologue
    invoke-static {p0}, Landroid/text/BidiFormatter;->isRtlLocale(Ljava/util/Locale;)Z

    move-result v0

    return v0
.end method

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

    .prologue
    const/4 v3, 0x2

    .line 87
    sget-object v0, Landroid/text/TextDirectionHeuristics;->FIRSTSTRONG_LTR:Landroid/text/TextDirectionHeuristic;

    sput-object v0, Landroid/text/BidiFormatter;->DEFAULT_TEXT_DIRECTION_HEURISTIC:Landroid/text/TextDirectionHeuristic;

    .line 117
    const/16 v0, 0x200e

    invoke-static {v0}, Ljava/lang/Character;->toString(C)Ljava/lang/String;

    move-result-object v0

    sput-object v0, Landroid/text/BidiFormatter;->LRM_STRING:Ljava/lang/String;

    .line 122
    const/16 v0, 0x200f

    invoke-static {v0}, Ljava/lang/Character;->toString(C)Ljava/lang/String;

    move-result-object v0

    sput-object v0, Landroid/text/BidiFormatter;->RLM_STRING:Ljava/lang/String;

    .line 219
    new-instance v0, Landroid/text/BidiFormatter;

    .line 222
    sget-object v1, Landroid/text/BidiFormatter;->DEFAULT_TEXT_DIRECTION_HEURISTIC:Landroid/text/TextDirectionHeuristic;

    .line 220
    const/4 v2, 0x0

    .line 219
    invoke-direct {v0, v2, v3, v1}, Landroid/text/BidiFormatter;-><init>(ZILandroid/text/TextDirectionHeuristic;)V

    sput-object v0, Landroid/text/BidiFormatter;->DEFAULT_LTR_INSTANCE:Landroid/text/BidiFormatter;

    .line 224
    new-instance v0, Landroid/text/BidiFormatter;

    .line 227
    sget-object v1, Landroid/text/BidiFormatter;->DEFAULT_TEXT_DIRECTION_HEURISTIC:Landroid/text/TextDirectionHeuristic;

    .line 225
    const/4 v2, 0x1

    .line 224
    invoke-direct {v0, v2, v3, v1}, Landroid/text/BidiFormatter;-><init>(ZILandroid/text/TextDirectionHeuristic;)V

    sput-object v0, Landroid/text/BidiFormatter;->DEFAULT_RTL_INSTANCE:Landroid/text/BidiFormatter;

    .line 82
    return-void
.end method

.method private constructor <init>(ZILandroid/text/TextDirectionHeuristic;)V
    .locals 0
    .param p1, "isRtlContext"    # Z
    .param p2, "flags"    # I
    .param p3, "heuristic"    # Landroid/text/TextDirectionHeuristic;

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

    .line 265
    iput-boolean p1, p0, Landroid/text/BidiFormatter;->mIsRtlContext:Z

    .line 266
    iput p2, p0, Landroid/text/BidiFormatter;->mFlags:I

    .line 267
    iput-object p3, p0, Landroid/text/BidiFormatter;->mDefaultTextDirectionHeuristic:Landroid/text/TextDirectionHeuristic;

    .line 264
    return-void
.end method

.method synthetic constructor <init>(ZILandroid/text/TextDirectionHeuristic;Landroid/text/BidiFormatter;)V
    .locals 0
    .param p1, "isRtlContext"    # Z
    .param p2, "flags"    # I
    .param p3, "heuristic"    # Landroid/text/TextDirectionHeuristic;

    .prologue
    invoke-direct {p0, p1, p2, p3}, Landroid/text/BidiFormatter;-><init>(ZILandroid/text/TextDirectionHeuristic;)V

    return-void
.end method

.method private static getEntryDir(Ljava/lang/String;)I
    .locals 2
    .param p0, "str"    # Ljava/lang/String;

    .prologue
    .line 492
    new-instance v0, Landroid/text/BidiFormatter$DirectionalityEstimator;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Landroid/text/BidiFormatter$DirectionalityEstimator;-><init>(Ljava/lang/String;Z)V

    invoke-virtual {v0}, Landroid/text/BidiFormatter$DirectionalityEstimator;->getEntryDir()I

    move-result v0

    return v0
.end method

.method private static getExitDir(Ljava/lang/String;)I
    .locals 2
    .param p0, "str"    # Ljava/lang/String;

    .prologue
    .line 475
    new-instance v0, Landroid/text/BidiFormatter$DirectionalityEstimator;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Landroid/text/BidiFormatter$DirectionalityEstimator;-><init>(Ljava/lang/String;Z)V

    invoke-virtual {v0}, Landroid/text/BidiFormatter$DirectionalityEstimator;->getExitDir()I

    move-result v0

    return v0
.end method

.method public static getInstance()Landroid/text/BidiFormatter;
    .locals 1

    .prologue
    .line 238
    new-instance v0, Landroid/text/BidiFormatter$Builder;

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

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

    move-result-object v0

    return-object v0
.end method

.method public static getInstance(Ljava/util/Locale;)Landroid/text/BidiFormatter;
    .locals 1
    .param p0, "locale"    # Ljava/util/Locale;

    .prologue
    .line 256
    new-instance v0, Landroid/text/BidiFormatter$Builder;

    invoke-direct {v0, p0}, Landroid/text/BidiFormatter$Builder;-><init>(Ljava/util/Locale;)V

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

    move-result-object v0

    return-object v0
.end method

.method public static getInstance(Z)Landroid/text/BidiFormatter;
    .locals 1
    .param p0, "rtlContext"    # Z

    .prologue
    .line 247
    new-instance v0, Landroid/text/BidiFormatter$Builder;

    invoke-direct {v0, p0}, Landroid/text/BidiFormatter$Builder;-><init>(Z)V

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

    move-result-object v0

    return-object v0
.end method

.method private static isRtlLocale(Ljava/util/Locale;)Z
    .locals 2
    .param p0, "locale"    # Ljava/util/Locale;

    .prologue
    const/4 v0, 0x1

    .line 450
    invoke-static {p0}, Landroid/text/TextUtils;->getLayoutDirectionFromLocale(Ljava/util/Locale;)I

    move-result v1

    if-ne v1, v0, :cond_0

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

# virtual methods
.method public getStereoReset()Z
    .locals 2

    .prologue
    const/4 v0, 0x0

    .line 282
    iget v1, p0, Landroid/text/BidiFormatter;->mFlags:I

    and-int/lit8 v1, v1, 0x2

    if-eqz v1, :cond_0

    const/4 v0, 0x1

    :cond_0
    return v0
.end method

.method public isRtl(Ljava/lang/String;)Z
    .locals 3
    .param p1, "str"    # Ljava/lang/String;

    .prologue
    .line 351
    iget-object v0, p0, Landroid/text/BidiFormatter;->mDefaultTextDirectionHeuristic:Landroid/text/TextDirectionHeuristic;

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

    move-result v1

    const/4 v2, 0x0

    invoke-interface {v0, p1, v2, v1}, Landroid/text/TextDirectionHeuristic;->isRtl(Ljava/lang/CharSequence;II)Z

    move-result v0

    return v0
.end method

.method public isRtlContext()Z
    .locals 1

    .prologue
    .line 274
    iget-boolean v0, p0, Landroid/text/BidiFormatter;->mIsRtlContext:Z

    return v0
.end method

.method public markAfter(Ljava/lang/String;Landroid/text/TextDirectionHeuristic;)Ljava/lang/String;
    .locals 3
    .param p1, "str"    # Ljava/lang/String;
    .param p2, "heuristic"    # Landroid/text/TextDirectionHeuristic;

    .prologue
    .line 303
    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v1

    const/4 v2, 0x0

    invoke-interface {p2, p1, v2, v1}, Landroid/text/TextDirectionHeuristic;->isRtl(Ljava/lang/CharSequence;II)Z

    move-result v0

    .line 305
    .local v0, "isRtl":Z
    iget-boolean v1, p0, Landroid/text/BidiFormatter;->mIsRtlContext:Z

    if-nez v1, :cond_1

    if-nez v0, :cond_0

    invoke-static {p1}, Landroid/text/BidiFormatter;->getExitDir(Ljava/lang/String;)I

    move-result v1

    const/4 v2, 0x1

    if-ne v1, v2, :cond_1

    .line 306
    :cond_0
    sget-object v1, Landroid/text/BidiFormatter;->LRM_STRING:Ljava/lang/String;

    return-object v1

    .line 308
    :cond_1
    iget-boolean v1, p0, Landroid/text/BidiFormatter;->mIsRtlContext:Z

    if-eqz v1, :cond_3

    if-eqz v0, :cond_2

    invoke-static {p1}, Landroid/text/BidiFormatter;->getExitDir(Ljava/lang/String;)I

    move-result v1

    const/4 v2, -0x1

    if-ne v1, v2, :cond_3

    .line 309
    :cond_2
    sget-object v1, Landroid/text/BidiFormatter;->RLM_STRING:Ljava/lang/String;

    return-object v1

    .line 311
    :cond_3
    const-string/jumbo v1, ""

    return-object v1
.end method

.method public markBefore(Ljava/lang/String;Landroid/text/TextDirectionHeuristic;)Ljava/lang/String;
    .locals 3
    .param p1, "str"    # Ljava/lang/String;
    .param p2, "heuristic"    # Landroid/text/TextDirectionHeuristic;

    .prologue
    .line 332
    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v1

    const/4 v2, 0x0

    invoke-interface {p2, p1, v2, v1}, Landroid/text/TextDirectionHeuristic;->isRtl(Ljava/lang/CharSequence;II)Z

    move-result v0

    .line 334
    .local v0, "isRtl":Z
    iget-boolean v1, p0, Landroid/text/BidiFormatter;->mIsRtlContext:Z

    if-nez v1, :cond_1

    if-nez v0, :cond_0

    invoke-static {p1}, Landroid/text/BidiFormatter;->getEntryDir(Ljava/lang/String;)I

    move-result v1

    const/4 v2, 0x1

    if-ne v1, v2, :cond_1

    .line 335
    :cond_0
    sget-object v1, Landroid/text/BidiFormatter;->LRM_STRING:Ljava/lang/String;

    return-object v1

    .line 337
    :cond_1
    iget-boolean v1, p0, Landroid/text/BidiFormatter;->mIsRtlContext:Z

    if-eqz v1, :cond_3

    if-eqz v0, :cond_2

    invoke-static {p1}, Landroid/text/BidiFormatter;->getEntryDir(Ljava/lang/String;)I

    move-result v1

    const/4 v2, -0x1

    if-ne v1, v2, :cond_3

    .line 338
    :cond_2
    sget-object v1, Landroid/text/BidiFormatter;->RLM_STRING:Ljava/lang/String;

    return-object v1

    .line 340
    :cond_3
    const-string/jumbo v1, ""

    return-object v1
.end method

.method public unicodeWrap(Ljava/lang/String;)Ljava/lang/String;
    .locals 2
    .param p1, "str"    # Ljava/lang/String;

    .prologue
    .line 440
    iget-object v0, p0, Landroid/text/BidiFormatter;->mDefaultTextDirectionHeuristic:Landroid/text/TextDirectionHeuristic;

    const/4 v1, 0x1

    invoke-virtual {p0, p1, v0, v1}, Landroid/text/BidiFormatter;->unicodeWrap(Ljava/lang/String;Landroid/text/TextDirectionHeuristic;Z)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public unicodeWrap(Ljava/lang/String;Landroid/text/TextDirectionHeuristic;)Ljava/lang/String;
    .locals 1
    .param p1, "str"    # Ljava/lang/String;
    .param p2, "heuristic"    # Landroid/text/TextDirectionHeuristic;

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

    invoke-virtual {p0, p1, p2, v0}, Landroid/text/BidiFormatter;->unicodeWrap(Ljava/lang/String;Landroid/text/TextDirectionHeuristic;Z)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public unicodeWrap(Ljava/lang/String;Landroid/text/TextDirectionHeuristic;Z)Ljava/lang/String;
    .locals 4
    .param p1, "str"    # Ljava/lang/String;
    .param p2, "heuristic"    # Landroid/text/TextDirectionHeuristic;
    .param p3, "isolate"    # Z

    .prologue
    const/4 v2, 0x0

    .line 385
    if-nez p1, :cond_0

    return-object v2

    .line 386
    :cond_0
    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v2

    const/4 v3, 0x0

    invoke-interface {p2, p1, v3, v2}, Landroid/text/TextDirectionHeuristic;->isRtl(Ljava/lang/CharSequence;II)Z

    move-result v0

    .line 387
    .local v0, "isRtl":Z
    new-instance v1, Ljava/lang/StringBuilder;

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

    .line 388
    .local v1, "result":Ljava/lang/StringBuilder;
    invoke-virtual {p0}, Landroid/text/BidiFormatter;->getStereoReset()Z

    move-result v2

    if-eqz v2, :cond_1

    if-eqz p3, :cond_1

    .line 390
    if-eqz v0, :cond_3

    sget-object v2, Landroid/text/TextDirectionHeuristics;->RTL:Landroid/text/TextDirectionHeuristic;

    .line 389
    :goto_0
    invoke-virtual {p0, p1, v2}, Landroid/text/BidiFormatter;->markBefore(Ljava/lang/String;Landroid/text/TextDirectionHeuristic;)Ljava/lang/String;

    move-result-object v2

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

    .line 392
    :cond_1
    iget-boolean v2, p0, Landroid/text/BidiFormatter;->mIsRtlContext:Z

    if-eq v0, v2, :cond_5

    .line 393
    if-eqz v0, :cond_4

    const/16 v2, 0x202b

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

    .line 394
    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 395
    const/16 v2, 0x202c

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

    .line 399
    :goto_2
    if-eqz p3, :cond_2

    .line 401
    if-eqz v0, :cond_6

    sget-object v2, Landroid/text/TextDirectionHeuristics;->RTL:Landroid/text/TextDirectionHeuristic;

    .line 400
    :goto_3
    invoke-virtual {p0, p1, v2}, Landroid/text/BidiFormatter;->markAfter(Ljava/lang/String;Landroid/text/TextDirectionHeuristic;)Ljava/lang/String;

    move-result-object v2

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

    .line 403
    :cond_2
    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    return-object v2

    .line 390
    :cond_3
    sget-object v2, Landroid/text/TextDirectionHeuristics;->LTR:Landroid/text/TextDirectionHeuristic;

    goto :goto_0

    .line 393
    :cond_4
    const/16 v2, 0x202a

    goto :goto_1

    .line 397
    :cond_5
    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    goto :goto_2

    .line 401
    :cond_6
    sget-object v2, Landroid/text/TextDirectionHeuristics;->LTR:Landroid/text/TextDirectionHeuristic;

    goto :goto_3
.end method

.method public unicodeWrap(Ljava/lang/String;Z)Ljava/lang/String;
    .locals 1
    .param p1, "str"    # Ljava/lang/String;
    .param p2, "isolate"    # Z

    .prologue
    .line 429
    iget-object v0, p0, Landroid/text/BidiFormatter;->mDefaultTextDirectionHeuristic:Landroid/text/TextDirectionHeuristic;

    invoke-virtual {p0, p1, v0, p2}, Landroid/text/BidiFormatter;->unicodeWrap(Ljava/lang/String;Landroid/text/TextDirectionHeuristic;Z)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method


text:
Die Model-Klassen  beheimaten alle Daten  sowie den Grossteil  der Algorithmen
(zus\"atzliche Algorithmen,  die von den Model-Klassen  verwendet werden, sind
in den Klassen \code{Calc}  und \code{SplineNAK} des Packages \code{Utilities}
sowie in  der Apache-Library zu  finden). Das \code{Model} ist  observable, um
das Aktualisieren der \code{View} zu erm\"oglichen.

\subsubsection*{\code{Model}}
Wie  im  Klassendiagramm  (siehe  Anhang~\ref{app:classdiagram})  ersichtlich,
erzeugt  die  Klasse \code{Model}  im  Konstruktor  f\"ur jede  Berechnungsart
eine  Instanz der  Klasse \code{ClosedLoop}. Das  \code{Model} hat  ein Objekt
der  Klasse \code{Path}  und \"ubergibt  dieses an  den \code{ClosedLoop}. Das
\code{Model}  enth\"alt  Setter-  und  Getter-Methoden  zur  Verarbeitung  der
Daten  mittels  weiterer  Klassen. Das \code{Model}  nutzt  die  M\"oglichkeit
\code{notifyObservers()} aufzurufen, um \code{update()} auf der \code{View} zu
bewirken.

\subsubsection*{\code{ClosedLoop}}
Die    Instanzen   der    Klasse   \code{ClosedLoop}    repr\"asentieren   die
geschlossenen  Regelkreise. Sie  kennen   ihren  Berechnungstyp  und  besitzen
einen  Regler. Im  Konstruktor  wird  je  nach  Berechnungsart  ein  passender
\code{Controller}   instanziiert. Zus\"atzlich  beinhaltet   die  Klasse   die
Methode  \code{calculate()}. Diese   berechnet  f\"ur   alle  Berechnungsarten
die    Schrittantwort    mittels   \code{calculateStepResponse()}.

F\"ur  die  Phasengangmethode  wird  zus\"atzlich  das  \"Uberschwingverhalten
mittels   der   Methode    \code{overShootOptimization()}   optimiert   (siehe
Anhang~\ref{app:algo:oversh}).  Zudem sind diverse Setter- und Getter-Methoden
Bestandteil dieser Model-Klasse.

\subsubsection*{\code{Controller}}
Der  \code{Controller}  bildet  die  Oberklasse  aller  Faustformeln  und  der
Phasengangmethode. Er  beinhaltet  die   abstrakte  Klasse  \code{calculate()}
sowie  alle  n\"otigen  Setter-  und   Getter-Methoden  um  Werte  zu  setzten
und  auszulesen.  Die  Methode  \code{utfController()},  deren Algorithmus  in
Anhang~\ref{app:algo:utfcontroller}  beschrieben ist,  wird durch  die Methode
\code{setUTFPoly()} hier ausgel\"ost.

\subsubsection*{\code{Chien20}}
Die     Klasse     \code{Chien20}     stellt    die     Algorithmen     (siehe
Anhang~\ref{app:algo:chien})   zur   Berechnung   der   Reglerwerte   gem\"ass
der  Faustformel   Chien/Hrones/Reswick  (20\%)  zur  Verf\"ugung,   erbt  von
\code{Controller}, instanziiert und setzt eine \"Ubertragungsfunktion.

\subsubsection*{\code{ChienApper}}
Die    Klasse     \code{ChienApper}    stellt    die     Algorithmen    (siehe
Anhang~\ref{app:algo:chien})  zur  Berechnung  der  Reglerwerte  gem\"ass  der
Faustformel  Chien/Hrones/Reswick  (aperiodisch)  zur  Verf\"ugung,  erbt  von
\code{Controller}, instanziiert und setzt eine \"Ubertragungsfunktion.

\subsubsection*{\code{Oppelt}}
Die     Klasse     \code{Oppelt}     stellt     die     Algorithmen     (siehe
Anhang~\ref{app:algo:oppelt})  zur  Berechnung  der Reglerwerte  gem\"ass  der
Faustformel Oppelt  zur Verf\"ugung, erbt von  \code{Controller}, instanziiert
und setzt eine \"Ubertragungsfunktion.

\subsubsection*{\code{Rosenberg}}
Die     Klasse    \code{Rosenberg}     stellt    die     Algorithmen    (siehe
Anhang~\ref{app:algo:rosenberg})  zur  Berechnung   der  Reglerwerte  gem\"ass
der  Faustformel  Rosenberg  zur   Verf\"ugung,  erbt  von  \code{Controller},
instanziiert und setzt eine \"Ubertragungsfunktion.

\subsubsection*{\code{PhaseResponseMethod}}
Die Klasse  \code{PhaseResponseMethod} stellt  die Algorithmen  zur Berechnung
der Reglerwerte  gem\"ass der Phasengangmethode zur  Verf\"ugung. Sie erbt von
der Klasse \code{Controller} und bringt  all deren Setter- und Getter-Methoden
mit.

\"Uber  die  \"uberladene  Methode  \code{setData()}  werden  die  Input-Werte
gesetzt. Dabei wird die Methode \code{calculateOverShoot()}, die das f\"ur die
Berechnung  des  korrekten  \"Uberschwingens ben\"otigt  Attribut  \code{phiU}
setzt,    ausgel\"ost. Zus\"atzlich   wird    \code{calculate()}   aufgerufen.
\code{calculate()}  berechnet  anhand   der  Methode  \code{createOmegaAxis()}
die   diskrete  Frequenzachse   in   Abh\"angigkeit   der  Zeitkonstante   der
Regelstrecke. Die \"Ubertragungsfunktion in s der Regelstrecke wird f\"ur alle
Punkte von \code{omega} berechnet.

\code{calculateTnk()}  wird ausgel\"ost  und berechnet  $T_{nk}$ und  $T_{vk}$
unter   Zuhilfenahme  der   diskreten   Werte.  \code{calculateTnk()}   l\"ost
wiederum   \code{calculateKrk()}  zur   Berechnung   von   $K_{rk}$  aus   und
ruft   zudem   \code{calculateControllerConf()}   und   \code{setUTF()}   auf.
\code{calculateControllerConf()} transformiert die Werte in die reglerkonforme
Darstellung  (siehe  Anhang~\ref{app:algo:boderegler}). \code{setUTF()}  setzt
die \"Ubertragungs-Funktion des Reglers.

\subsubsection*{\code{Path}}
Die   Klasse  \code{Path}   berechnet  in   der  Methode   \code{calculate()},
unter   Zuhilfenahme  der   Sani-Methode  (\code{Calc.sani()}),   die  Strecke
(\code{Path}). Sie besitzt  eine Instanz  der Klasse \code{UTF}  sowie Setter-
und Getter-Methoden zum Setzen und Auslesen von Werten.

\subsubsection*{\code{UTF}}
Setzt  und speichert  die  \"Ubertragungsfunktion. Diese  kann \"uber  diverse
Getter- und Setter-Methoden ausgelesen bzw. geschrieben werden.

redpajama_set_name: RedPajamaGithub


text:
package com.mesosphere.sdk.specification;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.mesosphere.sdk.offer.Constants;
import com.mesosphere.sdk.offer.evaluate.placement.PlacementRule;
import com.mesosphere.sdk.specification.validation.UniqueTaskName;
import com.mesosphere.sdk.specification.validation.ValidationUtils;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.net.URI;
import java.util.*;

/**
 * Default implementation of {@link PodSpec}.
 */
public class DefaultPodSpec implements PodSpec {
    @NotNull
    @Size(min = 1)
    private final String type;
    private final String user;
    @NotNull
    @Min(0)
    private final Integer count;
    @NotNull
    private Boolean allowDecommission;
    @Size(min = 1)
    private String image;
    @Valid
    private Collection<NetworkSpec> networks;
    @Valid
    private Collection<RLimitSpec> rlimits;
    @NotNull
    @Valid
    @Size(min = 1)
    @UniqueTaskName(message = "Task names must be unique")
    private final List<TaskSpec> tasks;
    @Valid
    private final PlacementRule placementRule;
    @Valid
    private final Collection<URI> uris;
    @Valid
    private Collection<VolumeSpec> volumes;
    @Valid
    private Collection<SecretSpec> secrets;
    private String preReservedRole;
    @NotNull
    private Boolean sharePidNamespace;

    @JsonCreator
    public DefaultPodSpec(
            @JsonProperty("type") String type,
            @JsonProperty("user") String user,
            @JsonProperty("count") Integer count,
            @JsonProperty("image") String image,
            @JsonProperty("networks") Collection<NetworkSpec> networks,
            @JsonProperty("rlimits") Collection<RLimitSpec> rlimits,
            @JsonProperty("uris") Collection<URI> uris,
            @JsonProperty("task-specs") List<TaskSpec> tasks,
            @JsonProperty("placement-rule") PlacementRule placementRule,
            @JsonProperty("volumes") Collection<VolumeSpec> volumes,
            @JsonProperty("pre-reserved-role") String preReservedRole,
            @JsonProperty("secrets") Collection<SecretSpec> secrets,
            @JsonProperty("share-pid-namespace") Boolean sharePidNamespace,
            @JsonProperty("allow-decommission") Boolean allowDecommission) {
        this(
                new Builder(Optional.empty()) // Assume that Executor URI is already present
                        .type(type)
                        .user(user)
                        .count(count)
                        .image(image)
                        .networks(networks)
                        .rlimits(rlimits)
                        .uris(uris)
                        .tasks(tasks)
                        .placementRule(placementRule)
                        .volumes(volumes)
                        .preReservedRole(preReservedRole)
                        .secrets(secrets)
                        .sharePidNamespace(sharePidNamespace)
                        .allowDecommission(allowDecommission));
    }

    private DefaultPodSpec(Builder builder) {
        this.count = builder.count;
        this.allowDecommission = builder.allowDecommission;
        this.image = builder.image;
        this.networks = builder.networks;
        this.placementRule = builder.placementRule;
        this.preReservedRole = builder.preReservedRole;
        this.rlimits = builder.rlimits;
        this.secrets = builder.secrets;
        this.tasks = builder.tasks;
        this.type = builder.type;
        this.uris = builder.uris;
        this.user = builder.user;
        this.volumes = builder.volumes;
        this.sharePidNamespace = builder.sharePidNamespace;
        ValidationUtils.validate(this);
    }

    public static Builder newBuilder(String executorUri) {
        return new Builder(Optional.of(executorUri));
    }

    public static Builder newBuilder(PodSpec copy) {
        Builder builder = new Builder(Optional.empty()); // Assume that Executor URI is already present
        builder.count = copy.getCount();
        builder.allowDecommission = copy.getAllowDecommission();
        builder.image = copy.getImage().isPresent() ? copy.getImage().get() : null;
        builder.networks = copy.getNetworks();
        builder.placementRule = copy.getPlacementRule().isPresent() ? copy.getPlacementRule().get() : null;
        builder.preReservedRole = copy.getPreReservedRole();
        builder.rlimits = copy.getRLimits();
        builder.secrets = copy.getSecrets();
        builder.tasks = copy.getTasks();
        builder.type = copy.getType();
        builder.uris = copy.getUris();
        builder.user = copy.getUser().isPresent() ? copy.getUser().get() : null;
        builder.volumes = copy.getVolumes();
        builder.sharePidNamespace = copy.getSharePidNamespace();
        return builder;
    }

    @Override
    public String getType() {
        return type;
    }

    @Override
    public Optional<String> getUser() {
        return Optional.ofNullable(user);
    }

    @Override
    public Integer getCount() {
        return count;
    }

    @Override
    public Boolean getAllowDecommission() {
        return allowDecommission;
    }

    @Override
    public Optional<String> getImage() {
        return Optional.ofNullable(image);
    }

    @Override
    public Collection<NetworkSpec> getNetworks() {
        return networks;
    }

    @Override
    public Collection<RLimitSpec> getRLimits() {
        return rlimits;
    }

    @Override
    public Collection<URI> getUris() {
        return uris;
    }

    @Override
    public List<TaskSpec> getTasks() {
        return tasks;
    }

    @Override
    public Optional<PlacementRule> getPlacementRule() {
        return Optional.ofNullable(placementRule);
    }

    @Override
    public Collection<VolumeSpec> getVolumes() {
        return volumes;
    }

    @Override
    public String getPreReservedRole() {
        return preReservedRole;
    }

    @Override
    public Collection<SecretSpec> getSecrets() {
        return secrets;
    }

    @Override
    public Boolean getSharePidNamespace() {
        return sharePidNamespace;
    }

    @Override
    public boolean equals(Object o) {
        return EqualsBuilder.reflectionEquals(this, o);
    }

    @Override
    public int hashCode() {
        return HashCodeBuilder.reflectionHashCode(this);
    }

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

    /**
     * {@code DefaultPodSpec} builder static inner class.
     */
    public static final class Builder {
        private final Optional<String> executorUri;

        private String type;
        private String user;
        private Integer count;
        private Boolean allowDecommission = false;
        private String image;
        private PlacementRule placementRule;
        private String preReservedRole = Constants.ANY_ROLE;
        private Collection<NetworkSpec> networks = new ArrayList<>();
        private Collection<RLimitSpec> rlimits =  new ArrayList<>();
        private Collection<URI> uris = new ArrayList<>();
        private List<TaskSpec> tasks = new ArrayList<>();
        private Collection<VolumeSpec> volumes = new ArrayList<>();
        private Collection<SecretSpec> secrets = new ArrayList<>();
        private Boolean sharePidNamespace = false;

        private Builder(Optional<String> executorUri) {
            this.executorUri = executorUri;
        }

        /**
         * Sets the {@code type} and returns a reference to this Builder so that the methods can be chained together.
         *
         * @param type the {@code type} to set
         * @return a reference to this Builder
         */
        public Builder type(String type) {
            this.type = type;
            return this;
        }

        /**
         * Sets the {@code user} and returns a reference to this Builder so that the methods can be chained together.
         *
         * @param user the {@code user} to set
         * @return a reference to this Builder
         */
        public Builder user(String user) {
            this.user = user;
            return this;
        }

        /**
         * Sets the {@code count} and returns a reference to this Builder so that the methods can be chained together.
         *
         * @param count the {@code count} to set
         * @return a reference to this Builder
         */
        public Builder count(Integer count) {
            this.count = count;
            return this;
        }

        /**
         * Sets whether the {@link #count(Integer)} for this pod can ever be decreased in a config update.
         *
         * @param allowDecommission whether the count can be decreased in a config update
         * @return a reference to this Builder
         */
        public Builder allowDecommission(Boolean allowDecommission) {
            this.allowDecommission = allowDecommission != null && allowDecommission;
            return this;
        }

        /**
         * Sets the {@code image} and returns a reference to this Builder so that the methods can be
         * chained together.
         *
         * @param image the {@code image} to set
         * @return a reference to this Builder
         */
        public Builder image(String image) {
            this.image = image;
            return this;
        }

        /**
         * Sets the {@code networks} and returns a reference to this Builder so that the methods can be
         * chained together.
         *
         * @param networks the {@code networks} to set
         * @return a reference to this Builder
         */
        public Builder networks(Collection<NetworkSpec> networks) {
            if (networks == null) {
               this.networks = new ArrayList<>();
            } else {
                this.networks = networks;
            }

            return this;
        }

        /**
         * Sets the {@code rlimits} and returns a reference to this Builder so that the methods can be
         * chained together.
         *
         * @param rlimits the {@code rlimits} to set
         * @return a reference to this Builder
         */
        public Builder rlimits(Collection<RLimitSpec> rlimits) {
            if (rlimits == null) {
                this.rlimits = new ArrayList<>();
            } else {
                this.rlimits = rlimits;
            }

            return this;
        }

        /**
         * Sets the {@code uris} and returns a reference to this Builder so that the methods can be chained together.
         *
         * @param uris the {@code uris} to set
         * @return a reference to this Builder
         */
        public Builder uris(Collection<URI> uris) {
            if (uris == null) {
                this.uris = new ArrayList<>();
            } else {
                this.uris = uris;
            }

            return this;
        }

        /**
         * Adds the {@code uris} and returns a reference to this Builder so that the methods can be chained together.
         *
         * @param uri the {@code uri} to add
         * @return a reference to this Builder
         */
        public Builder addUri(URI uri) {
            this.uris.add(uri);
            return this;
        }

        /**
         * Sets the {@code tasks} and returns a reference to this Builder so that the methods can be chained together.
         *
         * @param tasks the {@code tasks} to set
         * @return a reference to this Builder
         */
        public Builder tasks(List<TaskSpec> tasks) {
            if (tasks == null) {
                this.tasks = new ArrayList<>();
            } else {
                this.tasks = tasks;
            }

            return this;
        }

        /**
         * Adds the {@code task} and returns a reference to this Builder so that the methods can be chained together.
         *
         * @param task the {@code task} to add
         * @return a reference to this Builder
         */
        public Builder addTask(TaskSpec task) {
            this.tasks.add(task);
            return this;
        }

        /**
         * Sets the {@code placementRule} and returns a reference to this Builder so that the methods can be chained
         * together.
         *
         * @param placementRule the {@code placementRule} to set
         * @return a reference to this Builder
         */
        public Builder placementRule(PlacementRule placementRule) {
            this.placementRule = placementRule;
            return this;
        }

        /**
         * Sets the {@code volumes} and returns a reference to this Builder so that the methods can be
         * chained together.
         *
         * @param volumes the {@code volumes} to set
         * @return a reference to this Builder
         */
        public Builder volumes(Collection<VolumeSpec> volumes) {
            if (volumes == null) {
                this.volumes = new ArrayList<>();
            } else {
                this.volumes = volumes;
            }

            return this;
        }

        /**
         * Sets the {@code pre-reserved-role} and returns a reference to this Builder so that the methods can be
         * chained together.
         *
         * @param preReservedRole the {@code preReservedRole} to set
         * @return a reference to this Builder
         */
        public Builder preReservedRole(String preReservedRole) {
            if (preReservedRole == null) {
                this.preReservedRole = Constants.ANY_ROLE;
            } else {
                this.preReservedRole = preReservedRole;
            }

            return this;
        }

        /**
         * Sets the {@code secrets} and returns a reference to this Builder so that the methods can be
         * chained together.
         *
         * @param secrets the {@code secrets} to set
         * @return a reference to this Builder
         */
        public Builder secrets(Collection<SecretSpec> secrets) {
            if (secrets == null) {
                this.secrets = new ArrayList<>();
            } else {
                this.secrets = secrets;
            }

            return this;
        }

        /**
         * Sets whether tasks in this pod share a pid namespace and returns a reference to this Builder so that the
         * methods can be chained together.
         *
         * @param sharePidNamespace whether tasks in this pod share a pid namespace
         * @return a reference to this Builder
         */
        public Builder sharePidNamespace(Boolean sharePidNamespace) {
            this.sharePidNamespace = sharePidNamespace != null && sharePidNamespace;
            return this;
        }

        /**
         * Returns a {@code DefaultPodSpec} built from the parameters previously set.
         *
         * @return a {@code DefaultPodSpec} built with parameters of this {@code DefaultPodSpec.Builder}
         */
        public DefaultPodSpec build() {
            if (executorUri.isPresent()) {
                // Inject the executor URI as one of the pods URIs. This ensures
                // that the scheduler properly tracks changes to executors
                // (reflected in changes to the executor URI)
                URI actualURI = URI.create(executorUri.get());
                if (this.uris == null || !this.uris.contains(actualURI)) {
                    this.addUri(actualURI);
                }
            }

            DefaultPodSpec defaultPodSpec = new DefaultPodSpec(this);
            return defaultPodSpec;
        }
    }
}


text:
package org.hisp.dhis.analytics.table;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Future;

import org.hisp.dhis.analytics.AnalyticsTable;
import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
import org.hisp.dhis.period.PeriodType;
import org.hisp.dhis.system.util.DateUtils;
import org.springframework.scheduling.annotation.Async;

/**
 * @author Lars Helge Overland
 */
public class JdbcCompletenessTableManager
    extends AbstractJdbcTableManager
{
    @Override
    public String validState()
    {
        boolean hasData = jdbcTemplate.queryForRowSet( "select datasetid from completedatasetregistration limit 1" ).next();

        if ( !hasData )
        {
            return "No complete registrations exist, not updating completeness analytics tables";
        }

        return null;
    }

    @Override
    public String getTableName()
    {
        return COMPLETENESS_TABLE_NAME;
    }

    @Override
    public void createTable( AnalyticsTable table )
    {
        final String tableName = table.getTempTableName();

        final String sqlDrop = "drop table " + tableName;

        executeSilently( sqlDrop );

        String sqlCreate = "create table " + tableName + " (";

        List<String[]> columns = getDimensionColumns( table );

        validateDimensionColumns( columns );

        for ( String[] col : columns )
        {
            sqlCreate += col[0] + " " + col[1] + ",";
        }

        sqlCreate += "value date) ";

        sqlCreate += statementBuilder.getTableOptions( false );

        log.info( "Creating table: " + tableName + ", columns: " + columns.size() );

        log.debug( "Create SQL: " + sqlCreate );

        jdbcTemplate.execute( sqlCreate );
    }

    @Override
    @Async
    public Future<?> populateTableAsync( ConcurrentLinkedQueue<AnalyticsTable> tables )
    {
        taskLoop : while ( true )
        {
            AnalyticsTable table = tables.poll();

            if ( table == null )
            {
                break taskLoop;
            }

            final String start = DateUtils.getMediumDateString( table.getPeriod().getStartDate() );
            final String end = DateUtils.getMediumDateString( table.getPeriod().getEndDate() );
            final String tableName = table.getTempTableName();

            String insert = "insert into " + table.getTempTableName() + " (";

            List<String[]> columns = getDimensionColumns( table );

            validateDimensionColumns( columns );

            for ( String[] col : columns )
            {
                insert += col[0] + ",";
            }

            insert += "value) ";

            String select = "select ";

            for ( String[] col : columns )
            {
                select += col[2] + ",";
            }

            select = select.replace( "organisationunitid", "sourceid" ); // Legacy fix TODO remove

            select +=
                "cdr.date as value " +
                "from completedatasetregistration cdr " +
                "left join _organisationunitgroupsetstructure ougs on cdr.sourceid=ougs.organisationunitid " +
                "left join _orgunitstructure ous on cdr.sourceid=ous.organisationunitid " +
                "inner join period pe on cdr.periodid=pe.periodid " +
                "left join _periodstructure ps on cdr.periodid=ps.periodid " +
                "inner join dataset ds on cdr.datasetid=ds.datasetid " +
                "where pe.startdate >= '" + start + "' " +
                "and pe.startdate <= '" + end + "'" +
                "and cdr.date is not null";

            final String sql = insert + select;

            populateAndLog( sql, tableName );
        }

        return null;
    }

    @Override
    public List<String[]> getDimensionColumns( AnalyticsTable table )
    {
        List<String[]> columns = new ArrayList<>();

        Collection<OrganisationUnitGroupSet> orgUnitGroupSets =
            idObjectManager.getDataDimensionsNoAcl( OrganisationUnitGroupSet.class );

        Collection<OrganisationUnitLevel> levels =
            organisationUnitService.getFilledOrganisationUnitLevels();

        for ( OrganisationUnitGroupSet groupSet : orgUnitGroupSets )
        {
            String[] col = { quote( groupSet.getUid() ), "character(11)", "ougs." + quote( groupSet.getUid() ) };
            columns.add( col );
        }

        for ( OrganisationUnitLevel level : levels )
        {
            String column = quote( PREFIX_ORGUNITLEVEL + level.getLevel() );
            String[] col = { column, "character(11)", "ous." + column };
            columns.add( col );
        }

        for ( PeriodType periodType : PeriodType.getAvailablePeriodTypes() )
        {
            String column = quote( periodType.getName().toLowerCase() );
            String[] col = { column, "character varying(15)", "ps." + column };
            columns.add( col );
        }

        String[] ds = { quote( "dx" ), "character(11) not null", "ds.uid" };

        columns.add( ds );

        return columns;
    }

    @Override
    public List<Integer> getDataYears( Date earliest )
    {
        String sql =
            "select distinct(extract(year from pe.startdate)) " +
            "from completedatasetregistration cdr " +
            "inner join period pe on cdr.periodid=pe.periodid " +
            "where pe.startdate is not null ";

        if ( earliest != null )
        {
            sql += "and pe.startdate >= '" + DateUtils.getMediumDateString( earliest ) + "'";
        }

        return jdbcTemplate.queryForList( sql, Integer.class );
    }

    @Override
    @Async
    public Future<?> applyAggregationLevels( ConcurrentLinkedQueue<AnalyticsTable> tables, Collection<String> dataElements, int aggregationLevel )
    {
        return null; // Not relevant
    }

    @Override
    @Async
    public Future<?> vacuumTablesAsync( ConcurrentLinkedQueue<AnalyticsTable> tables )
    {
        return null; // Not needed
    }
}


text:
namespace content {

HistogramsMonitor::HistogramsMonitor() = default;

HistogramsMonitor::~HistogramsMonitor() = default;

void HistogramsMonitor::StartMonitoring(const std::string& query) {
  query_ = query;
  FetchHistograms();
  histograms_snapshot_.clear();
  // Save a snapshot of all current histograms that will be used as a baseline.
  for (const auto* const histogram : base::StatisticsRecorder::WithName(
           base::StatisticsRecorder::GetHistograms(), query_)) {
    histograms_snapshot_[histogram->histogram_name()] =
        histogram->SnapshotSamples();
  }
}

base::ListValue HistogramsMonitor::GetDiff() {
  FetchHistograms();
  base::StatisticsRecorder::Histograms histograms =
      base::StatisticsRecorder::Sort(base::StatisticsRecorder::WithName(
          base::StatisticsRecorder::GetHistograms(), query_));
  return GetDiffInternal(histograms);
}

void HistogramsMonitor::FetchHistograms() {
  base::StatisticsRecorder::ImportProvidedHistograms();
  HistogramSynchronizer::FetchHistograms();
}

base::ListValue HistogramsMonitor::GetDiffInternal(
    const base::StatisticsRecorder::Histograms& histograms) {
  base::ListValue histograms_list;
  for (const base::HistogramBase* const histogram : histograms) {
    std::unique_ptr<base::HistogramSamples> snapshot =
        histogram->SnapshotSamples();
    auto it = histograms_snapshot_.find(histogram->histogram_name());
    if (it != histograms_snapshot_.end()) {
      snapshot->Subtract(*it->second.get());
    }
    if (snapshot->TotalCount() > 0) {
      base::Value histogram_dict = snapshot->ToGraphDict(
          histogram->histogram_name(), histogram->flags());
      histograms_list.Append(std::move(histogram_dict));
    }
  }
  return histograms_list;
}

}  // namespace content


text:
/*
Description: The script is used to check for the existence of a file path in a given set of properties
             and to load and store these files in the Storage Manager.
Filename:asset.storage.injector.js
Created Date: 27/9/2013
 */

var injector=function(){

    var log=new Log('asset.storage.injector');
    var utility=require('/modules/utility.js').utility();
    var dataInjectModule=require('/modules/data/data.injector.js').dataInjectorModule();
    var modes=dataInjectModule.Modes;
    var config=require('/config/storage.json');

    /*
    The function performs any initialization logic.It is invoked only once when the handler is assembled
    @context: The context which will be used in handling requests
     */
    function init(context){
          context['config']=config;
    }

    /*
     The modes in which the handler should be executed
     @return: The operation mode in which the handler should be executed
     */
    function operationModes(){
       return modes.STORAGE;
    }

    /*
    The function checks whether the provided object should be processed by the
    the injector
    @object: The object to be checked for a match
    return: True if the object is handled,else false
     */
    function isHandled(object){

        //We check for the exsistence of an attributes property
        if(object.hasOwnProperty('attributes')){
            return true;
        }

        log.debug('the object: '+stringify(object)+' is not handled.');
    }

    /*
    The function extracts a set of targeted properties, if they contain a
    local file path it is added to the storage
    @context: The context data to handle a particular field
    @return: True, if handled successfully,else false
     */
    function handle(context){
        var object=context.object||{};
        var config=context.config;
        var fields=config.storeFields;
        var field;
        var uuid;
        var path;

        for(var index in fields){

            //Current field been examined
            field=fields[index];

            utility.isPresent(object.attributes,field,function(){

                //Get the value of the current field
                path=object.attributes[field];

                //Attempt to store
                uuid=addToStorage(path,context);

                //Update value
                if(uuid){
                    object.attributes[field]=uuid;
                }
            });
        }

        log.debug(object);

        return true;
    }
    /*
    The function attempts to add the provided path to the storage if it is present
    and returns a uuid
    @path: A path to a resource
    @return: If the file is added to storage then a uuid is returned,else null
     */
    function addToStorage(path,context){
        var file=new File(path);
        var uuid=null;

        //Only add it storage if it is a valid path and get the uuid
        if(file.isExists()){
            log.debug('loaded resource '+path+' into storage.');
            uuid=useStorageManager(path,file,context);
        }

        return uuid
    }

    function useStorageManager(path,file,context){

        var path=path;

        //Only store it if the storage manager exists
        if(context.storageManager){

            var resource={};
            resource['file']=file;
            resource['contentType']=determineContentType(file);

            //Get the uuid/filename
            path=context.storageManager.put(resource);

        }

        return path;
    }

    function determineContentType(file){
        var extension=utility.fileio.getExtension(file);
        return utility.fileio.getContentType(extension);
    }

    return{
        init:init,
        operationModes:operationModes,
        isHandled:isHandled,
        handle:handle
    };
};


text:
package net.roboconf.target.api;

import java.util.Iterator;
import java.util.Set;

import org.junit.Assert;
import net.roboconf.target.api.AbstractThreadedTargetHandler.CancelledMachines;

import org.junit.Test;

/**
 * @author Vincent Zurczak - Linagora
 */
public class CancelledMachinesTest {

	@Test
	public void testWorkflow() {

		CancelledMachines cm = new CancelledMachines();
		Assert.assertEquals( 0, cm.removeSnapshot().size());

		cm.addMachineId( "test1" );
		Set<String> snapshot = cm.removeSnapshot();
		Assert.assertEquals( 1, snapshot.size());
		Assert.assertEquals( "test1", snapshot.iterator().next());

		cm.addMachineId( "test2" );
		cm.addMachineId( "test3" );
		snapshot = cm.removeSnapshot();
		Assert.assertEquals( 2, snapshot.size());

		Iterator<String> it = snapshot.iterator();
		Assert.assertEquals( "test2", it.next());
		Assert.assertEquals( "test3", it.next());

		Assert.assertEquals( 0, cm.removeSnapshot().size());
	}
}


text:
namespace ConDep.Dsl
{
    public interface IOfferIisAppPoolIdentityOptions
    {
        /// <summary>
        /// Configures the application pool to run as the built-in account NetworkService.
        /// In IIS 7, this is the default (not IIS 7.5 and above, which has  ApplicationPoolIdentity
        /// as default).
        /// </summary>
        /// <returns></returns>
        IOfferIisAppPoolOptions NetworkService();

        /// <summary>
        /// Configures the application pool to run as the built-in account LocalService.
        /// </summary>
        /// <returns></returns>
        IOfferIisAppPoolOptions LocalService();

        /// <summary>
        /// Configures the application pool to run as the built-in account LocalSystem.
        /// </summary>
        /// <returns></returns>
        IOfferIisAppPoolOptions LocalSystem();

        /// <summary>
        /// Configures the application pool to run as the built-in account ApplicationPoolIdentity.
        /// In IIS 7.5 and above this is the default.
        /// </summary>
        /// <returns></returns>
        IOfferIisAppPoolOptions ApplicationPoolIdentity();

        /// <summary>
        /// Configures the application pool to run as a custom account. Provide a local or domain user,
        /// together with the password.
        /// </summary>
        /// <returns></returns>
        IOfferIisAppPoolOptions SpecificUser(string username, string password);
    }
}


text:
package com.att.cadi.client;

import java.security.Principal;

import com.att.cadi.SecuritySetter;
import com.att.cadi.config.SecurityInfoC;
import com.att.cadi.principal.BasicPrincipal;
import com.att.cadi.principal.TGuardPrincipal;
import com.att.cadi.principal.TrustPrincipal;

public abstract class AbsTransferSS<CLIENT> implements SecuritySetter<CLIENT> {
	protected String value;
	protected SecurityInfoC<CLIENT> securityInfo;
	protected SecuritySetter<CLIENT> defSS;
	private Principal principal;

	//Format:<ID>:<APP>:<protocol>[:AS][,<ID>:<APP>:<protocol>]*
	public AbsTransferSS(Principal principal, String app) {
		init(principal, app);
	}

	public AbsTransferSS(Principal principal, String app, SecurityInfoC<CLIENT> si) {
		init(principal,app);
		securityInfo = si;
		this.defSS = si.defSS;
	}

	private void init(Principal principal, String app)  {
		this.principal=principal;
		if(principal==null) {
			return;
		} else if(principal instanceof BasicPrincipal) {
			value = principal.getName() + ':' + app + ":BasicAuth:AS";
		} else if(principal instanceof TrustPrincipal) {
			TrustPrincipal tp = (TrustPrincipal)principal;
			// recursive
			init(tp.original(),app);
			value += principal.getName() + ':' + app + ":Trust:AS" + ',' + tp.userChain();
		} else if(principal instanceof TGuardPrincipal) {
			value = principal.getName() + ':' + app + ":TGUARD:AS";
		}
	}

	/* (non-Javadoc)
	 * @see com.att.cadi.SecuritySetter#getID()
	 */
	@Override
	public String getID() {
		return principal==null?"":principal.getName();
	}
}


text:
    Radio

        <input ref="input" name="data[radio][undefined-radio]" type="radio" class="form-check-input" lang="en" value="" checked=true id="-radio--">


text:
import config
from .base import *

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

# Database
# https://docs.djangoproject.com/en/1.9/ref/settings/#databases

DATABASES = {
    'default': config.database_default
}


text:
class Current
  include FactoryGirl::Syntax::Methods

  class << self
    def reload!
      @instance = new
    end

    def instance
      @instance ||= new
    end

    def method_missing(name, *args)
      instance.respond_to?(name) ? instance.send(name, *args) : super
    end
  end

  FACTORIES = [
    :user, :character
  ]

  FACTORIES.each do |type|
    class_eval <<-EOF
      def #{type}
        @#{type} ||= create :#{type}
      end
    EOF
  end
end

RSpec.configure do |config|
  config.before :each do
    Current.reload!
  end
end


text:
#include <stdio.h>

#include "wsdd_param.h"
#include "net_utils.h"

/*
 * This function converts the template parameter (option) --xaddr
 * to final URL for the ONVIF service. If this option is specified on the command line
 * does not contain a template parameter %s function snprintf() just make a copy in a static array.
 * If option contains template parameter %s, it will be replaced by
 * IP addres of Network interface specified by --if_name option.
 *
 * Example:
 * ./wsdd --xaddr "http://192.168.1.1:2000/onvif/device_service" - will not be changed
 *
 * ./wsdd --xaddr "http://%s:2000/onvif/device_service" --if_name eth1
 * template %s will be replaced to the IP address of the network interface eth1
*/
const char* get_xaddr(struct wsdd_param_t *wsdd_param)
{
    static char xaddr[128];
    char ip[INET_ADDRSTRLEN];

    if( get_ip_of_if(wsdd_param->if_name, AF_INET, ip) == 0 )
    {
        snprintf(xaddr, sizeof(xaddr), wsdd_param->xaddr, ip);
    }
    else
    {
        snprintf(xaddr, sizeof(xaddr), wsdd_param->xaddr, "127.0.0.1");
    }

    return xaddr;
}

const char* get_rand_endpoint(struct soap *soap_srv)
{
    static char tmp[48];      //UUID "urn:uuid:xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"

    const char *random_UUID = soap_wsa_rand_uuid(soap_srv);

    if(!random_UUID)
        return NULL;

    snprintf(tmp, sizeof(tmp), "%s", random_UUID);

    return tmp;
}

void send_hello(struct soap *soap_srv, struct wsdd_param_t *wsdd_param)
{
    int res = soap_wsdd_Hello(soap_srv,
                              SOAP_WSDD_ADHOC,             // mode
                              SOAP_WSDD_TS_ADDRESS,        // address of TS
                              soap_wsa_rand_uuid(soap_srv),// message ID
                              NULL,
                              wsdd_param->endpoint,
                              wsdd_param->type,
                              wsdd_param->scope,
                              NULL,
                              get_xaddr(wsdd_param),
                              wsdd_param->metadata_ver);

    if(res == SOAP_OK)
        soap_wsdd_listen(soap_srv, 1);
    else
        soap_print_fault(soap_srv, stderr);
}

void send_bye(struct soap *soap_srv, struct wsdd_param_t *wsdd_param)
{
    int res = soap_wsdd_Bye(soap_srv,
                            SOAP_WSDD_ADHOC,             // mode
                            SOAP_WSDD_TS_ADDRESS,        // address of TS
                            soap_wsa_rand_uuid(soap_srv),// message ID
                            wsdd_param->endpoint,
                            wsdd_param->type,
                            wsdd_param->scope,
                            NULL,
                            get_xaddr(wsdd_param),
                            wsdd_param->metadata_ver);

    if(res == SOAP_OK)
        soap_wsdd_listen(soap_srv, 1);
    else
        soap_print_fault(soap_srv, stderr);
}


text:
require 'test_helper'

module HandlebarsAssets
  class CompilingTest < Test::Unit::TestCase

    def teardown
      HandlebarsAssets::Config.reset!
      HandlebarsAssets::Handlebars.reset!
    end

    def test_custom_handlebars
      source = "This is {{handlebars}}"

      HandlebarsAssets::Config.compiler_path = File.expand_path '../../edge', __FILE__

      compiled = Handlebars.precompile(source, HandlebarsAssets::Config.options)
      assert_match /PRECOMPILE CALLED/, compiled
    end

    def test_patching_handlebars
      source = "This is {{nested.handlebars}}"

      HandlebarsAssets::Config.patch_path = File.expand_path '../../patch', __FILE__
      HandlebarsAssets::Config.patch_files = ['patch.js']

      compiled = Handlebars.precompile(source, HandlebarsAssets::Config.options)
      assert_match /CALLED PATCH/, compiled
    end
  end
end


text:
AGENT_ROOT=$VOLTTRON_ROOT/applications/kisensum/Simulation/SimulationDriverAgent

cd $VOLTTRON_ROOT

volttron-ctl config store simulation.driver simload.csv $AGENT_ROOT/simload.csv --csv
volttron-ctl config store simulation.driver devices/campus1/building1/simload $AGENT_ROOT/simload.config

volttron-ctl config store simulation.driver simmeter.csv $AGENT_ROOT/simmeter.csv --csv
volttron-ctl config store simulation.driver devices/campus1/building1/simmeter $AGENT_ROOT/simmeter.config

volttron-ctl config store simulation.driver simpv.csv $AGENT_ROOT/simpv.csv --csv
volttron-ctl config store simulation.driver devices/campus1/building1/simpv $AGENT_ROOT/simpv.config

volttron-ctl config store simulation.driver simstorage.csv $AGENT_ROOT/simstorage.csv --csv
volttron-ctl config store simulation.driver devices/campus1/building1/simstorage $AGENT_ROOT/simstorage.config

echo
echo Simulation drivers configured:
volttron-ctl config list simulation.driver


text:
echo "running bwaves..."

./bwaves_base.arm-v7a 2>> bwaves.err

echo "bwaves done"


text:
package com.skcraft.plume.module.perf;

import ninja.leaping.configurate.objectmapping.Setting;
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;

class SensibleNumbersConfig {

    @Setting(comment = "Configure the creature quotas used in the vanilla creature spawner")
    public CreatureQuotas quotas = new CreatureQuotas();

    @Setting(comment = "Limit mob spawning based on the number of existing mobs in the nearby area")
    public RadiusHardLimit radiusHardLimit = new RadiusHardLimit();

    @ConfigSerializable
    public static class CreatureQuotas {
        @Setting
        public int monster = 70;
        @Setting
        public int animal = 10;
        @Setting
        public int ambient = 15;
        @Setting
        public int water = 5;
    }

    @ConfigSerializable
    public static class RadiusHardLimit {
        @Setting(comment = "Enable to attempt to block spawning entities based on radius")
        public boolean enabled = false;

        @Setting
        public CountPerRadius zombie = new CountPerRadius(2, 5);
        @Setting
        public CountPerRadius skeleton = new CountPerRadius(2, 5);
        @Setting
        public CountPerRadius creeper = new CountPerRadius(2, 5);
        @Setting
        public CountPerRadius spider = new CountPerRadius(2, 5);
        @Setting
        public CountPerRadius enderman = new CountPerRadius(2, 5);
        @Setting
        public CountPerRadius witch = new CountPerRadius(2, 5);
        @Setting
        public CountPerRadius squid = new CountPerRadius(1, 5);
        @Setting
        public CountPerRadius sheep = new CountPerRadius(5, 5);
        @Setting
        public CountPerRadius pig = new CountPerRadius(5, 5);
        @Setting
        public CountPerRadius cow = new CountPerRadius(5, 5);
        @Setting
        public CountPerRadius chicken = new CountPerRadius(5, 5);
        @Setting
        public CountPerRadius pet = new CountPerRadius(5, 5);
    }

    @ConfigSerializable
    public static class CountPerRadius {
        @Setting
        public int limit = 10;
        @Setting
        public int radius = 1;

        public CountPerRadius() {
        }

        public CountPerRadius(int limit, int radius) {
            this.limit = limit;
            this.radius = radius;
        }
    }

}


text:
/*
 * MIT License http://opensource.org/licenses/MIT
 * Author: Ben Holloway @bholloway
 */
'use strict';

var path              = require('path'),
    fs                = require('fs'),
    loaderUtils       = require('loader-utils'),
    rework            = require('rework'),
    visit             = require('rework-visit'),
    convert           = require('convert-source-map'),
    camelcase         = require('camelcase'),
    defaults          = require('lodash.defaults'),
    SourceMapConsumer = require('source-map').SourceMapConsumer;

var findFile           = require('./lib/find-file'),
    absoluteToRelative = require('./lib/sources-absolute-to-relative'),
    adjustSourceMap    = require('adjust-sourcemap-loader/lib/process');

var PACKAGE_NAME = require('./package.json').name;

/**
 * A webpack loader that resolves absolute url() paths relative to their original source file.
 * Requires source-maps to do any meaningful work.
 * @param {string} content Css content
 * @param {object} sourceMap The source-map
 * @returns {string|String}
 */
function resolveUrlLoader(content, sourceMap) {
  /* jshint validthis:true */

  // details of the file being processed
  var loader   = this,
      filePath = path.dirname(loader.resourcePath);

  // prefer loader query, else options object, else default values
  var options = defaults(loaderUtils.parseQuery(loader.query), loader.options[camelcase(PACKAGE_NAME)], {
    absolute : false,
    sourceMap: false,
    fail     : false,
    silent   : false,
    keepQuery: false,
    debug    : false,
    root     : null
  });

  // validate root directory
  var resolvedRoot = (typeof options.root === 'string') && path.resolve(options.root) || undefined,
      isValidRoot  = resolvedRoot && fs.existsSync(resolvedRoot);
  if (options.root && !isValidRoot) {
    return handleException('"root" option does not resolve to a valid path');
  }

  // loader result is cacheable
  loader.cacheable();

  // incoming source-map
  var sourceMapConsumer, contentWithMap, sourceRoot;
  if (sourceMap) {

    // support non-standard string encoded source-map (per less-loader)
    if (typeof sourceMap === 'string') {
      try {
        sourceMap = JSON.parse(sourceMap);
      }
      catch (exception) {
        return handleException('source-map error', 'cannot parse source-map string (from less-loader?)');
      }
    }

    // Note the current sourceRoot before it is removed
    //  later when we go back to relative paths, we need to add it again
    sourceRoot = sourceMap.sourceRoot;

    // leverage adjust-sourcemap-loader's codecs to avoid having to make any assumptions about the sourcemap
    //  historically this is a regular source of breakage
    var absSourceMap;
    try {
      absSourceMap = adjustSourceMap(this, {format: 'absolute'}, sourceMap);
    }
    catch (exception) {
      return handleException('source-map error', exception.message);
    }

    // prepare the adjusted sass source-map for later look-ups
    sourceMapConsumer = new SourceMapConsumer(absSourceMap);

    // embed source-map in css for rework-css to use
    contentWithMap = content + convert.fromObject(absSourceMap).toComment({multiline: true});
  }
  // absent source map
  else {
    contentWithMap = content;
  }

  // process
  //  rework-css will throw on css syntax errors
  var useMap = loader.sourceMap || options.sourceMap,
      reworked;
  try {
    reworked = rework(contentWithMap, {source: loader.resourcePath})
      .use(reworkPlugin)
      .toString({
        sourcemap        : useMap,
        sourcemapAsObject: useMap
      });
  }
    //  fail gracefully
  catch (exception) {
    return handleException('CSS error', exception);
  }

  // complete with source-map
  if (useMap) {

    // source-map sources seem to be relative to the file being processed
    absoluteToRelative(reworked.map.sources, path.resolve(filePath, sourceRoot || '.'));

    // Set source root again
    reworked.map.sourceRoot = sourceRoot;

    // need to use callback when there are multiple arguments
    loader.callback(null, reworked.code, reworked.map);
  }
  // complete without source-map
  else {
    return reworked;
  }

  /**
   * Push an error for the given exception and return the original content.
   * @param {string} label Summary of the error
   * @param {string|Error} [exception] Optional extended error details
   * @returns {string} The original CSS content
   */
  function handleException(label, exception) {
    var rest = (typeof exception === 'string') ? [exception] :
               (exception instanceof Error) ? [exception.message, exception.stack.split('\n')[1].trim()] :
               [];
    var message = '  resolve-url-loader cannot operate: ' + [label].concat(rest).filter(Boolean).join('\n  ');
    if (options.fail) {
      loader.emitError(message);
    }
    else if (!options.silent) {
      loader.emitWarning(message);
    }
    return content;
  }

  /**
   * Plugin for css rework that follows SASS transpilation
   * @param {object} stylesheet AST for the CSS output from SASS
   */
  function reworkPlugin(stylesheet) {
    var URL_STATEMENT_REGEX = /(url\s*\()\s*(?:(['"])((?:(?!\2).)*)(\2)|([^'"](?:(?!\)).)*[^'"]))\s*(\))/g;

    // visit each node (selector) in the stylesheet recursively using the official utility method
    //  each node may have multiple declarations
    visit(stylesheet, function visitor(declarations) {
      if (declarations) {
        declarations
          .forEach(eachDeclaration);
      }
    });

    /**
     * Process a declaration from the syntax tree.
     * @param declaration
     */
    function eachDeclaration(declaration) {
      var isValid = declaration.value && (declaration.value.indexOf('url') >= 0),
          directory;
      if (isValid) {

        // reverse the original source-map to find the original sass file
        var startPosApparent = declaration.position.start,
            startPosOriginal = sourceMapConsumer && sourceMapConsumer.originalPositionFor(startPosApparent);

        // we require a valid directory for the specified file
        directory = startPosOriginal && startPosOriginal.source && path.dirname(startPosOriginal.source);
        if (directory) {

          // allow multiple url() values in the declaration
          //  split by url statements and process the content
          //  additional capture groups are needed to match quotations correctly
          //  escaped quotations are not considered
          declaration.value = declaration.value
            .split(URL_STATEMENT_REGEX)
            .map(eachSplitOrGroup)
            .join('');
        }
        // source-map present but invalid entry
        else if (sourceMapConsumer) {
          throw new Error('source-map information is not available at url() declaration');
        }
      }

      /**
       * Encode the content portion of url() statements.
       * There are 4 capture groups in the split making every 5th unmatched.
       * @param {string} token A single split item
       * @param i The index of the item in the split
       * @returns {string} Every 3 or 5 items is an encoded url everything else is as is
       */
      function eachSplitOrGroup(token, i) {
        var BACKSLASH_REGEX = /\\/g;

        // we can get groups as undefined under certain match circumstances
        var initialised = token || '';

        // the content of the url() statement is either in group 3 or group 5
        var mod = i % 7;
        if ((mod === 3) || (mod === 5)) {

          // split into uri and query/hash and then find the absolute path to the uri
          var split    = initialised.split(/([?#])/g),
              uri      = split[0],
              absolute = uri && findFile(options).absolute(directory, uri, resolvedRoot),
              query    = options.keepQuery ? split.slice(1).join('') : '';

          // use the absolute path (or default to initialised)
          if (options.absolute) {
            return absolute && absolute.replace(BACKSLASH_REGEX, '/').concat(query) || initialised;
          }
          // module relative path (or default to initialised)
          else {
            var relative     = absolute && path.relative(filePath, absolute),
                rootRelative = relative && loaderUtils.urlToRequest(relative, '~');
            return (rootRelative) ? rootRelative.replace(BACKSLASH_REGEX, '/').concat(query) : initialised;
          }
        }
        // everything else, including parentheses and quotation (where present) and media statements
        else {
          return initialised;
        }
      }
    }
  }
}

module.exports = resolveUrlLoader;


text:
/**
 *
 */
package logica;

/**
 * @author Alexander
 * La clase Cliente.java esta encargada de representar un cliente de libros.
 */
public class Cliente extends ThreadSocket {

	/**
	 *
	 * Constructor de la clase Conexion.java.
	 */
	public Cliente(String ip, int puerto) {
		super(ip, puerto);
	}

	@Override
	public void gestionarComunicacion(String opcion){
		System.out.println(opcion);
	}
}


text:
import os
import base64
import logging
import datetime
from cryptography.fernet import Fernet
from selenium import  webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys

def main():
    logging.getLogger("selenium").setLevel(logging.INFO)
    try:
        path = os.environ['AD_LOG_PATH']
    except KeyError:
        path = ''
    logging.basicConfig(filename=path+'adrenalin.log', format='%(levelname)s:%(message)s', level=logging.DEBUG)
    logging.info('================================================================================')
    logging.info('################# Started On %s  #################', datetime.datetime.now())

class AdrenalinLogin():
    """
    Class to login Adrenalin
    """
    def __init__(self, url):
        self.browser = webdriver.Chrome(executable_path='/usr/lib/chromium-browser/chromedriver')
        self.browser.get("http://10.1.1.209/adrenalin/")
        self.userid_field = self.browser.find_element_by_id("txtID")
        self.pass_field = self.browser.find_element_by_id("txtPwd")

    def login(self, userid, password):
        self.userid_field.send_keys(userid)
        self.pass_field.send_keys(password)
        self.pass_field.send_keys(Keys.ENTER)
        delay = 3 #seconds
        try:
            WebDriverWait(self.browser, delay).until(EC.presence_of_element_located((By.ID, "btnOK")))
            logging.info("'OK button' located and clicked.")
            print("Page is ready!")
        except TimeoutException:
            logging.info("Timeout while locating 'OK button'.")
        except NoSuchElementException:
            logging.info("Not able to locate 'OK button'.")
        try:
            WebDriverWait(self.browser, delay).until(EC.presence_of_element_located((By.ID, "lblExit"))).click()
            logging.info("'Exit button' located and clicked.")
        except TimeoutException:
            logging.info("Timeout while locating 'Exit button'.")
        except NoSuchElementException:
            logging.info("Not able to locate 'Exit button'.")

def get_password(secret_key):
    cipher_suite = Fernet(secret_key.encode(encoding="UTF-8"))
    return (cipher_suite.decrypt(HASH.encode(encoding="UTF-8"))).decode(encoding="UTF-8")

if __name__ == "__main__":
    main()
    try:
        HASH = os.environ['AD_PASS_HASH']
        SECRET = os.environ['AD_SEC_KEY']
        EMP_ID = os.environ['AD_EMP_ID']
        AD_URL = os.environ['AD_URL']
    except KeyError as key:
        logging.info('%s key is not found environment variable.', key)
        logging.info('################# Finished On %s #################', datetime.datetime.now())
    adrenalin_url = "http://10.1.1.209/adrenalin/"
    obj = AdrenalinLogin(AD_URL)
        logging.info('================================================================================')
    obj.login(EMP_ID, get_password(SECRET))
    logging.info('################# Finished On %s #################', datetime.datetime.now())
    logging.info('================================================================================')


text:
**Last Updated:** 06/16/2017

## Overview

-	**Data Source:** US Department of Transportation Roadway Data

-	**Input:** EXPest, latitude/longitude for resident location

-	**Output:** absolute distance (meters); categorical score, ranging from 1 (far from road) to 5 (close to road)

Roadways are classified in a variety of ways. For our purposes, we'll focus on major roads (i.e., primary urban roads and arterial roads with medium to large traffic capacity) and highways (expressways and primary and secondary highways) and calculate distance between home residence and major road/highway in meters [4]

Note that several authors [e.g., 4] have used the ArcGIS online mapping program to calculate distance

Exposure scores calculated [1,3,4] as:

```
1 = if home residence >300 meters from major road/highway
2 = if home residence 201-300 meters from major road/highway
3 = if home residence 101-200 meters from major road/highway
4 = if home residence 50-100 meters from major road/highway
5 = of home residence <50 meters from major road/highway
```

**Caveat:** This approach is restricted to primary home residence and does not account for exposure to secondary or connecting roads

**Caveat:** The approach could be adapted to account for locations other than home residence (e.g., school, workplace)

## References

https://github.com/mjstealey/datatranslator/blob/develop/exposure_docs/references.md

https://github.com/mjstealey/exposures-api/blob/develop/exposure_docs/references2.md

## Implemented as

Code:

•	python-flask-server/exposures/pm25.py

## Details:

•	TODO