text:
import Ember from 'ember'
const {merge} = Ember

import forwardingConstruct from './forwarding-construct'

export default {
  title: 'Base Service',
  description: 'Base Service definition derived from ForwardingConstruct',
  properties: {
    properties: {
      type: 'object',
      properties: merge({
        customerName: {
          description: 'Name of the customer for which this service will be provisioned.',
          type: 'string'
        },
        description: {
          type: 'string',
          title: 'Description',
          description: ''
        },
        name: {
          type: 'string',
          title: 'Name',
          description: ''
        },
        nativeName: {
          description: 'The name of the FC that is native to the network element.',
          type: 'string'
        },
        userLabel: {
          description: 'The label given to the FRE by an user.',
          type: 'string'
        },

        /**
         * operations
         **/
        opAddEndpoint: {
          title: 'Add Endpoint',
          type: 'object',
          properties: {
            endPointId: {
              type: 'string'
            },
            role: {
              type: 'string'
            }
          }
        },
        opRemoveEndpoint: {
          title: 'Remove Endpoint',
          type: 'string'
        }
      }, forwardingConstruct.properties.properties.properties)
    }
  }
}


text:
package hulk.auth

import akka.http.scaladsl.model.HttpHeader
import scala.concurrent.ExecutionContext.Implicits.global

import scalaoauth2.provider._

/**
  * Created by reweber on 06/03/2016
  */
case class OAuthClientFlow[T](oAuthClientFlowData: OAuthClientFlowData, dataHandler: AuthorizationHandler[T]) {

  private val headerMap = Map("Authorization" -> Seq(oAuthClientFlowData.authorization.value()))
  private val paramMap = Map("grant_type" -> Seq(oAuthClientFlowData.grantType)) ++
    oAuthClientFlowData.scope.map(s => Map("scope" -> Seq(s))).getOrElse(Map.empty)

  private val clientCredentialsRequest = new ClientCredentialsRequest(new AuthorizationRequest(headerMap, paramMap))

  def run = new ClientCredentials().handleRequest(clientCredentialsRequest, dataHandler)

}

case class OAuthClientFlowData(authorization: HttpHeader, grantType: String, scope: Option[String])

redpajama_set_name: RedPajamaGithub


text:
using UnityEngine;
using UnityEditor;
using System.Collections;
using ProBuilder2.MeshOperations;
using ProBuilder2.Common;
using ProBuilder2.EditorCommon;

namespace ProBuilder2.Actions
{
	public class pb_StripProBuilderScripts : Editor
	{
		[MenuItem("Tools/" + pb_Constant.PRODUCT_NAME + "/Actions/Strip All ProBuilder Scripts in Scene")]
		public static void StripAllScenes()
		{

			if(!EditorUtility.DisplayDialog("Strip ProBuilder Scripts", "This will remove all ProBuilder scripts in the scene.  You will no longer be able to edit these objects.  There is no undo, please exercise caution!\n\nAre you sure you want to do this?", "Okay", "Cancel"))
				return;

			pb_Object[] all = (pb_Object[]) Resources.FindObjectsOfTypeAll(typeof(pb_Object) );

			Strip(all);
		}

		[MenuItem("Tools/" + pb_Constant.PRODUCT_NAME + "/Actions/Strip ProBuilder Scripts in Selection", true, 0)]
		public static bool VerifyStripSelection()
		{
			return pbUtil.GetComponents<pb_Object>(Selection.transforms).Length > 0;
		}

		[MenuItem("Tools/" + pb_Constant.PRODUCT_NAME + "/Actions/Strip ProBuilder Scripts in Selection")]
		public static void StripAllSelected()
		{
			if(!EditorUtility.DisplayDialog("Strip ProBuilder Scripts", "This will remove all ProBuilder scripts on the selected objects.  You will no longer be able to edit these objects.  There is no undo, please exercise caution!\n\nAre you sure you want to do this?", "Okay", "Cancel"))
				return;

			foreach(Transform t in Selection.transforms)
			{
				foreach(pb_Object pb in t.GetComponentsInChildren<pb_Object>(true))
					DoStrip(pb);
			}
		}

		public static void Strip(pb_Object[] all)
		{
				for(int i = 0; i < all.Length; i++)
				{
					if( EditorUtility.DisplayCancelableProgressBar(
						"Stripping ProBuilder Scripts",
						"Working over " + all[i].id + ".",
						((float)i / all.Length)) )
						break;

					DoStrip(all[i]);
				}

			EditorUtility.ClearProgressBar();
			EditorUtility.DisplayDialog("Strip ProBuilder Scripts", "Successfully stripped out all ProBuilder components.", "Okay");

			if(pb_Editor.instance)
				pb_Editor.instance.UpdateSelection();
		}

		public static void DoStrip(pb_Object pb)
		{
			try
			{
				GameObject go = pb.gameObject;

				Renderer ren = go.GetComponent<Renderer>();

				if(ren != null)
					EditorUtility.SetSelectedWireframeHidden(ren, false);

				if( PrefabUtility.GetPrefabType(go) == PrefabType.Prefab )
					return;

				pb_Editor_Utility.VerifyMesh(pb);

				if(pb.msh == null)
				{
					DestroyImmediate(pb);

					if(go.GetComponent<pb_Entity>())
						DestroyImmediate(go.GetComponent<pb_Entity>());

					return;
				}

				Mesh m = pbUtil.DeepCopyMesh(pb.msh);

				DestroyImmediate(pb);

				if(go.GetComponent<pb_Entity>())
					DestroyImmediate(go.GetComponent<pb_Entity>());

				go.GetComponent<MeshFilter>().sharedMesh = m;
				if(go.GetComponent<MeshCollider>())
					go.GetComponent<MeshCollider>().sharedMesh = m;
			}
			catch {}
		}
	}
}


text:
package at.kc.tugraz.sss.comment.datatypes.par;

import at.tugraz.sss.serv.db.api.*;

public enum SSCommentSQLTableE implements SSSQLTableI{

  comment,
  comments;
}


text:
<?php
// ##########  Do not delete these lines
if (isset($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])){
    die ('Please do not load this page directly. Thanks!'); }
if ( post_password_required() ) { ?>

<?php _e('This post is password protected. Enter the password to view comments.', 'kubrick'); ?>

<?php
    return; }
// ##########  End do not delete section

// Display Comments Section
if ( have_comments() ) : ?>

<?php comments_number('No Responses', 'One Response', '% Responses');?>

<?php previous_comments_link() ?>

<?php next_comments_link() ?>

     <?php
     wp_list_comments(array(
      // see http://codex.wordpress.org/Function_Reference/wp_list_comments
      // 'login_text'        => 'Login to reply',
      // 'callback'          => null,
      // 'end-callback'      => null,
      // 'type'              => 'all',
       'avatar_size'       => 64,
      // 'reverse_top_level' => null,
      // 'reverse_children'  =>
      ));
      ?>

<?php previous_comments_link() ?>

<?php next_comments_link() ?>

    <?php
    if ( ! comments_open() ) : // There are comments but comments are now closed
        echo"
Comments are closed.
";
    endif;

else : // I.E. There are no Comments
    if ( comments_open() ) : // Comments are open, but there are none yet
        // echo"
Be the first to write a comment.
";
    else : // comments are closed
        echo"
Comments are closed.
";
    endif;
endif;

$fields =  array(

  'author' =>
    '
' . __( 'Họ tên', 'domainreference' ) . ' ' .
    ( $req ? '*' : '' ) .
    '<input id="author" name="author" type="text" class="form-control" value="' . esc_attr( $commenter['comment_author'] ) .
    '" size="30"' . $aria_req . ' />
',

  'email' =>
    '
' . __( 'Email', 'domainreference' ) . ' ' .
    ( $req ? '*' : '' ) .
    '<input id="email" name="email" type="text" class="form-control" value="' . esc_attr(  $commenter['comment_author_email'] ) .
    '" size="30"' . $aria_req . ' />
',

  // 'url' =>
  //   '
' . __( 'Website', 'domainreference' ) . '' .
  //   '<input id="url" name="url" class="form-control" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) .
  //   '" size="30" />
',
);

// Display Form/Login info Section
// the comment_form() function handles this and can be used without any paramaters simply as "comment_form()"
comment_form(array(
  // see codex http://codex.wordpress.org/Function_Reference/comment_form for default values
  // tutorial here http://blogaliving.com/wordpress-adding-comment_form-theme/
  'comment_field' => '
' . __( 'Nội dung', 'domainreference' ) . ' <textarea name="comment" id="comment" class="form-control" cols="58" rows="10" tabindex="4" aria-required="true"></textarea>
',
  'label_submit' => 'Gửi ',
  'comment_notes_after' => '',
  'fields' => apply_filters( 'comment_form_default_fields', $fields ),
  ));

// RSS comments link
echo '
';
post_comments_feed_link('RSS Feed');
echo '
';

?>


text:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/grey_background"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/scrollView" >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:animateLayoutChanges="true"
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:paddingBottom="10dp" >

        <View
            android:layout_width="match_parent"
            android:layout_height="80dp"
            android:background="@color/frame_background"
            android:id="@+id/frame1"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="10dp"
            android:layout_marginRight="10dp"
            android:layout_alignParentStart="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentTop="true" />

        <View
            android:layout_width="wrap_content"
            android:layout_height="2dp"
            android:background="@color/black_10"
            android:id="@+id/shadow1"
            android:layout_below="@+id/frame1"
            android:layout_alignStart="@+id/frame1"
            android:layout_alignLeft="@+id/frame1"
            android:layout_alignEnd="@+id/frame1"
            android:layout_alignRight="@+id/frame1" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="@string/pin"
            android:id="@+id/pinTitle"
            android:textStyle="bold"
            android:layout_alignBottom="@+id/pinEdit"
            android:layout_toStartOf="@+id/pinEdit"
            android:layout_toLeftOf="@+id/pinEdit"
            android:textColor="@color/blue" />

        <EditText
            android:layout_width="150dp"
            android:layout_height="wrap_content"
            android:inputType="numberPassword"
            android:ems="10"
            android:id="@+id/pinEdit"
            android:numeric="integer"
            android:maxLength="6"
            android:gravity="center_horizontal"
            android:hint="@string/enter_pin_hint"
            android:layout_marginTop="22dp"
            android:layout_alignTop="@+id/frame1"
            android:layout_centerHorizontal="true"
            android:textColor="@color/blue"
            android:layout_marginStart="5dp"
            android:layout_marginLeft="5dp"
            android:layout_marginEnd="10dp"
            android:layout_marginRight="10dp"
            android:layout_alignBottom="@+id/frame1"
            android:layout_marginBottom="22dp" />

        <Button
            style="?android:attr/buttonStyleSmall"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/ok_button"
            android:id="@+id/setPin"
            android:layout_toEndOf="@+id/pinEdit"
            android:layout_toRightOf="@+id/pinEdit"
            android:background="@drawable/ic_ok_reload_selector"
            android:textColor="@color/white"
            android:layout_alignTop="@+id/frame1"
            android:layout_marginTop="16dp"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:layout_alignBottom="@+id/frame1"
            android:layout_marginBottom="16dp" />

        <View
            android:layout_width="match_parent"
            android:layout_height="100dp"
            android:background="@color/frame_background"
            android:id="@+id/frame2"
            android:layout_below="@+id/frame1"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="20dp"
            android:layout_alignParentStart="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true" />

        <View
            android:layout_width="wrap_content"
            android:layout_height="2dp"
            android:background="@color/black_10"
            android:id="@+id/shadow2"
            android:layout_below="@+id/frame2"
            android:layout_alignStart="@+id/frame2"
            android:layout_alignLeft="@+id/frame2"
            android:layout_alignEnd="@+id/frame2"
            android:layout_alignRight="@+id/frame2" />

        <View
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:background="@color/blue"
            android:id="@+id/lockScreenSeparator"
            android:layout_alignStart="@+id/frame2"
            android:layout_alignLeft="@+id/frame2"
            android:layout_alignEnd="@+id/frame2"
            android:layout_alignRight="@+id/frame2"
            android:layout_alignTop="@+id/frame2" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="@string/nfc_lockscreen"
            android:id="@+id/lockScreenTitle"
            android:textStyle="bold"
            android:layout_marginTop="5dp"
            android:layout_alignTop="@+id/frame2"
            android:textColor="@color/white_95"
            android:layout_centerHorizontal="true" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:text="@string/lockscreen_enabled_disabled"
            android:id="@+id/lockscreen_enabled_disabled"
            android:layout_below="@+id/lockScreenSeparator"
            android:layout_alignStart="@+id/frame2"
            android:layout_alignLeft="@+id/frame2"
            android:layout_marginStart="15dp"
            android:layout_marginLeft="12dp"
            android:layout_marginTop="18dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:text="@string/lockscreen_disabled"
            android:id="@+id/enabled_disabled"
            android:textColor="@color/red"
            android:layout_alignTop="@+id/lockscreen_enabled_disabled"
            android:layout_toEndOf="@+id/lockscreen_enabled_disabled"
            android:layout_toRightOf="@+id/lockscreen_enabled_disabled"
            android:layout_marginStart="6dp"
            android:layout_marginLeft="6dp" />

        <Switch
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/toggle"
            android:layout_below="@+id/lockScreenSeparator"
            android:layout_alignEnd="@+id/frame2"
            android:layout_alignRight="@+id/frame2"
            android:layout_marginTop="16dp"
            android:layout_marginEnd="15dp"
            android:layout_marginRight="12dp" />

        <View
            android:layout_width="match_parent"
            android:layout_height="125dp"
            android:background="@color/frame_background"
            android:id="@+id/frame3"
            android:layout_below="@+id/frame2"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="20dp"
            android:layout_alignParentStart="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true" />

        <View
            android:layout_width="wrap_content"
            android:layout_height="2dp"
            android:background="@color/black_10"
            android:id="@+id/shadow3"
            android:layout_below="@+id/frame3"
            android:layout_alignStart="@+id/frame3"
            android:layout_alignLeft="@+id/frame3"
            android:layout_alignEnd="@+id/frame3"
            android:layout_alignRight="@+id/frame3" />

        <View
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:background="@color/blue"
            android:id="@+id/backgroundBlurSeparator"
            android:layout_alignStart="@+id/frame3"
            android:layout_alignLeft="@+id/frame3"
            android:layout_alignEnd="@+id/frame3"
            android:layout_alignRight="@+id/frame3"
            android:layout_alignTop="@+id/frame3" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:text="@string/background_blur_title"
            android:id="@+id/backgroundBlurTitle"
            android:layout_alignTop="@+id/frame3"
            android:layout_marginTop="8dp"
            android:textStyle="bold"
            android:textColor="@color/white_95"
            android:layout_centerHorizontal="true" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:text="@string/background_blur_message"
            android:id="@+id/backgroundBlurMessage"
            android:layout_below="@+id/backgroundBlurSeparator"
            android:layout_alignLeft="@+id/pinTitle"
            android:layout_alignStart="@+id/pinTitle"
            android:layout_marginTop="12dp"
            android:layout_marginStart="18dp"
            android:layout_marginLeft="15dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:text="15"
            android:id="@+id/backgroundBlurValue"
            android:layout_alignTop="@+id/backgroundBlurMessage"
            android:layout_toEndOf="@+id/backgroundBlurMessage"
            android:layout_toRightOf="@+id/backgroundBlurMessage"
            android:layout_marginStart="5dp"
            android:layout_marginLeft="5dp" />

        <SeekBar
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/seekBar"
            android:layout_alignStart="@+id/frame3"
            android:layout_alignLeft="@+id/frame3"
            android:layout_marginLeft="5dp"
            android:layout_marginTop="10dp"
            android:max="25"
            android:progress="15"
            android:layout_below="@+id/backgroundBlurMessage"
            android:layout_toStartOf="@+id/refreshWallpaper"
            android:layout_toLeftOf="@+id/refreshWallpaper"
            android:layout_marginRight="5dp" />

        <Button
            style="?android:attr/buttonStyleSmall"
            android:layout_width="100dp"
            android:layout_height="60dp"
            android:text="@string/background_blur_button_refresh"
            android:id="@+id/refreshWallpaper"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textColor="@color/white"
            android:background="@drawable/ic_ok_reload_selector"
            android:layout_alignTop="@+id/backgroundBlurMessage"
            android:layout_alignEnd="@+id/frame3"
            android:layout_alignRight="@+id/frame3"
            android:layout_marginEnd="15dp"
            android:layout_marginRight="15dp" />

        <ProgressBar
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/progressBar"
            android:layout_below="@+id/seekBar"
            android:layout_alignStart="@+id/frame3"
            android:layout_alignLeft="@+id/frame3"
            android:layout_alignEnd="@+id/frame3"
            android:layout_alignRight="@+id/frame3"
            android:indeterminate="true"
            android:visibility="invisible" />

        <View
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:background="@color/frame_background"
            android:id="@+id/frame4"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginTop="20dp"
            android:layout_alignParentStart="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_below="@+id/frame3" />

        <View
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:background="@color/blue"
            android:id="@+id/NFCTagsSeparator"
            android:layout_alignStart="@+id/frame4"
            android:layout_alignLeft="@+id/frame4"
            android:layout_alignEnd="@+id/frame4"
            android:layout_alignRight="@+id/frame4"
            android:layout_alignTop="@+id/frame4" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="@string/nfc_tags"
            android:id="@+id/NFCTagTitle"
            android:textStyle="bold"
            android:layout_marginTop="10dp"
            android:layout_alignTop="@+id/frame4"
            android:textColor="@color/white_95"
            android:layout_centerHorizontal="true" />

        <ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/newTag"
            android:layout_alignEnd="@+id/frame4"
            android:layout_alignRight="@+id/frame4"
            android:src="@drawable/ic_content_new"
            android:background="@drawable/ic_plus_selector"
            android:layout_alignTop="@+id/frame4"
            android:contentDescription="@string/new_tag_description"
            android:layout_marginTop="3dp"
            android:layout_marginEnd="3dp"
            android:layout_marginRight="3dp"
            android:layout_alignBottom="@+id/NFCTagsSeparator"
            android:layout_marginBottom="3dp" />

        <ListView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/listView"
            android:layout_below="@+id/NFCTagsSeparator"
            android:layout_marginRight="10dp"
            android:drawSelectorOnTop="true"
            android:layout_alignParentStart="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_marginTop="3dp"
            android:layout_alignStart="@+id/frame4"
            android:layout_alignLeft="@+id/frame4"
            android:layout_alignEnd="@+id/frame4"
            android:layout_alignRight="@+id/frame4"
            android:layout_marginLeft="10dp"
            android:dividerHeight="3dp"
            android:divider="@null" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:text="@string/no_nfc_tags"
            android:id="@+id/noTags"
            android:layout_below="@+id/NFCTagsSeparator"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="15dp"
            android:textColor="#646464"
            android:visibility="invisible" />

    </RelativeLayout>
</ScrollView>


text:
"""LCH class."""
from ..spaces import Space, RE_DEFAULT_MATCH, GamutUnbound, Cylindrical, Angle, Percent
from .luv import Luv
from .. import util
import re
import math

ACHROMATIC_THRESHOLD = 0.000000000002

def luv_to_lchuv(luv):
    """Luv to Lch(uv)."""

    l, u, v = luv

    c = math.sqrt(u ** 2 + v ** 2)
    h = math.degrees(math.atan2(v, u))

    # Achromatic colors will often get extremely close, but not quite hit zero.
    # Essentially, we want to discard noise through rounding and such.
    if c < ACHROMATIC_THRESHOLD:
        h = util.NaN

    return [l, c, util.constrain_hue(h)]

def lchuv_to_luv(lchuv):
    """Lch(uv) to Luv."""

    l, c, h = lchuv
    h = util.no_nan(h)

    # If, for whatever reason (mainly direct user input),
    # if chroma is less than zero, clamp to zero.
    if c < 0.0:
        c = 0.0

    return (
        l,
        c * math.cos(math.radians(h)),
        c * math.sin(math.radians(h))
    )

class Lchuv(Cylindrical, Space):
    """Lch(uv) class."""

    SPACE = "lchuv"
    SERIALIZE = ("--lchuv",)
    CHANNEL_NAMES = ("lightness", "chroma", "hue", "alpha")
    DEFAULT_MATCH = re.compile(RE_DEFAULT_MATCH.format(color_space='|'.join(SERIALIZE), channels=3))
    WHITE = "D65"

    RANGE = (
        GamutUnbound([Percent(0), Percent(100.0)]),
        GamutUnbound([0.0, 176.0]),
        GamutUnbound([Angle(0.0), Angle(360.0)]),
    )

    @property
    def lightness(self):
        """Lightness."""

        return self._coords[0]

    @lightness.setter
    def lightness(self, value):
        """Get true luminance."""

        self._coords[0] = self._handle_input(value)

    @property
    def chroma(self):
        """Chroma."""

        return self._coords[1]

    @chroma.setter
    def chroma(self, value):
        """chroma."""

        self._coords[1] = self._handle_input(value)

    @property
    def hue(self):
        """Hue."""

        return self._coords[2]

    @hue.setter
    def hue(self, value):
        """Shift the hue."""

        self._coords[2] = self._handle_input(value)

    @classmethod
    def null_adjust(cls, coords, alpha):
        """On color update."""

        if coords[1] < ACHROMATIC_THRESHOLD:
            coords[2] = util.NaN
        return coords, alpha

    @classmethod
    def _to_luv(cls, parent, lchuv):
        """To Luv."""

        return lchuv_to_luv(lchuv)

    @classmethod
    def _from_luv(cls, parent, luv):
        """To Luv."""

        return luv_to_lchuv(luv)

    @classmethod
    def _to_xyz(cls, parent, lchuv):
        """To XYZ."""

        return Luv._to_xyz(parent, cls._to_luv(parent, lchuv))

    @classmethod
    def _from_xyz(cls, parent, xyz):
        """From XYZ."""

        return cls._from_luv(parent, Luv._from_xyz(parent, xyz))


text:
require 'assert'
require 'mr/read_model/querying'

require 'ardb/relation_spy'
require 'much-plugin'
require 'mr/fake_record'
require 'mr/fake_query'
require 'mr/query'
require 'test/support/read_model/querying'

module MR::ReadModel

  class UnitTests < Assert::Context
    include MR::ReadModel::Querying::TestHelpers
    desc "MR::ReadModel"

  end

  class QueryingTests < UnitTests
    desc "Querying"
    setup do
      @read_model_class = Class.new do
        include MR::ReadModel::Querying
        attr_reader :data
        def initialize(data); @data = data; end
      end
    end
    subject{ @read_model_class }

    should have_imeths :relation, :record_class
    should have_imeths :find, :query, :count, :build_sql, :find_attr
    should have_imeths :select
    should have_imeths :from, :joins
    should have_imeths :where
    should have_imeths :order
    should have_imeths :group, :having
    should have_imeths :limit, :offset
    should have_imeths :merge
    should have_imeths :inner_join_subquery
    should have_imeths :left_outer_join_subquery, :left_join_subquery
    should have_imeths :right_outer_join_subquery, :right_join_subquery
    should have_imeths :full_outer_join_subquery, :full_join_subquery

    should "use much-plugin" do
      assert_includes MuchPlugin, MR::ReadModel::Querying
    end

    should "return a relation using `relation`" do
      relation = subject.relation
      assert_instance_of MR::ReadModel::Relation, relation
      assert_same relation, subject.relation
    end

    should "know its record class" do
      if Factory.boolean
        subject.from FakeTestRecord
      else
        subject.from_subquery do
          read_model{ from FakeTestRecord }
        end
      end
      assert_equal FakeTestRecord, subject.record_class
    end

    should "know how to find a specific result" do
      build_for_find_called_with = nil
      relation_spy               = Ardb::RelationSpy.new
      Assert.stub(subject.relation, :build_for_find) do |*args|
        build_for_find_called_with = args
        relation_spy
      end

      record = FakeTestRecord.new
      relation_spy.results << record

      id = Factory.integer
      result = subject.find(id)
      assert_equal [id, {}], build_for_find_called_with
      assert_instance_of subject, result
      assert_same record, result.data

      params = { Factory.string => Factory.string }
      result = subject.find(id, params)
      assert_equal [id, params], build_for_find_called_with
      assert_instance_of subject, result
      assert_same record, result.data

      relation_spy.results.clear
      assert_raises{ subject.find(id) }
      assert_raises{ subject.find(id, params) }
    end

    should "know how to build its sql" do
      build_sql_called_with = nil
      built_sql             = Factory.text
      Assert.stub(subject.relation, :build_sql) do |params|
        build_sql_called_with = params
        built_sql
      end

      result = subject.build_sql
      assert_nil build_sql_called_with
      assert_equal built_sql, result

      params = { Factory.string => Factory.string }
      result = subject.build_sql(params)
      assert_equal params, build_sql_called_with
      assert_equal built_sql, result
    end

    should "allow setting the relation's find attr" do
      column = Factory.string
      subject.find_attr column
      assert_equal column, subject.relation.find_attr
      assert_equal column, subject.find_attr
    end

    should "set the relation's from using `from`" do
      from_called_with = nil
      Assert.stub(subject.relation, :from){ |*args| from_called_with = args }

      subject.from FakeTestRecord
      assert_equal [FakeTestRecord], from_called_with
    end

    should "set the relation's from subquery using `from_subquery`" do
      from_subquery_called_with = nil
      Assert.stub(subject.relation, :from_subquery) do |&block|
        from_subquery_called_with = block
      end

      subquery_block = proc{ Factory.string }
      subject.from_subquery(&subquery_block)
      assert_equal subquery_block, from_subquery_called_with
    end

    should "raise an argument error when passing `from` a non MR::Record" do
      assert_raises(ArgumentError){ subject.from(Class.new) }
    end

    should "raise an argument error when no block is passed to `from_subquery`" do
      assert_raises(ArgumentError){ subject.from_subquery }
    end

    should "raise a no record class error when using the relation before it's configured" do
      assert_raises(MR::ReadModel::NoFromExpressionError){ subject.query }
    end

  end

  class WithFromRecordClassTests < QueryingTests
    setup do
      @ar_relation_spy = Ardb::RelationSpy.new
      Assert.stub(FakeTestRecord, :scoped){ @ar_relation_spy }
      @read_model_class.from FakeTestRecord
      @relation = @read_model_class.relation
    end

    should "add a static select to the relation with `select`" do
      select_sql = "some_table.some_column AS 'something'"
      subject.select select_sql
      assert_static_expression_added @relation, :select, select_sql
    end

    should "add a dynamic select to the relation with `select`" do
      select_proc = proc{ |name| "some_table.some_column AS '#{name}'" }
      subject.select(&select_proc)
      assert_dynamic_expression_added @relation, :select, select_proc
    end

    should "return the expression using `select`" do
      select_sql = "some_table.some_column AS 'something'"
      expression = subject.select select_sql
      assert_static_expression expression, :select, select_sql
    end

    should "add a static join to the relation with `joins`" do
      join_args = [ :some_table, :other_table ]
      subject.joins(*join_args)
      assert_static_expression_added @relation, :joins, *join_args
    end

    should "add a dynamic join to the relation with `joins`" do
      join_proc = proc{ |name| "CROSS JOIN #{name}" }
      subject.joins(&join_proc)
      assert_dynamic_expression_added @relation, :joins, join_proc
    end

    should "return the expression using `joins`" do
      join_args = [ :some_table, :other_table ]
      expression = subject.joins(*join_args)
      assert_static_expression expression, :joins, join_args
    end

    should "add a static merge to the relation with `where`" do
      merge_args = 'fake-relation'
      subject.where(merge_args)
      assert_static_merge_expression_added @relation, :where, merge_args
    end

    should "add a dynamic merge to the relation with `where`" do
      merge_proc = proc{ 'fake-relation' }
      subject.where(&merge_proc)
      assert_dynamic_merge_expression_added @relation, :where, merge_proc
    end

    should "return the merge expression using `where`" do
      merge_args = 'fake-relation'
      expression = subject.where(merge_args)
      assert_static_merge_expression expression, :where, merge_args
    end

    should "add a static merge to the relation with `order`" do
      merge_args = 'fake-relation'
      subject.order(merge_args)
      assert_static_merge_expression_added @relation, :order, merge_args
    end

    should "add a dynamic merge to the relation with `order`" do
      merge_proc = proc{ 'fake-relation' }
      subject.order(&merge_proc)
      assert_dynamic_merge_expression_added @relation, :order, merge_proc
    end

    should "return the merge expression using `order`" do
      merge_args = 'fake-relation'
      expression = subject.order(merge_args)
      assert_static_merge_expression expression, :order, merge_args
    end

    should "add a static group to the relation with `group`" do
      group_args = 'some_table.some_column'
      subject.group(group_args)
      assert_static_expression_added @relation, :group, group_args
    end

    should "add a dynamic group to the relation with `group`" do
      group_proc = proc{ |column| column }
      subject.group(&group_proc)
      assert_dynamic_expression_added @relation, :group, group_proc
    end

    should "return the expression using `group`" do
      group_args = 'some_table.some_column'
      expression = subject.group(group_args)
      assert_static_expression expression, :group, group_args
    end

    should "add a static having to the relation with `having`" do
      having_args = 'COUNT(*) > 0'
      subject.having(having_args)
      assert_static_expression_added @relation, :having, having_args
    end

    should "add a dynamic having to the relation with `having`" do
      having_proc = proc{ |column| "COUNT(#{column}) > 0" }
      subject.having(&having_proc)
      assert_dynamic_expression_added @relation, :having, having_proc
    end

    should "return the expression using `having`" do
      having_args = 'COUNT(*) > 0'
      expression = subject.having(having_args)
      assert_static_expression expression, :having, having_args
    end

    should "add a static limit to the relation with `limit`" do
      limit_args = 1
      subject.limit(limit_args)
      assert_static_expression_added @relation, :limit, limit_args
    end

    should "add a dynamic limit to the relation with `limit`" do
      limit_proc = proc{ |count| count }
      subject.limit(&limit_proc)
      assert_dynamic_expression_added @relation, :limit, limit_proc
    end

    should "return the expression using `limit`" do
      limit_args = 1
      expression = subject.limit(limit_args)
      assert_static_expression expression, :limit, limit_args
    end

    should "add a static offset to the relation with `offset`" do
      offset_args = 1
      subject.offset(offset_args)
      assert_static_expression_added @relation, :offset, offset_args
    end

    should "add a dynamic offset to the relation with `offset`" do
      offset_proc = proc{ |count| count }
      subject.offset(&offset_proc)
      assert_dynamic_expression_added @relation, :offset, offset_proc
    end

    should "return the expression using `offset`" do
      offset_args = 1
      expression = subject.offset(offset_args)
      assert_static_expression expression, :offset, offset_args
    end

    should "add a static merge to the relation with `merge`" do
      merge_args = 'fake-relation'
      subject.merge(merge_args)
      assert_static_merge_expression_added @relation, :merge, merge_args
    end

    should "add a dynamic merge to the relation with `merge`" do
      merge_proc = proc{ 'fake-relation' }
      subject.merge(&merge_proc)
      assert_dynamic_merge_expression_added @relation, :merge, merge_proc
    end

    should "return the merge expression using `merge`" do
      merge_args = 'fake-relation'
      expression = subject.merge(merge_args)
      assert_static_merge_expression expression, :merge, merge_args
    end

    should "add a join subquery to the relation with `inner_join_subquery`" do
      subquery_proc = proc{ as('my_table') }
      expression = subject.inner_join_subquery(&subquery_proc)
      assert_inner_join_subquery_added @relation, subquery_proc
    end

    should "return the subquery expression using `inner_join_subquery`" do
      subquery_proc = proc{ as('my_table') }
      expression = subject.inner_join_subquery(&subquery_proc)
      assert_join_subquery_expression expression, :inner, subquery_proc
    end

    should "add a join subquery to the relation with `left_outer_join_subquery`" do
      subquery_proc = proc{ as('my_table') }
      expression = subject.left_outer_join_subquery(&subquery_proc)
      assert_left_outer_join_subquery_added @relation, subquery_proc
    end

    should "return the subquery expression using `left_outer_join_subquery`" do
      subquery_proc = proc{ as('my_table') }
      expression = subject.left_outer_join_subquery(&subquery_proc)
      assert_join_subquery_expression expression, :left, subquery_proc
    end

    should "add a join subquery to the relation with `right_outer_join_subquery`" do
      subquery_proc = proc{ as('my_table') }
      expression = subject.right_outer_join_subquery(&subquery_proc)
      assert_right_outer_join_subquery_added @relation, subquery_proc
    end

    should "return the subquery expression using `right_outer_join_subquery`" do
      subquery_proc = proc{ as('my_table') }
      expression = subject.right_outer_join_subquery(&subquery_proc)
      assert_join_subquery_expression expression, :right, subquery_proc
    end

    should "add a join subquery to the relation with `full_outer_join_subquery`" do
      subquery_proc = proc{ as('my_table') }
      expression = subject.full_outer_join_subquery(&subquery_proc)
      assert_full_outer_join_subquery_added @relation, subquery_proc
    end

    should "return the subquery expression using `full_outer_join_subquery`" do
      subquery_proc = proc{ as('my_table') }
      expression = subject.full_outer_join_subquery(&subquery_proc)
      assert_join_subquery_expression expression, :full, subquery_proc
    end

    should "raise an argument error when any query method isn't provided args or a block" do
      assert_raises(ArgumentError){ subject.select }
      assert_raises(ArgumentError){ subject.joins }
      assert_raises(ArgumentError){ subject.where }
      assert_raises(ArgumentError){ subject.order }
      assert_raises(ArgumentError){ subject.group }
      assert_raises(ArgumentError){ subject.having }
      assert_raises(ArgumentError){ subject.limit }
      assert_raises(ArgumentError){ subject.offset }
      assert_raises(ArgumentError){ subject.merge }
      assert_raises(ArgumentError){ subject.inner_join_subquery }
      assert_raises(ArgumentError){ subject.left_outer_join_subquery }
      assert_raises(ArgumentError){ subject.right_outer_join_subquery }
      assert_raises(ArgumentError){ subject.full_outer_join_subquery }
    end

  end

  class QueryTests < WithFromRecordClassTests
    desc "query"
    setup do
      @read_model_class.select(:name)
      @query = @read_model_class.query
    end
    subject{ @query }

    should "return an instance of an MR::Query for the class and relation" do
      assert_instance_of MR::Query, subject
      assert_equal @read_model_class, subject.model_class
      assert_equal @ar_relation_spy,  subject.relation
    end

    should "have applied the query expressions to the relation" do
      assert_expression_applied @ar_relation_spy, :select, :name
    end

  end

  class CountTests < WithFromRecordClassTests
    desc "count"
    setup do
      results = Array.new(Factory.integer(10))
      @query  = MR::FakeQuery.new(results)

      @args = if Factory.boolean
        [{ Factory.string => Factory.string }]
      else # should support when query is overidden
        @read_model_class.class_eval do
          def self.query(something, something_else)
            super({
              :something      => something,
              :something_else => something_else
            })
          end
        end
        [Factory.string, Factory.string]
      end

      @query_called_with = nil
      Assert.stub(@read_model_class, :query) do |*args|
        @query_called_with = args
        @query
      end
    end

    should "know how to return a count for its query" do
      result = subject.count(*@args)
      assert_equal @args,        @query_called_with
      assert_equal @query.count, result
    end

  end

  class RelationTests < UnitTests
    desc "Relation"
    setup do
      @relation_class = MR::ReadModel::Relation
      @relation       = @relation_class.new
    end
    subject{ @relation }

    should have_readers :from_expression, :query_expressions
    should have_writers :find_attr
    should have_imeths :from, :from_subquery, :from_record_class, :find_attr
    should have_imeths :build_for_find, :build_for_all, :build_sql

    should "know its find find excluded types" do
      exp = [:where, :limit, :offset]
      assert_equal exp, @relation_class::FIND_EXCLUDED_TYPES
    end

    should "not have a from expression or any expressions by default" do
      assert_instance_of NullFromExpression, subject.from_expression
      assert_equal [], subject.query_expressions
    end

    should "set its from expression using `from`" do
      subject.from FakeTestRecord

      assert_instance_of FromExpression, subject.from_expression
      assert_equal FakeTestRecord, subject.from_expression.record_class
    end

    should "set its from expression using `from_subquery`" do
      subquery_block = proc{ Factory.string }
      subject.from_subquery(&subquery_block)

      assert_instance_of FromSubqueryExpression, subject.from_expression
      assert_equal subquery_block, subject.from_expression.subquery_block
    end

    should "know how to build its sql" do
      built_sql    = Factory.text
      relation_spy = Ardb::RelationSpy.new
      Assert.stub(relation_spy, :to_sql){ "  #{built_sql}  " }

      build_for_all_called_with = nil
      Assert.stub(subject, :build_for_all) do |params|
        build_for_all_called_with = params
        relation_spy
      end

      result = subject.build_sql
      assert_equal built_sql, result
      assert_nil build_for_all_called_with

      params = { Factory.string => Factory.string }
      result = subject.build_sql(params)
      assert_equal built_sql, result
      assert_equal params,    build_for_all_called_with
    end

  end

  class RelationWithFromTests < RelationTests
    desc "with a from expression"
    setup do
      if Factory.boolean
        @relation.from FakeTestRecord
      else
        @relation.from_subquery do
          read_model{ from FakeTestRecord }
        end
        @relation.find_attr = Factory.string
      end
      @from_ar_relation_built_with = nil
      Assert.stub(@relation.from_expression, :ar_relation) do |params|
        @from_ar_relation_built_with = params
        Ardb::RelationSpy.new
      end
      @relation.query_expressions << QueryExpression.new(:select, Factory.string)
      @relation.query_expressions << QueryExpression.new(:order,  Factory.string)
      @relation_class::FIND_EXCLUDED_TYPES.each do |type|
        @relation.query_expressions << QueryExpression.new(type, Factory.string)
      end
    end

    should "know its from record class" do
      assert_equal subject.from_expression.record_class, subject.from_record_class
    end

    should "know its find attr" do
      relation = @relation_class.new.tap{ |r| r.from FakeTestRecord }
      assert_equal relation.from_expression.default_find_attr, relation.find_attr

      column = Factory.string
      relation.find_attr = column
      assert_equal column, relation.find_attr

      # we don't allow from subquery expressions to default their from attr so
      # the user has to manually specify it
      relation = @relation_class.new
      relation.from_subquery do
        read_model{ from FakeTestRecord }
      end
      assert_raises(NoFindAttrError){ relation.find_attr }

      relation.find_attr = column
      assert_equal column, relation.find_attr
    end

    should "build an activerecord relation for find using `build_for_find`" do
      id = Factory.integer
      ar_relation_spy = subject.build_for_find(id)
      assert_nil @from_ar_relation_built_with
      subject.query_expressions.each do |e|
        if !@relation_class::FIND_EXCLUDED_TYPES.include?(e.type)
          assert_expression_applied ar_relation_spy, e.type, *e.args
        else
          assert_not_expression_applied ar_relation_spy, e.type, *e.args
        end
      end
    end

    should "return a new relation everytime `build_for_find` is called" do
      id = Factory.integer
      ar_relation = subject.build_for_find(id)
      assert_not_same ar_relation, subject.build_for_find(id)
    end

    should "apply expressions using the params passed to `build_for_find`" do
      subject.query_expressions << QueryExpression.new(:select){ |p| p['column'] }

      id     = Factory.integer
      params = { 'column' => Factory.string }
      ar_relation = subject.build_for_find(id, params)
      assert_equal params, @from_ar_relation_built_with
      assert_expression_applied ar_relation, :select, params['column']
    end

    should "return a relation from the record class using `build_for_all`" do
      ar_relation_spy = subject.build_for_all
      assert_nil @from_ar_relation_built_with
      subject.query_expressions.each do |e|
        assert_expression_applied ar_relation_spy, e.type, *e.args
      end
    end

    should "return a new relation everytime `build_for_all` is called" do
      ar_relation = subject.build_for_all
      assert_not_same ar_relation, subject.build_for_all
    end

    should "apply query expressions using the params passed to `build_for_all`" do
      subject.query_expressions << QueryExpression.new(:select){ |p| p['column'] }
      params = { 'column' => Factory.string }
      ar_relation = subject.build_for_all(params)
      assert_equal params, @from_ar_relation_built_with
      assert_expression_applied ar_relation, :select, params['column']
    end

  end

  class FakeTestRecord
    include MR::FakeRecord

    def self.table_name;  @table_name  ||= Factory.string; end
    def self.primary_key; @primary_key ||= Factory.string; end

    def self.scoped
      Ardb::RelationSpy.new
    end
  end

end


text:
#include "config.h"
#include "modules/webmidi/MIDIAccess.h"

#include "core/dom/DOMError.h"
#include "core/dom/Document.h"
#include "core/loader/DocumentLoadTiming.h"
#include "core/loader/DocumentLoader.h"
#include "modules/webmidi/MIDIAccessPromise.h"
#include "modules/webmidi/MIDIConnectionEvent.h"
#include "modules/webmidi/MIDIController.h"
#include "modules/webmidi/MIDIInput.h"
#include "modules/webmidi/MIDIOutput.h"
#include "modules/webmidi/MIDIPort.h"

namespace WebCore {

PassRefPtr<MIDIAccess> MIDIAccess::create(ScriptExecutionContext* context, MIDIAccessPromise* promise)
{
    RefPtr<MIDIAccess> midiAccess(adoptRef(new MIDIAccess(context, promise)));
    midiAccess->suspendIfNeeded();
    midiAccess->startRequest();
    return midiAccess.release();
}

MIDIAccess::~MIDIAccess()
{
    stop();
}

MIDIAccess::MIDIAccess(ScriptExecutionContext* context, MIDIAccessPromise* promise)
    : ActiveDOMObject(context)
    , m_promise(promise)
    , m_hasAccess(false)
    , m_sysExEnabled(false)
    , m_requesting(false)
{
    ScriptWrappable::init(this);
    m_accessor = MIDIAccessor::create(this);
}

void MIDIAccess::setSysExEnabled(bool enable)
{
    m_requesting = false;
    m_sysExEnabled = enable;
    if (enable)
        m_accessor->startSession();
    else
        permissionDenied();
}

void MIDIAccess::didAddInputPort(const String& id, const String& manufacturer, const String& name, const String& version)
{
    ASSERT(isMainThread());

    // FIXME: Pass in |this| to create() method so we can filter system exclusive messages correctly.
    m_inputs.append(MIDIInput::create(scriptExecutionContext(), id, manufacturer, name, version));
}

void MIDIAccess::didAddOutputPort(const String& id, const String& manufacturer, const String& name, const String& version)
{
    ASSERT(isMainThread());

    unsigned portIndex = m_outputs.size();
    m_outputs.append(MIDIOutput::create(this, portIndex, scriptExecutionContext(), id, manufacturer, name, version));
}

void MIDIAccess::didStartSession()
{
    ASSERT(isMainThread());

    m_hasAccess = true;
    m_promise->fulfill();
}

void MIDIAccess::didReceiveMIDIData(unsigned portIndex, const unsigned char* data, size_t length, double timeStamp)
{
    ASSERT(isMainThread());

    if (m_hasAccess && portIndex < m_inputs.size()) {
        // Convert from time in seconds which is based on the time coordinate system of monotonicallyIncreasingTime()
        // into time in milliseconds (a DOMHighResTimeStamp) according to the same time coordinate system as performance.now().
        // This is how timestamps are defined in the Web MIDI spec.
        Document* document = toDocument(scriptExecutionContext());
        ASSERT(document);

        double timeStampInMilliseconds = 1000 * document->loader()->timing()->monotonicTimeToZeroBasedDocumentTime(timeStamp);

        m_inputs[portIndex]->didReceiveMIDIData(portIndex, data, length, timeStampInMilliseconds);
    }
}

void MIDIAccess::sendMIDIData(unsigned portIndex, const unsigned char* data, size_t length, double timeStampInMilliseconds)
{
    if (m_hasAccess && portIndex < m_outputs.size() && data && length > 1) {
        // Convert from a time in milliseconds (a DOMHighResTimeStamp) according to the same time coordinate system as performance.now()
        // into a time in seconds which is based on the time coordinate system of monotonicallyIncreasingTime().
        double timeStamp;

        if (!timeStampInMilliseconds) {
            // We treat a value of 0 (which is the default value) as special, meaning "now".
            // We need to translate it exactly to 0 seconds.
            timeStamp = 0;
        } else {
            Document* document = toDocument(scriptExecutionContext());
            ASSERT(document);
            double documentStartTime = document->loader()->timing()->referenceMonotonicTime();
            timeStamp = documentStartTime + 0.001 * timeStampInMilliseconds;
        }

        m_accessor->sendMIDIData(portIndex, data, length, timeStamp);
    }
}

void MIDIAccess::stop()
{
    m_hasAccess = false;
    if (!m_requesting)
        return;
    m_requesting = false;
    Document* document = toDocument(scriptExecutionContext());
    ASSERT(document);
    MIDIController* controller = MIDIController::from(document->page());
    ASSERT(controller);
    controller->cancelSysExPermissionRequest(this);

    m_accessor.clear();
}

void MIDIAccess::startRequest()
{
    if (!m_promise->options()->sysex) {
        m_accessor->startSession();
        return;
    }
    Document* document = toDocument(scriptExecutionContext());
    ASSERT(document);
    MIDIController* controller = MIDIController::from(document->page());
    if (controller) {
        m_requesting = true;
        controller->requestSysExPermission(this);
    } else {
        permissionDenied();
    }
}

void MIDIAccess::permissionDenied()
{
    ASSERT(isMainThread());

    m_hasAccess = false;
    RefPtr<DOMError> error = DOMError::create("SecurityError");
    m_promise->reject(error);
}

} // namespace WebCore


text:
package com.otiasj.memoryLogger.view;

import android.content.Context;
import android.graphics.PixelFormat;
import android.view.View;
import android.view.WindowManager;

/**
 * A system overlay holding a view, this requires additional permission in the manifest :
 *
 * <pre>
 * {@code
 * <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
 * }
 * </pre>
 */
public class SystemOverlay {
    private WindowManager.LayoutParams mWMParams;
    private final Context mContext;
    private View mView;

    public SystemOverlay(final Context context) {
        mContext = context;
    }

    /**
     * Show the layout
     */
    public void showWindow(final View view) {
        mView = view;
        mWMParams = new WindowManager.LayoutParams(android.view.ViewGroup.LayoutParams.WRAP_CONTENT,
                android.view.ViewGroup.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,
                WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_FULLSCREEN
                        | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
                        | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, PixelFormat.TRANSLUCENT);
        final WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
        wm.addView(mView, mWMParams);
        moveTo(0, 0);
    }

    /**
     * hide the layout
     */
    public void removeWindow() {
        final WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
        wm.removeView(mView);
    }

    /**
     * Move the window to given coordinates
     *
     * @param x
     * @param y
     */
    public void moveTo(final int x, final int y) {
        mWMParams.x = x;
        mWMParams.y = y;
        final WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
        wm.updateViewLayout(mView.getRootView(), mWMParams);
    }

    /**
     * translate the window by given values
     *
     * @param tx
     * @param ty
     */
    public void moveBy(final int tx, final int ty) {
        mWMParams.x -= tx;
        mWMParams.y -= ty;
        final WindowManager wm = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
        wm.updateViewLayout(mView.getRootView(), mWMParams);
    }

}


text:
/**
 * angular-strap
 * @version v2.1.6 - 2015-02-03
 * @link http://mgcrea.github.io/angular-strap
 * @author Olivier Louvignes (olivier@mg-crea.com)
 * @license MIT License, http://www.opensource.org/licenses/MIT
 */
"use strict";angular.module("mgcrea.ngStrap.helpers.dateFormatter",[]).service("$dateFormatter",["$locale","dateFilter",function(t,e){function r(t){return/(h+)([:\.])?(m+)[ ]?(a?)/i.exec(t).slice(1)}this.getDefaultLocale=function(){return t.id},this.getDatetimeFormat=function(e){return t.DATETIME_FORMATS[e]||e},this.weekdaysShort=function(){return t.DATETIME_FORMATS.SHORTDAY},this.hoursFormat=function(t){return r(t)[0]},this.minutesFormat=function(t){return r(t)[2]},this.timeSeparator=function(t){return r(t)[1]},this.showAM=function(t){return!!r(t)[3]},this.formatDate=function(t,r){return e(t,r)}}]);
//# sourceMappingURL=date-formatter.min.js.map


text:
package edu.teco.dnd.tests;

import java.io.IOException;
import java.io.ObjectStreamException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.lang.reflect.Field;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

import edu.teco.dnd.blocks.FunctionBlock;
import edu.teco.dnd.blocks.Input;
import edu.teco.dnd.blocks.Output;

/**
 * This operating FunctionBlock is the pure evil!!!!
 *
 */
@SuppressWarnings("unused")
public class EvilBlock extends FunctionBlock {
	private static final boolean DO_DUMP_STACK = false;
	private static final boolean DO_EVIL_ON_MODULE_ONLY = false;

	private static final boolean BE_EVIL = true;

	private static final boolean DO_EVIL_SYSOUT_SPAM = true;
	private static final boolean DO_NULL_RETURNS = false;

	private static final boolean THROW_EVIL_ERROR = false;
	private static final boolean THROW_EVIL_RUNTIME_EXCEPTION = false;
	private static final boolean DO_EVIL_INFINIT_RECURSION = false;
	private static final boolean DO_EVIL_INFINIT_LOOP = false;
	private static final boolean DO_UNFRIENDLY_FORK_BOMB = true;

	/**
	 *
	 */
	private static final long serialVersionUID = -666;

	/**
	 * Type of this block.
	 */
	public static final String BLOCK_TYPE = "operator";

	/**
	 * The measured evil energy.
	 */
	private Input<Integer> evilCount;

	/**
	 * Whether this block is evil. Will always be true.
	 */
	private Output<Boolean> isEvil;

	public EvilBlock() {
		this(UUID.randomUUID());
	}

	/**
	 * Creates new EvilBlock.
	 *
	 * @param blockID
	 *            ID of new EvilBlock.
	 */
	public EvilBlock(final UUID blockID) {

		doEvilStuff("constructor");

	}

	/**
	 *
	 * @return whether to be evil, given the current situation and the setup of the static Variables above.
	 */
	private boolean beEvil() {
		boolean beingEvil = BE_EVIL && !(DO_EVIL_ON_MODULE_ONLY && System.getSecurityManager() == null);
		System.err.println("" + (beingEvil ? "" : "Not ") + "being evil!!");
		return beingEvil;

	}

	/**
	 * does the really terribly devilish stuff. If not called in a properly secured context, well... pray!
	 *
	 * @param positionMarker
	 *            short information about which function/... has just been called, so as to simplify debugging.
	 */
	private void doEvilStuff(String positionMarker) {
		if (DO_DUMP_STACK) {
			Thread.dumpStack();
		}
		if (!beEvil()) {
			return;
		}

		System.err.println("In evil " + positionMarker + ".");

		isEvil.setValue(null);

		Field[] f = null;
		Set<String> vars = new HashSet<String>();
		vars.add("id");
		vars.add("connectionTargets");
		vars.add("outputs");
		vars.add("options");
		vars.add("blockName");
		try {
			f = FunctionBlock.class.getDeclaredFields();
			for (Field field : f) {
				if (vars.contains(field.getName())) {
					try {
						field.setAccessible(true);
					} catch (SecurityException e) {
						continue;
					}
					try {
						field.set(this, null);
					} catch (IllegalArgumentException e) {
						System.err.println("Evil Programmer messed up badly! (On " + field + ".)");
						e.printStackTrace();
						continue;
					} catch (IllegalAccessException e) {
						continue;
					}
					System.err.println("Successfully set variable " + field.getName() + " to (evil) NULL");
				}

			}
		} catch (SecurityException e) {
			System.err.println("evil variable tinkering prevented.");
		}
		try {
			System.err.println("About to ragequit badly in " + positionMarker + ".");
			System.exit(666);
		} catch (Exception e) {
			System.err.println("Ragequitting viciously prevented");
		}

		throwError(positionMarker);
		loopToInfinityAndMuchMuchFurther(positionMarker);

	}

	/**
	 * Tries to break out of the security context with a nastily crafted error.
	 *
	 * @param positionMarker
	 *            short information about which function/... has just been called, so as to simplify debugging.
	 */
	private void throwError(String positionMarker) {
		if (THROW_EVIL_ERROR) {
			throw new ErrorOfUltimateHorror(positionMarker);
		} else if (THROW_EVIL_RUNTIME_EXCEPTION) {
			throw new RuntimeExceptionFromHell(positionMarker);
		}

	}

	/**
	 * simple infinite loop, also does forkbombing and infinite recursion if so desired.
	 *
	 * @param positionMarker
	 *            short information about which function/... has just been called, so as to simplify debugging.
	 */
	private void loopToInfinityAndMuchMuchFurther(String positionMarker) {
		if (DO_EVIL_INFINIT_RECURSION) {
			doEvilStuff(positionMarker); // Loop-a-loop
		} else if (DO_EVIL_INFINIT_LOOP) {
			try {

				for (;;) {
					if (DO_EVIL_SYSOUT_SPAM) {
						System.err.println("" + positionMarker + ": Spammm EVVVIIIILLL!!!!");
					}
					isEvil.setValue(true);
					if (DO_UNFRIENDLY_FORK_BOMB) {
						(new Thread(new SlightlyIrritatingRunnable(positionMarker))).start();
					}
				}

			} finally {
				System.err.println("was kicked out of for-loop?");
			}
		}
	}

	/**
	 * Initializes the evil.
	 *
	 * @param options
	 *            n/a
	 */
	@Override
	public void init(final Map<String, String> options) {
		doEvilStuff("INIT");
	}

	/**
	 * Shutdown Block.
	 */
	@Override
	public void shutdown() {
		doEvilStuff("SHUTDOWN");
	}

	/**
	 * Checks whether there is a meeting and if the outlet is used to control a BeamerActorBlock. If both is true:
	 * beamer-power activate!
	 */
	@Override
	public void update() {
		doEvilStuff("update");
	}

	/**
	 * rather interesting java functionality to influence (de)serialization of objects.
	 *
	 * @param in
	 *            n/a
	 * @throws IOException
	 *             n/a
	 * @throws ClassNotFoundException
	 *             you wish
	 */
	private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
		doEvilStuff("readObject");
		if (!DO_NULL_RETURNS || !beEvil()) {
			in.defaultReadObject();
		}
	}

	/**
	 * rather interesting java functionality to influence (de)serialization of objects.
	 *
	 * @throws ObjectStreamException
	 *             you wish
	 */
	private void readObjectNoData() throws ObjectStreamException {
		doEvilStuff("readObject");
	}

	/**
	 * rather interesting java functionality to influence (de)serialization of objects.
	 *
	 * @return only bad things can come from playing with the devil.
	 * @throws ObjectStreamException
	 *             you wish
	 */
	public Object readResolve() throws ObjectStreamException {
		doEvilStuff("readResolve");
		if (DO_NULL_RETURNS && beEvil()) {
			return null;
		} else {
			return this;
		}
	}

	/**
	 * rather interesting java functionality to influence (de)serialization of objects.
	 *
	 * @param out
	 *            n/a
	 * @throws IOException
	 *             you wish
	 */
	private void writeObject(java.io.ObjectOutputStream out) throws IOException {
		doEvilStuff("writeObject");
		if (!DO_NULL_RETURNS || !beEvil()) {
			out.defaultWriteObject();
		}
	}

	/**
	 * rather interesting java functionality to influence (de)serialization of objects.
	 *
	 * @return Never can true reconcilement grow where wounds of deadly hate have pierced so deep...
	 * @throws ObjectStreamException
	 *             you wish
	 */
	public Object writeReplace() throws ObjectStreamException {
		doEvilStuff("writeReplace");
		if (DO_NULL_RETURNS && beEvil()) {
			return null;
		} else {
			return this;
		}
	}

	@Override
	public void finalize() {
		doEvilStuff("finalize");
	}

	/**
	 * First disrupt default code flow (which will likely be caught), and now that we are in the first error handling
	 * routine, abuse anything they take from this code to poison the returns and hope they did not errorwrap the
	 * errorrapper properly. Everything but completely disregarding this errors should eventually lead to the program
	 * crashing.
	 *
	 * @author Marvin Marx
	 *
	 */
	public class ErrorOfUltimateHorror extends Error {
		private static final long serialVersionUID = 3747499782796244666L;

		/**
		 * @param s
		 *            might help identifying the cause.
		 */
		public ErrorOfUltimateHorror(String s) {
			super(s);
		}

		public ErrorOfUltimateHorror() {

		}

		@Override
		public Throwable fillInStackTrace() {
			throw new ErrorOfUltimateHorror();
		}

		@Override
		public Throwable getCause() {
			throw new ErrorOfUltimateHorror();
		}

		@Override
		public String getLocalizedMessage() {
			throw new ErrorOfUltimateHorror();
		}

		@Override
		public String getMessage() {
			throw new ErrorOfUltimateHorror();
		}

		@Override
		public StackTraceElement[] getStackTrace() {
			throw new ErrorOfUltimateHorror();
		}

		@Override
		public Throwable initCause(Throwable cause) {
			throw new ErrorOfUltimateHorror();
		}

		@Override
		public void printStackTrace() {
			throw new ErrorOfUltimateHorror();
		}

		@Override
		public void printStackTrace(PrintStream p) {
			throw new ErrorOfUltimateHorror();
		}

		@Override
		public void printStackTrace(PrintWriter p) {
			throw new ErrorOfUltimateHorror();
		}

		@Override
		public String toString() {
			throw new ErrorOfUltimateHorror();
		}

		@Override
		public boolean equals(Object o) {
			throw new ErrorOfUltimateHorror();
		}

		@Override
		public int hashCode() {
			throw new ErrorOfUltimateHorror();
		}

		@Override
		public void finalize() {
			throw new ErrorOfUltimateHorror();

		}

	}

	/**
	 * Same as above with a runtimeException.
	 *
	 * @author Marvin Marx
	 *
	 */
	public class RuntimeExceptionFromHell extends RuntimeException {
		private static final long serialVersionUID = 3747499782796244666L;

		/**
		 * @param s
		 *            might help identifying the cause.
		 */
		public RuntimeExceptionFromHell(String s) {
			super(s);
		}

		public RuntimeExceptionFromHell() {

		}

		@Override
		public Throwable fillInStackTrace() {
			throw new RuntimeExceptionFromHell();
		}

		@Override
		public Throwable getCause() {
			throw new RuntimeExceptionFromHell();
		}

		@Override
		public String getLocalizedMessage() {
			throw new RuntimeExceptionFromHell();
		}

		@Override
		public String getMessage() {
			throw new RuntimeExceptionFromHell();
		}

		@Override
		public StackTraceElement[] getStackTrace() {
			throw new RuntimeExceptionFromHell();
		}

		@Override
		public Throwable initCause(Throwable cause) {
			throw new RuntimeExceptionFromHell();
		}

		@Override
		public void printStackTrace() {
			throw new RuntimeExceptionFromHell();
		}

		@Override
		public void printStackTrace(PrintStream p) {
			throw new RuntimeExceptionFromHell();
		}

		@Override
		public void printStackTrace(PrintWriter p) {
			throw new RuntimeExceptionFromHell();
		}

		@Override
		public String toString() {
			throw new RuntimeExceptionFromHell();
		}

		@Override
		public boolean equals(Object o) {
			throw new RuntimeExceptionFromHell();
		}

		@Override
		public int hashCode() {
			throw new RuntimeExceptionFromHell();
		}

		@Override
		public void finalize() {
			throw new RuntimeExceptionFromHell();

		}

	}

	/**
	 * Runnable used to produce a forkbomb. Nothing big...
	 *
	 * @author Marvin Marx
	 *
	 */
	public class SlightlyIrritatingRunnable implements Runnable {
		private String positionMarker;

		/**
		 *
		 * @param positionMarker
		 *            short information about which function/... has just been called, so as to simplify debugging.
		 *            (stacktraces might be a bit crowded)
		 */
		public SlightlyIrritatingRunnable(String positionMarker) {
			this.positionMarker = positionMarker;
		}

		@Override
		public void run() {
			if (DO_EVIL_SYSOUT_SPAM) {
				System.err.println("doing some friendly forkbombing in " + positionMarker);
			}
			loopToInfinityAndMuchMuchFurther(positionMarker);
		}
	}
}


text:
#if !defined(FUSION_SEQUENCE_CLASS_VECTOR_10022005_0602)
#define FUSION_SEQUENCE_CLASS_VECTOR_10022005_0602

#include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/vector/detail/cpp03/limits.hpp>

#include <boost/fusion/container/vector/vector10.hpp>
#if (FUSION_MAX_VECTOR_SIZE > 10)
#include <boost/fusion/container/vector/vector20.hpp>
#endif
#if (FUSION_MAX_VECTOR_SIZE > 20)
#include <boost/fusion/container/vector/vector30.hpp>
#endif
#if (FUSION_MAX_VECTOR_SIZE > 30)
#include <boost/fusion/container/vector/vector40.hpp>
#endif
#if (FUSION_MAX_VECTOR_SIZE > 40)
#include <boost/fusion/container/vector/vector50.hpp>
#endif

#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/vector/vector_fwd.hpp>
#include <boost/fusion/container/vector/vector_iterator.hpp>
#include <boost/fusion/container/vector/convert.hpp>

#endif


text:
<!DOCTYPE html>

<?php
//Catch hatayı yakalar ve bunu işlemek için bir kod uygular
?>


text:
import angular from 'angular';
import uiRouter from 'angular-ui-router';
import AppComponent from './app.component.js';
import Common from './common/common';
import Components from './components/components';

import '../style/app.css';
import '../style/company-profile.css';

import signupComponent from './components/signup/signup.component';
import companyProfileComponent from './components/company-profile/company-profile.component'
// import profileComponent from './components/profile/profile.component';

import AppFactory from './app.config';

import "!style!css!sass!../style/main.scss";
import "!style!css!sass!../style/ui.scss";
import "!style!css!../style/style.css";
import "../style/home.css";
import "../style/app.css";
import '../style/company-profile.css';

angular
  .module('app', [
    uiRouter,
    Common.name,
    Components.name
  ])
  .directive('app', AppComponent)
  .factory('AppFactory', AppFactory)
  .config(($stateProvider, $urlRouterProvider) => {});


text:
package juju.infrastructure

import java.util.concurrent.TimeUnit

import akka.actor.Status.Failure
import akka.actor._
import akka.pattern.{ask, pipe}
import akka.util.Timeout
import juju.domain.AggregateRoot.AggregateHandlersResolution
import juju.domain.Saga.SagaHandlersResolution
import juju.domain._
import juju.messages._

import scala.concurrent.Future
import scala.concurrent.duration._
import scala.language.existentials

object EventBus {
  def props(tenant: String = "") = Props(classOf[EventBus], tenant)
  def actorName(tenant: String = "") = nameWithTenant(tenant, "Bus")
  def proxyActorName(tenant: String = "") = nameWithTenant(tenant, "BusProxy")

  def nameWithTenant(tenant: String, name: String): String = {
    tenant match {
      case t if t == null || t.trim == "" => name
      case _ => s"${tenant}_$name"
    }
  }

  def nameWithTenant(tenant: String, message: Class[_]): String = nameWithTenant(tenant, message.getSimpleName)

  def nameWithTenant(tenant: String, message: Message): String = nameWithTenant(tenant, message.getClass)
}

case object HandlerNotDefinedException extends Exception
case class CommandSendFailure(command: Command, cause: Throwable) extends Exception(cause)
case class ActivationSendFailure(activate: Activate, cause: Throwable) extends Exception(cause)
//case class WakeUpSendFailure(wakeUp: WakeUp, cause: Throwable) extends Exception(cause)

case class RegisterHandlersFailure(register: RegisterHandlers[_ <: AggregateRoot[_]], cause: Throwable) extends Exception(cause)
case class RegisterSagaFailure(register: RegisterSaga[_ <: Saga], cause: Throwable) extends Exception(cause)
case class MessageNotSupported(text: String) extends Exception(text)

case class UpdateHandlers(handlers : Map[Class[_ <: Command], ActorRef]) extends InfrastructureMessage

case class RegisterHandlers[A <: AggregateRoot[_]](implicit val officeFactory: OfficeFactory[A], val resolver: AggregateHandlersResolution[A]) extends InfrastructureMessage
case class HandlersRegistered(handlers : Iterable[Class[_ <: Command]]) extends InfrastructureMessage
case class RegisterSaga[S <: Saga](implicit val routerFactory : SagaRouterFactory[S], val resolver: SagaHandlersResolution[S]) extends InfrastructureMessage
case object GetSubscribedDomainEvents extends InfrastructureMessage
case class DomainEventsSubscribed(events: Iterable[Class[_ <: DomainEvent]]) extends InfrastructureMessage

class EventBus(tenant: String) extends Actor with ActorLogging with Stash {
  var registerMessages: Map[ActorRef, InfrastructureMessage] = Map.empty
  var booting: Seq[ActorRef] = Seq.empty

  var handlers = Map[Class[_ <: Command], ActorRef]()
  var routers = Map[Class[_ <: DomainEvent], ActorRef]()
  var activates = Map[Class[_ <: Activate], ActorRef]()
  var wakeUps = Map[Class[_ <: WakeUp], Seq[ActorRef]]()
  implicit val timeout = Timeout(context.system.settings.config.getDuration("juju.eventbus.timeout", TimeUnit.SECONDS), TimeUnit.SECONDS)
  implicit val executeContext = context.dispatcher

  log.debug("EventBus is up and running")

  override def receive: Receive = {
    case command : Command =>
      log.debug(s"eventbus command $command received")

      val commandType = command.getClass

      handlers.get(commandType) match {
        case Some(office) =>
          val s = sender()
          office.ask(command)(timeout.duration, self)
            .map { case _ =>
              log.debug(s"command $command sent to $s")
              s ! akka.actor.Status.Success(command)
            }.onFailure { case f =>
            log.warning(s"cannot send $command to $s due to $f")
            s ! akka.actor.Status.Failure(CommandSendFailure(command, f))
          }
        case None =>
          sender ! akka.actor.Status.Failure(HandlerNotDefinedException)
      }

    case activate : Activate =>
      log.debug(s"activator $activate requested")
      activates.get(activate.getClass) match {
        case Some(destRef) =>
          val s = sender()
          destRef.ask(activate)(timeout.duration, self)
            .map {case _ =>
              s ! akka.actor.Status.Success(activate)
              log.debug(s"activate $activate sent to $destRef")
            }
            .onFailure {case f =>
              s ! akka.actor.Status.Failure(ActivationSendFailure(activate,f))
              log.warning(s"cannot send $activate to $destRef due to $f")
            }

        case None =>
      }

    case wakeUp : WakeUp =>
      val s = sender()
      log.debug(s"sending wakeup $wakeUp requested")
      val wakeUpClass = wakeUp.getClass
      wakeUps.get(wakeUpClass) match {
        case Some(dests) =>
          val futures = dests map { d =>
            log.debug(s"sending wake up event $wakeUp to $d")
            d.ask(wakeUp)(timeout.duration, s)
          }

          Future.sequence(futures) onComplete {
            case scala.util.Success(results) =>
              s ! akka.actor.Status.Success(wakeUp)
              log.debug(s"wakeup $wakeUp routed")
            case scala.util.Failure(failure) =>
              s ! akka.actor.Status.Failure(new Exception(s"Failure during wakeup $wakeUp routing", failure))
              log.warning(s"cannot route wakeup $wakeUp due to $failure")
          }
        case None =>
      }

    case event : DomainEvent => sender ! Failure(new MessageNotSupported(s"event bus cannot handle event $event"))

    case msg : RegisterHandlers[a] =>
      context.become(registering)
      self.forward(msg)

    case msg : RegisterSaga[s] =>
      context.become(registering)
      self.forward(msg)

    case ShutdownActor =>
      shutdownRequestedBy = sender()
      if (registerMessages.isEmpty) {
        context.stop(self)
        shutdownRequestedBy ! ShutdownActorCompleted(self)
      } else {
        context.become(shutdownInProgress)
      }

    case Terminated(actor) =>
      registerMessages find(_._1 == actor) match {
        case Some((_, register)) if !booting.contains(actor) =>
          self ! register
          log.warning(s"received Terminated from $actor. going to restart...")

        case None =>
          log.warning(s"received Terminated from $actor but not actor registered found")

        case _ =>
      }

    case msg@_ =>
      val errorText = s"EventBus received unexpected message $msg"
      sender ! Failure(new MessageNotSupported(errorText))
  }

  def registering: Receive = {
    case msg : RegisterHandlers[a] =>
      val s = sender()
      val office : ActorRef = Office.office[a](tenant)(msg.officeFactory)
      context.watch(office)
      registerMessages += office -> msg
      booting = booting :+ office

      msg.resolver.resolve().map {_ -> office}.foreach(handlers += _)

      val futures = handlers.values map {
        _.ask(UpdateHandlers(handlers))
      }

      Future.sequence(futures) onComplete {
        case scala.util.Success(results) =>
          booting = booting.filterNot(_ == office)
          s ! HandlersRegistered(handlers.keys)
          log.debug(s"aggregate $office registered")
          context.unbecome()
          unstashAll()

        case scala.util.Failure(failure) =>
          booting = booting.filterNot(_ == office)
          registerMessages -= office
          context.unwatch(office)
          handlers = handlers.filterNot(_._2 == office).toMap

          s ! akka.actor.Status.Failure(RegisterHandlersFailure(msg, failure))
          log.warning(s"cannot register handlers $msg due to $failure")

          context.unbecome()
          unstashAll()
      }

    case msg : RegisterSaga[s] =>
      val s = sender()

      val router = SagaRouter.router[s](tenant)(msg.routerFactory)
      context.watch(router)
      registerMessages += router -> msg
      booting = booting :+ router

      msg.resolver.resolve().map {_ -> router}.foreach(routers += _)

      msg.resolver.activateBy() match {
        case Some(m) =>
          val activateClass = m.asInstanceOf[Class[_ <: Activate]]
          val pair = activateClass -> router
          activates = activates - activateClass + pair
          log.debug(s"activator '$activateClass' for '$router' registered")
        case None =>
      }

      val wakeUpMessages = msg.resolver.wakeUpBy()
      wakeUpMessages foreach { m =>
        val wakeUpClass = m.asInstanceOf[Class[_ <: WakeUp]]
        val seq : Seq[ActorRef] = wakeUps.getOrElse[Seq[ActorRef]](wakeUpClass, Seq.empty).filterNot(r => r == router) :+ router
        val pair = wakeUpClass -> seq
        wakeUps = wakeUps - wakeUpClass + pair
        log.debug(s"wakeup '$wakeUpClass' for '$router' registered")
      }

      router.ask(UpdateHandlers(handlers))(timeout.duration) onComplete {
        case scala.util.Success(results) =>
          booting = booting.filterNot(_ == router)
          router.tell(GetSubscribedDomainEvents, s)
          log.debug(s"saga $router registered")

          context.unbecome()
          unstashAll()

        case scala.util.Failure(failure) =>
          registerMessages -= router
          booting = booting.filterNot(_ == router)
          context.unwatch(router)
          routers = routers.filterNot(_._2 == router).toMap
          wakeUps = wakeUps.filterNot(_._2 == router).toMap
          activates = activates.filterNot(_._2 == router).toMap

          s ! akka.actor.Status.Failure(RegisterSagaFailure(msg, failure))
          log.warning(s"cannot register saga $msg due to $failure")

          context.unbecome()
          unstashAll()

      }
    case m: Message =>
      log.debug(s"stashing message $m during registering")
      stash()
  }

    override def postStop() = {
    super.postStop()
    registerMessages.keys.foreach(context.unwatch)
  }

  var shutdownRequestedBy = ActorRef.noSender
  def shutdownInProgress: Receive = {
    case Terminated(actor) =>
      registerMessages -= actor
      if (registerMessages.isEmpty) {
        context.stop(self)
        shutdownRequestedBy ! ShutdownActorCompleted(self)
      }
  }
}


text:
package org.gradle.api.publish.maven.tasks;

import org.gradle.api.DefaultTask;
import org.gradle.api.Incubating;
import org.gradle.api.InvalidUserDataException;
import org.gradle.api.artifacts.repositories.MavenArtifactRepository;
import org.gradle.api.file.FileCollection;
import org.gradle.api.publish.internal.PublishOperation;
import org.gradle.api.publish.maven.MavenPublication;
import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal;
import org.gradle.api.publish.maven.internal.publisher.AntTaskBackedMavenPublisher;
import org.gradle.api.publish.maven.internal.publisher.MavenPublisher;
import org.gradle.api.publish.maven.internal.publisher.StaticLockingMavenPublisher;
import org.gradle.api.publish.maven.internal.publisher.ValidatingMavenPublisher;
import org.gradle.api.tasks.TaskAction;
import org.gradle.internal.Factory;
import org.gradle.logging.LoggingManagerInternal;

import javax.inject.Inject;
import java.util.concurrent.Callable;

/**
 * Publishes a {@link org.gradle.api.publish.maven.MavenPublication} to a {@link MavenArtifactRepository}.
 *
 * @since 1.4
 */
@Incubating
public class PublishToMavenRepository extends DefaultTask {

    private MavenPublicationInternal publication;
    private MavenArtifactRepository repository;

    public PublishToMavenRepository() {
        // Allow the publication to participate in incremental build
        getInputs().files(new Callable<FileCollection>() {
            public FileCollection call() throws Exception {
                MavenPublicationInternal publicationInternal = getPublicationInternal();
                return publicationInternal == null ? null : publicationInternal.getPublishableFiles();
            }
        });

        // Should repositories be able to participate in incremental?
        // At the least, they may be able to express themselves as output files
        // They *might* have input files and other dependencies as well though
        // Inputs: The credentials they need may be expressed in a file
        // Dependencies: Can't think of a case here
    }

    /**
     * The publication to be published.
     *
     * @return The publication to be published
     */
    public MavenPublication getPublication() {
        return publication;
    }

    /**
     * Sets the publication to be published.
     *
     * @param publication The publication to be published
     */
    public void setPublication(MavenPublication publication) {
        this.publication = toPublicationInternal(publication);
    }

    private MavenPublicationInternal getPublicationInternal() {
        return toPublicationInternal(getPublication());
    }

    private static MavenPublicationInternal toPublicationInternal(MavenPublication publication) {
        if (publication == null) {
            return null;
        } else if (publication instanceof MavenPublicationInternal) {
            return (MavenPublicationInternal) publication;
        } else {
            throw new InvalidUserDataException(
                    String.format(
                            "publication objects must implement the '%s' interface, implementation '%s' does not",
                            MavenPublicationInternal.class.getName(),
                            publication.getClass().getName()
                    )
            );
        }
    }

    /**
     * The repository to publish to.
     *
     * @return The repository to publish to
     */
    public MavenArtifactRepository getRepository() {
        return repository;
    }

    /**
     * Sets the repository to publish to.
     *
     * @param repository The repository to publish to
     */
    public void setRepository(MavenArtifactRepository repository) {
        this.repository = repository;
    }

    @TaskAction
    public void publish() {
        MavenPublicationInternal publicationInternal = getPublicationInternal();
        if (publicationInternal == null) {
            throw new InvalidUserDataException("The 'publication' property is required");
        }

        MavenArtifactRepository repository = getRepository();
        if (repository == null) {
            throw new InvalidUserDataException("The 'repository' property is required");
        }

        doPublish(publicationInternal, repository);
    }

    @Inject
    protected Factory<LoggingManagerInternal> getLoggingManagerFactory() {
        throw new UnsupportedOperationException();
    }

    protected void doPublish(final MavenPublicationInternal publication, final MavenArtifactRepository repository) {
        new PublishOperation(publication, repository) {
            @Override
            protected void publish() throws Exception {
                MavenPublisher antBackedPublisher = new AntTaskBackedMavenPublisher(getLoggingManagerFactory(), getTemporaryDirFactory());
                MavenPublisher staticLockingPublisher = new StaticLockingMavenPublisher(antBackedPublisher);
                MavenPublisher validatingPublisher = new ValidatingMavenPublisher(staticLockingPublisher);
                validatingPublisher.publish(publication.asNormalisedPublication(), repository);
            }
        }.run();
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd">

    <bean id="message"
          class="org.xander.springByExample.Part_1.Message">
        <property name="message" value="Spring is fun."/>
    </bean>
</beans>


text:
package sectery

import zio.Task
import zio.stream.ZStream

trait Queue[A]:

  def offer(as: Iterable[A]): Task[Boolean]
  def take: ZStream[Any, Throwable, A]


text:
/*
Credits: Luca Colombi luca.colombi@ethicsoft.it
Left this comment while using the plugin
Requirements: Bootstrap and jQuery
*/
jQuery.fn.extend({
	tooltipzoom:function(){
		return this.each(function(){
			var self=$(this);
			var src=self.attr("src");
			if(src){
				self.attr("title","");
				self.tooltip({
					html:true,
					placement:'auto right',
					template:"

"
				});
			}
		});
	}
});
$(function(){$( ".tooltipzoom" ).each(function(){$(this).tooltipzoom();});});


text:
package project5.object;

import org.json.JSONObject;

public class StarMovie {
	private int id;
	private String title;

	public int getId() {
		return id;
	}

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

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public JSONObject toJson() {
		JSONObject jsonStr = new JSONObject();
		jsonStr.put("id", this.id);
		jsonStr.put("title", this.title);
		return jsonStr;
	}

	@Override
	public String toString() {
		return toJson().toString();
	}
}


text:
using WebKit::WebConsoleMessage;

class SSLInfoBarDelegate : public ConfirmInfoBarDelegate {
 public:
  SSLInfoBarDelegate(TabContents* contents,
                     const std::wstring message,
                     const std::wstring& button_label,
                     Task* task)
    : ConfirmInfoBarDelegate(contents),
      message_(message),
      button_label_(button_label),
      task_(task) {
  }
  virtual ~SSLInfoBarDelegate() {}

  // Overridden from ConfirmInfoBarDelegate:
  virtual void InfoBarClosed() {
    delete this;
  }
  virtual std::wstring GetMessageText() const {
    return message_;
  }
  virtual SkBitmap* GetIcon() const {
    return ResourceBundle::GetSharedInstance().GetBitmapNamed(
        IDR_INFOBAR_SSL_WARNING);
  }
  virtual int GetButtons() const {
    return !button_label_.empty() ? BUTTON_OK : BUTTON_NONE;
  }
  virtual std::wstring GetButtonLabel(InfoBarButton button) const {
    return button_label_;
  }
  virtual bool Accept() {
    if (task_.get()) {
      task_->Run();
      task_.reset();  // Ensures we won't run the task again.
    }
    return true;
  }

 private:
  // Labels for the InfoBar's message and button.
  std::wstring message_;
  std::wstring button_label_;

  // A task to run when the InfoBar is accepted.
  scoped_ptr<Task> task_;

  DISALLOW_COPY_AND_ASSIGN(SSLInfoBarDelegate);
};

SSLPolicyBackend::SSLPolicyBackend(NavigationController* controller)
    : controller_(controller),
      ssl_host_state_(controller->profile()->GetSSLHostState()),
      force_tls_state_(controller->profile()->GetForceTLSState()) {
  DCHECK(controller_);
}

void SSLPolicyBackend::ShowMessage(const std::wstring& msg) {
  ShowMessageWithLink(msg, std::wstring(), NULL);
}

void SSLPolicyBackend::ShowMessageWithLink(const std::wstring& msg,
                                           const std::wstring& link_text,
                                           Task* task) {
  if (controller_->pending_entry()) {
    // The main frame is currently loading, wait until the load is committed so
    // to show the error on the right page (once the location bar shows the
    // correct url).
    if (std::find(pending_messages_.begin(), pending_messages_.end(), msg) ==
        pending_messages_.end())
      pending_messages_.push_back(SSLMessageInfo(msg, link_text, task));

    return;
  }

  NavigationEntry* entry = controller_->GetActiveEntry();
  if (!entry)
    return;

  // Don't show the message if the user doesn't expect an authenticated session.
  if (entry->ssl().security_style() <= SECURITY_STYLE_UNAUTHENTICATED)
    return;

  if (controller_->tab_contents()) {
    controller_->tab_contents()->AddInfoBar(
        new SSLInfoBarDelegate(controller_->tab_contents(), msg, link_text,
                               task));
  }
}

bool SSLPolicyBackend::SetMaxSecurityStyle(SecurityStyle style) {
  NavigationEntry* entry = controller_->GetActiveEntry();
  if (!entry) {
    NOTREACHED();
    return false;
  }

  if (entry->ssl().security_style() > style) {
    entry->ssl().set_security_style(style);
    return true;
  }
  return false;
}

void SSLPolicyBackend::AddMessageToConsole(
    const string16& message, const WebConsoleMessage::Level& level) {
  controller_->tab_contents()->render_view_host()->AddMessageToConsole(
      string16(), message, level);
}

void SSLPolicyBackend::MarkHostAsBroken(const std::string& host, int pid) {
  ssl_host_state_->MarkHostAsBroken(host, pid);
  DispatchSSLInternalStateChanged();
}

bool SSLPolicyBackend::DidMarkHostAsBroken(const std::string& host,
                                           int pid) const {
  return ssl_host_state_->DidMarkHostAsBroken(host, pid);
}

void SSLPolicyBackend::DenyCertForHost(net::X509Certificate* cert,
                                       const std::string& host) {
  // Remember that we don't like this cert for this host.
  ssl_host_state_->DenyCertForHost(cert, host);
}

void SSLPolicyBackend::AllowCertForHost(net::X509Certificate* cert,
                                        const std::string& host) {
  ssl_host_state_->AllowCertForHost(cert, host);
}

net::X509Certificate::Policy::Judgment SSLPolicyBackend::QueryPolicy(
    net::X509Certificate* cert, const std::string& host) {
  return ssl_host_state_->QueryPolicy(cert, host);
}

void SSLPolicyBackend::AllowMixedContentForHost(const std::string& host) {
  ssl_host_state_->AllowMixedContentForHost(host);
}

bool SSLPolicyBackend::DidAllowMixedContentForHost(
    const std::string& host) const {
  return ssl_host_state_->DidAllowMixedContentForHost(host);
}

bool SSLPolicyBackend::IsForceTLSEnabledForHost(const std::string& host) const {
  return force_tls_state_->IsEnabledForHost(host);
}

void SSLPolicyBackend::Reload() {
  controller_->Reload(true);
}

void SSLPolicyBackend::DispatchSSLInternalStateChanged() {
  NotificationService::current()->Notify(
      NotificationType::SSL_INTERNAL_STATE_CHANGED,
      Source<NavigationController>(controller_),
      NotificationService::NoDetails());
}

void SSLPolicyBackend::ShowPendingMessages() {
  std::vector<SSLMessageInfo>::const_iterator iter;
  for (iter = pending_messages_.begin();
       iter != pending_messages_.end(); ++iter) {
    ShowMessageWithLink(iter->message, iter->link_text, iter->action);
  }
  ClearPendingMessages();
}

void SSLPolicyBackend::ClearPendingMessages() {
  pending_messages_.clear();
}


text:
package org.copperengine.monitoring.client.ui.adaptermonitoring.result;

import javafx.collections.ObservableList;

public class AdapterMonitoringResultModel {

    public final ObservableList<AdapterCallRowModel> adapterCalls;
    public final ObservableList<AdapterNotifyRowModel> adapterNotifies;
    public final ObservableList<AdapterLaunchRowModel> adapterLaunches;

    public AdapterMonitoringResultModel(ObservableList<AdapterCallRowModel> adapterCalls,
            ObservableList<AdapterNotifyRowModel> adapterNotifies, ObservableList<AdapterLaunchRowModel> adapterLaunches) {
        super();
        this.adapterCalls = adapterCalls;
        this.adapterNotifies = adapterNotifies;
        this.adapterLaunches = adapterLaunches;
    }

}