text:
<!doctype html>

    <meta charset="utf-8">
    <title>Bouncy Circles</title>

Downloading...

      <progress value="0" max="100" id="progress" hidden=1></progress>

      <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>

    <textarea id="output" rows="8"></textarea>

redpajama_set_name: RedPajamaGithub


text:
class Ability
  include CanCan::Ability

  def initialize(user)
    user ||= User.new

    # Admin
    can :read, ActiveAdmin::Page, :name => "Dashboard"
    can :manage_site do
      user.is_admin
    end

    # Circles
    can :create, Circle
    can :read,   Circle do |circle|
      circle.users.active.include? user
    end

    can :manage, Circle do |circle|
      circle.admins.active.include? user
    end

    can :create_task, Circle do |circle|
      can?(:manage, circle) or
      user.working_group_roles.admin.for_circle(circle).exists?
    end
    cannot :create_task, Circle do |circle|
      circle.working_groups.count == 0
    end

    can :create_supply, Circle do |circle|
      can?(:manage, circle) or
      user.working_group_roles.admin.for_circle(circle).exists?
    end
    cannot :create_supply, Circle do |circle|
      circle.working_groups.count == 0
    end

    can :create_group, Circle do |circle|
      can?(:manage, circle)
    end

    can :create_item, Circle do |circle|
      can?(:create_task, circle) or
      can?(:create_supply, circle)
    end
    cannot :create_item, Circle do |circle|
      !can?(:create_task, circle)
    end

    can :delete, Circle::Role do |role|
      can?(:manage, role.circle)
      if role.role_type == 'circle.admin'
        can?(:manage, role.circle) &&
        role.circle.admins.active.count > 1
      else
        can?(:manage, role.circle)
      end
    end

    # Users
    can :read, User do |member, circle|
      member.id == user.id ||
      (can?(:read, circle) &&
        (user.working_group_roles.admin.for_circle(circle).exists? ||
          circle.admins.include?(user) ||
          member.public_profile?))
    end

    # Work Groups
    can :read, WorkingGroup do |wg|
      if wg.is_private?
        can?(:manage, wg.circle) ||
          wg.users.include?(user)
      else
        can?(:read, wg.circle)
      end
    end

    can :manage, WorkingGroup do |wg|
      can?(:manage, wg.circle) ||
      wg.admins.active.include?(user)
    end

    can :create_task, WorkingGroup do |wg|
      can?(:manage, wg)
    end

    can :join, WorkingGroup do |wg|
      can?(:read, wg)
    end
    cannot :join, WorkingGroup do |wg|
      wg.users.include?(user)
    end

    can :leave, WorkingGroup do |wg|
      cannot?(:join, wg)
    end
    cannot :leave, WorkingGroup do |wg|
      can?(:join, wg)
    end

    # Tasks
    can :read, Task do |task|
      can?(:read, task.working_group)
    end

    can :manage, Task do |task|
      task.organizers.include?(user) or
      can?(:manage, task.working_group) or
      can?(:manage, task.circle)
    end
    cannot :delete, Task do |task|
      !task.persisted?
    end

    can :volunteer, Task do |task|
      can?(:read, task)
    end
    cannot :volunteer, Task do |task|
      task.complete? or task.volunteers.include?(user)
    end

    can :decline, Task do |task|
      task.volunteers.include?(user)
    end
    cannot :decline, Task do |task|
      task.complete?
    end

    can :invite_to, Task do |task|
      can?(:manage, task)
    end
    cannot :invite_to, Task do |task|
      task.complete?
    end

    can :complete, Task do |task|
      task.due_date < Time.now and (
        task.volunteers.include?(user) or
        task.organizers.include?(user)
      ) or
      can?(:manage, task.working_group) or
      can?(:manage, task.circle)
    end
    cannot :complete, Task do |task|
      task.complete?
    end

    can :reopen, Task do |task|
      task.complete? and ((
      task.volunteers.include?(user) or
          task.organizers.include?(user)
      ) or
          can?(:manage, task.working_group) or
          can?(:manage, task.circle))
    end
    cannot :reopen, Task do |task|
      task.incomplete?
    end

    # Supply
    can :read, Supply do |supply|
      can?(:read, supply.working_group)
    end

    can :manage, Supply do |supply|
      supply.organizers.include?(user) or
      can?(:manage, supply.working_group) or
      can?(:manage, supply.circle)
    end
    cannot :delete, Supply do |supply|
      !supply.persisted?
    end

    can :volunteer, Supply do |supply|
      can?(:read, supply)
    end
    cannot :volunteer, Supply do |supply|
      supply.complete? or supply.volunteers.include?(user)
    end

    can :decline, Supply do |supply|
      supply.volunteers.include?(user)
    end

    can :volunteer, Supply do |supply|
      can?(:read, supply)
    end
    cannot :volunteer, Supply do |supply|
      supply.complete? or supply.volunteers.present?
    end

    can :decline, Supply do |supply|
      supply.volunteers.include?(user)
    end
    cannot :decline, Supply do |supply|
      supply.complete? or supply.volunteers.empty?
    end

    can :complete, Supply do |supply|
      supply.due_date < Time.now and (
        supply.volunteers.include?(user) or
        supply.organizers.include?(user)
      ) or
      can?(:manage, supply.working_group) or
      can?(:manage, supply.circle)
    end
    cannot :complete, Supply do |supply|
      supply.complete?
    end

    can :invite_to, Supply do |supply|
      can?(:manage, supply)
    end
    cannot :invite_to, Supply do |supply|
      supply.complete? || supply.volunteer.present?
    end

    # Comments
    can :create, Comment do |comment|
      user.circles.include?(comment.task.circle)
    end
  end
end


text:
#ifndef _paintown_gradient_h
#define _paintown_gradient_h

#include "bitmap.h"
#include <stdint.h>

class Token;

namespace Effects{

class Gradient{
public:
    Gradient();
    Gradient(Graphics::Color singleColor);
    Gradient(int size, Graphics::Color startColor, Graphics::Color endColor);
    Gradient(const Gradient & copy);
    Gradient(const Token * token);

    Gradient & operator=(const Gradient & copy);

    /* move to next color. update is an alias for `forward' */
    void update();
    void forward();
    void backward();

    /* start at startColor */
    void reset();

    /* get current color */
    Graphics::Color current() const;
    Graphics::Color current(int offset) const;

    virtual ~Gradient();

protected:
    Graphics::Color * colors;
    uint32_t size;
    uint32_t index;
};

}

#endif


text:
package processes.monadTransformers.scalaz

import processes.PatchAssignmentSpec

class EnhancedSpec extends PatchAssignmentSpec(
    "Scalaz enhanced monad transformers",
    s => new Enhanced(s)
)


text:
<bill session="115" type="s" number="961" updated="2017-10-06T04:50:26Z">
  <state datetime="2017-04-27">REFERRED</state>
  <status>
    <introduced datetime="2017-04-27"/>
  </status>
  <introduced datetime="2017-04-27"/>
  <titles>
    <title type="short" as="introduced">Using Evidence to Move Welfare Recipients into Work Act</title>
    <title type="short" as="introduced">Using Evidence to Move Welfare Recipients into Work Act</title>
    <title type="official" as="introduced">A bill to develop a database of projects that are proven or promising in terms of moving welfare recipients into work.</title>
    <title type="display">Using Evidence to Move Welfare Recipients into Work Act</title>
  </titles>
  <sponsor bioguide_id="Y000064"/>
  <cosponsors/>
  <actions>
    <action datetime="2017-04-27">
      <text>Introduced in Senate</text>
    </action>
    <action datetime="2017-04-27" state="REFERRED">
      <text>Read twice and referred to the Committee on Finance.</text>
    </action>
  </actions>
  <committees>
    <committee subcommittee="" code="SSFI" name="Senate Finance" activity="Referral"/>
  </committees>
  <relatedbills>
    <bill type="h" session="115" relation="unknown" number="576"/>
    <bill type="h" session="115" relation="unknown" number="2126"/>
  </relatedbills>
  <subjects>
    <term name="Social welfare"/>
    <term name="Employment and training programs"/>
    <term name="Government information and archives"/>
    <term name="Performance measurement"/>
    <term name="Poverty and welfare assistance"/>
  </subjects>
  <amendments/>
  <summary date="2017-04-27T04:00:00Z" status="Introduced in Senate">Using Evidence to Move Welfare Recipients into Work Act

This bill amends title IV (Temporary Assistance for Needy Families) (TANF) of the Social Security Act to direct the Department of Health and Human Services, in consultation with the Department of Labor, to develop a database of projects that have used a proven or promising approach in moving TANF recipients into work. The database shall be called the "What Works Clearinghouse of Proven and Promising Projects to Move Welfare Recipients into Work."</summary>
  <committee-reports/>
</bill>


text:
var searchData=
[
  ['jtzeroinstruction',['JtZeroInstruction',['../classMIPS_1_1JtZeroInstruction.html',1,'MIPS']]],
  ['jumpinstruction',['JumpInstruction',['../classMIPS_1_1JumpInstruction.html',1,'MIPS']]]
];


text:
namespace
{

template <typename InputT, typename OutputT>
std::vector<char> CreateArgMinMaxTfLiteModel(tflite::BuiltinOperator argMinMaxOperatorCode,
                                             tflite::TensorType tensorType,
                                             const std::vector<int32_t>& inputTensorShape,
                                             const std::vector<int32_t>& axisTensorShape,
                                             const std::vector<int32_t>& outputTensorShape,
                                             const std::vector<OutputT> axisValue,
                                             tflite::TensorType outputType,
                                             float quantScale = 1.0f,
                                             int quantOffset  = 0)
{
    using namespace tflite;
    flatbuffers::FlatBufferBuilder flatBufferBuilder;

    auto quantizationParameters =
        CreateQuantizationParameters(flatBufferBuilder,
                                     0,
                                     0,
                                     flatBufferBuilder.CreateVector<float>({ quantScale }),
                                     flatBufferBuilder.CreateVector<int64_t>({ quantOffset }));

    auto inputTensor = CreateTensor(flatBufferBuilder,
                                    flatBufferBuilder.CreateVector<int32_t>(inputTensorShape.data(),
                                                                            inputTensorShape.size()),
                                    tensorType,
                                    0,
                                    flatBufferBuilder.CreateString("input"),
                                    quantizationParameters);

    auto axisTensor = CreateTensor(flatBufferBuilder,
                                   flatBufferBuilder.CreateVector<int32_t>(axisTensorShape.data(),
                                                                           axisTensorShape.size()),
                                   tflite::TensorType_INT32,
                                   1,
                                   flatBufferBuilder.CreateString("axis"));

    auto outputTensor = CreateTensor(flatBufferBuilder,
                                     flatBufferBuilder.CreateVector<int32_t>(outputTensorShape.data(),
                                                                             outputTensorShape.size()),
                                     outputType,
                                     2,
                                     flatBufferBuilder.CreateString("output"),
                                     quantizationParameters);

    std::vector<flatbuffers::Offset<Tensor>> tensors = { inputTensor, axisTensor, outputTensor };

    std::vector<flatbuffers::Offset<tflite::Buffer>> buffers;
    buffers.push_back(CreateBuffer(flatBufferBuilder, flatBufferBuilder.CreateVector({})));
    buffers.push_back(
        CreateBuffer(flatBufferBuilder,
                     flatBufferBuilder.CreateVector(reinterpret_cast<const uint8_t*>(axisValue.data()),
                                                    sizeof(OutputT))));
    buffers.push_back(CreateBuffer(flatBufferBuilder, flatBufferBuilder.CreateVector({})));

    std::vector<int32_t> operatorInputs = {{ 0, 1 }};
    std::vector<int> subgraphInputs = {{ 0, 1 }};

    tflite::BuiltinOptions operatorBuiltinOptionsType = BuiltinOptions_ArgMaxOptions;
    flatbuffers::Offset<void> operatorBuiltinOptions = CreateArgMaxOptions(flatBufferBuilder, outputType).Union();

    if (argMinMaxOperatorCode == tflite::BuiltinOperator_ARG_MIN)
    {
        operatorBuiltinOptionsType = BuiltinOptions_ArgMinOptions;
        operatorBuiltinOptions = CreateArgMinOptions(flatBufferBuilder, outputType).Union();
    }

    // create operator
    const std::vector<int32_t> operatorOutputs{ 2 };
    flatbuffers::Offset <Operator> argMinMaxOperator =
        CreateOperator(flatBufferBuilder,
                       0,
                       flatBufferBuilder.CreateVector<int32_t>(operatorInputs.data(), operatorInputs.size()),
                       flatBufferBuilder.CreateVector<int32_t>(operatorOutputs.data(), operatorOutputs.size()),
                       operatorBuiltinOptionsType,
                       operatorBuiltinOptions);

    const std::vector<int> subgraphOutputs{ 2 };
    flatbuffers::Offset <SubGraph> subgraph =
        CreateSubGraph(flatBufferBuilder,
                       flatBufferBuilder.CreateVector(tensors.data(), tensors.size()),
                       flatBufferBuilder.CreateVector<int32_t>(subgraphInputs.data(), subgraphInputs.size()),
                       flatBufferBuilder.CreateVector<int32_t>(subgraphOutputs.data(), subgraphOutputs.size()),
                       flatBufferBuilder.CreateVector(&argMinMaxOperator, 1));

    flatbuffers::Offset <flatbuffers::String> modelDescription =
        flatBufferBuilder.CreateString("ArmnnDelegate: ArgMinMax Operator Model");
    flatbuffers::Offset <OperatorCode> operatorCode = CreateOperatorCode(flatBufferBuilder,
                                                                         argMinMaxOperatorCode);

    flatbuffers::Offset <Model> flatbufferModel =
        CreateModel(flatBufferBuilder,
                    TFLITE_SCHEMA_VERSION,
                    flatBufferBuilder.CreateVector(&operatorCode, 1),
                    flatBufferBuilder.CreateVector(&subgraph, 1),
                    modelDescription,
                    flatBufferBuilder.CreateVector(buffers.data(), buffers.size()));

    flatBufferBuilder.Finish(flatbufferModel);

    return std::vector<char>(flatBufferBuilder.GetBufferPointer(),
                             flatBufferBuilder.GetBufferPointer() + flatBufferBuilder.GetSize());
}

template <typename InputT, typename OutputT>
void ArgMinMaxTest(tflite::BuiltinOperator argMinMaxOperatorCode,
                   tflite::TensorType tensorType,
                   const std::vector<armnn::BackendId>& backends,
                   const std::vector<int32_t>& inputShape,
                   const std::vector<int32_t>& axisShape,
                   std::vector<int32_t>& outputShape,
                   std::vector<InputT>& inputValues,
                   std::vector<OutputT>& expectedOutputValues,
                   OutputT axisValue,
                   tflite::TensorType outputType,
                   float quantScale = 1.0f,
                   int quantOffset  = 0)
{
    using namespace tflite;
    std::vector<char> modelBuffer = CreateArgMinMaxTfLiteModel<InputT, OutputT>(argMinMaxOperatorCode,
                                                                                tensorType,
                                                                                inputShape,
                                                                                axisShape,
                                                                                outputShape,
                                                                                {axisValue},
                                                                                outputType,
                                                                                quantScale,
                                                                                quantOffset);

    const Model* tfLiteModel = GetModel(modelBuffer.data());
    CHECK(tfLiteModel != nullptr);

    std::unique_ptr<Interpreter> armnnDelegateInterpreter;
    CHECK(InterpreterBuilder(tfLiteModel, ::tflite::ops::builtin::BuiltinOpResolver())
          (&armnnDelegateInterpreter) == kTfLiteOk);
    CHECK(armnnDelegateInterpreter != nullptr);
    CHECK(armnnDelegateInterpreter->AllocateTensors() == kTfLiteOk);

    std::unique_ptr<Interpreter> tfLiteInterpreter;
    CHECK(InterpreterBuilder(tfLiteModel, ::tflite::ops::builtin::BuiltinOpResolver())
          (&tfLiteInterpreter) == kTfLiteOk);
    CHECK(tfLiteInterpreter != nullptr);
    CHECK(tfLiteInterpreter->AllocateTensors() == kTfLiteOk);

    // Create the ArmNN Delegate
    armnnDelegate::DelegateOptions delegateOptions(backends);
    std::unique_ptr<TfLiteDelegate, decltype(&armnnDelegate::TfLiteArmnnDelegateDelete)>
        theArmnnDelegate(armnnDelegate::TfLiteArmnnDelegateCreate(delegateOptions),
                         armnnDelegate::TfLiteArmnnDelegateDelete);
    CHECK(theArmnnDelegate != nullptr);
    // Modify armnnDelegateInterpreter to use armnnDelegate
    CHECK(armnnDelegateInterpreter->ModifyGraphWithDelegate(theArmnnDelegate.get()) == kTfLiteOk);

    // Set input data
    armnnDelegate::FillInput<InputT>(tfLiteInterpreter, 0, inputValues);
    armnnDelegate::FillInput<InputT>(armnnDelegateInterpreter, 0, inputValues);

    // Run EnqueueWorkload
    CHECK(tfLiteInterpreter->Invoke() == kTfLiteOk);
    CHECK(armnnDelegateInterpreter->Invoke() == kTfLiteOk);

    // Compare output data
    auto tfLiteDelegateOutputId = tfLiteInterpreter->outputs()[0];
    auto tfLiteDelageOutputData = tfLiteInterpreter->typed_tensor<OutputT>(tfLiteDelegateOutputId);
    auto armnnDelegateOutputId = armnnDelegateInterpreter->outputs()[0];
    auto armnnDelegateOutputData = armnnDelegateInterpreter->typed_tensor<OutputT>(armnnDelegateOutputId);

    for (size_t i = 0; i < expectedOutputValues.size(); i++)
    {
        CHECK(expectedOutputValues[i] == armnnDelegateOutputData[i]);
        CHECK(tfLiteDelageOutputData[i] == expectedOutputValues[i]);
        CHECK(tfLiteDelageOutputData[i] == armnnDelegateOutputData[i]);
    }
}

} // anonymous namespace


text:
<?xml version="1.0" encoding="UTF-8"?> <?xml-model href="../../../docbook-customization/src/docbkx-stylesheet/common/komet.rnc" type="application/relax-ng-compact-syntax"?>

<section xml:id="SoC_Section" xmlns="http://docbook.org/ns/docbook"
  xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink"
  version="5.1">
  <title><?oxy_comment_start author="kec" timestamp="20190721T123358-0700" comment="Change section name to "Architectural Separation of Concerns". Promote section, and move to prior to Analysis Normal Form section. " flag="done"?>Approach
    - Architectural Separation of Concerns<?oxy_comment_end?></title>
  <para>Increased reliance on computerized health records, including Electronic Health Records
    Systems, requires standardized medical terminology to encode health information consistently
    across systems and enterprises.
    <?oxy_comment_start author="kec" timestamp="20190721T123842-0700" comment="Add why simply mapping won't solve the problem, and we need to rely on a more comprehensive approach of statement to model transformation. Maybe anticipate the model transformation section. " flag="done"?>Clinicians
    require not only objective quantitative measurements (e.g. 90 beats per minute for a patient's
    pulse) but also contextual or procedural context (e.g. pulse oximetry, manual) about past
    observations or requests for future interventions. While two quantitative measurements may be
    the same, the procedural information could indicate meaningful semantic differences and lead to
    different clinical interpretation and treatment.
    <?oxy_comment_start author="steph" timestamp="20191015T181648-0600" comment="I recommend making this a new paragraph."?>As<?oxy_comment_end?>
    information is exchanged across systems, the solution requires a common understanding of data
    and a method to support knowledge-representation and clinical decision rules based on common
    terminology and statements. Each component must address an aspect and, together they need to
    address the requirements of clinicians.<?oxy_comment_end?> Current HL7 standard implementations
    rely on profiles and templates to disambiguate statement and terminology, and provide sufficient
    precision for transactions, documents, and standards-based APIs. Therefore the architectural
    approach described here would be applicable to standards organizations developing
    interoperability-enterprise, and project-specific implementations in equal measure. </para>
  <para><?oxy_comment_start author="kec" timestamp="20190721T124118-0700" comment=""Breaking up the solution" is a bad phrase... Humpty Dumpty had a great fall.. All the [etc] could not put him back togehter again. There is a potential fear that this will make things more complicated, and make it difficult to fit all the pieces.

Try "Separating concerns across architectural layers is a foundational..."" flag="done"?>Functional
    decomposition<?oxy_comment_end?>—often referred to as a <glossterm
      baseform="Separation of Concerns">Separation of Concerns</glossterm> (SoC)—across components
    or sections with a specific purpose is a foundational design principle for complex system
    architecture. Enabling a SoC allows a complete system to be subdivided into distinct sections or
    components with well-defined functionality and dependencies. If successful, this approach allows
    individual sections to be able to be <emphasis>reused</emphasis>, as well as designed,
    implemented, and updated <emphasis>independently</emphasis> to address emerging
      <emphasis>requirements</emphasis>. This is especially useful and important in a medical
    context given how many different health information and clinical terminology projects are
    ongoing at any given time. Efforts are often uncoordinated and led by disparate and unrelated
    standards development organizations. In these cases, SoC allows teams to work independently, in
    coordination with each other, and reuse the resulting artifacts.</para>
  <para><?oxy_comment_start author="kec" timestamp="20190721T131643-0700" comment="I edited this one directly to demonstrate the linking mechanism. " flag="done"?><xref
      linkend="SoC-diagram"/> shows how a layered knowledge architecture can enable a separation of
    concerns.<?oxy_comment_end?></para>
  <figure xml:id="SoC-diagram">
    <title>Separation of Concerns: Knowledge Architecture</title>
    <mediaobject role="bordered">
      <imageobject>
        <?oxy_comment_start author="kec" timestamp="20190721T130116-0700" comment="Move the "Each architectural layer..." to the caption (I demonstrated how to do it here)

Not sure how ANF leads to agile improvement. Possibly just remove, and simplify diagram,

Add to the Shared Module System description: "Shared version and module system" "Provides the structural foundation that supports change over time, modularity, and knowledge representation. "

Remove the definition from the figure, and link to glossary where appropriate. " flag="done"?>
        <imagedata fileref="images/SoC_new.png" scale="40" align="center"/><?oxy_comment_end?>
      </imageobject>
    </mediaobject>
    <caption>
      <para><emphasis>Separation of concerns is an architectural design principle, whereby a system
          is divided into distinct sections, such that each section can address separate concerns.
          In this case, each architectural layer addresses separate concerns that can make use of
          the architecture layers below.</emphasis></para>
    </caption>
  </figure>
  <para><?oxy_comment_start author="kec" timestamp="20190721T130509-0700" comment="Change from using emphasis, to using glossary link. Start out active voice. "The Architectural Foundation layer is responsible for defining how object identity, versioning, modularity, and symbolic knowledge is represented"" flag="done"?><emphasis
      role="bold"
        ><?oxy_comment_start author="Ioana" timestamp="20190729T001818-0400" comment="Add link to glossary" flag="done"?><link
        linkend="CIF_EHR_1"><glossterm baseform="Architectural Foundation">Architectural
          Foundation</glossterm></link><?oxy_comment_end?></emphasis> – The <glossterm>Architectural
      Foundation</glossterm> of the Knowledge Architecture provides the common elements of
    interoperability such as object identity, versioning, modularity, and knowledge representation.
    It includes a) the foundation and building blocks of the common model; (b) how the repeatable
    transformation process of disparate standards into the common model promotes interoperability
    with other environments; and (c) how the modules of the architecture are tightly version
    controlled over time.
    <!--The Architectural Foundation provides patient identity cross-referencing, practitoiner, data provance, security, etc. --></para><?oxy_comment_end?>
  <para><link linkend="CIF_EHR_1">
      <emphasis role="bold"
          ><?oxy_comment_start author="Ioana" timestamp="20190729T001906-0400" comment="Add link to glossary" flag="done"?><glossterm
          baseform="Terminology Knowledge">Terminology
        Knowledge</glossterm><?oxy_comment_end?></emphasis>
    </link><?oxy_comment_start author="kec" timestamp="20190721T130700-0700" comment="The Termnology Knowledge layer is responsible for... Most of SNOMED CT, LOINC, RxNorm live here. I don't think "Representation of absence" should be mentioned here. " flag="done"?>–
    The Terminology Knowledge layer is responsible for structured sets of medical terms and codes
    that <emphasis>define</emphasis> concepts of interest, including descriptions, dialects,
    language, and semantic hierarchy. SNOMED CT, LOINC, and RxNorm are part of this layer. It
    defines what valid codes or expressions may be used by higher level layers<?oxy_comment_end?>. </para>
  <para><?oxy_comment_start author="kec" timestamp="20190721T130821-0700" comment="The Statement Model layer is responsible for defining how terminology concepts can be combined to create a statement. " flag="done"?><emphasis
      role="bold"
        ><?oxy_comment_start author="rcholan" timestamp="20190730T111546-0400" comment="glossary" flag="done"?><glossterm
        baseform="Statement Model">Statement Model</glossterm><?oxy_comment_end?></emphasis> – The
    Statement Model layer is responsible for defining how data elements are combined to create a
    statement. <?oxy_comment_end?>ANF Reference Model belongs in this layer. Other standards-based
    clinical statements are discussed later in this chapter. This layer reuses the artifacts defined
    in the Terminology Knowledge layer.</para>
  <para><?oxy_comment_start author="kec" timestamp="20190721T130846-0700" comment="The Assertional Knowledge layer is responsible for..." flag="done"?><emphasis
      role="bold"
        ><?oxy_comment_start author="rcholan" timestamp="20190730T111554-0400" comment="glossary" flag="done"?><glossterm
        baseform="Assertional Knowledge">Assertional
      Knowledge<?oxy_comment_end?></glossterm></emphasis> – The Assertional Knowledge layer makes
    use of the Terminology Knowledge layer concepts to specify <emphasis>non-defining</emphasis>
    facts that may be used by procedural knowledge algorithms. An example of such a fact might be
    that "thiazide diuretics treat hypertension." Assertional Knowledge may indicate what symptoms
    may be associated with a disorder. </para>
  <para><?oxy_comment_end?><emphasis role="bold"
        ><?oxy_comment_start author="rcholan" timestamp="20190730T111601-0400" comment="glossary" flag="done"?><?oxy_comment_start author="kec" timestamp="20190721T130913-0700" comment="The procedural knowledge layer is responsible for..." flag="done" mid="15"?><glossterm
        baseform="Procedural Knowledge">Procedural
      Knowledge</glossterm><?oxy_comment_end?></emphasis> – Procedural knowledge, also known as
    imperative knowledge, is the knowledge exercised in the performance of some task, such as
    determining a hypertension treatment plan by analyzing a combination of a patient's ANF
    statements, and the available assertional knowledge. The procedural knowledge is responsible for
    information about standard ways to carry out specific procedures as well as other procedural
    guidelines, e.g. treatment protocols for diseases and order sets focused on particular patient
    situations. Procedural knowledge, together with assertional knowledge, enables clinical decision
    support, quality measurement, and supports patient safety. This layer relies on the
    architectural foundation and terminology layers, incorporates the statement model for
    information retrieval, and uses the assertional knowledge.<?oxy_comment_end mid="15"?>
    Procedural knowledge artifacts may include clinical alert rules, reminders, etc. that trigger
    actions or recommend interventions.</para>
  <para>Examining a clinical procedure for controlling hypertension illustrates each of the layers
    of the informatics architectural separation of concerns. <itemizedlist>
      <listitem>
        <para>At the Terminology Knowledge layer, there may be various codes and terms from
          disparate source terminologies to define a concept (e.g. hypertension).
          <!--For example, the concept "essential hypertension" is defined by the ICD-10 CM code I10 and 59621000 in SNOMED CT-->
          Ideally, these overlapping codes and terms would be oriented to the same parent concept
          during the transformation and integration process at
          <?oxy_comment_start author="kec" timestamp="20190721T171552-0700" comment="The foundational layer is just data structures. Terminology integration happens at the terminology layer. " flag="done"?>the
          Terminology layer <?oxy_comment_end?>(e.g.,
          <glossterm>Solor</glossterm>).<!-- Furthermore, any updates over time to code sets or value sets that define hypertension (in the NLM's Value Set Authority Center for instance) would be maintained by continuous integration at the Architectural Foundation layer.--></para>
      </listitem>
      <listitem>
        <para>The<?oxy_comment_start author="kec" timestamp="20190721T171955-0700" comment="The FHIR observation resource is not ANF. Can be considered another CIF, and we would need a standard transform. For here, just say that the statement model layer provide a standard means for representing quantatative and existential measurement... Probably want to replace categorical data with existential measurement throughout. " flag="done"?>
          Statement Model layer enables representation of blood pressure measurement values (e.g.,
          systolic BP = 140 mmHg) or the categorical data (e.g., pregnancy induced hypertension vs.
          renal hypertension) within a standard data structure to facilitate information exchange or
          retrieval, such as within a standards-based clinical statement (i.e. CIMI, CDA, FHIR, ANF,
          etc.). <?oxy_comment_end?>
        </para>
      </listitem>
      <listitem>
        <para>T<?oxy_comment_start author="kec" timestamp="20190721T171053-0700" comment="Assertional knowledge can't contain conditional branches, so can't represent workflow (implied branching), and can't represent rules "if-then-else"" flag="done"?>he
          Assertional Knowledge layer represents non-procedural statements, or facts, such "Stage 2
          high blood pressure is over 140 systolic or 90 diastolic," or that beta-blockers and ACE
          inhibitors may be used to treat hypertension, or that beta-blockers are contraindicated in
          patients with a diagnosis of reactive airway disease.<?oxy_comment_end?>
        </para>
      </listitem>
      <listitem>
        <para><?oxy_comment_start author="kec" timestamp="20190721T171119-0700" comment="Procedural knowledge includes if-then-else. " flag="done"?>Finally,
          the Procedural Knowledge layer provides algorithms to analyze ANF statements about a
          patients, in combination with the Assertional Knowledge, to recommend a treatment protocol
          for different kinds of hypertension, including the considerations of, e.g. patient age,
          co-morbidities etc., which can be generated by an electronic clinical decision support
          system (Statement + Assertional layers).<?oxy_comment_end?> This layer adds to support for
          workflow and conditional logic (i.e. if-then-else).</para>
      </listitem>
    </itemizedlist></para>
  <para>A clear separation of concerns enables the isosemantic transformation of standards-based
    clinical statements to normal form by decoupling structure from semantics and workflow
    <?oxy_comment_start author="kec" timestamp="20190721T172337-0700" comment="The clean separation of concerns helps to enable isosemantic transformation, by having a reproducible form. The separation of concerns does not really speak to the isosemantic representation.

Yes, ANF is for URU..." flag="done"?>in
    regard to an isosemantic representation in the Statement Model layer<?oxy_comment_end?>.</para>
  <para>HL7 relies on implementation guides (for V2, CDA, and FHIR) to add sufficient terminology
    knowledge to standards-based clinical statements. Vocabulary constraints documented as profiles
    or templates are the mechanism to create interoperable implementation guides from health IT
    standards. Only after the Terminology Knowledge is fully defined, the standards-based statements
    can be used to support business and workflow decision points consistent with Assertional and
    Procedural layers described above. </para>
</section>


text:
/**
 *
 */
package com.flat502.rox.server;

import com.flat502.rox.processing.HttpMessageHandler;
import com.flat502.rox.processing.ResourcePool;

public class ServerResourcePool extends ResourcePool {
    @Override
    protected HttpMessageHandler newWorker() {
        return new HttpRequestHandler(this.getQueue());
    }
}


text:
package org.gradle.api.internal.artifacts;

import org.gradle.api.artifacts.ComponentMetadata;
import org.gradle.internal.component.external.model.ModuleComponentResolveMetadata;

public interface ComponentMetadataProcessor {
    ComponentMetadataProcessor NO_OP = new ComponentMetadataProcessor() {
        @Override
        public ModuleComponentResolveMetadata processMetadata(ModuleComponentResolveMetadata metadata) {
            return metadata;
        }

        @Override
        public ComponentMetadata processMetadata(ComponentMetadata metadata) {
            return metadata;
        }

        @Override
        public int getRulesHash() {
            return 0;
        };
    };

    ModuleComponentResolveMetadata processMetadata(ModuleComponentResolveMetadata metadata);

    /**
     * Processes "shallow" metadata, only for selecting a version. This metadata is typically
     * provided by a custom metadata processor.
     * @param metadata the metadata to be processed
     * @return updated metadata, if any component metadata rule applies.
     */
    ComponentMetadata processMetadata(ComponentMetadata metadata);

    int getRulesHash();
}


text:
using UnityEditor;

namespace TuxedoBerries.ScenePanel
{
	/// <summary>
	/// Scene panel menu.
	/// </summary>
	public class ScenePanelMenu
	{

		[MenuItem("TuxedoBerries/Scene Panel/Gameplay Control Panel", false, 10)]
		private static void InitGameplayControls()
		{
			var window = EditorWindow.GetWindow<GameplayControlPanel> ();
			window.Show ();
		}

		[MenuItem("TuxedoBerries/Scene Panel/Dashboard Panel", false, 100)]
		private static void InitDashboard()
		{
			var window = EditorWindow.GetWindow<SceneDashboardPanel> ();
			window.ClearHistory ();
			window.Show ();
		}

		[MenuItem("TuxedoBerries/Scene Panel/History Panel", false, 101)]
		private static void InitHistory()
		{
			var window = EditorWindow.GetWindow<HistoryPanel> ();
			window.ClearHistory ();
			window.Show ();
		}

		[MenuItem("TuxedoBerries/Scene Panel/Scene List Panel", false, 102)]
		private static void InitSceneList()
		{
			var window = EditorWindow.GetWindow<SceneListPanel> ();
			window.Show ();
		}

		[MenuItem("TuxedoBerries/Scene Panel/Current Scene Panel", false, 103)]
		private static void InitCurrentScene()
		{
			var window = EditorWindow.GetWindow<CurrentScenePanel> ();
			window.Show ();
		}

		[MenuItem("TuxedoBerries/Scene Panel/Snapshot Panel", false, 1000)]
		private static void InitSnapshot()
		{
			var window = EditorWindow.GetWindow<QuickScreenshotPanel> ();
			window.Show ();
		}

		[MenuItem("TuxedoBerries/Scene Panel/Database Panel", false, 1001)]
		private static void InitDatabase()
		{
			var window = EditorWindow.GetWindow<SceneDatabasePanel> ();
			window.Show ();
		}
	}
}


text:
require 'rouge/plugins/redcarpet'
describe Rouge::Plugins::Redcarpet do
  # skip if redcarpet isn't loaded
  next unless Object.const_defined? :Redcarpet

  let(:redcarpet) {
    Class.new(Redcarpet::Render::HTML) do
      include Rouge::Plugins::Redcarpet
    end
  }

  let(:markdown) {
    Redcarpet::Markdown.new(redcarpet.new, :fenced_code_blocks => true)
  }

  it 'renders a thing' do
    result = markdown.render <<-mkd
``` javascript
var foo = 1;
```

``` shell
foo=1
```
    mkd

    assert { result.include?(%<>) }
    assert { result.include?(%<>) }
  end

  it 'guesses' do
    result = markdown.render <<-mkd
``` guess
<xml>an xml code block</xml>
```
    mkd

    assert { result.include?(%<>) }
  end

  it 'passes options' do
    result = markdown.render <<-mkd
``` shell?k=v
foo=1
```
    mkd

    # TODO: test that an option is actually there
    assert { result.include?(%<>) }
  end

  it 'works when no language is provided' do
    result = markdown.render <<-mkd
```
#!/usr/bin/env ruby
$stdin.each { |l| $stdout.puts l.reverse }
```
    mkd
    assert { result.include?(%()) }
  end
end


text:
using System;
using System.Diagnostics;
using System.Globalization;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;
using Cake.Core;
using Cake.Core.Annotations;

namespace Cake.Scripting.Mono.CodeGen
{
    /// <summary>
    /// Responsible for generating script property aliases.
    /// </summary>
    public static class MonoPropertyAliasGenerator
    {
        /// <summary>
        /// Generates a script property alias from the specified method.
        /// The provided method must be an extension method for <see cref="ICakeContext"/>
        /// and it must be decorated with the <see cref="CakePropertyAliasAttribute"/>.
        /// </summary>
        /// <param name="method">The method to generate the code for.</param>
        /// <returns>The generated code.</returns>
        public static string Generate(MethodInfo method)
        {
            if (method == null)
            {
                throw new ArgumentNullException("method");
            }

            // Perform validation.
            ValidateMethod(method);
            ValidateMethodParameters(method);

            // Get the property alias attribute.
            var attribute = method.GetCustomAttribute<CakePropertyAliasAttribute>();

            // Generate code.
            return attribute.Cache
                ? GenerateCachedCode(method)
                    : GenerateCode(method);
        }

        private static void ValidateMethod(MethodInfo method)
        {
            Debug.Assert(method.DeclaringType != null, "method.DeclaringType != null"); // Resharper

            if (!method.DeclaringType.IsStatic())
            {
                const string format = "The type '{0}' is not static.";
                throw new CakeException(string.Format(CultureInfo.InvariantCulture, format, method.DeclaringType.FullName));
            }

            if (!method.IsDefined(typeof(ExtensionAttribute)))
            {
                const string format = "The method '{0}' is not an extension method.";
                throw new CakeException(string.Format(CultureInfo.InvariantCulture, format, method.Name));
            }

            if (!method.IsDefined(typeof(CakePropertyAliasAttribute)))
            {
                const string format = "The method '{0}' is not a property alias.";
                throw new CakeException(string.Format(CultureInfo.InvariantCulture, format, method.Name));
            }
        }

        private static void ValidateMethodParameters(MethodInfo method)
        {
            var parameters = method.GetParameters();
            var parameterCorrect = false;
            if (parameters.Length == 1)
            {
                if (parameters[0].ParameterType == typeof(ICakeContext))
                {
                    parameterCorrect = true;
                }
            }

            if (!parameterCorrect)
            {
                const string format = "The property alias '{0}' has an invalid signature.";
                throw new CakeException(string.Format(CultureInfo.InvariantCulture, format, method.Name));
            }

            if (method.IsGenericMethod)
            {
                const string format = "The property alias '{0}' cannot be generic.";
                throw new CakeException(string.Format(CultureInfo.InvariantCulture, format, method.Name));
            }

            if (method.ReturnType == typeof(void))
            {
                const string format = "The property alias '{0}' cannot return void.";
                throw new CakeException(string.Format(CultureInfo.InvariantCulture, format, method.Name));
            }
        }

        private static string GenerateCode(MethodInfo method)
        {
            var builder = new StringBuilder();

            builder.Append("public ");
            builder.Append(GetReturnType(method));
            builder.Append(" ");
            builder.Append(method.Name);
            builder.AppendLine();
            builder.Append("{");
            builder.AppendLine();
            builder.Append("    get {");
            builder.AppendLine();
            builder.Append("        return ");
            builder.Append(method.GetFullName());
            builder.Append("(Context);");
            builder.Append("    }");
            builder.AppendLine();
            builder.Append("}");
            builder.AppendLine();
            builder.AppendLine();

            return builder.ToString();
        }

        private static string GenerateCachedCode(MethodInfo method)
        {
            var builder = new StringBuilder();

            // Backing field.
            builder.Append("private ");
            builder.Append(GetReturnType(method));
            if (method.ReturnType.IsValueType)
            {
                builder.Append("?");
            }
            builder.Append(" _");
            builder.Append(method.Name);
            builder.Append(";");
            builder.AppendLine();

            // Property
            builder.Append("public ");
            builder.Append(GetReturnType(method));
            builder.Append(" ");
            builder.Append(method.Name);
            builder.AppendLine();
            builder.Append("{");
            builder.AppendLine();
            builder.Append("    get { ");
            builder.AppendLine();
            builder.AppendFormat("        if (_{0}==null)", method.Name);
            builder.Append(" {");
            builder.AppendLine();
            builder.AppendFormat("            _{0} = ", method.Name);
            builder.Append(method.GetFullName());
            builder.Append("(Context);");
            builder.AppendLine();
            builder.Append("        }");
            builder.AppendLine();
            builder.AppendFormat("        return _{0}", method.Name);
            if (method.ReturnType.IsValueType)
            {
                builder.Append(".Value");
            }
            builder.Append(";");
            builder.AppendLine();
            builder.Append("    }");
            builder.AppendLine();
            builder.Append("}");
            builder.AppendLine();
            builder.AppendLine();

            return builder.ToString();
        }

        private static string GetReturnType(MethodInfo method)
        {
            return method.ReturnType.GetFullName();
        }
    }
}


text:
import os
import mimetypes
import urllib
from functools import partial
import threading
import urllib2
import socket
import atexit
from wsgiref.simple_server import make_server, WSGIRequestHandler, WSGIServer

from werkzeug.wrappers import Response, Request
from werkzeug.routing import Map, Rule
from werkzeug.wsgi import wrap_file

from .serializers import svg, text, dot

PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

def _silent(call, *args):
    try:
        call(*args)
    except Exception:
        pass

class SilentHandler(WSGIRequestHandler):

    def log_message(self, *args, **kwargs):
        pass

class WSGIServerWithReusableSocket(WSGIServer):
    allow_reuse_address = True

class WebView(object):
    """

    state_machine(:class:`StateMachineCrawler <state_machine_crawler.StateMachineCrawler>` instance)
        State machine to be monitored

    Sample usage:

    >>> app = WebView(state_machine)
    >>> try:
    >>>     app.start()
    >>>     state_machine.verify_all_states()
    >>> except TransitionError, e:
    >>>     print e
    >>> except KeyboardInterrupt:
    >>>     pass
    >>> app.stop()

    Once the code is executed, a web service monitoring your state machine shall be started under
    `http://localhost:8666 <http://localhost:8666>`_. The url shall be printed to stdout to ease the access.

    An html page of the web service is a dynamic view of the graph that represents the state machine.
    """

    HOST = 'localhost'

    SERIALIZER_MAP = {
        "svg": svg,
        "txt": text,
        "dot": dot
    }

    def __init__(self, state_machine):
        self._state_machine = state_machine
        self._viewer_thread = threading.Thread(target=self._run_server)
        self._alive = False
        self._server = None

        url_map = [
            Rule("/", endpoint=partial(self._static, path="index.html")),
            Rule("/kill", endpoint=None),
            Rule("/graph.<string:serializer_type>", endpoint=self._graph),
            Rule("/<string:path>", endpoint=self._static)
        ]

        self._url_map = Map(url_map)

    def _graph(self, request, serializer_type):

        serializer_class = self.SERIALIZER_MAP.get(serializer_type, text).Serializer

        resp = Response(repr(serializer_class(self._state_machine)))
        resp.mimetype = serializer_class.mimetype
        return resp

    def _static(self, request, path):
        root = os.path.join(os.path.dirname(__file__), "webview")
        file_name = path.lstrip("/").replace("/", os.path.sep)

        abs_path = os.path.join(root, file_name)
        resp = Response()

        if not (os.path.exists(abs_path) and os.path.isfile(abs_path)):
            resp.status_code = 404
            return resp

        fil = open(abs_path)
        resp.direct_passthrough = True
        resp.response = wrap_file(request.environ, fil)

        url = urllib.pathname2url(abs_path)
        resp.mimetype = mimetypes.guess_type(url)[0]

        return resp

    def __call__(self, environ, start_response):
        urls = self._url_map.bind_to_environ(environ)
        endpoint, params = urls.match()
        if endpoint is None:
            resp = Response("Killed")
        else:
            resp = endpoint(Request(environ), **params)
        return resp(environ, start_response)

    def _run_server(self):
        self._server = httpd = make_server(self.HOST, 8666, self, server_class=WSGIServerWithReusableSocket,
                                           handler_class=SilentHandler)
        print("Started the server at http://%s:%d" % (self.HOST, httpd.server_port))

        def close_socket():
            _silent(httpd.socket.shutdown, socket.SHUT_RDWR)
            _silent(httpd.socket.close)

        atexit.register(close_socket)

        while self._alive:
            httpd.handle_request()

    def start(self):
        if self._alive:
            return
        self._alive = True
        self._viewer_thread.start()

    def stop(self):
        if not self._alive:
            return
        self._alive = False
        try:
            urllib2.urlopen("http://%s:%d/kill" % (self.HOST, self._server.server_port), timeout=3)
        except socket.error:
            pass
        self._viewer_thread.join()


text:
namespace grpc {
class CompletionQueue;
class Channel;
class RpcService;
class ServerCompletionQueue;
class ServerContext;
}  // namespace grpc

namespace google {
namespace storagetransfer {
namespace v1 {

}  // namespace v1
}  // namespace storagetransfer
}  // namespace google

#endif  // GRPC_google_2fstoragetransfer_2fv1_2ftransfer_5ftypes_2eproto__INCLUDED


text:
"""
      Title:
    Project:
     Author: Will Hardy
       Date: January 2009
      Usage:
  $Revision$

Description:

"""
from django.contrib import admin
from django_dms.apps.small_dms.models import Document

class DocumentAdmin(admin.ModelAdmin):
    list_display = ('title', 'slug', 'file_mimetype', 'file_extension', 'date_created')
    prepopulated_fields = {"slug": ("title",)}

admin.site.register(Document, DocumentAdmin)


text:
Unit tests, Behave tests and PEP8 tests are supported.

If you want to test a plot, you should refer to the sections on [adding a plot](adding-a-plot.md) and on [interactive plots](interactive-plots.md).

## Unit tests

You should add all your unit tests to the folder `tests/unittests`. For convenience a base test case class `tests.unittests.base.BaseTestCase` is provided, which sets up and tears down the Flask environment. This class also creates a test client, which can be accessed as `self.client`. This test client is using cookies.

In addition, the `test.unittests.base` module offers a class `NoAuthBaseTestCase`, which extends the `BaseTestCase` class and disables authentication, meaning that `login_required` decorators for routes are ignored.

A unit test using the `NoAuthBaseTestClass` might look as follows.

```python
from tests.unittests.base import NoAuthBaseTestCase

class NoAuthBasicsTestCase(NoAuthBaseTestCase):
    def test_homepage_exists(self):
        response = self.client.get('/')
        self.assertTrue(response.status_code == 200)
```

## Behave tests

[Behave](https://pythonhosted.org/behave/index.html) feature files should be put in the folder `tests/features`, and the corresponding step implementation files in `tests/features/steps`.

The context variable passed to the step implementations provides access to the Flask app and a test client (which are set up in the `environment.py` module). The test client is using cookies. The following example illustrates how the test client can  be used.

```python
from behave import *

use_step_matcher("re")

@when('I access the homepage')
def step_impl(context):
    context.response = context.client.get('/')

@then('I get a page with no error')
def step_impl(context):
    assert context.response.status_code == 200
```

## PEP8 tests

The testing script mentioned in the next subsection includes PEP8 checking.

## Running the tests

The Bash script `run_tests.sh` allows you to run your tests. In addition it uses the `pycodestyle` module to check compliance with PEP8. Regarding the latter a maximum line length of 120 is assumed and module level imports aren't forced to be at the top of a file.

If you want to enforce that git commits can only be pushed if all tests are passed, you may use a git hook. If there is a pre-push hook already, modify it to include the content of the `run_tests.sh` script. Otherwise just copy the script and ensure the hook is executable:

```bash
cp run_tests.sh .git/hooks/pre-push
chmod u+x .git/hooks/pre-push
```


text:
require 'chef_compat/monkeypatches/chef'
require 'chef_compat/monkeypatches/chef/log'
require 'chef_compat/monkeypatches/chef/mixin/params_validate'
require 'chef_compat/monkeypatches/chef/recipe'
require 'chef_compat/monkeypatches/chef/resource'
require 'chef_compat/monkeypatches/chef/property'
require 'chef_compat/monkeypatches/chef/provider'
require 'chef_compat/monkeypatches/chef/resource/lwrp_base'
require 'chef_compat/monkeypatches/chef/exceptions'
require 'chef_compat/monkeypatches/chef/run_context'


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="lt">
<context>
    <name>LFileDialog</name>
    <message>
        <location filename="../LFileDialog.ui" line="14"/>
        <source>Open With...</source>
        <translation>Atverti naudojant...</translation>
    </message>
    <message>
        <location filename="../LFileDialog.ui" line="68"/>
        <source>Preferred</source>
        <translation>Pageidaujama</translation>
    </message>
    <message>
        <location filename="../LFileDialog.ui" line="75"/>
        <source>Available</source>
        <translation>Prieinama</translation>
    </message>
    <message>
        <location filename="../LFileDialog.ui" line="82"/>
        <source>Custom</source>
        <translation>Tinkinta</translation>
    </message>
    <message>
        <location filename="../LFileDialog.ui" line="131"/>
        <source>Binary Location</source>
        <translation>Dvejetainės vieta</translation>
    </message>
    <message>
        <location filename="../LFileDialog.ui" line="138"/>
        <source>Find</source>
        <translation>Rasti</translation>
    </message>
    <message>
        <location filename="../LFileDialog.ui" line="199"/>
        <source>Set this application as the default </source>
        <translation>Nustatyti šią programą kaip numatytąją </translation>
    </message>
    <message>
        <location filename="../LFileDialog.ui" line="221"/>
        <source>OK</source>
        <translation>Gerai</translation>
    </message>
    <message>
        <location filename="../LFileDialog.ui" line="235"/>
        <source>Cancel</source>
        <translation>Atsisakyti</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="40"/>
        <source>(Email Link)</source>
        <translation>(El. pašto nuoroda)</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="41"/>
        <source>(Internet URL - %1)</source>
        <translation>(Internetinis URL - %1)</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="114"/>
        <source>Audio</source>
        <translation>Garsas</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="115"/>
        <source>Video</source>
        <translation>Vaizdas</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="116"/>
        <source>Multimedia</source>
        <translation>Multimedija</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="117"/>
        <source>Development</source>
        <translation>Programavimas</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="118"/>
        <source>Education</source>
        <translation>Švietimas</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="119"/>
        <source>Game</source>
        <translation>Žaidimai</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="120"/>
        <source>Graphics</source>
        <translation>Grafika</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="121"/>
        <source>Network</source>
        <translation>Tinklas</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="122"/>
        <source>Office</source>
        <translation>Raštinė</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="123"/>
        <source>Science</source>
        <translation>Mokslas</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="124"/>
        <source>Settings</source>
        <translation>Nustatymai</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="125"/>
        <source>System</source>
        <translation>Sistema</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="126"/>
        <source>Utilities</source>
        <translation>Paslaugų programos</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="127"/>
        <source>Other</source>
        <translation>Kita</translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="211"/>
        <source>[default] </source>
        <translation>[numatytoji] </translation>
    </message>
    <message>
        <location filename="../LFileDialog.cpp" line="278"/>
        <source>Find Application Binary</source>
        <translation>Rasti programos dvejetainę</translation>
    </message>
</context>
<context>
    <name>QObject</name>
    <message>
        <location filename="../main.cpp" line="54"/>
        <source>File Error</source>
        <translation>Failo klaida</translation>
    </message>
    <message>
        <location filename="../main.cpp" line="199"/>
        <location filename="../main.cpp" line="213"/>
        <source>Audio Volume %1%</source>
        <translation>Garso garsis %1%</translation>
    </message>
    <message>
        <location filename="../main.cpp" line="221"/>
        <location filename="../main.cpp" line="230"/>
        <source>Screen Brightness %1%</source>
        <translation>Ekrano ryškumas %1%</translation>
    </message>
    <message>
        <location filename="../main.cpp" line="262"/>
        <source>Invalid file or URL: %1</source>
        <translation>Netinkamas failas ar URL: %1</translation>
    </message>
    <message>
        <location filename="../main.cpp" line="283"/>
        <source>Application entry is invalid: %1</source>
        <translation>Programos įrašas yra neteisingas: %1</translation>
    </message>
    <message>
        <location filename="../main.cpp" line="294"/>
        <source>Application shortcut is missing the launching information (malformed shortcut): %1</source>
        <translation>Programos šaukinyje trūksta paleidimo informacijos (netaisyklingas šaukinys): %1</translation>
    </message>
    <message>
        <location filename="../main.cpp" line="307"/>
        <source>URL shortcut is missing the URL: %1</source>
        <translation>URL šaukinyje trūksta URL: %1</translation>
    </message>
    <message>
        <location filename="../main.cpp" line="318"/>
        <source>Directory shortcut is missing the path to the directory: %1</source>
        <translation>Katalogo šaukinyje trūksta kelio į katalogą: %1</translation>
    </message>
    <message>
        <location filename="../main.cpp" line="323"/>
        <source>Unknown type of shortcut : %1</source>
        <translation>Nežinomas šaukinio tipas : %1</translation>
    </message>
    <message>
        <location filename="../main.cpp" line="386"/>
        <source>Could not find "%1". Please ensure it is installed first.</source>
        <translation>Nepavyko rasti "%1". Iš pradžių, įsitikinkite ar ji įdiegta.</translation>
    </message>
    <message>
        <location filename="../main.cpp" line="435"/>
        <source>Application Error</source>
        <translation>Programos klaida</translation>
    </message>
    <message>
        <location filename="../main.cpp" line="435"/>
        <source>The following application experienced an error and needed to close:</source>
        <translation>Ši programa susidūrė su klaida ir turėjo būti užverta:</translation>
    </message>
</context>
<context>
    <name>XDGDesktopList</name>
    <message>
        <location filename="../../libLumina/LuminaXDG.cpp" line="608"/>
        <source>Multimedia</source>
        <translation type="unfinished">Multimedija</translation>
    </message>
    <message>
        <location filename="../../libLumina/LuminaXDG.cpp" line="609"/>
        <source>Development</source>
        <translation type="unfinished">Programavimas</translation>
    </message>
    <message>
        <location filename="../../libLumina/LuminaXDG.cpp" line="610"/>
        <source>Education</source>
        <translation type="unfinished">Švietimas</translation>
    </message>
    <message>
        <location filename="../../libLumina/LuminaXDG.cpp" line="611"/>
        <source>Games</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../../libLumina/LuminaXDG.cpp" line="612"/>
        <source>Graphics</source>
        <translation type="unfinished">Grafika</translation>
    </message>
    <message>
        <location filename="../../libLumina/LuminaXDG.cpp" line="613"/>
        <source>Network</source>
        <translation type="unfinished">Tinklas</translation>
    </message>
    <message>
        <location filename="../../libLumina/LuminaXDG.cpp" line="614"/>
        <source>Office</source>
        <translation type="unfinished">Raštinė</translation>
    </message>
    <message>
        <location filename="../../libLumina/LuminaXDG.cpp" line="615"/>
        <source>Science</source>
        <translation type="unfinished">Mokslas</translation>
    </message>
    <message>
        <location filename="../../libLumina/LuminaXDG.cpp" line="616"/>
        <source>Settings</source>
        <translation type="unfinished">Nustatymai</translation>
    </message>
    <message>
        <location filename="../../libLumina/LuminaXDG.cpp" line="617"/>
        <source>System</source>
        <translation type="unfinished">Sistema</translation>
    </message>
    <message>
        <location filename="../../libLumina/LuminaXDG.cpp" line="618"/>
        <source>Utility</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../../libLumina/LuminaXDG.cpp" line="619"/>
        <source>Wine</source>
        <translation type="unfinished"></translation>
    </message>
    <message>
        <location filename="../../libLumina/LuminaXDG.cpp" line="620"/>
        <source>Unsorted</source>
        <translation type="unfinished"></translation>
    </message>
</context>
</TS>


text:
<?php
//============================================================+
// File name   : tcpdf_config.php
// Begin       : 2004-06-11
// Last Update : 2013-02-06
//
// Description : Configuration file for TCPDF.
// Author      : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
// License     : GNU-LGPL v3 (http://www.gnu.org/copyleft/lesser.html)
// -------------------------------------------------------------------
// Copyright (C) 2004-2013  Nicola Asuni - Tecnick.com LTD
//
// This file is part of TCPDF software library.
//
// TCPDF is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// TCPDF is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with TCPDF.  If not, see <http://www.gnu.org/licenses/>.
//
// See LICENSE.TXT file for more information.
//============================================================+

/**
 * Configuration file for TCPDF.
 * @author Nicola Asuni
 * @package com.tecnick.tcpdf
 * @version 4.9.005
 * @since 2004-10-27
 */

// If you define the constant K_TCPDF_EXTERNAL_CONFIG, the following settings will be ignored.

if (!defined('K_TCPDF_EXTERNAL_CONFIG')) {

    define('K_TCPDF_EXTERNAL_CONFIG', true);

    // DOCUMENT_ROOT fix for IIS Webserver
    if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) {
        if (isset($_SERVER['SCRIPT_FILENAME'])) {
            $_SERVER['DOCUMENT_ROOT'] = str_replace(
                '\\',
                '/',
                substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF']))
            );
        } elseif (isset($_SERVER['PATH_TRANSLATED'])) {
            $_SERVER['DOCUMENT_ROOT'] = str_replace(
                '\\',
                '/',
                substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF']))
            );
        } else {
            // define here your DOCUMENT_ROOT path if the previous fails (e.g. '/var/www')
            $_SERVER['DOCUMENT_ROOT'] = '/var/www';
        }
    }

    // be sure that the end slash is present
    $_SERVER['DOCUMENT_ROOT'] = str_replace('//', '/', $_SERVER['DOCUMENT_ROOT'].'/');

	/**
	 * Installation path of tcpdf with composer.
	 */
    $vendorFolders = array(
        dirname(dirname(__FILE__)) . '/../../vendor/',
        dirname(dirname(__FILE__)) . '/../../../../',
    );
    foreach ($vendorFolders as $vendorFolder) {
        if (file_exists($vendorFolder.'autoload.php')) {
            $k_path_main = $vendorFolder . 'tecnickcom/tcpdf/';

            break;
        }
    }

    if (!isset($k_path_main)) {
        echo "
      [ERROR]
         It seems that HTML2PDF dependencies are not installed...
         you must install thems with `composer install`

";
        exit;
    }
    define ('K_PATH_MAIN', $k_path_main);

    // Automatic calculation for the following K_PATH_URL constant
	$k_path_url = $k_path_main; // default value for console mode
    if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) {
        if (isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND strtolower($_SERVER['HTTPS'])!='off') {
			$k_path_url = 'https://';
        } else {
			$k_path_url = 'http://';
        }
		$k_path_url .= $_SERVER['HTTP_HOST'];
		$k_path_url .= str_replace( '\\', '/', substr(K_PATH_MAIN, (strlen($_SERVER['DOCUMENT_ROOT']) - 1)));
    }

    /**
     * URL path to tcpdf installation folder (http://localhost/tcpdf/).
     * By default it is automatically calculated but you can also set it as a fixed string to improve performances.
     */
	define ('K_PATH_URL', $k_path_url);

    /**
     * path for PDF fonts
     * use K_PATH_MAIN.'fonts/old/' for old non-UTF8 fonts
     */
    define('K_PATH_FONTS', K_PATH_MAIN.'fonts/');

    /**
     * cache directory for temporary files (url path)
     */
    define('K_PATH_URL_CACHE', K_PATH_URL.'cache/');

    /**
     *images directory
     */
    define('K_PATH_IMAGES', K_PATH_MAIN.'images/');

    /**
     * blank image
     */
    define('K_BLANK_IMAGE', K_PATH_IMAGES.'_blank.png');

    /**
     * page format
     */
    define('PDF_PAGE_FORMAT', 'A4');

    /**
     * page orientation (P=portrait, L=landscape)
     */
    define('PDF_PAGE_ORIENTATION', 'P');

    /**
     * document creator
     */
    define('PDF_CREATOR', 'HTML2PDF - TCPDF');

    /**
     * document author
     */
    define('PDF_AUTHOR', 'HTML2PDF - TCPDF');

    /**
     * header title
     */
    define('PDF_HEADER_TITLE', null);

    /**
     * header description string
     */
    define('PDF_HEADER_STRING', null);

    /**
     * image logo
     */
    define('PDF_HEADER_LOGO', null);

    /**
     * header logo image width [mm]
     */
    define('PDF_HEADER_LOGO_WIDTH', null);

    /**
     *  document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]
     */
    define('PDF_UNIT', 'mm');

    /**
     * header margin
     */
    define('PDF_MARGIN_HEADER', 0);

    /**
     * footer margin
     */
    define('PDF_MARGIN_FOOTER', 0);

    /**
     * top margin
     */
    define('PDF_MARGIN_TOP', 0);

    /**
     * bottom margin
     */
    define('PDF_MARGIN_BOTTOM', 0);

    /**
     * left margin
     */
    define('PDF_MARGIN_LEFT', 0);

    /**
     * right margin
     */
    define('PDF_MARGIN_RIGHT', 0);

    /**
     * default main font name
     */
    define('PDF_FONT_NAME_MAIN', 'helvetica');

    /**
     * default main font size
     */
    define('PDF_FONT_SIZE_MAIN', 10);

    /**
     * default data font name
     */
    define('PDF_FONT_NAME_DATA', 'helvetica');

    /**
     * default data font size
     */
    define('PDF_FONT_SIZE_DATA', 8);

    /**
     * default monospaced font name
     */
    define('PDF_FONT_MONOSPACED', 'courier');

    /**
     * ratio used to adjust the conversion of pixels to user units
     */
    define('PDF_IMAGE_SCALE_RATIO', 1);

    /**
     * magnification factor for titles
     */
    define('HEAD_MAGNIFICATION', 1);

    /**
     * height of cell respect font height
     */
    define('K_CELL_HEIGHT_RATIO', 1);

    /**
     * title magnification respect main font size
     */
    define('K_TITLE_MAGNIFICATION', 1);

    /**
     * reduction factor for small font
     */
    define('K_SMALL_RATIO', 2/3);

    /**
     * set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language
     */
    define('K_THAI_TOPCHARS', true);

    /**
     * if true allows to call TCPDF methods using HTML syntax
     * IMPORTANT: For security reason, disable this feature if you are printing user HTML content.
     */
    define('K_TCPDF_CALLS_IN_HTML', false);

	/**
	 * if true and PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution.
	 */
	define('K_TCPDF_THROW_EXCEPTION_ERROR', true);
}

//============================================================+
// END OF FILE
//============================================================+


text:
package net.wendal.nutzbook.ui.activity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.widget.TextView;
import android.widget.Toast;

import com.rey.material.widget.Switch;
import com.squareup.picasso.Cache;
import com.squareup.picasso.Picasso;

import net.wendal.nutzbook.R;
import net.wendal.nutzbook.storage.SettingShared;
import net.wendal.nutzbook.ui.listener.NavigationFinishClickListener;

import java.lang.reflect.Field;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class SettingActivity extends BaseActivity implements Switch.OnCheckedChangeListener {

    @Bind(R.id.setting_toolbar)
    protected Toolbar toolbar;

    @Bind(R.id.setting_switch_notification)
    protected Switch switchNotification;

    @Bind(R.id.setting_switch_new_topic_draft)
    protected Switch switchNewTopicDraft;

    @Bind(R.id.setting_switch_topic_sign)
    protected Switch switchTopicSign;

    @Bind(R.id.setting_btn_modify_topic_sign)
    protected TextView btnModifyTopicSign;

//    @Bind(R.id.setting_switch_third_party_image_upload_api)
//    protected Switch switchThirdPartyImageUploadApi;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        ButterKnife.bind(this);

        toolbar.setNavigationOnClickListener(new NavigationFinishClickListener(this));

        switchNotification.setChecked(SettingShared.isEnableNotification(this));
        switchNewTopicDraft.setChecked(SettingShared.isEnableNewTopicDraft(this));
        switchTopicSign.setChecked(SettingShared.isEnableTopicSign(this));
        btnModifyTopicSign.setEnabled(SettingShared.isEnableTopicSign(this));
        //switchThirdPartyImageUploadApi.setChecked(SettingShared.isEnableThirdPartyImageUploadApi(this));

        switchNotification.setOnCheckedChangeListener(this);
        switchNewTopicDraft.setOnCheckedChangeListener(this);
        switchTopicSign.setOnCheckedChangeListener(this);
    }

    @OnClick(R.id.setting_btn_notification)
    protected void onBtnNotificationClick() {
        switchNotification.toggle();
    }

    @OnClick(R.id.setting_btn_new_topic_draft)
    protected void onBtnNewTopicDraftClick() {
        switchNewTopicDraft.toggle();
    }

    @OnClick(R.id.setting_btn_topic_sign)
    protected void onBtnTopicSignClick() {
        switchTopicSign.toggle();
    }

//    @OnClick(R.id.setting_btn_third_party_image_upload_api)
//    protected void onBtnThirdPartyImageUploadApiClick() {
//        switchThirdPartyImageUploadApi.toggle();
//    }

    @Override
    public void onCheckedChanged(Switch switchView, boolean isChecked) {
        switch (switchView.getId()) {
            case R.id.setting_switch_notification:
                SettingShared.setEnableNotification(this, isChecked);
                break;
            case R.id.setting_switch_new_topic_draft:
                SettingShared.setEnableNewTopicDraft(this, isChecked);
                break;
            case R.id.setting_switch_topic_sign:
                SettingShared.setEnableTopicSign(this, isChecked);
                btnModifyTopicSign.setEnabled(isChecked);
                break;
//            case R.id.setting_switch_third_party_image_upload_api:
//                SettingShared.setEnableThirdPartyImageUploadApi(this, isChecked);
//
//                // TODO
//                //Toast.makeText(this, "该功能暂未实现", Toast.LENGTH_SHORT).show();
//                // TODO
//
//                break;
        }
    }

    @OnClick(R.id.setting_btn_modify_topic_sign)
    protected void onBtnModifyTopicSignClick() {
        startActivity(new Intent(this, ModifyTopicSignActivity.class));
    }

    @OnClick(R.id.setting_btn_clear_avatar_cache)
    protected void onBtnClearAvatarCacheClick() {
        Picasso picasso = Picasso.with(this);
        try {
            Field field = Picasso.class.getDeclaredField("cache");
            field.setAccessible(true);
            ((Cache)field.get(picasso)).clear();
            Toast.makeText(this, "搞定^_^", Toast.LENGTH_SHORT).show();
        } catch (Exception e) {
            Toast.makeText(this, "失败-_-", Toast.LENGTH_SHORT).show();
        }
    }

    @Override
    public String name() {
        return "配置界面";
    }
}


text:
from django import forms
from django.template.loader import render_to_string
from django.core.mail import EmailMultiAlternatives

from eventi.receipts.models import Receipt
from eventi.subscriptions.models import Subscription

class ReceiptForm(forms.ModelForm):
    class Meta:
        model = Receipt

    def send_mail(self, pk):
        subject = u'Lions Clubes, comprovante enviado.'
        context = {
            'name': self.cleaned_data['name'],
            'subscription': self.cleaned_data['subscription'],
        }

        s = Subscription.objects.get(pk=self.cleaned_data['subscription'])
        if s:
            email_to = s.email
        else:
            email_to = ''

        message = render_to_string('receipts/receipt_mail.txt', context)
        message_html = render_to_string('receipts/receipt_mail.html',
                                        context)
        msg = EmailMultiAlternatives(subject, message,
                                     'convencao@lionsclubegaranhuns.org.br',
                                     [email_to])

        msg.attach_alternative(message_html, 'text/html')
        msg.send()


text:
package org.xdi.oxauth.interop;

import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
import org.xdi.oxauth.BaseTest;
import org.xdi.oxauth.client.*;
import org.xdi.oxauth.model.common.AuthenticationMethod;
import org.xdi.oxauth.model.common.GrantType;
import org.xdi.oxauth.model.common.Prompt;
import org.xdi.oxauth.model.common.ResponseType;
import org.xdi.oxauth.model.register.ApplicationType;
import org.xdi.oxauth.model.util.StringUtils;

import java.util.Arrays;
import java.util.List;
import java.util.UUID;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;

/**
 * OC5:FeatureTest-Support prompt value login
 *
 * @author Javier Rojas Blum
 * @version August 9, 2017
 */
public class SupportPromptValueLogin extends BaseTest {

    @Parameters({"userId", "userSecret", "redirectUris", "redirectUri", "sectorIdentifierUri"})
    @Test
    public void supportPromptValueLogin(
            final String userId, final String userSecret, final String redirectUris, final String redirectUri,
            final String sectorIdentifierUri) throws Exception {
        showTitle("OC5:FeatureTest-Support prompt value login");

        List<ResponseType> responseTypes = Arrays.asList(ResponseType.CODE);

        // 1. Register client
        RegisterRequest registerRequest = new RegisterRequest(ApplicationType.WEB, "oxAuth test app",
                StringUtils.spaceSeparatedToList(redirectUris));
        registerRequest.setResponseTypes(responseTypes);
        registerRequest.setSectorIdentifierUri(sectorIdentifierUri);

        RegisterClient registerClient = new RegisterClient(registrationEndpoint);
        registerClient.setRequest(registerRequest);
        RegisterResponse registerResponse = registerClient.exec();

        showClient(registerClient);
        assertEquals(registerResponse.getStatus(), 200, "Unexpected response code: " + registerResponse.getEntity());
        assertNotNull(registerResponse.getClientId());
        assertNotNull(registerResponse.getClientSecret());
        assertNotNull(registerResponse.getRegistrationAccessToken());
        assertNotNull(registerResponse.getClientIdIssuedAt());
        assertNotNull(registerResponse.getClientSecretExpiresAt());

        String clientId = registerResponse.getClientId();
        String clientSecret = registerResponse.getClientSecret();

        String sessionId;
        {
            // 2. Request authorization
            List<String> scopes = Arrays.asList("openid", "profile", "address", "email");
            String nonce = UUID.randomUUID().toString();
            String state = UUID.randomUUID().toString();

            AuthorizationRequest authorizationRequest = new AuthorizationRequest(responseTypes, clientId, scopes, redirectUri, nonce);
            authorizationRequest.setState(state);

            AuthorizationResponse authorizationResponse = authenticateResourceOwnerAndGrantAccess(
                    authorizationEndpoint, authorizationRequest, userId, userSecret);

            assertNotNull(authorizationResponse.getLocation());
            assertNotNull(authorizationResponse.getCode());
            assertNotNull(authorizationResponse.getState());
            assertNotNull(authorizationResponse.getScope());

            String authorizationCode = authorizationResponse.getCode();
            sessionId = authorizationResponse.getSessionId();

            // 3. Get Access Token
            TokenRequest tokenRequest = new TokenRequest(GrantType.AUTHORIZATION_CODE);
            tokenRequest.setCode(authorizationCode);
            tokenRequest.setRedirectUri(redirectUri);
            tokenRequest.setAuthUsername(clientId);
            tokenRequest.setAuthPassword(clientSecret);
            tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_BASIC);

            TokenClient tokenClient = new TokenClient(tokenEndpoint);
            tokenClient.setRequest(tokenRequest);
            TokenResponse tokenResponse = tokenClient.exec();

            showClient(tokenClient);
            assertEquals(tokenResponse.getStatus(), 200, "Unexpected response code: " + tokenResponse.getStatus());
            assertNotNull(tokenResponse.getEntity(), "The entity is null");
            assertNotNull(tokenResponse.getAccessToken(), "The access token is null");
            assertNotNull(tokenResponse.getExpiresIn(), "The expires in value is null");
            assertNotNull(tokenResponse.getTokenType(), "The token type is null");
            assertNotNull(tokenResponse.getRefreshToken(), "The refresh token is null");
        }

        {
            // 4. Request authorization
            List<String> scopes = Arrays.asList("openid", "profile", "address", "email");
            String nonce = UUID.randomUUID().toString();
            String state = UUID.randomUUID().toString();

            AuthorizationRequest authorizationRequest = new AuthorizationRequest(responseTypes, clientId, scopes, redirectUri, nonce);
            authorizationRequest.setState(state);
            authorizationRequest.getPrompts().add(Prompt.LOGIN);
            authorizationRequest.setSessionId(sessionId);

            AuthorizationResponse authorizationResponse = authenticateResourceOwner(
                    authorizationEndpoint, authorizationRequest, userId, userSecret, false);

            assertNotNull(authorizationResponse.getLocation());
            assertNotNull(authorizationResponse.getCode());
            assertNotNull(authorizationResponse.getState());
            assertNotNull(authorizationResponse.getScope());

            String authorizationCode = authorizationResponse.getCode();

            // 5. Get Access Token
            TokenRequest tokenRequest = new TokenRequest(GrantType.AUTHORIZATION_CODE);
            tokenRequest.setCode(authorizationCode);
            tokenRequest.setRedirectUri(redirectUri);
            tokenRequest.setAuthUsername(clientId);
            tokenRequest.setAuthPassword(clientSecret);
            tokenRequest.setAuthenticationMethod(AuthenticationMethod.CLIENT_SECRET_BASIC);

            TokenClient tokenClient = new TokenClient(tokenEndpoint);
            tokenClient.setRequest(tokenRequest);
            TokenResponse tokenResponse = tokenClient.exec();

            showClient(tokenClient);
            assertEquals(tokenResponse.getStatus(), 200, "Unexpected response code: " + tokenResponse.getStatus());
            assertNotNull(tokenResponse.getEntity(), "The entity is null");
            assertNotNull(tokenResponse.getAccessToken(), "The access token is null");
            assertNotNull(tokenResponse.getExpiresIn(), "The expires in value is null");
            assertNotNull(tokenResponse.getTokenType(), "The token type is null");
            assertNotNull(tokenResponse.getRefreshToken(), "The refresh token is null");
        }
    }
}


text:
public class Unconvertable {
    public void cantConvertThis() {
        TestClass2 tester = new TestClass2();
        tester.test(null);
    }
}


text:
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace dbqf.core.tests.Display.Advanced
{
    [TestFixture]
    public class AdvancedAdapter_Delete_Fixture
    {
        /// <summary>
        /// A, no selection, delete A.
        /// Outcome: A is deleted.
        /// </summary>
        [Test]
        public void A_no_selection()
        {

        }

        /// <summary>
        /// A, selected, delete A.
        /// Outcome: Part is deleted and SelectedPart null
        /// </summary>
        [Test]
        public void A_selected()
        {

        }

        /// <summary>
        /// Delete part with 3 parts in 1 junction, not selected
        /// Outcome: Part is deleted, junction remains with 2 parts
        /// </summary>
        [Test]
        public void ABC_junction_no_selection_delete_A()
        {

        }

        /// <summary>
        /// Delete selected part with 3 parts in 1 junction, 1 selected.
        /// Outcome: Part is deleted, junction remains with 2 parts, SelectedPart null.
        /// </summary>
        [Test]
        public void ABC_junction_A_selected_delete_A()
        {

        }

        /// <summary>
        /// Delete root junction with 2 parts, no selection.
        /// Outcome: 2 parts and junction deleted, root null.
        /// </summary>
        [Test]
        public void AB_junction_no_selection_delete_junction()
        {

        }

        /// <summary>
        /// Delete root junction with 2 parts, 1 selected.
        /// Outcome: 2 parts and junction deleted, root null, SelectedPart null.
        /// </summary>
        [Test]
        public void AB_junction_A_selected_delete_junction()
        {

        }

        /// <summary>
        /// Delete part with 2 parts in 1 junction, no selection.
        /// Outcome: Part and junction deleted, remaining part becomes root
        /// </summary>
        [Test]
        public void AB_junction_no_selection_delete_A()
        {

        }

        /// <summary>
        /// Delete selected part with 2 parts in 1 junction, 1 selected.
        /// Outcome: Part and junction deleted, remaining part becomes root, SelectedPart null.
        /// </summary>
        [Test]
        public void AB_junction_A_selected_delete_A()
        {

        }

        /// <summary>
        /// and(A, B, or(C, D)), delete C
        /// Outcome: and(A, B, D).
        /// </summary>
        [Test]
        public void AB_orCD_junction_no_selection_delete_C()
        {

        }

        /// <summary>
        /// and(A, or(B, and(C, or(D, E selected)))), delete or(B, ...).
        /// Outcome: A, SelectedPart null
        /// </summary>
        [Test]
        public void A_orB_andC_orDE_junction_E_selected_delete_orB()
        {

        }
    }
}


text:
package ping

import (
	"context"

	"go-common/app/interface/main/app-resource/conf"
	pgdao "go-common/app/interface/main/app-resource/dao/plugin"
)

type Service struct {
	pgDao *pgdao.Dao
}

func New(c *conf.Config) (s *Service) {
	s = &Service{
		pgDao: pgdao.New(c),
	}
	return
}

func (s *Service) Ping(c context.Context) (err error) {
	return s.pgDao.PingDB(c)
}


text:
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <!--
    <parameters>
        <parameter key="marincsak_istvan_api.example.class">MarincsakIstvan\ApiBundle\Example</parameter>
    </parameters>

    <services>
        <service id="marincsak_istvan_api.example" class="%marincsak_istvan_api.example.class%">
            <argument type="service" id="service_id" />
            <argument>plain_value</argument>
            <argument>%parameter_name%</argument>
        </service>
    </services>
    -->

    <services>
            <service id="marincsak_istvan_api.response_formatter" class="MarincsakIstvan\ApiBundle\Service\ResponseFormatter" />
     </services>
</container>


text:
SDLLogFileModule Class Reference

Section Contents

name

files

logLevel

-init

-initWithName:files:level:

-initWithName:files:

+moduleWithName:files:

-containsFile:

Overview

A log file module is a collection of source code files that form a cohesive unit and that logs can all use to describe themselves. E.g. a “transport” module, or a “Screen Manager” module.

      name

The name of the this module, e.g. “Transport”

Objective-C

@property (nonatomic, copy, readonly) NSString *_Nonnull name;

Swift

var name: String { get }

      files

All of the files contained within this module. When a log is logged, the __FILE__ (in Obj-C) or #file (in Swift) is automatically captured and checked to see if any module has a file in this set that matches. If it does, it will be logged using the module’s log level and the module’s name will be printed in the formatted log.

Objective-C

@property (nonatomic, copy, readonly) NSSet<NSString *> *_Nonnull files;

Swift

var files: Set<String> { get }

      logLevel

The custom level of the log. This is SDLLogLevelDefault (whatever the current global log level is) by default.

Objective-C

@property (nonatomic) SDLLogLevel logLevel;

Swift

var logLevel: SDLLogLevel { get set }

      -init

This method is unavailable and may not be used.

Objective-C

- (nonnull instancetype)init;

Return Value

Always returns nil

      -initWithName:files:level:

Returns an initialized SDLLogFileModule that contains a custom name, set of files, and associated log level.

Objective-C

- (nonnull instancetype)initWithName:(nonnull NSString *)name
                               files:(nonnull NSSet<NSString *> *)files
                               level:(SDLLogLevel)level;

Swift

init(name: String, files: Set<String>, level: SDLLogLevel)

Parameters

name

The name of this module. This will be used when printing a formatted log for a file within this module e.g. “Transport”.

files

The files this module covers. This should correspond to a __FILE__ or #file call for use when comparing a log to this module. Any log originating in a file contained in this set will then use this module’s log level and print the module name.

level

The custom logging level logs originating in files contained in this log module will use. For example, if the global level is SDLLogLevelError and this module is configured to SDLLogLevelVerbose, all logs originating from files within this module will be logged, not merely error logs.

Return Value

An initialized SDLLogFileModule

      -initWithName:files:

Returns an initialized SDLLogFileModule that contains a custom name and set of files. The logging level is the same as the current global logging file by using SDLLogLevelDefault.

Objective-C

- (nonnull instancetype)initWithName:(nonnull NSString *)name
                               files:(nonnull NSSet<NSString *> *)files;

Swift

convenience init(name: String, files: Set<String>)

Parameters

name

The name of this module. This will be used when printing a formatted log for a file within this module e.g. “Transport”.

files

The files this module covers. This should correspond to a __FILE__ or #file call for use when comparing a log to this module. Any log originating in a file contained in this set will then use this module’s log level and print the module name.

Return Value

An initialized SDLLogFileModule

      +moduleWithName:files:

Returns an initialized SDLLogFileModule that contains a custom name and set of files. The logging level is the same as the current global logging file by using SDLLogLevelDefault.

Objective-C

+ (nonnull instancetype)moduleWithName:(nonnull NSString *)name
                                 files:(nonnull NSSet<NSString *> *)files;

Parameters

name

The name of this module. This will be used when printing a formatted log for a file within this module e.g. “Transport”.

files

The files this module covers. This should correspond to a __FILE__ or #file call for use when comparing a log to this module. Any log originating in a file contained in this set will then use this module’s log level and print the module name.

Return Value

An initialized SDLLogFileModule

      -containsFile:

Returns whether or not this module contains a given file.

Objective-C

- (BOOL)containsFile:(nonnull NSString *)fileName;

Swift

func containsFile(_ fileName: String) -> Bool

Parameters

fileName

The file name to check

Return Value

A BOOL, YES if this module contains the given file.