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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Terrain Engine 2D: TerrainEngine2D.FluidRenderer Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

Terrain Engine 2D
    1.21

A 2D Block Engine

Protected Member Functions |
Properties |
List of all members

TerrainEngine2D.FluidRenderer Class Reference

Renders the fluid simulation in a texture
 More...

Inheritance diagram for TerrainEngine2D.FluidRenderer:

  <map id="TerrainEngine2D.FluidRenderer_map" name="TerrainEngine2D.FluidRenderer_map">
<area href="class_terrain_engine2_d_1_1_textured_mesh.html" title="Generates a custom texture and renders it to a mesh covering the loaded terrain " alt="TerrainEngine2D.TexturedMesh" shape="rect" coords="0,56,193,80"/>
</map>

Protected Member Functions

override void 	Awake ()

override void 	Start ()

override void 	LateUpdate ()

override Color32 [] 	GetPixelData ()

Properties

static FluidRenderer 	Instance [get]

 	A singleton instance of the Fluid Renderer  More...

Additional Inherited Members

 Public Member Functions inherited from TerrainEngine2D.TexturedMesh

void 	UpdateTexture ()

 	Set the texture for an update  More...

 Public Attributes inherited from TerrainEngine2D.TexturedMesh

FilterMode 	FilterMode

 	The filter mode of the texture  More...

 Protected Attributes inherited from TerrainEngine2D.TexturedMesh

RenderTexture 	renderTexture

Texture2D 	texture2D

Mesh 	mesh

Vector3 [] 	vertices

Vector2 [] 	uvs

int [] 	triangles

Color32 [] 	tempPixelData

int 	width

bool 	update

Material 	material

Detailed Description

Renders the fluid simulation in a texture

Member Function Documentation

◆ Awake()

          override void TerrainEngine2D.FluidRenderer.Awake
          (
          	)

protectedvirtual

Reimplemented from TerrainEngine2D.TexturedMesh.

◆ GetPixelData()

          override Color32 [] TerrainEngine2D.FluidRenderer.GetPixelData
          (
          	)

protectedvirtual

Implements TerrainEngine2D.TexturedMesh.

◆ LateUpdate()

          override void TerrainEngine2D.FluidRenderer.LateUpdate
          (
          	)

protectedvirtual

Reimplemented from TerrainEngine2D.TexturedMesh.

◆ Start()

          override void TerrainEngine2D.FluidRenderer.Start
          (
          	)

protectedvirtual

Reimplemented from TerrainEngine2D.TexturedMesh.

Property Documentation

◆ Instance

          FluidRenderer TerrainEngine2D.FluidRenderer.Instance

staticget

A singleton instance of the Fluid Renderer

The documentation for this class was generated from the following file:

C:/Users/sk8te/Documents/Unity/SVN/TerrainEngine2D/trunk/TerrainEngine2D/Assets/TerrainEngine2D/Assets/Scripts/Fluid Dynamics/FluidRenderer.cs

TerrainEngine2D

FluidRenderer

Generated on Thu Apr 30 2020 23:39:33 for Terrain Engine 2D by

     1.8.14


text:
@interface NSString (RACKeyPathUtilities)

// Returns an array of the components of the receiver.
//
// Calling this method on a string that isn't a key path is considered undefined
// behavior.
- (NSArray *)rac_keyPathComponents;

// Returns a key path with all the components of the receiver except for the
// last one.
//
// Calling this method on a string that isn't a key path is considered undefined
// behavior.
- (NSString *)rac_keyPathByDeletingLastKeyPathComponent;

// Returns a key path with all the components of the receiver expect for the
// first one.
//
// Calling this method on a string that isn't a key path is considered undefined
// behavior.
- (NSString *)rac_keyPathByDeletingFirstKeyPathComponent;

@end

redpajama_set_name: RedPajamaGithub


text:
package com.github.hgwood.fanfaron;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.github.hgwood.fanfaron.utils.vendorextensions.DynamicObjectWithVendorExtensions;

import java.util.Map;

/**
 * https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#responsesObject
 */
public class Responses extends DynamicObjectWithVendorExtensions<ResponseOrReference> {
    @JsonCreator public Responses(Map<String, ?> responses) {
        super(responses);
    }

    public Responses() {
        super();
    }
}


text:
/**
#jquery.mapquery.mqOverviewMap.js
The file containing the mqOverviewMap Widget

### *$('selector')*.`mqOverviewMap([options])`
_version added 0.1_
####**Description**: create a widget to show an overview map

 + **options**:
  - **map**: the mapquery instance
  - **title**: Title that will be displayed at the top of the overview window
  - **position**: The position of the overview map dialog (default right bottom)
  - **width**: width of the overview window (default 300px)
  - **height**: height of the overview window (default 200px)

>Returns: widget

The mqOverviewMap widget allows us to display an overview map dialog
(http://jqueryui.com/demos/dialog/) and a toggle button. The dialog will be put
on the given position see (http://jqueryui.com/demos/dialog/#option-position).
The toggle button will be put in the element where the widget is attached to.

     $('#overviewmap').mqOverviewMap({
        map: '#map',
        position: ['right','top']
     });

 */
(function($) {
$.template('mqOverviewMap',
    '
'+
    '

'+
    '
'+
    '
'+
    '
');

$.widget("mapQuery.mqOverviewMap", {
    options: {
        // The MapQuery instance
        map: undefined,

        // Title that will be displayed at the top of the overview window
        title: "Overview map",

        //the position of the overview map, default right bottom of the window
        position: ['right','bottom'],

        //initial size of the overviewmap
        width: 300,
        height: 200
    },
    _create: function() {
        var map;
        var self = this;
        var element = this.element;
    //TODO smo20110620 make this configurable
        var id = 'mqOverviewMap-dialog';

    //get the mapquery object
        map = $(this.options.map).data('mapQuery');

        this.element.addClass('ui-widget  ui-helper-clearfix ' +
                              'ui-corner-all');

        $.tmpl('mqOverviewMap',{
            id: id}).appendTo(element);

        var dialogElement = $('#'+id).dialog({
            dialogClass: 'mq-overviewmap-dialog',
            autoOpen: true,
            width: this.options.width,
            height: this.options.height,
            title: this.options.title,
            position: this.options.position,
            resizeStop: function (event, ui) {
                $('.olMap', this).width($(this).width());
               $('.olMap', this).height($(this).height());
            },
            close:function(event,ui){
                 $('.mq-overviewmap-close').removeClass(
            'mq-overviewmap-close ui-icon-arrowthick-1-se').addClass(
            'mq-overviewmap-open ui-icon-arrowthick-1-nw');
            }

        });

        var overviewmapsize = {
        w: $(dialogElement).width(),
        h: $(dialogElement).height() };
        var mapOptions = map.olMapOptions;
        //remove the controls, otherwise you end up with recursing events
        delete mapOptions.controls;
        // use the lowest layer of the map as overviewmap
        // TODO: make the layer configurable
        var overview = new OpenLayers.Control.OverviewMap(
        {div: document.getElementById(id),size:overviewmapsize,
            mapOptions:mapOptions,layers:[
                map.layers().reverse()[0].olLayer.clone()]});
        map.olMap.addControl(overview);

        // remove OpenLayers blue border around overviewmap
        $('.olControlOverviewMapElement', dialogElement).removeClass(
        'olControlOverviewMapElement');

        element.delegate('.mq-overviewmap-close', 'click', function() {
            $(this).removeClass(
        'mq-overviewmap-close ui-icon-arrowthick-1-se').addClass(
        'mq-overviewmap-open ui-icon-arrowthick-1-nw');
            $('#'+id).dialog('close');
        });
        element.delegate('.mq-overviewmap-open', 'click', function() {
            $(this).removeClass(
        'mq-overviewmap-open ui-icon-arrowthick-1-nw').addClass(
        'mq-overviewmap-close ui-icon-arrowthick-1-se');
            $('#'+id).dialog('open');
        });
    },
    _destroy: function() {
        this.element.removeClass(' ui-widget ui-helper-clearfix ' +
                                 'ui-corner-all')
            .empty();
    }

});
})(jQuery);


text:
=========================
Django REST Framework SSO
=========================

Django REST Framework SSO is an extension to Django REST Framework that enables
Single sign-on in a microservice-oriented environment using the JWT standard.

This library provides two types of JWT tokens:

1. non-expiring session tokens for your primary login application (aka. "refresh tokens")

2. short-lived authorization tokens for accessing your other apps (these contain permissions given by the primary app)

The client is expected to first login to your primary login application by POSTing an username and password. The client will receive a permanent session token that will allow subsequent requests to the same server be authenticated. These tokens do not contain any permissions/authorization information and cannot be used for SSO into other apps.

Afterwards, the client is expected to obtain and keep updating authorization tokens using the session token. These secondary tokens are short-lived (15mins..1 hour) and contain the permissions that the user has at the time of issuance. These tokens are used to access other services, which then trust the permissions in the JWT payload for the lifetime of the token.

Quick start
-----------

1. Add "rest_framework_sso" to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = [
        ...
        'rest_framework_sso',
    ]

2. Include the session and authorization token URLs::

    from rest_framework_sso.views import obtain_session_token, obtain_authorization_token

    urlpatterns = [
        ...
        url(r'^session/', obtain_session_token),
        url(r'^authorize/', obtain_authorization_token),
    ]

Additional data in authorization tokens
---------------------------------------
For example, you may want to include an `account` field in your JWT authorization tokens,
so that `otherapp` will know about the user's permissions. To do this, you may need to override
the ObtainAuthorizationTokenView and AuthorizationTokenSerializer::

    class ObtainAuthorizationTokenView(rest_framework_sso.views.ObtainAuthorizationTokenView):
        """
        Returns a JSON Web Token that can be used for authenticated requests.
        """
        serializer_class = AuthorizationTokenSerializer

    class AuthorizationTokenSerializer(serializers.Serializer):
        account = serializers.HyperlinkedRelatedField(
            queryset=Account.objects.all(),
            required=True,
            view_name='api:account-detail',
        )

        class Meta:
            fields = ['account']

Replace the authorization token view in your URL conf::

    urlpatterns = [
        url(r'^authorize/$', ObtainAuthorizationTokenView.as_view()),
        ...
    ]

Add the `account` keyword argument to the `create_authorization_payload` function::

    from rest_framework_sso import claims

    def create_authorization_payload(session_token, user, account, **kwargs):
        return {
            claims.TOKEN: claims.TOKEN_AUTHORIZATION,
            claims.SESSION_ID: session_token.pk,
            claims.USER_ID: user.pk,
            claims.EMAIL: user.email,
            'account': account.pk,
        }

You will need to activete this function in the settings::

    REST_FRAMEWORK_SSO = {
        'CREATE_AUTHORIZATION_PAYLOAD': 'myapp.authentication.create_authorization_payload',
        ...
    }

JWT Authentication
------------------
In order to get-or-create User accounts automatically within your microservice apps,
you may need to write your custom JWT payload authentication function::

    from django.contrib.auth import get_user_model
    from rest_framework_sso import claims

    def authenticate_payload(payload):
        user_model = get_user_model()
        user, created = user_model.objects.get_or_create(
            service=payload.get(claims.ISSUER),
            external_id=payload.get(claims.USER_ID),
        )
        if not user.is_active:
            raise exceptions.AuthenticationFailed(_('User inactive or deleted.'))
        return user

Enable authenticate_payload function in REST_FRAMEWORK_SSO settings::

    REST_FRAMEWORK_SSO = {
        'AUTHENTICATE_PAYLOAD': 'otherapp.authentication.authenticate_payload',
        ...
    }

Enable JWT authentication in the REST_FRAMEWORK settings::

    REST_FRAMEWORK = {
        'DEFAULT_AUTHENTICATION_CLASSES': (
            'rest_framework_sso.authentication.JWTAuthentication',
            'rest_framework.authentication.SessionAuthentication',
            ...
        ),
        ...
    }

Requests that have been successfully authenticated with JWTAuthentication contain
the JWT payload data in the `request.auth` variable. This data can be used in your
API views/viewsets to handle permissions, for example::

    from rest_framework_sso import claims

    class UserViewSet(viewsets.ReadOnlyModelViewSet):
        serializer_class = UserSerializer
        queryset = User.objects.none()

        def get_queryset(self):
            if not request.user.is_authenticated or not request.auth:
                return self.none()
            return User.objects.filter(
                service=request.auth.get(claims.ISSUER),
                external_id=request.auth.get(claims.USER_ID),
            )

Settings
--------
Example settings for project that both issues and validates tokens for `myapp` and `otherapp`::

    REST_FRAMEWORK_SSO = {
        'CREATE_AUTHORIZATION_PAYLOAD': 'myapp.authentication.create_authorization_payload',
        'IDENTITY': 'myapp',
        'SESSION_AUDIENCE': ['myapp'],
        'AUTHORIZATION_AUDIENCE': ['myapp', 'otherapp'],
        'ACCEPTED_ISSUERS': ['myapp'],
        'KEY_STORE_ROOT': '/srv/myapp/keys',
        'PUBLIC_KEYS': {
            'myapp': ['myapp-20200410.pem', 'myapp-20180101.pem'],  # both private/public key in the same file
        },
        'PRIVATE_KEYS': {
            'myapp': ['myapp-20200410.pem', 'myapp-20180101.pem'],  # both private/public key in the same file
        },
    }

Example settings for project that only accepts tokens signed by `myapp` public key for `otherapp`::

    REST_FRAMEWORK_SSO = {
        'AUTHENTICATE_PAYLOAD': 'otherapp.authentication.authenticate_payload',
        'VERIFY_SESSION_TOKEN': False,
        'IDENTITY': 'otherapp',
        'ACCEPTED_ISSUERS': ['myapp'],
        'KEY_STORE_ROOT': '/srv/otherapp/keys',
        'PUBLIC_KEYS': {
            'myapp': ['myapp-20200410.pem', 'myapp-20180101.pem'],  # only public keys in these files
        },
    }

Full list of settings parameters with their defaults::

    REST_FRAMEWORK_SSO = {
        'CREATE_SESSION_PAYLOAD': 'rest_framework_sso.utils.create_session_payload',
        'CREATE_AUTHORIZATION_PAYLOAD': 'rest_framework_sso.utils.create_authorization_payload',
        'ENCODE_JWT_TOKEN': 'rest_framework_sso.utils.encode_jwt_token',
        'DECODE_JWT_TOKEN': 'rest_framework_sso.utils.decode_jwt_token',
        'AUTHENTICATE_PAYLOAD': 'rest_framework_sso.utils.authenticate_payload',

        'ENCODE_ALGORITHM': 'RS256',
        'DECODE_ALGORITHMS': None,
        'VERIFY_SIGNATURE': True,
        'VERIFY_EXPIRATION': True,
        'VERIFY_ISSUER': True,
        'VERIFY_AUDIENCE': True,
        'VERIFY_SESSION_TOKEN': True,
        'EXPIRATION_LEEWAY': 0,
        'SESSION_EXPIRATION': None,
        'AUTHORIZATION_EXPIRATION': datetime.timedelta(seconds=300),

        'IDENTITY': None,
        'SESSION_AUDIENCE': None,
        'AUTHORIZATION_AUDIENCE': None,
        'ACCEPTED_ISSUERS': None,
        'KEY_STORE_ROOT': None,
        'PUBLIC_KEYS': {},
        'PRIVATE_KEYS': {},

        'AUTHENTICATE_HEADER': 'JWT',
    }

Generating RSA keys
-------------------
You can use openssl to generate your public/private key pairs::

    $ openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048
    $ openssl rsa -pubout -in private_key.pem -out public_key.pem
    $ cat private_key.pem public_key.pem > keys/myapp-20180101.pem


text:
modules.define(
    'test',
    ['popup', 'i-bem__dom', 'bh', 'jquery', 'sinon'],
    function (provide, Popup, DOM, bh, $, sinon) {

    describe('popup', function () {
        var popup;
        var targetNode;
        var windowWidth;
        var windowHeight;

        beforeEach(function () {
            targetNode = $('<div/>').appendTo('body');
            popup = Popup.create({
                direction: 'right',
                content: 'test'
            });
            windowWidth = sinon.stub(popup.__self.win, 'width').returns(300);
            windowHeight = sinon.stub(popup.__self.win, 'height').returns(300);
        });

        afterEach(function () {
            DOM.destruct(popup.domElem);
            targetNode.remove();
            windowWidth.restore();
            windowHeight.restore();
        });

        it('should show popup', function () {
            popup.show(targetNode);
            $.contains(document.body, popup.domElem[0]).should.be.true;
            popup.isShown().should.be.true;
        });

        it('should hide popup', function () {
            popup.show(targetNode);
            popup.hide();
            popup.isShown().should.be.false;
        });

        it('should set content', function () {
            popup.setContent('tro-lo-lo');
            popup.findElem('content').text().should.be.equal('tro-lo-lo');
        });

        describe('when bh has built bemjson', function () {
            it('should contain close elem', function () {
                bh.processBemJson({block: 'popup'}).content[1].elem.should.be.equal('close');
            });
        });
    });

    provide();
});


text:
This module handles opinionated Google Cloud Platform Kubernetes Engine cluster creation and configuration with Node Pools, IP MASQ, Network Policy, etc. This particular submodule creates a [private cluster](https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters)Beta features are enabled in this submodule.
The resources/services/activations/deletions that this module will create/trigger are:
- Create a GKE cluster with the provided addons
- Create GKE Node Pool(s) with provided configuration and attach to cluster
- Replace the default kube-dns configmap if `stub_domains` are provided
- Activate network policy if `network_policy` is true
- Add `ip-masq-agent` configmap with provided `non_masquerade_cidrs` if `configure_ip_masq` is true

Sub modules are provided for creating private clusters, beta private clusters, and beta public clusters as well.  Beta sub modules allow for the use of various GKE beta features. See the modules directory for the various sub modules.

## Private Cluster Details
For details on configuring private clusters with this module, check the [troubleshooting guide](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/master/docs/private_clusters.md).

## Compatibility

This module is meant for use with Terraform 0.13+ and tested using Terraform 1.0+.
If you find incompatibilities using Terraform `>=0.13`, please open an issue.

If you haven't [upgraded][terraform-0.13-upgrade] and need a Terraform
0.12.x-compatible version of this module, the last released version
intended for Terraform 0.12.x is [12.3.0].

## Usage
There are multiple examples included in the [examples](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/tree/master/examples) folder but simple usage is as follows:

```hcl
# google_client_config and kubernetes provider must be explicitly specified like the following.
data "google_client_config" "default" {}

provider "kubernetes" {
  host                   = "https://${module.gke.endpoint}"
  token                  = data.google_client_config.default.access_token
  cluster_ca_certificate = base64decode(module.gke.ca_certificate)
}

module "gke" {
  source                     = "terraform-google-modules/kubernetes-engine/google//modules/beta-private-cluster"
  project_id                 = "<PROJECT ID>"
  name                       = "gke-test-1"
  region                     = "us-central1"
  zones                      = ["us-central1-a", "us-central1-b", "us-central1-f"]
  network                    = "vpc-01"
  subnetwork                 = "us-central1-01"
  ip_range_pods              = "us-central1-01-gke-01-pods"
  ip_range_services          = "us-central1-01-gke-01-services"
  http_load_balancing        = false
  network_policy             = false
  horizontal_pod_autoscaling = true
  filestore_csi_driver       = false
  enable_private_endpoint    = true
  enable_private_nodes       = true
  master_ipv4_cidr_block     = "10.0.0.0/28"
  istio                      = true
  cloudrun                   = true
  dns_cache                  = false

  node_pools = [
    {
      name                      = "default-node-pool"
      machine_type              = "e2-medium"
      node_locations            = "us-central1-b,us-central1-c"
      min_count                 = 1
      max_count                 = 100
      local_ssd_count           = 0
      spot                      = false
      local_ssd_ephemeral_count = 0
      disk_size_gb              = 100
      disk_type                 = "pd-standard"
      image_type                = "COS_CONTAINERD"
      enable_gcfs               = false
      enable_gvnic              = false
      auto_repair               = true
      auto_upgrade              = true
      service_account           = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
      preemptible               = false
      initial_node_count        = 80
    },
  ]

  node_pools_oauth_scopes = {
    all = [
      "https://www.googleapis.com/auth/logging.write",
      "https://www.googleapis.com/auth/monitoring",
    ]
  }

  node_pools_labels = {
    all = {}

    default-node-pool = {
      default-node-pool = true
    }
  }

  node_pools_metadata = {
    all = {}

    default-node-pool = {
      node-pool-metadata-custom-value = "my-node-pool"
    }
  }

  node_pools_taints = {
    all = []

    default-node-pool = [
      {
        key    = "default-node-pool"
        value  = true
        effect = "PREFER_NO_SCHEDULE"
      },
    ]
  }

  node_pools_tags = {
    all = []

    default-node-pool = [
      "default-node-pool",
    ]
  }
}
```

Then perform the following commands on the root folder:

- `terraform init` to get the plugins
- `terraform plan` to see the infrastructure plan
- `terraform apply` to apply the infrastructure build
- `terraform destroy` to destroy the built infrastructure

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| add\_cluster\_firewall\_rules | Create additional firewall rules | `bool` | `false` | no |
| add\_master\_webhook\_firewall\_rules | Create master\_webhook firewall rules for ports defined in `firewall_inbound_ports` | `bool` | `false` | no |
| add\_shadow\_firewall\_rules | Create GKE shadow firewall (the same as default firewall rules with firewall logs enabled). | `bool` | `false` | no |
| authenticator\_security\_group | The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format gke-security-groups@yourdomain.com | `string` | `null` | no |
| cloudrun | (Beta) Enable CloudRun addon | `bool` | `false` | no |
| cloudrun\_load\_balancer\_type | (Beta) Configure the Cloud Run load balancer type. External by default. Set to `LOAD_BALANCER_TYPE_INTERNAL` to configure as an internal load balancer. | `string` | `""` | no |
| cluster\_autoscaling | Cluster autoscaling configuration. See [more details](https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1beta1/projects.locations.clusters#clusterautoscaling) |
object({
    enabled             = bool
    autoscaling_profile = string
    min_cpu_cores       = number
    max_cpu_cores       = number
    min_memory_gb       = number
    max_memory_gb       = number
    gpu_resources       = list(object({ resource_type = string, minimum = number, maximum = number }))
  })
 |
{
  "autoscaling_profile": "BALANCED",
  "enabled": false,
  "gpu_resources": [],
  "max_cpu_cores": 0,
  "max_memory_gb": 0,
  "min_cpu_cores": 0,
  "min_memory_gb": 0
}
 | no |
| cluster\_dns\_domain | The suffix used for all cluster service records. | `string` | `""` | no |
| cluster\_dns\_provider | Which in-cluster DNS provider should be used. PROVIDER\_UNSPECIFIED (default) or PLATFORM\_DEFAULT or CLOUD\_DNS. | `string` | `"PROVIDER_UNSPECIFIED"` | no |
| cluster\_dns\_scope | The scope of access to cluster DNS records. DNS\_SCOPE\_UNSPECIFIED (default) or CLUSTER\_SCOPE or VPC\_SCOPE. | `string` | `"DNS_SCOPE_UNSPECIFIED"` | no |
| cluster\_ipv4\_cidr | The IP address range of the kubernetes pods in this cluster. Default is an automatically assigned CIDR. | `string` | `null` | no |
| cluster\_resource\_labels | The GCE resource labels (a map of key/value pairs) to be applied to the cluster | `map(string)` | `{}` | no |
| cluster\_telemetry\_type | Available options include ENABLED, DISABLED, and SYSTEM\_ONLY | `string` | `null` | no |
| config\_connector | (Beta) Whether ConfigConnector is enabled for this cluster. | `bool` | `false` | no |
| configure\_ip\_masq | Enables the installation of ip masquerading, which is usually no longer required when using aliasied IP addresses. IP masquerading uses a kubectl call, so when you have a private cluster, you will need access to the API server. | `bool` | `false` | no |
| create\_service\_account | Defines if service account specified to run nodes should be created. | `bool` | `true` | no |
| database\_encryption | Application-layer Secrets Encryption settings. The object format is {state = string, key\_name = string}. Valid values of state are: "ENCRYPTED"; "DECRYPTED". key\_name is the name of a CloudKMS key. | `list(object({ state = string, key_name = string }))` |
[
  {
    "key_name": "",
    "state": "DECRYPTED"
  }
]
 | no |
| datapath\_provider | The desired datapath provider for this cluster. By default, `DATAPATH_PROVIDER_UNSPECIFIED` enables the IPTables-based kube-proxy implementation. `ADVANCED_DATAPATH` enables Dataplane-V2 feature. | `string` | `"DATAPATH_PROVIDER_UNSPECIFIED"` | no |
| default\_max\_pods\_per\_node | The maximum number of pods to schedule per node | `number` | `110` | no |
| deploy\_using\_private\_endpoint | (Beta) A toggle for Terraform and kubectl to connect to the master's internal IP address during deployment. | `bool` | `false` | no |
| description | The description of the cluster | `string` | `""` | no |
| disable\_default\_snat | Whether to disable the default SNAT to support the private use of public IP addresses | `bool` | `false` | no |
| disable\_legacy\_metadata\_endpoints | Disable the /0.1/ and /v1beta1/ metadata server endpoints on the node. Changing this value will cause all node pools to be recreated. | `bool` | `true` | no |
| dns\_cache | The status of the NodeLocal DNSCache addon. | `bool` | `false` | no |
| enable\_binary\_authorization | Enable BinAuthZ Admission controller | `bool` | `false` | no |
| enable\_confidential\_nodes | An optional flag to enable confidential node config. | `bool` | `false` | no |
| enable\_cost\_allocation | Enables Cost Allocation Feature and the cluster name and namespace of your GKE workloads appear in the labels field of the billing export to BigQuery | `bool` | `false` | no |
| enable\_identity\_service | Enable the Identity Service component, which allows customers to use external identity providers with the K8S API. | `bool` | `false` | no |
| enable\_intranode\_visibility | Whether Intra-node visibility is enabled for this cluster. This makes same node pod to pod traffic visible for VPC network | `bool` | `false` | no |
| enable\_kubernetes\_alpha | Whether to enable Kubernetes Alpha features for this cluster. Note that when this option is enabled, the cluster cannot be upgraded and will be automatically deleted after 30 days. | `bool` | `false` | no |
| enable\_l4\_ilb\_subsetting | Enable L4 ILB Subsetting on the cluster | `bool` | `false` | no |
| enable\_network\_egress\_export | Whether to enable network egress metering for this cluster. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | `bool` | `false` | no |
| enable\_pod\_security\_policy | enabled - Enable the PodSecurityPolicy controller for this cluster. If enabled, pods must be valid under a PodSecurityPolicy to be created. | `bool` | `false` | no |
| enable\_private\_endpoint | (Beta) Whether the master's internal IP address is used as the cluster endpoint | `bool` | `false` | no |
| enable\_private\_nodes | (Beta) Whether nodes have internal IP addresses only | `bool` | `false` | no |
| enable\_resource\_consumption\_export | Whether to enable resource consumption metering on this cluster. When enabled, a table will be created in the resource export BigQuery dataset to store resource consumption data. The resulting table can be joined with the resource usage table or with BigQuery billing export. | `bool` | `true` | no |
| enable\_shielded\_nodes | Enable Shielded Nodes features on all nodes in this cluster | `bool` | `true` | no |
| enable\_tpu | Enable Cloud TPU resources in the cluster. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
| enable\_vertical\_pod\_autoscaling | Vertical Pod Autoscaling automatically adjusts the resources of pods controlled by it | `bool` | `false` | no |
| filestore\_csi\_driver | The status of the Filestore CSI driver addon, which allows the usage of filestore instance as volumes | `bool` | `false` | no |
| firewall\_inbound\_ports | List of TCP ports for admission/webhook controllers. Either flag `add_master_webhook_firewall_rules` or `add_cluster_firewall_rules` (also adds egress rules) must be set to `true` for inbound-ports firewall rules to be applied. | `list(string)` |
[
  "8443",
  "9443",
  "15017"
]
 | no |
| firewall\_priority | Priority rule for firewall rules | `number` | `1000` | no |
| gce\_pd\_csi\_driver | (Beta) Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `false` | no |
| gke\_backup\_agent\_config | (Beta) Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |
| http\_load\_balancing | Enable httpload balancer addon | `bool` | `true` | no |
| identity\_namespace | The workload pool to attach all Kubernetes service accounts to. (Default value of `enabled` automatically sets project-based pool `[project_id].svc.id.goog`) | `string` | `"enabled"` | no |
| initial\_node\_count | The number of nodes to create in this cluster's default node pool. | `number` | `0` | no |
| ip\_masq\_link\_local | Whether to masquerade traffic to the link-local prefix (169.254.0.0/16). | `bool` | `false` | no |
| ip\_masq\_resync\_interval | The interval at which the agent attempts to sync its ConfigMap file from the disk. | `string` | `"60s"` | no |
| ip\_range\_pods | The _name_ of the secondary subnet ip range to use for pods | `string` | n/a | yes |
| ip\_range\_services | The _name_ of the secondary subnet range to use for services | `string` | n/a | yes |
| issue\_client\_certificate | Issues a client certificate to authenticate to the cluster endpoint. To maximize the security of your cluster, leave this option disabled. Client certificates don't automatically rotate and aren't easily revocable. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
| istio | (Beta) Enable Istio addon | `bool` | `false` | no |
| istio\_auth | (Beta) The authentication type between services in Istio. | `string` | `"AUTH_MUTUAL_TLS"` | no |
| kalm\_config | (Beta) Whether KALM is enabled for this cluster. | `bool` | `false` | no |
| kubernetes\_version | The Kubernetes version of the masters. If set to 'latest' it will pull latest available version in the selected region. | `string` | `"latest"` | no |
| logging\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | no |
| logging\_service | The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none | `string` | `"logging.googleapis.com/kubernetes"` | no |
| maintenance\_end\_time | Time window specified for recurring maintenance operations in RFC3339 format | `string` | `""` | no |
| maintenance\_exclusions | List of maintenance exclusions. A cluster can have up to three | `list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))` | `[]` | no |
| maintenance\_recurrence | Frequency of the recurring maintenance window in RFC5545 format. | `string` | `""` | no |
| maintenance\_start\_time | Time window specified for daily or recurring maintenance operations in RFC3339 format | `string` | `"05:00"` | no |
| master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no |
| master\_global\_access\_enabled | Whether the cluster master is accessible globally (from any region) or only within the same region as the private endpoint. | `bool` | `true` | no |
| master\_ipv4\_cidr\_block | (Beta) The IP range in CIDR notation to use for the hosted master network | `string` | `"10.0.0.0/28"` | no |
| monitoring\_enable\_managed\_prometheus | (Beta) Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS (provider version >= 3.89.0). Empty list is default GKE configuration. | `list(string)` | `[]` | no |
| monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no |
| name | The name of the cluster (required) | `string` | n/a | yes |
| network | The VPC network to host the cluster in (required) | `string` | n/a | yes |
| network\_policy | Enable network policy addon | `bool` | `false` | no |
| network\_policy\_provider | The network policy provider. | `string` | `"CALICO"` | no |
| network\_project\_id | The project ID of the shared VPC's host (for shared vpc support) | `string` | `""` | no |
| node\_metadata | Specifies how node metadata is exposed to the workload running on the node | `string` | `"GKE_METADATA"` | no |
| node\_pools | List of maps containing node pools | `list(map(any))` |
[
  {
    "name": "default-node-pool"
  }
]
 | no |
| node\_pools\_labels | Map of maps containing node labels by node-pool name | `map(map(string))` |
{
  "all": {},
  "default-node-pool": {}
}
 | no |
| node\_pools\_linux\_node\_configs\_sysctls | Map of maps containing linux node config sysctls by node-pool name | `map(map(string))` |
{
  "all": {},
  "default-node-pool": {}
}
 | no |
| node\_pools\_metadata | Map of maps containing node metadata by node-pool name | `map(map(string))` |
{
  "all": {},
  "default-node-pool": {}
}
 | no |
| node\_pools\_oauth\_scopes | Map of lists containing node oauth scopes by node-pool name | `map(list(string))` |
{
  "all": [
    "https://www.googleapis.com/auth/cloud-platform"
  ],
  "default-node-pool": []
}
 | no |
| node\_pools\_tags | Map of lists containing node network tags by node-pool name | `map(list(string))` |
{
  "all": [],
  "default-node-pool": []
}
 | no |
| node\_pools\_taints | Map of lists containing node taints by node-pool name | `map(list(object({ key = string, value = string, effect = string })))` |
{
  "all": [],
  "default-node-pool": []
}
 | no |
| non\_masquerade\_cidrs | List of strings in CIDR notation that specify the IP address ranges that do not use IP masquerading. | `list(string)` |
[
  "10.0.0.0/8",
  "172.16.0.0/12",
  "192.168.0.0/16"
]
 | no |
| notification\_config\_topic | The desired Pub/Sub topic to which notifications will be sent by GKE. Format is projects/{project}/topics/{topic}. | `string` | `""` | no |
| project\_id | The project ID to host the cluster in (required) | `string` | n/a | yes |
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | `string` | `null` | no |
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | `bool` | `true` | no |
| registry\_project\_ids | Projects holding Google Container Registries. If empty, we use the cluster project. If a service account is created and the `grant_registry_access` variable is set to `true`, the `storage.objectViewer` and `artifactregsitry.reader` roles are assigned on these projects. | `list(string)` | `[]` | no |
| release\_channel | The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`. | `string` | `null` | no |
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | `bool` | `false` | no |
| resource\_usage\_export\_dataset\_id | The ID of a BigQuery Dataset for using BigQuery as the destination of resource usage export. | `string` | `""` | no |
| sandbox\_enabled | (Beta) Enable GKE Sandbox (Do not forget to set `image_type` = `COS_CONTAINERD` to use it). | `bool` | `false` | no |
| service\_account | The service account to run nodes as if not overridden in `node_pools`. The create\_service\_account variable default value (true) will cause a cluster-specific service account to be created. | `string` | `""` | no |
| service\_external\_ips | Whether external ips specified by a service will be allowed in this cluster | `bool` | `false` | no |
| shadow\_firewall\_rules\_priority | The firewall priority of GKE shadow firewall rules. The priority should be less than default firewall, which is 1000. | `number` | `999` | no |
| skip\_provisioners | Flag to skip all local-exec provisioners. It breaks `stub_domains` and `upstream_nameservers` variables functionality. | `bool` | `false` | no |
| stub\_domains | Map of stub domains and their resolvers to forward DNS queries for a certain domain to an external DNS server | `map(list(string))` | `{}` | no |
| subnetwork | The subnetwork to host the cluster in (required) | `string` | n/a | yes |
| timeouts | Timeout for cluster operations. | `map(string)` | `{}` | no |
| upstream\_nameservers | If specified, the values replace the nameservers taken by default from the node's /etc/resolv.conf | `list(string)` | `[]` | no |
| windows\_node\_pools | List of maps containing Windows node pools | `list(map(string))` | `[]` | no |
| zones | The zones to host the cluster in (optional if regional cluster / required if zonal) | `list(string)` | `[]` | no |

## Outputs

| Name | Description |
|------|-------------|
| ca\_certificate | Cluster ca certificate (base64 encoded) |
| cloudrun\_enabled | Whether CloudRun enabled |
| cluster\_id | Cluster ID |
| dns\_cache\_enabled | Whether DNS Cache enabled |
| endpoint | Cluster endpoint |
| horizontal\_pod\_autoscaling\_enabled | Whether horizontal pod autoscaling enabled |
| http\_load\_balancing\_enabled | Whether http load balancing enabled |
| identity\_namespace | Workload Identity pool |
| identity\_service\_enabled | Whether Identity Service is enabled |
| instance\_group\_urls | List of GKE generated instance groups |
| intranode\_visibility\_enabled | Whether intra-node visibility is enabled |
| istio\_enabled | Whether Istio is enabled |
| location | Cluster location (region if regional cluster, zone if zonal cluster) |
| logging\_service | Logging service used |
| master\_authorized\_networks\_config | Networks from which access to master is permitted |
| master\_ipv4\_cidr\_block | The IP range in CIDR notation used for the hosted master network |
| master\_version | Current master kubernetes version |
| min\_master\_version | Minimum master kubernetes version |
| monitoring\_service | Monitoring service used |
| name | Cluster name |
| network\_policy\_enabled | Whether network policy enabled |
| node\_pools\_names | List of node pools names |
| node\_pools\_versions | Node pool versions by node pool name |
| peering\_name | The name of the peering between this cluster and the Google owned VPC. |
| pod\_security\_policy\_enabled | Whether pod security policy is enabled |
| region | Cluster region |
| release\_channel | The release channel of this cluster |
| service\_account | The service account to default running nodes as if not overridden in `node_pools`. |
| tpu\_ipv4\_cidr\_block | The IP range in CIDR notation used for the TPUs |
| type | Cluster type (regional / zonal) |
| vertical\_pod\_autoscaling\_enabled | Whether vertical pod autoscaling enabled |
| zones | List of zones in which the cluster resides |

## node_pools variable

> Use this variable for provisioning linux based node pools. For Windows based node pools use [windows_node_pools](#windows\_node\_pools-variable)

The node_pools variable takes the following parameters:

| Name | Description | Default | Requirement |
| --- | --- | --- | --- |
| accelerator_count | The number of the guest accelerator cards exposed to this instance | 0 | Optional |
| accelerator_type | The accelerator type resource to expose to the instance | " " | Optional |
| auto_repair | Whether the nodes will be automatically repaired | true | Optional |
| autoscaling | Configuration required by cluster autoscaler to adjust the size of the node pool to the current cluster usage | true | Optional |
| auto_upgrade | Whether the nodes will be automatically upgraded | true (if cluster is regional) | Optional |
| boot_disk_kms_key | The Customer Managed Encryption Key used to encrypt the boot disk attached to each node in the node pool. This should be of the form projects/[KEY_PROJECT_ID]/locations/[LOCATION]/keyRings/[RING_NAME]/cryptoKeys/[KEY_NAME]. | " " | Optional |
| cpu_manager_policy | The CPU manager policy on the node. One of "none" or "static". | "static" | Optional |
| cpu_cfs_quota | Enforces the Pod's CPU limit. Setting this value to false means that the CPU limits for Pods are ignored | null | Optional |
| cpu_cfs_quota_period | The CPU CFS quota period value, which specifies the period of how often a cgroup's access to CPU resources should be reallocated | null | Optional |
| enable\_confidential\_nodes | An optional flag to enable confidential node config. | `bool` | `false` | no |
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
| effect | Effect for the taint | | Required |
| enable_gcfs | Google Container File System (gcfs) has to be enabled for image streaming to be active. Needs image_type to be set to COS_CONTAINERD. | false | Optional |
| enable_gvnic | gVNIC (GVE) is an alternative to the virtIO-based ethernet driver. Needs a Container-Optimized OS node image. | false | Optional |
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
| gpu_partition_size | Size of partitions to create on the GPU | null | Optional |
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
| key | The key required for the taint | | Required |
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume.  | 0 | Optional |
| local_ssd_ephemeral_count | The amount of local SSD disks that will be attached to each cluster node and assigned as scratch space as an `emptyDir` volume. If unspecified, ephemeral storage is backed by the cluster node boot disk. | 0 | Optional |
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |
| min_cpu_platform | Minimum CPU platform to be used by the nodes in the pool. The nodes may be scheduled on the specified or newer CPU platform. | " " | Optional |
| max_count | Maximum number of nodes in the NodePool. Must be >= min_count | 100 | Optional |
| max_pods_per_node | The maximum number of pods per node in this cluster | null | Optional |
| max_surge | The number of additional nodes that can be added to the node pool during an upgrade. Increasing max_surge raises the number of nodes that can be upgraded simultaneously. Can be set to 0 or greater. | 1 | Optional |
| max_unavailable | The number of nodes that can be simultaneously unavailable during an upgrade. Increasing max_unavailable raises the number of nodes that can be upgraded in parallel. Can be set to 0 or greater. | 0 | Optional |
| min_count | Minimum number of nodes in the NodePool. Must be >=0 and <= max_count. Should be used when autoscaling is true | 1 | Optional |
| name | The name of the node pool |  | Required |
| placement_policy | Placement type to set for nodes in a node pool. Can be set as [COMPACT](https://cloud.google.com/kubernetes-engine/docs/how-to/compact-placement#overview) if desired | Optional |
| pod_range |  The ID of the secondary range for pod IPs. |  | Optional |
| node_count | The number of nodes in the nodepool when autoscaling is false. Otherwise defaults to 1. Only valid for non-autoscaling clusters |  | Required |
| node_locations | The list of zones in which the cluster's nodes are located. Nodes must be in the region of their regional cluster or in the same region as their cluster's zone for zonal clusters. Defaults to cluster level node locations if nothing is specified | " " | Optional |
| node_metadata | Options to expose the node metadata to the workload running on the node | | Optional |
| preemptible | A boolean that represents whether or not the underlying node VMs are preemptible | false | Optional |
| spot | A boolean that represents whether the underlying node VMs are spot | false | Optional |
| sandbox_type | Sandbox to use for pods in the node pool | | Required |
| service_account | The service account to be used by the Node VMs | " " | Optional |
| tags | The list of instance tags applied to all nodes | | Required |
| value | The value for the taint | | Required |
| version | The Kubernetes version for the nodes in this pool. Should only be set if auto_upgrade is false | " " | Optional |

## windows_node_pools variable
The windows_node_pools variable takes the same parameters as [node_pools](#node\_pools-variable) but is reserved for provisioning Windows based node pools only. This variable is introduced to satisfy a [specific requirement](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster-windows#create_a_cluster_and_node_pools) for the presence of at least one linux based node pool in the cluster before a windows based node pool can be created.

## Requirements

Before this module can be used on a project, you must ensure that the following pre-requisites are fulfilled:

1. Terraform and kubectl are [installed](#software-dependencies) on the machine where Terraform is executed.
2. The Service Account you execute the module with has the right [permissions](#configure-a-service-account).
3. The Compute Engine and Kubernetes Engine APIs are [active](#enable-apis) on the project you will launch the cluster in.
4. If you are using a Shared VPC, the APIs must also be activated on the Shared VPC host project and your service account needs the proper permissions there.

The [project factory](https://github.com/terraform-google-modules/terraform-google-project-factory) can be used to provision projects with the correct APIs active and the necessary Shared VPC connections.

### Software Dependencies
#### Kubectl
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
#### Terraform and Plugins
- [Terraform](https://www.terraform.io/downloads.html) 0.12
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v3.41
#### gcloud
Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH.
See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information.

### Configure a Service Account
In order to execute this module you must have a Service Account with the
following project roles:
- roles/compute.viewer
- roles/compute.securityAdmin (only required if `add_cluster_firewall_rules` is set to `true`)
- roles/container.clusterAdmin
- roles/container.developer
- roles/iam.serviceAccountAdmin
- roles/iam.serviceAccountUser
- roles/resourcemanager.projectIamAdmin (only required if `service_account` is set to `create`)

Additionally, if `service_account` is set to `create` and `grant_registry_access` is requested, the service account requires the following role on the `registry_project_ids` projects:
- roles/resourcemanager.projectIamAdmin

### Enable APIs
In order to operate with the Service Account you must activate the following APIs on the project where the Service Account was created:

- Compute Engine API - compute.googleapis.com
- Kubernetes Engine API - container.googleapis.com

[terraform-provider-google-beta]: https://github.com/terraform-providers/terraform-provider-google-beta
[12.3.0]: https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/12.3.0
[terraform-0.13-upgrade]: https://www.terraform.io/upgrade-guides/0-13.html


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>org.gradle.api.publish.ivy (Gradle API 1.12)</title>
<meta name="date" content="2014-04-29">
<link rel="stylesheet" type="text/css" href="../../../../../javadoc.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

@Incubating

Package org.gradle.api.publish.ivy

Types that deal with publishing in the Ivy format.

See: Description

Interface Summary

Interface
Description

IvyArtifact

An artifact published as part of a IvyPublication.

IvyArtifactSet

A Collection of IvyArtifacts to be included in an IvyPublication.

IvyConfiguration

A configuration included in an IvyPublication, which will be published in the ivy descriptor file generated.

IvyConfigurationContainer

The set of IvyConfigurations that will be included in the IvyPublication.

IvyDependency

A module dependency declared in an ivy dependency descriptor published as part of an IvyPublication.

IvyModuleDescriptor

The descriptor of any Ivy publication.

IvyPublication

A IvyPublication is the representation/configuration of how Gradle should publish something in Ivy format, to an Ivy repository.

Exception Summary

Exception
Description

InvalidIvyPublicationException

Thrown when attempting to publish with an invalid IvyPublication.

Package org.gradle.api.publish.ivy Description

Types that deal with publishing in the Ivy format.

Since:

1.3

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes


text:
<?php
/**
 * PHP version 5.
 *
 * @category Exceptions
 *
 * @author   Alexander Fedyashov <a@fedyashov.com>
 * @license  MIT https://opensource.org/licenses/MIT
 *
 * @link     https://github.com/layershifter/TLDExtract
 */
namespace CrowdTwist\TLDExtract\Tests;

use CrowdTwist\TLDExtract\Extract;
use CrowdTwist\TLDExtract\Result;

/**
 * Test that coverages all cases of CrowdTwist\TLDExtract\Result.
 */
class ResultTest extends \PHPUnit_Framework_TestCase
{

    /**
     * Object for tests.
     *
     * @var Result
     */
    private $entity;

    /**
     * Method that setups test's environment.
     */
    public function setUp()
    {
        $this->entity = new Result('192.168.0.1', null, null);
    }

    /**
     * Test for __constructor.
     */
    public function testConstruct()
    {
        static::assertNull($this->entity->subdomain);
        static::assertEquals('192.168.0.1', $this->entity->hostname);
        static::assertNull($this->entity->suffix);

        $entity = new Result(null, 'domain', 'com');

        static::assertNull($entity->hostname);
        static::assertEquals('domain', $entity->subdomain);
        static::assertEquals('com', $entity->suffix);

        unset($entity);

        $entity = new Result('www', 'domain', 'com');

        static::assertEquals('www', $entity->hostname);
        static::assertEquals('domain', $entity->subdomain);
        static::assertEquals('com', $entity->suffix);

        static::assertArrayHasKey('hostname', $entity);
        static::assertArrayHasKey('subdomain', $entity);
        static::assertArrayHasKey('suffix', $entity);
    }

    /**
     * Test domain entry.
     */
    public function testDomain()
    {
        $extract = new Extract;
        $result = $extract->parse('github.com');

        static::assertEquals('github.com', $result->getFullHost());
        static::assertEquals(null, $result->getHostname());
        static::assertEquals(null, $result->getHostnameParts());
        static::assertEquals('github.com', $result->getRegistrableDomain());
        static::assertEquals('github.com', $result->getPublicDomain());
        static::assertTrue($result->isValidDomain());
        static::assertFalse($result->isIp());
    }

    /**
     * Test subdomain entry.
     */
    public function testSubDomain()
    {
        $extract = new Extract;
        $result = $extract->parse('shop.github.com');

        static::assertEquals('shop.github.com', $result->getFullHost());
        static::assertEquals('github', $result->getSubdomain());
        static::assertEquals('github.com', $result->getRegistrableDomain());
        static::assertEquals('github.com', $result->getPublicDomain());
        static::assertTrue($result->isValidDomain());
        static::assertFalse($result->isIp());
    }

    /**
     * Test hostname parts.
     */
    public function testHostnameParts()
    {
        $extract = new Extract;
        $result = $extract->parse('new.shop.github.com');

        static::assertEquals('new.shop.github.com', $result->getFullHost());
        static::assertEquals('new.shop', $result->getHostname());
        static::assertEquals(['new', 'shop'], $result->getHostnameParts());
    }

    /**
     * Test IP entry.
     */
    public function testIp()
    {
        $extract = new Extract;
        $result = $extract->parse('192.168.0.1');

        static::assertEquals('192.168.0.1', $result->getFullHost());
        static::assertEquals(null, $result->getSubdomain());
        static::assertEquals(['192', '168', '0', '1'], $result->getHostnameParts());
        static::assertNull($result->getRegistrableDomain());
        static::assertFalse($result->isValidDomain());
        static::assertTrue($result->isIp());
    }

    /**
     * Test for toJson().
     */
    public function testToJson()
    {
        static::assertJsonStringEqualsJsonString(
            json_encode((object) [
                'hostname' => '192.168.0.1',
                'subdomain' => null,
                'suffix' => null,
            ]),
            $this->entity->toJson()
        );
    }

    /**
     * Test for magic method __toString().
     */
    public function testToString()
    {
        static::assertEquals('192.168.0.1', (string)$this->entity);
    }

    /**
     * Test for magic method __isset().
     */
    public function testIsset()
    {
        static::assertNull($this->entity->subdomain);
        static::assertNotNull($this->entity->hostname);
        static::assertNull($this->entity->suffix);

        /* @noinspection PhpUndefinedFieldInspection
         * Test for not existing field
         */
        static::assertEquals(false, isset($this->entity->test));
    }

    /**
     * Test for magic method __set().
     */
    public function testSet()
    {
        $this->setExpectedException('LogicException');
        $this->entity->offsetSet('hostname', 'another-domain');
    }

    /**
     * Test for magic method __set().
     */
    public function testSetViaProperty()
    {
        $this->setExpectedException('LogicException');
        $this->entity->hostname = 'another-domain';
    }

    /**
     * Test for magic method __get().
     */
    public function testGet()
    {
        $this->setExpectedException('OutOfRangeException');

        /* @noinspection PhpUndefinedFieldInspection
         * Test for not existing field
         */
        $this->entity->hostname1;
    }

    /**
     * Test for magic method __offsetSet().
     */
    public function testOffsetSet()
    {
        $this->setExpectedException('LogicException');
        $this->entity['hostname'] = 'another-domain';
    }

    /**
     * Test for magic method __offsetGet().
     */
    public function testOffsetGet()
    {
        static::assertEquals('192.168.0.1', $this->entity['hostname']);
    }

    /**
     * Test for magic method __offsetUnset().
     */
    public function testOffsetUnset()
    {
        $this->setExpectedException('LogicException');
        unset($this->entity['hostname']);
    }

}


text:
This boilerplate was built as a template for [vue-cli](https://github.com/vuejs/vue-cli) and includes options to customize your final scaffolded application. The use of `node@^7` or higher is required. electron-vue also officially recommends the [`yarn`](https://yarnpkg.org) package manager as it handles dependencies much better and can help reduce final build size with `yarn clean`.

```bash
# Install vue-cli and scaffold boilerplate
npm install -g vue-cli
vue init simulatedgreg/electron-vue my-project

# Install dependencies and run your app
cd my-project
yarn # or npm install
yarn run dev # or npm run dev
```

#### On the subject of electron

Although optional, it is recommended to lock in your electron version after scaffolding your project. This helps prevent other developers working on the same project from developing on a different version. Electron makes releases quite often so features are always subject to change. [More Info](http://electron.atom.io/docs/tutorial/electron-versioning/).

#### A note for Windows Users

If you run into errors during `npm install` about `node-gyp`, then you most likely do not have the proper build tools installed on your system. Build tools include items like Python and Visual Studio. Thanks to [@felixrieseberg](https://github.com/felixrieseberg), there are a few packages to help simplify this process.

The first item we need to check is our npm version and ensure that it is not outdated. This can is accomplished using [`npm-windows-upgrade`](https://github.com/felixrieseberg/npm-windows-upgrade). If you are using `yarn`, then you can skip this check.

Once that is complete, we can then continue to setup the needed build tools. Using [`windows-build-tools`](https://github.com/felixrieseberg/windows-build-tools), most of the dirty work is done for us. Installing this globally will in turn setup Visual C++ packages, Python, and more.

At this point things should successfully install, but if not then you will need a clean installation of Visual Studio. Please note that these are not direct problems with electron-vue itself \(Windows can be difficult sometimes ¯\\\_\(ツ\)\_/¯\).


text:
#ifndef _FCGLTextureManager_h
#define _FCGLTextureManager_h

#include "Shared/Graphics/FCGraphics.h"

#include "Shared/Graphics/FCTextureManager.h"
#include "FCGL.h"

//class FCGLTextureManager : public IFCTextureManager
class FCGLTextureManager
{
public:
	FCGLTextureManager();
	virtual ~FCGLTextureManager();

	static FCGLTextureManager* Instance();

	void BindDebugTextureToAttributeHandle( GLuint handle );
private:
	GLuint	m_hDebugTexture;
};

#endif


text:
import React, { Component } from 'react';
import { connect } from 'react-redux';
import Chart from '../components/chart';
import GoogleMap from '../components/google_map';

// removed b/c no longer exporting just WeatherList as the default
// export default class WeatherList extends Component {
class WeatherList extends Component {

  renderWeather(cityData) {
    const name = cityData.city.name;
    const temps = cityData.list.map(weather => weather.main.temp);
    const pressures = cityData.list.map(weather => weather.main.pressure);
    const humidities = cityData.list.map(weather => weather.main.humidity);
    // const lon = cityData.city.coord.lon;
    // const lat = cityData.city.coord.lat;
    // refactored for ES6 below
    const { lon, lat } = cityData.city.coord;

    return (

        <GoogleMap lon={lon} lat={lat} />
        <Chart data={temps} color="orange" units="K" />
        <Chart data={pressures} color="green" units="hPa" />
        <Chart data={humidities} color="black" units="%" />

    );
  }

	render() {
		return (

            City
            Temperature (K)
            Pressure (hPa)
            Humidity (%)

          {this.props.weather.map(this.renderWeather)}

		);
	}
}

// function mapStateToProps(state) {
//   return { weather: state.weather };
// }

// function mapStateToProps({ weather }) {
//   return { weather: weather };
// }

// ES6 refactor of the above functions
function mapStateToProps({ weather }) {
  return { weather };
}

export default connect(mapStateToProps)(WeatherList);


text:
// Binary kwazthis (K, what's this?) determines what references are located at a
// particular offset (or line and column) within a file.  All results are
// printed as JSON.
//
// By default, kwazthis will search for a .kythe configuration file in a
// directory above the given --path (if it exists locally relative to the
// current working directory).  If found, --path will be made relative to this
// directory and --root before making any Kythe service requests.  If not found,
// --path will be passed unchanged.  --ignore_local_repo will turn off this
// behavior.
//
// Usage:
//   kwazthis --path kythe/cxx/tools/kindex_tool_main.cc --offset 2660
//   kwazthis --path kythe/cxx/common/CommandLineUtils.cc --line 81 --column 27
//   kwazthis --path kythe/java/com/google/devtools/kythe/analyzers/base/EntrySet.java --offset 2815
package main

import (
	"encoding/json"
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"path/filepath"
	"strconv"
	"strings"

	"kythe.io/kythe/go/platform/vfs"
	"kythe.io/kythe/go/services/search"
	"kythe.io/kythe/go/services/xrefs"
	"kythe.io/kythe/go/serving/api"
	"kythe.io/kythe/go/util/flagutil"
	"kythe.io/kythe/go/util/kytheuri"
	"kythe.io/kythe/go/util/schema"

	"golang.org/x/net/context"

	spb "kythe.io/kythe/proto/storage_proto"
	xpb "kythe.io/kythe/proto/xref_proto"
)

func init() {
	flag.Usage = flagutil.SimpleUsage(`Determine what references are located at a particular offset (or line and column) within a file.

kwazthis normally searches for a .kythe configuration file in a directory above
the given --path (if it exists locally relative to the current working
directory).  If found, --path will be made relative to this directory and --root
before making any Kythe service requests.  If not found, --path will be passed
unchanged.

If the given --path file is found locally and --dirty_buffer is unset,
--dirty_buffer is automatically set to found local file and sent to the server .

--local_repo supplies kwazthis with the corpus root without searching the
filesystem for the .kythe file and --local_repo=NONE will turn off all local
filesystem behavior completely (including the automatic --dirty_buffer
feature).`,
		`(--offset int | --line int --column int) (--path p | --signature s)
[--corpus c] [--root r] [--language l]
[--api spec] [--local_repo root] [--dirty_buffer path] [--skip_defs]`)
}

var (
	ctx = context.Background()

	apiFlag = api.Flag("api", api.CommonDefault, api.CommonFlagUsage)

	localRepoRoot = flag.String("local_repo", "",
		`Path to local repository root ("" indicates to search for a .kythe configuration file in a directory about the given --path; "NONE" completely disables all local repository behavior)`)

	dirtyBuffer = flag.String("dirty_buffer", "", "Path to file with dirty buffer contents (optional)")

	path      = flag.String("path", "", "Path of file (optional if --signature is given)")
	signature = flag.String("signature", "", "Signature of file VName (optional if --path is given)")
	corpus    = flag.String("corpus", "", "Corpus of file VName (optional)")
	root      = flag.String("root", "", "Root of file VName (optional)")
	language  = flag.String("language", "", "Language of file VName (optional)")

	offset       = flag.Int("offset", -1, "Non-negative offset in file to list references (mutually exclusive with --line and --column)")
	lineNumber   = flag.Int("line", -1, "1-based line number in file to list references (must be given with --column)")
	columnOffset = flag.Int("column", -1, "Non-negative column offset in file to list references (must be given with --line)")

	skipDefinitions = flag.Bool("skip_defs", false, "Skip listing definitions for each node")
)

var (
	xs  xrefs.Service
	idx search.Service

	fileFacts = []*spb.SearchRequest_Fact{
		{Name: schema.NodeKindFact, Value: []byte(schema.FileKind)},
	}
)

type definition struct {
	File  *spb.VName `json:"file"`
	Start int        `json:"start"`
	End   int        `json:"end"`
}

type reference struct {
	Span struct {
		Start int    `json:"start"`
		End   int    `json:"end"`
		Text  string `json:"text,omitempty"`
	} `json:"span"`
	Kind string `json:"kind"`

	Node struct {
		Ticket  string   `json:"ticket"`
		Names   []string `json:"names,omitempty"`
		Kind    string   `json:"kind,omitempty"`
		Subkind string   `json:"subkind,omitempty"`
		Typed   string   `json:"typed,omitempty"`

		Definitions []*definition `json:"definitions,omitempty"`
	} `json:"node"`
}

var (
	definedAtEdge        = schema.MirrorEdge(schema.DefinesEdge)
	definedBindingAtEdge = schema.MirrorEdge(schema.DefinesBindingEdge)
)

func main() {
	flag.Parse()
	if flag.NArg() > 0 {
		flagutil.UsageErrorf("unknown non-flag argument(s): %v", flag.Args())
	} else if *offset < 0 && (*lineNumber < 0 || *columnOffset < 0) {
		flagutil.UsageError("non-negative --offset (or --line and --column) required")
	} else if *signature == "" && *path == "" {
		flagutil.UsageError("must provide at least --path or --signature")
	}

	defer (*apiFlag).Close()
	xs, idx = *apiFlag, *apiFlag

	relPath := *path
	if *localRepoRoot != "NONE" {
		if _, err := os.Stat(relPath); err == nil {
			absPath, err := filepath.Abs(relPath)
			if err != nil {
				log.Fatal(err)
			}
			if *dirtyBuffer == "" {
				*dirtyBuffer = absPath
			}

			kytheRoot := *localRepoRoot
			if kytheRoot == "" {
				kytheRoot = findKytheRoot(filepath.Dir(absPath))
			}
			if kytheRoot != "" {
				relPath, err = filepath.Rel(filepath.Join(kytheRoot, *root), absPath)
				if err != nil {
					log.Fatal(err)
				}
			}
		}
	}
	partialFile := &spb.VName{
		Signature: *signature,
		Corpus:    *corpus,
		Root:      *root,
		Path:      relPath,
		Language:  *language,
	}
	reply, err := idx.Search(ctx, &spb.SearchRequest{
		Partial: partialFile,
		Fact:    fileFacts,
	})
	if err != nil {
		log.Fatalf("Error locating file {%v}: %v", partialFile, err)
	}
	if len(reply.Ticket) == 0 {
		log.Fatalf("Could not locate file {%v}", partialFile)
	} else if len(reply.Ticket) > 1 {
		log.Fatalf("Ambiguous file {%v}; multiple results: %v", partialFile, reply.Ticket)
	}

	fileTicket := reply.Ticket[0]
	text := readDirtyBuffer(ctx)
	decor, err := xs.Decorations(ctx, &xpb.DecorationsRequest{
		// TODO(schroederc): limit Location to a SPAN around *offset
		Location:    &xpb.Location{Ticket: fileTicket},
		References:  true,
		SourceText:  true,
		DirtyBuffer: text,
		Filter: []string{
			schema.NodeKindFact,
			schema.SubkindFact,
			schema.AnchorLocFilter, // TODO(schroederc): remove once backwards-compatibility fix below is removed
		},
	})
	if err != nil {
		log.Fatal(err)
	}
	if text == nil {
		text = decor.SourceText
	}
	nodes := xrefs.NodesMap(decor.Node)

	// Normalize point within source text
	point := normalizedPoint(text)

	en := json.NewEncoder(os.Stdout)
	for _, ref := range decor.Reference {
		var start, end int
		if ref.AnchorStart == nil || ref.AnchorEnd == nil {
			// TODO(schroederc): remove this backwards-compatibility fix
			start, end = parseAnchorSpan(nodes[ref.SourceTicket])
		} else {
			start, end = int(ref.AnchorStart.ByteOffset), int(ref.AnchorEnd.ByteOffset)
		}

		if start <= point && point < end {
			var r reference
			r.Span.Start = start
			r.Span.End = end
			r.Span.Text = string(text[start:end])
			r.Kind = strings.TrimPrefix(ref.Kind, schema.EdgePrefix)
			r.Node.Ticket = ref.TargetTicket

			node := nodes[ref.TargetTicket]
			r.Node.Kind = string(node[schema.NodeKindFact])
			r.Node.Subkind = string(node[schema.SubkindFact])

			if eReply, err := xrefs.AllEdges(ctx, xs, &xpb.EdgesRequest{
				Ticket: []string{ref.TargetTicket},
				Kind:   []string{schema.NamedEdge, schema.TypedEdge, definedAtEdge, definedBindingAtEdge},
			}); err != nil {
				log.Printf("WARNING: error getting edges for %q: %v", ref.TargetTicket, err)
			} else {
				edges := xrefs.EdgesMap(eReply.EdgeSet)[ref.TargetTicket]
				for _, name := range edges[schema.NamedEdge] {
					if uri, err := kytheuri.Parse(name); err != nil {
						log.Printf("WARNING: named node ticket (%q) could not be parsed: %v", name, err)
					} else {
						r.Node.Names = append(r.Node.Names, uri.Signature)
					}
				}

				if typed := edges[schema.TypedEdge]; len(typed) > 0 {
					r.Node.Typed = typed[0]
				}

				if !*skipDefinitions {
					defs := edges[definedAtEdge]
					if len(defs) == 0 {
						defs = edges[definedBindingAtEdge]
					}
					for _, defAnchor := range defs {
						def, err := completeDefinition(defAnchor)
						if err != nil {
							log.Printf("WARNING: failed to complete definition for %q: %v", defAnchor, err)
						} else {
							r.Node.Definitions = append(r.Node.Definitions, def)
						}
					}
				}
			}

			if err := en.Encode(r); err != nil {
				log.Fatal(err)
			}
		}
	}
}

func completeDefinition(defAnchor string) (*definition, error) {
	parentReply, err := xrefs.AllEdges(ctx, xs, &xpb.EdgesRequest{
		Ticket: []string{defAnchor},
		Kind:   []string{schema.ChildOfEdge},
		Filter: []string{schema.NodeKindFact, schema.AnchorLocFilter},
	})
	if err != nil {
		return nil, err
	}

	parentNodes := xrefs.NodesMap(parentReply.Node)
	var files []string
	for _, parent := range xrefs.EdgesMap(parentReply.EdgeSet)[defAnchor][schema.ChildOfEdge] {
		if string(parentNodes[parent][schema.NodeKindFact]) == schema.FileKind {
			files = append(files, parent)
		}
	}

	if len(files) == 0 {
		return nil, nil
	} else if len(files) > 1 {
		return nil, fmt.Errorf("anchor has multiple file parents %q: %v", defAnchor, files)
	}

	vName, err := kytheuri.Parse(files[0])
	if err != nil {
		return nil, err
	}
	start, end := parseAnchorSpan(parentNodes[defAnchor])

	return &definition{
		File:  vName.VName(),
		Start: start,
		End:   end,
	}, nil
}

func parseAnchorSpan(anchor map[string][]byte) (start int, end int) {
	start, _ = strconv.Atoi(string(anchor[schema.AnchorStartFact]))
	end, _ = strconv.Atoi(string(anchor[schema.AnchorEndFact]))
	return
}

func readDirtyBuffer(ctx context.Context) []byte {
	if *dirtyBuffer == "" {
		return nil
	}

	f, err := vfs.Open(ctx, *dirtyBuffer)
	if err != nil {
		log.Fatalf("ERROR: could not open dirty buffer at %q: %v", *dirtyBuffer, err)
	}
	defer f.Close()
	data, err := ioutil.ReadAll(f)
	if err != nil {
		log.Fatalf("ERROR: could read dirty buffer at %q: %v", *dirtyBuffer, err)
	}
	return data
}

func findKytheRoot(dir string) string {
	for {
		if fi, err := os.Stat(filepath.Join(dir, ".kythe")); err == nil && fi.Mode().IsRegular() {
			return dir
		}
		if dir == "/" {
			break
		}
		dir = filepath.Dir(dir)
	}
	return ""
}

func normalizedPoint(text []byte) int {
	p := xrefs.NewNormalizer(text).Point(&xpb.Location_Point{
		ByteOffset:   max(*offset, 0),
		LineNumber:   max(*lineNumber, 0),
		ColumnOffset: max(*columnOffset, 0),
	})
	return int(p.ByteOffset)
}

func max(a, b int) int32 {
	if a > b {
		return int32(a)
	}
	return int32(b)
}


text:
namespace feedwire {
class DataOperation;
}  // namespace feedwire

namespace feed {
struct StreamModelUpdateRequest;

// An in-memory stream model.
class StreamModel {
 public:
  // Information about the context to pass to this model.
  struct Context {
    Context();
    ~Context();
    Context(const Context&) = delete;
    Context& operator=(const Context&) = delete;
    ContentRevision::Generator revision_generator;
  };

  // Information about an update to the model.
  struct UiUpdate {
    struct SharedStateInfo {
      // The shared state's unique ID.
      std::string shared_state_id;
      // Whether the shared state was just modified or added.
      bool updated = false;
    };
    UiUpdate();
    ~UiUpdate();
    UiUpdate(const UiUpdate&);
    UiUpdate& operator=(const UiUpdate&);
    // Whether the list of content has changed. Use
    // |StreamModel::GetContentList()| to get the updated list of content.
    bool content_list_changed = false;
    // The list of shared states in the model.
    std::vector<SharedStateInfo> shared_states;
  };

  struct StoreUpdate {
    StoreUpdate();
    ~StoreUpdate();
    StoreUpdate(StoreUpdate&&);
    StoreUpdate& operator=(StoreUpdate&&);
    StreamType stream_type;

    // Sequence number to use when writing to the store.
    int32_t sequence_number = 0;
    // Whether the |update_request| should overwrite all stream data.
    bool overwrite_stream_data = false;
    // Data to write. Either a list of operations or a
    // |StreamModelUpdateRequest|.
    std::vector<feedstore::DataOperation> operations;
    std::unique_ptr<StreamModelUpdateRequest> update_request;
  };

  class Observer : public base::CheckedObserver {
   public:
    // Called when the UI model changes.
    virtual void OnUiUpdate(const UiUpdate& update) = 0;
  };

  class StoreObserver {
   public:
    // Called when the peristent store should be modified to reflect a model
    // change.
    virtual void OnStoreChange(StoreUpdate update) = 0;
  };

  // TODO(crbug.com/1268575): Add LoggingParameters here, as they should stay
  // constant over the life of the model.
  explicit StreamModel(Context* context);
  ~StreamModel();

  StreamModel(const StreamModel& src) = delete;
  StreamModel& operator=(const StreamModel&) = delete;

  void SetStreamType(const StreamType& stream_type);
  void AddObserver(Observer* observer);
  void RemoveObserver(Observer* observer);
  void SetStoreObserver(StoreObserver* store_observer);

  // Data access.

  // Was this feed signed in.
  bool signed_in() const { return stream_data_.signed_in(); }

  // Is activity logging enabled?
  bool logging_enabled() const { return stream_data_.logging_enabled(); }

  // Has the privacy notice been fulfilled?
  bool privacy_notice_fulfilled() const {
    return stream_data_.privacy_notice_fulfilled();
  }

  // Returns the full list of content in the order it should be presented.
  const std::vector<ContentRevision>& GetContentList() const {
    return content_list_;
  }
  // Returns a list of all shared state IDs.
  std::vector<std::string> GetSharedStateIds() const;

  // Apply an update from the network or storage.
  void Update(std::unique_ptr<StreamModelUpdateRequest> update_request);

  // Returns the content identified by |ContentRevision|.
  const feedstore::Content* FindContent(ContentRevision revision) const;

  // Returns the ContentId of the content.
  feedwire::ContentId FindContentId(ContentRevision revision) const;

  // Returns the shared state data identified by |id|.
  const std::string* FindSharedStateData(const std::string& id) const;

  // Apply |operations| to the model.
  void ExecuteOperations(std::vector<feedstore::DataOperation> operations);

  // Create a temporary change that may be undone or committed later.
  EphemeralChangeId CreateEphemeralChange(
      std::vector<feedstore::DataOperation> operations);
  // Commits a change. Returns false if the change does not exist.
  bool CommitEphemeralChange(EphemeralChangeId id);
  // Rejects a change. Returns false if the change does not exist.
  bool RejectEphemeralChange(EphemeralChangeId id);

  const std::string& GetNextPageToken() const;
  // Time the client received this stream data. 'NextPage' requests do not
  // change this time.
  base::Time GetLastAddedTime() const;
  // Returns a set of content IDs contained. This remains constant even
  // after data operations or next-page requests.
  ContentIdSet GetContentIds() const;

  // Outputs a string representing the model state for debugging or testing.
  std::string DumpStateForTesting();

  // Returns true if one or more "cards" can be rendered from the content.
  bool HasVisibleContent();

  ContentStats GetContentStats() const;

  const std::string& GetRootEventId() const;

 private:
  struct SharedState {
    // Whether the data has been changed since the last call to |OnUiUpdate()|.
    bool updated = true;
    std::string data;
  };
  // The final feature tree after applying any ephemeral changes.
  // May link directly to |base_feature_tree_|.
  stream_model::FeatureTree* GetFinalFeatureTree();
  const stream_model::FeatureTree* GetFinalFeatureTree() const;

  void UpdateFlattenedTree();

  // The stream type for which this model is used. Used only for forwarding to
  // observers.
  StreamType stream_type_;

  base::ObserverList<Observer> observers_;
  raw_ptr<StoreObserver> store_observer_ = nullptr;  // Unowned.
  stream_model::ContentMap content_map_;
  stream_model::FeatureTree base_feature_tree_{&content_map_};
  // |base_feature_tree_| with |ephemeral_changes_| applied.
  // Null if there are no ephemeral changes.
  std::unique_ptr<stream_model::FeatureTree> feature_tree_after_changes_;
  stream_model::EphemeralChangeList ephemeral_changes_;

  // The following data is associated with the stream, but lives outside of the
  // tree.

  feedstore::StreamData stream_data_;
  base::flat_map<std::string, SharedState> shared_states_;
  int32_t next_structure_sequence_number_ = 0;

  // Current state of the flattened tree.
  // Updated after each tree change.
  std::vector<ContentRevision> content_list_;
};

}  // namespace feed
#endif  // COMPONENTS_FEED_CORE_V2_STREAM_MODEL_H_


text:
<?xml version="1.0" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<link rel="stylesheet" type="text/css" href="../../scineplex.css">
<title></title>
<link rel="stylesheet" href="../../Active.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />

NAME

SYNOPSIS

DESCRIPTION

LICENSE

NAME

CPAN::Version - utility functions to compare CPAN versions

SYNOPSIS

  use CPAN::Version;

  CPAN::Version->vgt("1.1","1.1.1");    # 1 bc. 1.1 > 1.001001

  CPAN::Version->vlt("1.1","1.1");      # 0 bc. 1.1 not < 1.1

  CPAN::Version->vcmp("1.1","1.1.1");   # 1 bc. first is larger

  CPAN::Version->vcmp("1.1.1","1.1");   # -1 bc. first is smaller

  CPAN::Version->readable(v1.2.3);      # "v1.2.3"

  CPAN::Version->vstring("v1.2.3");     # v1.2.3

  CPAN::Version->float2vv(1.002003);    # "v1.2.3"

DESCRIPTION

This module mediates between some version that perl sees in a package and the version that is published by the CPAN indexer.

It's only written as a helper module for both CPAN.pm and CPANPLUS.pm.

As it stands it predates version.pm but has the same goal: make version strings visible and comparable.

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


text:
#ifndef LOGIMPLOPENIKE_H
#define LOGIMPLOPENIKE_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <libopenikev2/logimpl.h>

#include <libopenikev2/busobserver.h>

using namespace std;

namespace openikev2 {

    /**
        This class represents a Log concrete implementation.
        @author Pedro J. Fernandez Ruiz, Alejandro Perez Mendez <pedroj@um.es, alex@um.es>
    */
    class LogImplOpenIKE : public LogImpl, public BusObserver {

            /****************************** ATTRIBUTES ******************************/
        protected:
            uint16_t log_mask;          /**< Current log mask */
            bool show_extra_info;       /**< Indicates if extra information must be shown */
            FILE *log_file;             /**< File to write log information */

            /****************************** METHODS ******************************/
        protected:
            /**
             * Creates a new LogImpl and sets its attribute default values
             */
            LogImplOpenIKE();

        public:
            /**
             * Sets the log mask to be applied.
             * @param log_mask Log mask
             */
            virtual void setLogMask( uint16_t log_mask );

            virtual void showExtraInfo(bool show_extra_info);

            /**
             * Writes a log message to the log file.
             * @param who Module writting the message
             * @param message Log message to be writed
             * @param type Type of log message (Log::LOG_INFO, D_THRD, ...)
             * @param main_info Indicates if date must be writed
             */
            virtual void writeMessage( string who, string message, uint16_t type, bool main_info ) = 0;

            /**
             * Opens the indicated file and writes subsequent log messages to it
             * @param file_name File name
             */
            virtual void open( string file_name );

            /**
             * Closes log file
             */
            virtual void close();

            virtual void notifyBusEvent( const BusEvent& event );

            virtual ~LogImplOpenIKE();
    };

};
#endif


text:
package org.apereo.portal.io.xml.permission;

import org.apereo.portal.utils.ComparableExtractingComparator;

/**
 * Compare ExternalActivity based on fname
 *
 * @author Eric Dalquist
 */
public class ExternalActivityFnameComparator extends ComparableExtractingComparator<ExternalActivity, String> {
    public static final ExternalActivityFnameComparator INSTANCE = new ExternalActivityFnameComparator();

    private ExternalActivityFnameComparator() {
    }

    @Override
    protected String getComparable(ExternalActivity o) {
        return o.getFname();
    }
}


text:
package android.graphics;

import android.annotation.ColorInt;
import android.annotation.Size;
import android.util.MathUtils;
import com.android.internal.util.XmlUtils;

import java.util.HashMap;
import java.util.Locale;

/**
 * The Color class defines methods for creating and converting color ints.
 * Colors are represented as packed ints, made up of 4 bytes: alpha, red,
 * green, blue. The values are unpremultiplied, meaning any transparency is
 * stored solely in the alpha component, and not in the color components. The
 * components are stored as follows (alpha << 24) | (red << 16) |
 * (green << 8) | blue. Each component ranges between 0..255 with 0
 * meaning no contribution for that component, and 255 meaning 100%
 * contribution. Thus opaque-black would be 0xFF000000 (100% opaque but
 * no contributions from red, green, or blue), and opaque-white would be
 * 0xFFFFFFFF
 */
public class Color {
    @ColorInt public static final int BLACK       = 0xFF000000;
    @ColorInt public static final int DKGRAY      = 0xFF444444;
    @ColorInt public static final int GRAY        = 0xFF888888;
    @ColorInt public static final int LTGRAY      = 0xFFCCCCCC;
    @ColorInt public static final int WHITE       = 0xFFFFFFFF;
    @ColorInt public static final int RED         = 0xFFFF0000;
    @ColorInt public static final int GREEN       = 0xFF00FF00;
    @ColorInt public static final int BLUE        = 0xFF0000FF;
    @ColorInt public static final int YELLOW      = 0xFFFFFF00;
    @ColorInt public static final int CYAN        = 0xFF00FFFF;
    @ColorInt public static final int MAGENTA     = 0xFFFF00FF;
    @ColorInt public static final int TRANSPARENT = 0;

    /**
     * Return the alpha component of a color int. This is the same as saying
     * color >>> 24
     */
    public static int alpha(int color) {
        return color >>> 24;
    }

    /**
     * Return the red component of a color int. This is the same as saying
     * (color >> 16) & 0xFF
     */
    public static int red(int color) {
        return (color >> 16) & 0xFF;
    }

    /**
     * Return the green component of a color int. This is the same as saying
     * (color >> 8) & 0xFF
     */
    public static int green(int color) {
        return (color >> 8) & 0xFF;
    }

    /**
     * Return the blue component of a color int. This is the same as saying
     * color & 0xFF
     */
    public static int blue(int color) {
        return color & 0xFF;
    }

    /**
     * Return a color-int from red, green, blue components.
     * The alpha component is implicity 255 (fully opaque).
     * These component values should be [0..255], but there is no
     * range check performed, so if they are out of range, the
     * returned color is undefined.
     * @param red  Red component [0..255] of the color
     * @param green Green component [0..255] of the color
     * @param blue  Blue component [0..255] of the color
     */
    @ColorInt
    public static int rgb(int red, int green, int blue) {
        return (0xFF << 24) | (red << 16) | (green << 8) | blue;
    }

    /**
     * Return a color-int from alpha, red, green, blue components.
     * These component values should be [0..255], but there is no
     * range check performed, so if they are out of range, the
     * returned color is undefined.
     * @param alpha Alpha component [0..255] of the color
     * @param red   Red component [0..255] of the color
     * @param green Green component [0..255] of the color
     * @param blue  Blue component [0..255] of the color
     */
    @ColorInt
    public static int argb(int alpha, int red, int green, int blue) {
        return (alpha << 24) | (red << 16) | (green << 8) | blue;
    }

    /**
     * Returns the relative luminance of a color.
     * <p>
     * Assumes sRGB encoding. Based on the formula for relative luminance
     * defined in WCAG 2.0, W3C Recommendation 11 December 2008.
     *
     * @return a value between 0 (darkest black) and 1 (lightest white)
     */
    public static float luminance(@ColorInt int color) {
        double red = Color.red(color) / 255.0;
        red = red < 0.03928 ? red / 12.92 : Math.pow((red + 0.055) / 1.055, 2.4);
        double green = Color.green(color) / 255.0;
        green = green < 0.03928 ? green / 12.92 : Math.pow((green + 0.055) / 1.055, 2.4);
        double blue = Color.blue(color) / 255.0;
        blue = blue < 0.03928 ? blue / 12.92 : Math.pow((blue + 0.055) / 1.055, 2.4);
        return (float) ((0.2126 * red) + (0.7152 * green) + (0.0722 * blue));
    }

    /**
     * Parse the color string, and return the corresponding color-int.
     * If the string cannot be parsed, throws an IllegalArgumentException
     * exception. Supported formats are:
     * #RRGGBB
     * #AARRGGBB
     * or one of the following names:
     * 'red', 'blue', 'green', 'black', 'white', 'gray', 'cyan', 'magenta',
     * 'yellow', 'lightgray', 'darkgray', 'grey', 'lightgrey', 'darkgrey',
     * 'aqua', 'fuchsia', 'lime', 'maroon', 'navy', 'olive', 'purple',
     * 'silver', 'teal'.
     */
    @ColorInt
    public static int parseColor(@Size(min=1) String colorString) {
        if (colorString.charAt(0) == '#') {
            // Use a long to avoid rollovers on #ffXXXXXX
            long color = Long.parseLong(colorString.substring(1), 16);
            if (colorString.length() == 7) {
                // Set the alpha value
                color |= 0x00000000ff000000;
            } else if (colorString.length() != 9) {
                throw new IllegalArgumentException("Unknown color");
            }
            return (int)color;
        } else {
            Integer color = sColorNameMap.get(colorString.toLowerCase(Locale.ROOT));
            if (color != null) {
                return color;
            }
        }
        throw new IllegalArgumentException("Unknown color");
    }

    /**
     * Convert RGB components to HSV.
     *     hsv[0] is Hue [0 .. 360)
     *     hsv[1] is Saturation [0...1]
     *     hsv[2] is Value [0...1]
     * @param red  red component value [0..255]
     * @param green  green component value [0..255]
     * @param blue  blue component value [0..255]
     * @param hsv  3 element array which holds the resulting HSV components.
     */
    public static void RGBToHSV(int red, int green, int blue, @Size(3) float hsv[]) {
        if (hsv.length < 3) {
            throw new RuntimeException("3 components required for hsv");
        }
        nativeRGBToHSV(red, green, blue, hsv);
    }

    /**
     * Convert the argb color to its HSV components.
     *     hsv[0] is Hue [0 .. 360)
     *     hsv[1] is Saturation [0...1]
     *     hsv[2] is Value [0...1]
     * @param color the argb color to convert. The alpha component is ignored.
     * @param hsv  3 element array which holds the resulting HSV components.
     */
    public static void colorToHSV(@ColorInt int color, @Size(3) float hsv[]) {
        RGBToHSV((color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF, hsv);
    }

    /**
     * Convert HSV components to an ARGB color. Alpha set to 0xFF.
     *     hsv[0] is Hue [0 .. 360)
     *     hsv[1] is Saturation [0...1]
     *     hsv[2] is Value [0...1]
     * If hsv values are out of range, they are pinned.
     * @param hsv  3 element array which holds the input HSV components.
     * @return the resulting argb color
    */
    public static int HSVToColor(@Size(3) float hsv[]) {
        return HSVToColor(0xFF, hsv);
    }

    /**
     * Convert HSV components to an ARGB color. The alpha component is passed
     * through unchanged.
     *     hsv[0] is Hue [0 .. 360)
     *     hsv[1] is Saturation [0...1]
     *     hsv[2] is Value [0...1]
     * If hsv values are out of range, they are pinned.
     * @param alpha the alpha component of the returned argb color.
     * @param hsv  3 element array which holds the input HSV components.
     * @return the resulting argb color
    */
    public static int HSVToColor(int alpha, @Size(3) float hsv[]) {
        if (hsv.length < 3) {
            throw new RuntimeException("3 components required for hsv");
        }
        return nativeHSVToColor(alpha, hsv);
    }

    private static native void nativeRGBToHSV(int red, int greed, int blue, float hsv[]);
    private static native int nativeHSVToColor(int alpha, float hsv[]);

    /**
     * Converts an HTML color (named or numeric) to an integer RGB value.
     *
     * @param color Non-null color string.
     *
     * @return A color value, or {@code -1} if the color string could not be interpreted.
     *
     * @hide
     */
    @ColorInt
    public static int getHtmlColor(String color) {
        Integer i = sColorNameMap.get(color.toLowerCase(Locale.ROOT));
        if (i != null) {
            return i;
        } else {
            try {
                return XmlUtils.convertValueToInt(color, -1);
            } catch (NumberFormatException nfe) {
                return -1;
            }
        }
    }

    private static final HashMap<String, Integer> sColorNameMap;

    static {
        sColorNameMap = new HashMap<String, Integer>();
        sColorNameMap.put("black", BLACK);
        sColorNameMap.put("darkgray", DKGRAY);
        sColorNameMap.put("gray", GRAY);
        sColorNameMap.put("lightgray", LTGRAY);
        sColorNameMap.put("white", WHITE);
        sColorNameMap.put("red", RED);
        sColorNameMap.put("green", GREEN);
        sColorNameMap.put("blue", BLUE);
        sColorNameMap.put("yellow", YELLOW);
        sColorNameMap.put("cyan", CYAN);
        sColorNameMap.put("magenta", MAGENTA);
        sColorNameMap.put("aqua", 0xFF00FFFF);
        sColorNameMap.put("fuchsia", 0xFFFF00FF);
        sColorNameMap.put("darkgrey", DKGRAY);
        sColorNameMap.put("grey", GRAY);
        sColorNameMap.put("lightgrey", LTGRAY);
        sColorNameMap.put("lime", 0xFF00FF00);
        sColorNameMap.put("maroon", 0xFF800000);
        sColorNameMap.put("navy", 0xFF000080);
        sColorNameMap.put("olive", 0xFF808000);
        sColorNameMap.put("purple", 0xFF800080);
        sColorNameMap.put("silver", 0xFFC0C0C0);
        sColorNameMap.put("teal", 0xFF008080);

    }
}


text:
<?php

namespace Sylius\Component\Currency\Model;

use Sylius\Component\Resource\Model\TimestampableTrait;
use Webmozart\Assert\Assert;

/**
 * @author Jan Góralski <jan.goralski@lakion.com>
 */
class ExchangeRate implements ExchangeRateInterface
{
    use TimestampableTrait;

    /**
     * @var mixed
     */
    protected $id;

    /**
     * @var float
     */
    protected $ratio;

    /**
     * @var CurrencyInterface
     */
    protected $sourceCurrency;

    /**
     * @var CurrencyInterface
     */
    protected $targetCurrency;

    public function __construct()
    {
        $this->createdAt = new \DateTime();
    }

    /**
     * {@inheritdoc}
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * {@inheritdoc}
     */
    public function getRatio()
    {
        return $this->ratio;
    }

    /**
     * {@inheritdoc}
     *
     * @throws \InvalidArgumentException
     */
    public function setRatio($ratio)
    {
        Assert::nullOrFloat($ratio);

        $this->ratio = $ratio;
    }

    /**
     * {@inheritdoc}
     */
    public function getSourceCurrency()
    {
        return $this->sourceCurrency;
    }

    /**
     * {@inheritdoc}
     */
    public function setSourceCurrency(CurrencyInterface $currency)
    {
        $this->sourceCurrency = $currency;
    }

    /**
     * {@inheritdoc}
     */
    public function getTargetCurrency()
    {
        return $this->targetCurrency;
    }

    /**
     * {@inheritdoc}
     */
    public function setTargetCurrency(CurrencyInterface $currency)
    {
        $this->targetCurrency = $currency;
    }
}


text:
"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
let container;
function getServiceContainer() {
    return container;
}
exports.getServiceContainer = getServiceContainer;
function setServiceContainer(serviceContainer) {
    container = serviceContainer;
}
exports.setServiceContainer = setServiceContainer;
//# sourceMappingURL=index.js.map