text:
package libsecurityRestful

import (
	"crypto/rsa"
	"encoding/json"
	"fmt"
	"net/http"
	"strings"

	"github.com/emicklei/go-restful"
	am "github.com/ibm-security-innovation/libsecurity-go/accounts"
	app "github.com/ibm-security-innovation/libsecurity-go/app/token"
	en "github.com/ibm-security-innovation/libsecurity-go/entity"
	logger "github.com/ibm-security-innovation/libsecurity-go/logger"
	cr "github.com/ibm-security-innovation/libsecurity-go/restful/common-restful"
	ss "github.com/ibm-security-innovation/libsecurity-go/storage"
)

const (
	stPrefix  = "/libsecurity"
	storePath = "/store"
	loadPath  = "/load"

	userIDParam = "user-name"
)

var (
	servicePath  string
	toFilterFlag = true

	checkSecretStrength = true // Allow only strength secrets
)

// LibsecurityRestful : The LibsecurityRestful structure
type LibsecurityRestful struct {
	UsersList     *en.EntityManager
	verifyKey     *rsa.PublicKey
	loginKey      []byte
	SignKey       *rsa.PrivateKey
	SecureStorage *ss.SecureStorage
}

func init() {
	initCommandToPath()
}

// NewLibsecurityRestful : return a pointer to the LibsecurityRestful structure
func NewLibsecurityRestful() *LibsecurityRestful {
	return &LibsecurityRestful{}
}

// SetToFilterFlag : set the filter flag state
func (l LibsecurityRestful) SetToFilterFlag(val bool) {
	toFilterFlag = val
	logger.Info.Println("Set toFilterFlag to:", toFilterFlag)
}

// Continue if we need to filter
func (l LibsecurityRestful) toFilter() bool {
	if toFilterFlag == false {
		logger.Info.Println("No filtering")
	}
	return toFilterFlag
}

func (l LibsecurityRestful) getCookieAccessTokenValue(req *restful.Request) string {
	vec := req.Request.Cookies()

	tokenStr := ""
	for _, c := range vec {
		if c.Name == cr.AccessToken {
			tokenStr = c.Value
		}
		logger.Trace.Println("cookie name:", c.Name, "value:", c.Value)
	}
	return tokenStr
}

func (l LibsecurityRestful) verifyUserPermissions(req *restful.Request, resp *restful.Response, chain *restful.FilterChain, userPermission string) bool {
	if l.toFilter() == false {
		return true
	}

	tokenStr := l.getCookieAccessTokenValue(req)
	if tokenStr == "" {
		l.setError(resp, http.StatusMethodNotAllowed, fmt.Errorf("Authentication is required"))
		return false
	}
	isPrivilegeOk, err := app.IsPrivilegeOk(tokenStr, userPermission, getIPAddress(req), l.verifyKey)
	if err != nil {
		l.setError(resp, http.StatusMethodNotAllowed, err)
		return false
	}
	if isPrivilegeOk == false {
		l.setError(resp, http.StatusMethodNotAllowed, fmt.Errorf("This command must be called by root user"))
		return false
	}
	return true
}

func (l LibsecurityRestful) isUpdatePasswordOnly(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) bool {
	if l.toFilter() == false {
		return false
	}

	tokenStr := l.getCookieAccessTokenValue(req)
	if tokenStr == "" {
		l.setError(resp, http.StatusMethodNotAllowed, fmt.Errorf("Authentication is required"))
		return false
	}
	isUpdatePasswordOnly, err := app.IsUpdatePasswordOnlySet(tokenStr, getIPAddress(req), l.verifyKey)
	if err != nil {
		l.setError(resp, http.StatusMethodNotAllowed, err)
		return false
	}
	return isUpdatePasswordOnly
}

// SuperUserFilter : Verify that the commands is called by user with super user privilege
func (l LibsecurityRestful) SuperUserFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {
	if l.verifyUserPermissions(req, resp, chain, am.SuperUserPermission) == true {
		chain.ProcessFilter(req, resp)
	}
}

func (l LibsecurityRestful) sameUserFilterCheckPasswordUpdate(req *restful.Request, resp *restful.Response, chain *restful.FilterChain, passwordUpdateOnly bool) {
	if l.toFilter() == false {
		chain.ProcessFilter(req, resp)
		return
	}

	name := req.PathParameter(userIDParam)
	logger.Trace.Println("SameUserFilter: user name:", name)
	tokenStr := l.getCookieAccessTokenValue(req)
	if tokenStr == "" {
		l.setError(resp, http.StatusMethodNotAllowed, fmt.Errorf("Authentication is required"))
		return
	}
	isUserMatch, err := app.IsItTheSameUser(tokenStr, name, getIPAddress(req), l.verifyKey)
	if err != nil {
		l.setError(resp, http.StatusMethodNotAllowed, err)
		return
	}
	isPrivilegeOk, _ := app.IsPrivilegeOk(tokenStr, am.SuperUserPermission, getIPAddress(req), l.verifyKey)
	if isPrivilegeOk == false && isUserMatch == false {
		tokenData, _ := app.ParseToken(tokenStr, getIPAddress(req), l.verifyKey)
		l.setError(resp, http.StatusMethodNotAllowed, fmt.Errorf("User '%v' is not permitted to run the operation, Only root or the user can run it.", tokenData.UserName))
		return
	}
	if passwordUpdateOnly == true {
		updatePasswordOnly := l.isUpdatePasswordOnly(req, resp, chain)
		if updatePasswordOnly == true {
			l.setError(resp, http.StatusMethodNotAllowed, fmt.Errorf("The only permitted operation is to update the user password"))
			return
		}
	}
	chain.ProcessFilter(req, resp)
}

// SameUserFilter : Verify that the commands is called by a super user or the user itself and that the updatePassword is not set in the token
func (l LibsecurityRestful) SameUserFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {
	l.sameUserFilterCheckPasswordUpdate(req, resp, chain, true)
}

// SameUserUpdatePasswordFilter : Verify that the commands is called by a super user or the user itself, don't check if the updatePassword flag is set
func (l LibsecurityRestful) SameUserUpdatePasswordFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {
	l.sameUserFilterCheckPasswordUpdate(req, resp, chain, false)
}

// VerifyToken : verify is the received token is legal and as expected
func (l LibsecurityRestful) VerifyToken(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) {
	tokenStr := l.getCookieAccessTokenValue(req)
	if tokenStr == "" {
		l.setError(resp, http.StatusMethodNotAllowed, fmt.Errorf("Authentication is required"))
		return
	}
	_, err := app.ParseToken(tokenStr, getIPAddress(req), l.verifyKey)
	if err != nil {
		l.setError(resp, http.StatusMethodNotAllowed, err)
		return
	}
	chain.ProcessFilter(req, resp)
}

// SetData : initialize the LibsecurityRestful structure
func (l *LibsecurityRestful) SetData(el *en.EntityManager, loginKeyVal []byte, verifyKeyval *rsa.PublicKey, signKeyVal *rsa.PrivateKey, secureStorage *ss.SecureStorage) {
	l.UsersList = el
	l.loginKey = loginKeyVal
	l.verifyKey = verifyKeyval
	l.SignKey = signKeyVal
	l.SecureStorage = secureStorage
}

func (l LibsecurityRestful) getURLPath(request *restful.Request, name string) cr.URL {
	return cr.URL{URL: fmt.Sprintf("%v/%v", servicePath, name)}
}

func (l *LibsecurityRestful) setError(response *restful.Response, httpStatusCode int, err error) {
	data, _ := json.Marshal(cr.Error{Code: httpStatusCode, Message: fmt.Sprintf("%v", err)})
	response.WriteErrorString(httpStatusCode, string(data))
}

func (l LibsecurityRestful) restGetVersion(request *restful.Request, response *restful.Response) {
	response.WriteHeaderAndEntity(http.StatusOK, cr.StringMessage{Str: GetVersion()})
}

func (l LibsecurityRestful) restStoreData(request *restful.Request, response *restful.Response) {
	// old use var filePath cr.StringMessage
	var fileData cr.SecureFile

	err := request.ReadEntity(&fileData)
	if err != nil {
		l.setError(response, http.StatusNotFound, err)
		return
	}
	err = l.UsersList.StoreInfo(fileData.FilePath, []byte(fileData.Secret), checkSecretStrength)
	if err != nil {
		l.setError(response, http.StatusInternalServerError, err)
		return
	}
	response.WriteHeaderAndEntity(http.StatusOK, fileData.FilePath)
}

func (l LibsecurityRestful) restLoadData(request *restful.Request, response *restful.Response) {
	// old use var fileData cr.StringMessage
	var fileData cr.SecureFile

	err := request.ReadEntity(&fileData)
	if err != nil {
		l.setError(response, http.StatusNotFound, err)
		return
	}
	err = en.LoadInfo(fileData.FilePath, []byte(fileData.Secret), l.UsersList)
	if err != nil {
		l.setError(response, http.StatusInternalServerError, err)
		return
	}
	response.WriteHeaderAndEntity(http.StatusCreated, fileData.FilePath)
}

func getIPAddress(request *restful.Request) string {
	return strings.Split(request.Request.RemoteAddr, ":")[0]
}


text:
#ifndef TENSORFLOW_LITE_EXPERIMENTAL_DELEGATES_COREML_BUILDERS_SOFTMAX_OP_BUILDER_H_
#define TENSORFLOW_LITE_EXPERIMENTAL_DELEGATES_COREML_BUILDERS_SOFTMAX_OP_BUILDER_H_

#include "tensorflow/lite/delegates/coreml/builders/op_builder.h"

namespace tflite {
namespace delegates {
namespace coreml {
// Builder for Softmax op in CoreML.
class SoftmaxOpBuilder : public OpBuilder {
 public:
  explicit SoftmaxOpBuilder(GraphBuilder* graph_builder)
      : OpBuilder(graph_builder) {}
  const std::string& DebugName() override;

  CoreML::Specification::NeuralNetworkLayer* Build() override;

  TfLiteStatus RegisterInputs(const TfLiteIntArray* inputs,
                              TfLiteContext* context) override;

  TfLiteStatus RegisterOutputs(const TfLiteIntArray* outputs,
                               TfLiteContext* context) override;
};

}  // namespace coreml
}  // namespace delegates
}  // namespace tflite

#endif  // TENSORFLOW_LITE_EXPERIMENTAL_DELEGATES_COREML_BUILDERS_SOFTMAX_OP_BUILDER_H_

redpajama_set_name: RedPajamaGithub


text:
package org.jbpm.services.ejb.api;

import javax.ejb.Remote;

import org.jbpm.services.api.DeploymentEventListener;
import org.jbpm.services.api.RuntimeDataService;
import org.kie.internal.task.query.TaskSummaryQueryBuilder;

@Remote
public interface RuntimeDataServiceEJBRemote extends RuntimeDataService, DeploymentEventListener {

    /**
     * This method is not supported in EJB remote api as <code>TaskSummaryQueryBuilder<code> is not remote capable object
     */
    @Override
    TaskSummaryQueryBuilder taskSummaryQuery(String userId);
}


text:
<?php

namespace Aequasi\Environment\Test;

use Aequasi\Environment\Environment;
use Aequasi\Environment\SymfonyEnvironment;
use Symfony\Component\Console\Input\ArgvInput;

/**
 * @author Luis Cordova <cordoval@gmail.com>
 */
class SymfonyEnvironmentTest extends \PHPUnit_Framework_TestCase
{
    /** @var \Aequasi\Environment\Environment */
    protected $environment;

    /**
     * @test
     */
    public function it_falls_back_when_no_custom_input_passed()
    {
        $this->environment = new SymfonyEnvironment();

        $this->assertEquals(
            Environment::$DEFAULT_TYPE,
            $this->environment->getType()
        );
        $this->assertTrue($this->environment->isDebug());
    }

    /**
     * @test
     */
    public function it_gets_type_from_input_args()
    {
        $input = new ArgvInput(['command:name', '--env=test']);
        $this->environment = new SymfonyEnvironment($input);

        $this->assertEquals(
            'test',
            $this->environment->getType()
        );
        $this->assertTrue($this->environment->isDebug());
    }

    /**
     * @test
     */
    public function it_detects_is_debug_from_input_args()
    {
        $input = new ArgvInput(['command:name', '--no-debug']);
        $this->environment = new SymfonyEnvironment($input);

        $this->assertFalse($this->environment->isDebug());
    }
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>PlaceIt</title>
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css">
    <link href='http://fonts.googleapis.com/css?family=Roboto:400,100,300,700' rel='stylesheet' type='text/css'>

{{ config.app_name }} {{ config.app_slogan }}


text:
package org.apache.calcite.sql.test;

import org.apache.calcite.avatica.util.Casing;
import org.apache.calcite.avatica.util.Quoting;
import org.apache.calcite.jdbc.JavaTypeFactoryImpl;
import org.apache.calcite.rel.type.DelegatingTypeSystem;
import org.apache.calcite.rel.type.RelDataTypeFactory;
import org.apache.calcite.rel.type.RelDataTypeSystem;
import org.apache.calcite.sql.SqlOperatorTable;
import org.apache.calcite.sql.advise.SqlAdvisor;
import org.apache.calcite.sql.fun.SqlStdOperatorTable;
import org.apache.calcite.sql.parser.SqlParser;
import org.apache.calcite.sql.parser.SqlParserImplFactory;
import org.apache.calcite.sql.parser.impl.SqlParserImpl;
import org.apache.calcite.sql.validate.SqlConformance;
import org.apache.calcite.sql.validate.SqlConformanceEnum;
import org.apache.calcite.sql.validate.SqlValidator;
import org.apache.calcite.sql.validate.SqlValidatorCatalogReader;
import org.apache.calcite.sql.validate.SqlValidatorUtil;
import org.apache.calcite.sql.validate.SqlValidatorWithHints;
import org.apache.calcite.test.CalciteAssert;
import org.apache.calcite.test.MockSqlOperatorTable;
import org.apache.calcite.test.catalog.MockCatalogReader;
import org.apache.calcite.test.catalog.MockCatalogReaderSimple;
import org.apache.calcite.util.SourceStringReader;

import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSortedMap;

import java.util.Map;
import java.util.Objects;

/**
 * Default implementation of {@link SqlTestFactory}.
 *
 *
Suitable for most tests. If you want different behavior, you can extend;
 * if you want a factory with different properties (e.g. SQL conformance level
 * or identifier quoting), use {@link #with(String, Object)} to create a new factory.

*/
public class SqlTestFactory {
  public static final ImmutableMap<String, Object> DEFAULT_OPTIONS =
      ImmutableSortedMap.<String, Object>naturalOrder()
          .put("parserFactory", SqlParserImpl.FACTORY)
          .put("quoting", Quoting.DOUBLE_QUOTE)
          .put("quotedCasing", Casing.UNCHANGED)
          .put("unquotedCasing", Casing.TO_UPPER)
          .put("caseSensitive", true)
          .put("lenientOperatorLookup", false)
          .put("enableTypeCoercion", true)
          .put("conformance", SqlConformanceEnum.DEFAULT)
          .put("identifierExpansion", false)
          .put("allowUnknownTables", false)
          .put("operatorTable", SqlStdOperatorTable.instance())
          .put("connectionFactory",
              CalciteAssert.EMPTY_CONNECTION_FACTORY
                  .with(
                      new CalciteAssert.AddSchemaSpecPostProcessor(
                          CalciteAssert.SchemaSpec.HR)))
          .build();

  public static final SqlTestFactory INSTANCE =
      new SqlTestFactory();

  private final ImmutableMap<String, Object> options;
  private final MockCatalogReaderFactory catalogReaderFactory;
  private final ValidatorFactory validatorFactory;

  private final Supplier<RelDataTypeFactory> typeFactory;
  private final Supplier<SqlOperatorTable> operatorTable;
  private final Supplier<SqlValidatorCatalogReader> catalogReader;
  private final Supplier<SqlParser.Config> parserConfig;

  protected SqlTestFactory() {
    this(DEFAULT_OPTIONS, MockCatalogReaderSimple::new, SqlValidatorUtil::newValidator);
  }

  protected SqlTestFactory(ImmutableMap<String, Object> options,
      MockCatalogReaderFactory catalogReaderFactory,
      ValidatorFactory validatorFactory) {
    this.options = options;
    this.catalogReaderFactory = catalogReaderFactory;
    this.validatorFactory = validatorFactory;
    this.operatorTable = Suppliers.memoize(
        () -> createOperatorTable((SqlOperatorTable) options.get("operatorTable")));
    this.typeFactory = Suppliers.memoize(
        () -> createTypeFactory((SqlConformance) options.get("conformance")));
    Boolean caseSensitive = (Boolean) options.get("caseSensitive");
    this.catalogReader = Suppliers.memoize(
        () -> catalogReaderFactory.create(typeFactory.get(), caseSensitive).init());
    this.parserConfig = Suppliers.memoize(
        () -> createParserConfig(options));
  }

  private static SqlOperatorTable createOperatorTable(SqlOperatorTable opTab0) {
    MockSqlOperatorTable opTab = new MockSqlOperatorTable(opTab0);
    MockSqlOperatorTable.addRamp(opTab);
    return opTab;
  }

  public SqlParser.Config getParserConfig() {
    return parserConfig.get();
  }

  public SqlParser createParser(String sql) {
    return SqlParser.create(new SourceStringReader(sql), parserConfig.get());
  }

  public static SqlParser.Config createParserConfig(ImmutableMap<String, Object> options) {
    return SqlParser.configBuilder()
        .setParserFactory((SqlParserImplFactory) options.get("parserFactory"))
        .setQuoting((Quoting) options.get("quoting"))
        .setUnquotedCasing((Casing) options.get("unquotedCasing"))
        .setQuotedCasing((Casing) options.get("quotedCasing"))
        .setConformance((SqlConformance) options.get("conformance"))
        .setCaseSensitive((boolean) options.get("caseSensitive"))
        .build();
  }

  public SqlValidator getValidator() {
    final SqlConformance conformance =
        (SqlConformance) options.get("conformance");
    final boolean lenientOperatorLookup =
        (boolean) options.get("lenientOperatorLookup");
    final boolean enableTypeCoercion =
        (boolean) options.get("enableTypeCoercion");
    final boolean identifierExpansion =
        (boolean) options.get("identifierExpansion");
    final boolean allowUnknownTables =
        (boolean) options.get("allowUnknownTables");
    final SqlValidator.Config config = SqlValidator.Config.DEFAULT
        .withSqlConformance(conformance)
        .withTypeCoercionEnabled(enableTypeCoercion)
        .withLenientOperatorLookup(lenientOperatorLookup)
        .withIdentifierExpansion(identifierExpansion)
        .withAllowUnknownTables(allowUnknownTables);
    return validatorFactory.create(operatorTable.get(),
        catalogReader.get(),
        typeFactory.get(),
        config);
  }

  public SqlAdvisor createAdvisor() {
    SqlValidator validator = getValidator();
    if (validator instanceof SqlValidatorWithHints) {
      return new SqlAdvisor((SqlValidatorWithHints) validator, parserConfig.get());
    }
    throw new UnsupportedOperationException(
        "Validator should implement SqlValidatorWithHints, actual validator is " + validator);
  }

  public SqlTestFactory with(String name, Object value) {
    if (Objects.equals(value, options.get(name))) {
      return this;
    }
    ImmutableMap.Builder<String, Object> builder = ImmutableSortedMap.naturalOrder();
    // Protect from IllegalArgumentException: Multiple entries with same key
    for (Map.Entry<String, Object> entry : options.entrySet()) {
      if (name.equals(entry.getKey())) {
        continue;
      }
      builder.put(entry);
    }
    builder.put(name, value);
    return new SqlTestFactory(builder.build(), catalogReaderFactory, validatorFactory);
  }

  public SqlTestFactory withCatalogReader(MockCatalogReaderFactory newCatalogReaderFactory) {
    return new SqlTestFactory(options, newCatalogReaderFactory, validatorFactory);
  }

  public SqlTestFactory withValidator(ValidatorFactory newValidatorFactory) {
    return new SqlTestFactory(options, catalogReaderFactory, newValidatorFactory);
  }

  public final Object get(String name) {
    return options.get(name);
  }

  private static RelDataTypeFactory createTypeFactory(SqlConformance conformance) {
    RelDataTypeSystem typeSystem = RelDataTypeSystem.DEFAULT;
    if (conformance.shouldConvertRaggedUnionTypesToVarying()) {
      typeSystem = new DelegatingTypeSystem(typeSystem) {
        public boolean shouldConvertRaggedUnionTypesToVarying() {
          return true;
        }
      };
    }
    if (conformance.allowExtendedTrim()) {
      typeSystem = new DelegatingTypeSystem(typeSystem) {
        public boolean allowExtendedTrim() {
          return true;
        }
      };
    }
    return new JavaTypeFactoryImpl(typeSystem);
  }

  /**
   * Creates {@link SqlValidator} for tests.
   */
  public interface ValidatorFactory {
    SqlValidator create(
        SqlOperatorTable opTab,
        SqlValidatorCatalogReader catalogReader,
        RelDataTypeFactory typeFactory,
        SqlValidator.Config config);
  }

  /**
   * Creates {@link MockCatalogReader} for tests.
   * Note: {@link MockCatalogReader#init()} is to be invoked later, so a typical implementation
   * should be via constructor reference like {@code MockCatalogReaderSimple::new}.
   */
  public interface MockCatalogReaderFactory {
    MockCatalogReader create(RelDataTypeFactory typeFactory, boolean caseSensitive);
  }
}


text:
<?php

declare(strict_types=1);

namespace Tests\Carbon;

use Carbon\Carbon;
use Carbon\CarbonImmutable;
use Carbon\CarbonInterface;
use DateTime;
use DateTimeZone;
use InvalidArgumentException;
use Tests\AbstractTestCase;

class InstanceTest extends AbstractTestCase
{
    public function testInstanceFromDateTime()
    {
        $dating = Carbon::instance(DateTime::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11'));
        $this->assertCarbon($dating, 1975, 5, 21, 22, 32, 11);
        $dating = Carbon::parse(DateTime::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11'));
        $this->assertCarbon($dating, 1975, 5, 21, 22, 32, 11);
    }

    public function testInstanceFromCarbon()
    {
        $dating = Carbon::instance(Carbon::create(1975, 5, 21, 22, 32, 11));
        $this->assertCarbon($dating, 1975, 5, 21, 22, 32, 11);
    }

    public function testInstanceFromDateTimeKeepsTimezoneName()
    {
        $dating = Carbon::instance(DateTime::createFromFormat('Y-m-d H:i:s', '1975-05-21 22:32:11')->setTimezone(new DateTimeZone('America/Vancouver')));
        $this->assertSame('America/Vancouver', $dating->tzName);
    }

    public function testInstanceFromCarbonKeepsTimezoneName()
    {
        $dating = Carbon::instance(Carbon::create(1975, 5, 21, 22, 32, 11)->setTimezone(new DateTimeZone('America/Vancouver')));
        $this->assertSame('America/Vancouver', $dating->tzName);
    }

    public function testInstanceFromDateTimeKeepsMicros()
    {
        $micro = 254687;
        $datetime = DateTime::createFromFormat('Y-m-d H:i:s.u', '2014-02-01 03:45:27.'.$micro);
        $carbon = Carbon::instance($datetime);
        $this->assertSame($micro, $carbon->micro);
    }

    public function testInstanceFromCarbonKeepsMicros()
    {
        $micro = 254687;
        $carbon = Carbon::createFromFormat('Y-m-d H:i:s.u', '2014-02-01 03:45:27.'.$micro);
        $carbon = Carbon::instance($carbon);
        $this->assertSame($micro, $carbon->micro);
    }

    public function testTimezoneCopy()
    {
        $carbon = new Carbon('2017-06-27 13:14:15.123456', 'Europe/Paris');
        $carbon = CarbonImmutable::instance($carbon);
        $this->assertSame('2017-06-27 13:14:15.123456 Europe/Paris', $carbon->format('Y-m-d H:i:s.u e'));
    }

    public function testInstanceStateSetBySetStateMethod()
    {
        $carbon = Carbon::__set_state([
            'date' => '2017-05-18 13:02:15.273420',
            'timezone_type' => 3,
            'timezone' => 'UTC',
        ]);
        $this->assertInstanceOf(Carbon::class, $carbon);
        $this->assertSame('2017-05-18 13:02:15.273420', $carbon->format('Y-m-d H:i:s.u'));
    }

    public function testInstanceStateSetBySetStateString()
    {
        $carbon = Carbon::__set_state('2017-05-18 13:02:15.273420');
        $this->assertInstanceOf(Carbon::class, $carbon);
        $this->assertSame('2017-05-18 13:02:15.273420', $carbon->format('Y-m-d H:i:s.u'));
    }

    public function testDeserializationOccursCorrectly()
    {
        $carbon = new Carbon('2017-06-27 13:14:15.000000');
        $serialized = 'return '.var_export($carbon, true).';';
        $deserialized = eval($serialized);

        $this->assertInstanceOf(Carbon::class, $deserialized);
    }

    public function testMutableConversions()
    {
        $carbon = new Carbon('2017-06-27 13:14:15.123456', 'Europe/Paris');
        $carbon = $carbon->locale('en_CA');
        $copy = $carbon->toImmutable();

        $this->assertEquals($copy, $carbon);
        $this->assertNotSame($copy, $carbon);
        $this->assertSame('en_CA', $copy->locale());
        $this->assertInstanceOf(CarbonImmutable::class, $copy);
        $this->assertTrue($copy->isImmutable());
        $this->assertFalse($copy->isMutable());
        $this->assertSame('2017-06-27 13:14:15.123456', $copy->format(CarbonInterface::MOCK_DATETIME_FORMAT));
        $this->assertSame('Europe/Paris', $copy->tzName);
        $this->assertNotSame($copy, $copy->modify('+1 day'));

        $copy = $carbon->toMutable();

        $this->assertEquals($copy, $carbon);
        $this->assertNotSame($copy, $carbon);
        $this->assertSame('en_CA', $copy->locale());
        $this->assertInstanceOf(Carbon::class, $copy);
        $this->assertFalse($copy->isImmutable());
        $this->assertTrue($copy->isMutable());
        $this->assertSame('2017-06-27 13:14:15.123456', $copy->format(CarbonInterface::MOCK_DATETIME_FORMAT));
        $this->assertSame('Europe/Paris', $copy->tzName);
        $this->assertSame($copy, $copy->modify('+1 day'));
    }

    public function testInvalidCast()
    {
        $this->expectExceptionObject(new InvalidArgumentException(
            'DateTimeZone has not the instance() method needed to cast the date.'
        ));

        $carbon = new Carbon('2017-06-27 13:14:15.123456', 'Europe/Paris');
        $carbon->cast(DateTimeZone::class);
    }

    public function testChildCast()
    {
        $class = \get_class(new class() extends Carbon {
            public function foo()
            {
                return 42;
            }
        });
        $carbon = new Carbon('2017-06-27 13:14:15.123456', 'Europe/Paris');
        /** @var object $casted */
        $casted = $carbon->cast($class);

        $this->assertInstanceOf($class, $casted);
        $this->assertInstanceOf(Carbon::class, $casted);
        $this->assertSame(42, $casted->foo());
        $this->assertSame('2017-06-27', $casted->format('Y-m-d'));
    }

    public function testSiblingCast()
    {
        $class = \get_class(new class() extends DateTime {
            public function foo()
            {
                return 42;
            }
        });
        $carbon = new Carbon('2017-06-27 13:14:15.123456', 'Europe/Paris');
        /** @var object $casted */
        $casted = $carbon->cast($class);

        $this->assertInstanceOf($class, $casted);
        $this->assertInstanceOf(DateTime::class, $casted);
        $this->assertSame(42, $casted->foo());
        $this->assertSame('2017-06-27', $casted->format('Y-m-d'));
    }
}


text:
.class public interface abstract Ljava/security/spec/KeySpec;
.super Ljava/lang/Object;
.source "KeySpec.java"


text:
30.times{User.create!(email:Faker::Internet.email,password:"password")}
u = User.all
100.times{Feedback.create!(user_id:u.sample.id)}
f = Feedback.all
choice = ["never","always","sometimes","Rarely","Mostly","N/A"]
100.times{FeedbackDetail.create!(employee_id: u.sample.id, feedback_id:f.sample.id , feedback_content:Faker::Lorem.paragraph(15) , motivated: choice.sample, best: choice.sample, recommend: choice.sample, considered: choice.sample)}
100.times{Qaquestion.create!(title: Faker::Hacker.say_something_smart, content: Faker::Lorem.paragraph(3), user_id: u.sample.id)}
fd = FeedbackDetail.all
  100.times{Vote.create!(voter_id: u.sample.id, feedback_detail_id: fd.sample.id,actionable: (1..5).to_a.sample, specific: (1..5).to_a.sample, kind: (1..5).to_a.sample)}


text:
TEST_CASE_NAME(EntityTests) {
    ecs::World* world;

    SETUP {
        world = new ecs::World();
    };

    TEAR_DOWN {
        delete world;
    };

    TEST("Entity creation") {
        ASSERT_EQUAL(0, world->getEntityCount());

        ecs::Entity e1;
        ASSERT_FALSE(e1.isValid());

        ecs::Entity e2 = world->createEntity();
        ASSERT_TRUE(e2.isValid());
        ASSERT_EQUAL(1, world->getEntityCount());

        e1 = e2;
        ASSERT_TRUE(e1.isValid());
    }

    TEST("Entity reuse") {
        ASSERT_EQUAL(0, world->getEntityCount());

        ecs::Entity e1 = world->createEntity();
        ASSERT_TRUE(e1.isValid());

        ecs::Entity e2 = e1;
        ASSERT_TRUE(e2.isValid());

        auto e1Id = e1.getId();

        e1.kill();

        // make sure to refresh the world, so the entity is destroyed
        world->refresh();

        ASSERT_FALSE(e1.isValid());
        ASSERT_FALSE(e2.isValid());

        ecs::Entity e3 = world->createEntity();

        auto e3Id = e3.getId();

        // the two ids should be different
        ASSERT_NOT_EQUAL(e1Id.value(), e3Id.value());

        // the index part should be the same
        ASSERT_EQUAL(e1Id.index, e3Id.index);

        // the version should be different
        ASSERT_NOT_EQUAL(e1Id.version, e3Id.version);
    }

    TEST("Entities are destroyed when World cleared") {
        ecs::Entity e1 = world->createEntity();
        ecs::Entity e2 = world->createEntity();

        world->clear();
        world->refresh();

        ASSERT_FALSE(e1.isValid());
        ASSERT_FALSE(e2.isValid());
    }
}


text:
namespace Merchello.Core
{
    using System;

    /// <summary>
    /// Merchello constant Guids (keys)
    /// </summary>
    public static partial class Constants
    {
        /// <summary>
        /// Default GUID keys for warehouse, invoice and order types
        /// </summary>
        public static class DefaultKeys
        {
            /// <summary>
            /// The default warehouse keys
            /// </summary>
            public static class Warehouse
            {
                /// <summary>
                /// Gets the default warehouse key.
                /// </summary>
                public static Guid DefaultWarehouseKey
                {
                    get { return new Guid("268D4007-8853-455A-89F7-A28398843E5F"); }
                }

                /// <summary>
                /// Gets the default warehouse catalog key.
                /// </summary>
                public static Guid DefaultWarehouseCatalogKey
                {
                    get { return new Guid("B25C2B00-578E-49B9-BEA2-BF3712053C63"); }
                }
            }

            /// <summary>
            /// The default invoice status keys.
            /// </summary>
            public static class InvoiceStatus
            {
                /// <summary>
                /// Gets the unpaid invoice status key.
                /// </summary>
                public static Guid Unpaid
                {
                    get { return new Guid("17ADA9AC-C893-4C26-AA26-234ECEB2FA75"); }
                }

                /// <summary>
                /// Gets the paid invoice status key.
                /// </summary>
                public static Guid Paid
                {
                    get { return new Guid("1F872A1A-F0DD-4C3E-80AB-99799A28606E"); }
                }

                /// <summary>
                /// Gets the partially paid invoice status key.
                /// </summary>
                public static Guid Partial
                {
                    get { return new Guid("6606B0EA-15B6-44AA-8557-B2D9D049645C"); }
                }

                /// <summary>
                /// Gets the cancelled invoice status key.
                /// </summary>
                public static Guid Cancelled
                {
                    get { return new Guid("53077EFD-6BF0-460D-9565-0E00567B5176"); }
                }

                /// <summary>
                /// Gets the fraud invoice status key
                /// </summary>
                public static Guid Fraud
                {
                    get { return new Guid("75E1E5EB-33E8-4904-A8E5-4B64A37D6087"); }
                }
            }

            /// <summary>
            /// The order status keys
            /// </summary>
            public static class OrderStatus
            {
                /// <summary>
                /// Gets the not fulfilled (or not shipped) order status key
                /// </summary>
                public static Guid NotFulfilled
                {
                    get { return new Guid("C54D47E6-D1C9-40D5-9BAF-18C6ADFFE9D0"); }
                }

                /// <summary>
                /// Gets the order status open key.
                /// </summary>
                public static Guid Open
                {
                    get { return new Guid("E67B414E-0E55-480D-9429-1204AD46ECDA"); }
                }

                /// <summary>
                /// Gets the back order "back ordered" order status key
                /// </summary>
                public static Guid BackOrder
                {
                    get { return new Guid("C47D475F-A075-4635-BBB9-4B9C49AA8EBE"); }
                }

                /// <summary>
                /// Gets the fulfilled (or completed) order status key.
                /// </summary>
                public static Guid Fulfilled
                {
                    get { return new Guid("D5369B84-8CCA-4586-8FBA-F3020F5E06EC"); }
                }

                /// <summary>
                /// Gets the cancelled order status key.
                /// </summary>
                public static Guid Cancelled
                {
                    get { return new Guid("77DAF52E-C79C-4E1B-898C-5E977A9A6027"); }
                }
            }

            /// <summary>
            /// The shipment status.
            /// </summary>
            public static class ShipmentStatus
            {
                /// <summary>
                /// Gets the quoted shipment status key
                /// </summary>
                public static Guid Quoted
                {
                    get { return new Guid("6FA425A9-7802-4DA0-BD33-083C100E30F3"); }
                }

                /// <summary>
                /// Gets the packaging status key.
                /// </summary>
                public static Guid Packaging
                {
                    get { return new Guid("7342DCD6-8113-44B6-BFD0-4555B82F9503"); }
                }

                /// <summary>
                /// Gets the shipment ready status key.
                /// </summary>
                public static Guid Ready
                {
                    get { return new Guid("CB24D43F-2774-4E56-85D8-653E49E3F542"); }
                }

                /// <summary>
                /// Gets the shipment shipped status key.
                /// </summary>
                public static Guid Shipped
                {
                    get { return new Guid("B37BE101-CEC9-4608-9330-54E56FA0537A"); }
                }

                /// <summary>
                /// Gets the delivered shipment status key.
                /// </summary>
                public static Guid Delivered
                {
                    get { return new Guid("3A279633-4919-485D-8C3B-479848A053D9"); }
                }
            }
        }

        /// <summary>
        /// Default gateway provider keys
        /// </summary>
        public static class ProviderKeys
        {
            /// <summary>
            /// The shipping gateway providers keys.
            /// </summary>
            public static class Shipping
            {
                /// <summary>
                /// Gets the fixed rate shipping provider key.
                /// </summary>
                public static Guid FixedRateShippingProviderKey
                {
                    get { return new Guid("AEC7A923-9F64-41D0-B17B-0EF64725F576"); }
                }
            }

            /// <summary>
            /// The taxation gateway provider keys.
            /// </summary>
            public static class Taxation
            {
                /// <summary>
                /// Gets the fixed rate taxation provider key.
                /// </summary>
                public static Guid FixedRateTaxationProviderKey
                {
                    get { return new Guid("A4AD4331-C278-4231-8607-925E0839A6CD"); }
                }
            }

            /// <summary>
            /// The payment gateway provider keys.
            /// </summary>
            public static class Payment
            {
                /// <summary>
                /// Gets the cash payment provider key.
                /// </summary>
                public static Guid CashPaymentProviderKey
                {
                    get { return new Guid("B2612C3D-8BF0-411C-8C56-32E7495AE79C"); }
                }
            }

            /// <summary>
            /// The notification.
            /// </summary>
            public static class Notification
            {
                /// <summary>
                /// Gets the smtp notification provider key.
                /// </summary>
                public static Guid SmtpNotificationProviderKey
                {
                    get { return new Guid("5F2E88D1-6D07-4809-B9AB-D4D6036473E9");}
                }
            }
        }

        /// <summary>
        /// Store Settings
        /// </summary>
        public static class StoreSettingKeys
        {
            /// <summary>
            /// Gets the currency code settings key.
            /// </summary>
            public static Guid CurrencyCodeKey
            {
                get { return new Guid("7E62B7AB-E633-4CC1-9C3B-C3C54BF10BF6"); }
            }

            /// <summary>
            /// Gets the next order number settings key.
            /// </summary>
            public static Guid NextOrderNumberKey
            {
                get { return new Guid("FFC51FA0-2AFF-4707-876D-79E6FD726022"); }
            }

            /// <summary>
            /// Gets the next invoice number settings key.
            /// </summary>
            public static Guid NextInvoiceNumberKey
            {
                get { return new Guid("10BF357E-2E91-4888-9AE5-5B9D7E897052"); }
            }

            /// <summary>
            /// Gets the next shipment number key.
            /// </summary>
            public static Guid NextShipmentNumberKey
            {
                get { return new Guid("487F1C4E-DDBC-4DCD-9882-A9F7C78892B5"); }
            }

            /// <summary>
            /// Gets the date format settings key.
            /// </summary>
            public static Guid DateFormatKey
            {
                get { return new Guid("4693279F-85DC-4EEF-AADF-D47DB0CDE974"); }
            }

            /// <summary>
            /// Gets the time format settings key.
            /// </summary>
            public static Guid TimeFormatKey
            {
                get { return new Guid("CBE0472F-3F72-439D-9C9D-FC8F840C1A9D"); }
            }

            /// <summary>
            /// Gets the Unit System settings key.
            /// </summary>
            public static Guid UnitSystemKey
            {
                get { return new Guid("03069B06-27CB-494B-B153-9C295AF2DE85"); }
            }

            /// <summary>
            /// Gets the global taxable settings key.
            /// </summary>
            public static Guid GlobalTaxableKey
            {
                get { return new Guid("02F008D4-6003-4E4A-9F82-B0027D6A6208"); }
            }

            /// <summary>
            /// Gets the global track inventory settings key.
            /// </summary>
            public static Guid GlobalTrackInventoryKey
            {
                get { return new Guid("11D2CBE6-1057-423B-A7C4-B0EF6D07D9A0"); }
            }

            /// <summary>
            /// Gets the global shippable settings key.
            /// </summary>
            public static Guid GlobalShippableKey
            {
                get { return new Guid("43116355-FC53-497F-965B-6227B57A38E6"); }
            }

            /// <summary>
            /// Gets the global shipping is taxable key.
            /// </summary>
            public static Guid GlobalShippingIsTaxableKey
            {
                get { return new Guid("E322F6C7-9AD6-4338-ADAA-0C86353D8192"); }
            }

            /// <summary>
            /// Gets the migration key.
            /// </summary>
            public static Guid MigrationKey
            {
                get
                {
                    return new Guid("56044D81-5C1E-4073-A2CB-1BE3412E461B");
                }
            }

            /// <summary>
            /// Gets the global taxation application key.
            /// </summary>
            public static Guid GlobalTaxationApplicationKey
            {
                get { return new Guid("B9653D97-A87B-4F78-BE2D-395665FBE361"); }
            }
        }

        /// <summary>
        /// The default type field keys
        /// </summary>
        /// TODO these are incomplete
        public static class TypeFieldKeys
        {
            /// <summary>
            /// Address related keys
            /// </summary>
            public static class Address
            {
                /// <summary>
                /// Gets the shipping address key.
                /// </summary>
                public static Guid ShippingAddressKey
                {
                    get { return new Guid("D32D7B40-2FF2-453F-9AC5-51CF1A981E46"); }
                }

                /// <summary>
                /// Gets the billing address key.
                /// </summary>
                public static Guid BillingAddressKey
                {
                    get { return new Guid("5C2A8638-EA32-49AD-8167-EDDFB45A7360"); }
                }
            }

            /// <summary>
            /// The campaign offer key.
            /// </summary>
            public static class CampaignActivity
            {
                ///// <summary>
                ///// Gets the key representing a sale type.
                ///// </summary>
                //public static Guid SaleKey
                //{
                //    get { return new Guid("2E8804AF-9852-4216-A3FB-A87D60C2EAF4"); }
                //}

                /// <summary>
                /// Gets the key representing a discount type.
                /// </summary>
                public static Guid DiscountKey
                {
                    get { return new Guid("05F735B6-C01E-4B61-863D-EFE7DF8136BF"); }
                }
            }

            /// <summary>
            /// Entity related keys
            /// </summary>
            public static class Entity
            {
                /// <summary>
                /// Gets the campaign offer key.
                /// </summary>
                public static Guid CampaignOfferKey
                {
                    get { return new Guid("0B73E574-4050-47A0-B5A0-7F32B73EF56F"); }
                }

                /// <summary>
                /// Gets the customer type field key that represents the entity
                /// </summary>
                public static Guid CustomerKey
                {
                    get { return new Guid("1607D643-E5E8-4A93-9393-651F83B5F1A9"); }
                }

                /// <summary>
                /// Gets the gateway provider type field key that represents the entity
                /// </summary>
                public static Guid GatewayProviderKey
                {
                    get { return new Guid("05BD6E6E-37A0-4954-AA34-BB73678543B2"); }
                }

                /// <summary>
                /// Gets the invoice type field key that represents the entity
                /// </summary>
                public static Guid InvoiceKey
                {
                    get { return new Guid("454539B9-D753-4C16-8ED5-5EB659E56665"); }
                }

                /// <summary>
                /// Gets the item cache type field key that represents the entity
                /// </summary>
                public static Guid ItemCacheKey
                {
                    get { return new Guid("9FEFEEF2-7ECE-439C-90E2-02D2F95D9E37"); }
                }

                /// <summary>
                /// Gets the order type field key that represents the entity
                /// </summary>
                public static Guid OrderKey
                {
                    get { return new Guid("CC5B1372-2EFA-49D5-B9F7-6EACD1182C5B"); }
                }

                /// <summary>
                /// Gets the payment type field key that represents the entity
                /// </summary>
                public static Guid PaymentKey
                {
                    get { return new Guid("6263D568-DEE1-41BB-8100-2333ECB4CF08"); }
                }

                /// <summary>
                /// Gets the product type field key that represents the entity
                /// </summary>
                public static Guid ProductKey
                {
                    get { return new Guid("9F923716-A022-4089-A110-1E9B4E1F2AD1"); }
                }

                /// <summary>
                /// Gets the shipment type field key that represents the entity
                /// </summary>
                public static Guid ShipmentKey
                {
                    get { return new Guid("5F26DF00-BD45-4E83-8095-D17AD8D7D3CE"); }
                }

                /// <summary>
                /// Gets the warehouse type field key that represents the entity
                /// </summary>
                public static Guid WarehouseKey
                {
                    get { return new Guid("2367D705-4BEA-4B3E-8329-664823D28316"); }
                }

                /// <summary>
                /// Gets the warehouse catalog type field key that represents the entity
                /// </summary>
                public static Guid WarehouseCatalogKey
                {
                    get { return new Guid("ED7D69B2-7434-40F4-88A7-EDDA9FB50995"); }
                }
            }

            /// <summary>
            /// The item cache keys
            /// </summary>
            public static class ItemCache
            {
                /// <summary>
                /// Gets the basket key.
                /// </summary>
                public static Guid BasketKey
                {
                    get { return new Guid("C53E3100-2DFD-408A-872E-4380383FAD35"); }
                }

                /// <summary>
                /// Gets the backoffice key.
                /// </summary>
                public static Guid BackofficeKey
                {
                    get { return new Guid("E36930FE-6D6A-4EB3-AF95-712629913812"); }
                }

                /// <summary>
                /// Gets the wishlist key.
                /// </summary>
                public static Guid WishlistKey
                {
                    get { return new Guid("B3EBB9E0-C7CE-4BA6-B379-BEDA3465D6D5"); }
                }

                /// <summary>
                /// Gets the checkout key.
                /// </summary>
                public static Guid CheckoutKey
                {
                    get { return new Guid("25608A4E-F3DB-43DE-B137-A9E55B1412CE"); }
                }
            }

            /// <summary>
            /// The line item keys
            /// </summary>
            public static class LineItem
            {
                /// <summary>
                /// Gets the product line item type key.
                /// </summary>
                public static Guid ProductKey
                {
                    get { return new Guid("D462C051-07F4-45F5-AAD2-D5C844159F04"); }
                }

                /// <summary>
                /// Gets the shipping line item type key.
                /// </summary>
                public static Guid ShippingKey
                {
                    get { return new Guid("6F3119EA-53F8-41D0-9249-167B8D32AE81"); }
                }

                /// <summary>
                /// Gets the tax line item type key.
                /// </summary>
                public static Guid TaxKey
                {
                    get { return new Guid("B73C17BC-50D8-4B67-B343-9F0AF7A6E62E"); }
                }

                /// <summary>
                /// Gets the discount line item type key.
                /// </summary>
                public static Guid DiscountKey
                {
                    get { return new Guid("E7CC502D-DE7C-4C37-8A9C-837760533A76"); }
                }
            }

            /// <summary>
            /// The payment method type keys
            /// </summary>
            public static class PaymentMethod
            {
                /// <summary>
                /// Gets the cash type key.
                /// </summary>
                public static Guid CashKey
                {
                    get { return new Guid("9C9A7E61-D79C-4ECC-B0E0-B2A502F252C5"); }
                }

                /// <summary>
                /// Gets the credit card type key.
                /// </summary>
                public static Guid CreditCardKey
                {
                    get { return new Guid("CB1354FE-B30C-449E-BD5C-CD50BCBD804A"); }
                }

                /// <summary>
                /// Gets the purchase order type key.
                /// </summary>
                public static Guid PurchaseOrderKey
                {
                    get { return new Guid("2B588AE0-7B76-430F-9341-270A8C943E7E"); }
                }

                /// <summary>
                /// Gets the customer credit.
                /// </summary>
                public static Guid CustomerCreditKey
                {
                    get { return new Guid("CD0FB122-DE4E-4F1A-939F-EC5859777EAE"); }
                }
            }

            /// <summary>
            /// The applied payment type field keys
            /// </summary>
            public static class AppliedPayment
            {
                /// <summary>
                /// Gets the credit record type key.
                /// </summary>
                public static Guid CreditRecordKey
                {
                    get { return new Guid("020F6FF8-1F66-4D90-9FF4-C32A7A5AB32B"); }
                }

                /// <summary>
                /// Gets the debit record tyep key.
                /// </summary>
                public static Guid DebitRecordKey
                {
                    get { return new Guid("916929F0-96FB-430A-886D-F7A83E9A4B9A"); }
                }

                /// <summary>
                /// Gets the void record type key.
                /// </summary>
                public static Guid VoidRecordKey
                {
                    get { return new Guid("F59C7DA6-8252-4891-A5A2-7F6C38766649"); }
                }

                /// <summary>
                /// Gets the refund record type key.
                /// </summary>
                public static Guid RefundRecordKey
                {
                    get { return new Guid("4CFCEB9C-F6F4-4FDC-9C52-CDC285F1B90A"); }
                }

                /// <summary>
                /// Gets the denied record type key.
                /// </summary>
                public static Guid DeniedRecordKey
                {
                    get { return new Guid("2AE1F2E2-DF5F-4087-81C1-4E0EE809948F"); }
                }
            }

            /// <summary>
            /// Gateway provider type field keys
            /// </summary>
            public static class GatewayProvider
            {
                /// <summary>
                /// Gets the payment provider key.
                /// </summary>
                public static Guid PaymentProviderKey
                {
                    get { return new Guid("A0B4F835-D92E-4D17-8181-6C342C41606E");}
                }

                /// <summary>
                /// Gets the notification provider key.
                /// </summary>
                public static Guid NotificationProviderKey
                {
                    get { return new Guid("C5F53682-4C49-4538-87B3-035D30EE3347"); }
                }

                /// <summary>
                /// Gets the shipping provider key.
                /// </summary>
                public static Guid ShippingProviderKey
                {
                    get { return new Guid("646D3EA7-3B31-45C1-9488-7C0449A564A6"); }
                }

                /// <summary>
                /// Gets the taxation provider key.
                /// </summary>
                public static Guid TaxationProviderKey
                {
                    get { return new Guid("360B47F9-A4FB-4B96-81B4-A4A497D2B44A"); }
                }
            }
        }

        /// <summary>
        /// The default notification keys.
        /// </summary>
        internal static class NotificationKeys
        {
            /// <summary>
            /// The invoice notification trigger keys.
            /// </summary>
            internal static class InvoiceTriggers
            {
                /// <summary>
                /// The status changed trigger keys
                /// </summary>
                public static class StatusChanged
                {
                    /// <summary>
                    /// Gets the invoice status changed to paid.
                    /// </summary>
                    public static Guid ToPaid
                    {
                        get { return new Guid("645E7E24-3F97-467D-9923-0CC4DD96468C"); }
                    }

                    /// <summary>
                    /// Gets invoice status changed the to partial.
                    /// </summary>
                    public static Guid ToPartial
                    {
                        get { return new Guid("5AF5E106-697E-438E-B768-876666C4E333"); }
                    }

                    /// <summary>
                    /// Gets the to cancelled.
                    /// </summary>
                    public static Guid ToCancelled
                    {
                        get { return new Guid("BB2AC8F1-B813-41BE-BFEE-F5A95CBB541A"); }
                    }
                }
            }

            /// <summary>
            /// The order triggers.
            /// </summary>
            internal static class OrderTriggers
            {
                /// <summary>
                /// The status changed notification triggers
                /// </summary>
                public static class StatusChanged
                {
                    /// <summary>
                    /// Gets the to back order notification trigger key
                    /// </summary>
                    public static Guid ToBackOrder
                    {
                        get { return new Guid("7E2858CB-B41C-456F-9D25-EED36FCD4FBC"); }
                    }

                    /// <summary>
                    /// Gets the status changed to fulfilled notification trigger key
                    /// </summary>
                    public static Guid ToFulfilled
                    {
                        get { return new Guid("39D15CDF-32B6-41CC-95F0-483A676F90C0"); }
                    }

                    /// <summary>
                    /// Gets the to cancelled.
                    /// </summary>
                    public static Guid ToCancelled
                    {
                        get { return new Guid("6B495772-D1E2-4515-955C-1E65C86C23D4"); }
                    }
                }
            }
        }
    }
}


text:
  && !defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_ALL_STATIC_LINK)
# define BOOST_FILESYSTEM_STATIC_LINK
#endif

#if defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_FILESYSTEM_DYN_LINK)
# define BOOST_FILESYSTEM_DYN_LINK
#elif defined(BOOST_ALL_STATIC_LINK) && !defined(BOOST_FILESYSTEM_STATIC_LINK)
# define BOOST_FILESYSTEM_STATIC_LINK
#endif

#if defined(BOOST_FILESYSTEM_DYN_LINK) && defined(BOOST_FILESYSTEM_STATIC_LINK)
# error Must not define both BOOST_FILESYSTEM_DYN_LINK and BOOST_FILESYSTEM_STATIC_LINK
#endif

#if defined(BOOST_ALL_NO_LIB) && !defined(BOOST_FILESYSTEM_NO_LIB)
# define BOOST_FILESYSTEM_NO_LIB
#endif

//  enable dynamic linking  ------------------------------------------------------------//

#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
# if defined(BOOST_FILESYSTEM_SOURCE)
#   define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_EXPORT
# else
#   define BOOST_FILESYSTEM_DECL BOOST_SYMBOL_IMPORT
# endif
#else
# define BOOST_FILESYSTEM_DECL
#endif

//  enable automatic library variant selection  ----------------------------------------//

#if !defined(BOOST_FILESYSTEM_SOURCE) && !defined(BOOST_ALL_NO_LIB) \
  && !defined(BOOST_FILESYSTEM_NO_LIB)
//
// Set the name of our library, this will get undef'ed by auto_link.hpp
// once it's done with it:
//
#define BOOST_LIB_NAME lslboost_filesystem
//
// If we're importing code from a dll, then tell auto_link.hpp about it:
//
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FILESYSTEM_DYN_LINK)
#  define BOOST_DYN_LINK
#endif
//
// And include the header that does the work:
//
#include <lslboost/config/auto_link.hpp>
#endif  // auto-linking disabled

#endif // BOOST_FILESYSTEM3_CONFIG_HPP


text:
@if ($message = Session::get('success'))

	<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>

Success

    <?= e($message) ?>

@endif

@if ($message = Session::get('error'))

	<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>

Error

    <?= e($message) ?>

@endif

@if ($message = Session::get('warning'))

	<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>

Warning

    <?= e($message) ?>

@endif

@if ($message = Session::get('info'))

	<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>

Info

    <?= e($message) ?>

@endif


text:
package com.rayleigh.util.exception;

public class EntityException extends Exception {

	private static final long serialVersionUID = -1956216016026597508L;

	public EntityException() {
	}

	public EntityException(String message) {
		super(message);
	}

	public EntityException(Throwable cause) {
		super(cause);
	}

	public EntityException(String message, Throwable cause) {
		super(message, cause);
	}

}


text:
layout: segment
lesson: 3
segment: 1
---


text:
import Graph from './graph';

export default class Edge extends Graph {
}


text:
module Azure::KubernetesConfiguration::Mgmt::V2021_03_01
  module Models
    #
    # Supported operation of this resource provider.
    #
    class ResourceProviderOperation

      include MsRestAzure

      # @return [String] Operation name, in format of
      # {provider}/{resource}/{operation}
      attr_accessor :name

      # @return [ResourceProviderOperationDisplay] Display metadata associated
      # with the operation.
      attr_accessor :display

      # @return [Boolean] The flag that indicates whether the operation applies
      # to data plane.
      attr_accessor :is_data_action

      #
      # Mapper for ResourceProviderOperation class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'ResourceProviderOperation',
          type: {
            name: 'Composite',
            class_name: 'ResourceProviderOperation',
            model_properties: {
              name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'name',
                type: {
                  name: 'String'
                }
              },
              display: {
                client_side_validation: true,
                required: false,
                serialized_name: 'display',
                type: {
                  name: 'Composite',
                  class_name: 'ResourceProviderOperationDisplay'
                }
              },
              is_data_action: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'isDataAction',
                type: {
                  name: 'Boolean'
                }
              }
            }
          }
        }
      end
    end
  end
end


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Coleus coerulescens Gürke

### Remarks
null


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

  var app = window.app;
  app.factory('moduleConfigFactory', ['$http', function($http) {

    return {
      getJson: function(moduleConfig) {
        return $http.get('/api/v1/module-config/'+moduleConfig+'/');
      },
      postJson: function(moduleConfig, data) {
        return $http.post('/api/v1/module-config/'+moduleConfig+'/', data);
      }
    };
  }]);

})(window);


text:
package io.crate.planner.statement;

import org.elasticsearch.test.ESTestCase;
import org.junit.Test;

import static io.crate.planner.statement.SetSessionPlan.validateSetting;

public class SetSessionPlanTest extends ESTestCase {

    @Test
    public void testSetSessionInvalidSetting() throws Exception {
        expectedException.expect(IllegalArgumentException.class);
        expectedException.expectMessage(
            "GLOBAL Cluster setting 'stats.operations_log_size' cannot be used with SET SESSION / LOCAL");
        validateSetting("stats.operations_log_size");
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <!--条目-(中)右-中-按下状态-->
    <solid android:color="@color/jyz_main" />
    <stroke
        android:width="0.5dp"
        android:color="@android:color/transparent" />
</shape>


text:
/*
Template Name: Color Admin - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.3.7
Version: 2.1.0
Author: Sean Ngu
Website: http://www.seantheme.com/color-admin-v2.1/admin/html/
*/var handleCountdownTimer=function(){var e=new Date;e=new Date(e.getFullYear()+1,1-1,1);$("#timer").countdown({until:e})};var ComingSoon=function(){"use strict";return{init:function(){handleCountdownTimer()}}}()


text:
using System;
using System.Configuration;
using Akka.Actor;
using Akka.Configuration;
using Akka.Configuration.Hocon;
using Akka.Util.Internal;

namespace Samples.Cluster.Transformation
{
    class Program
    {
        private static Config _clusterConfig;

        static void Main(string[] args)
        {
            var section = (AkkaConfigurationSection)ConfigurationManager.GetSection("akka");
            _clusterConfig = section.AkkaConfig;
            LaunchBackend(new []{ "2551" });
            LaunchBackend(new[] { "2552" });
            LaunchBackend(new string[0]);
            LaunchFrontend(new string[0]);
            //starting 2 frontend nodes and 3 backend nodes
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }

        static void LaunchBackend(string[] args)
        {
            var port = args.Length > 0 ? args[0] : "0";
            var config =
                    ConfigurationFactory.ParseString("akka.remote.helios.tcp.port=" + port)
                    .WithFallback(ConfigurationFactory.ParseString("akka.cluster.roles = [backend]"))
                        .WithFallback(_clusterConfig);

            var system = ActorSystem.Create("ClusterSystem", config);
            system.ActorOf(Props.Create<TransformationBackend>(), "backend");
        }

        static void LaunchFrontend(string[] args)
        {
            var port = args.Length > 0 ? args[0] : "0";
            var config =
                    ConfigurationFactory.ParseString("akka.remote.helios.tcp.port=" + port)
                    .WithFallback(ConfigurationFactory.ParseString("akka.cluster.roles = [frontend]"))
                        .WithFallback(_clusterConfig);

            var system = ActorSystem.Create("ClusterSystem", config);

            var frontend = system.ActorOf(Props.Create<TransformationFrontend>(), "frontend");
            var interval = TimeSpan.FromSeconds(2);
            var timeout = TimeSpan.FromSeconds(5);
            var counter = new AtomicCounter();
            system.Scheduler.Schedule(interval, interval,
                () => frontend.Ask(new TransformationMessages.TransformationJob("hello-" + counter.GetAndIncrement()), timeout)
                .ContinueWith(
                    r => Console.WriteLine(r.Result)));
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:spring="http://www.springframework.org/schema/beans" xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
  xmlns:script="http://www.mulesoft.org/schema/mule/scripting"
  xmlns:test="http://www.mulesoft.org/schema/mule/test"
  xsi:schemaLocation="
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
          http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.3/mule.xsd
          http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/3.3/mule-scripting.xsd
          http://www.mulesoft.org/schema/mule/test http://www.mulesoft.org/schema/mule/test/3.3/mule-test.xsd
          http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.3/mule-vm.xsd">

  <spring:bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
      <spring:property name="driverClass" value="org.h2.Driver"/>
      <spring:property name="url" value="jdbc:h2:mem:activiti;DB_CLOSE_DELAY=1000"/>
      <spring:property name="username" value="sa"/>
      <spring:property name="password" value=""/>
  </spring:bean>

  <spring:bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
      <spring:property name="dataSource" ref="dataSource"/>
  </spring:bean>

  <spring:bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
    <spring:property name="dataSource" ref="dataSource"/>
    <spring:property name="transactionManager" ref="transactionManager"/>
    <spring:property name="databaseSchemaUpdate" value="true" />
    <spring:property name="activiti5CompatibilityEnabled" value="true" />
    <spring:property name="activiti5CompatibilityHandlerFactory" ref="activiti5CompabilityFactory" />
    <spring:property name="jobExecutorActivate" value="false" />
    <spring:property name="beans">
      <spring:map>
        <spring:entry key="muleContext" value-ref="_muleContext" />
      </spring:map>
    </spring:property>
  </spring:bean>

  <spring:bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
    <spring:property name="processEngineConfiguration" ref="processEngineConfiguration" />
  </spring:bean>

  <spring:bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
  <spring:bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
  <spring:bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
  <spring:bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />

  <spring:bean id="activiti5CompabilityFactory" class="org.activiti.compatibility.spring.SpringActiviti5CompatibilityHandlerFactory" />

  <flow name="test">
    <vm:inbound-endpoint path="in" exchange-pattern="request-response" />
    <script:transformer>
      <script:script engine="groovy">return 30</script:script>
    </script:transformer>
  </flow>
</mule>


text:
#if !defined(__CUDA_RUNTIME_API_DYNLINK_H__)
#define __CUDA_RUNTIME_API_DYNLINK_H__

/*******************************************************************************
*                                                                              *
* CUDA runtime API version number 2.1                                          *
*                                                                              *
*******************************************************************************/

#define CUDART_VERSION \
        2010

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

#include "host_defines.h"
#include "builtin_types.h"

#if !defined(__dv)

#if defined(__cplusplus)

#define __dv(v) \
        = v

#else /* __cplusplus */

#define __dv(v)

#endif /* __cplusplus */

#endif /* !__dv */

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

#ifdef _WIN32
#define CUDARTAPI __stdcall
#else
#define CUDARTAPI
#endif

#if defined(__cplusplus)

//namespace dyn
//{

extern "C" {
#endif /* __cplusplus */

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

typedef __host__ cudaError_t CUDARTAPI tcudaMalloc3D(struct cudaPitchedPtr* pitchDevPtr, struct cudaExtent extent);
typedef __host__ cudaError_t CUDARTAPI tcudaMalloc3DArray(struct cudaArray** arrayPtr, const struct cudaChannelFormatDesc* desc, struct cudaExtent extent);
typedef __host__ cudaError_t CUDARTAPI tcudaMemset3D(struct cudaPitchedPtr pitchDevPtr, int value, struct cudaExtent extent);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpy3D(const struct cudaMemcpy3DParms *p);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpy3DAsync(const struct cudaMemcpy3DParms *p, cudaStream_t stream);

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

typedef __host__ cudaError_t CUDARTAPI tcudaMalloc(void **devPtr, size_t size);
typedef __host__ cudaError_t CUDARTAPI tcudaMallocHost(void **ptr, size_t size);
typedef __host__ cudaError_t CUDARTAPI tcudaMallocPitch(void **devPtr, size_t *pitch, size_t width, size_t height);
typedef __host__ cudaError_t CUDARTAPI tcudaMallocArray(struct cudaArray **array, const struct cudaChannelFormatDesc *desc, size_t width, size_t height /*__dv(1)*/);
typedef __host__ cudaError_t CUDARTAPI tcudaFree(void *devPtr);
typedef __host__ cudaError_t CUDARTAPI tcudaFreeHost(void *ptr);
typedef __host__ cudaError_t CUDARTAPI tcudaFreeArray(struct cudaArray *array);

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

typedef __host__ cudaError_t CUDARTAPI tcudaMemcpy(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpyToArray(struct cudaArray *dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpyFromArray(void *dst, const struct cudaArray *src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpyArrayToArray(struct cudaArray *dst, size_t wOffsetDst, size_t hOffsetDst, const struct cudaArray *src, size_t wOffsetSrc, size_t hOffsetSrc, size_t count, enum cudaMemcpyKind /*kind __dv(cudaMemcpyDeviceToDevice)*/);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpy2D(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpy2DToArray(struct cudaArray *dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpy2DFromArray(void *dst, size_t dpitch, const struct cudaArray *src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpy2DArrayToArray(struct cudaArray *dst, size_t wOffsetDst, size_t hOffsetDst, const struct cudaArray *src, size_t wOffsetSrc, size_t hOffsetSrc, size_t width, size_t height, enum cudaMemcpyKind /*kind __dv(cudaMemcpyDeviceToDevice)*/);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpyToSymbol(const char *symbol, const void *src, size_t count, size_t offset /*__dv(0)*/, enum cudaMemcpyKind kind /*__dv(cudaMemcpyHostToDevice)*/);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpyFromSymbol(void *dst, const char *symbol, size_t count, size_t offset /*__dv(0)*/, enum cudaMemcpyKind kind /*__dv(cudaMemcpyDeviceToHost)*/);

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

typedef __host__ cudaError_t CUDARTAPI tcudaMemcpyAsync(void *dst, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpyToArrayAsync(struct cudaArray *dst, size_t wOffset, size_t hOffset, const void *src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpyFromArrayAsync(void *dst, const struct cudaArray *src, size_t wOffset, size_t hOffset, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpy2DAsync(void *dst, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpy2DToArrayAsync(struct cudaArray *dst, size_t wOffset, size_t hOffset, const void *src, size_t spitch, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpy2DFromArrayAsync(void *dst, size_t dpitch, const struct cudaArray *src, size_t wOffset, size_t hOffset, size_t width, size_t height, enum cudaMemcpyKind kind, cudaStream_t stream);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpyToSymbolAsync(const char *symbol, const void *src, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream);
typedef __host__ cudaError_t CUDARTAPI tcudaMemcpyFromSymbolAsync(void *dst, const char *symbol, size_t count, size_t offset, enum cudaMemcpyKind kind, cudaStream_t stream);

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

typedef __host__ cudaError_t CUDARTAPI tcudaMemset(void *mem, int c, size_t count);
typedef __host__ cudaError_t CUDARTAPI tcudaMemset2D(void *mem, size_t pitch, int c, size_t width, size_t height);

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

typedef __host__ cudaError_t CUDARTAPI tcudaGetSymbolAddress(void **devPtr, const char *symbol);
typedef __host__ cudaError_t CUDARTAPI tcudaGetSymbolSize(size_t *size, const char *symbol);

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

typedef __host__ cudaError_t CUDARTAPI tcudaGetDeviceCount(int *count);
typedef __host__ cudaError_t CUDARTAPI tcudaGetDeviceProperties(struct cudaDeviceProp *prop, int device);
typedef __host__ cudaError_t CUDARTAPI tcudaChooseDevice(int *device, const struct cudaDeviceProp *prop);
typedef __host__ cudaError_t CUDARTAPI tcudaSetDevice(int device);
typedef __host__ cudaError_t CUDARTAPI tcudaGetDevice(int *device);

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

typedef __host__ cudaError_t CUDARTAPI tcudaBindTexture(size_t *offset, const struct textureReference *texref, const void *devPtr, const struct cudaChannelFormatDesc *desc, size_t size /*__dv(UINT_MAX)*/);
typedef __host__ cudaError_t CUDARTAPI tcudaBindTextureToArray(const struct textureReference *texref, const struct cudaArray *array, const struct cudaChannelFormatDesc *desc);
typedef __host__ cudaError_t CUDARTAPI tcudaUnbindTexture(const struct textureReference *texref);
typedef __host__ cudaError_t CUDARTAPI tcudaGetTextureAlignmentOffset(size_t *offset, const struct textureReference *texref);
typedef __host__ cudaError_t CUDARTAPI tcudaGetTextureReference(const struct textureReference **texref, const char *symbol);

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

typedef __host__ cudaError_t CUDARTAPI tcudaGetChannelDesc(struct cudaChannelFormatDesc *desc, const struct cudaArray *array);
typedef __host__ struct cudaChannelFormatDesc CUDARTAPI tcudaCreateChannelDesc(int x, int y, int z, int w, enum cudaChannelFormatKind f);

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

typedef __host__ cudaError_t CUDARTAPI tcudaGetLastError(void);
typedef __host__ const char* CUDARTAPI tcudaGetErrorString(cudaError_t error);

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

typedef __host__ cudaError_t CUDARTAPI tcudaConfigureCall(dim3 gridDim, dim3 blockDim, size_t sharedMem /*__dv(0)*/, cudaStream_t stream /*__dv(0)*/);
typedef __host__ cudaError_t CUDARTAPI tcudaSetupArgument(const void *arg, size_t size, size_t offset);
typedef __host__ cudaError_t CUDARTAPI tcudaLaunch(const char *symbol);

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

typedef __host__ cudaError_t CUDARTAPI tcudaStreamCreate(cudaStream_t *stream);
typedef __host__ cudaError_t CUDARTAPI tcudaStreamDestroy(cudaStream_t stream);
typedef __host__ cudaError_t CUDARTAPI tcudaStreamSynchronize(cudaStream_t stream);
typedef __host__ cudaError_t CUDARTAPI tcudaStreamQuery(cudaStream_t stream);

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

typedef __host__ cudaError_t CUDARTAPI tcudaEventCreate(cudaEvent_t *event);
typedef __host__ cudaError_t CUDARTAPI tcudaEventRecord(cudaEvent_t event, cudaStream_t stream);
typedef __host__ cudaError_t CUDARTAPI tcudaEventQuery(cudaEvent_t event);
typedef __host__ cudaError_t CUDARTAPI tcudaEventSynchronize(cudaEvent_t event);
typedef __host__ cudaError_t CUDARTAPI tcudaEventDestroy(cudaEvent_t event);
typedef __host__ cudaError_t CUDARTAPI tcudaEventElapsedTime(float *ms, cudaEvent_t start, cudaEvent_t end);

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

typedef __host__ cudaError_t CUDARTAPI tcudaSetDoubleForDevice(double *d);
typedef __host__ cudaError_t CUDARTAPI tcudaSetDoubleForHost(double *d);

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

typedef __host__ cudaError_t CUDARTAPI tcudaThreadExit(void);
typedef __host__ cudaError_t CUDARTAPI tcudaThreadSynchronize(void);

/*******************************************************************************
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/

extern tcudaMalloc3D                   *cudaMalloc3D;
extern tcudaMalloc3DArray              *cudaMalloc3DArray;
extern tcudaMemset3D                   *cudaMemset3D;
extern tcudaMemcpy3D                   *cudaMemcpy3D;
extern tcudaMemcpy3DAsync              *cudaMemcpy3DAsync;
extern tcudaMalloc                     *cudaMalloc;
extern tcudaMallocHost                 *cudaMallocHost;
extern tcudaMallocPitch                *cudaMallocPitch;
extern tcudaMallocArray                *cudaMallocArray;
extern tcudaFree                       *cudaFree;
extern tcudaFreeHost                   *cudaFreeHost;
extern tcudaFreeArray                  *cudaFreeArray;
extern tcudaMemcpy                     *cudaMemcpy;
extern tcudaMemcpyToArray              *cudaMemcpyToArray;
extern tcudaMemcpyFromArray            *cudaMemcpyFromArray;
extern tcudaMemcpyArrayToArray         *cudaMemcpyArrayToArray;
extern tcudaMemcpy2D                   *cudaMemcpy2D;
extern tcudaMemcpy2DToArray            *cudaMemcpy2DToArray;
extern tcudaMemcpy2DFromArray          *cudaMemcpy2DFromArray;
extern tcudaMemcpy2DArrayToArray       *cudaMemcpy2DArrayToArray;
extern tcudaMemcpyToSymbol             *cudaMemcpyToSymbol;
extern tcudaMemcpyFromSymbol           *cudaMemcpyFromSymbol;
extern tcudaMemcpyAsync                *cudaMemcpyAsync;
extern tcudaMemcpyToArrayAsync         *cudaMemcpyToArrayAsync;
extern tcudaMemcpyFromArrayAsync       *cudaMemcpyFromArrayAsync;
extern tcudaMemcpy2DAsync              *cudaMemcpy2DAsync;
extern tcudaMemcpy2DToArrayAsync       *cudaMemcpy2DToArrayAsync;
extern tcudaMemcpy2DFromArrayAsync     *cudaMemcpy2DFromArrayAsync;
extern tcudaMemcpyToSymbolAsync        *cudaMemcpyToSymbolAsync;
extern tcudaMemcpyFromSymbolAsync      *cudaMemcpyFromSymbolAsync;
extern tcudaMemset                     *cudaMemset;
extern tcudaMemset2D                   *cudaMemset2D;
extern tcudaGetSymbolAddress           *cudaGetSymbolAddress;
extern tcudaGetSymbolSize              *cudaGetSymbolSize;
extern tcudaGetDeviceCount             *cudaGetDeviceCount;
extern tcudaGetDeviceProperties        *cudaGetDeviceProperties;
extern tcudaChooseDevice               *cudaChooseDevice;
extern tcudaSetDevice                  *cudaSetDevice;
extern tcudaGetDevice                  *cudaGetDevice;
extern tcudaBindTexture                *cudaBindTexture;
extern tcudaBindTextureToArray         *cudaBindTextureToArray;
extern tcudaUnbindTexture              *cudaUnbindTexture;
extern tcudaGetTextureAlignmentOffset  *cudaGetTextureAlignmentOffset;
extern tcudaGetTextureReference        *cudaGetTextureReference;
extern tcudaGetChannelDesc             *cudaGetChannelDesc;
extern tcudaCreateChannelDesc          *cudaCreateChannelDesc;
extern tcudaGetLastError               *cudaGetLastError;
extern tcudaGetErrorString             *cudaGetErrorString;
extern tcudaConfigureCall              *cudaConfigureCall;
extern tcudaSetupArgument              *cudaSetupArgument;
extern tcudaLaunch                     *cudaLaunch;
extern tcudaStreamCreate               *cudaStreamCreate;
extern tcudaStreamDestroy              *cudaStreamDestroy;
extern tcudaStreamSynchronize          *cudaStreamSynchronize;
extern tcudaStreamQuery                *cudaStreamQuery;
extern tcudaEventCreate                *cudaEventCreate;
extern tcudaEventRecord                *cudaEventRecord;
extern tcudaEventQuery                 *cudaEventQuery;
extern tcudaEventSynchronize           *cudaEventSynchronize;
extern tcudaEventDestroy               *cudaEventDestroy;
extern tcudaEventElapsedTime           *cudaEventElapsedTime;
extern tcudaSetDoubleForDevice         *cudaSetDoubleForDevice;
extern tcudaSetDoubleForHost           *cudaSetDoubleForHost;
extern tcudaThreadExit                 *cudaThreadExit;
extern tcudaThreadSynchronize          *cudaThreadSynchronize;

extern __host__ cudaError_t CUDARTAPI cudaRuntimeDynload(void);

#if defined(__cplusplus)

}

// } /* namespace dyn */

#endif /* __cplusplus */

#undef __dv

#endif /* !__CUDA_RUNTIME_API_DYNLINK_H__ */


text:
package lighthouse.subwindows;

import com.google.common.util.concurrent.*;
import com.vinumeris.updatefx.*;
import de.jensd.fx.fontawesome.*;
import javafx.beans.property.*;
import javafx.collections.*;
import javafx.concurrent.*;
import javafx.event.*;
import javafx.fxml.*;
import javafx.scene.control.*;
import javafx.scene.text.*;
import lighthouse.*;

import javax.annotation.*;
import java.io.*;
import java.nio.file.*;
import java.util.*;

import static com.google.common.base.Preconditions.*;
import static java.lang.String.format;
import static java.nio.file.Files.*;
import static lighthouse.utils.GuiUtils.*;
import static lighthouse.utils.GuiUtils.log;
import static lighthouse.utils.I18nUtil.*;

/**
 * Lets the user select a version to pin themselves to.
 */
public class UpdateFXWindow {
    public static final String CACHED_UPDATE_SUMMARY = "cached-update-summary";
    public Main.OverlayUI<UpdateFXWindow> overlayUI;

    @FXML Text descriptionLabel;
    @FXML ListView<UFXProtocol.Update> updatesList;
    @FXML Button pinBtn;

    private ObservableList<UFXProtocol.Update> updates = FXCollections.observableArrayList();
    private SimpleIntegerProperty currentPin = new SimpleIntegerProperty();
    private UpdateSummary summary;

    public void initialize() {
        currentPin.set(UpdateFX.getVersionPin(Main.unadjustedAppDir));

        updatesList.setCellFactory(param -> new ListCell<UFXProtocol.Update>() {
            @Override
            protected void updateItem(@Nullable UFXProtocol.Update item, boolean empty) {
                super.updateItem(item, empty);
                if (empty || summary == null) {
                    setText("");
                    setGraphic(null);
                    setStyle("");
                } else {
                    setStyle("");
                    setText(item == null ? "Latest version" : item.getDescription(0).getOneLiner());
                    Icon icon = Icon.create().icon(AwesomeIcon.THUMB_TACK);
                    icon.setStyle("-fx-font-family: FontAwesome; -fx-font-size: 1.5em");
                    icon.visibleProperty().bind(currentPin.isEqualTo(item != null ? item.getVersion() : 0));
                    setGraphic(icon);
                    // Bold the current version that's running, or latest if we're up to date.
                    if ((item == null && Main.VERSION == summary.highestVersion) ||
                            (item != null && item.getVersion() == Main.VERSION && item.getVersion() != summary.highestVersion))
                        setStyle("-fx-font-weight: bold");
                    else
                        setStyle("");
                }
            }
        });
        updatesList.setItems(updates);
        updatesList.getSelectionModel().selectFirst();
        updatesList.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
        updatesList.getSelectionModel().selectedIndexProperty().addListener((x, prev, cur) -> {
            if (cur.intValue() > 0)
                descriptionLabel.setText(updates.get(cur.intValue()).getDescription(0).getDescription());
            else
                descriptionLabel.setText("");
        });
    }

    public static Main.OverlayUI<UpdateFXWindow> open(Updater updater) {
        Main.OverlayUI<UpdateFXWindow> result = Main.instance.<UpdateFXWindow>overlayUI("subwindows/updatefx.fxml", tr("Application updates"));
        result.controller.setUpdater(checkNotNull(updater));
        return result;
    }

    @FXML
    public void pinClicked(ActionEvent event) {
        UFXProtocol.Update selected = updatesList.getSelectionModel().getSelectedItem();
        if (selected == null) {
            UpdateFX.unpin(Main.unadjustedAppDir);
            currentPin.set(0);
            informationalAlert(tr("Version change"),
                    tr("You will be switched to always track the latest version. The app will now restart."));
            Main.restart();
        } else {
            int ver = selected.getVersion();
            UpdateFX.pinToVersion(Main.unadjustedAppDir, ver);
            currentPin.set(ver);
            informationalAlert(tr("Version change"),
                    // TRANS: %d = version number
                    tr("You will be switched to always use version %d. The app will now restart."), ver);
            Main.restart();
        }
    }

    @FXML
    public void closeClicked(ActionEvent event) {
        overlayUI.done();
    }

    public void setUpdater(Updater updater) {
        if (updater.isDone() || Main.bitcoin.isOffline())
            processUpdater(updater);
        else
            updater.addEventHandler(WorkerStateEvent.WORKER_STATE_SUCCEEDED, event -> {
                processUpdater(updater);
            });
    }

    private void processUpdater(Updater updater) {
        updates.clear();
        updates.add(null);  // Sentinel for "latest"
        UpdateSummary s = null;
        try {
            if (!Main.bitcoin.isOffline())
                s = Futures.getUnchecked(updater);
        } catch (Exception e) {
            log.warn("Failed to get online updates index, trying to fall back to disk cache: {}", e.getMessage());
        }
        if (s != null)
            summary = s;
        else
            summary = loadCachedIndex();
        if (summary == null) {
            log.error("Not online and failed to load cached updates, showing blank window.");
            pinBtn.setDisable(true);
            return;   // Not online and no cached updates, or some other issue, so give up.
        }
        List<UFXProtocol.Update> list = new ArrayList<>(summary.updates.getUpdatesList());
        Collections.reverse(list);
        for (UFXProtocol.Update update : list) {
            // For each update in the index, check if we have it on disk (the index can contain updates older than
            // what we can roll back to).
            if (exists(Main.unadjustedAppDir.resolve(format("%d.jar", update.getVersion())))) {
                if (update.getDescriptionCount() > 0)
                    updates.add(update);
            }
        }
    }

    // Returns an UpdateSummary object that we previously had downloaded, so we can still display update info if
    // we are offline, or null if not found or some other error.
    @Nullable
    private UpdateSummary loadCachedIndex() {
        try (InputStream is = Files.newInputStream(Main.unadjustedAppDir.resolve(CACHED_UPDATE_SUMMARY))) {
            return new UpdateSummary(Main.VERSION, UFXProtocol.Updates.parseDelimitedFrom(is));
        } catch (IOException e) {
            return null;
        }
    }

    public static void saveCachedIndex(UFXProtocol.Updates updates) {
        try (OutputStream os = Files.newOutputStream(Main.unadjustedAppDir.resolve(CACHED_UPDATE_SUMMARY))) {
            updates.writeDelimitedTo(os);
        } catch (IOException e) {
            log.error("Failed to save cached update index", e);
        }
    }
}


text:
package org.gradle.api.internal.attributes;

import org.gradle.api.Action;
import org.gradle.api.attributes.CompatibilityCheckDetails;

import java.util.Comparator;

public class DefaultOrderedCompatibilityRule<T> implements Action<CompatibilityCheckDetails<T>> {
    private final Comparator<? super T> comparator;
    private final boolean reverse;

    public DefaultOrderedCompatibilityRule(Comparator<? super T> comparator, boolean reverse) {
        this.comparator = comparator;
        this.reverse = reverse;
    }

    @Override
    public void execute(CompatibilityCheckDetails<T> details) {
        T consumerValue = details.getConsumerValue();
        T producerValue = details.getProducerValue();
        int cmp = comparator.compare(consumerValue, producerValue);
        if (reverse) {
            cmp = -cmp;
        }
        if (cmp >= 0) {
            details.compatible();
        } else {
            details.incompatible();
        }
    }

}


text:
Capistrano tagging3
====

Automagically tag your current deployed release with capistrano v3

Install
----

```bash
$ gem install capistrano-tagging3
```

Usage
----

In `deploy.rb`:

```ruby
require 'capistrano/tagging3'
```

That's it! You can specify format of tag:

```ruby
set :tagging3_format, ':rails_env_:release' # default, also available all of deploy variables
```

Original idea:
---

* [https://github.com/dimko/capistrano-tagging](https://github.com/dimko/capistrano-tagging) - tagging for capistrano v2
* [https://github.com/LeipeLeon/capistrano-git-tags](https://github.com/LeipeLeon/capistrano-git-tags)

* [http://wendbaar.nl/blog/2010/04/automagically-tagging-releases-in-github/](http://wendbaar.nl/blog/2010/04/automagically-tagging-releases-in-github/)

* [http://gist.github.com/381852](http://gist.github.com/381852)