text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Synchytrium myosotidis var. dryadis F. Thomas

### Remarks
null


text:
import Response from "@sendgrid/helpers/classes/response";

export type ClientResponse = Response;

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<litepal>
    <dbname value="weather" ></dbname>

    <version value="2" ></version>

    <list>
        <mapping class="com.weather.app.model.CityInformation"></mapping>
    </list>
</litepal>


text:
package db.migration.mysql;

import db.migration.AbstractDeduplicateUsers;

@SuppressWarnings("unused")
public class V11_4_0_5__Deduplicate_Users extends AbstractDeduplicateUsers {
}


text:
define(function(require, exports, module) {

    var DynamicCollection = require('../widget/dynamic-collection4');
    require('jquery.sortable');
    require('es-ckeditor');

    exports.run = function() {

        // group:'course'
        CKEDITOR.replace('course-about-field', {
            allowedContent: true,
            toolbar: 'Detail',
            filebrowserImageUploadUrl: $('#course-about-field').data('imageUploadUrl')
        });

        var goalDynamicCollection = new DynamicCollection({
            element: '#course-goals-form-group'
        });

        var audiencesDynamicCollection = new DynamicCollection({
            element: '#course-audiences-form-group'
        });

        $(".sortable-list").sortable({
            'distance':20
        });

        $("#course-base-form").on('submit', function() {
            goalDynamicCollection.addItem();
            audiencesDynamicCollection.addItem();

        });

    };

});


text:
@extends('core::app.layout')

@section('content')

        @include('bumi-deposit::app/facility/bumi-deposit/_breadcrumb')

Bank

Create

Bank

    @include('bumi-deposit::app.facility.bumi-deposit.bank._menu')

    @include('core::app.error._alert')

            <form action="{{ url('facility/bumi-deposit/bank') }}" method="post" class="form-horizontal form-bordered">
                {!! csrf_field() !!}
                <fieldset>

                            <legend> Form</legend>

                </fieldset>

                    Bank Name *

                        <input type="text" name="name" id="name" class="form-control" value="{{ old('name') }}"/>

                    Branch *

                        <input type="text" name="branch" id="branch" class="form-control" value="{{ old('branch') }}" />

                    Address

                        <input type="text" name="address" id="address" class="form-control" value="{{ old('address') }}" />

                    Phone

                        <input type="text" name="phone" id="phone" class="form-control" value="{{ old('phone') }}" />

                    Fax

                        <input type="text" name="fax" id="fax" class="form-control" value="{{ old('fax') }}" />

                    Notes

                        <input type="text" name="notes" id="notes" class="form-control" value="{{ old('notes') }}" />

                <fieldset>

                            <legend> Account</legend>

                                        ACCOUNT NAME
                                        ACCOUNT NUMBER
                                        NOTES

                            <input type="button" id="addAccountRow" class="btn btn-primary" value="Add Account">

                </fieldset>

                <fieldset>

                            <legend> Product</legend>

                                        PRODUCT NAME
                                        NOTES

                            <input type="button" id="addProductRow" class="btn btn-primary" value="Add Product">

                </fieldset>

                        <button type="submit" class="btn btn-effect-ripple btn-primary">Submit</button>

            </form>

@stop

@section('scripts')

@stop


text:
/*
 * Name: TUNorrisBridge.js
 * Module:
 * Location: Norris/test/unit
 * Date: 2015-05-25
 * Version: v1.00
 *
 * History:
 *
 * ================================================================================
 * Version Date Programmer Changes
 * ================================================================================
 * v1.00 2015-06-15 Carlon Chiara Approved
 * ================================================================================
 * v0.02 2015-06-02 Pavanello Fabio Matteo Verify
 * ================================================================================
 * v0.01 2015-05-25 Bucco Riccardo Creation
 * ================================================================================
 */

describe('NorrisImpl', function(){
    require.cache = {};
    var NorrisImpl = require('../../main/DataModel/NorrisImpl.js');
    var PageImpl = require('../../main/DataModel/NorrisPage/PageImpl.js');
    var NorrisBridge = require('../../main/InternalAPIManager/NorrisBridge.js');
    var ChartBridge = require('../../main/InternalAPIManager/ChartBridge.js');
    var assert = require("assert");

    describe('createPage(pageId: String): void',function(){
        it('should create a page with the indicated id',function(){
            var page = {'charts': [],'settings': {'maxChartsCol': 3,'maxChartsRow': 2,'title': "Norris's page"},'uid': '00'};
            var endpoint = 'endpoint';
            var norrisImpl = new NorrisImpl(endpoint);
            assert.deepEqual(page,norrisImpl.createPage('00'));
        });
    });

    describe('getSettings(): NorrisSettings',function(){
        it('should return the settings of a NorrisBridge object', function(){
            var settings = {
                randomkey: 'random value',
                examplefunc: function () {},
                circular: settings,
                numeric: 5,
                boolean: true
            };

            var norrisImpl = new NorrisImpl();
            norrisImpl.settings = settings

            assert.deepEqual(settings,norrisImpl.getSettings());
        });
    });

    describe('getChart(Id: String): ChartImpl',function(){
        it('should return a chart in the page', function(){
            var endpoint = 'endpoint';
            var norrisImpl = new NorrisImpl(endpoint);

            norrisImpl.createChart('mapchart','01');
            var chart = {
                _events: {},
                _maxListeners: 10,
                data: {},
                domain: null,
                settings: {
                area : {
                    x: 0,
                    y:0,
                    zoom : 1
                },
                description: 'This is a map chart',
                legendPosition: 'topright',
                zoomPosition: 'topleft',
                scalePosition: 'bottomleft',
                allowFilter: false,
                maxItems: 5,
                title: ''
                },
                type: 'mapchart',
                uid: '01'
            };

            assert.deepEqual(chart,norrisImpl.getChart('01'));
        });
    });

});


text:
#ifndef itkFreeSurferAsciiMeshIOFactory_h
#define itkFreeSurferAsciiMeshIOFactory_h
#include "ITKIOMeshExport.h"

#include "itkObjectFactoryBase.h"
#include "itkMeshIOBase.h"

namespace itk
{
/** \class FreeSurferAsciiMeshIOFactory
   * \brief Create instances of FreeSurferAsciiMeshIO objects using an object factory.
   * \ingroup ITKIOMesh
   */
class ITKIOMesh_EXPORT FreeSurferAsciiMeshIOFactory:public ObjectFactoryBase
{
public:
  /** Standard class typedefs. */
  typedef FreeSurferAsciiMeshIOFactory Self;
  typedef ObjectFactoryBase            Superclass;
  typedef SmartPointer< Self >         Pointer;
  typedef SmartPointer< const Self >   ConstPointer;

  /** Class methods used to interface with the registered factories. */
  virtual const char * GetITKSourceVersion(void) const ITK_OVERRIDE;

  virtual const char * GetDescription(void) const ITK_OVERRIDE;

  /** Method for class instantiation. */
  itkFactorylessNewMacro(Self);

  /** Run-time type information (and related methods). */
  itkTypeMacro(FreeSurferAsciiMeshIOFactory, ObjectFactoryBase);

  /** Register one factory of this type  */
  static void RegisterOneFactory(void)
    {
    FreeSurferAsciiMeshIOFactory::Pointer freesurferFactory = FreeSurferAsciiMeshIOFactory::New();

    ObjectFactoryBase::RegisterFactoryInternal(freesurferFactory);
    }

protected:
  FreeSurferAsciiMeshIOFactory();
  ~FreeSurferAsciiMeshIOFactory();

  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;

private:
  ITK_DISALLOW_COPY_AND_ASSIGN(FreeSurferAsciiMeshIOFactory);
};
} // end namespace itk

#endif


text:
package org.lockss.util;

import java.util.Arrays;
import java.util.List;
import java.util.TimeZone;

public class TimeZoneUtil {

  /**
   *

   * Returns a {@link TimeZone} instance with exactly the given identifier, or
   * throws {@link IllegalArgumentException}.
   *

   *

   * This is useful because {@link TimeZone#getTimeZone(String)} always returns
   * something but not necessarily what the caller intended; if the time zone
   * identifier has a typo, or if the underlying system's Java time zone data is
   * broken or missing (e.g. well-known annoyance with third-party Java 7 on
   * Ubuntu 16.04), GMT is returned, probably unbeknownst to the caller. The
   * downside of this method is that {@link TimeZone#getTimeZone(String)} might
   * return a {@link TimeZone} instance that is equivalent to the one requested
   * but with another identifier, which this method refuses to do.
   *

   *
   * @param tzid
   *          A time zone identifier.
   * @return A {@link TimeZone} instance, for which {@link TimeZone#getID()}
   *         returns the same as the given time zone identifier.
   * @throws IllegalArgumentException
   * @since 1.74
   * @see TimeZone#getAvailableIDs()
   * @see TimeZone#getTimeZone(String)
   */
  public static TimeZone getExactTimeZone(String tzid) throws IllegalArgumentException {
    if (tzid == null) {
      throw new IllegalArgumentException("Time zone identifier cannot be null");
    }
    TimeZone tz = TimeZone.getTimeZone(tzid);
    String actualTzid = tz.getID();
    if (!actualTzid.equals(tzid)) {
      throw new IllegalArgumentException("Unknown time zone identifier: " + tzid);
    }
    return tz;
  }

  /**
   *

   * Performs a test to determine if basic time zone data is available. On some
   * systems (e.g. third-party Java 7 Ubuntu 16.04), Java time zone data may be
   * broken or missing, and the effect is that
   * {@link TimeZone#getTimeZone(String)} silently returns GMT.
   *

   *
   * @return True if and only the test time zones in {@link #BASIC_TIME_ZONES}
   *         seem to exist properly.
   * @since 1.74
   * @see #BASIC_TIME_ZONES
   */
  public static boolean isBasicTimeZoneDataAvailable() {
    if (TimeZone.getAvailableIDs() == null) {
      return false;
    }
    for (String id : BASIC_TIME_ZONES) {
      if (!BASIC_TIME_ZONES.contains(id)) {
        return false;
      }
      if (!id.equals(TimeZone.getTimeZone(id).getID())) {
        return false;
      }
    }
    return true;
  }

  public static final List<String> BASIC_TIME_ZONES = Arrays.asList(
      "GMT",
      "UTC",
      "America/Los_Angeles",
      "America/New_York",
      "US/Pacific",
      "US/Eastern"
  );

}


text:
jQuery(document).ready(function() {
	var update = function() {
		jQuery('.context').hide()
			.filter('.context-' + this.value.replace(/\//g,"_"))
			.show();
	};

	jQuery('#context')
		.bind('change', update)
		.bind('keyup', update).change();

	jQuery(document).bind('submit', function() {
		var expression = /^fields\[parameters\]\[[0-9]+\]\[(.*)]$/;

		// Cleanup old contexts:
		jQuery('.context:not(:visible)').remove();

		// Set filter names:
		jQuery('.parameter-duplicator.context > .content > .instances > li').each(function(index) {
			var instance = jQuery(this);

			instance.find('[name]').each(function() {
				var input = jQuery(this);
				var name = input.attr('name');
				var match = null;

				// Extract name:
				if (match = name.match(expression)) name = match[1];

				input.attr(
					'name',
					'fields[parameters]['
					+ index
					+ ']['
					+ name
					+ ']'
				);
			});
		});
	});
})


text:
This file is used to list changes made in each version of the phusion-server-tools cookbook.

## 0.1.1

* Initial release of phusion-server-tools


text:
package me._Jonathan_xD.BasePlugin;

import java.io.File;
import java.io.IOException;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin implements Listener{
	public static void main(String[] args)
	{
		YamlConfiguration ycfg = new YamlConfiguration();
		ycfg.set("Teste", "Olá ppp");
		try {
			ycfg.save(new File("500.yml"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	public void onEnable(){
		Bukkit.getServer().getPluginManager().registerEvents(this, this);
		this.getLogger().info("Plugin Enabled");
	}
	public void onDisable(){
		this.getLogger().info("Plugin Disabled");
	}
	@Override
	public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
		if(cmd.getName().equalsIgnoreCase("bp")){
			sender.sendMessage(ChatColor.RED+"Base plugin working :)");
			return true;
		}
		return false;
	}
}


text:
package de.doe300.activerecord.dsl;

import de.doe300.activerecord.jdbc.driver.JDBCDriver;
import de.doe300.activerecord.record.ActiveRecord;
import java.util.Comparator;
import java.util.Map;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.Syntax;
import javax.annotation.concurrent.Immutable;

/**
 * An object representing the SQL ORDER BY-Clause
 * @author doe300
 */
@Immutable
public interface Order extends Comparator<ActiveRecord>
{
	/**
	 * @param driver the driver for the underlying RDBMS
	 * @param tableName the name to use to uniquely identify the table
	 * @return a SQL representation of this Order
	 */
	@Syntax(value = "SQL")
	public String toSQL(@Nonnull final JDBCDriver driver, @Nullable final String tableName);

	@Override
	public int compare(ActiveRecord o1, ActiveRecord o2);

	/**
	 * @param o1 the attribute-value map for the first record
	 * @param o2 the attribute-value map for the second record
	 * @return the comparison-value
	 * @see #compare(de.doe300.activerecord.record.ActiveRecord, de.doe300.activerecord.record.ActiveRecord)
	 */
	public int compare(Map<String, Object> o1, Map<String, Object> o2);

	/**
	 * @return an Order with exact the inverse ordering
	 * @since 0.7
	 */
	@Override
	public Order reversed();

	/**
	 * Concatenates the two orders. More exact: A.thenComparing(B) => "ORDER BY" A, B
	 * @param order
	 * @return a new combined order
	 * @see Comparator#thenComparing(java.util.Comparator)
	 * @since 0.8
	 */
	@Nonnull
	public default Order thenComparing(@Nonnull final Order order)
	{
		return Orders.combine( this, order);
	}

	/**
	 * Orders are equal, if their SQL-representation is the same
	 * @param order
	 * @return whether the two orders are equal
	 * @see #equals(java.lang.Object)
	 * @since 0.7
	 */
	public default boolean equals( @Nullable final Order order )
	{
		if(order == null)
		{
			return false;
		}
		return toSQL( JDBCDriver.DEFAULT, null ).equals( order.toSQL( JDBCDriver.DEFAULT, null));
	}
}


text:
<!DOCTYPE html>

  <title>WebRTC Face Reco Demo Application</title>

<video id="localVideo" autoplay muted></video>
<canvas width="1000" height="1000" id="localCanvas"></canvas>

JS Face Detect by Liu Liu


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.opsgenie.oas</groupId>
    <artifactId>swagger-spec</artifactId>
    <packaging>jar</packaging>
    <version>1.0.12</version>
    <name>opsgenie-oas</name>
    <url>http://maven.apache.org</url>

    <build>
        <plugins>
            <!-- activate the plugin -->
            <plugin>
                <groupId>io.swagger</groupId>
                <artifactId>swagger-codegen-maven-plugin</artifactId>
                <version>${swagger-codegen-maven-plugin-version}</version>
                <executions>
                    <execution>
                        <id>swagger-java-sdk</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <!-- specify the swagger yaml/json -->
                            <inputSpec>swagger.json</inputSpec>
                            <!-- target to generate java client code -->
                            <language>java</language>

                            <configHelp>false</configHelp>

                            <!-- target output path -->
                            <output>${project.build.directory}/generated-sources/java</output>
                            <!-- package for generated models -->
                            <modelPackage>com.opsgenie.oas.sdk.model</modelPackage>
                            <!-- package for generated api classes -->
                            <apiPackage>com.opsgenie.oas.sdk.api</apiPackage>
                            <!-- package for invoker Objects -->
                            <invokerPackage>com.opsgenie.oas.sdk</invokerPackage>

                            <!-- pass any necessary config options -->
                            <configOptions>
                                <groupId>com.opsgenie.oas</groupId>
                                <artifactId>opsgenie-sdk-swagger</artifactId>
                                <artifactVersion>${project.version}</artifactVersion>
                                <developerName>Alp, Baris, Mustafa, Halil, Alperen, Zafer</developerName>
                                <developerEmail>support@opsgenie.com</developerEmail>
                                <developerOrganization>OpsGenie</developerOrganization>
                                <developerOrganizationUrl>https://www.opsgenie.com/</developerOrganizationUrl>
                                <hideGenerationTimestamp>true</hideGenerationTimestamp>
                                <dateLibrary>joda</dateLibrary>
                                <library>jersey2</library>
                                <sortParamsByRequiredFlag>false</sortParamsByRequiredFlag>
                                <useBeanValidation>true</useBeanValidation>
                                <performBeanValidation>true</performBeanValidation>
                                <supportJava6>false</supportJava6>
                                <useRuntimeException>true</useRuntimeException>
                                <licenseName>Apache License 2.0 (Apache-2.0)</licenseName>
                                <licenseUrl>https://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
                            </configOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-annotations</artifactId>
            <version>${swagger-annotations-version}</version>
        </dependency>

        <!-- You can find the dependencies for the library configuation you chose by looking in JavaClientCodegen.
             Then find the corresponding dependency on Maven Central, and set the versions in the property section below -->

        <!-- HTTP client: jersey-client -->
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
            <version>${jersey-version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-jackson</artifactId>
            <version>${jersey-version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-multipart</artifactId>
            <version>${jersey-version}</version>
        </dependency>

        <!-- JSON processing: jackson -->
        <dependency>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-base</artifactId>
            <version>${jackson-version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson-version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${jackson-version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson-data-bind-version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-json-provider</artifactId>
            <version>${jackson-version}</version>
        </dependency>

        <!-- Joda time: if you use it -->
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-joda</artifactId>
            <version>${jackson-version}</version>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>${jodatime-version}</version>
        </dependency>

        <!-- bean validation: if you use it -->
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>${javax-version}</version>
        </dependency>

        <!-- Base64 encoding that works in both JVM and Android -->
        <dependency>
            <groupId>com.brsanthu</groupId>
            <artifactId>migbase64</artifactId>
            <version>${base64-version}</version>
        </dependency>
    </dependencies>

    <properties>
        <swagger-codegen-maven-plugin-version>2.3.0</swagger-codegen-maven-plugin-version>
        <swagger-annotations-version>1.5.8</swagger-annotations-version>
        <jersey-version>2.25.1</jersey-version>
        <jackson-version>2.9.10</jackson-version>
        <jackson-data-bind-version>2.10.5.1</jackson-data-bind-version>
        <javax-version>1.1.0.Final</javax-version>
        <jodatime-version>2.7</jodatime-version>
        <base64-version>2.2</base64-version>
        <maven-plugin-version>1.0.0</maven-plugin-version>
        <junit-version>4.8.1</junit-version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
</project>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using Riganti.Selenium.Core.Abstractions.Exceptions;
using Riganti.Selenium.Core.Abstractions.Reporting;
using Riganti.Selenium.Core.Configuration;
using Riganti.Selenium.Core.Factories;

namespace Riganti.Selenium.Core.Discovery
{
    public class ResultReportersFactory
    {
        public Dictionary<string, ITestResultReporter> CreateReporters(IEnumerable<Assembly> assemblies, SeleniumTestsConfiguration configuration)
        {
            // find all factories
            var foundTypes = DiscoverReporters(assemblies);
            var reporters = InstantiateReporters(foundTypes);

            // create instances and configure them
            var result = new Dictionary<string, ITestResultReporter>();
            foreach (var factoryConfiguration in configuration.Reporting.Reporters.Where(s => s.Value.Enabled))
            {
                // try to find factory instance
                var instance = reporters.SingleOrDefault(f => f.Name == factoryConfiguration.Key);
                if (instance == null)
                {
                    throw new SeleniumTestConfigurationException($"The reporter '{factoryConfiguration.Key}' was not found!");
                }

                instance.ReportTestResultUrl = factoryConfiguration.Value.ReportTestResultUrl;

                //load options
                foreach (var entry in factoryConfiguration.Value.Options)
                {
                    instance.Options[entry.Key] = entry.Value;
                }

                // return the instance
                result[factoryConfiguration.Key] = instance;
            }
            return result;
        }

        /// <summary>
        /// Returns discovered types of Reporters that implements <see cref="ITestResultReporter"/>.
        /// </summary>
        /// <param name="assemblies"></param>
        protected virtual IEnumerable<Type> DiscoverReporters(IEnumerable<Assembly> assemblies)
        {
            var foundTypes = GetExportedTypes(assemblies)
                .Where(t => typeof(ITestResultReporter).IsAssignableFrom(t))
                .Where(t => !t.IsAbstract);
            return foundTypes;
        }

        private static IEnumerable<Type> GetExportedTypes(IEnumerable<Assembly> assemblies)
        {
            try
            {
                return assemblies.SelectMany(a => a.GetExportedTypes());
            }
            catch (ReflectionTypeLoadException e)
            {
                return e.Types.ToArray();
            }
        }

        private IList<ITestResultReporter> InstantiateReporters(IEnumerable<Type> foundTypes)
        {
            var instances = new List<ITestResultReporter>();
            foreach (var type in foundTypes)
            {
                try
                {
                    var instance = (ITestResultReporter)Activator.CreateInstance(type);
                    instances.Add(instance);
                }
                catch (Exception ex)
                {
                    throw new SeleniumTestConfigurationException($"Failed to create an instance of the '{type}'! Make sure that the reporter has a parameterless constructor.", ex);
                }
            }
            return instances;
        }
    }
}


text:
package io.opensec.six.oval.model.windows;

import io.opensec.six.oval.model.sc.EntityItemStringType;

/**
 * The EntityItemGUIDType restricts a string value to a representation of a GUID, used for module ID.
 *
 * @author  Akihito Nakamura, AIST
 * @see OVAL Language
 */
public class EntityItemGUIDType
    extends EntityItemStringType
{

    /**
     * Constructor.
     */
    public EntityItemGUIDType()
    {
    }

    public EntityItemGUIDType(
                    final String content
                    )
    {
        super( content );
    }

    //**************************************************************
    //  EntityItemBase
    //**************************************************************

//    @Override
//    public void setContent(
//                    final String content
//                    )
//    {
//        if (content != null) {
//          //validation
//          // TODO: pattern matching test required.
//          //(\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\}){0,}
//        }
//
//        super.setContent( content );
//    }

    //**************************************************************
    //  java.lang.Object
    //**************************************************************

    @Override
    public int hashCode()
    {
        return super.hashCode();
    }

    @Override
    public boolean equals(
                    final Object obj
                    )
    {
        if (this == obj) {
            return true;
        }

        if (!(obj instanceof EntityItemGUIDType)) {
            return false;
        }

        return super.equals( obj );
    }

}
//


text:
package org.hisp.dhis.webapi.controller;

import org.hisp.dhis.webapi.DhisControllerConvenienceTest;
import org.junit.jupiter.api.Test;

/**
 * Tests the
 * {@link org.hisp.dhis.webapi.controller.validation.ValidationController} using
 * (mocked) REST requests.
 *
 * @author Jan Bernitt
 */
class ValidationControllerTest extends DhisControllerConvenienceTest
{

    @Test
    void testRunValidationNotificationsTask()
    {
        assertWebMessage( "OK", 200, "OK", "Initiated validation result notification",
            POST( "/validation/sendNotifications" ).content() );
    }
}


text:
package org.apache.karaf.audit.layout;

import org.apache.karaf.audit.Event;
import org.apache.karaf.audit.util.Buffer;
import org.apache.karaf.audit.util.FastDateFormat;

import java.io.IOException;
import java.util.Locale;
import java.util.TimeZone;

public class Rfc3164Layout extends AbstractLayout {

    public static final int DEFAULT_ENTERPRISE_NUMBER = 18060;

    protected final int facility;
    protected final int priority;
    protected final int enterpriseNumber;
    protected final FastDateFormat fastDateFormat;

    protected String hdr1;
    protected String hdr2;
    protected String hdr3;

    public Rfc3164Layout(int facility, int priority, int enterpriseNumber, TimeZone timeZone, Locale locale) {
        super(new Buffer(Buffer.Format.Syslog));
        this.facility = facility;
        this.priority = priority;
        this.enterpriseNumber = enterpriseNumber;
        this.fastDateFormat = new FastDateFormat(timeZone, locale);

        hdr1 = "<" + ((facility << 3) + priority) + ">";
        hdr2 = " " + hostName + " " + appName + " " + procId + " ";
        hdr3 = enterpriseNumber > 0 ? "@" + enterpriseNumber : "";
    }

    @Override
    protected void header(Event event) throws IOException {
        buffer.append(hdr1);
        datetime(event.timestamp());
        buffer.append(hdr2);
        buffer.append(event.type());
        buffer.append(' ');
        buffer.append('[');
        buffer.append(event.type());
        buffer.append(hdr3);
    }

    @Override
    protected void footer(Event event) throws IOException {
        buffer.append(']');
    }

    @Override
    protected void append(String key, Object val) throws IOException {
        if (val != null) {
            buffer.append(' ')
                    .append(key)
                    .append('=')
                    .append('"')
                    .format(val)
                    .append('"');
        }
    }

    protected void datetime(long millis) throws IOException {
        buffer.append(fastDateFormat.getDate(millis, FastDateFormat.MMM_D2));
        buffer.append(' ');
        fastDateFormat.writeTime(millis, false, buffer);
    }

}


text:
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import withRouter from 'react-router/withRouter';
import get from 'lodash/get';

import loadData from './repo_detail_page_data_fetch';

import Footer from './../../../components/footer/footer';

class RepoDetail extends Component {
  componentWillMount() {
    if (!get(this.props, 'state.config.initialPageLoad')) {
      loadData(this.props.match, this.props.dispatch, this.props.state);
    } else {
      // TODO: warm cache for PWA, don't trigger render
    }
  }

  render() {
    if (this.props.error) {
      const errorMessage = "We're sorry, please try again later.";
      return (

{errorMessage}

{this.props.errorMessage}

      );
    }

    if (this.props.isLoading) {
      return (

Loading...

      );
    }

    const { repo } = this.props;
    return (

{repo.name}

{repo.description}

          {`Owner: ${repo.owner.login}`}

{`Stars: ${repo.stargazers_count}`}

{`Watchers: ${repo.watchers_count}`}

    );
  }
}

RepoDetail.propTypes = {
  match: PropTypes.shape({}).isRequired,
  dispatch: PropTypes.func.isRequired,
  state: PropTypes.shape({}).isRequired,
  repo: PropTypes.shape({}), // eslint-disable-line react/require-default-props
  isLoading: PropTypes.bool, // eslint-disable-line react/require-default-props
  error: PropTypes.bool, // eslint-disable-line react/require-default-props
  errorMessage: PropTypes.string // eslint-disable-line react/require-default-props
};

// More info here: https://github.com/reactjs/react-redux/issues/210
RepoDetail.defaultProps = {
  isLoading: true,
  error: false
};

function mapStateToProps(state = {}) {
  return {
    error: get(state, 'repoDetail.error'),
    errorMessage: get(state, 'repoDetail.errorMessage'),
    isLoading: get(state, 'repoDetail.isLoading'),
    repo: get(state, 'repoDetail.repo'),
    state
  };
}

export default withRouter(connect(mapStateToProps)(RepoDetail));


text:
require_relative 'book'
require_relative 'sheet'
require_relative 'source'
require_relative 'test'
require_relative 'api'
require_relative 'job'
require_relative 'job_executor'
require_relative 'expectations_matcher'
require_relative 'expectations_matcher_json'
require_relative 'expectations_matcher_array'
require_relative 'result'


text:
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/pm.h>
#include <linux/tick.h>
#include <linux/bitops.h>
#include <asm/pgalloc.h>
#include <asm/uaccess.h> /* for USER_DS macros */
#include <asm/cacheflush.h>

void show_regs(struct pt_regs *regs)
{
	printk(KERN_INFO " Registers dump: mode=%X\r\n", regs->pt_mode);
	printk(KERN_INFO " r1=%08lX, r2=%08lX, r3=%08lX, r4=%08lX\n",
				regs->r1, regs->r2, regs->r3, regs->r4);
	printk(KERN_INFO " r5=%08lX, r6=%08lX, r7=%08lX, r8=%08lX\n",
				regs->r5, regs->r6, regs->r7, regs->r8);
	printk(KERN_INFO " r9=%08lX, r10=%08lX, r11=%08lX, r12=%08lX\n",
				regs->r9, regs->r10, regs->r11, regs->r12);
	printk(KERN_INFO " r13=%08lX, r14=%08lX, r15=%08lX, r16=%08lX\n",
				regs->r13, regs->r14, regs->r15, regs->r16);
	printk(KERN_INFO " r17=%08lX, r18=%08lX, r19=%08lX, r20=%08lX\n",
				regs->r17, regs->r18, regs->r19, regs->r20);
	printk(KERN_INFO " r21=%08lX, r22=%08lX, r23=%08lX, r24=%08lX\n",
				regs->r21, regs->r22, regs->r23, regs->r24);
	printk(KERN_INFO " r25=%08lX, r26=%08lX, r27=%08lX, r28=%08lX\n",
				regs->r25, regs->r26, regs->r27, regs->r28);
	printk(KERN_INFO " r29=%08lX, r30=%08lX, r31=%08lX, rPC=%08lX\n",
				regs->r29, regs->r30, regs->r31, regs->pc);
	printk(KERN_INFO " msr=%08lX, ear=%08lX, esr=%08lX, fsr=%08lX\n",
				regs->msr, regs->ear, regs->esr, regs->fsr);
}

void (*pm_idle)(void);
void (*pm_power_off)(void) = NULL;
EXPORT_SYMBOL(pm_power_off);

static int hlt_counter = 1;

void disable_hlt(void)
{
	hlt_counter++;
}
EXPORT_SYMBOL(disable_hlt);

void enable_hlt(void)
{
	hlt_counter--;
}
EXPORT_SYMBOL(enable_hlt);

static int __init nohlt_setup(char *__unused)
{
	hlt_counter = 1;
	return 1;
}
__setup("nohlt", nohlt_setup);

static int __init hlt_setup(char *__unused)
{
	hlt_counter = 0;
	return 1;
}
__setup("hlt", hlt_setup);

void default_idle(void)
{
	if (likely(hlt_counter)) {
		local_irq_disable();
		stop_critical_timings();
		cpu_relax();
		start_critical_timings();
		local_irq_enable();
	} else {
		clear_thread_flag(TIF_POLLING_NRFLAG);
		smp_mb__after_clear_bit();
		local_irq_disable();
		while (!need_resched())
			cpu_sleep();
		local_irq_enable();
		set_thread_flag(TIF_POLLING_NRFLAG);
	}
}

void cpu_idle(void)
{
	set_thread_flag(TIF_POLLING_NRFLAG);

	/* endless idle loop with no priority at all */
	while (1) {
		void (*idle)(void) = pm_idle;

		if (!idle)
			idle = default_idle;

		tick_nohz_idle_enter();
		rcu_idle_enter();
		while (!need_resched())
			idle();
		rcu_idle_exit();
		tick_nohz_idle_exit();

		schedule_preempt_disabled();
		check_pgt_cache();
	}
}

void flush_thread(void)
{
}

int copy_thread(unsigned long clone_flags, unsigned long usp,
		unsigned long unused,
		struct task_struct *p, struct pt_regs *regs)
{
	struct pt_regs *childregs = task_pt_regs(p);
	struct thread_info *ti = task_thread_info(p);

	*childregs = *regs;
	if (user_mode(regs))
		childregs->r1 = usp;
	else
		childregs->r1 = ((unsigned long) ti) + THREAD_SIZE;

#ifndef CONFIG_MMU
	memset(&ti->cpu_context, 0, sizeof(struct cpu_context));
	ti->cpu_context.r1 = (unsigned long)childregs;
	ti->cpu_context.msr = (unsigned long)childregs->msr;
#else

	/* if creating a kernel thread then update the current reg (we don't
	 * want to use the parent's value when restoring by POP_STATE) */
	if (kernel_mode(regs))
		/* save new current on stack to use POP_STATE */
		childregs->CURRENT_TASK = (unsigned long)p;
	/* if returning to user then use the parent's value of this register */

	/* if we're creating a new kernel thread then just zeroing all
	 * the registers. That's OK for a brand new thread.*/
	/* Pls. note that some of them will be restored in POP_STATE */
	if (kernel_mode(regs))
		memset(&ti->cpu_context, 0, sizeof(struct cpu_context));
	/* if this thread is created for fork/vfork/clone, then we want to
	 * restore all the parent's context */
	/* in addition to the registers which will be restored by POP_STATE */
	else {
		ti->cpu_context = *(struct cpu_context *)regs;
		childregs->msr |= MSR_UMS;
	}

	/* FIXME STATE_SAVE_PT_OFFSET; */
	ti->cpu_context.r1  = (unsigned long)childregs;
	/* we should consider the fact that childregs is a copy of the parent
	 * regs which were saved immediately after entering the kernel state
	 * before enabling VM. This MSR will be restored in switch_to and
	 * RETURN() and we want to have the right machine state there
	 * specifically this state must have INTs disabled before and enabled
	 * after performing rtbd
	 * compose the right MSR for RETURN(). It will work for switch_to also
	 * excepting for VM and UMS
	 * don't touch UMS , CARRY and cache bits
	 * right now MSR is a copy of parent one */
	childregs->msr |= MSR_BIP;
	childregs->msr &= ~MSR_EIP;
	childregs->msr |= MSR_IE;
	childregs->msr &= ~MSR_VM;
	childregs->msr |= MSR_VMS;
	childregs->msr |= MSR_EE; /* exceptions will be enabled*/

	ti->cpu_context.msr = (childregs->msr|MSR_VM);
	ti->cpu_context.msr &= ~MSR_UMS; /* switch_to to kernel mode */
	ti->cpu_context.msr &= ~MSR_IE;
#endif
	ti->cpu_context.r15 = (unsigned long)ret_from_fork - 8;

	if (clone_flags & CLONE_SETTLS)
		;

	return 0;
}

#ifndef CONFIG_MMU
/*
 * Return saved PC of a blocked thread.
 */
unsigned long thread_saved_pc(struct task_struct *tsk)
{
	struct cpu_context *ctx =
		&(((struct thread_info *)(tsk->stack))->cpu_context);

	/* Check whether the thread is blocked in resume() */
	if (in_sched_functions(ctx->r15))
		return (unsigned long)ctx->r15;
	else
		return ctx->r14;
}
#endif

static void kernel_thread_helper(int (*fn)(void *), void *arg)
{
	fn(arg);
	do_exit(-1);
}

int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
{
	struct pt_regs regs;

	memset(&regs, 0, sizeof(regs));
	/* store them in non-volatile registers */
	regs.r5 = (unsigned long)fn;
	regs.r6 = (unsigned long)arg;
	local_save_flags(regs.msr);
	regs.pc = (unsigned long)kernel_thread_helper;
	regs.pt_mode = 1;

	return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0,
			&regs, 0, NULL, NULL);
}
EXPORT_SYMBOL_GPL(kernel_thread);

unsigned long get_wchan(struct task_struct *p)
{
/* TBD (used by procfs) */
	return 0;
}

/* Set up a thread for executing a new program */
void start_thread(struct pt_regs *regs, unsigned long pc, unsigned long usp)
{
	regs->pc = pc;
	regs->r1 = usp;
	regs->pt_mode = 0;
#ifdef CONFIG_MMU
	regs->msr |= MSR_UMS;
#endif
}

#ifdef CONFIG_MMU
#include <linux/elfcore.h>
/*
 * Set up a thread for executing a new program
 */
int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpregs)
{
	return 0; /* MicroBlaze has no separate FPU registers */
}
#endif /* CONFIG_MMU */


text:
DELETE FROM workflow_node_run WHERE id IN (SELECT id FROM (

select id from (
  select scount.*, wnr.id  from (
    select count(*) as nb, workflow_node_id,num,sub_num from workflow_node_run group by workflow_node_id,num,sub_num
  ) scount, workflow_node_run wnr
  where scount.nb > 1
  and wnr.workflow_node_id = scount.workflow_node_id and wnr.num = scount.num and wnr.sub_num = scount.sub_num
  ) allid

EXCEPT

SELECT MAX(id) from (
  select scount.*, wnr.id  from (
    select count(*) as nb, workflow_node_id,num,sub_num from workflow_node_run group by workflow_node_id,num,sub_num
  ) scount, workflow_node_run wnr
  where scount.nb > 1
  and wnr.workflow_node_id = scount.workflow_node_id and wnr.num = scount.num and wnr.sub_num = scount.sub_num
) maxid GROUP BY (maxid.workflow_node_id, maxid.num, maxid.sub_num)

) a );

select create_unique_index('workflow_node_run', 'IDX_WORKFLOW_NODE_RUN_SUBNUM', 'workflow_node_id,num,sub_num');

-- +migrate Down
DROP INDEX IDX_WORKFLOW_NODE_RUN_SUBNUM;


text:
/*
 * @(#)PartTimeEmployee.java	1.4 06/02/11
 */

package com.sun.ts.tests.ejb30.persistence.inheritance.mappedsc.annotation;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Entity;
import javax.persistence.Column;
import javax.persistence.Table;
import java.sql.Date;

/*
 * PartTimeEmployee entity extends an MappedSuperClass while overriding
 * mapping information.
 */

@Entity
@Table(name="EMPLOYEE")
@AttributeOverrides({
        @AttributeOverride(name="id",column=@Column(name="ID")),
        @AttributeOverride(name="firstName",column=@Column(name="FIRSTNAME")),
        @AttributeOverride(name="lastName",column=@Column(name="LASTNAME")),
        @AttributeOverride(name="hireDate",column=@Column(name="HIREDATE"))
})
public class PartTimeEmployee extends Employee {

    private float wage;

    public PartTimeEmployee() {
    }

    public PartTimeEmployee(int id, String firstName, String lastName, Date hireDate,
                        float salary)
    {
                super(id, firstName, lastName, hireDate);
                this.wage = wage;
    }

   // ===========================================================
   // getters and setters for the state fields

    @Column(name="SALARY")
    public float getWage() {
        return wage;
    }
    public void setWage(float wage) {
        this.wage = wage;
    }

}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;

namespace Com.Latipium.IDE.Git.Protocol {
    public abstract class AbstractSmartGitRemote : IGitRemote {
        protected abstract T UploadPack<T>(Func<Stream, T> task);

        public IEnumerable<VersionTag> GetVersions(out string masterHash) {
            string _masterHash = null;
            IEnumerable<VersionTag> result = UploadPack(stream => {
                IEnumerable<string[]> refs = new PktLines(stream)
                        .Skip(1)
                        .Select(s => Encoding.UTF8.GetString(s).Split(new[] { ' ' }, 2))
                        .Where(a => a.Length == 2)
                        .ToArray();
                _masterHash = refs.Where(a => a[1].Equals("refs/heads/master"))
                                 .Select(a => a[0]).FirstOrDefault();
                return refs.Where(a => a[1].StartsWith("refs/tags/", StringComparison.InvariantCulture))
                           .Select(a => new VersionTag(a, this))
                           .Where(v => v.Version != null);
            });
            masterHash = _masterHash;
            return result;
        }

        public byte[] FetchPack(IEnumerable<string> haves, IEnumerable<string> wants, IEnumerable<string> shallows, int deepen = 0) {
            return UploadPack(stream => {
                new PktLines(stream);
                PktLines req = new PktLines();
                foreach (string want in wants) {
                    req.Append("want ", want);
                }
                foreach (string shallow in shallows) {
                    req.Append("shallow ", shallow);
                }
                if (deepen != 0) {
                    req.Append("deepen ", deepen.ToString());
                }
                req.Flush();
                byte[] data;
                if (haves.Any()) {
                    foreach (string have in haves) {
                        req.Append("have ", have);
                        data = req.Serialize();
                        stream.Write(data, 0, data.Length);
                        req = new PktLines();
                        PktLines res = new PktLines(stream, 1);
                        if (!Encoding.UTF8.GetString(res.First()).StartsWith("ACK ", StringComparison.InvariantCulture)) {
                            throw new ProtocolViolationException("Remote did not acknowledge the request");
                        }
                    }
                    req.Append("done");
                }
                data = req.Serialize();
                stream.Write(data, 0, data.Length);
                if (!haves.Any()) {
                    new PktLines(stream, 2, false);
                    req = new PktLines();
                    req.Append("done");
                    data = req.Serialize();
                    stream.Write(data, 0, data.Length);
                    new PktLines(stream, 1);
                }
                using (MemoryStream buffer = new MemoryStream()) {
                    stream.CopyTo(buffer);
                    return buffer.ToArray();
                }
            });
        }
    }
}


text:
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "mozilla/ModuleUtils.h"
#include "nsIClassInfoImpl.h"

#include "nsAnnoProtocolHandler.h"
#include "nsAnnotationService.h"
#include "nsNavHistory.h"
#include "nsNavBookmarks.h"
#include "nsFaviconService.h"
#include "nsPlacesExportService.h"
#include "History.h"
#include "nsDocShellCID.h"

using namespace mozilla::places;

NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsNavHistory,
                                         nsNavHistory::GetSingleton)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsAnnotationService,
                                         nsAnnotationService::GetSingleton)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsNavBookmarks,
                                         nsNavBookmarks::GetSingleton)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsFaviconService,
                                         nsFaviconService::GetSingleton)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsPlacesExportService,
                                         nsPlacesExportService::GetSingleton)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(History, History::GetSingleton)

NS_GENERIC_FACTORY_CONSTRUCTOR(nsAnnoProtocolHandler)
NS_DEFINE_NAMED_CID(NS_NAVHISTORYSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_ANNOTATIONSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_ANNOPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_NAVBOOKMARKSSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_FAVICONSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_PLACESIMPORTEXPORTSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_HISTORYSERVICE_CID);

const mozilla::Module::CIDEntry kPlacesCIDs[] = {
  { &kNS_NAVHISTORYSERVICE_CID, false, NULL, nsNavHistoryConstructor },
  { &kNS_ANNOTATIONSERVICE_CID, false, NULL, nsAnnotationServiceConstructor },
  { &kNS_ANNOPROTOCOLHANDLER_CID, false, NULL, nsAnnoProtocolHandlerConstructor },
  { &kNS_NAVBOOKMARKSSERVICE_CID, false, NULL, nsNavBookmarksConstructor },
  { &kNS_FAVICONSERVICE_CID, false, NULL, nsFaviconServiceConstructor },
  { &kNS_HISTORYSERVICE_CID, false, NULL, HistoryConstructor },
  { &kNS_PLACESIMPORTEXPORTSERVICE_CID, false, NULL, nsPlacesExportServiceConstructor },
  { NULL }
};

const mozilla::Module::ContractIDEntry kPlacesContracts[] = {
  { NS_NAVHISTORYSERVICE_CONTRACTID, &kNS_NAVHISTORYSERVICE_CID },
  { NS_GLOBALHISTORY2_CONTRACTID, &kNS_NAVHISTORYSERVICE_CID },
  { NS_ANNOTATIONSERVICE_CONTRACTID, &kNS_ANNOTATIONSERVICE_CID },
  { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "moz-anno", &kNS_ANNOPROTOCOLHANDLER_CID },
  { NS_NAVBOOKMARKSSERVICE_CONTRACTID, &kNS_NAVBOOKMARKSSERVICE_CID },
  { NS_FAVICONSERVICE_CONTRACTID, &kNS_FAVICONSERVICE_CID },
  { "@mozilla.org/embeddor.implemented/bookmark-charset-resolver;1", &kNS_NAVHISTORYSERVICE_CID },
  { NS_IHISTORY_CONTRACTID, &kNS_HISTORYSERVICE_CID },
  { NS_DOWNLOADHISTORY_CONTRACTID, &kNS_HISTORYSERVICE_CID },
  { NS_PLACESIMPORTEXPORTSERVICE_CONTRACTID, &kNS_PLACESIMPORTEXPORTSERVICE_CID },
  { NULL }
};

const mozilla::Module::CategoryEntry kPlacesCategories[] = {
  { "vacuum-participant", "Places", NS_NAVHISTORYSERVICE_CONTRACTID },
  { NULL }
};

const mozilla::Module kPlacesModule = {
  mozilla::Module::kVersion,
  kPlacesCIDs,
  kPlacesContracts,
  kPlacesCategories
};

NSMODULE_DEFN(nsPlacesModule) = &kPlacesModule;


text:
namespace Microsoft.Azure.Management.AppService.Fluent.Models
{
    using Newtonsoft.Json;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// Class representing Abnormal Time Period identified in diagnosis
    /// </summary>
    public partial class AbnormalTimePeriod
    {
        /// <summary>
        /// Initializes a new instance of the AbnormalTimePeriod class.
        /// </summary>
        public AbnormalTimePeriod()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the AbnormalTimePeriod class.
        /// </summary>
        /// <param name="startTime">Start time of the downtime</param>
        /// <param name="endTime">End time of the downtime</param>
        /// <param name="events">List of Possible Cause of downtime</param>
        /// <param name="solutions">List of proposed solutions</param>
        public AbnormalTimePeriod(System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), IList<DetectorAbnormalTimePeriod> events = default(IList<DetectorAbnormalTimePeriod>), IList<Solution> solutions = default(IList<Solution>))
        {
            StartTime = startTime;
            EndTime = endTime;
            Events = events;
            Solutions = solutions;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets start time of the downtime
        /// </summary>
        [JsonProperty(PropertyName = "startTime")]
        public System.DateTime? StartTime { get; set; }

        /// <summary>
        /// Gets or sets end time of the downtime
        /// </summary>
        [JsonProperty(PropertyName = "endTime")]
        public System.DateTime? EndTime { get; set; }

        /// <summary>
        /// Gets or sets list of Possible Cause of downtime
        /// </summary>
        [JsonProperty(PropertyName = "events")]
        public IList<DetectorAbnormalTimePeriod> Events { get; set; }

        /// <summary>
        /// Gets or sets list of proposed solutions
        /// </summary>
        [JsonProperty(PropertyName = "solutions")]
        public IList<Solution> Solutions { get; set; }

    }
}


text:
package com.google.devtools.depan.remap_doc.eclipse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Provide a common logger for the entire view/tools
 * package.  Simply import this class, and use the
 * available {@link #LOG} member.
 *
 * This logger is available for use by XStream type converters, regardless
 * of the plugin that supplies the converter.
 *
 * @author Lee Carver
 */
public class RemapLogger {

  public static final Logger LOG =
      LoggerFactory.getLogger(RemapLogger.class.getName());

  private RemapLogger() {
    // Prevent instantiation.
  }
}


text:
#include <stdio.h>
#include <vector>
#include <CL/cl.h>
#include <iostream>
#include <fstream>
#include <string>
#include <tchar.h>
#include <cstdio>
#include <Windows.h>

//OpenCV
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include "opencv2/imgproc/imgproc.hpp"

using namespace std;
using  std::string;
using namespace cv;

//#pragma comment(lib,"OpenCL.lib")

//read image and get arguements
void img_init(string &str, Mat &img_buf, unsigned int &img_rows, unsigned int &img_cols, unsigned int &img_channels)
{
//	img_buf.create(576, 720, CV_8UC1);
	img_buf = imread(str);
	GaussianBlur(img_buf, img_buf, Size(5, 5), 0, 0, BORDER_DEFAULT);
	cvtColor(img_buf, img_buf, CV_BGR2GRAY);
	threshold(img_buf, img_buf, 0, 255, CV_THRESH_OTSU + CV_THRESH_BINARY);
//	convertScaleAbs(img_buf, img_buf);
//	imwrite("test_gray.jpg",img_buf);
	img_rows = img_buf.rows;
	img_cols = img_buf.cols;
	img_channels = img_buf.channels();
}

//create program
cl_program load_program(cl_context context, const char* filename)
{
	std::ifstream in(filename, std::ios_base::binary);
	if(!in.good())
	{
		return 0;

	}

	// get file length

	in.seekg(0, std::ios_base::end);
    size_t length = in.tellg();
    in.seekg(0, std::ios_base::beg);

    // read program source

	std::vector<char> data(length + 1);
	in.read(&data[0], length);
	data[length] = 0;

    // create and build program

	const char* source = &data[0];
	cl_program program = clCreateProgramWithSource(context, 1, &source, 0, 0);
	if(program == 0)
	{
		return 0;
	}
	if(clBuildProgram(program, 0, 0, 0, 0, 0) != CL_SUCCESS)
	{
		return 0;
	}
	return program;
}

int _tmain(int argc, _TCHAR* argv[])
{

	//begin time counte
	LARGE_INTEGER t1,t2,tc;
	QueryPerformanceFrequency(&tc);
    QueryPerformanceCounter(&t1);

	//Read image
	string str_in_img = "test.jpg";
	Mat in_img;
	unsigned int in_img_rows, in_img_cols, in_img_channels;
	img_init(str_in_img, in_img, in_img_rows, in_img_cols, in_img_channels);

	cout << "in_img_rows = " << in_img_rows <<endl;
	cout << "in_img_cols = " << in_img_cols <<endl;
	cout << "in_img_channels = " << in_img_channels <<endl;
	cout << "isContinue = " << in_img.isContinuous() << endl;

	cl_int err;
    cl_uint num;

	//get platform IDs
    err = clGetPlatformIDs(0, 0, &num);
    if(err != CL_SUCCESS)
	{
		std::cerr << "Unable to get platforms\n";
        return 0;
    }
    std::vector<cl_platform_id> platforms(num);
    err = clGetPlatformIDs(num, &platforms[0], &num);
    if(err != CL_SUCCESS)
	{
		std::cerr << "Unable to get platform ID\n";
        return 0;
	}

	//make context
	cl_context_properties prop[] = { CL_CONTEXT_PLATFORM, reinterpret_cast<cl_context_properties>(platforms[0]), 0 };
	cl_context context = clCreateContextFromType(prop, CL_DEVICE_TYPE_DEFAULT, NULL, NULL, NULL);
	if(context == 0)
	{
		std::cerr << "Can't create OpenCL context\n";
		return 0;
	}

	//get devices
	size_t cb;
	clGetContextInfo(context, CL_CONTEXT_DEVICES, 0, NULL, &cb);
	std::vector<cl_device_id> devices(cb / sizeof(cl_device_id));
	clGetContextInfo(context, CL_CONTEXT_DEVICES, cb, &devices[0], 0);

	clGetDeviceInfo(devices[0], CL_DEVICE_NAME, 0, NULL, &cb);
	std::string devname;
	devname.resize(cb);
	clGetDeviceInfo(devices[0], CL_DEVICE_NAME, cb, &devname[0], 0);
	std::cout << "Device: " << devname.c_str() << "\n";

	cl_command_queue queue = clCreateCommandQueue(context, devices[0], 0, 0);
	if(queue == 0)
	{
		std::cerr << "Can't create command queue\n";
		clReleaseContext(context);
		return 0;
	}

	//create buffers
	unsigned int DATA_SIZE = in_img_rows * in_img_cols * in_img_channels;

	cl_mem cl_img_in = clCreateBuffer(context, CL_MEM_READ_ONLY, sizeof(uchar) * DATA_SIZE, NULL, NULL);
	cl_mem cl_img_out = clCreateBuffer(context, CL_MEM_WRITE_ONLY,  sizeof(uchar) * DATA_SIZE, NULL, NULL);
	if(cl_img_in == 0 || cl_img_out == 0)
	{
		std::cerr << "Can't create OpenCL buffer\n";
		clReleaseMemObject(cl_img_in);
		clReleaseMemObject(cl_img_out);
		clReleaseCommandQueue(queue);
		clReleaseContext(context);
		return 0;
	}

	//make prograam
	cl_program program = load_program(context, "..\\Erosion.cl");
	if(program == 0)
	{
		std::cerr << "Can't load or build program\n";
		clReleaseMemObject(cl_img_in);
		clReleaseMemObject(cl_img_out);
		clReleaseCommandQueue(queue);
		clReleaseContext(context);
		return 0;
	}

	//create kernel
	cl_kernel erosion = clCreateKernel(program, "erosion", 0);
	if(erosion == 0)
	{
		std::cerr << "Can't load kernel\n";
		clReleaseProgram(program);
		clReleaseMemObject(cl_img_in);
		clReleaseMemObject(cl_img_out);
		clReleaseCommandQueue(queue);
		clReleaseContext(context);
		return 0;
	}

	//set kernel arguements
	clSetKernelArg(erosion, 0, sizeof(cl_mem), &cl_img_in);
	clSetKernelArg(erosion, 1, sizeof(cl_mem), &cl_img_out);
	clSetKernelArg(erosion, 2, sizeof(unsigned int), &DATA_SIZE);
//	clSetKernelArg(graying, 3, sizeof(unsigned int), &in_img_cols);
//	clSetKernelArg(graying, 4, sizeof(unsigned int), &in_img_channels);

	//wirte image data to buffer
	uchar* pixel_in = in_img.data;
	err = clEnqueueWriteBuffer(queue, cl_img_in, CL_FALSE, 0, DATA_SIZE, pixel_in, 0, NULL, NULL);
	clFinish(queue);

	//cout << "" << in_img << endl;

/*	for ( int xx = 0; xx < 720 * 576 ; xx++)
	{
		printf("%d,", pixel_in[xx]);
	}*/

	//set NDRange
	size_t work_size = 1;
	cl_event event;
	err = clEnqueueNDRangeKernel(queue, erosion, 1, 0, &work_size, 0, 0, 0, &event);
	clFinish(queue);

	Mat out_img(in_img_rows, in_img_cols, CV_8UC1);//must define the arguements when define the Mat
	cout << "out_isContinue = " << out_img.isContinuous() << endl;
	uchar* pixel_out = out_img.data;
	if(err == CL_SUCCESS)
	{
		err = clEnqueueReadBuffer(queue, cl_img_out, CL_FALSE, 0, DATA_SIZE, pixel_out, 0, 0, 0);
	}
	//time counts over
	QueryPerformanceCounter(&t2);
    printf("OpenCL program Use Time:%f\n",(t2.QuadPart - t1.QuadPart)*1.0/tc.QuadPart);

	//release cl things
	clReleaseKernel(erosion);
	clReleaseProgram(program);
	clReleaseMemObject(cl_img_in);
	clReleaseMemObject(cl_img_out);
	clReleaseCommandQueue(queue);
    clReleaseContext(context);

	//begin time count
	LARGE_INTEGER t3,t4;
	QueryPerformanceFrequency(&tc);
    QueryPerformanceCounter(&t3);

	//opencv comparison
	Mat dst;
	Mat element = getStructuringElement(MORPH_RECT, Size(17, 3));
	morphologyEx(in_img, dst, MORPH_ERODE, element);
	//time count over
	QueryPerformanceCounter(&t4);
    printf("OpenCV program  Use Time:%f\n",(t4.QuadPart - t3.QuadPart)*1.0/tc.QuadPart);

	//show result
	namedWindow("test_in");
	imshow("test_in",in_img);
	namedWindow("test_in_dst");
	imshow("test_in_dst",dst);
	namedWindow("test_out");
	imshow("test_out",out_img);

	waitKey(0);
	return 0;

}


text:
"""
Notes
-----
Calculations are carried out with numpy.float64 precision.
This Python implementation is not optimized for speed.
Angles are in radians unless specified otherwise.
Quaternions ix+jy+kz+w are represented as [x, y, z, w].
"""
import rospy
# Messages
from std_msgs.msg import Float64
from sensor_msgs.msg import JointState
from baxter_core_msgs.msg import EndpointState
from omni_msgs.msg import OmniState, OmniFeedback, OmniButtonEvent
from geometry_msgs.msg import Vector3, Point, PoseStamped, Quaternion, Wrench, Transform, PoseStamped
from visualization_msgs.msg import Marker
from std_msgs.msg import Bool
# State Machine
import smach
import smach_ros
from smach import CBState
# Math
from math import pi, exp, sin, sqrt
import numpy as np
import tf.transformations as tr
# Quaternions tools
import PyKDL
import time

GREY_BUTTON = 0
WHITE_BUTTON = 1

class TextColors:
  HEADER = '\033[95m'
  OKBLUE = '\033[94m'
  OKGREEN = '\033[92m'
  WARNING = '\033[93m'
  FAIL = '\033[91m'
  ENDC = '\033[0m'

  def disable(self):
    self.HEADER = ''
    self.OKBLUE = ''
    self.OKGREEN = ''
    self.WARNING = ''
    self.FAIL = ''
    self.ENDC = ''

class RatePositionController:
  STATES = ['GO_TO_CENTER', 'POSITION_CONTROL', 'VIBRATORY_PHASE', 'RATE_CONTROL', 'RATE_COLLISION']
  def __init__(self):
    # Create a SMACH state machine
    self.sm = smach.StateMachine(outcomes=['succeeded', 'aborted'])
    with self.sm:
      # Add states to the state machine
      smach.StateMachine.add('GO_TO_CENTER', CBState(self.go_to_center, cb_args=[self]),
                             transitions={'stay': 'GO_TO_CENTER', 'to_pos': 'POSITION_CONTROL', 'to_rate': 'RATE_CONTROL', 'aborted': 'aborted'})
      smach.StateMachine.add('POSITION_CONTROL', CBState(self.position_control, cb_args=[self]),
                             transitions={'stay': 'POSITION_CONTROL', 'to_cen': 'GO_TO_CENTER', 'to_vib': 'VIBRATORY_PHASE', 'aborted': 'aborted'})
      smach.StateMachine.add('VIBRATORY_PHASE', CBState(self.vibratory_phase, cb_args=[self]),
                             transitions={'vibrate': 'VIBRATORY_PHASE', 'succeeded': 'RATE_CONTROL', 'aborted': 'aborted'})
      smach.StateMachine.add('RATE_CONTROL', CBState(self.rate_control, cb_args=[self]),
                             transitions={'stay': 'RATE_CONTROL', 'to_cen': 'GO_TO_CENTER', 'collision': 'RATE_COLLISION', 'aborted': 'aborted'})
      smach.StateMachine.add('RATE_COLLISION', CBState(self.rate_collision, cb_args=[self]),
                             transitions={'succeeded': 'GO_TO_CENTER', 'aborted': 'aborted'})

    # Read all the parameters from the parameter server
    # Topics to interact
    master_name = self.read_parameter('~master_name', 'phantom')
    slave_name = self.read_parameter('~slave_name', 'grips')
    self.master_state_topic = '/%s/state' % master_name
    self.slave_state_topic = '/%s/state' % slave_name
    self.ik_mc_topic = '/%s/ik_command' % slave_name
    self.sm_control_topic = '/rate_pos/sm_control'
    self.sm_desired_topic = '/rate_pos/sm_desired'
    ### <FORCE COUPLED>
    self.feedback_topic = '/%s/force_feedback' % master_name
    self.ext_forces_topic = '/%s/external_forces' % slave_name

    # Workspace definition
    self.units = self.read_parameter('~units', 'mm')
    width = self.read_parameter('~workspace/width', 140.0)
    height = self.read_parameter('~workspace/height', 100.0)
    depth = self.read_parameter('~workspace/depth', 55.0)
    self.center_pos = self.read_parameter('~workspace/center', [0, 0 ,0])
    self.workspace = np.array([width, depth, height])
    self.hysteresis = self.read_parameter('~hysteresis', 3.0)
    self.pivot_dist = self.read_parameter('~pivot_dist', 5.0)

    # Force feedback parameters
    self.k_center = self.read_parameter('~k_center', 0.1)
    self.b_center = self.read_parameter('~b_center', 0.003)
    self.k_rate = self.read_parameter('~k_rate', 0.05)
    self.b_rate = self.read_parameter('~b_rate', 0.003)

    # Position parameters
    self.hysteresis = self.read_parameter('~hysteresis', 3.0)
    self.pivot_dist = self.read_parameter('~pivot_dist', 5.0)
    self.position_ratio = self.read_parameter('~position_ratio', 250)
    ### Rotation between Slave and Master
    self.axes_arot_1 = self.read_parameter('~axes_arot_1', [0, 0, 0])
    self.angle_arot_1 = self.read_parameter('~angle_arot_1', 0.0)
    self.axes_arot_2 = self.read_parameter('~axes_arot_2', [0, 0, 0])
    self.angle_arot_2 = self.read_parameter('~angle_arot_2', 0.0)
    self.axes_arot_3 = self.read_parameter('~axes_arot_3', [0, 0, 0])
    self.angle_arot_3 = self.read_parameter('~angle_arot_3', 0.0)
    self.axes_mrot_1 = self.read_parameter('~axes_mrot_1', [0, 0, 0])
    self.angle_mrot_1 = self.read_parameter('~angle_mrot_1', 0.0)
    self.axes_mrot_2 = self.read_parameter('~axes_mrot_2', [0, 0, 0])
    self.angle_mrot_2 = self.read_parameter('~angle_mrot_2', 0.0)
    self.axes_mrot_3 = self.read_parameter('~axes_mrot_3', [0, 0, 0])
    self.angle_mrot_3 = self.read_parameter('~angle_mrot_3', 0.0)
    ### Axis modification
    self.position_axes = [0, 1, 2]
    self.position_sign = np.array([1.0, 1.0, 1.0])
    self.axes_mapping = self.read_parameter('~axes_mapping', ['x', 'y' ,'z'])
    rospy.logwarn('axes_mapping[0] -> %s' % self.axes_mapping[0])
    rospy.logwarn('axes_mapping[1] -> %s' % self.axes_mapping[1])
    rospy.logwarn('axes_mapping[2] -> %s' % self.axes_mapping[2])
    if len(self.axes_mapping) != 3:
      rospy.logwarn('The invalid number of values in [axes_mapping]. Received 3, expected %d' % len(self.axes_mapping))
    for i, axis in enumerate(self.axes_mapping):
      axis = axis.lower()
      if '-' == axis[0]:
        axis = axis[1:]
        self.position_sign[i] = -1.0
      if axis not in ('x','y','z'):
        rospy.logwarn('Invalid axis %s given in [axes_mapping]' % axis)
      self.position_axes[i] = ['x','y','z'].index(axis)

    # Vibration parameters
    self.vib_a = self.read_parameter('~vibration/a', 2.0)             # Amplitude (mm)
    self.vib_c = self.read_parameter('~vibration/c', 5.0)             # Damping
    self.vib_freq = self.read_parameter('~vibration/frequency', 30.0) # Frequency (Hz)
    self.vib_time = self.read_parameter('~vibration/duration', 0.3)   # Duration (s)
    self.vib_start_time = 0.0

    # Rate parameters
    self.rate_pivot = np.zeros(3)
    self.rate_gain = self.read_parameter('~rate_gain', 1.0)

    # Initial values
    self.publish_frequency = self.read_parameter('~publish_rate', 1000.0)
    self.frame_id = self.read_parameter('~reference_frame', 'world')
    self.current_strategy = self.read_parameter('~mode_name','b')
    self.center_pos = np.array([0, 0, 0])
    self.colors = TextColors()
    self.gripper_cmd = 0.0
    self.master_pos = None
    self.master_rot = np.array([0, 0, 0, 1])
    self.master_vel = np.zeros(3)
    self.master_dir = np.zeros(3)
    self.slave_pos = None
    self.slave_rot = np.array([0, 0, 0, 1])
    self.slave_collision = False
    self.control_desired = 1.0
    ### <FORCE COUPLED>
    self.force_feedback = np.zeros(3)
    self.ext_forces = np.zeros(3)

    # Synch
    self.slave_synch_pos = np.zeros(3)
    self.slave_synch_rot = np.array([0, 0, 0, 1])
    self.master_synch_rot = np.array([0, 0, 0, 1])

    # Setup Publishers
    self.sm_control_pub = rospy.Publisher(self.sm_control_topic, Float64)
    self.ik_mc_pub = rospy.Publisher(self.ik_mc_topic, PoseStamped)
    self.vis_pub = rospy.Publisher('visualization_marker', Marker)
    ### <FORCE COUPLED>
    self.feedback_pub = rospy.Publisher(self.feedback_topic, OmniFeedback)

    # Setup Subscribers
    rospy.Subscriber(self.master_state_topic, OmniState, self.cb_master_state)
    rospy.Subscriber(self.slave_state_topic, PoseStamped, self.cb_slave_state)
    rospy.Subscriber(self.sm_desired_topic, Float64, self.cb_control_desired)
    ### <FORCE COUPLED>
    rospy.Subscriber(self.ext_forces_topic, OmniFeedback, self.cb_ext_forces)

    self.loginfo('Waiting for [%s] topic' % (self.master_state_topic))
    self.loginfo('Waiting for [%s] topic' % (self.slave_state_topic))
    while not rospy.is_shutdown():
      if (self.slave_pos == None) or (self.master_pos == None):
        rospy.sleep(0.01)
      else:
        self.loginfo('Rate position controller running')
        # Register rospy shutdown hook
        rospy.on_shutdown(self.shutdown_hook)
        break

    # Make sure the first command sent to the slave is equal to its current position6D
    self.command_pos = np.array(self.slave_pos)
    self.command_rot = np.array(self.slave_rot)

    # Start the timer that will publish the ik commands
    self.loginfo('Publisher frequency: [%f]' % self.publish_frequency)
    self.timer = rospy.Timer(rospy.Duration(1.0/self.publish_frequency), self.publish_command)
    self.loginfo('State machine state: GO_TO_CENTER')

  @smach.cb_interface(outcomes=['stay', 'to_rate', 'to_pos', 'aborted'])
  def go_to_center(user_data, self):

    if not np.allclose(np.zeros(3), self.master_pos, atol=self.hysteresis):
      self.sm_control_pub.publish(4.0)
      ### <FORCE COUPLED>
      #~ rospy.logwarn('pose z [%f]' % (self.master_pos[2]))
      self.force_feedback = (self.k_center * self.master_pos + self.b_center * self.master_vel) * -1.0
      #~ rospy.logwarn('Force x [%f]' % (self.force_feedback[0]))
      #~ rospy.logwarn('Force y [%f]' % (self.force_feedback[1]))
      #~ rospy.logwarn('Force z [%f]' % (self.force_feedback[2]))
      #~ rospy.logwarn('------------------------------------')
      return 'stay'

    else:
      if (self.control_desired == 1.0):
        self.sm_control_pub.publish(1.0)
        self.slave_synch_pos = np.array(self.slave_pos)
        self.slave_synch_rot = np.array(self.slave_rot)
        self.master_synch_rot = np.array(self.master_rot)
        self.command_pos = np.array(self.slave_pos)
        self.command_rot = np.array(self.slave_rot)
        if (self.current_strategy == "a"):
          self.draw_position_region(self.slave_synch_pos)

        self.loginfo('State machine transitioning: GO_TO_CENTER:to_pos-->POSITION_CONTROL')
        ### <FORCE COUPLED>
        self.force_feedback = np.zeros(3)

        return 'to_pos'

      elif (self.control_desired == 2.0):
        self.sm_control_pub.publish(2.0)
        self.command_pos = np.array(self.slave_pos)
        self.command_rot = np.array(self.slave_rot)
        self.slave_synch_pos = np.array(self.slave_pos)
        self.slave_synch_rot = np.array(self.slave_rot)
        # The pivot point should be inside the position area but it's better when we use the center
        #~ self.rate_pivot = self.master_pos - self.pivot_dist * self.normalize_vector(self.master_pos)
        self.rate_pivot = np.array(self.master_pos)
        self.loginfo('State machine transitioning: GO_TO_CENTER:to_rate-->RATE_CONTROL')
        ### <FORCE COUPLED>
        self.force_feedback = np.zeros(3)

        return 'to_rate'

  @smach.cb_interface(outcomes=['stay', 'to_vib', 'to_cen', 'aborted'])
  def position_control(user_data, self):

    if (self.control_desired == 1.0):
      self.command_pos = self.slave_synch_pos + (self.master_pos / self.position_ratio)
      self.command_rot = np.array(self.master_rot)
      self.sm_control_pub.publish(1.0)
      ### <FORCE COUPLED>
      self.force_feedback = self.ext_forces

      return 'stay'

    else:
      if (self.current_strategy == "a"):
        self.sm_control_pub.publish(3.0)
        self.command_pos = np.array(self.slave_pos)
        self.command_rot = np.array(self.slave_rot)
        self.vib_start_time = rospy.get_time()
        self.loginfo('State machine transitioning: POSITION_CONTROL:to_vib-->VIBRATORY_PHASE')
        ### <FORCE COUPLED>
        self.force_feedback = np.zeros(3)

        return 'to_vib'

      else:
        self.sm_control_pub.publish(4.0)
        self.command_pos = np.array(self.slave_pos)
        self.command_rot = np.array(self.slave_rot)
        self.loginfo('State machine transitioning: POSITION_CONTROL:to_cen-->GO_TO_CENTER')
        ### <FORCE COUPLED>
        self.force_feedback = np.zeros(3)

        return 'to_cen'

  @smach.cb_interface(outcomes=['vibrate', 'succeeded', 'aborted'])
  def vibratory_phase(user_data, self):
    if rospy.get_time() < self.vib_start_time + self.vib_time:
      self.sm_control_pub.publish(3.0)
      ### <FORCE COUPLED>
      t = rospy.get_time() - self.vib_start_time
      amplitude = -self.vib_a*exp(-self.vib_c*t)*sin(2*pi*self.vib_freq*t);
      self.force_feedback = amplitude * self.master_dir

      return 'vibrate'

    else:
      self.sm_control_pub.publish(2.0)
      self.slave_synch_pos = np.array(self.slave_pos)
      self.slave_synch_rot = np.array(self.slave_rot)
      # The pivot point should be inside the position area but it's better when we use the center
      #~ self.rate_pivot = self.master_pos - self.pivot_dist * self.normalize_vector(self.master_pos)
      self.rate_pivot = np.array(self.master_pos)
      self.loginfo('State machine transitioning: VIBRATORY_PHASE:succeeded-->RATE_CONTROL')
      ### <FORCE COUPLED>
      self.force_feedback = np.zeros(3)

      return 'succeeded'

  @smach.cb_interface(outcomes=['stay', 'to_cen', 'collision', 'aborted'])
  def rate_control(user_data, self):
    if not self.slave_collision:
        if (self.control_desired == 2.0):
          self.sm_control_pub.publish(2.0)
          distance = sqrt(np.sum((self.master_pos - self.rate_pivot) ** 2)) / self.position_ratio
          self.command_pos += (self.rate_gain * distance * self.normalize_vector(self.master_pos)) / self.position_ratio
          self.command_rot = np.array(self.slave_synch_rot)
          ### <FORCE COUPLED>
          self.force_feedback = (self.k_rate * self.master_pos + self.b_rate * self.master_vel) * -1.0
          self.force_feedback += self.ext_forces

          return 'stay'

        else:
          self.sm_control_pub.publish(4.0)
          self.command_pos = np.array(self.slave_pos)
          self.command_rot = np.array(self.slave_rot)
          self.loginfo('State machine transitioning: RATE_CONTROL:leave-->GO_TO_CENTER')
          ### <FORCE COUPLED>
          self.force_feedback = np.zeros(3)

          return 'to_cen'

    else:
        self.command_pos = np.array(self.slave_pos)
        self.command_rot = np.array(self.slave_rot)
        self.sm_control_pub.publish(0.0)
        self.loginfo('State machine transitioning: RATE_CONTROL:collision-->RATE_COLLISION')
        ### <FORCE COUPLED>
        self.force_feedback = np.zeros(3)

        return 'collision'

  @smach.cb_interface(outcomes=['succeeded', 'aborted'])
  def rate_collision(user_data, self):
    self.control_desired = 1.0
    self.loginfo('State machine transitioning: RATE_COLLISION:succeeded-->GO_TO_CENTER')

    return 'succeeded'

  def execute(self):
    self.sm.execute()

  def shutdown_hook(self):
    # Stop the state machine
    self.sm.request_preempt()
    # Stop the publisher timer
    self.timer.shutdown()

  def read_parameter(self, name, default):
    if not rospy.has_param(name):
      rospy.logwarn('Parameter [%s] not found, using default: %s' % (name, default))
    return rospy.get_param(name, default)

  def loginfo(self, msg):
    rospy.logwarn(self.colors.OKBLUE + str(msg) + self.colors.ENDC)

  def normalize_vector(self, v):
    result = np.array(v)
    norm = np.sqrt(np.sum((result ** 2)))
    if norm:
      result /= norm
    return result

  def change_axes(self, array, index=None, sign=None):
    if index == None:
      index = self.position_axes
    if sign == None:
      sign = self.position_sign
    result = np.zeros(len(array))
    for i, idx in enumerate(index):
      result[i] = array[idx] * sign[idx]
    return result

  def change_force_axes(self, array, index=None, sign=None):
    if index == None:
      index = self.position_axes
    if sign == None:
      sign = self.position_sign
    result = np.zeros(len(array))
    for i, idx in enumerate(index):
      result[i] = array[idx] * sign[i] #~ ??
    return result

  ### <FORCE COUPLED>
  def send_feedback(self):
    feedback_msg = OmniFeedback()
    force = self.force_feedback
    pos = self.change_axes(self.center_pos)
    feedback_msg.force = Vector3(*force)
    feedback_msg.position = Vector3(*pos)
    self.feedback_pub.publish(feedback_msg)

  # DO NOT print to the console within this function
  def cb_master_state(self, msg):
    self.master_real_pos = np.array([msg.pose.position.x, msg.pose.position.y, msg.pose.position.z])
    pos = np.array([msg.pose.position.x, msg.pose.position.y, msg.pose.position.z]) - self.center_pos
    vel = np.array([msg.velocity.x, msg.velocity.y, msg.velocity.z])
    self.master_pos = self.change_axes(pos)
    self.master_vel = self.change_axes(vel)

    real_rot = np.array([msg.pose.orientation.x, msg.pose.orientation.y, msg.pose.orientation.z, msg.pose.orientation.w])

    #~ # Synchronize rotation axis
    if (self.angle_arot_1 == 0.0):
        aux_arot_1 = real_rot
    else:
        q_a1 = tr.quaternion_about_axis(self.angle_arot_1, self.axes_arot_1)
        aux_arot_1 = tr.quaternion_multiply(real_rot, q_a1)

    if (self.angle_arot_2 == 0.0):
        aux_arot_2 = aux_arot_1
    else:
        q_a2 = tr.quaternion_about_axis(self.angle_arot_2, self.axes_arot_2)
        aux_arot_2 = tr.quaternion_multiply(aux_arot_1, q_a2)

    if (self.angle_arot_3 == 0.0):
        aux_arot_3 = aux_arot_2
    else:
        q_a3 = tr.quaternion_about_axis(self.angle_arot_3, self.axes_arot_3)
        aux_arot_3 = tr.quaternion_multiply(aux_arot_2, q_a3)

    # Synchronize rotation movement
    if (self.angle_mrot_1 == 0.0):
        aux_mrot_1 = aux_arot_3
    else:
        q_m1 = tr.quaternion_about_axis(self.angle_mrot_1, self.axes_mrot_1)
        aux_mrot_1 = tr.quaternion_multiply(q_m1, aux_arot_3)

    if (self.angle_mrot_2 == 0.0):
        aux_mrot_2 = aux_mrot_1
    else:
        q_m2 = tr.quaternion_about_axis(self.angle_mrot_2, self.axes_mrot_2)
        aux_mrot_2 = tr.quaternion_multiply(q_m2, aux_mrot_1)

    if (self.angle_mrot_3 == 0.0):
        aux_mrot_3 = aux_mrot_2
    else:
        q_m3 = tr.quaternion_about_axis(self.angle_mrot_3, self.axes_mrot_3)
        aux_mrot_3 = tr.quaternion_multiply(q_m3, aux_mrot_2)

    self.master_rot = aux_mrot_3

    #Normalize velocitity
    self.master_dir = self.normalize_vector(self.master_vel)

  def cb_slave_state(self, msg):
    self.slave_pos = np.array([msg.pose.position.x, msg.pose.position.y, msg.pose.position.z])
    self.slave_rot = np.array([msg.pose.orientation.x, msg.pose.orientation.y, msg.pose.orientation.z, msg.pose.orientation.w])

  def cb_control_desired(self,msg):
    self.control_desired = msg.data

  def cb_slave_collision(self, msg):
    self.slave_collision = msg.data

  ### <FORCE COUPLED>
  def cb_ext_forces(self, msg):
    self.ext_forces = self.change_force_axes(np.array([msg.force.x, msg.force.y, msg.force.z]))

  def publish_command(self, event):

    position, orientation = self.command_pos, self.command_rot
    ik_mc_msg = PoseStamped()
    ik_mc_msg.header.frame_id = self.frame_id
    ik_mc_msg.header.stamp = rospy.Time.now()
    ik_mc_msg.pose.position = Point(*position)
    ik_mc_msg.pose.orientation = Quaternion(*orientation)

    try:
      self.ik_mc_pub.publish(ik_mc_msg)
      self.send_feedback()
    except rospy.exceptions.ROSException:
      pass

  def draw_position_region(self, center_pos):
    marker = Marker()
    marker.header.frame_id = self.frame_id
    marker.header.stamp = rospy.Time.now()
    marker.id = 0;
    marker.type = marker.SPHERE
    marker.ns = 'position_region'
    marker.action = marker.ADD
    marker.pose.position.x = center_pos[0]
    marker.pose.position.y = center_pos[1]
    marker.pose.position.z = center_pos[2]
    #~ Workspace ellipsoid: self.workspace
    marker.scale.x = 2 * self.workspace[0]/self.position_ratio
    marker.scale.y = 2 * self.workspace[1]/self.position_ratio
    marker.scale.z = 2 * self.workspace[2]/self.position_ratio
    marker.color.a = 0.5
    marker.color.r = 1.0
    marker.color.g = 1.0
    marker.color.b = 0.2
    #~ Publish
    self.vis_pub.publish(marker)

if __name__ == '__main__':
  rospy.init_node('rate_position_controller', log_level=rospy.WARN)
  try:
    controller = RatePositionController()
    controller.execute()
  except rospy.exceptions.ROSInterruptException:
      pass


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mem. N. Y. bot. Gdn 49: 282 (1989)

#### Original name
Nectria parviphialis Samuels

### Remarks
null


text:
shared_examples "it has a classifications assocation" do

  context "when no classifications exist" do

    it "should return an empty array" do
      expect(relation_instance.classifications).to eq([])
    end
  end

  context "when classifications exist" do

    let(:classification) { build(:classification) }

    it "should return the linked classifications" do
      relation_instance.classifications << classification
      expect(relation_instance.classifications).to eq([classification])
    end
  end
end

shared_examples "it has a cached counter for classifications" do
  let(:classification_with_relation) do
    association_name = relation_instance.class.name.underscore.to_sym
    name = Classification.reflect_on_association(association_name).name
    create(:classification, name => relation_instance)
  end

  it "should cache the count of classficiatons" do
    expect(relation_instance.classifications_count).to eq(0)
  end

  context "when adding a classification" do

    let!(:add_classification) do
      classification_with_relation
      relation_instance.reload
    end

    it "should increment the count" do
      expect(relation_instance.classifications_count).to eq(1)
    end

    context "when deleting a classification" do

      it "should have a classification to destroy" do
        expect(relation_instance.classifications).to eq([classification_with_relation])
      end

      it "should decrement the count" do
        classification_with_relation.destroy
        relation_instance.reload
        expect(relation_instance.classifications_count).to eq(0)
      end
    end
  end
end