text:
package com.macro.mall.model;

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

public class CmsHelpExample {
    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public CmsHelpExample() {
        oredCriteria = new ArrayList<>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        public Criteria andIdIsNull() {
            addCriterion("id is null");
            return (Criteria) this;
        }

        public Criteria andIdIsNotNull() {
            addCriterion("id is not null");
            return (Criteria) this;
        }

        public Criteria andIdEqualTo(Long value) {
            addCriterion("id =", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotEqualTo(Long value) {
            addCriterion("id <>", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThan(Long value) {
            addCriterion("id >", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThanOrEqualTo(Long value) {
            addCriterion("id >=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThan(Long value) {
            addCriterion("id <", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThanOrEqualTo(Long value) {
            addCriterion("id <=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdIn(List<Long> values) {
            addCriterion("id in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotIn(List<Long> values) {
            addCriterion("id not in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdBetween(Long value1, Long value2) {
            addCriterion("id between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotBetween(Long value1, Long value2) {
            addCriterion("id not between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andCategoryIdIsNull() {
            addCriterion("category_id is null");
            return (Criteria) this;
        }

        public Criteria andCategoryIdIsNotNull() {
            addCriterion("category_id is not null");
            return (Criteria) this;
        }

        public Criteria andCategoryIdEqualTo(Long value) {
            addCriterion("category_id =", value, "categoryId");
            return (Criteria) this;
        }

        public Criteria andCategoryIdNotEqualTo(Long value) {
            addCriterion("category_id <>", value, "categoryId");
            return (Criteria) this;
        }

        public Criteria andCategoryIdGreaterThan(Long value) {
            addCriterion("category_id >", value, "categoryId");
            return (Criteria) this;
        }

        public Criteria andCategoryIdGreaterThanOrEqualTo(Long value) {
            addCriterion("category_id >=", value, "categoryId");
            return (Criteria) this;
        }

        public Criteria andCategoryIdLessThan(Long value) {
            addCriterion("category_id <", value, "categoryId");
            return (Criteria) this;
        }

        public Criteria andCategoryIdLessThanOrEqualTo(Long value) {
            addCriterion("category_id <=", value, "categoryId");
            return (Criteria) this;
        }

        public Criteria andCategoryIdIn(List<Long> values) {
            addCriterion("category_id in", values, "categoryId");
            return (Criteria) this;
        }

        public Criteria andCategoryIdNotIn(List<Long> values) {
            addCriterion("category_id not in", values, "categoryId");
            return (Criteria) this;
        }

        public Criteria andCategoryIdBetween(Long value1, Long value2) {
            addCriterion("category_id between", value1, value2, "categoryId");
            return (Criteria) this;
        }

        public Criteria andCategoryIdNotBetween(Long value1, Long value2) {
            addCriterion("category_id not between", value1, value2, "categoryId");
            return (Criteria) this;
        }

        public Criteria andIconIsNull() {
            addCriterion("icon is null");
            return (Criteria) this;
        }

        public Criteria andIconIsNotNull() {
            addCriterion("icon is not null");
            return (Criteria) this;
        }

        public Criteria andIconEqualTo(String value) {
            addCriterion("icon =", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconNotEqualTo(String value) {
            addCriterion("icon <>", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconGreaterThan(String value) {
            addCriterion("icon >", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconGreaterThanOrEqualTo(String value) {
            addCriterion("icon >=", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconLessThan(String value) {
            addCriterion("icon <", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconLessThanOrEqualTo(String value) {
            addCriterion("icon <=", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconLike(String value) {
            addCriterion("icon like", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconNotLike(String value) {
            addCriterion("icon not like", value, "icon");
            return (Criteria) this;
        }

        public Criteria andIconIn(List<String> values) {
            addCriterion("icon in", values, "icon");
            return (Criteria) this;
        }

        public Criteria andIconNotIn(List<String> values) {
            addCriterion("icon not in", values, "icon");
            return (Criteria) this;
        }

        public Criteria andIconBetween(String value1, String value2) {
            addCriterion("icon between", value1, value2, "icon");
            return (Criteria) this;
        }

        public Criteria andIconNotBetween(String value1, String value2) {
            addCriterion("icon not between", value1, value2, "icon");
            return (Criteria) this;
        }

        public Criteria andTitleIsNull() {
            addCriterion("title is null");
            return (Criteria) this;
        }

        public Criteria andTitleIsNotNull() {
            addCriterion("title is not null");
            return (Criteria) this;
        }

        public Criteria andTitleEqualTo(String value) {
            addCriterion("title =", value, "title");
            return (Criteria) this;
        }

        public Criteria andTitleNotEqualTo(String value) {
            addCriterion("title <>", value, "title");
            return (Criteria) this;
        }

        public Criteria andTitleGreaterThan(String value) {
            addCriterion("title >", value, "title");
            return (Criteria) this;
        }

        public Criteria andTitleGreaterThanOrEqualTo(String value) {
            addCriterion("title >=", value, "title");
            return (Criteria) this;
        }

        public Criteria andTitleLessThan(String value) {
            addCriterion("title <", value, "title");
            return (Criteria) this;
        }

        public Criteria andTitleLessThanOrEqualTo(String value) {
            addCriterion("title <=", value, "title");
            return (Criteria) this;
        }

        public Criteria andTitleLike(String value) {
            addCriterion("title like", value, "title");
            return (Criteria) this;
        }

        public Criteria andTitleNotLike(String value) {
            addCriterion("title not like", value, "title");
            return (Criteria) this;
        }

        public Criteria andTitleIn(List<String> values) {
            addCriterion("title in", values, "title");
            return (Criteria) this;
        }

        public Criteria andTitleNotIn(List<String> values) {
            addCriterion("title not in", values, "title");
            return (Criteria) this;
        }

        public Criteria andTitleBetween(String value1, String value2) {
            addCriterion("title between", value1, value2, "title");
            return (Criteria) this;
        }

        public Criteria andTitleNotBetween(String value1, String value2) {
            addCriterion("title not between", value1, value2, "title");
            return (Criteria) this;
        }

        public Criteria andShowStatusIsNull() {
            addCriterion("show_status is null");
            return (Criteria) this;
        }

        public Criteria andShowStatusIsNotNull() {
            addCriterion("show_status is not null");
            return (Criteria) this;
        }

        public Criteria andShowStatusEqualTo(Integer value) {
            addCriterion("show_status =", value, "showStatus");
            return (Criteria) this;
        }

        public Criteria andShowStatusNotEqualTo(Integer value) {
            addCriterion("show_status <>", value, "showStatus");
            return (Criteria) this;
        }

        public Criteria andShowStatusGreaterThan(Integer value) {
            addCriterion("show_status >", value, "showStatus");
            return (Criteria) this;
        }

        public Criteria andShowStatusGreaterThanOrEqualTo(Integer value) {
            addCriterion("show_status >=", value, "showStatus");
            return (Criteria) this;
        }

        public Criteria andShowStatusLessThan(Integer value) {
            addCriterion("show_status <", value, "showStatus");
            return (Criteria) this;
        }

        public Criteria andShowStatusLessThanOrEqualTo(Integer value) {
            addCriterion("show_status <=", value, "showStatus");
            return (Criteria) this;
        }

        public Criteria andShowStatusIn(List<Integer> values) {
            addCriterion("show_status in", values, "showStatus");
            return (Criteria) this;
        }

        public Criteria andShowStatusNotIn(List<Integer> values) {
            addCriterion("show_status not in", values, "showStatus");
            return (Criteria) this;
        }

        public Criteria andShowStatusBetween(Integer value1, Integer value2) {
            addCriterion("show_status between", value1, value2, "showStatus");
            return (Criteria) this;
        }

        public Criteria andShowStatusNotBetween(Integer value1, Integer value2) {
            addCriterion("show_status not between", value1, value2, "showStatus");
            return (Criteria) this;
        }

        public Criteria andCreateTimeIsNull() {
            addCriterion("create_time is null");
            return (Criteria) this;
        }

        public Criteria andCreateTimeIsNotNull() {
            addCriterion("create_time is not null");
            return (Criteria) this;
        }

        public Criteria andCreateTimeEqualTo(Date value) {
            addCriterion("create_time =", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeNotEqualTo(Date value) {
            addCriterion("create_time <>", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeGreaterThan(Date value) {
            addCriterion("create_time >", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
            addCriterion("create_time >=", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeLessThan(Date value) {
            addCriterion("create_time <", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
            addCriterion("create_time <=", value, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeIn(List<Date> values) {
            addCriterion("create_time in", values, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeNotIn(List<Date> values) {
            addCriterion("create_time not in", values, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeBetween(Date value1, Date value2) {
            addCriterion("create_time between", value1, value2, "createTime");
            return (Criteria) this;
        }

        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
            addCriterion("create_time not between", value1, value2, "createTime");
            return (Criteria) this;
        }

        public Criteria andReadCountIsNull() {
            addCriterion("read_count is null");
            return (Criteria) this;
        }

        public Criteria andReadCountIsNotNull() {
            addCriterion("read_count is not null");
            return (Criteria) this;
        }

        public Criteria andReadCountEqualTo(Integer value) {
            addCriterion("read_count =", value, "readCount");
            return (Criteria) this;
        }

        public Criteria andReadCountNotEqualTo(Integer value) {
            addCriterion("read_count <>", value, "readCount");
            return (Criteria) this;
        }

        public Criteria andReadCountGreaterThan(Integer value) {
            addCriterion("read_count >", value, "readCount");
            return (Criteria) this;
        }

        public Criteria andReadCountGreaterThanOrEqualTo(Integer value) {
            addCriterion("read_count >=", value, "readCount");
            return (Criteria) this;
        }

        public Criteria andReadCountLessThan(Integer value) {
            addCriterion("read_count <", value, "readCount");
            return (Criteria) this;
        }

        public Criteria andReadCountLessThanOrEqualTo(Integer value) {
            addCriterion("read_count <=", value, "readCount");
            return (Criteria) this;
        }

        public Criteria andReadCountIn(List<Integer> values) {
            addCriterion("read_count in", values, "readCount");
            return (Criteria) this;
        }

        public Criteria andReadCountNotIn(List<Integer> values) {
            addCriterion("read_count not in", values, "readCount");
            return (Criteria) this;
        }

        public Criteria andReadCountBetween(Integer value1, Integer value2) {
            addCriterion("read_count between", value1, value2, "readCount");
            return (Criteria) this;
        }

        public Criteria andReadCountNotBetween(Integer value1, Integer value2) {
            addCriterion("read_count not between", value1, value2, "readCount");
            return (Criteria) this;
        }
    }

    public static class Criteria extends GeneratedCriteria {
        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}


text:
namespace zam {
    namespace base {
        namespace log {
            namespace detail {

                boost::log::basic_formatter<char>
                frontendFormatFactory<char>::get(formatType fmt) {

                    namespace expr = boost::log::expressions;
                    namespace attrs = boost::log::attributes;

                    switch (fmt) {
                        case formatType::plain:
                            return expr::format("%1% (%2%) [%3%] %4%")
                                   % expr::format_date_time<boost::posix_time::ptime>(
                                    default_attribute_names::timestamp(), "%d %H:%M:%S.%f")
                                   % expr::attr<attrs::current_thread_id::value_type>(
                                    default_attribute_names::thread_id())
                                   % zam_severity
                                   % expr::message;
                        case formatType::xml:
                            return expr::format("<record time=\"%1%\" tid=\"%2%\" level=\"%3%\">%4%</record>")
                                   % expr::format_date_time<boost::posix_time::ptime>(
                                    default_attribute_names::timestamp(), "%d %H:%M:%S.%f")
                                   % expr::attr<attrs::current_thread_id::value_type>(
                                    default_attribute_names::thread_id())
                                   % zam_severity
                                   % expr::message;
                        case formatType::json:
                            return expr::format("{time:\"%1%\", tid:\"%2%\", level:\"%3%\", content=\"%4%\"},")
                                   % expr::format_date_time<boost::posix_time::ptime>(
                                    default_attribute_names::timestamp(), "%d %H:%M:%S.%f")
                                   % expr::attr<attrs::current_thread_id::value_type>(
                                    default_attribute_names::thread_id())
                                   % zam_severity
                                   % expr::message;
                        default:
                            break;
                    }

                    throw std::invalid_argument("invalid log format type");
                    return expr::format("");
                }
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
require 'libxml'
module Tilia
  module Xml
    # The XML Writer class.
    #
    # This class works exactly as PHP's built-in XMLWriter, with a few additions.
    #
    # Namespaces can be registered beforehand, globally. When the first element is
    # written, namespaces will automatically be declared.
    #
    # The write_attribute, startElement and write_element can now take a
    # clark-notation element name (example: {http://www.w3.org/2005/Atom}link).
    #
    # If, when writing the namespace is a known one a prefix will automatically be
    # selected, otherwise a random prefix will be generated.
    #
    # Instead of standard string values, the writer can take Element classes (as
    # defined by this library) to delegate the serialization.
    #
    # The write() method can take array structures to quickly write out simple xml
    # trees.
    class Writer
      include ContextStackTrait

      # Writes a value to the output stream.
      #
      # The following values are supported:
      #   1. Scalar values will be written as-is, as text.
      #   2. Null values will be skipped (resulting in a short xml tag).
      #   3. If a value is an instance of an Element class, writing will be
      #      delegated to the object.
      #   4. If a value is an array, two formats are supported.
      #
      #  Array format 1:
      #  [
      #    "{namespace}name1" => "..",
      #    "{namespace}name2" => "..",
      #  ]
      #
      #  One element will be created for each key in this array. The values of
      #  this array support any format this method supports (this method is
      #  called recursively).
      #
      #  Array format 2:
      #
      #  [
      #    [
      #      "name" => "{namespace}name1"
      #      "value" => "..",
      #      "attributes" => [
      #          "attr" => "attribute value",
      #      ]
      #    ],
      #    [
      #      "name" => "{namespace}name1"
      #      "value" => "..",
      #      "attributes" => [
      #          "attr" => "attribute value",
      #      ]
      #    ]
      # ]
      #
      # @param value
      # @return [void]
      def write(value)
        Serializer.standard_serializer(self, value)
      end

      # Starts an element.
      #
      # @param [String] name
      # @return [Boolean]
      def start_element(name)
        if name[0] == '{'
          (namespace, local_name) = Service.parse_clark_notation(name)

          if @namespace_map.key?(namespace)
            tmp_ns = @namespace_map[namespace]
            tmp_ns = nil if tmp_ns.blank?
            result = start_element_ns(tmp_ns, local_name, nil)
          elsif namespace.blank?
            # An empty namespace means it's the global namespace. This is
            # allowed, but it mustn't get a prefix.
            result = start_element(local_name)
            write_attribute('xmlns', '')
          else
            unless @adhoc_namespaces.key?(namespace)
              @adhoc_namespaces[namespace] = 'x' + (@adhoc_namespaces.size + 1).to_s
            end
            result = start_element_ns(@adhoc_namespaces[namespace], local_name, namespace)
          end
        else
          result = @writer.start_element(name)
        end

        unless @namespaces_written
          @namespace_map.each do |ns, prefix|
            write_attribute((prefix.present? ? 'xmlns:' + prefix : 'xmlns'), ns)
          end
          @namespaces_written = true
        end

        result
      end

      # Write a full element tag and it's contents.
      #
      # This method automatically closes the element as well.
      #
      # The element name may be specified in clark-notation.
      #
      # Examples:
      #
      #    writer.write_element('{http://www.w3.org/2005/Atom}author',null)
      #    becomes:
      #    <author xmlns="http://www.w3.org/2005" />
      #
      #    writer.write_element('{http://www.w3.org/2005/Atom}author', [
      #       '{http://www.w3.org/2005/Atom}name' => 'Evert Pot',
      #    ])
      #    becomes:
      #    <author xmlns="http://www.w3.org/2005" /><name>Evert Pot</name></author>
      #
      # @param [String] name
      # @param [String] content
      # @return [Boolean]
      def write_element(name, content = nil)
        start_element(name)
        write(content) unless content.nil?
        end_element
      end

      # Writes a list of attributes.
      #
      # Attributes are specified as a key->value array.
      #
      # The key is an attribute name. If the key is a 'localName', the current
      # xml namespace is assumed. If it's a 'clark notation key', this namespace
      # will be used instead.
      #
      # @param [Hash] attributes
      # @return [void]
      def write_attributes(attributes)
        attributes.each do |name, value|
          write_attribute(name, value)
        end
      end

      # Writes a new attribute.
      #
      # The name may be specified in clark-notation.
      #
      # Returns true when successful.
      #
      # @param [String] name
      # @param [String] value
      # @return [Boolean]
      def write_attribute(name, value)
        if name[0] == '{'
          (namespace, local_name) = Service.parse_clark_notation(name)
          if @namespace_map.key?(namespace)
            # It's an attribute with a namespace we know
            write_attribute(
              @namespace_map[namespace] + ':' + local_name,
              value
            )
          else
            # We don't know the namespace, we must add it in-line
            @adhoc_namespaces[namespace] = 'x' + (@adhoc_namespaces.size + 1).to_s unless @adhoc_namespaces.key?(namespace)

            write_attribute_ns(
              @adhoc_namespaces[namespace],
              local_name,
              namespace,
              value
            )
          end
        else
          @writer.write_attribute(name, value)
        end
      end

      # Initializes the instance variables
      def initialize
        @adhoc_namespaces = {}
        @namespaces_written = false

        super
      end

      # Fakes the php function open_memory
      #
      # Initilizes the LibXML Writer
      #
      # @return [void]
      def open_memory
        raise 'XML document already created' if @writer

        @writer = ::LibXML::XML::Writer.string
      end

      # Fakes the php function output_memory
      #
      # @return [String]
      def output_memory
        @writer.result
      end

      # Delegates missing methods to XML::Writer instance
      def method_missing(name, *args)
        @writer.send(name, *args)
      end
    end
  end
end


text:
package ch.hearc.gotit.controllers;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping(value = "/admin")
public class AdminController {

	private static final String START_URI = "standards/admins/";

	private static final String OVERVIEW_URI = START_URI + "overview";

	@RequestMapping(value = {"", "/"}, method = RequestMethod.GET)
	public String getOverview() {
		return OVERVIEW_URI;
	}
}


text:
Supporting Payum

Payum is an MIT-licensed open source project with its ongoing development made possible entirely by the support of community and our customers. If you'd like to join them, please consider:

- [Become a sponsor](https://www.patreon.com/makasim)
- [Become our client](http://forma-pro.com/)

---

# Payum Bundle. Configure gateway in backend

In [get it started](get-it-started.md) we showed you how to configure gateways in the Symfony config.yml file.
Though it covers most of the cases sometimes you may want to configure gateways in the backend.
For example you will be able to change a gateway credentials, add or delete a gateway.

PayumBundle comes with [Sonata Admin](http://sonata-project.org/bundles/admin/2-3/doc/index.html) bundle support out of the box, but you can totally do it manually.

## Configure

First we have to create an entity where we store information about a gateway.
The model must implement `Payum\Core\Model\GatewayConfigInterface`.

_**Note**: In this chapter we show how to use Doctrine ORM entities. There are other supported [storages](storages.md)._

```php
<?php
namespace Acme\PaymentBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Payum\Core\Model\GatewayConfig as BaseGatewayConfig;

/**
 * @ORM\Table
 * @ORM\Entity
 */
class GatewayConfig extends BaseGatewayConfig
{
    /**
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     *
     * @var integer $id
     */
    protected $id;
}
```

### With Sonata Admin

Next, you have to add mapping of the basic entity you've just extended, and configure payum's extension:

```yml
#app/config/config.yml

payum:
    dynamic_gateways:
        sonata_admin: true
        config_storage:
            Acme\PaymentBundle\Entity\GatewayConfig: { doctrine: orm }
```

#### Backend

Once you have configured everything doctrine, payum and sonata admin go to `/admin/dashboard`.
There you have to see a `Gateways` section. Try to add a gateway there.

### The manual way

```yml
#app/config/config.yml

payum:
    dynamic_gateways:
        config_storage:
            Acme\PaymentBundle\Entity\GatewayConfig: { doctrine: orm }
```

#### Backend

The following code is a basic example for configuring a [Paypal Express Checkout](https://github.com/Payum/Payum/blob/master/docs/paypal/express-checkout/get-it-started.md) gateway.

We first need to create a FormType with three fields:
  1. `factoryName`, the name of a factory, in our case it will always be `paypal_express_checkout`
  2. `gatewayName`, the name you want to give to your gateway
  3. `config`, the gateway configuration

```php
<?php
// src/Acme/PaymentBundle/Form/Type/GatewayConfigType.php

namespace Acme\PaymentBundle\Form\Type;

use Acme\PaymentBundle\Entity\GatewayConfig;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\OptionsResolver\OptionsResolver;

final class PaypalGatewayConfigType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('factoryName', TextType::class, [
                'disabled' => true,
                'data' => 'paypal_express_checkout',
            ])
            ->add('gatewayName', TextType::class)
            ->add('config', ConfigPaypalGatewayConfigType::class, [
                'label' => false,
                'auto_initialize' => false,
            ])
        ;
    }

    public function configureOptions(OptionsResolver $resolver): void
    {
        $resolver->setDefaults([
            'data_class' => GatewayConfig::class,
        ]);
    }
}
```

Then, we should implement a new FormType that will configure your PayPal gateway's config.

By reading [the doc](https://github.com/Payum/Payum/blob/master/docs/paypal/express-checkout/get-it-started.md), we should create four fields:
  1. `sandbox`
  2. `username`
  3. `password`
  4. `signature`

```php
<?php
// src/Acme/PaymentBundle/Form/Type/PaypalGatewayConfigType.php

namespace Acme\PaymentBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextType;

final class ConfigPaypalGatewayConfigType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options): void
    {
        $builder
            ->add('sandbox', CheckboxType::class)
            ->add('username', TextType::class)
            ->add('password', TextType::class)
            ->add('signature', TextType::class)
        ;
    }
}
```

For a more advanced example, you can check how Sylius implemented [Paypal and Stripe gateways form types](https://github.com/Sylius/Sylius/tree/master/src/Sylius/Bundle/PayumBundle/Form/Type).

## Use gateway

Let's say you created a gateway with name `paypal`. Here we will show you how to use it.

```php
<?php
// src/Acme/PaymentBundle/Controller/PaymentController.php

namespace Acme\PaymentBundle\Controller;

class PaymentController extends Controller
{
    public function prepareAction()
    {
        // If you have linked a gateway config to your user, you can simply use:
        $gatewayName = $this->getUser()->getGatewayConfig()->getGatewayName();

        $storage = $this->get('payum')->getStorage('Acme\PaymentBundle\Entity\Payment');

        $payment = $storage->create();
        $payment->setNumber(uniqid());
        $payment->setCurrencyCode('EUR');
        $payment->setTotalAmount(123); // 1.23 EUR
        $payment->setDescription('A description');
        $payment->setClientId('anId');
        $payment->setClientEmail('foo@example.com');

        $storage->update($payment);

        $captureToken = $this->get('payum')->getTokenFactory()->createCaptureToken(
            $gatewayName,
            $payment,
            'done' // the route to redirect after capture
        );

        return $this->redirect($captureToken->getTargetUrl());
    }
}
```

_**Note**: If you configured a gateway in config.yml and in the backend with same name. Backend one will be used._

* [Back to index](../index.md).


text:
'use strict';

module.exports = function(app) {
    var channels = require('../controllers/chat-channels.server.controller.js');

    // Messages Routes
    app.route('/api/chatchannel').all()
        .get(channels.list)
        .post(channels.create);

    app.route('/api/chatchannel/:channelId')
        .get(channels.read)
        .put(channels.update)
        .delete(channels.delete);

    // Finish by binding the Message middleware
    app.param('channelId', channels.channelByID);
};


text:
class gl_helper
{
public:

static void DrawRect(int x, int y, int width, int height);
static void DrawNumber(int x , int y, int n);
static void DebugPoint(float x , float y);

};

#endif // GL_HELPER_H


text:
<?php declare(strict_types=1);

namespace Monolog\Handler;

use Monolog\Test\TestCase;
use Monolog\Level;
use Monolog\Formatter\LineFormatter;

function error_log()
{
    $GLOBALS['error_log'][] = func_get_args();
}

class ErrorLogHandlerTest extends TestCase
{
    protected function setUp(): void
    {
        $GLOBALS['error_log'] = [];
    }

    /**
     * @covers Monolog\Handler\ErrorLogHandler::__construct
     */
    public function testShouldNotAcceptAnInvalidTypeOnConstructor()
    {
        $this->expectException(\InvalidArgumentException::class);
        $this->expectExceptionMessage('The given message type "42" is not supported');

        new ErrorLogHandler(42);
    }

    /**
     * @covers Monolog\Handler\ErrorLogHandler::write
     */
    public function testShouldLogMessagesUsingErrorLogFunction()
    {
        $type = ErrorLogHandler::OPERATING_SYSTEM;
        $handler = new ErrorLogHandler($type);
        $handler->setFormatter(new LineFormatter('%channel%.%level_name%: %message% %context% %extra%', null, true));
        $handler->handle($this->getRecord(Level::Error, "Foo\nBar\r\n\r\nBaz"));

        $this->assertSame("test.ERROR: Foo\nBar\r\n\r\nBaz [] []", $GLOBALS['error_log'][0][0]);
        $this->assertSame($GLOBALS['error_log'][0][1], $type);

        $handler = new ErrorLogHandler($type, Level::Debug, true, true);
        $handler->setFormatter(new LineFormatter(null, null, true));
        $handler->handle($this->getRecord(Level::Error, "Foo\nBar\r\n\r\nBaz"));

        $this->assertStringMatchesFormat('[%s] test.ERROR: Foo', $GLOBALS['error_log'][1][0]);
        $this->assertSame($GLOBALS['error_log'][1][1], $type);

        $this->assertStringMatchesFormat('Bar', $GLOBALS['error_log'][2][0]);
        $this->assertSame($GLOBALS['error_log'][2][1], $type);

        $this->assertStringMatchesFormat('Baz [] []', $GLOBALS['error_log'][3][0]);
        $this->assertSame($GLOBALS['error_log'][3][1], $type);
    }
}


text:
'''
menory system for robbie
we use a pickel file to store memories as a dictionary
to share with other files

'''

import pickle

class Robbie_memory():
    def __init__(self):
        #rospy.init_node("robbie_memory")
        self.MeMemory = {}

    def Memory_read(self):
        '''
         open file and read data as dictionary

        '''
        pkl_file = open('/home/peter/catkin_hydro/src/robbie_ros/robbie_behave/nodes/robbie.pkl', 'rb') #change location
        self.MeMemory = pickle.load(pkl_file)
        pkl_file.close()

    def Memory_write(self):
        output = open('/home/peter/catkin_hydro/src/robbie_ros/robbie_behave/nodes/robbie.pkl', 'wb')
        pickle.dump(self.MeMemory, output)
        output.close()


text:
"""
Support for ROS Names

See: U{http://www.ros.org/wiki/Names}
"""

import sys
import os

from rosgraph.names import namespace, get_ros_namespace, ns_join, make_global_ns, load_mappings, \
     SEP, GLOBALNS, REMAP, ANYTYPE, \
     is_global, is_private
import rosgraph.names

from rospy.exceptions import ROSException
from rospy.impl.validators import ParameterInvalid

TOPIC_ANYTYPE = ANYTYPE #indicates that a subscriber will connect any datatype given to it
SERVICE_ANYTYPE = ANYTYPE #indicates that a service client does not have a fixed type

import struct

if sys.hexversion > 0x03000000: #Python3
    def isstring(s):
        return isinstance(s, str) #Python 3.x
else:
    def isstring(s):
        return isinstance(s, basestring) #Python 2.x

def canonicalize_name(name):
    """
    Put name in canonical form. Double slashes '//' are removed and
    name is returned without any trailing slash, e.g. /foo/bar
    @param name: ROS name
    @type  name: str
    """
    if not name or name == SEP:
        return name
    elif name[0] == SEP:
        return '/' + '/'.join([x for x in name.split(SEP) if x])
    else:
        return '/'.join([x for x in name.split(SEP) if x])
    ##if len(name) > 1 and name[-1] == SEP:
    ##    return name[:-1]
    ##return name

# Mappings override name resolution by substituting fully-qualified
# names in for local name references. They override any name
# reference, with exception of '.local' names. We load remapping args
# as soon as client API is referenced so that they are initialized
# before Topic constructors are invoked.
_mappings = load_mappings(sys.argv)
_resolved_mappings = {}

def reload_mappings(argv):
    """
    Re-initialize the name remapping table.

    @param argv: Command line arguments to this program. ROS reads
        these arguments to find renaming params.
    @type  argv: [str]
    """
    global _mappings
    _mappings = load_mappings(argv)

# #1810
def initialize_mappings(node_name):
    """
    Initialize the remapping table based on provide node name.

    @param node_name: name of node (caller ID)
    @type  node_name: str
    """
    global _resolved_mappings
    _resolved_mappings = {}
    for m,v in _mappings.items():
        # resolve both parts of the mappings. use the rosgraph.names
        # version of resolve_name to avoid circular mapping.
        if m.startswith('__'): # __name, __log, etc...
            _resolved_mappings[m] = v
        else:
            _resolved_mappings[rosgraph.names.resolve_name(m, node_name)] = rosgraph.names.resolve_name(v, node_name)

def resolve_name_without_node_name(name):
    """
    The need for this function is complicated -- Topics and Services can be created before init_node is called.
    In general, this is okay, unless the name is a ~name, in which
    case we have to raise an ValueError

    @param name: ROS name to resolve
    @type  name: str
    @raise ValueError: if name is a ~name
    @raise ROSInitException: if name is remapped to a ~name
    """
    if is_private(name):
        raise ValueError("~name topics cannot be created before init_node() has been called")

    # we use the underlying rosgraph.names.resolve_name to avoid dependencies on nodename/remappings
    fake_caller_id = ns_join(get_namespace(), 'node')
    fake_resolved = rosgraph.names.resolve_name(name, fake_caller_id)

    for m, v in _mappings.items():
        if rosgraph.names.resolve_name(m, fake_caller_id) == fake_resolved:
            if is_private(name):
                raise ROSInitException("due to the way this node is written, %s cannot be remapped to a ~name. \nThe declaration of topics/services must be moved after the call to init_node()"%name)
            else:
                return rosgraph.names.resolve_name(v, fake_caller_id)
    return fake_resolved

def get_mappings():
    """
    Get mapping table with unresolved names

    @return: command-line remappings {name: name}
    @rtype: {str: str}
    """
    return _mappings

def get_resolved_mappings():
    """
    Get mapping table with resolved names

    @return: command-line remappings {name: name}
    @rtype: {str: str}
    """
    return _resolved_mappings

#TODO: port to a wrapped call to rosgraph.names.resolve_name
def resolve_name(name, caller_id=None):
    """
    Resolve a ROS name to its global, canonical form. Private ~names
    are resolved relative to the node name.

    @param name: name to resolve.
    @type  name: str
    @param caller_id: node name to resolve relative to. To
    resolve to local namespace, omit this parameter (or use None)
    @type  caller_id: str
    @return: Resolved name. If name is empty/None, resolve_name
    returns parent namespace. If namespace is empty/None,
    @rtype: str
    """
    if not caller_id:
        caller_id = get_name()
    if not name: #empty string resolves to namespace
        return namespace(caller_id)

    name = str(name)  # enforce string conversion else struct.pack might raise UnicodeDecodeError (see #3998)
    name = canonicalize_name(name)
    if name[0] == SEP: #global name
        resolved_name = name
    elif is_private(name): #~name
        resolved_name = ns_join(caller_id, name[1:])
    else: #relative
        resolved_name = namespace(caller_id) + name

    #Mappings override general namespace-based resolution
    # - do this before canonicalization as remappings are meant to
    #   match the name as specified in the code
    if resolved_name in _resolved_mappings:
        return _resolved_mappings[resolved_name]
    else:
        return resolved_name

def remap_name(name, caller_id=None, resolved=True):
    """
    Remap a ROS name. This API should be used to instead of
    resolve_name for APIs in which you don't wish to resolve the name
    unless it is remapped.
    @param name: name to remap
    @type  name: str

    @param resolved: if True (default), use resolved names in remappings, which is the standard for ROS.
    @type  resolved: bool

    @return: Remapped name
    @rtype: str
    """
    if not caller_id:
        caller_id = get_caller_id()
    if name in _mappings:
        return rosgraph.names.resolve_name(_mappings[name], caller_id)
    return name

def scoped_name(caller_id, name):
    """
    Convert the global caller_id to a relative name within the namespace. For example, for
    namespace '/foo' and name '/foo/bar/name', the return value will
    be 'bar/name'

    WARNING: scoped_name does not validate that name is actually within
    the supplied namespace.
    @param caller_id: caller ID, in canonical form
    @type  caller_id: str
    @param name: name to scope
    @type  name: str
    @return: name scoped to the caller_id's namespace.
    @rtype: str
    """
    if not is_global(caller_id):
        raise ROSException("caller_id must be global")
    return canonicalize_name(name)[len(namespace(caller_id)):]

###################################################
# Name validators      ############################

#Technically XMLRPC will never send a None, but I don't want to code masterslave.py to be
#XML-RPC specific in this way.

def valid_name_validator_resolved(param_name, param_value, caller_id):
    if not param_value or not isstring(param_value):
        raise ParameterInvalid("ERROR: parameter [%s] must be a non-empty string"%param_name)
    #TODO: actual validation of chars
    # I added the colon check as the common error will be to send an URI instead of name
    if ':' in param_value or ' ' in param_value:
        raise ParameterInvalid("ERROR: parameter [%s] contains illegal chars"%param_name)
    #don't use our own resolve_name because we do not want to remap
    return rosgraph.names.resolve_name(param_value, caller_id, remappings=None)

def valid_name_validator_unresolved(param_name, param_value, caller_id):
    if not param_value or not isstring(param_value):
        raise ParameterInvalid("ERROR: parameter [%s] must be a non-empty string"%param_name)
    #TODO: actual validation of chars
    # I added the colon check as the common error will be to send an URI instead of name
    if ':' in param_value or ' ' in param_value:
        raise ParameterInvalid("ERROR: parameter [%s] contains illegal chars"%param_name)
    return param_value

def valid_name(param_name, resolve=True):
    """
    Validator that resolves names and also ensures that they are not empty
    @param param_name: name
    @type  param_name: str
    @param resolve: if True/omitted, the name will be resolved to
       a global form. Otherwise, no resolution occurs.
    @type  resolve: bool
    @return: resolved parameter value
    @rtype: str
    """
    def validator(param_value, caller_id):
        if resolve:
            return valid_name_validator_resolved(param_name, param_value, caller_id)
        return valid_name_validator_unresolved(param_name, param_value, caller_id)
    return validator

def global_name(param_name):
    """
    Validator that checks for valid, global graph resource name.
    @return: parameter value
    @rtype: str
    """
    def validator(param_value, caller_id):
        if not param_value or not isstring(param_value):
            raise ParameterInvalid("ERROR: parameter [%s] must be a non-empty string"%param_name)
        #TODO: actual validation of chars
        if not is_global(param_value):
            raise ParameterInvalid("ERROR: parameter [%s] must be a globally referenced name"%param_name)
        return param_value
    return validator

#########################################################
#Global Namespace Routines
# - Global state, e.g. singletons and namespace

_caller_namespace = get_ros_namespace()
_caller_id = _caller_namespace+'unnamed' #default for non-node.

def get_namespace():
    """
    Get namespace of local node.
    @return: fully-qualified name of local node or '' if not applicable
    @rtype: str
    """
    return _caller_namespace

def get_name():
    """
    Get fully resolved name of local node. If this is not a node,
    use empty string
    @return: fully-qualified name of local node or '' if not applicable
    @rtype: str
    """
    return _caller_id

# backwards compatibility
get_caller_id = get_name

def _set_caller_id(caller_id):
    """
    Internal API.
    Set the global name (i.e. caller_id) and namespace. Methods can
    check what the name of the current node is by calling get_caller_id.

    The caller_id is important as it is the first parameter to any API
    call on a remote node.  Invoked by ROSNode constructor
    @param caller_id: new caller ID
    @type  caller_id: str
    """
    global _caller_id, _caller_namespace
    _caller_id = caller_id
    _caller_namespace = namespace(caller_id)


text:
package io.ray.streaming.runtime.master.scheduler;

import io.ray.streaming.runtime.core.graph.executiongraph.ExecutionGraph;

/**
 * Job scheduler is used to do the scheduling in JobMaster.
 */
public interface JobScheduler {

  /**
   * Schedule streaming job using the physical plan.
   *
   * @param executionGraph physical plan
   * @return scheduling result
   */
  boolean scheduleJob(ExecutionGraph executionGraph);
}


text:
WHAT WE DO

HOW WE MADE THIS

       INTERACTIVE MEDIA

          WHO WE ARE

              FACULTY

              STUDENTS / ALUMNI

          RESOURCES

              CURRENT STUDENTS

              ALUMNI


text:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<form name="input" action="" method="get">
Request:
<input type="text" name="REQUEST" value="GETCAPABILITIES" size="50">

 Service:
<input type="text" name="SERVICE" value="WFS" size="10">

 Version:
<input type="text" name="VERSION" value="1.1.0" size="10">

 Format:
<select name="FORMAT">
<option value="text/xml">text/xml</option>
<option value="text/html">text/html</option>
</select>

<input type="submit" value="Submit" onclick="SetActionTarget()"> <input type="reset">
</form>