text:
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;

namespace Eve
{
    public partial class EveClient : IDisposable
    {
        /// <summary>
        /// Performs an asynchronous GET request on an arbitrary endpoint.
        /// </summary>
        /// <param name="uri">Endpoint URI.</param>
        /// <param name="etag">ETag</param>
        /// <param name="ifModifiedSince">Return only documents that changed since this date.</param>
        /// <param name="showDeleted">Wether soft deleted documents should be included or not.</param>
        /// <param name="rawQuery">Return only documents that match this query.</param>
        public async Task<HttpResponseMessage> GetAsync(string uri, string etag, DateTime? ifModifiedSince, bool showDeleted, string rawQuery)
        {

            if (uri == null)
            {
                throw new ArgumentNullException("uri");
            }
            ValidateBaseAddress();

            using (var client = new HttpClient())
            {
                Settings(client);

                if (etag != null)
                {
                    client.DefaultRequestHeaders.TryAddWithoutValidation("If-None-Match", etag);
                }

                var q = new System.Text.StringBuilder();
                if (ifModifiedSince != null)
                    q.AppendFormat(
                        @"{{""{0}"": {{""$gt"": ""{1}""}}}}",
                        LastUpdatedField,
                        ((DateTime)ifModifiedSince).ToString("r"));
                // do the query filtering
                if (rawQuery != null)
                    if (q.Length > 0)
                    {
                        q.Insert(0, @"{""$and"": [");
                        q.AppendFormat(@", {0}]}}", @rawQuery);
                    }
                    else
                        q.AppendFormat(@"{0}", @rawQuery);
                if (q.Length > 0)
                    q.Insert(0, "where=");

                // append other stuff
                if (showDeleted)
                {
                    if (q.Length > 0)
                        q.Append('&');
                    q.Append("show_deleted");
                }

                // prepend the url
                if (q.Length > 0)
                    q.Insert(0, '?');
                q.Insert(0, uri);

                HttpResponse = await client.GetAsync(q.ToString()).ConfigureAwait(false);
                return HttpResponse;

            }
        }

        #region Overloads

        /// <summary>
        /// Performs an asynchronous GET request on an arbitrary endpoint.
        /// </summary>
        /// <param name="uri">Endpoint URI.</param>
        /// <param name="etag">ETag</param>
        public async Task<HttpResponseMessage> GetAsync(string uri, string etag)
        {
            return await GetAsync(uri, etag, null, false, null);

        }

        /// <summary>
        /// Performs an asynchronous GET request on an arbitrary endpoint.
        /// </summary>
        /// <param name="uri">Endpoint URI.</param>
        /// <param name="ifModifiedSince">Return only documents that changed since this date.</param>
        public async Task<HttpResponseMessage> GetAsync(string uri, DateTime? ifModifiedSince)
        {
            return await GetAsync(uri, null, ifModifiedSince, false, null);
        }

        /// <summary>
        /// Performs an asynchronous GET request on an arbitrary endpoint.
        /// </summary>
        /// <param name="uri">Endpoint URI.</param>
        public async Task<HttpResponseMessage> GetAsync(string uri)
        {
            return await GetAsync(uri, etag: null);
        }

        /// <summary>
        /// Performs an asynchronous GET request on a document endpoint.
        /// </summary>
        /// <returns> An istance of the requested document, or null if document was not found or some other issue arised.</returns>
        /// <param name="resourceName">Resource name.</param>
        /// <param name="documentId">Document identifier.</param>
        /// <param name="etag">Document ETag.</param>
        /// <typeparam name="T">The type to which the retrieved JSON should be casted.</typeparam>
        public async Task<T> GetAsync<T>(string resourceName, string documentId, string etag)
        {
            ValidateResourceName(resourceName);

            if (documentId == null)
            {
                throw new ArgumentNullException("documentId");
            }

            HttpResponse = await GetAsync(string.Format("{0}/{1}", resourceName, documentId), etag);

            if (HttpResponse.StatusCode != HttpStatusCode.OK)
                return default(T);
            return await DeserializeObject<T>(HttpResponse);
        }

        /// <summary>
        /// Performs an asynchronous GET request on a document endpoint.
        /// </summary>
        /// <returns> An istance of the requested document, or null if document was not found or some other issue arised.</returns>
        /// <param name="resourceName">Resource name.</param>
        /// <param name="documentId">Document identifier.</param>
        /// <typeparam name="T">The type to which the retrieved JSON should be casted.</typeparam>
        public async Task<T> GetAsync<T>(string resourceName, string documentId)
        {
            return await GetAsync<T>(resourceName, documentId, null);
        }

        /// <summary>
        /// Performs an asynchronous GET request of a document.
        /// </summary>
        /// <returns> An istance of the requested document, or null if document was not found or some other issue arised.</returns>
        /// <param name="obj">The instance of the document to be retrieved.</param>
        /// <typeparam name="T">The type to which the retrieved JSON should be casted.</typeparam>
        public async Task<T> GetAsync<T>(object obj)
        {
            ValidateResourceName();
            return await GetAsync<T>(ResourceName, obj);
        }

        /// <summary>
        /// Performs an asynchronous GET request on a document endpoint.
        /// </summary>
        /// <returns> An istance of the requested document, or null if document was not found or some other issue arised.</returns>
        /// <param name="resourceName">The resource name.</param>
        /// <param name="obj">The instance of the document to be retrieved.</param>
        /// <typeparam name="T">The type to which the retrieved JSON should be casted.</typeparam>
        public async Task<T> GetAsync<T>(string resourceName, object obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("obj");
            }

            var retObj = await GetAsync<T>(resourceName, GetDocumentId(obj), GetETag(obj));

            return HttpResponse.StatusCode == HttpStatusCode.NotModified ? (T)obj : retObj;
        }

        /// <summary>
        /// Performs an asynchronous GET request for a specific document.
        /// </summary>
        /// <returns>A list of objects of the requested type, or null if the response from the remote service was something other than 200 OK.</returns>
        /// <typeparam name="T">The type to which the retrieved JSON should be casted.</typeparam>
        public async Task<List<T>> GetAsync<T>()
        {
            ValidateResourceName();
            return await GetAsync<T>(ResourceName);
        }

        /// <summary>
        /// Performs an asynchronous GET request for a specific document.
        /// </summary>
        /// <returns>A list of objects of the requested type, or null if the response from the remote service was something other than 200 OK.</returns>
        /// <typeparam name="T">The type to which the retrieved JSON should be casted.</typeparam>
        public async Task<List<T>> GetAsync<T>(DateTime? ifModifiedSince)
        {
            ValidateResourceName();
            return await GetAsync<T>(ResourceName, ifModifiedSince);
        }

        /// <summary>
        /// Performs an asynchronous GET request for a specific document.
        /// </summary>
        /// <returns>A list of objects of the requested type, or null if the response from the remote service was something other than 200 OK.</returns>
        /// <typeparam name="T">The type to which the retrieved JSON should be casted.</typeparam>
        public async Task<List<T>> GetAsync<T>(bool softDeleted)
        {
            ValidateResourceName();
            return await GetAsync<T>(ResourceName, softDeleted);
        }
        /// <summary>
        /// Performs an asynchronous GET request on a resource endpoint.
        /// </summary>
        /// <returns>A list of objects of the requested type, or null if the response from the remote service was something other than 200 OK.</returns>
        /// <param name="resourceName">Resource endpoint.</param>
        /// <param name="ifModifiedSince">Return only documents that changed since this date. </param>
        /// <typeparam name="T">The type to which the retrieved JSON should be casted.</typeparam>
        public async Task<List<T>> GetAsync<T>(string resourceName, DateTime? ifModifiedSince)
        {
            ValidateResourceName(resourceName);

            HttpResponse = await GetAsync(resourceName, ifModifiedSince);

            if (HttpResponse.StatusCode != HttpStatusCode.OK)
                return default(List<T>);
            return await ParseJsonAsListOf<T>(HttpResponse.Content);
        }

        /// <summary>
        /// Performs an asynchronous GET request on a resource endpoint.
        /// </summary>
        /// <returns>A list of objects of the requested type, or null if the response from the remote service was something other than 200 OK.</returns>
        /// <param name="resourceName">Resource endpoint.</param>
        /// <param name="softDeleted">Include deleted documents. </param>
        /// <typeparam name="T">The type to which the retrieved JSON should be casted.</typeparam>
        public async Task<List<T>> GetAsync<T>(string resourceName, bool softDeleted)
        {
            ValidateResourceName(resourceName);

            HttpResponse = await GetAsync(resourceName, null, null, softDeleted, null);

            if (HttpResponse.StatusCode != HttpStatusCode.OK)
                return default(List<T>);
            return await ParseJsonAsListOf<T>(HttpResponse.Content);
        }
        /// <summary>
        /// Performs an asynchronous GET request on a resource endpoint.
        /// </summary>
        /// <returns>A list of objects of the requested type, or null if the response from the remote service was something other than 200 OK.</returns>
        /// <param name="resourceName">Resource endpoint.</param>
        /// <param name="ifModifiedSince">Return only documents that changed since this date. </param>
        /// <param name="rawQuery">Only return documents matching this query.</param>
        /// <typeparam name="T">The type to which the retrieved JSON should be casted.</typeparam>
        public async Task<List<T>> GetAsync<T>(string resourceName, DateTime? ifModifiedSince, string rawQuery)
        {
            ValidateResourceName(resourceName);

            HttpResponse = await GetAsync(resourceName, null, ifModifiedSince, false, rawQuery);

            if (HttpResponse.StatusCode != HttpStatusCode.OK)
                return default(List<T>);
            return await ParseJsonAsListOf<T>(HttpResponse.Content);
        }

        /// <summary>
        /// Performs an asynchronous GET request on a resource endpoint.
        /// </summary>
        /// <returns>A list of objects of the requested type, or null if the response from the remote service was something other than 200 OK.</returns>
        /// <param name="resourceName">Resource endpoint.</param>
        /// <param name="softDeleted">Include deleted documents. </param>
        /// <param name="rawQuery">Only return documents matching this query.</param>
        /// <typeparam name="T">The type to which the retrieved JSON should be casted.</typeparam>
        public async Task<List<T>> GetAsync<T>(string resourceName, bool softDeleted, string rawQuery)
        {
            ValidateResourceName(resourceName);

            HttpResponse = await GetAsync(resourceName, null, null, softDeleted, rawQuery).ConfigureAwait(false);

            if (HttpResponse.StatusCode != HttpStatusCode.OK)
                return default(List<T>);
            return await ParseJsonAsListOf<T>(HttpResponse.Content);
        }

        /// <summary>
        /// Performs an asynchronous GET request on a resource endpoint.
        /// </summary>
        /// <returns>A list of objects of the requested type, or null if the response from the remote service was something other than 200 OK.</returns>
        /// <param name="resourceName">Resource endpoint.</param>
        /// <param name="ifModifiedSince">Return only documents that changed since this date. </param>
        /// <param name="softDeleted">Include deleted documents.</param>
        /// <typeparam name="T">The type to which the retrieved JSON should be casted.</typeparam>
        public async Task<List<T>> GetAsync<T>(string resourceName, DateTime? ifModifiedSince, bool softDeleted)
        {
            ValidateResourceName(resourceName);

            HttpResponse = await GetAsync(resourceName, null, ifModifiedSince, softDeleted, null);

            if (HttpResponse.StatusCode != HttpStatusCode.OK)
                return default(List<T>);
            return await ParseJsonAsListOf<T>(HttpResponse.Content);
        }

        /// <summary>
        /// Performs an asynchronous GET request on a resource endpoint.
        /// </summary>
        /// <returns>A list of objects of the requested type, or null if the response from the remote service was something other than 200 OK.</returns>
        /// <param name="resourceName">Resource endpoint.</param>
        /// <param name="ifModifiedSince">Return only documents that changed since this date. </param>
        /// <param name="softDeleted">Wether soft deleted documents should be returned or not.</param>
        /// <param name="rawQuery">Only return documents matching this query.</param>
        /// <typeparam name="T">The type to which the retrieved JSON should be casted.</typeparam>
        public async Task<List<T>> GetAsync<T>(string resourceName, DateTime? ifModifiedSince, bool softDeleted, string rawQuery)
        {
            ValidateResourceName(resourceName);

            HttpResponse = await GetAsync(resourceName, null, ifModifiedSince, softDeleted, rawQuery);

            if (HttpResponse.StatusCode != HttpStatusCode.OK)
                return default(List<T>);
            return await ParseJsonAsListOf<T>(HttpResponse.Content);
        }

        /// <summary>
        /// Performs an asynchronous GET request on a resource endpoint.
        /// </summary>
        /// <returns>A list of objects of the requested type, or null if the response from the remote service was something other than 200 OK.</returns>
        /// <param name="resourceName">Resource endpoint.</param>
        /// <typeparam name="T">The type to which the retrieved JSON should be casted.</typeparam>
        public async Task<List<T>> GetAsync<T>(string resourceName)
        {
            return await GetAsync<T>(resourceName, ifModifiedSince: null);
        }

        #endregion Overloads
    }
}


text:
This file describes all parameters settable at the
configuration files inside the `config` folder.

Redis Commander uses the node "config" module (https://github.com/lorenwest/node-config)
More information about possible file formats and config file names
as well as there evaluation order can be found in the wiki of the node-config
project.

## Configuration data

The entire system can be configured within the json configuration files located below the `config/` folder.
Some parameters can be set additionally via environment variable and/or command line parameter.
Whenever this is possible the name of the environment variable is listed too as well as a flag to
show when it can be set as cli parameter (overwriting the config file as well as the environment variable)

### 1. General Parameter

All top-level configuration data are

| Name | Type | Default | Cli | Environment-Var | Description |
|---|---|---|---|---|---|
| noSave | boolean | false | --nosave | NO_SAVE | do not persist changes in active connection list  |
| noLogData | boolean | false | --no-log-data | NO_LOG_DATA | do not log values of redis keys to console |
| ui | object |  | | | see section 2. User interface parameter|
| redis | object |  | | | see section 3. General Redis connection parameter |
| server | object |  | | | see section 4. Express HTTP Server parameter |
| connections | list | [] | | | see section 5. Redis Connections |

### 2. User interface parameter

The `ui` object contains configuration values regarding the web user
interface of Redis Commander.

| Name | Type | Default | Cli | Environment-Var | Description |
|---|---|---|---|---|---|
| ui.sidebarWidth |number | 250 | | | start width in pixel of the tree view on the left side of the ui. |
| ui.locked | boolean | false | | | if "true" do not change height of command line, otherwise increase height if cli is active |
| ui.cliHeight | number | 320 | | | start height in pixel of the command line at the bottom (if opened) |
| ui.cliOpen | boolean | false | | | start with maximized cli height on "true", with minimized one on "false" |
| ui.foldingChar | string | ':' | --folding-char | FOLDING_CHAR | character to use for creation of a virtual hierarchical tree of all keys. e.g key 'top/sub/mykey' is divided into a folder 'top' containing the folder 'sub' with the key 'mykey' inside it. |
| ui.jsonViewAsDefault | string list | 'none' | | VIEW_JSON_DEFAULT | comma separated list of data types where valid json data should be displayed as JSON tree object instead of plain string. Default '' or 'none' displays no data as string, 'all' displays all data-types supported as JSON objects.
Example: "string,hash" only displays these two types as JSON if possible per default
Values supported: '', 'none', 'all', 'string', 'list', 'set', 'zset', 'hash'
| ui.binaryAsHex | boolean | true | | BINARY_AS_HEX | do not display binary data as string but in hexadecimal view |
| ui.maxHashFieldSize | number | 0 | | MAX_HASH_FIELD_SIZE | The max number of bytes for a hash field before you must click to view it. Defaults to 0, which is disabled

### 3. General Redis connection parameter

| Name | Type | Default | Cli | Environment-Var | Description |
|---|---|---|---|---|---|
| redis.readOnly | boolean | false | --read-only | READ_ONLY | use Redis Commander in read-only mode - if set to "true" no commands modifying data are allowed (ui and command line) |
| redis.flushOnImport | boolean | false | | FLUSH_ON_IMPORT | flag to either check "flush" checkbox (true) on import page or uncheck (false) it. If "true" the entire database is flushed before bulk importing the data. |
| redis.useScan | boolean | true | --use-scan | USE_SCAN | use redis "SCAN" command instead of "KEYS" to enumerate all keys inside db for display |
| redis.scanCount | number | 100 | --scan-count | SCAN_COUNT | number of keys read when using SCAN cursor instead of KEYS (useScan must be true) |
| redis.rootPattern | string | '*' | --root-pattern | ROOT_PATTERN | filter pattern to use at start, can be used to exclude some date inside redis db |
| redis.connectionName | string | 'redis-commander' | | REDIS_CONNECTION_NAME | connection name to set at redis client for easier identification of clients at redis server (command "client list") |
| redis.defaultLabel | string | 'local' | | REDIS_LABEL | default label to display for a connection if no label is specified (e.g. for connection from env vars or command line) |
| redis.defaultSentinelGroup | string | 'mymaster' | | | default redis database group if using sentinels to connect and no special database group via connection param 'sentinelName' is given. |

### 4. Express HTTP Server parameter

| Name | Type | Default | Cli | Environment-Var | Description |
|---|---|---|---|---|---|
| server.address | string | '0.0.0.0' | --address | ADDRESS | ip address of interface to bind http server to, use 0.0.0.0 to bind to all interfaces |
| server.port | number | 8081 | --port | PORT | port to listen on for HTTP server |
| server.urlPrefix | string | '' | --url-prefix | URL_PREFIX | path prefix to run Redis Commander at, can be used if run behind a reverse proxy with different path set (e.g. /rc), if set must start with '/' |
| server.signinPath | string | 'signin' | | SIGNIN_PATH | path added after urlPrefix as route to send login requests too. Some platforms (e.g. github codespaces) may require changing this path. |
| server.trustProxy | boolean or string | false | --trust-proxy | TRUST_PROXY | should be set to true if run behind a reverse proxy and 'X-Forwarded-For' headers shall be trusted to get real client ip for logging, this parameter maps directly to the Express "trust proxy" setting (https://expressjs.com/de/guide/behind-proxies.html)|
| server.clientMaxBodySize | number or string | '100kb' | | CLIENT_MAX_BODY_SIZE | number in bytes or a string with size and SI-unit, this parameter maps to the "limit" options of body-parser (https://github.com/expressjs/body-parser#limit) |
| server.auth | object |  | | | see section 4.1 Authentication  |

#### 4.1 Authentication configuration for HTTP server

To enable HTTP authentication inside Redis Commander set a username
and either a password (clear text) or a passwordHash.

If username is empty Redis Commander does not use any authentication leaving
all your redis keys accessible to anyone. This mode may be used
if an HTTP reverse proxy in front of Redis commander performs
the user authentication.

Please be aware that using an HTTP reverse proxy for authentication and
not using Redis Commander builtin auth allows (at least) all users having
accounts on the server running Redis Commander to connect via localhost directly
to via app port (e.g. 8081) unauthenticated!

| Name | Type | Default | Cli | Environment-Var | Description |
|---|---|---|---|---|---|
| server.httpAuth.username | string | '' | --http-u | HTTP_USER | set a username and either password or passwordHash to |
| server.httpAuth.password | string | '' | --http-p | HTTP_PASSWORD | clear text password to use for HTTP Basic auth (either password or passwordHash allowed) |
| server.httpAuth.passwordHash | string | '' | --http-h | HTTP_PASSWORD_HASH | password hash to use for HTTP Basic auth (either password or passwordHash allowed) |
| server.httpAuth.jwtSecret | string | '' | | | Shared Secret used to sign JWT tokens for all future requests after initial login to not send HTTP basic auth header on all requests. If this value is empty a random value is generated on every startup. |

### 5. Redis Connections

All Connections use be redis commander are defined as
entries of the "connections" list. The possible
values for a connection are described in the [connections.md]()
file.

## Environment Variables

All possible environment variables with their mapping
to configuration data are defined inside the file
[custom-environment-variables.json](../config/custom-environment-variables.json).
This file can be extended if there is any need to define
more environment variables for custom config data like
connection configs.

redpajama_set_name: RedPajamaGithub


text:
#include "ISceneObject.h"

namespace ion
{
	namespace Scene
	{

		ISceneObject::~ISceneObject()
		{}

		bool ISceneObject::IsVisible() const
		{
			return Visible;
		}

		bool ISceneObject::IsLoaded(CRenderPass const * RenderPass) const
		{
			bool Check = false;
			TryMapAccess(Loaded, RenderPass, Check);
			return Check;
		}

		void ISceneObject::TriggerReload()
		{
			for (auto & it : Loaded)
			{
				it.second = false;
			}
		}

		void ISceneObject::SetVisible(bool const isVisible)
		{
			Visible = isVisible;
		}

		void ISceneObject::SetDebugName(string const & DebugName)
		{
			this->DebugName = DebugName;
		}

		string const & ISceneObject::GetDebugName() const
		{
			return DebugName;
		}

		STransformation3 const & ISceneObject::GetTransformation() const
		{
			return Transformation;
		}

		void ISceneObject::SetTransformation(glm::mat4 const & transformation)
		{
			Transformation.Set(transformation);
		}

		void ISceneObject::SetTranslation(vec3f const & translation)
		{
			Transformation.SetTranslation(translation);
		}

		void ISceneObject::SetPosition(vec3f const & translation)
		{
			Transformation.SetTranslation(translation);
		}

		void ISceneObject::SetRotation(vec3f const & rotation)
		{
			Transformation.SetRotation(rotation);
		}

		void ISceneObject::SetRotation(glm::mat4 const & matrix)
		{
			Transformation.SetRotation(matrix);
		}

		void ISceneObject::SetScale(vec3f const & scale)
		{
			Transformation.SetScale(scale);
		}

		vec3f ISceneObject::GetRotation() const
		{
			return Transformation.GetRotation();
		}

		vec3f ISceneObject::GetTranslation() const
		{
			return Transformation.GetTranslation();
		}

		vec3f ISceneObject::GetPosition() const
		{
			return Transformation.GetTranslation();
		}

		vec3f ISceneObject::GetScale() const
		{
			return Transformation.GetScale();
		}

		void ISceneObject::SetRotationOrder(ERotationOrder const RotationOrder)
		{
			Transformation.SetRotationOrder(RotationOrder);
		}

		ERotationOrder ISceneObject::GetRotationOrder() const
		{
			return Transformation.GetRotationOrder();
		}

		void ISceneObject::SetTransformationOrder(ETransformationOrder const TransformationOrder)
		{
			Transformation.SetOrder(TransformationOrder);
		}

		ETransformationOrder ISceneObject::GetTransformationOrder() const
		{
			return Transformation.GetOrder();
		}

	}
}


text:
namespace Serilog.Tests.Support;

public class DelegatingSink : ILogEventSink
{
    readonly Action<LogEvent> _write;

    public DelegatingSink(Action<LogEvent> write)
    {
        _write = Guard.AgainstNull(write);
    }

    public void Emit(LogEvent logEvent)
    {
        _write(logEvent);
    }

    public static LogEvent GetLogEvent(Action<ILogger> writeAction)
    {
        LogEvent? result = null;
        var l = new LoggerConfiguration()
            .MinimumLevel.Verbose()
            .WriteTo.Sink(new DelegatingSink(le => result = le))
            .CreateLogger();

        writeAction(l);
        Assert.NotNull(result);
        return result!;
    }
}


text:
package org.apache.hyracks.storage.common;

import java.util.HashMap;
import java.util.Map;

import org.apache.hyracks.api.exceptions.HyracksDataException;

public class TransientLocalResourceRepository implements ILocalResourceRepository {

    private Map<String, LocalResource> name2ResourceMap = new HashMap<>();
    private Map<Long, LocalResource> id2ResourceMap = new HashMap<>();

    @Override
    public LocalResource get(String path) throws HyracksDataException {
        return name2ResourceMap.get(path);
    }

    @Override
    public synchronized void insert(LocalResource resource) throws HyracksDataException {
        long id = resource.getId();

        if (id2ResourceMap.containsKey(id)) {
            throw new HyracksDataException("Duplicate resource");
        }
        id2ResourceMap.put(id, resource);
        name2ResourceMap.put(resource.getPath(), resource);
    }

    @Override
    public synchronized void delete(String path) throws HyracksDataException {
        LocalResource resource = name2ResourceMap.get(path);
        if (resource == null) {
            throw new HyracksDataException("Resource doesn't exist");
        }
        id2ResourceMap.remove(resource.getId());
        name2ResourceMap.remove(path);
    }

    @Override
    public long maxId() throws HyracksDataException {
        long maxResourceId = 0;

        for (Long resourceId : id2ResourceMap.keySet()) {
            maxResourceId = Math.max(maxResourceId, resourceId);
        }
        return maxResourceId;
    }
}


text:
#ifndef QMITKLABELSWIDGET_H
#define QMITKLABELSWIDGET_H

// mitk core
#include <mitkWeakPointer.h>

// Qt
#include <QWidget>

namespace Ui
{
  class QmitkLabelsWidgetControls;
}

namespace mitk
{
  class DataNode;
  class Image;
  class LabelSetImage;
  class ToolManager;
}

class QmitkLabelsWidget : public QWidget
{
  Q_OBJECT

public:

  explicit QmitkLabelsWidget(QWidget* parent = nullptr);
  ~QmitkLabelsWidget() override;

  void UpdateGUI();

  void SetDefaultLabelNaming(bool defaultLabelNaming);

Q_SIGNALS:

  void LabelsChanged();

  void ShowLabelTable(bool);

private:

  mitk::LabelSetImage* GetWorkingImage();

  mitk::DataNode* GetWorkingNode();

  // reaction to button "New Label"
  void OnNewLabel();
  void OnNewLabelShortcutActivated();

  // reaction to the button "Lock exterior"
  void OnLockExterior(bool);

  // reaction to button "Save Preset"
  void OnSavePreset();

  // reaction to button "Load Preset"
  void OnLoadPreset();

  void WaitCursorOn();

  void WaitCursorOff();

  void RestoreOverrideCursor();

  Ui::QmitkLabelsWidgetControls* m_Controls;

  mitk::ToolManager* m_ToolManager;

  bool m_DefaultLabelNaming;

};

#endif


text:
<app-loading-bar></app-loading-bar>

<router-outlet (activate)='onActivate($event)'>
</router-outlet>

© The Reincarnation {{year}}

- UI {{uiVersion}}

- API {{apiVersion}}

<app-dialog></app-dialog>


text:
<?php

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly

/**
 * Abstract Email Class
 *
 * WooCommerce Email Class which is extended by specific email template classes to add emails to WooCommerce
 *
 * @class 		WC_Email
 * @version		2.0.0
 * @package		WooCommerce/Abstracts
 * @author 		WooThemes
 * @category	Abstract Class
 * @extends 	WC_Settings_API
 */
abstract class WC_Email extends WC_Settings_API {

	/** @var string Payment method ID. */
	var $id;

	/** @var string Payment method title. */
	var $title;

	/** @var bool True if the method is enabled. */
	var $enabled;

	/** @var string Description for the gateway. */
	var $description;

	/** @var string plain text template path */
	var $template_plain;

	/** @var string html template path */
	var $template_html;

	/** @var string template path */
	var $template_base;

	/** @var string recipients for the email */
	var $recipient;

	/** @var string heading for the email content */
	var $heading;

	/** @var string subject for the email */
	var $subject;

	/** @var object this email is for, for example a customer, product, or email */
	var $object;

	/** @var array strings to find in subjects/headings */
	var $find;

	/** @var array strings to replace in subjects/headings */
	var $replace;

	/** @var string For multipart emails */
	var $mime_boundary;

	/** @var string For multipart emails */
	var $mime_boundary_header;

	/** @var bool true when email is being sent */
	var $sending;

	/**
     *  List of preg* regular expression patterns to search for,
     *  used in conjunction with $replace.
     *  https://raw.github.com/ushahidi/wp-silcc/master/class.html2text.inc
     *
     *  @var array $search
     *  @access public
     *  @see $replace
     */
    var $plain_search = array(
        "/\r/",                                  // Non-legal carriage return
        '/&(nbsp|#160);/i',                      // Non-breaking space
        '/&(quot|rdquo|ldquo|#8220|#8221|#147|#148);/i',
		                                         // Double quotes
        '/&(apos|rsquo|lsquo|#8216|#8217);/i',   // Single quotes
        '/>/i',                               // Greater-than
        '/</i',                               // Less-than
        '/&(amp|#38);/i',                        // Ampersand
        '/&(copy|#169);/i',                      // Copyright
        '/&(trade|#8482|#153);/i',               // Trademark
        '/&(reg|#174);/i',                       // Registered
        '/&(mdash|#151|#8212);/i',               // mdash
        '/&(ndash|minus|#8211|#8722);/i',        // ndash
        '/&(bull|#149|#8226);/i',                // Bullet
        '/&(pound|#163);/i',                     // Pound sign
        '/&(euro|#8364);/i',                     // Euro sign
        '/&[^&;]+;/i',                           // Unknown/unhandled entities
        '/[ ]{2,}/'                              // Runs of spaces, post-handling
    );

    /**
     *  List of pattern replacements corresponding to patterns searched.
     *
     *  @var array $replace
     *  @access public
     *  @see $search
     */
    var $plain_replace = array(
        '',                                     // Non-legal carriage return
        ' ',                                    // Non-breaking space
        '"',                                    // Double quotes
        "'",                                    // Single quotes
        '>',
        '<',
        '&',
        '(c)',
        '(tm)',
        '(R)',
        '--',
        '-',
        '*',
        '£',
        'EUR',                                  // Euro sign. € ?
        '',                                     // Unknown/unhandled entities
        ' '                                     // Runs of spaces, post-handling
    );

	/**
	 * Constructor
	 *
	 * @access public
	 * @return void
	 */
	function __construct() {
		global $woocommerce;

		// Init settings
		$this->init_form_fields();
		$this->init_settings();

		// Save settings hook
		add_action( 'woocommerce_update_options_email_' . $this->id, array( $this, 'process_admin_options' ) );

		// Default template base if not declared in child constructor
		if ( is_null( $this->template_base ) )
			$this->template_base = $woocommerce->plugin_path() . '/templates/';

		// Settings
		$this->heading 			= $this->get_option( 'heading', $this->heading );
		$this->subject      	= $this->get_option( 'subject', $this->subject );
		$this->email_type     	= $this->get_option( 'email_type' );
		$this->enabled   		= $this->get_option( 'enabled' );

		// Find/replace
		$this->find = array( '{blogname}' );
		$this->replace = array( $this->get_blogname() );

		// For multipart messages
		add_filter( 'phpmailer_init', array( $this, 'handle_multipart' ) );
	}

	/**
	 * handle_multipart function.
	 *
	 * @access public
	 * @param mixed $mailer
	 * @return void
	 */
	function handle_multipart( $mailer )  {

		if ( $this->sending && $this->get_email_type() == 'multipart' ) {

			$mailer->AltBody = wordwrap( preg_replace( $this->plain_search, $this->plain_replace, strip_tags( $this->get_content_plain() ) ) );
			//$mailer->AltBody = wordwrap( html_entity_decode( strip_tags( $this->get_content_plain() ) ), 70 );
			$this->sending = false;
		}

		return $mailer;
	}

	/**
	 * format_string function.
	 *
	 * @access public
	 * @param mixed $string
	 * @return string
	 */
	function format_string( $string ) {
		return str_replace( $this->find, $this->replace, $string );
	}
	/**
	 * get_subject function.
	 *
	 * @access public
	 * @return string
	 */
	function get_subject() {
		return apply_filters( 'woocommerce_email_subject_' . $this->id, $this->format_string( $this->subject ), $this->object );
	}

	/**
	 * get_heading function.
	 *
	 * @access public
	 * @return string
	 */
	function get_heading() {
		return apply_filters( 'woocommerce_email_heading_' . $this->id, $this->format_string( $this->heading ), $this->object );
	}

	/**
	 * get_recipient function.
	 *
	 * @access public
	 * @return string
	 */
	function get_recipient() {
		return apply_filters( 'woocommerce_email_recipient_' . $this->id, $this->recipient, $this->object );
	}

	/**
	 * get_headers function.
	 *
	 * @access public
	 * @return string
	 */
	function get_headers() {
		return apply_filters( 'woocommerce_email_headers', "Content-Type: " . $this->get_content_type() . "\r\n", $this->id, $this->object );
	}

	/**
	 * get_attachments function.
	 *
	 * @access public
	 * @return string
	 */
	function get_attachments() {
		return apply_filters( 'woocommerce_email_attachments', '', $this->id, $this->object );
	}

	/**
	 * get_type function.
	 *
	 * @access public
	 * @return string
	 */
	function get_email_type() {
		return $this->email_type ? $this->email_type : 'plain';
	}

	/**
	 * get_content_type function.
	 *
	 * @access public
	 * @return void
	 */
	function get_content_type() {
		switch ( $this->get_email_type() ) {
			case "html" :
				return 'text/html';
			case "multipart" :
				return 'multipart/alternative';
			default :
				return 'text/plain';
		}
	}

	/**
	* Proxy to parent's get_option and attempt to localize the result using gettext.
	*
	* @access public
	* @return string
	*/
	function get_option( $key, $empty_value = null ) {
		return __( parent::get_option( $key, $empty_value ) );
	}

	/**
	 * Checks if this email is enabled and will be sent.
	 *
	 * @access public
	 * @return bool
	 */
	function is_enabled() {
		$enabled = $this->enabled == "yes" ? true : false;

		return apply_filters( 'woocommerce_email_enabled_' . $this->id, $enabled, $this->object );
	}

	/**
	 * get_blogname function.
	 *
	 * @access public
	 * @return void
	 */
	function get_blogname() {
		return wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
	}

	/**
	 * get_content function.
	 *
	 * @access public
	 * @return string
	 */
	function get_content() {

		$this->sending = true;

		if ( $this->get_email_type() == 'plain' ) {
			$email_content = preg_replace( $this->plain_search, $this->plain_replace, strip_tags( $this->get_content_plain() ) );
		} else {
			$email_content = $this->style_inline( $this->get_content_html() );
		}

		return $email_content;
	}

	/**
	 * Apply inline styles to dynamic content.
	 *
	 * @access public
	 * @param mixed $content
	 * @return void
	 */
	function style_inline( $content ) {

		if ( ! class_exists( 'DOMDocument' ) )
			return $content;

		$dom = new DOMDocument();
		libxml_use_internal_errors( true );
    		@$dom->loadHTML( $content );
    		libxml_clear_errors();

		$nodes = $dom->getElementsByTagName('img');

		foreach( $nodes as $node )
			if ( ! $node->hasAttribute( 'style' ) )
				$node->setAttribute( "style", "display:inline; border:none; font-size:14px; font-weight:bold; height:auto; line-height:100%; outline:none; text-decoration:none; text-transform:capitalize;" );

		$nodes_h1 = $dom->getElementsByTagName('h1');
		$nodes_h2 = $dom->getElementsByTagName('h2');
		$nodes_h3 = $dom->getElementsByTagName('h3');

		foreach( $nodes_h1 as $node )
			if ( ! $node->hasAttribute( 'style' ) )
				$node->setAttribute( "style", "color: " . get_option( 'woocommerce_email_text_color' ) . "; display:block; font-family:Arial; font-size:34px; font-weight:bold; margin-top: 10px; margin-right:0; margin-bottom:10px; margin-left:0; text-align:left; line-height: 150%;" );

		foreach( $nodes_h2 as $node )
			if ( ! $node->hasAttribute( 'style' ) )
				$node->setAttribute( "style", "color: " . get_option( 'woocommerce_email_text_color' ) . "; display:block; font-family:Arial; font-size:30px; font-weight:bold; margin-top: 10px; margin-right:0; margin-bottom:10px; margin-left:0; text-align:left; line-height: 150%;" );

		foreach( $nodes_h3 as $node )
			if ( ! $node->hasAttribute( 'style' ) )
				$node->setAttribute( "style", "color: " . get_option( 'woocommerce_email_text_color' ) . "; display:block; font-family:Arial; font-size:26px; font-weight:bold; margin-top: 10px; margin-right:0; margin-bottom:10px; margin-left:0; text-align:left; line-height: 150%;" );

		$nodes = $dom->getElementsByTagName('a');

		foreach( $nodes as $node )
			if ( ! $node->hasAttribute( 'style' ) )
				$node->setAttribute( "style", "color: " . get_option( 'woocommerce_email_text_color' ) . "; font-weight:normal; text-decoration:underline;" );

		$content = $dom->saveHTML();

		return $content;
	}

	/**
	 * get_content_plain function.
	 *
	 * @access public
	 * @return void
	 */
	function get_content_plain() {}

	/**
	 * get_content_html function.
	 *
	 * @access public
	 * @return void
	 */
	function get_content_html() {}

	/**
	 * Get from name for email.
	 *
	 * @access public
	 * @return string
	 */
	function get_from_name() {
		return wp_specialchars_decode( esc_html( get_option( 'woocommerce_email_from_name' ) ), ENT_QUOTES );
	}

	/**
	 * Get from email address.
	 *
	 * @access public
	 * @return string
	 */
	function get_from_address() {
		return sanitize_email( get_option( 'woocommerce_email_from_address' ) );
	}

	/**
	 * Send the email.
	 *
	 * @access public
	 * @param mixed $to
	 * @param mixed $subject
	 * @param mixed $message
	 * @param string $headers
	 * @param string $attachments
	 * @return void
	 */
	function send( $to, $subject, $message, $headers, $attachments ) {
		add_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );
		add_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
		add_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );

		wp_mail( $to, $subject, $message, $headers, $attachments );

		remove_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );
		remove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
		remove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );
	}

    /**
     * Initialise Settings Form Fields - these are generic email options most will use.
     *
     * @access public
     * @return void
     */
    function init_form_fields() {
    	$this->form_fields = array(
			'enabled' => array(
				'title' 		=> __( 'Enable/Disable', 'woocommerce' ),
				'type' 			=> 'checkbox',
				'label' 		=> __( 'Enable this email notification', 'woocommerce' ),
				'default' 		=> 'yes'
			),
			'subject' => array(
				'title' 		=> __( 'Email subject', 'woocommerce' ),
				'type' 			=> 'text',
				'description' 	=> sprintf( __( 'Defaults to %s', 'woocommerce' ), $this->subject ),
				'placeholder' 	=> '',
				'default' 		=> ''
			),
			'heading' => array(
				'title' 		=> __( 'Email heading', 'woocommerce' ),
				'type' 			=> 'text',
				'description' 	=> sprintf( __( 'Defaults to %s', 'woocommerce' ), $this->heading ),
				'placeholder' 	=> '',
				'default' 		=> ''
			),
			'email_type' => array(
				'title' 		=> __( 'Email type', 'woocommerce' ),
				'type' 			=> 'select',
				'description' 	=> __( 'Choose which format of email to send.', 'woocommerce' ),
				'default' 		=> 'html',
				'class'			=> 'email_type',
				'options'		=> array(
					'plain' 		=> __( 'Plain text', 'woocommerce' ),
					'html' 			=> __( 'HTML', 'woocommerce' ),
					'multipart' 	=> __( 'Multipart', 'woocommerce' ),
				)
			)
		);
    }

	/**
	 * Admin Panel Options Processing
	 * - Saves the options to the DB
	 *
	 * @since 1.0.0
	 * @access public
	 * @return bool
	 */
    public function process_admin_options() {

    	// Save regular options
    	parent::process_admin_options();

    	// Save templates
		if ( ! empty( $_POST['template_html_code'] ) && ! empty( $this->template_html ) ) {

			$saved	= false;
			$file	= get_stylesheet_directory() . '/woocommerce/' . $this->template_html;
			$code 	= stripslashes( $_POST['template_html_code'] );

			if ( is_writeable( $file ) ) {
				$f = fopen( $file, 'w+' );
				if ( $f !== FALSE ) {
    				fwrite( $f, $code );
    				fclose( $f );
    				$saved = true;
    			}
			}

			if ( ! $saved ) {
    			$redirect = add_query_arg( 'wc_error', urlencode( __( 'Could not write to template file.', 'woocommerce' ) ) );
    			wp_redirect( $redirect );
    			exit;
    		}
		}
		if ( ! empty( $_POST['template_plain_code'] ) && ! empty( $this->template_plain ) ) {

    		$saved	= false;
			$file	= get_stylesheet_directory() . '/woocommerce/' . $this->template_plain;
			$code 	= stripslashes( $_POST['template_plain_code'] );

			if ( is_writeable( $file ) ) {
				$f = fopen( $file, 'w+' );
				if ( $f !== FALSE ) {
    				fwrite( $f, $code );
    				fclose( $f );
    				$saved = true;
    			}
			}

			if ( ! $saved ) {
    			$redirect = add_query_arg( 'wc_error', __( 'Could not write to template file.', 'woocommerce' ) );
    			wp_redirect( $redirect );
    			exit;
    		}
		}
    }

	/**
	 * Admin Options
	 *
	 * Setup the gateway settings screen.
	 * Override this in your gateway.
	 *
	 * @since 1.0.0
	 * @access public
	 * @return void
	 */
	function admin_options() {
		global $woocommerce;

		// Handle any actions
		if ( ! empty( $this->template_html ) || ! empty( $this->template_plain ) ) {

			if ( ! empty( $_GET['move_template'] ) && ( $template = esc_attr( basename( $_GET['move_template'] ) ) ) ) {
				if ( ! empty( $this->$template ) ) {
					if (  wp_mkdir_p( dirname( get_stylesheet_directory() . '/woocommerce/' . $this->$template ) ) && ! file_exists( get_stylesheet_directory() . '/woocommerce/' . $this->$template ) ) {
						copy( $this->template_base . $this->$template, get_stylesheet_directory() . '/woocommerce/' . $this->$template );
						echo '

' . __( 'Template file copied to theme.', 'woocommerce' ) . '

';
					}
				}
			}

			if ( ! empty( $_GET['delete_template'] ) && ( $template = esc_attr( basename( $_GET['delete_template'] ) ) ) ) {
				if ( ! empty( $this->$template ) ) {
					if ( file_exists( get_stylesheet_directory() . '/woocommerce/' . $this->$template ) ) {
						unlink( get_stylesheet_directory() . '/woocommerce/' . $this->$template );
						echo '

' . __( 'Template file deleted from theme.', 'woocommerce' ) . '

';
					}
				}
			}

		}

		?>

<?php echo ( ! empty( $this->title ) ) ? $this->title : __( 'Settings','woocommerce' ) ; ?>

		<?php echo ( ! empty( $this->description ) ) ? wpautop( $this->description ) : ''; ?>

			<?php $this->generate_settings_html(); ?>

		<?php if ( ! empty( $this->template_html ) || ! empty( $this->template_plain ) ) { ?>

			<?php
				$templates = array(
					'template_html' 	=> __( 'HTML template', 'woocommerce' ),
					'template_plain' 	=> __( 'Plain text template', 'woocommerce' )
				);
				foreach ( $templates as $template => $title ) :
					if ( empty( $this->$template ) )
						continue;

					$local_file = get_stylesheet_directory() . '/woocommerce/' . $this->$template;
					$core_file 	= $this->template_base . $this->$template;
					?>
					<div class="template <?php echo $template; ?>">

<?php echo wp_kses_post( $title ); ?>

						<?php if ( file_exists( $local_file ) ) : ?>

								<?php if ( is_writable( $local_file ) ) : ?>
									<a href="<?php echo remove_query_arg( array( 'move_template', 'saved' ), add_query_arg( 'delete_template', $template ) ); ?>" class="delete_template button"><?php _e( 'Delete template file', 'woocommerce' ); ?>
								<?php endif; ?>

								<?php printf( __( 'This template has been overridden by your theme and can be found in: %s.', 'woocommerce' ), 'yourtheme/woocommerce/' . $this->$template ); ?>

								<textarea class="code" cols="25" rows="20" <?php if ( ! is_writable( $local_file ) ) : ?>readonly="readonly" disabled="disabled"<?php else : ?>data-name="<?php echo $template . '_code'; ?>"<?php endif; ?>><?php echo file_get_contents( $local_file ); ?></textarea>

						<?php elseif ( file_exists( $core_file ) ) : ?>

								<?php if ( ( is_dir( get_stylesheet_directory() . '/woocommerce/emails/' ) && is_writable( get_stylesheet_directory() . '/woocommerce/emails/' ) ) || is_writable( get_stylesheet_directory() ) ) : ?>
									<a href="<?php echo remove_query_arg( array( 'delete_template', 'saved' ), add_query_arg( 'move_template', $template ) ); ?>" class="button"><?php _e( 'Copy file to theme', 'woocommerce' ); ?>
								<?php endif; ?>

								<?php printf( __( 'To override and edit this email template copy %s to your theme folder: %s.', 'woocommerce' ), plugin_basename( $core_file ) , 'yourtheme/woocommerce/' . $this->$template ); ?>

								<textarea class="code" readonly="readonly" disabled="disabled" cols="25" rows="20"><?php echo file_get_contents( $core_file ); ?></textarea>

						<?php else : ?>

<?php _e( 'File was not found.', 'woocommerce' ); ?>

						<?php endif; ?>

					<?php
				endforeach;
			?>

			<?php
			$woocommerce->add_inline_js("
				jQuery('select.email_type').change(function(){

					var val = jQuery( this ).val();

					jQuery('.template_plain, .template_html').show();

					if ( val != 'multipart' && val != 'html' )
						jQuery('.template_html').hide();

					if ( val != 'multipart' && val != 'plain' )
						jQuery('.template_plain').hide();

				}).change();

				var view = '" . esc_js( __( 'View template', 'woocommerce' ) ) . "';
				var hide = '" . esc_js( __( 'Hide template', 'woocommerce' ) ) . "';

				jQuery('a.toggle_editor').text( view ).toggle( function() {
					jQuery( this ).text( hide ).closest('.template').find('.editor').slideToggle();
					return false;
				}, function() {
					jQuery( this ).text( view ).closest('.template').find('.editor').slideToggle();
					return false;
				} );

				jQuery('a.delete_template').click(function(){
					var answer = confirm('" . esc_js( __( 'Are you sure you want to delete this template file?', 'woocommerce' ) ) . "');

					if (answer)
						return true;

					return false;
				});

				jQuery('.editor textarea').change(function(){
					var name = jQuery(this).attr( 'data-name' );

					if ( name )
						jQuery(this).attr( 'name', name );
				});
			");
		}
	}
}


text:
/*global jest, describe, beforeEach, it, expect*/

jest.autoMockOff();

describe('componentMethodsHandler', () => {
  let documentation;
  let componentMethodsJsDocHandler;

  beforeEach(() => {
    documentation = new (require('../../Documentation'));
    componentMethodsJsDocHandler = require('../componentMethodsJsDocHandler');
  });

  it('stays the same when no docblock is present', () => {
    const methods = [{
      name: 'foo',
      docblock: null,
      modifiers: [],
      returns: null,
      params: [{
        name: 'test',
        type: null,
      }],
    }];
    documentation.set('methods', methods);
    componentMethodsJsDocHandler(documentation, null);
    expect(documentation.get('methods')).toEqual(methods);
  });

  it('adds js doc types when no flow types', () => {
    documentation.set('methods', [{
      name: 'foo',
      docblock: `
        @param {string} test
        @returns {string}
      `,
      modifiers: [],
      returns: null,
      params: [{
        name: 'test',
        type: null,
      }],
    }]);
    componentMethodsJsDocHandler(documentation, null);
    expect(documentation.get('methods')).toEqual([{
      name: 'foo',
      description: null,
      docblock: `
        @param {string} test
        @returns {string}
      `,
      modifiers: [],
      returns: {
        type: {name: 'string'},
        description: null,
      },
      params: [{
        name: 'test',
        description: null,
        type: {name: 'string'},
      }],
    }]);
  });

  it('keeps flow types over js doc types', () => {
    documentation.set('methods', [{
      name: 'foo',
      docblock: `
        @param {string} test
        @returns {string}
      `,
      modifiers: [],
      returns: {
        type: {name: 'number'},
      },
      params: [{
        name: 'test',
        type: {name: 'number'},
      }],
    }]);
    componentMethodsJsDocHandler(documentation, null);
    expect(documentation.get('methods')).toEqual([{
      name: 'foo',
      description: null,
      docblock: `
        @param {string} test
        @returns {string}
      `,
      modifiers: [],
      returns: {
        type: {name: 'number'},
        description: null,
      },
      params: [{
        name: 'test',
        description: null,
        type: {name: 'number'},
      }],
    }]);
  });

  it('adds descriptions', () => {
    documentation.set('methods', [{
      name: 'foo',
      docblock: `
        The foo method.
        @param test The test
        @returns The number
      `,
      modifiers: [],
      returns: null,
      params: [{
        name: 'test',
        type: null,
      }],
    }]);
    componentMethodsJsDocHandler(documentation, null);
    expect(documentation.get('methods')).toEqual([{
      name: 'foo',
      description: 'The foo method.',
      docblock: `
        The foo method.
        @param test The test
        @returns The number
      `,
      modifiers: [],
      returns: {
        description: 'The number',
        type: null,
      },
      params: [{
        name: 'test',
        description: 'The test',
        type: null,
      }],
    }]);
  });
});


text:
@interface LeftTableViewController : UITableViewController

@end


text:
.class Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter;
.super Landroid/widget/BaseAdapter;
.source "SelectShareAppDialog.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/shotcutkey/SelectShareAppDialog;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "myAdapter"
.end annotation

.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$ViewHolder;
    }
.end annotation

# instance fields
.field private inflater:Landroid/view/LayoutInflater;

.field final synthetic this$0:Lcom/android/shotcutkey/SelectShareAppDialog;

# direct methods
.method public constructor <init>(Lcom/android/shotcutkey/SelectShareAppDialog;)V
    .locals 2

    .prologue
    .line 294
    iput-object p1, p0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter;->this$0:Lcom/android/shotcutkey/SelectShareAppDialog;

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    .line 292
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter;->inflater:Landroid/view/LayoutInflater;

    .line 295
    # getter for: Lcom/android/shotcutkey/SelectShareAppDialog;->mContext:Landroid/content/Context;
    invoke-static {p1}, Lcom/android/shotcutkey/SelectShareAppDialog;->access$1(Lcom/android/shotcutkey/SelectShareAppDialog;)Landroid/content/Context;

    move-result-object v0

    .line 296
    const-string v1, "layout_inflater"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/LayoutInflater;

    .line 295
    iput-object v0, p0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter;->inflater:Landroid/view/LayoutInflater;

    .line 297
    return-void
.end method

.method static synthetic access$0(Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter;)Lcom/android/shotcutkey/SelectShareAppDialog;
    .locals 1

    .prologue
    .line 290
    iget-object v0, p0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter;->this$0:Lcom/android/shotcutkey/SelectShareAppDialog;

    return-object v0
.end method

# virtual methods
.method public getCount()I
    .locals 1

    .prologue
    .line 301
    iget-object v0, p0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter;->this$0:Lcom/android/shotcutkey/SelectShareAppDialog;

    # getter for: Lcom/android/shotcutkey/SelectShareAppDialog;->mListInfo:Ljava/util/ArrayList;
    invoke-static {v0}, Lcom/android/shotcutkey/SelectShareAppDialog;->access$2(Lcom/android/shotcutkey/SelectShareAppDialog;)Ljava/util/ArrayList;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1
    .param p1, "arg0"    # I

    .prologue
    .line 306
    iget-object v0, p0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter;->this$0:Lcom/android/shotcutkey/SelectShareAppDialog;

    # getter for: Lcom/android/shotcutkey/SelectShareAppDialog;->mListInfo:Ljava/util/ArrayList;
    invoke-static {v0}, Lcom/android/shotcutkey/SelectShareAppDialog;->access$2(Lcom/android/shotcutkey/SelectShareAppDialog;)Ljava/util/ArrayList;

    move-result-object v0

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2
    .param p1, "arg0"    # I

    .prologue
    .line 311
    int-to-long v0, p1

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 8
    .param p1, "arg0"    # I
    .param p2, "arg1"    # Landroid/view/View;
    .param p3, "arg2"    # Landroid/view/ViewGroup;

    .prologue
    const/16 v7, 0x8

    const/4 v6, 0x0

    .line 316
    const/4 v2, 0x0

    .line 317
    .local v2, "view":Landroid/view/View;
    const/4 v0, 0x0

    .line 319
    .local v0, "holder":Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$ViewHolder;
    iget-object v3, p0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter;->inflater:Landroid/view/LayoutInflater;

    const v4, 0x7f030043

    const/4 v5, 0x0

    invoke-virtual {v3, v4, v5}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v2

    .line 320
    new-instance v0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$ViewHolder;

    .end local v0    # "holder":Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$ViewHolder;
    invoke-direct {v0, p0, v2}, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$ViewHolder;-><init>(Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter;Landroid/view/View;)V

    .line 321
    .restart local v0    # "holder":Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$ViewHolder;
    invoke-virtual {v2, v0}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    .line 327
    invoke-virtual {p0, p1}, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter;->getItem(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/android/shotcutkey/SelectShareAppDialog$ListItemInfo;

    .line 332
    .local v1, "info":Lcom/android/shotcutkey/SelectShareAppDialog$ListItemInfo;
    invoke-virtual {v1}, Lcom/android/shotcutkey/SelectShareAppDialog$ListItemInfo;->getIcon()Landroid/graphics/drawable/Drawable;

    move-result-object v3

    if-eqz v3, :cond_3

    .line 333
    iget-object v3, v0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$ViewHolder;->appIcon:Landroid/widget/ImageView;

    invoke-virtual {v1}, Lcom/android/shotcutkey/SelectShareAppDialog$ListItemInfo;->getIcon()Landroid/graphics/drawable/Drawable;

    move-result-object v4

    invoke-virtual {v3, v4}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 338
    :goto_0
    invoke-virtual {v1}, Lcom/android/shotcutkey/SelectShareAppDialog$ListItemInfo;->getAppName()Ljava/lang/String;

    move-result-object v3

    if-eqz v3, :cond_4

    .line 339
    iget-object v3, v0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$ViewHolder;->appName:Landroid/widget/TextView;

    invoke-virtual {v1}, Lcom/android/shotcutkey/SelectShareAppDialog$ListItemInfo;->getAppName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 344
    :goto_1
    iget-object v3, v0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$ViewHolder;->raidoButton:Lcom/zte/mifavor/widget/RadioButtonZTE;

    invoke-virtual {v3, v6}, Lcom/zte/mifavor/widget/RadioButtonZTE;->setVisibility(I)V

    .line 346
    # getter for: Lcom/android/shotcutkey/SelectShareAppDialog;->DEBUG:Z
    invoke-static {}, Lcom/android/shotcutkey/SelectShareAppDialog;->access$3()Z

    move-result v3

    if-eqz v3, :cond_0

    .line 347
    # getter for: Lcom/android/shotcutkey/SelectShareAppDialog;->TAG:Ljava/lang/String;
    invoke-static {}, Lcom/android/shotcutkey/SelectShareAppDialog;->access$4()Ljava/lang/String;

    move-result-object v3

    .line 348
    new-instance v4, Ljava/lang/StringBuilder;

    const-string v5, "getView() arg0 = "

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v4, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, ",  enabled = "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    .line 349
    invoke-virtual {v1}, Lcom/android/shotcutkey/SelectShareAppDialog$ListItemInfo;->getEnabled()Z

    move-result v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, ",  name = "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    .line 350
    invoke-virtual {v1}, Lcom/android/shotcutkey/SelectShareAppDialog$ListItemInfo;->getAppName()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    .line 348
    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    .line 347
    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 351
    :cond_0
    invoke-virtual {v1}, Lcom/android/shotcutkey/SelectShareAppDialog$ListItemInfo;->getEnabled()Z

    move-result v3

    if-nez v3, :cond_2

    .line 352
    # getter for: Lcom/android/shotcutkey/SelectShareAppDialog;->DEBUG:Z
    invoke-static {}, Lcom/android/shotcutkey/SelectShareAppDialog;->access$3()Z

    move-result v3

    if-eqz v3, :cond_1

    .line 353
    # getter for: Lcom/android/shotcutkey/SelectShareAppDialog;->TAG:Ljava/lang/String;
    invoke-static {}, Lcom/android/shotcutkey/SelectShareAppDialog;->access$4()Ljava/lang/String;

    move-result-object v3

    new-instance v4, Ljava/lang/StringBuilder;

    const-string v5, "getView() name = "

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Lcom/android/shotcutkey/SelectShareAppDialog$ListItemInfo;->getAppName()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 355
    :cond_1
    iget-object v3, v0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$ViewHolder;->appName:Landroid/widget/TextView;

    const v4, 0x7f070022

    invoke-virtual {v3, v4}, Landroid/widget/TextView;->setTextColor(I)V

    .line 356
    iget-object v3, v0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$ViewHolder;->raidoButton:Lcom/zte/mifavor/widget/RadioButtonZTE;

    invoke-virtual {v3, v6}, Lcom/zte/mifavor/widget/RadioButtonZTE;->setEnabled(Z)V

    .line 359
    :cond_2
    iget-object v3, v0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$ViewHolder;->raidoButton:Lcom/zte/mifavor/widget/RadioButtonZTE;

    invoke-virtual {v1}, Lcom/android/shotcutkey/SelectShareAppDialog$ListItemInfo;->getChecked()Z

    move-result v4

    invoke-virtual {v3, v4}, Lcom/zte/mifavor/widget/RadioButtonZTE;->setChecked(Z)V

    .line 360
    iget-object v3, v0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$ViewHolder;->raidoButton:Lcom/zte/mifavor/widget/RadioButtonZTE;

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v4

    invoke-virtual {v3, v4}, Lcom/zte/mifavor/widget/RadioButtonZTE;->setTag(Ljava/lang/Object;)V

    .line 361
    iget-object v3, v0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$ViewHolder;->raidoButton:Lcom/zte/mifavor/widget/RadioButtonZTE;

    new-instance v4, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$1;

    invoke-direct {v4, p0}, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$1;-><init>(Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter;)V

    invoke-virtual {v3, v4}, Lcom/zte/mifavor/widget/RadioButtonZTE;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 400
    return-object v2

    .line 335
    :cond_3
    iget-object v3, v0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$ViewHolder;->appIcon:Landroid/widget/ImageView;

    invoke-virtual {v3, v7}, Landroid/widget/ImageView;->setVisibility(I)V

    goto/16 :goto_0

    .line 341
    :cond_4
    iget-object v3, v0, Lcom/android/shotcutkey/SelectShareAppDialog$myAdapter$ViewHolder;->appName:Landroid/widget/TextView;

    invoke-virtual {v3, v7}, Landroid/widget/TextView;->setVisibility(I)V

    goto/16 :goto_1
.end method


text:
public class Main {

  /// CHECK-START: java.lang.Object Main.boundTypeForIf(java.lang.Object) builder (after)
  /// CHECK:     BoundType
  public static Object boundTypeForIf(Object a) {
    if (a != null) {
      return a.toString();
    } else {
      return null;
    }
  }

  /// CHECK-START: java.lang.Object Main.boundTypeForInstanceOf(java.lang.Object) builder (after)
  /// CHECK:     BoundType
  public static Object boundTypeForInstanceOf(Object a) {
    if (a instanceof Main) {
      return (Main)a;
    } else {
      return null;
    }
  }

  /// CHECK-START: java.lang.Object Main.noBoundTypeForIf(java.lang.Object) builder (after)
  /// CHECK-NOT: BoundType
  public static Object noBoundTypeForIf(Object a) {
    if (a == null) {
      return new Object();
    } else {
      return null;
    }
  }

  /// CHECK-START: java.lang.Object Main.noBoundTypeForInstanceOf(java.lang.Object) builder (after)
  /// CHECK-NOT: BoundType
  public static Object noBoundTypeForInstanceOf(Object a) {
    if (a instanceof Main) {
      return new Object();
    } else {
      return null;
    }
  }

  public static void main(String[] args) {  }
}


text:
package kubelet

import (
	"testing"
	"time"

	"k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/types"
	"k8s.io/client-go/tools/record"
	testingclock "k8s.io/utils/clock/testing"
)

// mockPodStatusProvider returns the status on the specified pod
type mockPodStatusProvider struct {
	pods []*v1.Pod
}

// GetPodStatus returns the status on the associated pod with matching uid (if found)
func (m *mockPodStatusProvider) GetPodStatus(uid types.UID) (v1.PodStatus, bool) {
	for _, pod := range m.pods {
		if pod.UID == uid {
			return pod.Status, true
		}
	}
	return v1.PodStatus{}, false
}

// TestActiveDeadlineHandler verifies the active deadline handler functions as expected.
func TestActiveDeadlineHandler(t *testing.T) {
	pods := newTestPods(4)
	fakeClock := testingclock.NewFakeClock(time.Now())
	podStatusProvider := &mockPodStatusProvider{pods: pods}
	fakeRecorder := &record.FakeRecorder{}
	handler, err := newActiveDeadlineHandler(podStatusProvider, fakeRecorder, fakeClock)
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}

	now := metav1.Now()
	startTime := metav1.NewTime(now.Time.Add(-1 * time.Minute))

	// this pod has exceeded its active deadline
	exceededActiveDeadlineSeconds := int64(30)
	pods[0].Status.StartTime = &startTime
	pods[0].Spec.ActiveDeadlineSeconds = &exceededActiveDeadlineSeconds

	// this pod has not exceeded its active deadline
	notYetActiveDeadlineSeconds := int64(120)
	pods[1].Status.StartTime = &startTime
	pods[1].Spec.ActiveDeadlineSeconds = &notYetActiveDeadlineSeconds

	// this pod has no deadline
	pods[2].Status.StartTime = &startTime
	pods[2].Spec.ActiveDeadlineSeconds = nil

	testCases := []struct {
		pod      *v1.Pod
		expected bool
	}{{pods[0], true}, {pods[1], false}, {pods[2], false}, {pods[3], false}}

	for i, testCase := range testCases {
		if actual := handler.ShouldSync(testCase.pod); actual != testCase.expected {
			t.Errorf("[%d] ShouldSync expected %#v, got %#v", i, testCase.expected, actual)
		}
		actual := handler.ShouldEvict(testCase.pod)
		if actual.Evict != testCase.expected {
			t.Errorf("[%d] ShouldEvict.Evict expected %#v, got %#v", i, testCase.expected, actual.Evict)
		}
		if testCase.expected {
			if actual.Reason != reason {
				t.Errorf("[%d] ShouldEvict.Reason expected %#v, got %#v", i, message, actual.Reason)
			}
			if actual.Message != message {
				t.Errorf("[%d] ShouldEvict.Message expected %#v, got %#v", i, message, actual.Message)
			}
		}
	}
}


text:
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace PackageExplorer
{
    public class UriConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var uri = (Uri) value;
            return uri == null ? null : uri.ToString();
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var stringValue = (string) value;
            if (String.IsNullOrEmpty(stringValue))
            {
                return null;
            }
            else
            {
                Uri uri;
                if (Uri.TryCreate(stringValue, UriKind.Absolute, out uri))
                {
                    return uri;
                }
                else
                {
                    return DependencyProperty.UnsetValue;
                }
            }
        }

        #endregion
    }
}


text:
package org.codehaus.griffon.compile.core;

/**
 * @author Andres Almiray
 */
public interface AnnotationHandler {
}


text:
#ifndef BOOKMARKS_H
#define BOOKMARKS_H

#include <QtCore/QObject>
#include <QtCore/QAbstractItemModel>

#include <QtGui/QUndoCommand>

/*!
    Bookmark manager, owner of the bookmarks, loads, saves and basic tasks
  */
class AutoSaver;
class BookmarkNode;
class BookmarksModel;
class BookmarksManager : public QObject
{
    Q_OBJECT

signals:
    void entryAdded(BookmarkNode *item);
    void entryRemoved(BookmarkNode *parent, int row, BookmarkNode *item);
    void entryChanged(BookmarkNode *item);

public:
    BookmarksManager(QObject *parent = 0);
    ~BookmarksManager();

    void addBookmark(BookmarkNode *parent, BookmarkNode *node, int row = -1);
    void removeBookmark(BookmarkNode *node);
    void setTitle(BookmarkNode *node, const QString &newTitle);
    void setUrl(BookmarkNode *node, const QString &newUrl);
    void changeExpanded();

    BookmarkNode *bookmarks();
    BookmarkNode *menu();
    BookmarkNode *toolbar();

    BookmarksModel *bookmarksModel();
    QUndoStack *undoRedoStack() { return &m_commands; };

public slots:
    void importBookmarks();
    void exportBookmarks();

private slots:
    void save() const;

private:
    void load();

    bool m_loaded;
    AutoSaver *m_saveTimer;
    BookmarkNode *m_bookmarkRootNode;
    BookmarksModel *m_bookmarkModel;
    QUndoStack m_commands;

    friend class RemoveBookmarksCommand;
    friend class ChangeBookmarkCommand;
};

class RemoveBookmarksCommand : public QUndoCommand
{

public:
    RemoveBookmarksCommand(BookmarksManager *m_bookmarkManagaer, BookmarkNode *parent, int row);
    ~RemoveBookmarksCommand();
    void undo();
    void redo();

protected:
    int m_row;
    BookmarksManager *m_bookmarkManagaer;
    BookmarkNode *m_node;
    BookmarkNode *m_parent;
    bool m_done;
};

class InsertBookmarksCommand : public RemoveBookmarksCommand
{

public:
    InsertBookmarksCommand(BookmarksManager *m_bookmarkManagaer,
        BookmarkNode *parent, BookmarkNode *node, int row);
    void undo() { RemoveBookmarksCommand::redo(); }
    void redo() { RemoveBookmarksCommand::undo(); }

};

class ChangeBookmarkCommand : public QUndoCommand
{

public:
    ChangeBookmarkCommand(BookmarksManager *m_bookmarkManagaer,
        BookmarkNode *node, const QString &newValue, bool title);
    void undo();
    void redo();

private:
    BookmarksManager *m_bookmarkManagaer;
    bool m_title;
    QString m_oldValue;
    QString m_newValue;
    BookmarkNode *m_node;
};

/*!
    BookmarksModel is a QAbstractItemModel wrapper around the BookmarkManager
  */
#include <QtGui/QIcon>
class BookmarksModel : public QAbstractItemModel
{
    Q_OBJECT

public slots:
    void entryAdded(BookmarkNode *item);
    void entryRemoved(BookmarkNode *parent, int row, BookmarkNode *item);
    void entryChanged(BookmarkNode *item);

public:
    enum Roles {
        TypeRole = Qt::UserRole + 1,
        UrlRole = Qt::UserRole + 2,
        UrlStringRole = Qt::UserRole + 3,
        SeparatorRole = Qt::UserRole + 4
    };

    BookmarksModel(BookmarksManager *bookmarkManager, QObject *parent = 0);
    inline BookmarksManager *bookmarksManager() const { return m_bookmarksManager; }

    QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    int columnCount(const QModelIndex &parent = QModelIndex()) const;
    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    QModelIndex index(int, int, const QModelIndex& = QModelIndex()) const;
    QModelIndex parent(const QModelIndex& index= QModelIndex()) const;
    Qt::ItemFlags flags(const QModelIndex &index) const;
    Qt::DropActions supportedDropActions () const;
    bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
    bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
    QMimeData *mimeData(const QModelIndexList &indexes) const;
    QStringList mimeTypes() const;
    bool dropMimeData(const QMimeData *data,
        Qt::DropAction action, int row, int column, const QModelIndex &parent);
    bool hasChildren(const QModelIndex &parent = QModelIndex()) const;

    BookmarkNode *node(const QModelIndex &index) const;
    QModelIndex index(BookmarkNode *node) const;

private:

    bool m_endMacro;
    BookmarksManager *m_bookmarksManager;
};

// Menu that is dynamically populated from the bookmarks
#include "modelmenu.h"
class BookmarksMenu : public ModelMenu
{
    Q_OBJECT

signals:
    void openUrl(const QUrl &url);

public:
     BookmarksMenu(QWidget *parent = 0);
     void setInitialActions(QList<QAction*> actions);

protected:
    bool prePopulated();

private slots:
    void activated(const QModelIndex &index);

private:
    BookmarksManager *m_bookmarksManager;
    QList<QAction*> m_initialActions;
};

/*
    Proxy model that filters out the bookmarks so only the folders
    are left behind.  Used in the add bookmark dialog combobox.
 */
#include <QtGui/QSortFilterProxyModel>
class AddBookmarkProxyModel : public QSortFilterProxyModel
{
    Q_OBJECT
public:
    AddBookmarkProxyModel(QObject * parent = 0);
    int columnCount(const QModelIndex & parent = QModelIndex()) const;

protected:
    bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
};

/*!
    Add bookmark dialog
 */
#include "ui_addbookmarkdialog.h"
class AddBookmarkDialog : public QDialog, public Ui_AddBookmarkDialog
{
    Q_OBJECT

public:
    AddBookmarkDialog(const QString &url, const QString &title, QWidget *parent = 0, BookmarksManager *bookmarkManager = 0);

private slots:
    void accept();

private:
    QString m_url;
    BookmarksManager *m_bookmarksManager;
    AddBookmarkProxyModel *m_proxyModel;
};

#include "ui_bookmarks.h"
class TreeProxyModel;
class BookmarksDialog : public QDialog, public Ui_BookmarksDialog
{
    Q_OBJECT

signals:
    void openUrl(const QUrl &url);

public:
    BookmarksDialog(QWidget *parent = 0, BookmarksManager *manager = 0);
    ~BookmarksDialog();

private slots:
    void customContextMenuRequested(const QPoint &pos);
    void open();
    void newFolder();

private:
    void expandNodes(BookmarkNode *node);
    bool saveExpandedNodes(const QModelIndex &parent);

    BookmarksManager *m_bookmarksManager;
    BookmarksModel *m_bookmarksModel;
    TreeProxyModel *m_proxyModel;
};

#include <QtGui/QToolBar>
class BookmarksToolBar : public QToolBar
{
    Q_OBJECT

signals:
    void openUrl(const QUrl &url);

public:
    BookmarksToolBar(BookmarksModel *model, QWidget *parent = 0);
    void setRootIndex(const QModelIndex &index);
    QModelIndex rootIndex() const;

protected:
    void dragEnterEvent(QDragEnterEvent *event);
    void dropEvent(QDropEvent *event);

private slots:
    void triggered(QAction *action);
    void activated(const QModelIndex &index);
    void build();

private:
    BookmarksModel *m_bookmarksModel;
    QPersistentModelIndex m_root;
};

#endif // BOOKMARKS_H


text:
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

<suite name="SystemTestSuite" verbose="1">
    <test name="Test">
        <classes>
            <class name="au.gov.ga.geodesy.gws.systemtest.AwsSystemTest"/>
            <class name="au.gov.ga.geodesy.gws.systemtest.AuthorizationSystemTest"/>
            <class name="au.gov.ga.geodesy.gws.systemtest.CreateCorsNetworksSystemTest"/>
            <class name="au.gov.ga.geodesy.gws.systemtest.EndpointSecuritySystemTest"/>
            <class name="au.gov.ga.geodesy.gws.systemtest.UploadSiteLogsSystemTest"/>
            <class name="au.gov.ga.geodesy.gws.systemtest.SetupSystemTest"/>
        </classes>
    </test>
</suite>


text:
*
* $Id$
*
*======================================================================
*
* DISCLAIMER
*
* This material was prepared as an account of work sponsored by an
* agency of the United States Government.  Neither the United States
* Government nor the United States Department of Energy, nor Battelle,
* nor any of their employees, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR
* ASSUMES ANY LEGAL LIABILITY OR RESPONSIBILITY FOR THE ACCURACY,
* COMPLETENESS, OR USEFULNESS OF ANY INFORMATION, APPARATUS, PRODUCT,
* SOFTWARE, OR PROCESS DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT
* INFRINGE PRIVATELY OWNED RIGHTS.
*
* ACKNOWLEDGMENT
*
* This software and its documentation were produced with Government
* support under Contract Number DE-AC06-76RLO-1830 awarded by the United
* States Department of Energy.  The Government retains a paid-up
* non-exclusive, irrevocable worldwide license to reproduce, prepare
* derivative works, perform publicly and display publicly by or for the
* Government, including the right to distribute to other Government
* contractors.
*
*======================================================================
*
*  -- PEIGS  routine (version 2.1) --
*     Pacific Northwest Laboratory
*     July 28, 1995
*
*======================================================================
      program machine
c
c
      double precision dlamch
      real slamch
c
      write(*,*)
      write(*,*) ' Double Precision results'
      write(*,1000) ' depsilon ', dlamch('e')
      write(*,1000) ' dbase ', dlamch('b')
      write(*,1000) ' dsafeulp ', dlamch('s')
      write(*,1000) ' dlamch(u)  ', dlamch('u')
c
      write(*,*)
      write(*,*) ' Single Precision results'
      write(*,1000) ' depsilon ', slamch('e')
      write(*,1000) ' dbase ', slamch('b')
      write(*,1000) ' dsafeulp ', slamch('s')
      write(*,1000) ' slamch(u)  ', slamch('u')
      write(*,*)
 1000 FORMAT( A12, 1X, 1P, E26.16 )
      stop
      end


text:
package nachos.vm;

import nachos.machine.*;
import nachos.threads.*;
import nachos.userprog.*;
import nachos.vm.*;

/**
 * A kernel that can support multiple demand-paging user processes.
 */
public class VMKernel extends UserKernel {
    /**
     * Allocate a new VM kernel.
     */
    public VMKernel() {
        super();
    }

    /**
     * Initialize this kernel.
     */
    public void initialize(String[] args) {
        super.initialize(args);
    }

    /**
     * Test this kernel.
     */
    public void selfTest() {
        super.selfTest();
    }

    /**
     * Start running user programs.
     */
    public void run() {
        super.run();
    }

    /**
     * Terminate this kernel. Never returns.
     */
    public void terminate() {
        super.terminate();
    }

    // dummy variables to make javac smarter
    private static VMProcess dummy1 = null;

    private static final char dbgVM = 'v';
}


text:
使用 `open` 对下拉菜单进行自由扩展。如果希望点击自定义内容后关闭浮层,你需要使用受控模式自行控制([codesandbox](https://codesandbox.io/s/ji-ben-shi-yong-antd-4-21-7-forked-gnp4cy?file=/demo.js))。

## en-US

Customize the dropdown menu via `dropdownRender`. If you want to close the dropdown after clicking the custom content, you need to control `open` prop, here is an [codesandbox](https://codesandbox.io/s/ji-ben-shi-yong-antd-4-21-7-forked-gnp4cy?file=/demo.js).


text:
package org.asteriskjava.manager.response;

/**
 * Corresponds to a PingAction and contains an additional (yet useless) ping property.
 *
 * @author srt
 * @see org.asteriskjava.manager.action.PingAction
 */
public class PingResponse extends ManagerResponse {
    private static final long serialVersionUID = 0L;

    private String ping;
    private String timestamp;

    /**
     * Returns always "Pong".
     *
     * @return always "Pong".
     */
    public String getPing() {
        return ping;
    }

    public void setPing(String ping) {
        this.ping = ping;
    }

    /**
     * Timestamp for the response.
     *
     * @return Timestamp as a String, e.g 1353747825.795863
     * @since 1.0.0
     */
    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }
}


text:
ALTER TABLE "AWARD_NOTEPAD"
	ADD ( "CREATE_USER" VARCHAR2(60) NULL )
/
--Populate new field with existing data
UPDATE AWARD_NOTEPAD
SET CREATE_USER  = UPDATE_USER
/
COMMIT
/
--make new field non-nullable
ALTER TABLE "AWARD_NOTEPAD" MODIFY ( "CREATE_USER" VARCHAR2(60) NOT NULL )


text:
package rule

import (
	"encoding/json"
	"fmt"

	"github.com/influxdata/flux/ast"
	"github.com/influxdata/influxdb/v2"
	"github.com/influxdata/influxdb/v2/notification/endpoint"
	"github.com/influxdata/influxdb/v2/notification/flux"
)

// Slack is the notification rule config of slack.
type Slack struct {
	Base
	Channel         string `json:"channel"`
	MessageTemplate string `json:"messageTemplate"`
}

// GenerateFlux generates a flux script for the slack notification rule.
func (s *Slack) GenerateFlux(e influxdb.NotificationEndpoint) (string, error) {
	slackEndpoint, ok := e.(*endpoint.Slack)
	if !ok {
		return "", fmt.Errorf("endpoint provided is a %s, not an Slack endpoint", e.Type())
	}
	p, err := s.GenerateFluxAST(slackEndpoint)
	if err != nil {
		return "", err
	}
	return ast.Format(p), nil
}

// GenerateFluxAST generates a flux AST for the slack notification rule.
func (s *Slack) GenerateFluxAST(e *endpoint.Slack) (*ast.Package, error) {
	f := flux.File(
		s.Name,
		flux.Imports("influxdata/influxdb/monitor", "slack", "influxdata/influxdb/secrets", "experimental"),
		s.generateFluxASTBody(e),
	)
	return &ast.Package{Package: "main", Files: []*ast.File{f}}, nil
}

func (s *Slack) generateFluxASTBody(e *endpoint.Slack) []ast.Statement {
	var statements []ast.Statement
	statements = append(statements, s.generateTaskOption())
	if e.Token.Key != "" {
		statements = append(statements, s.generateFluxASTSecrets(e))
	}
	statements = append(statements, s.generateFluxASTEndpoint(e))
	statements = append(statements, s.generateFluxASTNotificationDefinition(e))
	statements = append(statements, s.generateFluxASTStatuses())
	statements = append(statements, s.generateLevelChecks()...)
	statements = append(statements, s.generateFluxASTNotifyPipe())

	return statements
}

func (s *Slack) generateFluxASTSecrets(e *endpoint.Slack) ast.Statement {
	call := flux.Call(flux.Member("secrets", "get"), flux.Object(flux.Property("key", flux.String(e.Token.Key))))

	return flux.DefineVariable("slack_secret", call)
}

func (s *Slack) generateFluxASTEndpoint(e *endpoint.Slack) ast.Statement {
	props := []*ast.Property{}
	if e.Token.Key != "" {
		props = append(props, flux.Property("token", flux.Identifier("slack_secret")))
	}
	if e.URL != "" {
		props = append(props, flux.Property("url", flux.String(e.URL)))
	}
	call := flux.Call(flux.Member("slack", "endpoint"), flux.Object(props...))

	return flux.DefineVariable("slack_endpoint", call)
}

func (s *Slack) generateFluxASTNotifyPipe() ast.Statement {
	endpointProps := []*ast.Property{}
	endpointProps = append(endpointProps, flux.Property("channel", flux.String(s.Channel)))
	// TODO(desa): are these values correct?
	endpointProps = append(endpointProps, flux.Property("text", flux.String(s.MessageTemplate)))
	endpointProps = append(endpointProps, flux.Property("color", s.generateSlackColors()))
	endpointFn := flux.Function(flux.FunctionParams("r"), flux.Object(endpointProps...))

	props := []*ast.Property{}
	props = append(props, flux.Property("data", flux.Identifier("notification")))
	props = append(props, flux.Property("endpoint",
		flux.Call(flux.Identifier("slack_endpoint"), flux.Object(flux.Property("mapFn", endpointFn)))))

	call := flux.Call(flux.Member("monitor", "notify"), flux.Object(props...))

	return flux.ExpressionStatement(flux.Pipe(flux.Identifier("all_statuses"), call))
}

func (s *Slack) generateSlackColors() ast.Expression {
	level := flux.Member("r", "_level")
	return flux.If(
		flux.Equal(level, flux.String("crit")),
		flux.String("danger"),
		flux.If(
			flux.Equal(level, flux.String("warn")),
			flux.String("warning"),
			flux.String("good"),
		),
	)
}

type slackAlias Slack

// MarshalJSON implement json.Marshaler interface.
func (s Slack) MarshalJSON() ([]byte, error) {
	return json.Marshal(
		struct {
			slackAlias
			Type string `json:"type"`
		}{
			slackAlias: slackAlias(s),
			Type:       s.Type(),
		})
}

// Valid returns where the config is valid.
func (s Slack) Valid() error {
	if err := s.Base.valid(); err != nil {
		return err
	}
	if s.MessageTemplate == "" {
		return &influxdb.Error{
			Code: influxdb.EInvalid,
			Msg:  "slack msg template is empty",
		}
	}
	return nil
}

// Type returns the type of the rule config.
func (s Slack) Type() string {
	return "slack"
}


text:
SOAP 1.2: T63 validateCountryCode
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$HTTP_RAW_POST_DATA = <<<EOF
<?xml version='1.0' ?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
  <env:Header>
    <test:validateCountryCode xmlns:test="http://example.org/ts-tests"
          env:role="http://example.org/ts-tests/C"
          env:mustUnderstand="1">ABCD</test:validateCountryCode>
  </env:Header>
  <env:Body>
  </env:Body>
</env:Envelope>

EOF;
include "soap12-test.inc";
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://example.org/ts-tests"><env:Header><ns1:validateCountryCodeFault>Country code must be 2 letters.</ns1:validateCountryCodeFault></env:Header><env:Body><env:Fault><env:Code><env:Value>env:Sender</env:Value></env:Code><env:Reason><env:Text>Not a valid country code</env:Text></env:Reason></env:Fault></env:Body></env:Envelope>
ok


text:
using Xunit;
using System;
using KbgSoft.LineCounter.Strategies;

namespace TeamBinary.LineCounter.Tests
{
    public class CsStrategyTests
    {
		[Fact]
        public void IgnoredLines()
		{
			var endOfObjectInitializer = "};";

			var codeLines = new CSharpStrategy().Count(new []{" ; "," { ", " } ",endOfObjectInitializer}).CodeLines;

			Assert.Equal(0, codeLines);

			//Console.WriteLine(new CSharpStrategy().Count(@"C:\src\KBGit\git.cs").CodeLines);
			//Console.WriteLine(new CSharpStrategy().Count(@"C:\src\KBGit\git.cs").DocumentationLines);
		}

	    [Fact]
	    public void Manual()
	    {
		    Console.WriteLine(new CSharpStrategy().Count(@"C:\src\KBGit\git.cs").CodeLines);
	    }
	}
}


text:
'use strict';
module.exports = function(sequelize, DataTypes) {
  var campaignanalyticsopen = sequelize.define('campaignanalyticsopen', {
    country: DataTypes.STRING,  // 2 letter ISO-3166-1 country code
    region: DataTypes.STRING,   // 2 char region code: US=ISO-3166-2, other=FIPS 10-4
    city: DataTypes.STRING,     // Full city name
    ipAddress: DataTypes.STRING,
    operatingSystem: DataTypes.STRING,
    deviceType: DataTypes.STRING,
    deviceVendor: DataTypes.STRING,
    browserName: DataTypes.STRING,
    opened: { type: DataTypes.BOOLEAN, defaultValue: false },
    trackingId: { type: DataTypes.UUID, defaultValue: DataTypes.UUIDV4 }
  }, {
    classMethods: {
      associate: function(models) {
        campaignanalyticsopen.belongsTo(models.campaignanalytics);
        campaignanalyticsopen.belongsTo(models.listsubscriber);
        // might want to assoc with user too
      }
    }
  });
  return campaignanalyticsopen;
};


text:
package brooklyn.entity.drivers;

import brooklyn.location.Location;

/**
 * Responsible for creating a driver for a given entity/location. Also used for customizing which
 * type of driver should be used by entities in given locations.
 *
 * The idea is that an entity should not be tightly coupled to a specific driver implementation,
 * so that there is flexibility for driver changes, without changing the entity itself. The
 * advantage is that drivers can easily be reconfigured, replaced or new drivers for different
 * environments can be added, without needing to modify Brooklyn.
 *
 * To obtain an instance of a driver, use {@link #build(DriverDependentEntity, Location)}.
 * This will use the registered driver types, or if one is not registered will fallback to the
 * default strategy.
 */
public interface EntityDriverManager {

    /**
     * Builds a new {@link EntityDriver} for the given entity/location.
     *
     * @param entity the {@link DriverDependentEntity} to create the {@link EntityDriver} for.
     * @param location the {@link Location} where the {@link DriverDependentEntity} is running.
     * @param <D>
     * @return the creates EntityDriver.
     */
    <D extends EntityDriver> D build(DriverDependentEntity<D> entity, Location location);

    <D extends EntityDriver> void registerDriver(Class<D> driverInterface, Class<? extends Location> locationClazz, Class<? extends D> driverClazz);
}


text:
<!DOCTYPE HTML>

<title>Uses of Interface com.googlecode.cqengine.index.support.indextype.OnHeapTypeIndex (CQEngine 3.5.0 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2020-03-29">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../../jquery/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

All Classes

SEARCH:
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">

JavaScript is disabled on your browser.

Uses of Interface
com.googlecode.cqengine.index.support.indextype.OnHeapTypeIndex

Packages that use OnHeapTypeIndex

Package
Description

com.googlecode.cqengine.index.compound

com.googlecode.cqengine.index.hash

com.googlecode.cqengine.index.navigable

com.googlecode.cqengine.index.radix

com.googlecode.cqengine.index.radixinverted

com.googlecode.cqengine.index.radixreversed

com.googlecode.cqengine.index.standingquery

com.googlecode.cqengine.index.suffix

com.googlecode.cqengine.index.unique

Uses of OnHeapTypeIndex in com.googlecode.cqengine.index.compound

Classes in com.googlecode.cqengine.index.compound that implement OnHeapTypeIndex

Modifier and Type
Class
Description

class
CompoundIndex<O>

An index backed by a ConcurrentHashMap which indexes CompoundAttributes,
 storing CompoundValueTuple objects as keys.

Uses of OnHeapTypeIndex in com.googlecode.cqengine.index.hash

Classes in com.googlecode.cqengine.index.hash that implement OnHeapTypeIndex

Modifier and Type
Class
Description

class
HashIndex<A,O>

An index backed by a ConcurrentHashMap.

Uses of OnHeapTypeIndex in com.googlecode.cqengine.index.navigable

Classes in com.googlecode.cqengine.index.navigable that implement OnHeapTypeIndex

Modifier and Type
Class
Description

class
NavigableIndex<A extends Comparable<A>,O>

An index backed by a ConcurrentSkipListMap.

class
PartialNavigableIndex<A extends Comparable<A>,O>

A PartialIndex which wraps a NavigableIndex and uses OnHeapPersistence.

Uses of OnHeapTypeIndex in com.googlecode.cqengine.index.radix

Classes in com.googlecode.cqengine.index.radix that implement OnHeapTypeIndex

Modifier and Type
Class
Description

class
RadixTreeIndex<A extends CharSequence,O>

An index backed by a ConcurrentRadixTree.

Uses of OnHeapTypeIndex in com.googlecode.cqengine.index.radixinverted

Classes in com.googlecode.cqengine.index.radixinverted that implement OnHeapTypeIndex

Modifier and Type
Class
Description

class
InvertedRadixTreeIndex<A extends CharSequence,O>

An index backed by a ConcurrentInvertedRadixTree.

Uses of OnHeapTypeIndex in com.googlecode.cqengine.index.radixreversed

Classes in com.googlecode.cqengine.index.radixreversed that implement OnHeapTypeIndex

Modifier and Type
Class
Description

class
ReversedRadixTreeIndex<A extends CharSequence,O>

An index backed by a ConcurrentReversedRadixTree.

Uses of OnHeapTypeIndex in com.googlecode.cqengine.index.standingquery

Classes in com.googlecode.cqengine.index.standingquery that implement OnHeapTypeIndex

Modifier and Type
Class
Description

class
StandingQueryIndex<O>

An index which stores objects matching any type of query, and which can answer arbitrarily complex
 queries in constant time complexity.

Uses of OnHeapTypeIndex in com.googlecode.cqengine.index.suffix

Classes in com.googlecode.cqengine.index.suffix that implement OnHeapTypeIndex

Modifier and Type
Class
Description

class
SuffixTreeIndex<A extends CharSequence,O>

An index backed by a ConcurrentSuffixTree.

Uses of OnHeapTypeIndex in com.googlecode.cqengine.index.unique

Classes in com.googlecode.cqengine.index.unique that implement OnHeapTypeIndex

Modifier and Type
Class
Description

class
UniqueIndex<A,O>

An index backed by a ConcurrentHashMap, which can be more efficient than HashIndex when used with
 (and only with) attributes which uniquely identify objects (primary key-type attributes).

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

All Classes

JavaScript is disabled on your browser.

Copyright © 2020. All rights reserved.


text:
AWS Access
==========

PynamoDB uses botocore to interact with the DynamoDB API. Thus, any method of configuration supported by ``botocore`` works with PynamoDB.
For local development the use of environment variables such as `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
is probably preferable. You can of course use IAM users, as recommended by AWS. In addition
`EC2 roles <http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html>`_ will work as well and
would be recommended when running on EC2.

As for the permissions granted via IAM, many tasks can be carried out by PynamoDB. So you should construct your
policies as required, see the
`DynamoDB <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/UsingIAMWithDDB.html>`_ docs for more
information.

If for some reason you can't use conventional AWS configuration methods, you can set the credentials in the Model Meta class:

.. code-block:: python

    from pynamodb.models import Model

    class MyModel(Model):
        class Meta:
            aws_access_key_id = 'my_access_key_id'
            aws_secret_access_key = 'my_secret_access_key'
            aws_session_token = 'my_session_token' # Optional, only for temporary credentials like those received when assuming a role

Finally, see the `AWS CLI documentation <http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-installing-credentials>`_
for more details on how to pass credentials to botocore.


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using NoFrillsTransformation.Interfaces;

namespace NoFrillsTransformation.Operators.Utils
{
    [Export(typeof(NoFrillsTransformation.Interfaces.IOperator))]
    public class RegexCaptureOperator : AbstractUtilsOperator, IOperator
    {
        public RegexCaptureOperator()
        {
            Type = ExpressionType.Custom;
            Name = "regexcapture";
            ParamCount = 2;
            ParamTypes = new ParamType[] { ParamType.String, ParamType.Any };
            ReturnType = ParamType.String;
        }

        public string Evaluate(IEvaluator eval, IExpression expression, IContext context)
        {
            string regex = "";
            if (_regex == null) // We will only do this once.
                regex = eval.Evaluate(eval, expression.Arguments[0], context);
            string input = eval.Evaluate(eval, expression.Arguments[1], context);
            return RegexCapture(regex, input);
        }

        private Regex _regex;

        private string RegexCapture(string regex, string input)
        {
            if (null == _regex)
                _regex = new Regex(regex, RegexOptions.Multiline);

            var match = _regex.Match(input);
            if (!match.Success)
                return "";

            if (match.Groups.Count > 1)
                return match.Groups[1].Value;

            return match.Value;
        }
    }
}


text:
miqHttpInject(angular.module('miq.containers.providersModule')).controller('containers.deployProviderCDNChannelController',
  ['$rootScope', '$scope', 'miqService',
  function($rootScope, $scope, miqService) {
    'use strict';

    $scope.reviewTemplate = "/static/deploy_containers_provider/deploy-provider-details-cdn-review.html.haml";
    var firstShow = true;
    $scope.onCdnShow = function () {
      if (firstShow) {
        $scope.data.cdnEnabled = false;
        $scope.data.rhnUsername = '';
        $scope.data.rhnPassword = '';
        $scope.data.rhnSKU = '';
        $scope.data.specifySatelliteUrl = false;
        $scope.data.rhnSatelliteUrl = '';
        firstShow = false;
        $scope.validateForm();
      }
    };

    var validString = function(value) {
      return angular.isDefined(value) && value.length > 0;
    };

    $scope.validateForm = function() {
      $scope.deploymentDetailsCDNComplete = !$scope.data.cdnEnabled || validString($scope.data.rhnUsername) &&
        validString($scope.data.rhnPassword) &&
        validString($scope.data.rhnSKU) &&
        (!$scope.data.specifySatelliteUrl || validString($scope.data.rhnSatelliteUrl));
    };

    $scope.cdnChange = function() {
      if ($scope.data.cdnEnabled) {
        miqService.dynamicAutoFocus('rhn-user-name');
      }
      $scope.validateForm();
    }
  }
]);