text:
package com.asakusafw.spark

import java.lang.{ Boolean => JBoolean }

import scala.collection.JavaConversions._
import org.objectweb.asm.Type
import com.asakusafw.lang.compiler.analyzer.util.{ BranchOperatorUtil, MasterJoinOperatorUtil }
import com.asakusafw.lang.compiler.api.CompilerOptions
import com.asakusafw.lang.compiler.api.reference.DataModelReference
import com.asakusafw.lang.compiler.model.PropertyName
import com.asakusafw.lang.compiler.model.description._
import com.asakusafw.lang.compiler.model.graph._
import com.asakusafw.lang.compiler.planning.SubPlan
import com.asakusafw.spark.compiler.planning.{ NameInfo, SubPlanInfo }

package object compiler {

  val GeneratedClassPackageInternalName = "com/asakusafw/spark/generated"

  implicit class AugmentedTypeDescription(val desc: TypeDescription) extends AnyVal {

    def asType: Type =
      desc match {
        case desc: BasicTypeDescription => desc.asType
        case desc: ClassDescription => desc.asType
        case desc: ArrayTypeDescription => desc.asType
      }
  }

  implicit class AugmentedReifiableTypeDescription(
    val desc: ReifiableTypeDescription) extends AnyVal {

    def resolveClass(
      implicit provider: ClassLoaderProvider): Class[_] = {
      desc.resolve(provider.classLoader)
    }
  }

  implicit class AugmentedBasicTypeDescription(val desc: BasicTypeDescription) extends AnyVal {

    def asType: Type = {
      import BasicTypeDescription.BasicTypeKind // scalastyle:ignore
      desc.getBasicTypeKind match {
        case BasicTypeKind.VOID => Type.VOID_TYPE
        case BasicTypeKind.INT => Type.INT_TYPE
        case BasicTypeKind.LONG => Type.LONG_TYPE
        case BasicTypeKind.FLOAT => Type.FLOAT_TYPE
        case BasicTypeKind.DOUBLE => Type.DOUBLE_TYPE
        case BasicTypeKind.SHORT => Type.SHORT_TYPE
        case BasicTypeKind.CHAR => Type.CHAR_TYPE
        case BasicTypeKind.BYTE => Type.BYTE_TYPE
        case BasicTypeKind.BOOLEAN => Type.BOOLEAN_TYPE
      }
    }
  }

  implicit class AugmentedClassDescription(val desc: ClassDescription) extends AnyVal {

    def asType: Type = Type.getObjectType(desc.getInternalName)
  }

  implicit class AugmentedArrayTypeDescription(val desc: ArrayTypeDescription) extends AnyVal {

    def asType: Type = Type.getObjectType(s"[${desc.getComponentType.asType.getDescriptor}")
  }

  implicit class AugmentedCompilerOptions(val options: CompilerOptions) extends AnyVal {

    import SparkClientCompiler.Options._ // scalastyle:ignore

    def verifyPlan: Boolean = {
      JBoolean.parseBoolean(options.get(SparkPlanVerify, false.toString))
    }

    def useInputDirect: Boolean = {
      JBoolean.parseBoolean(options.get(SparkInputDirect, true.toString))
    }

    def useOutputDirect: Boolean = {
      JBoolean.parseBoolean(options.get(SparkOutputDirect, true.toString))
    }
  }

  implicit class AugmentedOperator(val operator: Operator) extends AnyVal {

    def annotationDesc: AnnotationDescription = {
      operator.asInstanceOf[UserOperator].getAnnotation
    }

    def implementationClass: ClassDescription = {
      operator.asInstanceOf[UserOperator].getImplementationClass
    }

    def methodDesc: MethodDescription = {
      operator.asInstanceOf[UserOperator].getMethod
    }

    def inputs: Seq[OperatorInput] = {
      operator.getInputs
    }

    def outputs: Seq[OperatorOutput] = {
      operator.getOutputs
    }

    def arguments: Seq[OperatorArgument] = {
      operator.getArguments
    }

    def nonBroadcastInputs: Seq[OperatorInput] = {
      operator.inputs.filter(_.getInputUnit != OperatorInput.InputUnit.WHOLE)
    }

    def branchOutputMap(
      implicit provider: ClassLoaderProvider): Map[OperatorOutput, Enum[_]] = {
      BranchOperatorUtil.getOutputMap(provider.classLoader, operator).toMap
    }

    def selectionMethod(
      implicit provider: ClassLoaderProvider): Option[(String, Type)] = {
      Option(MasterJoinOperatorUtil.getSelection(provider.classLoader, operator))
        .map(method => (method.getName, Type.getType(method)))
    }
  }

  implicit class AugmentedAnnotationDescription(val ad: AnnotationDescription) extends AnyVal {

    def elements: Map[String, ValueDescription] = ad.getElements.toMap

    def resolveClass(
      implicit provider: ClassLoaderProvider): Class[_] = {
      ad.getDeclaringClass.resolveClass
    }
  }

  implicit class AugmentedMethodDescirption(val md: MethodDescription) extends AnyVal {

    def asType(
      implicit provider: ClassLoaderProvider): Type = {
      Type.getType(md.resolve(provider.classLoader))
    }

    def name: String = md.getName

    def parameterClasses(
      implicit provider: ClassLoaderProvider): Seq[Class[_]] = {
      md.getParameterTypes.map(_.resolve(provider.classLoader))
    }
  }

  implicit class AugmentedOperatorPort(val op: OperatorPort) extends AnyVal {

    def dataModelRef(
      implicit provider: DataModelLoaderProvider): DataModelReference = {
      provider.dataModelLoader.load(op.getDataType)
    }

    def dataModelType(
      implicit provider: DataModelLoaderProvider): Type = {
      dataModelRef.getDeclaration.asType
    }

    def dataModelClass(
      implicit dataModelProvider: DataModelLoaderProvider,
      classLoaderProvider: ClassLoaderProvider): Class[_] = {
      dataModelRef.getDeclaration.resolve(classLoaderProvider.classLoader)
    }
  }

  implicit class AugmentedOperatorArgument(val oa: OperatorArgument) extends AnyVal {

    def asType: Type = oa.getValue.getValueType.asType

    def resolveClass(
      implicit provider: ClassLoaderProvider): Class[_] = {
      oa.getValue.getValueType.getErasure.resolve(provider.classLoader)
    }

    def value(
      implicit provider: ClassLoaderProvider): Any = {
      oa.getValue.value
    }
  }

  implicit class AugmentedValueDescription(val vd: ValueDescription) extends AnyVal {

    def value(
      implicit provider: ClassLoaderProvider): Any = {
      vd.resolve(provider.classLoader)
    }
  }

  implicit class AugmentedDataModelReference(val dataModelRef: DataModelReference) extends AnyVal {

    def groupingTypes(propertyNames: Seq[PropertyName]): Seq[Type] = {
      propertyNames.map { propertyName =>
        dataModelRef.findProperty(propertyName).getType.asType
      }
    }

    def orderingTypes(orderings: Seq[Group.Ordering]): Seq[(Type, Boolean)] = {
      orderings.map { ordering =>
        (dataModelRef.findProperty(ordering.getPropertyName).getType.asType,
          ordering.getDirection == Group.Direction.ASCENDANT)
      }
    }
  }

  implicit class SubPlanNames(val subplan: SubPlan) extends AnyVal {

    def name: String = {
      Option(subplan.getAttribute(classOf[NameInfo]))
        .map(_.getName)
        .getOrElse("N/A")
    }

    def label: String = {
      Seq(
        Option(subplan.getAttribute(classOf[NameInfo]))
          .map(_.getName),
        Option(subplan.getAttribute(classOf[SubPlanInfo]))
          .flatMap(info => Option(info.getLabel)))
        .flatten match {
          case Seq() => "N/A"
          case s: Seq[String] => s.mkString(":")
        }
    }
  }
}


text:
package com.microsoft.bingads.v10.adinsight;

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

/**
 *
Java class for DayMonthAndYear complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="DayMonthAndYear">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="Day" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
 *         <element name="Month" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
 *         <element name="Year" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DayMonthAndYear", propOrder = {
    "day",
    "month",
    "year"
})
public class DayMonthAndYear {

    @XmlElement(name = "Day")
    protected Integer day;
    @XmlElement(name = "Month")
    protected Integer month;
    @XmlElement(name = "Year")
    protected Integer year;

    /**
     * Gets the value of the day property.
     *
     * @return
     *     possible object is
     *     {@link Integer }
     *
     */
    public Integer getDay() {
        return day;
    }

    /**
     * Sets the value of the day property.
     *
     * @param value
     *     allowed object is
     *     {@link Integer }
     *
     */
    public void setDay(Integer value) {
        this.day = value;
    }

    /**
     * Gets the value of the month property.
     *
     * @return
     *     possible object is
     *     {@link Integer }
     *
     */
    public Integer getMonth() {
        return month;
    }

    /**
     * Sets the value of the month property.
     *
     * @param value
     *     allowed object is
     *     {@link Integer }
     *
     */
    public void setMonth(Integer value) {
        this.month = value;
    }

    /**
     * Gets the value of the year property.
     *
     * @return
     *     possible object is
     *     {@link Integer }
     *
     */
    public Integer getYear() {
        return year;
    }

    /**
     * Sets the value of the year property.
     *
     * @param value
     *     allowed object is
     *     {@link Integer }
     *
     */
    public void setYear(Integer value) {
        this.year = value;
    }

}

redpajama_set_name: RedPajamaGithub


text:
package uk.ac.ebi.eva.vcfdump;

import htsjdk.variant.variantcontext.Allele;
import htsjdk.variant.variantcontext.Genotype;
import htsjdk.variant.variantcontext.GenotypeBuilder;
import htsjdk.variant.variantcontext.VariantContext;
import htsjdk.variant.variantcontext.VariantContextBuilder;
import org.opencb.biodata.models.variant.Variant;
import org.opencb.biodata.models.variant.VariantSource;
import org.opencb.biodata.models.variant.VariantSourceEntry;
import org.opencb.biodata.models.variant.annotation.ConsequenceType;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Optional;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

public class BiodataVariantToVariantContextConverter {

    public static final String GENOTYPE_KEY = "GT";

    private final VariantContextBuilder variantContextBuilder;

    private List<VariantSource> sources;

    private Set<String> studies;

    private Map<String, Map<String, String>> filesSampleNamesEquivalences;

    private static final int NO_CALL_ALLELE_INDEX = 2;

    protected static final Pattern genotypePattern = Pattern.compile("/|\\|");

    public BiodataVariantToVariantContextConverter(List<VariantSource> sources,
                                                   Map<String, Map<String, String>> filesSampleNamesEquivalences) {
        this.sources = sources;
        if (sources != null) {
            this.studies = sources.stream().map(VariantSource::getStudyId).collect(Collectors.toSet());
        }
        this.filesSampleNamesEquivalences = filesSampleNamesEquivalences;
        variantContextBuilder = new VariantContextBuilder();
    }

    public VariantContext transform(Variant variant) {
        String[] allelesArray = getAllelesArray(variant);

        Set<Genotype> genotypes = getGenotypes(variant, allelesArray);

        String csq = getAnnotationAttributes(variant);

        if (csq != null) {
            variantContextBuilder.attribute("CSQ", csq);
        }

        VariantContext variantContext = variantContextBuilder
                .chr(variant.getChromosome())
                .start(variant.getStart())
                .stop(getVariantContextStop(variant))
                .noID()
                .alleles(allelesArray)
                .unfiltered()
                .genotypes(genotypes).make();
        return variantContext;
    }

    private String getAnnotationAttributes(Variant variant) {
        List<ConsequenceType> consequenceTypes = variant.getAnnotation().getConsequenceTypes();
        String allele = variant.getAnnotation().getAlternativeAllele();
        String csq = null;
        if (consequenceTypes != null) {
            List<String> consequences = new ArrayList<>();
            for (ConsequenceType consequenceType : consequenceTypes) {
                List<ConsequenceType.ConsequenceTypeEntry> soTermList = consequenceType.getSoTerms();
                List<String> soNameList = soTermList.stream().map(ConsequenceType.ConsequenceTypeEntry::getSoName)
                        .collect(Collectors.toList());
                String soNames = String.join("&", soNameList);
                String symbol = consequenceType.getGeneName();
                String gene = consequenceType.getEnsemblGeneId();
                String feature = consequenceType.getEnsemblTranscriptId();
                String bioType = consequenceType.getBiotype();
                Integer cDnaPosition = consequenceType.getcDnaPosition();
                Integer cdsPosition = consequenceType.getCdsPosition();

                StringBuilder csqSb = new StringBuilder();
                csqSb.append(allele != null ? allele : "").append("|")
                        .append(soNames != null ? soNames : "").append("|")
                        .append(symbol != null ? symbol : "").append("|")
                        .append(gene != null ? gene : "").append("|")
                        .append(feature != null ? feature : "").append("|")
                        .append(bioType != null ? bioType : "").append("|")
                        .append(cDnaPosition != null ? cDnaPosition : "").append("|")
                        .append(cdsPosition != null ? cdsPosition : "");
                consequences.add(csqSb.toString());
            }
            csq = String.join(",", consequences);

        }
        return csq;
    }

    private String[] getAllelesArray(Variant variant) {
        String[] allelesArray;
        // if there are indels, we cannot use the normalized alleles (hts forbids empty alleles), so we have to extract a context allele
        // from the VCF source line, add it to the variant and update the variant coordinates
        if (variant.getReference().isEmpty() || variant.getAlternate().isEmpty()) {
            variant = updateVariantAddingContextNucleotideFromSourceLine(variant);
        }
        allelesArray = new String[]{variant.getReference(), variant.getAlternate()};

        return allelesArray;
    }

    private Variant updateVariantAddingContextNucleotideFromSourceLine(Variant variant) {
        // get the original VCF line for the variant from the 'files.src' field
        List<VariantSourceEntry> studiesEntries =
                variant.getSourceEntries().values().stream().filter(s -> studies.contains(s.getStudyId()))
                       .collect(Collectors.toList());
        Optional<String> srcLine = studiesEntries.stream().filter(s -> s.getAttribute("src") != null).findAny()
                                                 .map(s -> s.getAttribute("src"));
        if (!srcLine.isPresent()) {
            String prefix = studiesEntries.size() == 1 ? "study " : "studies ";
            String studies = studiesEntries.stream().map(s -> s.getStudyId())
                                           .collect(Collectors.joining(",", prefix, "."));
            throw new NoSuchElementException("Source line not present for " + studies);
        }

        String[] srcLineFields = srcLine.get().split("\t", 5);

        // get the relative position of the context nucleotide in the source line REF string
        int positionInSrcLine = Integer.parseInt(srcLineFields[1]);
        // the context nucleotide is generally the one preceding the variant
        boolean prependContextNucleotideToVariant = true;
        int relativePositionOfContextNucleotide = variant.getStart() - 1 - positionInSrcLine;
        // if there is no preceding nucleotide in the source line, the context nucleotide will be "after" the variant
        if (relativePositionOfContextNucleotide < 0) {
            relativePositionOfContextNucleotide = variant.getStart() + variant.getReference()
                                                                              .length() - positionInSrcLine;
            prependContextNucleotideToVariant = false;
        }

        // get context nucleotide and add it to the variant
        String contextNucleotide = getContextNucleotideFromSourceLine(srcLineFields,
                                                                      relativePositionOfContextNucleotide);
        variant = addContextNucleotideToVariant(variant, contextNucleotide, prependContextNucleotideToVariant);

        return variant;
    }

    private String getContextNucleotideFromSourceLine(String[] srcLineFields, int relativePositionOfContextNucleotide) {
        String referenceInSrcLine = srcLineFields[3];
        return referenceInSrcLine
                .substring(relativePositionOfContextNucleotide, relativePositionOfContextNucleotide + 1);
    }

    private Variant addContextNucleotideToVariant(Variant variant, String contextNucleotide,
                                                  boolean prependContextNucleotideToVariant) {
        // prepend or append the context nucleotide to the reference and alternate alleles
        if (prependContextNucleotideToVariant) {
            variant.setReference(contextNucleotide + variant.getReference());
            variant.setAlternate(contextNucleotide + variant.getAlternate());
            // update variant start
            variant.setStart(variant.getStart() - 1);
        } else {
            variant.setReference(variant.getReference() + contextNucleotide);
            variant.setAlternate(variant.getAlternate() + contextNucleotide);
            // update variant end
            variant.setEnd(variant.getEnd() + 1);
        }
        return variant;
    }

    private Set<Genotype> getGenotypes(Variant variant, String[] allelesArray) {
        Set<Genotype> genotypes = new HashSet<>();

        Allele[] variantAlleles =
                {Allele.create(allelesArray[0], true), Allele.create(allelesArray[1]), Allele.create(Allele.NO_CALL,
                                                                                false)};

        for (VariantSource source : sources) {
            List<VariantSourceEntry> variantStudyEntries =
                    variant.getSourceEntries().values().stream().filter(s -> s.getStudyId().equals(source.getStudyId()))
                           .collect(Collectors.toList());
            for (VariantSourceEntry variantStudyEntry : variantStudyEntries) {
                genotypes = getStudyGenotypes(genotypes, variantAlleles, variantStudyEntry);
            }
        }
        return genotypes;
    }

    private Set<Genotype> getStudyGenotypes(Set<Genotype> genotypes, Allele[] variantAlleles,
                                            VariantSourceEntry variantStudyEntry) {
        for (Map.Entry<String, Map<String, String>> sampleEntry : variantStudyEntry.getSamplesData().entrySet()) {
            String sampleGenotypeString = sampleEntry.getValue().get(GENOTYPE_KEY);
            Genotype sampleGenotype =
                    parseSampleGenotype(variantAlleles, variantStudyEntry.getFileId(), sampleEntry.getKey(),
                                        sampleGenotypeString);
            genotypes.add(sampleGenotype);
        }
        return genotypes;
    }

    private Genotype parseSampleGenotype(Allele[] variantAlleles, String fileId, String sampleName,
                                         String sampleGenotypeString) {
        String[] alleles = genotypePattern.split(sampleGenotypeString, -1);
        boolean isPhased = sampleGenotypeString.contains("|");

        List<Allele> genotypeAlleles = new ArrayList<>(2);
        for (String allele : alleles) {
            int index;
            if (allele.equals(".")) {
                index = -1;
            } else {
                index = Integer.valueOf(allele);
            }
            // every allele not 0 or 1 will be considered no call
            if (index == -1 || index > NO_CALL_ALLELE_INDEX) {
                index = NO_CALL_ALLELE_INDEX;
            }
            genotypeAlleles.add(variantAlleles[index]);
        }

        GenotypeBuilder builder = new GenotypeBuilder()
                .name(getFixedSampleName(fileId, sampleName))
                .phased(isPhased)
                .alleles(genotypeAlleles);

        return builder.make();
    }

    private String getFixedSampleName(String fileId, String sampleName) {
        // this method returns the "studyId appended" sample name if there are sample name conflicts
        if (filesSampleNamesEquivalences != null) {
            return filesSampleNamesEquivalences.get(fileId).get(sampleName);
        } else {
            return sampleName;
        }
    }

    private long getVariantContextStop(Variant variant) {
        return variant.getStart() + variant.getReference().length() - 1;
    }
}


text:
/* Marked for removal */
var LocalStrategy   = require('passport-local').Strategy;
var Book = require('../models/book');
// TODO - Add models
//var Movie = require('../models/movie');
//var Music = require('../models/music');
//var App = require('../models/app');
//var Game = require('../models/game');

//var bCrypt = require('bcrypt-nodejs');

module.exports = function(passport){

	passport.use('upload', new LocalStrategy({
            passReqToCallback : true // allows us to pass back the entire request to the callback
        },
        function(req, username, password, done) {

            uploadTorrent = function(){
                        var newBook = new Book();

                        newBook.title = req.param('title');
                        newBook.isbn = req.param('isbn');
                        newBook.description = req.param('description');
                        newBook.file_path = torrent.path;
                        // test
                        console.log(req.files);

                        // save the user
                        newBook.save(function(err) {
                            if (err){
                                console.log('Error in Saving torrent: '+err);
                                throw err;
                            }
                            console.log('Upload succesful');
                            return done(null, false, req.flash('message','Upload Succesfully'));
                        });
                    }
            // Delay the execution of findOrCreateUser and execute the method
            // in the next tick of the event loop
            process.nextTick(uploadTorrent);
        })
    );
    //Other functions
}


text:
<?php

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

class CreateModuleTasksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('module_tasks', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string("module");
            $table->string("method");
            $table->string('type');
            $table->integer('year');
            $table->integer('month');
            $table->integer('day');
            $table->integer('hour');
            $table->integer('minute');
            $table->dateTime('last_execution')->nullable();
            $table->dateTime('next_execution')->nullable();
            $table->tinyInteger("status")->default(1);
            $table->tinyInteger("in_progress")->default(0);
            $table->timestamps();
        });
    }

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


text:
<?php

abstract class Wpsqt_Question {

	/**
     * Where the what objects have been called already is
     * stored, currently on useful in the admin section.
     *
     * @var array
     * @since 2.0
	 */
	protected static $_called = array();

	/**
	 * Some sort of identifier for the object.
	 *
	 * @var string
	 * @since 2.0
	 */
	protected static $_id;

	/**
	 * The absolute path to the page view for the form. Needs to
	 * be set in the constructor.
	 *
	 * @var String
	 * @since 2.0
	 */
	protected $_formView;

	/**
	 * The absolute path to the page view for the display. Needs
	 * to be set in the constructor.
	 *
	 * @var string
	 * @since 2.0
	 */
	protected $_displayView;

	/**
	 * The variable information relating the to current question.
	 * @var array
	 * @since 2.0
	 */
	protected $_questionVars = array();

	/**
	 *
	 * Enter description here ...
	 * @var unknown_type
	 */
	protected static $_displayViews = array();

	/**
	 * To set the $this->_formView and collect the data required
	 * for the question type.
	 *
	 * @since 2.0
	 */
	abstract public function __construct( array $values = array() );

	/**
	 * Process the data to set the values for the form.
     *
	 * @param array $input the data for the question.
	 * @since 2.0
	 */
	 public function processValues( array $input ){
	 	$this->_questionVars = $input;
	 	return $this;
	 }

	/**
	 * Returns the content of the form.
	 *
	 * @param string $form The absolute path of the form view file.
	 * @since 2.0
	 */
	public function form( ){

		if ( empty($this->_formView) ){
			return "Someone has dun goof'd! No question form view!";
		}
		if ( !isset(self::$_called[$this->_id]) ){
			ob_start();
			extract($this->_questionVars);
			require $this->_formView;
			self::$_called[$this->_id] = true;
			return ob_get_clean();
		}

		return null;
	}

	/**
	 * Handles processing the form to see if the fields are present
	 * and then process them to return an associative array an item
	 * with the key "errors" which will be merged with the error
	 * messages for the page and item with the key "content" and
	 * an item with the key "name" which is the name of the key
	 * in questions it will assume.
	 *
	 * @param array $postData
	 * @since 2.0
	 */
	public function processForm($postData){
		return false;
	}

	/**
	 * Displays the question for use.
	 *
	 * @since 2.0
	 */
	public static function getDisplayView( $questionData ){

		if ( !isset(self::$_displayViews[$questionData["type"]]) ){
			$objQuestion = self::getObject($questionData["type"]);
			self::$_displayViews[$questionData["type"]] = $objQuestion->getView();
		}

		return self::$_displayViews[$questionData["type"]];

	}

	public function getView(){
		return $this->_displayView;
	}

	/**
	 * Returns the question object.
	 *
	 * @todo look into my possible over use of the factory pattern.
	 * @param string $type
	 * @since 2.0
	 */
	public static function getObject($type){

		return Wpsqt_Core::getObject("Wpsqt_Question_".ucfirst(str_replace(" ", "",strtolower($type))));

	}

}


text:
body { background-color: #eee; }
.container {
  background-color: #eee;
}
#terminal {
  background-color: #000;
  height: 400px;
  overflow: scroll
}
#messages {
  font-family: monospace;
  background-color: black;
  color: green;
  list-style-type: none;
  margin: 0;
  padding: 0;
}
#messages li { padding: 5px 10px; }
#messages li:nth-child(odd) { background: rgba(255, 255, 255, 0.15); }
#caret {
  background-color: #000;
  color: green;
  border-top: 1px solid #000;
}

.input-field .prefix {
  font-size: 3rem !important;
}


text:
<beans:beans xmlns="http://www.springframework.org/schema/security"
	xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans
	http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
	http://www.springframework.org/schema/security
	http://www.springframework.org/schema/security/spring-security-3.2.xsd">

	<!-- enable use-expressions -->
	<http auto-config="true" use-expressions="true">
		<intercept-url pattern="/admin**" access="hasRole('ROLE_ADMIN')" />

		<!-- access denied page -->
		<access-denied-handler error-page="/403" />
		<form-login
		    login-page="/login"
		    default-target-url="/home"
			authentication-failure-url="/login?error"
			username-parameter="username"
			password-parameter="password" />
		<logout logout-success-url="/login?logout" logout-url="/logout" />
		<!-- enable csrf protection -->
<!-- 		<csrf /> -->
	</http>

	<authentication-manager>
		<authentication-provider user-service-ref="myUserDetailsService" >
			<password-encoder hash="bcrypt" />
		</authentication-provider>
	</authentication-manager>

</beans:beans>


text:
import {NgModule} from '@angular/core';
import {IonicPageModule} from 'ionic-angular';
import {RegistrationPage} from './registration';
import {AuthProvider} from '../../providers/auth/auth';
import {File} from '@ionic-native/file';

@NgModule({
    declarations: [
        RegistrationPage,
    ],
    imports: [
        IonicPageModule.forChild(RegistrationPage),
    ],
    exports: [
        RegistrationPage
    ],
    providers: [
        AuthProvider
        ,File
    ]
})
export class RegistrationPageModule {}


text:
var Reciever = {
	fields: {'log': $('log'), 'status': $('status') },
	ajax: {'url': '', 'method': ''},
	actions: new Array(),
	request: undefined,
	interval: undefined,
	initTime: undefined,
	curentAction: 0,

	init: function(config){
		var that = this;
		config = JSON.parse(unescape(config));
		this.initTime = config.initTime;
		this.ajax = config.ajax;
		this.setupInterval(that);

	},
	setupInterval: function(that){
		that.interval = that.getNextAction.periodical(250,that);
	},
	getNextAction: function(){
		var that = this;
		clearInterval(this.interval)
		var onRequest = function(){
			//console.log("send");
			that.fields.status.set('text',"waiting for action..");
		};

		var onFailure = function(xhr){
			console.log(xhr);
			setTimeout(function(){
					req.send();
					},250);
		};
		var onException = function(headerName, value){
			console.log(headerName + " - " +value);
			setTimeout(function(){
					req.send();
					},250);
		};
		var onComplete = function(response){
			if(typeof response == 'undefined'){
				setTimeout(function(){
					req.send();
					},250);
			}else{
				if(response.length > 0){
					var data = JSON.parse(unescape(response[0].data));

					if(data.status == 'ok'){
						that.fields.status.set('text',"performing action!");
						that.processResponse(data.actions);
					}else if(data.status == 'error'){
						that.fields.status.set('text',"error while loading! " + response[0].data.message);
						that.setupInterval(that);
					}
				}else{
					that.fields.status.set('text',"response was empty!");
					that.setupInterval(that);
				}
			}
		};
		var onError = function(error){
			that.fields.status.set('text',"error while ajax request!");
		};

		var action =  { 'time': this.getLastAction() ? this.getLastAction().time : this.initTime};

		var req = new Request.HTML({
			link: 'ignore',
			timeout: 5000,
			method: that.ajax.method,
			url: that.ajax.url,
			data: action,
			onRequest: onRequest,
			onComplete: onComplete,
			onFailure: onFailure,
			onException: onException
			}).send();
	},
	getLastAction: function(){
		if(this.actions.length > 1){
			return this.actions[this.actions.length-1];
		}else{
			return false;
		}
	},
	getFirstAction: function(){
		if(this.actions.length > 1){
			return this.actions[0];
		}else{
			return false;
		}
	},
	processResponse: function(data){
		var isClone = function(a,b){
			for(var o in a){
				if(a.hasOwnProperty(o) && b.hasOwnProperty(o)){
					if(a[o] !== b[o]){
						return false
					}
				}else{
					return false;
				}
			}
			return true;
		}
		for(var i = 0; i < data.length; i++){
			var action = new Action(data[i]);
			if(typeof this.actions[i] != 'undefined' && isClone(this.actions[i], action)){
				console.log("double found");
			}else{
				this.actions.push(action);
			}
		}
		this.setupInterval(this);
		this.performActions();
	},
	performActions: function(){
		for(; this.curentAction < this.actions.length;){
			var action = this.actions[this.curentAction]
			if(action){
				switch (action.type) {
					case "switch_page":
						this.switchPage(action.handling);
						break;
					case "zoom":
						this.zoom(action.handling);
						break;
					default:
						break;
				}
				this.curentAction++;
			}
		}
	},
	switchPage: function(handling){
		var p = new Element('p',{
			'html': "SwitchPage to: " + handling
		});
		p.inject(this.fields.log);
	},
	zoom: function(handling){
		/*
		 * todo: zoom page
		 */
	}
};


text:
package androidx.appcompat.widget;

import static androidx.annotation.RestrictTo.Scope.LIBRARY_GROUP_PREFIX;

import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.ActionMode;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputConnection;
import android.widget.CheckedTextView;
import android.widget.TextView;

import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.RestrictTo;
import androidx.appcompat.R;
import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.view.TintableBackgroundView;
import androidx.core.view.ViewCompat;
import androidx.core.widget.TextViewCompat;
import androidx.core.widget.TintableCheckedTextView;
import androidx.core.widget.TintableCompoundDrawablesView;
import androidx.resourceinspection.annotation.AppCompatShadowedAttributes;

/**
 * A {@link CheckedTextView} which supports compatible features on older versions of the platform,
 * including:
 *

 *
Allows dynamic tint of its background via the background tint methods in
 *     {@link androidx.core.view.ViewCompat}.

 *
Allows setting of the background tint using {@link R.attr#backgroundTint} and
 *     {@link R.attr#backgroundTintMode}.

 *
Allows dynamic tint of its check mark via the check mark tint methods in
 *     {@link androidx.core.widget.CheckedTextViewCompat}.

 *
Allows setting of the check mark tint using {@link R.attr#checkMarkTint} and
 *     {@link R.attr#checkMarkTintMode}.

 *
Allows setting of the font family using {@link android.R.attr#fontFamily}

 *

 *
 *
This will automatically be used when you use {@link CheckedTextView} in your layouts
 * and the top-level activity / dialog is provided by
 * appcompat.
 * You should only need to manually use this class when writing custom views.

 */
@AppCompatShadowedAttributes
public class AppCompatCheckedTextView extends CheckedTextView implements TintableCheckedTextView,
        TintableBackgroundView, EmojiCompatConfigurationView, TintableCompoundDrawablesView {

    private final AppCompatCheckedTextViewHelper mCheckedHelper;
    private final AppCompatBackgroundHelper mBackgroundTintHelper;
    private final AppCompatTextHelper mTextHelper;
    @NonNull
    private AppCompatEmojiTextHelper mAppCompatEmojiTextHelper;

    public AppCompatCheckedTextView(@NonNull Context context) {
        this(context, null);
    }

    public AppCompatCheckedTextView(@NonNull Context context, @Nullable AttributeSet attrs) {
        this(context, attrs, R.attr.checkedTextViewStyle);
    }

    public AppCompatCheckedTextView(
            @NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(TintContextWrapper.wrap(context), attrs, defStyleAttr);

        ThemeUtils.checkAppCompatTheme(this, getContext());

        mTextHelper = new AppCompatTextHelper(this);
        mTextHelper.loadFromAttributes(attrs, defStyleAttr);
        mTextHelper.applyCompoundDrawablesTints();

        mBackgroundTintHelper = new AppCompatBackgroundHelper(this);
        mBackgroundTintHelper.loadFromAttributes(attrs, defStyleAttr);

        mCheckedHelper = new AppCompatCheckedTextViewHelper(this);
        mCheckedHelper.loadFromAttributes(attrs, defStyleAttr);

        AppCompatEmojiTextHelper emojiTextViewHelper = getEmojiTextViewHelper();
        emojiTextViewHelper.loadFromAttributes(attrs, defStyleAttr);
    }

    @Override
    public void setCheckMarkDrawable(@Nullable Drawable d) {
        super.setCheckMarkDrawable(d);
        if (mCheckedHelper != null) {
            mCheckedHelper.onSetCheckMarkDrawable();
        }
    }

    @Override
    public void setCheckMarkDrawable(@DrawableRes int resId) {
        setCheckMarkDrawable(AppCompatResources.getDrawable(getContext(), resId));
    }

    /**
     * This should be accessed from {@link androidx.core.widget.CheckedTextViewCompat}
     *
     * @hide
     */
    @RestrictTo(LIBRARY_GROUP_PREFIX)
    @Override
    public void setSupportCheckMarkTintList(@Nullable ColorStateList tint) {
        if (mCheckedHelper != null) {
            mCheckedHelper.setSupportCheckMarkTintList(tint);
        }
    }

    /**
     * This should be accessed from {@link androidx.core.widget.CheckedTextViewCompat}
     *
     * @hide
     */
    @RestrictTo(LIBRARY_GROUP_PREFIX)
    @Nullable
    @Override
    public ColorStateList getSupportCheckMarkTintList() {
        return mCheckedHelper != null
                ? mCheckedHelper.getSupportCheckMarkTintList()
                : null;
    }

    /**
     * This should be accessed from {@link androidx.core.widget.CheckedTextViewCompat}
     *
     * @hide
     */
    @RestrictTo(LIBRARY_GROUP_PREFIX)
    @Override
    public void setSupportCheckMarkTintMode(@Nullable PorterDuff.Mode tintMode) {
        if (mCheckedHelper != null) {
            mCheckedHelper.setSupportCheckMarkTintMode(tintMode);
        }
    }

    /**
     * This should be accessed from {@link androidx.core.widget.CheckedTextViewCompat}
     *
     * @hide
     */
    @RestrictTo(LIBRARY_GROUP_PREFIX)
    @Nullable
    @Override
    public PorterDuff.Mode getSupportCheckMarkTintMode() {
        return mCheckedHelper != null
                ? mCheckedHelper.getSupportCheckMarkTintMode()
                : null;
    }

    /**
     * This should be accessed via
     * {@link ViewCompat#setBackgroundTintList(View, ColorStateList)}
     * @hide
     */
    @RestrictTo(LIBRARY_GROUP_PREFIX)
    @Override
    public void setSupportBackgroundTintList(@Nullable ColorStateList tint) {
        if (mBackgroundTintHelper != null) {
            mBackgroundTintHelper.setSupportBackgroundTintList(tint);
        }
    }

    /**
     * This should be accessed via
     * {@link androidx.core.view.ViewCompat#getBackgroundTintList(android.view.View)}
     *
     * @hide
     */
    @RestrictTo(LIBRARY_GROUP_PREFIX)
    @Override
    @Nullable
    public ColorStateList getSupportBackgroundTintList() {
        return mBackgroundTintHelper != null
                ? mBackgroundTintHelper.getSupportBackgroundTintList() : null;
    }

    /**
     * This should be accessed via
     * {@link ViewCompat#setBackgroundTintMode(View, PorterDuff.Mode)}
     *
     * @hide
     */
    @RestrictTo(LIBRARY_GROUP_PREFIX)
    @Override
    public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode tintMode) {
        if (mBackgroundTintHelper != null) {
            mBackgroundTintHelper.setSupportBackgroundTintMode(tintMode);
        }
    }

    /**
     * This should be accessed via
     * {@link androidx.core.view.ViewCompat#getBackgroundTintMode(android.view.View)}
     *
     * @hide
     */
    @RestrictTo(LIBRARY_GROUP_PREFIX)
    @Override
    @Nullable
    public PorterDuff.Mode getSupportBackgroundTintMode() {
        return mBackgroundTintHelper != null
                ? mBackgroundTintHelper.getSupportBackgroundTintMode() : null;
    }

    @Override
    public void setBackgroundDrawable(@Nullable Drawable background) {
        super.setBackgroundDrawable(background);
        if (mBackgroundTintHelper != null) {
            mBackgroundTintHelper.onSetBackgroundDrawable(background);
        }
    }

    @Override
    public void setBackgroundResource(@DrawableRes int resId) {
        super.setBackgroundResource(resId);
        if (mBackgroundTintHelper != null) {
            mBackgroundTintHelper.onSetBackgroundResource(resId);
        }
    }

    @Override
    public void setTextAppearance(@NonNull Context context, int resId) {
        super.setTextAppearance(context, resId);
        if (mTextHelper != null) {
            mTextHelper.onSetTextAppearance(context, resId);
        }
    }

    @Override
    protected void drawableStateChanged() {
        super.drawableStateChanged();
        if (mTextHelper != null) {
            mTextHelper.applyCompoundDrawablesTints();
        }
        if (mBackgroundTintHelper != null) {
            mBackgroundTintHelper.applySupportBackgroundTint();
        }
        if (mCheckedHelper != null) {
            mCheckedHelper.applyCheckMarkTint();
        }
    }

    @Override
    @Nullable
    public InputConnection onCreateInputConnection(@NonNull EditorInfo outAttrs) {
        return AppCompatHintHelper.onCreateInputConnection(super.onCreateInputConnection(outAttrs),
                outAttrs, this);
    }

    /**
     * See
     * {@link TextViewCompat#setCustomSelectionActionModeCallback(TextView, ActionMode.Callback)}
     */
    @Override
    public void setCustomSelectionActionModeCallback(
            @Nullable ActionMode.Callback actionModeCallback) {
        super.setCustomSelectionActionModeCallback(
                TextViewCompat.wrapCustomSelectionActionModeCallback(this, actionModeCallback));
    }

    @Override
    @Nullable
    public ActionMode.Callback getCustomSelectionActionModeCallback() {
        return TextViewCompat.unwrapCustomSelectionActionModeCallback(
                super.getCustomSelectionActionModeCallback());
    }

    /**
     * This may be called from super constructors.
     */
    @NonNull
    private AppCompatEmojiTextHelper getEmojiTextViewHelper() {
        //noinspection ConstantConditions
        if (mAppCompatEmojiTextHelper == null) {
            mAppCompatEmojiTextHelper = new AppCompatEmojiTextHelper(this);
        }
        return mAppCompatEmojiTextHelper;
    }

    @Override
    public void setAllCaps(boolean allCaps) {
        super.setAllCaps(allCaps);
        getEmojiTextViewHelper().setAllCaps(allCaps);
    }

    @Override
    public void setEmojiCompatEnabled(boolean enabled) {
        getEmojiTextViewHelper().setEnabled(enabled);
    }

    @Override
    public boolean isEmojiCompatEnabled() {
        return getEmojiTextViewHelper().isEnabled();
    }

    @Override
    public void setCompoundDrawables(@Nullable Drawable left, @Nullable Drawable top,
            @Nullable Drawable right, @Nullable Drawable bottom) {
        super.setCompoundDrawables(left, top, right, bottom);
        if (mTextHelper != null) {
            mTextHelper.onSetCompoundDrawables();
        }
    }

    @RequiresApi(17)
    @Override
    public void setCompoundDrawablesRelative(@Nullable Drawable start, @Nullable Drawable top,
            @Nullable Drawable end, @Nullable Drawable bottom) {
        super.setCompoundDrawablesRelative(start, top, end, bottom);
        if (mTextHelper != null) {
            mTextHelper.onSetCompoundDrawables();
        }
    }

    /**
     * This should be accessed via
     * {@link androidx.core.widget.TextViewCompat#getCompoundDrawableTintList(TextView)}
     *
     * @return the tint applied to the compound drawables
     * @attr ref androidx.appcompat.R.styleable#AppCompatTextView_drawableTint
     * @see #setSupportCompoundDrawablesTintList(ColorStateList)
     *
     * @hide
     */
    @Nullable
    @Override
    @RestrictTo(LIBRARY_GROUP_PREFIX)
    public ColorStateList getSupportCompoundDrawablesTintList() {
        return mTextHelper.getCompoundDrawableTintList();
    }

    /**
     * This should be accessed via {@link
     * androidx.core.widget.TextViewCompat#setCompoundDrawableTintList(TextView, ColorStateList)}
     *
     * Applies a tint to the compound drawables. Does not modify the current tint mode, which is
     * {@link PorterDuff.Mode#SRC_IN} by default.
     *

     * Subsequent calls to {@link #setCompoundDrawables(Drawable, Drawable, Drawable, Drawable)} and
     * related methods will automatically mutate the drawables and apply the specified tint and tint
     * mode using {@link Drawable#setTintList(ColorStateList)}.
     *
     * @param tintList the tint to apply, may be {@code null} to clear tint
     * @attr ref androidx.appcompat.R.styleable#AppCompatTextView_drawableTint
     * @see #getSupportCompoundDrawablesTintList()
     *
     * @hide
     */
    @Override
    @RestrictTo(LIBRARY_GROUP_PREFIX)
    public void setSupportCompoundDrawablesTintList(@Nullable ColorStateList tintList) {
        mTextHelper.setCompoundDrawableTintList(tintList);
        mTextHelper.applyCompoundDrawablesTints();
    }

    /**
     * This should be accessed via
     * {@link androidx.core.widget.TextViewCompat#getCompoundDrawableTintMode(TextView)}
     *
     * Returns the blending mode used to apply the tint to the compound drawables, if specified.
     *
     * @return the blending mode used to apply the tint to the compound drawables
     * @attr ref androidx.appcompat.R.styleable#AppCompatTextView_drawableTintMode
     * @see #setSupportCompoundDrawablesTintMode(PorterDuff.Mode)
     *
     * @hide
     */
    @Nullable
    @Override
    @RestrictTo(LIBRARY_GROUP_PREFIX)
    public PorterDuff.Mode getSupportCompoundDrawablesTintMode() {
        return mTextHelper.getCompoundDrawableTintMode();
    }

    /**
     * This should be accessed via {@link
     * androidx.core.widget.TextViewCompat#setCompoundDrawableTintMode(TextView, PorterDuff.Mode)}
     *
     * Specifies the blending mode used to apply the tint specified by
     * {@link #setSupportCompoundDrawablesTintList(ColorStateList)} to the compound drawables. The
     * default mode is {@link PorterDuff.Mode#SRC_IN}.
     *
     * @param tintMode the blending mode used to apply the tint, may be {@code null} to clear tint
     * @attr ref androidx.appcompat.R.styleable#AppCompatTextView_drawableTintMode
     * @see #setSupportCompoundDrawablesTintList(ColorStateList)
     *
     * @hide
     */
    @Override
    @RestrictTo(LIBRARY_GROUP_PREFIX)
    public void setSupportCompoundDrawablesTintMode(@Nullable PorterDuff.Mode tintMode) {
        mTextHelper.setCompoundDrawableTintMode(tintMode);
        mTextHelper.applyCompoundDrawablesTints();
    }
}


text:
{-# LANGUAGE PatternSynonyms, ForeignFunctionInterface, JavaScriptFFI #-}
module GHCJS.DOM.JSFFI.Generated.SVGPathSegCurvetoCubicRel
       (js_setX, setX, js_getX, getX, js_setY, setY, js_getY, getY,
        js_setX1, setX1, js_getX1, getX1, js_setY1, setY1, js_getY1, getY1,
        js_setX2, setX2, js_getX2, getX2, js_setY2, setY2, js_getY2, getY2,
        SVGPathSegCurvetoCubicRel, castToSVGPathSegCurvetoCubicRel,
        gTypeSVGPathSegCurvetoCubicRel)
       where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, fmap, Show, Read, Eq, Ord)
import Data.Typeable (Typeable)
import GHCJS.Types (JSRef(..), JSString, castRef)
import GHCJS.Foreign (jsNull)
import GHCJS.Foreign.Callback (syncCallback, asyncCallback, syncCallback1, asyncCallback1, syncCallback2, asyncCallback2, OnBlocked(..))
import GHCJS.Marshal (ToJSRef(..), FromJSRef(..))
import GHCJS.Marshal.Pure (PToJSRef(..), PFromJSRef(..))
import Control.Monad.IO.Class (MonadIO(..))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import GHCJS.DOM.Types
import Control.Applicative ((<$>))
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName)
import GHCJS.DOM.Enums

foreign import javascript unsafe "$1[\"x\"] = $2;" js_setX ::
        JSRef SVGPathSegCurvetoCubicRel -> Float -> IO ()

-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGPathSegCurvetoCubicRel.x Mozilla SVGPathSegCurvetoCubicRel.x documentation>
setX :: (MonadIO m) => SVGPathSegCurvetoCubicRel -> Float -> m ()
setX self val
  = liftIO (js_setX (unSVGPathSegCurvetoCubicRel self) val)

foreign import javascript unsafe "$1[\"x\"]" js_getX ::
        JSRef SVGPathSegCurvetoCubicRel -> IO Float

-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGPathSegCurvetoCubicRel.x Mozilla SVGPathSegCurvetoCubicRel.x documentation>
getX :: (MonadIO m) => SVGPathSegCurvetoCubicRel -> m Float
getX self = liftIO (js_getX (unSVGPathSegCurvetoCubicRel self))

foreign import javascript unsafe "$1[\"y\"] = $2;" js_setY ::
        JSRef SVGPathSegCurvetoCubicRel -> Float -> IO ()

-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGPathSegCurvetoCubicRel.y Mozilla SVGPathSegCurvetoCubicRel.y documentation>
setY :: (MonadIO m) => SVGPathSegCurvetoCubicRel -> Float -> m ()
setY self val
  = liftIO (js_setY (unSVGPathSegCurvetoCubicRel self) val)

foreign import javascript unsafe "$1[\"y\"]" js_getY ::
        JSRef SVGPathSegCurvetoCubicRel -> IO Float

-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGPathSegCurvetoCubicRel.y Mozilla SVGPathSegCurvetoCubicRel.y documentation>
getY :: (MonadIO m) => SVGPathSegCurvetoCubicRel -> m Float
getY self = liftIO (js_getY (unSVGPathSegCurvetoCubicRel self))

foreign import javascript unsafe "$1[\"x1\"] = $2;" js_setX1 ::
        JSRef SVGPathSegCurvetoCubicRel -> Float -> IO ()

-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGPathSegCurvetoCubicRel.x1 Mozilla SVGPathSegCurvetoCubicRel.x1 documentation>
setX1 :: (MonadIO m) => SVGPathSegCurvetoCubicRel -> Float -> m ()
setX1 self val
  = liftIO (js_setX1 (unSVGPathSegCurvetoCubicRel self) val)

foreign import javascript unsafe "$1[\"x1\"]" js_getX1 ::
        JSRef SVGPathSegCurvetoCubicRel -> IO Float

-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGPathSegCurvetoCubicRel.x1 Mozilla SVGPathSegCurvetoCubicRel.x1 documentation>
getX1 :: (MonadIO m) => SVGPathSegCurvetoCubicRel -> m Float
getX1 self = liftIO (js_getX1 (unSVGPathSegCurvetoCubicRel self))

foreign import javascript unsafe "$1[\"y1\"] = $2;" js_setY1 ::
        JSRef SVGPathSegCurvetoCubicRel -> Float -> IO ()

-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGPathSegCurvetoCubicRel.y1 Mozilla SVGPathSegCurvetoCubicRel.y1 documentation>
setY1 :: (MonadIO m) => SVGPathSegCurvetoCubicRel -> Float -> m ()
setY1 self val
  = liftIO (js_setY1 (unSVGPathSegCurvetoCubicRel self) val)

foreign import javascript unsafe "$1[\"y1\"]" js_getY1 ::
        JSRef SVGPathSegCurvetoCubicRel -> IO Float

-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGPathSegCurvetoCubicRel.y1 Mozilla SVGPathSegCurvetoCubicRel.y1 documentation>
getY1 :: (MonadIO m) => SVGPathSegCurvetoCubicRel -> m Float
getY1 self = liftIO (js_getY1 (unSVGPathSegCurvetoCubicRel self))

foreign import javascript unsafe "$1[\"x2\"] = $2;" js_setX2 ::
        JSRef SVGPathSegCurvetoCubicRel -> Float -> IO ()

-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGPathSegCurvetoCubicRel.x2 Mozilla SVGPathSegCurvetoCubicRel.x2 documentation>
setX2 :: (MonadIO m) => SVGPathSegCurvetoCubicRel -> Float -> m ()
setX2 self val
  = liftIO (js_setX2 (unSVGPathSegCurvetoCubicRel self) val)

foreign import javascript unsafe "$1[\"x2\"]" js_getX2 ::
        JSRef SVGPathSegCurvetoCubicRel -> IO Float

-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGPathSegCurvetoCubicRel.x2 Mozilla SVGPathSegCurvetoCubicRel.x2 documentation>
getX2 :: (MonadIO m) => SVGPathSegCurvetoCubicRel -> m Float
getX2 self = liftIO (js_getX2 (unSVGPathSegCurvetoCubicRel self))

foreign import javascript unsafe "$1[\"y2\"] = $2;" js_setY2 ::
        JSRef SVGPathSegCurvetoCubicRel -> Float -> IO ()

-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGPathSegCurvetoCubicRel.y2 Mozilla SVGPathSegCurvetoCubicRel.y2 documentation>
setY2 :: (MonadIO m) => SVGPathSegCurvetoCubicRel -> Float -> m ()
setY2 self val
  = liftIO (js_setY2 (unSVGPathSegCurvetoCubicRel self) val)

foreign import javascript unsafe "$1[\"y2\"]" js_getY2 ::
        JSRef SVGPathSegCurvetoCubicRel -> IO Float

-- | <https://developer.mozilla.org/en-US/docs/Web/API/SVGPathSegCurvetoCubicRel.y2 Mozilla SVGPathSegCurvetoCubicRel.y2 documentation>
getY2 :: (MonadIO m) => SVGPathSegCurvetoCubicRel -> m Float
getY2 self = liftIO (js_getY2 (unSVGPathSegCurvetoCubicRel self))


text:
<?php

use GameOfLife\Board;
use Input\RandomInput;
use Ulrichsg\Getopt;
use PHPUnit\Framework\TestCase;

/**
 * Checks whether \Input\RandomInput works as expected.
 */
class RandomInputTest extends TestCase
{
    /** @var Board $board */
    private $board;
    /** @var  RandomInput $input */
    private $input;
    /** @var \PHPUnit_Framework_MockObject_MockObject */
    private $optionsMock;

    protected function setUp()
    {
        $this->input = new RandomInput();
        $this->board = new Board(10, 10, 50, true);
        $this->optionsMock = $this->getMockBuilder(\Ulrichsg\Getopt::class)
                                  ->getMock();
    }

    protected function tearDown()
    {
        unset($this->input);
        unset($this->board);
        unset($this->optionsMock);
    }

    /**
     * @covers \Input\RandomInput::addOptions()
     */
    public function testCanAddOptions()
    {
        $randomInputOptions = array(
            array(null, "fillPercent", Getopt::REQUIRED_ARGUMENT, "RandomInput - Percentage of living cells on a random board\n")
        );

        $this->optionsMock->expects($this->exactly(1))
                          ->method("addOptions")
                          ->with($randomInputOptions);
        if ($this->optionsMock instanceof Getopt) $this->input->addOptions($this->optionsMock);
    }

    /**
     * @covers \Input\RandomInput::fillBoard()
     *
     * @throws \Exception
     */
    public function testCanFillBoardRandomPercentage()
    {
        $amountFields = $this->board->height() * $this->board->width();
        $minAmountCellsAlive = (float)$amountFields * 0.15;
        $maxAmountCellsAlive = (float)$amountFields * 0.70;

        $this->input->fillBoard($this->board, new Getopt());

        $amountCellsAlive = $this->board->getAmountCellsAlive();
        $this->assertGreaterThanOrEqual($minAmountCellsAlive, $amountCellsAlive);
        $this->assertLessThanOrEqual($maxAmountCellsAlive, $amountCellsAlive);
    }

    /**
     * @dataProvider fillBoardCustomPercentageProvider
     * @covers \Input\RandomInput::fillBoard()
     *
     * @param int $_fillPercentage  Fill Percentage
     * @param bool $_expectsError   True: Expects error message
     *                              False: Expects no error message
     * @param string $_errorMessage The expected error message
     *
     * @throws \Exception
     */
    public function testCanFillBoardCustomPercentage(int $_fillPercentage, bool $_expectsError, string $_errorMessage = null)
    {
        $this->optionsMock->expects($this->exactly(2))
                          ->method("getOption")
                          ->with("fillPercent")
                          ->willReturn($_fillPercentage);

        $exceptionOccurred = false;

        if ($this->optionsMock instanceof Getopt)
        {
            try
            {
                $this->input->fillBoard($this->board, $this->optionsMock);
            }
            catch (\Exception $_exception)
            {
                $exceptionOccurred = true;
                $this->assertEquals($_errorMessage, $_exception->getMessage());
            }
        }

        if (! $_expectsError)
        {
            $expectedAmountCellsAlive = ceil($this->board->width() * $this->board->height() * $_fillPercentage / 100);
            $this->assertEquals($expectedAmountCellsAlive, $this->board->getAmountCellsAlive());
            $this->assertFalse($exceptionOccurred);
        }
        else
        {
            $this->assertEquals(0, $this->board->getAmountCellsAlive());
            $this->assertTrue($exceptionOccurred);
        }
    }

    public function fillBoardCustomPercentageProvider()
    {
        return [
            "-1% filled" => ["-1", true, "There can't be less living cells than 0% of the fields."],
            "0% filled" => ["0", false],
            "20% filled" => ["20", false],
            "50% filled" => ["50", false],
            "76% filled" => ["76", false],
            "90% filled" => ["90", false],
            "99% filled" => ["99", false],
            "100% filled" => ["100", false],
            "101% filled" => ["101", true, "There can't be more living cells than 100% of the fields."],
            "130% filled" => ["130", true, "There can't be more living cells than 100% of the fields."],
            "2500% filled" => ["2500", true, "There can't be more living cells than 100% of the fields."]
        ];
    }
}


text:
package org.hibernate.cache.ehcache.internal.nonstop;

import net.sf.ehcache.constructs.nonstop.NonStopCacheException;

import org.hibernate.cache.CacheException;
import org.hibernate.cache.spi.EntityRegion;
import org.hibernate.cache.spi.access.EntityRegionAccessStrategy;
import org.hibernate.cache.spi.access.SoftLock;

/**
 * Implementation of {@link EntityRegionAccessStrategy} that handles {@link net.sf.ehcache.constructs.nonstop.NonStopCacheException} using
 * {@link HibernateNonstopCacheExceptionHandler}
 *
 * @author Abhishek Sanoujam
 * @author Alex Snaps
 */
public class NonstopAwareEntityRegionAccessStrategy implements EntityRegionAccessStrategy {

	private final EntityRegionAccessStrategy actualStrategy;
	private final HibernateNonstopCacheExceptionHandler hibernateNonstopExceptionHandler;

	/**
	 * Constructor accepting the actual {@link EntityRegionAccessStrategy} and the {@link HibernateNonstopCacheExceptionHandler}
	 *
	 * @param actualStrategy
	 * @param hibernateNonstopExceptionHandler
	 */
	public NonstopAwareEntityRegionAccessStrategy(EntityRegionAccessStrategy actualStrategy,
												  HibernateNonstopCacheExceptionHandler hibernateNonstopExceptionHandler) {
		this.actualStrategy = actualStrategy;
		this.hibernateNonstopExceptionHandler = hibernateNonstopExceptionHandler;
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.hibernate.cache.spi.access.EntityRegionAccessStrategy#getRegion()
	 */
	public EntityRegion getRegion() {
		return actualStrategy.getRegion();
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.hibernate.cache.spi.access.EntityRegionAccessStrategy#afterInsert(java.lang.Object, java.lang.Object, java.lang.Object)
	 */
	public boolean afterInsert(Object key, Object value, Object version) throws CacheException {
		try {
			return actualStrategy.afterInsert( key, value, version );
		}
		catch ( NonStopCacheException nonStopCacheException ) {
			hibernateNonstopExceptionHandler.handleNonstopCacheException( nonStopCacheException );
			return false;
		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.hibernate.cache.spi.access.EntityRegionAccessStrategy#afterUpdate(java.lang.Object, java.lang.Object, java.lang.Object,
	 *	  java.lang.Object, org.hibernate.cache.spi.access.SoftLock)
	 */
	public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock)
			throws CacheException {
		try {
			return actualStrategy.afterUpdate( key, value, currentVersion, previousVersion, lock );
		}
		catch ( NonStopCacheException nonStopCacheException ) {
			hibernateNonstopExceptionHandler.handleNonstopCacheException( nonStopCacheException );
			return false;
		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.hibernate.cache.spi.access.EntityRegionAccessStrategy#evict(java.lang.Object)
	 */
	public void evict(Object key) throws CacheException {
		try {
			actualStrategy.evict( key );
		}
		catch ( NonStopCacheException nonStopCacheException ) {
			hibernateNonstopExceptionHandler.handleNonstopCacheException( nonStopCacheException );
		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.hibernate.cache.spi.access.EntityRegionAccessStrategy#evictAll()
	 */
	public void evictAll() throws CacheException {
		try {
			actualStrategy.evictAll();
		}
		catch ( NonStopCacheException nonStopCacheException ) {
			hibernateNonstopExceptionHandler.handleNonstopCacheException( nonStopCacheException );
		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.hibernate.cache.spi.access.EntityRegionAccessStrategy#get(java.lang.Object, long)
	 */
	public Object get(Object key, long txTimestamp) throws CacheException {
		try {
			return actualStrategy.get( key, txTimestamp );
		}
		catch ( NonStopCacheException nonStopCacheException ) {
			hibernateNonstopExceptionHandler.handleNonstopCacheException( nonStopCacheException );
			return null;
		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.hibernate.cache.spi.access.EntityRegionAccessStrategy#insert(java.lang.Object, java.lang.Object, java.lang.Object)
	 */
	public boolean insert(Object key, Object value, Object version) throws CacheException {
		try {
			return actualStrategy.insert( key, value, version );
		}
		catch ( NonStopCacheException nonStopCacheException ) {
			hibernateNonstopExceptionHandler.handleNonstopCacheException( nonStopCacheException );
			return false;
		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.hibernate.cache.spi.access.EntityRegionAccessStrategy#lockItem(java.lang.Object, java.lang.Object)
	 */
	public SoftLock lockItem(Object key, Object version) throws CacheException {
		try {
			return actualStrategy.lockItem( key, version );
		}
		catch ( NonStopCacheException nonStopCacheException ) {
			hibernateNonstopExceptionHandler.handleNonstopCacheException( nonStopCacheException );
			return null;
		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.hibernate.cache.spi.access.EntityRegionAccessStrategy#lockRegion()
	 */
	public SoftLock lockRegion() throws CacheException {
		try {
			return actualStrategy.lockRegion();
		}
		catch ( NonStopCacheException nonStopCacheException ) {
			hibernateNonstopExceptionHandler.handleNonstopCacheException( nonStopCacheException );
			return null;
		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.hibernate.cache.spi.access.EntityRegionAccessStrategy#putFromLoad(java.lang.Object, java.lang.Object, long, java.lang.Object,
	 *	  boolean)
	 */
	public boolean putFromLoad(Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride)
			throws CacheException {
		try {
			return actualStrategy.putFromLoad( key, value, txTimestamp, version, minimalPutOverride );
		}
		catch ( NonStopCacheException nonStopCacheException ) {
			hibernateNonstopExceptionHandler.handleNonstopCacheException( nonStopCacheException );
			return false;
		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.hibernate.cache.spi.access.EntityRegionAccessStrategy#putFromLoad(java.lang.Object, java.lang.Object, long, java.lang.Object)
	 */
	public boolean putFromLoad(Object key, Object value, long txTimestamp, Object version) throws CacheException {
		try {
			return actualStrategy.putFromLoad( key, value, txTimestamp, version );
		}
		catch ( NonStopCacheException nonStopCacheException ) {
			hibernateNonstopExceptionHandler.handleNonstopCacheException( nonStopCacheException );
			return false;
		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.hibernate.cache.spi.access.EntityRegionAccessStrategy#remove(java.lang.Object)
	 */
	public void remove(Object key) throws CacheException {
		try {
			actualStrategy.remove( key );
		}
		catch ( NonStopCacheException nonStopCacheException ) {
			hibernateNonstopExceptionHandler.handleNonstopCacheException( nonStopCacheException );
		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.hibernate.cache.spi.access.EntityRegionAccessStrategy#removeAll()
	 */
	public void removeAll() throws CacheException {
		try {
			actualStrategy.removeAll();
		}
		catch ( NonStopCacheException nonStopCacheException ) {
			hibernateNonstopExceptionHandler.handleNonstopCacheException( nonStopCacheException );
		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.hibernate.cache.spi.access.EntityRegionAccessStrategy#unlockItem(java.lang.Object, org.hibernate.cache.spi.access.SoftLock)
	 */
	public void unlockItem(Object key, SoftLock lock) throws CacheException {
		try {
			actualStrategy.unlockItem( key, lock );
		}
		catch ( NonStopCacheException nonStopCacheException ) {
			hibernateNonstopExceptionHandler.handleNonstopCacheException( nonStopCacheException );
		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.hibernate.cache.spi.access.EntityRegionAccessStrategy#unlockRegion(org.hibernate.cache.spi.access.SoftLock)
	 */
	public void unlockRegion(SoftLock lock) throws CacheException {
		try {
			actualStrategy.unlockRegion( lock );
		}
		catch ( NonStopCacheException nonStopCacheException ) {
			hibernateNonstopExceptionHandler.handleNonstopCacheException( nonStopCacheException );
		}
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see org.hibernate.cache.spi.access.EntityRegionAccessStrategy#update(java.lang.Object, java.lang.Object, java.lang.Object,
	 *	  java.lang.Object)
	 */
	public boolean update(Object key, Object value, Object currentVersion, Object previousVersion)
			throws CacheException {
		try {
			return actualStrategy.update( key, value, currentVersion, previousVersion );
		}
		catch ( NonStopCacheException nonStopCacheException ) {
			hibernateNonstopExceptionHandler.handleNonstopCacheException( nonStopCacheException );
			return false;
		}
	}
}


text:
#include <signal.h>
#include <adbase/Net.hpp>
#include <adbase/Logging.hpp>
#include <adbase/Metrics.hpp>

adbase::metrics::Metrics* metrics = nullptr;
adbase::EventLoop* gloop = nullptr;

void test(void*) {
    if (metrics != nullptr) {
        std::unordered_map<std::string, int64_t> values = metrics->getGauges();
        for (auto &t : values) {
            adbase::metrics::MetricName metricName = adbase::metrics::Metrics::getMetricName(t.first);
            LOG_INFO << metricName.moduleName << " -> " << t.second;
            LOG_INFO << metricName.metricName << " -> " << t.second;
            for (auto &a : metricName.tags) {
                LOG_INFO << a.first << " -> " << a.second;
            }
        }
    }
}

// {{{ static void killSignal()

static void killSignal(const int sig) {
    (void)sig;
    if (gloop != nullptr) {
        gloop->stop();
        delete gloop;
        gloop = nullptr;
    }

    adbase::metrics::Metrics::stop();
    exit(0);
}

// }}}
// {{{ static void reloadConf()

static void reloadConf(const int sig) {
    (void)sig;
}

// }}}
// {{{ static void registerSignal()

static void registerSignal() {
    /* 忽略Broken Pipe信号 */
    signal(SIGPIPE, SIG_IGN);
    /* 处理kill信号 */
    signal(SIGINT,  killSignal);
    signal(SIGKILL, killSignal);
    signal(SIGQUIT, killSignal);
    signal(SIGTERM, killSignal);
    signal(SIGHUP,  killSignal);
    signal(SIGSEGV, killSignal);
    signal(SIGUSR1, reloadConf);
}

// }}}

int main(void) {
    registerSignal();
    adbase::EventLoop* eventloop = new adbase::EventLoop();
    gloop = eventloop;
    adbase::Timer timer(eventloop->getBase());
    metrics = adbase::metrics::Metrics::init(&timer);

    uint32_t interval = 1000;
    timer.runEvery(interval, std::bind(test, std::placeholders::_1), nullptr);
    std::unordered_map<std::string, std::string> tags;
    tags["topic"] = "admid";
    tags["xxx"] = "example1";
    adbase::metrics::Metrics::buildGaugesWithTag("test", "rss", tags, interval, [](){
        return 100;
    });
    eventloop->start();
    return 0;
}


text:
import hashlib
import json
import mimetypes
import netaddr
import os
import sentry_sdk
# import structlog
import subprocess
import sys
import webtest

from dcicutils.beanstalk_utils import source_beanstalk_env_vars
# from dcicutils.beanstalk_utils import whodaman as _whodaman  # don't export
from dcicutils.env_utils import get_mirror_env_from_context, FF_ENV_PRODUCTION_GREEN, FF_ENV_PRODUCTION_BLUE
from dcicutils.ff_utils import get_health_page
from dcicutils.log_utils import set_logging
from sentry_sdk.integrations.pyramid import PyramidIntegration
from sentry_sdk.integrations.sqlalchemy import SqlalchemyIntegration
from pkg_resources import resource_filename
# from pyramid.authorization import ACLAuthorizationPolicy
from pyramid.config import Configurator
from pyramid_localroles import LocalRolesAuthorizationPolicy
# from pyramid.path import AssetResolver, caller_package
# from pyramid.session import SignedCookieSessionFactory
from pyramid.settings import asbool
from snovault.app import STATIC_MAX_AGE, session, json_from_path, configure_dbsession, changelogs, json_asset
from snovault.elasticsearch import APP_FACTORY
from snovault.elasticsearch.interfaces import INVALIDATION_SCOPE_ENABLED
# from snovault.json_renderer import json_renderer
# from sqlalchemy import engine_from_config
# from webob.cookies import JSONSerializer

from .loadxl import load_all
from .util import find_other_in_pair

if sys.version_info.major < 3:
    raise EnvironmentError("The Fourfront encoded library no longer supports Python 2.")

# location of environment variables on elasticbeanstalk
BEANSTALK_ENV_PATH = "/opt/python/current/env"

def static_resources(config):
    mimetypes.init()
    mimetypes.init([resource_filename('encoded', 'static/mime.types')])
    config.add_static_view('static', 'static', cache_max_age=STATIC_MAX_AGE)
    config.add_static_view('profiles', 'schemas', cache_max_age=STATIC_MAX_AGE)

    # Favicon
    favicon_path = '/static/img/favicon.ico'
    if config.route_prefix:
        favicon_path = '/%s%s' % (config.route_prefix, favicon_path)
    config.add_route('favicon.ico', 'favicon.ico')

    def favicon(request):
        subreq = request.copy()
        subreq.path_info = favicon_path
        response = request.invoke_subrequest(subreq)
        return response

    config.add_view(favicon, route_name='favicon.ico')

    # Robots.txt
    robots_txt_path = None
    if config.registry.settings.get('testing') in [True, 'true', 'True']:
        robots_txt_path = '/static/dev-robots.txt'
    else:
        robots_txt_path = '/static/robots.txt'

    if config.route_prefix:
        robots_txt_path = '/%s%s' % (config.route_prefix, robots_txt_path)

    config.add_route('robots.txt-conditional', '/robots.txt')

    def robots_txt(request):
        subreq = request.copy()
        subreq.path_info = robots_txt_path
        response = request.invoke_subrequest(subreq)
        return response

    config.add_view(robots_txt, route_name='robots.txt-conditional')

def load_workbook(app, workbook_filename, docsdir):
    environ = {
        'HTTP_ACCEPT': 'application/json',
        'REMOTE_USER': 'IMPORT',
    }
    testapp = webtest.TestApp(app, environ)
    load_all(testapp, workbook_filename, docsdir)

# This key is best interpreted not as the 'snovault version' but rather the 'version of the app built on snovault'.
# As such, it should be left this way, even though it may appear redundant with the 'eb_app_version' registry key
# that we also have, which tries to be the value eb uses. -kmp 28-Apr-2020
APP_VERSION_REGISTRY_KEY = 'snovault.app_version'

def app_version(config):
    if not config.registry.settings.get(APP_VERSION_REGISTRY_KEY):
        # we update version as part of deployment process `deploy_beanstalk.py`
        # but if we didn't check env then git
        version = os.environ.get("ENCODED_VERSION")
        if not version:
            try:
                version = subprocess.check_output(
                    ['git', '-C', os.path.dirname(__file__), 'describe']).decode('utf-8').strip()
                diff = subprocess.check_output(
                    ['git', '-C', os.path.dirname(__file__), 'diff', '--no-ext-diff'])
                if diff:
                    version += '-patch' + hashlib.sha1(diff).hexdigest()[:7]
            except Exception:
                version = "test"

        config.registry.settings[APP_VERSION_REGISTRY_KEY] = version

    # GA Config
    ga_conf_file = config.registry.settings.get('ga_config_location')
    ga_conf_existing = config.registry.settings.get('ga_config')
    if ga_conf_file and not ga_conf_existing:
        ga_conf_file = os.path.normpath(
            os.path.join(
                os.path.dirname(os.path.abspath(__file__)),  # Absolute loc. of this file
                "../../",                                    # Go back up to repo dir
                ga_conf_file
            )
        )
        if not os.path.exists(ga_conf_file):
            raise Exception(ga_conf_file + " does not exist in filesystem. Aborting.")
        with open(ga_conf_file) as json_file:
            config.registry.settings["ga_config"] = json.load(json_file)

def main(global_config, **local_config):
    """
    This function returns a Pyramid WSGI application.
    """

    settings = global_config
    settings.update(local_config)

    set_logging(in_prod=settings.get('production'))
    # set_logging(settings.get('elasticsearch.server'), settings.get('production'))

    # source environment variables on elastic beanstalk
    source_beanstalk_env_vars()

    settings['snovault.jsonld.namespaces'] = json_asset('encoded:schemas/namespaces.json')
    settings['snovault.jsonld.terms_namespace'] = 'https://www.encodeproject.org/terms/'
    settings['snovault.jsonld.terms_prefix'] = 'encode'
    # set auth0 keys
    settings['auth0.secret'] = os.environ.get("Auth0Secret")
    settings['auth0.client'] = os.environ.get("Auth0Client")
    # set google reCAPTCHA keys
    settings['g.recaptcha.key'] = os.environ.get('reCaptchaKey')
    settings['g.recaptcha.secret'] = os.environ.get('reCaptchaSecret')
    # enable invalidation scope
    settings[INVALIDATION_SCOPE_ENABLED] = True

    # set mirrored Elasticsearch location (for staging and production servers)
    mirror = get_mirror_env_from_context(settings)
    if mirror is not None:
        settings['mirror.env.name'] = mirror
        settings['mirror_health'] = get_health_page(ff_env=mirror)

    config = Configurator(settings=settings)

    config.registry[APP_FACTORY] = main  # used by mp_indexer
    config.include(app_version)

    config.include('pyramid_multiauth')  # must be before calling set_authorization_policy
    # Override default authz policy set by pyramid_multiauth
    config.set_authorization_policy(LocalRolesAuthorizationPolicy())
    config.include(session)

    # must include, as tm.attempts was removed from pyramid_tm
    config.include('pyramid_retry')

    config.include(configure_dbsession)
    config.include('snovault')
    config.commit()  # commit so search can override listing

    # Render an HTML page to browsers and a JSON document for API clients
    # config.include(add_schemas_to_html_responses)
    config.include('.renderers')
    config.include('.authentication')
    config.include('.server_defaults')
    config.include('.root')
    config.include('.types')
    config.include('.batch_download')
    config.include('.loadxl')
    config.include('.visualization')

    if 'elasticsearch.server' in config.registry.settings:
        config.include('snovault.elasticsearch')
        config.include('.search')

    # this contains fall back url, so make sure it comes just before static_resoruces
    config.include('.types.page')
    config.include(static_resources)
    config.include(changelogs)

    # we are loading ontologies now as regular items
    # config.registry['ontology'] = json_from_path(settings.get('ontology_path'), {})
    aws_ip_ranges = json_from_path(settings.get('aws_ip_ranges_path'), {'prefixes': []})
    config.registry['aws_ipset'] = netaddr.IPSet(
        record['ip_prefix'] for record in aws_ip_ranges['prefixes'] if record['service'] == 'AMAZON')

    if asbool(settings.get('testing', False)):
        config.include('.tests.testing_views')

    # Load upgrades last so that all views (including testing views) are
    # registered.
    config.include('.upgrade')

    # initialize sentry reporting, split into "production" and "mastertest", do nothing in local/testing
    current_env = settings.get('env.name', None)
    if current_env in [FF_ENV_PRODUCTION_GREEN, FF_ENV_PRODUCTION_BLUE]:
        sentry_sdk.init("https://0d46fafce1d04ea2bfbe11ff15ca896e@o427308.ingest.sentry.io/5379985",
                        integrations=[PyramidIntegration(), SqlalchemyIntegration()])
    elif current_env is not None:
        sentry_sdk.init("https://ce359da106854a07aa67aabee873601c@o427308.ingest.sentry.io/5373642",
                        integrations=[PyramidIntegration(), SqlalchemyIntegration()])

    app = config.make_wsgi_app()

    workbook_filename = settings.get('load_workbook', '')
    # This option never gets used. Is that bad? -kmp 27-Jun-2020
    # load_test_only = asbool(settings.get('load_test_only', False))
    docsdir = settings.get('load_docsdir', None)
    if docsdir is not None:
        docsdir = [path.strip() for path in docsdir.strip().split('\n')]
    if workbook_filename:
        load_workbook(app, workbook_filename, docsdir)

    return app


text:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Threading;
using Xamarin.Utilities;

#if PLATFORM_IOS
using AuthenticateUIType = MonoTouch.UIKit.UIViewController;
#elif PLATFORM_ANDROID
using AuthenticateUIType = Android.Content.Intent;
using UIContext = Android.Content.Context;
#else
using AuthenticateUIType = System.Object;
#endif

namespace Xamarin.Auth
{
	/// <summary>
	/// A process and user interface to authenticate a user.
	/// </summary>
#if XAMARIN_AUTH_INTERNAL
	internal abstract class Authenticator
#else
	public abstract class Authenticator
#endif
	{
		/// <summary>
		/// Title of any UI elements that need to be presented for this authenticator.
		/// </summary>
		public string Title { get; set; }

		/// <summary>
		/// Occurs when authentication has been successfully or unsuccessfully completed.
		/// Consult the <see cref="AuthenticatorCompletedEventArgs.IsAuthenticated"/> event argument to determine if
		/// authentication was successful.
		/// </summary>
		public event EventHandler<AuthenticatorCompletedEventArgs> Completed;

		/// <summary>
		/// Occurs when there an error is encountered when authenticating.
		/// </summary>
		public event EventHandler<AuthenticatorErrorEventArgs> Error;

		/// <summary>
		/// Whether this authenticator has completed its interaction with the user.
		/// </summary>
		public bool HasCompleted { get; private set; }

		/// <summary>
		/// Initializes a new instance of the <see cref="Xamarin.Auth.Authenticator"/> class.
		/// </summary>
		public Authenticator ()
		{
			Title = "Authenticate";
			HasCompleted = false;
		}

#if PLATFORM_ANDROID
		UIContext context;
		public AuthenticateUIType GetUI (UIContext context)
		{
			this.context = context;
			return GetPlatformUI (context);
		}
		protected abstract AuthenticateUIType GetPlatformUI (UIContext context);
#else
		/// <summary>
		/// Gets the UI for this authenticator.
		/// </summary>
		/// <returns>
		/// The UI that needs to be presented.
		/// </returns>
		public AuthenticateUIType GetUI ()
		{
			return GetPlatformUI ();
		}

		/// <summary>
		/// Gets the UI for this authenticator.
		/// </summary>
		/// <returns>
		/// The UI that needs to be presented.
		/// </returns>
		protected abstract AuthenticateUIType GetPlatformUI ();
#endif

		/// <summary>
		/// Implementations must call this function when they have successfully authenticated.
		/// </summary>
		/// <param name='account'>
		/// The authenticated account.
		/// </param>
		public void OnSucceeded (Account account)
		{
			if (HasCompleted)
				return;

			HasCompleted = true;

			BeginInvokeOnUIThread (delegate {
				var ev = Completed;
				if (ev != null) {
					ev (this, new AuthenticatorCompletedEventArgs (account));
				}
			});
		}

		/// <summary>
		/// Implementations must call this function when they have successfully authenticated.
		/// </summary>
		/// <param name='username'>
		/// User name of the account.
		/// </param>
		/// <param name='accountProperties'>
		/// Additional data, such as access tokens, that need to be stored with the account. This
		/// information is secured.
		/// </param>
		public void OnSucceeded (string username, IDictionary<string, string> accountProperties)
		{
			OnSucceeded (new Account (username, accountProperties));
		}

		/// <summary>
		/// Implementations must call this function when they have cancelled the operation.
		/// </summary>
		public void OnCancelled ()
		{
			if (HasCompleted)
				return;

			HasCompleted = true;

			BeginInvokeOnUIThread (delegate {
				var ev = Completed;
				if (ev != null) {
					ev (this, new AuthenticatorCompletedEventArgs (null));
				}
			});
		}

		/// <summary>
		/// Implementations must call this function when they have failed to authenticate.
		/// </summary>
		/// <param name='message'>
		/// The reason that this authentication has failed.
		/// </param>
		public void OnError (string message)
		{
			BeginInvokeOnUIThread (delegate {
				var ev = Error;
				if (ev != null) {
					ev (this, new AuthenticatorErrorEventArgs (message));
				}
			});
		}

		/// <summary>
		/// Implementations must call this function when they have failed to authenticate.
		/// </summary>
		/// <param name='exception'>
		/// The reason that this authentication has failed.
		/// </param>
		public void OnError (Exception exception)
		{
			BeginInvokeOnUIThread (delegate {
				var ev = Error;
				if (ev != null) {
					ev (this, new AuthenticatorErrorEventArgs (exception));
				}
			});
		}

		void BeginInvokeOnUIThread (Action action)
		{
#if PLATFORM_IOS
			MonoTouch.UIKit.UIApplication.SharedApplication.BeginInvokeOnMainThread (delegate {
				action ();
			});
#elif PLATFORM_ANDROID
			var a = context as Android.App.Activity;
			if (a != null) {
				a.RunOnUiThread (action);
			}
			else {
				action ();
			}
#else
			action ();
#endif
		}
	}

	/// <summary>
	/// Authenticator completed event arguments.
	/// </summary>
#if XAMARIN_AUTH_INTERNAL
	internal class AuthenticatorCompletedEventArgs : EventArgs
#else
	public class AuthenticatorCompletedEventArgs : EventArgs
#endif
	{
		/// <summary>
		/// Whether the authentication succeeded and there is a valid <see cref="Account"/>.
		/// </summary>
		/// <value>
		/// <see langword="true"/> if the user is authenticated; otherwise, <see langword="false"/>.
		/// </value>
		public bool IsAuthenticated { get { return Account != null; } }

		/// <summary>
		/// Gets the account created that represents this authentication.
		/// </summary>
		/// <value>
		/// The account.
		/// </value>
		public Account Account { get; private set; }

		/// <summary>
		/// Initializes a new instance of the <see cref="Xamarin.Auth.AuthenticatorCompletedEventArgs"/> class.
		/// </summary>
		/// <param name='account'>
		/// The account created or <see langword="null"/> if authentication failed or was canceled.
		/// </param>
		public AuthenticatorCompletedEventArgs (Account account)
		{
			Account = account;
		}
	}

	/// <summary>
	/// Authenticator error event arguments.
	/// </summary>
#if XAMARIN_AUTH_INTERNAL
	internal class AuthenticatorErrorEventArgs : EventArgs
#else
	public class AuthenticatorErrorEventArgs : EventArgs
#endif
	{
		/// <summary>
		/// Gets a message describing the error.
		/// </summary>
		/// <value>
		/// The message.
		/// </value>
		public string Message { get; private set; }

		/// <summary>
		/// Gets the exception that signaled the error if there was one.
		/// </summary>
		/// <value>
		/// The exception or <see langword="null"/>.
		/// </value>
		public Exception Exception { get; private set; }

		/// <summary>
		/// Initializes a new instance of the <see cref="Xamarin.Auth.AuthenticatorErrorEventArgs"/> class
		/// with a message but no exception.
		/// </summary>
		/// <param name='message'>
		/// A message describing the error.
		/// </param>
		public AuthenticatorErrorEventArgs (string message)
		{
			Message = message;
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="Xamarin.Auth.AuthenticatorErrorEventArgs"/> class with an exception.
		/// </summary>
		/// <param name='exception'>
		/// The exception signaling the error. The message of this object is retrieved from this exception or
		/// its inner exceptions.
		/// </param>
		public AuthenticatorErrorEventArgs (Exception exception)
		{
			Message = exception.GetUserMessage ();
			Exception = exception;
		}
	}
}


text:
<?php # -*- coding: utf-8 -*-
/**
 * Mlp_Language_Negotiation_Interface
 *
 * @version    2014.09.26
 * @author     Inpsyde GmbH, toscho
 * @license    GPL
 * @package    MultilingualPress
 * @subpackage Redirect
 */
interface Mlp_Language_Negotiation_Interface {

	/**
	 * @param array $args
	 *
	 * @return array
	 */
	public function get_redirect_match( array $args = array() );

	/**
	 * Returns the redirect target data for all available language versions.
	 *
	 * @since 2.10.0
	 *
	 * @param array $args Optional. Arguments required to determine the redirect targets. Defaults to empty array.
	 *
	 * @return array[] Array of redirect targets.
	 */
	public function get_redirect_targets( array $args = array() );
}


text:
'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
    Category = mongoose.model('Category'),
    _ = require('lodash');

var crud = require('./crud.server.controller')('Category', 'name');

module.exports = crud;


text:
import {ColumnView} from '../scene/view';
import {ColumnModel} from './column.model';
import {TemplatePath} from '../template';

TemplatePath.register('pivot-cell', (template) => {
	return {
		model: 'pivot',
		resource: template.for
	};
});

export class PivotColumnModel extends ColumnModel {
	constructor() {
		super('pivot');

		this.key = '$pivot';
		this.title = 'Pivot';

		this.source = 'generation';
		this.class = 'pivot';
		this.canEdit = false;
		this.canSort = false;
		this.canResize = false;
		this.width = 60;
		this.rowIndex = 0;
	}
}

export class PivotColumn extends ColumnView {
	constructor(model) {
		super(model);
	}

	static model(model) {
		return model ? PivotColumn.assign(model) : new PivotColumnModel();
	}
}


text:
package org.apache.camel.builder.endpoint.dsl;

import javax.annotation.Generated;
import org.apache.camel.builder.EndpointConsumerBuilder;
import org.apache.camel.builder.EndpointProducerBuilder;
import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;

/**
 * Used for communicating with a remote Bonita BPM process engine.
 *
 * Generated by camel build tools - do NOT edit this file!
 */
@Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
public interface BonitaEndpointBuilderFactory {

    /**
     * Builder for endpoint for the Bonita component.
     */
    public interface BonitaEndpointBuilder extends EndpointProducerBuilder {
        default AdvancedBonitaEndpointBuilder advanced() {
            return (AdvancedBonitaEndpointBuilder) this;
        }
        /**
         * Hostname where Bonita engine runs.
         *
         * The option is a: java.lang.String type.
         *
         * Default: localhost
         * Group: producer
         */
        default BonitaEndpointBuilder hostname(String hostname) {
            doSetProperty("hostname", hostname);
            return this;
        }
        /**
         * Whether the producer should be started lazy (on the first message).
         * By starting lazy you can use this to allow CamelContext and routes to
         * startup in situations where a producer may otherwise fail during
         * starting and cause the route to fail being started. By deferring this
         * startup to be lazy then the startup failure can be handled during
         * routing messages via Camel's routing error handlers. Beware that when
         * the first message is processed then creating and starting the
         * producer may take a little time and prolong the total processing time
         * of the processing.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: producer
         */
        default BonitaEndpointBuilder lazyStartProducer(
                boolean lazyStartProducer) {
            doSetProperty("lazyStartProducer", lazyStartProducer);
            return this;
        }
        /**
         * Whether the producer should be started lazy (on the first message).
         * By starting lazy you can use this to allow CamelContext and routes to
         * startup in situations where a producer may otherwise fail during
         * starting and cause the route to fail being started. By deferring this
         * startup to be lazy then the startup failure can be handled during
         * routing messages via Camel's routing error handlers. Beware that when
         * the first message is processed then creating and starting the
         * producer may take a little time and prolong the total processing time
         * of the processing.
         *
         * The option will be converted to a boolean type.
         *
         * Default: false
         * Group: producer
         */
        default BonitaEndpointBuilder lazyStartProducer(String lazyStartProducer) {
            doSetProperty("lazyStartProducer", lazyStartProducer);
            return this;
        }
        /**
         * Port of the server hosting Bonita engine.
         *
         * The option is a: java.lang.String type.
         *
         * Default: 8080
         * Group: producer
         */
        default BonitaEndpointBuilder port(String port) {
            doSetProperty("port", port);
            return this;
        }
        /**
         * Name of the process involved in the operation.
         *
         * The option is a: java.lang.String type.
         *
         * Group: producer
         */
        default BonitaEndpointBuilder processName(String processName) {
            doSetProperty("processName", processName);
            return this;
        }
        /**
         * Password to authenticate to Bonita engine.
         *
         * The option is a: java.lang.String type.
         *
         * Group: security
         */
        default BonitaEndpointBuilder password(String password) {
            doSetProperty("password", password);
            return this;
        }
        /**
         * Username to authenticate to Bonita engine.
         *
         * The option is a: java.lang.String type.
         *
         * Group: security
         */
        default BonitaEndpointBuilder username(String username) {
            doSetProperty("username", username);
            return this;
        }
    }

    /**
     * Advanced builder for endpoint for the Bonita component.
     */
    public interface AdvancedBonitaEndpointBuilder
            extends
                EndpointProducerBuilder {
        default BonitaEndpointBuilder basic() {
            return (BonitaEndpointBuilder) this;
        }
        /**
         * Whether the endpoint should use basic property binding (Camel 2.x) or
         * the newer property binding with additional capabilities.
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: advanced
         */
        default AdvancedBonitaEndpointBuilder basicPropertyBinding(
                boolean basicPropertyBinding) {
            doSetProperty("basicPropertyBinding", basicPropertyBinding);
            return this;
        }
        /**
         * Whether the endpoint should use basic property binding (Camel 2.x) or
         * the newer property binding with additional capabilities.
         *
         * The option will be converted to a boolean type.
         *
         * Default: false
         * Group: advanced
         */
        default AdvancedBonitaEndpointBuilder basicPropertyBinding(
                String basicPropertyBinding) {
            doSetProperty("basicPropertyBinding", basicPropertyBinding);
            return this;
        }
        /**
         * Sets whether synchronous processing should be strictly used, or Camel
         * is allowed to use asynchronous processing (if supported).
         *
         * The option is a: boolean type.
         *
         * Default: false
         * Group: advanced
         */
        default AdvancedBonitaEndpointBuilder synchronous(boolean synchronous) {
            doSetProperty("synchronous", synchronous);
            return this;
        }
        /**
         * Sets whether synchronous processing should be strictly used, or Camel
         * is allowed to use asynchronous processing (if supported).
         *
         * The option will be converted to a boolean type.
         *
         * Default: false
         * Group: advanced
         */
        default AdvancedBonitaEndpointBuilder synchronous(String synchronous) {
            doSetProperty("synchronous", synchronous);
            return this;
        }
    }

    public interface BonitaBuilders {
        /**
         * Bonita (camel-bonita)
         * Used for communicating with a remote Bonita BPM process engine.
         *
         * Category: process
         * Since: 2.19
         * Maven coordinates: org.apache.camel:camel-bonita
         *
         * Syntax: bonita:operation
         *
         * Path parameter: operation (required)
         * Operation to use
         * The value can be one of: startCase
         */
        default BonitaEndpointBuilder bonita(String path) {
            return BonitaEndpointBuilderFactory.bonita(path);
        }
    }
    /**
     * Bonita (camel-bonita)
     * Used for communicating with a remote Bonita BPM process engine.
     *
     * Category: process
     * Since: 2.19
     * Maven coordinates: org.apache.camel:camel-bonita
     *
     * Syntax: bonita:operation
     *
     * Path parameter: operation (required)
     * Operation to use
     * The value can be one of: startCase
     */
    static BonitaEndpointBuilder bonita(String path) {
        class BonitaEndpointBuilderImpl extends AbstractEndpointBuilder implements BonitaEndpointBuilder, AdvancedBonitaEndpointBuilder {
            public BonitaEndpointBuilderImpl(String path) {
                super("bonita", path);
            }
        }
        return new BonitaEndpointBuilderImpl(path);
    }
}


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>

	<groupId>cz.znj.kvr.sw.exp.java.dynamodb</groupId>
	<artifactId>dynamodb-exp-base</artifactId>
	<packaging>pom</packaging>
	<version>0.0.1</version>
	<name>DynamoDb experiments base</name>
	<description>Parent of DynamoDb experiments</description>

	<!--
		Few notes about running:
		Please remember to pass -Dsqlite4java.library.path=${project.build.directory}/native-libs/
	-->

	<parent>
		<groupId>cz.znj.kvr.sw.exp.java</groupId>
		<artifactId>java-exp</artifactId>
		<version>0.0.1</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<properties>
		<dynamodb.version>1.11.76</dynamodb.version>
		<dynamodb-local.version>1.11.0.1</dynamodb-local.version>
		<sqlite4java.version>1.0.392</sqlite4java.version>
	</properties>

	<modules>
		<module>dynamodb-basic-exp</module>
	</modules>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>${maven-dependency-plugin.version}</version>
				<executions>
					<execution>
						<id>copy</id>
						<phase>initialize</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<includeScope>test</includeScope>
							<includeTypes>so,dll,dylib</includeTypes>
							<outputDirectory>${project.build.directory}/native-libs
							</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<argLine>-Dsqlite4java.library.path=${project.build.directory}/native-libs/</argLine>
				</configuration>
			</plugin>

		</plugins>
	</build>

	<dependencyManagement>
		<dependencies>

			<dependency>
				<groupId>com.amazonaws</groupId>
				<artifactId>aws-java-sdk-dynamodb</artifactId>
				<version>${dynamodb.version}</version>
			</dependency>
			<dependency>
				<groupId>com.amazonaws</groupId>
				<artifactId>DynamoDBLocal</artifactId>
				<version>${dynamodb-local.version}</version>
			</dependency>
			<dependency>
				<groupId>com.almworks.sqlite4java</groupId>
				<artifactId>sqlite4java</artifactId>
				<version>${sqlite4java.version}</version>
			</dependency>

			<dependency>
				<groupId>com.fasterxml.jackson.core</groupId>
				<artifactId>jackson-core</artifactId>
				<version>${jackson.version}</version>
			</dependency>
			<dependency>
				<groupId>com.fasterxml.jackson.core</groupId>
				<artifactId>jackson-databind</artifactId>
				<version>${jackson.version}</version>
			</dependency>

	</dependencies>
	</dependencyManagement>

	<repositories>
		<repository>
			<id>dynamodblocal</id>
			<name>AWS DynamoDB Local Release Repository</name>
			<url>http://dynamodb-local.s3-website-us-west-2.amazonaws.com/release</url>
		</repository>
	</repositories>

</project>


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>CKEditor Sample</title>

	<link rel="stylesheet" href="css/samples.css">
	<link rel="stylesheet" href="toolbarconfigurator/lib/codemirror/neo.css">

Hello world!

I'm an instance of CKEditor.


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Madroño 20(4):231, fig. 1. 1970

#### Original name
null

### Remarks
null


text:
layout: post
microblog: true
audio:
photo:
date: 2011-07-25 15:36:06 -0600
guid: http://craigmcclellan.micro.blog/2011/07/25/t95608288560951297.html
---
Video: Artist Panel Discussion The young adult ministry of my church hosted a panel of artists talking about... [tumblr.com/xiq3p8yzv...](http://tumblr.com/xiq3p8yzvn)