text:
package k8s

import (
	"testing"

	"github.com/stretchr/testify/assert"
	corev1 "k8s.io/api/core/v1"
	v1 "k8s.io/api/networking/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func Test_detectChanges(t *testing.T) {
	tests := []struct {
		name   string
		oldObj interface{}
		newObj interface{}
		want   bool
	}{
		{
			name: "With nil values",
			want: true,
		},
		{
			name:   "With empty endpoints",
			oldObj: &corev1.Endpoints{},
			newObj: &corev1.Endpoints{},
		},
		{
			name:   "With old nil",
			newObj: &corev1.Endpoints{},
			want:   true,
		},
		{
			name:   "With new nil",
			oldObj: &corev1.Endpoints{},
			want:   true,
		},
		{
			name: "With same version",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
			},
		},
		{
			name: "With different version",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
			},
		},
		{
			name: "Ingress With same version",
			oldObj: &v1.Ingress{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
			},
			newObj: &v1.Ingress{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
			},
		},
		{
			name: "Ingress With different version",
			oldObj: &v1.Ingress{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
			},
			newObj: &v1.Ingress{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
			},
			want: true,
		},
		{
			name: "With same annotations",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
					Annotations: map[string]string{
						"test-annotation": "_",
					},
				},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
					Annotations: map[string]string{
						"test-annotation": "_",
					},
				},
			},
		},
		{
			name: "With different annotations",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
					Annotations: map[string]string{
						"test-annotation": "V",
					},
				},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
					Annotations: map[string]string{
						"test-annotation": "X",
					},
				},
			},
		},
		{
			name: "With same subsets",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{},
			},
		},
		{
			name: "With different len of subsets",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
				Subsets: []corev1.EndpointSubset{{}},
			},
			want: true,
		},
		{
			name: "With same subsets with same len of addresses",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{{
					Addresses: []corev1.EndpointAddress{},
				}},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
				Subsets: []corev1.EndpointSubset{{
					Addresses: []corev1.EndpointAddress{},
				}},
			},
		},
		{
			name: "With same subsets with different len of addresses",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{{
					Addresses: []corev1.EndpointAddress{},
				}},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
				Subsets: []corev1.EndpointSubset{{
					Addresses: []corev1.EndpointAddress{{}},
				}},
			},
			want: true,
		},
		{
			name: "With same subsets with same len of ports",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{{
					Ports: []corev1.EndpointPort{},
				}},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
				Subsets: []corev1.EndpointSubset{{
					Ports: []corev1.EndpointPort{},
				}},
			},
		},
		{
			name: "With same subsets with different len of ports",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{{
					Ports: []corev1.EndpointPort{},
				}},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
				Subsets: []corev1.EndpointSubset{{
					Ports: []corev1.EndpointPort{{}},
				}},
			},
			want: true,
		},
		{
			name: "With same subsets with same len of addresses with same ip",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{{
					Addresses: []corev1.EndpointAddress{{
						IP: "10.10.10.10",
					}},
				}},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
				Subsets: []corev1.EndpointSubset{{
					Addresses: []corev1.EndpointAddress{{
						IP: "10.10.10.10",
					}},
				}},
			},
		},
		{
			name: "With same subsets with same len of addresses with different ip",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{{
					Addresses: []corev1.EndpointAddress{{
						IP: "10.10.10.10",
					}},
				}},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
				Subsets: []corev1.EndpointSubset{{
					Addresses: []corev1.EndpointAddress{{
						IP: "10.10.10.42",
					}},
				}},
			},
			want: true,
		},
		{
			name: "With same subsets with same len of addresses with same hostname",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{{
					Addresses: []corev1.EndpointAddress{{
						Hostname: "foo",
					}},
				}},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
				Subsets: []corev1.EndpointSubset{{
					Addresses: []corev1.EndpointAddress{{
						Hostname: "foo",
					}},
				}},
			},
		},
		{
			name: "With same subsets with same len of addresses with same hostname",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{{
					Addresses: []corev1.EndpointAddress{{
						Hostname: "foo",
					}},
				}},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
				Subsets: []corev1.EndpointSubset{{
					Addresses: []corev1.EndpointAddress{{
						Hostname: "bar",
					}},
				}},
			},
			want: true,
		},
		{
			name: "With same subsets with same len of port with same name",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{{
					Ports: []corev1.EndpointPort{{
						Name: "foo",
					}},
				}},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
				Subsets: []corev1.EndpointSubset{{
					Ports: []corev1.EndpointPort{{
						Name: "foo",
					}},
				}},
			},
		},
		{
			name: "With same subsets with same len of port with different name",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{{
					Ports: []corev1.EndpointPort{{
						Name: "foo",
					}},
				}},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
				Subsets: []corev1.EndpointSubset{{
					Ports: []corev1.EndpointPort{{
						Name: "bar",
					}},
				}},
			},
			want: true,
		},
		{
			name: "With same subsets with same len of port with same port",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{{
					Ports: []corev1.EndpointPort{{
						Port: 4242,
					}},
				}},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
				Subsets: []corev1.EndpointSubset{{
					Ports: []corev1.EndpointPort{{
						Port: 4242,
					}},
				}},
			},
		},
		{
			name: "With same subsets with same len of port with different port",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{{
					Ports: []corev1.EndpointPort{{
						Port: 4242,
					}},
				}},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
				Subsets: []corev1.EndpointSubset{{
					Ports: []corev1.EndpointPort{{
						Port: 6969,
					}},
				}},
			},
			want: true,
		},
		{
			name: "With same subsets with same len of port with same protocol",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{{
					Ports: []corev1.EndpointPort{{
						Protocol: "HTTP",
					}},
				}},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
				Subsets: []corev1.EndpointSubset{{
					Ports: []corev1.EndpointPort{{
						Protocol: "HTTP",
					}},
				}},
			},
		},
		{
			name: "With same subsets with same len of port with different protocol",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{{
					Ports: []corev1.EndpointPort{{
						Protocol: "HTTP",
					}},
				}},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
				Subsets: []corev1.EndpointSubset{{
					Ports: []corev1.EndpointPort{{
						Protocol: "TCP",
					}},
				}},
			},
			want: true,
		},
		{
			name: "With same subsets with same subset",
			oldObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "1",
				},
				Subsets: []corev1.EndpointSubset{{
					Addresses: []corev1.EndpointAddress{{
						IP:       "10.10.10.10",
						Hostname: "foo",
					}},
					Ports: []corev1.EndpointPort{{
						Name:     "bar",
						Port:     4242,
						Protocol: "HTTP",
					}},
				}},
			},
			newObj: &corev1.Endpoints{
				ObjectMeta: metav1.ObjectMeta{
					ResourceVersion: "2",
				},
				Subsets: []corev1.EndpointSubset{{
					Addresses: []corev1.EndpointAddress{{
						IP:       "10.10.10.10",
						Hostname: "foo",
					}},
					Ports: []corev1.EndpointPort{{
						Name:     "bar",
						Port:     4242,
						Protocol: "HTTP",
					}},
				}},
			},
		},
	}
	for _, test := range tests {
		test := test
		t.Run(test.name, func(t *testing.T) {
			t.Parallel()

			assert.Equal(t, test.want, objChanged(test.oldObj, test.newObj))
		})
	}
}


text:
"""Airflow DAG for TCRM workflow.

This DAG will transfer data from BigQuery to Campaign Manager (DCM).

This DAG relies on the following Airflow variables:
* `cm_profile_id`:    Profile id of the service account user in CM.
* `cm_service_account`:  Service account authorized as Campaign Manager user.
* `bq_dataset_id`:    BigQuery dataset name. Ex: `my_dataset`.
* `bq_table_id`:      BigQuery table name which holds the data. Ex: `my_table`

Refer to https://airflow.apache.org/concepts.html#variables for more on Airflow
Variables.
"""

import os
from typing import Optional

from airflow.models import dag

from dags import base_dag
from plugins.pipeline_plugins.operators import data_connector_operator
from plugins.pipeline_plugins.utils import hook_factory

# Airflow configuration variables.
_AIRFLOW_ENV = 'AIRFLOW_HOME'

# Airflow DAG configurations.
_DAG_NAME = 'tcrm_bq_to_cm'

# BigQuery connection ID. Refer to
# https://cloud.google.com/composer/docs/how-to/managing/connections
# for more details on Managing Airflow connections.
_BQ_CONN_ID = 'bigquery_default'

class BigQueryToCMDag(base_dag.BaseDag):
  """BigQuery to Campaign Manager DAG."""

  def create_task(
      self,
      main_dag: Optional[dag.DAG] = None,
      is_retry: bool = False) -> data_connector_operator.DataConnectorOperator:
    """Creates and initializes the main DAG.

    Args:
      main_dag: The dag that the task attaches to.
      is_retry: Whether or not the operator should includ a retry task.

    Returns:
      DataConnectorOperator.
    """
    return data_connector_operator.DataConnectorOperator(
        dag_name=_DAG_NAME,
        task_id=self.get_task_id('bq_to_cm', is_retry),
        input_hook=hook_factory.InputHookType.BIG_QUERY,
        output_hook=(hook_factory.OutputHookType
                     .GOOGLE_CAMPAIGN_MANAGER_OFFLINE_CONVERSIONS),
        is_retry=is_retry,
        return_report=self.dag_enable_run_report,
        enable_monitoring=self.dag_enable_monitoring,
        monitoring_dataset=self.monitoring_dataset,
        monitoring_table=self.monitoring_table,
        monitoring_bq_conn_id=self.monitoring_bq_conn_id,
        bq_conn_id=_BQ_CONN_ID,
        bq_dataset_id=self.get_variable_value(_DAG_NAME, 'bq_dataset_id'),
        bq_table_id=self.get_variable_value(_DAG_NAME, 'bq_table_id'),
        cm_service_account=self.get_variable_value(_DAG_NAME,
                                                   'cm_service_account'),
        cm_profile_id=self.get_variable_value(_DAG_NAME, 'cm_profile_id'),
        dag=main_dag)  # pytype: disable=wrong-arg-types

if os.getenv(_AIRFLOW_ENV):
  dag = BigQueryToCMDag(_DAG_NAME).create_dag()

redpajama_set_name: RedPajamaGithub


text:
/**
 * InstrumentLookup.java
 * @author Vagisha Sharma
 * Sep 22, 2010
 */
package org.yeastrc.jqs.queue.ws;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import org.yeastrc.db.DBConnectionManager;

/**
 *
 */
public class InstrumentLookup {

	private static InstrumentLookup instance = new InstrumentLookup();

	private InstrumentLookup() {}

	public static InstrumentLookup getInstance() {
		return instance;
	}

	public int forName(String instrumentName) throws SQLException {

		Connection conn = null;
		Statement stmt = null;
		ResultSet rs = null;

		try {

			conn = DBConnectionManager.getConnection(DBConnectionManager.MS_DATA);
			String sql = "SELECT id FROM msInstrument WHERE name = \""+instrumentName+"\"";
			stmt = conn.createStatement();
			rs = stmt.executeQuery( sql );

			if(rs.next()) {
				return rs.getInt(1);
			}

			return 0;

		} finally {

			if (rs != null) {
				try { rs.close(); rs = null; } catch (Exception e) { ; }
			}

			if (stmt != null) {
				try { stmt.close(); stmt = null; } catch (Exception e) { ; }
			}

			if (conn != null) {
				try { conn.close(); conn = null; } catch (Exception e) { ; }
			}
		}
	}

	public String nameForId(int instrumentId) throws SQLException {

		Connection conn = null;
		Statement stmt = null;
		ResultSet rs = null;

		try {

			conn = DBConnectionManager.getConnection(DBConnectionManager.MS_DATA);
			String sql = "SELECT name FROM msInstrument WHERE id = \""+instrumentId+"\"";
			stmt = conn.createStatement();
			rs = stmt.executeQuery( sql );

			if(rs.next()) {
				return rs.getString(1);
			}

			return null;

		} finally {

			if (rs != null) {
				try { rs.close(); rs = null; } catch (Exception e) { ; }
			}

			if (stmt != null) {
				try { stmt.close(); stmt = null; } catch (Exception e) { ; }
			}

			if (conn != null) {
				try { conn.close(); conn = null; } catch (Exception e) { ; }
			}
		}
	}

}


text:
@implementation UIColor (Components)

-(CGFloat)red {
    const CGFloat * components = CGColorGetComponents(self.CGColor);
    return components[0];
}
-(CGFloat)green {
    const CGFloat * components = CGColorGetComponents(self.CGColor);
    return components[1];
}
-(CGFloat)blue {
    const CGFloat * components = CGColorGetComponents(self.CGColor);
    return components[2];
}
-(CGFloat)alpha {
    const CGFloat * components = CGColorGetComponents(self.CGColor);
    return components[3];
}

@end


text:
/*
 * EmojiSelector
 */

import { FC, memo, Fragment } from 'react'
import { buildLog } from '@/utils/logger'

import type { TEmotion, TEmotionType } from '@/spec'

import { getEmotionName } from '../helper'
import EmotionUnit from './EmotionUnit'
/* eslint-disable-next-line */
const log = buildLog('c:SelectedEmotions:index')

type TProps = {
  emotions: TEmotion[]
  onAction?: (name: TEmotionType, hasEmotioned: boolean) => void
}

const SelectedEmotions: FC<TProps> = ({ emotions, onAction }) => {
  return (
    <Fragment>
      {emotions.map((item) => {
        const name = getEmotionName(item) as string

        return <EmotionUnit key={name} item={item} onAction={onAction} />
      })}
    </Fragment>
  )
}

export default memo(SelectedEmotions)


text:
package rd.com.huma.jenkins.nexus_version_finder.model;

import java.util.HashMap;
import java.util.Map;
import javax.annotation.Generated;
import org.codehaus.jackson.annotate.JsonAnyGetter;
import org.codehaus.jackson.annotate.JsonAnySetter;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.annotate.JsonPropertyOrder;
import org.codehaus.jackson.map.annotate.JsonSerialize;

@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@Generated("org.jsonschema2pojo")
@JsonPropertyOrder({
"repositoryId",
"repositoryName",
"repositoryContentClass",
"repositoryKind",
"repositoryPolicy",
"repositoryURL"
})
public class RepoDetails {

@JsonProperty("repositoryId")
private String repositoryId;
@JsonProperty("repositoryName")
private String repositoryName;
@JsonProperty("repositoryContentClass")
private String repositoryContentClass;
@JsonProperty("repositoryKind")
private String repositoryKind;
@JsonProperty("repositoryPolicy")
private String repositoryPolicy;
@JsonProperty("repositoryURL")
private String repositoryURL;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();

/**
*
* @return
* The repositoryId
*/
@JsonProperty("repositoryId")
public String getRepositoryId() {
return repositoryId;
}

/**
*
* @param repositoryId
* The repositoryId
*/
@JsonProperty("repositoryId")
public void setRepositoryId(String repositoryId) {
this.repositoryId = repositoryId;
}

/**
*
* @return
* The repositoryName
*/
@JsonProperty("repositoryName")
public String getRepositoryName() {
return repositoryName;
}

/**
*
* @param repositoryName
* The repositoryName
*/
@JsonProperty("repositoryName")
public void setRepositoryName(String repositoryName) {
this.repositoryName = repositoryName;
}

/**
*
* @return
* The repositoryContentClass
*/
@JsonProperty("repositoryContentClass")
public String getRepositoryContentClass() {
return repositoryContentClass;
}

/**
*
* @param repositoryContentClass
* The repositoryContentClass
*/
@JsonProperty("repositoryContentClass")
public void setRepositoryContentClass(String repositoryContentClass) {
this.repositoryContentClass = repositoryContentClass;
}

/**
*
* @return
* The repositoryKind
*/
@JsonProperty("repositoryKind")
public String getRepositoryKind() {
return repositoryKind;
}

/**
*
* @param repositoryKind
* The repositoryKind
*/
@JsonProperty("repositoryKind")
public void setRepositoryKind(String repositoryKind) {
this.repositoryKind = repositoryKind;
}

/**
*
* @return
* The repositoryPolicy
*/
@JsonProperty("repositoryPolicy")
public String getRepositoryPolicy() {
return repositoryPolicy;
}

/**
*
* @param repositoryPolicy
* The repositoryPolicy
*/
@JsonProperty("repositoryPolicy")
public void setRepositoryPolicy(String repositoryPolicy) {
this.repositoryPolicy = repositoryPolicy;
}

/**
*
* @return
* The repositoryURL
*/
@JsonProperty("repositoryURL")
public String getRepositoryURL() {
return repositoryURL;
}

/**
*
* @param repositoryURL
* The repositoryURL
*/
@JsonProperty("repositoryURL")
public void setRepositoryURL(String repositoryURL) {
this.repositoryURL = repositoryURL;
}

@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}

@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}

}


text:
#include "stdafx.h"
#include "MainFramework.h"

#include "SpawnSystem.h"
#include "LightControlSystem.h"
#include "SwirlyLightSystem.h"
#include "CelestialBodySystem.h"
#include "PlaylistSystem.h"
#include "FreeCamera.h"

#include <EtCore/Content/ResourceManager.h>

#include <EtFramework/SceneGraph/UnifiedScene.h>
#include <EtFramework/SceneGraph/SceneEvents.h>

#include <Common/CustomTestAsset.h>
#include <Common/DemoUI.h>

namespace et {
namespace demo {

//================
// Main Framework
//================

//-----------------------------
// MainFramework::OnSystemInit
//
void MainFramework::OnSystemInit()
{
	fw::EcsController& ecs = fw::UnifiedScene::Instance().GetEcs();

	ecs.RegisterSystem<FreeCameraSystem>();
	ecs.RegisterSystem<SpawnSystem>();
	ecs.RegisterSystem<LightControlSystem>();
	ecs.RegisterSystem<SwirlyLightSystem>();
	ecs.RegisterSystem<CelestialBodySystem>();
	ecs.RegisterSystem<PlaylistSystem>();
	ecs.RegisterSystem<DemoUISystem>();
}

//--------------------------
// MainFramework::OnInit
//
void MainFramework::OnInit()
{
	// scenes
	fw::UnifiedScene::Instance().GetEventDispatcher().Register( fw::E_SceneEvent::Activated,
		fw::T_SceneEventCallback([this](fw::T_SceneEventFlags const flags, fw::SceneEventData const* const evnt)
			{
				ET_UNUSED(flags);
				ET_UNUSED(evnt);
				OnSceneActivated();
				DemoUI::OnSceneActivated();
			}));

	// gui
	DemoUI::SetupDataModels();

	// custom asset loading
	AssetPtr<TestData> m_TestAsset = core::ResourceManager::Instance()->GetAssetData<TestData>(core::HashString("test.txt"));
	ET_ASSERT(m_TestAsset != nullptr);

	LOG(FS("Custom Assets:\n\t%s", std::string(m_TestAsset->GetText(), m_TestAsset->GetLength()).c_str()));
}

//--------------------------
// MainFramework::OnTick
//
// Demo specific updates independent of scene
//
void MainFramework::OnTick()
{
	fw::UnifiedScene& uniScene = fw::UnifiedScene::Instance();
	core::InputManager* const input = core::InputManager::GetInstance();

	// Scene switching
	//-----------------
	if(input->GetKeyState(E_KbdKey::F3) == E_KeyState::Pressed)
	{
		std::vector<core::HashString> const& scenes = GetSceneIds();
		if (--m_CurrentScene >= scenes.size())
		{
			m_CurrentScene = scenes.size() - 1;
		}

		uniScene.LoadScene(scenes[m_CurrentScene]);
	}

	if(input->GetKeyState(E_KbdKey::F4) == E_KeyState::Pressed)
	{
		std::vector<core::HashString> const& scenes = GetSceneIds();
		m_CurrentScene = (m_CurrentScene + 1) % scenes.size();

		uniScene.LoadScene(scenes[m_CurrentScene]);
	}

	// Screenshots
	//-------------
	if (input->GetKeyState(E_KbdKey::F12) == E_KeyState::Pressed)
	{
		m_ScreenshotCapture.Take(render::Viewport::GetCurrentViewport());
	}

	// view
	//------
	bool const up = (input->GetKeyState(E_KbdKey::Up) == E_KeyState::Down);
	if (up || (input->GetKeyState(E_KbdKey::Down) == E_KeyState::Down))
	{
		render::Scene& renderScene = uniScene.GetRenderScene();
		render::PostProcessingSettings ppSettings = renderScene.GetPostProcessingSettings();

		float const newExp = ppSettings.exposure * 4.f;
		ppSettings.exposure += (newExp - ppSettings.exposure) * TIME->DeltaTime() * (up ? 1.f : -1.f);

		LOG(FS("Exposure: %f", ppSettings.exposure));

		renderScene.SetPostProcessingSettings(ppSettings);
	}
}

//---------------------------------
// MainFramework::OnSceneActivated
//
// Keep track of current scene for switching and set up the camera
//
void MainFramework::OnSceneActivated()
{
	// active scene as loaded by boot config
	std::vector<core::HashString> const& scenes = GetSceneIds();
	auto foundSceneIt = std::find(scenes.cbegin(), scenes.cend(), fw::UnifiedScene::Instance().GetSceneId());
	ET_ASSERT(foundSceneIt != scenes.cend());
	m_CurrentScene = foundSceneIt - scenes.cbegin();

	// set up camera
	fw::EcsController& ecs = fw::UnifiedScene::Instance().GetEcs();
	fw::T_EntityId const camEnt = fw::UnifiedScene::Instance().GetActiveCamera();

	ET_ASSERT(camEnt != fw::INVALID_ENTITY_ID);
	ET_ASSERT(!ecs.HasComponent<FreeCameraComponent>(camEnt));

	ecs.AddComponents(camEnt, FreeCameraComponent());
}

} // namespace demo
} // namespace et


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Boletín de la Soc. Ciencias de Córdoba 25: 108 (1921)

#### Original name
Septoria podanthi Speg.

### Remarks
null


text:
<?xml version="1.0" encoding="UTF-8"?>

<rootTag>
  <Award>
    <AwardTitle>PostDoctoral Research Fellowship</AwardTitle>
    <AwardEffectiveDate>08/01/2015</AwardEffectiveDate>
    <AwardExpirationDate>07/31/2019</AwardExpirationDate>
    <AwardAmount>150000</AwardAmount>
    <AwardInstrument>
      <Value>Fellowship</Value>
    </AwardInstrument>
    <Organization>
      03040000
      <Directorate>
        <LongName>Direct For Mathematical & Physical Scien</LongName>
      </Directorate>
      <Division>
        <LongName>Division Of Mathematical Sciences</LongName>
      </Division>
    </Organization>
    <ProgramOfficer>
      <SignBlockName>Bruce P. Palka</SignBlockName>
    </ProgramOfficer>
    <AbstractNarration>This award is made as part of the FY 2015 Mathematical Sciences Postdoctoral Research Fellowships Program. Each of the fellowships supports a research and training project at a host institution in the mathematical sciences, including applications to other disciplines, under the mentorship of a sponsoring scientist. The title of the project for this fellowship to Andrew J. Manion is "Knot Homology Theories and Quantum Representations." The host institution for the fellowship is the University of California-Los Angeles, and the sponsoring scientist is Dr. Ciprian Manolescu.</AbstractNarration>
    <MinAmdLetterDate>03/13/2015</MinAmdLetterDate>
    <MaxAmdLetterDate>03/13/2015</MaxAmdLetterDate>
    <ARRAAmount/>
    <AwardID>1502686</AwardID>
    <Investigator>
      <FirstName>Andrew</FirstName>
      <LastName>Manion</LastName>
      <EmailAddress/>
      <StartDate>03/13/2015</StartDate>
      <EndDate/>
      <RoleCode>Principal Investigator</RoleCode>
    </Investigator>
    <Institution>
      <Name>Manion Andrew J</Name>
      <CityName>Princeton</CityName>
      <ZipCode>085441000</ZipCode>
      <PhoneNumber></PhoneNumber>
      <StreetAddress></StreetAddress>
      <CountryName>United States</CountryName>
      <StateName>New Jersey</StateName>
      <StateCode>NJ</StateCode>
    </Institution>
  </Award>
</rootTag>


text:
namespace NLog.LogReceiverService
{
    using System;
#if WCF_SUPPORTED
    using System.ServiceModel;
#endif
    /// <summary>
    /// Service contract for Log Receiver client.
    /// </summary>
#if WCF_SUPPORTED
    [ServiceContract(Namespace = LogReceiverServiceConfig.WebServiceNamespace, ConfigurationName = "NLog.LogReceiverService.ILogReceiverClient")]
#endif
    public interface ILogReceiverTwoWayClient
    {
        /// <summary>
        /// Begins processing of log messages.
        /// </summary>
        /// <param name="events">The events.</param>
        /// <param name="callback">The callback.</param>
        /// <param name="asyncState">Asynchronous state.</param>
        /// <returns>
        /// IAsyncResult value which can be passed to <see cref="EndProcessLogMessages"/>.
        /// </returns>
#if WCF_SUPPORTED
        [OperationContractAttribute(AsyncPattern = true, Action = "http://nlog-project.org/ws/ILogReceiverServer/ProcessLogMessages", ReplyAction = "http://nlog-project.org/ws/ILogReceiverServer/ProcessLogMessagesResponse")]
#endif
         IAsyncResult BeginProcessLogMessages(NLogEvents events, AsyncCallback callback, object asyncState);

        /// <summary>
        /// Ends asynchronous processing of log messages.
        /// </summary>
        /// <param name="result">The result.</param>
         void EndProcessLogMessages(IAsyncResult result);
    }
}


text:
/**
* Creates a group box that opens and closes.
* @constructor
* @public
* @name Rendition.UI.GroupBox
* @param {Native.Object} args Parameters for the widget.
* @param {Native.Boolean} [args.alwaysExpanded=false] The groupBox will appear always expanded and cannot be closed.
* @param {Native.Array} [args.childNodes=false] Array of child elements to append to the groupBox.
* @param {String|Function} [args.title] The title of the groupBox.  When a function is passed the function must return a string.
* @param {Native.DHTMLElement} [args.parentNode] The parent DHTML element to append this groupBox to.
* @returns {Native.Object} <link xlink:href="Rendition.UI.GroupBox"/>.
*/
Rendition.UI.GroupBox = function (args) {
	var instance = {}
	if (args === undefined) { args = {} }
	/**
	* Unique id of this widget.
	* @property
	* @type Native.String
	* @name GroupBox.id
	* @memberOf Rendition.UI.GroupBox.prototype
	* @public
	*/
	instance.id = 'uid_' + Rendition.UI.createId();
	/**
	* Index of this groupBox in the Rendition.UI.groupBoxes array
	* @property
	* @type Native.Integer
	* @name GroupBox.index
	* @memberOf Rendition.UI.GroupBox.prototype
	* @public
	*/
	instance.index = Rendition.UI.groupBoxes.length;
	Rendition.UI.groupBoxes.push(instance);
	/**
	* List of child elements in this widget.
	* <alert type="note">This only works if you add elements via groupBox.appendChild to add child nodes
	* or child nodes are passed during instantiation.</alert>
	* @property
	* @type Native.Integer
	* @name GroupBox.childNodes
	* @memberOf Rendition.UI.GroupBox.prototype
	* @public
	*/
	instance.childNodes = [];
	instance.expanded = 1;
	instance.expandEvents = [];
	instance.collapseEvents = [];
	instance.resizeEvents = [];
	instance.hidden = false;
	/**
	* Attach a procedure to an event.
	* @function
	* @name GroupBox.addEventListener
	* @memberOf Rendition.UI.GroupBox.prototype
	* @type Native.undefined
	* @param {Native.String} type The type of event to subscribe to.
	* @param {Native.Function} proc The function to call when the event is fired.
	* @param {Native.Boolean} [capture=false] What phase of the event will occur on.  This is not used.
	* @public
	*/
	instance.addEventListener = function (type, proc, capture) {
	    if (type === 'expand') {
	        instance.expandEvents.push(proc);
	    } else if (type === 'collapse') {
	        instance.collapseEvents.push(proc);
	    } else if (type === 'collapse') {
	        instance.resizeEvents.push(proc);
	    }
	    return instance;
	}
	/**
	* Redraw the group box, reapply the style.
	* @function
	* @name GroupBox.resize
	* @memberOf Rendition.UI.GroupBox.prototype
	* @public
	* @returns undefined.
	*/
	instance.resize = function () {
	    for (var x = 0; instance.resizeEvents.length > x; x++) {
	        instance.resizeEvents[x].apply(this, [instance]);
	    }
	    return instance;
	}
	/**
	* Opens/Closes the group box by setting the 'inner' DIV from hidden/none to visible/block.
	* @function
	* @name GroupBox.expand
	* @memberOf Rendition.UI.GroupBox.prototype
	* @public
	* @returns undefined.
	*/
	instance.expand = function () {
	    if (args.alwaysExpanded !== undefined) { return instance; }
	    if (instance.expanded === 0) {
	        instance.inner.style.display = 'block';
	        instance.inner.style.visibility = 'visible';
	        instance.expanded = 1;
	        instance.expander.className = 'expander';
	        for (var x = 0; instance.expandEvents.length > x; x++) {
	            instance.expandEvents[x].apply(this, [instance]);
	        }
	    } else {
	        instance.inner.style.display = 'none';
	        instance.inner.style.visibility = 'hidden';
	        instance.expanded = 0;
	        instance.expander.className = 'expander_closed';
	        for (var x = 0; instance.expandEvents.length > x; x++) {
	            instance.collapseEvents[x].apply(this, [instance]);
	        }
	    }
	    return instance;
	}
	/**
	* The expander control arrow that points right or down depending on the toggled state.
	* @property
	* @type Native.DHTMLElement
	* @name GroupBox.expander
	* @memberOf Rendition.UI.GroupBox.prototype
	* @public
	*/
	instance.expander = document.createElement('div');
	if (args.alwaysExpanded !== undefined) {
	    instance.expander.style.visibility = 'hidden';
	}
	instance.expander.className = 'expander';
	instance.expander.onclick = function () {
	    instance.expand();
	    return instance;
	}
	/**
	* The DIV that holds everything in the group box.
	* @property
	* @name GroupBox.outer
	* @type Native.DHTMLElement
	* @memberOf Rendition.UI.GroupBox.prototype
	* @public
	*/
	instance.outer = document.createElement('div');
	instance.outer.className = 'groupbox';
	/**
	* The DIV that holds the title text.
	* @property
	* @name GroupBox.tspan
	* @type Native.DHTMLElement
	* @memberOf Rendition.UI.GroupBox.prototype
	* @public
	*/
	instance.tspan = document.createElement('div');
	instance.tspan.className = 'groupboxtitletext';
	instance.tspan.onclick = function () {
	    instance.expand();
	    return instance;
	}
	/**
	* The inner most DIV, this DIV holds the content of the groupBox.
	* You should use the groupBox.appendChild method to append child element.
	* Don't use this node directly or risk breaking some functionality.
	* @property
	* @name GroupBox.inner
	* @type Native.DHTMLElement
	* @memberOf Rendition.UI.GroupBox.prototype
	* @public
	*/
	instance.inner = document.createElement('div');
	instance.inner.className = 'groupboxtitle';
	if (Rendition.UI.safari || Rendition.UI.chrome) {
	    instance.inner.style.marginTop = '5px';
	}
	/**
	* Appends a DHTML element to the group box.
	* @function
	* @name GroupBox.appendChild
	* @memberOf Rendition.UI.GroupBox.prototype
	* @public
	* @returns <link xlink:href="Rendition.UI.GroupBox"/>.
	*/
	instance.appendChild = function (eleToAppend) {
	    instance.childNodes.push(eleToAppend);
	    instance.inner.appendChild(eleToAppend);
	    return instance;
	}
	instance.outer.appendChild(instance.tspan);
	instance.outer.appendChild(instance.expander);
	instance.outer.appendChild(instance.inner);
	if (args.childNodes !== undefined) {
	    for (var x = 0; args.childNodes.length > x; x++) {
	        instance.appendChild(args.childNodes[x]);
	    }
	}
	/**
	* Sets the title of the groupBox.  This can be a string or a function that returns a string.
	* @function
	* @name GroupBox.title
	* @memberOf Rendition.UI.GroupBox.prototype
	* @public
	* @returns <link xlink:href="Rendition.UI.GroupBox"/>.
	*/
	instance.title = function (objTitle) {
	    if (typeof objTitle === 'string') {
	        instance.tspan.appendChild(Rendition.UI.txt(objTitle));
	    } else {
	        instance.tspan.appendChild(objTitle);
	    }
	    return instance;
	}
	if (args.title !== undefined) {
	    instance.title(args.title);
	}
	/**
	* Hides the group box.
	* @function
	* @name GroupBox.hide
	* @memberOf Rendition.UI.GroupBox.prototype
	* @public
	* @returns <link xlink:href="Rendition.UI.GroupBox"/>.
	*/
	instance.hide = function () {
	    instance.hidden = true;
	    instance.outer.style.visibility = 'hidden';
	    instance.outer.style.display = 'none';
	    return instance;
	}
	/**
	* Show (unhide) the group box.
	* @function
	* @name GroupBox.show
	* @memberOf Rendition.UI.GroupBox.prototype
	* @public
	* @returns <link xlink:href="Rendition.UI.GroupBox"/>.
	*/
	instance.show = function () {
	    instance.hidden = false;
	    instance.outer.style.visibility = 'visible';
	    instance.outer.style.display = 'block';
	    return instance;
	}
	/**
	* Toggle the visibility of the groupBox.
	* @function
	* @name GroupBox.toggleVisibility
	* @memberOf Rendition.UI.GroupBox.prototype
	* @public
	* @returns <link xlink:href="Rendition.UI.GroupBox"/>.
	*/
	instance.toggleVisibility = function () {
	    if (instance.hidden) {
	        instance.show();
	    } else {
	        instance.hide();
	    }
	    return instance;
	}
	/**
	* Appends the groupBox to a parentElement and wires up resize events.
	* @function
	* @name GroupBox.appendTo
	* @memberOf Rendition.UI.GroupBox.prototype
	* @public
	* @returns <link xlink:href="Rendition.UI.GroupBox"/>.
	*/
	instance.appendTo = function (parentNode) {
	    instance.parentNode = parentNode;
	    instance.parentNode.appendChild(instance.outer);
	    Rendition.UI.wireupResizeEvents(instance.resize, instance.parentNode);
	    return instance;
	}
	if (args.parentNode !== undefined) {
	    instance.appendTo(args.parentNode);
	}
	if (args.expanded === false) {
	    instance.expand();
	}
	return instance;
}


text:
public class KdTree_RJ {

    private abstract static class Node {
        protected Point2D p;      // the point
        protected RectHV rect;    // the axis-aligned rectangle corresponding to this node
        protected Node lb;        // the left/bottom subtree
        protected Node rt;        // the right/top subtree
        protected int N;          // size of the subtree (inclusive of this node)

        public Node(Point2D _p, int _n) {
            p = _p;
            N = _n;
        }

        public void insert(Point2D p) {
            if (this.p == p) { return; } //already exists
            if (smaller(p)) {
                if (lb == null) { lb = GetAppropriateSubNode(p); }
                else { lb.insert(p); }
            }
            else  {
                if (rt == null) { rt = GetAppropriateSubNode(p); }
                else { rt.insert(p); }
            }

            N = (lb != null ? lb.N : 0) + (rt != null ? rt.N : 0) + 1;

            RectHV leftRect = leftRect();
            RectHV rightRect = rightRect();
            rect = new RectHV(leftRect.xmin(), leftRect.ymin(), rightRect.xmax(), rightRect.ymax());
        }

        public void draw() {
            StdDraw.setPenColor(StdDraw.BLACK);
            StdDraw.setPenRadius(.01);
            StdDraw.point(p.x(), p.y());
            drawLine();
            if (lb != null) { lb.draw(); }
            if (rt != null) { rt.draw(); }
        }

        public abstract Node GetAppropriateSubNode(Point2D p);
        public abstract boolean smaller(Point2D p);
        public abstract RectHV leftRect();
        public abstract RectHV rightRect();
        public abstract void drawLine();
    }

    private class HNode extends Node {
        public HNode(Point2D _p, int _n) {
            super(_p, _n);
        }

        public HNode(Point2D _p, int _n, RectHV _rect) {
            this(_p, _n);
            rect = _rect;
        }

        public Node GetAppropriateSubNode(Point2D p) {
            return new VNode(p, 1);
        }

        @Override
        public boolean smaller(Point2D p) {
            return (p.x() < this.p.x());
        }

        @Override
        public RectHV leftRect() {
            RectHV retVal = new RectHV(0.0, 0.0, p.x(), 1.0);
            if (lb != null) {
                if (lb.rect == null) {
                    lb.rect = retVal;
                }
                retVal = lb.rect;
            }
            return retVal;
        }

        @Override
        public RectHV rightRect() {
            RectHV retVal = new RectHV(p.x(), 0.0, 1.0, 1.0);
            if (rt != null) {
                if (rt.rect == null) {
                    rt.rect = retVal;
                }
                retVal = rt.rect;
            }
            return retVal;
        }

        @Override
        public void drawLine() {
            StdDraw.setPenRadius();
            StdDraw.setPenColor(StdDraw.RED);
            StdDraw.line(p.x(), rect.ymin(), p.x(), rect.ymax());
        }
    }

    private class VNode extends Node {
        public VNode(Point2D _p, int _n) {
            super(_p, _n);
        }

        public Node GetAppropriateSubNode(Point2D p) {
            return new HNode(p, 1);
        }

        @Override
        public boolean smaller(Point2D p) {
            return (p.y() < this.p.y());
        }

        @Override
        public RectHV leftRect() {
            RectHV retVal = new RectHV(0.0, 0.0, 1.0, p.y());
            if (lb != null) {
                if (lb.rect == null) {
                    lb.rect = retVal;
                }
                retVal = lb.rect;
            }
            return retVal;
        }

        @Override
        public RectHV rightRect() {
            RectHV retVal = new RectHV(0.0, p.y(), 1.0, 1.0);
            if (rt != null) {
                if (rt.rect == null) {
                    rt.rect = retVal;
                }
                retVal = rt.rect;
            }
            return retVal;
        }

        @Override
        public void drawLine() {
            StdDraw.setPenRadius();
            StdDraw.setPenColor(StdDraw.BLUE);
            StdDraw.line(rect.xmin(), p.y(), rect.xmax(), p.y());
        }
    }

    private Node root;

    public KdTree_RJ() {                               // construct an empty set of points
    }

    public boolean isEmpty() {                       // is the set empty?
        return (root == null);
    }

    public int size() {                               // number of points in the set
        return root.N;
    }

    public void insert(Point2D p) {                   // add the point p to the set (if it is not already in the set)
        if (root == null) { root = new HNode(p, 1, new RectHV(0.0, 0.0, 1.0, 1.0)); }
        else { root.insert(p); }
    }

    public boolean contains(Point2D p)  {             // does the set contain the point p?
        return (get(p) != null);
    }

    public void draw() {                              // draw all of the points to standard draw
        StdDraw.setPenColor();
        StdDraw.rectangle(0.5, 0.5, 0.5, 0.5);
        root.draw();
    }

    public Iterable<Point2D> range(RectHV rect) {     // all points in the set that are inside the rectangle
        final Queue<Point2D> retVal = new Queue<Point2D>();
        range(root, rect, retVal, new RectHV(0, 0, 1, 1));
        return retVal;
    }

    public Point2D nearest(Point2D p) {              // a nearest neighbor in the set to p; null if set is empty
        //TODO: implement nearest
        return p;
    }

    public static void main(String[] args) {
        KdTree test = new KdTree();
        Point2D p = new Point2D(0.5, 0.5);
        Point2D q = new Point2D(0.5, 0.5);
        Point2D r = new Point2D(0.7, 0.7);
        Point2D s = new Point2D(0.9, 0.9);
        StdOut.println("test contains " + p.toString() + " = " + test.contains(p));
        StdOut.println("adding " + r.toString() + " to test");
        test.insert(r);
        StdOut.println("adding " + q.toString() + " to test");
        test.insert(p);
        StdOut.println("test contains " + p.toString() + " = " + test.contains(p));
        StdOut.println("test contains " + q.toString() + " = " + test.contains(q));
        StdOut.println("test contains " + r.toString() + " = " + test.contains(r));
        StdOut.println("test contains " + s.toString() + " = " + test.contains(s));

        //test.draw();

        String filename = args[0];
        In in = new In(filename);

        // initialize the data structures with N points from standard input
        KdTree kdtree = new KdTree();
        while (!in.isEmpty()) {
            StdDraw.clear();
            double x = in.readDouble();
            double y = in.readDouble();
            Point2D z = new Point2D(x, y);
            kdtree.insert(z);
            kdtree.draw();
            while (!StdDraw.hasNextKeyTyped()) { } //pause until key is pressed
            StdDraw.nextKeyTyped();
        }

    }

    private Node get(Point2D p) {
        return get(root, p);
    }

    private Node get(Node n, Point2D p) {
        while (n != null) {
            int cmp = p.compareTo(n.p);
            if      (cmp < 0) n = n.lb;
            else if (cmp > 0) n = n.rt;
            else              return n;
        }
        return null;
    }

    private void range(Node n, RectHV rect, Queue<Point2D> queue, RectHV nodeRect) {
        if (n == null) { return; } //end of a branch -- nothing to do!
        if (rect.intersects(nodeRect)) {
            if (rect.contains(n.p)) { queue.enqueue(n.p); }
            range(n.lb, rect, queue, n.leftRect());
            range(n.rt, rect, queue, n.rightRect());
        }
    }

}


text:
<!--
  Copyright (c) 2016-2022 Martin Donath <martin.donath@squidfunk.com>

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to
  deal in the Software without restriction, including without limitation the
  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  sell copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  IN THE SOFTWARE.
-->

<!-- Translations: Hindi -->
{% macro t(key) %}{{ {
  "language": "hi",
  "clipboard.copy": "क्लिपबोर्ड पर कॉपी करें",
  "clipboard.copied": "क्लिपबोर्ड पर कॉपी कर दिया गया",
  "edit.link.title": "इस पृष्ठ को संपादित करें",
  "footer.previous": "पिछला",
  "footer.next": "आगामी",
  "meta.comments": "टिप्पणियाँ",
  "meta.source": "स्रोत",
  "search.config.lang": "hi",
  "search.placeholder": "खोज",
  "search.result.placeholder": "खोज शुरू करने के लिए टाइप करें",
  "search.result.none": "कोई मिलान डॉक्यूमेंट नहीं",
  "search.result.one": "1 मिलान डॉक्यूमेंट",
  "search.result.other": "# मिलान डाक्यूमेंट्स",
  "skip.link.title": "विषय पर बढ़ें",
  "source.link.title": "रिपॉजिटरी पर जाएं",
  "source.file.date.updated": "आखिरी अपडेट",
  "source.file.date.created": "बनाया था",
  "toc.title": "विषय - सूची"
}[key] }}{% endmacro %}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Localization;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using Orchard.ContentManagement.Metadata.Settings;
using Orchard.ContentManagement.MetaData;
using Orchard.ContentManagement.Metadata.Models;
using Orchard.ContentTypes.Editors;
using Orchard.ContentTypes.Services;
using Orchard.ContentTypes.ViewModels;
using Orchard.DisplayManagement.ModelBinding;
using Orchard.DisplayManagement.Notify;
using Orchard.Environment.Shell;
using Orchard.Mvc.Utilities;
using YesSql;
using System.Reflection;
using Orchard.Mvc.ActionConstraints;

namespace Orchard.ContentTypes.Controllers
{
    public class AdminController : Controller, IUpdateModel
    {
        private readonly IContentDefinitionService _contentDefinitionService;
        private readonly IContentDefinitionManager _contentDefinitionManager;
        private readonly ShellSettings _settings;
        private readonly IAuthorizationService _authorizationService;
        private readonly ISession _session;
        private readonly IContentDefinitionDisplayManager _contentDefinitionDisplayManager;
        private readonly INotifier _notifier;

        public AdminController(
            IContentDefinitionDisplayManager contentDefinitionDisplayManager,
            IContentDefinitionService contentDefinitionService,
            IContentDefinitionManager contentDefinitionManager,
            ShellSettings settings,
            IAuthorizationService authorizationService,
            ISession session,
            ILogger<AdminController> logger,
            IHtmlLocalizer<AdminMenu> htmlLocalizer,
            IStringLocalizer<AdminMenu> stringLocalizer,
            INotifier notifier
            )
        {
            _notifier = notifier;
            _contentDefinitionDisplayManager = contentDefinitionDisplayManager;
            _session = session;
            _authorizationService = authorizationService;
            _contentDefinitionService = contentDefinitionService;
            _contentDefinitionManager = contentDefinitionManager;
            _settings = settings;

            Logger = logger;
            T = htmlLocalizer;
            S = stringLocalizer;
        }

        public IHtmlLocalizer T { get; set; }
        public IStringLocalizer S { get; set; }
        public ILogger Logger { get; set; }
        public Task<ActionResult> Index() { return List(); }

        #region Types

        public async Task<ActionResult> List()
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.ViewContentTypes))
                return Unauthorized();

            return View("List", new ListContentTypesViewModel
            {
                Types = _contentDefinitionService.GetTypes()
            });
        }

        public async Task<ActionResult> Create(string suggestion)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            return View(new CreateTypeViewModel { DisplayName = suggestion, Name = suggestion.ToSafeName() });
        }

        [HttpPost, ActionName("Create")]
        public async Task<ActionResult> CreatePOST(CreateTypeViewModel viewModel)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            viewModel.DisplayName = viewModel.DisplayName ?? String.Empty;
            viewModel.Name = viewModel.Name ?? String.Empty;

            if (String.IsNullOrWhiteSpace(viewModel.DisplayName))
            {
                ModelState.AddModelError("DisplayName", S["The Display Name can't be empty."]);
            }

            if (String.IsNullOrWhiteSpace(viewModel.Name))
            {
                ModelState.AddModelError("Name", S["The Content Type Id can't be empty."]);
            }

            if (_contentDefinitionService.GetTypes().Any(t => String.Equals(t.Name.Trim(), viewModel.Name.Trim(), StringComparison.OrdinalIgnoreCase)))
            {
                ModelState.AddModelError("Name", S["A type with the same Id already exists."]);
            }

            if (!String.IsNullOrWhiteSpace(viewModel.Name) && !viewModel.Name[0].IsLetter())
            {
                ModelState.AddModelError("Name", S["The technical name must start with a letter."]);
            }

            if (_contentDefinitionService.GetTypes().Any(t => String.Equals(t.DisplayName.Trim(), viewModel.DisplayName.Trim(), StringComparison.OrdinalIgnoreCase)))
            {
                ModelState.AddModelError("DisplayName", S["A type with the same Display Name already exists."]);
            }

            if (!ModelState.IsValid)
            {
                _session.Cancel();
                return View(viewModel);
            }

            var contentTypeDefinition = _contentDefinitionService.AddType(viewModel.Name, viewModel.DisplayName);

            var typeViewModel = new EditTypeViewModel(contentTypeDefinition);

            _notifier.Success(T["The \"{0}\" content type has been created.", typeViewModel.DisplayName]);

            return RedirectToAction("AddPartsTo", new { id = typeViewModel.Name });
        }

        public async Task<ActionResult> Edit(string id)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            var typeViewModel = _contentDefinitionService.GetType(id);

            if (typeViewModel == null)
            {
                return NotFound();
            }

            typeViewModel.Editor = await _contentDefinitionDisplayManager.BuildTypeEditorAsync(typeViewModel.TypeDefinition, this);

            return View(typeViewModel);
        }

        [HttpPost, ActionName("Edit")]
        [FormValueRequired("submit.Save")]
        public async Task<ActionResult> EditPOST(string id, EditTypeViewModel viewModel)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            var contentTypeDefinition = _contentDefinitionManager.GetTypeDefinition(id);

            if (contentTypeDefinition == null)
            {
                return NotFound();
            }

            viewModel.Settings = contentTypeDefinition.Settings;
            viewModel.TypeDefinition = contentTypeDefinition;
            viewModel.DisplayName = contentTypeDefinition.DisplayName;
            viewModel.Editor = await _contentDefinitionDisplayManager.UpdateTypeEditorAsync(contentTypeDefinition, this);

            if (!ModelState.IsValid)
            {
                _session.Cancel();

                HackModelState(nameof(EditTypeViewModel.OrderedFieldNames));
                HackModelState(nameof(EditTypeViewModel.OrderedPartNames));

                return View(viewModel);
            }
            else
            {
                var ownedPartDefinition = _contentDefinitionManager.GetPartDefinition(contentTypeDefinition.Name);
                if (ownedPartDefinition != null && viewModel.OrderedFieldNames != null)
                {
                    _contentDefinitionService.AlterPartFieldsOrder(ownedPartDefinition, viewModel.OrderedFieldNames);
                }
                _contentDefinitionService.AlterTypePartsOrder(contentTypeDefinition, viewModel.OrderedPartNames);
                _notifier.Success(T["\"{0}\" settings have been saved.", contentTypeDefinition.Name]);
            }

            return RedirectToAction("Edit", new { id });
        }

        [HttpPost, ActionName("Edit")]
        [FormValueRequired("submit.Delete")]
        public async Task<ActionResult> Delete(string id)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            var typeViewModel = _contentDefinitionService.GetType(id);

            if (typeViewModel == null)
                return NotFound();

            _contentDefinitionService.RemoveType(id, true);

            _notifier.Success(T["\"{0}\" has been removed.", typeViewModel.DisplayName]);

            return RedirectToAction("List");
        }

        public async Task<ActionResult> AddPartsTo(string id)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
            {
                return Unauthorized();
            }

            var typeViewModel = _contentDefinitionService.GetType(id);

            if (typeViewModel == null)
                return NotFound();

            var typePartNames = new HashSet<string>(
                typeViewModel.TypeDefinition.Parts
                    .Where(cpd => !cpd.Settings.ToObject<ContentPartSettings>().Reusable)
                    .Select(p => p.PartDefinition.Name)
                );

            var viewModel = new AddPartsViewModel
            {
                Type = typeViewModel,
                PartSelections = _contentDefinitionService.GetParts(metadataPartsOnly: false)
                    .Where(cpd => !typePartNames.Contains(cpd.Name) &&
                        cpd.Settings.ToObject<ContentPartSettings>().Attachable &&
                        !cpd.Settings.ToObject<ContentPartSettings>().Reusable)
                    .Select(cpd => new PartSelectionViewModel { PartName = cpd.Name, PartDisplayName = cpd.DisplayName, PartDescription = cpd.Description })
                    .ToList()
            };

            return View(viewModel);
        }

        public async Task<ActionResult> AddReusablePartTo(string id)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
            {
                return Unauthorized();
            }

            var typeViewModel = _contentDefinitionService.GetType(id);

            if (typeViewModel == null)
                return NotFound();

            var reusableParts = _contentDefinitionService.GetParts(metadataPartsOnly: false)
                    .Where(cpd =>
                        cpd.Settings.ToObject<ContentPartSettings>().Attachable &&
                        cpd.Settings.ToObject<ContentPartSettings>().Reusable);

            var viewModel = new AddReusablePartViewModel
            {
                Type = typeViewModel,
                PartSelections = reusableParts
                    .Select(cpd => new PartSelectionViewModel { PartName = cpd.Name, PartDisplayName = cpd.DisplayName, PartDescription = cpd.Description })
                    .ToList(),
                SelectedPartName = reusableParts.FirstOrDefault()?.Name
            };

            return View(viewModel);
        }

        [HttpPost, ActionName("AddPartsTo")]
        public async Task<ActionResult> AddPartsToPOST(string id)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            var typeViewModel = _contentDefinitionService.GetType(id);

            if (typeViewModel == null)
                return NotFound();

            var viewModel = new AddPartsViewModel();
            if (!await TryUpdateModelAsync(viewModel))
            {
                return await AddPartsTo(id);
            }

            var partsToAdd = viewModel.PartSelections.Where(ps => ps.IsSelected).Select(ps => ps.PartName);
            foreach (var partToAdd in partsToAdd)
            {
                _contentDefinitionService.AddPartToType(partToAdd, typeViewModel.Name);
                _notifier.Success(T["The \"{0}\" part has been added.", partToAdd]);
            }

            if (!ModelState.IsValid)
            {
                _session.Cancel();
                return await AddPartsTo(id);
            }

            return RedirectToAction("Edit", new { id });
        }

        [HttpPost, ActionName("AddReusablePartTo")]
        public async Task<ActionResult> AddReusablePartToPOST(string id)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            var typeViewModel = _contentDefinitionService.GetType(id);

            if (typeViewModel == null)
                return NotFound();

            var viewModel = new AddReusablePartViewModel();
            if (!await TryUpdateModelAsync(viewModel))
            {
                return await AddReusablePartTo(id);
            }

            if (String.IsNullOrWhiteSpace(viewModel.DisplayName))
            {
                ModelState.AddModelError("DisplayName", S["The Display Name can't be empty."]);
            }

            if (String.IsNullOrWhiteSpace(viewModel.Name))
            {
                ModelState.AddModelError("Name", S["The Content Type Id can't be empty."]);
            }

            var partToAdd = viewModel.SelectedPartName;

            _contentDefinitionService.AddReusablePartToType(viewModel.Name, viewModel.DisplayName, viewModel.Description, partToAdd, typeViewModel.Name);
            _notifier.Success(T["The \"{0}\" part has been added.", partToAdd]);

            if (!ModelState.IsValid)
            {
                _session.Cancel();
                return await AddReusablePartTo(id);
            }

            return RedirectToAction("Edit", new { id });
        }

        [HttpPost, ActionName("RemovePart")]
        public async Task<ActionResult> RemovePartPOST(string id, string name)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            var typeViewModel = _contentDefinitionService.GetType(id);

            if (typeViewModel == null
                || !typeViewModel.TypeDefinition.Parts.Any(p => p.Name == name))
                return NotFound();

            _contentDefinitionService.RemovePartFromType(name, id);

            _notifier.Success(T["The \"{0}\" part has been removed.", name]);

            return RedirectToAction("Edit", new { id });
        }

        #endregion

        #region Parts

        public async Task<ActionResult> ListParts()
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.ViewContentTypes))
                return Unauthorized();

            return View(new ListContentPartsViewModel
            {
                // only user-defined parts (not code as they are not configurable)
                Parts = _contentDefinitionService.GetParts(true/*metadataPartsOnly*/)
            });
        }

        public async Task<ActionResult> CreatePart(string suggestion)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            return View(new CreatePartViewModel { Name = suggestion.ToSafeName() });
        }

        [HttpPost, ActionName("CreatePart")]
        public async Task<ActionResult> CreatePartPOST(CreatePartViewModel viewModel)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            if (_contentDefinitionManager.GetPartDefinition(viewModel.Name) != null)
                ModelState.AddModelError("Name", S["Cannot add part named '{0}'. It already exists.", viewModel.Name]);

            if (!ModelState.IsValid)
                return View(viewModel);

            var partViewModel = _contentDefinitionService.AddPart(viewModel);

            if (partViewModel == null)
            {
                _notifier.Information(T["The content part could not be created."]);
                return View(viewModel);
            }

            _notifier.Success(T["The \"{0}\" content part has been created.", partViewModel.Name]);

            return RedirectToAction("EditPart", new { id = partViewModel.Name });
        }

        public async Task<ActionResult> EditPart(string id)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            var contentPartDefinition = _contentDefinitionManager.GetPartDefinition(id);

            if (contentPartDefinition == null)
            {
                return NotFound();
            }

            var viewModel = new EditPartViewModel(contentPartDefinition);
            viewModel.Editor = await _contentDefinitionDisplayManager.BuildPartEditorAsync(contentPartDefinition, this);

            return View(viewModel);
        }

        [HttpPost, ActionName("EditPart")]
        [FormValueRequired("submit.Save")]
        public async Task<ActionResult> EditPartPOST(string id, string[] orderedFieldNames)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            var contentPartDefinition = _contentDefinitionManager.GetPartDefinition(id);

            if (contentPartDefinition == null)
            {
                return NotFound();
            }

            var viewModel = new EditPartViewModel(contentPartDefinition);
            viewModel.Editor = await _contentDefinitionDisplayManager.UpdatePartEditorAsync(contentPartDefinition, this);

            if (!ModelState.IsValid)
            {
                _session.Cancel();
                return View(viewModel);
            }
            else
            {
                _contentDefinitionService.AlterPartFieldsOrder(contentPartDefinition, orderedFieldNames);
                _notifier.Success(T["The settings of \"{0}\" have been saved.", contentPartDefinition.Name]);
            }

            return RedirectToAction("EditPart", new { id });
        }

        [HttpPost, ActionName("EditPart")]
        [FormValueRequired("submit.Delete")]
        public async Task<ActionResult> DeletePart(string id)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            var partViewModel = _contentDefinitionService.GetPart(id);

            if (partViewModel == null)
                return NotFound();

            _contentDefinitionService.RemovePart(id);

            _notifier.Information(T["\"{0}\" has been removed.", partViewModel.DisplayName]);

            return RedirectToAction("ListParts");
        }

        public async Task<ActionResult> AddFieldTo(string id)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            var partViewModel = _contentDefinitionService.GetPart(id);

            if (partViewModel == null)
            {
                return NotFound();
            }

            var viewModel = new AddFieldViewModel
            {
                Part = partViewModel.PartDefinition,
                Fields = _contentDefinitionService.GetFields().Select(x => x.Name).OrderBy(x => x).ToList()
            };

            return View(viewModel);
        }

        [HttpPost, ActionName("AddFieldTo")]
        public async Task<ActionResult> AddFieldToPOST(AddFieldViewModel viewModel, string id)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            var partViewModel = _contentDefinitionService.GetPart(id);

            if (partViewModel == null)
            {
                return NotFound();
            }

            var partDefinition = partViewModel.PartDefinition;

            viewModel.DisplayName = viewModel.DisplayName?.Trim() ?? String.Empty;

            viewModel.Name = viewModel.Name ?? String.Empty;

            if (String.IsNullOrWhiteSpace(viewModel.DisplayName))
            {
                ModelState.AddModelError("DisplayName", S["The Display Name name can't be empty."]);
            }

            if (String.IsNullOrWhiteSpace(viewModel.Name))
            {
                ModelState.AddModelError("Name", S["The Technical Name can't be empty."]);
            }

            if (partDefinition.Fields.Any(t => String.Equals(t.Name.Trim(), viewModel.Name.Trim(), StringComparison.OrdinalIgnoreCase)))
            {
                ModelState.AddModelError("Name", S["A field with the same name already exists."]);
            }

            if (!String.IsNullOrWhiteSpace(viewModel.Name) && !viewModel.Name[0].IsLetter())
            {
                ModelState.AddModelError("Name", S["The technical name must start with a letter."]);
            }

            if (!String.Equals(viewModel.Name, viewModel.Name.ToSafeName(), StringComparison.OrdinalIgnoreCase))
            {
                ModelState.AddModelError("Name", S["The technical name contains invalid characters."]);
            }

            if (partDefinition.Fields.Any(t => String.Equals(t.DisplayName().Trim(), Convert.ToString(viewModel.DisplayName).Trim(), StringComparison.OrdinalIgnoreCase)))
            {
                ModelState.AddModelError("DisplayName", S["A field with the same Display Name already exists."]);
            }

            if (!ModelState.IsValid)
            {
                viewModel.Part = partDefinition;
                viewModel.Fields = _contentDefinitionService.GetFields().Select(x => x.Name).OrderBy(x => x).ToList();

                _session.Cancel();

                return View(viewModel);
            }

            _contentDefinitionService.AddFieldToPart(viewModel.Name, viewModel.DisplayName, viewModel.FieldTypeName, partDefinition.Name);

            _notifier.Success(T["The field \"{0}\" has been added.", viewModel.DisplayName]);

            return RedirectToAction("EditField", new { id, viewModel.Name });
        }

        public async Task<ActionResult> EditField(string id, string name)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            var partViewModel = _contentDefinitionService.GetPart(id);

            if (partViewModel == null)
            {
                return NotFound();
            }

            var partFieldDefinition = partViewModel.PartDefinition.Fields.FirstOrDefault(x => x.Name == name);

            if (partFieldDefinition == null)
            {
                return NotFound();
            }

            var viewModel = new EditFieldViewModel
            {
                Name = partFieldDefinition.Name,
                DisplayName = partFieldDefinition.DisplayName(),
                PartFieldDefinition = partFieldDefinition,
                Editor = await _contentDefinitionDisplayManager.BuildPartFieldEditorAsync(partFieldDefinition, this)
            };

            return View(viewModel);
        }

        [HttpPost, ActionName("EditField")]
        [FormValueRequired("submit.Save")]
        public async Task<ActionResult> EditFieldPOST(string id, EditFieldViewModel viewModel)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            if (viewModel == null)
                return NotFound();

            var partViewModel = _contentDefinitionService.GetPart(id);

            if (partViewModel == null)
            {
                return NotFound();
            }

            var field = _contentDefinitionManager.GetPartDefinition(id).Fields.FirstOrDefault(x => x.Name == viewModel.Name);

            if (field == null)
            {
                return NotFound();
            }

            if (field.DisplayName() != viewModel.DisplayName)
            {
                // prevent null reference exception in validation
                viewModel.DisplayName = viewModel.DisplayName?.Trim() ?? String.Empty;

                if (String.IsNullOrWhiteSpace(viewModel.DisplayName))
                {
                    ModelState.AddModelError("DisplayName", S["The Display Name name can't be empty."]);
                }

                if (_contentDefinitionService.GetPart(partViewModel.Name).PartDefinition.Fields.Any(t => t.Name != viewModel.Name && String.Equals(t.DisplayName().Trim(), viewModel.DisplayName.Trim(), StringComparison.OrdinalIgnoreCase)))
                {
                    ModelState.AddModelError("DisplayName", S["A field with the same Display Name already exists."]);
                }

                if (!ModelState.IsValid)
                {
                    _session.Cancel();
                    return View(viewModel);
                }

                _contentDefinitionService.AlterField(partViewModel, viewModel);

                _notifier.Information(T["Display name changed to {0}.", viewModel.DisplayName]);
            }

            viewModel.Editor = await _contentDefinitionDisplayManager.UpdatePartFieldEditorAsync(field, this);

            if (!ModelState.IsValid)
            {
                _session.Cancel();
                return View(viewModel);
            }
            else
            {
                _notifier.Success(T["The \"{0}\" field settings have been saved.", field.DisplayName()]);
            }

            // Redirect to the type editor if a type exists with this name
            var typeViewModel = _contentDefinitionService.GetType(id);
            if (typeViewModel != null)
            {
                return RedirectToAction("Edit", new { id });
            }

            return RedirectToAction("EditPart", new { id });
        }

        [HttpPost, ActionName("RemoveFieldFrom")]
        public async Task<ActionResult> RemoveFieldFromPOST(string id, string name)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            var partViewModel = _contentDefinitionService.GetPart(id);

            if (partViewModel == null)
            {
                return NotFound();
            }

            var field = partViewModel.PartDefinition.Fields.FirstOrDefault(x => x.Name == name);

            if (field == null)
            {
                return NotFound();
            }

            _contentDefinitionService.RemoveFieldFromPart(name, partViewModel.Name);

            _notifier.Success(T["The \"{0}\" field has been removed.", field.DisplayName()]);

            if (_contentDefinitionService.GetType(id) != null)
            {
                return RedirectToAction("Edit", new { id });
            }

            return RedirectToAction("EditPart", new { id });
        }

        #endregion

        #region Type Parts
        public async Task<ActionResult> EditTypePart(string id, string name)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            var typeDefinition = _contentDefinitionManager.GetTypeDefinition(id);

            if (typeDefinition == null)
            {
                return NotFound();
            }

            var typePartDefinition = typeDefinition.Parts.FirstOrDefault(x => x.Name == name);

            if (typePartDefinition == null)
            {
                return NotFound();
            }

            var typePartViewModel = new EditTypePartViewModel
            {
                Name = typePartDefinition.Name,
                DisplayName = typePartDefinition.DisplayName(),
                Description = typePartDefinition.Description(),
                TypePartDefinition = typePartDefinition,
                Editor = await _contentDefinitionDisplayManager.BuildTypePartEditorAsync(typePartDefinition, this)
            };

            return View(typePartViewModel);
        }

        [HttpPost, ActionName("EditTypePart")]
        [FormValueRequired("submit.Save")]
        public async Task<ActionResult> EditTypePartPOST(string id, EditTypePartViewModel viewModel)
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.EditContentTypes))
                return Unauthorized();

            if (viewModel == null)
            {
                return NotFound();
            }

            var typeDefinition = _contentDefinitionManager.GetTypeDefinition(id);

            if (typeDefinition == null)
            {
                return NotFound();
            }

            var part = typeDefinition.Parts.FirstOrDefault(x => x.Name == viewModel.Name);

            if (part == null)
            {
                return NotFound();
            }

            viewModel.TypePartDefinition = part;

            if (part.PartDefinition.IsReusable())
            {
                if (part.DisplayName() != viewModel.DisplayName)
                {
                    // Prevent null reference exception in validation
                    viewModel.DisplayName = viewModel.DisplayName?.Trim() ?? String.Empty;

                    if (String.IsNullOrWhiteSpace(viewModel.DisplayName))
                    {
                        ModelState.AddModelError("DisplayName", S["The display name can't be empty."]);
                    }

                    if (typeDefinition.Parts.Any(t => t.Name != viewModel.Name && String.Equals(t.DisplayName()?.Trim(), viewModel.DisplayName.Trim(), StringComparison.OrdinalIgnoreCase)))
                    {
                        ModelState.AddModelError("DisplayName", S["A part with the same display name already exists."]);
                    }

                    if (!ModelState.IsValid)
                    {
                        _session.Cancel();
                        return View(viewModel);
                    }

                }

                _contentDefinitionService.AlterTypePart(viewModel);
            }

            viewModel.Editor = await _contentDefinitionDisplayManager.UpdateTypePartEditorAsync(part, this);

            if (!ModelState.IsValid)
            {
                _session.Cancel();
                return View(viewModel);
            }
            else
            {
                _notifier.Success(T["The \"{0}\" part settings have been saved.", part.DisplayName()]);
            }

            return RedirectToAction("Edit", new { id });
        }

        #endregion

        private void HackModelState(string key)
        {
            // TODO: Remove this once https://github.com/aspnet/Mvc/issues/4989 has shipped
            var modelStateEntry = ModelState[key];
            var nodeType = modelStateEntry.GetType();
            nodeType.GetMethod("GetNode").Invoke(modelStateEntry, new object[] { new Microsoft.Extensions.Primitives.StringSegment("--!!f-a-k-e"), true });
            ((System.Collections.IList)nodeType.GetProperty("ChildNodes").GetValue(modelStateEntry)).Clear();
        }
    }
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package buoy.tests.router;

/**
 *
 * @author Gregory
 */
public class TestControllerNoDefaultConstructor {

	public TestControllerNoDefaultConstructor(String dummy) {

	}

	private void privateInstanceMethod() {

	}

	protected void protectedInstanceMethod() {

	}

	public void publicInstanceMethod() {

	}

	private static void privateStaticMethod() {

	}

	protected static void protectedStaticMethod() {

	}

	public static void publicStaticMethod() {

	}
}


text:
<ion-view view-title="Articles">

  <ion-content scroll-event-interval="5" id="dashboard" ng-controller="ArticlesCtrl">

{{article.timeAgo}}

{{article.owner.profile.firstName}} {{article.owner.profile.lastName}}

{{article.network.name}} - {{article.created | date : 'medium'}}

{{article.title}}

          {{article.deck}}

  </ion-content>
</ion-view>


text:
from django.contrib import admin

# Register your models here.
from rango.models import Category, Page
from rango.models import UserProfile

# Add in this class to customized the Admin Interface
class CategoryAdmin(admin.ModelAdmin):
    prepopulated_fields = {'slug':('name',)}

class PageAdmin(admin.ModelAdmin):
	"""docstring for PageAdmin"""
	list_display = ('title', 'category', 'url')

admin.site.register(Category, CategoryAdmin)
admin.site.register(Page, PageAdmin)
admin.site.register(UserProfile)


text:
FROM quay.io/eris/tools
MAINTAINER Eris Industries <support@erisindustries.com>

RUN apt-get update -qq && \
  apt-get install -qq -y --no-install-recommends \
    geth && \
  rm -rf /var/lib/apt/lists/*

# start script
COPY start.sh $INSTALL_BASE/start
COPY new_account.sh $INSTALL_BASE/new_account

# set user
USER $USER
WORKDIR $ERIS

# configure $ETH_PATH is a default, will usually not go to that for test chains
ENV ETH_PATH $ERIS/blockchains/ethereum
RUN mkdir --parents $ETH_PATH

# boot
VOLUME $ERIS
EXPOSE 8545 30303
CMD ["start"]

# default is to use keys from the host
# docker run --user eris -e CHAIN_ID=eth_test -e ACCOUNT=0 -e KEY=$(cat ~/.eris/keys/ethereum/whatever) -e PASSWORD="whatever" eris/eth

# you'll need to make a key from inside the container and export it to your host if you have not make a key yet...
# docker run --rm --user eris -e PASSWORD=whatever eris/eth new_account

# OR..... you can always just make it make an account and go for you
# docker run --user eris -e ACCOUNT=0 -e PASSWORD=whatever -e CHAIN_ID=eth_test -e MAKEACCT=true eris/eth


text:
<title>
Crisis in our schools
</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include "../../legacy-includes/Script.htmlf" ?>

<?php include "../../legacy-includes/TopLogo.htmlf" ?>

<?php include "../../legacy-includes/TopAd.htmlf" ?>

<?php include "../../legacy-includes/LeftButtons.htmlf" ?>

<?php include "../../legacy-includes/BodyInsert.htmlf" ?>

NYC teachers speak out against overcrowding

Crisis in our schools

October 31, 2003 | Page 4

Dear Socialist Worker,

Severe overcrowding--the worst in years--has hit New York City public schools. Because the No Child Left Behind Act requires that students be allowed to transfer from "failing" schools (i.e., schools that have low standardized test scores), schools in Brooklyn and the Bronx are filled beyond their capacity.

At Columbus High School, where I teach in the Bronx, all of the 3,700 students have to go seven periods (more than six hours) without a lunch break. School begins at 7 a.m. and ends at 5:45 p.m., and every space in the building, from auto shops to libraries, is being used as a classroom.

Most of the bathrooms have already been converted into office and storage space. Teachers are angry and upset at the lack of space, and at Columbus High School my coworkers and I are helping turn that anger into action.

Forty teachers and staff, along with students, walked a lunchtime picket line in front of the school, carrying signs like "Crowded schools lead to unsafe conditions" and "Libraries should not be used for classrooms." Chants were also raised demanding "Money for schools not for war," and coworkers quickly made the connection between the $87 billion being spent on the occupation of Iraq and the worsening situation at the schools.

The protest was part of a citywide effort on behalf of the United Federation of Teachers (UFT) draw attention to the disastrous reorganization of the schools pushed from the top by Mayor Mike Bloomberg and Chancellor Joel Klein.

But the UFT is also the focus of anger from rank-and-filers. Teachers took to task one of the union vice presidents who showed up at the picket for giving away some of our rights.

The union leadership actually facilitated some of the overcrowding by participating in plans to open smaller schools within large Bronx high schools. Secondly, UFT President Randi Weingarten opened contract negotiations with an offer to renegotiate our work rules on a school-by-school basis around the city.

This would open the door to individual principals eliminating rules that protect teachers, like class-size limits and limits on how many classes we can teach in a row. Klein is now calling for an end to tenure, seniority transfer rights and is demanding merit pay--showing that if you give the Department of Education an inch, they demand a mile.

In response, the UFT called a rally for respect at City Hall. The more teachers who show up, the stronger the message that will be sent to the city--and to the union leadership--that teachers are angry and ready to fight.

Peter Lamphere, New York City

<?php include "../../legacy-includes/BottomNavLinks.htmlf" ?>

<?php include "../../legacy-includes/RightAdFolder.htmlf" ?>


text:
using System.Web.Mvc;

namespace CrudGridExample.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
    }
}


text:
.class public Lcom/xiaomi/infra/galaxy/common/auth/AnonymousGalaxyCredentials;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/xiaomi/infra/galaxy/common/auth/GalaxyCredentials;

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

# direct methods
.method public constructor <init>(Ljava/lang/String;)V
    .locals 0

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

    iput-object p1, p0, Lcom/xiaomi/infra/galaxy/common/auth/AnonymousGalaxyCredentials;->galaxyAppId:Ljava/lang/String;

    return-void
.end method

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

    iget-object v0, p0, Lcom/xiaomi/infra/galaxy/common/auth/AnonymousGalaxyCredentials;->galaxyAppId:Ljava/lang/String;

    return-object v0
.end method

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

    const/4 v0, 0x0

    return-object v0
.end method


text:
/*global env: true */
/**
 * @module jsdoc/util/templateHelper
 */

var md5 = require('jsMD5').digest_s;
var dictionary = require('jsdoc/tag/dictionary');

var files = {};

// each container gets its own html file
var containers = ['class', 'module', 'external', 'namespace', 'mixin'];

/** @external {jsdoc.tutorial.Tutorial} */
var tutorials;

/** Sets tutorials map.
    @param {jsdoc.tutorial.Tutorial} root - Root tutorial node.
 */
exports.setTutorials = function(root) {
    tutorials = root;
};

exports.globalName = 'global';
exports.fileExtension = '.html';
exports.scopeToPunc = { 'static': '.', 'inner': '~', 'instance': '#' };

function getNamespace(kind) {
    if (dictionary.isNamespace(kind)) {
        return kind + ':';
    }
    return '';
}

function makeFilenameUnique(filename, str) {
    //add suffix underscore until filename gets unique
    while (filename in files && files[filename] !== str) {
        filename += '_';
    }
    files[filename] = str;
    return filename;
}

// compute it here just once
var nsprefix = /^(event|module|external):/;

function strToFilename(str) {
    // allow for namespace prefix
    var basename = str.replace(nsprefix, '$1-');

    if ( /[^$a-z0-9._\-]/i.test(basename) ) {
        return md5(str).substr(0, 10);
    }
    return makeFilenameUnique(basename, str);
}

// two-way lookup
var linkMap = {
    longnameToUrl: {},
    urlToLongname: {}
};

var longnameToUrl = exports.longnameToUrl = linkMap.longnameToUrl;

var linkto = exports.linkto = function(longname, linktext) {
    var url = longnameToUrl[longname];
    return url ? '' + (linktext || longname) + '' : (linktext || longname);
};

var htmlsafe = exports.htmlsafe = function(str) {
    return str.replace(/</g, '<');
};

/**
 * Find items in a TaffyDB database that match the specified key-value pairs.
 * @param {TAFFY} data The TaffyDB database to search.
 * @param {object|function} spec Key-value pairs to match against (for example,
 * `{ longname: 'foo' }`), or a function that returns `true` if a value matches or `false` if it
 * does not match.
 * @return {array<object>} The matching items.
 */
var find = exports.find = function(data, spec) {
    return data(spec).get();
};

/**
 * Retrieve all of the following types of members from a set of doclets:
 *
 * + Classes
 * + Externals
 * + Globals
 * + Mixins
 * + Modules
 * + Namespaces
 * @param {TAFFY} data The TaffyDB database to search.
 * @return {object} An object with `classes`, `externals`, `globals`, `mixins`, `modules`, and
 * `namespaces` properties. Each property contains an array of objects.
 */
exports.getMembers = function(data) {
    return {
        classes: find( data, {kind: 'class'} ),
        externals: find( data, {kind: 'external'} ),
        globals: find(data, {
            kind: ['member', 'function', 'constant', 'typedef'],
            memberof: { isUndefined: true }
        }),
        mixins: find( data, {kind: 'mixin'} ),
        modules: find( data, {kind: 'module'} ),
        namespaces: find( data, {kind: 'namespace'} )
    };
};

/**
 * Retrieve the member attributes for a doclet (for example, `virtual`, `static`, and
 * `readonly`).
 * @param {object} d The doclet whose attributes will be retrieved.
 * @return {array<string>} The member attributes for the doclet.
 */
exports.getAttribs = function(d) {
    var attribs = [];

    if (d.virtual) {
        attribs.push('virtual');
    }

    if (d.access && d.access !== 'public') {
        attribs.push(d.access);
    }

    if (d.scope && d.scope !== 'instance' && d.scope !== 'global') {
        if (d.kind == 'function' || d.kind == 'member' || d.kind == 'constant') {
            attribs.push(d.scope);
        }
    }

    if (d.readonly === true) {
        if (d.kind == 'member') {
            attribs.push('readonly');
        }
    }

    if (d.kind === 'constant') {
        attribs.push('constant');
    }

    return attribs;
};

/**
 * Retrieve links to allowed types for the member.
 * @param {object} d The doclet whose types will be retrieved.
 * @return {array<string>} HTML links to allowed types for the member.
 */
exports.getSignatureTypes = function(d) {
    var types = [];

    if (d.type && d.type.names) {
        types = d.type.names;
    }

    if (types && types.length) {
        types = types.map(function(t) {
            return linkto(t, htmlsafe(t));
        });
    }

    return types;
};

/**
 * Retrieve names of the parameters that the member accepts. If a value is provided for `optClass`,
 * the names of optional parameters will be wrapped in a `<span>` tag with that class.
 * @param {object} d The doclet whose parameter names will be retrieved.
 * @param {string} [optClass] The class to assign to the `<span>` tag that is wrapped around the
 * names of optional parameters. If a value is not provided, optional parameter names will not be
 * wrapped with a `<span>` tag. Must be a legal value for a CSS class name.
 * @return {array<string>} An array of parameter names, with or without `<span>` tags wrapping the
 * names of optional parameters.
 */
exports.getSignatureParams = function(d, optClass) {
    var pnames = [];

    if (d.params) {
        d.params.forEach(function(p) {
            if (p.name && p.name.indexOf('.') === -1) {
                if (p.optional && optClass) {
                    pnames.push('' + p.name + '');
                }
                else {
                    pnames.push(p.name);
                }
            }
        });
    }

    return pnames;
};

/**
 * Retrieve links to types that the member can return.
 * @param {object} d The doclet whose types will be retrieved.
 * @return {array<string>} HTML links to types that the member can return.
 */
exports.getSignatureReturns = function(d) {
    var returnTypes = [];

    if (d.returns) {
        d.returns.forEach(function(r) {
            if (r.type && r.type.names) {
                if (!returnTypes.length) {
                    returnTypes = r.type.names;
                }
            }
        });
    }

    if (returnTypes && returnTypes.length) {
        returnTypes = returnTypes.map(function(r) {
            return linkto(r);
        });
    }

    return returnTypes;
};

/**
 * Retrieve links to a member's ancestors.
 * @param {TAFFY} data The TaffyDB database to search.
 * @param {object} doclet The doclet whose ancestors will be retrieved.
 * @return {array<string>} HTML links to a member's ancestors.
 */
exports.getAncestorLinks = function(data, doclet) {
    var ancestors = [],
        doc = doclet.memberof;

    while (doc) {
        doc = find( data, {longname: doc}, false );
        if (doc) { doc = doc[0]; }
        if (!doc) { break; }
        ancestors.unshift( linkto(doc.longname, (exports.scopeToPunc[doc.scope] || '') + doc.name) );
        doc = doc.memberof;
    }
    if (ancestors.length) {
        ancestors[ancestors.length - 1] += (exports.scopeToPunc[doclet.scope] || '');
    }
    return ancestors;
};

/**
 * Remove members that will not be included in the output, including:
 *
 * + Undocumented members.
 * + Members tagged `@ignore`.
 * + Members of anonymous classes.
 * + Members tagged `@private`, unless the `private` option is enabled.
 * @param {TAFFY} data The TaffyDB database to prune.
 * @return {TAFFY} The pruned database.
 */
exports.prune = function(data) {
    data({undocumented: true}).remove();
    data({ignore: true}).remove();
    if (!env.opts.private) { data({access: 'private'}).remove(); }
    data({memberof: '<anonymous>'}).remove();

    return data;
};

exports.registerLink = function(longname, url) {
    linkMap.longnameToUrl[longname] = url;
    linkMap.urlToLongname[url] = longname;
};

function toLink(longname, content) {
    if (!longname) {
        // if this happens, there's something wrong with the caller itself; the user can't fix this
        throw new Error('Missing required parameter: url');
    }

    // Has link been specified manually?
    var url;
    if (/^(http|ftp)s?:/.test(longname)) {
        url = longname;

        // Has link text been specified {@link http://github.com|GitHub Website}
        var split = url.indexOf('|');
        if (split !== -1) {
            content = url.substr(split + 1);
            url = url.substr(0, split);
        }
    }
    else {
        url = linkMap.longnameToUrl[longname];
    }

    content = content || longname;

    if (!url) {
        return content;
    }
    else {
        return ''+content+'';
    }
}

var tutorialToUrl = exports.tutorialToUrl = function(tutorial) {
    var node = tutorials.getByName(tutorial);
    // no such tutorial
    if (!node) {
        require('jsdoc/util/error').handle( new Error('No such tutorial: '+tutorial) );
        return;
    }

    return 'tutorial-' + strToFilename(node.name) + exports.fileExtension;
};

/**
 * Retrieve a link to a tutorial, or the name of the tutorial if the tutorial is missing. If the
 * `missingOpts` parameter is supplied, the names of missing tutorials will be prefixed by the
 * specified text and wrapped in the specified HTML tag and CSS class.
 * @param {string} tutorial The name of the tutorial.
 * @param {string} content The link text to use.
 * @param {object} [missingOpts] Options for displaying the name of a missing tutorial.
 * @param {string} missingOpts.classname The CSS class to wrap around the tutorial name.
 * @param {string} missingOpts.prefix The prefix to add to the tutorial name.
 * @param {string} missingOpts.tag The tag to wrap around the tutorial name.
 * @return {string} An HTML link to the tutorial, or the name of the tutorial with the specified
 * options.
 */
var toTutorial = exports.toTutorial = function(tutorial, content, missingOpts) {
    if (!tutorial) {
        require('jsdoc/util/error').handle( new Error('Missing required parameter: tutorial') );
        return;
    }

    var node = tutorials.getByName(tutorial);
    // no such tutorial
    if (!node) {
        missingOpts = missingOpts || {};
        var tag = missingOpts.tag;
        var classname = missingOpts.classname;

        var link = tutorial;
        if (missingOpts.prefix) {
            link = missingOpts.prefix + link;
        }
        if (tag) {
            link = '<' + tag + (classname ? (' class="' + classname + '">') : '>') + link;
            link += '</' + tag + '>';
        }
        return link;
    }

    content = content || node.title;

    return '' + content + '';
};

/** Find symbol {@link ...} and {@tutorial ...} strings in text and turn into html links */
exports.resolveLinks = function(str) {
    str = str.replace(/(?:\[(.+?)\])?\{@link +(.+?)\}/gi,
        function(match, content, longname) {
            return toLink(longname, content);
        }
    );

    str = str.replace(/(?:\[(.+?)\])?\{@tutorial +(.+?)\}/gi,
        function(match, content, tutorial) {
            return toTutorial(tutorial, content);
        }
    );

    return str;
};

/** Turn a doclet into a URL. */
exports.createLink = function(doclet) {
    var url = '',
        longname,
        filename;

    if (containers.indexOf(doclet.kind) < 0) {
        longname = doclet.longname;
        filename = strToFilename(doclet.memberof || exports.globalName);

        url = filename + exports.fileExtension + '#' + getNamespace(doclet.kind) + doclet.name;
    }
    else {
        longname = doclet.longname;
        filename = strToFilename(longname);

        url = filename + exports.fileExtension;
    }

    return url;
};


text:
using Avalonia;
using Avalonia.Controls;
using ReactiveUI;
using System;
using System.Reactive.Disposables;
using System.Reactive.Linq;

namespace WalletWasabi.Fluent.Behaviors
{
	public class SplitViewAutoBehavior : DisposingBehavior<SplitView>
	{
		private bool _sidebarWasForceClosed;

		public static readonly StyledProperty<double> CollapseThresholdProperty =
			AvaloniaProperty.Register<SplitViewAutoBehavior, double>(nameof(CollapseThreshold));

		public static readonly StyledProperty<Action> ToggleActionProperty =
			AvaloniaProperty.Register<SplitViewAutoBehavior, Action>(nameof(ToggleAction));

		public static readonly StyledProperty<Action> CollapseOnClickActionProperty =
			AvaloniaProperty.Register<SplitViewAutoBehavior, Action>(nameof(CollapseOnClickAction));

		public double CollapseThreshold
		{
			get => GetValue(CollapseThresholdProperty);
			set => SetValue(CollapseThresholdProperty, value);
		}

		public Action ToggleAction
		{
			get => GetValue(ToggleActionProperty);
			set => SetValue(ToggleActionProperty, value);
		}

		public Action CollapseOnClickAction
		{
			get => GetValue(CollapseOnClickActionProperty);
			set => SetValue(CollapseOnClickActionProperty, value);
		}

		protected override void OnAttached(CompositeDisposable disposables)
		{
			AssociatedObject!.WhenAnyValue(x => x.Bounds)
				.DistinctUntilChanged()
				.Subscribe(SplitViewBoundsChanged)
				.DisposeWith(disposables);

			ToggleAction = OnToggleAction;
			CollapseOnClickAction = OnCollapseOnClickAction;
		}

		private void OnCollapseOnClickAction()
		{
			if (AssociatedObject!.Bounds.Width <= CollapseThreshold && AssociatedObject!.IsPaneOpen)
			{
				AssociatedObject!.IsPaneOpen = false;
			}
		}

		private void OnToggleAction()
		{
			if (AssociatedObject!.Bounds.Width > CollapseThreshold)
			{
				_sidebarWasForceClosed = AssociatedObject!.IsPaneOpen;
			}

			AssociatedObject!.IsPaneOpen = !AssociatedObject!.IsPaneOpen;
		}

		private void SplitViewBoundsChanged(Rect x)
		{
			if (AssociatedObject is null)
			{
				return;
			}

			if (x.Width <= CollapseThreshold)
			{
				AssociatedObject.DisplayMode = SplitViewDisplayMode.CompactOverlay;

				if (!_sidebarWasForceClosed && AssociatedObject.IsPaneOpen)
				{
					AssociatedObject.IsPaneOpen = false;
				}
			}
			else
			{
				AssociatedObject.DisplayMode = SplitViewDisplayMode.CompactInline;

				if (!_sidebarWasForceClosed && !AssociatedObject.IsPaneOpen)
				{
					AssociatedObject.IsPaneOpen = true;
				}
			}
		}
	}
}


text:
package edu.uw.zookeeper.safari.schema.volumes;

import static com.google.common.base.Preconditions.*;

import com.google.common.collect.ImmutableSet;

import edu.uw.zookeeper.data.ZNodePath;
import edu.uw.zookeeper.safari.Identifier;
import edu.uw.zookeeper.safari.VersionedValue;

public final class VolumeLeaves extends VolumeVersion<ImmutableSet<Identifier>> {

    public static VolumeLeaves valueOf(
            Identifier id,
            ZNodePath path,
            VersionedValue<ImmutableSet<Identifier>> state) {
        return valueOf(VolumeDescriptor.valueOf(id, path), state);
    }

    public static VolumeLeaves valueOf(
            VolumeDescriptor descriptor,
            VersionedValue<ImmutableSet<Identifier>> state) {
        return new VolumeLeaves(descriptor, state);
    }

    protected VolumeLeaves(
            VolumeDescriptor descriptor,
            VersionedValue<ImmutableSet<Identifier>> state) {
        super(descriptor, checkNotNull(state));
    }
}


text: Demos for Windows 10 Dev Readiness