text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Sampling Worker — Delphin Automation 0.1 documentation</title>
    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Simulation Worker" href="simulation_worker.html" />
    <link rel="prev" title="RiBuild Backend" href="backend.html" />

  <link rel="stylesheet" href="_static/custom.css" type="text/css" />

  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

Sampling Worker¶

delphin_6_automation.backend.sampling_worker.main()[source]¶

Entrance to the sampling worker

delphin_6_automation.backend.sampling_worker.sampling_overview(strategy_id)[source]¶

Shows the progress in the sampling strategy

delphin_6_automation.backend.sampling_worker.sampling_worker(strategy_id: str) → None[source]¶

Main sampling worker, which creates new Delphin projects based on a sample strategy and checks for convergence,
when all Delphin simulations in a given iteration is done.
If convergence was not reached then it creates new Delphin projects.

Related Topics

Documentation overview

RiBuild Backend

Previous: RiBuild Backend

Next: Simulation Worker

Quick search

    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

      ©2018, Christian Kongsgaard, Thomas Perkov.

      |
      Powered by Sphinx 1.7.7
      & Alabaster 0.7.11

      |
      Page source


text:
FROM microsoft/windowsservercore

# Install Chocolatey (see https://chocolatey.org/install#install-with-cmdexe)
RUN powershell -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command \
    "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

# Install Sleeve prerequisites (see https://github.com/yaronyg/sleeveforarm)

# Use Chocolatey to install git, Node.js, MySQL and Azure CLI
RUN choco install -y \
    git \
    nodejs \
    mysql \
    azure-cli

# Use NPM to install Sleeve globally
RUN npm install sleeveforarm -g

redpajama_set_name: RedPajamaGithub


text:
using namespace std;

IssuanceMessage::IssuanceMessage(string data)
{
    _data = data;
}

UniValue IssuanceMessage::decode()
{
    int assetIDLen = (8*8);
    int quantityLen = (8*8);
    int divisibleLen = (1*8);
    int callableLen = (1*8);
    int callDateLen = (4*8);
    int callPriceLen = (4*8);

    int offset = 0;
    unsigned long assetID = stol(_data.substr(offset, assetIDLen), nullptr, 2);

    offset += assetIDLen;
    unsigned long quantity = stol(_data.substr(offset, quantityLen), nullptr, 2);

    offset += quantityLen;
    unsigned long divisible = stol(_data.substr(offset, divisibleLen), nullptr, 2);

    offset += divisibleLen;
    unsigned long callable = stol(_data.substr(offset, callableLen), nullptr, 2);

    offset += callableLen;
    unsigned long callDate = stol(_data.substr(offset, callDateLen), nullptr, 2);

    offset += callDateLen;
    unsigned long callPrice = stol(_data.substr(offset, callPriceLen), nullptr, 2);

    offset += callPriceLen;
    string description = utf8str(_data.substr(offset));

    string asset = assetName(assetID);

    UniValue decodedCpTx(UniValue::VOBJ);
    decodedCpTx.push_back(Pair("type", "issuance"));
    decodedCpTx.push_back(Pair("asset", asset));
    decodedCpTx.push_back(Pair("quantity", (int64_t)quantity));
    decodedCpTx.push_back(Pair("divisible", (int64_t)divisible));
    decodedCpTx.push_back(Pair("callable", (int64_t)callable));
    decodedCpTx.push_back(Pair("call_date", (int64_t)callDate));
    decodedCpTx.push_back(Pair("call_price", (int64_t)callPrice));
    decodedCpTx.push_back(Pair("description", description));

    return decodedCpTx;
}


text:
define([
        'doh/main',
        'Sds/Validator/Credential'
    ],
    function(
        doh,
        Credential
    ){
        doh.register("Sds/Test/Validator/TestCredential", [

            function ValidatorTest(doh){
                var validator = new Credential;

                var testArray = [
                    [true, 'password1'],
                    [true, 'password1@'],
                    [false, '1abcd'],
                    [false, '123456789'],
                    [false, 'password'],
                    [false, '123456789123456789123456789123456789password']
                ];

                var index;
                for (index in testArray){
                    if (testArray[index][0]){
                        doh.assertTrue(validator.isValid(testArray[index][1]).result);
                    } else {
                        doh.assertFalse(validator.isValid(testArray[index][1]).result);
                    }
                }
            },
        ]);
    }
);


text:
;(function(ng) {
  "use strict";

  ng.module('<%= app %>', [])
    .service('GreetingService', [function GreetingService() {
        this.sayHello = function() {
           return "hello there!";
        };
    }]);
}(window.angular));


text:
// Package
///////////////
package com.hp.hpl.jena.ontology.impl;

// Imports
///////////////
import com.hp.hpl.jena.ontology.*;
import com.hp.hpl.jena.enhanced.*;
import com.hp.hpl.jena.graph.*;
import com.hp.hpl.jena.graph.query.*;
import com.hp.hpl.jena.rdf.model.*;
import com.hp.hpl.jena.reasoner.*;
import com.hp.hpl.jena.util.iterator.*;
import com.hp.hpl.jena.vocabulary.*;

import java.util.*;

/**
 *

 * Implementation of the ontology abstraction representing ontology classes.
 *

 *
 * @author Ian Dickinson, HP Labs
 *         (email)
 * @version CVS $Id: OntClassImpl.java,v 1.3 2010-01-11 09:17:06 chris-dollin Exp $
 */
public class OntClassImpl
    extends OntResourceImpl
    implements OntClass
{
    // Constants
    //////////////////////////////////

    /* LDP never returns properties in these namespaces */
    private static final String[] IGNORE_NAMESPACES = new String[] {
            OWL.NS,
            DAMLVocabulary.NAMESPACE_DAML_2001_03_URI,
            RDF.getURI(),
            RDFS.getURI(),
            ReasonerVocabulary.RBNamespace
    };

    // Static variables
    //////////////////////////////////

    /**
     * A factory for generating OntClass facets from nodes in enhanced graphs.
     * Note: should not be invoked directly by user code: use
     * {@link com.hp.hpl.jena.rdf.model.RDFNode#as as()} instead.
     */
    @SuppressWarnings("hiding")
    public static Implementation factory = new Implementation() {
        @Override
        public EnhNode wrap( Node n, EnhGraph eg ) {
            if (canWrap( n, eg )) {
                return new OntClassImpl( n, eg );
            }
            else {
                throw new ConversionException( "Cannot convert node " + n.toString() + " to OntClass: it does not have rdf:type owl:Class or equivalent");
            }
        }

        @Override
        public boolean canWrap( Node node, EnhGraph eg ) {
            // node will support being an OntClass facet if it has rdf:type owl:Class or equivalent
            Profile profile = (eg instanceof OntModel) ? ((OntModel) eg).getProfile() : null;
            return (profile != null)  &&  profile.isSupported( node, eg, OntClass.class );
        }
    };

    // Instance variables
    //////////////////////////////////

    /** Query for properties with this class as domain */
    protected BindingQueryPlan m_domainQuery;

    /** Query for properties restricted by this class */
    protected BindingQueryPlan m_restrictionPropQuery = null;

    // Constructors
    //////////////////////////////////

    /**
     *

     * Construct an ontology class node represented by the given node in the given graph.
     *

     *
     * @param n The node that represents the resource
     * @param g The enh graph that contains n
     */
    public OntClassImpl( Node n, EnhGraph g ) {
        super( n, g );

        // pre-built queries
        // ?x a rdf:Property ; rdfs:domain this.
        Query q = new Query();
        q.addMatch( Query.X, getProfile().DOMAIN().asNode(), asNode() );

        m_domainQuery = getModel().queryHandler().prepareBindings( q, new Node[] {Query.X} );

        // this rdfs:subClassOf ?x. ?x owl:onProperty ?y.
        if (getProfile().ON_PROPERTY() != null) {
            q = new Query();
            q.addMatch( asNode(), getProfile().SUB_CLASS_OF().asNode(), Query.X );
            q.addMatch( Query.X, getProfile().ON_PROPERTY().asNode(), Query.Y );

            m_restrictionPropQuery = getModel().queryHandler().prepareBindings( q, new Node[] {Query.Y} );
        }
    }

    // External signature methods
    //////////////////////////////////

    // subClassOf

    /**
     *
Assert that this class is sub-class of the given class. Any existing
     * statements for subClassOf will be removed.

     * @param cls The class that this class is a sub-class of
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile.
     */
    @Override
    public void setSuperClass( Resource cls ) {
        setPropertyValue( getProfile().SUB_CLASS_OF(), "SUB_CLASS_OF", cls );
    }

    /**
     *
Add a super-class of this class.

     * @param cls A class that is a super-class of this class.
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile.
     */
    @Override
    public void addSuperClass( Resource cls ) {
        addPropertyValue( getProfile().SUB_CLASS_OF(), "SUB_CLASS_OF", cls );
    }

    /**
     *
Answer a class that is the super-class of this class. If there is
     * more than one such class, an arbitrary selection is made.

     * @return A super-class of this class
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile.
     */
    @Override
    public OntClass getSuperClass() {
        return objectAs( getProfile().SUB_CLASS_OF(), "SUB_CLASS_OF", OntClass.class );
    }

    /**
     *
Answer an iterator over all of the classes that are declared to be super-classes of
     * this class. Each element of the iterator will be an {@link OntClass}.

     * @return An iterator over the super-classes of this class.
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile.
     */
    @Override
    public ExtendedIterator<OntClass> listSuperClasses() {
        return listSuperClasses( false );
    }

    /**
     *
Answer an iterator over all of the classes that are declared to be super-classes of
     * this class. Each element of the iterator will be an {@link OntClass}.
     * See {@link #listSubClasses( boolean )} for a full explanation of the direct
     * parameter.
     *

     *
     * @param direct If true, only answer the direcly adjacent classes in the
     * super-class relation: i.e. eliminate any class for which there is a longer route
     * to reach that child under the super-class relation.
     * @return an iterator over the resources representing this class's sub-classes.
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile.
     */
    @Override
    public ExtendedIterator<OntClass> listSuperClasses( boolean direct ) {
        return UniqueExtendedIterator.create(
                listDirectPropertyValues( getProfile().SUB_CLASS_OF(), "SUB_CLASS_OF", OntClass.class, getProfile().SUB_CLASS_OF(), direct, false )
                .filterDrop( new SingleEqualityFilter<OntClass>( this ) ) );
    }

    /**
     *
Answer true if the given class is a super-class of this class.

     * @param cls A class to test.
     * @return True if the given class is a super-class of this class.
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile.
     */
    @Override
    public boolean hasSuperClass( Resource cls ) {
        return hasSuperClass( cls, false );
    }

    /**
     *
Answer true if this class has any super-class in the model. Note that
     * when using a reasoner, all OWL classes have owl:Thing as a super-class.

     * @return True if this class has any known super-class.
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile.
     */
    @Override
    public boolean hasSuperClass() {
        return getSuperClass() != null;
    }

    /**
     *
Answer true if the given class is a super-class of this class.
     * See {@link #listSubClasses( boolean )} for a full explanation of the direct
     * parameter.
     *

     * @param cls A class to test.
     * @param direct If true, only search the classes that are directly adjacent to this
     * class in the class hierarchy.
     * @return True if the given class is a super-class of this class.
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile.
     */
    @Override
    public boolean hasSuperClass( Resource cls, boolean direct ) {
        if (!direct) {
            // don't need any special case, we just get the property
            return hasPropertyValue( getProfile().SUB_CLASS_OF(), "SUB_CLASS_OF", cls );
        }
        else {
            // we want the direct, not general relationship
            // first try to find an inf graph that can do the work for us
            InfGraph ig = null;
            if (getGraph() instanceof InfGraph) {
                ig = (InfGraph) getGraph();
            }
            else if (getGraph() instanceof OntModel) {
                OntModel m = (OntModel) getGraph();
                if (m.getGraph() instanceof InfGraph) {
                    ig = (InfGraph) m.getGraph();
                }
            }

            if (ig != null && ig.getReasoner().supportsProperty( ReasonerVocabulary.directSubClassOf )) {
                // we can look this up directly
                return hasPropertyValue( ReasonerVocabulary.directSubClassOf, "direct sub-class", cls );
            }
            else {
                // otherwise, not an inf-graph or the given inf-graph does not support direct directly (:-)
                return hasSuperClassDirect(cls);
            }
        }
    }

    /**
     *
Remove the given class from the super-classes of this class.  If this statement
     * is not true of the current model, nothing happens.

     * @param cls A class to be removed from the super-classes of this class
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} class is not supported in the current language profile.
     */
    @Override
    public void removeSuperClass( Resource cls ) {
        removePropertyValue( getProfile().SUB_CLASS_OF(), "SUB_CLASS_OF", cls );
    }

    /**
     *
Assert that this class is super-class of the given class. Any existing
     * statements for subClassOf on prop will be removed.

     * @param cls The class that is a sub-class of this class
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile.
     */
    @Override
    public void setSubClass( Resource cls ) {
        // first we have to remove all of the inverse sub-class links
        checkProfile( getProfile().SUB_CLASS_OF(), "SUB_CLASS_OF" );
        for (StmtIterator i = getModel().listStatements( null, getProfile().SUB_CLASS_OF(), this );  i.hasNext(); ) {
            i.removeNext();
        }

        cls.as( OntClass.class ).addSuperClass( this );
    }

    /**
     *
Add a sub-class of this class.

     * @param cls A class that is a sub-class of this class.
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile.
     */
    @Override
    public void addSubClass( Resource cls ) {
        cls.as( OntClass.class ).addSuperClass( this );
    }

    /**
     *
Answer a class that is the sub-class of this class. If there is
     * more than one such class, an arbitrary selection is made. If
     * there is no such class, return null.

     * @return A sub-class of this class or null
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()}
     * property is not supported in the current language profile.
     */
    @Override
    public OntClass getSubClass() {
        checkProfile( getProfile().SUB_CLASS_OF(), "SUB_CLASS_OF" );
        StmtIterator i = getModel().listStatements( null, getProfile().SUB_CLASS_OF(), this );
        try {
            if (i.hasNext()) {
                return i.nextStatement()
                                   .getSubject()
                                   .as( OntClass.class );
            }
            else {
                return null;
            }
        }
        finally {
            i.close();
        }
    }

    /**
     *
Answer an iterator over all of the classes that are declared to be sub-classes of
     * this class. Each element of the iterator will be an {@link OntClass}.

     * @return An iterator over the sub-classes of this class.
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile.
     */
    @Override
    public ExtendedIterator<OntClass> listSubClasses() {
        return listSubClasses( false );
    }

    /**
     *

     * Answer an iterator over the classes that are declared to be sub-classes of
     * this class. Each element of the iterator will be an {@link OntClass}. The
     * distinguishing extra parameter for this method is the flag direct
     * that allows some selectivity over the classes that appear in the iterator.
     * Consider the following scenario:
     *

     *   :B rdfs:subClassOf :A.
     *   :C rdfs:subClassOf :A.
     *   :D rdfs:subClassof :C.
     *

     * (so A has two sub-classes, B and C, and C has sub-class D).  In a raw model, with
     * no inference support, listing the sub-classes of A will answer B and C.  In an
     * inferencing model, rdfs:subClassOf is known to be transitive, so
     * the sub-classes iterator will include D.  The direct sub-classes
     * are those members of the closure of the subClassOf relation, restricted to classes that
     * cannot be reached by a longer route, i.e. the ones that are directly adjacent
     * to the given root.  Thus, the direct sub-classes of A are B and C only, and not D -
     * even in an inferencing graph.  Note that this is not the same as the entailments
     * from the raw graph. Suppose we add to this example:
     *

     *   :D rdfs:subClassof :A.
     *

     * Now, in the raw graph, A has sub-class C.  But the direct sub-classes of A remain
     * B and C, since there is a longer path A-C-D that means that D is not a direct sub-class
     * of A.  The assertion in the raw graph that A has sub-class D is essentially redundant,
     * since this can be inferred from the closure of the graph.
     *

     *

     * Note: This is is a change from the behaviour of Jena 1, which took a
     * parameter closed to compute the closure over transitivity and equivalence
     * of sub-classes.  The closure capability in Jena2 is determined by the inference engine
     * that is wrapped with the ontology model.  The direct parameter is provided to allow,
     * for exmaple, a level-by-level traversal of the class hierarchy, starting at some given
     * root.
     *

     *
     * @param direct If true, only answer the direcly adjacent classes in the
     * sub-class relation: i.e. eliminate any class for which there is a longer route
     * to reach that child under the sub-class relation.
     * @return an iterator over the resources representing this class's sub-classes
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile.
     */
    @Override
    public ExtendedIterator<OntClass> listSubClasses( boolean direct ) {
        return UniqueExtendedIterator.create(
                listDirectPropertyValues( getProfile().SUB_CLASS_OF(), "SUB_CLASS_OF", OntClass.class, getProfile().SUB_CLASS_OF(), direct, true )
                .filterDrop( new SingleEqualityFilter<OntClass>( this ) ) );
    }

    /**
     *
Answer true if the given class is a sub-class of this class.

     * @param cls A class to test.
     * @return True if the given class is a sub-class of this class.
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile.
     */
    @Override
    public boolean hasSubClass( Resource cls ) {
        return hasSubClass( cls, false );
    }

    /**
     *
Answer true if this class has any sub-class in the model. Note that
     * when using a reasoner, all OWL classes have owl:Nothing as a sub-class.

     * @return True if this class has any known sub-class.
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile.
     */
    @Override
    public boolean hasSubClass() {
        return getSubClass() != null;
    }

    /**
     *
Answer true if the given class is a sub-class of this class.
     * See {@link #listSubClasses( boolean )} for a full explanation of the direct
     * parameter.
     *

     * @param cls A class to test.
     * @param direct If true, only search the classes that are directly adjacent to this
     * class in the class hierarchy.
     * @return True if the given class is a sub-class of this class.
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} property is not supported in the current language profile.
     */
    @Override
    public boolean hasSubClass( Resource cls, boolean direct ) {
        if (getModel() instanceof OntModel &&
            (cls.getModel() == null || !(cls.getModel() instanceof OntModel)))
        {
            // could be outside an ontmodel if a constant
            cls = cls.inModel( getModel() );
        }
        return cls.as( OntClass.class ).hasSuperClass( this, direct );
    }

    /**
     *
Remove the given class from the sub-classes of this class.  If this statement
     * is not true of the current model, nothing happens.

     * @param cls A class to be removed from the sub-classes of this class
     * @exception OntProfileException If the {@link Profile#SUB_CLASS_OF()} class is not supported in the current language profile.
     */
    @Override
    public void removeSubClass( Resource cls ) {
        (cls.as( OntClass.class)).removeSuperClass( this );
    }

    // equivalentClass

    /**
     *
Assert that the given class is equivalent to this class. Any existing
     * statements for equivalentClass will be removed.

     * @param cls The class that this class is a equivalent to.
     * @exception OntProfileException If the {@link Profile#EQUIVALENT_CLASS()} property is not supported in the current language profile.
     */
    @Override
    public void setEquivalentClass( Resource cls ) {
        setPropertyValue( getProfile().EQUIVALENT_CLASS(), "EQUIVALENT_CLASS", cls );
    }

    /**
     *
Add a class that is equivalent to this class.

     * @param cls A class that is equivalent to this class.
     * @exception OntProfileException If the {@link Profile#EQUIVALENT_CLASS()} property is not supported in the current language profile.
     */
    @Override
    public void addEquivalentClass( Resource cls ) {
        addPropertyValue( getProfile().EQUIVALENT_CLASS(), "EQUIVALENT_CLASS", cls );
    }

    /**
     *
Answer a class that is equivalent to this class. If there is
     * more than one such class, an arbitrary selection is made.

     * @return A class equivalent to this class
     * @exception OntProfileException If the {@link Profile#EQUIVALENT_CLASS()} property is not supported in the current language profile.
     */
    @Override
    public OntClass getEquivalentClass() {
        return objectAs( getProfile().EQUIVALENT_CLASS(), "EQUIVALENT_CLASS", OntClass.class );
    }

    /**
     *
Answer an iterator over all of the classes that are declared to be equivalent classes to
     * this class. Each element of the iterator will be an {@link OntClass}.

     * @return An iterator over the classes equivalent to this class.
     * @exception OntProfileException If the {@link Profile#EQUIVALENT_CLASS()} property is not supported in the current language profile.
     */
    @Override
    public ExtendedIterator<OntClass> listEquivalentClasses() {
        return UniqueExtendedIterator.create( listAs( getProfile().EQUIVALENT_CLASS(), "EQUIVALENT_CLASS", OntClass.class ) );
    }

    /**
     *
Answer true if the given class is equivalent to this class.

     * @param cls A class to test for
     * @return True if the given property is equivalent to this class.
     * @exception OntProfileException If the {@link Profile#EQUIVALENT_CLASS()} property is not supported in the current language profile.
     */
    @Override
    public boolean hasEquivalentClass( Resource cls ) {
        return hasPropertyValue( getProfile().EQUIVALENT_CLASS(), "EQUIVALENT_CLASS", cls );
    }

    /**
     *
Remove the statement that this class and the given class are
     * equivalent.  If this statement
     * is not true of the current model, nothing happens.

     * @param cls A class that may be declared to be equivalent to this class, and which is no longer equivalent
     * @exception OntProfileException If the {@link Profile#EQUIVALENT_CLASS()()} property is not supported in the current language profile.
     */
    @Override
    public void removeEquivalentClass( Resource cls ) {
        removePropertyValue( getProfile().EQUIVALENT_CLASS(), "EQUIVALENT_CLASS", cls );
    }

    // disjointWith

    /**
     *
Assert that this class is disjoint with the given class. Any existing
     * statements for disjointWith will be removed.

     * @param cls The property that this class is disjoint with.
     * @exception OntProfileException If the {@link Profile#DISJOINT_WITH()} property is not supported in the current language profile.
     */
    @Override
    public void setDisjointWith( Resource cls ) {
        setPropertyValue( getProfile().DISJOINT_WITH(), "DISJOINT_WITH", cls );
    }

    /**
     *
Add a class that this class is disjoint with.

     * @param cls A class that has no instances in common with this class.
     * @exception OntProfileException If the {@link Profile#DISJOINT_WITH()} property is not supported in the current language profile.
     */
    @Override
    public void addDisjointWith( Resource cls ) {
        addPropertyValue( getProfile().DISJOINT_WITH(), "DISJOINT_WITH", cls );
    }

    /**
     *
Answer a class with which this class is disjoint. If there is
     * more than one such class, an arbitrary selection is made.

     * @return A class disjoint with this class
     * @exception OntProfileException If the {@link Profile#DISJOINT_WITH()} property is not supported in the current language profile.
     */
    @Override
    public OntClass getDisjointWith() {
        return objectAs( getProfile().DISJOINT_WITH(), "DISJOINT_WITH", OntClass.class );
    }

    /**
     *
Answer an iterator over all of the classes that this class is declared to be disjoint with.
     * Each element of the iterator will be an {@link OntClass}.

     * @return An iterator over the classes disjoint with this class.
     * @exception OntProfileException If the {@link Profile#DISJOINT_WITH()} property is not supported in the current language profile.
     */
    @Override
    public ExtendedIterator<OntClass> listDisjointWith() {
        return UniqueExtendedIterator.create( listAs( getProfile().DISJOINT_WITH(), "DISJOINT_WITH", OntClass.class ) );
    }

    /**
     *
Answer true if this class is disjoint with the given class.

     * @param cls A class to test
     * @return True if the this class is disjoint with the the given class.
     * @exception OntProfileException If the {@link Profile#DISJOINT_WITH()} property is not supported in the current language profile.
     */
    @Override
    public boolean isDisjointWith( Resource cls ) {
        return hasPropertyValue( getProfile().DISJOINT_WITH(), "DISJOINT_WITH", cls );
    }

    /**
     *
Remove the statement that this class and the given class are
     * disjoint.  If this statement
     * is not true of the current model, nothing happens.

     * @param cls A class that may be declared to be disjoint with this class, and which is no longer disjoint
     * @exception OntProfileException If the {@link Profile#DISJOINT_WITH()()()} property is not supported in the current language profile.
     */
    @Override
    public void removeDisjointWith( Resource cls ) {
        removePropertyValue( getProfile().DISJOINT_WITH(), "DISJOINT_WITH", cls );
    }

    // other utility methods

    /**
     *
Answer an iteration of the properties associated with a frame-like
     * view of this class. Note that many cases of determining whether a
     * property is associated with a class depends on RDFS or OWL reasoning.
     * This method may therefore return complete results only in models that
     * have an attached reasoner.
     * See the
     * RDF frames how-to
     * for full details.

     * @return An iteration of the properties that are associated with this class
     * by their domain.
     */
    @Override
    public ExtendedIterator<OntProperty> listDeclaredProperties() {
        return listDeclaredProperties( false );
    }

    /**
     *
Answer an iteration of the properties associated with a frame-like
     * view of this class. Note that many cases of determining whether a
     * property is associated with a class depends on RDFS or OWL reasoning.
     * This method may therefore return complete results only in models that
     * have an attached reasoner. See the
     * RDF frames how-to
     * for full details.

     * @param direct If true, restrict the properties returned to those directly
     * associated with this class.
     * @return An iteration of the properties that are associated with this class
     * by their domain.
     */
    @Override
    public ExtendedIterator<OntProperty> listDeclaredProperties( boolean direct ) {
        // first collect the candidate properties
        Set<RDFNode> candSet = new HashSet<RDFNode>();

        // if the attached model does inference, it will potentially find more of these
        // than a non-inference model
        for (Iterator<Statement> i = listAllProperties(); i.hasNext(); ) {
            candSet.add( i.next().getSubject().as( Property.class ) );
        }

        // now we iterate over the candidates and check that they match all domain constraints
        List<RDFNode> cands = new ArrayList<RDFNode>();
        cands.addAll( candSet );
        for (int j = cands.size() -1; j >= 0; j--) {
            Property cand = (Property) cands.get( j );
            if (!hasDeclaredProperty( cand, direct )) {
                cands.remove( j );
            }
        }

        // return the results, using the ont property facet
        return WrappedIterator.create( cands.iterator() )
                              .mapWith( new AsMapper<OntProperty>( OntProperty.class ) );
    }

    /**
     *
Answer true if the given property is one of the declared properties
     * of this class. For details, see {@link #listDeclaredProperties(boolean)}.

     * @param p A property to test
     * @param direct If true, only direct associations between classes and properties
     * are considered
     * @return True if p is one of the declared properties of
     * this class
     */
    @Override
    public boolean hasDeclaredProperty( Property p, boolean direct ) {
        return testDomain( p, direct );
    }

    /**
     *
Answer an iterator over the individuals in the model that have this
     * class among their types.

     *
     * @return An iterator over those instances that have this class as one of
     *         the classes to which they belong
     */
    @Override
    public ExtendedIterator<Individual> listInstances() {
        return listInstances( false );
    }

    /**
     *
Answer an iterator over the individuals in the model that have this
     * class among their types, optionally excluding sub-classes of this class.

     *
     * @param  direct If true, only direct instances are counted (i.e. not instances
     * of sub-classes of this class)
     * @return An iterator over those instances that have this class as one of
     *         the classes to which they belong
     */
    @Override
    public ExtendedIterator<Individual> listInstances( final boolean direct ) {
        return UniqueExtendedIterator.create(
                getModel()
                .listStatements( null, RDF.type, this )
                .mapWith( new SubjectAsMapper<Individual>( Individual.class ) )
                .filterKeep( new Filter<Individual>() {
                    @Override
                    public boolean accept( Individual o ) {
                        // if direct, ignore the sub-class typed resources
                        return o.hasRDFType( OntClassImpl.this, direct );
                    }} )
        );
    }

    /**
     *
Answer a new individual that has this class as its rdf:type

     * @return A new anonymous individual that is an instance of this class
     */
    @Override
    public Individual createIndividual() {
        return ((OntModel) getModel()).createIndividual( this );
    }

    /**
     *
Answer a new individual that has this class as its rdf:type

     * @param uri The URI of the new individual
     * @return A new named individual that is an instance of this class
     */
    @Override
    public Individual createIndividual( String uri ) {
        return ((OntModel) getModel()).createIndividual( uri, this );
    }

    /**
     *
Remove the given individual from the set of instances that are members of
     * this class. This is effectively equivalent to the {@link Individual#removeOntClass} method,
     * but invoked via the class resource rather than via the individual resource.

     * @param individual A resource denoting an individual that is no longer to be a member
     * of this class
     */
    @Override
    public void dropIndividual( Resource individual ) {
        getModel().remove( individual, RDF.type, this );
    }

    /**
     *
Answer true if this class is one of the roots of the class hierarchy.
     * This will be true if either (i) this class has owl:Thing
     * (or daml:Thing) as a direct super-class, or (ii) it has
     * no declared super-classes (including anonymous class expressions).

     * @return True if this class is the root of the class hierarchy in the
     * model it is attached to
     */
    @Override
    public boolean isHierarchyRoot() {
        // sanity check - :Nothing is never a root class
        if (equals( getProfile().NOTHING() )) {
            return false;
        }

        // the only super-classes of a root class are the various aliases
        // of Top, or itself

        /**
            Note: moved the initialisation of i outside the try-catch, otherwise an
            exception in listSuperClasses [eg a broken Graph implementation] will
            avoid i's initialisation but still run i.close, generating a mysterious
            NullPointerException. Signed, Mr Burnt Spines.
         */
        ExtendedIterator<OntClass> i = listSuperClasses( true );
        try {

            while (i.hasNext()) {
                Resource sup = i.next();
                if (!(sup.equals( getProfile().THING() ) ||
                      sup.equals( RDFS.Resource ) ||
                      sup.equals( this )))
                {
                    // a super that indicates this is not a root class
                    return false;
                }
            }
        }
        finally {
            i.close();
        }

        return true;
    }

    // access to facets
    /**
     *
Answer a view of this class as an enumerated class

     * @return This class, but viewed as an EnumeratedClass node
     * @exception ConversionException if the class cannot be converted to an enumerated class
     * given the lanuage profile and the current state of the underlying model.
     */
    @Override
    public EnumeratedClass asEnumeratedClass() {
        return as( EnumeratedClass.class );
    }

    /**
     *
Answer a view of this class as a union class

     * @return This class, but viewed as a UnionClass node
     * @exception ConversionException if the class cannot be converted to a union class
     * given the lanuage profile and the current state of the underlying model.
     */
    @Override
    public UnionClass asUnionClass()  {
        return as( UnionClass.class );
    }

    /**
     *
Answer a view of this class as an intersection class

     * @return This class, but viewed as an IntersectionClass node
     * @exception ConversionException if the class cannot be converted to an intersection class
     * given the lanuage profile and the current state of the underlying model.
     */
    @Override
    public IntersectionClass asIntersectionClass()  {
        return as( IntersectionClass.class );
    }

    /**
     *
Answer a view of this class as a complement class

     * @return This class, but viewed as a ComplementClass node
     * @exception ConversionException if the class cannot be converted to a complement class
     * given the lanuage profile and the current state of the underlying model.
     */
    @Override
    public ComplementClass asComplementClass() {
        return as( ComplementClass.class );
    }

    /**
     *
Answer a view of this class as a restriction class expression

     * @return This class, but viewed as a Restriction node
     * @exception ConversionException if the class cannot be converted to a restriction
     * given the lanuage profile and the current state of the underlying model.
     */
    @Override
    public Restriction asRestriction() {
        return as( Restriction.class );
    }

    // sub-type testing

    /**
     *
Answer true if this class is an enumerated class expression

     * @return True if this is an enumerated class expression
     */
    @Override
    public boolean isEnumeratedClass() {
        checkProfile( getProfile().ONE_OF(), "ONE_OF" );
        return hasProperty( getProfile().ONE_OF() );
    }

    /**
     *
Answer true if this class is a union class expression

     * @return True if this is a union class expression
     */
    @Override
    public boolean isUnionClass() {
        checkProfile( getProfile().UNION_OF(), "UNION_OF" );
        return hasProperty( getProfile().UNION_OF() );
    }

    /**
     *
Answer true if this class is an intersection class expression

     * @return True if this is an intersection class expression
     */
    @Override
    public boolean isIntersectionClass() {
        checkProfile( getProfile().INTERSECTION_OF(), "INTERSECTION_OF" );
        return hasProperty( getProfile().INTERSECTION_OF() );
    }

    /**
     *
Answer true if this class is a complement class expression

     * @return True if this is a complement class expression
     */
    @Override
    public boolean isComplementClass() {
        checkProfile( getProfile().COMPLEMENT_OF(), "COMPLEMENT_OF" );
        return hasProperty( getProfile().COMPLEMENT_OF() );
    }

    /**
     *
Answer true if this class is a property restriction

     * @return True if this is a restriction
     */
    @Override
    public boolean isRestriction() {
        checkProfile( getProfile().RESTRICTION(), "RESTRICTION" );
        return hasProperty( getProfile().ON_PROPERTY() ) ||
               hasProperty( RDF.type, getProfile().RESTRICTION() );
    }

    // conversion operations

    /**
     *
Answer a view of this class as an enumeration of the given individuals.

     * @param individuals A list of the individuals that will comprise the permitted values of this
     * class converted to an enumeration
     * @return This ontology class, converted to an enumeration of the given individuals
     */
    @Override
    public EnumeratedClass convertToEnumeratedClass( RDFList individuals ) {
        setPropertyValue( getProfile().ONE_OF(), "ONE_OF", individuals );
        return as( EnumeratedClass.class );
    }

    /**
     *
Answer a view of this class as an intersection of the given classes.

     * @param classes A list of the classes that will comprise the operands of the intersection
     * @return This ontology class, converted to an intersection of the given classes
     */
    @Override
    public IntersectionClass convertToIntersectionClass( RDFList classes ) {
        setPropertyValue( getProfile().INTERSECTION_OF(), "INTERSECTION_OF", classes );
        return as( IntersectionClass.class );
    }

    /**
     *
Answer a view of this class as a union of the given classes.

     * @param classes A list of the classes that will comprise the operands of the union
     * @return This ontology class, converted to an union of the given classes
     */
    @Override
    public UnionClass convertToUnionClass( RDFList classes ) {
        setPropertyValue( getProfile().UNION_OF(), "UNION_OF", classes );
        return as( UnionClass.class );
    }

    /**
     *
Answer a view of this class as an complement of the given class.

     * @param cls An ontology classs that will be operand of the complement
     * @return This ontology class, converted to an complement of the given class
     */
    @Override
    public ComplementClass convertToComplementClass( Resource cls ) {
        setPropertyValue( getProfile().COMPLEMENT_OF(), "COMPLEMENT_OF", cls );
        return as( ComplementClass.class );
    }

    /**
     *
Answer a view of this class as an resriction on the given property.

     * @param prop A property this is the subject of a property restriction class expression
     * @return This ontology class, converted to a restriction on the given property
     */
    @Override
    public Restriction convertToRestriction( Property prop ) {
        if (!hasRDFType( getProfile().RESTRICTION(), "RESTRICTION", false )) {
            setRDFType( getProfile().RESTRICTION() );
        }
        setPropertyValue( getProfile().ON_PROPERTY(), "ON_PROPERTY", prop );
        return as( Restriction.class );
    }

    // Internal implementation methods
    //////////////////////////////////

    /**
     *
Answer true if this class has the given class as a direct super-class, without using
     * extra help from the reasoner.

     * @param cls The class to test
     * @return True if the cls is a direct super-class of this class
     */
    protected boolean hasSuperClassDirect(Resource cls) {
        // we manually compute the maximal lower elements - this could be expensive in general
        //return ResourceUtils.maximalLowerElements( listSuperClasses(), getProfile().SUB_CLASS_OF(), false ).contains( cls );

        ExtendedIterator<OntClass> i = listDirectPropertyValues( getProfile().SUB_CLASS_OF(), "subClassOf", OntClass.class,
                                                       getProfile().SUB_CLASS_OF(), true, false );
        try {
            while (i.hasNext()) {
                if (cls.equals( i.next() )) {
                    return true;
                }
            }
        }
        finally {
            i.close();
        }

        return false;
    }

    /**
     *
Answer true if this class lies with the domain of p

     * @param p
     * @param direct If true, only consider direct associations with domain
     * @return True if this class in the domain of property p
     */
    protected boolean testDomain( Property p, boolean direct ) {
        // we ignore any property in the DAML, OWL, etc namespace
        String namespace = p.getNameSpace();
        for (int i = 0; i < IGNORE_NAMESPACES.length; i++) {
            if (namespace.equals( IGNORE_NAMESPACES[i] )) {
                return false;
            }
        }

        // check for global props, that have no specific domain constraint
        boolean isGlobal = true;

        // flag for detecting the direct case
        boolean seenDirect = false;

        for (StmtIterator i = getModel().listStatements( p, getProfile().DOMAIN(), (RDFNode) null ); i.hasNext();  ) {
            Resource domain = i.nextStatement().getResource();

            // there are some well-known values we ignore
            if (!(domain.equals( getProfile().THING() ) || domain.equals( RDFS.Resource ))) {
                // not a generic domain
                isGlobal = false;

                if (domain.equals( this )) {
                    // if this class is actually in the domain (as opposed to one of this class's
                    // super-classes), then we've detected the direct property case
                    seenDirect = true;
                }
                else if (!canProveSuperClass( domain )) {
                    // there is a class in the domain of p that is not a super-class of this class
                    return false;
                }
            }
        }

        if (direct) {
            // if we're looking for direct props, we must either have seen the direct case
            // or it's a global prop and this is a root class
            return seenDirect || (isGlobal && isHierarchyRoot());
        }
        else {
            // not direct, we must either found a global or a super-class prop
            // otherwise the 'return false' above would have kicked in
            return true;
        }
    }

    /**
     *
Answer an iterator over all of the properties in this model
     * @return An iterator over {@link OntProperty}
     */
    protected ExtendedIterator<Statement> listAllProperties() {
        OntModel mOnt = (OntModel) getModel();
        Profile prof = mOnt.getProfile();

        ExtendedIterator<Statement> pi = mOnt.listStatements( null, RDF.type, getProfile().PROPERTY() );

        // check reasoner capabilities - major performance improvement for inf models
        if (mOnt.getReasoner() != null) {
            Model caps = mOnt.getReasoner().getReasonerCapabilities();
            if (caps.contains( null, ReasonerVocabulary.supportsP, OWL.ObjectProperty) ||
                caps.contains( null, ReasonerVocabulary.supportsP, DAML_OIL.ObjectProperty))
            {
                // we conclude that the reasoner can do the necessary work to infer that
                // all owl:ObjectProperty, owl:DatatypeProperty, etc, are rdf:Property resources
                return pi;
            }
        }

        // otherwise, we manually check the other property types
        if (prof.OBJECT_PROPERTY() != null) {
            pi = pi.andThen( mOnt.listStatements( null, RDF.type, prof.OBJECT_PROPERTY() ) );
        }
        if (prof.DATATYPE_PROPERTY() != null) {
            pi = pi.andThen( mOnt.listStatements( null, RDF.type, prof.DATATYPE_PROPERTY() ) );
        }
        if (prof.FUNCTIONAL_PROPERTY() != null) {
            pi = pi.andThen( mOnt.listStatements( null, RDF.type, prof.FUNCTIONAL_PROPERTY() ) );
        }
        if (prof.INVERSE_FUNCTIONAL_PROPERTY() != null) {
            pi = pi.andThen( mOnt.listStatements( null, RDF.type, prof.INVERSE_FUNCTIONAL_PROPERTY() ) );
        }
        if (prof.SYMMETRIC_PROPERTY() != null) {
            pi = pi.andThen( mOnt.listStatements( null, RDF.type, prof.SYMMETRIC_PROPERTY() ) );
        }
        if (prof.TRANSITIVE_PROPERTY() != null) {
            pi = pi.andThen( mOnt.listStatements( null, RDF.type, prof.TRANSITIVE_PROPERTY() ) );
        }
        if (prof.ANNOTATION_PROPERTY() != null) {
            pi = pi.andThen( mOnt.listStatements( null, RDF.type, prof.ANNOTATION_PROPERTY() ) );
        }

        return pi;
    }

    /**
     *
Answer true if we can demonstrate that this class has the given super-class.
     * If this model has a reasoner, this is equivalent to asking if the sub-class
     * relation holds. Otherwise, we simulate basic reasoning by searching upwards
     * through the class hierarchy.

     * @param sup A super-class to test for
     * @return True if we can show that sup is a super-class of thsi class
     */
    protected boolean canProveSuperClass( Resource sup ) {
        OntModel om = (OntModel) getModel();
        if (om.getReasoner() != null) {
            if (om.getReasoner()
                  .getReasonerCapabilities().contains( null, ReasonerVocabulary.supportsP, RDFS.subClassOf ))
            {
                // this reasoner does transitive closure on sub-classes, so we just ask
                return hasSuperClass( sup );
            }
        }

        // otherwise, we have to search upwards through the class hierarchy
        Set<OntClass> seen = new HashSet<OntClass>();
        List<OntClass> queue = new ArrayList<OntClass>();
        queue.add( this );

        while (!queue.isEmpty()) {
            OntClass c = queue.remove( 0 );
            if (!seen.contains( c )) {
                seen.add( c );

                if (c.equals( sup )) {
                    // found the super class
                    return true;
                }
                else {
                    // queue the supers
                    for (Iterator<OntClass> i = c.listSuperClasses(); i.hasNext(); ) {
                        queue.add( i.next() );
                    }
                }
            }
        }

        // to get here, we didn't find the class we were looking for
        return false;
    }

    //==============================================================================
    // Inner class definitions
    //==============================================================================

}


text:
<?php

namespace Denismitr\Permissions\Traits;

use Denismitr\Permissions\Exceptions\PermissionDoesNotExist;
use Denismitr\Permissions\Models\Permission;
use Denismitr\Permissions\Loader;

trait HasPermissions
{
    /**
     * @param array ...$permissions
     * @return $this
     */
    public function givePermissionTo(...$permissions)
    {
        $permissions = collect($permissions)
            ->flatten()
            ->map(function ($permission) {
                return $this->getPermission($permission);
            })->all();

        $this->permissions()->saveMany($permissions);

        app(Loader::class)->forgetCachedPermissions();

        $this->load('permissions');

        return $this;
    }

    /**
     * @param $permission
     * @return $this
     * @throws PermissionDoesNotExist
     */
    public function revokePermissionTo($permission)
    {
        $this->permissions()->detach($this->getPermission($permission));

        app(Loader::class)->forgetCachedPermissions();

        $this->load('permissions');

        return $this;
    }

    /**
     * @param array ...$permissions
     * @return $this
     */
    public function allowTo(...$permissions)
    {
        return $this->givePermissionTo(...$permissions);
    }

    /**
     * @param array ...$permissions
     * @return $this
     */
    public function grantPermissionTo(...$permissions)
    {
        return $this->givePermissionTo(...$permissions);
    }

    /**
     * @param $permission
     * @return Permission
     * @throws PermissionDoesNotExist
     */
    protected function getPermission($permission): Permission
    {
        if (is_numeric($permission)) {
            return Permission::findById($permission);
        }

        if (is_string($permission)) {
            return app(Permission::class)->findByName($permission);
        }

        if ($permission instanceof Permission) {
            return $permission;
        }

        throw new PermissionDoesNotExist("Permission {$permission} is invalid or does not exist.");
    }
}


text:
// NOTE - eventually this file will be automatically updated using a Perl script that understand
// the naming of test case files, functions, and namespaces.

#ifndef _TESTCASES_H
#define _TESTCASES_H

#ifdef __cplusplus
extern "C" {
#endif

// declare C good and bad functions
#ifndef OMITGOOD
	/* BEGIN-AUTOGENERATED-C-GOOD-FUNCTION-DECLARATIONS */
	void CWE510_Trapdoor__hostname_based_logic_01_good();

	void CWE510_Trapdoor__hostname_based_logic_02_good();

	void CWE510_Trapdoor__hostname_based_logic_03_good();

	void CWE510_Trapdoor__hostname_based_logic_04_good();

	void CWE510_Trapdoor__hostname_based_logic_05_good();

	void CWE510_Trapdoor__hostname_based_logic_06_good();

	void CWE510_Trapdoor__hostname_based_logic_07_good();

	void CWE510_Trapdoor__hostname_based_logic_08_good();

	void CWE510_Trapdoor__hostname_based_logic_09_good();

	void CWE510_Trapdoor__hostname_based_logic_10_good();

	void CWE510_Trapdoor__hostname_based_logic_11_good();

	void CWE510_Trapdoor__hostname_based_logic_12_good();

	void CWE510_Trapdoor__hostname_based_logic_13_good();

	void CWE510_Trapdoor__hostname_based_logic_14_good();

	void CWE510_Trapdoor__hostname_based_logic_15_good();

	void CWE510_Trapdoor__hostname_based_logic_16_good();

	void CWE510_Trapdoor__hostname_based_logic_17_good();

	void CWE510_Trapdoor__hostname_based_logic_18_good();

	void CWE510_Trapdoor__ip_based_logic_01_good();

	void CWE510_Trapdoor__ip_based_logic_02_good();

	void CWE510_Trapdoor__ip_based_logic_03_good();

	void CWE510_Trapdoor__ip_based_logic_04_good();

	void CWE510_Trapdoor__ip_based_logic_05_good();

	void CWE510_Trapdoor__ip_based_logic_06_good();

	void CWE510_Trapdoor__ip_based_logic_07_good();

	void CWE510_Trapdoor__ip_based_logic_08_good();

	void CWE510_Trapdoor__ip_based_logic_09_good();

	void CWE510_Trapdoor__ip_based_logic_10_good();

	void CWE510_Trapdoor__ip_based_logic_11_good();

	void CWE510_Trapdoor__ip_based_logic_12_good();

	void CWE510_Trapdoor__ip_based_logic_13_good();

	void CWE510_Trapdoor__ip_based_logic_14_good();

	void CWE510_Trapdoor__ip_based_logic_15_good();

	void CWE510_Trapdoor__ip_based_logic_16_good();

	void CWE510_Trapdoor__ip_based_logic_17_good();

	void CWE510_Trapdoor__ip_based_logic_18_good();

	/* END-AUTOGENERATED-C-GOOD-FUNCTION-DECLARATIONS */
#endif // OMITGOOD

#ifndef OMITBAD
	/* BEGIN-AUTOGENERATED-C-BAD-FUNCTION-DECLARATIONS */
	void CWE510_Trapdoor__hostname_based_logic_01_bad();

	void CWE510_Trapdoor__hostname_based_logic_02_bad();

	void CWE510_Trapdoor__hostname_based_logic_03_bad();

	void CWE510_Trapdoor__hostname_based_logic_04_bad();

	void CWE510_Trapdoor__hostname_based_logic_05_bad();

	void CWE510_Trapdoor__hostname_based_logic_06_bad();

	void CWE510_Trapdoor__hostname_based_logic_07_bad();

	void CWE510_Trapdoor__hostname_based_logic_08_bad();

	void CWE510_Trapdoor__hostname_based_logic_09_bad();

	void CWE510_Trapdoor__hostname_based_logic_10_bad();

	void CWE510_Trapdoor__hostname_based_logic_11_bad();

	void CWE510_Trapdoor__hostname_based_logic_12_bad();

	void CWE510_Trapdoor__hostname_based_logic_13_bad();

	void CWE510_Trapdoor__hostname_based_logic_14_bad();

	void CWE510_Trapdoor__hostname_based_logic_15_bad();

	void CWE510_Trapdoor__hostname_based_logic_16_bad();

	void CWE510_Trapdoor__hostname_based_logic_17_bad();

	void CWE510_Trapdoor__hostname_based_logic_18_bad();

	void CWE510_Trapdoor__ip_based_logic_01_bad();

	void CWE510_Trapdoor__ip_based_logic_02_bad();

	void CWE510_Trapdoor__ip_based_logic_03_bad();

	void CWE510_Trapdoor__ip_based_logic_04_bad();

	void CWE510_Trapdoor__ip_based_logic_05_bad();

	void CWE510_Trapdoor__ip_based_logic_06_bad();

	void CWE510_Trapdoor__ip_based_logic_07_bad();

	void CWE510_Trapdoor__ip_based_logic_08_bad();

	void CWE510_Trapdoor__ip_based_logic_09_bad();

	void CWE510_Trapdoor__ip_based_logic_10_bad();

	void CWE510_Trapdoor__ip_based_logic_11_bad();

	void CWE510_Trapdoor__ip_based_logic_12_bad();

	void CWE510_Trapdoor__ip_based_logic_13_bad();

	void CWE510_Trapdoor__ip_based_logic_14_bad();

	void CWE510_Trapdoor__ip_based_logic_15_bad();

	void CWE510_Trapdoor__ip_based_logic_16_bad();

	void CWE510_Trapdoor__ip_based_logic_17_bad();

	void CWE510_Trapdoor__ip_based_logic_18_bad();

	void CWE510_Trapdoor__network_connection_01_bad();

	void CWE510_Trapdoor__network_connection_02_bad();

	void CWE510_Trapdoor__network_connection_03_bad();

	void CWE510_Trapdoor__network_connection_04_bad();

	void CWE510_Trapdoor__network_connection_05_bad();

	void CWE510_Trapdoor__network_connection_06_bad();

	void CWE510_Trapdoor__network_connection_07_bad();

	void CWE510_Trapdoor__network_connection_08_bad();

	void CWE510_Trapdoor__network_connection_09_bad();

	void CWE510_Trapdoor__network_connection_10_bad();

	void CWE510_Trapdoor__network_connection_11_bad();

	void CWE510_Trapdoor__network_connection_13_bad();

	void CWE510_Trapdoor__network_connection_14_bad();

	void CWE510_Trapdoor__network_connection_15_bad();

	void CWE510_Trapdoor__network_connection_16_bad();

	void CWE510_Trapdoor__network_connection_17_bad();

	void CWE510_Trapdoor__network_connection_18_bad();

	void CWE510_Trapdoor__network_listen_01_bad();

	void CWE510_Trapdoor__network_listen_02_bad();

	void CWE510_Trapdoor__network_listen_03_bad();

	void CWE510_Trapdoor__network_listen_04_bad();

	void CWE510_Trapdoor__network_listen_05_bad();

	void CWE510_Trapdoor__network_listen_06_bad();

	void CWE510_Trapdoor__network_listen_07_bad();

	void CWE510_Trapdoor__network_listen_08_bad();

	void CWE510_Trapdoor__network_listen_09_bad();

	void CWE510_Trapdoor__network_listen_10_bad();

	void CWE510_Trapdoor__network_listen_11_bad();

	void CWE510_Trapdoor__network_listen_13_bad();

	void CWE510_Trapdoor__network_listen_14_bad();

	void CWE510_Trapdoor__network_listen_15_bad();

	void CWE510_Trapdoor__network_listen_16_bad();

	void CWE510_Trapdoor__network_listen_17_bad();

	void CWE510_Trapdoor__network_listen_18_bad();

	/* END-AUTOGENERATED-C-BAD-FUNCTION-DECLARATIONS */
#endif // OMITBAD

#ifdef __cplusplus
} // end extern "C"
#endif

#ifdef __cplusplus
// declare C++ namespaces and good and bad functions

#ifndef OMITGOOD
	/* BEGIN-AUTOGENERATED-CPP-GOOD-FUNCTION-DECLARATIONS */

	/* END-AUTOGENERATED-CPP-GOOD-FUNCTION-DECLARATIONS */
#endif // OMITGOOD

#ifndef OMITBAD
	/* BEGIN-AUTOGENERATED-CPP-BAD-FUNCTION-DECLARATIONS */

	/* END-AUTOGENERATED-CPP-BAD-FUNCTION-DECLARATIONS */
#endif // OMITBAD

#endif // __cplusplus

#endif //  _TESTCASES_H


text:
//@@author A0141021H-reused
package seedu.whatnow.commons.events.ui;

import seedu.whatnow.commons.events.BaseEvent;

/**
 * An event requesting to view the help page.
 */
public class ShowHelpRequestEvent extends BaseEvent {

    @Override
    public String toString() {
        return this.getClass().getSimpleName();
    }

}


text:
package org.apache.cassandra.transport.messages;

import org.junit.Assert;
import org.junit.Test;

import org.apache.cassandra.transport.Message;
import org.apache.cassandra.transport.ProtocolVersion;

public class PrepareMessageTest extends EncodeAndDecodeTestBase<PrepareMessage>
{
    @Test
    public void testEncodeThenDecode()
    {
        PrepareMessage origin = new PrepareMessage("SELECT * FROM keyspace.tbl WHERE name='ßètæ'", "keyspace");
        PrepareMessage newMessage = encodeThenDecode(origin, ProtocolVersion.V5);
        Assert.assertEquals(origin.toString(), newMessage.toString());
    }

    protected Message.Codec<PrepareMessage> getCodec()
    {
        return PrepareMessage.codec;
    }
}


text:
jQuery FeedbackRadio plugin turns consecutive radio buttons into rating feedback stars without affecting data that is submitted:

| Before | After |
|:------:|:------:|
|![Original radio inputs](https://github.com/ain/jquery-feedbackradio/raw/master/example/original.png) | ![Interpreted radio inputs](https://github.com/ain/jquery-feedbackradio/raw/master/example/converted.png) |

## Getting Started
Download the [production version][min] or the [development version][max].

[min]: https://raw.github.com/ain/jquery-feedbackradio/master/dist/jquery-feedbackradio.min.js
[max]: https://raw.github.com/ain/jquery-feedbackradio/master/src/jquery-feedbackradio.js

In your web page:

```html
<script src="jquery.js"></script>
<script src="jquery-feedbackradio.min.js"></script>
<script>
jQuery(function($) {
  // Call on the ID of the fieldset radio inputs reside in.
  $('#feedback-fieldset').feedbackradio();
});
</script>
```

## Requirements
- jQuery 1.2.6+

## Documentation
See inline JSDoc comments in [source](https://github.com/ain/jquery-feedbackradio/blob/master/src/jquery-feedbackradio.js).

## Examples
See the [example/](https://github.com/ain/jquery-feedbackradio/tree/master/example) folder.

## Contributing
See [Contributing](https://github.com/ain/jquery-feedbackradio/blob/master/CONTRIBUTING.md).

## Release History
- 2013-10-29  v0.2.0  Optional vertical block layout for feedback stars.
- 2013-10-27  v0.1.0  First production-ready release with basic functionality.


text:
package tech.arauk.ark.arel.nodes;

import tech.arauk.ark.arel.annotations.Beta;
import tech.arauk.ark.arel.interfaces.*;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;

@Beta
public class ArelNodeSelectCore extends ArelNode implements ArelFromInterface, ArelGroupsInterface, ArelHavingsInterface, ArelProjectionsInterface, ArelSetQuantifierInterface, ArelSourceInterface, ArelTopInterface, ArelWheresInterface, ArelWindowsInterface {
    public ArelNodeJoinSource source;
    public ArelNodeTop top;
    public ArelNode setQuantifier;
    public List<Object> groups;
    public List<Object> havings;
    public List<Object> projections;
    public List<Object> windows;
    public List<Object> wheres;

    public ArelNodeSelectCore() {
        super();

        this.groups = new ArrayList<>();
        this.havings = new ArrayList<>();
        this.projections = new ArrayList<>();
        this.source = new ArelNodeJoinSource(null);
        this.windows = new ArrayList<>();
        this.wheres = new ArrayList<>();
    }

    @Override
    public boolean equals(Object other) {
        if (other instanceof ArelNodeSelectCore) {
            ArelNodeSelectCore selectCore = (ArelNodeSelectCore) other;

            return Objects.equals(this.source(), selectCore.source())
                    && Objects.equals(this.setQuantifier(), selectCore.setQuantifier())
                    && Objects.equals(this.projections(), selectCore.projections())
                    && Objects.equals(this.wheres(), selectCore.wheres())
                    && Objects.equals(this.groups(), selectCore.groups())
                    && Objects.equals(this.havings(), selectCore.havings())
                    && Objects.equals(this.windows(), selectCore.windows());
        }

        return super.equals(other);
    }

    @Override
    public Object from() {
        return source.left();
    }

    @Override
    public ArelNodeSelectCore from(Object value) {
        this.source.left(value);

        return this;
    }

    @Override
    public List<Object> groups() {
        return this.groups;
    }

    @Override
    public ArelNodeSelectCore groups(List<Object> groups) {
        this.groups = groups;
        return this;
    }

    @Override
    public int hashCode() {
        return Arrays.hashCode(new Object[]{source(), top(), setQuantifier(), projections(), wheres(), groups(), havings(), windows()});
    }

    @Override
    public List<Object> havings() {
        return this.havings;
    }

    @Override
    public ArelNodeSelectCore havings(List<Object> havings) {
        this.havings = havings;
        return this;
    }

    @Override
    public List<Object> projections() {
        return this.projections;
    }

    @Override
    public ArelNodeSelectCore projections(Object projections) {
        this.projections = objectToList(projections);
        return this;
    }

    @Override
    public ArelNode setQuantifier() {
        return this.setQuantifier;
    }

    @Override
    public ArelNodeSelectCore setQuantifier(ArelNode setQuantifier) {
        this.setQuantifier = setQuantifier;
        return this;
    }

    @Override
    public ArelNodeJoinSource source() {
        return this.source;
    }

    @Override
    public ArelNodeSelectCore source(ArelNodeJoinSource source) {
        this.source = source;
        return this;
    }

    @Override
    public ArelNodeTop top() {
        return this.top;
    }

    @Override
    public ArelNodeSelectCore top(ArelNodeTop top) {
        this.top = top;
        return this;
    }

    @Override
    public List<Object> wheres() {
        return this.wheres;
    }

    @Override
    public ArelNodeSelectCore wheres(Object wheres) {
        this.wheres = objectToList(wheres);
        return this;
    }

    @Override
    public List<Object> windows() {
        return this.windows;
    }

    @Override
    public ArelNodeSelectCore windows(List<Object> windows) {
        this.windows = windows;
        return this;
    }

    public Object froms() {
        return from();
    }

    public ArelNodeSelectCore froms(Object value) {
        return from(value);
    }
}


text:
package com.stanfy.enroscar.async.internal;

import android.os.AsyncTask;

import java.util.concurrent.Callable;

final class AsyncTaskWithDelegate<D> extends AsyncTask<Void, Void, D> {

  /** Delegate. */
  private final BaseAsync<D> async;

  /** Task. */
  private final Callable<D> task;

  /** Caught error. */
  private Exception error;

  protected AsyncTaskWithDelegate(final Callable<D> task, final BaseAsync<D> async) {
    this.async = async;
    this.task = task;
  }

  @Override
  protected final D doInBackground(Void... params) {
    try {
      return task.call();
    } catch (Exception e) {
      error = e;
      return null;
    }
  }

  @Override
  protected final void onPostExecute(final D d) {
    if (error != null) {
      async.postError(error);
    } else {
      async.postResult(d);
      async.postReset();
    }
  }

}


text:
namespace BitPaySDK.Models.Invoice
{
    public class SupportedTransactionCurrency
    {
        public bool Enabled { get; set; }
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DataReader.Models;

namespace DataReader.BusinessLogic
{
    public interface INameBusinessLogic
    {
        NameDTO GetById(string id);
        string[] GetAllNameIds();
    }
}


text:
#ifndef ASLAM_BACKEND_MAP_TRANSFORMATION_HPP
#define ASLAM_BACKEND_MAP_TRANSFORMATION_HPP

#include <sm/kinematics/Transformation.hpp>
#include <aslam/backend/MappedRotationQuaternion.hpp>
#include <aslam/backend/MappedEuclideanPoint.hpp>

namespace aslam {
    namespace backend {

        TransformationExpression transformationToExpression( sm::kinematics::Transformation & T,
                                                             boost::shared_ptr<MappedRotationQuaternion> & outQ,
                                                             boost::shared_ptr<MappedEuclideanPoint> & outT);

        /// \brief Convert a Tranformation to an optimizable transformation expression
        ///
        /// The created design variables will be stored in the expression. You can
        /// get them with getDesignVariables()
        TransformationExpression transformationToExpression( sm::kinematics::Transformation & T );

    } // namespace backend
} // namespace aslam

#endif /* ASLAM_BACKEND_MAP_TRANSFORMATION_HPP */


text:
@import io.github.bamos.ReadmeAnalysis
@(numTop: Int, repos: Seq[(String,Int,ReadmeAnalysis)],
  numTotal: Int, numChecked: Int, numBroken: Int)

@base { } {

        girl is a
        Github Readme Link Checker.
        This is a free service that checks the broken links in the
        READMEs of the
        1" target="main">top @(numTop)
          GitHub repositories
        by number of stars.
        Results are cached for 24 hours.

        "Total Links" and "Checked Links" may differ below because
        only the first 100 links in each repository will be checked.
        To surpass this limit, please run a local instance.

        Try girl on your profile or repo!
        This public instance is restricted to users
        with 50 or more followers.
        <form id="tryForm" class='form-horizontal'>
            <input type='text' class='form-control' id='suffix'
                placeholder='username or username/repo'>
            <button type="submit" class='btn'>Submit</button>
        </form>

            Crafted by Brandon Amos |
            Open-sourced on GitHub

            Tweet
            Follow @brandondamos

      @(numTotal) Total Links |
      @(numChecked) Checked Links |
      @(numBroken) Broken Links

      @for((repoName,stars,repoAnalysis)<-repos) {

@(repoName) | @(stars) Stars

        @for((link,reason)<-repoAnalysis.brokenLinks) {

Broken Link: @(link)

Reason: @reason

        }

      }

}


text:
import {Math} from 'j0';
import tests from '../tests.js';
tests(Math.exp, ['Math', 'exp']);


text:
<?php declare(strict_types = 1);

namespace SlevomatCsobGateway\Call;

use SlevomatCsobGateway\Api\ApiClient;
use SlevomatCsobGateway\Crypto\SignatureDataFormatter;
use SlevomatCsobGateway\EncodeHelper;
use SlevomatCsobGateway\Validator;
use function array_filter;

class RefundPaymentRequest
{

	public function __construct(
		private string $merchantId,
		private string $payId,
		private ?int $amount = null,
	)
	{
		Validator::checkPayId($payId);
	}

	public function send(ApiClient $apiClient): AuthCodeStatusDetailPaymentResponse
	{
		$requestData = array_filter([
			'merchantId' => $this->merchantId,
			'payId' => $this->payId,
			'amount' => $this->amount,
		], EncodeHelper::filterValueCallback());

		$response = $apiClient->put(
			'payment/refund',
			$requestData,
			new SignatureDataFormatter([
				'merchantId' => null,
				'payId' => null,
				'dttm' => null,
				'amount' => null,
			]),
			new SignatureDataFormatter(AuthCodeStatusDetailPaymentResponse::encodeForSignature()),
		);

		/** @var mixed[] $data */
		$data = $response->getData();

		return AuthCodeStatusDetailPaymentResponse::createFromResponseData($data);
	}

}


text:
package com.bdh.demo.vo;

/**
 * Created by baodehua on 2016/12/7.
 */
public class Comment {
    private String author;
    private String text;

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
}


text:
require "simplecov"
SimpleCov.start

ENV['RACK_ENV'] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/boot")

RSpec.configure do |conf|
  conf.include Rack::Test::Methods
end


text:
import { Component } from '@angular/core';
import { NgbProgressbarConfig, NgbProgressbarModule } from '@ng-bootstrap/ng-bootstrap';

@Component({
	selector: 'ngbd-progressbar-config',
	standalone: true,
	imports: [NgbProgressbarModule],
	templateUrl: './progressbar-config.html',
	providers: [NgbProgressbarConfig], // add the NgbProgressbarConfig to the component providers
})
export class NgbdProgressbarConfig {
	constructor(config: NgbProgressbarConfig) {
		// customize default values of progress bars used by this component tree
		config.max = 1000;
		config.striped = true;
		config.animated = true;
		config.type = 'success';
		config.height = '20px';
	}
}


text:
All Bugs

Defect Detection Percentage

The defect detection percentage (DDP) gives a measure of the testing effectiveness.
                    It is calculated as a ratio of defects found found prior to release and after release by customers.
                    You can also calculate DDP from sub-metrics:

Number of escaped defects

Number of defects (at the moment of software version release)

                    For example, suppose that 90 defects were found during QA/testing stage and 20 defects were found by
                    customers after the release. The DDP would be calculated as 90 divided by (90 + 20) = 81.8%

                    `DDP=("Number of defects at the moment of software version release")/("Number of defects at the moment of software release + escaped defects found")`

                {{total}}

Defect Removal Efficiency

                    The defect removal efficiency (DRE) gives a measure of the development team ability to remove
                    defects prior to release. It is calculated as a ratio of defects resolved to total number of defects
                    found. It is typically measured prior and at the moment of release.

                        For example, suppose that 100 defects were found during QA/testing stage and 84 defects were
                        resolved by the development team at the moment of measurement.
                        The DRE would be calculated as 84 divided by 100 = 84%

                    `DRE = ("Number of defects resolved by the development team")/("total number of defects at the moment of measurement")`

Schedule Estimation Accuracy

                        `SEA=("Actual project duration")/("Estimated project duration")`

Total Released Defects

                        `"TRD"_{"total"}={"Number of released defects"}/{"Assembly-equivalent total source size"}`

Customer-Found Defects

                        `"CFD"_{"total"}={"Number of customer-found defects"}/{"Assembly-equivalent total source size"}`

Test Case Efficiency

                    To know the efficiency of the test cases that are being executed in the testing phase.
                    The quality of the test cases can be determined.

                        `"TCF"={"Number of defects detected"}/{"Number of test cases run"}*100`


text:
"""Decorators to apply Lighttpd X-Sendfile on a specific view."""
from django_downloadview.decorators import DownloadDecorator
from django_downloadview.lighttpd.middlewares import XSendfileMiddleware

def x_sendfile(view_func, *args, **kwargs):
    """Apply
    :class:`~django_downloadview.lighttpd.middlewares.XSendfileMiddleware` to
    ``view_func``.

    Proxies (``*args``, ``**kwargs``) to middleware constructor.

    """
    decorator = DownloadDecorator(XSendfileMiddleware)
    return decorator(view_func, *args, **kwargs)


text:
import Route                from './styles'

import compact              from 'lodash/compact'
import without              from 'lodash/without'
import flatMap              from 'lodash/flatMap'
import includes             from 'lodash/includes'

import React, { PropTypes } from 'react'
import { Badge, Button }    from 'antd'

import OrdersTable          from 'containers/OrdersTable'

import BoundsWrapper        from 'components/BoundsWrapper'

import { STATUSES,
         orderStatusIcon,
         orderStatusText,
         orderStatusColor } from 'utils/orders'

//-----------  Definitions  -----------//

const title = 'Orders'

//-----------  Component  -----------//

class OrdersRoute extends React.Component {

  state = {
    filters: ['fulfilled', 'paid']
  }

  //-----------  Event Hadlers  -----------//

  toggleFilter = (status, remove = false) => {
    let { filters } = this.state
    filters = remove ? without(filters, status) : filters.concat([status])
    this.setState({ filters })
  }

  //-----------  HTML Render  -----------//

  render(){
    const { data, error, hasMore, isLoading } = this.props.orders
    const { filters } = this.state

    const orders = compact(flatMap(data, (arr, key) => includes(filters, key) ? arr : null))

    return (
      <Route.Page title={title} loading={isLoading}>
        <BoundsWrapper>
          <Route.Header>

{flatMap(data, arr => arr).length} Orders

Filter By Status:

              {STATUSES.map(status => {
                const selected = includes(filters, status)
                return (
                  <Badge
                    key={status}
                    showZero={true}
                    count={data[status] ? data[status].length : 0}
                    style={{ backgroundColor: orderStatusColor(status) }}
                  >
                    <Button
                      type={selected ? 'primary' : 'dashed'}
                      icon={orderStatusIcon(status, !selected)}
                      onClick={() => this.toggleFilter(status, selected)}
                    >
                      {orderStatusText(status)}
                    </Button>
                  </Badge>
                )
              })}

          </Route.Header>

          <OrdersTable
            rowKey='id'
            loading={isLoading}
            dataSource={orders}
            pagination={hasMore}
          />
        </BoundsWrapper>
      </Route.Page>
    )
  }
}

//-----------  Prop Types  -----------//

OrdersRoute.propTypes = {
  orders: PropTypes.object.isRequired,
}

//-----------  Exports  -----------//

export default OrdersRoute


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>sd-reader: partition.h File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

sd-reader

Main Page

Modules

Data Structures

Files

File List

Globals

Data Structures |
Defines |
Typedefs |
Functions

partition.h File Reference
Partition table support

Partition table header (license: GPLv2 or LGPLv2.1)
More...

Data Structures

struct  	partition_struct

 	Describes a partition.  More...

Defines

#define 	PARTITION_TYPE_FREE

 	The partition table entry is not used.

#define 	PARTITION_TYPE_FAT12

 	The partition contains a FAT12 filesystem.

#define 	PARTITION_TYPE_FAT16_32MB

 	The partition contains a FAT16 filesystem with 32MB maximum.

#define 	PARTITION_TYPE_EXTENDED

 	The partition is an extended partition with its own partition table.

#define 	PARTITION_TYPE_FAT16

 	The partition contains a FAT16 filesystem.

#define 	PARTITION_TYPE_FAT32

 	The partition contains a FAT32 filesystem.

#define 	PARTITION_TYPE_FAT32_LBA

 	The partition contains a FAT32 filesystem with LBA.

#define 	PARTITION_TYPE_FAT16_LBA

 	The partition contains a FAT16 filesystem with LBA.

#define 	PARTITION_TYPE_EXTENDED_LBA

 	The partition is an extended partition with LBA.

#define 	PARTITION_TYPE_UNKNOWN

 	The partition has an unknown type.

Typedefs

typedef uint8_t(* 	device_read_t )(offset_t offset, uint8_t *buffer, uintptr_t length)

 	A function pointer used to read from the partition.

typedef uint8_t(* 	device_read_callback_t )(uint8_t *buffer, offset_t offset, void *p)

 	A function pointer passed to a device_read_interval_t.

typedef uint8_t(* 	device_read_interval_t )(offset_t offset, uint8_t *buffer, uintptr_t interval, uintptr_t length, device_read_callback_t callback, void *p)

 	A function pointer used to continuously read units of interval bytes and call a callback function.

typedef uint8_t(* 	device_write_t )(offset_t offset, const uint8_t *buffer, uintptr_t length)

 	A function pointer used to write to the partition.

typedef uintptr_t(* 	device_write_callback_t )(uint8_t *buffer, offset_t offset, void *p)

 	A function pointer passed to a device_write_interval_t.

typedef uint8_t(* 	device_write_interval_t )(offset_t offset, uint8_t *buffer, uintptr_t length, device_write_callback_t callback, void *p)

 	A function pointer used to continuously write a data stream obtained from a callback function.

Functions

struct partition_struct * 	partition_open (device_read_t device_read, device_read_interval_t device_read_interval, device_write_t device_write, device_write_interval_t device_write_interval, int8_t index)

 	Opens a partition.

uint8_t 	partition_close (struct partition_struct *partition)

 	Closes a partition.

Detailed Description

Partition table header (license: GPLv2 or LGPLv2.1)

Author:

Roland Riegel

<address class="footer">
Generated on Tue Jun 12 2012 20:06:45 for sd-reader by

 1.7.6.1
</address>


text:
<?php namespace PHPFHIRGenerated\FHIRResource\FHIRConformance;

use PHPFHIRGenerated\FHIRElement\FHIRBackboneElement;
use PHPFHIRGenerated\JsonSerializable;

/**
 * A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.
 */
class FHIRConformanceRest extends FHIRBackboneElement implements JsonSerializable
{
    /**
     * Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.
     * @var \PHPFHIRGenerated\FHIRElement\FHIRRestfulConformanceMode
     */
    public $mode = null;

    /**
     * Information about the system's restful capabilities that apply across all applications, such as security.
     * @var \PHPFHIRGenerated\FHIRElement\FHIRString
     */
    public $documentation = null;

    /**
     * Information about security implementation from an interface perspective - what a client needs to know.
     * @var \PHPFHIRGenerated\FHIRResource\FHIRConformance\FHIRConformanceSecurity
     */
    public $security = null;

    /**
     * A specification of the restful capabilities of the solution for a specific resource type.
     * @var \PHPFHIRGenerated\FHIRResource\FHIRConformance\FHIRConformanceResource[]
     */
    public $resource = array();

    /**
     * A specification of restful operations supported by the system.
     * @var \PHPFHIRGenerated\FHIRResource\FHIRConformance\FHIRConformanceInteraction1[]
     */
    public $interaction = array();

    /**
     * A code that indicates how transactions are supported.
     * @var \PHPFHIRGenerated\FHIRElement\FHIRTransactionMode
     */
    public $transactionMode = null;

    /**
     * Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.
     * @var \PHPFHIRGenerated\FHIRResource\FHIRConformance\FHIRConformanceSearchParam[]
     */
    public $searchParam = array();

    /**
     * Definition of an operation or a named query and with its parameters and their meaning and type.
     * @var \PHPFHIRGenerated\FHIRResource\FHIRConformance\FHIRConformanceOperation[]
     */
    public $operation = array();

    /**
     * An absolute URI which is a reference to the definition of a compartment hosted by the system.
     * @var \PHPFHIRGenerated\FHIRElement\FHIRUri[]
     */
    public $compartment = array();

    /**
     * @var string
     */
    private $_fhirElementName = 'Conformance.Rest';

    /**
     * Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.
     * @return \PHPFHIRGenerated\FHIRElement\FHIRRestfulConformanceMode
     */
    public function getMode()
    {
        return $this->mode;
    }

    /**
     * Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.
     * @param \PHPFHIRGenerated\FHIRElement\FHIRRestfulConformanceMode $mode
     * @return $this
     */
    public function setMode($mode)
    {
        $this->mode = $mode;
        return $this;
    }

    /**
     * Information about the system's restful capabilities that apply across all applications, such as security.
     * @return \PHPFHIRGenerated\FHIRElement\FHIRString
     */
    public function getDocumentation()
    {
        return $this->documentation;
    }

    /**
     * Information about the system's restful capabilities that apply across all applications, such as security.
     * @param \PHPFHIRGenerated\FHIRElement\FHIRString $documentation
     * @return $this
     */
    public function setDocumentation($documentation)
    {
        $this->documentation = $documentation;
        return $this;
    }

    /**
     * Information about security implementation from an interface perspective - what a client needs to know.
     * @return \PHPFHIRGenerated\FHIRResource\FHIRConformance\FHIRConformanceSecurity
     */
    public function getSecurity()
    {
        return $this->security;
    }

    /**
     * Information about security implementation from an interface perspective - what a client needs to know.
     * @param \PHPFHIRGenerated\FHIRResource\FHIRConformance\FHIRConformanceSecurity $security
     * @return $this
     */
    public function setSecurity($security)
    {
        $this->security = $security;
        return $this;
    }

    /**
     * A specification of the restful capabilities of the solution for a specific resource type.
     * @return \PHPFHIRGenerated\FHIRResource\FHIRConformance\FHIRConformanceResource[]
     */
    public function getResource()
    {
        return $this->resource;
    }

    /**
     * A specification of the restful capabilities of the solution for a specific resource type.
     * @param \PHPFHIRGenerated\FHIRResource\FHIRConformance\FHIRConformanceResource[] $resource
     * @return $this
     */
    public function addResource($resource)
    {
        $this->resource[] = $resource;
        return $this;
    }

    /**
     * A specification of restful operations supported by the system.
     * @return \PHPFHIRGenerated\FHIRResource\FHIRConformance\FHIRConformanceInteraction1[]
     */
    public function getInteraction()
    {
        return $this->interaction;
    }

    /**
     * A specification of restful operations supported by the system.
     * @param \PHPFHIRGenerated\FHIRResource\FHIRConformance\FHIRConformanceInteraction1[] $interaction
     * @return $this
     */
    public function addInteraction($interaction)
    {
        $this->interaction[] = $interaction;
        return $this;
    }

    /**
     * A code that indicates how transactions are supported.
     * @return \PHPFHIRGenerated\FHIRElement\FHIRTransactionMode
     */
    public function getTransactionMode()
    {
        return $this->transactionMode;
    }

    /**
     * A code that indicates how transactions are supported.
     * @param \PHPFHIRGenerated\FHIRElement\FHIRTransactionMode $transactionMode
     * @return $this
     */
    public function setTransactionMode($transactionMode)
    {
        $this->transactionMode = $transactionMode;
        return $this;
    }

    /**
     * Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.
     * @return \PHPFHIRGenerated\FHIRResource\FHIRConformance\FHIRConformanceSearchParam[]
     */
    public function getSearchParam()
    {
        return $this->searchParam;
    }

    /**
     * Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.
     * @param \PHPFHIRGenerated\FHIRResource\FHIRConformance\FHIRConformanceSearchParam[] $searchParam
     * @return $this
     */
    public function addSearchParam($searchParam)
    {
        $this->searchParam[] = $searchParam;
        return $this;
    }

    /**
     * Definition of an operation or a named query and with its parameters and their meaning and type.
     * @return \PHPFHIRGenerated\FHIRResource\FHIRConformance\FHIRConformanceOperation[]
     */
    public function getOperation()
    {
        return $this->operation;
    }

    /**
     * Definition of an operation or a named query and with its parameters and their meaning and type.
     * @param \PHPFHIRGenerated\FHIRResource\FHIRConformance\FHIRConformanceOperation[] $operation
     * @return $this
     */
    public function addOperation($operation)
    {
        $this->operation[] = $operation;
        return $this;
    }

    /**
     * An absolute URI which is a reference to the definition of a compartment hosted by the system.
     * @return \PHPFHIRGenerated\FHIRElement\FHIRUri[]
     */
    public function getCompartment()
    {
        return $this->compartment;
    }

    /**
     * An absolute URI which is a reference to the definition of a compartment hosted by the system.
     * @param \PHPFHIRGenerated\FHIRElement\FHIRUri[] $compartment
     * @return $this
     */
    public function addCompartment($compartment)
    {
        $this->compartment[] = $compartment;
        return $this;
    }

    /**
     * @return string
     */
    public function get_fhirElementName()
    {
        return $this->_fhirElementName;
    }

    /**
     * @return string
     */
    public function __toString()
    {
        return $this->get_fhirElementName();
    }

    /**
     * @return array
     */
    public function jsonSerialize()
    {
        $json = parent::jsonSerialize();
        if (null !== $this->mode) $json['mode'] = $this->mode->jsonSerialize();
        if (null !== $this->documentation) $json['documentation'] = $this->documentation->jsonSerialize();
        if (null !== $this->security) $json['security'] = $this->security->jsonSerialize();
        if (0 < count($this->resource)) {
            $json['resource'] = array();
            foreach($this->resource as $resource) {
                $json['resource'][] = $resource->jsonSerialize();
            }
        }
        if (0 < count($this->interaction)) {
            $json['interaction'] = array();
            foreach($this->interaction as $interaction) {
                $json['interaction'][] = $interaction->jsonSerialize();
            }
        }
        if (null !== $this->transactionMode) $json['transactionMode'] = $this->transactionMode->jsonSerialize();
        if (0 < count($this->searchParam)) {
            $json['searchParam'] = array();
            foreach($this->searchParam as $searchParam) {
                $json['searchParam'][] = $searchParam->jsonSerialize();
            }
        }
        if (0 < count($this->operation)) {
            $json['operation'] = array();
            foreach($this->operation as $operation) {
                $json['operation'][] = $operation->jsonSerialize();
            }
        }
        if (0 < count($this->compartment)) {
            $json['compartment'] = array();
            foreach($this->compartment as $compartment) {
                $json['compartment'][] = $compartment->jsonSerialize();
            }
        }
        return $json;
    }

    /**
     * @param boolean $returnSXE
     * @param \SimpleXMLElement $sxe
     * @return string|\SimpleXMLElement
     */
    public function xmlSerialize($returnSXE = false, $sxe = null)
    {
        if (null === $sxe) $sxe = new \SimpleXMLElement('<ConformanceRest xmlns="http://hl7.org/fhir"></ConformanceRest>');
        parent::xmlSerialize(true, $sxe);
        if (null !== $this->mode) $this->mode->xmlSerialize(true, $sxe->addChild('mode'));
        if (null !== $this->documentation) $this->documentation->xmlSerialize(true, $sxe->addChild('documentation'));
        if (null !== $this->security) $this->security->xmlSerialize(true, $sxe->addChild('security'));
        if (0 < count($this->resource)) {
            foreach($this->resource as $resource) {
                $resource->xmlSerialize(true, $sxe->addChild('resource'));
            }
        }
        if (0 < count($this->interaction)) {
            foreach($this->interaction as $interaction) {
                $interaction->xmlSerialize(true, $sxe->addChild('interaction'));
            }
        }
        if (null !== $this->transactionMode) $this->transactionMode->xmlSerialize(true, $sxe->addChild('transactionMode'));
        if (0 < count($this->searchParam)) {
            foreach($this->searchParam as $searchParam) {
                $searchParam->xmlSerialize(true, $sxe->addChild('searchParam'));
            }
        }
        if (0 < count($this->operation)) {
            foreach($this->operation as $operation) {
                $operation->xmlSerialize(true, $sxe->addChild('operation'));
            }
        }
        if (0 < count($this->compartment)) {
            foreach($this->compartment as $compartment) {
                $compartment->xmlSerialize(true, $sxe->addChild('compartment'));
            }
        }
        if ($returnSXE) return $sxe;
        return $sxe->saveXML();
    }

}


text:
import * as actionCreators from "../../web/static/js/actions/retro"

import stageConfigs from "../../web/static/js/configs/stage_configs"
import STAGES from "../../web/static/js/configs/stages"

const { PRIME_DIRECTIVE } = STAGES

describe("updateStage", () => {
  it("creates an action to update the retro's stage", () => {
    const newStage = "newSlang"

    expect(actionCreators.updateStage(newStage)).to.deep.equal({
      type: "UPDATE_STAGE",
      stage: newStage,
      stageConfigs,
    })
  })
})

describe("setInitialState", () => {
  it("creates an action to set the retro's initial state", () => {
    const initialState = { stage: PRIME_DIRECTIVE, inserted_at: "2017-04-14T17:30:10" }

    expect(actionCreators.setInitialState(initialState)).to.deep.equal({
      type: "SET_INITIAL_STATE",
      initialState,
    })
  })
})


text:
layout: page
title: About
header-img: "img/about-bg.png"
---

I am a 29 year old with a Bachelor's of Business Administration, who has spent the last few years in sales. After dabbling every so slightly in programming a few years ago, I knew it was something I was very interested in. I came to a crossroads in my life, and I made the tough decision to leave the sales world purse my programming passion, which led me to Flatiron School's Web Developer Program. I am pursuing completion of the program and seeking a career and future in software development!


text:
'''
Author: jason
Created: Apr 15, 2012
Module: moBu.hotkeys.loadPCSoptionsCall
Purpose: call to custom load process
'''

import moBu.core.mobuFile

# eclipseSyntax
if False: from pyfbsdk_gen_doc import *

def loadPCSoptionsCall():
	reload(moBu.core.mobuFile)
	moBu.core.mobuFile.loadPCSoptions()
	pass

if __name__ == '__main__':
	print "moBu.hotkeys.loadPCSoptionsCall imported"
else:
	loadPCSoptionsCall()


text:
Make sure you have NPM and node installed:
```
$ node --version && npm --version
```
We support node version `4.x.x` and above.  For help installing, see [How To Install NPM](http://blog.npmjs.org/post/85484771375/how-to-install-npm)

Next, install the bespoken tools command line tool (bst):
```
$ npm install bespoken-tools -g
```
__Note:__ If you are on MacOS and the command fails, it is probably because you need to run it with sudo, like this:
```
$ sudo npm install bespoken-tools -g
```
Verify the installation by typing:
```
$ bst
```

## Updating

To update bst:
```
$ npm update bespoken-tools -g
```


text:
<?php

namespace GoPay\Definition\Response;

class PaymentStatus
{

    const CREATED = 'CREATED';
    const PAYMENT_METHOD_CHOSEN = 'PAYMENT_METHOD_CHOSEN';
    const PAID = 'PAID';
    const AUTHORIZED = 'AUTHORIZED';
    const CANCELED = 'CANCELED';
    const TIMEOUTED = 'TIMEOUTED';
    const REFUNDED = 'REFUNDED';
    const PARTIALLY_REFUNDED = 'PARTIALLY_REFUNDED';
}


text:
import { withAttr as _withAttr } from ".";
declare const withAttr: typeof _withAttr;
export = withAttr;


text:
package com.sleepcamel.bsoneer.tests.integration;

import static com.google.testing.compile.JavaSourceSubjectFactory.javaSource;
import static com.sleepcamel.bsoneer.tests.integration.ProcessorTestUtils.bsoneerProcessors;
import static org.truth0.Truth.ASSERT;

import javax.tools.JavaFileObject;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import com.google.common.base.Joiner;
import com.google.testing.compile.JavaFileObjects;

@RunWith(JUnit4.class)
final public class BsoneeBsonGeneratorTest {

	@Test public void generationTest() {
	    JavaFileObject sourceFile = JavaFileObjects.forSourceString("Person", Joiner.on("\n").join(
	        "import com.sleepcamel.bsoneer.Bsonee;",
	        "@Bsonee",
	        "class Person {",
	        "  Person() {}",
	        "  int a;",
	        "}"));

	    JavaFileObject expectedRegistry =
	            JavaFileObjects.forSourceString("BsoneeBson", Joiner.on("\n").join(
	            		"// Code generated by bsoneer-compiler.  Do not edit.",
	            		"//",
	            		"import java.lang.Class;",
	            		"import java.lang.Override;",
	            		"import java.lang.SuppressWarnings;",
	            		"import javax.annotation.Generated;",
	            		"import org.bson.BsonDocument;",
	            		"import org.bson.RawBsonDocument;",
	            		"import org.bson.codecs.Codec;",
	            		"import org.bson.codecs.configuration.CodecRegistry;",
	            		"import org.bson.conversions.Bson;",
	            		"",
	            		"/**",
	            		" * Code generated by bsoneer-compiler.  Do not edit.",
	            		" */",
	            		"@Generated(\"com.sleepcamel.bsoneer.processor.BsonProcessor\")",
	            		"public final class BsoneeBson<T> implements Bson {",
	            		"  private static final BsoneeCodecProvider bcp = new BsoneeCodecProvider();",
	            		"",
	            		"  private final T wrapped;",
	            		"",
	            		"  private final Class<T> wrappedClazz;",
	            		"",
	            		"	@SuppressWarnings({\"unchecked\"})",
	            		"  private BsoneeBson(final T wrapped) {",
	            		"    this.wrapped = wrapped;",
	            		"    this.wrappedClazz = (Class<T>)wrapped.getClass();",
	            		"  }",
	            		"",
	            		"  @Override",
	            		"  public <C> BsonDocument toBsonDocument(final Class<C> documentClass, final CodecRegistry registry) {",
	            		"    Codec<T> codec = registry.get(wrappedClazz);",
	            		"    if (codec == null) {",
	            		"      codec = bcp.get(wrappedClazz, registry);",
	            		"    }",
	            		"    return new RawBsonDocument(wrapped, codec);",
	            		"  }",
	            		"",
	            		"  public static <C> Bson bson(final C entity) {",
	            		"    return new BsoneeBson<C>(entity);",
	            		"  }",
	            		"}"));

	    ASSERT.about(javaSource()).that(sourceFile).processedWith(bsoneerProcessors()).compilesWithoutError().and().generatesSources(expectedRegistry);
  }
}