text:
namespace Microsoft.Azure.Management.Compute.Models
{
    using Microsoft.Rest;
    using Microsoft.Rest.Serialization;
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// Describes a VMSS VM Extension.
    /// </summary>
    [Rest.Serialization.JsonTransformation]
    public partial class VirtualMachineScaleSetVMExtension : SubResourceReadOnly
    {
        /// <summary>
        /// Initializes a new instance of the VirtualMachineScaleSetVMExtension
        /// class.
        /// </summary>
        public VirtualMachineScaleSetVMExtension()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the VirtualMachineScaleSetVMExtension
        /// class.
        /// </summary>
        /// <param name="id">Resource Id</param>
        /// <param name="name">The name of the extension.</param>
        /// <param name="type">Resource type</param>
        /// <param name="forceUpdateTag">How the extension handler should be
        /// forced to update even if the extension configuration has not
        /// changed.</param>
        /// <param name="publisher">The name of the extension handler
        /// publisher.</param>
        /// <param name="type1">Specifies the type of the extension; an example
        /// is "CustomScriptExtension".</param>
        /// <param name="typeHandlerVersion">Specifies the version of the
        /// script handler.</param>
        /// <param name="autoUpgradeMinorVersion">Indicates whether the
        /// extension should use a newer minor version if one is available at
        /// deployment time. Once deployed, however, the extension will not
        /// upgrade minor versions unless redeployed, even with this property
        /// set to true.</param>
        /// <param name="enableAutomaticUpgrade">Indicates whether the
        /// extension should be automatically upgraded by the platform if there
        /// is a newer version of the extension available.</param>
        /// <param name="settings">Json formatted public settings for the
        /// extension.</param>
        /// <param name="protectedSettings">The extension can contain either
        /// protectedSettings or protectedSettingsFromKeyVault or no protected
        /// settings at all.</param>
        /// <param name="provisioningState">The provisioning state, which only
        /// appears in the response.</param>
        /// <param name="instanceView">The virtual machine extension instance
        /// view.</param>
        /// <param name="suppressFailures">Indicates whether failures stemming
        /// from the extension will be suppressed (Operational failures such as
        /// not connecting to the VM will not be suppressed regardless of this
        /// value). The default is false.</param>
        /// <param name="protectedSettingsFromKeyVault">The extensions
        /// protected settings that are passed by reference, and consumed from
        /// key vault</param>
        public VirtualMachineScaleSetVMExtension(string id = default(string), string name = default(string), string type = default(string), string forceUpdateTag = default(string), string publisher = default(string), string type1 = default(string), string typeHandlerVersion = default(string), bool? autoUpgradeMinorVersion = default(bool?), bool? enableAutomaticUpgrade = default(bool?), object settings = default(object), object protectedSettings = default(object), string provisioningState = default(string), VirtualMachineExtensionInstanceView instanceView = default(VirtualMachineExtensionInstanceView), bool? suppressFailures = default(bool?), KeyVaultSecretReference protectedSettingsFromKeyVault = default(KeyVaultSecretReference))
            : base(id)
        {
            Name = name;
            Type = type;
            ForceUpdateTag = forceUpdateTag;
            Publisher = publisher;
            Type1 = type1;
            TypeHandlerVersion = typeHandlerVersion;
            AutoUpgradeMinorVersion = autoUpgradeMinorVersion;
            EnableAutomaticUpgrade = enableAutomaticUpgrade;
            Settings = settings;
            ProtectedSettings = protectedSettings;
            ProvisioningState = provisioningState;
            InstanceView = instanceView;
            SuppressFailures = suppressFailures;
            ProtectedSettingsFromKeyVault = protectedSettingsFromKeyVault;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets the name of the extension.
        /// </summary>
        [JsonProperty(PropertyName = "name")]
        public string Name { get; private set; }

        /// <summary>
        /// Gets resource type
        /// </summary>
        [JsonProperty(PropertyName = "type")]
        public string Type { get; private set; }

        /// <summary>
        /// Gets or sets how the extension handler should be forced to update
        /// even if the extension configuration has not changed.
        /// </summary>
        [JsonProperty(PropertyName = "properties.forceUpdateTag")]
        public string ForceUpdateTag { get; set; }

        /// <summary>
        /// Gets or sets the name of the extension handler publisher.
        /// </summary>
        [JsonProperty(PropertyName = "properties.publisher")]
        public string Publisher { get; set; }

        /// <summary>
        /// Gets or sets specifies the type of the extension; an example is
        /// "CustomScriptExtension".
        /// </summary>
        [JsonProperty(PropertyName = "properties.type")]
        public string Type1 { get; set; }

        /// <summary>
        /// Gets or sets specifies the version of the script handler.
        /// </summary>
        [JsonProperty(PropertyName = "properties.typeHandlerVersion")]
        public string TypeHandlerVersion { get; set; }

        /// <summary>
        /// Gets or sets indicates whether the extension should use a newer
        /// minor version if one is available at deployment time. Once
        /// deployed, however, the extension will not upgrade minor versions
        /// unless redeployed, even with this property set to true.
        /// </summary>
        [JsonProperty(PropertyName = "properties.autoUpgradeMinorVersion")]
        public bool? AutoUpgradeMinorVersion { get; set; }

        /// <summary>
        /// Gets or sets indicates whether the extension should be
        /// automatically upgraded by the platform if there is a newer version
        /// of the extension available.
        /// </summary>
        [JsonProperty(PropertyName = "properties.enableAutomaticUpgrade")]
        public bool? EnableAutomaticUpgrade { get; set; }

        /// <summary>
        /// Gets or sets json formatted public settings for the extension.
        /// </summary>
        [JsonProperty(PropertyName = "properties.settings")]
        public object Settings { get; set; }

        /// <summary>
        /// Gets or sets the extension can contain either protectedSettings or
        /// protectedSettingsFromKeyVault or no protected settings at all.
        /// </summary>
        [JsonProperty(PropertyName = "properties.protectedSettings")]
        public object ProtectedSettings { get; set; }

        /// <summary>
        /// Gets the provisioning state, which only appears in the response.
        /// </summary>
        [JsonProperty(PropertyName = "properties.provisioningState")]
        public string ProvisioningState { get; private set; }

        /// <summary>
        /// Gets or sets the virtual machine extension instance view.
        /// </summary>
        [JsonProperty(PropertyName = "properties.instanceView")]
        public VirtualMachineExtensionInstanceView InstanceView { get; set; }

        /// <summary>
        /// Gets or sets indicates whether failures stemming from the extension
        /// will be suppressed (Operational failures such as not connecting to
        /// the VM will not be suppressed regardless of this value). The
        /// default is false.
        /// </summary>
        [JsonProperty(PropertyName = "properties.suppressFailures")]
        public bool? SuppressFailures { get; set; }

        /// <summary>
        /// Gets or sets the extensions protected settings that are passed by
        /// reference, and consumed from key vault
        /// </summary>
        [JsonProperty(PropertyName = "properties.protectedSettingsFromKeyVault")]
        public KeyVaultSecretReference ProtectedSettingsFromKeyVault { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (ProtectedSettingsFromKeyVault != null)
            {
                ProtectedSettingsFromKeyVault.Validate();
            }
        }
    }
}


text:
package org.apache.geronimo.common.propertyeditor;

import java.util.ArrayList;
import java.util.Collection;

/**
 * Unit test for {@link CollectionEditor} class.
 *
 * @version $Rev$ $Date$
 */
public class CollectionEditorTest extends AbstractCollectionEditorTest {

    protected void setUp() {
        editor = PropertyEditors.findEditor(Collection.class);
        ordered = false;
    }

    public void testEditorClass() throws Exception {
        assertEquals(CollectionEditor.class, editor.getClass());
    }

    protected void checkType(Object output) {
        assertTrue(output instanceof Collection);
    }

    protected Collection createCollection() {
        return new ArrayList();
    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * Custom functions that act independently of the theme templates
 *
 * Eventually, some of the functionality here could be replaced by core features
 *
 * @package podium
 */


text:
package at.favre.app.morseme.morse.translators;

import android.media.AudioFormat;
import android.media.AudioManager;
import android.media.AudioTrack;
import android.util.Log;

import java.util.List;

import at.favre.app.morseme.morse.EMorsePart;

/**
 * Created by PatrickF on 26.04.2014.
 */
public class SineMorseTranslator extends ATranslator{

	private List<EMorsePart> sequenze;

	private final int sampleRate = 8000;
	private final double freqOfTone = 800; // hz
	private byte generatedSnd[];
	private AudioTrack audioTrack;

	public SineMorseTranslator(List<EMorsePart> sequenze, ITranslatorListener listener, long morseLengthMs, long pauseLengthMs) {
		super(sequenze, listener, morseLengthMs, pauseLengthMs);
	}

	@Override
	protected void startTranslator(long length) {
		genTone(length);
		playSound();
	}

	@Override
	protected void stopTranslator() {
		audioTrack.release();
	}

	void genTone(long durationMS){
		int numSamples = (int) durationMS  * sampleRate / 1000;
		double[] sample = new double[numSamples];
		generatedSnd = new byte[2 * numSamples];

		// fill out the array
		for (int i = 0; i < numSamples; ++i) {
			sample[i] = Math.sin(2 * Math.PI * i / (sampleRate/freqOfTone));
		}

		// convert to 16 bit pcm sound array
		// assumes the sample buffer is normalised.
		int idx = 0;
		for (final double dVal : sample) {
			// scale to maximum amplitude
			final short val = (short) ((dVal * 32767));
			// in 16 bit wav PCM, first byte is the low order byte
			generatedSnd[idx++] = (byte) (val & 0x00ff);
			generatedSnd[idx++] = (byte) ((val & 0xff00) >>> 8);

		}
	}

	void playSound(){
		try {
			audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC,
					sampleRate, AudioFormat.CHANNEL_OUT_MONO,
					AudioFormat.ENCODING_PCM_16BIT, generatedSnd.length,
					AudioTrack.MODE_STATIC);
			audioTrack.write(generatedSnd, 0, generatedSnd.length);
			audioTrack.play();
		} catch (Exception e) {
			Log.w(TAG,"Error while plaing sound",e);
		}
	}

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<title></title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<form id="form1" action="#">

评论:

姓名: <input type="text" name="username" id="username" />

内容: <textarea name="content" id="content"  rows="2" cols="20"></textarea>

<input type="button" id="send" value="提交"/>

</form>

已有评论:


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

#nullable enable

using System;
using System.Globalization;
using Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.EmbeddedLanguages.VirtualChars;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Text;

namespace Microsoft.CodeAnalysis.Features.EmbeddedLanguages.DateAndTime
{
    internal partial class DateAndTimeEmbeddedCompletionProvider
    {
        private readonly struct EmbeddedCompletionContext
        {
            private static readonly DateTime s_exampleDateTime = DateTime.Parse("2009-06-15T13:45:30.1234567");
            private static readonly CultureInfo s_enUsCulture = CultureInfo.GetCultureInfo("en-US");

            private readonly ArrayBuilder<DateAndTimeItem> _items;
            private readonly TextSpan _replacementSpan;

            /// <summary>
            /// The portion of the user string token prior to the section we're replacing.  Used for building the
            /// example format to present.
            /// </summary>
            private readonly string _userFormatPrefix;

            /// <summary>
            /// The portion of the user string token after to the section we're replacing.  Used for building the
            /// example format to present.
            /// </summary>
            private readonly string _userFormatSuffix;

            public EmbeddedCompletionContext(
                SourceText text,
                CompletionContext context,
                VirtualCharSequence virtualChars,
                ArrayBuilder<DateAndTimeItem> items)
            {
                _items = items;

                var startPosition = context.Position;
                while (char.IsLetter(text[startPosition - 1]))
                {
                    startPosition--;
                }

                _replacementSpan = TextSpan.FromBounds(startPosition, context.Position);

                (_userFormatPrefix, _userFormatSuffix) = GetUserFormatParts(virtualChars, startPosition, context.Position);
            }

            private static (string prefix, string suffix) GetUserFormatParts(
                VirtualCharSequence virtualChars, int startPosition, int endPosition)
            {
                virtualChars = virtualChars.IsDefault ? VirtualCharSequence.Empty : virtualChars;

                using var _1 = PooledStringBuilder.GetInstance(out var prefix);
                using var _2 = PooledStringBuilder.GetInstance(out var suffix);
                foreach (var ch in virtualChars)
                {
                    if (ch.Span.End <= startPosition)
                        ch.AppendTo(prefix);
                    else if (ch.Span.Start >= endPosition)
                        ch.AppendTo(suffix);
                }

                return (prefix.ToString(), suffix.ToString());
            }

            private void AddExamples(ArrayBuilder<string> examples, bool standard, string displayText)
            {
                var userFormat = _userFormatPrefix + displayText + _userFormatSuffix;

                var primaryCulture = CultureInfo.CurrentCulture;
                var secondaryCulture = s_enUsCulture;
                var hideCulture = primaryCulture.Equals(secondaryCulture);

                AddExample(examples, standard, userFormat, primaryCulture, hideCulture);
                AddExample(examples, standard, userFormat, secondaryCulture, hideCulture);
                AddExample(examples, standard, displayText, primaryCulture, hideCulture);
                AddExample(examples, standard, displayText, secondaryCulture, hideCulture);
            }

            private static void AddExample(
                ArrayBuilder<string> examples, bool standard, string displayText, CultureInfo culture, bool hideCulture)
            {
                // Single letter custom strings need a %, or else they're interpreted as a format
                // standard format string (and will throw a format exception).
                var formatString = !standard && displayText.Length == 1
                    ? "%" + displayText
                    : displayText;

                if (formatString == "")
                    return;

                // Format string may be invalid.  Just don't show anything in that case.
                string formattedDate;
                try
                {
                    formattedDate = s_exampleDateTime.ToString(formatString);
                }
                catch (FormatException)
                {
                    return;
                }
                catch (ArgumentOutOfRangeException)
                {
                    return;
                }

                var example = hideCulture
                    ? $"   {displayText} → {formattedDate}"
                    : $"   {displayText} ({culture}) → {formattedDate}";
                if (!examples.Contains(example))
                    examples.Add(example);
            }

            public void AddStandard(string displayText, string suffix, string description, bool isDefault = false)
                => Add(displayText, suffix, description, standard: true, isDefault);

            public void AddCustom(string displayText, string suffix, string description)
                => Add(displayText, suffix, description, standard: false, isDefault: false);

            private void Add(string displayText, string suffix, string description, bool standard, bool isDefault)
            {
                using var _1 = PooledStringBuilder.GetInstance(out var descriptionBuilder);
                using var _2 = ArrayBuilder<string>.GetInstance(out var examples);

                AddExamples(examples, standard, displayText);

                descriptionBuilder.AppendLine(
                    examples.Count == 1 ? FeaturesResources.Example : FeaturesResources.Examples);
                foreach (var example in examples)
                    descriptionBuilder.AppendLine(example);

                descriptionBuilder.AppendLine();
                descriptionBuilder.Append(description);

                _items.Add(new DateAndTimeItem(
                    displayText, suffix, descriptionBuilder.ToString(),
                    CompletionChange.Create(
                        new TextChange(_replacementSpan, displayText)),
                    isDefault));
            }
        }
    }
}


text:
========================
Nova System Architecture
========================

Nova comprises multiple server processes, each performing different
functions. The user-facing interface is a REST API, while internally Nova
components communicate via an RPC message passing mechanism.

The API servers process REST requests, which typically involve database
reads/writes, optionally sending RPC messages to other Nova services,
and generating responses to the REST calls.
RPC messaging is done via the **oslo.messaging** library,
an abstraction on top of message queues.
Nova uses a messaging-based, "shared nothing" architecture and most of the
major nova components can be run on multiple servers, and have a manager that
is listening for RPC messages.
The one major exception is the compute service, where a single process runs on the
hypervisor it is managing (except when using the VMware or Ironic drivers).
The manager also, optionally, has periodic tasks.
For more details on our RPC system, refer to :doc:`/reference/rpc`.

Nova uses traditional SQL databases to store information.
These are (logically) shared between multiple components.
To aid upgrade, the database is accessed through an object layer that ensures
an upgraded control plane can still communicate with a compute nodes running
the previous release.
To make this possible, services running on the compute node proxy database
requests over RPC to a central manager called the conductor.

To horizontally expand Nova deployments, we have a deployment sharding
concept called :term:`cells <cell>`.
All deployments contain at least one cell.
For more information, refer to :doc:`/admin/cells`.

Components
----------

Below you will find a helpful explanation of the key components
of a typical Nova deployment.

.. image:: /_static/images/architecture.svg
   :width: 100%

* **DB**: SQL database for data storage.

* **API**: Component that receives HTTP requests, converts commands and
  communicates with other components via the **oslo.messaging** queue or HTTP.

* **Scheduler**: Decides which host gets each instance.

* **Compute**: Manages communication with hypervisor and virtual machines.

* **Conductor**: Handles requests that need coordination (build/resize), acts
  as a database proxy, or handles object conversions.

* **:placement-doc:`Placement <>`**: Tracks resource provider inventories and
  usages.

While all services are designed to be horizontally scalable, you should have
significantly more computes than anything else.

Hypervisors
-----------

Nova controls hypervisors through an API server. Selecting the best
hypervisor to use can be difficult, and you must take budget, resource
constraints, supported features, and required technical specifications into
account. However, the majority of OpenStack development is done on systems
using KVM-based hypervisors. For a detailed list of features and
support across different hypervisors, see :doc:`/user/support-matrix`.

You can also orchestrate clouds using multiple hypervisors in different
availability zones. Nova supports the following hypervisors:

- :ironic-doc:`Baremetal <>`

- `Hyper-V
  <https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/hyper-v-technology-overview>`__

- `Kernel-based Virtual Machine (KVM)
  <https://www.linux-kvm.org/page/Main_Page>`__

- `Linux Containers (LXC) <https://linuxcontainers.org>`__

- `Quick Emulator (QEMU) <https://wiki.qemu.org/Manual>`__

- `Virtuozzo <https://www.virtuozzo.com/products/vz7.html>`__

- `VMware vSphere
  <https://www.vmware.com/support/vsphere-hypervisor.html>`__

- `zVM <https://www.ibm.com/it-infrastructure/z/zvm>`__

For more information about hypervisors, see
:doc:`/admin/configuration/hypervisors`
section in the Nova Configuration Reference.

Projects, users, and roles
--------------------------

To begin using Nova, you must create a user with the
:keystone-doc:`Identity service <>`.

The Nova system is designed to be used by different consumers in the form of
projects on a shared system, and role-based access assignments. Roles control
the actions that a user is allowed to perform.

Projects are isolated resource containers that form the principal
organizational structure within the Nova service. They typically consist of
networks, volumes, instances, images, keys, and users. A user can
specify the project by appending ``project_id`` to their access key.

For projects, you can use quota controls to limit the number of processor cores
and the amount of RAM that can be allocated. Other projects also allow quotas
on their own resources. For example, :neutron-doc:`neutron
</admin/ops-quotas.html>` allows you to manage the amount of networks that can
be created within a project.

Roles control the actions a user is allowed to perform. By default, most
actions do not require a particular role, but you can configure them by editing
the ``policy.yaml`` file for user roles. For example, a rule can be defined so
that a user must have the ``admin`` role in order to be able to allocate a
public IP address.

A project limits users' access to particular images. Each user is assigned a
user name and password. Keypairs granting access to an instance are enabled for
each user, but quotas are set, so that each project can control resource
consumption across available hardware resources.

.. note::

   Earlier versions of OpenStack used the term ``tenant`` instead of
   ``project``. Because of this legacy terminology, some command-line tools use
   ``--tenant_id`` where you would normally expect to enter a project ID.

Block storage
-------------

OpenStack provides two classes of block storage: storage that is provisioned by
Nova itself, and storage that is managed by the block storage service, Cinder.

.. rubric:: Nova-provisioned block storage

Nova provides the ability to create a root disk and an optional "ephemeral"
volume. The root disk will always be present unless the instance is a
:term:`Boot From Volume` instance.

The root disk is associated with an instance, and exists only for the life of
this very instance. Generally, it is used to store an instance's root file
system, persists across the guest operating system reboots, and is removed on
an instance deletion. The amount of the root ephemeral volume is defined by the
flavor of an instance.

In addition to the root volume, flavors can provide an additional
ephemeral block device. It is represented as a raw block device with no
partition table or file system. A cloud-aware operating system can discover,
format, and mount such a storage device. Nova defines the default file system
for different operating systems as ext4 for Linux distributions, VFAT for
non-Linux and non-Windows operating systems, and NTFS for Windows. However, it
is possible to configure other filesystem types.

.. note::

   For example, the ``cloud-init`` package included into an Ubuntu's stock
   cloud image, by default, formats this space as an ext4 file system and
   mounts it on ``/mnt``. This is a cloud-init feature, and is not an OpenStack
   mechanism. OpenStack only provisions the raw storage.

.. rubric:: Cinder-provisioned block storage

The OpenStack Block Storage service, Cinder, provides persistent volumes hat
are represented by a persistent virtualized block device independent of any
particular instance.

Persistent volumes can be accessed by a single instance or attached to multiple
instances. This type of configuration requires a traditional network file
system to allow multiple instances accessing the persistent volume. It also
requires a traditional network file system like NFS, CIFS, or a cluster file
system such as Ceph. These systems can be built within an OpenStack
cluster, or provisioned outside of it, but OpenStack software does not provide
these features.

You can configure a persistent volume as bootable and use it to provide a
persistent virtual instance similar to the traditional non-cloud-based
virtualization system. It is still possible for the resulting instance to keep
ephemeral storage, depending on the flavor selected. In this case, the root
file system can be on the persistent volume, and its state is maintained, even
if the instance is shut down. For more information about this type of
configuration, see :cinder-doc:`Introduction to the Block Storage service
<configuration/block-storage/block-storage-overview.html>`.

Building blocks
---------------

In OpenStack the base operating system is usually copied from an image stored
in the OpenStack Image service, glance. This is the most common case and
results in an ephemeral instance that starts from a known template state and
loses all accumulated states on virtual machine deletion. It is also possible
to put an operating system on a persistent volume in the OpenStack Block
Storage service. This gives a more traditional persistent system that
accumulates states which are preserved on the OpenStack Block Storage volume
across the deletion and re-creation of the virtual machine. To get a list of
available images on your system, run:

.. code-block:: console

   $ openstack image list
   +--------------------------------------+-----------------------------+--------+
   | ID                                   | Name                        | Status |
   +--------------------------------------+-----------------------------+--------+
   | aee1d242-730f-431f-88c1-87630c0f07ba | Ubuntu 14.04 cloudimg amd64 | active |
   | 0b27baa1-0ca6-49a7-b3f4-48388e440245 | Ubuntu 14.10 cloudimg amd64 | active |
   | df8d56fc-9cea-4dfd-a8d3-28764de3cb08 | jenkins                     | active |
   +--------------------------------------+-----------------------------+--------+

The displayed image attributes are:

``ID``
  Automatically generated UUID of the image

``Name``
  Free form, human-readable name for image

``Status``
  The status of the image. Images marked ``ACTIVE`` are available for use.

``Server``
  For images that are created as snapshots of running instances, this is the
  UUID of the instance the snapshot derives from. For uploaded images, this
  field is blank.

Virtual hardware templates are called ``flavors``. By default, these are
configurable by admin users, however, that behavior can be changed by redefining
the access controls ``policy.yaml`` on the ``nova-api`` server. For more
information, refer to :doc:`/configuration/policy`.

For a list of flavors that are available on your system:

.. code-block:: console

   $ openstack flavor list
   +-----+-----------+-------+------+-----------+-------+-----------+
   | ID  | Name      |   RAM | Disk | Ephemeral | VCPUs | Is_Public |
   +-----+-----------+-------+------+-----------+-------+-----------+
   | 1   | m1.tiny   |   512 |    1 |         0 |     1 | True      |
   | 2   | m1.small  |  2048 |   20 |         0 |     1 | True      |
   | 3   | m1.medium |  4096 |   40 |         0 |     2 | True      |
   | 4   | m1.large  |  8192 |   80 |         0 |     4 | True      |
   | 5   | m1.xlarge | 16384 |  160 |         0 |     8 | True      |
   +-----+-----------+-------+------+-----------+-------+-----------+

Nova service architecture
-------------------------

These basic categories describe the service architecture and information about
the cloud controller.

.. rubric:: API server

At the heart of the cloud framework is an API server, which makes command and
control of the hypervisor, storage, and networking programmatically available
to users.

The API endpoints are basic HTTP web services which handle authentication,
authorization, and basic command and control functions using various API
interfaces under the Amazon, Rackspace, and related models. This enables API
compatibility with multiple existing tool sets created for interaction with
offerings from other vendors. This broad compatibility prevents vendor lock-in.

.. rubric:: Message queue

A messaging queue brokers the interaction between compute nodes (processing),
the networking controllers (software which controls network infrastructure),
API endpoints, the scheduler (determines which physical hardware to allocate to
a virtual resource), and similar components. Communication to and from the
cloud controller is handled by HTTP requests through multiple API endpoints.

A typical message passing event begins with the API server receiving a request
from a user. The API server authenticates the user and ensures that they are
permitted to issue the subject command. The availability of objects implicated
in the request is evaluated and, if available, the request is routed to the
queuing engine for the relevant workers.  Workers continually listen to the
queue based on their role, and occasionally their type host name. When an
applicable work request arrives on the queue, the worker takes assignment of
the task and begins executing it. Upon completion, a response is dispatched to
the queue which is received by the API server and relayed to the originating
user.  Database entries are queried, added, or removed as necessary during the
process.

.. rubric:: Compute worker

Compute workers manage computing instances on host machines. The API dispatches
commands to compute workers to complete these tasks:

-  Run instances

-  Delete instances (Terminate instances)

-  Reboot instances

-  Attach volumes

-  Detach volumes

-  Get console output

.. rubric:: Network Controller

The Network Controller manages the networking resources on host machines. The
API server dispatches commands through the message queue, which are
subsequently processed by Network Controllers. Specific operations include:

-  Allocating fixed IP addresses

-  Configuring VLANs for projects

-  Configuring networks for compute nodes


text:
static const char* g_makefile;
static bool g_is_syntax_check_only;
static bool g_generate_ninja;
static const char* g_ninja_suffix;
static const char* g_ninja_dir;
static bool g_use_find_emulator;

static bool ParseCommandLineOptionWithArg(StringPiece option,
                                          char* argv[],
                                          int* index,
                                          const char** out_arg) {
  const char* arg = argv[*index];
  if (!HasPrefix(arg, option))
    return false;
  if (arg[option.size()] == '\0') {
    ++*index;
    *out_arg = argv[*index];
    return true;
  }
  if (arg[option.size()] == '=') {
    *out_arg = arg + option.size() + 1;
    return true;
  }
  // E.g, -j999
  if (option.size() == 2) {
    *out_arg = arg + option.size();
    return true;
  }
  return false;
}

static void ParseCommandLine(int argc, char* argv[],
                             vector<Symbol>* targets,
                             vector<StringPiece>* cl_vars) {
  // TODO: Decide the appropriate number based on the number of cores.
  g_num_jobs = 32;
  const char* num_jobs_str;

  for (int i = 1; i < argc; i++) {
    const char* arg = argv[i];
    if (!strcmp(arg, "-f")) {
      g_makefile = argv[++i];
    } else if (!strcmp(arg, "-c")) {
      g_is_syntax_check_only = true;
    } else if (!strcmp(arg, "-i")) {
      g_is_dry_run = true;
    } else if (!strcmp(arg, "--kati_stats")) {
      g_enable_stat_logs = true;
    } else if (!strcmp(arg, "--ninja")) {
      g_generate_ninja = true;
    } else if (!strcmp(arg, "--detect_android_echo")) {
      g_detect_android_echo = true;
    } else if (!strcmp(arg, "--error_on_env_change")) {
      g_error_on_env_change = true;
    } else if (ParseCommandLineOptionWithArg(
        "-j", argv, &i, &num_jobs_str)) {
      g_num_jobs = strtol(num_jobs_str, NULL, 10);
      if (g_num_jobs <= 0) {
        ERROR("Invalid -j flag: %s", num_jobs_str);
      }
    } else if (ParseCommandLineOptionWithArg(
        "--ninja_suffix", argv, &i, &g_ninja_suffix)) {
    } else if (ParseCommandLineOptionWithArg(
        "--ninja_dir", argv, &i, &g_ninja_dir)) {
    } else if (!strcmp(arg, "--use_find_emulator")) {
      g_use_find_emulator = true;
    } else if (!strcmp(arg, "--gen_regen_rule")) {
      // TODO: Make this default once we have removed unnecessary
      // command line change from Android build.
      g_gen_regen_rule = true;
    } else if (ParseCommandLineOptionWithArg(
        "--goma_dir", argv, &i, &g_goma_dir)) {
    } else if (ParseCommandLineOptionWithArg(
        "--ignore_optional_include",
        argv, &i, &g_ignore_optional_include_pattern)) {
    } else if (arg[0] == '-') {
      ERROR("Unknown flag: %s", arg);
    } else {
      if (strchr(arg, '=')) {
        cl_vars->push_back(arg);
      } else {
        targets->push_back(Intern(arg));
      }
    }
  }
}

static void Init() {
  InitSymtab();
  InitFuncTable();
  InitDepNodePool();
  InitParser();

  if (g_makefile == NULL) {
    if (Exists("GNUmakefile")) {
      g_makefile = "GNUmakefile";
#if !defined(__APPLE__)
    } else if (Exists("makefile")) {
      g_makefile = "makefile";
#endif
    } else if (Exists("Makefile")) {
      g_makefile = "Makefile";
    } else {
      ERROR("*** No targets specified and no makefile found.");
    }
  }
}

static void Quit() {
  ReportAllStats();

  QuitParser();
  QuitDepNodePool();
  QuitFuncTable();
  QuitSymtab();
}

static void ReadBootstrapMakefile(const vector<Symbol>& targets,
                                  vector<AST*>* asts) {
  string bootstrap = (
      "CC:=cc\n"
#if defined(__APPLE__)
      "CXX:=c++\n"
#else
      "CXX:=g++\n"
#endif
      "AR:=ar\n"
      "MAKE:=kati\n"
      // Pretend to be GNU make 3.81, for compatibility.
      "MAKE_VERSION:=3.81\n"
      "SHELL:=/bin/sh\n"
      // TODO: Add more builtin vars.

      // http://www.gnu.org/software/make/manual/make.html#Catalogue-of-Rules
      // The document above is actually not correct. See default.c:
      // http://git.savannah.gnu.org/cgit/make.git/tree/default.c?id=4.1
      ".c.o:\n"
      "\t$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $<\n"
      ".cc.o:\n"
      "\t$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $<\n"
      // TODO: Add more builtin rules.
                      );
  bootstrap += StringPrintf("MAKECMDGOALS:=%s\n",
                            JoinSymbols(targets, " ").c_str());

  char cwd[PATH_MAX];
  if (!getcwd(cwd, PATH_MAX)) {
    fprintf(stderr, "getcwd failed\n");
    CHECK(false);
  }
  bootstrap += StringPrintf("CURDIR:=%s\n", cwd);
  Parse(Intern(bootstrap).str(), Loc("*bootstrap*", 0), asts);
}

static void SetVar(StringPiece l, VarOrigin origin, Vars* vars) {
  size_t found = l.find('=');
  CHECK(found != string::npos);
  Symbol lhs = Intern(l.substr(0, found));
  StringPiece rhs = l.substr(found + 1);
  vars->Assign(lhs,
               new RecursiveVar(NewLiteral(rhs.data()), origin, rhs.data()));
}

extern "C" char** environ;
static void FillDefaultVars(const vector<StringPiece>& cl_vars, Vars* vars) {
  for (char** p = environ; *p; p++) {
    SetVar(*p, VarOrigin::ENVIRONMENT, vars);
  }
  for (StringPiece l : cl_vars) {
    SetVar(l, VarOrigin::COMMAND_LINE, vars);
  }
}

static int Run(const vector<Symbol>& targets,
               const vector<StringPiece>& cl_vars,
               const string& orig_args) {
  MakefileCacheManager* cache_mgr = NewMakefileCacheManager();

  Vars* vars = new Vars();
  FillDefaultVars(cl_vars, vars);
  Evaluator* ev = new Evaluator(vars);

  vector<AST*> bootstrap_asts;
  ReadBootstrapMakefile(targets, &bootstrap_asts);
  ev->set_is_bootstrap(true);
  for (AST* ast : bootstrap_asts) {
    LOG("%s", ast->DebugString().c_str());
    ast->Eval(ev);
  }
  ev->set_is_bootstrap(false);

  vars->Assign(Intern("MAKEFILE_LIST"),
               new SimpleVar(make_shared<string>(
                   StringPrintf(" %s", g_makefile)), VarOrigin::FILE));

  {
    ScopedTimeReporter tr("eval time");
    Makefile* mk = cache_mgr->ReadMakefile(g_makefile);
    for (AST* ast : mk->asts()) {
      LOG("%s", ast->DebugString().c_str());
      ast->Eval(ev);
    }
  }

  vector<DepNode*> nodes;
  {
    ScopedTimeReporter tr("make dep time");
    MakeDep(ev, ev->rules(), ev->rule_vars(), targets, &nodes);
  }

  for (const auto& p : ev->exports()) {
    const Symbol name = p.first;
    if (p.second) {
      Var* v = ev->LookupVar(name);
      shared_ptr<string> value = v->Eval(ev);
      LOG("setenv(%s, %s)", name.c_str(), value->c_str());
      setenv(name.c_str(), value->c_str(), 1);
    } else {
      LOG("unsetenv(%s)", name.c_str());
      unsetenv(name.c_str());
    }
  }

  if (g_is_syntax_check_only)
    return 0;

  if (g_generate_ninja) {
    ScopedTimeReporter tr("generate ninja time");
    GenerateNinja(g_ninja_suffix, g_ninja_dir, nodes, ev, !targets.empty(),
                  orig_args);
    return 0;
  }

  {
    ScopedTimeReporter tr("exec time");
    Exec(nodes, ev);
  }

  for (AST* ast : bootstrap_asts)
    delete ast;
  delete ev;
  delete vars;
  delete cache_mgr;

  return 0;
}

int main(int argc, char* argv[]) {
  Init();
  string orig_args;
  for (int i = 0; i < argc; i++) {
    if (i)
      orig_args += ' ';
    orig_args += argv[i];
  }
  vector<Symbol> targets;
  vector<StringPiece> cl_vars;
  ParseCommandLine(argc, argv, &targets, &cl_vars);
  // This depends on command line flags.
  if (g_use_find_emulator)
    InitFindEmulator();
  int r = Run(targets, cl_vars, orig_args);
  Quit();
  return r;
}


text:
<!--
 Licensed to the Hipparchus project under one or more
 contributor license agreements.  See the NOTICE file distributed with
 this work for additional information regarding copyright ownership.
 The Hipparchus project 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.
-->
# Filtering
## Overview
The filtering package provides classes useful for real-time process estimation:

  * linear Kalman filter for linear processes
  * extended Kalman filter for non-linear processes

![Kalman class diagram](images/userguide/kalman.png)

Kalman filters are devoted to real time estimates. They process measurements one by one
as they arrive and produce a new estimate of the process state based on each measurement.

Depending on the type of process (linear or non-linear), a different type of Kalman
filter should be used (see below), and different interfaces must be implemented
by users to model their process.

In both cases, users must implement the general [Measurement](../apidocs/org/hipparchus/filtering/kalman/Measurement.html)
interface, and their implementation will be used as the parameterized type T in the filter.

In both cases, once users have created a Kalman filter of the appropriate type, they will feed it with
measurements, getting back the process estimates, which correspond to the corrected values. If needed,
the filter also stores the predicted values (as Kalman filter relies on a prediction/correction algorithm),
so they can monitor precisely how the filter works.

In both cases, the user-implemented process can decide if a measurement should be completely ignored
(typically if it is invalid or is an outlier). In this case, the correction phase is a no-op and
the corrected process estimate will be the same as the predicted state estimate.

## Linear processes
Linear processes with command are governed by the evolution equation on state `\(x_k\)`:

`\[
  x_k = A_{k-1} x_{k-1} + B_{k-1} u_{k-1} + w_{k-1}
\]`

 where

  * `\(A_{k-1}\)` is the state transition matrix in the absence of control
  * `\(B_{k-1}\)` is the control matrix
  * `\(u_{k-1}\)` is the command
  * `\(w_{k-1}\)` is the process noise, which has covariance matrix `\(Q_{k-1}\)`

and by the measurement equation on measurement `\(z_k\)`:
`\[
  z_k = H_k x_k + r_k
\]`

where

  * `\(H_k\)` is the measurement matrix
  * `\(r_{k-1}\)` is the measurement noise, which has covariance matrix `\(R_k\)`

In order to estimate the state of a linear process, users must implement
the [LinearProcess](../apidocs/org/hipparchus/filtering/kalman/linear/LinearProcess.html) interface
and create a [LinearKalmanFilter](../apidocs/org/hipparchus/filtering/kalman/linear/LinearKalmanFilter.html)
instance.

If a measurement should be ignored, a null measurement Jacobian matrix should be put in the
[LinearEvolution](../apidocs/org/hipparchus/filtering/kalman/linear/LinearEvolution.html)
instance returned by the linear process.

## Non-linear processes
Non-linear processes with command are governed by the evolution equation on state `\(x_k\)`:

`\[
  x_k = f(x_{k-1}) + w_{k-1}
\]`

 where

  * `\(f\)` is an evolution function
  * `\(w_{k-1}\)` is the process noise, which has covariance matrix `\(Q_{k-1}\)`

and by the measurement equation on measurement `\(z_k\)`:
`\[
  z_k = m(x_k) + r_k
\]`

where

  * `\(m\)` is a measurement function
  * `\(r_{k-1}\)` is the measurement noise, which has covariance matrix `\(R_k\)`

In order to estimate the state of a non-linear process, users must implement
the [NonLinearProcess](../apidocs/org/hipparchus/filtering/kalman/extended/NonLinearProcess.html) interface
and create an [ExtendedKalmanFilter](../apidocs/org/hipparchus/filtering/kalman/extended/ExtendedKalmanFilter.html)
instance.

If a measurement should be ignored, either a null measurement Jacobian matrix should be put in the
[NonLinearEvolution](../apidocs/org/hipparchus/filtering/kalman/extended/NonLinearEvolution.html)
instance returned by the process, or a null innovation vector should be returned by the
process. The former way can be used if the decision about ignoring the measurement can be taken
early in the prediction phase, and the latter can be used when the decision needs to perform some
computations based on the innovation covariance matrix. This second case typically occurs when rejecting
outliers measurements is based on a ratio between the innovation (which is a residual) and the a posteriori
measurement covariance. This avoids having a bad measurement pulling the process state very far from
reality as the a priori measurement covariance included in the measurement itself can be very wrong.


text:
class Scene {

public:

    Scene();

    ~Scene();

    void render();

    void setCamera(Camera *c) { mCamera = c; }

private:

	Camera *mCamera = nullptr;

};

#endif // SCENE_H


text:
package org.macrulez.utils.raml2swagger;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.NoArgsConstructor;
import org.apache.commons.io.IOUtils;
import org.junit.Assert;
import org.junit.Test;

import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@NoArgsConstructor
public class RAMLtoSwaggerTest {
    private static final String PRODUCT_API_RAML = "/product-api.raml";
    private final RAMLtoSwagger raml2Swagger = new RAMLtoSwagger();
    private final ObjectMapper objectMapper = new ObjectMapper();

    @Test
    @SuppressWarnings("unchecked")
    public void convertToSwaggerValidJson() throws Exception {
        String raml = IOUtils.resourceToString("/product-api.raml", Charset.forName("UTF-8"));
        Assert.assertNotNull(raml);

        String swagger = raml2Swagger.convertToSwagger(raml);
        Assert.assertNotNull(swagger);

        TypeReference<HashMap<String, Object>> typeRef = new TypeReference<HashMap<String, Object>>() {};
        Map<String, Object> json = objectMapper.readValue(swagger, typeRef);
        Assert.assertNotNull(json);
    }

    @Test
    @SuppressWarnings("unchecked")
    public void convertToSwaggerFromString() throws Exception {
        String raml = IOUtils.resourceToString("/product-api.raml", Charset.forName("UTF-8"));
        Assert.assertNotNull(raml);

        String swagger = raml2Swagger.convertToSwagger(raml);
        Assert.assertNotNull(swagger);

        TypeReference<HashMap<String, Object>> typeRef = new TypeReference<HashMap<String, Object>>() {};
        Map<String, Object> json = objectMapper.readValue(swagger, typeRef);
        Assert.assertNotNull(json);

        /* A bunch of checks based on the test RAML, to prove recursive functions work correctly */
        Assert.assertEquals("Swagger version should be 2.0", json.get("swagger").toString(), "2.0");
        Assert.assertTrue("Info section should be a map", json.get("info") instanceof Map);
        Assert.assertEquals("Info section should have three keys", 3, ((Map<String, Object>)json.get("info")).size());
        Assert.assertTrue("Schemes section should be a list", json.get("schemes") instanceof List);
        Assert.assertEquals("Info section should have two values", 2, ((List<String>)json.get("schemes")).size());
        Assert.assertTrue("Paths section should be a map", json.get("paths") instanceof Map);
        Assert.assertEquals("Paths section should have 62 keys", 62, ((Map<String, Object>)json.get("paths")).size());
    }

    @Test
    @SuppressWarnings("unchecked")
    public void checkQueryParameters() throws Exception {
        String raml = IOUtils.resourceToString("/product-api.raml", Charset.forName("UTF-8"));
        Assert.assertNotNull(raml);

        String swagger = raml2Swagger.convertToSwagger(raml);
        Assert.assertNotNull(swagger);

        TypeReference<HashMap<String, Object>> typeRef = new TypeReference<HashMap<String, Object>>() {};
        Map<String, Object> json = objectMapper.readValue(swagger, typeRef);
        Assert.assertNotNull(json);

        Map<String, Object> paths = (Map<String, Object>)json.get("paths");
        Map<String, Object> path = (Map<String, Object>)paths.get("/{version}/cache/clear");
        Map<String, Object> method = (Map<String, Object>)path.get("get");
        List<Map<String, Object>> parameters = (List<Map<String, Object>>)method.get("parameters");
        Assert.assertEquals("There should be 4 parameters", 4, parameters.size());
        Assert.assertEquals("Parameter type should be 'query'", "query", parameters.get(0).get("in"));
    }

    @Test
    @SuppressWarnings("unchecked")
    public void checkPathParameters() throws Exception {
        String raml = IOUtils.resourceToString("/product-api.raml", Charset.forName("UTF-8"));
        Assert.assertNotNull(raml);

        String swagger = raml2Swagger.convertToSwagger(raml);
        Assert.assertNotNull(swagger);

        TypeReference<HashMap<String, Object>> typeRef = new TypeReference<HashMap<String, Object>>() {};
        Map<String, Object> json = objectMapper.readValue(swagger, typeRef);
        Assert.assertNotNull(json);

        Map<String, Object> paths = (Map<String, Object>)json.get("paths");
        Map<String, Object> path = (Map<String, Object>)paths.get("/{version}/used-families/{familyName}/{modelName}/{type}");
        Map<String, Object> method = (Map<String, Object>)path.get("get");
        List<Map<String, Object>> parameters = (List<Map<String, Object>>)method.get("parameters");
        Assert.assertEquals("There should be 3 parameters", 3, parameters.size());
        Assert.assertEquals("Parameter type should be 'query'", "path", parameters.get(0).get("in"));
    }

    @Test
    @SuppressWarnings("unchecked")
    public void checkCorrectParametersResolution() throws Exception {
        String raml = IOUtils.resourceToString("/product-api.raml", Charset.forName("UTF-8"));
        Assert.assertNotNull(raml);

        String swagger = raml2Swagger.convertToSwagger(raml);
        Assert.assertNotNull(swagger);

        TypeReference<HashMap<String, Object>> typeRef = new TypeReference<HashMap<String, Object>>() {};
        Map<String, Object> json = objectMapper.readValue(swagger, typeRef);
        Assert.assertNotNull(json);

        Map<String, Object> paths = (Map<String, Object>)json.get("paths");
        Map<String, Object> path = (Map<String, Object>)paths.get("/{version}/models/{externalId}/derivativeFeatureCombos/{featureList}");
        Map<String, Object> method = (Map<String, Object>)path.get("get");
        List<Map<String, Object>> parameters = (List<Map<String, Object>>)method.get("parameters");
        Assert.assertEquals("There should be 2 parameters", 2, parameters.size());
    }

    @Test
    public void convertToSwaggerFromInputStream() throws Exception {
        String raml = IOUtils.resourceToString(PRODUCT_API_RAML, Charset.forName("UTF-8"));
        Assert.assertNotNull(raml);

        String swagger = raml2Swagger.convertToSwagger(raml);
        Assert.assertNotNull(swagger);

        String swagger2 = raml2Swagger.convertToSwagger(getClass().getResourceAsStream(PRODUCT_API_RAML));
        Assert.assertNotNull(swagger2);
        Assert.assertEquals("The two swaggers output should be the same", swagger, swagger2);
    }
}


text:
create table degree (
	uniqueid decimal(20,0) primary key not null,
	session_id decimal(20,0) not null,
	reference varchar(20) not null,
	label varchar(60) not null,
	external_uid varchar(40)
) engine = INNODB;

create unique index uk_degree on degree(session_id, reference);

alter table degree add constraint fk_degree_session foreign key (session_id)
	references sessions (uniqueid) on delete cascade;

alter table student_area_clasf_major add degree_id decimal(20,0);

alter table student_area_clasf_major add constraint fk_student_acmaj_deg foreign key (degree_id)
	references degree (uniqueid) on delete set null;

insert into rights (role_id, value)
	select distinct r.role_id, 'Degrees'
	from roles r, rights g where g.role_id = r.role_id and g.value = 'Majors';

insert into rights (role_id, value)
	select distinct r.role_id, 'DegreeEdit'
	from roles r, rights g where g.role_id = r.role_id and g.value = 'MajorEdit';

/*
 * Update database version
 */

update application_config set value='239' where name='tmtbl.db.version';

commit;


text:
/**
 *
 */
package com.cardpay.pccredit.ipad.model;

/**
 * ipad 接口 数据字典
 * @author shaoming
 *
 * 2014年11月25日   下午5:16:52
 */
public class DataDictionary {
	private String code;
	private String name;

	public DataDictionary() {
	}

	public DataDictionary(String code, String name) {
		this.code = code;
		this.name = name;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

}


text:
namespace GlobalcachingApplication.Plugins.OLMap
{
    partial class OpenLayersMapForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.panel1 = new System.Windows.Forms.Panel();
            this.webBrowser1 = new System.Windows.Forms.WebBrowser();
            this.timer1 = new System.Windows.Forms.Timer(this.components);
            this.radioButtonAll = new System.Windows.Forms.RadioButton();
            this.label1 = new System.Windows.Forms.Label();
            this.radioButtonSelected = new System.Windows.Forms.RadioButton();
            this.radioButtonActive = new System.Windows.Forms.RadioButton();
            this.panel1.SuspendLayout();
            this.SuspendLayout();
            //
            // panel1
            //
            this.panel1.Controls.Add(this.radioButtonAll);
            this.panel1.Controls.Add(this.label1);
            this.panel1.Controls.Add(this.radioButtonSelected);
            this.panel1.Controls.Add(this.radioButtonActive);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(684, 30);
            this.panel1.TabIndex = 0;
            //
            // webBrowser1
            //
            this.webBrowser1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.webBrowser1.Location = new System.Drawing.Point(0, 30);
            this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
            this.webBrowser1.Name = "webBrowser1";
            this.webBrowser1.Size = new System.Drawing.Size(684, 381);
            this.webBrowser1.TabIndex = 1;
            this.webBrowser1.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.webBrowser1_DocumentCompleted);
            //
            // timer1
            //
            this.timer1.Interval = 300;
            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
            //
            // radioButtonAll
            //
            this.radioButtonAll.AutoSize = true;
            this.radioButtonAll.Location = new System.Drawing.Point(467, 4);
            this.radioButtonAll.Margin = new System.Windows.Forms.Padding(4);
            this.radioButtonAll.Name = "radioButtonAll";
            this.radioButtonAll.Size = new System.Drawing.Size(44, 21);
            this.radioButtonAll.TabIndex = 15;
            this.radioButtonAll.TabStop = true;
            this.radioButtonAll.Text = "All";
            this.radioButtonAll.UseVisualStyleBackColor = true;
            this.radioButtonAll.CheckedChanged += new System.EventHandler(this.radioButtonActive_CheckedChanged);
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(8, 4);
            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(113, 17);
            this.label1.TabIndex = 16;
            this.label1.Text = "Load geocaches";
            //
            // radioButtonSelected
            //
            this.radioButtonSelected.AutoSize = true;
            this.radioButtonSelected.Location = new System.Drawing.Point(316, 4);
            this.radioButtonSelected.Margin = new System.Windows.Forms.Padding(4);
            this.radioButtonSelected.Name = "radioButtonSelected";
            this.radioButtonSelected.Size = new System.Drawing.Size(84, 21);
            this.radioButtonSelected.TabIndex = 14;
            this.radioButtonSelected.TabStop = true;
            this.radioButtonSelected.Text = "Selected";
            this.radioButtonSelected.UseVisualStyleBackColor = true;
            this.radioButtonSelected.CheckedChanged += new System.EventHandler(this.radioButtonActive_CheckedChanged);
            //
            // radioButtonActive
            //
            this.radioButtonActive.AutoSize = true;
            this.radioButtonActive.Checked = true;
            this.radioButtonActive.Location = new System.Drawing.Point(188, 4);
            this.radioButtonActive.Margin = new System.Windows.Forms.Padding(4);
            this.radioButtonActive.Name = "radioButtonActive";
            this.radioButtonActive.Size = new System.Drawing.Size(67, 21);
            this.radioButtonActive.TabIndex = 13;
            this.radioButtonActive.TabStop = true;
            this.radioButtonActive.Text = "Active";
            this.radioButtonActive.UseVisualStyleBackColor = true;
            this.radioButtonActive.CheckedChanged += new System.EventHandler(this.radioButtonActive_CheckedChanged);
            //
            // OpenLayersMapForm
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(684, 411);
            this.Controls.Add(this.webBrowser1);
            this.Controls.Add(this.panel1);
            this.Name = "OpenLayersMapForm";
            this.ShowIcon = false;
            this.Text = "OpenLayersMapForm";
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.OpenLayersMapForm_FormClosing);
            this.LocationChanged += new System.EventHandler(this.OpenLayersMapForm_LocationChanged);
            this.SizeChanged += new System.EventHandler(this.OpenLayersMapForm_SizeChanged);
            this.Enter += new System.EventHandler(this.OpenLayersMapForm_Enter);
            this.Leave += new System.EventHandler(this.OpenLayersMapForm_Leave);
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.WebBrowser webBrowser1;
        private System.Windows.Forms.Timer timer1;
        private System.Windows.Forms.RadioButton radioButtonAll;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.RadioButton radioButtonSelected;
        private System.Windows.Forms.RadioButton radioButtonActive;
    }
}


text:
default: run

help: # with thanks to Ben Rady
	@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'

export XZ_OPT := -1 -T 0
export SENTRY_ORG := compiler-explorer

# If you see "node-not-found" then you need to depend on node-installed.
NODE:=node-not-found
NPM:=npm-not-found

# These 'find' scripts cache their results in a dotfile.
# Doing it this way instead of NODE:=$(shell etc/script/find-node) means
# if they fail, they stop the make process. As best I can tell there's no
# way to get make to fail if a sub-shell command fails.
.node-bin: etc/scripts/find-node
	@etc/scripts/find-node .node-bin

# All targets that need node must depend on this to ensure the NODE variable
# is appropriately set, and that PATH is updated.
node-installed: .node-bin
	@$(eval NODE:=$(shell cat .node-bin))
	@$(eval NPM:=$(shell dirname $(shell cat .node-bin))/npm)
	@$(eval PATH=$(shell dirname $(realpath $(NODE))):$(PATH))

info: node-installed ## print out some useful variables
	@echo Using node from $(NODE)
	@echo Using npm from $(NPM)
	@echo PATH is $(PATH)

.PHONY: clean run test run-amazon
.PHONY: dist lint lint-fix ci-lint prereqs node_modules gh-dist check pre-commit
prereqs: node_modules

NODE_MODULES=.npm-updated
$(NODE_MODULES): package.json | node-installed
	$(NPM) install --only=prod $(NPM_FLAGS)
	$(NPM) install --only=dev $(NPM_FLAGS)
	@touch $@

WEBPACK:=./node_modules/webpack-cli/bin/cli.js
$(WEBPACK): $(NODE_MODULES)

lint: $(NODE_MODULES)  ## Checks if the source currently matches code conventions
	$(NPM) run lint

lint-fix: $(NODE_MODULES)  ## Checks if everything matches code conventions & fixes those which are trivial to do so
	$(NPM) run lint-fix

ci-lint: $(NODE_MODULES)
	$(NPM) run ci-lint

node_modules: $(NODE_MODULES)
webpack: $(WEBPACK)  ## Runs webpack (useful only for debugging webpack)
	rm -rf out/dist/static out/dist/manifest.json
	$(WEBPACK) $(WEBPACK_ARGS)

test: $(NODE_MODULES)  ## Runs the tests
	$(NPM) run test
	@echo Tests pass

check: $(NODE_MODULES) test lint  ## Runs all checks required before committing (fixing trivial things automatically)
pre-commit: $(NODE_MODULES) test ci-lint

clean:  ## Cleans up everything
	rm -rf node_modules .*-updated .*-bin out

# Don't use $(NODE) ./node_modules/<path to node_module> as sometimes that's not actually a node script. Instead, rely
# on PATH ensuring "node" is found in our distribution first.
run: export NODE_ENV=production
run: export WEBPACK_ARGS="-p"
run: prereqs webpack  ## Runs the site normally
	./node_modules/.bin/supervisor -w app.js,lib,etc/config -e 'js|node|properties|yaml' --exec $(NODE) $(NODE_ARGS) -- -r esm ./app.js $(EXTRA_ARGS)

dev: export NODE_ENV=development
dev: prereqs install-git-hooks ## Runs the site as a developer; including live reload support and installation of git hooks
	./node_modules/.bin/supervisor -w app.js,lib,etc/config -e 'js|node|properties|yaml' -n exit --exec $(NODE) $(NODE_ARGS) -- -r esm ./app.js $(EXTRA_ARGS)

debug: export NODE_ENV=development
debug: prereqs install-git-hooks ## Runs the site as a developer with full debugging; including live reload support and installation of git hooks
	./node_modules/.bin/supervisor -w app.js,lib,etc/config -e 'js|node|properties|yaml' -n exit --exec $(NODE) $(NODE_ARGS) -- -r esm ./app.js --debug $(EXTRA_ARGS)

HASH := $(shell git rev-parse HEAD)
dist: export NODE_ENV=production
dist: export WEBPACK_ARGS=-p
dist: prereqs webpack  ## Creates a distribution
	echo $(HASH) > out/dist/git_hash

RELEASE_FILE_NAME=$(GITHUB_RUN_NUMBER)
RELEASE_NAME=gh-$(RELEASE_FILE_NAME)
gh-dist: dist  ## Creates a distribution as if we were running on github
	# Output some magic for GH to set the branch name
	echo "::set-output name=branch::$${GITHUB_REF#refs/heads/}"
	echo $(RELEASE_NAME) > out/dist/release_build
	rm -rf out/dist-bin
	mkdir -p out/dist-bin
	tar -Jcf out/dist-bin/$(RELEASE_FILE_NAME).tar.xz -T gh-dist-files.txt
	tar -Jcf out/dist-bin/$(RELEASE_FILE_NAME).static.tar.xz --transform="s,^out/dist/static/,," out/dist/static/*
	echo $(HASH) > out/dist-bin/$(RELEASE_FILE_NAME).txt
	du -ch out/**/*
	# Create and set commits for a sentry release if and only if we have the secure token set
	# External GitHub PRs etc won't have the variable set.
	@[ -z "$(SENTRY_AUTH_TOKEN)" ] || $(NPM) run sentry -- releases new -p compiler-explorer $(RELEASE_NAME)
	@[ -z "$(SENTRY_AUTH_TOKEN)" ] || $(NPM) run sentry -- releases set-commits --auto $(RELEASE_NAME)
	@[ -z "$(SENTRY_AUTH_TOKEN)" ] || $(NPM) run sentry -- releases files $(RELEASE_NAME) upload-sourcemaps out/dist/static

install-git-hooks:  ## Install git hooks that will ensure code is linted and tests are run before allowing a check in
	mkdir -p "$(shell git rev-parse --git-dir)/hooks"
	ln -sf "$(shell pwd)/etc/scripts/pre-commit" "$(shell git rev-parse --git-dir)/hooks/pre-commit"
.PHONY: install-git-hooks

changelog:  ## Create the changelog
	python3 ./etc/scripts/changelog.py

policies:
	python3 ./etc/scripts/politic.py

.PHONY: changelog


text:
// <copyright file="IImageEmitDetailsFactory.cs" company="natsnudasoft">
// Copyright (c) Adrian John Dunstan. All rights reserved.
//
// 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.
// </copyright>

namespace Natsnudasoft.EgamiFlowScreensaver
{
    /// <summary>
    /// Provides an interface describing methods to create instances of
    /// <see cref="IImageEmitDetails"/>.
    /// </summary>
    public interface IImageEmitDetailsFactory
    {
        /// <summary>
        /// Creates an instance of <see cref="IImageEmitDetails"/>.
        /// </summary>
        /// <param name="screensaverArea">The description of the area of the screensaver.</param>
        /// <returns>The created instance of <see cref="IImageEmitDetails"/>.</returns>
        IImageEmitDetails Create(ScreensaverArea screensaverArea);
    }
}


text:
namespace CharacterMap.Models
{
    public enum GlyphAnnotation
    {
        None = 0,
        UnicodeHex = 1,
        UnicodeIndex = 2
    }
}


text:
@interface StarInfoStatus : NSObject

@property(nonatomic,copy)NSString *Sif_Id;

@property(nonatomic,copy)NSString *Sif_Name;

@property(nonatomic,copy)NSString *Sif_Relation;

@property(nonatomic,copy)NSString *Sif_Img;

@end


text:
package com.daimajia.swipedemo.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.daimajia.swipe.adapters.BaseSwipeAdapter;
import com.daimajia.swipedemo.R;

public class GridViewAdapter extends BaseSwipeAdapter {

    private Context mContext;

    public GridViewAdapter(Context mContext) {
        this.mContext = mContext;
    }

    @Override
    public int getSwipeLayoutResourceId(int position) {
        return R.id.swipe;
    }

    @Override
    public View generateView(int position, ViewGroup parent) {
        return LayoutInflater.from(mContext).inflate(R.layout.grid_item, null);
    }

    @Override
    public void fillValues(int position, View convertView) {
        TextView t = (TextView)convertView.findViewById(R.id.position);
        t.setText((position + 1 )+".");
    }

    @Override
    public int getCount() {
        return 50;
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }
}


text:
/*jslint node: true, nomen: true, vars: true, plusplus: true*/
'use strict';

// DEPENDENCIES

// GLOBALS

var stdin = process.stdin;
var MAX_PROMPT_TRIES = 3;

// MAIN LOGIC

function preprocess (argv) {

	var i, arg;
	for (i = 0; i < argv.length; i++) {
		arg = argv[i];
		var parts = arg.match(/(.+[^\\])=(.+)/);
		if (parts) {
	            argv.splice(i, 1, parts[1], parts[2]);
		}

	        if(arg.match(/\\=/)){
	            argv.splice(i, 1, arg.replace(/\\=/g, '='));
	        }
	}

	return argv;
}

/**
 * Parses command line options
 * @param {function} options options specification
 * @param {string} extra Extra arguments description
 * @param {argv} arguments Arguments array (optionsl)
 */
module.exports.getopt = function (options, extra, argv) {

	var opts = {};           // Options map
	var arg;                 // Every argument
	var spected;
	var i;
	var len;
	var opt;
	var optname;
	var j;
	var o;
	var argvBackup;

	argv = argv || process.argv;
	argv = preprocess(argv);
	argvBackup = argv.join('&%$·').split('&%$·');

	// Arguments parsing
	argv = argv.slice(2);

	/**
	 * Creates the help description (to be used by printHelp(), for instance)
	 */
	opts.createHelp = function () {

		var o = null, lines = [], maxLength, help = '';

		for (o in options) {
			if (options.hasOwnProperty(o)) {
				var ops = ' ', i;
				for (i = 0; i < options[o].args; i++) {
					ops += '<ARG' + (i + 1) + '> ';
				}
				lines.push(['  ' + (options[o].key ? '-' + options[o].key + ', --' : '--') + o + ops, (options[o].description || '') + (options[o].mandatory ? ' (mandatory)' : '')]);
			}
		}

		maxLength = lines.reduce(function (prev, curr) {
			var aux = curr[0].length;
			if (aux > prev) {
				return aux;
			}
			return prev;
		}, 0);

		lines.forEach(function (l) {
			help += l[0] + (new Array(maxLength - l[0].length + 1)).join(' ') + '\t' + l[1] + '\n';
		});

		return help;
	};

	/**
	 * Prints the standard help message
	 */
	opts.printHelp = function () {
		var usage = 'USAGE: ';
		usage += 'node ' + argvBackup[1].split('/').pop() + ' [OPTIONS] ' + (extra || '');
		usage += ', where OPTIONS are:';
		console.log(usage);
		process.stdout.write(opts.createHelp());
	};

	/**
	 * Perform the parsing
	 */
	for (i = 0, len = argv.length; i < len; i = i + 1) {

		opt = null;
		optname = null;

		arg = argv[i];

		if (arg.charAt(0) === '-') {

			opt = {};
			spected = null;

			if (arg.charAt(1) === '-') {

				// It's a long option

				optname = arg.substring(2);
				spected = options[optname];
				if (!spected) {
					console.log('Unknown option: --' + optname);
					opts.printHelp();
					process.exit(-1);
				}

			} else if (arg.charAt(1).match(/[a-zA-Z]/)) {

				// It's a negative number, a short option (or many one)

				var keys = arg.substring(1).split('');

				keys.forEach(function (k) {

					var name;
					for (name in options) {

						if (options[name].key === k) {
							optname = name;
							break;
						}
					}

					spected = options[optname];
					if (!spected) {
						console.log('Unknown option: -' + k);
						opts.printHelp();
						process.exit(-1);
					}

					if (keys.length > 1) {

						opts[optname] = true;

					}
				});
			}

			if (argv[i + 1]) {

				// Arguments asociated with this option

				if (spected.args === 1) {

					i = i + 1;
					opt = argv[i];

				} else if (spected.args) {

					opt = [];
					for (j = i + 1; j < i + 1 + (spected.args || 0); j = j + 1) {
						opt.push(argv[j]);
					}
					i += spected.args;

				} else {

					opt = true;
				}

			} else {

				opt = true;
			}

			if (opt) {
				opts[optname] = opt;
			}

		} else {

			if (!opts.args) {
				opts.args = [];
			}

			opts.args.push(argv[i]);
		}
	}

	// Check if two options has the same short key

	var key = null;
	var shorts = {};
	for (key in options) {
		if (options.hasOwnProperty(key) && options[key].key) {
			if (shorts[options[key].key]) {
				console.log('Wrong options specification: There are two or more options with the key "-%s"', options[key].key);
				process.exit(-1);
			}
			shorts[options[key].key] = true;
		}
	}

	// Check if there is any mandatory and not specified option, or any wrong specified one

	var mandatoryNotSpecified = [];
	var wrongSpecified = [];

	for (o in options) {

		if (options.hasOwnProperty(o)) {

			var argsCount = parseInt(options[o].args, 10);

			if (opts[o] === true && argsCount === 1) {

				// Wrong specified
				wrongSpecified.push(o);

			} else if (opts[o] && argsCount >= 2) {

				for (i = 0; i < argsCount; i++) {

					if (!opts[o][i]) {

						// Wrong specified
						wrongSpecified.push(o);
						break;
					}
				}

			} else if (!opts[o] && options[o].mandatory) {

				// Not specified being mandatory
				mandatoryNotSpecified.push(o);
			}
		}
	}

	if (wrongSpecified.length > 0) {

		var error2 = 'Incomplete specification of option' + (mandatoryNotSpecified.length > 1 ? 's' : '') + ': ';

		error2 += wrongSpecified.map(function (o) {
			return '--' + o;
		}).join(', ');

		console.log(error2);
	}

	if (mandatoryNotSpecified.length > 0) {

		var error = 'Mandatory option' + (mandatoryNotSpecified.length > 1 ? 's' : '') + ' not specified: ';

		error += mandatoryNotSpecified.map(function (o) {
			return '--' + o;
		}).join(', ');

		console.log(error);
	}

	if (mandatoryNotSpecified.length > 0 || wrongSpecified.length > 0) {

		opts.printHelp();
		process.exit(-1);
	}

	return opts;
};

/**
 * Reads the complete standard input
 * @param {function} callback
 */
module.exports.read = function (callback) {

	if (!callback) {
		throw new Error('no callback provided to readInput() call');
	}

	var inputdata;
	stdin.resume();

	var listener = function (text) {
		inputdata += String(text);
	};

	stdin.on('data', listener);

	stdin.on('end', function () {
		stdin.removeListener('data', listener);
		callback(inputdata);
	});
};

/**
 * Shows a prompt question with some possible answers
 * @param {string}   question Question to show
 * @param {array}    options  Possible answers
 * @param {function} callback Function to call with user response (err, response)
 */
module.exports.question = function (question, options, callback) {

	// Options can be omited
	if (typeof options === 'function' && !callback) {
		callback = options;
		options = null;
	}

	if (!question || (options && (!Array.isArray(options) || options.length < 2))) {
		throw new Error('Stdio prompt question is malformed');
	}

	var tries = MAX_PROMPT_TRIES;

	var performQuestion = function () {
		var str = question;
		if (options) {
			str += ' [' + options.join('/') + ']';
		}
		str += ': ';
		process.stdout.write(str);
	};

	stdin.resume();

	var listener = function (data) {

		var response = data.toString().toLowerCase().trim();

		if (options && options.indexOf(response) === -1) {

			console.log('Unexpected answer');
			tries--;
			if (tries === 0) {
				stdin.removeListener('data', listener);
				callback('Retries spent');
			} else {
				performQuestion();
			}
			return;
		}
		stdin.removeListener('data', listener);
		callback(false, response);
	};

	stdin.addListener('data', listener);
	performQuestion();
};


text:
module.exports = {
    rules: {
        'declaration-bang-space-after': 'never',
        'declaration-bang-space-before': 'always',
        'declaration-colon-newline-after': null,
        'declaration-colon-space-after': 'always-single-line',
        'declaration-colon-space-before': 'never',
        'declaration-empty-line-before': 'never',
        'declaration-no-important': true,
        'declaration-property-unit-blacklist': null,
        'declaration-property-unit-whitelist': null,
        'declaration-property-value-blacklist': null,
        'declaration-property-value-whitelist': null,
    }
};


text:
'use strict';

const signup = require('./signup');

const handler = require('feathers-errors/handler');
const notFound = require('./not-found-handler');
const logger = require('./logger');

module.exports = function() {
  // Add your custom middleware here. Remember, that
  // just like Express the order matters, so error
  // handling middleware should go last.
  console.log('Register POST /signup')

  const app = this;

  app.post('/signup', signup(app));
  app.use(notFound());
  app.use(logger(app));
  app.use(handler());
};


text:
package com.wavesplatform.it.sync.smartcontract

import com.typesafe.config.Config
import com.wavesplatform.api.http.ApiError.ScriptExecutionError
import com.wavesplatform.common.state.ByteStr
import com.wavesplatform.common.utils.EitherExt2
import com.wavesplatform.features.BlockchainFeatures
import com.wavesplatform.it.NodeConfigs
import com.wavesplatform.it.api.SyncHttpApi._
import com.wavesplatform.it.api.TransactionInfo
import com.wavesplatform.it.sync._
import com.wavesplatform.it.transactions.BaseTransactionSuite
import com.wavesplatform.lang.v1.compiler.Terms.CONST_BYTESTR
import com.wavesplatform.lang.v1.estimator.v2.ScriptEstimatorV2
import com.wavesplatform.lang.v1.estimator.v3.ScriptEstimatorV3
import com.wavesplatform.state._
import com.wavesplatform.test._
import com.wavesplatform.transaction.Asset.Waves
import com.wavesplatform.transaction.TxVersion
import com.wavesplatform.transaction.smart.InvokeScriptTransaction.Payment
import com.wavesplatform.transaction.smart.script.ScriptCompiler
import org.scalatest.CancelAfterFailure

import scala.concurrent.duration._

class InvokeScriptTransactionSuite extends BaseTransactionSuite with CancelAfterFailure {

  val activationHeight = 8
  override protected def nodeConfigs: Seq[Config] =
    NodeConfigs
      .Builder(NodeConfigs.Default, 1, Seq.empty)
      .overrideBase(_.quorum(0))
      .overrideBase(
        _.preactivatedFeatures(
          (BlockchainFeatures.Ride4DApps.id, 0),
          (BlockchainFeatures.BlockV5.id, activationHeight)
        )
      )
      .withDefault(1)
      .buildNonConflicting()

  private def firstContract      = firstKeyPair
  private def secondContract     = secondKeyPair
  private lazy val thirdContract = sender.createKeyPair()
  private def caller             = thirdKeyPair

  private lazy val firstContractAddress: String  = firstContract.toAddress.toString
  private lazy val secondContractAddress: String = secondContract.toAddress.toString

  protected override def beforeAll(): Unit = {
    super.beforeAll()
    val scriptText =
      """
        |{-# STDLIB_VERSION 3 #-}
        |{-# CONTENT_TYPE DAPP #-}
        |
        | @Callable(inv)
        | func foo(a:ByteVector) = {
        |  WriteSet([DataEntry("a", a), DataEntry("sender", inv.caller.bytes)])
        | }
        | @Callable(inv)
        | func emptyKey() = {
        |  WriteSet([DataEntry("", "a")])
        | }
        |
        | @Callable(inv)
        | func baz() = {
        |  WriteSet([DataEntry("test", this.bytes)])
        | }
        |
        | @Callable(inv)
        | func default() = {
        |  WriteSet([DataEntry("a", "b"), DataEntry("sender", "senderId")])
        | }
        |
        | @Verifier(t)
        | func verify() = {
        |  true
        | }
        |
        |
        """.stripMargin
    val script = ScriptCompiler.compile(scriptText, ScriptEstimatorV2).explicitGet()._1.bytes().base64
    sender.transfer(firstKeyPair, thirdContract.toAddress.toString, 10.waves, minFee, waitForTx = true)
    val setScriptId  = sender.setScript(firstContract, Some(script), setScriptFee, waitForTx = true).id
    val setScriptId2 = sender.setScript(secondContract, Some(script), setScriptFee, waitForTx = true).id

    val acc0ScriptInfo  = sender.addressScriptInfo(firstContractAddress)
    val acc0ScriptInfo2 = sender.addressScriptInfo(secondContractAddress)
    sender.createAlias(firstContract, "alias", fee = 1.waves, waitForTx = true)

    acc0ScriptInfo.script.isEmpty shouldBe false
    acc0ScriptInfo.scriptText.isEmpty shouldBe false
    acc0ScriptInfo.script.get.startsWith("base64:") shouldBe true
    acc0ScriptInfo2.script.isEmpty shouldBe false
    acc0ScriptInfo2.scriptText.isEmpty shouldBe false
    acc0ScriptInfo2.script.get.startsWith("base64:") shouldBe true

    sender.transactionInfo[TransactionInfo](setScriptId).script.get.startsWith("base64:") shouldBe true
    sender.transactionInfo[TransactionInfo](setScriptId2).script.get.startsWith("base64:") shouldBe true
  }

  ignore("""Allow to use "this" if DApp is called by alias""") {
    sender.invokeScript(
      caller,
      "alias:I:alias",
      func = Some("baz"),
      args = List(),
      payment = Seq(),
      fee = 1.waves,
      waitForTx = true
    )
    sender.getDataByKey(firstContractAddress, "test") shouldBe BinaryDataEntry("test", ByteStr(firstContract.toAddress.bytes))
  }

  test("Wait for activation") {
    val scriptTextV4 =
      """
        |{-# STDLIB_VERSION 4 #-}
        |{-# CONTENT_TYPE DAPP #-}
        |
        | @Callable(inv)
        |func foo() = [IntegerEntry("", 1)]
        |
        | @Callable(inv)
        |func bar() = [IntegerEntry("", 2)]
        |
        |@Callable(inv)
        | func biz() = [IntegerEntry("numb", 1)]
        |
        """.stripMargin
    val script2 = ScriptCompiler.compile(scriptTextV4, ScriptEstimatorV3(fixOverflow = true, overhead = false)).explicitGet()._1.bytes().base64
    sender.waitForHeight(activationHeight, 13.minute)
    val setScriptId3 = sender.setScript(thirdContract, Some(script2), setScriptFee, waitForTx = true).id
    sender.transactionInfo[TransactionInfo](setScriptId3).script.get.startsWith("base64:") shouldBe true
  }

  test("contract caller invokes a function on a contract") {
    val arg = ByteStr(Array(42: Byte))
    for (v <- invokeScrTxSupportedVersions) {
      val contract = (if (v < 2) firstContract else secondContract).toAddress.toString
      val invokeScriptTx = sender.invokeScript(
        caller,
        contract,
        func = Some("foo"),
        args = List(CONST_BYTESTR(arg).explicitGet()),
        payment = Seq(Payment(1.waves, Waves)),
        fee = 1.waves,
        version = v,
        waitForTx = true
      )

      nodes.waitForHeightAriseAndTxPresent(invokeScriptTx._1.id)

      sender.getDataByKey(contract, "a") shouldBe BinaryDataEntry("a", arg)
      sender.getDataByKey(contract, "sender") shouldBe BinaryDataEntry("sender", ByteStr(caller.toAddress.bytes))
    }
  }

  test("contract caller invokes a function on a contract by alias") {
    val arg = ByteStr(Array(43: Byte))

    val _ = sender.invokeScript(
      caller,
      "alias:I:alias",
      func = Some("foo"),
      args = List(CONST_BYTESTR(arg).explicitGet()),
      payment = Seq(),
      fee = 1.waves,
      waitForTx = true
    )

    sender.getDataByKey(firstContractAddress, "a") shouldBe BinaryDataEntry("a", arg)
    sender.getDataByKey(firstContractAddress, "sender") shouldBe BinaryDataEntry("sender", ByteStr(caller.toAddress.bytes))
  }

  test("translate alias to the address") {
    sender.invokeScript(
      caller,
      "alias:I:alias",
      func = Some("baz"),
      args = List(),
      payment = Seq(),
      fee = 1.waves,
      waitForTx = true
    )
    sender.getDataByKey(firstContractAddress, "test") shouldBe BinaryDataEntry("test", ByteStr(firstContract.toAddress.bytes))
  }

  test("contract caller invokes a default function on a contract") {
    for (v <- invokeScrTxSupportedVersions) {
      val contract = (if (v < 2) firstContract else secondContract).toAddress.toString
      val _ = sender.invokeScript(
        caller,
        contract,
        func = None,
        payment = Seq(),
        fee = 1.waves,
        version = v,
        waitForTx = true
      )
      sender.getDataByKey(contract, "a") shouldBe StringDataEntry("a", "b")
      sender.getDataByKey(contract, "sender") shouldBe StringDataEntry("sender", "senderId")
    }
  }

  test("verifier works") {
    for (v <- invokeScrTxSupportedVersions) {
      val contract = if (v < 2) firstContract else secondContract
      val dataTxId = sender.putData(contract, data = List(StringDataEntry("a", "OOO")), fee = 1.waves, waitForTx = true).id

      nodes.waitForHeightAriseAndTxPresent(dataTxId)

      sender.getDataByKey(contract.toAddress.toString, "a") shouldBe StringDataEntry("a", "OOO")
    }
  }

  test("not able to set an empty key by InvokeScriptTransaction with version >= 2") {
    assertApiError(
      sender
        .invokeScript(
          caller,
          secondContractAddress,
          func = Some("emptyKey"),
          payment = Seq(),
          fee = 1.waves,
          version = TxVersion.V2
        ),
      AssertiveApiError(ScriptExecutionError.Id, "Error while executing dApp: Empty keys aren't allowed in tx version >= 2")
    )

    nodes.waitForHeightArise()
    sender.getData(secondContractAddress).filter(_.key.isEmpty) shouldBe List.empty

    assertApiError(
      sender.invokeScript(
        caller,
        thirdContract.toAddress.toString,
        func = Some("bar"),
        payment = Seq(),
        fee = 1.waves,
        version = TxVersion.V2
      ),
      AssertiveApiError(ScriptExecutionError.Id, "Error while executing dApp: Empty keys aren't allowed in tx version >= 2")
    )

    nodes.waitForHeightArise()
    sender.getData(thirdContract.toAddress.toString).filter(_.key.isEmpty) shouldBe List.empty
  }

  test("invoke script via dApp alias") {
    sender.createAlias(thirdContract, "dappalias", smartMinFee, waitForTx = true)
    val dAppAlias = sender.aliasByAddress(thirdContract.toAddress.toString).find(_.endsWith("dappalias")).get
    for (v <- invokeScrTxSupportedVersions) {
      sender.invokeScript(caller, dAppAlias, fee = smartMinFee + smartFee, func = Some("biz"), version = v, waitForTx = true)
      sender.getDataByKey(thirdContract.toAddress.toString, "numb") shouldBe IntegerDataEntry("numb", 1)
    }
  }
}


text:
import BluebirdPromise from "bluebird-lst"
import { Arch, warn } from "builder-util"
import { PackageFileInfo } from "builder-util-runtime"
import { unlink } from "fs-extra-p"
import { getTemplatePath } from "../../util/pathManager"
import { NsisTarget } from "./NsisTarget"
import { copyFile } from "builder-util/out/fs"
import * as path from "path"
import { Lazy } from "lazy-val"
import { getBinFromGithub } from "builder-util/out/binDownload"

export const nsisTemplatesDir = getTemplatePath("nsis")

// noinspection SpellCheckingInspection
export const NSIS_PATH = new Lazy(() => getBinFromGithub("nsis", "3.0.1.13", "2921dd404ce9b69679088a6f1409a56dd360da2077fe1019573c0712c9edf057"))

export class AppPackageHelper {
  private readonly archToFileInfo = new Map<Arch, Promise<PackageFileInfo>>()
  private readonly infoToIsDelete = new Map<PackageFileInfo, boolean>()

  /** @private */
  refCount = 0

  constructor(private readonly elevateHelper: CopyElevateHelper) {
  }

  async packArch(arch: Arch, target: NsisTarget): Promise<PackageFileInfo> {
    let infoPromise = this.archToFileInfo.get(arch)
    if (infoPromise == null) {
      const appOutDir = target.archs.get(arch)!
      infoPromise = this.elevateHelper.copy(appOutDir, target)
        .then(() => target.buildAppPackage(appOutDir, arch))
      this.archToFileInfo.set(arch, infoPromise)
    }

    const info = await infoPromise
    if (target.isWebInstaller) {
      this.infoToIsDelete.set(info, false)
    }
    else if (!this.infoToIsDelete.has(info)) {
      this.infoToIsDelete.set(info, true)
    }
    return info
  }

  async finishBuild(): Promise<any> {
    if (--this.refCount > 0) {
      return
    }

    const filesToDelete: Array<string> = []
    for (const [info, isDelete]  of this.infoToIsDelete.entries()) {
      if (isDelete) {
        filesToDelete.push(info.path)
      }
    }

    await BluebirdPromise.map(filesToDelete, it => unlink(it))
  }
}

export class CopyElevateHelper {
  private readonly copied = new Map<string, Promise<string>>()

  copy(appOutDir: string, target: NsisTarget): Promise<any> {
    let isPackElevateHelper = target.options.packElevateHelper
    if (isPackElevateHelper === false && target.options.perMachine === true) {
      isPackElevateHelper = true
      warn("`packElevateHelper = false` is ignored, because `perMachine` is set to `true`")
    }

    if (isPackElevateHelper === false) {
      return BluebirdPromise.resolve()
    }

    let promise = this.copied.get(appOutDir)
    if (promise != null) {
      return promise
    }

    promise = NSIS_PATH.value.then(it => copyFile(path.join(it, "elevate.exe"), path.join(appOutDir, "resources", "elevate.exe"), false))
    this.copied.set(appOutDir, promise)
    return promise
  }
}


text:
<?php
	namespace controllers;

	require_once \core\FileManager::getCorePath('Controller');
	require_once \core\FileManager::getPersistencePath('Former');

	class Authentification extends \core\Controller {

		/**
		 * Affiche la page d'authentification
		 */
		public function actionDefault()
		{
			if(\libs\http\Request::sessionExists('id_former'))
				\libs\http\Response::redirect('index.php');

			$this->_view->setFile('authentification/form');
			$this->_view->setTitle('Authentification');
		}

		/**
		 * L'utilisateur valide le formulaire d'authentification
		 */
		public function actionConnect()
		{
			if(\libs\http\Request::sessionExists('id_former'))
				\libs\http\Response::redirect('index.php');

			if(isset($_POST['username'], $_POST['password']))
			{
				$params = array(
					'name' => \libs\http\Request::postData('username'),
					'password' => \libs\http\Request::postData('password')
				);

				$former = new \models\Former($params);

				if(\persistences\Former::isValid($former) === TRUE)
				{
					$_SESSION['id_former'] = $former->getIdFormer();

					\libs\http\Response::redirect('index.php');
				}
			}

			$this->_view->setFile('authentification/error');
			$this->_view->setTitle('Authentification');
		}

		/**
		 * L'utilisateur se deconnecte
		 */
		public function actionDisconnect()
		{
			session_destroy();

			$this->_view->setFile('authentification/form');
			$this->_view->setTitle('Authentification');
		}
	}
?>


text:
package java.lang;

import java.lang.StackWalker.StackFrame;
import java.util.EnumSet;
import java.util.Set;

import static java.lang.StackWalker.ExtendedOption.LOCALS_AND_OPERANDS;

/**
 * UNSUPPORTED This interface is intended to be package-private
 * or move to an internal package.

 *
 * {@code LiveStackFrame} represents a frame storing data and partial results.
 * Each frame has its own array of local variables (JVMS section 2.6.1),
 * its own operand stack (JVMS section 2.6.2) for a method invocation.
 *
 * @jvms 2.6 Frames
 */
/* package-private */
interface LiveStackFrame extends StackFrame {
    /**
     * Return the monitors held by this stack frame. This method returns
     * an empty array if no monitor is held by this stack frame.
     *
     * @return the monitors held by this stack frames
     */
    public Object[] getMonitors();

    /**
     * Gets the local variable array of this stack frame.
     *
     *
A single local variable can hold a value of type boolean, byte, char,
     * short, int, float, reference or returnAddress.  A pair of local variables
     * can hold a value of type long or double (JVMS section 2.6.1).  Primitive
     * locals are represented in the returned array as {@code PrimitiveSlot}s,
     * with longs and doubles occupying a pair of consecutive
     * {@code PrimitiveSlot}s.
     *
     *
The current VM implementation does not provide specific type
     * information for primitive locals.  This method simply returns the raw
     * contents of the VM's primitive locals on a best-effort basis, without
     * indicating a specific type.
     *
     *
The returned array may contain null entries for local variables that
     * are not live.
     *
     * @implNote
     *
 The specific subclass of {@code PrimitiveSlot} will reflect the
     * underlying architecture, and will be either {@code PrimitiveSlot32} or
     * {@code PrimitiveSlot64}.
     *
     *
How a long or double value is stored in the pair of
     * {@code PrimitiveSlot}s can vary based on the underlying architecture and
     * VM implementation.  On 32-bit architectures, long/double values are split
     * between the two {@code PrimitiveSlot32}s.
     * On 64-bit architectures, the entire value may be stored in one of the
     * {@code PrimitiveSlot64}s, with the other {@code PrimitiveSlot64} being
     * unused.
     *
     *
The contents of the unused, high-order portion of a
     * {@code PrimitiveSlot64} (when storing a primitive other than a long or
     * double) is unspecified.  In particular, the unused bits are not
     * necessarily zeroed out.
     *
     * @return  the local variable array of this stack frame.
     */
    public Object[] getLocals();

    /**
     * Gets the operand stack of this stack frame.
     *
     *

     * The 0-th element of the returned array represents the top of the operand stack.
     * This method returns an empty array if the operand stack is empty.
     *
     *
Each entry on the operand stack can hold a value of any Java Virtual
     * Machine Type.
     * For a value of primitive type, the element in the returned array is
     * a {@link PrimitiveSlot} object; otherwise, the element is the {@code Object}
     * on the operand stack.
     *
     * @return the operand stack of this stack frame.
     */
    public Object[] getStack();

    /**
     * UNSUPPORTED This interface is intended to be package-private
     * or moved to an internal package.

     *
     * Represents a local variable or an entry on the operand stack whose value is
     * of primitive type.
     */
    public abstract class PrimitiveSlot {
        /**
         * Constructor.
         */
        PrimitiveSlot() {}

        /**
         * Returns the size, in bytes, of the slot.
         */
        public abstract int size();

        /**
         * Returns the int value if this primitive value is of size 4
         * @return the int value if this primitive value is of size 4
         *
         * @throws UnsupportedOperationException if this primitive value is not
         * of size 4.
         */
        public int intValue() {
            throw new UnsupportedOperationException("this " + size() + "-byte primitive");
        }

        /**
         * Returns the long value if this primitive value is of size 8
         * @return the long value if this primitive value is of size 8
         *
         * @throws UnsupportedOperationException if this primitive value is not
         * of size 8.
         */
        public long longValue() {
            throw new UnsupportedOperationException("this " + size() + "-byte primitive");
        }
    }

    /**
     * Gets {@code StackWalker} that can get locals and operands.
     *
     * @throws SecurityException if the security manager is present and
     * denies access to {@code RuntimePermission("liveStackFrames")}
     */
    public static StackWalker getStackWalker() {
        return getStackWalker(EnumSet.noneOf(StackWalker.Option.class));
    }

    /**
     * Gets a {@code StackWalker} instance with the given options specifying
     * the stack frame information it can access, and which will traverse at most
     * the given {@code maxDepth} number of stack frames.  If no option is
     * specified, this {@code StackWalker} obtains the method name and
     * the class name with all
     * {@linkplain StackWalker.Option#SHOW_HIDDEN_FRAMES hidden frames} skipped.
     * The returned {@code StackWalker} can get locals and operands.
     *
     * @param options stack walk {@link StackWalker.Option options}
     *
     * @throws SecurityException if the security manager is present and
     * it denies access to {@code RuntimePermission("liveStackFrames")};
     * or if the given {@code options} contains
     * {@link StackWalker.Option#RETAIN_CLASS_REFERENCE Option.RETAIN_CLASS_REFERENCE}
     * and it denies access to {@code RuntimePermission("getStackWalkerWithClassReference")}.
     */
    public static StackWalker getStackWalker(Set<StackWalker.Option> options) {
        @SuppressWarnings("removal")
        SecurityManager sm = System.getSecurityManager();
        if (sm != null) {
            sm.checkPermission(new RuntimePermission("liveStackFrames"));
        }
        return StackWalker.newInstance(options, LOCALS_AND_OPERANDS);
    }
}


text:
package io.gatling.jms

import javax.jms.ConnectionFactory

import io.gatling.core.action.builder.ActionBuilder
import io.gatling.core.config.GatlingConfiguration
import io.gatling.core.session._
import io.gatling.jms.check.JmsCheckSupport
import io.gatling.jms.jndi.{ JmsJndiConnectionFactoryBuilder, JmsJndiConnectionFactoryBuilderBase }
import io.gatling.jms.protocol.{ JmsProtocol, JmsProtocolBuilder, JmsProtocolBuilderBase }
import io.gatling.jms.request._

trait JmsDsl extends JmsCheckSupport {

  def jms(implicit configuration: GatlingConfiguration) = JmsProtocolBuilderBase

  val jmsJndiConnectionFactory = JmsJndiConnectionFactoryBuilderBase

  /**
   * DSL text to start the jms builder
   *
   * @param requestName human readable name of request
   * @return a PingBuilder instance which can be used to build up a ping
   */
  def jms(requestName: Expression[String]) = JmsDslBuilderBase(requestName)

  /**
   * Convert a JmsProtocolBuilder to a JmsProtocol
   * <p>
   * Simplifies the API somewhat (you can pass the builder reference to the scenario .protocolConfig() method)
   */
  implicit def jmsProtocolBuilder2jmsProtocol(builder: JmsProtocolBuilder): JmsProtocol = builder.build

  implicit def jmsDslBuilder2ActionBuilder(builder: SendDslBuilder): ActionBuilder = builder.build()

  implicit def jmsDslBuilder2ActionBuilder(builder: RequestReplyDslBuilder): ActionBuilder = builder.build()

  implicit def jmsJndiConnectionFactory2ActionBuilder(builder: JmsJndiConnectionFactoryBuilder): ConnectionFactory = builder.build()

  def topic(name: String) = JmsTopic(name)
  def queue(name: String) = JmsQueue(name)
}


text:
package fema.edu.json.test;

import fema.edu.json.engine.Engine;
import fema.edu.json.engine.JsonEngine;

public class Main {
  public static void main(String[] args) {
    Pessoa p = new Pessoa();
    p.setNome("joao pedro");
    p.setIdade(12);
    Engine e = new JsonEngine();
    String json = e.toJson(p);
    System.out.println(json);
  }
}