/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/obj/local/arm64-v8a/objs/ijksdl/ffmpeg/ijksdl_vout_overlay_ffmpeg.o: \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/ijksdl_vout_overlay_ffmpeg.c \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/ijksdl_vout_overlay_ffmpeg.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_stdinc.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stddef.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_cprolog.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/features.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_stlport_version.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/user_config.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/compat.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/host.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/_system.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/_android.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/_gcc.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/stl_confix.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/_native_headers.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_epilog.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_config_compat_post.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_vout.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_stdinc.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_class.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_mutex.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/pthread.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_prolog.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_video.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_fourcc.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_endian.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ffmpeg/ijksdl_inc_ffmpeg.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/imgutils.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/avutil.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/common.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/math.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stdio.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stdlib.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/attributes.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/macros.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/version.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/avconfig.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/mem.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/error.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/rational.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/mathematics.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/intfloat.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/log.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/pixfmt.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/pixdesc.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/pixfmt.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/frame.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/buffer.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/dict.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/samplefmt.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/common.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavcodec/avcodec.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/samplefmt.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/attributes.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/avutil.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/buffer.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/cpu.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/channel_layout.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/dict.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/log.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/rational.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavcodec/version.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/version.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libswscale/swscale.h \
 /home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libswscale/version.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ffmpeg/../ijksdl_inc_internal.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ffmpeg/../ijksdl_log.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ffmpeg/../ijksdl_extra_log.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ffmpeg/../ijksdl_misc.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ffmpeg/../ijksdl_stdinc.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/ijksdl_inc_ffmpeg.h \
 /home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/assert.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_misc.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_mutex.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_vout_internal.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_vout.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_video.h \
 /home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/ijksdl_image_convert.h

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/ijksdl_vout_overlay_ffmpeg.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_stdinc.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stddef.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_cprolog.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/features.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_stlport_version.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/user_config.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/compat.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/host.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/_system.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/_android.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/_gcc.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/stl_confix.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/config/_native_headers.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_epilog.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_config_compat_post.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_vout.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_stdinc.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_class.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_mutex.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/pthread.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stl/_prolog.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_video.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_fourcc.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_endian.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ffmpeg/ijksdl_inc_ffmpeg.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/imgutils.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/avutil.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/common.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/math.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stdio.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/stdlib.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/attributes.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/macros.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/version.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/avconfig.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/mem.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/error.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/rational.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/mathematics.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/intfloat.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/log.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/pixfmt.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/pixdesc.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/pixfmt.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/frame.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/buffer.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/dict.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/samplefmt.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/common.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavcodec/avcodec.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/samplefmt.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/attributes.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/avutil.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/buffer.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/cpu.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/channel_layout.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/dict.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/log.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/rational.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavcodec/version.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libavutil/version.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libswscale/swscale.h:

/home/ksw/develop/ijkplayer-android/android/contrib/build/ffmpeg-arm64/output/include/libswscale/version.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ffmpeg/../ijksdl_inc_internal.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ffmpeg/../ijksdl_log.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ffmpeg/../ijksdl_extra_log.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ffmpeg/../ijksdl_misc.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ffmpeg/../ijksdl_stdinc.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/ijksdl_inc_ffmpeg.h:

/home/ksw/develop/android-ndk-r14b/sources/cxx-stl/stlport/stlport/assert.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_misc.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_mutex.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_vout_internal.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_vout.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/../ijksdl_video.h:

/home/ksw/develop/ijkplayer-android/android/ijkplayer/ijkplayer-arm64/src/main/jni/ijkmedia/ijksdl/ffmpeg/ijksdl_image_convert.h:


// this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-

// -- BEGIN LICENSE BLOCK ----------------------------------------------
// This program is free software licensed under the CDDL
// (COMMON DEVELOPMENT AND DISTRIBUTION LICENSE Version 1.0).
// You can find a copy of this license in LICENSE in the top
// directory of the source code.
//
// © Copyright 2018 FZI Forschungszentrum Informatik, Karlsruhe, Germany
// -- END LICENSE BLOCK ------------------------------------------------

//----------------------------------------------------------------------
/*!\file
 *
 * \author  Klaus Uhl <uhl@fzi.de>
 * \date    2012-01-25
 *
 */
//----------------------------------------------------------------------
#include <icl_core_config/Config.h>

#include <iterator>
#include <vector>
#include <boost/assign/list_of.hpp>
#include <boost/test/unit_test.hpp>

namespace icc = icl_core::config;
namespace icl = icl_core::logging;

enum EnumValue
{
  ONE,
  TWO,
  THREE
};

std::vector<std::string> enum_value_description =
  boost::assign::list_of<std::string>("ONE")("TWO")("THREE");

char const * enum_value_char_description[] = {"ONE", "TWO", "THREE", NULL};

struct ConfigListEntry
{
  std::string string_value;
  EnumValue enum_value;
  struct Foo
  {
    uint32_t uint32_value;
    EnumValue enum_value;
    struct Bar {
      double double_value;
      EnumValue enum_value;
    } bar;
  } foo;
};

BOOST_AUTO_TEST_SUITE(ts_BatchGet)

#ifdef ICL_CORE_CONFIG_HAS_ENHANCED_CONFIG_MACROS

BOOST_AUTO_TEST_CASE(ConfigValue)
{
  // Simulate the following configuration file:
  //
  // <?xml version="1.0" encoding="UTF-8"?>
  //
  // <ConfigValue>
  //   <StringEntry>string-value</StringEntry>
  //   <UInt32Entry>12345</UInt32Entry>
  //   <DoubleEntry>1.2345</DoubleEntry>
  // </ConfigValue>
  icc::setValue("/ConfigValue/StringEntry", "string-value");
  icc::setValue("/ConfigValue/UInt32Entry", "12345");
  icc::setValue("/ConfigValue/DoubleEntry", "1.2345");

  std::string string_value = "";
  uint32_t uint32_value = 0;
  double double_value = 0.;
  bool read_success =
    icc::get(CONFIG_VALUES(CONFIG_VALUE("/ConfigValue/StringEntry", string_value)
                           CONFIG_VALUE("/ConfigValue/UInt32Entry", uint32_value)
                           CONFIG_VALUE("/ConfigValue/DoubleEntry", double_value)),
             icl::Nirwana::instance());
  BOOST_CHECK(read_success);

  BOOST_CHECK_EQUAL(string_value, "string-value");
  BOOST_CHECK_EQUAL(uint32_value, uint32_t(12345));
  BOOST_CHECK_EQUAL(double_value, double(1.2345));
}

BOOST_AUTO_TEST_CASE(ConfigValueDefault)
{
  // Simulate the following configuration file:
  //
  // <?xml version="1.0" encoding="UTF-8"?>
  //
  // <ConfigValueDefault>
  //   <StringEntry>string-value</StringEntry>
  // </ConfigValueDefault>
  icc::setValue("/ConfigValueDefault/StringEntry", "string-value");

  std::string string_value = "";
  uint32_t uint32_value = 0;
  bool read_success =
    icc::get(CONFIG_VALUES(
               CONFIG_VALUE_DEFAULT("/ConfigValueDefault/StringEntry", string_value, "other-string-value")
               CONFIG_VALUE_DEFAULT("/ConfigValue/UInt32Entry", uint32_value, 12345)),
             icl::Nirwana::instance());
  BOOST_CHECK(read_success);

  BOOST_CHECK_EQUAL(string_value, "string-value");
  BOOST_CHECK_EQUAL(uint32_value, uint32_t(12345));
}

BOOST_AUTO_TEST_CASE(ConfigEnum)
{
  // Simulate the following configuration file:
  //
  // <?xml version="1.0" encoding="UTF-8"?>
  //
  // <ConfigEnum>
  //   <Entry1>ONE</Entry1>
  //   <Entry2>TWO</Entry2>
  // </ConfigEnum>
  icc::setValue("/ConfigEnum/Entry1", "ONE");
  icc::setValue("/ConfigEnum/Entry2", "TWO");

  EnumValue value1 = THREE;
  EnumValue value2 = THREE;
  bool read_success =
    icc::get(CONFIG_VALUES(CONFIG_ENUM("/ConfigEnum/Entry1", value1, enum_value_char_description)
                           CONFIG_ENUM("/ConfigEnum/Entry2", value2, enum_value_char_description)),
             icl::Nirwana::instance());
  BOOST_CHECK(read_success);

  BOOST_CHECK_EQUAL(value1, ONE);
  BOOST_CHECK_EQUAL(value2, TWO);
}

BOOST_AUTO_TEST_CASE(ConfigEnumDefault)
{
  // Simulate the following configuration file:
  //
  // <?xml version="1.0" encoding="UTF-8"?>
  //
  // <ConfigEnumDefault>
  //   <Entry1>ONE</Entry1>
  // </ConfigEnumDefault>
  icc::setValue("/ConfigEnumDefault/Entry1", "ONE");

  EnumValue value1 = THREE;
  EnumValue value2 = THREE;
  bool read_success =
    icc::get(CONFIG_VALUES(
               CONFIG_ENUM_DEFAULT("/ConfigEnumDefault/Entry1", value1, TWO, enum_value_char_description)
               CONFIG_ENUM_DEFAULT("/ConfigEnumDefault/Entry2", value2, TWO, enum_value_char_description)),
             icl::Nirwana::instance());
  BOOST_CHECK(read_success);

  BOOST_CHECK_EQUAL(value1, ONE);
  BOOST_CHECK_EQUAL(value2, TWO);
}

BOOST_AUTO_TEST_CASE(ConfigPrefix)
{
  // Simulate the following configuration file:
  //
  // <?xml version="1.0" encoding="UTF-8"?>
  //
  // <ConfigPrefix>
  //   <StringEntry>string-value</StringEntry>
  //   <UInt32Value>12345</UInt32Value>
  //   <DoubleEntry>1.2345</DoubleEntry>
  //   <EnumEntry>TWO</EnumEntry>
  // </ConfigPrefix>
  icc::setValue("/ConfigPrefix/StringEntry", "string-value");
  icc::setValue("/ConfigPrefix/UInt32Entry", "12345");
  icc::setValue("/ConfigPrefix/DoubleEntry", "1.2345");
  icc::setValue("/ConfigPrefix/EnumEntry",   "TWO");

  std::string string_value = "";
  uint32_t uint32_value = 0;
  double double_value = 0.;
  EnumValue enum_value = ONE;
  bool read_success =
    icc::get("/ConfigPrefix",
             CONFIG_VALUES(CONFIG_VALUE("StringEntry", string_value)
                           CONFIG_VALUE("UInt32Entry", uint32_value)
                           CONFIG_VALUE("DoubleEntry", double_value)
                           CONFIG_ENUM ("EnumEntry",   enum_value, enum_value_char_description)),
             icl::Nirwana::instance());
  BOOST_CHECK(read_success);

  BOOST_CHECK_EQUAL(string_value, "string-value");
  BOOST_CHECK_EQUAL(uint32_value, uint32_t(12345));
  BOOST_CHECK_EQUAL(double_value, double(1.2345));
  BOOST_CHECK_EQUAL(enum_value,   TWO);
}

BOOST_AUTO_TEST_CASE(ConfigList)
{
  // Simulate the following configuration file:
  //
  // <?xml version="1.0" encoding="UTF-8"?>
  //
  // <ConfigList>
  //   <List>
  //     <Entry1>
  //       <StringEntry>string-value-1</StringEntry>
  //       <EnumEntry>ONE</EnumEntry>
  //       <Foo>
  //         <UInt32Value>1</UInt32Value>
  //         <EnumEntry>ONE</EnumEntry>
  //         <Bar>
  //           <DoubleEntry>0.1</DoubleEntry>
  //           <EnumEntry>ONE</EnumEntry>
  //         </Bar>
  //       </Foo>
  //     </Entry1>
  //     <Entry2>
  //       <StringEntry>string-value-2</StringEntry>
  //       <EnumEntry>TWO</EnumEntry>
  //       <Foo>
  //         <UInt32Value>2</UInt32Value>
  //         <EnumEntry>TWO</EnumEntry>
  //         <Bar>
  //           <DoubleEntry>0.2</DoubleEntry>
  //           <EnumEntry>TWO</EnumEntry>
  //         </Bar>
  //       </Foo>
  //     </Entry2>
  //     <Entry3>
  //       <StringEntry>string-value-3</StringEntry>
  //       <EnumEntry>THREE</EnumEntry>
  //       <Foo>
  //         <UInt32Value>3</UInt32Value>
  //         <EnumEntry>TWO</EnumEntry>
  //         <Bar>
  //           <DoubleEntry>0.3</DoubleEntry>
  //           <EnumEntry>TWO</EnumEntry>
  //         </Bar>
  //       </Foo>
  //     </Entry3>
  //   </List>
  // </ConfigValuePrefix>
  icc::setValue("/ConfigList/List/Entry1/StringEntry",         "string-value-1");
  icc::setValue("/ConfigList/List/Entry1/EnumEntry",           "ONE");
  icc::setValue("/ConfigList/List/Entry1/Foo/UInt32Entry",     "1");
  icc::setValue("/ConfigList/List/Entry1/Foo/EnumEntry",       "ONE");
  icc::setValue("/ConfigList/List/Entry1/Foo/Bar/DoubleEntry", "0.1");
  icc::setValue("/ConfigList/List/Entry1/Foo/Bar/EnumEntry",   "ONE");
  icc::setValue("/ConfigList/List/Entry2/StringEntry",         "string-value-2");
  icc::setValue("/ConfigList/List/Entry2/EnumEntry",           "TWO");
  icc::setValue("/ConfigList/List/Entry2/Foo/UInt32Entry",     "2");
  icc::setValue("/ConfigList/List/Entry2/Foo/EnumEntry",       "TWO");
  icc::setValue("/ConfigList/List/Entry2/Foo/Bar/DoubleEntry", "0.2");
  icc::setValue("/ConfigList/List/Entry2/Foo/Bar/EnumEntry",   "TWO");
  icc::setValue("/ConfigList/List/Entry3/StringEntry",         "string-value-3");
  icc::setValue("/ConfigList/List/Entry3/EnumEntry",           "THREE");
  icc::setValue("/ConfigList/List/Entry3/Foo/UInt32Entry",     "3");
  icc::setValue("/ConfigList/List/Entry3/Foo/EnumEntry",       "THREE");
  icc::setValue("/ConfigList/List/Entry3/Foo/Bar/DoubleEntry", "0.3");
  icc::setValue("/ConfigList/List/Entry3/Foo/Bar/EnumEntry",   "THREE");

  // Remard: This also works with std::list.
  // Actually, every container that provides a push_back() method can be used!
  std::vector<ConfigListEntry> config_list;
  bool read_successful =
    icc::get(CONFIG_VALUES(
               CONFIG_LIST(
                 ConfigListEntry, "/ConfigList/List",
                 MEMBER_MAPPING(
                   ConfigListEntry,
                   MEMBER_VALUE_1("StringEntry", ConfigListEntry, string_value)
                   MEMBER_VALUE_2("Foo/UInt32Entry", ConfigListEntry, foo, uint32_value)
                   MEMBER_VALUE_3("Foo/Bar/DoubleEntry", ConfigListEntry, foo, bar, double_value)
                   MEMBER_ENUM_1 ("EnumEntry", ConfigListEntry, enum_value, enum_value_description)
                   MEMBER_ENUM_2 ("Foo/EnumEntry", ConfigListEntry, foo, enum_value, enum_value_description)
                   MEMBER_ENUM_3 ("Foo/Bar/EnumEntry",   ConfigListEntry, foo, bar, enum_value,
                                  // Enum members also work with plain C-string arrays.
                                  enum_value_char_description)),
                 std::back_inserter(config_list))),
             icl::Nirwana::instance());
  BOOST_CHECK(read_successful);

  BOOST_CHECK_EQUAL(config_list.size(), 3u);

  BOOST_CHECK_EQUAL(config_list[0].string_value, "string-value-1");
  BOOST_CHECK_EQUAL(config_list[0].foo.uint32_value, 1u);
  BOOST_CHECK_EQUAL(config_list[0].foo.bar.double_value, 0.1);
  BOOST_CHECK_EQUAL(config_list[0].enum_value,   ONE);
  BOOST_CHECK_EQUAL(config_list[0].foo.enum_value,   ONE);
  BOOST_CHECK_EQUAL(config_list[0].foo.bar.enum_value,   ONE);

  BOOST_CHECK_EQUAL(config_list[1].string_value, "string-value-2");
  BOOST_CHECK_EQUAL(config_list[1].foo.uint32_value, 2u);
  BOOST_CHECK_EQUAL(config_list[1].foo.bar.double_value, 0.2);
  BOOST_CHECK_EQUAL(config_list[1].enum_value,   TWO);
  BOOST_CHECK_EQUAL(config_list[1].foo.enum_value,   TWO);
  BOOST_CHECK_EQUAL(config_list[1].foo.bar.enum_value,   TWO);

  BOOST_CHECK_EQUAL(config_list[2].string_value, "string-value-3");
  BOOST_CHECK_EQUAL(config_list[2].foo.uint32_value, 3u);
  BOOST_CHECK_EQUAL(config_list[2].foo.bar.double_value, 0.3);
  BOOST_CHECK_EQUAL(config_list[2].enum_value,   THREE);
  BOOST_CHECK_EQUAL(config_list[2].foo.enum_value,   THREE);
  BOOST_CHECK_EQUAL(config_list[2].foo.bar.enum_value,   THREE);
}

#else
# if defined(_MSC_VER)
#  pragma message("The icl_core_config batch convenience macros are only available in Visual Studio 2010 and newer.")
# endif
#endif

BOOST_AUTO_TEST_SUITE_END()


# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

static_library("browser") {
  sources = [
    "ruleset_service.cc",
    "ruleset_service.h",
    "ruleset_service_delegate.h",
    "subresource_filter_client.h",
    "subresource_filter_constants.cc",
    "subresource_filter_constants.h",
    "subresource_filter_features.cc",
    "subresource_filter_features.h",
  ]
  deps = [
    "//base",
    "//components/prefs:prefs",
    "//components/subresource_filter/core/common",
    "//components/variations",
    "//third_party/protobuf:protobuf_lite",
  ]
}

static_library("test_support") {
  testonly = true
  sources = [
    "subresource_filter_features_test_support.cc",
    "subresource_filter_features_test_support.h",
  ]
  deps = [
    ":browser",
    "//base",
    "//base/test:test_support",
    "//components/variations",
    "//testing/gtest",
  ]
}

source_set("unit_tests") {
  testonly = true
  sources = [
    "ruleset_service_unittest.cc",
    "subresource_filter_features_unittest.cc",
  ]
  deps = [
    ":browser",
    ":test_support",
    "//base",
    "//base/test:test_support",
    "//components/prefs:test_support",
    "//components/subresource_filter/core/common:test_support",
    "//testing/gmock",
    "//testing/gtest",
  ]
}


//
//     Generated by class-dump 3.5 (64 bit).
//
//     class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//

#import "NSObject.h"

@class IMAPClientOperationQueue, IMAPConnection, IMAPConnectionPool, NSCondition, NSOperationQueue, NSRecursiveLock;

@interface IMAPGateway : NSObject
{
    IMAPConnection *_connection;
    NSOperationQueue *_checkInQueue;
    NSCondition *_connectionAvailabilityCondition;
    NSRecursiveLock *_clientCountLock;
    BOOL _operationQueueCanCheckInConnection;
    BOOL _canYield;
    BOOL _remainedDeserted;
    BOOL _isSealedShut;
    BOOL _needsSelect;
    BOOL _primaryClientAllowsYielding;
    IMAPClientOperationQueue *_operationQueue;
    unsigned long long _clientCount;
    IMAPConnectionPool *_connectionPool;
}

+ (void)_checkIdleGateways;
+ (void)_removeIdleGateway:(id)arg1;
+ (void)_addIdleGateway:(id)arg1;
+ (double)IMAPIdleRefreshDelay;
+ (void)initialize;
@property IMAPConnectionPool *connectionPool; // @synthesize connectionPool=_connectionPool;
@property BOOL primaryClientAllowsYielding; // @synthesize primaryClientAllowsYielding=_primaryClientAllowsYielding;
@property BOOL needsSelect; // @synthesize needsSelect=_needsSelect;
@property BOOL isSealedShut; // @synthesize isSealedShut=_isSealedShut;
@property unsigned long long clientCount; // @synthesize clientCount=_clientCount;
@property BOOL remainedDeserted; // @synthesize remainedDeserted=_remainedDeserted;
@property BOOL canYield; // @synthesize canYield=_canYield;
@property(retain) IMAPClientOperationQueue *operationQueue; // @synthesize operationQueue=_operationQueue;
- (id)description;
- (void)refreshIdle;
- (BOOL)startIdle;
- (void)refreshDone:(BOOL)arg1 withOperation:(id)arg2;
- (BOOL)synchronouslyExecuteDoneWithSequence:(unsigned long long)arg1 session:(unsigned long long)arg2;
- (BOOL)synchronouslyExecuteSelect:(id)arg1;
- (unsigned int)searchedUidNextForMessageNumber:(unsigned long long)arg1;
- (id)searchUidRange:(CDStruct_f792af56)arg1 forNewMessageIDs:(id)arg2;
- (id)searchUidRange:(CDStruct_f792af56)arg1 forTerms:(id)arg2;
- (BOOL)appendData:(id)arg1 toMailboxNamed:(id)arg2 flags:(id)arg3 dateReceived:(id)arg4 messageInfo:(id)arg5 error:(id *)arg6;
- (BOOL)copyUids:(id)arg1 toMailboxNamed:(id)arg2 messageInfo:(id)arg3 error:(id *)arg4;
- (BOOL)deleteMessagesOlderThanNumberOfDays:(long long)arg1 settingFlags:(id)arg2;
- (BOOL)_storeGmailLabels:(id)arg1 state:(BOOL)arg2 forUids:(id)arg3 mailboxName:(id)arg4;
- (BOOL)_storeFlags:(id)arg1 state:(BOOL)arg2 forUids:(id)arg3 mailboxName:(id)arg4;
- (BOOL)_expunge:(BOOL)arg1 orStoreFlags:(id)arg2 orStoreGmailLabels:(id)arg3 state:(BOOL)arg4 forUids:(id)arg5;
- (BOOL)storeGmailLabels:(id)arg1 state:(BOOL)arg2 forUids:(id)arg3;
- (BOOL)storeFlags:(id)arg1 state:(BOOL)arg2 forUids:(id)arg3;
- (void)fetchTotalSizeAndMessageCount;
- (void)unselect;
- (void)closeAndLogout;
- (void)logout;
- (void)close;
- (BOOL)_expungeUids:(id)arg1 mailboxName:(id)arg2;
- (BOOL)expungeUids:(id)arg1;
- (BOOL)expunge;
- (BOOL)check:(id *)arg1;
- (BOOL)getQuotaForRootName:(id)arg1;
- (void)fetchQuotaRootNamesForMailboxes:(id)arg1;
- (BOOL)unsubscribeMailbox:(id)arg1;
- (BOOL)subscribeMailbox:(id)arg1;
- (BOOL)renameMailbox:(id)arg1 toMailbox:(id)arg2;
- (BOOL)deleteMailbox:(id)arg1;
- (BOOL)createMailbox:(id)arg1;
- (BOOL)_completeSelectOperation:(id)arg1;
- (void)_waitForDelayedSelectOperation:(id)arg1;
- (BOOL)_addSelectOperationForMailbox:(id)arg1 class:(Class)arg2;
- (BOOL)selectMailbox:(id)arg1;
- (BOOL)examineMailbox:(id)arg1;
- (id)statusForMailbox:(id)arg1 dataItems:(unsigned long long)arg2;
- (void)fetchStatusForMailboxes:(id)arg1 dataItems:(unsigned long long)arg2;
- (BOOL)subscribedListingForMailbox:(id)arg1 options:(long long)arg2 listingInfo:(id)arg3;
- (BOOL)listingForMailbox:(id)arg1 options:(long long)arg2 listingInfo:(id)arg3;
- (id)namespacesWithSeparatorChar:(id)arg1;
- (void)setServerPathPrefixOnAccount:(id)arg1 withSeparatorChar:(id)arg2;
- (void)fetchFlagsForMaxRecentMessages:(unsigned long long)arg1;
- (void)fetchAllFlags;
- (void)noop;
- (void)_setErrorFromOperation:(id)arg1 overwriteExistingError:(BOOL)arg2;
- (void)_setError:(id *)arg1 fromOperation:(id)arg2;
- (id)mailboxNameIfSelected:(BOOL)arg1;
- (BOOL)supportsCapability:(unsigned long long)arg1;
- (void)configureForMailboxName:(id)arg1;
- (id)mailboxName;
- (void)waitUntilAllOperationsAreFinished;
- (void)waitUntilClientOperationIsFinished:(id)arg1;
- (BOOL)addClientOperation:(id)arg1 toQueueAndWaitUntilFinished:(BOOL)arg2;
- (void)_executeSuspend:(id)arg1;
- (void)_allowClientOperationThrough:(id)arg1;
- (void)allowClientOperationThrough:(id)arg1;
- (BOOL)isDeserted;
- (void)_finishQueueIdlingAndSuspend:(BOOL)arg1;
- (void)sealShutAndCompact:(BOOL)arg1 allowNetworking:(BOOL)arg2;
- (void)resumeWithConnection:(id)arg1 reselect:(BOOL)arg2;
- (void)suspend;
- (void)yield;
- (BOOL)okToYield;
- (BOOL)checkOut;
- (void)_tryToCheckInConnectionAndTryToIdle:(BOOL)arg1;
- (void)checkIn;
- (void)operationQueueDidIdle;
@property(retain) IMAPConnection *connection;
- (void)dealloc;
- (id)init;
- (id)initWithIMAPConnection:(id)arg1 mailbox:(id)arg2 pool:(id)arg3;

@end


// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Unicode table generator.
// Data read from the web.

// +build ignore

package main

import (
	"flag"
	"log"
	"unicode"
	"unicode/utf8"

	"golang.org/x/text/internal/gen"
	"golang.org/x/text/internal/triegen"
	"golang.org/x/text/internal/ucd"
	"golang.org/x/text/unicode/norm"
	"golang.org/x/text/unicode/rangetable"
)

var outputFile = flag.String("output", "tables.go", "output file for generated tables; default tables.go")

var assigned, disallowedRunes *unicode.RangeTable

var runeCategory = map[rune]category{}

var overrides = map[category]category{
	viramaModifier: viramaJoinT,
	greek:          greekJoinT,
	hebrew:         hebrewJoinT,
}

func setCategory(r rune, cat category) {
	if c, ok := runeCategory[r]; ok {
		if override, ok := overrides[c]; cat == joiningT && ok {
			cat = override
		} else {
			log.Fatalf("%U: multiple categories for rune (%v and %v)", r, c, cat)
		}
	}
	runeCategory[r] = cat
}

func init() {
	if numCategories > 1<<propShift {
		log.Fatalf("Number of categories is %d; may at most be %d", numCategories, 1<<propShift)
	}
}

func main() {
	gen.Init()

	// Load data
	runes := []rune{}
	// PrecisIgnorableProperties: https://tools.ietf.org/html/rfc7564#section-9.13
	ucd.Parse(gen.OpenUCDFile("DerivedCoreProperties.txt"), func(p *ucd.Parser) {
		if p.String(1) == "Default_Ignorable_Code_Point" {
			runes = append(runes, p.Rune(0))
		}
	})
	ucd.Parse(gen.OpenUCDFile("PropList.txt"), func(p *ucd.Parser) {
		switch p.String(1) {
		case "Noncharacter_Code_Point":
			runes = append(runes, p.Rune(0))
		}
	})
	// OldHangulJamo: https://tools.ietf.org/html/rfc5892#section-2.9
	ucd.Parse(gen.OpenUCDFile("HangulSyllableType.txt"), func(p *ucd.Parser) {
		switch p.String(1) {
		case "L", "V", "T":
			runes = append(runes, p.Rune(0))
		}
	})

	disallowedRunes = rangetable.New(runes...)
	assigned = rangetable.Assigned(unicode.Version)

	// Load category data.
	runeCategory['l'] = latinSmallL
	ucd.Parse(gen.OpenUCDFile("UnicodeData.txt"), func(p *ucd.Parser) {
		const cccVirama = 9
		if p.Int(ucd.CanonicalCombiningClass) == cccVirama {
			setCategory(p.Rune(0), viramaModifier)
		}
	})
	ucd.Parse(gen.OpenUCDFile("Scripts.txt"), func(p *ucd.Parser) {
		switch p.String(1) {
		case "Greek":
			setCategory(p.Rune(0), greek)
		case "Hebrew":
			setCategory(p.Rune(0), hebrew)
		case "Hiragana", "Katakana", "Han":
			setCategory(p.Rune(0), japanese)
		}
	})

	// Set the rule categories associated with exceptions. This overrides any
	// previously set categories. The original categories are manually
	// reintroduced in the categoryTransitions table.
	for r, e := range exceptions {
		if e.cat != 0 {
			runeCategory[r] = e.cat
		}
	}
	cat := map[string]category{
		"L": joiningL,
		"D": joiningD,
		"T": joiningT,

		"R": joiningR,
	}
	ucd.Parse(gen.OpenUCDFile("extracted/DerivedJoiningType.txt"), func(p *ucd.Parser) {
		switch v := p.String(1); v {
		case "L", "D", "T", "R":
			setCategory(p.Rune(0), cat[v])
		}
	})

	writeTables()
	gen.Repackage("gen_trieval.go", "trieval.go", "precis")
}

type exception struct {
	prop property
	cat  category
}

func init() {
	// Programmatically add the Arabic and Indic digits to the exceptions map.
	// See comment in the exceptions map below why these are marked disallowed.
	for i := rune(0); i <= 9; i++ {
		exceptions[0x0660+i] = exception{
			prop: disallowed,
			cat:  arabicIndicDigit,
		}
		exceptions[0x06F0+i] = exception{
			prop: disallowed,
			cat:  extendedArabicIndicDigit,
		}
	}
}

// The Exceptions class as defined in RFC 5892
// https://tools.ietf.org/html/rfc5892#section-2.6
var exceptions = map[rune]exception{
	0x00DF: {prop: pValid},
	0x03C2: {prop: pValid},
	0x06FD: {prop: pValid},
	0x06FE: {prop: pValid},
	0x0F0B: {prop: pValid},
	0x3007: {prop: pValid},

	// ContextO|J rules are marked as disallowed, taking a "guilty until proven
	// innocent" approach. The main reason for this is that the check for
	// whether a context rule should be applied can be moved to the logic for
	// handing disallowed runes, taken it off the common path. The exception to
	// this rule is for katakanaMiddleDot, as the rule logic is handled without
	// using a rule function.

	// ContextJ (Join control)
	0x200C: {prop: disallowed, cat: zeroWidthNonJoiner},
	0x200D: {prop: disallowed, cat: zeroWidthJoiner},

	// ContextO
	0x00B7: {prop: disallowed, cat: middleDot},
	0x0375: {prop: disallowed, cat: greekLowerNumeralSign},
	0x05F3: {prop: disallowed, cat: hebrewPreceding}, // punctuation Geresh
	0x05F4: {prop: disallowed, cat: hebrewPreceding}, // punctuation Gershayim
	0x30FB: {prop: pValid, cat: katakanaMiddleDot},

	// These are officially ContextO, but the implementation does not require
	// special treatment of these, so we simply mark them as valid.
	0x0660: {prop: pValid},
	0x0661: {prop: pValid},
	0x0662: {prop: pValid},
	0x0663: {prop: pValid},
	0x0664: {prop: pValid},
	0x0665: {prop: pValid},
	0x0666: {prop: pValid},
	0x0667: {prop: pValid},
	0x0668: {prop: pValid},
	0x0669: {prop: pValid},
	0x06F0: {prop: pValid},
	0x06F1: {prop: pValid},
	0x06F2: {prop: pValid},
	0x06F3: {prop: pValid},
	0x06F4: {prop: pValid},
	0x06F5: {prop: pValid},
	0x06F6: {prop: pValid},
	0x06F7: {prop: pValid},
	0x06F8: {prop: pValid},
	0x06F9: {prop: pValid},

	0x0640: {prop: disallowed},
	0x07FA: {prop: disallowed},
	0x302E: {prop: disallowed},
	0x302F: {prop: disallowed},
	0x3031: {prop: disallowed},
	0x3032: {prop: disallowed},
	0x3033: {prop: disallowed},
	0x3034: {prop: disallowed},
	0x3035: {prop: disallowed},
	0x303B: {prop: disallowed},
}

// LetterDigits: https://tools.ietf.org/html/rfc5892#section-2.1
// r in {Ll, Lu, Lo, Nd, Lm, Mn, Mc}.
func isLetterDigits(r rune) bool {
	return unicode.In(r,
		unicode.Ll, unicode.Lu, unicode.Lm, unicode.Lo, // Letters
		unicode.Mn, unicode.Mc, // Modifiers
		unicode.Nd, // Digits
	)
}

func isIdDisAndFreePVal(r rune) bool {
	return unicode.In(r,
		// OtherLetterDigits: https://tools.ietf.org/html/rfc7564#section-9.18
		// r in in {Lt, Nl, No, Me}
		unicode.Lt, unicode.Nl, unicode.No, // Other letters / numbers
		unicode.Me, // Modifiers

		// Spaces: https://tools.ietf.org/html/rfc7564#section-9.14
		// r in in {Zs}
		unicode.Zs,

		// Symbols: https://tools.ietf.org/html/rfc7564#section-9.15
		// r in {Sm, Sc, Sk, So}
		unicode.Sm, unicode.Sc, unicode.Sk, unicode.So,

		// Punctuation: https://tools.ietf.org/html/rfc7564#section-9.16
		// r in {Pc, Pd, Ps, Pe, Pi, Pf, Po}
		unicode.Pc, unicode.Pd, unicode.Ps, unicode.Pe,
		unicode.Pi, unicode.Pf, unicode.Po,
	)
}

// HasCompat: https://tools.ietf.org/html/rfc7564#section-9.17
func hasCompat(r rune) bool {
	return !norm.NFKC.IsNormalString(string(r))
}

// From https://tools.ietf.org/html/rfc5892:
//
// If .cp. .in. Exceptions Then Exceptions(cp);
//   Else If .cp. .in. BackwardCompatible Then BackwardCompatible(cp);
//   Else If .cp. .in. Unassigned Then UNASSIGNED;
//   Else If .cp. .in. ASCII7 Then PVALID;
//   Else If .cp. .in. JoinControl Then CONTEXTJ;
//   Else If .cp. .in. OldHangulJamo Then DISALLOWED;
//   Else If .cp. .in. PrecisIgnorableProperties Then DISALLOWED;
//   Else If .cp. .in. Controls Then DISALLOWED;
//   Else If .cp. .in. HasCompat Then ID_DIS or FREE_PVAL;
//   Else If .cp. .in. LetterDigits Then PVALID;
//   Else If .cp. .in. OtherLetterDigits Then ID_DIS or FREE_PVAL;
//   Else If .cp. .in. Spaces Then ID_DIS or FREE_PVAL;
//   Else If .cp. .in. Symbols Then ID_DIS or FREE_PVAL;
//   Else If .cp. .in. Punctuation Then ID_DIS or FREE_PVAL;
//   Else DISALLOWED;

func writeTables() {
	propTrie := triegen.NewTrie("derivedProperties")
	w := gen.NewCodeWriter()
	defer w.WriteGoFile(*outputFile, "precis")
	gen.WriteUnicodeVersion(w)

	// Iterate over all the runes...
	for i := rune(0); i < unicode.MaxRune; i++ {
		r := rune(i)

		if !utf8.ValidRune(r) {
			continue
		}

		e, ok := exceptions[i]
		p := e.prop
		switch {
		case ok:
		case !unicode.In(r, assigned):
			p = unassigned
		case r >= 0x0021 && r <= 0x007e: // Is ASCII 7
			p = pValid
		case unicode.In(r, disallowedRunes, unicode.Cc):
			p = disallowed
		case hasCompat(r):
			p = idDisOrFreePVal
		case isLetterDigits(r):
			p = pValid
		case isIdDisAndFreePVal(r):
			p = idDisOrFreePVal
		default:
			p = disallowed
		}
		cat := runeCategory[r]
		// Don't set category for runes that are disallowed.
		if p == disallowed {
			cat = exceptions[r].cat
		}
		propTrie.Insert(r, uint64(p)|uint64(cat))
	}
	sz, err := propTrie.Gen(w)
	if err != nil {
		log.Fatal(err)
	}
	w.Size += sz
}


package chap09;

import static helpers.Printer.*;

/**
 * A child is running up a staircase with n steps, and can
 * hop either 1 step, 2 steps, or 3 steps at a time. Implement
 * a method to count how many possible ways the child can run
 * up the stairs.
 */
public class Q01 {
    // Naive: O(3^n) time, O(n) space
    public static int countWays(int n) {
        if (n < 0) return 0;
        if (n == 0) return 1;
        return countWays(n - 1) + countWays(n - 2) + countWays(n - 3);
    }

    // Memoization (top-down): O(n) time, O(n) space
    public static int countWaysMemo(int n) {
        return countWaysMemo(n, new int[n + 1]);
    }

    private static int countWaysMemo(int n, int[] cache) {
        if (n < 0) return 0;
        if (n == 0) return 1;
        if (cache[n] == 0)
            cache[n] = countWays(n - 1) + countWays(n - 2) + countWays(n - 3);
        return cache[n];
    }

    // DP with rolling array (bottom-up): O(n) time, O(1) space
    public static int countWaysDP(int n) {
        if (n < 0) return 0;
        if (n == 0) return 1;
        if (n == 1) return 2;
        if (n == 2) return 4;

        int[] dp = new int[3];
        dp[0] = 1; dp[1] = 2; dp[2] = 4;
        for (int i = 3; i < n; ++i) {
            dp[i%3] = dp[(i - 1)%3] + dp[(i - 2)%3] + dp[(i - 3)%3];
        }
        return dp[(n - 1)%3];
    }

    public static void countWaysPrinter(int n) {
        println(n + "-step stairs:");
        if (n <= 0) {
            println("None!");
        } else {
            println("countWays:     " + countWays(n));
            println("countWaysMemo: " + countWaysMemo(n));
            println("countWaysDP:   " + countWaysDP(n));
        }
        println();
    }

    //TEST----------------------------------
    public static void main(String[] args) {
        countWaysPrinter(1);
        countWaysPrinter(10);
        countWaysPrinter(25);
    }
}


---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: (devel)
  creationTimestamp: null
  name: ipamhandles.crd.projectcalico.org
spec:
  group: crd.projectcalico.org
  names:
    kind: IPAMHandle
    listKind: IPAMHandleList
    plural: ipamhandles
    singular: ipamhandle
  scope: Cluster
  versions:
  - name: v1
    schema:
      openAPIV3Schema:
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation
              of an object. Servers should convert recognized schemas to the latest
              internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this
              object represents. Servers may infer this from the endpoint the client
              submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            description: IPAMHandleSpec contains the specification for an IPAMHandle
              resource.
            properties:
              block:
                additionalProperties:
                  type: integer
                type: object
              handleID:
                type: string
            required:
            - block
            - handleID
            type: object
        type: object
    served: true
    storage: true
status:
  acceptedNames:
    kind: ""
    plural: ""
  conditions: []
  storedVersions: []


/*
 * Copyright (C) Kreogist Dev Team
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */
#include <QCryptographicHash>
#include <QDir>
#include <QIcon>

#include "knutil.h"
#include "kndpimanager.h"

#include "knmusicglobal.h"
#include "knmusicparser.h"

#include "knmusiclibraryimagemanager.h"

#include <QDebug>

KNMusicLibraryImageManager::KNMusicLibraryImageManager(QObject *parent) :
    QObject(parent),
    m_analysisQueue(QLinkedList<AnalysisQueueItem>()),
    m_imageFolderPath(QString()),
    m_scaledHashAlbumArt(nullptr),
    m_isWorking(false)
{
    //Link the analysis request signal and response slot in queue connection.
    connect(this, &KNMusicLibraryImageManager::requireAnalysisNext,
            this, &KNMusicLibraryImageManager::analysisNext,
            Qt::QueuedConnection);
}

void KNMusicLibraryImageManager::analysisAlbumArt(
        QPersistentModelIndex itemIndex,
        KNMusicAnalysisItem item)
{
    //Check out the validation of item index.
    if(!itemIndex.isValid())
    {
        //Ignore the item index.
        return;
    }
    //Check analysis queue is empty before.
    if(m_analysisQueue.isEmpty())
    {
        //Set working flag.
        m_isWorking=true;
    }
    //Generate the queue item.
    AnalysisQueueItem queueItem;
    //Save the item information.
    queueItem.itemIndex=itemIndex;
    queueItem.item=item;
    //Add the item to queue.
    m_analysisQueue.append(queueItem);
    //And of course, ask to analysis the next item, start looping.
    emit requireAnalysisNext();
}

void KNMusicLibraryImageManager::recoverAlbumArt(const QStringList &hashList)
{
    //Check out the image hash list has been set or not.
    if(m_scaledHashAlbumArt==nullptr)
    {
        return;
    }
    //Get the image folder path information.
    QFileInfo pathChecker(m_imageFolderPath);
    //Check is the path exist or it's a file
    if(pathChecker.exists() && pathChecker.isFile())
    {
        //Delete the file.
        QFile::remove(pathChecker.absoluteFilePath());
    }
    //Generate the image directory.
    QDir imageDir(m_imageFolderPath);
    //Check if it's not exist, simply generate the folder.
    if(!pathChecker.exists())
    {
        //Generate the folder.
        imageDir.mkpath(imageDir.absolutePath());
        //Do nothing, return. Because the folder is just created.
        return;
    }
    //Check the existence again, if the path is still not exist, then failed.
    if(!pathChecker.isDir() || !pathChecker.exists())
    {
        return;
    }
    //Get the entry info list.
    QFileInfoList contentInfos=imageDir.entryInfoList();
    //Check each file.
    for(auto i : contentInfos)
    {
        //Check the information of all the file and the suffix.
        if(i.isFile() && i.suffix().toLower()=="png")
        {
            //Get the hash key, which is the base name.
            QString hashKey=i.completeBaseName();
            //Check whether the file is in the hash list.
            if(hashList.contains(hashKey))
            {
                //Load the image.
                QPixmap currentPixmap=QPixmap(i.absoluteFilePath(), "png");
                //If there's image data is not null.
                if(!currentPixmap.isNull())
                {
                    //Insert the image to the hash list.
                    insertImage(i.completeBaseName(), currentPixmap);
                    //Continue to next file.
                    continue;
                }
            }
        }
        //Remove the no use file.
        QFile::remove(i.absoluteFilePath());
    }
    //After loading the images, emit recover signal.
    emit recoverImageComplete();
}

void KNMusicLibraryImageManager::analysisNext()
{
    //Check is there no item in the queue.
    if(m_analysisQueue.isEmpty())
    {
        //Reset the working flag.
        m_isWorking=false;
        //Mission complete.
        return;
    }
    //Get the first item from the queue.
    AnalysisQueueItem currentItem=m_analysisQueue.takeFirst();
    //Get the analysis item.
    KNMusicAnalysisItem &analysisItem=currentItem.item;
    //Use the parser to parse the analysis item.
    knMusicGlobal->parser()->parseAlbumArt(analysisItem);
    //Check the result of the cover image.
    if(!analysisItem.coverImage.isNull() && m_scaledHashAlbumArt!=nullptr)
    {
        //The cover image is not null, get the hash key.
        analysisItem.detailInfo.coverImageHash=
                insertArtwork(analysisItem.coverImage);
        //Ask to update the row, check the index first.
        if(currentItem.itemIndex.isValid())
        {
            //Emit the update signal.
            emit requireUpdateRow(currentItem.itemIndex.row(),
                                  analysisItem.detailInfo);
        }
    }
    //Ask to update the next item.
    emit requireAnalysisNext();
}

inline void KNMusicLibraryImageManager::insertImage(const QString &hashKey,
                                                    const QPixmap &pixmap)
{
    //We won't do pointer check here, for speed reason.
    //We will only saved the scaled album art.
    m_scaledHashAlbumArt->insert(hashKey,
                                 QVariant(pixmap.scaled(
                                     knDpi->size(138, 138),
                                     Qt::KeepAspectRatio,
                                     Qt::SmoothTransformation)));
}

QHash<QString, QVariant> *KNMusicLibraryImageManager::scaledHashAlbumArt() const
{
    return m_scaledHashAlbumArt;
}

QString KNMusicLibraryImageManager::insertArtwork(const QImage &image)
{
    //Calculate the meta data of the image(MD4 of image content).
    QByteArray hashResult=
            QCryptographicHash::hash(QByteArray((char *)image.bits(),
                                                image.byteCount()),
                                     QCryptographicHash::Md4);
    //Get the image key of the image.
    QString imageHashKey;
    //Add hash result data to image hash key.
    for(int i=0; i<hashResult.size(); ++i)
    {
        //Get the text string of the current number.
        QString currentByteText=QString::number((quint8)hashResult.at(i), 16);
        //Check out the data of image hash key.
        imageHashKey.append(hashResult.at(i)<16?"0"+currentByteText:
                                                currentByteText);
    }
    //Check whether the hash is already exists in image list.
    if(m_scaledHashAlbumArt!=nullptr &&
            !m_scaledHashAlbumArt->contains(imageHashKey))
    {
        //If this image is first time exist in the hash list, save the image
        //first.
        insertImage(imageHashKey, QPixmap::fromImage(image));
        //Save the image.
        image.save(KNUtil::ensurePathValid(m_imageFolderPath) +
                   "/" + imageHashKey + ".png",
                   "PNG");
        //Emit the inserted signal.
        emit imageInserted(imageHashKey);
    }
    return imageHashKey;
}

bool KNMusicLibraryImageManager::isWorking() const
{
    return m_isWorking;
}

void KNMusicLibraryImageManager::removeHashImage(const QString &hashKey)
{
    //Remove the file, simply combine the path.
    QFile::remove(m_imageFolderPath + "/" + hashKey + ".png");
}

QString KNMusicLibraryImageManager::imageFolderPath() const
{
    return m_imageFolderPath;
}

void KNMusicLibraryImageManager::setImageFolderPath(
        const QString &imageFolderPath)
{
    //Save the image folder path.
    m_imageFolderPath = imageFolderPath;
}

QPixmap KNMusicLibraryImageManager::artwork(const QString &hashKey)
{
    //Combine the folder path with the hash key to load the image.
    return QPixmap(m_imageFolderPath + "/" + hashKey + ".png");
}

void KNMusicLibraryImageManager::setHashAlbumArt(
        QHash<QString, QVariant> *scaledHashAlbumArt)
{
    //Save the two pointer.
    m_scaledHashAlbumArt = scaledHashAlbumArt;
}


/*-
 * <<
 * DBus
 * ==
 * Copyright (C) 2016 - 2019 Bridata
 * ==
 * 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.
 * >>
 */

package com.creditease.dbus.heartbeat.vo;

import java.io.Serializable;

/**
 * Created by mal on 2018/3/8.
 */
public class MasterSlaveDelayVo implements Serializable {

    private String masterLatestTime;

    private String slaveLatestTime;

    private Long diff;

    private String strDiff;

    private Long synTime;

    public String getMasterLatestTime() {
        return masterLatestTime;
    }

    public void setMasterLatestTime(String masterLatestTime) {
        this.masterLatestTime = masterLatestTime;
    }

    public String getSlaveLatestTime() {
        return slaveLatestTime;
    }

    public void setSlaveLatestTime(String slaveLatestTime) {
        this.slaveLatestTime = slaveLatestTime;
    }

    public Long getDiff() {
        return diff;
    }

    public void setDiff(Long diff) {
        this.diff = diff;
    }

    public String getStrDiff() {
        return strDiff;
    }

    public void setStrDiff(String strDiff) {
        this.strDiff = strDiff;
    }

    public Long getSynTime() {
        return synTime;
    }

    public void setSynTime(Long synTime) {
        this.synTime = synTime;
    }
}


# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you 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.

from aliyunsdkcore.request import RpcRequest
class ListApgroupConfigRequest(RpcRequest):

	def __init__(self):
		RpcRequest.__init__(self, 'cloudwf', '2017-03-28', 'ListApgroupConfig','cloudwf')

	def get_OrderCol(self):
		return self.get_query_params().get('OrderCol')

	def set_OrderCol(self,OrderCol):
		self.add_query_param('OrderCol',OrderCol)

	def get_SearchName(self):
		return self.get_query_params().get('SearchName')

	def set_SearchName(self,SearchName):
		self.add_query_param('SearchName',SearchName)

	def get_SearchCompany(self):
		return self.get_query_params().get('SearchCompany')

	def set_SearchCompany(self,SearchCompany):
		self.add_query_param('SearchCompany',SearchCompany)

	def get_Length(self):
		return self.get_query_params().get('Length')

	def set_Length(self,Length):
		self.add_query_param('Length',Length)

	def get_PageIndex(self):
		return self.get_query_params().get('PageIndex')

	def set_PageIndex(self,PageIndex):
		self.add_query_param('PageIndex',PageIndex)

	def get_OrderDir(self):
		return self.get_query_params().get('OrderDir')

	def set_OrderDir(self,OrderDir):
		self.add_query_param('OrderDir',OrderDir)


import PageHeader from './src/main';

/* istanbul ignore next */
PageHeader.install = function(Vue) {
  Vue.component(PageHeader.name, PageHeader);
};

export default PageHeader;


// @flow

declare function bar1<TKey: ?{+$data?: mixed}>(key: TKey): void;

function bar2(fragmentRef) {
  bar1(fragmentRef);
}

function foo(props: { userRef?: {} }) {
  const userRef = props.userRef;
  bar2(userRef);
}


const initialAppState = {
  currentPage: 'home',
  currentExample: '',
  srcUrl: ''
};

export default function handleActions(state = initialAppState, action) {
  let _appState = Object.assign({}, state);
  switch (action.type) {
    case 'AppNavMenuAction': _appState.currentPage = action.newPage; return _appState;
    default: return state;
  }
}


<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <global name="ERP5 Form" module="erp5.portal_type"/>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>_bind_names</string> </key>
            <value>
              <object>
                <klass>
                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
                </klass>
                <tuple/>
                <state>
                  <dictionary>
                    <item>
                        <key> <string>_asgns</string> </key>
                        <value>
                          <dictionary/>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>_objects</string> </key>
            <value>
              <tuple/>
            </value>
        </item>
        <item>
            <key> <string>action</string> </key>
            <value> <string>Base_edit</string> </value>
        </item>
        <item>
            <key> <string>description</string> </key>
            <value> <string></string> </value>
        </item>
        <item>
            <key> <string>edit_order</string> </key>
            <value>
              <list/>
            </value>
        </item>
        <item>
            <key> <string>encoding</string> </key>
            <value> <string>UTF-8</string> </value>
        </item>
        <item>
            <key> <string>enctype</string> </key>
            <value> <string></string> </value>
        </item>
        <item>
            <key> <string>group_list</string> </key>
            <value>
              <list>
                <string>left</string>
                <string>right</string>
                <string>center</string>
                <string>bottom</string>
                <string>hidden</string>
              </list>
            </value>
        </item>
        <item>
            <key> <string>groups</string> </key>
            <value>
              <dictionary>
                <item>
                    <key> <string>bottom</string> </key>
                    <value>
                      <list>
                        <string>listbox</string>
                      </list>
                    </value>
                </item>
                <item>
                    <key> <string>center</string> </key>
                    <value>
                      <list/>
                    </value>
                </item>
                <item>
                    <key> <string>hidden</string> </key>
                    <value>
                      <list>
                        <string>listbox_quantity_unit</string>
                      </list>
                    </value>
                </item>
                <item>
                    <key> <string>left</string> </key>
                    <value>
                      <list>
                        <string>my_quantity_unit</string>
                      </list>
                    </value>
                </item>
                <item>
                    <key> <string>right</string> </key>
                    <value>
                      <list>
                        <string>my_translated_validation_state_title</string>
                      </list>
                    </value>
                </item>
              </dictionary>
            </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>QuantityUnitConversionGroup_view</string> </value>
        </item>
        <item>
            <key> <string>method</string> </key>
            <value> <string>POST</string> </value>
        </item>
        <item>
            <key> <string>name</string> </key>
            <value> <string>QuantityUnitConversionGroup_view</string> </value>
        </item>
        <item>
            <key> <string>pt</string> </key>
            <value> <string>form_view</string> </value>
        </item>
        <item>
            <key> <string>row_length</string> </key>
            <value> <int>4</int> </value>
        </item>
        <item>
            <key> <string>stored_encoding</string> </key>
            <value> <string>UTF-8</string> </value>
        </item>
        <item>
            <key> <string>title</string> </key>
            <value> <string>Quantity Unit Conversion Group</string> </value>
        </item>
        <item>
            <key> <string>unicode_mode</string> </key>
            <value> <int>0</int> </value>
        </item>
        <item>
            <key> <string>update_action</string> </key>
            <value> <string></string> </value>
        </item>
        <item>
            <key> <string>update_action_title</string> </key>
            <value> <string></string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>


fileFormatVersion: 2
guid: e09f07f9be24b2d4180a74a671348b5b
folderAsset: yes
DefaultImporter:
  userData:
  assetBundleName:


// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE

(function(mod) {
  if (typeof exports == "object" && typeof module == "object") // CommonJS
    mod(require("../../lib/codemirror"));
  else if (typeof define == "function" && define.amd) // AMD
    define(["../../lib/codemirror"], mod);
  else // Plain browser env
    mod(CodeMirror);
})(function(CodeMirror) {
  var defaults = {
    pairs: "()[]{}''\"\"",
    triples: "",
    explode: "[]{}"
  };

  var Pos = CodeMirror.Pos;

  CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) {
    if (old && old != CodeMirror.Init) {
      cm.removeKeyMap(keyMap);
      cm.state.closeBrackets = null;
    }
    if (val) {
      cm.state.closeBrackets = val;
      cm.addKeyMap(keyMap);
    }
  });

  function getOption(conf, name) {
    if (name == "pairs" && typeof conf == "string") return conf;
    if (typeof conf == "object" && conf[name] != null) return conf[name];
    return defaults[name];
  }

  var bind = defaults.pairs + "`";
  var keyMap = {Backspace: handleBackspace, Enter: handleEnter};
  for (var i = 0; i < bind.length; i++)
    keyMap["'" + bind.charAt(i) + "'"] = handler(bind.charAt(i));

  function handler(ch) {
    return function(cm) { return handleChar(cm, ch); };
  }

  function getConfig(cm) {
    var deflt = cm.state.closeBrackets;
    if (!deflt) return null;
    var mode = cm.getModeAt(cm.getCursor());
    return mode.closeBrackets || deflt;
  }

  function handleBackspace(cm) {
    var conf = getConfig(cm);
    if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;

    var pairs = getOption(conf, "pairs");
    var ranges = cm.listSelections();
    for (var i = 0; i < ranges.length; i++) {
      if (!ranges[i].empty()) return CodeMirror.Pass;
      var around = charsAround(cm, ranges[i].head);
      if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;
    }
    for (var i = ranges.length - 1; i >= 0; i--) {
      var cur = ranges[i].head;
      cm.replaceRange("", Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1));
    }
  }

  function handleEnter(cm) {
    var conf = getConfig(cm);
    var explode = conf && getOption(conf, "explode");
    if (!explode || cm.getOption("disableInput")) return CodeMirror.Pass;

    var ranges = cm.listSelections();
    for (var i = 0; i < ranges.length; i++) {
      if (!ranges[i].empty()) return CodeMirror.Pass;
      var around = charsAround(cm, ranges[i].head);
      if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;
    }
    cm.operation(function() {
      cm.replaceSelection("\n\n", null);
      cm.execCommand("goCharLeft");
      ranges = cm.listSelections();
      for (var i = 0; i < ranges.length; i++) {
        var line = ranges[i].head.line;
        cm.indentLine(line, null, true);
        cm.indentLine(line + 1, null, true);
      }
    });
  }

  function handleChar(cm, ch) {
    var conf = getConfig(cm);
    if (!conf || cm.getOption("disableInput")) return CodeMirror.Pass;

    var pairs = getOption(conf, "pairs");
    var pos = pairs.indexOf(ch);
    if (pos == -1) return CodeMirror.Pass;
    var triples = getOption(conf, "triples");

    var identical = pairs.charAt(pos + 1) == ch;
    var ranges = cm.listSelections();
    var opening = pos % 2 == 0;

    var type, next;
    for (var i = 0; i < ranges.length; i++) {
      var range = ranges[i], cur = range.head, curType;
      var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));
      if (opening && !range.empty()) {
        curType = "surround";
      } else if ((identical || !opening) && next == ch) {
        if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)
          curType = "skipThree";
        else
          curType = "skip";
      } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&
                 cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch &&
                 (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) {
        curType = "addFour";
      } else if (identical) {
        if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, ch)) curType = "both";
        else return CodeMirror.Pass;
      } else if (opening && (cm.getLine(cur.line).length == cur.ch ||
                             isClosingBracket(next, pairs) ||
                             /\s/.test(next))) {
        curType = "both";
      } else {
        return CodeMirror.Pass;
      }
      if (!type) type = curType;
      else if (type != curType) return CodeMirror.Pass;
    }

    var left = pos % 2 ? pairs.charAt(pos - 1) : ch;
    var right = pos % 2 ? ch : pairs.charAt(pos + 1);
    cm.operation(function() {
      if (type == "skip") {
        cm.execCommand("goCharRight");
      } else if (type == "skipThree") {
        for (var i = 0; i < 3; i++)
          cm.execCommand("goCharRight");
      } else if (type == "surround") {
        var sels = cm.getSelections();
        for (var i = 0; i < sels.length; i++)
          sels[i] = left + sels[i] + right;
        cm.replaceSelections(sels, "around");
      } else if (type == "both") {
        cm.replaceSelection(left + right, null);
        cm.triggerElectric(left + right);
        cm.execCommand("goCharLeft");
      } else if (type == "addFour") {
        cm.replaceSelection(left + left + left + left, "before");
        cm.execCommand("goCharRight");
      }
    });
  }

  function isClosingBracket(ch, pairs) {
    var pos = pairs.lastIndexOf(ch);
    return pos > -1 && pos % 2 == 1;
  }

  function charsAround(cm, pos) {
    var str = cm.getRange(Pos(pos.line, pos.ch - 1),
                          Pos(pos.line, pos.ch + 1));
    return str.length == 2 ? str : null;
  }

  // Project the token type that will exists after the given char is
  // typed, and use it to determine whether it would cause the start
  // of a string token.
  function enteringString(cm, pos, ch) {
    var line = cm.getLine(pos.line);
    var token = cm.getTokenAt(pos);
    if (/\bstring2?\b/.test(token.type)) return false;
    var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);
    stream.pos = stream.start = token.start;
    for (;;) {
      var type1 = cm.getMode().token(stream, token.state);
      if (stream.pos >= pos.ch + 1) return /\bstring2?\b/.test(type1);
      stream.start = stream.pos;
    }
  }
});


extern crate postgres;

use postgres::{Connection, TlsMode, Result};
use postgres::transaction::Transaction;
use self::postgres::error::T_R_SERIALIZATION_FAILURE;

/// Runs op inside a transaction and retries it as needed.
/// On non-retryable failures, the transaction is aborted and
/// rolled back; on success, the transaction is committed.
fn execute_txn<T, F>(conn: &Connection, mut op: F) -> Result<T>
where
    F: FnMut(&Transaction) -> Result<T>,
{
    let txn = conn.transaction()?;
    loop {
        let sp = txn.savepoint("cockroach_restart")?;
        match op(&sp).and_then(|t| sp.commit().map(|_| t)) {
            Err(ref err) if err.as_db()
                               .map(|e| e.code == T_R_SERIALIZATION_FAILURE)
                               .unwrap_or(false) => {},
            r => break r,
        }
    }.and_then(|t| txn.commit().map(|_| t))
}

fn transfer_funds(txn: &Transaction, from: i64, to: i64, amount: i64) -> Result<()> {
    // Read the balance.
    let from_balance: i64 = txn.query("SELECT balance FROM accounts WHERE id = $1", &[&from])?
        .get(0)
        .get(0);

    assert!(from_balance >= amount);

    // Perform the transfer.
    txn.execute(
        "UPDATE accounts SET balance = balance - $1 WHERE id = $2",
        &[&amount, &from],
    )?;
    txn.execute(
        "UPDATE accounts SET balance = balance + $1 WHERE id = $2",
        &[&amount, &to],
    )?;
    Ok(())
}

fn main() {
    let conn = Connection::connect("postgresql://maxroach@localhost:26257/bank", TlsMode::None)
        .unwrap();

    // Run a transfer in a transaction.
    execute_txn(&conn, |txn| transfer_funds(txn, 1, 2, 100)).unwrap();

    // Check account balances after the transaction.
    for row in &conn.query("SELECT id, balance FROM accounts", &[]).unwrap() {
        let id: i64 = row.get(0);
        let balance: i64 = row.get(1);
        println!("{} {}", id, balance);
    }
}


/*
 * Copyright (c) 2009 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 *
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 *
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 *
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#include <string.h>
#include <sys/types.h>
#include <AssertMacros.h>

#if !KERNEL
    #include <stdio.h>
    #include <stdlib.h>
    #include "kxld.h"
    #include "kxld_types.h"
#else
    #include <libkern/libkern.h>
    #include <libkern/kxld.h>
    #include <libkern/kxld_types.h>
#endif /* KERNEL */

#include "kxld_util.h"

/******************************************************************************
* Macros
******************************************************************************/

#define kCopyrightToken "Copyright © "
#define kRightsToken " Apple Inc. All rights reserved."

/******************************************************************************
* Globals
******************************************************************************/

#if TEST

#include <CoreFoundation/CoreFoundation.h>

CFStringRef passes[] = {
    CFSTR("Copyright © 2008 Apple Inc. All rights reserved."),
    CFSTR("Copyright © 2004-2008 Apple Inc. All rights reserved."),
    CFSTR("Copyright © 2004,2006 Apple Inc. All rights reserved."),
    CFSTR("Copyright © 2004,2006-2008 Apple Inc. All rights reserved."),
    CFSTR("Copyright © 2004 , 2006-2008 Apple Inc. All rights reserved."),
    CFSTR("Copyright © 1998,2000-2002,2004,2006-2008 Apple Inc. All rights reserved."),
    CFSTR("IOPCIFamily 2.1; Copyright © 2004,2006-2008 Apple Inc. All rights reserved."),
    CFSTR("Copyright © 2004,2006-2008 Apple Inc. All rights reserved.  The quick brown fox jumped over the lazy dog."),
    CFSTR("IOPCIFamily 2.1; Copyright © 2004,2006-2008 Apple Inc. All rights reserved.  The quick brown fox jumped over the lazy dog.")
};

CFStringRef fails[] = {
    CFSTR("Copyright © 2007-08 Apple Inc. All rights reserved."),
    CFSTR("Copyright (c) 2007 Apple Inc. All rights reserved."),
    CFSTR("Copyright © 2007- Apple Inc. All rights reserved."),
    CFSTR("Copyright © 2007 - 2008 Apple Inc. All rights reserved.")
};

extern char *createUTF8CStringForCFString(CFStringRef aString);

#endif /* TEST */

/******************************************************************************
* Prototypes
******************************************************************************/

static boolean_t is_space(const char c)
    __attribute__((const));
static boolean_t is_token_delimiter(const char c)
    __attribute__((const));
static boolean_t is_token_break(const char *str)
    __attribute__((pure, nonnull));
static boolean_t token_is_year(const char *str)
    __attribute__((pure, nonnull));
static boolean_t token_is_yearRange(const char *str)
    __attribute__((pure, nonnull));
static boolean_t dates_are_valid(const char *str, const u_long len)
    __attribute__((pure, nonnull));

/******************************************************************************
******************************************************************************/
static boolean_t
is_space(const char c)
{
    switch (c) {
    case ' ':
    case '\t':
    case '\n':
    case '\v':
    case '\f':
    case '\r':
        return TRUE;
    }

    return FALSE;
}

/******************************************************************************
******************************************************************************/
static boolean_t
is_token_delimiter(const char c)
{
    return (is_space(c) || (',' == c) || ('\0' == c));
}

/******************************************************************************
* A token break is defined to be the boundary where the current character is
* not a token delimiter and the next character is a token delimiter.
******************************************************************************/
static boolean_t
is_token_break(const char *str)
{
    /* This is safe because '\0' is a token delimiter, so the second check
     * will not execute if we reach the end of the string.
     */
    return (!is_token_delimiter(str[0]) && is_token_delimiter(str[1]));
}

/******************************************************************************
* A year is defined by the following regular expression:
*   /[0-9]{4}$/
******************************************************************************/
#define kYearLen 5
static boolean_t
token_is_year(const char *str)
{
    boolean_t result = FALSE;
    u_int i = 0;

    for (i = 0; i < kYearLen - 1; ++i) {
        if (str[i] < '0' || str[i] > '9') goto finish;
    }

    if (str[i] != '\0') goto finish;

    result = TRUE;
finish:
    return result;
}

/******************************************************************************
* A year range is defined by the following regular expression:
*   /[0-9]{4}[-][0-9]{4}$/
******************************************************************************/
#define kYearRangeLen 10
static boolean_t
token_is_yearRange(const char *str)
{
    boolean_t result = FALSE;
    u_int i = 0;

    for (i = 0; i < kYearLen - 1; ++i) {
        if (str[i] < '0' || str[i] > '9') goto finish;
    }

    if (str[i] != '-') goto finish;

    for (i = kYearLen; i < kYearRangeLen - 1; ++i) {
        if (str[i] < '0' || str[i] > '9') goto finish;
    }

    if (str[i] != '\0') goto finish;

    result = TRUE;
finish:
    return result;
}

/******************************************************************************
* The dates_are_valid function takes as input a comma-delimited list of years
* and year ranges, and returns TRUE if all years and year ranges are valid
* and well-formed.
******************************************************************************/
static boolean_t
dates_are_valid(const char *str, const u_long len)
{
    boolean_t result = FALSE;
    const char *token_ptr = NULL;
    char token_buffer[kYearRangeLen];
    u_int token_index = 0;

    token_index = 0;
    for (token_ptr = str; token_ptr < str + len; ++token_ptr) {
        if (is_token_delimiter(*token_ptr) && !token_index) continue;

        /* If we exceed the length of a year range, the test will not succeed,
         * so just fail now.  This limits the length of the token buffer that
         * we have to keep around.
         */
        if (token_index == kYearRangeLen) goto finish;

        token_buffer[token_index++] = *token_ptr;
        if (is_token_break(token_ptr)) {
            if (!token_index) continue;

            token_buffer[token_index] = '\0';

            if (!token_is_year(token_buffer) &&
                !token_is_yearRange(token_buffer))
            {
                goto finish;
            }

            token_index = 0;
        }
    }

    result = TRUE;
finish:
    return result;
}

/******************************************************************************
* The copyright string is composed of three parts:
*   1) A copyright notice, "Copyright ©"
*   2) One or more years or year ranges, e.g., "2004,2006-2008"
*   3) A rights reserved notice, "Apple Inc. All Rights Reserved."
* We check the validity of the string by searching for both the copyright

* notice and the rights reserved notice.  If both are found, we then check that
* the text between the two notices contains only valid years and year ranges.
******************************************************************************/
boolean_t
kxld_validate_copyright_string(const char *str)
{
    boolean_t result = FALSE;
    const char *copyright = NULL;
    const char *rights = NULL;
    char *date_str = NULL;
    u_long len = 0;

    copyright = kxld_strstr(str, kCopyrightToken);
    rights = kxld_strstr(str, kRightsToken);

    if (!copyright || !rights || copyright > rights) goto finish;

    str = copyright + const_strlen(kCopyrightToken);

    len = rights - str;
    date_str = kxld_alloc(len+1);
    if (!date_str) goto finish;

    strncpy(date_str, str, len);
    date_str[len] = '\0';

    if (!dates_are_valid(date_str, len)) goto finish;

    result = TRUE;
finish:
    if (date_str) kxld_free(date_str, len+1);
    return result;
}

#if TEST

/******************************************************************************
******************************************************************************/
int
main(int argc __unused, char *argv[] __unused)
{
    int result = 1;
    CFStringRef the_string = NULL;
    const char *str = NULL;
    u_int i = 0;

    printf("The following %lu strings should pass\n",
        const_array_len(passes));

    for (i = 0; i < const_array_len(passes); ++i) {
        the_string = passes[i];
        str = createUTF8CStringForCFString(the_string);
        if (!str) goto finish;

        printf("%s: %s\n",
            (kxld_validate_copyright_string(str)) ? "pass" : "fail", str);
    }

    printf("\nThe following %lu strings should fail\n",
        const_array_len(fails));

    for (i = 0; i < const_array_len(fails); ++i) {
        the_string = fails[i];
        str = createUTF8CStringForCFString(the_string);
        if (!str) goto finish;

        printf("%s: %s\n",
            (kxld_validate_copyright_string(str)) ? "pass" : "fail", str);
    }

    result = 0;

finish:
    return result;
}
#endif /* TEST */


/***************************************************************************
 *                (C) Copyright 2005-2013 - Faiumoni e. V.                 *
 ***************************************************************************
 ***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
package games.stendhal.server.entity.status;

import java.util.Collections;
import java.util.List;

import games.stendhal.server.core.events.TurnListener;
import games.stendhal.server.core.events.TurnNotifier;
import games.stendhal.server.entity.RPEntity;
import games.stendhal.server.entity.player.Player;

/**
 * eating turn listener
 */
public class EatStatusTurnListener implements TurnListener {
	private StatusList statusList;
	private static final String ATTRIBUTE_NAME = "eating";
	private static final String ATTRIBUTE_NAME_CHOKING = "choking";

	/**
	 * EatStatusTurnListener
	 *
	 * @param statusList StatusList
	 */
	public EatStatusTurnListener(StatusList statusList) {
		this.statusList = statusList;
	}

	@Override
	public void onTurnReached(int turn) {
		RPEntity entity = statusList.getEntity();
		List<EatStatus> toConsume = statusList.getAllStatusByClass(EatStatus.class);

		// check that the entity exists
		if (entity == null) {
			return;
		}

		// cleanup status
		if (toConsume.isEmpty()) {
			if (entity.has(ATTRIBUTE_NAME)) {
				entity.remove(ATTRIBUTE_NAME);
			}
			if (entity.has(ATTRIBUTE_NAME_CHOKING)) {
				entity.remove(ATTRIBUTE_NAME_CHOKING);
			}
			entity.notifyWorldAboutChanges();
			return;
		}

		Collections.sort(toConsume);
		final ConsumableStatus food = toConsume.get(0);

		if (turn % food.getFrecuency() == 0) {
			final int amount = food.consume();
			if (isChoking(toConsume)) {
				entity.put(ATTRIBUTE_NAME_CHOKING, amount);
			} else {
				if (entity.has(ATTRIBUTE_NAME_CHOKING)) {
					entity.remove(ATTRIBUTE_NAME_CHOKING);
				}
				entity.put(ATTRIBUTE_NAME, amount);
				entity.notifyWorldAboutChanges();
			}

			// is full hp?
			if (entity.heal(amount, true) == 0) {
				if (entity instanceof Player) {
					statusList.removeAll(EatStatus.class);
				}
			}

			// is item used up?
			if (food.consumed()) {
				statusList.remove(food);
			}
		}

		TurnNotifier.get().notifyInTurns(0, this);
	}

	private boolean isChoking(List<EatStatus> toConsume) {
		return toConsume.size() > 5;
	}

	@Override
	public int hashCode() {
		return statusList.hashCode() * 31;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if ((obj == null) || (getClass() != obj.getClass())) {
			return false;
		}
		EatStatusTurnListener other = (EatStatusTurnListener) obj;
		return statusList.equals(other.statusList);
	}

}


<?php
/**
 * System messages translation for CodeIgniter(tm)
 *
 * @author	CodeIgniter community
 * @copyright	Copyright (c) 2014-2019, British Columbia Institute of Technology (https://bcit.ca/)
 * @license	http://opensource.org/licenses/MIT	MIT License
 * @link	https://codeigniter.com
 */
defined('BASEPATH') OR exit('No direct script access allowed');

$lang['db_invalid_connection_str'] = 'Невозможно определить параметры базы данных на основе строки подключения, которую вы предоставили.';
$lang['db_unable_to_connect'] = 'Невозможно подключиться к серверу базы данных, используя предоставленные параметры.';
$lang['db_unable_to_select'] = 'Невозможно выбрать указанную базу данных: %s';
$lang['db_unable_to_create'] = 'Невозможно создать указанную базу данных: %s';
$lang['db_invalid_query'] = 'Представленный вами запрос является недопустимым.';
$lang['db_must_set_table'] = 'Необходимо указать таблицу базы данных, которая будет использована в вашем запросе.';
$lang['db_must_use_set'] = 'Необходимо использовать метод "set" для обновления запись.';
$lang['db_must_use_index'] = 'Необходимо указать индекс для пакетного обновления.';
$lang['db_batch_missing_index'] = 'Одна или несколько строк представленных для пакетного обновления не содержит указанный индекс.';
$lang['db_must_use_where'] = 'Обновления не допускаются, без указания условия через "where" оператор.';
$lang['db_del_must_use_where'] = 'Удаления не допускаются, без указания условия через "where" или "like" параметр.';
$lang['db_field_param_missing'] = 'Для выборки полей необходимо имя таблицы в качестве параметра.';
$lang['db_unsupported_function'] = 'Эта функция не доступна для используемой базы данных.';
$lang['db_transaction_failure'] = 'Транзакция не удалась: Осуществляется откат.';
$lang['db_unable_to_drop'] = 'Невозможно удалить указанную базу данных.';
$lang['db_unsupported_feature'] = 'Неподдерживаемая особенность платформы базы данных которую вы используете.';
$lang['db_unsupported_compression'] = 'Формат сжатия файлов который вы выбрали не поддерживается вашим сервером.';
$lang['db_filepath_error'] = 'Невозможно записать данные в файл, используя путь который вы указали.';
$lang['db_invalid_cache_path'] = 'Путь до кеш файлов, указанный вами, некорректен или недоступен для записи.';
$lang['db_table_name_required'] = 'Необходимо указать имя таблицы для этой операции.';
$lang['db_column_name_required'] = 'Необходимо указать имя столбца для этой операции.';
$lang['db_column_definition_required'] = 'Указание столбца обязательно для этой операции.';
$lang['db_unable_to_set_charset'] = 'Невозможно установить кодировку соединения: %s';
$lang['db_error_heading'] = 'Ошибка базы данных.';


<?php
/**
 *
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace Magento\Customer\Api\Data;

/**
 * Validation results interface.
 * @api
 * @since 100.0.2
 */
interface ValidationResultsInterface
{
    /**#@+
     * Constants for keys of data array
     */
    const VALID = 'valid';
    const MESSAGES = 'messages';
    /**#@-*/

    /**
     * Check if the provided data is valid.
     *
     * @return bool
     */
    public function isValid();

    /**
     * Set if the provided data is valid.
     *
     * @param bool $isValid
     * @return $this
     */
    public function setIsValid($isValid);

    /**
     * Get error messages as array in case of validation failure, else return empty array.
     *
     * @return string[]
     */
    public function getMessages();

    /**
     * Set error messages as array in case of validation failure.
     *
     * @param string[] $messages
     * @return string[]
     */
    public function setMessages(array $messages);
}


# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
#
# To ban all spiders from the entire site uncomment the next two lines:
# User-Agent: *
# Disallow: /


/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 */
package org.apache.omid.tso;

import org.apache.commons.pool2.PooledObject;
import org.jboss.netty.channel.Channel;
import org.mockito.Mock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import static org.mockito.MockitoAnnotations.initMocks;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;

public class TestBatch {

    private static final Logger LOG = LoggerFactory.getLogger(TestBatch.class);

    private static final int BATCH_SIZE = 1000;

    private static final long ANY_ST = 1231;
    private static final long ANY_CT = 2241;

    @Mock
    private Channel channel;
    @Mock
    private MonitoringContext monCtx;

    @BeforeMethod
    void setup() {
        initMocks(this);
    }

    @Test(timeOut = 10_000)
    public void testBatchFunctionality() {

        // Component to test
        Batch batch = new Batch(0, BATCH_SIZE);

        // Test initial state is OK
        assertTrue(batch.isEmpty(), "Batch should be empty");
        assertFalse(batch.isFull(), "Batch shouldn't be full");
        assertEquals(batch.getNumEvents(), 0, "Num events should be 0");

        // Test getting or setting an element in the batch greater than the current number of events is illegal
        try {
            batch.get(1);
            fail();
        } catch (IllegalStateException ex) {
            // Expected, as we can not access elements in the batch greater than the current number of events
        }
        try {
            batch.set(1, new PersistEvent());
            fail();
        } catch (IllegalStateException ex) {
            // Expected, as we can not access elements in the batch greater than the current number of events
        }

        // Test when filling the batch with different types of events, that becomes full
        for (int i = 0; i < BATCH_SIZE; i++) {
            if (i % 4 == 0) {
                batch.addTimestamp(ANY_ST, channel, monCtx);
            } else if (i % 4 == 1) {
                batch.addCommit(ANY_ST, ANY_CT, channel, monCtx);
            } else if (i % 4 == 2) {
                batch.addCommitRetry(ANY_ST, channel, monCtx);
            } else {
                batch.addAbort(ANY_ST, channel, monCtx);
            }
        }
        assertFalse(batch.isEmpty(), "Batch should contain elements");
        assertTrue(batch.isFull(), "Batch should be full");
        assertEquals(batch.getNumEvents(), BATCH_SIZE, "Num events should be " + BATCH_SIZE);

        // Test an exception is thrown when batch is full and a new element is going to be added
        try {
            batch.addCommit(ANY_ST, ANY_CT, channel, monCtx);
            fail("Should throw an IllegalStateException");
        } catch (IllegalStateException e) {
            assertEquals(e.getMessage(), "batch is full", "message returned doesn't match");
            LOG.debug("IllegalStateException catch properly");
        }
        assertTrue(batch.isFull(), "Batch shouldn't be empty");

        // Check the first 3 events and the last one correspond to the filling done above
        assertTrue(batch.get(0).getType().equals(PersistEvent.Type.TIMESTAMP));
        assertTrue(batch.get(1).getType().equals(PersistEvent.Type.COMMIT));
        assertTrue(batch.get(2).getType().equals(PersistEvent.Type.COMMIT_RETRY));
        assertTrue(batch.get(3).getType().equals(PersistEvent.Type.ABORT));

        // Set a new value for last element in Batch and check we obtain the right result
        batch.decreaseNumEvents();
        assertEquals(batch.getNumEvents(), BATCH_SIZE - 1, "Num events should be " + (BATCH_SIZE - 1));
        try {
            batch.get(BATCH_SIZE - 1);
            fail();
        } catch (IllegalStateException ex) {
            // Expected, as we can not access elements in the batch greater than the current number of events
        }

        // Re-check that batch is NOT full
        assertFalse(batch.isFull(), "Batch shouldn't be full");

        // Clear the batch and goes back to its initial state
        batch.clear();
        assertTrue(batch.isEmpty(), "Batch should be empty");
        assertFalse(batch.isFull(), "Batch shouldn't be full");
        assertEquals(batch.getNumEvents(), 0, "Num events should be 0");

    }

    @Test(timeOut = 10_000)
    public void testBatchFactoryFunctionality() throws Exception {

        // Component to test
        Batch.BatchFactory factory = new Batch.BatchFactory(BATCH_SIZE);

        // Check the factory creates a new batch properly...
        Batch batch = factory.create();
        assertTrue(batch.isEmpty(), "Batch should be empty");
        assertFalse(batch.isFull(), "Batch shouldn't be full");
        assertEquals(batch.getNumEvents(), 0, "Num events should be 0");

        // ...and is wrapped in to a pooled object
        PooledObject<Batch> pooledBatch = factory.wrap(batch);
        assertEquals(pooledBatch.getObject(), batch);

        // Put some elements in the batch...
        batch.addTimestamp(ANY_ST, channel, monCtx);
        batch.addCommit(ANY_ST, ANY_CT, channel, monCtx);
        batch.addCommitRetry(ANY_ST, channel, monCtx);
        batch.addAbort(ANY_ST, channel, monCtx);
        assertFalse(batch.isEmpty(), "Batch should contain elements");
        assertFalse(batch.isFull(), "Batch should NOT be full");
        assertEquals(batch.getNumEvents(), 4, "Num events should be 4");

        // ... and passivate the object through the factory. It should reset the state of the batch
        factory.passivateObject(pooledBatch);
        assertTrue(batch.isEmpty(), "Batch should NOT contain elements");
        assertFalse(batch.isFull(), "Batch should NOT be full");
        assertEquals(batch.getNumEvents(), 0, "Num events should be 0");

    }

}