text:
package mesosphere.marathon.core.task.tracker.impl

import akka.actor.{ ActorRef, Status }
import akka.util.Timeout
import mesosphere.marathon.Protos.MarathonTask
import mesosphere.marathon.core.task.bus.TaskChangeObservables.TaskChanged
import mesosphere.marathon.core.task.tracker.impl.TaskOpProcessorImpl.TaskStateOpResolver
import mesosphere.marathon.core.task.tracker.{ TaskTracker, TaskTrackerConfig }
import mesosphere.marathon.core.task.{ Task, TaskStateChange, TaskStateOp }
import mesosphere.marathon.storage.repository.TaskRepository
import org.slf4j.LoggerFactory

import scala.concurrent.{ ExecutionContext, Future }
import scala.util.control.NonFatal

private[tracker] object TaskOpProcessorImpl {

  /**
    * Maps a [[TaskStateOp]] to the appropriate [[TaskStateChange]].
    *
    * @param directTaskTracker a TaskTracker instance that goes directly to the correct taskTracker
    *                          without going through the WhenLeaderActor indirection.
    */
  class TaskStateOpResolver(directTaskTracker: TaskTracker) {
    private[this] val log = LoggerFactory.getLogger(getClass)

    /**
      * Maps the TaskStateOp
      *
      * * a TaskStateChange.Failure if the task does not exist OR ELSE
      * * delegates the TaskStateOp to the existing task that will then determine the state change
      */
    def resolve(op: TaskStateOp)(implicit ec: ExecutionContext): Future[TaskStateChange] = {
      op match {
        case op: TaskStateOp.LaunchEphemeral => updateIfNotExists(op.taskId, op.task)
        case op: TaskStateOp.LaunchOnReservation => updateExistingTask(op)
        case op: TaskStateOp.MesosUpdate => updateExistingTask(op)
        case op: TaskStateOp.ReservationTimeout => updateExistingTask(op)
        case op: TaskStateOp.Reserve => updateIfNotExists(op.taskId, op.task)
        case op: TaskStateOp.ForceExpunge => expungeTask(op.taskId)
        case op: TaskStateOp.Revert =>
          Future.successful(TaskStateChange.Update(newState = op.task, oldState = None))
      }
    }

    private[this] def updateIfNotExists(taskId: Task.Id, updatedTask: Task)(
      implicit
      ec: ExecutionContext): Future[TaskStateChange] = {
      directTaskTracker.task(taskId).map {
        case Some(existingTask) =>
          TaskStateChange.Failure(new IllegalStateException(s"$taskId of app [${taskId.runSpecId}] already exists"))

        case None => TaskStateChange.Update(newState = updatedTask, oldState = None)
      }
    }

    private[this] def updateExistingTask(op: TaskStateOp)(implicit ec: ExecutionContext): Future[TaskStateChange] = {
      directTaskTracker.task(op.taskId).map {
        case Some(existingTask) =>
          existingTask.update(op)

        case None =>
          val taskId = op.taskId
          TaskStateChange.Failure(new IllegalStateException(s"$taskId of app [${taskId.runSpecId}] does not exist"))
      }
    }

    private[this] def expungeTask(taskId: Task.Id)(implicit ec: ExecutionContext): Future[TaskStateChange] = {
      directTaskTracker.task(taskId).map {
        case Some(existingTask) =>
          TaskStateChange.Expunge(existingTask)

        case None =>
          log.info("Ignoring ForceExpunge for [{}], task does not exist", taskId)
          TaskStateChange.NoChange(taskId)
      }
    }
  }
}

/**
  * Processes durable operations on tasks by storing the updated tasks in or removing them from the task repository
  */
private[tracker] class TaskOpProcessorImpl(
    taskTrackerRef: ActorRef,
    tasks: TaskRepository,
    stateOpResolver: TaskStateOpResolver,
    config: TaskTrackerConfig) extends TaskOpProcessor {
  import TaskOpProcessor._

  private[this] val log = LoggerFactory.getLogger(getClass)

  override def process(op: Operation)(implicit ec: ExecutionContext): Future[Unit] = {
    val stateChange = stateOpResolver.resolve(op.stateOp)
    stateChange.flatMap {
      case change: TaskStateChange.Expunge =>
        // Used for task termination or as a result from a UpdateStatus action.
        // The expunge is propagated to the taskTracker which in turn informs the sender about the success (see Ack).
        tasks.delete(op.taskId).map { _ => TaskTrackerActor.Ack(op.sender, change) }
          .recoverWith(tryToRecover(op)(expectedState = None, oldState = Some(change.task)))
          .flatMap { ack: TaskTrackerActor.Ack => notifyTaskTrackerActor(op, ack) }

      case change: TaskStateChange.Failure =>
        // Used if a task status update for a non-existing task is processed.
        // Since we did not change the task state, we inform the sender directly of the failed operation.
        op.sender ! Status.Failure(change.cause)
        Future.successful(())

      case change: TaskStateChange.NoChange =>
        // Used if a task status update does not result in any changes.
        // Since we did not change the task state, we inform the sender directly of the success of
        // the operation.
        op.sender ! change
        Future.successful(())

      case change: TaskStateChange.Update =>
        // Used for a create or as a result from a UpdateStatus action.
        // The update is propagated to the taskTracker which in turn informs the sender about the success (see Ack).
        tasks.store(change.newState).map { _ => TaskTrackerActor.Ack(op.sender, change) }
          .recoverWith(tryToRecover(op)(expectedState = Some(change.newState), oldState = change.oldState))
          .flatMap { ack => notifyTaskTrackerActor(op, ack) }
    }
  }

  private[this] def notifyTaskTrackerActor(op: Operation, ack: TaskTrackerActor.Ack)(
    implicit
    ec: ExecutionContext): Future[Unit] = {

    import akka.pattern.ask

    import scala.concurrent.duration._
    implicit val taskTrackerQueryTimeout: Timeout = config.internalTaskTrackerRequestTimeout().milliseconds

    val msg = TaskTrackerActor.StateChanged(taskChanged = TaskChanged(op.stateOp, ack.stateChange), ack)
    (taskTrackerRef ? msg).map(_ => ())
  }

  /**
    * If we encounter failure, we try to reload the effected task to make sure that the taskTracker
    * is up-to-date. We signal failure to the sender if the state is not as expected.
    *
    * If reloading the tasks also fails, the operation does fail.
    *
    * This tries to isolate failures that only effect certain tasks, e.g. errors in the serialization logic
    * which are only triggered for a certain combination of fields.
    */
  private[this] def tryToRecover(op: Operation)(expectedState: Option[Task], oldState: Option[Task])(
    implicit
    ec: ExecutionContext): PartialFunction[Throwable, Future[TaskTrackerActor.Ack]] = {

    case NonFatal(cause) =>
      def ack(actualTaskState: Option[MarathonTask], change: TaskStateChange): TaskTrackerActor.Ack = {
        val msg =
          if (expectedState.map(TaskSerializer.toProto) == actualTaskState) change
          else TaskStateChange.Failure(cause)
        TaskTrackerActor.Ack(op.sender, msg)
      }

      log.warn(s"${op.taskId} of app [${op.taskId.runSpecId}]: try to recover from failed ${op.stateOp}", cause)

      tasks.get(op.taskId).map {
        case Some(task) =>
          val stateChange = TaskStateChange.Update(task, oldState)
          ack(Some(TaskSerializer.toProto(task)), stateChange)
        case None =>
          val stateChange = oldState match {
            case Some(oldTask) => TaskStateChange.Expunge(oldTask)
            case None => TaskStateChange.NoChange(op.taskId)
          }
          ack(None, stateChange)
      }.recover {
        case NonFatal(loadingFailure) =>
          log.warn(s"${op.taskId} of app [${op.taskId.runSpecId}]: task reloading failed as well", loadingFailure)
          throw cause
      }
  }
}


text:
namespace llvm {
  class ICmpInst;
  class Value;

  /// Encode a icmp predicate into a three bit mask. These bits are carefully
  /// arranged to allow folding of expressions such as:
  ///
  ///      (A < B) | (A > B) --> (A != B)
  ///
  /// Note that this is only valid if the first and second predicates have the
  /// same sign. It is illegal to do: (A u< B) | (A s> B)
  ///
  /// Three bits are used to represent the condition, as follows:
  ///   0  A > B
  ///   1  A == B
  ///   2  A < B
  ///
  /// <=>  Value  Definition
  /// 000     0   Always false
  /// 001     1   A >  B
  /// 010     2   A == B
  /// 011     3   A >= B
  /// 100     4   A <  B
  /// 101     5   A != B
  /// 110     6   A <= B
  /// 111     7   Always true
  ///
  unsigned getICmpCode(const ICmpInst *ICI, bool InvertPred = false);

  /// This is the complement of getICmpCode. It turns a predicate code into
  /// either a constant true or false or the predicate for a new ICmp.
  /// The sign is passed in to determine which kind of predicate to use in the
  /// new ICmp instruction.
  /// Non-NULL return value will be a true or false constant.
  /// NULL return means a new ICmp is needed. The predicate is output in Pred.
  Constant *getPredForICmpCode(unsigned Code, bool Sign, Type *OpTy,
                               CmpInst::Predicate &Pred);

  /// Return true if both predicates match sign or if at least one of them is an
  /// equality comparison (which is signless).
  bool predicatesFoldable(CmpInst::Predicate P1, CmpInst::Predicate P2);

  /// Decompose an icmp into the form ((X & Mask) pred 0) if possible. The
  /// returned predicate is either == or !=. Returns false if decomposition
  /// fails.
  bool decomposeBitTestICmp(Value *LHS, Value *RHS, CmpInst::Predicate &Pred,
                            Value *&X, APInt &Mask,
                            bool LookThroughTrunc = true);

} // end namespace llvm

#endif

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.ServiceModel.Channels;
using SoapCore.Extensibility;
using SoapCore.ServiceModel;

namespace SoapCore
{
	[Obsolete]
	internal sealed class ObsoleteMessageInspector : IMessageInspector2
	{
		private readonly IMessageInspector _inner;

		public ObsoleteMessageInspector(IMessageInspector inner)
		{
			_inner = inner;
		}

		public object AfterReceiveRequest(ref Message message, ServiceDescription serviceDescription)
		{
			return _inner.AfterReceiveRequest(ref message);
		}

		public void BeforeSendReply(ref Message reply, ServiceDescription serviceDescription, object correlationState)
		{
			_inner.BeforeSendReply(ref reply, correlationState);
		}
	}
}


text:
 <!-- * Copyright (C) 2022 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License. -->

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.mycompany.app</groupId>
  <artifactId>my-app</artifactId>
  <version>1.0-SNAPSHOT</version>

  <name>my-app</name>
  <!-- FIXME change it to the project's website -->
  <url>http://www.example.com</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>

    <dependency>
    <groupId>com.google.api-client</groupId>
    <artifactId>google-api-client</artifactId>
    <version>1.33.2</version>
  </dependency>

  <dependency>
   <groupId>com.google.apis</groupId>
   <artifactId>google-api-services-cloudsupport</artifactId>
   <version>v2beta-rev20211103-1.32.1</version>
 </dependency>

 <dependency>
   <groupId>com.google.auth</groupId>
   <artifactId>google-auth-library-oauth2-http</artifactId>
   <version>1.4.0</version>
 </dependency>

  </dependencies>

  <build>
    <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
      <plugins>
        <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.0.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.0.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
        <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.7.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>


text:
mkdir tmp
cp root.js tmp/

assert_errors "$FLOW" status .
cp tmp1/root.js ./
assert_ok "$FLOW" force-recheck root.js
assert_errors "$FLOW" status .

mv tmp/root.js ./
rmdir tmp


text:
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.

#pragma once

#include "CoreTypes.h"
#include "Containers/UnrealString.h"
#include "RpcMessage.h"
#include "UObject/ObjectMacros.h"

#include "RpcMessages.generated.h"

/* Service discovery
 *****************************************************************************/

USTRUCT()
struct FConfiguratorPing
{
	GENERATED_BODY()
};

USTRUCT()
struct FConfiguratorPong
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, Category="Message")
	FString ServerAddress;

	FConfiguratorPong() { }
	FConfiguratorPong(const FString& InServerAddress)
		: ServerAddress(InServerAddress)
	{ }
};

/* Command
*****************************************************************************/

UENUM()
enum class EConfiguratorCommand : uint8
{
	Reset,
	Tap,
	UpdateRotation,
	UpdateSelectedItem,
	UpdateVisualization,
	Zoom
};

USTRUCT()
struct FConfiguratorCommandRequest
	: public FRpcMessage
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, Category="Message")
	EConfiguratorCommand Command;

	UPROPERTY(EditAnywhere, Category="Message")
	int32 CategoryIndex;

	UPROPERTY(EditAnywhere, Category="Message")
	int32 ItemIndex;

	UPROPERTY(EditAnywhere, Category="Message")
	int32 ModeIndex;

	UPROPERTY(EditAnywhere, Category="Message")
	float Pitch;

	UPROPERTY(EditAnywhere, Category="Message")
	float Yaw;

	FConfiguratorCommandRequest(
		EConfiguratorCommand InCommand,
		int32 InCategoryIndex,
		int32 InItemIndex,
		int32 InModeIndex,
		float InPitch,
		float InYaw
	)
		: Command(InCommand)
		, CategoryIndex(InCategoryIndex)
		, ItemIndex(InItemIndex)
		, ModeIndex(InModeIndex)
		, Pitch(InPitch)
		, Yaw(InYaw)
	{ }

	FConfiguratorCommandRequest() { }
};

USTRUCT()
struct FConfiguratorCommandResponse
	: public FRpcMessage
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, Category="Message")
	int32 Result;

	FConfiguratorCommandResponse()
		: Result(INDEX_NONE)
	{ }

	FConfiguratorCommandResponse(int32 InResult)
		: Result(InResult)
	{ }
};

DECLARE_RPC(FConfiguratorCommand, int32)


text:
<!--
   This file is part of the X12Parser library that provides tools to
   manipulate X12 messages using Ruby native syntax.

   http://x12parser.rubyforge.org

   Copyright (C) 2009 APP Design, Inc.

   This library 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 2.1 of the License, or (at your option) any later version.

   This library 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 this library; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

   $Id: PKL.xml 78 2009-05-12 22:27:26Z ikk $
-->

<Segment name="PKL" comment="To identify the package level, quantity of stock-keeping units (SKUs), and other basic data related to the configuration of the package being defined">
  <Field name="ProductServiceIdQualifier" min="2" max="2" validation="T235" comment="Code identifying the type/source of the descriptive number used in Product/Service ID (234)"/>
  <Field name="ProductServiceId" min="1" max="48" comment="Identifying number for a product or service"/>
  <Field name="UnitOrBasisForMeasurementCode1" min="2" max="2" validation="T355" comment="Code specifying the units in which a value is being expressed, or manner in which a measurement has been taken"/>
  <Field name="Quantity" type="double" min="1" max="15" comment="Numeric value of quantity"/>
  <Field name="Height" type="double" required="y" min="1" max="8" comment="Vertical dimension of an object measured when the object is in the upright position"/>
  <Field name="Width" type="double" required="y" min="1" max="8" comment="Shorter measurement of the two horizontal dimensions measured with the object in the upright position"/>
  <Field name="ItemDepth" type="double" required="y" min="1" max="6" comment="The depth is the thickness of the product; in the dimension coordinate axes represented by X, Y and Z, depth is measured along the Z axis where X is the horizontal axis and Y is the vertical axis"/>
  <Field name="UnitOrBasisForMeasurementCode2" required="y" min="2" max="2" validation="T355" comment="Code specifying the units in which a value is being expressed, or manner in which a measurement has been taken"/>
  <Field name="GrossWeightPerPack" type="double" required="y" min="1" max="9" comment="Numeric value of gross weight per pack"/>
  <Field name="UnitOrBasisForMeasurementCode3" required="y" min="2" max="2" validation="T355" comment="Code specifying the units in which a value is being expressed, or manner in which a measurement has been taken"/>
  <Field name="GrossVolumePerPack" type="double" required="y" min="1" max="9" comment="Numeric value of gross volume per pack"/>
  <Field name="UnitOrBasisForMeasurementCode4" required="y" min="2" max="2" validation="T355" comment="Code specifying the units in which a value is being expressed, or manner in which a measurement has been taken"/>
  <Field name="YesNoConditionOrResponseCode" required="y" min="1" max="1" validation="T1073" comment="Code indicating a Yes or No condition or response"/>
</Segment>


text:
package org.apache.geode.cache.wan.internal.cli.commands;

import static org.apache.geode.cache.wan.internal.cli.commands.WanCopyRegionCommand.WAN_COPY_REGION__BATCHSIZE;
import static org.apache.geode.cache.wan.internal.cli.commands.WanCopyRegionCommand.WAN_COPY_REGION__CANCEL;
import static org.apache.geode.cache.wan.internal.cli.commands.WanCopyRegionCommand.WAN_COPY_REGION__MAXRATE;
import static org.assertj.core.api.Assertions.assertThat;

import org.junit.ClassRule;
import org.junit.Test;

import org.apache.geode.management.internal.cli.GfshParseResult;
import org.apache.geode.test.junit.rules.GfshParserRule;

public class WanCopyRegionCommandTest {
  @ClassRule
  public static GfshParserRule gfsh = new GfshParserRule();

  @Test
  public void gfshParserReturnsNullIfMandatoryOptionsNotSpecified() {
    assertThat(gfsh.parse("wan-copy region")).isNull();
    assertThat(gfsh.parse("wan-copy region --region=myregion")).isNull();
    assertThat(gfsh.parse("wan-copy region --sender-id=ln")).isNull();
    assertThat(gfsh.parse("wan-copy region --batch-size=10")).isNull();
  }

  @Test
  public void verifyDefaultValues() {
    GfshParseResult result = gfsh.parse("wan-copy region --region=myregion --sender-id=ln");
    assertThat(result.getParamValueAsString(WAN_COPY_REGION__MAXRATE)).isEqualTo("0");
    assertThat(result.getParamValueAsString(WAN_COPY_REGION__BATCHSIZE))
        .isEqualTo("1000");
    assertThat(result.getParamValueAsString(WAN_COPY_REGION__CANCEL))
        .isEqualTo("false");
  }
}


text:
#include <cmath>
#include <memory>
#include <vector>

#include "tensorflow/compiler/xla/array2d.h"
#include "tensorflow/compiler/xla/array4d.h"
#include "tensorflow/compiler/xla/client/computation.h"
#include "tensorflow/compiler/xla/client/computation_builder.h"
#include "tensorflow/compiler/xla/client/lib/arithmetic.h"
#include "tensorflow/compiler/xla/client/local_client.h"
#include "tensorflow/compiler/xla/legacy_flags/cpu_compiler_flags.h"
#include "tensorflow/compiler/xla/literal_util.h"
#include "tensorflow/compiler/xla/shape_util.h"
#include "tensorflow/compiler/xla/statusor.h"
#include "tensorflow/compiler/xla/tests/client_library_test_base.h"
#include "tensorflow/compiler/xla/tests/literal_test_util.h"
#include "tensorflow/compiler/xla/xla_data.pb.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/test.h"
#include "tensorflow/core/platform/types.h"

namespace xla {
namespace {

class BatchNormalizationTest : public ClientLibraryTestBase {
 protected:
  BatchNormalizationTest() : input_array_(kSamples, kZ, kY, kX) {
    Array2D<float> pz({
        // z0 z1
        {-1.0f, 4.1f},  // p0
        {2.0f, 4.1f},   // p1
        {5.0f, 4.4f},   // p2
    });
    input_array_.FillWithPZ(pz);
    input_literal_ = *LiteralUtil::CreateR4FromArray4D(input_array_);
    CHECK_EQ(kSamples, input_array_.planes());
    CHECK_EQ(kZ, input_array_.depth());
    CHECK_EQ(kY, input_array_.height());
    CHECK_EQ(kY, input_array_.width());
  }

  static constexpr int64 kSamples = 3;
  static constexpr int64 kX = 1;
  static constexpr int64 kY = 1;
  static constexpr int64 kZ = 2;

  Array4D<float> input_array_;
  Literal input_literal_;
  const ErrorSpec error_spec_{0.001, 0.001};
};

TEST_F(BatchNormalizationTest, SubtractInZ) {
  ComputationBuilder builder(client_, "subtract_in_z_one_sample");
  auto x = builder.ConstantLiteral(input_literal_);
  auto y = builder.ConstantR1<float>({3.14, 4.25});
  builder.Sub(x, y, /*broadcast_dimensions=*/{1});

  Array4D<float> expected(kSamples, kZ, kY, kX);
  Array2D<float> pz({
      {-1.0f - 3.14f, 4.1f - 4.25f},  // p0
      {2.0f - 3.14f, 4.1f - 4.25f},   // p1
      {5.0f - 3.14f, 4.4f - 4.25f},   // p2
  });
  expected.FillWithPZ(pz);
  ComputeAndCompareR4<float>(&builder, expected, {}, error_spec_);
}

TEST_F(BatchNormalizationTest, SquareTesseractElementwise) {
  ComputationBuilder builder(client_, "square_tesseract_elementwise");
  auto x = builder.ConstantLiteral(input_literal_);
  builder.SquareF32(x);

  Array4D<float> expected(kSamples, kZ, kY, kX);
  Array2D<float> expected_pz({
      {std::pow(-1.0f, 2.0f), std::pow(4.1f, 2.0f)},
      {std::pow(2.0f, 2.0f), std::pow(4.1f, 2.0f)},
      {std::pow(5.0f, 2.0f), std::pow(4.4f, 2.0f)},
  });
  expected.FillWithPZ(expected_pz);
  ComputeAndCompareR4<float>(&builder, expected, {}, error_spec_);
}

TEST_F(BatchNormalizationTest, SumToZ) {
  ComputationBuilder builder(client_, "sum_to_z");
  auto input_activations = builder.ConstantLiteral(input_literal_);
  Computation add = CreateScalarAddComputation(F32, &builder);
  // Reduce all but the Z dimension.
  builder.Reduce(input_activations, builder.ConstantR0<float>(0.0f), add,
                 {0, 2, 3});

  std::vector<float> expected = {6, 12.6};
  ComputeAndCompareR1<float>(&builder, expected, {}, error_spec_);
}

TEST_F(BatchNormalizationTest, SquareAndReduce) {
  ComputationBuilder builder(client_, "square_and_reduce");
  auto input_activations = builder.ConstantLiteral(input_literal_);
  auto set_means = builder.ConstantR1<float>({2.f, 4.2f});
  auto activation_deviations = builder.Sub(input_activations, set_means,
                                           /*broadcast_dimensions=*/{1});
  Computation add = CreateScalarAddComputation(F32, &builder);
  auto dev_squares = builder.SquareF32(activation_deviations);
  auto sum_of_squares = builder.Reduce(
      dev_squares, builder.ConstantR0<float>(0.0f), add, {0, 2, 3});

  std::vector<float> expected = {18, 0.06};
  ComputeAndCompareR1<float>(&builder, expected, {}, error_spec_);
}

TEST_F(BatchNormalizationTest, VarianceToStddev) {
  ComputationBuilder builder(client_, "variance_to_stddev");
  auto variance = builder.ConstantR1<float>({6.f, .02f});
  auto sqrt = builder.SqrtF32(variance);

  std::vector<float> expected = {2.44948974f, 0.14142136f};
  ComputeAndCompareR1<float>(&builder, expected, {}, error_spec_);
}

// Compare against a forward batch normalization example in the NN spec
// reference.
TEST_F(BatchNormalizationTest, SpecComparisonForward) {
  ComputationBuilder builder(client_, "batch_normalize_per_spec");
  auto input_activations =
      builder.CheckShape(builder.ConstantLiteral(input_literal_),
                         ShapeUtil::MakeShape(F32, {3, 2, 1, 1}));
  auto gamma = builder.ConstantR1<float>({1.0, 1.0});
  auto beta = builder.ConstantR1<float>({0.0, 0.0});
  Computation add = CreateScalarAddComputation(F32, &builder);
  // Reduce all dimensions except dimension 1.
  Shape TwoElementVectorF32 = ShapeUtil::MakeShape(F32, {2});
  auto sum = builder.CheckShape(
      builder.Reduce(input_activations, builder.ConstantR0<float>(0.0f), add,
                     /*dimensions_to_reduce=*/{0, 2, 3}),
      TwoElementVectorF32);
  auto input_shape = builder.GetShape(input_activations).ConsumeValueOrDie();
  auto sum_shape = builder.GetShape(sum).ConsumeValueOrDie();
  auto count = builder.ConstantR0<float>(ShapeUtil::ElementsIn(*input_shape) /
                                         ShapeUtil::ElementsIn(*sum_shape));
  auto set_means = builder.Div(sum, count);

  const float kEpsilon = 1e-9f;
  auto epsilon = builder.ConstantR0<float>(kEpsilon);
  auto epsilon2 = builder.ConstantR1<float>({kEpsilon, kEpsilon});
  auto activation_deviations = builder.Sub(input_activations, set_means,
                                           /*broadcast_dimensions=*/{1});
  auto dev_squares = builder.SquareF32(activation_deviations);
  auto sum_of_squares = builder.CheckShape(
      builder.Reduce(dev_squares, builder.ConstantR0<float>(0.0f), add,
                     /*dimensions_to_reduce=*/{0, 2, 3}),
      TwoElementVectorF32);
  auto variance = builder.Div(sum_of_squares, count);
  auto standard_deviation = builder.SqrtF32(variance);
  auto standard_deviation_above_epsilon = builder.CheckShape(
      builder.Gt(standard_deviation, epsilon), ShapeUtil::MakeShape(PRED, {2}));
  auto gt_eps = builder.Select(standard_deviation_above_epsilon,
                               standard_deviation, epsilon2);
  auto normalization_factors = builder.ReciprocalF32(gt_eps);
  auto normalized_input_activations =
      builder.Mul(activation_deviations, normalization_factors,
                  /*broadcast_dimensions=*/{1});
  /* auto output_activations = */ builder.Add(
      builder.Mul(normalized_input_activations, gamma,
                  /*broadcast_dimensions=*/{1}),
      beta, /*broadcast_dimensions=*/{1});

  Array4D<float> expected(kSamples, kZ, kY, kX);
  Array2D<float> pz({
      {-3.f / std::sqrt(6.f), -.1f / std::sqrt(.02f)},
      {0.f, -.1f / std::sqrt(.02f)},
      {3.f / std::sqrt(6.f), .2f / std::sqrt(.02f)},
  });
  expected.FillWithPZ(pz);

  ComputeAndCompareR4<float>(&builder, expected, {}, error_spec_);
}

}  // namespace
}  // namespace xla

int main(int argc, char** argv) {
  std::vector<tensorflow::Flag> flag_list;
  xla::legacy_flags::AppendCpuCompilerFlags(&flag_list);
  xla::string usage = tensorflow::Flags::Usage(argv[0], flag_list);
  const bool parse_result = tensorflow::Flags::Parse(&argc, argv, flag_list);
  if (!parse_result) {
    LOG(ERROR) << "\n" << usage;
    return 2;
  }
  testing::InitGoogleTest(&argc, argv);
  if (argc > 1) {
    LOG(ERROR) << "Unknown argument " << argv[1] << "\n" << usage;
    return 2;
  }
  return RUN_ALL_TESTS();
}


text:
require 'bundler/setup'
require 'game_codebreaker'
require 'rspec/collection_matchers'
load    'bin/game_codebreaker'

RSpec.configure do |config|

  config.after(:each) do
    dir = "./spec/game_codebreaker/fixtures/save_dump"
    File.delete( dir ) if File.exists?( dir )
  end

  config.mock_with :rspec do |c|
    c.syntax = [:should, :expect]
  end

end


text:
#include <stdlib.h>
#include <string.h>
#include <sys/uio.h>

#include <Python.h>
#include <corosync/cpg.h>

#define RETURN_ON_ERROR(code, function) \
    do if (code != CPG_OK) \
    { \
	PyErr_Format(py_cpg_error, "%s(): returned error %d", function, code); \
	return NULL; \
    } while (0)

#define RETURN_IF_NULL(value) \
    do if (value == NULL) { return NULL; } while (0)

#define RETURN_VOID_IF_NULL(value) \
    do if (value == NULL) { return; } while (0)

/*
 * Global variables
 */

static PyObject *py_cpg_error;

typedef struct
{
    cpg_handle_t handle;
    PyObject *callbacks;
} py_cpg_callbacks_t;

static py_cpg_callbacks_t *py_cpg_callbacks = NULL;
static int py_cpg_nr_callbacks = 0;
static int py_cpg_alloc_callbacks = 0;
static const int py_cpg_start_callbacks = 10;

/*
 * Callback mapping utility functions.
 */

static int
py_cpg_init_callbacks()
{
    py_cpg_callbacks = calloc(py_cpg_start_callbacks,
			      sizeof (py_cpg_callbacks_t));
    if (py_cpg_callbacks == NULL)
    {
	PyErr_NoMemory();
	return -1;
    }
    py_cpg_alloc_callbacks = py_cpg_start_callbacks;
    return 0;
}

static int
py_cpg_add_callbacks(cpg_handle_t handle, PyObject *callbacks)
{
    if (py_cpg_nr_callbacks == py_cpg_alloc_callbacks)
    {
	py_cpg_callbacks = realloc(py_cpg_callbacks, py_cpg_alloc_callbacks * 2
				   * sizeof (py_cpg_callbacks_t));
	if (py_cpg_callbacks == NULL)
	{
	    PyErr_NoMemory();
	    return -1;
	}
	py_cpg_alloc_callbacks *= 2;
    }

    py_cpg_callbacks[py_cpg_nr_callbacks].handle = handle;
    py_cpg_callbacks[py_cpg_nr_callbacks].callbacks = callbacks;
    py_cpg_nr_callbacks += 1;

    return 0;
}

static void
py_cpg_remove_callbacks(cpg_handle_t handle)
{
    int i;

    for (i=0; i<py_cpg_nr_callbacks; i++)
    {
	if (py_cpg_callbacks[i].handle == handle)
	{
	    memmove(py_cpg_callbacks + i, py_cpg_callbacks + i + 1,
		    (py_cpg_nr_callbacks - i) * sizeof (py_cpg_callbacks_t));
	    py_cpg_nr_callbacks -= 1;
	    break;
	}
    }
}

static PyObject *
py_cpg_find_callbacks(cpg_handle_t handle)
{
    int i;

    for (i=0; i<py_cpg_nr_callbacks; i++)
    {
	if (py_cpg_callbacks[i].handle == handle)
	    return py_cpg_callbacks[i].callbacks;
    }
    return NULL;
}

/*
 * OpenAIS callbacks
 */

static void
py_cpg_deliver_fn(cpg_handle_t handle, struct cpg_name *group_name,
		  uint32_t nodeid, uint32_t pid, void *msg, int msg_len)
{
    PyObject *Pcallbacks, *Pname, *Paddr, *Pmessage, *Pmethod, *Pret;

    Pcallbacks = py_cpg_find_callbacks(handle);
    RETURN_VOID_IF_NULL(Pcallbacks);

    Pname = PyString_FromStringAndSize(group_name->value, group_name->length);
    RETURN_VOID_IF_NULL(Pname);

    Paddr = PyTuple_New(3);
    RETURN_VOID_IF_NULL(Paddr);
    PyTuple_SET_ITEM(Paddr, 0, PyInt_FromLong(nodeid));
    PyTuple_SET_ITEM(Paddr, 1, PyInt_FromLong(pid));
    PyTuple_SET_ITEM(Paddr, 2, PyInt_FromLong(0));

    Pmessage = PyString_FromStringAndSize(msg, msg_len);
    RETURN_VOID_IF_NULL(Pmessage);

    Pmethod = PyString_FromString("_deliver_fn");
    RETURN_VOID_IF_NULL(Pmethod);

    Pret = PyObject_CallMethodObjArgs(Pcallbacks, Pmethod, Pname, Paddr,
				      Pmessage, NULL);
    if (Pret == NULL)
	return;

    Py_DECREF(Pname);
    Py_DECREF(Paddr);
    Py_DECREF(Pmessage);
    Py_DECREF(Pmethod);
    Py_DECREF(Pret);
}

static void
py_cpg_confchg_fn(cpg_handle_t handle, struct cpg_name *group_name,
		  struct cpg_address *member_list, int member_list_entries,
		  struct cpg_address *left_list, int left_list_entries,
		  struct cpg_address *joined_list, int joined_list_entries)
{
    int i;
    PyObject *Pcallbacks, *Pname, *Pmembers, *Paddr, *Pleft, *Pjoined,
	     *Pmethod, *Pret;

    Pcallbacks = py_cpg_find_callbacks(handle);
    RETURN_VOID_IF_NULL(Pcallbacks);

    Pname = PyString_FromStringAndSize(group_name->value, group_name->length);
    RETURN_VOID_IF_NULL(Pname);

    Pmembers = PyList_New(member_list_entries);
    RETURN_VOID_IF_NULL(Pmembers);
    for (i=0; i<member_list_entries; i++)
    {
	Paddr = PyTuple_New(3);
	RETURN_VOID_IF_NULL(Paddr);
	PyTuple_SET_ITEM(Paddr, 0, PyInt_FromLong(member_list[i].nodeid));
	PyTuple_SET_ITEM(Paddr, 1, PyInt_FromLong(member_list[i].pid));
	PyTuple_SET_ITEM(Paddr, 2, PyInt_FromLong(member_list[i].reason));
	PyList_SET_ITEM(Pmembers, i, Paddr);
    }

    Pleft = PyList_New(left_list_entries);
    RETURN_VOID_IF_NULL(Pleft);
    for (i=0; i<left_list_entries; i++)
    {
	Paddr = PyTuple_New(3);
	RETURN_VOID_IF_NULL(Paddr);
	PyTuple_SET_ITEM(Paddr, 0, PyInt_FromLong(left_list[i].nodeid));
	PyTuple_SET_ITEM(Paddr, 1, PyInt_FromLong(left_list[i].pid));
	PyTuple_SET_ITEM(Paddr, 2, PyInt_FromLong(left_list[i].reason));
	PyList_SET_ITEM(Pleft, i, Paddr);
    }

    Pjoined = PyList_New(joined_list_entries);
    RETURN_VOID_IF_NULL(Pjoined);
    for (i=0; i<joined_list_entries; i++)
    {
	Paddr = PyTuple_New(3);
	RETURN_VOID_IF_NULL(Paddr);
	PyTuple_SET_ITEM(Paddr, 0, PyInt_FromLong(joined_list[i].nodeid));
	PyTuple_SET_ITEM(Paddr, 1, PyInt_FromLong(joined_list[i].pid));
	PyTuple_SET_ITEM(Paddr, 2, PyInt_FromLong(joined_list[i].reason));
	PyList_SET_ITEM(Pjoined, i, Paddr);
    }

    Pmethod = PyString_FromString("_confchg_fn");
    RETURN_VOID_IF_NULL(Pmethod);

    Pret = PyObject_CallMethodObjArgs(Pcallbacks, Pmethod, Pname, Pmembers,
				      Pleft, Pjoined, NULL);
    if (Pret == NULL)
	return;

    Py_DECREF(Pname);
    Py_DECREF(Pmembers);
    Py_DECREF(Pleft);
    Py_DECREF(Pjoined);
    Py_DECREF(Pmethod);
    Py_DECREF(Pret);
}

static void
py_cpg_groups_get_fn(cpg_handle_t handle, uint32_t group_num,
		    uint32_t group_total, struct cpg_name *group_name,
		    struct cpg_address *member_list, int member_list_entries)
{
    /* empty for now */
}

/*
 * Methods
 */

static PyObject *
py_cpg_initialize(PyObject *self, PyObject *args)
{
    int ret;
    cpg_handle_t handle;
    cpg_callbacks_t callbacks;
    PyObject *Phandle, *Pcallbacks;

    if (!PyArg_ParseTuple(args, "O", &Pcallbacks))
	return NULL;

    callbacks.cpg_deliver_fn = py_cpg_deliver_fn;
    callbacks.cpg_confchg_fn = py_cpg_confchg_fn;
    callbacks.cpg_groups_get_fn = py_cpg_groups_get_fn;

    ret = cpg_initialize(&handle, &callbacks);
    RETURN_ON_ERROR(ret, "cpg_initialize");

    ret = py_cpg_add_callbacks(handle, Pcallbacks);
    if (ret == -1)
	return NULL;

    Phandle = PyLong_FromLong(handle);
    return Phandle;
}

static PyObject *
py_cpg_finalize(PyObject *self, PyObject *args)
{
    int ret;
    cpg_handle_t handle;

    if (!PyArg_ParseTuple(args, "l", &handle))
	return NULL;

    ret = cpg_finalize(handle);
    RETURN_ON_ERROR(ret, "cpg_finalize");

    py_cpg_remove_callbacks(handle);

    Py_INCREF(Py_None);
    return Py_None;
}

static PyObject *
py_cpg_join(PyObject *self, PyObject *args)
{
    char *name;
    int length, ret;
    cpg_handle_t handle;
    struct cpg_name group_name;

    if (!PyArg_ParseTuple(args, "ls#", &handle, &name, &length))
	return NULL;

    if (length > CPG_MAX_NAME_LENGTH)
    {
	PyErr_Format(py_cpg_error, "Group name too long (%d, max length = %d)",
		     length, CPG_MAX_NAME_LENGTH);
	return NULL;
    }
    group_name.length = length;
    memcpy(group_name.value, name, length);

    ret = cpg_join(handle, &group_name);
    RETURN_ON_ERROR(ret, "cpg_join");

    Py_INCREF(Py_None);
    return Py_None;
}

static PyObject *
py_cpg_leave(PyObject *self, PyObject *args)
{
    char *name;
    int length, ret;
    cpg_handle_t handle;
    struct cpg_name group_name;

    if (!PyArg_ParseTuple(args, "ls#", &handle, &name, &length))
	return NULL;

    if (length > CPG_MAX_NAME_LENGTH)
    {
	PyErr_Format(py_cpg_error, "Group name too long (%d, max length = %d)",
		     length, CPG_MAX_NAME_LENGTH);
	return NULL;
    }
    group_name.length = length;
    memcpy(group_name.value, name, length);

    ret = cpg_leave(handle, &group_name);
    RETURN_ON_ERROR(ret, "cpg_leave");

    Py_INCREF(Py_None);
    return Py_None;
}

static PyObject *
py_cpg_dispatch(PyObject *self, PyObject *args)
{
    int ret;
    cpg_handle_t handle;
    cs_dispatch_flags_t dispatch;

    if (!PyArg_ParseTuple(args, "li", &handle, &dispatch))
	return NULL;

    ret = cpg_dispatch(handle, dispatch);
    RETURN_ON_ERROR(ret, "cpg_dispach");

    Py_INCREF(Py_None);
    return Py_None;
}

static PyObject *
py_cpg_fd_get(PyObject *self, PyObject *args)
{
    int fd, ret;
    cpg_handle_t handle;
    PyObject *Phandle;

    if (!PyArg_ParseTuple(args, "l", &handle))
	return NULL;

    ret = cpg_fd_get(handle, &fd);
    RETURN_ON_ERROR(ret, "cpg_fd_get");

    Phandle = PyInt_FromLong(fd);
    return Phandle;
}

static PyObject *
py_cpg_mcast_joined(PyObject *self, PyObject *args)
{
    int ret;
    void *data;
    size_t length;
    cpg_handle_t handle;
    cpg_guarantee_t guarantee;
    struct iovec iov;

    if (!PyArg_ParseTuple(args, "lis#", &handle, &guarantee, &data, &length))
	return NULL;

    iov.iov_base = data;
    iov.iov_len = length;

    ret = cpg_mcast_joined(handle, guarantee, &iov, 1);
    RETURN_ON_ERROR(ret, "cpg_mcast_joined");

    Py_INCREF(Py_None);
    return Py_None;
}

static PyObject *
py_cpg_membership_get(PyObject *self, PyObject *args)
{
    cpg_handle_t handle;
    struct cpg_name group_name;
    const int maxaddrs = 100;
    int naddrs = maxaddrs, i, ret;
    struct cpg_address addrs[maxaddrs];
    PyObject *Pname, *Paddr, *Paddrs, *Presult;

    if (!PyArg_ParseTuple(args, "l", &handle))
	return NULL;

    ret = cpg_membership_get(handle, &group_name, addrs, &naddrs);
    RETURN_ON_ERROR(ret, "cpg_membership_get");

    Pname = PyString_FromStringAndSize(group_name.value, group_name.length);
    RETURN_IF_NULL(Pname);

    Paddrs = PyList_New(naddrs);
    RETURN_IF_NULL(Paddrs);
    for (i=0; i<naddrs; i++)
    {
	Paddr = PyTuple_New(3);
	RETURN_IF_NULL(Paddr);
	PyTuple_SET_ITEM(Paddr, 0, PyInt_FromLong(addrs[i].nodeid));
	PyTuple_SET_ITEM(Paddr, 1, PyInt_FromLong(addrs[i].pid));
	PyTuple_SET_ITEM(Paddr, 2, PyInt_FromLong(addrs[i].reason));
	PyList_SET_ITEM(Paddrs, i, Paddr);
    }

    Presult = PyTuple_New(2);
    RETURN_IF_NULL(Presult);
    PyTuple_SET_ITEM(Presult, 0, Pname);
    PyTuple_SET_ITEM(Presult, 1, Paddrs);
    return Presult;
}

/*
 * Constants and methods.
 */

typedef struct
{
    const char *name;
    int value;
} py_cpg_constant_t;

static py_cpg_constant_t py_cpg_constants[] =
{
    { "REASON_JOIN", CPG_REASON_JOIN },
    { "REASON_LEAVE", CPG_REASON_LEAVE },
    { "REASON_NODEUP", CPG_REASON_NODEUP },
    { "REASON_NODEDOWN", CPG_REASON_NODEDOWN },
    { "DISPATCH_ONE", CPG_DISPATCH_ONE },
    { "DISPATCH_ALL", CPG_DISPATCH_ALL },
    { "DISPATCH_BLOCKING", CPG_DISPATCH_BLOCKING },
    { "TYPE_UNORDERED", CPG_TYPE_UNORDERED },
    { "TYPE_FIFO", CPG_TYPE_FIFO },
    { "TYPE_AGREED", CPG_TYPE_AGREED },
    { "TYPE_SAFE", CPG_TYPE_SAFE },
    { NULL, 0 }
};

typedef struct
{
    int code;
    const char *name;
} py_cpg_error_t;

static PyMethodDef py_cpg_methods[] =
{
    { "initialize", (PyCFunction) py_cpg_initialize, METH_VARARGS },
    { "finalize", (PyCFunction) py_cpg_finalize, METH_VARARGS },
    { "join", (PyCFunction) py_cpg_join, METH_VARARGS },
    { "leave", (PyCFunction) py_cpg_leave, METH_VARARGS },
    { "fd_get", (PyCFunction) py_cpg_fd_get, METH_VARARGS },
    { "membership_get", (PyCFunction) py_cpg_membership_get, METH_VARARGS },
    { "dispatch", (PyCFunction) py_cpg_dispatch, METH_VARARGS },
    { "mcast_joined", (PyCFunction) py_cpg_mcast_joined, METH_VARARGS },
    { NULL, NULL }
};

/*
 * Module initialization function
 */

void
init_cpg(void)
{
    int i;
    PyObject *Pmodule, *Pdict;

    Pmodule = Py_InitModule("_cpg", py_cpg_methods);
    Pdict = PyModule_GetDict(Pmodule);

    py_cpg_init_callbacks();

    py_cpg_error = PyErr_NewException("corosync._cpg.Error", NULL, NULL);
    PyDict_SetItemString(Pdict, "Error", py_cpg_error);

    for (i=0; py_cpg_constants[i].name != NULL; i++)
    {
	PyDict_SetItemString(Pdict, py_cpg_constants[i].name,
			     PyInt_FromLong(py_cpg_constants[i].value));
    }
}


text:
require 'rails_helper'

describe "reports/_capital_projects_report_rollup.html.haml", :type => :view do
  it 'info' do
    test_org = create(:organization)
    test_funding_source = create(:funding_source)
    test_proj = create(:capital_project, :organization => test_org)
    report = CapitalProjectsReport.new
    data = report.get_data(test_org, {:funding_source => test_funding_source})
    assign(:data, data)
    render

    expect(rendered).to have_content(test_org.short_name)
    expect(rendered).to have_content(1)
    expect(rendered).to have_content('$0')
  end
end


text:
body {
  font-family: "Tahoma";
  font-size: 0.85em; }

.current-slot {
  display: inline-block;
  padding: 5px;
  border: 1px solid #cccccc; }

.calendar-icon {
  display: inline-block;
  width: 25px;
  height: 25px;
  background-image: url("../img/calendar_image.gif");
  background-repeat: no-repeat;
  cursor: pointer;
  text-indent: 100%;
  white-space: nowrap;
  overflow: hidden; }

.cal-container {
  position: relative;
  width: 180px;
  padding: 10px;
  border: 1px solid #dddddd;
  background: #eeeeee;
  -webkit-box-shadow:  0 2px 3px 1px rgba(0, 0, 0, 0.075);
  -moz-box-shadow:  0 2px 3px 1px rgba(0, 0, 0, 0.075);
  -ms-box-shadow:  0 2px 3px 1px rgba(0, 0, 0, 0.075);
  -o-box-shadow:  0 2px 3px 1px rgba(0, 0, 0, 0.075);
  box-shadow:  0 2px 3px 1px rgba(0, 0, 0, 0.075); }
  .cal-container:before, .cal-container:after {
    content: " ";
    display: table; }
  .cal-container:after {
    clear: both; }
  .cal-container .controls > div {
    position: absolute;
    top: 10px;
    width: 25px;
    height: 25px;
    background-image: url("../img/ss-buttons-cal.png");
    background-repeat: no-repeat;
    cursor: pointer;
    text-indent: 100%;
    white-space: nowrap;
    overflow: hidden; }
  .cal-container .controls .left {
    left: 7px; }
  .cal-container .controls .right {
    right: 10px;
    background-position: -25px 0; }
  .cal-container .month-year {
    padding: 3px 0 13px 0;
    text-align: center; }
  .cal-container .days:before, .cal-container .days:after,
  .cal-container .cells:before,
  .cal-container .cells:after {
    content: " ";
    display: table; }
  .cal-container .days:after,
  .cal-container .cells:after {
    clear: both; }
  .cal-container .cells {
    width: 175px;
    border-left: 1px solid #cccccc;
    border-top: 1px solid #cccccc; }
  .cal-container .day,
  .cal-container .cell {
    float: left;
    width: 25px;
    height: 25px;
    text-align: center; }
  .cal-container .cell {
    width: 24px;
    height: auto;
    padding: 3px 0;
    border-right: 1px solid #cccccc;
    border-bottom: 1px solid #cccccc;
    font-size: 0.8em; }
    .cal-container .cell.is-active {
      background: white; }
    .cal-container .cell.is-current {
      background: #5c8018; }
      .cal-container .cell.is-current a {
        color: white; }
        .cal-container .cell.is-current a:hover {
          text-decoration: none; }
  .cal-container a {
    color: black;
    text-decoration: none; }
    .cal-container a:hover {
      text-decoration: underline; }
  .cal-container .cell.is-inactive a:hover {
    text-decoration: none; }


text:
namespace mozart {

// Definitions in UUID
constexpr size_t UUID::byte_count;

// Definitions of the uuid's of data types
constexpr UUID Atom::uuid;
constexpr UUID Boolean::uuid;
constexpr UUID BigInt::uuid;
constexpr UUID ByteString::uuid;
constexpr UUID GlobalName::uuid;
constexpr UUID NamedName::uuid;
constexpr UUID SmallInt::uuid;
constexpr UUID String::uuid;
constexpr UUID UniqueName::uuid;
constexpr UUID Unit::uuid;

// Bytecode for object dispatch procedure
const ByteCode Object::dispatchByteCode[9] = {
  OpMoveGX, 0, 1,
  OpInlineGetClass, 1, 2,
  OpTailCallG, 1, 3
};

}


text:
package org.jutge.joc.porra.utils;

/**
 * Raco utility methods + constants
 * @author Llop
 */
public class RacoUtils {

	//public static final String RACO_USERNAME_PATTERN = "([a-z-]+)(\\.[a-z-]+)+";
	public static final String RACO_MAIL_ACTION_PATTERN = "compose\\.php\\?uniq=([a-z0-9]+)";
	public static final String RACO_FORMTOKEN_PATTERN = "__formToken_compose\" value=\"[a-z0-9]+";

	public static String sanitizeUserName(final String userName) {
		if (userName != null) {
			return userName.replace('.', ' ');
		}
		return null;
	}

	public static String desanitizeUserName(final String userName) {
		if (userName != null) {
			return userName.replace(' ', '.');
		}
		return null;
	}

	private RacoUtils() {}

}


text:
/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.flowable.variable.service.impl.persistence.entity;

import java.util.Date;

import org.flowable.engine.common.impl.db.HasRevision;
import org.flowable.engine.common.impl.persistence.entity.Entity;
import org.flowable.variable.api.history.HistoricVariableInstance;
import org.flowable.variable.api.types.ValueFields;
import org.flowable.variable.api.types.VariableType;

/**
 * @author Christian Lipphardt (camunda)
 * @author Joram Barrez
 */
public interface HistoricVariableInstanceEntity extends ValueFields, HistoricVariableInstance, Entity, HasRevision {

    VariableType getVariableType();

    void setName(String name);

    void setVariableType(VariableType variableType);

    void setProcessInstanceId(String processInstanceId);

    void setTaskId(String taskId);

    void setCreateTime(Date createTime);

    void setLastUpdatedTime(Date lastUpdatedTime);

    void setExecutionId(String executionId);

    void setScopeId(String scopeId);

    void setSubScopeId(String subScopeId);

    void setScopeType(String scopeType);

    VariableByteArrayRef getByteArrayRef();

}


text:
namespace YAF.Pages.Admin;

using YAF.Core.Data;
using YAF.Types.Extensions.Data;
using YAF.Types.Interfaces.Data;
using YAF.Web.Editors;

/// <summary>
/// The run SQL Query Page.
/// </summary>
public partial class RunSql : AdminPage
{
    /// <summary>
    /// Initializes a new instance of the <see cref="RunSql"/> class.
    /// </summary>
    public RunSql()
        : base("ADMIN_RUNSQL", ForumPages.Admin_RunSql)
    {
    }

    /// <summary>
    ///   The editor.
    /// </summary>
    private ForumEditor editor;

    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
    protected void Page_Load([NotNull] object sender, [NotNull] EventArgs e)
    {
        this.PageBoardContext.PageElements.RegisterJsBlockStartup(
            nameof(JavaScriptBlocks.FormValidatorJs),
            JavaScriptBlocks.FormValidatorJs(this.RunQuery.ClientID));

        if (this.IsPostBack)
        {
            return;
        }

        this.BindData();
    }

    /// <summary>
    /// Raises the <see cref="E:System.Web.UI.Control.Init" /> event.
    /// </summary>
    /// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param>
    protected override void OnInit([NotNull] EventArgs e)
    {
        this.editor = new CKEditorBBCodeEditorSql
                          {
                              UserCanUpload = false,
                              MaxCharacters = int.MaxValue
                          };

        this.EditorLine.Controls.Add(this.editor);

        base.OnInit(e);
    }

    /// <summary>
    /// Creates page links for this page.
    /// </summary>
    public override void CreatePageLinks()
    {
        this.PageBoardContext.PageLinks.AddRoot();

        this.PageBoardContext.PageLinks.AddLink(
            this.GetText("ADMIN_ADMIN", "Administration"),
            this.Get<LinkBuilder>().GetLink(ForumPages.Admin_Admin));
        this.PageBoardContext.PageLinks.AddLink(this.GetText("ADMIN_RUNSQL", "TITLE"), string.Empty);
    }

    /// <summary>
    /// Runs the query click.
    /// </summary>
    /// <param name="sender">The sender.</param>
    /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
    protected void RunQueryClick([NotNull] object sender, [NotNull] EventArgs e)
    {
        this.txtResult.Text = string.Empty;
        this.ResultHolder.Visible = true;

        this.txtResult.Text = this.Get<IDbAccess>().RunSQL(
            CommandTextHelpers.GetCommandTextReplaced(this.editor.Text.Trim()),
            Configuration.Config.SqlCommandTimeout);
    }

    /// <summary>
    /// The bind data.
    /// </summary>
    private void BindData()
    {
        this.DataBind();
    }
}


text:
package org.telegram.telegrambots.extensions.bots.commandbot;

import org.telegram.telegrambots.bots.DefaultBotOptions;
import org.telegram.telegrambots.bots.TelegramWebhookBot;
import org.telegram.telegrambots.extensions.bots.commandbot.commands.CommandRegistry;
import org.telegram.telegrambots.extensions.bots.commandbot.commands.IBotCommand;
import org.telegram.telegrambots.extensions.bots.commandbot.commands.ICommandRegistry;
import org.telegram.telegrambots.meta.api.methods.BotApiMethod;
import org.telegram.telegrambots.meta.api.objects.Message;
import org.telegram.telegrambots.meta.api.objects.Update;
import org.telegram.telegrambots.meta.bots.AbsSender;

import java.util.Collection;
import java.util.Map;
import java.util.function.BiConsumer;

/**
 * This class adds command functionality to the TelegramWebhookBot
 *
 * @author Andrey Korsakov (loolzaaa)
 */
public abstract class TelegramWebhookCommandBot extends TelegramWebhookBot implements CommandBot, ICommandRegistry {
    private final CommandRegistry commandRegistry;

    /**
     * Creates a TelegramWebhookCommandBot using default options
     * Use ICommandRegistry's methods on this bot to register commands
     *
     */
    public TelegramWebhookCommandBot() {
        this(new DefaultBotOptions());
    }

    /**
     * Creates a TelegramWebhookCommandBot with custom options and allowing commands with
     * usernames
     * Use ICommandRegistry's methods on this bot to register commands
     *
     * @param options     Bot options
     */
    public TelegramWebhookCommandBot(DefaultBotOptions options) {
        this(options, true);
    }

    /**
     * Creates a TelegramWebhookCommandBot
     * Use ICommandRegistry's methods on this bot to register commands
     *
     * @param options                   Bot options
     * @param allowCommandsWithUsername true to allow commands with parameters (default),
     *                                  false otherwise
     */
    public TelegramWebhookCommandBot(DefaultBotOptions options, boolean allowCommandsWithUsername) {
        super(options);
        this.commandRegistry = new CommandRegistry(allowCommandsWithUsername, this::getBotUsername);
    }

    @Override
    public BotApiMethod<?> onWebhookUpdateReceived(Update update) {
        if (update.hasMessage()) {
            Message message = update.getMessage();
            if (message.isCommand() && !filter(message)) {
                if (!commandRegistry.executeCommand(this, message)) {
                    //we have received a not registered command, handle it as invalid
                    processInvalidCommandUpdate(update);
                }
                return null;
            }
        }
        processNonCommandUpdate(update);
        return null;
    }

    @Override
    public final boolean register(IBotCommand botCommand) {
        return commandRegistry.register(botCommand);
    }

    @Override
    public final Map<IBotCommand, Boolean> registerAll(IBotCommand... botCommands) {
        return commandRegistry.registerAll(botCommands);
    }

    @Override
    public final boolean deregister(IBotCommand botCommand) {
        return commandRegistry.deregister(botCommand);
    }

    @Override
    public final Map<IBotCommand, Boolean> deregisterAll(IBotCommand... botCommands) {
        return commandRegistry.deregisterAll(botCommands);
    }

    @Override
    public final Collection<IBotCommand> getRegisteredCommands() {
        return commandRegistry.getRegisteredCommands();
    }

    @Override
    public void registerDefaultAction(BiConsumer<AbsSender, Message> defaultConsumer) {
        commandRegistry.registerDefaultAction(defaultConsumer);
    }

    @Override
    public final IBotCommand getRegisteredCommand(String commandIdentifier) {
        return commandRegistry.getRegisteredCommand(commandIdentifier);
    }
}


text:
package com.greensnow25.entity;

/**
 * Public class MusicType.
 *
 * @author greensnow25.
 * @version 1.
 * @since 11.10.2017.
 */
public class MusicType {
    /**
     * music type.
     */
    private String type;
    /**
     * id.
     */
    private int id;

    public MusicType(String type, int id) {
        this.type = type;
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
}


text:
import Input from '../../mixins/input'

export default {
  name: 'text-field',

  mixins: [Input],

  data () {
    return {
      hasFocused: false,
      inputHeight: null
    }
  },

  props: {
    autofocus: Boolean,
    autoGrow: Boolean,
    counter: Boolean,
    fullWidth: Boolean,
    id: String,
    name: String,
    maxlength: [Number, String],
    max: [Number, String],
    min: [Number, String],
    step: [Number, String],
    multiLine: Boolean,
    prefix: String,
    readonly: Boolean,
    rows: {
      default: 5
    },
    singleLine: Boolean,
    suffix: String,
    type: {
      type: String,
      default: 'text'
    }
  },

  computed: {
    classes () {
      return {
        'input-group--text-field': true,
        'input-group--single-line': this.singleLine,
        'input-group--multi-line': this.multiLine,
        'input-group--full-width': this.fullWidth
      }
    },
    hasError () {
      return this.errors.length > 0 ||
        !this.counterIsValid() ||
        !this.validateIsValid() ||
        this.error
    },
    count () {
      const inputLength = (this.inputValue && this.inputValue.toString() || '').length
      let min = inputLength

      if (this.counterMin !== 0 && inputLength < this.counterMin) {
        min = this.counterMin
      }

      return `${min} / ${this.counterMax}`
    },
    counterMin () {
      const parsedMin = Number.parseInt(this.min, 10)
      return Number.isNaN(parsedMin) ? 0 : parsedMin
    },
    counterMax () {
      const parsedMax = Number.parseInt(this.max, 10)
      return Number.isNaN(parsedMax) ? 25 : parsedMax
    },
    inputValue: {
      get () {
        return this.value
      },
      set (val) {
        if (this.modifiers.trim) {
          val = val.trim()
        }

        if (this.modifiers.number) {
          val = Number(val)
        }

        if (!this.modifiers.lazy) {
          this.$emit('input', val)
        }

        this.lazyValue = val
      }
    },
    isDirty () {
      return this.lazyValue !== null &&
        typeof this.lazyValue !== 'undefined' &&
        this.lazyValue.toString().length > 0
    }
  },

  watch: {
    focused (val) {
      this.hasFocused = true

      !val && this.$emit('change', this.lazyValue)
    },
    value () {
      this.lazyValue = this.value
      this.validate()
      this.multiLine && this.autoGrow && this.calculateInputHeight()
    }
  },

  mounted () {
    this.$vuetify.load(() => {
      this.multiLine && this.autoGrow && this.calculateInputHeight()
      this.autofocus && this.focus()
    })
  },

  methods: {
    calculateInputHeight () {
      const height = this.$refs.input.scrollHeight
      const minHeight = this.rows * 24
      this.inputHeight = height < minHeight ? minHeight : height
    },
    onInput (e) {
      this.inputValue = e.target.value
      this.multiLine && this.autoGrow && this.calculateInputHeight()
    },
    blur (e) {
      this.validate()
      this.$nextTick(() => (this.focused = false))
      this.$emit('blur', e)
    },
    focus (e) {
      this.focused = true
      this.$refs.input.focus()
      this.$emit('focus', e)
    },
    genCounter () {
      return this.$createElement('div', {
        'class': {
          'input-group__counter': true,
          'input-group__counter--error': !this.counterIsValid()
        }
      }, this.count)
    },
    genInput () {
      const tag = this.multiLine ? 'textarea' : 'input'

      const data = {
        style: {
          'height': this.inputHeight && `${this.inputHeight}px`
        },
        domProps: {
          disabled: this.disabled,
          required: this.required,
          value: this.lazyValue,
          autofucus: this.autofocus
        },
        attrs: {
          tabindex: this.tabindex,
          readonly: this.readonly
        },
        on: {
          blur: this.blur,
          input: this.onInput,
          focus: this.focus
        },
        ref: 'input'
      }

      if (this.placeholder) data.domProps.placeholder = this.placeholder
      if (this.autocomplete) data.domProps.autocomplete = true
      if (this.name) data.attrs.name = this.name
      if (this.maxlength) data.attrs.maxlength = this.maxlength
      if (this.id) data.domProps.id = this.id
      if (this.step) data.attrs.step = this.step
      if (!this.counter) {
        if (this.max) data.attrs.max = this.max
        if (this.min) data.attrs.min = this.min
      }

      if (this.multiLine) {
        data.domProps.rows = this.rows
      } else {
        data.domProps.type = this.type
      }

      const children = [this.$createElement(tag, data)]

      this.prefix && children.unshift(this.genFix('prefix'))
      this.suffix && children.push(this.genFix('suffix'))

      return children
    },
    genFix (type) {
      return this.$createElement('span', {
        'class': `input-group--text-field__${type}`
      }, this[type])
    },
    counterIsValid: function counterIsValid () {
      const val = (this.inputValue && this.inputValue.toString() || '')

      return (!this.counter ||
        (val.length >= this.counterMin && val.length <= this.counterMax)
      )
    },
    validateIsValid () {
      return (!this.required ||
        (this.required &&
          this.isDirty) ||
        !this.hasFocused ||
        (this.hasFocused && this.focused))
    }
  },

  render () {
    return this.genInputGroup(this.genInput(), { attrs: { tabindex: -1 }})
  }
}


text:
<?php namespace Lean\Acf;

/**
 * Class that carries the filters and some util function aroudn this,
 *
 * @since 0.4.0
 */
class Filter {
	const DEFAULT_TRANSFORMS = 'ln_acf_apply_default_transforms';
	const FIELD              = 'ln_acf_field';
	const IMAGE              = 'ln_acf_image_size';
	const REPEATER_AS_ARRAY  = 'ln_acf_repeater_as_array';

	public static function parse_suffix( $suffix = '' ) {
		$suffix = strtolower( $suffix );
		$suffix = str_replace( [ '-', '/', '.' ], '_', $suffix );
		return trim( $suffix, ' _' );
	}

	public static function create_name( $base = '', $suffix = '' ) {
		if ( $suffix ) {
			return sprintf( '%s_%s', $base, self::parse_suffix( $suffix ) );
		} else {
			return $base;
		}
	}
}


text:
FROM extesla/nginx
MAINTAINER "Sean Quinn <sean.quinn@extesla.com>"

RUN rm -rf /etc/nginx/conf.d/default.conf

COPY files/etc/nginx/nginx.conf /etc/nginx/nginx.conf
COPY files/etc/nginx/sites /etc/nginx/sites
COPY files/etc/nginx/sites-available/acme.conf /etc/nginx/sites-available/acme.com


text:
package org.gdg.frisbee.android.view;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.Filter;
import android.widget.ListView;

public class FilterListView extends ListView {
    private Filter.FilterListener mFilterListener;

    public FilterListView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void onFilterComplete(int count) {
        super.onFilterComplete(count);
        if (mFilterListener != null) {
            mFilterListener.onFilterComplete(count);
        }
    }

    public void setFilterListener(Filter.FilterListener filterListener) {
        mFilterListener = filterListener;
    }
}


text:
using System;

namespace ALinq.Mapping
{
    /// <summary>
    /// Associates a class with a column in a database table.
    /// </summary>
    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)]
    public sealed class ColumnAttribute : DataAttribute
    {
        // Fields
        private bool canBeNull = true;
        private UpdateCheck check = UpdateCheck.Always;

        /// <summary>
        /// Initializes a new instance of the ALinq.Mapping.ColumnAttribute class.
        /// </summary>
        public ColumnAttribute()
        {

        }

        /// <summary>
        /// Gets or sets the ALinq.Mapping.AutoSync enumeration.
        /// </summary>
        /// <returns>
        /// The ALinq.Mapping.AutoSync value.
        /// </returns>
        public AutoSync AutoSync { get; set; }

        /// <summary>
        /// Gets or sets whether a column can contain null values.
        /// </summary>
        /// <returns>
        /// Default = true.
        /// </returns>
        public bool CanBeNull
        {
            get
            {
                return canBeNull;
            }
            set
            {
                CanBeNullSet = true;
                canBeNull = value;
            }
        }

        internal bool CanBeNullSet { get; private set; }

        /// <summary>
        /// Gets or sets the type of the database column.
        /// </summary>
        public string DbType { get; set; }

        /// <summary>
        /// Gets or sets whether a column is a computed column in a database.
        /// </summary>
        /// <returns>
        /// Default = empty.
        /// </returns>
        public string Expression { get; set; }

        /// <summary>
        /// Gets or sets whether a column contains values that the database auto-generates.
        /// </summary>
        /// <returns>
        /// Default = false.
        /// </returns>
        public bool IsDbGenerated { get; set; }

        /// <summary>
        /// Gets or sets whether a column contains a discriminator value for a LINQ to SQL inheritance hierarchy.
        /// </summary>
        /// <returns>
        /// Default = false.
        /// </returns>
        public bool IsDiscriminator { get; set; }

        /// <summary>
        /// Gets or sets whether this class member represents a column that is part or all of the primary key of the table.
        /// </summary>
        /// <returns>
        /// Default = false.
        /// </returns>
        public bool IsPrimaryKey { get; set; }

        /// <summary>
        /// Gets or sets whether the column type of the member is a database timestamp or version number.
        /// </summary>
        /// <returns>
        /// Default = false.
        /// </returns>
        public bool IsVersion { get; set; }

        /// <summary>
        /// Gets or sets how LINQ to SQL approaches the detection of optimistic concurrency conflicts.
        /// </summary>
        /// <returns>
        /// Default = ALinq.Mapping.UpdateCheck.Always, unless ALinq.Mapping.ColumnAttribute.IsVersion is true for a member.  Other values are ALinq.Mapping.UpdateCheck.Never and ALinq.Mapping.UpdateCheck.WhenChanged.
        /// </returns>
        public UpdateCheck UpdateCheck
        {
            get
            {
                return check;
            }
            set
            {
                check = value;
            }
        }
    }
}


text:
package org.watterssoft;

import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.UserDetailsService;

/**
 * @author johnwatters Apr 27, 2014 11:48:45 AM
 */

@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter
{

	@Autowired
	private DataSource dataSource;

	@Autowired
	private UserDetailsService userDetailsService;

	@Autowired
	public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception
	{
		Md5PasswordEncoder passwordEncoder = new Md5PasswordEncoder();
		auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder);//jdbcAuthentication().usersByUsernameQuery("select user_name, user_password, enabled from USERS where user_name = ?").passwordEncoder(passwordEncoder).dataSource(dataSource);
	}

	@Override
	protected void configure(HttpSecurity http) throws Exception
	{

		http.authorizeRequests().antMatchers("/resources/**", "/signup", "/about","/jquery/**","/js/**","/logout").permitAll().antMatchers("/admin/**").hasRole("ADMIN").antMatchers("/db/**")
				.access("hasRole('ROLE_ADMIN') and hasRole('ROLE_DBA')").anyRequest().authenticated().and().formLogin().loginPage("/login").defaultSuccessUrl("/").permitAll();
		http.csrf().disable();
	}

}


text:
<template>

${ appTitle }

        This is version ${ version }.
        Ask for help
        ${ name }
        ${ helpline }

        <template if.bind="show.roster.active">

        </template>

+

</template>


text:
SDEI: Software Delegated Exception Interface
============================================

This document provides an overview of the SDEI dispatcher implementation in
Trusted Firmware-A (TF-A).

Introduction
------------

Software Delegated Exception Interface (|SDEI|) is an Arm specification for
Non-secure world to register handlers with firmware to receive notifications
about system events. Firmware will first receive the system events by way of
asynchronous exceptions and, in response, arranges for the registered handler to
execute in the Non-secure EL.

Normal world software that interacts with the SDEI dispatcher (makes SDEI
requests and receives notifications) is referred to as the *SDEI Client*. A
client receives the event notification at the registered handler even when it
was executing with exceptions masked. The list of SDEI events available to the
client are specific to the platform [#std-event]_. See also `Determining client
EL`_.

.. _general SDEI dispatch:

The following figure depicts a general sequence involving SDEI client executing
at EL2 and an event dispatch resulting from the triggering of a bound interrupt.
A commentary is provided below:

.. uml:: ../resources/diagrams/plantuml/sdei_general.puml

As part of initialisation, the SDEI client binds a Non-secure interrupt [1], and
the SDEI dispatcher returns a platform dynamic event number [2]. The client then
registers a handler for that event [3], enables the event [5], and unmasks all
events on the current PE [7]. This sequence is typical of an SDEI client, but it
may involve additional SDEI calls.

At a later point in time, when the bound interrupt triggers [9], it's trapped to
EL3. The interrupt is handed over to the SDEI dispatcher, which then arranges to
execute the registered handler [10]. The client terminates its execution with
``SDEI_EVENT_COMPLETE`` [11], following which the dispatcher resumes the
original EL2 execution [13]. Note that the SDEI interrupt remains active until
the client handler completes, at which point EL3 does EOI [12].

Other than events bound to interrupts, as depicted in the sequence above, SDEI
events can be explicitly dispatched in response to other exceptions, for
example, upon receiving an *SError* or *Synchronous External Abort*. See
`Explicit dispatch of events`_.

The remainder of this document only discusses the design and implementation of
SDEI dispatcher in TF-A, and assumes that the reader is familiar with the SDEI
specification, the interfaces, and their requirements.

Defining events
---------------

A platform choosing to include the SDEI dispatcher must also define the events
available on the platform, along with their attributes.

The platform is expected to provide two arrays of event descriptors: one for
private events, and another for shared events. The SDEI dispatcher provides
``SDEI_PRIVATE_EVENT()`` and ``SDEI_SHARED_EVENT()`` macros to populate the
event descriptors. Both macros take 3 arguments:

-  The event number: this must be a positive 32-bit integer.

-  For an event that has a backing interrupt, the interrupt number the event is
   bound to:

   - If it's not applicable to an event, this shall be left as ``0``.

   - If the event is dynamic, this should be specified as ``SDEI_DYN_IRQ``.

-  A bit map of `Event flags`_.

To define event 0, the macro ``SDEI_DEFINE_EVENT_0()`` should be used. This
macro takes only one parameter: an SGI number to signal other PEs.

To define an event that's meant to be explicitly dispatched (i.e., not as a
result of receiving an SDEI interrupt), the macro ``SDEI_EXPLICIT_EVENT()``
should be used. It accepts two parameters:

-  The event number (as above);

-  Event priority: ``SDEI_MAPF_CRITICAL`` or ``SDEI_MAPF_NORMAL``, as described
   below.

Once the event descriptor arrays are defined, they should be exported to the
SDEI dispatcher using the ``REGISTER_SDEI_MAP()`` macro, passing it the pointers
to the private and shared event descriptor arrays, respectively. Note that the
``REGISTER_SDEI_MAP()`` macro must be used in the same file where the arrays are
defined.

Regarding event descriptors:

-  For Event 0:

   - There must be exactly one descriptor in the private array, and none in the
     shared array.

   - The event should be defined using ``SDEI_DEFINE_EVENT_0()``.

   - Must be bound to a Secure SGI on the platform.

-  Explicit events should only be used in the private array.

-  Statically bound shared and private interrupts must be bound to shared and
   private interrupts on the platform, respectively. See the section on
   `Configuration within Exception Handling Framework`_.

-  Both arrays should be one-dimensional. The ``REGISTER_SDEI_MAP()`` macro
   takes care of replicating private events for each PE on the platform.

-  Both arrays must be sorted in the increasing order of event number.

The SDEI specification doesn't have provisions for discovery of available events
on the platform. The list of events made available to the client, along with
their semantics, have to be communicated out of band; for example, through
Device Trees or firmware configuration tables.

See also `Event definition example`_.

Event flags
~~~~~~~~~~~

Event flags describe the properties of the event. They are bit maps that can be
``OR``\ ed to form parameters to macros that define events (see
`Defining events`_).

-  ``SDEI_MAPF_DYNAMIC``: Marks the event as dynamic. Dynamic events can be
   bound to (or released from) any Non-secure interrupt at runtime via the
   ``SDEI_INTERRUPT_BIND`` and ``SDEI_INTERRUPT_RELEASE`` calls.

-  ``SDEI_MAPF_BOUND``: Marks the event as statically bound to an interrupt.
   These events cannot be re-bound at runtime.

-  ``SDEI_MAPF_NORMAL``: Marks the event as having *Normal* priority. This is
   the default priority.

-  ``SDEI_MAPF_CRITICAL``: Marks the event as having *Critical* priority.

Event definition example
------------------------

.. code:: c

   static sdei_ev_map_t plat_private_sdei[] = {
        /* Event 0 definition */
        SDEI_DEFINE_EVENT_0(8),

        /* PPI */
        SDEI_PRIVATE_EVENT(8, 23, SDEI_MAPF_BOUND),

        /* Dynamic private events */
        SDEI_PRIVATE_EVENT(100, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC),
        SDEI_PRIVATE_EVENT(101, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC)

        /* Events for explicit dispatch */
        SDEI_EXPLICIT_EVENT(2000, SDEI_MAPF_NORMAL);
        SDEI_EXPLICIT_EVENT(2000, SDEI_MAPF_CRITICAL);
   };

   /* Shared event mappings */
   static sdei_ev_map_t plat_shared_sdei[] = {
        SDEI_SHARED_EVENT(804, 0, SDEI_MAPF_DYNAMIC),

        /* Dynamic shared events */
        SDEI_SHARED_EVENT(3000, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC),
        SDEI_SHARED_EVENT(3001, SDEI_DYN_IRQ, SDEI_MAPF_DYNAMIC)
   };

   /* Export SDEI events */
   REGISTER_SDEI_MAP(plat_private_sdei, plat_shared_sdei);

Configuration within Exception Handling Framework
-------------------------------------------------

The SDEI dispatcher functions alongside the Exception Handling Framework. This
means that the platform must assign priorities to both Normal and Critical SDEI
interrupts for the platform:

-  Install priority descriptors for Normal and Critical SDEI interrupts.

-  For those interrupts that are statically bound (i.e. events defined as having
   the ``SDEI_MAPF_BOUND`` property), enumerate their properties for the GIC
   driver to configure interrupts accordingly.

   The interrupts must be configured to target EL3. This means that they should
   be configured as *Group 0*.  Additionally, on GICv2 systems, the build option
   ``GICV2_G0_FOR_EL3`` must be set to ``1``.

See also :ref:`porting_guide_sdei_requirements`.

Determining client EL
---------------------

The SDEI specification requires that the *physical* SDEI client executes in the
highest Non-secure EL implemented on the system. This means that the dispatcher
will only allow SDEI calls to be made from:

-  EL2, if EL2 is implemented. The Hypervisor is expected to implement a
   *virtual* SDEI dispatcher to support SDEI clients in Guest Operating Systems
   executing in Non-secure EL1.

-  Non-secure EL1, if EL2 is not implemented or disabled.

See the function ``sdei_client_el()`` in ``sdei_private.h``.

.. _explicit-dispatch-of-events:

Explicit dispatch of events
---------------------------

Typically, an SDEI event dispatch is caused by the PE receiving interrupts that
are bound to an SDEI event. However, there are cases where the Secure world
requires dispatch of an SDEI event as a direct or indirect result of a past
activity, such as receiving a Secure interrupt or an exception.

The SDEI dispatcher implementation provides ``sdei_dispatch_event()`` API for
this purpose. The API has the following signature:

.. code:: c

        int sdei_dispatch_event(int ev_num);

The parameter ``ev_num`` is the event number to dispatch. The API returns ``0``
on success, or ``-1`` on failure.

The following figure depicts a scenario involving explicit dispatch of SDEI
event. A commentary is provided below:

.. uml:: ../resources/diagrams/plantuml/sdei_explicit_dispatch.puml

As part of initialisation, the SDEI client registers a handler for a platform
event [1], enables the event [3], and unmasks the current PE [5]. Note that,
unlike in `general SDEI dispatch`_, this doesn't involve interrupt binding, as
bound or dynamic events can't be explicitly dispatched (see the section below).

At a later point in time, a critical event [#critical-event]_ is trapped into
EL3 [7]. EL3 performs a first-level triage of the event, and a RAS component
assumes further handling [8]. The dispatch completes, but intends to involve
Non-secure world in further handling, and therefore decides to explicitly
dispatch an event [10] (which the client had already registered for [1]). The
rest of the sequence is similar to that in the `general SDEI dispatch`_: the
requested event is dispatched to the client (assuming all the conditions are
met), and when the handler completes, the preempted execution resumes.

Conditions for event dispatch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

All of the following requirements must be met for the API to return ``0`` and
event to be dispatched:

-  SDEI events must be unmasked on the PE. I.e. the client must have called
   ``PE_UNMASK`` beforehand.

-  Event 0 can't be dispatched.

-  The event must be declared using the ``SDEI_EXPLICIT_EVENT()`` macro
   described above.

-  The event must be private to the PE.

-  The event must have been registered for and enabled.

-  A dispatch for the same event must not be outstanding. I.e. it hasn't already
   been dispatched and is yet to be completed.

-  The priority of the event (either Critical or Normal, as configured by the
   platform at build-time) shouldn't cause priority inversion. This means:

   -  If it's of Normal priority, neither Normal nor Critical priority dispatch
      must be outstanding on the PE.

   -  If it's of a Critical priority, no Critical priority dispatch must be
      outstanding on the PE.

Further, the caller should be aware of the following assumptions made by the
dispatcher:

-  The caller of the API is a component running in EL3; for example, a RAS
   driver.

-  The requested dispatch will be permitted by the Exception Handling Framework.
   I.e. the caller must make sure that the requested dispatch has sufficient
   priority so as not to cause priority level inversion within Exception
   Handling Framework.

-  The caller must be prepared for the SDEI dispatcher to restore the Non-secure
   context, and mark that the active context.

-  The call will block until the SDEI client completes the event (i.e. when the
   client calls either ``SDEI_EVENT_COMPLETE`` or ``SDEI_COMPLETE_AND_RESUME``).

-  The caller must be prepared for this API to return failure and handle
   accordingly.

Porting requirements
--------------------

The porting requirements of the SDEI dispatcher are outlined in the
:ref:`Porting Guide <porting_guide_sdei_requirements>`.

Note on writing SDEI event handlers
-----------------------------------

*This section pertains to SDEI event handlers in general, not just when using
the TF-A SDEI dispatcher.*

The SDEI specification requires that event handlers preserve the contents of all
registers except ``x0`` to ``x17``. This has significance if event handler is
written in C: compilers typically adjust the stack frame at the beginning and
end of C functions. For example, AArch64 GCC typically produces the following
function prologue and epilogue:

::

        c_event_handler:
                stp     x29, x30, [sp,#-32]!
                mov     x29, sp

                ...

                bl      ...

                ...

                ldp     x29, x30, [sp],#32
                ret

The register ``x29`` is used as frame pointer in the prologue. Because neither a
valid ``SDEI_EVENT_COMPLETE`` nor ``SDEI_EVENT_COMPLETE_AND_RESUME`` calls
return to the handler, the epilogue never gets executed, and registers ``x29``
and ``x30`` (in the case above) are inadvertently corrupted. This violates the
SDEI specification, and the normal execution thereafter will result in
unexpected behaviour.

To work this around, it's advised that the top-level event handlers are
implemented in assembly, following a similar pattern as below:

::

        asm_event_handler:
                /* Save link register whilst maintaining stack alignment */
                stp     xzr, x30, [sp, #-16]!
                bl      c_event_handler

                /* Restore link register */
                ldp     xzr, x30, [sp], #16

                /* Complete call */
                ldr     x0, =SDEI_EVENT_COMPLETE
                smc     #0
                b       .

--------------

*Copyright (c) 2017-2019, Arm Limited and Contributors. All rights reserved.*

.. rubric:: Footnotes

.. [#std-event] Except event 0, which is defined by the SDEI specification as a
                standard event.

.. [#critical-event] Examples of critical events are *SError*, *Synchronous
                     External Abort*, *Fault Handling interrupt* or *Error
                     Recovery interrupt* from one of RAS nodes in the system.

.. _SDEI specification: http://infocenter.arm.com/help/topic/com.arm.doc.den0054a/ARM_DEN0054A_Software_Delegated_Exception_Interface.pdf
.. _Software Delegated Exception Interface: `SDEI specification`_


text:
package com.wincom.actor.editor.test2.model;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.ui.views.properties.ColorPropertyDescriptor;
import org.eclipse.ui.views.properties.IPropertyDescriptor;
import org.eclipse.ui.views.properties.PropertyDescriptor;
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ActorModel extends ElementModel {
	private static final long serialVersionUID = -3468137955444207978L;
	private final Logger log = LoggerFactory.getLogger(this.getClass());

	private String id;
	private PortModel input;
	private List<PortModel> outputs = new ArrayList<>();

	public static final String ID = "id";
	public static final String INPUT = "input";
	public static final String OUTPUTS = "outputs";

	private static final IPropertyDescriptor[] descriptors = new IPropertyDescriptor[] {
			new TextPropertyDescriptor(ID, ID),
			new TextPropertyDescriptor(NAME, NAME),
			new PropertyDescriptor(PARENT, PARENT),
			new PropertyDescriptor(INPUT, INPUT),
			new PropertyDescriptor(OUTPUTS, OUTPUTS),
			new ColorPropertyDescriptor(BACKGROUND_COLOR, BACKGROUND_COLOR),
			new ColorPropertyDescriptor(FOREGROUND_COLOR, FOREGROUND_COLOR)
			};

	public ActorModel() {
		log.info("new ActorModel()");
		setId("actor-" + Double.valueOf(Math.random() * 1000).intValue());
		setName("actor-" + Double.valueOf(Math.random() * 1000).intValue());
		this.input = new PortModel();
		this.input.setName(INPUT);
		this.input.setParent(this);

		for(int i = 0; i < 3; ++i) {
			PortModel output = new PortModel();
			String outName = "output-" + (i + 1);
			output.setName(outName);
			output.setParent(this);
			outputs.add(output);
		}
	}

	@Override
	public void setLayout(Rectangle newLayout) {
		log.info("check");
		super.setLayout(newLayout);
		layoutChildren(newLayout);
	}

	public void layoutChildren() {
		layoutChildren(getLayout());
	}

	public void layoutChildren(Rectangle newLayout) {
		int P = 0;
		int W = newLayout.width;
		int H = newLayout.height;
		layoutInput(P, H);

		layoutOutputs(P, W, H);
	}

	private void layoutInput(int P, int H) {
		int h = input.getLayout().height;
		int w = input.getLayout().width;
		int x = 0;
		int y = (H - 2*P)/2 + P - h/2;
		input.setLayout(new Rectangle(x, y, w, h));
	}

	public void layoutOutputs() {
		int P = 0;
		int W = getLayout().width;
		int H = getLayout().height;
		layoutOutputs(P, W, H);
	}

	private void layoutOutputs(int P, int W, int H) {
		int h;
		int w;
		int x;
		int y;
		final int N = outputs.size();
		for(int i = 0; i < N; ++i) {
			PortModel out = outputs.get(i);
			h = out.getLayout().height;
			w = out.getLayout().width;
			x = W - w;
			y = (H - 2*P)/(N + 1) * (i + 1) + P - h/2;
			out.setLayout(new Rectangle(x, y, w, h));
		}
	}

	@Override
	public IPropertyDescriptor[] getPropertyDescriptors() {
		return descriptors;
	}

	public String getId() {
		log.info("id = " + this.id);
		return this.id;
	}

	public void setId(String newId) {
		String old = id;
		this.id = newId;
		firePropertyChange(ID, old, newId);
	}

	public PortModel getInput() {
		return input;
	}

	public void setInput(PortModel port) {
		PortModel old = this.input;
		this.input = port;
		port.setParent(this);
		firePropertyChange(INPUT, old, port);
	}

	private PortModel findOutput(String name) {
		List<PortModel> l = outputs.stream().filter(x -> x.name.equals(name)).collect(Collectors.toList());
		return l.isEmpty() ? null : l.get(0);
	}

	public void removeOutput(PortModel port) {
		PortModel old = findOutput(port.name);

		if(old != null) {
			old.setParent(null);
		}
		this.outputs.remove(port);
		layoutOutputs();
		firePropertyChange(OUTPUTS, old, null);
	}

	public List<PortModel> getOutputs() {
		return outputs;
	}

	public void setOutputs(List<PortModel> newOutputs) {
		List<PortModel> old = outputs;
		outputs = newOutputs;
		firePropertyChange(OUTPUTS, old, newOutputs);
	}

	public void addOutputs(PortModel port) {
		port.setParent(this);
		outputs.add(port);
		layoutOutputs();
		firePropertyChange(OUTPUTS, null, port);
	}

	public boolean contains(PortModel port) {
		return this.outputs.contains(port);
	}

	@Override
	public List<ElementModel> getChildren() {
		List<ElementModel> children = new ArrayList<>();
		children.add(input);
		children.addAll(outputs);
		return children;
	}

	@Override
	public Object getPropertyValue(Object id) {
		if (ID.equals(id)) {
			return getId();
		} else if (INPUT.equals(id)) {
			return getInput();
		} else if (OUTPUTS.equals(id)) {
			return getOutputs();
		}
		return super.getPropertyValue(id);
	}

	@Override
	public boolean isPropertySet(Object id) {
		return getPropertyValue(id) != null;
	}

	@Override
	public void resetPropertyValue(Object id) {

	}

	@SuppressWarnings("unchecked")
	@Override
	public void setPropertyValue(Object id, Object value) {
		if (ID.equals(id)) {
			setId((String) value);
		} else if (INPUT.equals(id)) {
			setInput((PortModel) value);
		} else if (OUTPUTS.equals(id)) {
			setOutputs((List<PortModel>) value);
		} else {
			super.setPropertyValue(id, value);
		}
	}

	@Override
	public Object clone() {
		ActorModel model = new ActorModel();
		model.setBackgroundColor(getBackgroundColor());
		model.setForegroundColor(getForegroundColor());
		model.setId(getId());
		model.setInput(getInput());
		model.setLayout(new Rectangle(getLayout().x + 10, getLayout().y + 10, getLayout().width, getLayout().height));
		model.setName(getName());

		List<PortModel> outputs = new ArrayList<>();
		for (PortModel e : this.outputs) {
			PortModel port = (PortModel) e.clone();
			port.setLayout(e.getLayout());
			outputs.add(port);
		}

		model.setOutputs(outputs);
		model.setParent(getParent());

		return model;

	}
}


text:
require('../lib/node_loader');
var AWS = require('../lib/core');
var Service = AWS.Service;
var apiLoader = AWS.apiLoader;

apiLoader.services['codeartifact'] = {};
AWS.CodeArtifact = Service.defineService('codeartifact', ['2018-09-22']);
Object.defineProperty(apiLoader.services['codeartifact'], '2018-09-22', {
  get: function get() {
    var model = require('../apis/codeartifact-2018-09-22.min.json');
    model.paginators = require('../apis/codeartifact-2018-09-22.paginators.json').pagination;
    return model;
  },
  enumerable: true,
  configurable: true
});

module.exports = AWS.CodeArtifact;


text:
<?php

final class PHUIListExample extends PhabricatorUIExample {

  public function getName() {
    return 'Lists';
  }

  public function getDescription() {
    return 'Create a fanciful list of objects and prismatic donuts.';
  }

  public function renderExample() {

    /* Action Menu */

    $action1 = id(new PHUIListItemView())
      ->setName('Edit Document')
      ->setHref('#')
      ->setIcon('edit')
      ->setType(PHUIListItemView::TYPE_LINK);

    $action2 = id(new PHUIListItemView())
      ->setName('Move Document')
      ->setHref('#')
      ->setIcon('move')
      ->setType(PHUIListItemView::TYPE_LINK);

    $action3 = id(new PHUIListItemView())
      ->setName('Delete Document')
      ->setHref('#')
      ->setIcon('delete')
      ->setType(PHUIListItemView::TYPE_LINK);

    $action4 = id(new PHUIListItemView())
      ->setName('View History')
      ->setHref('#')
      ->setIcon('history')
      ->setType(PHUIListItemView::TYPE_LINK);

    $action5 = id(new PHUIListItemView())
      ->setName('Subscribe')
      ->setHref('#')
      ->setIcon('check')
      ->setType(PHUIListItemView::TYPE_LINK);

    $actionmenu = id(new PHUIListView())
      ->setType(PHUIListView::SIDENAV_LIST)
      ->addMenuItem($action1)
      ->addMenuItem($action2)
      ->addMenuItem($action3)
      ->addMenuItem($action4)
      ->addMenuItem($action5);

    /* Side Navigation */

    $label1 = id(new PHUIListItemView())
      ->setName('Getting Started')
      ->setType(PHUIListItemView::TYPE_LABEL);

    $label2 = id(new PHUIListItemView())
      ->setName('Documentation')
      ->setType(PHUIListItemView::TYPE_LABEL);

    $item1 = id(new PHUIListItemView())
      ->setName('Installation')
      ->setHref('#')
      ->setType(PHUIListItemView::TYPE_LINK);

    $item2 = id(new PHUIListItemView())
      ->setName('Webserver Config')
      ->setHref('#')
      ->setType(PHUIListItemView::TYPE_LINK);

    $item3 = id(new PHUIListItemView())
      ->setName('Adding Users')
      ->setHref('#')
      ->setType(PHUIListItemView::TYPE_LINK);

    $item4 = id(new PHUIListItemView())
      ->setName('Debugging')
      ->setHref('#')
      ->setType(PHUIListItemView::TYPE_LINK);

    $divider = id(new PHUIListItemView)
      ->setType(PHUIListItemView::TYPE_DIVIDER);

    $sidenav = id(new PHUIListView())
      ->setType(PHUIListView::SIDENAV_LIST)
      ->addMenuItem($label1)
      ->addMenuItem($item3)
      ->addMenuItem($item2)
      ->addMenuItem($item1)
      ->addMenuItem($item4)
      ->addMenuItem($divider)
      ->addMenuItem($label2)
      ->addMenuItem($item3)
      ->addMenuItem($item2)
      ->addMenuItem($item1)
      ->addMenuItem($item4);

    /* Unstyled */

    $item1 = id(new PHUIListItemView())
      ->setName('Rain');

    $item2 = id(new PHUIListItemView())
      ->setName('Spain');

    $item3 = id(new PHUIListItemView())
      ->setName('Mainly');

    $item4 = id(new PHUIListItemView())
      ->setName('Plains');

    $unstyled = id(new PHUIListView())
      ->addMenuItem($item1)
      ->addMenuItem($item2)
      ->addMenuItem($item3)
      ->addMenuItem($item4);

    /* Top Navigation */

    $home = id(new PHUIListItemView())
      ->setIcon('home')
      ->setHref('#')
      ->setType(PHUIListItemView::TYPE_ICON);

    $item1 = id(new PHUIListItemView())
      ->setName('Installation')
      ->setHref('#')
      ->setSelected(true)
      ->setType(PHUIListItemView::TYPE_LINK);

    $item2 = id(new PHUIListItemView())
      ->setName('Webserver Config')
      ->setHref('#')
      ->setType(PHUIListItemView::TYPE_LINK);

    $item3 = id(new PHUIListItemView())
      ->setName('Adding Users')
      ->setHref('#')
      ->setType(PHUIListItemView::TYPE_LINK);

    $item4 = id(new PHUIListItemView())
      ->setName('Debugging')
      ->setHref('#')
      ->setType(PHUIListItemView::TYPE_LINK);

        $item1 = id(new PHUIListItemView())
      ->setName('Installation')
      ->setHref('#')
      ->setSelected(true)
      ->setType(PHUIListItemView::TYPE_LINK);

    $item2 = id(new PHUIListItemView())
      ->setName('Webserver Config')
      ->setHref('#')
      ->setType(PHUIListItemView::TYPE_LINK);

    $details1 = id(new PHUIListItemView())
      ->setName('Details')
      ->setHref('#')
      ->setSelected(true)
      ->setType(PHUIListItemView::TYPE_LINK);

    $details2 = id(new PHUIListItemView())
      ->setName('Lint (OK)')
      ->setHref('#')
      ->setType(PHUIListItemView::TYPE_LINK);

    $details3 = id(new PHUIListItemView())
      ->setName('Unit (5/5)')
      ->setHref('#')
      ->setType(PHUIListItemView::TYPE_LINK);

    $details4 = id(new PHUIListItemView())
      ->setName('Lint (Warn)')
      ->setHref('#')
      ->setStatusColor(PHUIListItemView::STATUS_WARN)
      ->setType(PHUIListItemView::TYPE_LINK);

    $details5 = id(new PHUIListItemView())
      ->setName('Unit (3/5)')
      ->setHref('#')
      ->setStatusColor(PHUIListItemView::STATUS_FAIL)
      ->setType(PHUIListItemView::TYPE_LINK);

    $topnav = id(new PHUIListView())
      ->setType(PHUIListView::NAVBAR_LIST)
      ->addMenuItem($home)
      ->addMenuItem($item1)
      ->addMenuItem($item2)
      ->addMenuItem($item3)
      ->addMenuItem($item4);

    $statustabs = id(new PHUIListView())
      ->setType(PHUIListView::NAVBAR_LIST)
      ->addMenuItem($details1)
      ->addMenuItem($details2)
      ->addMenuItem($details3)
      ->addMenuItem($details4)
      ->addMenuItem($details5);

    $layout1 =
      array(
        id(new PHUIBoxView())
          ->appendChild($unstyled)
          ->addMargin(PHUI::MARGIN_MEDIUM)
          ->addPadding(PHUI::PADDING_SMALL)
          ->setBorder(true));

    $layout2 =
      array(
        id(new PHUIBoxView())
          ->appendChild($sidenav)
          ->addMargin(PHUI::MARGIN_MEDIUM)
          ->setBorder(true));

    $layout3 =
      array(
        id(new PHUIBoxView())
          ->appendChild($topnav)
          ->addMargin(PHUI::MARGIN_MEDIUM)
          ->setBorder(true));

    $layout4 =
      array(
        id(new PHUIBoxView())
          ->appendChild($actionmenu)
          ->addMargin(PHUI::MARGIN_MEDIUM)
          ->setBorder(true));

    $layout5 =
      array(
        id(new PHUIBoxView())
          ->appendChild($statustabs)
          ->addMargin(PHUI::MARGIN_MEDIUM)
          ->setBorder(true));

    $head1 = id(new PHUIHeaderView())
      ->setHeader(pht('Unstyled'));

    $head2 = id(new PHUIHeaderView())
      ->setHeader(pht('Side Navigation'));

    $head3 = id(new PHUIHeaderView())
      ->setHeader(pht('Top Navigation'));

    $head4 = id(new PHUIHeaderView())
      ->setHeader(pht('Action Menu'));

    $head5 = id(new PHUIHeaderView())
      ->setHeader(pht('Status Tabs'));

    $wrap1 = id(new PHUIBoxView())
      ->appendChild($layout1)
      ->addMargin(PHUI::MARGIN_LARGE);

    $wrap2 = id(new PHUIBoxView())
      ->appendChild($layout2)
      ->addMargin(PHUI::MARGIN_LARGE);

    $wrap3 = id(new PHUIBoxView())
      ->appendChild($layout3)
      ->addMargin(PHUI::MARGIN_LARGE);

    $wrap4 = id(new PHUIBoxView())
      ->appendChild($layout4)
      ->addMargin(PHUI::MARGIN_LARGE);

    $wrap5 = id(new PHUIBoxView())
      ->appendChild($layout5)
      ->addMargin(PHUI::MARGIN_LARGE);

    return phutil_tag(
      'div',
        array(
          'class' => 'phui-list-example',
        ),
        array(
          $head1,
          $wrap1,
          $head2,
          $wrap2,
          $head3,
          $wrap3,
          $head5,
          $wrap5,
          $head4,
          $wrap4
        ));
        }
}


text:
+++
Talk_date = ""
Talk_start_time = ""
Talk_end_time = ""
Title = "How DevOps Revolutionize Indonesian Fintech Industry"
Type = "talk"
Speakers = ["rohit-sharma"]
+++