text:
import StockData from '../StockData';
import CandlestickFinder from './CandlestickFinder';
export default class DarkCloudCover extends CandlestickFinder {
    constructor();
    logic(data: StockData): boolean;
}
export declare function darkcloudcover(data: StockData): any;


text:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="<?php echo $this->charset;?>">
  <title><?php echo $this->title;?></title>
    <style>
        #loading .svg-icon-loader {position: absolute;top: 50%;left: 50%;margin: -50px 0 0 -50px;}
    </style>
<!--[if IE]><meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'><![endif]-->

<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

<!-- SEO -->
<?php

// Meta tags

if($this->seo != null)
{
foreach($this->seo->meta as $meta => $data)
{
?>
		<meta name="<?php echo $meta; ?>" content = "<?php echo $data; ?>">
<?php
}

// Facebook tags

foreach($this->seo->og as $og => $data)
{
?>
		<meta property="og:<?php echo $og; ?>" content = "<?php echo $data; ?>"/>
<?php
}
}
?>

<!-- Favicons -->

<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../../assets/images/icons/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="../../assets/images/icons/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="../../assets/images/icons/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="../../assets/images/icons/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="../../assets/images/icons/favicon.png">

<!-- HELPERS -->

<link rel="stylesheet" type="text/css" href="../../assets/helpers/animate.css">
<link rel="stylesheet" type="text/css" href="../../assets/helpers/boilerplate.css">
<link rel="stylesheet" type="text/css" href="../../assets/helpers/border-radius.css">
<link rel="stylesheet" type="text/css" href="../../assets/helpers/grid.css">
<link rel="stylesheet" type="text/css" href="../../assets/helpers/page-transitions.css">
<link rel="stylesheet" type="text/css" href="../../assets/helpers/spacing.css">
<link rel="stylesheet" type="text/css" href="../../assets/helpers/typography.css">
<link rel="stylesheet" type="text/css" href="../../assets/helpers/utils.css">
<link rel="stylesheet" type="text/css" href="../../assets/helpers/colors.css">

<!-- MATERIAL -->

<link rel="stylesheet" type="text/css" href="../../assets/material/ripple.css">

<!-- ELEMENTS -->

<link rel="stylesheet" type="text/css" href="../../assets/elements/badges.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/buttons.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/content-box.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/dashboard-box.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/forms.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/images.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/info-box.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/invoice.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/loading-indicators.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/menus.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/panel-box.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/response-messages.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/responsive-tables.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/ribbon.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/social-box.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/tables.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/tile-box.css">
<link rel="stylesheet" type="text/css" href="../../assets/elements/timeline.css">

<!-- ICONS -->

<link rel="stylesheet" type="text/css" href="../../assets/icons/fontawesome/fontawesome.css">
<link rel="stylesheet" type="text/css" href="../../assets/icons/linecons/linecons.css">
<link rel="stylesheet" type="text/css" href="../../assets/icons/spinnericon/spinnericon.css">

<!-- WIDGETS -->

<link rel="stylesheet" type="text/css" href="../../assets/widgets/accordion-ui/accordion.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/calendar/calendar.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/carousel/carousel.css">

<link rel="stylesheet" type="text/css" href="../../assets/widgets/charts/justgage/justgage.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/charts/morris/morris.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/charts/piegage/piegage.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/charts/xcharts/xcharts.css">

<link rel="stylesheet" type="text/css" href="../../assets/widgets/chosen/chosen.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/colorpicker/colorpicker.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/carousel/carousel.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/datatable/datatable.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/datepicker/datepicker.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/datepicker-ui/datepicker.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/daterangepicker/daterangepicker.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/dialog/dialog.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/dropdown/dropdown.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/dropzone/dropzone.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/file-input/fileinput.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/input-switch/inputswitch.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/input-switch/inputswitch-alt.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/ionrangeslider/ionrangeslider.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/jcrop/jcrop.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/jgrowl-notifications/jgrowl.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/loading-bar/loadingbar.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/maps/vector-maps/vectormaps.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/markdown/markdown.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/modal/modal.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/multi-select/multiselect.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/multi-upload/fileupload.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/nestable/nestable.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/noty-notifications/noty.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/popover/popover.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/pretty-photo/prettyphoto.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/progressbar/progressbar.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/range-slider/rangeslider.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/slidebars/slidebars.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/slider-ui/slider.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/summernote-wysiwyg/summernote-wysiwyg.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/tabs-ui/tabs.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/timepicker/timepicker.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/tocify/tocify.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/tooltip/tooltip.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/touchspin/touchspin.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/uniform/uniform.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/wizard/wizard.css">
<link rel="stylesheet" type="text/css" href="../../assets/widgets/xeditable/xeditable.css">

<!-- SNIPPETS -->

<link rel="stylesheet" type="text/css" href="../../assets/snippets/chat.css">
<link rel="stylesheet" type="text/css" href="../../assets/snippets/files-box.css">
<link rel="stylesheet" type="text/css" href="../../assets/snippets/login-box.css">
<link rel="stylesheet" type="text/css" href="../../assets/snippets/notification-box.css">
<link rel="stylesheet" type="text/css" href="../../assets/snippets/progress-box.css">
<link rel="stylesheet" type="text/css" href="../../assets/snippets/todo.css">
<link rel="stylesheet" type="text/css" href="../../assets/snippets/user-profile.css">
<link rel="stylesheet" type="text/css" href="../../assets/snippets/mobile-navigation.css">

<!-- APPLICATIONS -->

<link rel="stylesheet" type="text/css" href="../../assets/applications/mailbox.css">

<!-- Admin theme -->

<link rel="stylesheet" type="text/css" href="../../assets/themes/admin/layout.css">
<link rel="stylesheet" type="text/css" href="../../assets/themes/admin/color-schemes/default.css">

<!-- Components theme -->

<link rel="stylesheet" type="text/css" href="../../assets/themes/components/default.css">
<link rel="stylesheet" type="text/css" href="../../assets/themes/components/border-radius.css">

<!-- Admin responsive -->

<link rel="stylesheet" type="text/css" href="../../assets/helpers/responsive-elements.css">
<link rel="stylesheet" type="text/css" href="../../assets/helpers/admin-responsive.css">

<!-- Custom CSS -->

<?php
if($this->cssdata != null)
{
foreach($this->cssdata as $cssdata)
{
?>
		<link type="text/css" rel="stylesheet" href = "<?php echo $cssdata ?>">
<?php
}
}
?>

<!-- JS Core -->
<script type="text/javascript" src="../../assets/js-core/jquery-core.js"></script>
<script type="text/javascript" src="../../assets/js-core/jquery-ui.js"></script>
<script type="text/javascript" src="../../assets/js-core/mate.js"></script>
<script type="text/javascript" src="../../assets/js-core/transition.js"></script>
<script type="text/javascript" src="../../assets/js-core/modernizr.js"></script>
<script type="text/javascript" src="../../assets/js-core/jquery-cookie.js"></script>

<script type="text/javascript">
    $(window).load(function(){
        setTimeout(function() {
            $('#loading').fadeOut( 400, "linear" );
        }, 300);
    });
</script>

<!-- Custom JS -->

<?php
if($this->jsdata != null) {
  foreach($this->jsdata as $jsd) {
      ?>
      <script type="text/javascript" src="<?php echo $jsd?>" ></script>
      <?php
  }
}
?>

</head>
  <body class = "closed-sidebar">

redpajama_set_name: RedPajamaGithub


text:
/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2005-2010, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

package scala.actors

/**
 * This class is used by our efficient message queue
 * implementation.
 *
 * @author Philipp Haller
 */
@serializable @SerialVersionUID(7124278808020037465L)
@deprecated("this class is going to be removed in a future release")
class MessageQueueElement(msg: Any, session: OutputChannel[Any], next: MessageQueueElement) extends MQueueElement[Any](msg, session, next) {
  def this() = this(null, null, null)
  def this(msg: Any, session: OutputChannel[Any]) = this(msg, session, null)
}

private[actors] class MQueueElement[Msg >: Null](val msg: Msg, val session: OutputChannel[Any], var next: MQueueElement[Msg]) {
  def this() = this(null, null, null)
  def this(msg: Msg, session: OutputChannel[Any]) = this(msg, session, null)
}

/**
 * The class MessageQueue provides an efficient
 * implementation of a message queue specialized for this actor
 * library. Classes in this package are supposed to be the only
 * clients of this class.
 *
 * @author Philipp Haller
 */
@serializable @SerialVersionUID(2168935872884095767L)
@deprecated("this class is going to be removed in a future release")
class MessageQueue(label: String) extends MQueue[Any](label)

private[actors] class MQueue[Msg >: Null](protected val label: String) {
  protected var first: MQueueElement[Msg] = null
  protected var last: MQueueElement[Msg] = null  // last eq null iff list is empty
  private var _size = 0

  def size = _size
  final def isEmpty = last eq null

  protected def changeSize(diff: Int) {
    _size += diff
  }

  def append(msg: Msg, session: OutputChannel[Any]) {
    changeSize(1) // size always increases by 1
    val el = new MQueueElement(msg, session)

    if (isEmpty) first = el
    else last.next = el

    last = el
  }

  def append(el: MQueueElement[Msg]) {
    changeSize(1) // size always increases by 1

    if (isEmpty) first = el
    else last.next = el

    last = el
  }

  def foreach(f: (Msg, OutputChannel[Any]) => Unit) {
    var curr = first
    while (curr != null) {
      f(curr.msg, curr.session)
      curr = curr.next
    }
  }

  def foreachAppend(target: MQueue[Msg]) {
    var curr = first
    while (curr != null) {
      target.append(curr)
      curr = curr.next
    }
  }

  def foreachDequeue(target: MQueue[Msg]) {
    var curr = first
    while (curr != null) {
      target.append(curr)
      curr = curr.next
    }
    first = null
    last = null
    _size = 0
  }

  def foldLeft[B](z: B)(f: (B, Msg) => B): B = {
    var acc = z
    var curr = first
    while (curr != null) {
      acc = f(acc, curr.msg)
      curr = curr.next
    }
    acc
  }

  /** Returns the n-th message that satisfies the predicate p
   *  without removing it.
   */
  def get(n: Int)(p: Msg => Boolean): Option[Msg] = {
    var pos = 0

    def test(msg: Msg): Boolean =
      p(msg) && (pos == n || { pos += 1; false })

    var curr = first
    while (curr != null)
      if (test(curr.msg)) return Some(curr.msg) // early return
      else curr = curr.next

    None
  }

  /** Removes the n-th message that satisfies the predicate p.
   */
  def remove(n: Int)(p: (Msg, OutputChannel[Any]) => Boolean): Option[(Msg, OutputChannel[Any])] =
    removeInternal(n)(p) map (x => (x.msg, x.session))

  /** Extracts the first message that satisfies the predicate p
   *  or null if p fails for all of them.
   */
  def extractFirst(p: (Msg, OutputChannel[Any]) => Boolean): MQueueElement[Msg] =
    removeInternal(0)(p) orNull

  def extractFirst(pf: PartialFunction[Msg, Any]): MQueueElement[Msg] = {
    if (isEmpty)    // early return
      return null

    // special handling if returning the head
    if (pf.isDefinedAt(first.msg)) {
      val res = first
      first = first.next
      if (res eq last)
        last = null

      changeSize(-1)
      res
    }
    else {
      var curr = first.next   // init to element #2
      var prev = first

      while (curr != null) {
        if (pf.isDefinedAt(curr.msg)) {
          prev.next = curr.next
          if (curr eq last)
            last = prev

          changeSize(-1)
          return curr // early return
        }
        else {
          prev = curr
          curr = curr.next
        }
      }
      // not found
      null
    }
  }

  private def removeInternal(n: Int)(p: (Msg, OutputChannel[Any]) => Boolean): Option[MQueueElement[Msg]] = {
    var pos = 0

    def foundMsg(x: MQueueElement[Msg]) = {
      changeSize(-1)
      Some(x)
    }
    def test(msg: Msg, session: OutputChannel[Any]): Boolean =
      p(msg, session) && (pos == n || { pos += 1 ; false })

    if (isEmpty)    // early return
      return None

    // special handling if returning the head
    if (test(first.msg, first.session)) {
      val res = first
      first = first.next
      if (res eq last)
        last = null

      foundMsg(res)
    }
    else {
      var curr = first.next   // init to element #2
      var prev = first

      while (curr != null) {
        if (test(curr.msg, curr.session)) {
          prev.next = curr.next
          if (curr eq last)
            last = prev

          return foundMsg(curr) // early return
        }
        else {
          prev = curr
          curr = curr.next
        }
      }
      // not found
      None
    }
  }
}

/** Debugging trait.
 */
private[actors] trait MessageQueueTracer extends MQueue[Any]
{
  private val queueNumber = MessageQueueTracer.getQueueNumber

  override def append(msg: Any, session: OutputChannel[Any]) {
    super.append(msg, session)
    printQueue("APPEND %s" format msg)
  }
  override def get(n: Int)(p: Any => Boolean): Option[Any] = {
    val res = super.get(n)(p)
    printQueue("GET %s" format res)
    res
  }
  override def remove(n: Int)(p: (Any, OutputChannel[Any]) => Boolean): Option[(Any, OutputChannel[Any])] = {
    val res = super.remove(n)(p)
    printQueue("REMOVE %s" format res)
    res
  }
  override def extractFirst(p: (Any, OutputChannel[Any]) => Boolean): MQueueElement[Any] = {
    val res = super.extractFirst(p)
    printQueue("EXTRACT_FIRST %s" format res)
    res
  }

  private def printQueue(msg: String) = {
    def firstMsg = if (first eq null) "null" else first.msg
    def lastMsg = if (last eq null) "null" else last.msg

    println("[%s size=%d] [%s] first = %s, last = %s".format(this, size, msg, firstMsg, lastMsg))
  }
  override def toString() = "%s:%d".format(label, queueNumber)
}

private[actors] object MessageQueueTracer {
  // for tracing purposes
  private var queueNumberAssigner = 0
  private def getQueueNumber = synchronized {
    queueNumberAssigner += 1
    queueNumberAssigner
  }
}


text:
#include "cinder/ip/Blend.h"
#include "cinder/ip/Fill.h"

using namespace std;

namespace cinder { namespace ip {

/*
	   αr = 1 – [(1–αd)×(1–αs)] = αd+αs–(αd×αs)
	αr×Cr =  [(1–αs)×αd×Cd]+[(1–αd)×αs×Cs]+[αd×αs×B(Cd,Cs)]			Unpremult * Unpremult
	   Cr = [[(1–αs)×αd×Cd]+[(1–αd)×αs×Cs]+[αd×αs×B(Cd,Cs)]]/αr
	αr×Cr = (1–αs)×Cd + (1–αd)×Cs + B(Cd, αd, Cs, αs)				Premult * Premult
*/

template<bool DSTALPHA, bool DSTPREMULT, bool SRCPREMULT>
void blendImpl_u8( Surface8u *background, const Surface8u &foreground, const Area &srcArea, ivec2 absOffset )
{
	bool SRCALPHA = foreground.hasAlpha();
	const int32_t srcRowBytes = foreground.getRowBytes();
	const uint8_t sR = foreground.getChannelOrder().getRedOffset();
	const uint8_t sG = foreground.getChannelOrder().getGreenOffset();
	const uint8_t sB = foreground.getChannelOrder().getBlueOffset();
	const uint8_t sA = SRCALPHA ? (foreground.getChannelOrder().getAlphaOffset()) : 0;
	const uint8_t srcInc = foreground.getPixelInc();
	const int32_t dstRowBytes = background->getRowBytes();
	const uint8_t dR = background->getChannelOrder().getRedOffset();
	const uint8_t dG = background->getChannelOrder().getGreenOffset();
	const uint8_t dB = background->getChannelOrder().getBlueOffset();
	const uint8_t dA = DSTALPHA ? (background->getChannelOrder().getAlphaOffset()) : 0;
	const uint8_t dstInc = background->getPixelInc();
	const int32_t width = srcArea.getWidth();

	if( ! SRCALPHA ) {// normal blend with no src alpha is a copy
		ivec2 relativeOffset = absOffset - srcArea.getUL();
		background->copyFrom( foreground, srcArea, relativeOffset );
		if( DSTALPHA )
			ip::fill( &background->getChannelAlpha(), (uint8_t)255 );
		return;
	}

	for( int32_t y = 0; y < srcArea.getHeight(); ++y ) {
		const uint8_t *src = reinterpret_cast<const uint8_t*>( reinterpret_cast<const uint8_t*>( foreground.getData() + srcArea.x1 * 4 ) + ( srcArea.y1 + y ) * srcRowBytes );
		uint8_t *dst = reinterpret_cast<uint8_t*>( reinterpret_cast<uint8_t*>( background->getData() + absOffset.x * 4 ) + ( y + absOffset.y ) * dstRowBytes );
		for( int32_t x = 0; x < width; ++x ) {
			const uint8_t alphaS = (SRCALPHA) ? src[sA] : 255;
			const uint8_t invAlphaS = (SRCALPHA) ? CHANTRAIT<uint8_t>::inverse(src[sA]) : 0;
			const uint8_t alphaD = (DSTALPHA) ? dst[dA] : CHANTRAIT<uint8_t>::max();
			const uint8_t invAlphaD = (DSTALPHA) ? CHANTRAIT<uint8_t>::inverse(dst[dA]) : 0;
			if( DSTALPHA )
				dst[dA] = 255 - invAlphaS * invAlphaD / 255;
			if( ( ! DSTALPHA ) || dst[dA] ) {
				if( ! DSTALPHA && ! SRCPREMULT ) { // none * unpremult -> none
					dst[dR] = ( invAlphaS * dst[dR] + alphaS * src[sR] ) / 255;
					dst[dG] = ( invAlphaS * dst[dG] + alphaS * src[sG] ) / 255;
					dst[dB] = ( invAlphaS * dst[dB] + alphaS * src[sB] ) / 255;
				}
				else if( ! DSTALPHA && SRCPREMULT ) { // none * premult -> none
					dst[dR] = invAlphaS * dst[dR] / 255 + src[sR];
					dst[dG] = invAlphaS * dst[dG] / 255 + src[sG];
					dst[dB] = invAlphaS * dst[dB] / 255 + src[sB];
				}
				else if( ! DSTPREMULT && ! SRCPREMULT ) { // unpremult * unpremult -> unpremult
					dst[dR] = ( invAlphaS * alphaD * dst[dR] + invAlphaD * alphaS * src[sR] + alphaD * alphaS * src[sR] ) / ( 255 * dst[dA] );
					dst[dG] = ( invAlphaS * alphaD * dst[dG] + invAlphaD * alphaS * src[sG] + alphaD * alphaS * src[sG] ) / ( 255 * dst[dA] );
					dst[dB] = ( invAlphaS * alphaD * dst[dB] + invAlphaD * alphaS * src[sB] + alphaD * alphaS * src[sB] ) / ( 255 * dst[dA] );
				}
				else if( ! DSTPREMULT && SRCPREMULT ) { // unpremult * premult -> unpremult
					dst[dR] = ( invAlphaS * alphaD * dst[dR] / 255 + invAlphaD * src[sR] + alphaD * src[sR] ) / dst[dA];
					dst[dG] = ( invAlphaS * alphaD * dst[dG] / 255 + invAlphaD * src[sG] + alphaD * src[sG] ) / dst[dA];
					dst[dB] = ( invAlphaS * alphaD * dst[dB] / 255 + invAlphaD * src[sB] + alphaD * src[sB] ) / dst[dA];
				}
				else if( DSTPREMULT && SRCPREMULT ) { // premult * premult -> premult
					dst[dR] = ( invAlphaS * dst[dR] + invAlphaD * src[sR] + alphaD * src[sR] ) / 255;
					dst[dG] = ( invAlphaS * dst[dG] + invAlphaD * src[sG] + alphaD * src[sG] ) / 255;
					dst[dB] = ( invAlphaS * dst[dB] + invAlphaD * src[sB] + alphaD * src[sB] ) / 255;
				}
				else if( DSTPREMULT && ! SRCPREMULT ) { // premult * unpremult -> premult
					dst[dR] = ( invAlphaS * dst[dR] + ( invAlphaD * alphaS * src[sR] + alphaD * alphaS * src[sR] ) / 255 ) / 255;
					dst[dG] = ( invAlphaS * dst[dG] + ( invAlphaD * alphaS * src[sG] + alphaD * alphaS * src[sG] ) / 255 ) / 255;
					dst[dB] = ( invAlphaS * dst[dB] + ( invAlphaD * alphaS * src[sB] + alphaD * alphaS * src[sB] ) / 255 ) / 255;
				}
			}
			src += srcInc;
			dst += dstInc;
		}
	}
}

template<bool DSTALPHA, bool DSTPREMULT, bool SRCPREMULT>
void blendImpl_float( Surface32f *background, const Surface32f &foreground, const Area &srcArea, ivec2 absOffset )
{
	bool SRCALPHA = foreground.hasAlpha();
	const int32_t srcRowBytes = foreground.getRowBytes();
	const uint8_t sR = foreground.getChannelOrder().getRedOffset();
	const uint8_t sG = foreground.getChannelOrder().getGreenOffset();
	const uint8_t sB = foreground.getChannelOrder().getBlueOffset();
	const uint8_t sA = SRCALPHA ? (foreground.getChannelOrder().getAlphaOffset()) : 0;
	const uint8_t srcInc = foreground.getPixelInc();
	const int32_t dstRowBytes = background->getRowBytes();
	const uint8_t dR = background->getChannelOrder().getRedOffset();
	const uint8_t dG = background->getChannelOrder().getGreenOffset();
	const uint8_t dB = background->getChannelOrder().getBlueOffset();
	const uint8_t dA = DSTALPHA ? (background->getChannelOrder().getAlphaOffset()) : 0;
	const uint8_t dstInc = background->getPixelInc();
	const int32_t width = srcArea.getWidth();

	if( ! SRCALPHA ) {// normal blend with no src alpha is a copy
		ivec2 relativeOffset = absOffset - srcArea.getUL();
		background->copyFrom( foreground, srcArea, relativeOffset );
		if( DSTALPHA )
			ip::fill( &background->getChannelAlpha(), 1.0f );
		return;
	}

	for( int32_t y = 0; y < srcArea.getHeight(); ++y ) {
		const float *src = reinterpret_cast<const float*>( reinterpret_cast<const uint8_t*>( foreground.getData() + srcArea.x1 * 4 ) + ( srcArea.y1 + y ) * srcRowBytes );
		float *dst = reinterpret_cast<float*>( reinterpret_cast<uint8_t*>( background->getData() + absOffset.x * 4 ) + ( y + absOffset.y ) * dstRowBytes );
		for( int32_t x = 0; x < width; ++x ) {
			const float alphaS = (SRCALPHA) ? src[sA] : 1;
			const float invAlphaS = (SRCALPHA) ? CHANTRAIT<float>::inverse(src[sA]) : 0;
			const float alphaD = (DSTALPHA) ? dst[dA] : CHANTRAIT<float>::max();
			const float invAlphaD = (DSTALPHA) ? CHANTRAIT<float>::inverse(dst[dA]) : 0;
			if( DSTALPHA )
				dst[dA] = 1 - invAlphaS * invAlphaD;
			if( ( ! DSTALPHA ) || dst[dA] ) {
				if( ! DSTALPHA && ! SRCPREMULT ) { // none * unpremult -> none
					dst[dR] = invAlphaS * dst[dR] + alphaS * src[sR];
					dst[dG] = invAlphaS * dst[dG] + alphaS * src[sG];
					dst[dB] = invAlphaS * dst[dB] + alphaS * src[sB];
				}
				else if( ! DSTALPHA && SRCPREMULT ) { // none * premult -> none
					dst[dR] = invAlphaS * dst[dR] + src[sR];
					dst[dG] = invAlphaS * dst[dG] + src[sG];
					dst[dB] = invAlphaS * dst[dB] + src[sB];
				}
				else if( ! DSTPREMULT && ! SRCPREMULT ) { // unpremult * unpremult -> unpremult
					float invDstA = 1.0f / dst[dA];
					dst[dR] = ( invAlphaS * alphaD * dst[dR] + invAlphaD * alphaS * src[sR] + alphaD * alphaS * src[sR] ) * invDstA;
					dst[dG] = ( invAlphaS * alphaD * dst[dG] + invAlphaD * alphaS * src[sG] + alphaD * alphaS * src[sG] ) * invDstA;
					dst[dB] = ( invAlphaS * alphaD * dst[dB] + invAlphaD * alphaS * src[sB] + alphaD * alphaS * src[sB] ) * invDstA;
				}
				else if( ! DSTPREMULT && SRCPREMULT ) { // unpremult * premult -> unpremult
					float invDstA = 1.0f / dst[dA];
					dst[dR] = ( invAlphaS * alphaD * dst[dR] + invAlphaD * src[sR] + alphaD * src[sR] ) * invDstA;
					dst[dG] = ( invAlphaS * alphaD * dst[dG] + invAlphaD * src[sG] + alphaD * src[sG] ) * invDstA;
					dst[dB] = ( invAlphaS * alphaD * dst[dB] + invAlphaD * src[sB] + alphaD * src[sB] ) * invDstA;
				}
				else if( DSTPREMULT && SRCPREMULT ) { // premult * premult -> premult
					dst[dR] = invAlphaS * dst[dR] + invAlphaD * src[sR] + alphaD * src[sR];
					dst[dG] = invAlphaS * dst[dG] + invAlphaD * src[sG] + alphaD * src[sG];
					dst[dB] = invAlphaS * dst[dB] + invAlphaD * src[sB] + alphaD * src[sB];
				}
				else if( DSTPREMULT && ! SRCPREMULT ) { // premult * unpremult -> premult
					dst[dR] = invAlphaS * dst[dR] + invAlphaD * alphaS * src[sR] + alphaD * alphaS * src[sR];
					dst[dG] = invAlphaS * dst[dG] + invAlphaD * alphaS * src[sG] + alphaD * alphaS * src[sG];
					dst[dB] = invAlphaS * dst[dB] + invAlphaD * alphaS * src[sB] + alphaD * alphaS * src[sB];
				}
			}
			src += srcInc;
			dst += dstInc;
		}
	}
}

void blend( Surface8u *background, const Surface8u &foreground, const Area &srcArea, const ivec2 &dstRelativeOffset )
{
	pair<Area,ivec2> srcDst = clippedSrcDst( foreground.getBounds(), srcArea, background->getBounds(), srcArea.getUL() + dstRelativeOffset );
	if( background->hasAlpha() ) {
		if( background->isPremultiplied() ) {
			if( foreground.isPremultiplied() )
				blendImpl_u8<true, true, true>( background, foreground, srcDst.first, srcDst.second );
			else
				blendImpl_u8<true, true, false>( background, foreground, srcDst.first, srcDst.second );
		}
		else { // background unpremult
			if( foreground.isPremultiplied() )
				blendImpl_u8<true, false, true>( background, foreground, srcDst.first, srcDst.second );
			else
				blendImpl_u8<true, false, false>( background, foreground, srcDst.first, srcDst.second );
		}
	}
	else { // background no alpha
		if( foreground.isPremultiplied() )
			blendImpl_u8<false, false, true>( background, foreground, srcDst.first, srcDst.second );
		else
			blendImpl_u8<false, false, false>( background, foreground, srcDst.first, srcDst.second );
	}
}

void blend( Surface32f *background, const Surface32f &foreground, const Area &srcArea, const ivec2 &dstRelativeOffset )
{
	pair<Area,ivec2> srcDst = clippedSrcDst( foreground.getBounds(), srcArea, background->getBounds(), srcArea.getUL() + dstRelativeOffset );
	if( background->hasAlpha() ) {
		if( background->isPremultiplied() ) {
			if( foreground.isPremultiplied() )
				blendImpl_float<true, true, true>( background, foreground, srcDst.first, srcDst.second );
			else
				blendImpl_float<true, true, false>( background, foreground, srcDst.first, srcDst.second );
		}
		else {
			if( foreground.isPremultiplied() )
				blendImpl_float<true, false, true>( background, foreground, srcDst.first, srcDst.second );
			else
				blendImpl_float<true, false, false>( background, foreground, srcDst.first, srcDst.second );
		}
	}
	else { // background no alpha
		if( foreground.isPremultiplied() )
			blendImpl_float<false, false, true>( background, foreground, srcDst.first, srcDst.second );
		else
			blendImpl_float<false, false, false>( background, foreground, srcDst.first, srcDst.second );
	}
}

} } // namespace cinder::ip


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.SessionState;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.Composing;
using Umbraco.Web;

namespace Umbraco.Tests.TestHelpers.Stubs
{
    /// <summary>
    /// Used in place of the UmbracoControllerFactory which relies on BuildManager which throws exceptions in a unit test context
    /// </summary>
    internal class TestControllerFactory : IControllerFactory
    {
        private readonly UmbracoContext _umbracoContext;
        private readonly ILogger _logger;

        public TestControllerFactory(UmbracoContext umbracoContext, ILogger logger)
        {
            _umbracoContext = umbracoContext;
            _logger = logger;
        }

        public IController CreateController(RequestContext requestContext, string controllerName)
        {
            var types = TypeFinder.FindClassesOfType<ControllerBase>(new[] { Assembly.GetExecutingAssembly() });

            var controllerTypes = types.Where(x => x.Name.Equals(controllerName + "Controller", StringComparison.InvariantCultureIgnoreCase));
            var t = controllerTypes.SingleOrDefault();

            if (t == null)
                return null;

            var possibleParams = new object[]
            {
                _umbracoContext, _logger
            };
            var ctors = t.GetConstructors();
            foreach (var ctor in ctors.OrderByDescending(x => x.GetParameters().Length))
            {
                var args = new List<object>();
                var allParams = ctor.GetParameters().ToArray();
                foreach (var parameter in allParams)
                {
                    var found = possibleParams.SingleOrDefault(x => x.GetType() == parameter.ParameterType)
                             ?? Current.Factory.GetInstance(parameter.ParameterType);
                    if (found != null) args.Add(found);
                }
                if (args.Count == allParams.Length)
                {
                    return Activator.CreateInstance(t, args.ToArray()) as IController;
                }
            }
            return null;
        }

        public SessionStateBehavior GetControllerSessionBehavior(RequestContext requestContext, string controllerName)
        {
            return SessionStateBehavior.Disabled;
        }

        public void ReleaseController(IController controller)
        {
            controller.DisposeIfDisposable();
        }
    }
}


text:
package leap.orm.event.reflect;

import leap.core.annotation.Transactional;
import leap.core.transaction.TransactionStatus;
import leap.lang.Types;
import leap.lang.beans.BeanProperty;
import leap.lang.beans.BeanType;
import leap.lang.reflect.ReflectMethod;
import leap.lang.reflect.ReflectParameter;
import leap.lang.reflect.Reflection;
import leap.orm.annotation.Entity;
import leap.orm.event.EntityEvent;
import leap.orm.event.EntityEventWithWrapper;
import leap.orm.model.Model;
import leap.orm.value.EntityWrapper;

import java.util.function.Consumer;

public abstract class ReflectEntityListenerBase<E extends EntityEvent> {

    protected final Object        inst;
    protected final ReflectMethod method;
    protected final Consumer<E>   func;
    protected final boolean       transactional;

    protected ReflectEntityListenerBase(Object inst, ReflectMethod m) {
        this.inst   = inst;
        this.method = m;

        Class<?> eventType  = Types.getActualTypeArgument(this.getClass().getGenericSuperclass());
        boolean  withEntity = EntityEventWithWrapper.class.isAssignableFrom(eventType);

        if(m.getParameters().length == 1) {

            this.transactional = m.isAnnotationPresent(Transactional.class);

            ReflectParameter p = m.getParameters()[0];

            if(p.getType().equals(eventType)) {
                func = (e) -> m.invoke(inst, e);
                return;
            }

            if(withEntity) {
                if(p.getType().equals(EntityWrapper.class)) {
                    func = (e) -> m.invoke(inst, ((EntityEventWithWrapper)e).getEntity());
                    return;
                }

                if(isEntityType(p)) {
                    BeanType bt = BeanType.of(p.getType());
                    func = (e) -> invoke((EntityEventWithWrapper)e, bt, (bean) -> m.invoke(inst, bean));
                    return;
                }
            }

        } else if(m.getParameters().length == 2) {
            this.transactional = true;

            ReflectParameter p0 = m.getParameters()[0];
            ReflectParameter p1 = m.getParameters()[1];

            if(withEntity) {
                if(p0.getType().equals(EntityWrapper.class) && p1.getType().equals(TransactionStatus.class)) {
                    func = (e) -> m.invoke(inst, ((EntityEventWithWrapper)e).getEntity(), e.getTransactionStatus());
                    return;
                }

                if(p0.getType().equals(eventType) && p1.getType().equals(TransactionStatus.class)) {
                    func = (e) -> m.invoke(inst, e, e.getTransactionStatus());
                    return;
                }

                if(isEntityType(p0) && p1.getType().equals(TransactionStatus.class)) {
                    BeanType bt = BeanType.of(p0.getType());
                    func = (e) -> invoke((EntityEventWithWrapper)e, bt, (bean) -> m.invoke(inst, bean, e.getTransactionStatus()));
                    return;
                }
            }

        }

        throw new IllegalArgumentException("Incorrect parameters in method '" +
                                            Reflection.fullQualifyName(m.getReflectedMethod()) +
                                            "' for '" + eventType.getSimpleName() + "' event");
    }

    public boolean isTransactional() {
        return transactional;
    }

    protected boolean isEntityType(ReflectParameter p) {
        return Model.class.isAssignableFrom(p.getType()) || p.getType().isAnnotationPresent(Entity.class);
    }

    protected void invoke(EntityEventWithWrapper e, BeanType bt, Consumer<Object> func) {
        EntityWrapper entity = e.getEntity();

        boolean typeMatches = e.getEntity().raw().getClass().equals(bt.getBeanClass());

        Object bean;

        if(!typeMatches) {
            bean = bt.newInstance();
            for (String name : entity.getFieldNames()) {
                bt.trySetProperty(bean, name, entity.get(name));
            }
        }else {
            bean = e.getEntity().raw();
        }

        func.accept(bean);

        if(!typeMatches) {
            for (BeanProperty bp : bt.getProperties()) {
                if(bp.isWritable()) {
                    entity.set(bp.getName(), bp.getValue(bean));
                }
            }
        }
    }

}


text:
namespace xE {

//Definitions
#define xE_CNULL xColor(-1,-1,-1)
#define xE_GREEN xColor(0,255,0)
#define xE_BLUE xColor(0,0,255)
#define xE_WHITE xColor(255,255,255)
#define xE_BLACK xColor(0,0,0)
#define xE_RED xColor(255,0,0)
#define xE_PURPLE xColor(155,0,255)
#define xE_YELLOW xColor(255,255,0)
#define xE_CYAN xColor(0,255,255)

class xColor {

	friend class xRectangle;
	friend class xDisplayField;
	friend class xText;

public:
	xColor();
	xColor(int red, int green, int blue);
	xColor(xColor leftDown, xColor leftUp, xColor rightUp, xColor rightDown);
	xColor(const xColor& color);
	void set(int red, int green, int blue);
	virtual ~xColor();

	//void changeColor(int red, int green, int blue);
	//void changeColor(Colors leftDown, Colors leftUp, Colors rightUp, Colors rightDown);
	void setAlpha(int opacity);
	void setAlpha(int first, int second, int third, int fourth);
	int getAlpha();

	float rgb4v[12];
	float alpha[4];
	float alpha4All;
	bool ifMonolith;

private:

};

}

#endif // XCOLOR_HPP


text:
import pytest
import numpy as np
import nnabla as nn
import nnabla.functions as F
from nbla_test_utils import list_context

ctxs = list_context('Split')

def ref_split(x, axis):
    return tuple([np.squeeze(sq, axis) for sq in np.split(x, x.shape[axis], axis=axis)])

@pytest.mark.parametrize("ctx, func_name", ctxs)
@pytest.mark.parametrize("axis", [0, 1, 2, -1, -2, -3])
@pytest.mark.parametrize("seed", [313])
def test_split_forward_backward(seed, axis, ctx, func_name):
    from nbla_test_utils import function_tester
    rng = np.random.RandomState(seed)
    shape = [2, 3, 4]
    x = rng.randn(*shape).astype(np.float32)
    inputs = [x]
    function_tester(rng, F.split, ref_split, inputs,
                    func_args=[axis], ctx=ctx, func_name=func_name,
                    atol_b=1e-2)

def test_zero_value():
    a = nn.Variable((1, 6, 0))
    with pytest.raises(RuntimeError):
        F.split(a, axis=1)

@pytest.mark.parametrize("ctx, func_name", ctxs)
@pytest.mark.parametrize("axis", [0, 1, 2, -1, -2, -3])
@pytest.mark.parametrize("seed", [313])
def test_split_double_backward(seed, axis, ctx, func_name):
    from nbla_test_utils import backward_function_tester
    rng = np.random.RandomState(seed)
    shape = [2, 3, 4]
    x = rng.randn(*shape).astype(np.float32)
    inputs = [x]
    backward_function_tester(rng, F.split,
                             inputs=inputs,
                             func_args=[axis], func_kwargs={},
                             atol_f=1e-3,
                             atol_accum=5e-3,
                             dstep=1e-2,
                             ctx=ctx)


text:
package nrlogrus

import (
	newrelic "github.com/newrelic/go-agent"
	"github.com/newrelic/go-agent/internal"
	"github.com/sirupsen/logrus"
)

func init() { internal.TrackUsage("integration", "logging", "logrus") }

type shim struct{ e *logrus.Entry }

func (s *shim) Error(msg string, c map[string]interface{}) {
	s.e.WithFields(c).Error(msg)
}
func (s *shim) Warn(msg string, c map[string]interface{}) {
	s.e.WithFields(c).Warn(msg)
}
func (s *shim) Info(msg string, c map[string]interface{}) {
	s.e.WithFields(c).Info(msg)
}
func (s *shim) Debug(msg string, c map[string]interface{}) {
	s.e.WithFields(c).Info(msg)
}
func (s *shim) DebugEnabled() bool {
	lvl := logrus.GetLevel()
	return lvl >= logrus.DebugLevel
}

// StandardLogger returns a newrelic.Logger which forwards agent log messages to
// the logrus package-level exported logger.
func StandardLogger() newrelic.Logger {
	return &shim{
		e: logrus.WithFields(logrus.Fields{
			"component": "newrelic",
		}),
	}
}


text:
<?php

namespace Krystal\Db\Sql\Relations;

use Krystal\Db\Sql\DbInterface;

final class RelationProcessor implements RelationProcessorInterface
{
    /**
     * Queue of relations
     *
     * @var array
     */
    private $queue = array();

    /**
     * Database service
     *
     * @var \Krystal\Db\Sql\DbInterface
     */
    private $db;

    /**
     * A name of the PK in master table
     *
     * @var string
     */
    private $pk;

    const PARAM_RELATION = 'relation';
    const PARAM_ARGS = 'args';

    /**
     * State initialization
     *
     * @param \Krystal\Db\Sql\DbInterface $db Database service
     * @return void
     */
    public function __construct(DbInterface $db)
    {
        $this->db = $db;
    }

    /**
     * Append new relation to the queue stack
     *
     * @param string $relation
     * @param array $args Arguments to be passed on invoking
     * @return void
     */
    public function queue($relation, array $args)
    {
        $this->queue[] = array(
            self::PARAM_RELATION => $relation,
            self::PARAM_ARGS => $args
        );
    }

    /**
     * Checks whether queue is empty or not
     *
     * @return boolean
     */
    public function hasQueue()
    {
        return !empty($this->queue);
    }

    /**
     * Processes a raw result-set appending relational data if necessary
     *
     * @param array $rows Target collection of rows
     * @return array
     */
    public function process(array $rows)
    {
        foreach ($this->queue as $queue) {
            // Just references
            $relation = $queue[self::PARAM_RELATION];
            $args = $queue[self::PARAM_ARGS];

            switch ($relation) {
                case 'asOneToMany':
                    $relation = new OneToMany($this->db);

                    // Grab values from arguments passed in $db->asOneToMany()
                    $slaveTable = $args[0];
                    $slaveColumnId = $args[1];
                    $alias = $args[2];

                    $rows = $relation->merge($this->getMasterPkName(), $rows, $alias, $slaveTable, $slaveColumnId);
                break;

                case 'asOneToOne':
                    // Grab values from arguments passed in $db->asOneToOne()
                    $column = $args[0];
                    $alias = $args[1];
                    $table = $args[2];
                    $link = $args[3];

                    $relation = new OneToOne($this->db);
                    $rows = $relation->merge($rows, $column, $alias, $table, $link);
                break;

                case 'asManyToMany':
                    // Grab values from arguments passed in $db->asManyToMany()
                    $alias = $args[0];
                    $junction = $args[1];
                    $column = $args[2];
                    $table = $args[3];
                    $pk = $args[4];
                    $columns = $args[5];

                    $relation = new ManyToMany($this->db);
                    $rows = $relation->merge($this->getMasterPkName(), $alias, $rows, $junction, $column, $table, $pk, $columns);
                break;
            }
        }

        $this->clearQueue();
        return $rows;
    }

    /**
     * Clears the queue
     *
     * @return void
     */
    private function clearQueue()
    {
        $this->queue = array();
    }

    /**
     * Extracts PK column from a table
     *
     * @param string $table
     * @return string
     */
    private function extractPkName($table)
    {
        if (is_null($this->pk)) {
            // This has been tested only in MySQL so far
            $row = $this->db->showKeys()
                            ->from($table)
                            ->whereEquals('Key_name', 'PRIMARY')
                            ->getStmt()
                            ->fetch();

            $this->pk = $row['Column_name'];
        }

        return $this->pk;
    }

    /**
     * Returns PK's column name of the master table
     *
     * @return string
     */
    private function getMasterPkName()
    {
        return $this->extractPkName($this->db->getQueryBuilder()->getSelectedTable());
    }
}


text:
# frozen_string_literal: true
ENV["RAILS_ENV"] ||= "test"
require "spec_helper"
require File.expand_path("../../config/environment", __FILE__)
require "rspec/rails"
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }

ActiveRecord::Migration.maintain_test_schema!
require "spec_helper"
RSpec.configure do |config|
  config.use_transactional_fixtures = true
  config.infer_base_class_for_anonymous_controllers = false
end


text:
'use strict';

var devMode = false;

const
	electron = require('electron'),
	app = electron.app,
	BrowserWindow = electron.BrowserWindow,
	ipcMain = electron.ipcMain,
	utils = require('./utils'),
	_utils = new utils();

var
	mainWindow,
	windowOptions = {
		width: 300,
		height: 100,
		fullscreenable: false,
		maximizable: false,
		frame: false,
		resizable: devMode ? true : false,
		alwaysOnTop: devMode ? true : false,
		transparent: false
	};

class Index {

	constructor() {
		app.on("ready", () => this.appReady());
	}

	appReady() {
		mainWindow = new BrowserWindow(windowOptions);
		this.loadInstaller();
	}

	loadInstaller() {
		this.installer = require('./installer_index');
		this.installerInstance = new this.installer(app, mainWindow, ipcMain, _utils);
	}

}

module.exports = new Index();


text:
define(
     ({
        "widgets": {
            "AboutDialog": {
                "title": "Sobre",
                "itemInfo": "Visualizar este item",
                "itemInfoLink": "no ArcGIS Online.",
                "licenseHeader":"Licença",
                "dateCreated":"Criado:",
                "dateModified":"Ultima modificação",
                "moreInfoHeader":"Mais Informações"
            }
        }
    })
);


text:
namespace v8 {
namespace internal {

// Type hints for an binary operation.
enum class BinaryOperationHint : uint8_t {
  kNone,
  kSignedSmall,
  kSigned32,
  kNumberOrOddball,
  kString,
  kAny
};

inline size_t hash_value(BinaryOperationHint hint) {
  return static_cast<unsigned>(hint);
}

std::ostream& operator<<(std::ostream&, BinaryOperationHint);

// Type hints for an compare operation.
enum class CompareOperationHint : uint8_t {
  kNone,
  kSignedSmall,
  kNumber,
  kNumberOrOddball,
  kString,
  kAny
};

inline size_t hash_value(CompareOperationHint hint) {
  return static_cast<unsigned>(hint);
}

std::ostream& operator<<(std::ostream&, CompareOperationHint);

// Type hints for the ToBoolean type conversion.
enum class ToBooleanHint : uint16_t {
  kNone = 0u,
  kUndefined = 1u << 0,
  kBoolean = 1u << 1,
  kNull = 1u << 2,
  kSmallInteger = 1u << 3,
  kReceiver = 1u << 4,
  kString = 1u << 5,
  kSymbol = 1u << 6,
  kHeapNumber = 1u << 7,
  kSimdValue = 1u << 8,
  kAny = kUndefined | kBoolean | kNull | kSmallInteger | kReceiver | kString |
         kSymbol | kHeapNumber | kSimdValue,
  kNeedsMap = kReceiver | kString | kSymbol | kHeapNumber | kSimdValue,
  kCanBeUndetectable = kReceiver,
};

std::ostream& operator<<(std::ostream&, ToBooleanHint);
std::string ToString(ToBooleanHint);

typedef base::Flags<ToBooleanHint, uint16_t> ToBooleanHints;

std::ostream& operator<<(std::ostream&, ToBooleanHints);
std::string ToString(ToBooleanHints);

DEFINE_OPERATORS_FOR_FLAGS(ToBooleanHints)

enum StringAddFlags {
  // Omit both parameter checks.
  STRING_ADD_CHECK_NONE = 0,
  // Check left parameter.
  STRING_ADD_CHECK_LEFT = 1 << 0,
  // Check right parameter.
  STRING_ADD_CHECK_RIGHT = 1 << 1,
  // Check both parameters.
  STRING_ADD_CHECK_BOTH = STRING_ADD_CHECK_LEFT | STRING_ADD_CHECK_RIGHT,
  // Convert parameters when check fails (instead of throwing an exception).
  STRING_ADD_CONVERT = 1 << 2,
  STRING_ADD_CONVERT_LEFT = STRING_ADD_CHECK_LEFT | STRING_ADD_CONVERT,
  STRING_ADD_CONVERT_RIGHT = STRING_ADD_CHECK_RIGHT | STRING_ADD_CONVERT
};

std::ostream& operator<<(std::ostream& os, const StringAddFlags& flags);

}  // namespace internal
}  // namespace v8

#endif  // V8_TYPE_HINTS_H_


text:
#include "src/fastertransformer/utils/cuda_utils.h"
#include <cublasLt.h>
#include <cublas_v2.h>
#include <cuda_runtime.h>
#include <map>
#include <string>
#include <utility>

#pragma once
namespace fastertransformer {

#define GEMM_NUM 6
#define GEMM_CONFIG "gemm_config.in"
#define IGEMM_CONFIG "igemm_config.in"
#define SPGEMM_CONFIG "spgemm_config.in"
#define SPIGEMM_CONFIG "spigemm_config.in"

typedef struct {
    int algoId, customOption, tile, splitK_val;
    int swizzle, reductionScheme, workspaceSize;
    // only used in cublasLt >= 11.0
    int   stages;
    float exec_time;
} cublasLtMatmulAlgo_info;

/* Structure to store information about different run trials */
typedef struct {
    cublasLtMatmulAlgo_t      algo;
    cublasStatus_t            status;
    float                     time;
    size_t                    workspaceSize;  // actual memory workspace needed
    cublasMath_t              mathMode;
    cublasLtReductionScheme_t reductionScheme;
    int                       customOption;
    float                     wavesCount;
} customMatmulPerf_t;

class cublasAlgoMap {
private:
    std::map<std::string, cublasLtMatmulAlgo_info> algo_map_;
    std::string                                    config_filename_;
    std::string                                    sp_config_filename_;
    std::map<std::string, int>                     sp_algo_map_;

public:
    explicit cublasAlgoMap(const std::string filename, const std::string sp_config_filename = "");
    cublasAlgoMap(const cublasAlgoMap& map);
    ~cublasAlgoMap();
    void loadGemmConfig();
    void loadSpGemmConfig();
    int  getSpAlgo(const int batch_count, const int m, const int n, const int k);
    bool isUseSparse(const int batch_count, const int m, const int n, const int k);

    bool isExist(const int batch_count, const int m, const int n, const int k, const CublasDataType data_type);

    cublasLtMatmulAlgo_info
    getAlgo(const int batch_count, const int m, const int n, const int k, const CublasDataType data_type);
};

}  // namespace fastertransformer


text:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=utf-8>
</head>

<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src='../remix.js'></script>
<script type="text/javascript">

// First-beat extraction and assembly
// You will need to supply your Echo Nest API key, the trackID, and a URL to the track.
// The supplied track can be found in the audio subdirectory.
var apiKey = 'YOUR-API-KEY';
var trackID = 'TRCYWPQ139279B3308';
var trackURL = 'audio/1451_-_D.mp3'

var remixer;
var player;
var track;
var remixed;

function init() {
    var contextFunction = window.AudioContext || window.webkitAudioContext;
    if (contextFunction === undefined) {
        $("#info").text("Sorry, this app needs advanced web audio. Your browser doesn't"
            + " support it. Try the latest version of Chrome?");
    } else {
        var context = new contextFunction();
        remixer = createJRemixer(context, $, apiKey);
        player = remixer.getPlayer();
        $("#info").text("Loading analysis data...");

        remixer.remixTrackById(trackID, trackURL, function(t, percent) {
            track = t;

            $("#info").text(percent + "% of the track loaded");
            if (percent == 100) {
                $("#info").text(percent + "% of the track loaded, remixing...");
            }

            if (track.status == 'ok') {
                remixed = new Array();
                // Do the remixing here!
                for (var i=0; i < track.analysis.beats.length; i++) {
                    if (i % 4 == 0) {
                        remixed.push(track.analysis.beats[i])
                    }
                }
                $("#info").text("Remix complete!");
            }
        });
    }
}

window.onload = init;
</script>

Welcome to One.html
<div id='info'> </div>
<button onClick="player.play(0, remixed);">Play!</button>
<button onClick="player.stop()">Stop!</button>
</body>

</html>


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

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;

import static java.util.Collections.emptyMap;
import static java.util.Objects.requireNonNull;

public class ConnectorTableMetadata
{
    private final SchemaTableName table;
    private final Optional<String> comment;
    private final List<ColumnMetadata> columns;
    private final Map<String, Object> properties;

    public ConnectorTableMetadata(SchemaTableName table, List<ColumnMetadata> columns)
    {
        this(table, columns, emptyMap());
    }

    public ConnectorTableMetadata(SchemaTableName table, List<ColumnMetadata> columns, Map<String, Object> properties)
    {
        this(table, columns, properties, Optional.empty());
    }

    public ConnectorTableMetadata(SchemaTableName table, List<ColumnMetadata> columns, Map<String, Object> properties, Optional<String> comment)
    {
        requireNonNull(table, "table is null");
        requireNonNull(columns, "columns is null");
        requireNonNull(comment, "comment is null");

        this.table = table;
        this.columns = Collections.unmodifiableList(new ArrayList<>(columns));
        this.properties = Collections.unmodifiableMap(new LinkedHashMap<>(properties));
        this.comment = comment;
    }

    public SchemaTableName getTable()
    {
        return table;
    }

    public List<ColumnMetadata> getColumns()
    {
        return columns;
    }

    public Map<String, Object> getProperties()
    {
        return properties;
    }

    public Optional<String> getComment()
    {
        return comment;
    }

    @Override
    public String toString()
    {
        StringBuilder sb = new StringBuilder("ConnectorTableMetadata{");
        sb.append("table=").append(table);
        sb.append(", columns=").append(columns);
        sb.append(", properties=").append(properties);
        comment.ifPresent(value -> sb.append(", comment='").append(value).append("'"));
        sb.append('}');
        return sb.toString();
    }
}


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTranslationsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (! Schema::hasTable('translations')) {
            Schema::create('translations', function(Blueprint $table) {
                $table->increments('id');
                $table->string('lang', 3);
                $table->text('content');
                $table->morphs('translatable');
                $table->timestamps();
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('translations');
    }
}


text:
package com.google.idea.blaze.android.sync.model;

import com.android.SdkConstants;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
import com.google.devtools.intellij.model.ProjectData;
import com.google.idea.blaze.android.libraries.UnpackedAars;
import com.google.idea.blaze.base.ideinfo.ArtifactLocation;
import com.google.idea.blaze.base.ideinfo.LibraryArtifact;
import com.google.idea.blaze.base.model.BlazeLibrary;
import com.google.idea.blaze.base.model.BlazeProjectData;
import com.google.idea.blaze.base.model.LibraryFilesProvider;
import com.google.idea.blaze.base.model.LibraryKey;
import com.google.idea.blaze.base.sync.workspace.ArtifactLocationDecoder;
import com.google.idea.common.experiments.BoolExperiment;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.text.StringUtil;
import java.io.File;
import java.util.Objects;
import javax.annotation.concurrent.Immutable;
import org.jetbrains.annotations.Nullable;

/**
 * A library corresponding to an AAR file. Has jars and resource directories.
 *
 * <p>AAR Libraries are structured to generate an IntelliJ Library that looks like a library that
 * Studio will generate for an aar in the gradle world. In particular, the classes.jar and res
 * folders are all included as source roots in a single library. One consequence of this is that we
 * don't end up using the blaze sync plugin's handling of jars (which for instance only attaches
 * sources on demand).
 */
@Immutable
public final class AarLibrary extends BlazeLibrary {
  private static final Logger logger = Logger.getInstance(AarLibrary.class);

  @VisibleForTesting
  public static final BoolExperiment exportResourcePackage =
      new BoolExperiment("aswb.aarlibrary.export.res.package", true);

  // libraryArtifact would be null if this aar is created by aspect file. Such aar is generated for
  // generated resources which should not have any bundled jar file.
  @Nullable public final LibraryArtifact libraryArtifact;
  public final ArtifactLocation aarArtifact;

  // resourcePackage is used to set the resource package of the corresponding ExternalLibrary
  // generated by BlazeModuleSystem. Setting resourcePackage to null will create an ExternalLibrary
  // that doesn't have its resource package set.
  //
  // resourcePackage is null when we don't want to export a resource package for the Aar. This would
  // be either if `exportResourcePackage` is turned off, or if there's an issue trying to infer
  // package of the Aar.
  @Nullable public final String resourcePackage;

  public AarLibrary(ArtifactLocation artifactLocation, @Nullable String resourcePackage) {
    this(null, artifactLocation, resourcePackage);
  }

  public AarLibrary(
      @Nullable LibraryArtifact libraryArtifact,
      ArtifactLocation aarArtifact,
      @Nullable String resourcePackage) {
    // Use the aar's name for the library key. The jar name is the same for all AARs, so could more
    // easily get a hash collision.
    super(LibraryKey.fromArtifactLocation(aarArtifact));
    this.libraryArtifact = libraryArtifact;
    this.aarArtifact = aarArtifact;
    this.resourcePackage = exportResourcePackage.getValue() ? resourcePackage : null;
  }

  static AarLibrary fromProto(ProjectData.BlazeLibrary proto) {
    ProjectData.AarLibrary aarLibrary = proto.getAarLibrary();
    return new AarLibrary(
        aarLibrary.hasLibraryArtifact()
            ? LibraryArtifact.fromProto(aarLibrary.getLibraryArtifact())
            : null,
        ArtifactLocation.fromProto(aarLibrary.getAarArtifact()),
        aarLibrary.getResourcePackage());
  }

  @Override
  public ProjectData.BlazeLibrary toProto() {
    ProjectData.AarLibrary.Builder aarLibraryBuilder =
        ProjectData.AarLibrary.newBuilder().setAarArtifact(aarArtifact.toProto());
    if (libraryArtifact != null) {
      aarLibraryBuilder.setLibraryArtifact(libraryArtifact.toProto());
    }

    if (!StringUtil.isEmpty(resourcePackage)) {
      aarLibraryBuilder.setResourcePackage(resourcePackage);
    }
    return super.toProto().toBuilder().setAarLibrary(aarLibraryBuilder.build()).build();
  }

  @Nullable
  public File getLintRuleJar(Project project, ArtifactLocationDecoder decoder) {
    UnpackedAars unpackedAars = UnpackedAars.getInstance(project);
    File lintRuleJar = unpackedAars.getLintRuleJar(decoder, this);
    return (lintRuleJar == null || !lintRuleJar.exists()) ? null : lintRuleJar;
  }

  @Override
  public int hashCode() {
    return Objects.hash(super.hashCode(), libraryArtifact, aarArtifact, resourcePackage);
  }

  @Override
  public LibraryFilesProvider getDefaultLibraryFilesProvider(Project project) {
    return new DefaultAarLibraryFilesProvider(project);
  }

  @Override
  public boolean equals(Object other) {
    if (this == other) {
      return true;
    }
    if (!(other instanceof AarLibrary)) {
      return false;
    }

    AarLibrary that = (AarLibrary) other;
    return super.equals(other)
        && Objects.equals(this.libraryArtifact, that.libraryArtifact)
        && this.aarArtifact.equals(that.aarArtifact)
        && Objects.equals(this.resourcePackage, that.resourcePackage);
  }

  @Override
  public String getExtension() {
    return SdkConstants.DOT_AAR;
  }

  /** An implementation of {@link LibraryFilesProvider} for {@link AarLibrary}. */
  private final class DefaultAarLibraryFilesProvider implements LibraryFilesProvider {
    private final Project project;

    DefaultAarLibraryFilesProvider(Project project) {
      this.project = project;
    }

    @Override
    public String getName() {
      return AarLibrary.this.key.getIntelliJLibraryName();
    }

    @Override
    public ImmutableList<File> getClassFiles(BlazeProjectData blazeProjectData) {
      UnpackedAars unpackedAars = UnpackedAars.getInstance(project);
      File resourceDirectory =
          UnpackedAars.getInstance(project)
              .getResourceDirectory(blazeProjectData.getArtifactLocationDecoder(), AarLibrary.this);
      if (resourceDirectory == null) {
        logger.warn("No resource directory found for aar: " + aarArtifact);
        return ImmutableList.of();
      }

      File jar =
          unpackedAars.getClassJar(blazeProjectData.getArtifactLocationDecoder(), AarLibrary.this);
      // not every aar has class jar attached, do not return non-existent jar to avoid false alarm
      // log.
      if (jar != null && jar.exists()) {
        return ImmutableList.of(resourceDirectory, jar);
      }
      return ImmutableList.of(resourceDirectory);
    }

    @Override
    public ImmutableList<File> getSourceFiles(BlazeProjectData blazeProjectData) {
      // Unconditionally add any linked to source jars. BlazeJarLibrary doesn't do this - it only
      // attaches sources for libraries that the user explicitly asks for. We don't do that for two
      // reasons: 1) all the logic for attaching sources to a library (AttachSourceJarAction,
      // BlazeSourceJarNavigationPolicy, LibraryActionHelper etc) are all tied to Java specific
      // libraries, and 2) So far, aar_imports are primarily used for very few 3rd party
      // dependencies.
      // Longer term, we may want to make this behave just like the Java libraries.
      return UnpackedAars.getInstance(project)
          .getCachedSrcJars(blazeProjectData.getArtifactLocationDecoder(), AarLibrary.this);
    }

    @Override
    public boolean equals(Object other) {
      if (this == other) {
        return true;
      }
      if (!(other instanceof DefaultAarLibraryFilesProvider)) {
        return false;
      }

      DefaultAarLibraryFilesProvider that = (DefaultAarLibraryFilesProvider) other;
      return Objects.equals(project, that.project) && getName().equals(that.getName());
    }

    @Override
    public int hashCode() {
      return Objects.hash(project, getName());
    }
  }
}


text:
package testing

import (
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"strings"
	"testing"

	"github.com/mitchellh/packer/packer"
	"github.com/mitchellh/packer/template"
)

// TestEnvVar must be set to a non-empty value for acceptance tests to run.
const TestEnvVar = "PACKER_ACC"

// TestCase is a single set of tests to run for a backend. A TestCase
// should generally map 1:1 to each test method for your acceptance
// tests.
type TestCase struct {
	// Precheck, if non-nil, will be called once before the test case
	// runs at all. This can be used for some validation prior to the
	// test running.
	PreCheck func()

	// Builder is the Builder that will be tested. It will be available
	// as the "test" builder in the template.
	Builder packer.Builder

	// Template is the template contents to use.
	Template string

	// Check is called after this step is executed in order to test that
	// the step executed successfully. If this is not set, then the next
	// step will be called
	Check TestCheckFunc

	// Teardown will be called before the test case is over regardless
	// of if the test succeeded or failed. This should return an error
	// in the case that the test can't guarantee all resources were
	// properly cleaned up.
	Teardown TestTeardownFunc

	// If SkipArtifactTeardown is true, we will not attempt to destroy the
	// artifact created in this test run.
	SkipArtifactTeardown bool
}

// TestCheckFunc is the callback used for Check in TestStep.
type TestCheckFunc func([]packer.Artifact) error

// TestTeardownFunc is the callback used for Teardown in TestCase.
type TestTeardownFunc func() error

// TestT is the interface used to handle the test lifecycle of a test.
//
// Users should just use a *testing.T object, which implements this.
type TestT interface {
	Error(args ...interface{})
	Fatal(args ...interface{})
	Skip(args ...interface{})
}

// Test performs an acceptance test on a backend with the given test case.
//
// Tests are not run unless an environmental variable "PACKER_ACC" is
// set to some non-empty value. This is to avoid test cases surprising
// a user by creating real resources.
//
// Tests will fail unless the verbose flag (`go test -v`, or explicitly
// the "-test.v" flag) is set. Because some acceptance tests take quite
// long, we require the verbose flag so users are able to see progress
// output.
func Test(t TestT, c TestCase) {
	// We only run acceptance tests if an env var is set because they're
	// slow and generally require some outside configuration.
	if os.Getenv(TestEnvVar) == "" {
		t.Skip(fmt.Sprintf(
			"Acceptance tests skipped unless env '%s' set",
			TestEnvVar))
		return
	}

	// We require verbose mode so that the user knows what is going on.
	if !testTesting && !testing.Verbose() {
		t.Fatal("Acceptance tests must be run with the -v flag on tests")
		return
	}

	// Run the PreCheck if we have it
	if c.PreCheck != nil {
		c.PreCheck()
	}

	// Parse the template
	log.Printf("[DEBUG] Parsing template...")
	tpl, err := template.Parse(strings.NewReader(c.Template))
	if err != nil {
		t.Fatal(fmt.Sprintf("Failed to parse template: %s", err))
		return
	}

	// Build the core
	log.Printf("[DEBUG] Initializing core...")
	core, err := packer.NewCore(&packer.CoreConfig{
		Components: packer.ComponentFinder{
			Builder: func(n string) (packer.Builder, error) {
				if n == "test" {
					return c.Builder, nil
				}

				return nil, nil
			},
		},
		Template: tpl,
	})
	if err != nil {
		t.Fatal(fmt.Sprintf("Failed to init core: %s", err))
		return
	}

	// Get the build
	log.Printf("[DEBUG] Retrieving 'test' build")
	build, err := core.Build("test")
	if err != nil {
		t.Fatal(fmt.Sprintf("Failed to get 'test' build: %s", err))
		return
	}

	// Prepare it
	log.Printf("[DEBUG] Preparing 'test' build")
	warnings, err := build.Prepare()
	if err != nil {
		t.Fatal(fmt.Sprintf("Prepare error: %s", err))
		return
	}
	if len(warnings) > 0 {
		t.Fatal(fmt.Sprintf(
			"Prepare warnings:\n\n%s",
			strings.Join(warnings, "\n")))
		return
	}

	// Run it! We use a temporary directory for caching and discard
	// any UI output. We discard since it shows up in logs anyways.
	log.Printf("[DEBUG] Running 'test' build")
	cache := &packer.FileCache{CacheDir: os.TempDir()}
	ui := &packer.BasicUi{
		Reader:      os.Stdin,
		Writer:      ioutil.Discard,
		ErrorWriter: ioutil.Discard,
	}
	artifacts, err := build.Run(ui, cache)
	if err != nil {
		t.Fatal(fmt.Sprintf("Run error:\n\n%s", err))
		goto TEARDOWN
	}

	// Check function
	if c.Check != nil {
		log.Printf("[DEBUG] Running check function")
		if err := c.Check(artifacts); err != nil {
			t.Fatal(fmt.Sprintf("Check error:\n\n%s", err))
			goto TEARDOWN
		}
	}

TEARDOWN:
	if !c.SkipArtifactTeardown {
		// Delete all artifacts
		for _, a := range artifacts {
			if err := a.Destroy(); err != nil {
				t.Error(fmt.Sprintf(
					"!!! ERROR REMOVING ARTIFACT '%s': %s !!!",
					a.String(), err))
			}
		}
	}

	// Teardown
	if c.Teardown != nil {
		log.Printf("[DEBUG] Running teardown function")
		if err := c.Teardown(); err != nil {
			t.Fatal(fmt.Sprintf("Teardown failure:\n\n%s", err))
			return
		}
	}
}

// This is for unit tests of this package.
var testTesting = false