text:
package com.facebook.imagepipeline.common;

import android.graphics.Bitmap;
import com.facebook.imagepipeline.decoder.ImageDecoder;
import javax.annotation.Nullable;

/**
 * Builder for {@link ImageDecodeOptions}.
 */
public class ImageDecodeOptionsBuilder {

  private int mMinDecodeIntervalMs = 100;
  private boolean mDecodePreviewFrame;
  private boolean mUseLastFrameForPreview;
  private boolean mDecodeAllFrames;
  private boolean mForceStaticImage;
  private Bitmap.Config mBitmapConfig = Bitmap.Config.ARGB_8888;
  private @Nullable ImageDecoder mCustomImageDecoder;

  public ImageDecodeOptionsBuilder() {
  }

  /**
   * Sets the builder to be equivalent to the specified options.
   *
   * @param options the options to copy from
   * @return this builder
   */
  public ImageDecodeOptionsBuilder setFrom(ImageDecodeOptions options) {
    mDecodePreviewFrame = options.decodePreviewFrame;
    mUseLastFrameForPreview = options.useLastFrameForPreview;
    mDecodeAllFrames = options.decodeAllFrames;
    mForceStaticImage = options.forceStaticImage;
    mBitmapConfig = options.bitmapConfig;
    mCustomImageDecoder = options.customImageDecoder;
    return this;
  }

  /**
   * Sets the minimum decode interval.
   *
   * <p/> Decoding of intermediate results won't happen more often that intervalMs. If another
   * intermediate result comes too soon, it will be decoded only after intervalMs since the last
   * decode. If there were more intermediate results in between, only the last one gets decoded.
   * @param intervalMs the minimum decode interval in milliseconds
   * @return this builder
   */
  public ImageDecodeOptionsBuilder setMinDecodeIntervalMs(int intervalMs) {
    mMinDecodeIntervalMs = intervalMs;
    return this;
  }

  /**
   * Gets the minimum decode interval.
   *
   * @return the minimum decode interval in milliseconds
   */
  public int getMinDecodeIntervalMs() {
    return mMinDecodeIntervalMs;
  }

  /**
   * Sets whether to decode a preview frame for animated images.
   *
   * @param decodePreviewFrame whether to decode a preview frame
   * @return this builder
   */
  public ImageDecodeOptionsBuilder setDecodePreviewFrame(boolean decodePreviewFrame) {
    mDecodePreviewFrame = decodePreviewFrame;
    return this;
  }

  /**
   * Gets whether to decode a preview frame for animated images.
   *
   * @return whether to decode a preview frame
   */
  public boolean getDecodePreviewFrame() {
    return mDecodePreviewFrame;
  }

  /**
   * Gets whether to use the last frame for the preview image (defaults to the first frame).
   *
   * @return whether to use the last frame for the preview image
   */
  public boolean getUseLastFrameForPreview() {
    return mUseLastFrameForPreview;
  }

  /**
   * Sets whether to use the last frame for the preview image (defaults to the first frame).
   *
   * @param useLastFrameForPreview whether to use the last frame for the preview image
   * @return this builder
   */
  public ImageDecodeOptionsBuilder setUseLastFrameForPreview(boolean useLastFrameForPreview) {
    mUseLastFrameForPreview = useLastFrameForPreview;
    return this;
  }

  /**
   * Gets whether to decode all the frames and store them in memory. This should only ever be used
   * for animations that are known to be small (e.g. stickers). Caching dozens of large Bitmaps
   * in memory for general GIFs or WebP's will not fit in memory.
   *
   * @return whether to decode all the frames and store them in memory
   */
  public boolean getDecodeAllFrames() {
    return mDecodeAllFrames;
  }

  /**
   * Sets whether to decode all the frames and store them in memory. This should only ever be used
   * for animations that are known to be small (e.g. stickers). Caching dozens of large Bitmaps
   * in memory for general GIFs or WebP's will not fit in memory.
   *
   * @param decodeAllFrames whether to decode all the frames and store them in memory
   * @return this builder
   */
  public ImageDecodeOptionsBuilder setDecodeAllFrames(boolean decodeAllFrames) {
    mDecodeAllFrames = decodeAllFrames;
    return this;
  }

  /**
   * Sets whether to force animated image formats to be decoded as static, non-animated images.
   *
   * @param forceStaticImage whether to force the image to be decoded as a static image
   * @return this builder
   */
  public ImageDecodeOptionsBuilder setForceStaticImage(boolean forceStaticImage) {
    mForceStaticImage = forceStaticImage;
    return this;
  }

  /**
   * Set a custom image decoder override to be used for the given image.
   * This will bypass all default decoders and only use the provided custom image decoder
   * for the given image.
   *
   * @param customImageDecoder the custom decoder to use
   * @return this builder
   */
  public ImageDecodeOptionsBuilder setCustomImageDecoder(
      @Nullable ImageDecoder customImageDecoder) {
    mCustomImageDecoder = customImageDecoder;
    return this;
  }

  /**
   * Get the custom image decoder, if one has been set.
   *
   * @return the custom image decoder or null if not set
   */
  @Nullable
  public ImageDecoder getCustomImageDecoder() {
    return mCustomImageDecoder;
  }

  /**
   * Gets whether to force animated image formats to be decoded as static, non-animated images.
   *
   * @return whether to force animated image formats to be decoded as static
   */
  public boolean getForceStaticImage() {
    return mForceStaticImage;
  }

  /**
   * Gets which config image will be decode with;
   *
   * @return which config image will be decode with
   */
  public Bitmap.Config getBitmapConfig() {
    return mBitmapConfig;
  }

  /**
   * Sets which config static image will be decode with;
   * @param bitmapConfig which config static image will be decode with;
   */
  public ImageDecodeOptionsBuilder setBitmapConfig(Bitmap.Config bitmapConfig) {
    mBitmapConfig = bitmapConfig;
    return this;
  }

  /**
   * Builds the immutable {@link ImageDecodeOptions} instance.
   *
   * @return the immutable instance
   */
  public ImageDecodeOptions build() {
    return new ImageDecodeOptions(this);
  }
}


text:
import { NgModule } from '@angular/core';

import { makeSlideModule } from 'app/slides/base-slide-module';
import { ClockSlideComponent } from './clock-slide.component';

@NgModule(makeSlideModule(ClockSlideComponent))
export class ClockSlideModule {}

redpajama_set_name: RedPajamaGithub


text:
namespace Microsoft.AspNetCore.OutputCaching;

internal interface IOutputCacheKeyProvider
{
    /// <summary>
    /// Create a key for storing cached responses.
    /// </summary>
    /// <param name="context">The <see cref="OutputCacheContext"/>.</param>
    /// <returns>The created key.</returns>
    string CreateStorageKey(OutputCacheContext context);
}


text:
package model

import (
	"encoding/json"
)

// All const variable used in job
const (
	// binlog type
	SyncInsert = "insert"
	SyncUpdate = "update"
	SyncDelete = "delete"
)

// BinlogMsg dm binlog msg
type BinlogMsg struct {
	Action string          `json:"action"`
	Table  string          `json:"table"`
	New    json.RawMessage `json:"new"`
	Old    json.RawMessage `json:"old"`
}


text:
package io.opentelemetry.sdk.extension.trace.jaeger.sampler;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.awaitility.Awaitility.await;

import com.linecorp.armeria.common.grpc.protocol.ArmeriaStatusException;
import com.linecorp.armeria.server.ServerBuilder;
import com.linecorp.armeria.server.ServiceRequestContext;
import com.linecorp.armeria.server.grpc.protocol.AbstractUnaryGrpcService;
import com.linecorp.armeria.testing.junit5.server.SelfSignedCertificateExtension;
import com.linecorp.armeria.testing.junit5.server.ServerExtension;
import io.github.netmikey.logunit.api.LogCapturer;
import io.opentelemetry.internal.testing.slf4j.SuppressLogger;
import io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling;
import io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling.RateLimitingSamplingStrategy;
import io.opentelemetry.sdk.extension.trace.jaeger.proto.api_v2.Sampling.SamplingStrategyType;
import io.opentelemetry.sdk.trace.samplers.Sampler;
import java.io.IOException;
import java.lang.reflect.Field;
import java.nio.file.Files;
import java.time.Duration;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
import org.awaitility.core.ThrowingRunnable;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.slf4j.event.Level;
import org.slf4j.event.LoggingEvent;

@SuppressLogger(DefaultGrpcService.class)
class JaegerRemoteSamplerGrpcNettyTest {

  private static final String SERVICE_NAME = "my-service";
  private static final int RATE = 999;

  private static final ConcurrentLinkedQueue<ArmeriaStatusException> grpcErrors =
      new ConcurrentLinkedQueue<>();

  private static final ConcurrentLinkedQueue<Sampling.SamplingStrategyResponse> responses =
      new ConcurrentLinkedQueue<>();

  private static void addGrpcError(int code, @Nullable String message) {
    grpcErrors.add(new ArmeriaStatusException(code, message));
  }

  @RegisterExtension
  LogCapturer logs = LogCapturer.create().captureForType(DefaultGrpcService.class, Level.TRACE);

  @Order(1)
  @RegisterExtension
  static final SelfSignedCertificateExtension certificate = new SelfSignedCertificateExtension();

  @Order(2)
  @RegisterExtension
  static final ServerExtension server =
      new ServerExtension() {
        @Override
        protected void configure(ServerBuilder sb) {
          sb.service(
              JaegerRemoteSamplerBuilder.GRPC_ENDPOINT_PATH,
              new AbstractUnaryGrpcService() {
                @Override
                protected CompletionStage<byte[]> handleMessage(
                    ServiceRequestContext ctx, byte[] message) {

                  ArmeriaStatusException grpcError = grpcErrors.poll();
                  if (grpcError != null) {
                    throw grpcError;
                  }

                  Sampling.SamplingStrategyResponse response = responses.poll();
                  // use default
                  if (response == null) {
                    response =
                        Sampling.SamplingStrategyResponse.newBuilder()
                            .setStrategyType(SamplingStrategyType.RATE_LIMITING)
                            .setRateLimitingSampling(
                                RateLimitingSamplingStrategy.newBuilder()
                                    .setMaxTracesPerSecond(RATE)
                                    .build())
                            .build();
                  }

                  return CompletableFuture.completedFuture(response.toByteArray());
                }
              });
          sb.http(0);
          sb.https(0);
          sb.tls(certificate.certificateFile(), certificate.privateKeyFile());
        }
      };

  @BeforeEach
  public void before() {
    grpcErrors.clear();
    responses.clear();
  }

  @Test
  void connectionWorks() {
    try (JaegerRemoteSampler sampler =
        JaegerRemoteSampler.builder()
            .setEndpoint(server.httpUri().toString())
            .setPollingInterval(1, TimeUnit.SECONDS)
            .setServiceName(SERVICE_NAME)
            .build()) {

      await().untilAsserted(samplerIsType(sampler, RateLimitingSampler.class));

      // verify
      assertThat(sampler.getDescription()).contains("RateLimitingSampler{999.00}");
    }
  }

  @Test
  void tlsConnectionWorks() throws IOException {
    try (JaegerRemoteSampler sampler =
        JaegerRemoteSampler.builder()
            .setEndpoint(server.httpsUri().toString())
            .setPollingInterval(1, TimeUnit.SECONDS)
            .setTrustedCertificates(Files.readAllBytes(certificate.certificateFile().toPath()))
            .setServiceName(SERVICE_NAME)
            .build()) {

      await().untilAsserted(samplerIsType(sampler, RateLimitingSampler.class));

      // verify
      assertThat(sampler.getDescription()).contains("RateLimitingSampler{999.00}");
    }
  }

  @Test
  void description() {
    try (JaegerRemoteSampler sampler =
        JaegerRemoteSampler.builder()
            .setEndpoint(server.httpUri().toString())
            .setPollingInterval(1, TimeUnit.SECONDS)
            .setServiceName(SERVICE_NAME)
            .build()) {
      assertThat(sampler.getDescription())
          .startsWith("JaegerRemoteSampler{ParentBased{root:TraceIdRatioBased{0.001000}");

      // wait until the sampling strategy is retrieved before exiting test method
      await().untilAsserted(samplerIsType(sampler, RateLimitingSampler.class));
    }
  }

  @Test
  void initialSampler() {
    try (JaegerRemoteSampler sampler =
        JaegerRemoteSampler.builder()
            .setEndpoint("http://example.com")
            .setServiceName(SERVICE_NAME)
            .setInitialSampler(Sampler.alwaysOn())
            .build()) {
      assertThat(sampler.getDescription()).startsWith("JaegerRemoteSampler{AlwaysOnSampler}");
    }
  }

  @Test
  void pollingInterval() {
    try (JaegerRemoteSampler sampler =
        JaegerRemoteSampler.builder()
            .setEndpoint(server.httpUri().toString())
            .setServiceName(SERVICE_NAME)
            .setPollingInterval(1, TimeUnit.MILLISECONDS)
            .build()) {

      // wait until the sampling strategy is retrieved before exiting test method
      await().untilAsserted(samplerIsType(sampler, RateLimitingSampler.class));
    }
  }

  @Test
  void pollingInterval_duration() {
    try (JaegerRemoteSampler sampler =
        JaegerRemoteSampler.builder()
            .setEndpoint(server.httpUri().toString())
            .setServiceName(SERVICE_NAME)
            .setPollingInterval(Duration.ofMillis(1))
            .build()) {

      // wait until the sampling strategy is retrieved before exiting test method
      await().untilAsserted(samplerIsType(sampler, RateLimitingSampler.class));
    }
  }

  @Test
  void perOperationSampling() {
    Sampling.SamplingStrategyResponse response =
        Sampling.SamplingStrategyResponse.newBuilder()
            .setOperationSampling(
                Sampling.PerOperationSamplingStrategies.newBuilder()
                    .setDefaultSamplingProbability(0.55)
                    .setDefaultLowerBoundTracesPerSecond(100)
                    .setDefaultUpperBoundTracesPerSecond(200)
                    .addPerOperationStrategies(
                        Sampling.OperationSamplingStrategy.newBuilder()
                            .setOperation("foo")
                            .setProbabilisticSampling(
                                Sampling.ProbabilisticSamplingStrategy.newBuilder()
                                    .setSamplingRate(0.90)
                                    .build())
                            .build())
                    .addPerOperationStrategies(
                        Sampling.OperationSamplingStrategy.newBuilder()
                            .setOperation("bar")
                            .setProbabilisticSampling(
                                Sampling.ProbabilisticSamplingStrategy.newBuilder()
                                    .setSamplingRate(0.7)
                                    .build())
                            .build())
                    .build())
            .setRateLimitingSampling(
                RateLimitingSamplingStrategy.newBuilder().setMaxTracesPerSecond(RATE).build())
            .build();
    responses.add(response);

    try (JaegerRemoteSampler sampler =
        JaegerRemoteSampler.builder()
            .setEndpoint(server.httpUri().toString())
            .setServiceName(SERVICE_NAME)
            // Make sure only polls once.
            .setPollingInterval(500, TimeUnit.SECONDS)
            .build()) {

      await()
          .untilAsserted(
              () -> {
                assertThat(sampler.getDescription())
                    .startsWith(
                        "JaegerRemoteSampler{ParentBased{root:PerOperationSampler{default=TraceIdRatioBased{0.550000}, perOperation={foo=TraceIdRatioBased{0.900000}, bar=TraceIdRatioBased{0.700000}}}");
                assertThat(sampler.getDescription()).contains("bar");
              });
    }
  }

  @Test
  void internal_error_server_response() {
    addGrpcError(13, "internal error");

    try (JaegerRemoteSampler sampler =
        JaegerRemoteSampler.builder()
            .setEndpoint(server.httpUri().toString())
            .setServiceName(SERVICE_NAME)
            .setPollingInterval(50, TimeUnit.MILLISECONDS)
            .build()) {

      assertThat(sampler.getDescription())
          .startsWith("JaegerRemoteSampler{ParentBased{root:TraceIdRatioBased{0.001000}");

      await()
          .untilAsserted(
              () -> {
                LoggingEvent log =
                    logs.assertContains(" Server responded with gRPC status code 13");
                assertThat(log.getLevel()).isEqualTo(Level.WARN);
              });
    }
  }

  @Test
  void unavailable_error_server_response() {
    addGrpcError(14, "クマ🐻 resource exhausted");

    try (JaegerRemoteSampler sampler =
        JaegerRemoteSampler.builder()
            .setEndpoint(server.httpUri().toString())
            .setServiceName(SERVICE_NAME)
            .setPollingInterval(50, TimeUnit.MILLISECONDS)
            .build()) {

      assertThat(sampler.getDescription())
          .startsWith("JaegerRemoteSampler{ParentBased{root:TraceIdRatioBased{0.001000}");

      await()
          .untilAsserted(
              () -> {
                LoggingEvent log = logs.assertContains("Server is UNAVAILABLE");
                assertThat(log.getLevel()).isEqualTo(Level.ERROR);
              });
    }
  }

  @Test
  void unimplemented_error_server_response() {
    addGrpcError(12, null);

    try (JaegerRemoteSampler sampler =
        JaegerRemoteSampler.builder()
            .setEndpoint(server.httpUri().toString())
            .setServiceName(SERVICE_NAME)
            .setPollingInterval(50, TimeUnit.MILLISECONDS)
            .build()) {

      assertThat(sampler.getDescription())
          .startsWith("JaegerRemoteSampler{ParentBased{root:TraceIdRatioBased{0.001000}");

      await()
          .untilAsserted(
              () -> {
                LoggingEvent log = logs.assertContains("Server responded with UNIMPLEMENTED.");
                assertThat(log.getLevel()).isEqualTo(Level.ERROR);
              });
    }
  }

  @Test
  void invalidArguments() {
    assertThatThrownBy(() -> JaegerRemoteSampler.builder().setServiceName(null))
        .isInstanceOf(NullPointerException.class)
        .hasMessage("serviceName");
    assertThatThrownBy(() -> JaegerRemoteSampler.builder().setEndpoint(null))
        .isInstanceOf(NullPointerException.class)
        .hasMessage("endpoint");
    assertThatThrownBy(
            () -> JaegerRemoteSampler.builder().setPollingInterval(-1, TimeUnit.MILLISECONDS))
        .isInstanceOf(IllegalArgumentException.class)
        .hasMessage("polling interval must be positive");
    assertThatThrownBy(() -> JaegerRemoteSampler.builder().setPollingInterval(1, null))
        .isInstanceOf(NullPointerException.class)
        .hasMessage("unit");
    assertThatThrownBy(
            () -> JaegerRemoteSampler.builder().setPollingInterval(Duration.ofMillis(-1)))
        .isInstanceOf(IllegalArgumentException.class)
        .hasMessage("polling interval must be positive");
    assertThatThrownBy(() -> JaegerRemoteSampler.builder().setPollingInterval(null))
        .isInstanceOf(NullPointerException.class)
        .hasMessage("interval");
  }

  @Test
  void usingGrpc() {
    assertThat(JaegerRemoteSampler.builder().getDelegate())
        .isInstanceOf(DefaultGrpcServiceBuilder.class);
  }

  static ThrowingRunnable samplerIsType(
      JaegerRemoteSampler sampler, Class<? extends Sampler> expected) {
    return () -> {
      assertThat(sampler.getSampler().getClass().getName())
          .isEqualTo("io.opentelemetry.sdk.trace.samplers.ParentBasedSampler");

      Field field = sampler.getSampler().getClass().getDeclaredField("root");
      field.setAccessible(true);
      assertThat(field.get(sampler.getSampler()).getClass()).isEqualTo(expected);
    };
  }
}


text:
'use strict';

function NumberField() {

}

NumberField.buildField = function(){
	var field = FieldBase.buildField(this);
	field.field_type = 'NumberField';
	field.validations = {
        min_number: null,
        max_number: null,
    };
	return (field);
};

// Register field constructor in Factory
fieldFactory.registerField('NumberField', NumberField);


text:
NS_ASSUME_NONNULL_BEGIN

SK_EXPORT @interface SKPhysicsJoint : NSObject <NSCoding>

@property (nonatomic, retain) SKPhysicsBody *bodyA;
@property (nonatomic, retain) SKPhysicsBody *bodyB;

// Instantaneous directed reaction force, in Newtons at anchor point
@property (nonatomic, readonly) CGVector reactionForce;

// Instantaneous reaction torque, in Newton-meters, at anchor point
@property (nonatomic, readonly) CGFloat reactionTorque;

@end

SK_EXPORT @interface SKPhysicsJointPin : SKPhysicsJoint

+ (SKPhysicsJointPin *)jointWithBodyA:(SKPhysicsBody *)bodyA bodyB:(SKPhysicsBody *)bodyB anchor:(CGPoint)anchor;

@property (nonatomic) BOOL shouldEnableLimits;
@property (nonatomic) CGFloat lowerAngleLimit;
@property (nonatomic) CGFloat upperAngleLimit;
@property (nonatomic) CGFloat frictionTorque;
@property (nonatomic) CGFloat rotationSpeed;     // in radians/sec

@end

SK_EXPORT @interface SKPhysicsJointSpring : SKPhysicsJoint

+ (SKPhysicsJointSpring *)jointWithBodyA:(SKPhysicsBody *)bodyA bodyB:(SKPhysicsBody *)bodyB anchorA:(CGPoint)anchorA anchorB:(CGPoint)anchorB;

@property (nonatomic) CGFloat damping;
@property (nonatomic) CGFloat frequency;

@end

SK_EXPORT @interface SKPhysicsJointFixed : SKPhysicsJoint

+ (SKPhysicsJointFixed *)jointWithBodyA:(SKPhysicsBody *)bodyA bodyB:(SKPhysicsBody *)bodyB anchor:(CGPoint)anchor;

@end

SK_EXPORT @interface SKPhysicsJointSliding : SKPhysicsJoint

+ (SKPhysicsJointSliding *)jointWithBodyA:(SKPhysicsBody *)bodyA bodyB:(SKPhysicsBody *)bodyB anchor:(CGPoint)anchor axis:(CGVector)axis;

@property (nonatomic) BOOL shouldEnableLimits;
@property (nonatomic) CGFloat lowerDistanceLimit;
@property (nonatomic) CGFloat upperDistanceLimit;

@end

SK_EXPORT @interface SKPhysicsJointLimit : SKPhysicsJoint

@property (nonatomic) CGFloat maxLength;

+ (SKPhysicsJointLimit *)jointWithBodyA:(SKPhysicsBody *)bodyA bodyB:(SKPhysicsBody *)bodyB anchorA:(CGPoint)anchorA anchorB:(CGPoint)anchorB;

@end

NS_ASSUME_NONNULL_END


text:
package qq
package data

import cats.Functor
import cats.implicits._

object Program {
  type Definitions[F] = Vector[Definition[F]]

  implicit private final val definitionsFunctor: Functor[Definitions] =
    catsStdInstancesForVector.compose[Definition](Definition.definitionFunctor)

  implicit def programFunctor: Functor[Program] = new Functor[Program] {
    override def map[A, B](fa: Program[A])(f: (A) => B): Program[B] = Program[B](definitionsFunctor.map(fa.defns)(f), f(fa.main))
  }
}

case class Program[F](defns: Program.Definitions[F], main: F)


text:
#include "xenia/debug/debugger.h"

#include <gflags/gflags.h>

#include <mutex>

#include "xenia/base/filesystem.h"
#include "xenia/base/logging.h"
#include "xenia/base/string.h"
#include "xenia/base/threading.h"
#include "xenia/cpu/backend/code_cache.h"
#include "xenia/cpu/function.h"
#include "xenia/cpu/processor.h"
#include "xenia/cpu/stack_walker.h"
#include "xenia/debug/server/gdb/gdb_server.h"
#include "xenia/debug/server/mi/mi_server.h"
#include "xenia/debug/server/xdp/xdp_server.h"
#include "xenia/emulator.h"
#include "xenia/kernel/objects/xkernel_module.h"
#include "xenia/kernel/objects/xmodule.h"
#include "xenia/kernel/objects/xthread.h"
#include "xenia/kernel/objects/xuser_module.h"

#if 0 && DEBUG
#define DEFAULT_DEBUG_FLAG true
#else
#define DEFAULT_DEBUG_FLAG false
#endif

DEFINE_bool(debug, DEFAULT_DEBUG_FLAG,
            "Allow debugging and retain debug information.");
DEFINE_string(debug_session_path, "", "Debug output path.");
DEFINE_bool(wait_for_debugger, false,
            "Waits for a debugger to attach before starting the game.");
DEFINE_bool(exit_with_debugger, true, "Exit whe the debugger disconnects.");

DEFINE_string(debug_server, "xdp", "Debug server protocol [gdb, mi, xdp].");

namespace xe {
namespace debug {

using namespace xe::kernel;

using xe::cpu::ThreadState;

Breakpoint::Breakpoint(Type type, uint32_t address)
    : type_(type), address_(address) {}

Breakpoint::~Breakpoint() = default;

Debugger::Debugger(Emulator* emulator) : emulator_(emulator) {}

Debugger::~Debugger() { StopSession(); }

void Debugger::set_attached(bool attached) {
  if (is_attached_ && !attached) {
    // Debugger detaching.
    if (FLAGS_exit_with_debugger) {
      XELOGE("Debugger detached, --exit_with_debugger is killing us");
      exit(1);
      return;
    }
  }
  is_attached_ = attached;
  if (is_attached_) {
    attach_fence_.Signal();
  }
}

bool Debugger::StartSession() {
  auto session_path = xe::to_wstring(FLAGS_debug_session_path);
  if (!session_path.empty()) {
    session_path = xe::to_absolute_path(session_path);
    xe::filesystem::CreateFolder(session_path);
  }

  functions_path_ = xe::join_paths(session_path, L"functions");
  functions_file_ =
      ChunkedMappedMemoryWriter::Open(functions_path_, 32 * 1024 * 1024, false);

  functions_trace_path_ = xe::join_paths(session_path, L"functions.trace");
  functions_trace_file_ = ChunkedMappedMemoryWriter::Open(
      functions_trace_path_, 32 * 1024 * 1024, true);

  if (FLAGS_debug_server == "gdb") {
    server_ = std::make_unique<xe::debug::server::gdb::GdbServer>(this);
    if (!server_->Initialize()) {
      XELOGE("Unable to initialize GDB debug server");
      return false;
    }
  } else if (FLAGS_debug_server == "gdb") {
    server_ = std::make_unique<xe::debug::server::mi::MIServer>(this);
    if (!server_->Initialize()) {
      XELOGE("Unable to initialize MI debug server");
      return false;
    }
  } else {
    server_ = std::make_unique<xe::debug::server::xdp::XdpServer>(this);
    if (!server_->Initialize()) {
      XELOGE("Unable to initialize XDP debug server");
      return false;
    }
  }

  return true;
}

void Debugger::PreLaunch() {
  if (FLAGS_wait_for_debugger) {
    // Wait for the first client.
    XELOGI("Waiting for debugger because of --wait_for_debugger...");
    attach_fence_.Wait();
    XELOGI("Debugger attached, breaking and waiting for continue...");

    // Start paused.
    execution_state_ = ExecutionState::kRunning;
    server_->PostSynchronous([this]() { Interrupt(); });
  } else {
    // Start running.
    execution_state_ = ExecutionState::kRunning;
  }
}

void Debugger::StopSession() {
  std::lock_guard<std::recursive_mutex> lock(mutex_);

  FlushSession();

  // Kill debug server.
  server_.reset();

  functions_file_.reset();
  functions_trace_file_.reset();
}

void Debugger::FlushSession() {
  if (functions_file_) {
    functions_file_->Flush();
  }
  if (functions_trace_file_) {
    functions_trace_file_->Flush();
  }
}

uint8_t* Debugger::AllocateFunctionData(size_t size) {
  if (!functions_file_) {
    return nullptr;
  }
  return functions_file_->Allocate(size);
}

uint8_t* Debugger::AllocateFunctionTraceData(size_t size) {
  if (!functions_trace_file_) {
    return nullptr;
  }
  return functions_trace_file_->Allocate(size);
}

void Debugger::DumpThreadStacks() {
  auto stack_walker = emulator()->processor()->stack_walker();
  auto threads =
      emulator_->kernel_state()->object_table()->GetObjectsByType<XThread>(
          XObject::kTypeThread);
  for (auto& thread : threads) {
    XELOGI("Thread %s (%s)", thread->name().c_str(),
           thread->is_guest_thread() ? "guest" : "host");
    uint64_t frame_host_pcs[64];
    uint64_t hash;
    size_t count = stack_walker->CaptureStackTrace(
        thread->GetWaitHandle()->native_handle(), frame_host_pcs, 0, 64, &hash);
    cpu::StackFrame frames[64];
    stack_walker->ResolveStack(frame_host_pcs, frames, count);
    for (size_t i = 0; i < count; ++i) {
      auto& frame = frames[i];
      if (frame.type == cpu::StackFrame::Type::kHost) {
        XELOGI("  %.2lld %.16llX          %s", count - i - 1, frame.host_pc,
               frame.host_symbol.name);
      } else {
        auto function_info = frame.guest_symbol.function_info;
        XELOGI("  %.2lld %.16llX %.8X %s", count - i - 1, frame.host_pc,
               frame.guest_pc,
               function_info ? function_info->name().c_str() : "?");
      }
    }
  }
}

int Debugger::AddBreakpoint(Breakpoint* breakpoint) {
  // Add to breakpoints map.
  {
    std::lock_guard<std::recursive_mutex> lock(mutex_);
    breakpoints_.insert(
        std::pair<uint32_t, Breakpoint*>(breakpoint->address(), breakpoint));
  }

  // Find all functions that contain the breakpoint address.
  auto fns =
      emulator_->processor()->FindFunctionsWithAddress(breakpoint->address());

  // Add.
  for (auto fn : fns) {
    if (fn->AddBreakpoint(breakpoint)) {
      return 1;
    }
  }

  return 0;
}

int Debugger::RemoveBreakpoint(Breakpoint* breakpoint) {
  // Remove from breakpoint map.
  {
    std::lock_guard<std::recursive_mutex> lock(mutex_);
    auto range = breakpoints_.equal_range(breakpoint->address());
    if (range.first == range.second) {
      return 1;
    }
    bool found = false;
    for (auto it = range.first; it != range.second; ++it) {
      if (it->second == breakpoint) {
        breakpoints_.erase(it);
        found = true;
        break;
      }
    }
    if (!found) {
      return 1;
    }
  }

  // Find all functions that have the breakpoint set.
  auto fns =
      emulator_->processor()->FindFunctionsWithAddress(breakpoint->address());

  // Remove.
  for (auto fn : fns) {
    fn->RemoveBreakpoint(breakpoint);
  }

  return 0;
}

void Debugger::FindBreakpoints(uint32_t address,
                               std::vector<Breakpoint*>& out_breakpoints) {
  std::lock_guard<std::recursive_mutex> lock(mutex_);

  out_breakpoints.clear();

  auto range = breakpoints_.equal_range(address);
  if (range.first == range.second) {
    return;
  }

  for (auto it = range.first; it != range.second; ++it) {
    Breakpoint* breakpoint = it->second;
    out_breakpoints.push_back(breakpoint);
  }
}

bool Debugger::SuspendAllThreads() {
  auto threads =
      emulator_->kernel_state()->object_table()->GetObjectsByType<XThread>(
          XObject::kTypeThread);
  for (auto& thread : threads) {
    if (!XSUCCEEDED(thread->Suspend(nullptr))) {
      return false;
    }
  }
  return true;
}

bool Debugger::ResumeThread(uint32_t thread_id) {
  auto thread = emulator_->kernel_state()->GetThreadByID(thread_id);
  if (!thread) {
    return false;
  }
  return XSUCCEEDED(thread->Resume());
}

bool Debugger::ResumeAllThreads() {
  auto threads =
      emulator_->kernel_state()->object_table()->GetObjectsByType<XThread>(
          XObject::kTypeThread);
  for (auto& thread : threads) {
    if (!XSUCCEEDED(thread->Resume())) {
      return false;
    }
  }
  return true;
}

void Debugger::Interrupt() {
  std::lock_guard<std::recursive_mutex> lock(mutex_);
  assert_true(execution_state_ == ExecutionState::kRunning);
  SuspendAllThreads();
  execution_state_ = ExecutionState::kStopped;
  server_->OnExecutionInterrupted();

  // TEST CODE.
  // TODO(benvanik): remove when UI shows threads.
  DumpThreadStacks();
}

void Debugger::Continue() {
  std::lock_guard<std::recursive_mutex> lock(mutex_);
  assert_true(execution_state_ == ExecutionState::kStopped);
  ResumeAllThreads();
  execution_state_ = ExecutionState::kRunning;
  server_->OnExecutionContinued();
}

void Debugger::StepOne(uint32_t thread_id) {
  std::lock_guard<std::recursive_mutex> lock(mutex_);
  assert_true(execution_state_ == ExecutionState::kStopped);
  //
}

void Debugger::StepTo(uint32_t thread_id, uint32_t target_pc) {
  std::lock_guard<std::recursive_mutex> lock(mutex_);
  assert_true(execution_state_ == ExecutionState::kStopped);
  //
}

void Debugger::OnThreadCreated(xe::kernel::XThread* thread) {
  // TODO(benvanik): notify transports.
}

void Debugger::OnThreadExit(xe::kernel::XThread* thread) {
  // TODO(benvanik): notify transports.
}

void Debugger::OnThreadDestroyed(xe::kernel::XThread* thread) {
  // TODO(benvanik): notify transports.
}

void Debugger::OnFunctionDefined(cpu::FunctionInfo* symbol_info,
                                 cpu::Function* function) {
  // Man, I'd love not to take this lock.
  std::vector<Breakpoint*> breakpoints;
  {
    std::lock_guard<std::recursive_mutex> lock(mutex_);
    for (uint32_t address = symbol_info->address();
         address <= symbol_info->end_address(); address += 4) {
      auto range = breakpoints_.equal_range(address);
      if (range.first == range.second) {
        continue;
      }
      for (auto it = range.first; it != range.second; ++it) {
        Breakpoint* breakpoint = it->second;
        breakpoints.push_back(breakpoint);
      }
    }
  }

  if (breakpoints.size()) {
    // Breakpoints to add!
    for (auto breakpoint : breakpoints) {
      function->AddBreakpoint(breakpoint);
    }
  }
}

void Debugger::OnBreakpointHit(xe::kernel::XThread* thread,
                               Breakpoint* breakpoint) {
  // Suspend all threads immediately.
  SuspendAllThreads();

  // TODO(benvanik): notify transports.

  // Note that we stay suspended.
}

}  // namespace debug
}  // namespace xe


text:
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Activation, Dropout
import random

sample_inputs = []
sample_outputs = []
hundred_nums = list(range(1,100)) #Nums 100
#Lets generate some data
for num in range(100000):
	num_1 = random.choice(hundred_nums)
	num_2 = random.choice(hundred_nums)
	i = [num_1,num_2]
	o = [num_1+num_2]
	sample_inputs.append(i)
	sample_outputs.append(o)

X = np.array(sample_inputs)
Y = np.array(sample_outputs)

model = Sequential()
model.add(Dense(input_dim=2, output_dim=1))
model.compile(optimizer='adadelta',
          loss='mae',
          metrics=['accuracy'])

#Split the data to validate the results
model.fit(X, Y, validation_split=0.3,nb_epoch=5)

model.save("addition_model")

while True:
	i = np.array([eval(input(">"))])
	answer = model.predict(i)
	print (answer)


text:
require 'spec_helper'

describe Bummr::Outdated do
  # https://github.com/wireframe/gitx/blob/8e3cdc8b5d0c2082ed3daaf2fc054654b2e7a6c8/spec/gitx/executor_spec.rb#L9
  let(:stdoutput_legacy) {
    output = String.new
    output += "  * devise (newest 4.1.1, installed 3.5.2) in group \"default\"\n"
    output += "  * rake (newest 11.1.2, installed 10.4.2)\n"
    output += "  * rails (newest 4.2.6, installed 4.2.5.1, requested ~> 4.2.0) in group \"default\"\n"
    output += "  * spring (newest 4.2.6, installed 4.2.5.1, requested ~> 4.2.0) in group \"development\"\n"
    output += "  * indirect_dep (newest 1.0.0, installed 0.0.1)\n"
    StringIO.new(output)
  }

  let(:stdoutput) {
    output = stdoutput_legacy.string.gsub(/^([\s*]+)/, "")
    StringIO.new(output)
  }

  let(:gemfile) {
    gemfile = String.new
    gemfile += "gem 'devise'\n"
    gemfile += "gem 'rake'\n"
    gemfile += "gem 'rails'\n"
    gemfile += "gem 'spring', :group => :development\n"
    gemfile
  }

  describe "#outdated_gems" do
    { bundler2: :stdoutput, bundler1: :stdoutput_legacy }.each_pair do |version, output|
    it "Correctly identifies outdated gems with bundler #{version}" do
      allow(Open3).to receive(:popen2).and_yield(nil, public_send(output))
        allow_any_instance_of(described_class).to receive(:gemfile).and_return gemfile

        instance = Bummr::Outdated.instance
        result = instance.outdated_gems

        expect(result[0][:name]).to eq('devise')
        expect(result[0][:newest]).to eq('4.1.1')
        expect(result[0][:installed]).to eq('3.5.2')

        expect(result[1][:name]).to eq('rake')
        expect(result[1][:newest]).to eq('11.1.2')
        expect(result[1][:installed]).to eq('10.4.2')

        expect(result[2][:name]).to eq('rails')
        expect(result[2][:newest]).to eq('4.2.6')
        expect(result[2][:installed]).to eq('4.2.5.1')

        expect(result[3][:name]).to eq('spring')
        expect(result[3][:newest]).to eq('4.2.6')
        expect(result[3][:installed]).to eq('4.2.5.1')
      end
    end

    describe "all gems option" do
      it "lists all outdated dependencies by omitting the strict option" do
        allow(Open3).to receive(:popen2).with("bundle outdated --parseable").and_yield(nil, stdoutput)

        allow(Bummr::Outdated.instance).to receive(:gemfile).and_return gemfile

        results = Bummr::Outdated.instance.outdated_gems(all_gems: true)
        gem_names = results.map { |result| result[:name] }

        expect(gem_names).to include "indirect_dep"
      end

      it "defaults to false" do
        expect(Open3).to receive(:popen2).with("bundle outdated --parseable --strict").and_yield(nil, stdoutput)

        allow(Bummr::Outdated.instance).to receive(:gemfile).and_return gemfile

        results = Bummr::Outdated.instance.outdated_gems
        gem_names = results.map { |result| result[:name] }

        expect(gem_names).to_not include "indirect_dep"
      end
    end

    describe "group option" do
      let(:stdoutput_from_development_group) {
        output = String.new
        output += "spring (newest 4.2.6, installed 4.2.5.1, requested ~> 4.2.0)"
        StringIO.new(output)
      }

      it "lists outdated gems only from supplied group" do
        allow(Open3).to receive(:popen2)
          .with("bundle outdated --parseable --strict --group development")
          .and_yield(nil, stdoutput_from_development_group)

        allow(Bummr::Outdated.instance).to receive(:gemfile).and_return gemfile

        results = Bummr::Outdated.instance.outdated_gems(group: :development)
        gem_names = results.map { |result| result[:name] }

        expect(gem_names).to match_array ['spring']
      end

      it "defaults to all groups" do
        allow(Open3).to receive(:popen2)
          .with("bundle outdated --parseable --strict")
          .and_yield(nil, stdoutput)

        allow(Bummr::Outdated.instance).to receive(:gemfile).and_return gemfile

        results = Bummr::Outdated.instance.outdated_gems
        gem_names = results.map { |result| result[:name] }

        expect(gem_names).to include 'devise', 'rake', 'rails', 'spring'
      end
    end

    describe "gem option" do
      let(:stdoutput_from_spring_gem) {
        output = String.new
        output += "spring (newest 4.2.6, installed 4.2.5.1, requested ~> 4.2.0)"
        StringIO.new(output)
      }

      it "lists outdated gems only from supplied gem" do
        allow(Open3).to receive(:popen2)
          .with("bundle outdated --parseable --strict spring")
          .and_yield(nil, stdoutput_from_spring_gem)

        allow(Bummr::Outdated.instance).to receive(:gemfile).and_return gemfile

        results = Bummr::Outdated.instance.outdated_gems(gem: :spring)
        gem_names = results.map { |result| result[:name] }

        expect(gem_names).to match_array ['spring']
      end
    end
  end

  describe "#parse_gem_from" do
    it 'line' do
      line = 'devise (newest 4.1.1, installed 3.5.2) in group "default"'

      gem = Bummr::Outdated.instance.parse_gem_from(line)

      expect(gem[:name]).to eq('devise')
      expect(gem[:newest]).to eq('4.1.1')
      expect(gem[:installed]).to eq('3.5.2')
    end

    it 'line in group' do
      line = 'rake (newest 11.1.2, installed 10.4.2)'

      gem = Bummr::Outdated.instance.parse_gem_from(line)

      expect(gem[:name]).to eq('rake')
      expect(gem[:newest]).to eq('11.1.2')
      expect(gem[:installed]).to eq('10.4.2')
    end

    it 'line with requested' do
      line = 'rails (newest 4.2.6, installed 4.2.5.1, requested ~> 4.2.0) in group "default"'

      gem = Bummr::Outdated.instance.parse_gem_from(line)

      expect(gem[:name]).to eq('rails')
      expect(gem[:newest]).to eq('4.2.6')
      expect(gem[:installed]).to eq('4.2.5.1')
    end
  end
end


text:
/**
 * Crossbrowser library
 *
 * @class vortexBrowser
 * @constructor
 * @module vortex
 */
function vortexBrowser() {

	/*
	 * Constructor
	 */
	function _init() {

	};

	/**
	 * Registers a callback function to a DOM element event
	 *
	 * @method registerEvent
	 * @param {DOMElement} element DOM element
	 * @param {String} eventName Event name
	 * @param {Function} callback Callback function
	 */
	function registerEvent(element,eventName,callback) {

		if (typeof(element)=='string') {

			element=document.getElementById(element);

		}

		if (element==null) return;

		if (element.addEventListener) {

			if (eventName=='mousewheel') {

				element.addEventListener('DOMMouseScroll',callback,false);

			}

			element.addEventListener(eventName,callback,false);

		} else if (element.attachEvent) {

			element.attachEvent(
				'on'+eventName,
				callback
			);

		}

	};

	/**
	 * Unregisters a callback function from a DOM element event
	 *
	 * @method unregisterEvent
	 * @param {DOMElement} element DOM element
	 * @param {String} eventName Event name
	 * @param {Function} callback Callback function
	 */
	function unregisterEvent(element,eventName,callback) {

		if (typeof(element)=='string') {

			element=document.getElementById(element);

		}

		if (element==null) return;

		if (element.removeEventListener) {

			if (eventName=='mousewheel') {

				element.removeEventListener('DOMMouseScroll',callback,false);

			}

			element.removeEventListener(eventName,callback,false);

		} else if (element.detachEvent) {

			element.detachEvent(
				'on'+eventName,
				callback
			);

		}

	};

	/**
	 * Cancel DOM event
	 *
	 * @method cancelEvent
	 * @param {DOMEvent} event DOM event
	 * @return {Boolean} Returns false
	 */
	function cancelEvent(event) {

		event=((event) ? event : window.event);

		if (event.stopPropagation) event.stopPropagation();
		if (event.preventDefault) event.preventDefault();

		event.cancelBubble=true;
		event.cancel=true;
		event.returnValue=false;

		return false;

	};

	/**
	 * Apply properties to an object
	 *
	 * @method apply
	 * @param {Object} obj The object witch the properties should be applied to
	 * @param {Object} props A JSON property structure
	 */
	function applyObject(obj,props) {

		for (var name in props) {

			if (typeof(props[name])=='object') {

				if (typeof(props[name].length)!=='undefined') {

					obj[name]=props[name];

				} else {

					if (typeof obj[name]=='undefined') {

						obj[name]={};

					}

					this.applyObject(obj[name],props[name]);
				}

			} else {

				obj[name]=props[name];

			}

		}

	};

	/**
	 * Check WebSocket support
	 *
	 * @method isWebSocketSupported
	 * @return {Boolean} True if the Browser supports WebSockets
	 */
	function isWebSocketSupported() {

		return (window.WebSocket!==undefined
			|| window.MozWebSocket!==undefined);

	};

	/**
	 * Returns the Browser specific WebSocket class
	 *
	 * @method getWebSocket
	 * @return {Boolean}
	 */
	function getWebSocket() {

		return window.WebSocket || window.MozWebSocket;

	}

	// Execute constructor
	_init();

	// Return public members
	return {
		registerEvent: registerEvent,
		unregisterEvent: unregisterEvent,
		cancelEvent: cancelEvent,
		applyObject: applyObject,
		isWebSocketSupported: isWebSocketSupported,
		getWebSocket: getWebSocket
	};

};


text:
import requests, json
import accountHelper

def readLine(openedfile):
    #Reads file and splits contents by comma

        line = openedfile.readline()
        line = line.strip()
        splitstring = line.split(",")
        return splitstring

def createUserList():
    userList = []
    allvals = ['username','fullName', 'tags', 'email', 'userType', 'role', 'disabled']
    for row in t.userDict:
       userLst = []
       #Appends variables into user list, and adds user list to list of user list
       for val in allvals:
            userLst.append(row[val])
       userList.append(userLst)
    return userList

def writeCSV(f, userlist):
    #updates list to record which emails have been sent to the users and writes information to user.
    for user in userlist:
        for i,j in enumerate(user):
            if user[i]:
                user[i] = user[i]
            else:
                user[i] = 'none'
        try:

            line = "{}, {}, {}, {}, {}, {}, {}\n".format(user[0],user[1],user[2][0],user[3],user[4],user[5],user[6])
            print (line)
            f.write(line)
        except:
            pass

if __name__ == '__main__':
    #username is case sensitive
    user = 'username'
    pw  = 'password'

    #calls organization info
    t = accountHelper.agolAdmin(user, pw)

        #create user List
    userList = createUserList()
    fileLoc =raw_input("Where would you like your CSV to be written to? ex. c:\manageAgol\user.csv ")
    userFile=open(fileLoc, "w")
    header="Username,Full Name, Tags,Email,Type, Role,Disabled\n"
    userFile.write(header)

#Performs analysis on userlist to prepare for writing to CSV file
    for user in userList:
            user[5]= t.roleAssign(user[5])
            user[4] = t.myEsriAssign(user[4])

        #Writes the updated list to the CSV File
    writeCSV(userFile,userList)
    userFile.close()


text:
namespace ash {

namespace {

// Scales |value| using the smaller one of |scale_1| and |scale_2|.
int MinScale(int value, float scale_1, float scale_2) {
  return std::round(value * std::min(scale_1, scale_2));
}

// The height reduced from the tile when min scale is not sufficient to make the
// apps grid fit the available size - This would essentially remove the vertical
// padding for the unclipped folder icon.
int MinYScaleHeightAdjustmentForType(ash::AppListConfigType type) {
  switch (type) {
    case ash::AppListConfigType::kLarge:
    case ash::AppListConfigType::kRegular:
      return 16;
    case ash::AppListConfigType::kMedium:
    case ash::AppListConfigType::kDense:
      return 8;
    case ash::AppListConfigType::kSmall:
      return 4;
  }
}

int GridTileWidthForType(ash::AppListConfigType type) {
  switch (type) {
    case ash::AppListConfigType::kLarge:
      return 120;
    case ash::AppListConfigType::kMedium:
      return 88;
    case ash::AppListConfigType::kSmall:
      return 80;
    case ash::AppListConfigType::kRegular:
      return 96;
    case ash::AppListConfigType::kDense:
      return 72;
  }
}

int GridTileHeightForType(ash::AppListConfigType type) {
  switch (type) {
    case ash::AppListConfigType::kLarge:
    case ash::AppListConfigType::kRegular:
      return 120;
    case ash::AppListConfigType::kMedium:
    case ash::AppListConfigType::kDense:
      return 88;
    case ash::AppListConfigType::kSmall:
      return 80;
  }
}

int GridIconDimensionForType(ash::AppListConfigType type) {
  switch (type) {
    case ash::AppListConfigType::kLarge:
    case ash::AppListConfigType::kRegular:
      return 64;
    case ash::AppListConfigType::kMedium:
    case ash::AppListConfigType::kDense:
      return 48;
    case ash::AppListConfigType::kSmall:
      return 40;
  }
}

int GridTitleTopPaddingForType(ash::AppListConfigType type) {
  switch (type) {
    case ash::AppListConfigType::kLarge:
      return 92;
    case ash::AppListConfigType::kMedium:
      return 64;
    case ash::AppListConfigType::kSmall:
      return 56;
    case ash::AppListConfigType::kRegular:
      return 88;
    case ash::AppListConfigType::kDense:
      return 60;
  }
}

int GridTitleBottomPaddingForType(ash::AppListConfigType type) {
  switch (type) {
    case ash::AppListConfigType::kLarge:
      return 8;
    case ash::AppListConfigType::kMedium:
    case ash::AppListConfigType::kSmall:
      return 6;
    case ash::AppListConfigType::kRegular:
      return 12;
    case ash::AppListConfigType::kDense:
      return 8;
  }
}

int GridTitleHorizontalPaddingForType(ash::AppListConfigType type) {
  switch (type) {
    case ash::AppListConfigType::kLarge:
    case ash::AppListConfigType::kRegular:
      return 8;
    case ash::AppListConfigType::kMedium:
    case ash::AppListConfigType::kDense:
      return 4;
    case ash::AppListConfigType::kSmall:
      return 0;
  }
}

int GridFocusDimensionForType(ash::AppListConfigType type) {
  switch (type) {
    case ash::AppListConfigType::kLarge:
      return 80;
    case ash::AppListConfigType::kMedium:
      return 64;
    case ash::AppListConfigType::kSmall:
      return 56;
    // Unused for ProductivityLauncher.
    case ash::AppListConfigType::kRegular:
    case ash::AppListConfigType::kDense:
      return -1;
  }
}

int GridFocusCornerRadiusForType(ash::AppListConfigType type) {
  switch (type) {
    case ash::AppListConfigType::kLarge:
      return 12;
    case ash::AppListConfigType::kMedium:
    case ash::AppListConfigType::kSmall:
    case ash::AppListConfigType::kRegular:
    case ash::AppListConfigType::kDense:
      return 8;
  }
}

int AppTitleMaxLineHeightForType(ash::AppListConfigType type) {
  switch (type) {
    case ash::AppListConfigType::kLarge:
    case ash::AppListConfigType::kRegular:
      return 20;
    case ash::AppListConfigType::kMedium:
    case ash::AppListConfigType::kSmall:
    case ash::AppListConfigType::kDense:
      return 18;
  }
}

gfx::FontList AppTitleFontForType(ash::AppListConfigType type) {
  ui::ResourceBundle::FontDetails details;
  // TODO(https://crbug.com/1197600): Use Google Sans Text (medium weight) for
  // ProductivityLauncher (kRegular, kDense) when that font is available.
  switch (type) {
    case ash::AppListConfigType::kLarge:
    case ash::AppListConfigType::kRegular:
      details.size_delta = 1;
      break;
    case ash::AppListConfigType::kMedium:
    case ash::AppListConfigType::kSmall:
    case ash::AppListConfigType::kDense:
      details.size_delta = 0;
      break;
  }
  return ui::ResourceBundle::GetSharedInstance().GetFontListForDetails(details);
}

// See "App drag over folder" in go/cros-launcher-spec.
int FolderUnclippedIconDimensionForType(ash::AppListConfigType type) {
  switch (type) {
    case ash::AppListConfigType::kLarge:
      return 88;
    case ash::AppListConfigType::kMedium:
      return 64;
    case ash::AppListConfigType::kSmall:
      return 56;
    case ash::AppListConfigType::kRegular:
      return 76;
    case ash::AppListConfigType::kDense:
      return 56;
  }
}

int FolderClippedIconDimensionForType(ash::AppListConfigType type) {
  switch (type) {
    case ash::AppListConfigType::kLarge:
      return 72;
    case ash::AppListConfigType::kMedium:
      return 56;
    case ash::AppListConfigType::kSmall:
      return 48;
    case ash::AppListConfigType::kRegular:
      return 60;
    case ash::AppListConfigType::kDense:
      return 44;
  }
}

int ItemIconInFolderIconDimensionForType(ash::AppListConfigType type) {
  switch (type) {
    case ash::AppListConfigType::kLarge:
    case ash::AppListConfigType::kRegular:
      return 32;
    case ash::AppListConfigType::kMedium:
      return 28;
    case ash::AppListConfigType::kSmall:
    case ash::AppListConfigType::kDense:
      return 24;
  }
}

int ItemIconInFolderIconMarginForType(ash::AppListConfigType type) {
  switch (type) {
    case ash::AppListConfigType::kLarge:
    case ash::AppListConfigType::kRegular:
    case ash::AppListConfigType::kMedium:
    case ash::AppListConfigType::kDense:
      return 4;
    case ash::AppListConfigType::kSmall:
      return 2;
  }
}

}  // namespace

SharedAppListConfig& SharedAppListConfig::instance() {
  static base::NoDestructor<SharedAppListConfig> shared_config;
  return *shared_config;
}

SharedAppListConfig::SharedAppListConfig()
    : search_result_title_font_style_(ui::ResourceBundle::BaseFont),
      search_result_recommendation_title_font_(
          ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta(1)) {}

int SharedAppListConfig::GetMaxNumOfItemsPerPage() const {
  return 20;
}

int SharedAppListConfig::GetPreferredIconDimension(
    SearchResultDisplayType display_type) const {
  switch (display_type) {
    case SearchResultDisplayType::kList:
      return search_list_icon_dimension_;
    case SearchResultDisplayType::kTile:
      return search_tile_icon_dimension_;
    case SearchResultDisplayType::kChip:
      return suggestion_chip_icon_dimension_;
    case SearchResultDisplayType::kContinue:
      return suggestion_chip_icon_dimension_;
    case SearchResultDisplayType::kNone:        // Falls through.
    case SearchResultDisplayType::kAnswerCard:  // Falls through.
    case SearchResultDisplayType::kLast:
      return 0;
  }
}

AppListConfig::AppListConfig(AppListConfigType type)
    : type_(type),
      scale_x_(1),
      scale_y_(1),
      grid_tile_width_(GridTileWidthForType(type)),
      grid_tile_height_(GridTileHeightForType(type)),
      grid_icon_dimension_(GridIconDimensionForType(type)),
      grid_icon_bottom_padding_(24),
      grid_title_top_padding_(GridTitleTopPaddingForType(type)),
      grid_title_bottom_padding_(GridTitleBottomPaddingForType(type)),
      grid_title_horizontal_padding_(GridTitleHorizontalPaddingForType(type)),
      grid_title_width_(grid_tile_width_),
      grid_focus_dimension_(GridFocusDimensionForType(type)),
      grid_focus_corner_radius_(GridFocusCornerRadiusForType(type)),
      app_title_max_line_height_(AppTitleMaxLineHeightForType(type)),
      app_title_font_(AppTitleFontForType(type)),
      folder_bubble_radius_(FolderUnclippedIconDimensionForType(type) / 2),
      folder_icon_dimension_(FolderClippedIconDimensionForType(type)),
      folder_unclipped_icon_dimension_(
          FolderUnclippedIconDimensionForType(type)),
      folder_icon_radius_(FolderClippedIconDimensionForType(type) / 2),
      folder_background_radius_(12),
      item_icon_in_folder_icon_dimension_(
          ItemIconInFolderIconDimensionForType(type)),
      item_icon_in_folder_icon_margin_(ItemIconInFolderIconMarginForType(type)),
      folder_dropping_circle_radius_(folder_bubble_radius_) {}

AppListConfig::AppListConfig(const AppListConfig& base_config,
                             float scale_x,
                             float scale_y,
                             float inner_tile_scale_y,
                             bool min_y_scale)
    : type_(base_config.type_),
      scale_x_(scale_x),
      scale_y_(scale_y),
      grid_tile_width_(MinScale(base_config.grid_tile_width_, scale_x, 1)),
      grid_tile_height_(MinScale(
          base_config.grid_tile_height_ -
              (min_y_scale ? MinYScaleHeightAdjustmentForType(type_) : 0),
          scale_y,
          1)),
      grid_icon_dimension_(MinScale(base_config.grid_icon_dimension_,
                                    scale_x,
                                    inner_tile_scale_y)),
      grid_icon_bottom_padding_(MinScale(
          base_config.grid_icon_bottom_padding_ +
              (min_y_scale ? MinYScaleHeightAdjustmentForType(type_) : 0),
          inner_tile_scale_y,
          1)),
      grid_title_top_padding_(MinScale(
          base_config.grid_title_top_padding_ -
              (min_y_scale ? MinYScaleHeightAdjustmentForType(type_) : 0),
          inner_tile_scale_y,
          1)),
      grid_title_bottom_padding_(
          MinScale(base_config.grid_title_bottom_padding_,
                   inner_tile_scale_y,
                   1)),
      grid_title_horizontal_padding_(
          MinScale(base_config.grid_title_horizontal_padding_, scale_x, 1)),
      grid_title_width_(base_config.grid_tile_width_),
      grid_focus_dimension_(MinScale(base_config.grid_focus_dimension_,
                                     scale_x,
                                     inner_tile_scale_y)),
      grid_focus_corner_radius_(MinScale(base_config.grid_focus_corner_radius_,
                                         scale_x,
                                         inner_tile_scale_y)),
      app_title_max_line_height_(base_config.app_title_max_line_height_),
      app_title_font_(base_config.app_title_font_.DeriveWithSizeDelta(
          min_y_scale ? -2 : (scale_y < 0.66 ? -1 : 0))),
      folder_bubble_radius_(MinScale(base_config.folder_bubble_radius_,
                                     scale_x,
                                     inner_tile_scale_y)),
      folder_icon_dimension_(MinScale(base_config.folder_icon_dimension_,
                                      scale_x,
                                      inner_tile_scale_y)),
      folder_unclipped_icon_dimension_(
          MinScale(base_config.folder_unclipped_icon_dimension_,
                   scale_x,
                   inner_tile_scale_y)),
      folder_icon_radius_(MinScale(base_config.folder_icon_radius_,
                                   scale_x,
                                   inner_tile_scale_y)),
      folder_background_radius_(
          MinScale(base_config.folder_background_radius_, scale_x, scale_y)),
      item_icon_in_folder_icon_dimension_(
          MinScale(base_config.item_icon_in_folder_icon_dimension_,
                   scale_x,
                   inner_tile_scale_y)),
      item_icon_in_folder_icon_margin_(
          MinScale(base_config.item_icon_in_folder_icon_margin_,
                   scale_x,
                   inner_tile_scale_y)),
      folder_dropping_circle_radius_(
          MinScale(base_config.folder_dropping_circle_radius_,
                   scale_x,
                   inner_tile_scale_y)) {}

AppListConfig::~AppListConfig() = default;

}  // namespace ash


text:
<!doctype html>

		<title>Zabuun - Learn Egyptian Arabic for English speakers</title>
		<meta name="description" content="">
		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/head.php';?>

		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/ie8.php';?>
		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/header.php';?>

			<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/side.php';?>

Essays > The Heart Attack (1)

						Expand All | Collapse All

The Heart Attack (1)

 He couldn't believe it. I'm having a heart attack, he thought. No, it couldn't be. He was perfectly healthy, or at least he was the last time he saw his doctor. When was that—one year, or two years, ago? Well, it didn't matter. Your doctor could give you a clean bill of health on Monday and you could drop dead on Wednesday. But he had great genes—no one in his family had ever died of a heart attack. In fact, no one in his family had ever died o

		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/footer.php';?>
		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/scripts.php';?>


text:
layout: document
title: Finanzkalkulation
document_type: excel
application: docs
folderish: false
parent: "MinistrantInnen-Fest vom 7. September 2014 in St. Gallen"
parentid: minifest
pinned: true
tile_size: 2.
document_creator: Liz Baker
document_creator_id: liz
---


text:
package net.siufung.bzgzpt.persistence.collect.dao;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import cn.jbinfo.platform.core.framework.annotation.MyBatisDao;
import net.siufung.bzgzpt.config.persistence.ICrudDAO;
import net.siufung.bzgzpt.persistence.collect.domain.BuziPersonTrain;

/**
 * 对BuziPersonTrain实体进行CRUD操作
 */
@MyBatisDao
public interface IBuziPersonTrainDao extends ICrudDAO<BuziPersonTrain>{

	//----------增加
	/**
	 * @param BuziPersonTrain
	 * 添加
	 */
	public void save(@Param("model")BuziPersonTrain buziPersonTrain);
	//-------根据主键删除
	/**
	 * @param BuziPersonTrain
	 * 删除
	 */
	public void deleteById(@Param("id")Long id);
	//---------------全字段修改
	/**
	 * @param BuziPersonTrain
	 * 修改
	 */
	public void update(@Param("model")BuziPersonTrain buziPersonTrain);
	//---------------查找
	/**
	 * @param
	 * @return 查找
	 */
	public BuziPersonTrain getById(@Param("id")Long id);
	/**
	 * @param
	 * @return 全部字段查找
	 */
	public BuziPersonTrain getByModel(@Param("model")BuziPersonTrain buziPersonTrain);
	//-------------查找list
	/**
	 * @param model
	 */
	public List<BuziPersonTrain> searchList(@Param("model")BuziPersonTrain buziPersonTrain);

	/**
	 * 分页查询方法
	 */
	public List<Map<String,Object>> queryForPage(Map<String,Object> map);
}


text:
package org.pentaho.di.repository.pur;

import static org.junit.Assert.fail;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

import java.net.ConnectException;

import org.junit.Before;
import org.junit.Test;
import org.pentaho.di.repository.KettleRepositoryLostException;

public class UnifiedRepositoryInvocationHandlerTest {
  private static interface IFace {
    Object doNotThrowException();

    Object throwSomeException();

    Object throwChainedConnectException();
  };

  private static final Object returnValue = "return-value";
  private static final RuntimeException rte = new RuntimeException( "some-exception" );
  private static final ConnectException connectException = new ConnectException();

  private static final IFace wrappee = new IFace() {

    @Override
    public Object doNotThrowException() {
      return returnValue;
    }

    @Override
    public Object throwSomeException() {
      throw rte;
    }

    @Override
    public Object throwChainedConnectException() {
      throw new RuntimeException( "wrapper-exception", connectException );
    }

  };

  IFace testee;

  @Before
  public void setUp() {
    testee = UnifiedRepositoryInvocationHandler.forObject( wrappee, IFace.class );
  }

  @Test
  public void testNormalCall() {
    assertEquals( "the method did not return what was expected", returnValue, testee.doNotThrowException() );
  }

  @Test
  public void testThrowingSomeException() {
    try {
      testee.throwSomeException();
    } catch ( RuntimeException actual ) {
      assertEquals( "did not get the expected runtime exception", rte, actual );
    }
  }

  @Test
  public void testThrowingConnectException() {
    try {
      testee.throwChainedConnectException();
    } catch ( KettleRepositoryLostException krle ) {
      Throwable found = krle;
      while ( found != null ) {
        if ( connectException.equals( found ) ) {
          break;
        }
        found = found.getCause();
      }
      assertNotNull( "Should have found the original ConnectException" );
    } catch ( Throwable other ) {
      fail( "Should not catch something other than KettleRepositoryLostException" );
    }
  }
}


text:
<?php

namespace Omnipay\Vindicia\Message;

use Omnipay\Vindicia\TestFramework\Mocker;
use Omnipay\Vindicia\TestFramework\DataFaker;
use Omnipay\Vindicia\TestFramework\SoapTestCase;
use Omnipay\Vindicia\NameValue;
use Omnipay\Vindicia\VindiciaItemBag;
use Omnipay\Common\CreditCard;
use Omnipay\Vindicia\AttributeBag;

class CreatePayPalSubscriptionRequestTest extends SoapTestCase
{
    /**
     * @return void
     */
    public function setUp()
    {
        $this->faker = new DataFaker();

        $this->subscriptionId = $this->faker->subscriptionId();
        $this->planId = $this->faker->planId();
        $this->customerId = $this->faker->customerId();
        $this->productId = $this->faker->productId();
        $this->subscriptionReference = $this->faker->subscriptionReference();
        $this->planReference = $this->faker->planReference();
        $this->customerReference = $this->faker->customerReference();
        $this->productReference = $this->faker->productReference();
        $this->currency = $this->faker->currency();
        $this->statementDescriptor = $this->faker->statementDescriptor();
        $this->ip = $this->faker->ipAddress();
        $this->startTime = $this->faker->timestamp();
        $this->paymentMethodId = $this->faker->paymentMethodId();
        $this->attributes = $this->faker->attributesAsArray();
        $this->subscriptionStatus = $this->faker->subscriptionStatus();
        $this->subscriptionBillingState = $this->faker->subscriptionBillingState();
        $this->returnUrl = $this->faker->url();
        $this->cancelUrl = $this->faker->url();
        $this->card = array(
            'country' => $this->faker->region(),
            'postcode' => $this->faker->postcode()
        );
        $this->shouldAuthorize = $this->faker->bool();

        $this->request = new CreatePayPalSubscriptionRequest($this->getHttpClient(), $this->getHttpRequest());
        $this->request->initialize(
            array(
                'subscriptionId' => $this->subscriptionId,
                'planId' => $this->planId,
                'customerId' => $this->customerId,
                'productId' => $this->productId,
                'subscriptionReference' => $this->subscriptionReference,
                'planReference' => $this->planReference,
                'customerReference' => $this->customerReference,
                'productReference' => $this->productReference,
                'currency' => $this->currency,
                'statementDescriptor' => $this->statementDescriptor,
                'ip' => $this->ip,
                'startTime' => $this->startTime,
                'card' => $this->card,
                'paymentMethodId' => $this->paymentMethodId,
                'attributes' => $this->attributes,
                'returnUrl' => $this->returnUrl,
                'cancelUrl' => $this->cancelUrl,
                'shouldAuthorize' => $this->shouldAuthorize,
            )
        );

        $this->paymentMethodReference = $this->faker->paymentMethodReference();
        $this->payPalToken = $this->faker->payPalToken();
        $this->amount = $this->faker->monetaryAmount($this->currency);
        $this->riskScore = $this->faker->riskScore();
    }

    /**
     * @return void
     */
    public function testSubscriptionId()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreatePayPalSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setSubscriptionId($this->subscriptionId));
        $this->assertSame($this->subscriptionId, $request->getSubscriptionId());
    }

    /**
     * @return void
     */
    public function testPlanId()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreatePayPalSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setPlanId($this->planId));
        $this->assertSame($this->planId, $request->getPlanId());
    }

    /**
     * @return void
     */
    public function testCustomerId()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreatePayPalSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setCustomerId($this->customerId));
        $this->assertSame($this->customerId, $request->getCustomerId());
    }

    /**
     * @return void
     */
    public function testProductId()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreatePayPalSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setProductId($this->productId));
        $this->assertSame($this->productId, $request->getProductId());
    }

    /**
     * @return void
     */
    public function testSubscriptionReference()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreatePayPalSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setSubscriptionReference($this->subscriptionReference));
        $this->assertSame($this->subscriptionReference, $request->getSubscriptionReference());
    }

    /**
     * @return void
     */
    public function testPlanReference()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreatePayPalSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setPlanReference($this->planReference));
        $this->assertSame($this->planReference, $request->getPlanReference());
    }

    /**
     * @return void
     */
    public function testCustomerReference()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreatePayPalSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setCustomerReference($this->customerReference));
        $this->assertSame($this->customerReference, $request->getCustomerReference());
    }

    /**
     * @return void
     */
    public function testProductReference()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreatePayPalSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setProductReference($this->productReference));
        $this->assertSame($this->productReference, $request->getProductReference());
    }

    /**
     * @return void
     */
    public function testStatementDescriptor()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreatePayPalSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setStatementDescriptor($this->statementDescriptor));
        $this->assertSame($this->statementDescriptor, $request->getStatementDescriptor());
    }

    /**
     * @return void
     */
    public function testCurrency()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreatePayPalSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setCurrency($this->currency));
        $this->assertSame($this->currency, $request->getCurrency());
    }

    /**
     * @return void
     */
    public function testIp()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreatePayPalSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setIp($this->ip));
        $this->assertSame($this->ip, $request->getIp());
    }

    /**
     * @return void
     */
    public function testPaymentMethodId()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreatePayPalSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setPaymentMethodId($this->paymentMethodId));
        $this->assertSame($this->paymentMethodId, $request->getPaymentMethodId());
    }

    /**
     * @return void
     */
    public function testPaymentMethodReference()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreatePayPalSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setPaymentMethodReference($this->paymentMethodReference));
        $this->assertSame($this->paymentMethodReference, $request->getPaymentMethodReference());
    }

    /**
     * @return void
     */
    public function testStartTime()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreatePayPalSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setStartTime($this->startTime));
        $this->assertSame($this->startTime, $request->getStartTime());
    }

    /**
     * @return void
     */
    public function testReturnUrl()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreatePayPalSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setReturnUrl($this->returnUrl));
        $this->assertEquals($this->returnUrl, $request->getReturnUrl());
    }

    /**
     * @return void
     */
    public function testCancelUrl()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreatePayPalSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setCancelUrl($this->cancelUrl));
        $this->assertEquals($this->cancelUrl, $request->getCancelUrl());
    }

    /**
     * @return void
     */
    public function testShouldAuthorize()
    {
        $request = Mocker::mock('\Omnipay\Vindicia\Message\CreateSubscriptionRequest')->makePartial();
        $request->initialize();

        $this->assertSame($request, $request->setShouldAuthorize($this->shouldAuthorize));
        $this->assertSame($this->shouldAuthorize, $request->getShouldAuthorize());
    }

    /**
     * @return void
     */
    public function testGetData()
    {
        $data = $this->request->getData();

        $this->assertSame($this->subscriptionId, $data['autobill']->merchantAutoBillId);
        $this->assertSame($this->planId, $data['autobill']->billingPlan->merchantBillingPlanId);
        $this->assertSame($this->subscriptionReference, $data['autobill']->VID);
        $this->assertSame($this->planReference, $data['autobill']->billingPlan->VID);
        $this->assertSame(1, count($data['autobill']->items));
        $this->assertSame($this->productId, $data['autobill']->items[0]->product->merchantProductId);
        $this->assertSame($this->productReference, $data['autobill']->items[0]->product->VID);
        $this->assertSame($this->customerId, $data['autobill']->account->merchantAccountId);
        $this->assertSame($this->customerReference, $data['autobill']->account->VID);
        $this->assertSame($this->currency, $data['autobill']->currency);
        $this->assertSame($this->ip, $data['autobill']->sourceIp);
        $this->assertSame($this->startTime, $data['autobill']->startTimestamp);
        $this->assertSame('DoNotSend', $data['autobill']->statementFormat);
        $this->assertSame($this->statementDescriptor, $data['autobill']->billingStatementIdentifier);
        $this->assertSame($this->paymentMethodId, $data['autobill']->paymentMethod->merchantPaymentMethodId);
        $this->assertSame($this->card['postcode'], $data['autobill']->paymentMethod->billingAddress->postalCode);
        $this->assertSame($this->card['country'], $data['autobill']->paymentMethod->billingAddress->country);
        $this->assertSame('PayPal', $data['autobill']->paymentMethod->type);
        $this->assertSame($this->returnUrl, $data['autobill']->paymentMethod->paypal->returnUrl);
        $this->assertSame($this->cancelUrl, $data['autobill']->paymentMethod->paypal->cancelUrl);

        $numAttributes = count($this->attributes);
        $this->assertSame($numAttributes, count($data['autobill']->nameValues));
        for ($i = 0; $i < $numAttributes; $i++) {
            $this->assertSame($this->attributes[$i]['name'], $data['autobill']->nameValues[$i]->name);
            $this->assertSame($this->attributes[$i]['value'], $data['autobill']->nameValues[$i]->value);
        }

        $this->assertSame('update', $data['action']);
        $this->assertSame('putAutoBillInRetryCycleIfPaymentMethodIsValid', $data['immediateAuthFailurePolicy']);
        $this->assertSame($this->shouldAuthorize, $data['validateForFuturePayment']);
        $this->assertSame(false, $data['ignoreAvsPolicy']);
        $this->assertSame(false, $data['ignoreCvnPolicy']);
        $this->assertSame(null, $data['campaignCode']);
        $this->assertSame(false, $data['dryrun']);
        $this->assertSame(null, $data['cancelReasonCode']);
    }

    /**
     * @expectedException        \Omnipay\Common\Exception\InvalidRequestException
     * @expectedExceptionMessage The returnUrl parameter is required
     * @return                   void
     */
    public function testReturnUrlRequired()
    {
        $this->request->setReturnUrl(null);
        $this->request->getData();
    }

    /**
     * @expectedException        \Omnipay\Common\Exception\InvalidRequestException
     * @expectedExceptionMessage The cancelUrl parameter is required
     * @return                   void
     */
    public function testCancelUrlRequired()
    {
        $this->request->setCancelUrl(null);
        $this->request->getData();
    }

    /**
     * @expectedException        \Omnipay\Common\Exception\InvalidRequestException
     * @expectedExceptionMessage Either the productId or productReference parameter is required.
     * @return                   void
     */
    public function testProductIdOrReferenceRequired()
    {
        $this->request->setProductId(null);
        $this->request->setProductReference(null);
        $this->request->getData();
    }

    /**
     * @expectedException        \Omnipay\Common\Exception\InvalidRequestException
     * @expectedExceptionMessage The subscriptionId parameter is required
     * @return                   void
     */
    public function testSubscriptionIdRequired()
    {
        $this->request->setSubscriptionId(null);
        $this->request->getData();
    }

    /**
     * @expectedException        \Omnipay\Common\Exception\InvalidRequestException
     * @expectedExceptionMessage Either the customerId or customerReference parameter is required.
     * @return                   void
     */
    public function testCustomerIdOrReferenceRequired()
    {
        $this->request->setCustomerId(null);
        $this->request->setCustomerReference(null);
        $this->request->getData();
    }

    /**
     * @return void
     */
    public function testSendSuccess()
    {
        $this->setMockSoapResponse('CreatePayPalSubscriptionSuccess.xml', array(
            'CURRENCY' => $this->currency,
            'AMOUNT' => $this->amount,
            'CUSTOMER_ID' => $this->customerId,
            'CUSTOMER_REFERENCE' => $this->customerReference,
            'PAYMENT_METHOD_ID' => $this->paymentMethodId,
            'PAYMENT_METHOD_REFERENCE' => $this->paymentMethodReference,
            'SUBSCRIPTION_ID' => $this->subscriptionId,
            'SUBSCRIPTION_REFERENCE' => $this->subscriptionReference,
            'PLAN_ID' => $this->planId,
            'PLAN_REFERENCE' => $this->planReference,
            'PRODUCT_ID' => $this->productId,
            'PRODUCT_REFERENCE' => $this->productReference,
            'RETURN_URL' => $this->returnUrl,
            'CANCEL_URL' => $this->cancelUrl,
            'PAYPAL_TOKEN' => $this->payPalToken,
            'RISK_SCORE' => $this->riskScore,
            'STATUS' => $this->subscriptionStatus,
            'BILLING_STATE' => $this->subscriptionBillingState
        ));

        $response = $this->request->send();

        $this->assertTrue($response->isSuccessful());
        $this->assertTrue($response->isRedirect());
        $this->assertFalse($response->isPending());
        $this->assertSame('OK', $response->getMessage());
        $this->assertSame($this->subscriptionId, $response->getSubscriptionId());
        $this->assertSame($this->subscriptionReference, $response->getSubscriptionReference());
        $this->assertSame($this->subscriptionStatus, $response->getSubscriptionStatus());
        $this->assertSame($this->subscriptionBillingState, $response->getSubscriptionBillingState());
        $this->assertSame('https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token=' . $this->payPalToken, $response->getRedirectUrl());
        $this->assertSame($this->riskScore, $response->getRiskScore());

        $this->assertSame(AbstractRequest::TEST_ENDPOINT . '/18.0/AutoBill.wsdl', $this->getLastEndpoint());
    }

    /**
     * @return void
     */
    public function testSendFailure()
    {
        $this->setMockSoapResponse('CreatePayPalSubscriptionFailure.xml');

        $response = $this->request->send();

        $this->assertFalse($response->isSuccessful());
        $this->assertFalse($response->isRedirect());
        $this->assertFalse($response->isPending());
        $this->assertSame('400', $response->getCode());
        $this->assertSame('Unable to update BillingPlan: Unable to create BillingPlan without a Billing Period ', $response->getMessage());

        $this->assertNull($response->getSubscriptionId());
        $this->assertNull($response->getSubscriptionReference());
        $this->assertNull($response->getRedirectUrl());
    }
}


text:
package d.money.pojo.base;

import java.util.ArrayList;
import java.util.List;

public class ArgsExample {
    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    protected Integer mysqlOffset;

    protected Integer mysqlLength;

    public ArgsExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    public void setMysqlOffset(Integer mysqlOffset) {
        this.mysqlOffset=mysqlOffset;
    }

    public Integer getMysqlOffset() {
        return mysqlOffset;
    }

    public void setMysqlLength(Integer mysqlLength) {
        this.mysqlLength=mysqlLength;
    }

    public Integer getMysqlLength() {
        return mysqlLength;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        public Criteria andIdIsNull() {
            addCriterion("id is null");
            return (Criteria) this;
        }

        public Criteria andIdIsNotNull() {
            addCriterion("id is not null");
            return (Criteria) this;
        }

        public Criteria andIdEqualTo(Integer value) {
            addCriterion("id =", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotEqualTo(Integer value) {
            addCriterion("id <>", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThan(Integer value) {
            addCriterion("id >", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("id >=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThan(Integer value) {
            addCriterion("id <", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThanOrEqualTo(Integer value) {
            addCriterion("id <=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdIn(List<Integer> values) {
            addCriterion("id in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotIn(List<Integer> values) {
            addCriterion("id not in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdBetween(Integer value1, Integer value2) {
            addCriterion("id between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotBetween(Integer value1, Integer value2) {
            addCriterion("id not between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andBonusIsNull() {
            addCriterion("bonus is null");
            return (Criteria) this;
        }

        public Criteria andBonusIsNotNull() {
            addCriterion("bonus is not null");
            return (Criteria) this;
        }

        public Criteria andBonusEqualTo(Integer value) {
            addCriterion("bonus =", value, "bonus");
            return (Criteria) this;
        }

        public Criteria andBonusNotEqualTo(Integer value) {
            addCriterion("bonus <>", value, "bonus");
            return (Criteria) this;
        }

        public Criteria andBonusGreaterThan(Integer value) {
            addCriterion("bonus >", value, "bonus");
            return (Criteria) this;
        }

        public Criteria andBonusGreaterThanOrEqualTo(Integer value) {
            addCriterion("bonus >=", value, "bonus");
            return (Criteria) this;
        }

        public Criteria andBonusLessThan(Integer value) {
            addCriterion("bonus <", value, "bonus");
            return (Criteria) this;
        }

        public Criteria andBonusLessThanOrEqualTo(Integer value) {
            addCriterion("bonus <=", value, "bonus");
            return (Criteria) this;
        }

        public Criteria andBonusIn(List<Integer> values) {
            addCriterion("bonus in", values, "bonus");
            return (Criteria) this;
        }

        public Criteria andBonusNotIn(List<Integer> values) {
            addCriterion("bonus not in", values, "bonus");
            return (Criteria) this;
        }

        public Criteria andBonusBetween(Integer value1, Integer value2) {
            addCriterion("bonus between", value1, value2, "bonus");
            return (Criteria) this;
        }

        public Criteria andBonusNotBetween(Integer value1, Integer value2) {
            addCriterion("bonus not between", value1, value2, "bonus");
            return (Criteria) this;
        }

        public Criteria andTjBonusPercentIsNull() {
            addCriterion("tj_bonus_percent is null");
            return (Criteria) this;
        }

        public Criteria andTjBonusPercentIsNotNull() {
            addCriterion("tj_bonus_percent is not null");
            return (Criteria) this;
        }

        public Criteria andTjBonusPercentEqualTo(Float value) {
            addCriterion("tj_bonus_percent =", value, "tjBonusPercent");
            return (Criteria) this;
        }

        public Criteria andTjBonusPercentNotEqualTo(Float value) {
            addCriterion("tj_bonus_percent <>", value, "tjBonusPercent");
            return (Criteria) this;
        }

        public Criteria andTjBonusPercentGreaterThan(Float value) {
            addCriterion("tj_bonus_percent >", value, "tjBonusPercent");
            return (Criteria) this;
        }

        public Criteria andTjBonusPercentGreaterThanOrEqualTo(Float value) {
            addCriterion("tj_bonus_percent >=", value, "tjBonusPercent");
            return (Criteria) this;
        }

        public Criteria andTjBonusPercentLessThan(Float value) {
            addCriterion("tj_bonus_percent <", value, "tjBonusPercent");
            return (Criteria) this;
        }

        public Criteria andTjBonusPercentLessThanOrEqualTo(Float value) {
            addCriterion("tj_bonus_percent <=", value, "tjBonusPercent");
            return (Criteria) this;
        }

        public Criteria andTjBonusPercentIn(List<Float> values) {
            addCriterion("tj_bonus_percent in", values, "tjBonusPercent");
            return (Criteria) this;
        }

        public Criteria andTjBonusPercentNotIn(List<Float> values) {
            addCriterion("tj_bonus_percent not in", values, "tjBonusPercent");
            return (Criteria) this;
        }

        public Criteria andTjBonusPercentBetween(Float value1, Float value2) {
            addCriterion("tj_bonus_percent between", value1, value2, "tjBonusPercent");
            return (Criteria) this;
        }

        public Criteria andTjBonusPercentNotBetween(Float value1, Float value2) {
            addCriterion("tj_bonus_percent not between", value1, value2, "tjBonusPercent");
            return (Criteria) this;
        }

        public Criteria andPxBonusPercentIsNull() {
            addCriterion("px_bonus_percent is null");
            return (Criteria) this;
        }

        public Criteria andPxBonusPercentIsNotNull() {
            addCriterion("px_bonus_percent is not null");
            return (Criteria) this;
        }

        public Criteria andPxBonusPercentEqualTo(Float value) {
            addCriterion("px_bonus_percent =", value, "pxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andPxBonusPercentNotEqualTo(Float value) {
            addCriterion("px_bonus_percent <>", value, "pxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andPxBonusPercentGreaterThan(Float value) {
            addCriterion("px_bonus_percent >", value, "pxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andPxBonusPercentGreaterThanOrEqualTo(Float value) {
            addCriterion("px_bonus_percent >=", value, "pxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andPxBonusPercentLessThan(Float value) {
            addCriterion("px_bonus_percent <", value, "pxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andPxBonusPercentLessThanOrEqualTo(Float value) {
            addCriterion("px_bonus_percent <=", value, "pxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andPxBonusPercentIn(List<Float> values) {
            addCriterion("px_bonus_percent in", values, "pxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andPxBonusPercentNotIn(List<Float> values) {
            addCriterion("px_bonus_percent not in", values, "pxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andPxBonusPercentBetween(Float value1, Float value2) {
            addCriterion("px_bonus_percent between", value1, value2, "pxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andPxBonusPercentNotBetween(Float value1, Float value2) {
            addCriterion("px_bonus_percent not between", value1, value2, "pxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andZxBonusPercentIsNull() {
            addCriterion("zx_bonus_percent is null");
            return (Criteria) this;
        }

        public Criteria andZxBonusPercentIsNotNull() {
            addCriterion("zx_bonus_percent is not null");
            return (Criteria) this;
        }

        public Criteria andZxBonusPercentEqualTo(Float value) {
            addCriterion("zx_bonus_percent =", value, "zxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andZxBonusPercentNotEqualTo(Float value) {
            addCriterion("zx_bonus_percent <>", value, "zxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andZxBonusPercentGreaterThan(Float value) {
            addCriterion("zx_bonus_percent >", value, "zxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andZxBonusPercentGreaterThanOrEqualTo(Float value) {
            addCriterion("zx_bonus_percent >=", value, "zxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andZxBonusPercentLessThan(Float value) {
            addCriterion("zx_bonus_percent <", value, "zxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andZxBonusPercentLessThanOrEqualTo(Float value) {
            addCriterion("zx_bonus_percent <=", value, "zxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andZxBonusPercentIn(List<Float> values) {
            addCriterion("zx_bonus_percent in", values, "zxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andZxBonusPercentNotIn(List<Float> values) {
            addCriterion("zx_bonus_percent not in", values, "zxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andZxBonusPercentBetween(Float value1, Float value2) {
            addCriterion("zx_bonus_percent between", value1, value2, "zxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andZxBonusPercentNotBetween(Float value1, Float value2) {
            addCriterion("zx_bonus_percent not between", value1, value2, "zxBonusPercent");
            return (Criteria) this;
        }

        public Criteria andCommentIsNull() {
            addCriterion("comment is null");
            return (Criteria) this;
        }

        public Criteria andCommentIsNotNull() {
            addCriterion("comment is not null");
            return (Criteria) this;
        }

        public Criteria andCommentEqualTo(String value) {
            addCriterion("comment =", value, "comment");
            return (Criteria) this;
        }

        public Criteria andCommentNotEqualTo(String value) {
            addCriterion("comment <>", value, "comment");
            return (Criteria) this;
        }

        public Criteria andCommentGreaterThan(String value) {
            addCriterion("comment >", value, "comment");
            return (Criteria) this;
        }

        public Criteria andCommentGreaterThanOrEqualTo(String value) {
            addCriterion("comment >=", value, "comment");
            return (Criteria) this;
        }

        public Criteria andCommentLessThan(String value) {
            addCriterion("comment <", value, "comment");
            return (Criteria) this;
        }

        public Criteria andCommentLessThanOrEqualTo(String value) {
            addCriterion("comment <=", value, "comment");
            return (Criteria) this;
        }

        public Criteria andCommentLike(String value) {
            addCriterion("comment like", value, "comment");
            return (Criteria) this;
        }

        public Criteria andCommentNotLike(String value) {
            addCriterion("comment not like", value, "comment");
            return (Criteria) this;
        }

        public Criteria andCommentIn(List<String> values) {
            addCriterion("comment in", values, "comment");
            return (Criteria) this;
        }

        public Criteria andCommentNotIn(List<String> values) {
            addCriterion("comment not in", values, "comment");
            return (Criteria) this;
        }

        public Criteria andCommentBetween(String value1, String value2) {
            addCriterion("comment between", value1, value2, "comment");
            return (Criteria) this;
        }

        public Criteria andCommentNotBetween(String value1, String value2) {
            addCriterion("comment not between", value1, value2, "comment");
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria {

        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}