text:
/*
 * Copyright © 2009  Red Hat, Inc.
 * Copyright © 2012  Google, Inc.
 *
 *  This is part of HarfBuzz, a text shaping library.
 *
 * Permission is hereby granted, without written agreement and without
 * license or royalty fees, to use, copy, modify, and distribute this
 * software and its documentation for any purpose, provided that the
 * above copyright notice and the following two paragraphs appear in
 * all copies of this software.
 *
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Red Hat Author(s): Behdad Esfahbod
 * Google Author(s): Behdad Esfahbod
 */

#include "hb-private.hh"

#include "hb-shaper-private.hh"
#include "hb-shape-plan-private.hh"
#include "hb-buffer-private.hh"
#include "hb-font-private.hh"

/**
 * SECTION:hb-shape
 * @title: Shaping
 * @short_description: Conversion of text strings into positioned glyphs
 * @include: hb.h
 *
 * Shaping is the central operation of HarfBuzz. Shaping operates on buffers,
 * which are sequences of Unicode characters that use the same font and have
 * the same text direction, script and language. After shaping the buffer
 * contains the output glyphs and their positions.
 **/

static const char **static_shaper_list;

#ifdef HB_USE_ATEXIT
static
void free_static_shaper_list (void)
{
  free (static_shaper_list);
}
#endif

/**
 * hb_shape_list_shapers:
 *
 * Retrieves the list of shapers supported by HarfBuzz.
 *
 * Return value: (transfer none) (array zero-terminated=1): an array of
 *    constant strings
 *
 * Since: 0.9.2
 **/
const char **
hb_shape_list_shapers (void)
{
retry:
  const char **shaper_list = (const char **) hb_atomic_ptr_get (&static_shaper_list);

  if (unlikely (!shaper_list))
  {
    /* Not found; allocate one. */
    shaper_list = (const char **) calloc (1 + HB_SHAPERS_COUNT, sizeof (const char *));
    if (unlikely (!shaper_list)) {
      static const char *nil_shaper_list[] = {nullptr};
      return nil_shaper_list;
    }

    const hb_shaper_pair_t *shapers = _hb_shapers_get ();
    unsigned int i;
    for (i = 0; i < HB_SHAPERS_COUNT; i++)
      shaper_list[i] = shapers[i].name;
    shaper_list[i] = nullptr;

    if (!hb_atomic_ptr_cmpexch (&static_shaper_list, nullptr, shaper_list)) {
      free (shaper_list);
      goto retry;
    }

#ifdef HB_USE_ATEXIT
    atexit (free_static_shaper_list); /* First person registers atexit() callback. */
#endif
  }

  return shaper_list;
}

/**
 * hb_shape_full:
 * @font: an #hb_font_t to use for shaping
 * @buffer: an #hb_buffer_t to shape
 * @features: (array length=num_features) (allow-none): an array of user
 *    specified #hb_feature_t or %NULL
 * @num_features: the length of @features array
 * @shaper_list: (array zero-terminated=1) (allow-none): a %NULL-terminated
 *    array of shapers to use or %NULL
 *
 * See hb_shape() for details. If @shaper_list is not %NULL, the specified
 * shapers will be used in the given order, otherwise the default shapers list
 * will be used.
 *
 * Return value: false if all shapers failed, true otherwise
 *
 * Since: 0.9.2
 **/
hb_bool_t
hb_shape_full (hb_font_t          *font,
	       hb_buffer_t        *buffer,
	       const hb_feature_t *features,
	       unsigned int        num_features,
	       const char * const *shaper_list)
{
  hb_shape_plan_t *shape_plan = hb_shape_plan_create_cached2 (font->face, &buffer->props,
							      features, num_features,
							      font->coords, font->num_coords,
							      shaper_list);
  hb_bool_t res = hb_shape_plan_execute (shape_plan, font, buffer, features, num_features);
  hb_shape_plan_destroy (shape_plan);

  if (res)
    buffer->content_type = HB_BUFFER_CONTENT_TYPE_GLYPHS;
  return res;
}

/**
 * hb_shape:
 * @font: an #hb_font_t to use for shaping
 * @buffer: an #hb_buffer_t to shape
 * @features: (array length=num_features) (allow-none): an array of user
 *    specified #hb_feature_t or %NULL
 * @num_features: the length of @features array
 *
 * Shapes @buffer using @font turning its Unicode characters content to
 * positioned glyphs. If @features is not %NULL, it will be used to control the
 * features applied during shaping.
 *
 * Since: 0.9.2
 **/
void
hb_shape (hb_font_t           *font,
	  hb_buffer_t         *buffer,
	  const hb_feature_t  *features,
	  unsigned int         num_features)
{
  hb_shape_full (font, buffer, features, num_features, nullptr);
}


text:
<?php

namespace Zenify\ModularMenu\Contract\Provider;

interface RankedMenuItemsProviderInterface extends MenuItemsProviderInterface
{

	/**
	 * Get priority rank. Same as order: 1 = first, 100 = bellow.
	 *
	 * @return int
	 */
	function getRank();

}

redpajama_set_name: RedPajamaGithub


text:
from django import forms
from rango.models import Page, Category

class CategoryForm(forms.ModelForm):
    name = forms.CharField(max_length=128, help_text="Please enter the category name.")
    views = forms.IntegerField(widget=forms.HiddenInput(), initial=0)
    likes = forms.IntegerField(widget=forms.HiddenInput(), initial=0)

    # An inline class to provide additional information on the form.
    class Meta:
        # Provide an association between the Model Form and a model
        model = Category

class PageForm(forms.ModelForm):
    title = forms.CharField(max_length=128, help_text="Please enter the title of the page.")
    url = forms.URLField(max_length=200, help_text="Please enter the URL of the page.")
    views = forms.IntegerField(widget=forms.HiddenInput(), initial=0)

    class Meta:
        # Provide an association between the ModelForm and a model
        model = Page

        # What fields do we want to include in our form?
        # This way we don't need every field in the model present.
        # Some fields may allow NULL values, so we may not want to include them...
        # Here, we are hiding the foreign key.
        fields = ('title', 'url', 'views')

    def clean(self):
        cleaned_data = self.cleaned_data
        url = cleaned_data.get('url')

        # If url is not empty and doesn't start with 'http://', add it
        if url and not url.startswith('http://'):
            url = 'http://' + url
            cleaned_data['url'] = url
        return cleaned_data


text:
import { Component, Input } from '@angular/core';
import { OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { RouterLink, ActivatedRoute } from '@angular/router';

import { ToDo } from '../models/todo';
import { Question } from '../models/question';

import { CheckUp } from '../models/checkUp';
import { CheckUpTemplate } from '../models/checkUpTemplate';

import { CheckUpService } from '../services/checkUp.service';
import { FeedbackMessage } from '../models/feedbackMessage';

@Component({
  moduleId: module.id,
  selector: 'showcheckup',
  templateUrl: `showcheckup.component.html`,
  providers:[RouterLink]
})
export class ShowCheckupComponent implements OnInit {
  feedbackMessage: FeedbackMessage = null;
  checkUp: CheckUp = new CheckUp();
  checkUpTemplate: CheckUpTemplate = new CheckUpTemplate();

  constructor(private checkUpService: CheckUpService, private titleService: Title, private router: RouterLink, private route: ActivatedRoute) {
    this.titleService.setTitle('Check Up!');
    this.router = router;
  } // with this Angular will know to supply an instance of the CheckUpTemplateService when it creates a new AppComponent
  ngOnInit(): void {
    this.route.params.subscribe(params => {
       let checkUpId = params['id'];
       this.checkUpService.getCheckUp(checkUpId).subscribe((checkUp: CheckUp)=>{
         this.checkUp = checkUp;
       });
    });
  }

  createCheckUp(newCheckUp: CheckUp): void {
    this.checkUpService.updateCheckUp(newCheckUp)
    .subscribe(
      (newCheckUp) => {
        this.feedbackMessage = new FeedbackMessage("CheckUp wurde erstellt.", "CheckUp wurde erstellt.", "success");
      },
      (err) => {
        this.feedbackMessage = new FeedbackMessage("Das hat leider nicht funktioniert.", "Das hat leider nicht funktioniert.", "error")
      });
  }

}


text:
typedef int int32;
// IBM AIX typedefs `int64` in `sys/inttypes.h`, included transitively above.
#ifndef _AIX
typedef long int64;
#endif

using std::string;
using std::vector;
using std::pair;

// This assertion produces errors like "error: invalid use of
// incomplete type 'struct <unnamed>::AssertTypesEq<const int, int>'"
// when it fails.
template<typename T, typename U> struct AssertTypesEq;
template<typename T> struct AssertTypesEq<T, T> {};
#define COMPILE_ASSERT_TYPES_EQ(T, U) static_cast<void>(AssertTypesEq<T, U>())

// A user-defined POD type.
struct A {
  int n_;
};

// A user-defined non-POD type with a trivial copy constructor.
class B {
 public:
  explicit B(int n) : n_(n) { }
 private:
  int n_;
};

// Another user-defined non-POD type with a trivial copy constructor.
// We will explicitly declare C to have a trivial copy constructor
// by specializing has_trivial_copy.
class C {
 public:
  explicit C(int n) : n_(n) { }
 private:
  int n_;
};

namespace google {
namespace protobuf {
namespace internal {
template<> struct has_trivial_copy<C> : true_type { };
}  // namespace internal
}  // namespace protobuf
}  // namespace google

// Another user-defined non-POD type with a trivial assignment operator.
// We will explicitly declare C to have a trivial assignment operator
// by specializing has_trivial_assign.
class D {
 public:
  explicit D(int n) : n_(n) { }
 private:
  int n_;
};

namespace google {
namespace protobuf {
namespace internal {
template<> struct has_trivial_assign<D> : true_type { };
}  // namespace internal
}  // namespace protobuf
}  // namespace google

// Another user-defined non-POD type with a trivial constructor.
// We will explicitly declare E to have a trivial constructor
// by specializing has_trivial_constructor.
class E {
 public:
  int n_;
};

namespace google {
namespace protobuf {
namespace internal {
template<> struct has_trivial_constructor<E> : true_type { };
}  // namespace internal
}  // namespace protobuf
}  // namespace google

// Another user-defined non-POD type with a trivial destructor.
// We will explicitly declare E to have a trivial destructor
// by specializing has_trivial_destructor.
class F {
 public:
  explicit F(int n) : n_(n) { }
 private:
  int n_;
};

namespace google {
namespace protobuf {
namespace internal {
template<> struct has_trivial_destructor<F> : true_type { };
}  // namespace internal
}  // namespace protobuf
}  // namespace google

enum G {};

union H {};

class I {
 public:
  operator int() const;
};

class J {
 private:
  operator int() const;
};

namespace google {
namespace protobuf {
namespace internal {
namespace {

// A base class and a derived class that inherits from it, used for
// testing conversion type traits.
class Base {
 public:
  virtual ~Base() { }
};

class Derived : public Base {
};

TEST(TypeTraitsTest, TestIsInteger) {
  // Verify that is_integral is true for all integer types.
  EXPECT_TRUE(is_integral<bool>::value);
  EXPECT_TRUE(is_integral<char>::value);
  EXPECT_TRUE(is_integral<unsigned char>::value);
  EXPECT_TRUE(is_integral<signed char>::value);
  EXPECT_TRUE(is_integral<wchar_t>::value);
  EXPECT_TRUE(is_integral<int>::value);
  EXPECT_TRUE(is_integral<unsigned int>::value);
  EXPECT_TRUE(is_integral<short>::value);
  EXPECT_TRUE(is_integral<unsigned short>::value);
  EXPECT_TRUE(is_integral<long>::value);
  EXPECT_TRUE(is_integral<unsigned long>::value);

  // Verify that is_integral is false for a few non-integer types.
  EXPECT_FALSE(is_integral<void>::value);
  EXPECT_FALSE(is_integral<float>::value);
  EXPECT_FALSE(is_integral<string>::value);
  EXPECT_FALSE(is_integral<int*>::value);
  EXPECT_FALSE(is_integral<A>::value);
  EXPECT_FALSE((is_integral<pair<int, int> >::value));

  // Verify that cv-qualified integral types are still integral, and
  // cv-qualified non-integral types are still non-integral.
  EXPECT_TRUE(is_integral<const char>::value);
  EXPECT_TRUE(is_integral<volatile bool>::value);
  EXPECT_TRUE(is_integral<const volatile unsigned int>::value);
  EXPECT_FALSE(is_integral<const float>::value);
  EXPECT_FALSE(is_integral<int* volatile>::value);
  EXPECT_FALSE(is_integral<const volatile string>::value);
}

TEST(TypeTraitsTest, TestIsFloating) {
  // Verify that is_floating_point is true for all floating-point types.
  EXPECT_TRUE(is_floating_point<float>::value);
  EXPECT_TRUE(is_floating_point<double>::value);
  EXPECT_TRUE(is_floating_point<long double>::value);

  // Verify that is_floating_point is false for a few non-float types.
  EXPECT_FALSE(is_floating_point<void>::value);
  EXPECT_FALSE(is_floating_point<long>::value);
  EXPECT_FALSE(is_floating_point<string>::value);
  EXPECT_FALSE(is_floating_point<float*>::value);
  EXPECT_FALSE(is_floating_point<A>::value);
  EXPECT_FALSE((is_floating_point<pair<int, int> >::value));

  // Verify that cv-qualified floating point types are still floating, and
  // cv-qualified non-floating types are still non-floating.
  EXPECT_TRUE(is_floating_point<const float>::value);
  EXPECT_TRUE(is_floating_point<volatile double>::value);
  EXPECT_TRUE(is_floating_point<const volatile long double>::value);
  EXPECT_FALSE(is_floating_point<const int>::value);
  EXPECT_FALSE(is_floating_point<volatile string>::value);
  EXPECT_FALSE(is_floating_point<const volatile char>::value);
}

TEST(TypeTraitsTest, TestIsPointer) {
  // Verify that is_pointer is true for some pointer types.
  EXPECT_TRUE(is_pointer<int*>::value);
  EXPECT_TRUE(is_pointer<void*>::value);
  EXPECT_TRUE(is_pointer<string*>::value);
  EXPECT_TRUE(is_pointer<const void*>::value);
  EXPECT_TRUE(is_pointer<volatile float* const*>::value);

  // Verify that is_pointer is false for some non-pointer types.
  EXPECT_FALSE(is_pointer<void>::value);
  EXPECT_FALSE(is_pointer<float&>::value);
  EXPECT_FALSE(is_pointer<long>::value);
  EXPECT_FALSE(is_pointer<vector<int*> >::value);
  EXPECT_FALSE(is_pointer<int[5]>::value);

  // A function pointer is a pointer, but a function type, or a function
  // reference type, is not.
  EXPECT_TRUE(is_pointer<int (*)(int x)>::value);
  EXPECT_FALSE(is_pointer<void(char x)>::value);
  EXPECT_FALSE(is_pointer<double (&)(string x)>::value);

  // Verify that is_pointer<T> is true for some cv-qualified pointer types,
  // and false for some cv-qualified non-pointer types.
  EXPECT_TRUE(is_pointer<int* const>::value);
  EXPECT_TRUE(is_pointer<const void* volatile>::value);
  EXPECT_TRUE(is_pointer<char** const volatile>::value);
  EXPECT_FALSE(is_pointer<const int>::value);
  EXPECT_FALSE(is_pointer<volatile vector<int*> >::value);
  EXPECT_FALSE(is_pointer<const volatile double>::value);
}

TEST(TypeTraitsTest, TestIsEnum) {
// is_enum isn't supported on MSVC or gcc 3.x
#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
  // Verify that is_enum is true for enum types.
  EXPECT_TRUE(is_enum<G>::value);
  EXPECT_TRUE(is_enum<const G>::value);
  EXPECT_TRUE(is_enum<volatile G>::value);
  EXPECT_TRUE(is_enum<const volatile G>::value);

  // Verify that is_enum is false for a few non-enum types.
  EXPECT_FALSE(is_enum<void>::value);
  EXPECT_FALSE(is_enum<G&>::value);
  EXPECT_FALSE(is_enum<G[1]>::value);
  EXPECT_FALSE(is_enum<const G[1]>::value);
  EXPECT_FALSE(is_enum<G[]>::value);
  EXPECT_FALSE(is_enum<int>::value);
  EXPECT_FALSE(is_enum<float>::value);
  EXPECT_FALSE(is_enum<A>::value);
  EXPECT_FALSE(is_enum<A*>::value);
  EXPECT_FALSE(is_enum<const A>::value);
  EXPECT_FALSE(is_enum<H>::value);
  EXPECT_FALSE(is_enum<I>::value);
  EXPECT_FALSE(is_enum<J>::value);
  EXPECT_FALSE(is_enum<void()>::value);
  EXPECT_FALSE(is_enum<void(*)()>::value);
  EXPECT_FALSE(is_enum<int A::*>::value);
  EXPECT_FALSE(is_enum<void (A::*)()>::value);
#endif
}

TEST(TypeTraitsTest, TestIsReference) {
  // Verifies that is_reference is true for all reference types.
  typedef float& RefFloat;
  EXPECT_TRUE(is_reference<float&>::value);
  EXPECT_TRUE(is_reference<const int&>::value);
  EXPECT_TRUE(is_reference<const int*&>::value);
  EXPECT_TRUE(is_reference<int (&)(bool)>::value);
  EXPECT_TRUE(is_reference<RefFloat>::value);
  EXPECT_TRUE(is_reference<const RefFloat>::value);
  EXPECT_TRUE(is_reference<volatile RefFloat>::value);
  EXPECT_TRUE(is_reference<const volatile RefFloat>::value);

  // Verifies that is_reference is false for all non-reference types.
  EXPECT_FALSE(is_reference<float>::value);
  EXPECT_FALSE(is_reference<const float>::value);
  EXPECT_FALSE(is_reference<volatile float>::value);
  EXPECT_FALSE(is_reference<const volatile float>::value);
  EXPECT_FALSE(is_reference<const int*>::value);
  EXPECT_FALSE(is_reference<int()>::value);
  EXPECT_FALSE(is_reference<void(*)(const char&)>::value);
}

TEST(TypeTraitsTest, TestAddReference) {
  COMPILE_ASSERT_TYPES_EQ(int&, add_reference<int>::type);
  COMPILE_ASSERT_TYPES_EQ(const int&, add_reference<const int>::type);
  COMPILE_ASSERT_TYPES_EQ(volatile int&,
                          add_reference<volatile int>::type);
  COMPILE_ASSERT_TYPES_EQ(const volatile int&,
                          add_reference<const volatile int>::type);
  COMPILE_ASSERT_TYPES_EQ(int&, add_reference<int&>::type);
  COMPILE_ASSERT_TYPES_EQ(const int&, add_reference<const int&>::type);
  COMPILE_ASSERT_TYPES_EQ(volatile int&,
                          add_reference<volatile int&>::type);
  COMPILE_ASSERT_TYPES_EQ(const volatile int&,
                          add_reference<const volatile int&>::type);
}

TEST(TypeTraitsTest, TestIsPod) {
  // Verify that arithmetic types and pointers are marked as PODs.
  EXPECT_TRUE(is_pod<bool>::value);
  EXPECT_TRUE(is_pod<char>::value);
  EXPECT_TRUE(is_pod<unsigned char>::value);
  EXPECT_TRUE(is_pod<signed char>::value);
  EXPECT_TRUE(is_pod<wchar_t>::value);
  EXPECT_TRUE(is_pod<int>::value);
  EXPECT_TRUE(is_pod<unsigned int>::value);
  EXPECT_TRUE(is_pod<short>::value);
  EXPECT_TRUE(is_pod<unsigned short>::value);
  EXPECT_TRUE(is_pod<long>::value);
  EXPECT_TRUE(is_pod<unsigned long>::value);
  EXPECT_TRUE(is_pod<float>::value);
  EXPECT_TRUE(is_pod<double>::value);
  EXPECT_TRUE(is_pod<long double>::value);
  EXPECT_TRUE(is_pod<string*>::value);
  EXPECT_TRUE(is_pod<A*>::value);
  EXPECT_TRUE(is_pod<const B*>::value);
  EXPECT_TRUE(is_pod<C**>::value);
  EXPECT_TRUE(is_pod<const int>::value);
  EXPECT_TRUE(is_pod<char* volatile>::value);
  EXPECT_TRUE(is_pod<const volatile double>::value);
#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ <= 3)
  EXPECT_TRUE(is_pod<G>::value);
  EXPECT_TRUE(is_pod<const G>::value);
  EXPECT_TRUE(is_pod<volatile G>::value);
  EXPECT_TRUE(is_pod<const volatile G>::value);
#endif

  // Verify that some non-POD types are not marked as PODs.
  EXPECT_FALSE(is_pod<void>::value);
  EXPECT_FALSE(is_pod<string>::value);
  EXPECT_FALSE((is_pod<pair<int, int> >::value));
  EXPECT_FALSE(is_pod<A>::value);
  EXPECT_FALSE(is_pod<B>::value);
  EXPECT_FALSE(is_pod<C>::value);
  EXPECT_FALSE(is_pod<const string>::value);
  EXPECT_FALSE(is_pod<volatile A>::value);
  EXPECT_FALSE(is_pod<const volatile B>::value);
}

TEST(TypeTraitsTest, TestHasTrivialConstructor) {
  // Verify that arithmetic types and pointers have trivial constructors.
  EXPECT_TRUE(has_trivial_constructor<bool>::value);
  EXPECT_TRUE(has_trivial_constructor<char>::value);
  EXPECT_TRUE(has_trivial_constructor<unsigned char>::value);
  EXPECT_TRUE(has_trivial_constructor<signed char>::value);
  EXPECT_TRUE(has_trivial_constructor<wchar_t>::value);
  EXPECT_TRUE(has_trivial_constructor<int>::value);
  EXPECT_TRUE(has_trivial_constructor<unsigned int>::value);
  EXPECT_TRUE(has_trivial_constructor<short>::value);
  EXPECT_TRUE(has_trivial_constructor<unsigned short>::value);
  EXPECT_TRUE(has_trivial_constructor<long>::value);
  EXPECT_TRUE(has_trivial_constructor<unsigned long>::value);
  EXPECT_TRUE(has_trivial_constructor<float>::value);
  EXPECT_TRUE(has_trivial_constructor<double>::value);
  EXPECT_TRUE(has_trivial_constructor<long double>::value);
  EXPECT_TRUE(has_trivial_constructor<string*>::value);
  EXPECT_TRUE(has_trivial_constructor<A*>::value);
  EXPECT_TRUE(has_trivial_constructor<const B*>::value);
  EXPECT_TRUE(has_trivial_constructor<C**>::value);

  // Verify that pairs and arrays of such types have trivial
  // constructors.
  typedef int int10[10];
  EXPECT_TRUE((has_trivial_constructor<pair<int, char*> >::value));
  EXPECT_TRUE(has_trivial_constructor<int10>::value);

  // Verify that pairs of types without trivial constructors
  // are not marked as trivial.
  EXPECT_FALSE((has_trivial_constructor<pair<int, string> >::value));
  EXPECT_FALSE((has_trivial_constructor<pair<string, int> >::value));

  // Verify that types without trivial constructors are
  // correctly marked as such.
  EXPECT_FALSE(has_trivial_constructor<string>::value);
  EXPECT_FALSE(has_trivial_constructor<vector<int> >::value);

  // Verify that E, which we have declared to have a trivial
  // constructor, is correctly marked as such.
  EXPECT_TRUE(has_trivial_constructor<E>::value);
}

TEST(TypeTraitsTest, TestHasTrivialCopy) {
  // Verify that arithmetic types and pointers have trivial copy
  // constructors.
  EXPECT_TRUE(has_trivial_copy<bool>::value);
  EXPECT_TRUE(has_trivial_copy<char>::value);
  EXPECT_TRUE(has_trivial_copy<unsigned char>::value);
  EXPECT_TRUE(has_trivial_copy<signed char>::value);
  EXPECT_TRUE(has_trivial_copy<wchar_t>::value);
  EXPECT_TRUE(has_trivial_copy<int>::value);
  EXPECT_TRUE(has_trivial_copy<unsigned int>::value);
  EXPECT_TRUE(has_trivial_copy<short>::value);
  EXPECT_TRUE(has_trivial_copy<unsigned short>::value);
  EXPECT_TRUE(has_trivial_copy<long>::value);
  EXPECT_TRUE(has_trivial_copy<unsigned long>::value);
  EXPECT_TRUE(has_trivial_copy<float>::value);
  EXPECT_TRUE(has_trivial_copy<double>::value);
  EXPECT_TRUE(has_trivial_copy<long double>::value);
  EXPECT_TRUE(has_trivial_copy<string*>::value);
  EXPECT_TRUE(has_trivial_copy<A*>::value);
  EXPECT_TRUE(has_trivial_copy<const B*>::value);
  EXPECT_TRUE(has_trivial_copy<C**>::value);

  // Verify that pairs and arrays of such types have trivial
  // copy constructors.
  typedef int int10[10];
  EXPECT_TRUE((has_trivial_copy<pair<int, char*> >::value));
  EXPECT_TRUE(has_trivial_copy<int10>::value);

  // Verify that pairs of types without trivial copy constructors
  // are not marked as trivial.
  EXPECT_FALSE((has_trivial_copy<pair<int, string> >::value));
  EXPECT_FALSE((has_trivial_copy<pair<string, int> >::value));

  // Verify that types without trivial copy constructors are
  // correctly marked as such.
  EXPECT_FALSE(has_trivial_copy<string>::value);
  EXPECT_FALSE(has_trivial_copy<vector<int> >::value);

  // Verify that C, which we have declared to have a trivial
  // copy constructor, is correctly marked as such.
  EXPECT_TRUE(has_trivial_copy<C>::value);
}

TEST(TypeTraitsTest, TestHasTrivialAssign) {
  // Verify that arithmetic types and pointers have trivial assignment
  // operators.
  EXPECT_TRUE(has_trivial_assign<bool>::value);
  EXPECT_TRUE(has_trivial_assign<char>::value);
  EXPECT_TRUE(has_trivial_assign<unsigned char>::value);
  EXPECT_TRUE(has_trivial_assign<signed char>::value);
  EXPECT_TRUE(has_trivial_assign<wchar_t>::value);
  EXPECT_TRUE(has_trivial_assign<int>::value);
  EXPECT_TRUE(has_trivial_assign<unsigned int>::value);
  EXPECT_TRUE(has_trivial_assign<short>::value);
  EXPECT_TRUE(has_trivial_assign<unsigned short>::value);
  EXPECT_TRUE(has_trivial_assign<long>::value);
  EXPECT_TRUE(has_trivial_assign<unsigned long>::value);
  EXPECT_TRUE(has_trivial_assign<float>::value);
  EXPECT_TRUE(has_trivial_assign<double>::value);
  EXPECT_TRUE(has_trivial_assign<long double>::value);
  EXPECT_TRUE(has_trivial_assign<string*>::value);
  EXPECT_TRUE(has_trivial_assign<A*>::value);
  EXPECT_TRUE(has_trivial_assign<const B*>::value);
  EXPECT_TRUE(has_trivial_assign<C**>::value);

  // Verify that pairs and arrays of such types have trivial
  // assignment operators.
  typedef int int10[10];
  EXPECT_TRUE((has_trivial_assign<pair<int, char*> >::value));
  EXPECT_TRUE(has_trivial_assign<int10>::value);

  // Verify that pairs of types without trivial assignment operators
  // are not marked as trivial.
  EXPECT_FALSE((has_trivial_assign<pair<int, string> >::value));
  EXPECT_FALSE((has_trivial_assign<pair<string, int> >::value));

  // Verify that types without trivial assignment operators are
  // correctly marked as such.
  EXPECT_FALSE(has_trivial_assign<string>::value);
  EXPECT_FALSE(has_trivial_assign<vector<int> >::value);

  // Verify that D, which we have declared to have a trivial
  // assignment operator, is correctly marked as such.
  EXPECT_TRUE(has_trivial_assign<D>::value);
}

TEST(TypeTraitsTest, TestHasTrivialDestructor) {
  // Verify that arithmetic types and pointers have trivial destructors.
  EXPECT_TRUE(has_trivial_destructor<bool>::value);
  EXPECT_TRUE(has_trivial_destructor<char>::value);
  EXPECT_TRUE(has_trivial_destructor<unsigned char>::value);
  EXPECT_TRUE(has_trivial_destructor<signed char>::value);
  EXPECT_TRUE(has_trivial_destructor<wchar_t>::value);
  EXPECT_TRUE(has_trivial_destructor<int>::value);
  EXPECT_TRUE(has_trivial_destructor<unsigned int>::value);
  EXPECT_TRUE(has_trivial_destructor<short>::value);
  EXPECT_TRUE(has_trivial_destructor<unsigned short>::value);
  EXPECT_TRUE(has_trivial_destructor<long>::value);
  EXPECT_TRUE(has_trivial_destructor<unsigned long>::value);
  EXPECT_TRUE(has_trivial_destructor<float>::value);
  EXPECT_TRUE(has_trivial_destructor<double>::value);
  EXPECT_TRUE(has_trivial_destructor<long double>::value);
  EXPECT_TRUE(has_trivial_destructor<string*>::value);
  EXPECT_TRUE(has_trivial_destructor<A*>::value);
  EXPECT_TRUE(has_trivial_destructor<const B*>::value);
  EXPECT_TRUE(has_trivial_destructor<C**>::value);

  // Verify that pairs and arrays of such types have trivial
  // destructors.
  typedef int int10[10];
  EXPECT_TRUE((has_trivial_destructor<pair<int, char*> >::value));
  EXPECT_TRUE(has_trivial_destructor<int10>::value);

  // Verify that pairs of types without trivial destructors
  // are not marked as trivial.
  EXPECT_FALSE((has_trivial_destructor<pair<int, string> >::value));
  EXPECT_FALSE((has_trivial_destructor<pair<string, int> >::value));

  // Verify that types without trivial destructors are
  // correctly marked as such.
  EXPECT_FALSE(has_trivial_destructor<string>::value);
  EXPECT_FALSE(has_trivial_destructor<vector<int> >::value);

  // Verify that F, which we have declared to have a trivial
  // destructor, is correctly marked as such.
  EXPECT_TRUE(has_trivial_destructor<F>::value);
}

// Tests remove_pointer.
TEST(TypeTraitsTest, TestRemovePointer) {
  COMPILE_ASSERT_TYPES_EQ(int, remove_pointer<int>::type);
  COMPILE_ASSERT_TYPES_EQ(int, remove_pointer<int*>::type);
  COMPILE_ASSERT_TYPES_EQ(const int, remove_pointer<const int*>::type);
  COMPILE_ASSERT_TYPES_EQ(int, remove_pointer<int* const>::type);
  COMPILE_ASSERT_TYPES_EQ(int, remove_pointer<int* volatile>::type);
}

TEST(TypeTraitsTest, TestRemoveConst) {
  COMPILE_ASSERT_TYPES_EQ(int, remove_const<int>::type);
  COMPILE_ASSERT_TYPES_EQ(int, remove_const<const int>::type);
  COMPILE_ASSERT_TYPES_EQ(int *, remove_const<int * const>::type);
  // TR1 examples.
  COMPILE_ASSERT_TYPES_EQ(const int *, remove_const<const int *>::type);
  COMPILE_ASSERT_TYPES_EQ(volatile int,
                          remove_const<const volatile int>::type);
}

TEST(TypeTraitsTest, TestRemoveVolatile) {
  COMPILE_ASSERT_TYPES_EQ(int, remove_volatile<int>::type);
  COMPILE_ASSERT_TYPES_EQ(int, remove_volatile<volatile int>::type);
  COMPILE_ASSERT_TYPES_EQ(int *, remove_volatile<int * volatile>::type);
  // TR1 examples.
  COMPILE_ASSERT_TYPES_EQ(volatile int *,
                          remove_volatile<volatile int *>::type);
  COMPILE_ASSERT_TYPES_EQ(const int,
                          remove_volatile<const volatile int>::type);
}

TEST(TypeTraitsTest, TestRemoveCV) {
  COMPILE_ASSERT_TYPES_EQ(int, remove_cv<int>::type);
  COMPILE_ASSERT_TYPES_EQ(int, remove_cv<volatile int>::type);
  COMPILE_ASSERT_TYPES_EQ(int, remove_cv<const int>::type);
  COMPILE_ASSERT_TYPES_EQ(int *, remove_cv<int * const volatile>::type);
  // TR1 examples.
  COMPILE_ASSERT_TYPES_EQ(const volatile int *,
                          remove_cv<const volatile int *>::type);
  COMPILE_ASSERT_TYPES_EQ(int,
                          remove_cv<const volatile int>::type);
}

TEST(TypeTraitsTest, TestRemoveReference) {
  COMPILE_ASSERT_TYPES_EQ(int, remove_reference<int>::type);
  COMPILE_ASSERT_TYPES_EQ(int, remove_reference<int&>::type);
  COMPILE_ASSERT_TYPES_EQ(const int, remove_reference<const int&>::type);
  COMPILE_ASSERT_TYPES_EQ(int*, remove_reference<int * &>::type);
}

TEST(TypeTraitsTest, TestIsSame) {
  EXPECT_TRUE((is_same<int32, int32>::value));
  EXPECT_FALSE((is_same<int32, int64>::value));
  EXPECT_FALSE((is_same<int64, int32>::value));
  EXPECT_FALSE((is_same<int, const int>::value));

  EXPECT_TRUE((is_same<void, void>::value));
  EXPECT_FALSE((is_same<void, int>::value));
  EXPECT_FALSE((is_same<int, void>::value));

  EXPECT_TRUE((is_same<int*, int*>::value));
  EXPECT_TRUE((is_same<void*, void*>::value));
  EXPECT_FALSE((is_same<int*, void*>::value));
  EXPECT_FALSE((is_same<void*, int*>::value));
  EXPECT_FALSE((is_same<void*, const void*>::value));
  EXPECT_FALSE((is_same<void*, void* const>::value));

  EXPECT_TRUE((is_same<Base*, Base*>::value));
  EXPECT_TRUE((is_same<Derived*, Derived*>::value));
  EXPECT_FALSE((is_same<Base*, Derived*>::value));
  EXPECT_FALSE((is_same<Derived*, Base*>::value));
}

TEST(TypeTraitsTest, TestConvertible) {
#if !(defined(__GNUC__) && __GNUC__ <= 3)
  EXPECT_TRUE((is_convertible<int, int>::value));
  EXPECT_TRUE((is_convertible<int, long>::value));
  EXPECT_TRUE((is_convertible<long, int>::value));

  EXPECT_TRUE((is_convertible<int*, void*>::value));
  EXPECT_FALSE((is_convertible<void*, int*>::value));

  EXPECT_TRUE((is_convertible<Derived*, Base*>::value));
  EXPECT_FALSE((is_convertible<Base*, Derived*>::value));
  EXPECT_TRUE((is_convertible<Derived*, const Base*>::value));
  EXPECT_FALSE((is_convertible<const Derived*, Base*>::value));
#endif
}

}  // anonymous namespace
}  // namespace internal
}  // namespace protobuf
}  // namespace google


text:
package org.jboss.as.cli.impl;

import org.jboss.as.cli.CliInitializationException;

/**
 *
This is a workaround for WFCORE-526 (affects AS 7 and
 * WildFly 8, fixed in WildFly 9). This class has a stupidly long name to signify that it's not meant to be used
 * publicly, even if it is {@code public}.

 *
 *
All methods are inherited unmodified, except of {@code getControllerHost} and {@code getControllerPort}
 * that return correct values. It needs to be in the {@code org.jboss.as.cli.impl} package so that it can inherit
 * from a package-private class.

 */
public final class WorkaroundForWFCORE526_CommandContextImpl extends CommandContextImpl {
    private final String host;
    private final int port;

    public WorkaroundForWFCORE526_CommandContextImpl(String host, int port) throws CliInitializationException {
        super();
        this.host = host;
        this.port = port;
    }

    @Override
    public String getControllerHost() {
        return getModelControllerClient() != null ? host : null;
    }

    @Override
    public int getControllerPort() {
        return getModelControllerClient() != null ? port : -1;
    }
}


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<link rel="apple-touch-startup-image" href="startup.png">
	<link rel="apple-touch-icon" href="chocolatechip-icon.png"/>
	<link rel="shortcut icon" href="favicon.ico">
	<title>ChocolateChip Mobile</title>
	<link rel="stylesheet" href="chui/chui.css">

	<app id="appID" class="appClass">
		<view title="Main" class="mainView" id="main" ui-background-style="striped" ui-navigation-status="current">
			<navbar id="segmentedToolbar">

Switchcontrol

			</navbar>
			<subview id="subview1" class="mySubView" ui-associations="withNavBar">
				<scrollpanel>
					<tableview ui-kind="grouped">
                    	<tablecell>
                        <celltitle>Sleep</celltitle>
                    	</tablecell>
                    </tableview>
                    <tableview ui-kind="grouped">
                    	<tablecell>
                        <celltitle>Vacation</celltitle>
                    	</tablecell>
                    </tableview>
                    <tableview ui-kind="grouped">
                    	<tablecell>
                        <celltitle>Breakfast</celltitle>
                    	</tablecell>
                    </tableview>

                    	Response:

				</scrollpanel>
			</subview>
		</view>
	</app>


text:
package com.koch.ambeth.server.rest;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.util.Enumeration;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.regex.Pattern;
import java.util.zip.DeflaterOutputStream;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import java.util.zip.InflaterInputStream;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.NotSupportedException;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.StreamingOutput;

import com.koch.ambeth.ioc.IServiceContext;
import com.koch.ambeth.ioc.threadlocal.IThreadLocalCleanupController;
import com.koch.ambeth.log.AmbethLogger;
import com.koch.ambeth.log.ILogger;
import com.koch.ambeth.log.LoggerFactory;
import com.koch.ambeth.merge.transfer.CreateContainer;
import com.koch.ambeth.merge.transfer.ObjRef;
import com.koch.ambeth.service.transfer.AmbethServiceException;
import com.koch.ambeth.util.collections.ArrayList;
import com.koch.ambeth.util.collections.EmptyList;
import com.koch.ambeth.util.collections.HashSet;
import com.koch.ambeth.util.collections.IList;
import com.koch.ambeth.util.config.IProperties;
import com.koch.ambeth.util.exception.MaskingRuntimeException;
import com.koch.ambeth.util.exception.RuntimeExceptionUtil;
import com.koch.ambeth.util.io.FastByteArrayOutputStream;
import com.koch.ambeth.util.state.AbstractStateRollback;
import com.koch.ambeth.util.state.IStateRollback;
import com.koch.ambeth.util.state.NoOpStateRollback;
import com.koch.ambeth.util.threading.IBackgroundWorkerParamDelegate;
import com.koch.ambeth.xml.ICyclicXMLHandler;
import com.koch.ambeth.xml.ioc.XmlModule;

public abstract class AbstractServiceREST {
	public static final String THREAD_LOCAL_HANDLED = "threadLocalHandled";

	/**
	 * this is needed for MS Silverlight applications because in the C# web sandbox it is not allowed
	 * to specify the "Accept-Encoding" header directly.
	 */
	public static final String ACCEPT_ENCODING_WORKAROUND = "Accept-Encoding-Workaround";

	public static final String deflateEncoding = "deflate";

	public static final String gzipEncoding = "gzip";

	public static final String DEFLATE_MIME_TYPE = MediaType.APPLICATION_OCTET_STREAM;

	protected static final Charset utfCharset = Charset.forName("UTF-8");

	protected static final Pattern basicPattern = Pattern.compile("Basic *(.+) *",
			Pattern.CASE_INSENSITIVE);

	protected static final Pattern pattern = Pattern.compile("(.+) *\\: *(.+)");

	private static final Set<String> ignoreExceptions = new HashSet<>();

	static {
		ignoreExceptions.add("org.apache.catalina.connector.ClientAbortException");
	}

	@Context
	protected ServletContext servletContext;

	protected final AmbethServletAspect aspect = new AmbethServletAspect();

	private ILogger log;

	private IServiceContext beanContext;

	private volatile boolean waitForRebuild;

	private long waitForRebuildMaxDelay = 30000;

	protected final Lock writeLock = new ReentrantLock();

	private final Condition rebuildContextCond = writeLock.newCondition();

	public void setBeanContext(IServiceContext beanContext) {
		writeLock.lock();
		try {
			this.beanContext = beanContext;
			aspect.setBeanContext(beanContext);
			log = null;
			if (this.beanContext != null) {
				// notify all paused threads that we now have a valid context (again)
				rebuildContextCond.signalAll();
			}
		}
		finally {
			writeLock.unlock();
		}
	}

	public void prepareBeanContextRebuild() {
		writeLock.lock();
		try {
			setBeanContext(null);
			waitForRebuild = true;
		}
		finally {
			writeLock.unlock();
		}
	}

	protected ILogger getLog() {
		if (log == null) {
			IProperties properties = getServiceContext().getService(IProperties.class);
			log = LoggerFactory.getLogger(getClass(), properties);
		}
		return log;
	}

	@GET
	@Path("ping")
	@Produces({MediaType.TEXT_PLAIN})
	public String ping() {
		return "Ping";
	}

	@GET
	@Path("ping2")
	@Produces({MediaType.TEXT_XML})
	public ObjRef ping2() {
		ObjRef objRef = new ObjRef();
		objRef.setId(5);
		objRef.setIdNameIndex((byte) -1);
		objRef.setVersion(7);
		objRef.setRealType(CreateContainer.class);
		return objRef;
	}

	@SuppressWarnings("unchecked")
	protected <T> IList<T> createList(Class<T> targetType, List<?> list) {
		ArrayList<T> targetList = new ArrayList<>(list.size());
		for (int a = 0, size = list.size(); a < size; a++) {
			targetList.add((T) list.get(a));
		}
		return targetList;
	}

	/**
	 *
	 * @return The singleton IServiceContext which is stored in the context of the servlet
	 */
	protected IServiceContext getServiceContext() {
		writeLock.lock();
		try {
			IServiceContext serviceContext = beanContext;
			long waitUpTo = System.currentTimeMillis() + waitForRebuildMaxDelay;
			while (serviceContext == null && waitForRebuild) {
				try {
					long waitTime = waitUpTo - System.currentTimeMillis();
					if (waitTime <= 0) {
						waitForRebuild = false;
						break;
					}
					rebuildContextCond.await(waitUpTo, TimeUnit.MILLISECONDS);
				}
				catch (InterruptedException e) {
					Thread.interrupted(); // clear interrupted flag
					continue;
				}
				serviceContext = beanContext;
			}
			if (serviceContext != null) {
				return serviceContext;
			}
		}
		finally {
			writeLock.unlock();
		}
		return (IServiceContext) servletContext
				.getAttribute(AmbethServletListener.ATTRIBUTE_I_SERVICE_CONTEXT);
	}

	protected IStateRollback preServiceCall(final HttpServletRequest request,
			HttpServletResponse response) {
		if (Boolean.TRUE.equals(request.getAttribute(THREAD_LOCAL_HANDLED))) {
			return NoOpStateRollback.instance;
		}
		final ILogger log = getLog();
		final String path = log.isDebugEnabled() ? request.getMethod() + " " + request.getRequestURI()
				: null;
		if (path != null) {
			log.debug("Enter: " + path);
		}
		boolean success = false;
		IStateRollback rollback = aspect.pushServletAspectWithThreadLocals(request);
		try {
			if (path != null) {
				rollback = new AbstractStateRollback(rollback) {
					@Override
					protected void rollbackIntern() throws Exception {
						log.debug("Exit:  " + path);
					}
				};
			}
			success = true;
			return rollback;
		}
		finally {
			if (!success) {
				rollback.rollback();
			}
		}
	}

	protected <T> T getService(Class<T> serviceType) {
		return getServiceContext().getService(serviceType);
	}

	protected <T> T getService(String beanName, Class<T> serviceType) {
		return getServiceContext().getService(beanName, serviceType);
	}

	protected String readSingleValueFromHeader(String name, HttpServletRequest request) {
		return request.getHeader(name);
	}

	protected List<String> readMultiValueFromHeader(String name, HttpServletRequest request) {
		Enumeration<String> headers = request.getHeaders(name);
		if (!headers.hasMoreElements()) {
			return EmptyList.<String>getInstance();
		}
		ArrayList<String> list = new ArrayList<>();
		while (headers.hasMoreElements()) {
			list.add(headers.nextElement());
		}
		return list;
	}

	protected Object[] getArguments(InputStream is, HttpServletRequest request) {
		is = decompressContentIfNecessary(is, request);

		String contentType = request.getContentType();

		Object args = null;
		if (contentType == null || "application/xml".equals(contentType)
				|| "application/xml+ambeth".equals(contentType)) {
			ICyclicXMLHandler cyclicXmlHandler = getService(XmlModule.CYCLIC_XML_HANDLER,
					ICyclicXMLHandler.class);
			args = cyclicXmlHandler.readFromStream(is);
		}
		else if ("application/json".equals(contentType)) {
			throw new NotSupportedException("'" + contentType + "' not yet supported");

			// ObjectMapper mapper = new ObjectMapper();
			// try
			// {
			// JsonNode node = mapper.readValue(is, JsonNode.class);
			// args = node;
			// }
			// catch (JsonParseException e)
			// {
			// throw new BadRequestException("JSON invalid", e);
			// }
			// catch (JsonMappingException e)
			// {
			// throw new NotSupportedException("JSON not mappable", e);
			// }
			// catch (IOException e)
			// {
			// throw new InternalServerErrorException(e);
			// }
		}
		if (args instanceof Object[]) {
			return (Object[]) args;
		}
		return new Object[] {args};
	}

	protected AmbethServiceException convertThrowable(Throwable e) {
		if (e == null) {
			return null;
		}
		AmbethServiceException result = new AmbethServiceException();
		StringBuilder sb = new StringBuilder();
		AmbethLogger.printThrowable(e, sb, "\n", 0, false);
		result.setMessage(e.getMessage());
		result.setExceptionType(e.getClass().getName());
		result.setStackTrace(sb.toString());
		result.setCause(convertThrowable(e.getCause()));
		return result;
	}

	protected StreamingOutput createExceptionResult(Throwable e, HttpServletRequest request,
			final HttpServletResponse response) {
		if (e.getClass().getName().equals(MaskingRuntimeException.class.getName())
				&& e.getMessage() == null) {
			e = e.getCause();
		}
		IServiceContext beanContext = this.beanContext;
		if (beanContext != null && beanContext.isRunning() && !beanContext.isDisposing()) {
			logException(e, null);
		}
		AmbethServiceException result = convertThrowable(e);

		int errorStatus = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
		if (e instanceof SecurityException) {
			errorStatus = HttpServletResponse.SC_FORBIDDEN;
		}
		final int fErrorStatus = errorStatus;
		final StreamingOutput streamingOutput = createResult(result, request, response);
		response.setStatus(fErrorStatus);
		return new StreamingOutput() {
			@Override
			public void write(OutputStream output) throws IOException, WebApplicationException {
				response.setStatus(fErrorStatus);
				streamingOutput.write(output);
			}
		};
	}

	protected void writeContent(OutputStream os, Object result) {
		ICyclicXMLHandler cyclicXmlHandler = getService(XmlModule.CYCLIC_XML_HANDLER,
				ICyclicXMLHandler.class);
		cyclicXmlHandler.writeToStream(os, result);
	}

	protected StreamingOutput createResult(Object result, HttpServletRequest request,
			HttpServletResponse response) {
		return createResult(result, request, response, null, true);
	}

	protected StreamingOutput createSynchronousResult(Object result, HttpServletRequest request,
			HttpServletResponse response) {
		StreamingOutput asyncOutput = createResult(result, request, response, null, false);
		final FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
		try {
			asyncOutput.write(bos);
			return new StreamingOutput() {
				@Override
				public void write(OutputStream output) throws IOException, WebApplicationException {
					bos.writeTo(output);
				}
			};
		}
		catch (Exception e) {
			throw RuntimeExceptionUtil.mask(e);
		}
	}

	protected StreamingOutput createResult(final Object result, HttpServletRequest request,
			final HttpServletResponse response,
			final IBackgroundWorkerParamDelegate<Throwable> streamingFinishedCallback,
			final boolean cleanupOnFinally) {
		final String contentEncoding = evaluateAcceptedContentEncoding(request, response);
		return new StreamingOutput() {
			@Override
			public void write(OutputStream output) throws IOException, WebApplicationException {
				response.setHeader(HttpHeaders.CONTENT_ENCODING, contentEncoding);
				if (gzipEncoding.equals(contentEncoding)) {
					output = new GZIPOutputStream(output);
				}
				else if (deflateEncoding.equals(contentEncoding)) {
					output = new DeflaterOutputStream(output);
				}
				try {
					writeContent(output, result);
					if (output instanceof DeflaterOutputStream) {
						((DeflaterOutputStream) output).finish();
					}
					if (streamingFinishedCallback != null) {
						streamingFinishedCallback.invoke(null);
					}
				}
				catch (Throwable e) {
					if (streamingFinishedCallback != null) {
						try {
							streamingFinishedCallback.invoke(e);
						}
						catch (Throwable e1) {
							// intended blank
						}
					}
					ILogger log = getLog();
					if (log.isErrorEnabled()) {
						// Reconstruct written stream for debugging purpose
						final StringBuilder sb = new StringBuilder();
						try {
							writeContent(new OutputStream() {
								@Override
								public void write(int b) throws IOException {
									sb.append(b);
								}

								@Override
								public void flush() throws IOException {
									// Intended blank
								}
							}, result);
						}
						catch (RuntimeException ex) {
							// Intended blank
						}
						logException(e, sb);
					}
					if (e instanceof IOException) {
						throw (IOException) e; // no need to mask IOException because of the write() signature
					}
					throw RuntimeExceptionUtil.mask(e);
				}
				finally {
					if (cleanupOnFinally) {
						getService(IThreadLocalCleanupController.class).cleanupThreadLocal();
					}
				}
			}
		};
	}

	protected String evaluateAcceptedContentEncoding(HttpServletRequest request,
			HttpServletResponse response) {
		List<String> acceptEncoding = readMultiValueFromHeader(ACCEPT_ENCODING_WORKAROUND, request);
		if (acceptEncoding.isEmpty()) {
			acceptEncoding = readMultiValueFromHeader(HttpHeaders.ACCEPT_ENCODING, request);
		}
		for (int a = acceptEncoding.size(); a-- > 0;) {
			acceptEncoding.set(a, acceptEncoding.get(a).toLowerCase());
		}
		if (acceptEncoding.contains(deflateEncoding)) {
			response.setHeader(HttpHeaders.CONTENT_ENCODING, deflateEncoding);
			return deflateEncoding;
		}
		else if (acceptEncoding.contains(gzipEncoding)) {
			response.setHeader(HttpHeaders.CONTENT_ENCODING, gzipEncoding);
			return gzipEncoding;
		}
		return "text/xml";
	}

	protected InputStream decompressContentIfNecessary(InputStream is, HttpServletRequest request) {
		String contentEncoding = readSingleValueFromHeader("Content-Encoding-Workaround", request);
		if (contentEncoding == null || contentEncoding.length() == 0) {
			contentEncoding = readSingleValueFromHeader(HttpHeaders.CONTENT_ENCODING, request);
		}
		if (contentEncoding == null) {
			contentEncoding = "";
		}
		contentEncoding = contentEncoding.toLowerCase();
		if (deflateEncoding.equals(contentEncoding)) {
			return new InflaterInputStream(is);
		}
		else if (gzipEncoding.equals(contentEncoding)) {
			try {
				return new GZIPInputStream(is);
			}
			catch (IOException e) {
				throw RuntimeExceptionUtil.mask(e);
			}
		}
		return is;
	}

	protected void logException(Throwable e, StringBuilder sb) {
		if (e instanceof MaskingRuntimeException) {
			MaskingRuntimeException mre = (MaskingRuntimeException) e;
			if (mre.getMessage() == null) {
				logException(e.getCause(), sb);
				return;
			}
		}
		if (ignoreExceptions.contains(e.getClass().getName())) {
			return;
		}
		ILogger log = getLog();
		if (log.isErrorEnabled()) {
			if (sb != null) {
				log.error(sb.toString(), e);
			}
			else {
				log.error(e);
			}
		}
	}
}


text:
package loadbalancer

import (
	"fmt"
	"net"
	"testing"
	"time"

	"golang.org/x/net/context"

	"github.com/go-kit/kit/endpoint"
)

func TestDNSSRVPublisher(t *testing.T) {
	// Reset the vars when we're done
	oldResolve := resolve
	defer func() { resolve = oldResolve }()
	oldNewTicker := newTicker
	defer func() { newTicker = oldNewTicker }()

	// Set up a fixture and swap the vars
	a := []*net.SRV{
		{Target: "foo", Port: 123},
		{Target: "bar", Port: 456},
		{Target: "baz", Port: 789},
	}
	ticker := make(chan time.Time)
	resolve = func(string) ([]*net.SRV, string, error) { return a, fmt.Sprint(len(a)), nil }
	newTicker = func(time.Duration) *time.Ticker { return &time.Ticker{C: ticker} }

	// Construct endpoint
	m := map[string]int{}
	e := func(hostport string) endpoint.Endpoint {
		return func(context.Context, interface{}) (interface{}, error) {
			m[hostport]++
			return struct{}{}, nil
		}
	}

	// Build the publisher
	var (
		name         = "irrelevant"
		ttl          = time.Second
		makeEndpoint = func(hostport string) endpoint.Endpoint { return e(hostport) }
	)
	p := NewDNSSRVPublisher(name, ttl, makeEndpoint)
	defer p.Stop()

	// Subscribe
	c := make(chan []endpoint.Endpoint, 1)
	p.Subscribe(c)
	defer p.Unsubscribe(c)

	// Invoke all of the endpoints
	for _, e := range <-c {
		e(context.Background(), struct{}{})
	}

	// Make sure we invoked what we expected to
	for _, addr := range a {
		hostport := addr2hostport(addr)
		if want, have := 1, m[hostport]; want != have {
			t.Errorf("%q: want %d, have %d", name, want, have)
		}
		delete(m, hostport)
	}
	if want, have := 0, len(m); want != have {
		t.Errorf("want %d, have %d", want, have)
	}

	// Reset the fixture, trigger the timer, count the endpoints
	a = []*net.SRV{}
	ticker <- time.Now()
	if want, have := len(a), len(<-c); want != have {
		t.Errorf("want %d, have %d", want, have)
	}
}


text:
package com.linecorp.armeria.server;

import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;

import com.linecorp.armeria.common.Request;
import com.linecorp.armeria.common.http.AggregatedHttpMessage;
import com.linecorp.armeria.common.http.HttpHeaders;
import com.linecorp.armeria.common.http.HttpRequest;
import com.linecorp.armeria.common.http.HttpResponse;
import com.linecorp.armeria.common.http.HttpResponseWriter;
import com.linecorp.armeria.common.http.HttpStatus;
import com.linecorp.armeria.common.util.CompletionActions;
import com.linecorp.armeria.common.util.Exceptions;
import com.linecorp.armeria.server.http.AbstractHttpService;
import com.linecorp.armeria.server.logging.LoggingService;
import com.linecorp.armeria.testing.common.AnticipatedException;
import com.linecorp.armeria.testing.server.ServerRule;

import io.netty.handler.codec.http.HttpStatusClass;
import io.netty.util.concurrent.DefaultEventExecutorGroup;
import io.netty.util.concurrent.EventExecutorGroup;

public class ServerTest {

    private static final long processDelayMillis = 1000;
    private static final long requestTimeoutMillis = 500;
    private static final long idleTimeoutMillis = 500;

    private static final EventExecutorGroup asyncExecutorGroup = new DefaultEventExecutorGroup(1);

    @ClassRule
    public static final ServerRule server = new ServerRule() {
        @Override
        protected void configure(ServerBuilder sb) throws Exception {

            final Service<HttpRequest, HttpResponse> immediateResponseOnIoThread =
                    new EchoService().decorate(LoggingService.newDecorator());

            final Service<HttpRequest, HttpResponse> delayedResponseOnIoThread = new EchoService() {
                @Override
                protected void echo(AggregatedHttpMessage aReq, HttpResponseWriter res) {
                    try {
                        Thread.sleep(processDelayMillis);
                        super.echo(aReq, res);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }.decorate(LoggingService.newDecorator());

            final Service<HttpRequest, HttpResponse> lazyResponseNotOnIoThread = new EchoService() {
                @Override
                protected void echo(AggregatedHttpMessage aReq, HttpResponseWriter res) {
                    asyncExecutorGroup.schedule(
                            () -> super.echo(aReq, res), processDelayMillis, TimeUnit.MILLISECONDS);
                }
            }.decorate(LoggingService.newDecorator());

            final Service<HttpRequest, HttpResponse> buggy = new AbstractHttpService() {
                @Override
                protected void doPost(ServiceRequestContext ctx,
                                      HttpRequest req, HttpResponseWriter res) throws Exception {

                    throw Exceptions.clearTrace(new AnticipatedException("bug!"));
                }
            }.decorate(LoggingService.newDecorator());

            sb.service("/", immediateResponseOnIoThread)
              .service("/delayed", delayedResponseOnIoThread)
              .service("/timeout", lazyResponseNotOnIoThread)
              .service("/timeout-not", lazyResponseNotOnIoThread)
              .service("/buggy", buggy);

            // Disable request timeout for '/timeout-not' only.
            final Function<Service<HttpRequest, HttpResponse>, Service<HttpRequest, HttpResponse>> decorator =
                    s -> new SimpleDecoratingService<HttpRequest, HttpResponse>(s) {
                        @Override
                        public HttpResponse serve(ServiceRequestContext ctx, HttpRequest req) throws Exception {
                            ctx.setRequestTimeoutMillis(
                                    "/timeout-not".equals(ctx.path()) ? 0 : requestTimeoutMillis);
                            return delegate().serve(ctx, req);
                        }
                    };

            sb.decorator(decorator);

            sb.idleTimeoutMillis(idleTimeoutMillis);
        }
    };

    /**
     * Ensures that the {@link Server} is always started when a test begins. This is necessary even if we
     * enabled auto-start for {@link ServerRule} because we stop it in {@link #testStartStop()}.
     */
    @Before
    public void startServer() {
        server.start();
    }

    @Test
    public void testStartStop() throws Exception {
        final Server server = ServerTest.server.server();
        assertThat(server.activePorts().size(), is(1));
        server.stop().get();
        assertThat(server.activePorts().size(), is(0));
    }

    @Test
    public void testInvocation() throws Exception {
        testInvocation0("/");
    }

    @Test
    public void testDelayedResponseApiInvocationExpectedTimeout() throws Exception {
        testInvocation0("/delayed");
    }

    private static void testInvocation0(String path) throws IOException {
        try (CloseableHttpClient hc = HttpClients.createMinimal()) {
            final HttpPost req = new HttpPost(server.uri(path));
            req.setEntity(new StringEntity("Hello, world!", StandardCharsets.UTF_8));

            try (CloseableHttpResponse res = hc.execute(req)) {
                assertThat(res.getStatusLine().toString(), is("HTTP/1.1 200 OK"));
                assertThat(EntityUtils.toString(res.getEntity()), is("Hello, world!"));
            }
        }
    }

    @Test
    public void testRequestTimeoutInvocation() throws Exception {
         try (CloseableHttpClient hc = HttpClients.createMinimal()) {
            final HttpPost req = new HttpPost(server.uri("/timeout"));
            req.setEntity(new StringEntity("Hello, world!", StandardCharsets.UTF_8));

            try (CloseableHttpResponse res = hc.execute(req)) {
                assertThat(HttpStatusClass.valueOf(res.getStatusLine().getStatusCode()),
                           is(not(HttpStatusClass.SUCCESS)));
            }
        }
    }

    @Test
    public void testDynamicRequestTimeoutInvocation() throws Exception {
        try (CloseableHttpClient hc = HttpClients.createMinimal()) {
            final HttpPost req = new HttpPost(server.uri("/timeout-not"));
            req.setEntity(new StringEntity("Hello, world!", StandardCharsets.UTF_8));

            try (CloseableHttpResponse res = hc.execute(req)) {
                assertThat(HttpStatusClass.valueOf(res.getStatusLine().getStatusCode()),
                           is(HttpStatusClass.SUCCESS));
            }
        }
    }

    @Test(timeout = idleTimeoutMillis * 5)
    public void testIdleTimeoutByNoContentSent() throws Exception {
        try (Socket socket = new Socket()) {
            socket.setSoTimeout((int) (idleTimeoutMillis * 4));
            socket.connect(server.httpSocketAddress());
            long connectedNanos = System.nanoTime();
            //read until EOF
            while (socket.getInputStream().read() != -1) {
                continue;
            }
            long elapsedTimeMillis = TimeUnit.MILLISECONDS.convert(
                    System.nanoTime() - connectedNanos, TimeUnit.NANOSECONDS);
            assertThat(elapsedTimeMillis, is(greaterThanOrEqualTo(idleTimeoutMillis)));
        }
    }

    @Test(timeout = idleTimeoutMillis * 5)
    public void testIdleTimeoutByContentSent() throws Exception {
        try (Socket socket = new Socket()) {
            socket.setSoTimeout((int) (idleTimeoutMillis * 4));
            socket.connect(server.httpSocketAddress());
            PrintWriter outWriter = new PrintWriter(socket.getOutputStream(), false);
            outWriter.print("POST / HTTP/1.1\r\n");
            outWriter.print("Connection: Keep-Alive\r\n");
            outWriter.print("\r\n");
            outWriter.flush();

            long lastWriteNanos = System.nanoTime();
            //read until EOF
            while (socket.getInputStream().read() != -1) {
                continue;
            }

            long elapsedTimeMillis = TimeUnit.MILLISECONDS.convert(
                    System.nanoTime() - lastWriteNanos, TimeUnit.NANOSECONDS);
            assertThat(elapsedTimeMillis, is(greaterThanOrEqualTo(idleTimeoutMillis)));
        }
    }

    /**
     * Ensure that the connection is not broken even if {@link Service#serve(ServiceRequestContext, Request)}
     * raises an exception.
     */
    @Test(timeout = idleTimeoutMillis * 5)
    public void testBuggyService() throws Exception {
        try (Socket socket = new Socket()) {
            socket.setSoTimeout((int) (idleTimeoutMillis * 4));
            socket.connect(server.httpSocketAddress());
            PrintWriter outWriter = new PrintWriter(socket.getOutputStream(), false);

            // Send a request to a buggy service whose invoke() raises an exception.
            // If the server handled the exception correctly (i.e. responded with 500 Internal Server Error and
            // recovered from the exception successfully), then the connection should not be closed immediately
            // but on the idle timeout of the second request.
            outWriter.print("POST /buggy HTTP/1.1\r\n");
            outWriter.print("Connection: Keep-Alive\r\n");
            outWriter.print("Content-Length: 0\r\n");
            outWriter.print("\r\n");
            outWriter.print("POST / HTTP/1.1\r\n");
            outWriter.print("Connection: Keep-Alive\r\n");
            outWriter.print("\r\n");
            outWriter.flush();

            long lastWriteNanos = System.nanoTime();
            //read until EOF
            while (socket.getInputStream().read() != -1) {
                continue;
            }

            long elapsedTimeMillis = TimeUnit.MILLISECONDS.convert(
                    System.nanoTime() - lastWriteNanos, TimeUnit.NANOSECONDS);
            assertThat(elapsedTimeMillis, is(greaterThanOrEqualTo(idleTimeoutMillis)));
        }
    }

    @Test
    public void testOptions() throws Exception {
        testSimple("OPTIONS * HTTP/1.1", "HTTP/1.1 200 OK",
                   "allow: OPTIONS,GET,HEAD,POST,PUT,PATCH,DELETE,TRACE");
    }

    @Test
    public void testInvalidPath() throws Exception {
        testSimple("GET * HTTP/1.1", "HTTP/1.1 400 Bad Request");
    }

    private static void testSimple(
            String reqLine, String expectedStatusLine, String... expectedHeaders) throws Exception {

        try (Socket socket = new Socket()) {
            socket.setSoTimeout((int) (idleTimeoutMillis * 4));
            socket.connect(server.httpSocketAddress());
            PrintWriter outWriter = new PrintWriter(socket.getOutputStream(), false);

            outWriter.print(reqLine);
            outWriter.print("\r\n");
            outWriter.print("Connection: close\r\n");
            outWriter.print("Content-Length: 0\r\n");
            outWriter.print("\r\n");
            outWriter.flush();

            BufferedReader in = new BufferedReader(new InputStreamReader(
                    socket.getInputStream(), StandardCharsets.US_ASCII));

            assertThat(in.readLine(), is(expectedStatusLine));
            // Read till the end of the connection.
            List<String> headers = new ArrayList<>();
            for (;;) {
                String line = in.readLine();
                if (line == null) {
                    break;
                }

                // This is not really correct, but just wanna make it as simple as possible.
                headers.add(line);
            }

            for (String expectedHeader : expectedHeaders) {
                if (!headers.contains(expectedHeader)) {
                    fail("does not contain '" + expectedHeader + "': " + headers);
                }
            }
        }
    }

    private static class EchoService extends AbstractHttpService {
        @Override
        protected final void doPost(ServiceRequestContext ctx, HttpRequest req, HttpResponseWriter res) {
            req.aggregate()
               .thenAccept(aReq -> echo(aReq, res))
               .exceptionally(CompletionActions::log);
        }

        protected void echo(AggregatedHttpMessage aReq, HttpResponseWriter res) {
            res.write(HttpHeaders.of(HttpStatus.OK));
            res.write(aReq.content());
            res.close();
        }
    }
}


text:
package org.topicquests.solr;

import org.apache.solr.common.SolrInputDocument;
import org.apache.uima.jcas.tcas.Annotation;

public interface DocumentAdderDelegate {

	public void addToDocument(Annotation annotation,SolrInputDocument doc);
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping
                  http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">

    <entity name="Cubalider\Component\Mobile\Model\CollectionMobile" table="collections_mobiles">
        <id name="id" type="integer">
            <generator strategy="AUTO"/>
        </id>

        <many-to-one field="mobile" target-entity="Cubalider\Component\Mobile\Model\Mobile">
            <join-column referenced-column-name="number"/>
        </many-to-one>
        <many-to-one field="collection" target-entity="Cubalider\Component\Mobile\Model\Collection">
            <join-column referenced-column-name="id"/>
        </many-to-one>
    </entity>

</doctrine-mapping>


text:
<?php

namespace ZendPdf\Annotation;

use ZendPdf as Pdf;
use ZendPdf\Exception;
use ZendPdf\InternalType;

/**
 * A file attachment annotation contains a reference to a file,
 * which typically is embedded in the PDF file.
 *
 * @package    Zend_PDF
 * @subpackage Zend_PDF_Annotation
 */
class FileAttachment extends AbstractAnnotation
{
    /**
     * Annotation object constructor
     *
     * @throws \ZendPdf\Exception\ExceptionInterface
     */
    public function __construct(InternalType\AbstractTypeObject $annotationDictionary)
    {
        if ($annotationDictionary->getType() != InternalType\AbstractTypeObject::TYPE_DICTIONARY) {
            throw new Exception\CorruptedPdfException('Annotation dictionary resource has to be a dictionary.');
        }

        if ($annotationDictionary->Subtype === null  ||
            $annotationDictionary->Subtype->getType() != InternalType\AbstractTypeObject::TYPE_NAME  ||
            $annotationDictionary->Subtype->value != 'FileAttachment') {
            throw new Exception\CorruptedPdfException('Subtype => FileAttachment entry is requires');
        }

        parent::__construct($annotationDictionary);
    }

    /**
     * Create link annotation object
     *
     * @param float $x1
     * @param float $y1
     * @param float $x2
     * @param float $y2
     * @param string $fileSpecification
     * @return \ZendPdf\Annotation\FileAttachment
     */
    public static function create($x1, $y1, $x2, $y2, $fileSpecification)
    {
        $annotationDictionary = new InternalType\DictionaryObject();

        $annotationDictionary->Type    = new InternalType\NameObject('Annot');
        $annotationDictionary->Subtype = new InternalType\NameObject('FileAttachment');

        $rectangle = new InternalType\ArrayObject();
        $rectangle->items[] = new InternalType\NumericObject($x1);
        $rectangle->items[] = new InternalType\NumericObject($y1);
        $rectangle->items[] = new InternalType\NumericObject($x2);
        $rectangle->items[] = new InternalType\NumericObject($y2);
        $annotationDictionary->Rect = $rectangle;

        $fsDictionary = new InternalType\DictionaryObject();
        $fsDictionary->Type = new InternalType\NameObject('Filespec');
        $fsDictionary->F    = new InternalType\StringObject($fileSpecification);

        $annotationDictionary->FS = $fsDictionary;

        return new self($annotationDictionary);
    }
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Surf & Paddle Company  - Pixel Perfect Replica</title>
    <link href="https://fonts.googleapis.com/css?family=Oswald|Open+Sans" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
    <link rel="stylesheet" href="assets/stylesheets/main.css">

            Surf & Paddle Co. Blog

About

Search

Surf & Paddle Co.

An Ironyard Academy Project Est. Fall 2013

A fantastic engaging headline goes here

Anne Marie

on <time datetime="2013-10-07T09:22Z">Monday, Oct. 7th 9:22pm</time>

Locavore ea meggings, deep v gentrify bespoke butcher yr typewriter. Nisi sunt 8-bit craft beer, leggings deep v biodiesel Williamsburg. Actually hashtag art party nesciunt squid pour-over. Kitsch Vice cray, Marfa brunch fingerstache oficcia Schlitz Blue Bottle cillum. Mlkshk 8-bit aliquip fingerstache sunt.

Distillery ad sriracha, synth wolf street art brunch excepteur consectetur art party irony fugiat. Duis chia yr, pour-over Portland velit High Life non aesthetic fugiat tattoed shabby chic mixtape.

  Woah, that's radical!

Swag nisi mixtape cray, non hashtag blog tote bag lolor bitters before they sold out ea dolore. Raw denim mistape drinking vinegar, Vice 3 wolf moon authentic officia aute id. Keffiyeh yr retro, salvia do alique(rollover) leggings selvage narwhal farm-to-table dolor Tonx DIY photo booth. Bitters gastropub non 3 wolf moon Blue Bottle organic, cray aesthetic jean shorts velit umami. Mlkshk roof party cardigan, farm-to-table aute plaid wolf master cleanse. Thundercats tattoed lo-fi culpa, mollit Pinterest American Apparel. 3 wolf moon VHS hella, Tonx beard chambray sustainable jean shorts synth mlkshk fugiat excepteur banh mi eu whatever.

Vinyl sartorial culpa bespoke labore, ethical redymade tofu selfies ut locavore commodo mumblecore paleo typewriter. Mumblecore selfies nostrud, asymmetrcial 90's fannypack est Blue Bottle ethnic blog. Narwhal Shoreditch fixie tofu, nisi before.

            Read Comments

            Read Later

            Share This Post

<sidebar>

Anne Marie

Twitter

 Facbook

 Instagram

About This Ad

Sidebar Section Heading

Distillery ad sriracha, synth wolf street art brunch excepteur consectetur art party irony fugiat. Duis chia yr, pour-over Portland velit High Life non aesthetic fugiat tattoed shabby chic mixtape.ethical cornhole mustache roof party proident aesthetic hoodie.

      </sidebar>

Most Popular Posts

Another Cool Post

Post Title

Here's Another
 Longer Post Title

Oh Cool A Post!

          The Ironyard Copyright 2013, All Rights Reserved

Nav Item 1

Nav Item 2

Nav Item 3

Nav Item 5


text:
    <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" />
    <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" />
    <title>IniReader.GetCommentDelimiters Method</title>
    <xml>
    </xml>
    <link rel="stylesheet" type="text/css" href="MSDN.css" />

            Nini Library API Reference - http://nini.sourceforge.net/

IniReader.GetCommentDelimiters Method

Returns the comment delimiters.

public char[] GetCommentDelimiters();

Remarks

 The default value is a semicolon (';').

See Also

        IniReader Class | Nini.Ini Namespace

      <object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e" viewastext="true" style="display: none;">
        <param name="Keyword" value="GetCommentDelimiters method">
        </param>
        <param name="Keyword" value="GetCommentDelimiters method, IniReader class">
        </param>
        <param name="Keyword" value="IniReader.GetCommentDelimiters method">
        </param>
      </object>

          Copyright (c) 2006 Brent R. Matzelle


text:
layout: default
showcase: true
<!-- date: 2017-02-05 -->
img: submarine.png
alt: Colorophone logo. 3 fjerdedeler av en sirkel som er delt opp i 3  Med fargene blå, rød og grønn.
project-date: Våren 2017
client: Colorophone Bachellor project, NTNU
category: Apputvikling
description:
link: "#"
---


text:
"""Thermostat endpoint.

This endpoint module corresponds to the
"Thermostat" Matter device type which defines required and optional clusters
in the Matter spec 1.0.

A Thermostat endpoint houses an instance of Thermostat Matter device type with
the following defined clusters on this endpoint:

The required clusters for this endpoint: Thermostat.
The optional clusters for this endpoint: Groups, Scenes, Alarms,
Thermostat User Interface Configuration, Relative Humidity Measurement,
Fan Control, Time, TimeSync, Temperature Measurement, Occupancy Sensing.
"""
from typing import Union

from gazoo_device import decorators
from gazoo_device.capabilities import matter_enums
from gazoo_device.capabilities.matter_clusters import occupancy_sensing_chip_tool
from gazoo_device.capabilities.matter_clusters import occupancy_sensing_pw_rpc
from gazoo_device.capabilities.matter_clusters import relative_humidity_measurement_pw_rpc
from gazoo_device.capabilities.matter_clusters import temperature_measurement_pw_rpc
from gazoo_device.capabilities.matter_clusters import thermostat_chip_tool
from gazoo_device.capabilities.matter_clusters import thermostat_pw_rpc
from gazoo_device.capabilities.matter_endpoints.interfaces import thermostat_base

class ThermostatEndpoint(thermostat_base.ThermostatBase):
  """Matter Thermostat endpoint."""

  @decorators.CapabilityDecorator([
      thermostat_chip_tool.ThermostatClusterChipTool,
      thermostat_pw_rpc.ThermostatClusterPwRpc
  ])
  def thermostat(
      self
  ) -> Union[thermostat_chip_tool.ThermostatClusterChipTool,
             thermostat_pw_rpc.ThermostatClusterPwRpc]:
    """Matter Thermostat cluster instance."""
    return self.cluster_lazy_init(matter_enums.ThermostatCluster.ID)

  @decorators.CapabilityDecorator(
      relative_humidity_measurement_pw_rpc.
      RelativeHumidityMeasurementClusterPwRpc)
  def relative_humidity_measurement(
      self) -> (relative_humidity_measurement_pw_rpc.
                RelativeHumidityMeasurementClusterPwRpc):
    """Matter Relative Humidity Measurement cluster instance."""
    return self.cluster_lazy_init(
        matter_enums.RelativeHumidityMeasurementCluster.ID)

  @decorators.CapabilityDecorator(
      temperature_measurement_pw_rpc.TemperatureMeasurementClusterPwRpc)
  def temperature_measurement(
      self
  ) -> temperature_measurement_pw_rpc.TemperatureMeasurementClusterPwRpc:
    """Matter Temperature Measurement cluster instance."""
    return self.cluster_lazy_init(matter_enums.TemperatureMeasurementCluster.ID)

  @decorators.CapabilityDecorator([
      occupancy_sensing_chip_tool.OccupancySensingClusterChipTool,
      occupancy_sensing_pw_rpc.OccupancySensingClusterPwRpc
  ])
  def occupancy_sensing(
      self
  ) -> Union[occupancy_sensing_chip_tool.OccupancySensingClusterChipTool,
             occupancy_sensing_pw_rpc.OccupancySensingClusterPwRpc]:
    """Matter Occupancy Sensing cluster instance."""
    return self.cluster_lazy_init(matter_enums.OccupancySensingCluster.ID)

  # TODO(b/239741839): add optional clusters below
  # def scenes(self):
  #   """Matter scenes cluster instance."""

  # def groups(self):
  #   """Matter groups cluster instance."""

  # def alarms(self):
  #   """Matter alarms cluster instance."""

  # def thermostat_user_interface_configuration(self):
  #   """Matter thermostat UI configuration cluster instance."""

  # def time(self):
  #   """Matter time cluster instance."""

  # def time_sync(self):
  #   """Matter time sync cluster instance."""

  # def fan_control(self):
  #   """Matter fan control cluster instance."""


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (C) 2011 Andrey Yeremenok (eav1986__at__gmail__com)
~
~ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>formbuilder-parent</artifactId>
        <groupId>org.formbuilder</groupId>
        <version>1.2-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>formbuilder-scala</artifactId>
    <packaging>jar</packaging>
    <!-- -->
    <repositories>
        <repository>
            <id>scala-tools.org</id>
            <name>Scala-Tools Maven2 Repository</name>
            <url>http://scala-tools.org/repo-releases</url>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>scala-tools.org</id>
            <name>Scala-Tools Maven2 Repository</name>
            <url>http://scala-tools.org/repo-releases</url>
        </pluginRepository>
    </pluginRepositories>
    <!-- -->
    <build>
        <plugins>
            <plugin>
                <groupId>org.scala-tools</groupId>
                <artifactId>maven-scala-plugin</artifactId>
                <version>2.14.1</version>
                <executions>
                    <execution>
                        <goals>
                            <!-- goal>add-source</goal -->
                            <goal>compile</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <!-- -->
    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>formbuilder-main</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>2.9.0-1</version>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-swing</artifactId>
            <version>2.9.0-1</version>
        </dependency>
    </dependencies>
</project>


text:
<?xml version="1.0" encoding="utf-8"?>
<Mustpass version="3.2.3.x">
	<!---->
	<!--/* WARNING: This is auto-generated file. Do not modify, since changes will
 * be lost! Modify the generating script instead.
 */-->
	<TestPackage name="AOSP Mustpass EGL">
		<Configuration caseListFile="egl-master.txt" commandLine="--deqp-gl-config-name=rgba8888d24s8ms0 --deqp-screen-rotation=unspecified --deqp-surface-width=256 --deqp-surface-height=256 --deqp-watchdog=disable" name="master" os="any" useForFirstEGLConfig="True"/>
	</TestPackage>
</Mustpass>


text:
package xhsun.gw2app.steve.backend.util.support.vault;

/**
 * Receive query text from {@link QueryTextCallback} and send it to apporiate {@link xhsun.gw2app.steve.backend.util.support.SearchCallback}
 *
 * @author xhsun
 * @since 2017-06-28
 */
public interface QueryTextListener {
	void notifyQueryTest(String query);
}


text:
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Component\Notifier\Bridge\Firebase\FirebaseTransportFactory;
use Symfony\Component\Notifier\Bridge\FreeMobile\FreeMobileTransportFactory;
use Symfony\Component\Notifier\Bridge\Mattermost\MattermostTransportFactory;
use Symfony\Component\Notifier\Bridge\Nexmo\NexmoTransportFactory;
use Symfony\Component\Notifier\Bridge\OvhCloud\OvhCloudTransportFactory;
use Symfony\Component\Notifier\Bridge\RocketChat\RocketChatTransportFactory;
use Symfony\Component\Notifier\Bridge\Sinch\SinchTransportFactory;
use Symfony\Component\Notifier\Bridge\Slack\SlackTransportFactory;
use Symfony\Component\Notifier\Bridge\Telegram\TelegramTransportFactory;
use Symfony\Component\Notifier\Bridge\Twilio\TwilioTransportFactory;
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
use Symfony\Component\Notifier\Transport\NullTransportFactory;

return static function (ContainerConfigurator $container) {
    $container->services()
        ->set('notifier.transport_factory.abstract', AbstractTransportFactory::class)
            ->abstract()
            ->args([service('event_dispatcher'), service('http_client')->ignoreOnInvalid()])

        ->set('notifier.transport_factory.slack', SlackTransportFactory::class)
            ->parent('notifier.transport_factory.abstract')
            ->tag('chatter.transport_factory')

        ->set('notifier.transport_factory.telegram', TelegramTransportFactory::class)
            ->parent('notifier.transport_factory.abstract')
            ->tag('chatter.transport_factory')

        ->set('notifier.transport_factory.mattermost', MattermostTransportFactory::class)
            ->parent('notifier.transport_factory.abstract')
            ->tag('chatter.transport_factory')

        ->set('notifier.transport_factory.nexmo', NexmoTransportFactory::class)
            ->parent('notifier.transport_factory.abstract')
            ->tag('texter.transport_factory')

        ->set('notifier.transport_factory.rocketchat', RocketChatTransportFactory::class)
            ->parent('notifier.transport_factory.abstract')
            ->tag('chatter.transport_factory')

        ->set('notifier.transport_factory.twilio', TwilioTransportFactory::class)
            ->parent('notifier.transport_factory.abstract')
            ->tag('texter.transport_factory')

        ->set('notifier.transport_factory.firebase', FirebaseTransportFactory::class)
            ->parent('notifier.transport_factory.abstract')
            ->tag('texter.transport_factory')

        ->set('notifier.transport_factory.freemobile', FreeMobileTransportFactory::class)
            ->parent('notifier.transport_factory.abstract')
            ->tag('texter.transport_factory')

        ->set('notifier.transport_factory.ovhcloud', OvhCloudTransportFactory::class)
            ->parent('notifier.transport_factory.abstract')
            ->tag('texter.transport_factory')

        ->set('notifier.transport_factory.sinch', SinchTransportFactory::class)
            ->parent('notifier.transport_factory.abstract')
            ->tag('texter.transport_factory')

        ->set('notifier.transport_factory.null', NullTransportFactory::class)
            ->parent('notifier.transport_factory.abstract')
            ->tag('chatter.transport_factory')
            ->tag('texter.transport_factory')
    ;
};


text:
layout: default
title: CAS - Configuration Server
category: Configuration
---

{% include variables.html %}

# Spring Cloud Configuration Server - Spring Cloud Amazon S3

Spring Cloud Configuration Server is able to use [Amazon S3](https://aws.amazon.com/s3/) to locate properties and settings.

Support is provided via the following dependency in the WAR overlay:

{% include_cached casmodule.html group="org.apereo.cas" module="cas-server-support-configuration-cloud-aws-s3" %}

Usage
The configuration modules provide here may also be used verbatim inside a CAS server overlay and do not exclusively belong to a Spring Cloud Configuration server. While this module is primarily useful when inside the Spring Cloud Configuration server, it nonetheless may also be used inside a CAS server overlay directly to fetch settings from a source.

{% include_cached casproperties.html properties="cas.spring.cloud.aws.s3" %}


text:
<?php
session_start();
//echo "filename:". $_REQUEST['fn'];
$data_file = file_get_contents($_SESSION['home'] . $_REQUEST['fn']);
//echo $data_file;
if ($_REQUEST['s'] == 1)
 echo "File salvato.";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<title>Full featured example using jQuery plugin</title>

<form method="post" action="save.php">

			<textarea id="elm1" name="elm1" class="tinymce">
              <?php echo $data_file;?>
			</textarea>

	<input type="text" value="<?php echo $_REQUEST['fn']?>" name="filename">
</form>


text:
User.inject({
	statics: {
		log: function() {
			var str = Array.create(arguments).join(' ');
			if (session && session.user)
				str = '[' + session.user.name + '] ' + str;
			app.log(str);
		},

		logError: function(title, e) {
			var shortDesc = (e.fileName
				? 'Error in ' + e.fileName + ', Line ' + e.lineNumber
				: 'Error')
					+ ' (' + title + '): ' + e;
			// In some situations, the global req object might not be available,
			// so make sure we check to not produce another error.
			if (global.req && req.path)
				shortDesc += '\n(' + req.path + ')';
			// Generate the stacktrace:
			var longDesc = shortDesc;
			if (e.javaException) {
				var sw = new java.io.StringWriter();
				e.javaException.printStackTrace(new java.io.PrintWriter(sw));
				longDesc += '\nStacktrace:\n' + sw.toString();
			}
			User.log(longDesc);
			var from = app.properties.errorFromAddress
					|| app.properties.serverAddress;
			var to = app.properties.errorToAddress;
			if (from && to) {
				try {
					// Send an error mail:
					var mail = new Mail();
					mail.setFrom(from);
					mail.setTo(to);
					mail.setSubject('[' + new Date().format(
							'yyyy/MM/dd HH:mm:ss') + '] ' + title);
					if (session.user != null)
						longDesc = '[' + session.user.name + '] ' + longDesc;
					mail.addText(longDesc);
					mail.send();
				} catch (e) {
				}
			}
			return shortDesc;
		},

		getHost: function() {
			var host = req.data.http_remotehost;
			var address = java.net.InetAddress.getByName(host);
			var name = address && address.getCanonicalHostName();
			return name || host;
		}
	}
});


text:
<?php

namespace InstantSoin\OrderBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class OrderBundle extends Bundle
{
}


text:
#ifndef EVOLVE_TIMER_H
#define EVOLVE_TIMER_H

#ifdef WIN32
#include <windows.h>
#else
#include <ctime>
#endif

namespace evolve {
    namespace utils {
        class Timer {
        public:
            inline explicit Timer() {
#ifdef WIN32
            	QueryPerformanceFrequency(&frequency);
#endif
                reset();
            }
            inline ~Timer() {}
            inline void reset() {
#ifdef WIN32
            	QueryPerformanceCounter(&start);
#else
                start = std::clock();
#endif
            }
#ifdef WIN32
            inline double getSeconds() const {
            	LARGE_INTEGER current;
            	QueryPerformanceCounter(&current);
                return (current.QuadPart - start.QuadPart) / static_cast<double>(frequency.QuadPart);
            }
            inline double getMilliseconds() const {
            	LARGE_INTEGER current;
            	QueryPerformanceCounter(&current);
                return ((current.QuadPart - start.QuadPart)*1000) / static_cast<double>(frequency.QuadPart);
            }
            inline double getMicroseconds() const {
            	LARGE_INTEGER current;
            	QueryPerformanceCounter(&current);
                return ((current.QuadPart - start.QuadPart)*1000000) / static_cast<double>(frequency.QuadPart);
            }
#else
            inline double getSeconds() const {
                return ((double) (std::clock()-start))/((double) CLOCKS_PER_SEC);
            }
            inline double getMilliseconds() const {
            	return (unsigned long) (((double) (std::clock()-start))* ((1000.0) / ((double) CLOCKS_PER_SEC)));
            }
            inline double getMicroseconds() const {
                return (unsigned long) (((double) (std::clock()-start))* ((1000000.0) / ((double) CLOCKS_PER_SEC)));
            }
#endif
        private:
#ifdef WIN32
        	LARGE_INTEGER frequency;
        	LARGE_INTEGER start;
#else
            unsigned long start;
#endif
        };
    }
}

#endif


text:
using namespace Supernova;

bool UserSettings::getBoolForKey(const char *key){
    return getBoolForKey(key, false);
}

int UserSettings::getIntegerForKey(const char *key){
    return getIntegerForKey(key, 0);
}

long UserSettings::getLongForKey(const char *key){
    return getLongForKey(key, 0);
}

float UserSettings::getFloatForKey(const char *key){
    return getFloatForKey(key, 0);
}

double UserSettings::getDoubleForKey(const char *key){
    return getDoubleForKey(key, 0);
}

std::string UserSettings::getStringForKey(const char *key){
    return getStringForKey(key, "");
}

Data UserSettings::getDataForKey(const char *key){
    return getDataForKey(key, Data());
}

bool UserSettings::getBoolForKey(const char *key, bool defaultValue){
    return System::instance().getBoolForKey(key, defaultValue);
}

int UserSettings::getIntegerForKey(const char *key, int defaultValue){
    return System::instance().getIntegerForKey(key, defaultValue);
}

long UserSettings::getLongForKey(const char *key, long defaultValue){
    return System::instance().getLongForKey(key, defaultValue);
}

float UserSettings::getFloatForKey(const char *key, float defaultValue){
    return System::instance().getFloatForKey(key, defaultValue);
}

double UserSettings::getDoubleForKey(const char *key, double defaultValue){
    return System::instance().getDoubleForKey(key, defaultValue);
}

std::string UserSettings::getStringForKey(const char *key, std::string defaultValue){
    return System::instance().getStringForKey(key, defaultValue);
}

Data UserSettings::getDataForKey(const char *key, const Data& defaultValue){
    return System::instance().getDataForKey(key, defaultValue);
}

void UserSettings::setBoolForKey(const char *key, bool value){
    System::instance().setBoolForKey(key, value);
}

void UserSettings::setIntegerForKey(const char *key, int value){
    System::instance().setIntegerForKey(key, value);
}

void UserSettings::setLongForKey(const char *key, long value){
    System::instance().setLongForKey(key, value);
}

void UserSettings::setFloatForKey(const char *key, float value){
    System::instance().setFloatForKey(key, value);
}

void UserSettings::setDoubleForKey(const char *key, double value){
    System::instance().setDoubleForKey(key, value);
}

void UserSettings::setStringForKey(const char* key, std::string value){
    System::instance().setStringForKey(key, value);
}

void UserSettings::setDataForKey(const char *key, Data& value){
    System::instance().setDataForKey(key, value);
}

void UserSettings::removeKey(const char *key){
    System::instance().removeKey(key);
}


text:
<?php

class M_data extends CI_Model{

//-------JTable 08/06/2016------//
	/*
	public function grid($params)
	{
		return $this->db->get('tb_bookmark');
	}

	public function add($data)
	{
		return $this->db->insert('tb_bookmark', $data);
	}

	public function edit($key, $data)
	{
		return $this->db->update('tb_bookmark', $data, $key);
	}

	public function delete($key)
	{
		return $this->db->delete('tb_bookmark',$key);
	}
} */

/*	function ambil_data(){
		return $this->db->get('tb_bookmark'); //contoh 'user'
		/*syntax $this->db->get()
		di gunakan untuk mengambil data dari database.
		dan nama table yang ingin di ambil datanya
		letakkan dalam parameternya */
/*	}

	function input_data($data,$table){
		$this->db->insert($table,$data);
	}

	function edit_data($where,$table){
		return $this->db->get_where($table,$where);
	}

	function update_data($where,$data,$table){
		$this->db->where($where);
		$this->db->update($table,$data);
	}

	function hapus_data($where,$table){
		$this->db->where($where);
		$this->db->delete($table);
	}
} */
/*
	 function grid($params)
	{
		return $this->db->get('tb_bookmark');
	}

	 function add($data)
	{
		return $this->db->insert('tb_bookmark', $data);
	}

	 function edit($key, $data)
	{
		return $this->db->update('tb_bookmark', $data, $key);
	}

	 function delete($key)
	{
		return $this->db->delete('tb_bookmark',$key);
	}
} */


text:
class Drills
  include Commands

  def start
    drill = linked_drills[0]
    while drill do
      drill.show

      begin
        input = Readline.readline("\n>> ", true)
      end while (!drill.done?(input))

      case input
      when 'back'
        drill = drill.previous
        clear
      when 'menu'
        break
      else
        drill = drill.next
        continue
      end

    end
  end

  # Creates a linked list from the array of drills
  def linked_drills
    ordered_drills.tap do |linked|
      for i in 0..linked.size-1
        linked[i].previous = linked[i-1] unless (i == 0)
        linked[i].next = linked[i+1] unless (i == linked.size-1)
      end
    end
  end

  # deliver drills in random order
  def ordered_drills
    drills.shuffle
  end

  # Determines the list of drills in this directory
  def drills
    mod = self.class.name.gsub(/Drills/, '').downcase
    Dir["#{File.dirname(__FILE__)}/#{mod}/*drill.rb"].map do |f|
      require f
      name = File.basename(f, '.rb')
      clazz = name.split('_').map(&:capitalize).join
      Module.const_get(clazz).new
    end
  end
end


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;

namespace System.Text.Json.Serialization.Converters
{
    internal sealed class JsonKeyValuePairConverter<TKey, TValue> : JsonConverter<KeyValuePair<TKey, TValue>>
    {
        private const string KeyName = "Key";
        private const string ValueName = "Value";

        // "encoder: null" is used since the literal values of "Key" and "Value" should not normally be escaped
        // unless a custom encoder is used that escapes these ASCII characters (rare).
        // Also by not specifying an encoder allows the values to be cached statically here.
        private static readonly JsonEncodedText _keyName = JsonEncodedText.Encode(KeyName, encoder: null);
        private static readonly JsonEncodedText _valueName = JsonEncodedText.Encode(ValueName, encoder: null);

        public override KeyValuePair<TKey, TValue> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
        {
            if (reader.TokenType != JsonTokenType.StartObject)
            {
                ThrowHelper.ThrowJsonException();
            }

            TKey k = default;
            bool keySet = false;

            TValue v = default;
            bool valueSet = false;

            // Get the first property.
            reader.Read();
            if (reader.TokenType != JsonTokenType.PropertyName)
            {
                ThrowHelper.ThrowJsonException();
            }

            string propertyName = reader.GetString();
            if (propertyName == KeyName)
            {
                k = ReadProperty<TKey>(ref reader, typeToConvert, options);
                keySet = true;
            }
            else if (propertyName == ValueName)
            {
                v = ReadProperty<TValue>(ref reader, typeToConvert, options);
                valueSet = true;
            }
            else
            {
                ThrowHelper.ThrowJsonException();
            }

            // Get the second property.
            reader.Read();
            if (reader.TokenType != JsonTokenType.PropertyName)
            {
                ThrowHelper.ThrowJsonException();
            }

            propertyName = reader.GetString();
            if (propertyName == ValueName)
            {
                v = ReadProperty<TValue>(ref reader, typeToConvert, options);
                valueSet = true;
            }
            else if (propertyName == KeyName)
            {
                k = ReadProperty<TKey>(ref reader, typeToConvert, options);
                keySet = true;
            }
            else
            {
                ThrowHelper.ThrowJsonException();
            }

            if (!keySet || !valueSet)
            {
                ThrowHelper.ThrowJsonException();
            }

            reader.Read();

            if (reader.TokenType != JsonTokenType.EndObject)
            {
                ThrowHelper.ThrowJsonException();
            }

            return new KeyValuePair<TKey, TValue>(k, v);
        }

        private T ReadProperty<T>(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
        {
            T k;

            // Attempt to use existing converter first before re-entering through JsonSerializer.Deserialize().
            // The default converter for objects does not parse null objects as null, so it is not used here.
            if (typeToConvert != typeof(object) && (options?.GetConverter(typeToConvert) is JsonConverter<T> keyConverter))
            {
                reader.Read();
                k = keyConverter.Read(ref reader, typeToConvert, options);
            }
            else
            {
                k = JsonSerializer.Deserialize<T>(ref reader, options);
            }

            return k;
        }

        private void WriteProperty<T>(Utf8JsonWriter writer, T value, JsonEncodedText name, JsonSerializerOptions options)
        {
            Type typeToConvert = typeof(T);

            writer.WritePropertyName(name);

            // Attempt to use existing converter first before re-entering through JsonSerializer.Serialize().
            // The default converter for object does not support writing.
            if (typeToConvert != typeof(object) && (options?.GetConverter(typeToConvert) is JsonConverter<T> keyConverter))
            {
                keyConverter.Write(writer, value, options);
            }
            else
            {
                JsonSerializer.Serialize<T>(writer, value, options);
            }
        }

        public override void Write(Utf8JsonWriter writer, KeyValuePair<TKey, TValue> value, JsonSerializerOptions options)
        {
            writer.WriteStartObject();
            WriteProperty(writer, value.Key, _keyName, options);
            WriteProperty(writer, value.Value, _valueName, options);
            writer.WriteEndObject();
        }
    }
}