text:
class Repositext
  class Validation
    class Validator
      # Depending on @options[:gap_mark_tagging_import_consistency_compare_mode], validates:
      # * 'pre_import':
      #   that the text contents in gap_mark_tagging_import still match those of content_at
      #   Purpose: To make sure that import is based on current content_at.
      # * 'post_import':
      #   that the gap_mark_tagging_import file is identical to a
      #   gap_mark_tagging_export generated from the new content AT (with updated gap_marks)
      #   Purpose: To make sure that the import worked correctly and nothing
      #   was changed inadvertently.
      class GapMarkTaggingImportConsistency < Validator

        class TextMismatchError < ::StandardError; end

        # Runs all validations for self
        def run
          # @file_to_validate is an array with the content_at and
          # gap_mark_tagging_import files
          content_at_file, gap_mark_tagging_import_file = @file_to_validate
          outcome = contents_match?(
            content_at_file.contents,
            gap_mark_tagging_import_file.contents
          )
          log_and_report_validation_step(outcome.errors, outcome.warnings)
        end

      private

        # Checks if contents match (depending on @options[:gap_mark_tagging_import_consistency_compare_mode])
        # @param [String] content_at
        # @param [String] gap_mark_tagging_import
        # @return [Outcome]
        def contents_match?(content_at, gap_mark_tagging_import)
          # We have to export content_at in both cases to a temporary gap_mark_tagging_export
          # so that we can compare it with the gap_mark_tagging_import
          tmp_gap_mark_tagging_export = Repositext::Process::Export::GapMarkTagging.new(content_at).export.result
          case @options[:gap_mark_tagging_import_consistency_compare_mode]
          when 'pre_import'
            # We re-export the existing content_at to gap_mark_tagging
            # and compare the result with gap_mark_tagging_import after removing
            # subtitle_marks and gap_marks in both since we expect them to change.
            string_1 = Repositext::Process::Merge::GapMarkTaggingImportIntoContentAt.remove_gap_marks_and_omit_classes(tmp_gap_mark_tagging_export)
            string_2 = Repositext::Process::Merge::GapMarkTaggingImportIntoContentAt.remove_gap_marks_and_omit_classes(gap_mark_tagging_import)
            error_message = "\n\nText mismatch between gap_mark_tagging_import and content_at in #{ @file_to_validate.last.filename }."
          when 'post_import'
            # We re-export the new content_at to gap_mark_tagging and compare the result
            # with gap_mark_tagging_import. We remove subtitle_marks since they
            # are stripped during gap_mark_tagging export. We leave gap_marks in
            # place since they should be identical if everything works correctly.
            string_1 = gap_mark_tagging_import.gsub(/[@]/, '')
            string_2 = tmp_gap_mark_tagging_export.gsub(/[@]/, '')
            error_message = "\n\nText mismatch between gap_mark_tagging_import and gap_mark_tagging_export from content_at in #{ @file_to_validate.last.filename }."
          else
            raise "Invalid compare mode: #{ @options[:gap_mark_tagging_import_consistency_compare_mode].inspect }"
          end

          diffs = Suspension::StringComparer.compare(string_1, string_2)

          if diffs.empty?
            Outcome.new(true, nil)
          else
            # We want to terminate an import if the text is not consistent.
            # Normally we'd return a negative outcome (see below), but in this
            # case we raise an exception.
            # Outcome.new(
            #   false, nil, [],
            #   [
            #     Reportable.error(
            #       [@file_to_validate.last], # gap_mark_tagging_import file
            #       [
            #         'Text mismatch between gap_mark_tagging_import and content_at:',
            #         diffs.inspect
            #       ]
            #     )
            #   ]
            # )
            raise TextMismatchError.new(
              [
                error_message,
                "Cannot proceed with import. Please resolve text differences first:",
                diffs.inspect
              ].join("\n")
            )
          end
        end

      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
package org.springframework.web.servlet.tags.form;

import java.beans.PropertyEditor;
import java.beans.PropertyEditorSupport;
import java.io.StringReader;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;

import jakarta.servlet.jsp.JspException;
import jakarta.servlet.jsp.tagext.Tag;
import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import org.junit.jupiter.api.Test;

import org.springframework.beans.propertyeditors.CustomCollectionEditor;
import org.springframework.beans.testfixture.beans.TestBean;
import org.springframework.format.Formatter;
import org.springframework.format.support.FormattingConversionService;
import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.validation.BindingResult;
import org.springframework.web.servlet.support.BindStatus;
import org.springframework.web.servlet.tags.TransformTag;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;

/**
 * @author Rob Harrop
 * @author Juergen Hoeller
 * @author Jeremy Grelle
 * @author Dave Syer
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
public class SelectTagTests extends AbstractFormTagTests {

	private static final Locale LOCALE_AT = new Locale("de", "AT");
	private static final Locale LOCALE_NL = new Locale("nl", "NL");

	private SelectTag tag;

	private TestBeanWithRealCountry bean;

	@Override
	@SuppressWarnings("serial")
	protected void onSetUp() {
		this.tag = new SelectTag() {
			@Override
			protected TagWriter createTagWriter() {
				return new TagWriter(getWriter());
			}
		};
		this.tag.setPageContext(getPageContext());
	}

	@Test
	public void dynamicAttributes() throws JspException {
		String dynamicAttribute1 = "attr1";
		String dynamicAttribute2 = "attr2";

		this.tag.setPath("country");
		this.tag.setItems(Collections.EMPTY_LIST);
		this.tag.setItemValue("isoCode");
		this.tag.setItemLabel("name");
		this.tag.setDynamicAttribute(null, dynamicAttribute1, dynamicAttribute1);
		this.tag.setDynamicAttribute(null, dynamicAttribute2, dynamicAttribute2);

		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		assertContainsAttribute(output, dynamicAttribute1, dynamicAttribute1);
		assertContainsAttribute(output, dynamicAttribute2, dynamicAttribute2);
	}

	@Test
	public void emptyItems() throws Exception {
		this.tag.setPath("country");
		this.tag.setItems(Collections.EMPTY_LIST);

		this.tag.setItemValue("isoCode");
		this.tag.setItemLabel("name");
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		assertThat(output).isEqualTo("<select id=\"country\" name=\"country\"></select>");
	}

	@Test
	public void nullItems() throws Exception {
		this.tag.setPath("country");
		this.tag.setItems(null);

		this.tag.setItemValue("isoCode");
		this.tag.setItemLabel("name");
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		assertThat(output).isEqualTo("<select id=\"country\" name=\"country\"></select>");
	}

	@Test
	public void withList() throws Exception {
		this.tag.setPath("country");
		this.tag.setItems(Country.getCountries());
		assertList(true);
	}

	@Test
	public void withResolvedList() throws Exception {
		this.tag.setPath("country");
		this.tag.setItems(Country.getCountries());
		assertList(true);
	}

	@Test
	public void withOtherValue() throws Exception {
		TestBean tb = getTestBean();
		tb.setCountry("AT");
		this.tag.setPath("country");
		this.tag.setItems(Country.getCountries());
		assertList(false);
	}

	@Test
	public void withNullValue() throws Exception {
		TestBean tb = getTestBean();
		tb.setCountry(null);
		this.tag.setPath("country");
		this.tag.setItems(Country.getCountries());
		assertList(false);
	}

	@Test
	public void withListAndNoLabel() throws Exception {
		this.tag.setPath("country");
		this.tag.setItems(Country.getCountries());
		this.tag.setItemValue("isoCode");
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);
		validateOutput(getOutput(), true);
	}

	@Test
	public void withListAndTransformTag() throws Exception {
		this.tag.setPath("country");
		this.tag.setItems(Country.getCountries());
		assertList(true);

		TransformTag transformTag = new TransformTag();
		transformTag.setValue(Country.getCountries().get(0));
		transformTag.setVar("key");
		transformTag.setParent(this.tag);
		transformTag.setPageContext(getPageContext());
		transformTag.doStartTag();
		assertThat(getPageContext().findAttribute("key")).isEqualTo("Austria(AT)");
	}

	@Test
	public void withListAndTransformTagAndEditor() throws Exception {
		this.tag.setPath("realCountry");
		this.tag.setItems(Country.getCountries());
		BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(getTestBean(), "testBean");
		bindingResult.getPropertyAccessor().registerCustomEditor(Country.class, new PropertyEditorSupport() {
			@Override
			public void setAsText(String text) throws IllegalArgumentException {
				setValue(Country.getCountryWithIsoCode(text));
			}
			@Override
			public String getAsText() {
				return ((Country) getValue()).getName();
			}
		});
		getPageContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "testBean", bindingResult);
		this.tag.doStartTag();

		TransformTag transformTag = new TransformTag();
		transformTag.setValue(Country.getCountries().get(0));
		transformTag.setVar("key");
		transformTag.setParent(this.tag);
		transformTag.setPageContext(getPageContext());
		transformTag.doStartTag();
		assertThat(getPageContext().findAttribute("key")).isEqualTo("Austria");
	}

	@Test
	public void withListAndEditor() throws Exception {
		this.tag.setPath("realCountry");
		this.tag.setItems(Country.getCountries());
		this.tag.setItemValue("isoCode");
		this.tag.setItemLabel("name");
		BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(getTestBean(), "testBean");
		bindingResult.getPropertyAccessor().registerCustomEditor(Country.class, new PropertyEditorSupport() {
			@Override
			public void setAsText(String text) throws IllegalArgumentException {
				setValue(Country.getCountryWithIsoCode(text));
			}
			@Override
			public String getAsText() {
				return ((Country) getValue()).getName();
			}
		});
		getPageContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "testBean", bindingResult);
		this.tag.doStartTag();
		String output = getOutput();
		assertThat(output.startsWith("<select ")).isTrue();
		assertThat(output.endsWith("</select>")).isTrue();
		assertThat(output.contains("option value=\"AT\" selected=\"selected\">Austria")).isTrue();
	}

	@Test
	public void nestedPathWithListAndEditorAndNullValue() throws Exception {
		this.tag.setPath("bean.realCountry");
		this.tag.setItems(Country.getCountries());
		this.tag.setItemValue("isoCode");
		this.tag.setItemLabel("name");
		this.tag.setMultiple("false");
		TestBeanWrapper testBean = new TestBeanWrapper();
		TestBeanWithRealCountry withCountry = (TestBeanWithRealCountry) getTestBean();
		withCountry.setRealCountry(null);
		testBean.setBean(withCountry);
		BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(testBean , "testBean");
		bindingResult.getPropertyAccessor().registerCustomEditor(Country.class, new PropertyEditorSupport() {
			@Override
			public void setAsText(String text) throws IllegalArgumentException {
				if (text==null || text.length()==0) {
					setValue(null);
					return;
				}
				setValue(Country.getCountryWithIsoCode(text));
			}
			@Override
			public String getAsText() {
				Country value = (Country) getValue();
				if (value==null) {
					return null;
				}
				return value.getName();
			}
		});
		getPageContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "testBean", bindingResult);
		this.tag.doStartTag();
		String output = getOutput();
		assertThat(output.startsWith("<select ")).isTrue();
		assertThat(output.endsWith("</select>")).isTrue();
		assertThat(output.contains("selected=\"selected\"")).isFalse();
		assertThat(output.contains("multiple=\"multiple\"")).isFalse();
	}

	@Test
	public void nestedPathWithListAndEditor() throws Exception {
		this.tag.setPath("bean.realCountry");
		this.tag.setItems(Country.getCountries());
		this.tag.setItemValue("isoCode");
		this.tag.setItemLabel("name");
		TestBeanWrapper testBean = new TestBeanWrapper();
		testBean.setBean(getTestBean());
		BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(testBean , "testBean");
		bindingResult.getPropertyAccessor().registerCustomEditor(Country.class, new PropertyEditorSupport() {
			@Override
			public void setAsText(String text) throws IllegalArgumentException {
				setValue(Country.getCountryWithIsoCode(text));
			}
			@Override
			public String getAsText() {
				return ((Country) getValue()).getName();
			}
		});
		getPageContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "testBean", bindingResult);
		this.tag.doStartTag();
		String output = getOutput();
		assertThat(output.startsWith("<select ")).isTrue();
		assertThat(output.endsWith("</select>")).isTrue();
		assertThat(output.contains("option value=\"AT\" selected=\"selected\">Austria")).isTrue();
	}

	@Test
	public void withListAndEditorAndNullValue() throws Exception {
		this.tag.setPath("realCountry");
		this.tag.setItems(Country.getCountries());
		this.tag.setItemValue("isoCode");
		this.tag.setItemLabel("name");
		TestBeanWithRealCountry testBean = (TestBeanWithRealCountry) getTestBean();
		testBean.setRealCountry(null);
		BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(testBean, "testBean");
		bindingResult.getPropertyAccessor().registerCustomEditor(Country.class, new PropertyEditorSupport() {
			@Override
			public void setAsText(String text) throws IllegalArgumentException {
				setValue(Country.getCountryWithIsoCode(text));
			}
			@Override
			public String getAsText() {
				Country value = (Country) getValue();
				if (value==null) {
					return "";
				}
				return value.getName();
			}
		});
		getPageContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "testBean", bindingResult);
		this.tag.doStartTag();
		String output = getOutput();
		assertThat(output.startsWith("<select ")).isTrue();
		assertThat(output.endsWith("</select>")).isTrue();
		assertThat(output.contains("selected=\"selected\"")).isFalse();
	}

	@Test
	public void withMap() throws Exception {
		this.tag.setPath("sex");
		this.tag.setItems(getSexes());
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);
	}

	@Test
	public void withInvalidList() throws Exception {
		this.tag.setPath("country");
		this.tag.setItems(new TestBean());
		this.tag.setItemValue("isoCode");
		assertThatExceptionOfType(JspException.class).as("use a non-Collection typed value as the value of 'items'").isThrownBy(
				this.tag::doStartTag)
			.withMessageContaining("items")
			.withMessageContaining("org.springframework.beans.testfixture.beans.TestBean");
	}

	@Test
	public void withNestedOptions() throws Exception {
		this.tag.setPath("country");
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.EVAL_BODY_INCLUDE);

		BindStatus value = (BindStatus) getPageContext().getAttribute(SelectTag.LIST_VALUE_PAGE_ATTRIBUTE);
		assertThat(value.getValue()).as("Selected country not exposed in page context").isEqualTo("UK");

		result = this.tag.doEndTag();
		assertThat(result).isEqualTo(Tag.EVAL_PAGE);
		this.tag.doFinally();

		String output = getOutput();
		assertThat(output.startsWith("<select ")).isTrue();
		assertThat(output.endsWith("</select>")).isTrue();
		assertContainsAttribute(output, "name", "country");
	}

	@Test
	public void withStringArray() throws Exception {
		this.tag.setPath("name");
		this.tag.setItems(getNames());
		assertStringArray();
	}

	@Test
	public void withResolvedStringArray() throws Exception {
		this.tag.setPath("name");
		this.tag.setItems(getNames());
		assertStringArray();
	}

	@Test
	public void withIntegerArray() throws Exception {
		this.tag.setPath("someIntegerArray");
		Integer[] array = new Integer[50];
		for (int i = 0; i < array.length; i++) {
			array[i] = i;
		}
		this.tag.setItems(array);
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		output = "<doc>" + output + "</doc>";

		SAXReader reader = new SAXReader();
		Document document = reader.read(new StringReader(output));
		Element rootElement = document.getRootElement();
		assertThat(rootElement.elements()).hasSize(2);

		Element selectElement = rootElement.element("select");
		assertThat(selectElement.getName()).isEqualTo("select");
		assertThat(selectElement.attribute("name").getValue()).isEqualTo("someIntegerArray");

		List children = selectElement.elements();
		assertThat(children.size()).as("Incorrect number of children").isEqualTo(array.length);

		Element e = (Element) selectElement.selectSingleNode("option[text() = '12']");
		assertThat(e.attribute("selected").getValue()).as("'12' node not selected").isEqualTo("selected");

		e = (Element) selectElement.selectSingleNode("option[text() = '34']");
		assertThat(e.attribute("selected").getValue()).as("'34' node not selected").isEqualTo("selected");
	}

	@Test
	public void withFloatCustom() throws Exception {
		PropertyEditor propertyEditor = new SimpleFloatEditor();
		BeanPropertyBindingResult errors = new BeanPropertyBindingResult(getTestBean(), COMMAND_NAME);
		errors.getPropertyAccessor().registerCustomEditor(Float.class, propertyEditor);
		exposeBindingResult(errors);

		this.tag.setPath("myFloat");

		Float[] array = new Float[] {
				Float.valueOf("12.30"), Float.valueOf("12.32"), Float.valueOf("12.34"), Float.valueOf("12.36"),
				Float.valueOf("12.38"), Float.valueOf("12.40"), Float.valueOf("12.42"), Float.valueOf("12.44"),
				Float.valueOf("12.46"), Float.valueOf("12.48")
		};

		this.tag.setItems(array);
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		assertThat(output.startsWith("<select ")).isTrue();
		assertThat(output.endsWith("</select>")).isTrue();

		SAXReader reader = new SAXReader();
		Document document = reader.read(new StringReader(output));
		Element rootElement = document.getRootElement();
		assertThat(rootElement.getName()).isEqualTo("select");
		assertThat(rootElement.attribute("name").getValue()).isEqualTo("myFloat");
		List children = rootElement.elements();
		assertThat(children.size()).as("Incorrect number of children").isEqualTo(array.length);

		Element e = (Element) rootElement.selectSingleNode("option[text() = '12.34f']");
		assertThat(e.attribute("selected").getValue()).as("'12.34' node not selected").isEqualTo("selected");

		e = (Element) rootElement.selectSingleNode("option[text() = '12.32f']");
		assertThat(e.attribute("selected")).as("'12.32' node incorrectly selected").isNull();
	}

	@Test
	public void withMultiList() throws Exception {
		List list = new ArrayList();
		list.add(Country.COUNTRY_UK);
		list.add(Country.COUNTRY_AT);
		this.bean.setSomeList(list);

		this.tag.setPath("someList");
		this.tag.setItems(Country.getCountries());
		this.tag.setItemValue("isoCode");
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		output = "<doc>" + output + "</doc>";

		SAXReader reader = new SAXReader();
		Document document = reader.read(new StringReader(output));
		Element rootElement = document.getRootElement();
		assertThat(rootElement.elements()).hasSize(2);

		Element selectElement = rootElement.element("select");
		assertThat(selectElement.getName()).isEqualTo("select");
		assertThat(selectElement.attribute("name").getValue()).isEqualTo("someList");

		List children = selectElement.elements();
		assertThat(children.size()).as("Incorrect number of children").isEqualTo(4);

		Element e = (Element) selectElement.selectSingleNode("option[@value = 'UK']");
		assertThat(e.attribute("selected").getValue()).as("UK node not selected").isEqualTo("selected");
		assertThat(e.getText()).isEqualTo("United Kingdom(UK)");

		e = (Element) selectElement.selectSingleNode("option[@value = 'AT']");
		assertThat(e.attribute("selected").getValue()).as("AT node not selected").isEqualTo("selected");
		assertThat(e.getText()).isEqualTo("Austria(AT)");
	}

	@Test
	public void withElementFormatter() throws Exception {
		this.bean.setRealCountry(Country.COUNTRY_UK);

		BeanPropertyBindingResult errors = new BeanPropertyBindingResult(this.bean, COMMAND_NAME);
		FormattingConversionService cs = new FormattingConversionService();
		cs.addFormatterForFieldType(Country.class, new Formatter<Country>() {
			@Override
			public String print(Country object, Locale locale) {
				return object.getName();
			}
			@Override
			public Country parse(String text, Locale locale) throws ParseException {
				return new Country(text, text);
			}
		});
		errors.initConversion(cs);
		exposeBindingResult(errors);

		this.tag.setPath("realCountry");
		this.tag.setItems(Country.getCountries());
		this.tag.setItemValue("isoCode");
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		output = "<doc>" + output + "</doc>";

		SAXReader reader = new SAXReader();
		Document document = reader.read(new StringReader(output));
		Element rootElement = document.getRootElement();
		assertThat(rootElement.elements()).hasSize(1);

		Element selectElement = rootElement.element("select");
		assertThat(selectElement.getName()).isEqualTo("select");
		assertThat(selectElement.attribute("name").getValue()).isEqualTo("realCountry");

		List children = selectElement.elements();
		assertThat(children.size()).as("Incorrect number of children").isEqualTo(4);

		Element e = (Element) selectElement.selectSingleNode("option[@value = 'UK']");
		assertThat(e.attribute("selected").getValue()).as("UK node not selected").isEqualTo("selected");
		assertThat(e.getText()).isEqualTo("United Kingdom");
	}

	@Test
	public void withMultiListAndElementFormatter() throws Exception {
		List list = new ArrayList();
		list.add(Country.COUNTRY_UK);
		list.add(Country.COUNTRY_AT);
		this.bean.setSomeList(list);

		BeanPropertyBindingResult errors = new BeanPropertyBindingResult(this.bean, COMMAND_NAME);
		FormattingConversionService cs = new FormattingConversionService();
		cs.addFormatterForFieldType(Country.class, new Formatter<Country>() {
			@Override
			public String print(Country object, Locale locale) {
				return object.getName();
			}
			@Override
			public Country parse(String text, Locale locale) throws ParseException {
				return new Country(text, text);
			}
		});
		errors.initConversion(cs);
		exposeBindingResult(errors);

		this.tag.setPath("someList");
		this.tag.setItems(Country.getCountries());
		this.tag.setItemValue("isoCode");
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		output = "<doc>" + output + "</doc>";

		SAXReader reader = new SAXReader();
		Document document = reader.read(new StringReader(output));
		Element rootElement = document.getRootElement();
		assertThat(rootElement.elements()).hasSize(2);

		Element selectElement = rootElement.element("select");
		assertThat(selectElement.getName()).isEqualTo("select");
		assertThat(selectElement.attribute("name").getValue()).isEqualTo("someList");

		List children = selectElement.elements();
		assertThat(children.size()).as("Incorrect number of children").isEqualTo(4);

		Element e = (Element) selectElement.selectSingleNode("option[@value = 'UK']");
		assertThat(e.attribute("selected").getValue()).as("UK node not selected").isEqualTo("selected");
		assertThat(e.getText()).isEqualTo("United Kingdom");

		e = (Element) selectElement.selectSingleNode("option[@value = 'AT']");
		assertThat(e.attribute("selected").getValue()).as("AT node not selected").isEqualTo("selected");
		assertThat(e.getText()).isEqualTo("Austria");
	}

	@Test
	public void withMultiListAndCustomEditor() throws Exception {
		List list = new ArrayList();
		list.add(Country.COUNTRY_UK);
		list.add(Country.COUNTRY_AT);
		this.bean.setSomeList(list);

		BeanPropertyBindingResult errors = new BeanPropertyBindingResult(this.bean, COMMAND_NAME);
		errors.getPropertyAccessor().registerCustomEditor(List.class, new CustomCollectionEditor(ArrayList.class) {
			@Override
			public String getAsText() {
				return getValue().toString();
			}
		});
		exposeBindingResult(errors);

		this.tag.setPath("someList");
		this.tag.setItems(Country.getCountries());
		this.tag.setItemValue("isoCode");
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		output = "<doc>" + output + "</doc>";

		SAXReader reader = new SAXReader();
		Document document = reader.read(new StringReader(output));
		Element rootElement = document.getRootElement();
		assertThat(rootElement.elements()).hasSize(2);

		Element selectElement = rootElement.element("select");
		assertThat(selectElement.getName()).isEqualTo("select");
		assertThat(selectElement.attribute("name").getValue()).isEqualTo("someList");

		List children = selectElement.elements();
		assertThat(children.size()).as("Incorrect number of children").isEqualTo(4);

		Element e = (Element) selectElement.selectSingleNode("option[@value = 'UK']");
		assertThat(e.attribute("selected").getValue()).as("UK node not selected").isEqualTo("selected");

		e = (Element) selectElement.selectSingleNode("option[@value = 'AT']");
		assertThat(e.attribute("selected").getValue()).as("AT node not selected").isEqualTo("selected");
	}

	@Test
	public void withMultiMap() throws Exception {
		Map someMap = new HashMap();
		someMap.put("M", "Male");
		someMap.put("F", "Female");
		this.bean.setSomeMap(someMap);

		this.tag.setPath("someMap");
		this.tag.setItems(getSexes());

		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		output = "<doc>" + output + "</doc>";

		SAXReader reader = new SAXReader();
		Document document = reader.read(new StringReader(output));
		Element rootElement = document.getRootElement();
		assertThat(rootElement.elements()).hasSize(2);

		Element selectElement = rootElement.element("select");
		assertThat(selectElement.getName()).isEqualTo("select");
		assertThat(selectElement.attribute("name").getValue()).isEqualTo("someMap");

		List children = selectElement.elements();
		assertThat(children.size()).as("Incorrect number of children").isEqualTo(2);

		Element e = (Element) selectElement.selectSingleNode("option[@value = 'M']");
		assertThat(e.attribute("selected").getValue()).as("M node not selected").isEqualTo("selected");

		e = (Element) selectElement.selectSingleNode("option[@value = 'F']");
		assertThat(e.attribute("selected").getValue()).as("F node not selected").isEqualTo("selected");
	}

	/**
	 * Tests new support added as a result of <a
	 * href="https://opensource.atlassian.com/projects/spring/browse/SPR-2660"
	 * target="_blank">SPR-2660</a>.
	 * <p>
	 * Specifically, if the {@code items} attribute is supplied a
	 * {@link Map}, and {@code itemValue} and {@code itemLabel}
	 * are supplied non-null values, then:
	 * </p>
	 * <ul>
	 * <li>{@code itemValue} will be used as the property name of the
	 * map's <em>key</em>, and</li>
	 * <li>{@code itemLabel} will be used as the property name of the
	 * map's <em>value</em>.</li>
	 * </ul>
	 */
	@Test
	public void withMultiMapWithItemValueAndItemLabel() throws Exception {
		// Save original default locale.
		final Locale defaultLocale = Locale.getDefault();
		// Use a locale that doesn't result in the generation of HTML entities
		// (e.g., not German, where \u00e4 becomes ä)
		Locale.setDefault(Locale.US);

		try {
			final Country austria = Country.COUNTRY_AT;
			final Country usa = Country.COUNTRY_US;
			final Map someMap = new HashMap();
			someMap.put(austria, LOCALE_AT);
			someMap.put(usa, Locale.US);
			this.bean.setSomeMap(someMap);

			this.tag.setPath("someMap"); // see: TestBean
			this.tag.setItems(getCountryToLocaleMap());
			this.tag.setItemValue("isoCode"); // Map key: Country
			this.tag.setItemLabel("displayLanguage"); // Map value: Locale

			BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(getTestBean(), COMMAND_NAME);
			bindingResult.getPropertyAccessor().registerCustomEditor(Country.class, new PropertyEditorSupport() {
				@Override
				public void setAsText(final String text) throws IllegalArgumentException {
					setValue(Country.getCountryWithIsoCode(text));
				}

				@Override
				public String getAsText() {
					return ((Country) getValue()).getIsoCode();
				}
			});
			exposeBindingResult(bindingResult);

			int result = this.tag.doStartTag();
			assertThat(result).isEqualTo(Tag.SKIP_BODY);

			String output = getOutput();
			output = "<doc>" + output + "</doc>";

			SAXReader reader = new SAXReader();
			Document document = reader.read(new StringReader(output));
			Element rootElement = document.getRootElement();
			assertThat(rootElement.elements()).hasSize(2);

			Element selectElement = rootElement.element("select");
			assertThat(selectElement.getName()).isEqualTo("select");
			assertThat(selectElement.attribute("name").getValue()).isEqualTo("someMap");

			List children = selectElement.elements();
			assertThat(children.size()).as("Incorrect number of children").isEqualTo(3);

			Element e;
			e = (Element) selectElement.selectSingleNode("option[@value = '" + austria.getIsoCode() + "']");
			assertThat(e).as("Option node not found with Country ISO code value [" + austria.getIsoCode() + "].").isNotNull();
			assertThat(e.attribute("selected").getValue()).as("AT node not selected.").isEqualTo("selected");
			assertThat(e.getData()).as("AT Locale displayLanguage property not used for option label.").isEqualTo(LOCALE_AT.getDisplayLanguage());

			e = (Element) selectElement.selectSingleNode("option[@value = '" + usa.getIsoCode() + "']");
			assertThat(e).as("Option node not found with Country ISO code value [" + usa.getIsoCode() + "].").isNotNull();
			assertThat(e.attribute("selected").getValue()).as("US node not selected.").isEqualTo("selected");
			assertThat(e.getData()).as("US Locale displayLanguage property not used for option label.").isEqualTo(Locale.US.getDisplayLanguage());

		}
		finally {
			// Restore original default locale.
			Locale.setDefault(defaultLocale);
		}
	}

	@Test
	public void multipleForCollection() throws Exception {
		this.bean.setSomeList(new ArrayList());

		this.tag.setPath("someList");
		this.tag.setItems(Country.getCountries());
		this.tag.setItemValue("isoCode");
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		output = "<doc>" + output + "</doc>";

		SAXReader reader = new SAXReader();
		Document document = reader.read(new StringReader(output));
		Element rootElement = document.getRootElement();
		assertThat(rootElement.elements()).hasSize(2);

		Element selectElement = rootElement.element("select");
		assertThat(selectElement.getName()).isEqualTo("select");
		assertThat(selectElement.attribute("name").getValue()).isEqualTo("someList");
		assertThat(selectElement.attribute("multiple").getValue()).isEqualTo("multiple");

		List children = selectElement.elements();
		assertThat(children.size()).as("Incorrect number of children").isEqualTo(4);

		Element inputElement = rootElement.element("input");
		assertThat(inputElement).isNotNull();
	}

	@Test
	public void multipleWithStringValue() throws Exception {
		this.tag.setPath("name");
		this.tag.setItems(Country.getCountries());
		this.tag.setItemValue("isoCode");
		this.tag.setMultiple("multiple");
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		output = "<doc>" + output + "</doc>";

		SAXReader reader = new SAXReader();
		Document document = reader.read(new StringReader(output));
		Element rootElement = document.getRootElement();
		assertThat(rootElement.elements()).hasSize(2);

		Element selectElement = rootElement.element("select");
		assertThat(selectElement.getName()).isEqualTo("select");
		assertThat(selectElement.attribute("name").getValue()).isEqualTo("name");
		assertThat(selectElement.attribute("multiple").getValue()).isEqualTo("multiple");

		List children = selectElement.elements();
		assertThat(children.size()).as("Incorrect number of children").isEqualTo(4);

		Element inputElement = rootElement.element("input");
		assertThat(inputElement).isNotNull();
	}

	@Test
	public void multipleExplicitlyTrue() throws Exception {
		this.tag.setPath("name");
		this.tag.setItems(Country.getCountries());
		this.tag.setItemValue("isoCode");
		this.tag.setMultiple("true");
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		output = "<doc>" + output + "</doc>";

		SAXReader reader = new SAXReader();
		Document document = reader.read(new StringReader(output));
		Element rootElement = document.getRootElement();
		assertThat(rootElement.elements()).hasSize(2);

		Element selectElement = rootElement.element("select");
		assertThat(selectElement.getName()).isEqualTo("select");
		assertThat(selectElement.attribute("name").getValue()).isEqualTo("name");
		assertThat(selectElement.attribute("multiple").getValue()).isEqualTo("multiple");

		List children = selectElement.elements();
		assertThat(children.size()).as("Incorrect number of children").isEqualTo(4);

		Element inputElement = rootElement.element("input");
		assertThat(inputElement).isNotNull();
	}

	@Test
	public void multipleExplicitlyFalse() throws Exception {
		this.tag.setPath("name");
		this.tag.setItems(Country.getCountries());
		this.tag.setItemValue("isoCode");
		this.tag.setMultiple("false");
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		output = "<doc>" + output + "</doc>";

		SAXReader reader = new SAXReader();
		Document document = reader.read(new StringReader(output));
		Element rootElement = document.getRootElement();
		assertThat(rootElement.elements()).hasSize(1);

		Element selectElement = rootElement.element("select");
		assertThat(selectElement.getName()).isEqualTo("select");
		assertThat(selectElement.attribute("name").getValue()).isEqualTo("name");
		assertThat(selectElement.attribute("multiple")).isNull();

		List children = selectElement.elements();
		assertThat(children.size()).as("Incorrect number of children").isEqualTo(4);
	}

	@Test
	public void multipleWithBooleanTrue() throws Exception {
		this.tag.setPath("name");
		this.tag.setItems(Country.getCountries());
		this.tag.setItemValue("isoCode");
		this.tag.setMultiple(true);
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		output = "<doc>" + output + "</doc>";

		SAXReader reader = new SAXReader();
		Document document = reader.read(new StringReader(output));
		Element rootElement = document.getRootElement();
		assertThat(rootElement.elements()).hasSize(2);

		Element selectElement = rootElement.element("select");
		assertThat(selectElement.getName()).isEqualTo("select");
		assertThat(selectElement.attribute("name").getValue()).isEqualTo("name");
		assertThat(selectElement.attribute("multiple").getValue()).isEqualTo("multiple");

		List children = selectElement.elements();
		assertThat(children.size()).as("Incorrect number of children").isEqualTo(4);

		Element inputElement = rootElement.element("input");
		assertThat(inputElement).isNotNull();
	}

	@Test
	public void multipleWithBooleanFalse() throws Exception {
		this.tag.setPath("name");
		this.tag.setItems(Country.getCountries());
		this.tag.setItemValue("isoCode");
		this.tag.setMultiple(false);
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		output = "<doc>" + output + "</doc>";

		SAXReader reader = new SAXReader();
		Document document = reader.read(new StringReader(output));
		Element rootElement = document.getRootElement();
		assertThat(rootElement.elements()).hasSize(1);

		Element selectElement = rootElement.element("select");
		assertThat(selectElement.getName()).isEqualTo("select");
		assertThat(selectElement.attribute("name").getValue()).isEqualTo("name");
		assertThat(selectElement.attribute("multiple")).isNull();

		List children = selectElement.elements();
		assertThat(children.size()).as("Incorrect number of children").isEqualTo(4);
	}

	private void assertStringArray() throws JspException, DocumentException {
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		assertThat(output.startsWith("<select ")).isTrue();
		assertThat(output.endsWith("</select>")).isTrue();

		SAXReader reader = new SAXReader();
		Document document = reader.read(new StringReader(output));
		Element rootElement = document.getRootElement();
		assertThat(rootElement.getName()).isEqualTo("select");
		assertThat(rootElement.attribute("name").getValue()).isEqualTo("name");

		List children = rootElement.elements();
		assertThat(children.size()).as("Incorrect number of children").isEqualTo(4);

		Element e = (Element) rootElement.selectSingleNode("option[text() = 'Rob']");
		assertThat(e.attribute("selected").getValue()).as("Rob node not selected").isEqualTo("selected");
	}

	private Map getCountryToLocaleMap() {
		Map map = new TreeMap((o1, o2) -> ((Country)o1).getName().compareTo(((Country)o2).getName()));
		map.put(Country.COUNTRY_AT, LOCALE_AT);
		map.put(Country.COUNTRY_NL, LOCALE_NL);
		map.put(Country.COUNTRY_US, Locale.US);
		return map;
	}

	private String[] getNames() {
		return new String[]{"Rod", "Rob", "Juergen", "Adrian"};
	}

	private Map getSexes() {
		Map<String, String> sexes = new HashMap<>();
		sexes.put("F", "Female");
		sexes.put("M", "Male");
		return sexes;
	}

	private void assertList(boolean selected) throws JspException, DocumentException {
		this.tag.setItemValue("isoCode");
		this.tag.setItemLabel("name");
		this.tag.setSize("5");
		int result = this.tag.doStartTag();
		assertThat(result).isEqualTo(Tag.SKIP_BODY);

		String output = getOutput();
		validateOutput(output, selected);
		assertContainsAttribute(output, "size", "5");
	}

	private void validateOutput(String output, boolean selected) throws DocumentException {
		SAXReader reader = new SAXReader();
		Document document = reader.read(new StringReader(output));
		Element rootElement = document.getRootElement();
		assertThat(rootElement.getName()).isEqualTo("select");
		assertThat(rootElement.attribute("name").getValue()).isEqualTo("country");

		List children = rootElement.elements();
		assertThat(children.size()).as("Incorrect number of children").isEqualTo(4);

		Element e = (Element) rootElement.selectSingleNode("option[@value = 'UK']");
		Attribute selectedAttr = e.attribute("selected");
		if (selected) {
			assertThat(selectedAttr != null && "selected".equals(selectedAttr.getValue())).isTrue();
		}
		else {
			assertThat(selectedAttr).isNull();
		}
	}

	@Override
	protected TestBean createTestBean() {
		this.bean = new TestBeanWithRealCountry();
		this.bean.setName("Rob");
		this.bean.setCountry("UK");
		this.bean.setSex("M");
		this.bean.setMyFloat(Float.valueOf("12.34"));
		this.bean.setSomeIntegerArray(new Integer[]{12, 34});
		return this.bean;
	}

	private TestBean getTestBean() {
		return (TestBean) getPageContext().getRequest().getAttribute(COMMAND_NAME);
	}

	public static class TestBeanWrapper {
		private TestBean bean;

		public TestBean getBean() {
			return bean;
		}

		public void setBean(TestBean bean) {
			this.bean = bean;
		}

	}

}


text:
namespace CSC.CSClassroom.Service.Assignments.QuestionGeneration
{
	/// <summary>
	/// The result of attempting to generate a question.
	/// </summary>
	public class QuestionGenerationResult
	{
		/// <summary>
		/// The generated question, if successful.
		/// </summary>
		public string SerializedQuestion { get; }

		/// <summary>
		/// The full file used to generate the question.
		/// </summary>
		public string FullGeneratorFileContents { get; }

		/// <summary>
		/// The line offset in the file used to generate the question.
		/// </summary>
		public int FullGeneratorFileLineOffset { get; }

		/// <summary>
		/// The error text, if the question could not be generated.
		/// </summary>
		public string Error { get; }

		/// <summary>
		/// The seed used to generate the question.
		/// </summary>
		public int? Seed { get; }

		/// <summary>
		/// Constructor.
		/// </summary>
		public QuestionGenerationResult(
			string serializedQuestion,
			string fullGeneratorFileContents,
			int fullGeneratorFileLineOffset,
			int seed)
		{
			SerializedQuestion = serializedQuestion;
			FullGeneratorFileContents = fullGeneratorFileContents;
			FullGeneratorFileLineOffset = fullGeneratorFileLineOffset;
			Seed = seed;
		}

		/// <summary>
		/// Constructor.
		/// </summary>
		public QuestionGenerationResult(string error)
		{
			Error = error;
		}
	}
}


text:
drop table if exists mpp5458_test;
create table mpp5458_test (i int, b bigserial);
alter table mpp5458_test drop column b;
insert into mpp5458_test values (1);
alter table mpp5458_test add column b bigserial;

drop table if exists mpp5458_t;
create table mpp5458_t as select j as a, 'abc' as i from
generate_series(1, 10) j;

alter table mpp5458_t alter i type int; -- error out

alter table mpp5458_t alter i type text;

--cursor
begin;
declare c1 cursor for select * from mpp5458_t;
-- start_ignore
fetch 1 from c1;

select * from mpp5458_test limit 10;
-- end_ignore

drop table if exists mpp5458_test1;
create table mpp5458_test1 (i int, b bigserial);
alter table mpp5458_test1 drop column b;
insert into mpp5458_test1 values (1);
alter table mpp5458_test1 add column b bigserial;

-- start_ignore

fetch 5 from c1;
fetch 5 from c1;
-- end_ignore

close c1;

end;

drop sequence if exists mpp5458_s1;
create sequence mpp5458_s1;
-- start_ignore
select *, nextval('mpp5458_s1') from mpp5458_t;
-- end_ignore

-- prepare
prepare mpp5458_stmt as select *, nextval('mpp5458_s1') from mpp5458_t;
-- start_ignore
execute mpp5458_stmt;
-- end_ignore

deallocate mpp5458_stmt;

--cursor
begin;
declare mpp5458_c1 cursor for select *, nextval('mpp5458_s1') from mpp5458_t;

-- start_ignore

fetch 1 from mpp5458_c1;

select * from mpp5458_test limit 10;

fetch 10 from mpp5458_c1;

fetch 1 from mpp5458_c1;
-- end_ignore

close mpp5458_c1;
end;


text:
set +h		# disable hashall
shopt -s -o pipefail
set -e

PKG_NAME="fontforge"
PKG_VERSION="20150824"

TARBALL="${PKG_NAME}-${PKG_VERSION}.tar.gz"
SRC_DIR="${PKG_NAME}-${PKG_VERSION}"

function prepare() {
    ln -sv "/source/$TARBALL" "$TARBALL"
}

function unpack() {
    tar xf ${TARBALL}
}

function build() {
	sed -i 's%naist.jp/pub/NetBSD/packages%netbsd.org/pub/pkgsrc%' \
			tests/Makefile.in &&
	./configure --prefix=/usr     	\
				--enable-gtk2-use \
				--disable-static	&&
	make $MAKE_PARALLEL
}

function check() {
	make $MAKE_PARALLEL check
}

function instal() {
	make $MAKE_PARALLEL install

	sed -e '/Exec/ s/fontforge/& -new/' \
	    -i /usr/share/applications/fontforge.desktop
}

function clean() {
    rm -rf "${SRC_DIR}" "$TARBALL"
}

clean;prepare;unpack;pushd ${SRC_DIR};build;[[ $MAKE_CHECK = TRUE ]] && check;instal;popd;clean


text:
package model;

import java.util.logging.Logger;

import model.battlefield.Battlefield;
import model.battlefield.BattlefieldFactory;
import model.builders.MapArtisanUtil;
import model.builders.entity.definitions.DefParser;
import event.BattleFieldUpdateEvent;
import event.EventManager;

public class ModelManager {

	private static final Logger logger = Logger.getLogger(ModelManager.class.getName());

	public static final String CONFIG_PATH = "assets/data";
	public static final String DEFAULT_MAP_PATH = "assets/maps/";
	private static final double UPDATE_DELAY = 1000;
	private static final int DEFAULT_WIDTH = 64;
	private static final int DEFAULT_HEIGHT = 32;

	private static final BattlefieldFactory factory;

	private static Battlefield battlefield;
	private final static DefParser parser;
	private static double nextUpdate = 0;
	public static boolean battlefieldReady = true;

	static {
		parser = new DefParser(CONFIG_PATH);

		factory = new BattlefieldFactory();
		// setNewBattlefield();
	}

	// no instancing from outside
	private ModelManager() {

	}

	public static void updateConfigs() {
		if (System.currentTimeMillis() > nextUpdate) {
			nextUpdate = System.currentTimeMillis() + UPDATE_DELAY;
			parser.readFile();
		}
	}

	public static void loadBattlefield() {
		Battlefield loadedBattlefield = factory.loadWithFileChooser();
		setBattlefield(loadedBattlefield);
	}

	public static void loadBattlefield(String file) {
		Battlefield loadedBattlefield = factory.load(file);
		setBattlefield(loadedBattlefield);
	}

	public static void saveBattlefield() {
		factory.save(battlefield);
	}

	public static void setNewBattlefield() {
		setBattlefield(factory.getNew(DEFAULT_WIDTH, DEFAULT_HEIGHT));
	}

	private static void setBattlefield(Battlefield battlefield) {
		if (battlefield != null) {
			ModelManager.battlefield = battlefield;
			battlefieldReady = true;
			MapArtisanUtil.act(getBattlefield().getMap());
			getBattlefield().getEngagement().reset();
			EventManager.post(new BattleFieldUpdateEvent());
			logger.info("Done.");

		}
	}

	public static void reload() {
		saveBattlefield();
		Battlefield loadedBattlefield = factory.load(battlefield.getFileName());
		setBattlefield(loadedBattlefield);
	}

	public static Battlefield getBattlefield() {
		if(battlefieldReady) {
			return battlefield;
		} else {
			throw new RuntimeException("Trying to acces to battlefield while it is unavailable");
		}
	}

	public static void setBattlefieldUnavailable(){
		battlefieldReady = false;
	}
	public static void setBattlefieldReady(){
		battlefieldReady = true;
	}

}


text:
package de.craftolution.craftoplugin.core.annotations;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Declares dependencies for some class.
 */
@Retention(RetentionPolicy.RUNTIME)
public @interface Dependencies {

	Class<?>[] value();

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Class AssemblyExtensions
   </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Class AssemblyExtensions
   ">
    <meta name="generator" content="docfx 2.28.2.0">

    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                Toggle navigation

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

          Show / Hide Table of Contents

Class AssemblyExtensions

A static class that contains extension methods for the System.Reflection.Assembly class.

Inheritance

System.Object

AssemblyExtensions

Inherited Members

      System.Object.Equals(System.Object)

      System.Object.Equals(System.Object, System.Object)

      System.Object.GetHashCode()

      System.Object.GetType()

      System.Object.MemberwiseClone()

      System.Object.ReferenceEquals(System.Object, System.Object)

      System.Object.ToString()

Namespace: Juhta.Net.Extensions

Assembly: Juhta.Net.dll

Syntax

public static class AssemblyExtensions

Methods

    |
    Improve this Doc

    View Source

GetCompany(Assembly)

Gets the value of the current assembly's Company attribute.

Declaration

public static string GetCompany(this Assembly assembly)

Parameters

        Type
        Name
        Description

        System.Reflection.Assembly
        assembly

Specifies the current assembly.

Returns

        Type
        Description

        System.String

Returns the value of the Company attribute, or null, if the attibute was not found.

    |
    Improve this Doc

    View Source

GetCopyright(Assembly)

Gets the value of the current assembly's Copyright attribute.

Declaration

public static string GetCopyright(this Assembly assembly)

Parameters

        Type
        Name
        Description

        System.Reflection.Assembly
        assembly

Specifies the current assembly.

Returns

        Type
        Description

        System.String

Returns the value of the Copyright attribute, or null, if the attibute was not found.

    |
    Improve this Doc

    View Source

GetDescription(Assembly)

Gets the value of the current assembly's Description attribute.

Declaration

public static string GetDescription(this Assembly assembly)

Parameters

        Type
        Name
        Description

        System.Reflection.Assembly
        assembly

Specifies the current assembly.

Returns

        Type
        Description

        System.String

Returns the value of the Description attribute, or null, if the attibute was not found.

    |
    Improve this Doc

    View Source

GetDirectory(Assembly)

Gets the directory of the current assembly.

Declaration

public static string GetDirectory(this Assembly assembly)

Parameters

        Type
        Name
        Description

        System.Reflection.Assembly
        assembly

Specifies the current assembly.

Returns

        Type
        Description

        System.String

Returns the directory of the current assembly without an ending directory separator.

    |
    Improve this Doc

    View Source

GetFileName(Assembly)

Gets the file name of the current assembly.

Declaration

public static string GetFileName(this Assembly assembly)

Parameters

        Type
        Name
        Description

        System.Reflection.Assembly
        assembly

Specifies the current assembly.

Returns

        Type
        Description

        System.String

Returns the file name of the current assembly.

    |
    Improve this Doc

    View Source

GetFileNameWithoutExtension(Assembly)

Gets the file name of the current assembly without the extension.

Declaration

public static string GetFileNameWithoutExtension(this Assembly assembly)

Parameters

        Type
        Name
        Description

        System.Reflection.Assembly
        assembly

Specifies the current assembly.

Returns

        Type
        Description

        System.String

Returns the file name of the current assembly without the extension.

    |
    Improve this Doc

    View Source

GetProduct(Assembly)

Gets the value of the current assembly's Product attribute.

Declaration

public static string GetProduct(this Assembly assembly)

Parameters

        Type
        Name
        Description

        System.Reflection.Assembly
        assembly

Specifies the current assembly.

Returns

        Type
        Description

        System.String

Returns the value of the Product attribute, or null, if the attibute was not found.

    |
    Improve this Doc

    View Source

GetProductVersion(Assembly)

Gets the product version associated with the current assembly.

Declaration

public static string GetProductVersion(this Assembly assembly)

Parameters

        Type
        Name
        Description

        System.Reflection.Assembly
        assembly

Specifies the current assembly.

Returns

        Type
        Description

        System.String

Returns the product version associated with the current assembly.

    |
    Improve this Doc

    View Source

GetTitle(Assembly)

Gets the value of the current assembly's Title attribute.

Declaration

public static string GetTitle(this Assembly assembly)

Parameters

        Type
        Name
        Description

        System.Reflection.Assembly
        assembly

Specifies the current assembly.

Returns

        Type
        Description

        System.String

Returns the value of the Title attribute, or null, if the attibute was not found.

    |
    Improve this Doc

    View Source

GetVersion(Assembly)

Gets the value of the current assembly's Version attribute.

Declaration

public static string GetVersion(this Assembly assembly)

Parameters

        Type
        Name
        Description

        System.Reflection.Assembly
        assembly

Specifies the current assembly.

Returns

        Type
        Description

        System.String

Returns the value of the Version attribute, or null, if the attibute was not found.

    |
    <a href="https://github.com/jlahteen/juhta.net/new/release/v1.0.0-rc2/apiSpec/new?filename=Juhta_Net_Extensions_AssemblyExtensions_LoadEmbeddedResourceFile_System_Reflection_Assembly_System_String_.md&value=---%0Auid%3A%20Juhta.Net.Extensions.AssemblyExtensions.LoadEmbeddedResourceFile(System.Reflection.Assembly%2CSystem.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc

    View Source

LoadEmbeddedResourceFile(Assembly, String)

Loads an embedded resource file from the current assembly.

Declaration

public static string LoadEmbeddedResourceFile(this Assembly assembly, string fileName)

Parameters

        Type
        Name
        Description

        System.Reflection.Assembly
        assembly

Specifies the current assembly.

        System.String
        fileName

Specifies the name of a resource file to be loaded.

Returns

        Type
        Description

        System.String

Returns the contents of the requested resource file.

Remarks

This method loads the first resource file whose name matches the specified file name regardless of
the file namespace.

    |
    <a href="https://github.com/jlahteen/juhta.net/new/release/v1.0.0-rc2/apiSpec/new?filename=Juhta_Net_Extensions_AssemblyExtensions_LoadEmbeddedResourceFile_System_Reflection_Assembly_System_String_System_String_.md&value=---%0Auid%3A%20Juhta.Net.Extensions.AssemblyExtensions.LoadEmbeddedResourceFile(System.Reflection.Assembly%2CSystem.String%2CSystem.String)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc

    View Source

LoadEmbeddedResourceFile(Assembly, String, String)

Loads an embedded resource file from the current assembly.

Declaration

public static string LoadEmbeddedResourceFile(this Assembly assembly, string fileName, string fileNamespace)

Parameters

        Type
        Name
        Description

        System.Reflection.Assembly
        assembly

Specifies the current assembly.

        System.String
        fileName

Specifies the name of a resource file to be loaded.

        System.String
        fileNamespace

Specifies the namespace of a resource file to be loaded. Can be null in which
case the method loads the first resource file whose name matches the specified file name.

Returns

        Type
        Description

        System.String

Returns the contents of the requested resource file.

                    Improve this Doc

                    View Source

              Back to top

            Copyright © 2017-2018 Juha Lähteenmäki
Generated by DocFX


text:
import sys
from pkg_resources import normalize_path
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand

version = '0.1'

install_requires = [
    "mezzanine",
    "south",
]

setup(
    name='mezzanine-odcatalog',
    version=version,
    packages=find_packages(),
    url='',
    license='Apache License, Version 2.0',
    author='Samuele Santi',
    author_email='samuele@samuelesanti.com',
    description='Simple Open Data catalog management application',
    long_description='Simple Open Data catalog management application',
    install_requires=install_requires,
    classifiers=[
        "Programming Language :: Python :: 2.7",
    ],
    package_data={'': ['README.rst', 'LICENSE']},
)


text:
Fine Arts

Draw my heart to you

						Famous Arts

						<art-intro-item class="wow fadeInDown" data-wow-delay="{{$index * .15  + 's'}}" ng-repeat="data in artInfo track by $index" data="data"></art-intro-item>


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 v.i.p_software;

import javax.swing.DefaultListModel;

/**
 *
 * @author chokayg3
 */
public class TicketView extends javax.swing.JFrame {
 DefaultListModel list_model;
    /**
     * Creates new form TicketView
     */
    public TicketView() {
        list_model =new DefaultListModel();
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        list = new javax.swing.JList();
        jButton1 = new javax.swing.JButton();
        additionalbooking_button = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setType(java.awt.Window.Type.UTILITY);

        list.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED), "Ticket View", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Dialog", 0, 14))); // NOI18N
        list.setModel(list_model);
        jScrollPane1.setViewportView(list);

        jButton1.setFont(new java.awt.Font("Dialog", 0, 14)); // NOI18N
        jButton1.setText("Ok");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        additionalbooking_button.setFont(new java.awt.Font("Dialog", 0, 14)); // NOI18N
        additionalbooking_button.setText("New Booking");
        additionalbooking_button.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                additionalbooking_buttonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(additionalbooking_button)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 246, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton1)
                    .addComponent(additionalbooking_button))
                .addContainerGap())
        );

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
//System.exit(0);        // TODO add your handling code here:
        this.setVisible(false);
        new WELCOME_INTERFACE().setVisible(true);
    }//GEN-LAST:event_jButton1ActionPerformed

    private void additionalbooking_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_additionalbooking_buttonActionPerformed
        // TODO add your handling code here:
        new BOOKING_VIEW().setVisible(true);
    }//GEN-LAST:event_additionalbooking_buttonActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(TicketView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(TicketView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(TicketView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(TicketView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new TicketView().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton additionalbooking_button;
    private javax.swing.JButton jButton1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JList list;
    // End of variables declaration//GEN-END:variables
}


text:
using EndlessClient.Controllers;
using EndlessClient.Dialogs.Services;
using EndlessClient.Input;
using EndlessClient.Rendering;
using EndlessClient.Rendering.Factories;
using EndlessClient.Rendering.Sprites;
using EOLib;
using EOLib.Domain.Character;
using EOLib.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System;
using System.Threading.Tasks;
using XNAControls;

namespace EndlessClient.UIControls
{
    public class CharacterInfoPanel : XNAControl
    {
        private readonly INativeGraphicsManager _gfxManager;
        private readonly Character _character;
        private readonly ILoginController _loginController;
        private readonly ICharacterManagementController _characterManagementController;
        private readonly IRendererRepositoryResetter _rendererRepositoryResetter;
        private readonly CharacterControl _characterControl;
        private readonly ISpriteSheet _adminGraphic;
        private readonly IUserInputProvider _userInputProvider;
        private readonly IXnaControlSoundMapper _xnaControlSoundMapper;
        private readonly Texture2D _backgroundImage;

        private readonly IXNAButton _loginButton, _deleteButton;
        private readonly IXNALabel _nameLabel, _levelLabel;

        private readonly int _characterIndex;

        private Task _activeTask;

        //top left - 334, 36 + ndx*124
        protected CharacterInfoPanel(int characterIndex,
                                     INativeGraphicsManager gfxManager,
                                     IEODialogButtonService dialogButtonService)
        {
            _characterIndex = characterIndex;
            _gfxManager = gfxManager;
            DrawPosition = new Vector2(334, 36 + characterIndex*124);

            _loginButton = new XNAButton(dialogButtonService.SmallButtonSheet,
                new Vector2(161, 57),
                dialogButtonService.GetSmallDialogButtonOutSource(SmallButton.Login),
                dialogButtonService.GetSmallDialogButtonOverSource(SmallButton.Login));
            _loginButton.OnClick += (o, e) => AsyncButtonClick(() => _loginController.LoginToCharacter(_character));
            _loginButton.SetParentControl(this);

            _deleteButton = new XNAButton(dialogButtonService.SmallButtonSheet,
                new Vector2(161, 85),
                dialogButtonService.GetSmallDialogButtonOutSource(SmallButton.Delete),
                dialogButtonService.GetSmallDialogButtonOverSource(SmallButton.Delete));
            _deleteButton.OnClick += (o, e) => AsyncButtonClick(() => _characterManagementController.DeleteCharacter(_character));
            _deleteButton.SetParentControl(this);

            _backgroundImage = _gfxManager.TextureFromResource(GFXTypes.PreLoginUI, 11);
        }

        public CharacterInfoPanel(int characterIndex,
                                  Character character,
                                  INativeGraphicsManager gfxManager,
                                  IEODialogButtonService dialogButtonService,
                                  ILoginController loginController,
                                  ICharacterManagementController characterManagementController,
                                  ICharacterRendererFactory rendererFactory,
                                  IRendererRepositoryResetter rendererRepositoryResetter,
                                  IUserInputProvider userInputProvider,
                                  IXnaControlSoundMapper xnaControlSoundMapper)
            : this(characterIndex, gfxManager, dialogButtonService)
        {
            _character = character;
            _loginController = loginController;
            _characterManagementController = characterManagementController;
            _rendererRepositoryResetter = rendererRepositoryResetter;
            _userInputProvider = userInputProvider;
            _xnaControlSoundMapper = xnaControlSoundMapper;

            _characterControl = new CharacterControl(character, rendererFactory)
            {
                DrawPosition = new Vector2(68, 28)
            };
            _characterControl.SetParentControl(this);

            _nameLabel = new XNALabel(Constants.FontSize08pt5)
            {
                DrawArea = GetNameLabelLocation(),
                ForeColor = ColorConstants.BeigeText,
                Text = CapitalizeName(character.Name),
                TextAlign = LabelAlignment.MiddleCenter,
                AutoSize = false
            };
            _nameLabel.SetParentControl(this);

            _levelLabel = new XNALabel(Constants.FontSize09)
            {
                DrawArea = GetLevelLabelLocation(),
                ForeColor = ColorConstants.BeigeText,
                Text = character.Stats.Stats[CharacterStat.Level].ToString()
            };
            _levelLabel.SetParentControl(this);

            _adminGraphic = CreateAdminGraphic(character.AdminLevel);
        }

        public override void Initialize()
        {
            _characterControl.Initialize();

            _loginButton.Initialize();
            _xnaControlSoundMapper.BindSoundToControl(_loginButton);

            _deleteButton.Initialize();
            _xnaControlSoundMapper.BindSoundToControl(_deleteButton);

            _nameLabel.Initialize();
            _levelLabel.Initialize();

            base.Initialize();
        }

        protected override bool ShouldUpdate()
        {
            return Visible;
        }

        protected override void OnUpdateControl(GameTime gameTime)
        {
            DoUpdateLogic(gameTime);
            base.OnUpdateControl(gameTime);
        }

        protected override void OnDrawControl(GameTime gameTime)
        {
            _spriteBatch.Begin();
            _spriteBatch.Draw(_backgroundImage, DrawPositionWithParentOffset, Color.White);
            _spriteBatch.End();

            DoDrawLogic(gameTime);

            base.OnDrawControl(gameTime);
        }

        protected virtual void AsyncButtonClick(Func<Task> clickHandler)
        {
            if (_activeTask == null)
            {
                _activeTask = clickHandler();
                _activeTask.ContinueWith(_ => _activeTask = null);
            }
        }

        protected virtual void DoUpdateLogic(GameTime gameTime)
        {
            _characterControl.Update(gameTime);

            var previousKeyState = _userInputProvider.PreviousKeyState;
            var currentKeyState = _userInputProvider.CurrentKeyState;
            if (currentKeyState.IsKeyPressedOnce(previousKeyState, Keys.D1 + _characterIndex))
            {
                AsyncButtonClick(() => _loginController.LoginToCharacter(_character));
            }
        }

        protected virtual void DoDrawLogic(GameTime gameTime)
        {
            _characterControl.Draw(gameTime);

            if (_adminGraphic.HasTexture && !_spriteBatch.IsDisposed)
            {
                _spriteBatch.Begin();
                _spriteBatch.Draw(_adminGraphic.SheetTexture, GetAdminGraphicLocation(), _adminGraphic.SourceRectangle, Color.White);
                _spriteBatch.End();
            }
        }

        private static Rectangle GetNameLabelLocation()
        {
            return new Rectangle(165, 26, 89, 22);
        }

        private static Rectangle GetLevelLabelLocation()
        {
            return new Rectangle(29, 99, 1, 1);
        }

        private Vector2 GetAdminGraphicLocation()
        {
            return new Vector2(DrawAreaWithParentOffset.X + 109, DrawAreaWithParentOffset.Y + 97);
        }

        private static string CapitalizeName(string name)
        {
            return string.IsNullOrEmpty(name) ? string.Empty : (char)(name[0] - 32) + name.Substring(1);
        }

        private ISpriteSheet CreateAdminGraphic(AdminLevel adminLevel)
        {
            var adminGraphic = _gfxManager.TextureFromResource(GFXTypes.PreLoginUI, 22);

            switch (adminLevel)
            {
                case AdminLevel.Player:
                    return new EmptySpriteSheet();
                case AdminLevel.Guide:
                    return new SpriteSheet(adminGraphic, new Rectangle(252, 39, 17, 17));
                case AdminLevel.Guardian:
                case AdminLevel.GM:
                case AdminLevel.HGM:
                    return new SpriteSheet(adminGraphic, new Rectangle(233, 39, 17, 17));
                default:
                    throw new ArgumentOutOfRangeException(nameof(adminLevel), adminLevel, null);
            }
        }
    }

    /// <summary>
    /// This is a no-op class that represents an empty character slot. The buttons don't do anything, and nothing is drawn / updated
    /// </summary>
    public class EmptyCharacterInfoPanel : CharacterInfoPanel
    {
        public EmptyCharacterInfoPanel(int characterIndex,
            INativeGraphicsManager gfxManager,
            IEODialogButtonService dialogButtonService)
            : base(characterIndex, gfxManager, dialogButtonService)
        {
        }

        public override void Initialize()
        {
        }

        protected override void DoUpdateLogic(GameTime gameTime)
        {
        }

        protected override void DoDrawLogic(GameTime gameTime)
        {
        }

        protected override void AsyncButtonClick(Func<Task> clickHandler)
        {
        }
    }
}


text:
<?php
namespace Entity;

use \Doctrine\Common\Collections\ArrayCollection;

/**
 * @Table(name="convention_archives")
 * @Entity
 * @HasLifecycleCallbacks
 */
class ConventionArchive extends \DF\Doctrine\Entity
{
    public function __construct()
    {
        $this->type = 'yt_video';
        $this->created_at = time();
        $this->synchronized_at = 0;
    }

    /**
     * Clear all related video items when a playlist is deleted.
     * @PreRemove
     */
    public function deleting()
    {
        if ($this->type == 'yt_playlist')
        {
            $em = self::getEntityManager();

            $em->createQuery('DELETE FROM Entity\ConventionArchive ca WHERE ca.playlist_id = :id')
                ->setParameter('id', $this->id)
                ->execute();
        }
    }

    /**
     * @Column(name="id", type="integer")
     * @Id
     * @GeneratedValue(strategy="IDENTITY")
     */
    protected $id;

    /** @Column(name="convention_id", type="integer") */
    protected $convention_id;

    /** @Column(name="playlist_id", type="integer", nullable=true) */
    protected $playlist_id;

    /** @Column(name="type", type="string", length=50, nullable=true) */
    protected $type;

    public function isPlayable()
    {
        return self::typeIsPlayable($this->type);
    }

    /** @Column(name="folder", type="string", length=50, nullable=true) */
    protected $folder;

    /** @Column(name="name", type="string", length=400, nullable=true) */
    protected $name;

    /** @Column(name="description", type="text", nullable=true) */
    protected $description;

    /** @Column(name="web_url", type="string", length=250, nullable=true) */
    protected $web_url;

    /** @Column(name="thumbnail_url", type="string", length=250, nullable=true) */
    protected $thumbnail_url;

    /** @Column(name="created_at", type="integer") */
    protected $created_at;

    /** @Column(name="synchronized_at", type="integer") */
    protected $synchronized_at;

    /**
     * @ManyToOne(targetEntity="Convention", inversedBy="archives")
     * @JoinColumns({
     *   @JoinColumn(name="convention_id", referencedColumnName="id", onDelete="CASCADE")
     * })
     */
    protected $convention;

    public function process()
    {
        \PVL\ConventionManager::process($this);
        $this->save();
    }

    /**
     * Static Functions
     */

    public static function getTypes()
    {
        return array(
            'yt_video'      => 'YouTube Video',
            'yt_playlist'   => 'YouTube Playlist',
        );
    }
    public static function getFolders()
    {
        return array(
            'pvl'           => 'Ponyville Live! Footage',
            'efn'           => 'Everfree Network Footage',
            'viper'         => 'VIPER Footage',
            'con'           => 'Convention-Supplied Footage',
            'thirdparty'    => 'Third-Party Footage',
        );
    }
    public static function typeIsPlayable($type)
    {
        $playable_types = array('yt_video');
        return in_array($type, $playable_types);
    }
}


text:
package net.raumzeitfalle.niohttp;

import java.util.Objects;

/**
 * Authentication specific message header fields.
 *
 * @see http://httpwg.org/specs/rfc7231.html#response.auth
 *

 *
Proxy-Authenticate

 *
WWW-Authenticate

 *

 *
 */
public enum AuthenticationFields implements HeaderField {
    PROXY_AUTHENTICATE("Proxy-Authenticate"), WWW_AUTHENTICATE("WWW-Authenticate");

    private final String fieldName;

    AuthenticationFields(final String fieldName) {
	this.fieldName = fieldName;
    }

    public String getFieldName() {
	return this.fieldName;
    }

    public static AuthenticationFields fromString(final String lineFromBytes) {
	Objects.requireNonNull(lineFromBytes, "lineFromBytes should not be null");
	for (AuthenticationFields responseField : values()) {
	    if (lineFromBytes.trim().toLowerCase().startsWith(responseField.fieldName.toLowerCase())) {
		return responseField;
	    }
	}
	throw new RuntimeException("Unknown HTTP header response field");
    }

    public static boolean isResponseField(final String lineFromBytes) {
	Objects.requireNonNull(lineFromBytes, "lineFromBytes should not be null");
	for (AuthenticationFields responseField : values()) {
	    if (lineFromBytes.trim().toLowerCase().startsWith(responseField.fieldName.toLowerCase())) {
		return true;
	    }
	}
	return false;
    }
}


text:
/* eslint-disable no-console */
const server = require('http').createServer()
const io = require('socket.io')(server)

server.listen(7000, '0.0.0.0', () => {
  console.log('[http] server started')
})

io.sockets.on('connection', client => {
  console.log('new connection from', client.conn.remoteAddress)

  client.broadcast.emit('client', {
    sender: client.id,
  })

  client.on('offer', ({ to, offer }) => {
    console.log('offer from', client.conn.remoteAddress)

    client.to(to).emit('offer', {
      sender: client.id,
      offer,
    })
  })

  client.on('answer', ({ to, answer }) => {
    console.log('answer from', client.conn.remoteAddress)

    client.to(to).emit('answer', {
      sender: client.id,
      answer,
    })
  })

  client.on('candidate', ({ to, candidate }) => {
    console.log('candidate from', client.conn.remoteAddress)

    client.to(to).emit('candidate', {
      sender: client.id,
      candidate,
    })
  })

  client.on('disconnect', () => {
    console.log('client %s disconnected', client.conn.remoteAddress)
  })
})


text:
#ifndef __CODE_IDE_SUPPORT_H__
#define __CODE_IDE_SUPPORT_H__

// define 1 to open Cocos Code IDE support, 0 to disable
#define CC_CODE_IDE_DEBUG_SUPPORT 1

#endif /* __CODE_IDE_SUPPORT_H__ */


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

namespace InfraDoc.Data.DataAccess
{
    public interface ISiteRepository
    {
        IQueryable<Site> GetSites();
    }
}


text:
require "helper"

describe Google::Cloud::Storage::Bucket, :update, :lazy, :mock_storage do
  let(:bucket_name) { "new-bucket-#{Time.now.to_i}" }
  let(:bucket_url_root) { "https://www.googleapis.com/storage/v1" }
  let(:bucket_url) { "#{bucket_url_root}/b/#{bucket_name}" }
  let(:bucket_location) { "US" }
  let(:bucket_storage_class) { "STANDARD" }
  let(:bucket_logging_bucket) { "bucket-name-logging" }
  let(:bucket_logging_prefix) { "AccessLog" }
  let(:bucket_website_main) { "index.html" }
  let(:bucket_website_404) { "404.html" }
  let(:bucket_requester_pays) { true }
  let(:bucket_cors_gapi) { Google::Apis::StorageV1::Bucket::CorsConfiguration.new(
    max_age_seconds: 300,
    origin: ["http://example.org", "https://example.org"],
    http_method: ["*"],
    response_header: ["X-My-Custom-Header"]) }
  let(:bucket_cors_hash) { JSON.parse bucket_cors_gapi.to_json }

  let(:bucket) { Google::Cloud::Storage::Bucket.new_lazy bucket_name, storage.service }

  it "updates its versioning" do
    mock = Minitest::Mock.new
    patch_versioning_gapi = Google::Apis::StorageV1::Bucket::Versioning.new enabled: true
    patch_bucket_gapi = Google::Apis::StorageV1::Bucket.new versioning: patch_versioning_gapi
    returned_bucket_gapi = Google::Apis::StorageV1::Bucket.from_json \
      random_bucket_hash(bucket_name, bucket_url, bucket_location, bucket_storage_class, true).to_json
    mock.expect :patch_bucket, returned_bucket_gapi,
      [bucket_name, patch_bucket_gapi, predefined_acl: nil, predefined_default_object_acl: nil, user_project: nil]

    bucket.service.mocked_service = mock

    bucket.wont_be :versioning?
    bucket.versioning = true
    bucket.must_be :versioning?

    mock.verify
  end

  it "updates its versioning with user_project set to true" do
    mock = Minitest::Mock.new
    patch_versioning_gapi = Google::Apis::StorageV1::Bucket::Versioning.new enabled: true
    patch_bucket_gapi = Google::Apis::StorageV1::Bucket.new versioning: patch_versioning_gapi
    returned_bucket_gapi = Google::Apis::StorageV1::Bucket.from_json \
      random_bucket_hash(bucket_name, bucket_url, bucket_location, bucket_storage_class, true).to_json
    mock.expect :patch_bucket, returned_bucket_gapi,
      [bucket_name, patch_bucket_gapi, predefined_acl: nil, predefined_default_object_acl: nil, user_project: "test"]

    bucket.service.mocked_service = mock
    bucket.user_project = true

    bucket.wont_be :versioning?
    bucket.versioning = true
    bucket.must_be :versioning?

    mock.verify
  end

  it "updates its logging bucket" do
    mock = Minitest::Mock.new
    patch_logging_gapi = Google::Apis::StorageV1::Bucket::Logging.new log_bucket: bucket_logging_bucket
    patch_bucket_gapi = Google::Apis::StorageV1::Bucket.new logging: patch_logging_gapi
    returned_bucket_gapi = Google::Apis::StorageV1::Bucket.from_json \
      random_bucket_hash(bucket_name, bucket_url, bucket_location, bucket_storage_class, nil, bucket_logging_bucket).to_json
    mock.expect :patch_bucket, returned_bucket_gapi,
      [bucket_name, patch_bucket_gapi, predefined_acl: nil, predefined_default_object_acl: nil, user_project: nil]

    bucket.service.mocked_service = mock

    bucket.logging_bucket.must_be :nil?
    bucket.logging_bucket = bucket_logging_bucket
    bucket.logging_bucket.must_equal bucket_logging_bucket

    mock.verify
  end

  it "updates its logging prefix" do
    mock = Minitest::Mock.new
    patch_logging_gapi = Google::Apis::StorageV1::Bucket::Logging.new log_object_prefix: bucket_logging_prefix
    patch_bucket_gapi = Google::Apis::StorageV1::Bucket.new logging: patch_logging_gapi
    returned_bucket_gapi = Google::Apis::StorageV1::Bucket.from_json \
      random_bucket_hash(bucket_name, bucket_url, bucket_location, bucket_storage_class, nil, nil, bucket_logging_prefix).to_json
    mock.expect :patch_bucket, returned_bucket_gapi,
      [bucket_name, patch_bucket_gapi, predefined_acl: nil, predefined_default_object_acl: nil, user_project: nil]

    bucket.service.mocked_service = mock

    bucket.logging_prefix.must_be :nil?
    bucket.logging_prefix = bucket_logging_prefix
    bucket.logging_prefix.must_equal bucket_logging_prefix

    mock.verify
  end

  it "updates its logging bucket and prefix" do
    mock = Minitest::Mock.new
    patch_logging_gapi = Google::Apis::StorageV1::Bucket::Logging.new log_bucket: bucket_logging_bucket, log_object_prefix: bucket_logging_prefix
    patch_bucket_gapi = Google::Apis::StorageV1::Bucket.new logging: patch_logging_gapi
    returned_bucket_gapi = Google::Apis::StorageV1::Bucket.from_json \
      random_bucket_hash(bucket_name, bucket_url, bucket_location, bucket_storage_class, nil, bucket_logging_bucket, bucket_logging_prefix).to_json
    mock.expect :patch_bucket, returned_bucket_gapi,
      [bucket_name, patch_bucket_gapi.class, predefined_acl: nil, predefined_default_object_acl: nil, user_project: nil]

    bucket.service.mocked_service = mock

    bucket.logging_bucket.must_be :nil?
    bucket.logging_prefix.must_be :nil?

    bucket.update do |b|
      b.logging_bucket = bucket_logging_bucket
      b.logging_prefix = bucket_logging_prefix
    end

    bucket.logging_bucket.must_equal bucket_logging_bucket
    bucket.logging_prefix.must_equal bucket_logging_prefix

    mock.verify
  end

  it "updates its storage class" do
    mock = Minitest::Mock.new
    patch_bucket_gapi = Google::Apis::StorageV1::Bucket.new storage_class: "NEARLINE"
    returned_bucket_gapi = Google::Apis::StorageV1::Bucket.from_json \
      random_bucket_hash(bucket_name, bucket_url, bucket_location, "NEARLINE", nil, nil, bucket_logging_prefix).to_json
    mock.expect :patch_bucket, returned_bucket_gapi,
      [bucket_name, patch_bucket_gapi, predefined_acl: nil, predefined_default_object_acl: nil, user_project: nil]

    bucket.service.mocked_service = mock

    bucket.storage_class.must_be :nil?
    bucket.storage_class = :nearline
    bucket.storage_class.must_equal "NEARLINE"

    mock.verify
  end

  it "updates its website main page" do
    mock = Minitest::Mock.new
    patch_website_gapi = Google::Apis::StorageV1::Bucket::Website.new main_page_suffix: bucket_website_main
    patch_bucket_gapi = Google::Apis::StorageV1::Bucket.new website: patch_website_gapi
    returned_bucket_gapi = Google::Apis::StorageV1::Bucket.from_json \
      random_bucket_hash(bucket_name, bucket_url, bucket_location, bucket_storage_class, nil, nil, nil, bucket_website_main).to_json
    mock.expect :patch_bucket, returned_bucket_gapi,
      [bucket_name, patch_bucket_gapi, predefined_acl: nil, predefined_default_object_acl: nil, user_project: nil]

    bucket.service.mocked_service = mock

    bucket.website_main.must_be :nil?
    bucket.website_main = bucket_website_main
    bucket.website_main.must_equal bucket_website_main

    mock.verify
  end

  it "updates its website not found 404 page" do
    mock = Minitest::Mock.new
    patch_website_gapi = Google::Apis::StorageV1::Bucket::Website.new not_found_page: bucket_website_404
    patch_bucket_gapi = Google::Apis::StorageV1::Bucket.new website: patch_website_gapi
    returned_bucket_gapi = Google::Apis::StorageV1::Bucket.from_json \
      random_bucket_hash(bucket_name, bucket_url, bucket_location, bucket_storage_class, nil, nil, nil, nil, bucket_website_404).to_json
    mock.expect :patch_bucket, returned_bucket_gapi,
      [bucket_name, patch_bucket_gapi, predefined_acl: nil, predefined_default_object_acl: nil, user_project: nil]

    bucket.service.mocked_service = mock

    bucket.website_404.must_be :nil?
    bucket.website_404 = bucket_website_404
    bucket.website_404.must_equal bucket_website_404

    mock.verify
  end

  it "updates its website main page and not found 404 page" do
    mock = Minitest::Mock.new
    patch_website_gapi = Google::Apis::StorageV1::Bucket::Website.new main_page_suffix: bucket_website_main, not_found_page: bucket_website_404
    patch_bucket_gapi = Google::Apis::StorageV1::Bucket.new website: patch_website_gapi
    returned_bucket_gapi = Google::Apis::StorageV1::Bucket.from_json \
      random_bucket_hash(bucket_name, bucket_url, bucket_location, bucket_storage_class, nil, nil, nil, bucket_website_main, bucket_website_404).to_json
    mock.expect :patch_bucket, returned_bucket_gapi,
      [bucket_name, patch_bucket_gapi, predefined_acl: nil, predefined_default_object_acl: nil, user_project: nil]

    bucket.service.mocked_service = mock

    bucket.website_main.must_be :nil?
    bucket.website_404.must_be :nil?

    bucket.update do |b|
      b.website_main = bucket_website_main
      b.website_404 = bucket_website_404
    end

    bucket.website_main.must_equal bucket_website_main
    bucket.website_404.must_equal bucket_website_404

    mock.verify
  end

  it "updates its requester pays" do
    mock = Minitest::Mock.new
    patch_billing_gapi = Google::Apis::StorageV1::Bucket::Billing.new requester_pays: bucket_requester_pays
    patch_bucket_gapi = Google::Apis::StorageV1::Bucket.new billing: patch_billing_gapi
    returned_bucket_gapi = Google::Apis::StorageV1::Bucket.from_json \
      random_bucket_hash(bucket_name, bucket_url, bucket_location, bucket_storage_class, nil, nil, nil, nil, nil, [], bucket_requester_pays).to_json
    mock.expect :patch_bucket, returned_bucket_gapi,
      [bucket_name, patch_bucket_gapi, predefined_acl: nil, predefined_default_object_acl: nil, user_project: nil]

    bucket.service.mocked_service = mock

    bucket.requester_pays.must_be :nil?
    bucket.requester_pays = bucket_requester_pays
    bucket.requester_pays.must_equal bucket_requester_pays

    mock.verify
  end

  it "cannot modify its labels" do
    bucket.labels.must_equal Hash.new
    assert_raises do
      bucket.labels["foo"] = "bar"
    end
  end

  it "updates its labels" do
    mock = Minitest::Mock.new
    new_labels = { "env" => "production", "foo" => "bar" }
    patch_bucket_gapi = Google::Apis::StorageV1::Bucket.new labels: new_labels
    returned_bucket_hash = random_bucket_hash bucket_name, bucket_url, bucket_location, bucket_storage_class
    returned_bucket_hash[:labels] = new_labels
    returned_bucket_gapi = Google::Apis::StorageV1::Bucket.from_json returned_bucket_hash.to_json
    mock.expect :patch_bucket, returned_bucket_gapi,
      [bucket_name, patch_bucket_gapi, predefined_acl: nil, predefined_default_object_acl: nil, user_project: nil]

    bucket.service.mocked_service = mock

    bucket.labels.must_equal Hash.new
    bucket.labels = new_labels
    bucket.labels.must_equal new_labels

    mock.verify
  end

  it "updates multiple attributes in a block" do
    mock = Minitest::Mock.new
    patch_versioning_gapi = Google::Apis::StorageV1::Bucket::Versioning.new enabled: true
    patch_logging_gapi = Google::Apis::StorageV1::Bucket::Logging.new log_bucket: bucket_logging_bucket, log_object_prefix: bucket_logging_prefix
    patch_website_gapi = Google::Apis::StorageV1::Bucket::Website.new main_page_suffix: bucket_website_main, not_found_page: bucket_website_404
    patch_billing_gapi = Google::Apis::StorageV1::Bucket::Billing.new requester_pays: bucket_requester_pays
    patch_bucket_gapi = Google::Apis::StorageV1::Bucket.new(versioning: patch_versioning_gapi, logging: patch_logging_gapi, storage_class: "NEARLINE", website: patch_website_gapi, billing: patch_billing_gapi, labels: { "env" => "production" })
    returned_bucket_hash = random_bucket_hash bucket_name, bucket_url, bucket_location, "NEARLINE", true, bucket_logging_bucket, bucket_logging_prefix, bucket_website_main, bucket_website_404, [], bucket_requester_pays
    returned_bucket_hash[:labels] = { "env" => "production" }
    returned_bucket_gapi = Google::Apis::StorageV1::Bucket.from_json returned_bucket_hash.to_json
    mock.expect :patch_bucket, returned_bucket_gapi,
      [bucket_name, patch_bucket_gapi, predefined_acl: nil, predefined_default_object_acl: nil, user_project: nil]

    bucket.service.mocked_service = mock

    bucket.wont_be :versioning?
    bucket.logging_bucket.must_be :nil?
    bucket.logging_prefix.must_be :nil?
    bucket.website_main.must_be :nil?
    bucket.website_404.must_be :nil?
    bucket.requester_pays.must_be :nil?
    bucket.labels.must_equal Hash.new

    bucket.update do |b|
      b.versioning = true
      b.logging_prefix = bucket_logging_prefix
      b.logging_bucket = bucket_logging_bucket
      b.storage_class = :nearline
      b.website_main = bucket_website_main
      b.website_404 = bucket_website_404
      b.requester_pays = bucket_requester_pays
      b.labels["env"] = "production"
    end

    bucket.versioning?.must_equal true
    bucket.logging_bucket.must_equal bucket_logging_bucket
    bucket.logging_prefix.must_equal bucket_logging_prefix
    bucket.storage_class.must_equal "NEARLINE"
    bucket.website_main.must_equal bucket_website_main
    bucket.website_404.must_equal bucket_website_404
    bucket.requester_pays.must_equal bucket_requester_pays
    bucket.labels.must_equal({ "env" => "production" })

    mock.verify
  end

  it "sets the cors rules" do
    mock = Minitest::Mock.new
    patch_bucket_gapi = Google::Apis::StorageV1::Bucket.new cors_configurations: [bucket_cors_gapi]
    returned_bucket_gapi = Google::Apis::StorageV1::Bucket.from_json \
      random_bucket_hash(bucket_name, bucket_url, bucket_location, bucket_storage_class, nil, nil, nil, nil, nil, [bucket_cors_hash]).to_json
    mock.expect :patch_bucket, returned_bucket_gapi,
      [bucket_name, patch_bucket_gapi, predefined_acl: nil, predefined_default_object_acl: nil, user_project: nil]
    bucket.service.mocked_service = mock

    bucket.cors.must_equal []
    bucket.cors do |c|
      c.add_rule ["http://example.org", "https://example.org"],
                 "*",
                 headers: ["X-My-Custom-Header"],
                 max_age: 300
    end

    mock.verify
  end

  it "can't update cors outside of a block" do
    err = expect {
      bucket.cors.add_rule ["http://example.org", "https://example.org"],
                            "*",
                            headers: ["X-My-Custom-Header"],
                            max_age: 300
    }.must_raise RuntimeError
    err.message.must_match "can't modify frozen"
  end

  it "can update cors inside of a block" do
    mock = Minitest::Mock.new
    patch_bucket_gapi = Google::Apis::StorageV1::Bucket.new cors_configurations: [
      Google::Apis::StorageV1::Bucket::CorsConfiguration.new(
        max_age_seconds: 600, http_method: ["PUT"], origin: ["http://example.org", "https://example.org", "https://example.com"], response_header: ["X-My-Custom-Header", "X-Another-Custom-Header"]
      ),
      Google::Apis::StorageV1::Bucket::CorsConfiguration.new(
        max_age_seconds: 1800, http_method: [], origin: [], response_header: []
      )
    ]
    returned_bucket_gapi = Google::Apis::StorageV1::Bucket.from_json \
      random_bucket_hash(bucket_name, bucket_url, bucket_location, bucket_storage_class, nil, nil, nil, nil, nil, [bucket_cors_hash]).to_json
    mock.expect :patch_bucket, returned_bucket_gapi,
      [bucket_name, patch_bucket_gapi, predefined_acl: nil, predefined_default_object_acl: nil, user_project: nil]
    bucket.service.mocked_service = mock

    bucket.cors.must_be :frozen?
    bucket.cors.class.must_equal Google::Cloud::Storage::Bucket::Cors
    bucket.update do |b|
      b.cors.wont_be :frozen?
      b.cors.must_be :empty?
      b.cors.add_rule ["http://example.org", "https://example.org", "https://example.com"],
                       "PUT",
                       headers: ["X-My-Custom-Header", "X-Another-Custom-Header"],
                       max_age: 600
      # Add a rule
      b.cors << Google::Cloud::Storage::Bucket::Cors::Rule.new(nil, nil)
    end

    mock.verify
  end

  it "adds CORS rules in a nested block in update" do
    mock = Minitest::Mock.new
    patch_bucket_gapi = Google::Apis::StorageV1::Bucket.new cors_configurations: [
      Google::Apis::StorageV1::Bucket::CorsConfiguration.new(
        max_age_seconds: 1800, http_method: ["GET"], origin: ["http://example.org"], response_header: []
      ),
      Google::Apis::StorageV1::Bucket::CorsConfiguration.new(
        max_age_seconds: 300, http_method: ["PUT", "DELETE"], origin: ["http://example.org", "https://example.org"], response_header: ["X-My-Custom-Header"]
      ),
      Google::Apis::StorageV1::Bucket::CorsConfiguration.new(
        max_age_seconds: 1800, http_method: ["*"], origin: ["http://example.com"], response_header: ["X-Another-Custom-Header"]
      )
    ]
    returned_bucket_gapi = Google::Apis::StorageV1::Bucket.from_json \
      random_bucket_hash(bucket_name, bucket_url, bucket_location, bucket_storage_class, nil, nil, nil, nil, nil, [bucket_cors_hash]).to_json
    mock.expect :patch_bucket, returned_bucket_gapi,
      [bucket_name, patch_bucket_gapi, predefined_acl: nil, predefined_default_object_acl: nil, user_project: nil]
    bucket.service.mocked_service = mock

    bucket.update do |b|
      b.cors.delete_if { |c| c.max_age = 300 }
      b.cors do |c|
        c.add_rule "http://example.org", "GET"
        c.add_rule ["http://example.org", "https://example.org"],
                   ["PUT", "DELETE"],
                   headers: ["X-My-Custom-Header"],
                   max_age: 300
        c.add_rule "http://example.com",
                   "*",
                   headers: "X-Another-Custom-Header"
      end
    end

    mock.verify
  end

  it "adds CORS rules in a block to cors" do
    mock = Minitest::Mock.new
    patch_bucket_gapi = Google::Apis::StorageV1::Bucket.new cors_configurations: [
      Google::Apis::StorageV1::Bucket::CorsConfiguration.new(
        max_age_seconds: 1800, http_method: ["GET"], origin: ["http://example.org"], response_header: []
      ),
      Google::Apis::StorageV1::Bucket::CorsConfiguration.new(
        max_age_seconds: 300, http_method: ["PUT", "DELETE"], origin: ["http://example.org", "https://example.org"], response_header: ["X-My-Custom-Header"]
      ),
      Google::Apis::StorageV1::Bucket::CorsConfiguration.new(
        max_age_seconds: 1800, http_method: ["*"], origin: ["http://example.com"], response_header: ["X-Another-Custom-Header"]
      )
    ]
    returned_bucket_gapi = Google::Apis::StorageV1::Bucket.from_json \
      random_bucket_hash(bucket_name, bucket_url, bucket_location, bucket_storage_class, nil, nil, nil, nil, nil, [bucket_cors_hash]).to_json
    mock.expect :patch_bucket, returned_bucket_gapi,
      [bucket_name, patch_bucket_gapi, predefined_acl: nil, predefined_default_object_acl: nil, user_project: nil]
    bucket.service.mocked_service = mock

    returned_cors = bucket.cors do |c|
      c.add_rule "http://example.org", "GET"
      c.add_rule ["http://example.org", "https://example.org"],
                 ["PUT", "DELETE"],
                 headers: ["X-My-Custom-Header"],
                 max_age: 300
      c.add_rule "http://example.com",
                 "*",
                 headers: "X-Another-Custom-Header"
    end
    returned_cors.frozen?.must_equal true
    returned_cors.first.frozen?.must_equal true

    mock.verify
  end
end


text:
namespace Sdl.Web.Tridion.Templates.R2.Data.TargetGroups.Model
{
    public class CustomerCharacteristicCondition : Condition
    {
        public string Name { get; set; }
        public ConditionOperator Operator { get; set; }
        public object Value { get; set; }
    }
}