#!@BASH_SHELL@
#
# Copyright (c) 2014 David Vossel <davidvossel@gmail.com>
#                    All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it would be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# Further, this software is distributed without any warranty that it is
# free of the rightful claim of any third person regarding infringement
# or the like.  Any license provided herein, whether implied or
# otherwise, applies only to this software file.  Patent licenses, if
# any, provided herein do not apply to combinations of this program with
# other software, or any other product whatsoever.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write the Free Software Foundation,
# Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
#

#######################################################################
# Initialization:

: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat}
. ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs
. ${OCF_FUNCTIONS_DIR}/ocf-directories

# Parameter defaults

OCF_RESKEY_source_host_default=""
OCF_RESKEY_notify_args_default="false"

: ${OCF_RESKEY_source_host=${OCF_RESKEY_source_host_default}}
: ${OCF_RESKEY_notify_args=${OCF_RESKEY_notify_args_default}}

#######################################################################

sbindir=$HA_SBIN_DIR
if [ -z "$sbindir" ]; then
	sbindir=/usr/sbin
fi

SELINUX_ENABLED=-1

NFSNOTIFY_TMP_DIR="${HA_RSCTMP}/nfsnotify_${OCF_RESOURCE_INSTANCE}/"
HA_STATD_PIDFILE="$NFSNOTIFY_TMP_DIR/rpc.statd_${OCF_RESOURCE_INSTANCE}.pid"
HA_STATD_PIDFILE_PREV="$NFSNOTIFY_TMP_DIR/rpc.statd_${OCF_RESOURCE_INSTANCE}.pid.prev"
STATD_PATH="/var/lib/nfs/statd"
SM_NOTIFY_BINARY="${sbindir}/sm-notify"
IS_RENOTIFY=0

meta_data() {
	cat <<END
<?xml version="1.0"?>
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
<resource-agent name="nfsnotify">
<version>1.0</version>

<longdesc lang="en">
This agent sends NFSv3 reboot notifications to clients which informs clients to reclaim locks.
</longdesc>
<shortdesc lang="en">sm-notify reboot notifications</shortdesc>

<parameters>

<parameter name="source_host" unique="0" required="0">
<longdesc lang="en">
Comma separated list of floating IP addresses or host names that clients use
to access the nfs service.  This will be used to set the source address and
mon_name of the SN_NOTIFY reboot notifications.
</longdesc>
<shortdesc lang="en">source IP addresses</shortdesc>
<content type="string" default="${OCF_RESKEY_source_host_default}" />
</parameter>

<parameter name="notify_args" unique="0" required="0">
<longdesc lang="en">
Additional arguments to send to the sm-notify command. By default
this agent will always set sm-notify's '-f' option.  When the
source_host option is set, the '-v' option will be used automatically
to set the proper source address. Any additional sm-notify arguments
set with this option will be used in addition to the previous default
arguments.
</longdesc>
<shortdesc lang="en">sm-notify arguments</shortdesc>
<content type="string" default="${OCF_RESKEY_notify_args_default}" />
</parameter>

</parameters>

<actions>
<action name="start"        timeout="90s" />
<action name="stop"         timeout="90s" />
<action name="monitor"      timeout="90s" interval="30s" depth="0" />
<action name="reload"       timeout="90s" />
<action name="meta-data"    timeout="10s" />
<action name="validate-all"   timeout="20s" />
</actions>
</resource-agent>
END
}

v3notify_usage()
{
	cat <<END
usage: $0 {start|stop|monitor|validate-all|meta-data}

Expects to have a fully populated OCF RA-compliant environment set.
END
}

v3notify_validate()
{
	# check_binary will exit with OCF_ERR_INSTALLED when binary is missing
	check_binary "$SM_NOTIFY_BINARY"
	check_binary "pgrep"
	check_binary "killall"

	return $OCF_SUCCESS
}

killall_smnotify()
{
	# killall sm-notify
	killall -TERM $SM_NOTIFY_BINARY > /dev/null 2>&1
	if [ $? -eq 0 ]; then
		# it is useful to know if sm-notify processes were actually left around
		# or not during the stop/start operation. Whether this condition is true
		# or false does not indicate a failure. It does indicate that
		# there are probably some unresponsive nfs clients out there that are keeping
		# the sm-notify processes retrying.
		ocf_log info "previous sm-notify processes terminated before $__OCF_ACTION action."
	fi
}

v3notify_stop()
{
	killall_smnotify

	rm -f $HA_STATD_PIDFILE_PREV > /dev/null 2>&1
	mv $HA_STATD_PIDFILE $HA_STATD_PIDFILE_PREV > /dev/null 2>&1

	return $OCF_SUCCESS
}

check_statd_pidfile()
{
	local binary="rpc.statd"
	local pidfile="$HA_STATD_PIDFILE"

	ocf_log debug "Checking status for ${binary}."
	if [ -e "$pidfile" ]; then
		cat /proc/$(cat $pidfile)/cmdline 2>/dev/null | grep -a "${binary}" > /dev/null 2>&1
		if [ $? -eq 0 ]; then
			return $OCF_SUCCESS
		fi

		ocf_exit_reason "$(cat $pidfile) for $binary is no longer running, sm-notify needs to re-notify clients"
		return $OCF_ERR_GENERIC
	fi

	# if we don't have a pid file for rpc.statd, we have not yet sent the notifications
	return $OCF_NOT_RUNNING
}

write_statd_pid()
{
	local binary="rpc.statd"
	local pidfile="$HA_STATD_PIDFILE"
	local pid

	pid=$(pgrep ${binary})
	case $? in
		0)
			ocf_log info "PID file (pid:${pid} at $pidfile) created for ${binary}."
			mkdir -p $(dirname $pidfile)
			echo "$pid" > $pidfile
			return $OCF_SUCCESS;;
		1)
			rm -f "$pidfile" > /dev/null 2>&1
			ocf_log info "$binary is not running"
			return $OCF_NOT_RUNNING;;
		*)
			rm -f "$pidfile" > /dev/null 2>&1
		  	ocf_exit_reason "Error encountered detecting pid status of $binary"
			return $OCF_ERR_GENERIC;;
	esac
}

copy_statd()
{
	local src=$1
	local dest=$2

	if ! [ -d "$dest" ]; then
		mkdir -p "$dest"
	fi

	cp -rpfn $src/sm $src/sm.bak $src/state $dest > /dev/null 2>&1

	# make sure folder ownership and selinux lables stay consistent
	[ -n "`id -u rpcuser`" -a "`id -g rpcuser`" ] && chown rpcuser.rpcuser "$dest"
	[ $SELINUX_ENABLED -eq 0 ] && chcon -R "$SELINUX_LABEL" "$dest"
}

v3notify_start()
{
	local rc=$OCF_SUCCESS
	local cur_statd
	local statd_backup
	local is_renotify=0

	# monitor, see if we need to notify or not
	v3notify_monitor
	if [ $? -eq 0 ]; then
		return $OCF_SUCCESS
	fi

	# kill off any other sm-notify processes that might already be running.
	killall_smnotify

	# record the pid of rpc.statd. if this pid ever changes, we have to re-notify
	write_statd_pid
	rc=$?
	if [ $rc -ne 0 ]; then
		return $rc
	fi

	# if the last time we ran nfs-notify, it was with the same statd process,
	# consider this a re-notification. During re-notifications we do not let the
	# sm-notify binary have access to the real statd directory.
	if [ "$(cat $HA_STATD_PIDFILE)" = "$(cat $HA_STATD_PIDFILE_PREV 2>/dev/null)" ]; then
		ocf_log info "Renotifying clients"
		is_renotify=1
	fi

	statd_backup="$STATD_PATH/nfsnotify.bu"
	copy_statd "$STATD_PATH" "$statd_backup"

	if [ -z "$OCF_RESKEY_source_host" ]; then
		if [ "$is_renotify" -eq 0 ]; then
			cur_statd="$STATD_PATH"
		else
			cur_statd="$statd_backup"
		fi
		ocf_log info "sending notifications on default source address."
		$SM_NOTIFY_BINARY -f $OCF_RESKEY_notify_args -P $cur_statd
		if [ $? -ne 0 ]; then
			ocf_exit_reason "sm-notify execution failed, view syslog for more information"
			return $OCF_ERR_GENERIC
		fi

		return $OCF_SUCCESS
	fi

	# do sm-notify for each ip
	for ip in `echo ${OCF_RESKEY_source_host} | sed 's/,/ /g'`; do

		# have the first sm-notify use the actual statd directory so the
		# notify list can be managed properly.
		if [ "$is_renotify" -eq 0 ]; then
			cur_statd="$STATD_PATH"
			# everything after the first notify we are considering a renotification
			# which means we don't use the real statd directory.
			is_renotify=1
		else
			# use our copied statd directory for the remaining ip addresses
			cur_statd="$STATD_PATH/nfsnotify_${OCF_RESOURCE_INSTANCE}_${ip}"
			copy_statd "$statd_backup" "$cur_statd"
		fi

		ocf_log info "sending notifications with source address $ip"
		$SM_NOTIFY_BINARY -f $OCF_RESKEY_notify_args -v $ip -P "$cur_statd"
		if [ $? -ne 0 ]; then
			ocf_exit_reason "sm-notify with source host set to [ $ip ] failed. view syslog for more information"
			return $OCF_ERR_GENERIC
		fi
	done

	return $OCF_SUCCESS
}

v3notify_monitor()
{
	# verify rpc.statd is up, and that the rpc.statd pid is the same one we
	# found during the start. otherwise rpc.statd recovered and we need to notify
	# again.
	check_statd_pidfile
}

case $__OCF_ACTION in
	meta-data)   meta_data
		exit $OCF_SUCCESS;;
	usage|help)    v3notify_usage
		exit $OCF_SUCCESS;;
	*)
		;;
esac

which restorecon > /dev/null 2>&1 && selinuxenabled
SELINUX_ENABLED=$?
if [ $SELINUX_ENABLED -eq 0 ]; then
	export SELINUX_LABEL="$(ls -dZ $STATD_PATH | grep -o '\S\+:\S\+:\S\+')"
fi

case $__OCF_ACTION in
	start)         v3notify_start;;
	stop)          v3notify_stop;;
	monitor)       v3notify_monitor;;
	validate-all)  v3notify_validate;;
	*)             v3notify_usage
	               exit $OCF_ERR_UNIMPLEMENTED;;
esac

rc=$?
ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : $rc"
exit $rc


function s = col_sum(x)
% COL_SUM   Sum for each column.
% A more readable alternative to sum(x,1).
s = sum(x,1);


################################################################################
#
# nbd
#
################################################################################

NBD_VERSION = 3.15.2
NBD_SOURCE = nbd-$(NBD_VERSION).tar.xz
NBD_SITE = http://downloads.sourceforge.net/project/nbd/nbd/$(NBD_VERSION)
NBD_CONF_OPTS = --enable-lfs
NBD_DEPENDENCIES = libglib2
NBD_LICENSE = GPL-2.0
NBD_LICENSE_FILES = COPYING

ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
# We have linux/falloc.h
# but uClibc lacks fallocate(2) which is a glibc-ism
NBD_CONF_ENV = ac_cv_header_linux_falloc_h=no
endif

ifneq ($(BR2_PACKAGE_NBD_CLIENT),y)
NBD_TOREMOVE += /usr/sbin/nbd-client
endif
ifneq ($(BR2_PACKAGE_NBD_SERVER),y)
NBD_TOREMOVE += /usr/bin/nbd-server
endif
ifneq ($(BR2_PACKAGE_NBD_TRDUMP),y)
NBD_TOREMOVE += /usr/bin/nbd-trdump
endif

define NBD_CLEANUP_AFTER_INSTALL
	rm -f $(addprefix $(TARGET_DIR), $(NBD_TOREMOVE))
endef

NBD_POST_INSTALL_TARGET_HOOKS += NBD_CLEANUP_AFTER_INSTALL

$(eval $(autotools-package))


using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Abp.Application.Services.Dto;
using Abp.Authorization.Roles;
using Abp.AutoMapper;
using LTMCompanyNameFree.YoyoCmsTemplate.Authorization.Roles;

namespace LTMCompanyNameFree.YoyoCmsTemplate.Roles.Dto
{
    [AutoMap(typeof(Role))]
    public class RoleDto : EntityDto<int>
    {
        [Required]
        [StringLength(AbpRoleBase.MaxNameLength)]
        public string Name { get; set; }

        [Required]
        [StringLength(AbpRoleBase.MaxDisplayNameLength)]
        public string DisplayName { get; set; }

        public string NormalizedName { get; set; }

        [StringLength(Role.MaxDescriptionLength)]
        public string Description { get; set; }

        public bool IsStatic { get; set; }

        public List<string> Permissions { get; set; }
    }
}


#pragma once
#include "Common.hpp"

struct Emitter
{
    Emitter(const string& fname);
    ~Emitter();
    bool good();

    static inline int indent(int n) { return 4*n; }

    void emit(int indent, const char* msg, ...);
    void emitStart(int indent, const char* msg, ...);
    void emitContinue(const char* msg, ...);
    void emitEnd(const char* msg, ...);

    const string& getFilename();

  private:
    FILE* f = nullptr;
    string filename = "";
};


{% extends "dashboard.twig" %}

{% block notification %}{% endblock %}

{% block topcontrols %}
    {% include "@CoreHome/_siteSelectHeader.twig" %}
{% endblock %}

{% block content %}

            {{ 'SitesManager_SiteWithoutDataDescription'|translate }} {{ 'Installation_JSTracking_Intro'|translate }}
            {{ 'SitesManager_SiteWithoutDataSetupTracking'|translate('', "")|raw }}

            {{ 'SitesManager_SiteWithoutDataMessageDisappears'|translate }}

                {% if showMatomoLinks %}

{{ 'SitesManager_InstallationGuides'|translate }}

{{ 'SitesManager_InstallationGuidesIntro'|translate }}

                WordPress
                | Squarespace
                | Wix
                | SharePoint
                | Joomla
                | Shopify

                    {{ 'SitesManager_ExtraInformationNeeded'|translate }}

                    Matomo URL: {{ piwikUrl }}

                    {{ 'SitesManager_EmailInstructionsYourSiteId'|translate('' ~ idSite ~ '')|raw }}

                {% endif %}

{{ 'SitesManager_Integrations'|translate }}

{{ 'CoreAdminHome_JSTrackingIntro3a'|translate('','')|raw }} {{ 'CoreAdminHome_JSTrackingIntro3b'|translate|raw }}

{{ 'General_JsTrackingTag'|translate }}

{{ 'CoreAdminHome_JSTracking_CodeNoteBeforeClosingHead'|translate("</head>")|raw }}

                        {{ 'SitesManager_EmailInstructionsButton'|translate }}

{{ jsTag|raw }}

{{ 'CoreAdminHome_JSTrackingIntro5'|translate('','')|raw }}

{{ 'CoreAdminHome_JSTracking_EndNote'|translate('','')|raw }}

                     {{ 'SitesManager_CustomizeJavaScriptTracker'|translate }}

{{ 'SitesManager_LogAnalytics'|translate }}

{{ 'SitesManager_LogAnalyticsDescription'|translate('', '')|raw }}

{{ 'SitesManager_MobileAppsAndSDKs'|translate }}

{{ 'SitesManager_MobileAppsAndSDKsDescription'|translate('','')|raw }}

{{ 'CoreAdminHome_HttpTrackingApi'|translate }}

{{ 'CoreAdminHome_HttpTrackingApiDescription'|translate('','')|raw }}

                {% if googleAnalyticsImporterMessage is defined %}
                {{ googleAnalyticsImporterMessage|raw }}
                {% endif %}

                {{ postEvent('Template.endTrackingHelpPage') }}

            {{ postEvent('Template.siteWithoutData.afterIntro') }}

            {{ 'SitesManager_SiteWithoutDataIgnoreMessage'|translate }}

        {{ postEvent('Template.siteWithoutData.afterTrackingHelp') }}

{% endblock %}


'use strict'

module.exports = {
  parser: 'babel-eslint',

  extends: [
    '@strv/node/v10',
    '@strv/node/optional',
    '@strv/node/style',<%_ if (config.testsuite) { %>
    '@strv/mocha',<%_ } %>
  ],

  rules: {
    // If your editor cannot show these to you, occasionally turn this off and run the linter
    'no-warning-comments': 0,

    'node/no-unsupported-features/es-syntax': ['error', {
      ignores: ['modules'],
    }],
  },

  overrides: [{<%_ if (!config.testsuite) { %>
    // Custom settings for your test files
    files: [
      '**/*.test.mjs',
    ],

    env: {
      // Enable your test environment of choice here to have ESLint recognise its globals
      // mocha: true,
    },<%_ } else { %>
    files: [
      '**/*.test.mjs',
    ],

    rules: {
      'max-classes-per-file': 'off',
    },<%_ } %>
  }, {
    // Custom settings for plain JavaScript files
    files: [
      '*.js',
      '.*.js',
    ],

    parserOptions: {
      sourceType: 'script',
    },
  }],
}


DefinitionBlock ("", "SSDT", 2, "LENOVO", "TP-IGPU", 0x00002000)
{
    External (_SB_.PCI0.IGPU, DeviceObj)

    Method (_SB.PCI0.IGPU._DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
    {
        If ((Arg2 == Zero))
        {
            Return (Buffer (One)
            {
                 0x03                                             // .
            })
        }

        Return (Package (0x32)
        {
            "AAPL,GfxYTile",
            Buffer (0x04)
            {
                 0x01, 0x00, 0x00, 0x00                           // ....
            },

            "framebuffer-unifiedmem",
            Buffer (0x04)
            {
                 0x00, 0x00, 0x00, 0x80                           // ....
            },

            "framebuffer-con2-enable",
            Buffer (0x04)
            {
                 0x01, 0x00, 0x00, 0x00                           // ....
            },

            "framebuffer-portcount",
            Buffer (0x04)
            {
                 0x02, 0x00, 0x00, 0x00                           // ....
            },

            "disable-external-gpu",
            Buffer (0x04)
            {
                 0x01, 0x00, 0x00, 0x00                           // ....
            },

            "device-id",
            Buffer (0x04)
            {
                 0x16, 0x16, 0x00, 0x00                           // ....
            },

            "framebuffer-con1-pipe",
            Buffer (0x04)
            {
                 0x12, 0x00, 0x00, 0x00                           // ....
            },

            "device_type",
            Buffer (0x1A)
            {
                "VGA Compatible Controller"
            },

            "hda-gfx",
            Buffer (0x0A)
            {
                "onboard-1"
            },

            "built-in",
            Buffer (One)
            {
                 0x00                                             // .
            },

            "framebuffer-patch-enable",
            Buffer (0x04)
            {
                 0x01, 0x00, 0x00, 0x00                           // ....
            },

            "framebuffer-con0-pipe",
            Buffer (0x04)
            {
                 0x12, 0x00, 0x00, 0x00                           // ....
            },

            "framebuffer-con1-type",
            Buffer (0x04)
            {
                 0x00, 0x08, 0x00, 0x00                           // ....
            },

            "AAPL,slot-name",
            Buffer (0x09)
            {
                "Internal"
            },

            "AAPL,ig-platform-id",
            Buffer (0x04)
            {
                 0x06, 0x00, 0x26, 0x16                           // ..&.
            },

            "framebuffer-con2-index",
            Buffer (0x04)
            {
                 0xFF, 0xFF, 0xFF, 0xFF                           // ....
            },

            "model",
            Buffer (0x17)
            {
                "Intel HD Graphics 5500"
            },

            "framebuffer-con1-enable",
            Buffer (0x04)
            {
                 0x01, 0x00, 0x00, 0x00                           // ....
            },

            "framebuffer-con0-enable",
            Buffer (0x04)
            {
                 0x01, 0x00, 0x00, 0x00                           // ....
            },

            "vendor-id",
            Buffer (0x04)
            {
                 0x86, 0x80, 0x00, 0x00                           // ....
            },

            "subsystem-vendor-id",
            Buffer (0x04)
            {
                 0xAA, 0x17, 0x00, 0x00                           // ....
            },

            "subsystem-device-id",
            Buffer (0x04)
            {
                 0x34, 0x50, 0x00, 0x00                           // 4P..
            },

            "name",
            Buffer ()
            {
                "Apple Retina Display"
            },

            "IOName",
            Buffer (0x0D)
            {
                "pci8086,1616"
            },

            "compatible",
            Buffer (0x32)
            {
                "pci17aa,5034, pci8086,1616, pciclass,030000, IGPU"
            }
        })
    }
}


---
id: configuration
title: Module Configuration
sidebar_label: Module Configuration
---

Each module can have its own configuration, and you can specify it in your `GraphQLModule`.

Start by creating a TypeScript interface that specifies the structure of your configuration object, and pass it as the first generic argument to your `GraphQLModule`:

```typescript
import { GraphQLModule } from '@graphql-modules/core';
import { MyProvider } from './my-provider.ts';

export interface MyModuleConfig {
  secretKey: string;
  remoteEndpoint: string;
  someDbInstance: SomeDBInstance;
}

// You can access the config object like below inside the module declaration
export const MyModule = new GraphQLModule<MyModuleConfig>({
  providers: ({ config: { someDbInstance } }) => [
    MyProvider,
    {
      provide: SomeDbInstance,
      useValue: someDbInstance,
    },
  ],
});
```

To provide the configuration values, add `.forRoot` to your module when you load it:

```typescript
import { GraphQLModule } from '@graphql-modules/core';
import { MyModule } from './modules/my-module';

const AnotherModule = new GraphQLModule({
  imports: [
    MyModule.forRoot({
      secretKey: '123',
      remoteEndpoint: 'http://my-other-service.com',
    }),
  ],
});
```

To get access to your configuration in your `Provider`s, inject `MyModuleConfig`:

```typescript
import { ModuleConfig } from '@graphql-modules/core';
import { Inject, Injectable } from '@graphql-modules/di';
import { MyModule } from './my-module.ts';

@Injectable()
export class MyProvider {
  constructor(@Inject(ModuleConfig) private config: MyModuleConfig) {
    ...
  }

  async fetchData() {
    return fetch({
      url: this.config.remoteEndpoint.
      body: {
        key: this.config.secretKey,
      }
    });
  }
}
```


<!DOCTYPE html>

  <title>API documentation</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap.min.css'/>
<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/prettify.css'/>
<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap-responsive.min.css'/>
  <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/application.css'/>

    Foreman v2
    /

      Plugins

    /

index

   [ ca | cs_CZ | de | en | en_GB | es | fr | gl | it | ja | ko | nl_NL | pl | pt_BR | ru | sv_SE | zh_CN | zh_TW ]

      GET /api/plugins

      List installed plugins

Examples

GET /api/plugins
200
{
  "total": 1,
  "subtotal": 1,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "id": "skip_test",
      "name": null,
      "author": null,
      "description": null,
      "url": null,
      "version": null
    }
  ]
}

Params

        Param name
        Description

      location_id

        optional

Set the current location context for the request

Validations:

Must be a Integer

      organization_id

        optional

Set the current organization context for the request

Validations:

Must be a Integer


<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="timeout" content="long">
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">


---

title: Enable dual-write for existing Finance and Operations apps
description: Learn how to enable dual-write for existing instances of Finance and Operations apps, and also for a new or existing Common Data Service environment.
author: sabinn-msft
manager: AnnBe
ms.date: 03/20/2020
ms.topic: article
ms.prod:
ms.service: dynamics-ax-applications
ms.technology:

# optional metadata

ms.search.form:
# ROBOTS:
audience: Developer
# ms.devlang:
ms.reviewer: v-douklo
ms.search.scope: Operations
# ms.tgt_pltfrm:
ms.custom:
ms.assetid:
ms.search.region: Global
# ms.search.industry:
ms.author: sabinn
ms.search.validFrom: 2020-03-20
ms.dyn365.ops.version: AX 7.0.0
---

# Enable dual-write for existing Finance and Operations apps

[!include [banner](../../includes/banner.md)]

This set of topics provides step-by step instructions that explain how to enable dual-write for existing instances of Finance and Operations apps (Microsoft Dynamics 365 Finance and Dynamics 365 Supply Chain Management), and also for a new or existing Common Data Service environment.

## Step-by-step instructions to enable dual-write for existing instances of Finance and Operations apps and a new or existing Common Data Service environment

The process of enabling dual-write has three parts:

1. [Make sure that you meet all the system requirements and complete all the prerequisites](requirements-and-prerequisites.md).
2. [Link your Finance and Operations app environment to Common Data Service by using the dual-write wizard](link-your-environment.md).
3. [Enable the entity maps](enable-entity-map.md).

Each part is described in a separate topic.

## Next steps

[System requirements and prerequisites](requirements-and-prerequisites.md)


/*
 * reserved comment block
 * DO NOT REMOVE OR ALTER!
 */
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.sun.org.apache.bcel.internal.classfile;

import java.io.DataInput;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import com.sun.org.apache.bcel.internal.Const;

/**
 * This class represents a reference to an unknown (i.e.,
 * application-specific) attribute of a class.  It is instantiated from the
 * {@link Attribute#readAttribute(java.io.DataInput, ConstantPool)} method.
 * Applications that need to read in application-specific attributes should create an
 * {@link UnknownAttributeReader} implementation and attach it via
 * {@link Attribute#addAttributeReader(String, UnknownAttributeReader)}.

 *
 * @version $Id$
 * @see Attribute
 * @see UnknownAttributeReader
 */
public final class Unknown extends Attribute {

    private byte[] bytes;
    private final String name;
    private static final Map<String, Unknown> unknown_attributes = new HashMap<>();

    /** @return array of unknown attributes, but just one for each kind.
     */
    static Unknown[] getUnknownAttributes() {
        final Unknown[] unknowns = new Unknown[unknown_attributes.size()];
        unknown_attributes.values().toArray(unknowns);
        unknown_attributes.clear();
        return unknowns;
    }

    /**
     * Initialize from another object. Note that both objects use the same
     * references (shallow copy). Use clone() for a physical copy.
     */
    public Unknown(final Unknown c) {
        this(c.getNameIndex(), c.getLength(), c.getBytes(), c.getConstantPool());
    }

    /**
     * Create a non-standard attribute.
     *
     * @param name_index Index in constant pool
     * @param length Content length in bytes
     * @param bytes Attribute contents
     * @param constant_pool Array of constants
     */
    public Unknown(final int name_index, final int length, final byte[] bytes, final ConstantPool constant_pool) {
        super(Const.ATTR_UNKNOWN, name_index, length, constant_pool);
        this.bytes = bytes;
        name = ((ConstantUtf8) constant_pool.getConstant(name_index, Const.CONSTANT_Utf8))
                .getBytes();
        unknown_attributes.put(name, this);
    }

    /**
     * Construct object from input stream.
     *
     * @param name_index Index in constant pool
     * @param length Content length in bytes
     * @param input Input stream
     * @param constant_pool Array of constants
     * @throws IOException
     */
    Unknown(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool)
            throws IOException {
        this(name_index, length, (byte[]) null, constant_pool);
        if (length > 0) {
            bytes = new byte[length];
            input.readFully(bytes);
        }
    }

    /**
     * Called by objects that are traversing the nodes of the tree implicitely
     * defined by the contents of a Java class. I.e., the hierarchy of methods,
     * fields, attributes, etc. spawns a tree of objects.
     *
     * @param v Visitor object
     */
    @Override
    public void accept( final Visitor v ) {
        v.visitUnknown(this);
    }

    /**
     * Dump unknown bytes to file stream.
     *
     * @param file Output file stream
     * @throws IOException
     */
    @Override
    public final void dump( final DataOutputStream file ) throws IOException {
        super.dump(file);
        if (super.getLength() > 0) {
            file.write(bytes, 0, super.getLength());
        }
    }

    /**
     * @return data bytes.
     */
    public final byte[] getBytes() {
        return bytes;
    }

    /**
     * @return name of attribute.
     */
    @Override
    public final String getName() {
        return name;
    }

    /**
     * @param bytes the bytes to set
     */
    public final void setBytes( final byte[] bytes ) {
        this.bytes = bytes;
    }

    /**
     * @return String representation.
     */
    @Override
    public final String toString() {
        if (super.getLength() == 0 || bytes == null) {
            return "(Unknown attribute " + name + ")";
        }
        String hex;
        if (super.getLength() > 10) {
            final byte[] tmp = new byte[10];
            System.arraycopy(bytes, 0, tmp, 0, 10);
            hex = Utility.toHexString(tmp) + "... (truncated)";
        } else {
            hex = Utility.toHexString(bytes);
        }
        return "(Unknown attribute " + name + ": " + hex + ")";
    }

    /**
     * @return deep copy of this attribute
     */
    @Override
    public Attribute copy( final ConstantPool _constant_pool ) {
        final Unknown c = (Unknown) clone();
        if (bytes != null) {
            c.bytes = new byte[bytes.length];
            System.arraycopy(bytes, 0, c.bytes, 0, bytes.length);
        }
        c.setConstantPool(_constant_pool);
        return c;
    }
}


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

description: >-
  ResNet-101 with Squeeze-and-Excitation blocks <https://arxiv.org/abs/1709.01507>
task_type: classification
files:
  - name: se-resnet-101.prototxt
    size: 98677
    sha256: c97375db60ad04e1196966c7149bd5cc98fbb9a34bdde511c26c922ba791903d
    source: https://raw.githubusercontent.com/hujie-frank/SENet/369374b0678907a0e45c6f267256c7c34203177e/models/SE-ResNet-101.prototxt
  - name: se-resnet-101.caffemodel
    size: 197806200
    sha256: 09777ce1202087954ee34ae2566cf611d03d2d8195ced0fe51b612ebf951d729
    source:
      $type: google_drive
      id: 0BwHV3BlNKkWlTEg4YmcwQ0FoZFU
model_optimizer_args:
  - --input_shape=[1,3,224,224]
  - --input=data
  - --mean_values=data[104.0,117.0,123.0]
  - --output=prob
  - --input_model=$dl_dir/se-resnet-101.caffemodel
  - --input_proto=$dl_dir/se-resnet-101.prototxt
framework: caffe
quantizable: yes
license: https://raw.githubusercontent.com/hujie-frank/SENet/master/LICENSE


<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="hs__app_review_button">आढावा घ्या</string>
    <string name="hs__attach_screenshot_btn">स्क्रीनशॉट जोडा</string>
    <string name="hs__attach_screenshot_button">जोडा</string>
    <string name="hs__ca_msg">आम्ही आपल्याला आनंदाने मदत करू!</string>
    <string name="hs__change_btn">बदला</string>
    <string name="hs__chat_btn">@string/hs__contact_us_btn</string>
    <string name="hs__chat_hint">आपला संदेश टाइप करा</string>
    <string name="hs__chat_out_of_business_hours">आम्ही सध्या उपस्थित नाही आहोत, आम्ही आपल्याशी कार्यालयीन वेळेत पुन्हा संपर्क साधू.</string>
    <string name="hs__confirmation_footer_msg">आम्हाला संदेश पाठविल्याबद्दल धन्यवाद!</string>
    <string name="hs__confirmation_msg">आम्ही आपल्या सर्व प्रश्नांची उत्तरे दिली का?</string>
    <string name="hs__contact_us_btn">आमच्याशी संपर्क करा</string>
    <string name="hs__conversation_detail_error">कृपया आपल्या समस्येचे वर्णन करा</string>
    <string name="hs__conversation_end_msg">हा संवाद संपलेला आहे.</string>
    <string name="hs__conversation_header">संवाद</string>
    <string name="hs__conversation_started_message">आमच्याशी संपर्क केल्याबद्दल धन्यवाद. आमच्याशी संपर्क केल्याबद्दल धन्यवाद!</string>
    <string name="hs__copy">कॉपी करा</string>
    <string name="hs__could_not_open_attachment_msg">ही कृती कोणतीही अॅप्स करू शकत नाहीत.</string>
    <string name="hs__could_not_reach_support_msg">सहाय्यापर्यंत पोहोचण्यात अक्षम</string>
    <string name="hs__cr_msg">इतर कशाबद्दल आम्ही आपल्याला मदत करू शकतो?</string>
    <string name="hs__csat_additonal_feedback_message">इतर कोणताही प्रतिसाद (वैकल्पिक)</string>
    <string name="hs__csat_dislike_message">त्याबद्दल द्वेष वाटला!</string>
    <string name="hs__csat_like_message">ते आवडले!</string>
    <string name="hs__csat_message">आपला आमच्या ग्राहक सहाय्याबद्दल काय प्रतिसाद आहे?</string>
    <string name="hs__csat_option_message">किंवा</string>
    <string name="hs__csat_ratingbar">कृपया आमच्या सेवेस मूल्यांकन द्या.</string>
    <string name="hs__csat_submit_toast">आम्हाला मूल्यांकन दिल्याबद्दल धन्यवाद!</string>
    <string name="hs__data_not_found_msg">डेटा सापडला नाही</string>
    <string name="hs__default_notification_content_title">सहाय्य</string>
    <string name="hs__description_invalid_length_error">कृपया पुढे वर्णन करा ज्यामुळे आम्ही अधिक चांगली मदत करू शकू</string>
    <string name="hs__dm_video_loading">व्हिडिओ लोड करत आहे…</string>
    <string name="hs__done_btn">झाले</string>
    <string name="hs__email_hint">ईमेल (वैकल्पिक)</string>
    <string name="hs__email_required_hint">ईमेल</string>
    <string name="hs__empty_section">क्षमस्व! या विभागात कोणतेही प्रश्न उपलब्ध नाहीत.</string>
    <string name="hs__faq_fetching_fail_message">या क्षणी एफएक्यू लोड करण्यास अक्षम. कृपया थोड्या क्षणाने पुन्हा प्रयत्न करा…</string>
    <string name="hs__faq_header">एफएक्यू</string>
    <string name="hs__faqs_search_footer">कोणतेही एफएक्यू सापडले नाहीत.</string>
    <string name="hs__feedback_button">प्रतिसाद पाठवा</string>
    <string name="hs__fetching_faqs_message">आपली उत्तरे मिळविणे…</string>
    <string name="hs__file_not_found_msg">फाइल सापडली नाही</string>
    <string name="hs__file_type_audio">ऑडिओ</string>
    <string name="hs__file_type_csv">सीएसव्ही</string>
    <string name="hs__file_type_ms_office">ऑफिस डॉक</string>
    <string name="hs__file_type_pdf">पीडीएफ</string>
    <string name="hs__file_type_rtf">आरटीएफ</string>
    <string name="hs__file_type_text">टीएक्सटी</string>
    <string name="hs__file_type_unknown">फाइल</string>
    <string name="hs__file_type_video">व्हिडिओ</string>
    <string name="hs__help_header">मदत</string>
    <string name="hs__image_attachment">प्रतिमा जोडणी</string>
    <string name="hs__image_not_available">प्रतिमा उपलब्ध नाही.</string>
    <string name="hs__invalid_description_error">अवैध वर्णन</string>
    <string name="hs__invalid_email_error">कृपया एक वैध ईमेल प्रविष्ट करा</string>
    <string name="hs__issue_archival_message">क्षमस्व! निष्क्रियतेमुळे हे संभाषण बंद करण्यात आले आहे. आमच्या एजंट्सशी नवीन संभाषण सुरु करा.</string>
    <string name="hs__mark_helpful_toast">प्रश्नाला उपयुक्त म्हणून खूण केली गेली आहे</string>
    <string name="hs__mark_no">नाही</string>
    <string name="hs__mark_unhelpful_toast">प्रश्नाला उपयुक्त नाही म्हणून खूण केली गेली आहे</string>
    <string name="hs__mark_yes">होय</string>
    <string name="hs__mark_yes_no_question">हे उपयुक्त होते का?</string>
    <string name="hs__message_not_sent">संदेश पाठवला गेला नाही.</string>
    <string name="hs__network_error_msg">उप्स! काहीतरी चुकीचे झाले</string>
    <string name="hs__network_unavailable_msg">नेटवर्क उपलब्ध नाही.</string>
    <string name="hs__new_conversation_btn">एक नवीन संवाद सुरू करा</string>
    <string name="hs__new_conversation_header">नवीन संवाद</string>
    <string name="hs__new_conversation_hint">आम्ही कशी मदत करू शकतो?</string>
    <string name="hs__no_search_results_message">व्हुप्स! आम्हाला query साठी काहीही सापडू शकले नाही</string>
    <string name="hs__notification_content_text">बद्दल:</string>
    <string name="hs__permission_denied_message">स्क्रीनशॉटपर्यंत प्रवेश करण्यासाठी आणि जोडण्या डाऊनलोड करण्यासाठी संचय परवानगी आवश्यक आहे</string>
    <string name="hs__permission_denied_snackbar_action">सेटिंग्स</string>
    <string name="hs__permission_not_granted">अनुप्रयोगाला आपल्या फोटोंपर्यंत प्रवेश करण्याची परवानगी नाही</string>
    <string name="hs__permission_rationale_snackbar_action_label">ठीक आहे</string>
    <string name="hs__question_header" />
    <string name="hs__question_helpful_message">आपल्याला हे उपयुक्त वाटले.</string>
    <string name="hs__question_unhelpful_message">आपल्याला हे उपयुक्त वाटले नाही.</string>
    <string name="hs__rate_button">मूल्यांकन करा</string>
    <string name="hs__remove_screenshot_btn">स्क्रीनशॉट काढून टाका</string>
    <string name="hs__retry_faq_fetching_button">पुन्हा प्रयत्न करा</string>
    <string name="hs__review_accepted_message">आपण आढावा विनंती स्वीकारली</string>
    <string name="hs__review_close_button">बंद करा</string>
    <string name="hs__review_message">आपल्याला आमचे अॅप आवडले असेल तर, कृपया त्याला मूल्यांकन देण्यासाठी काही क्षण काढा</string>
    <string name="hs__review_request_message">आपल्याला प्ले स्टोअरवर अॅपचा आढावा घ्यायला आवडेल का?</string>
    <string name="hs__review_title">आमच्या अॅपला मूल्यांकन द्या</string>
    <string name="hs__screenshot_add">जोडा</string>
    <string name="hs__screenshot_cloud_attach_error">स्क्रीनशॉट जोडताना रुटी. कृपया साधनावर थानिकरि या उपलब्ध असलेली प्रतिमा निवडा.</string>
    <string name="hs__screenshot_limit_error">स्क्रीनशॉटचा आकार %.2f एमबी हून जास्त असू नये</string>
    <string name="hs__screenshot_remove">काढून टाका</string>
    <string name="hs__screenshot_sent_msg">स्क्रीनशॉट पाठवला</string>
    <string name="hs__screenshot_upload_error_msg">स्क्रीनशॉट अपलोड करताना त्रुटी</string>
    <string name="hs__search_footer">आपण शोधत आहात ते सापडू शकत नाही का?</string>
    <string name="hs__search_hint">आपल्या समस्येचे वर्णन करा</string>
    <string name="hs__search_result_message">आपले उत्तर आधीच असू शकणारे प्रश्न</string>
    <string name="hs__search_result_title">सूचना</string>
    <string name="hs__search_title">शोधा</string>
    <string name="hs__select_a_question_message">कृपया डावीकडून एक प्रश्न निवडा</string>
    <string name="hs__send_anyway">तरीही पाठवा</string>
    <string name="hs__send_msg_btn">पाठवा</string>
    <string name="hs__sending_fail_msg">संदेश पाठविला नाही. पुन्हा प्रयत्न करण्यासाठी स्पर्श करा.</string>
    <string name="hs__sending_msg">पाठवा…</string>
    <string name="hs__solved_btn">होय, सोडवले!</string>
    <string name="hs__starting_download">डाऊनलोड सुरू होत आहे…</string>
    <string name="hs__submit_conversation_btn">प्रस्तुत करा</string>
    <string name="hs__unsolved_btn">नाही, सोडविलेले नाही</string>
    <string name="hs__username_blank_error">कृपया एक वैध नाव प्रविष्ट करा</string>
    <string name="hs__username_hint">आपले नाव</string>
    <string name="com_facebook_device_auth_instructions">आपला स्‍मार्ट फोन किंवा संगणकावर %@ ला भेट द्या आणि हा कोड प्रविष्‍ट करा:</string>
    <string name="com_facebook_image_download_unknown_error">प्रतिमा डाउनलोड करताना अनपेक्षित त्रुटी.</string>
    <string name="com_facebook_internet_permission_error_message">वेबदृश्य लॉग इन आवश्यकता इंटरनेट परवानगी</string>
    <string name="com_facebook_internet_permission_error_title">AndroidManifest त्रुटी</string>
    <string name="com_facebook_like_button_liked">आवडलेले</string>
    <string name="com_facebook_like_button_not_liked">आवडले</string>
    <string name="com_facebook_loading">लोड होत आहे...</string>
    <string name="com_facebook_loginview_cancel_action">रद्द करा</string>
    <string name="com_facebook_loginview_log_in_button">लॉग इन करा</string>
    <string name="com_facebook_loginview_log_in_button_long">फेसबुकसह लॉग इन करा</string>
    <string name="com_facebook_loginview_log_out_action">लॉग आउट करा</string>
    <string name="com_facebook_loginview_log_out_button">लॉग आउट करा</string>
    <string name="com_facebook_loginview_logged_in_as">म्हणून लॉग इन केले: %1$s</string>
    <string name="com_facebook_loginview_logged_in_using_facebook">फेसबुक वापरून लॉग इन केले</string>
    <string name="com_facebook_send_button_text">पाठवा</string>
    <string name="com_facebook_share_button_text">सामायिक करा</string>
    <string name="com_facebook_tooltip_default">नवीन! आपण नियंत्रणात आहात - आपण कोणती माहिती अनुप्रयोगांसह शेअर करू इच्छिता ते निवडा.</string>
    <string name="messenger_send_button_text">पाठवा</string>
</resources>


<?php

namespace Drupal\Core\Entity;

use Symfony\Component\EventDispatcher\EventDispatcherInterface;

/**
 * Reacts to entity type CRUD on behalf of the Entity system.
 *
 * @see \Drupal\Core\Entity\EntityTypeEvents
 */
class EntityTypeListener implements EntityTypeListenerInterface {

  /**
   * The entity type manager.
   *
   * @var \Drupal\Core\Entity\EntityTypeManagerInterface
   */
  protected $entityTypeManager;

  /**
   * The entity field manager.
   *
   * @var \Drupal\Core\Entity\EntityFieldManagerInterface
   */
  protected $entityFieldManager;

  /**
   * The event dispatcher.
   *
   * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
   */
  protected $eventDispatcher;

  /**
   * The entity last installed schema repository.
   *
   * @var \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface
   */
  protected $entityLastInstalledSchemaRepository;

  /**
   * Constructs a new EntityTypeListener.
   *
   * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
   *   The entity type manager.
   * @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager
   *   The entity field manager.
   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
   *   The event dispatcher.
   * @param \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface $entity_last_installed_schema_repository
   *   The entity last installed schema repository.
   */
  public function __construct(EntityTypeManagerInterface $entity_type_manager, EntityFieldManagerInterface $entity_field_manager, EventDispatcherInterface $event_dispatcher, EntityLastInstalledSchemaRepositoryInterface $entity_last_installed_schema_repository) {
    $this->entityTypeManager = $entity_type_manager;
    $this->entityFieldManager = $entity_field_manager;
    $this->eventDispatcher = $event_dispatcher;
    $this->entityLastInstalledSchemaRepository = $entity_last_installed_schema_repository;
  }

  /**
   * {@inheritdoc}
   */
  public function onEntityTypeCreate(EntityTypeInterface $entity_type) {
    $entity_type_id = $entity_type->id();

    // @todo Forward this to all interested handlers, not only storage, once
    //   iterating handlers is possible: https://www.drupal.org/node/2332857.
    $storage = $this->entityTypeManager->getStorage($entity_type_id);
    if ($storage instanceof EntityTypeListenerInterface) {
      $storage->onEntityTypeCreate($entity_type);
    }

    $this->eventDispatcher->dispatch(EntityTypeEvents::CREATE, new EntityTypeEvent($entity_type));

    $this->entityLastInstalledSchemaRepository->setLastInstalledDefinition($entity_type);
    if ($entity_type->entityClassImplements(FieldableEntityInterface::class)) {
      $this->entityLastInstalledSchemaRepository->setLastInstalledFieldStorageDefinitions($entity_type_id, $this->entityFieldManager->getFieldStorageDefinitions($entity_type_id));
    }
  }

  /**
   * {@inheritdoc}
   */
  public function onEntityTypeUpdate(EntityTypeInterface $entity_type, EntityTypeInterface $original) {
    $entity_type_id = $entity_type->id();

    // @todo Forward this to all interested handlers, not only storage, once
    //   iterating handlers is possible: https://www.drupal.org/node/2332857.
    $storage = $this->entityTypeManager->getStorage($entity_type_id);
    if ($storage instanceof EntityTypeListenerInterface) {
      $storage->onEntityTypeUpdate($entity_type, $original);
    }

    $this->eventDispatcher->dispatch(EntityTypeEvents::UPDATE, new EntityTypeEvent($entity_type, $original));

    $this->entityLastInstalledSchemaRepository->setLastInstalledDefinition($entity_type);
  }

  /**
   * {@inheritdoc}
   */
  public function onEntityTypeDelete(EntityTypeInterface $entity_type) {
    $entity_type_id = $entity_type->id();

    // @todo Forward this to all interested handlers, not only storage, once
    //   iterating handlers is possible: https://www.drupal.org/node/2332857.
    $storage = $this->entityTypeManager->getStorage($entity_type_id);
    if ($storage instanceof EntityTypeListenerInterface) {
      $storage->onEntityTypeDelete($entity_type);
    }

    $this->eventDispatcher->dispatch(EntityTypeEvents::DELETE, new EntityTypeEvent($entity_type));

    $this->entityLastInstalledSchemaRepository->deleteLastInstalledDefinition($entity_type_id);
  }

}


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

using System.Device.Gpio;

namespace Iot.Device.Mcp23xxx
{
    /// <summary>
    /// Wraps 16-bit MCP I/O expanders.
    /// </summary>
    public abstract class Mcp23x1x : Mcp23xxx
    {
        /// <summary>
        /// Constructs Mcp23x1x instance
        /// </summary>
        /// <param name="device">I2C device used to communicate with the device</param>
        /// <param name="reset">Reset pin</param>
        /// <param name="interruptA">Interrupt A pin</param>
        /// <param name="interruptB">Interrupt B pin</param>
        /// <param name="masterController">
        /// <see cref="GpioController"/> related with
        /// <paramref name="reset"/> <paramref name="interruptA"/> and <paramref name="interruptB"/> pins
        /// </param>
        /// <param name="shouldDispose">True to dispose the Gpio Controller</param>
        protected Mcp23x1x(BusAdapter device, int reset, int interruptA, int interruptB, GpioController masterController, bool shouldDispose = true)
            : base(device, reset, interruptA, interruptB, masterController, shouldDispose: shouldDispose)
        {
        }

        /// <inheritdoc/>
        protected override int PinCount => 16;

        /// <summary>
        /// Read a byte from the given register on the given port.
        /// </summary>
        public byte ReadByte(Register register, Port port) => InternalReadByte(register, port);

        /// <summary>
        /// Write a byte to the given register on the given port.
        /// </summary>
        public void WriteByte(Register register, byte value, Port port) => InternalWriteByte(register, value, port);

        /// <summary>
        /// Read a ushort from the given register.
        /// </summary>
        public ushort ReadUInt16(Register register) => InternalReadUInt16(register);

        /// <summary>
        /// Write a ushort to the given register. Writes the value to both ports.
        /// </summary>
        public void WriteUInt16(Register register, ushort value) => InternalWriteUInt16(register, value);

        /// <summary>
        /// Reads the interrupt pin for the given port if configured.
        /// </summary>
        public PinValue ReadInterrupt(Port port) => InternalReadInterrupt(port);
    }
}


StartChar: q
Encoding: 113 113 16
Width: 1060
VWidth: -2
Flags: W
HStem: -8 152<286.542 475.008> 890 144<443.442 767.614>
VStem: 89 152<187.28 570.631> 622 165<-368.954 93.3045> 864 165<961 1004.22>
LayerCount: 2
Fore
SplineSet
266 514 m 0
 249 451 241 395 241 346 c 0
 241 218 295 144 373 144 c 0
 522 144 704 456 796 664 c 1
 834 804 l 1
 784 839 711 890 607 890 c 0
 416 890 337 774 266 514 c 0
1029 1002 m 1
 925 504 l 2
 906 407 818 101 796 -52 c 0
 790 -94 787 -134 787 -171 c 0
 787 -243 799 -307 823 -372 c 1
 667 -424 l 1
 637 -344 622 -251 622 -165 c 0
 622 -126 625 -89 631 -55 c 0
 659 105 705 198 716 262 c 1
 658 178 556 -8 344 -8 c 0
 189 -8 89 140 89 343 c 0
 89 394 95 448 108 504 c 0
 192 862 326 1034 627 1034 c 0
 753 1034 816 994 864 961 c 1
 869 984 872 1006 874 1026 c 1
 1029 1002 l 1
EndSplineSet
Validated: 1
EndChar


text = '''
The Zen of Python, by Tim Peters
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambxiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
'''
text=text.replace(',',' ').replace('.',' ').replace('--',' ').replace('!',' ').replace('*',' ')
word = []
counts = dict()

for i in text.split():
    word.append(i)
for j in word:
    if j in counts:
        counts[j] += 1
    else:
        counts[j] = 1
count=sorted(counts.items(),key=lambda x:x[1],reverse=True)
print(count)


<template>

      {{ title }}
      <nut-icon type="down" :class="direction"></nut-icon>

      <slot></slot>

</template>


#region License

// Copyright (c) 2013, ClearCanvas Inc.
// All rights reserved.
// http://www.clearcanvas.ca
//
// This file is part of the ClearCanvas RIS/PACS open source project.
//
// The ClearCanvas RIS/PACS open source project is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// The ClearCanvas RIS/PACS open source project is distributed in the hope that it
// will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
// Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// the ClearCanvas RIS/PACS open source project.  If not, see
// <http://www.gnu.org/licenses/>.

#endregion

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using ClearCanvas.Common;
using ClearCanvas.Common.Utilities;
using ClearCanvas.ImageServer.Enterprise;
using ClearCanvas.ImageServer.Model;
using ClearCanvas.ImageServer.Web.Application.Controls;
using ClearCanvas.ImageServer.Web.Common.Data;
using SR = Resources.SR;

namespace ClearCanvas.ImageServer.Web.Application.Pages.Queues.WorkQueue.Edit
{
    /// <summary>
    /// A dialog box that prompts users for confirmation to reset a work queue entry and carries out the reset if users do so.
    /// </summary>
    /// <remarks>
    /// To use this dialog, caller must indicate the <see cref="WorkQueue"/> entry through the <see cref="WorkQueueItemKey"/> property then
    /// call <see cref="Show"/> to display the dialog. Optionally, caller can register an event listener for <see cref="WorkQueueItemResetListener"/>
    /// which is fired when users confirmed to reset the entry and it was sucessfully reset.
    /// </remarks>
    public partial class ResetWorkQueueDialog : UserControl
    {
        private Model.WorkQueue _workQueue;

        #region Events

        #region Delegates

        public delegate void OnHideEventHandler();

        public delegate void OnShowEventHandler();

        public delegate void WorkQueueItemResetListener(Model.WorkQueue item);

        #endregion

        public new event EventHandler<WorkQueueItemResetErrorEventArgs> Error;

        public event WorkQueueItemResetListener WorkQueueItemReseted;

        public event OnShowEventHandler OnShow;

        public event OnHideEventHandler OnHide;

        #endregion Events

        #region Public Properties

        /// <summary>
        /// Sets / Gets the <see cref="ServerEntityKey"/> of the <see cref="WorkQueue"/> item associated with this dialog
        /// </summary>
        public ServerEntityKey WorkQueueItemKey
        {
            get { return ViewState["WorkQueueItemKey"] == null ? null : (ServerEntityKey) ViewState["WorkQueueItemKey"]; }
            set { ViewState["WorkQueueItemKey"] = value; }
        }

        public bool IsShown
        {
            get { return ViewState["IsShown"] != null && (bool) ViewState["IsShown"]; }
            set { ViewState["IsShown"] = value; }
        }

        #endregion Public Properties

        private Model.WorkQueue WorkQueue
        {
            get
            {
                if (_workQueue == null)
                {
                    if (WorkQueueItemKey != null)
                    {
                        var adaptor = new WorkQueueAdaptor();
                        _workQueue = adaptor.Get(WorkQueueItemKey);
                    }
                }

                return _workQueue;
            }
        }

        #region Protected Methods

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            PreResetConfirmDialog.Confirmed += PreResetConfirmDialog_Confirmed;
            PreResetConfirmDialog.Cancel += Hide;
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (Page.IsPostBack && IsShown)
            {
                DataBind();
            }
        }

        #endregion Protected Methods

        #region Private Methods

        private void PreResetConfirmDialog_Confirmed(object data)
        {
            Hide();

            var key = data as ServerEntityKey;

            if (key != null)
            {
                var adaptor = new WorkQueueAdaptor();
                Model.WorkQueue item = adaptor.Get(key);
                if (item == null)
                {
                    String errorMessage = SR.WorkQueueNotAvailable;
                    EventsHelper.Fire(Error, this, new WorkQueueItemResetErrorEventArgs(errorMessage, null));
                }
                else
                {
                    var controller = new WorkQueueController();
                    DateTime scheduledTime = item.ScheduledTime;
                    if (scheduledTime < Platform.Time)
                        scheduledTime = Platform.Time.AddSeconds(WorkQueueSettings.Default.WorkQueueProcessDelaySeconds);

	                DateTime expirationTime = item.ExpirationTime.GetValueOrDefault(Platform.Time.AddSeconds(WorkQueueSettings.Default.WorkQueueExpireDelaySeconds));
                    if (expirationTime < scheduledTime)
                        expirationTime = scheduledTime.AddSeconds(WorkQueueSettings.Default.WorkQueueExpireDelaySeconds);

                    try
                    {
                        var items = new List<Model.WorkQueue>();
                        items.Add(item);

                        controller.ResetWorkQueueItems(items, scheduledTime, expirationTime);

                        Platform.Log(LogLevel.Info, "{0} Work Queue item reset:  Key={1}.", item.WorkQueueTypeEnum,
                                     item.GetKey());
                        if (WorkQueueItemReseted != null)
                            WorkQueueItemReseted(item);

                        if (OnHide != null) OnHide();
                    }
                    catch (Exception e)
                    {
                        Platform.Log(LogLevel.Error, e, "Unable to reset {0} work queue item. Key={1}.",
                                     item.WorkQueueTypeEnum, item.GetKey());

                        String errorMessage = String.Format(SR.WorkQueueResetFailed, e.Message);

                        EventsHelper.Fire(Error, this, new WorkQueueItemResetErrorEventArgs(errorMessage, e));
                    }
                }
            }
        }

        #endregion Private Methods

        #region Public Methods

        public override void DataBind()
        {
            if (WorkQueue != null)
            {
                if (WorkQueue.WorkQueueStatusEnum == WorkQueueStatusEnum.InProgress)
                {
                    if (!String.IsNullOrEmpty(_workQueue.ProcessorID)) // somebody has claimed it
                    {
                        PreResetConfirmDialog.MessageType =
                            MessageBox.MessageTypeEnum.INFORMATION;
                        PreResetConfirmDialog.Message = SR.WorkQueueBeingProcessed;
                    }
                }
                else
                {
                    PreResetConfirmDialog.Data = WorkQueueItemKey;
                    PreResetConfirmDialog.MessageType =
                        MessageBox.MessageTypeEnum.YESNO;
                    PreResetConfirmDialog.Message = SR.WorkQueueResetConfirm;
                }
            }

            base.DataBind();
        }

        /// <summary>
        /// Displays the dialog box for reseting the <see cref="WorkQueue"/> entry.
        /// </summary>
        /// <remarks>
        /// The <see cref="WorkQueueItemKey"/> to be deleted must be set prior to calling <see cref="Show"/>.
        /// </remarks>
        public void Show()
        {
            IsShown = true;

            DataBind();

            if (OnShow != null) OnShow();
        }

        /// <summary>
        /// Closes the dialog box
        /// </summary>
        public void Hide()
        {
            IsShown = false;
            if (OnHide != null) OnHide();
        }

        protected override void OnPreRender(EventArgs e)
        {
            PreResetConfirmDialog.Close();
            if (IsShown)
            {
                if (WorkQueue != null)
                {
                    PreResetConfirmDialog.Show();
                }
            }
            base.OnPreRender(e);
        }

        #endregion Public Methods
    }

    public class WorkQueueItemResetErrorEventArgs : EventArgs
    {
        public WorkQueueItemResetErrorEventArgs(string error, Exception exception)
        {
            ErrorMessage = error;
            Exception = exception;
        }

        public string ErrorMessage { get; set; }

        public Exception Exception { get; set; }
    }
}


// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto

package urlfetch

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package

type URLFetchServiceError_ErrorCode int32

const (
	URLFetchServiceError_OK                       URLFetchServiceError_ErrorCode = 0
	URLFetchServiceError_INVALID_URL              URLFetchServiceError_ErrorCode = 1
	URLFetchServiceError_FETCH_ERROR              URLFetchServiceError_ErrorCode = 2
	URLFetchServiceError_UNSPECIFIED_ERROR        URLFetchServiceError_ErrorCode = 3
	URLFetchServiceError_RESPONSE_TOO_LARGE       URLFetchServiceError_ErrorCode = 4
	URLFetchServiceError_DEADLINE_EXCEEDED        URLFetchServiceError_ErrorCode = 5
	URLFetchServiceError_SSL_CERTIFICATE_ERROR    URLFetchServiceError_ErrorCode = 6
	URLFetchServiceError_DNS_ERROR                URLFetchServiceError_ErrorCode = 7
	URLFetchServiceError_CLOSED                   URLFetchServiceError_ErrorCode = 8
	URLFetchServiceError_INTERNAL_TRANSIENT_ERROR URLFetchServiceError_ErrorCode = 9
	URLFetchServiceError_TOO_MANY_REDIRECTS       URLFetchServiceError_ErrorCode = 10
	URLFetchServiceError_MALFORMED_REPLY          URLFetchServiceError_ErrorCode = 11
	URLFetchServiceError_CONNECTION_ERROR         URLFetchServiceError_ErrorCode = 12
)

var URLFetchServiceError_ErrorCode_name = map[int32]string{
	0:  "OK",
	1:  "INVALID_URL",
	2:  "FETCH_ERROR",
	3:  "UNSPECIFIED_ERROR",
	4:  "RESPONSE_TOO_LARGE",
	5:  "DEADLINE_EXCEEDED",
	6:  "SSL_CERTIFICATE_ERROR",
	7:  "DNS_ERROR",
	8:  "CLOSED",
	9:  "INTERNAL_TRANSIENT_ERROR",
	10: "TOO_MANY_REDIRECTS",
	11: "MALFORMED_REPLY",
	12: "CONNECTION_ERROR",
}
var URLFetchServiceError_ErrorCode_value = map[string]int32{
	"OK":                       0,
	"INVALID_URL":              1,
	"FETCH_ERROR":              2,
	"UNSPECIFIED_ERROR":        3,
	"RESPONSE_TOO_LARGE":       4,
	"DEADLINE_EXCEEDED":        5,
	"SSL_CERTIFICATE_ERROR":    6,
	"DNS_ERROR":                7,
	"CLOSED":                   8,
	"INTERNAL_TRANSIENT_ERROR": 9,
	"TOO_MANY_REDIRECTS":       10,
	"MALFORMED_REPLY":          11,
	"CONNECTION_ERROR":         12,
}

func (x URLFetchServiceError_ErrorCode) Enum() *URLFetchServiceError_ErrorCode {
	p := new(URLFetchServiceError_ErrorCode)
	*p = x
	return p
}
func (x URLFetchServiceError_ErrorCode) String() string {
	return proto.EnumName(URLFetchServiceError_ErrorCode_name, int32(x))
}
func (x *URLFetchServiceError_ErrorCode) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(URLFetchServiceError_ErrorCode_value, data, "URLFetchServiceError_ErrorCode")
	if err != nil {
		return err
	}
	*x = URLFetchServiceError_ErrorCode(value)
	return nil
}
func (URLFetchServiceError_ErrorCode) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{0, 0}
}

type URLFetchRequest_RequestMethod int32

const (
	URLFetchRequest_GET    URLFetchRequest_RequestMethod = 1
	URLFetchRequest_POST   URLFetchRequest_RequestMethod = 2
	URLFetchRequest_HEAD   URLFetchRequest_RequestMethod = 3
	URLFetchRequest_PUT    URLFetchRequest_RequestMethod = 4
	URLFetchRequest_DELETE URLFetchRequest_RequestMethod = 5
	URLFetchRequest_PATCH  URLFetchRequest_RequestMethod = 6
)

var URLFetchRequest_RequestMethod_name = map[int32]string{
	1: "GET",
	2: "POST",
	3: "HEAD",
	4: "PUT",
	5: "DELETE",
	6: "PATCH",
}
var URLFetchRequest_RequestMethod_value = map[string]int32{
	"GET":    1,
	"POST":   2,
	"HEAD":   3,
	"PUT":    4,
	"DELETE": 5,
	"PATCH":  6,
}

func (x URLFetchRequest_RequestMethod) Enum() *URLFetchRequest_RequestMethod {
	p := new(URLFetchRequest_RequestMethod)
	*p = x
	return p
}
func (x URLFetchRequest_RequestMethod) String() string {
	return proto.EnumName(URLFetchRequest_RequestMethod_name, int32(x))
}
func (x *URLFetchRequest_RequestMethod) UnmarshalJSON(data []byte) error {
	value, err := proto.UnmarshalJSONEnum(URLFetchRequest_RequestMethod_value, data, "URLFetchRequest_RequestMethod")
	if err != nil {
		return err
	}
	*x = URLFetchRequest_RequestMethod(value)
	return nil
}
func (URLFetchRequest_RequestMethod) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{1, 0}
}

type URLFetchServiceError struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *URLFetchServiceError) Reset()         { *m = URLFetchServiceError{} }
func (m *URLFetchServiceError) String() string { return proto.CompactTextString(m) }
func (*URLFetchServiceError) ProtoMessage()    {}
func (*URLFetchServiceError) Descriptor() ([]byte, []int) {
	return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{0}
}
func (m *URLFetchServiceError) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_URLFetchServiceError.Unmarshal(m, b)
}
func (m *URLFetchServiceError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_URLFetchServiceError.Marshal(b, m, deterministic)
}
func (dst *URLFetchServiceError) XXX_Merge(src proto.Message) {
	xxx_messageInfo_URLFetchServiceError.Merge(dst, src)
}
func (m *URLFetchServiceError) XXX_Size() int {
	return xxx_messageInfo_URLFetchServiceError.Size(m)
}
func (m *URLFetchServiceError) XXX_DiscardUnknown() {
	xxx_messageInfo_URLFetchServiceError.DiscardUnknown(m)
}

var xxx_messageInfo_URLFetchServiceError proto.InternalMessageInfo

type URLFetchRequest struct {
	Method                        *URLFetchRequest_RequestMethod `protobuf:"varint,1,req,name=Method,enum=appengine.URLFetchRequest_RequestMethod" json:"Method,omitempty"`
	Url                           *string                        `protobuf:"bytes,2,req,name=Url" json:"Url,omitempty"`
	Header                        []*URLFetchRequest_Header      `protobuf:"group,3,rep,name=Header,json=header" json:"header,omitempty"`
	Payload                       []byte                         `protobuf:"bytes,6,opt,name=Payload" json:"Payload,omitempty"`
	FollowRedirects               *bool                          `protobuf:"varint,7,opt,name=FollowRedirects,def=1" json:"FollowRedirects,omitempty"`
	Deadline                      *float64                       `protobuf:"fixed64,8,opt,name=Deadline" json:"Deadline,omitempty"`
	MustValidateServerCertificate *bool                          `protobuf:"varint,9,opt,name=MustValidateServerCertificate,def=1" json:"MustValidateServerCertificate,omitempty"`
	XXX_NoUnkeyedLiteral          struct{}                       `json:"-"`
	XXX_unrecognized              []byte                         `json:"-"`
	XXX_sizecache                 int32                          `json:"-"`
}

func (m *URLFetchRequest) Reset()         { *m = URLFetchRequest{} }
func (m *URLFetchRequest) String() string { return proto.CompactTextString(m) }
func (*URLFetchRequest) ProtoMessage()    {}
func (*URLFetchRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{1}
}
func (m *URLFetchRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_URLFetchRequest.Unmarshal(m, b)
}
func (m *URLFetchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_URLFetchRequest.Marshal(b, m, deterministic)
}
func (dst *URLFetchRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_URLFetchRequest.Merge(dst, src)
}
func (m *URLFetchRequest) XXX_Size() int {
	return xxx_messageInfo_URLFetchRequest.Size(m)
}
func (m *URLFetchRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_URLFetchRequest.DiscardUnknown(m)
}

var xxx_messageInfo_URLFetchRequest proto.InternalMessageInfo

const Default_URLFetchRequest_FollowRedirects bool = true
const Default_URLFetchRequest_MustValidateServerCertificate bool = true

func (m *URLFetchRequest) GetMethod() URLFetchRequest_RequestMethod {
	if m != nil && m.Method != nil {
		return *m.Method
	}
	return URLFetchRequest_GET
}

func (m *URLFetchRequest) GetUrl() string {
	if m != nil && m.Url != nil {
		return *m.Url
	}
	return ""
}

func (m *URLFetchRequest) GetHeader() []*URLFetchRequest_Header {
	if m != nil {
		return m.Header
	}
	return nil
}

func (m *URLFetchRequest) GetPayload() []byte {
	if m != nil {
		return m.Payload
	}
	return nil
}

func (m *URLFetchRequest) GetFollowRedirects() bool {
	if m != nil && m.FollowRedirects != nil {
		return *m.FollowRedirects
	}
	return Default_URLFetchRequest_FollowRedirects
}

func (m *URLFetchRequest) GetDeadline() float64 {
	if m != nil && m.Deadline != nil {
		return *m.Deadline
	}
	return 0
}

func (m *URLFetchRequest) GetMustValidateServerCertificate() bool {
	if m != nil && m.MustValidateServerCertificate != nil {
		return *m.MustValidateServerCertificate
	}
	return Default_URLFetchRequest_MustValidateServerCertificate
}

type URLFetchRequest_Header struct {
	Key                  *string  `protobuf:"bytes,4,req,name=Key" json:"Key,omitempty"`
	Value                *string  `protobuf:"bytes,5,req,name=Value" json:"Value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *URLFetchRequest_Header) Reset()         { *m = URLFetchRequest_Header{} }
func (m *URLFetchRequest_Header) String() string { return proto.CompactTextString(m) }
func (*URLFetchRequest_Header) ProtoMessage()    {}
func (*URLFetchRequest_Header) Descriptor() ([]byte, []int) {
	return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{1, 0}
}
func (m *URLFetchRequest_Header) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_URLFetchRequest_Header.Unmarshal(m, b)
}
func (m *URLFetchRequest_Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_URLFetchRequest_Header.Marshal(b, m, deterministic)
}
func (dst *URLFetchRequest_Header) XXX_Merge(src proto.Message) {
	xxx_messageInfo_URLFetchRequest_Header.Merge(dst, src)
}
func (m *URLFetchRequest_Header) XXX_Size() int {
	return xxx_messageInfo_URLFetchRequest_Header.Size(m)
}
func (m *URLFetchRequest_Header) XXX_DiscardUnknown() {
	xxx_messageInfo_URLFetchRequest_Header.DiscardUnknown(m)
}

var xxx_messageInfo_URLFetchRequest_Header proto.InternalMessageInfo

func (m *URLFetchRequest_Header) GetKey() string {
	if m != nil && m.Key != nil {
		return *m.Key
	}
	return ""
}

func (m *URLFetchRequest_Header) GetValue() string {
	if m != nil && m.Value != nil {
		return *m.Value
	}
	return ""
}

type URLFetchResponse struct {
	Content               []byte                     `protobuf:"bytes,1,opt,name=Content" json:"Content,omitempty"`
	StatusCode            *int32                     `protobuf:"varint,2,req,name=StatusCode" json:"StatusCode,omitempty"`
	Header                []*URLFetchResponse_Header `protobuf:"group,3,rep,name=Header,json=header" json:"header,omitempty"`
	ContentWasTruncated   *bool                      `protobuf:"varint,6,opt,name=ContentWasTruncated,def=0" json:"ContentWasTruncated,omitempty"`
	ExternalBytesSent     *int64                     `protobuf:"varint,7,opt,name=ExternalBytesSent" json:"ExternalBytesSent,omitempty"`
	ExternalBytesReceived *int64                     `protobuf:"varint,8,opt,name=ExternalBytesReceived" json:"ExternalBytesReceived,omitempty"`
	FinalUrl              *string                    `protobuf:"bytes,9,opt,name=FinalUrl" json:"FinalUrl,omitempty"`
	ApiCpuMilliseconds    *int64                     `protobuf:"varint,10,opt,name=ApiCpuMilliseconds,def=0" json:"ApiCpuMilliseconds,omitempty"`
	ApiBytesSent          *int64                     `protobuf:"varint,11,opt,name=ApiBytesSent,def=0" json:"ApiBytesSent,omitempty"`
	ApiBytesReceived      *int64                     `protobuf:"varint,12,opt,name=ApiBytesReceived,def=0" json:"ApiBytesReceived,omitempty"`
	XXX_NoUnkeyedLiteral  struct{}                   `json:"-"`
	XXX_unrecognized      []byte                     `json:"-"`
	XXX_sizecache         int32                      `json:"-"`
}

func (m *URLFetchResponse) Reset()         { *m = URLFetchResponse{} }
func (m *URLFetchResponse) String() string { return proto.CompactTextString(m) }
func (*URLFetchResponse) ProtoMessage()    {}
func (*URLFetchResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{2}
}
func (m *URLFetchResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_URLFetchResponse.Unmarshal(m, b)
}
func (m *URLFetchResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_URLFetchResponse.Marshal(b, m, deterministic)
}
func (dst *URLFetchResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_URLFetchResponse.Merge(dst, src)
}
func (m *URLFetchResponse) XXX_Size() int {
	return xxx_messageInfo_URLFetchResponse.Size(m)
}
func (m *URLFetchResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_URLFetchResponse.DiscardUnknown(m)
}

var xxx_messageInfo_URLFetchResponse proto.InternalMessageInfo

const Default_URLFetchResponse_ContentWasTruncated bool = false
const Default_URLFetchResponse_ApiCpuMilliseconds int64 = 0
const Default_URLFetchResponse_ApiBytesSent int64 = 0
const Default_URLFetchResponse_ApiBytesReceived int64 = 0

func (m *URLFetchResponse) GetContent() []byte {
	if m != nil {
		return m.Content
	}
	return nil
}

func (m *URLFetchResponse) GetStatusCode() int32 {
	if m != nil && m.StatusCode != nil {
		return *m.StatusCode
	}
	return 0
}

func (m *URLFetchResponse) GetHeader() []*URLFetchResponse_Header {
	if m != nil {
		return m.Header
	}
	return nil
}

func (m *URLFetchResponse) GetContentWasTruncated() bool {
	if m != nil && m.ContentWasTruncated != nil {
		return *m.ContentWasTruncated
	}
	return Default_URLFetchResponse_ContentWasTruncated
}

func (m *URLFetchResponse) GetExternalBytesSent() int64 {
	if m != nil && m.ExternalBytesSent != nil {
		return *m.ExternalBytesSent
	}
	return 0
}

func (m *URLFetchResponse) GetExternalBytesReceived() int64 {
	if m != nil && m.ExternalBytesReceived != nil {
		return *m.ExternalBytesReceived
	}
	return 0
}

func (m *URLFetchResponse) GetFinalUrl() string {
	if m != nil && m.FinalUrl != nil {
		return *m.FinalUrl
	}
	return ""
}

func (m *URLFetchResponse) GetApiCpuMilliseconds() int64 {
	if m != nil && m.ApiCpuMilliseconds != nil {
		return *m.ApiCpuMilliseconds
	}
	return Default_URLFetchResponse_ApiCpuMilliseconds
}

func (m *URLFetchResponse) GetApiBytesSent() int64 {
	if m != nil && m.ApiBytesSent != nil {
		return *m.ApiBytesSent
	}
	return Default_URLFetchResponse_ApiBytesSent
}

func (m *URLFetchResponse) GetApiBytesReceived() int64 {
	if m != nil && m.ApiBytesReceived != nil {
		return *m.ApiBytesReceived
	}
	return Default_URLFetchResponse_ApiBytesReceived
}

type URLFetchResponse_Header struct {
	Key                  *string  `protobuf:"bytes,4,req,name=Key" json:"Key,omitempty"`
	Value                *string  `protobuf:"bytes,5,req,name=Value" json:"Value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *URLFetchResponse_Header) Reset()         { *m = URLFetchResponse_Header{} }
func (m *URLFetchResponse_Header) String() string { return proto.CompactTextString(m) }
func (*URLFetchResponse_Header) ProtoMessage()    {}
func (*URLFetchResponse_Header) Descriptor() ([]byte, []int) {
	return fileDescriptor_urlfetch_service_b245a7065f33bced, []int{2, 0}
}
func (m *URLFetchResponse_Header) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_URLFetchResponse_Header.Unmarshal(m, b)
}
func (m *URLFetchResponse_Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_URLFetchResponse_Header.Marshal(b, m, deterministic)
}
func (dst *URLFetchResponse_Header) XXX_Merge(src proto.Message) {
	xxx_messageInfo_URLFetchResponse_Header.Merge(dst, src)
}
func (m *URLFetchResponse_Header) XXX_Size() int {
	return xxx_messageInfo_URLFetchResponse_Header.Size(m)
}
func (m *URLFetchResponse_Header) XXX_DiscardUnknown() {
	xxx_messageInfo_URLFetchResponse_Header.DiscardUnknown(m)
}

var xxx_messageInfo_URLFetchResponse_Header proto.InternalMessageInfo

func (m *URLFetchResponse_Header) GetKey() string {
	if m != nil && m.Key != nil {
		return *m.Key
	}
	return ""
}

func (m *URLFetchResponse_Header) GetValue() string {
	if m != nil && m.Value != nil {
		return *m.Value
	}
	return ""
}

func init() {
	proto.RegisterType((*URLFetchServiceError)(nil), "appengine.URLFetchServiceError")
	proto.RegisterType((*URLFetchRequest)(nil), "appengine.URLFetchRequest")
	proto.RegisterType((*URLFetchRequest_Header)(nil), "appengine.URLFetchRequest.Header")
	proto.RegisterType((*URLFetchResponse)(nil), "appengine.URLFetchResponse")
	proto.RegisterType((*URLFetchResponse_Header)(nil), "appengine.URLFetchResponse.Header")
}

func init() {
	proto.RegisterFile("google.golang.org/appengine/internal/urlfetch/urlfetch_service.proto", fileDescriptor_urlfetch_service_b245a7065f33bced)
}

var fileDescriptor_urlfetch_service_b245a7065f33bced = []byte{
	// 770 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xdd, 0x6e, 0xe3, 0x54,
	0x10, 0xc6, 0x76, 0x7e, 0xa7, 0x5d, 0x7a, 0x76, 0xb6, 0x45, 0x66, 0xb5, 0xa0, 0x10, 0x09, 0x29,
	0x17, 0x90, 0x2e, 0x2b, 0x24, 0x44, 0xaf, 0x70, 0xed, 0x93, 0xad, 0xa9, 0x63, 0x47, 0xc7, 0x4e,
	0x61, 0xb9, 0xb1, 0xac, 0x78, 0x9a, 0x5a, 0xb2, 0xec, 0x60, 0x9f, 0x2c, 0xf4, 0x35, 0x78, 0x0d,
	0xde, 0x87, 0xa7, 0xe1, 0x02, 0x9d, 0xc4, 0xc9, 0x6e, 0xbb, 0xd1, 0x4a, 0x5c, 0x65, 0xe6, 0x9b,
	0xef, 0xcc, 0x99, 0x7c, 0xdf, 0xf8, 0x80, 0xb3, 0x2c, 0xcb, 0x65, 0x4e, 0xe3, 0x65, 0x99, 0x27,
	0xc5, 0x72, 0x5c, 0x56, 0xcb, 0xf3, 0x64, 0xb5, 0xa2, 0x62, 0x99, 0x15, 0x74, 0x9e, 0x15, 0x92,
	0xaa, 0x22, 0xc9, 0xcf, 0xd7, 0x55, 0x7e, 0x4b, 0x72, 0x71, 0xb7, 0x0f, 0xe2, 0x9a, 0xaa, 0xb7,
	0xd9, 0x82, 0xc6, 0xab, 0xaa, 0x94, 0x25, 0xf6, 0xf7, 0x67, 0x86, 0x7f, 0xeb, 0x70, 0x3a, 0x17,
	0xde, 0x44, 0xb1, 0xc2, 0x2d, 0x89, 0x57, 0x55, 0x59, 0x0d, 0xff, 0xd2, 0xa1, 0xbf, 0x89, 0xec,
	0x32, 0x25, 0xec, 0x80, 0x1e, 0x5c, 0xb3, 0x4f, 0xf0, 0x04, 0x8e, 0x5c, 0xff, 0xc6, 0xf2, 0x5c,
	0x27, 0x9e, 0x0b, 0x8f, 0x69, 0x0a, 0x98, 0xf0, 0xc8, 0xbe, 0x8a, 0xb9, 0x10, 0x81, 0x60, 0x3a,
	0x9e, 0xc1, 0xd3, 0xb9, 0x1f, 0xce, 0xb8, 0xed, 0x4e, 0x5c, 0xee, 0x34, 0xb0, 0x81, 0x9f, 0x01,
	0x0a, 0x1e, 0xce, 0x02, 0x3f, 0xe4, 0x71, 0x14, 0x04, 0xb1, 0x67, 0x89, 0xd7, 0x9c, 0xb5, 0x14,
	0xdd, 0xe1, 0x96, 0xe3, 0xb9, 0x3e, 0x8f, 0xf9, 0xaf, 0x36, 0xe7, 0x0e, 0x77, 0x58, 0x1b, 0x3f,
	0x87, 0xb3, 0x30, 0xf4, 0x62, 0x9b, 0x8b, 0xc8, 0x9d, 0xb8, 0xb6, 0x15, 0xf1, 0xa6, 0x53, 0x07,
	0x9f, 0x40, 0xdf, 0xf1, 0xc3, 0x26, 0xed, 0x22, 0x40, 0xc7, 0xf6, 0x82, 0x90, 0x3b, 0xac, 0x87,
	0x2f, 0xc0, 0x74, 0xfd, 0x88, 0x0b, 0xdf, 0xf2, 0xe2, 0x48, 0x58, 0x7e, 0xe8, 0x72, 0x3f, 0x6a,
	0x98, 0x7d, 0x35, 0x82, 0xba, 0x79, 0x6a, 0xf9, 0x6f, 0x62, 0xc1, 0x1d, 0x57, 0x70, 0x3b, 0x0a,
	0x19, 0xe0, 0x33, 0x38, 0x99, 0x5a, 0xde, 0x24, 0x10, 0x53, 0xee, 0xc4, 0x82, 0xcf, 0xbc, 0x37,
	0xec, 0x08, 0x4f, 0x81, 0xd9, 0x81, 0xef, 0x73, 0x3b, 0x72, 0x03, 0xbf, 0x69, 0x71, 0x3c, 0xfc,
	0xc7, 0x80, 0x93, 0x9d, 0x5a, 0x82, 0x7e, 0x5f, 0x53, 0x2d, 0xf1, 0x27, 0xe8, 0x4c, 0x49, 0xde,
	0x95, 0xa9, 0xa9, 0x0d, 0xf4, 0xd1, 0xa7, 0xaf, 0x46, 0xe3, 0xbd, 0xba, 0xe3, 0x47, 0xdc, 0x71,
	0xf3, 0xbb, 0xe5, 0x8b, 0xe6, 0x1c, 0x32, 0x30, 0xe6, 0x55, 0x6e, 0xea, 0x03, 0x7d, 0xd4, 0x17,
	0x2a, 0xc4, 0x1f, 0xa1, 0x73, 0x47, 0x49, 0x4a, 0x95, 0x69, 0x0c, 0x8c, 0x11, 0xbc, 0xfa, 0xea,
	0x23, 0x3d, 0xaf, 0x36, 0x44, 0xd1, 0x1c, 0xc0, 0x17, 0xd0, 0x9d, 0x25, 0xf7, 0x79, 0x99, 0xa4,
	0x66, 0x67, 0xa0, 0x8d, 0x8e, 0x2f, 0xf5, 0x9e, 0x26, 0x76, 0x10, 0x8e, 0xe1, 0x64, 0x52, 0xe6,
	0x79, 0xf9, 0x87, 0xa0, 0x34, 0xab, 0x68, 0x21, 0x6b, 0xb3, 0x3b, 0xd0, 0x46, 0xbd, 0x8b, 0x96,
	0xac, 0xd6, 0x24, 0x1e, 0x17, 0xf1, 0x39, 0xf4, 0x1c, 0x4a, 0xd2, 0x3c, 0x2b, 0xc8, 0xec, 0x0d,
	0xb4, 0x91, 0x26, 0xf6, 0x39, 0xfe, 0x0c, 0x5f, 0x4c, 0xd7, 0xb5, 0xbc, 0x49, 0xf2, 0x2c, 0x4d,
	0x24, 0xa9, 0xed, 0xa1, 0xca, 0xa6, 0x4a, 0x66, 0xb7, 0xd9, 0x22, 0x91, 0x64, 0xf6, 0xdf, 0xeb,
	0xfc, 0x71, 0xea, 0xf3, 0x97, 0xd0, 0xd9, 0xfe, 0x0f, 0x25, 0xc6, 0x35, 0xdd, 0x9b, 0xad, 0xad,
	0x18, 0xd7, 0x74, 0x8f, 0xa7, 0xd0, 0xbe, 0x49, 0xf2, 0x35, 0x99, 0xed, 0x0d, 0xb6, 0x4d, 0x86,
	0x1e, 0x3c, 0x79, 0xa0, 0x26, 0x76, 0xc1, 0x78, 0xcd, 0x23, 0xa6, 0x61, 0x0f, 0x5a, 0xb3, 0x20,
	0x8c, 0x98, 0xae, 0xa2, 0x2b, 0x6e, 0x39, 0xcc, 0x50, 0xc5, 0xd9, 0x3c, 0x62, 0x2d, 0xb5, 0x2e,
	0x0e, 0xf7, 0x78, 0xc4, 0x59, 0x1b, 0xfb, 0xd0, 0x9e, 0x59, 0x91, 0x7d, 0xc5, 0x3a, 0xc3, 0x7f,
	0x0d, 0x60, 0xef, 0x84, 0xad, 0x57, 0x65, 0x51, 0x13, 0x9a, 0xd0, 0xb5, 0xcb, 0x42, 0x52, 0x21,
	0x4d, 0x4d, 0x49, 0x29, 0x76, 0x29, 0x7e, 0x09, 0x10, 0xca, 0x44, 0xae, 0x6b, 0xf5, 0x71, 0x6c,
	0x8c, 0x6b, 0x8b, 0xf7, 0x10, 0xbc, 0x78, 0xe4, 0xdf, 0xf0, 0xa0, 0x7f, 0xdb, 0x6b, 0x1e, 0x1b,
	0xf8, 0x03, 0x3c, 0x6b, 0xae, 0xf9, 0x25, 0xa9, 0xa3, 0x6a, 0x5d, 0x28, 0x81, 0xb6, 0x66, 0xf6,
	0x2e, 0xda, 0xb7, 0x49, 0x5e, 0x93, 0x38, 0xc4, 0xc0, 0x6f, 0xe0, 0x29, 0xff, 0x73, 0xfb, 0x02,
	0x5c, 0xde, 0x4b, 0xaa, 0x43, 0x35, 0xb8, 0x72, 0xd7, 0x10, 0x1f, 0x16, 0xf0, 0x7b, 0x38, 0x7b,
	0x00, 0x0a, 0x5a, 0x50, 0xf6, 0x96, 0xd2, 0x8d, 0xcd, 0x86, 0x38, 0x5c, 0x54, 0xfb, 0x30, 0xc9,
	0x8a, 0x24, 0x57, 0xfb, 0xaa, 0xec, 0xed, 0x8b, 0x7d, 0x8e, 0xdf, 0x01, 0x5a, 0xab, 0xcc, 0x5e,
	0xad, 0xa7, 0x59, 0x9e, 0x67, 0x35, 0x2d, 0xca, 0x22, 0xad, 0x4d, 0x50, 0xed, 0x2e, 0xb4, 0x97,
	0xe2, 0x40, 0x11, 0xbf, 0x86, 0x63, 0x6b, 0x95, 0xbd, 0x9b, 0xf6, 0x68, 0x47, 0x7e, 0x00, 0xe3,
	0xb7, 0xc0, 0x76, 0xf9, 0x7e, 0xcc, 0xe3, 0x1d, 0xf5, 0x83, 0xd2, 0xff, 0x5f, 0xa6, 0x4b, 0xf8,
	0xad, 0xb7, 0x7b, 0x2a, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x1d, 0x9f, 0x6d, 0x24, 0x63, 0x05,
	0x00, 0x00,
}


/** Automatically generated file. DO NOT MODIFY */
package com.haarman.listviewanimations;

public final class BuildConfig {
    public final static boolean DEBUG = true;
}


import module namespace ddl = "http://zorba.io/modules/store/static/collections/ddl";
import module namespace ns = "http://example.org/datamodule/" at "../collections.xqdata";

declare namespace ann = "http://zorba.io/annotations";

declare %ann:sequential function local:foo() {
  ddl:delete(xs:QName('ns:collection_333'));
  exit returning ();
};

local:foo()


//===-- NVPTXTargetMachine.cpp - Define TargetMachine for NVPTX -----------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Top-level implementation for the NVPTX target.
//
//===----------------------------------------------------------------------===//

#include "NVPTXTargetMachine.h"
#include "NVPTX.h"
#include "NVPTXAllocaHoisting.h"
#include "NVPTXLowerAggrCopies.h"
#include "NVPTXTargetObjectFile.h"
#include "NVPTXTargetTransformInfo.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Scalar/GVN.h"
#include "llvm/Transforms/Vectorize.h"
#include <cassert>
#include <string>

using namespace llvm;

// LSV is still relatively new; this switch lets us turn it off in case we
// encounter (or suspect) a bug.
static cl::opt<bool>
    DisableLoadStoreVectorizer("disable-nvptx-load-store-vectorizer",
                               cl::desc("Disable load/store vectorizer"),
                               cl::init(false), cl::Hidden);

namespace llvm {

void initializeNVVMIntrRangePass(PassRegistry&);
void initializeNVVMReflectPass(PassRegistry&);
void initializeGenericToNVVMPass(PassRegistry&);
void initializeNVPTXAllocaHoistingPass(PassRegistry &);
void initializeNVPTXAssignValidGlobalNamesPass(PassRegistry&);
void initializeNVPTXLowerAggrCopiesPass(PassRegistry &);
void initializeNVPTXLowerArgsPass(PassRegistry &);
void initializeNVPTXLowerAllocaPass(PassRegistry &);

} // end namespace llvm

extern "C" void LLVMInitializeNVPTXTarget() {
  // Register the target.
  RegisterTargetMachine<NVPTXTargetMachine32> X(getTheNVPTXTarget32());
  RegisterTargetMachine<NVPTXTargetMachine64> Y(getTheNVPTXTarget64());

  // FIXME: This pass is really intended to be invoked during IR optimization,
  // but it's very NVPTX-specific.
  PassRegistry &PR = *PassRegistry::getPassRegistry();
  initializeNVVMReflectPass(PR);
  initializeNVVMIntrRangePass(PR);
  initializeGenericToNVVMPass(PR);
  initializeNVPTXAllocaHoistingPass(PR);
  initializeNVPTXAssignValidGlobalNamesPass(PR);
  initializeNVPTXLowerArgsPass(PR);
  initializeNVPTXLowerAllocaPass(PR);
  initializeNVPTXLowerAggrCopiesPass(PR);
}

static std::string computeDataLayout(bool is64Bit) {
  std::string Ret = "e";

  if (!is64Bit)
    Ret += "-p:32:32";

  Ret += "-i64:64-i128:128-v16:16-v32:32-n16:32:64";

  return Ret;
}

static CodeModel::Model getEffectiveCodeModel(Optional<CodeModel::Model> CM) {
  if (CM)
    return *CM;
  return CodeModel::Small;
}

NVPTXTargetMachine::NVPTXTargetMachine(const Target &T, const Triple &TT,
                                       StringRef CPU, StringRef FS,
                                       const TargetOptions &Options,
                                       Optional<Reloc::Model> RM,
                                       Optional<CodeModel::Model> CM,
                                       CodeGenOpt::Level OL, bool is64bit)
    // The pic relocation model is used regardless of what the client has
    // specified, as it is the only relocation model currently supported.
    : LLVMTargetMachine(T, computeDataLayout(is64bit), TT, CPU, FS, Options,
                        Reloc::PIC_, getEffectiveCodeModel(CM), OL),
      is64bit(is64bit), TLOF(llvm::make_unique<NVPTXTargetObjectFile>()),
      Subtarget(TT, CPU, FS, *this) {
  if (TT.getOS() == Triple::NVCL)
    drvInterface = NVPTX::NVCL;
  else
    drvInterface = NVPTX::CUDA;
  initAsmInfo();
}

NVPTXTargetMachine::~NVPTXTargetMachine() = default;

void NVPTXTargetMachine32::anchor() {}

NVPTXTargetMachine32::NVPTXTargetMachine32(const Target &T, const Triple &TT,
                                           StringRef CPU, StringRef FS,
                                           const TargetOptions &Options,
                                           Optional<Reloc::Model> RM,
                                           Optional<CodeModel::Model> CM,
                                           CodeGenOpt::Level OL, bool JIT)
    : NVPTXTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false) {}

void NVPTXTargetMachine64::anchor() {}

NVPTXTargetMachine64::NVPTXTargetMachine64(const Target &T, const Triple &TT,
                                           StringRef CPU, StringRef FS,
                                           const TargetOptions &Options,
                                           Optional<Reloc::Model> RM,
                                           Optional<CodeModel::Model> CM,
                                           CodeGenOpt::Level OL, bool JIT)
    : NVPTXTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, true) {}

namespace {

class NVPTXPassConfig : public TargetPassConfig {
public:
  NVPTXPassConfig(NVPTXTargetMachine &TM, PassManagerBase &PM)
      : TargetPassConfig(TM, PM) {}

  NVPTXTargetMachine &getNVPTXTargetMachine() const {
    return getTM<NVPTXTargetMachine>();
  }

  void addIRPasses() override;
  bool addInstSelector() override;
  void addPostRegAlloc() override;
  void addMachineSSAOptimization() override;

  FunctionPass *createTargetRegisterAllocator(bool) override;
  void addFastRegAlloc(FunctionPass *RegAllocPass) override;
  void addOptimizedRegAlloc(FunctionPass *RegAllocPass) override;

private:
  // If the opt level is aggressive, add GVN; otherwise, add EarlyCSE. This
  // function is only called in opt mode.
  void addEarlyCSEOrGVNPass();

  // Add passes that propagate special memory spaces.
  void addAddressSpaceInferencePasses();

  // Add passes that perform straight-line scalar optimizations.
  void addStraightLineScalarOptimizationPasses();
};

} // end anonymous namespace

TargetPassConfig *NVPTXTargetMachine::createPassConfig(PassManagerBase &PM) {
  return new NVPTXPassConfig(*this, PM);
}

void NVPTXTargetMachine::adjustPassManager(PassManagerBuilder &Builder) {
  Builder.addExtension(
    PassManagerBuilder::EP_EarlyAsPossible,
    [&](const PassManagerBuilder &, legacy::PassManagerBase &PM) {
      PM.add(createNVVMReflectPass());
      PM.add(createNVVMIntrRangePass(Subtarget.getSmVersion()));
    });
}

TargetTransformInfo
NVPTXTargetMachine::getTargetTransformInfo(const Function &F) {
  return TargetTransformInfo(NVPTXTTIImpl(this, F));
}

void NVPTXPassConfig::addEarlyCSEOrGVNPass() {
  if (getOptLevel() == CodeGenOpt::Aggressive)
    addPass(createGVNPass());
  else
    addPass(createEarlyCSEPass());
}

void NVPTXPassConfig::addAddressSpaceInferencePasses() {
  // NVPTXLowerArgs emits alloca for byval parameters which can often
  // be eliminated by SROA.
  addPass(createSROAPass());
  addPass(createNVPTXLowerAllocaPass());
  addPass(createInferAddressSpacesPass());
}

void NVPTXPassConfig::addStraightLineScalarOptimizationPasses() {
  addPass(createSeparateConstOffsetFromGEPPass());
  addPass(createSpeculativeExecutionPass());
  // ReassociateGEPs exposes more opportunites for SLSR. See
  // the example in reassociate-geps-and-slsr.ll.
  addPass(createStraightLineStrengthReducePass());
  // SeparateConstOffsetFromGEP and SLSR creates common expressions which GVN or
  // EarlyCSE can reuse. GVN generates significantly better code than EarlyCSE
  // for some of our benchmarks.
  addEarlyCSEOrGVNPass();
  // Run NaryReassociate after EarlyCSE/GVN to be more effective.
  addPass(createNaryReassociatePass());
  // NaryReassociate on GEPs creates redundant common expressions, so run
  // EarlyCSE after it.
  addPass(createEarlyCSEPass());
}

void NVPTXPassConfig::addIRPasses() {
  // The following passes are known to not play well with virtual regs hanging
  // around after register allocation (which in our case, is *all* registers).
  // We explicitly disable them here.  We do, however, need some functionality
  // of the PrologEpilogCodeInserter pass, so we emulate that behavior in the
  // NVPTXPrologEpilog pass (see NVPTXPrologEpilogPass.cpp).
  disablePass(&PrologEpilogCodeInserterID);
  disablePass(&MachineCopyPropagationID);
  disablePass(&TailDuplicateID);
  disablePass(&StackMapLivenessID);
  disablePass(&LiveDebugValuesID);
  disablePass(&PostRASchedulerID);
  disablePass(&FuncletLayoutID);
  disablePass(&PatchableFunctionID);

  // NVVMReflectPass is added in addEarlyAsPossiblePasses, so hopefully running
  // it here does nothing.  But since we need it for correctness when lowering
  // to NVPTX, run it here too, in case whoever built our pass pipeline didn't
  // call addEarlyAsPossiblePasses.
  addPass(createNVVMReflectPass());

  if (getOptLevel() != CodeGenOpt::None)
    addPass(createNVPTXImageOptimizerPass());
  addPass(createNVPTXAssignValidGlobalNamesPass());
  addPass(createGenericToNVVMPass());

  // NVPTXLowerArgs is required for correctness and should be run right
  // before the address space inference passes.
  addPass(createNVPTXLowerArgsPass(&getNVPTXTargetMachine()));
  if (getOptLevel() != CodeGenOpt::None) {
    addAddressSpaceInferencePasses();
    if (!DisableLoadStoreVectorizer)
      addPass(createLoadStoreVectorizerPass());
    addStraightLineScalarOptimizationPasses();
  }

  // === LSR and other generic IR passes ===
  TargetPassConfig::addIRPasses();
  // EarlyCSE is not always strong enough to clean up what LSR produces. For
  // example, GVN can combine
  //
  //   %0 = add %a, %b
  //   %1 = add %b, %a
  //
  // and
  //
  //   %0 = shl nsw %a, 2
  //   %1 = shl %a, 2
  //
  // but EarlyCSE can do neither of them.
  if (getOptLevel() != CodeGenOpt::None)
    addEarlyCSEOrGVNPass();
}

bool NVPTXPassConfig::addInstSelector() {
  const NVPTXSubtarget &ST = *getTM<NVPTXTargetMachine>().getSubtargetImpl();

  addPass(createLowerAggrCopies());
  addPass(createAllocaHoisting());
  addPass(createNVPTXISelDag(getNVPTXTargetMachine(), getOptLevel()));

  if (!ST.hasImageHandles())
    addPass(createNVPTXReplaceImageHandlesPass());

  return false;
}

void NVPTXPassConfig::addPostRegAlloc() {
  addPass(createNVPTXPrologEpilogPass(), false);
  if (getOptLevel() != CodeGenOpt::None) {
    // NVPTXPrologEpilogPass calculates frame object offset and replace frame
    // index with VRFrame register. NVPTXPeephole need to be run after that and
    // will replace VRFrame with VRFrameLocal when possible.
    addPass(createNVPTXPeephole());
  }
}

FunctionPass *NVPTXPassConfig::createTargetRegisterAllocator(bool) {
  return nullptr; // No reg alloc
}

void NVPTXPassConfig::addFastRegAlloc(FunctionPass *RegAllocPass) {
  assert(!RegAllocPass && "NVPTX uses no regalloc!");
  addPass(&PHIEliminationID);
  addPass(&TwoAddressInstructionPassID);
}

void NVPTXPassConfig::addOptimizedRegAlloc(FunctionPass *RegAllocPass) {
  assert(!RegAllocPass && "NVPTX uses no regalloc!");

  addPass(&ProcessImplicitDefsID);
  addPass(&LiveVariablesID);
  addPass(&MachineLoopInfoID);
  addPass(&PHIEliminationID);

  addPass(&TwoAddressInstructionPassID);
  addPass(&RegisterCoalescerID);

  // PreRA instruction scheduling.
  if (addPass(&MachineSchedulerID))
    printAndVerify("After Machine Scheduling");

  addPass(&StackSlotColoringID);

  // FIXME: Needs physical registers
  //addPass(&PostRAMachineLICMID);

  printAndVerify("After StackSlotColoring");
}

void NVPTXPassConfig::addMachineSSAOptimization() {
  // Pre-ra tail duplication.
  if (addPass(&EarlyTailDuplicateID))
    printAndVerify("After Pre-RegAlloc TailDuplicate");

  // Optimize PHIs before DCE: removing dead PHI cycles may make more
  // instructions dead.
  addPass(&OptimizePHIsID);

  // This pass merges large allocas. StackSlotColoring is a different pass
  // which merges spill slots.
  addPass(&StackColoringID);

  // If the target requests it, assign local variables to stack slots relative
  // to one another and simplify frame index references where possible.
  addPass(&LocalStackSlotAllocationID);

  // With optimization, dead code should already be eliminated. However
  // there is one known exception: lowered code for arguments that are only
  // used by tail calls, where the tail calls reuse the incoming stack
  // arguments directly (see t11 in test/CodeGen/X86/sibcall.ll).
  addPass(&DeadMachineInstructionElimID);
  printAndVerify("After codegen DCE pass");

  // Allow targets to insert passes that improve instruction level parallelism,
  // like if-conversion. Such passes will typically need dominator trees and
  // loop info, just like LICM and CSE below.
  if (addILPOpts())
    printAndVerify("After ILP optimizations");

  addPass(&MachineLICMID);
  addPass(&MachineCSEID);

  addPass(&MachineSinkingID);
  printAndVerify("After Machine LICM, CSE and Sinking passes");

  addPass(&PeepholeOptimizerID);
  printAndVerify("After codegen peephole optimization pass");
}


<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (c) 2018 ThanksMister LLC
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software distributed
  ~ under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

    <item >

        <shape  android:shape="rectangle" >

            <corners android:radius="0dp" />

            <solid android:color="@color/blue_pressed" />

        </shape>

    </item>

    <item android:bottom="0dp" android:top="0dp" android:left="0dp" android:right="0dp">

        <shape  android:shape="rectangle">

            <corners android:radius="0dp" />

            <solid android:color="@color/blue_pressed" />

        </shape>

    </item>

</layer-list>


<!DOCTYPE html>

		<title>CHAR Function</title>
		<meta charset="utf-8" />
		<meta name="description" content="" />
		<link type="text/css" rel="stylesheet" href="../editor.css" />

                <input id="search" class="searchBar" placeholder="Search" type="text" onkeypress="doSearch(event)">

CHAR Function

The CHAR function is one of the text and data functions. Is used to return the ASCII character specified by a number.

The CHAR function syntax is:

CHAR(number)

where number (from 1 to 255) is a data entered manually or included into the cell you make reference to.

To apply the CHAR function,

select the cell where you wish to display the result,

click the Insert function  icon situated at the top toolbar,

or right-click within a selected cell and select the Insert Function option from the menu,

or click the  icon situated at the formula bar,

select the Text and data function group from the list,

click the CHAR function,

enter the required argument,

press the Enter button.

The result will be displayed in the selected cell.