text:
package sparkjni.utils.cpp.fields;//package org.apache.spark.examples;

import sparkjni.utils.annotations.JNI_field;
import sparkjni.utils.CppSyntax;
import sparkjni.utils.JniUtils;

import java.lang.reflect.Field;

/**
 * Created by Tudor on 7/6/2016.
 */
public class CppRawTypeField extends CppField {
    private boolean isSafe = true;
    boolean isLengthOfArray = false;
    private boolean isMemoryAligned = false;
    private boolean isCriticalArray = false;
    private int memoryAlignment = JniUtils.DEFAULT_MEMORY_ALIGNMENT;

    public CppRawTypeField(Field field) {
        super(field);
        this.type = JniUtils.getCppFieldType(javaField.getType().getSimpleName());
        isSafe = javaField.getAnnotation(JNI_field.class).safe();
        isCriticalArray = javaField.getAnnotation(JNI_field.class).critical();

        parseMemoryAligned();
        parseAnnotationTargetType();
        parseFieldDeclaration();
    }

    private void parseAnnotationTargetType(){
        String annotationTargetType = javaField.getAnnotation(JNI_field.class).nativeTypeTarget();
        if(!annotationTargetType.equals(CppSyntax.NATIVE_TARGET_TYPE_JAVA_DEFINED))
            nativeTargetType = annotationTargetType;
    }

    private void parseMemoryAligned(){
        String annotationOption = javaField.getAnnotation(JNI_field.class).alignment();
        isMemoryAligned = !annotationOption.equals(JniUtils.MEM_UNALIGNED);
        if(isMemoryAligned){
            try {
                memoryAlignment = Integer.parseInt(annotationOption);
            } catch(Exception e){
                isMemoryAligned = false;
            }
        }
    }

    private void parseFieldDeclaration(){
        fieldDeclaration = nativeTargetType == null ? String.format(CppSyntax.FIELD_DECLARATION_STR, type, "%s"+name) :
                String.format(CppSyntax.FIELD_DECLARATION_STR, nativeTargetType, "%s"+name);

        if(javaField.getType().isArray()){
            arrayTypeJniName = JniUtils.getArrayTypeDecl(javaField.getType().getSimpleName());
            String jniArrField = "%s"+name + "Arr";
            fieldDeclaration += String.format(CppSyntax.FIELD_DECLARATION_STR, arrayTypeJniName, jniArrField);
        }
    }

    public CppRawTypeField(String cppType, String fieldName, String ownerClassName) {
        super(cppType, fieldName, ownerClassName);
    }

    public String getTypeOfArrayElement() {
        if(isArray())
            return JniUtils.getArrayElementType(javaField);
        else
            throw new RuntimeException("[ERROR] Field is not an array..");
    }

    public String getArrayTypeName(){
//        if(nativeTargetType == null)
            return arrayTypeJniName;
//        else
//            return nativeTargetType;
    }

    public boolean isPrimitiveArray(){
        return isArray() && JniUtils.isPrimitiveArray(javaField.getType());
    }

    public boolean isTranslatedField(){
        return translatedField;
    }

    public String getJniTypePlaceholderName(){
        if(javaField == null)
            return "Int";
        else return JniUtils.getJniTypePlaceholderName(javaField.getType());
    }

    public boolean isMemoryAligned() {
        return isMemoryAligned;
    }

    public int getMemoryAlignment() {
        return memoryAlignment;
    }

    public boolean isSafe() {
        return isSafe;
    }

    public CppRawTypeField getArrayLengthFieldCppFieldObj(){
        return new CppRawTypeField("int", javaField.getName()+"_length", ownerClassName);
    }

    public boolean isCriticalArray() {
        return isCriticalArray;
    }

    public void setCriticalArray(boolean criticalArray) {
        isCriticalArray = criticalArray;
    }
}


text:
/***
* Inferno Engine v4 2015-2017
* Written by Tomasz "Rex Dex" Jonarski
*
* [# filter: view\handler #]
***/

#pragma once

#include "renderingView.h"

namespace rendering
{
    namespace scene
    {

        ///---

        enum class PackedLightType : Uint8
        {
            Directional = 0,
            Point = 1,
            Spot = 2,
        };

        ///---

        /// collected light data
        struct PackedLightData
        {
            Uint32 Type; // 0-ambient, 1-directional, 2-point, 3-spot
            Uint32 Padding0;
            Uint32 Padding1;
            Uint32 Padding2;
            base::math::Vector4 Position; // x y z -
            base::math::Vector4 Direction; // x y z -
            base::math::Vector4 Size; // radius 1/radius radius^2 1/radius^2
            base::math::Vector4 Color; // r g b -
        };

        ///---

        struct PackedLight
        {
            PackedLightType m_type = PackedLightType::Point;

            base::math::Matrix m_localToWorld; // position + projection matrix
            base::math::Vector4 m_direction;
            base::math::Vector4 m_color;
            base::math::Vector4 m_shape; // shape parameters
        };

        ///---

        /// view handler that handles the lighting
        class RendererViewHandler_Lighting : public IRendererViewHandler
        {
            RTTI_DECLARE_VIRTUAL_CLASS(RendererViewHandler_Lighting, IRendererViewHandler);

        public:
            RendererViewHandler_Lighting();
            virtual ~RendererViewHandler_Lighting();

            virtual const Bool initialize(const IRendererView& view) override final;
            virtual void earlyPrepare(IRendererView& view) override final;
            virtual void prepare(IRendererView& view, microp::MicroOpWriter& cmd) override final;
            virtual void configure(const IRendererView& view, const IRendererPass* pass, microp::MicroOpWriter& cmd) const override final;

            // get the global lighting direction
            FORCEINLINE const base::math::Vector3& getGlobalLightingDirection() const { return m_globalLightDirection; }

            //--

            // collect a light for this scene, returns index of the light in the light data structures (usually passed to the cluster handler)
            const Uint16 collectLight(const PackedLight& lightData);

        private:
            // global lighting params
            base::math::Vector3 m_globalLightDirection;
            base::math::Vector4 m_globalLightColor;
            base::math::Vector4 m_globalAmbientColor;
            Bool m_hasGlobalAmbient;
            Bool m_hasGlobalLight;

            // lights visible in this view
            base::InplaceArray<PackedLight, 128> m_lights;
            BufferReadOnlyView m_lightsDataPacked;

            //--

            // pack lights data
            BufferReadOnlyView packLightsData(microp::MicroOpWriter& cmd) const;
        };

        ///---

    } // scene
} // rendering

redpajama_set_name: RedPajamaGithub


text:
using System;

namespace MarcelJoachimKloubert.Execution.Workflows
{
    /// <summary>
    /// A workflow based on a delegate.
    /// </summary>
    public class DelegateWorkflow : SimpleWorkflowBase
    {
        #region Fields (1)

        private readonly WorkflowAction _START_ACTION;

        #endregion Fields (1)

        #region Constructors (1)

        /// <summary>
        /// Initializes a new instance of the <see cref="DelegateWorkflow" /> class.
        /// </summary>
        /// <param name="startAction">The start action.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="startAction" /> is <see langword="null" />.
        /// </exception>
        public DelegateWorkflow(WorkflowAction startAction)
        {
            if (startAction == null)
            {
                throw new ArgumentNullException("startAction");
            }

            _START_ACTION = startAction;
        }

        #endregion Constructors (1)

        #region Methods (1)

        /// <inheriteddoc />
        protected sealed override void ExecuteFirstStep(IWorkflowExecutionContext ctx)
        {
            _START_ACTION(ctx);
        }

        #endregion Methods (1)
    }
}


text:
package domains;

import java.util.ArrayList;

/**
 * Created by Administrator on 2014/12/28.
 */
public class ShoppingChart {
    private ArrayList<Item> items = new ArrayList<Item>();

    public void add(Item item) {
        this.items.add(item);
    }

    public ArrayList<Item> getItems() {
        return items;
    }

    public void setItems(ArrayList<Item> list) {
        items = list;
    }
}


text:
namespace utils {
namespace rnd {

int             irand();
int32_t         i32rand();
int64_t         i64rand();
double          drand_closed(); // In closed    interval [0,1]
double          drand_open();   // In open      interval (0,1)
double          drand_hopen();  // In half-open interval [0,1)

// Call to set the seed
void init(unsigned seed = 0x8944C407); // Arbitrary number
// Call at the end of the program
void shutdown();

} // End of the rnd namespace
} // End of the utils namespace

#endif // UTILS_RAND_H


text:
class Class
    def publicize_methods(*methods)
        saved_private_instance_methods = methods.empty? ? self.private_instance_methods : methods

        self.class_eval { public(*saved_private_instance_methods) }
        yield
        self.class_eval { private(*saved_private_instance_methods) }
    end
end


text:
package org.ogf.schemas.nsi._2013._12.connection.types;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
 *                 Type definition for the reserveConfirmed message. A Provider NSA
 *                 sends this positive reserveRequest response to the Requester NSA
 *                 that issued the original request message.
 *
 *                 Elements:
 *
 *                 connectionId - The Provider NSA assigned connectionId for this
 *                 reservation. This value will be unique within the context
 *                 of the Provider NSA.
 *
 *                 globalReservationId - An optional global reservation id that can be
 *                 used to correlate individual related service reservations through
 *                 the network. This must be populated with a Universally Unique
 *                 Identifier (UUID) URN as per ITU-T Rec. X.667 | ISO/IEC 9834-8:2005
 *                 and IETF RFC 4122.
 *
 *                 description - An optional description for the service reservation.
 *
 *                 criteria - A set of versioned reservation criteria information.
 *
 *
 *
Java class for ReserveConfirmedType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="ReserveConfirmedType">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="connectionId" type="{http://schemas.ogf.org/nsi/2013/12/framework/types}ConnectionIdType"/>
 *         <element name="globalReservationId" type="{http://schemas.ogf.org/nsi/2013/12/connection/types}GlobalReservationIdType" minOccurs="0"/>
 *         <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
 *         <element name="criteria" type="{http://schemas.ogf.org/nsi/2013/12/connection/types}ReservationConfirmCriteriaType"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ReserveConfirmedType", propOrder = {
    "connectionId",
    "globalReservationId",
    "description",
    "criteria"
})
public class ReserveConfirmedType {

    @XmlElement(required = true)
    protected String connectionId;
    protected String globalReservationId;
    protected String description;
    @XmlElement(required = true)
    protected ReservationConfirmCriteriaType criteria;

    /**
     * Gets the value of the connectionId property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getConnectionId() {
        return connectionId;
    }

    /**
     * Sets the value of the connectionId property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setConnectionId(String value) {
        this.connectionId = value;
    }

    /**
     * Gets the value of the globalReservationId property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getGlobalReservationId() {
        return globalReservationId;
    }

    /**
     * Sets the value of the globalReservationId property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setGlobalReservationId(String value) {
        this.globalReservationId = value;
    }

    /**
     * Gets the value of the description property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets the value of the description property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDescription(String value) {
        this.description = value;
    }

    /**
     * Gets the value of the criteria property.
     *
     * @return
     *     possible object is
     *     {@link ReservationConfirmCriteriaType }
     *
     */
    public ReservationConfirmCriteriaType getCriteria() {
        return criteria;
    }

    /**
     * Sets the value of the criteria property.
     *
     * @param value
     *     allowed object is
     *     {@link ReservationConfirmCriteriaType }
     *
     */
    public void setCriteria(ReservationConfirmCriteriaType value) {
        this.criteria = value;
    }

}


text:
namespace HouseOfTheFuture.IoTHub.Protocol
{
    public static class TickTack
    {
        public const string ReceiveDeviceInfoCommand = "TT_SEND_DEVICE_INFO";
        public const string SendDeviceInfoCommand = "TT_DEVICE_IDENTIFIER";
    }
}


text:
#ifndef __demo_state_h__
#define __demo_state_h__

#include "../common.h"
#include <igl/Camera.h>
#include <igl/anttweakbar/ReAntTweakBar.h>

struct DemoState
{
    igl::anttweakbar::ReTwBar rebar;
	igl::Camera m_down_camera;
	bool left_mouse_motion = false;
	bool right_mouse_motion = false;
	int m_down_x, m_down_y;
	Eigen::VectorXi sel;
};

#endif /* __demo_state_h__ */


text:
package com.ustcinfo.mobile.util;

import java.util.ArrayList;

import android.app.ActivityManager;
import android.app.ActivityManager.RunningServiceInfo;
import android.content.Context;

public class AndroidSysUtil {
	public static boolean serviceIsRunning(Context context, String serviceName) {
		// 获取ActivityManager
		ActivityManager myManager = (ActivityManager) context
				.getSystemService(Context.ACTIVITY_SERVICE);
		ArrayList<RunningServiceInfo> runningService = (ArrayList<RunningServiceInfo>) myManager
				.getRunningServices(30);
		// 获取系统当前的所有Service,最多可以获取30个
		for (int i = 0; i < runningService.size(); i++) {
			// 遍历当前运行的Service,判断是否存在指定的Service
			if (runningService.get(i).service.getClassName().toString()
					.equals(serviceName)) {
				return true;
			}

		}
		return false;
	}
}


text:
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
	[ActionCategory(ActionCategory.Physics)]
	[Tooltip("Adds a force to a Game Object. Use Vector3 variable and/or Float variables for each axis.")]
	public class AddForce : ComponentAction<Rigidbody>
	{
		[RequiredField]
		[CheckForComponent(typeof(Rigidbody))]
        [Tooltip("The GameObject to apply the force to.")]
		public FsmOwnerDefault gameObject;

		[UIHint(UIHint.Variable)]
		[Tooltip("Optionally apply the force at a position on the object. This will also add some torque. The position is often returned from MousePick or GetCollisionInfo actions.")]
		public FsmVector3 atPosition;

		[UIHint(UIHint.Variable)]
		[Tooltip("A Vector3 force to add. Optionally override any axis with the X, Y, Z parameters.")]
		public FsmVector3 vector;

        [Tooltip("Force along the X axis. To leave unchanged, set to 'None'.")]
		public FsmFloat x;

        [Tooltip("Force along the Y axis. To leave unchanged, set to 'None'.")]
		public FsmFloat y;

        [Tooltip("Force along the Z axis. To leave unchanged, set to 'None'.")]
		public FsmFloat z;

        [Tooltip("Apply the force in world or local space.")]
		public Space space;

        [Tooltip("The type of force to apply. See Unity Physics docs.")]
        public ForceMode forceMode;

        [Tooltip("Repeat every frame while the state is active.")]
        public bool everyFrame;

		public override void Reset()
		{
			gameObject = null;
			atPosition = new FsmVector3 { UseVariable = true };
			vector = null;
			// default axis to variable dropdown with None selected.
			x = new FsmFloat { UseVariable = true };
			y = new FsmFloat { UseVariable = true };
			z = new FsmFloat { UseVariable = true };
			space = Space.World;
			forceMode = ForceMode.Force;
			everyFrame = false;
		}

        public override void OnPreprocess()
        {
            Fsm.HandleFixedUpdate = true;
        }

		public override void OnEnter()
		{
			DoAddForce();

			if (!everyFrame)
			{
				Finish();
			}
		}

		public override void OnFixedUpdate()
		{
			DoAddForce();
		}

		void DoAddForce()
		{
			var go = Fsm.GetOwnerDefaultTarget(gameObject);
			if (!UpdateCache(go))
			{
				return;
			}

			var force = vector.IsNone ? new Vector3() : vector.Value;

			// override any axis

			if (!x.IsNone) force.x = x.Value;
			if (!y.IsNone) force.y = y.Value;
			if (!z.IsNone) force.z = z.Value;

			// apply force

			if (space == Space.World)
			{
				if (!atPosition.IsNone)
				{
					rigidbody.AddForceAtPosition(force, atPosition.Value, forceMode);
				}
				else
				{
					rigidbody.AddForce(force, forceMode);
				}
			}
			else
			{
				rigidbody.AddRelativeForce(force,forceMode);
			}
		}
	}
}


text:
quote: true
category: "iOS"
img: "iOS.jpg"
tags: [iOS, Quote]
title: Pebble Smart-watch, Xcode 5 and OS X Mavericks
---

After stumbling a few times while setting up my development environment  for the Pebble Smart-watch, I decided to write a step-by-step guide on the topic to save time and sanity to other developers coding their first application for Pebble using Xcode 5 under OS X Mavericks and iOS.

## Things You'll Will Need In Your iOS Device

0. Update to iOS 7 just to be sure.

1. **Don't bother downloading the Pebble app from the App Store (v1.x)**. You need to [submit a form](https://docs.google.com/a/pulse-dev.net/forms/d/14r3MHPsdH5ha-BCkfuquQuAKuQSEJLmxm--XXpBA8mg/viewform) to receive an .ipa with the 2.x version.

2. After receiving the .ipa file with the Pebble app v2.x, install it.
	Open your device's *Settings* app, select *Pebble* and enable 'Developer Mode'.

3. Return to the home screen and open the Pebble app.
	Select 'Developer Connection' and enable it.

## Things You Need In Your Pebble Smart-Watch

0. Be sure you have opened the iOS Pebble app v2.x at least once.

1. Put your Pebble in Recovery Mode: Press the Back button, the Up button and the Select button for at least 30 seconds until you see 'Loading…' on the screen.

	Don't let that 'Pebble' screen fool you! Keep pressing those buttons until you can read 'Loading...'.

2. Re-pair your Pebble with your iOS device's bluetooth.

3. If your device suggests that an upgrade is available, refuse the upgrade.

4. Open one of the following links from your iOS device, your phone will start upgrading your Pebble:

	If your serial number starts with a number, [download Pebble Firmware 2.0-BETA2 for ev2_4.](https://developer.getpebble.com/2/download/Pebble-2.0-BETA2-ev2_4.pbz).

	If your serial number starts with the letter *Q*, [download Pebble Firmware 2.0-BETA2 for v1_5](https://developer.getpebble.com/2/download/Pebble-2.0-BETA2-v1_5.pbz).

## Things You Need In Your Computer

1. Install the Xcode Command Line Tools by typing the following command in the Terminal:

	```
	xcode-select --install
	```

	If you have problems installing them via this command (*'Can't install the software because it is not currently available from the Software Update server'* error), download the installer manually from the [Developer Center](https://developer.apple.com/downloads/index.action).

	**Don't skip this step!** The Command Line Tools are not installed by default in Xcode 5.

2. Download the latest version of the Pebble SDK. Go and grab it from the *[Getting Started Guide](https://developer.getpebble.com/2/getting-started/)*, there is big orange button that reads 'PEBBLE SDK'.

3. Create a directory for all Pebble tools:

	```
	mkdir ~/pebble-dev/
	```

4. Unzip the Pebble SDK inside that directory. You should end with something like:  ```~/pebble-dev/PebbleSDK-2.0-BETA2```.

5. Add the Pebble tool to your command line:

	```
	echo 'export PATH=~/pebble-dev/PebbleSDK-2.0-BETA2/bin:$PATH' >> ~/.bash_profile
	```

6. Reload your shell configuration to make it available immediately

	```
	source ~/.bash_profile
	```

7. Download the toolchain for OS X ([arm-cs-tools-macos-universal-static.tar.gz](https://assets.getpebble.com.s3-website-us-east-1.amazonaws.com/sdk/arm-cs-tools-macos-universal-static.tar.gz)).

8. Extract that compressed file inside ```~/pebble-dev/PebbleSDK-2.0-BETA2```.  Be sure you end with something like: ```~/pebble-dev/PebbleSDK-2.0-BETA2/arm-cs-tools```.

9. Install the Python packet manager, pip:

	```
	sudo easy_install pip
	```

10. And all the Python dependencies used by Pebble:

	```
	 pip install --user -r ~/pebble-dev/PebbleSDK-2.0-BETA2/requirements.txt
	 ```

	 If this last step fails, it is probably because you don't have the Xcode Command Line Tools installed.

## Things You Need In Your Xcode Project

1. Include ```PebbleKit.framework``` and  ```PebbleVendor.framework``` in your Xcode project.

2. Link ```ExternalAccessory.framework```, ```libz.dylib```, ```CoreBluetooth.framework```, ```CoreMotion.framework```, ```CFNetwork.framework``` and ```MessageUI.framework```.

3. Add ```-ObjC``` to *Other Linker Flags* of your target's Build Settings.

4. In your Info.plist file, add the value ```com.getpebble.public``` to the *Supported external accessory protocols* array.

5. Also in the Info.plist file,  add the value *App communicates with an accessory* to the *Required background modes* array.

6. In the Build Settings of your project, change Architecture's value from  ```$(ARCHS_STANDARD_INCLUDING_64_BIT)``` to ```$(ARCHS_STANDARD)```.

	Otherwise, you will bump with the following error:

	````
	Undefined symbols for architecture x86_64:
	  "_OBJC_CLASS_$_PBPebbleCentral", referenced from:
    	  objc-class-ref in NPViewController.o
	ld: symbol(s) not found for architecture x86_64
	```

After all those steps, your watch, Mac, iPhone and Xcode should be ready to start coding.

Did somebody said '[Hello World](https://developer.getpebble.com/2/getting-started/hello-world/)'?

Happy coding!


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

package org.flowable.engine.impl.persistence.entity;

/**
 * @author Tijs Rademakers
 */
public interface MessageEventSubscriptionEntity extends EventSubscriptionEntity {

    String EVENT_TYPE = "message";

}


text:
namespace v8_crdtp {
// =============================================================================
// FindByFirst - Efficient retrieval from a sorted vector.
// =============================================================================
TEST(FindByFirst, SpanBySpan) {
  std::vector<std::pair<span<uint8_t>, span<uint8_t>>> sorted_span_by_span = {
      {SpanFrom("foo1"), SpanFrom("bar1")},
      {SpanFrom("foo2"), SpanFrom("bar2")},
      {SpanFrom("foo3"), SpanFrom("bar3")},
  };
  {
    auto result = FindByFirst(sorted_span_by_span, SpanFrom("foo1"),
                              SpanFrom("not_found"));
    EXPECT_EQ("bar1", std::string(result.begin(), result.end()));
  }
  {
    auto result = FindByFirst(sorted_span_by_span, SpanFrom("foo3"),
                              SpanFrom("not_found"));
    EXPECT_EQ("bar3", std::string(result.begin(), result.end()));
  }
  {
    auto result = FindByFirst(sorted_span_by_span, SpanFrom("baz"),
                              SpanFrom("not_found"));
    EXPECT_EQ("not_found", std::string(result.begin(), result.end()));
  }
}

namespace {
class TestObject {
 public:
  explicit TestObject(const std::string& message) : message_(message) {}

  const std::string& message() const { return message_; }

 private:
  std::string message_;
};
}  // namespace

TEST(FindByFirst, ObjectBySpan) {
  std::vector<std::pair<span<uint8_t>, std::unique_ptr<TestObject>>>
      sorted_object_by_span;
  sorted_object_by_span.push_back(
      std::make_pair(SpanFrom("foo1"), std::make_unique<TestObject>("bar1")));
  sorted_object_by_span.push_back(
      std::make_pair(SpanFrom("foo2"), std::make_unique<TestObject>("bar2")));
  sorted_object_by_span.push_back(
      std::make_pair(SpanFrom("foo3"), std::make_unique<TestObject>("bar3")));
  {
    TestObject* result =
        FindByFirst<TestObject>(sorted_object_by_span, SpanFrom("foo1"));
    ASSERT_TRUE(result);
    ASSERT_EQ("bar1", result->message());
  }
  {
    TestObject* result =
        FindByFirst<TestObject>(sorted_object_by_span, SpanFrom("foo3"));
    ASSERT_TRUE(result);
    ASSERT_EQ("bar3", result->message());
  }
  {
    TestObject* result =
        FindByFirst<TestObject>(sorted_object_by_span, SpanFrom("baz"));
    ASSERT_FALSE(result);
  }
}
}  // namespace v8_crdtp


text:
angular.module('myApp').service('ConfigService', ['$http', '$q', 'baseApi', function ($http, $q, baseApi) {

	var ConfigService = {};

	var resourceUrl = '/api/admin-config';

	function buildBaucisQuery(opts) {
		var q ='?';
		var prefix='';
		if (opts.page === null && opts.blockSize === null) {
			opts.page = opts.page || 1;
			opts.pageSize = opts.pageSize || 20;
		}
		else {
			opts.page = opts.page || 1;
			opts.pageSize = opts.pageSize || 20;

			var skip =  (opts.page-1)*opts.pageSize;
			if(skip > 0) {
				q += prefix + 'skip=' + skip;
				prefix='&';
			}
			q += prefix + '&limit=' + opts.pageSize;
			prefix='&';
		}
		if (opts.sort) {
			q += prefix + 'sort=' + encodeURIComponent(opts.sort) + '';
			prefix='&';
		}
		if (opts.criteria) {
			q += prefix + 'conditions={' + encodeURIComponent(opts.criteria) + '}';
			prefix='&';
		}
		if (opts.select) {
			q += prefix + 'select={' + encodeURIComponent(opts.select) + '}';
			prefix='&';
		}
		if (opts.populate) {
			q += prefix + 'populate={' + encodeURIComponent(opts.populate) + '}';
			prefix='&';
		}
		if (opts.hint) {
			q += prefix + 'hint={' + encodeURIComponent(opts.hint) + '}';
			prefix='&';
		}
		if (opts.count === true) {
			q += prefix + 'count=true';
			prefix='&';
		}
		if (opts.searchText && opts.searchText!=='') {
			//Do a custom like query
			var likeQuery = buildLikeQuery(opts.searchText);
			q += prefix + 'conditions={' + encodeURIComponent(likeQuery) + '}';
			prefix='&';
		}
		return q;
	}

	function buildLikeQuery(searchText) {
		var res='"$or":[';
		//add string fields
		var clauses = [];
		var clause = null;

		//Process each property
		clause = addStringLike('key', searchText);
		if (clause !== null) {
			clauses.push(clause);
		}
		clause = addStringLike('value', searchText);
		if (clause !== null) {
			clauses.push(clause);
		}

		var prefix='';
		clauses.forEach(function(item) {
			res+=prefix+item;
			prefix=',';
		});
		res += ']';

		if (clauses.length>0) {
			return res;
		}

		return '';
	}

	function addStringLike(property, searchValue) {
		if (searchValue === null) {
			return null;
		}
		return '{"'+ property +'":{"$regex":"' + escapeForRegex(searchValue) + '","$options":"i"}}';
	}
	function escapeForRegex(candidate) {
		//escape values for regex
		return candidate;
	}
	function buildMongooseQuery(opts) {
		var q = '';
		if (opts.searchText && opts.searchText!=='') {
			var likeQuery = buildMoongooseLikeQuery(opts.searchText);
			q = '{' + likeQuery + '}';
		}
		return q;
	}

	function buildMoongooseLikeQuery(searchText) {
		var res='"$or":[';
		//add string fields
		var clauses = [];
		var clause = null;

		//Process each property
		clause = addStringLike('key', searchText);
		if (clause !== null) {
			clauses.push(clause);
		}
		clause = addStringLike('value', searchText);
		if (clause !== null) {
			clauses.push(clause);
		}

		var prefix='';
		clauses.forEach(function(item) {
			res+=prefix+item;
			prefix=',';
		});
		res += ']';

		if (clauses.length>0) {
			return res;
		}
		return '';
	}

	//-- Public API -----

	ConfigService.getCount =  function (opts) {
		opts = opts || {};
		opts.count = true;
		var q = buildBaucisQuery(opts);
		return $http.get(resourceUrl + q);
	};

	ConfigService.getList = function (opts) {
		opts = opts || {};
		var q = buildBaucisQuery(opts);
		return $http.get(resourceUrl + q);
	};

	ConfigService.getListAsCsv = function () {
		return $http({
			method: 'GET',
			url: resourceUrl,
			headers: {'Accept': 'text/csv'}
		});
	};

	ConfigService.getFileAsCsv = function () {
		return $http({
			method: 'GET',
			url: resourceUrl + '/download/csv/',
			headers: {'Accept': 'text/csv'}
		});
	};
	ConfigService.getFileAsXml = function () {
		return $http({
			method: 'GET',
			url: resourceUrl + '/download/xml/',
			headers: {'Accept': 'text/xml'}
		});
	};
	ConfigService.getFileAsXlsx = function () {
		return $http({
			method: 'GET',
			url: resourceUrl + '/download/xlsx/',
			headers: {'Accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'},
			responseType: 'blob'
		});
	};

	ConfigService.getToEdit = function (id) {
		return $http.get(resourceUrl + '/' + id );
	};

	ConfigService.get = function (link) {
		return $http.get(link);
	};

	ConfigService.add = function (item) {
		return $http.post(resourceUrl, JSON.stringify(item));
	};

	ConfigService.update = function (item) {
		return $http.put(resourceUrl + '/' + item._id, JSON.stringify(item));
	};

	ConfigService.delete = function (id) {
		return $http.delete(resourceUrl + '/' + id);
	};

	ConfigService.deleteMany = function (ids) {
		var msg = {
			'className' : 'admin_config',
			'ids'		: ids
		};
		return $http.post(baseApi + '/delete', JSON.stringify(msg));
	};

	ConfigService.deleteAll = function (opts) {
		var msg = {
			'className' : 'admin_config',
			'conditions' : buildMongooseQuery(opts)
		};
		return $http.post(baseApi + '/deleteAll', JSON.stringify(msg));
	};

	ConfigService.setKey = function (key, value) {
		var item = {
			'key': key,
			'value': value
		};
		return $http.post('/api/setConfigKey', JSON.stringify(item));
	};

	ConfigService.getByKey = function (configKey) {
		var q = buildBaucisQuery({
			'searchText': configKey
		});
		return $http.get(resourceUrl + q);
	};

	return ConfigService;

}]);


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Uses of Class gov.nih.nci.cabig.caaers.accesscontrol.dataproviders.FilteredDataLoader
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
gov.nih.nci.cabig.caaers.accesscontrol.dataproviders.FilteredDataLoader

Packages that use FilteredDataLoader

gov.nih.nci.cabig.caaers.accesscontrol.aspects

gov.nih.nci.cabig.caaers.web.listener

Uses of FilteredDataLoader in gov.nih.nci.cabig.caaers.accesscontrol.aspects

Methods in gov.nih.nci.cabig.caaers.accesscontrol.aspects with parameters of type FilteredDataLoader

 void
RefreshIndexAspect.setFilteredDataLoader(FilteredDataLoader filteredDataLoader)

Uses of FilteredDataLoader in gov.nih.nci.cabig.caaers.web.listener

Methods in gov.nih.nci.cabig.caaers.web.listener with parameters of type FilteredDataLoader

 void
AbstractEventListener.setFilteredDataLoader(FilteredDataLoader filteredDataLoader)

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes


text:
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="Date-Revision-yyyymmdd" content="20180114" />
    <meta http-equiv="Content-Language" content="en" />
    <title>Play! 2.x Provider for Play! 2.1.x – Project Dependencies</title>
    <link rel="stylesheet" href="./css/apache-maven-fluido-1.6.min.css" />
    <link rel="stylesheet" href="./css/site.css" />
    <link rel="stylesheet" href="./css/print.css" media="print" />

<link rel="stylesheet" href="./css/site.css" type="text/css" />

Play! 2.x Provider for Play! 2.1.x

Last Published: 2018-01-14|

Version: 1.0.0-rc2

Parent Project

Play! 2.x Providers

Overview

Introduction

Usage

JavaDocs

Project Documentation

Project Information

CI Management

Dependencies

Dependency Convergence

Dependency Information

Distribution Management

Issue Management

Licenses

Plugin Management

Plugins

Team

Source Code Management

Summary

Project Reports

Project Dependencies

compile

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

GroupId
ArtifactId
Version
Type
Licenses

com.google.javascript
closure-compiler
rr2079.1
jar
The Apache Software License, Version 2.0

org.avaje.ebeanorm
avaje-ebeanorm-agent
3.1.1
jar
The Apache Software License, Version 2.0

org.scala-lang
scala-compiler
2.9.2
jar
BSD-like

play
routes-compiler_2.9.2
2.1.5
jar
-

play
sbt-link
2.1.5
jar
-

play
templates-compiler_2.9.2
2.1.5
jar
-

rhino
js
1.7R2
jar
Mozilla Public License

provided

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

GroupId
ArtifactId
Version
Type
Licenses

com.google.code.play2-maven-plugin
play2-provider-api
1.0.0-rc2
jar
The Apache Software License, Version 2.0

org.codehaus.plexus
plexus-component-annotations
1.6
jar
The Apache Software License, Version 2.0

Project Transitive Dependencies

The following is a list of transitive dependencies for this project. Transitive dependencies are the dependencies of the project dependencies.

compile

The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:

GroupId
ArtifactId
Version
Type
Licenses

com.github.jsuereth.scala-arm
scala-arm_2.9.1
1.1
jar
-

com.github.scala-incubator.io
scala-io-core_2.9.2
0.4.1
jar
Scala License

com.github.scala-incubator.io
scala-io-file_2.9.2
0.4.1
jar
Scala License

com.google.guava
guava
10.0.1
jar
The Apache Software License, Version 2.0

org.javassist
javassist
3.16.1-GA
jar
MPL 1.1-LGPL 2.1-Apache License 2.0

org.scala-lang
scala-library
2.9.2
jar
BSD-like

Project Dependency Graph

Dependency Tree

com.google.code.play2-maven-plugin:play2-provider-play21:jar:1.0.0-rc2

Play! 2.x Provider for Play! 2.1.x

Description: Play! 2.x Provider for Play! 2.1.x

URL: https://play2-maven-plugin.github.io/play2-maven-plugin/1.0.0-rc2/play2-providers/play2-provider-play21/

Project Licenses: The Apache Software License, Version 2.0

com.google.javascript:closure-compiler:jar:rr2079.1 (compile)

Closure Compiler

Description: Closure Compiler is a JavaScript optimizing compiler. It parses your
    JavaScript, analyzes it, removes dead code and rewrites and minimizes
    what's left. It also checks syntax, variable references, and types, and
    warns about common JavaScript pitfalls. It is used in many of Google's
    JavaScript apps, including Gmail, Google Web Search, Google Maps, and
    Google Docs.

URL: http://code.google.com/p/closure-compiler/

Project Licenses: The Apache Software License, Version 2.0

com.google.guava:guava:jar:10.0.1 (compile)

Guava: Google Core Libraries for Java

Description: Guava is a suite of core and expanded libraries that include
    utility classes, google's collections, io classes, and much
    much more.

    This project is a complete packaging of all the Guava libraries
    into a single jar.  Individual portions of Guava can be used
    by downloading the appropriate module and its dependencies.

    Guava (complete) has only one code dependency - javax.annotation,
    per the JSR-305 spec.

URL: http://code.google.com/p/guava-libraries/guava

Project Licenses: The Apache Software License, Version 2.0

org.avaje.ebeanorm:avaje-ebeanorm-agent:jar:3.1.1 (compile)

avaje-ebeanorm-agent

Description: This is for Java artifacts. It primarily is designed around testing.

URL: http://www.avaje.org

Project Licenses: The Apache Software License, Version 2.0

play:routes-compiler_2.9.2:jar:2.1.5 (compile)

Routes-Compiler

Description: Routes-Compiler

Project Licenses: No licenses are defined for this project.

com.github.scala-incubator.io:scala-io-file_2.9.2:jar:0.4.1 (compile)

scala-io-file

Description: scala-io-file

URL: http://jesseeichar.github.com/scala-io-doc/index.html

Project Licenses: Scala License

com.github.scala-incubator.io:scala-io-core_2.9.2:jar:0.4.1 (compile)

scala-io-core

Description: scala-io-core

URL: http://jesseeichar.github.com/scala-io-doc/index.html

Project Licenses: Scala License

com.github.jsuereth.scala-arm:scala-arm_2.9.1:jar:1.1 (compile)

scala-arm

Description: scala-arm

Project Licenses: No licenses are defined for this project.

play:templates-compiler_2.9.2:jar:2.1.5 (compile)

Templates-Compiler

Description: Templates-Compiler

Project Licenses: No licenses are defined for this project.

org.scala-lang:scala-compiler:jar:2.9.2 (compile)

Scala Compiler

Description: Compiler for the Scala Programming Language

URL: http://www.scala-lang.org/

Project Licenses: BSD-like

org.scala-lang:scala-library:jar:2.9.2 (compile)

Scala Library

Description: Standard library for the Scala Programming Language

URL: http://www.scala-lang.org/

Project Licenses: BSD-like

play:sbt-link:jar:2.1.5 (compile)

SBT-link

Description: SBT-link

Project Licenses: No licenses are defined for this project.

org.javassist:javassist:jar:3.16.1-GA (compile)

Javassist

Description: Javassist (JAVA programming ASSISTant) makes Java bytecode manipulation
    simple.  It is a class library for editing bytecodes in Java.

URL: http://www.javassist.org/

Project Licenses: MPL 1.1, LGPL 2.1, Apache License 2.0

rhino:js:jar:1.7R2 (compile)

Rhino

Description: Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically embedded into Java applications to provide scripting to end users.

URL: http://www.mozilla.org/rhino/

Project Licenses: Mozilla Public License

com.google.code.play2-maven-plugin:play2-provider-api:jar:1.0.0-rc2 (provided)

Play! 2.x Provider API

Description: Play! 2.x Provider API

URL: https://play2-maven-plugin.github.io/play2-maven-plugin/1.0.0-rc2/play2-provider-api/

Project Licenses: The Apache Software License, Version 2.0

org.codehaus.plexus:plexus-component-annotations:jar:1.6 (provided)

Plexus :: Component Annotations

Description: Plexus Component "Java 5" Annotations, to describe plexus components properties in java sources with
    standard annotations instead of javadoc annotations.

URL: http://plexus.codehaus.org/plexus-containers/plexus-component-annotations/

Project Licenses: The Apache Software License, Version 2.0

Licenses

Unknown: Routes-Compiler, SBT-link, Templates-Compiler, scala-arm

Apache License 2.0: Javassist

BSD-like: Scala Compiler, Scala Library

Scala License: scala-io-core, scala-io-file

LGPL 2.1: Javassist

MPL 1.1: Javassist

Mozilla Public License: Rhino

The Apache Software License, Version 2.0: Closure Compiler, Guava: Google Core Libraries for Java, Play! 2.x Provider API, Play! 2.x Provider for Play! 2.1.x, Plexus :: Component Annotations, avaje-ebeanorm-agent

Dependency File Details

Filename
Size
Entries
Classes
Packages
Java Version
Debug Information

scala-arm_2.9.1-1.1.jar
68.7 kB
59
57
1
1.5
Yes

scala-io-core_2.9.2-0.4.1.jar
1.4 MB
917
907
9
1.5
Yes

scala-io-file_2.9.2-0.4.1.jar
389.9 kB
268
262
4
1.5
Yes

play2-provider-api-1.0.0-rc2.jar
17.5 kB
36
23
1
1.6
Yes

guava-10.0.1.jar
1.5 MB
1185
1164
10
1.5
Yes

closure-compiler-rr2079.1.jar
3.4 MB
1859
1778
32
1.6
Yes

avaje-ebeanorm-agent-3.1.1.jar
182.6 kB
90
73
4
1.6
Yes

plexus-component-annotations-1.6.jar
4.3 kB
15
3
1
1.5
No

javassist-3.16.1-GA.jar
659.3 kB
400
376
17
1.5
Yes

scala-compiler-2.9.2.jar
11.4 MB
7218
7105
44
1.5
Yes

scala-library-2.9.2.jar
8.9 MB
5433
5370
59
1.5
Yes

routes-compiler_2.9.2-2.1.5.jar
428.7 kB
363
360
1
1.5
Yes

sbt-link-2.1.5.jar
8.5 kB
13
8
3
1.6
Yes

templates-compiler_2.9.2-2.1.5.jar
327.8 kB
273
270
1
1.5
Yes

js-1.7R2.jar
871.3 kB
344
317
17
1.5
Yes

Total
Size
Entries
Classes
Packages
Java Version
Debug Information

15
29.6 MB
18473
18073
204
1.6
14

compile: 13
compile: 29.6 MB
compile: 18422
compile: 18047
compile: 202
-
compile: 13

provided: 2
provided: 21.8 kB
provided: 51
provided: 26
provided: 2
-
provided: 1

Dependency Repository Locations

Repo ID
URL
Release
Snapshot
Blacklisted

central
https://repo.maven.apache.org/maven2
Yes
No
No

ScalaToolsMaven2Repository
http://scala-tools.org/repo-releases/
Yes
Yes
No

typesafe
https://dl.bintray.com/typesafe/maven-releases/
Yes
No
No

junitinterfacerepo
https://repository.jboss.org/nexus/content/repositories/scala-tools-releases/
Yes
Yes
Yes

sonatype-nexus-snapshots
https://oss.sonatype.org/content/repositories/snapshots
No
Yes
No

TypesafeRepository
http://repo.typesafe.com/typesafe/releases/
Yes
Yes
No

Repository locations for each of the Dependencies.

Artifact
central
ScalaToolsMaven2Repository
typesafe
sonatype-nexus-snapshots
TypesafeRepository

com.github.jsuereth.scala-arm:scala-arm_2.9.1:jar:1.1

-
-
-
-

com.github.scala-incubator.io:scala-io-core_2.9.2:jar:0.4.1

-
-
-
-

com.github.scala-incubator.io:scala-io-file_2.9.2:jar:0.4.1

-
-
-
-

com.google.code.play2-maven-plugin:play2-provider-api:jar:1.0.0-rc2

-
-
-
-

com.google.guava:guava:jar:10.0.1

-
-
-
-

com.google.javascript:closure-compiler:jar:rr2079.1

-
-
-
-

org.avaje.ebeanorm:avaje-ebeanorm-agent:jar:3.1.1

-
-
-
-

org.codehaus.plexus:plexus-component-annotations:jar:1.6

-
-
-
-

org.javassist:javassist:jar:3.16.1-GA

-
-
-
-

org.scala-lang:scala-compiler:jar:2.9.2

-
-
-
-

org.scala-lang:scala-library:jar:2.9.2

-
-
-
-

play:routes-compiler_2.9.2:jar:2.1.5
-
-

-

play:sbt-link:jar:2.1.5
-
-

-

play:templates-compiler_2.9.2:jar:2.1.5
-
-

-

rhino:js:jar:1.7R2

-
-
-
-

Total
central
ScalaToolsMaven2Repository
typesafe
sonatype-nexus-snapshots
TypesafeRepository

15 (compile: 13, provided: 2)
12
0
3
0
3

Copyright ©2013–2018.
All rights reserved.


text:
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create, update: update });

var tilesprite;
var cursors;

function preload() {

    // game.load.image('starfield', 'assets/misc/starfield.jpg');
    game.load.image('starfield', 'assets/tstest.png');

}

function create() {

    tilesprite = game.add.tileSprite(0, 0, 800, 600, 'starfield');

    cursors = game.input.keyboard.createCursorKeys();

}

function update() {

    if (cursors.left.isDown)
    {
        tilesprite.tilePosition.x += 8;
    }
    else if (cursors.right.isDown)
    {
        tilesprite.tilePosition.x -= 8;
    }

    if (cursors.up.isDown)
    {
        tilesprite.tilePosition.y += 8;
    }
    else if (cursors.down.isDown)
    {
        tilesprite.tilePosition.y -= 8;
    }

}


text:
<?php
namespace Tarth\Task;

use Tarth\Params;
use Tarth\Task\AbstractTask;
use \Curl\Curl;

class EmailTask extends AbstractTask {
    public $to = '';
    public $subject = '';
    public $message = '';

    protected function _processTask() {
        return mail($this->to, $this->subject, $this->message);
    }

    public function key() {
        return md5("{$this->to}|{$this->subject}|{$this->message}");
    }
}


text:
package de.plushnikov.constructor;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;

import java.util.Timer;

@Data
@NoArgsConstructor
public class DataAndOtherConstructor {
  int test1;
  int test2;

  public void test() {
    DataAndOtherConstructor test = new DataAndOtherConstructor();
    System.out.println(test);
    DataAndAllArgsConstructor test2 = new DataAndAllArgsConstructor(1, 2);
    System.out.println(test2);
    DataAndRequiredArgsConstructor test3 = new DataAndRequiredArgsConstructor();
    System.out.println(test3);

    SomeClass someClass = new SomeClass();
  }

  @Data
  @AllArgsConstructor
  class DataAndAllArgsConstructor {
    int test1;
    int test2;
  }

  @Data
  @RequiredArgsConstructor
  class DataAndRequiredArgsConstructor {
    int test1;
    int test2;
  }

  public static void main(String[] args) {
    new DataAndOtherConstructor().test();
  }

  @EqualsAndHashCode(callSuper = false)
  @Data
  class SomeClass extends Timer {
    final int x;

    SomeClass() {
      super();
      x = 3;
    }
  }
}


text:
.. Copyright (c) 2015-2018, Exa Analytics Development Team
.. Distributed under the terms of the Apache License 2.0

#####################################
Atom Two
#####################################
.. automodule:: exatomic.core.two
    :members:


text:
package org.intellij.lang.regexp.psi;

import org.jetbrains.annotations.NotNull;

/**
 * Represents an atom with a quantifier, such as ?, *, + or {min,max}
 */
public interface RegExpClosure extends RegExpAtom {
    @NotNull
    RegExpQuantifier getQuantifier();

    @NotNull
    RegExpAtom getAtom();
}


text:
package com.google.security.zynamics.binnavi.Gui.GraphWindows.Actions;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

import com.google.common.base.Preconditions;
import com.google.security.zynamics.binnavi.Gui.GraphWindows.CGraphWindow;
import com.google.security.zynamics.binnavi.Gui.GraphWindows.Implementations.CGraphFunctions;
import com.google.security.zynamics.binnavi.disassembly.views.INaviView;
import com.google.security.zynamics.binnavi.disassembly.views.IViewContainer;

/**
 * Action class for creating data flow graphs.
 */
public final class CActionShowDataflow extends AbstractAction {
  /**
   * Used for serialization.
   */
  private static final long serialVersionUID = -3300675538631018022L;

  /**
   * Window where the new view is shown.
   */
  private final CGraphWindow m_parent;

  /**
   * Container where the new view is created.
   */
  private final IViewContainer m_container;

  /**
   * The view whose data flow graph is created.
   */
  private final INaviView m_view;

  /**
   * Creates a new action object.
   *
   * @param parent Window where the new view is shown.
   * @param container Container where the new view is created.
   * @param view The view whose data flow graph is created.
   */
  public CActionShowDataflow(
      final CGraphWindow parent, final IViewContainer container, final INaviView view) {
    super("Show Dataflow graph");

    m_parent = Preconditions.checkNotNull(parent, "IE01647: Parent can not be null");
    m_container =
        Preconditions.checkNotNull(container, "IE01649: Container argument can not be null");
    m_view = Preconditions.checkNotNull(view, "IE02298: View argument can not be null");
  }

  @Override
  public void actionPerformed(final ActionEvent event) {
    CGraphFunctions.showDataflowGraph(m_parent, m_container, m_view);
  }
}


text:
package com.microsoftopentechnologies.tooling.msservices.model;

public class Office365Service {
    private String id;
    private String name;

    @Override
    public String toString() {
        return name;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }

        if (obj == null) {
            return false;
        }

        if (getClass() != obj.getClass()) {
            return false;
        }

        Office365Service other = (Office365Service) obj;

        if (id == null) {
            if (other.id != null) {
                return false;
            }
        } else if (!id.equals(other.id)) {
            return false;
        }

        if (name == null) {
            if (other.name != null) {
                return false;
            }
        } else if (!name.equals(other.name)) {
            return false;
        }

        return true;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

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


text:
<!DOCTYPE html>

    <title>Mobile Leave Calendar v0.0.1</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
    <link rel="stylesheet" type="text/css" href="app/styles/login.css">

      <form id="login" class="form-signin" action="#">

Please sign in

        <input id="username" type="text" class="input-block-level" placeholder="SESA ID">
        <input id="password" type="password" class="input-block-level" placeholder="Password">

          <input type="checkbox" value="remember-me"> Remember me

        <button class="btn btn-large btn-primary" type="submit">Sign in</button>
      </form>

        <input id="name" type="text" class="input-block-level" placeholder="SESA ID">
        <input id="word" type="text" class="input-block-level" placeholder="Password">
        <button id="MD5Button"class="btn btn-large btn-primary" type="button">General MD5 String</button>


text:
/*global defineSuite*/
defineSuite([
        'Core/DistanceDisplayConditionGeometryInstanceAttribute',
        'Core/ComponentDatatype',
        'Core/DistanceDisplayCondition'
    ], function(
        DistanceDisplayConditionGeometryInstanceAttribute,
        ComponentDatatype,
        DistanceDisplayCondition) {
    'use strict';

    it('constructor', function() {
        var attribute = new DistanceDisplayConditionGeometryInstanceAttribute(10.0, 100.0);
        expect(attribute.componentDatatype).toEqual(ComponentDatatype.FLOAT);
        expect(attribute.componentsPerAttribute).toEqual(2);
        expect(attribute.normalize).toEqual(false);

        var value = new Float32Array([10.0, 100.0]);
        expect(attribute.value).toEqual(value);
    });

    it('constructor throws with far > near', function() {
        expect(function() {
            return new DistanceDisplayConditionGeometryInstanceAttribute(100.0, 10.0);
        }).toThrowDeveloperError();
    });

    it('fromDistanceDisplayCondition', function() {
        var dc = new DistanceDisplayCondition(10.0, 100.0);
        var attribute = DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(dc);
        expect(attribute.componentDatatype).toEqual(ComponentDatatype.FLOAT);
        expect(attribute.componentsPerAttribute).toEqual(2);
        expect(attribute.normalize).toEqual(false);

        var value = new Float32Array([dc.near, dc.far]);
        expect(attribute.value).toEqual(value);
    });

    it('fromDistanceDisplayCondition throws without distanceDisplayCondition', function() {
        expect(function() {
            DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition();
        }).toThrowDeveloperError();
    });

    it('fromDistanceDisplayCondition throws with far >= near', function() {
        expect(function() {
            DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(new DistanceDisplayCondition(100.0, 10.0));
        }).toThrowDeveloperError();
    });

    it('toValue', function() {
        var dc = new DistanceDisplayCondition(10.0, 200.0);
        var expectedResult = new Float32Array([dc.near, dc.far]);
        expect(DistanceDisplayConditionGeometryInstanceAttribute.toValue(dc)).toEqual(expectedResult);
    });

    it('toValue works with result parameter', function() {
        var dc = new DistanceDisplayCondition(10.0, 200.0);
        var expectedResult = new Float32Array([dc.near, dc.far]);
        var result = new Float32Array(2);
        var returnedResult = DistanceDisplayConditionGeometryInstanceAttribute.toValue(dc, result);
        expect(returnedResult).toBe(result);
        expect(returnedResult).toEqual(expectedResult);
    });

    it('toValue throws without a distanceDisplayCondition', function() {
        expect(function() {
            DistanceDisplayConditionGeometryInstanceAttribute.toValue();
        }).toThrowDeveloperError();
    });
});


text:
package com.action.shejizhichan.chapter18;

/**
 * @Description TODO
 * @Author wuyunfeng
 * @Date 2020-05-25 22:49
 * @Version 1.0
 */
public class BlockEnemy implements IStrategy {
    @Override
    public void operate() {
        System.out.println("孙夫人断后,挡住追兵");
    }
}


text:
title: Procedural reflections
date: 17:34 07/04/2014
taxonomy:
    category: blog
    tag: [tips, shading]
---
For reflective materials something is needed to be reflected. Common and nice looking method is to use an HDR image. However, sometimes a simple gradient node can look nice in reflections. You can sort of 'paint' your reflections with it in real-time, which is cool :)

![Gradient node reflections][2]

  [2]: http://i.stack.imgur.com/CR1Nw.jpg


text:
package edu.java.cosc111.samples;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;

/**
 *
 * @author RLVillacarlos
 */
public class JHex extends javax.swing.JFrame {
    private static final int BUFF_SIZE = 2 << 20 ;
    private static final int DEFAULT_WIDTH = 16;
    private static final int ASCII_DOT = 46;
    private static final int ASCII_SPACE = 32;
    private static final char[] hexArray = "0123456789ABCDEF".toCharArray();

    private int curViewWidth = DEFAULT_WIDTH;
    private int curColHex  = 0;
    private int curColChar = 0;
    /**
     * Creates new form JHex
     */
    public JHex() {
        initComponents();
        init();
    }

    private void init(){
        jtaASCII.setColumns(curViewWidth);
        jtaHex.setColumns(curViewWidth);
        jtaASCII.setText("");
        jtaHex.setText("");
        curColHex  = 0;
        curColChar = 0;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jSplitPane1 = new javax.swing.JSplitPane();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtaASCII = new javax.swing.JTextArea();
        jPanel3 = new javax.swing.JPanel();
        filler5 = new javax.swing.Box.Filler(new java.awt.Dimension(5, 0), new java.awt.Dimension(5, 0), new java.awt.Dimension(5, 32767));
        jLabel1 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jtaHex = new javax.swing.JTextArea();
        jPanel4 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        filler6 = new javax.swing.Box.Filler(new java.awt.Dimension(5, 0), new java.awt.Dimension(5, 0), new java.awt.Dimension(5, 32767));
        filler3 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 5), new java.awt.Dimension(0, 5), new java.awt.Dimension(32767, 5));
        filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 32767));
        filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 0), new java.awt.Dimension(10, 32767));
        filler4 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 5), new java.awt.Dimension(0, 5), new java.awt.Dimension(32767, 5));
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("JHex");

        jSplitPane1.setDividerLocation(200);

        jPanel1.setLayout(new java.awt.BorderLayout());

        jtaASCII.setEditable(false);
        jtaASCII.setColumns(20);
        jtaASCII.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
        jtaASCII.setRows(5);
        jScrollPane1.setViewportView(jtaASCII);

        jPanel1.add(jScrollPane1, java.awt.BorderLayout.CENTER);

        jPanel3.setLayout(new java.awt.BorderLayout());
        jPanel3.add(filler5, java.awt.BorderLayout.WEST);

        jLabel1.setText("ASCII View");
        jPanel3.add(jLabel1, java.awt.BorderLayout.CENTER);

        jPanel1.add(jPanel3, java.awt.BorderLayout.PAGE_START);

        jSplitPane1.setLeftComponent(jPanel1);

        jPanel2.setLayout(new java.awt.BorderLayout());

        jtaHex.setEditable(false);
        jtaHex.setColumns(20);
        jtaHex.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
        jtaHex.setRows(5);
        jScrollPane2.setViewportView(jtaHex);

        jPanel2.add(jScrollPane2, java.awt.BorderLayout.CENTER);

        jPanel4.setLayout(new java.awt.BorderLayout());

        jLabel2.setText("Hex View");
        jPanel4.add(jLabel2, java.awt.BorderLayout.CENTER);
        jPanel4.add(filler6, java.awt.BorderLayout.WEST);

        jPanel2.add(jPanel4, java.awt.BorderLayout.PAGE_START);

        jSplitPane1.setRightComponent(jPanel2);

        getContentPane().add(jSplitPane1, java.awt.BorderLayout.CENTER);
        getContentPane().add(filler3, java.awt.BorderLayout.PAGE_START);
        getContentPane().add(filler1, java.awt.BorderLayout.WEST);
        getContentPane().add(filler2, java.awt.BorderLayout.EAST);
        getContentPane().add(filler4, java.awt.BorderLayout.PAGE_END);

        jMenu1.setText("File");

        jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem1.setText("Open");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuBar1.add(jMenu1);

        setJMenuBar(jMenuBar1);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        openFile();
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(JHex.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(JHex.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(JHex.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(JHex.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new JHex().setVisible(true);
            }
        });
    }

    private void openFile(){
        JFileChooser jFileChoose = new JFileChooser();

        if(jFileChoose.showOpenDialog(null)==JFileChooser.APPROVE_OPTION){
            Path p = jFileChoose.getSelectedFile().toPath();
            this.setTitle("JHex - Reading " + p.toString());
            try(InputStream in = new BufferedInputStream(
                                Files.newInputStream(p,StandardOpenOption.READ),BUFF_SIZE)){

                byte[] b = new byte[BUFF_SIZE];
                int readBytes = 0;
                init();
                while((readBytes = in.read(b))!=-1){
                    if(readBytes<b.length){
                        byte[] b_ = new byte[readBytes];
                        System.arraycopy(b, 0, b_, 0, readBytes);
                        addCharacterValues(b_);
                        addHexValues(b_);
                    }else{
                        addCharacterValues(b);
                        addHexValues(b);
                    }
                }
                jtaASCII.setCaretPosition(0);
                jtaHex.setCaretPosition(0);
                this.setTitle("JHex - " + p.toString());
            }catch(IOException ex){
                JOptionPane.showMessageDialog(this, ex.getMessage(),
                    "Error Reading File",JOptionPane.ERROR_MESSAGE);
            }
        }

    }

    private void addHexValues(byte[] dataBytes){
        StringBuilder s = new StringBuilder(dataBytes.length*3);

        for(int i =0;i<dataBytes.length;i++){
            s.append(byteToHex(dataBytes[i]));
            curColHex = (curColHex + 1) % curViewWidth;
            if(curColHex==0){
                s.append("\n");
            }else{
                s.append(" ");
            }
        }
        jtaHex.append(s.toString());
    }

    //Modified version of http://stackoverflow.com/a/9855338/4042112
    public static String byteToHex(byte b) {
        char[] hexChars = new char[2];
        int v = b & 0xFF;
        hexChars[0] = hexArray[v >>> 4];
        hexChars[1] = hexArray[v & 0x0F];
        return new String(hexChars);
    }

    private void addCharacterValues(byte[] dataBytes) throws UnsupportedEncodingException{
        StringBuilder s = new StringBuilder(dataBytes.length);
        byte[] bytes = new byte[dataBytes.length];

        for(int i =0;i<dataBytes.length;i++){
            int n = (int)dataBytes[i] & 0xFF;

            if(n <ASCII_SPACE){ //If character is non-printable
                bytes[i] = ASCII_DOT;
            }else{
                bytes[i] = dataBytes[i];
            }
        }
        String toAppend = new String(bytes,StandardCharsets.US_ASCII);
        int pos = 0;
        int len = toAppend.length();
        while(pos<len){
            int lenToRead = curViewWidth - curColChar;
            int posEnd = pos + lenToRead;

            if(posEnd>len){
                lenToRead = toAppend.length() - pos;
                posEnd = pos + lenToRead;
            }

            s.append(toAppend.substring(pos, posEnd));
            curColChar = (curColChar + lenToRead)  % curViewWidth;
            pos += lenToRead;
            if(curColChar==0){
                s.append("\n");
            }
        }
        jtaASCII.append(s.toString());
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.Box.Filler filler1;
    private javax.swing.Box.Filler filler2;
    private javax.swing.Box.Filler filler3;
    private javax.swing.Box.Filler filler4;
    private javax.swing.Box.Filler filler5;
    private javax.swing.Box.Filler filler6;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JTextArea jtaASCII;
    private javax.swing.JTextArea jtaHex;
    // End of variables declaration//GEN-END:variables
}


text:
package com.springcryptoutils.core.keystore;

public class InitializationException extends Exception {

    public InitializationException(String message) {
	super(message);
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<LearningStandards>
  <LearningStandardItem xml:lang="en" RefID="BE3EA41F879A428d98EEA966A0703B99">
    <RefURI>http://corestandards.org/ELA-Literacy/L/2/1/d/</RefURI>
    <StandardHierarchyLevel>
      <number>6</number>
      <description>Component</description>
    </StandardHierarchyLevel>
    <StatementCodes>
      <StatementCode>CCSS.ELA-Literacy.L.2.1d</StatementCode>
    </StatementCodes>
    <Statements>
      <Statement>Form and use the past tense of frequently occurring irregular verbs (e.g., sat, hid, told).</Statement>
    </Statements>
    <GradeLevels>
      <GradeLevel>02</GradeLevel>
    </GradeLevels>
    <LearningStandardDocumentRefId>0FAC40650F514a459951A657F942B845</LearningStandardDocumentRefId>
    <RelatedLearningStandardItems>
      <LearningStandardItemRefId RelationshipType="childOf">3BC8F46071754afc8A9871C559FE7B8A</LearningStandardItemRefId>
    </RelatedLearningStandardItems>
  </LearningStandardItem>
</LearningStandards>


text:
require 'tilt'
require 'active_support'

module Librato
  module Services
    module Helpers
      module AlertHelpers
        def self.sample_alert_payload
          {
            :alert => {
              :id => 12345,
              :name => ""
            },
            :metric => {
              :name => "my_sample_alert",
              :type => "gauge"
            },
            :measurement => { :value => 2345.9, :source => "r3.acme.com" },
            :trigger_time => 1321311840
          }.with_indifferent_access
        end

        def self.sample_alert_payload_multiple_measurements
          {
            :alert => {
              :id => 12345
            },
            :metric => {
              :name => "my_sample_alert",
              :type => "gauge"
            },
            :measurements => [
              { :value => 2345.9, :source => "r3.acme.com" },
              { :value => 123,    :source => "r2.acme.com" }
            ],
            :trigger_time => 1321311840
          }.with_indifferent_access
        end

        #TODO rename when it's no longer "new"
        def self.sample_new_alert_payload
          ::HashWithIndifferentAccess.new({
            user_id: 1,
            incident_key: "foo",
            alert: {id: 123,
                    name: "Some alert name",
                    version: 2,
                    description: "Verbose alert explanation",
                    runbook_url: "http://runbooks.com/howtodoit"},
            auth: {email:"foo@example.com", annotations_token:"lol"},
            service_type: "campfire",
            event_type: "alert",
            triggered_by_user_test: false,
            trigger_time: 12321123,
            conditions: [{type: "above", threshold: 10, id: 1}],
            violations: {
              "foo.bar" => [{
                metric: "metric.name", value: 100, recorded_at: 1389391083,
                condition_violated: 1
              }]
            }
          })
        end

        def get_measurements(body)
          measurements = body['measurements'] || []
          measurements << body['measurement']
          measurements.compact
        end

        def erb(template, target_binding)
          ERB.new(template, nil, '-').result(target_binding)
        end

        def h(text)
          ERB::Util.h(text)
        end

        def test_alert_message()
          "This is a test alert notification, no action is required."
        end

        def unindent(string)
          indentation = string[/\A\s*/]
          string.strip.gsub(/^#{indentation}/, "") + "\n"
        end

        def pluralize(count, singular, plural = nil)
          "#{count || 0} " + ((count == 1 || count =~ /^1(\.0+)?$/) ? singular : (plural || singular.pluralize))
        end

        def metric_link(type, name)
          "https://#{ENV['METRICS_APP_URL']}/metrics/#{name}"
        end

        def alert_link(id)
          "https://#{ENV['METRICS_APP_URL']}/alerts/#{id}"
        end

        # TODO: fix for specific alert id?
        def payload_link(payload)
          if payload[:alert][:version] == 2
            "https://#{ENV['METRICS_APP_URL']}/metrics/"
          else
            metric_link(payload[:metric][:type], payload[:metric][:name])
          end
        end
      end
    end
  end
end


text:
Discord Bot
The .env contains the Discord Token
Built following the tutorial by Shayne Hartford in https://www.youtube.com/watch?v=AqqfnhuqVLc

Ruu is Waifu


text:
package io.hekate.spring.boot.cluster;

import io.hekate.HekateTestProps;
import io.hekate.cluster.internal.DefaultClusterService;
import io.hekate.cluster.seed.SeedNodeProvider;
import io.hekate.cluster.seed.SeedNodeProviderGroup;
import io.hekate.cluster.seed.consul.ConsulSeedNodeProvider;
import io.hekate.spring.boot.EnableHekate;
import io.hekate.spring.boot.HekateAutoConfigurerTestBase;
import io.hekate.spring.boot.HekateTestConfigBase;
import java.net.URI;
import org.junit.Assume;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

public class HekateConsulSeedNodeProviderConfigurerTest extends HekateAutoConfigurerTestBase {
    @EnableHekate
    @EnableAutoConfiguration
    public static class ConsulEnabledConfig {
        // No-op.
    }

    @EnableAutoConfiguration
    public static class ConsulDisabledConfig extends HekateTestConfigBase {
        // No-op.
    }

    private URI consulUrl;

    @BeforeClass
    public static void mayBeDisableTest() {
        Assume.assumeTrue(HekateTestProps.is("CONSUL_ENABLED"));
    }

    @Before
    public void setUp() throws Exception {
        consulUrl = new URI(HekateTestProps.get("CONSUL_URL"));
    }

    @Test
    public void testEnabled() throws Exception {
        ignoreGhostThreads();

        registerAndRefresh(
            new String[]{
                "hekate.cluster.seed.consul.enable=true",
                "hekate.cluster.seed.consul.url=" + consulUrl,
                "hekate.cluster.seed.consul.base-path=///////hekate-test"
            },
            HekateConsulSeedNodeProviderConfigurerTest.ConsulEnabledConfig.class
        );

        SeedNodeProviderGroup group = (SeedNodeProviderGroup)getNode().get(DefaultClusterService.class).seedNodeProvider();

        assertEquals(1, group.allProviders().size());
        assertTrue(group.allProviders().get(0) instanceof ConsulSeedNodeProvider);
        assertEquals(group.allProviders(), group.liveProviders());

        ConsulSeedNodeProvider provider = (ConsulSeedNodeProvider)group.allProviders().get(0);

        assertEquals("hekate-test", provider.basePath());
        assertEquals(consulUrl, provider.url());
    }

    @Test
    public void testDisabled() throws Exception {
        ignoreGhostThreads();

        registerAndRefresh(new String[]{
            "hekate.cluster.seed.consul.enable=false"
        }, ConsulDisabledConfig.class);

        SeedNodeProvider provider = getNode().get(DefaultClusterService.class).seedNodeProvider();

        assertFalse(provider instanceof ConsulSeedNodeProvider);
    }
}


text:
module KindleClipper
  VERSION = "0.0.1"
end


text:
/** Automatically generated file. DO NOT MODIFY */
package com.kasonchan.share;

public final class BuildConfig {
    public final static boolean DEBUG = true;
}


text:
hippo7-rproxy-nodejs
====================

Node.js script for Reverse Proxy targeting Hippo CMS 7 and HST-2 applications.
You can run this simple script as a reverse proxy server supporting both HTTP and HTTPS.

Note
----
The current version of rproxy.js wohttrks with the latest versions (1.0.x) of 'http-proxy' module.
The old version of rproxy.js which worked with the outdated versions (0.8.x or earlier) of 'http-proxy' module has moved to 'with-http-proxy-0.8.x' branch.

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

Hippo CMS 7 (http://www.onehippo.org) is a Java based Open Source Web Content Management Solution.
Hippo CMS 7 solution usually consists of multiple web applications and
system administrators often deploy a reverse proxy server before Java application servers for many reasons.

Apache HTTP Server with mod_proxy is a popular solution for the reverse proxy node, but it is not so convenient
to install Apache HTTP Server on a developer's computer.

So, I looked for an alternative solution for convenience of developers who want to test in the same environment as
the production server.

The solution is Node.js!
Yes, I was able to implement a full-featured, reliable reverse proxy script with Node.js very quickly.

How to run the reverse proxy server script
------------------------------------------

  Note: First, you need to install Node.js in order to run Reverse Proxy Server script.
        See the next section for installation guide.

  1. Copy the following two files into the root folder of your Hippo CMS 7 project.
    * rproxy.js
    * pakage.json

      Or you can run the following in the command line to download it:

        $ curl -L https://raw.github.com/woonsan/hippo7-rproxy-nodejs/hippo7-rproxy-nodejs-1.0.x/rproxy.js > rproxy.js
        $ curl -L https://raw.github.com/woonsan/hippo7-rproxy-nodejs/hippo7-rproxy-nodejs-1.0.x/package.json > package.json

  2. Install dependencies (you can run this only once).

    Run the following command in the root folder of your Hippo CMS 7 project:

      $ npm install

    (The above command will install all the dependencies defined in the package.json.)

    * Note: if you have a problem in installing with npm due to a corporate proxy, then please follow
            Wil Boayue's blog article: [Using Npm Behind a Corporate Proxy] (http://wil.boayue.com/blog/2013/06/14/using-npm-behind-a-proxy/).

  3. Move to the root folder of your Hippo CMS 7 project in the command line console and run the following command:

       $ sudo node rproxy.js

     * Note: Windows Users can omit `sudo' for the above and the other command examples below:

       C:\\...> node rproxy.js

    The above command will run the Reverse Proxy Server at port 80 and at SSL port 443 by default.
    (The SSL port will open only if you have SSL private key file and certificate file properly.
    The default paths are './priv.pem' and './cert.pem'.)

    You can run it at different ports like the following example:

        $ sudo node rproxy.js 8888

    The above command will open 8888 for HTTP and 443 for HTTPS.

        $ node rproxy.js 8888 8443

    The above command will open 8888 for HTTP and 8443 for HTTPS.

  4. For your information, to generate SSL private key and certificate files for testing purpose,
     you can simply run the following:

    $ openssl genrsa -out priv.pem 1024
    $ openssl req -new -key priv.pem -out cert.csr
    $ openssl x509 -req -in cert.csr -signkey priv.pem -out cert.pem

About installing Node.js
----------------------------------------------

  Download a Node.js installer package from the following site and install it on your system.
  - http://nodejs.org/

Reverse Proxy Mapping Configuration
-----------------------------------

  If you open the 'rproxy.js' file, you can find the following as the default mapping configuration:

  /**************************************************************/
  /* URL Path Mappings for Reverse Proxying to Target Servers */
  /**************************************************************/
  /* You can add edit mappings below! */

  var mappings = [
    {
      host: '*',
      pathregex: /^\/cms(\/|$)/,
      route: {
        target: 'http://localhost:8080'
      }
    },
    {
      host: '*',
      pathregex: /^\/site(\/|$)/,
      route: {
        target: 'http://localhost:8080'
      }
    },
    {
      host: '*',
      pathregex: /^/,
      pathreplace: '/site',
      setcookie: {
        pathregex: /^\/site/,
        pathreplace: '/'
      },
      route: {
        target: 'http://localhost:8080'
      }
    },
  ];

  Based on the 'mappings' array object, the 'rproxy.js' will do reverse proxying for each target.
  In the above default example mappings, there are two mappings defined.

  The first mapping checks if the request host header matches the host property ('*' means any host),
  and if the request path is just '/cms' or starts with '/cms/' (e.g., http://localhost:8080/cms/...).
  If the request path is just '/cms' or starts with '/cms/', then it routes the request to the target, 'http://localhost:8080'.
  And, in this case, the request path doesn't change.
  So, the request path like '/cms/...', will be targeted to 'http://localhost:8080/cms/...'.

  The third mapping checks if the request host header matches the host property ('*' means any host),
  and if the request path starts with *any* (by the regular expression, /^/), then
  it prepends the request path by '/site' and the request is targeted to the 'http://localhost:8080'.
  So, the request path like '/news/...', will be targeted to 'http://localhost:8080/site/news/...'.
  'pathreplace' property is optional. If it's defined, then it is used to replace the found match by 'pathregex' property.

  The second mapping was added only to allow requests having the same context path, which is targeting to the same one
  as the third one explained above. (You may remove this if you don't need to allow this.)

  You can add or remove mapping in 'mappings' object just by editing 'rproxy.js'.

Changing the default SSL private key and certificate file paths
---------------------------------------------------------------

  If you want to use different SSL private key and certificate file paths, then open the 'rproxy.js' file.
  You can find the following as the default file paths:

/*============================================================*/
/* Reverse Proxy Server Default Options Configuration         */
/*------------------------------------------------------------*/

var defaultOptions = {
  xfwd: true, // add X-Forwarded-* headers
};

// SSL Key file paths; change those paths if you have those in other paths.
var ssl_private_key_path = './priv.pem';
var ssl_certificate_path = './cert.pem';

  Change the file paths above to whatever you want to use.

Simulating Multiple Domain Environment on your computer
-------------------------------------------------------

  Sometimes we want to test multiple domain environment for some reason. e.g., client-side federation between domains.
  You can use multiple domains with this rproxy.js to simulate multiple domains environments.
  For example, you can configure the mapping to let 'http://www1.example.lan' go to 'http://localhost:8080/site',
  while 'http://www2.example.lan' go to 'http://localhost:9080/site'.
  The following is an example mapping configuration for this scenario:

/*------------------------------------------------------------*/
/* URL Path Mappings Configuration for Reverse Proxy Targets  */
/*------------------------------------------------------------*/
// You can add edit mappings below!

  var mappings = [
    {
      host: 'www1.example.lan',
      pathregex: /^/,
      pathreplace: '/site',
      route: {
        target: 'http://localhost:8080'
      }
    },
    {
      host: 'www2.example.lan',
      pathregex: /^/,
      pathreplace: '/site',
      route: {
        target: 'http://localhost:9080'
      }
    },
  ];

  Of course, you will need to add those host names into your hosts file (e.g., /etc/hosts) like this:

127.0.0.1    www1.example.lan
127.0.0.1    www2.example.lan

  Then you don't have to prepare two different machines, but you can focus more on your federated scenario implementation/testing!

Adding Custom Request Headers on Specific Proxy Mapping
-------------------------------------------------------
You can also add custom proxy request headers by setting 'reqHeaders' property like the following examples:

/*------------------------------------------------------------*/
/* URL Path Mappings Configuration for Reverse Proxy Targets  */
/*------------------------------------------------------------*/
// You can add edit mappings below!

  var mappings = [
    {
      host: 'www1.example.lan',
      pathregex: /^/,
      pathreplace: '/site',
      route: {
        target: 'http://localhost:8080'
      },
      reqHeaders: {
        'X-Special-Proxy-Header': 'foobar'
      }
    },
  ];

-----

OK. Now enjoy working with rproxy.js (powered by Node.js) !!

Cheers!


text:
class TestModel < ApplicationRecord
  belongs_to :user
end


text:
#import "UIView+React.h"

#import <objc/runtime.h>

#import "RCTAssert.h"
#import "RCTLog.h"
#import "RCTShadowView.h"

@implementation UIView (React)

- (NSNumber *)reactTag
{
  return objc_getAssociatedObject(self, _cmd);
}

- (void)setReactTag:(NSNumber *)reactTag
{
  objc_setAssociatedObject(self, @selector(reactTag), reactTag, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

#if RCT_DEV

- (RCTShadowView *)_DEBUG_reactShadowView
{
  return objc_getAssociatedObject(self, _cmd);
}

- (void)_DEBUG_setReactShadowView:(RCTShadowView *)shadowView
{
  // Use assign to avoid keeping the shadowView alive it if no longer exists
  objc_setAssociatedObject(self, @selector(_DEBUG_reactShadowView), shadowView, OBJC_ASSOCIATION_ASSIGN);
}

#endif

- (BOOL)isReactRootView
{
  return RCTIsReactRootView(self.reactTag);
}

- (NSNumber *)reactTagAtPoint:(CGPoint)point
{
  UIView *view = [self hitTest:point withEvent:nil];
  while (view && !view.reactTag) {
    view = view.superview;
  }
  return view.reactTag;
}

- (NSArray<UIView *> *)reactSubviews
{
  return objc_getAssociatedObject(self, _cmd);
}

- (UIView *)reactSuperview
{
  return self.superview;
}

- (void)insertReactSubview:(UIView *)subview atIndex:(NSInteger)atIndex
{
  // We access the associated object directly here in case someone overrides
  // the `reactSubviews` getter method and returns an immutable array.
  NSMutableArray *subviews = objc_getAssociatedObject(self, @selector(reactSubviews));
  if (!subviews) {
    subviews = [NSMutableArray new];
    objc_setAssociatedObject(self, @selector(reactSubviews), subviews, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
  }
  [subviews insertObject:subview atIndex:atIndex];
}

- (void)removeReactSubview:(UIView *)subview
{
  // We access the associated object directly here in case someone overrides
  // the `reactSubviews` getter method and returns an immutable array.
  NSMutableArray *subviews = objc_getAssociatedObject(self, @selector(reactSubviews));
  [subviews removeObject:subview];
  [subview removeFromSuperview];
}

- (UIUserInterfaceLayoutDirection)reactLayoutDirection
{
  if ([self respondsToSelector:@selector(semanticContentAttribute)]) {
    return [UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.semanticContentAttribute];
  } else {
    return [objc_getAssociatedObject(self, @selector(reactLayoutDirection)) integerValue];
  }
}

- (void)setReactLayoutDirection:(UIUserInterfaceLayoutDirection)layoutDirection
{
  if ([self respondsToSelector:@selector(setSemanticContentAttribute:)]) {
    self.semanticContentAttribute =
      layoutDirection == UIUserInterfaceLayoutDirectionLeftToRight ?
        UISemanticContentAttributeForceLeftToRight :
        UISemanticContentAttributeForceRightToLeft;
  } else {
    objc_setAssociatedObject(self, @selector(reactLayoutDirection), @(layoutDirection), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
  }
}

- (NSInteger)reactZIndex
{
  return [objc_getAssociatedObject(self, _cmd) integerValue];
}

- (void)setReactZIndex:(NSInteger)reactZIndex
{
  objc_setAssociatedObject(self, @selector(reactZIndex), @(reactZIndex), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

- (NSArray<UIView *> *)sortedReactSubviews
{
  NSArray *subviews = objc_getAssociatedObject(self, _cmd);
  if (!subviews) {
    // Check if sorting is required - in most cases it won't be
    BOOL sortingRequired = NO;
    for (UIView *subview in self.reactSubviews) {
      if (subview.reactZIndex != 0) {
        sortingRequired = YES;
        break;
      }
    }
    subviews = sortingRequired ? [self.reactSubviews sortedArrayUsingComparator:^NSComparisonResult(UIView *a, UIView *b) {
      if (a.reactZIndex > b.reactZIndex) {
        return NSOrderedDescending;
      } else {
        // ensure sorting is stable by treating equal zIndex as ascending so
        // that original order is preserved
        return NSOrderedAscending;
      }
    }] : self.reactSubviews;
    objc_setAssociatedObject(self, _cmd, subviews, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
  }
  return subviews;
}

// private method, used to reset sort
- (void)clearSortedSubviews
{
  objc_setAssociatedObject(self, @selector(sortedReactSubviews), nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

- (void)didUpdateReactSubviews
{
  for (UIView *subview in self.sortedReactSubviews) {
    [self addSubview:subview];
  }
}

- (void)reactSetFrame:(CGRect)frame
{
  // These frames are in terms of anchorPoint = topLeft, but internally the
  // views are anchorPoint = center for easier scale and rotation animations.
  // Convert the frame so it works with anchorPoint = center.
  CGPoint position = {CGRectGetMidX(frame), CGRectGetMidY(frame)};
  CGRect bounds = {CGPointZero, frame.size};

  // Avoid crashes due to nan coords
  if (isnan(position.x) || isnan(position.y) ||
      isnan(bounds.origin.x) || isnan(bounds.origin.y) ||
      isnan(bounds.size.width) || isnan(bounds.size.height)) {
    RCTLogError(@"Invalid layout for (%@)%@. position: %@. bounds: %@",
                self.reactTag, self, NSStringFromCGPoint(position), NSStringFromCGRect(bounds));
    return;
  }

  self.center = position;
  self.bounds = bounds;
}

- (void)reactSetInheritedBackgroundColor:(__unused UIColor *)inheritedBackgroundColor
{
  // Does nothing by default
}

- (UIViewController *)reactViewController
{
  id responder = [self nextResponder];
  while (responder) {
    if ([responder isKindOfClass:[UIViewController class]]) {
      return responder;
    }
    responder = [responder nextResponder];
  }
  return nil;
}

- (void)reactAddControllerToClosestParent:(UIViewController *)controller
{
  if (!controller.parentViewController) {
    UIView *parentView = (UIView *)self.reactSuperview;
    while (parentView) {
      if (parentView.reactViewController) {
        [parentView.reactViewController addChildViewController:controller];
        [controller didMoveToParentViewController:parentView.reactViewController];
        break;
      }
      parentView = (UIView *)parentView.reactSuperview;
    }
    return;
  }
}

/**
 * Focus manipulation.
 */
- (BOOL)reactIsFocusNeeded
{
  return [(NSNumber *)objc_getAssociatedObject(self, @selector(reactIsFocusNeeded)) boolValue];
}

- (void)setReactIsFocusNeeded:(BOOL)isFocusNeeded
{
  objc_setAssociatedObject(self, @selector(reactIsFocusNeeded), @(isFocusNeeded), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

- (void)reactFocus {
  if (![self becomeFirstResponder]) {
    self.reactIsFocusNeeded = YES;
  }
}

- (void)reactFocusIfNeeded {
  if (self.reactIsFocusNeeded) {
    if ([self becomeFirstResponder]) {
      self.reactIsFocusNeeded = NO;
    }
  }
}

- (void)reactBlur {
  [self resignFirstResponder];
}

/**
 * Responder overrides - to be deprecated.
 */
- (BOOL)reactRespondsToTouch:(__unused UITouch *)touch
{
  return YES;
}

@end