text:
package org.killbill.billing.client.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

public class StackTraceElement {

    private String className;
    private String fileName;
    private Integer lineNumber;
    private String methodName;
    private Boolean nativeMethod;

    @JsonCreator
    public StackTraceElement(@JsonProperty("className") final String className,
                             @JsonProperty("fileName") final String fileName,
                             @JsonProperty("lineNumber") final Integer lineNumber,
                             @JsonProperty("methodName") final String methodName,
                             @JsonProperty("nativeMethod") final Boolean nativeMethod) {
        this.className = className;
        this.fileName = fileName;
        this.lineNumber = lineNumber;
        this.methodName = methodName;
        this.nativeMethod = nativeMethod;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(final String className) {
        this.className = className;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(final String fileName) {
        this.fileName = fileName;
    }

    public Integer getLineNumber() {
        return lineNumber;
    }

    public void setLineNumber(final Integer lineNumber) {
        this.lineNumber = lineNumber;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(final String methodName) {
        this.methodName = methodName;
    }

    public Boolean getNativeMethod() {
        return nativeMethod;
    }

    public void setNativeMethod(final Boolean nativeMethod) {
        this.nativeMethod = nativeMethod;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("StackTraceElement{");
        sb.append("className='").append(className).append('\'');
        sb.append(", fileName='").append(fileName).append('\'');
        sb.append(", lineNumber=").append(lineNumber);
        sb.append(", methodName='").append(methodName).append('\'');
        sb.append(", nativeMethod=").append(nativeMethod);
        sb.append('}');
        return sb.toString();
    }

    @Override
    public boolean equals(final Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        final StackTraceElement that = (StackTraceElement) o;

        if (className != null ? !className.equals(that.className) : that.className != null) {
            return false;
        }
        if (fileName != null ? !fileName.equals(that.fileName) : that.fileName != null) {
            return false;
        }
        if (lineNumber != null ? !lineNumber.equals(that.lineNumber) : that.lineNumber != null) {
            return false;
        }
        if (methodName != null ? !methodName.equals(that.methodName) : that.methodName != null) {
            return false;
        }
        if (nativeMethod != null ? !nativeMethod.equals(that.nativeMethod) : that.nativeMethod != null) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int result = className != null ? className.hashCode() : 0;
        result = 31 * result + (fileName != null ? fileName.hashCode() : 0);
        result = 31 * result + (lineNumber != null ? lineNumber.hashCode() : 0);
        result = 31 * result + (methodName != null ? methodName.hashCode() : 0);
        result = 31 * result + (nativeMethod != null ? nativeMethod.hashCode() : 0);
        return result;
    }
}


text:
#include "tensorflow/lite/delegates/gpu/gl/kernels/elementwise.h"

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "tensorflow/lite/delegates/gpu/common/operations.h"
#include "tensorflow/lite/delegates/gpu/gl/kernels/test_util.h"

using ::testing::FloatNear;
using ::testing::Pointwise;

namespace tflite {
namespace gpu {
namespace gl {
namespace {

class ElementwiseOneArgumentTest : public ::testing::Test {
 public:
  ElementwiseOneArgumentTest() = default;
  ~ElementwiseOneArgumentTest() override = default;

  TensorRefFloat32 GetTensorRef(int ref) {
    TensorRefFloat32 tensor_ref;
    tensor_ref.type = DataType::FLOAT32;
    tensor_ref.ref = ref;
    tensor_ref.shape = BHWC(1, 2, 2, 1);
    return tensor_ref;
  }
};

TEST_F(ElementwiseOneArgumentTest, Abs) {
  OperationType op_type = OperationType::ABS;
  SingleOpModel model({ToString(op_type), {}}, {GetTensorRef(0)},
                      {GetTensorRef(1)});
  ASSERT_TRUE(model.PopulateTensor(0, {0.0, -6.2, 2.0, 4.0}));
  ASSERT_OK(model.Invoke(*NewElementwiseNodeShader(op_type)));
  EXPECT_THAT(model.GetOutput(0),
              Pointwise(FloatNear(1e-6), {0.0, 6.2, 2.0, 4.0}));
}

TEST_F(ElementwiseOneArgumentTest, Sin) {
  OperationType op_type = OperationType::SIN;
  SingleOpModel model({ToString(op_type), {}}, {GetTensorRef(0)},
                      {GetTensorRef(1)});
  ASSERT_TRUE(model.PopulateTensor(0, {0.0, 3.1415926, -3.1415926, 1.0}));
  ASSERT_OK(model.Invoke(*NewElementwiseNodeShader(op_type)));
  EXPECT_THAT(model.GetOutput(0),
              Pointwise(FloatNear(1e-6), {0.0, 0.0, 0.0, 0.841471}));
}

TEST_F(ElementwiseOneArgumentTest, Cos) {
  OperationType op_type = OperationType::COS;
  SingleOpModel model({ToString(op_type), {}}, {GetTensorRef(0)},
                      {GetTensorRef(1)});
  ASSERT_TRUE(model.PopulateTensor(0, {0.0, 3.1415926, -3.1415926, 1}));
  ASSERT_OK(model.Invoke(*NewElementwiseNodeShader(op_type)));
  EXPECT_THAT(model.GetOutput(0),
              Pointwise(FloatNear(1e-6), {1.0, -1.0, -1.0, 0.540302}));
}

TEST_F(ElementwiseOneArgumentTest, Log) {
  OperationType op_type = OperationType::LOG;
  SingleOpModel model({ToString(op_type), {}}, {GetTensorRef(0)},
                      {GetTensorRef(1)});
  ASSERT_TRUE(model.PopulateTensor(0, {1.0, 3.1415926, 1.0, 1.0}));
  ASSERT_OK(model.Invoke(*NewElementwiseNodeShader(op_type)));
  EXPECT_THAT(model.GetOutput(0),
              Pointwise(FloatNear(1e-6), {0.0, 1.14473, 0.0, 0.0}));
}

TEST_F(ElementwiseOneArgumentTest, Sqrt) {
  OperationType op_type = OperationType::SQRT;
  SingleOpModel model({ToString(op_type), {}}, {GetTensorRef(0)},
                      {GetTensorRef(1)});
  ASSERT_TRUE(model.PopulateTensor(0, {0.0, 1.0, 2.0, 4.0}));
  ASSERT_OK(model.Invoke(*NewElementwiseNodeShader(op_type)));
  EXPECT_THAT(model.GetOutput(0),
              Pointwise(FloatNear(1e-6), {0.0, 1.0, 1.414213, 2.0}));
}

TEST_F(ElementwiseOneArgumentTest, Rsqrt) {
  OperationType op_type = OperationType::RSQRT;
  SingleOpModel model({ToString(op_type), {}}, {GetTensorRef(0)},
                      {GetTensorRef(1)});
  ASSERT_TRUE(model.PopulateTensor(0, {1.0, 2.0, 4.0, 9.0}));
  ASSERT_OK(model.Invoke(*NewElementwiseNodeShader(op_type)));
  EXPECT_THAT(model.GetOutput(0),
              Pointwise(FloatNear(1e-6), {1.0, 0.707106, 0.5, 0.333333}));
}

TEST_F(ElementwiseOneArgumentTest, Square) {
  OperationType op_type = OperationType::SQUARE;
  SingleOpModel model({ToString(op_type), {}}, {GetTensorRef(0)},
                      {GetTensorRef(1)});
  ASSERT_TRUE(model.PopulateTensor(0, {1.0, 2.0, 0.5, -3.0}));
  ASSERT_OK(model.Invoke(*NewElementwiseNodeShader(op_type)));
  EXPECT_THAT(model.GetOutput(0),
              Pointwise(FloatNear(1e-6), {1.0, 4.0, 0.25, 9.0}));
}

TEST_F(ElementwiseOneArgumentTest, Sigmoid) {
  OperationType op_type = OperationType::SIGMOID;
  SingleOpModel model({ToString(op_type), {}}, {GetTensorRef(0)},
                      {GetTensorRef(1)});
  ASSERT_TRUE(model.PopulateTensor(0, {0.0, -6.0, 2.0, 4.0}));
  ASSERT_OK(model.Invoke(*NewElementwiseNodeShader(op_type)));
  EXPECT_THAT(model.GetOutput(0),
              Pointwise(FloatNear(1e-6), {0.5, 0.002473, 0.880797, 0.982014}));
}

TEST_F(ElementwiseOneArgumentTest, Tanh) {
  OperationType op_type = OperationType::TANH;
  SingleOpModel model({ToString(op_type), {}}, {GetTensorRef(0)},
                      {GetTensorRef(1)});
  ASSERT_TRUE(model.PopulateTensor(0, {0.0, -6.0, 2.0, 4.0}));
  ASSERT_OK(model.Invoke(*NewElementwiseNodeShader(op_type)));
  EXPECT_THAT(model.GetOutput(0),
              Pointwise(FloatNear(1e-6), {0.0, -0.999987, 0.964027, 0.999329}));
}

class ElementwiseTwoArgumentsTest : public ::testing::Test {
 public:
  ElementwiseTwoArgumentsTest() = default;
  ~ElementwiseTwoArgumentsTest() override = default;

  TensorRefFloat32 GetTensorRef(int ref) {
    TensorRefFloat32 tensor_ref;
    tensor_ref.type = DataType::FLOAT32;
    tensor_ref.ref = ref;
    tensor_ref.shape = BHWC(1, 2, 2, 1);
    return tensor_ref;
  }
};

TEST_F(ElementwiseTwoArgumentsTest, Sub) {
  OperationType op_type = OperationType::SUB;
  SingleOpModel model({ToString(op_type), {}},
                      {GetTensorRef(0), GetTensorRef(1)}, {GetTensorRef(2)});
  ASSERT_TRUE(model.PopulateTensor(0, {0.0, -6.2, 2.0, 4.0}));
  ASSERT_TRUE(model.PopulateTensor(1, {1.0, 2.0, 3.0, 4.0}));
  ASSERT_OK(model.Invoke(*NewElementwiseNodeShader(op_type)));
  EXPECT_THAT(model.GetOutput(0),
              Pointwise(FloatNear(1e-6), {-1.0, -8.2, -1.0, 0.0}));
}

TEST_F(ElementwiseTwoArgumentsTest, Div) {
  OperationType op_type = OperationType::DIV;
  SingleOpModel model({ToString(op_type), {}},
                      {GetTensorRef(0), GetTensorRef(1)}, {GetTensorRef(2)});
  ASSERT_TRUE(model.PopulateTensor(0, {0.0, -6.2, 2.0, 4.0}));
  ASSERT_TRUE(model.PopulateTensor(1, {1.0, 2.0, -0.5, 4.0}));
  ASSERT_OK(model.Invoke(*NewElementwiseNodeShader(op_type)));
  EXPECT_THAT(model.GetOutput(0),
              Pointwise(FloatNear(1e-6), {0.0, -3.1, -4.0, 1.0}));
}

TEST_F(ElementwiseTwoArgumentsTest, Pow) {
  OperationType op_type = OperationType::POW;
  SingleOpModel model({ToString(op_type), {}},
                      {GetTensorRef(0), GetTensorRef(1)}, {GetTensorRef(2)});
  ASSERT_TRUE(model.PopulateTensor(0, {0.0, 1.0, 2.0, 4.0}));
  ASSERT_TRUE(model.PopulateTensor(1, {1.0, 2.0, 3.0, 4.0}));
  ASSERT_OK(model.Invoke(*NewElementwiseNodeShader(op_type)));
  EXPECT_THAT(model.GetOutput(0),
              Pointwise(FloatNear(1e-6), {0.0, 1.0, 8.0, 256.0}));
}

TEST_F(ElementwiseTwoArgumentsTest, SquaredDiff) {
  OperationType op_type = OperationType::SQUARED_DIFF;
  SingleOpModel model({ToString(op_type), {}},
                      {GetTensorRef(0), GetTensorRef(1)}, {GetTensorRef(2)});
  ASSERT_TRUE(model.PopulateTensor(0, {0.0, 2.0, 2.0, 4.0}));
  ASSERT_TRUE(model.PopulateTensor(1, {1.0, 1.0, 5.0, 4.0}));
  ASSERT_OK(model.Invoke(*NewElementwiseNodeShader(op_type)));
  EXPECT_THAT(model.GetOutput(0),
              Pointwise(FloatNear(1e-6), {1.0, 1.0, 9.0, 0.0}));
}

}  // namespace
}  // namespace gl
}  // namespace gpu
}  // namespace tflite

redpajama_set_name: RedPajamaGithub


text:
namespace flutter {

// This class represents a frame that has been fully configured for the
// underlying client rendering API. A frame may only be submitted once.
class SurfaceFrame {
 public:
  using SubmitCallback =
      std::function<bool(SurfaceFrame& surface_frame, SkCanvas* canvas)>;

  // Information about the underlying framebuffer
  struct FramebufferInfo {
    // Indicates whether or not the surface supports pixel readback as used in
    // circumstances such as a BackdropFilter.
    bool supports_readback = false;

    // Indicates that target device supports partial repaint. At very minimum
    // this means that the surface will provide valid existing damage.
    bool supports_partial_repaint = false;

    // For some targets it may be beneficial or even required to snap clip
    // rect to tile grid. I.e. repainting part of a tile may cause performance
    // degradation if the tile needs to be decompressed first.
    int vertical_clip_alignment = 1;
    int horizontal_clip_alignment = 1;

    // This is the area of framebuffer that lags behind the front buffer.
    //
    // Correctly providing exiting_damage is necessary for supporting double and
    // triple buffering. Embedder is responsible for tracking this area for each
    // of the back buffers used. When doing partial redraw, this area will be
    // repainted alongside of dirty area determined by diffing current and
    // last successfully rasterized layer tree;
    //
    // If existing damage is unspecified (nullopt), entire frame will be
    // rasterized (no partial redraw). To signal that there is no existing
    // damage use an empty SkIRect.
    std::optional<SkIRect> existing_damage;
  };

  SurfaceFrame(sk_sp<SkSurface> surface,
               FramebufferInfo framebuffer_info,
               const SubmitCallback& submit_callback,
               std::unique_ptr<GLContextResult> context_result = nullptr,
               bool display_list_fallback = false);

  struct SubmitInfo {
    // The frame damage for frame n is the difference between frame n and
    // frame (n-1), and represents the area that a compositor must recompose.
    //
    // Corresponds to EGL_KHR_swap_buffers_with_damage
    std::optional<SkIRect> frame_damage;

    // The buffer damage for a frame is the area changed since that same buffer
    // was last used. If the buffer has not been used before, the buffer damage
    // is the entire area of the buffer.
    //
    // Corresponds to EGL_KHR_partial_update
    std::optional<SkIRect> buffer_damage;
  };

  bool Submit();

  bool IsSubmitted() const;

  sk_sp<SkSurface> SkiaSurface() const;

  SkCanvas* SkiaCanvas();

  const FramebufferInfo& framebuffer_info() const { return framebuffer_info_; }

  void set_submit_info(const SubmitInfo& submit_info) {
    submit_info_ = submit_info;
  }
  const SubmitInfo& submit_info() const { return submit_info_; }

  sk_sp<DisplayListBuilder> GetDisplayListBuilder();

  sk_sp<DisplayList> BuildDisplayList();

 private:
  bool submitted_ = false;

  sk_sp<DisplayListCanvasRecorder> dl_recorder_;
  sk_sp<SkSurface> surface_;
  SkCanvas* canvas_ = nullptr;
  FramebufferInfo framebuffer_info_;
  SubmitInfo submit_info_;
  SubmitCallback submit_callback_;
  std::unique_ptr<GLContextResult> context_result_;

  bool PerformSubmit();

  FML_DISALLOW_COPY_AND_ASSIGN(SurfaceFrame);
};

}  // namespace flutter

#endif  // FLUTTER_FLOW_SURFACE_FRAME_H_


text:
const should = require('should');

const {PostsService} = require('../../../../../core/server/services/posts/posts-service');

describe('PostsService', function () {
    describe('shouldSendEmail', function () {
        it('calculates if an email should be sent', async function () {
            const postsService = new PostsService({});

            postsService.shouldSendEmail('published', 'draft').should.be.true();
            postsService.shouldSendEmail('published', 'scheduled').should.be.true();
            postsService.shouldSendEmail('sent', 'draft').should.be.true();
            postsService.shouldSendEmail('sent', 'scheduled').should.be.true();

            postsService.shouldSendEmail('published', 'published').should.be.false();
            postsService.shouldSendEmail('published', 'sent').should.be.false();
            postsService.shouldSendEmail('published', 'published').should.be.false();
            postsService.shouldSendEmail('published', 'sent').should.be.false();
            postsService.shouldSendEmail('sent', 'published').should.be.false();
            postsService.shouldSendEmail('sent', 'sent').should.be.false();

            postsService.shouldSendEmail().should.be.false();
        });
    });
});


text:
using System;
using System.Linq.Expressions;
using System.Reflection;

namespace WootzJs.Injection
{
    public class FactoryResolver : IResolver
    {
        private Func<Request, Delegate> factory;
        private static MethodInfo requestCreateChildRequest;
        private static MethodInfo requestResolve;

        static FactoryResolver()
        {
            requestCreateChildRequest = typeof(Request).GetMethod("CreateChildRequest");
            requestResolve = typeof(Request).GetMethod("Resolve");
        }

        public FactoryResolver(Type type)
        {
            var requestParameter = Expression.Parameter(typeof(Request), "_");

            // Pseudo-code of what this expression tree is building toward
            // var childRequest = requestParameter.CreateChildRequest(type);
            var createChildRequest = Expression.Call(requestParameter, requestCreateChildRequest, Expression.Constant(type));

            // var resolution = childRequest.Resolve();
            var resolution = Expression.Call(createChildRequest, requestResolve);

            // var internalFactoryBody = (type)resolution;
            var internalFactoryBody = Expression.Convert(resolution, type);
            var internalFactoryType = typeof(Func<>).MakeGenericType(type);

            // Func<type> internalFactory = internalFactoryBody;
            var internalFactory = Expression.Lambda(internalFactoryType, internalFactoryBody);

            // Func<Request, Func<Type>> factory = requestParameter => internalFactory;
            var factory = Expression.Lambda<Func<Request, Delegate>>(internalFactory, requestParameter);

            this.factory = factory.Compile();
        }

        public object Instantiate(Request request)
        {
            return factory(request);
        }

        public void Activate(Request request, object o)
        {
        }
    }
}


text:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:paddingLeft="@dimen/activity_horizontal_margin"
                android:paddingRight="@dimen/activity_horizontal_margin"
                android:paddingTop="@dimen/activity_vertical_margin"
                android:paddingBottom="@dimen/activity_vertical_margin"
                android:clipToPadding="false"
                tools:context="com.hozakan.android.sunshine.ui.activities.DetailActivityFragment">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <TextView
            android:id="@+id/day_textview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:fontFamily="sans-serif-condensed"
            android:textSize="24sp"
            tools:text="Today" />

        <TextView
            android:id="@+id/date_textview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:fontFamily="sans-serif-condensed"
            android:textSize="16dp"
            android:textColor="#646464"
            tools:text="June 24" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:gravity="center_vertical">

            <LinearLayout
                android:layout_width="0dp"
                android:layout_weight="5"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:gravity="center_horizontal">

                <TextView
                    android:id="@+id/high_textview"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:fontFamily="sans-serif-light"
                    android:textSize="96sp"
                    tools:text="22" />

                <TextView
                    android:id="@+id/low_textview"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:fontFamily="sans-serif-light"
                    android:textSize="48sp"
                    android:textColor="#646464"
                    tools:text="17" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="0dp"
                android:layout_weight="4"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:gravity="center_horizontal">

                <ImageView
                    android:id="@+id/icon"
                    android:layout_width="100dp"
                    android:layout_height="100dp" />

                <TextView
                    android:id="@+id/forecast_textview"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:fontFamily="sans-serif-cendensed"
                    android:textSize="22sp"
                    android:textColor="#646464"
                    tools:text="Clear" />

            </LinearLayout>

        </LinearLayout>

        <TextView
            android:id="@+id/humidity_textview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:fontFamily="sans-serif-light"
            android:textAppearance="?android:textAppearanceLarge"
            tools:text="@string/format_humidity" />

        <!--<TextView-->
            <!--android:id="@+id/wind_textview"-->
            <!--android:layout_width="wrap_content"-->
            <!--android:layout_height="wrap_content"-->
            <!--android:paddingTop="4dp"-->
            <!--android:fontFamily="sans-serif-light"-->
            <!--android:textAppearance="?android:textAppearanceLarge"-->
            <!--tools:text="@string/format_wind_kmh" />-->

        <com.hozakan.android.sunshine.ui.MyView
            android:id="@+id/wind_textview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingTop="4dp" />

        <TextView
            android:id="@+id/pressure_textview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingTop="4dp"
            android:fontFamily="sans-serif-light"
            android:textAppearance="?android:textAppearanceLarge"
            tools:text="@string/format_pressure" />

    </LinearLayout>

</ScrollView>


text:
module Bosh::AzureCloud
  # https://bosh.io/docs/azure-cpi/#resource-pools
  class VMCloudProps
    include Helpers
    attr_accessor :instance_type
    attr_reader :instance_types
    attr_reader :root_disk, :ephemeral_disk, :caching
    attr_reader :availability_zone
    attr_reader :availability_set
    attr_reader :load_balancer
    attr_reader :application_gateway
    attr_reader :managed_identity
    attr_reader :security_group
    attr_reader :application_security_groups
    attr_reader :assign_dynamic_public_ip, :ip_forwarding, :accelerated_networking
    attr_reader :storage_account_name, :storage_account_type, :storage_account_kind, :storage_account_max_disk_number
    attr_reader :resource_group_name
    attr_reader :tags

    # Below defines are for test purpose
    attr_writer :availability_zone
    attr_writer :availability_set
    attr_writer :assign_dynamic_public_ip

    AVAILABILITY_SET_KEY = 'availability_set'
    LOAD_BALANCER_KEY = 'load_balancer'
    RESOURCE_GROUP_NAME_KEY = 'resource_group_name'
    NAME_KEY = 'name'

    def initialize(vm_properties, global_azure_config)
      @vm_properties = vm_properties.dup

      @instance_type = vm_properties['instance_type']
      @instance_types = vm_properties['instance_types']
      cloud_error("You need to specify one of 'vm_type/instance_type' or 'vm_resources'.") if @instance_type.nil? && (@instance_types.nil? || @instance_types.empty?)

      root_disk_hash = vm_properties.fetch('root_disk', {})
      @root_disk = Bosh::AzureCloud::RootDisk.new(root_disk_hash['size'], root_disk_hash['type'])

      ephemeral_disk_hash = vm_properties.fetch('ephemeral_disk', {})
      @ephemeral_disk = Bosh::AzureCloud::EphemeralDisk.new(
        ephemeral_disk_hash['use_root_disk'].nil? ? false : ephemeral_disk_hash['use_root_disk'],
        ephemeral_disk_hash['size'],
        ephemeral_disk_hash['type']
      )

      @caching = vm_properties.fetch('caching', 'ReadWrite')

      @availability_zone = vm_properties['availability_zone']
      unless @availability_zone.nil?
        cloud_error('Virtual Machines deployed to an Availability Zone must use managed disks') unless global_azure_config.use_managed_disks
        cloud_error("'#{@availability_zone}' is not a valid zone. Available zones are: #{AVAILABILITY_ZONES}") unless AVAILABILITY_ZONES.include?(@availability_zone.to_s)
      end
      @availability_set = _parse_availability_set_config(vm_properties, global_azure_config)
      cloud_error("Only one of 'availability_zone' and 'availability_set' is allowed to be configured for the VM but you have configured both.") if !@availability_zone.nil? && !@availability_set.name.nil?

      @load_balancer = _parse_load_balancer_config(vm_properties, global_azure_config)
      @application_gateway = vm_properties['application_gateway']

      @managed_identity = global_azure_config.default_managed_identity
      managed_identity_hash = vm_properties.fetch('managed_identity', nil)
      @managed_identity = Bosh::AzureCloud::ManagedIdentity.new(managed_identity_hash) unless managed_identity_hash.nil?

      @security_group = Bosh::AzureCloud::SecurityGroup.parse_security_group(vm_properties['security_group'])
      @application_security_groups = vm_properties['application_security_groups']

      @assign_dynamic_public_ip = vm_properties['assign_dynamic_public_ip']
      @ip_forwarding = vm_properties['ip_forwarding']
      @accelerated_networking = vm_properties['accelerated_networking']

      @storage_account_name = vm_properties['storage_account_name']
      @storage_account_kind = vm_properties.fetch('storage_account_kind', STORAGE_ACCOUNT_KIND_GENERAL_PURPOSE_V1)
      @storage_account_type = vm_properties['storage_account_type']
      @storage_account_max_disk_number = vm_properties.fetch('storage_account_max_disk_number', 30)

      @resource_group_name = vm_properties.fetch('resource_group_name', global_azure_config.resource_group_name)
      @tags = vm_properties.fetch('tags', {})
    end

    private

    # In AzureStack, availability sets can only be configured with 1 update domain.
    # In Azure, the max update domain count of a managed/unmanaged availability set is 5.
    def _default_update_domain_count(global_azure_config)
      global_azure_config.environment == ENVIRONMENT_AZURESTACK ? 1 : 5
    end

    # In AzureStack, availability sets can only be configured with 1 fault domain and 1 update domain.
    # In Azure, the max fault domain count of an unmanaged availability set is 3;
    #           the max fault domain count of a managed availability set is 2 in some regions.
    #           When all regions support 3 fault domains, the default value should be changed to 3.
    def _default_fault_domain_count(global_azure_config)
      if global_azure_config.environment == ENVIRONMENT_AZURESTACK
        1
      else
        global_azure_config.use_managed_disks ? 2 : 3
      end
    end

    def _parse_load_balancer_config(vm_properties, global_azure_config)
      if vm_properties[LOAD_BALANCER_KEY].is_a?(Hash)
        resource_group_name = vm_properties[LOAD_BALANCER_KEY][RESOURCE_GROUP_NAME_KEY] || global_azure_config.resource_group_name
        Bosh::AzureCloud::LoadBalancerConfig.new(
          resource_group_name,
          vm_properties[LOAD_BALANCER_KEY][NAME_KEY]
        )
      else
        Bosh::AzureCloud::LoadBalancerConfig.new(
          global_azure_config.resource_group_name,
          vm_properties[LOAD_BALANCER_KEY]
        )
      end
    end

    def _parse_availability_set_config(vm_properties, global_azure_config)
      if vm_properties[AVAILABILITY_SET_KEY].is_a?(Hash)
        platform_update_domain_count = vm_properties[AVAILABILITY_SET_KEY]['platform_update_domain_count'] || _default_update_domain_count(global_azure_config)
        platform_fault_domain_count = vm_properties[AVAILABILITY_SET_KEY]['platform_fault_domain_count'] || _default_fault_domain_count(global_azure_config)
        Bosh::AzureCloud::AvailabilitySetConfig.new(
          vm_properties[AVAILABILITY_SET_KEY][NAME_KEY],
          platform_update_domain_count,
          platform_fault_domain_count
        )
      else
        platform_update_domain_count = vm_properties['platform_update_domain_count'] || _default_update_domain_count(global_azure_config)
        platform_fault_domain_count = vm_properties['platform_fault_domain_count'] || _default_fault_domain_count(global_azure_config)
        Bosh::AzureCloud::AvailabilitySetConfig.new(
          vm_properties[AVAILABILITY_SET_KEY],
          platform_update_domain_count,
          platform_fault_domain_count
        )
      end
    end
  end
end


text:
export default () =>
error! let's go home


text:
namespace UnitTests
{
    using System;
    using System.Net.Sockets;
    using System.Threading;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Splunk;
    using SplunkSDKHelper;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class TestHelper
    {
        /// <summary>
        /// Root Debug string for assertions
        /// </summary>
        private string assertRoot = "Test Support assert: ";

        /// <summary>
        /// The command object
        /// </summary>
        private Command command;

        /// <summary>
        /// Initializes a new instance of the <see cref="TestHelper"/> class.
        /// </summary>
        public TestHelper()
        {
            this.command = Command.Splunk();
        }

        /// <summary>
        /// Connect to splunk using the command line options (or .splunkrc)
        /// </summary>
        /// <returns>The service</returns>
        public Service Connect()
        {
            return Service.Connect(this.command.Opts);
        }

        /// <summary>
        /// Returns a value dermining whether a string is in the
        /// non-ordered array of strings.
        /// </summary>
        /// <param name="array">The array to scan</param>
        /// <param name="value">The value to look for</param>
        /// <returns>True or false</returns>
        public bool Contains(string[] array, string value)
        {
            for (int i = 0; i < array.Length; ++i)
            {
                if (array[i].Equals(value))
                {
                    return true;
                }
            }
            return false;
        }

        /// <summary>
        /// Create a fresh test app with the given name, delete the existing
        /// test app and reboot Splunk.
        /// </summary>
        /// <param name="name">The app name</param>
        public void CreateApp(string name)
        {
            EntityCollection<Application> apps;

            Service service = this.Connect();

            apps = service.GetApplications();
            if (apps.ContainsKey(name))
            {
                apps.Remove(name);
                this.SplunkRestart();
                service = this.Connect();
            }

            apps = service.GetApplications();
            Assert.IsFalse(apps.ContainsKey(name), this.assertRoot + "#1");

            apps.Create(name);
            this.SplunkRestart();
            service = this.Connect();

            apps = service.GetApplications();
            Assert.IsTrue(apps.ContainsKey(name), this.assertRoot + "#2");
        }

        /// <summary>
        /// Remove the given app and reboot Splunk if needed.
        /// </summary>
        /// <param name="name">The app name</param>
        public void RemoveApp(string name)
        {
            EntityCollection<Application> apps;

            Service service = this.Connect();

            apps = service.GetApplications();
            if (apps.ContainsKey(name))
            {
                apps.Remove(name);
                this.SplunkRestart();
                service = this.Connect();
            }

            apps = service.GetApplications();
            Assert.IsFalse(apps.ContainsKey(name), this.assertRoot + "#3");
        }

        /// <summary>
        /// Returns the command object, which picks up .splunkrc
        /// </summary>
        /// <returns>The command object</returns>
        public Command SetUp()
        {
            this.command = Command.Splunk();
            return this.command;
        }

        /// <summary>
        /// Restarts splunk with a default 3 minute restart time check.
        /// </summary>
        public void SplunkRestart()
        {
            // If not specified, use 3 minutes (in milliseconds) as default
            // restart timeout.
            this.SplunkRestart(3 * 60 * 1000);
        }

        /// <summary>
        /// Restarts splunk -- If the restart (i.e. splunk is back up) does
        /// not happen by the time the millisecond timeout counts down, an
        /// the assertion that the service is back up will throw an exception.
        /// </summary>
        /// <param name="millisecondTimeout">The number of milliseconds</param>
        public void SplunkRestart(int millisecondTimeout)
        {
            bool restarted = false;

            Service service = this.Connect();

            ResponseMessage response = service.Restart();

            // Sniff the management port. We expect the port to be up for a short
            // while, and then no conection
            int totalTime = 0;

            // Server is back up, wait until socket no longer accepted.
            while (totalTime < millisecondTimeout)
            {
                try
                {
                    Socket socket = service.Open(service.Port);
                    socket.Close();
                    Thread.Sleep(10);
                    totalTime += 10;
                }
                catch (Exception)
                {
                    break;
                }
            }

            // server down, wait until socket accepted.
            while (totalTime < millisecondTimeout)
            {
                try
                {
                    Socket socket = service.Open(service.Port);
                    socket.Close();
                    break;
                }
                catch (Exception)
                {
                    Thread.Sleep(10);
                    totalTime += 10;
                }
            }

            while (totalTime < millisecondTimeout)
            {
                try
                {
                    this.Connect();
                    restarted = true;
                    break;
                }
                catch (Exception)
                {
                    Thread.Sleep(100);
                    totalTime += 100;
                }
            }

            Assert.IsTrue(restarted, this.assertRoot + "#5");
        }

        /// <summary>
        /// Wait for a job to be queryable
        /// </summary>
        /// <param name="job">The job</param>
        /// <returns>The same job</returns>
        public Job Ready(Job job)
        {
            while (!job.IsReady)
            {
                Thread.Sleep(10);
            }
            return job;
        }

        /// <summary>
        /// Wait for the given job to complete
        /// </summary>
        /// <param name="job">The job</param>
        /// <returns>The same job</returns>
        public Job Wait(Job job)
        {
            while (!job.IsDone)
            {
                Thread.Sleep(1000);
            }

            return job;
        }
    }
}


text:
'use strict';

var forEach = require('lodash/collection/forEach'),
    map = require('lodash/collection/map');

/**
 * A handler that implements reversible attaching/detaching of shapes.
 */
function AttachShapeHandler(modeling) {
  this._modeling = modeling;
}

module.exports = AttachShapeHandler;

AttachShapeHandler.$inject = [ 'modeling' ];

AttachShapeHandler.prototype.execute = function(context) {
  var shape = context.shape,
      newHost = context.newHost,
      oldHost = shape.host;

  // (0) detach from old host
  context.oldHost = oldHost;
  context.attacherIdx = removeAttacher(oldHost, shape);

  // (1) attach to new host
  addAttacher(newHost, shape);

  // position attacher and it's label on top of host
  positionOnTop(context);

  // (2) update host
  shape.host = newHost;

  return shape;
};

AttachShapeHandler.prototype.revert = function(context) {
  var shape = context.shape,
      newHost = context.newHost,
      oldHost = context.oldHost,
      attacherIdx = context.attacherIdx;

  // (2) update host
  shape.host = oldHost;

  // (1) attach to new host
  removeAttacher(newHost, shape);

  // (0) detach from old host
  addAttacher(oldHost, shape, attacherIdx);

  // position attacher and it's label on top of oldHost
  reposition(context);

  return shape;
};

function insertAfter(coll, a, b) {
  // b comes after a
  var aIdx = coll.indexOf(a),
      bIdx = coll.indexOf(b);

  if ((aIdx === -1 || bIdx === -1) || (bIdx > aIdx)) {
    return;
  }

  coll.splice(bIdx, 1);

  aIdx = coll.indexOf(a);

  coll.splice(aIdx, 1, a, b);
}

function positionOnTop(context) {
  var shape = context.shape,
      newHost = context.newHost,
      oldHost = context.oldHost,
      parent = shape.parent,
      children = parent.children,
      label;

  if (!newHost) {
    return;
  }

  var elements = (label = shape.label) ? [ oldHost, shape, label ] : [ oldHost, shape ];

  context.elements = map(elements, function(element) {
    return {
      shape: element,
      idx: children.indexOf(element)
    };
  });

  insertAfter(children, newHost, shape);

  if (label) {
    insertAfter(children, shape, label);
  }
}

function reposition(context) {
  var shape = context.shape,
      oldHost = context.oldHost,
      parent = shape.parent,
      children = parent.children,
      elements = context.elements;

  if (!oldHost) {
    return;
  }

  forEach(elements, function(element) {
    children.splice(children.indexOf(element.shape), 1);

    children.splice(element.idx, 0, element.shape);
  });
}

function removeAttacher(host, attacher) {
  var attachers = host && host.attachers;

  var idx = -1;

  if (attachers) {
    idx = attachers.indexOf(attacher);

    if (idx !== -1) {
      attachers.splice(idx, 1);
    }
  }

  return idx;
}

function addAttacher(host, attacher, idx) {

  if (!host) {
    return;
  }

  var attachers = host.attachers;

  if (!attachers) {
    host.attachers = attachers = [];
  }

  attachers.splice(idx || attachers.length, 0, attacher);
}


text:
CGFloat const kTableHeaderHeight = 300.0;
CGFloat const kTableHeaderCutAway = 30.0;
CGFloat const kTableHeaderOffset = 15.0;

@interface MainController () <UIScrollViewDelegate>
@property (strong, nonatomic) UIView *headerView;
@end

@interface MainController ()
@property (nonatomic, retain) BlurTransition *transition;
@end

@interface MainController ()
- (IBAction)refresh:(UIRefreshControl *)sender;
@property (nonatomic, retain) DataSource *dataSource;
@end

@implementation MainController

- (void)viewDidLoad {
    [super viewDidLoad];

    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;

    self.dataSource = [[DataSource alloc] init];
    self.tableView.dataSource = self.dataSource;

    [self.dataSource registerReusableViewsWithTableView:self.tableView];
    [self.dataSource loadContentWithCompletionHandler:^{
        [self.tableView reloadData];
    }];

//    UIView *view = [UIView new];
//    UIImageView *imageView = [UIImageView new];
//    imageView.image = [UIImage imageNamed:@"bg-header"];
//    imageView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
//    imageView.contentMode = UIViewContentModeScaleAspectFill;
//    [view addSubview:imageView];
//    [view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[imageView]|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(imageView)]];
//    [view addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[imageView]|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(imageView)]];

    // Little handshake to manage the view ourselves
    self.headerView = self.tableView.tableHeaderView;
    self.tableView.tableHeaderView = nil;
    [self.tableView addSubview:self.headerView];

    CGFloat offset = kTableHeaderHeight - kTableHeaderOffset;
    offset -= 44; // so that tableHeader goes nicely under the navbar
    self.tableView.contentInset = UIEdgeInsetsMake(offset, 0, 0, 0);
    self.tableView.contentOffset = CGPointMake(0, -offset);

    self.transition = [[BlurTransition alloc] init];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.translucent = YES;
    [self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Navigation

- (BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender {
    return YES;
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if (![[segue identifier] isEqualToString:@"showDetailSegue"]) return;
    NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
    NSString *text = self.dataSource.items[indexPath.item];
    NSLog(@"text: %@", text);
    WebViewController *controller = segue.destinationViewController;
    if ([text containsString:@"http"]) {
        controller.url = [NSURL URLWithString:text];
    } else {
        controller.url = [NSURL URLWithString:@"http://developer.mozilla.org"];
    }
    [self.tableView deselectRowAtIndexPath:indexPath animated:NO];
}

#pragma mark - UITableViewDelegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
}

#pragma mark - UIRefreshControl

- (IBAction)refresh:(UIRefreshControl *)sender {
    // Reload the data. This example datasource uses a block to
    // signal when the data has finished being refreshed
    [self.dataSource loadContentWithCompletionHandler:^{
        // Reload the table data with the new data
        [self.tableView reloadData];
        // Restore the view to normal
        [sender endRefreshing];
    }];
}

#pragma mark -

- (IBAction)settings:(UIBarButtonItem *)sender {
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    UIViewController *controller = [storyboard instantiateViewControllerWithIdentifier:@"settingsNavigation"];
    controller.modalTransitionStyle = UIModalPresentationCustom;
    controller.transitioningDelegate = self.transition;

    [self presentViewController:controller animated:YES completion:nil];
}

#pragma mark - UIScrollViewDelegate

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    [self updateHeaderView];
}

- (void) updateHeaderView {
    CGFloat offset = kTableHeaderHeight - kTableHeaderOffset;
    CGRect rect = CGRectMake(0, -offset, self.tableView.bounds.size.width, kTableHeaderHeight);
    if (self.tableView.contentOffset.y < -offset) {
        rect.origin.y = self.tableView.contentOffset.y;
        rect.size.height = -self.tableView.contentOffset.y + kTableHeaderOffset;
    }
    self.headerView.frame = rect;

    UIBezierPath *path = [UIBezierPath bezierPath];
    [path moveToPoint:CGPointZero];
    [path addLineToPoint:CGPointMake(rect.size.width, 0)];
    [path addLineToPoint:CGPointMake(rect.size.width, rect.size.height)];
    [path addLineToPoint:CGPointMake(0, rect.size.height-kTableHeaderCutAway)];
    CAShapeLayer *mask = [CAShapeLayer layer];
    mask.fillColor = [[UIColor blackColor] CGColor];
    mask.path = [path CGPath];
    self.headerView.layer.mask = mask;
}

#pragma mark -

- (IBAction)unwndToMainViewController:(UIStoryboardSegue *)sender {
    // Used in Exit Actions
}
@end


text:
package com.robert.httphelper.sample;

// @RestUrl(url = "http://localhost:8080/student")
public interface HttpService {
	// @Get
	public @Json2Object Student getStudent(@QueryParam long dogId);

	// @Post
	public @Json2Status int getStudent(@FormField long dogId);

}


text:
module.exports = function(environment) {
  var ENV = {
    rootURL: '/',
    FEATURES: {
      // Here you can enable experimental features on an ember canary build
      // e.g. 'with-controller': true
    }
  };

  if (environment === 'development') {
    ENV.host = 'localhost:3000';
  }

  if (environment === 'production') {

  }

  return JSON.stringify(ENV); // Set in index.html
};


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

namespace trainers
{
    class Program
    {
        static void Main(string[] args)
        {
            int numberOfParticipants = int.Parse(Console.ReadLine());
            if (numberOfParticipants > 0)
            {

                Dictionary<string, double> dataBase = new Dictionary<string, double>();
                for (int i = 0; i < numberOfParticipants; ++i)
                {
                    int distanceInMiles = int.Parse(Console.ReadLine());
                    double cargoInTons = double.Parse(Console.ReadLine());
                    string name = Console.ReadLine();
                    double earnedMoney = cargoInTons * 1000 * 1.5 - distanceInMiles * 1600 * 0.7 * 2.5;
                    if (!dataBase.ContainsKey(name))
                    {
                        dataBase.Add(name, earnedMoney);
                    }
                    else
                    {
                        dataBase[name] += earnedMoney;
                    }
                }
                var maxValue = dataBase.Values.Max();
                var maxKey = dataBase.FirstOrDefault(x => x.Value == maxValue).Key;
                Console.WriteLine("The {0} Trainers win with ${1:f3}.", maxKey, maxValue);
            }

        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">

    <record model="ir.rule" id="purchase_requisition_comp_rule">
        <field name="name">Purchase Requisition multi-company</field>
        <field name="model_id" ref="model_purchase_requisition"/>
        <field name="global" eval="True"/>
        <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
    </record>

    <record model="ir.rule" id="purchase_requisition_line_comp_rule">
        <field name="name">Purchase requisition Line multi-company</field>
        <field name="model_id" ref="model_purchase_requisition_line"/>
        <field name="global" eval="True"/>
        <field name="domain_force">['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
    </record>

</data>
</openerp>


text:
{{ "" | safeHTML }}

        <svg class="right mt2 top-accent-svg-icon"><use xlink:href="/img/symbol-defs.svg#icon-blog" /></svg>

          Welcome to

Rick Cogley Central

Thanks for stopping by! This is where I write about my experiences with the technology and tech techniques I use, my hobbies & pasttimes, and my life in Japan.

I am the master of my fate: I am the captain of my soul.
—from "Invictus" by W.E. Henley

I've been helping businesses and visitors in Japan since 1987, and am the co-founder and CEO of eSolia Inc, my IT management firm. I like to create, manage, negotiate, drum, run, cycle and pay attention to the details. More oversharing on my bio page, if you're so inclined.

I hope you'll find something informative in my content. <svg><use xlink:href="/img/symbol-defs.svg#icon-dice2" /></svg>

{{ "" | safeHTML }}


text:
package com.linkedin.pinot.core.indexsegment.generator;

import com.google.common.base.Preconditions;
import com.linkedin.pinot.common.data.FieldSpec;
import com.linkedin.pinot.common.data.FieldSpec.FieldType;
import com.linkedin.pinot.common.data.Schema;
import com.linkedin.pinot.common.data.StarTreeIndexSpec;
import com.linkedin.pinot.common.data.TimeFieldSpec;
import com.linkedin.pinot.core.data.readers.CSVRecordReaderConfig;
import com.linkedin.pinot.core.data.readers.FileFormat;
import com.linkedin.pinot.core.data.readers.RecordReaderConfig;
import com.linkedin.pinot.core.indexsegment.utils.AvroUtils;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.apache.commons.lang.StringUtils;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.map.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Configuration properties used in the creation of index segments.
 */
public class SegmentGeneratorConfig {
  private static final Logger LOGGER = LoggerFactory.getLogger(SegmentGeneratorConfig.class);

  private Map<String, String> _customProperties = new HashMap<>();
  private List<String> _invertedIndexCreationColumns = new ArrayList<>();
  private String _dataDir = null;
  private String _inputFilePath = null;
  private FileFormat _format = FileFormat.AVRO;
  private String _outDir = null;
  private boolean _overwrite = false;
  private String _tableName = null;
  private String _segmentName = null;
  private String _segmentNamePostfix = null;
  private String _segmentTimeColumnName = null;
  private TimeUnit _segmentTimeUnit = null;
  private String _segmentCreationTime = null;
  private String _segmentStartTime = null;
  private String _segmentEndTime = null;
  private SegmentVersion _segmentVersion = SegmentVersion.v1;
  private String _schemaFile = null;
  private Schema _schema = null;
  private String _readerConfigFile = null;
  private RecordReaderConfig _readerConfig = null;
  private boolean _enableStarTreeIndex = false;
  private String _starTreeIndexSpecFile = null;
  private StarTreeIndexSpec _starTreeIndexSpec = null;

  public SegmentGeneratorConfig() {
  }

  public SegmentGeneratorConfig(SegmentGeneratorConfig config) {
    Preconditions.checkNotNull(config);
    _customProperties.putAll(config._customProperties);
    _invertedIndexCreationColumns.addAll(config._invertedIndexCreationColumns);
    _dataDir = config._dataDir;
    _inputFilePath = config._inputFilePath;
    _format = config._format;
    _outDir = config._outDir;
    _overwrite = config._overwrite;
    _tableName = config._tableName;
    _segmentName = config._segmentName;
    _segmentNamePostfix = config._segmentNamePostfix;
    _segmentTimeColumnName = config._segmentTimeColumnName;
    _segmentTimeUnit = config._segmentTimeUnit;
    _segmentCreationTime = config._segmentCreationTime;
    _segmentStartTime = config._segmentStartTime;
    _segmentEndTime = config._segmentEndTime;
    _segmentVersion = config._segmentVersion;
    _schemaFile = config._schemaFile;
    _schema = config._schema;
    _readerConfigFile = config._readerConfigFile;
    _readerConfig = config._readerConfig;
    _enableStarTreeIndex = config._enableStarTreeIndex;
    _starTreeIndexSpecFile = config._starTreeIndexSpecFile;
    _starTreeIndexSpec = config._starTreeIndexSpec;
  }

  public SegmentGeneratorConfig(Schema schema) {
    _schema = schema;
  }

  public Map<String, String> getCustomProperties() {
    return _customProperties;
  }

  public void setCustomProperties(Map<String, String> properties) {
    Preconditions.checkNotNull(properties);
    _customProperties.putAll(properties);
  }

  public boolean containsCustomProperty(String key) {
    Preconditions.checkNotNull(key);
    return _customProperties.containsKey(key);
  }

  public List<String> getInvertedIndexCreationColumns() {
    return _invertedIndexCreationColumns;
  }

  public void setInvertedIndexCreationColumns(List<String> indexCreationColumns) {
    Preconditions.checkNotNull(indexCreationColumns);
    _invertedIndexCreationColumns.addAll(indexCreationColumns);
  }

  public void createInvertedIndexForColumn(String column) {
    Preconditions.checkNotNull(column);
    if (_schema != null && _schema.getFieldSpecFor(column) == null) {
      LOGGER.warn("Cannot find column {} in schema, will not create inverted index.", column);
      return;
    }
    if (_schema == null) {
      LOGGER.warn("Schema has not been set, column {} might not exist in schema after all.", column);
    }
    _invertedIndexCreationColumns.add(column);
  }

  public void createInvertedIndexForAllColumns() {
    if (_schema == null) {
      LOGGER.warn("Schema has not been set, will not create inverted index for all columns.");
      return;
    }
    for (FieldSpec spec : _schema.getAllFieldSpecs()) {
      _invertedIndexCreationColumns.add(spec.getName());
    }
  }

  public String getDataDir() {
    return _dataDir;
  }

  public void setDataDir(String dataDir) {
    _dataDir = dataDir;
  }

  public String getInputFilePath() {
    return _inputFilePath;
  }

  public void setInputFilePath(String inputFilePath) {
    Preconditions.checkNotNull(inputFilePath);
    File inputFile = new File(inputFilePath);
    Preconditions.checkState(inputFile.exists(), "Input path {} does not exist.", inputFilePath);
    Preconditions.checkState(inputFile.isFile(), "Input path {} is not a file.", inputFilePath);
    _inputFilePath = inputFile.getAbsolutePath();
  }

  public FileFormat getFormat() {
    return _format;
  }

  public void setFormat(FileFormat format) {
    _format = format;
  }

  public String getOutDir() {
    return _outDir;
  }

  public void setOutDir(String dir) {
    Preconditions.checkNotNull(dir);
    final File outputDir = new File(dir);
    if (outputDir.exists()) {
      Preconditions.checkState(outputDir.isDirectory(), "Path {} is not a directory.", dir);
    } else {
      Preconditions.checkState(outputDir.mkdirs(), "Cannot create output dir: {}", dir);
    }
    _outDir = outputDir.getAbsolutePath();
  }

  public boolean isOverwrite() {
    return _overwrite;
  }

  public void setOverwrite(boolean overwrite) {
    _overwrite = overwrite;
  }

  public String getTableName() {
    return _tableName;
  }

  public void setTableName(String tableName) {
    _tableName = tableName;
  }

  public String getSegmentName() {
    return _segmentName;
  }

  public void setSegmentName(String segmentName) {
    _segmentName = segmentName;
  }

  public String getSegmentNamePostfix() {
    return _segmentNamePostfix;
  }

  public void setSegmentNamePostfix(String postfix) {
    _segmentNamePostfix = postfix;
  }

  public String getTimeColumnName() {
    if (_segmentTimeColumnName != null) {
      return _segmentTimeColumnName;
    }
    return getQualifyingDimensions(FieldType.TIME);
  }

  public void setTimeColumnName(String timeColumnName) {
    _segmentTimeColumnName = timeColumnName;
  }

  public TimeUnit getSegmentTimeUnit() {
    if (_segmentTimeUnit != null) {
      return _segmentTimeUnit;
    } else {
      if (_schema.getTimeFieldSpec() != null) {
        if (_schema.getTimeFieldSpec().getOutgoingGranularitySpec() != null) {
          return _schema.getTimeFieldSpec().getOutgoingGranularitySpec().getTimeType();
        }
        if (_schema.getTimeFieldSpec().getIncomingGranularitySpec() != null) {
          return _schema.getTimeFieldSpec().getIncomingGranularitySpec().getTimeType();
        }
      }
      return TimeUnit.DAYS;
    }
  }

  public void setSegmentTimeUnit(TimeUnit timeUnit) {
    _segmentTimeUnit = timeUnit;
  }

  public String getCreationTime() {
    return _segmentCreationTime;
  }

  public void setCreationTime(String creationTime) {
    _segmentCreationTime = creationTime;
  }

  public String getStartTime() {
    return _segmentStartTime;
  }

  public void setStartTime(String startTime) {
    _segmentStartTime = startTime;
  }

  public String getEndTime() {
    return _segmentEndTime;
  }

  public void setEndTime(String endTime) {
    _segmentEndTime = endTime;
  }

  public SegmentVersion getSegmentVersion() {
    return _segmentVersion;
  }

  public void setSegmentVersion(SegmentVersion segmentVersion) {
    _segmentVersion = segmentVersion;
  }

  public String getSchemaFile() {
    return _schemaFile;
  }

  public void setSchemaFile(String schemaFile) {
    _schemaFile = schemaFile;
  }

  public Schema getSchema() {
    return _schema;
  }

  public void setSchema(Schema schema) {
    Preconditions.checkNotNull(schema);
    _schema = schema;
    if (_invertedIndexCreationColumns != null) {
      Iterator<String> iterator = _invertedIndexCreationColumns.iterator();
      while (iterator.hasNext()) {
        String column = iterator.next();
        if (_schema.getFieldSpecFor(column) == null) {
          LOGGER.warn("Cannot find column {} in schema, will not create inverted index.", column);
          iterator.remove();
        }
      }
    }
  }

  public String getReaderConfigFile() {
    return _readerConfigFile;
  }

  public void setReaderConfigFile(String readerConfigFile) {
    _readerConfigFile = readerConfigFile;
  }

  public RecordReaderConfig getReaderConfig() {
    return _readerConfig;
  }

  public void setReaderConfig(RecordReaderConfig readerConfig) {
    _readerConfig = readerConfig;
  }

  public boolean isEnableStarTreeIndex() {
    return _enableStarTreeIndex;
  }

  public void setEnableStarTreeIndex(boolean enableStarTreeIndex) {
    _enableStarTreeIndex = enableStarTreeIndex;
  }

  public String getStarTreeIndexSpecFile() {
    return _starTreeIndexSpecFile;
  }

  public void setStarTreeIndexSpecFile(String starTreeIndexSpecFile) {
    _starTreeIndexSpecFile = starTreeIndexSpecFile;
  }

  public StarTreeIndexSpec getStarTreeIndexSpec() {
    return _starTreeIndexSpec;
  }

  public void setStarTreeIndexSpec(StarTreeIndexSpec starTreeIndexSpec) {
    _starTreeIndexSpec = starTreeIndexSpec;
  }

  @JsonIgnore
  public String getMetrics() {
    return getQualifyingDimensions(FieldType.METRIC);
  }

  public void loadConfigFiles()
      throws IOException {
    ObjectMapper objectMapper = new ObjectMapper();

    Schema schema;
    if (_schemaFile != null) {
      schema = objectMapper.readValue(new File(_schemaFile), Schema.class);
      setSchema(schema);
    } else if (_format == FileFormat.AVRO) {
      schema = AvroUtils.extractSchemaFromAvro(new File(_inputFilePath));
      setSchema(schema);
    } else {
      throw new RuntimeException("Input format " + _format + " requires schema.");
    }
    setTimeColumnName(schema.getTimeColumnName());
    TimeFieldSpec timeFieldSpec = schema.getTimeFieldSpec();
    if (timeFieldSpec != null) {
      setSegmentTimeUnit(timeFieldSpec.getIncomingGranularitySpec().getTimeType());
    } else {
      setSegmentTimeUnit(TimeUnit.DAYS);
    }

    if (_readerConfigFile != null) {
      setReaderConfig(objectMapper.readValue(new File(_readerConfigFile), CSVRecordReaderConfig.class));
    }

    if (_starTreeIndexSpecFile != null) {
      setStarTreeIndexSpec(objectMapper.readValue(new File(_starTreeIndexSpecFile), StarTreeIndexSpec.class));
    }
  }

  @JsonIgnore
  public String getDimensions() {
    return getQualifyingDimensions(FieldType.DIMENSION);
  }

  /**
   * Returns a comma separated list of qualifying dimension name strings
   * @param type FieldType to filter on
   * @return
   */
  @JsonIgnore
  private String getQualifyingDimensions(FieldType type) {
    List<String> dimensions = new ArrayList<>();

    for (final FieldSpec spec : getSchema().getAllFieldSpecs()) {
      if (spec.getFieldType() == type) {
        dimensions.add(spec.getName());
      }
    }
    Collections.sort(dimensions);
    return StringUtils.join(dimensions, ",");
  }
}


text:
package com.hubspot.singularity;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Collections;
import java.util.Objects;
import java.util.Set;

@Schema(description = "Describes the settings for a particular user")
public class SingularityUserSettings {
  private final Set<String> starredRequestIds;

  @JsonCreator
  public SingularityUserSettings(
    @JsonProperty("starredRequestIds") Set<String> starredRequestIds
  ) {
    this.starredRequestIds =
      starredRequestIds != null ? starredRequestIds : Collections.emptySet();
  }

  public static SingularityUserSettings empty() {
    return new SingularityUserSettings(Collections.<String>emptySet());
  }

  @Schema(description = "The list of starred request ids for a particular user")
  public Set<String> getStarredRequestIds() {
    return starredRequestIds;
  }

  public SingularityUserSettings addStarredRequestIds(Set<String> newStarredRequestIds) {
    starredRequestIds.addAll(newStarredRequestIds);
    return this;
  }

  public SingularityUserSettings deleteStarredRequestIds(
    Set<String> oldStarredRequestIds
  ) {
    starredRequestIds.removeAll(oldStarredRequestIds);
    return this;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SingularityUserSettings that = (SingularityUserSettings) o;
    return Objects.equals(starredRequestIds, that.starredRequestIds);
  }

  @Override
  public int hashCode() {
    return Objects.hash(starredRequestIds);
  }

  @Override
  public String toString() {
    return "SingularityUserSettings{" + "starredRequestIds=" + starredRequestIds + '}';
  }
}


text:
require 'evosynth/evobench/math'
require 'evosynth/evobench/diversity_distance'
require 'evosynth/evobench/diversity_entropy'
require 'evosynth/evobench/diversity_subseq'

require 'evosynth/evobench/run_result'
require 'evosynth/evobench/test_run'
require 'evosynth/evobench/full_factorial_plan'
require 'evosynth/evobench/comparator'
require 'evosynth/evobench/experiment'


text:
<!doctype html>
<meta charset=utf-8>
<title>Test AudioContext.createPeriodicWave when inputs contain Infinite values</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
let ctx;
setup(() => {
  ctx = new OfflineAudioContext({length: 1, sampleRate: 24000});
});
test(() => {
  const real = new Float32Array([0, Infinity]);
  const imag = new Float32Array([0, 1]);
  assert_throws_js(TypeError, () => ctx.createPeriodicWave(real, imag));
}, "createPeriodicWave with Infinity real values should throw");

test(() => {
  const real = new Float32Array([0, 1]);
  const imag = new Float32Array([1, Infinity]);
  assert_throws_js(TypeError, () => ctx.createPeriodicWave(real, imag));
}, "createPeriodicWave with Infinity imag values should throw");
</script>


text:
(function() {
  "use strict";
  var CardViewModule, Dreamhorn, ViewModule, When, _, assert, dom, templates,
    bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
    hasProp = {}.hasOwnProperty;

  _ = require('./util');

  When = require('when');

  dom = require('./dom');

  assert = require('./assert');

  Dreamhorn = require('./dreamhorn');

  ViewModule = require('./mod-view');

  templates = require('./templates');

  CardViewModule = (function(superClass) {
    extend(CardViewModule, superClass);

    function CardViewModule() {
      this.on_choice_click = bind(this.on_choice_click, this);
      this.on_deactivate = bind(this.on_deactivate, this);
      return CardViewModule.__super__.constructor.apply(this, arguments);
    }

    CardViewModule.prototype.defaults = {
      template: '
\n  {{#if header}}\n
\n    {{{ header }}}\n
\n  {{/if}}\n
\n    {{{ content }}}\n
\n  {{#if choices}}\n
\n    {{#each choices}}\n
\n      {{{ text }}}\n
\n    {{/each}}\n
\n  {{/if}}\n
'
    };

    CardViewModule.prototype.events = {
      'click a': 'on_choice_click'
    };

    CardViewModule.prototype.get_card = function() {
      return this.options.card;
    };

    CardViewModule.prototype.get_context = function(ambient_context) {
      var card;
      card = this.get_card();
      _.extend(ambient_context, {
        card: card,
        deck: this.deck
      });
      return When.join(this.will_get_header(card, ambient_context), this.will_get_content(card, ambient_context), this.will_get_choices(card, ambient_context)).then((function(_this) {
        return function(arg) {
          var choices, content, header;
          header = arg[0], content = arg[1], choices = arg[2];
          return _.extend(ambient_context, {
            header: header,
            content: content,
            choices: choices
          });
        };
      })(this));
    };

    CardViewModule.prototype.will_get_header = function(card, context) {
      return card.will_get_header().then((function(_this) {
        return function(raw_header) {
          var header;
          header = templates.render_template(raw_header, context);
          return templates.convert_markdown_to_html(header);
        };
      })(this));
    };

    CardViewModule.prototype.will_get_content = function(card, context) {
      return card.will_get_content().then((function(_this) {
        return function(raw_content) {
          var content;
          content = templates.render_template(raw_content, context);
          return templates.convert_markdown_to_html(content);
        };
      })(this));
    };

    CardViewModule.prototype.will_get_choices = function(card, context) {
      return card.will_get_choices().then((function(_this) {
        return function(choices) {
          var choice, i, len;
          for (i = 0, len = choices.length; i < len; i++) {
            choice = choices[i];
            if (_.isUndefined(choice.text)) {
              choice.text = templates.render_template(choice.raw_text, context);
            }
          }
          return choices;
        };
      })(this));
    };

    CardViewModule.prototype.get_links = function() {
      return dom('a', this.el).map(function(anchor) {
        return dom.wrap(anchor);
      });
    };

    CardViewModule.prototype.will_process_el = function() {
      var card;
      card = this.get_card();
      return this.get_links().each((function(_this) {
        return function($el) {
          var href;
          if (!$el.hasClass('raw') && !$el.data('target')) {
            href = $el.attr('href');
            $el.attr('href', '#');
            return $el.attr('data-target', href);
          }
        };
      })(this));
    };

    CardViewModule.prototype.disable_links = function() {
      return this.get_links().each($el)((function(_this) {
        return function() {
          if (!$el.hasClass('sticky')) {
            return $el.addClass('disabled');
          }
        };
      })(this));
    };

    CardViewModule.prototype.enable_links = function() {
      return this.get_links().each($el)((function(_this) {
        return function() {
          return $el.removeClass('disabled');
        };
      })(this));
    };

    CardViewModule.prototype.setup = function() {
      return this.deck.on('card:deactivate-all', this.on_deactivate);
    };

    CardViewModule.prototype.teardown = function() {
      dom.wrap(this.el).empty().remove();
      return this.deck.off('card:deactivate-all', this.on_deactivate);
    };

    CardViewModule.prototype.on_deactivate = function() {};

    CardViewModule.prototype.on_choice_click = function(evt) {
      var $el, card, target;
      $el = dom.wrap(evt.target);
      if ($el.hasClass('raw')) {
        return;
      }
      evt.preventDefault();
      if ($el.hasClass('disabled')) {
        return;
      }
      card = this.options.card;
      target = $el.data('target');
      return card.will_get_choices_by_target().then((function(_this) {
        return function(choices) {
          var choice;
          choice = choices[target];
          if (_.isUndefined(choice)) {
            choice = target;
          }
          return card.will_choose(choice, evt.target).then(function(result) {
            if (_.isString(result)) {
              return dom.wrap(_this.el).replaceWith(templates.convert_to_markdown(result));
            }
          });
        };
      })(this));
    };

    return CardViewModule;

  })(ViewModule);

  module.exports = CardViewModule;

}).call(this);

//# sourceMappingURL=mod-card-view.js.map


text:
package jp.codic.plugins.netbeans.client;

import jp.codic.plugins.netbeans.client.config.CodicConfig;
import jp.codic.plugins.netbeans.client.impl.CodicClientImpl;

/**
 *
 * @author junichi11
 */
public class CodicClientFactory {

    public static CodicClient create(CodicConfig config) {
        return new CodicClientImpl(config);
    }
}


text:
import {Component, OnInit, OnDestroy} from '@angular/core';
import {Router, ActivatedRoute} from '@angular/router';
import { Subscription } from 'rxjs/Rx';

import {Project} from '../common/project';
import {ProjectService} from '../common/project.service';
import { AuthService } from '../../auth.service';
import { OrganizationService } from '../../organization/common/organization.service';
import { User } from '../../user/common/user';

import { ImageDisplayService } from '../../_services/image-display.service';

@Component({
  selector: 'my-projects',
  templateUrl: 'project-list.component.html',
  styleUrls: ['project-list.component.scss']
})
export class ProjectListComponent implements OnInit, OnDestroy {

  p = 0;
  projects: Project[];
  users: User[];
  selectedProject: Project;
  pagedItems: any[]; // paged items
  pager: any = {}; // pager Object
  projectsSubscription: Subscription;
  userId: number;
  orgId: number;
  from: string;
  userProjectStatus = 'A';

  constructor(

     private projectService: ProjectService,
     private organizationService: OrganizationService,
     private router: Router,
     private auth: AuthService,
     private route: ActivatedRoute,
     private idService: ImageDisplayService
  ) { }

  ngOnInit(): void {
        const id = this.auth.getCurrentUserId();
        this.userId = +id;
        this.route.params.subscribe(
          params => this.from = params['from']);
        this.getProjects();
  }

   private getProjects(): void {
/* TODO the logic to be integrated
        if ((!this.auth.authenticated()) || (this.from === 'opportunities')) {
                 this.projectsSubscription = this.projectService.getProjects().subscribe(
                      res => this.projects = res,
                      error => console.log(error));

    }  else if ((this.auth.isVolunteer()) && (this.from === 'myProjects')) {
                  this.projectsSubscription = this.projectService.getProjectByUser(this.userId, this.userProjectStatus).subscribe(
                       res   => this.projects = JSON.parse(JSON.parse(JSON.stringify(res))._body),
                       error => console.log(error));

    }  else if ((this.auth.isOrganization()) && (this.from === 'myProjects')) {
                  this.organizationService.getUserOrganization(this.userId).subscribe(
                    response =>  {
                             this.users = JSON.parse(JSON.parse(JSON.stringify(response))._body);
                             this.users.forEach(
                               user => {
                                        this.orgId = user.id;
                                        this.projectsSubscription = this.projectService.getProjectByOrg(this.orgId).subscribe(
                                               res => this.projects = JSON.parse(JSON.parse(JSON.stringify(res))._body),
                                               error => console.log(error));
                                      });
                            },
                    error => console.log(error));
                   }
}
*/

     this.projectsSubscription = this.projectService
                                     .getProjects()
                                     .subscribe(
                                     res => {
                                       this.projects = res;
                                       res.forEach((e: Project) => {
                                        this.idService.displayImage(e.id,
                                          this.projectService.retrieveImage.bind(this.projectService))
                                          .subscribe(image => {
                                            e.image = image.url;
                                          });
                                       });
                                     },
                                       error => console.log(error)
                                     );

    /* TODO For logged in user, if they click Opportunities, they should see full list of project
       If they click My Projects, they should see filtered list of projecct for themselves.

    if(!this.auth.authenticated()){
         this.projectsSubscription = this.projectService.getProjects().subscribe(
              res => {
                this.projects = JSON.parse(JSON.parse(JSON.stringify(res))._body);
                this.setPage(1); // initialize to page 1
              },
              error => console.log(error));
        }

    else if (this.auth.isVolunteer()){
      this.projectsSubscription = this.projectService.getProjectByUser(this.userId).subscribe(
           res => {
             this.projects = JSON.parse(JSON.parse(JSON.stringify(res))._body);
             this.setPage(1); // initialize to page 1
           },
           error => console.log(error));
    }
    else if (this.auth.isOrganization()){
      this.projectsSubscription = this.projectService.getProjectByOrg(2).subscribe(
           res => {
             this.projects = JSON.parse(JSON.parse(JSON.stringify(res))._body);
             this.setPage(1); // initialize to page 1
           },
           error => console.log(error))
    }
    */
  }

  getProjectsByKeyword(keyword: string) {
    keyword = keyword.trim();
    if (!keyword) {
      return;
    }
    this.projectService
        .getProjectsByKeyword(keyword)
        .subscribe(
          res => this.projects = res,
          error => console.log(error)
        );
  }

  onSelect(project: Project): void {
    this.selectedProject = project;
    this.router.navigate(['/project/view', project.id]);
  }

  // TODO Don't provide the identity colume value
  add(name: string): void {
    name = name.trim();
    if (!name) {
      return;
    }

    const project = new Project(8, name, 1, 'description', 'logo.png', 'city', 'USA', '55311', 'Teens Give');

    this.projectService
        .add(project)
        .subscribe(
          response => {
            this.getProjects();
            this.router.navigate(['/nonprofits']);
          },
          error => console.log(error)
        );
  }

  delete(project: Project): void {
    this.projectService
        .delete(project.id)
        .subscribe(
          response => { // An error occurred SyntaxError: Unexpected end of JSON input
            this.getProjects();
            this.router.navigate(['/nonprofits']);
          },
          error => console.log(error)
        );
  }

  ngOnDestroy() {
    if (this.projectsSubscription) { this.projectsSubscription.unsubscribe(); }
  }

}


text: docker build . --force-rm -t efaruk/dotnet:vnext


text:
/**
 * Support and FAQ: visit Atmel Support
 */

#ifndef CONF_TEST_H_INCLUDED
#define CONF_TEST_H_INCLUDED

#define CONF_STDIO_USART          EDBG_CDC_MODULE
#define CONF_STDIO_MUX_SETTING    EDBG_CDC_SERCOM_MUX_SETTING
#define CONF_STDIO_PINMUX_PAD0    EDBG_CDC_SERCOM_PINMUX_PAD0
#define CONF_STDIO_PINMUX_PAD1    EDBG_CDC_SERCOM_PINMUX_PAD1
#define CONF_STDIO_PINMUX_PAD2    EDBG_CDC_SERCOM_PINMUX_PAD2
#define CONF_STDIO_PINMUX_PAD3    EDBG_CDC_SERCOM_PINMUX_PAD3
#define CONF_STDIO_BAUDRATE       38400

/* RX USART to test */
#define CONF_RX_USART              EXT1_UART_MODULE
#define CONF_RX_USART_SERCOM_MUX   EXT1_UART_SERCOM_MUX_SETTING
#define CONF_RX_USART_PINMUX_PAD0  EXT1_UART_SERCOM_PINMUX_PAD0
#define CONF_RX_USART_PINMUX_PAD1  EXT1_UART_SERCOM_PINMUX_PAD1
#define CONF_RX_USART_PINMUX_PAD2  EXT1_UART_SERCOM_PINMUX_PAD2
#define CONF_RX_USART_PINMUX_PAD3  EXT1_UART_SERCOM_PINMUX_PAD3

/* TX USART to test
 *
 * There is only one SERCOM for USART on the EXT headers of the rev. 2
 * SAM D21 Xplained Pro. The settings below are a hack to get a second
 * USART via a SERCOM that is not mapped to a RX/TX pin on a header.
 *
 * More specifically, it is the SPI SERCOM on EXT1, with RX mapped to PA05
 * (EXT1_PIN_15 or "SS_0") and TX mapped to PA04 (EXT1_PIN_17 or "MISO").
 */
#define CONF_TX_USART              SERCOM0
#define CONF_TX_USART_SERCOM_MUX   USART_RX_1_TX_0_XCK_1
#define CONF_TX_USART_PINMUX_PAD0  PINMUX_PA04D_SERCOM0_PAD0
#define CONF_TX_USART_PINMUX_PAD1  PINMUX_PA05D_SERCOM0_PAD1
#define CONF_TX_USART_PINMUX_PAD2  PINMUX_PA06D_SERCOM0_PAD2
#define CONF_TX_USART_PINMUX_PAD3  PINMUX_PA07D_SERCOM0_PAD3

#endif /* CONF_TEST_H_INCLUDED */


text:
@interface BVMappingArray : BVMappingObject

@property (nonatomic, strong) NSString * itemClass;
@property (nonatomic, strong) NSString * parentKey;

+ (id)key:(NSString *)key property:(NSString *)property itemClass:(NSString *)itemClass;
+ (id)key:(NSString *)key parentKey:(NSString *)parentKey property:(NSString *)property itemClass:(NSString *)itemClass;

@end


text:
%w{ models controllers helpers views }.each do |dir|
  path = File.join(directory, 'app', dir)
  $LOAD_PATH << path
  ActiveSupport::Dependencies.load_paths << path
  if dir =~ /controllers/
    config.controller_paths << path
  end
  ActiveSupport::Dependencies.load_once_paths.delete(path)
end


text:
<!DOCTYPE html>

	<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
	<title>Fancytree - Example: Filter</title>

	<link href="../src/skin-win8/ui.fancytree.css" rel="stylesheet">

	<link href="../lib/prettify.css" rel="stylesheet">

	<link href="sample.css" rel="stylesheet">

Example: 'filter' extension

			Allow to dimm or hide nodes based on a matching expression.

			Status: production.
			Details:
			ext-filter.

		Skin: <select id="skinswitcher"></select>

		Filter:
		<input name="search" placeholder="Filter..." autocomplete="off">
		<button id="btnResetSearch">×</button>

	<fieldset>
		<legend>Options</legend>

			<input type="checkbox" id="regex">
			Regular expression

			<input type="checkbox" id="hideMode">
			Hide unmatched nodes

			<input type="checkbox" id="autoExpand" checked="checked">
			Auto expand

			<input type="checkbox" id="branchMode">
			Match whole branch

			<input type="checkbox" id="leavesOnly">
			Match end nodes only

			<input type="checkbox" id="fuzzy">
			Fuzzy

			<input type="checkbox" id="hideExpanders">
			hideExpanders

			<input type="checkbox" id="highlight" checked="checked">
			Highlight

			<input type="checkbox" id="nodata" checked="checked">
			nodata

			<input type="checkbox" id="counter" checked="checked">
			Add counter badges

			<input type="checkbox" id="hideExpandedCounter" checked="checked">
			hideExpandedCounter

	</fieldset>

		jquery.fancytree.js project home
		Link to this page
		Example Browser
		View source code


text:
> Register and receive push notifications

# What is this?

This plugin offers support to receive and handle native push notifications with a **single unified API**.

Starting with version `1.9.0`, this plugin will support `CocoaPods` installation of the `Google Cloud Messaging` library. More details are available in the [Installation](docs/INSTALLATION.md#cocoapods) documentation.

- [Reporting Issues](docs/ISSUES.md)
- [Installation](docs/INSTALLATION.md)
- [API reference](docs/API.md)
- [Typescript support](docs/TYPESCRIPT.md)
- [Examples](docs/EXAMPLES.md)
- [Platform support](docs/PLATFORM_SUPPORT.md)
- [Cloud build support (PG Build, IntelXDK)](docs/PHONEGAP_BUILD.md)
- [Push notification payload details](docs/PAYLOAD.md)
- [Contributing](.github/CONTRIBUTING.md)
- [License (MIT)](MIT-LICENSE)

# Do you like tutorial? You get tutorial!

 - [PhoneGap Day US Push Workshop 2016 (using node-gcm)](http://macdonst.github.io/push-workshop/)
 - [PhoneGap Day EU Push Workshop 2016 (using PhoneGap Push)](http://macdonst.github.io/push-workshop-eu/)


text:
<?php

return [
    /*
    |--------------------------------------------------------------------------
    | Authentication Language Lines
    |--------------------------------------------------------------------------
    |
    | The following language lines are used during authentication for various
    | messages that we need to display to the user. You are free to modify
    | these language lines according to your application's requirements.
    |
    */

    'failed'   => 'Estas credenciales no estan registradas.',
    'throttle' => 'Demasiados intentos de login. Intenta nuevamente en :seconds segundos.',
];


text:
#include <aws/dynamodbstreams/model/Shard.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace DynamoDBStreams
{
namespace Model
{

Shard::Shard() :
    m_shardIdHasBeenSet(false),
    m_sequenceNumberRangeHasBeenSet(false),
    m_parentShardIdHasBeenSet(false)
{
}

Shard::Shard(const JsonValue& jsonValue) :
    m_shardIdHasBeenSet(false),
    m_sequenceNumberRangeHasBeenSet(false),
    m_parentShardIdHasBeenSet(false)
{
  *this = jsonValue;
}

Shard& Shard::operator =(const JsonValue& jsonValue)
{
  if(jsonValue.ValueExists("ShardId"))
  {
    m_shardId = jsonValue.GetString("ShardId");

    m_shardIdHasBeenSet = true;
  }

  if(jsonValue.ValueExists("SequenceNumberRange"))
  {
    m_sequenceNumberRange = jsonValue.GetObject("SequenceNumberRange");

    m_sequenceNumberRangeHasBeenSet = true;
  }

  if(jsonValue.ValueExists("ParentShardId"))
  {
    m_parentShardId = jsonValue.GetString("ParentShardId");

    m_parentShardIdHasBeenSet = true;
  }

  return *this;
}

JsonValue Shard::Jsonize() const
{
  JsonValue payload;

  if(m_shardIdHasBeenSet)
  {
   payload.WithString("ShardId", m_shardId);

  }

  if(m_sequenceNumberRangeHasBeenSet)
  {
   payload.WithObject("SequenceNumberRange", m_sequenceNumberRange.Jsonize());

  }

  if(m_parentShardIdHasBeenSet)
  {
   payload.WithString("ParentShardId", m_parentShardId);

  }

  return payload;
}

} // namespace Model
} // namespace DynamoDBStreams
} // namespace Aws


text:
require 'mocha/expectation'

module Mocha # :nodoc:

  class MissingExpectation < Expectation # :nodoc:

    def verify
      msg = error_message(0, 1)
      similar_expectations_list = method_signature.similar_method_signatures.join("\n")
      msg << "\nSimilar expectations:\n#{similar_expectations_list}" unless similar_expectations_list.empty?
      raise ExpectationError.new(msg, backtrace)
    end

  end

end


text:
.. _templates:

Templates
=========

`kaleo` comes with two templates that are minimal snippets that get rendered
from the template tags.

_invite_form.html
-----------------

This is a snippet that renders the form as well as a div to hold the contents
of the response from the form AJAX submission.

_invited.html
-------------

A simple unordered list of people you have invited that is linked to their
profile when they join the site.

_invites_remaining.html
-----------------------

A fragment to display how many invites a particular user has.


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
     <solid android:color="#00ffffff" />
     <padding android:left="6dp"
        android:top="6dp"
        android:right="6dp"
        android:bottom="6dp" />
     <corners android:radius="5dp" />
     <stroke android:width="3dp" android:color="#ffffffff" />
</shape>


text:
package jsc

import (
	"net/http"
	"net/http/httptest"
	"testing"

	"github.com/derekdowling/go-json-spec-handler"
	. "github.com/smartystreets/goconvey/convey"
)

func TestPost(t *testing.T) {

	attrs := map[string]string{
		"foo": "bar",
	}

	api := testAPI()
	server := httptest.NewServer(api)
	defer server.Close()

	baseURL := server.URL

	Convey("Post Tests", t, func() {
		testObject, err := jsh.NewObject("", "tests", attrs)
		So(err, ShouldBeNil)

		_, resp, postErr := Post(baseURL, testObject)
		So(postErr, ShouldBeNil)
		So(resp.StatusCode, ShouldEqual, http.StatusCreated)
	})
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <parent>
    <groupId>com.hotels.styx</groupId>
    <artifactId>styx-components</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>styx-proxy</artifactId>
  <name>Styx - Components - Proxy</name>

  <properties>
    <main.basedir>${project.parent.parent.basedir}</main.basedir>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.hotels.styx</groupId>
      <artifactId>styx-api</artifactId>
    </dependency>

    <dependency>
      <groupId>com.hotels.styx</groupId>
      <artifactId>styx-common</artifactId>
    </dependency>

    <dependency>
      <groupId>com.hotels.styx</groupId>
      <artifactId>styx-client</artifactId>
    </dependency>

    <dependency>
      <groupId>com.hotels.styx</groupId>
      <artifactId>styx-server</artifactId>
    </dependency>

    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-tcnative-boringssl-static</artifactId>
      <classifier>${netty-tcnative.classifier}</classifier>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>

    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>annotations</artifactId>
    </dependency>

    <!--For logback.xml-->
    <dependency>
      <groupId>org.codehaus.janino</groupId>
      <artifactId>janino</artifactId>
    </dependency>

    <dependency>
      <groupId>org.codehaus.janino</groupId>
      <artifactId>commons-compiler</artifactId>
    </dependency>

    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-jvm</artifactId>
    </dependency>

    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-graphite</artifactId>
    </dependency>

    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-healthchecks</artifactId>
    </dependency>

    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-jmx</artifactId>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.dataformat</groupId>
      <artifactId>jackson-dataformat-yaml</artifactId>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.module</groupId>
      <artifactId>jackson-module-kotlin</artifactId>
    </dependency>

    <dependency>
      <artifactId>logback-classic</artifactId>
      <groupId>ch.qos.logback</groupId>
    </dependency>

    <dependency>
      <artifactId>logback-core</artifactId>
      <groupId>ch.qos.logback</groupId>
    </dependency>

    <dependency>
      <artifactId>jul-to-slf4j</artifactId>
      <groupId>org.slf4j</groupId>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
    </dependency>

    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-launcher</artifactId>
      <version>1.6.0</version>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
    </dependency>

    <dependency>
      <groupId>com.hotels.styx</groupId>
      <artifactId>styx-testsupport</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.hotels.styx</groupId>
      <artifactId>styx-api-testsupport</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib-jdk8</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jetbrains.kotlinx</groupId>
      <artifactId>kotlinx-html-jvm</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-test</artifactId>
    </dependency>

    <dependency>
      <groupId>io.mockk</groupId>
      <artifactId>mockk</artifactId>
    </dependency>

    <dependency>
      <groupId>io.kotlintest</groupId>
      <artifactId>kotlintest-runner-junit5</artifactId>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.natpryce/hamkrest -->
    <dependency>
      <groupId>com.natpryce</groupId>
      <artifactId>hamkrest</artifactId>
      <version>1.7.0.0</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.pcollections</groupId>
      <artifactId>pcollections</artifactId>
    </dependency>

    <dependency>
      <groupId>io.projectreactor</groupId>
      <artifactId>reactor-test</artifactId>
    </dependency>

  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>**/*</include>
        </includes>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
      </testResource>
    </testResources>

    <plugins>

      <plugin>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>${build-helper-maven-plugin.version}</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/main/kotlin</source>
                <source>src/main/java</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-test-source</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/test/kotlin</source>
                <source>src/test/java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>

    </plugins>
  </build>

</project>


text:
"""
Module for downloading and caching LORRI images.

"""

__all__ = (
    'update_metadata',
    'load_metadata',
    'check_images',
    'IMG_FORMAT',
    'MissingImage',
    'NoMetadataFile',
)

import calendar
import glob
import json
import os
import re
import time
import urllib2

_THUMBNAIL_URL_FORMAT = ("http://pluto.jhuapl.edu/soc/Pluto-Encounter/"
                         "index.php?page={}")
_IMG_URL_PREFIX = 'http://pluto.jhuapl.edu/soc/Pluto-Encounter/'
_TIMESTAMP_FORMAT = "%Y-%m-%d<br>%H:%M:%S %Z"
_IMG_PATH = "data/images/input/"
IMG_FORMAT = _IMG_PATH + "%Y-%m-%d_%H%M%S_%Z.jpg"
_METADATA_FILE = _IMG_PATH + "metadata.json"

FETCH_SLEEP = 1.0   # Avoid spamming the server!
MAX_FETCHES = 1000  # Should never need more than this number of HTTP
                    # requests.
num_fetches = 0

def _parse_line(line):
    l = []
    d = {}
    for cmd in line.split(";"):
        if cmd.startswith("thumbArr.push"):
            d["url"] = _IMG_URL_PREFIX + cmd.split('"')[1].replace(
                                                            "thumbnails/", "")
        elif cmd.startswith("UTCArr.push"):
            d["timestamp"] = calendar.timegm(time.strptime(cmd.split('"')[1],
                                             _TIMESTAMP_FORMAT))
            d["image_path"] = time.strftime(IMG_FORMAT,
                                            time.gmtime(d["timestamp"]))
        elif cmd.startswith("ExpArr.push"):
            d["exposure"] = cmd.split('"')[1]
            l.append(d)
            d = {}

    return l

class _InvalidPageNum(Exception):
    pass

def _urlopen(url):
    global num_fetches
    num_fetches += 1

    assert num_fetches < MAX_FETCHES, ("Too many HTTP requests ({}) "
                                             "attempted!".format(num_fetches))
    f = urllib2.urlopen(url)
    time.sleep(FETCH_SLEEP)

    return f

def _get_data_for_page(page_num):
    print "Fetching page {}".format(page_num)
    f = _urlopen(_THUMBNAIL_URL_FORMAT.format(page_num))

    for line in f.readlines():
        if line.startswith("StatusArr.push"):
            return _parse_line(line)

    raise _InvalidPageNum

def _metadata_gen():
    page_num = 1
    while True:
        try:
            for d in _get_data_for_page(page_num):
                yield d
        except _InvalidPageNum:
            return

        page_num += 1

class NoMetadataFile(Exception):
    pass

def load_metadata():
    """Load and return the meta-data."""
    if not os.path.exists(_METADATA_FILE):
        raise NoMetadataFile("Try running with -u?")

    with open(_METADATA_FILE, 'r') as f:
        return json.load(f)

def update_metadata():
    """Download any missing meta-data from the New Horizon's website."""

    try:
        old_metadata = load_metadata()
    except NoMetadataFile:
        old_metadata = []

    updates = []
    for d in _metadata_gen():
        if (len(old_metadata) > 0 and
            d['timestamp'] == old_metadata[0]['timestamp']):
            break
        updates.append(d)

    print "Downloaded new metadata for {} files".format(len(updates))

    with open(_METADATA_FILE, 'w') as f:
        json.dump(updates + old_metadata, f)

def _download_image(d):
    print "Downloading {} to {}".format(d['url'], d["image_path"])
    time.sleep(FETCH_SLEEP)
    in_f = _urlopen(d['url'])
    with open(d["image_path"], 'w') as out_f:
        out_f.write(in_f.read())

class MissingImage(Exception):
    pass

def check_images(metadata, download_missing=False):
    """
    Check images for the provided metadata have been downloaded.

    If the `download_missing` argument is False, `MissingImage` is raised for
    any missing images.

    """
    for d in metadata:
        if not os.path.exists(d["image_path"]):
            if download_missing:
                _download_image(d)
            else:
                raise MissingImage("Image {} has not been downloaded".format(
                                                             d["image_path"]))


text:
/**
 * @file random_init.hpp
 * @author Mohan Rajendran
 *
 * Intialization rule for alternating matrix forization (AMF). This simple
 * initialization is performed by assigning a random matrix to W and H.
 */
#ifndef __MLPACK_METHODS_LMF_RANDOM_INIT_HPP
#define __MLPACK_METHODS_LMF_RANDOM_INIT_HPP

#include <mlpack/core.hpp>

namespace mlpack {
namespace amf {

/**
 * This initialization rule for AMF simply fills the W and H matrices with
 * uniform random noise in [0, 1].
 */
class RandomInitialization
{
 public:
  // Empty constructor required for the InitializeRule template
  RandomInitialization() { }

  /**
   * Fill W and H with random uniform noise.
   *
   * @param V Input matrix.
   * @param r Rank of decomposition.
   * @param W W matrix, to be filled with random noise.
   * @param H H matrix, to be filled with random noise.
   */
  template<typename MatType>
  inline static void Initialize(const MatType& V,
                                const size_t r,
                                arma::mat& W,
                                arma::mat& H)
  {
    // Simple implementation (left in the header file due to its simplicity).
    const size_t n = V.n_rows;
    const size_t m = V.n_cols;

    // Intialize to random values.
    W.randu(n, r);
    H.randu(r, m);
  }

  //! Serialize the object (in this case, there is nothing to serialize).
  template<typename Archive>
  void Serialize(Archive& /* ar */, const unsigned int /* version */) { }
};

} // namespace amf
} // namespace mlpack

#endif


text:
module BasicApp

  # An abstract superclass for basic action functionality specific to an
  # application implementation.  Put application specific code here.
  class AppAction < BaseAction
  end

end


text:
<?xml version="1.0" encoding="UTF-8"?>
<folder exportedWithPermissions="true">
    <parent>/organizations/org_template</parent>
    <name>temp</name>
    <label>Temp</label>
    <description>Temp</description>
    <creationDate>2015-05-27T15:05:11.798-07:00</creationDate>
    <updateDate>2015-05-27T15:05:11.798-07:00</updateDate>
    <permission>
        <permissionMask>1</permissionMask>
        <recipient recipientType="role">ROLE_USER</recipient>
    </permission>
</folder>