text:
package de.leanovate.swaggercheck.schema.model

import de.leanovate.swaggercheck.schema.adapter.NodeAdapter
import de.leanovate.swaggercheck.schema.model.formats.{IntegerFormats, NumberFormats, StringFormats, ValueFormat}

case class DefaultSchema(
                          root: Definition,
                          definitions: Map[String, Definition],
                          parameters: Map[String, Parameter],
                          stringFormats: Map[String, ValueFormat[String]] = StringFormats.defaultFormats,
                          integerFormats: Map[String, ValueFormat[BigInt]] = IntegerFormats.defaultFormats,
                          numberFormats: Map[String, ValueFormat[BigDecimal]] = NumberFormats.defaultFormats
                        ) extends Schema {
  override def findByRef(ref: String): Option[Definition] = {
    val simpleRef = if (ref.startsWith("#/definitions/")) ref.substring(14) else ref

    definitions.get(simpleRef)
  }

  override def findNumberFormat(name: String): Option[ValueFormat[BigDecimal]] = numberFormats.get(name)

  override def findIntegerFormat(name: String): Option[ValueFormat[BigInt]] = integerFormats.get(name)

  override def findStringFormat(name: String): Option[ValueFormat[String]] = stringFormats.get(name)

  /**
    * Add a self-defined string format.
    */
  def withStringFormats(formats: (String, ValueFormat[String])*): DefaultSchema =
    copy(stringFormats = stringFormats ++ Map(formats: _*))

  /**
    * Add a self-defined integer format.
    */
  def withIntegerFormats(formats: (String, ValueFormat[BigInt])*): DefaultSchema =
    copy(integerFormats = integerFormats ++ Map(formats: _*))

  /**
    * Add a self-defined number format.
    */
  def withNumberFormats(formats: (String, ValueFormat[BigDecimal])*): DefaultSchema =
    copy(numberFormats = numberFormats ++ Map(formats: _*))

  def validate[T](node: T)(implicit nodeAdapter: NodeAdapter[T]): ValidationResult =
    root.validate(this, JsonPath(), node)
}

object DefaultSchema {
  def build(
             schemaType: Option[String],
             allOf: Option[Seq[Definition]],
             enum: Option[List[String]],
             exclusiveMinimum: Option[Boolean],
             exclusiveMaximum: Option[Boolean],
             format: Option[String],
             items: Option[Definition],
             minItems: Option[Int],
             maxItems: Option[Int],
             minimum: Option[BigDecimal],
             maximum: Option[BigDecimal],
             minLength: Option[Int],
             maxLength: Option[Int],
             oneOf: Option[Seq[Definition]],
             pattern: Option[String],
             properties: Option[Map[String, Definition]],
             additionalProperties: Option[Either[Boolean, Definition]],
             required: Option[Set[String]],
             ref: Option[String],
             uniqueItems: Option[Boolean],
             definitions: Option[Map[String, Definition]],
             parameters: Option[Map[String, Parameter]]
           ): DefaultSchema = {
    DefaultSchema(
      Definition.build(schemaType, allOf, enum, exclusiveMinimum, exclusiveMaximum, format, items, minItems, maxItems,
        minimum, maximum, minLength, maxLength, oneOf, pattern, properties, additionalProperties, required, ref,
        uniqueItems),
      definitions.getOrElse(Map.empty),
      parameters.getOrElse(Map.empty)
    )
  }
}


text:
title: Sarah Brin
summary: Writer, curator (Autodesk Pier 9)
categories:
- curator
- mac
- writer
---

### Who are you, and what do you do?

I'm [Sarah Brin](http://sarahbrin.com/ "Sarah's website."), and I'm a curator specializing in technology, public space, and participation. I work at the [Autodesk Pier 9 workshop in San Francisco](http://www.autodesk.com/pier-9 "Autodesk's workshop in SF."), which is a fancy digital fabrication facility where I work with artists, public installations, and other experimental programs intended to delight and inspire people.

I also do a lot of extracurricular work around artist-made videogames and museums. I believe in popular media's potential for affecting cultural change, and a lot of my projects not-so-secretly hinge on that belief.

### What hardware do you use?

Despite working in a digital fabrication facility with a ton of sophisticated machinery, the hardware I use on a day-to-day basis is pretty simple! I use a [MacBook Air][macbook-air], a wireless [Evoluent 4 VerticalMouse][verticalmouse-wireless], a [Goldtouch laptop stand][go-travel], a [Logitech K810 external keyboard][k810] and a [24 in. Viewsonic LED monitor][va2445m-led]. And a wrist rest. The ergonomic stuff is pretty essential because I got carpal tunnel in both hands real bad when I was in [grad school](http://roski.usc.edu/ma/ "The Master of Arts program at USC."), and if I slack on my computer habits (or grip my phone too much), it comes back.

When I work from home, I am very, very dependent on my [Sonos PLAY:1][play-1] and my ever-slowing [iPhone 5s][iphone-5s]. I have a [Canon PIXMA MG5620 wireless printer][pixma-mg5620], and it's slower than I'd like.

### And what software?

Nothing too fancy. Everything I write, from grocery lists to magazine articles, starts as an email draft, either in [Outlook][] or [Gmail][]. I use both [Pages][] and [Word][] equally, same with [Excel][] and [Numbers][]. But for presentations, I only use [Keynote][]. I'm pretty dependent on [Tomato Timer][tomatotimer] for multitasking, and I keep my running to-do list on [Trello][]. I am extremely dependent on [Spotify][], [Chrome][] and [Sunrise][].

### What would be your dream setup?

My dream setup would have lots and lots of natural light, a good sound system and leafy plants. And a nice big labrador. I'd need a lot of table space so I could spread out all my dumb scribbly drafts, floor plans and reference books. (So far I'm just describing my friends' Steve and Michelle's house in Los Angeles - I've done all of my best writing while watching their dogs while they were on vacation!)

I'd like a proper desktop [iMac][], too. And more [colored pencils][premier-soft-core]. And more pictures of my friends.

[chrome]: https://www.google.com/intl/en/chrome/browser/ "A WebKit-based browser, where each tab runs in its own thread."
[excel]: https://products.office.com/en-us/excel "A spreadsheet application."
[gmail]: https://mail.google.com/mail/ "Web-based email."
[go-travel]: https://www.goldtouch.com/the-goldtouch-go-travel-notebook-tablet-stand/ "A laptop and tablet stand."
[imac]: https://www.apple.com/imac/ "An all-in-one computer."
[iphone-5s]: https://en.wikipedia.org/wiki/IPhone_5S "A smartphone."
[k810]: https://www.logitech.com/en-us/product/bluetooth-illuminated-keyboard-k810 "A multi-device Bluetooth keyboard."
[keynote]: https://www.apple.com/keynote/ "Presentation software for the Mac."
[macbook-air]: https://www.apple.com/macbook-air/ "A very thin laptop."
[numbers]: https://www.apple.com/numbers/ "A spreadsheet application for the Mac."
[outlook]: https://products.office.com/en-us/outlook/email-and-calendar-software-microsoft-outlook "An email, calendar and contact software suite."
[pages]: https://www.apple.com/pages/ "A Mac word processor and layout tool from Apple."
[pixma-mg5620]: https://www.usa.canon.com/internet/portal/us/home/products/details/printers/inkjet-multifunction/mg-series-inkjet/mg5620/ "An all-in-one printer."
[play-1]: http://www.sonos.com/shop/play1 "A wireless speaker."
[premier-soft-core]: http://www.prismacolor.com/products/colored-pencils/softcore-lead "Coloured pencils."
[spotify]: https://www.spotify.com/us/ "A music streaming service."
[sunrise]: https://itunes.apple.com/app/sunrise-calendar/id886106985 "A Mac app for viewing your Google Calendar."
[tomatotimer]: https://tomato-timer.com/ "A web-based Pomodoro timer."
[trello]: https://trello.com/ "A project management service."
[va2445m-led]: https://www.viewsonic.com/us/va2445m-led.html "A 24 inch monitor."
[verticalmouse-wireless]: https://evoluent.com/products/vm4rw/ "A unique wireless mouse."
[word]: https://products.office.com/en-us/word "A document editor."

redpajama_set_name: RedPajamaGithub


text:
var Point = require('../point/Point');
var TriangleToLine = require('./TriangleToLine');
var LineToLine = require('./LineToLine');

/**
 * Checks if a Triangle and a Line intersect, and returns the intersection points as a Point object array.
 *
 * The Line intersects the Triangle if it starts inside of it, ends inside of it, or crosses any of the Triangle's sides. Thus, the Triangle is considered "solid".
 *
 * @function Phaser.Geom.Intersects.GetTriangleToLine
 * @since 3.0.0
 *
 * @param {Phaser.Geom.Triangle} triangle - The Triangle to check with.
 * @param {Phaser.Geom.Line} line - The Line to check with.
 * @param {array} [out] - An optional array in which to store the points of intersection.
 *
 * @return {array} An array with the points of intersection if objects intersect, otherwise an empty array.
 */
var GetTriangleToLine = function (triangle, line, out)
{
    if (out === undefined) { out = []; }

    if (TriangleToLine(triangle, line))
    {
        var lineA = triangle.getLineA();
        var lineB = triangle.getLineB();
        var lineC = triangle.getLineC();

        var output = [ new Point(), new Point(), new Point() ];

        var result = [
            LineToLine(lineA, line, output[0]),
            LineToLine(lineB, line, output[1]),
            LineToLine(lineC, line, output[2])
        ];

        for (var i = 0; i < 3; i++)
        {
            if (result[i]) { out.push(output[i]); }
        }
    }

    return out;
};

module.exports = GetTriangleToLine;


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Meliola macrocarpa Mont.

### Remarks
null


text:
""" Defines a convenient mix-in class for implementing Qt frontends.
"""

class BaseFrontendMixin(object):
    """ A mix-in class for implementing Qt frontends.

    To handle messages of a particular type, frontends need only define an
    appropriate handler method. For example, to handle 'stream' messaged, define
    a '_handle_stream(msg)' method.
    """

    #---------------------------------------------------------------------------
    # 'BaseFrontendMixin' concrete interface
    #---------------------------------------------------------------------------
    _kernel_client = None
    _kernel_manager = None

    @property
    def kernel_client(self):
        """Returns the current kernel client."""
        return self._kernel_client

    @kernel_client.setter
    def kernel_client(self, kernel_client):
        """Disconnect from the current kernel client (if any) and set a new
            kernel client.
        """
        # Disconnect the old kernel client, if necessary.
        old_client = self._kernel_client
        if old_client is not None:
            old_client.started_channels.disconnect(self._started_channels)
            old_client.stopped_channels.disconnect(self._stopped_channels)

            # Disconnect the old kernel client's channels.
            old_client.iopub_channel.message_received.disconnect(self._dispatch)
            old_client.shell_channel.message_received.disconnect(self._dispatch)
            old_client.stdin_channel.message_received.disconnect(self._dispatch)
            old_client.hb_channel.kernel_died.disconnect(
                self._handle_kernel_died)

            # Handle the case where the old kernel client is still listening.
            if old_client.channels_running:
                self._stopped_channels()

        # Set the new kernel client.
        self._kernel_client = kernel_client
        if kernel_client is None:
            return

        # Connect the new kernel client.
        kernel_client.started_channels.connect(self._started_channels)
        kernel_client.stopped_channels.connect(self._stopped_channels)

        # Connect the new kernel client's channels.
        kernel_client.iopub_channel.message_received.connect(self._dispatch)
        kernel_client.shell_channel.message_received.connect(self._dispatch)
        kernel_client.stdin_channel.message_received.connect(self._dispatch)
        # hb_channel
        kernel_client.hb_channel.kernel_died.connect(self._handle_kernel_died)

        # Handle the case where the kernel client started channels before
        # we connected.
        if kernel_client.channels_running:
            self._started_channels()

    @property
    def kernel_manager(self):
        """The kernel manager, if any"""
        return self._kernel_manager

    @kernel_manager.setter
    def kernel_manager(self, kernel_manager):
        old_man = self._kernel_manager
        if old_man is not None:
            old_man.kernel_restarted.disconnect(self._handle_kernel_restarted)

        self._kernel_manager = kernel_manager
        if kernel_manager is None:
            return

        kernel_manager.kernel_restarted.connect(self._handle_kernel_restarted)

    #---------------------------------------------------------------------------
    # 'BaseFrontendMixin' abstract interface
    #---------------------------------------------------------------------------

    def _handle_kernel_died(self, since_last_heartbeat):
        """ This is called when the ``kernel_died`` signal is emitted.

        This method is called when the kernel heartbeat has not been
        active for a certain amount of time.
        This is a strictly passive notification -
        the kernel is likely being restarted by its KernelManager.

        Parameters
        ----------
        since_last_heartbeat : float
            The time since the heartbeat was last received.
        """

    def _handle_kernel_restarted(self):
        """ This is called when the ``kernel_restarted`` signal is emitted.

        This method is called when the kernel has been restarted by the
        autorestart mechanism.

        Parameters
        ----------
        since_last_heartbeat : float
            The time since the heartbeat was last received.
        """
    def _started_kernel(self):
        """Called when the KernelManager starts (or restarts) the kernel subprocess.
        Channels may or may not be running at this point.
        """

    def _started_channels(self):
        """ Called when the KernelManager channels have started listening or
            when the frontend is assigned an already listening KernelManager.
        """

    def _stopped_channels(self):
        """ Called when the KernelManager channels have stopped listening or
            when a listening KernelManager is removed from the frontend.
        """

    #---------------------------------------------------------------------------
    # 'BaseFrontendMixin' protected interface
    #---------------------------------------------------------------------------

    def _dispatch(self, msg):
        """ Calls the frontend handler associated with the message type of the
            given message.
        """
        msg_type = msg['header']['msg_type']
        handler = getattr(self, '_handle_' + msg_type, None)
        if handler:
            handler(msg)

    def from_here(self, msg):
        """Return whether a message is from this session"""
        session_id = self._kernel_client.session.session
        return msg['parent_header'].get("session", session_id) == session_id

    def include_output(self, msg):
        """Return whether we should include a given output message"""
        if self._hidden:
            return False
        from_here = self.from_here(msg)
        if msg['msg_type'] == 'execute_input':
            # only echo inputs not from here
            return self.include_other_output and not from_here

        if self.include_other_output:
            return True
        else:
            return from_here


text:
import { isSafeInteger } from "lodash";
export = isSafeInteger;


text:
const { CompositeDisposable } = require('atom')

let MinimapGitDiffBinding = null

module.exports = {
	config: {
		useGutterDecoration: {
			type: 'boolean',
			default: false,
			description: 'When enabled the git diffs will be displayed as thin vertical lines on the left side of the minimap.',
		},
	},

	isActive () {
		return this.pluginActive
	},

	activate () {
		this.pluginActive = false
		this.subscriptions = new CompositeDisposable()
		this.bindings = new WeakMap()
		require('atom-package-deps').install('minimap-git-diff')
	},

	consumeMinimapServiceV1 (minimap) {
		this.minimap = minimap
		return this.minimap.registerPlugin('git-diff', this)
	},

	deactivate () {
		this.destroyBindings()
		this.minimap = null
	},

	activatePlugin () {
		if (this.pluginActive) { return }

		try {
			this.createBindings()
			this.pluginActive = true

			this.subscriptions.add(this.minimap.onDidActivate(this.createBindings.bind(this)))
			this.subscriptions.add(this.minimap.onDidDeactivate(this.destroyBindings.bind(this)))
		} catch (e) {
			console.log(e)
		}
	},

	deactivatePlugin () {
		if (!this.pluginActive) { return }

		this.pluginActive = false
		this.subscriptions.dispose()
		this.destroyBindings()
	},

	createBindings () {
		if (!MinimapGitDiffBinding) { MinimapGitDiffBinding = require('./minimap-git-diff-binding') }

		this.subscriptions.add(this.minimap.observeMinimaps(o => {
			const minimap = o.view ? o.view : o
			const editor = minimap.getTextEditor()

			if (!editor) { return }

			const binding = new MinimapGitDiffBinding(minimap)
			this.bindings.set(minimap, binding)
		}),
		)
	},

	destroyBindings () {
		if (!this.minimap || !this.minimap.editorsMinimaps) { return }
		this.minimap.editorsMinimaps.forEach(minimap => {
			const minimapBinding = this.bindings.get(minimap)
			if (minimapBinding) {
				minimapBinding.destroy()
			}
			this.bindings.delete(minimap)
		})
	},
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@mipmap/guidepage_three">
        <TextView
            android:id="@+id/tv_getlogin"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_above="@+id/ll_point"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="15dp"
            android:background="@drawable/cate_btn"
            android:paddingBottom="10dp"
            android:paddingLeft="25dp"
            android:paddingRight="25dp"
            android:paddingTop="10dp"
            android:text="开启美食之旅"
            android:textColor="@android:color/white" />

        <LinearLayout
            android:id="@+id/ll_point"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:gravity="center_horizontal"
            android:orientation="horizontal"
            android:paddingBottom="15dp">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@mipmap/point" />

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:paddingLeft="18dp"
                android:src="@mipmap/point" />

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:paddingLeft="18dp"
                android:src="@mipmap/changedpoint" />
        </LinearLayout>
    </RelativeLayout>
</LinearLayout>


text:
<?php

namespace Symfony\Component\Validator\Constraints;

use Symfony\Component\Intl\Intl;
use Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyAccessor;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
use Symfony\Component\Validator\Exception\LogicException;
use Symfony\Component\Validator\Exception\UnexpectedTypeException;
use Symfony\Component\Validator\Exception\UnexpectedValueException;

/**
 * @author Michael Hirschler <michael.vhirsch@gmail.com>
 *
 * @see https://en.wikipedia.org/wiki/ISO_9362#Structure
 */
class BicValidator extends ConstraintValidator
{
    private $propertyAccessor;

    public function __construct(PropertyAccessor $propertyAccessor = null)
    {
        $this->propertyAccessor = $propertyAccessor;
    }

    /**
     * {@inheritdoc}
     */
    public function validate($value, Constraint $constraint)
    {
        if (!$constraint instanceof Bic) {
            throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Bic');
        }

        if (null === $value || '' === $value) {
            return;
        }

        if (!is_scalar($value) && !(\is_object($value) && method_exists($value, '__toString'))) {
            throw new UnexpectedValueException($value, 'string');
        }

        $canonicalize = str_replace(' ', '', $value);

        // the bic must be either 8 or 11 characters long
        if (!\in_array(\strlen($canonicalize), array(8, 11))) {
            $this->context->buildViolation($constraint->message)
                ->setParameter('{{ value }}', $this->formatValue($value))
                ->setCode(Bic::INVALID_LENGTH_ERROR)
                ->addViolation();

            return;
        }

        // must contain alphanumeric values only
        if (!ctype_alnum($canonicalize)) {
            $this->context->buildViolation($constraint->message)
                ->setParameter('{{ value }}', $this->formatValue($value))
                ->setCode(Bic::INVALID_CHARACTERS_ERROR)
                ->addViolation();

            return;
        }

        // first 4 letters must be alphabetic (bank code)
        if (!ctype_alpha(substr($canonicalize, 0, 4))) {
            $this->context->buildViolation($constraint->message)
                ->setParameter('{{ value }}', $this->formatValue($value))
                ->setCode(Bic::INVALID_BANK_CODE_ERROR)
                ->addViolation();

            return;
        }

        // @deprecated since Symfony 4.2, will throw in 5.0
        if (class_exists(Intl::class)) {
            $validCountryCode = isset(Intl::getRegionBundle()->getCountryNames()[substr($canonicalize, 4, 2)]);
        } else {
            $validCountryCode = ctype_alpha(substr($canonicalize, 4, 2));
            // throw new LogicException('The "symfony/intl" component is required to use the Bic constraint.');
        }

        if (!$validCountryCode) {
            $this->context->buildViolation($constraint->message)
                ->setParameter('{{ value }}', $this->formatValue($value))
                ->setCode(Bic::INVALID_COUNTRY_CODE_ERROR)
                ->addViolation();

            return;
        }

        // should contain uppercase characters only
        if (strtoupper($canonicalize) !== $canonicalize) {
            $this->context->buildViolation($constraint->message)
                ->setParameter('{{ value }}', $this->formatValue($value))
                ->setCode(Bic::INVALID_CASE_ERROR)
                ->addViolation();

            return;
        }

        // check against an IBAN
        $iban = $constraint->iban;
        $path = $constraint->ibanPropertyPath;
        if ($path && null !== $object = $this->context->getObject()) {
            try {
                $iban = $this->getPropertyAccessor()->getValue($object, $path);
            } catch (NoSuchPropertyException $e) {
                throw new ConstraintDefinitionException(sprintf('Invalid property path "%s" provided to "%s" constraint: %s', $path, \get_class($constraint), $e->getMessage()), 0, $e);
            }
        }
        if (!$iban) {
            return;
        }
        $ibanCountryCode = substr($iban, 0, 2);
        if (ctype_alpha($ibanCountryCode) && substr($canonicalize, 4, 2) !== $ibanCountryCode) {
            $this->context->buildViolation($constraint->ibanMessage)
                ->setParameter('{{ value }}', $this->formatValue($value))
                ->setParameter('{{ iban }}', $iban)
                ->setCode(Bic::INVALID_IBAN_COUNTRY_CODE_ERROR)
                ->addViolation();
        }
    }

    private function getPropertyAccessor(): PropertyAccessor
    {
        if (null === $this->propertyAccessor) {
            if (!class_exists(PropertyAccess::class)) {
                throw new LogicException('Unable to use property path as the Symfony PropertyAccess component is not installed.');
            }
            $this->propertyAccessor = PropertyAccess::createPropertyAccessor();
        }

        return $this->propertyAccessor;
    }
}


text:
@protocol SJSmallViewFloatingTransitionView;

NS_ASSUME_NONNULL_BEGIN
@interface SJSmallViewFloatingTransitionController : NSObject<SJSmallViewFloatingController>
- (void)resume;
@property (nonatomic, strong, null_resettable) __kindof UIView<SJSmallViewFloatingTransitionView> *floatingView;
@property (nonatomic) BOOL ignoreSafeAreaInsets API_AVAILABLE(ios(11.0));
/// default value is SJSmallViewLayoutPositionBottomRight.
@property (nonatomic) SJSmallViewLayoutPosition layoutPosition;
/// default value is UIEdgeInsetsMake(20, 12, 20, 12).
@property (nonatomic) UIEdgeInsets layoutInsets;
@property (nonatomic) CGSize layoutSize;
/// vc退出时, 是否自动进入小浮窗模式. 默认 YES
@property (nonatomic) BOOL automaticallyEnterFloatingMode;
@end

@interface UIViewController (SJSmallViewFloatingTransitionControllerExtended)
@property (nonatomic, strong, readonly, nullable) SJSmallViewFloatingTransitionController *smallViewFloatingTransitionController;
@end

@interface UIWindow (SJSmallViewFloatingTransitionControllerExtended)
/// 当前处于悬浮播放状态的视图控制器
- (NSArray<__kindof UIViewController *> *_Nullable)SVTC_playbackInFloatingViewControllers;
@end

@protocol SJSmallViewFloatingTransitionView <NSObject>
// The player view will be added to the container view.
@property (nonatomic, strong, readonly) UIView *containerView;
@end
NS_ASSUME_NONNULL_END