text:
package com.google.inject.testing.fieldbinder;

import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.inject.Binder;
import com.google.inject.BindingAnnotation;
import com.google.inject.ConfigurationException;
import com.google.inject.Key;
import com.google.inject.Module;
import com.google.inject.Provider;
import com.google.inject.TypeLiteral;
import com.google.inject.binder.AnnotatedBindingBuilder;
import com.google.inject.binder.LinkedBindingBuilder;
import com.google.inject.internal.Annotations;
import com.google.inject.internal.MoreTypes;
import com.google.inject.internal.Nullability;
import com.google.inject.spi.Message;
import com.google.inject.util.Providers;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

/**
 * Automatically creates Guice bindings for fields in an object annotated with {@link Bind}.
 *
 *
This module is intended for use in tests to reduce the code needed to bind local fields
 * (usually mocks) for injection.
 *
 *
The following rules are followed in determining how fields are bound using this module:
 *
 *

 *
For each {@link Bind} annotated field of an object and its superclasses, this module will
 *       bind that field's type to that field's value at injector creation time. This includes both
 *       instance and static fields.
 *
If {@link Bind#to} is specified, the field's value will be bound to the class specified by
 *       {@link Bind#to} instead of the field's actual type.
 *
If {@link Bind#lazy} is true, this module will delay reading the value from the field until
 *       injection time, allowing the field's value to be reassigned during the course of a test's
 *       execution.
 *
If a {@link BindingAnnotation} or {@link javax.inject.Qualifier} is present on the field,
 *       that field will be bound using that annotation via {@link
 *       AnnotatedBindingBuilder#annotatedWith}. For example, {@code
 *       bind(Foo.class).annotatedWith(BarAnnotation.class).toInstance(theValue)}. It is an error to
 *       supply more than one {@link BindingAnnotation} or {@link javax.inject.Qualifier}.
 *
If the field is of type {@link Provider}, the field's value will be bound as a {@link
 *       Provider} using {@link LinkedBindingBuilder#toProvider} to the provider's parameterized
 *       type. For example, {@code Provider<Integer>} binds to {@link Integer}. Attempting to bind a
 *       non-parameterized {@link Provider} without a {@link Bind#to} clause is an error.
 *

 *
 *
Example use:
 *
 *

 * public class TestFoo {
 *   // bind(new TypeLiteral{@code <List<Object>>}() {}).toInstance(listOfObjects);
 *   {@literal @}Bind private List{@code <Object>} listOfObjects = Lists.of();
 *
 *   // private String userName = "string_that_changes_over_time";
 *   // bind(String.class).toProvider(new Provider() { public String get() { return userName; }});
 *   {@literal @}Bind(lazy = true) private String userName;
 *
 *   // bind(SuperClass.class).toInstance(aSubClass);
 *   {@literal @}Bind(to = SuperClass.class) private SubClass aSubClass = new SubClass();
 *
 *   // bind(String.class).annotatedWith(MyBindingAnnotation.class).toInstance(myString);
 *   {@literal @}Bind
 *   {@literal @}MyBindingAnnotation
 *   private String myString = "hello";
 *
 *   // bind(Object.class).toProvider(myProvider);
 *   {@literal @}Bind private Provider{@code <Object>} myProvider = getProvider();
 *
 *   {@literal @}Before public void setUp() {
 *     Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
 *   }
 * }
 *

 *
 * @see Bind
 * @author eatnumber1@google.com (Russ Harmon)
 */
public final class BoundFieldModule implements Module {
  private final Object instance;
  private final ImmutableList<Message> deferredBindingErrors;
  private final ImmutableSet<BoundFieldInfo> boundFields;

  private BoundFieldModule(Object instance) {
    this.instance = instance;

    ImmutableList.Builder<Message> deferredErrors = ImmutableList.builder();
    boundFields = findBindableFields(deferredErrors);
    deferredBindingErrors = deferredErrors.build();
  }

  /**
   * Create a BoundFieldModule which binds the {@link Bind} annotated fields of {@code instance}.
   *
   * @param instance the instance whose fields will be bound.
   * @return a module which will bind the {@link Bind} annotated fields of {@code instance}.
   */
  public static BoundFieldModule of(Object instance) {
    return new BoundFieldModule(instance);
  }

  private static class BoundFieldException extends Exception {
    private final Message message;

    BoundFieldException(Message message) {
      super(message.getMessage());
      this.message = message;
    }
  }

  private static class NullBoundFieldValueException extends RuntimeException {
    private final Message message;

    NullBoundFieldValueException(Message message) {
      super(message.toString());
      this.message = message;
    }
  }

  /** Information about a field bound by {@link BoundFieldModule}. */
  public static final class BoundFieldInfo {
    private final Object instance;
    private final Field field;
    private final TypeLiteral<?> fieldType;
    private final Bind bindAnnotation;

    /** @see #getBoundKey */
    private final Key<?> boundKey;

    private BoundFieldInfo(
        Object instance, Field field, Bind bindAnnotation, TypeLiteral<?> fieldType)
        throws BoundFieldException {
      this.instance = instance;
      this.field = field;
      this.fieldType = fieldType;
      this.bindAnnotation = bindAnnotation;

      field.setAccessible(true);
      Annotation bindingAnnotation = computeBindingAnnotation();
      Optional<TypeLiteral<?>> naturalType = computeNaturalFieldType();
      this.boundKey = computeKey(naturalType, bindingAnnotation);
      checkBindingIsAssignable(field, naturalType);
    }

    private void checkBindingIsAssignable(Field field, Optional<TypeLiteral<?>> naturalType)
        throws BoundFieldException {
      if (naturalType.isPresent()) {
        Class<?> boundRawType = boundKey.getTypeLiteral().getRawType();
        Class<?> naturalRawType = MoreTypes.canonicalizeForKey(naturalType.get()).getRawType();
        if (!boundRawType.isAssignableFrom(naturalRawType)) {
          throw new BoundFieldException(
              new Message(
                  field,
                  String.format(
                      "Requested binding type \"%s\" is not assignable "
                          + "from field binding type \"%s\"",
                      boundRawType.getName(), naturalRawType.getName())));
        }
      }
    }

    /** The field itself. */
    public Field getField() {
      return field;
    }

    /**
     * The actual type of the field.
     *
     *
For example, {@code @Bind(to = Object.class) Number one = new Integer(1);} will be {@code
     * Number}. {@code @Bind Provider<Number>} will be {@code Provider<Number>}.
     */
    public TypeLiteral<?> getFieldType() {
      return fieldType;
    }

    /**
     * The {@literal @}{@link Bind} annotation which is present on the field.
     *
     *
Note this is not the same as the binding annotation (or qualifier) for {@link
     * #getBoundKey()}
     */
    public Bind getBindAnnotation() {
      return bindAnnotation;
    }

    /**
     * The key this field will bind to.
     *
     *

     *
{@code @Bind(to = Object.class) @MyQualifier Number one = new Integer(1);} will be
     *       {@code @MyQualifier Object}.
     *
{@code @Bind @MyQualifier(2) Number one = new Integer(1);} will be
     *       {@code @MyQualifier(2) Number}.
     *
{@code @Bind @MyQualifier Provider<String> three = "default"} will be
     *       {@code @MyQualfier String}
     *

     */
    public Key<?> getBoundKey() {
      return boundKey;
    }

    /** Returns the current value of this field. */
    public Object getValue() {
      try {
        return field.get(instance);
      } catch (IllegalAccessException e) {
        // Since we called setAccessible(true) on this field in the constructor, this is a
        // programming error if it occurs.
        throw new AssertionError(e);
      }
    }

    private Annotation computeBindingAnnotation() throws BoundFieldException {
      Annotation found = null;
      for (Annotation annotation : field.getAnnotations()) {
        Class<? extends Annotation> annotationType = annotation.annotationType();
        if (Annotations.isBindingAnnotation(annotationType)) {
          if (found != null) {
            throw new BoundFieldException(
                new Message(field, "More than one annotation is specified for this binding."));
          }
          found = annotation;
        }
      }
      return found;
    }

    private Key<?> computeKey(Optional<TypeLiteral<?>> naturalType, Annotation bindingAnnotation)
        throws BoundFieldException {
      TypeLiteral<?> boundType = computeBoundType(naturalType);
      if (bindingAnnotation == null) {
        return Key.get(boundType);
      } else {
        return Key.get(boundType, bindingAnnotation);
      }
    }

    private TypeLiteral<?> computeBoundType(Optional<TypeLiteral<?>> naturalType)
        throws BoundFieldException {
      Class<?> bindClass = bindAnnotation.to();
      // Bind#to's default value is Bind.class which is used to represent that no explicit binding
      // type is requested.
      if (bindClass == Bind.class) {
        Preconditions.checkState(naturalType != null);
        if (!naturalType.isPresent()) {
          throw new BoundFieldException(
              new Message(
                  field,
                  "Non parameterized Provider fields must have an explicit "
                      + "binding class via @Bind(to = Foo.class)"));
        }
        return naturalType.get();
      } else {
        return TypeLiteral.get(bindClass);
      }
    }

    /**
     * Retrieves the type this field binds to naturally.
     *
     *
A field's "natural" type specifically ignores the to() method on the @Bind annotation, is
     * the parameterized type if the field's actual type is a parameterized {@link Provider}, is
     * {@link Optional#absent()} if this field is a non-parameterized {@link Provider} and otherwise
     * is the field's actual type.
     *
     * @return the type this field binds to naturally, or {@link Optional#absent()} if this field is
     *     a non-parameterized {@link Provider}.
     */
    private Optional<TypeLiteral<?>> computeNaturalFieldType() {
      if (isTransparentProvider(fieldType.getRawType())) {
        Type providerType = fieldType.getType();
        if (providerType instanceof Class) {
          return Optional.absent();
        }
        Preconditions.checkState(providerType instanceof ParameterizedType);
        Type[] providerTypeArguments = ((ParameterizedType) providerType).getActualTypeArguments();
        Preconditions.checkState(providerTypeArguments.length == 1);
        return Optional.<TypeLiteral<?>>of(TypeLiteral.get(providerTypeArguments[0]));
      } else {
        return Optional.<TypeLiteral<?>>of(fieldType);
      }
    }

    /** Returns whether a binding supports null values. */
    private boolean allowsNull() {
      return !isTransparentProvider(fieldType.getRawType())
          && Nullability.allowsNull(field.getAnnotations());
    }
  }

  /** Returns the the object originally passed to {@link BoundFieldModule#of}). */
  public Object getInstance() {
    return instance;
  }

  /**
   * Returns information about the fields bound by this module.
   *
   *
Note this is available immediately after construction, fields with errors won't be included
   * but their error messages will be deferred to configuration time.
   *
   *
Fields with invalid null values are included but still cause errors at
   * configuration time.
   */
  public ImmutableSet<BoundFieldInfo> getBoundFields() {
    return boundFields;
  }

  private ImmutableSet<BoundFieldInfo> findBindableFields(
      ImmutableList.Builder<Message> deferredErrors) {
    ImmutableSet.Builder<BoundFieldInfo> fieldInfos = ImmutableSet.builder();
    TypeLiteral<?> currentClassType = TypeLiteral.get(instance.getClass());
    while (currentClassType.getRawType() != Object.class) {
      for (Field field : currentClassType.getRawType().getDeclaredFields()) {
        Optional<BoundFieldInfo> fieldInfoOpt =
            getBoundFieldInfo(currentClassType, field, deferredErrors);
        if (fieldInfoOpt.isPresent()) {
          fieldInfos.add(fieldInfoOpt.get());
        }
      }
      currentClassType =
          currentClassType.getSupertype(currentClassType.getRawType().getSuperclass());
    }
    return fieldInfos.build();
  }

  /**
   * Retrieve a {@link BoundFieldInfo}.
   *
   *
This returns a {@link BoundFieldInfo} if the field has a {@link Bind} annotation. Otherwise
   * it returns {@link Optional#absent()}.
   */
  private Optional<BoundFieldInfo> getBoundFieldInfo(
      TypeLiteral<?> containingClassType,
      Field field,
      ImmutableList.Builder<Message> deferredErrors) {
    Bind bindAnnotation = field.getAnnotation(Bind.class);
    if (bindAnnotation == null) {
      return Optional.absent();
    }
    if (hasInject(field)) {
      deferredErrors.add(
          new Message(field, "Fields annotated with both @Bind and @Inject are illegal."));
      return Optional.absent();
    }
    try {
      return Optional.of(
          new BoundFieldInfo(
              instance, field, bindAnnotation, containingClassType.getFieldType(field)));
    } catch (ConfigurationException e) { // thrown from Key.get, MoreTypes.canonicalizeForKey
      deferredErrors.addAll(e.getErrorMessages());
      return Optional.absent();
    } catch (BoundFieldException e) {
      deferredErrors.add(e.message);
      return Optional.absent();
    }
  }

  private static boolean hasInject(Field field) {
    return field.isAnnotationPresent(javax.inject.Inject.class)
        || field.isAnnotationPresent(com.google.inject.Inject.class);
  }

  /**
   * Determines if {@code clazz} is a "transparent provider".
   *
   *
If you have traced through the code and found that what you want to do is failing because of
   * this check, try using {@code @Bind(lazy=true) MyType myField} and lazily assign myField
   * instead.
   *
   *
A transparent provider is a {@link com.google.inject.Provider} or {@link
   * javax.inject.Provider} which binds to it's parameterized type when used as the argument to
   * {@link Binder#bind}.
   *
   *
A {@link Provider} is transparent if the base class of that object is {@link Provider}. In
   * other words, subclasses of {@link Provider} are not transparent. As a special case, if a {@link
   * Provider} has no parameterized type but is otherwise transparent, then it is considered
   * transparent.
   *
   *
Subclasses of {@link Provider} are not considered transparent in order to allow users to
   * bind those subclasses directly, enabling them to inject the providers themselves.
   */
  private static boolean isTransparentProvider(Class<?> clazz) {
    return com.google.inject.Provider.class == clazz || javax.inject.Provider.class == clazz;
  }

  private static void bindField(Binder binder, final BoundFieldInfo fieldInfo) {
    LinkedBindingBuilder<?> linkedBinder = binder.bind(fieldInfo.boundKey);

    // It's unfortunate that Field.get() just returns Object rather than the actual type (although
    // that would be impossible) because as a result calling binder.toInstance or binder.toProvider
    // is impossible to do without an unchecked cast. This is safe if fieldInfo.naturalType is
    // present because compatibility is checked explicitly above, but is _unsafe_ if
    // fieldInfo.naturalType is absent which occurrs when a non-parameterized Provider is used with
    // @Bind(to = ...)
    @SuppressWarnings("unchecked")
    AnnotatedBindingBuilder<Object> binderUnsafe = (AnnotatedBindingBuilder<Object>) linkedBinder;

    if (isTransparentProvider(fieldInfo.fieldType.getRawType())) {
      if (fieldInfo.bindAnnotation.lazy()) {
        binderUnsafe.toProvider(
            new Provider<Object>() {
              @Override
              // @Nullable
              public Object get() {
                // This is safe because we checked that the field's type is Provider above.
                @SuppressWarnings("unchecked")
                javax.inject.Provider<?> provider =
                    (javax.inject.Provider<?>) getFieldValue(fieldInfo);
                return provider.get();
              }
            });
      } else {
        // This is safe because we checked that the field's type is Provider above.
        @SuppressWarnings("unchecked")
        javax.inject.Provider<?> fieldValueUnsafe =
            (javax.inject.Provider<?>) getFieldValue(fieldInfo);
        binderUnsafe.toProvider(fieldValueUnsafe);
      }
    } else if (fieldInfo.bindAnnotation.lazy()) {
      binderUnsafe.toProvider(
          new Provider<Object>() {
            @Override
            // @Nullable
            public Object get() {
              return getFieldValue(fieldInfo);
            }
          });
    } else {
      Object fieldValue = getFieldValue(fieldInfo);
      if (fieldValue == null) {
        binderUnsafe.toProvider(Providers.of(null));
      } else {
        binderUnsafe.toInstance(fieldValue);
      }
    }
  }

  // @Nullable
  /**
   * Returns the field value to bind, throwing for non-{@code @Nullable} fields with null values,
   * and for null "transparent providers".
   */
  private static Object getFieldValue(final BoundFieldInfo fieldInfo) {
    Object fieldValue = fieldInfo.getValue();
    if (fieldValue == null && !fieldInfo.allowsNull()) {
      if (isTransparentProvider(fieldInfo.fieldType.getRawType())) {
        throw new NullBoundFieldValueException(
            new Message(
                fieldInfo.field,
                "Binding to null is not allowed. Use Providers.of(null) if this is your intended "
                    + "behavior."));
      } else {
        throw new NullBoundFieldValueException(
            new Message(
                fieldInfo.field,
                "Binding to null values is only allowed for fields that are annotated @Nullable."));
      }
    }
    return fieldValue;
  }

  @Override
  public void configure(Binder binder) {
    binder = binder.skipSources(BoundFieldModule.class);

    for (Message message : deferredBindingErrors) {
      binder.addError(message);
    }

    for (BoundFieldInfo fieldInfo : boundFields) {
      try {
        bindField(binder, fieldInfo);
      } catch (NullBoundFieldValueException e) {
        // Defer errors for all eagerly bound null values
        binder.addError(e.message);
      }
    }
  }
}


text:
{% extends path+"/_layout-case-simple4.html" %}

{% block actioncolumn %}

Return to case list

Portal designs

{% endblock %}

{% block citizen_detail %}
Kenneth Robertson
{% endblock %}

{% block citizen_content %}

{% if data['evidencePath']=='ev-ftf'%}

	{% if data['evidenceRecorded']=='record-yes'%}

		{% if data['pbachoice']%}

	{% else %}

New evidence recorded

	         1

Roberto's case should be reviewed before making a recommendation

	         2

Make recommendation

	{% endif %}

	{% endif %}

	{% endif %}

    {# macro #}
  {{ nav.scenario_tabs("details-fme",1,path1, customer._id) }}

Back

  	Kenneth's contact details

Contact information

							Contact number
							0151 000 0000

							Email address
							kenneth.robertson@kennyrobbo.com

							Preferred contact method
							Email

							Address

								860 Liverpool Lane
								Bolton
								Lancashire
								TXX ZZZ

							Is address used for correspondence
							Yes

Edit details

{% endblock %}

{# {% block page_script %}

{% endblock %} #}

redpajama_set_name: RedPajamaGithub


text:
package com.alibaba.dubbo.rpc.cluster;

import com.alibaba.dubbo.common.extension.SPI;

/**
 * 将多个对象合并成一个对象
 * @author kimi
 */
@SPI
public interface Merger<T> {

    T merge(T... items);

}


text:
<?php

namespace ZendQueueTest\Adapter;

use ZendQueue\Queue;
use ZendQueue\Adapter;

/**
 * @category   Zend
 * @package    ZendQueue\Queue
 * @subpackage UnitTests
 */
class AmqpTest extends AdapterTest
{
    /**
     * (non-PHPdoc)
     * @see PHPUnit_Framework_TestCase::tearDown()
     */
    public function tearDown()
    {
        if (!$queue = $this->createQueue($this->getName())) {
            return;
        }
        $adapter = $queue->getAdapter();
        $adapter->getQueue()->deleteQueue();
        parent::tearDown();
    }

    /**
     * (non-PHPdoc)
     * @see \ZendQueueTest\Adapter\AdapterTest::getAdapterName()
     */
    public function getAdapterName()
    {
        return 'Amqp';
    }

    /**
     * (non-PHPdoc)
     * @see \ZendQueueTest\Adapter\AdapterTest::getAdapterFullName()
     */
    public function getAdapterFullName()
    {
        return '\ZendQueue\Adapter\\' . $this->getAdapterName();
    }

    /**
     * (non-PHPdoc)
     * @see \ZendQueueTest\Adapter\AdapterTest::getTestConfig()
     */
    public function getTestConfig()
    {
        $driverOptions = array();
        if (defined('TESTS_ZEND_QUEUE_AMQP_HOST')) {
            $driverOptions['host'] = TESTS_ZEND_QUEUE_AMQP_HOST;
        }
        if (defined('TESTS_ZEND_QUEUE_AMQP_PORT')) {
            $driverOptions['port'] = TESTS_ZEND_QUEUE_AMQP_PORT;
        }
        if (defined('TESTS_ZEND_QUEUE_AMQP_USER')) {
            $driverOptions['user'] = TESTS_ZEND_QUEUE_AMQP_USER;
        }
        if (defined('TESTS_ZEND_QUEUE_AMQP_PASS')) {
            $driverOptions['pass'] = TESTS_ZEND_QUEUE_AMQP_PASS;
        }
        if (defined('TESTS_ZEND_QUEUE_AMQP_VHOST')) {
            $driverOptions['vhost'] = TESTS_ZEND_QUEUE_AMQP_VHOST;
        }
        if (defined('TESTS_ZEND_QUEUE_AMQP_DEBUG')) {
            $driverOptions['debug'] = TESTS_ZEND_QUEUE_AMQP_DEBUG;
        }
        return array('driverOptions' => $driverOptions);
    }

    /**
     *
     */
    public function testFailedConstructor()
    {
        try {
            $queue = $this->createQueue(__FUNCTION__, array());
            /*
             * delete the queue we created
             */
            $queue->deleteQueue();
            $this->fail('The test should fail if no host and password are passed');
        } catch (\Exception $e) {
            $this->assertTrue( true, 'Job Queue host and password should be provided');
        }
    }

    /**
     * (non-PHPdoc)
     * @see \ZendQueueTest\Adapter\AdapterTest::testConst()
     */
    public function testConst()
    {
        $this->assertTrue(is_string(Adapter\Amqp::DEFAULT_HOST));
        $this->assertTrue(is_integer(Adapter\Amqp::DEFAULT_PORT));
        $this->assertTrue(is_string(Adapter\Amqp::DEFAULT_USER));
        $this->assertTrue(is_string(Adapter\Amqp::DEFAULT_PASS));
        $this->assertTrue(is_string(Adapter\Amqp::DEFAULT_VHOST));
        $this->assertTrue(is_bool(Adapter\Amqp::DEFAULT_DEBUG));
    }

    /**
     * (non-PHPdoc)
     * @see \ZendQueueTest\Adapter\AdapterTest::testSampleBehavior()
     */
    public function testSampleBehavior()
    {
        if (!$queue = $this->createQueue(__FUNCTION__)) {
            return;
        }
        $this->assertTrue($queue instanceof Queue);

        if ($queue->isSupported('send')) {
            $msg = 1;

            for($i = 0; $i < 10; $i++) {
                $queue->send("$msg");
                $msg ++;
            }
        }

        if ($queue->isSupported('receive')) {
            $msg = 1;
            $messages = $queue->receive(5);
            foreach($messages as $i => $message) {
                $this->assertEquals($msg, $message->body);
                $queue->deleteMessage($message);
                $msg++;
            }
        }

        $this->assertEquals(5, count($queue));
        $this->assertTrue($queue->deleteQueue());
        /*
         * delete the queue we created
         */
        $queue->deleteQueue();
    }
}


text:
package org.apache.edgent.connectors.wsclient;

import org.apache.edgent.topology.TSink;
import org.apache.edgent.topology.TStream;
import org.apache.edgent.topology.TopologyElement;

import com.google.gson.JsonObject;

/**
 * A generic connector for sending and receiving messages to a WebSocket Server.
 *

 * A connector is bound to its configuration specified
 * {@code javax.websockets} WebSocket URI.
 *

 * A single connector instance supports sinking at most one stream
 * and sourcing at most one stream.
 *

 * Sample use:
 *
{@code
 * // assuming a properties file containing at least:
 * // ws.uri=ws://myWsServerHost/myService
 *
 * String propsPath = <path to properties file>;
 * Properties properties = new Properties();
 * properties.load(Files.newBufferedReader(new File(propsPath).toPath()));
 *
 * Topology t = ...;
 * Jsr356WebSocketClient wsclient = new SomeWebSocketClient(t, properties);
 *
 * // send a stream's JsonObject tuples as JSON WebSocket text messages
 * TStream<JsonObject> s = ...;
 * wsclient.send(s);
 *
 * // create a stream of JsonObject tuples from received JSON WebSocket text messages
 * TStream<JsonObject> r = wsclient.receive();
 * r.print();
 * }

 *

 * Note, the WebSocket protocol differentiates between text/String and
 * binary/byte messages.
 * A receiver only receives the messages of the type that it requests.
 *

 * Implementations are strongly encouraged to support construction from
 * Properties with the following configuration parameters:
 *

 *
ws.uri - "ws://host[:port][/path]", "wss://host[:port][/path]"
 *   the default port is 80 and 443 for "ws" and "wss" respectively.
 *   The optional path must match the server's configuration.

 *
ws.trustStore - optional. Only used with "wss:".
 *     Path to trust store file in JKS format.
 *     If not set, the standard JRE and javax.net.ssl system properties
 *     control the SSL behavior.
 *     Generally not required if server has a CA-signed certificate.

 *
ws.trustStorePassword - required if ws.trustStore is set

 *
ws.keyStore - optional. Only used with "wss:" when the
 *     server is configured for client auth.
 *     Path to key store file in JKS format.
 *     If not set, the standard JRE and javax.net.ssl system properties
 *     control the SSL behavior.

 *
ws.keyStorePassword - required if ws.keyStore is set.

 *
ws.keyPassword - defaults to ws.keyStorePassword value

 *
ws.keyCertificateAlias - alias for certificate in key store. defaults to "default"

 *

 */
public interface WebSocketClient extends TopologyElement {

    /**
     * Send a stream's JsonObject tuples as JSON in a WebSocket text message.
     * @param stream the stream
     * @return sink
     */
    TSink<JsonObject> send(TStream<JsonObject> stream);

    /**
     * Send a stream's String tuples in a WebSocket text message.
     * @param stream the stream
     * @return sink
     */
    TSink<String> sendString(TStream<String> stream);

    /**
     * Send a stream's byte[] tuples in a WebSocket binary message.
     * @param stream the stream
     * @return sink
     */
    TSink<byte[]> sendBytes(TStream<byte[]> stream);

    /**
     * Create a stream of JsonObject tuples from received JSON WebSocket text messages.
     * @return the stream
     */
    TStream<JsonObject> receive();

    /**
     * Create a stream of String tuples from received WebSocket text messages.
     *

     * Note, the WebSocket protocol differentiates between text/String and
     * binary/byte messages.  This method only receives messages sent as text.
     *
     * @return the stream
     */
    TStream<String> receiveString();

    /**
     * Create a stream of byte[] tuples from received WebSocket binary messages.
     *

     * Note, the WebSocket protocol differentiates between text/String and
     * binary/byte messages.  This method only receives messages sent as bytes.
     *
     * @return the stream
     */
    TStream<byte[]> receiveBytes();

}


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

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <title>Qt 4.8: Using ActiveX controls and COM in Qt</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />

  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />

      Home

    Qt Reference Documentation

Qt HOME

DEV

          DOC

BLOG

Qt 4.8

ALL VERSIONS

API Lookup

Class index

Function index

Modules

Namespaces

Global Declarations

QML elements

Qt Topics

Programming with Qt

Device UIs & Qt Quick

UI Design with Qt

Supported Platforms

Qt and Key Technologies

How-To's and Best Practices

Examples

Examples

Tutorials

Demos

QML Examples

          Search index:

          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />

 Close

All | API | Articles | Examples

 results:

            </fieldset>
          </form>

            API Lookup

Class index

Function index

Modules

Namespaces

Global Declarations

QML elements

            Qt Topics

Programming with Qt

Device UIs & Qt Quick

UI Design with Qt

Supported Platforms

Qt and Key Technologies

How-To's and Best Practices

            Examples

Examples

Tutorials

Demos

QML Examples

Home

Using ActiveX controls and COM in Qt

A

A

A

                Print

Contents

Using the Library

Distributing QAxContainer Applications

Instantiating COM Objects

Typical Error Messages

Requested control could not be instantiated

Accessing the Object API

Generating a C++ Namespace

Call-by-Name

Calling Function Through a Script Engine

Calling a Function Using the Native COM Interfaces

Typical Error Messages

QAxBase::internalInvoke: No such method

Error calling IDispatch member: Non-optional parameter missing

Error calling IDispatch member: Type mismatch in parameter n

QAxScriptManager::call(): No script provides this function

Using ActiveX controls and COM in Qt

The QAxContainer module is part of the ActiveQt framework. It provides a library implementing a QWidget subclass, QAxWidget, that acts as a container for ActiveX controls, and a QObject subclass, QAxObject, that can be used to easily access non-visual COM objects. Scripting COM objects embedded using these classes is possible through the QAxScript, QAxScriptManager and QAxScriptEngine classes, and a set of tools makes it easy to access COM objects programmatically.

The module consists of six classes

QAxBase is an abstract class that provides an API to initialize and access a COM object or ActiveX control.

QAxObject provides a QObject that wraps a COM object.

QAxWidget is a QWidget that wraps an ActiveX control.

QAxScriptManager, QAxScript and QAxScriptEngine provide an interface to the Windows Script Host.

Some example applications that use standard ActiveX controls to provide high-level user interface functionality are provided.

Topics:

Using the Library

To build Qt applications that can host COM objects and ActiveX controls link the application against the QAxContainer module by adding

 CONFIG += qaxcontainer

to your application's <tt>.pro</tt> file.

Distributing QAxContainer Applications

The QAxContainer library is static, so there is no need to redistribute any additional files when using this module. Note however that the ActiveX server binaries you are using might not be installed on the target system, so you have to ship them with your package and register them during the installation process of your application.

Instantiating COM Objects

To instantiate a COM object use the QAxBase::setControl() API, or pass the name of the object directly into the constructor of the QAxBase subclass you are using.

The control can be specified in a variety of formats, but the fastest and most powerful format is to use the class ID (CLSID) of the object directly. The class ID can be prepended with information about a remote machine that the object should run on, and can include a license key for licensed controls.

Typical Error Messages

ActiveQt prints error messages to the debug output when it encounters error situations at runtime. Usually you must run your program in the debugger to see these messages (e.g. in Visual Studio's Debug output).

Requested control could not be instantiated

The control requested in QAxBase::setControl() is not installed on this system, or is not accessible for the current user.

The control might require administrator rights, or a license key. If the control is licensed, pass the license key to QAxBase::setControl as documented.

Accessing the Object API

ActiveQt provides a Qt API to the COM object, and replaces COM datatypes with Qt equivalents.

There are four ways to call APIs on the COM object:

Generating a C++ namespace

Call-by-name

Through a script engine

Using the native COM interfaces

Generating a C++ Namespace

To generate a C++ namespace for the type library you want to access, use the dumpcpp tool. Run this tool manually on the type library you want to use, or integrate it into the build system by adding the type libraries to the <tt>TYPELIBS</tt> variable in your application's <tt>.pro</tt> file:

 TYPELIBS = file.tlb

Note that dumpcpp might not be able to expose all APIs in the type library.

Include the resulting header file in your code to access the object APIs through the generated C++ classes. See the Qutlook example for more information.

Call-by-Name

Use QAxBase::dynamicCall() and QAxBase::querySubObject() as well as the QObject::setProperty() and QObject::property() APIs to call the methods and properties of the COM object through their name. Use the dumpdoc tool to get the documentation of the Qt API for any COM object and its subobjects; note that not all of the COM object's APIs might be available.

See the Webbrowser example for more information.

Calling Function Through a Script Engine

A Qt application can host any ActiveScript engine installed on the system. The script engine can then run script code that accesses the COM objects.

To instantiate a script engine, use QAxScriptManager::addObject() to register the COM objects you want to access from script, and QAxScriptManager::load() to load the script code into the engine. Then call the script functions using QAxScriptManager::call() or QAxScript::call().

Which APIs of the COM object are available through scripting depends on the script language used.

The ActiveX Test Container demonstrates loading of script files.

Calling a Function Using the Native COM Interfaces

To call functions of the COM object that can not be accessed via any of the above methods it is possible to request the COM interface directly using QAxBase::queryInterface(). To get a C++ definition of the respective interface classes use the <tt>#import</tt> directive with the type library provided with the control; see your compiler manual for details.

Typical Error Messages

ActiveQt prints error messages to the debug output when it encounters error situations at runtime. Usually you must run your program in the debugger to see these messages (e.g. in Visual Studio's Debug output).

QAxBase::internalInvoke: No such method

A QAxBase::dynamicCall() failed - the function prototype did not match any function available in the object's API.

Error calling IDispatch member: Non-optional parameter missing

A QAxBase::dynamicCall() failed - the function prototype was correct, but too few parameters were provided.

Error calling IDispatch member: Type mismatch in parameter n

A QAxBase::dynamicCall() failed - the function prototype was correct, but the paramter at index <tt>n</tt> was of the wrong type and could not be coerced to the correct type.

QAxScriptManager::call(): No script provides this function

You try to call a function that is provided through an engine that doesn't provide introspection (ie. ActivePython or ActivePerl). You need to call the function directly on the respective QAxScript object.

See also ActiveQt Framework.

      <acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.

      The documentation provided herein is licensed under the terms of the
      GNU Free Documentation
      License version 1.3 as published by the Free Software Foundation.

      Documentation sources may be obtained from
      www.qt-project.org.

      Digia, Qt and their respective logos are trademarks of Digia Plc
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. Privacy Policy


text:
{-# language CPP #-}
-- No documentation found for Chapter "Enums"
module OpenXR.Core10.Enums  ( module OpenXR.Core10.Enums.ActionType
                            , module OpenXR.Core10.Enums.CompositionLayerFlagBits
                            , module OpenXR.Core10.Enums.EnvironmentBlendMode
                            , module OpenXR.Core10.Enums.EyeVisibility
                            , module OpenXR.Core10.Enums.FormFactor
                            , module OpenXR.Core10.Enums.InputSourceLocalizedNameFlagBits
                            , module OpenXR.Core10.Enums.InstanceCreateFlagBits
                            , module OpenXR.Core10.Enums.ObjectType
                            , module OpenXR.Core10.Enums.ReferenceSpaceType
                            , module OpenXR.Core10.Enums.Result
                            , module OpenXR.Core10.Enums.SessionCreateFlagBits
                            , module OpenXR.Core10.Enums.SessionState
                            , module OpenXR.Core10.Enums.SpaceLocationFlagBits
                            , module OpenXR.Core10.Enums.SpaceVelocityFlagBits
                            , module OpenXR.Core10.Enums.StructureType
                            , module OpenXR.Core10.Enums.SwapchainCreateFlagBits
                            , module OpenXR.Core10.Enums.SwapchainUsageFlagBits
                            , module OpenXR.Core10.Enums.ViewConfigurationType
                            , module OpenXR.Core10.Enums.ViewStateFlagBits
                            ) where
import OpenXR.Core10.Enums.ActionType
import OpenXR.Core10.Enums.CompositionLayerFlagBits
import OpenXR.Core10.Enums.EnvironmentBlendMode
import OpenXR.Core10.Enums.EyeVisibility
import OpenXR.Core10.Enums.FormFactor
import OpenXR.Core10.Enums.InputSourceLocalizedNameFlagBits
import OpenXR.Core10.Enums.InstanceCreateFlagBits
import OpenXR.Core10.Enums.ObjectType
import OpenXR.Core10.Enums.ReferenceSpaceType
import OpenXR.Core10.Enums.Result
import OpenXR.Core10.Enums.SessionCreateFlagBits
import OpenXR.Core10.Enums.SessionState
import OpenXR.Core10.Enums.SpaceLocationFlagBits
import OpenXR.Core10.Enums.SpaceVelocityFlagBits
import OpenXR.Core10.Enums.StructureType
import OpenXR.Core10.Enums.SwapchainCreateFlagBits
import OpenXR.Core10.Enums.SwapchainUsageFlagBits
import OpenXR.Core10.Enums.ViewConfigurationType
import OpenXR.Core10.Enums.ViewStateFlagBits


text:
""" This module collects all of the tests and runs them"""
import unittest
import os

# Check if we have discover function, if not use unittest2
# This might be compatible with some python versions < 2.7
"""
try:
    dummy = unittest.defaultTestLoader.discover(os.path.dirname(__file__))
except:
    import unittest2 as unittest
"""

def run():
    test_loader = unittest.defaultTestLoader
    test_suites = test_loader.discover(os.path.dirname(__file__))
    unittest.TextTestRunner(buffer=True).run(test_suites)
    #parallel.barrier()

if __name__ == '__main__':
    run()


text:
cask 'zoho-mail' do
  version '1.0.16'
  sha256 '70a9408a4e20596ccaa933196c64edd06d1edab8c70a9d01249f3a8ef4984f3e'

  # downloads.zohocdn.com/zmail-desktop/mac was verified as official when first introduced to the cask
  url "https://downloads.zohocdn.com/zmail-desktop/mac/zoho-mail-desktop-installer-v#{version}.dmg"
  appcast 'https://www.zoho.com/mail/desktop/artifacts.json'
  name 'Zoho Mail'
  homepage 'https://www.zoho.com/mail/desktop/'

  app 'Zoho Mail - Desktop.app'
end


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.onosproject</groupId>
    <artifactId>onos-apps</artifactId>
    <version>1.3.0-SNAPSHOT</version>
  </parent>
  <artifactId>onos-app-pcep-api</artifactId>
  <packaging>bundle</packaging>

  <description>PCEP protocol API</description>
</project>


text:
{-# OPTIONS_GHC -Wall #-}

{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE Strict #-}

module Main (main) where

import System.Random
import Data.Foldable (toList, foldl')

import qualified Data.Vector as V

data Nat :: * where
   Z :: Nat
   S :: Nat -> Nat

data SNat :: Nat -> * where
   SZ :: SNat 'Z
   SS :: SNat n -> SNat ('S n)

instance Show (SNat n) where
   show = ("SNat " ++) . show . snatToInt

snatToInt :: SNat n -> Int
snatToInt = snatToInt' 0
   where
   snatToInt' :: Int -> SNat n -> Int
   snatToInt' acc SZ = acc
   snatToInt' acc (SS sn) = snatToInt' (acc+1) sn

infixr 5 :-
data Vector' :: Nat -> * -> * where
   Nil :: Vector' 'Z a
   (:-) :: a -> Vector' n a -> Vector' ('S n) a

instance Foldable (Vector' n) where
   foldMap _ Nil = mempty
   foldMap f (x :- xs) = f x `mappend` foldMap f xs

data Vector :: Nat -> * where
   Vector :: SNat n -> V.Vector Double -> Vector n

instance Show (Vector n) where
   show (Vector _ a) = "Vector " ++ show (V.length a) ++ " " ++ show a

vector :: SNat ('S n) -> Vector' ('S n) Double -> Vector ('S n)
vector sn = Vector sn . foldl' V.snoc V.empty . toList

zeros :: SNat ('S n) -> Vector ('S n)
zeros sn = Vector sn $ V.replicate (snatToInt sn) 0

type NFeatures = ('S ('S 'Z))

sNFeatures :: SNat NFeatures
sNFeatures = SS (SS SZ)

type Model = Vector ('S NFeatures)
type Target = Double
type Features = Vector NFeatures

type Hypothesis = Model -> Features -> Target

-- General purpose example
data Example = Example
   Features
   Target deriving Show

{-# INLINE nextModel #-}
nextModel ::
   Double -> --lambda
   Double -> --learningRate
   Double -> --difference
   Model -> --model
   Features ->
   Model --the resulting model

nextModel lambda learningRate difference (Vector sn modelArr) (Vector _ featureArr) = Vector sn $
   V.update
      (V.zipWith (-) modelArr $ (* learningRate) <$> V.zipWith (+) (fmap (* difference) featureArr) (fmap (* lambda) modelArr))
      (V.singleton (0, (modelArr V.! 0) - learningRate * difference))

stochaticGradientDescentUpdate :: Hypothesis -> Double -> Double -> Example -> Model -> (Target, Model)
stochaticGradientDescentUpdate hypothesis lambda learningRate (Example features target) model =
   let
      cost = negate (log approximation*target + log(1 - approximation)*(1-target))
      nxtModel = nextModel lambda learningRate difference model features
   in ((,) $! cost) $! nxtModel
   where
   difference :: Target
   difference = approximation - target
   approximation :: Target
   approximation = hypothesis model features
{-- Octave code
h = sigmoid(theta'*X');
reg_theta = [0; theta(2:end)];

first_cost_term = (log(h)*y);
second_const_term = log(1 - h) * (1 - y);
third_cost_term = (lambda/2)*sum(reg_theta.^2);

J = ((-1)/m)*( first_cost_term + second_const_term - third_cost_term);
grad = (1/m)*( ( (h - y') * X) + (lambda) *reg_theta');
-}

-- Test main
main :: IO ()
main =
   print $ foldr folder (1000,zeroModel) $ take 1000000 d
   where
   folder ex (_, model) =
      let
         (err, nxtModel) = stochaticGradientDescentUpdate sigmoidHypothesis 0.01 0.1 ex model
      in (err, nxtModel)

   d :: [Example]
   d = example <$> randomRs (0,1) (mkStdGen 332) <*> randomRs (0,1) (mkStdGen 2132)
   example :: Double -> Double -> Example
   example x y =
      Example
         (vector
            sNFeatures -- SS because of the 1
            (x :- y :- Nil))
         (if y > 0.5 then 1 else 0)
   zeroModel = zeros (SS sNFeatures)

sigmoidHypothesis :: Model -> Features -> Target
sigmoidHypothesis (Vector _ modelArr) (Vector _ featuresArr) =
   1 / ( 1 + exp (negate $ V.foldl' (+) 0 $ V.zipWith (*) modelArr (V.cons 1 featuresArr)))

-- vim: expandtab


text:
namespace sockpp
{

class IPv4Addr;

namespace operations
{

class SocketGetter
{
public:
    SocketGetter(): fd(-1) {}
    void setFd(int _fd) { fd = _fd; }
    int getFd() { return fd; }
private:
    int fd;
};

class SocketOption : public SocketGetter
{
protected:
    template<class OptionValue>
    bool setOption(int level, int option, const OptionValue& optionValue, const char* optionName)
    {
        return setOptionImpl(getFd(), level, option, (void*)&optionValue, sizeof(optionValue), optionName);
    }
private:
    bool setOptionImpl(int fd, int level, int option, void* value, size_t valSize, const char* optionName);

};

struct Bind : public SocketGetter
{
    bool port(uint16_t port);
    bool addressPort(const IPv4Addr& addr, uint16_t port);
};

struct Listen : public SocketGetter
{
    bool listen();
    bool port(uint16_t port);
    bool addressPort(const IPv4Addr& addr, uint16_t port);

};

struct Connect : public SocketGetter
{
    bool connect(const IPv4Addr& addr, uint16_t port);
};

struct Data : public SocketGetter
{
    size_t sendTo(const IPv4Addr& addr, uint16_t port, void* buffer, size_t size);

};

struct SocketTraits : public SocketGetter
{
    SocketTraits() {}
    SocketTraits(int fd);
    ProtocolFamilyEnum getProtocolFamily();
    ProtocolTypeEnum getProtocolType();
};

struct NonBlocking : public SocketGetter
{
    bool isNonBlocking();
    bool setNonBlocking();
    bool setBlocking();
    bool set(bool nonBlocking);
};

struct Fragmentation : public SocketOption
{
    bool probe();
    bool allow();
    bool deny();
};

struct ReuseAddress : public SocketOption
{
    bool turnOn();
    bool turnOff();
};

struct ReusePort : public SocketOption
{
    bool turnOn();
    bool turnOff();
};

struct Broadcast : public SocketOption
{
    bool turnOn();
    bool turnOff();
};

struct Multicase : public SocketOption
{
    bool addMembership(const IPv4Addr& multiAddress, const IPv4Addr& selfAddress);
    bool dropMembership(const IPv4Addr& multiAddress, const IPv4Addr& selfAddress);
    bool setIpIface(const IPv4Addr& ifIp);
    bool setTTL(u_int8_t ttl);
};

} // namespace operations
} // namespace sockpp

#endif // CORE_NET_SOCKET_OPERATIONS_H


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class com.thinkaurelius.titan.core.schema.ConsistencyModifier (Titan 1.0.0 API)</title>
<meta name="date" content="2015-09-19">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
com.thinkaurelius.titan.core.schema.ConsistencyModifier

Packages that use ConsistencyModifier

Package
Description

com.thinkaurelius.titan.core.schema

com.thinkaurelius.titan.graphdb.database.management

com.thinkaurelius.titan.graphdb.internal

com.thinkaurelius.titan.graphdb.types

com.thinkaurelius.titan.graphdb.types.indextype

com.thinkaurelius.titan.graphdb.types.system

com.thinkaurelius.titan.graphdb.types.vertices

Uses of ConsistencyModifier in com.thinkaurelius.titan.core.schema

Methods in com.thinkaurelius.titan.core.schema that return ConsistencyModifier

Modifier and Type
Method and Description

ConsistencyModifier
TitanManagement.getConsistency(TitanSchemaElement element)

Retrieves the consistency modifier for the given TitanSchemaElement.

static ConsistencyModifier
ConsistencyModifier.valueOf(String name)

Returns the enum constant of this type with the specified name.

static ConsistencyModifier[]
ConsistencyModifier.values()

Returns an array containing the constants of this enum type, in
the order they are declared.

Methods in com.thinkaurelius.titan.core.schema with parameters of type ConsistencyModifier

Modifier and Type
Method and Description

void
TitanManagement.setConsistency(TitanSchemaElement element,
              ConsistencyModifier consistency)

Sets the consistency modifier for the given TitanSchemaElement.

Uses of ConsistencyModifier in com.thinkaurelius.titan.graphdb.database.management

Methods in com.thinkaurelius.titan.graphdb.database.management that return ConsistencyModifier

Modifier and Type
Method and Description

ConsistencyModifier
ManagementSystem.getConsistency(TitanSchemaElement element)

Retrieves the consistency level for a schema element (types and internal indexes)

Methods in com.thinkaurelius.titan.graphdb.database.management with parameters of type ConsistencyModifier

Modifier and Type
Method and Description

void
ManagementSystem.setConsistency(TitanSchemaElement element,
              ConsistencyModifier consistency)

Sets the consistency level for those schema elements that support it (types and internal indexes)

Uses of ConsistencyModifier in com.thinkaurelius.titan.graphdb.internal

Methods in com.thinkaurelius.titan.graphdb.internal that return ConsistencyModifier

Modifier and Type
Method and Description

ConsistencyModifier
InternalRelationType.getConsistencyModifier()

Uses of ConsistencyModifier in com.thinkaurelius.titan.graphdb.types

Methods in com.thinkaurelius.titan.graphdb.types that return ConsistencyModifier

Modifier and Type
Method and Description

ConsistencyModifier
CompositeIndexType.getConsistencyModifier()

static ConsistencyModifier
TypeUtil.getConsistencyModifier(SchemaSource schema)

Uses of ConsistencyModifier in com.thinkaurelius.titan.graphdb.types.indextype

Methods in com.thinkaurelius.titan.graphdb.types.indextype that return ConsistencyModifier

Modifier and Type
Method and Description

ConsistencyModifier
CompositeIndexTypeWrapper.getConsistencyModifier()

Uses of ConsistencyModifier in com.thinkaurelius.titan.graphdb.types.system

Methods in com.thinkaurelius.titan.graphdb.types.system that return ConsistencyModifier

Modifier and Type
Method and Description

ConsistencyModifier
ImplicitKey.getConsistencyModifier()

ConsistencyModifier
BaseRelationType.getConsistencyModifier()

Uses of ConsistencyModifier in com.thinkaurelius.titan.graphdb.types.vertices

Methods in com.thinkaurelius.titan.graphdb.types.vertices that return ConsistencyModifier

Modifier and Type
Method and Description

ConsistencyModifier
RelationTypeVertex.getConsistencyModifier()

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2012–2015. All rights reserved.


text:
@interface SFBuildableCall : SFCall

@property (nonatomic, assign) BOOL forceSynchronous;

@property (nonatomic, copy) SFCallResult *(^resultBuilder)();

+ (instancetype)callWithResultBuilder:(SFCallResult *(^)())resultBuilder;
+ (instancetype)callWithResultBuilder:(SFCallResult *(^)())resultBuilder forceSynchronous:(BOOL)forceSynchronous;

@end


text: export * from './VisMap'


text:
"""Script for branching Google Test/Mock wiki pages for a new version.

SYNOPSIS
       release_docs.py NEW_RELEASE_VERSION

       Google Test and Google Mock's external user documentation is in
       interlinked wiki files.  When we release a new version of
       Google Test or Google Mock, we need to branch the wiki files
       such that users of a specific version of Google Test/Mock can
       look up documenation relevant for that version.  This script
       automates that process by:

         - branching the current wiki pages (which document the
           behavior of the SVN trunk head) to pages for the specified
           version (e.g. branching FAQ.wiki to V2_6_FAQ.wiki when
           NEW_RELEASE_VERSION is 2.6);
         - updating the links in the branched files to point to the branched
           version (e.g. a link in V2_6_FAQ.wiki that pointed to
           Primer.wiki#Anchor will now point to V2_6_Primer.wiki#Anchor).

       NOTE: NEW_RELEASE_VERSION must be a NEW version number for
       which the wiki pages don't yet exist; otherwise you'll get SVN
       errors like "svn: Path 'V1_7_PumpManual.wiki' is not a
       directory" when running the script.

EXAMPLE
       $ cd PATH/TO/GTEST_SVN_WORKSPACE/trunk
       $ scripts/release_docs.py 2.6  # create wiki pages for v2.6
       $ svn status                   # verify the file list
       $ svn diff                     # verify the file contents
       $ svn commit -m "release wiki pages for v2.6"
"""

from __future__ import print_function

__author__ = 'wan@google.com (Zhanyong Wan)'

import os
import re
import sys

import common

# Wiki pages that shouldn't be branched for every gtest/gmock release.
GTEST_UNVERSIONED_WIKIS = ['DevGuide.wiki']
GMOCK_UNVERSIONED_WIKIS = [
    'DesignDoc.wiki',
    'DevGuide.wiki',
    'KnownIssues.wiki'
    ]

def DropWikiSuffix(wiki_filename):
  """Removes the .wiki suffix (if any) from the given filename."""

  return (wiki_filename[:-len('.wiki')] if wiki_filename.endswith('.wiki')
          else wiki_filename)

class WikiBrancher(object):
  """Branches ..."""

  def __init__(self, dot_version):
    self.project, svn_root_path = common.GetSvnInfo()
    if self.project not in ('googletest', 'googlemock'):
      sys.exit('This script must be run in a gtest or gmock SVN workspace.')
    self.wiki_dir = svn_root_path + '/wiki'
    # Turn '2.6' to 'V2_6_'.
    self.version_prefix = 'V' + dot_version.replace('.', '_') + '_'
    self.files_to_branch = self.GetFilesToBranch()
    page_names = [DropWikiSuffix(f) for f in self.files_to_branch]
    # A link to Foo.wiki is in one of the following forms:
    #   [Foo words]
    #   [Foo#Anchor words]
    #   [http://code.google.com/.../wiki/Foo words]
    #   [http://code.google.com/.../wiki/Foo#Anchor words]
    # We want to replace 'Foo' with 'V2_6_Foo' in the above cases.
    self.search_for_re = re.compile(
        # This regex matches either
        #   [Foo
        # or
        #   /wiki/Foo
        # followed by a space or a #, where Foo is the name of an
        # unversioned wiki page.
        r'(\[|/wiki/)(%s)([ #])' % '|'.join(page_names))
    self.replace_with = r'\1%s\2\3' % (self.version_prefix,)

  def GetFilesToBranch(self):
    """Returns a list of .wiki file names that need to be branched."""

    unversioned_wikis = (GTEST_UNVERSIONED_WIKIS if self.project == 'googletest'
                         else GMOCK_UNVERSIONED_WIKIS)
    return [f for f in os.listdir(self.wiki_dir)
            if (f.endswith('.wiki') and
                not re.match(r'^V\d', f) and  # Excluded versioned .wiki files.
                f not in unversioned_wikis)]

  def BranchFiles(self):
    """Branches the .wiki files needed to be branched."""

    print('Branching %d .wiki files:' % (len(self.files_to_branch),))
    os.chdir(self.wiki_dir)
    for f in self.files_to_branch:
      command = 'svn cp %s %s%s' % (f, self.version_prefix, f)
      print(command)
      os.system(command)

  def UpdateLinksInBranchedFiles(self):

    for f in self.files_to_branch:
      source_file = os.path.join(self.wiki_dir, f)
      versioned_file = os.path.join(self.wiki_dir, self.version_prefix + f)
      print('Updating links in %s.' % (versioned_file,))
      text = file(source_file, 'r').read()
      new_text = self.search_for_re.sub(self.replace_with, text)
      file(versioned_file, 'w').write(new_text)

def main():
  if len(sys.argv) != 2:
    sys.exit(__doc__)

  brancher = WikiBrancher(sys.argv[1])
  brancher.BranchFiles()
  brancher.UpdateLinksInBranchedFiles()

if __name__ == '__main__':
  main()


text:
package server

import (
	"bytes"
	"net"
	"testing"
)

func TestGenPacket(t *testing.T) {
	TestSpoofChannel = make(chan []byte, 1)

	state := &PathReflectionState{
		net.IP{127, 0, 0, 1},
		uint16(8080),
		net.IP{127, 0, 0, 1},
		uint16(8081),
		0,
		0,
	}
	conf := Config{0, "", "", "", "../pathreflection.json"}
	challenge, err := SendPathReflectionChallenge(conf, state)
	if err != nil {
		t.Fatal("Error sending challenge", err)
	}

	// Compare
	sentPkt := <-TestSpoofChannel
	if !bytes.Contains(sentPkt, []byte(challenge)) {
		t.Fatal("Challenge not in spoofed packet")
	}
}


text:
<?php

namespace Immortal;

use Immortal\Components\Router\Router;
use Immortal\Interfaces\ServiceProviderInterface;

class ServiceProvider implements ServiceProviderInterface
{
    public function register($container)
    {
        if (!isset($container['environment'])) {
            $container['environment'] = function () {
                return new Environment($_SERVER);
            };
        }

        if (!isset($container['router'])) {
            $container['router'] = function ($container) {
                $routerCacheFile = false;
                if (isset($container->get('settings')['routerCacheFile'])) {
                    $routerCacheFile = $container->get('settings')['routerCacheFile'];
                }

                $router = (new Router)->setCacheFile($routerCacheFile);
                if (method_exists($router, 'setContainer')) {
                    $router->setContainer($container);
                }

                return $router;
            };
        }
    }
}


text:
package net.algart.pyramid.standard;

import net.algart.external.MatrixToBufferedImageConverter;

import java.awt.*;
import java.util.HashMap;
import java.util.Map;

enum RendererType {
    DEFAULT("Default") {
        @Override
        public RendererType toCompatible(int channelCount) {
            return this;
        }

        @Override
        public Color getBackgroundColor(String backgroundColor, boolean transparencySupported) {
            if (backgroundColor != null) {
                return Color.decode("#" + backgroundColor);
            } else {
                return transparencySupported ? TRANSPARENT_COLOR : Color.WHITE;
            }
        }

        @Override
        public MatrixToBufferedImageConverter getConverter(
            Color color,
            double opacity,
            boolean addAlpha)
        {
            return new MatrixToBufferedImageConverter.Packed3DToPackedRGB(addAlpha);
        }
    },

    ALPHA_0_GRAY("Alpha0Gray") {
        @Override
        public RendererType toCompatible(int channelCount) {
            return channelCount > 1 ? DEFAULT : this;
        }

        @Override
        public Color getBackgroundColor(String backgroundColor, boolean transparencySupported) {
            return ALPHA_0_BACKGROUND_COLOR;
        }

        @Override
        public MatrixToBufferedImageConverter getConverter(
            Color color,
            double opacity,
            boolean addAlpha)
        {
            if (opacity < 0.0 || opacity > 1.0) {
                throw new IllegalArgumentException("Illegal opacity " + opacity + " (must be in 0.0..1.0 range)");
            }
            final int opacity255 = (int) Math.round(opacity * 255.0);
            return new MatrixToBufferedImageConverter.MonochromeToIndexed(
                new double[] {0, 0, 0, 0},
                new double[] {1.0, 1.0, 1.0, 1.0}
            )
            {
                @Override
                public byte[][] palette() {
                    final byte[] intensity = new byte[256];
                    final byte[] a = new byte[256];
                    intensity[0] = 0;
                    a[0] = 0;
                    for (int i = 1; i < 256; i++) {
                        intensity[i] = (byte) (i & 0xff);
                        a[i] = (byte) opacity255;
                    }
                    return new byte[][] {intensity, intensity, intensity, a};
                }

                @Override
                protected void toDataBufferBand0Filter(byte[] src, int srcPos, byte[] dest) {
                    super.toDataBufferBand0Filter(src, srcPos, dest);
                    for (int i = 0; i < dest.length; i++) {
                        if (dest[i] == 0) {
                            dest[i] = 1;
                        }
                    }
                }
            };
        }
    },
    ALPHA_0_COLOR("Alpha0Color") {
        @Override
        public RendererType toCompatible(int channelCount) {
            return channelCount > 1 ? DEFAULT : this;
        }

        @Override
        public Color getBackgroundColor(String backgroundColor, boolean transparencySupported) {
            return ALPHA_0_BACKGROUND_COLOR;
        }

        @Override
        public MatrixToBufferedImageConverter getConverter(Color color, double opacity, boolean addAlpha) {
            if (opacity < 0.0 || opacity > 1.0) {
                throw new IllegalArgumentException("Illegal opacity " + opacity + " (must be in 0.0..1.0 range)");
            }
            final float[] rgb = color.getRGBColorComponents(null);
            return new MatrixToBufferedImageConverter.MonochromeToIndexed(
                new double[] {rgb[0], rgb[1], rgb[2], 0},
                new double[] {rgb[0], rgb[1], rgb[2], opacity}
            )
            {
                @Override
                public byte[][] palette() {
                    final byte[][] result = super.palette();
                    result[0][0] = 0;
                    result[1][0] = 0;
                    result[2][0] = 0;
                    result[3][0] = 0;
                    return result;
                }
            };
        }
    };

    private static final Color TRANSPARENT_COLOR = new Color(0, 0, 0, 0);
    private static final Color ALPHA_0_BACKGROUND_COLOR = new Color(0, 0, 0, 0);
    private static final Map<String, RendererType> JSON_NAMES = new HashMap<>();
    static {
        for (RendererType v : RendererType.values()) {
            JSON_NAMES.put(v.jsonName, v);
            JSON_NAMES.put(v.name(), v);
            // support of both names: UPPERCASE and user-friendly
        }
    }

    private final String jsonName;

    RendererType(String jsonName) {
        this.jsonName = jsonName;
    }

    public static RendererType parse(String name) {
        if (name == null) {
            return DEFAULT;
        }
        final RendererType result = JSON_NAMES.get(name);
        return result == null ? DEFAULT : result;
    }

    public abstract RendererType toCompatible(int channelCount);

    public abstract Color getBackgroundColor(String backgroundColor, boolean transparencySupported);

    public abstract MatrixToBufferedImageConverter getConverter(
        Color color,
        double opacity,
        boolean addAlpha);
}


text:
package org.caleydo.view.dvi.tableperspective;

import java.awt.geom.Point2D;

import javax.media.opengl.GL2;

import org.caleydo.core.data.datadomain.ATableBasedDataDomain;
import org.caleydo.core.data.perspective.table.TablePerspective;
import org.caleydo.core.view.opengl.canvas.AGLView;
import org.caleydo.core.view.opengl.canvas.PixelGLConverter;
import org.caleydo.core.view.opengl.util.text.CaleydoTextRenderer;
import org.caleydo.datadomain.pathway.data.PathwayTablePerspective;
import org.caleydo.view.dvi.node.IDVINode;

public class TablePerspectiveRenderer extends ADraggableColorRenderer {

	private static final int TEXT_SPACING_PIXELS = 2;

	public final static int TEXT_ROTATION_0 = 0;
	public final static int TEXT_ROTATION_90 = 90;
	public final static int TEXT_ROTATION_180 = 180;
	public final static int TEXT_ROTATION_270 = 270;

	public static final float[] INACTIVE_COLOR = { 0.9f, 0.9f, 0.9f, 1f };
	public static final float[] INACTIVE_BORDER_COLOR = { 0.7f, 0.7f, 0.7f, 1f };

	private TablePerspective tablePerspective;
	private TablePerspectiveCreator creator;

	private IDVINode node;
	protected boolean showText = true;
	protected int textRotation = 0;
	protected int textHeightPixels;
	protected boolean isActive = false;

	public TablePerspectiveRenderer(TablePerspective tablePerspective, AGLView view, IDVINode node) {
		super(INACTIVE_COLOR, INACTIVE_BORDER_COLOR, 2, view);
		this.setTablePerspective(tablePerspective);
		this.view = view;
		this.node = node;
	}

	public TablePerspectiveRenderer(TablePerspectiveCreator creator, AGLView view, IDVINode node) {
		super(INACTIVE_COLOR, INACTIVE_BORDER_COLOR, 2, view);
		this.creator = creator;
		this.view = view;
		this.node = node;
	}

	@Override
	public void renderContent(GL2 gl) {
		CaleydoTextRenderer textRenderer = view.getTextRenderer();
		PixelGLConverter pixelGLConverter = view.getPixelGLConverter();

		gl.glPushMatrix();
		gl.glTranslatef(0, 0, 0.1f);
		super.renderContent(gl);
		gl.glPopMatrix();

		if (showText && tablePerspective != null) {
			float textPositionX = 0;
			switch (textRotation) {
			case TEXT_ROTATION_0:
				textRenderer.renderTextInBounds(gl, tablePerspective.getLabel(),
						pixelGLConverter.getGLWidthForPixelWidth(TEXT_SPACING_PIXELS),
						pixelGLConverter.getGLWidthForPixelWidth(TEXT_SPACING_PIXELS), 0.1f,
						x - 2 * pixelGLConverter.getGLWidthForPixelWidth(TEXT_SPACING_PIXELS),
						pixelGLConverter.getGLHeightForPixelHeight(textHeightPixels));
				break;

			case TEXT_ROTATION_90:

				gl.glPushMatrix();
				textPositionX = pixelGLConverter.getGLHeightForPixelHeight(textHeightPixels - 2)
						+ (x - pixelGLConverter.getGLHeightForPixelHeight(textHeightPixels - 2)) / 2.0f;

				gl.glTranslatef(textPositionX, pixelGLConverter.getGLHeightForPixelHeight(TEXT_SPACING_PIXELS), 0.2f);
				gl.glRotatef(90, 0, 0, 1);
				textRenderer.renderTextInBounds(gl, tablePerspective.getLabel(), 0, 0, 0,
						y - pixelGLConverter.getGLHeightForPixelHeight(TEXT_SPACING_PIXELS),
						pixelGLConverter.getGLHeightForPixelHeight(textHeightPixels));
				gl.glPopMatrix();
				break;
			case TEXT_ROTATION_270:

				gl.glPushMatrix();
				textPositionX = (x - pixelGLConverter.getGLHeightForPixelHeight(textHeightPixels - 2)) / 2.0f;
				gl.glTranslatef(textPositionX, y - pixelGLConverter.getGLHeightForPixelHeight(TEXT_SPACING_PIXELS),
						0.2f);
				gl.glRotatef(-90, 0, 0, 1);
				textRenderer.renderTextInBounds(gl, tablePerspective.getLabel(), 0, 0, 0,
						y - pixelGLConverter.getGLHeightForPixelHeight(TEXT_SPACING_PIXELS),
						pixelGLConverter.getGLHeightForPixelHeight(textHeightPixels));
				gl.glPopMatrix();
				break;
			}
		}
	}

	public void setTablePerspective(TablePerspective dimensionGroupData) {
		this.tablePerspective = dimensionGroupData;
	}

	public TablePerspective getTablePerspective() {
		return tablePerspective;
	}

	public TablePerspective createOrGetTablePerspective() {
		if (tablePerspective != null)
			return tablePerspective;
		return creator.create();
	}

	/**
	 * @return the creator, see {@link #creator}
	 */
	public TablePerspectiveCreator getCreator() {
		return creator;
	}

	public boolean hasTablePerspective() {
		return tablePerspective != null;
	}

	@Override
	protected Point2D getPosition() {
		return node.getBottomObjectAnchorPoints(tablePerspective != null ? tablePerspective : this).getFirst();
	}

	public boolean isShowText() {
		return showText;
	}

	public void setShowText(boolean showText) {
		this.showText = showText;
	}

	public int getTextRotation() {
		return textRotation;
	}

	public void setTextRotation(int textRotation) {
		this.textRotation = textRotation;
	}

	public int getTextHeightPixels() {
		return textHeightPixels;
	}

	public void setTextHeightPixels(int textHeightPixels) {
		this.textHeightPixels = textHeightPixels;
	}

	@Override
	protected boolean permitsWrappingDisplayLists() {
		return false;
	}

	/**
	 * @return the isActive, see {@link #isActive}
	 */
	public boolean isActive() {
		return isActive;
	}

	/**
	 * @param isActive
	 *            setter, see {@link isActive}
	 */
	public void setActive(boolean isActive) {
		if (isActive) {
			if (tablePerspective == null)
				return;
			float[] color = getActiveColor();
			float[] borderColor = new float[] { color[0] - 0.2f, color[1] - 0.2f, color[2] - 0.2f, 1f };
			setColor(color);
			setBorderColor(borderColor);
		} else {
			setColor(INACTIVE_COLOR);
			setBorderColor(INACTIVE_BORDER_COLOR);
		}
		this.isActive = isActive;
	}

	public float[] getActiveColor() {

		if (tablePerspective instanceof PathwayTablePerspective) {
			return ((PathwayTablePerspective) tablePerspective).getPathwayDataDomain().getColor().getRGBA();
		} else {
			return tablePerspective.getDataDomain().getColor().getRGBA();
		}
	}

	public ATableBasedDataDomain getDataDomain() {
		if (tablePerspective != null)
			return tablePerspective.getDataDomain();
		return creator.getDataDomain();
	}
}


text:
title: 'Installatron'
taxonomy:
    category:
        - docs
---

# Installatron


text:
```
cd /tmp
wget -N https://github.com/edenhill/librdkafka/archive/master.zip -O librdkafka.zip; unzip librdkafka.zip; rm -f librdkafka.zip
cd librdkafka-master
./configure
make
sudo make install
```

Any problems, check [this](https://github.com/edenhill/librdkafka)


text:
import React from 'react';
import ReactMixin from 'react-mixin';
import { IntlMixin } from 'react-intl';
import classnames from 'classnames';

import ActivityActionCreators from 'actions/ActivityActionCreators';

import DialogStore from 'stores/DialogStore';
import ActivityStore from 'stores/ActivityStore';

//import AvatarItem from 'components/common/AvatarItem.react';

const getStateFromStores = () => {
  return {
    dialogInfo: DialogStore.getSelectedDialogInfo(),
    isActivityOpen: ActivityStore.isOpen()
  };
};

@ReactMixin.decorate(IntlMixin)
class ToolbarSection extends React.Component {
  state = {
    dialogInfo: null,
    isActivityOpen: false
  };

  constructor(props) {
    super(props);

    DialogStore.addSelectedChangeListener(this.onChange);
    ActivityStore.addChangeListener(this.onChange);
  }

  componentWillUnmount() {
    DialogStore.removeSelectedChangeListener(this.onChange);
    ActivityStore.removeChangeListener(this.onChange);
  }

  onClick = () => {
    if (!this.state.isActivityOpen) {
      ActivityActionCreators.show();
    } else {
      ActivityActionCreators.hide();
    }
  };

  onChange = () => {
    this.setState(getStateFromStores());
  };

  render() {
    const info = this.state.dialogInfo;
    const isActivityOpen = this.state.isActivityOpen;

    let infoButtonClassName = classnames('button button--icon', {
      'button--active': isActivityOpen
    });

    if (info != null) {
      return (

                {info.name}
                {info.presence}

              search
              <input className="input input--search" placeholder={this.getIntlMessage('search')} type="search"/>

              <button className={infoButtonClassName} onClick={this.onClick}>
                info
              </button>
              <button className="button button--icon hide">
                more_vert
              </button>

      );
    } else {
      return (

      );
    }
  }
}

export default ToolbarSection;


text:
function Player(name) {
	this.name = name;
}

Player.prototype.choses = function(playerPick) {
	this.chosen = playerPick;
}

// Game Class
function Game(player) {
	this.player1 = player1;
	this.player2 = player2;
}

Game.prototype.winner = function() {
 if(player1.chosen === 'rock' && player2.chosen === 'scissors'){
 	return player1;
 }
if(player1.chosen === 'paper' && player2.chosen === 'rock'){
	return player1;
 }
 if(player1.chosen === 'scissors' && player2.chosen === 'paper'){
 	return player1;
 }
 if(player1.chosen === player2.chosen){
 	return 'Draw';
 }
 else{
 	return player2;
 }
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.cardpay.pccredit.customer.dao.CustomerCareersInformationDao" >
  <resultMap id="BaseResultMap" type="com.cardpay.pccredit.customer.model.CustomerCareersInformation" >
    <id column="ID" property="id" jdbcType="VARCHAR" />
    <result column="CUSTOMER_ID" property="customerId" jdbcType="VARCHAR" />
    <result column="NAME_UNIT" property="nameUnit" jdbcType="VARCHAR" />
    <result column="DEPARTMENT_NAME" property="departmentName" jdbcType="VARCHAR" />
    <result column="UNIT_ADDRESS" property="unitAddress" jdbcType="VARCHAR" />
    <result column="ZIP_CODE" property="zipCode" jdbcType="VARCHAR" />
    <result column="UNIT_PHONE" property="unitPhone" jdbcType="VARCHAR" />
    <result column="UNIT_NATURE" property="unitNature" jdbcType="VARCHAR" />
    <result column="INDUSTRY_TYPE" property="industryType" jdbcType="VARCHAR" />
    <result column="POSITIO" property="positio" jdbcType="VARCHAR" />
    <result column="TITLE" property="title" jdbcType="VARCHAR" />
    <result column="ANNUAL_INCOME" property="annualIncome" jdbcType="VARCHAR" />
    <result column="YEAR_WORK_UNIT" property="yearWorkUnit" jdbcType="VARCHAR" />
    <result column="BEFORE_NAME_UNIT" property="beforeNameUnit" jdbcType="VARCHAR" />
    <result column="BEFORE_YEAR_WORK_UNIT" property="beforeYearWorkUnit" jdbcType="VARCHAR" />
    <result column="WORK_TIME" property="workTime" jdbcType="VARCHAR" />
    <result column="CREATED_BY" property="createdBy" jdbcType="VARCHAR" />
    <result column="CREATED_TIME" property="createdTime" jdbcType="DATE" />
    <result column="MODIFIED_BY" property="modifiedBy" jdbcType="VARCHAR" />
    <result column="MODIFIED_TIME" property="modifiedTime" jdbcType="DATE" />
  </resultMap>
  <sql id="Base_Column_List" >
    ID, CUSTOMER_ID, NAME_UNIT, DEPARTMENT_NAME, UNIT_ADDRESS, ZIP_CODE, UNIT_PHONE,
    UNIT_NATURE, INDUSTRY_TYPE, POSITIO, TITLE, ANNUAL_INCOME, YEAR_WORK_UNIT, BEFORE_NAME_UNIT,
    BEFORE_YEAR_WORK_UNIT, WORK_TIME, CREATED_BY, CREATED_TIME, MODIFIED_BY, MODIFIED_TIME
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
    select
    <include refid="Base_Column_List" />
    from CUSTOMER_CAREERS_INFORMATION
    where ID = #{id,jdbcType=DECIMAL}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
    delete from CUSTOMER_CAREERS_INFORMATION
    where ID = #{id,jdbcType=DECIMAL}
  </delete>

  <sql id="Customer_Careers">
  	c.id as id,b.chinese_name as customerName,c.name_unit as nameUnit,c.department_name as departmentName,
  	c.unit_address as unitAddress,c.zip_code as zipCode,c.unit_phone as unitPhone,c.unit_nature as unitNature,
  	c.industry_type as industryType,c.positio as positio,c.title as title,c.annual_income as annualIncome,
  	c.year_work_unit as yearWorkUnit,c.before_name_unit as beforeNameUnit,c.before_year_work_unit as beforeYearWorkUnit,
  	c.work_time as workTime
  </sql>
  <select id="getCustomerCareersByCustomerId" resultType="com.cardpay.pccredit.customer.model.CustomerCareersWeb">
  	select
  	<include refid="Customer_Careers" />
  	 from basic_customer_information b
  	 left join CUSTOMER_CAREERS_INFORMATION c
  	 on c.customer_id=b.id
  	where c.customer_id=#{id}
  </select>

  <select id="findCustomerCareersByAppId" resultType="com.cardpay.pccredit.customer.model.CustomerCareersWeb">
    select
  	<include refid="Customer_Careers" />
  	 from CUSTOMER_CAREERS_INFORMATION_S c
  	 left join basic_customer_information b
  	 on c.customer_id=b.id
    where c.application_id = #{applicationId}
  </select>
  <select id="getCustomerCareersInformationByCustomerId" resultMap="BaseResultMap">
  	select *
  	from CUSTOMER_CAREERS_INFORMATION c
  	where c.customer_id=#{id}
  </select>

</mapper>


text:
/*
 * NaCl Server Runtime logging code.
 */
#include "native_client/src/include/nacl_compiler_annotations.h"
#include "native_client/src/include/portability.h"
#include "native_client/src/include/portability_io.h"
#include "native_client/src/include/portability_process.h"
#include "native_client/src/include/portability_string.h"

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <limits.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>

#include "native_client/src/shared/platform/nacl_log.h"
#include "native_client/src/shared/platform/nacl_log_intern.h"

#define THREAD_SAFE_DETAIL_CHECK  0
/*
 * If set, check detail_level without grabbing a mutex.  This makes
 * logging much cheaper, but implies that the verbosity level should
 * only be changed prior to going multithreaded.
 */

#include "native_client/src/shared/gio/gio.h"
#include "native_client/src/shared/platform/nacl_exit.h"
#include "native_client/src/shared/platform/nacl_sync.h"
#include "native_client/src/shared/platform/nacl_sync_checked.h"
#include "native_client/src/shared/platform/nacl_threads.h"
#include "native_client/src/shared/platform/nacl_timestamp.h"

static int              g_initialized = 0;

/*
 * Three implementation strategies for module-specific logging:
 *
 * If Thread Local Storage is available, NaClLogSetModule sets a TLS
 * variable to the current module name and NaClLogDoLogAndUnsetModule
 * will use that variable to determine whether to log or not, without
 * taking a lock.
 *
 * If Thread-Specific Data is available (pthread.h), then
 * NaClLogModuleInit allocates a pthread_[sg]etspecific key, and
 * NaClLogSetModule / NaClLogDoLogAndUnsetModule uses the TSD variable
 * in much the same way that a TLS variable would be used.
 *
 * If neither TLS nor TSD is available, then a global variable is used
 * to hold the module name, and a NaClMutex lock is used to prevent
 * another thread from changing it until the detail level vs verbosity
 * level check has fired.
 */
#if NACL_PLATFORM_HAS_TLS
THREAD char const       *gTls_ModuleName;
#elif NACL_PLATFORM_HAS_TSD
#  include <pthread.h>
pthread_key_t           gModuleNameKey;
#else
static char const       *nacl_log_module_name = NULL;
#endif

/*
 * All logging output is protected by this mutex, so that the logging
 * code may output using multiple calls to the gio functions and not
 * have logging output from multiple threads get intermixed.
 */
static struct NaClMutex log_mu;
static int              tag_output = 0;
static int              g_abort_count = 0;
/*
 * g_abort_count is incremented prior to calling
 * gNaClLogAbortBehavior, so that the abort hook can invoke other
 * functions that might need to log, without those log entries
 * deadlocking or polluting the crash log output.
 */
static int              g_abort_behavior_active = 0;

#define NACL_VERBOSITY_UNSET INT_MAX

static int              verbosity = NACL_VERBOSITY_UNSET;
static struct Gio       *log_stream = NULL;
static struct GioFile   log_file_stream;
static int              timestamp_enabled = 1;

/* global, but explicitly not exposed in non-test header file */
void (*gNaClLogAbortBehavior)(void) = NaClAbort;

/*
 * For now, we use a simple linked list.  New entries are pushed to
 * the front; search starts at front.  So last entry for a particular
 * module wins, and we don't bother to eliminate duplicates.  The
 * expected number of modules is small, so we don't do anything
 * fancier.  TODO(bsy): measure performance loss and consider
 * alternatives.
 */

struct NaClLogModuleVerbosity {
  struct NaClLogModuleVerbosity *next;
  char const                    *module_name;  /* strdup'd */
  int                           verbosity;
};

static struct NaClLogModuleVerbosity *gNaClLogModuleVerbosity = NULL;

static FILE *NaClLogFileIoBufferFromFile(char const *log_file) {
  int   log_desc;
  FILE  *log_iob;

  log_desc = open(log_file, O_WRONLY | O_APPEND | O_CREAT, 0777);
  if (-1 == log_desc) {
    perror("NaClLogSetFile");
    fprintf(stderr, "Could not create log file\n");
    NaClAbort();
  }

  log_iob = FDOPEN(log_desc, "a");
  if (NULL == log_iob) {
    perror("NaClLogSetFile");
    fprintf(stderr, "Could not fdopen log stream\n");
    NaClAbort();
  }
  return log_iob;
}

/*
 * Setting the log stream buffering to fully buffered, so that the
 * write of the tag string will be less likely to be separated
 * from the write of the actual log message.
 */
static FILE *NaClLogDupFileIo(FILE *orig) {
  int  d;
  FILE *copy;

  /*
   * On windows (at least on a win7 machine which i tested on),
   * fileno(stderr) is -2.  I/O to the stderr stream appears to
   * succeed -- though who knows, maybe fclose(stderr) would actually
   * report an error? -- but DUP of -2 fails.  We don't try to detect
   * -2 (or other windows magic values) as a special case here, since
   * in the future other FILE* might be used here.  Instead, we just
   * check for DUP failure and trundle on as best as we could.
   */
  if (-1 == (d = DUP(fileno(orig)))) {
    copy = orig;
    /* this means that setvbuf later will affect the shared stream */
  } else if (NULL == (copy = FDOPEN(d, "a"))) {
    copy = orig;
    /* ditto */
  }
  (void) setvbuf(copy, (char *) NULL, _IOFBF, 1024);
  return copy;
}

static struct Gio *NaClLogGioFromFileIoBuffer(FILE *log_iob) {
  struct GioFile *log_gio;

  log_gio = malloc(sizeof *log_gio);
  if (NULL == log_gio) {
    perror("NaClLogSetFile");
    fprintf(stderr, "No memory for log buffers\n");
    NaClAbort();
  }
  if (!GioFileRefCtor(log_gio, log_iob)) {
    fprintf(stderr, "NaClLog module internal error: GioFileRefCtor failed\n");
    NaClAbort();
  }
  return (struct Gio *) log_gio;
}

void NaClLogSetFile(char const *log_file) {
  NaClLogSetGio(NaClLogGioFromFileIoBuffer(
      NaClLogFileIoBufferFromFile(log_file)));
}

int NaClLogDefaultLogVerbosity(void) {
  char *env_verbosity;

  if (NULL != (env_verbosity = getenv("NACLVERBOSITY"))) {
    int v = strtol(env_verbosity, (char **) 0, 0);

    if (v >= 0) {
      return v;
    }
  }
  return 0;
}

struct Gio *NaClLogDefaultLogGio(void) {
  char            *log_file;
  FILE            *log_iob;

  log_file = getenv("NACLLOG");

  if (NULL == log_file) {
    log_iob = NaClLogDupFileIo(stderr);
  } else {
    log_iob = NaClLogFileIoBufferFromFile(log_file);
  }
  return NaClLogGioFromFileIoBuffer(log_iob);
}

void NaClLogParseAndSetModuleVerbosityMap(char const *module_verbosity_map) {
  char        entry_buf[256];
  size_t      entry_len;
  char const  *sep;
  char const  *next;
  char        *assign;
  int         seen_global = 0;
  char        *module_name;
  int         module_verbosity;

  if (NULL == module_verbosity_map) {
    return;
  }

  while (*module_verbosity_map != '\0') {
    sep = strpbrk(module_verbosity_map, ",:");
    if (NULL == sep) {
      sep = module_verbosity_map + strlen(module_verbosity_map);
      next = sep;
    } else {
      next = sep + 1;
    }
    /* post: sep points to comma or termination NUL */
    entry_len = sep - module_verbosity_map;
    if (entry_len > sizeof entry_buf - 1) {
      NaClLog(LOG_ERROR,
              "NaClLog: entry too long in module verbosity map \"%.*s\".\n",
              (int) entry_len,
              module_verbosity_map);
      entry_len = sizeof entry_buf - 1;
    }
    strncpy(entry_buf, module_verbosity_map, entry_len);
    entry_buf[entry_len] = '\0';
    assign = strchr(entry_buf, '=');
    if (NULL == assign && !seen_global) {
      verbosity = strtol(entry_buf, (char **) 0, 0);
      seen_global = 1;
    } else {
      *assign = '\0';

      module_verbosity = strtol(assign+1, (char **) 0, 0);

      while (entry_buf < assign && (' ' == assign[-1] || '\t' == assign[-1])) {
        *--assign = '\0';
      }
      if (entry_buf == assign) {
        NaClLog(LOG_FATAL,
                "NaClLog: Bad module name in \"%s\".\n",
                module_verbosity_map);
      }

      for (module_name = entry_buf;
           ' ' == *module_name || '\t' == *module_name;
           ++module_name) {
        ;
      }
      NaClLogSetModuleVerbosity(module_name, module_verbosity);
    }
    module_verbosity_map = next;
  }
}

void NaClLogModuleInitExtended2(int         default_verbosity,
                                char const  *module_verbosity_map,
                                struct Gio  *log_gio) {
  if (!g_initialized) {
#if !THREAD_SAFE_DETAIL_CHECK && !NACL_PLATFORM_HAS_TLS && NACL_PLATFORM_HAS_TSD
    int errnum;

    if (0 != (errnum = pthread_key_create(&gModuleNameKey, NULL))) {
      fprintf(stderr, "NaClLogModuleInitExtended2: "
              "pthread_key_create failed\n");
      abort();
    }
#endif
    NaClXMutexCtor(&log_mu);
    g_initialized = 1;
  }
  NaClLogSetVerbosity(default_verbosity);
  NaClLogParseAndSetModuleVerbosityMap(module_verbosity_map);
  NaClLogSetGio(log_gio);
}

void NaClLogModuleInitExtended(int        initial_verbosity,
                               struct Gio *log_gio) {

  NaClLogModuleInitExtended2(initial_verbosity,
                             getenv("NACLVERBOSITY"),
                             log_gio);
}

void NaClLogModuleInit(void) {
  NaClLogModuleInitExtended(NaClLogDefaultLogVerbosity(),
                            NaClLogDefaultLogGio());
}

void NaClLogModuleFini(void) {
  struct NaClLogModuleVerbosity *entry;
  struct NaClLogModuleVerbosity *next;

  entry = gNaClLogModuleVerbosity;
  while (entry != NULL) {
    next = entry->next;
    free(entry);
    entry = next;
  }
  gNaClLogModuleVerbosity = NULL;
  NaClMutexDtor(&log_mu);
  g_initialized = 0;
}

void NaClLogTagNext_mu(void) {
  tag_output = 1;
}

void NaClLogLock(void) {
  NaClXMutexLock(&log_mu);
  NaClLogTagNext_mu();
}

void NaClLogUnlock(void) {
  int run_abort_behavior = 0;
  switch (g_abort_count) {
    case 0:
      NaClXMutexUnlock(&log_mu);
      break;
    case 1:
      /*
       * include an easy-to-recognize output for the fuzzer to recognize
       */
      if (!g_abort_behavior_active) {
        NaClLog_mu(LOG_ERROR, "LOG_FATAL abort exit\n");
        g_abort_behavior_active = 1;
        run_abort_behavior = 1;
        /*
         * run abort behavior only on edge transition when
         * g_abort_behavior_active is first set.
         */
      }
      NaClXMutexUnlock(&log_mu);
      if (run_abort_behavior) {
#ifdef __COVERITY__
        NaClAbort();  /* help coverity figure out that this is the default */
#else
        (*gNaClLogAbortBehavior)();
#endif
        NaClAbort();
      }
      break;
    default:
      /*
       * Abort handling code in turn aborted.  Eeep!
       */
      NaClAbort();
      break;
  }
}

static INLINE struct Gio *NaClLogGetGio_mu(void) {
  if (NULL == log_stream) {
    (void) GioFileRefCtor(&log_file_stream, NaClLogDupFileIo(stderr));
    log_stream = (struct Gio *) &log_file_stream;
  }
  return log_stream;
}

static void NaClLogSetVerbosity_mu(int verb) {
  verbosity = verb;
}

void NaClLogPreInitSetVerbosity(int verb) {
  /*
   * The lock used by NaClLogLock has not been initialized and cannot
   * be used; however, prior to initialization we are not going to be
   * invoked from multiple threads, since the caller is responsible
   * for not invoking NaClLog module functions (except for the PreInit
   * ones, obviously) at all, let alone from multiple threads.  Ergo,
   * it is safe to manipulate the module globals without locking.
   */
  NaClLogSetVerbosity_mu(verb);
}

void  NaClLogSetVerbosity(int verb) {
  NaClLogLock();
  NaClLogSetVerbosity_mu(verb);
  NaClLogUnlock();
}

void  NaClLogIncrVerbosity(void) {
  NaClLogLock();
  if (NACL_VERBOSITY_UNSET == verbosity) {
    verbosity = 0;
  }
  ++verbosity;
  NaClLogUnlock();
}

int NaClLogGetVerbosity(void) {
  int v;

  NaClLogLock();
  if (NACL_VERBOSITY_UNSET == verbosity) {
    verbosity = 0;
  }
  v = verbosity;
  NaClLogUnlock();

  return v;
}

static void NaClLogSetGio_mu(struct Gio *stream) {
  if (NULL != log_stream) {
    (void) (*log_stream->vtbl->Flush)(log_stream);
  }
  log_stream = stream;
}

void NaClLogPreInitSetGio(struct Gio *out_stream) {
  /*
   * See thread safety comment in NaClLogPreInitSetVerbosity.
   */
  NaClLogSetGio_mu(out_stream);
}

void NaClLogSetGio(struct Gio *stream) {
  NaClLogLock();
  NaClLogSetGio_mu(stream);
  NaClLogUnlock();
}

struct Gio  *NaClLogGetGio(void) {
  struct Gio  *s;

  NaClLogLock();
  s = NaClLogGetGio_mu();
  NaClLogUnlock();

  return s;
}

void NaClLogEnableTimestamp(void) {
  timestamp_enabled = 1;
}

void NaClLogDisableTimestamp(void) {
  timestamp_enabled = 0;
}

static void NaClLogOutputTag_mu(struct Gio *s) {
  char timestamp[128];
  int  pid;

  if (timestamp_enabled && tag_output) {
    pid = GETPID();
    gprintf(s, "[%d,%u:%s] ",
            pid,
            NaClThreadId(),
            NaClTimeStampString(timestamp, sizeof timestamp));
    tag_output = 0;
  }
}

/*
 * Output a printf-style formatted message if the log verbosity level
 * is set higher than the log output's detail level.  Note that since
 * this is not a macro, log message arguments that have side effects
 * will have their side effects regardless of whether the
 * corresponding log message is printed or not.  This is good from a
 * consistency point of view, but it means that should a logging
 * argument be expensive to compute, the log statement needs to be
 * surrounded by something like
 *
 *  if (detail_level <= NaClLogGetVerbosity()) {
 *    NaClLog(detail_level, "format string", expensive_arg(), ...);
 *  }
 *
 * The log message, if written, is prepended by a microsecond
 * resolution timestamp on linux and a millisecond resolution
 * timestamp on windows.  This means that if the NaCl app can read its
 * own logs, it can distinguish which host OS it is running on.
 */
void NaClLogDoLogV_mu(int         detail_level,
                      char const  *fmt,
                      va_list     ap) {
  struct Gio  *s;

  if (0 == g_abort_count) {
    s = NaClLogGetGio_mu();

    NaClLogOutputTag_mu(s);
    (void) gvprintf(s, fmt, ap);
    (void) (*s->vtbl->Flush)(s);
  } else {
    (void) fprintf(stderr, "POST-ABORT: ");
    (void) vfprintf(stderr, fmt, ap);
    (void) fflush(stderr);
  }

  if (LOG_FATAL == detail_level) {
    ++g_abort_count;
  }
}

void NaClLogV_mu(int        detail_level,
                 char const *fmt,
                 va_list    ap) {
  if (NACL_VERBOSITY_UNSET == verbosity) {
    verbosity = NaClLogDefaultLogVerbosity();
  }

  if (detail_level <= verbosity) {
    NaClLogDoLogV_mu(detail_level, fmt, ap);
  }
}

void NaClLogV(int         detail_level,
              char const  *fmt,
              va_list     ap) {
#if !THREAD_SAFE_DETAIL_CHECK
  if (detail_level > verbosity) {
    return;
  }
#endif
  NaClLogLock();
  NaClLogV_mu(detail_level, fmt, ap);
  NaClLogUnlock();
}

void NaClLogSetModuleVerbosity_mu(char const  *module_name,
                                  int         verbosity) {
  struct NaClLogModuleVerbosity *entry;

  entry = (struct NaClLogModuleVerbosity *) malloc(sizeof *entry);
  if (NULL == entry) {
    NaClLog_mu(LOG_FATAL,
               ("NaClLogSetModuleVerbosity_mu: Out of memory while setting"
                " module record for module: %s, verbosity: %d\n"),
               module_name, verbosity);
  }
  entry->module_name = STRDUP(module_name);
  if (NULL == entry->module_name) {
    NaClLog_mu(LOG_FATAL,
               ("NaClLogSetModuleVerbosity_mu: Out of memory while duplicating"
                " module name: %s, verbosity: %d\n"),
               module_name, verbosity);
  }
  entry->verbosity = verbosity;
  entry->next = gNaClLogModuleVerbosity;
  gNaClLogModuleVerbosity = entry;
}

void NaClLogSetModuleVerbosity(char const *module_name,
                               int        verbosity) {
  NaClLogLock();
  NaClLogSetModuleVerbosity_mu(module_name, verbosity);
  NaClLogUnlock();
}

/*
 * After initialization, gNaClLogModuleVerbosity is read-only, so can
 * be examined sans locking.
 */
int NaClLogGetModuleVerbosity_mu(char const *module_name) {
  struct NaClLogModuleVerbosity *p;

  if (NULL != module_name) {
    for (p = gNaClLogModuleVerbosity; NULL != p; p = p->next) {
      if (!strcmp(p->module_name, module_name)) {
        return p->verbosity;
      }
    }
  }
  return verbosity;
}

int NaClLogGetModuleVerbosity(char const *module_name) {
  int rv;
  NaClLogLock();
  rv = NaClLogGetModuleVerbosity_mu(module_name);
  NaClLogUnlock();
  return rv;
}

#if NACL_PLATFORM_HAS_TLS
int NaClLogSetModule(char const *module_name) {
  gTls_ModuleName = module_name;
  return 0;
}

static void NaClLogDoLogAndUnsetModuleV(int        detail_level,
                                        const char *fmt,
                                        va_list    ap) {
  int module_verbosity;

  module_verbosity = NaClLogGetModuleVerbosity_mu(gTls_ModuleName);
  if (detail_level <= module_verbosity) {
    NaClLogLock();
    NaClLogDoLogV_mu(detail_level, fmt, ap);
    NaClLogUnlock();
  }
  gTls_ModuleName = (char const *) NULL;
}

#elif NACL_PLATFORM_HAS_TSD
int NaClLogSetModule(char const *module_name) {
  (void) pthread_setspecific(gModuleNameKey, (void const *) module_name);
  return 0;
}

static void NaClLogDoLogAndUnsetModuleV(int        detail_level,
                                        const char *fmt,
                                        va_list    ap) {
  char const  *module_name = (char const *) pthread_getspecific(gModuleNameKey);
  int         module_verbosity;

  module_verbosity = NaClLogGetModuleVerbosity_mu(module_name);
  if (detail_level <= module_verbosity) {
    NaClLogLock();
    NaClLogDoLogV_mu(detail_level, fmt, ap);
    NaClLogUnlock();
  }
  (void) pthread_setspecific(gModuleNameKey, (void const *) NULL);
}

#else
/* !NACL_PLATFORM_HAS_TLS && !NACL_PLATFORM_HAS_TSD */

int NaClLogSetModule(char const *module_name) {
  NaClLogLock();
  nacl_log_module_name = module_name;
  return 0;
}

static void NaClLogDoLogAndUnsetModuleV(int         detail_level,
                                        char const  *fmt,
                                        va_list     ap) {
  int module_verbosity;

  module_verbosity = NaClLogGetModuleVerbosity_mu(nacl_log_module_name);
  if (detail_level <= module_verbosity) {
    NaClLogDoLogV_mu(detail_level, fmt, ap);
  }
  nacl_log_module_name = NULL;
  NaClLogUnlock();
}
#endif

void NaClLogDoLogAndUnsetModule(int        detail_level,
                                char const *fmt,
                                ...) {
  va_list ap;

  va_start(ap, fmt);
  NaClLogDoLogAndUnsetModuleV(detail_level, fmt, ap);
  va_end(ap);
}

void NaClLog(int         detail_level,
             char const  *fmt,
             ...) {
  va_list ap;

#if !THREAD_SAFE_DETAIL_CHECK
  if (NACL_LIKELY(detail_level > verbosity)) {
    return;
  }
#endif

  NaClLogLock();
  va_start(ap, fmt);
  NaClLogV_mu(detail_level, fmt, ap);
  va_end(ap);
  NaClLogUnlock();
}

void NaClLog_mu(int         detail_level,
                char const  *fmt,
                ...) {
  va_list ap;

#if THREAD_SAFE_DETAIL_CHECK
  if (detail_level > verbosity) {
    return;
  }
#endif

  va_start(ap, fmt);
  NaClLogV_mu(detail_level, fmt, ap);
  va_end(ap);
}

void NaClLog2(char const *module_name,
              int        detail_level,
              char const *fmt,
              ...) {
  va_list ap;

  NaClLogSetModule(module_name);
  va_start(ap, fmt);
  NaClLogDoLogAndUnsetModuleV(detail_level, fmt, ap);
  va_end(ap);
}

void NaClLogSetAbortBehavior(void (*fn)(void)) {
  NaClXMutexLock(&log_mu);
  gNaClLogAbortBehavior = fn;
  NaClXMutexUnlock(&log_mu);
}


text:
<?php

namespace ANDS\API\Task\ImportSubTask;
use ANDS\Registry\Providers\RelationshipProvider;
use ANDS\Repository\RegistryObjectsRepository;

/**
 * Class ProcessGrantsRelationship
 * @package ANDS\API\Task\ImportSubTask
 */
class ProcessGrantsRelationship extends ImportSubTask
{
    protected $requireImportedRecords = true;
    protected $title = "PROCESSING GRANTS NETWORK RELATIONSHIPS";

    public function run_task()
    {
        $targetStatus = $this->parent()->getTaskData('targetStatus');
        if (!RegistryObjectsRepository::isPublishedStatus($targetStatus)) {
            $this->log("Target status is ". $targetStatus.' does not process grants network');
            return;
        }

        // importedRecords should already be ordered by ProcessRelationship
        $importedRecords = $this->parent()->getTaskData("importedRecords");
        $total = count($importedRecords);

        $this->log("Process Grants (inferred) Relationships started for $total records");

        foreach ($importedRecords as $index => $id) {
            $record = RegistryObjectsRepository::getRecordByID($id);
            // process implicit relationships for the grants network
            RelationshipProvider::processGrantsRelationship($record);
            $this->updateProgress($index, $total, "Processed ($index/$total) $record->title($record->registry_object_id)");
            tearDownEloquent();
        }

        $this->log("Process Grants (inferred) Relationships completed for $total records");
    }
}