text:
package pl.touk.nussknacker.engine.schemedkafka.source.flink

import org.apache.avro.generic.GenericRecord
import org.scalatest.BeforeAndAfter
import pl.touk.nussknacker.engine.api.CustomStreamTransformer
import pl.touk.nussknacker.engine.api.process._
import pl.touk.nussknacker.engine.build.ScenarioBuilder
import pl.touk.nussknacker.engine.canonicalgraph.CanonicalProcess
import pl.touk.nussknacker.engine.flink.test.RecordingExceptionConsumer
import pl.touk.nussknacker.engine.kafka.generic.FlinkKafkaDelayedSourceImplFactory
import pl.touk.nussknacker.engine.kafka.source.delayed.DelayedKafkaSourceFactory.{DelayParameterName, TimestampFieldParamName}
import pl.touk.nussknacker.engine.process.compiler.FlinkProcessCompiler
import pl.touk.nussknacker.engine.process.helpers.SampleNodes.SinkForLongs
import pl.touk.nussknacker.engine.process.registrar.FlinkProcessRegistrar
import pl.touk.nussknacker.engine.schemedkafka.KafkaAvroIntegrationMockSchemaRegistry.schemaRegistryMockClient
import pl.touk.nussknacker.engine.schemedkafka.KafkaAvroTestProcessConfigCreator
import pl.touk.nussknacker.engine.schemedkafka.KafkaUniversalComponentTransformer.{SchemaVersionParamName, TopicParamName}
import pl.touk.nussknacker.engine.schemedkafka.helpers.KafkaAvroSpecMixin
import pl.touk.nussknacker.engine.schemedkafka.schemaregistry.confluent.ConfluentSchemaBasedSerdeProvider
import pl.touk.nussknacker.engine.schemedkafka.schemaregistry.confluent.client.{ConfluentSchemaRegistryClientFactory, MockConfluentSchemaRegistryClientFactory, MockSchemaRegistryClient}
import pl.touk.nussknacker.engine.schemedkafka.schemaregistry.{SchemaBasedSerdeProvider, SchemaVersionOption}
import pl.touk.nussknacker.engine.schemedkafka.source.delayed.DelayedUniversalKafkaSourceFactory
import pl.touk.nussknacker.engine.spel
import pl.touk.nussknacker.engine.testing.LocalModelData

import java.time.Instant

trait DelayedUniversalKafkaSourceIntegrationMixinSpec extends KafkaAvroSpecMixin with BeforeAndAfter  {

  private lazy val creator: ProcessConfigCreator = new DelayedKafkaUniversalProcessConfigCreator {
    override protected def schemaRegistryClientFactory = new MockConfluentSchemaRegistryClientFactory(schemaRegistryMockClient)
  }

  override protected def schemaRegistryClient: MockSchemaRegistryClient = schemaRegistryMockClient

  override protected def confluentClientFactory: ConfluentSchemaRegistryClientFactory = new MockConfluentSchemaRegistryClientFactory(schemaRegistryMockClient)

  override protected def beforeAll(): Unit = {
    super.beforeAll()
    val modelData = LocalModelData(config, creator)
    registrar = FlinkProcessRegistrar(new FlinkProcessCompiler(modelData), executionConfigPreparerChain(modelData))
  }

  before {
    SinkForLongs.clear()
  }

  protected def runAndVerify(topic: String, process: CanonicalProcess, givenObj: AnyRef): Unit = {
    kafkaClient.createTopic(topic, partitions = 1)
    pushMessage(givenObj, topic)
    run(process) {
      eventually {
        RecordingExceptionConsumer.dataFor(runId) shouldBe empty
        SinkForLongs.data should have size 1
      }
    }
  }

  protected def createProcessWithDelayedSource(topic: String, version: SchemaVersionOption, timestampField: String, delay: String): CanonicalProcess = {

    import spel.Implicits._

    ScenarioBuilder.streaming("kafka-universal-delayed-test")
      .parallelism(1)
      .source(
        "start",
        "kafka-universal-delayed",
        s"$TopicParamName" -> s"'${topic}'",
        s"$SchemaVersionParamName" -> asSpelExpression(formatVersionParam(version)),
        s"$TimestampFieldParamName" -> s"${timestampField}",
        s"$DelayParameterName" -> s"${delay}"
      )
      .emptySink("out", "sinkForLongs", "value" -> "T(java.time.Instant).now().toEpochMilli()")
  }

}

class DelayedKafkaUniversalProcessConfigCreator extends KafkaAvroTestProcessConfigCreator {

  override def sourceFactories(processObjectDependencies: ProcessObjectDependencies): Map[String, WithCategories[SourceFactory]] = {
    Map(
      "kafka-universal-delayed" -> defaultCategory(new DelayedUniversalKafkaSourceFactory[String, GenericRecord](schemaRegistryClientFactory, createSchemaBasedMessagesSerdeProvider,
        processObjectDependencies, new FlinkKafkaDelayedSourceImplFactory(None, UniversalTimestampFieldAssigner(_))))
    )
  }

  override def customStreamTransformers(processObjectDependencies: ProcessObjectDependencies): Map[String, WithCategories[CustomStreamTransformer]] =
    Map.empty

  override def sinkFactories(processObjectDependencies: ProcessObjectDependencies): Map[String, WithCategories[SinkFactory]] = {
    Map(
      "sinkForLongs" -> defaultCategory(SinkForLongs.toSinkFactory)
    )
  }

  override def expressionConfig(processObjectDependencies: ProcessObjectDependencies): ExpressionConfig = {
    super.expressionConfig(processObjectDependencies).copy(additionalClasses = List(classOf[Instant]))
  }

  override protected def createSchemaBasedMessagesSerdeProvider: SchemaBasedSerdeProvider = ConfluentSchemaBasedSerdeProvider.universal(schemaRegistryClientFactory)

}


text:
require 'spec_helper'
require 'kontena/plugin/digital_ocean/master/create_command'

describe Kontena::Plugin::DigitalOcean::Master::CreateCommand do

  let(:subject) do
    described_class.new(File.basename($0))
  end

  let(:provisioner) do
    spy(:provisioner)
  end

  describe '#run' do
    it 'prompts user if options are missing' do
      expect(subject).to receive(:prompt).at_least(:once).and_return(spy)
      allow(subject).to receive(:provisioner).and_return(provisioner)
      allow(subject).to receive(:ask_ssh_key).and_return(1)
      subject.run(['--name', 'foo', '--skip-auth-provider'])
    end

    it 'passes options to provisioner' do
      options = [
        '--token', 'secretone',
        '--name', 'test-master',
        '--no-prompt',
        '--skip-auth-provider',
        '--region', 'sfo1',
        '--size', '2gb'
      ]
      expect(subject).to receive(:provisioner).with('secretone').and_return(provisioner)
      allow(subject).to receive(:ask_ssh_key).and_return(1)
      expect(provisioner).to receive(:run!).with(
        hash_including(
          ssh_key_id: 1, name: 'test-master'
        )
      )
      subject.run(options)
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
This program is attempting to create Android Window transition graphs for
the static analyzer [**DroidInfer**](https://github.com/proganalysis/type-inference).

# Running
[**run.sh**](https://github.com/FireElementalNE/wtg-research/blob/master/run.sh) runs the framework. It assumes that all required jars are
in a folder named 'classpath_includes' in the root (the same directory as this file).
  An example classpath_includes folder is shown below:
```
|-- android-4.3.jar
|-- android-all.jar
|-- cfl.jar
|-- cgs.jar
|-- jdk-android.jar
|-- jre
|   `-- lib
|       |-- alt-rt.jar
|       |-- charsets.jar
|       |-- deploy.jar
|       |-- ext
|       |   |-- dnsns.jar
|       |   |-- localedata.jar
|       |   |-- sunec.jar
|       |   |-- sunjce_provider.jar
|       |   |-- sunpkcs11.jar
|       |   `-- zipfs.jar
|       |-- javaws.jar
|       |-- jce.jar
|       |-- jfr.jar
|       |-- jfxrt.jar
|       |-- jsse.jar
|       |-- management-agent.jar
|       |-- plugin.jar
|       |-- resources.jar
|       |-- rt.jar
|       `-- security
|           |-- local_policy.jar
|           `-- US_export_policy.jar
|-- libs
|   |-- core.jar
|   |-- framework2.jar
|   |-- framework3.jar
|   `-- framework.jar
|-- soot-develop.jar
`-- soot-trunk.jar

5 directories, 31 files
```

This was created by running:
```shell
tree -S -P "*.jar" --charset=ascii --prune -n
```
run.sh has the following usage:
```
bash $ ./run.sh -h
Usage: ./run.sh [-v] [-t <ANDROID APK>] [-m <MEMORY>] [-c] [-X] [-h]
	-h print this help message and exit
	-v shows soot's (very) verbose output
	-t <ANDROID APK> sets the target apk
	-m <MEMORY> sets the max java memory (-Xmx)
	-X skip running apktool
	-c clean up dirs
```

# Requirements
* Java JDK (you need javac)
* All of the classes that will be analyzed (anything not explicitly given
  will be treated as a phantom-ref!)
* [**Graphviz**](http://www.graphviz.org/) (this is available for most Linux distributions)
* [**APK tool**](https://ibotpeaches.github.io/Apktool/documentation/)

# Notes
* The original WTG paper can be found [**here**](http://dacongy.github.io/papers/yang-ase15.pdf).
* JavaDoc for soot can be found in [**docs/src**](https://github.com/FireElementalNE/wtg-research/tree/master/docs/soot)


text:
#ifndef ZEPHYR_INCLUDE_SYS_CBPRINTF_H_
#define ZEPHYR_INCLUDE_SYS_CBPRINTF_H_

#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <zephyr/toolchain.h>
#include <string.h>

#ifdef CONFIG_CBPRINTF_LIBC_SUBSTS
#include <stdio.h>
#endif /* CONFIG_CBPRINTF_LIBC_SUBSTS */

/* Determine if _Generic is supported using macro from toolchain.h.
 *
 * @note Z_C_GENERIC is also set for C++ where functionality is implemented
 * using overloading and templates.
 */
#ifndef Z_C_GENERIC
#if defined(__cplusplus) || TOOLCHAIN_HAS_C_GENERIC
#define Z_C_GENERIC 1
#else
#define Z_C_GENERIC 0
#endif
#endif

/**
 * @brief cbprintf package descriptor.
 */
struct cbprintf_package_desc {
	/** Package length (in 32 bit words) */
	uint8_t len;

	/** Number of appended strings in the package. */
	uint8_t str_cnt;

	/** Number of read-only strings, indexes appended to the package */
	uint8_t ro_str_cnt;

	/** Number of read-write strings, indexes appended to the package */
	uint8_t rw_str_cnt;

#ifdef CONFIG_CBPRINTF_PACKAGE_HEADER_STORE_CREATION_FLAGS
	/** Flags used to create the package */
	uint32_t pkg_flags;
#endif
} __packed;

/** @brief cbprintf package header
 *
 * cbprintf package header, without the format string pointer.
 */
union cbprintf_package_hdr {
	/** Header description */
	struct cbprintf_package_desc desc;

	void *raw;

#if defined(CONFIG_CBPRINTF_PACKAGE_HEADER_STORE_CREATION_FLAGS) && !defined(CONFIG_64BIT)
	void *raw2[2];
#endif

#ifdef CONFIG_CBPRINTF_PACKAGE_HEADER_STORE_CREATION_FLAGS
#ifdef __xtensa__
	/*
	 * On Xtensa, the first argument needs to be aligned to 8-byte.
	 * With 32-bit pointers, we need another 4 bytes padding so
	 * that whole struct cbprintf_package_hdr_ext is of multiple of
	 * 8 bytes.
	 */
	uint32_t xtensa_padding;
#endif
#endif

} __packed;

/** @brief cbprintf package header with format string pointer.
 *
 * cbprintf package header with format string pointer.
 */
struct cbprintf_package_hdr_ext {
	/** Header of package */
	union cbprintf_package_hdr hdr;

	/** Pointer to format string */
	char *fmt;

	/*
	 * When extending this struct, make sure this align
	 * to pointer size.
	 */
} __packed;

/* Z_C_GENERIC is used there */
#include <zephyr/sys/cbprintf_internal.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @defgroup cbprintf_apis Formatted Output APIs
 * @ingroup support_apis
 * @{
 */

/** @brief Required alignment of the buffer used for packaging. */
#ifdef __xtensa__
#define CBPRINTF_PACKAGE_ALIGNMENT 16
#else
#define CBPRINTF_PACKAGE_ALIGNMENT \
	Z_POW2_CEIL(COND_CODE_1(CONFIG_CBPRINTF_PACKAGE_LONGDOUBLE, \
		(sizeof(long double)), (MAX(sizeof(double), sizeof(long long)))))
#endif

BUILD_ASSERT(Z_IS_POW2(CBPRINTF_PACKAGE_ALIGNMENT));

/**@defgroup CBPRINTF_PACKAGE_FLAGS Package flags.
 * @{
 */

/** @brief Assume that const char pointer is pointing to read only (constant) strings.
 *
 * Flag is valid only for @ref CBPRINTF_STATIC_PACKAGE.
 */
#define CBPRINTF_PACKAGE_CONST_CHAR_RO BIT(0)

/** @brief Append locations (within the package) of read-only string pointers.`*/
#define CBPRINTF_PACKAGE_ADD_RO_STR_POS BIT(1)

/** @brief Append locations (within the package) of read-write string pointers.
 *
 * When this flag is not used then read-write strings are appended to the package.
 */
#define CBPRINTF_PACKAGE_ADD_RW_STR_POS BIT(2)

#define Z_CBPRINTF_PACKAGE_FIRST_RO_STR_BITS 3
#define Z_CBPRINTF_PACKAGE_FIRST_RO_STR_OFFSET 3
#define Z_CBPRINTF_PACKAGE_FIRST_RO_STR_MASK BIT_MASK(Z_CBPRINTF_PACKAGE_FIRST_RO_STR_BITS)

/** @brief Indicate that @p n first string format arguments are char pointers to
 * read-only location.
 *
 * Runtime algorithm (address analysis) is skipped for those strings.
 *
 * @param n Number of string arguments considered as read-only.
 */
#define CBPRINTF_PACKAGE_FIRST_RO_STR_CNT(n) \
	(n << Z_CBPRINTF_PACKAGE_FIRST_RO_STR_OFFSET)

/** @brief Get number of first format string arguments which are known to be read-only
 * string.
 */
#define Z_CBPRINTF_PACKAGE_FIRST_RO_STR_CNT_GET(flags) \
	(((flags) >> Z_CBPRINTF_PACKAGE_FIRST_RO_STR_OFFSET) & Z_CBPRINTF_PACKAGE_FIRST_RO_STR_MASK)

/** @brief Append indexes of read-only string arguments in the package.
 *
 * When used, package contains locations of read-only string arguments. Package
 * with that information can be converted to fully self-contain package using
 * @ref cbprintf_fsc_package.
 */
#define CBPRINTF_PACKAGE_ADD_STRING_IDXS \
	(CBPRINTF_PACKAGE_ADD_RO_STR_POS | CBPRINTF_PACKAGE_CONST_CHAR_RO)

/** @brief Indicate the incoming arguments are tagged.
 *
 * When set, this indicates that the incoming arguments are tagged, and
 * need to be processed accordingly.
 */
#define CBPRINTF_PACKAGE_ARGS_ARE_TAGGED BIT(6)

/**@} */

/**@defgroup CBPRINTF_PACKAGE_CONVERT_FLAGS Package flags.
 * @{
 */

/** @brief Append read-only strings from source package to destination package.
 *
 * If package was created with @ref CBPRINTF_PACKAGE_ADD_RO_STR_POS
 * or @ref CBPRINTF_PACKAGE_ADD_RW_STR_POS it contains arrays of indexes where
 * string address can be found in the package. When flag is set, read-only strings
 * are copied into destination package. Address of strings indicated as read-write
 * are also checked and if determined to be read-only they are also copied.
 */
#define CBPRINTF_PACKAGE_CONVERT_RO_STR BIT(0)
#define CBPRINTF_PACKAGE_COPY_RO_STR CBPRINTF_PACKAGE_CONVERT_RO_STR __DEPRECATED_MACRO

/** @brief Append read-write strings from source package to destination package.
 *
 * If package was created with @ref CBPRINTF_PACKAGE_ADD_RW_STR_POS it contains
 * arrays of indexes where string address can be found in the package. When flag
 * is set, list of read-write strings is examined and if they are not determined
 * to be read-only, they are copied into the destination package.
 * If @ref CBPRINTF_PACKAGE_CONVERT_RO_STR is not set, remaining string locations
 * are considered as pointing to read-only location and they are copy to the
 * package if @ref CBPRINTF_PACKAGE_CONVERT_KEEP_RO_STR is set.
 */
#define CBPRINTF_PACKAGE_CONVERT_RW_STR BIT(1)
#define CBPRINTF_PACKAGE_COPY_RW_STR CBPRINTF_PACKAGE_CONVERT_RW_STR __DEPRECATED_MACRO

/** @brief Keep read-only location indexes in the package.
 *
 * If it is set read-only string pointers are kept in the package after copy. If
 * not set they are discarded.
 */
#define CBPRINTF_PACKAGE_CONVERT_KEEP_RO_STR BIT(2)
#define CBPRINTF_PACKAGE_COPY_KEEP_RO_STR CBPRINTF_PACKAGE_CONVERT_KEEP_RO_STR __DEPRECATED_MACRO

/** @brief Check format string if %p argument was treated as %s in the package.
 *
 * Static packaging is done based only on types of arguments used for a format
 * string. Without looking into format specifiers present in the string. Because
 * of that if (unsigned) char pointer is used for %p it will be considered as
 * a string location and during conversion an attempt to append a string to a
 * package may be performed. This can lead to misbehavior, in the best case
 * package will be bigger and in the worst case memory fault or security violation
 * may occur.
 *
 * When this flag is set, format string will be checked to detect cases when
 * string candidate is a pointer used for %p and string appending from unexpected
 * location is avoided. Additionally, an log warning is generated to encourage
 * user to cast such argument to void *. It is recommended because there are
 * configurations where string is not accessible and inspection cannot be done.
 * In those cases there are no means to detect such cases.
 */
#define CBPRINTF_PACKAGE_CONVERT_PTR_CHECK BIT(3)

/**@} */

/**@defgroup Z_CBVPRINTF_PROCESS_FLAGS cbvprintf processing flags.
 * @{
 */

/** @brief Indicates the arguments are tagged.
 *
 * This tells z_cbvprintf_impl() that the incoming arguments are
 * tagged, and should be processed accordingly.
 */
#define Z_CBVPRINTF_PROCESS_FLAG_TAGGED_ARGS BIT(0)

/**@} */

#include <zephyr/sys/cbprintf_enums.h>

/** @brief Signature for a cbprintf callback function.
 *
 * This function expects two parameters:
 *
 * * @p c a character to output.  The output behavior should be as if
 *   this was cast to an unsigned char.
 * * @p ctx a pointer to an object that provides context for the
 *   output operation.
 *
 * The declaration does not specify the parameter types.  This allows a
 * function like @c fputc to be used without requiring all context pointers to
 * be to a @c FILE object.
 *
 * @return the value of @p c cast to an unsigned char then back to
 * int, or a negative error code that will be returned from
 * cbprintf().
 */
#ifdef __CHECKER__
typedef int (*cbprintf_cb)(int c, void *ctx);
#else
typedef int (*cbprintf_cb)(/* int c, void *ctx */);
#endif

/** @brief Signature for a cbprintf multibyte callback function.
 *
 * @param buf data.
 * @param len data length.
 * @param ctx a pointer to an object that provides context for the operation.
 *
 * return Amount of copied data or negative error code.
 */
typedef int (*cbprintf_convert_cb)(const void *buf, size_t len, void *ctx);

/** @brief Signature for a external formatter function identical to cbvprintf.
 *
 * This function expects the following parameters:
 *
 * @param out the function used to emit each generated character.
 *
 * @param ctx a pointer to an object that provides context for the
 * external formatter.
 *
 * @param fmt a standard ISO C format string with characters and
 * conversion specifications.
 *
 * @param ap captured stack arguments corresponding to the conversion
 * specifications found within @p fmt.
 *
 * @return vprintf like return values: the number of characters printed,
 * or a negative error value returned from external formatter.
 */
typedef int (*cbvprintf_external_formatter_func)(cbprintf_cb out, void *ctx,
						 const char *fmt, va_list ap);

/** @brief Determine if string must be packaged in run time.
 *
 * Static packaging can be applied if size of the package can be determined
 * at compile time. In general, package size can be determined at compile time
 * if there are no string arguments which might be copied into package body if
 * they are considered transient.
 *
 * @note By default any char pointers are considered to be pointing at transient
 * strings. This can be narrowed down to non const pointers by using
 * @ref CBPRINTF_PACKAGE_CONST_CHAR_RO.
 *
 * @param ... String with arguments.
 * @param flags option flags. See @ref CBPRINTF_PACKAGE_FLAGS.
 *
 * @retval 1 if string must be packaged in run time.
 * @retval 0 string can be statically packaged.
 */
#define CBPRINTF_MUST_RUNTIME_PACKAGE(flags, ... /* fmt, ... */) \
	Z_CBPRINTF_MUST_RUNTIME_PACKAGE(flags, __VA_ARGS__)

/** @brief Statically package string.
 *
 * Build string package from formatted string. It assumes that formatted
 * string is in the read only memory.
 *
 * If _Generic is not supported then runtime packaging is performed.
 *
 * @param packaged pointer to where the packaged data can be stored. Pass a null
 * pointer to skip packaging but still calculate the total space required.
 * The data stored here is relocatable, that is it can be moved to another
 * contiguous block of memory. It must be aligned to the size of the longest
 * argument. It is recommended to use CBPRINTF_PACKAGE_ALIGNMENT for alignment.
 *
 * @param inlen set to the number of bytes available at @p packaged. If
 * @p packaged is NULL the value is ignored.
 *
 * @param outlen variable updated to the number of bytes required to completely
 * store the packed information. If input buffer was too small it is set to
 * -ENOSPC.
 *
 * @param align_offset input buffer alignment offset in bytes. Where offset 0
 * means that buffer is aligned to CBPRINTF_PACKAGE_ALIGNMENT. Xtensa requires
 * that @p packaged is aligned to CBPRINTF_PACKAGE_ALIGNMENT so it must be
 * multiply of CBPRINTF_PACKAGE_ALIGNMENT or 0.
 *
 * @param flags option flags. See @ref CBPRINTF_PACKAGE_FLAGS.
 *
 * @param ... formatted string with arguments. Format string must be constant.
 */
#define CBPRINTF_STATIC_PACKAGE(packaged, inlen, outlen, align_offset, flags, \
				... /* fmt, ... */) \
	Z_CBPRINTF_STATIC_PACKAGE(packaged, inlen, outlen, \
				  align_offset, flags, __VA_ARGS__)

/** @brief Capture state required to output formatted data later.
 *
 * Like cbprintf() but instead of processing the arguments and emitting the
 * formatted results immediately all arguments are captured so this can be
 * done in a different context, e.g. when the output function can block.
 *
 * In addition to the values extracted from arguments this will ensure that
 * copies are made of the necessary portions of any string parameters that are
 * not confirmed to be stored in read-only memory (hence assumed to be safe to
 * refer to directly later).
 *
 * @param packaged pointer to where the packaged data can be stored.  Pass a
 * null pointer to store nothing but still calculate the total space required.
 * The data stored here is relocatable, that is it can be moved to another
 * contiguous block of memory. However, under condition that alignment is
 * maintained. It must be aligned to at least the size of a pointer.
 *
 * @param len this must be set to the number of bytes available at @p packaged
 * if it is not null. If @p packaged is null then it indicates hypothetical
 * buffer alignment offset in bytes compared to CBPRINTF_PACKAGE_ALIGNMENT
 * alignment. Buffer alignment offset impacts returned size of the package.
 * Xtensa requires that buffer is always aligned to CBPRINTF_PACKAGE_ALIGNMENT
 * so it must be multiply of CBPRINTF_PACKAGE_ALIGNMENT or 0 when @p packaged is
 * null.
 *
 * @param flags option flags. See @ref CBPRINTF_PACKAGE_FLAGS.
 *
 * @param format a standard ISO C format string with characters and conversion
 * specifications.
 *
 * @param ... arguments corresponding to the conversion specifications found
 * within @p format.
 *
 * @retval nonegative the number of bytes successfully stored at @p packaged.
 * This will not exceed @p len.
 * @retval -EINVAL if @p format is not acceptable
 * @retval -EFAULT if @p packaged alignment is not acceptable
 * @retval -ENOSPC if @p packaged was not null and the space required to store
 * exceed @p len.
 */
__printf_like(4, 5)
int cbprintf_package(void *packaged,
		     size_t len,
		     uint32_t flags,
		     const char *format,
		     ...);

/** @brief Capture state required to output formatted data later.
 *
 * Like cbprintf() but instead of processing the arguments and emitting the
 * formatted results immediately all arguments are captured so this can be
 * done in a different context, e.g. when the output function can block.
 *
 * In addition to the values extracted from arguments this will ensure that
 * copies are made of the necessary portions of any string parameters that are
 * not confirmed to be stored in read-only memory (hence assumed to be safe to
 * refer to directly later).
 *
 * @param packaged pointer to where the packaged data can be stored.  Pass a
 * null pointer to store nothing but still calculate the total space required.
 * The data stored here is relocatable, that is it can be moved to another
 * contiguous block of memory. The pointer must be aligned to a multiple of
 * the largest element in the argument list.
 *
 * @param len this must be set to the number of bytes available at @p packaged.
 * Ignored if @p packaged is NULL.
 *
 * @param flags option flags. See @ref CBPRINTF_PACKAGE_FLAGS.
 *
 * @param format a standard ISO C format string with characters and conversion
 * specifications.
 *
 * @param ap captured stack arguments corresponding to the conversion
 * specifications found within @p format.
 *
 * @retval nonegative the number of bytes successfully stored at @p packaged.
 * This will not exceed @p len.
 * @retval -EINVAL if @p format is not acceptable
 * @retval -ENOSPC if @p packaged was not null and the space required to store
 * exceed @p len.
 */
int cbvprintf_package(void *packaged,
		      size_t len,
		      uint32_t flags,
		      const char *format,
		      va_list ap);

/** @brief Convert a package.
 *
 * Converting may include appending strings used in the package to the package body.
 * If input package was created with @ref CBPRINTF_PACKAGE_ADD_RO_STR_POS or
 * @ref CBPRINTF_PACKAGE_ADD_RW_STR_POS, it contains information where strings
 * are located within the package. This information can be used to copy strings
 * during the conversion.
 *
 * @p cb is called with portions of the output package. At the end of the conversion
 * @p cb is called with null buffer.
 *
 * @param in_packaged Input package.
 *
 * @param in_len Input package length. If 0 package length will be retrieved
 * from the @p in_packaged
 *
 * @param cb callback called with portions of the converted package. If null only
 * length of the output package is calculated.
 *
 * @param ctx Context provided to the @p cb.
 *
 * @param flags Flags. See @ref CBPRINTF_PACKAGE_CONVERT_FLAGS.
 *
 * @param[in, out] strl if @p packaged is null, it is a pointer to the array where
 * @p strl_len first string lengths will is stored. If @p packaged is not null,
 * it contains lengths of first @p strl_len strings. It can be used to optimize
 * copying so that string length is calculated only once (at length calculation
 * phase when @p packaged is null.)
 *
 * @param strl_len Number of elements in @p strl array.
 *
 * @retval Positive output package size.
 * @retval -ENOSPC if @p packaged was not null and the space required to store
 * exceed @p len.
 */
int cbprintf_package_convert(void *in_packaged,
			     size_t in_len,
			     cbprintf_convert_cb cb,
			     void *ctx,
			     uint32_t flags,
			     uint16_t *strl,
			     size_t strl_len);

/* @interal Context used for package copying. */
struct z_cbprintf_buf_desc {
	void *buf;
	size_t size;
	size_t off;
};

/* @internal Function callback used for package copying. */
static inline int z_cbprintf_cpy(const void *buf, size_t len, void *ctx)
{
	struct z_cbprintf_buf_desc *desc = (struct z_cbprintf_buf_desc *)ctx;

	if ((desc->size - desc->off) < len) {
		return -ENOSPC;
	}

	memcpy(&((uint8_t *)desc->buf)[desc->off], buf, len);
	desc->off += len;

	return len;
}

/** @brief Copy package with optional appending of strings.
 *
 * @ref cbprintf_package_convert is used to convert and store converted package
 * in the new location.
 *
 * @param in_packaged Input package.
 *
 * @param in_len Input package length. If 0 package length will be retrieved
 * from the @p in_packaged
 *
 * @param[out] packaged Output package. If null only length of the output package
 * is calculated.
 *
 * @param len Available space in the location pointed by @p packaged. Not used when
 * @p packaged is null.
 *
 * @param flags Flags. See @ref CBPRINTF_PACKAGE_CONVERT_FLAGS.
 *
 * @param[in, out] strl if @p packaged is null, it is a pointer to the array where
 * @p strl_len first string lengths will is stored. If @p packaged is not null,
 * it contains lengths of first @p strl_len strings. It can be used to optimize
 * copying so that string length is calculated only once (at length calculation
 * phase when @p packaged is null.)
 *
 * @param strl_len Number of elements in @p strl array.
 *
 * @retval Positive Output package size.
 * @retval -ENOSPC if @p packaged was not null and the space required to store
 * exceed @p len.
 */
static inline int cbprintf_package_copy(void *in_packaged,
					size_t in_len,
					void *packaged,
					size_t len,
					uint32_t flags,
					uint16_t *strl,
					size_t strl_len)
{
	struct z_cbprintf_buf_desc buf_desc = {
		.buf = packaged,
		.size = len,
		.off = 0,
	};

	return cbprintf_package_convert(in_packaged, in_len,
					packaged ? z_cbprintf_cpy : NULL, &buf_desc,
					flags, strl, strl_len);
}

/** @brief Convert package to fully self-contained (fsc) package.
 *
 * Package may not be self contain since strings by default are stored by address.
 * Package may be partially self-contained when transient (not read only) strings
 * are appended to the package. Such package can be decoded only when there is an
 * access to read-only strings.
 *
 * Fully self-contained has (fsc) contains all strings used in the package. A package
 * can be converted to fsc package if it was create with @ref CBPRINTF_PACKAGE_ADD_RO_STR_POS
 * flag. Such package will contain necessary data to find read only strings in
 * the package and copy them into the package body.
 *
 * @param in_packaged pointer to original package created with
 * @ref CBPRINTF_PACKAGE_ADD_RO_STR_POS.
 *
 * @param in_len @p in_packaged length.
 *
 * @param packaged pointer to location where fully self-contained version of the
 * input package will be written. Pass a null pointer to calculate space required.
 *
 * @param len must be set to the number of bytes available at @p packaged. Not
 * used if @p packaged is null.
 *
 * @retval nonegative the number of bytes successfully stored at @p packaged.
 * This will not exceed @p len. If @p packaged is null, calculated length.
 * @retval -ENOSPC if @p packaged was not null and the space required to store
 * exceed @p len.
 * @retval -EINVAL if @p in_packaged is null.
 */
static inline int cbprintf_fsc_package(void *in_packaged,
				       size_t in_len,
				       void *packaged,
				       size_t len)
{
	return cbprintf_package_copy(in_packaged, in_len, packaged, len,
				     CBPRINTF_PACKAGE_CONVERT_RO_STR |
				     CBPRINTF_PACKAGE_CONVERT_RW_STR, NULL, 0);
}

/** @brief Generate the output for a previously captured format
 * operation using an external formatter.
 *
 * @param out the function used to emit each generated character.
 *
 * @param formatter external formatter function.
 *
 * @param ctx a pointer to an object that provides context for the
 * external formatter.
 *
 * @param packaged the data required to generate the formatted output, as
 * captured by cbprintf_package() or cbvprintf_package(). The alignment
 * requirement on this data is the same as when it was initially created.
 *
 * @note Memory indicated by @p packaged will be modified in a non-destructive
 * way, meaning that it could still be reused with this function again.
 *
 * @return printf like return values: the number of characters printed,
 * or a negative error value returned from external formatter.
 */
int cbpprintf_external(cbprintf_cb out,
		       cbvprintf_external_formatter_func formatter,
		       void *ctx,
		       void *packaged);

/** @brief *printf-like output through a callback.
 *
 * This is essentially printf() except the output is generated
 * character-by-character using the provided @p out function.  This allows
 * formatting text of unbounded length without incurring the cost of a
 * temporary buffer.
 *
 * All formatting specifiers of C99 are recognized, and most are supported if
 * the functionality is enabled.
 *
 * @note The functionality of this function is significantly reduced
 * when @kconfig{CONFIG_CBPRINTF_NANO} is selected.
 *
 * @param out the function used to emit each generated character.
 *
 * @param ctx context provided when invoking out
 *
 * @param format a standard ISO C format string with characters and conversion
 * specifications.
 *
 * @param ... arguments corresponding to the conversion specifications found
 * within @p format.
 *
 * @return the number of characters printed, or a negative error value
 * returned from invoking @p out.
 */
__printf_like(3, 4)
int cbprintf(cbprintf_cb out, void *ctx, const char *format, ...);

/** @brief varargs-aware *printf-like output through a callback.
 *
 * This is essentially vsprintf() except the output is generated
 * character-by-character using the provided @p out function.  This allows
 * formatting text of unbounded length without incurring the cost of a
 * temporary buffer.
 *
 * @note This function is available only when
 * @kconfig{CONFIG_CBPRINTF_LIBC_SUBSTS} is selected.
 *
 * @note The functionality of this function is significantly reduced when
 * @kconfig{CONFIG_CBPRINTF_NANO} is selected.
 *
 * @param out the function used to emit each generated character.
 *
 * @param ctx context provided when invoking out
 *
 * @param format a standard ISO C format string with characters and conversion
 * specifications.
 *
 * @param ap a reference to the values to be converted.
 *
 * @param flags flags on how to process the inputs.
 *              @see Z_CBVPRINTF_PROCESS_FLAGS.
 *
 * @return the number of characters generated, or a negative error value
 * returned from invoking @p out.
 */
int z_cbvprintf_impl(cbprintf_cb out, void *ctx, const char *format,
		     va_list ap, uint32_t flags);

/** @brief varargs-aware *printf-like output through a callback.
 *
 * This is essentially vsprintf() except the output is generated
 * character-by-character using the provided @p out function.  This allows
 * formatting text of unbounded length without incurring the cost of a
 * temporary buffer.
 *
 * @note This function is available only when
 * @kconfig{CONFIG_CBPRINTF_LIBC_SUBSTS} is selected.
 *
 * @note The functionality of this function is significantly reduced when
 * @kconfig{CONFIG_CBPRINTF_NANO} is selected.
 *
 * @param out the function used to emit each generated character.
 *
 * @param ctx context provided when invoking out
 *
 * @param format a standard ISO C format string with characters and conversion
 * specifications.
 *
 * @param ap a reference to the values to be converted.
 *
 * @return the number of characters generated, or a negative error value
 * returned from invoking @p out.
 */
#ifdef CONFIG_PICOLIBC
int cbvprintf(cbprintf_cb out, void *ctx, const char *format, va_list ap);
#else
static inline
int cbvprintf(cbprintf_cb out, void *ctx, const char *format, va_list ap)
{
	return z_cbvprintf_impl(out, ctx, format, ap, 0);
}
#endif

/** @brief varargs-aware *printf-like output through a callback with tagged arguments.
 *
 * This is essentially vsprintf() except the output is generated
 * character-by-character using the provided @p out function.  This allows
 * formatting text of unbounded length without incurring the cost of a
 * temporary buffer.
 *
 * Note that the argument list @p ap are tagged.
 *
 * @note This function is available only when
 * @kconfig{CONFIG_CBPRINTF_LIBC_SUBSTS} is selected.
 *
 * @note The functionality of this function is significantly reduced when
 * @kconfig{CONFIG_CBPRINTF_NANO} is selected.
 *
 * @param out the function used to emit each generated character.
 *
 * @param ctx context provided when invoking out
 *
 * @param format a standard ISO C format string with characters and conversion
 * specifications.
 *
 * @param ap a reference to the values to be converted.
 *
 * @return the number of characters generated, or a negative error value
 * returned from invoking @p out.
 */
static inline
int cbvprintf_tagged_args(cbprintf_cb out, void *ctx,
			  const char *format, va_list ap)
{
	return z_cbvprintf_impl(out, ctx, format, ap,
				Z_CBVPRINTF_PROCESS_FLAG_TAGGED_ARGS);
}

/** @brief Generate the output for a previously captured format
 * operation.
 *
 * @param out the function used to emit each generated character.
 *
 * @param ctx context provided when invoking out
 *
 * @param packaged the data required to generate the formatted output, as
 * captured by cbprintf_package() or cbvprintf_package(). The alignment
 * requirement on this data is the same as when it was initially created.
 *
 * @note Memory indicated by @p packaged will be modified in a non-destructive
 * way, meaning that it could still be reused with this function again.
 *
 * @return the number of characters printed, or a negative error value
 * returned from invoking @p out.
 */
static inline
int cbpprintf(cbprintf_cb out, void *ctx, void *packaged)
{
#if defined(CONFIG_CBPRINTF_PACKAGE_SUPPORT_TAGGED_ARGUMENTS)
	union cbprintf_package_hdr *hdr =
		(union cbprintf_package_hdr *)packaged;

	if ((hdr->desc.pkg_flags & CBPRINTF_PACKAGE_ARGS_ARE_TAGGED)
	    == CBPRINTF_PACKAGE_ARGS_ARE_TAGGED) {
		return cbpprintf_external(out, cbvprintf_tagged_args,
					  ctx, packaged);
	}
#endif

	return cbpprintf_external(out, cbvprintf, ctx, packaged);
}

#ifdef CONFIG_CBPRINTF_LIBC_SUBSTS

#ifdef CONFIG_PICOLIBC

#define fprintfcb(stream, ...) fprintf(stream, __VA_ARGS__)
#define vfprintfcb(stream, format, ap) vfprintf(stream, format, ap)
#define printfcb(format, ...) printf(format, __VA_ARGS__)
#define vprintfcb(format, ap) vprintf(format, ap)
#define snprintfcb(str, size, ...) snprintf(str, size, __VA_ARGS__)
#define vsnprintfcb(str, size, format, ap) vsnprintf(str, size, format, ap)

#else

/** @brief fprintf using Zephyrs cbprintf infrastructure.
 *
 * @note This function is available only when
 * @kconfig{CONFIG_CBPRINTF_LIBC_SUBSTS} is selected.
 *
 * @note The functionality of this function is significantly reduced
 * when @kconfig{CONFIG_CBPRINTF_NANO} is selected.
 *
 * @param stream the stream to which the output should be written.
 *
 * @param format a standard ISO C format string with characters and
 * conversion specifications.
 *
 * @param ... arguments corresponding to the conversion specifications found
 * within @p format.
 *
 * return The number of characters printed.
 */
__printf_like(2, 3)
int fprintfcb(FILE * stream, const char *format, ...);

/** @brief vfprintf using Zephyrs cbprintf infrastructure.
 *
 * @note This function is available only when
 * @kconfig{CONFIG_CBPRINTF_LIBC_SUBSTS} is selected.
 *
 * @note The functionality of this function is significantly reduced when
 * @kconfig{CONFIG_CBPRINTF_NANO} is selected.
 *
 * @param stream the stream to which the output should be written.
 *
 * @param format a standard ISO C format string with characters and conversion
 * specifications.
 *
 * @param ap a reference to the values to be converted.
 *
 * @return The number of characters printed.
 */
int vfprintfcb(FILE *stream, const char *format, va_list ap);

/** @brief printf using Zephyrs cbprintf infrastructure.
 *
 * @note This function is available only when
 * @kconfig{CONFIG_CBPRINTF_LIBC_SUBSTS} is selected.
 *
 * @note The functionality of this function is significantly reduced
 * when @kconfig{CONFIG_CBPRINTF_NANO} is selected.
 *
 * @param format a standard ISO C format string with characters and
 * conversion specifications.
 *
 * @param ... arguments corresponding to the conversion specifications found
 * within @p format.
 *
 * @return The number of characters printed.
 */
__printf_like(1, 2)
int printfcb(const char *format, ...);

/** @brief vprintf using Zephyrs cbprintf infrastructure.
 *
 * @note This function is available only when
 * @kconfig{CONFIG_CBPRINTF_LIBC_SUBSTS} is selected.
 *
 * @note The functionality of this function is significantly reduced when
 * @kconfig{CONFIG_CBPRINTF_NANO} is selected.
 *
 * @param format a standard ISO C format string with characters and conversion
 * specifications.
 *
 * @param ap a reference to the values to be converted.
 *
 * @return The number of characters printed.
 */
int vprintfcb(const char *format, va_list ap);

/** @brief snprintf using Zephyrs cbprintf infrastructure.
 *
 * @note This function is available only when
 * @kconfig{CONFIG_CBPRINTF_LIBC_SUBSTS} is selected.
 *
 * @note The functionality of this function is significantly reduced
 * when @kconfig{CONFIG_CBPRINTF_NANO} is selected.
 *
 * @param str where the formatted content should be written
 *
 * @param size maximum number of chaacters for the formatted output,
 * including the terminating null byte.
 *
 * @param format a standard ISO C format string with characters and
 * conversion specifications.
 *
 * @param ... arguments corresponding to the conversion specifications found
 * within @p format.
 *
 * @return The number of characters that would have been written to @p
 * str, excluding the terminating null byte.  This is greater than the
 * number actually written if @p size is too small.
 */
__printf_like(3, 4)
int snprintfcb(char *str, size_t size, const char *format, ...);

/** @brief vsnprintf using Zephyrs cbprintf infrastructure.
 *
 * @note This function is available only when
 * @kconfig{CONFIG_CBPRINTF_LIBC_SUBSTS} is selected.
 *
 * @note The functionality of this function is significantly reduced when
 * @kconfig{CONFIG_CBPRINTF_NANO} is selected.
 *
 * @param str where the formatted content should be written
 *
 * @param size maximum number of chaacters for the formatted output, including
 * the terminating null byte.
 *
 * @param format a standard ISO C format string with characters and conversion
 * specifications.
 *
 * @param ap a reference to the values to be converted.
 *
 * @return The number of characters that would have been written to @p
 * str, excluding the terminating null byte.  This is greater than the
 * number actually written if @p size is too small.
 */
int vsnprintfcb(char *str, size_t size, const char *format, va_list ap);

#endif /* CONFIG_PICOLIBC */
#endif /* CONFIG_CBPRINTF_LIBC_SUBSTS */

/**
 * @}
 */

#ifdef __cplusplus
}
#endif

#endif /* ZEPHYR_INCLUDE_SYS_CBPRINTF_H_ */


text:
import {createElementWithAttributes, escapeHtml} from '#core/dom';
import {dict} from '#core/types/object';

import {getFieSafeScriptSrcs} from '../../../src/friendly-iframe-embed';

// If making changes also change ALLOWED_FONT_REGEX in head-validation.js
/** @const {string} */
const fontProviderAllowList = [
  'https://cdn.materialdesignicons.com',
  'https://cloud.typography.com',
  'https://fast.fonts.net',
  'https://fonts.googleapis.com',
  'https://maxcdn.bootstrapcdn.com',
  'https://p.typekit.net',
  'https://pro.fontawesome.com',
  'https://use.fontawesome.com',
  'https://use.typekit.net',
].join(' ');

/** @const {string} */
const sandboxVals =
  'allow-forms ' +
  'allow-popups ' +
  'allow-popups-to-escape-sandbox ' +
  'allow-same-origin ' +
  'allow-scripts ' +
  'allow-top-navigation';

const TOKEN_VALUE_1P =
  'AzKSXqpxJ3GJ4xUcmPM97hZVJG1MQdsBvJDfIuF7mkjVveoiTyt11U3+HIw4U2VdqQ3CNKMUoohEGtHUnS3h8wAAAACBeyJvcmlnaW4iOiJodHRwczovL2FtcHByb2plY3Qub3JnOjQ0MyIsImZlYXR1cmUiOiJDb252ZXJzaW9uTWVhc3VyZW1lbnQiLCJleHBpcnkiOjE2MzQwODMxOTksImlzU3ViZG9tYWluIjp0cnVlLCJ1c2FnZSI6InN1YnNldCJ9';

/**
 * Create the starting html for all FIE ads. If streaming is supported body will be
 * piped in later.
 * @param {string} url
 * @param {string} sanitizedHeadElements
 * @param {string} body
 * @return {string}
 */
export const createSecureDocSkeleton = (url, sanitizedHeadElements, body) =>
  `<!DOCTYPE html>
  <html ⚡4ads lang="en">
  <head>
    <base href="${escapeHtml(url)}">
    <meta charset="UTF-8">
    <meta http-equiv=Content-Security-Policy content="
      img-src * data:;
      media-src *;
      font-src *;
      connect-src *;
      script-src ${getFieSafeScriptSrcs()};
      object-src 'none';
      child-src 'none';
      default-src 'none';
      style-src ${fontProviderAllowList} 'unsafe-inline';
    ">
    <meta http-equiv="origin-trial" content=${TOKEN_VALUE_1P}>
    ${sanitizedHeadElements}
  </head>
  <body>${body}</body>
  </html>`;

/**
 * Create iframe with predefined CSP and sandbox attributes for security.
 * @param {!Window} win
 * @param {string} title
 * @param {string} height
 * @param {string} width
 * @return {!HTMLIFrameElement}
 */
export function createSecureFrame(win, title, height, width) {
  const {document} = win;
  const iframe = /** @type {!HTMLIFrameElement} */ (
    createElementWithAttributes(
      document,
      'iframe',
      dict({
        // NOTE: It is possible for either width or height to be 'auto',
        // a non-numeric value.
        'height': height,
        'width': width,
        'title': title,
        'frameborder': '0',
        'allowfullscreen': '',
        'allowtransparency': '',
        'scrolling': 'no',
        'sandbox': sandboxVals,
        'role': 'region',
        'aria-label': 'Advertisement',
        'tabindex': '0',
      })
    )
  );

  if (isAttributionReportingSupported(document)) {
    iframe.setAttribute('allow', `attribution-reporting 'src'`);
  }

  return iframe;
}

/**
 * Determine if `attribution-reporting` API is available in browser.
 * @param {!Document} doc
 * @return {boolean}
 */
export function isAttributionReportingSupported(doc) {
  return doc.featurePolicy?.features().includes('attribution-reporting');
}


text:
module RbDbg
	module Debugger
		module OSX
		end
	end
end

require 'rbdbg/debugger/osx/mach'
require 'rbdbg/debugger/osx/ptrace'
require 'rbdbg/debugger/osx/threadstate64'
require 'rbdbg/debugger/osx/proc'
require 'rbdbg/debugger/osx/externproc'
require 'rbdbg/debugger/osx/sysctl'
require 'rbdbg/debugger/osx/machine'

require 'rbdbg/debugger/osx/osx_debugger'


text:
/* jshint undef: true, unused: true */
/* global describe, it */
'use strict';

var Azurin = require('../index');

/* jshint newcap: false */
var azurin = Azurin(process.env.AZURE_CERTIFICATE);
/* jshint newcap: true */

var assert = require('assert');

var blob = {
  container: process.env.AZURIN_TEST_STORAGE_CONTAINER,
  name: process.env.AZURIN_TEST_BLOBACCOUNT
};

describe('#lastImportInBlobStorage()', function(){

  this.timeout(10000);

  it('should return the last blob in container', function(done){
    azurin.blobAccountKey(blob.name, function (error, key) {
      azurin.lastImportInBlobStorage (blob.name, key, blob.container,
        function (error, last) {
          assert(last);
          done();
        });
    });
  });
});


text:
:- module(pronounTestSuite,[discourse/2]).

/*========================================================================
    Example Discourses
========================================================================*/

discourse([every,man,likes,himself],1).

discourse([no,man,likes,himself],1).

discourse([no,man,likes,herself],0).

discourse([if,a,man,walks,then,he,smokes],1).

discourse([if,a,man,walks,then,she,smokes],0).

discourse([a,man,walks,he,smokes],1).

discourse([mia,dances,she,likes,vincent],1).

discourse([mia,dances,she,does,not,like,vincent],1).

discourse([mia,walks,she,smokes],1).

discourse([mia,knows,jody,she,smokes],2).


text:
package com.intellij.java.refactoring;

import com.intellij.JavaTestUtil;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiExpression;
import com.intellij.psi.PsiType;
import com.intellij.refactoring.introduceField.BaseExpressionToFieldHandler;
import com.intellij.refactoring.util.CommonRefactoringUtil;
import com.intellij.testFramework.LightCodeInsightTestCase;
import org.jetbrains.annotations.NotNull;

import java.util.List;

/**
 * @author ven
 */
public class IntroduceFieldInSameClassTest extends LightCodeInsightTestCase {
  @NotNull
  @Override
  protected String getTestDataPath() {
    return JavaTestUtil.getJavaTestDataPath();
  }

  public void testInClassInitializer() {
    configureByFile("/refactoring/introduceField/before1.java");
    performRefactoring(BaseExpressionToFieldHandler.InitializationPlace.IN_FIELD_DECLARATION, true);
    checkResultByFile("/refactoring/introduceField/after1.java");
  }

  public void testConflictingFieldInContainingClass() {
    configureByFile("/refactoring/introduceField/beforeConflictingFieldInContainingClass.java");
    new MockIntroduceFieldHandler(BaseExpressionToFieldHandler.InitializationPlace.IN_FIELD_DECLARATION, false) {
      @Override
      protected String getNewName(Project project, PsiExpression expr, PsiType type) {
        return "aField";
      }
    }.invoke(getProject(), myEditor, myFile, null);
    checkResultByFile("/refactoring/introduceField/afterConflictingFieldInContainingClass.java");
  }

  public void testConflictingFieldInContainingClassLocal() {
    configureByFile("/refactoring/introduceField/beforeConflictingFieldInContainingClassLocal.java");
    new MockIntroduceFieldHandler(BaseExpressionToFieldHandler.InitializationPlace.IN_FIELD_DECLARATION, false) {
      @Override
      protected String getNewName(Project project, PsiExpression expr, PsiType type) {
        return "aField";
      }

      @Override
      protected int getChosenClassIndex(List<PsiClass> classes) {
        return 0;
      }
    }.invoke(getProject(), myEditor, myFile, null);
    checkResultByFile("/refactoring/introduceField/afterConflictingFieldInContainingClassLocal.java");
  }

  public void testInElseClause() {
    configureByFile("/refactoring/introduceField/beforeElseClause.java");
    performRefactoring(BaseExpressionToFieldHandler.InitializationPlace.IN_CURRENT_METHOD, true);
    checkResultByFile("/refactoring/introduceField/afterElseClause.java");
  }

  public void testOuterClass() {
    configureByFile("/refactoring/introduceField/beforeOuterClass.java");
    performRefactoring(BaseExpressionToFieldHandler.InitializationPlace.IN_CONSTRUCTOR, false);
    checkResultByFile("/refactoring/introduceField/afterOuterClass.java");
  }

  public void testOnClassLevelNoDuplicates() {
    configureByFile("/refactoring/introduceField/beforeOnClassLevelNoDuplicates.java");
    performRefactoring(BaseExpressionToFieldHandler.InitializationPlace.IN_FIELD_DECLARATION, false);
    checkResultByFile("/refactoring/introduceField/afterOnClassLevelNoDuplicates.java");
  }

  public void testOnClassLevelDuplicates() {
    configureByFile("/refactoring/introduceField/beforeOnClassLevelDuplicates.java");
    performRefactoring(BaseExpressionToFieldHandler.InitializationPlace.IN_FIELD_DECLARATION, false);
    checkResultByFile("/refactoring/introduceField/afterOnClassLevelDuplicates.java");
  }

  public void testOnClassLevelDuplicates1() {
    configureByFile("/refactoring/introduceField/beforeOnClassLevelDuplicates1.java");
    performRefactoring(BaseExpressionToFieldHandler.InitializationPlace.IN_FIELD_DECLARATION, false);
    checkResultByFile("/refactoring/introduceField/afterOnClassLevelDuplicates1.java");
  }

  public void testOnClassLevelBinary() {
    configureByFile("/refactoring/introduceField/beforeOnClassLevelBinary.java");
    performRefactoring(BaseExpressionToFieldHandler.InitializationPlace.IN_FIELD_DECLARATION, false);
    checkResultByFile("/refactoring/introduceField/afterOnClassLevelBinary.java");
  }

  //multiple error elements on class level corresponding to the extracted fragment ------------------
  public void testOnClassLevelNewExpression() {
    configureByFile("/refactoring/introduceField/beforeOnClassLevelNewExpression.java");
    performRefactoring(BaseExpressionToFieldHandler.InitializationPlace.IN_FIELD_DECLARATION, false);
    checkResultByFile("/refactoring/introduceField/afterOnClassLevelNewExpression.java");
  }

  public void testOnClassLevelClassForName() {
    configureByFile("/refactoring/introduceField/beforeOnClassLevelClassForName.java");
    performRefactoring(BaseExpressionToFieldHandler.InitializationPlace.IN_FIELD_DECLARATION, false);
    checkResultByFile("/refactoring/introduceField/afterOnClassLevelClassForName.java");
  }
  //-------------------------------------------------------------------------------------------------

  public void testUnresolvedReferenceToLocalVar() {
    configureByFile("/refactoring/introduceField/beforeUnresolvedReferenceToLocalVar.java");
    performRefactoring(BaseExpressionToFieldHandler.InitializationPlace.IN_CURRENT_METHOD, false);
    checkResultByFile("/refactoring/introduceField/afterUnresolvedReferenceToLocalVar.java");
  }

  public void testForcedFieldType() {
    configureByFile("/refactoring/introduceField/beforeForcedFieldType.java");
    new MockIntroduceFieldHandler(BaseExpressionToFieldHandler.InitializationPlace.IN_CURRENT_METHOD, false) {
      @Override
      protected PsiType getFieldType(PsiType type) {
        return PsiType.INT;
      }
    }.invoke(getProject(), myEditor, myFile, null);
    checkResultByFile("/refactoring/introduceField/afterForcedFieldType.java");
  }

  public void testRejectIntroduceFieldFromExprInThisCall() {
    configureByFile("/refactoring/introduceField/beforeRejectIntroduceFieldFromExprInThisCall.java");
    try {
      performRefactoring(BaseExpressionToFieldHandler.InitializationPlace.IN_FIELD_DECLARATION, false);
      fail("Should not proceed");
    }
    catch (CommonRefactoringUtil.RefactoringErrorHintException e) {
      assertEquals("Cannot perform refactoring.\nInvalid expression context.", e.getMessage());
    }
  }

  public void testInConstructorEnclosingAnonymous() {
    configureByFile("/refactoring/introduceField/beforeEnclosingAnonymous.java");
    performRefactoring(BaseExpressionToFieldHandler.InitializationPlace.IN_CONSTRUCTOR, false);
    checkResultByFile("/refactoring/introduceField/afterEnclosingAnonymous.java");
  }

  public void testLocalVarAnnotations() {
    configureByFile("/refactoring/introduceField/beforeLocalVarAnnotations.java");
    performRefactoring(BaseExpressionToFieldHandler.InitializationPlace.IN_FIELD_DECLARATION, false);
    checkResultByFile("/refactoring/introduceField/afterLocalVarAnnotations.java");
  }

  public void testFromLambdaExpr() {
    configureByFile("/refactoring/introduceField/beforeFromLambdaExpr.java");
    performRefactoring(BaseExpressionToFieldHandler.InitializationPlace.IN_FIELD_DECLARATION, false);
    checkResultByFile("/refactoring/introduceField/afterFromLambdaExpr.java");
  }

  public void testSimplifyDiamond() throws Exception {
    configureByFile("/refactoring/introduceField/beforeSimplifiedDiamond.java");
    performRefactoring(BaseExpressionToFieldHandler.InitializationPlace.IN_FIELD_DECLARATION, false);
    checkResultByFile("/refactoring/introduceField/afterSimplifiedDiamond.java");
  }

  public void testStaticFieldInInnerClass() {
    configureByFile("/refactoring/introduceField/beforeStaticFieldInInnerClass.java");
    new MockIntroduceFieldHandler(BaseExpressionToFieldHandler.InitializationPlace.IN_CURRENT_METHOD, false) {
      @Override
      protected int getChosenClassIndex(List<PsiClass> classes) {
        return 0;
      }
    }.invoke(getProject(), myEditor, myFile, null);
    checkResultByFile("/refactoring/introduceField/afterStaticFieldInInnerClass.java");
  }

  private static void performRefactoring(BaseExpressionToFieldHandler.InitializationPlace initializationPlace, boolean declareStatic) {
    new MockIntroduceFieldHandler(initializationPlace, declareStatic).invoke(getProject(), myEditor, myFile, null);
  }
}


text:
Since we've been publishing on jcenter & mavenCentral, the core code has remained almost identical. Most version number bumps have been due to updating dependencies, adding new classes to the optional packages, and occasionally tidying up the naming or the API (the version numbers for all the packages are incremented at the same time so that they will always match - this means some version bumps have no effect for a particular package).

**kotlin** API android package
```
co.early.fore:fore-kt-android
```

**java** API android package
```
co.early.fore:fore-jv-android
```

The fore library is divided into optional packages which you can pull in independently if you want (though the fat package is so small, it doesn't really seem worth it IMO).

**kotlin** API
```
co.early.fore:fore-kt-core
co.early.fore:fore-kt-android-core
co.early.fore:fore-kt-android-adapters
co.early.fore:fore-kt-android-network
```

**java** API
```
co.early.fore:fore-jv-core
co.early.fore:fore-jv-android-core
co.early.fore:fore-jv-android-adapters
co.early.fore:fore-jv-android-network
```

To check what versions of what transitive dependencies each package pulls in, the definitive answer is found in the pom files hosted at [mavenCentral](https://repo1.maven.org/maven2/co/early/fore/). The other packages you will see in mavenCentral have been rolled in to the packages listed above and are no longer updated. The GPG fingerprint used to sign the maven packages is: 5B83EC7248CCAEED24076AF87D1CC9121D51BA24 and the GPG public cert is [here](https://erdo.github.io/android-fore/gpg-pub-cert.asc).

## fore 1.5.0
**fore 1.5.0** bumps the kotlin version to **1.5.31** and adds a CallProcessor class (marked as experimental) supporting Apollo3 3.0.0-alpha07. A new package called **fore-kt-android-compose:1.1.0-alpha05** adds an extension function to use with jetpack compose 1.1.0-alpha05 (also marked as experimental).

## fore 1.4.7
**fore 1.4.7** bumps the kotlin version to **1.5.10** so if you haven't updgrade your project to kotin 1.5.10 yet, you might encounter strange problems with obfuscation or other issues. If you do, drop down to **fore 1.4.6** or upgrade kotlin in your project.

## fore 1.4.1
**fore 1.4.1** to **fore 1.4.6** inclusive are built with **kotlin 1.4.30**

## OkHttp3
As **fore** now wraps **Retrofit2**, **Apollo** or **Ktor** calls with a single package, the network logs need to work out which version of OkHttp3 your app is running (Retrofit2 and Apollo use v3.x.x, Ktor uses 4.x.x and these versions of OkHttp3 have slightly different APIs). From **1.3.7** we do this with reflection, but feel free to exclude the kotlin-reflect package from your release builds as follows: `exclude("org.jetbrains.kotlin", "kotlin-reflect")`, you just won't see any network logs when using the InterceptorLogging class (which you probably have turned off for release builds anyway).

## Ktor Client Support
**1.3.6** adds support for **Ktor**, it wraps the calls using a CallProcessor in a similar way to how Retrofit2 and Apollo is handled.

## fore-lifecycle deprecation
**1.3.5** was the last version of the fore-lifecycle package that will be published on mavenCentral. The useful classes from this package were moved into fore-core a while ago and with the ObservableGoup interface, most of what fore-lifecycle did can be done yourself pretty easily anyway. 1.3.5 won't be going anywhere of course and you can still pull it in individually if you want it.

## jcenter removal
**1.3.4** is the last version that was published on jcenter, mavenCentral has most versions since **1.1.0** (if for some reason you need an older version, please open an issue and I might be able to sign one and put it on mavenCentral for you). **All new versions will be released to mavenCentral only**. All references to jcenter have been removed from the project so it will continue to build after jcenter has been closed.

## GraphQL Support
**1.3.1** adds support for **Apollo**, it wraps the calls using a CallProcessor in a similar way to how Retrofit2 is handled.

## kotlin 1.4
**1.2.1** bumps the kotlin version to 1.4 so if you haven't updgrade your project to kotin 1.4 yet, you might encounter strange problems with obfuscation, if so drop down to **fore 1.2.0** or upgrade kotlin in your project, see [this issue](https://github.com/erdo/android-fore/issues/72)

## defaults for WorkMode, Logger and SystemTimeWrapper

From **1.2.0** the kotlin APIs will set default values for these parameters if you don't specify them. See more [here](https://erdo.github.io/android-fore/04-more-fore.html#default-params).

## removing deprecated sync views

These were removed for **1.1.0** (1.0.6 is identical to 1.1.0 but still has those syncviews).

## AS4

**1.1.0** is also the last version to support AS3

## kotlin support

**1.0.6** introduced explicit kotlin support with the packages **fore-core-kt** and **fore-retrofit-kt** (they're based on coroutines and fore-retrofit-kt's CallProcessor has a more functional API that uses suspend functions).

As a convenience, **1.0.6** also introduces the packages **fore-jv** and **fore-kt**, these contain all the classes from fore (suitable for java or kotlin as appropriate) in one aar file so you only have to add one line of dependency in your build file. Some classes are removed, for instance fore-kt does not contain the java based CallProcessor, only the kotlin one.

## android studio 3.5+

It used to be convenient to put the .idea/modules.xml file into source control, but now it messes things up, so with commit a1766e17f80fdc1b43e4176cfc6d60094322c83d .idea/modules.xml is removed and the whole of the .idea folder is put in .gitignore.

There's no need to do anything when you pull the latest code, but if you want to be sure your project is all setup nicely you just have to: close Android Studio; delete the .idea directory (it's a hidden directory by the way); restart Android Studio.

## androidx support from 1.0.0 onwards

Versions from **1.0.0** support **androidx**, if you are not using androidx yet you can continue to use 0.11.1

There was one minor breaking change previous to 0.11.1 (sorry):

* SuccessCallBack -> SuccessCallback (case change)

## Pre the rename from ASAF to fore (<0.9.32)

These are more substantial, but are mainly related to renaming or shuffling packages around, there are no functionality changes.

* most of the packages have changed from **co.early.asaf** to **co.early.fore**
* the deprecated classes **SimpleChangeAwareAdapter** and **SimpleChangeAwareList** have finally been removed (you should use **ChangeAwareAdapter** and **ChangeAwareList** as appropriate)
* the deprecated **SyncTrigger** methods: **resetAfterCheckFails(), resetAfterCheckAlways(), setImmediatelyResetAfterCheck()** have now been removed. Use the construction parameter: **ResetRule** instead.
* the deprecated **SyncTrigger** method: **check(boolean swallowTriggerForFirstCheck)** has been made private. Use **check()** and **checkLazy()** instead (checkLazy() swallows the trigger on first check so it's equivalent to calling the old check(false))
* **SyncTrigger** has also been moved into **fore-core** and placed under the **ui** package
* **AsafTask** and **AsafTaskBuilder** have been renamed **Async** and **AsyncBuilder** accordingly


text:
"""
KDE Plot Bokeh
==============

_thumb: .2, .8
"""
import bokeh.plotting as bkp
import numpy as np

import arviz as az

data = az.load_arviz_data("centered_eight")

# Combine posterior draws for from xarray of (4,500) to ndarray (2000,)
y_hat = np.concatenate(data.posterior_predictive["obs"].values)

figure_kwargs = dict(height=500, width=500, output_backend="webgl")
ax = bkp.figure(**figure_kwargs)

ax = az.plot_kde(
    y_hat,
    label="Estimated Effect\n of SAT Prep",
    rug=True,
    plot_kwargs={"line_width": 2, "line_color": "black"},
    rug_kwargs={"line_color": "black"},
    backend="bokeh",
    ax=ax,
)


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Teichospora patellaris P. Karst.

### Remarks
null


text:
//
//   Copyright 2016  Cityzen Data
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
//

package io.warp10.script.functions;

import io.warp10.continuum.gts.UnsafeString;
import io.warp10.script.NamedWarpScriptFunction;
import io.warp10.script.WarpScriptStackFunction;
import io.warp10.script.WarpScriptException;
import io.warp10.script.WarpScriptStack;

import org.bouncycastle.util.encoders.Hex;

import com.google.common.base.Charsets;
import com.google.common.io.BaseEncoding;

/**
 * Decode a String in binary
 */
public class BINTO extends NamedWarpScriptFunction implements WarpScriptStackFunction {

  public BINTO(String name) {
    super(name);
  }

  @Override
  public Object apply(WarpScriptStack stack) throws WarpScriptException {
    Object o = stack.pop();

    if (!(o instanceof String)) {
      throw new WarpScriptException(getName() + " operates on a String.");
    }

    String bin = o.toString();

    if (bin.length() % 8 != 0) {
      bin = "00000000".substring(bin.length() % 8) + bin;
    }

    char[] chars = UnsafeString.getChars(bin);

    StringBuilder sb = new StringBuilder();

    byte curbyte = 0;

    byte[] bytes = new byte[bin.length() / 8];
    int byteidx = 0;

    for (int i = 0; i < bin.length(); i += 4) {

      curbyte <<= 4;

      String nibble = new String(chars, i, 4);

      if ("0000".equals(nibble)) {
        curbyte |= 0;
      } else if ("0001".equals(nibble)) {
        curbyte |= 0x1;
      } else if ("0010".equals(nibble)) {
        curbyte |= 0x2;
      } else if ("0011".equals(nibble)) {
        curbyte |= 0x3;
      } else if ("0100".equals(nibble)) {
        curbyte |= 0x4;
      } else if ("0101".equals(nibble)) {
        curbyte |= 0x5;
      } else if ("0110".equals(nibble)) {
        curbyte |= 0x6;
      } else if ("0111".equals(nibble)) {
        curbyte |= 0x7;
      } else if ("1000".equals(nibble)) {
        curbyte |= 0x8;
      } else if ("1001".equals(nibble)) {
        curbyte |= 0x9;
      } else if ("1010".equals(nibble)) {
        curbyte |= 0xA;
      } else if ("1011".equals(nibble)) {
        curbyte |= 0xB;
      } else if ("1100".equals(nibble)) {
        curbyte |= 0xC;
      } else if ("1101".equals(nibble)) {
        curbyte |= 0xD;
      } else if ("1110".equals(nibble)) {
        curbyte |= 0xE;
      } else if ("1111".equals(nibble)) {
        curbyte |= 0xF;
      }

      if (i > 0 && 4 == i % 8) {
        bytes[byteidx++] = curbyte;
        curbyte = 0;
      }
    }

    stack.push(bytes);

    return stack;
  }
}


text:
import m from 'mithril';
import projectSidebar from '../../src/c/project-sidebar';

describe('ProjectSidebar', () => {
    let generateContextByNewState;

    describe('view', () => {
        beforeAll(() => {
            generateContextByNewState = (newState = {}) => {
                spyOn(m, 'component').and.callThrough();
                let projectDetail = m.prop(_.extend({}, ProjectDetailsMockery()[0], newState)),
                    component = m.component(projectSidebar, {
                        project: projectDetail,
                        userDetails: m.prop([])
                    }),
                    ctrl = component.controller({
                        project: projectDetail,
                        userDetails: m.prop([])
                    }),
                    view = component.view(component.controller(), {
                        project: projectDetail,
                        userDetails: m.prop([])
                    });

                return {
                    output: mq(view),
                    ctrl: ctrl,
                    projectDetail: projectDetail
                };
            };
        });

        it('should render project stats', () => {
            let {
                output, projectDetail
            } = generateContextByNewState({
                state: 'successful'
            });

            expect(output.find('#project-sidebar.aside').length).toEqual(1);
            expect(output.find('.card-success').length).toEqual(1);
        });

        it('should render a all or nothing badge when is aon', () => {
            let {
                output, projectDetail
            } = generateContextByNewState({
                mode: 'aon'
            });

            expect(output.find('#aon').length).toEqual(1);
        });

        it('should render a flex badge when project mode is flexible', () => {
            let {
                output, projectDetail
            } = generateContextByNewState({
                mode: 'flex'
            });

            expect(output.find('#flex').length).toEqual(1);
        });

        describe('reminder', () => {
            it('should render reminder when project is open_for_contributions and user signed in and is in_reminder', () => {
                let {
                    output, projectDetail
                } = generateContextByNewState({
                    open_for_contributions: true,
                    user_signed_in: true,
                    in_reminder: true
                });

                expect(output.contains('Lembrete ativo')).toEqual(true);
                expect(output.find('#project-reminder').length).toEqual(1);
            });

            it('should render reminder when project is open_for_contributions and user signed in ant not in_reminder', () => {
                let {
                    output, projectDetail
                } = generateContextByNewState({
                    open_for_contributions: true,
                    user_signed_in: true,
                    in_reminder: false
                });

                expect(output.contains('Lembrar-me')).toEqual(true);
                expect(output.find('#project-reminder').length).toEqual(1);
            });

            it('should render reminder when project is open_for_contributions and user not signed in', () => {
                let {
                    output, projectDetail
                } = generateContextByNewState({
                    open_for_contributions: true,
                    user_signed_in: false
                });

                expect(output.find('#project-reminder').length).toEqual(1);
            });

            it('should not render reminder when project is not open_for_contributions and user signed in', () => {
                let {
                    output, projectDetail
                } = generateContextByNewState({
                    open_for_contributions: false,
                    user_signed_in: true
                });

                expect(output.find('#project-reminder').length).toEqual(0);
            });
        });
    });
});


text:
Prohibit default exports. Mostly an inverse of [`prefer-default-export`].

[`prefer-default-export`]: ./prefer-default-export.md

## Rule Details

The following patterns are considered warnings:

```javascript
// bad1.js

// There is a default export.
export const foo = 'foo';
const bar = 'bar';
export default 'bar';
```

```javascript
// bad2.js

// There is a default export.
const foo = 'foo';
export { foo as default }
```

The following patterns are not warnings:

```javascript
// good1.js

// There is only a single module export and it's a named export.
export const foo = 'foo';
```

```javascript
// good2.js

// There is more than one named export in the module.
export const foo = 'foo';
export const bar = 'bar';
```

```javascript
// good3.js

// There is more than one named export in the module
const foo = 'foo';
const bar = 'bar';
export { foo, bar }
```

```javascript
// export-star.js

// Any batch export will disable this rule. The remote module is not inspected.
export * from './other-module'
```

## When Not To Use It

If you don't care if default imports are used, or if you prefer default imports over named imports.


text:
// Copyright (c) 2016 Framefield. All rights reserved.
// Released under the MIT license. (see LICENSE.txt)

using System;
using System.Collections.Generic;
using System.Windows.Controls;
using AvalonDock;
using Framefield.Core;
using System.Windows;
using System.IO;
using System.Text;
using Framefield.Tooll.Components.Dialogs;
using Framefield.Core.Commands;

namespace Framefield.Tooll
{
    public partial class LibraryView : DocumentContent
    {
        public LibraryView()
        {
            InitializeComponent();
            Title = "Library";

            App.Current.Model.MetaOpManager.ChangedEvent += (o, a) => UpdateOperatorTree();
            UpdateOperatorTree();
        }

        public void UpdateOperatorTree()
        {
            var expandedItems = CollectExpandedItems("", XTreeView);
            XTreeView.Items.Clear();
            _typeTree.Clear();

            foreach (var metaOpEntry in App.Current.Model.MetaOpManager.MetaOperators)
            {
                if (metaOpEntry.Value == null)
                {
                    string messageBoxText = String.Format("Requested undefined MetaOperator {0}.\nDo you want to delete Config/Home.mop? You should also delete Temp/Cache before restarting.", metaOpEntry.Key);
                    var caption = "Inconsistent Operator";
                    var button = MessageBoxButton.YesNo;
                    var icon = MessageBoxImage.Warning;
                    var result = MessageBox.Show(messageBoxText, caption, button, icon);
                    if (result == MessageBoxResult.Yes)
                    {
                        File.Delete(@"Config/Home.mop");
                        //Directory.Delete(@".\Operators\Cache");
                    }

                    App.Current.Shutdown(110);
                    Environment.Exit(110);
                }

                _typeTree.SortInOperator(metaOpEntry.Value);
            }
            _operatorTypeButtons.Clear();
            PopulateTree(XTreeView, _typeTree, "", expandedItems);
        }

        HashSet<string> CollectExpandedItems(String prefix, ItemsControl item)
        {
            var expandedItems = new HashSet<string>();
            var treeViewItem = item as TreeViewItem;
            String fullname = prefix;
            if (treeViewItem != null)
            {
                fullname = prefix + (String)treeViewItem.Header;
                if (treeViewItem.IsExpanded)
                    expandedItems.Add(fullname);
            }

            foreach (var child in item.Items)
            {
                if (child is ItemsControl)
                {
                    foreach (var e in CollectExpandedItems(fullname, (ItemsControl)child))
                    {
                        expandedItems.Add(e);
                    }
                }
            }
            return expandedItems;
        }

        private ContextMenu CreateContextMenu()
        {
            var newContextMenu = new ContextMenu();

            var menuItem = new MenuItem()
            {
                Header = "Rename namespace",
            };
            menuItem.Click += RenameNamespaceHandler;
            newContextMenu.Items.Add(menuItem);
            return newContextMenu;
        }

        private void RenameNamespaceHandler(object sender, RoutedEventArgs e)
        {
            if (sender is MenuItem menuItem && menuItem.DataContext is OperatorTypeTree tree)
            {
                var names = new List<String>();
                foreach (var p in tree.Parents)
                {
                    names.Add(p.Name);
                }
                names.Add(tree.Name);

                var joinedNames = String.Join(".", names);

                var popup = new TextInputWindow();
                popup.XText.Text = "Rename operator namespace?";
                popup.XTextBox.Text = joinedNames;
                popup.XTextBox.SelectAll();
                popup.XTextBox.Focus();
                popup.ShowDialog();

                if (popup.DialogResult == false)
                    return;

                var newNameSpace = popup.XTextBox.Text;
                if (newNameSpace.EndsWith("."))
                {
                    MessageBox.Show("Namespace should have tailing '.' character.", "Sorry");
                    return;
                }

                if (newNameSpace.Contains(" "))
                {
                    MessageBox.Show("Namespace should not contain spaces.", "Sorry");
                    return;
                }

                var commands = new List<ICommand>();

                foreach (var opDefinition in App.Current.Model.MetaOpManager.MetaOperators.Values)
                {
                    if (!opDefinition.Namespace.StartsWith(joinedNames))
                        continue;

                    var newNamespace = opDefinition.Namespace.Replace(joinedNames, newNameSpace);
                    commands.Add(new RenameOperatorNamespaceCommand(opDefinition, newNamespace));
                }

                if (commands.Count > 0)
                {
                    Logger.Info("Updated namespace of {0} Operators", commands.Count);
                    var macroCommand = new MacroCommand("Rename namespace", commands);
                    App.Current.UndoRedoStack.AddAndExecute(macroCommand);
                    App.Current.MainWindow.XLibraryView.UpdateOperatorTree();
                }
                else
                {
                    Logger.Info("No matching operators found");
                }
            }
        }

        /**
         * Recursively create subtree and add OperatorTypeButtons
         */
        private void PopulateTree(ItemsControl item, OperatorTypeTree typeTree, String prefix, HashSet<string> expandedItems)
        {
            typeTree.Children.Sort(CompareOpsTypeTreeByName);

            foreach (var subtree in typeTree.Children)
            {
                var newSubTreeItem = new TreeViewItem()
                {
                    IsExpanded = expandedItems.Contains(prefix + subtree.Name),
                    Header = subtree.Name,
                    DataContext = subtree,
                };

                newSubTreeItem.ContextMenu = CreateContextMenu();
                item.Items.Add(newSubTreeItem);
                PopulateTree(newSubTreeItem, subtree, prefix + subtree.Name, expandedItems);
            }

            typeTree.Operators.Sort(CompareOpsByName);

            foreach (var op in typeTree.Operators)
            {
                var b = new OperatorTypeButton(op, false);
                _operatorTypeButtons.Add(b);
                item.Items.Add(b);
            }
        }

        void HighlightMatchingOperators(FunctionType opType)
        {
            foreach (var otb in _operatorTypeButtons)
            {
                otb.Opacity = IsMatchingOpType(opType, otb) ? 1.0 : 0.3;
            }
        }

        private static bool IsMatchingOpType(FunctionType opType, OperatorTypeButton otb)
        {
            return (otb.MetaOp.Inputs.Count > 0) &&
                   ((otb.MetaOp.Inputs[0].OpPart.Type == opType) ||
                    (otb.MetaOp.Inputs[0].OpPart.Type == FunctionType.Generic));
        }

        void HighlightNothing()
        {
            foreach (var otb in _operatorTypeButtons)
            {
                otb.Opacity = 1.0;
            }
        }

        public void UpdateViewToCurrentSelectionHandler(object sender, SelectionHandler.FirstSelectedChangedEventArgs e)
        {
            var opWidget = e.Element as OperatorWidget;
            if (opWidget != null)
            {
                if (opWidget.Operator.Outputs.Count > 0)
                {
                    HighlightMatchingOperators(opWidget.Operator.Outputs[0].Type);
                }
                return;
            }
            HighlightNothing();
        }

        private static int CompareOpsByName(MetaOperator lhs, MetaOperator rhs)
        {
            return lhs.Name.CompareTo(rhs.Name);
        }

        private static int CompareOpsTypeTreeByName(OperatorTypeTree lhs, OperatorTypeTree rhs)
        {
            return lhs.Name.CompareTo(rhs.Name);
        }

        private readonly OperatorTypeTree _typeTree = new OperatorTypeTree("root", new List<OperatorTypeTree>());
        private readonly List<OperatorTypeButton> _operatorTypeButtons = new List<OperatorTypeButton>();
    }
}


text:
tiendaApp
=========

Spring MVC + JSF + Primefaces + Bootstrap


text:
CREATE TABLE `bitmasked_bits` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `model` varchar(32) NOT NULL,
  `foreign_id` int(11) unsigned NOT NULL,
  `bits` bigint(20) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `polymorphic_idx` (`model`,`foreign_id`)
);


text:
<!DOCTYPE HTML>

<title>CSS 2.1 Test Suite: Test for wrapping around floats whose top is below the top of what must wrap around them</title>
<link rel="author" title="L. David Baron" href="http://dbaron.org/" />
<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
<link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" />
<meta name="assert" content="However, line boxes created next to the float are shortened to make room for the margin box of the float." />
<meta name="flags" content="" />


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
 ~Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 ~
 ~WSO2 Inc. licenses this file to you under the Apache License,
 ~Version 2.0 (the "License"); you may not use this file except
 ~in compliance with the License.
 ~You may obtain a copy of the License at
 ~
 ~http://www.apache.org/licenses/LICENSE-2.0
 ~
 ~Unless required by applicable law or agreed to in writing,
 ~software distributed under the License is distributed on an
 ~"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 ~KIND, either express or implied.  See the License for the
 ~specific language governing permissions and limitations
 ~under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <groupId>org.wso2</groupId>
        <artifactId>wso2</artifactId>
        <version>1</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <groupId>org.wso2.carbon.automation</groupId>
    <artifactId>test-automation-framework</artifactId>
    <version>4.4.2-SNAPSHOT</version>
    <packaging>pom</packaging>

    <name>WSO2 Carbon Automation - Parent core project</name>

    <modules>
        <module>test-automation-framework/org.wso2.carbon.automation.engine</module>
        <module>test-automation-framework/org.wso2.carbon.automation.extensions</module>
        <module>test-automation-framework/org.wso2.carbon.automation.test.utils</module>
        <module>test-automation-framework/org.wso2.carbon.automation.artifacts</module>
    </modules>

    <scm>
        <connection>scm:git:https://github.com/wso2/carbon-platform-integration.git</connection>
        <developerConnection>scm:git:https://github.com/wso2/carbon-platform-integration.git
        </developerConnection>
        <url>https://github.com/wso2/carbon-platform-integration.git</url>
        <tag>test-automation-framework-4.3.1</tag>
    </scm>

    <repositories>
        <repository>
            <id>saucelabs-repository</id>
            <url>https://repository-saucelabs.forge.cloudbees.com/release</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jvnet.maven.incrementalbuild</groupId>
                <artifactId>incremental-build-plugin</artifactId>
                <version>1.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>incremental-build</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.1</version>
                <inherited>true</inherited>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <failOnError>false</failOnError>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.1.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <attach>false</attach>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <arguments>-Dmaven.test.skip=true -Dmaven.javadoc.skip=true</arguments>
                    <preparationGoals>clean install</preparationGoals>
                    <autoVersionSubmodules>false</autoVersionSubmodules>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>${testng.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.axis2.wso2</groupId>
                <artifactId>axis2</artifactId>
                <version>${axis2.wso2.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>${commons.logging.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons.io.version}</version>
            </dependency>
            <dependency>
                <groupId>org.wso2.carbon.automation</groupId>
                <artifactId>org.wso2.carbon.automation.engine</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.wso2.carbon.automation</groupId>
                <artifactId>org.wso2.carbon.automation.extensions</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.ftpserver</groupId>
                <artifactId>ftpserver-core</artifactId>
                <version>${ftpserver.core.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-all</artifactId>
                <version>${activemq.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat.embed</groupId>
                <artifactId>tomcat-embed-core</artifactId>
                <version>${org.apache.tomcat}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat.embed</groupId>
                <artifactId>tomcat-embed-logging-juli</artifactId>
                <version>${org.apache.tomcat}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.ws.wso2</groupId>
                <artifactId>spring.framework</artifactId>
                <version>${spring.framework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-frontend-jaxrs</artifactId>
                <version>${cfx.fronted.jaxrs.version}</version>
            </dependency>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-java</artifactId>
                <version>${selenium.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.seleniumhq.selenium</groupId>
                        <artifactId>selenium-android-driver</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>net.sourceforge.htmlunit</groupId>
                <artifactId>htmlunit</artifactId>
                <version>2.15</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.httpcomponents</groupId>
                        <artifactId>httpclient</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.opera</groupId>
                <artifactId>operadriver</artifactId>
                <version>${operadriver.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.seleniumhq.selenium</groupId>
                        <artifactId>selenium-remote-driver</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>ApacheJMeter</artifactId>
                <version>${jmeter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>ApacheJMeter_core</artifactId>
                <version>${jmeter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>ApacheJMeter_components</artifactId>
                <version>${jmeter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>ApacheJMeter_functions</artifactId>
                <version>${jmeter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>ApacheJMeter_http</artifactId>
                <version>${jmeter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>ApacheJMeter_java</artifactId>
                <version>${jmeter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>ApacheJMeter_report</artifactId>
                <version>${jmeter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>ApacheJMeter_tcp</artifactId>
                <version>${jmeter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>ApacheJMeter_ftp</artifactId>
                <version>${jmeter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>ApacheJMeter_jdbc</artifactId>
                <version>${jmeter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>ApacheJMeter_jms</artifactId>
                <version>${jmeter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>ApacheJMeter_ldap</artifactId>
                <version>${jmeter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>ApacheJMeter_mail</artifactId>
                <version>${jmeter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>ApacheJMeter_junit</artifactId>
                <version>${jmeter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>ApacheJMeter_monitors</artifactId>
                <version>${jmeter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.jmeter</groupId>
                <artifactId>ApacheJMeter_config</artifactId>
                <version>${jmeter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.derby</groupId>
                <artifactId>derbynet</artifactId>
                <version>${derby.version}</version>
            </dependency>
            <dependency>
                <groupId>com.saucelabs.selenium</groupId>
                <artifactId>sauce-ondemand-driver</artifactId>
                <version>${saucelabs.version}</version>
            </dependency>
            <dependency>
                <groupId>com.saucelabs.selenium</groupId>
                <artifactId>selenium-client-factory</artifactId>
                <version>${saucelabs.version}</version>
            </dependency>
            <dependency>
                <groupId>net.lingala.zip4j</groupId>
                <artifactId>zip4j</artifactId>
                <version>${lingala.zip4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.ws.commons.axiom.wso2</groupId>
                <artifactId>axiom</artifactId>
                <version>${axiom.version}</version>
            </dependency>
            <dependency>
                <groupId>org.wso2.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${httpcomponents.wso2.version}</version>
            </dependency>
            <dependency>
                <groupId>com.icegreen</groupId>
                <artifactId>greenmail</artifactId>
                <version>${greenmail.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.sshd</groupId>
                <artifactId>sshd-core</artifactId>
                <version>${sshd.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jacoco</groupId>
                <artifactId>org.jacoco.core</artifactId>
                <version>${jacoco.core.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jacoco</groupId>
                <artifactId>org.jacoco.report</artifactId>
                <version>${jacoco.core.version}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-utils</artifactId>
                <version>${org.codehaus.plexus.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
                <version>${commons.collections.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.activemq</groupId>
                <artifactId>activemq-mqtt</artifactId>
                <version>${activemq.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <properties>
        <!-- wso2 dependencies -->
        <axiom.version>1.2.11.wso2v6</axiom.version>
        <spring.framework.version>3.2.9.wso2v1</spring.framework.version>
        <httpcomponents.wso2.version>4.3.1.wso2v1</httpcomponents.wso2.version>
        <axis2.wso2.version>1.6.1.wso2v12</axis2.wso2.version>

        <!-- Other dependencies -->
        <testng.version>6.1.1</testng.version>
        <jacoco.core.version>0.7.4.201502262128</jacoco.core.version>
        <org.codehaus.plexus.version>3.0.22</org.codehaus.plexus.version>
        <commons.collections.version>3.2.1</commons.collections.version>
        <lingala.zip4j.version>1.2.3</lingala.zip4j.version>
        <operadriver.version>0.8.1</operadriver.version>
        <selenium.version>2.43.0</selenium.version>
        <jmeter.version>2.6</jmeter.version>
        <ftpserver.core.version>1.0.6</ftpserver.core.version>
        <activemq.version>5.9.1</activemq.version>
        <org.apache.tomcat>7.0.34</org.apache.tomcat>
        <cfx.fronted.jaxrs.version>2.6.1</cfx.fronted.jaxrs.version>
        <derby.version>10.8.2.2</derby.version>
        <saucelabs.version>2.6</saucelabs.version>
        <commons.logging.version>1.1.1</commons.logging.version>
        <commons.io.version>2.2</commons.io.version>
        <commens.hhtpclient.version>3.1</commens.hhtpclient.version>
        <zip4j.version>1.2.3</zip4j.version>
        <greenmail.version>1.3.1b</greenmail.version>
        <project.scm.id>scm-server</project.scm.id>
        <sshd.version>0.13.0</sshd.version>
    </properties>
</project>