text:
#region S# License

#endregion S# License
namespace StockSharp.Hydra.Oanda
{
	using System.Collections.Generic;
	using System.Linq;
	using System.Security;

	using Ecng.Common;
	using Ecng.ComponentModel;

	using StockSharp.Algo;
	using StockSharp.Hydra.Core;
	using StockSharp.Oanda;
	using StockSharp.Messages;
	using StockSharp.Localization;

	using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;

	[DisplayNameLoc(_sourceName)]
	[DescriptionLoc(LocalizedStrings.Str2281ParamsKey, _sourceName)]
	[Doc("http://stocksharp.com/doc/html/6a99aea5-1142-4b2e-b183-554fcc890fad.htm")]
	[TaskCategory(TaskCategories.Forex | TaskCategories.RealTime |
		TaskCategories.Free | TaskCategories.History | TaskCategories.MarketDepth |
		TaskCategories.Level1 | TaskCategories.Candles | TaskCategories.Transactions)]
	class OandaTask : ConnectorHydraTask<OandaMessageAdapter>
	{
		private const string _sourceName = "OANDA";

		[TaskSettingsDisplayName(_sourceName)]
		[CategoryOrder(_sourceName, 0)]
		private sealed class OandaSettings : ConnectorHydraTaskSettings
		{
			public OandaSettings(HydraTaskSettings settings)
				: base(settings)
			{
			}

			[CategoryLoc(_sourceName)]
			[DisplayNameLoc(LocalizedStrings.Str3416Key)]
			[DescriptionLoc(LocalizedStrings.Str3450Key)]
			[PropertyOrder(0)]
			public OandaServers Server
			{
				get { return ExtensionInfo[nameof(Server)].To<OandaServers>(); }
				set { ExtensionInfo[nameof(Server)] = value.To<string>(); }
			}

			[CategoryLoc(_sourceName)]
			[DisplayNameLoc(LocalizedStrings.Str3451Key)]
			[DescriptionLoc(LocalizedStrings.Str3451Key, true)]
			[PropertyOrder(1)]
			public SecureString Token
			{
				get { return ExtensionInfo[nameof(Token)].To<SecureString>(); }
				set { ExtensionInfo[nameof(Token)] = value; }
			}
		}

		public OandaTask()
		{
			SupportedDataTypes = OandaMessageAdapter
				.TimeFrames
				.Select(tf => DataType.Create(typeof(TimeFrameCandleMessage), tf))
				.Concat(new[]
				{
					DataType.Create(typeof(Level1ChangeMessage), null),
					DataType.Create(typeof(ExecutionMessage), ExecutionTypes.Transaction),
				})
				.ToArray();
		}

		private OandaSettings _settings;

		public override HydraTaskSettings Settings => _settings;

		public override IEnumerable<DataType> SupportedDataTypes { get; }

		protected override void ApplySettings(HydraTaskSettings settings)
		{
			_settings = new OandaSettings(settings);

			if (settings.IsDefault)
			{
				_settings.Server = OandaServers.Real;
				_settings.Token = new SecureString();
			}
		}

		protected override OandaMessageAdapter GetAdapter(IdGenerator generator)
		{
			return new OandaMessageAdapter(generator)
			{
				Server = _settings.Server,
				Token = _settings.Token,
			};
		}
	}
}


text:
from .chaos_event import ChaosEvent

class StartedChaosEvent(ChaosEvent):
    """Describes a Chaos event that gets generated when Chaos is started.

    :param time_stamp_utc: The UTC timestamp when this Chaos event was
     generated.
    :type time_stamp_utc: datetime
    :param kind: Constant filled by server.
    :type kind: str
    :param chaos_parameters: Defines all the parameters to configure a Chaos
     run.
    :type chaos_parameters: ~azure.servicefabric.models.ChaosParameters
    """

    _validation = {
        'time_stamp_utc': {'required': True},
        'kind': {'required': True},
    }

    _attribute_map = {
        'time_stamp_utc': {'key': 'TimeStampUtc', 'type': 'iso-8601'},
        'kind': {'key': 'Kind', 'type': 'str'},
        'chaos_parameters': {'key': 'ChaosParameters', 'type': 'ChaosParameters'},
    }

    def __init__(self, time_stamp_utc, chaos_parameters=None):
        super(StartedChaosEvent, self).__init__(time_stamp_utc=time_stamp_utc)
        self.chaos_parameters = chaos_parameters
        self.kind = 'Started'

redpajama_set_name: RedPajamaGithub


text:
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/17005f6b919a40819ca1fe7386317851)](https://www.codacy.com/app/AnthyG/da_cards-2?utm_source=github.com&utm_medium=referral&utm_content=AnthyG/da_cards-2&utm_campaign=Badge_Grade)
[![Build Status](https://travis-ci.org/AnthyG/da_cards-2.svg?branch=master)](https://travis-ci.org/AnthyG/da_cards-2)

A Online Card-game, based on NodeJS, socket.io, and React.


text:
id: 587d781a367417b2b2512ab7
title: Utiliza la etiqueta strong para poner el texto en negrita
challengeType: 0
videoUrl: 'https://scrimba.com/c/ceJNBSb'
forumTopicId: 301080
dashedName: use-the-strong-tag-to-make-text-bold
---

# --description--

Para poner el texto en negrita, puedes usar la etiqueta `strong`. Esto se usa a menudo para llamar la atención sobre el texto y simbolizar que es importante. Con la etiqueta `strong`, el navegador aplica el CSS de `font-weight: bold;` al elemento.

# --instructions--

Envuelve una etiqueta `strong` alrededor del texto `Stanford University` dentro de la etiqueta `p` (no incluyas el punto).

# --hints--

Tu código debe agregar una etiqueta `strong` al lenguaje de marcado.

```js
assert($('strong').length == 1);
```

La etiqueta `strong` debe estar dentro de la etiqueta `p`.

```js
assert($('p').children('strong').length == 1);
```

La etiqueta `strong` debe envolver el texto `Stanford University`.

```js
assert(
  $('strong')
    .text()
    .match(/^Stanford University\.?$/gi)
);
```

# --seed--

## --seed-contents--

```html
<style>
  h4 {
    text-align: center;
    height: 25px;
  }
  p {
    text-align: justify;
  }
  .links {
    text-align: left;
    color: black;
  }
  .fullCard {
    width: 245px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin: 10px 5px;
    padding: 4px;
  }
  .cardContent {
    padding: 10px;
  }
  .cardText {
    margin-bottom: 30px;
  }
</style>
<div class="fullCard">
  <div class="cardContent">
    <div class="cardText">
      <h4>Google</h4>
      <p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University.</p>
    </div>
    <div class="cardLinks">
      <a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
      <a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
    </div>
  </div>
</div>
```

# --solutions--

```html
<style>
  h4 {
    text-align: center;
    height: 25px;
  }
  p {
    text-align: justify;
  }
  .links {
    text-align: left;
    color: black;
  }
  .fullCard {
    width: 245px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin: 10px 5px;
    padding: 4px;
  }
  .cardContent {
    padding: 10px;
  }
  .cardText {
    margin-bottom: 30px;
  }
</style>
<div class="fullCard">
  <div class="cardContent">
    <div class="cardText">
      <h4>Google</h4>
      <p>Google was founded by Larry Page and Sergey Brin while they were Ph.D. students at <strong>Stanford University</strong>.</p>
    </div>
    <div class="cardLinks">
      <a href="https://en.wikipedia.org/wiki/Larry_Page" target="_blank" class="links">Larry Page</a><br><br>
      <a href="https://en.wikipedia.org/wiki/Sergey_Brin" target="_blank" class="links">Sergey Brin</a>
    </div>
  </div>
</div>
```


text:
helloworld-html5: HTML5 and REST Hello World Example
===================
Author: Jay Balunas, Burr Sutter, Douglas Campos, Bruno Olivera
Level: Beginner
Technologies: CDI, JAX-RS, HTML5
Summary: The `helloworld-html5` quickstart demonstrates the use of *CDI 1.1* and *JAX-RS 2.0* using the HTML5 architecture and RESTful services on the backend.
Target Product: JBoss EAP
Source: <https://github.com/jboss-developer/jboss-eap-quickstarts>

What is it?
-----------

The `helloworld-html5` quickstart demonstrates the use of *CDI 1.1* and *JAX-RS 2.0* in Red Hat JBoss Enterprise Application Platform 7 or later using the HTML5 + REST architecture.

The application is basically a smart, HTML5+CSS3+JavaScript front-end using RESTful services on the backend.

 * HelloWorld.java - establishes the RESTful endpoints using JAX-RS
 * Web.xml - maps RESTful endpoints to "/hello"
 * index.html - is a jQuery augmented plain old HTML5 web page

The example can be deployed using Maven from the command line or from Eclipse using JBoss Tools.

System requirements
-------------------

The application this project produces is designed to be run on Red Hat JBoss Enterprise Application Platform (JBoss EAP) 7 or later.

All you need to build this project is Java 8.0 (Java SDK 1.8) or later, Maven 3.0 or later.

An HTML5 compatible browser such as Chrome, Safari 5+, Firefox 5+, or IE 9+ is required.

With the prerequisites out of the way, you're ready to build and deploy.

Configure Maven
---------------

If you have not yet done so, you must [Configure Maven](https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/CONFIGURE_MAVEN.md#configure-maven-to-build-and-deploy-the-quickstarts) before testing the quickstarts.

Start the JBoss EAP Server
-------------------------

1. Open a command line and navigate to the root of the JBoss EAP directory.
2. The following shows the command line to start the server with the default profile:

        For Linux:   EAP_HOME/bin/standalone.sh
        For Windows: EAP_HOME\bin\standalone.bat

Build and Deploy the Quickstart
-------------------------

_NOTE: The following build command assumes you have configured your Maven user settings. If you have not, you must include Maven setting arguments on the command line. See [Build and Deploy the Quickstarts](../README.md#build-and-deploy-the-quickstarts) for complete instructions and additional options._

1. Make sure you have started the JBoss EAP server as described above.
2. Open a command line and navigate to the root directory of this quickstart.
3. Type this command to build and deploy both the client and service applications:

        mvn clean package wildfly:deploy

4. This will deploy `target/jboss-helloworld-html5.war` to the running instance of the server.

Access the application
---------------------

The application will be running at the following URL <http://localhost:8080/jboss-helloworld-html5/>.

You can also test the REST endpoint as follows. Feel free to replace `YOUR_NAME` with a name of your choosing.

* The *XML* content can be tested by accessing the following URL: <http://localhost:8080/jboss-helloworld-html5/hello/xml/YOUR_NAME>
* The *JSON* content can be tested by accessing this URL: <http://localhost:8080/jboss-helloworld-html5/hello/json/YOUR_NAME>

Undeploy the Archive
--------------------

1. Make sure you have started the JBoss EAP server as described above.
2. Open a command line and navigate to the root directory of this quickstart.
3. When you are finished testing, type this command to undeploy the archive:

        mvn jboss-as:undeploy

Run the Arquillian Functional Tests
-----------------------------------

This quickstart provides Arquillian functional tests as well. They are located in the functional-tests/ subdirectory under the root directory of this quickstart.
Functional tests verify that your application behaves correctly from the user's point of view. The tests open a browser instance, simulate clicking around the page as a normal user would do, and then close the browser instance.

To run these tests, you must build the main project as described above.

1. Open a command line and navigate to the root directory of this quickstart.
2. Build the quickstart WAR using the following command:

        mvn clean package

3. Navigate to the functional-tests/ directory in this quickstart.
4. If you have a running instance of the JBoss EAP server, as described above, run the remote tests by typing the following command:

        mvn clean verify -Parq-wildfly-remote

5. If you prefer to run the functional tests using managed instance of the JBoss EAP server, meaning the tests will start the server for you, type fhe following command:

        mvn clean verify -Parq-wildfly-managed

Run the Quickstart in Red Hat JBoss Developer Studio or Eclipse
-------------------------------------
You can also start the server and deploy the quickstarts or run the Arquillian tests from Eclipse using JBoss tools. For more information, see [Use JBoss Developer Studio or Eclipse to Run the Quickstarts](https://github.com/jboss-developer/jboss-developer-shared-resources/blob/master/guides/USE_JBDS.md#use-jboss-developer-studio-or-eclipse-to-run-the-quickstarts)

Debug the Application
------------------------------------

If you want to debug the source code or look at the Javadocs of any library in the project, run either of the following commands to pull them into your local repository. The IDE should then detect them.

        mvn dependency:sources
        mvn dependency:resolve -Dclassifier=javadoc

Build and Deploy the Quickstart - to OpenShift
-------------------------

You can also deploy the application directly to OpenShift, Red Hat's cloud based PaaS offering, follow the instructions [here](https://community.jboss.org/wiki/DeployingHTML5ApplicationsToOpenshift)


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.Diagnostics;
using System.Threading;
using Microsoft.Research.Naiad.Dataflow.Channels;
using System.IO;
using System.Threading.Tasks;
using Microsoft.Research.Naiad.Scheduling;
using Microsoft.Research.Naiad.Runtime.Networking;

using Microsoft.Research.Naiad.Diagnostics;

namespace Microsoft.Research.Naiad.Runtime.Networking
{
    internal enum NaiadProtocolOpcode
    {
        InvalidOpcode = -1,
        PeerConnect = 0,
        ConstructGraph = 1,
        LoadDataFromFile = 2,
        GetIngressSocket = 3,
        GetEgressSocket = 4,
        GetComputationStats = 5,
        DoReport = 6,
        Kill = 7,
        List = 8,
        Complain = 9
    }

    internal class NaiadServer : IDisposable
    {
        private enum ServerState
        {
            Initalized,
            Started,
            Stopped
        }

        private ServerState state;

        private struct GuardedAction
        {
            public GuardedAction(Action<Socket> a, bool mustGuard)
            {
                Guard = new Task(() => { });
                if (!mustGuard)
                {
                    Guard.RunSynchronously();
                }
                Action = a;
            }

            public readonly Task Guard;
            public readonly Action<Socket> Action;
        }

        private readonly IPEndPoint endpoint;
        private readonly Socket listeningSocket;
        private readonly Dictionary<NaiadProtocolOpcode, GuardedAction> serverActions;
        private readonly Dictionary<int, TcpNetworkChannel> networkChannels;
        private readonly Thread servingThread;

        public NaiadServer(ref IPEndPoint endpoint)
        {
            this.serverActions = new Dictionary<NaiadProtocolOpcode, GuardedAction>();
            this.state = ServerState.Initalized;
            this.serverActions[NaiadProtocolOpcode.Kill] = new GuardedAction(s => { using (TextWriter writer = new StreamWriter(new NetworkStream(s))) writer.WriteLine("Killed"); s.Close(); System.Environment.Exit(-9); }, false);
            this.networkChannels = new Dictionary<int, TcpNetworkChannel>();
            this.serverActions[NaiadProtocolOpcode.PeerConnect] = new GuardedAction(s => { int channelId = ReceiveInt(s); this.networkChannels[channelId].PeerConnect(s); }, true);

            Socket socket = BindSocket(ref endpoint);

            this.endpoint = endpoint;
            this.listeningSocket = socket;

            this.servingThread = new Thread(this.ThreadStart);
        }

        public void RegisterNetworkChannel(TcpNetworkChannel channel)
        {
            if (channel != null)
                this.networkChannels[channel.Id] = channel;
        }

        /// <summary>
        /// Registers an Action that will be called when a connection is made with the given opcode.
        ///
        /// The Action receives the socket for the accepted connection, and is responsible for managing that
        /// resource by e.g. closing it.
        ///
        /// This method must be called before a call to Start();
        /// </summary>
        /// <param name="opcode">The opcode to handle.</param>
        /// <param name="serverAction">The Action to execute when this opcode is received.</param>
        /// <param name="mustGuard">If true, the execution will be guarded.</param>
        public void RegisterServerAction(NaiadProtocolOpcode opcode, Action<Socket> serverAction, bool mustGuard)
        {
            this.serverActions[opcode] = new GuardedAction(serverAction, mustGuard);
        }

        private Socket TryToBind(IPEndPoint endpoint)
        {
            Logging.Progress("Trying to bind Naiad server at {0}", endpoint);

            Socket s = new Socket(endpoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);

            try
            {
                s.Bind(endpoint);

                return s;
            }
            catch (SocketException e)
            {
                if (e.SocketErrorCode == SocketError.AddressAlreadyInUse)
                {
                    // another process has bound to this socket: we'll pick a different port and try
                    // again in the calling code
                    return null;
                }
                else
                {
                    // unexpected error so we'll just let someone else deal with it
                    throw;
                }
            }
        }

        /// <summary>
        /// Binds the server socket to an available port.
        /// </summary>
        /// <param name="endpoint">If this parameter is not null, try to listen on this endpoint, otherwise one will be picked arbitrarily.</param>
        /// <returns>The bound socket.</returns>
        private Socket BindSocket(ref IPEndPoint endpoint)
        {
            Socket socket = null;

            if (endpoint == null)
            {
                int port = 2101;
                for (int i = 0; socket == null && i < 1000; ++i)
                {
                    endpoint = new IPEndPoint(IPAddress.Any, port + i);
                    socket = TryToBind(endpoint);
                }
            }
            else
            {
                socket = TryToBind(endpoint);
            }

            if (socket == null)
            {
                throw new ApplicationException("Unable to find a socket to bind to");
            }

            Logging.Progress("Starting Naiad server at {0}", endpoint);

            return socket;
        }

        /// <summary>
        /// Starts the server accepting connections. To stop the server, call <see cref="Stop"/>.
        /// </summary>
        public void Start()
        {
            Debug.Assert(this.state == ServerState.Initalized);

            this.servingThread.Start();
        }

        /// <summary>
        /// Accept loop thread. Implements protocol operation demuxing, based on a 4-byte opcode, in the first 4 bytes received
        /// from the accept()'ed socket.
        /// </summary>
        private void ThreadStart()
        {
            this.state = ServerState.Started;

            this.listeningSocket.Listen(100);
            while (true)
            {
                Socket acceptedSocket;
                try
                {
                    acceptedSocket = this.listeningSocket.Accept();
                }
                catch (ObjectDisposedException)
                {
                    break;
                }
                catch (SocketException se)
                {
                    if (se.SocketErrorCode == SocketError.Interrupted)
                    {
                        break;
                    }
                    else
                    {
                        throw;
                    }
                }
                NaiadProtocolOpcode opcode = (NaiadProtocolOpcode) ReceiveInt(acceptedSocket);
                GuardedAction acceptAction;
                if (this.serverActions.TryGetValue(opcode, out acceptAction))
                {
                    // Ensures that the Action runs after the Guard task has run.
                    acceptAction.Guard.ContinueWith(
                        (task) => AcceptInternal(acceptAction.Action, acceptedSocket, opcode));
                }
                else
                {
                    Logging.Progress("Invalid/unhandled opcode received: {0}", opcode);
                    acceptedSocket.Close();
                }
            }
        }

        public void AcceptPeerConnections()
        {
            // Allows queued PeerConnect operations to continue.
            this.serverActions[NaiadProtocolOpcode.PeerConnect].Guard.RunSynchronously();
        }

        private void AcceptInternal(Action<Socket> action, Socket peerSocket, NaiadProtocolOpcode opcode)
        {
            try
            {
                action(peerSocket);
            }
            catch (Exception e)
            {
                Logging.Progress("Error handling a connection with opcode: {0}", opcode);
                Logging.Progress(e.ToString());
                peerSocket.Close();
            }
        }

        private static int ReceiveInt(Socket peerSocket)
        {
            byte[] intBuffer = new byte[4];
            int n = peerSocket.Receive(intBuffer);
            Debug.Assert(n == 4);
            return BitConverter.ToInt32(intBuffer, 0);
        }

        public void Stop()
        {
            Debug.Assert(this.state == ServerState.Started);
            this.listeningSocket.Close();
            this.servingThread.Join();
            this.state = ServerState.Stopped;
        }

        public void Dispose()
        {
            if (this.state == ServerState.Started)
                this.Stop();
            this.listeningSocket.Dispose();
        }
    }
}


text:
class AddDischargeReasonCodeToUKRDCTreatments < ActiveRecord::Migration[5.2]
  def change
    within_renalware_schema do
      add_column :ukrdc_treatments, :discharge_reason_code, :integer
      add_column :ukrdc_treatments, :discharge_reason_comment, :string
    end
  end
end


text:
<?php
namespace QuickBooksOnline\API\Data;

/**
 * @xmlNamespace http://schema.intuit.com/finance/v3
 * @xmlType
 * @xmlName IPPItemComponentLine
 * @var IPPItemComponentLine
 * @xmlDefinition
				Product: ALL
				Description: Constituent line of a
				group item.

 */
class IPPItemComponentLine
	{

		/**
		* Initializes this object, optionally with pre-defined property values
		*
		* Initializes this object and it's property members, using the dictionary
		* of key/value pairs passed as an optional argument.
		*
		* @param dictionary $keyValInitializers key/value pairs to be populated into object's properties
		* @param boolean $verbose specifies whether object should echo warnings
		*/
		public function __construct($keyValInitializers=array(), $verbose=FALSE)
		{
			foreach($keyValInitializers as $initPropName => $initPropVal)
			{
				if (property_exists('IPPItemComponentLine',$initPropName) || property_exists('QuickBooksOnline\API\Data\IPPItemComponentLine',$initPropName))
				{
					$this->{$initPropName} = $initPropVal;
				}
				else
				{
					if ($verbose)
						echo "Property does not exist ($initPropName) in class (".get_class($this).")";
				}
			}
		}

	/**
	 * @Definition
						Product: ALL
						Description: Reference to an Item. For an Assembly item, this must be a
						reference to an Inventory Item needed in the assembly.

	 * @xmlType element
	 * @xmlNamespace http://schema.intuit.com/finance/v3
	 * @xmlMinOccurs 0
	 * @xmlName ItemRef
	 * @var com\intuit\schema\finance\v3\IPPReferenceType
	 */
	public $ItemRef;
	/**
	 * @Definition
						Product: ALL
						Description: Quantity of items.

	 * @xmlType element
	 * @xmlNamespace http://schema.intuit.com/finance/v3
	 * @xmlMinOccurs 0
	 * @xmlName Qty
	 * @var float
	 */
	public $Qty;
	/**
	 * @Definition
						Product: ALL
						Description: Reference to the unit of measure (within UOMSetRef) for this line
						item. Examples: "each" or "box".

	 * @xmlType element
	 * @xmlNamespace http://schema.intuit.com/finance/v3
	 * @xmlMinOccurs 0
	 * @xmlName UOMRef
	 * @var com\intuit\schema\finance\v3\IPPUOMRef
	 */
	public $UOMRef;

} // end class IPPItemComponentLine


text:
package v1alpha1

import (
	"github.com/traefik/traefik/v2/pkg/config/dynamic"
	apiextensionv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/util/intstr"
)

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +kubebuilder:storageversion

// Middleware is the CRD implementation of a Traefik Middleware.
// More info: https://doc.traefik.io/traefik/v2.9/middlewares/http/overview/
type Middleware struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	metav1.ObjectMeta `json:"metadata"`

	Spec MiddlewareSpec `json:"spec"`
}

// +k8s:deepcopy-gen=true

// MiddlewareSpec defines the desired state of a Middleware.
type MiddlewareSpec struct {
	AddPrefix         *dynamic.AddPrefix         `json:"addPrefix,omitempty"`
	StripPrefix       *dynamic.StripPrefix       `json:"stripPrefix,omitempty"`
	StripPrefixRegex  *dynamic.StripPrefixRegex  `json:"stripPrefixRegex,omitempty"`
	ReplacePath       *dynamic.ReplacePath       `json:"replacePath,omitempty"`
	ReplacePathRegex  *dynamic.ReplacePathRegex  `json:"replacePathRegex,omitempty"`
	Chain             *Chain                     `json:"chain,omitempty"`
	IPAllowList       *dynamic.IPAllowList       `json:"ipAllowList,omitempty"`
	Headers           *dynamic.Headers           `json:"headers,omitempty"`
	Errors            *ErrorPage                 `json:"errors,omitempty"`
	RateLimit         *RateLimit                 `json:"rateLimit,omitempty"`
	RedirectRegex     *dynamic.RedirectRegex     `json:"redirectRegex,omitempty"`
	RedirectScheme    *dynamic.RedirectScheme    `json:"redirectScheme,omitempty"`
	BasicAuth         *BasicAuth                 `json:"basicAuth,omitempty"`
	DigestAuth        *DigestAuth                `json:"digestAuth,omitempty"`
	ForwardAuth       *ForwardAuth               `json:"forwardAuth,omitempty"`
	InFlightReq       *dynamic.InFlightReq       `json:"inFlightReq,omitempty"`
	Buffering         *dynamic.Buffering         `json:"buffering,omitempty"`
	CircuitBreaker    *CircuitBreaker            `json:"circuitBreaker,omitempty"`
	Compress          *dynamic.Compress          `json:"compress,omitempty"`
	PassTLSClientCert *dynamic.PassTLSClientCert `json:"passTLSClientCert,omitempty"`
	Retry             *Retry                     `json:"retry,omitempty"`
	ContentType       *dynamic.ContentType       `json:"contentType,omitempty"`
	GrpcWeb           *dynamic.GrpcWeb           `json:"grpcWeb,omitempty"`
	// Plugin defines the middleware plugin configuration.
	// More info: https://doc.traefik.io/traefik/plugins/
	Plugin map[string]apiextensionv1.JSON `json:"plugin,omitempty"`
}

// +k8s:deepcopy-gen=true

// ErrorPage holds the custom error middleware configuration.
// This middleware returns a custom page in lieu of the default, according to configured ranges of HTTP Status codes.
// More info: https://doc.traefik.io/traefik/v2.9/middlewares/http/errorpages/
type ErrorPage struct {
	// Status defines which status or range of statuses should result in an error page.
	// It can be either a status code as a number (500),
	// as multiple comma-separated numbers (500,502),
	// as ranges by separating two codes with a dash (500-599),
	// or a combination of the two (404,418,500-599).
	Status []string `json:"status,omitempty"`
	// Service defines the reference to a Kubernetes Service that will serve the error page.
	// More info: https://doc.traefik.io/traefik/v2.9/middlewares/http/errorpages/#service
	Service Service `json:"service,omitempty"`
	// Query defines the URL for the error page (hosted by service).
	// The {status} variable can be used in order to insert the status code in the URL.
	Query string `json:"query,omitempty"`
}

// +k8s:deepcopy-gen=true

// CircuitBreaker holds the circuit breaker configuration.
type CircuitBreaker struct {
	// Expression is the condition that triggers the tripped state.
	Expression string `json:"expression,omitempty" toml:"expression,omitempty" yaml:"expression,omitempty" export:"true"`
	// CheckPeriod is the interval between successive checks of the circuit breaker condition (when in standby state).
	CheckPeriod *intstr.IntOrString `json:"checkPeriod,omitempty" toml:"checkPeriod,omitempty" yaml:"checkPeriod,omitempty" export:"true"`
	// FallbackDuration is the duration for which the circuit breaker will wait before trying to recover (from a tripped state).
	FallbackDuration *intstr.IntOrString `json:"fallbackDuration,omitempty" toml:"fallbackDuration,omitempty" yaml:"fallbackDuration,omitempty" export:"true"`
	// RecoveryDuration is the duration for which the circuit breaker will try to recover (as soon as it is in recovering state).
	RecoveryDuration *intstr.IntOrString `json:"recoveryDuration,omitempty" toml:"recoveryDuration,omitempty" yaml:"recoveryDuration,omitempty" export:"true"`
}

// +k8s:deepcopy-gen=true

// Chain holds the configuration of the chain middleware.
// This middleware enables to define reusable combinations of other pieces of middleware.
// More info: https://doc.traefik.io/traefik/v2.9/middlewares/http/chain/
type Chain struct {
	// Middlewares is the list of MiddlewareRef which composes the chain.
	Middlewares []MiddlewareRef `json:"middlewares,omitempty"`
}

// +k8s:deepcopy-gen=true

// BasicAuth holds the basic auth middleware configuration.
// This middleware restricts access to your services to known users.
// More info: https://doc.traefik.io/traefik/v2.9/middlewares/http/basicauth/
type BasicAuth struct {
	// Secret is the name of the referenced Kubernetes Secret containing user credentials.
	Secret string `json:"secret,omitempty"`
	// Realm allows the protected resources on a server to be partitioned into a set of protection spaces, each with its own authentication scheme.
	// Default: traefik.
	Realm string `json:"realm,omitempty"`
	// RemoveHeader sets the removeHeader option to true to remove the authorization header before forwarding the request to your service.
	// Default: false.
	RemoveHeader bool `json:"removeHeader,omitempty"`
	// HeaderField defines a header field to store the authenticated user.
	// More info: https://doc.traefik.io/traefik/v2.9/middlewares/http/basicauth/#headerfield
	HeaderField string `json:"headerField,omitempty"`
}

// +k8s:deepcopy-gen=true

// DigestAuth holds the digest auth middleware configuration.
// This middleware restricts access to your services to known users.
// More info: https://doc.traefik.io/traefik/v2.9/middlewares/http/digestauth/
type DigestAuth struct {
	// Secret is the name of the referenced Kubernetes Secret containing user credentials.
	Secret string `json:"secret,omitempty"`
	// RemoveHeader defines whether to remove the authorization header before forwarding the request to the backend.
	RemoveHeader bool `json:"removeHeader,omitempty"`
	// Realm allows the protected resources on a server to be partitioned into a set of protection spaces, each with its own authentication scheme.
	// Default: traefik.
	Realm string `json:"realm,omitempty"`
	// HeaderField defines a header field to store the authenticated user.
	// More info: https://doc.traefik.io/traefik/v2.9/middlewares/http/basicauth/#headerfield
	HeaderField string `json:"headerField,omitempty"`
}

// +k8s:deepcopy-gen=true

// ForwardAuth holds the forward auth middleware configuration.
// This middleware delegates the request authentication to a Service.
// More info: https://doc.traefik.io/traefik/v2.9/middlewares/http/forwardauth/
type ForwardAuth struct {
	// Address defines the authentication server address.
	Address string `json:"address,omitempty"`
	// TrustForwardHeader defines whether to trust (ie: forward) all X-Forwarded-* headers.
	TrustForwardHeader bool `json:"trustForwardHeader,omitempty"`
	// AuthResponseHeaders defines the list of headers to copy from the authentication server response and set on forwarded request, replacing any existing conflicting headers.
	AuthResponseHeaders []string `json:"authResponseHeaders,omitempty"`
	// AuthResponseHeadersRegex defines the regex to match headers to copy from the authentication server response and set on forwarded request, after stripping all headers that match the regex.
	// More info: https://doc.traefik.io/traefik/v2.9/middlewares/http/forwardauth/#authresponseheadersregex
	AuthResponseHeadersRegex string `json:"authResponseHeadersRegex,omitempty"`
	// AuthRequestHeaders defines the list of the headers to copy from the request to the authentication server.
	// If not set or empty then all request headers are passed.
	AuthRequestHeaders []string `json:"authRequestHeaders,omitempty"`
	// TLS defines the configuration used to secure the connection to the authentication server.
	TLS *ClientTLS `json:"tls,omitempty"`
}

// ClientTLS holds the client TLS configuration.
type ClientTLS struct {
	// CASecret is the name of the referenced Kubernetes Secret containing the CA to validate the server certificate.
	// The CA certificate is extracted from key `tls.ca` or `ca.crt`.
	CASecret string `json:"caSecret,omitempty"`
	// CertSecret is the name of the referenced Kubernetes Secret containing the client certificate.
	// The client certificate is extracted from the keys `tls.crt` and `tls.key`.
	CertSecret string `json:"certSecret,omitempty"`
	// InsecureSkipVerify defines whether the server certificates should be validated.
	InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"`
}

// +k8s:deepcopy-gen=true

// RateLimit holds the rate limit configuration.
// This middleware ensures that services will receive a fair amount of requests, and allows one to define what fair is.
// More info: https://doc.traefik.io/traefik/v2.9/middlewares/http/ratelimit/
type RateLimit struct {
	// Average is the maximum rate, by default in requests/s, allowed for the given source.
	// It defaults to 0, which means no rate limiting.
	// The rate is actually defined by dividing Average by Period. So for a rate below 1req/s,
	// one needs to define a Period larger than a second.
	Average int64 `json:"average,omitempty"`
	// Period, in combination with Average, defines the actual maximum rate, such as:
	// r = Average / Period. It defaults to a second.
	Period *intstr.IntOrString `json:"period,omitempty"`
	// Burst is the maximum number of requests allowed to arrive in the same arbitrarily small period of time.
	// It defaults to 1.
	Burst *int64 `json:"burst,omitempty"`
	// SourceCriterion defines what criterion is used to group requests as originating from a common source.
	// If several strategies are defined at the same time, an error will be raised.
	// If none are set, the default is to use the request's remote address field (as an ipStrategy).
	SourceCriterion *dynamic.SourceCriterion `json:"sourceCriterion,omitempty"`
}

// +k8s:deepcopy-gen=true

// Retry holds the retry middleware configuration.
// This middleware reissues requests a given number of times to a backend server if that server does not reply.
// As soon as the server answers, the middleware stops retrying, regardless of the response status.
// More info: https://doc.traefik.io/traefik/v2.9/middlewares/http/retry/
type Retry struct {
	// Attempts defines how many times the request should be retried.
	Attempts int `json:"attempts,omitempty"`
	// InitialInterval defines the first wait time in the exponential backoff series.
	// The maximum interval is calculated as twice the initialInterval.
	// If unspecified, requests will be retried immediately.
	// The value of initialInterval should be provided in seconds or as a valid duration format,
	// see https://pkg.go.dev/time#ParseDuration.
	InitialInterval intstr.IntOrString `json:"initialInterval,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// MiddlewareList is a collection of Middleware resources.
type MiddlewareList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	metav1.ListMeta `json:"metadata"`

	// Items is the list of Middleware.
	Items []Middleware `json:"items"`
}


text:
Template.offlineForm.helpers({
	error() {
		return Template.instance().error.get();
	},
	messageSent() {
		return Template.instance().messageSent.get();
	},
	offlineSuccessMessage() {
		if (!_.isEmpty(this.offlineSuccessMessage)) {
			return this.offlineSuccessMessage.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1<br>$2');
		} else {
			return TAPi18n.__('Thanks_We_ll_get_back_to_you_soon');
		}
	}
});

Template.offlineForm.events({
	'submit form'(event, instance) {
		event.preventDefault();

		const form = event.currentTarget;

		const data = {
			name: form.elements['name'].value,
			email: form.elements['email'].value,
			message: form.elements['message'].value
		};

		if (!instance.validateForm(form)) {
			instance.showError(TAPi18n.__('You_must_complete_all_fields'));
			return;
		}

		instance.$('.send').attr('disabled', 'disabled');

		Meteor.call('livechat:sendOfflineMessage', data, (error) => {
			instance.$('.send').attr('disabled', null);

			if (error) {
				return instance.showError(error.reason);
			} else {
				instance.messageSent.set(true);
			}
		});
	}
});

Template.offlineForm.onCreated(function() {
	this.error = new ReactiveVar();
	this.messageSent = new ReactiveVar(false);

	this.validateForm = (form) => {
		let valid = true;

		const fields = ['name', 'email', 'message'];

		for (let i = 0; i < fields.length; i++) {
			$(form.elements[fields[i]]).removeClass('field-error');

			if (_.isEmpty(s.trim(form.elements[fields[i]].value))) {
				$(form.elements[fields[i]]).addClass('field-error');
				valid = false;
			}
		}

		return valid;
	};

	this.showError = (msg) => {
		$('.error').addClass('show');
		this.error.set(msg);
	};
	this.hideError = () => {
		$('.error').removeClass('show');
		this.error.set();
	};
});


text:
package com.twitter.finagle.mysql

import com.twitter.concurrent.AsyncQueue
import com.twitter.conversions.DurationOps._
import com.twitter.finagle.Stack
import com.twitter.finagle.mysql.transport.{Packet, MysqlBuf}
import com.twitter.finagle.transport.QueueTransport
import com.twitter.io.Buf
import com.twitter.util.{Await, Awaitable}
import org.scalatest.funsuite.AnyFunSuite

class ClientDispatcherTest extends AnyFunSuite {
  private[this] def await[T](t: Awaitable[T]): T = Await.result(t, 1.second)

  val params = Stack.Params.empty

  def newCtx = new {
    val clientq = new AsyncQueue[Packet]()
    val serverq = new AsyncQueue[Packet]()
    val trans = new QueueTransport[Packet, Packet](serverq, clientq)
    val service = new ClientDispatcher(trans, params)
  }

  val okPacket =
    Packet(1, Buf.ByteArray.Owned(Array[Byte](0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00)))

  test("serially dispatch requests") {
    val ctx = newCtx
    import ctx._
    val r1 = service(QueryRequest("SELECT 1"))
    val r2 = service(QueryRequest("SELECT 2"))
    val r3 = service(QueryRequest("SELECT 3"))
    assert(serverq.size == 1)
    clientq.offer(okPacket)
    assert(r1.isDefined)
    assert(!r2.isDefined)
    assert(!r3.isDefined)
  }

  test("decode OK packet") {
    val ctx = newCtx
    import ctx._
    val r = service(PingRequest)
    clientq.offer(okPacket)
    assert(await(r).isInstanceOf[OK])
    val okResult = await(r).asInstanceOf[OK]
    assert(okResult == OK.decode(okPacket))
  }

  test("decode Error packet as ServerError") {
    val ctx = newCtx
    import ctx._
    val message = "Unknown table 'q'"
    val size = 9 + message.size
    val bw = MysqlBuf.writer(new Array[Byte](size))
    bw.writeByte(0xff) // field count
    bw.writeShortLE(0x041b) //err no
    bw.writeBytes("#42S02".getBytes) // sqlstate
    bw.writeBytes(message.getBytes(MysqlCharset.defaultCharset.displayName))

    val errpacket = Packet(1, bw.owned())
    val expectedError = Error.decode(errpacket)

    val r = service(QueryRequest("SELECT * FROM q"))
    clientq.offer(errpacket)
    intercept[ServerError] {
      await(r)
    }
  }

  def createFields(numFields: Int): List[Field] = {
    val catalog = "def"
    val db = "database0"
    val table = "table0"

    def aux(len: Int): List[Field] = len match {
      case 0 => Nil
      case x =>
        val maxLen = 12
        val fieldName = "field" + len
        val f = Field(
          catalog,
          db,
          table,
          table,
          fieldName,
          fieldName,
          33.toShort,
          maxLen,
          Type.VarChar,
          0,
          0
        )
        f :: aux(len - 1)
    }
    aux(numFields)
  }

  def toPacket(f: Field): Packet = {
    def strLen(s: String) = MysqlBuf.sizeOfLen(s.length) + s.length

    val sizeOfField = (strLen(f.catalog) + strLen(f.db)
      + strLen(f.table) + strLen(f.origTable)
      + strLen(f.name) + strLen(f.origName) + 12)

    val bw = MysqlBuf.writer(new Array[Byte](sizeOfField))

    def writeString(s: String) = bw.writeLengthCodedString(s, MysqlCharset.defaultCharset)

    writeString(f.catalog)
    writeString(f.db)
    writeString(f.table)
    writeString(f.origTable)
    writeString(f.name)
    writeString(f.origName)
    bw.writeByte(0)
    bw.writeShortLE(f.charset)
    bw.writeIntLE(f.displayLength)
    bw.writeByte(f.fieldType)
    bw.writeShortLE(f.flags)
    bw.writeByte(f.decimals)
    Packet(0, bw.owned())
  }

  val numFields = 5
  val numRows = 3
  val headerPacket = Packet(0, Buf.ByteArray.Owned(Array(numFields.toByte)))
  val eof = Packet(0, Buf.ByteArray.Owned(Array[Byte](Packet.EofByte, 0x00, 0x00, 0x00, 0x00)))
  val fields = createFields(numFields)
  val fieldPackets = fields.map(toPacket)

  def rowPacket: Packet = {
    val valueSize = 7
    val bufferSize = numFields * valueSize
    val bw = MysqlBuf.writer(new Array[Byte](bufferSize))
    for (i <- 1 to numFields) {
      bw.writeLengthCodedString("value" + i, MysqlCharset.defaultCharset)
    }

    Packet(0, bw.owned())
  }

  val rowPackets = for (i <- 1 to numRows) yield rowPacket

  test("Decode a ResultSet") {
    val ctx = newCtx
    import ctx._
    val query = service(QueryRequest("SELECT 1 + 1"))
    clientq.offer(headerPacket)
    fieldPackets foreach { clientq.offer(_) }
    clientq.offer(eof)
    rowPackets foreach { clientq.offer(_) }
    clientq.offer(eof)
    assert(await(query).isInstanceOf[ResultSet])
    val rs = await(query).asInstanceOf[ResultSet]
    assert(rs.fields.size == numFields)
    assert(rs.rows.size == numRows)
  }

  def makePreparedHeader(numColumns: Int, numParams: Int) = {
    val bw = MysqlBuf.writer(new Array[Byte](12))
    bw.writeByte(0x00) // ok byte
    bw.writeIntLE(1) // stmt id
    bw.writeShortLE(numColumns)
    bw.writeShortLE(numParams)
    bw.writeByte(0x00) // reserved byte
    bw.writeShortLE(0x00) // warning count
    Packet(0, bw.owned())
  }

  test("Decode PreparedStatement numParams = 0, numCols = 0") {
    val ctx = newCtx
    import ctx._
    val query = service(PrepareRequest(""))
    clientq.offer(makePreparedHeader(0, 0))
    assert(await(query).isInstanceOf[PrepareOK])
    val res = await(query).asInstanceOf[PrepareOK]
    assert(res.numOfCols == 0)
    assert(res.numOfParams == 0)
  }

  test("Decode PreparedStatement numParams > 0, numCols > 0") {
    val ctx = newCtx
    import ctx._
    val query = service(PrepareRequest("SELECT name FROM t1 WHERE id IN (?, ?, ?, ?, ?)"))
    val numParams = numFields
    clientq.offer(makePreparedHeader(1, numParams))
    fieldPackets foreach { clientq.offer(_) }
    clientq.offer(eof)
    val cols = createFields(1)
    val colPackets = cols map { toPacket(_) }
    colPackets foreach { clientq.offer(_) }
    clientq.offer(eof)
    assert(await(query).isInstanceOf[PrepareOK])
    val res = await(query).asInstanceOf[PrepareOK]
    assert(res.numOfCols == 1)
    assert(res.numOfParams == numParams)
    assert(res.columns == cols.toList)
    assert(res.params == fields.toList)
  }

  test("CloseStatement satisfies rpc") {
    val ctx = newCtx
    import ctx._
    val stmtId = 5
    val query = service(CloseRequest(5))
    val sent = await(serverq.poll())
    val br = MysqlBuf.reader(sent.body)
    assert(br.readByte() == Command.COM_STMT_CLOSE)
    assert(br.readIntLE() == stmtId)
    // response should be synthesized
    val resp = await(query)
    assert(resp.isInstanceOf[OK])
  }

  test("LostSyncException closes the service") {
    val ctx = newCtx
    import ctx._
    // offer an ill-formed packet
    clientq.offer(Packet(0, Buf.ByteArray.Owned(Array[Byte]())))
    intercept[LostSyncException] { await(service(PingRequest)) }
    assert(!service.isAvailable)
    assert(trans.onClose.isDefined)
  }

}


text:
<resources>
    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>
    <dimen name="nav_drawer_width">260dp</dimen>
    <dimen name="tab_max_width">264dp</dimen>
    <dimen name="tab_padding_bottom">16dp</dimen>
    <dimen name="tab_label">14sp</dimen>
    <dimen name="left">30dp</dimen>
    <dimen name="top">20dp</dimen>
    <dimen name="custom_tab_layout_height">72dp</dimen>
    <dimen name="toolbar_elevation">4dp</dimen>
    <dimen name="navigation_drawer_width">320dp</dimen>
    <dimen name="material_drawer_padding_half">4dp</dimen>
    <dimen name="material_drawer_persistent_height">48dp</dimen>
    <dimen name="material_drawer_persistent_height_icon">32dp</dimen>
</resources>


text:
using System.Collections;
using System.Collections.Generic;
using Java.Util;
using Java.Lang;

namespace Dot42.Internal
{
    /// <summary>
    /// Wraps an <see cref="Array{E}"/> such that is can be used as <see cref="System.Collections.Generic.IEnumerator{T}"/>.
    /// </summary>
    [Include(TypeCondition = typeof(IEnumerable))]
    [Include(TypeCondition = typeof(IEnumerable<>))]
	internal class ArrayIEnumerator<T> : IEnumerator<T>
	{
        private readonly T[] array;
	    private int current;

        /// <summary>
        /// Default ctor
        /// </summary>
        public ArrayIEnumerator(T[] array)
        {
            this.array = array;
            Reset();
        }

        /// <summary>
        /// Cleanup
        /// </summary>
	    public void Dispose()
	    {
	    }

	    /// <summary>
	    /// Move to the next element.
	    /// </summary>
	    /// <returns>True on success.</returns>
	    public bool MoveNext()
	    {
            if (array.Length-1 == current) return false;

            current++;
	        return true;
	    }

	    /// <summary>
	    /// Move to initial position (before first element).
	    /// </summary>
	    public void Reset()
	    {
	        current = -1;
	    }

	    /// <summary>
	    /// Gets the current element in the sequence.
	    /// </summary>
	    public T Current
	    {
	        get { return current == -1? default(T) : array[current]; }
	    }

	    /// <summary>
	    /// Gets the current element in the sequence.
	    /// </summary>
	    object IEnumerator.Current
	    {
	        get { return Current; }
	    }
	}
}


text:
package org.omg.SecurityLevel2;

/**
* org/omg/SecurityLevel2/_AuditDecisionStub.java .
* Error reading Messages File.
* Error reading Messages File.
* Thursday, January 14, 2010 1:08:58 AM PST
*/

/* */
public class _AuditDecisionStub extends org.omg.CORBA.portable.ObjectImpl implements org.omg.SecurityLevel2.AuditDecision
{

  public boolean audit_needed (org.omg.Security.AuditEventType event_type, org.omg.Security.SelectorValue[] value_list)
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("audit_needed", true);
                org.omg.Security.AuditEventTypeHelper.write ($out, event_type);
                org.omg.Security.SelectorValueListHelper.write ($out, value_list);
                $in = _invoke ($out);
                boolean $result = $in.read_boolean ();
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return audit_needed (event_type, value_list        );
            } finally {
                _releaseReply ($in);
            }
  } // audit_needed

  public org.omg.SecurityLevel2.AuditChannel audit_channel ()
  {
            org.omg.CORBA.portable.InputStream $in = null;
            try {
                org.omg.CORBA.portable.OutputStream $out = _request ("_get_audit_channel", true);
                $in = _invoke ($out);
                org.omg.SecurityLevel2.AuditChannel $result = org.omg.SecurityLevel2.AuditChannelHelper.read ($in);
                return $result;
            } catch (org.omg.CORBA.portable.ApplicationException $ex) {
                $in = $ex.getInputStream ();
                String _id = $ex.getId ();
                throw new org.omg.CORBA.MARSHAL (_id);
            } catch (org.omg.CORBA.portable.RemarshalException $rm) {
                return audit_channel (        );
            } finally {
                _releaseReply ($in);
            }
  } // audit_channel

  // Type-specific CORBA::Object operations
  private static String[] __ids = {
    "IDL:SecurityLevel2/AuditDecision:1.0"};

  public String[] _ids ()
  {
    return (String[])__ids.clone ();
  }

  private void readObject (java.io.ObjectInputStream s) throws java.io.IOException
  {
     String str = s.readUTF ();
     String[] args = null;
     java.util.Properties props = null;
     org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init (args, props).string_to_object (str);
     org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)._get_delegate ();
     _set_delegate (delegate);
  }

  private void writeObject (java.io.ObjectOutputStream s) throws java.io.IOException
  {
     String[] args = null;
     java.util.Properties props = null;
     String str = org.omg.CORBA.ORB.init (args, props).object_to_string (this);
     s.writeUTF (str);
  }
} // class _AuditDecisionStub


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css" />

<link rel="stylesheet" type="text/css" href="../../css/vivian.css"/>
<link rel="stylesheet" type="text/css" href="../../datatable/css/jquery.dataTables.css"/>
<link rel="stylesheet" type="text/css" href="../../datatable/css/buttons.dataTables.css"/>
<link rel="stylesheet" type="text/css" href="../../datatable/css/dataTables.searchHighlight.css"/>

Print Page as PDF

<title  id="pageTitle">DBIA #4849 ICR (4849)</title>

DBIA #4849     ICR (4849)

Name
Value

NUMBER
4849

IA #
4849

FILE NUMBER
771

DATE CREATED
2006/04/20

CUSTODIAL PACKAGE
REGISTRATION

USAGE
Private

TYPE
Other

DBIC APPROVAL STATUS
APPROVED

NAME
DBIA #4849

GENERAL DESCRIPTION

For the PFSS project, which includes a number of VistA
application packages, structures are setup for HL7 communication between VistA
and an external COTS system for patient billing.

Most inbound HL7 messages are being received for processing by the
REGISTRATION package (DG), but two specific messages (ADT-A05 and ADT-A04)
must be processed only by the INTEGRATED BILLING package within the new IBB
module for PFSS.

The IBB receivers use four PROTOCOLS (file #101) in order to route the ADT-A05
and ADT-A04 to the processing routine.  Since the COTS system will only use
the HL7 APPLICATION PARAMETER (file #771) names setup for the DG application
in their MSH segments, the IBB Protocols must be pointed to these file #771
entries.

This IA allows the four IBB Protocols to utilize the DG Application Parameters
DGPFSS ADT RECV and DGPFSS ADT SENDING as follows:

NAME: IBB PFSS ADT-A04 CLIENT           TYPE: subscriber
RECEIVING APPLICATION: DGPFSS ADT RECV
EVENT TYPE: A04                       RESPONSE MESSAGE TYPE: ADT
PROCESSING ROUTINE: D A04^IBBAADTI    SENDING FACILITY REQUIRED?: NO
RECEIVING FACILITY REQUIRED?: NO

NAME: IBB PFSS ADT-A04 SERVER           ITEM TEXT: PFSS/IBB ADT-A04 Receiver
TYPE: event driver
SENDING APPLICATION: DGPFSS ADT SENDING
TRANSACTION MESSAGE TYPE: ADT         EVENT TYPE: A04
MESSAGE STRUCTURE: ACK                ACCEPT ACK CODE: AL
APPLICATION ACK TYPE: AL              VERSION ID: 2.4 SUBSCRIBERS: IBB PFSS
ADT-A04 CLIENT

NAME: IBB PFSS ADT-A05 CLIENT           TYPE: subscriber
RECEIVING APPLICATION: DGPFSS ADT RECV
EVENT TYPE: A05                       RESPONSE MESSAGE TYPE: ADT
PROCESSING ROUTINE: D A05^IBBAADTI    SENDING FACILITY REQUIRED?: NO
RECEIVING FACILITY REQUIRED?: NO

NAME: IBB PFSS ADT-A05 SERVER           ITEM TEXT: PFSS/IBB ADT-A05 Receiver
TYPE: event driver
SENDING APPLICATION: DGPFSS ADT SENDING
TRANSACTION MESSAGE TYPE: ADT         EVENT TYPE: A05
ACCEPT ACK CODE: AL                   APPLICATION ACK TYPE: AL
VERSION ID: 2.4

VIEWER

KOPECKY,STEPHEN C

FAIN,ZACHARY

STATUS
Active

KEYWORDS

PFSS

HL7

PROTOCOLS

DURATION
Till Otherwise Agreed

SUBSCRIBING PACKAGE

SUBSCRIBING PACKAGE
SUBSCRIBING DETAILS

INTEGRATED BILLING

Four PROTOCOL file (#101) entries setup by IBB for PFSS
processing of inbound ADT-A05 and ADT-A04 messages will utilize HL7
APPLICATION PARAMETER file (#771) entries in the DG namespace that are
intended for use exclusively by the PFSS project.

The PROTOCOL file entries for IB are:

NAME: IBB PFSS ADT-A04 CLIENT           TYPE: subscriber
RECEIVING APPLICATION: DGPFSS ADT RECV
EVENT TYPE: A04                       RESPONSE MESSAGE TYPE: ADT
PROCESSING ROUTINE: D A04^IBBAADTI    SENDING FACILITY REQUIRED?: NO
RECEIVING FACILITY REQUIRED?: NO

NAME: IBB PFSS ADT-A04 SERVER           ITEM TEXT: PFSS/IBB ADT-A04 Receiver
TYPE: event driver
SENDING APPLICATION: DGPFSS ADT SENDING
TRANSACTION MESSAGE TYPE: ADT         EVENT TYPE: A04
MESSAGE STRUCTURE: ACK                ACCEPT ACK CODE: AL
APPLICATION ACK TYPE: AL              VERSION ID: 2.4 SUBSCRIBERS: IBB PFSS
ADT-A04 CLIENT

NAME: IBB PFSS ADT-A05 CLIENT           TYPE: subscriber
RECEIVING APPLICATION: DGPFSS ADT RECV
EVENT TYPE: A05                       RESPONSE MESSAGE TYPE: ADT
PROCESSING ROUTINE: D A05^IBBAADTI    SENDING FACILITY REQUIRED?: NO
RECEIVING FACILITY REQUIRED?: NO

NAME: IBB PFSS ADT-A05 SERVER           ITEM TEXT: PFSS/IBB ADT-A05 Receiver
TYPE: event driver
SENDING APPLICATION: DGPFSS ADT SENDING
TRANSACTION MESSAGE TYPE: ADT         EVENT TYPE: A05
ACCEPT ACK CODE: AL                   APPLICATION ACK TYPE: AL
VERSION ID: 2.4

EDITOR

PAJERSKI,JAN

MAIL MESSAGE
42863544

Generated from JAN 29,2016 IA Listing Descriptions


text:
package com.nowellpoint.api.model.document;

import com.nowellpoint.mongodb.annotation.Document;
import com.nowellpoint.mongodb.annotation.Reference;
import com.nowellpoint.mongodb.document.MongoDocument;

@Document(collectionName="leads")
public class Lead extends MongoDocument {

	private static final long serialVersionUID = 7199045654991076942L;

	@Reference(referenceClass = UserProfile.class)
	private UserRef createdBy;

	@Reference(referenceClass = UserProfile.class)
	private UserRef lastUpdatedBy;

	private String firstName;

	private String lastName;

	private String email;

	private String mobilePhone;

	private String phone;

	private String company;

	private String title;

	private String street;

	private String city;

	private String state;

	private String postalCode;

	private String countryCode;

	private String description;

	private String status;

	private String leadSource;

	public Lead() {

	}

	public UserRef getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(UserRef createdBy) {
		this.createdBy = createdBy;
	}

	public UserRef getLastUpdatedBy() {
		return lastUpdatedBy;
	}

	public void setLastUpdatedBy(UserRef lastUpdatedBy) {
		this.lastUpdatedBy = lastUpdatedBy;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getMobilePhone() {
		return mobilePhone;
	}

	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getStreet() {
		return street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getPostalCode() {
		return postalCode;
	}

	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	public String getCountryCode() {
		return countryCode;
	}

	public void setCountryCode(String countryCode) {
		this.countryCode = countryCode;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getLeadSource() {
		return leadSource;
	}

	public void setLeadSource(String leadSource) {
		this.leadSource = leadSource;
	}
}


text:
package org.apache.calcite.interpreter;

/**
 * Source of rows.
 *
 * <p>Corresponds to an input of a relational expression.
 */
public interface Source extends AutoCloseable {
  /** Reads a row. Null means end of data. */
  Row receive();

  void close();
}

// End Source.java


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Xerces-C++: StdOutFormatTarget.hpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">

Main Page

Related Pages

Classes

Files

StdOutFormatTarget.hpp
Go to the documentation of this file.

00001
00017
00018 /*
00019  * $Id: StdOutFormatTarget.hpp 553937 2007-07-06 16:02:19Z amassari $
00020  */
00021
00022 #if !defined(XERCESC_INCLUDE_GUARD_STDOUTFORMATTARGET_HPP)
00023 #define XERCESC_INCLUDE_GUARD_STDOUTFORMATTARGET_HPP
00024
00025 #include <xercesc/framework/XMLFormatter.hpp>
00026
00027 XERCES_CPP_NAMESPACE_BEGIN
00028
00029 class XMLPARSER_EXPORT StdOutFormatTarget : public XMLFormatTarget {
00030 public:
00031
00034     StdOutFormatTarget() ;
00035     ~StdOutFormatTarget();
00037
00038     // -----------------------------------------------------------------------
00039     //  Implementations of the format target interface
00040     // -----------------------------------------------------------------------
00041     virtual void writeChars(const XMLByte* const toWrite
00042                           , const XMLSize_t      count
00043                           , XMLFormatter* const  formatter);
00044
00045     virtual void flush();
00046
00047 private:
00048     // -----------------------------------------------------------------------
00049     //  Unimplemented methods.
00050     // -----------------------------------------------------------------------
00051     StdOutFormatTarget(const StdOutFormatTarget&);
00052     StdOutFormatTarget& operator=(const StdOutFormatTarget&);
00053 };
00054
00055 XERCES_CPP_NAMESPACE_END
00056
00057 #endif

<address style="text-align: right;">Generated on Wed Apr 21 17:55:48 2010 for Xerces-C++ by

 1.5.6 </address>


text:
namespace FreeDB.Core.Model
{
    using Bases;

    public class Artist : PersistentObject<int>
    {
        public virtual string Name { get; set; }
    }
}


text:
import { NgModule } from '@angular/core';

//Components
import { FgenComponent } from './function-gen.component';
import { SharedModule } from '../../app/shared/shared.module';
import { IonicModule } from 'ionic-angular';

/**
 * Note(andrew): Because the FgenComponent is used in more than two places (logger & instrument pages)
 * and isn't imported in the AppModule, it needs its own module that gets imported where needed
 */
@NgModule({
    imports: [
        SharedModule,
        IonicModule.forRoot(FgenComponent),
    ],
    declarations: [
        FgenComponent
    ],
    exports: [FgenComponent],
    providers: [
    ]
})
export class FGenModule { }


text:
class TokyoMetro::Factory::Generate::Static::MetaClass::Group::MultipleYamls < TokyoMetro::Factory::Generate::Static::MetaClass::Group::Fundamental::FromHash

  # Constructor
  def initialize( files )
    @files = files
  end

  # YAML ファイルからインスタンスを生成するためのインスタンスメソッド
  # @return [subclass of Hash]
  def generate
    if TO_INSPECT
      inspect_title
    end

    h_new = self.class.hash_class_for_this_factory.new
    h_new = generating_procedure( h_new )
    h_new
  end

  def inspect_title
    puts "● #{self.class.name}"
    puts " " * 4 + "< TokyoMetro::Factory::Generate::Static::MetaClass::Group::MultipleYamls"
    puts ""
  end

  undef :inspect_title_top

  private

  # YAML ファイルからインスタンスを生成する際のロジック
  # @return [Proc]
  def generating_procedure( h_new )
    @files.each do | file |
      hash_sub = self.class.factory_for_generating_from_each_saved_file.from_yaml( file )
      h_new = h_new.merge( hash_sub )
    end
    h_new
  end

  # @note ロジックは {TokyoMetro::Factory::Generate::Static::MetaClass::Group::Fundamental::FromHash.from_yamls} とほとんど同じだが、デフォルトのファイルがリスト(配列)であることに注意
  def self.from_yamls( files = nil )
    if files.nil?
      files = yaml_files
    end
    self.new( files ).generate
  end

  class << self
    undef :from_yaml
    undef :yaml_file
  end

end


text:
package com.google.apphosting.runtime.grpc;

import com.google.apphosting.base.protos.AppinfoPb;
import com.google.apphosting.base.protos.CloneControllerGrpc.CloneControllerImplBase;
import com.google.apphosting.base.protos.ClonePb;
import com.google.apphosting.base.protos.ClonePb.DebuggeeInfoRequest;
import com.google.apphosting.base.protos.ClonePb.DebuggeeInfoResponse;
import com.google.apphosting.base.protos.EmptyMessage;
import com.google.apphosting.base.protos.EvaluationRuntimeGrpc.EvaluationRuntimeImplBase;
import com.google.apphosting.base.protos.ModelClonePb;
import com.google.apphosting.base.protos.RuntimePb;
import com.google.apphosting.runtime.anyrpc.AnyRpcPlugin;
import com.google.apphosting.runtime.anyrpc.CloneControllerServerInterface;
import com.google.apphosting.runtime.anyrpc.EvaluationRuntimeServerInterface;
import com.google.common.base.Preconditions;
import io.grpc.ForwardingServerCallListener.SimpleForwardingServerCallListener;
import io.grpc.Metadata;
import io.grpc.Server;
import io.grpc.ServerCall;
import io.grpc.ServerCallHandler;
import io.grpc.ServerInterceptor;
import io.grpc.ServerInterceptors;
import io.grpc.ServerServiceDefinition;
import io.grpc.Status;
import io.grpc.StatusRuntimeException;
import io.grpc.netty.NettyServerBuilder;
import io.grpc.stub.StreamObserver;
import java.io.IOException;
import java.util.Optional;

/**
 * RPC plugin for gRPC.
 *
 */
public class GrpcPlugin extends AnyRpcPlugin {
  private static final int MAX_REQUEST_BODY_SIZE = 50 * 1024 * 1024; // 50 MB

  private Optional<Integer> optionalServerPort = Optional.empty();
  private Server server;

  public GrpcPlugin() {}

  @Override
  public void initialize(int serverPort) {
    if (serverPort != 0) {
      Preconditions.checkArgument(serverPort > 0, "Server port cannot be negative: %s", serverPort);
      this.optionalServerPort = Optional.of(serverPort);
    }
  }

  @Override
  public void startServer(
      EvaluationRuntimeServerInterface evaluationRuntime,
      CloneControllerServerInterface cloneController) {
    if (!optionalServerPort.isPresent()) {
      throw new IllegalStateException("No server port has been specified");
    }
    EvaluationRuntimeImplBase evaluationRuntimeServer =
        new EvaluationRuntimeServer(evaluationRuntime);
    CloneControllerImplBase cloneControllerServer = new CloneControllerServer(cloneController);
    ServerInterceptor exceptionInterceptor = new ExceptionInterceptor();
    ServerServiceDefinition evaluationRuntimeService =
        ServerInterceptors.intercept(evaluationRuntimeServer, exceptionInterceptor);
    ServerServiceDefinition cloneControllerService =
        ServerInterceptors.intercept(cloneControllerServer, exceptionInterceptor);
    server =
        NettyServerBuilder.forPort(optionalServerPort.get())
            .maxInboundMessageSize(MAX_REQUEST_BODY_SIZE)
            .addService(evaluationRuntimeService)
            .addService(cloneControllerService)
            .build();
    try {
      server.start();
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }

  public int getServerPort() {
    return optionalServerPort.get();
  }

  @Override
  public boolean serverStarted() {
    return server != null && !server.isShutdown() && !server.isTerminated();
  }

  @Override
  public void blockUntilShutdown() {
    try {
      server.awaitTermination();
    } catch (InterruptedException e) {
      throw new RuntimeException(e);
    }
  }

  @Override
  public void stopServer() {
    if (serverStarted()) {
      server.shutdown();
    }
  }

  @Override
  public void shutdown() {
    stopServer();
  }

  @Override
  public Runnable traceContextPropagating(Runnable runnable) {
    // TODO: Figure out how to do trace context propagation with gRPC.
    return runnable;
  }

  private static class EmptyGrpcServerContext extends GrpcServerContext<EmptyMessage> {
    EmptyGrpcServerContext(StreamObserver<EmptyMessage> streamObserver) {
      super(EmptyMessage.class, streamObserver);
    }
  }

  /**
   * Derive a {@link Status} from the given exception. If the exception is a
   * {@link StatusRuntimeException}, this method returns its contained
   * {@code Status}. Otherwise, it returns a {@link Status#INTERNAL} whose description includes
   * information about the exception. Currently this information is the exception's
   * {@code toString()} plus the first line of its stack trace.
   */
  private static Status statusFromException(RuntimeException e) {
    if (e instanceof StatusRuntimeException) {
      return ((StatusRuntimeException) e).getStatus();
    } else {
      String description = e.toString();
      StackTraceElement[] stack = e.getStackTrace();
      if (stack.length > 0) {
        description += ", at " + stack[0];
      }
      return Status.INTERNAL.withDescription(description).withCause(e);
    }
  }

  /**
   * Interceptor that catches exceptions while handling an operation. The exception causes the
   * call to be closed with an error status that includes information about the exception. This
   * interceptor is not designed to be used with streaming calls: in the simple request/response
   * calls that we currently have, the logic for handling an operation is triggered at the
   * "half-close" stage of the call, so catching the exception there is enough.
   *
   * <p>Interception is a little bit tricky. The original call handler can be wrapped by one or
   * more interceptors, making a chain. When a call arrives on the service, the first interceptor
   * in the chain (the outermost one in the wrapping) is asked to return a ServerCall.Listener that
   * will be informed of the various stages of the call. It is expected to call the next interceptor
   * in the chain and get back that interceptor's listener. It can then either return that listener
   * or wrap it in its own listener. So a chain of wrapped interceptors produces a chain of wrapped
   * listeners every time there is a call. Then the listeners are invoked as the stages of the call
   * proceed. Like the interceptors, each listener is expected to forward to its wrapped listener
   * in the usual case, and perform whatever extra logic it might need before and/or after that
   * forwarding.
   */
  private static class ExceptionInterceptor implements ServerInterceptor {
    @Override
    public <RequestT, ResponseT> ServerCall.Listener<RequestT> interceptCall(
        final ServerCall<RequestT, ResponseT> call,
        Metadata metadata,
        ServerCallHandler<RequestT, ResponseT> next) {
      ServerCall.Listener<RequestT> nextListener = next.startCall(call, metadata);
      return new SimpleForwardingServerCallListener<RequestT>(nextListener) {
        @Override
        public void onHalfClose() {
          try {
            super.onHalfClose();
          } catch (RuntimeException e) {
            call.close(statusFromException(e), new Metadata());
          }
        }
      };
    }
  }

  private static class EvaluationRuntimeServer extends EvaluationRuntimeImplBase {
    private final EvaluationRuntimeServerInterface evaluationRuntime;

    EvaluationRuntimeServer(EvaluationRuntimeServerInterface evaluationRuntime) {
      this.evaluationRuntime = evaluationRuntime;
    }

    @Override
    public void handleRequest(
        RuntimePb.UPRequest request,
        StreamObserver<RuntimePb.UPResponse> streamObserver) {
      GrpcServerContext<RuntimePb.UPResponse> serverContext =
          new GrpcServerContext<>(RuntimePb.UPResponse.class, streamObserver);
      evaluationRuntime.handleRequest(serverContext, request);
    }

    @Override
    public void addAppVersion(
        AppinfoPb.AppInfo appInfo,
        StreamObserver<EmptyMessage> streamObserver) {
      evaluationRuntime.addAppVersion(new EmptyGrpcServerContext(streamObserver), appInfo);
    }

    @Override
    public void deleteAppVersion(
        AppinfoPb.AppInfo appInfo,
        StreamObserver<EmptyMessage> streamObserver) {
      evaluationRuntime.deleteAppVersion(new EmptyGrpcServerContext(streamObserver), appInfo);
    }
  }

  private static class CloneControllerServer extends CloneControllerImplBase {
    private final CloneControllerServerInterface cloneController;

    CloneControllerServer(CloneControllerServerInterface cloneController) {
      this.cloneController = cloneController;
    }

    @Override
    public void waitForSandbox(
        EmptyMessage emptyMessage, StreamObserver<EmptyMessage> streamObserver) {
      cloneController.waitForSandbox(
          new EmptyGrpcServerContext(streamObserver), EmptyMessage.getDefaultInstance());
    }

    @Override
    public void applyCloneSettings(
        ClonePb.CloneSettings cloneSettings, StreamObserver<EmptyMessage> streamObserver) {
      cloneController.applyCloneSettings(
          new EmptyGrpcServerContext(streamObserver), cloneSettings);
    }

    @Override
    public void sendDeadline(
        ModelClonePb.DeadlineInfo deadlineInfo, StreamObserver<EmptyMessage> streamObserver) {
      cloneController.sendDeadline(new EmptyGrpcServerContext(streamObserver), deadlineInfo);
    }

    @Override
    public void getPerformanceData(
        ModelClonePb.PerformanceDataRequest request,
        StreamObserver<ClonePb.PerformanceData> streamObserver) {
      GrpcServerContext<ClonePb.PerformanceData> serverContext =
          new GrpcServerContext<>(ClonePb.PerformanceData.class, streamObserver);
      cloneController.getPerformanceData(serverContext, request);
    }

    @Override
    public void updateActiveBreakpoints(
        ClonePb.CloudDebuggerBreakpoints cloudDebuggerBreakpoints,
        StreamObserver<ClonePb.CloudDebuggerBreakpoints> streamObserver) {
      GrpcServerContext<ClonePb.CloudDebuggerBreakpoints> serverContext =
          new GrpcServerContext<>(ClonePb.CloudDebuggerBreakpoints.class, streamObserver);
      cloneController.updateActiveBreakpoints(serverContext, cloudDebuggerBreakpoints);
    }

    @Override
    public void getDebuggeeInfo(
        DebuggeeInfoRequest request, StreamObserver<DebuggeeInfoResponse> streamObserver) {
      GrpcServerContext<ClonePb.DebuggeeInfoResponse> serverContext =
          new GrpcServerContext<>(ClonePb.DebuggeeInfoResponse.class, streamObserver);
      cloneController.getDebuggeeInfo(serverContext, request);
    }
  }
}


text:
/**
 *
 */
/**
 * @author sergioc
 *
 */
package org.jconverter.converter.catalog.string;


text:
set -e
set -u
set -o pipefail

usage="$(basename "$0") [-h] [examples branch] [framework branch]  [unpacker branch] - program to install -pet framework

where:
    examples branch framework branch and unpacker branch are optional arguments
    that allow to choose specific branch. The default value is master.
    -h  shows help.

    Example: ./get-me-a-jpet-framework.sh develop develop master
    It will launch the installation for the following setup:
    j-pet-framework-examples: develop
    j-pet-framework: develop
    unpacker:master
    "

if [ "$1" == "-h" ]; then
  echo "$usage"
  exit 0
fi

examples_branch="${1:-master}"
framework_branch="${2:-master}"
unpacker_branch="${3:-master}"

initial_location=`pwd`
trap "cd $initial_location" EXIT

let n_cpus=`getconf _NPROCESSORS_ONLN`/2
echo "The compilation will be parallelized using $n_cpus cores."

mkdir framework-bin
root_dir="$initial_location/framework-bin"
cd framework-bin/

mkdir unpacker
mkdir unpacker-build
mkdir core
mkdir core-build
mkdir examples

git clone --recurse-submodules https://github.com/JPETTomography/Unpacker2.git -b $unpacker_branch
git clone --recurse-submodules https://github.com/JPETTomography/j-pet-framework.git -b $framework_branch
git clone --recurse-submodules https://github.com/JPETTomography/j-pet-framework-examples.git -b $examples_branch

cd $root_dir/unpacker-build

cmake ../Unpacker2 -DCMAKE_INSTALL_PREFIX=$root_dir/unpacker
make -j $n_cpus
make install

cd $root_dir/core-build

cmake ../j-pet-framework -DCMAKE_PREFIX_PATH=$root_dir/unpacker -DCMAKE_INSTALL_PREFIX=$root_dir/core
make -j $n_cpus
make install

cd $root_dir/examples

source $root_dir/core/bin/thisframework.sh
cmake ../j-pet-framework-examples -DCMAKE_INSTALL_PREFIX=`pwd`/../examples
make -j $n_cpus

cd $initial_location


text:
Timeout::Extensions
===================

[![Gem Version](https://badge.fury.io/rb/timeout-extensions.svg)](http://rubygems.org/gems/timeout-extensions)
[![Build Status](https://secure.travis-ci.org/celluloid/timeout-extensions.svg?branch=master)](http://travis-ci.org/celluloid/timeout-extensions)
[![Code Climate](https://codeclimate.com/github/celluloid/timeout-extensions.svg)](https://codeclimate.com/github/celluloid/timeout-extensions)

The Timeout::Extensions Gem augments Ruby's `timeout.rb` API with support for
multiple timeout backends which can be mixed and matched within a single app.

It supports pluggable timeout implementations which can selectively hook
into multiple backend schedulers rather than resorting to running code in a
separate thread to implement timeouts when there's a better backend available.

## Installation

Add this line to your application's Gemfile:

    gem 'timeout-extensions'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install timeout-extensions

## Usage

The Timeout::Extensions gem enhances the Ruby standard library's
`timeout.rb` API:

```ruby
require 'timeout'

Timeout.timeout(30) do
  # Times out after 30 seconds raising Timeout::Error
end
```

However, where `timeout.rb` provides one implementation, the Timeout Gem
provides support for multiple, swappable backends:

```ruby
# examples/even_odd.rb
require "timeout/extensions"

module MyAwesomeJob
  def self.perform
    timeout(5) do
      sleep 5 # perform incredibly heavy job
    end
  rescue => e
    puts "job failed: #{e.message}"
  end
end

module MyOwnTimeout
  CustomTimeoutError = Class.new(RuntimeError)
  def self.call(sec, *)
    puts "pretending to wait for #{sec} seconds..."
    yield
  end
end

5.times.map do |i|
  Thread.start do
    Thread.current.timeout_handler = MyOwnTimeout
    MyAwesomeJob.perform
  end
end.join(&:join)
__END__

pretending to wait for 2 seconds...
pretending to wait for 2 seconds...
job failed: execution expired
job failed: execution expired
job failed: execution expired

```

You can also setup a timeout backend temporarily, for the duration of a block:

```ruby
Timeout.backend(MyTimeoutThingy) do
  Timeout.timeout(30) do
    # Manage timeouts with MyTimeoutThingy instead of timeout.rb
    # MyTimeoutThingy just responds to #call(sec, ex)
    # Plug in your own backend just this easily!
  end
end
```

This library also supports setting your own sleep implementation:

```ruby

Thread.start do
  Thread.current.sleep_handler = YourSleepHandler # must also respond to #call(Integer or nil)
....
```

## Celluloid Support

This gem provides celluloid support out of the box.

Celluloid has its own actor timeout and sleep methods, which are implemented using the ```timer``` gem and do not block its mailbox. These have to be called inside your celluloid actor context however, thereby limiting the scope of your code:

```ruby
# examples/celluloid.rb
require "celluloid"

module MyJob
  def self.perform
    puts "performing"
    sleep 5
    puts "performed!"
  end
end

class Worker
  include Celluloid

  def develop
    MyJob.perform
  end

  def ten_times_developer
    10.times.each { async(:develop) }
  end
end

Worker.new.async(:ten_times_developer)

sleep
__END__
performing
performed!
performing
performed!
performing
performed!
performing
performed!
performing
performed!
...
```

But if your had the extension in the first line:
```
require 'timeout/extensions/celluloid'
....
__END__
performing
performing
performing
performing
performing
performing
performing
performing
performing
performing
performed!
performed!
performed!
performed!
performed!
....
```

## Supported Ruby Versions

This library aims to support and is [tested against][travis] the following Ruby
versions:

* Ruby 2.1
* Ruby 2.2
* Ruby 2.3
* JRuby 9.1

If something doesn't work on one of these versions, it's a bug.

# Contributing

* Fork this repository on github
* Make your changes and send us a pull request
* If we like them we'll merge them
* If we've accepted a patch, feel free to ask for commit access

# License

Copyright (c) 2014-2016 Tony Arcieri, Tiago Cardoso
Distributed under the MIT License. See LICENSE.txt for further details.


text:
---
uid: SolidEdgePart.Study.SetResultOptions(System.UInt32)
summary:
remarks: While creating a study we can set various results options on NASTRAN solver. Results options
      determine what all results we want from the solver. E.g. If we are only interested in displacement results then we
      can set below option.
example: [*content]
---
[!code-vb[Main](..\snippets\SolidEdgePart.Study.SetResultOptions.vb]
[!code-csharp[Main](..\snippets\SolidEdgePart.Study.SetResultOptions.cs]


text:
package org.teatrove.teaapps.contexts;

import org.teatrove.trove.log.Log;
import org.teatrove.trove.util.Utils;

import org.teatrove.teaapps.Context;
import org.teatrove.teaapps.ContextConfig;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.Reader;
import java.io.RandomAccessFile;

/**
 * Custom tea context that provides access to the local file system including
 * reading, writing, moving, deleting, etc.
 *
 * @author Scott Jappinen
 */
public class FileSystemContext implements Context {

    private Log mLog;

    /**
     * Initialize the context with the given configuration.
     *
     * @param config  The configuration to initialize with
     */
    public void init(ContextConfig config) {
        mLog = config.getLog();
    }

    /**
     * Delete the file at the given path.
     *
     * @param filePath The path of the file to delete
     *
     * @return true if the file was deleted,
     *         false otherwise
     *
     * @throws IOException if the file does not exist, cannot be written,
     *         or if an error occurs during deletion
     */
    public boolean deleteFile(String filePath) throws IOException {
        boolean result = false;
        // synchronized on an interned string makes has all the
        // makings for exclusive write access as far as this
        // process is concerned.
        String path = (String) Utils.intern(filePath);
        synchronized (path) {
            File file = null;
            try {
                file = new File(path);
                if (file.exists()) {
                    if (file.canWrite()) {
                        result = file.delete();
                    } else {
                        String msg =
                            "Can not delete write locked file (" + filePath + ")";

                        mLog.warn(msg);
                        throw new IOException(msg);
                    }
                } else {
                    String msg =
                        "Cannot delete non-existant file (" + filePath + ")";

                    mLog.warn(msg);
                    throw new IOException(msg);
                }
            } catch (IOException e) {
                mLog.error("Error deleting: " + filePath);
                mLog.error(e);
                throw e;
            }
        }
        return result;
    }

    /**
     * Move the file referenced by the srcPath to the dstPath. This will cause
     * the dstPath file to be overwritten if it already exists. If the srcPath
     * does not exist, or the dstPath cannot be written to, or an error occurs
     * during moving, then an {@link IOException} is thrown.
     *
     * @param srcPath The path of the file to move
     * @param dstPath The path to move the file to
     *
     * @return true if the file was properly moved,
     *         false otherwise
     *
     * @throws IOException if an error occurs moving the file
     */
    public boolean moveFile(String srcPath, String dstPath)
        throws IOException {

		return moveFile(srcPath, dstPath, true);
	}

    /**
     * Move the file referenced by the srcPath to the dstPath. If the overwrite
     * flag is truethis will cause the dstPath file to be
     * overwritten if it already exists. If the srcPath does not exist, the
     * dstPath cannot be written to, the overwrite flag was false
     * and the dstPath already exists, or an error occurs
     * during moving, then an {@link IOException} is thrown.
     *
     * @param srcPath The path of the file to move
     * @param dstPath The path to move the file to
     * @param overwrite Whether to overwrite the dstPath or not
     *
     * @return true if the file was properly moved,
     *         false otherwise
     *
     * @throws IOException if an error occurs moving the file
     */
    public boolean moveFile(String srcPath, String dstPath, boolean overwrite)
        throws IOException {

		boolean result = false;
		srcPath = (String) Utils.intern(srcPath);
		dstPath = (String) Utils.intern(dstPath);

		// synchronized on an interned strings makes has all the
		// makings for exclusive write access as far as this
		// process is concerned.

		try {
			synchronized (srcPath) {
				File srcFile = new File(srcPath);
				if (!srcFile.exists()) {
					String message =
					    "Cannot move non-existant file (" + srcPath + ")";
					mLog.warn(message);
					throw new IOException(message);
				}
				File dstFile = new File(dstPath);
				synchronized (dstPath) {
					if (dstFile.exists() && !overwrite) {
						String message =
						    "Destination file already exists (" + dstPath + ")";
						mLog.warn(message);
						throw new IOException(message);
					}
					if (dstFile.exists() && !dstFile.canWrite()) {
						String message =
						    "Can not overwrite write locked file (" + dstPath + ")";
						mLog.warn(message);
						throw new IOException(message);
					}
					result = srcFile.renameTo(dstFile);
				}
			}
		}
		catch (IOException e) {
			mLog.error("Error moving from: " + srcPath + " to " + dstPath);
			mLog.error(e);
			throw e;
		}
		return result;
    }

    /**
     * Get the file at the given file path.
     *
     * @param filePath The path of the file
     *
     * @return The file for the associated file path
     */
    public File getFile(String filePath) {
        return new File(filePath);
    }

    /**
     * Get the list of files within the given directory. This only returns the
     * files in the immediate directory and is not recursive.
     *
     * @param directoryPath The path of the directory
     *
     * @return The list of files in the directory
     *
     * @see File#listFiles()
     */
    public File[] listFiles(String directoryPath) {
        File[] result = null;
        File directory = null;
        directory = new File(directoryPath);
        if (directory.isDirectory()) {
            result = directory.listFiles();
        }
        return result;
    }

    /**
     * Read the contents of the given file and return the value as a string.
     *
     * @param filePath The path to the file to read
     *
     * @return The contents of the file as a string
     *
     * @throws IOException if an error occurs reading the file
     */
	public String readFileAsString(String filePath)
	    throws IOException {

		String result = null;
		Reader reader = new BufferedReader(new FileReader(filePath));

		StringBuilder stringBuffer = new StringBuilder(4096);
		int charRead = -1;
		while ((charRead = reader.read()) >= 0) {
			stringBuffer.append((char) charRead);
		}

		reader.close();
		result = stringBuffer.toString();
		return result;
	}

	/**
     * Write the contents of the given file data to the file at the given path.
     * This will replace any existing data.
     *
     * @param filePath The path to the file to write to
     * @param fileData The data to write to the given file
     *
     * @throws IOException if an error occurs writing the data
     *
     * @see #writeToFile(String, String, boolean)
     */
    public void writeToFile(String filePath, String fileData)
        throws IOException {

        writeToFile(filePath, fileData, false);
    }

	/**
	 * Write the contents of the given file data to the file at the given path.
	 * If the append flag is true, the file data will be appended
	 * to the end of the file if it already exists. Note that this will attempt
	 * to create any and all parent directories if the path does not exist.
	 *
	 * @param filePath The path to the file to write to
	 * @param fileData The data to write to the given file
	 * @param append Whether to append the file data or replace existing data
	 *
	 * @throws IOException if an error occurs writing the data
	 */
    public void writeToFile(String filePath, String fileData, boolean append)
        throws IOException {

        // synchronized on an interned string makes has all the
        // makings for exclusive write access as far as this
        // process is concerned.
        String path = (String) Utils.intern(filePath);
        synchronized (path) {
            File file = null;
            FileWriter fileWriter = null;
            try {
                file = new File(path);
                boolean exists = file.exists();
                if (!exists) {
                    exists = file.getParentFile().mkdirs();
                    exists = file.createNewFile();
                }
                if (exists) {
                    fileWriter = new FileWriter(file, append);
                    fileWriter.write(fileData);
                    fileWriter.flush();
                } else {
                    String msg =
                        "File could not be created. (" + filePath + ")";
                    mLog.error(msg);
                    throw new IOException(msg);
                }
            } catch (IOException e) {
                mLog.error("Error writing: " + filePath);
                mLog.error(e);
                throw e;
            } finally {
                if (fileWriter != null) {
                    fileWriter.close();
                }
            }
        }
    }

    /**
     * Write the contents of the given file data to the file at the given path.
     * This will replace any existing data.
     *
     * @param filePath The path to the file to write to
     * @param fileData The data to write to the given file
     *
     * @throws IOException if an error occurs writing the data
     *
     * @see #writeToFile(String, String, boolean)
     */
    public void writeToFile(String filePath, byte[] fileData)
        throws IOException {

        writeToFile(filePath, fileData, false);
    }

    /**
     * Write the contents of the given file data to the file at the given path.
     * If the append flag is true, the file data will be appended
     * to the end of the file if it already exists. Note that this will attempt
     * to create any and all parent directories if the path does not exist.
     *
     * @param filePath The path to the file to write to
     * @param fileData The data to write to the given file
     * @param append Whether to append the file data or replace existing data
     *
     * @throws IOException if an error occurs writing the data
     */
    public void writeToFile(String filePath, byte[] fileData, boolean append)
        throws IOException {

        // synchronized on an interned string makes has all the
        // makings for exclusive write access as far as this
        // process is concerned.
        String path = (String) Utils.intern(filePath);
        synchronized (path) {
            File file = null;
            FileOutputStream fileOutputStream = null;
            try {
                file = new File(path);
                boolean exists = file.exists();
                if (!exists) {
                    exists = file.getParentFile().mkdirs();
                    exists = file.createNewFile();
                }
                if (exists) {
                    fileOutputStream = new FileOutputStream(file, append);
                    fileOutputStream.write(fileData);
                    fileOutputStream.flush();
                } else {
                    String msg =
                        "File could not be created. (" + filePath + ")";
                    mLog.error(msg);
                    throw new IOException(msg);
                }
            } catch (IOException e) {
                mLog.error("Error writing: " + filePath);
                mLog.error(e);
                throw e;
            } finally {
                if (fileOutputStream != null) {
                    fileOutputStream.close();
                }
            }
        }
    }

    /**
     * Read the contents of the file at the given path and return the associated
     * byte array.
     *
     * @param filePath The path to the file to read
     *
     * @return The contents of the file
     *
     * @throws IOException if an error occurs reading the file
     */
	public byte[] getFileBytes(String filePath)
		throws IOException {

		byte[] out = null;
		String path = (String) Utils.intern(filePath);
		RandomAccessFile raf = null;
		synchronized (path) {
			File file = null;
			try {
				file = new File(path);
				boolean exists = file.exists();
				if (exists) {
					byte[] fileBytes = new byte[(int)file.length()];
					raf = new RandomAccessFile(file,"r");
					raf.readFully(fileBytes);
					out = fileBytes;
				} else {
				    String msg =
				        "File does not exist. (" + filePath + ")";
					mLog.error(msg);
					throw new IOException(msg);
				}
			} catch (IOException e) {
				mLog.error("Error writing: " + filePath);
				mLog.error(e);
				throw e;
			} finally {
				if (raf != null) {
					raf.close();
				}
			}
		}
		return out;
    }

}


text:
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8"/>
    <title>Canvas tutorial</title>
    <script src="https://code.jquery.com/jquery-2.2.1.min.js"></script>
    <script src="viewer.js"></script>
    <style type="text/css">
      canvas { border: 1px solid black; }
    </style>
  </head>
  <body onload="draw();">
    <canvas id="tutorial" width="450" height="450"></canvas>
  </body>
</html>


text:
package xworker.task.segment.impl;

import org.xmeta.ActionContext;
import org.xmeta.Thing;
import xworker.task.segment.Range;
import xworker.task.segment.RangeGenerator;
import xworker.task.segment.SegmentTask;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class TimeRangeGenerator implements RangeGenerator {
    String timeUnit;
    Date start;
    Date end;
    Date current = null;
    long step = 1;
    boolean trim = true;
    boolean waitRealTime = false;
    SegmentTask task;

    public TimeRangeGenerator(){
    }

    @Override
    public Range getNextRange() {
        Date currentEnd = null;
        if("second".equals(timeUnit)){
            currentEnd = new Date(current.getTime() + step * 1000);
        }else if("minute".equals(timeUnit)){
            currentEnd = new Date(current.getTime() + step * 60 * 1000);
        }else if("hour".equals(timeUnit)){
            currentEnd = new Date(current.getTime() + step * 3600 * 1000);
        }else if("day".equals(timeUnit)){
            currentEnd = new Date(current.getTime() + step * 24 * 3600 * 1000);
        }else if("week".equals(timeUnit)){
            currentEnd = new Date(current.getTime() + step * 7 * 24 * 3600 * 1000);
        }else {
            GregorianCalendar gc = new GregorianCalendar();
            gc.setTime(current);

            if ("year".equals(timeUnit)) {
                gc.add(Calendar.YEAR, (int) step);
                currentEnd = gc.getTime();
            }else if("month".equals(timeUnit)){
                gc.add(Calendar.MONTH, (int) step);
                currentEnd = gc.getTime();
            }
        }

        if(currentEnd == null){
            return null;
        }

        if(waitRealTime && currentEnd.getTime() >= System.currentTimeMillis()){
            //是否等待系统时间
            return null;
        }

        Range range = new Range(task, current.getTime(), currentEnd.getTime());

        current = currentEnd;
        return range;
    }

    @Override
    public void init(SegmentTask task) {
        Long offset = task.getRangeStore().getRangeOffset();
        if(offset != null){
            current = new Date(offset);
        }else{
            current = start;
        }

        this.task = task;
    }

    @Override
    public boolean hasNext() {
        return end == null || current.getTime() < end.getTime();
    }

    @Override
    public Object toObject(long value) {
        return new Date(value);
    }

    public String getTimeUnit() {
        return timeUnit;
    }

    public void setTimeUnit(String timeUnit) {
        this.timeUnit = timeUnit;
    }

    private Date trim(Date date) throws ParseException {
        if(date == null){
            return null;
        }

        SimpleDateFormat sf = null;
        if("minute".equals(timeUnit)){
            sf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        }else if("hour".equals(timeUnit)){
            sf = new SimpleDateFormat("yyyy-MM-dd HH");
        }else if("day".equals(timeUnit)){
            sf = new SimpleDateFormat("yyyy-MM-dd");
        }else if("week".equals(timeUnit)){
            sf = new SimpleDateFormat("yyyy-MM-dd");
        }else if ("year".equals(timeUnit)) {
            sf = new SimpleDateFormat("yyyy");
        }else if("month".equals(timeUnit)){
            sf = new SimpleDateFormat("yyyy-MM");
        }

        if(sf != null){
            Date newDate =  sf.parse(sf.format(date));
            if("week".equals(timeUnit)){
                GregorianCalendar gc = new GregorianCalendar();
                gc.setTime(newDate);
                int dateOfWeek = gc.get(Calendar.DAY_OF_WEEK);
                gc.add(Calendar.DATE, -dateOfWeek);
                newDate = gc.getTime();
            }
            return newDate;
        }else{
            return date;
        }
    }

    //动作实现:xworker.lang.task.impls.TimeRangeGenerator/@actions/@create
    public static Object create(ActionContext actionContext) throws ParseException {
        Thing self = actionContext.getObject("self");

        Date start = self.doAction("getStart", actionContext);
        Date end = self.doAction("getEnd", actionContext);
        Long step = self.doAction("getStep", actionContext);
        String timeUnit = self.doAction("getTimeUnit", actionContext);
        Boolean trim = self.doAction("isTrim", actionContext);
        Boolean waitRealTime = self.doAction("isWaitRealTime", actionContext);

        TimeRangeGenerator generator = new TimeRangeGenerator();
        if(start == null){
            start = new Date();
        }
        generator.start = start;
        generator.end = end;
        generator.step = step;
        if(generator.step <= 0){
            generator.step = 1;
        }
        generator.timeUnit = timeUnit;
        generator.trim = trim;
        generator.waitRealTime = waitRealTime;
        if(trim){
            generator.start = generator.trim(generator.start);
            if(generator.end != null){
                generator.end = generator.trim(generator.end);
            }
        }

        return generator;
    }
}