text:
package azkaban.execapp.event;

import static azkaban.jobcallback.JobCallbackConstants.CONTEXT_EXECUTION_ID_TOKEN;
import static azkaban.jobcallback.JobCallbackConstants.FIRST_JOB_CALLBACK_URL_TEMPLATE;
import static azkaban.jobcallback.JobCallbackConstants.CONTEXT_FLOW_TOKEN;
import static azkaban.jobcallback.JobCallbackConstants.HEADER_ELEMENT_DELIMITER;
import static azkaban.jobcallback.JobCallbackConstants.HEADER_NAME_VALUE_DELIMITER;
import static azkaban.jobcallback.JobCallbackConstants.HTTP_GET;
import static azkaban.jobcallback.JobCallbackConstants.HTTP_POST;
import static azkaban.jobcallback.JobCallbackConstants.JOB_CALLBACK_BODY_TEMPLATE;
import static azkaban.jobcallback.JobCallbackConstants.JOB_CALLBACK_REQUEST_HEADERS_TEMPLATE;
import static azkaban.jobcallback.JobCallbackConstants.JOB_CALLBACK_REQUEST_METHOD_TEMPLATE;
import static azkaban.jobcallback.JobCallbackConstants.JOB_CALLBACK_URL_TEMPLATE;
import static azkaban.jobcallback.JobCallbackConstants.CONTEXT_JOB_STATUS_TOKEN;
import static azkaban.jobcallback.JobCallbackConstants.CONTEXT_JOB_TOKEN;
import static azkaban.jobcallback.JobCallbackConstants.CONTEXT_PROJECT_TOKEN;
import static azkaban.jobcallback.JobCallbackConstants.SEQUENCE_TOKEN;
import static azkaban.jobcallback.JobCallbackConstants.CONTEXT_SERVER_TOKEN;
import static azkaban.jobcallback.JobCallbackConstants.STATUS_TOKEN;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;

import org.apache.http.Header;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.entity.StringEntity;
import org.apache.http.message.BasicHeader;
import org.apache.log4j.Logger;

import azkaban.event.Event;
import azkaban.execapp.JobRunner;
import azkaban.executor.ExecutableNode;
import azkaban.jobcallback.JobCallbackStatusEnum;
import azkaban.utils.Props;

public class JobCallbackUtil {
  private static final Logger logger = Logger.getLogger(JobCallbackUtil.class);

  private static Map<JobCallbackStatusEnum, String> firstJobcallbackPropertyMap =
      new HashMap<JobCallbackStatusEnum, String>(
          JobCallbackStatusEnum.values().length);

  static {
    for (JobCallbackStatusEnum statusEnum : JobCallbackStatusEnum.values()) {
      firstJobcallbackPropertyMap.put(statusEnum,
          replaceStatusToken(FIRST_JOB_CALLBACK_URL_TEMPLATE, statusEnum));
    }
  }

  /**
   * Use to quickly determine if there is a job callback related property in the
   * Props.
   *
   * @param props
   * @param status
   * @return true if there is job callback related property
   */
  public static boolean isThereJobCallbackProperty(Props props,
      JobCallbackStatusEnum status) {

    if (props == null || status == null) {
      throw new NullPointerException("One of the argument is null");
    }

    String jobCallBackUrl = firstJobcallbackPropertyMap.get(status);
    return props.containsKey(jobCallBackUrl);
  }

  public static boolean isThereJobCallbackProperty(Props props,
      JobCallbackStatusEnum... jobStatuses) {

    if (props == null || jobStatuses == null) {
      throw new NullPointerException("One of the argument is null");
    }

    for (JobCallbackStatusEnum jobStatus : jobStatuses) {
      if (JobCallbackUtil.isThereJobCallbackProperty(props, jobStatus)) {
        return true;
      }
    }
    return false;
  }

  public static List<HttpRequestBase> parseJobCallbackProperties(Props props,
      JobCallbackStatusEnum status, Map<String, String> contextInfo,
      int maxNumCallback) {

    return parseJobCallbackProperties(props, status, contextInfo,
        maxNumCallback, logger);
  }

  /**
   * This method is responsible for parsing job call URL properties and convert
   * them into a list of HttpRequestBase, which callers can use to execute.
   *
   * In addition to parsing, it will also replace the tokens with actual values.
   *
   * @param props
   * @param status
   * @param event
   * @return List<HttpRequestBase> - empty if no job callback related properties
   */
  public static List<HttpRequestBase> parseJobCallbackProperties(Props props,
      JobCallbackStatusEnum status, Map<String, String> contextInfo,
      int maxNumCallback, Logger privateLogger) {
    String callbackUrl = null;

    if (!isThereJobCallbackProperty(props, status)) {
      // short circuit
      return Collections.emptyList();
    }

    List<HttpRequestBase> result = new ArrayList<HttpRequestBase>();

    // replace property templates with status
    String jobCallBackUrlKey =
        replaceStatusToken(JOB_CALLBACK_URL_TEMPLATE, status);

    String requestMethod =
        replaceStatusToken(JOB_CALLBACK_REQUEST_METHOD_TEMPLATE, status);

    String httpBodyKey = replaceStatusToken(JOB_CALLBACK_BODY_TEMPLATE, status);

    String headersKey =
        replaceStatusToken(JOB_CALLBACK_REQUEST_HEADERS_TEMPLATE, status);

    for (int sequence = 1; sequence <= maxNumCallback; sequence++) {
      HttpRequestBase httpRequest = null;
      String sequenceStr = Integer.toString(sequence);
      // callback url
      String callbackUrlKey =
          jobCallBackUrlKey.replace(SEQUENCE_TOKEN, sequenceStr);

      callbackUrl = props.get(callbackUrlKey);
      if (callbackUrl == null || callbackUrl.length() == 0) {
        // no more needs to done
        break;
      } else {
        String callbackUrlWithTokenReplaced =
            replaceTokens(callbackUrl, contextInfo, true);

        String requestMethodKey =
            requestMethod.replace(SEQUENCE_TOKEN, sequenceStr);

        String method = props.getString(requestMethodKey, HTTP_GET);

        if (HTTP_POST.equals(method)) {
          String postBodyKey = httpBodyKey.replace(SEQUENCE_TOKEN, sequenceStr);
          String httpBodyValue = props.get(postBodyKey);
          if (httpBodyValue == null) {
            // missing body for POST, not good
            // update the wiki about skipping callback url if body is missing
            privateLogger.warn("Missing value for key: " + postBodyKey
                + " skipping job callback '" + callbackUrl + " for job "
                + contextInfo.get(CONTEXT_JOB_TOKEN));
          } else {
            // put together an URL
            HttpPost httpPost = new HttpPost(callbackUrlWithTokenReplaced);
            String postActualBody =
                replaceTokens(httpBodyValue, contextInfo, false);
            privateLogger.info("postActualBody: " + postActualBody);
            httpPost.setEntity(createStringEntity(postActualBody));
            httpRequest = httpPost;
          }
        } else if (HTTP_GET.equals(method)) {
          // GET
          httpRequest = new HttpGet(callbackUrlWithTokenReplaced);
        } else {
          privateLogger.warn("Unsupported request method: " + method
              + ". Only POST and GET are supported");
        }

        String headersKeyPerSequence =
            headersKey.replace(SEQUENCE_TOKEN, sequenceStr);
        String headersValue = props.get(headersKeyPerSequence);
        privateLogger.info("headers: " + headersValue);
        Header[] headers = parseHttpHeaders(headersValue);
        if (headers != null) {
          httpRequest.setHeaders(headers);
          privateLogger.info("# of headers found: " + headers.length);
        }
        result.add(httpRequest);
      }
    }
    return result;
  }

  /**
   * Parse headers
   *
   * @param headers
   * @return null if headers is null or empty
   */
  public static Header[] parseHttpHeaders(String headers) {
    if (headers == null || headers.length() == 0) {
      return null;
    }

    String[] headerArray = headers.split(HEADER_ELEMENT_DELIMITER);
    List<Header> headerList = new ArrayList<Header>(headerArray.length);
    for (int i = 0; i < headerArray.length; i++) {
      String headerPair = headerArray[i];
      int index = headerPair.indexOf(HEADER_NAME_VALUE_DELIMITER);
      if (index != -1) {
        headerList.add(new BasicHeader(headerPair.substring(0, index),
            headerPair.substring(index + 1)));
      }

    }
    return headerList.toArray(new BasicHeader[0]);
  }

  private static String replaceStatusToken(String template,
      JobCallbackStatusEnum status) {
    return template.replaceFirst(STATUS_TOKEN, status.name().toLowerCase());
  }

  private static StringEntity createStringEntity(String str) {
    try {
      return new StringEntity(str);
    } catch (UnsupportedEncodingException e) {
      throw new RuntimeException("Encoding not supported", e);
    }
  }

  /**
   * This method takes the job context info. and put the values into a map with
   * keys as the tokens.
   *
   * @param event
   * @return Map<String,String>
   */
  public static Map<String, String> buildJobContextInfoMap(Event event,
      String server) {

    if (event.getRunner() instanceof JobRunner) {
      JobRunner jobRunner = (JobRunner) event.getRunner();
      ExecutableNode node = jobRunner.getNode();
      String projectName = node.getParentFlow().getProjectName();
      String flowName = node.getParentFlow().getFlowId();
      String executionId =
          String.valueOf(node.getParentFlow().getExecutionId());
      String jobId = node.getId();

      Map<String, String> result = new HashMap<String, String>();
      result.put(CONTEXT_SERVER_TOKEN, server);
      result.put(CONTEXT_PROJECT_TOKEN, projectName);
      result.put(CONTEXT_FLOW_TOKEN, flowName);
      result.put(CONTEXT_EXECUTION_ID_TOKEN, executionId);
      result.put(CONTEXT_JOB_TOKEN, jobId);
      result.put(CONTEXT_JOB_STATUS_TOKEN, node.getStatus().name().toLowerCase());

      /*
       * if (node.getStatus() == Status.SUCCEEDED || node.getStatus() ==
       * Status.FAILED) { result.put(JOB_STATUS_TOKEN,
       * node.getStatus().name().toLowerCase()); } else if (node.getStatus() ==
       * Status.PREPARING) { result.put(JOB_STATUS_TOKEN, "started"); }
       */

      return result;

    } else {
      throw new IllegalArgumentException("Provided event is not a job event");
    }
  }

  /**
   * Replace the supported tokens in the URL with values in the contextInfo.
   * This will also make sure the values are HTTP encoded.
   *
   * @param value
   * @param contextInfo
   * @param withEncoding - whether the token values will be HTTP encoded
   * @return String - value with tokens replaced with values
   */
  public static String replaceTokens(String value,
      Map<String, String> contextInfo, boolean withEncoding) {

    String result = value;
    String tokenValue =
        encodeQueryParam(contextInfo.get(CONTEXT_SERVER_TOKEN), withEncoding);
    result = result.replaceFirst(Pattern.quote(CONTEXT_SERVER_TOKEN), tokenValue);

    tokenValue = encodeQueryParam(contextInfo.get(CONTEXT_PROJECT_TOKEN), withEncoding);
    result = result.replaceFirst(Pattern.quote(CONTEXT_PROJECT_TOKEN), tokenValue);

    tokenValue = encodeQueryParam(contextInfo.get(CONTEXT_FLOW_TOKEN), withEncoding);
    result = result.replaceFirst(Pattern.quote(CONTEXT_FLOW_TOKEN), tokenValue);

    tokenValue = encodeQueryParam(contextInfo.get(CONTEXT_JOB_TOKEN), withEncoding);
    result = result.replaceFirst(Pattern.quote(CONTEXT_JOB_TOKEN), tokenValue);

    tokenValue =
        encodeQueryParam(contextInfo.get(CONTEXT_EXECUTION_ID_TOKEN), withEncoding);
    result = result.replaceFirst(Pattern.quote(CONTEXT_EXECUTION_ID_TOKEN), tokenValue);

    tokenValue =
        encodeQueryParam(contextInfo.get(CONTEXT_JOB_STATUS_TOKEN), withEncoding);

    result = result.replaceFirst(Pattern.quote(CONTEXT_JOB_STATUS_TOKEN), tokenValue);

    return result;
  }

  private static String encodeQueryParam(String str, boolean withEncoding) {
    if (!withEncoding) {
      return str;
    }
    try {
      return URLEncoder.encode(str, "UTF-8");
    } catch (UnsupportedEncodingException e) {
      throw new IllegalArgumentException(
          "Encountered problem during encoding:", e);
    }
  }
}


text:
ACCEPTED

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

#### Published in
Cryptog. Mycol. 15(2): 138 (1994)

#### Original name
Galzinia occidentalis D.P. Rogers, 1944

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
package org.springframework.context.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Indicates that a class declares one or more {@link Bean @Bean} methods and may be processed
 * by the Spring container to generate bean definitions and service requests for those
 * beans at runtime, for example:
 *

 * @Configuration
 * public class AppConfig {
 *     @Bean
 *     public MyBean myBean() {
 *         // instantiate, configure and return bean ...
 *     }
 * }

 *
 *
Bootstrapping {@code @Configuration} classes

 *
Via {@code AnnotationConfigApplicationContext}

 * {@code @Configuration} classes are typically bootstrapped using either
 * {@link AnnotationConfigApplicationContext} or its web-capable variant,
 * {@link org.springframework.web.context.support.AnnotationConfigWebApplicationContext
 * AnnotationConfigWebApplicationContext}.
 * A simple example with the former follows:
 *

 * AnnotationConfigApplicationContext ctx =
 *     new AnnotationConfigApplicationContext();
 * ctx.register(AppConfig.class);
 * ctx.refresh();
 * MyBean myBean = ctx.getBean(MyBean.class);
 * // use myBean ...

 *
 * See {@link AnnotationConfigApplicationContext} Javadoc for further details and see
 * {@link org.springframework.web.context.support.AnnotationConfigWebApplicationContext
 * AnnotationConfigWebApplicationContext} for {@code web.xml} configuration instructions.
 *
 *
Via Spring {@code <beans>} XML

 *
As an alternative to registering {@code @Configuration} classes directly against an
 * {@code AnnotationConfigApplicationContext}, {@code @Configuration} classes may be
 * declared as normal {@code <bean>} definitions within Spring XML files:
 *

 * {@code
 * <beans>
 *    <context:annotation-config/>
 *    <bean class="com.acme.AppConfig"/>
 * </beans>}

 *
 * In the example above, {@code <context:annotation-config/>} is required in order to
 * enable {@link ConfigurationClassPostProcessor} and other annotation-related
 * post processors that facilitate handling {@code @Configuration} classes.
 *
 *
Via component scanning

 *
{@code @Configuration} is meta-annotated with {@link Component @Component}, therefore
 * {@code @Configuration} classes are candidates for component scanning (typically using
 * Spring XML's {@code <context:component-scan/>} element) and therefore may also take
 * advantage of {@link Autowired @Autowired}/{@link javax.inject.Inject @Inject}
 * at the field and method level (but not at the constructor level).
 *
{@code @Configuration} classes may not only be bootstrapped using
 * component scanning, but may also themselves configure component scanning using
 * the {@link ComponentScan @ComponentScan} annotation:
 *

 * @Configuration
 * @ComponentScan("com.acme.app.services")
 * public class AppConfig {
 *     // various @Bean definitions ...
 * }

 *
 * See {@link ComponentScan @ComponentScan} Javadoc for details.
 *
 *
 *
Working with externalized values

 *
Using the {@code Environment} API

 * Externalized values may be looked up by injecting the Spring
 * {@link org.springframework.core.env.Environment Environment} into a
 * {@code @Configuration} class using the {@code @Autowired} or the {@code @Inject}
 * annotation:
 *

 * @Configuration
 * public class AppConfig {
 *     &#064Inject Environment env;
 *
 *     @Bean
 *     public MyBean myBean() {
 *         MyBean myBean = new MyBean();
 *         myBean.setName(env.getProperty("bean.name"));
 *         return myBean;
 *     }
 * }

 *
 * Properties resolved through the {@code Environment} reside in one or more "property
 * source" objects, and {@code @Configuration} classes may contribute property sources to
 * the {@code Environment} object using
 * the {@link org.springframework.core.env.PropertySources @PropertySources} annotation:
 *

 * @Configuration
 * @PropertySource("classpath:/com/acme/app.properties")
 * public class AppConfig {
 *     &#064Inject Environment env;
 *
 *     @Bean
 *     public MyBean myBean() {
 *         return new MyBean(env.getProperty("bean.name"));
 *     }
 * }

 *
 * See {@link org.springframework.core.env.Environment Environment}
 * and {@link PropertySource @PropertySource} Javadoc for further details.
 *
 *
Using the {@code @Value} annotation

 * Externalized values may be 'wired into' {@code @Configuration} classes using
 * the {@link Value @Value} annotation:
 *

 * @Configuration
 * @PropertySource("classpath:/com/acme/app.properties")
 * public class AppConfig {
 *     &#064Value("${bean.name}") String beanName;
 *
 *     @Bean
 *     public MyBean myBean() {
 *         return new MyBean(beanName);
 *     }
 * }

 *
 * This approach is most useful when using Spring's
 * {@link org.springframework.context.support.PropertySourcesPlaceholderConfigurer
 * PropertySourcesPlaceholderConfigurer}, usually enabled via XML with
 * {@code <context:property-placeholder/>}.  See the section below on composing
 * {@code @Configuration} classes with Spring XML using {@code @ImportResource},
 * see {@link Value @Value} Javadoc, and see {@link Bean @Bean} Javadoc for details on working with
 * {@code BeanFactoryPostProcessor} types such as
 * {@code PropertySourcesPlaceholderConfigurer}.
 *
 *
Composing {@code @Configuration} classes

 *
With the {@code @Import} annotation

 *
{@code @Configuration} classes may be composed using the {@link Import @Import} annotation,
 * not unlike the way that {@code <import>} works in Spring XML. Because
 * {@code @Configuration} objects are managed as Spring beans within the container,
 * imported configurations may be injected using {@code @Autowired} or {@code @Inject}:
 *

 * @Configuration
 * public class DatabaseConfig {
 *     @Bean
 *     public DataSource dataSource() {
 *         // instantiate, configure and return DataSource
 *     }
 * }
 *
 * @Configuration
 * @Import(DatabaseConfig.class)
 * public class AppConfig {
 *     &#064Inject DatabaseConfig dataConfig;
 *
 *     @Bean
 *     public MyBean myBean() {
 *         // reference the dataSource() bean method
 *         return new MyBean(dataConfig.dataSource());
 *     }
 * }

 *
 * Now both {@code AppConfig} and the imported {@code DatabaseConfig} can be bootstrapped
 * by registering only {@code AppConfig} against the Spring context:
 *
 *

 * new AnnotationConfigApplicationContext(AppConfig.class);

 *
 *
With the {@code @Profile} annotation

 * {@code @Configuration} classes may be marked with the {@link Profile @Profile} annotation to
 * indicate they should be processed only if a given profile or profiles are
 * active:
 *

 * @Profile("embedded")
 * @Configuration
 * public class EmbeddedDatabaseConfig {
 *     @Bean
 *     public DataSource dataSource() {
 *         // instantiate, configure and return embedded DataSource
 *     }
 * }
 *
 * @Profile("production")
 * @Configuration
 * public class ProductionDatabaseConfig {
 *     @Bean
 *     public DataSource dataSource() {
 *         // instantiate, configure and return production DataSource
 *     }
 * }

 *
 * See {@link Profile @Profile} and {@link org.springframework.core.env.Environment Environment}
 * Javadoc for further details.
 *
 *
With Spring XML using the {@code @ImportResource} annotation

 * As mentioned above, {@code @Configuration} classes may be declared as regular Spring
 * {@code <bean>} definitions within Spring XML files. It is also possible to
 * import Spring XML configuration files into {@code @Configuration} classes using
 * the {@link ImportResource @ImportResource} annotation. Bean definitions imported from XML can be
 * injected using {@code @Autowired} or {@code @Import}:
 *

 * @Configuration
 * @ImportResource("classpath:/com/acme/database-config.xml")
 * public class AppConfig {
 *     &#064Inject DataSource dataSource; // from XML
 *
 *     @Bean
 *     public MyBean myBean() {
 *         // inject the XML-defined dataSource bean
 *         return new MyBean(this.dataSource);
 *     }
 * }

 *
 *
With nested {@code @Configuration} classes

 * {@code @Configuration} classes may be nested within one another as follows:
 *

 * @Configuration
 * public class AppConfig {
 *     @Inject DataSource dataSource;
 *
 *     @Bean
 *     public MyBean myBean() {
 *         return new MyBean(dataSource);
 *     }
 *
 *     @Configuration
 *     static class DatabaseConfig {
 *         @Bean
 *         DataSource dataSource() {
 *             return new EmbeddedDatabaseBuilder().build();
 *         }
 *     }
 * }

 *
 * When bootstrapping such an arrangement, only {@code AppConfig} need be registered
 * against the application context. By virtue of being a nested {@code @Configuration}
 * class, {@code DatabaseConfig} will be registered automatically. This avoids
 * the need to use an {@code @Import} annotation when the relationship between
 * {@code AppConfig} {@code DatabaseConfig} is already implicitly clear.
 *
 *
Note also that nested {@code @Configuration} classes can be used to good effect
 * with the {@code @Profile} annotation to provide two options of the same bean to the
 * enclosing {@code @Configuration} class.
 *
 *
Configuring lazy initialization

 *
By default, {@code @Bean} methods will be eagerly instantiated at container
 * bootstrap time.  To avoid this, {@code @Configuration} may be used in conjunction with
 * the {@link Lazy @Lazy} annotation to indicate that all {@code @Bean} methods declared within
 * the class are by default lazily initialized. Note that {@code @Lazy} may be used on
 * individual {@code @Bean} methods as well.
 *
 *
Testing support for {@code @Configuration} classes

 * The Spring TestContext framework available in the {@code spring-test} module
 * provides the {@code @ContextConfiguration} annotation, which as of Spring 3.1 can
 * accept an array of {@code @Configuration} {@code Class} objects:
 *

 * @RunWith(SpringJUnit4ClassRunner.class)
 * @ContextConfiguration(classes={AppConfig.class, DatabaseConfig.class})
 * public class MyTests {
 *
 *     @Autowired MyBean myBean;
 *
 *     @Autowired DataSource dataSource;
 *
 *     @Test
 *     public void test() {
 *         // assertions against myBean ...
 *     }
 * }

 *
 * See TestContext framework reference documentation for details.
 *
 *
Enabling built-in Spring features using {@code @Enable} annotations

 * Spring features such as asynchronous method execution, scheduled task execution,
 * annotation driven transaction management, and even Spring MVC can be enabled and
 * configured from {@code @Configuration}
 * classes using their respective "{@code @Enable}" annotations. See
 * {@link org.springframework.scheduling.annotation.EnableAsync @EnableAsync},
 * {@link org.springframework.scheduling.annotation.EnableScheduling @EnableScheduling},
 * {@link org.springframework.transaction.annotation.EnableTransactionManagement @EnableTransactionManagement},
 * {@link org.springframework.context.annotation.EnableAspectJAutoProxy @EnableAspectJAutoProxy},
 * and {@link org.springframework.web.servlet.config.annotation.EnableWebMvc @EnableWebMvc}
 * for details.
 *
 *
Constraints when authoring {@code @Configuration} classes

 *

 *
@Configuration classes must be non-final
 *
@Configuration classes must be non-local (may not be declared within a method)
 *
@Configuration classes must have a default/no-arg constructor and may not use
 * {@link Autowired @Autowired} constructor parameters. Any nested configuration classes
 * must be {@code static}.
 *

 *
 * @author Rod Johnson
 * @author Chris Beams
 * @since 3.0
 * @see Bean
 * @see Profile
 * @see Import
 * @see ImportResource
 * @see ComponentScan
 * @see Lazy
 * @see PropertySource
 * @see AnnotationConfigApplicationContext
 * @see ConfigurationClassPostProcessor
 * @see org.springframework.core.env.Environment
 * @see org.springframework.test.context.ContextConfiguration
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Component
public @interface Configuration {

	/**
	 * Explicitly specify the name of the Spring bean definition associated
	 * with this Configuration class.  If left unspecified (the common case),
	 * a bean name will be automatically generated.
	 *
The custom name applies only if the Configuration class is picked up via
	 * component scanning or supplied directly to a {@link AnnotationConfigApplicationContext}.
	 * If the Configuration class is registered as a traditional XML bean definition,
	 * the name/id of the bean element will take precedence.
	 * @return the specified bean name, if any
	 * @see org.springframework.beans.factory.support.DefaultBeanNameGenerator
	 */
	String value() default "";

}


text:
from multiprocessing import Process, Queue

import psutil as psutil
import time

import etcdb

def test_select_version(cursor):
    cursor.execute('SELECT VERSION()')
    assert cursor.fetchone()[0] == etcdb.__version__

def test_get_meta_lock(cursor):
    #print(cursor._get_meta_lock('foo', 'bar'))
    #print(cursor._release_meta_lock('foo', 'bar'))
    pass

def test_select_limit(cursor):
    cursor.execute('CREATE TABLE t1(id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255))')
    cursor.execute("INSERT INTO t1(id, name) VALUES (1, 'aaa')")
    cursor.execute("INSERT INTO t1(id, name) VALUES (2, 'bbb')")
    cursor.execute("INSERT INTO t1(id, name) VALUES (3, 'ccc')")
    cursor.execute("SELECT id, name FROM t1 LIMIT 2")
    assert cursor.fetchall() == (
        ('1', 'aaa'),
        ('2', 'bbb'),
    )

def test_select_where(cursor):
    cursor.execute("""
    CREATE TABLE `auth_user` (
  `id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
  `password` varchar(128) NOT NULL,
  `last_login` datetime(6),
  `is_superuser` tinyint NOT NULL,
  `username` varchar(150) NOT NULL,
  `first_name` varchar(30) NOT NULL,
  `last_name` varchar(30) NOT NULL,
  `email` varchar(254) NOT NULL,
  `is_staff` tinyint NOT NULL,
  `is_active` tinyint NOT NULL,
  `date_joined` datetime(6) NOT NULL
)""")
    cursor.execute('SHOW TABLES')
    assert cursor.fetchone() == ('auth_user',)
    cursor.execute("INSERT INTO `auth_user` (id, `password`, `last_login`, "
                   "`is_superuser`, `username`, `first_name`, `last_name`, "
                   "`email`, `is_staff`, `is_active`, `date_joined`) "
                   "VALUES (1, '=', 'None', "
                   "'True', 'root1', 'a', 'b', "
                   "'a@a.com', 'True', 'True', '2017-06-06 20:33:38')")
    cursor.execute("INSERT INTO `auth_user` (id, `password`, `last_login`, "
                   "`is_superuser`, `username`, `first_name`, `last_name`, "
                   "`email`, `is_staff`, `is_active`, `date_joined`) "
                   "VALUES (2, '=', 'None', "
                   "'True', 'root2', 'a', 'b', "
                   "'a@a.com', 'True', 'True', '2017-06-06 20:33:38')")
    cursor.execute('SELECT id, username FROM auth_user')
    assert cursor.fetchone() == ('1', 'root1')
    assert cursor.fetchone() == ('2', 'root2')

    cursor.execute("SELECT id, username FROM auth_user WHERE username = 'root1'")
    assert cursor.fetchone() == ('1', 'root1')

def test_wait_after_increases_modified(cursor):
    cursor.execute('CREATE TABLE t1(id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255))')
    cursor.execute("INSERT INTO t1(id, name) VALUES (1, 'aaa')")
    cursor.execute("SELECT id, name FROM t1 WHERE id = 1")
    assert cursor.n_rows == 1
    etcd_index = int(cursor.result_set.rows[0].etcd_index)
    assert etcd_index > 1
    wait_index = etcd_index + 1

    def _wait(que):

        query = "WAIT id, name FROM t1 WHERE id = 1 AFTER %d" \
                % wait_index

        cursor.execute(query)
        que.put(int(cursor.result_set.rows[0].modified_index))

    q = Queue()
    p = Process(target=_wait, args=(q, ))
    p.start()
    wait_proc = psutil.Process(p.pid)

    # Wait until the child establishes a TCP connection to etcd
    while True:
        tc_count = 0
        for tc in wait_proc.connections('tcp'):
            if tc.status == 'ESTABLISHED' and tc.raddr[1] == 2379:
                tc_count += 1
        if tc_count > 0:
            break

    time.sleep(1)

    cursor.execute("update t1 set name = 'bb'")
    p.join(timeout=10)
    modified_index = q.get()

    assert modified_index > wait_index

def test_select_sets_modified_index(cursor):
    cursor.execute('CREATE TABLE t1(id INT NOT NULL '
                   'PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255))')
    cursor.execute("INSERT INTO t1(id, name) VALUES (1, 'aaa')")
    cursor.execute("SELECT id, name FROM t1 WHERE id = 1")
    assert int(cursor.result_set.rows[0].modified_index) > 0


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/repo_detail"
    style="?android:attr/textAppearanceLarge"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:padding="@dimen/sixteen_dp"
    android:textIsSelectable="true"
    tools:context=".screens.user.detail.UserDetailFragment">

    <include layout="@layout/view_progress" />

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recyclerView_repositories"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="@dimen/eight_dp" />
</RelativeLayout>


text:
    {% load i18n assopy_tags %}

        {{ data.object.title }}
        {% if data.form %} (edit){% endif %}

{{ data.object.abstract|linebreaksbr }}

{{ data.attendees|length }} {% trans "people want to take part in this sprint" %}

        {% for u in data.attendees %}

            {% if u.user == request.user %}
            {{ u.name }} ⇐ you
            {% else %}
            {{ u.name }}
            {% endif %}

        {% endfor %}

    {% if request.user.is_authenticated %}
    <form class="form-user-attend" action="{% url "p3-sprint" sid=data.object.id %}" method="post">{% csrf_token %}
        <input type="hidden" name="user-attend" />
        <fieldset class="border">
        {% if not data.user_attend %}
        <button type="submit">{% trans "I will attend this sprint" %}</button>
        {% else %}
        <button type="submit" class="negate">{% trans "Cancel my registration" %}</button>
        {% endif %}
        </fieldset>
    </form>

        <form action="{% url "p3-sprint" sid=data.object.id %}" method="post">{% csrf_token %}
            <fieldset>
                {% for f in data.form %}
                    {{ f|field }}
                {% endfor %}
            </fieldset>
            <fieldset class="border">
                <button name="" value="" type="submit">{% trans "Submit" %}</button>
            </fieldset>
        </form>

    {% endif %}


text:
/**
 * config/passport.js
 * passport configuration file
 */

'use strict';

var BearerStrategy = require('passport-http-bearer').Strategy;
var jwt = require('jwt-simple');
var User = require('../app/models/user');

module.exports = function (passport, config) {

  // Bearer Strategy for token authentication
  passport.use(new BearerStrategy(
  function (token, done) {

    var decoded = null;
    try {
      decoded = jwt.decode(token, config.jwtsecret);
    } catch (e) {
      var err = new Error();
      err.message = "Invalid Token: " + e.message;
      return done(err, false);
    }

    if (decoded.exp <= Date.now()) {
      return done(null, false, {
        message: 'Access token has expired'
      });
    }

    User.findById(decoded.iss, function (err, user) {
      if (err) { return done(err); }
      if (!user) { return done(null, false); }
      return done(null, user);
    });
  }));
};


text:
import numpy as np
import sys
from gym.envs.toy_text import discrete

UP = 0
RIGHT = 1
DOWN = 2
LEFT = 3

class CliffWalkingEnv(discrete.DiscreteEnv):

    metadata = {'render.modes': ['human', 'ansi']}

    def _limit_coordinates(self, coord):
        coord[0] = min(coord[0], self.shape[0] - 1)
        coord[0] = max(coord[0], 0)
        coord[1] = min(coord[1], self.shape[1] - 1)
        coord[1] = max(coord[1], 0)
        return coord

    def _calculate_transition_prob(self, current, delta):
        new_position = np.array(current) + np.array(delta)
        new_position = self._limit_coordinates(new_position).astype(int)
        new_state = np.ravel_multi_index(tuple(new_position), self.shape)
        reward = -100.0 if self._cliff[tuple(new_position)] else -1.0
        is_done = self._cliff[tuple(new_position)] or (tuple(new_position) == (3,11))
        return [(1.0, new_state, reward, is_done)]

    def __init__(self):
        self.shape = (4, 12)

        nS = np.prod(self.shape)
        nA = 4

        # Cliff Location
        self._cliff = np.zeros(self.shape, dtype=np.bool)
        self._cliff[3, 1:-1] = True

        # Calculate transition probabilities
        P = {}
        for s in range(nS):
            position = np.unravel_index(s, self.shape)
            P[s] = { a : [] for a in range(nA) }
            P[s][UP] = self._calculate_transition_prob(position, [-1, 0])
            P[s][RIGHT] = self._calculate_transition_prob(position, [0, 1])
            P[s][DOWN] = self._calculate_transition_prob(position, [1, 0])
            P[s][LEFT] = self._calculate_transition_prob(position, [0, -1])

        # We always start in state (3, 0)
        isd = np.zeros(nS)
        isd[np.ravel_multi_index((3,0), self.shape)] = 1.0

        super(CliffWalkingEnv, self).__init__(nS, nA, P, isd)

    def _render(self, mode='human', close=False):
        if close:
            return

        outfile = StringIO() if mode == 'ansi' else sys.stdout

        for s in range(self.nS):
            position = np.unravel_index(s, self.shape)
            # print(self.s)
            if self.s == s:
                output = " x "
            elif position == (3,11):
                output = " T "
            elif self._cliff[position]:
                output = " C "
            else:
                output = " o "

            if position[1] == 0:
                output = output.lstrip()
            if position[1] == self.shape[1] - 1:
                output = output.rstrip()
                output += "\n"

            outfile.write(output)
        outfile.write("\n")


text:
<?xml version="1.0" encoding="UTF-8"?>
<CommandInterface xmlns="http://v8.1c.ru/8.3/xcf/extrnprops" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1">
	<CommandsVisibility>
		<Command name="Report._ДемоОстаткиТоваровВМестахХранения.StandardCommand.Open">
			<Visibility>
				<xr:Common>false</xr:Common>
			</Visibility>
		</Command>
	</CommandsVisibility>
</CommandInterface>


text:
from django.core import signals
from django.db.utils import (
    DEFAULT_DB_ALIAS, DJANGO_VERSION_PICKLE_KEY, ConnectionHandler,
    ConnectionRouter, DatabaseError, DataError, Error, IntegrityError,
    InterfaceError, InternalError, NotSupportedError, OperationalError,
    ProgrammingError,
)

__all__ = [
    'connection', 'connections', 'router', 'DatabaseError', 'IntegrityError',
    'InternalError', 'ProgrammingError', 'DataError', 'NotSupportedError',
    'Error', 'InterfaceError', 'OperationalError', 'DEFAULT_DB_ALIAS',
    'DJANGO_VERSION_PICKLE_KEY',
]

connections = ConnectionHandler()

router = ConnectionRouter()

# DatabaseWrapper.__init__() takes a dictionary, not a settings module, so we
# manually create the dictionary from the settings, passing only the settings
# that the database backends care about.
# We load all these up for backwards compatibility, you should use
# connections['default'] instead.
class DefaultConnectionProxy(object):
    """
    Proxy for accessing the default DatabaseWrapper object's attributes. If you
    need to access the DatabaseWrapper object itself, use
    connections[DEFAULT_DB_ALIAS] instead.
    """
    def __getattr__(self, item):
        return getattr(connections[DEFAULT_DB_ALIAS], item)

    def __setattr__(self, name, value):
        return setattr(connections[DEFAULT_DB_ALIAS], name, value)

    def __delattr__(self, name):
        return delattr(connections[DEFAULT_DB_ALIAS], name)

    def __eq__(self, other):
        return connections[DEFAULT_DB_ALIAS] == other

    def __ne__(self, other):
        return connections[DEFAULT_DB_ALIAS] != other

connection = DefaultConnectionProxy()

# Register an event to reset saved queries when a Django request is started.
def reset_queries(**kwargs):
    for conn in connections.all():
        conn.queries_log.clear()
signals.request_started.connect(reset_queries)

# Register an event to reset transaction state and close connections past
# their lifetime.
def close_old_connections(**kwargs):
    for conn in connections.all():
        conn.close_if_unusable_or_obsolete()
signals.request_started.connect(close_old_connections)
signals.request_finished.connect(close_old_connections)


text:
#pragma once
#include <aws/medialive/MediaLive_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{
namespace MediaLive
{
namespace Model
{
  enum class InputSecurityGroupState
  {
    NOT_SET,
    IDLE,
    IN_USE,
    UPDATING,
    DELETED
  };

namespace InputSecurityGroupStateMapper
{
AWS_MEDIALIVE_API InputSecurityGroupState GetInputSecurityGroupStateForName(const Aws::String& name);

AWS_MEDIALIVE_API Aws::String GetNameForInputSecurityGroupState(InputSecurityGroupState value);
} // namespace InputSecurityGroupStateMapper
} // namespace Model
} // namespace MediaLive
} // namespace Aws


text:
from __future__ import absolute_import

import sys
import argparse

import where

def main():
    parser = argparse.ArgumentParser( description="Find the locations of a file in the environment's paths." )

    parser.add_argument("filename", type=str, help="The filename to be found")

    args = parser.parse_args()

    for result in where.iwhere(args.filename):
        print(result)

if __name__ == "__main__":
    sys.exit(main())


text:
/*
 * @(#)TransportEvent.java	1.13 05/08/29
 *
 * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
 */

package javax.mail.event;

import java.util.*;
import javax.mail.*;

/**
 * This class models Transport events.
 *
 * @author John Mani
 * @author Max Spivak
 *
 * @see javax.mail.Transport
 * @see javax.mail.event.TransportListener
 */

public class TransportEvent extends MailEvent {

    /**
     * Message has been	successfully delivered to all recipients by the
     * transport firing this event. validSent[] contains all the addresses
     * this transport sent to successfully. validUnsent[] and invalid[]
     * should be null,
     */
    public static final int MESSAGE_DELIVERED	  = 1;

    /**
     * Message was not sent for some reason. validSent[] should be null.
     * validUnsent[] may have addresses that are valid (but the message
     * wasn't sent to them). invalid[] should likely contain invalid addresses.
     */
    public static final int MESSAGE_NOT_DELIVERED = 2;

    /**
     * Message was successfully sent to some recipients but not to all.
     * validSent[] holds addresses of recipients to whom the message was sent.
     * validUnsent[] holds valid addresses to which the message was not sent.
     * invalid[] holds invalid addresses, if any.
     */
    public static final int MESSAGE_PARTIALLY_DELIVERED = 3;

    /**
     * The event type.
     *
     * @serial
     */
    protected int type;

    transient protected Address[] validSent;
    transient protected Address[] validUnsent;
    transient protected Address[] invalid;
    transient protected Message msg;

    private static final long serialVersionUID = -4729852364684273073L;

    /**
     * Constructor.
     * @param transport  The Transport object
     */
    public TransportEvent(Transport transport, int type, Address[] validSent,
			  Address[] validUnsent, Address[] invalid,
			  Message msg) {
	super(transport);
	this.type = type;
	this.validSent = validSent;
	this.validUnsent = validUnsent;
	this.invalid = invalid;
	this.msg = msg;
    }

    /**
     * Return the type of this event.
     * @return  type
     */
    public int getType() {
	return type;
    }

    /**
     * Return the addresses to which this message was sent succesfully.
     * @return Addresses to which the message was sent successfully or null
     */
    public Address[] getValidSentAddresses() {
	return validSent;
    }

    /**
     * Return the addresses that are valid but to which this message
     * was not sent.
     * @return Addresses that are valid but to which the message was
     *         not sent successfully or null
     */
    public Address[] getValidUnsentAddresses() {
	return validUnsent;
    }

    /**
     * Return the addresses to which this message could not be sent.
     * @return Addresses to which the message sending failed or null
     */
    public Address[] getInvalidAddresses() {
	return invalid;
    }

    /**
     * Get the Message object associated with this Transport Event.
     *
     * @return          the Message object
     * @since		JavaMail 1.2
     */
    public Message getMessage() {
        return msg;
    }

    /**
     * Invokes the appropriate TransportListener method.
     */
    public void dispatch(Object listener) {
	if (type == MESSAGE_DELIVERED)
	    ((TransportListener)listener).messageDelivered(this);
	else if (type == MESSAGE_NOT_DELIVERED)
	    ((TransportListener)listener).messageNotDelivered(this);
	else // MESSAGE_PARTIALLY_DELIVERED
	    ((TransportListener)listener).messagePartiallyDelivered(this);
    }
}


text:
using System.Collections.Generic;

namespace Prexonite
{
    public interface IDependent<out T> : INamed<T>
    {
        IEnumerable<T> GetDependencies();
    }
}


text:
<?php

/**
 * @author:  Gabriel BONDAZ <gabriel.bondaz@idci-consulting.fr>
 * @license: MIT
 */

namespace IDCI\Bundle\ExtraFormBundle\Configuration\Builder;

use Symfony\Component\Form\FormBuilderInterface;

interface ExtraFormBuilderInterface
{
    /**
     * Build the extra form.
     *
     * @param mixed                $configuration
     * @param array                $parameters
     * @param array|null           $data
     * @param FormBuilderInterface $formBuilder
     *
     * @return FormBuilderInterface the built form builder
     */
    public function build(
        $configuration,
        array $parameters = array(),
        $data = null,
        FormBuilderInterface $formBuilder = null
    );
}


text:
Incubu
======

Guarda tus cuentas de manera segura. Proyecto que nacio en consecuencia
a que se tenian muchas cuentas y muchas claves que recordar. Entonces
se necesitaba de un lugar unificado para que se pudieran consultar esas
cuentas/claves de manera segura.

La informacion se cifra antes de ser guardada en el cliente, es decir,
en el navegador. Asi cuando la informacion llega a la BD ya llega encriptada.

Instalación
===========

°Descargar proyecto

	git clone https://github.com/Codectivo/Incubu.git

°Instalar virtualenv

    $ virtualenv env

°Activar virtualenv

    $ source /env/bin/activate

°Instalar requeriments.

    $ pip install -r requeriments.txt

°Crear un archivo config.json, similar a config.json-src

    $ cp config.json-src config.json

°Crear archivo en la raiz del proyecto de la Base de Datos (Nombre que se puso a la BD en config.json)

    $ touch incubu.db

°Sincronizar BD.

    $ python manage.py syncdb

°Ejecutar migraciones South para BD.

    $ python manage.py migrate

°Ejecutar proyecto y abrir http://127.0.0.1:8000

    $ python manage.py runserver 8000


text:
#include "webrtc/modules/pacing/bitrate_prober.h"

#include <assert.h>
#include <algorithm>
#include <limits>
#include <sstream>

#include "webrtc/system_wrappers/interface/logging.h"

namespace webrtc {

namespace {
int ComputeDeltaFromBitrate(size_t packet_size, int bitrate_bps) {
  assert(bitrate_bps > 0);
  // Compute the time delta needed to send packet_size bytes at bitrate_bps
  // bps. Result is in milliseconds.
  return static_cast<int>(1000ll * static_cast<int64_t>(packet_size) * 8ll /
      bitrate_bps);
}
}  // namespace

BitrateProber::BitrateProber()
    : probing_state_(kDisabled),
      packet_size_last_send_(0),
      time_last_send_ms_(-1) {
}

void BitrateProber::SetEnabled(bool enable) {
  if (enable) {
    if (probing_state_ == kDisabled) {
      probing_state_ = kAllowedToProbe;
      LOG(LS_INFO) << "Initial bandwidth probing enabled";
    }
  } else {
    probing_state_ = kDisabled;
    LOG(LS_INFO) << "Initial bandwidth probing disabled";
  }
}

bool BitrateProber::IsProbing() const {
  return probing_state_ == kProbing;
}

void BitrateProber::MaybeInitializeProbe(int bitrate_bps) {
  if (probing_state_ != kAllowedToProbe)
    return;
  probe_bitrates_.clear();
  // Max number of packets used for probing.
  const int kMaxNumProbes = 2;
  const int kPacketsPerProbe = 5;
  const float kProbeBitrateMultipliers[kMaxNumProbes] = {3, 6};
  int bitrates_bps[kMaxNumProbes];
  std::stringstream bitrate_log;
  bitrate_log << "Start probing for bandwidth, bitrates:";
  for (int i = 0; i < kMaxNumProbes; ++i) {
    bitrates_bps[i] = kProbeBitrateMultipliers[i] * bitrate_bps;
    bitrate_log << " " << bitrates_bps[i];
    // We need one extra to get 5 deltas for the first probe.
    if (i == 0)
      probe_bitrates_.push_back(bitrates_bps[i]);
    for (int j = 0; j < kPacketsPerProbe; ++j)
      probe_bitrates_.push_back(bitrates_bps[i]);
  }
  bitrate_log << ", num packets: " << probe_bitrates_.size();
  LOG(LS_INFO) << bitrate_log.str().c_str();
  probing_state_ = kProbing;
}

int BitrateProber::TimeUntilNextProbe(int64_t now_ms) {
  if (probing_state_ != kDisabled && probe_bitrates_.empty()) {
    probing_state_ = kWait;
  }
  if (probe_bitrates_.empty()) {
    // No probe started, or waiting for next probe.
    return -1;
  }
  int64_t elapsed_time_ms = now_ms - time_last_send_ms_;
  // We will send the first probe packet immediately if no packet has been
  // sent before.
  int time_until_probe_ms = 0;
  if (packet_size_last_send_ > 0 && probing_state_ == kProbing) {
    int next_delta_ms = ComputeDeltaFromBitrate(packet_size_last_send_,
                                                probe_bitrates_.front());
    time_until_probe_ms = next_delta_ms - elapsed_time_ms;
    // There is no point in trying to probe with less than 1 ms between packets
    // as it essentially means trying to probe at infinite bandwidth.
    const int kMinProbeDeltaMs = 1;
    // If we have waited more than 3 ms for a new packet to probe with we will
    // consider this probing session over.
    const int kMaxProbeDelayMs = 3;
    if (next_delta_ms < kMinProbeDeltaMs ||
        time_until_probe_ms < -kMaxProbeDelayMs) {
      // We currently disable probing after the first probe, as we only want
      // to probe at the beginning of a connection. We should set this to
      // kWait if we later want to probe periodically.
      probing_state_ = kWait;
      LOG(LS_INFO) << "Next delta too small, stop probing.";
      time_until_probe_ms = 0;
    }
  }
  return std::max(time_until_probe_ms, 0);
}

size_t BitrateProber::RecommendedPacketSize() const {
  return packet_size_last_send_;
}

void BitrateProber::PacketSent(int64_t now_ms, size_t packet_size) {
  assert(packet_size > 0);
  packet_size_last_send_ = packet_size;
  time_last_send_ms_ = now_ms;
  if (probing_state_ != kProbing)
    return;
  if (!probe_bitrates_.empty())
    probe_bitrates_.pop_front();
}
}  // namespace webrtc


text:
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace MineLib.PGL.Components
{
    public sealed class CameraComponent : GameComponent
    {
        float fovAngle;

        public float Near = 0.01f;
        public float Far = 2000.0f;

        Vector3 _cameraPosition;
        Vector3 _cameraRotation;
	    Vector3 _cameraLookAt;

        readonly float _cameraSpeed;

        Vector2 _cameraRotationBuffer;
        Vector2 _cameraPositionBuffer;

        bool _recalculate;

        public Vector3 Position { get { return _cameraPosition; } set { _cameraPosition = value; _recalculate = true; } }

        public Vector3 Rotation { get { return _cameraRotation; } set { _cameraRotation = value; _recalculate = true; } }

        public Matrix Projection { get; private set; }
        public Matrix View { get; private set; }
        public BoundingFrustum BoundingFrustum { get; private set; }

        internal Data.World World { get; set; }

        public CameraComponent(Game game, Vector3 position, Vector3 rotation, float speed) : base(game)
        {
            fovAngle = MathHelper.PiOver4;

            _cameraSpeed = speed;

            MoveTo(position, rotation);

            InputManager.TouchCameraRectangle = new Rectangle(Game.GraphicsDevice.Viewport.Width / 2, 0,
                Game.GraphicsDevice.Viewport.Width / 2, Game.GraphicsDevice.Viewport.Height);
            InputManager.TouchMoveRectangle = new Rectangle(0, 0,
                Game.GraphicsDevice.Viewport.Width / 2, Game.GraphicsDevice.Viewport.Height);

            _recalculate = true;
        }

        public void MoveTo(Vector3 pos, Vector3 rot)
        {
            Position = pos;
            Rotation = rot;
        }

        private Vector3 PreviewMove(Vector3 amount)
        {
            var rotate = Matrix.CreateRotationY(_cameraRotation.Y);

            var movement = new Vector3(amount.X, amount.Y, amount.Z);
            movement = Vector3.Transform(movement, rotate);

            return _cameraPosition + movement;
        }

        private void Move(Vector3 scale)
        {
            MoveTo(PreviewMove(scale), Rotation);
        }

        public override void Update(GameTime gameTime)
        {
            var dt = (float) gameTime.ElapsedGameTime.TotalSeconds;

#if DEBUG
            if (InputManager.IsOncePressed(Keys.U))
                MoveTo(DebugComponent.PlayerPos, Vector3.Zero);
#endif

            #region Moving
            var moveVector = Vector3.Zero;

            if (InputManager.MoveForward)
                moveVector.Z = 1f;
            if (InputManager.MoveBackward)
                moveVector.Z = -1f;
            if (InputManager.MoveLeft)
                moveVector.X = 1f;
            if (InputManager.MoveRight)
                moveVector.X = -1f;
            if (InputManager.MoveJump)
                moveVector.Y = 1f;
            if (InputManager.MoveCrouch)
                moveVector.Y = -1f;

            if (moveVector != Vector3.Zero)
            {
                moveVector.Normalize();
                moveVector *= dt * _cameraSpeed;
            }

            if (InputManager.TouchEnabled)
            {
                moveVector.X -= InputManager.TouchMoveDelta.X * dt;
                moveVector.Z -= InputManager.TouchMoveDelta.Y * dt;
            }

            Move(moveVector);
            #endregion Moving

            #region Camera
            if (InputManager.ButtonCameraSwitch)
                InputManager.MouseEnabled = !InputManager.MouseEnabled;

            if (InputManager.MouseEnabled)
            {
                var center = new Vector2(Game.GraphicsDevice.Viewport.Width * 0.5f, Game.GraphicsDevice.Viewport.Height * 0.5f);
                var mouseDelta = InputManager.MousePosition.ToVector2() - center;

                // Android set mouse to (0, 0)
                if (center != -mouseDelta)
                {
                    Mouse.SetPosition((int)center.X, (int)center.Y);

                    _cameraRotationBuffer -= 0.01f * mouseDelta * dt;
                }
            }

            if (InputManager.TouchEnabled)
                _cameraRotationBuffer -= 0.1f * InputManager.TouchCameraDelta * dt;

            if (_cameraRotationBuffer.Y < MathHelper.ToRadians(-75.0f))
                _cameraRotationBuffer.Y = _cameraRotationBuffer.Y - (_cameraRotationBuffer.Y - MathHelper.ToRadians(-75.0f));
            if (_cameraRotationBuffer.Y > MathHelper.ToRadians(75.0f))
                _cameraRotationBuffer.Y = _cameraRotationBuffer.Y - (_cameraRotationBuffer.Y - MathHelper.ToRadians(75.0f));

            Rotation = new Vector3(-MathHelper.Clamp(_cameraRotationBuffer.Y, MathHelper.ToRadians(-75.0f), MathHelper.ToRadians(75.0f)), MathHelper.WrapAngle(_cameraRotationBuffer.X), 0);
            //Position = new Vector3(-MathHelper.Clamp(_cameraPositionBuffer.Y, MathHelper.ToRadians(-75.0f), MathHelper.ToRadians(75.0f)), MathHelper.WrapAngle(_cameraPositionBuffer.X), 0);
            #endregion Camera

            base.Update(gameTime);
        }

        public void ApplyTo(Effect effect)
        {
            if (_recalculate)
                Recalculate();

            effect.Parameters["View"].SetValue(View);
            effect.Parameters["Projection"].SetValue(Projection);
            effect.Parameters["World"].SetValue(Matrix.Identity);

#if DEBUG
            DebugComponent.CameraPos = Position;
#endif
        }

        public void ApplyTo(BasicEffect effect)
        {
            if (_recalculate)
                Recalculate();

            effect.View = View;
            effect.Projection = Projection;
            effect.World = Matrix.Identity;

#if DEBUG
            DebugComponent.CameraPos = Position;
#endif
        }

        public void ApplyTo(AlphaTestEffect effect)
        {
            if (_recalculate)
                Recalculate();

            effect.View = View;
            effect.Projection = Projection;
            effect.World = Matrix.Identity;

#if DEBUG
            DebugComponent.CameraPos = Position;
#endif
        }

        private void Recalculate()
        {
            var rotationMatrix = Matrix.CreateRotationX(_cameraRotation.X) * Matrix.CreateRotationY(_cameraRotation.Y);
            var lookAtOffset = Vector3.Transform(Vector3.UnitZ, rotationMatrix);
            _cameraLookAt = _cameraPosition + lookAtOffset;

            View = Matrix.CreateLookAt(_cameraPosition, _cameraLookAt, Vector3.Up);
            Projection = Matrix.CreatePerspectiveFieldOfView(fovAngle, Game.GraphicsDevice.Viewport.AspectRatio, Near, Far);

            BoundingFrustum = new BoundingFrustum(View * Projection);

            _recalculate = false;
        }
    }
}


text:
angular.module('os.biospecimen.models.cpr',
  [
    'os.common.models',
    'os.biospecimen.models.participant',
    'os.biospecimen.models.form'
  ])
  .factory('CollectionProtocolRegistration', function($filter, $http, osModel, Participant, Form, Util) {
    var CollectionProtocolRegistration =
      osModel(
        'collection-protocol-registrations',
        function(cpr) {
          cpr.participant = new Participant(cpr.participant);
        }
      );

    CollectionProtocolRegistration.listForCp = function(cpId, includeStats, filterOpts) {
      var params = {cpId: cpId, includeStats: !!includeStats};
      angular.extend(params, filterOpts || {});
      if (!!params.dob) {
        //
        // Note: yyyy-MM-dd is server date format and is not locale based
        //
        params.dob = $filter('date')(params.dob, 'yyyy-MM-dd');
      }
      return CollectionProtocolRegistration.query(params);
    };

    CollectionProtocolRegistration.prototype.getType = function() {
      return 'collection_protocol_registration';
    }

    CollectionProtocolRegistration.prototype.getDisplayName = function() {
      var str = this.ppid;
      if (!!this.participant.firstName || !!this.participant.lastName) {
        str += " (" + this.participant.firstName + " " + this.participant.lastName + ")";
      }
      return str;
    };

    CollectionProtocolRegistration.prototype.getMrnSites = function() {
      return !this.participant ? undefined : this.participant.getMrnSites();
    };

    CollectionProtocolRegistration.prototype.$saveProps = function() {
      this.participant = this.participant.$saveProps();
      return this;
    };

    CollectionProtocolRegistration.prototype.getForms = function(params) {
      return Form.listFor(CollectionProtocolRegistration.url(), this.$id(), params);
    };

    CollectionProtocolRegistration.prototype.getRecords = function() {
      var url = CollectionProtocolRegistration.url() + this.$id() + '/extension-records';
      return Form.listRecords(url);
    };

    CollectionProtocolRegistration.prototype.$saveProps = function() {
      this.participant = this.participant.$saveProps();
      return this;
    };

    CollectionProtocolRegistration.prototype.getSignedConsentFormUrl = function() {
      return CollectionProtocolRegistration.url() + this.$id() + "/consent-form";
    }

    CollectionProtocolRegistration.prototype.deleteSignedConsentForm = function() {
      return $http.delete(this.getSignedConsentFormUrl()).then(function(result){ return result.data; });
    }

    return CollectionProtocolRegistration;
  });


text:
from __future__ import division

from sklearn import mixture, metrics
import pylab as pl
import csv
import numpy as np

def inc_avg(currAvg=None, currNumElem=None, newElem=None):

    if not currAvg is None and not currNumElem is None and not newElem is None:
        newAvg = currAvg + (newElem - currAvg) / (currNumElem +1)
        return newAvg
    else:
        raise Exception("inc_avg: something is None")

# reading file
for action in ['move', 'rotate', 'wax', 'fold', 'paint']:
    numberOfSlices=0
    actionName=action
    print "Action: ", actionName
    realDataMatrix=[]
    partialResults=[]
    for a in range(6):
        reader=csv.reader(open("/home/smorante/Repositories/cognitive/xgnitive/main/app/record/skeleton/"+actionName+"_"+str(a)+"/data.log","rb"),delimiter=' ')
        x=list(reader)
        temp0=np.array(x).astype('float')

        #gaussians by time
        newTimeValue= np.ceil(temp0[-1][1] - temp0[0][1])
        numberOfSlices = int(inc_avg(numberOfSlices, a, newTimeValue))

        ## Get the time range and rescale
        r = float(temp0[-1][1] - temp0[0][1])
        temp0[:,1] = map(lambda x: (x - temp0[0][1]) / r, temp0[:,1])

        # append
        realDataMatrix.append(temp0.tolist())

    #test all dimensions and sort
    Xnoisy = np.vstack(realDataMatrix) # noisy dataset
    Xnoisy = sorted(Xnoisy, key=lambda column: column[1])

    ## deletes first column (only -1 values)
    Xnoisy = np.delete(Xnoisy,0,axis=1)

    #assigning new clean dataset to variable X in numpy array
    X = np.array(Xnoisy)

    ## OVERLOAD
    for h in range(numberOfSlices):
        #print 'h', h
        #print X.shape[0]
        initial=(X.shape[0]/numberOfSlices)*h
        final=(X.shape[0]/numberOfSlices)*(h+1)
        #print X[initial:final].shape
        best_gmm = mixture.GMM(n_components=1, covariance_type='full')
        best_gmm.fit(X[initial:final])
        #print "Best : ", best_gmm
        #print "Best mean: ", best_gmm.means_.ravel().tolist()
        partialResults.append(best_gmm.means_.ravel().tolist())

    print 'slices: ', len(partialResults)
    # saving centers
    sortedPoints = sorted(partialResults, key=lambda point: point[0])
    np.savetxt("generalized/"+actionName+"Generalized kin", sortedPoints,  fmt='%.14e')


text:
namespace ResidenceStore
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Mailer;

    public class InMemoryResidenceStore : ResidenceStoreBase
    {
        private readonly List<ResidenceInfo> residences = new List<ResidenceInfo>();

        public InMemoryResidenceStore() : this(new DiscardingResidenceStoreMailer())
        {

        }

        public InMemoryResidenceStore(IResidenceStoreMailer mailer)
            : base(mailer)
        {

        }

        protected internal override ResidenceInfo GetResidence(string email, string residence)
        {
            return residences.FirstOrDefault(r => string.Compare(r.Email, email, StringComparison.InvariantCultureIgnoreCase) == 0 && residence == r.Residence);
        }

        protected internal override void PutResidence(ResidenceInfo residenceInfo)
        {
            var old = GetResidence(residenceInfo.Email, residenceInfo.Residence);
            if (old != null)
                residences.Remove(old);
            residences.Add(new ResidenceInfo(residenceInfo));
        }

        protected internal override void RemoveResidence(ResidenceInfo residenceInfo)
        {
            residences.Remove(residenceInfo);
        }

        public override bool HasResidenceForEmail(string email)
        {
            return residences
                .Any(r => string.Compare(r.Email, email, StringComparison.InvariantCultureIgnoreCase) == 0);
        }

        public override List<ResidenceInfo> ResidencesForEmail(string email)
        {
            return residences
                .Where(r => string.Compare(r.Email, email, StringComparison.InvariantCultureIgnoreCase) == 0)
                .ToList();
        }

        public override void RemoveAllResidencesForEmail(string email)
        {
            var all = ResidencesForEmail(email);
            foreach (var residenceInfo in all) {
                RemoveResidence(residenceInfo);
            }
        }

        public override int Count
        {
            get { return residences.Count; }
        }

        protected internal override ResidenceInfo GetVerifiedResidenceWithAnyToken(string token)
        {
            return residences.FirstOrDefault(r => r.Verified && (token == r.VerificationToken || token == r.AuthorizationToken));
        }

        protected internal override ResidenceInfo GetUnverifiedResidenceWithVerificationToken(string verificationToken)
        {
            return residences.FirstOrDefault(r => !r.Verified && verificationToken == r.VerificationToken);
        }
    }
}


text:
package com.github.satoshun.truth.android.api.view.animation;

import android.annotation.TargetApi;
import android.view.animation.Animation;
import android.view.animation.Interpolator;

import com.github.satoshun.truth.android.api.BaseSubject;
import com.google.common.truth.FailureStrategy;
import com.google.common.truth.SubjectFactory;

import static android.os.Build.VERSION_CODES.HONEYCOMB_MR1;

public abstract class AnimationSubject<S extends AnimationSubject<S, T>, T extends Animation>
    extends BaseSubject<S, T> {

  public static final AnimationSubjectFactory FACTORY = new AnimationSubjectFactory();

  public AnimationSubject(FailureStrategy failureStrategy, T actual) {
    super(failureStrategy, actual);
  }

  @TargetApi(HONEYCOMB_MR1)
  public S isBackgroundColor(int color) {
    isNotNull();
    check().withFailureMessage("is background color")
        .that(actual().getBackgroundColor())
        .isEqualTo(color);
    return myself();
  }

  public S isDuration(long duration) {
    isNotNull();
    check().withFailureMessage("is duration")
        .that(actual().getDuration())
        .isEqualTo(duration);
    return myself();
  }

  public S isFillingAfter() {
    isNotNull();
    check().withFailureMessage("is filling after")
        .that(actual().getFillAfter())
        .isTrue();
    return myself();
  }

  public S isNotFillingAfter() {
    isNotNull();
    check().withFailureMessage("is not filling after")
        .that(actual().getFillAfter())
        .isFalse();
    return myself();
  }

  public S isFillingBefore() {
    isNotNull();
    check().withFailureMessage("is filling before")
        .that(actual().getFillBefore())
        .isTrue();
    return myself();
  }

  public S isNotFillingBefore() {
    isNotNull();
    check().withFailureMessage("is not filling before")
        .that(actual().getFillBefore())
        .isFalse();
    return myself();
  }

  public S isInterpolator(Interpolator interpolator) {
    isNotNull();
    check().withFailureMessage("is interpolator")
        .that(actual().getInterpolator())
        .isSameAs(interpolator);
    return myself();
  }

  public S isRepeatCount(int count) {
    isNotNull();
    check().withFailureMessage("is repeat count")
        .that(actual().getInterpolator())
        .isEqualTo(count);
    return myself();
  }

  public S isRepeatMode(int mode) {
    isNotNull();
    check().withFailureMessage("is repeat mode")
        .that(actual().getRepeatMode())
        .isEqualTo(mode);
    return myself();
  }

  public S isStartOffset(long offset) {
    isNotNull();
    check().withFailureMessage("is start offset")
        .that(actual().getStartOffset())
        .isEqualTo(offset);
    return myself();
  }

  public S isStartTime(long time) {
    isNotNull();
    check().withFailureMessage("is start time")
        .that(actual().getStartTime())
        .isEqualTo(time);
    return myself();
  }

  public S isZAdjustment(int adjustment) {
    isNotNull();
    check().withFailureMessage("is z adjustment")
        .that(actual().getZAdjustment())
        .isEqualTo(adjustment);
    return myself();
  }

  public S hasEnded() {
    isNotNull();
    check().withFailureMessage("has ended")
        .that(actual().hasEnded())
        .isTrue();
    return myself();
  }

  public S doesNotHaveEnded() {
    isNotNull();
    check().withFailureMessage("does not have ended")
        .that(actual().hasEnded())
        .isFalse();
    return myself();
  }

  public S hasStarted() {
    isNotNull();
    check().withFailureMessage("has started")
        .that(actual().hasStarted())
        .isTrue();
    return myself();
  }

  public S doesNotHaveStarted() {
    isNotNull();
    check().withFailureMessage("does not have started")
        .that(actual().hasStarted())
        .isFalse();
    return myself();
  }

  public S isFillEnabled() {
    isNotNull();
    check().withFailureMessage("is fill enabled")
        .that(actual().isFillEnabled())
        .isTrue();
    return myself();
  }

  public S isFillDisabled() {
    isNotNull();
    check().withFailureMessage("is fill disabled")
        .that(actual().isFillEnabled())
        .isFalse();
    return myself();
  }

  public S isInitialized() {
    isNotNull();
    check().withFailureMessage("is initialized")
        .that(actual().isInitialized())
        .isTrue();
    return myself();
  }

  public S isNotInitialized() {
    isNotNull();
    check().withFailureMessage("is not initialized")
        .that(actual().isInitialized())
        .isFalse();
    return myself();
  }

  public S isChangingBounds() {
    isNotNull();
    check().withFailureMessage("is changing bounds")
        .that(actual().willChangeBounds())
        .isTrue();
    return myself();
  }

  public S isNotChangingBounds() {
    isNotNull();
    check().withFailureMessage("is not changing bounds")
        .that(actual().willChangeBounds())
        .isFalse();
    return myself();
  }

  public S isChangingTransformationMatrix() {
    isNotNull();
    check().withFailureMessage("is changing transformation matrix")
        .that(actual().willChangeTransformationMatrix())
        .isTrue();
    return myself();
  }

  public S isNotChangingTransformationMatrix() {
    isNotNull();
    check().withFailureMessage("is not changing transformation matrix")
        .that(actual().willChangeTransformationMatrix())
        .isFalse();
    return myself();
  }

  private static class AnimationSubjectImpl extends AnimationSubject<AnimationSubjectImpl, Animation> {
    AnimationSubjectImpl(FailureStrategy failureStrategy, Animation actual) {
      super(failureStrategy, actual);
    }
  }

  private static class AnimationSubjectFactory extends SubjectFactory<AnimationSubjectImpl, Animation> {
    @Override
    public AnimationSubjectImpl getSubject(FailureStrategy fs, Animation that) {
      return new AnimationSubjectImpl(fs, that);
    }
  }
}


text:
ServiceConfiguration.configurations.upsert(
	{ service: 'github' },
	{
		$set: {
			clientId: Meteor.settings.github_clientId,
			loginStyle: 'redirect',
			secret: Meteor.settings.github_secret
		}
	}
);


text:
<?php
if (!defined('IDIR')) { die; }

/**
*
* @package			ImpEx.smf2
*
*/

class smf2_010 extends smf2_000
{
	var $_dependent = '007';

	function smf2_010(&$displayobject)
	{
		$this->_modulestring = $displayobject->phrases['import_attachment'];
	}

	function init(&$sessionobject, &$displayobject, &$Db_target, &$Db_source)
	{
		$class_num = substr(get_class($this) , -3);

		if ($this->check_order($sessionobject,$this->_dependent))
		{
			if ($this->_restart)
			{
				if ($this->restart($sessionobject, $displayobject, $Db_target, $Db_source, 'clear_imported_attachments'))
				{;
					$displayobject->display_now("
{$displayobject->phrases['attachments_cleared']}
");
					$this->_restart = true;
				}
				else
				{
					$sessionobject->add_error($Db_target, 'fatal', $class_num, 0, $displayobject->phrases['attachment_restart_failed'], $displayobject->phrases['check_db_permissions']);
				}
			}

			// Start up the table
			$displayobject->update_basic('title',$displayobject->phrases['import_attachment']);
			$displayobject->update_html($displayobject->do_form_header('index', $class_num));
			$displayobject->update_html($displayobject->make_hidden_code($class_num, 'WORKING'));
			$displayobject->update_html($displayobject->make_table_header($this->_modulestring));

			// Ask some questions
			$displayobject->update_html($displayobject->make_input_code($displayobject->phrases['units_per_page'], 'perpage', 1000));
			$displayobject->update_html($displayobject->make_input_code($displayobject->phrases['path_to_upload'], 'attachmentsfolder',$sessionobject->get_session_var('attachmentsfolder'),1,60));

			// End the table
			$displayobject->update_html($displayobject->do_form_footer($displayobject->phrases['continue'],$displayobject->phrases['reset']));

			// Reset/Setup counters for this
			$sessionobject->add_session_var("{$class_num}_objects_done", '0');
			$sessionobject->add_session_var("{$class_num}_objects_failed", '0');
			$sessionobject->add_session_var('startat','0');
		}
		else
		{
			// Dependant has not been run
			$displayobject->update_html($displayobject->do_form_header('index', ''));
			$displayobject->update_html($displayobject->make_description("
{$displayobject->phrases['dependant_on']} " . $sessionobject->get_module_title($this->_dependent) . " {$displayobject->phrases['cant_run']} ."));
			$displayobject->update_html($displayobject->do_form_footer($displayobject->phrases['continue'],''));
			$sessionobject->set_session_var($class_num, 'FALSE');
			$sessionobject->set_session_var('module','000');
		}
	}

	function resume(&$sessionobject, &$displayobject, &$Db_target, &$Db_source)
	{
		// Set up working variables.
		$displayobject->update_basic('displaymodules','FALSE');
		$t_db_type		= $sessionobject->get_session_var('targetdatabasetype');
		$t_tb_prefix	= $sessionobject->get_session_var('targettableprefix');
		$s_db_type		= $sessionobject->get_session_var('sourcedatabasetype');
		$s_tb_prefix	= $sessionobject->get_session_var('sourcetableprefix');
		$dir 			= $sessionobject->get_session_var('attachmentsfolder');

		// Per page vars
		$start_at		= $sessionobject->get_session_var('startat');
		$per_page		= $sessionobject->get_session_var('perpage');
		$class_num		= substr(get_class($this) , -3);
		$idcache 		= new ImpExCache($Db_target, $t_db_type, $t_tb_prefix);

		// Start the timing
		if(!$sessionobject->get_session_var("{$class_num}_start"))
		{
			$sessionobject->timing($class_num , 'start' ,$sessionobject->get_session_var('autosubmit'));
		}

		// Get an array data
		$data_array = $this->get_smf_attach($Db_source, $s_db_type, $s_tb_prefix, $start_at, $per_page);

		// Get some refrence arrays (use and delete as nessesary).
		// User info
		#$this->get_vb_userid($Db_target, $t_db_type, $t_tb_prefix, $importuserid);
		#$this->get_one_username($Db_target, $t_db_type, $t_tb_prefix, $theuserid, $id='importuserid');
		#$users_array = $this->get_user_array($Db_target, $t_db_type, $t_tb_prefix, $startat = null, $perpage = null);
		#$done_user_ids = $this->get_done_user_ids($Db_target, $t_db_type, $t_tb_prefix);
		#$user_ids_array = $this->get_user_ids($Db_target, $t_db_type, $t_tb_prefix, $do_int_val = false);
		#$user_name_array = $this->get_username_to_ids($Db_target, $t_db_type, $t_tb_prefix);
		// Groups info
		#$user_group_ids_array = $this->get_imported_group_ids($Db_target, $t_db_type, $t_tb_prefix);
		#$user_group_ids_by_name_array = $this->get_imported_group_ids_by_name($Db_target, $t_db_type, $t_tb_prefix);
		#$bannded_groupid = $this->get_banned_group($Db_target, $t_db_type, $t_tb_prefix);
		// Thread info
		#$this->get_thread_id($Db_target, $t_db_type, $t_tb_prefix, &$importthreadid, &$forumid); // & left to show refrence
		#$thread_ids_array = $this->get_threads_ids($Db_target, $t_db_type, $t_tb_prefix);
		// Post info
		#$this->get_posts_ids($Db_target, $t_db_type, $t_tb_prefix);
		// Category info
		#$cat_ids_array = $this->get_category_ids($Db_target, $t_db_type, $t_tb_prefix);
		#$style_ids_array = $this->get_style_ids($Db_target, $t_db_type, $t_tb_prefix, $pad=0);
		// Forum info
		#$forum_ids_array = $this->get_forum_ids($Db_target, $t_db_type, $t_tb_prefix, $pad=0);

		// Display count and pass time
		$displayobject->print_per_page_pass($data_array['count'], $displayobject->phrases['attachments'], $start_at);

		$ImpExData_object = new ImpExData($Db_target, $sessionobject, 'attachment');

		foreach ($data_array['data'] as $import_id => $data)
		{
			$try = (phpversion() < '5' ? $ImpExData_object : clone($ImpExData_object));

			if (!$data['file_hash'])
			{
				$cleanname = preg_replace(array('/\s/', '/[^\w_\.\-]/'), array('_', ''), $data['filename']);
				$encname = $import_id . '_' . strtr($cleanname, '.', '_') . md5($cleanname);
				$cleanname = preg_replace('~\.[\.]+~', '.', $cleanname);
				if (is_file($dir . '/' . $cleanname))
				{
					$raw_filename = $cleanname;
				}
				else
				{
					$raw_filename = $encname;
				}
			}
			else
			{
				$raw_filename = $import_id  . '_' . $data['file_hash'];
			}

			if(!is_file($dir . '/' . $raw_filename))
			{
				$displayobject->display_now("
{$displayobject->phrases['source_file_not']}  :: {$data['filename']}");
				$sessionobject->add_error($Db_target, 'warning', $class_num, $import_id, $displayobject->phrases['attachment_not_imported'], $data['filename'] . ' - ' . $displayobject->phrases['attachment_not_imported_rem_1']);
				$sessionobject->set_session_var($class_num . '_objects_failed',$sessionobject->get_session_var($class_num. '_objects_failed') + 1 );
				continue;
			}

			$file = $this->vb_file_get_contents($dir . '/' . $raw_filename);

			// Mandatory
			$try->set_value('mandatory', 'importattachmentid',	$import_id);
			$try->set_value('mandatory', 'filename',			$data['filename']);
			$try->set_value('mandatory', 'filedata',			$file);

			// Non mandatory
			$try->set_value('nonmandatory', 'extension',		substr($data['filename'], strrpos($data['filename'], '.') + 1));
			$try->set_value('nonmandatory', 'filehash',			md5($file));
			$try->set_value('nonmandatory', 'filesize',			$data['size']);
			$try->set_value('nonmandatory', 'counter',			$data['downloads']);
			$try->set_value('nonmandatory', 'visible',			$data['approved']);
			$try->set_value('nonmandatory', 'postid',           $data['id_msg']);

			// Check if object is valid
			if($try->is_valid())
			{
				if($try->import_attachment($Db_target, $t_db_type, $t_tb_prefix))
				{
					if(shortoutput)
					{
						$displayobject->display_now('.');
					}
					else
					{
						$displayobject->display_now('
' . $import_id . ':: ' . $try->how_complete() . '% ' . $displayobject->phrases['attachment'] . ' -> ' . $data['filename']);
					}
					$sessionobject->add_session_var("{$class_num}_objects_done",intval($sessionobject->get_session_var("{$class_num}_objects_done")) + 1 );
				}
				else
				{
					$sessionobject->add_session_var("{$class_num}_objects_failed",intval($sessionobject->get_session_var("{$class_num}_objects_failed")) + 1 );
					$sessionobject->add_error($Db_target, 'warning', $class_num, $import_id, $displayobject->phrases['attachment_not_imported'], $displayobject->phrases['attachment_not_imported_rem']);
					$displayobject->display_now("
{$displayobject->phrases['failed']} {$import_id} :: {$displayobject->phrases['attachment_not_imported']}");
				}// $try->import_attachment
			}
			else
			{
				$sessionobject->add_session_var("{$class_num}_objects_failed",intval($sessionobject->get_session_var("{$class_num}_objects_failed")) + 1 );
				$sessionobject->add_error($Db_target, 'invalid', $class_num, $import_id, $displayobject->phrases['invalid_object'] . ' ' . $try->_failedon, $displayobject->phrases['invalid_object_rem']);
				$displayobject->display_now("
{$displayobject->phrases['invalid_object']}" . $try->_failedon);
			}// is_valid
			unset($try);
		}// End foreach

		// Check for page end
		if ($data_array['count'] == 0 OR $data_array['count'] < $per_page)
		{
			$sessionobject->timing($class_num, 'stop', $sessionobject->get_session_var('autosubmit'));
			$sessionobject->remove_session_var("{$class_num}_start");

			$displayobject->update_html($displayobject->module_finished($this->_modulestring,
				$sessionobject->return_stats($class_num, '_time_taken'),
				$sessionobject->return_stats($class_num, '_objects_done'),
				$sessionobject->return_stats($class_num, '_objects_failed')
			));

			$sessionobject->set_session_var($class_num , 'FINISHED');
			$sessionobject->set_session_var('module', '000');
			$sessionobject->set_session_var('autosubmit', '0');
		}

		$sessionobject->set_session_var('startat', $data_array['lastid']);
		$displayobject->update_html($displayobject->print_redirect('index.php',$sessionobject->get_session_var('pagespeed')));
	}// End resume
}//End Class
# Autogenerated on : January 2, 2008, 4:56 pm
# By ImpEx-generator 2.0
/*======================================================================*/
?>


text:
'use strict';
//# sourceMappingURL=ODataPagedResult1MembershipVisitItemContract.js.map


text:
/**
 * Kombination aus Radiobutton und einem Container, der die Beschriftung
 * des Buttons enthalten kann.
 *
 * @author Phil
 */

/**
 * Ein einzelner Radiobutton. Dieser soll nur von Hand erstellt werden, sondern
 * immer eine Gruppe von Buttons, da ein einzelner Button sonst keinen Nutzen
 * hat.
 *
 * @param HTMLElement parent_node
 * @param int x
 * @param int y
 * @param uint w
 * @param uint h
 * @param uint w_radio
 * @param string pic_url	Pfad zum Checkbox-Doppelbild [oben unchecked,
 * 															unten checked]
 */
PureFW.RadioLabel = function(parent_node, x, y, w, h, w_radio, pic_url) {
	if (typeof(parent_node) !== 'undefined') {
		this.init(parent_node, x, y, w, h, w_radio, pic_url);

		this.instance_num = this.constructor.num_instances;
		this.instance_name =
				"PureFW.RadioLabel.instances["+this.instance_num+"]";

		this.insert_into_dom_tree();
		this.constructor.num_instances++;
		this.constructor.instances[this.instance_num] = this;

		PureFW.WidgetManager.manager_all.register_widget(this);
	}
};

/********************************************************************
 * RadioLabel extends Widget
 ********************************************************************/
PureFW.RadioLabel.extend(PureFW.Widget);

/********************************************************************
 * Statische Deklarationen
 ********************************************************************/
PureFW.RadioLabel.num_instances = 0;
PureFW.RadioLabel.instances = new Array();

/********************************************************************
 * Prototyp-Deklarationen
 ********************************************************************/
PureFW.RadioLabel.prototype.init = function(parent_node, x, y, w, h, w_radio,
	pic_url)
{
	PureFW.RadioLabel.parent.init.call(this, parent_node, x, y, w, h);
	this.radio_pic_url = pic_url;
	this.radio_w = w_radio;
	this.radio_button = null;
	this.label_container = null;
};

PureFW.RadioLabel.prototype.insert_into_dom_tree = function() {
	PureFW.RadioLabel.parent.insert_into_dom_tree.call(this);

	this.radio_button = new PureFW.RadioButton(
		this.parent_node,
		this.position.x,
		this.position.y,
		this.radio_w, this.radio_w,
		this.radio_pic_url
	);
	this.label_container = new PureFW.Container(
		this.parent_node,
		this.radio_button.position.x +
			this.radio_button.width + 5,
		this.radio_button.position.y,
		this.width - this.radio_button.width - 5,
		this.height
	);
	this.label_container.add_event_handler(
		"click",
		(function (_instance) {
			return function(ev) {
				_instance.radio_button.on_click();
			}
		})(this)
	);
};

PureFW.RadioLabel.prototype.get_label_container = function() {
	return this.label_container;
};

PureFW.RadioLabel.prototype.get_radio_button = function() {
	return this.radio_button;
};


text:
<?
/* include package */
require_once("Model/Core/DBmanager/DBmanager.php");
require_once('Model/ManGong/Test.php');

/* set variable */
$intMemberSeq = $_SESSION[$_COOKIE['member_token']]['member_seq'];
$strAuthKey = $_SESSION[$_COOKIE['member_token']]['auth_key'];
$strMemberType = $_SESSION[$_COOKIE['member_token']]['member_type'];

/* create object */
$resMangongDB = new DB_manager('MAIN_SERVER');
$objTest = new Test($resMangongDB);

/*main process*/
//1. get main header
$intQueId = 1;//main header
//$arrHeader = $objTest->getTestByQue($intQueId);

//2. get test list
//$arrTest = $objTest->getTestListBy($intMemberSeq, $strMemberType);

//$arrPaging = array('page'=>$intPage ,'result_number'=>15,'block_number'=>10,'param'=>null);
if($arrPaging){
	$arr_output['paging'] = $arrPaging;
	if(!is_null($intCategorySeq) && !is_null($intGroupSeq)){
		$arr_output['paging']['paging']['prev']['link'] = '/teacher/test/list?page='.(int)$arr_output['paging']['paging']['prev']['number'].'&category='.$intCategorySeq.'&group='.$intGroupSeq;
		$arr_output['paging']['paging']['next']['link'] = '/teacher/test/list?page='.(int)$arr_output['paging']['paging']['next']['number'].'&category='.$intCategorySeq.'&group='.$intGroupSeq;
	}else{
		$arr_output['paging']['paging']['prev']['link'] = '/teacher/test/list?page='.(int)$arr_output['paging']['paging']['prev']['number'];
		$arr_output['paging']['paging']['next']['link'] = '/teacher/test/list?page='.(int)$arr_output['paging']['paging']['next']['number'];
	}
	foreach($arr_output['paging']['paging']['page'] as $page_key=>$page_value){
		if($intCategorySeq || $intGroupSeq){
			$arr_output['paging']['paging']['page'][$page_key]['link'] = '/teacher/test/list?page='.(int)$page_value['number'].'&category='.$intCategorySeq.'&group='.$intGroupSeq;
		}else{
			$arr_output['paging']['paging']['page'][$page_key]['link'] = '/teacher/test/list?page='.(int)$page_value['number'];
		}
	}
}

/* make output */
$arr_output['test_list'] = $arrTestListResult;
$arr_output['category'] = $arrCategoryResult;
$arr_output['category_name'] = $arrCategoryName;
$arr_output['select_category'] = $intCategorySeq;
?>


text:
/**
 * This file provided by Facebook is for non-commercial testing and evaluation
 * purposes only.  Facebook reserves all rights not expressly granted.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 * FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

import {
  GraphQLBoolean,
  GraphQLID,
  GraphQLInt,
  GraphQLList,
  GraphQLNonNull,
  GraphQLObjectType,
  GraphQLSchema,
  GraphQLString,
} from 'graphql';

import {
  connectionArgs,
  connectionDefinitions,
  connectionFromArray,
  cursorForObjectInConnection,
  fromGlobalId,
  globalIdField,
  mutationWithClientMutationId,
  nodeDefinitions,
  toGlobalId,
} from 'graphql-relay';

import {
  Todo,
  User,
  addTodo,
  changeTodoStatus,
  getTodo,
  getTodos,
  getUser,
  getViewer,
  markAllTodos,
  removeCompletedTodos,
  removeTodo,
  renameTodo,
} from './database';

const {nodeInterface, nodeField} = nodeDefinitions(
  (globalId) => {
    const {type, id} = fromGlobalId(globalId);
    if (type === 'Todo') {
      return getTodo(id);
    } else if (type === 'User') {
      return getUser(id);
    }
    return null;
  },
  (obj) => {
    if (obj instanceof Todo) {
      return GraphQLTodo;
    } else if (obj instanceof User) {
      return GraphQLUser;
    }
    return null;
  }
);

const GraphQLTodo = new GraphQLObjectType({
  name: 'Todo',
  fields: {
    id: globalIdField('Todo'),
    text: {
      type: GraphQLString,
      resolve: (obj) => obj.text,
    },
    complete: {
      type: GraphQLBoolean,
      resolve: (obj) => obj.complete,
    },
  },
  interfaces: [nodeInterface],
});

const {
  connectionType: TodosConnection,
  edgeType: GraphQLTodoEdge,
} = connectionDefinitions({
  name: 'Todo',
  nodeType: GraphQLTodo,
});

const GraphQLUser = new GraphQLObjectType({
  name: 'User',
  fields: {
    id: globalIdField('User'),
    todos: {
      type: TodosConnection,
      args: {
        status: {
          type: GraphQLString,
          defaultValue: 'any',
        },
        ...connectionArgs,
      },
      resolve: (obj, {status, ...args}) =>
        connectionFromArray(getTodos(status), args),
    },
    totalCount: {
      type: GraphQLInt,
      resolve: () => getTodos().length,
    },
    completedCount: {
      type: GraphQLInt,
      resolve: () => getTodos('completed').length,
    },
  },
  interfaces: [nodeInterface],
});

const Root = new GraphQLObjectType({
  name: 'Root',
  fields: {
    viewer: {
      type: GraphQLUser,
      resolve: () => getViewer(),
    },
    node: nodeField,
  },
});

const GraphQLAddTodoMutation = mutationWithClientMutationId({
  name: 'AddTodo',
  inputFields: {
    text: { type: new GraphQLNonNull(GraphQLString) },
  },
  outputFields: {
    todoEdge: {
      type: GraphQLTodoEdge,
      resolve: ({localTodoId}) => {
        const todo = getTodo(localTodoId);
        return {
          cursor: cursorForObjectInConnection(getTodos(), todo),
          node: todo,
        };
      },
    },
    viewer: {
      type: GraphQLUser,
      resolve: () => getViewer(),
    },
  },
  mutateAndGetPayload: ({text}) => {
    const localTodoId = addTodo(text);
    return {localTodoId};
  },
});

const GraphQLChangeTodoStatusMutation = mutationWithClientMutationId({
  name: 'ChangeTodoStatus',
  inputFields: {
    complete: { type: new GraphQLNonNull(GraphQLBoolean) },
    id: { type: new GraphQLNonNull(GraphQLID) },
  },
  outputFields: {
    todo: {
      type: GraphQLTodo,
      resolve: ({localTodoId}) => getTodo(localTodoId),
    },
    viewer: {
      type: GraphQLUser,
      resolve: () => getViewer(),
    },
  },
  mutateAndGetPayload: ({id, complete}) => {
    const localTodoId = fromGlobalId(id).id;
    changeTodoStatus(localTodoId, complete);
    return {localTodoId};
  },
});

const GraphQLMarkAllTodosMutation = mutationWithClientMutationId({
  name: 'MarkAllTodos',
  inputFields: {
    complete: { type: new GraphQLNonNull(GraphQLBoolean) },
  },
  outputFields: {
    changedTodos: {
      type: new GraphQLList(GraphQLTodo),
      resolve: ({changedTodoLocalIds}) => changedTodoLocalIds.map(getTodo),
    },
    viewer: {
      type: GraphQLUser,
      resolve: () => getViewer(),
    },
  },
  mutateAndGetPayload: ({complete}) => {
    const changedTodoLocalIds = markAllTodos(complete);
    return {changedTodoLocalIds};
  },
});

// TODO: Support plural deletes
const GraphQLRemoveCompletedTodosMutation = mutationWithClientMutationId({
  name: 'RemoveCompletedTodos',
  outputFields: {
    deletedTodoIds: {
      type: new GraphQLList(GraphQLString),
      resolve: ({deletedTodoIds}) => deletedTodoIds,
    },
    viewer: {
      type: GraphQLUser,
      resolve: () => getViewer(),
    },
  },
  mutateAndGetPayload: () => {
    const deletedTodoLocalIds = removeCompletedTodos();
    const deletedTodoIds = deletedTodoLocalIds.map(toGlobalId.bind(null, 'Todo'));
    return {deletedTodoIds};
  },
});

const GraphQLRemoveTodoMutation = mutationWithClientMutationId({
  name: 'RemoveTodo',
  inputFields: {
    id: { type: new GraphQLNonNull(GraphQLID) },
  },
  outputFields: {
    deletedTodoId: {
      type: GraphQLID,
      resolve: ({id}) => id,
    },
    viewer: {
      type: GraphQLUser,
      resolve: () => getViewer(),
    },
  },
  mutateAndGetPayload: ({id}) => {
    const localTodoId = fromGlobalId(id).id;
    removeTodo(localTodoId);
    return {id};
  },
});

const GraphQLRenameTodoMutation = mutationWithClientMutationId({
  name: 'RenameTodo',
  inputFields: {
    id: { type: new GraphQLNonNull(GraphQLID) },
    text: { type: new GraphQLNonNull(GraphQLString) },
  },
  outputFields: {
    todo: {
      type: GraphQLTodo,
      resolve: ({localTodoId}) => getTodo(localTodoId),
    },
  },
  mutateAndGetPayload: ({id, text}) => {
    const localTodoId = fromGlobalId(id).id;
    renameTodo(localTodoId, text);
    return {localTodoId};
  },
});

const Mutation = new GraphQLObjectType({
  name: 'Mutation',
  fields: {
    addTodo: GraphQLAddTodoMutation,
    changeTodoStatus: GraphQLChangeTodoStatusMutation,
    markAllTodos: GraphQLMarkAllTodosMutation,
    removeCompletedTodos: GraphQLRemoveCompletedTodosMutation,
    removeTodo: GraphQLRemoveTodoMutation,
    renameTodo: GraphQLRenameTodoMutation,
  },
});

export const schema = new GraphQLSchema({
  query: Root,
  mutation: Mutation,
});


text:
package io.core9.plugin.importer;

import io.core9.core.executor.Executor;
import io.core9.core.plugin.Core9Plugin;
import io.core9.plugin.admin.AdminPlugin;
import io.core9.plugin.admin.plugins.AdminConfigRepository;
import io.core9.plugin.database.mongodb.MongoDatabase;
import io.core9.plugin.importer.processor.ImporterConfig;
import io.core9.plugin.importer.processor.Processor;
import io.core9.plugin.server.VirtualHost;
import io.core9.plugin.server.VirtualHostProcessor;

import java.util.Map;

public interface ImporterPlugin extends Core9Plugin, AdminPlugin, Executor, VirtualHostProcessor {

	final String TYPE_IMPORT = "import";

	/**
	 * Register a processor to the importer
	 * @param processor
	 */
	void registerProcessor(Processor<? extends ImporterConfig> processor);

	/**
	 * Return the data repository
	 * @return
	 */
	MongoDatabase getRepository();

	/**
	 * Return the data repository
	 * @return
	 */
	AdminConfigRepository getConfigRepository();

	/**
	 * Runs an importer
	 * @param importer
	 * @return
	 */
	String runImporter(String type, VirtualHost vhost, Map<String,Object> importer);
}


text:
exports.User = require('./user');
exports.Message = require('./message');
exports.Tag = require('./tag');
exports.Topic = require('./topic');
exports.Reply = require('./reply');
exports.Relation = require('./relation');
exports.TagCollect = require('./tag_collect');
exports.TopicTag = require('./topic_tag');
exports.TopicCollect = require('./topic_collect');
exports.TopicZhan = require('./topic_zhan');


text:
cask 'unity-download-assistant' do
  version '2018.2.0f2,787658998520'
  sha256 '75baf4f0ff48b4d5ab2d021f654388a444abcfe420685fec49980cf5ff192c15'

  url "https://netstorage.unity3d.com/unity/#{version.after_comma}/UnityDownloadAssistant-#{version.before_comma}.dmg"
  appcast 'https://unity3d.com/get-unity/download/archive'
  name 'Unity'
  homepage 'https://unity3d.com/unity/'

  installer manual: 'Unity Download Assistant.app'

  uninstall pkgutil: 'com.unity3d.*'
end


text:
/*
TODO: Needs Review and Spec
*/

module.exports = {

	upload: function (req, res) {
		var knox = require('knox-s3');
		var keystone = req.keystone;
		var Types = keystone.Field.Types;

		if (!keystone.security.csrf.validate(req, req.body.authenticity_token)) {
			return res.status(403).send({ error: { message: 'invalid csrf' } });
		}

		if (req.files && req.files.file) {

			var s3Config = keystone.get('s3 config');

			var file = req.files.file;
			var path = s3Config.s3path ? s3Config.s3path + '/' : '';

			if (!file.name) {
				var extension;
				if (file.originalname) {
					extension = file.originalname.match(/.*(\..*)/);
				}
				file.name = file.filename + (extension ? extension[1] : '');
			}

			var headers = Types.S3File.prototype.generateHeaders.call({ s3config: s3Config, options: {} }, null, file);

			var s3Client = knox.createClient(s3Config);

			s3Client.putFile(file.path, path + file.name, headers, function (err, s3Response) {
				var sendResult = function () {
					if (err) {
						return res.send({ error: { message: err.message } });
					}

					if (s3Response) {
						if (s3Response.statusCode !== 200) {
							return res.send({ error: { message: 'Amazon returned Http Code: ' + s3Response.statusCode } });
						} else {
							if (s3Config.root) {
								return res.send({ image: { url: s3Config.root + '/' + file.name } });
							} else {
								var region = 's3';
								if (s3Config.region && s3Config.region !== 'us-east-1') {
									region = 's3-' + s3Config.region;
								}
								return res.send({ image: { url: 'https://' + region + '.amazonaws.com/' + s3Config.bucket + '/' + file.name } });
							}
						}
					}
				};

				res.format({
					html: sendResult,
					json: sendResult,
				});
			});

		} else {
			res.json({ error: { message: 'No image selected' } });
		}
	},
};


text:
var Stuff = function (type, stype) {
    this.type = type;
    this.subType = stype;
    this.character = null;
    this._i = Stuff.counter;
    Stuff.counter += 1;

    return this;
};
Stuff.counter = 0;

Stuff.prototype = {
    getType: function () {
        return this.type;
    }
    , getSubtype: function () {
        return this.getSubType();
    }
    , getSubType: function () {
        return this.subType;
    }
    , getId: function () {
        return this.getType() + '-' + this.getSubtype() + '-' + this._id;
    }
    , getName: function () {
        return this.type + ' ' + this.subtype;
    }
    , _add: function (char) {
        this.character = char;
    }
    , _drop: function () {
        this.char = null;
    }
}

export { Stuff };


text:
<?xml version="1.0" encoding="utf-8"?>
<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="oridashi-docimentreference" />
  <meta>
    <lastUpdated value="2017-08-20T21:04:21.564+10:00" />
  </meta>
  <url value="http://oridashi.com.au/fhir/StructureDefinition/oridashi-documentreference" />
  <name value="Oridashi Document Reference" />
  <title value="Oridashi Document Reference" />
  <status value="draft" />
  <date value="2017-08-20T20:59:17.59+10:00" />
  <fhirVersion value="3.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="DocumentReference" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DocumentReference" />
  <derivation value="constraint" />
  <differential>
    <element id="DocumentReference.masterIdentifier">
      <path value="DocumentReference.masterIdentifier" />
      <max value="0" />
    </element>
    <element id="DocumentReference.identifier">
      <path value="DocumentReference.identifier" />
      <max value="0" />
    </element>
    <element id="DocumentReference.author">
      <path value="DocumentReference.author" />
      <max value="0" />
    </element>
    <element id="DocumentReference.authenticator">
      <path value="DocumentReference.authenticator" />
      <max value="0" />
    </element>
    <element id="DocumentReference.custodian">
      <path value="DocumentReference.custodian" />
      <min value="1" />
    </element>
    <element id="DocumentReference.relatesTo">
      <path value="DocumentReference.relatesTo" />
      <max value="0" />
    </element>
    <element id="DocumentReference.securityLabel">
      <path value="DocumentReference.securityLabel" />
      <max value="1" />
    </element>
    <element id="DocumentReference.content.attachment.language">
      <path value="DocumentReference.content.attachment.language" />
      <max value="0" />
    </element>
    <element id="DocumentReference.content.attachment.url">
      <path value="DocumentReference.content.attachment.url" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>