text:
package com.amazonaws.services.ec2.model;
import com.amazonaws.AmazonWebServiceRequest;

/**
 * Container for the parameters to the {@link com.amazonaws.services.ec2.AmazonEC2#createCustomerGateway(CreateCustomerGatewayRequest) CreateCustomerGateway operation}.
 *

 * Provides information to AWS about your customer gateway device. The customer gateway is the appliance at your end of the VPN connection (compared to
 * the VPN gateway, which is the device at the AWS side of the VPN connection). You can have a single active customer gateway per AWS account (active
 * means that you've created a VPN connection to use with the customer gateway). AWS might delete any customer gateway that you create with this
 * operation if you leave it inactive for an extended period of time.
 *

 *

 * You must provide the Internet-routable IP address of the customer gateway's external interface. The IP address must be static.
 *

 *

 * You must also provide the device's Border Gateway Protocol (BGP) Autonomous System Number (ASN). You can use an existing ASN assigned to your
 * network. If you don't have an ASN already, you can use a private ASN (in the 64512 - 65534 range). For more information about ASNs, go to  http://en.wikipedia.org/wiki/Autonomous_system_%28Internet%29  .
 *

 *
 * @see com.amazonaws.services.ec2.AmazonEC2#createCustomerGateway(CreateCustomerGatewayRequest)
 */
public class CreateCustomerGatewayRequest extends AmazonWebServiceRequest {

    /**
     * The type of VPN connection this customer gateway supports.
     */
    private String type;

    /**
     * The Internet-routable IP address for the customer gateway's outside
     * interface. The address must be static
     */
    private String publicIp;

    /**
     * The customer gateway's Border Gateway Protocol (BGP) Autonomous System
     * Number (ASN).
     */
    private Integer bgpAsn;

    /**
     * Default constructor for a new CreateCustomerGatewayRequest object.  Callers should use the
     * setter or fluent setter (with...) methods to initialize this object after creating it.
     */
    public CreateCustomerGatewayRequest() {}

    /**
     * Constructs a new CreateCustomerGatewayRequest object.
     * Callers should use the setter or fluent setter (with...) methods to
     * initialize any additional object members.
     *
     * @param type The type of VPN connection this customer gateway supports.
     * @param publicIp The Internet-routable IP address for the customer
     * gateway's outside interface. The address must be static
     * @param bgpAsn The customer gateway's Border Gateway Protocol (BGP)
     * Autonomous System Number (ASN).
     */
    public CreateCustomerGatewayRequest(String type, String publicIp, Integer bgpAsn) {
        this.type = type;
        this.publicIp = publicIp;
        this.bgpAsn = bgpAsn;
    }

    /**
     * The type of VPN connection this customer gateway supports.
     *
     * @return The type of VPN connection this customer gateway supports.
     */
    public String getType() {
        return type;
    }

    /**
     * The type of VPN connection this customer gateway supports.
     *
     * @param type The type of VPN connection this customer gateway supports.
     */
    public void setType(String type) {
        this.type = type;
    }

    /**
     * The type of VPN connection this customer gateway supports.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param type The type of VPN connection this customer gateway supports.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public CreateCustomerGatewayRequest withType(String type) {
        this.type = type;
        return this;
    }

    /**
     * The Internet-routable IP address for the customer gateway's outside
     * interface. The address must be static
     *
     * @return The Internet-routable IP address for the customer gateway's outside
     *         interface. The address must be static
     */
    public String getPublicIp() {
        return publicIp;
    }

    /**
     * The Internet-routable IP address for the customer gateway's outside
     * interface. The address must be static
     *
     * @param publicIp The Internet-routable IP address for the customer gateway's outside
     *         interface. The address must be static
     */
    public void setPublicIp(String publicIp) {
        this.publicIp = publicIp;
    }

    /**
     * The Internet-routable IP address for the customer gateway's outside
     * interface. The address must be static
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param publicIp The Internet-routable IP address for the customer gateway's outside
     *         interface. The address must be static
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public CreateCustomerGatewayRequest withPublicIp(String publicIp) {
        this.publicIp = publicIp;
        return this;
    }

    /**
     * The customer gateway's Border Gateway Protocol (BGP) Autonomous System
     * Number (ASN).
     *
     * @return The customer gateway's Border Gateway Protocol (BGP) Autonomous System
     *         Number (ASN).
     */
    public Integer getBgpAsn() {
        return bgpAsn;
    }

    /**
     * The customer gateway's Border Gateway Protocol (BGP) Autonomous System
     * Number (ASN).
     *
     * @param bgpAsn The customer gateway's Border Gateway Protocol (BGP) Autonomous System
     *         Number (ASN).
     */
    public void setBgpAsn(Integer bgpAsn) {
        this.bgpAsn = bgpAsn;
    }

    /**
     * The customer gateway's Border Gateway Protocol (BGP) Autonomous System
     * Number (ASN).
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param bgpAsn The customer gateway's Border Gateway Protocol (BGP) Autonomous System
     *         Number (ASN).
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public CreateCustomerGatewayRequest withBgpAsn(Integer bgpAsn) {
        this.bgpAsn = bgpAsn;
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (type != null) sb.append("Type: " + type + ", ");
        if (publicIp != null) sb.append("PublicIp: " + publicIp + ", ");
        if (bgpAsn != null) sb.append("BgpAsn: " + bgpAsn + ", ");
        sb.append("}");
        return sb.toString();
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
        hashCode = prime * hashCode + ((getPublicIp() == null) ? 0 : getPublicIp().hashCode());
        hashCode = prime * hashCode + ((getBgpAsn() == null) ? 0 : getBgpAsn().hashCode());
        return hashCode;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;

        if (obj instanceof CreateCustomerGatewayRequest == false) return false;
        CreateCustomerGatewayRequest other = (CreateCustomerGatewayRequest)obj;

        if (other.getType() == null ^ this.getType() == null) return false;
        if (other.getType() != null && other.getType().equals(this.getType()) == false) return false;
        if (other.getPublicIp() == null ^ this.getPublicIp() == null) return false;
        if (other.getPublicIp() != null && other.getPublicIp().equals(this.getPublicIp()) == false) return false;
        if (other.getBgpAsn() == null ^ this.getBgpAsn() == null) return false;
        if (other.getBgpAsn() != null && other.getBgpAsn().equals(this.getBgpAsn()) == false) return false;
        return true;
    }

}


text:
package com.intellij.xml.util;

@Deprecated
public class XmlTagTextUtil extends XmlTagUtil {

}

redpajama_set_name: RedPajamaGithub


text:
if (window.Aloha !== undefined && window.Aloha !== null) {

	Aloha.ready(function() {

		Aloha.jQuery('.editable').aloha();

		Aloha.bind('aloha-editable-deactivated', function(event) {
			var content = Aloha.activeEditable.getContents();
			var contentId = Aloha.activeEditable.obj[0].id;
			var pageId = window.location.pathname;

			// textarea handling -- html id is "xy" and will be "xy-aloha" for the aloha editable
			if ( contentId.match(/-aloha$/gi) ) {
				contentId = contentId.replace(/-aloha/gi, '');
			}
			if (contentId.match(/-id/gi)) {
				contentId = contentId.replace(/-id/gi, '');
			}

			var formSelector = '.form-' + contentId;

			//set our hidden inputs
			$(formSelector + " :eq(1)").val(contentId);
			$(formSelector + " :eq(2)").val(content);
			//$(formSelector + " :eq(4)").click();

			$.post(window.location.href, $(formSelector).serialize());
		});
	});

}


text:
package org.datanucleus.tests.newfeatures;

import org.datanucleus.ClassLoaderResolver;
import org.datanucleus.NucleusContext;
import org.datanucleus.PersistenceNucleusContextImpl;
import org.datanucleus.api.jakarta.metadata.JakartaMetaDataManager;
import org.datanucleus.metadata.ClassMetaData;
import org.datanucleus.metadata.MetaDataManager;
import org.datanucleus.metadata.PersistenceUnitMetaData;
import org.datanucleus.samples.ann_xml.models.company.Person;
import org.datanucleus.tests.JakartaPersistenceTestCase;

/**
 * Tests for the use of JPA Annotations+MetaData.
 */
public class AnnotationPlusXMLTest extends JakartaPersistenceTestCase
{
    public AnnotationPlusXMLTest(String name)
    {
        super(name);
    }

    /**
     * Test of JPA @MapKeyColumn.
     */
    public void testMapKeyColumn()
    {
        NucleusContext nucleusCtx = new PersistenceNucleusContextImpl("Jakarta", null);
        ClassLoaderResolver clr = nucleusCtx.getClassLoaderResolver(null);
        MetaDataManager metaDataMgr = new JakartaMetaDataManager(nucleusCtx);
        PersistenceUnitMetaData pumd = getMetaDataForPersistenceUnit(nucleusCtx, "JakartaTest");
        metaDataMgr.loadPersistenceUnit(pumd, null);

        // Retrieve the metadata from the MetaDataManager (populates and initialises everything)
        ClassMetaData cmd1 = (ClassMetaData)metaDataMgr.getMetaDataForClass(Person.class.getName(), clr);
        assertEquals("phoneNumbers_key1", cmd1.getMetaDataForMember("phoneNumbers").getKeyMetaData().getColumnMetaData()[0].getName());
        assertTrue(cmd1.getMetaDataForMember("phoneNumbers").getKeyMetaData().getColumnMetaData()[0].getUnique());
    }
}


text:
using TpDotNetCore.Helpers;
using System.Linq;
using Microsoft.AspNetCore.Authorization;
using System.ComponentModel;
using NSwag.Annotations;
using Microsoft.AspNetCore.Mvc;
using System.Threading.Tasks;

namespace TpDotNetCore.Controllers
{
#pragma warning disable // Disable all warnings

    public interface ITpProfileController
    {
        /// Abfrage aller Profile
        /// <returns>Die Operation war erfolgreich.</returns>
        Task<SwaggerResponse<ProfileResponseDto>> GetProfilesAsync();

        /// Abfrage des eigenen Profils
        /// <returns>Die Operation war erfolgreich.</returns>
        Task<SwaggerResponse<ProfileResponseDto>> GetMyProfileAsync();

        /// Abfrage eines Benutzerprofiles
        /// <param name="userid">User Id</param>
        /// <returns>Die Operation war erfolgreich.</returns>
        Task<SwaggerResponse<ProfileResponseDto>> GetProfileAsync(string userid);
    }

    [Route("api/v1/profile")]
    [Authorize]
    public partial class TpProfileController : TpBaseController
    {
        private ITpProfileController _implementation;

        public TpProfileController(ITpProfileController implementation)
        {
            _implementation = implementation;
        }

        /// Abfrage aller Profile
        /// <returns>Die Operation war erfolgreich.</returns>
        [HttpGet, Route("getProfiles")]
        [SwaggerResponse("200", typeof(ProfileResponseDto))]
        // [SwaggerOperation("getProfiles")]
        public async Task<IActionResult> GetProfiles()
        {
            var result = await _implementation.GetProfilesAsync().ConfigureAwait(false);
            return ProcessResponse<ProfileResponseDto>(result);
        }

        /// Abfrage des eigenen Profils
        /// <returns>Die Operation war erfolgreich.</returns>
        [HttpGet, Route("getMyProfile")]
        [SwaggerResponse("200", typeof(ProfileResponseDto))]
        public async Task<IActionResult> GetMyProfile()
        {
            var result = await _implementation.GetMyProfileAsync().ConfigureAwait(false);
            return ProcessResponse<ProfileResponseDto>(result);
        }

        /// Abfrage eines Benutzerprofiles
        /// <param name="userid">User Id</param>
        /// <returns>Die Operation war erfolgreich.</returns>
        [HttpGet, Route("getUserProfile/{userid}")]
        [SwaggerResponse("200", typeof(ProfileResponseDto))]
        public async Task<IActionResult> GetProfile(string userid)
        {
            var result = await _implementation.GetProfileAsync(userid).ConfigureAwait(false);
            return ProcessResponse<ProfileResponseDto>(result);
        }
    }
}


text:
/** Utility classes for the analytics component. */
package org.apache.solr.analytics.util;


text:
require File.dirname(__FILE__) + '/../../spec_helper.rb'

module Spec
  module DSL
    describe Configuration do
      before(:each) do
        @config = Configuration.new
        @behaviour = mock("behaviour")
      end

      it "should default mock framework to rspec" do
        @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/rspec$/
      end

      it "should let you set rspec mocking explicitly" do
        @config.mock_with(:rspec)
        @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/rspec$/
      end

      it "should let you set mocha" do
        @config.mock_with(:mocha)
        @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/mocha$/
      end

      it "should let you set flexmock" do
        @config.mock_with(:flexmock)
        @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/flexmock$/
      end

      it "should let you set rr" do
        @config.mock_with(:rr)
        @config.mock_framework.should =~ /\/plugins\/mock_frameworks\/rr$/
      end

      it "should let you set an arbitrary adapter module" do
        adapter = Module.new
        @config.mock_with(adapter)
        @config.mock_framework.should == adapter
      end

      it "should let you define modules to be included" do
        mod = Module.new
        @config.include mod
        @config.modules_for(nil).should include(mod)
      end

      [:prepend_before, :append_before, :prepend_after, :append_after].each do |m|
        it "should delegate ##{m} to Behaviour class" do
          Behaviour.should_receive(m).with(:whatever)
          @config.__send__(m, :whatever)
        end
      end
    end
  end
end


text:
import sys
import os

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('../sphinxext'))
#sys.path.insert(0, os.path.abspath('../..'))

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.autosummary',
    'sphinx.ext.doctest',
    'sphinx.ext.pngmath',
    'sphinx.ext.inheritance_diagram',
    'sphinx.ext.extlinks',
    'sphinx.ext.todo',
    'sphinx.ext.viewcode',
    'ipython_console_highlighting',
    'numpydoc',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix of source filenames.
source_suffix = '.rst'

# The encoding of source files.
source_encoding = 'utf-8'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'PyTables'
copyright = u'2011-2014, PyTables maintainers'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
VERSION = open('../../VERSION').read().strip()
version = VERSION
# The full version, including alpha/beta/rc tags.
release = VERSION

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = []

# The reST default role (used for this markup: `text`) to use for all
# documents.
#default_role = None

# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
#pygments_style = 'sphinx'
#pygments_style = 'friendly'
#pygments_style = 'bw'
#pygments_style = 'fruity'
#pygments_style = 'manni'
pygments_style = 'tango'

# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []

# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False

# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
#html_theme = 'default'
#html_theme = 'altered_nature'
html_theme = 'cloud'
#html_theme = 'sphinxdoc'

# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Theme options are theme-specific and customize the look and feel of a theme
# further.  For a list of options available for each theme, see the
# documentation.
linkcolor = '#9F1E1E'
trimcolor = '#511755'
trimcolor = '#000000'

html_theme_options = {'sidebarbgcolor': 'rgba(213, 197, 229, 0.15)',
                      'sidebartextcolor': '#280941',
                      'sidebarlinkcolor': linkcolor,
                      'sidebartrimcolor': trimcolor,
                      'collapsiblesidebar': True,
                      'relbarbgcolor': '#006FFF',
                      'footerbgcolor': 'rgba(252, 255, 0, 0.125)',
                      'footertextcolor': '#504A4B',
                      'bodytrimcolor': trimcolor,
                      'linkcolor': linkcolor,
                      'textcolor': '#323039',
                      'sectionbgcolor': '#3CAD1C',
                      #'sectiontextcolor': '#777777',
                      #'sectiontrimcolor': trimcolor,
                      'codebgcolor': '#F1FFF0',
                      'codetextcolor': '#000000',
                      'quotebgcolor': '#f6fcfc',
                      'rubricbgcolor': '#D00000',
                      #'min_height': 'bottom',
                      }

# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = ["_theme"]

# The name for this set of Sphinx documents.  If None, it defaults to
# "<project> v<release> documentation".
#html_title = None

# A shorter title for the navigation bar.  Default is the same as html_title.
#html_short_title = None

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
html_logo = '_static/logo-pytables-small.png'

# The name of an image file (within the static path) to use as favicon of the
# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
html_favicon = 'images/favicon.ico'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
#html_extra_path = []

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True

# Custom sidebar templates, maps document names to template names.
html_sidebars = {
    'index': ['globaltoc.html', 'relations.html', 'sourcelink.html',
              'searchbox.html', 'travis-ci.html']
}

# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}

# If false, no module index is generated.
#html_domain_indices = True

# If false, no index is generated.
#html_use_index = True

# If true, the index is split into individual pages for each letter.
#html_split_index = False

# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True

# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it.  The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''

# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None

# Output file base name for HTML help builder.
htmlhelp_basename = 'pytablesdoc'

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
    # The paper size ('letterpaper' or 'a4paper').
    #'papersize': 'letterpaper',

    # The font size ('10pt', '11pt' or '12pt').
    #'pointsize': '10pt',

    # Additional stuff for the LaTeX preamble.
    'preamble': '\usepackage{bookmark,hyperref}',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
#  author, documentclass [howto, manual, or own class]).
latex_documents = [
  ('usersguide/usersguide', 'usersguide-%s.tex' % version,
   u'PyTables User Guide', u'PyTables maintainers', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
latex_logo = 'usersguide/images/pytables-front-logo.pdf'

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
latex_use_parts = True

# If true, show page references after internal links.
#latex_show_pagerefs = False

# If true, show URL addresses after external links.
#latex_show_urls = False

# Documents to append as an appendix to all manuals.
#latex_appendices = [
#    'usersguide/datatypes',
#    'usersguide/condition_syntax',
#    'usersguide/parameter_files',
#    'usersguide/nested_rec_arrays',
#    'usersguide/utilities',
#    'usersguide/file_format',
#    'usersguide/bibliography',
#]

# If false, no module index is generated.
latex_domain_indices = False

# -- Options for autodocumentation ---------------------------------------------
autodoc_member_order = "groupwise"
autoclass_content = "class"
autosummary_generate = []

# -- Options for Epub output ----------------------------------------------

# Bibliographic Dublin Core info.
epub_title = u'PyTables'
epub_author = u'PyTables maintainers'
epub_publisher = u'PyTables maintainers'
epub_copyright = u'2011-2014, PyTables maintainers'

# The basename for the epub file. It defaults to the project name.
#epub_basename = u'PyTables'

# The HTML theme for the epub output. Since the default themes are not optimized
# for small screen space, using the same theme for HTML and epub output is
# usually not wise. This defaults to 'epub', a theme designed to save visual
# space.
#epub_theme = 'epub'

# The language of the text. It defaults to the language option
# or en if the language is not set.
#epub_language = ''

# The scheme of the identifier. Typical schemes are ISBN or URL.
#epub_scheme = ''

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#epub_identifier = ''

# A unique identification for the text.
#epub_uid = ''

# A tuple containing the cover image and cover page html template filenames.
#epub_cover = ()

# A sequence of (type, uri, title) tuples for the guide element of content.opf.
#epub_guide = ()

# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_pre_files = []

# HTML files shat should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_post_files = []

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']

# The depth of the table of contents in toc.ncx.
#epub_tocdepth = 3

# Allow duplicate toc entries.
#epub_tocdup = True

# Choose between 'default' and 'includehidden'.
#epub_tocscope = 'default'

# Fix unsupported image types using the PIL.
#epub_fix_images = False

# Scale large images.
#epub_max_image_width = 0

# How to display URL addresses: 'footnote', 'no', or 'inline'.
#epub_show_urls = 'inline'

# If false, no index is generated.
#epub_use_index = True

# -- Intersphinx options ----------------------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
#intersphinx_mapping = {'http://docs.python.org/': None}

# -- External link options ----------------------------------------------------
extlinks = {
    'issue': ('https://github.com/PyTables/PyTables/issues/%s', 'gh-'),
    'irc': ('http://pytables.github.io/irc/%s.html', ''),
}


text:
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

import com.esri.client.local.LocalFeatureService;
import com.esri.client.local.LocalServiceStartCompleteEvent;
import com.esri.client.local.LocalServiceStartCompleteListener;
import com.esri.client.toolkit.overlays.HitTestEvent;
import com.esri.client.toolkit.overlays.HitTestListener;
import com.esri.client.toolkit.overlays.HitTestOverlay;
import com.esri.core.geometry.Envelope;
import com.esri.core.map.Graphic;
import com.esri.map.ArcGISFeatureLayer;
import com.esri.map.ArcGISTiledMapServiceLayer;
import com.esri.map.GraphicsLayer;
import com.esri.map.JMap;
import com.esri.map.LayerList;
import com.esri.map.MapEvent;
import com.esri.map.MapEventListenerAdapter;
import com.esri.map.popup.MapPopup;
import com.esri.map.popup.PopupView;
import com.esri.map.popup.PopupViewEvent;
import com.esri.map.popup.PopupViewListener;

/***
 * Application for a tech session at Esri Dev Summit 2013.
 */
public class DataAnalysisApp {

  private JPanel jPanel;

  private LocalFeatureService featureService;

  private ArcGISFeatureLayer pointsLayer;

  private JMap map;

  private HitTestOverlay hitTestOverlay;

  private DriveTimeExecutor driveTimeExecutor;

  private static String FSP = System.getProperty("file.separator");

  /**
   * Constructor
   */
  public DataAnalysisApp() {
    initialize();
  }

  public JPanel createUI() {
    return jPanel;
  }

  private void initialize() {

    // create UI
    jPanel = new JPanel();
    jPanel.setLayout(new BorderLayout(5, 0));
    jPanel.setBackground(Color.WHITE);

    // add map
    map = new JMap();
    jPanel.add(map, BorderLayout.CENTER);
    map.setMinimumSize(new Dimension(512, 512));

    // attribute editor
    JButton driveTimeButton = new JButton("Calculate Drive Time");
    driveTimeButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        hitTestOverlay.setActive(false);
        driveTimeExecutor.setEnabled(true);
      }
    });

    JButton viewAttributesButton = new JButton("View Attributes");
    viewAttributesButton.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        hitTestOverlay.setActive(true);
        driveTimeExecutor.setEnabled(false);
      }
    });

    JPanel topPanel = new JPanel();
    topPanel.add(driveTimeButton);
    topPanel.add(viewAttributesButton);
    jPanel.add(topPanel, BorderLayout.NORTH);

    // set default extent
    map.addMapEventListener(new MapEventListenerAdapter() {
      @Override
      public void mapReady(final MapEvent arg0) {
        SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {
            ((JMap) arg0.getSource()).setExtent(
              new Envelope(-122.51716971480532, 37.700866040901786, -122.34825490495734, 37.8145058824865));
          }
        });
      }

      @Override
      public void mapExtentChanged(final MapEvent arg0) {
      }
    });

    // add a tiled layer to map
    final LayerList layers = map.getLayers();
    layers.add(new ArcGISTiledMapServiceLayer(
        "http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"));

    // create the local feature service
    featureService = new LocalFeatureService("data" + FSP + "MyRestaurants.mpk");
    featureService.addLocalServiceStartCompleteListener(new LocalServiceStartCompleteListener() {

      @Override
      public void localServiceStartComplete(LocalServiceStartCompleteEvent arg0) {
        // once service started, create and add feature layers to the map
        pointsLayer = new ArcGISFeatureLayer(arg0.getUrl() + "/0");
        layers.add(pointsLayer);

        hitTestOverlay = new HitTestOverlay(pointsLayer);
        hitTestOverlay.addHitTestListener(new HitTestListener() {
          @Override
          public void graphicHit(HitTestEvent event) {
            // / get first (top-most) graphic hit by the mouse
            HitTestOverlay overlay = (HitTestOverlay) event.getSource();
            Graphic hitGraphic = overlay.getHitGraphics().get(0);
            try {
              PopupView content = PopupView.createEditView("Attributes", pointsLayer);
              content.setSize(300, 200);
              content.setGraphic(pointsLayer, hitGraphic);
              final MapPopup popup = pointsLayer.getMap().createPopup(new JComponent[] { content }, hitGraphic, true);
              popup.setMovingWithMap(true);
              popup.setTitle("Attributes");
              popup.setVisible(true);
              content.addPopupViewListener(new PopupViewListener() {

                @Override
                public void onCommitEdit(PopupViewEvent popupViewEvent, Graphic _graphic) {
                  popup.close();
                }

                @Override
                public void onCancelEdit(PopupViewEvent popupViewEvent, Graphic _graphic) {
                  popup.close();
                }
              });
            } catch (Exception e) {
              e.printStackTrace();
            }
          }
        });
        hitTestOverlay.setActive(true);
        map.addMapOverlay(hitTestOverlay);
      }
    });
    // start the service
    featureService.startAsync();

    // graphics layer for drive time
    GraphicsLayer graphicsLayer = new GraphicsLayer();
    driveTimeExecutor = new DriveTimeExecutor(map, graphicsLayer);
    map.addMouseListener(driveTimeExecutor);
    layers.add(graphicsLayer);
  }

  /**
   * Starting point of this application.
   *
   * @param args
   */
  public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        try {
          DataAnalysisApp templatePickerApp = new DataAnalysisApp();
          JFrame window = templatePickerApp.createWindow();
          window.add(templatePickerApp.createUI());
          window.setVisible(true);
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    });
  }

  /**
   * Creates a window.
   *
   * @return a window.
   */
  private JFrame createWindow() {
    JFrame window = new JFrame();
    window.setBounds(100, 100, 1000, 700);
    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    window.getContentPane().setLayout(new BorderLayout(0, 0));
    window.addWindowListener(new WindowAdapter() {
      @Override
      public void windowClosing(WindowEvent windowEvent) {
        super.windowClosing(windowEvent);
        map.dispose();
      }
    });
    return window;
  }
}


text:
package org.apache.axis2.engine;

import junit.framework.TestCase;
import org.apache.axis2.AbstractTestCase;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.description.AxisModule;
import org.apache.axis2.description.AxisOperation;
import org.apache.axis2.description.AxisService;

import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;

public class ModuleEngageTest extends TestCase {
    AxisConfiguration axisConfig;

    public void testModuleEngagement() throws AxisFault,
            XMLStreamException {
        String filename = AbstractTestCase.basedir + "/target/test-resources/deployment";
        axisConfig = ConfigurationContextFactory.createConfigurationContextFromFileSystem(filename, filename + "/axis2.xml")
                .getAxisConfiguration();
        AxisModule module = axisConfig.getModule("module1");
        assertNotNull(module);
        axisConfig.engageModule("module1");
        AxisService service = axisConfig.getService("service2");
        assertNotNull(service);
        AxisOperation moduleOperation = service.getOperation(
                new QName("creatSeq"));
        assertNotNull(moduleOperation);
    }

}


text:
FROM anthonyalmarza/alpine-pyenv:cable

MAINTAINER Anthony Almarza <anthony.almarza@gmail.com>

WORKDIR /var/chalk

COPY requirements-dev.txt requirements-dev.txt

VOLUME ['/var/chalk']

RUN pip install -r requirements-dev.txt


text:
<?php

namespace Hoa\Praspel\Exception;

/**
 * Class \Hoa\Praspel\Exception\Model.
 *
 * Extending the \Hoa\Praspel\Exception\Generic class.
 *
 * @copyright  Copyright © 2007-2015 Hoa community
 * @license    New BSD License
 */
class Model extends Generic
{
}


text:
<?php

namespace Google\AdsApi\AdManager\v202202;

/**
 * This file was generated from WSDL. DO NOT EDIT.
 */
class updateCreativeSetResponse
{

    /**
     * @var \Google\AdsApi\AdManager\v202202\CreativeSet $rval
     */
    protected $rval = null;

    /**
     * @param \Google\AdsApi\AdManager\v202202\CreativeSet $rval
     */
    public function __construct($rval = null)
    {
      $this->rval = $rval;
    }

    /**
     * @return \Google\AdsApi\AdManager\v202202\CreativeSet
     */
    public function getRval()
    {
      return $this->rval;
    }

    /**
     * @param \Google\AdsApi\AdManager\v202202\CreativeSet $rval
     * @return \Google\AdsApi\AdManager\v202202\updateCreativeSetResponse
     */
    public function setRval($rval)
    {
      $this->rval = $rval;
      return $this;
    }

}


text:
define("dojox/form/nls/eu/PasswordValidator", {
//begin v1.x content
        nomatchMessage: "Pasahitzak ez datoz bat.",
	badPasswordMessage: "Pasahitz baliogabea."
//end v1.x content
});


text:
using System;
using UnityEditor;
using UnityEngine;

namespace JustLogic.Editor.JLGUI.Drawers
{
    [ParameterDrawer(typeof(Bounds))]
    public class BoundsDrawer : ParameterDrawerBase
    {
        public override bool Initialize(DrawerInitArgs args, object value, IDrawContext context)
        {
            Layout = ParameterDrawerLayout.VerticalRoot;
            return base.Initialize(args, value, context);
        }

        protected override bool OnDraw(IDrawContext context, bool isNewAreaStarted)
        {
            var value = (Bounds)Value;
            context.BeginLook(true);
            try
            {
                object newValue = EditorGUILayout.BoundsField(value);
                if (!newValue.Equals(value))
                {
                    Value = newValue;
                    return true;
                }
                return false;
            }
            finally { context.EndLook(); }

        }
    }
}


text:
<?php

namespace Puli\Manager\Api\Installation;

use Puli\Manager\Api\Asset\AssetMapping;
use Puli\Manager\Api\Installer\InstallerDescriptor;
use Puli\Manager\Api\Installer\ResourceInstaller;
use Puli\Manager\Api\Installer\Validation\ConstraintViolation;
use Puli\Manager\Api\Installer\Validation\InstallerParameterValidator;
use Puli\Manager\Api\Server\Server;
use Puli\Repository\Api\Resource\Resource;
use Puli\Repository\Api\ResourceCollection;
use Webmozart\Glob\Glob;
use Webmozart\PathUtil\Path;

/**
 * Contains all the necessary information to install resources on a server.
 *
 * @since  1.0
 *
 * @author Bernhard Schussek <bschussek@gmail.com>
 */
class InstallationParams
{
    /**
     * @var ResourceInstaller
     */
    private $installer;

    /**
     * @var InstallerDescriptor
     */
    private $installerDescriptor;

    /**
     * @var Resource
     */
    private $resources;

    /**
     * @var AssetMapping
     */
    private $mapping;

    /**
     * @var Server
     */
    private $server;

    /**
     * @var string
     */
    private $rootDir;

    /**
     * @var array
     */
    private $parameterValues;

    /**
     * Creates the installation request.
     *
     * @param ResourceInstaller   $installer           The used resource installer.
     * @param InstallerDescriptor $installerDescriptor The descriptor of the
     *                                                 resource installer.
     * @param ResourceCollection  $resources           The resources to install.
     * @param AssetMapping        $mapping             The asset mapping.
     * @param Server              $server              The asset server.
     * @param string              $rootDir             The project's root directory.
     */
    public function __construct(ResourceInstaller $installer, InstallerDescriptor $installerDescriptor, ResourceCollection $resources, AssetMapping $mapping, Server $server, $rootDir)
    {
        $glob = $mapping->getGlob();
        $parameterValues = $server->getParameterValues();

        $this->validateParameterValues($parameterValues, $installerDescriptor);

        $this->installer = $installer;
        $this->installerDescriptor = $installerDescriptor;
        $this->resources = $resources;
        $this->mapping = $mapping;
        $this->server = $server;
        $this->rootDir = $rootDir;
        $this->basePath = Glob::isDynamic($glob) ? Glob::getBasePath($glob) : $glob;
        $this->parameterValues = array_replace(
            $installerDescriptor->getParameterValues(),
            $parameterValues
        );
    }

    /**
     * Returns the used resource installer.
     *
     * @return ResourceInstaller The installer used to install the resources in
     *                           the server's document root.
     */
    public function getInstaller()
    {
        return $this->installer;
    }

    /**
     * Returns the descriptor of the installer.
     *
     * @return InstallerDescriptor The descriptor of the installer.
     */
    public function getInstallerDescriptor()
    {
        return $this->installerDescriptor;
    }

    /**
     * Returns the installed resources.
     *
     * @return ResourceCollection The installed resources.
     */
    public function getResources()
    {
        return $this->resources;
    }

    /**
     * Returns the asset mapping.
     *
     * @return AssetMapping The asset mapping.
     */
    public function getMapping()
    {
        return $this->mapping;
    }

    /**
     * Returns the root directory of the Puli project.
     *
     * @return string The project's root directory.
     */
    public function getRootDirectory()
    {
        return $this->rootDir;
    }

    /**
     * Returns the common base path of the installed resources.
     *
     * @return string The common base path of the installed resources.
     */
    public function getBasePath()
    {
        return $this->basePath;
    }

    /**
     * Returns the target server.
     *
     * @return Server The target server.
     */
    public function getServer()
    {
        return $this->server;
    }

    /**
     * Returns the document root of the server.
     *
     * This can be a directory name, a URL or any other string that can be
     * interpreted by the installer.
     *
     * @return string The document root.
     */
    public function getDocumentRoot()
    {
        return $this->server->getDocumentRoot();
    }

    /**
     * Returns the path where the resources are going to be installed.
     *
     * This is a path relative to the document root of the target server.
     *
     * @return string The server path.
     */
    public function getServerPath()
    {
        return $this->mapping->getServerPath();
    }

    /**
     * Returns the path where a resource is going to be installed.
     *
     * This is a path relative to the document root of the target server.
     *
     * @param Resource $resource The resource.
     *
     * @return string The server path.
     */
    public function getServerPathForResource(Resource $resource)
    {
        $relPath = Path::makeRelative($resource->getRepositoryPath(), $this->basePath);

        return '/'.trim($this->mapping->getServerPath().'/'.$relPath, '/');
    }

    /**
     * Returns the installer parameters.
     *
     * The result is a merge of the default parameter values of the installer
     * and the parameter values set for the server.
     *
     * @return array The installer parameters.
     */
    public function getParameterValues()
    {
        return $this->parameterValues;
    }

    private function validateParameterValues(array $parameterValues, InstallerDescriptor $installerDescriptor)
    {
        $validator = new InstallerParameterValidator();
        $violations = $validator->validate($parameterValues, $installerDescriptor);

        foreach ($violations as $violation) {
            switch ($violation->getCode()) {
                case ConstraintViolation::MISSING_PARAMETER:
                    throw NotInstallableException::missingParameter(
                        $violation->getParameterName(),
                        $violation->getInstallerName()
                    );
                case ConstraintViolation::NO_SUCH_PARAMETER:
                    throw NotInstallableException::noSuchParameter(
                        $violation->getParameterName(),
                        $violation->getInstallerName()
                    );
            }
        }
    }
}


text:
layout: post
title: New Home!
date: 2015-07-27
categories: [General, News]
tags: [blog, site]
description: By João Vitor Rebouças
author:
  name: João Vitor Rebouças
  twitter: jvitor03
published: true
fullview: false
---

Hey folks! I'm Just posting here to annouce our new blog.
After a long time we finaly moved our site from wordpress.com to sheetcoldgames.me.
Our new home is hosted on github(yes, open source) and is jekyll powered. This layout is not final, we still have some changes to do.

And this is it.

Btw, this is my first post here. I will try to post more often (and that's a lie).


text:
using UnityEngine;
using System;
using LuaInterface;
using SLua;
using System.Collections.Generic;
public class Lua_UnityEngine_Security : LuaObject {
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.Security o;
			o=new UnityEngine.Security();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int PrefetchSocketPolicy_s(IntPtr l) {
		try {
			int argc = LuaDLL.lua_gettop(l);
			if(argc==2){
				System.String a1;
				checkType(l,1,out a1);
				System.Int32 a2;
				checkType(l,2,out a2);
				var ret=UnityEngine.Security.PrefetchSocketPolicy(a1,a2);
				pushValue(l,true);
				pushValue(l,ret);
				return 2;
			}
			else if(argc==3){
				System.String a1;
				checkType(l,1,out a1);
				System.Int32 a2;
				checkType(l,2,out a2);
				System.Int32 a3;
				checkType(l,3,out a3);
				var ret=UnityEngine.Security.PrefetchSocketPolicy(a1,a2,a3);
				pushValue(l,true);
				pushValue(l,ret);
				return 2;
			}
			pushValue(l,false);
			LuaDLL.lua_pushstring(l,"No matched override function to call");
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
	static public int LoadAndVerifyAssembly_s(IntPtr l) {
		try {
			int argc = LuaDLL.lua_gettop(l);
			if(argc==1){
				System.Byte[] a1;
				checkArray(l,1,out a1);
				var ret=UnityEngine.Security.LoadAndVerifyAssembly(a1);
				pushValue(l,true);
				pushValue(l,ret);
				return 2;
			}
			else if(argc==2){
				System.Byte[] a1;
				checkArray(l,1,out a1);
				System.String a2;
				checkType(l,2,out a2);
				var ret=UnityEngine.Security.LoadAndVerifyAssembly(a1,a2);
				pushValue(l,true);
				pushValue(l,ret);
				return 2;
			}
			pushValue(l,false);
			LuaDLL.lua_pushstring(l,"No matched override function to call");
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
	static public void reg(IntPtr l) {
		getTypeTable(l,"UnityEngine.Security");
		addMember(l,PrefetchSocketPolicy_s);
		addMember(l,LoadAndVerifyAssembly_s);
		createTypeMetatable(l,constructor, typeof(UnityEngine.Security));
	}
}


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 br.edu.ifrn.pdscfyp.Controller;

import br.edu.ifrn.pdscfyp.Model.Usuario;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 *
 * @author mateus
 */
@Controller
public class MainController {

    @RequestMapping("/index")
    public String index(HttpSession session, Model model) {

        Usuario u = (Usuario) session.getAttribute("usuarioLogado");

        model.addAttribute("usuarioLogado", u);
        model.addAttribute("sessao", session);

        if (session.getAttribute("jaPassou") != null && (boolean) session.getAttribute("jaPassou") == true) {
            String a = (String) session.getAttribute("falhaLogin");
            model.addAttribute("dadosInvalidos", a);
            session.setAttribute("jaPassou", false);
        } else {
            session.setAttribute("jaPassou", false);
        }

        return "index";
    }

    @RequestMapping("/")
    public String indexDois(HttpSession session, Model model) {
        return "redirect:index";
    }

    @RequestMapping("/logout")
    public String logout(HttpSession session) {

        session.setAttribute("usuarioLogado", null);

        return "redirect:index";
    }

    @RequestMapping(value = "/logon", method = RequestMethod.POST)
    public String logon(HttpSession session, @RequestParam("login") String login, @RequestParam("senha") String senha) {

        Usuario u = Usuario.login(login, senha);
        session.setAttribute("usuarioLogado", u);

        if (u != null) {
            return "redirect:mapa";
        } else {
            session.setAttribute("jaPassou", true);
            session.setAttribute("falhaLogin", "algumacoisa");
            return "redirect:index";
        }
    }

}


text:
class Spree::TimingsController < ApplicationController
  def index
    date = Date.new(Date.today.year,params[:month].to_i,params[:day].to_i)

    @slots = Spree::TimeSlot.all_for_doctor(params[:doctor_employee_id], date: date)

    respond_to do |format|
      format.js {}
    end
  end
end


text:
require 'test_helper'

class LayerTest < ActiveSupport::TestCase
  # test "the truth" do
  #   assert true
  # end
end


text:
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)

require "rake"
require 'elasticsearch/extensions/test/cluster/tasks'
require 'elasticsearch/provider'

RSpec.configure do |config|
  config.before :each, :elasticsearch do
    unless Elasticsearch::Extensions::Test::Cluster.running?
      Elasticsearch::Extensions::Test::Cluster.start \
        port: 9250,
        nodes: 1
      Elasticsearch::Provider.client = Elasticsearch::Client.new \
        url: 'localhost:9250',
        log: 'true'
    end
  end

  config.before :each, :elasticsearch_child do
    unless Elasticsearch::Extensions::Test::Cluster.running?
      Elasticsearch::Extensions::Test::Cluster.start \
        port: 9250,
        nodes: 1
      Elasticsearch::Provider.client = Elasticsearch::Client.new \
        url: 'localhost:9250',
        log: 'true'
    end

    client = Elasticsearch::Provider.client
    client.indices.delete index: 'test' if client.indices.exists index: 'test'
    client.indices.create index: 'test', body: {}

    client.indices.put_mapping index: 'test', type: 'prop', body: {
      prop: {
        _parent: {
          type: "doc"
        },
        properties: {
          id: {
            type: "string"
          },
          present: {
            type: "boolean"
          },
          ranked: {
            type: "nested",
            properties: {
              content: {
                type: "string",
                index: "not_analyzed"
              },
              rank: {
                type: "float"
              }
            }
          }
        }
      }
    },
    ignore_conflicts: true

    client.indices.put_mapping index: 'test', type: 'doc', body: {
      doc: {
        properties: {
          id: {
            type: "string"
          }
        }
      }
    },
    ignore_conflicts: true
  end

  config.after :suite do
   if Elasticsearch::Extensions::Test::Cluster.running?
     Elasticsearch::Extensions::Test::Cluster.stop(port: 9250)
   end
  end
end


text:
using std::map;
using std::string;

namespace xsettingsd {

// Test the basic operation of CharStream.
TEST(CharStreamTest, Basic) {
  ConfigParser::StringCharStream stream("012");

  // We should die if we try to do anything before calling Init().
  ASSERT_DEATH(stream.AtEOF(), "initialized");
  ASSERT_DEATH(stream.GetChar(), "initialized");
  ASSERT_DEATH(stream.UngetChar('0'), "initialized");

  // Now read a character, put it back, and read it again.
  ASSERT_TRUE(stream.Init(NULL));
  EXPECT_FALSE(stream.AtEOF());
  EXPECT_EQ('0', stream.GetChar());
  stream.UngetChar('0');
  EXPECT_EQ('0', stream.GetChar());

  // Do the same thing with the second character...
  EXPECT_FALSE(stream.AtEOF());
  EXPECT_EQ('1', stream.GetChar());
  stream.UngetChar('1');
  EXPECT_EQ('1', stream.GetChar());

  // ... and with the third.  We should be at EOF after reading it.
  EXPECT_EQ('2', stream.GetChar());
  EXPECT_TRUE(stream.AtEOF());
  stream.UngetChar('2');
  EXPECT_FALSE(stream.AtEOF());
  EXPECT_EQ('2', stream.GetChar());
  EXPECT_TRUE(stream.AtEOF());
}

// Test that line numbers are reported correctly as we get and un-get
// characters.
TEST(CharStreamTest, LineNumbers) {
  ConfigParser::StringCharStream stream("a\nb\n\nc");

  // We use line 0 to represent not having read any characters yet.
  ASSERT_TRUE(stream.Init(NULL));
  EXPECT_EQ(0, stream.line_num());

  // Getting the first 'a' should put us on line 1.  We move back to 0 when
  // we un-get it and back to 1 when we re-get it.
  EXPECT_EQ('a', stream.GetChar());
  EXPECT_EQ(1, stream.line_num());
  stream.UngetChar('a');
  EXPECT_EQ(0, stream.line_num());
  EXPECT_EQ('a', stream.GetChar());
  EXPECT_EQ(1, stream.line_num());

  // The first newline should show up as being on line 1 as well.
  EXPECT_EQ('\n', stream.GetChar());
  EXPECT_EQ(1, stream.line_num());
  stream.UngetChar('\n');
  EXPECT_EQ(1, stream.line_num());
  EXPECT_EQ('\n', stream.GetChar());
  EXPECT_EQ(1, stream.line_num());

  // The 'b' is on line 2...
  EXPECT_EQ('b', stream.GetChar());
  EXPECT_EQ(2, stream.line_num());
  stream.UngetChar('b');
  EXPECT_EQ(1, stream.line_num());
  EXPECT_EQ('b', stream.GetChar());
  EXPECT_EQ(2, stream.line_num());

  // ... as is the first newline after it.
  EXPECT_EQ('\n', stream.GetChar());
  EXPECT_EQ(2, stream.line_num());
  stream.UngetChar('\n');
  EXPECT_EQ(2, stream.line_num());
  EXPECT_EQ('\n', stream.GetChar());
  EXPECT_EQ(2, stream.line_num());

  // The second newline should show up as being on line 3.
  EXPECT_EQ('\n', stream.GetChar());
  EXPECT_EQ(3, stream.line_num());
  stream.UngetChar('\n');
  EXPECT_EQ(2, stream.line_num());
  EXPECT_EQ('\n', stream.GetChar());
  EXPECT_EQ(3, stream.line_num());

  // And the 'c' is on line 4.
  EXPECT_EQ('c', stream.GetChar());
  EXPECT_EQ(4, stream.line_num());
  stream.UngetChar('c');
  EXPECT_EQ(3, stream.line_num());
  EXPECT_EQ('c', stream.GetChar());
  EXPECT_EQ(4, stream.line_num());

  EXPECT_TRUE(stream.AtEOF());
}

class ConfigParserTest : public testing::Test {
 protected:
  // Helper methods to get the return value or string from
  // ConfigParser::ReadSettingName().
  bool GetReadSettingNameResult(const string& input) {
    bool result;
    RunReadSettingName(input, &result, NULL);
    return result;
  }
  string GetReadSettingNameData(const string& input) {
    bool result;
    string data;
    RunReadSettingName(input, &result, &data);
    assert(result);
    return data;
  }

  bool GetReadIntegerResult(const string& input) {
    bool result;
    RunReadInteger(input, &result, NULL);
    return result;
  }
  int32_t GetReadIntegerData(const string& input) {
    bool result;
    int32_t data;
    RunReadInteger(input, &result, &data);
    assert(result);
    return data;
  }

  bool GetReadStringResult(const string& input) {
    bool result;
    RunReadString(input, &result, NULL);
    return result;
  }
  string GetReadStringData(const string& input) {
    bool result;
    string data;
    RunReadString(input, &result, &data);
    assert(result);
    return data;
  }

  bool GetReadColorResult(const string& input) {
    bool result;
    RunReadColor(input, &result, NULL);
    return result;
  }
  string GetReadColorData(const string& input) {
    bool result;
    string data;
    RunReadColor(input, &result, &data);
    assert(result);
    return data;
  }

 private:
  void RunReadSettingName(const string& input,
                          bool* result_out,
                          string* name_out) {
    ConfigParser::CharStream* stream =
        new ConfigParser::StringCharStream(input);
    assert(stream->Init(NULL));
    ConfigParser parser(stream);
    string name;
    bool result = parser.ReadSettingName(&name);
    if (result_out)
      *result_out = result;
    if (name_out)
      *name_out = name;
  }

  void RunReadInteger(const string& input,
                      bool* result_out,
                      int32_t* num_out) {
    ConfigParser::CharStream* stream =
        new ConfigParser::StringCharStream(input);
    assert(stream->Init(NULL));
    ConfigParser parser(stream);
    int32_t num = 0;
    bool result = parser.ReadInteger(&num);
    if (result_out)
      *result_out = result;
    if (num_out)
      *num_out = num;
  }

  void RunReadString(const string& input,
                     bool* result_out,
                     string* str_out) {
    ConfigParser::CharStream* stream =
        new ConfigParser::StringCharStream(input);
    assert(stream->Init(NULL));
    ConfigParser parser(stream);
    string str;
    bool result = parser.ReadString(&str);
    if (result_out)
      *result_out = result;
    if (str_out)
      *str_out = str;
  }

  void RunReadColor(const string& input,
                    bool* result_out,
                    string* str_out) {
    ConfigParser::CharStream* stream =
        new ConfigParser::StringCharStream(input);
    assert(stream->Init(NULL));
    ConfigParser parser(stream);
    uint16_t red = 0, green = 0, blue = 0, alpha = 0;
    bool result = parser.ReadColor(&red, &green, &blue, &alpha);
    if (result_out)
      *result_out = result;
    if (str_out)
      *str_out = StringPrintf("(%d,%d,%d,%d)", red, green, blue, alpha);
  }
};

TEST_F(ConfigParserTest, ReadSettingName) {
  EXPECT_EQ("test",           GetReadSettingNameData("test"));
  EXPECT_EQ("First/Second",   GetReadSettingNameData("First/Second"));
  EXPECT_EQ("Has_Underscore", GetReadSettingNameData("Has_Underscore"));
  EXPECT_EQ("trailing_space", GetReadSettingNameData("trailing_space  "));
  EXPECT_EQ("blah",           GetReadSettingNameData("blah#comment"));
  EXPECT_FALSE(GetReadSettingNameResult(" leading_space"));
  EXPECT_FALSE(GetReadSettingNameResult("/leading_slash"));
  EXPECT_FALSE(GetReadSettingNameResult("trailing_slash/"));
  EXPECT_FALSE(GetReadSettingNameResult("double//slash"));
  EXPECT_FALSE(GetReadSettingNameResult("digit_after_slash/0"));

  // For good measure, test the examples of legitimate and illegitimate
  // names from the spec.
  EXPECT_EQ("GTK/colors/background0",
            GetReadSettingNameData("GTK/colors/background0"));
  EXPECT_EQ("_background", GetReadSettingNameData("_background"));
  EXPECT_EQ("_111",        GetReadSettingNameData("_111"));
  EXPECT_FALSE(GetReadSettingNameResult("/"));
  EXPECT_FALSE(GetReadSettingNameResult("_background/"));
  EXPECT_FALSE(GetReadSettingNameResult("GTK//colors"));
  EXPECT_FALSE(GetReadSettingNameResult(""));
}

TEST_F(ConfigParserTest, ReadInteger) {
  EXPECT_EQ(0,         GetReadIntegerData("0"));
  EXPECT_EQ(10,        GetReadIntegerData("10"));
  EXPECT_EQ(12,        GetReadIntegerData("0012"));
  EXPECT_EQ(15,        GetReadIntegerData("15#2 comment"));
  EXPECT_EQ(20,        GetReadIntegerData("20   "));
  EXPECT_EQ(30,        GetReadIntegerData("30\n"));
  EXPECT_EQ(INT32_MAX, GetReadIntegerData("2147483647"));
  EXPECT_EQ(-5,        GetReadIntegerData("-5"));
  EXPECT_EQ(INT32_MIN, GetReadIntegerData("-2147483648"));
  EXPECT_FALSE(GetReadIntegerResult(""));
  EXPECT_FALSE(GetReadIntegerResult("-"));
  EXPECT_FALSE(GetReadIntegerResult("--2"));
  EXPECT_FALSE(GetReadIntegerResult("2-3"));
  EXPECT_FALSE(GetReadIntegerResult(" "));
  EXPECT_FALSE(GetReadIntegerResult(" 23"));
}

TEST_F(ConfigParserTest, ReadString) {
  EXPECT_EQ("test",              GetReadStringData("\"test\""));
  EXPECT_EQ(" some whitespace ", GetReadStringData("\" some whitespace \""));
  EXPECT_EQ("a\tb\nc",           GetReadStringData("\"a\\tb\\nc\""));
  EXPECT_EQ("a\"b\\c",           GetReadStringData("\"a\\\"b\\\\c\""));
  EXPECT_EQ("ar",                GetReadStringData("\"\\a\\r\""));
  EXPECT_EQ(" ",                 GetReadStringData("\" \""));
  EXPECT_EQ("",                  GetReadStringData("\"\""));
  EXPECT_EQ("a",                 GetReadStringData("\"a\"   "));
  EXPECT_FALSE(GetReadStringResult(""));
  EXPECT_FALSE(GetReadStringResult("a"));
  EXPECT_FALSE(GetReadStringResult("\""));
  EXPECT_FALSE(GetReadStringResult("\"\n\""));
}

TEST_F(ConfigParserTest, ReadColor) {
  EXPECT_EQ("(1,2,3,4)", GetReadColorData("(1,2,3,4)"));
  EXPECT_EQ("(1,2,3,65535)", GetReadColorData("(1,2,3)"));
  EXPECT_EQ("(32768,32769,32770,32771)",
            GetReadColorData("(  32768 ,32769  , 32770, 32771  )"));
  EXPECT_FALSE(GetReadColorResult(""));
  EXPECT_FALSE(GetReadColorResult("("));
  EXPECT_FALSE(GetReadColorResult(")"));
  EXPECT_FALSE(GetReadColorResult("()"));
  EXPECT_FALSE(GetReadColorResult("( )"));
  EXPECT_FALSE(GetReadColorResult("(2)"));
  EXPECT_FALSE(GetReadColorResult("(,2)"));
  EXPECT_FALSE(GetReadColorResult("(2,)"));
  EXPECT_FALSE(GetReadColorResult("(2,3)"));
  EXPECT_FALSE(GetReadColorResult("(2,3,4,)"));
  EXPECT_FALSE(GetReadColorResult("(2,3,,4)"));
  EXPECT_FALSE(GetReadColorResult("(2,3,4,5,)"));
  EXPECT_FALSE(GetReadColorResult("(2(,3,4,5)"));
  EXPECT_FALSE(GetReadColorResult("(2,3,4,5,6)"));
  EXPECT_FALSE(GetReadColorResult("(2a,3,4,5)"));
  EXPECT_FALSE(GetReadColorResult("(2 1,3,4,5)"));
  EXPECT_FALSE(GetReadColorResult("(2,3,4,5"));
  EXPECT_FALSE(GetReadColorResult("(2,3\n,4,5)"));
}

testing::AssertionResult IntegerSettingEquals(
    const char* expected_expr,
    const char* actual_expr,
    int32_t expected,
    const Setting* actual) {
  if (!actual) {
    testing::Message msg;
    msg << "Expected: " << expected << "\n"
        << "  Actual: " << actual_expr << " is NULL";
    return testing::AssertionFailure(msg);
  }

  const IntegerSetting *setting = dynamic_cast<const IntegerSetting*>(actual);
  if (!setting) {
    testing::Message msg;
    msg << "Expected: " << expected << "\n"
        << "  Actual: " << actual_expr << " (not an IntegerSetting)";
    return testing::AssertionFailure(msg);
  }

  if (setting->value() != expected) {
    testing::Message msg;
    msg << "Expected: " << expected << "\n"
        << "  Actual: " << actual_expr << " contains " << setting->value();
    return testing::AssertionFailure(msg);
  }

  return testing::AssertionSuccess();
}

testing::AssertionResult StringSettingEquals(
    const char* expected_expr,
    const char* actual_expr,
    const string& expected,
    const Setting* actual) {
  if (!actual) {
    testing::Message msg;
    msg << "Expected: " << expected << "\n"
        << "  Actual: " << actual_expr << " is NULL";
    return testing::AssertionFailure(msg);
  }

  const StringSetting *setting = dynamic_cast<const StringSetting*>(actual);
  if (!setting) {
    testing::Message msg;
    msg << "Expected: " << expected << "\n"
        << "  Actual: " << actual_expr << " (not a StringSetting)";
    return testing::AssertionFailure(msg);
  }

  if (setting->value() != expected) {
    testing::Message msg;
    msg << "Expected: \"" << expected << "\"\n"
        << "  Actual: " << actual_expr << " contains \""
        << setting->value() << "\"";
    return testing::AssertionFailure(msg);
  }

  return testing::AssertionSuccess();
}

testing::AssertionResult ColorSettingEquals(
    const char* expected_expr,
    const char* actual_expr,
    const string& expected_str,
    const Setting* actual) {
  if (!actual) {
    testing::Message msg;
    msg << "Expected: " << expected_str << "\n"
        << "  Actual: " << actual_expr << " is NULL";
    return testing::AssertionFailure(msg);
  }

  const ColorSetting *setting = dynamic_cast<const ColorSetting*>(actual);
  if (!setting) {
    testing::Message msg;
    msg << "Expected: " << expected_str << "\n"
        << "  Actual: " << actual_expr << " (not a ColorSetting)";
    return testing::AssertionFailure(msg);
  }

  string actual_str = StringPrintf("(%d,%d,%d,%d)",
                                   setting->red(), setting->green(),
                                   setting->blue(), setting->alpha());
  if (actual_str != expected_str) {
    testing::Message msg;
    msg << "Expected: \"" << expected_str << "\"\n"
        << "  Actual: " << actual_expr << " contains \""
        << actual_str << "\"";
    return testing::AssertionFailure(msg);
  }

  return testing::AssertionSuccess();
}

TEST_F(ConfigParserTest, Parse) {
  const char* good_input =
      "Setting1  5\n"
      "Setting2 \"this is a string\"\n"
      "# commented line\n"
      "\n"
      "Setting3 2  # trailing comment\n"
      "Setting4 \"\\\"quoted\\\"\"# comment\n"
      "Setting5 (45,21, 5 , 8)# color";
  ConfigParser parser(new ConfigParser::StringCharStream(good_input));
  SettingsMap settings;
  ASSERT_TRUE(parser.Parse(&settings, NULL, 0));
  ASSERT_EQ(5, settings.map().size());
  EXPECT_PRED_FORMAT2(IntegerSettingEquals, 5, settings.GetSetting("Setting1"));
  EXPECT_PRED_FORMAT2(StringSettingEquals,
                      "this is a string",
                      settings.GetSetting("Setting2"));
  EXPECT_PRED_FORMAT2(IntegerSettingEquals, 2, settings.GetSetting("Setting3"));
  EXPECT_PRED_FORMAT2(StringSettingEquals,
                      "\"quoted\"",
                      settings.GetSetting("Setting4"));
  EXPECT_PRED_FORMAT2(ColorSettingEquals,
                      "(45,21,5,8)",
                      settings.GetSetting("Setting5"));

  const char* extra_name = "SettingName 3 blah";
  parser.Reset(new ConfigParser::StringCharStream(extra_name));
  EXPECT_FALSE(parser.Parse(&settings, NULL, 0));

  const char* missing_value = "SettingName";
  parser.Reset(new ConfigParser::StringCharStream(missing_value));
  EXPECT_FALSE(parser.Parse(&settings, NULL, 0));

  const char* comment_instead_of_value = "SettingName # test 3\n";
  parser.Reset(new ConfigParser::StringCharStream(comment_instead_of_value));
  EXPECT_FALSE(parser.Parse(&settings, NULL, 0));

  const char* duplicate_name = "SettingName 4\nSettingName 3";
  parser.Reset(new ConfigParser::StringCharStream(duplicate_name));
  EXPECT_FALSE(parser.Parse(&settings, NULL, 0));
}

}  // namespace xsettingsd

int main(int argc, char** argv) {
  testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();
}


text:
#pragma once
#include <aws/kendra/Kendra_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/kendra/model/ServiceNowBuildVersionType.h>
#include <aws/kendra/model/ServiceNowKnowledgeArticleConfiguration.h>
#include <aws/kendra/model/ServiceNowServiceCatalogConfiguration.h>
#include <aws/kendra/model/ServiceNowAuthenticationType.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace kendra
{
namespace Model
{

  /**
   *
Provides the configuration information to connect to ServiceNow as your data
   * source.

See Also:
   AWS
   * API Reference

   */
  class AWS_KENDRA_API ServiceNowConfiguration
  {
  public:
    ServiceNowConfiguration();
    ServiceNowConfiguration(Aws::Utils::Json::JsonView jsonValue);
    ServiceNowConfiguration& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The ServiceNow instance that the data source connects to. The host endpoint
     * should look like the following: {instance}.service-now.com.

     */
    inline const Aws::String& GetHostUrl() const{ return m_hostUrl; }

    /**
     *
The ServiceNow instance that the data source connects to. The host endpoint
     * should look like the following: {instance}.service-now.com.

     */
    inline bool HostUrlHasBeenSet() const { return m_hostUrlHasBeenSet; }

    /**
     *
The ServiceNow instance that the data source connects to. The host endpoint
     * should look like the following: {instance}.service-now.com.

     */
    inline void SetHostUrl(const Aws::String& value) { m_hostUrlHasBeenSet = true; m_hostUrl = value; }

    /**
     *
The ServiceNow instance that the data source connects to. The host endpoint
     * should look like the following: {instance}.service-now.com.

     */
    inline void SetHostUrl(Aws::String&& value) { m_hostUrlHasBeenSet = true; m_hostUrl = std::move(value); }

    /**
     *
The ServiceNow instance that the data source connects to. The host endpoint
     * should look like the following: {instance}.service-now.com.

     */
    inline void SetHostUrl(const char* value) { m_hostUrlHasBeenSet = true; m_hostUrl.assign(value); }

    /**
     *
The ServiceNow instance that the data source connects to. The host endpoint
     * should look like the following: {instance}.service-now.com.

     */
    inline ServiceNowConfiguration& WithHostUrl(const Aws::String& value) { SetHostUrl(value); return *this;}

    /**
     *
The ServiceNow instance that the data source connects to. The host endpoint
     * should look like the following: {instance}.service-now.com.

     */
    inline ServiceNowConfiguration& WithHostUrl(Aws::String&& value) { SetHostUrl(std::move(value)); return *this;}

    /**
     *
The ServiceNow instance that the data source connects to. The host endpoint
     * should look like the following: {instance}.service-now.com.

     */
    inline ServiceNowConfiguration& WithHostUrl(const char* value) { SetHostUrl(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the Secrets Manager secret that contains
     * the user name and password required to connect to the ServiceNow instance.

     */
    inline const Aws::String& GetSecretArn() const{ return m_secretArn; }

    /**
     *
The Amazon Resource Name (ARN) of the Secrets Manager secret that contains
     * the user name and password required to connect to the ServiceNow instance.

     */
    inline bool SecretArnHasBeenSet() const { return m_secretArnHasBeenSet; }

    /**
     *
The Amazon Resource Name (ARN) of the Secrets Manager secret that contains
     * the user name and password required to connect to the ServiceNow instance.

     */
    inline void SetSecretArn(const Aws::String& value) { m_secretArnHasBeenSet = true; m_secretArn = value; }

    /**
     *
The Amazon Resource Name (ARN) of the Secrets Manager secret that contains
     * the user name and password required to connect to the ServiceNow instance.

     */
    inline void SetSecretArn(Aws::String&& value) { m_secretArnHasBeenSet = true; m_secretArn = std::move(value); }

    /**
     *
The Amazon Resource Name (ARN) of the Secrets Manager secret that contains
     * the user name and password required to connect to the ServiceNow instance.

     */
    inline void SetSecretArn(const char* value) { m_secretArnHasBeenSet = true; m_secretArn.assign(value); }

    /**
     *
The Amazon Resource Name (ARN) of the Secrets Manager secret that contains
     * the user name and password required to connect to the ServiceNow instance.

     */
    inline ServiceNowConfiguration& WithSecretArn(const Aws::String& value) { SetSecretArn(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the Secrets Manager secret that contains
     * the user name and password required to connect to the ServiceNow instance.

     */
    inline ServiceNowConfiguration& WithSecretArn(Aws::String&& value) { SetSecretArn(std::move(value)); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the Secrets Manager secret that contains
     * the user name and password required to connect to the ServiceNow instance.

     */
    inline ServiceNowConfiguration& WithSecretArn(const char* value) { SetSecretArn(value); return *this;}

    /**
     *
The identifier of the release that the ServiceNow host is running. If the
     * host is not running the LONDON release, use
     * OTHERS.

     */
    inline const ServiceNowBuildVersionType& GetServiceNowBuildVersion() const{ return m_serviceNowBuildVersion; }

    /**
     *
The identifier of the release that the ServiceNow host is running. If the
     * host is not running the LONDON release, use
     * OTHERS.

     */
    inline bool ServiceNowBuildVersionHasBeenSet() const { return m_serviceNowBuildVersionHasBeenSet; }

    /**
     *
The identifier of the release that the ServiceNow host is running. If the
     * host is not running the LONDON release, use
     * OTHERS.

     */
    inline void SetServiceNowBuildVersion(const ServiceNowBuildVersionType& value) { m_serviceNowBuildVersionHasBeenSet = true; m_serviceNowBuildVersion = value; }

    /**
     *
The identifier of the release that the ServiceNow host is running. If the
     * host is not running the LONDON release, use
     * OTHERS.

     */
    inline void SetServiceNowBuildVersion(ServiceNowBuildVersionType&& value) { m_serviceNowBuildVersionHasBeenSet = true; m_serviceNowBuildVersion = std::move(value); }

    /**
     *
The identifier of the release that the ServiceNow host is running. If the
     * host is not running the LONDON release, use
     * OTHERS.

     */
    inline ServiceNowConfiguration& WithServiceNowBuildVersion(const ServiceNowBuildVersionType& value) { SetServiceNowBuildVersion(value); return *this;}

    /**
     *
The identifier of the release that the ServiceNow host is running. If the
     * host is not running the LONDON release, use
     * OTHERS.

     */
    inline ServiceNowConfiguration& WithServiceNowBuildVersion(ServiceNowBuildVersionType&& value) { SetServiceNowBuildVersion(std::move(value)); return *this;}

    /**
     *
Configuration information for crawling knowledge articles in the ServiceNow
     * site.

     */
    inline const ServiceNowKnowledgeArticleConfiguration& GetKnowledgeArticleConfiguration() const{ return m_knowledgeArticleConfiguration; }

    /**
     *
Configuration information for crawling knowledge articles in the ServiceNow
     * site.

     */
    inline bool KnowledgeArticleConfigurationHasBeenSet() const { return m_knowledgeArticleConfigurationHasBeenSet; }

    /**
     *
Configuration information for crawling knowledge articles in the ServiceNow
     * site.

     */
    inline void SetKnowledgeArticleConfiguration(const ServiceNowKnowledgeArticleConfiguration& value) { m_knowledgeArticleConfigurationHasBeenSet = true; m_knowledgeArticleConfiguration = value; }

    /**
     *
Configuration information for crawling knowledge articles in the ServiceNow
     * site.

     */
    inline void SetKnowledgeArticleConfiguration(ServiceNowKnowledgeArticleConfiguration&& value) { m_knowledgeArticleConfigurationHasBeenSet = true; m_knowledgeArticleConfiguration = std::move(value); }

    /**
     *
Configuration information for crawling knowledge articles in the ServiceNow
     * site.

     */
    inline ServiceNowConfiguration& WithKnowledgeArticleConfiguration(const ServiceNowKnowledgeArticleConfiguration& value) { SetKnowledgeArticleConfiguration(value); return *this;}

    /**
     *
Configuration information for crawling knowledge articles in the ServiceNow
     * site.

     */
    inline ServiceNowConfiguration& WithKnowledgeArticleConfiguration(ServiceNowKnowledgeArticleConfiguration&& value) { SetKnowledgeArticleConfiguration(std::move(value)); return *this;}

    /**
     *
Configuration information for crawling service catalogs in the ServiceNow
     * site.

     */
    inline const ServiceNowServiceCatalogConfiguration& GetServiceCatalogConfiguration() const{ return m_serviceCatalogConfiguration; }

    /**
     *
Configuration information for crawling service catalogs in the ServiceNow
     * site.

     */
    inline bool ServiceCatalogConfigurationHasBeenSet() const { return m_serviceCatalogConfigurationHasBeenSet; }

    /**
     *
Configuration information for crawling service catalogs in the ServiceNow
     * site.

     */
    inline void SetServiceCatalogConfiguration(const ServiceNowServiceCatalogConfiguration& value) { m_serviceCatalogConfigurationHasBeenSet = true; m_serviceCatalogConfiguration = value; }

    /**
     *
Configuration information for crawling service catalogs in the ServiceNow
     * site.

     */
    inline void SetServiceCatalogConfiguration(ServiceNowServiceCatalogConfiguration&& value) { m_serviceCatalogConfigurationHasBeenSet = true; m_serviceCatalogConfiguration = std::move(value); }

    /**
     *
Configuration information for crawling service catalogs in the ServiceNow
     * site.

     */
    inline ServiceNowConfiguration& WithServiceCatalogConfiguration(const ServiceNowServiceCatalogConfiguration& value) { SetServiceCatalogConfiguration(value); return *this;}

    /**
     *
Configuration information for crawling service catalogs in the ServiceNow
     * site.

     */
    inline ServiceNowConfiguration& WithServiceCatalogConfiguration(ServiceNowServiceCatalogConfiguration&& value) { SetServiceCatalogConfiguration(std::move(value)); return *this;}

    /**
     *
The type of authentication used to connect to the ServiceNow instance. If you
     * choose HTTP_BASIC, Amazon Kendra is authenticated using the user
     * name and password provided in the Secrets Manager secret in the
     * SecretArn field. When you choose OAUTH2, Amazon Kendra
     * is authenticated using the OAuth token and secret provided in the Secrets
     * Manager secret, and the user name and password are used to determine which
     * information Amazon Kendra has access to.

When you use OAUTH2
     * authentication, you must generate a token and a client secret using the
     * ServiceNow console. For more information, see Using
     * a ServiceNow data source.

     */
    inline const ServiceNowAuthenticationType& GetAuthenticationType() const{ return m_authenticationType; }

    /**
     *
The type of authentication used to connect to the ServiceNow instance. If you
     * choose HTTP_BASIC, Amazon Kendra is authenticated using the user
     * name and password provided in the Secrets Manager secret in the
     * SecretArn field. When you choose OAUTH2, Amazon Kendra
     * is authenticated using the OAuth token and secret provided in the Secrets
     * Manager secret, and the user name and password are used to determine which
     * information Amazon Kendra has access to.

When you use OAUTH2
     * authentication, you must generate a token and a client secret using the
     * ServiceNow console. For more information, see Using
     * a ServiceNow data source.

     */
    inline bool AuthenticationTypeHasBeenSet() const { return m_authenticationTypeHasBeenSet; }

    /**
     *
The type of authentication used to connect to the ServiceNow instance. If you
     * choose HTTP_BASIC, Amazon Kendra is authenticated using the user
     * name and password provided in the Secrets Manager secret in the
     * SecretArn field. When you choose OAUTH2, Amazon Kendra
     * is authenticated using the OAuth token and secret provided in the Secrets
     * Manager secret, and the user name and password are used to determine which
     * information Amazon Kendra has access to.

When you use OAUTH2
     * authentication, you must generate a token and a client secret using the
     * ServiceNow console. For more information, see Using
     * a ServiceNow data source.

     */
    inline void SetAuthenticationType(const ServiceNowAuthenticationType& value) { m_authenticationTypeHasBeenSet = true; m_authenticationType = value; }

    /**
     *
The type of authentication used to connect to the ServiceNow instance. If you
     * choose HTTP_BASIC, Amazon Kendra is authenticated using the user
     * name and password provided in the Secrets Manager secret in the
     * SecretArn field. When you choose OAUTH2, Amazon Kendra
     * is authenticated using the OAuth token and secret provided in the Secrets
     * Manager secret, and the user name and password are used to determine which
     * information Amazon Kendra has access to.

When you use OAUTH2
     * authentication, you must generate a token and a client secret using the
     * ServiceNow console. For more information, see Using
     * a ServiceNow data source.

     */
    inline void SetAuthenticationType(ServiceNowAuthenticationType&& value) { m_authenticationTypeHasBeenSet = true; m_authenticationType = std::move(value); }

    /**
     *
The type of authentication used to connect to the ServiceNow instance. If you
     * choose HTTP_BASIC, Amazon Kendra is authenticated using the user
     * name and password provided in the Secrets Manager secret in the
     * SecretArn field. When you choose OAUTH2, Amazon Kendra
     * is authenticated using the OAuth token and secret provided in the Secrets
     * Manager secret, and the user name and password are used to determine which
     * information Amazon Kendra has access to.

When you use OAUTH2
     * authentication, you must generate a token and a client secret using the
     * ServiceNow console. For more information, see Using
     * a ServiceNow data source.

     */
    inline ServiceNowConfiguration& WithAuthenticationType(const ServiceNowAuthenticationType& value) { SetAuthenticationType(value); return *this;}

    /**
     *
The type of authentication used to connect to the ServiceNow instance. If you
     * choose HTTP_BASIC, Amazon Kendra is authenticated using the user
     * name and password provided in the Secrets Manager secret in the
     * SecretArn field. When you choose OAUTH2, Amazon Kendra
     * is authenticated using the OAuth token and secret provided in the Secrets
     * Manager secret, and the user name and password are used to determine which
     * information Amazon Kendra has access to.

When you use OAUTH2
     * authentication, you must generate a token and a client secret using the
     * ServiceNow console. For more information, see Using
     * a ServiceNow data source.

     */
    inline ServiceNowConfiguration& WithAuthenticationType(ServiceNowAuthenticationType&& value) { SetAuthenticationType(std::move(value)); return *this;}

  private:

    Aws::String m_hostUrl;
    bool m_hostUrlHasBeenSet;

    Aws::String m_secretArn;
    bool m_secretArnHasBeenSet;

    ServiceNowBuildVersionType m_serviceNowBuildVersion;
    bool m_serviceNowBuildVersionHasBeenSet;

    ServiceNowKnowledgeArticleConfiguration m_knowledgeArticleConfiguration;
    bool m_knowledgeArticleConfigurationHasBeenSet;

    ServiceNowServiceCatalogConfiguration m_serviceCatalogConfiguration;
    bool m_serviceCatalogConfigurationHasBeenSet;

    ServiceNowAuthenticationType m_authenticationType;
    bool m_authenticationTypeHasBeenSet;
  };

} // namespace Model
} // namespace kendra
} // namespace Aws


text:
#ifndef _ASM_X86_IO_H
#define _ASM_X86_IO_H

/*
 * This file contains the definitions for the x86 IO instructions
 * inb/inw/inl/outb/outw/outl and the "string versions" of the same
 * (insb/insw/insl/outsb/outsw/outsl). You can also use "pausing"
 * versions of the single-IO instructions (inb_p/inw_p/..).
 *
 * This file is not meant to be obfuscating: it's just complicated
 * to (a) handle it all in a way that makes gcc able to optimize it
 * as well as possible and (b) trying to avoid writing the same thing
 * over and over again with slight variations and possibly making a
 * mistake somewhere.
 */

/*
 * Thanks to James van Artsdalen for a better timing-fix than
 * the two short jumps: using outb's to a nonexistent port seems
 * to guarantee better timings even on fast machines.
 *
 * On the other hand, I'd like to be sure of a non-existent port:
 * I feel a bit unsafe about using 0x80 (should be safe, though)
 *
 *		Linus
 */

 /*
  *  Bit simplified and optimized by Jan Hubicka
  *  Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999.
  *
  *  isa_memset_io, isa_memcpy_fromio, isa_memcpy_toio added,
  *  isa_read[wl] and isa_write[wl] fixed
  *  - Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  */

#define ARCH_HAS_IOREMAP_WC

#include <linux/string.h>
#include <linux/compiler.h>
#include <asm/page.h>

#define build_mmio_read(name, size, type, reg, barrier) \
static inline type name(const volatile void __iomem *addr) \
{ type ret; asm volatile("mov" size " %1,%0":reg (ret) \
:"m" (*(volatile type __force *)addr) barrier); return ret; }

#define build_mmio_write(name, size, type, reg, barrier) \
static inline void name(type val, volatile void __iomem *addr) \
{ asm volatile("mov" size " %0,%1": :reg (val), \
"m" (*(volatile type __force *)addr) barrier); }

build_mmio_read(readb, "b", unsigned char, "=q", :"memory")
build_mmio_read(readw, "w", unsigned short, "=r", :"memory")
build_mmio_read(readl, "l", unsigned int, "=r", :"memory")

build_mmio_read(__readb, "b", unsigned char, "=q", )
build_mmio_read(__readw, "w", unsigned short, "=r", )
build_mmio_read(__readl, "l", unsigned int, "=r", )

build_mmio_write(writeb, "b", unsigned char, "q", :"memory")
build_mmio_write(writew, "w", unsigned short, "r", :"memory")
build_mmio_write(writel, "l", unsigned int, "r", :"memory")

build_mmio_write(__writeb, "b", unsigned char, "q", )
build_mmio_write(__writew, "w", unsigned short, "r", )
build_mmio_write(__writel, "l", unsigned int, "r", )

#define readb_relaxed(a) __readb(a)
#define readw_relaxed(a) __readw(a)
#define readl_relaxed(a) __readl(a)
#define __raw_readb __readb
#define __raw_readw __readw
#define __raw_readl __readl

#define __raw_writeb __writeb
#define __raw_writew __writew
#define __raw_writel __writel

#define mmiowb() barrier()

#ifdef CONFIG_X86_64

build_mmio_read(readq, "q", unsigned long, "=r", :"memory")
build_mmio_write(writeq, "q", unsigned long, "r", :"memory")

#define readq_relaxed(a)	readq(a)

#define __raw_readq(a)		readq(a)
#define __raw_writeq(val, addr)	writeq(val, addr)

/* Let people know that we have them */
#define readq			readq
#define writeq			writeq

#endif

/**
 *	virt_to_phys	-	map virtual addresses to physical
 *	@address: address to remap
 *
 *	The returned physical address is the physical (CPU) mapping for
 *	the memory address given. It is only valid to use this function on
 *	addresses directly mapped or allocated via kmalloc.
 *
 *	This function does not give bus mappings for DMA transfers. In
 *	almost all conceivable cases a device driver should not be using
 *	this function
 */

static inline phys_addr_t virt_to_phys(volatile void *address)
{
	return __pa(address);
}

/**
 *	phys_to_virt	-	map physical address to virtual
 *	@address: address to remap
 *
 *	The returned virtual address is a current CPU mapping for
 *	the memory address given. It is only valid to use this function on
 *	addresses that have a kernel mapping
 *
 *	This function does not handle bus mappings for DMA transfers. In
 *	almost all conceivable cases a device driver should not be using
 *	this function
 */

static inline void *phys_to_virt(phys_addr_t address)
{
	return __va(address);
}

/*
 * Change "struct page" to physical address.
 */
#define page_to_phys(page)    ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)

/*
 * ISA I/O bus memory addresses are 1:1 with the physical address.
 * However, we truncate the address to unsigned int to avoid undesirable
 * promitions in legacy drivers.
 */
static inline unsigned int isa_virt_to_bus(volatile void *address)
{
	return (unsigned int)virt_to_phys(address);
}
#define isa_page_to_bus(page)	((unsigned int)page_to_phys(page))
#define isa_bus_to_virt		phys_to_virt

/*
 * However PCI ones are not necessarily 1:1 and therefore these interfaces
 * are forbidden in portable PCI drivers.
 *
 * Allow them on x86 for legacy drivers, though.
 */
#define virt_to_bus virt_to_phys
#define bus_to_virt phys_to_virt

/**
 * ioremap     -   map bus memory into CPU space
 * @offset:    bus address of the memory
 * @size:      size of the resource to map
 *
 * ioremap performs a platform specific sequence of operations to
 * make bus memory CPU accessible via the readb/readw/readl/writeb/
 * writew/writel functions and the other mmio helpers. The returned
 * address is not guaranteed to be usable directly as a virtual
 * address.
 *
 * If the area you are trying to map is a PCI BAR you should have a
 * look at pci_iomap().
 */
extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size);
extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size);
extern void __iomem *ioremap_prot(resource_size_t offset, unsigned long size,
				unsigned long prot_val);

/*
 * The default ioremap() behavior is non-cached:
 */
static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
{
	return ioremap_nocache(offset, size);
}

extern void iounmap(volatile void __iomem *addr);

extern void set_iounmap_nonlazy(void);

#ifdef __KERNEL__

#include <asm-generic/iomap.h>

#include <linux/vmalloc.h>

/*
 * Convert a virtual cached pointer to an uncached pointer
 */
#define xlate_dev_kmem_ptr(p)	p

static inline void
memset_io(volatile void __iomem *addr, unsigned char val, size_t count)
{
	memset((void __force *)addr, val, count);
}

static inline void
memcpy_fromio(void *dst, const volatile void __iomem *src, size_t count)
{
	memcpy(dst, (const void __force *)src, count);
}

static inline void
memcpy_toio(volatile void __iomem *dst, const void *src, size_t count)
{
	memcpy((void __force *)dst, src, count);
}

/*
 * ISA space is 'always mapped' on a typical x86 system, no need to
 * explicitly ioremap() it. The fact that the ISA IO space is mapped
 * to PAGE_OFFSET is pure coincidence - it does not mean ISA values
 * are physical addresses. The following constant pointer can be
 * used as the IO-area pointer (it can be iounmapped as well, so the
 * analogy with PCI is quite large):
 */
#define __ISA_IO_base ((char __iomem *)(PAGE_OFFSET))

/*
 *	Cache management
 *
 *	This needed for two cases
 *	1. Out of order aware processors
 *	2. Accidentally out of order processors (PPro errata #51)
 */

static inline void flush_write_buffers(void)
{
#if defined(CONFIG_X86_PPRO_FENCE)
	asm volatile("lock; addl $0,0(%%esp)": : :"memory");
#endif
}

#endif /* __KERNEL__ */

extern void native_io_delay(void);

extern int io_delay_type;
extern void io_delay_init(void);

#if defined(CONFIG_PARAVIRT)
#include <asm/paravirt.h>
#else

static inline void slow_down_io(void)
{
	native_io_delay();
#ifdef REALLY_SLOW_IO
	native_io_delay();
	native_io_delay();
	native_io_delay();
#endif
}

#endif

#define BUILDIO(bwl, bw, type)						\
static inline void out##bwl(unsigned type value, int port)		\
{									\
	asm volatile("out" #bwl " %" #bw "0, %w1"			\
		     : : "a"(value), "Nd"(port));			\
}									\
									\
static inline unsigned type in##bwl(int port)				\
{									\
	unsigned type value;						\
	asm volatile("in" #bwl " %w1, %" #bw "0"			\
		     : "=a"(value) : "Nd"(port));			\
	return value;							\
}									\
									\
static inline void out##bwl##_p(unsigned type value, int port)		\
{									\
	out##bwl(value, port);						\
	slow_down_io();							\
}									\
									\
static inline unsigned type in##bwl##_p(int port)			\
{									\
	unsigned type value = in##bwl(port);				\
	slow_down_io();							\
	return value;							\
}									\
									\
static inline void outs##bwl(int port, const void *addr, unsigned long count) \
{									\
	asm volatile("rep; outs" #bwl					\
		     : "+S"(addr), "+c"(count) : "d"(port));		\
}									\
									\
static inline void ins##bwl(int port, void *addr, unsigned long count)	\
{									\
	asm volatile("rep; ins" #bwl					\
		     : "+D"(addr), "+c"(count) : "d"(port));		\
}

BUILDIO(b, b, char)
BUILDIO(w, w, short)
BUILDIO(l, , int)

extern void *xlate_dev_mem_ptr(unsigned long phys);
extern void unxlate_dev_mem_ptr(unsigned long phys, void *addr);

extern int ioremap_change_attr(unsigned long vaddr, unsigned long size,
				unsigned long prot_val);
extern void __iomem *ioremap_wc(resource_size_t offset, unsigned long size);

/*
 * early_ioremap() and early_iounmap() are for temporary early boot-time
 * mappings, before the real ioremap() is functional.
 * A boot-time mapping is currently limited to at most 16 pages.
 */
extern void early_ioremap_init(void);
extern void early_ioremap_reset(void);
extern void __iomem *early_ioremap(resource_size_t phys_addr,
				   unsigned long size);
extern void __iomem *early_memremap(resource_size_t phys_addr,
				    unsigned long size);
extern void early_iounmap(void __iomem *addr, unsigned long size);
extern void fixup_early_ioremap(void);
extern bool is_early_ioremap_ptep(pte_t *ptep);

#ifdef CONFIG_XEN
#include <xen/xen.h>
struct bio_vec;

extern bool xen_biovec_phys_mergeable(const struct bio_vec *vec1,
				      const struct bio_vec *vec2);

#define BIOVEC_PHYS_MERGEABLE(vec1, vec2)				\
	(__BIOVEC_PHYS_MERGEABLE(vec1, vec2) &&				\
	 (!xen_domain() || xen_biovec_phys_mergeable(vec1, vec2)))
#endif	/* CONFIG_XEN */

#define IO_SPACE_LIMIT 0xffff

#ifdef CONFIG_MTRR
extern int __must_check arch_phys_wc_add(unsigned long base,
					 unsigned long size);
extern void arch_phys_wc_del(int handle);
#define arch_phys_wc_add arch_phys_wc_add
#endif

#endif /* _ASM_X86_IO_H */


text:
using Arma3BE.Client.Modules.ChatModule.Models;
using Arma3BE.Server.Models;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using Arma3BE.Client.Infrastructure.Windows;
using Arma3BEClient.Libs.Tools;

namespace Arma3BE.Client.Modules.ChatModule.Boxes
{
    /// <summary>
    ///     Interaction logic for ChatHistory.xaml
    /// </summary>
    // ReSharper disable once RedundantExtendsListEntry
    public partial class ChatHistory : WindowBase
    {
        private readonly ChatHistoryViewModel _model;

        public ChatHistory(ChatHistoryViewModel model, ISettingsStoreSource settingsStoreSource):base(settingsStoreSource)
        {
            _model = model;
            InitializeComponent();

            _model.PropertyChanged += _model_PropertyChanged;

            DataContext = _model;
        }

        private void _model_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Log")
            {
                Refresh();
            }
        }

        private void Refresh()
        {
            textControl.ClearAll();

            if (_model.Log.Count() > 10000)
            {
                // ReSharper disable once AssignNullToNotNullAttribute
                MessageBox.Show(GetWindow(this), "Too many results.", "Info", MessageBoxButton.OK, MessageBoxImage.Information);
                return;
            }

            foreach (var chatLog in _model.Log)
            {
                var mes = new ChatMessage { Date = chatLog.Date, Message = chatLog.Text };
                textControl.AppendText(mes, chatLog.ServerName);
            }
        }
    }
}


text:
/**
 *
 */
package com.org.commons.atomcore.test;

import java.util.ArrayList;

/**
 * @author Sharath
 *
 */
public class TestThreading {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		System.out.println("Starting Threads");
		System.out.println("*******************************************");
		Thread.yield();
		final ArrayList<Integer> _al;
		ArrayList<Integer> _bl = new ArrayList<Integer>();
		for(int index = 0; index<10;index++){
			_bl.add(index, (Integer)index);
		}
		_al = _bl;
		if(_al.size()>0){
			System.out.println("I am in ");
			new Thread(){
				public void run(){
					for(int i=0;i<10;i++){
						System.out.println("a -"+_al.get(i));
						try {
							Thread.sleep(1000);
						} catch (InterruptedException e) {
							System.out.println("Thread interruped on "+i+"iteration of a");
							e.printStackTrace();
						}
					}
				}
			}.start();
			new Thread(){
				public void run(){
					for(int i=0;i<10;i++){
						System.out.println("b -"+_al.get(i));
						try {
							Thread.sleep(2000);
						} catch (InterruptedException e) {
							System.out.println("Thread interruped on "+i+"iteration of b");
							e.printStackTrace();
						}
					}
				}
			}.start();
			new Thread(){
				public void run(){
					for(int i=0;i<10;i++){
						System.out.println("c -"+_al.get(i));
						try {
							Thread.sleep(500);
						} catch (InterruptedException e) {
							System.out.println("Thread interruped on "+i+"iteration of c");
							e.printStackTrace();
						}
					}
				}
			}.start();
		}
		System.out.println("*******************************************");
		System.out.println("Threads Completed");
	}

}


text:
<resources>
    <declare-styleable name="AppTheme">
        <attr name="textAppearanceFinish" format="reference" />
    </declare-styleable>
</resources>


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

namespace Simple
{
    public static class Extensions
    {
        public static string Set(this string input, params string[] replacements)
        {
            string newstring = input;

            for(int x = 0; x < replacements.Count(); x++)
            {
                newstring = newstring.Replace("{" + x + "}", replacements[x]);
            }
            return newstring;
        }
    }
}