text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>

#include "mscorlib_System_ValueType1744280289.h"
#include "mscorlib_System_IntPtr4010401971.h"

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif

// System.RuntimeFieldHandle
struct  RuntimeFieldHandle_t2347752062
{
public:
	// System.IntPtr System.RuntimeFieldHandle::value
	IntPtr_t ___value_0;

public:
	inline static int32_t get_offset_of_value_0() { return static_cast<int32_t>(offsetof(RuntimeFieldHandle_t2347752062, ___value_0)); }
	inline IntPtr_t get_value_0() const { return ___value_0; }
	inline IntPtr_t* get_address_of_value_0() { return &___value_0; }
	inline void set_value_0(IntPtr_t value)
	{
		___value_0 = value;
	}
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif
// Native definition for marshalling of: System.RuntimeFieldHandle
struct RuntimeFieldHandle_t2347752062_marshaled_pinvoke
{
	intptr_t ___value_0;
};
// Native definition for marshalling of: System.RuntimeFieldHandle
struct RuntimeFieldHandle_t2347752062_marshaled_com
{
	intptr_t ___value_0;
};


text:
using WebKit::WebApplicationCacheHost;
using WebKit::WebFrame;
using WebKit::WebMessagePortChannel;
using WebKit::WebMessagePortChannelArray;
using WebKit::WebSecurityOrigin;
using WebKit::WebString;
using WebKit::WebWorker;
using WebKit::WebSharedWorkerClient;

namespace content {

// How long to wait for worker to finish after it's been told to terminate.
#define kMaxTimeForRunawayWorkerSeconds 3

WebSharedWorkerClientProxy::WebSharedWorkerClientProxy(
    int route_id, WebSharedWorkerStub* stub)
    : route_id_(route_id),
      appcache_host_id_(0),
      stub_(stub),
      ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
      devtools_agent_(NULL) {
}

WebSharedWorkerClientProxy::~WebSharedWorkerClientProxy() {
}

void WebSharedWorkerClientProxy::postMessageToWorkerObject(
    const WebString& message,
    const WebMessagePortChannelArray& channels) {
  std::vector<int> message_port_ids(channels.size());
  std::vector<int> routing_ids(channels.size());
  for (size_t i = 0; i < channels.size(); ++i) {
    WebMessagePortChannelImpl* webchannel =
        static_cast<WebMessagePortChannelImpl*>(channels[i]);
    message_port_ids[i] = webchannel->message_port_id();
    webchannel->QueueMessages();
    DCHECK(message_port_ids[i] != MSG_ROUTING_NONE);
    routing_ids[i] = MSG_ROUTING_NONE;
  }

  Send(new WorkerMsg_PostMessage(
      route_id_, message, message_port_ids, routing_ids));
}

void WebSharedWorkerClientProxy::postExceptionToWorkerObject(
    const WebString& error_message,
    int line_number,
    const WebString& source_url) {
  Send(new WorkerHostMsg_PostExceptionToWorkerObject(
      route_id_, error_message, line_number, source_url));
}

void WebSharedWorkerClientProxy::postConsoleMessageToWorkerObject(
    int source,
    int type,
    int level,
    const WebString& message,
    int line_number,
    const WebString& source_url) {
  WorkerHostMsg_PostConsoleMessageToWorkerObject_Params params;
  params.source_identifier = source;
  params.message_type = type;
  params.message_level = level;
  params.message = message;
  params.line_number = line_number;
  params.source_url = source_url;
  Send(new WorkerHostMsg_PostConsoleMessageToWorkerObject(route_id_, params));
}

void WebSharedWorkerClientProxy::confirmMessageFromWorkerObject(
    bool has_pending_activity) {
  Send(new WorkerHostMsg_ConfirmMessageFromWorkerObject(
      route_id_, has_pending_activity));
}

void WebSharedWorkerClientProxy::reportPendingActivity(
    bool has_pending_activity) {
  Send(new WorkerHostMsg_ReportPendingActivity(
      route_id_, has_pending_activity));
}

void WebSharedWorkerClientProxy::workerContextClosed() {
  Send(new WorkerHostMsg_WorkerContextClosed(route_id_));
}

void WebSharedWorkerClientProxy::workerContextDestroyed() {
  Send(new WorkerHostMsg_WorkerContextDestroyed(route_id_));
  // Tell the stub that the worker has shutdown - frees this object.
  if (stub_)
    stub_->Shutdown();
}

WebKit::WebNotificationPresenter*
WebSharedWorkerClientProxy::notificationPresenter() {
  // TODO(johnnyg): Notifications are not yet hooked up to workers.
  // Coming soon.
  NOTREACHED();
  return NULL;
}

WebApplicationCacheHost* WebSharedWorkerClientProxy::createApplicationCacheHost(
    WebKit::WebApplicationCacheHostClient* client) {
  WorkerWebApplicationCacheHostImpl* host =
      new WorkerWebApplicationCacheHostImpl(stub_->appcache_init_info(),
                                            client);
  // Remember the id of the instance we create so we have access to that
  // value when creating nested dedicated workers in createWorker.
  appcache_host_id_ = host->host_id();
  return host;
}

// TODO(abarth): Security checks should use WebDocument or WebSecurityOrigin,
// not WebFrame as the context object because WebFrames can contain different
// WebDocuments at different times.
bool WebSharedWorkerClientProxy::allowDatabase(WebFrame* frame,
                                         const WebString& name,
                                         const WebString& display_name,
                                         unsigned long estimated_size) {
  WebSecurityOrigin origin = frame->document().securityOrigin();
  if (origin.isUnique())
    return false;

  bool result = false;
  Send(new WorkerProcessHostMsg_AllowDatabase(
      route_id_, GURL(origin.toString().utf8()), name, display_name,
      estimated_size, &result));
  return result;
}

bool WebSharedWorkerClientProxy::allowFileSystem() {
  bool result = false;
  Send(new WorkerProcessHostMsg_AllowFileSystem(
      route_id_, stub_->url().GetOrigin(), &result));
  return result;
}

void WebSharedWorkerClientProxy::openFileSystem(
    WebKit::WebFileSystem::Type type,
    long long size,
    bool create,
    WebKit::WebFileSystemCallbacks* callbacks) {
  ChildThread::current()->file_system_dispatcher()->OpenFileSystem(
      stub_->url().GetOrigin(), static_cast<fileapi::FileSystemType>(type),
      size, create, new WebFileSystemCallbackDispatcher(callbacks));
}

bool WebSharedWorkerClientProxy::allowIndexedDB(const WebKit::WebString& name) {
  bool result = false;
  Send(new WorkerProcessHostMsg_AllowIndexedDB(
      route_id_, stub_->url().GetOrigin(), name, &result));
  return result;
}

void WebSharedWorkerClientProxy::dispatchDevToolsMessage(
    const WebString& message) {
  if (devtools_agent_)
    devtools_agent_->SendDevToolsMessage(message);
}

void WebSharedWorkerClientProxy::saveDevToolsAgentState(
    const WebKit::WebString& state) {
  if (devtools_agent_)
    devtools_agent_->SaveDevToolsAgentState(state);
}

bool WebSharedWorkerClientProxy::Send(IPC::Message* message) {
  return WorkerThread::current()->Send(message);
}

void WebSharedWorkerClientProxy::EnsureWorkerContextTerminates() {
  // This shuts down the process cleanly from the perspective of the browser
  // process, and avoids the crashed worker infobar from appearing to the new
  // page. It's ok to post several of theese, because the first executed task
  // will exit the message loop and subsequent ones won't be executed.
  MessageLoop::current()->PostDelayedTask(FROM_HERE,
      base::Bind(
          &WebSharedWorkerClientProxy::workerContextDestroyed,
          weak_factory_.GetWeakPtr()),
      base::TimeDelta::FromSeconds(kMaxTimeForRunawayWorkerSeconds));
}

}  // namespace content

redpajama_set_name: RedPajamaGithub


text:
package com.infinityworks.common.lang;

import com.infinityworks.common.logging.LambdaLogger;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;

import static org.mockito.Mockito.*;

public class LambdaLoggerTest {

    private LambdaLogger logger;
    private Logger backingLogger;

    @Before
    public void setUp() throws Exception {
        backingLogger = mock(Logger.class);
        logger = new LambdaLogger(backingLogger);
    }

    @Test
    public void shouldLogWarningWhenEnabled() throws Exception {
        when(backingLogger.isWarnEnabled()).thenReturn(true);
        logger.warn(() -> "Warning");
        verify(backingLogger, times(1)).warn("Warning");
    }

    @Test
    public void shouldNotLogWarningWhenDisabled() throws Exception {
        when(backingLogger.isWarnEnabled()).thenReturn(false);
        logger.warn(() -> "Warning");
        verify(backingLogger, times(0)).warn(anyString());
    }

    @Test
    public void shouldLogDebugWhenEnabled() throws Exception {
        when(backingLogger.isDebugEnabled()).thenReturn(true);
        logger.debug(() -> "Debug");
        verify(backingLogger, times(1)).debug("Debug");
    }

    @Test
    public void shouldNotLogDebugWhenDisabled() throws Exception {
        when(backingLogger.isDebugEnabled()).thenReturn(false);
        logger.warn(() -> "Debug");
        verify(backingLogger, times(0)).warn(anyString());
    }

    @Test
    public void shouldLogInfoWhenEnabled() throws Exception {
        when(backingLogger.isInfoEnabled()).thenReturn(true);
        logger.info(() -> "Info");
        verify(backingLogger, times(1)).info("Info");
    }

    @Test
    public void shouldNotLogInfoWhenDisabled() throws Exception {
        when(backingLogger.isInfoEnabled()).thenReturn(false);
        logger.info(() -> "Info");
        verify(backingLogger, times(0)).info(anyString());
    }

    @Test
    public void shouldLogErrorWhenEnabled() throws Exception {
        when(backingLogger.isErrorEnabled()).thenReturn(true);
        logger.error(() -> "Error");
        verify(backingLogger, times(1)).error("Error");
    }

    @Test
    public void shouldNotLogErrorWhenDisabled() throws Exception {
        when(backingLogger.isErrorEnabled()).thenReturn(false);
        logger.error(() -> "Error");
        verify(backingLogger, times(0)).error(anyString());
    }

    @Test
    public void shouldLogTraceWhenEnabled() throws Exception {
        when(backingLogger.isTraceEnabled()).thenReturn(true);
        logger.trace(() -> "Trace");
        verify(backingLogger, times(1)).trace("Trace");
    }

    @Test
    public void shouldNotLogTraceWhenDisabled() throws Exception {
        when(backingLogger.isTraceEnabled()).thenReturn(false);
        logger.trace(() -> "Trace");
        verify(backingLogger, times(0)).trace(anyString());
    }
}


text:
#ifndef _PERFMGR_EVENT_DB_H_
#define _PERFMGR_EVENT_DB_H_

#ifdef ENABLE_OSM_PERF_MGR

#include <stdio.h>
#include <time.h>
#include <iba/ib_types.h>
#include <complib/cl_qmap.h>
#include <complib/cl_passivelock.h>

#ifdef __cplusplus
#  define BEGIN_C_DECLS extern "C" {
#  define END_C_DECLS   }
#else				/* !__cplusplus */
#  define BEGIN_C_DECLS
#  define END_C_DECLS
#endif				/* __cplusplus */

BEGIN_C_DECLS

struct osm_perfmgr;
/****h* OpenSM/PerfMgr Event Database
* DESCRIPTION
*       Database interface to record subnet events
*
*       Implementations of this object _MUST_ be thread safe.
*
* AUTHOR
*	Ira Weiny, LLNL
*
*********/
typedef enum {
	PERFMGR_EVENT_DB_SUCCESS = 0,
	PERFMGR_EVENT_DB_FAIL,
	PERFMGR_EVENT_DB_NOMEM,
	PERFMGR_EVENT_DB_GUIDNOTFOUND,
	PERFMGR_EVENT_DB_PORTNOTFOUND,
	PERFMGR_EVENT_DB_NOT_IMPL
} perfmgr_db_err_t;

/** =========================================================================
 * Port error reading
 */
typedef struct {
	uint64_t symbol_err_cnt;
	uint64_t link_err_recover;
	uint64_t link_downed;
	uint64_t rcv_err;
	uint64_t rcv_rem_phys_err;
	uint64_t rcv_switch_relay_err;
	uint64_t xmit_discards;
	uint64_t xmit_constraint_err;
	uint64_t rcv_constraint_err;
	uint64_t link_integrity;
	uint64_t buffer_overrun;
	uint64_t vl15_dropped;
	time_t time;
} perfmgr_db_err_reading_t;

/** =========================================================================
 * Port data count reading
 */
typedef struct {
	uint64_t xmit_data;	/* can be used for std or extended */
	uint64_t rcv_data;	/* can be used for std or extended */
	uint64_t xmit_pkts;	/* can be used for std or extended */
	uint64_t rcv_pkts;	/* can be used for std or extended */
	uint64_t unicast_xmit_pkts;
	uint64_t unicast_rcv_pkts;
	uint64_t multicast_xmit_pkts;
	uint64_t multicast_rcv_pkts;
	time_t time;
} perfmgr_db_data_cnt_reading_t;

/** =========================================================================
 * Port select errors
 */
typedef struct {
	uint64_t xmit_wait;
	time_t time;
} perfmgr_db_ps_reading_t;

/** =========================================================================
 * Dump output options
 */
typedef enum {
	PERFMGR_EVENT_DB_DUMP_HR = 0,	/* Human readable */
	PERFMGR_EVENT_DB_DUMP_MR	/* Machine readable */
} perfmgr_db_dump_t;

/** =========================================================================
 * Port counter object.
 * Store all the port counters for a single port.
 */
typedef struct _db_port {
	perfmgr_db_err_reading_t err_total;
	perfmgr_db_err_reading_t err_previous;
	perfmgr_db_data_cnt_reading_t dc_total;
	perfmgr_db_data_cnt_reading_t dc_previous;
	time_t last_reset;
} _db_port_t;

/** =========================================================================
 * group port counters for ports into the nodes
 */
#define NODE_NAME_SIZE (IB_NODE_DESCRIPTION_SIZE << 1)
typedef struct _db_node {
	cl_map_item_t map_item;	/* must be first */
	uint64_t node_guid;
	_db_port_t *ports;
	uint8_t num_ports;
	char node_name[NODE_NAME_SIZE];
} _db_node_t;

/** =========================================================================
 * all nodes in the system.
 */
typedef struct _db {
	cl_qmap_t pc_data;	/* stores type (_db_node_t *) */
	cl_plock_t lock;
	struct osm_perfmgr *perfmgr;
} perfmgr_db_t;

/**
 * functions
 */
perfmgr_db_t *perfmgr_db_construct(struct osm_perfmgr *perfmgr);
void perfmgr_db_destroy(perfmgr_db_t * db);

perfmgr_db_err_t perfmgr_db_create_entry(perfmgr_db_t * db, uint64_t guid,
					 uint8_t num_ports, char *node_name);

perfmgr_db_err_t perfmgr_db_add_err_reading(perfmgr_db_t * db, uint64_t guid,
					    uint8_t port,
					    perfmgr_db_err_reading_t * reading);
perfmgr_db_err_t perfmgr_db_get_prev_err(perfmgr_db_t * db, uint64_t guid,
					 uint8_t port,
					 perfmgr_db_err_reading_t * reading);
perfmgr_db_err_t perfmgr_db_clear_prev_err(perfmgr_db_t * db, uint64_t guid,
					   uint8_t port);

perfmgr_db_err_t perfmgr_db_add_dc_reading(perfmgr_db_t * db, uint64_t guid,
					   uint8_t port,
					   perfmgr_db_data_cnt_reading_t *
					   reading);
perfmgr_db_err_t perfmgr_db_get_prev_dc(perfmgr_db_t * db, uint64_t guid,
					uint8_t port,
					perfmgr_db_data_cnt_reading_t *
					reading);
perfmgr_db_err_t perfmgr_db_clear_prev_dc(perfmgr_db_t * db, uint64_t guid,
					  uint8_t port);

void perfmgr_db_clear_counters(perfmgr_db_t * db);
perfmgr_db_err_t perfmgr_db_dump(perfmgr_db_t * db, char *file,
				 perfmgr_db_dump_t dump_type);
void perfmgr_db_print_by_name(perfmgr_db_t * db, char *nodename, FILE *fp);
void perfmgr_db_print_by_guid(perfmgr_db_t * db, uint64_t guid, FILE *fp);

/** =========================================================================
 * helper functions to fill in the various db objects from wire objects
 */

void perfmgr_db_fill_err_read(ib_port_counters_t * wire_read,
			      perfmgr_db_err_reading_t * reading);
void perfmgr_db_fill_data_cnt_read_pc(ib_port_counters_t * wire_read,
				      perfmgr_db_data_cnt_reading_t * reading);
void perfmgr_db_fill_data_cnt_read_epc(ib_port_counters_ext_t * wire_read,
				       perfmgr_db_data_cnt_reading_t * reading);

END_C_DECLS

#endif				/* ENABLE_OSM_PERF_MGR */

#endif				/* _PERFMGR_PM_DB_H_ */


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

namespace HotelReservation
{
    class RoomList
    {
        List<Rooms> getAllRoom()
        {
            List<Rooms> list = new List<Rooms>();

            return list;
        }

        public List<Rooms> PrepereList(int neededPlace, List<Rooms> allRooms)
        {
            List<Rooms> list = new List<Rooms>();

            for (int i = neededPlace + 1; i > 0; i--)
            {
                foreach (Rooms room in allRooms)
                {
                    if (room.seats == i)
                    {
                        if (!list.Contains(room))
                            list.Add(room);
                    }
                }
            }

            return list;
        }
    }
}


text:
package org.scalatest.matchers

import org.scalatest._
import org.scalatest.prop.Checkers
import org.scalacheck._
import Arbitrary._
import Prop._

class ShouldEndWithRegexSpec extends Spec with ShouldMatchers with Checkers with ReturnsNormallyThrowsAssertion {

/*
s should include substring t
s should include regex t
s should endWith substring t
s should endWith regex t
s should endWith substring t
s should endWith regex t
s should fullyMatch regex t
*/

  describe("The endWith regex syntax") {

    val decimal = """(-)?(\d+)(\.\d*)?"""
    val decimalRegex = """(-)?(\d+)(\.\d*)?""".r

    describe("(when the regex is specified by a string)") {

      it("should do nothing if the string ends with substring that matched the regular expression specified as a string") {

        "1.78" should endWith regex (".78")
        "1.7" should endWith regex (decimal)
        "21.7" should endWith regex (decimal)
        "1.78" should endWith regex (decimal)
        "x8" should endWith regex (decimal)
        "x1." should endWith regex (decimal)

        // The remaining are full matches, which should also work with "endWith"
        "1.7" should endWith regex ("1.7")
        "1.7" should endWith regex (decimal)
        "-1.8" should endWith regex (decimal)
        "8" should endWith regex (decimal)
        "1." should endWith regex (decimal)
      }

      it("should do nothing if the string does not end with a substring that matched the regular expression specified as a string when used with not") {

        "eight" should not { endWith regex (decimal) }
        "one.eight" should not { endWith regex (decimal) }

        "eight" should not endWith regex (decimal)
        "one.eight" should not endWith regex (decimal)
      }

      it("should do nothing if the string does not end with a substring that matched the regular expression specified as a string when used in a logical-and expression") {

        "b1.7" should (endWith regex (decimal) and (endWith regex (decimal)))
        "b1.7" should ((endWith regex (decimal)) and (endWith regex (decimal)))
        "b1.7" should (endWith regex (decimal) and endWith regex (decimal))

        "1.7" should (endWith regex (decimal) and (endWith regex (decimal)))
        "1.7" should ((endWith regex (decimal)) and (endWith regex (decimal)))
        "1.7" should (endWith regex (decimal) and endWith regex (decimal))
      }

      it("should do nothing if the string does not end with a substring that matched the regular expression specified as a string when used in a logical-or expression") {

        "b1.7" should (endWith regex ("hello") or (endWith regex (decimal)))
        "b1.7" should ((endWith regex ("hello")) or (endWith regex (decimal)))
        "b1.7" should (endWith regex ("hello") or endWith regex (decimal))

        "1.7" should (endWith regex ("hello") or (endWith regex (decimal)))
        "1.7" should ((endWith regex ("hello")) or (endWith regex (decimal)))
        "1.7" should (endWith regex ("hello") or endWith regex (decimal))
      }

      it("should do nothing if the string does not end with a substring that matched the regular expression specified as a string when used in a logical-and expression with not") {
        "fred" should (not (endWith regex ("bob")) and not (endWith regex (decimal)))
        "fred" should ((not endWith regex ("bob")) and (not endWith regex (decimal)))
        "fred" should (not endWith regex ("bob") and not endWith regex (decimal))
      }

      it("should do nothing if the string does not end with a substring that matched the regular expression specified as a string when used in a logical-or expression with not") {
        "fred" should (not (endWith regex ("fred")) or not (endWith regex (decimal)))
        "fred" should ((not endWith regex ("fred")) or (not endWith regex (decimal)))
        "fred" should (not endWith regex ("fred") or not endWith regex (decimal))
      }

      it("should throw TestFailedException if the string does not match substring that matched the regular expression specified as a string") {

        val caught1 = intercept[TestFailedException] {
          "1.7" should endWith regex ("1.78")
        }
        assert(caught1.getMessage === "\"1.7\" did not end with a substring that matched the regular expression 1.78")

        val caught2 = intercept[TestFailedException] {
          "1.7" should endWith regex ("21.7")
        }
        assert(caught2.getMessage === "\"1.7\" did not end with a substring that matched the regular expression 21.7")

        val caught3 = intercept[TestFailedException] {
          "-one.eight" should endWith regex (decimal)
        }
        assert(caught3.getMessage === "\"-one.eight\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught6 = intercept[TestFailedException] {
          "eight" should endWith regex (decimal)
        }
        assert(caught6.getMessage === "\"eight\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught7 = intercept[TestFailedException] {
          "1.eight" should endWith regex (decimal)
        }
        assert(caught7.getMessage === "\"1.eight\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught8 = intercept[TestFailedException] {
          "onedoteight" should endWith regex (decimal)
        }
        assert(caught8.getMessage === "\"onedoteight\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught9 = intercept[TestFailedException] {
          "***" should endWith regex (decimal)
        }
        assert(caught9.getMessage === "\"***\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")
      }

      it("should throw TestFailedException if the string does matches substring that matched the regular expression specified as a string when used with not") {

        val caught1 = intercept[TestFailedException] {
          "1.7" should not { endWith regex ("1.7") }
        }
        assert(caught1.getMessage === "\"1.7\" ended with a substring that matched the regular expression 1.7")

        val caught2 = intercept[TestFailedException] {
          "1.7" should not { endWith regex (decimal) }
        }
        assert(caught2.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught3 = intercept[TestFailedException] {
          "-1.8" should not { endWith regex (decimal) }
        }
        assert(caught3.getMessage === "\"-1.8\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught4 = intercept[TestFailedException] {
          "8" should not { endWith regex (decimal) }
        }
        assert(caught4.getMessage === "\"8\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught5 = intercept[TestFailedException] {
          "1." should not { endWith regex (decimal) }
        }
        assert(caught5.getMessage === "\"1.\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught11 = intercept[TestFailedException] {
          "1.7" should not endWith regex ("1.7")
        }
        assert(caught11.getMessage === "\"1.7\" ended with a substring that matched the regular expression 1.7")

        val caught12 = intercept[TestFailedException] {
          "1.7" should not endWith regex (decimal)
        }
        assert(caught12.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught13 = intercept[TestFailedException] {
          "-1.8" should not endWith regex (decimal)
        }
        assert(caught13.getMessage === "\"-1.8\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught14 = intercept[TestFailedException] {
          "8" should not endWith regex (decimal)
        }
        assert(caught14.getMessage === "\"8\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught15 = intercept[TestFailedException] {
          "1." should not endWith regex (decimal)
        }
        assert(caught15.getMessage === "\"1.\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        // The rest are non-exact matches
        val caught21 = intercept[TestFailedException] {
          "a1.7" should not { endWith regex ("1.7") }
        }
        assert(caught21.getMessage === "\"a1.7\" ended with a substring that matched the regular expression 1.7")

        val caught22 = intercept[TestFailedException] {
          "b1.7" should not { endWith regex (decimal) }
        }
        assert(caught22.getMessage === "\"b1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught23 = intercept[TestFailedException] {
          "b-1.8" should not { endWith regex (decimal) }
        }
        assert(caught23.getMessage === "\"b-1.8\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")
      }

      it("should throw TestFailedException if the string ends with substring that matched the regular expression specified as a string when used in a logical-and expression") {

        val caught1 = intercept[TestFailedException] {
          "1.7" should (endWith regex (decimal) and (endWith regex ("1.8")))
        }
        assert(caught1.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, but \"1.7\" did not end with a substring that matched the regular expression 1.8")

        val caught2 = intercept[TestFailedException] {
          "1.7" should ((endWith regex (decimal)) and (endWith regex ("1.8")))
        }
        assert(caught2.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, but \"1.7\" did not end with a substring that matched the regular expression 1.8")

        val caught3 = intercept[TestFailedException] {
          "1.7" should (endWith regex (decimal) and endWith regex ("1.8"))
        }
        assert(caught3.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, but \"1.7\" did not end with a substring that matched the regular expression 1.8")

        // Check to make sure the error message "short circuits" (i.e., just reports the left side's failure)
        val caught4 = intercept[TestFailedException] {
          "1.eight" should (endWith regex (decimal) and (endWith regex ("1.8")))
        }
        assert(caught4.getMessage === "\"1.eight\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught5 = intercept[TestFailedException] {
          "1.eight" should ((endWith regex (decimal)) and (endWith regex ("1.8")))
        }
        assert(caught5.getMessage === "\"1.eight\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught6 = intercept[TestFailedException] {
          "1.eight" should (endWith regex (decimal) and endWith regex ("1.8"))
        }
        assert(caught6.getMessage === "\"1.eight\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")
      }

      it("should throw TestFailedException if the string ends with substring that matched the regular expression specified as a string when used in a logical-or expression") {

        val caught1 = intercept[TestFailedException] {
          "1.seven" should (endWith regex (decimal) or (endWith regex ("1.8")))
        }
        assert(caught1.getMessage === "\"1.seven\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, and \"1.seven\" did not end with a substring that matched the regular expression 1.8")

        val caught2 = intercept[TestFailedException] {
          "1.seven" should ((endWith regex (decimal)) or (endWith regex ("1.8")))
        }
        assert(caught2.getMessage === "\"1.seven\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, and \"1.seven\" did not end with a substring that matched the regular expression 1.8")

        val caught3 = intercept[TestFailedException] {
          "1.seven" should (endWith regex (decimal) or endWith regex ("1.8"))
        }
        assert(caught3.getMessage === "\"1.seven\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, and \"1.seven\" did not end with a substring that matched the regular expression 1.8")
      }

      it("should throw TestFailedException if the string ends with substring that matched the regular expression specified as a string when used in a logical-and expression used with not") {

        val caught1 = intercept[TestFailedException] {
          "1.7" should (not endWith regex ("1.8") and (not endWith regex (decimal)))
        }
        assert(caught1.getMessage === "\"1.7\" did not end with a substring that matched the regular expression 1.8, but \"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught2 = intercept[TestFailedException] {
          "1.7" should ((not endWith regex ("1.8")) and (not endWith regex (decimal)))
        }
        assert(caught2.getMessage === "\"1.7\" did not end with a substring that matched the regular expression 1.8, but \"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught3 = intercept[TestFailedException] {
          "1.7" should (not endWith regex ("1.8") and not endWith regex (decimal))
        }
        assert(caught3.getMessage === "\"1.7\" did not end with a substring that matched the regular expression 1.8, but \"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught4 = intercept[TestFailedException] {
          "a1.7" should (not endWith regex ("1.8") and (not endWith regex (decimal)))
        }
        assert(caught4.getMessage === "\"a1.7\" did not end with a substring that matched the regular expression 1.8, but \"a1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught5 = intercept[TestFailedException] {
          "1.7" should ((not endWith regex ("1.8")) and (not endWith regex (decimal)))
        }
        assert(caught5.getMessage === "\"1.7\" did not end with a substring that matched the regular expression 1.8, but \"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")
      }

      it("should throw TestFailedException if the string ends with substring that matched the regular expression specified as a string when used in a logical-or expression used with not") {

        val caught1 = intercept[TestFailedException] {
          "1.7" should (not endWith regex (decimal) or (not endWith regex ("1.7")))
        }
        assert(caught1.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, and \"1.7\" ended with a substring that matched the regular expression 1.7")

        val caught2 = intercept[TestFailedException] {
          "1.7" should ((not endWith regex (decimal)) or (not endWith regex ("1.7")))
        }
        assert(caught2.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, and \"1.7\" ended with a substring that matched the regular expression 1.7")

        val caught3 = intercept[TestFailedException] {
          "1.7" should (not endWith regex (decimal) or not endWith regex ("1.7"))
        }
        assert(caught3.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, and \"1.7\" ended with a substring that matched the regular expression 1.7")

        val caught4 = intercept[TestFailedException] {
          "1.7" should (not (endWith regex (decimal)) or not (endWith regex ("1.7")))
        }
        assert(caught4.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, and \"1.7\" ended with a substring that matched the regular expression 1.7")

        val caught5 = intercept[TestFailedException] {
          "a1.7" should (not endWith regex (decimal) or (not endWith regex ("1.7")))
        }
        assert(caught5.getMessage === "\"a1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, and \"a1.7\" ended with a substring that matched the regular expression 1.7")
      }
    }

    describe("(when the regex is specified by an actual Regex)") {

      it("should do nothing if the string ends with substring that matched the regular expression specified as a string") {

        "1.78" should endWith regex (".78")
        "1.7" should endWith regex (decimalRegex)
        "21.7" should endWith regex (decimalRegex)
        "1.78" should endWith regex (decimalRegex)
        "x8" should endWith regex (decimalRegex)
        "x1." should endWith regex (decimalRegex)

        // The remaining are full matches, which should also work with "endWith"
        "1.7" should endWith regex ("1.7")
        "1.7" should endWith regex (decimalRegex)
        "-1.8" should endWith regex (decimalRegex)
        "8" should endWith regex (decimalRegex)
        "1." should endWith regex (decimalRegex)
      }

      it("should do nothing if the string does not end with a substring that matched the regular expression specified as a string when used with not") {

        "eight" should not { endWith regex (decimalRegex) }
        "one.eight" should not { endWith regex (decimalRegex) }

        "eight" should not endWith regex (decimalRegex)
        "one.eight" should not endWith regex (decimalRegex)
      }

      it("should do nothing if the string does not end with a substring that matched the regular expression specified as a string when used in a logical-and expression") {

        "b1.7" should (endWith regex (decimalRegex) and (endWith regex (decimalRegex)))
        "b1.7" should ((endWith regex (decimalRegex)) and (endWith regex (decimalRegex)))
        "b1.7" should (endWith regex (decimalRegex) and endWith regex (decimalRegex))

        "1.7" should (endWith regex (decimalRegex) and (endWith regex (decimalRegex)))
        "1.7" should ((endWith regex (decimalRegex)) and (endWith regex (decimalRegex)))
        "1.7" should (endWith regex (decimalRegex) and endWith regex (decimalRegex))
      }

      it("should do nothing if the string does not end with a substring that matched the regular expression specified as a string when used in a logical-or expression") {

        "b1.7" should (endWith regex ("hello") or (endWith regex (decimalRegex)))
        "b1.7" should ((endWith regex ("hello")) or (endWith regex (decimalRegex)))
        "b1.7" should (endWith regex ("hello") or endWith regex (decimalRegex))

        "1.7" should (endWith regex ("hello") or (endWith regex (decimalRegex)))
        "1.7" should ((endWith regex ("hello")) or (endWith regex (decimalRegex)))
        "1.7" should (endWith regex ("hello") or endWith regex (decimalRegex))
      }

      it("should do nothing if the string does not end with a substring that matched the regular expression specified as a string when used in a logical-and expression with not") {
        "fred" should (not (endWith regex ("bob")) and not (endWith regex (decimalRegex)))
        "fred" should ((not endWith regex ("bob")) and (not endWith regex (decimalRegex)))
        "fred" should (not endWith regex ("bob") and not endWith regex (decimalRegex))
      }

      it("should do nothing if the string does not end with a substring that matched the regular expression specified as a string when used in a logical-or expression with not") {
        "fred" should (not (endWith regex ("fred")) or not (endWith regex (decimalRegex)))
        "fred" should ((not endWith regex ("fred")) or (not endWith regex (decimalRegex)))
        "fred" should (not endWith regex ("fred") or not endWith regex (decimalRegex))
      }

      it("should throw TestFailedException if the string does not match substring that matched the regular expression specified as a string") {

        val caught1 = intercept[TestFailedException] {
          "1.7" should endWith regex ("1.78")
        }
        assert(caught1.getMessage === "\"1.7\" did not end with a substring that matched the regular expression 1.78")

        val caught2 = intercept[TestFailedException] {
          "1.7" should endWith regex ("21.7")
        }
        assert(caught2.getMessage === "\"1.7\" did not end with a substring that matched the regular expression 21.7")

        val caught3 = intercept[TestFailedException] {
          "-one.eight" should endWith regex (decimalRegex)
        }
        assert(caught3.getMessage === "\"-one.eight\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught6 = intercept[TestFailedException] {
          "eight" should endWith regex (decimalRegex)
        }
        assert(caught6.getMessage === "\"eight\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught7 = intercept[TestFailedException] {
          "1.eight" should endWith regex (decimalRegex)
        }
        assert(caught7.getMessage === "\"1.eight\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught8 = intercept[TestFailedException] {
          "onedoteight" should endWith regex (decimalRegex)
        }
        assert(caught8.getMessage === "\"onedoteight\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught9 = intercept[TestFailedException] {
          "***" should endWith regex (decimalRegex)
        }
        assert(caught9.getMessage === "\"***\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")
      }

      it("should throw TestFailedException if the string does matches substring that matched the regular expression specified as a string when used with not") {

        val caught1 = intercept[TestFailedException] {
          "1.7" should not { endWith regex ("1.7") }
        }
        assert(caught1.getMessage === "\"1.7\" ended with a substring that matched the regular expression 1.7")

        val caught2 = intercept[TestFailedException] {
          "1.7" should not { endWith regex (decimalRegex) }
        }
        assert(caught2.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught3 = intercept[TestFailedException] {
          "-1.8" should not { endWith regex (decimalRegex) }
        }
        assert(caught3.getMessage === "\"-1.8\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught4 = intercept[TestFailedException] {
          "8" should not { endWith regex (decimalRegex) }
        }
        assert(caught4.getMessage === "\"8\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught5 = intercept[TestFailedException] {
          "1." should not { endWith regex (decimalRegex) }
        }
        assert(caught5.getMessage === "\"1.\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught11 = intercept[TestFailedException] {
          "1.7" should not endWith regex ("1.7")
        }
        assert(caught11.getMessage === "\"1.7\" ended with a substring that matched the regular expression 1.7")

        val caught12 = intercept[TestFailedException] {
          "1.7" should not endWith regex (decimalRegex)
        }
        assert(caught12.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught13 = intercept[TestFailedException] {
          "-1.8" should not endWith regex (decimalRegex)
        }
        assert(caught13.getMessage === "\"-1.8\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught14 = intercept[TestFailedException] {
          "8" should not endWith regex (decimalRegex)
        }
        assert(caught14.getMessage === "\"8\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught15 = intercept[TestFailedException] {
          "1." should not endWith regex (decimalRegex)
        }
        assert(caught15.getMessage === "\"1.\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        // The rest are non-exact matches
        val caught21 = intercept[TestFailedException] {
          "a1.7" should not { endWith regex ("1.7") }
        }
        assert(caught21.getMessage === "\"a1.7\" ended with a substring that matched the regular expression 1.7")

        val caught22 = intercept[TestFailedException] {
          "b1.7" should not { endWith regex (decimalRegex) }
        }
        assert(caught22.getMessage === "\"b1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught23 = intercept[TestFailedException] {
          "b-1.8" should not { endWith regex (decimalRegex) }
        }
        assert(caught23.getMessage === "\"b-1.8\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")
      }

      it("should throw TestFailedException if the string ends with substring that matched the regular expression specified as a string when used in a logical-and expression") {

        val caught1 = intercept[TestFailedException] {
          "1.7" should (endWith regex (decimalRegex) and (endWith regex ("1.8")))
        }
        assert(caught1.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, but \"1.7\" did not end with a substring that matched the regular expression 1.8")

        val caught2 = intercept[TestFailedException] {
          "1.7" should ((endWith regex (decimalRegex)) and (endWith regex ("1.8")))
        }
        assert(caught2.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, but \"1.7\" did not end with a substring that matched the regular expression 1.8")

        val caught3 = intercept[TestFailedException] {
          "1.7" should (endWith regex (decimalRegex) and endWith regex ("1.8"))
        }
        assert(caught3.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, but \"1.7\" did not end with a substring that matched the regular expression 1.8")

        // Check to make sure the error message "short circuits" (i.e., just reports the left side's failure)
        val caught4 = intercept[TestFailedException] {
          "1.eight" should (endWith regex (decimalRegex) and (endWith regex ("1.8")))
        }
        assert(caught4.getMessage === "\"1.eight\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught5 = intercept[TestFailedException] {
          "1.eight" should ((endWith regex (decimalRegex)) and (endWith regex ("1.8")))
        }
        assert(caught5.getMessage === "\"1.eight\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught6 = intercept[TestFailedException] {
          "1.eight" should (endWith regex (decimalRegex) and endWith regex ("1.8"))
        }
        assert(caught6.getMessage === "\"1.eight\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")
      }

      it("should throw TestFailedException if the string ends with substring that matched the regular expression specified as a string when used in a logical-or expression") {

        val caught1 = intercept[TestFailedException] {
          "1.seven" should (endWith regex (decimalRegex) or (endWith regex ("1.8")))
        }
        assert(caught1.getMessage === "\"1.seven\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, and \"1.seven\" did not end with a substring that matched the regular expression 1.8")

        val caught2 = intercept[TestFailedException] {
          "1.seven" should ((endWith regex (decimalRegex)) or (endWith regex ("1.8")))
        }
        assert(caught2.getMessage === "\"1.seven\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, and \"1.seven\" did not end with a substring that matched the regular expression 1.8")

        val caught3 = intercept[TestFailedException] {
          "1.seven" should (endWith regex (decimalRegex) or endWith regex ("1.8"))
        }
        assert(caught3.getMessage === "\"1.seven\" did not end with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, and \"1.seven\" did not end with a substring that matched the regular expression 1.8")
      }

      it("should throw TestFailedException if the string ends with substring that matched the regular expression specified as a string when used in a logical-and expression used with not") {

        val caught1 = intercept[TestFailedException] {
          "1.7" should (not endWith regex ("1.8") and (not endWith regex (decimalRegex)))
        }
        assert(caught1.getMessage === "\"1.7\" did not end with a substring that matched the regular expression 1.8, but \"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught2 = intercept[TestFailedException] {
          "1.7" should ((not endWith regex ("1.8")) and (not endWith regex (decimalRegex)))
        }
        assert(caught2.getMessage === "\"1.7\" did not end with a substring that matched the regular expression 1.8, but \"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught3 = intercept[TestFailedException] {
          "1.7" should (not endWith regex ("1.8") and not endWith regex (decimalRegex))
        }
        assert(caught3.getMessage === "\"1.7\" did not end with a substring that matched the regular expression 1.8, but \"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught4 = intercept[TestFailedException] {
          "a1.7" should (not endWith regex ("1.8") and (not endWith regex (decimalRegex)))
        }
        assert(caught4.getMessage === "\"a1.7\" did not end with a substring that matched the regular expression 1.8, but \"a1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")

        val caught5 = intercept[TestFailedException] {
          "1.7" should ((not endWith regex ("1.8")) and (not endWith regex (decimalRegex)))
        }
        assert(caught5.getMessage === "\"1.7\" did not end with a substring that matched the regular expression 1.8, but \"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?")
      }

      it("should throw TestFailedException if the string ends with substring that matched the regular expression specified as a string when used in a logical-or expression used with not") {

        val caught1 = intercept[TestFailedException] {
          "1.7" should (not endWith regex (decimalRegex) or (not endWith regex ("1.7")))
        }
        assert(caught1.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, and \"1.7\" ended with a substring that matched the regular expression 1.7")

        val caught2 = intercept[TestFailedException] {
          "1.7" should ((not endWith regex (decimalRegex)) or (not endWith regex ("1.7")))
        }
        assert(caught2.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, and \"1.7\" ended with a substring that matched the regular expression 1.7")

        val caught3 = intercept[TestFailedException] {
          "1.7" should (not endWith regex (decimalRegex) or not endWith regex ("1.7"))
        }
        assert(caught3.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, and \"1.7\" ended with a substring that matched the regular expression 1.7")

        val caught4 = intercept[TestFailedException] {
          "1.7" should (not (endWith regex (decimalRegex)) or not (endWith regex ("1.7")))
        }
        assert(caught4.getMessage === "\"1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, and \"1.7\" ended with a substring that matched the regular expression 1.7")

        val caught5 = intercept[TestFailedException] {
          "a1.7" should (not endWith regex (decimalRegex) or (not endWith regex ("1.7")))
        }
        assert(caught5.getMessage === "\"a1.7\" ended with a substring that matched the regular expression (-)?(\\d+)(\\.\\d*)?, and \"a1.7\" ended with a substring that matched the regular expression 1.7")
      }
    }
  }
}


text:
LOC=$(realpath $(dirname "${BASH_SOURCE[0]}"))
source $LOC/../../../common.sh $@

ERRORSTATE=0
return $ERRORSTATE


text:
[expect php]
[file]
<?php
// This iterator filters all values with less than 10 characters
class LengthFilterIterator extends FilterIterator {

    public function accept() {
        echo "accept(".parent::current()."), ";
		// Only accept strings with a length of 10 and greater
		return strlen(parent::current()) > 10;
    }

	public function next()
	{
		echo "next(), ";
		return parent::next();
	}

	public function valid()
	{
		echo "valid(), ";
		return parent::valid();
	}

	public function rewind()
	{
		echo "rewind(), ";
		return parent::rewind();
	}

}

$arrayIterator = new ArrayIterator(array('test1', 'more than 10 characters', 'another more than 10 characters', "test2", 'test3', 'someting longer than 10 chars'));
$lengthFilter = new LengthFilterIterator($arrayIterator);

$lengthFilter->rewind();

echo "\n";

foreach ($lengthFilter as $value) {
    echo "$value, ";
}
?>


text:
typedef void (*sig_handler)(int);
extern "C" void sigpipe_handler( int whatever )
{

}

namespace gw6cmessaging
{
// --------------------------------------------------------------------------
// Function : PipeServer constructor
//
// Description:
//   Will initialize a new PipeServer object.
//
// Arguments:
//   aPipeName: string [IN], The name of the pipe this server will create.
//
// Return values: (N/A)
//
// --------------------------------------------------------------------------
PipeServer::PipeServer( const string& aPipeName ) :
  IPCServer(),
  PipeIO(),
  m_PipeName(aPipeName),
  m_bClientConnected(false)
{
}

// --------------------------------------------------------------------------
// Function : PipeServer destructor
//
// Description:
//   Will clean-up space allocated during object lifetime.
//
// Arguments: (none)
//
// Return values: (N/A)
//
// --------------------------------------------------------------------------
PipeServer::~PipeServer( void )
{
  // Is client still connected ?
  assert( m_bClientConnected == false );
}

// --------------------------------------------------------------------------
// Function : CreateConnectionPoint
//
// Description:
//   Will create a NamedPipe server endpoint.
//
// Arguments: (none)
//
// Return values:
//   GW6CM_UIS__NOERROR: Operation successful.
//   Any other value is an error. Use GetLastError() for more information.
//
// --------------------------------------------------------------------------
error_t PipeServer::CreateConnectionPoint( void )
{
  assert( !m_PipeName.empty() );

  // Clear umask so it doesn't interfere with pipe security mask.
  umask(0);

  // ---------------------------------
  // Create the server pipe endpoint.
  // ---------------------------------
  int retCode = mknod( m_PipeName.c_str(), S_IFIFO|PIPE_MASK, 0);

  // Verify returned value.
  if( retCode != 0 )
  {
    return GW6CM_UIS_FAILCREATESERVERPIPE;
  }

  // Successful operation.
  return GW6CM_UIS__NOERROR;
}

// --------------------------------------------------------------------------
// Function : AcceptConnection
//
// Description:
//   Will accept a pipe client connection.
//   NOTE: THIS FUNCTION IS (big time) BLOCKING!!!
//
// Arguments: (none)
//
// Return values:
//   GW6CM_UIS__NOERROR: Operation successful.
//   Any other value is an error. Use GetLastError() for more information.
//
// --------------------------------------------------------------------------
error_t PipeServer::AcceptConnection( void )
{
  FILE* hPipe;

  if( m_bClientConnected )
    return GW6CM_UIS_CLIENTALRDYCONN;

  // Open the pipe in read - write mode, and block until
  // a client connects.
  //
  hPipe = fopen( m_PipeName.c_str(), "rwb" );
  if( hPipe == NULL )
  {
    // Error opening pipe.
    return GW6CM_UIS_FAILOPENPIPE;
  }

  // Register new handler for SIG_PIPE signal.
  sig_handler oldpipehandler = signal( SIGPIPE, sigpipe_handler );
  if( oldpipehandler == SIG_ERR )
  {

  }

  while( !m_bClientConnected )
  {

     SLEEP( 30 );

  }

  // Client connection successful
  return GW6CM_UIS__NOERROR;
}

// --------------------------------------------------------------------------
// Function : CloseConnection
//
// Description:
//   Will close the server-side pipe instance.
//
// Arguments: (none)
//
// Return values:
//   GW6CM_UIS__NOERROR: Operation successful.
//   Any other value is an error. Use GetLastError() for more information.
//
// --------------------------------------------------------------------------
error_t PipeServer::CloseConnection( void )
{
  // Mark client as not connected.
  m_bClientConnected = false;

  // Server pipe disconnection successful.
  return GW6CM_UIS__NOERROR;
}

}


text:
GetBundleResponse returns the result of the bundle requested with the Bundle method. The response contains the DeviceIdentification and CorrelationUid which is received from the [Bundle](bundle.md) request.

All requests have similar response behaviour which is described in [ResponseMessages](../../responsemessages.md).

## References

XSD:

[sm-adhoc.xsd](https://github.com/OSGP/open-smart-grid-platform/blob/development/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/sm-adhoc.xsd)

[sm-bundle.xsd](https://github.com/OSGP/open-smart-grid-platform/blob/development/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/sm-bundle.xsd)

[sm-configuration.xsd](https://github.com/OSGP/open-smart-grid-platform/blob/development/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/sm-configuration.xsd)

[sm-management.xsd](https://github.com/OSGP/open-smart-grid-platform/blob/development/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/sm-management.xsd)

[sm-monitoring.xsd](https://github.com/OSGP/open-smart-grid-platform/blob/development/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/sm-monitoring.xsd)

WSDL: [SmartMeteringBundle.wsdl](https://github.com/OSGP/open-smart-grid-platform/blob/development/osgp/shared/osgp-ws-smartmetering/src/main/resources/SmartMeteringBundle.wsdl)


text:
Simple keycode visualizer.

Just type on any key of your keyboard and see the keycode!

## Try it!
https://amsdamsgram.github.io/which-key/

## Credits
Project idea from [wesbos](https://github.com/wesbos)


text:
'use strict';

import configureStore from 'redux-mock-store';
import { routerMiddleware } from 'react-router-redux';

const mockStore = configureStore([routerMiddleware]);

export default function(initialState){
  return mockStore(initialState);
}


text:
import json

from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404, render
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger

from wagtail.wagtailadmin.modal_workflow import render_modal_workflow
from wagtail.wagtailadmin.forms import SearchForm
from wagtail.wagtailadmin.utils import permission_required
from wagtail.wagtailsearch.backends import get_search_backends

from wagtail.wagtailimages.models import get_image_model
from wagtail.wagtailimages.forms import get_image_form, ImageInsertionForm
from wagtail.wagtailimages.formats import get_image_format

def get_image_json(image):
    """
    helper function: given an image, return the json to pass back to the
    image chooser panel
    """
    preview_image = image.get_rendition('max-130x100')

    return json.dumps({
        'id': image.id,
        'edit_link': reverse('wagtailimages:edit', args=(image.id,)),
        'title': image.title,
        'preview': {
            'url': preview_image.url,
            'width': preview_image.width,
            'height': preview_image.height,
        }
    })

def chooser(request):
    Image = get_image_model()

    if request.user.has_perm('wagtailimages.add_image'):
        ImageForm = get_image_form(Image)
        uploadform = ImageForm()
    else:
        uploadform = None

    q = None
    if 'q' in request.GET or 'p' in request.GET:
        searchform = SearchForm(request.GET)
        if searchform.is_valid():
            q = searchform.cleaned_data['q']

            # page number
            p = request.GET.get("p", 1)

            images = Image.search(q, results_per_page=10, page=p)

            is_searching = True

        else:
            images = Image.objects.order_by('-created_at')
            p = request.GET.get("p", 1)
            paginator = Paginator(images, 10)

            try:
                images = paginator.page(p)
            except PageNotAnInteger:
                images = paginator.page(1)
            except EmptyPage:
                images = paginator.page(paginator.num_pages)

            is_searching = False

        return render(request, "wagtailimages/chooser/results.html", {
            'images': images,
            'is_searching': is_searching,
            'query_string': q,
            'will_select_format': request.GET.get('select_format')
        })
    else:
        searchform = SearchForm()

        images = Image.objects.order_by('-created_at')
        p = request.GET.get("p", 1)
        paginator = Paginator(images, 10)

        try:
            images = paginator.page(p)
        except PageNotAnInteger:
            images = paginator.page(1)
        except EmptyPage:
            images = paginator.page(paginator.num_pages)

    return render_modal_workflow(request, 'wagtailimages/chooser/chooser.html', 'wagtailimages/chooser/chooser.js', {
        'images': images,
        'uploadform': uploadform,
        'searchform': searchform,
        'is_searching': False,
        'query_string': q,
        'will_select_format': request.GET.get('select_format'),
        'popular_tags': Image.popular_tags(),
    })

def image_chosen(request, image_id):
    image = get_object_or_404(get_image_model(), id=image_id)

    return render_modal_workflow(
        request, None, 'wagtailimages/chooser/image_chosen.js',
        {'image_json': get_image_json(image)}
    )

@permission_required('wagtailimages.add_image')
def chooser_upload(request):
    Image = get_image_model()
    ImageForm = get_image_form(Image)

    searchform = SearchForm()

    if request.POST:
        image = Image(uploaded_by_user=request.user)
        form = ImageForm(request.POST, request.FILES, instance=image)

        if form.is_valid():
            form.save()

            # Reindex the image to make sure all tags are indexed
            for backend in get_search_backends():
                backend.add(image)

            if request.GET.get('select_format'):
                form = ImageInsertionForm(initial={'alt_text': image.default_alt_text})
                return render_modal_workflow(
                    request, 'wagtailimages/chooser/select_format.html', 'wagtailimages/chooser/select_format.js',
                    {'image': image, 'form': form}
                )
            else:
                # not specifying a format; return the image details now
                return render_modal_workflow(
                    request, None, 'wagtailimages/chooser/image_chosen.js',
                    {'image_json': get_image_json(image)}
                )
    else:
        form = ImageForm()

    images = Image.objects.order_by('title')

    return render_modal_workflow(
        request, 'wagtailimages/chooser/chooser.html', 'wagtailimages/chooser/chooser.js',
        {'images': images, 'uploadform': form, 'searchform': searchform}
    )

def chooser_select_format(request, image_id):
    image = get_object_or_404(get_image_model(), id=image_id)

    if request.POST:
        form = ImageInsertionForm(request.POST, initial={'alt_text': image.default_alt_text})
        if form.is_valid():

            format = get_image_format(form.cleaned_data['format'])
            preview_image = image.get_rendition(format.filter_spec)

            image_json = json.dumps({
                'id': image.id,
                'title': image.title,
                'format': format.name,
                'alt': form.cleaned_data['alt_text'],
                'class': format.classnames,
                'edit_link': reverse('wagtailimages:edit', args=(image.id,)),
                'preview': {
                    'url': preview_image.url,
                    'width': preview_image.width,
                    'height': preview_image.height,
                },
                'html': format.image_to_editor_html(image, form.cleaned_data['alt_text']),
            })

            return render_modal_workflow(
                request, None, 'wagtailimages/chooser/image_chosen.js',
                {'image_json': image_json}
            )
    else:
        form = ImageInsertionForm(initial={'alt_text': image.default_alt_text})

    return render_modal_workflow(
        request, 'wagtailimages/chooser/select_format.html', 'wagtailimages/chooser/select_format.js',
        {'image': image, 'form': form}
    )


text:
/* IBM_PROLOG_BEGIN_TAG */
/*
 * Copyright 2003,2016 IBM International Business Machines Corp.
 *
 * 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.
 */
/* IBM_PROLOG_END_TAG */

/* @(#)24	1.6  src/htx/usr/lpp/htx/bin/hxsmsg/send_sig.c, htx_msg, htxubuntu 10/10/05 05:38:47 */

/*
 *   FUNCTIONS: send_signal
 */

#include "hxsmsg.h"

#include <signal.h>

#ifdef __HTX_LINUX__
#define SIGMAX 32
#endif /* __HTX_LINUX__ */

#define BAD_PROCESS_ID 1
#define BAD_SIGNAL_NUMBER 2
#define BAD_KILL 3

/*
 * NAME: send_signal()
 *
 * FUNCTION: Sends a signal to the specified process.
 *
 * EXECUTION ENVIRONMENT:
 *
 *	This function is called by the check_wrap() function of the "hxsmsg"
 *      program.  The message handler program, "hxsmsg", is always a child
 *      process of the HTX supervisor program, "hxssup".
 *
 * NOTES:
 *
 *      operation:
 *      ---------
 *
 *      check process_id
 *      check signal_number
 *      call kill() system call to send signal
 *      check for errors
 *
 *      return
 *
 *
 * RETURNS:
 *
 *      Return Codes:
 *      -------------
 *       0 -- Normal exit.
 *       1 -- Bad process_id parameter passed to function.
 *       2 -- Bad signal_number parameter passed to function.
 *       3 -- Error from kill() system call.
 *
 *
 */

short send_signal(pid_t process_id, int signal_number)
     /*
      * process_id -- the process id of the process to get the signal
      * signal_number -- the signal number of the signal to be sent
      */

{
  /*
   ***  Data and Functions Definitions/Declarations  **************************
   */
  	char error_msg[128];       /* error message string                    */

  	extern char *program_name; /* this program's name (argv[0])           */

  	int errno_save;            /* errno save area                         */

  	short exit_code;           /* exit program return code                */

	FILE *fp;

  /*
   ***  Beginning of Executable Code  *****************************************
   */
  	exit_code = GOOD;

  	errno = 0;
  	if (process_id <= 2)       /* invalid process id?                    */
    	{
      		(void) sprintf(error_msg,
		"%s -- error in send_signal(),\n\
		Passed process id = %d (decimal).\n",
		program_name,
		process_id);

		errno = 0;
		fp = fopen("/usr/lpp/htx/.autostart", "r");
		errno_save = errno;
		if (fp == NULL && errno_save == 2)
		{
      		   (void) send_message(error_msg, 0, HTX_SYS_HARD_ERROR, HTX_SYS_MSG);
      		exit_code = BAD_PROCESS_ID;
		}
		else
		{
		   (void) send_message(error_msg, 0, HTX_SYS_INFO, HTX_SYS_MSG);
                }
		fclose(fp);
    	}

  	else if ((signal_number <= 0) || (signal_number > SIGMAX))
    	{
      		(void) sprintf(error_msg,
		"%s -- error in send_signal(),\n\
		Passed signal number = %d (decimal).\n",
		program_name,
		signal_number);

      		(void) send_message(error_msg, 0, HTX_SYS_HARD_ERROR, HTX_SYS_MSG);
      		exit_code = BAD_SIGNAL_NUMBER;
    	}

  	else if (kill(process_id, signal_number) != GOOD)
    	{
      		errno_save = errno;

      		(void) sprintf(error_msg,
		"%s -- error on kill() in send_signal()\n\
		errno: %d (%s).\n",
		program_name,
		errno_save,
		strerror(errno_save));

     		(void) send_message(error_msg, errno_save, HTX_SYS_HARD_ERROR,
		HTX_SYS_MSG);
      		exit_code = BAD_KILL;
   	}

  	return(exit_code);

} /* send_signal() */


text:
using org.xmlvm;
namespace java.io {
public class ObjectStreamClass_24: global::java.lang.Object,global::java.util.Comparator {
new public void @this(){
//XMLVM_BEGIN_WRAPPER[java.io.ObjectStreamClass$4: void <init>()]
    global::System.Object _r0_o = null;
    _r0_o = this;
    ((global::java.lang.Object) _r0_o).@this();
    return;
//XMLVM_END_WRAPPER[java.io.ObjectStreamClass$4: void <init>()]
}

public virtual int compare(global::java.lang.reflect.Method n1, global::java.lang.reflect.Method n2){
//XMLVM_BEGIN_WRAPPER[java.io.ObjectStreamClass$4: int compare(java.lang.reflect.Method, java.lang.reflect.Method)]
    global::org.xmlvm._nElement _r0;
    global::System.Object _r0_o = null;
    global::System.Object _r1_o = null;
    global::System.Object _r2_o = null;
    global::System.Object _r3_o = null;
    global::System.Object _r4_o = null;
    _r2_o = this;
    _r3_o = n1;
    _r4_o = n2;
    _r0_o = ((global::java.lang.reflect.Method) _r3_o).getName();
    _r1_o = ((global::java.lang.reflect.Method) _r4_o).getName();
    _r0.i = ((global::java.lang.String) _r0_o).compareTo((global::java.lang.String) _r1_o);
    if (_r0.i != 0) goto label26;
    _r0_o = global::java.io.ObjectStreamClass.getMethodSignature((global::java.lang.reflect.Method) _r3_o);
    _r1_o = global::java.io.ObjectStreamClass.getMethodSignature((global::java.lang.reflect.Method) _r4_o);
    _r0.i = ((global::java.lang.String) _r0_o).compareTo((global::java.lang.String) _r1_o);
    label26:;
    return _r0.i;
//XMLVM_END_WRAPPER[java.io.ObjectStreamClass$4: int compare(java.lang.reflect.Method, java.lang.reflect.Method)]
}

public virtual int compare(global::java.lang.Object n1, global::java.lang.Object n2){
//XMLVM_BEGIN_WRAPPER[java.io.ObjectStreamClass$4: int compare(java.lang.Object, java.lang.Object)]
    global::org.xmlvm._nElement _r0;
    global::System.Object _r1_o = null;
    global::System.Object _r2_o = null;
    global::System.Object _r3_o = null;
    _r1_o = this;
    _r2_o = n1;
    _r3_o = n2;
    _r0.i = ((global::java.io.ObjectStreamClass_24) _r1_o).compare((global::java.lang.reflect.Method) _r2_o, (global::java.lang.reflect.Method) _r3_o);
    return _r0.i;
//XMLVM_END_WRAPPER[java.io.ObjectStreamClass$4: int compare(java.lang.Object, java.lang.Object)]
}

//XMLVM_BEGIN_WRAPPER[java.io.ObjectStreamClass$4]
//XMLVM_END_WRAPPER[java.io.ObjectStreamClass$4]

} // end of class: ObjectStreamClass_24

} // end of namespace: java.io


text:
function New-VSGameLiftGameSessionQueue {
    <#
    .SYNOPSIS
        Adds an AWS::GameLift::GameSessionQueue resource to the template. The AWS::GameLift::GameSessionQueue resource establishes a queue for processing requests to create new game sessions. A queue identifies where new game sessions can be hosted by specifying a list of destinations (fleets or aliases. It also sets how long requests can wait in the queue before timing out. You can set up a queue with destinations in multiple Regions.

    .DESCRIPTION
        Adds an AWS::GameLift::GameSessionQueue resource to the template. The AWS::GameLift::GameSessionQueue resource establishes a queue for processing requests to create new game sessions. A queue identifies where new game sessions can be hosted by specifying a list of destinations (fleets or aliases. It also sets how long requests can wait in the queue before timing out. You can set up a queue with destinations in multiple Regions.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-gamesessionqueue.html

    .PARAMETER LogicalId
        The logical ID must be alphanumeric (A-Za-z0-9) and unique within the template. Use the logical name to reference the resource in other parts of the template. For example, if you want to map an Amazon Elastic Block Store volume to an Amazon EC2 instance, you reference the logical IDs to associate the block stores with the instance.

    .PARAMETER TimeoutInSeconds
        The maximum time, in seconds, that a new game session placement request remains in the queue. When a request exceeds this time, the game session placement changes to a TIMED_OUT status.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-gamesessionqueue.html#cfn-gamelift-gamesessionqueue-timeoutinseconds
        PrimitiveType: Integer
        UpdateType: Mutable

    .PARAMETER PlayerLatencyPolicies
        A collection of latency policies to apply when processing game sessions placement requests with player latency information. Multiple policies are evaluated in order of the maximum latency value, starting with the lowest latency values. With just one policy, the policy is enforced at the start of the game session placement for the duration period. With multiple policies, each policy is enforced consecutively for its duration period. For example, a queue might enforce a 60-second policy followed by a 120-second policy, and then no policy for the remainder of the placement. A player latency policy must set a value for MaximumIndividualPlayerLatencyMilliseconds. If none is set, this API request fails.

        Type: List
        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-gamesessionqueue.html#cfn-gamelift-gamesessionqueue-playerlatencypolicies
        ItemType: PlayerLatencyPolicy
        UpdateType: Mutable

    .PARAMETER Destinations
        A list of fleets that can be used to fulfill game session placement requests in the queue. Fleets are identified by either a fleet ARN or a fleet alias ARN. Destinations are listed in default preference order.

        Type: List
        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-gamesessionqueue.html#cfn-gamelift-gamesessionqueue-destinations
        ItemType: Destination
        UpdateType: Mutable

    .PARAMETER Name
        A descriptive label that is associated with game session queue. Queue names must be unique within each Region.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-gamesessionqueue.html#cfn-gamelift-gamesessionqueue-name
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER DeletionPolicy
        With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.

        To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .PARAMETER UpdateReplacePolicy
        Use the UpdateReplacePolicy attribute to retain or (in some cases) backup the existing physical instance of a resource when it is replaced during a stack update operation.

        When you initiate a stack update, AWS CloudFormation updates resources based on differences between what you submit and the stack's current template and parameters. If you update a resource property that requires that the resource be replaced, AWS CloudFormation recreates the resource during the update. Recreating the resource generates a new physical ID. AWS CloudFormation creates the replacement resource first, and then changes references from other dependent resources to point to the replacement resource. By default, AWS CloudFormation then deletes the old resource. Using the UpdateReplacePolicy, you can specify that AWS CloudFormation retain or (in some cases) create a snapshot of the old resource.

        For resources that support snapshots, such as AWS::EC2::Volume, specify Snapshot to have AWS CloudFormation create a snapshot before deleting the old resource instance.

        You can apply the UpdateReplacePolicy attribute to any resource. UpdateReplacePolicy is only executed if you update a resource property whose update behavior is specified as Replacement, thereby causing AWS CloudFormation to replace the old resource with a new one with a new physical ID. For example, if you update the Engine property of an AWS::RDS::DBInstance resource type, AWS CloudFormation creates a new resource and replaces the current DB instance resource with the new one. The UpdateReplacePolicy attribute would then dictate whether AWS CloudFormation deleted, retained, or created a snapshot of the old DB instance. The update behavior for each property of a resource is specified in the reference topic for that resource in the AWS Resource and Property Types Reference. For more information on resource update behavior, see Update Behaviors of Stack Resources.

        The UpdateReplacePolicy attribute applies to stack updates you perform directly, as well as stack updates performed using change sets.

        Note
        Resources that are retained continue to exist and continue to incur applicable charges until you delete those resources. Snapshots that are created with this policy continue to exist and continue to incur applicable charges until you delete those snapshots. UpdateReplacePolicy retains the old physical resource or snapshot, but removes it from AWS CloudFormation's scope.

        UpdateReplacePolicy differs from the DeletionPolicy attribute in that it only applies to resources replaced during stack updates. Use DeletionPolicy for resources deleted when a stack is deleted, or when the resource definition itself is deleted from the template as part of a stack update.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .PARAMETER DependsOn
        With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute.

        This parameter takes a string or list of strings representing Logical IDs of resources that must be created prior to this resource being created.

    .PARAMETER Metadata
        The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON or YAML to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.

        You must use a PSCustomObject containing key/value pairs here. This will be returned when describing the resource using AWS CLI.

    .PARAMETER UpdatePolicy
        Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup resource. AWS CloudFormation invokes one of three update policies depending on the type of change you make or whether a scheduled action is associated with the Auto Scaling group.

        You must use the "Add-UpdatePolicy" function here.
    .PARAMETER Condition
        Logical ID of the condition that this resource needs to be true in order for this resource to be provisioned.

    .FUNCTIONALITY
        Vaporshell
    #>
    [OutputType('Vaporshell.Resource.GameLift.GameSessionQueue')]
    [cmdletbinding()]
    Param
    (
        [parameter(Mandatory = $true,Position = 0)]
        [ValidateScript( {
                if ($_ -match "^[a-zA-Z0-9]*$") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String 'The LogicalID must be alphanumeric (a-z, A-Z, 0-9) and unique within the template.'))
                }
            })]
        [System.String]
        $LogicalId,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "System.Int32","Vaporshell.Function"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $TimeoutInSeconds,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "Vaporshell.Resource.GameLift.GameSessionQueue.PlayerLatencyPolicy"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $PlayerLatencyPolicies,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "Vaporshell.Resource.GameLift.GameSessionQueue.Destination"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $Destinations,
        [parameter(Mandatory = $true)]
        [ValidateScript( {
                $allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $Name,
        [ValidateSet("Delete","Retain","Snapshot")]
        [System.String]
        $DeletionPolicy,
        [ValidateSet("Delete","Retain","Snapshot")]
        [System.String]
        $UpdateReplacePolicy,
        [parameter(Mandatory = $false)]
        [System.String[]]
        $DependsOn,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "System.Management.Automation.PSCustomObject"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "The UpdatePolicy parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $Metadata,
        [parameter(Mandatory = $false)]
        [ValidateScript( {
                $allowedTypes = "Vaporshell.Resource.UpdatePolicy"
                if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") {
                    $true
                }
                else {
                    $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")."))
                }
            })]
        $UpdatePolicy,
        [parameter(Mandatory = $false)]
        $Condition
    )
    Begin {
        $ResourceParams = @{
            LogicalId = $LogicalId
            Type = "AWS::GameLift::GameSessionQueue"
        }
        $commonParams = @('Verbose','Debug','ErrorAction','WarningAction','InformationAction','ErrorVariable','WarningVariable','InformationVariable','OutVariable','OutBuffer','PipelineVariable')
    }
    Process {
        foreach ($key in $PSBoundParameters.Keys | Where-Object {$commonParams -notcontains $_}) {
            switch ($key) {
                LogicalId {}
                DeletionPolicy {
                    $ResourceParams.Add("DeletionPolicy",$DeletionPolicy)
                }
                UpdateReplacePolicy {
                    $ResourceParams.Add("UpdateReplacePolicy",$UpdateReplacePolicy)
                }
                DependsOn {
                    $ResourceParams.Add("DependsOn",$DependsOn)
                }
                Metadata {
                    $ResourceParams.Add("Metadata",$Metadata)
                }
                UpdatePolicy {
                    $ResourceParams.Add("UpdatePolicy",$UpdatePolicy)
                }
                Condition {
                    $ResourceParams.Add("Condition",$Condition)
                }
                PlayerLatencyPolicies {
                    if (!($ResourceParams["Properties"])) {
                        $ResourceParams.Add("Properties",([PSCustomObject]@{}))
                    }
                    $ResourceParams["Properties"] | Add-Member -MemberType NoteProperty -Name PlayerLatencyPolicies -Value @($PlayerLatencyPolicies)
                }
                Destinations {
                    if (!($ResourceParams["Properties"])) {
                        $ResourceParams.Add("Properties",([PSCustomObject]@{}))
                    }
                    $ResourceParams["Properties"] | Add-Member -MemberType NoteProperty -Name Destinations -Value @($Destinations)
                }
                Default {
                    if (!($ResourceParams["Properties"])) {
                        $ResourceParams.Add("Properties",([PSCustomObject]@{}))
                    }
                    $ResourceParams["Properties"] | Add-Member -MemberType NoteProperty -Name $key -Value $PSBoundParameters[$key]
                }
            }
        }
    }
    End {
        $obj = New-VaporResource @ResourceParams
        $obj | Add-ObjectDetail -TypeName 'Vaporshell.Resource.GameLift.GameSessionQueue'
        Write-Verbose "Resulting JSON from $($MyInvocation.MyCommand): `n`n$(@{$obj.LogicalId = $obj.Props} | ConvertTo-Json -Depth 5)`n"
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="EntryPointsManager">
    <entry_points version="2.0" />
  </component>
  <component name="IdProvider" IDEtalkID="DA3E54828DEA553C6E11687E0767AF26" />
  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
    <output url="file://$PROJECT_DIR$/out" />
  </component>
</project>


text:
<?php

declare(strict_types=1);

namespace phpseclib3\File\ASN1\Maps;

use phpseclib3\File\ASN1;

/**
 * PBMAC1params
 *
 * from https://tools.ietf.org/html/rfc2898#appendix-A.3
 *
 * @author  Jim Wigginton <terrafrost@php.net>
 */
abstract class PBMAC1params
{
    public const MAP = [
        'type' => ASN1::TYPE_SEQUENCE,
        'children' => [
            'keyDerivationFunc' => AlgorithmIdentifier::MAP,
            'messageAuthScheme' => AlgorithmIdentifier::MAP,
        ],
    ];
}


text:
package org.fidonet.echobase;

import org.fidonet.echobase.exceptions.EchoBaseException;
import org.fidonet.types.Message;

import java.io.IOException;
import java.util.List;

public class EchoMgr {

    private final IBase echosbase;

    public EchoMgr(IBase base) {
        this.echosbase = base;
    }

    public void addMessage(Message msg) throws IOException, EchoBaseException {
        echosbase.addMessage(msg, msg.getArea().toLowerCase());
    }

    public Message getMessage(String area, String id) throws EchoBaseException {
        return echosbase.getMessage(area, id);
    }

    public List<Message> getMessage(String id) throws EchoBaseException {
        return echosbase.getMessage(id);
    }

    private void createArea(String name) throws EchoBaseException {
        echosbase.createArea(name);
    }

    public List<String> getEchos() {
        return echosbase.getAreas();
    }

    public boolean isEchoExists(String name) {
        return echosbase.isAreaExists(name);
    }

    public void close() {
        echosbase.close();
    }

    public boolean isDupe(Message message) {
        return echosbase.isDupe(message);
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Ann. Rep. Reg. St. N. Y. 23: 65 (1872)

#### Original name
Depazea fraxinicola M.A. Curtis & Peck

### Remarks
null


text:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.jeeplus.weixin.mapper.UserAccountDetailModelMapper" >
  <resultMap id="BaseResultMap" type="cn.btkj.entity.UserAccountDetailModel" >
    <id column="recordid" property="recordid" jdbcType="INTEGER" />
    <result column="accountuser" property="accountuser" jdbcType="INTEGER" />
    <result column="accountopt" property="accountopt" jdbcType="TINYINT" />
    <result column="optamount" property="optamount" jdbcType="INTEGER" />
    <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" />
    <result column="reason" property="reason" jdbcType="VARCHAR" />
    <result column="checktime" property="checktime" jdbcType="TIMESTAMP" />
    <result column="checkerid" property="checkerid" jdbcType="INTEGER" />
    <result column="alipayaccount" property="alipayaccount" jdbcType="VARCHAR" />
    <result column="realname" property="realname" jdbcType="VARCHAR" />
    <result column="wxopenid" property="wxopenid" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    recordid, accountuser, accountopt, optamount, updatetime,reason,checktime,checkerid,alipayaccount,realname,wxopenid
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select
    <include refid="Base_Column_List" />
    from tmk_user_account_detail
    where recordid = #{recordid,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from tmk_user_account_detail
    where recordid = #{recordid,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="cn.btkj.entity.UserAccountDetailModel" >
    insert into tmk_user_account_detail (recordid, accountuser, accountopt,
      optamount, updatetime,alipayaccount,realname,wxopenid)
    values (#{recordid,jdbcType=INTEGER}, #{accountuser,jdbcType=INTEGER}, #{accountopt,jdbcType=TINYINT},
      #{optamount,jdbcType=INTEGER}, #{updatetime,jdbcType=TIMESTAMP}, #{alipayaccount},
       #{realname},#{wxopenid})
  </insert>
  <insert id="insertSelective" parameterType="cn.btkj.entity.UserAccountDetailModel" >
    insert into tmk_user_account_detail
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="recordid != null" >
        recordid,
      </if>
      <if test="accountuser != null" >
        accountuser,
      </if>
      <if test="accountopt != null" >
        accountopt,
      </if>
      <if test="optamount != null" >
        optamount,
      </if>
      <if test="updatetime != null" >
        updatetime,
      </if>
      <if test="alipayaccount != null" >
        alipayaccount,
      </if>
      <if test="realname != null" >
        realname,
      </if>
      <if test="wxopenid != null" >
        wxopenid,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="recordid != null" >
        #{recordid,jdbcType=INTEGER},
      </if>
      <if test="accountuser != null" >
        #{accountuser,jdbcType=INTEGER},
      </if>
      <if test="accountopt != null" >
        #{accountopt,jdbcType=TINYINT},
      </if>
      <if test="optamount != null" >
        #{optamount,jdbcType=INTEGER},
      </if>
      <if test="updatetime != null" >
        #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="alipayaccount != null" >
        #{alipayaccount},
      </if>
      <if test="realname != null" >
        #{realname},
      </if>
      <if test="wxopenid != null" >
        #{wxopenid},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="cn.btkj.entity.UserAccountDetailModel" >
    update tmk_user_account_detail
    <set >
      <if test="accountuser != null" >
        accountuser = #{accountuser,jdbcType=INTEGER},
      </if>
      <if test="accountopt != null" >
        accountopt = #{accountopt,jdbcType=TINYINT},
      </if>
      <if test="optamount != null" >
        optamount = #{optamount,jdbcType=INTEGER},
      </if>
      <if test="updatetime != null" >
        updatetime = #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="reason != null" >
        reason = #{reason},
      </if>
      <if test="checktime != null" >
        checktime = #{checktime},
      </if>
      <if test="checkerid != null" >
        checkerid = #{checkerid},
      </if>
      <if test="del != null" >
        del = #{del}
      </if>
    </set>
    where recordid = #{recordid,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.btkj.entity.UserAccountDetailModel" >
    update tmk_user_account_detail
    set accountuser = #{accountuser,jdbcType=INTEGER},
      accountopt = #{accountopt,jdbcType=TINYINT},
      optamount = #{optamount,jdbcType=INTEGER},
      updatetime = #{updatetime,jdbcType=TIMESTAMP},
      reason = #{reason},
      checktime = #{checktime},
      checkerid = #{checkerid},
      del = #{del}
    where recordid = #{recordid,jdbcType=INTEGER}
  </update>

   <select id="selectListByUserid" resultType="FoundDetailModel" parameterType="java.lang.Integer" >
	    select tuad.*,td.name as  accountopt_name
	    from tmk_user_account_detail tuad
	    LEFT JOIN tmk_dict td on td.category='AccountOpt' and tuad.accountopt=td.`value`
	    where tuad.accountuser = #{accountuser} and tuad.del=0
	    order by tuad.updatetime desc
  </select>

</mapper>


text:
#pragma once

#include "NodeGraph.hpp"

static auto Get42Line() -> std::string { static const std::string line('_', 42); return line; }

inline auto operator<<(std::ostream &stream, const Hotland::Plugins::NodeGraph::Variable &V) -> std::ostream &
{
    stream << Get42Line() << '\n';
    stream << "Variable [" << &V << "]'s contents:\n";
    stream << "Real name: [" << V.GetName() << "]; Unique ID: " << V.GetID() << "]\n";
    stream << "Underlying type name: [" << V.GetTypeName() << "]; Underlying type ID: [" << V.GetTypeID() << "]\n";
    stream << Get42Line() << '\n';
    stream << std::flush;

    return stream;
}


text:
package introspection

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestProcedureName(t *testing.T) {
	tests := []struct {
		msg  string
		p    Procedure
		want string
	}{
		{
			msg:  "proto encoding",
			p:    Procedure{Encoding: "proto", Name: "full.path.to.service::method"},
			want: "/full.path.to.service/method",
		},
		{
			msg:  "json encoding",
			p:    Procedure{Encoding: "json", Name: "full.path.to.service::method"},
			want: "full.path.to.service::method",
		},
		{
			msg:  "thrift encoding",
			p:    Procedure{Encoding: "thrift", Name: "full.path.to.service::method"},
			want: "full.path.to.service::method",
		},
	}

	for _, tt := range tests {
		t.Run(tt.msg, func(t *testing.T) {
			assert.Equal(t, tt.want, tt.p.ProcedureName(), "procedure name mismatch")
		})
	}
}


text:
/**
 * @file
 * Port object definitions.
 */
#include "mem/port.hh"

#include "base/trace.hh"
#include "sim/sim_object.hh"

namespace gem5
{

namespace
{

class DefaultRequestPort : public RequestPort
{
  protected:
    [[noreturn]] void
    blowUp() const
    {
        throw UnboundPortException();
    }

  public:
    DefaultRequestPort() : RequestPort("default_request_port", nullptr) {}

    // Atomic protocol.
    Tick recvAtomicSnoop(PacketPtr) override { blowUp(); }

    // Timing protocol.
    bool recvTimingResp(PacketPtr) override { blowUp(); }
    void recvTimingSnoopReq(PacketPtr) override { blowUp(); }
    void recvReqRetry() override { blowUp(); }
    void recvRetrySnoopResp() override { blowUp(); }

    // Functional protocol.
    void recvFunctionalSnoop(PacketPtr) override { blowUp(); }
};

class DefaultResponsePort : public ResponsePort
{
  protected:
    [[noreturn]] void
    blowUp() const
    {
        throw UnboundPortException();
    }

  public:
    DefaultResponsePort() : ResponsePort("default_response_port", nullptr) {}

    // Atomic protocol.
    Tick recvAtomic(PacketPtr) override { blowUp(); }

    // Timing protocol.
    bool recvTimingReq(PacketPtr) override { blowUp(); }
    bool tryTiming(PacketPtr) override { blowUp(); }
    bool recvTimingSnoopResp(PacketPtr) override { blowUp(); }
    void recvRespRetry() override { blowUp(); }

    // Functional protocol.
    void recvFunctional(PacketPtr) override { blowUp(); }

    // General.
    AddrRangeList getAddrRanges() const override { return AddrRangeList(); }
};

DefaultRequestPort defaultRequestPort;
DefaultResponsePort defaultResponsePort;

} // anonymous namespace

/**
 * Request port
 */
RequestPort::RequestPort(const std::string& name, SimObject* _owner,
    PortID _id) : Port(name, _id), _responsePort(&defaultResponsePort),
    owner(*_owner)
{
}

RequestPort::~RequestPort()
{
}

void
RequestPort::bind(Port &peer)
{
    auto *response_port = dynamic_cast<ResponsePort *>(&peer);
    fatal_if(!response_port, "Can't bind port %s to non-response port %s.",
             name(), peer.name());
    // request port keeps track of the response port
    _responsePort = response_port;
    Port::bind(peer);
    // response port also keeps track of request port
    _responsePort->responderBind(*this);
}

void
RequestPort::unbind()
{
    panic_if(!isConnected(), "Can't unbind request port %s which is "
    "not bound.", name());
    _responsePort->responderUnbind();
    _responsePort = &defaultResponsePort;
    Port::unbind();
}

AddrRangeList
RequestPort::getAddrRanges() const
{
    return _responsePort->getAddrRanges();
}

void
RequestPort::printAddr(Addr a)
{
    auto req = std::make_shared<Request>(
        a, 1, 0, Request::funcRequestorId);

    Packet pkt(req, MemCmd::PrintReq);
    Packet::PrintReqState prs(std::cerr);
    pkt.senderState = &prs;

    sendFunctional(&pkt);
}

/**
 * Response port
 */
ResponsePort::ResponsePort(const std::string& name, SimObject* _owner,
    PortID id) : Port(name, id), _requestPort(&defaultRequestPort),
    defaultBackdoorWarned(false), owner(*_owner)
{
}

ResponsePort::~ResponsePort()
{
}

void
ResponsePort::responderUnbind()
{
    _requestPort = &defaultRequestPort;
    Port::unbind();
}

void
ResponsePort::responderBind(RequestPort& request_port)
{
    _requestPort = &request_port;
    Port::bind(request_port);
}

Tick
ResponsePort::recvAtomicBackdoor(PacketPtr pkt, MemBackdoorPtr &backdoor)
{
    if (!defaultBackdoorWarned) {
        warn("Port %s doesn't support requesting a back door.", name());
        defaultBackdoorWarned = true;
    }
    return recvAtomic(pkt);
}

} // namespace gem5