text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.drools</groupId>
    <artifactId>droolsjbpm-integration</artifactId>
    <version>6.1.0-SNAPSHOT</version>
  </parent>

  <artifactId>drools-spring-legacy5</artifactId>
  <packaging>bundle</packaging>

  <name>Drools Spring Legacy5</name>
  <description>Legacy Drools 5.x integration for Spring.</description>

  <dependencies>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-internal</artifactId>
    </dependency>

    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>knowledge-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-core</artifactId>
    </dependency>

    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-compiler</artifactId>
    </dependency>

    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-decisiontables</artifactId>
    </dependency>

    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-persistence-jpa</artifactId>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-persistence-jpa</artifactId>
      <optional>true</optional>
    </dependency>

    <!-- dependency>
      <groupId>org.kie</groupId>
      <artifactId>drools-grid-impl</artifactId>
    </dependency-->

    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-xjc</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-orm</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hibernate.javax.persistence</groupId>
      <artifactId>hibernate-jpa-2.0-api</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.thoughtworks.xstream</groupId>
      <artifactId>xstream</artifactId>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency><!-- For unit test logging: configure in src/test/resources/logback-test.xml -->
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- test persistence -->
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-entitymanager</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- test -->
    <dependency>
      <groupId>org.eclipse.jdt.core.compiler</groupId>
      <artifactId>ecj</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>antlr-runtime</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <_removeheaders>Ignore-Package</_removeheaders>
            <Bundle-SymbolicName>org.drools.spring</Bundle-SymbolicName>
            <Bundle-Name>Drools Spring</Bundle-Name>
            <Import-Package>
              !org.drools.container.spring*,
              !org.drools.grid*,
              com.sun.tools.xjc*;resolution:=optional,
              javax.enterprise.context;resolution:=optional,
              javax.persistence;resolution:=optional,
              org.drools.persistence*;resolution:=optional,
              <!-- TODO Resolution should be removed as jBPM will be deployed on karaf too-->
              org.jbpm*;resolution:=optional,
              <!-- TODO Features spring-orm, spring-tx could be installed by default to avoid to declare them as optional -->
              org.springframework.orm.jpa;resolution:=optional,
              org.springframework.transaction*;resolution:=optional,
              *
            </Import-Package>
            <Export-Package>
              org.drools.container.spring*,
              org.drools.grid*
            </Export-Package>
          </instructions>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>


text:
import "./styles.scss";
import { View } from "backbone.marionette";
import { scaleOrdinal } from "d3-scale";
import { interpolateYlOrRd } from "d3-scale-chromatic";
import TrendChartView from "../../components/graph-trend-chart/TrendChartView";
import { className, regions } from "../../decorators/index";
import template from "./RetryTrendWidgetView.hbs";

@regions({
  chart: ".retry-trend__chart",
})
@className("retry-trend")
class RetryTrendWidgetView extends View {
  template = template;

  onRender() {
    const { retry, run } = this.model.last().get("data");
    const retriesPercent = Math.min(0.3 + Math.min(retry, run) / run, 1);
    const colors = scaleOrdinal(["#4682b4", interpolateYlOrRd(retriesPercent)]);
    this.showChildView(
      "chart",
      new TrendChartView({
        model: this.model,
        keys: ["run", "retry"],
        colors,
        hideLines: true,
        hidePoints: true,
      }),
    );
  }
}

export default RetryTrendWidgetView;

redpajama_set_name: RedPajamaGithub


text:
//  Copyright (c) 2021 Alachisoft
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License

using Alachisoft.NCache.Runtime.Serialization;
using Alachisoft.NCache.Runtime.Serialization.IO;

namespace Alachisoft.NCache.Common.Pooling.Stats
{
    public sealed class ObjectPoolStats : ICompactSerializable
    {
        public int Top
        {
            get; set;
        }

        public long Hits
        {
            get; set;
        }

        public int Count
        {
            get; set;
        }

        public long Misses
        {
            get; set;
        }

        public int Capacity
        {
            get; set;
        }

        public long TotalRequests
        {
            get; set;
        }

        public float ServingCapabilityBorderline
        {
            get; set;
        }

        public bool IsSimpleObjectPool
        {
            get;set;
        }

        #region ---------------------------- [ ICompactSerialization ] ----------------------------

        public void Serialize(CompactWriter writer)
        {
            writer.Write(Top);
            writer.Write(Hits);
            writer.Write(Count);
            writer.Write(Misses);
            writer.Write(Capacity);
            writer.Write(TotalRequests);
            writer.Write(ServingCapabilityBorderline);
        }

        public void Deserialize(CompactReader reader)
        {
            Top = reader.ReadInt32();
            Hits = reader.ReadInt64();
            Count = reader.ReadInt32();
            Misses = reader.ReadInt64();
            Capacity = reader.ReadInt32();
            TotalRequests = reader.ReadInt64();
            ServingCapabilityBorderline = reader.ReadSingle();
        }

        #endregion
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Massaria epiphegea Riess

### Remarks
null


text:
namespace mscorlib
{
	namespace System
	{
		namespace Collections
		{

			//Constructors Tests

			//Queue()
			TEST(mscorlib_System_Collections_Queue_Fixture,DefaultConstructor)
			{

				mscorlib::System::Collections::Queue *value = new mscorlib::System::Collections::Queue();
				EXPECT_NE(NULL, value->GetNativeObject());

			}

			//Queue(mscorlib::System::Int32 capacity)
			TEST(mscorlib_System_Collections_Queue_Fixture,Constructor_2)
			{

				mscorlib::System::Collections::Queue *value = new mscorlib::System::Collections::Queue();
				EXPECT_NE(NULL, value->GetNativeObject());

			}

			//Queue(mscorlib::System::Collections::ICollection col)
			TEST(mscorlib_System_Collections_Queue_Fixture,Constructor_3)
			{

				mscorlib::System::Collections::Queue *value = new mscorlib::System::Collections::Queue();
				EXPECT_NE(NULL, value->GetNativeObject());

			}

			//Queue(mscorlib::System::Int32 capacity, mscorlib::System::Single growFactor)
			TEST(mscorlib_System_Collections_Queue_Fixture,Constructor_4)
			{

				mscorlib::System::Collections::Queue *value = new mscorlib::System::Collections::Queue();
				EXPECT_NE(NULL, value->GetNativeObject());

			}

			//Public Methods Tests

			// Method CopyTo
			//		Signature: mscorlib::System::Array array, mscorlib::System::Int32 index
			TEST(mscorlib_System_Collections_Queue_Fixture,CopyTo_Test)
			{

			}

			// Method GetEnumerator
			//		Signature:
			TEST(mscorlib_System_Collections_Queue_Fixture,GetEnumerator_Test)
			{

			}

			// Method Clone
			//		Signature:
			TEST(mscorlib_System_Collections_Queue_Fixture,Clone_Test)
			{

			}

			// Method Clear
			//		Signature:
			TEST(mscorlib_System_Collections_Queue_Fixture,Clear_Test)
			{

			}

			// Method Contains
			//		Signature: mscorlib::System::Object obj
			TEST(mscorlib_System_Collections_Queue_Fixture,Contains_Test)
			{

			}

			// Method Dequeue
			//		Signature:
			TEST(mscorlib_System_Collections_Queue_Fixture,Dequeue_Test)
			{

			}

			// Method Enqueue
			//		Signature: mscorlib::System::Object obj
			TEST(mscorlib_System_Collections_Queue_Fixture,Enqueue_Test)
			{

			}

			// Method Peek
			//		Signature:
			TEST(mscorlib_System_Collections_Queue_Fixture,Peek_Test)
			{

			}

			// Method ToArray
			//		Signature:
			TEST(mscorlib_System_Collections_Queue_Fixture,ToArray_Test)
			{

			}

			// Method TrimToSize
			//		Signature:
			TEST(mscorlib_System_Collections_Queue_Fixture,TrimToSize_Test)
			{

			}

			//Public Static Methods Tests

			// Method Synchronized
			//		Signature: mscorlib::System::Collections::Queue queue
			TEST(mscorlib_System_Collections_Queue_Fixture,Synchronized_StaticTest)
			{

			}

			//Public Properties Tests

			// Property Count
			//		Return Type: mscorlib::System::Int32
			//			Property Get Method
			TEST(mscorlib_System_Collections_Queue_Fixture,get_Count_Test)
			{

			}

			// Property IsSynchronized
			//		Return Type: mscorlib::System::Boolean
			//			Property Get Method
			TEST(mscorlib_System_Collections_Queue_Fixture,get_IsSynchronized_Test)
			{

			}

			// Property SyncRoot
			//		Return Type: mscorlib::System::Object
			//			Property Get Method
			TEST(mscorlib_System_Collections_Queue_Fixture,get_SyncRoot_Test)
			{

			}

		}
	}
}


text:
<?php

include("../common.php");
Auth::checkSession(false);

//------------------------------------------------------------------------------
// Import $_POST variables and validation
//------------------------------------------------------------------------------

$validator = new FormValidator();
$validator->addRules(array(
	'jobID' => array(
		'type' => 'int',
		'required' => true,
		'min' => 1,
	),
	'temporary' => array(
		'type' => 'select',
		'required' => false,
		'options' => array(1, 0),
		'default' => 0
	),
	'feedbackMode' => array(
		'type' => 'select',
		'required' => true,
		'options' => array('personal', 'consensual')
	),
	'feedback' => array(
		'type' => 'json',
		'required' => true
	)
));

try {
	if($validator->validate($_POST))
		$params = $validator->output;
	else
		throw new Exception(implode("\n", $validator->errors));
	$is_consensual = $params['feedbackMode'] == 'consensual';

	$dstData = array();
	$job_id = $params['jobID'];

	$currentUser = Auth::currentUser();

	$cadResult = new CadResult($job_id);
	if (!$cadResult->job_id)
		throw new Exception('No CAD result found for the specified Job ID.');
	set_include_path(get_include_path() . PATH_SEPARATOR . $cadResult->Plugin->configurationPath());

	$reason = 'You can not enter the feedback for unknown reason.';
	if ($is_consensual)
		$av = $cadResult->feedbackAvailability('consensual', $currentUser, $reason);
	else
		$av = $cadResult->feedbackAvailability('personal', $currentUser, $reason);
	if ($av != 'normal')
		throw new Exception($reason);

	if (registerFeedback($cadResult, $params['feedback'], $params['temporary'], $is_consensual) === true)
		echo json_encode(array('status' => 'OK'));
	else
		throw new Exception('Failed!');
} catch (Exception $e) {
	echo json_encode(array(
		'action' => 'registerFeedback',
		'status' => 'SysError',
		'error' => array(
			'message' => $e->getMessage()
		)
	));
}
exit;

//------------------------------------------------------------------------------

function registerFeedback(CadResult $cadResult, $feedback, $temporary, $is_consensual)
{
	$job_id = $cadResult->job_id;
	$pdo = DBConnector::getConnection();
	$user = Auth::currentUser();
	$user_id = $user->user_id;

	if (strlen($user_id) == 0)
		throw new Exception('Session not established.');

	// Delete existing feedback set (temporary or not)
	$cond = array(
		'is_consensual' => $is_consensual ? 'TRUE' : 'FALSE',
		'job_id' => $job_id
	);
	if (!$is_consensual)
		$cond['entered_by'] = $user_id; // only delete my personal feedback
	$fbs = Feedback::select($cond);
	foreach ($fbs as $delete_fb)
		Feedback::delete($delete_fb->fb_id);

	// Save the new feedback data
	$fb = new Feedback();
	$fb->save(array(
		'Feedback' => array(
			'job_id' => $job_id,
			'is_consensual' => $is_consensual ? 'TRUE' : 'FALSE',
			'status' => $temporary ? Feedback::TEMPORARY : Feedback::REGISTERED,
			'entered_by' => $user_id,
			'registered_at' => date('Y-m-d H:i:s')
		),
		'blockFeedback' => $feedback['blockFeedback'],
		'additionalFeedback' => $feedback['additionalFeedback']
	));

	// Automatic consensus: If 'Automatic consensual' is enabled
	// by plugin result policy settings, save the same data
	// as consensual feedback.
	$policy = $cadResult->PluginResultPolicy;
	if (!$is_consensual && $policy->automatic_consensus)
	{
		// Use another instance of CadResult to avoid cacheing
		$cadResult2 = new CadResult($job_id);
		// Actually not the exact copy, since use of buildInitilalConsensualFeedback
		// may modify the feedback content (like 'missed TP' => 'TP')
		$pfb = $cadResult2->queryFeedback('personal');
		$cfb = $cadResult2->buildInitialConsensualFeedback($pfb);
		if (!registerFeedback($cadResult2, $cfb, false, true))
			return false;
	}

	return true;
}


text:
package com.example.dbflute.mysql.dbflute.cbean.nss;

import org.seasar.dbflute.cbean.ConditionQuery;
import com.example.dbflute.mysql.dbflute.cbean.cq.MemberCQ;

/**
 * The nest select set-upper of member.
 * @author DBFlute(AutoGenerator)
 */
public class MemberNss {

    // ===================================================================================
    //                                                                           Attribute
    //                                                                           =========
    protected MemberCQ _query;
    public MemberNss(MemberCQ query) { _query = query; }
    public boolean hasConditionQuery() { return _query != null; }

    // ===================================================================================
    //                                                                     Nested Relation
    //                                                                     ===============
    /**
     * With nested relation columns to select clause.

     * (会員ステータス)member_status by my MEMBER_STATUS_CODE, named 'memberStatus'.
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberStatusNss withMemberStatus() {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberStatus(); }});
        return new MemberStatusNss(_query.queryMemberStatus());
    }
    /**
     * With nested relation columns to select clause.

     * (会員住所情報)member_address by my MEMBER_ID, named 'memberAddressAsValid'.
     * @param targetDate The bind parameter of fixed condition for targetDate. (NotNull)
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberAddressNss withMemberAddressAsValid(final java.util.Date targetDate) {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberAddressAsValid(targetDate); }});
        return new MemberAddressNss(_query.queryMemberAddressAsValid(targetDate));
    }
    /**
     * With nested relation columns to select clause.

     * (会員住所情報)member_address by my MEMBER_ID, named 'memberAddressAsValidBefore'.
     * @param targetDate The bind parameter of fixed condition for targetDate. (NotNull)
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberAddressNss withMemberAddressAsValidBefore(final java.util.Date targetDate) {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberAddressAsValidBefore(targetDate); }});
        return new MemberAddressNss(_query.queryMemberAddressAsValidBefore(targetDate));
    }
    /**
     * With nested relation columns to select clause.

     * (会員ログイン情報)member_login by my MEMBER_ID, named 'memberLoginAsLoginStatus'.
     * @param statusCode The bind parameter of fixed condition for statusCode. (NotNull)
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberLoginNss withMemberLoginAsLoginStatus(final com.example.dbflute.mysql.dbflute.allcommon.CDef.MemberStatus statusCode) {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberLoginAsLoginStatus(statusCode); }});
        return new MemberLoginNss(_query.queryMemberLoginAsLoginStatus(statusCode));
    }
    /**
     * With nested relation columns to select clause.

     * (会員住所情報)member_address by my MEMBER_ID, named 'memberAddressAsIfComment'.
     * @param targetDate The bind parameter of fixed condition for targetDate. (might be NullAllowed: IF comment exists in the fixed condition)
     * @param region The bind parameter of fixed condition for region. (might be NullAllowed: IF comment exists in the fixed condition)
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberAddressNss withMemberAddressAsIfComment(final java.util.Date targetDate, final com.example.dbflute.mysql.dbflute.allcommon.CDef.Region region) {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberAddressAsIfComment(targetDate, region); }});
        return new MemberAddressNss(_query.queryMemberAddressAsIfComment(targetDate, region));
    }
    /**
     * With nested relation columns to select clause.

     * (会員住所情報)member_address by my MEMBER_ID, named 'memberAddressAsOnlyOneDate'.
     * @param targetDate The bind parameter of fixed condition for targetDate. (NotNull)
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberAddressNss withMemberAddressAsOnlyOneDate(final java.util.Date targetDate) {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberAddressAsOnlyOneDate(targetDate); }});
        return new MemberAddressNss(_query.queryMemberAddressAsOnlyOneDate(targetDate));
    }
    /**
     * With nested relation columns to select clause.

     * (会員ログイン情報)member_login by my MEMBER_ID, named 'memberLoginAsLocalForeignOverTest'.
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberLoginNss withMemberLoginAsLocalForeignOverTest() {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberLoginAsLocalForeignOverTest(); }});
        return new MemberLoginNss(_query.queryMemberLoginAsLocalForeignOverTest());
    }
    /**
     * With nested relation columns to select clause.

     * (会員ログイン情報)member_login by my MEMBER_ID, named 'memberLoginAsForeignForeignEachOverTest'.
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberLoginNss withMemberLoginAsForeignForeignEachOverTest() {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberLoginAsForeignForeignEachOverTest(); }});
        return new MemberLoginNss(_query.queryMemberLoginAsForeignForeignEachOverTest());
    }
    /**
     * With nested relation columns to select clause.

     * (会員ログイン情報)member_login by my MEMBER_ID, named 'memberLoginAsForeignForeignOptimizedBasicOverTest'.
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberLoginNss withMemberLoginAsForeignForeignOptimizedBasicOverTest() {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberLoginAsForeignForeignOptimizedBasicOverTest(); }});
        return new MemberLoginNss(_query.queryMemberLoginAsForeignForeignOptimizedBasicOverTest());
    }
    /**
     * With nested relation columns to select clause.

     * (会員ログイン情報)member_login by my MEMBER_ID, named 'memberLoginAsForeignForeignOptimizedMarkOverTest'.
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberLoginNss withMemberLoginAsForeignForeignOptimizedMarkOverTest() {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberLoginAsForeignForeignOptimizedMarkOverTest(); }});
        return new MemberLoginNss(_query.queryMemberLoginAsForeignForeignOptimizedMarkOverTest());
    }
    /**
     * With nested relation columns to select clause.

     * (会員ログイン情報)member_login by my MEMBER_ID, named 'memberLoginAsForeignForeignOptimizedPartOverTest'.
     * @param memberName The bind parameter of fixed condition for memberName. (NotNull)
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberLoginNss withMemberLoginAsForeignForeignOptimizedPartOverTest(final String memberName) {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberLoginAsForeignForeignOptimizedPartOverTest(memberName); }});
        return new MemberLoginNss(_query.queryMemberLoginAsForeignForeignOptimizedPartOverTest(memberName));
    }
    /**
     * With nested relation columns to select clause.

     * (会員ログイン情報)member_login by my MEMBER_ID, named 'memberLoginAsForeignForeignOptimizedWholeOverTest'.
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberLoginNss withMemberLoginAsForeignForeignOptimizedWholeOverTest() {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberLoginAsForeignForeignOptimizedWholeOverTest(); }});
        return new MemberLoginNss(_query.queryMemberLoginAsForeignForeignOptimizedWholeOverTest());
    }
    /**
     * With nested relation columns to select clause.

     * (会員ログイン情報)member_login by my MEMBER_ID, named 'memberLoginAsForeignForeignParameterOverTest'.
     * @param targetDate The bind parameter of fixed condition for targetDate. (NotNull)
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberLoginNss withMemberLoginAsForeignForeignParameterOverTest(final java.util.Date targetDate) {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberLoginAsForeignForeignParameterOverTest(targetDate); }});
        return new MemberLoginNss(_query.queryMemberLoginAsForeignForeignParameterOverTest(targetDate));
    }
    /**
     * With nested relation columns to select clause.

     * (会員ログイン情報)member_login by my MEMBER_ID, named 'memberLoginAsForeignForeignVariousOverTest'.
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberLoginNss withMemberLoginAsForeignForeignVariousOverTest() {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberLoginAsForeignForeignVariousOverTest(); }});
        return new MemberLoginNss(_query.queryMemberLoginAsForeignForeignVariousOverTest());
    }
    /**
     * With nested relation columns to select clause.

     * (会員ログイン情報)member_login by my MEMBER_ID, named 'memberLoginAsReferrerOverTest'.
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberLoginNss withMemberLoginAsReferrerOverTest() {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberLoginAsReferrerOverTest(); }});
        return new MemberLoginNss(_query.queryMemberLoginAsReferrerOverTest());
    }
    /**
     * With nested relation columns to select clause.

     * (会員ログイン情報)member_login by my MEMBER_ID, named 'memberLoginAsReferrerForeignOverTest'.
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberLoginNss withMemberLoginAsReferrerForeignOverTest() {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberLoginAsReferrerForeignOverTest(); }});
        return new MemberLoginNss(_query.queryMemberLoginAsReferrerForeignOverTest());
    }
    /**
     * With nested relation columns to select clause.

     * (会員住所情報)member_address by my MEMBER_ID, named 'memberAddressAsFormattedBasic'.
     * @param targetDate The bind parameter of fixed condition for targetDate. (NotNull)
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberAddressNss withMemberAddressAsFormattedBasic(final java.util.Date targetDate) {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberAddressAsFormattedBasic(targetDate); }});
        return new MemberAddressNss(_query.queryMemberAddressAsFormattedBasic(targetDate));
    }
    /**
     * With nested relation columns to select clause.

     * (会員住所情報)member_address by my MEMBER_ID, named 'memberAddressAsFormattedLong'.
     * @param targetDate The bind parameter of fixed condition for targetDate. (NotNull)
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberAddressNss withMemberAddressAsFormattedLong(final java.util.Date targetDate) {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberAddressAsFormattedLong(targetDate); }});
        return new MemberAddressNss(_query.queryMemberAddressAsFormattedLong(targetDate));
    }
    /**
     * With nested relation columns to select clause.

     * (会員ログイン情報)member_login by my MEMBER_ID, named 'memberLoginAsFormattedMany'.
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberLoginNss withMemberLoginAsFormattedMany() {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberLoginAsFormattedMany(); }});
        return new MemberLoginNss(_query.queryMemberLoginAsFormattedMany());
    }
    /**
     * With nested relation columns to select clause.

     * (会員ログイン情報)member_login by my MEMBER_ID, named 'memberLoginAsLatest'.
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberLoginNss withMemberLoginAsLatest() {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberLoginAsLatest(); }});
        return new MemberLoginNss(_query.queryMemberLoginAsLatest());
    }

    /**
     * With nested relation columns to select clause.

     * (会員セキュリティ情報)member_security by MEMBER_ID, named 'memberSecurityAsOne'.
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberSecurityNss withMemberSecurityAsOne() {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberSecurityAsOne(); }});
        return new MemberSecurityNss(_query.queryMemberSecurityAsOne());
    }
    /**
     * With nested relation columns to select clause.

     * (会員サービス)member_service by MEMBER_ID, named 'memberServiceAsOne'.
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberServiceNss withMemberServiceAsOne() {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberServiceAsOne(); }});
        return new MemberServiceNss(_query.queryMemberServiceAsOne());
    }
    /**
     * With nested relation columns to select clause.

     * (会員退会情報)member_withdrawal by MEMBER_ID, named 'memberWithdrawalAsOne'.
     * @return The set-upper of more nested relation. {...with[nested-relation].with[more-nested-relation]} (NotNull)
     */
    public MemberWithdrawalNss withMemberWithdrawalAsOne() {
        _query.doNss(new MemberCQ.NssCall() { public ConditionQuery qf() { return _query.queryMemberWithdrawalAsOne(); }});
        return new MemberWithdrawalNss(_query.queryMemberWithdrawalAsOne());
    }
}


text:
import * as nls from 'vs/nls';
import { IDisposable } from 'vs/base/common/lifecycle';
import { ExtensionDescriptionRegistry } from 'vs/workbench/services/extensions/common/extensionDescriptionRegistry';
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
import { ExtensionActivationError, MissingDependencyError } from 'vs/workbench/services/extensions/common/extensions';

const NO_OP_VOID_PROMISE = Promise.resolve<void>(undefined);

export interface IExtensionMemento {
	get<T>(key: string): T | undefined;
	get<T>(key: string, defaultValue: T): T;
	update(key: string, value: any): Promise<void>;
}

export interface IExtensionContext {
	subscriptions: IDisposable[];
	workspaceState: IExtensionMemento;
	globalState: IExtensionMemento;
	extensionPath: string;
	storagePath: string;
	globalStoragePath: string;
	asAbsolutePath(relativePath: string): string;
	readonly logPath: string;
	executionContext: number;
}

/**
 * Represents the source code (module) of an extension.
 */
export interface IExtensionModule {
	activate?(ctx: IExtensionContext): Promise<IExtensionAPI>;
	deactivate?(): void;
}

/**
 * Represents the API of an extension (return value of `activate`).
 */
export interface IExtensionAPI {
	// _extensionAPIBrand: any;
}

export type ExtensionActivationTimesFragment = {
	startup?: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
	codeLoadingTime?: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
	activateCallTime?: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
	activateResolvedTime?: { classification: 'SystemMetaData', purpose: 'PerformanceAndHealth', isMeasurement: true };
};

export class ExtensionActivationTimes {

	public static readonly NONE = new ExtensionActivationTimes(false, -1, -1, -1);

	public readonly startup: boolean;
	public readonly codeLoadingTime: number;
	public readonly activateCallTime: number;
	public readonly activateResolvedTime: number;

	constructor(startup: boolean, codeLoadingTime: number, activateCallTime: number, activateResolvedTime: number) {
		this.startup = startup;
		this.codeLoadingTime = codeLoadingTime;
		this.activateCallTime = activateCallTime;
		this.activateResolvedTime = activateResolvedTime;
	}
}

export class ExtensionActivationTimesBuilder {

	private readonly _startup: boolean;
	private _codeLoadingStart: number;
	private _codeLoadingStop: number;
	private _activateCallStart: number;
	private _activateCallStop: number;
	private _activateResolveStart: number;
	private _activateResolveStop: number;

	constructor(startup: boolean) {
		this._startup = startup;
		this._codeLoadingStart = -1;
		this._codeLoadingStop = -1;
		this._activateCallStart = -1;
		this._activateCallStop = -1;
		this._activateResolveStart = -1;
		this._activateResolveStop = -1;
	}

	private _delta(start: number, stop: number): number {
		if (start === -1 || stop === -1) {
			return -1;
		}
		return stop - start;
	}

	public build(): ExtensionActivationTimes {
		return new ExtensionActivationTimes(
			this._startup,
			this._delta(this._codeLoadingStart, this._codeLoadingStop),
			this._delta(this._activateCallStart, this._activateCallStop),
			this._delta(this._activateResolveStart, this._activateResolveStop)
		);
	}

	public codeLoadingStart(): void {
		this._codeLoadingStart = Date.now();
	}

	public codeLoadingStop(): void {
		this._codeLoadingStop = Date.now();
	}

	public activateCallStart(): void {
		this._activateCallStart = Date.now();
	}

	public activateCallStop(): void {
		this._activateCallStop = Date.now();
	}

	public activateResolveStart(): void {
		this._activateResolveStart = Date.now();
	}

	public activateResolveStop(): void {
		this._activateResolveStop = Date.now();
	}
}

export class ActivatedExtension {

	public readonly activationFailed: boolean;
	public readonly activationFailedError: Error | null;
	public readonly activationTimes: ExtensionActivationTimes;
	public readonly module: IExtensionModule;
	public readonly exports: IExtensionAPI | undefined;
	public readonly subscriptions: IDisposable[];

	constructor(
		activationFailed: boolean,
		activationFailedError: Error | null,
		activationTimes: ExtensionActivationTimes,
		module: IExtensionModule,
		exports: IExtensionAPI | undefined,
		subscriptions: IDisposable[]
	) {
		this.activationFailed = activationFailed;
		this.activationFailedError = activationFailedError;
		this.activationTimes = activationTimes;
		this.module = module;
		this.exports = exports;
		this.subscriptions = subscriptions;
	}
}

export class EmptyExtension extends ActivatedExtension {
	constructor(activationTimes: ExtensionActivationTimes) {
		super(false, null, activationTimes, { activate: undefined, deactivate: undefined }, undefined, []);
	}
}

export class HostExtension extends ActivatedExtension {
	constructor() {
		super(false, null, ExtensionActivationTimes.NONE, { activate: undefined, deactivate: undefined }, undefined, []);
	}
}

export class FailedExtension extends ActivatedExtension {
	constructor(activationError: Error) {
		super(true, activationError, ExtensionActivationTimes.NONE, { activate: undefined, deactivate: undefined }, undefined, []);
	}
}

export interface IExtensionsActivatorHost {
	onExtensionActivationError(extensionId: ExtensionIdentifier, error: ExtensionActivationError): void;
	actualActivateExtension(extensionId: ExtensionIdentifier, reason: ExtensionActivationReason): Promise<ActivatedExtension>;
}

export class ExtensionActivatedByEvent {
	constructor(
		public readonly startup: boolean,
		public readonly activationEvent: string
	) { }
}

export class ExtensionActivatedByAPI {
	constructor(
		public readonly startup: boolean
	) { }
}

export type ExtensionActivationReason = ExtensionActivatedByEvent | ExtensionActivatedByAPI;

export class ExtensionsActivator {

	private readonly _registry: ExtensionDescriptionRegistry;
	private readonly _resolvedExtensionsSet: Set<string>;
	private readonly _hostExtensionsMap: Map<string, ExtensionIdentifier>;
	private readonly _host: IExtensionsActivatorHost;
	private readonly _activatingExtensions: Map<string, Promise<void>>;
	private readonly _activatedExtensions: Map<string, ActivatedExtension>;
	/**
	 * A map of already activated events to speed things up if the same activation event is triggered multiple times.
	 */
	private readonly _alreadyActivatedEvents: { [activationEvent: string]: boolean; };

	constructor(registry: ExtensionDescriptionRegistry, resolvedExtensions: ExtensionIdentifier[], hostExtensions: ExtensionIdentifier[], host: IExtensionsActivatorHost) {
		this._registry = registry;
		this._resolvedExtensionsSet = new Set<string>();
		resolvedExtensions.forEach((extensionId) => this._resolvedExtensionsSet.add(ExtensionIdentifier.toKey(extensionId)));
		this._hostExtensionsMap = new Map<string, ExtensionIdentifier>();
		hostExtensions.forEach((extensionId) => this._hostExtensionsMap.set(ExtensionIdentifier.toKey(extensionId), extensionId));
		this._host = host;
		this._activatingExtensions = new Map<string, Promise<void>>();
		this._activatedExtensions = new Map<string, ActivatedExtension>();
		this._alreadyActivatedEvents = Object.create(null);
	}

	public isActivated(extensionId: ExtensionIdentifier): boolean {
		const extensionKey = ExtensionIdentifier.toKey(extensionId);

		return this._activatedExtensions.has(extensionKey);
	}

	public getActivatedExtension(extensionId: ExtensionIdentifier): ActivatedExtension {
		const extensionKey = ExtensionIdentifier.toKey(extensionId);

		const activatedExtension = this._activatedExtensions.get(extensionKey);
		if (!activatedExtension) {
			throw new Error('Extension `' + extensionId.value + '` is not known or not activated');
		}
		return activatedExtension;
	}

	public activateByEvent(activationEvent: string, reason: ExtensionActivationReason): Promise<void> {
		if (this._alreadyActivatedEvents[activationEvent]) {
			return NO_OP_VOID_PROMISE;
		}
		const activateExtensions = this._registry.getExtensionDescriptionsForActivationEvent(activationEvent);
		return this._activateExtensions(activateExtensions.map(e => e.identifier), reason).then(() => {
			this._alreadyActivatedEvents[activationEvent] = true;
		});
	}

	public activateById(extensionId: ExtensionIdentifier, reason: ExtensionActivationReason): Promise<void> {
		const desc = this._registry.getExtensionDescription(extensionId);
		if (!desc) {
			throw new Error('Extension `' + extensionId + '` is not known');
		}

		return this._activateExtensions([desc.identifier], reason);
	}

	/**
	 * Handle semantics related to dependencies for `currentExtension`.
	 * semantics: `redExtensions` must wait for `greenExtensions`.
	 */
	private _handleActivateRequest(currentExtensionId: ExtensionIdentifier, greenExtensions: { [id: string]: ExtensionIdentifier; }, redExtensions: ExtensionIdentifier[]): void {
		if (this._hostExtensionsMap.has(ExtensionIdentifier.toKey(currentExtensionId))) {
			greenExtensions[ExtensionIdentifier.toKey(currentExtensionId)] = currentExtensionId;
			return;
		}

		const currentExtension = this._registry.getExtensionDescription(currentExtensionId)!;
		const depIds = (typeof currentExtension.extensionDependencies === 'undefined' ? [] : currentExtension.extensionDependencies);
		let currentExtensionGetsGreenLight = true;

		for (let j = 0, lenJ = depIds.length; j < lenJ; j++) {
			const depId = depIds[j];

			if (this._resolvedExtensionsSet.has(ExtensionIdentifier.toKey(depId))) {
				// This dependency is already resolved
				continue;
			}

			const dep = this._activatedExtensions.get(ExtensionIdentifier.toKey(depId));
			if (dep && !dep.activationFailed) {
				// the dependency is already activated OK
				continue;
			}

			if (dep && dep.activationFailed) {
				// Error condition 2: a dependency has already failed activation
				this._host.onExtensionActivationError(currentExtension.identifier, nls.localize('failedDep1', "Cannot activate extension '{0}' because it depends on extension '{1}', which failed to activate.", currentExtension.displayName || currentExtension.identifier.value, depId));
				const error = new Error(`Dependency ${depId} failed to activate`);
				(<any>error).detail = dep.activationFailedError;
				this._activatedExtensions.set(ExtensionIdentifier.toKey(currentExtension.identifier), new FailedExtension(error));
				return;
			}

			if (this._hostExtensionsMap.has(ExtensionIdentifier.toKey(depId))) {
				// must first wait for the dependency to activate
				currentExtensionGetsGreenLight = false;
				greenExtensions[ExtensionIdentifier.toKey(depId)] = this._hostExtensionsMap.get(ExtensionIdentifier.toKey(depId))!;
				continue;
			}

			const depDesc = this._registry.getExtensionDescription(depId);
			if (depDesc) {
				// must first wait for the dependency to activate
				currentExtensionGetsGreenLight = false;
				greenExtensions[ExtensionIdentifier.toKey(depId)] = depDesc.identifier;
				continue;
			}

			// Error condition 1: unknown dependency
			this._host.onExtensionActivationError(currentExtension.identifier, new MissingDependencyError(depId));
			const error = new Error(`Unknown dependency '${depId}'`);
			this._activatedExtensions.set(ExtensionIdentifier.toKey(currentExtension.identifier), new FailedExtension(error));
			return;
		}

		if (currentExtensionGetsGreenLight) {
			greenExtensions[ExtensionIdentifier.toKey(currentExtension.identifier)] = currentExtensionId;
		} else {
			redExtensions.push(currentExtensionId);
		}
	}

	private _activateExtensions(extensionIds: ExtensionIdentifier[], reason: ExtensionActivationReason): Promise<void> {
		// console.log('_activateExtensions: ', extensionIds.map(p => p.value));
		if (extensionIds.length === 0) {
			return Promise.resolve(undefined);
		}

		extensionIds = extensionIds.filter((p) => !this._activatedExtensions.has(ExtensionIdentifier.toKey(p)));
		if (extensionIds.length === 0) {
			return Promise.resolve(undefined);
		}

		const greenMap: { [id: string]: ExtensionIdentifier; } = Object.create(null),
			red: ExtensionIdentifier[] = [];

		for (let i = 0, len = extensionIds.length; i < len; i++) {
			this._handleActivateRequest(extensionIds[i], greenMap, red);
		}

		// Make sure no red is also green
		for (let i = 0, len = red.length; i < len; i++) {
			const redExtensionKey = ExtensionIdentifier.toKey(red[i]);
			if (greenMap[redExtensionKey]) {
				delete greenMap[redExtensionKey];
			}
		}

		const green = Object.keys(greenMap).map(id => greenMap[id]);

		// console.log('greenExtensions: ', green.map(p => p.id));
		// console.log('redExtensions: ', red.map(p => p.id));

		if (red.length === 0) {
			// Finally reached only leafs!
			return Promise.all(green.map((p) => this._activateExtension(p, reason))).then(_ => undefined);
		}

		return this._activateExtensions(green, reason).then(_ => {
			return this._activateExtensions(red, reason);
		});
	}

	private _activateExtension(extensionId: ExtensionIdentifier, reason: ExtensionActivationReason): Promise<void> {
		const extensionKey = ExtensionIdentifier.toKey(extensionId);

		if (this._activatedExtensions.has(extensionKey)) {
			return Promise.resolve(undefined);
		}

		const currentlyActivatingExtension = this._activatingExtensions.get(extensionKey);
		if (currentlyActivatingExtension) {
			return currentlyActivatingExtension;
		}

		const newlyActivatingExtension = this._host.actualActivateExtension(extensionId, reason).then(undefined, (err) => {
			this._host.onExtensionActivationError(extensionId, nls.localize('activationError', "Activating extension '{0}' failed: {1}.", extensionId.value, err.message));
			console.error('Activating extension `' + extensionId.value + '` failed: ', err.message);
			console.log('Here is the error stack: ', err.stack);
			// Treat the extension as being empty
			return new FailedExtension(err);
		}).then((x: ActivatedExtension) => {
			this._activatedExtensions.set(extensionKey, x);
			this._activatingExtensions.delete(extensionKey);
		});

		this._activatingExtensions.set(extensionKey, newlyActivatingExtension);
		return newlyActivatingExtension;
	}
}


text:
layout: post
title: Cathnet Wiki
author: Jeff Geerling
nid: 433
comments: true
redirect_from: /wiki/433/cathnet-wiki/
created: 1339424610
---
Wiki containing Cathnet documents and information.

See the Cathnet project page for more information.


text:
> {%= description %}

## Install
{%= include("install-npm", {save: true}) %}

## Usage

Supports years as numbers or strings:

```js
var isValidYear = require('{%= name %}');

isValidYear(2011, '2010-2015');
//=> true
isValidYear(2011, '1999-2001');
//=> false
```

**Acceptable formats**

Pass an array or list or years or year ranges (years must increase from left to right).

- The first argument is the year to validate
- Everything else is a valid year to test against
- Year ranges must always be a string separated by `-`, as in `2001-2005`
- Non-ranges (sequential or otherwise) may be separated by `,` or `|` when passed as a string, or as must be passed as individual array elements.

All of the following should work:

```js
isValidYear(2011, 2015);
//=> false
isValidYear(2015, 2015);
//=> true

isValidYear(2015, [1999, 2000, 2001]);
//=> false
isValidYear(2001, [1999, 2000, 2001]);
//=> true

isValidYear(2009, '2010-2015');
//=> false
isValidYear(2010, '2010-2015');
//=> true

isValidYear(2008, '2009,2010-2015');
//=> false
isValidYear(2009, '2009,2010-2015');
//=> true

isValidYear(2011, [1997, '1999-2009', 2010]);
//=> false
isValidYear(2010, [1997, '1999-2009', 2010]);
//=> true
```

## Related projects
{%= related(verb.related.list) %}

## Running tests
{%= include("tests") %}

## Contributing
{%= include("contributing") %}

## Author
{%= include("author") %}

## License
{%= copyright() %}
{%= license() %}

***

{%= include("footer") %}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<title>SWIG-3.0 Documentation</title>

SWIG-3.0 Documentation

The SWIG documentation is available in one of the following formats.

HTML documentation with one chapter per page.
Please start with either the Sections summary or the Detailed table of contents.

HTML documentation on a single HTML page.

PDF document.


text:
package sagan.guides;

public class UnderstandingDoc implements UnderstandingMetadata, DocumentContent {

    private String subject;
    private String content;
	private String tableOfContents;

    // only used for JSON serialization
    public UnderstandingDoc() {
    }

    public UnderstandingDoc(String subject) {
        this.subject = subject;
    }

    public UnderstandingDoc(String subject, final String content) {
        this.subject = subject;
        this.content = content;
    }

    @Override
    public String getSubject() {
        return subject;
    }

    @Override
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

	@Override
	public String getTableOfContents() {
		return this.tableOfContents;
	}

	public void setTableOfContents(String tableOfContents) {
		this.tableOfContents = tableOfContents;
	}
}


text:
package org.motechproject.nms.testing.it.region;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.motechproject.nms.region.domain.Circle;
import org.motechproject.nms.region.domain.District;
import org.motechproject.nms.region.domain.Language;
import org.motechproject.nms.region.domain.NationalDefaultLanguage;
import org.motechproject.nms.region.domain.State;
import org.motechproject.nms.region.repository.CircleDataService;
import org.motechproject.nms.region.repository.DistrictDataService;
import org.motechproject.nms.region.repository.LanguageDataService;
import org.motechproject.nms.region.repository.NationalDefaultLanguageDataService;
import org.motechproject.nms.region.repository.StateDataService;
import org.motechproject.nms.testing.service.TestingService;
import org.motechproject.testing.osgi.BasePaxIT;
import org.motechproject.testing.osgi.container.MotechNativeTestContainerFactory;
import org.ops4j.pax.exam.ExamFactory;
import org.ops4j.pax.exam.junit.PaxExam;
import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
import org.ops4j.pax.exam.spi.reactors.PerSuite;

import javax.inject.Inject;
import javax.jdo.JDODataStoreException;

@RunWith(PaxExam.class)
@ExamReactorStrategy(PerSuite.class)
@ExamFactory(MotechNativeTestContainerFactory.class)
public class NationalDefaultLanguageLocationBundleIT extends BasePaxIT{

    @Inject
    TestingService testingService;

    @Inject
    NationalDefaultLanguageDataService nationalDefaultLanguageLocationDataService;

    @Inject
    StateDataService stateDataService;

    @Inject
    DistrictDataService districtDataService;

    @Inject
    CircleDataService circleDataService;

    @Inject
    LanguageDataService languageDataService;

    private void cleanAllData() {
        testingService.clearDatabase();
    }

    @Rule
    public ExpectedException exception = ExpectedException.none();

    @Test
    public void testVerifyOnlyOneNationalDefaultLanguage() {
        cleanAllData();

        District district = new District();
        district.setName("District 1");
        district.setRegionalName("District 1");
        district.setCode(1L);

        State state = new State();
        state.setName("State 1");
        state.setCode(1L);
        state.getDistricts().add(district);

        stateDataService.create(state);

        District district2 = new District();
        district2.setName("District 2");
        district2.setRegionalName("District 2");
        district2.setCode(2L);

        State state2 = new State();
        state2.setName("State 2");
        state2.setCode(2L);
        state2.getDistricts().add(district2);

        stateDataService.create(state2);

        Language ta = languageDataService.create(new Language("50", "tamil"));
        Language hi = languageDataService.create(new Language("99", "hindi"));

        Circle circle = new Circle("AA");
        circle.setDefaultLanguage(ta);
        circleDataService.update(circle);

        district.setLanguage(ta);
        districtDataService.update(district);

        district2.setLanguage(hi);
        districtDataService.update(district2);

        nationalDefaultLanguageLocationDataService.create(new NationalDefaultLanguage(ta));

        exception.expect(JDODataStoreException.class);
        nationalDefaultLanguageLocationDataService.create(new NationalDefaultLanguage(hi));
    }

}


text:
Google::Cloud::PubSub::V1::Subscriber::Client.configure do |config|
  config.channel_args ||= {}
  config.channel_args["grpc.max_send_message_length"] = -1
  config.channel_args["grpc.max_receive_message_length"] = -1
  config.channel_args["grpc.keepalive_time_ms"] = 300_000
  # Set max metadata size to 4 MB.
  config.channel_args["grpc.max_metadata_size"] = 4 * 1024 * 1024
end


text:
object HelloWorld {
  def main(args: Array[String]) {
     println("Hello, world!")
  }
}


text:
<?php

namespace Fwk\Di\Events;

use Fwk\Di\Container;
use Fwk\Di\DefinitionInterface;
use Fwk\Di\Event;

class BeforeServiceRegisteredEvent extends Event
{
    public function __construct(Container $container, $serviceName, DefinitionInterface $definition) {
        parent::__construct(
            'beforeServiceRegistered',
            array('definition' => $definition, 'serviceName' => $serviceName),
            $container
        );
    }

    /**
     * Returns the service's name
     *
     * @return string
     */
    public function getServiceName()
    {
        return $this->serviceName;
    }

    /**
     * Returns the service's definition
     *
     * @return DefinitionInterface
     */
    public function getDefinition()
    {
        return $this->definition;
    }
}


text:
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("Markdown")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Orchard")]
[assembly: AssemblyCopyright("Copyright © Outercurve Foundation 2011")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("146F4A3C-C611-4B60-A046-AC5C48D25C70")]

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.7")]
[assembly: AssemblyFileVersion("1.7")]


text:
package server

import (
	"context"
	"github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
	emptypb "github.com/GoogleCloudPlatform/declarative-resource-client-library/python/proto/empty_go_proto"
	betapb "github.com/GoogleCloudPlatform/declarative-resource-client-library/python/proto/logging/beta/logging_beta_go_proto"
	"github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/logging/beta"
)

// LogBucketServer implements the gRPC interface for LogBucket.
type LogBucketServer struct{}

// ProtoToLogBucketLifecycleStateEnum converts a LogBucketLifecycleStateEnum enum from its proto representation.
func ProtoToLoggingBetaLogBucketLifecycleStateEnum(e betapb.LoggingBetaLogBucketLifecycleStateEnum) *beta.LogBucketLifecycleStateEnum {
	if e == 0 {
		return nil
	}
	if n, ok := betapb.LoggingBetaLogBucketLifecycleStateEnum_name[int32(e)]; ok {
		e := beta.LogBucketLifecycleStateEnum(n[len("LoggingBetaLogBucketLifecycleStateEnum"):])
		return &e
	}
	return nil
}

// ProtoToLogBucket converts a LogBucket resource from its proto representation.
func ProtoToLogBucket(p *betapb.LoggingBetaLogBucket) *beta.LogBucket {
	obj := &beta.LogBucket{
		Name:           dcl.StringOrNil(p.GetName()),
		Description:    dcl.StringOrNil(p.GetDescription()),
		CreateTime:     dcl.StringOrNil(p.GetCreateTime()),
		UpdateTime:     dcl.StringOrNil(p.GetUpdateTime()),
		RetentionDays:  dcl.Int64OrNil(p.GetRetentionDays()),
		Locked:         dcl.Bool(p.GetLocked()),
		LifecycleState: ProtoToLoggingBetaLogBucketLifecycleStateEnum(p.GetLifecycleState()),
		Parent:         dcl.StringOrNil(p.GetParent()),
		Location:       dcl.StringOrNil(p.GetLocation()),
	}
	return obj
}

// LogBucketLifecycleStateEnumToProto converts a LogBucketLifecycleStateEnum enum to its proto representation.
func LoggingBetaLogBucketLifecycleStateEnumToProto(e *beta.LogBucketLifecycleStateEnum) betapb.LoggingBetaLogBucketLifecycleStateEnum {
	if e == nil {
		return betapb.LoggingBetaLogBucketLifecycleStateEnum(0)
	}
	if v, ok := betapb.LoggingBetaLogBucketLifecycleStateEnum_value["LogBucketLifecycleStateEnum"+string(*e)]; ok {
		return betapb.LoggingBetaLogBucketLifecycleStateEnum(v)
	}
	return betapb.LoggingBetaLogBucketLifecycleStateEnum(0)
}

// LogBucketToProto converts a LogBucket resource to its proto representation.
func LogBucketToProto(resource *beta.LogBucket) *betapb.LoggingBetaLogBucket {
	p := &betapb.LoggingBetaLogBucket{}
	p.SetName(dcl.ValueOrEmptyString(resource.Name))
	p.SetDescription(dcl.ValueOrEmptyString(resource.Description))
	p.SetCreateTime(dcl.ValueOrEmptyString(resource.CreateTime))
	p.SetUpdateTime(dcl.ValueOrEmptyString(resource.UpdateTime))
	p.SetRetentionDays(dcl.ValueOrEmptyInt64(resource.RetentionDays))
	p.SetLocked(dcl.ValueOrEmptyBool(resource.Locked))
	p.SetLifecycleState(LoggingBetaLogBucketLifecycleStateEnumToProto(resource.LifecycleState))
	p.SetParent(dcl.ValueOrEmptyString(resource.Parent))
	p.SetLocation(dcl.ValueOrEmptyString(resource.Location))

	return p
}

// applyLogBucket handles the gRPC request by passing it to the underlying LogBucket Apply() method.
func (s *LogBucketServer) applyLogBucket(ctx context.Context, c *beta.Client, request *betapb.ApplyLoggingBetaLogBucketRequest) (*betapb.LoggingBetaLogBucket, error) {
	p := ProtoToLogBucket(request.GetResource())
	res, err := c.ApplyLogBucket(ctx, p)
	if err != nil {
		return nil, err
	}
	r := LogBucketToProto(res)
	return r, nil
}

// applyLoggingBetaLogBucket handles the gRPC request by passing it to the underlying LogBucket Apply() method.
func (s *LogBucketServer) ApplyLoggingBetaLogBucket(ctx context.Context, request *betapb.ApplyLoggingBetaLogBucketRequest) (*betapb.LoggingBetaLogBucket, error) {
	cl, err := createConfigLogBucket(ctx, request.GetServiceAccountFile())
	if err != nil {
		return nil, err
	}
	return s.applyLogBucket(ctx, cl, request)
}

// DeleteLogBucket handles the gRPC request by passing it to the underlying LogBucket Delete() method.
func (s *LogBucketServer) DeleteLoggingBetaLogBucket(ctx context.Context, request *betapb.DeleteLoggingBetaLogBucketRequest) (*emptypb.Empty, error) {

	cl, err := createConfigLogBucket(ctx, request.GetServiceAccountFile())
	if err != nil {
		return nil, err
	}
	return &emptypb.Empty{}, cl.DeleteLogBucket(ctx, ProtoToLogBucket(request.GetResource()))

}

// ListLoggingBetaLogBucket handles the gRPC request by passing it to the underlying LogBucketList() method.
func (s *LogBucketServer) ListLoggingBetaLogBucket(ctx context.Context, request *betapb.ListLoggingBetaLogBucketRequest) (*betapb.ListLoggingBetaLogBucketResponse, error) {
	cl, err := createConfigLogBucket(ctx, request.GetServiceAccountFile())
	if err != nil {
		return nil, err
	}

	resources, err := cl.ListLogBucket(ctx, request.GetLocation(), request.GetParent())
	if err != nil {
		return nil, err
	}
	var protos []*betapb.LoggingBetaLogBucket
	for _, r := range resources.Items {
		rp := LogBucketToProto(r)
		protos = append(protos, rp)
	}
	p := &betapb.ListLoggingBetaLogBucketResponse{}
	p.SetItems(protos)
	return p, nil
}

func createConfigLogBucket(ctx context.Context, service_account_file string) (*beta.Client, error) {

	conf := dcl.NewConfig(dcl.WithUserAgent("dcl-test"), dcl.WithCredentialsFile(service_account_file))
	return beta.NewClient(conf), nil
}


text:
package com.takin.emmet.util;

import java.util.ArrayList;
import java.util.List;

public class WeightRoundRobin {
    /**上次选择的服务器*/
    private int currentIndex = -1;
    /**当前调度的权值*/
    private int currentWeight = 0;
    /**最大权重*/
    private int maxWeight;
    /**权重的最大公约数*/
    private int gcdWeight;
    /**服务器数*/
    private int serverCount;
    private List<Server> servers = new ArrayList<>();

    /*
     * 得到两值的最大公约数
     */
    public int greaterCommonDivisor(int a, int b) {
        if (a % b == 0) {
            return b;
        } else {
            return greaterCommonDivisor(b, a % b);
        }
    }

    /*
     * 得到list中所有权重的最大公约数,实际上是两两取最大公约数d,然后得到的d
     * 与下一个权重取最大公约数,直至遍历完
     */
    public int greatestCommonDivisor(List<Server> servers) {
        int divisor = 0;
        for (int index = 0, len = servers.size(); index < len - 1; index++) {
            if (index == 0) {
                divisor = greaterCommonDivisor(servers.get(index).getWeight(), servers.get(index + 1).getWeight());
            } else {
                divisor = greaterCommonDivisor(divisor, servers.get(index).getWeight());
            }
        }
        return divisor;
    }

    /*
     * 得到list中的最大的权重
     */
    public int greatestWeight(List<Server> servers) {
        int weight = 0;
        for (Server server : servers) {
            if (weight < server.getWeight()) {
                weight = server.getWeight();
            }
        }
        return weight;
    }

    /**
     *  算法流程:
     *  假设有一组服务器 S = {S0, S1, …, Sn-1}
     *  有相应的权重,变量currentIndex表示上次选择的服务器
     *  权值currentWeight初始化为0,currentIndex初始化为-1 ,当第一次的时候返回 权值取最大的那个服务器,
     *  通过权重的不断递减 寻找 适合的服务器返回
     */
    public Server getServer() {
        while (true) {
            currentIndex = (currentIndex + 1) % serverCount;
            if (currentIndex == 0) {
                currentWeight = currentWeight - gcdWeight;
                if (currentWeight <= 0) {
                    currentWeight = maxWeight;
                    if (currentWeight == 0) {
                        return null;
                    }
                }
            }
            if (servers.get(currentIndex).getWeight() >= currentWeight) {
                return servers.get(currentIndex);
            }
        }
    }

    public void init() {
        servers.add(new Server("192.168.191.2", 2));
        servers.add(new Server("192.168.191.4", 4));
        servers.add(new Server("192.168.191.8", 8));

        maxWeight = greatestWeight(servers);
        gcdWeight = greatestCommonDivisor(servers);
        serverCount = servers.size();
    }

    public static void main(String args[]) {
        WeightRoundRobin weightRoundRobin = new WeightRoundRobin();
        weightRoundRobin.init();

        for (int i = 0; i < 15; i++) {
            Server server = weightRoundRobin.getServer();
            System.out.println("server " + server.getIp() + " weight=" + server.getWeight());
        }
    }

}

class Server {
    private String ip;
    private int weight;

    public Server(String ip, int weight) {
        this.ip = ip;
        this.weight = weight;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

}


text:
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>ACosH</title>

ACosH()

语法

Result.f = ACosH(Value.f)

概要

Returns the area hyperbolic cosine of the specified value.

参数

Value.f

The input value. It must be
between greater than or equal to 1.

返回值

Returns the hyperbolic angle.

备注

This is the inverse function of CosH().
This function can handle float and double values.

示例

  Debug ACosH(1)                 ; will display '0'
  Debug Exp(ACosH(0.5 * Sqr(5))) ; will display '1.618033' (the golden ratio)

参阅

CosH(), @acos

已支持操作系统
所有

<- ACos() - Math Index - ASin() ->


text:
/**
 * Manglers that processes object coming from client and do necessary sanitation.
 *
 * @module server
 * @submodule manglers
 */
(function() {
	'use strict';

	var consts = require('./../SchemaConstants.js');
	var log = require('./../logging.js').getLogger('manglers/ObjectLink2Mangler.js');

	/**
	 *
	 * Mangler that mangles ObjectLink2 schema element.
	 * Generally this mangler only removes elements that should not be stored in database
	 *
	 * @TODO Mangler should validate keyword data
	 *
	 * @class ObjectLink2Mangler
	 * @constructor
	 */
	function ObjectLink2Mangler() {
	}

	/**
	 * Generic mangling function
	 *
	 * @method
	 * @param ctx
	 * @param objFragment
	 * @param schemaFragment
	 * @param objPath
	 * @param callback
	 */
	ObjectLink2Mangler.prototype.mangle = function(ctx,objFragment, schemaFragment, objPath, callback) {
		var prop;

		if (!objFragment || !schemaFragment || !schemaFragment[consts.OBJECT_LINK2_KEYWORD]) {
			callback(null, null);
			return;
		}

		log.silly('ObjectLink2 mangler start for %s', objPath);
		// remove all unneeded properties
		for (prop in objFragment) {
			if ((prop !== consts.OBJECT_LINK2_SCHEMA_KEYWORD) && (prop !== consts.OBJECT_LINK2_OID_KEYWORD)) {
				log.silly('Deleting field %s', prop);
				delete objFragment[prop];
			}
		}

		log.debug('ObjectLink2 mangling finished for %s',  objPath);
		callback(null, []);
	};

	module.exports = function() {
		return new ObjectLink2Mangler();
	};
}());


text:
package de.lalo5.particleeffectlib.effect;

import de.lalo5.particleeffectlib.Effect;
import de.lalo5.particleeffectlib.EffectManager;
import de.lalo5.particleeffectlib.EffectType;
import de.lalo5.particleeffectlib.util.ParticleEffect;
import de.lalo5.particleeffectlib.util.VectorUtils;
import org.bukkit.Location;
import org.bukkit.util.Vector;

public class DonutEffect extends Effect {

    /**
     * ParticleType of spawned particle
     */
    public ParticleEffect particle = ParticleEffect.FLAME;

    /**
     * Amount of particles inside of a single vertical circle
     */
    public int particlesCircle = 10;

    /**
     * Amount of circles to build the torus
     */
    public int circles = 36;

    /**
     * Radius of the torus
     */
    public float radiusDonut = 2;

    /**
     * Radius of the tube (the circles on the outside.
     */
    public float radiusTube = .5f;

    /**
     * Rotation of the torus.
     */
    public double xRotation, yRotation, zRotation = 0;

    public DonutEffect(EffectManager effectManager) {
        super(effectManager);
        type = EffectType.REPEATING;
        period = 10;
        iterations = 20;
    }

    @Override
    public void onRun() {
        Location location = getLocation();
        Vector v = new Vector();
        for (int i = 0; i < circles; i++) {
            double theta = 2 * Math.PI * i / circles;
            for (int j = 0; j < particlesCircle; j++) {
                double phi = 2 * Math.PI * j / particlesCircle;
                double cosPhi = Math.cos(phi);
                v.setX((radiusDonut + radiusTube * cosPhi) * Math.cos(theta));
                v.setY((radiusDonut + radiusTube * cosPhi) * Math.sin(theta));
                v.setZ(radiusTube * Math.sin(phi));

                VectorUtils.rotateVector(v, xRotation, yRotation, zRotation);

                display(particle, location.add(v));
                location.subtract(v);
            }
        }
    }
}


text:
package server

import (
	"fmt"
	"net"

	"github.com/laincloud/lainlet/endpoints"
	pb "github.com/laincloud/lainlet/message"
	"github.com/laincloud/lainlet/watcher"
	"github.com/mijia/sweb/log"
	"google.golang.org/grpc"
	"google.golang.org/grpc/credentials"
)

type Config struct {
	addr string

	keyFile  string
	certFile string
}

type Server struct {
	addr    string
	localIp string
	cfg     *Config

	watchers map[string]watcher.Watcher

	configWatcher    watcher.Watcher
	containerWatcher watcher.Watcher
	podgroupWatcher  watcher.Watcher
	dependsWatcher   watcher.Watcher
	nodesWatcher     watcher.Watcher
}

func NewConfig(addr, key, cert string) *Config {
	return &Config{
		addr:     addr,
		keyFile:  key,
		certFile: cert,
	}
}

func New(addr string, ip string, watchers map[string]watcher.Watcher, cfg *Config) (*Server, error) {
	if cfg != nil {
		if cfg.keyFile == "" || cfg.certFile == "" {
			return nil, fmt.Errorf("keyfile or certfile can't be empty when TLS is enabled.")
		}
	}
	srv := &Server{
		addr:    addr,
		localIp: ip,
		cfg:     cfg,

		watchers: watchers,

		configWatcher:    watchers["configwatcher"],
		containerWatcher: watchers["containerwatcher"],
		podgroupWatcher:  watchers["podgroupwatcher"],
		dependsWatcher:   watchers["dependswatcher"],
		nodesWatcher:     watchers["nodeswatcher"],
	}
	return srv, nil
}

func (srv *Server) Run() {
	lis, err := net.Listen("tcp", srv.addr)
	if err != nil {
		log.Fatalf("failed to listen: %v", err)
	}
	var opts []grpc.ServerOption
	if srv.cfg != nil {
		creds, err := credentials.NewServerTLSFromFile(srv.cfg.certFile, srv.cfg.keyFile)
		if err != nil {
			log.Fatalf("Failed to generate credentials %v", err)
		}
		opts = []grpc.ServerOption{grpc.Creds(creds)}
	}
	grpcServer := grpc.NewServer(opts...)

	pb.RegisterAppnameServer(grpcServer, endpoints.NewAppnameEndpoint())
	pb.RegisterLainletServer(grpcServer, endpoints.NewLainletEndpoint(srv.watchers))

	pb.RegisterAppsServer(grpcServer, endpoints.NewAppsEndpoint(srv.podgroupWatcher))
	pb.RegisterBackupctlServer(grpcServer, endpoints.NewBackupctlEndpoint(srv.podgroupWatcher))
	pb.RegisterConfigServer(grpcServer, endpoints.NewConfigEndpoint(srv.configWatcher))
	pb.RegisterContainersServer(grpcServer, endpoints.NewContainersEndpoint(srv.containerWatcher))
	pb.RegisterCoreinfoServer(grpcServer, endpoints.NewCoreinfoEndpoint(srv.podgroupWatcher))
	pb.RegisterDependsServer(grpcServer, endpoints.NewDependsEndpoint(srv.dependsWatcher))
	pb.RegisterLocalspecServer(grpcServer, endpoints.NewLocalspecEndpoint(srv.containerWatcher, srv.localIp))
	pb.RegisterNodesServer(grpcServer, endpoints.NewNodesEndpoint(srv.nodesWatcher))
	pb.RegisterPodgroupServer(grpcServer, endpoints.NewPodgroupEndpoint(srv.podgroupWatcher))
	pb.RegisterProxyServer(grpcServer, endpoints.NewProxyEndpoint(srv.podgroupWatcher))
	pb.RegisterRebellionLocalprocsServer(grpcServer, endpoints.NewRebellionLocalprocsEndpoint(srv.podgroupWatcher))
	pb.RegisterStreamrouterPortsServer(grpcServer, endpoints.NewStreamrouterPortsEndpoint(srv.podgroupWatcher))
	pb.RegisterStreamrouterStreamprocsServer(grpcServer, endpoints.NewStreamrouterStreamprocsEndpoint(srv.podgroupWatcher))
	pb.RegisterWebrouterWebprocsServer(grpcServer, endpoints.NewWebrouterWebprocsEndpoint(srv.podgroupWatcher))

	grpcServer.Serve(lis)
}


text:
/**
 */
package rgse.ttc17.emoflon.tgg.task1;

import gluemodel.COSEM.PhysicalDevice;

import org.eclipse.emf.ecore.EObject;

import org.moflon.tgg.runtime.AbstractCorrespondence;

import outageDetectionJointarget.EnergyConsumer;
// <-- [user defined imports]
// [user defined imports] -->

/**
 *
 * A representation of the model object 'Physical Device To Energy Consumer'.
 *
 *
 *

 * The following features are supported:
 *

 *
{@link rgse.ttc17.emoflon.tgg.task1.PhysicalDeviceToEnergyConsumer#getSource Source}

 *
{@link rgse.ttc17.emoflon.tgg.task1.PhysicalDeviceToEnergyConsumer#getTarget Target}

 *

 *

 *
 * @see rgse.ttc17.emoflon.tgg.task1.Task1Package#getPhysicalDeviceToEnergyConsumer()
 * @model
 * @generated
 */
public interface PhysicalDeviceToEnergyConsumer extends EObject, AbstractCorrespondence {
	/**
	 * Returns the value of the 'Source' reference.
	 *
	 *

	 * If the meaning of the 'Source' reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Source' reference.
	 * @see #setSource(PhysicalDevice)
	 * @see rgse.ttc17.emoflon.tgg.task1.Task1Package#getPhysicalDeviceToEnergyConsumer_Source()
	 * @model required="true"
	 * @generated
	 */
	PhysicalDevice getSource();

	/**
	 * Sets the value of the '{@link rgse.ttc17.emoflon.tgg.task1.PhysicalDeviceToEnergyConsumer#getSource Source}' reference.
	 *
	 *
	 * @param value the new value of the 'Source' reference.
	 * @see #getSource()
	 * @generated
	 */
	void setSource(PhysicalDevice value);

	/**
	 * Returns the value of the 'Target' reference.
	 *
	 *

	 * If the meaning of the 'Target' reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Target' reference.
	 * @see #setTarget(EnergyConsumer)
	 * @see rgse.ttc17.emoflon.tgg.task1.Task1Package#getPhysicalDeviceToEnergyConsumer_Target()
	 * @model required="true"
	 * @generated
	 */
	EnergyConsumer getTarget();

	/**
	 * Sets the value of the '{@link rgse.ttc17.emoflon.tgg.task1.PhysicalDeviceToEnergyConsumer#getTarget Target}' reference.
	 *
	 *
	 * @param value the new value of the 'Target' reference.
	 * @see #getTarget()
	 * @generated
	 */
	void setTarget(EnergyConsumer value);
	// <-- [user code injected with eMoflon]

	// [user code injected with eMoflon] -->
} // PhysicalDeviceToEnergyConsumer


text:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:tools="http://schemas.android.com/tools"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:paddingBottom="@dimen/activity_vertical_margin"
            android:paddingLeft="@dimen/activity_horizontal_margin"
            android:paddingRight="@dimen/activity_horizontal_margin"
            android:paddingTop="@dimen/activity_vertical_margin"
            tools:context=".MainActivity">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <Button
            android:id="@+id/button_frame_animations"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/frame_animations"
            />

        <Button
            android:id="@+id/button_reveal_animations"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/reveal_animations"
            />

        <Button
            android:id="@+id/button_ripple_effects"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/ripple_effects"
            />

        <Button
            android:id="@+id/button_linear_motion_effects"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/linear_motion_effects"
            />

        <Button
            android:id="@+id/button_curved_motion_effects"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/curved_motion_effects"
            />

        <Button
            android:id="@+id/button_shared_element_transitions"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/shared_element_transitions"
            />

        <Button
            android:id="@+id/button_transitions"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/transitions"
            />

    </LinearLayout>

</ScrollView>


text:
import argparse
from typing import (
    Dict,
    Optional,
    Iterator,
)
from .parser import Parser
from .validate import Validator
from .translator import Translator
from .node import Node

parser = argparse.ArgumentParser(description='Convert BNF grammar to CNF')
parser.add_argument(
    'file',
    nargs=1,
    type=str,
    help=(
        'The file to read the grammar from.'
    ),
)
parser.add_argument(
    '-f',
    '--format',
    choices=['cyk', 'py'],
    default='py',
    nargs='?',
    type=str,
    help=(
        'The output format.  Can be either "cyk" or "py".  "cyk" '
        'outputs the file in CYK format, as a .cyk file.  Py '
        'generates a grammar which can be read by darglint.'
    ),
)
parser.add_argument(
    '-o',
    '--output',
    nargs=1,
    type=str,
    default=None,
    help=(
        'The output file.'
    )
)

class Driver(object):

    def __init__(self):
        self.data = None  # type: Optional[str]
        self.parser = Parser()
        self.validator = Validator()
        self.translator = Translator()
        self.tree = None  # type: Optional[Node]

    def read(self, filename: str) -> 'Driver':
        with open(filename, 'r') as fin:
            self.data = fin.read()
        return self

    def parse(self) -> 'Driver':
        self.tree = self.parser.parse(self.data)
        return self

    def translate(self) -> 'Driver':
        self.translator.translate(self.tree)
        return self

    def validate(self) -> 'Driver':
        self.validator.validate(self.tree)
        return self

    def write(self, _format: str) -> str:
        assert self.tree is not None
        if _format == 'cyk':
            return str(self.tree)
        elif _format == 'py':
            return self.tree.to_python()
        else:
            raise Exception(f'Unrecognized format type {_format}')

    def get_imports(self) -> Iterator[str]:
        assert self.tree is not None
        for _import in self.tree.filter(Node.is_import):
            assert _import.value is not None
            yield _import.value

    def merge(self, driver: 'Driver'):
        """Merge in the grammar at the given filename with this grammar.

        Args:
            driver: Another driver to merge into this one.

        """
        assert self.tree is not None
        assert driver.tree is not None
        self.tree.merge(driver.tree)

def load_script(filename: str, cache: Dict[str, Driver] = dict()):
    """Recursively load a script, parsing it and adding dependencies.

    Args:
        filename: The name of the file to open.
        cache: A cache to avoid duplicate work.

    Returns:
        The fully parsed grammar.

    """
    assert filename not in cache
    driver = Driver().read(filename).parse()
    cache[filename] = driver

    # We know that merging doesn't introduce new imports,
    # so it's safe to immediately merge subgrammars.
    for filename in driver.get_imports():
        if filename in cache:
            # We skip already imported scripts, to avoid
            # having multiple copies of the productions.
            continue
        else:
            subdriver = load_script(filename, cache)
            driver.merge(subdriver)

    return driver

def main():
    args = parser.parse_args()
    driver = load_script(args.file[0])
    translated = driver.translate().validate().write(args.format)

    if args.output:
        with open(args.output[0], 'w') as fout:
            fout.write(translated)
    else:
        print(translated)

if __name__ == '__main__':
    main()


text:
<?php

function google_api_php_client_autoload($className)
{
  $classPath = explode('_', $className);
  if ($classPath[0] != 'Google') {
    return;
  }
  // Drop 'Google', and maximum class file path depth in this project is 3.
  $classPath = array_slice($classPath, 1, 2);

  $filePath = dirname(__FILE__) . '/' . implode('/', $classPath) . '.php';
  if (file_exists($filePath)) {
    require_once($filePath);
  }
}

spl_autoload_register('google_api_php_client_autoload');


text:
package org.spongepowered.test;

import com.google.inject.Inject;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.data.type.HandTypes;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.entity.IgniteEntityEvent;
import org.spongepowered.api.event.filter.Getter;
import org.spongepowered.api.item.ItemTypes;
import org.spongepowered.api.plugin.Plugin;
import org.spongepowered.api.plugin.PluginContainer;

@Plugin(authors = "gabizou", name = "Ignite Test", id = "ignitetest", description = IgniteEventTest.DESCRIPTION, version = "0.0.0")
public class IgniteEventTest implements LoadableModule {

    public static final String DESCRIPTION = "A test plugin to test setting the ignited entities on command";

    @Inject private PluginContainer container;

    private final IgniteEventListener listener = new IgniteEventListener();

    @Override
    public void enable(CommandSource src) {
        Sponge.getEventManager().registerListeners(this.container, this.listener);
    }

    public static class IgniteEventListener {

        @Listener
        public void onIgnite(IgniteEntityEvent entityEvent, @Getter("getTargetEntity") Player player) {
            player.getItemInHand(HandTypes.MAIN_HAND).ifPresent(item -> {
                if (item.getType() == ItemTypes.BLAZE_ROD) {
                    entityEvent.setFireTicks(600);
                }
            });
        }
    }

}


text:
#pragma once

#include <string>
#include <vector>

#include <test/testfw/core/Test.h>
#include <dp/util/DynamicLibrary.h>

namespace dp
{
  namespace testfw
  {
    namespace core
    {

      enum TestReturnFlag
      {
          TRF_PASSED = 0
        , TRF_FAILED = 1
        , TRF_INVALID_INPUT = 2
      };

      class TestObject
      {
        friend DPTCORE_API bool loadTest( const std::string & filename, std::vector<TestObject>& testOut );

      public:
        typedef Test * (*TestCreateFunc)();

      public:
        DPTCORE_API TestObject( TestCreateFunc testCreator, const std::string& name, const std::string& desc );
        DPTCORE_API TestObject( TestCreateFunc testCreator, const dp::util::DynamicLibrarySharedPtr& dynLib );

      public:
        DPTCORE_API TestObject( const TestObject& rhs );
        DPTCORE_API ~TestObject();

        DPTCORE_API TestReturnFlag run( MeasurementFunctor& mf, const std::vector<std::string>& options = std::vector<std::string>() );

        const std::string& getName(){ return m_name; }
        const std::string& getDescription(){ return m_description; }

      private:
        TestCreateFunc m_testCreator;
        dp::util::DynamicLibrarySharedPtr m_dynLib;

        std::string m_name;
        std::string m_description;
      };

    } //namespace core
  } //namespace testfw
} //namespace dp


text:
namespace views {
class ImageView;
}

namespace ash {
class TrayItemView;

// A system tray item that uses an image as its "tray view" in the status area.
class ASH_EXPORT TrayImageItem : public SystemTrayItem {
 public:
  TrayImageItem(SystemTray* system_tray, int resource_id, UmaType uma_type);
  ~TrayImageItem() override;

  views::View* tray_view();

 protected:
  virtual bool GetInitialVisibility() = 0;

  // Overridden from SystemTrayItem.
  views::View* CreateTrayView(LoginStatus status) override;
  views::View* CreateDefaultView(LoginStatus status) override;
  views::View* CreateDetailedView(LoginStatus status) override;
  void DestroyTrayView() override;
  void DestroyDefaultView() override;
  void DestroyDetailedView() override;
  void UpdateAfterLoginStatusChange(LoginStatus status) override;
  void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override;

  // Sets the color of the material design icon to |color|.
  void SetIconColor(SkColor color);

  // Changes the icon of the tray-view to the specified resource.
  // TODO(tdanderson): This is only used for non-material design, so remove it
  // when material design is the default. See crbug.com/625692.
  void SetImageFromResourceId(int resource_id);

 private:
  // Sets the current icon on |tray_view_|'s ImageView.
  void UpdateImageOnImageView();

  // The resource ID for the non-material design icon in the tray.
  // TODO(tdanderson): This is only used for non-material design, so remove it
  // when material design is the default. See crbug.com/625692.
  int resource_id_;

  // The color of the material design icon in the tray.
  SkColor icon_color_;

  // The image view in the tray.
  TrayItemView* tray_view_;

  DISALLOW_COPY_AND_ASSIGN(TrayImageItem);
};

}  // namespace ash

#endif  // ASH_COMMON_SYSTEM_TRAY_TRAY_IMAGE_ITEM_H_


text:
.class public Lcom/android/internal/telephony/ConferenceCallXml$User;
.super Ljava/lang/Object;
.source "ConferenceCallXml.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/internal/telephony/ConferenceCallXml;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1
    name = "User"
.end annotation

# instance fields
.field private mDisplayText:Ljava/lang/String;

.field private mEntity:Ljava/lang/String;

.field private mIndex:I

.field private mSipTelUri:Ljava/lang/String;

.field private mStatus:Ljava/lang/String;

.field final synthetic this$0:Lcom/android/internal/telephony/ConferenceCallXml;

# direct methods
.method public constructor <init>(Lcom/android/internal/telephony/ConferenceCallXml;)V
    .locals 0

    .prologue
    .line 40
    iput-object p1, p0, Lcom/android/internal/telephony/ConferenceCallXml$User;->this$0:Lcom/android/internal/telephony/ConferenceCallXml;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public getDisplayText()Ljava/lang/String;
    .locals 1

    .prologue
    .line 76
    iget-object v0, p0, Lcom/android/internal/telephony/ConferenceCallXml$User;->mDisplayText:Ljava/lang/String;

    return-object v0
.end method

.method public getEntity()Ljava/lang/String;
    .locals 1

    .prologue
    .line 68
    iget-object v0, p0, Lcom/android/internal/telephony/ConferenceCallXml$User;->mEntity:Ljava/lang/String;

    return-object v0
.end method

.method public getIndex()I
    .locals 1

    .prologue
    .line 84
    iget v0, p0, Lcom/android/internal/telephony/ConferenceCallXml$User;->mIndex:I

    return v0
.end method

.method public getSipTelUri()Ljava/lang/String;
    .locals 1

    .prologue
    .line 72
    iget-object v0, p0, Lcom/android/internal/telephony/ConferenceCallXml$User;->mSipTelUri:Ljava/lang/String;

    return-object v0
.end method

.method public getStatus()Ljava/lang/String;
    .locals 1

    .prologue
    .line 80
    iget-object v0, p0, Lcom/android/internal/telephony/ConferenceCallXml$User;->mStatus:Ljava/lang/String;

    return-object v0
.end method

.method setDisplayText(Ljava/lang/String;)V
    .locals 0
    .param p1, "displayText"    # Ljava/lang/String;

    .prologue
    .line 56
    iput-object p1, p0, Lcom/android/internal/telephony/ConferenceCallXml$User;->mDisplayText:Ljava/lang/String;

    .line 57
    return-void
.end method

.method setEntity(Ljava/lang/String;)V
    .locals 0
    .param p1, "entity"    # Ljava/lang/String;

    .prologue
    .line 48
    iput-object p1, p0, Lcom/android/internal/telephony/ConferenceCallXml$User;->mEntity:Ljava/lang/String;

    .line 49
    return-void
.end method

.method setIndex(I)V
    .locals 0
    .param p1, "index"    # I

    .prologue
    .line 64
    iput p1, p0, Lcom/android/internal/telephony/ConferenceCallXml$User;->mIndex:I

    .line 65
    return-void
.end method

.method setSipTelUri(Ljava/lang/String;)V
    .locals 0
    .param p1, "uri"    # Ljava/lang/String;

    .prologue
    .line 52
    iput-object p1, p0, Lcom/android/internal/telephony/ConferenceCallXml$User;->mSipTelUri:Ljava/lang/String;

    .line 53
    return-void
.end method

.method setStatus(Ljava/lang/String;)V
    .locals 0
    .param p1, "status"    # Ljava/lang/String;

    .prologue
    .line 60
    iput-object p1, p0, Lcom/android/internal/telephony/ConferenceCallXml$User;->mStatus:Ljava/lang/String;

    .line 61
    return-void
.end method


text:
#include "../natives.h"

#include "../core.h"

#include <boost/scoped_ptr.hpp>

cell AMX_NATIVE_CALL Natives::Streamer_CallbackHook(AMX *amx, cell *params)
{
	return 0;
}

cell AMX_NATIVE_CALL Natives::DestroyAllDynamicObjects(AMX *amx, cell *params)
{
	cell newParams[3] = { sizeof(cell) * 2, STREAMER_TYPE_OBJECT, 1 };
	return Natives::Streamer_DestroyAllItems(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::CountDynamicObjects(AMX *amx, cell *params)
{
	cell newParams[3] = { sizeof(cell) * 2, STREAMER_TYPE_OBJECT, 1 };
	return Natives::Streamer_CountItems(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::DestroyAllDynamicPickups(AMX *amx, cell *params)
{
	cell newParams[3] = { sizeof(cell) * 2, STREAMER_TYPE_PICKUP, 1 };
	return Natives::Streamer_DestroyAllItems(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::CountDynamicPickups(AMX *amx, cell *params)
{
	cell newParams[3] = { sizeof(cell) * 2, STREAMER_TYPE_PICKUP, 1 };
	return Natives::Streamer_CountItems(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::DestroyAllDynamicCPs(AMX *amx, cell *params)
{
	cell newParams[3] = { sizeof(cell) * 2, STREAMER_TYPE_CP, 1 };
	return Natives::Streamer_DestroyAllItems(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::CountDynamicCPs(AMX *amx, cell *params)
{
	cell newParams[3] = { sizeof(cell) * 2, STREAMER_TYPE_CP, 1 };
	return Natives::Streamer_CountItems(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::DestroyAllDynamicRaceCPs(AMX *amx, cell *params)
{
	cell newParams[3] = { sizeof(cell) * 2, STREAMER_TYPE_RACE_CP, 1 };
	return Natives::Streamer_DestroyAllItems(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::CountDynamicRaceCPs(AMX *amx, cell *params)
{
	cell newParams[3] = { sizeof(cell) * 2, STREAMER_TYPE_RACE_CP, 1 };
	return Natives::Streamer_CountItems(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::DestroyAllDynamicMapIcons(AMX *amx, cell *params)
{
	cell newParams[3] = { sizeof(cell) * 2, STREAMER_TYPE_MAP_ICON, 1 };
	return Natives::Streamer_DestroyAllItems(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::CountDynamicMapIcons(AMX *amx, cell *params)
{
	cell newParams[3] = { sizeof(cell) * 2, STREAMER_TYPE_MAP_ICON, 1 };
	return Natives::Streamer_CountItems(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::DestroyAllDynamic3DTextLabels(AMX *amx, cell *params)
{
	cell newParams[3] = { sizeof(cell) * 2, STREAMER_TYPE_3D_TEXT_LABEL, 1 };
	return Natives::Streamer_DestroyAllItems(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::CountDynamic3DTextLabels(AMX *amx, cell *params)
{
	cell newParams[3] = { sizeof(cell) * 2, STREAMER_TYPE_3D_TEXT_LABEL, 1 };
	return Natives::Streamer_CountItems(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::DestroyAllDynamicAreas(AMX *amx, cell *params)
{
	cell newParams[3] = { sizeof(cell) * 2, STREAMER_TYPE_AREA, 1 };
	return Natives::Streamer_DestroyAllItems(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::CountDynamicAreas(AMX *amx, cell *params)
{
	cell newParams[3] = { sizeof(cell) * 2, STREAMER_TYPE_AREA, 1 };
	return Natives::Streamer_CountItems(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::TogglePlayerDynamicCP(AMX *amx, cell *params)
{
	cell newParams[5] = { sizeof(cell) * 4, params[1], STREAMER_TYPE_CP, params[2], params[3] };
	return Natives::Streamer_ToggleItem(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::TogglePlayerAllDynamicCPs(AMX *amx, cell *params)
{
	cell newParams[6] = { sizeof(cell) * 5, params[1], STREAMER_TYPE_CP, params[2], params[3], params[4] };
	return Natives::Streamer_ToggleAllItems(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::TogglePlayerDynamicRaceCP(AMX *amx, cell *params)
{
	cell newParams[5] = { sizeof(cell) * 4, params[1], STREAMER_TYPE_RACE_CP, params[2], params[3] };
	return Natives::Streamer_ToggleItem(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::TogglePlayerAllDynamicRaceCPs(AMX *amx, cell *params)
{
	cell newParams[6] = { sizeof(cell) * 5, params[1], STREAMER_TYPE_RACE_CP, params[2], params[3], params[4] };
	return Natives::Streamer_ToggleAllItems(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::TogglePlayerDynamicArea(AMX *amx, cell *params)
{
	cell newParams[5] = { sizeof(cell) * 4, params[1], STREAMER_TYPE_AREA, params[2], params[3] };
	return Natives::Streamer_ToggleItem(amx, newParams);
}

cell AMX_NATIVE_CALL Natives::TogglePlayerAllDynamicAreas(AMX *amx, cell *params)
{
	cell newParams[6] = { sizeof(cell) * 5, params[1], STREAMER_TYPE_AREA, params[2], params[3], params[4] };
	return Natives::Streamer_ToggleAllItems(amx, newParams);
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Cotyledon fergusoniae L.Bolus

### Remarks
null


text:
//  Copyright 2004 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.apache.tapestry.util.xml;

import org.apache.tapestry.Tapestry;
import org.xml.sax.Attributes;

/**
 * Base implementation of {@link org.apache.tapestry.util.xml.IRule} that
 * does nothing.
 *
 * @author Howard Lewis Ship
 * @version $Id$
 * @since 3.0
 **/
public class BaseRule implements IRule
{
	protected String getAttribute(Attributes attributes, String name)
	{
		int count = attributes.getLength();

		for (int i = 0; i < count; i++)
		{
			String attributeName = attributes.getLocalName(i);

			if (Tapestry.isBlank(attributeName))
				attributeName = attributes.getQName(i);

			if (attributeName.equals(name))
				return attributes.getValue(i);
		}

		return null;
	}

    public void startElement(RuleDirectedParser parser, Attributes attributes)
    {

    }

    public void endElement(RuleDirectedParser parser)
    {

    }

    public void content(RuleDirectedParser parser, String content)
    {

    }

}


text:
from blog.models import Category

def get_categories(request):
    return {
        'categories': Category.objects.filter(post__active=True).distinct()
    }


text:
<?php

namespace Tests\Fixtures;

$dir = 'vendor/';
var_dump(scandir($dir));
require 'vendor/autoload.php';

use Guzzle\Http\Client;

$postBody = file_get_contents(__DIR__ . '/../Fixtures/testData.json');

$client = new Client('http://54.67.71.88');
$request = $client->post('/broadcast', [], $postBody);
$response = $request->send();
echo $response->getBody();