text:
package com.codeabovelab.dm.common.security.acl;

import org.springframework.security.acls.domain.AclAuthorizationStrategy;
import org.springframework.security.acls.domain.DefaultPermissionGrantingStrategy;
import org.springframework.security.acls.model.*;
import org.springframework.util.Assert;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * implementation of Acl (based on AclImpl code) which allow initial building without reflection hacks
 */
public class MutableAclImpl implements Acl, MutableAcl, AuditableAcl, OwnershipAcl {
    public static class Builder {

        private Acl parentAcl;
        private transient AclAuthorizationStrategy aclAuthorizationStrategy;
        private transient PermissionGrantingStrategy permissionGrantingStrategy;
        private final List<Object> aces = new ArrayList<>();
        private ObjectIdentity objectIdentity;
        private Serializable id;
        private Sid owner;
        private List<Sid> loadedSids = null;
        private boolean entriesInheriting = true;

        public Builder() {
        }

        public Acl getParentAcl() {
            return parentAcl;
        }

        public Builder parentAcl(Acl parentAcl) {
            setParentAcl(parentAcl);
            return this;
        }

        public void setParentAcl(Acl parentAcl) {
            this.parentAcl = parentAcl;
        }

        public AclAuthorizationStrategy getAclAuthorizationStrategy() {
            return aclAuthorizationStrategy;
        }

        public Builder aclAuthorizationStrategy(AclAuthorizationStrategy aclAuthorizationStrategy) {
            setAclAuthorizationStrategy(aclAuthorizationStrategy);
            return this;
        }

        public void setAclAuthorizationStrategy(AclAuthorizationStrategy aclAuthorizationStrategy) {
            this.aclAuthorizationStrategy = aclAuthorizationStrategy;
        }

        public PermissionGrantingStrategy getPermissionGrantingStrategy() {
            return permissionGrantingStrategy;
        }

        public Builder permissionGrantingStrategy(PermissionGrantingStrategy permissionGrantingStrategy) {
            setPermissionGrantingStrategy(permissionGrantingStrategy);
            return this;
        }

        public void setPermissionGrantingStrategy(PermissionGrantingStrategy permissionGrantingStrategy) {
            this.permissionGrantingStrategy = permissionGrantingStrategy;
        }

        public ObjectIdentity getObjectIdentity() {
            return objectIdentity;
        }

        public Builder objectIdentity(ObjectIdentity objectIdentity) {
            setObjectIdentity(objectIdentity);
            return this;
        }

        public void setObjectIdentity(ObjectIdentity objectIdentity) {
            this.objectIdentity = objectIdentity;
        }

        public Serializable getId() {
            return id;
        }

        public Builder id(Serializable id) {
            setId(id);
            return this;
        }

        public void setId(Serializable id) {
            this.id = id;
        }

        public Sid getOwner() {
            return owner;
        }

        public Builder owner(Sid owner) {
            setOwner(owner);
            return this;
        }

        public void setOwner(Sid owner) {
            this.owner = owner;
        }

        public List<Sid> getLoadedSids() {
            return loadedSids;
        }

        public Builder loadedSids(List<Sid> loadedSids) {
            setLoadedSids(loadedSids);
            return this;
        }

        public void setLoadedSids(List<Sid> loadedSids) {
            this.loadedSids = loadedSids;
        }

        public boolean isEntriesInheriting() {
            return entriesInheriting;
        }

        public Builder entriesInheriting(boolean entriesInheriting) {
            setEntriesInheriting(entriesInheriting);
            return this;
        }

        public void setEntriesInheriting(boolean entriesInheriting) {
            this.entriesInheriting = entriesInheriting;
        }

        public Builder addAce(AccessControlEntry ace) {
            aces.add(ace);
            return this;
        }

        public Builder addAce(AccessControlEntryImpl.Builder ace) {
            aces.add(ace);
            return this;
        }

        public MutableAclImpl build() {
            return new MutableAclImpl(this);
        }
    }

    private Acl parentAcl;
    private transient AclAuthorizationStrategy aclAuthorizationStrategy;
    private transient PermissionGrantingStrategy permissionGrantingStrategy;
    private final List<AccessControlEntry> aces = new ArrayList<>();
    private ObjectIdentity objectIdentity;
    private Serializable id;
    private Sid owner; // OwnershipAcl
    private List<Sid> loadedSids = null; // includes all SIDs the WHERE clause covered, even if there was no ACE for a SID
    private boolean entriesInheriting = true;

    /**
     */
    private MutableAclImpl(Builder b) {
        Assert.notNull(b.objectIdentity, "Object Identity required");
        Assert.notNull(b.id, "Id required");
        Assert.notNull(b.aclAuthorizationStrategy, "AclAuthorizationStrategy required");
        Assert.notNull(b.owner, "Owner required");

        this.objectIdentity = b.objectIdentity;
        this.id = b.id;
        this.aclAuthorizationStrategy = b.aclAuthorizationStrategy;
        this.parentAcl = b.parentAcl; // may be null
        this.loadedSids = b.loadedSids; // may be null
        this.entriesInheriting = b.entriesInheriting;
        this.owner = b.owner;
        this.permissionGrantingStrategy = b.permissionGrantingStrategy;

        AclUtils.buildEntries(this, b.aces, this.aces::add);
    }

    /**
     * Private no-argument constructor for use by reflection-based persistence
     * tools along with field-level access.
     */
    @SuppressWarnings("unused")
    private MutableAclImpl() {}

    //~ Methods ========================================================================================================

    @Override
    public void deleteAce(int aceIndex) throws NotFoundException {
        aclAuthorizationStrategy.securityCheck(this, AclAuthorizationStrategy.CHANGE_GENERAL);
        verifyAceIndexExists(aceIndex);

        synchronized (aces) {
            this.aces.remove(aceIndex);
        }
    }

    private void verifyAceIndexExists(int aceIndex) {
        if (aceIndex < 0) {
            throw new NotFoundException("aceIndex must be greater than or equal to zero");
        }
        if (aceIndex >= this.aces.size()) {
            throw new NotFoundException("aceIndex must refer to an index of the AccessControlEntry list. " +
                    "List size is " + aces.size() + ", index was " + aceIndex);
        }
    }

    @Override
    public void insertAce(int atIndexLocation, Permission permission, Sid sid, boolean granting) throws NotFoundException {
        aclAuthorizationStrategy.securityCheck(this, AclAuthorizationStrategy.CHANGE_GENERAL);
        Assert.notNull(permission, "Permission required");
        Assert.notNull(sid, "Sid required");
        if (atIndexLocation < 0) {
            throw new NotFoundException("atIndexLocation must be greater than or equal to zero");
        }
        if (atIndexLocation > this.aces.size()) {
            throw new NotFoundException("atIndexLocation must be less than or equal to the size of the AccessControlEntry collection");
        }

        AccessControlEntryImpl ace = new AccessControlEntryImpl.Builder()
                .acl(this)
                .sid(TenantSid.from(sid))
                .permission(permission)
                .granting(granting).build();

        synchronized (aces) {
            this.aces.add(atIndexLocation, ace);
        }
    }

    @Override
    public List<AccessControlEntry> getEntries() {
        // Can safely return AccessControlEntry directly, as they're immutable outside the ACL package
        synchronized(aces) {
            return new ArrayList<>(aces);
        }
    }

    @Override
    public Serializable getId() {
        return this.id;
    }

    @Override
    public ObjectIdentity getObjectIdentity() {
        return objectIdentity;
    }

    @Override
    public boolean isEntriesInheriting() {
        return entriesInheriting;
    }

    /**
     * Delegates to the {@link PermissionGrantingStrategy}.
     *
     * @throws UnloadedSidException if the passed SIDs are unknown to this ACL because the ACL was only loaded for a
     *         subset of SIDs
     * @see DefaultPermissionGrantingStrategy
     */
    @Override
    public boolean isGranted(List<Permission> permission, List<Sid> sids, boolean administrativeMode)
            throws NotFoundException, UnloadedSidException {
        Assert.notEmpty(permission, "Permissions required");
        Assert.notEmpty(sids, "SIDs required");

        if (!this.isSidLoaded(sids)) {
            throw new UnloadedSidException("ACL was not loaded for one or more SID");
        }

        return permissionGrantingStrategy.isGranted(this, permission, sids, administrativeMode);
    }

    @Override
    public boolean isSidLoaded(List<Sid> sids) {
        return AclUtils.isSidLoaded(loadedSids, sids);
    }

    @Override
    public void setEntriesInheriting(boolean entriesInheriting) {
        aclAuthorizationStrategy.securityCheck(this, AclAuthorizationStrategy.CHANGE_GENERAL);
        this.entriesInheriting = entriesInheriting;
    }

    @Override
    public void setOwner(Sid newOwner) {
        aclAuthorizationStrategy.securityCheck(this, AclAuthorizationStrategy.CHANGE_OWNERSHIP);
        Assert.notNull(newOwner, "Owner required");
        this.owner = newOwner;
    }

    @Override
    public Sid getOwner() {
        return this.owner;
    }

    @Override
    public void setParent(Acl newParent) {
        aclAuthorizationStrategy.securityCheck(this, AclAuthorizationStrategy.CHANGE_GENERAL);
        Assert.isTrue(newParent == null || !newParent.equals(this), "Cannot be the parent of yourself");
        this.parentAcl = newParent;
    }

    @Override
    public Acl getParentAcl() {
        return parentAcl;
    }

    @Override
    public void updateAce(int aceIndex, Permission permission)
        throws NotFoundException {
        aclAuthorizationStrategy.securityCheck(this, AclAuthorizationStrategy.CHANGE_GENERAL);
        verifyAceIndexExists(aceIndex);

        synchronized (aces) {
            AccessControlEntryImpl ace = (AccessControlEntryImpl) aces.get(aceIndex);
            aces.set(aceIndex, new AccessControlEntryImpl.Builder().from(ace).permission(permission).build());
        }
    }

    @Override
    public void updateAuditing(int aceIndex, boolean auditSuccess, boolean auditFailure) {
        aclAuthorizationStrategy.securityCheck(this, AclAuthorizationStrategy.CHANGE_AUDITING);
        verifyAceIndexExists(aceIndex);

        synchronized (aces) {
            AccessControlEntryImpl ace = (AccessControlEntryImpl) aces.get(aceIndex);
            aces.set(aceIndex, new AccessControlEntryImpl.Builder().from(ace)
                    .auditSuccess(auditSuccess)
                    .auditFailure(auditFailure)
                    .build());
        }
    }

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

        MutableAclImpl that = (MutableAclImpl) o;

        if (entriesInheriting != that.entriesInheriting) {
            return false;
        }
        if (aces != null ? !aces.equals(that.aces) : that.aces != null) {
            return false;
        }
        if (id != null ? !id.equals(that.id) : that.id != null) {
            return false;
        }
        if (loadedSids != null ? !loadedSids.equals(that.loadedSids) : that.loadedSids != null) {
            return false;
        }
        if (objectIdentity != null ? !objectIdentity.equals(that.objectIdentity) : that.objectIdentity != null) {
            return false;
        }
        if (owner != null ? !owner.equals(that.owner) : that.owner != null) {
            return false;
        }
        if (parentAcl != null ? !parentAcl.equals(that.parentAcl) : that.parentAcl != null) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int result = parentAcl != null ? parentAcl.hashCode() : 0;
        result = 31 * result + (aces != null ? aces.hashCode() : 0);
        result = 31 * result + (objectIdentity != null ? objectIdentity.hashCode() : 0);
        result = 31 * result + (id != null ? id.hashCode() : 0);
        result = 31 * result + (owner != null ? owner.hashCode() : 0);
        result = 31 * result + (loadedSids != null ? loadedSids.hashCode() : 0);
        result = 31 * result + (entriesInheriting ? 1 : 0);
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("AclImpl[");
        sb.append("id: ").append(this.id).append("; ");
        sb.append("objectIdentity: ").append(this.objectIdentity).append("; ");
        sb.append("owner: ").append(this.owner).append("; ");

        int count = 0;

        for (AccessControlEntry ace : aces) {
            count++;

            if (count == 1) {
                sb.append("\n");
            }

            sb.append(ace).append("\n");
        }

        if (count == 0) {
            sb.append("no ACEs; ");
        }

        sb.append("inheriting: ").append(this.entriesInheriting).append("; ");
        sb.append("parent: ").append((this.parentAcl == null) ? "Null" : this.parentAcl.getObjectIdentity().toString());
        sb.append("; ");
        sb.append("aclAuthorizationStrategy: ").append(this.aclAuthorizationStrategy).append("; ");
        sb.append("permissionGrantingStrategy: ").append(this.permissionGrantingStrategy);
        sb.append("]");

        return sb.toString();
    }
}


text:
This section is for developers who want to create a new output sink. Outputs
are created in a similar manner as collection plugins, and their interface has
similar constructs.

## Output Plugin Guidelines

- An output must conform to the [telegraf.Output][] interface.
- Outputs should call `outputs.Add` in their `init` function to register
  themselves.  See below for a quick example.
- To be available within Telegraf itself, plugins must add themselves to the
  `github.com/influxdata/telegraf/plugins/outputs/all/all.go` file.
- Each plugin requires a file called `sample.conf` containing the sample
  configuration  for the plugin in TOML format.
  Please consult the [Sample Config][] page for the latest style guidelines.
- Each plugin `README.md` file should include the `sample.conf` file in a section
  describing the configuration by specifying a `toml` section in the form `toml @sample.conf`. The specified file(s) are then injected automatically into the Readme.
- Follow the recommended [Code Style][].

## Output Plugin Example

```go
//go:generate ../../../tools/readme_config_includer/generator
package simpleoutput

// simpleoutput.go

import (
    _ "embed"

    "github.com/influxdata/telegraf"
    "github.com/influxdata/telegraf/plugins/outputs"
)

// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
//go:embed sample.conf
var sampleConfig string

type Simple struct {
    Ok  bool            `toml:"ok"`
    Log telegraf.Logger `toml:"-"`
}

func (*Simple) SampleConfig() string {
    return sampleConfig
}

// Init is for setup, and validating config.
func (s *Simple) Init() error {
    return nil
}

func (s *Simple) Connect() error {
    // Make any connection required here
    return nil
}

func (s *Simple) Close() error {
    // Close any connections here.
    // Write will not be called once Close is called, so there is no need to synchronize.
    return nil
}

// Write should write immediately to the output, and not buffer writes
// (Telegraf manages the buffer for you). Returning an error will fail this
// batch of writes and the entire batch will be retried automatically.
func (s *Simple) Write(metrics []telegraf.Metric) error {
    for _, metric := range metrics {
        // write `metric` to the output sink here
    }
    return nil
}

func init() {
    outputs.Add("simpleoutput", func() telegraf.Output { return &Simple{} })
}

```

## Data Formats

Some output plugins, such as the [file][] plugin, can write in any supported
[output data formats][].

In order to enable this, you must specify a
`SetSerializer(serializer serializers.Serializer)`
function on the plugin object (see the file plugin for an example), as well as
defining `serializer` as a field of the object.

You can then utilize the serializer internally in your plugin, serializing data
before it's written. Telegraf's configuration layer will take care of
instantiating and creating the `Serializer` object.

You should also add the following to your `SampleConfig()`:

```toml
  ## Data format to output.
  ## Each data format has its own unique set of configuration options, read
  ## more about them here:
  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
  data_format = "influx"
```

## Flushing Metrics to Outputs

Metrics are flushed to outputs when any of the following events happen:

- `flush_interval + rand(flush_jitter)` has elapsed since start or the last flush interval
- At least `metric_batch_size` count of metrics are waiting in the buffer
- The telegraf process has received a SIGUSR1 signal

Note that if the flush takes longer than the `agent.interval` to write the metrics
to the output, you'll see a message saying the output `did not complete within its
flush interval`. This may mean your output is not keeping up with the flow of metrics,
and you may want to look into enabling compression, reducing the size of your metrics,
or investigate other reasons why the writes might be taking longer than expected.

[file]: https://github.com/influxdata/telegraf/tree/master/plugins/inputs/file
[output data formats]: https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
[Sample Config]: https://github.com/influxdata/telegraf/blob/master/docs/developers/SAMPLE_CONFIG.md
[Code Style]: https://github.com/influxdata/telegraf/blob/master/docs/developers/CODE_STYLE.md
[telegraf.Output]: https://godoc.org/github.com/influxdata/telegraf#Output

redpajama_set_name: RedPajamaGithub


text:
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MongoDB.DeepUpdater.Test.Models;
using MongoDB.Driver;
using System;
using System.Linq;

namespace MongoDB.DeepUpdater.Test.Tests
{
    [TestClass]
    public class SelectAndWhereTest : BaseTestClass
    {
        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void Select_Expression_Null()
        {
            var univ = FindByToken("Complete");

            var update = Builders<University>.Update
                .Deep(univ)
                .Select<Department>(null);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void SelectArray_Expression_Null()
        {
            var univ = FindByToken("Complete");
            Assert.IsNotNull(univ);

            var update = Builders<University>.Update
                .Deep(univ)
                .SelectArray<Department>(null);
        }

        [TestMethod]
        [ExpectedException(typeof(NullReferenceException))]
        public void Select_SingleThroughNullProperty()
        {
            var univ = FindByToken("NullLists");
            Assert.IsNotNull(univ);

            var update = Builders<University>.Update
                .Deep(univ)
                .Select(x => x.Administration.Chancellor);

            update.GetFieldDefinitions();
        }

        [TestMethod]
        [ExpectedException(typeof(NullReferenceException))]
        public void Select_DoubleThroughNullProperty()
        {
            var univ = FindByToken("NullLists");
            Assert.IsNotNull(univ);

            var update = Builders<University>.Update
                .Deep(univ)
                .Select(x => x.Administration)
                .Select(x => x.Chancellor);

            update.GetFieldDefinitions();
        }

        [TestMethod]
        [ExpectedException(typeof(NullReferenceException))]
        public void SelectArray_SingleThroughNullProperty()
        {
            var univ = FindByToken("NullLists");
            Assert.IsNotNull(univ);

            var update = Builders<University>.Update
                .Deep(univ)
                .Select(x => x.Administration.Employees);

            update.GetFieldDefinitions();
        }

        [TestMethod]
        [ExpectedException(typeof(NullReferenceException))]
        public void SelectArray_DoubleThroughNullProperty()
        {
            var univ = FindByToken("NullLists");

            var update = Builders<University>.Update
                .Deep(univ)
                .Select(x => x.Administration)
                .Select(x => x.Employees);

            update.GetFieldDefinitions();
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void SelectArray_Null()
        {
            var univ = FindByToken("NullLists");

            var update = Builders<University>.Update
                .Deep(univ)
                .SelectArray(x => x.Departments);

            update.GetFieldDefinitions();
        }

        [TestMethod]
        public void Select_NullArray()
        {
            var univ = FindByToken("NullLists");

            var update = Builders<University>.Update
                .Deep(univ)
                .Select(x => x.Departments);

            var fieldDefinitions = update.GetFieldDefinitions();

            Assert.IsNotNull(fieldDefinitions);
            Assert.AreEqual(1, fieldDefinitions.Count);

            var fd = RenderFieldDef(fieldDefinitions[0]);
            Assert.AreEqual("Departments", fd);
        }

        [TestMethod]
        public void Select_Simple()
        {
            var univ = FindByToken("Complete");

            var update = Builders<University>.Update
                .Deep(univ)
                .Select(x => x.Administration);

            var fieldDefinitions = update.GetFieldDefinitions();

            Assert.IsNotNull(fieldDefinitions);
            Assert.AreEqual(1, fieldDefinitions.Count);

            var fdString = RenderFieldDef(fieldDefinitions[0]);
            Assert.AreEqual("Administration", fdString);
        }

        [TestMethod]
        public void Select_Deep()
        {
            var univ = FindByToken("Complete");

            var update = Builders<University>.Update
                .Deep(univ)
                .Select(x => x.Administration.Chancellor.Name);

            var fieldDefinitions = update.GetFieldDefinitions();

            Assert.IsNotNull(fieldDefinitions);
            Assert.AreEqual(1, fieldDefinitions.Count);

            var fdString = RenderFieldDef(fieldDefinitions[0]);
            Assert.AreEqual("Administration.Chancellor.Name", fdString);
        }

        [TestMethod]
        public void SelectArray_Single()
        {
            var univ = FindByToken("Complete");

            var update = Builders<University>.Update
                .Deep(univ)
                .SelectArray(x => x.Departments);

            var fieldDefinitions = update.GetFieldDefinitions();

            Assert.IsNotNull(fieldDefinitions);
            Assert.AreEqual(1, fieldDefinitions.Count);

            var fdString = RenderFieldDef(fieldDefinitions[0]);
            Assert.AreEqual("Departments", fdString);
        }

        [TestMethod]
        public void DeepSelect1()
        {
            var univ = FindByToken("Complete");

            var update = Builders<University>.Update
                .Deep(univ)
                .SelectArray(x => x.Departments)
                .Where(x => x.MacroArea == "Science")
                .SelectArray(x => x.Programs)
                .Where(x => x.Years.Count > 1)
                .Select(x => x.Name);

            var fieldDefinitions = update.GetFieldDefinitions();

            Assert.IsNotNull(fieldDefinitions);
            Assert.AreEqual(2, fieldDefinitions.Count);

            var fdString1 = RenderFieldDef(fieldDefinitions[0]);
            Assert.AreEqual("Departments.0.Programs.2.Name", fdString1);

            var fdString2 = RenderFieldDef(fieldDefinitions[1]);
            Assert.AreEqual("Departments.1.Programs.0.Name", fdString2);
        }

        [TestMethod]
        public void DeepSelect2()
        {
            var univ = FindByToken("Complete");

            var update = Builders<University>.Update
                .Deep(univ)
                .Select(x => x.Administration)
                .SelectArray(x => x.Employees)
                .Where(x => x.Name.StartsWith("A"));

            var fieldDefinitions = update.GetFieldDefinitions();

            Assert.IsNotNull(fieldDefinitions);
            Assert.AreEqual(3, fieldDefinitions.Count);

            var fdString1 = RenderFieldDef(fieldDefinitions[0]);
            Assert.AreEqual("Administration.Employees.0", fdString1);

            var fdString2 = RenderFieldDef(fieldDefinitions[1]);
            Assert.AreEqual("Administration.Employees.3", fdString2);

            var fdString3 = RenderFieldDef(fieldDefinitions[2]);
            Assert.AreEqual("Administration.Employees.4", fdString3);
        }

        [TestMethod]
        public void DeepSelect3()
        {
            var univ = FindByToken("Complete");

            var update = Builders<University>.Update
                .Deep(univ)
                .SelectArray(x => x.Departments)
                .Where(x => x.Area == "Engineering")
                .SelectArray(x => x.Programs)
                .Where(x => x.Name == "Informatic Engineering")
                .SelectArray(x => x.Years)
                .Where(x => x.Order == 3)
                .SelectArray(x => x.Classes)
                .Where(x => x.Name == "Networks");

            var fieldDefinitions = update.GetFieldDefinitions();

            Assert.IsNotNull(fieldDefinitions);
            Assert.AreEqual(1, fieldDefinitions.Count);

            var fd = RenderFieldDef(fieldDefinitions[0]);
            Assert.AreEqual("Departments.0.Programs.2.Years.2.Classes.2", fd);
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
 <MESSAGE ID="87872" PROTOCOLVERSION="1.0">
  <SIMPLEREQ>
   <METHODCALL NAME="SendTestIndication">
    <LOCALCLASSPATH>
     <LOCALNAMESPACEPATH>
      <NAMESPACE NAME="test"/>
      <NAMESPACE NAME="static"/>
     </LOCALNAMESPACEPATH>
     <CLASSNAME NAME="JMPI_RT_SampleIndication1"/>
    </LOCALCLASSPATH>
   </METHODCALL>
  </SIMPLEREQ>
 </MESSAGE>
</CIM>


text:
module MongoMapper
  module Plugins
    module Querying
      Methods = Plucky::Methods + [:delete, :delete_all, :destroy, :destroy_all, :find!]

      class DecoratedPluckyQuery < ::Plucky::Query
        include DynamicQuerying::ClassMethods

        def delete(*ids)
          where(:_id => ids.flatten).remove
        end

        def delete_all(options = {})
          where(options).remove
        end

        def destroy(*ids)
          [find!(*ids.flatten.compact.uniq)].flatten.each { |doc| doc.destroy }
        end

        def destroy_all(options={})
          find_each(options) { |document| document.destroy }
        end

        def model(model=nil)
          return @model if model.nil?
          @model = model
          self
        end

        def criteria_hash
          @model.dealias_keys super
        end

        def options_hash
          super.tap do |options|
            case options[:fields]
            when Hash
              options[:fields] = @model.dealias options[:fields]
            when Array
              options[:fields] = options[:fields].map do |field|
                key = keys[field.to_s]
                key && key.abbr || field
              end
            end
          end
        end

        def find!(*ids)
          ids = Array(ids).flatten.uniq
          raise DocumentNotFound, "Couldn't find without an ID" if ids.size == 0

          find(*ids).tap do |result|
            if result.nil? || ids.size != Array(result).size
              raise DocumentNotFound, "Couldn't find all of the ids (#{ids.join(',')}). Found #{Array(result).size}, but was expecting #{ids.size}"
            end
          end
        end

        protected

          def method_missing(method, *args, &block)
            return super unless model.respond_to?(method)
            result = model.send(method, *args, &block)
            if result.is_a?(Plucky::Query)
              merge(result)
            else
              result
            end
          end
      end
    end
  end
end


text:
namespace mscorlib
{
	namespace System
	{

		class Type;

	}
}
namespace mscorlib
{
	namespace System
	{
		namespace Security
		{
			namespace AccessControl
			{

				class RegistryAuditRule
					: public mscorlib::System::Security::AccessControl::AuditRuleBase
				{
				public:
					RegistryAuditRule(mscorlib::System::Security::Principal::IdentityReference identity, mscorlib::System::Security::AccessControl::RegistryRights::__ENUM__ registryRights, mscorlib::System::Security::AccessControl::InheritanceFlags::__ENUM__ inheritanceFlags, mscorlib::System::Security::AccessControl::PropagationFlags::__ENUM__ propagationFlags, mscorlib::System::Security::AccessControl::AuditFlags::__ENUM__ flags)
					: mscorlib::System::Security::AccessControl::AuditRuleBase(mscorlib::NativeTypeInfo::GetTypeInfo("mscorlib","System.Security.AccessControl.RegistryAuditRule"))
					{
						MonoType *__parameter_types__[5];
						void *__parameters__[5];
						__parameter_types__[0] = Global::GetType("mscorlib", "System.Security.Principal", "IdentityReference");
						__parameter_types__[1] = Global::GetType("mscorlib", "System.Security.AccessControl", "RegistryRights");
						__parameter_types__[2] = Global::GetType("mscorlib", "System.Security.AccessControl", "InheritanceFlags");
						__parameter_types__[3] = Global::GetType("mscorlib", "System.Security.AccessControl", "PropagationFlags");
						__parameter_types__[4] = Global::GetType("mscorlib", "System.Security.AccessControl", "AuditFlags");
						__parameters__[0] = (MonoObject*)identity;
						mscorlib::System::Int32 __param_registryRights__ = registryRights;
						__parameters__[1] = &__param_registryRights__;
						mscorlib::System::Int32 __param_inheritanceFlags__ = inheritanceFlags;
						__parameters__[2] = &__param_inheritanceFlags__;
						mscorlib::System::Int32 __param_propagationFlags__ = propagationFlags;
						__parameters__[3] = &__param_propagationFlags__;
						mscorlib::System::Int32 __param_flags__ = flags;
						__parameters__[4] = &__param_flags__;
						__native_object__ = Global::New("mscorlib", "System.Security.AccessControl", "RegistryAuditRule", 5, __parameter_types__, __parameters__);
					};

					RegistryAuditRule(mscorlib::System::String identity, mscorlib::System::Security::AccessControl::RegistryRights::__ENUM__ registryRights, mscorlib::System::Security::AccessControl::InheritanceFlags::__ENUM__ inheritanceFlags, mscorlib::System::Security::AccessControl::PropagationFlags::__ENUM__ propagationFlags, mscorlib::System::Security::AccessControl::AuditFlags::__ENUM__ flags)
					: mscorlib::System::Security::AccessControl::AuditRuleBase(mscorlib::NativeTypeInfo::GetTypeInfo("mscorlib","System.Security.AccessControl.RegistryAuditRule"))
					{
						MonoType *__parameter_types__[5];
						void *__parameters__[5];
						__parameter_types__[0] = Global::GetType("mscorlib", "System", "String");
						__parameter_types__[1] = Global::GetType("mscorlib", "System.Security.AccessControl", "RegistryRights");
						__parameter_types__[2] = Global::GetType("mscorlib", "System.Security.AccessControl", "InheritanceFlags");
						__parameter_types__[3] = Global::GetType("mscorlib", "System.Security.AccessControl", "PropagationFlags");
						__parameter_types__[4] = Global::GetType("mscorlib", "System.Security.AccessControl", "AuditFlags");
						__parameters__[0] = (MonoObject*)identity;
						mscorlib::System::Int32 __param_registryRights__ = registryRights;
						__parameters__[1] = &__param_registryRights__;
						mscorlib::System::Int32 __param_inheritanceFlags__ = inheritanceFlags;
						__parameters__[2] = &__param_inheritanceFlags__;
						mscorlib::System::Int32 __param_propagationFlags__ = propagationFlags;
						__parameters__[3] = &__param_propagationFlags__;
						mscorlib::System::Int32 __param_flags__ = flags;
						__parameters__[4] = &__param_flags__;
						__native_object__ = Global::New("mscorlib", "System.Security.AccessControl", "RegistryAuditRule", 5, __parameter_types__, __parameters__);
					};

					RegistryAuditRule(mscorlib::NativeTypeInfo *nativeTypeInfo)
					: mscorlib::System::Security::AccessControl::AuditRuleBase(nativeTypeInfo)
					{
					};

					RegistryAuditRule(MonoObject *nativeObject)
					: mscorlib::System::Security::AccessControl::AuditRuleBase(nativeObject)
					{
					};

					~RegistryAuditRule()
					{
					};

					RegistryAuditRule & operator=(RegistryAuditRule &value) { __native_object__ = value.GetNativeObject(); return value; };
					bool operator==(RegistryAuditRule &value) { return mscorlib::System::Object::Equals(value); };
					operator MonoObject*() { return __native_object__; };
					MonoObject* operator=(MonoObject* value) { return __native_object__ = value; };

					virtual MonoObject* GetNativeObject()  override  { return __native_object__; };

					//Public Properties
					__declspec(property(get=get_RegistryRights)) mscorlib::System::Security::AccessControl::RegistryRights::__ENUM__  RegistryRights;
					__declspec(property(get=get_AuditFlags)) mscorlib::System::Security::AccessControl::AuditFlags::__ENUM__  AuditFlags;
					__declspec(property(get=get_IdentityReference)) mscorlib::System::Security::Principal::IdentityReference  IdentityReference;
					__declspec(property(get=get_InheritanceFlags)) mscorlib::System::Security::AccessControl::InheritanceFlags::__ENUM__  InheritanceFlags;
					__declspec(property(get=get_IsInherited)) mscorlib::System::Boolean  IsInherited;
					__declspec(property(get=get_PropagationFlags)) mscorlib::System::Security::AccessControl::PropagationFlags::__ENUM__  PropagationFlags;

					//Get Set Properties Methods
					//	Get:RegistryRights
					mscorlib::System::Security::AccessControl::RegistryRights::__ENUM__  get_RegistryRights() const;

					//	Get:AuditFlags
					mscorlib::System::Security::AccessControl::AuditFlags::__ENUM__  get_AuditFlags() const;

					//	Get:IdentityReference
					mscorlib::System::Security::Principal::IdentityReference  get_IdentityReference() const;

					//	Get:InheritanceFlags
					mscorlib::System::Security::AccessControl::InheritanceFlags::__ENUM__  get_InheritanceFlags() const;

					//	Get:IsInherited
					mscorlib::System::Boolean  get_IsInherited() const;

					//	Get:PropagationFlags
					mscorlib::System::Security::AccessControl::PropagationFlags::__ENUM__  get_PropagationFlags() const;

				protected:

				private:

				};

			}
		}
	}
}
#endif


text:
#include <fstream>
#include <iostream>
#include <stdlib.h>
#include <vector>

#include "testing_common.hpp"

/* ============================================================================================ */

using hipblasGerModel = ArgumentModel<e_M, e_N, e_alpha, e_incx, e_incy, e_lda>;

inline void testname_ger(const Arguments& arg, std::string& name)
{
    hipblasGerModel{}.test_name(arg, name);
}

template <typename T, bool CONJ>
inline hipblasStatus_t testing_ger(const Arguments& arg)
{
    bool FORTRAN      = arg.fortran;
    auto hipblasGerFn = FORTRAN ? (CONJ ? hipblasGer<T, true, true> : hipblasGer<T, false, true>)
                                : (CONJ ? hipblasGer<T, true, false> : hipblasGer<T, false, false>);

    int M    = arg.M;
    int N    = arg.N;
    int incx = arg.incx;
    int incy = arg.incy;
    int lda  = arg.lda;

    int    abs_incx = incx >= 0 ? incx : -incx;
    int    abs_incy = incy >= 0 ? incy : -incy;
    size_t x_size   = size_t(M) * abs_incx;
    size_t y_size   = size_t(M) * abs_incy;
    size_t A_size   = size_t(lda) * N;

    hipblasLocalHandle handle(arg);

    // argument sanity check, quick return if input parameters are invalid before allocating invalid
    // memory
    bool invalid_size = M < 0 || N < 0 || !incx || !incy || lda < M || lda < 1;
    if(invalid_size || !M || !N)
    {
        hipblasStatus_t actual
            = hipblasGerFn(handle, M, N, nullptr, nullptr, incx, nullptr, incy, nullptr, lda);
        EXPECT_HIPBLAS_STATUS(
            actual, (invalid_size ? HIPBLAS_STATUS_INVALID_VALUE : HIPBLAS_STATUS_SUCCESS));
        return actual;
    }

    // Naming: dK is in GPU (device) memory. hK is in CPU (host) memory
    host_vector<T> hA(A_size);
    host_vector<T> hA_host(A_size);
    host_vector<T> hA_device(A_size);
    host_vector<T> hA_cpu(A_size);
    host_vector<T> hx(x_size);
    host_vector<T> hy(y_size);

    device_vector<T> dA(A_size);
    device_vector<T> dx(x_size);
    device_vector<T> dy(y_size);
    device_vector<T> d_alpha(1);

    double gpu_time_used, hipblas_error_host, hipblas_error_device;

    T h_alpha = arg.get_alpha<T>();

    // Initial Data on CPU
    hipblas_init_matrix(hA, arg, lda, N, lda, 0, 1, hipblas_client_never_set_nan, true, false);
    hipblas_init_vector(hx, arg, M, abs_incx, 0, 1, hipblas_client_alpha_sets_nan, false, true);
    hipblas_init_vector(hy, arg, N, abs_incy, 0, 1, hipblas_client_alpha_sets_nan);

    // copy matrix is easy in STL; hB = hA: save a copy in hB which will be output of CPU BLAS
    hA_cpu = hA;

    // copy data from CPU to device
    CHECK_HIP_ERROR(hipMemcpy(dA, hA.data(), sizeof(T) * A_size, hipMemcpyHostToDevice));
    CHECK_HIP_ERROR(hipMemcpy(dx, hx.data(), sizeof(T) * x_size, hipMemcpyHostToDevice));
    CHECK_HIP_ERROR(hipMemcpy(dy, hy.data(), sizeof(T) * y_size, hipMemcpyHostToDevice));
    CHECK_HIP_ERROR(hipMemcpy(d_alpha, &h_alpha, sizeof(T), hipMemcpyHostToDevice));

    if(arg.unit_check || arg.norm_check)
    {
        /* =====================================================================
            HIPBLAS
        =================================================================== */
        CHECK_HIPBLAS_ERROR(hipblasSetPointerMode(handle, HIPBLAS_POINTER_MODE_HOST));
        CHECK_HIPBLAS_ERROR(hipblasGerFn(handle, M, N, (T*)&h_alpha, dx, incx, dy, incy, dA, lda));

        CHECK_HIP_ERROR(hipMemcpy(hA_host.data(), dA, sizeof(T) * A_size, hipMemcpyDeviceToHost));
        CHECK_HIP_ERROR(hipMemcpy(dA, hA.data(), sizeof(T) * A_size, hipMemcpyHostToDevice));

        CHECK_HIPBLAS_ERROR(hipblasSetPointerMode(handle, HIPBLAS_POINTER_MODE_DEVICE));
        CHECK_HIPBLAS_ERROR(hipblasGerFn(handle, M, N, d_alpha, dx, incx, dy, incy, dA, lda));

        CHECK_HIP_ERROR(hipMemcpy(hA_device.data(), dA, sizeof(T) * A_size, hipMemcpyDeviceToHost));

        /* =====================================================================
           CPU BLAS
        =================================================================== */
        cblas_ger<T, CONJ>(M, N, h_alpha, hx.data(), incx, hy.data(), incy, hA_cpu.data(), lda);

        // enable unit check, notice unit check is not invasive, but norm check is,
        // unit check and norm check can not be interchanged their order
        if(arg.unit_check)
        {
            unit_check_general<T>(M, N, lda, hA_cpu.data(), hA_host.data());
            unit_check_general<T>(M, N, lda, hA_cpu.data(), hA_device.data());
        }
        if(arg.norm_check)
        {
            hipblas_error_host
                = norm_check_general<T>('F', M, N, lda, hA_cpu.data(), hA_host.data());
            hipblas_error_device
                = norm_check_general<T>('F', M, N, lda, hA_cpu.data(), hA_device.data());
        }
    }

    if(arg.timing)
    {
        CHECK_HIP_ERROR(hipMemcpy(dA, hA.data(), sizeof(T) * A_size, hipMemcpyHostToDevice));
        hipStream_t stream;
        CHECK_HIPBLAS_ERROR(hipblasGetStream(handle, &stream));
        CHECK_HIPBLAS_ERROR(hipblasSetPointerMode(handle, HIPBLAS_POINTER_MODE_DEVICE));

        int runs = arg.cold_iters + arg.iters;
        for(int iter = 0; iter < runs; iter++)
        {
            if(iter == arg.cold_iters)
                gpu_time_used = get_time_us_sync(stream);

            CHECK_HIPBLAS_ERROR(hipblasGerFn(handle, M, N, d_alpha, dx, incx, dy, incy, dA, lda));
        }
        gpu_time_used = get_time_us_sync(stream) - gpu_time_used;

        hipblasGerModel{}.log_args<T>(std::cout,
                                      arg,
                                      gpu_time_used,
                                      ger_gflop_count<T>(M, N),
                                      ger_gbyte_count<T>(M, N),
                                      hipblas_error_host,
                                      hipblas_error_device);
    }

    return HIPBLAS_STATUS_SUCCESS;
}


text:
from bokeh.models import HoverTool, ColumnDataSource
from bokeh.plotting import figure, save, show
from bokeh.sampledata.periodic_table import elements

romans = ["I", "II", "III", "IV", "V", "VI", "VII"]

elements["atomic mass"] = elements["atomic mass"].astype(str)

elements["period"] = [romans[x-1] for x in elements.period]
elements = elements[elements.group != "-"]

group_range = [str(x) for x in range(1, 19)]

colormap = {
    "alkali metal"         : "#a6cee3",
    "alkaline earth metal" : "#1f78b4",
    "halogen"              : "#fdbf6f",
    "metal"                : "#b2df8a",
    "metalloid"            : "#33a02c",
    "noble gas"            : "#bbbb88",
    "nonmetal"             : "#baa2a6",
    "transition metal"     : "#e08e79",
}

source = ColumnDataSource(
    data=dict(
        group=[str(x) for x in elements["group"]],
        period=[str(y) for y in elements["period"]],
        symx=[str(x)+":0.1" for x in elements["group"]],
        numbery=[str(x)+":0.8" for x in elements["period"]],
        massy=[str(x)+":0.15" for x in elements["period"]],
        namey=[str(x)+":0.3" for x in elements["period"]],
        sym=elements["symbol"],
        name=elements["name"],
        cpk=elements["CPK"],
        atomic_number=elements["atomic number"],
        electronic=elements["electronic configuration"],
        mass=elements["atomic mass"],
        type=elements["metal"],
        type_color=[colormap[x] for x in elements["metal"]],
    )
)

p = figure(title="Periodic Table", tools="resize,hover,save",
           x_range=group_range, y_range=list(reversed(romans)))
p.plot_width = 1200
p.toolbar_location = None
p.outline_line_color = None

p.rect("group", "period", 0.9, 0.9, source=source,
       fill_alpha=0.6, color="type_color")

text_props = {
    "source": source,
    "angle": 0,
    "color": "black",
    "text_align": "left",
    "text_baseline": "middle"
}

p.text(x="symx", y="period", text="sym",
       text_font_style="bold", text_font_size="15pt", **text_props)

p.text(x="symx", y="numbery", text="atomic_number",
       text_font_size="9pt", **text_props)

p.text(x="symx", y="namey", text="name",
       text_font_size="6pt", **text_props)

p.text(x="symx", y="massy", text="mass",
       text_font_size="5pt", **text_props)

p.grid.grid_line_color = None

p.select_one(HoverTool).tooltips = [
    ("name", "@name"),
    ("atomic number", "@atomic_number"),
    ("type", "@type"),
    ("atomic mass", "@mass"),
    ("CPK color", "$color[hex, swatch]:cpk"),
    ("electronic configuration", "@electronic"),
]

show(p)  # Change to save(p) to save but not show the HTML file


text:
DIR=`dirname $0`
cd $DIR/..

if [ -x $1 ]
then
    echo "run through ch07-ch15 test cases in test262:\n usage: $0 <s5-options>"
    exit 1
fi

chs="ch07 ch08 ch09 ch10 ch11 ch12 ch13 ch14 ch15"
log=optimization/test-test262.log
base=optimization/opt-test262-results
testscript=optimization/test-section.sh

rm -f $log
mkdir -p $base

for t in $chs
do
    echo "$t" >> $log
    dir=$base/$t-nonstrict
    $testscript nonstrict $t $dir "$@" > $base/$t-nonstrict.txt

    echo "strict $t" >> $log
    dir=$base/$t-strict
    $testscript strict $t $dir "$@" > $base/$t-strict.txt
done


text:
<?php
defined('SYSPATH') or die ('no tiene acceso');
//descripcion del modelo productos
class Model_niveles extends ORM{
    protected $_table_names_plural = false;
    public function menus($n){
        $sql="SELECT m.id, m.menu, m.descripcion, m.controlador,s.id as id_submenu  ,s.submenu,s.accion,s.descripcion,m.logo FROM menus m
        INNER JOIN nivelmenu n ON m.id=n.id_menu
        INNER JOIN submenus s ON m.id=s.id_menu
        WHERE n.id_nivel='$n'
        AND s.habilitado='1'
        ORDER BY m.index";
        return $this->_db->query(Database::SELECT, $sql,TRUE);
    }

}

?>


text:
$ cd path/to/blitzmax/mod
$ git clone git://github.com/komiga/duct-max.git duct.mod


text:
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.

#include "SwFactory.h"
#include "SwFabric.h"
#include "SwCloth.h"
#include "SwSolver.h"
#include "ClothImpl.h"
#include <string.h> // for memcpy

using namespace physx;

namespace physx
{
	namespace cloth
	{
		// defined in Factory.cpp
		uint32_t getNextFabricId();
	}
}

cloth::SwFactory::SwFactory()
: Factory(CPU)
{
}

cloth::SwFactory::~SwFactory()
{
}

cloth::Fabric* cloth::SwFactory::createFabric( uint32_t numParticles,
	Range<const uint32_t> phases, Range<const uint32_t> sets,
	Range<const float> restvalues, Range<const uint32_t> indices,
	Range<const uint32_t> anchors, Range<const float> tetherLengths)
{
	return new SwFabric( *this, numParticles, phases, sets,
		restvalues, indices, anchors, tetherLengths, getNextFabricId());
}

cloth::Cloth* cloth::SwFactory::createCloth( Range<const PxVec4> particles, Fabric& fabric )
{
	return new SwClothImpl( *this, fabric, particles );
}

cloth::Solver* cloth::SwFactory::createSolver(physx::PxProfileZone* profiler, physx::PxTaskManager* taskMgr)
{
#ifdef PX_PHYSX_GPU_EXPORTS
	// SwSolver not defined in PhysXGpu project
	PX_UNUSED(profiler);
	PX_UNUSED(taskMgr);
	return 0;
#else
	return new SwSolver(profiler, taskMgr);
#endif
}

cloth::Cloth* cloth::SwFactory::clone( const Cloth& cloth )
{
	if (cloth.getFactory().getPlatform() != Factory::CPU)
		return cloth.clone(*this); // forward to CuCloth

	// copy construct
	return new SwClothImpl(*this, static_cast<const SwClothImpl&>(cloth));
}

void cloth::SwFactory::copyToHost( const void* srcIt, const void* srcEnd, void* dstIt ) const
{
	memcpy(dstIt, srcIt, size_t(intptr_t(srcEnd) - intptr_t(srcIt)));
}

void cloth::SwFactory::copyFromHost( const void* srcIt, const void* srcEnd, void* dstIt ) const
{
	copyToHost(srcIt, srcEnd, dstIt);
}

void cloth::SwFactory::copyToHost( const void* srcIt, const void* srcEnd, void* dstIt, CUstream ) const
{
	copyToHost(srcIt, srcEnd, dstIt);
}

void cloth::SwFactory::copyFromHost( const void* srcIt, const void* srcEnd, void* dstIt, CUstream ) const
{
	copyToHost(srcIt, srcEnd, dstIt);
}

void cloth::SwFactory::extractFabricData(const Fabric& fabric,
	Range<uint32_t> phases, Range<uint32_t> sets,
	Range<float> restvalues, Range<uint32_t> indices,
	Range<uint32_t> anchors, Range<float> tetherLengths) const
{
	const SwFabric& swFabric = static_cast<const SwFabric&>(fabric);

	PX_ASSERT(phases.empty() || phases.size() == swFabric.getNumPhases());
	PX_ASSERT(restvalues.empty() || restvalues.size() == swFabric.getNumRestvalues());
	PX_ASSERT(sets.empty() || sets.size() == swFabric.getNumSets());
	PX_ASSERT(indices.empty() || indices.size() == swFabric.getNumIndices());
	PX_ASSERT(anchors.empty() || anchors.size() == swFabric.getNumTethers());
	PX_ASSERT(tetherLengths.empty() || tetherLengths.size() == swFabric.getNumTethers());

	for(uint32_t i=0; !phases.empty(); ++i, phases.popFront())
		phases.front() = swFabric.mPhases[i];

	const uint32_t* sEnd = swFabric.mSets.end(), *sIt;
	const float* rBegin = swFabric.mRestvalues.begin(), *rIt = rBegin;
	const uint16_t* iIt = swFabric.mIndices.begin();

	uint32_t* sDst = sets.begin();
	float* rDst = restvalues.begin();
	uint32_t* iDst = indices.begin();

	uint32_t numConstraints = 0;
	for(sIt = swFabric.mSets.begin(); ++sIt != sEnd; )
	{
		const float* rEnd = rBegin + *sIt;
		for(; rIt != rEnd; ++rIt)
		{
			uint16_t i0 = *iIt++;
			uint16_t i1 = *iIt++;

			if(PxMax(i0, i1) >= swFabric.mNumParticles)
				continue;

			if(!restvalues.empty())
				*rDst++ = *rIt;

			if(!indices.empty())
			{
				*iDst++ = i0;
				*iDst++ = i1;
			}

			++numConstraints;
		}

		if(!sets.empty())
			*sDst++ = numConstraints;
	}

	for(uint32_t i=0; !anchors.empty(); ++i, anchors.popFront())
		anchors.front() = swFabric.mTethers[i].mAnchor;

	for(uint32_t i=0; !tetherLengths.empty(); ++i, tetherLengths.popFront())
		tetherLengths.front() = swFabric.mTethers[i].mLength * swFabric.mTetherLengthScale;
}

void cloth::SwFactory::extractCollisionData(const Cloth& cloth, Range<PxVec4> spheres,
	Range<uint32_t> capsules, Range<PxVec4> planes,
	Range<uint32_t> convexes, Range<PxVec3> triangles) const
{
	PX_ASSERT(&cloth.getFactory() == this);

	const SwCloth& swCloth = static_cast<const SwClothImpl&>(cloth).mCloth;

	PX_ASSERT(spheres.empty() || spheres.size() == swCloth.mStartCollisionSpheres.size());
	PX_ASSERT(capsules.empty() || capsules.size() == swCloth.mCapsuleIndices.size()*2);
	PX_ASSERT(planes.empty() || planes.size() == swCloth.mStartCollisionPlanes.size());
	PX_ASSERT(convexes.empty() || convexes.size() == swCloth.mConvexMasks.size());
	PX_ASSERT(triangles.empty() || triangles.size() == swCloth.mStartCollisionTriangles.size());

	if (!swCloth.mStartCollisionSpheres.empty() && !spheres.empty())
		memcpy(spheres.begin(), &swCloth.mStartCollisionSpheres.front(),
			swCloth.mStartCollisionSpheres.size()*sizeof(PxVec4));

	if (!swCloth.mCapsuleIndices.empty() && !capsules.empty())
		memcpy(capsules.begin(), &swCloth.mCapsuleIndices.front(),
			swCloth.mCapsuleIndices.size()*sizeof(IndexPair));

	if (!swCloth.mStartCollisionPlanes.empty() && !planes.empty())
		memcpy(planes.begin(), &swCloth.mStartCollisionPlanes.front(),
			swCloth.mStartCollisionPlanes.size()*sizeof(PxVec4));

	if (!swCloth.mConvexMasks.empty() && !convexes.empty())
		memcpy(convexes.begin(), &swCloth.mConvexMasks.front(),
			swCloth.mConvexMasks.size()*sizeof(uint32_t));

	if (!swCloth.mStartCollisionTriangles.empty() && !triangles.empty())
		memcpy(triangles.begin(), &swCloth.mStartCollisionTriangles.front(),
			swCloth.mStartCollisionTriangles.size()*sizeof(PxVec3));
}

void cloth::SwFactory::extractMotionConstraints(const Cloth& cloth, Range<PxVec4> destConstraints) const
{
	PX_ASSERT(&cloth.getFactory() == this);

	const SwCloth& swCloth = static_cast<const SwClothImpl&>(cloth).mCloth;

	Vec4fAlignedVector const& srcConstraints = !swCloth.mMotionConstraints.mTarget.empty()
		? swCloth.mMotionConstraints.mTarget : swCloth.mMotionConstraints.mStart;

	if (!srcConstraints.empty())
	{
		// make sure dest array is big enough
		PX_ASSERT(destConstraints.size() == srcConstraints.size());

		memcpy(destConstraints.begin(), &srcConstraints.front(),
			srcConstraints.size()*sizeof(PxVec4));
	}
}

void cloth::SwFactory::extractSeparationConstraints(const Cloth& cloth, Range<PxVec4> destConstraints) const
{
	PX_ASSERT(&cloth.getFactory() == this);

	const SwCloth& swCloth = static_cast<const SwClothImpl&>(cloth).mCloth;

	Vec4fAlignedVector const& srcConstraints = !swCloth.mSeparationConstraints.mTarget.empty()
		? swCloth.mSeparationConstraints.mTarget : swCloth.mSeparationConstraints.mStart;

	if (!srcConstraints.empty())
	{
		// make sure dest array is big enough
		PX_ASSERT(destConstraints.size() == srcConstraints.size());

		memcpy(destConstraints.begin(), &srcConstraints.front(),
			srcConstraints.size()*sizeof(PxVec4));
	}
}

void cloth::SwFactory::extractParticleAccelerations(const Cloth& cloth, Range<PxVec4> destAccelerations) const
{
	PX_ASSERT(&cloth.getFactory() == this);

	const SwCloth& swCloth = static_cast<const SwClothImpl&>(cloth).mCloth;

	if (!swCloth.mParticleAccelerations.empty())
	{
		// make sure dest array is big enough
		PX_ASSERT(destAccelerations.size() == swCloth.mParticleAccelerations.size());

		memcpy(destAccelerations.begin(), &swCloth.mParticleAccelerations.front(),
			swCloth.mParticleAccelerations.size() * sizeof(PxVec4));
	}
}

void cloth::SwFactory::extractVirtualParticles(const Cloth& cloth,
	Range<uint32_t[4]> indices, Range<PxVec3> weights) const
{
	PX_ASSERT(this == &cloth.getFactory());

	const SwCloth& swCloth = static_cast<const SwClothImpl&>(cloth).mCloth;

	uint32_t numIndices = cloth.getNumVirtualParticles();
	uint32_t numWeights = cloth.getNumVirtualParticleWeights();

	PX_ASSERT(indices.size() == numIndices || indices.empty());
	PX_ASSERT(weights.size() == numWeights || weights.empty());

	if ( weights.size() == numWeights )
	{
		PxVec3* wDestIt = reinterpret_cast<PxVec3*>(weights.begin());

		// convert weights from vec4 to vec3
		cloth::Vec4fAlignedVector::ConstIterator wIt = swCloth.mVirtualParticleWeights.begin();
		cloth::Vec4fAlignedVector::ConstIterator wEnd= wIt + numWeights;

		for (; wIt != wEnd; ++wIt, ++wDestIt)
			*wDestIt = PxVec3(wIt->x, wIt->y, wIt->z);

		PX_ASSERT(wDestIt == weights.end());
	}
	if ( indices.size() == numIndices )
	{
		// convert indices
		Vec4u* iDestIt = reinterpret_cast<Vec4u*>(indices.begin());
		Vector<Vec4us>::Type::ConstIterator iIt = swCloth.mVirtualParticleIndices.begin();
		Vector<Vec4us>::Type::ConstIterator iEnd = swCloth.mVirtualParticleIndices.end();

		uint32_t numParticles = uint32_t(swCloth.mCurParticles.size());

		for (; iIt != iEnd; ++iIt)
		{
			// skip dummy indices
			if (iIt->x < numParticles)
				// byte offset to element index
				*iDestIt++ = Vec4u(*iIt);
		}

		PX_ASSERT(&array(*iDestIt) == indices.end());
	}
}

void cloth::SwFactory::extractSelfCollisionIndices(
	const Cloth& cloth, Range<uint32_t> destIndices ) const
{
	const SwCloth& swCloth = static_cast<const SwClothImpl&>(cloth).mCloth;
	PX_ASSERT(destIndices.size() == swCloth.mSelfCollisionIndices.size());
	copyToHost(swCloth.mSelfCollisionIndices.begin(),
		swCloth.mSelfCollisionIndices.end(), destIndices.begin());
}

void cloth::SwFactory::extractRestPositions(
	const Cloth& cloth, Range<PxVec4> destRestPositions ) const
{
	const SwCloth& cuCloth = static_cast<const SwClothImpl&>(cloth).mCloth;
	PX_ASSERT(destRestPositions.size() == cuCloth.mRestPositions.size());
	copyToHost(cuCloth.mRestPositions.begin(),
		cuCloth.mRestPositions.end(), destRestPositions.begin());
}


text:
import Ember from 'ember';
import EmberValidations from 'ember-validations';

const { computed, on } = Ember;

export default Ember.Mixin.create(
  EmberValidations, {

  /* Properties */

  formIsSubmitted: false,

  editing: computed(function() {
    return this.toString().indexOf('/edit:') > -1;
  }),

  hasFormMixin: computed(function() {
    return true;
  }).readOnly(),

  new: computed(function() {
    return this.toString().indexOf('/new:') > -1;
  }),

  /* Actions */

  actions: {

    /* Actions for child input groups */

    registerInputGroup(inputGroupComponent) {
      this.on('submission', function() {
        inputGroupComponent.send('showError');
      });
    },

    unregisterInputGroup(inputGroupComponent) {
      this.off('submission', function() {
        inputGroupComponent.send('showError');
      });
    },

    /* Form submission actions */

    cancel() {
      this.set('formIsSubmitted', true);
      this._eventHandler('cancel');
    },

    delete() {
      this.set('formIsSubmitted', true);
      this._eventHandler('delete');
    },

    /* Show validation errors on submit click */

    save() {
      this.set('formIsSubmitted', true);
      this.trigger('submission');
      this._eventHandler('save');
    },

  },

  /* Methods */

  resetForm: on('routeDidTransition', function() {
    this.resetSubmission();

    /* Add logic for resetting anything to do with
    input here */
  }),

  resetSubmission() {
    this.set('formIsSubmitted', false);
  },

  showServerError(/* xhr */) {
    this.resetSubmission();
  },

  validateThenSave() {
    const _this = this;

    function resolve() {
      Ember.assert(
        'You need to specify a save method on this controller',
        typeof _this.save === 'function'
      );

      _this.save();
    }

    function reject() {
      _this.set('formIsSubmitted', false);
    }

    /* If there is a custom validations method, resolve it */

    if (this.runCustomValidations) {
      const customValidationsPromise = this.runCustomValidations();

      if (!customValidationsPromise || !customValidationsPromise.then) {
        Ember.assert(
          'runCustomValidations() must return a promise (e.g. return new Ember.RSVP.Promise(...)).'
        );
      }

      customValidationsPromise.then(resolve, reject);
    } else {

      /* Else save with normal ember-validations checks */

      if (!this.get('isValid')) {
        reject();
      } else {
        resolve();
      }

    }
  },

  /* Private methods */

  _eventHandler(type) {
    const capitalizedType = Ember.String.capitalize(type);
    const handlerMethodName = `before${capitalizedType}`;
    const handler = this[handlerMethodName];

    function isFunction(key) {
      return Ember.typeOf(key) === 'function';
    }

    /* If event is save, method is renamed */

    if (type === 'save') {
      type = 'validateThenSave';
    }

    const method = this[type];

    Ember.assert(`You need to specify a ${type} method on this controller`, method && isFunction(method));

    /* If handler exists, resolve the promise then call
    the method... */

    if (handler) {
      Ember.assert(`${handlerMethodName}() must be a function`, isFunction(handler));

      const handlerPromise = handler();

      if (!handlerPromise.then) {
        Ember.assert('handler() must return a promise (e.g. return new Ember.RSVP.Promise(...))');
      }

      handlerPromise.then(function() {
        this[type]();
      }.bind(this));

    /* ...Else, just call the method */

    } else {
      this[type]();
    }

  },

});


text:
import {
  IApplication
} from 'ct';
import MainConfiguration from './Main.configuration';
import {RouterModule} from '../RouterModuleSetup';

class Main extends RouterModule implements IApplication {
  static Name: string = 'ratMain';
  static Dependencies: string[] = ['ui.router'];

  constructor() {
    super(Main.Name, Main.Dependencies);
    super.config(MainConfiguration);
  }

  bootstrap(): void {
    angular.bootstrap(document, [Main.Name], true);
  }
}

export default Main;


text:
import styled from 'styled-components'

// import type { TTestable } from '@/spec'

import Img from '@/Img'
import css, { theme } from '@/utils/css'

export const Wrapper = styled.div`
  ${css.flexColumn()};
  width: 200px;
  min-height: 100px;
  padding: 5px 10px;
`
export const Avatar = styled(Img)`
  ${css.circle(40)};
`
export const ShortBio = styled.div`
  color: ${theme('thread.articleDigest')};
  font-size: 12px;
  margin-top: 2px;
`
export const Info = styled.div`
  ${css.flexColumn()};
  margin-left: 12px;
`
export const Header = styled.div`
  ${css.flex('align-center')};
  margin-bottom: 10px;
`
export const Title = styled.a`
  text-decoration: none;
  font-size: 16px;
  font-weight: bold;

  &:hover {
    text-decoration: underline;
  }
`
export const Nickname = styled.div`
  color: ${theme('thread.articleTitle')};
  font-size: 15px;
`
export const Login = styled.div`
  color: ${theme('thread.articleDigest')};
  font-size: 13px;
`
export const Desc = styled.div`
  color: ${theme('thread.articleDigest')};
  font-size: 14px;
`


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >
    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        app:popupTheme="@style/ToolbarPopupTheme"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:title="@string/app_name"
        app:layout_constraintTop_toTopOf="parent"
        app:titleTextColor="@android:color/white"
        android:background="@color/colorAccent"
        />

    <Button
        android:text="create qrcode"
        android:id="@+id/btnCreateQrcode"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toBottomOf="@id/toolbar"
        />

    <Button
        android:id="@+id/btnScaner"
        android:text="scaner"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toBottomOf="@id/btnCreateQrcode"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        />

    <TextView
        android:textSize="20sp"
        android:id="@+id/tvReuslt"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        app:layout_constraintTop_toBottomOf="@id/btnScaner"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        />

    <Button
        android:visibility="gone"
        android:text="copy"
        android:id="@+id/btnCopy"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        app:layout_constraintTop_toBottomOf="@id/tvReuslt"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        />

</android.support.constraint.ConstraintLayout>


text:
namespace {

string TmpPath() {
  return "tmp";
}

class AppDir : public string {
 public:
  AppDir(const string& dir) {
    DirCreate(dir);
    DirCreate(JoinPath(dir, LibraryPath()));
    DirCreate(JoinPath(dir, TmpPath()));
    assign(dir);
  }
};

AppDir* kAppDir = NULL;

}  // namespace

void InitApplicationPath(const string& dir) {
  if (kAppDir == NULL) {
    kAppDir = new AppDir(dir);
  }
}

string JoinPath(const Slice& a, const Slice& b) {
  if (b.empty()) {
    return a.ToString();
  }
  if (!a.ends_with("/")) {
    return Format("%s/%s", a, b);
  }
  return Format("%s%s", a, b);
}

string HomeDir() {
  return *kAppDir;
}

string LibraryPath() {
  return "Library";
}

string LibraryDir() {
  return JoinPath(*kAppDir, LibraryPath());
}

string LoggingDir() {
  return JoinPath(LibraryDir(), "Logs");
}

string LoggingQueueDir() {
  return JoinPath(LoggingDir(), "Queue");
}

string TmpDir() {
  return JoinPath(*kAppDir, TmpPath());
}


text:
for type in Bold Light Medium Regular Retina; do
    wget -O ~/.local/share/fonts/FiraCode-${type}.ttf \
    "https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-${type}.ttf?raw=true";
done


text:
package de.codesourcery.jasm16.ast;

/**
 * A NO-OP {@link IASTVisitor} implementation.
 *
 * @author tobias.gierke@code-sourcery.de
 */
public class ASTVisitor implements IASTVisitor , IASTNodeVisitor<ASTNode> {

	@Override
	public final void visit(ASTNode n, IIterationContext context)
	{
		if ( n instanceof AST ) {
			visit( (AST) n , context );
	     } else if ( n instanceof IncludeSourceFileNode) {
	         visit( (IncludeSourceFileNode) n , context );
	     } else if ( n instanceof EquationNode) {
	         visit( (EquationNode) n , context );
	     } else if ( n instanceof OriginNode) {
	         visit( (OriginNode) n , context );
		} else if ( n instanceof IncludeBinaryFileNode) {
	        visit( (IncludeBinaryFileNode) n , context );
		} else if ( n instanceof CharacterLiteralNode) {
			visit( (CharacterLiteralNode) n , context );
		} else if ( n instanceof CommentNode) {
			visit( (CommentNode) n , context );
		} else if ( n instanceof ExpressionNode) {
			visit( (ExpressionNode) n , context );
		} else if ( n instanceof ExpressionNode) {
			visit( (ExpressionNode) n , context );
		} else if ( n instanceof InstructionNode) {
			visit( (InstructionNode) n , context );
		} else if ( n instanceof LabelNode) {
			visit( (LabelNode) n , context );
		} else if ( n instanceof SymbolReferenceNode) {
			visit( (SymbolReferenceNode) n , context );
		} else if ( n instanceof NumberNode) {
			visit( (NumberNode) n , context );
		} else if ( n instanceof OperandNode) {
			visit( (OperandNode) n , context );
		} else if ( n instanceof OperatorNode) {
			visit( (OperatorNode) n , context );
		} else if ( n instanceof RegisterReferenceNode) {
			visit( (RegisterReferenceNode) n , context );
		} else if ( n instanceof StatementNode) {
			visit( (StatementNode) n , context );
		} else if ( n instanceof InitializedMemoryNode) {
		    visit( (InitializedMemoryNode) n,context);
		} else if ( n instanceof UninitializedMemoryNode) {
			visit( (UninitializedMemoryNode) n , context );
		} else if ( n instanceof UnparsedContentNode) {
			visit( (UnparsedContentNode) n , context );
		} else if ( n instanceof IdentifierNode) {
			visit( (IdentifierNode) n , context );
		} else if ( n instanceof StartMacroNode ) {
			visit( (StartMacroNode) n , context );
		} else if ( n instanceof InvokeMacroNode) {
			visit( (InvokeMacroNode) n , context );
		} else if ( n instanceof EndMacroNode) {
			visit( (EndMacroNode) n , context );
		} else if ( n instanceof MacroParametersListNode) {
			visit( (MacroParametersListNode) n , context );
		} else if ( n instanceof MacroArgumentNode) {
			visit( (MacroArgumentNode) n , context );
		} else if ( n instanceof RawLineNode) {
			visit( (RawLineNode) n , context );
		} else {
			throw new RuntimeException("Unhandled node class: "+n.getClass());
		}
	}

	@Override
    public void visit(RawLineNode node,IIterationContext context) { }

    @Override
    public void visit(MacroArgumentNode node,IIterationContext context) { }

    @Override
    public void visit(IdentifierNode node,IIterationContext context) { }

    @Override
    public void visit(StartMacroNode node,IIterationContext context) { }

    @Override
    public void visit(InvokeMacroNode node,IIterationContext context) { }

    @Override
    public void visit(EndMacroNode node,IIterationContext context) { }

    @Override
    public void visit(MacroParametersListNode node,IIterationContext context) { }

    @Override
    public void visit(IncludeSourceFileNode node,IIterationContext context) { }

    @Override
    public void visit(EquationNode node,IIterationContext context) { }

    @Override
    public void visit(OriginNode node,IIterationContext context) { }

	@Override
    public void visit(IncludeBinaryFileNode node,IIterationContext context) { }

	@Override
	public void visit(AST node,IIterationContext context) { }

	@Override
	public void visit(InitializedMemoryNode node,IIterationContext context) { }

	@Override
	public void visit(CharacterLiteralNode node, IIterationContext context) { }

	@Override
	public void visit(CommentNode node, IIterationContext context) { }

	@Override
	public void visit(ExpressionNode node, IIterationContext context) {	}

	@Override
	public void visit(InstructionNode node, IIterationContext context) { }

	@Override
	public void visit(LabelNode node, IIterationContext context) { }

	@Override
	public void visit(SymbolReferenceNode node, IIterationContext context) {}

	@Override
	public void visit(NumberNode node, IIterationContext context) { }

	@Override
	public void visit(OperandNode node, IIterationContext context) {}

	@Override
	public void visit(OperatorNode node, IIterationContext context) {}

	@Override
	public void visit(RegisterReferenceNode node, IIterationContext context) {}

	@Override
	public void visit(StatementNode node, IIterationContext context) {}

	@Override
	public void visit(UninitializedMemoryNode node, IIterationContext context) {}

	@Override
	public void visit(UnparsedContentNode node, IIterationContext context) {}
}


text:
layout: post
title: 画像のアスペクト比を維持して拡縮
category : learning
---

jQueryの場合

javascriptの場合


text:
<?php
use phpforms\Form;

/* =============================================
    start session and include form class
============================================= */

session_start();
include_once rtrim($_SERVER['DOCUMENT_ROOT'], DIRECTORY_SEPARATOR) . '/phpforms/Form.php';
define('NUMBER_OF_STEPS', 5);
?>
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Step Customer Satisfaction Slide Form</title>

    <link href="../assets/css/bootstrap.min.css" rel="stylesheet">

Step Customer Satisfaction Slide Form

                <?php
                if (isset($sent_message)) {
                    echo $sent_message;
                }
                ?>
                <?php /* code preview button */
                    include_once '../assets/code-preview.php';
                ?>
                <legend>Customer Satisfaction Slide Step Form</legend>


text:
package com.facebook.buck.jvm.java.tracing;

import com.facebook.buck.core.model.BuildTarget;
import com.facebook.buck.event.AbstractBuckEvent;
import com.facebook.buck.event.EventKey;
import com.facebook.buck.event.WorkAdvanceEvent;
import com.google.common.collect.ImmutableMap;

/** Base class for events about the phases of compilation within javac. */
public abstract class JavacPhaseEvent extends AbstractBuckEvent implements WorkAdvanceEvent {
  public enum Phase {
    /** Parsing a single source file. Filename will be in the args. */
    PARSE(Constants.PARSE),
    /**
     * Entering all parse trees into the compiler's symbol tables. All filenames will be in the
     * args.
     */
    ENTER(Constants.ENTER),
    /** Overall annotation processing phase, including all rounds. No args. */
    ANNOTATION_PROCESSING(Constants.ANNOTATION_PROCESSING),
    /**
     * A single round of annotation processing, including running the relevant processors, parsing
     * any source files they create, then re-entering all previously parsed files into new symbol
     * tables. Round number and whether it's the last round will be in the args.
     */
    ANNOTATION_PROCESSING_ROUND(Constants.ANNOTATION_PROCESSING_ROUND),
    /**
     * Just running the annotation processors that are relevant to the sources being compiled. No
     * args.
     */
    RUN_ANNOTATION_PROCESSORS(Constants.RUN_ANNOTATION_PROCESSORS),
    /**
     * Analyze and transform the AST for a single type to prepare for code generation. Source file
     * and type being analyzed will be in the args.
     */
    ANALYZE(Constants.ANALYZE),
    /**
     * Generate a class file for a single type. Source file and type being generated will be in the
     * args.
     */
    GENERATE(Constants.GENERATE);

    private final String name;

    Phase(String name) {
      this.name = name;
    }

    public static Phase fromString(String value) {
      switch (value) {
        case Constants.PARSE:
          return PARSE;
        case Constants.ENTER:
          return ENTER;
        case Constants.ANNOTATION_PROCESSING:
          return ANNOTATION_PROCESSING;
        case Constants.ANNOTATION_PROCESSING_ROUND:
          return ANNOTATION_PROCESSING_ROUND;
        case Constants.RUN_ANNOTATION_PROCESSORS:
          return RUN_ANNOTATION_PROCESSORS;
        case Constants.ANALYZE:
          return ANALYZE;
        case Constants.GENERATE:
          return GENERATE;
        default:
          throw new IllegalArgumentException(
              Phase.class.getName() + " cannot be created from value " + value);
      }
    }

    @Override
    public String toString() {
      return name;
    }
  }

  public static class Constants {
    public static final String PARSE = "parse";
    public static final String ENTER = "enter";
    public static final String ANNOTATION_PROCESSING = "annotation processing";
    public static final String ANNOTATION_PROCESSING_ROUND = "annotation processing round";
    public static final String RUN_ANNOTATION_PROCESSORS = "run annotation processors";
    public static final String ANALYZE = "analyze";
    public static final String GENERATE = "generate";
  }

  private final BuildTarget buildTarget;
  private final Phase phase;
  private final ImmutableMap<String, String> args;

  protected JavacPhaseEvent(
      EventKey eventKey, BuildTarget buildTarget, Phase phase, ImmutableMap<String, String> args) {
    super(eventKey);
    this.buildTarget = buildTarget;
    this.phase = phase;
    this.args = args;
  }

  public BuildTarget getBuildTarget() {
    return buildTarget;
  }

  public Phase getPhase() {
    return phase;
  }

  public ImmutableMap<String, String> getArgs() {
    return args;
  }

  @Override
  protected String getValueString() {
    return buildTarget.toString();
  }

  public static Started started(
      BuildTarget buildTarget, Phase phase, ImmutableMap<String, String> args) {
    return new Started(buildTarget, phase, args);
  }

  public static Finished finished(Started startedEvent, ImmutableMap<String, String> args) {
    return new Finished(startedEvent, args);
  }

  public static class Started extends JavacPhaseEvent {
    public Started(BuildTarget buildTarget, Phase phase, ImmutableMap<String, String> args) {
      super(EventKey.unique(), buildTarget, phase, args);
    }

    @Override
    public String getEventName() {
      return String.format("javac.%sStarted", getPhase().toString());
    }
  }

  public static class Finished extends JavacPhaseEvent {
    public Finished(Started startedEvent, ImmutableMap<String, String> args) {
      super(
          startedEvent.getEventKey(), startedEvent.getBuildTarget(), startedEvent.getPhase(), args);
    }

    @Override
    public String getEventName() {
      return String.format("javac.%sFinished", getPhase().toString());
    }
  }
}


text:
<application>
  <component name="NotificationConfiguration">
    <notification groupId="Unindexed maven repositories gradle detection" displayType="NONE" shouldLog="false" />
  </component>
</application>