text:
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package base

import com.intellij.lang.ASTNode
import com.intellij.psi._
import com.intellij.psi.impl.source.tree.LeafPsiElement
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.util.IncorrectOperationException
import org.jetbrains.plugins.scala.annotator.intention.ScalaImportTypeFix
import org.jetbrains.plugins.scala.annotator.intention.ScalaImportTypeFix.{ClassTypeToImport, TypeAliasToImport}
import org.jetbrains.plugins.scala.lang.completion.lookups.LookupElementManager
import org.jetbrains.plugins.scala.lang.formatting.settings.ScalaCodeStyleSettings
import org.jetbrains.plugins.scala.lang.lexer.ScalaTokenTypes
import org.jetbrains.plugins.scala.lang.psi.api.ScalaElementVisitor
import org.jetbrains.plugins.scala.lang.psi.api.base._
import org.jetbrains.plugins.scala.lang.psi.api.base.patterns.{ScBindingPattern, ScConstructorPattern, ScInfixPattern, ScInterpolationPattern}
import org.jetbrains.plugins.scala.lang.psi.api.base.types.{ScInfixTypeElement, ScParameterizedTypeElement, ScSimpleTypeElement}
import org.jetbrains.plugins.scala.lang.psi.api.expr.{ScSuperReference, ScThisReference}
import org.jetbrains.plugins.scala.lang.psi.api.statements.{ScFunction, ScMacroDefinition, ScTypeAlias}
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.imports._
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.typedef.ScMember
import org.jetbrains.plugins.scala.lang.resolve._
import org.jetbrains.plugins.scala.lang.resolve.processor.CompletionProcessor

/**
 * @author AlexanderPodkhalyuzin
 *         Date: 22.02.2008
 */

class ScStableCodeReferenceElementImpl(node: ASTNode) extends ScalaPsiElementImpl(node) with ResolvableStableCodeReferenceElement {
  override def accept(visitor: PsiElementVisitor) {
    visitor match {
      case visitor: ScalaElementVisitor => super.accept(visitor)
      case _ => super.accept(visitor)
    }
  }

  def getVariants: Array[Object] = {
    val isInImport: Boolean = ScalaPsiUtil.getParentOfType(this, classOf[ScImportStmt]) != null
    doResolve(this, new CompletionProcessor(getKinds(incomplete = true), this)).flatMap {
      case res: ScalaResolveResult =>
        import org.jetbrains.plugins.scala.lang.psi.types.api.Nothing
        val qualifier = res.fromType.getOrElse(Nothing)
        LookupElementManager.getLookupElement(res, isInImport = isInImport, qualifierType = qualifier, isInStableCodeReference = true)
      case r => Seq(r.getElement)
    }
  }

  def getResolveResultVariants: Array[ScalaResolveResult] = {
    doResolve(this, new CompletionProcessor(getKinds(incomplete = true), this)).flatMap {
      case res: ScalaResolveResult => Seq(res)
      case r => Seq.empty
    }
  }

  def getConstructor = {
    getContext match {
      case s: ScSimpleTypeElement =>
        s.getContext match {
          case p: ScParameterizedTypeElement =>
            p.getContext match {
              case constr: ScConstructor => Some(constr)
              case _ => None
            }
          case constr: ScConstructor => Some(constr)
          case _ => None
        }
      case _ => None
    }
  }

  def isConstructorReference = getConstructor.nonEmpty

  override def toString: String = "CodeReferenceElement: " + getText

  def getKinds(incomplete: Boolean, completion: Boolean): Set[ResolveTargets.Value] = {
    import org.jetbrains.plugins.scala.lang.resolve.StdKinds._

    // The qualified identifier immediately following the `macro` keyword
    // may only refer to a method.
    def isInMacroDef = getContext match {
      case _: ScMacroDefinition =>
        prevSiblings.exists {
          case l: LeafPsiElement if l.getNode.getElementType == ScalaTokenTypes.kMACRO => true
          case _ => false
        }
      case _ => false
    }

    val result = getContext match {
      case _: ScStableCodeReferenceElement => stableQualRef
      case e: ScImportExpr => if (e.selectorSet != None
              //import Class._ is not allowed
              || qualifier == None || e.singleWildcard) stableQualRef
      else stableImportSelector
      case ste: ScSimpleTypeElement =>
        if (incomplete) noPackagesClassCompletion // todo use the settings to include packages
        else if (ste.getLastChild.isInstanceOf[PsiErrorElement]) stableQualRef

        else if (ste.singleton) stableQualRef
        else stableClass
      case _: ScTypeAlias => stableClass
      case _: ScInterpolationPattern => stableImportSelector
      case _: ScConstructorPattern => objectOrValue
      case _: ScInfixPattern => objectOrValue
      case _: ScThisReference | _: ScSuperReference => stableClassOrObject
      case _: ScImportSelector => stableImportSelector
      case _: ScInfixTypeElement => stableClass
      case _ if isInMacroDef => methodsOnly
      case _ => stableQualRef
    }
    if (completion) result + ResolveTargets.PACKAGE + ResolveTargets.OBJECT + ResolveTargets.VAL else result
  }

  def nameId: PsiElement = findChildByType[PsiElement](ScalaTokenTypes.tIDENTIFIER)

  //  @throws(IncorrectOperationException)
  def bindToElement(element: PsiElement): PsiElement = {
    if (isReferenceTo(element)) this
    else {
      val aliasedRef: Option[ScReferenceElement] = ScalaPsiUtil.importAliasFor(element, this)
      if (aliasedRef.isDefined) {
        this.replace(aliasedRef.get)
      }
      else {
        def bindToType(c: ScalaImportTypeFix.TypeToImport): PsiElement = {
          val suitableKinds = getKinds(incomplete = false)
          if (!ResolveUtils.kindMatches(element, suitableKinds))
            throw new IncorrectOperationException("class does not match expected kind, problem place: " + {
              if (getContext != null)
                if (getContext.getContext != null)
                  if (getContext.getContext.getContext != null)
                    getContext.getContext.getContext.getText
                  else getContext.getContext.getText
                else getContext.getText
              else getText
            })
          if (nameId.getText != c.name) {
            val ref = ScalaPsiElementFactory.createReferenceFromText(c.name, getManager)
            return this.replace(ref).asInstanceOf[ScStableCodeReferenceElement].bindToElement(element)
          }
          val qname = c.qualifiedName
          val isPredefined = ScalaCodeStyleSettings.getInstance(getProject).hasImportWithPrefix(qname)
          if (qualifier.isDefined && !isPredefined) {
            val ref = ScalaPsiElementFactory.createReferenceFromText(c.name, getContext, this)
            if (ref.isReferenceTo(element)) {
              val ref = ScalaPsiElementFactory.createReferenceFromText(c.name, getManager)
              return this.replace(ref)
            }
          }
          if (qname != null) {
            val selector: ScImportSelector = PsiTreeUtil.getParentOfType(this, classOf[ScImportSelector])
            if (selector != null) {
              val importExpr = PsiTreeUtil.getParentOfType(this, classOf[ScImportExpr])
              selector.deleteSelector() //we can't do anything here, so just simply delete it
              return importExpr.reference.get //todo: what we should return exactly?
              //              }
            } else getParent match {
              case importExpr: ScImportExpr if !importExpr.singleWildcard && !importExpr.selectorSet.isDefined =>
                val holder = PsiTreeUtil.getParentOfType(this, classOf[ScImportsHolder])
                importExpr.deleteExpr()
                c match {
                  case ClassTypeToImport(clazz) => holder.addImportForClass(clazz)
                  case ta => holder.addImportForPath(ta.qualifiedName)
                }
              //todo: so what to return? probable PIEAE after such code invocation
              case _ =>
                return safeBindToElement(qname, {
                  case (qual, true) => ScalaPsiElementFactory.createReferenceFromText(qual, getContext, this)
                  case (qual, false) => ScalaPsiElementFactory.createReferenceFromText(qual, getManager)
                }) {
                  c match {
                    case ClassTypeToImport(clazz) =>
                      ScalaImportTypeFix.getImportHolder(ref = this, project = getProject).
                        addImportForClass(clazz, ref = this)
                    case ta =>
                      ScalaImportTypeFix.getImportHolder(ref = this, project = getProject).
                        addImportForPath(ta.qualifiedName, ref = this)
                  }
                  if (qualifier != None) {
                    //let's make our reference unqualified
                    val ref: ScStableCodeReferenceElement = ScalaPsiElementFactory.createReferenceFromText(c.name, getManager)
                    this.replace(ref).asInstanceOf[ScReferenceElement]
                  }
                  this
                }
            }
          }
          this
        }
        element match {
          case c: PsiClass => bindToType(ClassTypeToImport(c))
          case ta: ScTypeAlias =>
            if (ta.containingClass != null && ScalaPsiUtil.hasStablePath(ta)) {
              bindToType(TypeAliasToImport(ta))
            } else {
              //todo: nothing to do yet, probably in future it would be great to implement something context-specific
              this
            }
          case binding: ScBindingPattern =>
            binding.nameContext match {
              case member: ScMember =>
                val containingClass = member.containingClass
                val refToClass = bindToElement(containingClass)
                val refToMember = ScalaPsiElementFactory.createReferenceFromText(refToClass.getText + "." + binding.name, getManager)
                this.replace(refToMember).asInstanceOf[ScReferenceElement]
            }
          case fun: ScFunction if Seq("unapply", "unapplySeq").contains(fun.name) && ScalaPsiUtil.hasStablePath(fun) =>
            bindToElement(fun.containingClass)
          case fun: ScFunction if fun.isConstructor =>
            bindToElement(fun.containingClass)
          case m: PsiMethod if m.isConstructor =>
            bindToElement(m.getContainingClass)
          case pckg: PsiPackage => bindToPackage(pckg)
          case _ => throw new IncorrectOperationException(s"Cannot bind to $element")
        }
      }
    }
  }

  //TODO: probably replace
  def getSameNameVariants: Array[ResolveResult] = doResolve(this, new CompletionProcessor(getKinds(incomplete = true), this, false, Some(refName.inName)))

  override def delete() {
    getContext match {
      case sel: ScImportSelector => sel.deleteSelector()
      case expr: ScImportExpr => expr.deleteExpr()
      case _ => super.delete()
    }
  }
}


text:
import React from 'react'
import Reflux from 'reflux'
import UsersStore from '../stores/usersstore'

var UsersList = React.createClass({

    mixins: [Reflux.connect(UsersStore, 'users')],

    render() {
        let usersToRender = this.state.users.map(function (user, i) {
            return(

{user}

            )
        })
        return(

{this.state.users.length} Users Online

                    {usersToRender}

        )
    }
})

module.exports = UsersList

redpajama_set_name: RedPajamaGithub


text:
@interface ZFPerformanceOptimizationViewController ()

@end

@implementation ZFPerformanceOptimizationViewController
#pragma mark - 初始化视图
- (void)viewDidLoad {
    [super viewDidLoad];
    [self setting];
}
#pragma mark - 设置
- (void)setting {

}
#pragma mark -

#pragma mark -

#pragma mark -

#pragma mark -

#pragma mark -

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end


text:
namespace filter {

struct ScalePoint: public Filter
{
  ScalePoint(Filter* pf0, double x, double y, double z): Filter(pf0), _xScale(x), _yScale(y), _zScale(z) {}

  double GetValue (double x, double y, double z) const
  {
    return _pSource[0]->GetValue (x * _xScale, y * _yScale, z * _zScale);
  }

protected:
  double _xScale;
  double _yScale;
  double _zScale;
};

}


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <group android:checkableBehavior="single">
        <item
            android:id="@+id/nav_today"
            android:icon="@drawable/ic_menu_camera"
            android:title="Today" />
        <item
            android:id="@+id/nav_subjects"
            android:icon="@drawable/ic_menu_gallery"
            android:title="Subjects" />
        <item
            android:id="@+id/nav_schedule"
            android:icon="@drawable/ic_menu_slideshow"
            android:title="Schedule" />
        <item
            android:id="@+id/nav_settings"
            android:icon="@drawable/ic_menu_manage"
            android:title="Settings" />
        <item
            android:id="@+id/nav_about"
            android:icon="@drawable/ic_menu_manage"
            android:title="About" />
    </group>

</menu>


text:
class CreatePrototypes < ActiveRecord::Migration
  def change
    create_table :prototypes do |t|
      t.string :name
      t.attachment :image
      t.boolean :show

      t.timestamps
    end
  end
end


text:
import pygame, os
from gi.repository import Gtk

from entity import Entity

class Background(Entity):

    # The total amount of defined levels in the game
    TOTAL_LEVELS = 4

    def __init__(self, x, y):
        Entity.__init__(self, x, y)
        self.sprites = []
        for index in range(1, Background.TOTAL_LEVELS + 1):
            self.sprites.append(pygame.image.load(os.path.join("assets/levels/" + str(index) + "/background.jpg")).convert())

        # Overlay constants
        overlayColor = (0, 0, 0, 127)
        overlayRect = pygame.Rect(3, 3, 300, 160)
        self.overlaySurface = pygame.Surface((300, 160), pygame.SRCALPHA)
        self.overlaySurface.fill(overlayColor, overlayRect)

    def draw(self, level, screen, drawOverlay):

        # Determine the index of the background to draw
        index = (level - 1) % len(self.sprites)

        # Draw the background
        screen.blit(self.sprites[index], (self.x, self.y))

        # Draw the overlay surface
        if drawOverlay:
            screen.blit(self.overlaySurface, (3, 3))


text:
<?php

namespace Proxies\__CG__\Ibw\MagSoftBundle\Entity;

/**
 * DO NOT EDIT THIS FILE - IT WAS CREATED BY DOCTRINE'S PROXY GENERATOR
 */
class Clienti extends \Ibw\MagSoftBundle\Entity\Clienti implements \Doctrine\ORM\Proxy\Proxy
{
    /**
     * @var \Closure the callback responsible for loading properties in the proxy object. This callback is called with
     *      three parameters, being respectively the proxy object to be initialized, the method that triggered the
     *      initialization process and an array of ordered parameters that were passed to that method.
     *
     * @see \Doctrine\Common\Persistence\Proxy::__setInitializer
     */
    public $__initializer__;

    /**
     * @var \Closure the callback responsible of loading properties that need to be copied in the cloned object
     *
     * @see \Doctrine\Common\Persistence\Proxy::__setCloner
     */
    public $__cloner__;

    /**
     * @var boolean flag indicating if this object was already initialized
     *
     * @see \Doctrine\Common\Persistence\Proxy::__isInitialized
     */
    public $__isInitialized__ = false;

    /**
     * @var array properties to be lazy loaded, with keys being the property
     *            names and values being their default values
     *
     * @see \Doctrine\Common\Persistence\Proxy::__getLazyProperties
     */
    public static $lazyPropertiesDefaults = array();

    /**
     * @param \Closure $initializer
     * @param \Closure $cloner
     */
    public function __construct($initializer = null, $cloner = null)
    {

        $this->__initializer__ = $initializer;
        $this->__cloner__      = $cloner;
    }

    /**
     *
     * @return array
     */
    public function __sleep()
    {
        if ($this->__isInitialized__) {
            return array('__isInitialized__', 'id', 'numeClient', 'prenumeClient', 'localitate', 'judet', 'telefon', 'strada', 'nr', 'bloc', 'scara', 'etaj', 'apartament', 'parteneri', 'proiecte', 'documents');
        }

        return array('__isInitialized__', 'id', 'numeClient', 'prenumeClient', 'localitate', 'judet', 'telefon', 'strada', 'nr', 'bloc', 'scara', 'etaj', 'apartament', 'parteneri', 'proiecte', 'documents');
    }

    /**
     *
     */
    public function __wakeup()
    {
        if ( ! $this->__isInitialized__) {
            $this->__initializer__ = function (Clienti $proxy) {
                $proxy->__setInitializer(null);
                $proxy->__setCloner(null);

                $existingProperties = get_object_vars($proxy);

                foreach ($proxy->__getLazyProperties() as $property => $defaultValue) {
                    if ( ! array_key_exists($property, $existingProperties)) {
                        $proxy->$property = $defaultValue;
                    }
                }
            };

        }
    }

    /**
     *
     */
    public function __clone()
    {
        $this->__cloner__ && $this->__cloner__->__invoke($this, '__clone', array());
    }

    /**
     * Forces initialization of the proxy
     */
    public function __load()
    {
        $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', array());
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __isInitialized()
    {
        return $this->__isInitialized__;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __setInitialized($initialized)
    {
        $this->__isInitialized__ = $initialized;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __setInitializer(\Closure $initializer = null)
    {
        $this->__initializer__ = $initializer;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __getInitializer()
    {
        return $this->__initializer__;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     */
    public function __setCloner(\Closure $cloner = null)
    {
        $this->__cloner__ = $cloner;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific cloning logic
     */
    public function __getCloner()
    {
        return $this->__cloner__;
    }

    /**
     * {@inheritDoc}
     * @internal generated method: use only when explicitly handling proxy specific loading logic
     * @static
     */
    public function __getLazyProperties()
    {
        return self::$lazyPropertiesDefaults;
    }

    /**
     * {@inheritDoc}
     */
    public function getProiecte()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getProiecte', array());

        return parent::getProiecte();
    }

    /**
     * {@inheritDoc}
     */
    public function removeProiecte(\Ibw\MagSoftBundle\Entity\Parteneri $proiecte)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'removeProiecte', array($proiecte));

        return parent::removeProiecte($proiecte);
    }

    /**
     * {@inheritDoc}
     */
    public function addProiecte(\Ibw\MagSoftBundle\Entity\Proiecte $proiecte)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'addProiecte', array($proiecte));

        return parent::addProiecte($proiecte);
    }

    /**
     * {@inheritDoc}
     */
    public function getDocuments()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDocuments', array());

        return parent::getDocuments();
    }

    /**
     * {@inheritDoc}
     */
    public function removeDocuments(\Ibw\MagSoftBundle\Entity\Document $documents)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'removeDocuments', array($documents));

        return parent::removeDocuments($documents);
    }

    /**
     * {@inheritDoc}
     */
    public function addDocuments(\Ibw\MagSoftBundle\Entity\Document $documents)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'addDocuments', array($documents));

        return parent::addDocuments($documents);
    }

    /**
     * {@inheritDoc}
     */
    public function getParteneri()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getParteneri', array());

        return parent::getParteneri();
    }

    /**
     * {@inheritDoc}
     */
    public function setParteneri(\Ibw\MagSoftBundle\Entity\Parteneri $parteneri = NULL)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setParteneri', array($parteneri));

        return parent::setParteneri($parteneri);
    }

    /**
     * {@inheritDoc}
     */
    public function getId()
    {
        if ($this->__isInitialized__ === false) {
            return (int)  parent::getId();
        }

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array());

        return parent::getId();
    }

    /**
     * {@inheritDoc}
     */
    public function setNumeClient($numeClient)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setNumeClient', array($numeClient));

        return parent::setNumeClient($numeClient);
    }

    /**
     * {@inheritDoc}
     */
    public function getNumeClient()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getNumeClient', array());

        return parent::getNumeClient();
    }

    /**
     * {@inheritDoc}
     */
    public function setPrenumeClient($prenumeClient)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setPrenumeClient', array($prenumeClient));

        return parent::setPrenumeClient($prenumeClient);
    }

    /**
     * {@inheritDoc}
     */
    public function getPrenumeClient()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getPrenumeClient', array());

        return parent::getPrenumeClient();
    }

    /**
     * {@inheritDoc}
     */
    public function setLocalitate($localitate)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setLocalitate', array($localitate));

        return parent::setLocalitate($localitate);
    }

    /**
     * {@inheritDoc}
     */
    public function getLocalitate()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getLocalitate', array());

        return parent::getLocalitate();
    }

    /**
     * {@inheritDoc}
     */
    public function setJudet($judet)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setJudet', array($judet));

        return parent::setJudet($judet);
    }

    /**
     * {@inheritDoc}
     */
    public function getJudet()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getJudet', array());

        return parent::getJudet();
    }

    /**
     * {@inheritDoc}
     */
    public function setTelefon($telefon)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setTelefon', array($telefon));

        return parent::setTelefon($telefon);
    }

    /**
     * {@inheritDoc}
     */
    public function getTelefon()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getTelefon', array());

        return parent::getTelefon();
    }

    /**
     * {@inheritDoc}
     */
    public function setStrada($strada)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setStrada', array($strada));

        return parent::setStrada($strada);
    }

    /**
     * {@inheritDoc}
     */
    public function getStrada()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getStrada', array());

        return parent::getStrada();
    }

    /**
     * {@inheritDoc}
     */
    public function setNr($nr)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setNr', array($nr));

        return parent::setNr($nr);
    }

    /**
     * {@inheritDoc}
     */
    public function getNr()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getNr', array());

        return parent::getNr();
    }

    /**
     * {@inheritDoc}
     */
    public function setBloc($bloc)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setBloc', array($bloc));

        return parent::setBloc($bloc);
    }

    /**
     * {@inheritDoc}
     */
    public function getBloc()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getBloc', array());

        return parent::getBloc();
    }

    /**
     * {@inheritDoc}
     */
    public function setScara($scara)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setScara', array($scara));

        return parent::setScara($scara);
    }

    /**
     * {@inheritDoc}
     */
    public function getScara()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getScara', array());

        return parent::getScara();
    }

    /**
     * {@inheritDoc}
     */
    public function setEtaj($etaj)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setEtaj', array($etaj));

        return parent::setEtaj($etaj);
    }

    /**
     * {@inheritDoc}
     */
    public function getEtaj()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getEtaj', array());

        return parent::getEtaj();
    }

    /**
     * {@inheritDoc}
     */
    public function setApartament($apartament)
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'setApartament', array($apartament));

        return parent::setApartament($apartament);
    }

    /**
     * {@inheritDoc}
     */
    public function getApartament()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, 'getApartament', array());

        return parent::getApartament();
    }

    /**
     * {@inheritDoc}
     */
    public function __toString()
    {

        $this->__initializer__ && $this->__initializer__->__invoke($this, '__toString', array());

        return parent::__toString();
    }

}


text:
$(document).ready(function(){
  $('form').on('change', '#application_submission_notify_of_denial', function(){
    var inform = this.checked
    $('.rejection-message').toggle(inform);
  })
});


text:
<!DOCTYPE html>

    <title>CleanMyAdmin</title>


text:
function [d imFnames]=strings9()
full_fname = 'strings9.mat';
fname = '/home/drc/code/crazyflie-tools/logs/cf2/tests0510/strings9.mat';
if (exist(full_fname,'file'))
    filename = full_fname;
else
    filename = fname;
end
d = load(filename);


text:
"""
wav32_to_wav16.py

Script to quickly convert a directory of 32 bit waveform files to 16 bit
waveform file.

Author:
        – Jon Clucas, 2016 (jon.clucas@childmind.org)

© 2016, Child Mind Institute, Apache v2.0 License

Created on Fri Dec 23 12:43:40 2016

@author: jon.clucas
"""
import argparse, subprocess
from os import path, walk

def wav32_to_wav16(in_file):
    # make an output filename
    out_base = path.basename(in_file).strip('.wav').strip('.WAV')
    out_i = 0
    out_file = path.join(path.dirname(in_file), ''.join([out_base, '.wav']))
    while path.exists(out_file):
        out_file = path.join(path.dirname(in_file), ''.join([out_base, '_',
                   str(out_i), '.wav']))
        out_i = out_i + 1
    # do the conversion verbosely
    to_convert = ''.join(["ffmpeg -i ", in_file, " -ac 2 -acodec pcm_s16le ",
                 out_file])
    print(''.join(["Converting ", in_file, " to ", out_file]))
    subprocess.call(to_convert, shell = True)

def main():
    # script can be run from the command line
    parser = argparse.ArgumentParser(description='get directory')
    parser.add_argument('in_dir', metavar='in_dir', type=str)
    arg = parser.parse_args()
    for root, dirs, files in walk(arg.in_dir):
        for file in files:
            if file.casefold().endswith(".wav".casefold()):
                wav32_to_wav16(path.join(root, file))
            elif file.casefold().endswith(".mxf".casefold()):
                mxf.mxf_to_wav(path.join(root, file))
            else:
                pass

# ============================================================================
if __name__ == '__main__':
    main()


text:
icckundli.com
=============

Official website of indian carrying corporation a kundli based transport company.


text:
@interface SearchResult : MTLModel <MTLJSONSerializing>

@property (readonly, nonatomic, copy) Class model;

@property (readonly, nonatomic, copy) NSString *modelID;
@property (readonly, nonatomic, copy) NSString *displayText;
@property (readonly, nonatomic, copy) NSString *label;
@property (readonly, nonatomic, copy) NSString *searchDetail;
@property (readonly, nonatomic, strong) NSNumber *isPublished;

+ (BOOL)searchResultIsSupported:(NSDictionary *)dict;
- (NSURLRequest *)imageRequest;
@end


text:
require 'timewizard/versioner/worklight'

RSpec.describe 'Timewizard::Versioner::Worklight' do

  before(:example) do
    pwd = Dir.pwd.to_s

    FileUtils.rm_rf Dir["#{pwd}/tmp"]
    FileUtils.rm_rf Dir["#{pwd}/pkg"]

    pwd = Dir.pwd.to_s
    FileUtils.cp_r("#{pwd}/resources/.", "#{pwd}/tmp")

    @versioner = Timewizard::Versioner::Worklight.new "#{pwd}/tmp/worklight/application-descriptor.xml"
  end

  context '.new' do
    it 'should raise error if arg is nil' do
      expect { Timewizard::Versioner::Worklight.new nil }.to raise_error("passed in file cannot be nil")
    end

    it 'should not raise error if arg is not nil' do
      expect { Timewizard::Versioner::Worklight.new '' }.not_to raise_error
    end
  end

  context '#file' do
    it 'should be an application-descriptor.xml' do
      expect(@versioner.file).to eq("#{Dir.pwd.to_s}/tmp/worklight/application-descriptor.xml")
    end
  end

  context '#old_build_number' do
    it 'should be nil' do
      expect(@versioner.old_build_number).to be_nil
    end
  end

  context '#old_version_number' do
    it 'should be nil' do
      expect(@versioner.old_version_number).to be_nil
    end
  end

  context '#new_build_number' do
    it 'should be nil' do
      expect(@versioner.new_build_number).to be_nil
    end
  end

  context '#new_build_number=' do
    it 'should change instance variable' do
      @versioner.new_build_number = '1'
      expect(@versioner.new_build_number).not_to be_nil
      @versioner.new_build_number = nil
      expect(@versioner.new_build_number).to be_nil
    end
  end

  context '#new_version_number' do
    it 'should be nil' do
      expect(@versioner.new_version_number).to be_nil
    end
  end

  context '#new_version_number=' do
    it 'should change instance variable' do
      @versioner.new_version_number = '1'
      expect(@versioner.new_version_number).not_to be_nil
      @versioner.new_version_number = nil
      expect(@versioner.new_version_number).to be_nil
    end
  end

  context '#read_build_numbers' do
    it 'should not raise an error' do
      expect { @versioner.read_build_numbers }.to_not raise_error
    end

    it 'should change instance variables' do
      expect(@versioner.old_build_number).to be_nil
      expect(@versioner.new_build_number).to be_nil
      @versioner.read_build_numbers
      expect(@versioner.old_build_number).to eq('0.0.1')
      expect(@versioner.new_build_number).to eq('0.0.2')
    end
  end

  context '#read_version_numbers' do
    it 'should not raise an error' do
      expect { @versioner.read_version_numbers }.to_not raise_error
    end

    it 'should change instance variables' do
      expect(@versioner.old_version_number).to be_nil
      expect(@versioner.new_version_number).to be_nil
      @versioner.read_version_numbers
      expect(@versioner.old_version_number).to eq('0.0.1')
      expect(@versioner.new_version_number).to eq('0.0.1')
    end
  end

  context '#write_build_numbers' do
    before(:example) do
      @versioner.read_build_numbers
    end

    it 'should not raise an error' do
      expect { @versioner.write_version_numbers }.to_not raise_error
    end

    it 'should not change instance variables' do
      expect(@versioner.old_build_number).to eq('0.0.1')
      expect(@versioner.new_build_number).to eq('0.0.2')
      @versioner.write_build_numbers
      expect(@versioner.old_build_number).to eq('0.0.1')
      expect(@versioner.new_build_number).to eq('0.0.2')
    end

    it 'should not change contents of parsed file' do
      expect(@versioner.old_build_number).to eq('0.0.1')
      expect(@versioner.new_build_number).to eq('0.0.2')
      @versioner.write_build_numbers
      @versioner.read_build_numbers
      expect(@versioner.old_build_number).to eq('0.0.1')
      expect(@versioner.new_build_number).to eq('0.0.2')
    end
  end

  context '#write_version_numbers' do
    before(:example) do
      @versioner.read_version_numbers
    end

    it 'should not raise an error' do
      expect { @versioner.write_version_numbers }.to_not raise_error
    end

    it 'should not change instance variables' do
      expect(@versioner.old_version_number).to eq('0.0.1')
      expect(@versioner.new_version_number).to eq('0.0.1')
      @versioner.write_version_numbers
      expect(@versioner.old_version_number).to eq('0.0.1')
      expect(@versioner.new_version_number).to eq('0.0.1')
    end

    it 'should change contents of parsed file' do
      expect(@versioner.old_version_number).to eq('0.0.1')
      expect(@versioner.new_version_number).to eq('0.0.1')
      @versioner.new_version_number = '0.0.2'
      @versioner.write_version_numbers
      @versioner.read_version_numbers
      expect(@versioner.old_version_number).to eq('0.0.2')
      expect(@versioner.new_version_number).to eq('0.0.2')
    end
  end

end


text:
'use strict';

var _supertestAsPromised = require('supertest-as-promised');

var _supertestAsPromised2 = _interopRequireDefault(_supertestAsPromised);

var _httpStatus = require('http-status');

var _httpStatus2 = _interopRequireDefault(_httpStatus);

var _chai = require('chai');

var _chai2 = _interopRequireDefault(_chai);

var _index = require('../index');

var _index2 = _interopRequireDefault(_index);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

_chai2.default.config.includeStack = true;

describe('## Misc', function () {
    describe('# GET /api/health-check', function () {
        it('should return OK', function (done) {
            (0, _supertestAsPromised2.default)(_index2.default).get('/api/health-check').expect(_httpStatus2.default.OK).then(function (res) {
                (0, _chai.expect)(res.text).to.equal('OK');
                done();
            }).catch(done);
        });
    });

    describe('# GET /api/404', function () {
        it('should return 404 status', function (done) {
            (0, _supertestAsPromised2.default)(_index2.default).get('/api/404').expect(_httpStatus2.default.NOT_FOUND).then(function (res) {
                (0, _chai.expect)(res.body.message).to.equal('Not Found');
                done();
            }).catch(done);
        });
    });

    describe('# Error Handling', function () {
        it('should handle mongoose CastError - Cast to ObjectId failed', function (done) {
            (0, _supertestAsPromised2.default)(_index2.default).get('/api/users/56z787zzz67fc').expect(_httpStatus2.default.INTERNAL_SERVER_ERROR).then(function (res) {
                (0, _chai.expect)(res.body.message).to.equal('Internal Server Error');
                done();
            }).catch(done);
        });

        it('should handle express validation error - username is required', function (done) {
            (0, _supertestAsPromised2.default)(_index2.default).post('/api/users').send({
                mobileNumber: '1234567890'
            }).expect(_httpStatus2.default.BAD_REQUEST).then(function (res) {
                (0, _chai.expect)(res.body.message).to.equal('"username" is required');
                done();
            }).catch(done);
        });
    });
});
//# sourceMappingURL=misc.test.js.map


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Uromyces plantaginis Vestergr.

### Remarks
null


text:
var React = require('react');
var ReactRouter = require('react-router');
var PostStore = require('../PostStore');
var actions = require('../actions');

var Link = ReactRouter.Link;

var HeaderMenu = React.createClass({
    render() {
        return (

<Link to={'/programmer/'}>PROGRAMMER</Link>

<Link to={'/om/'}>OM OSS</Link>

        );
    }
});

module.exports = HeaderMenu;


text:
package org.apache.camel.component.mail;

import java.util.Map;

import javax.activation.DataHandler;
import javax.activation.FileDataSource;

import org.apache.camel.Endpoint;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.Producer;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.junit.Test;
import org.jvnet.mock_javamail.Mailbox;

/**
 * Unit test for Camel attachments and Mail attachments.
 */
public class MailAttachmentTest extends CamelTestSupport {

    @Test
    public void testSendAndReceiveMailWithAttachments() throws Exception {
        // clear mailbox
        Mailbox.clearAll();

        // START SNIPPET: e1

        // create an exchange with a normal body and attachment to be produced as email
        Endpoint endpoint = context.getEndpoint("smtp://james@mymailserver.com?password=secret");

        // create the exchange with the mail message that is multipart with a file and a Hello World text/plain message.
        Exchange exchange = endpoint.createExchange();
        Message in = exchange.getIn();
        in.setBody("Hello World");
        in.addAttachment("logo.jpeg", new DataHandler(new FileDataSource("src/test/data/logo.jpeg")));

        // create a producer that can produce the exchange (= send the mail)
        Producer producer = endpoint.createProducer();
        // start the producer
        producer.start();
        // and let it go (processes the exchange by sending the email)
        producer.process(exchange);

        // END SNIPPET: e1

        // need some time for the mail to arrive on the inbox (consumed and sent to the mock)
        Thread.sleep(2000);

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);
        Exchange out = mock.assertExchangeReceived(0);
        mock.assertIsSatisfied();

        // plain text
        assertEquals("Hello World", out.getIn().getBody(String.class));

        // attachment
        Map<String, DataHandler> attachments = out.getIn().getAttachments();
        assertNotNull("Should have attachments", attachments);
        assertEquals(1, attachments.size());

        DataHandler handler = out.getIn().getAttachment("logo.jpeg");
        assertNotNull("The logo should be there", handler);

        assertEquals("image/jpeg; name=logo.jpeg", handler.getContentType());
        assertEquals("Handler name should be the file name", "logo.jpeg", handler.getName());

        producer.stop();
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() throws Exception {
                from("pop3://james@mymailserver.com?password=secret&consumer.delay=1000").to("mock:result");
            }
        };
    }
}


text:
namespace atom {

namespace api {

Net::Net(v8::Isolate* isolate) {
  Init(isolate);
}

Net::~Net() {}

// static
v8::Local<v8::Value> Net::Create(v8::Isolate* isolate) {
  return mate::CreateHandle(isolate, new Net(isolate)).ToV8();
}

// static
void Net::BuildPrototype(v8::Isolate* isolate,
                         v8::Local<v8::FunctionTemplate> prototype) {
  prototype->SetClassName(mate::StringToV8(isolate, "Net"));
  mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
      .SetProperty("URLRequest", &Net::URLRequest);
}

v8::Local<v8::Value> Net::URLRequest(v8::Isolate* isolate) {
  return URLRequest::GetConstructor(isolate)->GetFunction();
}

}  // namespace api

}  // namespace atom

namespace {

using atom::api::Net;
using atom::api::URLRequest;

void Initialize(v8::Local<v8::Object> exports,
                v8::Local<v8::Value> unused,
                v8::Local<v8::Context> context,
                void* priv) {
  v8::Isolate* isolate = context->GetIsolate();

  URLRequest::SetConstructor(isolate, base::Bind(URLRequest::New));

  mate::Dictionary dict(isolate, exports);
  dict.Set("net", Net::Create(isolate));
  dict.Set("Net", Net::GetConstructor(isolate)->GetFunction());
}

}  // namespace

NODE_MODULE_CONTEXT_AWARE_BUILTIN(atom_browser_net, Initialize)


text:
import type { FC } from 'react'
import React from 'react'

import { CodeDisplay } from '@looker/code-editor'
import { CollapserCard } from '@looker/run-it'

interface DocSchemaProps {
  object: any
}

/**
 * It renders links to the given types and/or methods references
 */
export const DocSchema: FC<DocSchemaProps> = ({ object }) => {
  if (!object) return <></>
  const json = JSON.stringify(object, null, 2)

  return (
    <CollapserCard
      heading="Original Schema"
      defaultOpen={false}
      id="original schema"
    >
      <>
        <CodeDisplay language="json" code={json} />
      </>
    </CollapserCard>
  )
}


text:
@interface HBRedPaperStategyController : HBBaseViewController

@end


text:
package org.apache.flink.streaming.runtime.io;

import org.apache.flink.core.memory.MemorySegment;
import org.apache.flink.core.memory.MemorySegmentFactory;
import org.apache.flink.runtime.checkpoint.CheckpointMetaData;
import org.apache.flink.runtime.checkpoint.CheckpointMetrics;
import org.apache.flink.runtime.checkpoint.CheckpointOptions;
import org.apache.flink.runtime.checkpoint.decline.AlignmentLimitExceededException;
import org.apache.flink.runtime.io.disk.iomanager.IOManager;
import org.apache.flink.runtime.io.disk.iomanager.IOManagerAsync;
import org.apache.flink.runtime.io.network.api.CheckpointBarrier;
import org.apache.flink.runtime.io.network.buffer.Buffer;
import org.apache.flink.runtime.io.network.buffer.FreeingBufferRecycler;
import org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent;
import org.apache.flink.runtime.jobgraph.tasks.StatefulTask;

import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import java.io.File;
import java.util.Arrays;
import java.util.Random;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.argThat;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

/**
 * Tests for the barrier buffer's maximum limit of buffered/spilled bytes.
 */
public class BarrierBufferAlignmentLimitTest {

	private static final int PAGE_SIZE = 512;

	private static final Random RND = new Random();

	private static IOManager ioManager;

	// ------------------------------------------------------------------------
	//  Setup
	// ------------------------------------------------------------------------

	@BeforeClass
	public static void setup() {
		ioManager = new IOManagerAsync();
	}

	@AfterClass
	public static void shutdownIOManager() {
		ioManager.shutdown();
	}

	// ------------------------------------------------------------------------
	//  Tests
	// ------------------------------------------------------------------------

	/**
	 * This tests that a single alignment that buffers too much data cancels.
	 */
	@Test
	public void testBreakCheckpointAtAlignmentLimit() throws Exception {
		BufferOrEvent[] sequence = {
				// some initial buffers
				/*  0 */ createBuffer(1, 100), createBuffer(2, 70),
				/*  2 */ createBuffer(0, 42), createBuffer(2, 111),

				// starting a checkpoint
				/*  4 */ createBarrier(7, 1),
				/*  5 */ createBuffer(1, 100), createBuffer(2, 200), createBuffer(1, 300), createBuffer(0, 50),
				/*  9 */ createBarrier(7, 0),
				/* 10 */ createBuffer(2, 100), createBuffer(0, 100), createBuffer(1, 200), createBuffer(0, 200),

				// this buffer makes the alignment spill too large
				/* 14 */ createBuffer(0, 101),

				// additional data
				/* 15 */ createBuffer(0, 100), createBuffer(1, 100), createBuffer(2, 100),

				// checkpoint completes - this should not result in a "completion notification"
				/* 18 */ createBarrier(7, 2),

				// trailing buffers
				/* 19 */ createBuffer(0, 100), createBuffer(1, 100), createBuffer(2, 100)
		};

		// the barrier buffer has a limit that only 1000 bytes may be spilled in alignment
		MockInputGate gate = new MockInputGate(PAGE_SIZE, 3, Arrays.asList(sequence));
		BarrierBuffer buffer = new BarrierBuffer(gate, ioManager, 1000);

		StatefulTask toNotify = mock(StatefulTask.class);
		buffer.registerCheckpointEventHandler(toNotify);

		// validating the sequence of buffers

		check(sequence[0], buffer.getNextNonBlocked());
		check(sequence[1], buffer.getNextNonBlocked());
		check(sequence[2], buffer.getNextNonBlocked());
		check(sequence[3], buffer.getNextNonBlocked());

		// start of checkpoint
		long startTs = System.nanoTime();
		check(sequence[6], buffer.getNextNonBlocked());
		check(sequence[8], buffer.getNextNonBlocked());
		check(sequence[10], buffer.getNextNonBlocked());

		// trying to pull the next makes the alignment overflow - so buffered buffers are replayed
		check(sequence[5], buffer.getNextNonBlocked());
		validateAlignmentTime(startTs, buffer);
		verify(toNotify, times(1)).abortCheckpointOnBarrier(eq(7L), any(AlignmentLimitExceededException.class));

		// playing back buffered events
		check(sequence[7], buffer.getNextNonBlocked());
		check(sequence[11], buffer.getNextNonBlocked());
		check(sequence[12], buffer.getNextNonBlocked());
		check(sequence[13], buffer.getNextNonBlocked());
		check(sequence[14], buffer.getNextNonBlocked());

		// the additional data
		check(sequence[15], buffer.getNextNonBlocked());
		check(sequence[16], buffer.getNextNonBlocked());
		check(sequence[17], buffer.getNextNonBlocked());

		check(sequence[19], buffer.getNextNonBlocked());
		check(sequence[20], buffer.getNextNonBlocked());
		check(sequence[21], buffer.getNextNonBlocked());

		// no call for a completed checkpoint must have happened
		verify(toNotify, times(0)).triggerCheckpointOnBarrier(
			any(CheckpointMetaData.class),
			any(CheckpointOptions.class),
			any(CheckpointMetrics.class));

		assertNull(buffer.getNextNonBlocked());
		assertNull(buffer.getNextNonBlocked());

		buffer.cleanup();
		checkNoTempFilesRemain();
	}

	/**
	 * This tests the following case:
	 *   - an alignment starts
	 *   - barriers from a second checkpoint queue before the first completes
	 *   - together they are larger than the threshold
	 *   - after the first checkpoint (with second checkpoint data queued) aborts, the second completes.
	 */
	@Test
	public void testAlignmentLimitWithQueuedAlignments() throws Exception {
		BufferOrEvent[] sequence = {
				// some initial buffers
				/*  0 */ createBuffer(1, 100), createBuffer(2, 70),

				// starting a checkpoint
				/*  2 */ createBarrier(3, 2),
				/*  3 */ createBuffer(1, 100), createBuffer(2, 100),
				/*  5 */ createBarrier(3, 0),
				/*  6 */ createBuffer(0, 100), createBuffer(1, 100),

				// queue some data from the next checkpoint
				/*  8 */ createBarrier(4, 0),
				/*  9 */ createBuffer(0, 100), createBuffer(0, 120), createBuffer(1, 100),

				// this one makes the alignment overflow
				/* 12 */ createBuffer(2, 100),

				// checkpoint completed
				/* 13 */ createBarrier(3, 1),

				// more for the next checkpoint
				/* 14 */ createBarrier(4, 1),
				/* 15 */ createBuffer(0, 100), createBuffer(1, 100), createBuffer(2, 100),

				// next checkpoint completes
				/* 18 */ createBarrier(4, 2),

				// trailing data
				/* 19 */ createBuffer(0, 100), createBuffer(1, 100), createBuffer(2, 100)
		};

		// the barrier buffer has a limit that only 1000 bytes may be spilled in alignment
		MockInputGate gate = new MockInputGate(PAGE_SIZE, 3, Arrays.asList(sequence));
		BarrierBuffer buffer = new BarrierBuffer(gate, ioManager, 500);

		StatefulTask toNotify = mock(StatefulTask.class);
		buffer.registerCheckpointEventHandler(toNotify);

		// validating the sequence of buffers
		long startTs;

		check(sequence[0], buffer.getNextNonBlocked());
		check(sequence[1], buffer.getNextNonBlocked());

		// start of checkpoint
		startTs = System.nanoTime();
		check(sequence[3], buffer.getNextNonBlocked());
		check(sequence[7], buffer.getNextNonBlocked());

		// next checkpoint also in progress
		check(sequence[11], buffer.getNextNonBlocked());

		// checkpoint alignment aborted due to too much data
		check(sequence[4], buffer.getNextNonBlocked());
		validateAlignmentTime(startTs, buffer);
		verify(toNotify, times(1)).abortCheckpointOnBarrier(eq(3L), any(AlignmentLimitExceededException.class));

		// replay buffered data - in the middle, the alignment for checkpoint 4 starts
		check(sequence[6], buffer.getNextNonBlocked());
		startTs = System.nanoTime();
		check(sequence[12], buffer.getNextNonBlocked());

		// only checkpoint 4 is pending now - the last checkpoint 3 barrier will not trigger success
		check(sequence[17], buffer.getNextNonBlocked());

		// checkpoint 4 completed - check and validate buffered replay
		check(sequence[9], buffer.getNextNonBlocked());
		validateAlignmentTime(startTs, buffer);
		verify(toNotify, times(1)).triggerCheckpointOnBarrier(
			argThat(new CheckpointMatcher(4L)), any(CheckpointOptions.class), any(CheckpointMetrics.class));

		check(sequence[10], buffer.getNextNonBlocked());
		check(sequence[15], buffer.getNextNonBlocked());
		check(sequence[16], buffer.getNextNonBlocked());

		// trailing data
		check(sequence[19], buffer.getNextNonBlocked());
		check(sequence[20], buffer.getNextNonBlocked());
		check(sequence[21], buffer.getNextNonBlocked());

		// only checkpoint 4 was successfully completed, not checkpoint 3
		verify(toNotify, times(0)).triggerCheckpointOnBarrier(
			argThat(new CheckpointMatcher(3L)), any(CheckpointOptions.class), any(CheckpointMetrics.class));

		assertNull(buffer.getNextNonBlocked());
		assertNull(buffer.getNextNonBlocked());

		buffer.cleanup();
		checkNoTempFilesRemain();
	}

	// ------------------------------------------------------------------------
	//  Utilities
	// ------------------------------------------------------------------------

	private static BufferOrEvent createBuffer(int channel, int size) {
		byte[] bytes = new byte[size];
		RND.nextBytes(bytes);

		MemorySegment memory = MemorySegmentFactory.allocateUnpooledSegment(PAGE_SIZE);
		memory.put(0, bytes);

		Buffer buf = new Buffer(memory, FreeingBufferRecycler.INSTANCE);
		buf.setSize(size);

		// retain an additional time so it does not get disposed after being read by the input gate
		buf.retain();

		return new BufferOrEvent(buf, channel);
	}

	private static BufferOrEvent createBarrier(long id, int channel) {
		return new BufferOrEvent(new CheckpointBarrier(id, System.currentTimeMillis(), CheckpointOptions.forCheckpoint()), channel);
	}

	private static void check(BufferOrEvent expected, BufferOrEvent present) {
		assertNotNull(expected);
		assertNotNull(present);
		assertEquals(expected.isBuffer(), present.isBuffer());

		if (expected.isBuffer()) {
			assertEquals(expected.getBuffer().getSize(), present.getBuffer().getSize());
			MemorySegment expectedMem = expected.getBuffer().getMemorySegment();
			MemorySegment presentMem = present.getBuffer().getMemorySegment();
			assertTrue("memory contents differs", expectedMem.compare(presentMem, 0, 0, PAGE_SIZE) == 0);
		}
		else {
			assertEquals(expected.getEvent(), present.getEvent());
		}
	}

	private static void validateAlignmentTime(long startTimestamp, BarrierBuffer buffer) {
		final long elapsed = System.nanoTime() - startTimestamp;
		assertTrue("wrong alignment time", buffer.getAlignmentDurationNanos() <= elapsed);
	}

	private static void checkNoTempFilesRemain() {
		// validate that all temp files have been removed
		for (File dir : ioManager.getSpillingDirectories()) {
			for (String file : dir.list()) {
				if (file != null && !(file.equals(".") || file.equals(".."))) {
					fail("barrier buffer did not clean up temp files. remaining file: " + file);
				}
			}
		}
	}

	/**
	 * A validation matcher for checkpoint metadata against checkpoint IDs.
	 */
	private static class CheckpointMatcher extends BaseMatcher<CheckpointMetaData> {

		private final long checkpointId;

		CheckpointMatcher(long checkpointId) {
			this.checkpointId = checkpointId;
		}

		@Override
		public boolean matches(Object o) {
			return o != null &&
					o.getClass() == CheckpointMetaData.class &&
					((CheckpointMetaData) o).getCheckpointId() == checkpointId;
		}

		@Override
		public void describeTo(Description description) {
			description.appendText("CheckpointMetaData - id = " + checkpointId);
		}
	}
}


text:
import { registerBidder } from '../src/adapters/bidderFactory.js';
import { BANNER } from '../src/mediaTypes.js';

const BIDDER_CODE = 'shinez';
const BIDDER_SHORT_CODE = 'shz';
const ADAPTER_VERSION = '1.0.0';

const TARGET_URL = 'https://shinez-ssp.shinez.workers.dev/prebid';

export const spec = {
  code: BIDDER_CODE,
  version: ADAPTER_VERSION,
  aliases: {
    code: BIDDER_SHORT_CODE
  },
  supportedMediaTypes: [ BANNER ],
  isBidRequestValid: isBidRequestValid,
  buildRequests: buildRequests,
  interpretResponse: interpretResponse,
};

export const internal = {
  TARGET_URL
}

function isBidRequestValid(bid) {
  return !!(bid && bid.params &&
    bid.params.placementId && typeof bid.params.placementId === 'string' &&
    (bid.params.unit == null || (typeof bid.params.unit === 'string' && bid.params.unit.length > 0))
  );
}

function buildRequests(validBidRequests, bidderRequest) {
  const utcOffset = (new Date()).getTimezoneOffset();
  const data = [];
  validBidRequests.forEach(function(bidRequest) {
    data.push(_buildServerBidRequest(bidRequest, bidderRequest, utcOffset));
  });
  const request = {
    method: 'POST',
    url: TARGET_URL,
    data: data
  };
  return request;
}

function interpretResponse(serverResponse, request) {
  const bids = [];
  serverResponse.body.forEach(function(serverBid) {
    bids.push(_convertServerBid(serverBid));
  });
  return bids;
}

function _buildServerBidRequest(bidRequest, bidderRequest, utcOffset) {
  return {
    bidId: bidRequest.bidId,
    transactionId: bidRequest.transactionId,
    crumbs: bidRequest.crumbs,
    mediaTypes: bidRequest.mediaTypes,
    refererInfo: bidderRequest.refererInfo,
    placementId: bidRequest.params.placementId,
    utcOffset: utcOffset,
    adUnitCode: bidRequest.adUnitCode,
    unit: bidRequest.params.unit
  }
}

function _convertServerBid(response) {
  return {
    requestId: response.bidId,
    cpm: response.cpm,
    currency: response.currency,
    width: response.width,
    height: response.height,
    ad: response.ad,
    ttl: response.ttl,
    creativeId: response.creativeId,
    netRevenue: response.netRevenue
  };
}

registerBidder(spec);


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="(C) Copyright 2005" />
<meta name="DC.rights.owner" content="(C) Copyright 2005" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta content="reference" name="DC.Type" />
<meta name="DC.Title" content="Updating an index" />
<meta name="abstract" content="After an index has been created, a user can perform a bulk reindexing of the text column." />
<meta name="description" content="After an index has been created, a user can perform a bulk reindexing of the text column." />
<meta content="luceneSupport optional tool, updating an index" name="DC.subject" />
<meta content="luceneSupport optional tool, updating an index" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="rtoolsoptlucene.html" />
<meta scheme="URI" name="DC.Relation" content="rtoolsoptlucenecreate.html" />
<meta scheme="URI" name="DC.Relation" content="rtoolsoptlucenequery.html" />
<meta scheme="URI" name="DC.Relation" content="rtoolsoptlucenedrop.html" />
<meta scheme="URI" name="DC.Relation" content="rtoolsoptlucenelist.html" />
<meta scheme="URI" name="DC.Relation" content="rtoolsoptlucenesecman.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="rtoolsoptluceneupdate" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="commonltr.css" type="text/css" rel="stylesheet" />
<title>Updating an index</title>

Updating an index

After an index has been created, a user can perform a bulk reindexing
of the text column.

If SQL authorization is enabled, the database owner is the only account which
can reindex a text column in another user's table. The following procedure
reindexes the column across the whole table:

LUCENESUPPORT.UPDATEINDEX
(
    SCHEMANAME VARCHAR( 128 ),
    TABLENAME VARCHAR( 128 ),
    TEXTCOLUMN VARCHAR( 128 ),
    INDEXDESCRIPTORMAKER VARCHAR( 32672 )
)

The first three arguments identify the column to be reindexed. The last
argument lets you override how the text is indexed and how queries are
parsed.

This release of the <samp class="codeph">luceneSupport</samp> tool does not support the
incremental reindexing of data. Updating the index is a bulk operation, which
reindexes an entire data set. For this reason, this release of the
<samp class="codeph">luceneSupport</samp> tool is not appropriate for update-intensive
applications where the results of full-text queries must be current. The
<samp class="codeph">luceneSupport</samp> tool is better suited to applications for which
yesterday's full-text query results are good enough:

Read-mostly: Applications which analyze static text data

Fuzzy: Applications which can perform a bulk reindexing of the text
data periodically (for example, once a day), and which can tolerate that amount
of fuzziness in query results

Example

-- reindex a column using a custom analyzer
CALL LUCENESUPPORT.UPDATEINDEX
(
    'ruth', 'poemView', 'poemText',
    'myapp.MyIndexDescriptor.makeMe',
);

Parent topic: Using the luceneSupport optional tool

Related reference

Creating an index

Querying an index

Dropping an index

Listing indexes

Running the luceneSupport tool with a security manager


text:
package com.github.gtache.lsp.client.languageserver.requestmanager

import java.util
import java.util.concurrent.CompletableFuture

import com.github.gtache.lsp.client.languageserver.ServerStatus
import com.github.gtache.lsp.client.languageserver.wrapper.LanguageServerWrapper
import com.intellij.openapi.diagnostic.Logger
import org.eclipse.lsp4j._
import org.eclipse.lsp4j.jsonrpc.messages
import org.eclipse.lsp4j.jsonrpc.messages.CancelParams
import org.eclipse.lsp4j.services.{LanguageClient, LanguageServer, TextDocumentService, WorkspaceService}

/**
  * Basic implementation of a RequestManager which just passes requests from client to server and vice-versa
  */
class SimpleRequestManager(wrapper: LanguageServerWrapper, server: LanguageServer, client: LanguageClient, serverCapabilities: ServerCapabilities) extends RequestManager {

  private val textDocumentOptions = if (serverCapabilities.getTextDocumentSync.isRight) serverCapabilities.getTextDocumentSync.getRight else null
  private val workspaceService: WorkspaceService = server.getWorkspaceService
  private val textDocumentService: TextDocumentService = server.getTextDocumentService
  private val LOG: Logger = Logger.getInstance(classOf[SimpleRequestManager])

  //Client
  override def showMessage(messageParams: MessageParams): Unit = client.showMessage(messageParams)

  override def showMessageRequest(showMessageRequestParams: ShowMessageRequestParams): CompletableFuture[MessageActionItem] = client.showMessageRequest(showMessageRequestParams)

  override def logMessage(messageParams: MessageParams): Unit = client.logMessage(messageParams)

  override def telemetryEvent(o: Any): Unit = client.telemetryEvent(o)

  override def registerCapability(params: RegistrationParams): CompletableFuture[Void] = client.registerCapability(params)

  override def unregisterCapability(params: UnregistrationParams): CompletableFuture[Void] = client.unregisterCapability(params)

  override def applyEdit(params: ApplyWorkspaceEditParams): CompletableFuture[ApplyWorkspaceEditResponse] = client.applyEdit(params)

  override def publishDiagnostics(publishDiagnosticsParams: PublishDiagnosticsParams): Unit = client.publishDiagnostics(publishDiagnosticsParams)

  override def semanticHighlighting(params: SemanticHighlightingParams): Unit = client.semanticHighlighting(params)

  //General
  override def initialize(params: InitializeParams): CompletableFuture[InitializeResult] = {
    if (checkStatus) try {
      server.initialize(params)
    } catch {
      case e: Exception => crashed(e)
        null
    } else null
  }

  override def initialized(params: InitializedParams): Unit =
    if (checkStatus) try {
      server.initialized(params)
    } catch {
      case e: Exception => crashed(e)
    }

  override def shutdown: CompletableFuture[AnyRef] =
    if (checkStatus) try {
      server.shutdown()
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def exit(): Unit =
    if (checkStatus) try {
      server.exit()
    } catch {
      case e: Exception => crashed(e)
    }

  override def cancelRequest(params: CancelParams): Unit = {
  }

  //Workspace
  override def didChangeConfiguration(params: DidChangeConfigurationParams): Unit =
    if (checkStatus) try {
      workspaceService.didChangeConfiguration(params)
    } catch {
      case e: Exception => crashed(e)
    }

  override def didChangeWatchedFiles(params: DidChangeWatchedFilesParams): Unit =
    if (checkStatus) try {
      workspaceService.didChangeWatchedFiles(params)
    } catch {
      case e: Exception => crashed(e)
    }

  override def symbol(params: WorkspaceSymbolParams): CompletableFuture[java.util.List[_ <: SymbolInformation]] =
    if (checkStatus) try {
      if (serverCapabilities.getWorkspaceSymbolProvider) workspaceService.symbol(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def executeCommand(params: ExecuteCommandParams): CompletableFuture[AnyRef] =
    if (checkStatus) try {
      if (serverCapabilities.getExecuteCommandProvider != null) workspaceService.executeCommand(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  //TextDocument
  override def didOpen(params: DidOpenTextDocumentParams): Unit =
    if (checkStatus) try {
      if (textDocumentOptions == null || textDocumentOptions.getOpenClose) textDocumentService.didOpen(params)
    } catch {
      case e: Exception => crashed(e)
    }

  override def didChange(params: DidChangeTextDocumentParams): Unit =
    if (checkStatus) try {
      if (textDocumentOptions == null || textDocumentOptions.getChange != null) textDocumentService.didChange(params)
    } catch {
      case e: Exception => crashed(e)
    }

  override def willSave(params: WillSaveTextDocumentParams): Unit =
    if (checkStatus) try {
      if (textDocumentOptions == null || textDocumentOptions.getWillSave) textDocumentService.willSave(params)
    } catch {
      case e: Exception => crashed(e)
    }

  override def willSaveWaitUntil(params: WillSaveTextDocumentParams): CompletableFuture[java.util.List[TextEdit]] =
    if (checkStatus) try {
      if (textDocumentOptions == null || textDocumentOptions.getWillSaveWaitUntil) textDocumentService.willSaveWaitUntil(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def didSave(params: DidSaveTextDocumentParams): Unit =
    if (checkStatus) try {
      if (textDocumentOptions == null || textDocumentOptions.getSave != null) textDocumentService.didSave(params)
    } catch {
      case e: Exception => crashed(e)
    }

  override def didClose(params: DidCloseTextDocumentParams): Unit =
    if (checkStatus) try {
      if (textDocumentOptions == null || textDocumentOptions.getOpenClose) textDocumentService.didClose(params)
    } catch {
      case e: Exception => crashed(e)
    }

  override def completion(params: CompletionParams): CompletableFuture[jsonrpc.messages.Either[java.util.List[CompletionItem], CompletionList]] =
    if (checkStatus) try {
      if (serverCapabilities.getCompletionProvider != null) textDocumentService.completion(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def resolveCompletionItem(unresolved: CompletionItem): CompletableFuture[CompletionItem] =
    if (checkStatus) try {
      if (serverCapabilities.getCompletionProvider != null && serverCapabilities.getCompletionProvider.getResolveProvider) textDocumentService.resolveCompletionItem(unresolved) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def hover(params: TextDocumentPositionParams): CompletableFuture[Hover] =
    if (checkStatus) try {
      if (serverCapabilities.getHoverProvider) textDocumentService.hover(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def signatureHelp(params: TextDocumentPositionParams): CompletableFuture[SignatureHelp] =
    if (checkStatus) try {
      if (serverCapabilities.getSignatureHelpProvider != null) textDocumentService.signatureHelp(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def references(params: ReferenceParams): CompletableFuture[java.util.List[_ <: Location]] =
    if (checkStatus) try {
      if (serverCapabilities.getReferencesProvider) textDocumentService.references(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def documentHighlight(params: TextDocumentPositionParams): CompletableFuture[java.util.List[_ <: DocumentHighlight]] =
    if (checkStatus) try {
      if (serverCapabilities.getDocumentHighlightProvider) textDocumentService.documentHighlight(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def documentSymbol(params: DocumentSymbolParams): CompletableFuture[java.util.List[jsonrpc.messages.Either[SymbolInformation, DocumentSymbol]]] =
    if (checkStatus) try {
      if (serverCapabilities.getDocumentSymbolProvider) textDocumentService.documentSymbol(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def formatting(params: DocumentFormattingParams): CompletableFuture[java.util.List[_ <: TextEdit]] =
    if (checkStatus) try {
      if (serverCapabilities.getDocumentFormattingProvider) textDocumentService.formatting(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def rangeFormatting(params: DocumentRangeFormattingParams): CompletableFuture[java.util.List[_ <: TextEdit]] =
    if (checkStatus) try {
      if (serverCapabilities.getDocumentRangeFormattingProvider) textDocumentService.rangeFormatting(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def onTypeFormatting(params: DocumentOnTypeFormattingParams): CompletableFuture[java.util.List[_ <: TextEdit]] =
    if (checkStatus) try {
      if (serverCapabilities.getDocumentOnTypeFormattingProvider != null) textDocumentService.onTypeFormatting(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def definition(params: TextDocumentPositionParams): CompletableFuture[jsonrpc.messages.Either[java.util.List[_ <: Location], java.util.List[_ <: LocationLink]]] =
    if (checkStatus) try {
      if (serverCapabilities.getDefinitionProvider) textDocumentService.definition(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def codeAction(params: CodeActionParams): CompletableFuture[java.util.List[jsonrpc.messages.Either[Command, CodeAction]]] =
    if (checkStatus) try {
      if (checkProvider(serverCapabilities.getCodeActionProvider.asInstanceOf[jsonrpc.messages.Either[Boolean, StaticRegistrationOptions]])) textDocumentService.codeAction(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  private def checkProvider(provider: jsonrpc.messages.Either[Boolean, StaticRegistrationOptions]): Boolean = {
    provider != null && ((provider.isLeft && provider.getLeft) || (provider.isRight && provider.getRight != null))
  }

  override def codeLens(params: CodeLensParams): CompletableFuture[java.util.List[_ <: CodeLens]] =
    if (checkStatus) try {
      if (serverCapabilities.getCodeLensProvider != null) textDocumentService.codeLens(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def resolveCodeLens(unresolved: CodeLens): CompletableFuture[CodeLens] =
    if (checkStatus) try {
      if (serverCapabilities.getCodeLensProvider != null && serverCapabilities.getCodeLensProvider.isResolveProvider) textDocumentService.resolveCodeLens(unresolved) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def documentLink(params: DocumentLinkParams): CompletableFuture[java.util.List[DocumentLink]] =
    if (checkStatus) try {
      if (serverCapabilities.getDocumentLinkProvider != null) textDocumentService.documentLink(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  private def checkStatus: Boolean = wrapper.getStatus == ServerStatus.STARTED

  private def crashed(e: Exception): Unit = {
    LOG.warn(e)
    wrapper.crashed(e)
  }

  override def documentLinkResolve(unresolved: DocumentLink): CompletableFuture[DocumentLink] =
    if (checkStatus) try {
      if (serverCapabilities.getDocumentLinkProvider != null && serverCapabilities.getDocumentLinkProvider.getResolveProvider)
        textDocumentService.documentLinkResolve(unresolved) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def rename(params: RenameParams): CompletableFuture[WorkspaceEdit] =
    if (checkStatus) try {
      if (checkProvider(serverCapabilities.getRenameProvider.asInstanceOf[jsonrpc.messages.Either[Boolean, StaticRegistrationOptions]])) textDocumentService.rename(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null

  override def prepareRename(params: TextDocumentPositionParams): CompletableFuture[messages.Either[Range, PrepareRenameResult]] = {
    if (checkStatus) try {
      if (checkProvider(serverCapabilities.getRenameProvider.asInstanceOf[jsonrpc.messages.Either[Boolean, StaticRegistrationOptions]])) textDocumentService.prepareRename(params) else null
    } catch {
      case e: Exception => crashed(e)
        null
    } else null
  }

  override def implementation(params: TextDocumentPositionParams): CompletableFuture[messages.Either[java.util.List[_ <: Location], java.util.List[_ <: LocationLink]]] = throw new NotImplementedError()

  override def typeDefinition(params: TextDocumentPositionParams): CompletableFuture[messages.Either[java.util.List[_ <: Location], java.util.List[_ <: LocationLink]]] = throw new NotImplementedError()

  override def documentColor(params: DocumentColorParams): CompletableFuture[util.List[ColorInformation]] = throw new NotImplementedError()

  override def colorPresentation(params: ColorPresentationParams): CompletableFuture[util.List[ColorPresentation]] = throw new NotImplementedError()

  override def foldingRange(params: FoldingRangeRequestParams): CompletableFuture[util.List[FoldingRange]] = throw new NotImplementedError()
}


text:
<?php
/* this file may be duplicated to provide testing for
   multiple php binaries or configurations.  It is used
   with the -c option on server-tests.php.  All these
   settings will also go into the environment for tests
   that are directly executed, so you can also set things
   like PHPRC here to force an executable to use a
   specific php.ini file. */

$conf = array(
/* path to the php source tree */
'TEST_PHP_SRCDIR'      =>    NULL,

/* executable that will be tested.  Not used for
   web based tests */
'TEST_PHP_EXECUTABLE'  =>    NULL,

/* php.ini to use when executing php */
'PHPRC'                =>    NULL,

/* log format */
'TEST_PHP_LOG_FORMAT'  =>    'LEODC',

/* debugging detail in output. */
'TEST_PHP_DETAILED'    =>    0,

/* error style for editors or IDE's */
'TEST_PHP_ERROR_STYLE' =>    'EMACS',

'REPORT_EXIT_STATUS'   =>    0,
'NO_PHPTEST_SUMMARY'   =>    0,

/* don't ask, and don't send results to QA if true */
'NO_INTERACTION'       =>    true,

/* base url prefixed to any requests */
'TEST_WEB_BASE_URL'    =>    NULL,

/* if set, copy phpt files into this directory,
   which should be accessable via an http server.  The
   TEST_WEB_BASE_URL setting should be the base url
   to access this path.  If this is not used,
   TEST_WEB_BASE_URL should be the base url pointing
   to TEST_PHP_SRCDIR, which should then be accessable via
   an http server.

   An example would be:
   TEST_WEB_BASE_URL=http://localhost/test
   TEST_BASE_PATH=/path/to/htdocs/test
*/
'TEST_BASE_PATH'   =>    NULL,

/* file extension of pages requested via http
   this allows for php to be configured to parse
   extensions other than php, useful for multiple
   configurations under a single webserver */
'TEST_WEB_EXT'         =>    'php',

/* if true doesn't run tests, just outputs executable info */
'TEST_CONTEXT_INFO'    =>    false,

/* : or ; separated list of paths */
'TEST_PATHS'           =>    NULL
/* additional configuration items that may be set
   to provide proxy support for testes:
  timeout
  proxy_host
  proxy_port
  proxy_user
  proxy_pass
*/
);

?>


text:
node-sibling [![Build Status](https://travis-ci.org/mdevils/node-sibling.png?branch=master)](https://travis-ci.org/mdevils/node-sibling)
============

Fast and easy IPC for node.

Installation
------------

```
npm install sibling
```

Usage
-----

Master process code, **runner.js**.
```javascript
var Vow = require('vow'),
    UserSibling = require('./user.js');

// Local UserSibling instance usage.
var user = UserSibling.create('Nick');
Vow.when(user.getName()).then(function() {
    console.log('local user name', user.getName());
    return Vow.when(user.getFriends()).then(function(friends) {
        console.log('local user friends', friends);
    }).then(function() {
        return Vow.when(user.getMotherName());
    }).fail(function(error) {
        console.log('local user mother name ', error.toString());
        Vow.when(user.getFatherName()).fail(function(error) {
            console.log('local user father name ', error.toString());
            user.dispose();
        });
    });
});

// Child process UserSibling instance usage.
var userSibling = UserSibling.fork('Nick');
Vow.when(userSibling.getName()).then(function(name) {
    console.log('sibling user name', name);
    return Vow.when(userSibling.getFriends()).then(function(friends) {
        console.log('sibling user friends', friends);
    }).then(function() {
        return Vow.when(userSibling.getMotherName());
    }).fail(function(error) {
        console.log('sibling user mother name ', error.toString());
        Vow.when(userSibling.getFatherName()).fail(function(error) {
            console.log('sibling user father name ', error.toString());
            userSibling.dispose();
        });
    });
});
```

Child/Master shared code, **user.js**.
```javascript
var sibling = require('../index'),
    Vow = require('vow');

module.exports = sibling.declare({
    __constructor: function(name) {
        this._name = name;
    },
    getName: function() {
        return this._name;
    },
    getFriends: function() {
        var promise = Vow.promise();
        setTimeout(function() {
            promise.fulfill([
                'Michael',
                'George'
            ]);
        }, 1000);
        return promise;
    },
    getMotherName: function() {
        throw new Error('Private info');
    },
    getFatherName: function() {
        return Vow.reject(new Error('Unknown info'));
    }
});
```


text:
package org.apache.ws.security.action;

import org.apache.ws.security.WSSecurityException;
import org.apache.ws.security.handler.RequestData;
import org.apache.ws.security.handler.WSHandler;
import org.apache.ws.security.message.WSSecTimestamp;
import org.w3c.dom.Document;

public class TimestampAction implements Action {
    public void execute(WSHandler handler, int actionToDo, Document doc, RequestData reqData)
            throws WSSecurityException {
        WSSecTimestamp timeStampBuilder =
                new WSSecTimestamp();
        timeStampBuilder.setWsConfig(reqData.getWssConfig());
        timeStampBuilder.setTimeToLive(handler.decodeTimeToLive(reqData));
        // add the Timestamp to the SOAP Envelope
        timeStampBuilder.build(doc, reqData.getSecHeader());
    }
}


text:
package de.adesso.alarm.boundary;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.when;

import javax.enterprise.context.RequestScoped;
import javax.ws.rs.Path;

import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

import de.adesso.alarm.control.AlarmManager;
import de.adesso.alarm.entity.Alarm;

public class AlarmFacadeTest {

    @Mock
    private AlarmManager manager;

    @InjectMocks
    private AlarmFacade alarmFacade;

    @Before
    public void setUp() throws Exception {
    	MockitoAnnotations.initMocks(this);
    	Alarm alarm = new Alarm();
    	alarm.setItem("Testalarm");
		when(manager.getAlarm()).thenReturn(alarm);
    }

    @Test
    public void testGet() throws Exception {
        final Alarm result = this.alarmFacade.getAlarmStatus();
        assertThat("the result message is world", result.getItem(), is("Testalarm"));
    }

    @Test
    public void testPathAnnotation() throws Exception {
        assertNotNull(this.alarmFacade.getClass()
                                    .getAnnotations());
        assertThat("The controller has the annotation Path", this.alarmFacade.getClass()
                                                                           .isAnnotationPresent(Path.class));

        final Path path = this.alarmFacade.getClass()
                                        .getAnnotation(Path.class);
        assertThat("The path is /alarmstatus", path.value(), is("/alarmstatus"));
    }

    @Test
    public void testScope() throws Exception {
        assertNotNull(this.alarmFacade.getClass()
                                    .getAnnotations());
        assertThat("The controller has the annotation RequestScoped", this.alarmFacade.getClass()
                                                                                .isAnnotationPresent(
                                                                                RequestScoped.class));
    }
}


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

<title>Uses of Class jason.infra.centralised.CentralisedExecutionControl (Jason - AgentSpeak Java Interpreter)</title>
<meta name="date" content="2013-12-12">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
jason.infra.centralised.CentralisedExecutionControl

Packages that use CentralisedExecutionControl

Package
Description

jason.infra.centralised

Uses of CentralisedExecutionControl in jason.infra.centralised

Methods in jason.infra.centralised that return CentralisedExecutionControl

Modifier and Type
Method and Description

CentralisedExecutionControl
CentralisedAgArch.getControlInfraTier()

CentralisedExecutionControl
RunCentralisedMAS.getControllerInfraTier()

Methods in jason.infra.centralised with parameters of type CentralisedExecutionControl

Modifier and Type
Method and Description

void
CentralisedAgArch.setControlInfraTier(CentralisedExecutionControl pControl)

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from 'material-ui/styles';
import { CardHeader } from 'material-ui/Card';
import Paper from 'material-ui/Paper';
import PaddedContent from './paddedContent';

const styleSheet = (theme) => {
  const padding = theme.spacing.unit * 2;
  return {
    center: {
      display: 'flex',
      justifyContent: 'center',
      alignItems: 'center',
      height: '100vh',
    },
    cardContainer: {
      [theme.breakpoints.up('md')]: {
        width: '30vw',
      },
      [theme.breakpoints.down('md')]: {
        width: '100vw',
      },
    },
    header: {
      color: 'white',
      height: '100px',
      textAlign: 'center',
      backgroundColor: theme.palette.secondary[500],
    },
    subtitle: {
      padding: `${padding}px`,
      color: 'black',
      background: '#F6F6F6',
    },
  };
};

const CardLogin = (props) => {
  const { classes, children, title } = props;
  return (

        <Paper elevation={2} >
          <CardHeader
            className={classes.header}
            title={title}
          />
          <PaddedContent >
            {children}
          </PaddedContent>
        </Paper>

  );
};

CardLogin.propTypes = {
  classes: PropTypes.object,
  children: PropTypes.node,
  title: PropTypes.string,
};

export default withStyles(styleSheet, { name: 'CardLogin' })(CardLogin);


text:
/* jshint -W117, -W030 */
describe('DashboardController', function() {
    var controller;
    var people = mockData.getMockPeople();

    beforeEach(function() {
        bard.appModule('app.dashboard');
        bard.inject('$controller', '$log', '$q', '$rootScope', 'dataservice');
    });

    beforeEach(function () {
        sinon.stub(dataservice, 'getPeople').returns($q.when(people));
        controller = $controller('DashboardController');
        $rootScope.$apply();
    });

    bard.verifyNoOutstandingHttpRequests();

    describe('Dashboard controller', function() {
        it('should be created successfully', function () {
            expect(controller).to.be.defined;
        });

        describe('after activate', function() {
            it('should have title of Dashboard', function () {
                expect(controller.title).to.equal('Dashboard');
            });

            it('should have logged "Activated"', function() {
                expect($log.info.logs).to.match(/Activated/);
            });

            it('should have news', function () {
                expect(controller.news).to.not.be.empty;
            });

            it('should have at least 1 person', function () {
                expect(controller.people).to.have.length.above(0);
            });

            it('should have people count of 5', function () {
                expect(controller.people).to.have.length(7);
            });
        });
    });
});


text:
import { ThemeProvider } from 'styled-components'
import getTheme from '~/themes'

const JestThemed = ({ children, theme }) =>
  <ThemeProvider theme={getTheme(theme || 'main')}>
    {children}
  </ThemeProvider>

export default JestThemed


text:
using System;
namespace Agiil.Domain
{
    public interface IGetsAllEnumFlags
    {
        T GetValueWithAllFlags<T>() where T : struct;
    }
}


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

    <parent>
        <artifactId>spring-boot</artifactId>
        <groupId>no.acntech.sandbox</groupId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <artifactId>spring-boot-websocket-stomp</artifactId>

    <!-- DEPENDENCIES -->
    <dependencies>
        <!-- Web -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>nz.net.ultraq.thymeleaf</groupId>
            <artifactId>thymeleaf-layout-dialect</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-websocket</artifactId>
        </dependency>

        <!-- WebJars -->
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery</artifactId>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>bootstrap</artifactId>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>webjars-locator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>stomp__stompjs</artifactId>
        </dependency>
    </dependencies>

    <!-- BUILD -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>


text:
package net.happybrackets.device.config;

import net.happybrackets.device.config.template.NetworkInterfaces;

import java.io.*;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * This class holds various administrative functions for managing devices.
 *
 */
public class LocalConfigManagement {

    final static Logger logger = LoggerFactory.getLogger(LocalConfigManagement.class);

    public static boolean updateInterfaces(String interfacesPath, String ssid, String psk) {

        try (Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(interfacesPath), "utf-8"))) {
            writer.write( NetworkInterfaces.newConfig(ssid, psk) );
            return true;
        } catch (UnsupportedEncodingException e) {
            logger.error("Unable to output {} in specified encoding!", interfacesPath, e);
        } catch (FileNotFoundException e) {
            logger.error("Unable to output to {}!", interfacesPath, e);
        } catch (IOException e) {
            logger.error("Error writing to {}!", interfacesPath, e);
        }
        return false;
    }
}


text:
#ifndef QDRI2CONTEXT_H
#define QDRI2CONTEXT_H

#include <QtGui/QPlatformGLContext>

class QXcbWindow;
class QDri2ContextPrivate;

struct xcb_dri2_dri2_buffer_t;

class QDri2Context : public QPlatformGLContext
{
    Q_DECLARE_PRIVATE(QDri2Context);
public:
    QDri2Context(QXcbWindow *window);
    ~QDri2Context();

    void makeCurrent();
    void doneCurrent();
    void swapBuffers();
    void* getProcAddress(const QString& procName);

    void resize(const QSize &size);

    QPlatformWindowFormat platformWindowFormat() const;

    void *eglContext() const;

protected:
    xcb_dri2_dri2_buffer_t *backBuffer();
    QScopedPointer<QDri2ContextPrivate> d_ptr;
private:
    Q_DISABLE_COPY(QDri2Context)
};

#endif // QDRI2CONTEXT_H


text:
RSpec::Matchers.define :have_attributes do |attributes|
  match do |response|
    unless response.is_a?(Hash)
      @missing = 'but data is not a Hash'
      return false
    end

    unless attributes.is_a?(Array)
      @missing = 'but attributes is not an Array'
      return false
    end

    keys = response.keys
    keys.to_set == attributes.to_set
  end

  failure_message do |response|
    "Expect #{response.inspect} contains these attributes #{attributes}, #{@missing}"
  end

  failure_message_when_negated do |response|
    "Expect #{response.inspect} NOT contains these attributes #{attributes}, #{@missing}"
  end

  description do
    'test if response contains attributes'
  end
end


text:
module HamlSourceLine
  VERSION = "0.1.0"
end


text:
class BackgroundItem;
class BScreen;

namespace FbTk {
class ResourceManager;
class ImageControl;
}

/// Contains border color, border size, bevel width and opGC for objects like geometry window in BScreen
class RootTheme: public FbTk::Theme, public FbTk::ThemeProxy<RootTheme> {
public:
    /// constructor
    /// @param resmanager resource manager for finding specific resources
    /// @param image_control for rendering background texture
    RootTheme(FbTk::ImageControl &image_control);
    ~RootTheme();

    bool fallback(FbTk::ThemeItem_base &item);
    void reconfigTheme();

    GC opGC() const { return m_opgc.gc(); }

    void setLineAttributes(unsigned int width,
                           int line_style,
                           int cap_style,
                           int join_style) {
        m_opgc.setLineAttributes(width, line_style, cap_style, join_style);
    }

    virtual FbTk::Subject &reconfigSig() { return FbTk::Theme::reconfigSig(); }
    virtual const FbTk::Subject &reconfigSig() const { return FbTk::Theme::reconfigSig(); }

    virtual RootTheme &operator *() { return *this; }
    virtual const RootTheme &operator *() const { return *this; }

private:
    BackgroundItem *m_background;///< background image/texture
    FbTk::GContext m_opgc;
    FbTk::ImageControl &m_image_ctrl; ///< image control for rendering background texture
    bool m_first;
};

#endif // ROOTTHEME_HH


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#000000"
    tools:context=".Numbers_api"
    tools:ignore="HardcodedText" >

    <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="300dp"
        android:layout_alignParentBottom="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:textColor="#FFFFFF" />

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:text="							Send Request"
        android:gravity="center_vertical"
        android:textColor="#FFFFFF"  />

    <EditText
        android:id="@+id/editText1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_below="@+id/button1"
        android:layout_marginTop="17dp"
        android:ems="10"
        android:textColor="#FFFFFF"
        android:hint="Enter number"
        android:inputType="number" >

        <requestFocus />
    </EditText>

</RelativeLayout>


text:
package main

import (
  "os/exec"
  "strings"
  "encoding/json"
)

type NetstatHost string;
type NetstatPort string;
type NetstatAddress struct {
  Host NetstatHost `json:"host"`;
  Port NetstatPort `json:"port"`;
}
type NetstatAddressPair struct {
  Local NetstatAddress   `json:"local"`;
  Remote NetstatAddress  `json:"remote"`;
}
type NetstatConnection struct {
  Host NetstatHost `json:"host"`;
  Count uint64     `json:"count"`;
}

type NetstatConnections map[NetstatHost]NetstatConnection;
type NetstatServices map[NetstatPort]NetstatConnections;

type NetstatInfo struct {
  Outgoing NetstatServices `json:"outgoing"`;
  Incoming NetstatServices `json:"incoming"`;
}

type Netstat struct {
  config *Config;
  currentInfo NetstatInfo;
};

func (this NetstatInfo) Encode() ([]byte, error) {
  return json.Marshal(this)
}

func (this NetstatInfo) GetType() (string) {
  return "netstat";
}

func (this Netstat) Monitor() (Info, error) {
  data, err := this.run();
  if err != nil {
    return this.currentInfo, err;
  }
  err = this.parse(&this.currentInfo, data)
  info := Info(this.currentInfo);
  return info, err
}

func (this Netstat) ClearResults() () {
  this.currentInfo = NetstatInfo{};
}

func (this *Netstat) run() (string, error) {
  var (
    commandStr string
    data []byte
    err error
  )
  commandStr, err = this.determineCommand();
  if err != nil {
    return string(data), err
  }
  command := strings.Split(commandStr, " ");
  cmd := exec.Command(command[0], command[1:]...);
  data, err = cmd.Output();
  return string(data), err;
}

func (this *Netstat) determineCommand() (string, error) {
  data, err := exec.Command("uname").Output();
  if err != nil {
    return "", err
  }
  switch strings.TrimSpace(string(data)) {
    case "Darwin":
      return "netstat -na -p tcp -b", nil
    default:
      return "netstat -antl", nil
  }
}

func (this *Netstat) parse(result *NetstatInfo, data string) (error) {
  if len(result.Incoming) < 1 {
    result.Incoming = make(NetstatServices)
  }
  if len(result.Outgoing) < 1 {
    result.Outgoing = make(NetstatServices)
  }
  listenAddresses := this.parseAddressPairs(data, []string{"LISTEN"})
  for i := 0; len(listenAddresses) > i; i++ {
    result.Incoming[listenAddresses[i].Local.Port] = make(NetstatConnections)
  }
  establishedAddresses := this.parseAddressPairs(data, []string{"ESTABLISHED", "TIME_WAIT"})
  for i := 0; len(establishedAddresses) > i; i++ {
    localPort := establishedAddresses[i].Local.Port
    if service, ok := result.Incoming[localPort]; ok == true {
      remoteHost := establishedAddresses[i].Remote.Host
      if _, ok := service[remoteHost]; ok == true {
        result.Incoming[localPort][remoteHost] = NetstatConnection{
          remoteHost,
          result.Incoming[localPort][remoteHost].Count + 1,
        };
      } else {
        result.Incoming[localPort][remoteHost] = NetstatConnection{
          remoteHost,
          1,
        };
      }
      continue
    }
    remotePort := establishedAddresses[i].Remote.Port
    if _, ok := result.Outgoing[remotePort]; ok == false {
      result.Outgoing[remotePort] = make(NetstatConnections);
    }
    remoteHost := establishedAddresses[i].Remote.Host
    if _, ok := result.Outgoing[remotePort][remoteHost]; ok == true {
      result.Outgoing[remotePort][remoteHost] = NetstatConnection{
        remoteHost,
        result.Outgoing[remotePort][remoteHost].Count + 1,
      };
    } else {
      result.Outgoing[remotePort][remoteHost] = NetstatConnection{
        remoteHost,
        1,
      };
    }
  }
  return nil
}

func (this *Netstat) parseAddressPairs(data string, states []string) []NetstatAddressPair {
  lines := strings.Split(data, "\n");
  pairs := make([]NetstatAddressPair, 0);
  for i := 1; len(lines) > i; i++ {
    line := strings.Fields(lines[i])
    if (len(line) < 4) {
      continue
    }
    if (line[0] == "tcp6") {
      continue
    }
    for _,state := range(states) {
      if line[5] == state {
        localAddress := this.parseAddress(line[3])
        remoteAddress := this.parseAddress(line[4])
        pair := NetstatAddressPair{
          localAddress,
          remoteAddress,
        }
        pairs = append(pairs, pair)
      }
    }
  }
  return pairs;
}

func (this *Netstat) parseAddress(data string) NetstatAddress {
  hostPort := strings.Split(data, ":")
  if (len(hostPort) > 1) {
    return NetstatAddress{
      NetstatHost(hostPort[0]),
      NetstatPort(hostPort[len(hostPort)-1]),
    }
  } else {
    hostPort = strings.Split(data, ".")
    host := strings.Join(hostPort[0:len(hostPort)-1], ".")
    return NetstatAddress{
      NetstatHost(host),
      NetstatPort(hostPort[len(hostPort)-1]),
    }
  }
}


text:
<?php

namespace Celtric\Fixtures\FixtureTypes;

use Celtric\Fixtures\FixtureDefinition;

final class ArrayFixture implements FixtureDefinition
{
    /** @var FixtureDefinition[] */
    private $data;

    /**
     * @param FixtureDefinition[] $data
     */
    public function __construct(array $data)
    {
        $this->data = $data;
    }

    /**
     * @inheritDoc
     */
    public function instantiate()
    {
        return array_map(function (FixtureDefinition $d) { return $d->instantiate(); }, $this->data);
    }
}


text:
require 'rubygems'
unless Object.const_defined?('Sequel')
  $:.unshift(File.join(File.dirname(__FILE__), "../../lib/"))
  require 'sequel/core'
  Sequel.quote_identifiers = false
end
begin
  require File.join(File.dirname(__FILE__), '../spec_config.rb')
rescue LoadError
end