text stringlengths 2 99k | meta dict |
|---|---|
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
/*
* Do not modify this file. This file is generated from the appconfig-2019-10-09.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Net;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.AppConfig.Model
{
/// <summary>
/// Container for the parameters to the GetDeployment operation.
/// Retrieve information about a configuration deployment.
/// </summary>
public partial class GetDeploymentRequest : AmazonAppConfigRequest
{
private string _applicationId;
private int? _deploymentNumber;
private string _environmentId;
/// <summary>
/// Gets and sets the property ApplicationId.
/// <para>
/// The ID of the application that includes the deployment you want to get.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string ApplicationId
{
get { return this._applicationId; }
set { this._applicationId = value; }
}
// Check to see if ApplicationId property is set
internal bool IsSetApplicationId()
{
return this._applicationId != null;
}
/// <summary>
/// Gets and sets the property DeploymentNumber.
/// <para>
/// The sequence number of the deployment.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public int DeploymentNumber
{
get { return this._deploymentNumber.GetValueOrDefault(); }
set { this._deploymentNumber = value; }
}
// Check to see if DeploymentNumber property is set
internal bool IsSetDeploymentNumber()
{
return this._deploymentNumber.HasValue;
}
/// <summary>
/// Gets and sets the property EnvironmentId.
/// <para>
/// The ID of the environment that includes the deployment you want to get.
/// </para>
/// </summary>
[AWSProperty(Required=true)]
public string EnvironmentId
{
get { return this._environmentId; }
set { this._environmentId = value; }
}
// Check to see if EnvironmentId property is set
internal bool IsSetEnvironmentId()
{
return this._environmentId != null;
}
}
} | {
"pile_set_name": "Github"
} |
---
title: <type>“”参数不能声明为“Optional”
ms.date: 07/20/2015
f1_keywords:
- bc33010
- vbc33010
helpviewer_keywords:
- BC33010
ms.assetid: ec4023e7-9ba6-4532-a6b9-4ae6b4f9063a
ms.openlocfilehash: 615279acae5db19a5f1f9a8974c52a753d3457e6
ms.sourcegitcommit: bf5c5850654187705bc94cc40ebfb62fe346ab02
ms.translationtype: MT
ms.contentlocale: zh-CN
ms.lasthandoff: 09/23/2020
ms.locfileid: "91062559"
---
# <a name="type-parameters-cannot-be-declared-optional"></a>\<type>“”参数不能声明为“Optional”
委托、事件或运算符的定义声明了 [Declare](../language-reference/modifiers/optional.md) 参数。
仅在`Optional` 、 `Declare`, `Function`, `Property`参数上允许 `Sub` 参数。
**错误 ID:** BC33010
## <a name="to-correct-this-error"></a>更正此错误
- 从参数列表中删除 `Optional` 关键字。
- 如果你正在定义一个运算符,则可能能够利用一系列重载实现 `Optional` 功能。
- 如果你正在定义委托或事件,则必须修改应用程序的这一部分的总逻辑。 不能对委托或事件参数使用 `Optional` 或 [ParamArray](../language-reference/modifiers/paramarray.md) 参数或重载版本。
## <a name="see-also"></a>请参阅
- [重载](../language-reference/modifiers/overloads.md)
- [运算符过程](../programming-guide/language-features/procedures/operator-procedures.md)
- [Operator Statement](../language-reference/statements/operator-statement.md)
| {
"pile_set_name": "Github"
} |
---
id: 382ee1a7
title: Networking Issues
description: Systems are currently down.
date: 2019-09-28T21:33:18.362Z
modified: 2019-09-28T23:33:18.362Z
severity: degraded-performance
resolved: true
affectedsystems:
- api
- cdn
---
Systems are currently down.
::: update Resolved | 2019-09-28T23:33:18.362Z
Our Files Conversion Process is responding slowly and we've investigating what is causing this issue.
:::
::: update Monitoring | 2019-09-28T22:33:18.362Z
Our Files Conversion System is not responding properly and we've investigating what is causing this issue. If you're affected by this issue, you can contact us at our [Support Page](https://statusfy.marquez.co).
:::
::: update Resolved | 2019-09-28T22:03:18.362Z
Our Files Conversion System is not responding properly and we've investigating what is causing this issue.
:::
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2006 W3C (R) (MIT ERCIM Keio), All Rights Reserved.
W3C liability, trademark and document use rules apply.
http://www.w3.org/Consortium/Legal/ipr-notice
http://www.w3.org/Consortium/Legal/copyright-documents
$Id: examples.xml,v 1.57 2008/02/20 16:41:48 pdowney Exp $
-->
<ex:echoSequenceAnyStrict xmlns:ex="http://www.w3.org/2002/ws/databinding/examples/6/09/">
<ex:sequenceAnyStrict xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl11="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap11enc="http://schemas.xmlsoap.org/soap/encoding/">
<ex:element1>string</ex:element1>
</ex:sequenceAnyStrict>
</ex:echoSequenceAnyStrict> | {
"pile_set_name": "Github"
} |
-----BEGIN PGP PRIVATE KEY BLOCK-----
Comment: GPGTools - https://gpgtools.org
lQOYBFnoT18BCAC60OTvCb8If9FnmhfrRnLOhC1awBVPekAeVpFqBgKjh8RDq8bb
39JuRA3UXDr89DJog7OuTzr8B4pIjnRdqTfhVoqGyjXjh5G5199jQ8gpwhr7qFTm
PUfJAZxiw/GGG5Zx4b33gvyVaxJFnWyxP4W82nxvrNkwbCnejzHxLZs/sApn1xz3
PUmTgdlzC0e6elWu2jWXQgUupYzw2VhnnIo/v0Se2An2ZWT36Q3drkR6XbpCBMJS
DJWTbyqsPIR20BiYLNEnKczBorTYP1O2pkw94g852193QIs4n+P9G4ulX1JwmbyV
6yZkbig7RjfBjFVByBwJCqq9GQzKSrWMxFQFABEBAAEAB/wJzNeVqp845OupUa4b
i5COQOTYM+dqSfF/Je9u7m3JAmBLZIGEG1PAsRVApK37gxv5257bcBCaFBMvBzoX
h78EtTODKqx1CTGd3DM909p2RlaACS6a/W/8nXcEv162OFBGHR+IEnkJpZpJyJ5h
FgIADD4m5ZxnK+VuZXirPEc+qfhzlKoTB1tkgVtIR6wOeAFvRLe+PaZmMyhd7PMa
9Wrrz3LwD9k9LXM6EoQCDZTwGFI24O1M/OCM7HuCkKtf40tIY+AxNSQc9Fqhnzj3
6MZcUgmEvoxlRnOrEY9862btqP/wvaG/Vq1Ly6OYwMvgv+l8vfPvxfrD7Usv0bGF
eu2pBADGPDZZ+u70HptP/+umwAyKe9a18r2pNThCU+g3kUV8g5EK80J+6iAhNG6m
IViZrBkemenyUEvClPZ0jLfXwz/aYgwzzOiBkIq7RsBn32eZafmqifPpHoegIAC4
2zZ93Z3ieQ2ynqp014ZWVqad29to1aDaMlNYUNuXI7b5iVwNrwQA8UDXSx/w7V6B
lRfDH0FP3gSJwKalq6jkY2cVF1Ae6xfj20n7AycsqYOb6Dbt8UVQM3g3GD3Bmmr1
xm0+PPeSY8OEzAixyCG4P2pW9zlBggxR/gU7hPRI236xJZYjULeHPOfK/1Hqa19D
5mpT5qB1CdxVq75yoMOBSTBEG/tU+osD/23S9negJyuTTML1GPalgWQ26+D4n+fs
is8UxsyQlyu/ncVA9T9riaiGAE4j3LRMF0HMDiQleoNhAx9uv+GCx3Kf4X1ZetRe
Gkvn94dA5VNbbOXtvtZrk7vflAbt3I4Z702c12eyTwSxEvCSFAyT1+uf4iImee33
mW/Rx/szXku6TGW0GlVzZXIgMyA8dXNlcjNAZXhhbXBsZS5jb20+iQFUBBMBCgA+
FiEEsyqWn3YKjtDW1nzadq7TCKLpcAEFAlnoT18CGwMFCQPCZwAFCwkIBwMFFQoJ
CAsFFgIDAQACHgECF4AACgkQdq7TCKLpcAGjQQf/StaNTrH2IbNSPym4eUkr/p0e
8iED0w0+gn1Z5YN+FZ8l5vhzrVvqWXL5B9UpxfgKja3ipR89Z95h4IUPjW5xsMkc
wd8AZ46axHSyPov872/3xf9RJvEYzPXUUTaB23RVp+xxunZUp4pJSOlrMonVHcPr
B2ufB8VKYNaYow6oXbxC7iUzoWYsKN4Oqtve2BYf0JpWXLAo6pVR9X+Dz+r6gaAi
EFvxPdJIVsb9JeR2NLLnDXmK1tvTpgp9dKZnWFBxBF1QQWnPxBsMaXkaXkcmKpmi
Wg+kn5nmDVbOazZJAqyKkkwFVOL4tCIJxDENPTXXTTsu1KevRKRKfCeC18zrPp0D
mARZ6E9fAQgAzCn7g8lIRlJk5Lrc0sKEueQNGn3MNxpZ6Xz/wTLc7KfWeTEzO/mK
KhfuSGqUBoESYM56AtD6HaKNWIt9EPxWbI5twe1BuOt7Kjic8QNB0gcOxqba76jz
pUcVr/z8Y4jShd03ayZm9bTWOTssW76abibv91A3109HRN9QkRCjcEaLDLSTrdBv
Cg8bgQ1XS7hZSYEZLNoa8myplf5TasuynOtGjkU4NvO62S6FhHW4flWx/dn7wCWq
HnKwSjCu4tvDdYC4WXpIwkHxFM5xsS3J5RW31qzYpHOoLq/z+Nbiqs5hXHwpgdtO
tdJ4EF+EuEDQQZuEsEfIAh8FU+4pvyLxFwARAQABAAf8CC8KoO65kfANkUmYPm6D
qXvltpEiVXcd8YkMK29hga78nuEE/7tx+Vv6NjbndhdIaE7+fwxnajaw2cLFoZ+r
yzAuYB6liscNqdSZHeQWiFe2FOptTjwEgDSIPwSyDT9XyPvkE8x3RhQYnjSsA4Vx
ZUb0SYKSqnPIFI+rCBWVp5Np/TC27KP61y3DTfMB5a0PeOgP/DbGLqtHejZkXT63
uv+FzidvPw8Zyeha6+FrUjFE5KxxJrvQ+utsqq4yMImArDkxkqkqN8EP1xH0o0PB
90Kv6qM+BUHiU3xXD1CDVYqVkfg1Lbe9Q7FhnQkTx/jxYZI8UncF4sGl2jNfRpFs
KQQA4jI+bGsJgwe/ik+OnuGWKCR5NcmBUR8P9vWnqnEfZQc7ep1ab514U+55SIoK
qB3OxGlwhNcRmokoHHzgh0PlSJ2xAY5DCcJQ4Ty6ZOoQJPiTl22Xklc7wHsZSv3u
dwPS3Cbket8GrPEmK2ldzRs5C06W52QKj4wyjm1LuGAMvl0EAOcQky6h5atJfNWI
laLPxw/q5hVzQSq+qGbcL23b2HM6Wg9oXe4RzGW/Ik0Izrw37jdayV82jc2isy5Y
xtxqd61yLzwFhCVH7fuovNxr3U4YMxPnwIbcrGXc15sUF2zp8DSQiNr7nXopX3q0
lRQvhiCAdGZEmrzqhND1hb8LaC4DA/9RaD8W/TZli9zPlhIp/ZsmefRNlUdf0w3y
wPMYrupZSWI3a4kqmf3uZNFcbT6+OP7u/mQTAfbNWq+MjL7k0SimRyYXXgZzsY6X
A4MHFS/kHFM56yOPYLbF2xNXLCr1M50wbR1geSPmZh6hu8wPQqLPMx9/BBMqdy5B
Y7nvhzxRjDaYiQE8BBgBCgAmFiEEsyqWn3YKjtDW1nzadq7TCKLpcAEFAlnoT18C
GwwFCQPCZwAACgkQdq7TCKLpcAEb5Af9Hw+GoxL7gt6lZQP717cnwF8ENEQV+ucY
4hiM5zcZTH6ZDAui8u976T2y1tLjV5K7wxR13dIyKEyaUP2DNwXXCKuj1FE/qq6n
xElyfYb1QZbaC3pTRM9zz03azO5UKlXrubu7IT2mn7HXhhMxJSLXLylK2b5Z8Bjb
rCthXKEI+IettPZ4OA1+aQSTYt021fBNeiGK09Ck8OKzunxaRhsuxZ1PrqaRoYz0
1rV0KYzUjAEP8UJ+oEfzy6jJviZcKua+ghTX6Ptvth6Ga6JwRBudLzw4zrZfq+D4
KvfzvylbdbM2iBdJljBORA0PGgBm/MLzx/slcVZKEN6quSrJuuY51Q==
=MWu4
-----END PGP PRIVATE KEY BLOCK-----
| {
"pile_set_name": "Github"
} |
# Capistrano::Magento2
[](https://badge.fury.io/rb/capistrano-magento2)
A Capistrano extension for Magento 2 deployments. Takes care of specific Magento 2 requirements and adds tasks specific to the Magento 2 application. Supports zero-down deployments based on differences in deployed `config.php` and db status as reported by Magento's `setup:db:status` CLI command. When themes and scopes have been dumped to `config.php` via `bin/magento app:config:dump scopes themes i18n` then zero-side-effect pipeline will be utilized such that no database nor cache backend configuration are available during the build process.
## Supported Magento Versions
The following describes minimum Magento versions supported by releases of this gem. Please use an earlier version to deploy older releases of Magento not supported by the most recent iterations of this gem.
* Version 0.9.x supports deployment of Magento 2.3.0 and later.
* Version 0.7.x supports deployment of Magento 2.1.1 and later.
## Installation
### Standalone Installation
$ gem install capistrano-magento2
### Using Bundler
1. Add the following to your project's `Gemfile`:
```ruby
source 'https://rubygems.org'
gem 'capistrano-magento2'
```
2. Execute the following:
$ bundle install
## Usage
1. Install Capistrano in your Magento project:
```shell
$ cd <project_root>
$ mkdir -p tools/cap
$ cd ./tools/cap
$ cap install
```
_Note: By default, Capistrano creates "staging" and "production" stages. If you want to define custom staging areas, you can do so using the "STAGES" option (e.g. `cap install STAGES=stage,prod`). Built-in notifications ([see below](#terminal-notifier-on-os-x)) confirm deploy action on both "production" and "prod" area names by default._
2. Update your project's `Capfile` to look like the following:
```ruby
# Load DSL and set up stages
require 'capistrano/setup'
# Load Magento deployment tasks
require 'capistrano/magento2/deploy'
require 'capistrano/magento2/pending'
# Load Git plugin
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git
# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
```
3. Configure Capistrano, per the [Capistrano Configuration](#capistrano-configuration) section below.
4. Configure your server(s), per the [Server Configuration](#server-configuration) section below.
5. Deploy Magento 2 to staging or production by running the following command in the `tools/cap` directory:
```shell
$ cap staging deploy
```
or
```shell
$ cap production deploy
```
## Default Configuration
### Capistrano Configuration
Before you can use Capistrano to deploy, you must configure the `config/deploy.rb` and `config/deploy/*.rb` files. This section will cover the basic details for configuring these files. Refer to the [Capistrano documentation](http://capistranorb.com/documentation/getting-started/preparing-your-application/#configure-your-server-addresses-in-the-generated-files) and [README](https://github.com/capistrano/capistrano/blob/master/README.md) for more details.
1. Configuring `config/deploy.rb`
Update the `:application` and `:repo_url` values in `config/deploy.rb`:
```ruby
# Something unique such as the website or company name
set :application, 'example'
# The repository that hosts the Magento 2 application (Magento should live in the root of the repo)
set :repo_url, 'git@github.com:acme/example-com.git'
```
2. Configuring `config/deploy/*.rb` files
Capistrano allows you to use server-based or role-based syntax. You can read through the comments in the file to learn more about each option. If you have a single application server then the server-based syntax is the simplest configuration option.
* Single application server
If your stage and production environments consist of a single application server, your configuration files should look something like this:
`config/deploy/production.rb`
```ruby
server 'www.example.com', user: 'www-data', roles: %w{app db web}
set :deploy_to, '/var/www/html'
set :branch, proc { `git rev-parse --abbrev-ref master`.chomp }
```
`config/deploy/staging.rb`
```ruby
server 'stage.example.com', user: 'www-data', roles: %w{app db web}
set :deploy_to, '/var/www/html'
set :branch, proc { `git rev-parse --abbrev-ref develop`.chomp }
```
* Multiple application servers
Refer to the "role-based syntax" comments in the `config/deploy/*.rb` files or to the [Capistrano documentation](http://capistranorb.com/documentation/getting-started/preparing-your-application/#configure-your-server-addresses-in-the-generated-files) for details on how to configure multiple application servers.
### Magento Deploy Settings
| setting | default | what it does
| ------------------------------ | -------- | ---
| `:magento_deploy_setup_role` | `:all` | Role from which primary host is chosen to run things like setup:upgrade on
| `:magento_deploy_cache_shared` | `true` | If true, cache operations are restricted to the primary node in setup role
| `:magento_deploy_languages` | `[]` | Array of languages passed to static content deploy routine
| `:magento_deploy_themes` | `[]` | Array of themes passed to static content deploy
| `:magento_deploy_jobs` | `nil` | Number of threads to use for static content deploy
| `:magento_deploy_composer` | `true` | Enables composer install behavior in the built-in deploy routine
| `:magento_deploy_production` | `true` | Enables production specific DI compilation and static content generation
| `:magento_deploy_no_dev` | `true` | Enables use of --no-dev flag on composer install
| `:magento_deploy_maintenance` | `true` | Enables use of maintenance mode while magento:setup:upgrade runs
| `:magento_deploy_confirm` | `[]` | Used to require confirmation of deployment to a set of capistrano stages
| `:magento_deploy_chmod_d` | `'2770'` | Default permissions applied to all directories in the release path
| `:magento_deploy_chmod_f` | `'0660'` | Default permissions applied to all non-executable files in the release path
| `:magento_deploy_chmod_x` | `['bin/magento']` | Default list of files in release path to set executable bit on
| `:magento_deploy_chcon_dirs` | `['var']` | Default list of directories on which to recursively set an SELinux context type
| `:magento_deploy_chcon_type` | `httpd_sys_rw_content_t` | Default SELinux context type to set on directories which should be writeable by application
| `:magento_deploy_strategy` | `nil` | Can be `quick`, `standard` or `compact`
#### Example Usage
Add a line similar to the following in `config/deploy.rb` to set a custom value on one of the above settings:
```ruby
set :magento_deploy_jobs, '$(nproc)'
set :magento_deploy_themes, ['Magento/backend', 'Magento/blank']
set :magento_deploy_languages, ['en_US', 'en_CA']
```
### Capistrano Built-Ins
For the sake of simplicity in new project setups `:linked_dirs` and `:linked_files` are pre-configured per the following.
```ruby
set :linked_files, [
'app/etc/env.php',
'var/.setup_cronjob_status',
'var/.update_cronjob_status'
]
set :linked_dirs, [
'pub/media',
'pub/sitemaps',
'var/backups',
'var/composer_home',
'var/importexport',
'var/import_history',
'var/log',
'var/session',
'var/tmp'
]
```
If you would like to customize the linked files or directories for your project, you can copy either one or both of the above arrays into the `config/deploy.rb` or `config/deploy/*.rb` files and tweak them to fit your project's needs. Alternatively, you can add a single linked dir (or file) using `append` like this:
```ruby
append :linked_dirs, 'path/to/link'
```
### Composer Auth Credentials
Magento 2's composer repository requires auth credentials to install. These can be set on target servers in a global composer `auth.json` file, the project's `composer.json` or by setting them in your deployment configuration using the following two settings:
```ruby
set :magento_auth_public_key, '<your_public_key_here>'
set :magento_auth_private_key, '<your_prviate_key_here>'
```
To obtain these credentials, reference the official documentation on DevDocs: [Get your authentication keys](http://devdocs.magento.com/guides/v2.0/install-gde/prereq/connect-auth.html)
**Caution:** When using these settings, the values will be logged to the `log/capistrano.log` file by SSHKit. They will not, however, be included in the general command output by default.
### Magento 2 Deploy Routine
A pre-built deploy routine is available out-of-the-box. This can be overriden on a per-project basis by including only the Magento 2 specific tasks and defining your own `deploy.rake` file under `lib/capistrano/tasks` in your projects Capistrano install location.
To see what process the built-in routine runs, take a look at the included rake file here: https://github.com/davidalger/capistrano-magento2/blob/master/lib/capistrano/tasks/deploy.rake
## Server Configuration
### Web Server Root Path
Before deploying with Capistrano, you must update each of your web servers to point to the `current` directory inside of the configured `:deploy_to` directory. For example: `/var/www/html/current/pub` Refer to the [Capistrano Structure](http://capistranorb.com/documentation/getting-started/structure/) to learn more about Capistrano's folder structure.
### PHP Opcache Reset
When doing atomic deployments with php-opcache installed on a server, the cache will reach a full state after which application performance will degrade as a result of the opcache not being able to do it's job. To work nicely with this, there is support included for automatically resetting the php-opcache after a release is published.
To use this, include `require 'capistrano/magento2/cachetool'` in your `Capfile` and make sure there is an `/etc/cachetool.yml` or `/var/www/html/.cachetool.yml` (assuming `:deploy_to` points at `/var/www/html`) file configured with contents like the following:
adapter: fastcgi
fastcgi: /var/run/php-fpm/www-data.sock
temp_dir: /dev/shm/cachetool
extensions: [ opcache ]
With this configuration in place, be sure cachetool ([available from here](http://gordalina.github.io/cachetool/)) has already been installed on the server and is available in `$PATH`.
Congratulations! You should now begin to see the pre-deployemnt opcache status information when running a deployment followed immediately be the `cachetool opcache:reset` command used to keep things humming nicely along.
## Magento Specific Tasks
All Magento 2 tasks used by the built-in `deploy.rake` file as well as some additional commands are implemented and exposed to the end-user for use directly via the cap tool. You can also see this list by running `cap -T` from your shell.
| cap command | what it does |
| ------------------------------------- | -------------------------------------------------- |
| magento:cache:clean | Clean Magento cache by types |
| magento:cache:disable | Disable Magento cache |
| magento:cache:enable | Enable Magento cache |
| magento:cache:flush | Flush Magento cache storage |
| magento:cache:status | Check Magento cache enabled status |
| magento:cache:varnish:ban | Add ban to Varnish for url(s) |
| magento:composer:install | Run composer install |
| magento:deploy:mode:production | Enables production mode |
| magento:deploy:mode:show | Displays current application mode |
| magento:indexer:info | Shows allowed indexers |
| magento:indexer:reindex | Reindex data by all indexers |
| magento:indexer:set-mode[mode,index] | Sets mode of all indexers |
| magento:indexer:show-mode[index] | Shows mode of all indexers |
| magento:indexer:status | Shows status of all indexers |
| magento:maintenance:allow-ips[ip] | Sets maintenance mode exempt IPs |
| magento:maintenance:disable | Disable maintenance mode |
| magento:maintenance:enable | Enable maintenance mode |
| magento:maintenance:status | Displays maintenance mode status |
| magento:setup:di:compile | Runs dependency injection compilation routine |
| magento:setup:permissions | Sets proper permissions on application |
| magento:setup:static-content:deploy | Deploys static view files |
| magento:setup:upgrade | Run the Magento upgrade process |
## Pending Changes Support
When the line `require 'capistrano/magento2/pending'` is included in your `Capfile` per the recommended configuration above, this gem will report changes pending deployment in an abbreviated git log style format. Here is an example:
```
00:00 deploy:pending:log
01 git fetch origin
✔ 01 dalger@localhost 1.241s
✔ 01 dalger@localhost 1.259s
Changes pending deployment on web1 (tags/2.1.2 -> 2.1):
f511288 Thu Feb 23 12:19:20 2017 -0600 David Alger (HEAD -> 2.1, tag: 2.1.4, origin/2.1) Magento 2.1.4
7fb219c Thu Feb 23 12:17:11 2017 -0600 David Alger (tag: 2.1.3) Magento 2.1.3
570c9b3 Thu Feb 23 12:12:43 2017 -0600 David Alger Updated capistrano configuration
No changes to deploy on web2 (from and to are the same: 2.1 -> 2.1)
```
When there are no changes due for deployment to any host, a warning requiring confirmation will be emitted by default:
```
No changes to deploy on web1 (from and to are the same: 2.1 -> 2.1)
No changes to deploy on web2 (from and to are the same: 2.1 -> 2.1)
Are you sure you want to continue? [y/n]
```
This confirmational warning can be disabled by including the following in your project's configuration:
```ruby
set :magento_deploy_pending_warn, false
```
### Pending Changes Configuration
| setting | what it does
| -------------------------------- | ----------
| `:magento_deploy_pending_role` | Role to check for pending changes on; defaults to `:all`
| `:magento_deploy_pending_warn` | Set this to `false` to disable confirmational warning on zero-change deployments
| `:magento_deploy_pending_format` | Can be used to set a custom change log format; refer to `defaults.rb` for example
### Pending Changes Tasks
| cap command | what it does |
| ------------------------------------- | -------------------------------------------------- |
| deploy:pending | Displays a summary of commits pending deployment |
Note: For more details including screenshots of what this functionality does, reference [this post](https://github.com/davidalger/capistrano-magento2/issues/58#issuecomment-282404477).
## Terminal Notifier on OS X
This gem includes an optional configuration file include which adds notification support via the [terminal-notifier](https://rubygems.org/gems/terminal-notifier) gem. To configure notifications, simply add the following line to your `Capfile`:
```ruby
require 'capistrano/magento2/notifier'
```
**Notice:** The `terminal-notifier` gem is currently macOS specific and thus can not be used on generic *nix environments. Because this gem has been known to cause ruby stability issues on certain non-macOS environments, it is not specified as a hard requirement in this gem's gemspec. When using this functionality, it is expected the gem either be already present on your working environment or be added to your project's `Gemfile`:
```ruby
gem 'terminal-notifier'
```
## Development
After checking out the repo, run `bundle install` to install dependencies. Make the necessary changes, then run `bundle exec rake install` to install a modified version of the gem on your local system.
To release a new version, update the version number in `capistrano/magento2/version.rb`, merge all changes to master, and then run `bundle exec rake release`. This will create a git tag for the version (the tag will apply to the current HEAD), push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
_Note: Releasing a new version of the gem is only possible for those with maintainer access to the gem on rubygems.org._
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/davidalger/capistrano-magento2.
## License
This project is licensed under the Open Software License 3.0 (OSL-3.0). See included LICENSE file for full text of OSL-3.0.
| {
"pile_set_name": "Github"
} |
PATH_PREFIX:=..
include ../common.mk
HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.headers_built
HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_headers_installed
define Host/Compile
endef
define Host/Install
PATH='$(TARGET_PATH)' $(MAKE) -C $(HOST_BUILD_DIR) \
PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \
DEVEL_PREFIX=/ \
RUNTIME_PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \
HOSTCC="$(HOSTCC)" \
CC="$(TARGET_CC)" \
CPU_CFLAGS="$(TARGET_CFLAGS)" \
ARCH="$(CONFIG_ARCH)" \
pregen \
install_headers
$(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/
endef
$(eval $(call HostBuild))
| {
"pile_set_name": "Github"
} |
var path = require('path')
, tcase = require('t-case')
, i = require('i')();
/**
* Returns the template path for a specific seed
*
* @param {Object} project Object returned from util.locations.get()
* @param {String} name Name of the seed
* @return {String} Path to the template
* @api public
*/
exports.getTemplatePath = function(project, name) {
return path.resolve([ __dirname, '..', '..', 'templates', project.name ].concat(name).join(path.sep));
};
/**
* Returns module's path
*
* @param {Object} project Object returned from util.locations.get()
* @param {String} name Name of the module
* @return {String} Path to the module
* @api public
*/
exports.getModulePath = function(project, name) {
var n = name.split(path.sep)
, moduleName = n.splice(-1)[ 0 ]
, proj = project.useCWD === true ? process.cwd() : path.join(project.moduleDir, project.modulePath);
return path.resolve([ proj ].concat(n.length > 0 ? n.join(path.sep) : [ ], moduleName).join(path.sep));
};
/**
* Returns the correct filename from templates
*
* @param {String} templateName Template's file name
* @param {String} name Module's name
* @return {String} New file name
* @api public
*/
exports.fileName = function(templateName, name) {
name = templateName
.replace('Template', tcase.classCase(i.singularize(name)))
.replace('template', tcase.classCase(i.singularize(name)));
return name;
};
| {
"pile_set_name": "Github"
} |
/* Texas Instruments Triple 8-/10-BIT 165-/110-MSPS Video and Graphics
* Digitizer with Horizontal PLL registers
*
* Copyright (C) 2009 Texas Instruments Inc
* Author: Santiago Nunez-Corrales <santiago.nunez@ridgerun.com>
*
* This code is partially based upon the TVP5150 driver
* written by Mauro Carvalho Chehab (mchehab@infradead.org),
* the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com>
* and the TVP7002 driver in the TI LSP 2.10.00.14. Revisions by
* Muralidharan Karicheri and Snehaprabha Narnakaje (TI).
*
* This program 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 2 of the License, or
* (at your option) any later version.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/videodev2.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/v4l2-dv-timings.h>
#include <media/tvp7002.h>
#include <media/v4l2-async.h>
#include <media/v4l2-device.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-of.h>
#include "tvp7002_reg.h"
MODULE_DESCRIPTION("TI TVP7002 Video and Graphics Digitizer driver");
MODULE_AUTHOR("Santiago Nunez-Corrales <santiago.nunez@ridgerun.com>");
MODULE_LICENSE("GPL");
/* I2C retry attempts */
#define I2C_RETRY_COUNT (5)
/* End of registers */
#define TVP7002_EOR 0x5c
/* Read write definition for registers */
#define TVP7002_READ 0
#define TVP7002_WRITE 1
#define TVP7002_RESERVED 2
/* Interlaced vs progressive mask and shift */
#define TVP7002_IP_SHIFT 5
#define TVP7002_INPR_MASK (0x01 << TVP7002_IP_SHIFT)
/* Shift for CPL and LPF registers */
#define TVP7002_CL_SHIFT 8
#define TVP7002_CL_MASK 0x0f
/* Debug functions */
static bool debug;
module_param(debug, bool, 0644);
MODULE_PARM_DESC(debug, "Debug level (0-2)");
/* Structure for register values */
struct i2c_reg_value {
u8 reg;
u8 value;
u8 type;
};
/*
* Register default values (according to tvp7002 datasheet)
* In the case of read-only registers, the value (0xff) is
* never written. R/W functionality is controlled by the
* writable bit in the register struct definition.
*/
static const struct i2c_reg_value tvp7002_init_default[] = {
{ TVP7002_CHIP_REV, 0xff, TVP7002_READ },
{ TVP7002_HPLL_FDBK_DIV_MSBS, 0x67, TVP7002_WRITE },
{ TVP7002_HPLL_FDBK_DIV_LSBS, 0x20, TVP7002_WRITE },
{ TVP7002_HPLL_CRTL, 0xa0, TVP7002_WRITE },
{ TVP7002_HPLL_PHASE_SEL, 0x80, TVP7002_WRITE },
{ TVP7002_CLAMP_START, 0x32, TVP7002_WRITE },
{ TVP7002_CLAMP_W, 0x20, TVP7002_WRITE },
{ TVP7002_HSYNC_OUT_W, 0x60, TVP7002_WRITE },
{ TVP7002_B_FINE_GAIN, 0x00, TVP7002_WRITE },
{ TVP7002_G_FINE_GAIN, 0x00, TVP7002_WRITE },
{ TVP7002_R_FINE_GAIN, 0x00, TVP7002_WRITE },
{ TVP7002_B_FINE_OFF_MSBS, 0x80, TVP7002_WRITE },
{ TVP7002_G_FINE_OFF_MSBS, 0x80, TVP7002_WRITE },
{ TVP7002_R_FINE_OFF_MSBS, 0x80, TVP7002_WRITE },
{ TVP7002_SYNC_CTL_1, 0x20, TVP7002_WRITE },
{ TVP7002_HPLL_AND_CLAMP_CTL, 0x2e, TVP7002_WRITE },
{ TVP7002_SYNC_ON_G_THRS, 0x5d, TVP7002_WRITE },
{ TVP7002_SYNC_SEPARATOR_THRS, 0x47, TVP7002_WRITE },
{ TVP7002_HPLL_PRE_COAST, 0x00, TVP7002_WRITE },
{ TVP7002_HPLL_POST_COAST, 0x00, TVP7002_WRITE },
{ TVP7002_SYNC_DETECT_STAT, 0xff, TVP7002_READ },
{ TVP7002_OUT_FORMATTER, 0x47, TVP7002_WRITE },
{ TVP7002_MISC_CTL_1, 0x01, TVP7002_WRITE },
{ TVP7002_MISC_CTL_2, 0x00, TVP7002_WRITE },
{ TVP7002_MISC_CTL_3, 0x01, TVP7002_WRITE },
{ TVP7002_IN_MUX_SEL_1, 0x00, TVP7002_WRITE },
{ TVP7002_IN_MUX_SEL_2, 0x67, TVP7002_WRITE },
{ TVP7002_B_AND_G_COARSE_GAIN, 0x77, TVP7002_WRITE },
{ TVP7002_R_COARSE_GAIN, 0x07, TVP7002_WRITE },
{ TVP7002_FINE_OFF_LSBS, 0x00, TVP7002_WRITE },
{ TVP7002_B_COARSE_OFF, 0x10, TVP7002_WRITE },
{ TVP7002_G_COARSE_OFF, 0x10, TVP7002_WRITE },
{ TVP7002_R_COARSE_OFF, 0x10, TVP7002_WRITE },
{ TVP7002_HSOUT_OUT_START, 0x08, TVP7002_WRITE },
{ TVP7002_MISC_CTL_4, 0x00, TVP7002_WRITE },
{ TVP7002_B_DGTL_ALC_OUT_LSBS, 0xff, TVP7002_READ },
{ TVP7002_G_DGTL_ALC_OUT_LSBS, 0xff, TVP7002_READ },
{ TVP7002_R_DGTL_ALC_OUT_LSBS, 0xff, TVP7002_READ },
{ TVP7002_AUTO_LVL_CTL_ENABLE, 0x80, TVP7002_WRITE },
{ TVP7002_DGTL_ALC_OUT_MSBS, 0xff, TVP7002_READ },
{ TVP7002_AUTO_LVL_CTL_FILTER, 0x53, TVP7002_WRITE },
{ 0x29, 0x08, TVP7002_RESERVED },
{ TVP7002_FINE_CLAMP_CTL, 0x07, TVP7002_WRITE },
/* PWR_CTL is controlled only by the probe and reset functions */
{ TVP7002_PWR_CTL, 0x00, TVP7002_RESERVED },
{ TVP7002_ADC_SETUP, 0x50, TVP7002_WRITE },
{ TVP7002_COARSE_CLAMP_CTL, 0x00, TVP7002_WRITE },
{ TVP7002_SOG_CLAMP, 0x80, TVP7002_WRITE },
{ TVP7002_RGB_COARSE_CLAMP_CTL, 0x8c, TVP7002_WRITE },
{ TVP7002_SOG_COARSE_CLAMP_CTL, 0x04, TVP7002_WRITE },
{ TVP7002_ALC_PLACEMENT, 0x5a, TVP7002_WRITE },
{ 0x32, 0x18, TVP7002_RESERVED },
{ 0x33, 0x60, TVP7002_RESERVED },
{ TVP7002_MVIS_STRIPPER_W, 0xff, TVP7002_RESERVED },
{ TVP7002_VSYNC_ALGN, 0x10, TVP7002_WRITE },
{ TVP7002_SYNC_BYPASS, 0x00, TVP7002_WRITE },
{ TVP7002_L_FRAME_STAT_LSBS, 0xff, TVP7002_READ },
{ TVP7002_L_FRAME_STAT_MSBS, 0xff, TVP7002_READ },
{ TVP7002_CLK_L_STAT_LSBS, 0xff, TVP7002_READ },
{ TVP7002_CLK_L_STAT_MSBS, 0xff, TVP7002_READ },
{ TVP7002_HSYNC_W, 0xff, TVP7002_READ },
{ TVP7002_VSYNC_W, 0xff, TVP7002_READ },
{ TVP7002_L_LENGTH_TOL, 0x03, TVP7002_WRITE },
{ 0x3e, 0x60, TVP7002_RESERVED },
{ TVP7002_VIDEO_BWTH_CTL, 0x01, TVP7002_WRITE },
{ TVP7002_AVID_START_PIXEL_LSBS, 0x01, TVP7002_WRITE },
{ TVP7002_AVID_START_PIXEL_MSBS, 0x2c, TVP7002_WRITE },
{ TVP7002_AVID_STOP_PIXEL_LSBS, 0x06, TVP7002_WRITE },
{ TVP7002_AVID_STOP_PIXEL_MSBS, 0x2c, TVP7002_WRITE },
{ TVP7002_VBLK_F_0_START_L_OFF, 0x05, TVP7002_WRITE },
{ TVP7002_VBLK_F_1_START_L_OFF, 0x00, TVP7002_WRITE },
{ TVP7002_VBLK_F_0_DURATION, 0x1e, TVP7002_WRITE },
{ TVP7002_VBLK_F_1_DURATION, 0x00, TVP7002_WRITE },
{ TVP7002_FBIT_F_0_START_L_OFF, 0x00, TVP7002_WRITE },
{ TVP7002_FBIT_F_1_START_L_OFF, 0x00, TVP7002_WRITE },
{ TVP7002_YUV_Y_G_COEF_LSBS, 0xe3, TVP7002_WRITE },
{ TVP7002_YUV_Y_G_COEF_MSBS, 0x16, TVP7002_WRITE },
{ TVP7002_YUV_Y_B_COEF_LSBS, 0x4f, TVP7002_WRITE },
{ TVP7002_YUV_Y_B_COEF_MSBS, 0x02, TVP7002_WRITE },
{ TVP7002_YUV_Y_R_COEF_LSBS, 0xce, TVP7002_WRITE },
{ TVP7002_YUV_Y_R_COEF_MSBS, 0x06, TVP7002_WRITE },
{ TVP7002_YUV_U_G_COEF_LSBS, 0xab, TVP7002_WRITE },
{ TVP7002_YUV_U_G_COEF_MSBS, 0xf3, TVP7002_WRITE },
{ TVP7002_YUV_U_B_COEF_LSBS, 0x00, TVP7002_WRITE },
{ TVP7002_YUV_U_B_COEF_MSBS, 0x10, TVP7002_WRITE },
{ TVP7002_YUV_U_R_COEF_LSBS, 0x55, TVP7002_WRITE },
{ TVP7002_YUV_U_R_COEF_MSBS, 0xfc, TVP7002_WRITE },
{ TVP7002_YUV_V_G_COEF_LSBS, 0x78, TVP7002_WRITE },
{ TVP7002_YUV_V_G_COEF_MSBS, 0xf1, TVP7002_WRITE },
{ TVP7002_YUV_V_B_COEF_LSBS, 0x88, TVP7002_WRITE },
{ TVP7002_YUV_V_B_COEF_MSBS, 0xfe, TVP7002_WRITE },
{ TVP7002_YUV_V_R_COEF_LSBS, 0x00, TVP7002_WRITE },
{ TVP7002_YUV_V_R_COEF_MSBS, 0x10, TVP7002_WRITE },
/* This signals end of register values */
{ TVP7002_EOR, 0xff, TVP7002_RESERVED }
};
/* Register parameters for 480P */
static const struct i2c_reg_value tvp7002_parms_480P[] = {
{ TVP7002_HPLL_FDBK_DIV_MSBS, 0x35, TVP7002_WRITE },
{ TVP7002_HPLL_FDBK_DIV_LSBS, 0xa0, TVP7002_WRITE },
{ TVP7002_HPLL_CRTL, 0x02, TVP7002_WRITE },
{ TVP7002_AVID_START_PIXEL_LSBS, 0x91, TVP7002_WRITE },
{ TVP7002_AVID_START_PIXEL_MSBS, 0x00, TVP7002_WRITE },
{ TVP7002_AVID_STOP_PIXEL_LSBS, 0x0B, TVP7002_WRITE },
{ TVP7002_AVID_STOP_PIXEL_MSBS, 0x00, TVP7002_WRITE },
{ TVP7002_VBLK_F_0_START_L_OFF, 0x03, TVP7002_WRITE },
{ TVP7002_VBLK_F_1_START_L_OFF, 0x01, TVP7002_WRITE },
{ TVP7002_VBLK_F_0_DURATION, 0x13, TVP7002_WRITE },
{ TVP7002_VBLK_F_1_DURATION, 0x13, TVP7002_WRITE },
{ TVP7002_ALC_PLACEMENT, 0x18, TVP7002_WRITE },
{ TVP7002_CLAMP_START, 0x06, TVP7002_WRITE },
{ TVP7002_CLAMP_W, 0x10, TVP7002_WRITE },
{ TVP7002_HPLL_PRE_COAST, 0x03, TVP7002_WRITE },
{ TVP7002_HPLL_POST_COAST, 0x03, TVP7002_WRITE },
{ TVP7002_EOR, 0xff, TVP7002_RESERVED }
};
/* Register parameters for 576P */
static const struct i2c_reg_value tvp7002_parms_576P[] = {
{ TVP7002_HPLL_FDBK_DIV_MSBS, 0x36, TVP7002_WRITE },
{ TVP7002_HPLL_FDBK_DIV_LSBS, 0x00, TVP7002_WRITE },
{ TVP7002_HPLL_CRTL, 0x18, TVP7002_WRITE },
{ TVP7002_AVID_START_PIXEL_LSBS, 0x9B, TVP7002_WRITE },
{ TVP7002_AVID_START_PIXEL_MSBS, 0x00, TVP7002_WRITE },
{ TVP7002_AVID_STOP_PIXEL_LSBS, 0x0F, TVP7002_WRITE },
{ TVP7002_AVID_STOP_PIXEL_MSBS, 0x00, TVP7002_WRITE },
{ TVP7002_VBLK_F_0_START_L_OFF, 0x00, TVP7002_WRITE },
{ TVP7002_VBLK_F_1_START_L_OFF, 0x00, TVP7002_WRITE },
{ TVP7002_VBLK_F_0_DURATION, 0x2D, TVP7002_WRITE },
{ TVP7002_VBLK_F_1_DURATION, 0x00, TVP7002_WRITE },
{ TVP7002_ALC_PLACEMENT, 0x18, TVP7002_WRITE },
{ TVP7002_CLAMP_START, 0x06, TVP7002_WRITE },
{ TVP7002_CLAMP_W, 0x10, TVP7002_WRITE },
{ TVP7002_HPLL_PRE_COAST, 0x03, TVP7002_WRITE },
{ TVP7002_HPLL_POST_COAST, 0x03, TVP7002_WRITE },
{ TVP7002_EOR, 0xff, TVP7002_RESERVED }
};
/* Register parameters for 1080I60 */
static const struct i2c_reg_value tvp7002_parms_1080I60[] = {
{ TVP7002_HPLL_FDBK_DIV_MSBS, 0x89, TVP7002_WRITE },
{ TVP7002_HPLL_FDBK_DIV_LSBS, 0x80, TVP7002_WRITE },
{ TVP7002_HPLL_CRTL, 0x98, TVP7002_WRITE },
{ TVP7002_AVID_START_PIXEL_LSBS, 0x06, TVP7002_WRITE },
{ TVP7002_AVID_START_PIXEL_MSBS, 0x01, TVP7002_WRITE },
{ TVP7002_AVID_STOP_PIXEL_LSBS, 0x8a, TVP7002_WRITE },
{ TVP7002_AVID_STOP_PIXEL_MSBS, 0x08, TVP7002_WRITE },
{ TVP7002_VBLK_F_0_START_L_OFF, 0x02, TVP7002_WRITE },
{ TVP7002_VBLK_F_1_START_L_OFF, 0x02, TVP7002_WRITE },
{ TVP7002_VBLK_F_0_DURATION, 0x16, TVP7002_WRITE },
{ TVP7002_VBLK_F_1_DURATION, 0x17, TVP7002_WRITE },
{ TVP7002_ALC_PLACEMENT, 0x5a, TVP7002_WRITE },
{ TVP7002_CLAMP_START, 0x32, TVP7002_WRITE },
{ TVP7002_CLAMP_W, 0x20, TVP7002_WRITE },
{ TVP7002_HPLL_PRE_COAST, 0x01, TVP7002_WRITE },
{ TVP7002_HPLL_POST_COAST, 0x00, TVP7002_WRITE },
{ TVP7002_EOR, 0xff, TVP7002_RESERVED }
};
/* Register parameters for 1080P60 */
static const struct i2c_reg_value tvp7002_parms_1080P60[] = {
{ TVP7002_HPLL_FDBK_DIV_MSBS, 0x89, TVP7002_WRITE },
{ TVP7002_HPLL_FDBK_DIV_LSBS, 0x80, TVP7002_WRITE },
{ TVP7002_HPLL_CRTL, 0xE0, TVP7002_WRITE },
{ TVP7002_AVID_START_PIXEL_LSBS, 0x06, TVP7002_WRITE },
{ TVP7002_AVID_START_PIXEL_MSBS, 0x01, TVP7002_WRITE },
{ TVP7002_AVID_STOP_PIXEL_LSBS, 0x8a, TVP7002_WRITE },
{ TVP7002_AVID_STOP_PIXEL_MSBS, 0x08, TVP7002_WRITE },
{ TVP7002_VBLK_F_0_START_L_OFF, 0x02, TVP7002_WRITE },
{ TVP7002_VBLK_F_1_START_L_OFF, 0x02, TVP7002_WRITE },
{ TVP7002_VBLK_F_0_DURATION, 0x16, TVP7002_WRITE },
{ TVP7002_VBLK_F_1_DURATION, 0x17, TVP7002_WRITE },
{ TVP7002_ALC_PLACEMENT, 0x5a, TVP7002_WRITE },
{ TVP7002_CLAMP_START, 0x32, TVP7002_WRITE },
{ TVP7002_CLAMP_W, 0x20, TVP7002_WRITE },
{ TVP7002_HPLL_PRE_COAST, 0x01, TVP7002_WRITE },
{ TVP7002_HPLL_POST_COAST, 0x00, TVP7002_WRITE },
{ TVP7002_EOR, 0xff, TVP7002_RESERVED }
};
/* Register parameters for 1080I50 */
static const struct i2c_reg_value tvp7002_parms_1080I50[] = {
{ TVP7002_HPLL_FDBK_DIV_MSBS, 0xa5, TVP7002_WRITE },
{ TVP7002_HPLL_FDBK_DIV_LSBS, 0x00, TVP7002_WRITE },
{ TVP7002_HPLL_CRTL, 0x98, TVP7002_WRITE },
{ TVP7002_AVID_START_PIXEL_LSBS, 0x06, TVP7002_WRITE },
{ TVP7002_AVID_START_PIXEL_MSBS, 0x01, TVP7002_WRITE },
{ TVP7002_AVID_STOP_PIXEL_LSBS, 0x8a, TVP7002_WRITE },
{ TVP7002_AVID_STOP_PIXEL_MSBS, 0x08, TVP7002_WRITE },
{ TVP7002_VBLK_F_0_START_L_OFF, 0x02, TVP7002_WRITE },
{ TVP7002_VBLK_F_1_START_L_OFF, 0x02, TVP7002_WRITE },
{ TVP7002_VBLK_F_0_DURATION, 0x16, TVP7002_WRITE },
{ TVP7002_VBLK_F_1_DURATION, 0x17, TVP7002_WRITE },
{ TVP7002_ALC_PLACEMENT, 0x5a, TVP7002_WRITE },
{ TVP7002_CLAMP_START, 0x32, TVP7002_WRITE },
{ TVP7002_CLAMP_W, 0x20, TVP7002_WRITE },
{ TVP7002_HPLL_PRE_COAST, 0x01, TVP7002_WRITE },
{ TVP7002_HPLL_POST_COAST, 0x00, TVP7002_WRITE },
{ TVP7002_EOR, 0xff, TVP7002_RESERVED }
};
/* Register parameters for 720P60 */
static const struct i2c_reg_value tvp7002_parms_720P60[] = {
{ TVP7002_HPLL_FDBK_DIV_MSBS, 0x67, TVP7002_WRITE },
{ TVP7002_HPLL_FDBK_DIV_LSBS, 0x20, TVP7002_WRITE },
{ TVP7002_HPLL_CRTL, 0xa0, TVP7002_WRITE },
{ TVP7002_AVID_START_PIXEL_LSBS, 0x47, TVP7002_WRITE },
{ TVP7002_AVID_START_PIXEL_MSBS, 0x01, TVP7002_WRITE },
{ TVP7002_AVID_STOP_PIXEL_LSBS, 0x4B, TVP7002_WRITE },
{ TVP7002_AVID_STOP_PIXEL_MSBS, 0x06, TVP7002_WRITE },
{ TVP7002_VBLK_F_0_START_L_OFF, 0x05, TVP7002_WRITE },
{ TVP7002_VBLK_F_1_START_L_OFF, 0x00, TVP7002_WRITE },
{ TVP7002_VBLK_F_0_DURATION, 0x2D, TVP7002_WRITE },
{ TVP7002_VBLK_F_1_DURATION, 0x00, TVP7002_WRITE },
{ TVP7002_ALC_PLACEMENT, 0x5a, TVP7002_WRITE },
{ TVP7002_CLAMP_START, 0x32, TVP7002_WRITE },
{ TVP7002_CLAMP_W, 0x20, TVP7002_WRITE },
{ TVP7002_HPLL_PRE_COAST, 0x00, TVP7002_WRITE },
{ TVP7002_HPLL_POST_COAST, 0x00, TVP7002_WRITE },
{ TVP7002_EOR, 0xff, TVP7002_RESERVED }
};
/* Register parameters for 720P50 */
static const struct i2c_reg_value tvp7002_parms_720P50[] = {
{ TVP7002_HPLL_FDBK_DIV_MSBS, 0x7b, TVP7002_WRITE },
{ TVP7002_HPLL_FDBK_DIV_LSBS, 0xc0, TVP7002_WRITE },
{ TVP7002_HPLL_CRTL, 0x98, TVP7002_WRITE },
{ TVP7002_AVID_START_PIXEL_LSBS, 0x47, TVP7002_WRITE },
{ TVP7002_AVID_START_PIXEL_MSBS, 0x01, TVP7002_WRITE },
{ TVP7002_AVID_STOP_PIXEL_LSBS, 0x4B, TVP7002_WRITE },
{ TVP7002_AVID_STOP_PIXEL_MSBS, 0x06, TVP7002_WRITE },
{ TVP7002_VBLK_F_0_START_L_OFF, 0x05, TVP7002_WRITE },
{ TVP7002_VBLK_F_1_START_L_OFF, 0x00, TVP7002_WRITE },
{ TVP7002_VBLK_F_0_DURATION, 0x2D, TVP7002_WRITE },
{ TVP7002_VBLK_F_1_DURATION, 0x00, TVP7002_WRITE },
{ TVP7002_ALC_PLACEMENT, 0x5a, TVP7002_WRITE },
{ TVP7002_CLAMP_START, 0x32, TVP7002_WRITE },
{ TVP7002_CLAMP_W, 0x20, TVP7002_WRITE },
{ TVP7002_HPLL_PRE_COAST, 0x01, TVP7002_WRITE },
{ TVP7002_HPLL_POST_COAST, 0x00, TVP7002_WRITE },
{ TVP7002_EOR, 0xff, TVP7002_RESERVED }
};
/* Timings definition for handling device operation */
struct tvp7002_timings_definition {
struct v4l2_dv_timings timings;
const struct i2c_reg_value *p_settings;
enum v4l2_colorspace color_space;
enum v4l2_field scanmode;
u16 progressive;
u16 lines_per_frame;
u16 cpl_min;
u16 cpl_max;
};
/* Struct list for digital video timings */
static const struct tvp7002_timings_definition tvp7002_timings[] = {
{
V4L2_DV_BT_CEA_1280X720P60,
tvp7002_parms_720P60,
V4L2_COLORSPACE_REC709,
V4L2_FIELD_NONE,
1,
0x2EE,
135,
153
},
{
V4L2_DV_BT_CEA_1920X1080I60,
tvp7002_parms_1080I60,
V4L2_COLORSPACE_REC709,
V4L2_FIELD_INTERLACED,
0,
0x465,
181,
205
},
{
V4L2_DV_BT_CEA_1920X1080I50,
tvp7002_parms_1080I50,
V4L2_COLORSPACE_REC709,
V4L2_FIELD_INTERLACED,
0,
0x465,
217,
245
},
{
V4L2_DV_BT_CEA_1280X720P50,
tvp7002_parms_720P50,
V4L2_COLORSPACE_REC709,
V4L2_FIELD_NONE,
1,
0x2EE,
163,
183
},
{
V4L2_DV_BT_CEA_1920X1080P60,
tvp7002_parms_1080P60,
V4L2_COLORSPACE_REC709,
V4L2_FIELD_NONE,
1,
0x465,
90,
102
},
{
V4L2_DV_BT_CEA_720X480P59_94,
tvp7002_parms_480P,
V4L2_COLORSPACE_SMPTE170M,
V4L2_FIELD_NONE,
1,
0x20D,
0xffff,
0xffff
},
{
V4L2_DV_BT_CEA_720X576P50,
tvp7002_parms_576P,
V4L2_COLORSPACE_SMPTE170M,
V4L2_FIELD_NONE,
1,
0x271,
0xffff,
0xffff
}
};
#define NUM_TIMINGS ARRAY_SIZE(tvp7002_timings)
/* Device definition */
struct tvp7002 {
struct v4l2_subdev sd;
struct v4l2_ctrl_handler hdl;
const struct tvp7002_config *pdata;
int ver;
int streaming;
const struct tvp7002_timings_definition *current_timings;
struct media_pad pad;
};
/*
* to_tvp7002 - Obtain device handler TVP7002
* @sd: ptr to v4l2_subdev struct
*
* Returns device handler tvp7002.
*/
static inline struct tvp7002 *to_tvp7002(struct v4l2_subdev *sd)
{
return container_of(sd, struct tvp7002, sd);
}
static inline struct v4l2_subdev *to_sd(struct v4l2_ctrl *ctrl)
{
return &container_of(ctrl->handler, struct tvp7002, hdl)->sd;
}
/*
* tvp7002_read - Read a value from a register in an TVP7002
* @sd: ptr to v4l2_subdev struct
* @addr: TVP7002 register address
* @dst: pointer to 8-bit destination
*
* Returns value read if successful, or non-zero (-1) otherwise.
*/
static int tvp7002_read(struct v4l2_subdev *sd, u8 addr, u8 *dst)
{
struct i2c_client *c = v4l2_get_subdevdata(sd);
int retry;
int error;
for (retry = 0; retry < I2C_RETRY_COUNT; retry++) {
error = i2c_smbus_read_byte_data(c, addr);
if (error >= 0) {
*dst = (u8)error;
return 0;
}
msleep_interruptible(10);
}
v4l2_err(sd, "TVP7002 read error %d\n", error);
return error;
}
/*
* tvp7002_read_err() - Read a register value with error code
* @sd: pointer to standard V4L2 sub-device structure
* @reg: destination register
* @val: value to be read
* @err: pointer to error value
*
* Read a value in a register and save error value in pointer.
* Also update the register table if successful
*/
static inline void tvp7002_read_err(struct v4l2_subdev *sd, u8 reg,
u8 *dst, int *err)
{
if (!*err)
*err = tvp7002_read(sd, reg, dst);
}
/*
* tvp7002_write() - Write a value to a register in TVP7002
* @sd: ptr to v4l2_subdev struct
* @addr: TVP7002 register address
* @value: value to be written to the register
*
* Write a value to a register in an TVP7002 decoder device.
* Returns zero if successful, or non-zero otherwise.
*/
static int tvp7002_write(struct v4l2_subdev *sd, u8 addr, u8 value)
{
struct i2c_client *c;
int retry;
int error;
c = v4l2_get_subdevdata(sd);
for (retry = 0; retry < I2C_RETRY_COUNT; retry++) {
error = i2c_smbus_write_byte_data(c, addr, value);
if (error >= 0)
return 0;
v4l2_warn(sd, "Write: retry ... %d\n", retry);
msleep_interruptible(10);
}
v4l2_err(sd, "TVP7002 write error %d\n", error);
return error;
}
/*
* tvp7002_write_err() - Write a register value with error code
* @sd: pointer to standard V4L2 sub-device structure
* @reg: destination register
* @val: value to be written
* @err: pointer to error value
*
* Write a value in a register and save error value in pointer.
* Also update the register table if successful
*/
static inline void tvp7002_write_err(struct v4l2_subdev *sd, u8 reg,
u8 val, int *err)
{
if (!*err)
*err = tvp7002_write(sd, reg, val);
}
/*
* tvp7002_write_inittab() - Write initialization values
* @sd: ptr to v4l2_subdev struct
* @regs: ptr to i2c_reg_value struct
*
* Write initialization values.
* Returns zero or -EINVAL if read operation fails.
*/
static int tvp7002_write_inittab(struct v4l2_subdev *sd,
const struct i2c_reg_value *regs)
{
int error = 0;
/* Initialize the first (defined) registers */
while (TVP7002_EOR != regs->reg) {
if (TVP7002_WRITE == regs->type)
tvp7002_write_err(sd, regs->reg, regs->value, &error);
regs++;
}
return error;
}
static int tvp7002_s_dv_timings(struct v4l2_subdev *sd,
struct v4l2_dv_timings *dv_timings)
{
struct tvp7002 *device = to_tvp7002(sd);
const struct v4l2_bt_timings *bt = &dv_timings->bt;
int i;
if (dv_timings->type != V4L2_DV_BT_656_1120)
return -EINVAL;
for (i = 0; i < NUM_TIMINGS; i++) {
const struct v4l2_bt_timings *t = &tvp7002_timings[i].timings.bt;
if (!memcmp(bt, t, &bt->standards - &bt->width)) {
device->current_timings = &tvp7002_timings[i];
return tvp7002_write_inittab(sd, tvp7002_timings[i].p_settings);
}
}
return -EINVAL;
}
static int tvp7002_g_dv_timings(struct v4l2_subdev *sd,
struct v4l2_dv_timings *dv_timings)
{
struct tvp7002 *device = to_tvp7002(sd);
*dv_timings = device->current_timings->timings;
return 0;
}
/*
* tvp7002_s_ctrl() - Set a control
* @ctrl: ptr to v4l2_ctrl struct
*
* Set a control in TVP7002 decoder device.
* Returns zero when successful or -EINVAL if register access fails.
*/
static int tvp7002_s_ctrl(struct v4l2_ctrl *ctrl)
{
struct v4l2_subdev *sd = to_sd(ctrl);
int error = 0;
switch (ctrl->id) {
case V4L2_CID_GAIN:
tvp7002_write_err(sd, TVP7002_R_FINE_GAIN, ctrl->val, &error);
tvp7002_write_err(sd, TVP7002_G_FINE_GAIN, ctrl->val, &error);
tvp7002_write_err(sd, TVP7002_B_FINE_GAIN, ctrl->val, &error);
return error;
}
return -EINVAL;
}
/*
* tvp7002_mbus_fmt() - V4L2 decoder interface handler for try/s/g_mbus_fmt
* @sd: pointer to standard V4L2 sub-device structure
* @f: pointer to mediabus format structure
*
* Negotiate the image capture size and mediabus format.
* There is only one possible format, so this single function works for
* get, set and try.
*/
static int tvp7002_mbus_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *f)
{
struct tvp7002 *device = to_tvp7002(sd);
const struct v4l2_bt_timings *bt = &device->current_timings->timings.bt;
f->width = bt->width;
f->height = bt->height;
f->code = MEDIA_BUS_FMT_YUYV10_1X20;
f->field = device->current_timings->scanmode;
f->colorspace = device->current_timings->color_space;
v4l2_dbg(1, debug, sd, "MBUS_FMT: Width - %d, Height - %d",
f->width, f->height);
return 0;
}
/*
* tvp7002_query_dv() - query DV timings
* @sd: pointer to standard V4L2 sub-device structure
* @index: index into the tvp7002_timings array
*
* Returns the current DV timings detected by TVP7002. If no active input is
* detected, returns -EINVAL
*/
static int tvp7002_query_dv(struct v4l2_subdev *sd, int *index)
{
const struct tvp7002_timings_definition *timings = tvp7002_timings;
u8 progressive;
u32 lpfr;
u32 cpln;
int error = 0;
u8 lpf_lsb;
u8 lpf_msb;
u8 cpl_lsb;
u8 cpl_msb;
/* Return invalid index if no active input is detected */
*index = NUM_TIMINGS;
/* Read standards from device registers */
tvp7002_read_err(sd, TVP7002_L_FRAME_STAT_LSBS, &lpf_lsb, &error);
tvp7002_read_err(sd, TVP7002_L_FRAME_STAT_MSBS, &lpf_msb, &error);
if (error < 0)
return error;
tvp7002_read_err(sd, TVP7002_CLK_L_STAT_LSBS, &cpl_lsb, &error);
tvp7002_read_err(sd, TVP7002_CLK_L_STAT_MSBS, &cpl_msb, &error);
if (error < 0)
return error;
/* Get lines per frame, clocks per line and interlaced/progresive */
lpfr = lpf_lsb | ((TVP7002_CL_MASK & lpf_msb) << TVP7002_CL_SHIFT);
cpln = cpl_lsb | ((TVP7002_CL_MASK & cpl_msb) << TVP7002_CL_SHIFT);
progressive = (lpf_msb & TVP7002_INPR_MASK) >> TVP7002_IP_SHIFT;
/* Do checking of video modes */
for (*index = 0; *index < NUM_TIMINGS; (*index)++, timings++)
if (lpfr == timings->lines_per_frame &&
progressive == timings->progressive) {
if (timings->cpl_min == 0xffff)
break;
if (cpln >= timings->cpl_min && cpln <= timings->cpl_max)
break;
}
if (*index == NUM_TIMINGS) {
v4l2_dbg(1, debug, sd, "detection failed: lpf = %x, cpl = %x\n",
lpfr, cpln);
return -ENOLINK;
}
/* Update lines per frame and clocks per line info */
v4l2_dbg(1, debug, sd, "detected timings: %d\n", *index);
return 0;
}
static int tvp7002_query_dv_timings(struct v4l2_subdev *sd,
struct v4l2_dv_timings *timings)
{
int index;
int err = tvp7002_query_dv(sd, &index);
if (err)
return err;
*timings = tvp7002_timings[index].timings;
return 0;
}
#ifdef CONFIG_VIDEO_ADV_DEBUG
/*
* tvp7002_g_register() - Get the value of a register
* @sd: ptr to v4l2_subdev struct
* @reg: ptr to v4l2_dbg_register struct
*
* Get the value of a TVP7002 decoder device register.
* Returns zero when successful, -EINVAL if register read fails or
* access to I2C client fails.
*/
static int tvp7002_g_register(struct v4l2_subdev *sd,
struct v4l2_dbg_register *reg)
{
u8 val;
int ret;
ret = tvp7002_read(sd, reg->reg & 0xff, &val);
reg->val = val;
reg->size = 1;
return ret;
}
/*
* tvp7002_s_register() - set a control
* @sd: ptr to v4l2_subdev struct
* @reg: ptr to v4l2_dbg_register struct
*
* Get the value of a TVP7002 decoder device register.
* Returns zero when successful, -EINVAL if register read fails.
*/
static int tvp7002_s_register(struct v4l2_subdev *sd,
const struct v4l2_dbg_register *reg)
{
return tvp7002_write(sd, reg->reg & 0xff, reg->val & 0xff);
}
#endif
/*
* tvp7002_enum_mbus_fmt() - Enum supported mediabus formats
* @sd: pointer to standard V4L2 sub-device structure
* @index: format index
* @code: pointer to mediabus format
*
* Enumerate supported mediabus formats.
*/
static int tvp7002_enum_mbus_fmt(struct v4l2_subdev *sd, unsigned index,
u32 *code)
{
/* Check requested format index is within range */
if (index)
return -EINVAL;
*code = MEDIA_BUS_FMT_YUYV10_1X20;
return 0;
}
/*
* tvp7002_s_stream() - V4L2 decoder i/f handler for s_stream
* @sd: pointer to standard V4L2 sub-device structure
* @enable: streaming enable or disable
*
* Sets streaming to enable or disable, if possible.
*/
static int tvp7002_s_stream(struct v4l2_subdev *sd, int enable)
{
struct tvp7002 *device = to_tvp7002(sd);
int error;
if (device->streaming == enable)
return 0;
/* low impedance: on, high impedance: off */
error = tvp7002_write(sd, TVP7002_MISC_CTL_2, enable ? 0x00 : 0x03);
if (error) {
v4l2_dbg(1, debug, sd, "Fail to set streaming\n");
return error;
}
device->streaming = enable;
return 0;
}
/*
* tvp7002_log_status() - Print information about register settings
* @sd: ptr to v4l2_subdev struct
*
* Log register values of a TVP7002 decoder device.
* Returns zero or -EINVAL if read operation fails.
*/
static int tvp7002_log_status(struct v4l2_subdev *sd)
{
struct tvp7002 *device = to_tvp7002(sd);
const struct v4l2_bt_timings *bt;
int detected;
/* Find my current timings */
tvp7002_query_dv(sd, &detected);
bt = &device->current_timings->timings.bt;
v4l2_info(sd, "Selected DV Timings: %ux%u\n", bt->width, bt->height);
if (detected == NUM_TIMINGS) {
v4l2_info(sd, "Detected DV Timings: None\n");
} else {
bt = &tvp7002_timings[detected].timings.bt;
v4l2_info(sd, "Detected DV Timings: %ux%u\n",
bt->width, bt->height);
}
v4l2_info(sd, "Streaming enabled: %s\n",
device->streaming ? "yes" : "no");
/* Print the current value of the gain control */
v4l2_ctrl_handler_log_status(&device->hdl, sd->name);
return 0;
}
static int tvp7002_enum_dv_timings(struct v4l2_subdev *sd,
struct v4l2_enum_dv_timings *timings)
{
if (timings->pad != 0)
return -EINVAL;
/* Check requested format index is within range */
if (timings->index >= NUM_TIMINGS)
return -EINVAL;
timings->timings = tvp7002_timings[timings->index].timings;
return 0;
}
static const struct v4l2_ctrl_ops tvp7002_ctrl_ops = {
.s_ctrl = tvp7002_s_ctrl,
};
/*
* tvp7002_enum_mbus_code() - Enum supported digital video format on pad
* @sd: pointer to standard V4L2 sub-device structure
* @fh: file handle for the subdev
* @code: pointer to subdev enum mbus code struct
*
* Enumerate supported digital video formats for pad.
*/
static int
tvp7002_enum_mbus_code(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
struct v4l2_subdev_mbus_code_enum *code)
{
/* Check requested format index is within range */
if (code->index != 0)
return -EINVAL;
code->code = MEDIA_BUS_FMT_YUYV10_1X20;
return 0;
}
/*
* tvp7002_get_pad_format() - get video format on pad
* @sd: pointer to standard V4L2 sub-device structure
* @fh: file handle for the subdev
* @fmt: pointer to subdev format struct
*
* get video format for pad.
*/
static int
tvp7002_get_pad_format(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
struct v4l2_subdev_format *fmt)
{
struct tvp7002 *tvp7002 = to_tvp7002(sd);
fmt->format.code = MEDIA_BUS_FMT_YUYV10_1X20;
fmt->format.width = tvp7002->current_timings->timings.bt.width;
fmt->format.height = tvp7002->current_timings->timings.bt.height;
fmt->format.field = tvp7002->current_timings->scanmode;
fmt->format.colorspace = tvp7002->current_timings->color_space;
return 0;
}
/*
* tvp7002_set_pad_format() - set video format on pad
* @sd: pointer to standard V4L2 sub-device structure
* @fh: file handle for the subdev
* @fmt: pointer to subdev format struct
*
* set video format for pad.
*/
static int
tvp7002_set_pad_format(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh,
struct v4l2_subdev_format *fmt)
{
return tvp7002_get_pad_format(sd, fh, fmt);
}
/* V4L2 core operation handlers */
static const struct v4l2_subdev_core_ops tvp7002_core_ops = {
.log_status = tvp7002_log_status,
.g_ext_ctrls = v4l2_subdev_g_ext_ctrls,
.try_ext_ctrls = v4l2_subdev_try_ext_ctrls,
.s_ext_ctrls = v4l2_subdev_s_ext_ctrls,
.g_ctrl = v4l2_subdev_g_ctrl,
.s_ctrl = v4l2_subdev_s_ctrl,
.queryctrl = v4l2_subdev_queryctrl,
.querymenu = v4l2_subdev_querymenu,
#ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = tvp7002_g_register,
.s_register = tvp7002_s_register,
#endif
};
/* Specific video subsystem operation handlers */
static const struct v4l2_subdev_video_ops tvp7002_video_ops = {
.g_dv_timings = tvp7002_g_dv_timings,
.s_dv_timings = tvp7002_s_dv_timings,
.query_dv_timings = tvp7002_query_dv_timings,
.s_stream = tvp7002_s_stream,
.g_mbus_fmt = tvp7002_mbus_fmt,
.try_mbus_fmt = tvp7002_mbus_fmt,
.s_mbus_fmt = tvp7002_mbus_fmt,
.enum_mbus_fmt = tvp7002_enum_mbus_fmt,
};
/* media pad related operation handlers */
static const struct v4l2_subdev_pad_ops tvp7002_pad_ops = {
.enum_mbus_code = tvp7002_enum_mbus_code,
.get_fmt = tvp7002_get_pad_format,
.set_fmt = tvp7002_set_pad_format,
.enum_dv_timings = tvp7002_enum_dv_timings,
};
/* V4L2 top level operation handlers */
static const struct v4l2_subdev_ops tvp7002_ops = {
.core = &tvp7002_core_ops,
.video = &tvp7002_video_ops,
.pad = &tvp7002_pad_ops,
};
static struct tvp7002_config *
tvp7002_get_pdata(struct i2c_client *client)
{
struct v4l2_of_endpoint bus_cfg;
struct tvp7002_config *pdata;
struct device_node *endpoint;
unsigned int flags;
if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node)
return client->dev.platform_data;
endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL);
if (!endpoint)
return NULL;
pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
goto done;
v4l2_of_parse_endpoint(endpoint, &bus_cfg);
flags = bus_cfg.bus.parallel.flags;
if (flags & V4L2_MBUS_HSYNC_ACTIVE_HIGH)
pdata->hs_polarity = 1;
if (flags & V4L2_MBUS_VSYNC_ACTIVE_HIGH)
pdata->vs_polarity = 1;
if (flags & V4L2_MBUS_PCLK_SAMPLE_RISING)
pdata->clk_polarity = 1;
if (flags & V4L2_MBUS_FIELD_EVEN_HIGH)
pdata->fid_polarity = 1;
if (flags & V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH)
pdata->sog_polarity = 1;
done:
of_node_put(endpoint);
return pdata;
}
/*
* tvp7002_probe - Probe a TVP7002 device
* @c: ptr to i2c_client struct
* @id: ptr to i2c_device_id struct
*
* Initialize the TVP7002 device
* Returns zero when successful, -EINVAL if register read fails or
* -EIO if i2c access is not available.
*/
static int tvp7002_probe(struct i2c_client *c, const struct i2c_device_id *id)
{
struct tvp7002_config *pdata = tvp7002_get_pdata(c);
struct v4l2_subdev *sd;
struct tvp7002 *device;
struct v4l2_dv_timings timings;
int polarity_a;
int polarity_b;
u8 revision;
int error;
if (pdata == NULL) {
dev_err(&c->dev, "No platform data\n");
return -EINVAL;
}
/* Check if the adapter supports the needed features */
if (!i2c_check_functionality(c->adapter,
I2C_FUNC_SMBUS_READ_BYTE | I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
return -EIO;
device = devm_kzalloc(&c->dev, sizeof(struct tvp7002), GFP_KERNEL);
if (!device)
return -ENOMEM;
sd = &device->sd;
device->pdata = pdata;
device->current_timings = tvp7002_timings;
/* Tell v4l2 the device is ready */
v4l2_i2c_subdev_init(sd, c, &tvp7002_ops);
v4l_info(c, "tvp7002 found @ 0x%02x (%s)\n",
c->addr, c->adapter->name);
error = tvp7002_read(sd, TVP7002_CHIP_REV, &revision);
if (error < 0)
return error;
/* Get revision number */
v4l2_info(sd, "Rev. %02x detected.\n", revision);
if (revision != 0x02)
v4l2_info(sd, "Unknown revision detected.\n");
/* Initializes TVP7002 to its default values */
error = tvp7002_write_inittab(sd, tvp7002_init_default);
if (error < 0)
return error;
/* Set polarity information after registers have been set */
polarity_a = 0x20 | device->pdata->hs_polarity << 5
| device->pdata->vs_polarity << 2;
error = tvp7002_write(sd, TVP7002_SYNC_CTL_1, polarity_a);
if (error < 0)
return error;
polarity_b = 0x01 | device->pdata->fid_polarity << 2
| device->pdata->sog_polarity << 1
| device->pdata->clk_polarity;
error = tvp7002_write(sd, TVP7002_MISC_CTL_3, polarity_b);
if (error < 0)
return error;
/* Set registers according to default video mode */
timings = device->current_timings->timings;
error = tvp7002_s_dv_timings(sd, &timings);
#if defined(CONFIG_MEDIA_CONTROLLER)
device->pad.flags = MEDIA_PAD_FL_SOURCE;
device->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
device->sd.entity.flags |= MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
error = media_entity_init(&device->sd.entity, 1, &device->pad, 0);
if (error < 0)
return error;
#endif
v4l2_ctrl_handler_init(&device->hdl, 1);
v4l2_ctrl_new_std(&device->hdl, &tvp7002_ctrl_ops,
V4L2_CID_GAIN, 0, 255, 1, 0);
sd->ctrl_handler = &device->hdl;
if (device->hdl.error) {
error = device->hdl.error;
goto error;
}
v4l2_ctrl_handler_setup(&device->hdl);
error = v4l2_async_register_subdev(&device->sd);
if (error)
goto error;
return 0;
error:
v4l2_ctrl_handler_free(&device->hdl);
#if defined(CONFIG_MEDIA_CONTROLLER)
media_entity_cleanup(&device->sd.entity);
#endif
return error;
}
/*
* tvp7002_remove - Remove TVP7002 device support
* @c: ptr to i2c_client struct
*
* Reset the TVP7002 device
* Returns zero.
*/
static int tvp7002_remove(struct i2c_client *c)
{
struct v4l2_subdev *sd = i2c_get_clientdata(c);
struct tvp7002 *device = to_tvp7002(sd);
v4l2_dbg(1, debug, sd, "Removing tvp7002 adapter"
"on address 0x%x\n", c->addr);
v4l2_async_unregister_subdev(&device->sd);
#if defined(CONFIG_MEDIA_CONTROLLER)
media_entity_cleanup(&device->sd.entity);
#endif
v4l2_device_unregister_subdev(sd);
v4l2_ctrl_handler_free(&device->hdl);
return 0;
}
/* I2C Device ID table */
static const struct i2c_device_id tvp7002_id[] = {
{ "tvp7002", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, tvp7002_id);
#if IS_ENABLED(CONFIG_OF)
static const struct of_device_id tvp7002_of_match[] = {
{ .compatible = "ti,tvp7002", },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(of, tvp7002_of_match);
#endif
/* I2C driver data */
static struct i2c_driver tvp7002_driver = {
.driver = {
.of_match_table = of_match_ptr(tvp7002_of_match),
.owner = THIS_MODULE,
.name = TVP7002_MODULE_NAME,
},
.probe = tvp7002_probe,
.remove = tvp7002_remove,
.id_table = tvp7002_id,
};
module_i2c_driver(tvp7002_driver);
| {
"pile_set_name": "Github"
} |
// +build f030x6
// Peripheral: USART_Periph Universal Synchronous Asynchronous Receiver Transmitter.
// Instances:
// USART1 mmap.USART1_BASE
// Registers:
// 0x00 32 CR1 Control register 1.
// 0x04 32 CR2 Control register 2.
// 0x08 32 CR3 Control register 3.
// 0x0C 32 BRR Baud rate register.
// 0x10 32 GTPR Guard time and prescaler register.
// 0x14 32 RTOR Receiver Time Out register.
// 0x18 32 RQR Request register.
// 0x1C 32 ISR Interrupt and status register.
// 0x20 32 ICR Interrupt flag Clear register.
// 0x24 16 RDR Receive Data register.
// 0x28 16 TDR Transmit Data register.
// Import:
// stm32/o/f030x6/mmap
package usart
// DO NOT EDIT THIS FILE. GENERATED BY stm32xgen.
const (
UE CR1 = 0x01 << 0 //+ USART Enable.
RE CR1 = 0x01 << 2 //+ Receiver Enable.
TE CR1 = 0x01 << 3 //+ Transmitter Enable.
IDLEIE CR1 = 0x01 << 4 //+ IDLE Interrupt Enable.
RXNEIE CR1 = 0x01 << 5 //+ RXNE Interrupt Enable.
TCIE CR1 = 0x01 << 6 //+ Transmission Complete Interrupt Enable.
TXEIE CR1 = 0x01 << 7 //+ TXE Interrupt Enable.
PEIE CR1 = 0x01 << 8 //+ PE Interrupt Enable.
PS CR1 = 0x01 << 9 //+ Parity Selection.
PCE CR1 = 0x01 << 10 //+ Parity Control Enable.
WAKE CR1 = 0x01 << 11 //+ Receiver Wakeup method.
M CR1 = 0x01 << 12 //+ Word Length.
MME CR1 = 0x01 << 13 //+ Mute Mode Enable.
CMIE CR1 = 0x01 << 14 //+ Character match interrupt enable.
OVER8 CR1 = 0x01 << 15 //+ Oversampling by 8-bit or 16-bit mode.
DEDT CR1 = 0x1F << 16 //+ DEDT[4:0] bits (Driver Enable Deassertion Time).
DEAT CR1 = 0x1F << 21 //+ DEAT[4:0] bits (Driver Enable Assertion Time).
RTOIE CR1 = 0x01 << 26 //+ Receive Time Out interrupt enable.
EOBIE CR1 = 0x01 << 27 //+ End of Block interrupt enable.
)
const (
UEn = 0
REn = 2
TEn = 3
IDLEIEn = 4
RXNEIEn = 5
TCIEn = 6
TXEIEn = 7
PEIEn = 8
PSn = 9
PCEn = 10
WAKEn = 11
Mn = 12
MMEn = 13
CMIEn = 14
OVER8n = 15
DEDTn = 16
DEATn = 21
RTOIEn = 26
EOBIEn = 27
)
const (
ADDM7 CR2 = 0x01 << 4 //+ 7-bit or 4-bit Address Detection.
LBCL CR2 = 0x01 << 8 //+ Last Bit Clock pulse.
CPHA CR2 = 0x01 << 9 //+ Clock Phase.
CPOL CR2 = 0x01 << 10 //+ Clock Polarity.
CLKEN CR2 = 0x01 << 11 //+ Clock Enable.
STOP CR2 = 0x03 << 12 //+ STOP[1:0] bits (STOP bits).
SWAP CR2 = 0x01 << 15 //+ SWAP TX/RX pins.
RXINV CR2 = 0x01 << 16 //+ RX pin active level inversion.
TXINV CR2 = 0x01 << 17 //+ TX pin active level inversion.
DATAINV CR2 = 0x01 << 18 //+ Binary data inversion.
MSBFIRST CR2 = 0x01 << 19 //+ Most Significant Bit First.
ABREN CR2 = 0x01 << 20 //+ Auto Baud-Rate Enable.
ABRMODE CR2 = 0x03 << 21 //+ ABRMOD[1:0] bits (Auto Baud-Rate Mode).
RTOEN CR2 = 0x01 << 23 //+ Receiver Time-Out enable.
ADD CR2 = 0xFF << 24 //+ Address of the USART node.
)
const (
ADDM7n = 4
LBCLn = 8
CPHAn = 9
CPOLn = 10
CLKENn = 11
STOPn = 12
SWAPn = 15
RXINVn = 16
TXINVn = 17
DATAINVn = 18
MSBFIRSTn = 19
ABRENn = 20
ABRMODEn = 21
RTOENn = 23
ADDn = 24
)
const (
EIE CR3 = 0x01 << 0 //+ Error Interrupt Enable.
HDSEL CR3 = 0x01 << 3 //+ Half-Duplex Selection.
DMAR CR3 = 0x01 << 6 //+ DMA Enable Receiver.
DMAT CR3 = 0x01 << 7 //+ DMA Enable Transmitter.
RTSE CR3 = 0x01 << 8 //+ RTS Enable.
CTSE CR3 = 0x01 << 9 //+ CTS Enable.
CTSIE CR3 = 0x01 << 10 //+ CTS Interrupt Enable.
ONEBIT CR3 = 0x01 << 11 //+ One sample bit method enable.
OVRDIS CR3 = 0x01 << 12 //+ Overrun Disable.
DDRE CR3 = 0x01 << 13 //+ DMA Disable on Reception Error.
DEM CR3 = 0x01 << 14 //+ Driver Enable Mode.
DEP CR3 = 0x01 << 15 //+ Driver Enable Polarity Selection.
)
const (
EIEn = 0
HDSELn = 3
DMARn = 6
DMATn = 7
RTSEn = 8
CTSEn = 9
CTSIEn = 10
ONEBITn = 11
OVRDISn = 12
DDREn = 13
DEMn = 14
DEPn = 15
)
const (
DIV_FRACTION BRR = 0x0F << 0 //+ Fraction of USARTDIV.
DIV_MANTISSA BRR = 0xFFF << 4 //+ Mantissa of USARTDIV.
)
const (
DIV_FRACTIONn = 0
DIV_MANTISSAn = 4
)
const (
PSC GTPR = 0xFF << 0 //+ PSC[7:0] bits (Prescaler value).
GT GTPR = 0xFF << 8 //+ GT[7:0] bits (Guard time value).
)
const (
PSCn = 0
GTn = 8
)
const (
RTO RTOR = 0xFFFFFF << 0 //+ Receiver Time Out Value.
BLEN RTOR = 0xFF << 24 //+ Block Length.
)
const (
RTOn = 0
BLENn = 24
)
const (
ABRRQ RQR = 0x01 << 0 //+ Auto-Baud Rate Request.
SBKRQ RQR = 0x01 << 1 //+ Send Break Request.
MMRQ RQR = 0x01 << 2 //+ Mute Mode Request.
RXFRQ RQR = 0x01 << 3 //+ Receive Data flush Request.
)
const (
ABRRQn = 0
SBKRQn = 1
MMRQn = 2
RXFRQn = 3
)
const (
PE ISR = 0x01 << 0 //+ Parity Error.
FE ISR = 0x01 << 1 //+ Framing Error.
NE ISR = 0x01 << 2 //+ Noise detected Flag.
ORE ISR = 0x01 << 3 //+ OverRun Error.
IDLE ISR = 0x01 << 4 //+ IDLE line detected.
RXNE ISR = 0x01 << 5 //+ Read Data Register Not Empty.
TC ISR = 0x01 << 6 //+ Transmission Complete.
TXE ISR = 0x01 << 7 //+ Transmit Data Register Empty.
CTSIF ISR = 0x01 << 9 //+ CTS interrupt flag.
CTS ISR = 0x01 << 10 //+ CTS flag.
RTOF ISR = 0x01 << 11 //+ Receiver Time Out.
ABRE ISR = 0x01 << 14 //+ Auto-Baud Rate Error.
ABRF ISR = 0x01 << 15 //+ Auto-Baud Rate Flag.
BUSY ISR = 0x01 << 16 //+ Busy Flag.
CMF ISR = 0x01 << 17 //+ Character Match Flag.
SBKF ISR = 0x01 << 18 //+ Send Break Flag.
RWU ISR = 0x01 << 19 //+ Receive Wake Up from mute mode Flag.
TEACK ISR = 0x01 << 21 //+ Transmit Enable Acknowledge Flag.
REACK ISR = 0x01 << 22 //+ Receive Enable Acknowledge Flag.
)
const (
PEn = 0
FEn = 1
NEn = 2
OREn = 3
IDLEn = 4
RXNEn = 5
TCn = 6
TXEn = 7
CTSIFn = 9
CTSn = 10
RTOFn = 11
ABREn = 14
ABRFn = 15
BUSYn = 16
CMFn = 17
SBKFn = 18
RWUn = 19
TEACKn = 21
REACKn = 22
)
const (
PECF ICR = 0x01 << 0 //+ Parity Error Clear Flag.
FECF ICR = 0x01 << 1 //+ Framing Error Clear Flag.
NCF ICR = 0x01 << 2 //+ Noise detected Clear Flag.
ORECF ICR = 0x01 << 3 //+ OverRun Error Clear Flag.
IDLECF ICR = 0x01 << 4 //+ IDLE line detected Clear Flag.
TCCF ICR = 0x01 << 6 //+ Transmission Complete Clear Flag.
CTSCF ICR = 0x01 << 9 //+ CTS Interrupt Clear Flag.
RTOCF ICR = 0x01 << 11 //+ Receiver Time Out Clear Flag.
CMCF ICR = 0x01 << 17 //+ Character Match Clear Flag.
)
const (
PECFn = 0
FECFn = 1
NCFn = 2
ORECFn = 3
IDLECFn = 4
TCCFn = 6
CTSCFn = 9
RTOCFn = 11
CMCFn = 17
)
| {
"pile_set_name": "Github"
} |
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "DVTLayoutView_ML.h"
#import "DVTInvalidation-Protocol.h"
@class DVTBorderedView, DVTStackBacktrace, IDEControlGroup, IDEPathControl;
@interface IDENavBar : DVTLayoutView_ML <DVTInvalidation>
{
DVTBorderedView *_pathBorderedView;
IDEPathControl *_pathControl;
IDEControlGroup *_leftControlGroup;
IDEControlGroup *_rightControlGroup;
int _borderSides;
BOOL _isGrouped;
}
+ (id)inactiveTextColorForGradientStyle:(int)arg1;
+ (id)textColorForGradientStyle:(int)arg1;
+ (id)interiorHighlightColorForGradientStyle:(int)arg1;
+ (id)inactiveInteriorBorderColorForGradientStyle:(int)arg1;
+ (id)interiorBorderColorForGradientStyle:(int)arg1;
+ (id)inactiveBackgroundGradientForGradientStyle:(int)arg1;
+ (id)backgroundGradientForGradientStyle:(int)arg1;
+ (id)inactiveBorderColorForGradientStyle:(int)arg1;
+ (id)borderColorForGradientStyle:(int)arg1;
+ (void)initialize;
@property BOOL isGrouped; // @synthesize isGrouped=_isGrouped;
@property(retain) IDEControlGroup *rightControlGroup; // @synthesize rightControlGroup=_rightControlGroup;
@property(retain) IDEPathControl *pathControl; // @synthesize pathControl=_pathControl;
@property(retain) IDEControlGroup *leftControlGroup; // @synthesize leftControlGroup=_leftControlGroup;
@property(nonatomic) int borderSides; // @synthesize borderSides=_borderSides;
- (void).cxx_destruct;
- (void)refreshColorsForXcode5UI:(BOOL)arg1;
- (void)_updateFocusStyleForGradientStyle:(int)arg1;
- (void)makeUnfocusedStyle;
- (void)makeFocusedStyle;
- (struct CGRect)grabRect;
- (void)primitiveInvalidate;
- (id)initWithCoder:(id)arg1;
- (id)initWithFrame:(struct CGRect)arg1;
- (void)_controlGroupDidChange:(id)arg1;
- (void)_IDENavBarSharedInit;
- (void)layoutBottomUp;
- (void)layoutTopDown;
- (void)_updateBorderSidesForSubviews;
- (id)accessibilityAttributeValue:(id)arg1;
- (BOOL)accessibilityIsIgnored;
// Remaining properties
@property(retain) DVTStackBacktrace *creationBacktrace;
@property(readonly) DVTStackBacktrace *invalidationBacktrace;
@property(readonly, nonatomic, getter=isValid) BOOL valid;
@end
| {
"pile_set_name": "Github"
} |
*> \brief \b SLASYF_ROOK computes a partial factorization of a real symmetric matrix using the bounded Bunch-Kaufman ("rook") diagonal pivoting method.
*
* =========== DOCUMENTATION ===========
*
* Online html documentation available at
* http://www.netlib.org/lapack/explore-html/
*
*> \htmlonly
*> Download SLASYF_ROOK + dependencies
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slasyf_rook.f">
*> [TGZ]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slasyf_rook.f">
*> [ZIP]</a>
*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slasyf_rook.f">
*> [TXT]</a>
*> \endhtmlonly
*
* Definition:
* ===========
*
* SUBROUTINE SLASYF_ROOK( UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO )
*
* .. Scalar Arguments ..
* CHARACTER UPLO
* INTEGER INFO, KB, LDA, LDW, N, NB
* ..
* .. Array Arguments ..
* INTEGER IPIV( * )
* REAL A( LDA, * ), W( LDW, * )
* ..
*
*
*> \par Purpose:
* =============
*>
*> \verbatim
*>
*> SLASYF_ROOK computes a partial factorization of a real symmetric
*> matrix A using the bounded Bunch-Kaufman ("rook") diagonal
*> pivoting method. The partial factorization has the form:
*>
*> A = ( I U12 ) ( A11 0 ) ( I 0 ) if UPLO = 'U', or:
*> ( 0 U22 ) ( 0 D ) ( U12**T U22**T )
*>
*> A = ( L11 0 ) ( D 0 ) ( L11**T L21**T ) if UPLO = 'L'
*> ( L21 I ) ( 0 A22 ) ( 0 I )
*>
*> where the order of D is at most NB. The actual order is returned in
*> the argument KB, and is either NB or NB-1, or N if N <= NB.
*>
*> SLASYF_ROOK is an auxiliary routine called by SSYTRF_ROOK. It uses
*> blocked code (calling Level 3 BLAS) to update the submatrix
*> A11 (if UPLO = 'U') or A22 (if UPLO = 'L').
*> \endverbatim
*
* Arguments:
* ==========
*
*> \param[in] UPLO
*> \verbatim
*> UPLO is CHARACTER*1
*> Specifies whether the upper or lower triangular part of the
*> symmetric matrix A is stored:
*> = 'U': Upper triangular
*> = 'L': Lower triangular
*> \endverbatim
*>
*> \param[in] N
*> \verbatim
*> N is INTEGER
*> The order of the matrix A. N >= 0.
*> \endverbatim
*>
*> \param[in] NB
*> \verbatim
*> NB is INTEGER
*> The maximum number of columns of the matrix A that should be
*> factored. NB should be at least 2 to allow for 2-by-2 pivot
*> blocks.
*> \endverbatim
*>
*> \param[out] KB
*> \verbatim
*> KB is INTEGER
*> The number of columns of A that were actually factored.
*> KB is either NB-1 or NB, or N if N <= NB.
*> \endverbatim
*>
*> \param[in,out] A
*> \verbatim
*> A is REAL array, dimension (LDA,N)
*> On entry, the symmetric matrix A. If UPLO = 'U', the leading
*> n-by-n upper triangular part of A contains the upper
*> triangular part of the matrix A, and the strictly lower
*> triangular part of A is not referenced. If UPLO = 'L', the
*> leading n-by-n lower triangular part of A contains the lower
*> triangular part of the matrix A, and the strictly upper
*> triangular part of A is not referenced.
*> On exit, A contains details of the partial factorization.
*> \endverbatim
*>
*> \param[in] LDA
*> \verbatim
*> LDA is INTEGER
*> The leading dimension of the array A. LDA >= max(1,N).
*> \endverbatim
*>
*> \param[out] IPIV
*> \verbatim
*> IPIV is INTEGER array, dimension (N)
*> Details of the interchanges and the block structure of D.
*>
*> If UPLO = 'U':
*> Only the last KB elements of IPIV are set.
*>
*> If IPIV(k) > 0, then rows and columns k and IPIV(k) were
*> interchanged and D(k,k) is a 1-by-1 diagonal block.
*>
*> If IPIV(k) < 0 and IPIV(k-1) < 0, then rows and
*> columns k and -IPIV(k) were interchanged and rows and
*> columns k-1 and -IPIV(k-1) were inerchaged,
*> D(k-1:k,k-1:k) is a 2-by-2 diagonal block.
*>
*> If UPLO = 'L':
*> Only the first KB elements of IPIV are set.
*>
*> If IPIV(k) > 0, then rows and columns k and IPIV(k)
*> were interchanged and D(k,k) is a 1-by-1 diagonal block.
*>
*> If IPIV(k) < 0 and IPIV(k+1) < 0, then rows and
*> columns k and -IPIV(k) were interchanged and rows and
*> columns k+1 and -IPIV(k+1) were inerchaged,
*> D(k:k+1,k:k+1) is a 2-by-2 diagonal block.
*> \endverbatim
*>
*> \param[out] W
*> \verbatim
*> W is REAL array, dimension (LDW,NB)
*> \endverbatim
*>
*> \param[in] LDW
*> \verbatim
*> LDW is INTEGER
*> The leading dimension of the array W. LDW >= max(1,N).
*> \endverbatim
*>
*> \param[out] INFO
*> \verbatim
*> INFO is INTEGER
*> = 0: successful exit
*> > 0: if INFO = k, D(k,k) is exactly zero. The factorization
*> has been completed, but the block diagonal matrix D is
*> exactly singular.
*> \endverbatim
*
* Authors:
* ========
*
*> \author Univ. of Tennessee
*> \author Univ. of California Berkeley
*> \author Univ. of Colorado Denver
*> \author NAG Ltd.
*
*> \date November 2013
*
*> \ingroup realSYcomputational
*
*> \par Contributors:
* ==================
*>
*> \verbatim
*>
*> November 2013, Igor Kozachenko,
*> Computer Science Division,
*> University of California, Berkeley
*>
*> September 2007, Sven Hammarling, Nicholas J. Higham, Craig Lucas,
*> School of Mathematics,
*> University of Manchester
*>
*> \endverbatim
*
* =====================================================================
SUBROUTINE SLASYF_ROOK( UPLO, N, NB, KB, A, LDA, IPIV, W, LDW,
$ INFO )
*
* -- LAPACK computational routine (version 3.5.0) --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
* November 2013
*
* .. Scalar Arguments ..
CHARACTER UPLO
INTEGER INFO, KB, LDA, LDW, N, NB
* ..
* .. Array Arguments ..
INTEGER IPIV( * )
REAL A( LDA, * ), W( LDW, * )
* ..
*
* =====================================================================
*
* .. Parameters ..
REAL ZERO, ONE
PARAMETER ( ZERO = 0.0E+0, ONE = 1.0E+0 )
REAL EIGHT, SEVTEN
PARAMETER ( EIGHT = 8.0E+0, SEVTEN = 17.0E+0 )
* ..
* .. Local Scalars ..
LOGICAL DONE
INTEGER IMAX, ITEMP, J, JB, JJ, JMAX, JP1, JP2, K, KK,
$ KW, KKW, KP, KSTEP, P, II
REAL ABSAKK, ALPHA, COLMAX, D11, D12, D21, D22,
$ STEMP, R1, ROWMAX, T, SFMIN
* ..
* .. External Functions ..
LOGICAL LSAME
INTEGER ISAMAX
REAL SLAMCH
EXTERNAL LSAME, ISAMAX, SLAMCH
* ..
* .. External Subroutines ..
EXTERNAL SCOPY, SGEMM, SGEMV, SSCAL, SSWAP
* ..
* .. Intrinsic Functions ..
INTRINSIC ABS, MAX, MIN, SQRT
* ..
* .. Executable Statements ..
*
INFO = 0
*
* Initialize ALPHA for use in choosing pivot block size.
*
ALPHA = ( ONE+SQRT( SEVTEN ) ) / EIGHT
*
* Compute machine safe minimum
*
SFMIN = SLAMCH( 'S' )
*
IF( LSAME( UPLO, 'U' ) ) THEN
*
* Factorize the trailing columns of A using the upper triangle
* of A and working backwards, and compute the matrix W = U12*D
* for use in updating A11
*
* K is the main loop index, decreasing from N in steps of 1 or 2
*
K = N
10 CONTINUE
*
* KW is the column of W which corresponds to column K of A
*
KW = NB + K - N
*
* Exit from loop
*
IF( ( K.LE.N-NB+1 .AND. NB.LT.N ) .OR. K.LT.1 )
$ GO TO 30
*
KSTEP = 1
P = K
*
* Copy column K of A to column KW of W and update it
*
CALL SCOPY( K, A( 1, K ), 1, W( 1, KW ), 1 )
IF( K.LT.N )
$ CALL SGEMV( 'No transpose', K, N-K, -ONE, A( 1, K+1 ),
$ LDA, W( K, KW+1 ), LDW, ONE, W( 1, KW ), 1 )
*
* Determine rows and columns to be interchanged and whether
* a 1-by-1 or 2-by-2 pivot block will be used
*
ABSAKK = ABS( W( K, KW ) )
*
* IMAX is the row-index of the largest off-diagonal element in
* column K, and COLMAX is its absolute value.
* Determine both COLMAX and IMAX.
*
IF( K.GT.1 ) THEN
IMAX = ISAMAX( K-1, W( 1, KW ), 1 )
COLMAX = ABS( W( IMAX, KW ) )
ELSE
COLMAX = ZERO
END IF
*
IF( MAX( ABSAKK, COLMAX ).EQ.ZERO ) THEN
*
* Column K is zero or underflow: set INFO and continue
*
IF( INFO.EQ.0 )
$ INFO = K
KP = K
CALL SCOPY( K, W( 1, KW ), 1, A( 1, K ), 1 )
ELSE
*
* ============================================================
*
* Test for interchange
*
* Equivalent to testing for ABSAKK.GE.ALPHA*COLMAX
* (used to handle NaN and Inf)
*
IF( .NOT.( ABSAKK.LT.ALPHA*COLMAX ) ) THEN
*
* no interchange, use 1-by-1 pivot block
*
KP = K
*
ELSE
*
DONE = .FALSE.
*
* Loop until pivot found
*
12 CONTINUE
*
* Begin pivot search loop body
*
*
* Copy column IMAX to column KW-1 of W and update it
*
CALL SCOPY( IMAX, A( 1, IMAX ), 1, W( 1, KW-1 ), 1 )
CALL SCOPY( K-IMAX, A( IMAX, IMAX+1 ), LDA,
$ W( IMAX+1, KW-1 ), 1 )
*
IF( K.LT.N )
$ CALL SGEMV( 'No transpose', K, N-K, -ONE,
$ A( 1, K+1 ), LDA, W( IMAX, KW+1 ), LDW,
$ ONE, W( 1, KW-1 ), 1 )
*
* JMAX is the column-index of the largest off-diagonal
* element in row IMAX, and ROWMAX is its absolute value.
* Determine both ROWMAX and JMAX.
*
IF( IMAX.NE.K ) THEN
JMAX = IMAX + ISAMAX( K-IMAX, W( IMAX+1, KW-1 ),
$ 1 )
ROWMAX = ABS( W( JMAX, KW-1 ) )
ELSE
ROWMAX = ZERO
END IF
*
IF( IMAX.GT.1 ) THEN
ITEMP = ISAMAX( IMAX-1, W( 1, KW-1 ), 1 )
STEMP = ABS( W( ITEMP, KW-1 ) )
IF( STEMP.GT.ROWMAX ) THEN
ROWMAX = STEMP
JMAX = ITEMP
END IF
END IF
*
* Equivalent to testing for
* ABS( W( IMAX, KW-1 ) ).GE.ALPHA*ROWMAX
* (used to handle NaN and Inf)
*
IF( .NOT.(ABS( W( IMAX, KW-1 ) ).LT.ALPHA*ROWMAX ) )
$ THEN
*
* interchange rows and columns K and IMAX,
* use 1-by-1 pivot block
*
KP = IMAX
*
* copy column KW-1 of W to column KW of W
*
CALL SCOPY( K, W( 1, KW-1 ), 1, W( 1, KW ), 1 )
*
DONE = .TRUE.
*
* Equivalent to testing for ROWMAX.EQ.COLMAX,
* (used to handle NaN and Inf)
*
ELSE IF( ( P.EQ.JMAX ) .OR. ( ROWMAX.LE.COLMAX ) )
$ THEN
*
* interchange rows and columns K-1 and IMAX,
* use 2-by-2 pivot block
*
KP = IMAX
KSTEP = 2
DONE = .TRUE.
ELSE
*
* Pivot not found: set params and repeat
*
P = IMAX
COLMAX = ROWMAX
IMAX = JMAX
*
* Copy updated JMAXth (next IMAXth) column to Kth of W
*
CALL SCOPY( K, W( 1, KW-1 ), 1, W( 1, KW ), 1 )
*
END IF
*
* End pivot search loop body
*
IF( .NOT. DONE ) GOTO 12
*
END IF
*
* ============================================================
*
KK = K - KSTEP + 1
*
* KKW is the column of W which corresponds to column KK of A
*
KKW = NB + KK - N
*
IF( ( KSTEP.EQ.2 ) .AND. ( P.NE.K ) ) THEN
*
* Copy non-updated column K to column P
*
CALL SCOPY( K-P, A( P+1, K ), 1, A( P, P+1 ), LDA )
CALL SCOPY( P, A( 1, K ), 1, A( 1, P ), 1 )
*
* Interchange rows K and P in last N-K+1 columns of A
* and last N-K+2 columns of W
*
CALL SSWAP( N-K+1, A( K, K ), LDA, A( P, K ), LDA )
CALL SSWAP( N-KK+1, W( K, KKW ), LDW, W( P, KKW ), LDW )
END IF
*
* Updated column KP is already stored in column KKW of W
*
IF( KP.NE.KK ) THEN
*
* Copy non-updated column KK to column KP
*
A( KP, K ) = A( KK, K )
CALL SCOPY( K-1-KP, A( KP+1, KK ), 1, A( KP, KP+1 ),
$ LDA )
CALL SCOPY( KP, A( 1, KK ), 1, A( 1, KP ), 1 )
*
* Interchange rows KK and KP in last N-KK+1 columns
* of A and W
*
CALL SSWAP( N-KK+1, A( KK, KK ), LDA, A( KP, KK ), LDA )
CALL SSWAP( N-KK+1, W( KK, KKW ), LDW, W( KP, KKW ),
$ LDW )
END IF
*
IF( KSTEP.EQ.1 ) THEN
*
* 1-by-1 pivot block D(k): column KW of W now holds
*
* W(k) = U(k)*D(k)
*
* where U(k) is the k-th column of U
*
* Store U(k) in column k of A
*
CALL SCOPY( K, W( 1, KW ), 1, A( 1, K ), 1 )
IF( K.GT.1 ) THEN
IF( ABS( A( K, K ) ).GE.SFMIN ) THEN
R1 = ONE / A( K, K )
CALL SSCAL( K-1, R1, A( 1, K ), 1 )
ELSE IF( A( K, K ).NE.ZERO ) THEN
DO 14 II = 1, K - 1
A( II, K ) = A( II, K ) / A( K, K )
14 CONTINUE
END IF
END IF
*
ELSE
*
* 2-by-2 pivot block D(k): columns KW and KW-1 of W now
* hold
*
* ( W(k-1) W(k) ) = ( U(k-1) U(k) )*D(k)
*
* where U(k) and U(k-1) are the k-th and (k-1)-th columns
* of U
*
IF( K.GT.2 ) THEN
*
* Store U(k) and U(k-1) in columns k and k-1 of A
*
D12 = W( K-1, KW )
D11 = W( K, KW ) / D12
D22 = W( K-1, KW-1 ) / D12
T = ONE / ( D11*D22-ONE )
DO 20 J = 1, K - 2
A( J, K-1 ) = T*( (D11*W( J, KW-1 )-W( J, KW ) ) /
$ D12 )
A( J, K ) = T*( ( D22*W( J, KW )-W( J, KW-1 ) ) /
$ D12 )
20 CONTINUE
END IF
*
* Copy D(k) to A
*
A( K-1, K-1 ) = W( K-1, KW-1 )
A( K-1, K ) = W( K-1, KW )
A( K, K ) = W( K, KW )
END IF
END IF
*
* Store details of the interchanges in IPIV
*
IF( KSTEP.EQ.1 ) THEN
IPIV( K ) = KP
ELSE
IPIV( K ) = -P
IPIV( K-1 ) = -KP
END IF
*
* Decrease K and return to the start of the main loop
*
K = K - KSTEP
GO TO 10
*
30 CONTINUE
*
* Update the upper triangle of A11 (= A(1:k,1:k)) as
*
* A11 := A11 - U12*D*U12**T = A11 - U12*W**T
*
* computing blocks of NB columns at a time
*
DO 50 J = ( ( K-1 ) / NB )*NB + 1, 1, -NB
JB = MIN( NB, K-J+1 )
*
* Update the upper triangle of the diagonal block
*
DO 40 JJ = J, J + JB - 1
CALL SGEMV( 'No transpose', JJ-J+1, N-K, -ONE,
$ A( J, K+1 ), LDA, W( JJ, KW+1 ), LDW, ONE,
$ A( J, JJ ), 1 )
40 CONTINUE
*
* Update the rectangular superdiagonal block
*
IF( J.GE.2 )
$ CALL SGEMM( 'No transpose', 'Transpose', J-1, JB,
$ N-K, -ONE, A( 1, K+1 ), LDA, W( J, KW+1 ), LDW,
$ ONE, A( 1, J ), LDA )
50 CONTINUE
*
* Put U12 in standard form by partially undoing the interchanges
* in columns k+1:n
*
J = K + 1
60 CONTINUE
*
KSTEP = 1
JP1 = 1
JJ = J
JP2 = IPIV( J )
IF( JP2.LT.0 ) THEN
JP2 = -JP2
J = J + 1
JP1 = -IPIV( J )
KSTEP = 2
END IF
*
J = J + 1
IF( JP2.NE.JJ .AND. J.LE.N )
$ CALL SSWAP( N-J+1, A( JP2, J ), LDA, A( JJ, J ), LDA )
JJ = J - 1
IF( JP1.NE.JJ .AND. KSTEP.EQ.2 )
$ CALL SSWAP( N-J+1, A( JP1, J ), LDA, A( JJ, J ), LDA )
IF( J.LE.N )
$ GO TO 60
*
* Set KB to the number of columns factorized
*
KB = N - K
*
ELSE
*
* Factorize the leading columns of A using the lower triangle
* of A and working forwards, and compute the matrix W = L21*D
* for use in updating A22
*
* K is the main loop index, increasing from 1 in steps of 1 or 2
*
K = 1
70 CONTINUE
*
* Exit from loop
*
IF( ( K.GE.NB .AND. NB.LT.N ) .OR. K.GT.N )
$ GO TO 90
*
KSTEP = 1
P = K
*
* Copy column K of A to column K of W and update it
*
CALL SCOPY( N-K+1, A( K, K ), 1, W( K, K ), 1 )
IF( K.GT.1 )
$ CALL SGEMV( 'No transpose', N-K+1, K-1, -ONE, A( K, 1 ),
$ LDA, W( K, 1 ), LDW, ONE, W( K, K ), 1 )
*
* Determine rows and columns to be interchanged and whether
* a 1-by-1 or 2-by-2 pivot block will be used
*
ABSAKK = ABS( W( K, K ) )
*
* IMAX is the row-index of the largest off-diagonal element in
* column K, and COLMAX is its absolute value.
* Determine both COLMAX and IMAX.
*
IF( K.LT.N ) THEN
IMAX = K + ISAMAX( N-K, W( K+1, K ), 1 )
COLMAX = ABS( W( IMAX, K ) )
ELSE
COLMAX = ZERO
END IF
*
IF( MAX( ABSAKK, COLMAX ).EQ.ZERO ) THEN
*
* Column K is zero or underflow: set INFO and continue
*
IF( INFO.EQ.0 )
$ INFO = K
KP = K
CALL SCOPY( N-K+1, W( K, K ), 1, A( K, K ), 1 )
ELSE
*
* ============================================================
*
* Test for interchange
*
* Equivalent to testing for ABSAKK.GE.ALPHA*COLMAX
* (used to handle NaN and Inf)
*
IF( .NOT.( ABSAKK.LT.ALPHA*COLMAX ) ) THEN
*
* no interchange, use 1-by-1 pivot block
*
KP = K
*
ELSE
*
DONE = .FALSE.
*
* Loop until pivot found
*
72 CONTINUE
*
* Begin pivot search loop body
*
*
* Copy column IMAX to column K+1 of W and update it
*
CALL SCOPY( IMAX-K, A( IMAX, K ), LDA, W( K, K+1 ), 1)
CALL SCOPY( N-IMAX+1, A( IMAX, IMAX ), 1,
$ W( IMAX, K+1 ), 1 )
IF( K.GT.1 )
$ CALL SGEMV( 'No transpose', N-K+1, K-1, -ONE,
$ A( K, 1 ), LDA, W( IMAX, 1 ), LDW,
$ ONE, W( K, K+1 ), 1 )
*
* JMAX is the column-index of the largest off-diagonal
* element in row IMAX, and ROWMAX is its absolute value.
* Determine both ROWMAX and JMAX.
*
IF( IMAX.NE.K ) THEN
JMAX = K - 1 + ISAMAX( IMAX-K, W( K, K+1 ), 1 )
ROWMAX = ABS( W( JMAX, K+1 ) )
ELSE
ROWMAX = ZERO
END IF
*
IF( IMAX.LT.N ) THEN
ITEMP = IMAX + ISAMAX( N-IMAX, W( IMAX+1, K+1 ), 1)
STEMP = ABS( W( ITEMP, K+1 ) )
IF( STEMP.GT.ROWMAX ) THEN
ROWMAX = STEMP
JMAX = ITEMP
END IF
END IF
*
* Equivalent to testing for
* ABS( W( IMAX, K+1 ) ).GE.ALPHA*ROWMAX
* (used to handle NaN and Inf)
*
IF( .NOT.( ABS( W( IMAX, K+1 ) ).LT.ALPHA*ROWMAX ) )
$ THEN
*
* interchange rows and columns K and IMAX,
* use 1-by-1 pivot block
*
KP = IMAX
*
* copy column K+1 of W to column K of W
*
CALL SCOPY( N-K+1, W( K, K+1 ), 1, W( K, K ), 1 )
*
DONE = .TRUE.
*
* Equivalent to testing for ROWMAX.EQ.COLMAX,
* (used to handle NaN and Inf)
*
ELSE IF( ( P.EQ.JMAX ) .OR. ( ROWMAX.LE.COLMAX ) )
$ THEN
*
* interchange rows and columns K+1 and IMAX,
* use 2-by-2 pivot block
*
KP = IMAX
KSTEP = 2
DONE = .TRUE.
ELSE
*
* Pivot not found: set params and repeat
*
P = IMAX
COLMAX = ROWMAX
IMAX = JMAX
*
* Copy updated JMAXth (next IMAXth) column to Kth of W
*
CALL SCOPY( N-K+1, W( K, K+1 ), 1, W( K, K ), 1 )
*
END IF
*
* End pivot search loop body
*
IF( .NOT. DONE ) GOTO 72
*
END IF
*
* ============================================================
*
KK = K + KSTEP - 1
*
IF( ( KSTEP.EQ.2 ) .AND. ( P.NE.K ) ) THEN
*
* Copy non-updated column K to column P
*
CALL SCOPY( P-K, A( K, K ), 1, A( P, K ), LDA )
CALL SCOPY( N-P+1, A( P, K ), 1, A( P, P ), 1 )
*
* Interchange rows K and P in first K columns of A
* and first K+1 columns of W
*
CALL SSWAP( K, A( K, 1 ), LDA, A( P, 1 ), LDA )
CALL SSWAP( KK, W( K, 1 ), LDW, W( P, 1 ), LDW )
END IF
*
* Updated column KP is already stored in column KK of W
*
IF( KP.NE.KK ) THEN
*
* Copy non-updated column KK to column KP
*
A( KP, K ) = A( KK, K )
CALL SCOPY( KP-K-1, A( K+1, KK ), 1, A( KP, K+1 ), LDA )
CALL SCOPY( N-KP+1, A( KP, KK ), 1, A( KP, KP ), 1 )
*
* Interchange rows KK and KP in first KK columns of A and W
*
CALL SSWAP( KK, A( KK, 1 ), LDA, A( KP, 1 ), LDA )
CALL SSWAP( KK, W( KK, 1 ), LDW, W( KP, 1 ), LDW )
END IF
*
IF( KSTEP.EQ.1 ) THEN
*
* 1-by-1 pivot block D(k): column k of W now holds
*
* W(k) = L(k)*D(k)
*
* where L(k) is the k-th column of L
*
* Store L(k) in column k of A
*
CALL SCOPY( N-K+1, W( K, K ), 1, A( K, K ), 1 )
IF( K.LT.N ) THEN
IF( ABS( A( K, K ) ).GE.SFMIN ) THEN
R1 = ONE / A( K, K )
CALL SSCAL( N-K, R1, A( K+1, K ), 1 )
ELSE IF( A( K, K ).NE.ZERO ) THEN
DO 74 II = K + 1, N
A( II, K ) = A( II, K ) / A( K, K )
74 CONTINUE
END IF
END IF
*
ELSE
*
* 2-by-2 pivot block D(k): columns k and k+1 of W now hold
*
* ( W(k) W(k+1) ) = ( L(k) L(k+1) )*D(k)
*
* where L(k) and L(k+1) are the k-th and (k+1)-th columns
* of L
*
IF( K.LT.N-1 ) THEN
*
* Store L(k) and L(k+1) in columns k and k+1 of A
*
D21 = W( K+1, K )
D11 = W( K+1, K+1 ) / D21
D22 = W( K, K ) / D21
T = ONE / ( D11*D22-ONE )
DO 80 J = K + 2, N
A( J, K ) = T*( ( D11*W( J, K )-W( J, K+1 ) ) /
$ D21 )
A( J, K+1 ) = T*( ( D22*W( J, K+1 )-W( J, K ) ) /
$ D21 )
80 CONTINUE
END IF
*
* Copy D(k) to A
*
A( K, K ) = W( K, K )
A( K+1, K ) = W( K+1, K )
A( K+1, K+1 ) = W( K+1, K+1 )
END IF
END IF
*
* Store details of the interchanges in IPIV
*
IF( KSTEP.EQ.1 ) THEN
IPIV( K ) = KP
ELSE
IPIV( K ) = -P
IPIV( K+1 ) = -KP
END IF
*
* Increase K and return to the start of the main loop
*
K = K + KSTEP
GO TO 70
*
90 CONTINUE
*
* Update the lower triangle of A22 (= A(k:n,k:n)) as
*
* A22 := A22 - L21*D*L21**T = A22 - L21*W**T
*
* computing blocks of NB columns at a time
*
DO 110 J = K, N, NB
JB = MIN( NB, N-J+1 )
*
* Update the lower triangle of the diagonal block
*
DO 100 JJ = J, J + JB - 1
CALL SGEMV( 'No transpose', J+JB-JJ, K-1, -ONE,
$ A( JJ, 1 ), LDA, W( JJ, 1 ), LDW, ONE,
$ A( JJ, JJ ), 1 )
100 CONTINUE
*
* Update the rectangular subdiagonal block
*
IF( J+JB.LE.N )
$ CALL SGEMM( 'No transpose', 'Transpose', N-J-JB+1, JB,
$ K-1, -ONE, A( J+JB, 1 ), LDA, W( J, 1 ), LDW,
$ ONE, A( J+JB, J ), LDA )
110 CONTINUE
*
* Put L21 in standard form by partially undoing the interchanges
* in columns 1:k-1
*
J = K - 1
120 CONTINUE
*
KSTEP = 1
JP1 = 1
JJ = J
JP2 = IPIV( J )
IF( JP2.LT.0 ) THEN
JP2 = -JP2
J = J - 1
JP1 = -IPIV( J )
KSTEP = 2
END IF
*
J = J - 1
IF( JP2.NE.JJ .AND. J.GE.1 )
$ CALL SSWAP( J, A( JP2, 1 ), LDA, A( JJ, 1 ), LDA )
JJ = J + 1
IF( JP1.NE.JJ .AND. KSTEP.EQ.2 )
$ CALL SSWAP( J, A( JP1, 1 ), LDA, A( JJ, 1 ), LDA )
IF( J.GE.1 )
$ GO TO 120
*
* Set KB to the number of columns factorized
*
KB = K - 1
*
END IF
RETURN
*
* End of SLASYF_ROOK
*
END
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env python
# coding:utf-8
"Queues(Pipe)-based independent remote client-server Python Debugger"
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2011 Mariano Reingart"
__license__ = "LGPL 3.0"
__version__ = "1.01b"
# remote debugger queue-based (jsonrpc-like interface):
# - bidirectional communication (request - response calls in both ways)
# - request with id == null is a notification (do not send a response)
# - request with a value for id is a normal call, wait response
# based on idle, inspired by pythonwin implementation, taken many code from pdb
import bdb
import inspect
import linecache
import os
import sys
import traceback
import cmd
import pydoc
import threading
class Qdb(bdb.Bdb):
"Qdb Debugger Backend"
def __init__(self, pipe, redirect_stdio=True, allow_interruptions=False,
skip=[__name__]):
kwargs = {}
if sys.version_info > (2, 7):
kwargs['skip'] = skip
bdb.Bdb.__init__(self, **kwargs)
self.frame = None
self.i = 1 # sequential RPC call id
self.waiting = False
self.pipe = pipe # for communication
self._wait_for_mainpyfile = False
self._wait_for_breakpoint = False
self.mainpyfile = ""
self._lineno = None # last listed line numbre
# replace system standard input and output (send them thru the pipe)
if redirect_stdio:
sys.stdin = self
sys.stdout = self
sys.stderr = self
if allow_interruptions:
# fake breakpoint to prevent removing trace_dispatch on set_continue
self.breaks[None] = []
self.allow_interruptions = allow_interruptions
self.burst = 0 # do not send notifications ("burst" mode)
self.params = {} # optional parameters for interaction
def pull_actions(self):
# receive a remote procedure call from the frontend:
# returns True if action processed
# None when 'run' notification is received (see 'startup')
request = self.pipe.recv()
if request.get("method") == 'run':
return None
response = {'version': '1.1', 'id': request.get('id'),
'result': None,
'error': None}
try:
# dispatch message (JSON RPC like)
method = getattr(self, request['method'])
response['result'] = method.__call__(*request['args'],
**request.get('kwargs', {}))
except Exception, e:
response['error'] = {'code': 0, 'message': str(e)}
# send the result for normal method calls, not for notifications
if request.get('id'):
self.pipe.send(response)
return True
# Override Bdb methods
def trace_dispatch(self, frame, event, arg):
# check for non-interaction rpc (set_breakpoint, interrupt)
while self.allow_interruptions and self.pipe.poll():
self.pull_actions()
# process the frame (see Bdb.trace_dispatch)
if self.quitting:
return # None
if event == 'line':
return self.dispatch_line(frame)
if event == 'call':
return self.dispatch_call(frame, arg)
if event == 'return':
return self.dispatch_return(frame, arg)
if event == 'exception':
return self.dispatch_exception(frame, arg)
return self.trace_dispatch
def user_call(self, frame, argument_list):
"""This method is called when there is the remote possibility
that we ever need to stop in this function."""
if self._wait_for_mainpyfile or self._wait_for_breakpoint:
return
if self.stop_here(frame):
self.interaction(frame, None)
def user_line(self, frame):
"""This function is called when we stop or break at this line."""
if self._wait_for_mainpyfile:
if (not self.canonic(frame.f_code.co_filename).startswith(self.mainpyfile)
or frame.f_lineno<= 0):
return
self._wait_for_mainpyfile = 0
if self._wait_for_breakpoint:
if not self.break_here(frame):
return
self._wait_for_breakpoint = 0
self.interaction(frame)
def user_exception(self, frame, info):
"""This function is called if an exception occurs,
but only if we are to stop at or just below this level."""
if self._wait_for_mainpyfile or self._wait_for_breakpoint:
return
extype, exvalue, trace = info
# pre-process stack trace as it isn't pickeable (cannot be sent pure)
msg = ''.join(traceback.format_exception(extype, exvalue, trace))
trace = traceback.extract_tb(trace)
title = traceback.format_exception_only(extype, exvalue)[0]
# send an Exception notification
msg = {'method': 'exception',
'args': (title, extype.__name__, exvalue, trace, msg),
'id': None}
self.pipe.send(msg)
self.interaction(frame, info)
def run(self, code, interp=None, *args, **kwargs):
try:
return bdb.Bdb.run(self, code, *args, **kwargs)
finally:
pass
def runcall(self, function, interp=None, *args, **kwargs):
try:
self.interp = interp
return bdb.Bdb.runcall(self, function, *args, **kwargs)
finally:
pass
def _runscript(self, filename):
# The script has to run in __main__ namespace (clear it)
import __main__
import imp
__main__.__dict__.clear()
__main__.__dict__.update({"__name__" : "__main__",
"__file__" : filename,
"__builtins__": __builtins__,
"imp" : imp, # need for run
})
# avoid stopping before we reach the main script
self._wait_for_mainpyfile = 1
self.mainpyfile = self.canonic(filename)
self._user_requested_quit = 0
statement = 'imp.load_source("__main__", "%s")' % filename
# notify and wait frontend to set initial params and breakpoints
self.pipe.send({'method': 'startup', 'args': (__version__, )})
while self.pull_actions() is not None:
pass
self.run(statement)
# General interaction function
def interaction(self, frame, info=None):
# chache frame locals to ensure that modifications are not overwritten
self.frame_locals = frame and frame.f_locals or {}
# extract current filename and line number
code, lineno = frame.f_code, frame.f_lineno
filename = code.co_filename
basename = os.path.basename(filename)
message = "%s:%s" % (basename, lineno)
if code.co_name != "?":
message = "%s: %s()" % (message, code.co_name)
# wait user events
self.waiting = True
self.frame = frame
try:
while self.waiting:
# sync_source_line()
if frame and filename[:1] + filename[-1:] != "<>" and os.path.exists(filename):
line = linecache.getline(filename, self.frame.f_lineno,
self.frame.f_globals)
else:
line = ""
# send the notification (debug event) - DOESN'T WAIT RESPONSE
self.burst -= 1
if self.burst < 0:
kwargs = {}
if self.params.get('call_stack'):
kwargs['call_stack'] = self.do_where()
if self.params.get('environment'):
kwargs['environment'] = self.do_environment()
self.pipe.send({'method': 'interaction', 'id': None,
'args': (filename, self.frame.f_lineno, line),
'kwargs': kwargs})
self.pull_actions()
finally:
self.waiting = False
self.frame = None
def do_debug(self, mainpyfile=None, wait_breakpoint=1):
self.reset()
if not wait_breakpoint or mainpyfile:
self._wait_for_mainpyfile = 1
if not mainpyfile:
frame = sys._getframe().f_back
mainpyfile = frame.f_code.co_filename
self.mainpyfile = self.canonic(mainpyfile)
self._wait_for_breakpoint = wait_breakpoint
sys.settrace(self.trace_dispatch)
def set_trace(self, frame=None):
# start debugger interaction immediatelly
if frame is None:
frame = sys._getframe().f_back
self._wait_for_mainpyfile = frame.f_code.co_filename
self._wait_for_breakpoint = 0
bdb.Bdb.set_trace(self, frame)
# Command definitions, called by interaction()
def do_continue(self):
self.set_continue()
self.waiting = False
def do_step(self):
self.set_step()
self.waiting = False
def do_return(self):
self.set_return(self.frame)
self.waiting = False
def do_next(self):
self.set_next(self.frame)
self.waiting = False
def interrupt(self):
self.set_step()
def do_quit(self):
self.set_quit()
self.waiting = False
def do_jump(self, lineno):
arg = int(lineno)
try:
self.frame.f_lineno = arg
return arg
except ValueError, e:
print '*** Jump failed:', e
return False
def do_list(self, arg):
last = None
if arg:
if isinstance(arg, tuple):
first, last = arg
else:
first = arg
elif not self._lineno:
first = max(1, self.frame.f_lineno - 5)
else:
first = self._lineno + 1
if last is None:
last = first + 10
filename = self.frame.f_code.co_filename
breaklist = self.get_file_breaks(filename)
lines = []
for lineno in range(first, last+1):
line = linecache.getline(filename, lineno,
self.frame.f_globals)
if not line:
lines.append((filename, lineno, '', current, "<EOF>\n"))
break
else:
breakpoint = "B" if lineno in breaklist else ""
current = "->" if self.frame.f_lineno == lineno else ""
lines.append((filename, lineno, breakpoint, current, line))
self._lineno = lineno
return lines
def do_read(self, filename):
return open(filename, "Ur").read()
def do_set_breakpoint(self, filename, lineno, temporary=0, cond=None):
return self.set_break(filename, int(lineno), temporary, cond)
def do_list_breakpoint(self):
breaks = []
if self.breaks: # There's at least one
for bp in bdb.Breakpoint.bpbynumber:
if bp:
breaks.append((bp.number, bp.file, bp.line,
bp.temporary, bp.enabled, bp.hits, bp.cond, ))
return breaks
def do_clear_breakpoint(self, filename, lineno):
self.clear_break(filename, lineno)
def do_clear_file_breakpoints(self, filename):
self.clear_all_file_breaks(filename)
def do_clear(self, arg):
# required by BDB to remove temp breakpoints!
err = self.clear_bpbynumber(arg)
if err:
print '*** DO_CLEAR failed', err
def do_eval(self, arg, safe=True):
ret = eval(arg, self.frame.f_globals,
self.frame_locals)
if safe:
ret = pydoc.cram(repr(ret), 255)
return ret
def do_exec(self, arg):
locals = self.frame_locals
globals = self.frame.f_globals
code = compile(arg + '\n', '<stdin>', 'single')
save_displayhook = sys.displayhook
self.displayhook_value = None
try:
sys.displayhook = self.displayhook
exec code in globals, locals
finally:
sys.displayhook = save_displayhook
return self.displayhook_value
def do_where(self):
"print_stack_trace"
stack, curindex = self.get_stack(self.frame, None)
lines = []
for frame, lineno in stack:
filename = frame.f_code.co_filename
line = linecache.getline(filename, lineno)
lines.append((filename, lineno, "", "", line, ))
return lines
def do_environment(self):
"return current frame local and global environment"
env = {'locals': {}, 'globals': {}}
# converts the frame global and locals to a short text representation:
if self.frame:
for name, value in self.frame_locals.items():
env['locals'][name] = pydoc.cram(repr(value), 255), repr(type(value))
for name, value in self.frame.f_globals.items():
env['globals'][name] = pydoc.cram(repr(value), 20), repr(type(value))
return env
def get_autocomplete_list(self, expression):
"Return list of auto-completion options for expression"
try:
obj = self.do_eval(expression)
except:
return []
else:
return dir(obj)
def get_call_tip(self, expression):
"Return list of auto-completion options for expression"
try:
obj = self.do_eval(expression)
except Exception, e:
return ('', '', str(e))
else:
name = ''
try:
name = obj.__name__
except AttributeError:
pass
argspec = ''
drop_self = 0
f = None
try:
if inspect.isbuiltin(obj):
pass
elif inspect.ismethod(obj):
# Get the function from the object
f = obj.im_func
drop_self = 1
elif inspect.isclass(obj):
# Get the __init__ method function for the class.
if hasattr(obj, '__init__'):
f = obj.__init__.im_func
else:
for base in object.__bases__:
if hasattr(base, '__init__'):
f = base.__init__.im_func
break
if f is not None:
drop_self = 1
elif callable(obj):
# use the obj as a function by default
f = obj
# Get the __call__ method instead.
f = obj.__call__.im_func
drop_self = 0
except AttributeError:
pass
if f:
argspec = apply(inspect.formatargspec, inspect.getargspec(f))
doc = ''
if callable(obj):
try:
doc = inspect.getdoc(obj)
except:
pass
return (name, argspec[1:-1], doc.strip())
def set_burst(self, val):
"Set burst mode -multiple command count- (shut up notifications)"
self.burst = val
def set_params(self, params):
"Set parameters for interaction"
self.params.update(params)
def displayhook(self, obj):
"""Custom displayhook for the do_exec which prevents
assignment of the _ variable in the builtins.
"""
self.displayhook_value = repr(obj)
def reset(self):
bdb.Bdb.reset(self)
self.waiting = False
self.frame = None
def post_mortem(self, t=None):
# handling the default
if t is None:
# sys.exc_info() returns (type, value, traceback) if an exception is
# being handled, otherwise it returns None
t = sys.exc_info()[2]
if t is None:
raise ValueError("A valid traceback must be passed if no "
"exception is being handled")
self.reset()
# get last frame:
while t is not None:
frame = t.tb_frame
t = t.tb_next
code, lineno = frame.f_code, frame.f_lineno
filename = code.co_filename
line = linecache.getline(filename, lineno)
#(filename, lineno, "", current, line, )}
self.interaction(frame)
# console file-like object emulation
def readline(self):
"Replacement for stdin.readline()"
msg = {'method': 'readline', 'args': (), 'id': self.i}
self.pipe.send(msg)
msg = self.pipe.recv()
self.i += 1
return msg['result']
def readlines(self):
"Replacement for stdin.readlines()"
lines = []
while lines[-1:] != ['\n']:
lines.append(self.readline())
return lines
def write(self, text):
"Replacement for stdout.write()"
msg = {'method': 'write', 'args': (text, ), 'id': None}
self.pipe.send(msg)
def writelines(self, l):
map(self.write, l)
def flush(self):
pass
def isatty(self):
return 0
class QueuePipe(object):
"Simulated pipe for threads (using two queues)"
def __init__(self, name, in_queue, out_queue):
self.__name = name
self.in_queue = in_queue
self.out_queue = out_queue
def send(self, data):
self.out_queue.put(data, block=True)
def recv(self, count=None, timeout=None):
data = self.in_queue.get(block=True, timeout=timeout)
return data
def poll(self, timeout=None):
return not self.in_queue.empty()
def close(self):
pass
class RPCError(RuntimeError):
"Remote Error (not user exception)"
pass
class Frontend(object):
"Qdb generic Frontend interface"
def __init__(self, pipe):
self.i = 1
self.pipe = pipe
self.notifies = []
self.read_lock = threading.RLock()
self.write_lock = threading.RLock()
def recv(self):
self.read_lock.acquire()
try:
return self.pipe.recv()
finally:
self.read_lock.release()
def send(self, data):
self.write_lock.acquire()
try:
return self.pipe.send(data)
finally:
self.write_lock.release()
def startup(self):
self.send({'method': 'run', 'args': (), 'id': None})
def interaction(self, filename, lineno, line, *kwargs):
raise NotImplementedError
def exception(self, title, extype, exvalue, trace, request):
"Show a user_exception"
raise NotImplementedError
def write(self, text):
"Console output (print)"
raise NotImplementedError
def readline(self, text):
"Console input/rawinput"
raise NotImplementedError
def run(self):
"Main method dispatcher (infinite loop)"
if self.pipe:
if not self.notifies:
# wait for a message...
request = self.recv()
else:
# process an asyncronus notification received earlier
request = self.notifies.pop(0)
return self.process_message(request)
def process_message(self, request):
if request:
result = None
if request.get("error"):
# it is not supposed to get an error here
# it should be raised by the method call
raise RPCError(res['error']['message'])
elif request.get('method') == 'interaction':
self.interaction(*request.get("args"), **request.get("kwargs"))
elif request.get('method') == 'startup':
self.startup()
elif request.get('method') == 'exception':
self.exception(*request['args'])
elif request.get('method') == 'write':
self.write(*request.get("args"))
elif request.get('method') == 'readline':
result = self.readline()
if result:
response = {'version': '1.1', 'id': request.get('id'),
'result': result,
'error': None}
self.send(response)
return True
def call(self, method, *args):
"Actually call the remote method (inside the thread)"
req = {'method': method, 'args': args, 'id': self.i}
self.send(req)
self.i += 1 # increment the id
while 1:
# wait until command acknowledge (response id match the request)
res = self.recv()
if 'id' not in res or not res['id']:
# nested notification received (i.e. write)! process it!
self.process_message(res)
elif 'result' not in res:
# nested request received (i.e. readline)! process it!
self.process_message(res)
elif long(req['id']) != long(res['id']):
print "DEBUGGER wrong packet received: expecting id", req['id'], res['id']
# protocol state is unknown
elif 'error' in res and res['error']:
raise RPCError(res['error']['message'])
else:
return res['result']
def do_step(self, arg=None):
"Execute the current line, stop at the first possible occasion"
self.call('do_step')
def do_next(self, arg=None):
"Execute the current line, do not stop at function calls"
self.call('do_next')
def do_continue(self, arg=None):
"Continue execution, only stop when a breakpoint is encountered."
self.call('do_continue')
def do_return(self, arg=None):
"Continue execution until the current function returns"
self.call('do_return')
def do_jump(self, arg):
"Set the next line that will be executed."
res = self.call('do_jump', arg)
print res
def do_where(self, arg=None):
"Print a stack trace, with the most recent frame at the bottom."
return self.call('do_where')
def do_quit(self, arg=None):
"Quit from the debugger. The program being executed is aborted."
self.call('do_quit')
def do_eval(self, expr):
"Inspect the value of the expression"
return self.call('do_eval', expr)
def do_environment(self):
"List all the locals and globals variables (string representation)"
return self.call('do_environment')
def do_list(self, arg=None):
"List source code for the current file"
return self.call('do_list', arg)
def do_read(self, filename):
"Read and send a local filename"
return self.call('do_read', filename)
def do_set_breakpoint(self, filename, lineno, temporary=0, cond=None):
"Set a breakpoint at filename:breakpoint"
self.call('do_set_breakpoint', filename, lineno, temporary, cond)
def do_clear_breakpoint(self, filename, lineno):
"Remove a breakpoint at filename:breakpoint"
self.call('do_clear_breakpoint', filename, lineno)
def do_clear_file_breakpoints(self, filename):
"Remove all breakpoints at filename"
self.call('do_clear_breakpoints', filename, lineno)
def do_list_breakpoint(self):
"List all breakpoints"
return self.call('do_list_breakpoint')
def do_exec(self, statement):
return self.call('do_exec', statement)
def get_autocomplete_list(self, expression):
return self.call('get_autocomplete_list', expression)
def get_call_tip(self, expression):
return self.call('get_call_tip', expression)
def interrupt(self):
"Immediately stop at the first possible occasion (outside interaction)"
# this is a notification!, do not expect a response
req = {'method': 'interrupt', 'args': ()}
self.send(req)
def set_burst(self, value):
req = {'method': 'set_burst', 'args': (value, )}
self.send(req)
def set_params(self, params):
req = {'method': 'set_params', 'args': (params, )}
self.send(req)
class Cli(Frontend, cmd.Cmd):
"Qdb Front-end command line interface"
def __init__(self, pipe, completekey='tab', stdin=None, stdout=None, skip=None):
cmd.Cmd.__init__(self, completekey, stdin, stdout)
Frontend.__init__(self, pipe)
# redefine Frontend methods:
def run(self):
while 1:
try:
Frontend.run(self)
except KeyboardInterrupt:
print "Interupting..."
self.interrupt()
def interaction(self, filename, lineno, line):
print "> %s(%d)\n-> %s" % (filename, lineno, line),
self.filename = filename
self.cmdloop()
def exception(self, title, extype, exvalue, trace, request):
print "=" * 80
print "Exception", title
print request
print "-" * 80
def write(self, text):
print text,
def readline(self):
return raw_input()
def postcmd(self, stop, line):
return not line.startswith("h") # stop
do_h = cmd.Cmd.do_help
do_s = Frontend.do_step
do_n = Frontend.do_next
do_c = Frontend.do_continue
do_r = Frontend.do_return
do_j = Frontend.do_jump
do_q = Frontend.do_quit
def do_eval(self, args):
"Inspect the value of the expression"
print Frontend.do_eval(self, args)
def do_list(self, args):
"List source code for the current file"
lines = Frontend.do_list(self, eval(args, {}, {}) if args else None)
self.print_lines(lines)
def do_where(self, args):
"Print a stack trace, with the most recent frame at the bottom."
lines = Frontend.do_where(self)
self.print_lines(lines)
def do_environment(self, args=None):
env = Frontend.do_environment(self)
for key in env:
print "=" * 78
print key.capitalize()
print "-" * 78
for name, value in env[key].items():
print "%-12s = %s" % (name, value)
def do_list_breakpoint(self, arg=None):
"List all breakpoints"
breaks = Frontend.do_list_breakpoint(self)
print "Num File Line Temp Enab Hits Cond"
for bp in breaks:
print '%-4d%-30s%4d %4s %4s %4d %s' % bp
print
def do_set_breakpoint(self, arg):
"Set a breakpoint at filename:breakpoint"
if arg:
if ':' in arg:
args = arg.split(":")
else:
args = (self.filename, arg)
Frontend.do_set_breakpoint(self, *args)
else:
self.do_list_breakpoint()
do_b = do_set_breakpoint
do_l = do_list
do_p = do_eval
do_w = do_where
do_e = do_environment
def default(self, line):
"Default command"
if line[:1] == '!':
print self.do_exec(line[1:])
else:
print "*** Unknown command: ", line
def print_lines(self, lines):
for filename, lineno, bp, current, source in lines:
print "%s:%4d%s%s\t%s" % (filename, lineno, bp, current, source),
print
def test():
def f(pipe):
print "creating debugger"
qdb = Qdb(pipe=pipe, redirect_stdio=False)
print "set trace"
my_var = "Mariano!"
qdb.set_trace()
print "hello world!"
print "good by!"
saraza
if '--process' in sys.argv:
from multiprocessing import Process, Pipe
pipe, child_conn = Pipe()
p = Process(target=f, args=(child_conn,))
else:
from threading import Thread
from Queue import Queue
parent_queue, child_queue = Queue(), Queue()
front_conn = QueuePipe("parent", parent_queue, child_queue)
child_conn = QueuePipe("child", child_queue, parent_queue)
p = Thread(target=f, args=(child_conn,))
p.start()
import time
class Test(Frontend):
def interaction(self, *args):
print "interaction!", args
def exception(self, *args):
print "exception", args
#raise RuntimeError("exception %s" % repr(args))
qdb = Test(front_conn)
time.sleep(5)
while 1:
print "running..."
Frontend.run(qdb)
time.sleep(1)
print "do_next"
qdb.do_next()
p.join()
def connect(host="localhost", port=6000, authkey='secret password'):
"Connect to a running debugger backend"
address = (host, port)
from multiprocessing.connection import Client
print "qdb debugger fronted: waiting for connection to", address
conn = Client(address, authkey=authkey)
try:
Cli(conn).run()
except EOFError:
pass
finally:
conn.close()
def main(host='localhost', port=6000, authkey='secret password'):
"Debug a script and accept a remote frontend"
if not sys.argv[1:] or sys.argv[1] in ("--help", "-h"):
print "usage: pdb.py scriptfile [arg] ..."
sys.exit(2)
mainpyfile = sys.argv[1] # Get script filename
if not os.path.exists(mainpyfile):
print 'Error:', mainpyfile, 'does not exist'
sys.exit(1)
del sys.argv[0] # Hide "pdb.py" from argument list
# Replace pdb's dir with script's dir in front of module search path.
sys.path[0] = os.path.dirname(mainpyfile)
from multiprocessing.connection import Listener
address = (host, port) # family is deduced to be 'AF_INET'
listener = Listener(address, authkey=authkey)
print "qdb debugger backend: waiting for connection at", address
conn = listener.accept()
print 'qdb debugger backend: connected to', listener.last_accepted
# create the backend
qdb = Qdb(conn, redirect_stdio=True, allow_interruptions=True)
try:
print "running", mainpyfile
qdb._runscript(mainpyfile)
print "The program finished"
except SystemExit:
# In most cases SystemExit does not warrant a post-mortem session.
print "The program exited via sys.exit(). Exit status: ",
print sys.exc_info()[1]
raise
except:
raise
conn.close()
listener.close()
qdb = None
def set_trace(host='localhost', port=6000, authkey='secret password'):
"Simplified interface to debug running programs"
global qdb, listener, conn
from multiprocessing.connection import Listener
# only create it if not currently instantiated
if not qdb:
address = (host, port) # family is deduced to be 'AF_INET'
listener = Listener(address, authkey=authkey)
conn = listener.accept()
# create the backend
qdb = Qdb(conn)
# start debugger backend:
qdb.set_trace()
def quit():
"Remove trace and quit"
global qdb, listener, conn
if qdb:
sys.settrace(None)
qdb = None
if conn:
conn.close()
conn = None
if listener:
listener.close()
listener = None
if __name__ == '__main__':
# When invoked as main program:
if '--test' in sys.argv:
test()
# Check environment for configuration parameters:
kwargs = {}
for param in 'host', 'port', 'authkey':
if 'QDB_%s' % param.upper() in os.environ:
kwargs[param] = os.environ['QDB_%s' % param.upper()]
if not sys.argv[1:]:
# connect to a remote debbuger
connect(**kwargs)
else:
# start the debugger on a script
# reimport as global __main__ namespace is destroyed
import qdb
qdb.main(**kwargs)
| {
"pile_set_name": "Github"
} |
function(status_line)
map_set(global status "${ARGN}")
string_pad("${ARGN}" 100)
ans(str)
echo_append("\r${str}\r")
endfunction() | {
"pile_set_name": "Github"
} |
owner = SPR
controller = SPR
add_core = SPR
infra = 7
1939.4.1 = {
owner = SPA
controller = SPA
add_core = SPA
}
| {
"pile_set_name": "Github"
} |
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M22,16v-2l-8.5,-5V3.5C13.5,2.67 12.83,2 12,2s-1.5,0.67 -1.5,1.5V9L2,14v2l8.5,-2.5V19L8,20.5L8,22l4,-1l4,1l0,-1.5L13.5,19v-5.5L22,16z"/>
</vector>
| {
"pile_set_name": "Github"
} |
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_binary",
"go_library",
)
go_binary(
name = "out-of-cluster-client-configuration",
embed = [":go_default_library"],
)
go_library(
name = "go_default_library",
srcs = ["main.go"],
importpath = "k8s.io/client-go/examples/out-of-cluster-client-configuration",
deps = [
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/client-go/kubernetes:go_default_library",
"//vendor/k8s.io/client-go/tools/clientcmd:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
| {
"pile_set_name": "Github"
} |
/* -*- mode: c; c-basic-offset: 8; -*-
* vim: noexpandtab sw=8 ts=8 sts=0:
*
* Copyright (C) 2005 Oracle. All rights reserved.
*
* This program 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 2 of the License, or (at your option) any later version.
*
* This program 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 this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/
#ifndef O2CLUSTER_MASKLOG_H
#define O2CLUSTER_MASKLOG_H
/*
* For now this is a trivial wrapper around printk() that gives the critical
* ability to enable sets of debugging output at run-time. In the future this
* will almost certainly be redirected to relayfs so that it can pay a
* substantially lower heisenberg tax.
*
* Callers associate the message with a bitmask and a global bitmask is
* maintained with help from /proc. If any of the bits match the message is
* output.
*
* We must have efficient bit tests on i386 and it seems gcc still emits crazy
* code for the 64bit compare. It emits very good code for the dual unsigned
* long tests, though, completely avoiding tests that can never pass if the
* caller gives a constant bitmask that fills one of the longs with all 0s. So
* the desire is to have almost all of the calls decided on by comparing just
* one of the longs. This leads to having infrequently given bits that are
* frequently matched in the high bits.
*
* _ERROR and _NOTICE are used for messages that always go to the console and
* have appropriate KERN_ prefixes. We wrap these in our function instead of
* just calling printk() so that this can eventually make its way through
* relayfs along with the debugging messages. Everything else gets KERN_DEBUG.
* The inline tests and macro dance give GCC the opportunity to quite cleverly
* only emit the appropriage printk() when the caller passes in a constant
* mask, as is almost always the case.
*
* All this bitmask nonsense is managed from the files under
* /sys/fs/o2cb/logmask/. Reading the files gives a straightforward
* indication of which bits are allowed (allow) or denied (off/deny).
* ENTRY deny
* EXIT deny
* TCP off
* MSG off
* SOCKET off
* ERROR allow
* NOTICE allow
*
* Writing changes the state of a given bit and requires a strictly formatted
* single write() call:
*
* write(fd, "allow", 5);
*
* Echoing allow/deny/off string into the logmask files can flip the bits
* on or off as expected; here is the bash script for example:
*
* log_mask="/sys/fs/o2cb/log_mask"
* for node in ENTRY EXIT TCP MSG SOCKET ERROR NOTICE; do
* echo allow >"$log_mask"/"$node"
* done
*
* The debugfs.ocfs2 tool can also flip the bits with the -l option:
*
* debugfs.ocfs2 -l TCP allow
*/
/* for task_struct */
#include <linux/sched.h>
/* bits that are frequently given and infrequently matched in the low word */
/* NOTE: If you add a flag, you need to also update masklog.c! */
#define ML_TCP 0x0000000000000001ULL /* net cluster/tcp.c */
#define ML_MSG 0x0000000000000002ULL /* net network messages */
#define ML_SOCKET 0x0000000000000004ULL /* net socket lifetime */
#define ML_HEARTBEAT 0x0000000000000008ULL /* hb all heartbeat tracking */
#define ML_HB_BIO 0x0000000000000010ULL /* hb io tracing */
#define ML_DLMFS 0x0000000000000020ULL /* dlm user dlmfs */
#define ML_DLM 0x0000000000000040ULL /* dlm general debugging */
#define ML_DLM_DOMAIN 0x0000000000000080ULL /* dlm domain debugging */
#define ML_DLM_THREAD 0x0000000000000100ULL /* dlm domain thread */
#define ML_DLM_MASTER 0x0000000000000200ULL /* dlm master functions */
#define ML_DLM_RECOVERY 0x0000000000000400ULL /* dlm master functions */
#define ML_DLM_GLUE 0x0000000000000800ULL /* ocfs2 dlm glue layer */
#define ML_VOTE 0x0000000000001000ULL /* ocfs2 node messaging */
#define ML_CONN 0x0000000000002000ULL /* net connection management */
#define ML_QUORUM 0x0000000000004000ULL /* net connection quorum */
#define ML_BASTS 0x0000000000008000ULL /* dlmglue asts and basts */
#define ML_CLUSTER 0x0000000000010000ULL /* cluster stack */
/* bits that are infrequently given and frequently matched in the high word */
#define ML_ERROR 0x1000000000000000ULL /* sent to KERN_ERR */
#define ML_NOTICE 0x2000000000000000ULL /* setn to KERN_NOTICE */
#define ML_KTHREAD 0x4000000000000000ULL /* kernel thread activity */
#define MLOG_INITIAL_AND_MASK (ML_ERROR|ML_NOTICE)
#ifndef MLOG_MASK_PREFIX
#define MLOG_MASK_PREFIX 0
#endif
/*
* When logging is disabled, force the bit test to 0 for anything other
* than errors and notices, allowing gcc to remove the code completely.
* When enabled, allow all masks.
*/
#if defined(CONFIG_OCFS2_DEBUG_MASKLOG)
#define ML_ALLOWED_BITS ~0
#else
#define ML_ALLOWED_BITS (ML_ERROR|ML_NOTICE)
#endif
#define MLOG_MAX_BITS 64
struct mlog_bits {
unsigned long words[MLOG_MAX_BITS / BITS_PER_LONG];
};
extern struct mlog_bits mlog_and_bits, mlog_not_bits;
#if BITS_PER_LONG == 32
#define __mlog_test_u64(mask, bits) \
( (u32)(mask & 0xffffffff) & bits.words[0] || \
((u64)(mask) >> 32) & bits.words[1] )
#define __mlog_set_u64(mask, bits) do { \
bits.words[0] |= (u32)(mask & 0xffffffff); \
bits.words[1] |= (u64)(mask) >> 32; \
} while (0)
#define __mlog_clear_u64(mask, bits) do { \
bits.words[0] &= ~((u32)(mask & 0xffffffff)); \
bits.words[1] &= ~((u64)(mask) >> 32); \
} while (0)
#define MLOG_BITS_RHS(mask) { \
{ \
[0] = (u32)(mask & 0xffffffff), \
[1] = (u64)(mask) >> 32, \
} \
}
#else /* 32bit long above, 64bit long below */
#define __mlog_test_u64(mask, bits) ((mask) & bits.words[0])
#define __mlog_set_u64(mask, bits) do { \
bits.words[0] |= (mask); \
} while (0)
#define __mlog_clear_u64(mask, bits) do { \
bits.words[0] &= ~(mask); \
} while (0)
#define MLOG_BITS_RHS(mask) { { (mask) } }
#endif
/*
* smp_processor_id() "helpfully" screams when called outside preemptible
* regions in current kernels. sles doesn't have the variants that don't
* scream. just do this instead of trying to guess which we're building
* against.. *sigh*.
*/
#define __mlog_cpu_guess ({ \
unsigned long _cpu = get_cpu(); \
put_cpu(); \
_cpu; \
})
/* In the following two macros, the whitespace after the ',' just
* before ##args is intentional. Otherwise, gcc 2.95 will eat the
* previous token if args expands to nothing.
*/
#define __mlog_printk(level, fmt, args...) \
printk(level "(%s,%u,%lu):%s:%d " fmt, current->comm, \
task_pid_nr(current), __mlog_cpu_guess, \
__PRETTY_FUNCTION__, __LINE__ , ##args)
#define mlog(mask, fmt, args...) do { \
u64 __m = MLOG_MASK_PREFIX | (mask); \
if ((__m & ML_ALLOWED_BITS) && \
__mlog_test_u64(__m, mlog_and_bits) && \
!__mlog_test_u64(__m, mlog_not_bits)) { \
if (__m & ML_ERROR) \
__mlog_printk(KERN_ERR, "ERROR: "fmt , ##args); \
else if (__m & ML_NOTICE) \
__mlog_printk(KERN_NOTICE, fmt , ##args); \
else __mlog_printk(KERN_INFO, fmt , ##args); \
} \
} while (0)
#define mlog_errno(st) do { \
int _st = (st); \
if (_st != -ERESTARTSYS && _st != -EINTR && \
_st != AOP_TRUNCATED_PAGE && _st != -ENOSPC) \
mlog(ML_ERROR, "status = %lld\n", (long long)_st); \
} while (0)
#define mlog_bug_on_msg(cond, fmt, args...) do { \
if (cond) { \
mlog(ML_ERROR, "bug expression: " #cond "\n"); \
mlog(ML_ERROR, fmt, ##args); \
BUG(); \
} \
} while (0)
#include <linux/kobject.h>
#include <linux/sysfs.h>
int mlog_sys_init(struct kset *o2cb_subsys);
void mlog_sys_shutdown(void);
#endif /* O2CLUSTER_MASKLOG_H */
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C99E3C420D63D5219CE57E33"
BuildableName = "App.app"
BlueprintName = "App"
ReferencedContainer = "container:SPM.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
onlyGenerateCoverageForSpecifiedTargets = "NO"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C99E3C420D63D5219CE57E33"
BuildableName = "App.app"
BlueprintName = "App"
ReferencedContainer = "container:SPM.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CommandLineArguments>
</CommandLineArguments>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C99E3C420D63D5219CE57E33"
BuildableName = "App.app"
BlueprintName = "App"
ReferencedContainer = "container:SPM.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "C99E3C420D63D5219CE57E33"
BuildableName = "App.app"
BlueprintName = "App"
ReferencedContainer = "container:SPM.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
| {
"pile_set_name": "Github"
} |
-----BEGIN CERTIFICATE-----
MIIC5jCCAk+gAwIBAgIBADANBgkqhkiG9w0BAQQFADBcMQswCQYDVQQGEwJBVTET
MBEGA1UECBMKUXVlZW5zbGFuZDEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQx
HDAaBgNVBAMTE1Rlc3QgUENBICgxMDI0IGJpdCkwHhcNOTkxMjAyMjEzNTQ4WhcN
MDUwNzExMjEzNTQ4WjBcMQswCQYDVQQGEwJBVTETMBEGA1UECBMKUXVlZW5zbGFu
ZDEaMBgGA1UEChMRQ3J5cHRTb2Z0IFB0eSBMdGQxHDAaBgNVBAMTE1Rlc3QgUENB
ICgxMDI0IGJpdCkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJ2haT/f5Zwy
V+MiuSDjSR62adBoSiBB7Usty44lXqsp9RICw+DCCxpsn/CfxPEDXLLd4olsWXc6
JRcxGynbYmnzk+Z6aIPPJQhK3CTvaqGnWKZsA1m+WaUIUqJCuNTK4N+7hMAGaf6S
S3e9HVgEQ4a34gXJ7VQFVIBNV1EnZRWHAgMBAAGjgbcwgbQwHQYDVR0OBBYEFE0R
aEcrj18q1dw+G6nJbsTWR213MIGEBgNVHSMEfTB7gBRNEWhHK49fKtXcPhupyW7E
1kdtd6FgpF4wXDELMAkGA1UEBhMCQVUxEzARBgNVBAgTClF1ZWVuc2xhbmQxGjAY
BgNVBAoTEUNyeXB0U29mdCBQdHkgTHRkMRwwGgYDVQQDExNUZXN0IFBDQSAoMTAy
NCBiaXQpggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAUa8B3pho
+Mvxeq9HsEzJxHIFQla05S5J/e/V+DQTYoKiRFchKPrDAdrzYSEvP3h4QJEtsNqQ
JfOxg5M42uLFq7aPGWkF6ZZqZsYS+zA9IVT14g7gNA6Ne+5QtJqQtH9HA24st0T0
Tga/lZ9M2ovImovaxSL/kRHbpCWcqWVxpOw=
-----END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQCdoWk/3+WcMlfjIrkg40ketmnQaEogQe1LLcuOJV6rKfUSAsPg
wgsabJ/wn8TxA1yy3eKJbFl3OiUXMRsp22Jp85PmemiDzyUIStwk72qhp1imbANZ
vlmlCFKiQrjUyuDfu4TABmn+kkt3vR1YBEOGt+IFye1UBVSATVdRJ2UVhwIDAQAB
AoGAba4fTtuap5l7/8ZsbE7Z1O32KJY4ZcOZukLOLUUhXxXduT+FTgGWujc0/rgc
z9qYCLlNZHOouMYTgtSfYvuMuLZ11VIt0GYH+nRioLShE59Yy+zCRyC+gPigS1kz
xvo14AsOIPYV14Tk/SsHyq6E0eTk7VzaIE197giiINUERPECQQDSKmtPTh/lRKw7
HSZSM0I1mFWn/1zqrAbontRQY5w98QWIOe5qmzYyFbPXYT3d9BzlsMyhgiRNoBbD
yvohSHXJAkEAwAHx6ezAZeWWzD5yXD36nyjpkVCw7Tk7TSmOceLJMWt1QcrCfqlS
xA5jjpQ6Z8suU5DdtWAryM2sAir1WisYzwJAd6Zcx56jvAQ3xcPXsE6scBTVFzrj
7FqZ6E+cclPzfLQ+QQsyOBE7bpI6e/FJppY26XGZXo3YGzV8IGXrt40oOQJALETG
h86EFXo3qGOFbmsDy4pdP5nBERCu8X1xUCSfintiD4c2DInxgS5oGclnJeMcjTvL
QjQoJCX3UJCi/OUO1QJBAKgcDHWjMvt+l1pjJBsSEZ0HX9AAIIVx0RQmbFGS+F2Q
hhu5l77WnnZOQ9vvhV5u7NPCUF9nhU3jh60qWWO8mkc=
-----END RSA PRIVATE KEY-----
| {
"pile_set_name": "Github"
} |
/*
* 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 org.apache.commons.math3.ode.nonstiff;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Random;
import org.apache.commons.math3.exception.DimensionMismatchException;
import org.apache.commons.math3.exception.MaxCountExceededException;
import org.apache.commons.math3.exception.NoBracketingException;
import org.apache.commons.math3.exception.NumberIsTooSmallException;
import org.apache.commons.math3.ode.ContinuousOutputModel;
import org.apache.commons.math3.ode.EquationsMapper;
import org.apache.commons.math3.ode.TestProblem1;
import org.apache.commons.math3.ode.TestProblem3;
import org.apache.commons.math3.ode.sampling.StepHandler;
import org.apache.commons.math3.ode.sampling.StepInterpolatorTestUtils;
import org.apache.commons.math3.util.FastMath;
import org.junit.Assert;
import org.junit.Test;
public class EulerStepInterpolatorTest {
@Test
public void noReset() throws MaxCountExceededException {
double[] y = { 0.0, 1.0, -2.0 };
double[][] yDot = { { 1.0, 2.0, -2.0 } };
EulerStepInterpolator interpolator = new EulerStepInterpolator();
interpolator.reinitialize(new DummyIntegrator(interpolator), y, yDot, true,
new EquationsMapper(0, y.length),
new EquationsMapper[0]);
interpolator.storeTime(0);
interpolator.shift();
interpolator.storeTime(1);
double[] result = interpolator.getInterpolatedState();
for (int i = 0; i < result.length; ++i) {
Assert.assertTrue(FastMath.abs(result[i] - y[i]) < 1.0e-10);
}
}
@Test
public void interpolationAtBounds() throws MaxCountExceededException {
double t0 = 0;
double[] y0 = {0.0, 1.0, -2.0};
double[] y = y0.clone();
double[][] yDot = { new double[y0.length] };
EulerStepInterpolator interpolator = new EulerStepInterpolator();
interpolator.reinitialize(new DummyIntegrator(interpolator), y, yDot, true,
new EquationsMapper(0, y.length),
new EquationsMapper[0]);
interpolator.storeTime(t0);
double dt = 1.0;
interpolator.shift();
y[0] = 1.0;
y[1] = 3.0;
y[2] = -4.0;
yDot[0][0] = (y[0] - y0[0]) / dt;
yDot[0][1] = (y[1] - y0[1]) / dt;
yDot[0][2] = (y[2] - y0[2]) / dt;
interpolator.storeTime(t0 + dt);
interpolator.setInterpolatedTime(interpolator.getPreviousTime());
double[] result = interpolator.getInterpolatedState();
for (int i = 0; i < result.length; ++i) {
Assert.assertTrue(FastMath.abs(result[i] - y0[i]) < 1.0e-10);
}
interpolator.setInterpolatedTime(interpolator.getCurrentTime());
result = interpolator.getInterpolatedState();
for (int i = 0; i < result.length; ++i) {
Assert.assertTrue(FastMath.abs(result[i] - y[i]) < 1.0e-10);
}
}
@Test
public void interpolationInside() throws MaxCountExceededException {
double[] y = { 0.0, 1.0, -2.0 };
double[][] yDot = { { 1.0, 2.0, -2.0 } };
EulerStepInterpolator interpolator = new EulerStepInterpolator();
interpolator.reinitialize(new DummyIntegrator(interpolator), y, yDot, true,
new EquationsMapper(0, y.length),
new EquationsMapper[0]);
interpolator.storeTime(0);
interpolator.shift();
y[0] = 1.0;
y[1] = 3.0;
y[2] = -4.0;
interpolator.storeTime(1);
interpolator.setInterpolatedTime(0.1);
double[] result = interpolator.getInterpolatedState();
Assert.assertTrue(FastMath.abs(result[0] - 0.1) < 1.0e-10);
Assert.assertTrue(FastMath.abs(result[1] - 1.2) < 1.0e-10);
Assert.assertTrue(FastMath.abs(result[2] + 2.2) < 1.0e-10);
interpolator.setInterpolatedTime(0.5);
result = interpolator.getInterpolatedState();
Assert.assertTrue(FastMath.abs(result[0] - 0.5) < 1.0e-10);
Assert.assertTrue(FastMath.abs(result[1] - 2.0) < 1.0e-10);
Assert.assertTrue(FastMath.abs(result[2] + 3.0) < 1.0e-10);
}
@Test
public void derivativesConsistency()
throws DimensionMismatchException, NumberIsTooSmallException,
MaxCountExceededException, NoBracketingException {
TestProblem3 pb = new TestProblem3();
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
EulerIntegrator integ = new EulerIntegrator(step);
StepInterpolatorTestUtils.checkDerivativesConsistency(integ, pb, 1.0e-10);
}
@Test
public void serialization()
throws IOException, ClassNotFoundException,
DimensionMismatchException, NumberIsTooSmallException,
MaxCountExceededException, NoBracketingException {
TestProblem1 pb = new TestProblem1();
double step = (pb.getFinalTime() - pb.getInitialTime()) * 0.001;
EulerIntegrator integ = new EulerIntegrator(step);
integ.addStepHandler(new ContinuousOutputModel());
integ.integrate(pb,
pb.getInitialTime(), pb.getInitialState(),
pb.getFinalTime(), new double[pb.getDimension()]);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
for (StepHandler handler : integ.getStepHandlers()) {
oos.writeObject(handler);
}
ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray());
ObjectInputStream ois = new ObjectInputStream(bis);
ContinuousOutputModel cm = (ContinuousOutputModel) ois.readObject();
Random random = new Random(347588535632l);
double maxError = 0.0;
for (int i = 0; i < 1000; ++i) {
double r = random.nextDouble();
double time = r * pb.getInitialTime() + (1.0 - r) * pb.getFinalTime();
cm.setInterpolatedTime(time);
double[] interpolatedY = cm.getInterpolatedState ();
double[] theoreticalY = pb.computeTheoreticalState(time);
double dx = interpolatedY[0] - theoreticalY[0];
double dy = interpolatedY[1] - theoreticalY[1];
double error = dx * dx + dy * dy;
if (error > maxError) {
maxError = error;
}
}
Assert.assertTrue(maxError < 0.001);
}
private static class DummyIntegrator extends RungeKuttaIntegrator {
protected DummyIntegrator(RungeKuttaStepInterpolator prototype) {
super("dummy", new double[0], new double[0][0], new double[0], prototype, Double.NaN);
}
}
}
| {
"pile_set_name": "Github"
} |
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-try-statement-runtime-semantics-evaluation
description: Abrupt completion from catch block calls UpdatEmpty()
info: |
13.15.8 Runtime Semantics: Evaluation
TryStatement : try Block Catch
...
2. If B.[[Type]] is throw, let C be CatchClauseEvaluation of Catch with parameter B.[[Value]].
...
4. Return Completion(UpdateEmpty(C, undefined)).
---*/
// Ensure the completion value from the first iteration ('bad completion') is not returned.
var completion = eval("for (var i = 0; i < 2; ++i) { if (i) { try { throw null; } catch (e) { break; } } 'bad completion'; }");
assert.sameValue(completion, undefined);
| {
"pile_set_name": "Github"
} |
task Stage {
Push-Location "$PSScriptRoot"
Copy-Item "$PSScriptRoot\UniversalDashboard.Map.psm1" "$PSScriptRoot\output\UniversalDashboard.Map.psm1" -Force
Get-ChildItem "$PSScriptRoot\Scripts" -File -Recurse -Filter "*.ps1" | ForEach-Object {
Get-Content $_.FullName -Raw | Out-File "$PSScriptRoot\output\UniversalDashboard.Map.psm1" -Append -Encoding UTF8
}
Copy-Item "$PSScriptRoot\UniversalDashboard.Map.psd1" "$PSScriptRoot\output"
Pop-Location
}
task Build {
Remove-Item "$PSScriptRoot\output" -Recurse -Force -ErrorAction SilentlyContinue
Push-Location "$PSScriptRoot"
& {
$ErrorActionPreference = 'SilentlyContinue'
npm install
npm run build
}
Pop-Location
}
task . Build, Stage | {
"pile_set_name": "Github"
} |
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M6,18C6,18.55 6.45,19 7,19H8V22.5C8,23.33 8.67,24 9.5,24C10.33,24 11,23.33 11,22.5V19H13V22.5C13,23.33 13.67,24 14.5,24C15.33,24 16,23.33 16,22.5V19H17C17.55,19 18,18.55 18,18V8H6V18ZM3.5,8C2.67,8 2,8.67 2,9.5V16.5C2,17.33 2.67,18 3.5,18C4.33,18 5,17.33 5,16.5V9.5C5,8.67 4.33,8 3.5,8ZM20.5,8C19.67,8 19,8.67 19,9.5V16.5C19,17.33 19.67,18 20.5,18C21.33,18 22,17.33 22,16.5V9.5C22,8.67 21.33,8 20.5,8ZM15.53,2.16L16.83,0.86C17.03,0.66 17.03,0.35 16.83,0.15C16.63,-0.05 16.32,-0.05 16.12,0.15L14.64,1.63C13.85,1.23 12.95,1 12,1C11.04,1 10.14,1.23 9.34,1.63L7.85,0.15C7.65,-0.05 7.34,-0.05 7.14,0.15C6.94,0.35 6.94,0.66 7.14,0.86L8.45,2.17C6.97,3.26 6,5.01 6,7H18C18,5.01 17.03,3.25 15.53,2.16ZM10,5H9V4H10V5ZM15,5H14V4H15V5Z"
android:fillColor="#727272"/>
</vector>
| {
"pile_set_name": "Github"
} |
{
"images" : [
{
"idiom" : "universal",
"filename" : "AS.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "AS@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "AS@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
} | {
"pile_set_name": "Github"
} |
/*
Copyright (c) 2003-2010 Niels Kokholm and Peter Sestoft
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
using System.Reflection;
using System.Runtime.CompilerServices;
using System;
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("C5: Copenhagen Comprehensive Collection Classes for CLI")]
[assembly: AssemblyDescription("This is a build of release 1.1.1")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("(c) 2003-2010 Niels Kokholm and Peter Sestoft")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.1.1")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyDelaySign(true)]
[assembly: CLSCompliant(true)]
| {
"pile_set_name": "Github"
} |
""" Tests for the unicodedata module.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import hashlib
from http.client import HTTPException
import sys
import unicodedata
import unittest
from test.support import open_urlresource, requires_resource, script_helper
class UnicodeMethodsTest(unittest.TestCase):
# update this, if the database changes
expectedchecksum = 'fbdf8106a3c7c242086b0a9efa03ad4d30d5b85d'
@requires_resource('cpu')
def test_method_checksum(self):
h = hashlib.sha1()
for i in range(sys.maxunicode + 1):
char = chr(i)
data = [
# Predicates (single char)
"01"[char.isalnum()],
"01"[char.isalpha()],
"01"[char.isdecimal()],
"01"[char.isdigit()],
"01"[char.islower()],
"01"[char.isnumeric()],
"01"[char.isspace()],
"01"[char.istitle()],
"01"[char.isupper()],
# Predicates (multiple chars)
"01"[(char + 'abc').isalnum()],
"01"[(char + 'abc').isalpha()],
"01"[(char + '123').isdecimal()],
"01"[(char + '123').isdigit()],
"01"[(char + 'abc').islower()],
"01"[(char + '123').isnumeric()],
"01"[(char + ' \t').isspace()],
"01"[(char + 'abc').istitle()],
"01"[(char + 'ABC').isupper()],
# Mappings (single char)
char.lower(),
char.upper(),
char.title(),
# Mappings (multiple chars)
(char + 'abc').lower(),
(char + 'ABC').upper(),
(char + 'abc').title(),
(char + 'ABC').title(),
]
h.update(''.join(data).encode('utf-8', 'surrogatepass'))
result = h.hexdigest()
self.assertEqual(result, self.expectedchecksum)
class UnicodeDatabaseTest(unittest.TestCase):
db = unicodedata
class UnicodeFunctionsTest(UnicodeDatabaseTest):
# Update this if the database changes. Make sure to do a full rebuild
# (e.g. 'make distclean && make') to get the correct checksum.
expectedchecksum = 'd1e37a2854df60ac607b47b51189b9bf1b54bfdb'
@requires_resource('cpu')
def test_function_checksum(self):
data = []
h = hashlib.sha1()
for i in range(sys.maxunicode + 1):
char = chr(i)
data = [
# Properties
format(self.db.digit(char, -1), '.12g'),
format(self.db.numeric(char, -1), '.12g'),
format(self.db.decimal(char, -1), '.12g'),
self.db.category(char),
self.db.bidirectional(char),
self.db.decomposition(char),
str(self.db.mirrored(char)),
str(self.db.combining(char)),
]
h.update(''.join(data).encode("ascii"))
result = h.hexdigest()
self.assertEqual(result, self.expectedchecksum)
def test_digit(self):
self.assertEqual(self.db.digit('A', None), None)
self.assertEqual(self.db.digit('9'), 9)
self.assertEqual(self.db.digit('\u215b', None), None)
self.assertEqual(self.db.digit('\u2468'), 9)
self.assertEqual(self.db.digit('\U00020000', None), None)
self.assertEqual(self.db.digit('\U0001D7FD'), 7)
self.assertRaises(TypeError, self.db.digit)
self.assertRaises(TypeError, self.db.digit, 'xx')
self.assertRaises(ValueError, self.db.digit, 'x')
def test_numeric(self):
self.assertEqual(self.db.numeric('A',None), None)
self.assertEqual(self.db.numeric('9'), 9)
self.assertEqual(self.db.numeric('\u215b'), 0.125)
self.assertEqual(self.db.numeric('\u2468'), 9.0)
self.assertEqual(self.db.numeric('\ua627'), 7.0)
self.assertEqual(self.db.numeric('\U00020000', None), None)
self.assertEqual(self.db.numeric('\U0001012A'), 9000)
self.assertRaises(TypeError, self.db.numeric)
self.assertRaises(TypeError, self.db.numeric, 'xx')
self.assertRaises(ValueError, self.db.numeric, 'x')
def test_decimal(self):
self.assertEqual(self.db.decimal('A',None), None)
self.assertEqual(self.db.decimal('9'), 9)
self.assertEqual(self.db.decimal('\u215b', None), None)
self.assertEqual(self.db.decimal('\u2468', None), None)
self.assertEqual(self.db.decimal('\U00020000', None), None)
self.assertEqual(self.db.decimal('\U0001D7FD'), 7)
self.assertRaises(TypeError, self.db.decimal)
self.assertRaises(TypeError, self.db.decimal, 'xx')
self.assertRaises(ValueError, self.db.decimal, 'x')
def test_category(self):
self.assertEqual(self.db.category('\uFFFE'), 'Cn')
self.assertEqual(self.db.category('a'), 'Ll')
self.assertEqual(self.db.category('A'), 'Lu')
self.assertEqual(self.db.category('\U00020000'), 'Lo')
self.assertEqual(self.db.category('\U0001012A'), 'No')
self.assertRaises(TypeError, self.db.category)
self.assertRaises(TypeError, self.db.category, 'xx')
def test_bidirectional(self):
self.assertEqual(self.db.bidirectional('\uFFFE'), '')
self.assertEqual(self.db.bidirectional(' '), 'WS')
self.assertEqual(self.db.bidirectional('A'), 'L')
self.assertEqual(self.db.bidirectional('\U00020000'), 'L')
self.assertRaises(TypeError, self.db.bidirectional)
self.assertRaises(TypeError, self.db.bidirectional, 'xx')
def test_decomposition(self):
self.assertEqual(self.db.decomposition('\uFFFE'),'')
self.assertEqual(self.db.decomposition('\u00bc'), '<fraction> 0031 2044 0034')
self.assertRaises(TypeError, self.db.decomposition)
self.assertRaises(TypeError, self.db.decomposition, 'xx')
def test_mirrored(self):
self.assertEqual(self.db.mirrored('\uFFFE'), 0)
self.assertEqual(self.db.mirrored('a'), 0)
self.assertEqual(self.db.mirrored('\u2201'), 1)
self.assertEqual(self.db.mirrored('\U00020000'), 0)
self.assertRaises(TypeError, self.db.mirrored)
self.assertRaises(TypeError, self.db.mirrored, 'xx')
def test_combining(self):
self.assertEqual(self.db.combining('\uFFFE'), 0)
self.assertEqual(self.db.combining('a'), 0)
self.assertEqual(self.db.combining('\u20e1'), 230)
self.assertEqual(self.db.combining('\U00020000'), 0)
self.assertRaises(TypeError, self.db.combining)
self.assertRaises(TypeError, self.db.combining, 'xx')
def test_pr29(self):
# https://www.unicode.org/review/pr-29.html
# See issues #1054943 and #10254.
composed = ("\u0b47\u0300\u0b3e", "\u1100\u0300\u1161",
'Li\u030dt-s\u1e73\u0301',
'\u092e\u093e\u0930\u094d\u0915 \u091c\u093c'
+ '\u0941\u0915\u0947\u0930\u092c\u0930\u094d\u0917',
'\u0915\u093f\u0930\u094d\u0917\u093f\u091c\u093c'
+ '\u0938\u094d\u0924\u093e\u0928')
for text in composed:
self.assertEqual(self.db.normalize('NFC', text), text)
def test_issue10254(self):
# Crash reported in #10254
a = 'C\u0338' * 20 + 'C\u0327'
b = 'C\u0338' * 20 + '\xC7'
self.assertEqual(self.db.normalize('NFC', a), b)
def test_issue29456(self):
# Fix #29456
u1176_str_a = '\u1100\u1176\u11a8'
u1176_str_b = '\u1100\u1176\u11a8'
u11a7_str_a = '\u1100\u1175\u11a7'
u11a7_str_b = '\uae30\u11a7'
u11c3_str_a = '\u1100\u1175\u11c3'
u11c3_str_b = '\uae30\u11c3'
self.assertEqual(self.db.normalize('NFC', u1176_str_a), u1176_str_b)
self.assertEqual(self.db.normalize('NFC', u11a7_str_a), u11a7_str_b)
self.assertEqual(self.db.normalize('NFC', u11c3_str_a), u11c3_str_b)
def test_east_asian_width(self):
eaw = self.db.east_asian_width
self.assertRaises(TypeError, eaw, b'a')
self.assertRaises(TypeError, eaw, bytearray())
self.assertRaises(TypeError, eaw, '')
self.assertRaises(TypeError, eaw, 'ra')
self.assertEqual(eaw('\x1e'), 'N')
self.assertEqual(eaw('\x20'), 'Na')
self.assertEqual(eaw('\uC894'), 'W')
self.assertEqual(eaw('\uFF66'), 'H')
self.assertEqual(eaw('\uFF1F'), 'F')
self.assertEqual(eaw('\u2010'), 'A')
self.assertEqual(eaw('\U00020000'), 'W')
def test_east_asian_width_9_0_changes(self):
self.assertEqual(self.db.ucd_3_2_0.east_asian_width('\u231a'), 'N')
self.assertEqual(self.db.east_asian_width('\u231a'), 'W')
class UnicodeMiscTest(UnicodeDatabaseTest):
def test_failed_import_during_compiling(self):
# Issue 4367
# Decoding \N escapes requires the unicodedata module. If it can't be
# imported, we shouldn't segfault.
# This program should raise a SyntaxError in the eval.
code = "import sys;" \
"sys.modules['unicodedata'] = None;" \
"""eval("'\\\\N{SOFT HYPHEN}'")"""
# We use a separate process because the unicodedata module may already
# have been loaded in this process.
result = script_helper.assert_python_failure("-c", code)
error = "SyntaxError: (unicode error) \\N escapes not supported " \
"(can't load unicodedata module)"
self.assertIn(error, result.err.decode("ascii"))
def test_decimal_numeric_consistent(self):
# Test that decimal and numeric are consistent,
# i.e. if a character has a decimal value,
# its numeric value should be the same.
count = 0
for i in range(0x10000):
c = chr(i)
dec = self.db.decimal(c, -1)
if dec != -1:
self.assertEqual(dec, self.db.numeric(c))
count += 1
self.assertTrue(count >= 10) # should have tested at least the ASCII digits
def test_digit_numeric_consistent(self):
# Test that digit and numeric are consistent,
# i.e. if a character has a digit value,
# its numeric value should be the same.
count = 0
for i in range(0x10000):
c = chr(i)
dec = self.db.digit(c, -1)
if dec != -1:
self.assertEqual(dec, self.db.numeric(c))
count += 1
self.assertTrue(count >= 10) # should have tested at least the ASCII digits
def test_bug_1704793(self):
self.assertEqual(self.db.lookup("GOTHIC LETTER FAIHU"), '\U00010346')
def test_ucd_510(self):
import unicodedata
# In UCD 5.1.0, a mirrored property changed wrt. UCD 3.2.0
self.assertTrue(unicodedata.mirrored("\u0f3a"))
self.assertTrue(not unicodedata.ucd_3_2_0.mirrored("\u0f3a"))
# Also, we now have two ways of representing
# the upper-case mapping: as delta, or as absolute value
self.assertTrue("a".upper()=='A')
self.assertTrue("\u1d79".upper()=='\ua77d')
self.assertTrue(".".upper()=='.')
def test_bug_5828(self):
self.assertEqual("\u1d79".lower(), "\u1d79")
# Only U+0000 should have U+0000 as its upper/lower/titlecase variant
self.assertEqual(
[
c for c in range(sys.maxunicode+1)
if "\x00" in chr(c).lower()+chr(c).upper()+chr(c).title()
],
[0]
)
def test_bug_4971(self):
# LETTER DZ WITH CARON: DZ, Dz, dz
self.assertEqual("\u01c4".title(), "\u01c5")
self.assertEqual("\u01c5".title(), "\u01c5")
self.assertEqual("\u01c6".title(), "\u01c5")
def test_linebreak_7643(self):
for i in range(0x10000):
lines = (chr(i) + 'A').splitlines()
if i in (0x0a, 0x0b, 0x0c, 0x0d, 0x85,
0x1c, 0x1d, 0x1e, 0x2028, 0x2029):
self.assertEqual(len(lines), 2,
r"\u%.4x should be a linebreak" % i)
else:
self.assertEqual(len(lines), 1,
r"\u%.4x should not be a linebreak" % i)
class NormalizationTest(unittest.TestCase):
@staticmethod
def check_version(testfile):
hdr = testfile.readline()
return unicodedata.unidata_version in hdr
@staticmethod
def unistr(data):
data = [int(x, 16) for x in data.split(" ")]
return "".join([chr(x) for x in data])
def test_normalization(self):
TESTDATAFILE = "NormalizationTest.txt"
TESTDATAURL = f"http://www.pythontest.net/unicode/{unicodedata.unidata_version}/{TESTDATAFILE}"
# Hit the exception early
try:
testdata = open_urlresource(TESTDATAURL, encoding="utf-8",
check=self.check_version)
except PermissionError:
self.skipTest(f"Permission error when downloading {TESTDATAURL} "
f"into the test data directory")
except (OSError, HTTPException):
self.fail(f"Could not retrieve {TESTDATAURL}")
with testdata:
self.run_normalization_tests(testdata)
def run_normalization_tests(self, testdata):
part = None
part1_data = {}
def NFC(str):
return unicodedata.normalize("NFC", str)
def NFKC(str):
return unicodedata.normalize("NFKC", str)
def NFD(str):
return unicodedata.normalize("NFD", str)
def NFKD(str):
return unicodedata.normalize("NFKD", str)
for line in testdata:
if '#' in line:
line = line.split('#')[0]
line = line.strip()
if not line:
continue
if line.startswith("@Part"):
part = line.split()[0]
continue
c1,c2,c3,c4,c5 = [self.unistr(x) for x in line.split(';')[:-1]]
# Perform tests
self.assertTrue(c2 == NFC(c1) == NFC(c2) == NFC(c3), line)
self.assertTrue(c4 == NFC(c4) == NFC(c5), line)
self.assertTrue(c3 == NFD(c1) == NFD(c2) == NFD(c3), line)
self.assertTrue(c5 == NFD(c4) == NFD(c5), line)
self.assertTrue(c4 == NFKC(c1) == NFKC(c2) == \
NFKC(c3) == NFKC(c4) == NFKC(c5),
line)
self.assertTrue(c5 == NFKD(c1) == NFKD(c2) == \
NFKD(c3) == NFKD(c4) == NFKD(c5),
line)
self.assertTrue(unicodedata.is_normalized("NFC", c2))
self.assertTrue(unicodedata.is_normalized("NFC", c4))
self.assertTrue(unicodedata.is_normalized("NFD", c3))
self.assertTrue(unicodedata.is_normalized("NFD", c5))
self.assertTrue(unicodedata.is_normalized("NFKC", c4))
self.assertTrue(unicodedata.is_normalized("NFKD", c5))
# Record part 1 data
if part == "@Part1":
part1_data[c1] = 1
# Perform tests for all other data
for c in range(sys.maxunicode+1):
X = chr(c)
if X in part1_data:
continue
self.assertTrue(X == NFC(X) == NFD(X) == NFKC(X) == NFKD(X), c)
def test_edge_cases(self):
self.assertRaises(TypeError, unicodedata.normalize)
self.assertRaises(ValueError, unicodedata.normalize, 'unknown', 'xx')
self.assertEqual(unicodedata.normalize('NFKC', ''), '')
def test_bug_834676(self):
# Check for bug 834676
unicodedata.normalize('NFC', '\ud55c\uae00')
if __name__ == "__main__":
unittest.main()
| {
"pile_set_name": "Github"
} |
Source: handbrake
Section: graphics
Priority: optional
Maintainer: John Stebbins <jstebbins.hb@gmail.com>
Build-Depends: meson, ninja-build, debhelper (>= 6), autotools-dev, libtool, libtool-bin, libgudev-1.0-dev, intltool, autoconf, nasm (>= 2.13), cmake, libbz2-dev, zlib1g-dev, libgtk-3-dev, libnotify-dev, libgstreamer1.0-dev, libgstreamer-plugins-base1.0-dev, python (>= 2.6), libfribidi-dev (>= 0.19.0), libxml2-dev, libogg-dev, libtheora-dev, libvorbis-dev, libopus-dev, libsamplerate0-dev, libfreetype6-dev, libfontconfig1-dev, libass-dev, libmp3lame-dev, libx264-dev, libjansson-dev, libspeex-dev, liblzma-dev, libvpx-dev, libva-dev, libdrm-dev, libnuma-dev
Standards-Version: 3.8.4
Homepage: http://www.handbrake.fr/
Package: handbrake-cli
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}
Conflicts: handbrake
Description: versatile DVD ripper and video transcoder - command line
HandBrake is a versatile, easy-to-use tool for converting DVDs and other videos
into H.264, MPEG-4, or OGG formatted media. It's particularly useful for making
videos that are compatible with portable video devices such as the Apple
iPod/iPhone. This package contains the command-line variant,
HandBrakeCLI
Package: handbrake-gtk
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}, gstreamer1.0-libav, gstreamer1.0-plugins-base, gstreamer1.0-plugins-good, gstreamer1.0-plugins-bad, gstreamer1.0-plugins-ugly, gstreamer1.0-pulseaudio
Conflicts: handbrake
Description: versatile DVD ripper and video transcoder - GTK GUI
HandBrake is a versatile, easy-to-use tool for converting DVDs and other videos
into H.264, MPEG-4, or OGG formatted media. It's particularly useful for making
videos that are compatible with portable video devices such as the Apple
iPod/iPhone. This package contains the graphical variant, ghb.
| {
"pile_set_name": "Github"
} |
---
id: faq-generators
title: "FAQ: Generators"
---
### What are some server generator use cases?
We have around 40+ server generators, with more added regularly. Some of these include Spring in your choice of Java or Kotlin, the Finch and Scalatra frameworks using Scala, and C# generators for NancyFX and WebAPI (to name only a few).
Besides generating the server code as a starting point to implement the API backend, here are some use cases of the server generators:
* **prototyping** - one can generate the server code and have a functional API backend very quickly to try different things or features.
* **mocking** - easily provide an API backend for mocking based on the examples field defined in the response object.
* **migration** - let's say one wants to migrate an API backend from Ruby on Rails to Java Spring. The server generator can save a lot of time in implementing and verify each endpoint in the new API backend.
* **evaluating** - when you want to try a new language or framework, and a typical "Hello, World" is too trivial.
## Java
### The API client has SSL errors due to an invalid certificate. Is there a way to bypass that?
Yes, please refer to http://stackoverflow.com/a/6055903/677735
### How can I customize the Feign client templates?
You will need to provide customized files in `Java/libraries/feign` under the resources folder and pass the location via the `-t` option.
In your Gradle build script, please add the following (example):
```
config.templateDir = 'src/openapi-generator-templates/Java/libraries/feign
```
## Android
### How can I generate an Android SDK?
**The Java SDK is also compatible with Android.**
[RECOMMENDED] To generate the Java SDK with `okhttp` and `gson` libraries, run the following:
```
mvn clean package
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
-i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.json \
-l java --library=okhttp-gson \
--additional-properties hideGenerationTimestamp=true \
-o /var/tmp/java/okhttp-gson/
```
You can also generate the Java SDK with other HTTP libraries by replacing `okhttp-gson` with `retrofit` for example. For a list of support libraries, please run
```
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar config-help -l java
```
To generate the Android SDK with [`volley`](https://github.com/mcxiaoke/android-volley), please run
```
mvn clean package
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \
-i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.json \
-l android --library=volley \
-o /var/tmp/android/volley/
```
We do **not** recommend using the default HTTP library (Apache HttpClient) with `android` as it's not actively maintained.
## C-Sharp
### How do I fix `CSC: warning CS2002` in Xamarin?
The full warning might look like this: `CSC: warning CS2002: Source file 'Api/FakeApi.cs' specified multiple times`
The warning has no impact on the build process so you should be able to build the solution without issue. The warning should be addressed in the upcoming stable release of Xamarin.
## Objective-C
### How do I run integration test with Petstore ObjC API client?
Here are the steps:
```
git clone https://github.com/openapitools/openapi-generator.git
cd openapi-generator/samples/client/petstore/objc/default/OpenAPIClientTests
mvn integration-test
```
Besides `default` (folder) ObjC API client, there's also `core-data` for another ObjC API client with [Core Data support](https://en.wikipedia.org/wiki/Core_Data).
## Swift
### How do I run integration test with Petstore Swift API client?
Here are the steps:
```
git clone https://github.com/openapitools/openapi-generator.git
cd openapi-generator/samples/client/petstore/swift/default/OpenAPIClientTests
mvn integration-test
```
Besides `default` (folder), there's another folder `promisekit` for Swift API client with [PromiseKit support](https://github.com/mxcl/PromiseKit)
```
git clone https://github.com/openapitools/openapi-generator.git
cd openapi-generator/samples/client/petstore/swift/promisekit/OpenAPIClientTests
mvn integration-test
```
### Is Swift (2.x) generator still actively maintained?
No, please use `swift3` or `swift4` generator instead as we want to focus on Swift 3.x, 4.x.
## TypeScript
### The JSON response fails to deserialize due to change in variable naming (snake_case to camelCase). Is there any way to keep the original naming?
Yes, please use the following option when generating TypeScript clients:
```
modelPropertyNaming
Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name (Default: camelCase)
```
| {
"pile_set_name": "Github"
} |
//
// PagerControllerDmeoController.h
// TYPagerControllerDemo
//
// Created by tany on 2017/7/19.
// Copyright © 2017年 tany. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface PagerControllerDmeoController : UIViewController
@end
| {
"pile_set_name": "Github"
} |
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2003 Ladislav Michl
* Copyright (C) 2004 Ralf Baechle
*/
#ifndef __ASM_MACH_IP32_MANGLE_PORT_H
#define __ASM_MACH_IP32_MANGLE_PORT_H
#define __swizzle_addr_b(port) ((port) ^ 3)
#define __swizzle_addr_w(port) ((port) ^ 2)
#define __swizzle_addr_l(port) (port)
#define __swizzle_addr_q(port) (port)
# define ioswabb(a, x) (x)
# define __mem_ioswabb(a, x) (x)
# define ioswabw(a, x) (x)
# define __mem_ioswabw(a, x) cpu_to_le16(x)
# define ioswabl(a, x) (x)
# define __mem_ioswabl(a, x) cpu_to_le32(x)
# define ioswabq(a, x) (x)
# define __mem_ioswabq(a, x) cpu_to_le32(x)
#endif /* __ASM_MACH_IP32_MANGLE_PORT_H */
| {
"pile_set_name": "Github"
} |
<style>
@import "/static/css/codemirror.css";
@import "/static/css/highlight.css";
</style>
<form id="article-form" class="form clear container" action="#" method="post">
<div class="left grid-1-2">
<input class="ipt title" id="title" type="text" required="required" name="title" placeholder="页面标题"/>
<textarea name="content" id="content" class="ipt">撰写页面内容,支持`markdown`语法高亮</textarea>
</div>
<div class="left grid-1-2">
<div class="preview markdown"></div>
</div>
<div class="form-vertical left">
<button class="btn btn-green left" type="button" id="attach-show">添加附件</button>
<p class="item">
<span for="slug">固定链接</span>
<input id="slug" class="ipt" type="text" name="slug" required="required" placeholder="页面的唯一链接"/>
</p>
<p class="item">
<span>保存状态</span>
<select name="status" id="status">
<option value="publish">公开</option>
<option value="draft">草稿</option>
</select>
</p>
<p class="item">
<span>允许评论</span>
<select name="comment" id="is-comment">
<option value="1">允许</option>
<option value="0">关闭</option>
</select>
</p>
<p class="item">
<span>置顶链接</span>
<select name="link" id="is-link">
<option value="0">关闭</option>
<option value="1">允许</option>
</select>
</p>
</div>
<p class="submit text-right" id="article-submit">
<span class="invalid lbl lbl-red hide" id="slug-invalid">固定链接由字母,数字和-组成</span>
<button class="btn btn-blue">保存文章</button>
</p>
</form>
<form class="form hide" id="attach-form" action="/admin/files/upload/" enctype="multipart/form-data" method="post">
<input id="attach-upload" type="file" name="file"/>
</form>
<script src="/static/lib/codemirror.min.js"></script>
<script src="/static/lib/codemirror-mode.min.js"></script>
<script src="/static/lib/marked.min.js"></script>
<script src="/static/lib/highlight.min.js"></script>
<script src="/static/js/upload.js"></script>
<script>
$(function () {
var editor = CodeMirror.fromTextArea(document.getElementById("content"), {
mode: 'markdown',
lineNumbers: true,
theme: "default",
extraKeys: {"Enter": "newlineAndIndentContinueMarkdownList"}
});
editor.on("change", function () {
var str = editor.getValue();
$('.preview').html(marked(str)).find("pre code").each(function (i, e) {
hljs.highlightBlock(e);
});
});
new FormValidator("article-form", [
{"name": "slug", "rules": "alpha_dash"}
],function (errors, e) {
e.preventDefault();
$('.invalid').hide();
if (errors.length) {
$("#" + errors[0].id + "-invalid").removeClass("hide").show();
return;
}
$('#article-form').ajaxSubmit(function (json) {
if (json.res) {
alert("已保存");
window.location.href = "/admin/pages/";
} else {
alert(json.msg);
}
});
});
initUpload("#article-submit");
});
</script> | {
"pile_set_name": "Github"
} |
# frozen_string_literal: false
require "webrick"
require "stringio"
require "test/unit"
class TestWEBrickHTTPRequest < Test::Unit::TestCase
def teardown
WEBrick::Utils::TimeoutHandler.terminate
super
end
def test_simple_request
msg = <<-_end_of_message_
GET /
_end_of_message_
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg))
assert(req.meta_vars) # fails if @header was not initialized and iteration is attempted on the nil reference
end
def test_parse_09
msg = <<-_end_of_message_
GET /
foobar # HTTP/0.9 request don't have header nor entity body.
_end_of_message_
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
assert_equal("GET", req.request_method)
assert_equal("/", req.unparsed_uri)
assert_equal(WEBrick::HTTPVersion.new("0.9"), req.http_version)
assert_equal(WEBrick::Config::HTTP[:ServerName], req.host)
assert_equal(80, req.port)
assert_equal(false, req.keep_alive?)
assert_equal(nil, req.body)
assert(req.query.empty?)
end
def test_parse_10
msg = <<-_end_of_message_
GET / HTTP/1.0
_end_of_message_
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
assert_equal("GET", req.request_method)
assert_equal("/", req.unparsed_uri)
assert_equal(WEBrick::HTTPVersion.new("1.0"), req.http_version)
assert_equal(WEBrick::Config::HTTP[:ServerName], req.host)
assert_equal(80, req.port)
assert_equal(false, req.keep_alive?)
assert_equal(nil, req.body)
assert(req.query.empty?)
end
def test_parse_11
msg = <<-_end_of_message_
GET /path HTTP/1.1
_end_of_message_
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
assert_equal("GET", req.request_method)
assert_equal("/path", req.unparsed_uri)
assert_equal("", req.script_name)
assert_equal("/path", req.path_info)
assert_equal(WEBrick::HTTPVersion.new("1.1"), req.http_version)
assert_equal(WEBrick::Config::HTTP[:ServerName], req.host)
assert_equal(80, req.port)
assert_equal(true, req.keep_alive?)
assert_equal(nil, req.body)
assert(req.query.empty?)
end
def test_request_uri_too_large
msg = <<-_end_of_message_
GET /#{"a"*2084} HTTP/1.1
_end_of_message_
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
assert_raise(WEBrick::HTTPStatus::RequestURITooLarge){
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
}
end
def test_parse_headers
msg = <<-_end_of_message_
GET /path HTTP/1.1
Host: test.ruby-lang.org:8080
Connection: close
Accept: text/*;q=0.3, text/html;q=0.7, text/html;level=1,
text/html;level=2;q=0.4, */*;q=0.5
Accept-Encoding: compress;q=0.5
Accept-Encoding: gzip;q=1.0, identity; q=0.4, *;q=0
Accept-Language: en;q=0.5, *; q=0
Accept-Language: ja
Content-Type: text/plain
Content-Length: 7
X-Empty-Header:
foobar
_end_of_message_
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
assert_equal(
URI.parse("http://test.ruby-lang.org:8080/path"), req.request_uri)
assert_equal("test.ruby-lang.org", req.host)
assert_equal(8080, req.port)
assert_equal(false, req.keep_alive?)
assert_equal(
%w(text/html;level=1 text/html */* text/html;level=2 text/*),
req.accept)
assert_equal(%w(gzip compress identity *), req.accept_encoding)
assert_equal(%w(ja en *), req.accept_language)
assert_equal(7, req.content_length)
assert_equal("text/plain", req.content_type)
assert_equal("foobar\n", req.body)
assert_equal("", req["x-empty-header"])
assert_equal(nil, req["x-no-header"])
assert(req.query.empty?)
end
def test_parse_header2()
msg = <<-_end_of_message_
POST /foo/bar/../baz?q=a HTTP/1.0
Content-Length: 9
User-Agent:
FOO BAR
BAZ
hogehoge
_end_of_message_
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
assert_equal("POST", req.request_method)
assert_equal("/foo/baz", req.path)
assert_equal("", req.script_name)
assert_equal("/foo/baz", req.path_info)
assert_equal("9", req['content-length'])
assert_equal("FOO BAR BAZ", req['user-agent'])
assert_equal("hogehoge\n", req.body)
end
def test_parse_headers3
msg = <<-_end_of_message_
GET /path HTTP/1.1
Host: test.ruby-lang.org
_end_of_message_
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
assert_equal(URI.parse("http://test.ruby-lang.org/path"), req.request_uri)
assert_equal("test.ruby-lang.org", req.host)
assert_equal(80, req.port)
msg = <<-_end_of_message_
GET /path HTTP/1.1
Host: 192.168.1.1
_end_of_message_
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
assert_equal(URI.parse("http://192.168.1.1/path"), req.request_uri)
assert_equal("192.168.1.1", req.host)
assert_equal(80, req.port)
msg = <<-_end_of_message_
GET /path HTTP/1.1
Host: [fe80::208:dff:feef:98c7]
_end_of_message_
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
assert_equal(URI.parse("http://[fe80::208:dff:feef:98c7]/path"),
req.request_uri)
assert_equal("[fe80::208:dff:feef:98c7]", req.host)
assert_equal(80, req.port)
msg = <<-_end_of_message_
GET /path HTTP/1.1
Host: 192.168.1.1:8080
_end_of_message_
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
assert_equal(URI.parse("http://192.168.1.1:8080/path"), req.request_uri)
assert_equal("192.168.1.1", req.host)
assert_equal(8080, req.port)
msg = <<-_end_of_message_
GET /path HTTP/1.1
Host: [fe80::208:dff:feef:98c7]:8080
_end_of_message_
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
assert_equal(URI.parse("http://[fe80::208:dff:feef:98c7]:8080/path"),
req.request_uri)
assert_equal("[fe80::208:dff:feef:98c7]", req.host)
assert_equal(8080, req.port)
end
def test_parse_get_params
param = "foo=1;foo=2;foo=3;bar=x"
msg = <<-_end_of_message_
GET /path?#{param} HTTP/1.1
Host: test.ruby-lang.org:8080
_end_of_message_
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
query = req.query
assert_equal("1", query["foo"])
assert_equal(["1", "2", "3"], query["foo"].to_ary)
assert_equal(["1", "2", "3"], query["foo"].list)
assert_equal("x", query["bar"])
assert_equal(["x"], query["bar"].list)
end
def test_parse_post_params
param = "foo=1;foo=2;foo=3;bar=x"
msg = <<-_end_of_message_
POST /path?foo=x;foo=y;foo=z;bar=1 HTTP/1.1
Host: test.ruby-lang.org:8080
Content-Length: #{param.size}
Content-Type: application/x-www-form-urlencoded
#{param}
_end_of_message_
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
query = req.query
assert_equal("1", query["foo"])
assert_equal(["1", "2", "3"], query["foo"].to_ary)
assert_equal(["1", "2", "3"], query["foo"].list)
assert_equal("x", query["bar"])
assert_equal(["x"], query["bar"].list)
end
def test_chunked
crlf = "\x0d\x0a"
expect = File.binread(__FILE__).freeze
msg = <<-_end_of_message_
POST /path HTTP/1.1
Host: test.ruby-lang.org:8080
Transfer-Encoding: chunked
_end_of_message_
msg.gsub!(/^ {6}/, "")
open(__FILE__){|io|
while chunk = io.read(100)
msg << chunk.size.to_s(16) << crlf
msg << chunk << crlf
end
}
msg << "0" << crlf
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg))
assert_equal(expect, req.body)
# chunked req.body_reader
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg))
dst = StringIO.new
IO.copy_stream(req.body_reader, dst)
assert_equal(expect, dst.string)
end
def test_forwarded
msg = <<-_end_of_message_
GET /foo HTTP/1.1
Host: localhost:10080
User-Agent: w3m/0.5.2
X-Forwarded-For: 123.123.123.123
X-Forwarded-Host: forward.example.com
X-Forwarded-Server: server.example.com
Connection: Keep-Alive
_end_of_message_
msg.gsub!(/^ {6}/, "")
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg))
assert_equal("server.example.com", req.server_name)
assert_equal("http://forward.example.com/foo", req.request_uri.to_s)
assert_equal("forward.example.com", req.host)
assert_equal(80, req.port)
assert_equal("123.123.123.123", req.remote_ip)
assert(!req.ssl?)
msg = <<-_end_of_message_
GET /foo HTTP/1.1
Host: localhost:10080
User-Agent: w3m/0.5.2
X-Forwarded-For: 192.168.1.10, 172.16.1.1, 123.123.123.123
X-Forwarded-Host: forward.example.com:8080
X-Forwarded-Server: server.example.com
Connection: Keep-Alive
_end_of_message_
msg.gsub!(/^ {6}/, "")
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg))
assert_equal("server.example.com", req.server_name)
assert_equal("http://forward.example.com:8080/foo", req.request_uri.to_s)
assert_equal("forward.example.com", req.host)
assert_equal(8080, req.port)
assert_equal("123.123.123.123", req.remote_ip)
assert(!req.ssl?)
msg = <<-_end_of_message_
GET /foo HTTP/1.1
Host: localhost:10080
Client-IP: 234.234.234.234
X-Forwarded-Proto: https, http
X-Forwarded-For: 192.168.1.10, 10.0.0.1, 123.123.123.123
X-Forwarded-Host: forward.example.com
X-Forwarded-Server: server.example.com
X-Requested-With: XMLHttpRequest
Connection: Keep-Alive
_end_of_message_
msg.gsub!(/^ {6}/, "")
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg))
assert_equal("server.example.com", req.server_name)
assert_equal("https://forward.example.com/foo", req.request_uri.to_s)
assert_equal("forward.example.com", req.host)
assert_equal(443, req.port)
assert_equal("234.234.234.234", req.remote_ip)
assert(req.ssl?)
msg = <<-_end_of_message_
GET /foo HTTP/1.1
Host: localhost:10080
Client-IP: 234.234.234.234
X-Forwarded-Proto: https
X-Forwarded-For: 192.168.1.10
X-Forwarded-Host: forward1.example.com:1234, forward2.example.com:5678
X-Forwarded-Server: server1.example.com, server2.example.com
X-Requested-With: XMLHttpRequest
Connection: Keep-Alive
_end_of_message_
msg.gsub!(/^ {6}/, "")
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg))
assert_equal("server1.example.com", req.server_name)
assert_equal("https://forward1.example.com:1234/foo", req.request_uri.to_s)
assert_equal("forward1.example.com", req.host)
assert_equal(1234, req.port)
assert_equal("234.234.234.234", req.remote_ip)
assert(req.ssl?)
end
def test_continue_sent
msg = <<-_end_of_message_
POST /path HTTP/1.1
Expect: 100-continue
_end_of_message_
msg.gsub!(/^ {6}/, "")
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg))
assert req['expect']
l = msg.size
req.continue
assert_not_equal l, msg.size
assert_match(/HTTP\/1.1 100 continue\r\n\r\n\z/, msg)
assert !req['expect']
end
def test_continue_not_sent
msg = <<-_end_of_message_
POST /path HTTP/1.1
_end_of_message_
msg.gsub!(/^ {6}/, "")
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg))
assert !req['expect']
l = msg.size
req.continue
assert_equal l, msg.size
end
def test_bad_messages
param = "foo=1;foo=2;foo=3;bar=x"
msg = <<-_end_of_message_
POST /path?foo=x;foo=y;foo=z;bar=1 HTTP/1.1
Host: test.ruby-lang.org:8080
Content-Type: application/x-www-form-urlencoded
#{param}
_end_of_message_
assert_raise(WEBrick::HTTPStatus::LengthRequired){
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
req.body
}
msg = <<-_end_of_message_
POST /path?foo=x;foo=y;foo=z;bar=1 HTTP/1.1
Host: test.ruby-lang.org:8080
Content-Length: 100000
body is too short.
_end_of_message_
assert_raise(WEBrick::HTTPStatus::BadRequest){
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
req.body
}
msg = <<-_end_of_message_
POST /path?foo=x;foo=y;foo=z;bar=1 HTTP/1.1
Host: test.ruby-lang.org:8080
Transfer-Encoding: foobar
body is too short.
_end_of_message_
assert_raise(WEBrick::HTTPStatus::NotImplemented){
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(msg.gsub(/^ {6}/, "")))
req.body
}
end
def test_eof_raised_when_line_is_nil
assert_raise(WEBrick::HTTPStatus::EOFError) {
req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)
req.parse(StringIO.new(""))
}
end
end
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html lang="en-us">
{% include head.html %}
<body>
{% include page-header.html %}
<section class="main-content">
{{ content }}
{% include page-footer.html %}
</section>
</body>
</html>
| {
"pile_set_name": "Github"
} |
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2012-07-12.20; # UTC
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
# This program 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 2, or (at your option)
# any later version.
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# A tabulation character.
tab=' '
# A newline character.
nl='
'
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' "$nl" < "$tmpdepfile" |
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependent.h'.
# Do two passes, one to just change these to
# '$object: dependent.h' and one to simply 'dependent.h:'.
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
# However on
# $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\':
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
# tcc 0.9.26 (FIXME still under development at the moment of writing)
# will emit a similar output, but also prepend the continuation lines
# with horizontal tabulation characters.
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form 'foo.o: dependent.h',
# or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
# Do two passes, one to just change these to
# '$object: dependent.h' and one to simply 'dependent.h:'.
sed -e "s/^[ $tab][ $tab]*/ /" -e "s,^[^:]*:,$object :," \
< "$tmpdepfile" > "$depfile"
sed '
s/[ '"$tab"'][ '"$tab"']*/ /g
s/^ *//
s/ *\\*$//
s/^[^:]*: *//
/^$/d
/:$/d
s/$/ :/
' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
base=`echo "$source" | sed -e 's|^.*/||' -e 's/\.[-_a-zA-Z0-9]*$//'`
tmpdepfile="$base.d"
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir="$base.d-lock"
trap "echo '$0: caught signal, cleaning up...' >&2; rm -rf $lockdir" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0 ; do
# mkdir is a portable test-and-set.
if mkdir $lockdir 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rm -rf $lockdir
break
else
## the lock is being held by a different process,
## wait until the winning process is done or we timeout
while test -d $lockdir && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
# With Tru64 cc, shared objects can also be used to make a
# static library. This mechanism is used in libtool 1.4 series to
# handle both shared and static libraries in a single compilation.
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
#
# With libtool 1.5 this exception was removed, and libtool now
# generates 2 separate objects for the 2 libraries. These two
# compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
tmpdepfile2=$dir$base.o.d # libtool 1.5
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.o.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test "$stat" = 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' "$nl" < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
| {
"pile_set_name": "Github"
} |
<?php
namespace classes\field_inheritance_002;
class A {
protected $x = -1;
public function Aget() {
return $this->x;
}
public function Aset($v) {
$this->x = $v;
}
}
class B extends A {
public $x;
public function Bget() {
return $this->x;
}
public function Bset($v) {
$this->x = $v;
}
}
function test() {
// in local:
$b = new B;
$b->x = 123;
echo $b->Aget() ."\n";
$b = new B;
$b->Bset(123);
echo $b->Aget() ."\n";
echo $b->Bget() ."\n";
$b = new B;
$b->Aset(123);
echo $b->Aget() ."\n";
echo $b->Bget() ."\n";
}
// in global:
$b = new B;
$b->x = 123;
echo $b->Aget() ."\n";
$b = new B;
$b->Bset(123);
echo $b->Aget() ."\n";
echo $b->Bget() ."\n";
$b = new B;
$b->Aset(123);
echo $b->Aget() ."\n";
echo $b->Bget() ."\n";
//
test();
| {
"pile_set_name": "Github"
} |
// -*- C++ -*-
// Copyright (C) 2005-2018 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library 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, or (at your option) any later
// version.
// This library 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.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
// Permission to use, copy, modify, sell, and distribute this software
// is hereby granted without fee, provided that the above copyright
// notice appears in all copies, and that both that copyright notice
// and this permission notice appear in supporting documentation. None
// of the above authors, nor IBM Haifa Research Laboratories, make any
// representation about the suitability of this software for any
// purpose. It is provided "as is" without express or implied
// warranty.
/**
* @file thin_heap_/constructors_destructor_fn_imps.hpp
* Contains an implementation for thin_heap_.
*/
PB_DS_CLASS_T_DEC
template<typename It>
void
PB_DS_CLASS_C_DEC::
copy_from_range(It first_it, It last_it)
{
while (first_it != last_it)
push(*(first_it++));
PB_DS_ASSERT_VALID((*this))
}
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
thin_heap() : m_p_max(0)
{
initialize();
PB_DS_ASSERT_VALID((*this))
}
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
thin_heap(const Cmp_Fn& r_cmp_fn)
: base_type(r_cmp_fn), m_p_max(0)
{
initialize();
PB_DS_ASSERT_VALID((*this))
}
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
thin_heap(const PB_DS_CLASS_C_DEC& other)
: base_type(other)
{
initialize();
m_p_max = base_type::m_p_root;
for (node_pointer p_nd = base_type::m_p_root; p_nd != 0;
p_nd = p_nd->m_p_next_sibling)
if (Cmp_Fn::operator()(m_p_max->m_value, p_nd->m_value))
m_p_max = p_nd;
PB_DS_ASSERT_VALID((*this))
}
PB_DS_CLASS_T_DEC
void
PB_DS_CLASS_C_DEC::
swap(PB_DS_CLASS_C_DEC& other)
{
PB_DS_ASSERT_VALID((*this))
base_type::swap(other);
std::swap(m_p_max, other.m_p_max);
PB_DS_ASSERT_VALID((*this))
}
PB_DS_CLASS_T_DEC
PB_DS_CLASS_C_DEC::
~thin_heap()
{ }
PB_DS_CLASS_T_DEC
void
PB_DS_CLASS_C_DEC::
initialize()
{ std::fill(m_a_aux, m_a_aux + max_rank, static_cast<node_pointer>(0)); }
| {
"pile_set_name": "Github"
} |
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !gccgo
#include "textflag.h"
//
// System call support for AMD64, FreeBSD
//
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.
TEXT ·Syscall(SB),NOSPLIT,$0-56
JMP syscall·Syscall(SB)
TEXT ·Syscall6(SB),NOSPLIT,$0-80
JMP syscall·Syscall6(SB)
TEXT ·Syscall9(SB),NOSPLIT,$0-104
JMP syscall·Syscall9(SB)
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
JMP syscall·RawSyscall(SB)
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
JMP syscall·RawSyscall6(SB)
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: cc4574c0f59721b4db6cde3443eb9f45
timeCreated: 1519907477
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
/* _Stoflt function */
#include "xmath.h"
#include <ctype.h>
#include <locale.h>
#include <stdlib.h>
#define BASE 10 /* decimal */
#define NDIG 9 /* decimal digits per long word */
#define MAXSIG (5 * NDIG) /* maximum significant digits to keep */
int _Stoflt(const char *s0, const char *s,
char **endptr, long lo[], int maxsig)
{ /* convert string to array of long plus exponent */
char buf[MAXSIG + 1]; /* worst case, with room for rounding digit */
int nsig; /* number of significant digits seen */
int seen; /* any valid field characters seen */
int sticky = 0; /* note any nonzero digits discarded */
int word = 0; /* just before current long word to fill */
maxsig *= NDIG; /* convert word count to digit count */
if (MAXSIG < maxsig)
maxsig = MAXSIG; /* protect against bad call */
lo[0] = 0; /* power of ten exponent */
lo[1] = 0; /* first NDIG-digit word of fraction */
for (seen = 0; *s == '0'; ++s, seen = 1)
; /* strip leading zeros */
for (nsig = 0; isdigit((unsigned char)*s); ++s, seen = 1)
if (nsig < maxsig)
buf[nsig++] = (char)(*s - '0'); /* accumulate a digit */
else
{ /* just scale exponent and note nonzero digits */
++lo[0];
if (*s != '0')
sticky = 1;
}
if (*s == localeconv()->decimal_point[0])
++s;
if (nsig == 0)
for (; *s == '0'; ++s, seen = 1)
--lo[0]; /* scale for stripped zeros after point */
for (; isdigit((unsigned char)*s); ++s, seen = 1)
if (nsig < maxsig)
{ /* accumulate a fraction digit */
buf[nsig++] = (char)(*s - '0');
--lo[0];
}
else if (*s != '0')
sticky = 1;
if (sticky)
buf[maxsig - 1] += 1; /* okay if digit becomes BASE */
for (; 0 < nsig && buf[nsig - 1] == '\0'; --nsig)
++lo[0]; /* discard trailing zeros */
if (nsig == 0)
buf[nsig++] = '\0'; /* ensure at least one digit */
if (seen)
{ /* convert digit sequence to words */
int bufidx = 0; /* next digit in buffer */
int wordidx = NDIG - nsig % NDIG; /* next digit in word (% NDIG) */
word = wordidx % NDIG == 0 ? 0 : 1;
for (; bufidx < nsig; ++wordidx, ++bufidx)
if (wordidx % NDIG == 0)
lo[++word] = buf[bufidx];
else
lo[word] = lo[word] * BASE + buf[bufidx];
if (*s == 'e' || *s == 'E')
{ /* parse exponent */
const char *ssav = s;
const char esign = *++s == '+' || *s == '-' ? *s++ : '+';
int eseen = 0;
long lexp = 0;
for (; isdigit((unsigned char)*s); ++s, eseen = 1)
if (lexp < 100000000) /* else overflow */
lexp = lexp * 10 + (unsigned char)*s - '0';
if (esign == '-')
lexp = -lexp;
lo[0] += lexp;
if (!eseen)
s = ssav; /* roll back if incomplete exponent */
}
}
if (!seen)
word = 0; /* return zero if bad parse */
if (endptr)
*endptr = (char *)(seen ? s : s0); /* roll back if bad parse */
return (word);
}
/*
* Copyright (c) by P.J. Plauger. All rights reserved.
* Consult your license regarding permissions and restrictions.
V6.50:0009 */
| {
"pile_set_name": "Github"
} |
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Zend\Http\Client\Adapter\Exception;
/**
*/
class InitializationException extends RuntimeException
{
}
| {
"pile_set_name": "Github"
} |
name = File Styles
description = Allows preset transformation of files and media for display.
package = Styles
core = 7.x
files[] = file_styles.module
files[] = file_styles.admin.inc
files[] = includes/styles/FileStyles.inc
dependencies[] = styles
dependencies[] = image
; Information added by drupal.org packaging script on 2011-09-12
version = "7.x-2.x-dev"
core = "7.x"
project = "styles"
datestamp = "1315787000"
| {
"pile_set_name": "Github"
} |
'use strict';
angular.module('angularCmsApp').controller('HelpCtrl', function($scope) {
$scope.awesomeThings = ['HTML5 Boilerplate', 'AngularJS', 'Karma'];
$scope.readmeEl = angular.element('#readme');
$scope.loadReadme = function() {
};
});
| {
"pile_set_name": "Github"
} |
/*BEGIN_LEGAL
Intel Open Source License
Copyright (c) 2002-2015 Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. Redistributions
in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution. Neither the name of
the Intel Corporation nor the names of its contributors may be used to
endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
END_LEGAL */
#include <stdio.h>
#include "pin.H"
#define DF_MASK 0x400
#define DF_POS 10
#if defined(__cplusplus)
extern "C"
#endif
int source[4] = {1,1,1,1};
#if defined(__cplusplus)
extern "C"
#endif
int dest[4] = {0,0,0,0};
// This function is called before every instruction is executed
// it should move source[1] and source[2] into dest[1] and dest[2] respectively
// Flags are written before the movsd
// If there is a bug and the DF is set - then it will move source[1] and source[0] into dest[1]
// and dest[0] respectively
// In the Fini function we check that dest has it's expected values
#if defined(__cplusplus)
extern "C"
#endif
VOID TestDfByMovsd ();
// Pin calls this function every time a new instruction is encountered
VOID Instruction(INS ins, VOID *v)
{
INS_InsertCall(ins, IPOINT_BEFORE, (AFUNPTR)TestDfByMovsd, IARG_END);
}
// This function is called when the application exits
VOID Fini(INT32 code, VOID *v)
{
BOOL hadFailure = false;
if (dest[0]!=0)
{
printf ("Unexpected value of dest[0] %d\n", dest[0]);
hadFailure = true;
}
if (dest[1]!=1)
{
printf ("Unexpected value of dest[1] %d\n", dest[1]);
hadFailure = true;
}
if (dest[2]!=1)
{
printf ("Unexpected value of dest[2] %d\n", dest[2]);
hadFailure = true;
}
if (dest[3]!=0)
{
printf ("Unexpected value of dest[3] %d\n", dest[3]);
hadFailure = true;
}
printf ("Finished: hadFailure %d\n", hadFailure);
fflush (stdout);
}
// argc, argv are the entire command line, including pin -t <toolname> -- ...
int main(int argc, char * argv[])
{
// Initialize pin
PIN_Init(argc, argv);
// Register Instruction to be called to instrument instructions
INS_AddInstrumentFunction(Instruction, 0);
// Register Fini to be called when the application exits
PIN_AddFiniFunction(Fini, 0);
// Start the program, never returns
PIN_StartProgram();
return 0;
}
| {
"pile_set_name": "Github"
} |
* $Id$
c--------------------------------------------------------------------
subroutine prec2ij(ibl,nblock1, bl,inx)
implicit real*8 (a-h,o-z)
#include "mafdecls.fh"
common /route/ iroute
common /infob/ inuc,ibas,na,nbf,nsh,ncf,ncs
common /primij/ iabprim, ijdim ,ijpar1
common /time0/ tprec2
c
common /map4uniq/ nij_uniqe, ij_uniqe_p, map_ij,
* nkl_uniqe, kl_uniqe_p, map_kl
c
dimension bl(*)
dimension inx(12,*)
dimension nblock1(*)
c---------------------------------------
call txs_second(tprec2b)
c---------------------------------------
c get : nij_uniqe=no of unique pairs and the pointer to the list
c
c10 call get_uniq(ibl,nij_uniqe,ij_uniqe_p,bl)
c
c nij_uniqe = number of uniqe pairs in ibl block of pairs
c (no of present pairs)
c ij_uniqe_p = pointer to the list
c---------------------------------------
call dimenij(ibl,inx,nij_uniqe,nblock1,ijdim,ijcont)
c---------------------------------------
IF( iroute.eq.1 ) THEN
call getmem(3*ijdim,iabprim)
call ab_prim_1(ibl, dbl_mb(inuc),dbl_mb(ibas),inx,
* bl(iabprim),ijcont,
* nij_uniqe,bl(ij_uniqe_p) )
ELSE
call getmem(2*ijcont+ijdim,iabprim)
iapb =iabprim
i1apb=iabprim+ijcont
isab =iabprim+ijcont*2
call ab_prim_2(ibl, dbl_mb(inuc),dbl_mb(ibas),inx,
* bl(iapb),bl(i1apb),bl(isab),ijcont,
* nij_uniqe,bl(ij_uniqe_p) )
ENDIF
c---------------------------------------
call txs_second(tprec2e)
tprec2=tprec2+tprec2e-tprec2b
c---------------------------------------
end
c=======================
subroutine prec2kl(kbl,nblock1, bl,inx)
implicit real*8 (a-h,o-z)
#include "mafdecls.fh"
common /route/ iroute
common /infob/ inuc,ibas,na,nbf,nsh,ncf,ncs
common /primkl/ kabprim, kldim ,klpar1
common /time0/ tprec2
c
common /map4uniq/ nij_uniqe, ij_uniqe_p, map_ij,
* nkl_uniqe, kl_uniqe_p, map_kl
c
dimension bl(*)
dimension inx(12,*)
dimension nblock1(*)
c---------------------------------------
call txs_second(tprec2b)
c---------------------------------------
c10 call get_uniq(kbl,nkl_uniqe,kl_uniqe_p,bl)
c---------------------------------------
call dimenij(kbl,inx,nkl_uniqe,nblock1,kldim,klcont)
c---------------------------------------
IF( iroute.eq.1 ) THEN
call getmem(3*kldim,kabprim)
call ab_prim_1(kbl, dbl_mb(inuc),dbl_mb(ibas),inx,
* bl(kabprim),klcont,
* nkl_uniqe,bl(kl_uniqe_p) )
ELSE
call getmem(2*klcont+kldim,kabprim)
icpd =kabprim
i1cpd=kabprim+klcont
iscd =kabprim+klcont*2
call ab_prim_2(kbl,dbl_mb(inuc),dbl_mb(ibas),inx,
* bl(icpd),bl(i1cpd),bl(iscd),klcont,
* nkl_uniqe,bl(kl_uniqe_p) )
ENDIF
c---------------------------------------
call txs_second(tprec2e)
tprec2=tprec2+tprec2e-tprec2b
c---------------------------------------
end
c====================================================================
subroutine dimenij(ibl,inx,nparij,nblock1,ijdim,ijcont)
dimension inx(12,*),nblock1(*) ! (0:ncs)
c
call get_ics_jcs(nblock1,ibl,1,ics1,jcs1)
c
icont=inx(5,ics1)-inx(1,ics1)
jcont=inx(5,jcs1)-inx(1,jcs1)
ijcont=icont*jcont
ijdim=nparij*ijcont
c
end
c====================================================================
subroutine precdiag
implicit real*8 (a-h,o-z)
c---------------------------------------------------------------
common /route/ iroute
common /memor5x/ ieab,iecd
common /memor5a/ iaa,ibb,icc,idd,icis,icjs,icks,icls,
* ixab,ixp,ixpn,ixpp,iabnia,iapb,i1apb,ifij,icij,isab,
* ixcd,ixq,ixqn,ixqq,icdnia,icpd,i1cpd,ifkl,ickl,iscd
common /memor5c/ itxab,itxcd,iabcd,ihabcd
common /memor5e/ igci,igcj,igck,igcl,indgc,igcoef,
* icfg,jcfg,kcfg,lcfg, igcij,igckl
c---------------------------------------------------------------
c* for a diagonal case : npklx=0
c
c* since this is for a diagonal block
c* pairs IJ and KL are the same
c
ixcd=ixab
ixq =ixp
ixqn=ixpn
ixqq=ixpp
c
icpd=iapb
i1cpd=i1apb
ickl=icij
ifkl=ifij
iscd=isab
c
icc=iaa
idd=ibb
c
icks=icis
icls=icjs
c
iecd=ieab
c
itxcd=itxab
c
icdnia=iabnia
c-----------------------------------
IF( iroute.eq.1 ) THEN
igck=igci
igcl=igcj
ELSE
igckl=igcij
ENDIF
c-----------------------------------
end
c====================================================================
subroutine ab_prim_1(ibl, datnuc,datbas,inx, abprim,ijcont,
* nij_uniqe,ij_uniqe )
implicit real*8 (a-h,o-z)
c
dimension inx(12,*)
dimension datbas(13,*),datnuc(5,*)
dimension abprim(nij_uniqe,ijcont,3)
dimension ij_uniqe(nij_uniqe)
c---------------------------------------------------------------
ctest
c write(6,*)' from ab_prim : ibl=',ibl,' nij_uniqe=',nij_uniqe
c call prt_uniqe(ij_uniqe,nij_uniqe)
c call prt_uniqe(ibl,ij_uniqe,nij_uniqe,1111 )
c write(6,*)' from ab_prim : ij1=',ij1,' ij2=',ij2
ctest
c
cccc do 100 ijpar=1,nparij
cccc ijcs=ijbl(ibl,ijpar)
cnew
c
do 100 ijpar =1,nij_uniqe ! over uniqe pairs
c
ijcs=ij_uniqe(ijpar)
call get_ij_half(ijcs,ics,jcs)
c
ia=inx(1,ics)+1
ie=inx(5,ics)
iat=inx(2,ics)
ja=inx(1,jcs)+1
je=inx(5,jcs)
jat=inx(2,jcs)
c
c center23 (atom number 0 is the one with s-orbital/one-exp.)
c
if(iat.eq.0) iat=jat
if(jat.eq.0) jat=iat
c
if(iat.eq.0 .and. jat.eq.0) then
xab=0.0d0
yab=0.0d0
zab=0.0d0
else
xab=datnuc(2,iat)-datnuc(2,jat)
yab=datnuc(3,iat)-datnuc(3,jat)
zab=datnuc(4,iat)-datnuc(4,jat)
endif
c
rr=xab*xab+yab*yab+zab*zab
c
ij=0
do 200 is=ia,ie
aa=datbas(1,is)
c----------------------------------
do 200 js=ja,je
bb=datbas(1,js)
ij=ij+1
c----------------------------------
c Sab=(a*b)**3/4 * (a+b)**-1 * exp( -ab/(a+b) * Rab**2)
c
if(aa.gt.0.0d0 .and. bb.gt.0.0d0) then
cold axb=aa*bb
cold apb=aa+bb
cold apb1=1.0d0/apb
cold e=axb*apb1
cold abprim(ijpar,ij,1)=apb
cold abprim(ijpar,ij,2)=apb1
cold abprim(ijpar,ij,3)=apb1*sqrt(sqrt(axb))**3*exp(-e*rr)
cnew98.......................................................
c
axb=aa*bb
apb=aa+bb
apb1=1.0d0/apb
e=axb*apb1
c98
err=e*rr
if(err.gt.46) then ! was 32 exp(-32)=1.27*10**-14
exp_err=0.d0 ! exp(-46) = 1e-20
else
exp_err=exp(-err)
endif
c98
abprim(ijpar,ij,1)=apb
abprim(ijpar,ij,2)=apb1
abprim(ijpar,ij,3)=apb1*sqrt(sqrt(axb))**3*exp_err
cnew98.......................................................
else
c center23:
if(aa.le.0.0d0 .and. bb.gt.0.0d0) then
c>>>>>>>>> write(8,*)' exp_a=zero ; ics=',ics
apb=aa+bb
apb1=1.0d0/apb
abprim(ijpar,ij,1)=apb
abprim(ijpar,ij,2)=apb1
c>>*a-3/4 abprim(ijpar,ij,3)= sqrt(bb) !Sbb
abprim(ijpar,ij,3)=1.0d0/sqrt(sqrt(bb)) !sqrt(Sbb)
endif
if(aa.gt.0.0d0 .and. bb.le.0.0d0) then
c>>>>>>>> write(8,*)' exp_b=zero ; jcs=',jcs
apb=aa+bb
apb1=1.0d0/apb
abprim(ijpar,ij,1)=apb
abprim(ijpar,ij,2)=apb1
c>>>>>>>>>>>> abprim(ijpar,ij,3)=sqrt(sqrt(aa)) ! sqrt(Saa)
c>>*a-3/4 abprim(ijpar,ij,3)= sqrt(aa) !Saa
abprim(ijpar,ij,3)=1.0d0/sqrt(sqrt(aa)) !sqrt(Saa)
endif
if(aa.le.0.0d0 .and. bb.le.0.0d0) then
abprim(ijpar,ij,1)=0.0d0
abprim(ijpar,ij,2)=0.0d0
abprim(ijpar,ij,3)=0.0d0
endif
endif
c----------------------------------
200 continue
100 continue
end
c============================================================
subroutine precalc2_1(isupb,bl,mmax,mmax1,nhabcd,nfumax,
* nbl2,nbls, inx,ibl,kbl,npkl)
c
c npkl=ndiag
c
implicit real*8 (a-h,o-z)
#include "mafdecls.fh"
c-----------------------------------------------------------
common /primij/ iabprim, ijdim ,ijpar1
common /primkl/ kabprim, kldim ,klpar1
common /ilepar/ lpar_exe,lpar_num
c
common /infob/ inuc,ibas,na,nbf,nsh,ncf,ncs
c
common /types/itype,jtype,ktype,ltype,itype1,jtype1,ktype1,ltype1
common /contr/ ngci,ngcj,ngck,ngcl,lci,lcj,lck,lcl,lcij,lckl
common /gcont/ ngci1,ngcj1,ngck1,ngcl1,ngcd
c
common /memor5x/ ieab,iecd
common /memor5a/ iaa,ibb,icc,idd,icis,icjs,icks,icls,
* ixab,ixp,ixpn,ixpp,iabnia,iapb,i1apb,ifij,icij,isab,
* ixcd,ixq,ixqn,ixqq,icdnia,icpd,i1cpd,ifkl,ickl,iscd
common /memor5c/ itxab,itxcd,iabcd,ihabcd
common /memor5d/ iabnix,icdnix,ixpnx,ixqnx,ihabcdx
common /memor5e/ igci,igcj,igck,igcl,indgc,igcoef,
* icfg,jcfg,kcfg,lcfg, igcij,igckl
c
common /map4uniq/ nij_uniqe, ij_uniqe_p, map_ij,
* nkl_uniqe, kl_uniqe_p, map_kl
c
dimension bl(*), inx(12,*)
c---------------------------------------------------------------
c precalculations for pairs ij
c
call precal2x_1(iabprim,ijdim,iapb,i1apb,isab)
c--------
lpar_exe=lpar_exe+1
lpar_num=lpar_num+nij_uniqe
call precal2a_1(dbl_mb(ibas),dbl_mb(inuc),inx, ibl, nbl2,
* bl(iabprim ),
* lcij,bl(iaa),bl(ibb),bl(ieab),bl(icis),bl(icjs),
* bl(ixab),bl(ixp),bl(icij),bl(ifij), bl(itxab),
* bl(igci),bl(igcj),ngci1,ngcj1,'left ',
* nij_uniqe,bl(ij_uniqe_p) )
c----------
c for abnia
if(mmax.gt.2) then
call precal2b_1(mmax1,lcij, bl(i1apb), bl(iabnia),
* nij_uniqe,bl(ij_uniqe_p) )
endif
c----------------------------------------
c precalculations for pairs kl
c
c10 if(kbl.eq.ibl) then
c10 kabprim=iabprim
c10 kldim =ijdim
c10 endif
c10 if(npkl.ne.0) then
call precal2x_1(kabprim,kldim,icpd,i1cpd,iscd)
c
lpar_exe=lpar_exe+1
lpar_num=lpar_num+nkl_uniqe
call precal2a_1(dbl_mb(ibas),dbl_mb(inuc),inx,kbl,nbl2,
* bl(kabprim ),
* lckl,bl(icc),bl(idd),bl(iecd),bl(icks),bl(icls),
* bl(ixcd),bl(ixq),bl(ickl),bl(ifkl), bl(itxcd),
* bl(igck),bl(igcl),ngck1,ngcl1,'right',
* nkl_uniqe,bl(kl_uniqe_p) )
c--
c for cdnia
if(mmax.gt.2) then
call precal2b_1(mmax1,lckl,bl(i1cpd), bl(icdnia),
* nkl_uniqe,bl(kl_uniqe_p))
endif
c10 else
c10 call precdiag
c10 endif
c----------------------------------------
c for habcd
c
if(mmax.gt.2) then
call precal2c_1(bl(i1apb),bl(i1cpd),bl(ihabcd),nhabcd,nfumax,
* nij_uniqe,bl(ij_uniqe_p),nkl_uniqe,bl(kl_uniqe_p))
endif
c---------------------------------------------------------------
c check for numerical stablility :
c
call num_stability_1(dbl_mb(ibas),inx,bl(icij),bl(ickl),
* nij_uniqe,bl(ij_uniqe_p),nkl_uniqe,bl(kl_uniqe_p))
c---------------------------------------------------------------
end
c====================================================================
subroutine precal2a_1(datbas,datnuc,inx, ibl,nbl2, abprim,lcij,
* aaa,bbb,estab,cis,cjs,
* xab,xparij,coefij,factij,txab,
* gci,gcj,ngci1,ngcj1,which ,
* nij_uniqe,ij_uniqe )
c
implicit real*8 (a-h,o-z)
character*5 which
c
COMMON /types/itype,jtype,ktype,ltype,ityp,jtyp,ktyp,ltyp
common /contr/ ngci,ngcj,ngck,ngcl,lci,lcj,lck,lcl,lc12,lc34
common/obarai/
* lni,lnj,lnk,lnl,lnij,lnkl,lnijkl,MMAX,
* NQI,NQJ,NQK,NQL,NSIJ,NSKL,
* NQIJ,NQIJ1,NSIJ1,NQKL,NQKL1,NSKL1,ijbeg,klbeg
c
c
dimension inx(12,*)
dimension abprim(nij_uniqe,lcij,3)
dimension datbas(13,*),datnuc(5,*)
c
dimension aaa(nij_uniqe,*),bbb(nij_uniqe,*)
dimension cis(nij_uniqe,*),cjs(nij_uniqe,*)
dimension xab(nij_uniqe,3), xparij(nij_uniqe,3,lcij,3)
dimension estab(nij_uniqe,lcij)
dimension coefij(nij_uniqe,lcij), factij(nij_uniqe,lcij)
dimension txab(nij_uniqe,3,*)
dimension gci(nij_uniqe,ngci1,*),gcj(nij_uniqe,ngcj1,*)
c
dimension ij_uniqe(nij_uniqe)
c
dimension xa(3),xb(3)
c---------------------------------------------------------------
cnot par268=eps1*8.d0
par268= 8.d0
c---------------------------------------------------------------
c
if(which.eq.'left ') then
itypp=ityp
jtypp=jtyp
ngcii=ngci
ngcjj=ngcj
nqii=nqi
nqjj=nqj
lcii=lci
lcjj=lcj
else
itypp=ktyp
jtypp=ltyp
ngcii=ngck
ngcjj=ngcl
nqii=nqk
nqjj=nql
lcii=lck
lcjj=lcl
endif
c
c-------------------------------------------------------------
c for integral neglect (to massage contraction coef.)
c
contrij=dble(lcii*lcjj)
contrij=sqrt(contrij)
c-------------------------------------------------------------
c for gen.contr
c
ngctot=ngci+ngcj+ngck+ngcl
c-------------------------------------------------------------
c precalculations for the pairs IJ :
c
c-------------------------------old
cccc ijpar=0
cccc do 100 ijp=nijbeg,nijend
cccc ijpar=ijpar+1
cccc ijcs=ijbl(ibl,ijp)
c-------------------------------old
c
do 100 ijpar=1,nij_uniqe
ijcs=ij_uniqe(ijpar)
call get_ij_half(ijcs,ics,jcs)
c
fact1=1.0d0
cpnl if(ics.eq.jcs) then
cpnl if(ngctot.eq.0) fact1=fact1*0.5d0
cpnl endif
c
c starting contr
ia=inx(1,ics)+1
ja=inx(1,jcs)+1
c last contr
ie=inx(5,ics)
je=inx(5,jcs)
c
c number of general contr.
c ngci=inx(4,ics)
c ngcj=inx(4,jcs)
c in the common block contr
c
iatom=inx(2,ics)
jatom=inx(2,jcs)
c
c center23 (atom number 0 is the one with s-orbital/zero-exp.)
c
if(iatom.eq.0) iatom=jatom
if(jatom.eq.0) jatom=iatom
c
do 150 i=1,3
if(iatom.eq.0 .and. jatom.eq.0) then
xa(i)=0.0d0
xb(i)=0.0d0
else
xa(i)=datnuc(1+i,iatom)
xb(i)=datnuc(1+i,jatom)
endif
xab(ijpar,i)=xa(i)-xb(i)
150 continue
c
ji=0
is1=0
do 200 is=ia,ie
is1=is1+1
aa=datbas(1,is)
aaa(ijpar,is1)=aa
if(ngctot.eq.0) then
csi=datbas(2,is)
cpi=datbas(3,is)
coefi=csi
est_is=csi
est_ip=1.d0
if(itypp.eq.3) then
est_ip=cpi
coefi=cpi
csi=csi/cpi
facti=csi
endif
coefi=coefi*fact1
if(which.eq.'right') coefi=coefi*par268
cis(ijpar,is1)=csi
else
c gen.contr. shell is somewhere
est_is=1.0d0
do 210 ig=0,ngcii
gci(ijpar,ig+1,is1)=datbas(ig+2,is)
210 continue
endif
c
js1=0
do 200 js=ja,je
js1=js1+1
ji=ji+1
bb=datbas(1,js)
bbb(ijpar,js1)=bb
if(ngctot.eq.0) then
csj=datbas(2,js)
cpj=datbas(3,js)
coefj=csj
est_js=csj
est_jp=1.d0
if(jtypp.eq.3) est_jp=cpj
if(jtypp.eq.3) coefj=cpj
c
coefij(ijpar,ji )=coefi*coefj
c
if(jtypp.eq.3) then
csj=csj/cpj
factj=csj
if(itypp.eq.3) then
factij(ijpar,ji )=facti*factj
endif
endif
cjs(ijpar,js1)=csj
else
c gen.contr.
coefij(ijpar,ji )=1.0d0
est_js=1.0d0
if(which.eq.'right') coefij(ijpar,ji)=par268
c
do 220 jg=0,ngcjj
gcj(ijpar,jg+1,js1)=datbas(jg+2,js)
220 continue
endif
c
sab= abprim(ijpar,ji,3)
aa1=aa*abprim(ijpar,ji,2)
bb1=bb*abprim(ijpar,ji,2)
coefij(ijpar,ji)=coefij(ijpar,ji) *sab
c
do 230 l=1,3
xparij(ijpar,l,ji,1)=aa1*xa(l)+bb1*xb(l) ! xp(ijpar,l,ji)
xxl=xa(l)
if(nqii.lt.nqjj) xxl=xb(l)
xparij(ijpar,l,ji,2)=xparij(ijpar,l,ji,1)-xxl ! xpn
xparij(ijpar,l,ji,3)=aa*xa(l)+bb*xb(l) ! xpp
c center23:
if(aa.le.0.0d0 .or. bb.le.0.0d0) then
xparij(ijpar,l,ji,2)=0.0d0
endif
230 continue
c------------------------------------------------------------------
c For integral neglect :
c no l-shells
if(itypp.ne.3 .and. jtypp.ne.3) then
factab=abs( est_is*est_js )
endif
c l-shells
if(itypp.eq.3 .and. jtypp.ne.3) then
fcts= abs( est_is*est_js )
fctp= abs( est_ip*est_js )
factab=max( fcts , fctp )
endif
if(itypp.ne.3 .and. jtypp.eq.3) then
fcts= abs( est_is*est_js )
fctp= abs( est_is*est_jp )
factab=max( fcts , fctp )
endif
if(itypp.eq.3 .and. jtypp.eq.3) then
fctss= abs( est_is*est_js )
fctsp= abs( est_is*est_jp )
fctps= abs( est_ip*est_js )
fctpp= abs( est_ip*est_jp )
factab=max(fctss,fctsp,fctps,fctpp)
endif
c
c----
factab=factab*contrij
if(factab.gt.1.d0) factab=1.d0
c----
estab(ijpar,ji)=factab*sab
estab(ijpar,ji)=estab(ijpar,ji)*estab(ijpar,ji)
c
c------------------------------------------------------------------
c
200 continue
100 continue
c
ctxab
c
if(nqii.ge.nqjj) then
ijs1=0
do 151 is1=1,lcii
do 151 js1=1,lcjj
ijs1=ijs1+1
do 151 ijpar=1,nij_uniqe
txab(ijpar,1,ijs1)=-bbb(ijpar,js1)*xab(ijpar,1)
txab(ijpar,2,ijs1)=-bbb(ijpar,js1)*xab(ijpar,2)
txab(ijpar,3,ijs1)=-bbb(ijpar,js1)*xab(ijpar,3)
c center23:
aa=aaa(ijpar,is1)
if(aa.le.0.0d0) then
txab(ijpar,1,ijs1)=0.0d0
txab(ijpar,2,ijs1)=0.0d0
txab(ijpar,3,ijs1)=0.0d0
endif
151 continue
else
ijs1=0
do 152 is1=1,lcii
do 152 js1=1,lcjj
ijs1=ijs1+1
do 152 ijpar=1,nij_uniqe
txab(ijpar,1,ijs1)= aaa(ijpar,is1)*xab(ijpar,1)
txab(ijpar,2,ijs1)= aaa(ijpar,is1)*xab(ijpar,2)
txab(ijpar,3,ijs1)= aaa(ijpar,is1)*xab(ijpar,3)
c center23:
bb=bbb(ijpar,js1)
if(bb.le.0.0d0) then
txab(ijpar,1,ijs1)=0.0d0
txab(ijpar,2,ijs1)=0.0d0
txab(ijpar,3,ijs1)=0.0d0
endif
152 continue
endif
c
c for the case with mmax=2 - special cases
c
if ( mmax.eq.2 ) then
if (itypp.gt.1 .or. jtypp.gt.1 ) then
do 153 ijs1=1,lcij
do 153 ijpar=1,nij_uniqe
rapb1=abprim(ijpar,ijs1,2)
txab(ijpar,1,ijs1)=txab(ijpar,1,ijs1)*rapb1
txab(ijpar,2,ijs1)=txab(ijpar,2,ijs1)*rapb1
txab(ijpar,3,ijs1)=txab(ijpar,3,ijs1)*rapb1
153 continue
endif
endif
c------------------------------------------------------------------
c for gradient derivative integrals rescale exponents by 2 :
c
do is1=1,lcii
do ijpar=1,nij_uniqe
aaa(ijpar,is1)= aaa(ijpar,is1)+aaa(ijpar,is1)
enddo
enddo
do js1=1,lcjj
do ijpar=1,nij_uniqe
bbb(ijpar,js1)= bbb(ijpar,js1)+bbb(ijpar,js1)
enddo
enddo
c------------------------------------------------------------------
c
end
c====================================================================
subroutine precal2b_1(mmax1,lcij,rapb,abnia, nij_uniqe,ij_uniqe )
c-------------------------------------------------------------------
c OUTPUT
c -------
c For each pair of primitive shells ij (kl) from IJ (KL) contracted
c pair belonging to a given block of quartets with total ang.mom. MMAX
c
c 1. ABNIA(IJ,L,ij) - L*( 0.5/(a+b) ) with L=1,2,...MMAX-1
c-------------------------------------------------------------------
implicit real*8 (a-h,o-z)
dimension rapb(nij_uniqe,*),abnia(nij_uniqe,mmax1,*)
dimension ij_uniqe(nij_uniqe)
c--------------------------
do 150 ij=1,lcij
do 200 ijpar=1,nij_uniqe
apb2=0.5d0*rapb(ijpar,ij)
abnia(ijpar,1,ij)=apb2
do 250 i=2,mmax1
abnia(ijpar,i,ij)=abnia(ijpar,i-1,ij)+apb2
250 continue
200 continue
150 continue
c
end
c====================================================================
subroutine precal2c_1(rapb,rcpd, habcd,nhabcd,nfumax,
* nij_uniqe,ij_uniqe, nkl_uniqe,kl_uniqe)
c-----------------------------------------------------------------------
c OUTPUT
c ------
c For each pair of primitive shells ij (kl) from IJ (KL) contracted
c pair belonging to a given block of quartets with total ang.mom. MMAX
c
c 3. HABCD(IJ,lx,ifu,ij) or HABCD(KL,lx,ifu,kl)
c
c where IFU denotes number of elementary function from 1 up to the
c total number of functions corresponding to the MMAX-1 /for example
c for mmax=3 it is from 1 to 10 - s,x,y,z,xx,yy,zz,xy,xz,yz /
c The second index lx stays for x,y or z and is used to find the power
c of an elementary function in these directions from matrix HNIA which
c is constant and is set up in BLOCK DATA logobsa. For example :
c
c habcd(klpar,1=x,ifu,kl)=hnia(1,ifu)*rcpd(klpar,kl)
c
c HABCD is used only in Tracy recursion in routines TRACIJ, TRACKL
c-----------------------------------------------------------------------
implicit real*8 (a-h,o-z)
common /contr/ ngci,ngcj,ngck,ngcl,lci,lcj,lck,lcl,lcij,lckl
#include "texas_lpar.fh"
c
common/obarai/
* lni,lnj,lnk,lnl,lnij,lnkl,lnijkl,MMAX,
* NQI,NQJ,NQK,NQL,NSIJ,NSKL,
* NQIJ,NQIJ1,NSIJ1,NQKL,NQKL1,NSKL1,ijbeg,klbeg
c
dimension rapb(nij_uniqe,*),rcpd(nkl_uniqe,*)
dimension habcd(nhabcd,3,nfumax,*)
dimension ij_uniqe(nij_uniqe),kl_uniqe(nkl_uniqe)
c-----------------------
do 170 kl=1,lckl
do 180 ifu=1,nfumax
hx=hnia(1,ifu)
hy=hnia(2,ifu)
hz=hnia(3,ifu)
cccccccc do 190 klpar=1,npkl
do 190 klpar=1,nkl_uniqe
habcd(klpar,1,ifu,kl)=hx*rcpd(klpar,kl)
habcd(klpar,2,ifu,kl)=hy*rcpd(klpar,kl)
habcd(klpar,3,ifu,kl)=hz*rcpd(klpar,kl)
190 continue
180 continue
170 continue
c
end
c====================================================================
subroutine prec4neg_1(nbls_n0 , map_n0, ij,kl,lc12,lc34,
* estab,estcd, apb,cpd,coefij,coefkl,xp,xq,
* map_ij, map_kl, nij_uniqe,nkl_uniqe,
coutput
* rppq,rhoapb,rhocpd,rys,const,nbls1,index)
c--------------------------------------------------------------------
implicit real*8 (a-h,o-z)
common /types/iityp,jjtyp,kktyp,lltyp, ityp,jtyp,ktyp,ltyp
common /neglect/ eps,eps1,epsr
c-------
dimension map_n0(*)
c2002 dimension map_ij(isbl_size),map_kl(isbl_size)
dimension map_ij( * ),map_kl( * )
dimension index(*)
c-------
dimension apb(nij_uniqe,lc12),cpd(nkl_uniqe,lc34)
dimension coefij(nij_uniqe,lc12),coefkl(nkl_uniqe,lc34)
dimension estab(nij_uniqe,lc12), estcd(nkl_uniqe,lc34)
dimension xp(nij_uniqe,3,*),xq(nkl_uniqe,3,*)
c----output
dimension rppq(*),rhoapb(*),rhocpd(*),rys(*),const(*)
c
c---------------------------------------------------------------
sqrpold=1.0d0
rpold=1.0d0
abpcd1r=0.0d0
abpcdr=0.0d0
c-----------------------------------------------------------------
c ijkl1=0
c ijklp=0
c do 100 iqp=1,isbl_size
c iq=isbl_q(isbl_point+iqp)
c if(iq.eq.0) go to 100
c
c ijklp=ijklp+1
c2002
c
ijkl1=0
do 100 ijklp=1,nbls_n0
iqp=map_n0(ijklp)
ijpar=map_ij(iqp) ! map to uniqe pairs
klpar=map_kl(iqp)
c
apb1=apb(ijpar,ij)
cpd1=cpd(klpar,kl)
c
abpcd1=apb1+cpd1
if(abpcd1.ne.abpcd1r) then
abpcd1r=abpcd1
abpcdr=1.0d0/abpcd1r
endif
c
estim=estab(ijpar,ij)*estcd(klpar,kl)*abpcdr
if(estim.gt.epsr) then
ijkl1=ijkl1+1
index(ijkl1)=ijklp
c
rppq(ijkl1)=abpcdr
rhoapb(ijkl1)=abpcdr*cpd1
rhocpd(ijkl1)=abpcdr*apb1
abxcd=apb1*cpd1
rho1=abxcd*abpcdr
c
x1= xp(ijpar,1,ij) - xq(klpar,1,kl)
x2= xp(ijpar,2,ij) - xq(klpar,2,kl)
x3= xp(ijpar,3,ij) - xq(klpar,3,kl)
c
rr2=x1*x1 + x2*x2 + x3*x3
rys(ijkl1)=rr2*rho1
c
if(abpcdr.ne.rpold) then
rpold=abpcdr
sqrpold=sqrt(rpold)
endif
c
const(ijkl1)=coefij(ijpar,ij)*coefkl(klpar,kl)*sqrpold
c
endif
100 continue
c
nbls1=ijkl1
c
end
c====================================================================
subroutine precspec_1(nbls_n0 , map_n0, ij,kl,lc12,lc34,
* indxij,indxkl,
* estab,estcd, apb,cpd,coefij,coefkl,xp,xq,
* rapb,rcpd,txab,txcd,
* map_ij,map_kl,
* nij_uniqe,nkl_uniqe,
c output
* rys,const,xpqr,txxr,nbls1,index)
c-------------------------------------------------------------------
implicit real*8 (a-h,o-z)
common /types/iityp,jjtyp,kktyp,lltyp, ityp,jtyp,ktyp,ltyp
common /neglect/ eps,eps1,epsr
c---------------
dimension map_n0(*)
c2002 dimension map_ij(isbl_size),map_kl(isbl_size)
dimension map_ij( * ),map_kl( * )
dimension indxij(*),indxkl(*),index(*)
c---------------
dimension apb(nij_uniqe,lc12),cpd(nkl_uniqe,lc34)
dimension rapb(nij_uniqe,*),rcpd(nkl_uniqe,*)
dimension coefij(nij_uniqe,lc12),coefkl(nkl_uniqe,lc34)
dimension estab(nij_uniqe,lc12), estcd(nkl_uniqe,lc34)
dimension txab(nij_uniqe,3,*),txcd(nkl_uniqe,3,*)
dimension xp(nij_uniqe,3,*),xq(nkl_uniqe,3,*)
c
dimension rys(*),const(*)
dimension xpqr(3,*),txxr(3,*)
c
c---------------------------------------------------------------
sqrpold=1.0d0
rpold=1.0d0
c
abpcd1r=0.0d0
abpcdr=0.0d0
c-----------------------------
c2002 ijkl1=0
c ijklp=0
c do 100 iqp=1,isbl_size
c iq=isbl_q(isbl_point+iqp)
c if(iq.eq.0) go to 100
c ijklp=ijklp+1
c-----------------------------
c
c
ijkl1=0
do 100 ijklp=1,nbls_n0
iqp=map_n0(ijklp)
c
ijpar=map_ij(iqp) ! map to uniqe pairs
klpar=map_kl(iqp)
c
apb1=apb(ijpar,ij)
cpd1=cpd(klpar,kl)
c
abpcd1=apb1+cpd1
if(abpcd1.ne.abpcd1r) then
abpcd1r=abpcd1
abpcdr=1.0d0/abpcd1r
endif
c
estim=estab(ijpar,ij)*estcd(klpar,kl)*abpcdr
if(estim.gt.epsr) then
ijkl1=ijkl1+1
index(ijkl1)=ijklp
c
abxcd=apb1*cpd1
rho1=abxcd*abpcdr
c
x1= xp(ijpar,1,ij) - xq(klpar,1,kl)
x2= xp(ijpar,2,ij) - xq(klpar,2,kl)
x3= xp(ijpar,3,ij) - xq(klpar,3,kl)
c
xpqr(1,ijkl1)=x1*rho1
xpqr(2,ijkl1)=x2*rho1
xpqr(3,ijkl1)=x3*rho1
c
rr2=x1*x1 + x2*x2 + x3*x3
rys(ijkl1)=rr2*rho1
c
if(abpcdr.ne.rpold) then
rpold=abpcdr
sqrpold=sqrt(rpold)
endif
c
const(ijkl1)=coefij(ijpar,ij)*coefkl(klpar,kl)*sqrpold
c
endif
100 continue
c
nbls1=ijkl1
if(nbls1.eq.0) return
c
cnew
if (ityp.gt.1 .or. jtyp.gt.1 ) then
do 210 i=1,nbls1
ijkl=index(i)
ijpar=indxij(ijkl) ! uniqe pair
c
xpqr(1,i)=xpqr(1,i)*rapb(ijpar,ij)
xpqr(2,i)=xpqr(2,i)*rapb(ijpar,ij)
xpqr(3,i)=xpqr(3,i)*rapb(ijpar,ij)
c
txxr(1,i)=txab(ijpar,1,ij)
txxr(2,i)=txab(ijpar,2,ij)
txxr(3,i)=txab(ijpar,3,ij)
210 continue
endif
c
if (ktyp.gt.1 .or. ltyp.gt.1 ) then
do 220 i=1,nbls1
ijkl=index(i)
klpar=indxkl(ijkl)
xpqr(1,i)=xpqr(1,i)*rcpd(klpar,kl)
xpqr(2,i)=xpqr(2,i)*rcpd(klpar,kl)
xpqr(3,i)=xpqr(3,i)*rcpd(klpar,kl)
c
txxr(1,i)=txcd(klpar,1,kl)
txxr(2,i)=txcd(klpar,2,kl)
txxr(3,i)=txcd(klpar,3,kl)
220 continue
endif
c
end
c====================================================================
subroutine xwpq_1(nbls1,xwp,xwq,p1234, lcij,lckl,
* indxij,indxkl,index, nij_uniqe,nkl_uniqe,
* rppq,xp,xq,xpp,xqq,
* txab,txcd,apb,rcpd,cpd,rapb)
c-----------------------------------------------
c OUTPUT
c
c XWP(ijkl1) - coordinates of W-P, where W=(XPP+XQQ)/(a+b+c+d)
c XWQ(ijkl1) - coordinates of W-Q
c P1234(ijkl1)=(txab+txcd)*(rcpd OR rapb)
c-----------------------------------------------
c
implicit real*8 (a-h,o-z)
c
common/obarai/
* lni,lnj,lnk,lnl,lnij,lnkl,lnijkl,MMAX,
* NQI,NQJ,NQK,NQL,NSIJ,NSKL,
* NQIJ,NQIJ1,NSIJ1,NQKL,NQKL1,NSKL1,ijbeg,klbeg
c
dimension xwp(nbls1,3),xwq(nbls1,3),p1234(nbls1,3)
c
dimension indxij(*),indxkl(*),index(*)
c
dimension xp(nij_uniqe,3,*), xq(nkl_uniqe,3,*)
dimension xpp(nij_uniqe,3,*),xqq(nkl_uniqe,3,*)
dimension apb(nij_uniqe,*),rapb(nij_uniqe,*)
dimension cpd(nkl_uniqe,*),rcpd(nkl_uniqe,*)
dimension txab(nij_uniqe,3,*),txcd(nkl_uniqe,3,*)
dimension rppq(*)
c---------------------------------------------------------------
do 100 i=1,nbls1
c
ijkl=index(i)
ijpar=indxij(ijkl) ! uniqe pair now !!!!
klpar=indxkl(ijkl) ! uniqe pair now !!!!
c
rppq1=rppq(i)
c
xwl=( xpp(ijpar,1,lcij) + xqq(klpar,1,lckl) )*rppq1
ywl=( xpp(ijpar,2,lcij) + xqq(klpar,2,lckl) )*rppq1
zwl=( xpp(ijpar,3,lcij) + xqq(klpar,3,lckl) )*rppq1
c
XWP(i,1)=xwl-XP(ijpar,1,lcij)
XWP(i,2)=ywl-XP(ijpar,2,lcij)
XWP(i,3)=zwl-XP(ijpar,3,lcij)
c
XWQ(i,1)=XWL-XQ(klpar,1,lckl)
XWQ(i,2)=YWL-XQ(klpar,2,lckl)
XWQ(i,3)=ZWL-XQ(klpar,3,lckl)
c
c for Tracy recursion:
c
rcpd1=rcpd(klpar,lckl)
c
p1234(i,1)=(txab(ijpar,1,lcij)+txcd(klpar,1,lckl))*rcpd1
p1234(i,2)=(txab(ijpar,2,lcij)+txcd(klpar,2,lckl))*rcpd1
p1234(i,3)=(txab(ijpar,3,lcij)+txcd(klpar,3,lckl))*rcpd1
c
100 continue
c---------------------------------------------------------------
c
end
c====================================================================
subroutine specase_1(bl,first,nbls,nbls1, index,indxij,indxkl,
* npij,npkl,ii,jj,kk,ll,
* cis,cjs,cks,cls,
* buf,buf1, const,rysx,xpqr,txxr,concoe)
c*
implicit real*8 (a-h,o-z)
logical first
common /types/iityp,jjtyp,kktyp,lltyp, ityp,jtyp,ktyp,ltyp
common /rys/ xrys,rysr(10),rysw(10),t,f0,f1,f2,f3,f4,f5,nroots
c
common/obarai/
* lni,lnj,lnk,lnl,lnij,lnkl,lnijkl,mmax,
* nqi,nqj,nqk,nql,nsij,nskl,
* nqij,nqij1,nsij1,nqkl,nqkl1,nskl1,ijbeg,klbeg
c
c-------------------------------------------------------------------
c
dimension bl(*)
dimension index(*),indxij(*),indxkl(*)
dimension xpqr(3,*),txxr(3,*)
dimension cis(npij,*),cjs(npij,*),cks(npkl,*),cls(npkl,*)
dimension const(*),rysx(*),concoe(*)
dimension buf(nbls,*),buf1(nbls1,4)
c
c-------------------------------------------------------------------
c this routine constitues the special code for
c two types of integrals over nbls quartets of primitive shells
c 1. (ss|ss)
c 2. (xs|ss),(sx|ss),(ss|xs),(ss|sx) where x=p or l
c these integrals are also contracted here.
c
c
c input
c ------
c all precalculated values for whole block :
c
c const(nbls) - contains consts=pi3sabcd/(pqsqrt(ppq)) for all int.
c rysx(nbls) - contains xrys i.e. arguments for fm,ft0 routines
c xp,xp - geometry for p,q
c
c output
c ------
c buf(nbls,) -contains final contracted integrals
c-------------------------------------------------------------------
c
c memory for f00,f11 :
c
call getmem(nbls1,if00)
call getmem(nbls1,if11)
c
if00=if00-1
if11=if11-1
c
c
do 100 i=1,nbls1
xrys=rysx(i)
call ft0
bl(if00+i)=f0
bl(if11+i)=f1
100 continue
c
c special code for (ss ss) integrals
c
if(mmax.eq.1) then
do 2031 i=1,nbls1
buf1(i,1)=const(i)*bl(if00+i)
2031 continue
go to 203
endif
c
c *** special code for (ps ss), (sp ss) (ss ps) and (ss sp)
c
cxxxx if(mmax.eq.2) then
intct=0
if (ityp.gt.1) then
do 101 i=1,nbls1
xpqr(1,i)=xpqr(1,i)*bl(if11+i) - txxr(1,i)*bl(if00+i)
xpqr(2,i)=xpqr(2,i)*bl(if11+i) - txxr(2,i)*bl(if00+i)
xpqr(3,i)=xpqr(3,i)*bl(if11+i) - txxr(3,i)*bl(if00+i)
101 continue
else if (jtyp.gt.1) then
do 102 i=1,nbls1
xpqr(1,i)=xpqr(1,i)*bl(if11+i) + txxr(1,i)*bl(if00+i)
xpqr(2,i)=xpqr(2,i)*bl(if11+i) + txxr(2,i)*bl(if00+i)
xpqr(3,i)=xpqr(3,i)*bl(if11+i) + txxr(3,i)*bl(if00+i)
102 continue
else if (ktyp.gt.1) then
do 103 i=1,nbls1
xpqr(1,i)=-xpqr(1,i)*bl(if11+i) - txxr(1,i)*bl(if00+i)
xpqr(2,i)=-xpqr(2,i)*bl(if11+i) - txxr(2,i)*bl(if00+i)
xpqr(3,i)=-xpqr(3,i)*bl(if11+i) - txxr(3,i)*bl(if00+i)
103 continue
else
do 104 i=1,nbls1
xpqr(1,i)=-xpqr(1,i)*bl(if11+i) + txxr(1,i)*bl(if00+i)
xpqr(2,i)=-xpqr(2,i)*bl(if11+i) + txxr(2,i)*bl(if00+i)
xpqr(3,i)=-xpqr(3,i)*bl(if11+i) + txxr(3,i)*bl(if00+i)
104 continue
endif
c
if( max(ityp,jtyp,ktyp,ltyp).eq.3) then
if(ityp.eq.3) then
do 1051 i=1,nbls1
ijkl=index(i)
ijpar=indxij(ijkl) ! uniqe pair now !!
concoe(i)=const(i)*cis(ijpar,ii)
1051 continue
endif
if(jtyp.eq.3) then
do 1052 i=1,nbls1
ijkl=index(i)
ijpar=indxij(ijkl)
concoe(i)=const(i)*cjs(ijpar,jj)
1052 continue
endif
if(ktyp.eq.3) then
do 1053 i=1,nbls1
ijkl=index(i)
klpar=indxkl(ijkl)
concoe(i)=const(i)*cks(klpar,kk)
1053 continue
endif
if(ltyp.eq.3) then
do 1054 i=1,nbls1
ijkl=index(i)
klpar=indxkl(ijkl)
concoe(i)=const(i)*cls(klpar,ll)
1054 continue
endif
c
do 105 i=1,nbls1
buf1(i,1)=concoe(i)*bl(if00+i)
105 continue
intct=1
endif
c
do 106 i=1,nbls1
buf1(i,intct+1)=-xpqr(1,i)*const(i)
buf1(i,intct+2)=-xpqr(2,i)*const(i)
buf1(i,intct+3)=-xpqr(3,i)*const(i)
106 continue
c
c**********************************************************
c
203 continue
if(first) then
do 204 icx=1,lnijkl
do 204 i=1,nbls1
ijkl=index(i)
buf(ijkl,icx)=buf1(i,icx)
204 continue
first=.false.
else
do 205 icx=1,lnijkl
do 205 i=1,nbls1
ijkl=index(i)
buf(ijkl,icx)=buf(ijkl,icx)+buf1(i,icx)
205 continue
endif
c
c relise memory
c
call retmem(2)
c
end
c====================================================================
subroutine precal2x_1(iabprim,ijdim,iapb,i1apb,isab)
c-------------------------------------------------------------
c precalculations for the pairs IJ :
c
iapb =iabprim
i1apb=iabprim + ijdim
isab =iabprim + ijdim*2
c
end
c====================================================================
subroutine ab_prim_2(ibl, datnuc,datbas,inx,apb,rapb,sab,ijcont,
* nij_uniqe,ij_uniqe )
implicit real*8 (a-h,o-z)
common /neglect/ eps,eps1,epsr
c
dimension inx(12,*)
dimension datbas(13,*),datnuc(5,*)
cccc dimension abprim(nparij,ijcont,3)
dimension apb(ijcont),rapb(ijcont),sab(nij_uniqe,ijcont)
dimension ij_uniqe(nij_uniqe)
c
integer dimmx
parameter(dimmx=1500)
dimension sqrtx(dimmx),eexx(dimmx)
c---------------------------------------------------------------
cccc do 100 ijpar=1,nparij
cccc ijcs=ijbl(ibl,ijpar)
cnew
do 100 ijpar =1,nij_uniqe ! over uniqe pairs
c
ijcs=ij_uniqe(ijpar)
call get_ij_half(ijcs,ics,jcs)
c
ia=inx(1,ics)+1
ie=inx(5,ics)
iat=inx(2,ics)
ja=inx(1,jcs)+1
je=inx(5,jcs)
jat=inx(2,jcs)
c
c center23 (atom number 0 is the one with s-orbital/zero-exp.)
c
if(iat.eq.0) iat=jat
if(jat.eq.0) jat=iat
c
if(iat.eq.0 .and. jat.eq.0) then
xab=0.0d0
yab=0.0d0
zab=0.0d0
else
xab=datnuc(2,iat)-datnuc(2,jat)
yab=datnuc(3,iat)-datnuc(3,jat)
zab=datnuc(4,iat)-datnuc(4,jat)
endif
c
rr=xab*xab+yab*yab+zab*zab
c
ij=0
if((ie-ia+1)*(je-ja+1).gt.dimmx) call errquit(
A ' ab_prim_2: increased dimmx to ',
C (ie-ia+1)*(je-ja+1),0)
do 200 is=ia,ie
aa=datbas(1,is)
c----------------------------------
do 200 js=ja,je
bb=datbas(1,js)
ij=ij+1
c----------------------------------
if(aa.gt.0.0d0 .and. bb.gt.0.0d0) then
if(ijpar.eq.1) then
axb=aa*bb
apb(ij)=aa+bb
rapb(ij)=1.0d0/apb(ij)
e=axb*rapb(ij)
eexx(ij)=e
sqrtx(ij)=sqrt(sqrt(axb))**3
sqrt3=sqrtx(ij)
else
sqrt3=sqrtx(ij)
e=eexx(ij)
endif
cold sab(ijpar,ij)=rapb(ij)*sqrt3*exp(-e*rr)
cnew98......
err=e*rr
if(err.gt.46.d0) then ! was 32
sab(ijpar,ij)=0.d0
else
sab(ijpar,ij)=rapb(ij)*sqrt3*exp(-err)
endif
cnew98......
else
c center23:
if(aa.le.0.0d0 .and. bb.gt.0.0d0) then
c>>>>>>>>> write(8,*)' exp_a=zero ; ics=',ics
if(ijpar.eq.1) then
apb(ij)=aa+bb
rapb(ij)=1.0d0/apb(ij)
c>>*b-3/4 sqrtx(ij)= sqrt(bb) ! Sbb
sqrtx(ij)=1.0d0/sqrt(sqrt(bb)) ! sqrt(Sbb)
sqrt3=sqrtx(ij)
else
sqrt3=sqrtx(ij)
endif
sab(ijpar,ij)=sqrt3 ! Sbb
endif
if(aa.gt.0.0d0 .and. bb.le.0.0d0) then
c>>>>>>> write(8,*)' exp_b=zero ; jcs=',jcs
if(ijpar.eq.1) then
apb(ij)=aa+bb
rapb(ij)=1.0d0/apb(ij)
c>>>*a-3/4 sqrtx(ij)= sqrt(aa) ! Saa
sqrtx(ij)=1.0d0/sqrt(sqrt(aa)) ! sqrt(Saa)
sqrt3=sqrtx(ij)
else
sqrt3=sqrtx(ij)
endif
sab(ijpar,ij)=sqrt3 ! Saa
endif
if(aa.le.0.0d0 .and. bb.le.0.0d0) then
apb(ij)=0.0d0
rapb(ij)=0.0d0
sab(ijpar,ij)=0.0d0
endif
endif
c
c----------------------------------
200 continue
100 continue
end
c============================================================
subroutine precalc2_2(isupb,bl,mmax,mmax1,nfumax,
* nbl2,nbls, inx,ibl,kbl,npkl)
implicit real*8 (a-h,o-z)
#include "mafdecls.fh"
c-----------------------------------------------------------
common /primij/ iabprim, ijdim ,ijpar1
common /primkl/ kabprim, kldim ,klpar1
common /ilepar/ lpar_exe,lpar_num
c
common /infob/ inuc,ibas,na,nbf,nsh,ncf,ncs
c
common /types/itype,jtype,ktype,ltype,itype1,jtype1,ktype1,ltype1
common /contr/ ngci,ngcj,ngck,ngcl,lci,lcj,lck,lcl,lcij,lckl
common /gcont/ ngci1,ngcj1,ngck1,ngcl1,ngcd
c
common /memor5x/ ieab,iecd
common /memor5a/ iaa,ibb,icc,idd,icis,icjs,icks,icls,
* ixab,ixp,ixpn,ixpp,iabnia,iapb,i1apb,ifij,icij,isab,
* ixcd,ixq,ixqn,ixqq,icdnia,icpd,i1cpd,ifkl,ickl,iscd
common /memor5c/ itxab,itxcd,iabcd,ihabcd
common /memor5d/ iabnix,icdnix,ixpnx,ixqnx,ihabcdx
common /memor5e/ igci,igcj,igck,igcl,indgc,igcoef,
* icfg,jcfg,kcfg,lcfg, igcij,igckl
c
common /map4uniq/ nij_uniqe, ij_uniqe_p, map_ij,
* nkl_uniqe, kl_uniqe_p, map_kl
c
dimension bl(*), inx(12,*)
c---------------------------------------------------------------
c precalculations for pairs ij
c
call precal2x_2(iabprim,lcij,iapb,i1apb,isab)
c----------
lpar_exe=lpar_exe+1
lpar_num=lpar_num+nij_uniqe
call precal2a_2(dbl_mb(ibas),dbl_mb(inuc),inx,ibl,nbl2,
* bl(iabprim+lcij),bl(iabprim+2*lcij),
* lcij,bl(iaa),bl(ibb),bl(ieab),bl(icis),bl(icjs),
* bl(ixab),bl(ixp),bl(icij),bl(ifij), bl(itxab),
* bl(igcij),ngci1,ngcj1,'left ',
* nij_uniqe,bl(ij_uniqe_p) )
c----------
c for abnia
if(mmax.gt.2) then
call precal2b_2(mmax1,lcij, bl(i1apb),bl(iabnia))
endif
c----------------------------------------
c precalculations for pairs kl
c
c10 if(kbl.eq.ibl) then
c10 kabprim=iabprim
c10 kldim =ijdim
c10 endif
c10 if(npkl.ne.0) then
call precal2x_2(kabprim,lckl,icpd,i1cpd,iscd)
c
lpar_exe=lpar_exe+1
lpar_num=lpar_num+nkl_uniqe
call precal2a_2(dbl_mb(ibas),dbl_mb(inuc),inx,kbl,nbl2,
* bl(kabprim+lckl),bl(kabprim+2*lckl),
c not an error, icc should be twice :
* lckl,bl(icc),bl(icc),bl(iecd),bl(icks),bl(icls),
* bl(ixcd),bl(ixq),bl(ickl),bl(ifkl), bl(itxcd),
* bl(igckl),ngck1,ngcl1,'right',
* nkl_uniqe,bl(kl_uniqe_p) )
c--
c for cdnia
if(mmax.gt.2) then
call precal2b_2(mmax1,lckl, bl(i1cpd),bl(icdnia))
endif
c10 else
c10 call precdiag
c10 endif
c----------------------------------------
c for habcd
c
if(mmax.gt.2) then
call precal2c_2(lcij,lckl,bl(i1apb),bl(i1cpd),
* bl(ihabcd),nfumax )
endif
c---------------------------------------------------------------
c check for numerical stablility :
c
call num_stability_2(dbl_mb(ibas),inx,bl(icij),bl(ickl),
* nij_uniqe,bl(ij_uniqe_p),nkl_uniqe,bl(kl_uniqe_p))
c---------------------------------------------------------------
end
c====================================================================
subroutine precal2a_2(datbas,datnuc,inx,ibl,nbl2,
* rapb,sab,lcij,
* aaa,bbb,estab, cis,cjs,
* xab,xparij,coefij,factij,txab,
* gcij,ngci1,ngcj1,which ,
* nij_uniqe,ij_uniqe )
c
implicit real*8 (a-h,o-z)
character*5 which
c
c for gradient derivatives only :
character*11 scftype
character*8 where
common /runtype/ scftype,where
c
COMMON /types/itype,jtype,ktype,ltype,ityp,jtyp,ktyp,ltyp
common /contr/ ngci,ngcj,ngck,ngcl,lci,lcj,lck,lcl,lc12,lc34
common/obarai/
* lni,lnj,lnk,lnl,lnij,lnkl,lnijkl,MMAX,
* NQI,NQJ,NQK,NQL,NSIJ,NSKL,
* NQIJ,NQIJ1,NSIJ1,NQKL,NQKL1,NSKL1,ijbeg,klbeg
c
common /neglect/ eps,eps1,epsr
c---------------------------------------------------------------
dimension rapb(lcij),sab(nij_uniqe,lcij)
dimension datbas(13,*),datnuc(5,*)
dimension inx(12,*)
c
dimension cis(*),cjs(*)
dimension xab(nij_uniqe,3), xparij(nij_uniqe,3,lcij,3)
dimension estab (nij_uniqe,lcij)
dimension coefij(nij_uniqe,lcij), factij(lcij)
dimension txab(nij_uniqe,3,*)
dimension gcij(ngcj1,ngci1,lcij)
dimension aexp(100),bexp(100)
c only for where='forc' or 'hess'
dimension aaa(nij_uniqe,*),bbb(nij_uniqe,*)
c
dimension ij_uniqe(nij_uniqe)
c
dimension xa(3),xb(3)
c---------------------------------------------------------------
cnot par268=eps1*8.d0
par268= 8.d0
c---------------------------------------------------------------
c
if(which.eq.'left ') then
itypp=ityp
jtypp=jtyp
ngcii=ngci
ngcjj=ngcj
nqii=nqi
nqjj=nqj
lcii=lci
lcjj=lcj
else
itypp=ktyp
jtypp=ltyp
ngcii=ngck
ngcjj=ngcl
nqii=nqk
nqjj=nql
lcii=lck
lcjj=lcl
endif
c
c-------------------------------------------------------------
c for integral neglect (to massage contraction coef.)
c
contrij=dble(lcii*lcjj)
contrij=sqrt(contrij)
c-------------------------------------------------------------
c for gen.contr
c
ngctot=ngci+ngcj+ngck+ngcl
c-------------------------------------------------------------
c precalculations for the pairs IJ :
c
do 100 ijpar=1,nij_uniqe
ijcs=ij_uniqe(ijpar)
call get_ij_half(ijcs,ics,jcs)
c
fact1=1.0d0
cpnl if(ics.eq.jcs) then
cpnl if(ngctot.eq.0) fact1=fact1*0.5d0
cpnl endif
c
c starting contr
ia=inx(1,ics)+1
ja=inx(1,jcs)+1
c last contr
ie=inx(5,ics)
je=inx(5,jcs)
c number of general contr.
c ngci=inx(4,ics)
c ngcj=inx(4,jcs)
c in the common block contr
c
iatom=inx(2,ics)
jatom=inx(2,jcs)
c
c center23 (atom number 0 is the one with s-orbital/zero-exp.)
c
if(iatom.eq.0) iatom=jatom
if(jatom.eq.0) jatom=iatom
c
do 150 i=1,3
if(iatom.eq.0 .and. jatom.eq.0) then
xa(i)=0.0d0
xb(i)=0.0d0
else
xa(i)=datnuc(1+i,iatom)
xb(i)=datnuc(1+i,jatom)
endif
xab(ijpar,i)=xa(i)-xb(i)
150 continue
c
ji=0
is1=0
do 200 is=ia,ie
is1=is1+1
aa=datbas(1,is)
aexp(is1)=aa
cmoved down if(where.eq.'forc') aaa(ijpar,is1)=aa
cmoved down if(where.eq.'hess') aaa(ijpar,is1)=aa
if(ngctot.eq.0) then
csi=datbas(2,is)
cpi=datbas(3,is)
coefi=csi
est_is=csi
est_ip=1.0d0
if(itypp.eq.3) then
est_ip=cpi
coefi=cpi
csi=csi/cpi
facti=csi
endif
coefi=coefi*fact1
if(which.eq.'right') coefi=coefi*par268
cis(is1)=csi
endif
c
js1=0
do 200 js=ja,je
js1=js1+1
ji=ji+1
bb=datbas(1,js)
bexp(js1)=bb
cmoved down if(where.eq.'forc' .and. which.eq.'left ') bbb(ijpar,js1)=bb
cmoved down if(where.eq.'hess' .and. which.eq.'left ') bbb(ijpar,js1)=bb
if(ngctot.eq.0) then
csj=datbas(2,js)
cpj=datbas(3,js)
coefj=csj
est_js=csj
est_jp=1.0d0
if(jtypp.eq.3) est_jp=cpj
if(jtypp.eq.3) coefj=cpj
coefij(ijpar,ji )=coefi*coefj
if(jtypp.eq.3) then
csj=csj/cpj
factj=csj
if(itypp.eq.3) then
factij(ji)=facti*factj
endif
endif
cjs(js1)=csj
else
c gen.contr.
est_is=1.0d0
est_js=1.0d0
coefij(ijpar,ji )=1.0d0
if(which.eq.'right') coefij(ijpar,ji)=par268
endif
c
c--------------------------------
c for general contractions :
if(ngctot.gt.0 .and. ijpar.eq.1) then
do 210 ig=0,ngcii
gci=datbas(ig+2,is)
do 210 jg=0,ngcjj
gcj=gci*datbas(jg+2,js)
gcij(jg+1,ig+1,ji)=gcj
210 continue
endif
c--------------------------------
c
rapb1=rapb(ji)
sab1 =sab(ijpar,ji)
aa1=aa*rapb1
bb1=bb*rapb1
c
c-overlap coefij(ijpar,ji)=coefij(ijpar,ji)*rapb1*sab1
coefij(ijpar,ji)=coefij(ijpar,ji) *sab1
c--------------------------------
c
do 230 l=1,3
xparij(ijpar,l,ji,1)=aa1*xa(l) + bb1*xb(l) ! xp(ijpar,l,ji
xxl=xa(l)
if(nqii.lt.nqjj) xxl=xb(l)
xparij(ijpar,l,ji,2)=xparij(ijpar,l,ji,1)-xxl ! xpn
xparij(ijpar,l,ji,3)=aa*xa(l)+bb*xb(l) ! xpp
c center23:
if(aa.le.0.0d0 .or. bb.le.0.0d0) then
xparij(ijpar,l,ji,2)=0.0d0
endif
c
230 continue
c------------------------------------------------------------------
c For integral neglect :
c no l-shells
if(itypp.ne.3 .and. jtypp.ne.3) then
factab=abs( est_is*est_js )
endif
c l-shells
if(itypp.eq.3 .and. jtypp.ne.3) then
fcts= abs( est_is*est_js )
fctp= abs( est_ip*est_js )
factab=max( fcts , fctp )
endif
if(itypp.ne.3 .and. jtypp.eq.3) then
fcts= abs( est_is*est_js )
fctp= abs( est_is*est_jp )
factab=max( fcts , fctp )
endif
if(itypp.eq.3 .and. jtypp.eq.3) then
fctss= abs( est_is*est_js )
fctsp= abs( est_is*est_jp )
fctps= abs( est_ip*est_js )
fctpp= abs( est_ip*est_jp )
factab=max(fctss,fctsp,fctps,fctpp)
endif
c
c----
factab=factab*contrij
if(factab.gt.1.d0) factab=1.d0
c----
estab(ijpar,ji)=factab*sab1
estab(ijpar,ji)=estab(ijpar,ji)*estab(ijpar,ji)
c
c------------------------------------------------------------------
c
200 continue
100 continue
c
ctxab
c
if(nqii.ge.nqjj) then
ijs1=0
do 151 is1=1,lcii
aa1=aexp(is1)
do 151 js1=1,lcjj
bb1=bexp(js1)
ijs1=ijs1+1
do 151 ijpar=1,nij_uniqe
txab(ijpar,1,ijs1)=-bb1*xab(ijpar,1)
txab(ijpar,2,ijs1)=-bb1*xab(ijpar,2)
txab(ijpar,3,ijs1)=-bb1*xab(ijpar,3)
c center23:
if(aa1.le.0.0d0) then
txab(ijpar,1,ijs1)=0.0d0
txab(ijpar,2,ijs1)=0.0d0
txab(ijpar,3,ijs1)=0.0d0
endif
151 continue
else
ijs1=0
do 152 is1=1,lcii
aa1=aexp(is1)
do 152 js1=1,lcjj
bb1=bexp(js1)
ijs1=ijs1+1
do 152 ijpar=1,nij_uniqe
txab(ijpar,1,ijs1)= aa1*xab(ijpar,1)
txab(ijpar,2,ijs1)= aa1*xab(ijpar,2)
txab(ijpar,3,ijs1)= aa1*xab(ijpar,3)
c center23:
if(bb1.le.0.0d0) then
txab(ijpar,1,ijs1)=0.0d0
txab(ijpar,2,ijs1)=0.0d0
txab(ijpar,3,ijs1)=0.0d0
endif
152 continue
endif
c
c for the case with mmax=2 - special cases
c
if ( mmax.eq.2 ) then
if (itypp.gt.1 .or. jtypp.gt.1 ) then
do 153 ijs1=1,lcij
rapb1=rapb(ijs1)
cold do 153 ijpar=1,npij
do 153 ijpar=1,nij_uniqe
txab(ijpar,1,ijs1)=txab(ijpar,1,ijs1)*rapb1
txab(ijpar,2,ijs1)=txab(ijpar,2,ijs1)*rapb1
txab(ijpar,3,ijs1)=txab(ijpar,3,ijs1)*rapb1
153 continue
endif
endif
c------------------------------------------------------------------
c for gradient derivative integrals save exponents rescaled by 2 :
c
if(where.eq.'forc' .or. where.eq.'hess') then
do is1=1,lcii
aaa(1,is1)=aexp(is1)+aexp(is1)
enddo
if(which.eq.'left ') then
do js1=1,lcjj
bbb(1,js1)=bexp(js1)+bexp(js1)
enddo
endif
endif
c------------------------------------------------------------------
end
c====================================================================
subroutine precal2b_2(mmax1,lcij, rapb, abnia)
implicit real*8 (a-h,o-z)
dimension rapb(*), abnia(mmax1,*)
c
do 150 ij=1,lcij
apb2=0.5d0*rapb(ij)
abnia(1,ij)=apb2
do 250 i=2,mmax1
abnia(i,ij)=abnia(i-1,ij)+apb2
250 continue
150 continue
c
end
c====================================================================
subroutine precal2c_2(lcij,lckl,rapb,rcpd,habcd,nfumax)
implicit real*8 (a-h,o-z)
#include "texas_lpar.fh"
c
common/obarai/
* lni,lnj,lnk,lnl,lnij,lnkl,lnijkl,MMAX,
* NQI,NQJ,NQK,NQL,NSIJ,NSKL,
* NQIJ,NQIJ1,NSIJ1,NQKL,NQKL1,NSKL1,ijbeg,klbeg
c
dimension rapb(*),rcpd(*), habcd(3,nfumax,*)
c
c-----------------------
c Do it only for one pair (the first one)
c
do 170 kl=1,lckl
rcpdkl=rcpd(kl)
do 180 ifu=1,nfumax
hx=hnia(1,ifu)
hy=hnia(2,ifu)
hz=hnia(3,ifu)
habcd(1,ifu,kl)=hx*rcpdkl
habcd(2,ifu,kl)=hy*rcpdkl
habcd(3,ifu,kl)=hz*rcpdkl
180 continue
170 continue
c
end
c====================================================================
c2002 subroutine prec4neg_2(isbl_size,isbl_point,isbl_q,ndiag,
subroutine prec4neg_2(nbls_n0 , map_n0,
* ij,kl, lc12, lc34,
* estab,estcd, apb,cpd,coefij,coefkl,xp,xq,
* map_ij,map_kl,
* nij_uniqe,nkl_uniqe,
coutput
* rppq,rhoapb,rhocpd,rys,const,nbls1,index)
c--------------------------------------------------------------------
implicit real*8 (a-h,o-z)
common /neglect/ eps,eps1,epsr
c-------
dimension map_n0(*)
c2002 dimension map_ij(isbl_size),map_kl(isbl_size)
dimension map_ij( * ),map_kl( * )
dimension index(*)
c-------
dimension apb(lc12),cpd(lc34)
dimension coefij(nij_uniqe,lc12),coefkl(nkl_uniqe,lc34)
dimension estab(nij_uniqe,lc12), estcd(nkl_uniqe,lc34)
dimension xp(nij_uniqe,3,*),xq(nkl_uniqe,3,*)
c----output
ccc dimension rppq(*),rhoapb(*),rhocpd(*),rys(*),const(*)
c now scalars: rppq,rhoapb,rhocpd
dimension rys(*),const(*)
c
c---------------------------------------------------------------
c NEWER
apb1=apb(ij)
cpd1=cpd(kl)
c
abpcd1=apb1+cpd1
abxcd=apb1*cpd1
abpcdr=1.0d0/abpcd1
rho1=abxcd*abpcdr
c
sqrpold=sqrt(abpcdr)
c
rppq =abpcdr
rhoapb=abpcdr*cpd1
rhocpd=abpcdr*apb1
c-----------------------------------------------------------------
c ijkl1=0
c ijklp=0
c do 100 iqp=1,isbl_size
c iq=isbl_q(isbl_point+iqp)
c if(iq.eq.0) go to 100
c
c ijklp=ijklp+1
c
c2002
c
ijkl1=0
do 100 ijklp=1,nbls_n0
iqp=map_n0(ijklp)
c
ijpar=map_ij(iqp) ! map to uniqe pairs
klpar=map_kl(iqp)
c
estim=estab(ijpar,ij)*estcd(klpar,kl)*abpcdr
if(estim.gt.epsr) then
ijkl1=ijkl1+1
index(ijkl1)=ijklp
c
x1= xp(ijpar,1,ij) - xq(klpar,1,kl)
x2= xp(ijpar,2,ij) - xq(klpar,2,kl)
x3= xp(ijpar,3,ij) - xq(klpar,3,kl)
rr2=x1*x1 + x2*x2 + x3*x3
c
rys(ijkl1)=rr2*rho1
const(ijkl1)=coefij(ijpar,ij)*coefkl(klpar,kl)*sqrpold
c
endif
100 continue
c
nbls1=ijkl1
c
end
c====================================================================
c2002 subroutine precspec_2(isbl_size,isbl_point, isbl_q,ndiag,
subroutine precspec_2(nbls_n0 , map_n0,
* ij,kl, lc12, lc34, indxij,indxkl,
* estab,estcd, apb,cpd,coefij,coefkl,xp,xq,
* rapb,rcpd,txab,txcd,
* map_ij,map_kl, nij_uniqe,nkl_uniqe,
c output
* rys,const,xpqr,txxr,nbls1,index)
c-------------------------------------------------------------------
implicit real*8 (a-h,o-z)
common /types/iityp,jjtyp,kktyp,lltyp, ityp,jtyp,ktyp,ltyp
common /neglect/ eps,eps1,epsr
c---------------
dimension map_n0(*)
c2002 dimension map_ij(isbl_size),map_kl(isbl_size)
dimension map_ij( * ),map_kl( * )
dimension indxij(*),indxkl(*),index(*)
c---------------
dimension apb(lc12),cpd(lc34)
dimension rapb(lc12),rcpd(lc34)
dimension coefij(nij_uniqe,lc12),coefkl(nkl_uniqe,lc34)
dimension estab(nij_uniqe,lc12), estcd(nkl_uniqe,lc34)
dimension txab(nij_uniqe,3,*),txcd(nkl_uniqe,3,*)
dimension xp(nij_uniqe,3,*),xq(nkl_uniqe,3,*)
c
dimension rys(*),const(*)
dimension xpqr(3,*),txxr(3,*)
c
c---------------------------------------------------------------
apb1=apb(ij)
cpd1=cpd(kl)
c
abpcd1=apb1+cpd1
abxcd=apb1*cpd1
abpcd1r=abpcd1
abpcdr=1.0d0/abpcd1r
rho1=abxcd*abpcdr
c
sqrpold=sqrt(abpcdr)
c------------
c ijkl1=0
c ijklp=0
c do 100 iqp=1,isbl_size
c iq=isbl_q(isbl_point+iqp)
c if(iq.eq.0) go to 100
c
c ijklp=ijklp+1
c2002
c
ijkl1=0
do 100 ijklp=1,nbls_n0
iqp=map_n0(ijklp)
c
ijpar=map_ij(iqp) ! map to uniqe pairs
ijpar=map_ij(iqp) ! map to uniqe pairs
klpar=map_kl(iqp)
c
estim=estab(ijpar,ij)*estcd(klpar,kl)*abpcdr
if(estim.gt.epsr) then
ijkl1=ijkl1+1
index(ijkl1)=ijklp
c
x1= xp(ijpar,1,ij) - xq(klpar,1,kl)
x2= xp(ijpar,2,ij) - xq(klpar,2,kl)
x3= xp(ijpar,3,ij) - xq(klpar,3,kl)
c
xpqr(1,ijkl1)=x1*rho1
xpqr(2,ijkl1)=x2*rho1
xpqr(3,ijkl1)=x3*rho1
c
rr2=x1*x1 + x2*x2 + x3*x3
rys(ijkl1)=rr2*rho1
c
const(ijkl1)=coefij(ijpar,ij)*coefkl(klpar,kl)*sqrpold
c
endif
100 continue
c
nbls1=ijkl1
if(nbls1.eq.0) return
c
c new
if (ityp.gt.1 .or. jtyp.gt.1 ) then
rapbxxx=rapb(ij)
do 210 i=1,nbls1
ijkl=index(i)
ijpar=indxij(ijkl) ! uniqe pair
xpqr(1,i)=xpqr(1,i)*rapbxxx
xpqr(2,i)=xpqr(2,i)*rapbxxx
xpqr(3,i)=xpqr(3,i)*rapbxxx
c
txxr(1,i)=txab(ijpar,1,ij)
txxr(2,i)=txab(ijpar,2,ij)
txxr(3,i)=txab(ijpar,3,ij)
210 continue
endif
c
if (ktyp.gt.1 .or. ltyp.gt.1 ) then
rcpdxxx=rcpd(kl)
do 220 i=1,nbls1
ijkl=index(i)
klpar=indxkl(ijkl)
xpqr(1,i)=xpqr(1,i)*rcpdxxx
xpqr(2,i)=xpqr(2,i)*rcpdxxx
xpqr(3,i)=xpqr(3,i)*rcpdxxx
c
txxr(1,i)=txcd(klpar,1,kl)
txxr(2,i)=txcd(klpar,2,kl)
txxr(3,i)=txcd(klpar,3,kl)
220 continue
endif
c
end
c====================================================================
subroutine xwpq_2(nbls1,xwp,xwq,p1234,lc12, lc34,lcij,lckl,
* indxij,indxkl,index, nij_uniqe,nkl_uniqe,
* rppq,xp,xq,xpp,xqq,
* txab,txcd, apb,rcpd,cpd,rapb)
c98 * txab,txcd,abcd,apb,rcpd,cpd,rapb)
c---------------------------------------------------------------
c const_max is maximum of abs values of const(nbls1)
c OUTPUT : xwp(nbls1,3),xwq(nbls1,3),p1234(nbls1,3)
c---------------------------------------------------------------
implicit real*8 (a-h,o-z)
common /flops/ iflop(20)
common/obarai/
* lni,lnj,lnk,lnl,lnij,lnkl,lnijkl,MMAX,
* NQI,NQJ,NQK,NQL,NSIJ,NSKL,
* NQIJ,NQIJ1,NSIJ1,NQKL,NQKL1,NSKL1,ijbeg,klbeg
c
dimension xwp(nbls1,3),xwq(nbls1,3),p1234(nbls1,3)
dimension indxij(*),indxkl(*),index(*)
c
dimension xp(nij_uniqe,3,*),xq(nkl_uniqe,3,*)
dimension xpp(nij_uniqe,3,*),xqq(nkl_uniqe,3,*)
dimension txab(nij_uniqe,3,*),txcd(nkl_uniqe,3,*)
c
dimension apb(lc12),rapb(lc12)
dimension cpd(lc34),rcpd(lc34)
c---------------------------------------------------------------
rppq1=rppq
rcpd1=rcpd(lckl)
c
do 100 i=1,nbls1
ijkl=index(i)
ijpar=indxij(ijkl)
klpar=indxkl(ijkl)
c
xwl=( xpp(ijpar,1,lcij) + xqq(klpar,1,lckl) )*rppq1
ywl=( xpp(ijpar,2,lcij) + xqq(klpar,2,lckl) )*rppq1
zwl=( xpp(ijpar,3,lcij) + xqq(klpar,3,lckl) )*rppq1
c
XWP(i,1)=xwl-XP(ijpar,1,lcij)
XWP(i,2)=ywl-XP(ijpar,2,lcij)
XWP(i,3)=zwl-XP(ijpar,3,lcij)
c
XWQ(i,1)=XWL-XQ(klpar,1,lckl)
XWQ(i,2)=YWL-XQ(klpar,2,lckl)
XWQ(i,3)=ZWL-XQ(klpar,3,lckl)
c
c for Tracy recursion :
c
p1234(i,1)=(txab(ijpar,1,lcij)+txcd(klpar,1,lckl))*rcpd1
p1234(i,2)=(txab(ijpar,2,lcij)+txcd(klpar,2,lckl))*rcpd1
p1234(i,3)=(txab(ijpar,3,lcij)+txcd(klpar,3,lckl))*rcpd1
c
100 continue
c
c---------------------------------------------------------------
end
c====================================================================
subroutine specase_2(bl,first,nbls,nbls1, index,
* npij,npkl,ii,jj,kk,ll,
* cis,cjs,cks,cls,
* buf,buf1, const,rysx,xpqr,txxr,concoe)
implicit real*8 (a-h,o-z)
logical first
common /types/iityp,jjtyp,kktyp,lltyp, ityp,jtyp,ktyp,ltyp
common /rys/ xrys,rysr(10),rysw(10),t,f0,f1,f2,f3,f4,f5,nroots
common/obarai/
* lni,lnj,lnk,lnl,lnij,lnkl,lnijkl,mmax,
* nqi,nqj,nqk,nql,nsij,nskl,
* nqij,nqij1,nsij1,nqkl,nqkl1,nskl1,ijbeg,klbeg
c
dimension bl(*)
dimension index(*)
dimension xpqr(3,*),txxr(3,*)
dimension cis(*),cjs(*),cks(*),cls(*)
dimension const(*),rysx(*),concoe(*)
dimension buf(nbls,*),buf1(nbls1,4)
c---------------------------------------------------------------
c this subroutine constitues the special code for
c two types of integrals over nbls quartets of primitive shells
c 1. (ss|ss)
c 2. (xs|ss),(sx|ss),(ss|xs),(ss|sx) where x=p or l
c these integrals are also contracted here.
c
c this routine is called from the twoe subroutine.
c
c
c input
c ------
c all precalculated values for whole block :
c
c const(nbls) - contains consts=pi3sabcd/(pqsqrt(ppq)) for all int.
c rysx(nbls) - contains xrys i.e. arguments for fm,ft0 routines
c xp,xp - geometry for p,q
c
c output
c ------
c buf(nbls,) -contains final contracted integrals
c---------------------------------------------------------------
c
c memory for f00,f11 :
c
call getmem(nbls1,if00)
call getmem(nbls1,if11)
c
if00=if00-1
if11=if11-1
c
do 100 i=1,nbls1
xrys=rysx(i)
call ft0
bl(if00+i)=f0
bl(if11+i)=f1
100 continue
c
c special code for (ss ss) integrals
c
if(mmax.eq.1) then
do 2031 i=1,nbls1
buf1(i,1)=const(i)*bl(if00+i)
2031 continue
go to 203
endif
c
c special code for (ps ss), (sp ss) (ss ps) and (ss sp)
c
cxxxx if(mmax.eq.2) then
intct=0
if (ityp.gt.1) then
do 101 i=1,nbls1
xpqr(1,i)=xpqr(1,i)*bl(if11+i) - txxr(1,i)*bl(if00+i)
xpqr(2,i)=xpqr(2,i)*bl(if11+i) - txxr(2,i)*bl(if00+i)
xpqr(3,i)=xpqr(3,i)*bl(if11+i) - txxr(3,i)*bl(if00+i)
101 continue
else if (jtyp.gt.1) then
do 102 i=1,nbls1
xpqr(1,i)=xpqr(1,i)*bl(if11+i) + txxr(1,i)*bl(if00+i)
xpqr(2,i)=xpqr(2,i)*bl(if11+i) + txxr(2,i)*bl(if00+i)
xpqr(3,i)=xpqr(3,i)*bl(if11+i) + txxr(3,i)*bl(if00+i)
102 continue
else if (ktyp.gt.1) then
do 103 i=1,nbls1
xpqr(1,i)=-xpqr(1,i)*bl(if11+i) - txxr(1,i)*bl(if00+i)
xpqr(2,i)=-xpqr(2,i)*bl(if11+i) - txxr(2,i)*bl(if00+i)
xpqr(3,i)=-xpqr(3,i)*bl(if11+i) - txxr(3,i)*bl(if00+i)
103 continue
else
do 104 i=1,nbls1
xpqr(1,i)=-xpqr(1,i)*bl(if11+i) + txxr(1,i)*bl(if00+i)
xpqr(2,i)=-xpqr(2,i)*bl(if11+i) + txxr(2,i)*bl(if00+i)
xpqr(3,i)=-xpqr(3,i)*bl(if11+i) + txxr(3,i)*bl(if00+i)
104 continue
endif
c------------------- NEW ------------------------
if( max(ityp,jtyp,ktyp,ltyp).eq.3) then
c
if(ityp.eq.3) then
coeff=cis(ii)
do 1051 i=1,nbls1
concoe(i)=const(i)*coeff
1051 continue
endif
if(jtyp.eq.3) then
coeff=cjs(jj)
do 1052 i=1,nbls1
concoe(i)=const(i)*coeff
1052 continue
endif
if(ktyp.eq.3) then
coeff=cks(kk)
do 1053 i=1,nbls1
concoe(i)=const(i)*coeff
1053 continue
endif
if(ltyp.eq.3) then
coeff=cls(ll)
do 1054 i=1,nbls1
concoe(i)=const(i)*coeff
1054 continue
endif
do 105 i=1,nbls1
buf1(i,1)=concoe(i)*bl(if00+i)
105 continue
intct=1
endif
c------------------- NEW end --------------------
do 106 i=1,nbls1
buf1(i,intct+1)=-xpqr(1,i)*const(i)
buf1(i,intct+2)=-xpqr(2,i)*const(i)
buf1(i,intct+3)=-xpqr(3,i)*const(i)
106 continue
c------------------------------------------------
203 continue
if(first) then
do 204 icx=1,lnijkl
do 204 i=1,nbls1
ijkl=index(i)
buf(ijkl,icx)=buf1(i,icx)
204 continue
first=.false.
else
do 205 icx=1,lnijkl
do 205 i=1,nbls1
ijkl=index(i)
buf(ijkl,icx)=buf(ijkl,icx)+buf1(i,icx)
205 continue
endif
c
c relise memory
c
call retmem(2)
c
end
c====================================================================
subroutine precal2x_2(iabprim,lcij, iapb,i1apb,isab)
c-------------------------------------------------------------
c* precalculations for the pairs IJ :
c
c iapb =iabprim
c i1apb=iabprim + ijdim
c isab =iabprim + ijdim*2
iapb =iabprim
i1apb=iabprim+lcij
isab =iabprim+2*lcij
c--------------
end
c====================================================================
subroutine num_stability_2(datbas,inx,coefij,coefkl,
* nij_uniqe,ij_uniqe,nkl_uniqe,kl_uniqe)
implicit real*8 (a-h,o-z)
logical stable_2
logical stable_kind_1,stable_kind_2
common /stability_2/ stable_2,stable_kind_1,stable_kind_2 ! use here and in abcd_
common /stability_3/ b_over_a(1000) ! use here and in abcd_
c 1000 above is enough for contractions as long as 31 (31*31=961)
c
common/obarai/
* lni,lnj,lnk,lnl,lnij,lnkl,lnijkl,mmax,
* nqi,nqj,nqk,nql,nsij,nskl,
* nqij,nqij1,nsij1,nqkl,nqkl1,nskl1,ijbeg,klbeg
c number of digit allowed to loose
common /allow_lost/ lost_allow
c
dimension datbas(13,*)
dimension inx(12,*)
dimension ij_uniqe(nij_uniqe)
dimension kl_uniqe(nkl_uniqe)
dimension coefij(nij_uniqe,*),coefkl(nkl_uniqe,*)
c-------------------------------------------------------------
c June 1998
c Numerical stability of Tracy recursion depends on the relative
c value of exponents involved. For (ab/cd) instability occurs when
c the second exponent (b) is much bigger than others.
c In such a case one has to proceed as follows:
c construct (s,s|i+j+k+l,s) integrals and then shift ang.mom.
c (s,s|i+j+k+l,s) ---> (i+j,s|k+l,s)
c from center 3 to center 1 (Tracy recursion)
c
c Before numerical instability in Tracy recursion has been
c realized the program calculated (i+j+k+l,s|s,s) for nsij.GE.nskl
c and onother way aroubd for nsij.LT.nskl .
c then shifted ang. mom. from 1 to 3 or fro 3 to 1.
c-------------------------------------------------------------
c calculate maximum of 2*b/max(1,a) and maximum of 1/(c+d)
c these two above will determine numerical stability in
c Tracy recursion
c-------------------------------------------------------------
c Lost digit :
c
c in one recursion step :
c
c
c 2*b
c log[-------------------]
c max(1,a) * (c+d)
c
c in all (nskl-1) steps :
c
c 2*b
c log[-------------------] * (nskl-1) + log(const_max)
c max(1,a) * (c+d)
c
c
c where const_max is max of const(ijkl) constracted in prec4neg_ .
c
c Number of lost digit given above gives the final accuracy for
c calculated integrals :
c
c acc_obatained = 10**-(14-lost_digit)
c
c The requested accuracy is given by the user's threshold
c
c acc_requested = 10**-10 =10**-(14-4) for example.
c
c (14 comes from double precission)
c-------------------------------------------------------------
c-------------------------------------------------------------
c const=c_ij*c_kl*Sij*Skl/(a+b+c+d) - S -radial overlap.
c maximum of it is needed
c-------------------------------------------------------------
c
stable_2 =.true.
stable_kind_1=.true.
stable_kind_2=.true.
c
if(mmax.gt.2 .and. nskl.gt.1) then
c
c left side pairs:
c
const_ij_max=0.d0 ! ij-part of const
do ijpar=1,nij_uniqe
ijcs=ij_uniqe(ijpar)
call get_ij_half(ijcs,ics,jcs)
ia=inx(1,ics)+1 ! starting contr
ja=inx(1,jcs)+1
ie=inx(5,ics) ! last contr
je=inx(5,jcs)
ij=0
do is=ia,ie
do js=ja,je
ij=ij+1
const_ij=abs(coefij(ijpar,ij))
if(const_ij.gt.const_ij_max) const_ij_max=const_ij
enddo
enddo
enddo
if (const_ij_max.eq.0.0d0) const_ij_max=1d-20
c
c---------------------------------------------------
c right side pairs:
c
const_kl_max=0.d0 ! kl-part of const
do klpar=1,nkl_uniqe
klcs=kl_uniqe(klpar)
call get_ij_half(klcs,kcs,lcs)
ka=inx(1,kcs)+1 ! starting contr
la=inx(1,lcs)+1
ke=inx(5,kcs) ! last contr
le=inx(5,lcs)
kl=0
do ks=ka,ke
do ls=la,le
kl=kl+1
const_kl=abs(coefkl(klpar,kl))
if(const_kl.gt.const_kl_max) const_kl_max=const_kl
enddo
enddo
enddo
if (const_kl_max.eq.0.0d0) const_kl_max=1d-20
c---------------------------------------------------
ijcs=ij_uniqe(1)
call get_ij_half(ijcs,ics,jcs)
ie=inx(5,ics)
ia=inx(1,ics)+1
je=inx(5,jcs)
ja=inx(1,jcs)+1
a_exp_max=datbas(1,ia)
b_exp_max=datbas(1,ja)
a_exp_min=datbas(1,ie)
b_exp_min=datbas(1,je)
a_1_max=max(1.d0,a_exp_min)
c---------------------------------------------------
klcs=kl_uniqe(1)
call get_ij_half(klcs,kcs,lcs)
ke=inx(5,kcs)
le=inx(5,lcs)
c_exp_min=datbas(1,ke)
d_exp_min=datbas(1,le)
cpd_min=c_exp_min+d_exp_min
cpd_max=1.d0/cpd_min
c---------------------------------------------------
c
apb_min=a_exp_min+b_exp_min
apb_max=a_exp_max+b_exp_max
cpd_min=c_exp_min+d_exp_min
cpd_max=1.d0/cpd_min
c
sqrt_abcd=sqrt(1.d0/(apb_min+cpd_min))
const_max=const_ij_max*const_kl_max*sqrt_abcd
lost_const = nint( log10(const_max) )
lost_const = max( -14, lost_const )
c---------------------------------------------------
c test
c write(6,*)'num_stability_2: BEG'
c write(6,*)'MAX of: const=',const_max ,
c * 'min of : a+b=',apb_min,' c+d=',cpd_min,
c * ' coef_ij,kl=',const_ij_max,const_kl_max
ctest
c---------------------------------------------------
c for stability of the first kind :
c
a_1_max=max(1.d0,a_exp_min)
boa_max=2.d0*b_exp_max/a_1_max
c
if(boa_max .ge. 10.d0) then
if(boa_max.GE.1.0d+07) then
stable_kind_1=.false.
ctest
c write(6,*)'Lost : due to 2b/max(1,a)=',
c * int( log10( boa_max) )
c write(6,*)'==> stable_kind_1=',stable_kind_1,
c * ' a.m. (',nqi-1,nqj-1,'|',nqk-1,nql-1,')'
ctest
else
xost_digit = (nskl-1)*log10(boa_max*cpd_max)
lost_digit = nint( xost_digit)
if(lost_digit.GT.0) then
lost_digit = lost_digit + lost_const
if(lost_digit.gt.lost_allow) stable_kind_1=.false.
endif ! if(lost_digit.GT.0) then
ctest..................................................................
c write(6,*)'I st-kind stability: ','boa_max =',boa_max
c write(6,*)'Lost : in ',nskl-1,' steps =',
c * int( xost_digit ),
c * '; due to const=',int( log10(const_max) ),
c * '; TOTAL=',lost_digit,'(allowed=',lost_allow,')'
c write(6,*)'==> stable_kind_1=',stable_kind_1,
c * ' a.m. (',nqi-1,nqj-1,'|',nqk-1,nql-1,')'
ctest..................................................................
endif ! if(boa_max.GE.1.0d+07) then
endif
c---------------------------------------------------
c for stability of the second kind :
c
abcd_max=apb_max*cpd_max
if(abcd_max.ge. 10.d0) then
xost_digit_1= log10(abcd_max) ! RJH was 0.5*
* xost_digit = (nskl-3)*xost_digit_1 ! RJH bad
xost_digit = (nskl-1)*xost_digit_1
lost_digit = nint( xost_digit ) + lost_const
if(lost_digit.gt.lost_allow) stable_kind_2=.false.
ctest..................................................................
c write(6,*)'IIed-kind stability: ','abcd_max=',abcd_max
c write(6,*)'Lost : in ',nskl-1,' steps =',
c * int( xost_digit ),
c * '; due to const=',lost_const,
c * '; TOTAL=',lost_digit,'(allowed=',lost_allow,')'
c write(6,*)'==> stable_kind_2=',stable_kind_2,
c * ' a.m. (',nqi-1,nqj-1,'|',nqk-1,nql-1,')'
ctest..................................................................
endif
c
c write(6,*)'num_stability_2: END'
c-------------------------------------------------------------
c final stability :
c
if(.not.stable_kind_1) stable_2=.false.
if(.not.stable_kind_2) stable_2=.false.
c
c-------------------------------------------------------------
if(.not.stable_kind_1) then
c
c calculate and save 2*b/max(1,a) for each left side contraction
c
ij=0
do is=ia,ie
aa=datbas(1,is)
a_1_max=max(1.d0,aa)
a2=2.d0/a_1_max
do js=ja,je
bb=datbas(1,js)
ij=ij+1
b_over_a(ij)=0.d0
boa=bb*a2
if(boa .ge. 10.d0) then
boa_max_cpd=boa*cpd_max
xost_digit_1= log10( boa_max_cpd )
xost_digit = (nskl-1)*xost_digit_1
lost_digit = nint( xost_digit )
lost_digit = lost_digit + lost_const
if(lost_digit.gt.lost_allow) then
b_over_a(ij)=boa
endif
endif
enddo ! js=ja,je
enddo ! is=ia,ie
endif ! if(.not.stable_kind_1) then
c-------------------------------------------------------------
endif ! if(mmax.gt.2 .and. nskl.gt.1) then
c
end
c===================================================================
subroutine num_stability_1(datbas,inx,coefij,coefkl,
* nij_uniqe,ij_uniqe,nkl_uniqe,kl_uniqe)
implicit real*8 (a-h,o-z)
logical stable_2
logical stable_kind_1,stable_kind_2
common /stability_2/ stable_2,stable_kind_1,stable_kind_2 ! use here and in abcd_
common /stability_3/ b_over_a(1000) ! use here and in abcd_
c 1000 above is enough for contractions as long as 31 (31*31=961)
c
character*11 scftype
character*8 where
common /runtype/ scftype,where
c
common/obarai/
* lni,lnj,lnk,lnl,lnij,lnkl,lnijkl,mmax,
* nqi,nqj,nqk,nql,nsij,nskl,
* nqij,nqij1,nsij1,nqkl,nqkl1,nskl1,ijbeg,klbeg
c number of digit allowed to loose
common /allow_lost/ lost_allow
c
dimension datbas(13,*)
dimension inx(12,*)
dimension ij_uniqe(nij_uniqe)
dimension kl_uniqe(nkl_uniqe)
dimension coefij(nij_uniqe,*),coefkl(nkl_uniqe,*)
c-------------------------------------------------------------
c for description see num_stability_2()
c-------------------------------------------------------------
c calculate maximum of 2*b/max(1,a) and maximum of 1/(c+d)
c these two above will determine numerical stability in
c Tracy recursion
c-------------------------------------------------------------
c const=c_ij*c_kl*Sij*Skl/(a+b+c+d) - S -radial overlap.
c maximum of it is needed
c-------------------------------------------------------------
c
stable_2 =.true.
stable_kind_1=.true.
stable_kind_2=.true.
c
if(mmax.gt.2 .and. nskl.gt.1) then
c
c left side pairs:
c
c write(6,*)'num_stability_1:'
c
const_ij_max=0.d0 ! ij-part of const
a_exp_min=1.0d+10 ! for stable_kind_1
b_exp_min=1.0d+10 ! for both
a_exp_max=0.0d0 ! for stable_kind_2
b_exp_max=0.0d0 ! for both
do ijpar=1,nij_uniqe
ijcs=ij_uniqe(ijpar)
call get_ij_half(ijcs,ics,jcs)
c
ia=inx(1,ics)+1 ! starting contr
ja=inx(1,jcs)+1
ie=inx(5,ics) ! last contr
je=inx(5,jcs)
c
do is=ia,ie
aa=datbas(1,is)
if(aa.lt.a_exp_min) a_exp_min=aa
if(aa.gt.a_exp_max) a_exp_max=aa
enddo
do js=ja,je
bb=datbas(1,js)
if(bb.lt.b_exp_min) b_exp_min=bb
if(bb.gt.b_exp_max) b_exp_max=bb
enddo
ij=0
do is=ia,ie
do js=ja,je
ij=ij+1
const_ij=abs(coefij(ijpar,ij))
if(const_ij.gt.const_ij_max) const_ij_max=const_ij
enddo
enddo
enddo
c
c---------------------------------------------------
c
c right side pairs:
c
const_kl_max=0.d0 ! kl-part of const
c_exp_min=1.0d+10
d_exp_min=1.0d+10
do klpar=1,nkl_uniqe
klcs=kl_uniqe(klpar)
call get_ij_half(klcs,kcs,lcs)
c
ka=inx(1,kcs)+1 ! starting contr
la=inx(1,lcs)+1
ke=inx(5,kcs) ! last contr
le=inx(5,lcs)
c
do ks=ka,ke
cc=datbas(1,ks)
if(cc.lt.c_exp_min) c_exp_min=cc
enddo
do ls=la,le
dd=datbas(1,ls)
if(dd.lt.d_exp_min) d_exp_min=dd
enddo
kl=0
do ks=ka,ke
do ls=la,le
kl=kl+1
const_kl=abs(coefkl(klpar,kl))
if(const_kl.gt.const_kl_max) const_kl_max=const_kl
enddo
enddo
enddo
c
apb_min=a_exp_min+b_exp_min
apb_max=a_exp_max+b_exp_max
cpd_min=c_exp_min+d_exp_min
cpd_max=1.d0/cpd_min
c
sqrt_abcd=sqrt(1.d0/(apb_min+cpd_min))
const_max=const_ij_max*const_kl_max*sqrt_abcd
c---------------------------------------------------
c test
c write(6,*)'num_stability_1: BEG'
c write(6,*)'MAX of: const=',const_max ,
c * 'min of : a+b=',apb_min,' c+d=',cpd_min,
c * ' coef_ij,kl=',const_ij_max,const_kl_max
ctest
c---------------------------------------------------
c for stability of the first kind :
c
a_1_max=max(1.d0,a_exp_min)
boa_max=2.d0*b_exp_max/a_1_max
c
if(boa_max .ge. 10.d0) then
if(boa_max.GE.1.0d+07) then
stable_kind_1=.false.
ctest
c write(6,*)'Lost : due to 2b/max(1,a)=',
c * int( log10( boa_max) )
c write(6,*)'==> stable_kind_1=',stable_kind_1,
c * ' a.m. (',nqi-1,nqj-1,'|',nqk-1,nql-1,')'
ctest
else
xost_digit = (nskl-1)*log10(boa_max*cpd_max)
lost_digit = nint( xost_digit)
if(lost_digit.GT.0) then
if(const_max.gt.1d-14) then
lost_const = nint( log10(const_max) )
else
lost_const=-14
endif
lost_const = max( -14, lost_const )
lost_digit = lost_digit + lost_const
if(lost_digit.gt.lost_allow) stable_kind_1=.false.
endif ! if(lost_digit.GT.0) then
ctest..................................................................
c write(6,*)'I st-kind stability: ','boa_max =',boa_max
c write(6,*)'Lost : in ',nskl-1,' steps =',
c * int( xost_digit ),
c * '; due to const=',int( log10(const_max) ),
c * '; TOTAL=',lost_digit,'(allowed=',lost_allow,')'
c write(6,*)'==> stable_kind_1=',stable_kind_1,
c * ' a.m. (',nqi-1,nqj-1,'|',nqk-1,nql-1,')'
ctest..................................................................
endif ! if(boa_max.GE.1.0d+07) then
endif
c---------------------------------------------------
c for stability of the second kind :
c
abcd_max=apb_max*cpd_max
if(abcd_max.ge. 10.d0) then
xost_digit_1= log10(abcd_max) ! RJH was 0.5d0*
* xost_digit = (nskl-3)*xost_digit_1 ! RJH BAD
xost_digit = (nskl-1)*xost_digit_1
if(const_max.gt.1d-14) then
lost_const = nint( log10(const_max) )
else
lost_const=-14
endif
lost_const = max( -14, lost_const )
lost_digit = nint( xost_digit ) + lost_const
if(lost_digit.gt.lost_allow) stable_kind_2=.false.
ctest..................................................................
c write(6,*)'IIed-kind stability: ','abcd_max=',abcd_max
c write(6,*)'Lost : in ',nskl-1,' steps =',
c * int( xost_digit ),
c * '; due to const=',lost_const,
c * '; TOTAL=',lost_digit,'(allowed=',lost_allow,')'
c write(6,*)'==> stable_kind_2=',stable_kind_2,
c * ' a.m. (',nqi-1,nqj-1,'|',nqk-1,nql-1,')'
ctest..................................................................
endif
c
c write(6,*)'num_stability_1: END'
c-------------------------------------------------------------
c final stability :
c
if(.not.stable_kind_1) stable_2=.false.
if(.not.stable_kind_2) stable_2=.false.
c
c-------------------------------------------------------------
c if(stable_2) return
c-------------------------------------------------------------
c calculate and save 2*b/max(1,a) for each left side contraction
c
c do ijpar=1,nij_uniqe
c ijcs=ij_uniqe(ijpar)
c call get_ij_half(ijcs,ics,jcs)
c ia=inx(1,ics)+1
c ja=inx(1,jcs)+1
c ie=inx(5,ics)
c je=inx(5,jcs)
c ij=0
c do is=ia,ie
c aa=datbas(1,is)
c a_1_max=max(1.d0,aa)
c a2=2.d0/a_1_max
c do js=ja,je
c bb=datbas(1,js)
c ij=ij+1
c
c b_over_a(ij)=0.d0
c boa=bb*a2
c boa_max_cpd=boa*cpd_max
c if(boa_max_cpd .ge. 10.d0) then
c xost_digit_1= log10( boa_max_cpd )
c xost_digit = (nskl-1)*xost_digit_1
c lost_digit = int( xost_digit )
c if(lost_digit.gt.lost_allow) then
c b_over_a(ijpar,ij)=boa
c endif
c endif
c enddo ! js=ja,je
c enddo ! is=ia,ie
c enddo ! ijpar=1,nij_uniqe
c-------------------------------------------------------------
endif ! if(mmax.gt.2 .and. nskl.gt.1) then
c
end
c===================================================================
subroutine get_max_const(nbls1,const,ngcd,indx,gcoef,const_max)
c
c called from abcd_2() only
c
implicit real*8 (a-h,o-z)
dimension const(nbls1),gcoef(ngcd,*) ! gcoef(ngcd,nbls)
dimension indx(*)
c
if(ngcd.EQ.1) then
const_max=0.d0
do i=1,nbls1
c_abs=abs(const(i))
if(c_abs.gt.const_max) const_max=c_abs
enddo
else
const_max=0.d0
do i=1,nbls1
const_i=const(i)
ijkl=indx(i)
gcoef_i=0.d0
do ijklg=1,ngcd
gc_abs=abs( gcoef(ijklg,ijkl) )
if(gc_abs.gt.gcoef_i) gcoef_i=gc_abs
enddo
c_abs=abs( const_i * gcoef_i )
if(c_abs.gt.const_max) const_max=c_abs
enddo
endif
c
end
c===============================================================
subroutine get_max_gcoef(gcoef,ngcd,gc_max)
c
c called from abcd_1() only
c
implicit real*8 (a-h,o-z)
dimension gcoef(ngcd)
c
gc_max=0.d0
do iqu=1,ngcd
gc_abs=abs(gcoef(iqu))
if(gc_abs.gt.gc_max) gc_max=gc_abs
enddo
c
end
c====================================================================
| {
"pile_set_name": "Github"
} |
/** @file
Cache Maintenance Functions.
Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <Base.h>
#include <Library/DebugLib.h>
/**
Invalidates the entire instruction cache in cache coherency domain of the
calling CPU.
**/
VOID
EFIAPI
InvalidateInstructionCache (
VOID
)
{
}
/**
Invalidates a range of instruction cache lines in the cache coherency domain
of the calling CPU.
Invalidates the instruction cache lines specified by Address and Length. If
Address is not aligned on a cache line boundary, then entire instruction
cache line containing Address is invalidated. If Address + Length is not
aligned on a cache line boundary, then the entire instruction cache line
containing Address + Length -1 is invalidated. This function may choose to
invalidate the entire instruction cache if that is more efficient than
invalidating the specified range. If Length is 0, then no instruction cache
lines are invalidated. Address is returned.
If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
@param Address The base address of the instruction cache lines to
invalidate. If the CPU is in a physical addressing mode, then
Address is a physical address. If the CPU is in a virtual
addressing mode, then Address is a virtual address.
@param Length The number of bytes to invalidate from the instruction cache.
@return Address.
**/
VOID *
EFIAPI
InvalidateInstructionCacheRange (
IN VOID *Address,
IN UINTN Length
)
{
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
return Address;
}
/**
Writes back and invalidates the entire data cache in cache coherency domain
of the calling CPU.
Writes back and invalidates the entire data cache in cache coherency domain
of the calling CPU. This function guarantees that all dirty cache lines are
written back to system memory, and also invalidates all the data cache lines
in the cache coherency domain of the calling CPU.
**/
VOID
EFIAPI
WriteBackInvalidateDataCache (
VOID
)
{
}
/**
Writes back and invalidates a range of data cache lines in the cache
coherency domain of the calling CPU.
Writes Back and Invalidate the data cache lines specified by Address and
Length. If Address is not aligned on a cache line boundary, then entire data
cache line containing Address is written back and invalidated. If Address +
Length is not aligned on a cache line boundary, then the entire data cache
line containing Address + Length -1 is written back and invalidated. This
function may choose to write back and invalidate the entire data cache if
that is more efficient than writing back and invalidating the specified
range. If Length is 0, then no data cache lines are written back and
invalidated. Address is returned.
If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
@param Address The base address of the data cache lines to write back and
invalidate. If the CPU is in a physical addressing mode, then
Address is a physical address. If the CPU is in a virtual
addressing mode, then Address is a virtual address.
@param Length The number of bytes to write back and invalidate from the
data cache.
@return Address of cache invalidation.
**/
VOID *
EFIAPI
WriteBackInvalidateDataCacheRange (
IN VOID *Address,
IN UINTN Length
)
{
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
return Address;
}
/**
Writes back the entire data cache in cache coherency domain of the calling
CPU.
Writes back the entire data cache in cache coherency domain of the calling
CPU. This function guarantees that all dirty cache lines are written back to
system memory. This function may also invalidate all the data cache lines in
the cache coherency domain of the calling CPU.
**/
VOID
EFIAPI
WriteBackDataCache (
VOID
)
{
}
/**
Writes back a range of data cache lines in the cache coherency domain of the
calling CPU.
Writes back the data cache lines specified by Address and Length. If Address
is not aligned on a cache line boundary, then entire data cache line
containing Address is written back. If Address + Length is not aligned on a
cache line boundary, then the entire data cache line containing Address +
Length -1 is written back. This function may choose to write back the entire
data cache if that is more efficient than writing back the specified range.
If Length is 0, then no data cache lines are written back. This function may
also invalidate all the data cache lines in the specified range of the cache
coherency domain of the calling CPU. Address is returned.
If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
@param Address The base address of the data cache lines to write back. If
the CPU is in a physical addressing mode, then Address is a
physical address. If the CPU is in a virtual addressing
mode, then Address is a virtual address.
@param Length The number of bytes to write back from the data cache.
@return Address of cache written in main memory.
**/
VOID *
EFIAPI
WriteBackDataCacheRange (
IN VOID *Address,
IN UINTN Length
)
{
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
return Address;
}
/**
Invalidates the entire data cache in cache coherency domain of the calling
CPU.
Invalidates the entire data cache in cache coherency domain of the calling
CPU. This function must be used with care because dirty cache lines are not
written back to system memory. It is typically used for cache diagnostics. If
the CPU does not support invalidation of the entire data cache, then a write
back and invalidate operation should be performed on the entire data cache.
**/
VOID
EFIAPI
InvalidateDataCache (
VOID
)
{
}
/**
Invalidates a range of data cache lines in the cache coherency domain of the
calling CPU.
Invalidates the data cache lines specified by Address and Length. If Address
is not aligned on a cache line boundary, then entire data cache line
containing Address is invalidated. If Address + Length is not aligned on a
cache line boundary, then the entire data cache line containing Address +
Length -1 is invalidated. This function must never invalidate any cache lines
outside the specified range. If Length is 0, then no data cache lines are
invalidated. Address is returned. This function must be used with care
because dirty cache lines are not written back to system memory. It is
typically used for cache diagnostics. If the CPU does not support
invalidation of a data cache range, then a write back and invalidate
operation should be performed on the data cache range.
If Length is greater than (MAX_ADDRESS - Address + 1), then ASSERT().
@param Address The base address of the data cache lines to invalidate. If
the CPU is in a physical addressing mode, then Address is a
physical address. If the CPU is in a virtual addressing mode,
then Address is a virtual address.
@param Length The number of bytes to invalidate from the data cache.
@return Address.
**/
VOID *
EFIAPI
InvalidateDataCacheRange (
IN VOID *Address,
IN UINTN Length
)
{
ASSERT (Length <= MAX_ADDRESS - (UINTN)Address + 1);
return Address;
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en-US">
<head>
<!--// Metadata ---------------------------------------------------- -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="UTF-8" />
<link rel="apple-touch-icon" sizes="57x57" href="img/favicon/apple-icon-57x57.png" />
<link rel="apple-touch-icon" sizes="60x60" href="img/favicon/apple-icon-60x60.png" />
<link rel="apple-touch-icon" sizes="72x72" href="img/favicon/apple-icon-72x72.png" />
<link rel="apple-touch-icon" sizes="76x76" href="img/favicon/apple-icon-76x76.png" />
<link rel="apple-touch-icon" sizes="114x114" href="img/favicon/apple-icon-114x114.png" />
<link rel="apple-touch-icon" sizes="120x120" href="img/favicon/apple-icon-120x120.png" />
<link rel="apple-touch-icon" sizes="144x144" href="img/favicon/apple-icon-144x144.png" />
<link rel="apple-touch-icon" sizes="152x152" href="img/favicon/apple-icon-152x152.png" />
<link rel="apple-touch-icon" sizes="180x180" href="img/favicon/apple-icon-180x180.png" />
<link rel="icon" type="image/png" sizes="192x192" href="img/favicon/android-icon-192x192.png" />
<link rel="icon" type="image/png" sizes="32x32" href="img/favicon/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="96x96" href="img/favicon/favicon-96x96.png" />
<link rel="icon" type="image/png" sizes="16x16" href="img/favicon/favicon-16x16.png" />
<link rel="manifest" href="img/favicon/manifest.json" />
<meta name="msapplication-TileColor" content="#ffffff" />
<meta name="msapplication-TileImage" content="img/favicon/ms-icon-144x144.png" />
<meta name="theme-color" content="#ffffff" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Open Graph data -->
<meta property="og:title" content="scRNA-tools" />
<meta property="og:url" content="https://www.scrna-tools.org/" />
<meta property="og:type" content="website" />
<meta
property="og:description"
content="A catalogue of single-cell RNA-sequencing analysis tools"
/>
<meta property="og:image" content="https://www.scrna-tools.org/img/square.png" />
<!-- Twitter Card -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@scRNAtools" />
<meta name="twitter:title" content="scRNA-tools submission page" />
<meta name="twitter:description" content="Submit a new tool to scRNA-tools.org!" />
<meta name="twitter:image" content="https://www.scrna-tools.org/img/square.png" />
<meta name="description" content="A catalogue of single-cell RNA-sequencing analysis tools" />
<title>scRNA-tools</title>
<!--// Styles ------------------------------------------------------ -->
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous"
/>
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css"
integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp"
crossorigin="anonymous"
/>
<link rel="stylesheet" type="text/css" href="css/layout.css" />
<link rel="stylesheet" type="text/css" href="css/submit.css" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"
/>
<!--// Scripts ----------------------------------------------------- -->
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"
></script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"
integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa"
crossorigin="anonymous"
></script>
<script type="application/javascript" src="js/jquery-banner.js"></script>
<script>
;(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r
;(i[r] =
i[r] ||
function () {
;(i[r].q = i[r].q || []).push(arguments)
}),
(i[r].l = 1 * new Date())
;(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0])
a.async = 1
a.src = g
m.parentNode.insertBefore(a, m)
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga')
ga('create', 'UA-52309538-3', 'auto')
ga('send', 'pageview')
</script>
<script>
$(function () {
$('#footerContent').load('footer_content.html')
})
</script>
</head>
<body id="page-submit">
<!--// Header --------------------------------------------------------->
<div id="frame-header" class="container-fluid">
<a id="navbar-brand" href="index.html">
<img id="logo-image" class="hidden-sm hidden-xs" alt="scRNA-tools" src="img/banner.svg" />
<img
id="logo-image"
class="hidden-lg hidden-md"
alt="scRNA-tools"
src="img/banner-symbol.svg"
/>
</a>
<ul id="navbar-main">
<li><a href="table.html">Table</a></li>
<li><a href="tools.html">Tools</a></li>
<li><a href="analysis.html">Analysis</a></li>
<li><a href="updates.html">Updates</a></li>
<li class="active"><a href="submit.html">Submit</a></li>
<li><a href="faqs.html">FAQs</a></li>
</ul>
<ul id="navbar-util">
<li>
<a href="https://twitter.com/scRNAtools"><i class="fa fa-twitter"></i></a>
</li>
<li>
<a href="https://github.com/scRNA-tools/scRNA-tools"><i class="fa fa-github"></i></a>
</li>
</ul>
</div>
<div id="page-title" class="container-fluid">
<div class="col-lg-12">
<h1>Submit</h1>
<h2>Suggest additions or updates to the database</h2>
</div>
</div>
<div id="frame-content" class="container-fluid">
<!--// Submission form ----------------------------------------- -->
<img id="logo-square" alt="scRNA-tools" src="img/square.svg" />
<form action="https://formspree.io/scrna.tools@gmail.com" method="POST">
<legend>
We would love to hear your suggestions for the scRNA-tools database! To contact us please
fill in the form below or open an issue or pull request via
<a href="https://github.com/scRNA-tools/scRNA-tools">GitHub</a>.
</legend>
<fieldset>
<div class="form-group">
<label for="name">Tool name:</label>
<input type="text" class="form-control" id="name" name="name" placeholder="Tool name" />
</div>
<div class="form-group">
<label for="platform">Platform(s):</label>
<input
type="text"
class="form-control"
id="platform"
name="platform"
placeholder="Available platforms (eg. R/Python)"
/>
</div>
<div class="form-group">
<label for="doi">DOI(s):</label>
<input
type="text"
class="form-control"
id="doi"
name="doi"
placeholder="DOIs for associated publications/preprints"
/>
</div>
<div class="form-group">
<label for="code">Code:</label>
<input
type="text"
class="form-control"
id="code"
name="code"
placeholder="Link to code repository (eg. GitHub)"
/>
</div>
<div class="form-group">
<label for="license">License:</label>
<input
type="text"
class="form-control"
id="license"
name="license"
placeholder="Associated software license"
/>
</div>
<div class="form-group">
<label for="email">Email:</label>
<input
type="email"
class="form-control"
id="email"
name="_replyto"
placeholder="Your email in case we have questions"
/>
</div>
<div class="full-group form-group">
<label for="description">Description:</label>
<textarea
type="text"
class="form-control"
id="description"
name="description"
placeholder="Short description of the tool and what it does"
></textarea>
</div>
<div class="form-group" id="checkbox-categories">
<label for="categories">Categories:</label>
<ul class="checkboxes">
<li>
<input
class="form-check-input"
type="checkbox"
value="ALignment"
id="alignment"
name="categories"
/>
<label class="form-check-label" for="alignment">Alignment</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Allele Specific"
id="allele_specific"
name="categories"
/>
<label class="form-check-label" for="allele_specific">Allele Specific</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Alternative Splicing"
id="alt_splicing"
name="categories"
/>
<label class="form-check-label" for="alt_splicing">Alternative Splicing</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Assembly"
id="assembly"
name="categories"
/>
<label class="form-check-label" for="assembly">Assembly</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Cell Cycle"
id="cell_cycle"
name="categories"
/>
<label class="form-check-label" for="cell_cycle">Cell Cycle</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Classification"
id="classification"
name="categories"
/>
<label class="form-check-label" for="classification">Classification</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Clustering"
id="clustering"
name="categories"
/>
<label class="form-check-label" for="clustering">Clustering</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Differential Expression"
id="diff_exp"
name="categories"
/>
<label class="form-check-label" for="diff_exp">Differential Expression</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Dimensionality Reduction"
id="dim_red"
name="categories"
/>
<label class="form-check-label" for="dim_red">Dimensionality Reduction</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Expression Patterns"
id="exp_patterns"
name="categories"
/>
<label class="form-check-label" for="exp_patterns">Expression Patterns</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Gene Filtering"
id="gene_filt"
name="categories"
/>
<label class="form-check-label" for="gene_filt">Gene Filtering</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Gene Networks"
id="gene_networks"
name="categories"
/>
<label class="form-check-label" for="gene_networks">Gene Networks</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Gene Sets"
id="gene_sets"
name="categories"
/>
<label class="form-check-label" for="gene_sets">Gene Sets</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Haplotypes"
id="haplotypes"
name="categories"
/>
<label class="form-check-label" for="assembly">Haplotypes</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Immune"
id="immune"
name="categories"
/>
<label class="form-check-label" for="immune">Immune</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Imputation"
id="imputation"
name="categories"
/>
<label class="form-check-label" for="imputation">Imputation</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Integration"
id="integration"
name="categories"
/>
<label class="form-check-label" for="integration">Integration</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Interactive"
id="interactive"
name="categories"
/>
<label class="form-check-label" for="interactive">Interactive</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Marker Genes"
id="markers"
name="categories"
/>
<label class="form-check-label" for="markers">Marker Genes</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Modality"
id="modality"
name="categories"
/>
<label class="form-check-label" for="modality">Modality</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Normalisation"
id="normalisation"
name="categories"
/>
<label class="form-check-label" for="normalisation">Normalisation</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Ordering"
id="ordering"
name="categories"
/>
<label class="form-check-label" for="ordering">Ordering</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Quality Control"
id="qc"
name="categories"
/>
<label class="form-check-label" for="qc">Quality Control</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Quantification"
id="quantification"
name="categories"
/>
<label class="form-check-label" for="quantification">Quantification</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Rare Cells"
id="rare"
name="categories"
/>
<label class="form-check-label" for="rare">Rare Cells</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Simulation"
id="simulation"
name="categories"
/>
<label class="form-check-label" for="simulation">Simulation</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Stem Cells"
id="stem_cells"
name="categories"
/>
<label class="form-check-label" for="stem_cells">Stem Cells</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Transformation"
id="transformation"
name="categories"
/>
<label class="form-check-label" for="transformation">Transformation</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="UMIs"
id="umis"
name="categories"
/>
<label class="form-check-label" for="umis">UMIs</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Variable Genes"
id="var_genes"
name="categories"
/>
<label class="form-check-label" for="assembly">Variable Genes</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Variants"
id="variants"
name="categories"
/>
<label class="form-check-label" for="variants">Variants</label>
</li>
<li>
<input
class="form-check-input"
type="checkbox"
value="Visualisation"
id="visualisation"
name="categories"
/>
<label class="form-check-label" for="visualisation">Visualisation</label>
</li>
</ul>
</div>
<div class="full-group form-group">
<label for="notes">Notes:</label>
<textarea
type="text"
class="form-control"
id="notes"
name="notes"
placeholder="Anything else you would like to tell us about the tool?"
></textarea>
</div>
<button type="submit" class="btn btn-default">Submit</button>
<div class="clear"></div>
</fieldset>
</form>
</div>
<div class="alert-banner" style="display: none;">
<div class="banner-wrapper">
<p>
We are currently looking for people to join the scRNA-tools team.<a href="contact.html"
>Learn more here.</a
>
</p>
<button aria-label="Close" type="button">
<span aria-hidden="true"><i class="fa fa-times" aria-hidden="true"></i></span>
</button>
</div>
</div>
<footer id="frame-footer">
<div class="container">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<h2>Cite us</h2>
<p>
Zappia L, Phipson B, Oshlack A. "Exploring the single-cell RNA-seq analysis landscape
with the scRNA-tools database", PLOS Computational Biology (2018), DOI:
<a href="https://doi.org/10.1371/journal.pcbi.1006245">10.1371/journal.pcbi.1006245</a>
</p>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<h2>About scRNA-tools</h2>
<p>
The scRNA-tools database is a catalogue of software packages for analysing single-cell
RNA sequencing data. It was created by the
<a href="http://oshlacklab.com/">Oshlack Lab</a>, a bioinformatics research group based
in Melbourne, Australia and is now maintained by a team of volunteers around the world.
<a href="contact.html">Contact us here</a>.
</p>
</div>
<div id="footer-menu" class="col-lg-12">
<ul>
<li><a href="table.html">Table</a></li>
<li><a href="tools.html">Tools</a></li>
<li><a href="analysis.html">Analysis</a></li>
<li><a href="updates.html">Updates</a></li>
<li><a href="submit.html">Submit</a></li>
<li><a href="faqs.html">FAQs</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
</div>
</div>
</footer>
<script type="application/javascript" src="js/jquery-banner.js"></script>
</body>
</html>
| {
"pile_set_name": "Github"
} |
/*
* Fast C2P (Chunky-to-Planar) Conversion
*
* Copyright (C) 2003-2008 Geert Uytterhoeven
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*/
#include <linux/types.h>
extern void c2p_planar(void *dst, const void *src, u32 dx, u32 dy, u32 width,
u32 height, u32 dst_nextline, u32 dst_nextplane,
u32 src_nextline, u32 bpp);
extern void c2p_iplan2(void *dst, const void *src, u32 dx, u32 dy, u32 width,
u32 height, u32 dst_nextline, u32 src_nextline,
u32 bpp);
| {
"pile_set_name": "Github"
} |
# Copyright 2017 Rene Rivera
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# TODO: Documentation.
import feature ;
feature.feature runtime-link
: shared static
: propagated ;
feature.feature runtime-debugging
: on off
: propagated ;
| {
"pile_set_name": "Github"
} |
/*
This file is part of the Tweeny library.
Copyright (c) 2016-2020 Leonardo Guilherme Lucena de Freitas
Copyright (c) 2016 Guilherme R. Costa
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/*
* This file provides the declarations for a tween currentPoint utility class. A tweenpoint holds the tween values,
* easings and durations.
*/
#ifndef TWEENY_TWEENPOINT_H
#define TWEENY_TWEENPOINT_H
#include <tuple>
#include <array>
#include "tweentraits.h"
namespace tweeny {
namespace detail {
/*
* The tweenpoint class aids in the management of a tweening currentPoint by the tween class.
* This class is private.
*/
template<typename... Ts>
struct tweenpoint {
typedef detail::tweentraits<Ts...> traits;
typename traits::valuesType values;
typename traits::durationsArrayType durations;
typename traits::easingCollection easings;
typename traits::callbackType onEnterCallbacks;
uint32_t stacked;
/* Constructs a tweenpoint from a set of values, filling their durations and easings */
tweenpoint(Ts... vs);
/* Set the duration for all the values in this currentPoint */
template<typename D> void during(D milis);
/* Sets the duration for each value in this currentPoint */
template<typename... Ds> void during(Ds... vs);
/* Sets the easing functions of each value */
template<typename... Fs> void via(Fs... fs);
/* Sets the same easing function for all values */
template<typename F> void via(F f);
/* Returns the highest value in duration array */
uint16_t duration() const;
/* Returns the value of that specific value */
uint16_t duration(size_t i) const;
};
}
}
#include "tweenpoint.tcc"
#endif //TWEENY_TWEENPOINT_H
| {
"pile_set_name": "Github"
} |
// (C) Copyright John Maddock 2006-7.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
static const boost::array<boost::array<typename table_type<T>::type, 4>, 190> tgamma_delta_ratio_int2 = { {
{{ SC_(0.11e2), SC_(0.1e2), SC_(0.1491552059147518383844493235618106619139e-11), SC_(0.36288e7) }},
{{ SC_(0.12e2), SC_(0.1e2), SC_(0.7812891738391762962994964567523415624059e-12), SC_(0.399168e8) }},
{{ SC_(0.12e2), SC_(0.11e2), SC_(0.3551314426541710437724983894328825283663e-13), SC_(0.399168e8) }},
{{ SC_(0.13e2), SC_(0.1e2), SC_(0.4261577311850052525269980673194590340396e-12), SC_(0.2395008e9) }},
{{ SC_(0.13e2), SC_(0.11e2), SC_(0.1852859700804370663160861162258517539303e-13), SC_(0.4790016e9) }},
{{ SC_(0.13e2), SC_(0.12e2), SC_(0.7720248753351544429836921509410489747094e-15), SC_(0.4790016e9) }},
{{ SC_(0.14e2), SC_(0.1e2), SC_(0.2408717611045681862109119510936072801093e-12), SC_(0.10378368e10) }},
{{ SC_(0.14e2), SC_(0.11e2), SC_(0.1003632337935700775878799796223363667122e-13), SC_(0.31135104e10) }},
{{ SC_(0.14e2), SC_(0.12e2), SC_(0.4014529351742803103515199184893454668489e-15), SC_(0.62270208e10) }},
{{ SC_(0.14e2), SC_(0.13e2), SC_(0.1544049750670308885967384301882097949419e-16), SC_(0.62270208e10) }},
{{ SC_(0.15e2), SC_(0.1e2), SC_(0.1405085273109981086230319714712709133971e-12), SC_(0.36324288e10) }},
{{ SC_(0.15e2), SC_(0.11e2), SC_(0.5620341092439924344921278858850836535885e-14), SC_(0.145297152e11) }},
{{ SC_(0.15e2), SC_(0.12e2), SC_(0.2161669650938432440354338022634937129186e-15), SC_(0.435891456e11) }},
{{ SC_(0.15e2), SC_(0.13e2), SC_(0.8006183892364564593904955639388656034024e-17), SC_(0.871782912e11) }},
{{ SC_(0.15e2), SC_(0.14e2), SC_(0.2859351390130201640680341299781662869294e-18), SC_(0.871782912e11) }},
{{ SC_(0.16e2), SC_(0.1e2), SC_(0.8430511638659886517381918288276254803827e-13), SC_(0.108972864e11) }},
{{ SC_(0.16e2), SC_(0.11e2), SC_(0.324250447640764866053150703395240569378e-14), SC_(0.54486432e11) }},
{{ SC_(0.16e2), SC_(0.12e2), SC_(0.1200927583854684689085743345908298405104e-15), SC_(0.217945728e12) }},
{{ SC_(0.16e2), SC_(0.13e2), SC_(0.4289027085195302461020511949672494303941e-17), SC_(0.653837184e12) }},
{{ SC_(0.16e2), SC_(0.14e2), SC_(0.1478974856963897400351900672300860104807e-18), SC_(0.1307674368e13) }},
{{ SC_(0.16e2), SC_(0.15e2), SC_(0.4929916189879658001173002241002867016024e-20), SC_(0.1307674368e13) }},
{{ SC_(0.17e2), SC_(0.1e2), SC_(0.5188007162252237856850411254323849110047e-13), SC_(0.290594304e11) }},
{{ SC_(0.17e2), SC_(0.11e2), SC_(0.1921484134167495502537189353453277448166e-14), SC_(0.1743565824e12) }},
{{ SC_(0.17e2), SC_(0.12e2), SC_(0.6862443336312483937632819119475990886306e-16), SC_(0.871782912e12) }},
{{ SC_(0.17e2), SC_(0.13e2), SC_(0.2366359771142235840563041075681376167692e-17), SC_(0.3487131648e13) }},
{{ SC_(0.17e2), SC_(0.14e2), SC_(0.7887865903807452801876803585604587225639e-19), SC_(0.10461394944e14) }},
{{ SC_(0.17e2), SC_(0.15e2), SC_(0.254447287219595251673445276954986684698e-20), SC_(0.20922789888e14) }},
{{ SC_(0.17e2), SC_(0.16e2), SC_(0.7951477725612351614795164904843333896814e-22), SC_(0.20922789888e14) }},
{{ SC_(0.18e2), SC_(0.1e2), SC_(0.3266523028084742354313221900870571661882e-13), SC_(0.705729024e11) }},
{{ SC_(0.18e2), SC_(0.11e2), SC_(0.1166615367173122269397579250310918450672e-14), SC_(0.4940103168e12) }},
{{ SC_(0.18e2), SC_(0.12e2), SC_(0.4022811610941800928957169828658339485076e-16), SC_(0.29640619008e13) }},
{{ SC_(0.18e2), SC_(0.13e2), SC_(0.1340937203647266976319056609552779828359e-17), SC_(0.14820309504e14) }},
{{ SC_(0.18e2), SC_(0.14e2), SC_(0.4325603882733119278448569708234773639867e-19), SC_(0.59281238016e14) }},
{{ SC_(0.18e2), SC_(0.15e2), SC_(0.1351751213354099774515178033823366762458e-20), SC_(0.177843714048e15) }},
{{ SC_(0.18e2), SC_(0.16e2), SC_(0.4096215798042726589439933435828384128662e-22), SC_(0.355687428096e15) }},
{{ SC_(0.18e2), SC_(0.17e2), SC_(0.1204769352365507820423509834067171802548e-23), SC_(0.355687428096e15) }},
{{ SC_(0.19e2), SC_(0.1e2), SC_(0.209990766091162008491564265055965321121e-13), SC_(0.1587890304e12) }},
{{ SC_(0.19e2), SC_(0.11e2), SC_(0.7241060899695241672122905691585011073137e-15), SC_(0.12703122432e13) }},
{{ SC_(0.19e2), SC_(0.12e2), SC_(0.2413686966565080557374301897195003691046e-16), SC_(0.88921857024e13) }},
{{ SC_(0.19e2), SC_(0.13e2), SC_(0.778608698891961470120742547482259255176e-18), SC_(0.533531142144e14) }},
{{ SC_(0.19e2), SC_(0.14e2), SC_(0.2433152184037379594127320460882060172425e-19), SC_(0.266765571072e15) }},
{{ SC_(0.19e2), SC_(0.15e2), SC_(0.7373188436476907860991880184491091431591e-21), SC_(0.1067062284288e16) }},
{{ SC_(0.19e2), SC_(0.16e2), SC_(0.2168584834257914076762317701320909244586e-22), SC_(0.3201186852864e16) }},
{{ SC_(0.19e2), SC_(0.17e2), SC_(0.6195956669308325933606622003774026413102e-24), SC_(0.6402373705728e16) }},
{{ SC_(0.19e2), SC_(0.18e2), SC_(0.1721099074807868314890728334381674003639e-25), SC_(0.6402373705728e16) }},
{{ SC_(0.2e2), SC_(0.1e2), SC_(0.1375801570942095917703352081401152103896e-13), SC_(0.3352212864e12) }},
{{ SC_(0.2e2), SC_(0.11e2), SC_(0.4586005236473653059011173604670507012987e-15), SC_(0.30169915776e13) }},
{{ SC_(0.2e2), SC_(0.12e2), SC_(0.1479356527894726793229410840216292584834e-16), SC_(0.241359326208e14) }},
{{ SC_(0.2e2), SC_(0.13e2), SC_(0.4622989149671021228841908875675914327607e-18), SC_(0.1689515283456e15) }},
{{ SC_(0.2e2), SC_(0.14e2), SC_(0.1400905802930612493588457235053307372002e-19), SC_(0.10137091700736e16) }},
{{ SC_(0.2e2), SC_(0.15e2), SC_(0.4120311185090036745848403632509727564713e-21), SC_(0.5068545850368e16) }},
{{ SC_(0.2e2), SC_(0.16e2), SC_(0.1177231767168581927385258180717065018489e-22), SC_(0.20274183401472e17) }},
{{ SC_(0.2e2), SC_(0.17e2), SC_(0.3270088242134949798292383835325180606915e-24), SC_(0.60822550204416e17) }},
{{ SC_(0.2e2), SC_(0.18e2), SC_(0.8838076330094458914303740095473461099769e-26), SC_(0.121645100408832e18) }},
{{ SC_(0.2e2), SC_(0.19e2), SC_(0.2325809560551173398500984235650910815729e-27), SC_(0.121645100408832e18) }},
{{ SC_(0.21e2), SC_(0.1e2), SC_(0.9172010472947306118022347209341014025973e-14), SC_(0.6704425728e12) }},
{{ SC_(0.21e2), SC_(0.11e2), SC_(0.2958713055789453586458821680432585169669e-15), SC_(0.6704425728e13) }},
{{ SC_(0.21e2), SC_(0.12e2), SC_(0.9245978299342042457683817751351828655215e-17), SC_(0.60339831552e14) }},
{{ SC_(0.21e2), SC_(0.13e2), SC_(0.2801811605861224987176914470106614744005e-18), SC_(0.482718652416e15) }},
{{ SC_(0.21e2), SC_(0.14e2), SC_(0.8240622370180073491696807265019455129425e-20), SC_(0.3379030566912e16) }},
{{ SC_(0.21e2), SC_(0.15e2), SC_(0.2354463534337163854770516361434130036979e-21), SC_(0.20274183401472e17) }},
{{ SC_(0.21e2), SC_(0.16e2), SC_(0.6540176484269899596584767670650361213829e-23), SC_(0.10137091700736e18) }},
{{ SC_(0.21e2), SC_(0.17e2), SC_(0.1767615266018891782860748019094692219954e-24), SC_(0.40548366802944e18) }},
{{ SC_(0.21e2), SC_(0.18e2), SC_(0.4651619121102346797001968471301821631458e-26), SC_(0.121645100408832e19) }},
{{ SC_(0.21e2), SC_(0.19e2), SC_(0.1192722851564704306923581659308159392681e-27), SC_(0.243290200817664e19) }},
{{ SC_(0.21e2), SC_(0.2e2), SC_(0.2981807128911760767308954148270398481704e-29), SC_(0.243290200817664e19) }},
{{ SC_(0.22e2), SC_(0.1e2), SC_(0.6213297417157852531563525528908428856304e-14), SC_(0.12799358208e13) }},
{{ SC_(0.22e2), SC_(0.11e2), SC_(0.1941655442861828916113601727783884017595e-15), SC_(0.140792940288e14) }},
{{ SC_(0.22e2), SC_(0.12e2), SC_(0.5883804372308572473071520387223890962409e-17), SC_(0.140792940288e15) }},
{{ SC_(0.22e2), SC_(0.13e2), SC_(0.1730530697737815433256329525654085577179e-18), SC_(0.1267136462592e16) }},
{{ SC_(0.22e2), SC_(0.14e2), SC_(0.4944373422108044095018084359011673077655e-20), SC_(0.10137091700736e17) }},
{{ SC_(0.22e2), SC_(0.15e2), SC_(0.1373437061696678915282801210836575854904e-21), SC_(0.70959641905152e17) }},
{{ SC_(0.22e2), SC_(0.16e2), SC_(0.3711992058639672744007570840098853661903e-23), SC_(0.425757851430912e18) }},
{{ SC_(0.22e2), SC_(0.17e2), SC_(0.9768400154314928273704133789733825426061e-25), SC_(0.212878925715456e19) }},
{{ SC_(0.22e2), SC_(0.18e2), SC_(0.2504717988285879044539521484547134724631e-26), SC_(0.851515702861824e19) }},
{{ SC_(0.22e2), SC_(0.19e2), SC_(0.6261794970714697611348803711367836811578e-28), SC_(0.2554547108585472e20) }},
{{ SC_(0.22e2), SC_(0.2e2), SC_(0.1527267066027975027158244807650691905263e-29), SC_(0.5109094217170944e20) }},
{{ SC_(0.22e2), SC_(0.21e2), SC_(0.3636350157209464350376773351549266441102e-31), SC_(0.5109094217170944e20) }},
{{ SC_(0.23e2), SC_(0.1e2), SC_(0.4271641974296023615449923801124544838709e-14), SC_(0.23465490048e13) }},
{{ SC_(0.23e2), SC_(0.11e2), SC_(0.129443696190788594407573448518925601173e-15), SC_(0.281585880576e14) }},
{{ SC_(0.23e2), SC_(0.12e2), SC_(0.3807167535023193953163924956438988269794e-17), SC_(0.3097444686336e15) }},
{{ SC_(0.23e2), SC_(0.13e2), SC_(0.1087762152863769700903978558982568077084e-18), SC_(0.3097444686336e16) }},
{{ SC_(0.23e2), SC_(0.14e2), SC_(0.3021561535732693613622162663840466880789e-20), SC_(0.27877002177024e17) }},
{{ SC_(0.23e2), SC_(0.15e2), SC_(0.8166382529007280036816655848217478056187e-22), SC_(0.223016017416192e18) }},
{{ SC_(0.23e2), SC_(0.16e2), SC_(0.2149048033949284220214909433741441593733e-23), SC_(0.1561112121913344e19) }},
{{ SC_(0.23e2), SC_(0.17e2), SC_(0.5510379574228933897986947266003696394188e-25), SC_(0.9366672731480064e19) }},
{{ SC_(0.23e2), SC_(0.18e2), SC_(0.1377594893557233474496736816500924098547e-26), SC_(0.4683336365740032e20) }},
{{ SC_(0.23e2), SC_(0.19e2), SC_(0.3359987545261545059748138576831522191578e-28), SC_(0.18733345462960128e21) }},
{{ SC_(0.23e2), SC_(0.2e2), SC_(0.7999970345860821570828901373408386170424e-30), SC_(0.56200036388880384e21) }},
{{ SC_(0.23e2), SC_(0.21e2), SC_(0.1860458219967632923448581714746136318703e-31), SC_(0.112400072777760768e22) }},
{{ SC_(0.23e2), SC_(0.22e2), SC_(0.4228314136290074826019503897150309815235e-33), SC_(0.112400072777760768e22) }},
{{ SC_(0.24e2), SC_(0.1e2), SC_(0.2977205012388137671374189315935288826979e-14), SC_(0.41515867008e13) }},
{{ SC_(0.24e2), SC_(0.11e2), SC_(0.8756485330553346092277027399809673020527e-16), SC_(0.539706271104e14) }},
{{ SC_(0.24e2), SC_(0.12e2), SC_(0.2501852951586670312079150685659906577293e-17), SC_(0.6476475253248e15) }},
{{ SC_(0.24e2), SC_(0.13e2), SC_(0.6949591532185195311330974126833073825815e-19), SC_(0.71241227785728e16) }},
{{ SC_(0.24e2), SC_(0.14e2), SC_(0.1878267981671674408467830845090019952923e-20), SC_(0.71241227785728e17) }},
{{ SC_(0.24e2), SC_(0.15e2), SC_(0.4942810478083353706494291697605315665587e-22), SC_(0.641171050071552e18) }},
{{ SC_(0.24e2), SC_(0.16e2), SC_(0.1267387302072654796536997871180850170663e-23), SC_(0.5129368400572416e19) }},
{{ SC_(0.24e2), SC_(0.17e2), SC_(0.3168468255181636991342494677952125426658e-25), SC_(0.35905578804006912e20) }},
{{ SC_(0.24e2), SC_(0.18e2), SC_(0.772797135410155363742071872671250104063e-27), SC_(0.215433472824041472e21) }},
{{ SC_(0.24e2), SC_(0.19e2), SC_(0.1839993179547988961290647315883928819198e-28), SC_(0.107716736412020736e22) }},
{{ SC_(0.24e2), SC_(0.2e2), SC_(0.4279053905925555723931737943916113533018e-30), SC_(0.430866945648082944e22) }},
{{ SC_(0.24e2), SC_(0.21e2), SC_(0.972512251346717209984485896344571257504e-32), SC_(0.1292600836944248832e23) }},
{{ SC_(0.24e2), SC_(0.22e2), SC_(0.2161138336326038244409968658543491683342e-33), SC_(0.2585201673888497664e23) }},
{{ SC_(0.24e2), SC_(0.23e2), SC_(0.4698126818100083140021670996833677572483e-35), SC_(0.2585201673888497664e23) }},
{{ SC_(0.25e2), SC_(0.1e2), SC_(0.2101556479332803062146486575954321524926e-14), SC_(0.71170057728e13) }},
{{ SC_(0.25e2), SC_(0.11e2), SC_(0.6004447083808008748989961645583775785504e-16), SC_(0.996380808192e14) }},
{{ SC_(0.25e2), SC_(0.12e2), SC_(0.1667901967724446874719433790439937718196e-17), SC_(0.12952950506496e16) }},
{{ SC_(0.25e2), SC_(0.13e2), SC_(0.4507843156012018580322794028216047887015e-19), SC_(0.155435406077952e17) }},
{{ SC_(0.25e2), SC_(0.14e2), SC_(0.1186274514740004889558630007425275759741e-20), SC_(0.1709789466857472e18) }},
{{ SC_(0.25e2), SC_(0.15e2), SC_(0.3041729524974371511688794890834040409592e-22), SC_(0.1709789466857472e19) }},
{{ SC_(0.25e2), SC_(0.16e2), SC_(0.760432381243592877922198722708510102398e-24), SC_(0.15388105201717248e20) }},
{{ SC_(0.25e2), SC_(0.17e2), SC_(0.1854713124984372872980972494411000249751e-25), SC_(0.123104841613737984e21) }},
{{ SC_(0.25e2), SC_(0.18e2), SC_(0.4415983630915173507097553558121429166074e-27), SC_(0.861733891296165888e21) }},
{{ SC_(0.25e2), SC_(0.19e2), SC_(0.1026972937422133373743617106539867247924e-28), SC_(0.5170403347776995328e22) }},
{{ SC_(0.25e2), SC_(0.2e2), SC_(0.233402940323212130396276615122697101801e-30), SC_(0.2585201673888497664e23) }},
{{ SC_(0.25e2), SC_(0.21e2), SC_(0.5186732007182491786583924780504380040021e-32), SC_(0.10340806695553990656e24) }},
{{ SC_(0.25e2), SC_(0.22e2), SC_(0.1127550436344019953605201039240082617396e-33), SC_(0.31022420086661971968e24) }},
{{ SC_(0.25e2), SC_(0.23e2), SC_(0.2399043481583021177883406466468260888076e-35), SC_(0.62044840173323943936e24) }},
{{ SC_(0.25e2), SC_(0.24e2), SC_(0.4998007253297960787257096805142210183493e-37), SC_(0.62044840173323943936e24) }},
{{ SC_(0.26e2), SC_(0.1e2), SC_(0.1501111770952002187247490411395943946376e-14), SC_(0.11861676288e14) }},
{{ SC_(0.26e2), SC_(0.11e2), SC_(0.4169754919311117186798584476099844295489e-16), SC_(0.17792514432e15) }},
{{ SC_(0.26e2), SC_(0.12e2), SC_(0.1126960789003004645080698507054011971754e-17), SC_(0.249095202048e16) }},
{{ SC_(0.26e2), SC_(0.13e2), SC_(0.2965686286850012223896575018563189399352e-19), SC_(0.3238237626624e17) }},
{{ SC_(0.26e2), SC_(0.14e2), SC_(0.760432381243592877922198722708510102398e-21), SC_(0.38858851519488e18) }},
{{ SC_(0.26e2), SC_(0.15e2), SC_(0.1901080953108982194805496806771275255995e-22), SC_(0.427447366714368e19) }},
{{ SC_(0.26e2), SC_(0.16e2), SC_(0.4636782812460932182452431236027500624378e-24), SC_(0.427447366714368e20) }},
{{ SC_(0.26e2), SC_(0.17e2), SC_(0.1103995907728793376774388389530357291519e-25), SC_(0.3847026300429312e21) }},
{{ SC_(0.26e2), SC_(0.18e2), SC_(0.2567432343555333434359042766349668119811e-27), SC_(0.30776210403434496e22) }},
{{ SC_(0.26e2), SC_(0.19e2), SC_(0.5835073508080303259906915378067427545024e-29), SC_(0.215433472824041472e23) }},
{{ SC_(0.26e2), SC_(0.2e2), SC_(0.1296683001795622946645981195126095010005e-30), SC_(0.1292600836944248832e24) }},
{{ SC_(0.26e2), SC_(0.21e2), SC_(0.281887609086004988401300259810020654349e-32), SC_(0.646300418472124416e24) }},
{{ SC_(0.26e2), SC_(0.22e2), SC_(0.5997608703957552944708516166170652220191e-34), SC_(0.2585201673888497664e25) }},
{{ SC_(0.26e2), SC_(0.23e2), SC_(0.1249501813324490196814274201285552545873e-35), SC_(0.7755605021665492992e25) }},
{{ SC_(0.26e2), SC_(0.24e2), SC_(0.2550003700662224891457702451603168460966e-37), SC_(0.15511210043330985984e26) }},
{{ SC_(0.26e2), SC_(0.25e2), SC_(0.5100007401324449782915404903206336921931e-39), SC_(0.15511210043330985984e26) }},
{{ SC_(0.27e2), SC_(0.1e2), SC_(0.1084136279020890468567631963785959516827e-14), SC_(0.19275223968e14) }},
{{ SC_(0.27e2), SC_(0.11e2), SC_(0.293009805140781207720981611834043112656e-16), SC_(0.308403583488e15) }},
{{ SC_(0.27e2), SC_(0.12e2), SC_(0.7710784345810031782131095048264292438315e-18), SC_(0.462605375232e16) }},
{{ SC_(0.27e2), SC_(0.13e2), SC_(0.1977124191233341482597716679042126266235e-19), SC_(0.6476475253248e17) }},
{{ SC_(0.27e2), SC_(0.14e2), SC_(0.4942810478083353706494291697605315665587e-21), SC_(0.84194178292224e18) }},
{{ SC_(0.27e2), SC_(0.15e2), SC_(0.1205563531239842367437632121367150162338e-22), SC_(0.1010330139506688e20) }},
{{ SC_(0.27e2), SC_(0.16e2), SC_(0.2870389360094862779613409812778928957948e-24), SC_(0.11113631534573568e21) }},
{{ SC_(0.27e2), SC_(0.17e2), SC_(0.6675324093243866929333511192509137111507e-26), SC_(0.11113631534573568e22) }},
{{ SC_(0.27e2), SC_(0.18e2), SC_(0.1517119112100878847575797998297531161706e-27), SC_(0.100022683811162112e23) }},
{{ SC_(0.27e2), SC_(0.19e2), SC_(0.3371375804668619661279551107327847026014e-29), SC_(0.800181470489296896e23) }},
{{ SC_(0.27e2), SC_(0.2e2), SC_(0.7329077836236129698433806755060537013074e-31), SC_(0.5601270293425078272e24) }},
{{ SC_(0.27e2), SC_(0.21e2), SC_(0.155937826302896376562421420320436957725e-32), SC_(0.33607621760550469632e25) }},
{{ SC_(0.27e2), SC_(0.22e2), SC_(0.324870471464367451171711292334243661927e-34), SC_(0.16803810880275234816e26) }},
{{ SC_(0.27e2), SC_(0.23e2), SC_(0.6630009621721784717790026374168237998511e-36), SC_(0.67215243521100939264e26) }},
{{ SC_(0.27e2), SC_(0.24e2), SC_(0.1326001924344356943558005274833647599702e-37), SC_(0.201645730563302817792e27) }},
{{ SC_(0.27e2), SC_(0.25e2), SC_(0.2600003773224229301094127989869897254318e-39), SC_(0.403291461126605635584e27) }},
{{ SC_(0.27e2), SC_(0.26e2), SC_(0.5000007256200440963642553826672879335227e-41), SC_(0.403291461126605635584e27) }},
{{ SC_(0.28e2), SC_(0.1e2), SC_(0.7911264738801092608466503519519164041712e-15), SC_(0.30613591008e14) }},
{{ SC_(0.28e2), SC_(0.11e2), SC_(0.2081911773368708581175395663031358958345e-16), SC_(0.520431047136e15) }},
{{ SC_(0.28e2), SC_(0.12e2), SC_(0.5338235316330022003013835033413740918834e-18), SC_(0.8326896754176e16) }},
{{ SC_(0.28e2), SC_(0.13e2), SC_(0.1334558829082505500753458758353435229708e-19), SC_(0.12490345131264e18) }},
{{ SC_(0.28e2), SC_(0.14e2), SC_(0.3255021534347574392081606727691305438313e-21), SC_(0.174864831837696e19) }},
{{ SC_(0.28e2), SC_(0.15e2), SC_(0.775005127225612950495620649450310818646e-23), SC_(0.2273242813890048e20) }},
{{ SC_(0.28e2), SC_(0.16e2), SC_(0.1802337505175844070920048021977467020107e-24), SC_(0.27278913766680576e21) }},
{{ SC_(0.28e2), SC_(0.17e2), SC_(0.4096221602672372888454654595403334136607e-26), SC_(0.300068051433486336e22) }},
{{ SC_(0.28e2), SC_(0.18e2), SC_(0.9102714672605273085454787989785186970237e-28), SC_(0.300068051433486336e23) }},
{{ SC_(0.28e2), SC_(0.19e2), SC_(0.197885101578375501857712782386634499353e-29), SC_(0.2700612462901377024e24) }},
{{ SC_(0.28e2), SC_(0.2e2), SC_(0.4210321310178202167185378348651797858574e-31), SC_(0.21604899703211016192e25) }},
{{ SC_(0.28e2), SC_(0.21e2), SC_(0.877150272953792118163620489302457887203e-33), SC_(0.151234297922477113344e26) }},
{{ SC_(0.28e2), SC_(0.22e2), SC_(0.1790102597864881873803307121025424259598e-34), SC_(0.907405787534862680064e26) }},
{{ SC_(0.28e2), SC_(0.23e2), SC_(0.3580205195729763747606614242050848519196e-36), SC_(0.453702893767431340032e27) }},
{{ SC_(0.28e2), SC_(0.24e2), SC_(0.7020010187705419112954145572648722586658e-38), SC_(0.1814811575069725360128e28) }},
{{ SC_(0.28e2), SC_(0.25e2), SC_(0.1350001959174119060183489533201677420511e-39), SC_(0.5444434725209176080384e28) }},
{{ SC_(0.28e2), SC_(0.26e2), SC_(0.2547173507875696339968848175852221548134e-41), SC_(0.10888869450418352160768e29) }},
{{ SC_(0.28e2), SC_(0.27e2), SC_(0.4716987977547585814757126251578188052101e-43), SC_(0.10888869450418352160768e29) }},
{{ SC_(0.29e2), SC_(0.1e2), SC_(0.5829352965432384027291107856487805083366e-15), SC_(0.47621141568e14) }},
{{ SC_(0.29e2), SC_(0.11e2), SC_(0.1494705888572406160843873809355847457273e-16), SC_(0.857180548224e15) }},
{{ SC_(0.29e2), SC_(0.12e2), SC_(0.3736764721431015402109684523389618643184e-18), SC_(0.14572069319808e17) }},
{{ SC_(0.29e2), SC_(0.13e2), SC_(0.9114060296173208297828498837535655227277e-20), SC_(0.233153109116928e18) }},
{{ SC_(0.29e2), SC_(0.14e2), SC_(0.2170014356231716261387737818460870292209e-21), SC_(0.349729663675392e19) }},
{{ SC_(0.29e2), SC_(0.15e2), SC_(0.50465450144923633985761344615369076563e-23), SC_(0.4896215291455488e20) }},
{{ SC_(0.29e2), SC_(0.16e2), SC_(0.114694204874826440876730328671293355825e-24), SC_(0.63650798788921344e21) }},
{{ SC_(0.29e2), SC_(0.17e2), SC_(0.2548760108329476463927340637139852351666e-26), SC_(0.763809585467056128e22) }},
{{ SC_(0.29e2), SC_(0.18e2), SC_(0.5540782844194514052015957906825765981884e-28), SC_(0.8401905440137617408e23) }},
{{ SC_(0.29e2), SC_(0.19e2), SC_(0.1178889966849896606811905937622503400401e-29), SC_(0.8401905440137617408e24) }},
{{ SC_(0.29e2), SC_(0.2e2), SC_(0.2456020764270617930858137370046882084168e-31), SC_(0.75617148961238556672e25) }},
{{ SC_(0.29e2), SC_(0.21e2), SC_(0.5012287274021669246649259938871187926874e-33), SC_(0.604937191689908453376e26) }},
{{ SC_(0.29e2), SC_(0.22e2), SC_(0.1002457454804333849329851987774237585375e-34), SC_(0.4234560341829359173632e27) }},
{{ SC_(0.29e2), SC_(0.23e2), SC_(0.1965602852557517351627160760341642324264e-36), SC_(0.25407362050976155041792e28) }},
{{ SC_(0.29e2), SC_(0.24e2), SC_(0.3780005485687533368513770692964696777431e-38), SC_(0.12703681025488077520896e29) }},
{{ SC_(0.29e2), SC_(0.25e2), SC_(0.7132085822051949751912774892386220334776e-40), SC_(0.50814724101952310083584e29) }},
{{ SC_(0.29e2), SC_(0.26e2), SC_(0.1320756633713324028131995350441892654588e-41), SC_(0.152444172305856930250752e30) }},
{{ SC_(0.29e2), SC_(0.27e2), SC_(0.2401375697660589142058173364439804826524e-43), SC_(0.304888344611713860501504e30) }},
{{ SC_(0.29e2), SC_(0.28e2), SC_(0.4288170888679623467961023865071080047364e-45), SC_(0.304888344611713860501504e30) }}
} };
| {
"pile_set_name": "Github"
} |
#include <ATen/core/ivalue.h>
| {
"pile_set_name": "Github"
} |
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package google provides support for making OAuth2 authorized and authenticated
// HTTP requests to Google APIs. It supports the Web server flow, client-side
// credentials, service accounts, Google Compute Engine service accounts, and Google
// App Engine service accounts.
//
// A brief overview of the package follows. For more information, please read
// https://developers.google.com/accounts/docs/OAuth2
// and
// https://developers.google.com/accounts/docs/application-default-credentials.
//
// OAuth2 Configs
//
// Two functions in this package return golang.org/x/oauth2.Config values from Google credential
// data. Google supports two JSON formats for OAuth2 credentials: one is handled by ConfigFromJSON,
// the other by JWTConfigFromJSON. The returned Config can be used to obtain a TokenSource or
// create an http.Client.
//
//
// Credentials
//
// The Credentials type represents Google credentials, including Application Default
// Credentials.
//
// Use FindDefaultCredentials to obtain Application Default Credentials.
// FindDefaultCredentials looks in some well-known places for a credentials file, and
// will call AppEngineTokenSource or ComputeTokenSource as needed.
//
// DefaultClient and DefaultTokenSource are convenience methods. They first call FindDefaultCredentials,
// then use the credentials to construct an http.Client or an oauth2.TokenSource.
//
// Use CredentialsFromJSON to obtain credentials from either of the two JSON formats
// described in OAuth2 Configs, above. The TokenSource in the returned value is the
// same as the one obtained from the oauth2.Config returned from ConfigFromJSON or
// JWTConfigFromJSON, but the Credentials may contain additional information
// that is useful is some circumstances.
package google // import "golang.org/x/oauth2/google"
| {
"pile_set_name": "Github"
} |
/******************************************************************************
*
* This file is provided under a dual BSD/GPLv2 license. When using or
* redistributing this file, you may do so under either license.
*
* GPL LICENSE SUMMARY
*
* Copyright(c) 2005 - 2009 Intel Corporation. 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 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
* USA
*
* The full GNU General Public License is included in this distribution
* in the file called LICENSE.GPL.
*
* Contact Information:
* Intel Linux Wireless <ilw@linux.intel.com>
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*
* BSD LICENSE
*
* Copyright(c) 2005 - 2009 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/
/*
* Please use this file (iwl-4965-hw.h) only for hardware-related definitions.
* Use iwl-commands.h for uCode API definitions.
* Use iwl-dev.h for driver implementation definitions.
*/
#ifndef __iwl_4965_hw_h__
#define __iwl_4965_hw_h__
#include "iwl-fh.h"
/* EEPROM */
#define IWL4965_EEPROM_IMG_SIZE 1024
/*
* uCode queue management definitions ...
* Queue #4 is the command queue for 3945 and 4965; map it to Tx FIFO chnl 4.
* The first queue used for block-ack aggregation is #7 (4965 only).
* All block-ack aggregation queues should map to Tx DMA/FIFO channel 7.
*/
#define IWL_CMD_QUEUE_NUM 4
#define IWL_CMD_FIFO_NUM 4
#define IWL49_FIRST_AMPDU_QUEUE 7
/* Time constants */
#define SHORT_SLOT_TIME 9
#define LONG_SLOT_TIME 20
/* RSSI to dBm */
#define IWL49_RSSI_OFFSET 44
/* PCI registers */
#define PCI_CFG_RETRY_TIMEOUT 0x041
/* PCI register values */
#define PCI_CFG_LINK_CTRL_VAL_L0S_EN 0x01
#define PCI_CFG_LINK_CTRL_VAL_L1_EN 0x02
#define IWL_NUM_SCAN_RATES (2)
#define IWL_DEFAULT_TX_RETRY 15
/* Sizes and addresses for instruction and data memory (SRAM) in
* 4965's embedded processor. Driver access is via HBUS_TARG_MEM_* regs. */
#define IWL49_RTC_INST_LOWER_BOUND (0x000000)
#define IWL49_RTC_INST_UPPER_BOUND (0x018000)
#define IWL49_RTC_DATA_LOWER_BOUND (0x800000)
#define IWL49_RTC_DATA_UPPER_BOUND (0x80A000)
#define IWL49_RTC_INST_SIZE (IWL49_RTC_INST_UPPER_BOUND - \
IWL49_RTC_INST_LOWER_BOUND)
#define IWL49_RTC_DATA_SIZE (IWL49_RTC_DATA_UPPER_BOUND - \
IWL49_RTC_DATA_LOWER_BOUND)
#define IWL49_MAX_INST_SIZE IWL49_RTC_INST_SIZE
#define IWL49_MAX_DATA_SIZE IWL49_RTC_DATA_SIZE
/* Size of uCode instruction memory in bootstrap state machine */
#define IWL49_MAX_BSM_SIZE BSM_SRAM_SIZE
static inline int iwl4965_hw_valid_rtc_data_addr(u32 addr)
{
return (addr >= IWL49_RTC_DATA_LOWER_BOUND) &&
(addr < IWL49_RTC_DATA_UPPER_BOUND);
}
/********************* START TEMPERATURE *************************************/
/**
* 4965 temperature calculation.
*
* The driver must calculate the device temperature before calculating
* a txpower setting (amplifier gain is temperature dependent). The
* calculation uses 4 measurements, 3 of which (R1, R2, R3) are calibration
* values used for the life of the driver, and one of which (R4) is the
* real-time temperature indicator.
*
* uCode provides all 4 values to the driver via the "initialize alive"
* notification (see struct iwl4965_init_alive_resp). After the runtime uCode
* image loads, uCode updates the R4 value via statistics notifications
* (see STATISTICS_NOTIFICATION), which occur after each received beacon
* when associated, or can be requested via REPLY_STATISTICS_CMD.
*
* NOTE: uCode provides the R4 value as a 23-bit signed value. Driver
* must sign-extend to 32 bits before applying formula below.
*
* Formula:
*
* degrees Kelvin = ((97 * 259 * (R4 - R2) / (R3 - R1)) / 100) + 8
*
* NOTE: The basic formula is 259 * (R4-R2) / (R3-R1). The 97/100 is
* an additional correction, which should be centered around 0 degrees
* Celsius (273 degrees Kelvin). The 8 (3 percent of 273) compensates for
* centering the 97/100 correction around 0 degrees K.
*
* Add 273 to Kelvin value to find degrees Celsius, for comparing current
* temperature with factory-measured temperatures when calculating txpower
* settings.
*/
#define TEMPERATURE_CALIB_KELVIN_OFFSET 8
#define TEMPERATURE_CALIB_A_VAL 259
/* Limit range of calculated temperature to be between these Kelvin values */
#define IWL_TX_POWER_TEMPERATURE_MIN (263)
#define IWL_TX_POWER_TEMPERATURE_MAX (410)
#define IWL_TX_POWER_TEMPERATURE_OUT_OF_RANGE(t) \
(((t) < IWL_TX_POWER_TEMPERATURE_MIN) || \
((t) > IWL_TX_POWER_TEMPERATURE_MAX))
/********************* END TEMPERATURE ***************************************/
/********************* START TXPOWER *****************************************/
/**
* 4965 txpower calculations rely on information from three sources:
*
* 1) EEPROM
* 2) "initialize" alive notification
* 3) statistics notifications
*
* EEPROM data consists of:
*
* 1) Regulatory information (max txpower and channel usage flags) is provided
* separately for each channel that can possibly supported by 4965.
* 40 MHz wide (.11n HT40) channels are listed separately from 20 MHz
* (legacy) channels.
*
* See struct iwl4965_eeprom_channel for format, and struct iwl4965_eeprom
* for locations in EEPROM.
*
* 2) Factory txpower calibration information is provided separately for
* sub-bands of contiguous channels. 2.4GHz has just one sub-band,
* but 5 GHz has several sub-bands.
*
* In addition, per-band (2.4 and 5 Ghz) saturation txpowers are provided.
*
* See struct iwl4965_eeprom_calib_info (and the tree of structures
* contained within it) for format, and struct iwl4965_eeprom for
* locations in EEPROM.
*
* "Initialization alive" notification (see struct iwl4965_init_alive_resp)
* consists of:
*
* 1) Temperature calculation parameters.
*
* 2) Power supply voltage measurement.
*
* 3) Tx gain compensation to balance 2 transmitters for MIMO use.
*
* Statistics notifications deliver:
*
* 1) Current values for temperature param R4.
*/
/**
* To calculate a txpower setting for a given desired target txpower, channel,
* modulation bit rate, and transmitter chain (4965 has 2 transmitters to
* support MIMO and transmit diversity), driver must do the following:
*
* 1) Compare desired txpower vs. (EEPROM) regulatory limit for this channel.
* Do not exceed regulatory limit; reduce target txpower if necessary.
*
* If setting up txpowers for MIMO rates (rate indexes 8-15, 24-31),
* 2 transmitters will be used simultaneously; driver must reduce the
* regulatory limit by 3 dB (half-power) for each transmitter, so the
* combined total output of the 2 transmitters is within regulatory limits.
*
*
* 2) Compare target txpower vs. (EEPROM) saturation txpower *reduced by
* backoff for this bit rate*. Do not exceed (saturation - backoff[rate]);
* reduce target txpower if necessary.
*
* Backoff values below are in 1/2 dB units (equivalent to steps in
* txpower gain tables):
*
* OFDM 6 - 36 MBit: 10 steps (5 dB)
* OFDM 48 MBit: 15 steps (7.5 dB)
* OFDM 54 MBit: 17 steps (8.5 dB)
* OFDM 60 MBit: 20 steps (10 dB)
* CCK all rates: 10 steps (5 dB)
*
* Backoff values apply to saturation txpower on a per-transmitter basis;
* when using MIMO (2 transmitters), each transmitter uses the same
* saturation level provided in EEPROM, and the same backoff values;
* no reduction (such as with regulatory txpower limits) is required.
*
* Saturation and Backoff values apply equally to 20 Mhz (legacy) channel
* widths and 40 Mhz (.11n HT40) channel widths; there is no separate
* factory measurement for ht40 channels.
*
* The result of this step is the final target txpower. The rest of
* the steps figure out the proper settings for the device to achieve
* that target txpower.
*
*
* 3) Determine (EEPROM) calibration sub band for the target channel, by
* comparing against first and last channels in each sub band
* (see struct iwl4965_eeprom_calib_subband_info).
*
*
* 4) Linearly interpolate (EEPROM) factory calibration measurement sets,
* referencing the 2 factory-measured (sample) channels within the sub band.
*
* Interpolation is based on difference between target channel's frequency
* and the sample channels' frequencies. Since channel numbers are based
* on frequency (5 MHz between each channel number), this is equivalent
* to interpolating based on channel number differences.
*
* Note that the sample channels may or may not be the channels at the
* edges of the sub band. The target channel may be "outside" of the
* span of the sampled channels.
*
* Driver may choose the pair (for 2 Tx chains) of measurements (see
* struct iwl4965_eeprom_calib_ch_info) for which the actual measured
* txpower comes closest to the desired txpower. Usually, though,
* the middle set of measurements is closest to the regulatory limits,
* and is therefore a good choice for all txpower calculations (this
* assumes that high accuracy is needed for maximizing legal txpower,
* while lower txpower configurations do not need as much accuracy).
*
* Driver should interpolate both members of the chosen measurement pair,
* i.e. for both Tx chains (radio transmitters), unless the driver knows
* that only one of the chains will be used (e.g. only one tx antenna
* connected, but this should be unusual). The rate scaling algorithm
* switches antennas to find best performance, so both Tx chains will
* be used (although only one at a time) even for non-MIMO transmissions.
*
* Driver should interpolate factory values for temperature, gain table
* index, and actual power. The power amplifier detector values are
* not used by the driver.
*
* Sanity check: If the target channel happens to be one of the sample
* channels, the results should agree with the sample channel's
* measurements!
*
*
* 5) Find difference between desired txpower and (interpolated)
* factory-measured txpower. Using (interpolated) factory gain table index
* (shown elsewhere) as a starting point, adjust this index lower to
* increase txpower, or higher to decrease txpower, until the target
* txpower is reached. Each step in the gain table is 1/2 dB.
*
* For example, if factory measured txpower is 16 dBm, and target txpower
* is 13 dBm, add 6 steps to the factory gain index to reduce txpower
* by 3 dB.
*
*
* 6) Find difference between current device temperature and (interpolated)
* factory-measured temperature for sub-band. Factory values are in
* degrees Celsius. To calculate current temperature, see comments for
* "4965 temperature calculation".
*
* If current temperature is higher than factory temperature, driver must
* increase gain (lower gain table index), and vice verse.
*
* Temperature affects gain differently for different channels:
*
* 2.4 GHz all channels: 3.5 degrees per half-dB step
* 5 GHz channels 34-43: 4.5 degrees per half-dB step
* 5 GHz channels >= 44: 4.0 degrees per half-dB step
*
* NOTE: Temperature can increase rapidly when transmitting, especially
* with heavy traffic at high txpowers. Driver should update
* temperature calculations often under these conditions to
* maintain strong txpower in the face of rising temperature.
*
*
* 7) Find difference between current power supply voltage indicator
* (from "initialize alive") and factory-measured power supply voltage
* indicator (EEPROM).
*
* If the current voltage is higher (indicator is lower) than factory
* voltage, gain should be reduced (gain table index increased) by:
*
* (eeprom - current) / 7
*
* If the current voltage is lower (indicator is higher) than factory
* voltage, gain should be increased (gain table index decreased) by:
*
* 2 * (current - eeprom) / 7
*
* If number of index steps in either direction turns out to be > 2,
* something is wrong ... just use 0.
*
* NOTE: Voltage compensation is independent of band/channel.
*
* NOTE: "Initialize" uCode measures current voltage, which is assumed
* to be constant after this initial measurement. Voltage
* compensation for txpower (number of steps in gain table)
* may be calculated once and used until the next uCode bootload.
*
*
* 8) If setting up txpowers for MIMO rates (rate indexes 8-15, 24-31),
* adjust txpower for each transmitter chain, so txpower is balanced
* between the two chains. There are 5 pairs of tx_atten[group][chain]
* values in "initialize alive", one pair for each of 5 channel ranges:
*
* Group 0: 5 GHz channel 34-43
* Group 1: 5 GHz channel 44-70
* Group 2: 5 GHz channel 71-124
* Group 3: 5 GHz channel 125-200
* Group 4: 2.4 GHz all channels
*
* Add the tx_atten[group][chain] value to the index for the target chain.
* The values are signed, but are in pairs of 0 and a non-negative number,
* so as to reduce gain (if necessary) of the "hotter" channel. This
* avoids any need to double-check for regulatory compliance after
* this step.
*
*
* 9) If setting up for a CCK rate, lower the gain by adding a CCK compensation
* value to the index:
*
* Hardware rev B: 9 steps (4.5 dB)
* Hardware rev C: 5 steps (2.5 dB)
*
* Hardware rev for 4965 can be determined by reading CSR_HW_REV_WA_REG,
* bits [3:2], 1 = B, 2 = C.
*
* NOTE: This compensation is in addition to any saturation backoff that
* might have been applied in an earlier step.
*
*
* 10) Select the gain table, based on band (2.4 vs 5 GHz).
*
* Limit the adjusted index to stay within the table!
*
*
* 11) Read gain table entries for DSP and radio gain, place into appropriate
* location(s) in command (struct iwl4965_txpowertable_cmd).
*/
/* Limit range of txpower output target to be between these values */
#define IWL_TX_POWER_TARGET_POWER_MIN (0) /* 0 dBm = 1 milliwatt */
#define IWL_TX_POWER_TARGET_POWER_MAX (16) /* 16 dBm */
/**
* When MIMO is used (2 transmitters operating simultaneously), driver should
* limit each transmitter to deliver a max of 3 dB below the regulatory limit
* for the device. That is, use half power for each transmitter, so total
* txpower is within regulatory limits.
*
* The value "6" represents number of steps in gain table to reduce power 3 dB.
* Each step is 1/2 dB.
*/
#define IWL_TX_POWER_MIMO_REGULATORY_COMPENSATION (6)
/**
* CCK gain compensation.
*
* When calculating txpowers for CCK, after making sure that the target power
* is within regulatory and saturation limits, driver must additionally
* back off gain by adding these values to the gain table index.
*
* Hardware rev for 4965 can be determined by reading CSR_HW_REV_WA_REG,
* bits [3:2], 1 = B, 2 = C.
*/
#define IWL_TX_POWER_CCK_COMPENSATION_B_STEP (9)
#define IWL_TX_POWER_CCK_COMPENSATION_C_STEP (5)
/*
* 4965 power supply voltage compensation for txpower
*/
#define TX_POWER_IWL_VOLTAGE_CODES_PER_03V (7)
/**
* Gain tables.
*
* The following tables contain pair of values for setting txpower, i.e.
* gain settings for the output of the device's digital signal processor (DSP),
* and for the analog gain structure of the transmitter.
*
* Each entry in the gain tables represents a step of 1/2 dB. Note that these
* are *relative* steps, not indications of absolute output power. Output
* power varies with temperature, voltage, and channel frequency, and also
* requires consideration of average power (to satisfy regulatory constraints),
* and peak power (to avoid distortion of the output signal).
*
* Each entry contains two values:
* 1) DSP gain (or sometimes called DSP attenuation). This is a fine-grained
* linear value that multiplies the output of the digital signal processor,
* before being sent to the analog radio.
* 2) Radio gain. This sets the analog gain of the radio Tx path.
* It is a coarser setting, and behaves in a logarithmic (dB) fashion.
*
* EEPROM contains factory calibration data for txpower. This maps actual
* measured txpower levels to gain settings in the "well known" tables
* below ("well-known" means here that both factory calibration *and* the
* driver work with the same table).
*
* There are separate tables for 2.4 GHz and 5 GHz bands. The 5 GHz table
* has an extension (into negative indexes), in case the driver needs to
* boost power setting for high device temperatures (higher than would be
* present during factory calibration). A 5 Ghz EEPROM index of "40"
* corresponds to the 49th entry in the table used by the driver.
*/
#define MIN_TX_GAIN_INDEX (0) /* highest gain, lowest idx, 2.4 */
#define MIN_TX_GAIN_INDEX_52GHZ_EXT (-9) /* highest gain, lowest idx, 5 */
/**
* 2.4 GHz gain table
*
* Index Dsp gain Radio gain
* 0 110 0x3f (highest gain)
* 1 104 0x3f
* 2 98 0x3f
* 3 110 0x3e
* 4 104 0x3e
* 5 98 0x3e
* 6 110 0x3d
* 7 104 0x3d
* 8 98 0x3d
* 9 110 0x3c
* 10 104 0x3c
* 11 98 0x3c
* 12 110 0x3b
* 13 104 0x3b
* 14 98 0x3b
* 15 110 0x3a
* 16 104 0x3a
* 17 98 0x3a
* 18 110 0x39
* 19 104 0x39
* 20 98 0x39
* 21 110 0x38
* 22 104 0x38
* 23 98 0x38
* 24 110 0x37
* 25 104 0x37
* 26 98 0x37
* 27 110 0x36
* 28 104 0x36
* 29 98 0x36
* 30 110 0x35
* 31 104 0x35
* 32 98 0x35
* 33 110 0x34
* 34 104 0x34
* 35 98 0x34
* 36 110 0x33
* 37 104 0x33
* 38 98 0x33
* 39 110 0x32
* 40 104 0x32
* 41 98 0x32
* 42 110 0x31
* 43 104 0x31
* 44 98 0x31
* 45 110 0x30
* 46 104 0x30
* 47 98 0x30
* 48 110 0x6
* 49 104 0x6
* 50 98 0x6
* 51 110 0x5
* 52 104 0x5
* 53 98 0x5
* 54 110 0x4
* 55 104 0x4
* 56 98 0x4
* 57 110 0x3
* 58 104 0x3
* 59 98 0x3
* 60 110 0x2
* 61 104 0x2
* 62 98 0x2
* 63 110 0x1
* 64 104 0x1
* 65 98 0x1
* 66 110 0x0
* 67 104 0x0
* 68 98 0x0
* 69 97 0
* 70 96 0
* 71 95 0
* 72 94 0
* 73 93 0
* 74 92 0
* 75 91 0
* 76 90 0
* 77 89 0
* 78 88 0
* 79 87 0
* 80 86 0
* 81 85 0
* 82 84 0
* 83 83 0
* 84 82 0
* 85 81 0
* 86 80 0
* 87 79 0
* 88 78 0
* 89 77 0
* 90 76 0
* 91 75 0
* 92 74 0
* 93 73 0
* 94 72 0
* 95 71 0
* 96 70 0
* 97 69 0
* 98 68 0
*/
/**
* 5 GHz gain table
*
* Index Dsp gain Radio gain
* -9 123 0x3F (highest gain)
* -8 117 0x3F
* -7 110 0x3F
* -6 104 0x3F
* -5 98 0x3F
* -4 110 0x3E
* -3 104 0x3E
* -2 98 0x3E
* -1 110 0x3D
* 0 104 0x3D
* 1 98 0x3D
* 2 110 0x3C
* 3 104 0x3C
* 4 98 0x3C
* 5 110 0x3B
* 6 104 0x3B
* 7 98 0x3B
* 8 110 0x3A
* 9 104 0x3A
* 10 98 0x3A
* 11 110 0x39
* 12 104 0x39
* 13 98 0x39
* 14 110 0x38
* 15 104 0x38
* 16 98 0x38
* 17 110 0x37
* 18 104 0x37
* 19 98 0x37
* 20 110 0x36
* 21 104 0x36
* 22 98 0x36
* 23 110 0x35
* 24 104 0x35
* 25 98 0x35
* 26 110 0x34
* 27 104 0x34
* 28 98 0x34
* 29 110 0x33
* 30 104 0x33
* 31 98 0x33
* 32 110 0x32
* 33 104 0x32
* 34 98 0x32
* 35 110 0x31
* 36 104 0x31
* 37 98 0x31
* 38 110 0x30
* 39 104 0x30
* 40 98 0x30
* 41 110 0x25
* 42 104 0x25
* 43 98 0x25
* 44 110 0x24
* 45 104 0x24
* 46 98 0x24
* 47 110 0x23
* 48 104 0x23
* 49 98 0x23
* 50 110 0x22
* 51 104 0x18
* 52 98 0x18
* 53 110 0x17
* 54 104 0x17
* 55 98 0x17
* 56 110 0x16
* 57 104 0x16
* 58 98 0x16
* 59 110 0x15
* 60 104 0x15
* 61 98 0x15
* 62 110 0x14
* 63 104 0x14
* 64 98 0x14
* 65 110 0x13
* 66 104 0x13
* 67 98 0x13
* 68 110 0x12
* 69 104 0x08
* 70 98 0x08
* 71 110 0x07
* 72 104 0x07
* 73 98 0x07
* 74 110 0x06
* 75 104 0x06
* 76 98 0x06
* 77 110 0x05
* 78 104 0x05
* 79 98 0x05
* 80 110 0x04
* 81 104 0x04
* 82 98 0x04
* 83 110 0x03
* 84 104 0x03
* 85 98 0x03
* 86 110 0x02
* 87 104 0x02
* 88 98 0x02
* 89 110 0x01
* 90 104 0x01
* 91 98 0x01
* 92 110 0x00
* 93 104 0x00
* 94 98 0x00
* 95 93 0x00
* 96 88 0x00
* 97 83 0x00
* 98 78 0x00
*/
/**
* Sanity checks and default values for EEPROM regulatory levels.
* If EEPROM values fall outside MIN/MAX range, use default values.
*
* Regulatory limits refer to the maximum average txpower allowed by
* regulatory agencies in the geographies in which the device is meant
* to be operated. These limits are SKU-specific (i.e. geography-specific),
* and channel-specific; each channel has an individual regulatory limit
* listed in the EEPROM.
*
* Units are in half-dBm (i.e. "34" means 17 dBm).
*/
#define IWL_TX_POWER_DEFAULT_REGULATORY_24 (34)
#define IWL_TX_POWER_DEFAULT_REGULATORY_52 (34)
#define IWL_TX_POWER_REGULATORY_MIN (0)
#define IWL_TX_POWER_REGULATORY_MAX (34)
/**
* Sanity checks and default values for EEPROM saturation levels.
* If EEPROM values fall outside MIN/MAX range, use default values.
*
* Saturation is the highest level that the output power amplifier can produce
* without significant clipping distortion. This is a "peak" power level.
* Different types of modulation (i.e. various "rates", and OFDM vs. CCK)
* require differing amounts of backoff, relative to their average power output,
* in order to avoid clipping distortion.
*
* Driver must make sure that it is violating neither the saturation limit,
* nor the regulatory limit, when calculating Tx power settings for various
* rates.
*
* Units are in half-dBm (i.e. "38" means 19 dBm).
*/
#define IWL_TX_POWER_DEFAULT_SATURATION_24 (38)
#define IWL_TX_POWER_DEFAULT_SATURATION_52 (38)
#define IWL_TX_POWER_SATURATION_MIN (20)
#define IWL_TX_POWER_SATURATION_MAX (50)
/**
* Channel groups used for Tx Attenuation calibration (MIMO tx channel balance)
* and thermal Txpower calibration.
*
* When calculating txpower, driver must compensate for current device
* temperature; higher temperature requires higher gain. Driver must calculate
* current temperature (see "4965 temperature calculation"), then compare vs.
* factory calibration temperature in EEPROM; if current temperature is higher
* than factory temperature, driver must *increase* gain by proportions shown
* in table below. If current temperature is lower than factory, driver must
* *decrease* gain.
*
* Different frequency ranges require different compensation, as shown below.
*/
/* Group 0, 5.2 GHz ch 34-43: 4.5 degrees per 1/2 dB. */
#define CALIB_IWL_TX_ATTEN_GR1_FCH 34
#define CALIB_IWL_TX_ATTEN_GR1_LCH 43
/* Group 1, 5.3 GHz ch 44-70: 4.0 degrees per 1/2 dB. */
#define CALIB_IWL_TX_ATTEN_GR2_FCH 44
#define CALIB_IWL_TX_ATTEN_GR2_LCH 70
/* Group 2, 5.5 GHz ch 71-124: 4.0 degrees per 1/2 dB. */
#define CALIB_IWL_TX_ATTEN_GR3_FCH 71
#define CALIB_IWL_TX_ATTEN_GR3_LCH 124
/* Group 3, 5.7 GHz ch 125-200: 4.0 degrees per 1/2 dB. */
#define CALIB_IWL_TX_ATTEN_GR4_FCH 125
#define CALIB_IWL_TX_ATTEN_GR4_LCH 200
/* Group 4, 2.4 GHz all channels: 3.5 degrees per 1/2 dB. */
#define CALIB_IWL_TX_ATTEN_GR5_FCH 1
#define CALIB_IWL_TX_ATTEN_GR5_LCH 20
enum {
CALIB_CH_GROUP_1 = 0,
CALIB_CH_GROUP_2 = 1,
CALIB_CH_GROUP_3 = 2,
CALIB_CH_GROUP_4 = 3,
CALIB_CH_GROUP_5 = 4,
CALIB_CH_GROUP_MAX
};
/********************* END TXPOWER *****************************************/
/**
* Tx/Rx Queues
*
* Most communication between driver and 4965 is via queues of data buffers.
* For example, all commands that the driver issues to device's embedded
* controller (uCode) are via the command queue (one of the Tx queues). All
* uCode command responses/replies/notifications, including Rx frames, are
* conveyed from uCode to driver via the Rx queue.
*
* Most support for these queues, including handshake support, resides in
* structures in host DRAM, shared between the driver and the device. When
* allocating this memory, the driver must make sure that data written by
* the host CPU updates DRAM immediately (and does not get "stuck" in CPU's
* cache memory), so DRAM and cache are consistent, and the device can
* immediately see changes made by the driver.
*
* 4965 supports up to 16 DRAM-based Tx queues, and services these queues via
* up to 7 DMA channels (FIFOs). Each Tx queue is supported by a circular array
* in DRAM containing 256 Transmit Frame Descriptors (TFDs).
*/
#define IWL49_NUM_FIFOS 7
#define IWL49_CMD_FIFO_NUM 4
#define IWL49_NUM_QUEUES 16
#define IWL49_NUM_AMPDU_QUEUES 8
/**
* struct iwl4965_schedq_bc_tbl
*
* Byte Count table
*
* Each Tx queue uses a byte-count table containing 320 entries:
* one 16-bit entry for each of 256 TFDs, plus an additional 64 entries that
* duplicate the first 64 entries (to avoid wrap-around within a Tx window;
* max Tx window is 64 TFDs).
*
* When driver sets up a new TFD, it must also enter the total byte count
* of the frame to be transmitted into the corresponding entry in the byte
* count table for the chosen Tx queue. If the TFD index is 0-63, the driver
* must duplicate the byte count entry in corresponding index 256-319.
*
* padding puts each byte count table on a 1024-byte boundary;
* 4965 assumes tables are separated by 1024 bytes.
*/
struct iwl4965_scd_bc_tbl {
__le16 tfd_offset[TFD_QUEUE_BC_SIZE];
u8 pad[1024 - (TFD_QUEUE_BC_SIZE) * sizeof(__le16)];
} __attribute__ ((packed));
#endif /* !__iwl_4965_hw_h__ */
| {
"pile_set_name": "Github"
} |
// Copyright (c) Facebook, Inc. and its affiliates.
//
// 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.
package api
import (
"context"
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"time"
jwt "github.com/dgrijalva/jwt-go"
"github.com/facebookincubator/nvdtools/providers/lib/client"
"github.com/facebookincubator/nvdtools/providers/snyk/schema"
)
type Client struct {
client.Client
baseURL string
consumerID string
secret string
}
func NewClient(c client.Client, baseURL, consumerID, secret string) *Client {
return &Client{
Client: c,
consumerID: consumerID,
secret: secret,
baseURL: baseURL,
}
}
func (c *Client) FetchAllVulnerabilities(ctx context.Context, since int64) (<-chan *schema.Advisory, error) {
// since is ignored, always download all from snyk
content, err := c.get(ctx, "vulnerabilities.json")
if err != nil {
return nil, fmt.Errorf("can't get vulnerabilities: %v", err)
}
output := make(chan *schema.Advisory)
go func() {
defer close(output)
defer content.Close()
var advisories schema.Advisories
if err := json.NewDecoder(content).Decode(&advisories); err != nil {
log.Printf("can't decode content into advisories: %v", err)
return
}
for _, advs := range advisories {
for _, adv := range advs {
output <- adv
}
}
}()
return output, nil
}
func (c *Client) get(ctx context.Context, endpoint string) (io.ReadCloser, error) {
tok := jwt.NewWithClaims(jwt.SigningMethodHS256, &jwt.StandardClaims{
Issuer: c.consumerID,
IssuedAt: time.Now().Unix(),
})
token, err := tok.SignedString([]byte(c.secret))
if err != nil {
return nil, fmt.Errorf("cannot create jwt token: %v", err)
}
url := fmt.Sprintf("%s/%s", c.baseURL, endpoint)
resp, err := client.Get(ctx, c, url, http.Header{
"Authorization": {"Bearer" + token},
})
if err != nil {
return nil, fmt.Errorf("failed to get vulnerabilities at %q: %v", url, err)
}
return resp.Body, nil
}
| {
"pile_set_name": "Github"
} |
# Generated by superflore -- DO NOT EDIT
#
# Copyright Open Source Robotics Foundation
inherit ros_distro_rolling
inherit ros_superflore_generated
DESCRIPTION = "A package containing some navigation related message and service definitions."
AUTHOR = "William Woodall <william@osrfoundation.org>"
HOMEPAGE = "https://wiki.ros.org"
SECTION = "devel"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://package.xml;beginline=8;endline=8;md5=12c26a18c7f493fdc7e8a93b16b7c04f"
ROS_CN = "common_interfaces"
ROS_BPN = "nav_msgs"
ROS_BUILD_DEPENDS = " \
builtin-interfaces \
geometry-msgs \
std-msgs \
"
ROS_BUILDTOOL_DEPENDS = " \
ament-cmake-native \
rosidl-default-generators-native \
"
ROS_EXPORT_DEPENDS = ""
ROS_BUILDTOOL_EXPORT_DEPENDS = ""
ROS_EXEC_DEPENDS = " \
builtin-interfaces \
geometry-msgs \
rosidl-default-runtime \
std-msgs \
"
# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags.
ROS_TEST_DEPENDS = " \
ament-lint-common \
"
DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}"
# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually
# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS.
DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}"
RDEPENDS_${PN} += "${ROS_EXEC_DEPENDS}"
# matches with: https://github.com/ros2-gbp/common_interfaces-release/archive/release/rolling/nav_msgs/2.1.0-1.tar.gz
ROS_BRANCH ?= "branch=release/rolling/nav_msgs"
SRC_URI = "git://github.com/ros2-gbp/common_interfaces-release;${ROS_BRANCH};protocol=https"
SRCREV = "78a15936174d0fe00ccab177de031497112d352f"
S = "${WORKDIR}/git"
ROS_BUILD_TYPE = "ament_cmake"
inherit ros_${ROS_BUILD_TYPE}
| {
"pile_set_name": "Github"
} |
#include <stdio.h>
#include <time.h>
#define MAX 2147483647
struct Matrix {
int cnt;
int one[100];
};
struct Pile {
int cnt;
int repeat[1000];
};
typedef struct Matrix Matrix;
typedef struct Pile Pile;
int N, M, setCnt;
int set[1001];
Matrix matrix[1001];
Pile pile[1001];
void search(int, int, int*);
int main() {
int i, j, min, flag;
clock_t st, ed;
st = clock();
while(scanf("%d %d", &N, &M) == 2) {
for(i = 0; i <= 1000; i++)
matrix[i].cnt = pile[i].cnt;
memset(set, 0, sizeof(set));
for(i = 0; i < N; i++) {
scanf("%d", &matrix[i].cnt);
for(j = 0; j < matrix[i].cnt; j++)
scanf("%d", &matrix[i].one[j]), set[matrix[i].one[j]] = 1;
pile[matrix[i].one[0]].repeat[pile[matrix[i].one[0]].cnt++] = i;
}
flag = 0;
for(i = 1; i <= M&&flag == 0; i++)
if(set[i] == 0)
flag = 1;
if(flag == 0) {
min = MAX;
setCnt = 0;
memset(set, 0, sizeof(set));
search(1, 0, &min);
printf(min == MAX?"No\n":"%d\n", min);
} else
puts("No");
}
ed = clock();
printf("[%f]\n", (float)(ed - st )/CLOCKS_PER_SEC);
return 0;
}
void search(int k, int cnt, int *min) {
int i, j, t, flag;
if(cnt > *min)
return ;
if(setCnt == M) {
*min = cnt < *min?cnt:*min;
return ;
}
if(k > M)
return ;
if(set[k] == 1) {
search(k+1, cnt, min);
return ;
}
for(i = 0; i < pile[k].cnt; i++) {
if(matrix[pile[k].repeat[i]].cnt+setCnt > M)
continue;
flag = 0;
for(j = 0; j < matrix[pile[k].repeat[i]].cnt&&flag == 0; j++)
if(set[matrix[pile[k].repeat[i]].one[j]] == 1)
flag = 1;
if(flag == 1)
continue;
for(j = 0; j < matrix[pile[k].repeat[i]].cnt; j++)
set[matrix[pile[k].repeat[i]].one[j]] = 1;
setCnt += matrix[pile[k].repeat[i]].cnt;
search(k+1, cnt+1, min);
for(j = 0; j < matrix[pile[k].repeat[i]].cnt; j++)
set[matrix[pile[k].repeat[i]].one[j]] = 0;
setCnt -= matrix[pile[k].repeat[i]].cnt;
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Provides classes for the secure socket package. Using the secure
* socket classes, you can communicate using SSL or a related security
* protocol to reliably detect any errors introduced into the network
* byte stream and to optionally encrypt the data and/or authenticate
* the communicating peers.
*
* <ul>
* <li><a href="{@docRoot}/../specs/security/standard-names.html">
* <b>Java™ Security Standard Algorithm Names Specification
* </b></a></li>
* </ul>
*
* @since 1.4
*/
package javax.net.ssl;
| {
"pile_set_name": "Github"
} |
/*
* Tigase XMPP Server - The instant messaging server
* Copyright (C) 2004 Tigase, Inc. (office@tigase.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. Look for COPYING file in the top folder.
* If not, see http://www.gnu.org/licenses/.
*/
package tigase.server.ext.lb;
import tigase.server.Packet;
import tigase.server.ext.ComponentConnection;
import tigase.server.ext.ComponentIOService;
import java.util.List;
/**
* @author Artur Hefczyc Created Jul 9, 2011
*/
public class ReceiverFullJidLB
implements LoadBalancerIfc {
@Override
public ComponentIOService selectConnection(Packet p, List<ComponentConnection> conns) {
ComponentIOService result = null;
int idx = Math.abs(p.getStanzaTo().hashCode() % conns.size());
ComponentConnection conn = conns.get(idx);
if (conn.getService() != null && conn.getService().isConnected()) {
result = conn.getService();
}
return result;
}
}
| {
"pile_set_name": "Github"
} |
using System;
using UnityEngine.Events;
namespace UnityAtoms.BaseAtoms
{
/// <summary>
/// None generic Unity Event of type `Void`. Inherits from `UnityEvent<Void>`.
/// </summary>
[Serializable]
public sealed class VoidUnityEvent : UnityEvent<Void> { }
}
| {
"pile_set_name": "Github"
} |
op {
graph_op_name: "ParseExample"
visibility: HIDDEN
}
| {
"pile_set_name": "Github"
} |
export interface IPatterns extends Array<Rule> {}
export interface IGrammar {
name: string;
scopeName: string;
fileTypes: string[];
patterns: IPatterns;
repository: IRepository;
}
export interface IMatchScopes {
[key: string]: RuleSimple;
}
export type Rule = RuleSimple | IRuleCapturing | IRuleDelimited | IRuleReference;
export interface IRuleCapturing {
match: string;
name?: string;
captures?: IMatchScopes;
patterns?: IPatterns;
}
export interface IRuleDelimited {
begin: string;
end: string;
applyEndPatternLast?: boolean;
name?: string;
contentName?: string;
beginCaptures?: IMatchScopes;
endCaptures?: IMatchScopes;
patterns?: IPatterns;
}
export interface IRuleReference {
include: string;
}
export type RuleSimple =
| {
name: string;
patterns?: IPatterns;
}
| {
name?: string;
patterns: IPatterns;
};
export interface IRepository {
[key: string]: Rule;
}
| {
"pile_set_name": "Github"
} |
<div id="footer">
Generated on <%= Time.now.strftime("%c") %> by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
<%= YARD::VERSION %> (ruby-<%= RUBY_VERSION %>).
</div>
<!-- BEGIN-SECTION -->
<script type="text/javascript" src="https://media.amazonwebservices.com/amznUrchin.js"></script>
<!-- SiteCatalyst code version: H.25.2. Copyright 1996-2012 Adobe, Inc. All Rights Reserved.
More info available at http://www.omniture.com -->
<script language="JavaScript" type="text/javascript" src="https://media.amazonwebservices.com/js/sitecatalyst/s_code.min.js">
</script>
<script language="JavaScript" type="text/javascript">
<!--
s.prop66='AWS SDK for Go';
s.eVar66='D=c66';
s.prop65='API Reference';
s.eVar65='D=c65';
var s_code=s.t();if(s_code)document.write(s_code)
//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--if(navigator.appVersion.indexOf('MSIE')>=0)document.write(unescape('%3C')+'\!-'+'-')
//-->
</script>
<noscript>
<img src="http://amazonwebservices.d2.sc.omtrdc.net/b/ss/awsamazondev/1/H.25.2--NS/0" height="1" width="1" border="0" alt="">
</noscript>
<!--/DO NOT REMOVE/-->
<!-- End SiteCatalyst code version: H.25.2. -->
<!-- END-SECTION -->
| {
"pile_set_name": "Github"
} |
import { Action } from '@ngrx/store';
import { Region } from '../../../model/address.model';
import { StateUtils } from '../../../state/utils/index';
import { REGIONS } from '../user-state';
export const LOAD_REGIONS = '[User] Load Regions';
export const LOAD_REGIONS_SUCCESS = '[User] Load Regions Success';
export const LOAD_REGIONS_FAIL = '[User] Load Regions Fail';
export const CLEAR_REGIONS = '[User] Clear Regions';
export class LoadRegions extends StateUtils.LoaderLoadAction {
readonly type = LOAD_REGIONS;
constructor(public payload: string) {
super(REGIONS);
}
}
export class LoadRegionsFail extends StateUtils.LoaderFailAction {
readonly type = LOAD_REGIONS_FAIL;
constructor(public payload: any) {
super(REGIONS, payload);
}
}
export class LoadRegionsSuccess extends StateUtils.LoaderSuccessAction {
readonly type = LOAD_REGIONS_SUCCESS;
constructor(public payload: { entities: Region[]; country: string }) {
super(REGIONS);
}
}
export class ClearRegions implements Action {
readonly type = CLEAR_REGIONS;
constructor() {}
}
export type RegionsAction =
| LoadRegions
| LoadRegionsFail
| LoadRegionsSuccess
| ClearRegions;
| {
"pile_set_name": "Github"
} |
// cgo -godefs -- -fsigned-char types_openbsd.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build arm,openbsd
package unix
const (
SizeofPtr = 0x4
SizeofShort = 0x2
SizeofInt = 0x4
SizeofLong = 0x4
SizeofLongLong = 0x8
)
type (
_C_short int16
_C_int int32
_C_long int32
_C_long_long int64
)
type Timespec struct {
Sec int64
Nsec int32
_ [4]byte
}
type Timeval struct {
Sec int64
Usec int32
_ [4]byte
}
type Rusage struct {
Utime Timeval
Stime Timeval
Maxrss int32
Ixrss int32
Idrss int32
Isrss int32
Minflt int32
Majflt int32
Nswap int32
Inblock int32
Oublock int32
Msgsnd int32
Msgrcv int32
Nsignals int32
Nvcsw int32
Nivcsw int32
}
type Rlimit struct {
Cur uint64
Max uint64
}
type _Gid_t uint32
type Stat_t struct {
Mode uint32
Dev int32
Ino uint64
Nlink uint32
Uid uint32
Gid uint32
Rdev int32
Atim Timespec
Mtim Timespec
Ctim Timespec
Size int64
Blocks int64
Blksize int32
Flags uint32
Gen uint32
_ [4]byte
_ Timespec
}
type Statfs_t struct {
F_flags uint32
F_bsize uint32
F_iosize uint32
_ [4]byte
F_blocks uint64
F_bfree uint64
F_bavail int64
F_files uint64
F_ffree uint64
F_favail int64
F_syncwrites uint64
F_syncreads uint64
F_asyncwrites uint64
F_asyncreads uint64
F_fsid Fsid
F_namemax uint32
F_owner uint32
F_ctime uint64
F_fstypename [16]int8
F_mntonname [90]int8
F_mntfromname [90]int8
F_mntfromspec [90]int8
_ [2]byte
Mount_info [160]byte
}
type Flock_t struct {
Start int64
Len int64
Pid int32
Type int16
Whence int16
}
type Dirent struct {
Fileno uint64
Off int64
Reclen uint16
Type uint8
Namlen uint8
_ [4]uint8
Name [256]int8
}
type Fsid struct {
Val [2]int32
}
const (
PathMax = 0x400
)
type RawSockaddrInet4 struct {
Len uint8
Family uint8
Port uint16
Addr [4]byte /* in_addr */
Zero [8]int8
}
type RawSockaddrInet6 struct {
Len uint8
Family uint8
Port uint16
Flowinfo uint32
Addr [16]byte /* in6_addr */
Scope_id uint32
}
type RawSockaddrUnix struct {
Len uint8
Family uint8
Path [104]int8
}
type RawSockaddrDatalink struct {
Len uint8
Family uint8
Index uint16
Type uint8
Nlen uint8
Alen uint8
Slen uint8
Data [24]int8
}
type RawSockaddr struct {
Len uint8
Family uint8
Data [14]int8
}
type RawSockaddrAny struct {
Addr RawSockaddr
Pad [92]int8
}
type _Socklen uint32
type Linger struct {
Onoff int32
Linger int32
}
type Iovec struct {
Base *byte
Len uint32
}
type IPMreq struct {
Multiaddr [4]byte /* in_addr */
Interface [4]byte /* in_addr */
}
type IPv6Mreq struct {
Multiaddr [16]byte /* in6_addr */
Interface uint32
}
type Msghdr struct {
Name *byte
Namelen uint32
Iov *Iovec
Iovlen uint32
Control *byte
Controllen uint32
Flags int32
}
type Cmsghdr struct {
Len uint32
Level int32
Type int32
}
type Inet6Pktinfo struct {
Addr [16]byte /* in6_addr */
Ifindex uint32
}
type IPv6MTUInfo struct {
Addr RawSockaddrInet6
Mtu uint32
}
type ICMPv6Filter struct {
Filt [8]uint32
}
const (
SizeofSockaddrInet4 = 0x10
SizeofSockaddrInet6 = 0x1c
SizeofSockaddrAny = 0x6c
SizeofSockaddrUnix = 0x6a
SizeofSockaddrDatalink = 0x20
SizeofLinger = 0x8
SizeofIPMreq = 0x8
SizeofIPv6Mreq = 0x14
SizeofMsghdr = 0x1c
SizeofCmsghdr = 0xc
SizeofInet6Pktinfo = 0x14
SizeofIPv6MTUInfo = 0x20
SizeofICMPv6Filter = 0x20
)
const (
PTRACE_TRACEME = 0x0
PTRACE_CONT = 0x7
PTRACE_KILL = 0x8
)
type Kevent_t struct {
Ident uint32
Filter int16
Flags uint16
Fflags uint32
_ [4]byte
Data int64
Udata *byte
_ [4]byte
}
type FdSet struct {
Bits [32]uint32
}
const (
SizeofIfMsghdr = 0xa8
SizeofIfData = 0x90
SizeofIfaMsghdr = 0x18
SizeofIfAnnounceMsghdr = 0x1a
SizeofRtMsghdr = 0x60
SizeofRtMetrics = 0x38
)
type IfMsghdr struct {
Msglen uint16
Version uint8
Type uint8
Hdrlen uint16
Index uint16
Tableid uint16
Pad1 uint8
Pad2 uint8
Addrs int32
Flags int32
Xflags int32
Data IfData
}
type IfData struct {
Type uint8
Addrlen uint8
Hdrlen uint8
Link_state uint8
Mtu uint32
Metric uint32
Rdomain uint32
Baudrate uint64
Ipackets uint64
Ierrors uint64
Opackets uint64
Oerrors uint64
Collisions uint64
Ibytes uint64
Obytes uint64
Imcasts uint64
Omcasts uint64
Iqdrops uint64
Oqdrops uint64
Noproto uint64
Capabilities uint32
_ [4]byte
Lastchange Timeval
}
type IfaMsghdr struct {
Msglen uint16
Version uint8
Type uint8
Hdrlen uint16
Index uint16
Tableid uint16
Pad1 uint8
Pad2 uint8
Addrs int32
Flags int32
Metric int32
}
type IfAnnounceMsghdr struct {
Msglen uint16
Version uint8
Type uint8
Hdrlen uint16
Index uint16
What uint16
Name [16]int8
}
type RtMsghdr struct {
Msglen uint16
Version uint8
Type uint8
Hdrlen uint16
Index uint16
Tableid uint16
Priority uint8
Mpls uint8
Addrs int32
Flags int32
Fmask int32
Pid int32
Seq int32
Errno int32
Inits uint32
Rmx RtMetrics
}
type RtMetrics struct {
Pksent uint64
Expire int64
Locks uint32
Mtu uint32
Refcnt uint32
Hopcount uint32
Recvpipe uint32
Sendpipe uint32
Ssthresh uint32
Rtt uint32
Rttvar uint32
Pad uint32
}
type Mclpool struct{}
const (
SizeofBpfVersion = 0x4
SizeofBpfStat = 0x8
SizeofBpfProgram = 0x8
SizeofBpfInsn = 0x8
SizeofBpfHdr = 0x14
)
type BpfVersion struct {
Major uint16
Minor uint16
}
type BpfStat struct {
Recv uint32
Drop uint32
}
type BpfProgram struct {
Len uint32
Insns *BpfInsn
}
type BpfInsn struct {
Code uint16
Jt uint8
Jf uint8
K uint32
}
type BpfHdr struct {
Tstamp BpfTimeval
Caplen uint32
Datalen uint32
Hdrlen uint16
_ [2]byte
}
type BpfTimeval struct {
Sec uint32
Usec uint32
}
type Termios struct {
Iflag uint32
Oflag uint32
Cflag uint32
Lflag uint32
Cc [20]uint8
Ispeed int32
Ospeed int32
}
type Winsize struct {
Row uint16
Col uint16
Xpixel uint16
Ypixel uint16
}
const (
AT_FDCWD = -0x64
AT_SYMLINK_FOLLOW = 0x4
AT_SYMLINK_NOFOLLOW = 0x2
)
type PollFd struct {
Fd int32
Events int16
Revents int16
}
const (
POLLERR = 0x8
POLLHUP = 0x10
POLLIN = 0x1
POLLNVAL = 0x20
POLLOUT = 0x4
POLLPRI = 0x2
POLLRDBAND = 0x80
POLLRDNORM = 0x40
POLLWRBAND = 0x100
POLLWRNORM = 0x4
)
type Sigset_t uint32
type Utsname struct {
Sysname [256]byte
Nodename [256]byte
Release [256]byte
Version [256]byte
Machine [256]byte
}
const SizeofUvmexp = 0x158
type Uvmexp struct {
Pagesize int32
Pagemask int32
Pageshift int32
Npages int32
Free int32
Active int32
Inactive int32
Paging int32
Wired int32
Zeropages int32
Reserve_pagedaemon int32
Reserve_kernel int32
Unused01 int32
Vnodepages int32
Vtextpages int32
Freemin int32
Freetarg int32
Inactarg int32
Wiredmax int32
Anonmin int32
Vtextmin int32
Vnodemin int32
Anonminpct int32
Vtextminpct int32
Vnodeminpct int32
Nswapdev int32
Swpages int32
Swpginuse int32
Swpgonly int32
Nswget int32
Nanon int32
Unused05 int32
Unused06 int32
Faults int32
Traps int32
Intrs int32
Swtch int32
Softs int32
Syscalls int32
Pageins int32
Unused07 int32
Unused08 int32
Pgswapin int32
Pgswapout int32
Forks int32
Forks_ppwait int32
Forks_sharevm int32
Pga_zerohit int32
Pga_zeromiss int32
Unused09 int32
Fltnoram int32
Fltnoanon int32
Fltnoamap int32
Fltpgwait int32
Fltpgrele int32
Fltrelck int32
Fltrelckok int32
Fltanget int32
Fltanretry int32
Fltamcopy int32
Fltnamap int32
Fltnomap int32
Fltlget int32
Fltget int32
Flt_anon int32
Flt_acow int32
Flt_obj int32
Flt_prcopy int32
Flt_przero int32
Pdwoke int32
Pdrevs int32
Pdswout int32
Pdfreed int32
Pdscans int32
Pdanscan int32
Pdobscan int32
Pdreact int32
Pdbusy int32
Pdpageouts int32
Pdpending int32
Pddeact int32
Unused11 int32
Unused12 int32
Unused13 int32
Fpswtch int32
Kmapent int32
}
const SizeofClockinfo = 0x14
type Clockinfo struct {
Hz int32
Tick int32
Tickadj int32
Stathz int32
Profhz int32
}
| {
"pile_set_name": "Github"
} |
Custom Actions
==============
You can override and extend Admin::ResourcesController with your methods.
Actions are defined in ``config/typus/application.yml``:
.. code-block:: yaml
Post:
...
actions:
index: custom_action
edit: custom_action_for_an_item
Remember to define permissions on ``config/typus/application_roles.yml`` to
have access to the new actions.
.. code-block:: yaml
admin:
Post: all
editor:
Post: create, read, update, custom_action_for_an_item
Your controller will look like this ...
.. code-block:: ruby
class Admin::PostsController < Admin::ResourcesController
def custom_action
...
end
def custom_action_for_an_item
...
end
end
| {
"pile_set_name": "Github"
} |
/*
* 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.
*/
package com.aliyuncs.ots.model.v20160620;
import com.aliyuncs.RpcAcsRequest;
import com.aliyuncs.http.MethodType;
/**
* @author auto create
* @version
*/
public class UpdateInstanceRequest extends RpcAcsRequest<UpdateInstanceResponse> {
private Long resourceOwnerId;
private String network;
private String instanceName;
public UpdateInstanceRequest() {
super("Ots", "2016-06-20", "UpdateInstance", "ots");
setMethod(MethodType.POST);
}
public Long getResourceOwnerId() {
return this.resourceOwnerId;
}
public void setResourceOwnerId(Long resourceOwnerId) {
this.resourceOwnerId = resourceOwnerId;
if(resourceOwnerId != null){
putQueryParameter("ResourceOwnerId", resourceOwnerId.toString());
}
}
public String getNetwork() {
return this.network;
}
public void setNetwork(String network) {
this.network = network;
if(network != null){
putQueryParameter("Network", network);
}
}
public String getInstanceName() {
return this.instanceName;
}
public void setInstanceName(String instanceName) {
this.instanceName = instanceName;
if(instanceName != null){
putQueryParameter("InstanceName", instanceName);
}
}
@Override
public Class<UpdateInstanceResponse> getResponseClass() {
return UpdateInstanceResponse.class;
}
}
| {
"pile_set_name": "Github"
} |
import datetime
import uuid
import sqlalchemy
from blue_yellow_app.data.modelbase import SqlAlchemyBase
class PasswordReset(SqlAlchemyBase):
__tablename__ = 'PasswordReset'
id = sqlalchemy.Column(sqlalchemy.String, primary_key=True,
default=lambda: str(uuid.uuid4()).replace('-', ''))
created_date = sqlalchemy.Column(sqlalchemy.DateTime, default=datetime.datetime.now)
used_date = sqlalchemy.Column(sqlalchemy.DateTime, nullable=True)
was_used = sqlalchemy.Column(sqlalchemy.Boolean, default=False)
used_ip_address = sqlalchemy.Column(sqlalchemy.String, nullable=True)
user_id = sqlalchemy.Column(sqlalchemy.String, sqlalchemy.ForeignKey('Account.id'))
| {
"pile_set_name": "Github"
} |
namespace Umbraco.Core.Models
{
public interface IImageUrlGenerator
{
string GetImageUrl(ImageUrlGenerationOptions options);
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package chacha20poly1305
import (
"bytes"
cr "crypto/rand"
"encoding/hex"
mr "math/rand"
"testing"
)
func TestVectors(t *testing.T) {
for i, test := range chacha20Poly1305Tests {
key, _ := hex.DecodeString(test.key)
nonce, _ := hex.DecodeString(test.nonce)
ad, _ := hex.DecodeString(test.aad)
plaintext, _ := hex.DecodeString(test.plaintext)
aead, err := New(key)
if err != nil {
t.Fatal(err)
}
ct := aead.Seal(nil, nonce, plaintext, ad)
if ctHex := hex.EncodeToString(ct); ctHex != test.out {
t.Errorf("#%d: got %s, want %s", i, ctHex, test.out)
continue
}
plaintext2, err := aead.Open(nil, nonce, ct, ad)
if err != nil {
t.Errorf("#%d: Open failed", i)
continue
}
if !bytes.Equal(plaintext, plaintext2) {
t.Errorf("#%d: plaintext's don't match: got %x vs %x", i, plaintext2, plaintext)
continue
}
if len(ad) > 0 {
alterAdIdx := mr.Intn(len(ad))
ad[alterAdIdx] ^= 0x80
if _, err := aead.Open(nil, nonce, ct, ad); err == nil {
t.Errorf("#%d: Open was successful after altering additional data", i)
}
ad[alterAdIdx] ^= 0x80
}
alterNonceIdx := mr.Intn(aead.NonceSize())
nonce[alterNonceIdx] ^= 0x80
if _, err := aead.Open(nil, nonce, ct, ad); err == nil {
t.Errorf("#%d: Open was successful after altering nonce", i)
}
nonce[alterNonceIdx] ^= 0x80
alterCtIdx := mr.Intn(len(ct))
ct[alterCtIdx] ^= 0x80
if _, err := aead.Open(nil, nonce, ct, ad); err == nil {
t.Errorf("#%d: Open was successful after altering ciphertext", i)
}
ct[alterCtIdx] ^= 0x80
}
}
func TestRandom(t *testing.T) {
// Some random tests to verify Open(Seal) == Plaintext
for i := 0; i < 256; i++ {
var nonce [12]byte
var key [32]byte
al := mr.Intn(128)
pl := mr.Intn(16384)
ad := make([]byte, al)
plaintext := make([]byte, pl)
cr.Read(key[:])
cr.Read(nonce[:])
cr.Read(ad)
cr.Read(plaintext)
aead, err := New(key[:])
if err != nil {
t.Fatal(err)
}
ct := aead.Seal(nil, nonce[:], plaintext, ad)
plaintext2, err := aead.Open(nil, nonce[:], ct, ad)
if err != nil {
t.Errorf("Random #%d: Open failed", i)
continue
}
if !bytes.Equal(plaintext, plaintext2) {
t.Errorf("Random #%d: plaintext's don't match: got %x vs %x", i, plaintext2, plaintext)
continue
}
if len(ad) > 0 {
alterAdIdx := mr.Intn(len(ad))
ad[alterAdIdx] ^= 0x80
if _, err := aead.Open(nil, nonce[:], ct, ad); err == nil {
t.Errorf("Random #%d: Open was successful after altering additional data", i)
}
ad[alterAdIdx] ^= 0x80
}
alterNonceIdx := mr.Intn(aead.NonceSize())
nonce[alterNonceIdx] ^= 0x80
if _, err := aead.Open(nil, nonce[:], ct, ad); err == nil {
t.Errorf("Random #%d: Open was successful after altering nonce", i)
}
nonce[alterNonceIdx] ^= 0x80
alterCtIdx := mr.Intn(len(ct))
ct[alterCtIdx] ^= 0x80
if _, err := aead.Open(nil, nonce[:], ct, ad); err == nil {
t.Errorf("Random #%d: Open was successful after altering ciphertext", i)
}
ct[alterCtIdx] ^= 0x80
}
}
func benchamarkChaCha20Poly1305Seal(b *testing.B, buf []byte) {
b.SetBytes(int64(len(buf)))
var key [32]byte
var nonce [12]byte
var ad [13]byte
var out []byte
aead, _ := New(key[:])
b.ResetTimer()
for i := 0; i < b.N; i++ {
out = aead.Seal(out[:0], nonce[:], buf[:], ad[:])
}
}
func benchamarkChaCha20Poly1305Open(b *testing.B, buf []byte) {
b.SetBytes(int64(len(buf)))
var key [32]byte
var nonce [12]byte
var ad [13]byte
var ct []byte
var out []byte
aead, _ := New(key[:])
ct = aead.Seal(ct[:0], nonce[:], buf[:], ad[:])
b.ResetTimer()
for i := 0; i < b.N; i++ {
out, _ = aead.Open(out[:0], nonce[:], ct[:], ad[:])
}
}
func BenchmarkChacha20Poly1305Open_64(b *testing.B) {
benchamarkChaCha20Poly1305Open(b, make([]byte, 64))
}
func BenchmarkChacha20Poly1305Seal_64(b *testing.B) {
benchamarkChaCha20Poly1305Seal(b, make([]byte, 64))
}
func BenchmarkChacha20Poly1305Open_1350(b *testing.B) {
benchamarkChaCha20Poly1305Open(b, make([]byte, 1350))
}
func BenchmarkChacha20Poly1305Seal_1350(b *testing.B) {
benchamarkChaCha20Poly1305Seal(b, make([]byte, 1350))
}
func BenchmarkChacha20Poly1305Open_8K(b *testing.B) {
benchamarkChaCha20Poly1305Open(b, make([]byte, 8*1024))
}
func BenchmarkChacha20Poly1305Seal_8K(b *testing.B) {
benchamarkChaCha20Poly1305Seal(b, make([]byte, 8*1024))
}
| {
"pile_set_name": "Github"
} |
# Kodi Media Center language file
# Addon Name: Aeon Nox
# Addon id: skin.aeon.nox.5
# Addon Provider: BigNoid
msgid ""
msgstr ""
"Project-Id-Version: XBMC Skins\n"
"Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Kodi Translation Team\n"
"Language-Team: Tajik (http://www.transifex.com/projects/p/xbmc-skins/language/tg/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: tg\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgctxt "#31003"
msgid "Power Options"
msgstr "Имконоти барқ"
msgctxt "#31005"
msgid "Fixed"
msgstr "Таъйиншуда"
msgctxt "#31006"
msgid "View Options"
msgstr "Имконоти намоиш"
msgctxt "#31008"
msgid "Full screen"
msgstr "Экрани пурра"
msgctxt "#31009"
msgid "Total Duration"
msgstr "Давомнокии умумӣ"
msgctxt "#31019"
msgid "Network"
msgstr "Шабака"
msgctxt "#31024"
msgid "Page"
msgstr "Саҳифа"
msgctxt "#31025"
msgid "Items"
msgstr "Объект"
msgctxt "#31026"
msgid "Misc Options"
msgstr "Имконоти гуногун"
msgctxt "#31039"
msgid "Actions"
msgstr "Амалҳо"
msgctxt "#31040"
msgid "Now Playing"
msgstr "Ҳозир пахш мекунад"
msgctxt "#31046"
msgid "SEEKING"
msgstr "ҶУСТУҶӮ"
msgctxt "#31048"
msgid "Visualisation Presets"
msgstr "Танзимҳои таҷассум"
msgctxt "#31050"
msgid "Sort: Ascending"
msgstr "Мураттаб: Бароянда"
msgctxt "#31051"
msgid "Sort: Descending"
msgstr "Мураттаб: Камшаванда"
msgctxt "#31055"
msgid "Open playlist"
msgstr "Кушодани рӯйхати пахш"
msgctxt "#31056"
msgid "Save playlist"
msgstr "Захира кардани рӯйхати пахш"
msgctxt "#31057"
msgid "Close playlist"
msgstr "Пӯшидани рӯйхати пахш"
msgctxt "#31058"
msgid "PVR information"
msgstr "Иттилооти PVR"
msgctxt "#31060"
msgid "This file is stacked, select the part you want to play from."
msgstr "Ин файли таркибӣ мебошад, қисмеро, ки мехоҳед пахш кунед, интихоб намоед."
msgctxt "#31079"
msgid "Shift"
msgstr "Shift"
msgctxt "#31102"
msgid "Background"
msgstr "Пасзамина"
msgctxt "#31124"
msgid "Show Background \"Now Playing\" Video"
msgstr "Намоиш додани видеои пахшшаванда дар пасзамина"
msgctxt "#31125"
msgid "Show Background \"Now Playing\" Visualisation"
msgstr "Намоиш додани таҷассуми пахшшаванда дар пасзамина"
msgctxt "#31129"
msgid "Hide Fanart in full screen visualisation"
msgstr "Пинҳон кардани маҳорати хӯши дар таҷассуми экрани пурра"
msgctxt "#31142"
msgid "Settings level"
msgstr "Сатҳи танзимот"
msgctxt "#31205"
msgid "Lyrics Source"
msgstr "Манбаи лирика"
msgctxt "#31301"
msgid "Last Updated"
msgstr "Навсозии охирин"
msgctxt "#31307"
msgid "Hide Fanart"
msgstr "Пинҳон кардани маҳорати хӯшӣ"
msgctxt "#31309"
msgid "Memory Used:"
msgstr "Ҳофизаи истифодашуда:"
msgctxt "#31317"
msgid "Set Fanart Path"
msgstr "Интихоби масири маҳорати хӯшӣ"
msgctxt "#31320"
msgid "Last Logged In"
msgstr "Воридшавии охирин"
msgctxt "#31321"
msgid "Karaoke Song Selector"
msgstr "Интихобкунандаи суруди караоке"
msgctxt "#31328"
msgid "Recently Added"
msgstr "Иловашудаи охирин"
msgctxt "#31390"
msgid "Skin default"
msgstr "Пӯсти пешфарз"
msgctxt "#31400"
msgid "[B]CONFIGURE APPEARANCE SETTINGS[/B][CR][CR]Change the skin · Set language and region · Change file listing options[CR]Set up a screensaver"
msgstr "[B]ТАНЗИМОТИ НАМУДИ ЗОҲИРӢ[/B][CR][CR]Тағйир додани пӯст • Интихоби забон ва минтақа • Тағйир додани имконоти рӯйхати файлҳо[CR]Танзимоти пардаи экран"
msgctxt "#31401"
msgid "[B]CONFIGURE VIDEO SETTINGS[/B][CR][CR]Manage your video library · Set video playback options · Change video listing options[CR]Set subtitle fonts"
msgstr "[B]ТАНЗИМОТИ ПАРАМЕТРҲОИ ВИДЕО[/B][CR][CR]Идоракунии китобхонаи видеоӣ • Имконоти пахши видео[CR]Тағйир додани имконоти рӯйхати видеоҳо • Танзимоти шрифтҳои зерунвон"
msgctxt "#31402"
msgid "[B]CONFIGURE MUSIC SETTINGS[/B][CR][CR]Manage your music library · Set music playback options · Change music listing options[CR]Setup song submission · Set karaoke options"
msgstr "[B]ТАНЗИМОТИ ПАРАМЕТРҲОИ МУСИҚӢ[/B][CR][CR]Идоракунии китобхонаи мусиқӣ · Имконоти пахши мусиқӣ · Тағйир додани имконоти рӯйхати мусиқӣ[CR]Танзими иловакунии мусиқӣ · Танзими имконоти караоке"
msgctxt "#31403"
msgid "[B]CONFIGURE PICTURE SETTINGS[/B][CR][CR]Set picture listing options · Configure slideshows"
msgstr "[B]ТАНЗИМОТИ ПАРАМЕТРҲОИ СУРАТҲО[/B][CR][CR]Тағйир додани имконоти рӯйхати суратҳо · Танзимоти намоиши слайдҳо"
msgctxt "#31404"
msgid "[B]CONFIGURE WEATHER SETTINGS[/B][CR][CR]Set three cities to collect weather information"
msgstr "[B]ТАНЗИМОТИ ПАРАМЕТРҲОИ ОБУ ҲАВО[/B][CR][CR]Интихоби се шаҳр барои гирифтани иттилооти пешгӯии обу ҳаво"
msgctxt "#31406"
msgid "[B]CONFIGURE SYSTEM SETTINGS[/B][CR][CR]Setup and calibrate displays · Configure audio output · Setup remote controls[CR]Set power saving options · Enable debugging · Setup master lock"
msgstr "[B]ТАНЗИМОТИ ПАРАМЕТРҲОИ СИСТЕМА[/B][CR][CR]Танзимот ва санҷиши дисплейҳо · Танзимоти барориши аудио · Танзимоти идоракунии дурдаст[CR]Танзимоти масрафи барқ · Танзимоти ислоҳи хатоҳо · Танзимоти қулфкунӣ"
msgctxt "#31408"
msgid "[B]CONFIGURE ADD-ONS[/B][CR][CR]Manage your installed Add-ons · Browse for and install Add-ons from kodi.tv[CR]Modify Add-on settings"
msgstr "[B]ТАНЗИМОТИ БАРНОМАҲОИ ИЛОВАГӢ[/B][CR][CR]Идоракунии барномаҳои иловагии насбшуда • Тамошо кардан ва насб кардани барномаҳои иловагӣ аз kodi.tv[CR]Тағйир додани танзимоти барномаҳои иловагӣ"
msgctxt "#31409"
msgid "[B]CONFIGURE TV SETTINGS[/B][CR][CR]Change full screen info · Manage EPG data settings"
msgstr "[B]ТАНЗИМОТИ ПАРАМЕТРҲОИ ТВ[/B][CR][CR]Танзимоти иттилооти экрани пурра · Идоракунии танзимоти иттилооти EPG"
msgctxt "#31410"
msgid "[B]CONFIGURE SERVICE SETTINGS[/B][CR][CR]Setup control of Kodi via UPnP and HTTP · Configure file sharing[CR]Enable Zeroconf · Configure AirPlay"
msgstr "[B]ТАНЗИМОТИ ПАРАМЕТРҲОИ ХИДМАТҲО[/B][CR][CR]танзимоти идоракунии Kodi тавассути UPnP ва HTTP · Танзимоти мубодилакунии файлҳо[CR]Фаъол кардани Zeroconf · Танзимоти AirPlay"
msgctxt "#31413"
msgid "Local subtitle available"
msgstr "Зерунвонҳои маҳаллӣ дастрасанд"
msgctxt "#31502"
msgid "Live TV"
msgstr "Пахши мустақим"
msgctxt "#31503"
msgid "Add Group"
msgstr "Илова кардани гурӯҳ"
msgctxt "#31504"
msgid "Rename Group"
msgstr "Тоза кардани гурӯҳ"
msgctxt "#31505"
msgid "Delete Group"
msgstr "Нест кардани гурӯҳ"
msgctxt "#31506"
msgid "Available[CR]Groups"
msgstr "Гурӯҳҳои[CR]дастрас"
msgctxt "#31511"
msgid "Channel Options"
msgstr "Имконоти шабака"
msgctxt "#31901"
msgid "36 Hour Forecast"
msgstr "Пешгӯии обу ҳаво барои 36 соат"
msgctxt "#31902"
msgid "Hourly Forecast"
msgstr "Пешгӯии обу ҳаво барои як соат"
msgctxt "#31903"
msgid "Weekend Forecast"
msgstr "Пешгӯии обу ҳаво барои рӯзҳои истироҳат"
msgctxt "#31904"
msgid "10 Day Forecast"
msgstr "Пешгӯии обу ҳаво барои 10 рӯз"
msgctxt "#31908"
msgid "Chance of Precipitation"
msgstr "Эҳтимолияти барфу борон"
msgctxt "#31909"
msgid "Fetching forecast info..."
msgstr "Бозёбии иттилооти пешгӯӣ..."
msgctxt "#31910"
msgid "Map & Alerts"
msgstr "Харита ва ҳушдорҳо"
msgctxt "#31950"
msgid "WEATHER"
msgstr "ОБУ ҲАВО"
msgctxt "#31951"
msgid "PICTURES"
msgstr "СУРАТҲО"
msgctxt "#31952"
msgid "LIVE TV"
msgstr "ПАХШИ МУСТАҚИМ"
msgctxt "#31953"
msgid "VIDEOS"
msgstr "ВИДЕОҲО"
msgctxt "#31954"
msgid "MOVIES"
msgstr "ФИЛМҲО"
msgctxt "#31955"
msgid "TV SHOWS"
msgstr "БАРНОМАҲОИ TV"
msgctxt "#31956"
msgid "MUSIC"
msgstr "МУСИҚӢ"
msgctxt "#31958"
msgid "PLAY DISC"
msgstr "ПАХШИ ДИСК"
msgctxt "#31959"
msgid "SYSTEM"
msgstr "СИСТЕМА"
| {
"pile_set_name": "Github"
} |
package com.kingston.im.chat.net.message;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import com.kingston.im.chat.net.IoSession;
public enum PacketManager {
INSTANCE;
public void execPacket(IoSession session, AbstractPacket pact){
if(pact == null) return;
try {
Method m = pact.getClass().getMethod("execPacket", IoSession.class);
m.invoke(pact, session);
} catch (NoSuchMethodException | SecurityException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
public AbstractPacket createNewPacket(int packetType){
Class<? extends AbstractPacket> packetClass = PacketType.getPacketClassBy(packetType);
if(packetClass == null){
throw new IllegalPacketException("类型为"+packetType+"的包定义不存在");
}
AbstractPacket packet = null;
try {
packet = (AbstractPacket)packetClass.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
throw new IllegalPacketException("类型为"+packetType+"的包实例化失败");
}
return packet;
}
}
| {
"pile_set_name": "Github"
} |
# Changelog
## Not yet released
None yet.
## v1.10.0
* #49 want convenience functions for MultiErrors
## v1.9.0
* #47 could use VError.hasCauseWithName()
## v1.8.1
* #39 captureStackTrace lost when inheriting from WError
## v1.8.0
* #23 Preserve original stack trace(s)
## v1.7.0
* #10 better support for extra properties on Errors
* #11 make it easy to find causes of a particular kind
* #29 No documentation on how to Install this package
* #36 elide development-only files from npm package
| {
"pile_set_name": "Github"
} |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { Position, Range, TextDocument } from 'vscode-languageserver';
export const getRangeAtPosition = (document: TextDocument, position: Position): Range | undefined => {
const text = document.getText();
const line = position.line;
const pos = position.character;
if (line >= text.split('\n').length) {
return undefined;
}
const lineText = text.split('\n')[line];
let match: RegExpMatchArray | null;
const wordDefinition = /[a-zA-Z0-9_/.-]+/g;
while ((match = wordDefinition.exec(lineText))) {
const matchIndex = match.index || 0;
if (matchIndex > pos) {
return undefined;
} else if (wordDefinition.lastIndex >= pos) {
return Range.create(line, matchIndex, line, wordDefinition.lastIndex);
}
}
return undefined;
};
export const getCompletionString = (currentWord: string, completionLabel: string): string => {
const currentWordArray = currentWord.split('.');
const completionLabelArray = completionLabel.split('.');
const completionArray = completionLabelArray.slice(currentWordArray.length - 1);
const completionString = completionArray.join('.');
return completionString;
};
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<PRONOM-Report xmlns="http://pronom.nationalarchives.gov.uk">
<report_format_detail>
<FileFormat>
<FormatID>523</FormatID>
<FormatName>Scanstudio 16-Colour Bitmap</FormatName>
<FormatVersion>
</FormatVersion>
<FormatAliases>
</FormatAliases>
<FormatFamilies>
</FormatFamilies>
<FormatTypes>Image (Raster)</FormatTypes>
<FormatDisclosure>
</FormatDisclosure>
<FormatDescription>This is an outline record only, and requires further details, research or authentication to provide information that will enable users to further understand the format and to assess digital preservation risks associated with it if appropriate. If you are able to help by supplying any additional information concerning this entry, please return to the main PRONOM page and select ‘Add an Entry’.</FormatDescription>
<BinaryFileFormat>Text</BinaryFileFormat>
<ByteOrders>
</ByteOrders>
<ReleaseDate>
</ReleaseDate>
<WithdrawnDate>
</WithdrawnDate>
<ProvenanceSourceID>1</ProvenanceSourceID>
<ProvenanceName>Digital Preservation Department / The National Archives</ProvenanceName>
<ProvenanceSourceDate>02 Aug 2005</ProvenanceSourceDate>
<ProvenanceDescription>
</ProvenanceDescription>
<LastUpdatedDate>02 Aug 2005</LastUpdatedDate>
<FormatNote>
</FormatNote>
<FormatRisk>
</FormatRisk>
<TechnicalEnvironment>
</TechnicalEnvironment>
<FileFormatIdentifier>
<Identifier>x-fmt/357</Identifier>
<IdentifierType>PUID</IdentifierType>
</FileFormatIdentifier>
<ExternalSignature>
<ExternalSignatureID>510</ExternalSignatureID>
<Signature>adc</Signature>
<SignatureType>File extension</SignatureType>
</ExternalSignature>
</FileFormat>
<SearchCriteria>Criteria</SearchCriteria>
</report_format_detail>
</PRONOM-Report>
| {
"pile_set_name": "Github"
} |
// @warnings{no-unused}
module test;
func void test2(i32) {
}
| {
"pile_set_name": "Github"
} |
/*****************************************************************************
* x264.h: x264 public header
*****************************************************************************
* Copyright (C) 2003-2011 x264 project
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Loren Merritt <lorenm@u.washington.edu>
* Jason Garrett-Glaser <darkshikari@gmail.com>
*
* This program 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 2 of the License, or
* (at your option) any later version.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
*
* This program is also available under a commercial proprietary license.
* For more information, contact us at licensing@x264.com.
*****************************************************************************/
#ifndef X264_X264_H
#define X264_X264_H
#if !defined(__STDINT_H) && !defined(_STDINT_H) && !defined(_STDINT_H_) && \
!defined(_INTTYPES_H) && !defined(_INTTYPES_H_) && !defined(__INTEL_COMPILER)
# ifdef _MSC_VER
# pragma message("You must include stdint.h or inttypes.h before x264.h")
# else
# warning You must include stdint.h or inttypes.h before x264.h
# endif
#endif
#include <stdarg.h>
#include "x264_config.h"
#define X264_BUILD 120
/* x264_t:
* opaque handler for encoder */
typedef struct x264_t x264_t;
/****************************************************************************
* NAL structure and functions
****************************************************************************/
enum nal_unit_type_e
{
NAL_UNKNOWN = 0,
NAL_SLICE = 1,
NAL_SLICE_DPA = 2,
NAL_SLICE_DPB = 3,
NAL_SLICE_DPC = 4,
NAL_SLICE_IDR = 5, /* ref_idc != 0 */
NAL_SEI = 6, /* ref_idc == 0 */
NAL_SPS = 7,
NAL_PPS = 8,
NAL_AUD = 9,
NAL_FILLER = 12,
/* ref_idc == 0 for 6,9,10,11,12 */
};
enum nal_priority_e
{
NAL_PRIORITY_DISPOSABLE = 0,
NAL_PRIORITY_LOW = 1,
NAL_PRIORITY_HIGH = 2,
NAL_PRIORITY_HIGHEST = 3,
};
/* The data within the payload is already NAL-encapsulated; the ref_idc and type
* are merely in the struct for easy access by the calling application.
* All data returned in an x264_nal_t, including the data in p_payload, is no longer
* valid after the next call to x264_encoder_encode. Thus it must be used or copied
* before calling x264_encoder_encode or x264_encoder_headers again. */
typedef struct
{
int i_ref_idc; /* nal_priority_e */
int i_type; /* nal_unit_type_e */
int b_long_startcode;
int i_first_mb; /* If this NAL is a slice, the index of the first MB in the slice. */
int i_last_mb; /* If this NAL is a slice, the index of the last MB in the slice. */
/* Size of payload in bytes. */
int i_payload;
/* If param->b_annexb is set, Annex-B bytestream with startcode.
* Otherwise, startcode is replaced with a 4-byte size.
* This size is the size used in mp4/similar muxing; it is equal to i_payload-4 */
uint8_t *p_payload;
} x264_nal_t;
/****************************************************************************
* Encoder parameters
****************************************************************************/
/* CPU flags
*/
#define X264_CPU_CACHELINE_32 0x0000001 /* avoid memory loads that span the border between two cachelines */
#define X264_CPU_CACHELINE_64 0x0000002 /* 32/64 is the size of a cacheline in bytes */
#define X264_CPU_ALTIVEC 0x0000004
#define X264_CPU_MMX 0x0000008
#define X264_CPU_MMX2 0x0000010 /* MMX2 aka MMXEXT aka ISSE */
#define X264_CPU_MMXEXT X264_CPU_MMX2
#define X264_CPU_SSE 0x0000020
#define X264_CPU_SSE2 0x0000040
#define X264_CPU_SSE2_IS_SLOW 0x0000080 /* avoid most SSE2 functions on Athlon64 */
#define X264_CPU_SSE2_IS_FAST 0x0000100 /* a few functions are only faster on Core2 and Phenom */
#define X264_CPU_SSE3 0x0000200
#define X264_CPU_SSSE3 0x0000400
#define X264_CPU_SHUFFLE_IS_FAST 0x0000800 /* Penryn, Nehalem, and Phenom have fast shuffle units */
#define X264_CPU_STACK_MOD4 0x0001000 /* if stack is only mod4 and not mod16 */
#define X264_CPU_SSE4 0x0002000 /* SSE4.1 */
#define X264_CPU_SSE42 0x0004000 /* SSE4.2 */
#define X264_CPU_SSE_MISALIGN 0x0008000 /* Phenom support for misaligned SSE instruction arguments */
#define X264_CPU_LZCNT 0x0010000 /* Phenom support for "leading zero count" instruction. */
#define X264_CPU_ARMV6 0x0020000
#define X264_CPU_NEON 0x0040000 /* ARM NEON */
#define X264_CPU_FAST_NEON_MRC 0x0080000 /* Transfer from NEON to ARM register is fast (Cortex-A9) */
#define X264_CPU_SLOW_CTZ 0x0100000 /* BSR/BSF x86 instructions are really slow on some CPUs */
#define X264_CPU_SLOW_ATOM 0x0200000 /* The Atom just sucks */
#define X264_CPU_AVX 0x0400000 /* AVX support: requires OS support even if YMM registers
* aren't used. */
#define X264_CPU_XOP 0x0800000 /* AMD XOP */
#define X264_CPU_FMA4 0x1000000 /* AMD FMA4 */
/* Analyse flags
*/
#define X264_ANALYSE_I4x4 0x0001 /* Analyse i4x4 */
#define X264_ANALYSE_I8x8 0x0002 /* Analyse i8x8 (requires 8x8 transform) */
#define X264_ANALYSE_PSUB16x16 0x0010 /* Analyse p16x8, p8x16 and p8x8 */
#define X264_ANALYSE_PSUB8x8 0x0020 /* Analyse p8x4, p4x8, p4x4 */
#define X264_ANALYSE_BSUB16x16 0x0100 /* Analyse b16x8, b8x16 and b8x8 */
#define X264_DIRECT_PRED_NONE 0
#define X264_DIRECT_PRED_SPATIAL 1
#define X264_DIRECT_PRED_TEMPORAL 2
#define X264_DIRECT_PRED_AUTO 3
#define X264_ME_DIA 0
#define X264_ME_HEX 1
#define X264_ME_UMH 2
#define X264_ME_ESA 3
#define X264_ME_TESA 4
#define X264_CQM_FLAT 0
#define X264_CQM_JVT 1
#define X264_CQM_CUSTOM 2
#define X264_RC_CQP 0
#define X264_RC_CRF 1
#define X264_RC_ABR 2
#define X264_QP_AUTO 0
#define X264_AQ_NONE 0
#define X264_AQ_VARIANCE 1
#define X264_AQ_AUTOVARIANCE 2
#define X264_B_ADAPT_NONE 0
#define X264_B_ADAPT_FAST 1
#define X264_B_ADAPT_TRELLIS 2
#define X264_WEIGHTP_NONE 0
#define X264_WEIGHTP_SIMPLE 1
#define X264_WEIGHTP_SMART 2
#define X264_B_PYRAMID_NONE 0
#define X264_B_PYRAMID_STRICT 1
#define X264_B_PYRAMID_NORMAL 2
#define X264_KEYINT_MIN_AUTO 0
#define X264_KEYINT_MAX_INFINITE (1<<30)
static const char * const x264_direct_pred_names[] = { "none", "spatial", "temporal", "auto", 0 };
static const char * const x264_motion_est_names[] = { "dia", "hex", "umh", "esa", "tesa", 0 };
static const char * const x264_b_pyramid_names[] = { "none", "strict", "normal", 0 };
static const char * const x264_overscan_names[] = { "undef", "show", "crop", 0 };
static const char * const x264_vidformat_names[] = { "component", "pal", "ntsc", "secam", "mac", "undef", 0 };
static const char * const x264_fullrange_names[] = { "off", "on", 0 };
static const char * const x264_colorprim_names[] = { "", "bt709", "undef", "", "bt470m", "bt470bg", "smpte170m", "smpte240m", "film", 0 };
static const char * const x264_transfer_names[] = { "", "bt709", "undef", "", "bt470m", "bt470bg", "smpte170m", "smpte240m", "linear", "log100", "log316", 0 };
static const char * const x264_colmatrix_names[] = { "GBR", "bt709", "undef", "", "fcc", "bt470bg", "smpte170m", "smpte240m", "YCgCo", 0 };
static const char * const x264_nal_hrd_names[] = { "none", "vbr", "cbr", 0 };
/* Colorspace type */
#define X264_CSP_MASK 0x00ff /* */
#define X264_CSP_NONE 0x0000 /* Invalid mode */
#define X264_CSP_I420 0x0001 /* yuv 4:2:0 planar */
#define X264_CSP_YV12 0x0002 /* yvu 4:2:0 planar */
#define X264_CSP_NV12 0x0003 /* yuv 4:2:0, with one y plane and one packed u+v */
#define X264_CSP_I422 0x0004 /* yuv 4:2:2 planar */
#define X264_CSP_YV16 0x0005 /* yvu 4:2:2 planar */
#define X264_CSP_NV16 0x0006 /* yuv 4:2:2, with one y plane and one packed u+v */
#define X264_CSP_I444 0x0007 /* yuv 4:4:4 planar */
#define X264_CSP_YV24 0x0008 /* yvu 4:4:4 planar */
#define X264_CSP_BGR 0x0009 /* packed bgr 24bits */
#define X264_CSP_BGRA 0x000a /* packed bgr 32bits */
#define X264_CSP_RGB 0x000b /* packed rgb 24bits */
#define X264_CSP_MAX 0x000c /* end of list */
#define X264_CSP_VFLIP 0x1000 /* the csp is vertically flipped */
#define X264_CSP_HIGH_DEPTH 0x2000 /* the csp has a depth of 16 bits per pixel component */
/* Slice type */
#define X264_TYPE_AUTO 0x0000 /* Let x264 choose the right type */
#define X264_TYPE_IDR 0x0001
#define X264_TYPE_I 0x0002
#define X264_TYPE_P 0x0003
#define X264_TYPE_BREF 0x0004 /* Non-disposable B-frame */
#define X264_TYPE_B 0x0005
#define X264_TYPE_KEYFRAME 0x0006 /* IDR or I depending on b_open_gop option */
#define IS_X264_TYPE_I(x) ((x)==X264_TYPE_I || (x)==X264_TYPE_IDR)
#define IS_X264_TYPE_B(x) ((x)==X264_TYPE_B || (x)==X264_TYPE_BREF)
/* Log level */
#define X264_LOG_NONE (-1)
#define X264_LOG_ERROR 0
#define X264_LOG_WARNING 1
#define X264_LOG_INFO 2
#define X264_LOG_DEBUG 3
/* Threading */
#define X264_THREADS_AUTO 0 /* Automatically select optimal number of threads */
#define X264_SYNC_LOOKAHEAD_AUTO (-1) /* Automatically select optimal lookahead thread buffer size */
/* HRD */
#define X264_NAL_HRD_NONE 0
#define X264_NAL_HRD_VBR 1
#define X264_NAL_HRD_CBR 2
/* Zones: override ratecontrol or other options for specific sections of the video.
* See x264_encoder_reconfig() for which options can be changed.
* If zones overlap, whichever comes later in the list takes precedence. */
typedef struct
{
int i_start, i_end; /* range of frame numbers */
int b_force_qp; /* whether to use qp vs bitrate factor */
int i_qp;
float f_bitrate_factor;
struct x264_param_t *param;
} x264_zone_t;
typedef struct x264_param_t
{
/* CPU flags */
unsigned int cpu;
int i_threads; /* encode multiple frames in parallel */
int b_sliced_threads; /* Whether to use slice-based threading. */
int b_deterministic; /* whether to allow non-deterministic optimizations when threaded */
int b_cpu_independent; /* force canonical behavior rather than cpu-dependent optimal algorithms */
int i_sync_lookahead; /* threaded lookahead buffer */
/* Video Properties */
int i_width;
int i_height;
int i_csp; /* CSP of encoded bitstream */
int i_level_idc;
int i_frame_total; /* number of frames to encode if known, else 0 */
/* NAL HRD
* Uses Buffering and Picture Timing SEIs to signal HRD
* The HRD in H.264 was not designed with VFR in mind.
* It is therefore not recommendeded to use NAL HRD with VFR.
* Furthermore, reconfiguring the VBV (via x264_encoder_reconfig)
* will currently generate invalid HRD. */
int i_nal_hrd;
struct
{
/* they will be reduced to be 0 < x <= 65535 and prime */
int i_sar_height;
int i_sar_width;
int i_overscan; /* 0=undef, 1=no overscan, 2=overscan */
/* see h264 annex E for the values of the following */
int i_vidformat;
int b_fullrange;
int i_colorprim;
int i_transfer;
int i_colmatrix;
int i_chroma_loc; /* both top & bottom */
} vui;
/* Bitstream parameters */
int i_frame_reference; /* Maximum number of reference frames */
int i_dpb_size; /* Force a DPB size larger than that implied by B-frames and reference frames.
* Useful in combination with interactive error resilience. */
int i_keyint_max; /* Force an IDR keyframe at this interval */
int i_keyint_min; /* Scenecuts closer together than this are coded as I, not IDR. */
int i_scenecut_threshold; /* how aggressively to insert extra I frames */
int b_intra_refresh; /* Whether or not to use periodic intra refresh instead of IDR frames. */
int i_bframe; /* how many b-frame between 2 references pictures */
int i_bframe_adaptive;
int i_bframe_bias;
int i_bframe_pyramid; /* Keep some B-frames as references: 0=off, 1=strict hierarchical, 2=normal */
int b_open_gop;
int b_bluray_compat;
int b_deblocking_filter;
int i_deblocking_filter_alphac0; /* [-6, 6] -6 light filter, 6 strong */
int i_deblocking_filter_beta; /* [-6, 6] idem */
int b_cabac;
int i_cabac_init_idc;
int b_interlaced;
int b_constrained_intra;
int i_cqm_preset;
char *psz_cqm_file; /* JM format */
uint8_t cqm_4iy[16]; /* used only if i_cqm_preset == X264_CQM_CUSTOM */
uint8_t cqm_4py[16];
uint8_t cqm_4ic[16];
uint8_t cqm_4pc[16];
uint8_t cqm_8iy[64];
uint8_t cqm_8py[64];
uint8_t cqm_8ic[64];
uint8_t cqm_8pc[64];
/* Log */
void (*pf_log)( void *, int i_level, const char *psz, va_list );
void *p_log_private;
int i_log_level;
int b_visualize;
char *psz_dump_yuv; /* filename for reconstructed frames */
/* Encoder analyser parameters */
struct
{
unsigned int intra; /* intra partitions */
unsigned int inter; /* inter partitions */
int b_transform_8x8;
int i_weighted_pred; /* weighting for P-frames */
int b_weighted_bipred; /* implicit weighting for B-frames */
int i_direct_mv_pred; /* spatial vs temporal mv prediction */
int i_chroma_qp_offset;
int i_me_method; /* motion estimation algorithm to use (X264_ME_*) */
int i_me_range; /* integer pixel motion estimation search range (from predicted mv) */
int i_mv_range; /* maximum length of a mv (in pixels). -1 = auto, based on level */
int i_mv_range_thread; /* minimum space between threads. -1 = auto, based on number of threads. */
int i_subpel_refine; /* subpixel motion estimation quality */
int b_chroma_me; /* chroma ME for subpel and mode decision in P-frames */
int b_mixed_references; /* allow each mb partition to have its own reference number */
int i_trellis; /* trellis RD quantization */
int b_fast_pskip; /* early SKIP detection on P-frames */
int b_dct_decimate; /* transform coefficient thresholding on P-frames */
int i_noise_reduction; /* adaptive pseudo-deadzone */
float f_psy_rd; /* Psy RD strength */
float f_psy_trellis; /* Psy trellis strength */
int b_psy; /* Toggle all psy optimizations */
/* the deadzone size that will be used in luma quantization */
int i_luma_deadzone[2]; /* {inter, intra} */
int b_psnr; /* compute and print PSNR stats */
int b_ssim; /* compute and print SSIM stats */
} analyse;
/* Rate control parameters */
struct
{
int i_rc_method; /* X264_RC_* */
int i_qp_constant; /* 0 to (51 + 6*(x264_bit_depth-8)). 0=lossless */
int i_qp_min; /* min allowed QP value */
int i_qp_max; /* max allowed QP value */
int i_qp_step; /* max QP step between frames */
int i_bitrate;
float f_rf_constant; /* 1pass VBR, nominal QP */
float f_rf_constant_max; /* In CRF mode, maximum CRF as caused by VBV */
float f_rate_tolerance;
int i_vbv_max_bitrate;
int i_vbv_buffer_size;
float f_vbv_buffer_init; /* <=1: fraction of buffer_size. >1: kbit */
float f_ip_factor;
float f_pb_factor;
int i_aq_mode; /* psy adaptive QP. (X264_AQ_*) */
float f_aq_strength;
int b_mb_tree; /* Macroblock-tree ratecontrol. */
int i_lookahead;
/* 2pass */
int b_stat_write; /* Enable stat writing in psz_stat_out */
char *psz_stat_out;
int b_stat_read; /* Read stat from psz_stat_in and use it */
char *psz_stat_in;
/* 2pass params (same as ffmpeg ones) */
float f_qcompress; /* 0.0 => cbr, 1.0 => constant qp */
float f_qblur; /* temporally blur quants */
float f_complexity_blur; /* temporally blur complexity */
x264_zone_t *zones; /* ratecontrol overrides */
int i_zones; /* number of zone_t's */
char *psz_zones; /* alternate method of specifying zones */
} rc;
/* Cropping Rectangle parameters: added to those implicitly defined by
non-mod16 video resolutions. */
struct
{
unsigned int i_left;
unsigned int i_top;
unsigned int i_right;
unsigned int i_bottom;
} crop_rect;
/* frame packing arrangement flag */
int i_frame_packing;
/* Muxing parameters */
int b_aud; /* generate access unit delimiters */
int b_repeat_headers; /* put SPS/PPS before each keyframe */
int b_annexb; /* if set, place start codes (4 bytes) before NAL units,
* otherwise place size (4 bytes) before NAL units. */
int i_sps_id; /* SPS and PPS id number */
int b_vfr_input; /* VFR input. If 1, use timebase and timestamps for ratecontrol purposes.
* If 0, use fps only. */
int b_pulldown; /* use explicity set timebase for CFR */
uint32_t i_fps_num;
uint32_t i_fps_den;
uint32_t i_timebase_num; /* Timebase numerator */
uint32_t i_timebase_den; /* Timebase denominator */
int b_tff;
/* Pulldown:
* The correct pic_struct must be passed with each input frame.
* The input timebase should be the timebase corresponding to the output framerate. This should be constant.
* e.g. for 3:2 pulldown timebase should be 1001/30000
* The PTS passed with each frame must be the PTS of the frame after pulldown is applied.
* Frame doubling and tripling require b_vfr_input set to zero (see H.264 Table D-1)
*
* Pulldown changes are not clearly defined in H.264. Therefore, it is the calling app's responsibility to manage this.
*/
int b_pic_struct;
/* Fake Interlaced.
*
* Used only when b_interlaced=0. Setting this flag makes it possible to flag the stream as PAFF interlaced yet
* encode all frames progessively. It is useful for encoding 25p and 30p Blu-Ray streams.
*/
int b_fake_interlaced;
/* Slicing parameters */
int i_slice_max_size; /* Max size per slice in bytes; includes estimated NAL overhead. */
int i_slice_max_mbs; /* Max number of MBs per slice; overrides i_slice_count. */
int i_slice_count; /* Number of slices per frame: forces rectangular slices. */
/* Optional callback for freeing this x264_param_t when it is done being used.
* Only used when the x264_param_t sits in memory for an indefinite period of time,
* i.e. when an x264_param_t is passed to x264_t in an x264_picture_t or in zones.
* Not used when x264_encoder_reconfig is called directly. */
void (*param_free)( void* );
/* Optional low-level callback for low-latency encoding. Called for each output NAL unit
* immediately after the NAL unit is finished encoding. This allows the calling application
* to begin processing video data (e.g. by sending packets over a network) before the frame
* is done encoding.
*
* This callback MUST do the following in order to work correctly:
* 1) Have available an output buffer of at least size nal->i_payload*3/2 + 5 + 16.
* 2) Call x264_nal_encode( h, dst, nal ), where dst is the output buffer.
* After these steps, the content of nal is valid and can be used in the same way as if
* the NAL unit were output by x264_encoder_encode.
*
* This does not need to be synchronous with the encoding process: the data pointed to
* by nal (both before and after x264_nal_encode) will remain valid until the next
* x264_encoder_encode call. The callback must be re-entrant.
*
* This callback does not work with frame-based threads; threads must be disabled
* or sliced-threads enabled. This callback also does not work as one would expect
* with HRD -- since the buffering period SEI cannot be calculated until the frame
* is finished encoding, it will not be sent via this callback.
*
* Note also that the NALs are not necessarily returned in order when sliced threads is
* enabled. Accordingly, the variable i_first_mb and i_last_mb are available in
* x264_nal_t to help the calling application reorder the slices if necessary.
*
* When this callback is enabled, x264_encoder_encode does not return valid NALs;
* the calling application is expected to acquire all output NALs through the callback.
*
* It is generally sensible to combine this callback with a use of slice-max-mbs or
* slice-max-size. */
void (*nalu_process) ( x264_t *h, x264_nal_t *nal );
} x264_param_t;
void x264_nal_encode( x264_t *h, uint8_t *dst, x264_nal_t *nal );
/****************************************************************************
* H.264 level restriction information
****************************************************************************/
typedef struct
{
int level_idc;
int mbps; /* max macroblock processing rate (macroblocks/sec) */
int frame_size; /* max frame size (macroblocks) */
int dpb; /* max decoded picture buffer (bytes) */
int bitrate; /* max bitrate (kbit/sec) */
int cpb; /* max vbv buffer (kbit) */
int mv_range; /* max vertical mv component range (pixels) */
int mvs_per_2mb; /* max mvs per 2 consecutive mbs. */
int slice_rate; /* ?? */
int mincr; /* min compression ratio */
int bipred8x8; /* limit bipred to >=8x8 */
int direct8x8; /* limit b_direct to >=8x8 */
int frame_only; /* forbid interlacing */
} x264_level_t;
/* all of the levels defined in the standard, terminated by .level_idc=0 */
extern const x264_level_t x264_levels[];
/****************************************************************************
* Basic parameter handling functions
****************************************************************************/
/* x264_param_default:
* fill x264_param_t with default values and do CPU detection */
void x264_param_default( x264_param_t * );
/* x264_param_parse:
* set one parameter by name.
* returns 0 on success, or returns one of the following errors.
* note: BAD_VALUE occurs only if it can't even parse the value,
* numerical range is not checked until x264_encoder_open() or
* x264_encoder_reconfig().
* value=NULL means "true" for boolean options, but is a BAD_VALUE for non-booleans. */
#define X264_PARAM_BAD_NAME (-1)
#define X264_PARAM_BAD_VALUE (-2)
int x264_param_parse( x264_param_t *, const char *name, const char *value );
/****************************************************************************
* Advanced parameter handling functions
****************************************************************************/
/* These functions expose the full power of x264's preset-tune-profile system for
* easy adjustment of large numbers of internal parameters.
*
* In order to replicate x264CLI's option handling, these functions MUST be called
* in the following order:
* 1) x264_param_default_preset
* 2) Custom user options (via param_parse or directly assigned variables)
* 3) x264_param_apply_fastfirstpass
* 4) x264_param_apply_profile
*
* Additionally, x264CLI does not apply step 3 if the preset chosen is "placebo"
* or --slow-firstpass is set. */
/* x264_param_default_preset:
* The same as x264_param_default, but also use the passed preset and tune
* to modify the default settings.
* (either can be NULL, which implies no preset or no tune, respectively)
*
* Currently available presets are, ordered from fastest to slowest: */
static const char * const x264_preset_names[] = { "ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow", "placebo", 0 };
/* The presets can also be indexed numerically, as in:
* x264_param_default_preset( ¶m, "3", ... )
* with ultrafast mapping to "0" and placebo mapping to "9". This mapping may
* of course change if new presets are added in between, but will always be
* ordered from fastest to slowest.
*
* Warning: the speed of these presets scales dramatically. Ultrafast is a full
* 100 times faster than placebo!
*
* Currently available tunings are: */
static const char * const x264_tune_names[] = { "film", "animation", "grain", "stillimage", "psnr", "ssim", "fastdecode", "zerolatency", 0 };
/* Multiple tunings can be used if separated by a delimiter in ",./-+",
* however multiple psy tunings cannot be used.
* film, animation, grain, stillimage, psnr, and ssim are psy tunings.
*
* returns 0 on success, negative on failure (e.g. invalid preset/tune name). */
int x264_param_default_preset( x264_param_t *, const char *preset, const char *tune );
/* x264_param_apply_fastfirstpass:
* If first-pass mode is set (rc.b_stat_read == 0, rc.b_stat_write == 1),
* modify the encoder settings to disable options generally not useful on
* the first pass. */
void x264_param_apply_fastfirstpass( x264_param_t * );
/* x264_param_apply_profile:
* Applies the restrictions of the given profile.
* Currently available profiles are, from most to least restrictive: */
static const char * const x264_profile_names[] = { "baseline", "main", "high", "high10", "high422", "high444", 0 };
/* (can be NULL, in which case the function will do nothing)
*
* Does NOT guarantee that the given profile will be used: if the restrictions
* of "High" are applied to settings that are already Baseline-compatible, the
* stream will remain baseline. In short, it does not increase settings, only
* decrease them.
*
* returns 0 on success, negative on failure (e.g. invalid profile name). */
int x264_param_apply_profile( x264_param_t *, const char *profile );
/****************************************************************************
* Picture structures and functions
****************************************************************************/
/* x264_bit_depth:
* Specifies the number of bits per pixel that x264 uses. This is also the
* bit depth that x264 encodes in. If this value is > 8, x264 will read
* two bytes of input data for each pixel sample, and expect the upper
* (16-x264_bit_depth) bits to be zero.
* Note: The flag X264_CSP_HIGH_DEPTH must be used to specify the
* colorspace depth as well. */
extern const int x264_bit_depth;
/* x264_chroma_format:
* Specifies the chroma formats that x264 supports encoding. When this
* value is non-zero, then it represents a X264_CSP_* that is the only
* chroma format that x264 supports encoding. If the value is 0 then
* there are no restrictions. */
extern const int x264_chroma_format;
enum pic_struct_e
{
PIC_STRUCT_AUTO = 0, // automatically decide (default)
PIC_STRUCT_PROGRESSIVE = 1, // progressive frame
// "TOP" and "BOTTOM" are not supported in x264 (PAFF only)
PIC_STRUCT_TOP_BOTTOM = 4, // top field followed by bottom
PIC_STRUCT_BOTTOM_TOP = 5, // bottom field followed by top
PIC_STRUCT_TOP_BOTTOM_TOP = 6, // top field, bottom field, top field repeated
PIC_STRUCT_BOTTOM_TOP_BOTTOM = 7, // bottom field, top field, bottom field repeated
PIC_STRUCT_DOUBLE = 8, // double frame
PIC_STRUCT_TRIPLE = 9, // triple frame
};
typedef struct
{
double cpb_initial_arrival_time;
double cpb_final_arrival_time;
double cpb_removal_time;
double dpb_output_time;
} x264_hrd_t;
/* Arbitrary user SEI:
* Payload size is in bytes and the payload pointer must be valid.
* Payload types and syntax can be found in Annex D of the H.264 Specification.
* SEI payload alignment bits as described in Annex D must be included at the
* end of the payload if needed.
* The payload should not be NAL-encapsulated.
* Payloads are written first in order of input, apart from in the case when HRD
* is enabled where payloads are written after the Buffering Period SEI. */
typedef struct
{
int payload_size;
int payload_type;
uint8_t *payload;
} x264_sei_payload_t;
typedef struct
{
int num_payloads;
x264_sei_payload_t *payloads;
/* In: optional callback to free each payload AND x264_sei_payload_t when used. */
void (*sei_free)( void* );
} x264_sei_t;
typedef struct
{
int i_csp; /* Colorspace */
int i_plane; /* Number of image planes */
int i_stride[4]; /* Strides for each plane */
uint8_t *plane[4]; /* Pointers to each plane */
} x264_image_t;
typedef struct
{
/* In: an array of quantizer offsets to be applied to this image during encoding.
* These are added on top of the decisions made by x264.
* Offsets can be fractional; they are added before QPs are rounded to integer.
* Adaptive quantization must be enabled to use this feature. Behavior if quant
* offsets differ between encoding passes is undefined.
*
* Array contains one offset per macroblock, in raster scan order. In interlaced
* mode, top-field MBs and bottom-field MBs are interleaved at the row level. */
float *quant_offsets;
/* In: optional callback to free quant_offsets when used.
* Useful if one wants to use a different quant_offset array for each frame. */
void (*quant_offsets_free)( void* );
} x264_image_properties_t;
typedef struct
{
/* In: force picture type (if not auto)
* If x264 encoding parameters are violated in the forcing of picture types,
* x264 will correct the input picture type and log a warning.
* The quality of frametype decisions may suffer if a great deal of fine-grained
* mixing of auto and forced frametypes is done.
* Out: type of the picture encoded */
int i_type;
/* In: force quantizer for != X264_QP_AUTO */
int i_qpplus1;
/* In: pic_struct, for pulldown/doubling/etc...used only if b_pic_struct=1.
* use pic_struct_e for pic_struct inputs
* Out: pic_struct element associated with frame */
int i_pic_struct;
/* Out: whether this frame is a keyframe. Important when using modes that result in
* SEI recovery points being used instead of IDR frames. */
int b_keyframe;
/* In: user pts, Out: pts of encoded picture (user)*/
int64_t i_pts;
/* Out: frame dts. When the pts of the first frame is close to zero,
* initial frames may have a negative dts which must be dealt with by any muxer */
int64_t i_dts;
/* In: custom encoding parameters to be set from this frame forwards
(in coded order, not display order). If NULL, continue using
parameters from the previous frame. Some parameters, such as
aspect ratio, can only be changed per-GOP due to the limitations
of H.264 itself; in this case, the caller must force an IDR frame
if it needs the changed parameter to apply immediately. */
x264_param_t *param;
/* In: raw data */
x264_image_t img;
/* In: optional information to modify encoder decisions for this frame */
x264_image_properties_t prop;
/* Out: HRD timing information. Output only when i_nal_hrd is set. */
x264_hrd_t hrd_timing;
/* In: arbitrary user SEI (e.g subtitles, AFDs) */
x264_sei_t extra_sei;
/* private user data. copied from input to output frames. */
void *opaque;
} x264_picture_t;
/* x264_picture_init:
* initialize an x264_picture_t. Needs to be done if the calling application
* allocates its own x264_picture_t as opposed to using x264_picture_alloc. */
void x264_picture_init( x264_picture_t *pic );
/* x264_picture_alloc:
* alloc data for a picture. You must call x264_picture_clean on it.
* returns 0 on success, or -1 on malloc failure or invalid colorspace. */
int x264_picture_alloc( x264_picture_t *pic, int i_csp, int i_width, int i_height );
/* x264_picture_clean:
* free associated resource for a x264_picture_t allocated with
* x264_picture_alloc ONLY */
void x264_picture_clean( x264_picture_t *pic );
/****************************************************************************
* Encoder functions
****************************************************************************/
/* Force a link error in the case of linking against an incompatible API version.
* Glue #defines exist to force correct macro expansion; the final output of the macro
* is x264_encoder_open_##X264_BUILD (for purposes of dlopen). */
#define x264_encoder_glue1(x,y) x##y
#define x264_encoder_glue2(x,y) x264_encoder_glue1(x,y)
#define x264_encoder_open x264_encoder_glue2(x264_encoder_open_,X264_BUILD)
/* x264_encoder_open:
* create a new encoder handler, all parameters from x264_param_t are copied */
x264_t *x264_encoder_open( x264_param_t * );
/* x264_encoder_reconfig:
* various parameters from x264_param_t are copied.
* this takes effect immediately, on whichever frame is encoded next;
* due to delay, this may not be the next frame passed to encoder_encode.
* if the change should apply to some particular frame, use x264_picture_t->param instead.
* returns 0 on success, negative on parameter validation error.
* not all parameters can be changed; see the actual function for a detailed breakdown. */
int x264_encoder_reconfig( x264_t *, x264_param_t * );
/* x264_encoder_parameters:
* copies the current internal set of parameters to the pointer provided
* by the caller. useful when the calling application needs to know
* how x264_encoder_open has changed the parameters, or the current state
* of the encoder after multiple x264_encoder_reconfig calls.
* note that the data accessible through pointers in the returned param struct
* (e.g. filenames) should not be modified by the calling application. */
void x264_encoder_parameters( x264_t *, x264_param_t * );
/* x264_encoder_headers:
* return the SPS and PPS that will be used for the whole stream.
* *pi_nal is the number of NAL units outputted in pp_nal.
* returns negative on error.
* the payloads of all output NALs are guaranteed to be sequential in memory. */
int x264_encoder_headers( x264_t *, x264_nal_t **pp_nal, int *pi_nal );
/* x264_encoder_encode:
* encode one picture.
* *pi_nal is the number of NAL units outputted in pp_nal.
* returns negative on error, zero if no NAL units returned.
* the payloads of all output NALs are guaranteed to be sequential in memory. */
int x264_encoder_encode( x264_t *, x264_nal_t **pp_nal, int *pi_nal, x264_picture_t *pic_in, x264_picture_t *pic_out );
/* x264_encoder_close:
* close an encoder handler */
void x264_encoder_close ( x264_t * );
/* x264_encoder_delayed_frames:
* return the number of currently delayed (buffered) frames
* this should be used at the end of the stream, to know when you have all the encoded frames. */
int x264_encoder_delayed_frames( x264_t * );
/* x264_encoder_maximum_delayed_frames( x264_t *h ):
* return the maximum number of delayed (buffered) frames that can occur with the current
* parameters. */
int x264_encoder_maximum_delayed_frames( x264_t *h );
/* x264_encoder_intra_refresh:
* If an intra refresh is not in progress, begin one with the next P-frame.
* If an intra refresh is in progress, begin one as soon as the current one finishes.
* Requires that b_intra_refresh be set.
*
* Useful for interactive streaming where the client can tell the server that packet loss has
* occurred. In this case, keyint can be set to an extremely high value so that intra refreshes
* only occur when calling x264_encoder_intra_refresh.
*
* In multi-pass encoding, if x264_encoder_intra_refresh is called differently in each pass,
* behavior is undefined.
*
* Should not be called during an x264_encoder_encode. */
void x264_encoder_intra_refresh( x264_t * );
/* x264_encoder_invalidate_reference:
* An interactive error resilience tool, designed for use in a low-latency one-encoder-few-clients
* system. When the client has packet loss or otherwise incorrectly decodes a frame, the encoder
* can be told with this command to "forget" the frame and all frames that depend on it, referencing
* only frames that occurred before the loss. This will force a keyframe if no frames are left to
* reference after the aforementioned "forgetting".
*
* It is strongly recommended to use a large i_dpb_size in this case, which allows the encoder to
* keep around extra, older frames to fall back on in case more recent frames are all invalidated.
* Unlike increasing i_frame_reference, this does not increase the number of frames used for motion
* estimation and thus has no speed impact. It is also recommended to set a very large keyframe
* interval, so that keyframes are not used except as necessary for error recovery.
*
* x264_encoder_invalidate_reference is not currently compatible with the use of B-frames or intra
* refresh.
*
* In multi-pass encoding, if x264_encoder_invalidate_reference is called differently in each pass,
* behavior is undefined.
*
* Should not be called during an x264_encoder_encode, but multiple calls can be made simultaneously.
*
* Returns 0 on success, negative on failure. */
int x264_encoder_invalidate_reference( x264_t *, int64_t pts );
#endif
| {
"pile_set_name": "Github"
} |
2434 1565597543067 httpcache-v1
Method: POST
URL: https://www.notion.so/api/v3/getRecordValues
Body:+110
{
"requests": [
{
"id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"table": "block"
}
]
}
Response:+2234
{
"results": [
{
"role": "comment_only",
"value": {
"alive": true,
"content": [
"c0d858f0-bf20-4f09-aebb-6e3f1310aaab",
"0e6b0b29-4308-4f38-b2b9-a13a9987a0fd",
"2c8feff7-4552-4e34-9405-94c1ce46cb43",
"a39e1655-9d46-4c6e-82bc-cc3a90ba2d4b",
"dce2becc-8eb7-4c82-bdc6-f17a9bb4cea3",
"79698535-cbec-4a21-84d4-4de7a3485b60",
"1b56fd8a-884f-452b-8e8e-c5debe8d8a6f",
"9477937a-9f6d-4280-ad62-987c5a768ac5",
"84d73715-8a8d-4ff0-afa6-cd33b829d6ae",
"5960255a-4d18-4c85-9ff8-c11ffa74e984",
"f1e0553d-8b60-440a-ba1d-d656b7304bff",
"b3caf89b-e1c0-4546-b804-d8fc56d7bbf8",
"715ed3a1-3600-4496-8131-77d636cfaca4",
"5e1b7d34-1765-4334-a82a-f549152e3565",
"8fc80ad0-a95a-4aa7-b5d7-9f71160ffffb",
"173d6d7c-8f5e-4024-b54b-bf089666b2b8",
"4c9f4c7e-f1dc-4033-9204-3744ffe27da9",
"3b6ec011-7312-423e-acee-862f456dbdb4",
"ab5d7858-6e19-4012-abe6-03b5e2d7fa17",
"550d7df6-13b6-4419-b79c-bfc6bd77d259",
"fe518e87-33e8-48b4-a4bd-92b842b57643",
"edb81ef4-aee5-4e8e-94e8-86a27be46d6a",
"15dee0d7-40a5-44cc-9af1-8111d661c426",
"528de59c-aea4-4f5c-b767-820087c3a58b",
"1f05ac62-727d-4723-959d-90f62942d498",
"38ab70d2-0a65-4788-bebd-9126e9c6d9cb",
"eacca210-a6ca-46be-846b-11cd367d1b2e",
"8faa0434-8d2e-4126-a60e-73c67632ff9b"
],
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372177,
"format": {
"page_full_width": true,
"page_small_text": true
},
"id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372177,
"parent_id": "caabd093-67a6-454d-8e67-b40f2303905b",
"parent_table": "block",
"properties": {
"title": [
[
"this self and static plus the singleton"
]
]
},
"type": "page",
"version": 3
}
}
]
}
40275 1565597543072 httpcache-v1
Method: POST
URL: https://www.notion.so/api/v3/loadPageChunk
Body:+152
{
"chunkNumber": 0,
"cursor": {
"stack": []
},
"limit": 50,
"pageId": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"verticalColumns": false
}
Response:+40034
{
"cursor": {
"stack": []
},
"recordMap": {
"block": {
"0e6b0b29-4308-4f38-b2b9-a13a9987a0fd": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372173,
"id": "0e6b0b29-4308-4f38-b2b9-a13a9987a0fd",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372173,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"In the example below, "
],
[
"sayHello()",
[
[
"c"
]
]
],
[
" and "
],
[
"sayGoodbye()",
[
[
"c"
]
]
],
[
" are using "
],
[
"self",
[
[
"c"
]
]
],
[
" and "
],
[
"$this",
[
[
"c"
]
]
],
[
" difference can be observed here."
]
]
},
"type": "text",
"version": 1
}
},
"15dee0d7-40a5-44cc-9af1-8111d661c426": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372177,
"id": "15dee0d7-40a5-44cc-9af1-8111d661c426",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372177,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"As you can see in the example code we are defining a private static property "
],
[
"$instance",
[
[
"c"
]
]
],
[
" to hold the object reference. Since this is static this reference is shared across ALL objects of this type."
]
]
},
"type": "text",
"version": 1
}
},
"173d6d7c-8f5e-4024-b54b-bf089666b2b8": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372175,
"id": "173d6d7c-8f5e-4024-b54b-bf089666b2b8",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372175,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"unknown"
]
]
},
"type": "quote",
"version": 1
}
},
"1b56fd8a-884f-452b-8e8e-c5debe8d8a6f": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372174,
"id": "1b56fd8a-884f-452b-8e8e-c5debe8d8a6f",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372174,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"language": [
[
"Plain Text"
]
],
"title": [
[
"class Car {\n protected static $brand = 'unknown';\n \n public static function brand() {\n return self::$brand.\"\\n\";\n }\n}\n\nclass Mercedes extends Car {\n protected static $brand = 'Mercedes';\n}\n\nclass BMW extends Car {\n protected static $brand = 'BMW';\n}\n\necho (new Car)-\u003ebrand();\necho (new BMW)-\u003ebrand();\necho (new Mercedes)-\u003ebrand();"
]
]
},
"type": "code",
"version": 1
}
},
"1d91b89d-6726-4b97-91ac-d5c943835a80": {
"role": "comment_only",
"value": {
"alive": true,
"content": [
"c0d858f0-bf20-4f09-aebb-6e3f1310aaab",
"0e6b0b29-4308-4f38-b2b9-a13a9987a0fd",
"2c8feff7-4552-4e34-9405-94c1ce46cb43",
"a39e1655-9d46-4c6e-82bc-cc3a90ba2d4b",
"dce2becc-8eb7-4c82-bdc6-f17a9bb4cea3",
"79698535-cbec-4a21-84d4-4de7a3485b60",
"1b56fd8a-884f-452b-8e8e-c5debe8d8a6f",
"9477937a-9f6d-4280-ad62-987c5a768ac5",
"84d73715-8a8d-4ff0-afa6-cd33b829d6ae",
"5960255a-4d18-4c85-9ff8-c11ffa74e984",
"f1e0553d-8b60-440a-ba1d-d656b7304bff",
"b3caf89b-e1c0-4546-b804-d8fc56d7bbf8",
"715ed3a1-3600-4496-8131-77d636cfaca4",
"5e1b7d34-1765-4334-a82a-f549152e3565",
"8fc80ad0-a95a-4aa7-b5d7-9f71160ffffb",
"173d6d7c-8f5e-4024-b54b-bf089666b2b8",
"4c9f4c7e-f1dc-4033-9204-3744ffe27da9",
"3b6ec011-7312-423e-acee-862f456dbdb4",
"ab5d7858-6e19-4012-abe6-03b5e2d7fa17",
"550d7df6-13b6-4419-b79c-bfc6bd77d259",
"fe518e87-33e8-48b4-a4bd-92b842b57643",
"edb81ef4-aee5-4e8e-94e8-86a27be46d6a",
"15dee0d7-40a5-44cc-9af1-8111d661c426",
"528de59c-aea4-4f5c-b767-820087c3a58b",
"1f05ac62-727d-4723-959d-90f62942d498",
"38ab70d2-0a65-4788-bebd-9126e9c6d9cb",
"eacca210-a6ca-46be-846b-11cd367d1b2e",
"8faa0434-8d2e-4126-a60e-73c67632ff9b"
],
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372177,
"format": {
"page_full_width": true,
"page_small_text": true
},
"id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372177,
"parent_id": "caabd093-67a6-454d-8e67-b40f2303905b",
"parent_table": "block",
"properties": {
"title": [
[
"this self and static plus the singleton"
]
]
},
"type": "page",
"version": 3
}
},
"1f05ac62-727d-4723-959d-90f62942d498": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372177,
"id": "1f05ac62-727d-4723-959d-90f62942d498",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372177,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"We are also setting the constructor to be private to ensure that no one creates it with the "
],
[
"new",
[
[
"c"
]
]
],
[
" keyword from the outside. If you need to inherit from this class just change the "
],
[
"private",
[
[
"c"
]
]
],
[
" keywords to "
],
[
"protected",
[
[
"c"
]
]
],
[
"."
]
]
},
"type": "text",
"version": 1
}
},
"2c8feff7-4552-4e34-9405-94c1ce46cb43": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372174,
"id": "2c8feff7-4552-4e34-9405-94c1ce46cb43",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372174,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"language": [
[
"Plain Text"
]
],
"title": [
[
"class Person {\n private $name;\n\n public function __construct($name) {\n $this-\u003ename = $name;\n }\n\n public function getName() {\n return $this-\u003ename;\n }\n\n public function getTitle() {\n return $this-\u003egetName().\" the person\";\n }\n\n public function sayHello() {\n echo \"Hello, I'm \".$this-\u003egetTitle().\"\u003cbr/\u003e\";\n }\n\n public function sayGoodbye() {\n echo \"Goodbye from \".self::getTitle().\"\u003cbr/\u003e\";\n }\n}\n\nclass Geek extends Person {\n public function __construct($name) {\n parent::__construct($name);\n }\n\n public function getTitle() {\n return $this-\u003egetName().\" the geek\";\n }\n}\n\n$geekObj = new Geek(\"Ludwig\");\n$geekObj-\u003esayHello();\n$geekObj-\u003esayGoodbye();"
]
]
},
"type": "code",
"version": 1
}
},
"38ab70d2-0a65-4788-bebd-9126e9c6d9cb": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372177,
"id": "38ab70d2-0a65-4788-bebd-9126e9c6d9cb",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372177,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"To use this object you just write the following:"
]
]
},
"type": "text",
"version": 1
}
},
"3b6ec011-7312-423e-acee-862f456dbdb4": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372176,
"id": "3b6ec011-7312-423e-acee-862f456dbdb4",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372176,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"Mercedes"
]
]
},
"type": "text",
"version": 1
}
},
"4c9f4c7e-f1dc-4033-9204-3744ffe27da9": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372176,
"id": "4c9f4c7e-f1dc-4033-9204-3744ffe27da9",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372176,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"BMW"
]
]
},
"type": "text",
"version": 1
}
},
"528de59c-aea4-4f5c-b767-820087c3a58b": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372177,
"id": "528de59c-aea4-4f5c-b767-820087c3a58b",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372177,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"The "
],
[
"getInstance()",
[
[
"c"
]
]
],
[
"method uses a method know as lazy instantiation to delay creating the object to the last possible moment as you do not want to have unused objects lying around in memory never intended to be used. It also saves time and CPU on page load not having to load more objects than necessary. The method is checking if the object is set, creating it if not, and returning it. This ensures that only one object of this kind is ever created."
]
]
},
"type": "text",
"version": 1
}
},
"550d7df6-13b6-4419-b79c-bfc6bd77d259": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372176,
"id": "550d7df6-13b6-4419-b79c-bfc6bd77d259",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372176,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"The singleton"
]
]
},
"type": "sub_header",
"version": 1
}
},
"5960255a-4d18-4c85-9ff8-c11ffa74e984": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372175,
"id": "5960255a-4d18-4c85-9ff8-c11ffa74e984",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372175,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"unknown"
]
]
},
"type": "text",
"version": 1
}
},
"5e1b7d34-1765-4334-a82a-f549152e3565": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372175,
"id": "5e1b7d34-1765-4334-a82a-f549152e3565",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372175,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"language": [
[
"Plain Text"
]
],
"title": [
[
"class Car {\n protected static $brand = 'unknown';\n \n public static function brand() {\n return static::$brand.\"\\n\";\n }\n}\n\nclass Mercedes extends Car {\n protected static $brand = 'Mercedes';\n}\n\nclass BMW extends Car {\n protected static $brand = 'BMW';\n}\n\necho (new Car)-\u003ebrand();\necho (new BMW)-\u003ebrand();\necho (new Mercedes)-\u003ebrand();"
]
]
},
"type": "code",
"version": 1
}
},
"715ed3a1-3600-4496-8131-77d636cfaca4": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372175,
"id": "715ed3a1-3600-4496-8131-77d636cfaca4",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372175,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"To refer to the correct class, you need to use "
],
[
"static",
[
[
"c"
]
]
],
[
" instead:"
]
]
},
"type": "text",
"version": 1
}
},
"79698535-cbec-4a21-84d4-4de7a3485b60": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372174,
"id": "79698535-cbec-4a21-84d4-4de7a3485b60",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372174,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"Consider the following code:"
]
]
},
"type": "text",
"version": 1
}
},
"84d73715-8a8d-4ff0-afa6-cd33b829d6ae": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372174,
"id": "84d73715-8a8d-4ff0-afa6-cd33b829d6ae",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372174,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"unknown"
]
]
},
"type": "quote",
"version": 1
}
},
"8faa0434-8d2e-4126-a60e-73c67632ff9b": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372177,
"id": "8faa0434-8d2e-4126-a60e-73c67632ff9b",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372177,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"Now I DO implore you to use dependency injection where you can and aim for loosely coupled objects, but sometimes that is just not reasonable and the singleton pattern can be of use."
]
]
},
"type": "text",
"version": 1
}
},
"8fc80ad0-a95a-4aa7-b5d7-9f71160ffffb": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372175,
"id": "8fc80ad0-a95a-4aa7-b5d7-9f71160ffffb",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372175,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"This does produce the desired output:"
]
]
},
"type": "text",
"version": 1
}
},
"9477937a-9f6d-4280-ad62-987c5a768ac5": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372174,
"id": "9477937a-9f6d-4280-ad62-987c5a768ac5",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372174,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"This doesn’t produce the result you want:"
]
]
},
"type": "text",
"version": 1
}
},
"a39e1655-9d46-4c6e-82bc-cc3a90ba2d4b": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372174,
"id": "a39e1655-9d46-4c6e-82bc-cc3a90ba2d4b",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372174,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"type": "divider",
"version": 1
}
},
"ab5d7858-6e19-4012-abe6-03b5e2d7fa17": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372176,
"id": "ab5d7858-6e19-4012-abe6-03b5e2d7fa17",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372176,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"See also http://stackoverflow.com/documentation/php/504/classes-and-objects/5420/late-static-binding#t=201608122306182437362"
]
]
},
"type": "text",
"version": 1
}
},
"b3caf89b-e1c0-4546-b804-d8fc56d7bbf8": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372175,
"id": "b3caf89b-e1c0-4546-b804-d8fc56d7bbf8",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372175,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"That’s because "
],
[
"self",
[
[
"c"
]
]
],
[
" refers to the "
],
[
"Car",
[
[
"c"
]
]
],
[
" class whenever method "
],
[
"brand()",
[
[
"c"
]
]
],
[
" is called."
]
]
},
"type": "text",
"version": 1
}
},
"b64d2e8d-06e0-4dbe-a37e-6e7d0e06bb48": {
"role": "comment_only",
"value": {
"alive": true,
"content": [
"517c8074-a37c-44fd-8a9c-fb9f3eae1dcb",
"494832a4-8019-450b-b43e-04be9e23957c",
"eb584d64-0967-460c-a9f1-9d66ff8697ea",
"6427ea2b-9d2c-4408-a6ff-9721a6dc9cdc",
"78acf98d-751b-413c-b0ef-3d520c041518",
"feed5453-5dd0-4311-9546-05916acc717b",
"c21e2838-bb88-4a0b-8677-7fd7990427b3",
"388890af-6e2d-48b5-8627-8159740b2534",
"3df608de-d7c1-4570-8555-90ad35d2817a",
"dd3184e6-59de-418c-9116-ab565faa8a55",
"3f08c649-08b2-4a97-b43f-ac884356a505",
"caabd093-67a6-454d-8e67-b40f2303905b",
"1f2707b9-a751-475a-ba82-519f75e3c8bd",
"7ea927a4-8c64-45ba-9d71-d5d5796e1b71",
"5d759c32-1671-4b6c-9cc1-ad59c031c78c",
"d2ac9d43-0e3b-4077-a4f0-344ab77dce28",
"8e344e73-ab23-422f-9bc5-1b7a660edb69",
"a3705b2a-2c83-4e42-b51b-b58874cdba41",
"8b30ba45-a57e-44b5-b6c2-501af4626d35",
"6feefd3b-c9d8-4156-84d1-a7c4286028c7",
"7862f22e-1011-4a4b-8afd-26b9317e46e3",
"27de0930-be0d-4503-9a9b-05150c7d754e",
"fcd7e413-e4c3-42f0-b0c5-7a7685e669ee",
"37215ea5-9547-43fb-89a7-dc17d26d5671",
"10044815-3b9e-4513-8fa0-812a9957a6cc",
"73d52685-2f50-4a6a-b764-7a1742062923",
"2aee6dcb-0989-4be0-82bb-e36362381d91",
"a5af103b-d852-4d05-b5ed-007e9bc6dac6",
"0f9ca6e7-305f-414a-9ea4-796bcec6a74b",
"640a427d-f7cc-4181-99da-abc56c0ee5c7",
"6358c964-0c94-4f8a-a8f5-0b120eed603b",
"a2437364-c680-4790-94d6-bb7afe6bbac0",
"2a04f54f-cf44-4cd5-bb37-8dc6b9f2f1bd",
"98823712-1c98-4a43-8727-0a1d762add3b",
"d5ddf8b7-ebe7-43b3-ab49-22492b9f0565",
"80fa00b7-710d-4ce0-a406-927876f8600b",
"1f9d9197-defa-432c-bc3d-187124d72a2f",
"dac99271-1f4b-46ca-8985-d6ddd65e5190",
"8c42d3d9-a3bc-48da-bce0-bdcb3b7ce79c",
"b27336d9-e12f-4163-b64c-0f3bd43d13e4",
"ee791784-c85f-4e7b-a57d-79d4a1fcce89",
"ca285753-71c7-41a9-b880-7bf2da161416",
"75659e2f-e309-433d-9258-b76662aeb4fb",
"9507d5d1-9e19-423b-bb30-e7776757fd1a",
"c2cfe994-4a4e-42a5-a1f3-29b806f5c459",
"60c1d051-8c78-4c95-aa4e-d6680ae7e1ed",
"39389e18-4435-40d2-be30-84d806209e25",
"0eabffb2-1a8c-43e6-b5d0-24c02329f9d1",
"c09beb38-7179-42f3-a2d1-f4b433238aa0",
"e738bef3-04ad-47b8-abdb-d2ff70319024",
"20bc9dce-d534-40ff-a8c3-c05e75afd5f6",
"4bba2444-204c-4803-8e80-ee10663d08c2",
"0a6069ee-9200-41b9-b90f-af0e866b3798",
"8aad07a8-ece6-477b-8cf0-8ad575a906a8",
"f0aa9c04-6b09-48e8-9f6d-39195ed864c6",
"cfd0d40b-7b07-441c-bde3-a5be0d2be41b",
"d4c8c201-7f26-48eb-a78f-b18c68723b03",
"f49c9bfd-2029-4200-9a4b-8089d428dd89",
"0fddad86-8858-4ff5-84b9-18129c56229f",
"34fff563-be44-4c2d-9eb5-6171986332d6",
"6ba36b23-f2c3-4c8b-a9cc-1cf9cb37def5",
"0dddc90f-f179-4221-bf9c-4b41d349abb0",
"beea7707-e1f5-4975-b2c8-ded58a7e3771",
"98e7c9aa-afb7-47fa-8982-4cbc37642c6c",
"19d3a490-e861-442a-bbf8-30380bc306b7",
"d8cdf9b0-ae04-41c2-ba75-67fe799b9269",
"d5631366-098b-4c90-b10a-4c27cda07738",
"50dc657c-d5c2-4a7b-9bac-a72649a034bc",
"fd667c80-db70-416a-827b-b1c047fdcd5a",
"681c5601-034f-4549-9a89-5da2da43ed1e",
"7bb5ac60-6cd4-4c77-b217-3d3c51d66ecc",
"057eb94f-bb82-4152-b310-dbb929c85b35",
"5c659a09-6a5a-44b5-88cd-2ab2cf5e69de",
"7c52c9fa-ae12-4339-a606-1e3e64a5e440",
"cee10c4b-aca3-4ae1-bef8-0e0c7958d06b",
"8790e424-131f-482d-9f67-2821001d711f",
"e4e32393-007a-4cd6-b1f8-27b0cb8545c5",
"a7c4d158-bfc6-4651-b97b-cf5908cb435e",
"0933ee85-f73c-456d-a664-05037c9050a2",
"fdac48d7-3a67-46af-8280-cb49d3eb2900",
"1ee62efb-a132-4463-ad88-13047e39701a",
"3bb8f2d9-3a30-426a-90e4-c8d89d2b2785",
"e0331f63-7a2f-4805-a18a-faecbe9cbd66",
"3e614d87-5020-40dc-9e8e-4af5ace88042",
"68a6b5ab-d251-4ea1-82a1-afa23f2b4071",
"99767f42-6259-4914-8dc4-5d6b25fdc196",
"8d36e04e-03e7-4133-81d8-8932cbbd4bc0",
"f74395f5-0fb4-4a16-adfe-cd4f56f1c218",
"82837995-7012-4d5d-a90f-fdf5f95771a1",
"88347a4f-4632-4e18-a9bb-6ff61df8922d",
"bd21e71f-9d9e-48dc-be35-e136a9a8c144",
"742d5ccb-5b6b-4d47-bb6c-9800fd80a6d3",
"92dec6b9-c8e9-44be-866a-e1b7eb1d9074",
"b8e79283-d1b6-4848-b988-973df27cf924",
"a6892b0f-5fd3-4ff3-8ab1-0f05027fe043",
"310dc1a9-743f-4997-aa0b-041e5451e745",
"29536388-77ef-4997-9c01-5894e8dbf0b6",
"09eab12d-0e6a-4f5d-981a-e20def142720",
"7b8f9cbd-f897-407c-94d7-825654c81800",
"8f27b6c2-32e0-46fe-9052-1bece702489a",
"f2cbf97f-76bf-4894-b8a7-9b36dbdaa986",
"c2d0558a-e174-47cc-b309-c640ed3984b2",
"1765cb3f-cdf2-4b3e-941e-3d64128527a6",
"9272c5f6-725a-4a1d-9d6a-bcf68f821ab7",
"14002421-cb79-46f2-bd72-40d37b882ed2",
"24526f5c-fac3-443f-911e-e2c72b4c6749",
"3665ae32-4323-4b83-a8e7-dc3122f82218",
"a00936a6-0a0a-4bf3-9db5-563f85e34db0",
"6b2e4928-558c-43b9-8be4-fe720bf21677"
],
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022174667,
"format": {
"page_full_width": true,
"page_small_text": true
},
"id": "b64d2e8d-06e0-4dbe-a37e-6e7d0e06bb48",
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1553725920000,
"parent_id": "8be972f2-13d4-403a-b7f8-c74e60f7639f",
"parent_table": "block",
"permissions": [
{
"allow_search_engine_indexing": false,
"role": "comment_only",
"type": "public_permission"
}
],
"properties": {
"title": [
[
"Essential PHP"
]
]
},
"type": "page",
"version": 170
}
},
"c0d858f0-bf20-4f09-aebb-6e3f1310aaab": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372170,
"id": "c0d858f0-bf20-4f09-aebb-6e3f1310aaab",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372170,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"Use $this to refer to the current object. Use self to refer to the current class. In other words, use $this-\u003emember for non-static members, use self::$member for static members."
]
]
},
"type": "quote",
"version": 1
}
},
"caabd093-67a6-454d-8e67-b40f2303905b": {
"role": "comment_only",
"value": {
"alive": true,
"content": [
"adffd25f-5a9b-44a8-913c-de7bafade0f0",
"f09dfbd5-1304-440b-9348-189eae189376",
"06807e7e-2dbb-4bf3-b6f4-58072a6e5092",
"b1864cfa-b2e4-4763-a818-d7b2c818bb3d",
"282fc71a-fbf4-4f78-ad0c-11d45d0137cd",
"a46b474a-1161-445b-ba3d-a237b46a601c",
"7132ecbc-9c1c-4fe1-b6c9-4b85824ac246",
"0e25c2f1-3d3c-441c-aed2-5a6be7eea34e",
"fd6f618e-f51e-42a6-81a8-bc04b21f1b4a",
"e18e6bc2-4977-4dcc-a6a1-ec7fbd8e0544",
"9932c762-76be-46d2-8bd1-6c5c341a5370",
"abd588c9-6350-4c16-b7be-addbf1df8c28",
"1d91b89d-6726-4b97-91ac-d5c943835a80",
"d75fcc46-66dd-49a8-b175-71b6ba144f48",
"aaa58118-080d-4afd-9068-7b700c1451cd"
],
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022340000,
"format": {
"page_full_width": true,
"page_small_text": true
},
"id": "caabd093-67a6-454d-8e67-b40f2303905b",
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022520000,
"parent_id": "b64d2e8d-06e0-4dbe-a37e-6e7d0e06bb48",
"parent_table": "block",
"permissions": [
{
"role": "editor",
"type": "user_permission",
"user_id": "bb760e2d-d679-4b64-b2a9-03005b21870a"
}
],
"properties": {
"title": [
[
"Classes and objects"
]
]
},
"type": "page",
"version": 44
}
},
"dce2becc-8eb7-4c82-bdc6-f17a9bb4cea3": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372174,
"id": "dce2becc-8eb7-4c82-bdc6-f17a9bb4cea3",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372174,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"static",
[
[
"c"
]
]
],
[
" refers to whatever class in the hierarchy you called the method on. It allows for better reuse of static class properties when classes are inherited."
]
]
},
"type": "text",
"version": 1
}
},
"eacca210-a6ca-46be-846b-11cd367d1b2e": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372177,
"id": "eacca210-a6ca-46be-846b-11cd367d1b2e",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372177,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"language": [
[
"Plain Text"
]
],
"title": [
[
"$singleton = Singleton::getInstance();"
]
]
},
"type": "code",
"version": 1
}
},
"edb81ef4-aee5-4e8e-94e8-86a27be46d6a": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372176,
"id": "edb81ef4-aee5-4e8e-94e8-86a27be46d6a",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372176,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"language": [
[
"Plain Text"
]
],
"title": [
[
"class Singleton {\n private static $instance = null;\n\n public static function getInstance(){\n if(!isset(self::$instance)){\n self::$instance = new self();\n }\n \n return self::$instance;\n }\n \n private function __construct() {\n // Do constructor stuff\n }\n}"
]
]
},
"type": "code",
"version": 1
}
},
"f1e0553d-8b60-440a-ba1d-d656b7304bff": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372175,
"id": "f1e0553d-8b60-440a-ba1d-d656b7304bff",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372175,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"unknown"
]
]
},
"type": "text",
"version": 1
}
},
"fe518e87-33e8-48b4-a4bd-92b842b57643": {
"role": "comment_only",
"value": {
"alive": true,
"created_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"created_time": 1552022372176,
"id": "fe518e87-33e8-48b4-a4bd-92b842b57643",
"ignore_block_count": true,
"last_edited_by": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"last_edited_time": 1552022372176,
"parent_id": "1d91b89d-6726-4b97-91ac-d5c943835a80",
"parent_table": "block",
"properties": {
"title": [
[
"If you have an object that’s expensive to create or represents a connection to some external resource you want to reuse, i.e. a database connection where there is no connection pooling or a socket to some other system, you can use the "
],
[
"static",
[
[
"c"
]
]
],
[
" and "
],
[
"self",
[
[
"c"
]
]
],
[
" keywords in a class to make it a singleton. There are strong opinions about whether the singleton pattern should or should not be used, but it does have its uses."
]
]
},
"type": "text",
"version": 1
}
}
},
"notion_user": {
"bb760e2d-d679-4b64-b2a9-03005b21870a": {
"role": "reader",
"value": {
"clipper_onboarding_completed": true,
"email": "kkowalczyk@gmail.com",
"family_name": "Kowalczyk",
"given_name": "Krzysztof",
"id": "bb760e2d-d679-4b64-b2a9-03005b21870a",
"mobile_onboarding_completed": true,
"onboarding_completed": true,
"profile_photo": "https://s3-us-west-2.amazonaws.com/public.notion-static.com/2dcaa66c-7674-4ff6-9924-601785b63561/head-bw-640x960.png",
"version": 179
}
}
},
"space": {}
}
}
| {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: GPL-2.0
/*
* fs/partitions/amiga.c
*
* Code extracted from drivers/block/genhd.c
*
* Copyright (C) 1991-1998 Linus Torvalds
* Re-organised Feb 1998 Russell King
*/
#define pr_fmt(fmt) fmt
#include <linux/types.h>
#include <linux/affs_hardblocks.h>
#include "check.h"
#include "amiga.h"
static __inline__ u32
checksum_block(__be32 *m, int size)
{
u32 sum = 0;
while (size--)
sum += be32_to_cpu(*m++);
return sum;
}
int amiga_partition(struct parsed_partitions *state)
{
Sector sect;
unsigned char *data;
struct RigidDiskBlock *rdb;
struct PartitionBlock *pb;
int start_sect, nr_sects, blk, part, res = 0;
int blksize = 1; /* Multiplier for disk block size */
int slot = 1;
char b[BDEVNAME_SIZE];
for (blk = 0; ; blk++, put_dev_sector(sect)) {
if (blk == RDB_ALLOCATION_LIMIT)
goto rdb_done;
data = read_part_sector(state, blk, §);
if (!data) {
if (warn_no_part)
pr_err("Dev %s: unable to read RDB block %d\n",
bdevname(state->bdev, b), blk);
res = -1;
goto rdb_done;
}
if (*(__be32 *)data != cpu_to_be32(IDNAME_RIGIDDISK))
continue;
rdb = (struct RigidDiskBlock *)data;
if (checksum_block((__be32 *)data, be32_to_cpu(rdb->rdb_SummedLongs) & 0x7F) == 0)
break;
/* Try again with 0xdc..0xdf zeroed, Windows might have
* trashed it.
*/
*(__be32 *)(data+0xdc) = 0;
if (checksum_block((__be32 *)data,
be32_to_cpu(rdb->rdb_SummedLongs) & 0x7F)==0) {
pr_err("Trashed word at 0xd0 in block %d ignored in checksum calculation\n",
blk);
break;
}
pr_err("Dev %s: RDB in block %d has bad checksum\n",
bdevname(state->bdev, b), blk);
}
/* blksize is blocks per 512 byte standard block */
blksize = be32_to_cpu( rdb->rdb_BlockBytes ) / 512;
{
char tmp[7 + 10 + 1 + 1];
/* Be more informative */
snprintf(tmp, sizeof(tmp), " RDSK (%d)", blksize * 512);
strlcat(state->pp_buf, tmp, PAGE_SIZE);
}
blk = be32_to_cpu(rdb->rdb_PartitionList);
put_dev_sector(sect);
for (part = 1; blk>0 && part<=16; part++, put_dev_sector(sect)) {
blk *= blksize; /* Read in terms partition table understands */
data = read_part_sector(state, blk, §);
if (!data) {
if (warn_no_part)
pr_err("Dev %s: unable to read partition block %d\n",
bdevname(state->bdev, b), blk);
res = -1;
goto rdb_done;
}
pb = (struct PartitionBlock *)data;
blk = be32_to_cpu(pb->pb_Next);
if (pb->pb_ID != cpu_to_be32(IDNAME_PARTITION))
continue;
if (checksum_block((__be32 *)pb, be32_to_cpu(pb->pb_SummedLongs) & 0x7F) != 0 )
continue;
/* Tell Kernel about it */
nr_sects = (be32_to_cpu(pb->pb_Environment[10]) + 1 -
be32_to_cpu(pb->pb_Environment[9])) *
be32_to_cpu(pb->pb_Environment[3]) *
be32_to_cpu(pb->pb_Environment[5]) *
blksize;
if (!nr_sects)
continue;
start_sect = be32_to_cpu(pb->pb_Environment[9]) *
be32_to_cpu(pb->pb_Environment[3]) *
be32_to_cpu(pb->pb_Environment[5]) *
blksize;
put_partition(state,slot++,start_sect,nr_sects);
{
/* Be even more informative to aid mounting */
char dostype[4];
char tmp[42];
__be32 *dt = (__be32 *)dostype;
*dt = pb->pb_Environment[16];
if (dostype[3] < ' ')
snprintf(tmp, sizeof(tmp), " (%c%c%c^%c)",
dostype[0], dostype[1],
dostype[2], dostype[3] + '@' );
else
snprintf(tmp, sizeof(tmp), " (%c%c%c%c)",
dostype[0], dostype[1],
dostype[2], dostype[3]);
strlcat(state->pp_buf, tmp, PAGE_SIZE);
snprintf(tmp, sizeof(tmp), "(res %d spb %d)",
be32_to_cpu(pb->pb_Environment[6]),
be32_to_cpu(pb->pb_Environment[4]));
strlcat(state->pp_buf, tmp, PAGE_SIZE);
}
res = 1;
}
strlcat(state->pp_buf, "\n", PAGE_SIZE);
rdb_done:
return res;
}
| {
"pile_set_name": "Github"
} |
// RUN: %clang_cc1 -DSTDCPP11 -std=c++11 -verify -fsyntax-only %s
// RUN: %clang_cc1 -DSTDGNU11 -std=gnu++11 -verify -fsyntax-only %s
// RUN: %clang_cc1 -DSTDGNU11TRI -ftrigraphs -std=gnu++11 -verify -fsyntax-only %s
// RUN: %clang_cc1 -DSTDCPP17 -std=c++1z -verify -fsyntax-only %s
// RUN: %clang_cc1 -DSTDCPP17TRI -ftrigraphs -std=c++1z -verify -fsyntax-only %s
// RUN: %clang_cc1 -DMSCOMPAT -fms-compatibility -std=c++11 -verify -fsyntax-only %s
void foo() {
#if defined(NOFLAGS) || defined(STDCPP11) || defined(STDGNU11TRI) || \
defined(STDCPP17TRI)
const char c[] = "??/n"; // expected-warning{{trigraph converted to '\' character}}
#elif defined(STDGNU11) || defined(STDCPP17) || defined(MSCOMPAT)
const char c[] = "??/n"; // expected-warning{{trigraph ignored}}
#else
#error Not handled.
#endif
}
| {
"pile_set_name": "Github"
} |
/*
Copyright 2018 The Kubernetes Authors.
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.
*/
package fake
import (
v1beta1 "k8s.io/api/apps/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)
// FakeDeployments implements DeploymentInterface
type FakeDeployments struct {
Fake *FakeAppsV1beta1
ns string
}
var deploymentsResource = schema.GroupVersionResource{Group: "apps", Version: "v1beta1", Resource: "deployments"}
var deploymentsKind = schema.GroupVersionKind{Group: "apps", Version: "v1beta1", Kind: "Deployment"}
// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any.
func (c *FakeDeployments) Get(name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(deploymentsResource, c.ns, name), &v1beta1.Deployment{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Deployment), err
}
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
func (c *FakeDeployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(deploymentsResource, deploymentsKind, c.ns, opts), &v1beta1.DeploymentList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1beta1.DeploymentList{}
for _, item := range obj.(*v1beta1.DeploymentList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested deployments.
func (c *FakeDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(deploymentsResource, c.ns, opts))
}
// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any.
func (c *FakeDeployments) Create(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(deploymentsResource, c.ns, deployment), &v1beta1.Deployment{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Deployment), err
}
// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any.
func (c *FakeDeployments) Update(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(deploymentsResource, c.ns, deployment), &v1beta1.Deployment{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Deployment), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeDeployments) UpdateStatus(deployment *v1beta1.Deployment) (*v1beta1.Deployment, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &v1beta1.Deployment{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Deployment), err
}
// Delete takes name of the deployment and deletes it. Returns an error if one occurs.
func (c *FakeDeployments) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(deploymentsResource, c.ns, name), &v1beta1.Deployment{})
return err
}
// DeleteCollection deletes a collection of objects.
func (c *FakeDeployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(deploymentsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1beta1.DeploymentList{})
return err
}
// Patch applies the patch and returns the patched deployment.
func (c *FakeDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, data, subresources...), &v1beta1.Deployment{})
if obj == nil {
return nil, err
}
return obj.(*v1beta1.Deployment), err
}
| {
"pile_set_name": "Github"
} |
{-# LANGUAGE MultiParamTypeClasses, TypeFamilies,
GeneralizedNewtypeDeriving,
TemplateHaskell, CPP, UndecidableInstances #-}
{-| All RPC calls are run within this monad.
It encapsulates:
* IO operations,
* failures,
* working with the daemon state.
Code that is specific either to the configuration or the lock management, should
go into their corresponding dedicated modules.
-}
{-
Copyright (C) 2014 Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-}
module Ganeti.WConfd.Monad
( DaemonHandle
, dhConfigPath
, dhLivelock
, mkDaemonHandle
, WConfdMonadInt
, runWConfdMonadInt
, WConfdMonad
, daemonHandle
, modifyConfigState
, modifyConfigStateWithImmediate
, forceConfigStateDistribution
, readConfigState
, modifyConfigDataErr_
, modifyConfigAndReturnWithLock
, modifyConfigWithLock
, modifyLockWaiting
, modifyLockWaiting_
, readLockWaiting
, readLockAllocation
, modifyTempResState
, modifyTempResStateErr
, readTempResState
, DistributionTarget(..)
) where
import Control.Arrow ((&&&), second)
import Control.Concurrent (forkIO, myThreadId)
import Control.Exception.Lifted (bracket)
import Control.Monad
import Control.Monad.Base
import Control.Monad.Error
import Control.Monad.Reader
import Control.Monad.State
import Control.Monad.Trans.Control
import Data.Functor.Identity
import Data.IORef.Lifted
import Data.Monoid (Any(..))
import qualified Data.Semigroup as Sem
import qualified Data.Set as S
import Data.Tuple (swap)
import System.Posix.Process (getProcessID)
import System.Time (getClockTime, ClockTime)
import qualified Text.JSON as J
import Ganeti.BasicTypes
import Ganeti.Errors
import Ganeti.JQueue (notifyJob)
import Ganeti.Lens
import qualified Ganeti.Locking.Allocation as LA
import Ganeti.Locking.Locks
import qualified Ganeti.Locking.Waiting as LW
import Ganeti.Logging
import Ganeti.Logging.WriterLog
import Ganeti.Objects (ConfigData)
import Ganeti.Utils.AsyncWorker
import Ganeti.Utils.IORef
import Ganeti.Utils.Livelock (Livelock)
import Ganeti.WConfd.ConfigState
import Ganeti.WConfd.TempRes
-- * Monoid of the locations to flush the configuration to
-- | Data type describing where the configuration has to be distributed to.
data DistributionTarget = Everywhere | ToGroups (S.Set String) deriving Show
instance Sem.Semigroup DistributionTarget where
Everywhere <> _ = Everywhere
_ <> Everywhere = Everywhere
(ToGroups a) <> (ToGroups b) = ToGroups (a `S.union` b)
instance Monoid DistributionTarget where
mempty = ToGroups S.empty
mappend = (Sem.<>)
-- * Pure data types used in the monad
-- | The state of the daemon, capturing both the configuration state and the
-- locking state.
data DaemonState = DaemonState
{ dsConfigState :: ConfigState
, dsLockWaiting :: GanetiLockWaiting
, dsTempRes :: TempResState
}
$(makeCustomLenses ''DaemonState)
data DaemonHandle = DaemonHandle
{ dhDaemonState :: IORef DaemonState -- ^ The current state of the daemon
, dhConfigPath :: FilePath -- ^ The configuration file path
-- all static information that doesn't change during the life-time of the
-- daemon should go here;
-- all IDs of threads that do asynchronous work should probably also go here
, dhSaveConfigWorker :: AsyncWorker (Any, DistributionTarget) ()
, dhSaveLocksWorker :: AsyncWorker () ()
, dhSaveTempResWorker :: AsyncWorker () ()
, dhLivelock :: Livelock
}
mkDaemonHandle :: FilePath
-> ConfigState
-> GanetiLockWaiting
-> TempResState
-> (IO ConfigState
-> [AsyncWorker DistributionTarget ()]
-> ResultG (AsyncWorker (Any, DistributionTarget) ()))
-- ^ A function that creates a worker that asynchronously
-- saves the configuration to the master file.
-> (IO ConfigState
-> ResultG (AsyncWorker DistributionTarget ()))
-- ^ A function that creates a worker that asynchronously
-- distributes the configuration to master candidates
-> (IO ConfigState
-> ResultG (AsyncWorker DistributionTarget ()))
-- ^ A function that creates a worker that asynchronously
-- distributes SSConf to nodes
-> (IO GanetiLockWaiting -> ResultG (AsyncWorker () ()))
-- ^ A function that creates a worker that asynchronously
-- saves the lock allocation state.
-> (IO TempResState -> ResultG (AsyncWorker () ()))
-- ^ A function that creates a worker that asynchronously
-- saves the temporary reservations state.
-> Livelock
-> ResultG DaemonHandle
mkDaemonHandle cpath cstat lstat trstat
saveWorkerFn distMCsWorkerFn distSSConfWorkerFn
saveLockWorkerFn saveTempResWorkerFn livelock = do
ds <- newIORef $ DaemonState cstat lstat trstat
let readConfigIO = dsConfigState `liftM` readIORef ds :: IO ConfigState
ssconfWorker <- distSSConfWorkerFn readConfigIO
distMCsWorker <- distMCsWorkerFn readConfigIO
saveWorker <- saveWorkerFn readConfigIO [ distMCsWorker
, ssconfWorker ]
saveLockWorker <- saveLockWorkerFn $ dsLockWaiting `liftM` readIORef ds
saveTempResWorker <- saveTempResWorkerFn $ dsTempRes `liftM` readIORef ds
return $ DaemonHandle ds cpath saveWorker saveLockWorker saveTempResWorker
livelock
-- * The monad and its instances
-- | A type alias for easier referring to the actual content of the monad
-- when implementing its instances.
type WConfdMonadIntType = ReaderT DaemonHandle IO
-- | The internal part of the monad without error handling.
newtype WConfdMonadInt a = WConfdMonadInt
{ getWConfdMonadInt :: WConfdMonadIntType a }
deriving (Functor, Applicative, Monad, MonadIO, MonadBase IO, MonadLog)
instance MonadBaseControl IO WConfdMonadInt where
#if MIN_VERSION_monad_control(1,0,0)
-- Needs Undecidable instances
type StM WConfdMonadInt b = StM WConfdMonadIntType b
liftBaseWith f = WConfdMonadInt $ liftBaseWith
$ \r -> f (r . getWConfdMonadInt)
restoreM = WConfdMonadInt . restoreM
#else
newtype StM WConfdMonadInt b = StMWConfdMonadInt
{ runStMWConfdMonadInt :: StM WConfdMonadIntType b }
liftBaseWith f = WConfdMonadInt . liftBaseWith
$ \r -> f (liftM StMWConfdMonadInt . r . getWConfdMonadInt)
restoreM = WConfdMonadInt . restoreM . runStMWConfdMonadInt
#endif
-- | Runs the internal part of the WConfdMonad monad on a given daemon
-- handle.
runWConfdMonadInt :: WConfdMonadInt a -> DaemonHandle -> IO a
runWConfdMonadInt (WConfdMonadInt k) = runReaderT k
-- | The complete monad with error handling.
type WConfdMonad = ResultT GanetiException WConfdMonadInt
-- | A pure monad that logs and reports errors used for atomic modifications.
type AtomicModifyMonad a = ResultT GanetiException WriterLog a
-- * Basic functions in the monad
-- | Returns the daemon handle.
daemonHandle :: WConfdMonad DaemonHandle
daemonHandle = lift . WConfdMonadInt $ ask
-- | Returns the current configuration, given a handle
readConfigState :: WConfdMonad ConfigState
readConfigState = liftM dsConfigState . readIORef . dhDaemonState
=<< daemonHandle
-- | From a result of a configuration change, determine if the
-- configuration was changed and if full distribution is needed.
-- If so, also bump the serial number.
unpackConfigResult :: ClockTime -> ConfigState
-> (a, ConfigState) -> ((a, Bool, Bool), ConfigState)
unpackConfigResult now cs (r, cs')
| cs /= cs' = ( (r, True, needsFullDist cs cs')
, over csConfigDataL (bumpSerial now) cs'
)
| otherwise = ((r, False, False), cs')
-- | Atomically modifies the configuration state in the WConfdMonad
-- with a computation that can possibly fail; immediately afterwards,
-- while config write is still going on, do the followup action. Return
-- only after replication is finished.
modifyConfigStateErrWithImmediate
:: (TempResState -> ConfigState -> AtomicModifyMonad (a, ConfigState))
-> WConfdMonad ()
-> WConfdMonad a
modifyConfigStateErrWithImmediate f immediateFollowup = do
dh <- daemonHandle
now <- liftIO getClockTime
let modCS ds@(DaemonState { dsTempRes = tr }) =
mapMOf2
dsConfigStateL (\cs -> liftM (unpackConfigResult now cs) (f tr cs)) ds
(r, modified, distSync) <- atomicModifyIORefErrLog (dhDaemonState dh)
(liftM swap . modCS)
if modified
then if distSync
then do
logDebug $ "Triggering config write" ++
" together with full synchronous distribution"
res <- liftBase . triggerWithResult (Any True, Everywhere)
$ dhSaveConfigWorker dh
immediateFollowup
wait res
logDebug "Config write and distribution finished"
else do
-- trigger the config. saving worker and wait for it
logDebug $ "Triggering config write" ++
" and asynchronous distribution"
res <- liftBase . triggerWithResult (Any False, Everywhere)
$ dhSaveConfigWorker dh
immediateFollowup
wait res
logDebug "Config writer finished with local task"
else
immediateFollowup
return r
-- | Atomically modifies the configuration state in the WConfdMonad
-- with a computation that can possibly fail.
modifyConfigStateErr
:: (TempResState -> ConfigState -> AtomicModifyMonad (a, ConfigState))
-> WConfdMonad a
modifyConfigStateErr = flip modifyConfigStateErrWithImmediate (return ())
-- | Atomically modifies the configuration state in the WConfdMonad
-- with a computation that can possibly fail.
modifyConfigStateErr_
:: (TempResState -> ConfigState -> AtomicModifyMonad ConfigState)
-> WConfdMonad ()
modifyConfigStateErr_ f = modifyConfigStateErr ((liftM ((,) ()) .) . f)
-- | Atomically modifies the configuration state in the WConfdMonad.
modifyConfigState :: (ConfigState -> (a, ConfigState)) -> WConfdMonad a
modifyConfigState f = modifyConfigStateErr ((return .) . const f)
-- | Atomically modifies the configuration state in WConfdMonad; immediately
-- afterwards (while the config write-out is not necessarily finished) do
-- another acation.
modifyConfigStateWithImmediate :: (ConfigState -> (a, ConfigState))
-> WConfdMonad ()
-> WConfdMonad a
modifyConfigStateWithImmediate f =
modifyConfigStateErrWithImmediate ((return .) . const f)
-- | Force the distribution of configuration without actually modifying it.
--
-- We need a separate call for this operation, because 'modifyConfigState' only
-- triggers the distribution when the configuration changes.
forceConfigStateDistribution :: DistributionTarget -> WConfdMonad ()
forceConfigStateDistribution target = do
logDebug "Forcing synchronous config write together with full distribution"
dh <- daemonHandle
liftBase . triggerAndWait (Any True, target) . dhSaveConfigWorker $ dh
logDebug "Forced config write and distribution finished"
-- | Atomically modifies the configuration data in the WConfdMonad
-- with a computation that can possibly fail.
modifyConfigDataErr_
:: (TempResState -> ConfigData -> AtomicModifyMonad ConfigData)
-> WConfdMonad ()
modifyConfigDataErr_ f =
modifyConfigStateErr_ (traverseOf csConfigDataL . f)
-- | Atomically modifies the state of temporary reservations in
-- WConfdMonad in the presence of possible errors.
modifyTempResStateErr
:: (ConfigData -> StateT TempResState ErrorResult a) -> WConfdMonad a
modifyTempResStateErr f = do
-- we use Compose to traverse the composition of applicative functors
-- @ErrorResult@ and @(,) a@
let f' ds = traverseOf2 dsTempResL
(runStateT (f (csConfigData . dsConfigState $ ds))) ds
dh <- daemonHandle
r <- toErrorBase $ atomicModifyIORefErr (dhDaemonState dh)
(liftM swap . f')
-- logDebug $ "Current temporary reservations: " ++ J.encode tr
logDebug "Triggering temporary reservations write"
liftBase . triggerAndWait_ . dhSaveTempResWorker $ dh
logDebug "Temporary reservations write finished"
return r
-- | Atomically modifies the state of temporary reservations in
-- WConfdMonad.
modifyTempResState :: (ConfigData -> State TempResState a) -> WConfdMonad a
modifyTempResState f =
modifyTempResStateErr (mapStateT (return . runIdentity) . f)
-- | Reads the state of of the configuration and temporary reservations
-- in WConfdMonad.
readTempResState :: WConfdMonad (ConfigData, TempResState)
readTempResState = liftM (csConfigData . dsConfigState &&& dsTempRes)
. readIORef . dhDaemonState
=<< daemonHandle
-- | Atomically modifies the lock waiting state in WConfdMonad.
modifyLockWaiting :: (GanetiLockWaiting -> ( GanetiLockWaiting
, (a, S.Set ClientId) ))
-> WConfdMonad a
modifyLockWaiting f = do
dh <- lift . WConfdMonadInt $ ask
let f' = (id &&& fst) . f
(lockAlloc, (r, nfy)) <- atomicModifyWithLens
(dhDaemonState dh) dsLockWaitingL f'
logDebug $ "Current lock status: " ++ J.encode lockAlloc
logDebug "Triggering lock state write"
liftBase . triggerAndWait_ . dhSaveLocksWorker $ dh
logDebug "Lock write finished"
unless (S.null nfy) $ do
logDebug . (++) "Locks became available for " . show $ S.toList nfy
liftIO . mapM_ (notifyJob . ciPid) $ S.toList nfy
logDebug "Finished notifying processes"
return r
-- | Atomically modifies the lock allocation state in WConfdMonad, not
-- producing any result
modifyLockWaiting_ :: (GanetiLockWaiting -> (GanetiLockWaiting, S.Set ClientId))
-> WConfdMonad ()
modifyLockWaiting_ = modifyLockWaiting . ((second $ (,) ()) .)
-- | Read the lock waiting state in WConfdMonad.
readLockWaiting :: WConfdMonad GanetiLockWaiting
readLockWaiting = liftM dsLockWaiting
. readIORef . dhDaemonState
=<< daemonHandle
-- | Read the underlying lock allocation.
readLockAllocation :: WConfdMonad (LA.LockAllocation GanetiLocks ClientId)
readLockAllocation = liftM LW.getAllocation readLockWaiting
-- | Modify the configuration while temporarily acquiring
-- the configuration lock. If the configuration lock is held by
-- someone else, nothing is changed and Nothing is returned.
modifyConfigAndReturnWithLock
:: (TempResState -> ConfigState -> AtomicModifyMonad (a, ConfigState))
-> State TempResState ()
-> WConfdMonad (Maybe a)
modifyConfigAndReturnWithLock f tempres = do
now <- liftIO getClockTime
dh <- lift . WConfdMonadInt $ ask
pid <- liftIO getProcessID
tid <- liftIO myThreadId
let cid = ClientId { ciIdentifier = ClientOther $ "wconfd-" ++ show tid
, ciLockFile = dhLivelock dh
, ciPid = pid
}
let modCS ds@(DaemonState { dsTempRes = tr }) =
mapMOf2
dsConfigStateL
(\cs -> liftM (unpackConfigResult now cs) (f tr cs))
ds
maybeDist <- bracket
(atomicModifyWithLens (dhDaemonState dh) dsLockWaitingL
$ swap . LW.updateLocks cid [LA.requestExclusive ConfigLock])
(\(res, _) -> case res of
Ok s | S.null s -> do
(_, nfy) <- atomicModifyWithLens (dhDaemonState dh) dsLockWaitingL
$ swap . LW.updateLocks cid [LA.requestRelease ConfigLock]
unless (S.null nfy) . liftIO . void . forkIO $ do
logDebug . (++) "Locks became available for " . show $ S.toList nfy
mapM_ (notifyJob . ciPid) $ S.toList nfy
logDebug "Finished notifying processes"
_ -> return ())
(\(res, _) -> case res of
Ok s | S.null s ->do
ret <- atomicModifyIORefErrLog (dhDaemonState dh)
(liftM swap . modCS)
atomicModifyWithLens (dhDaemonState dh) dsTempResL $ runState tempres
return $ Just ret
_ -> return Nothing)
flip (maybe $ return Nothing) maybeDist $ \(val, modified, dist) -> do
when modified $ do
logDebug . (++) "Triggering config write; distribution "
$ if dist then "synchronously" else "asynchronously"
liftBase . triggerAndWait (Any dist, Everywhere) $ dhSaveConfigWorker dh
logDebug "Config write finished"
logDebug "Triggering temporary reservations write"
liftBase . triggerAndWait_ . dhSaveTempResWorker $ dh
logDebug "Temporary reservations write finished"
return $ Just val
modifyConfigWithLock
:: (TempResState -> ConfigState -> AtomicModifyMonad ConfigState)
-> State TempResState ()
-> WConfdMonad (Maybe ())
modifyConfigWithLock f = modifyConfigAndReturnWithLock f'
where f' tr cs = fmap ((,) ()) (f tr cs)
| {
"pile_set_name": "Github"
} |
import {Component, Input} from '@angular/core';
@Component({
selector: 'validation',
template: `
<div class="validation">
<div *ngFor="let message of messages">{{message}}</div>
</div>
`,
styles: [`
.validation {
color: #999;
margin: 12px;
}`
]
})
export class ValidationComponent {
@Input() messages: Array<string>;
} | {
"pile_set_name": "Github"
} |
<!doctype html>
<html lang="en">
<head>
<title>jQuery UI Effects Demos</title>
<link type="text/css" href="../demos.css" rel="stylesheet" />
</head>
<body>
<div class="demos-nav">
<h4>Examples</h4>
<ul>
<li class="demo-config-on"><a href="default.html">Default functionality</a></li>
</ul>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
// Run: %dxc -T vs_6_0 -E main
// According to HLSL reference:
// The 'lerp' function can only operate on float, vector of float, and matrix of floats.
// CHECK: [[glsl:%\d+]] = OpExtInstImport "GLSL.std.450"
void main() {
float a1, a2, a3, lerp_a;
float4 b1, b2, b3, lerp_b;
float2x3 c1, c2, c3, lerp_c;
// CHECK: [[a1:%\d+]] = OpLoad %float %a1
// CHECK-NEXT: [[a2:%\d+]] = OpLoad %float %a2
// CHECK-NEXT: [[a3:%\d+]] = OpLoad %float %a3
// CHECK-NEXT: [[lerp_a:%\d+]] = OpExtInst %float [[glsl]] FMix [[a1]] [[a2]] [[a3]]
// CHECK-NEXT: OpStore %lerp_a [[lerp_a]]
lerp_a = lerp(a1, a2, a3);
// CHECK: [[b1:%\d+]] = OpLoad %v4float %b1
// CHECK-NEXT: [[b2:%\d+]] = OpLoad %v4float %b2
// CHECK-NEXT: [[b3:%\d+]] = OpLoad %v4float %b3
// CHECK-NEXT: [[lerp_b:%\d+]] = OpExtInst %v4float [[glsl]] FMix [[b1]] [[b2]] [[b3]]
// CHECK-NEXT: OpStore %lerp_b [[lerp_b]]
lerp_b = lerp(b1, b2, b3);
// CHECK: [[c1:%\d+]] = OpLoad %mat2v3float %c1
// CHECK-NEXT: [[c2:%\d+]] = OpLoad %mat2v3float %c2
// CHECK-NEXT: [[c3:%\d+]] = OpLoad %mat2v3float %c3
// CHECK-NEXT: [[c1_row0:%\d+]] = OpCompositeExtract %v3float [[c1]] 0
// CHECK-NEXT: [[c2_row0:%\d+]] = OpCompositeExtract %v3float [[c2]] 0
// CHECK-NEXT: [[c3_row0:%\d+]] = OpCompositeExtract %v3float [[c3]] 0
// CHECK-NEXT: [[lerp_c_row0:%\d+]] = OpExtInst %v3float [[glsl]] FMix [[c1_row0]] [[c2_row0]] [[c3_row0]]
// CHECK-NEXT: [[c1_row1:%\d+]] = OpCompositeExtract %v3float [[c1]] 1
// CHECK-NEXT: [[c2_row1:%\d+]] = OpCompositeExtract %v3float [[c2]] 1
// CHECK-NEXT: [[c3_row1:%\d+]] = OpCompositeExtract %v3float [[c3]] 1
// CHECK-NEXT: [[lerp_c_row1:%\d+]] = OpExtInst %v3float [[glsl]] FMix [[c1_row1]] [[c2_row1]] [[c3_row1]]
// CHECK-NEXT: [[lerp_c:%\d+]] = OpCompositeConstruct %mat2v3float [[lerp_c_row0]] [[lerp_c_row1]]
// CHECK-NEXT: OpStore %lerp_c [[lerp_c]]
lerp_c = lerp(c1, c2, c3);
}
| {
"pile_set_name": "Github"
} |
description: Presence of unused variables
issues:
- id: SWC-131
count: 0
locations: []
| {
"pile_set_name": "Github"
} |
from data import city_visit
from ranker import rank_adjuster_interface
# NOTE(igushev): This class works only with PointType implementation of
# PointTypeInterface.
class PointTypeRankAdjuster(rank_adjuster_interface.RankAdjusterInterface):
"""Adjusts rank of points by point types."""
@staticmethod
def _PointScoreMult(point_names_point_types, parameters_names_point_types):
return (
sum(max(point_type, 1) *
max(point_names_point_types[name], 1)
for name, point_type in parameters_names_point_types.items()) /
float(100 * 100) /
len(parameters_names_point_types))
def AdjustRank(self, score_points, city_visit_parameters):
for score_point in score_points:
assert isinstance(score_point, rank_adjuster_interface.ScorePoint)
assert isinstance(city_visit_parameters, city_visit.CityVisitParametersInterface)
parameters_names_point_types = (
city_visit_parameters.point_type.GetNamesPointTypes())
result_score_points = []
for score, point in score_points:
point_names_point_types = point.point_type.GetNamesPointTypes()
point_score_mult = PointTypeRankAdjuster._PointScoreMult(
point_names_point_types, parameters_names_point_types)
result_score_points.append(rank_adjuster_interface.ScorePoint(score * point_score_mult, point))
return result_score_points
| {
"pile_set_name": "Github"
} |
/*
* The MIT License
*
* Copyright 2017 Ayesha.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.github.horrorho.ragingmoose;
import java.io.IOException;
import java.nio.ByteBuffer;
import static java.nio.ByteOrder.LITTLE_ENDIAN;
import java.nio.channels.ReadableByteChannel;
import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.WillNotClose;
import javax.annotation.concurrent.NotThreadSafe;
/**
*
* @author Ayesha
*/
@NotThreadSafe
@ParametersAreNonnullByDefault
class RawBlockHeader {
private final ByteBuffer bb = ByteBuffer.allocate(4).order(LITTLE_ENDIAN);
private int nRawBytes;
@Nonnull
RawBlockHeader load(@WillNotClose ReadableByteChannel ch) throws IOException {
bb.rewind();
IO.readFully(ch, bb).flip();
nRawBytes = bb.getInt();
return this;
}
int nRawBytes() {
return nRawBytes;
}
@Override
public String toString() {
return "RawBlockHeader{" + "nRawBytes=" + nRawBytes + '}';
}
}
| {
"pile_set_name": "Github"
} |
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* The base implementation of `_.has` without support for deep paths.
*
* @private
* @param {Object} [object] The object to query.
* @param {Array|string} key The key to check.
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
return object != null && hasOwnProperty.call(object, key);
}
module.exports = baseHas;
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>激活邮箱</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="keywords" content="fly,layui,前端社区">
<meta name="description" content="Fly社区是模块化前端UI框架Layui的官网社区,致力于为web开发提供强劲动力">
<link rel="stylesheet" href="../../res/layui/css/layui.css">
<link rel="stylesheet" href="../../res/css/global.css">
</head>
<body>
<div class="fly-header layui-bg-black">
<div class="layui-container">
<a class="fly-logo" href="/">
<img src="../../res/images/logo.png" alt="layui">
</a>
<ul class="layui-nav fly-nav layui-hide-xs">
<li class="layui-nav-item layui-this">
<a href="/"><i class="iconfont icon-jiaoliu"></i>交流</a>
</li>
<li class="layui-nav-item">
<a href="../case/case.html"><i class="iconfont icon-iconmingxinganli"></i>案例</a>
</li>
<li class="layui-nav-item">
<a href="http://www.layui.com/" target="_blank"><i class="iconfont icon-ui"></i>框架</a>
</li>
</ul>
<ul class="layui-nav fly-nav-user">
<!-- 登入后的状态 -->
<li class="layui-nav-item">
<a class="fly-nav-avatar" href="javascript:;">
<cite class="layui-hide-xs">贤心</cite>
<i class="iconfont icon-renzheng layui-hide-xs" title="认证信息:layui 作者"></i>
<i class="layui-badge fly-badge-vip layui-hide-xs">VIP3</i>
<img src="https://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg">
</a>
<dl class="layui-nav-child">
<dd><a href="../user/set.html"><i class="layui-icon"></i>基本设置</a></dd>
<dd><a href="../user/message.html"><i class="iconfont icon-tongzhi" style="top: 4px;"></i>我的消息</a></dd>
<dd><a href="../user/home.html"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;"></i>我的主页</a></dd>
<hr style="margin: 5px 0;">
<dd><a href="" style="text-align: center;">退出</a></dd>
</dl>
</li>
</ul>
</div>
</div>
<div class="layui-container fly-marginTop fly-user-main">
<ul class="layui-nav layui-nav-tree layui-inline" lay-filter="user">
<li class="layui-nav-item">
<a href="home.html">
<i class="layui-icon"></i>
我的主页
</a>
</li>
<li class="layui-nav-item layui-this">
<a href="index.html">
<i class="layui-icon"></i>
用户中心
</a>
</li>
<li class="layui-nav-item">
<a href="set.html">
<i class="layui-icon"></i>
基本设置
</a>
</li>
<li class="layui-nav-item">
<a href="message.html">
<i class="layui-icon"></i>
我的消息
</a>
</li>
</ul>
<div class="site-tree-mobile layui-hide">
<i class="layui-icon"></i>
</div>
<div class="site-mobile-shade"></div>
<div class="site-tree-mobile layui-hide">
<i class="layui-icon"></i>
</div>
<div class="site-mobile-shade"></div>
<div class="fly-panel fly-panel-user" pad20>
<div class="layui-tab layui-tab-brief" lay-filter="user">
<ul class="layui-tab-title">
<li class="layui-this">
激活邮箱
</li>
</ul>
<div class="layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
<ul class="layui-form">
<li class="layui-form-li">
<label for="activate">您的邮箱:</label>
<span class="layui-form-text">xx@xx.com
<!-- <em style="color:#999;">(已成功激活)</em> -->
<em style="color:#c00;">(尚未激活)</em>
</span>
</li>
<li class="layui-form-li" style="margin-top: 20px; line-height: 26px;">
<div>
1. 如果您未收到邮件,或激活链接失效,您可以
<a class="layui-form-a" style="color:#4f99cf;" id="LAY-activate" href="javascript:;" email="{{user.email}}">重新发送邮件</a>,或者
<a class="layui-form-a" style="color:#4f99cf;" href="set.html">更换邮箱</a>;
</div>
<div>
2. 如果您始终没有收到 Fly 发送的邮件,请注意查看您邮箱中的垃圾邮件;
</div>
<div>
3. 如果你实在无法激活邮件,您还可以联系:admin@xx.com
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="fly-footer">
<p><a href="http://fly.layui.com/" target="_blank">Fly社区</a> 2017 © <a href="http://www.layui.com/" target="_blank">layui.com 出品</a></p>
<p>
<a href="http://fly.layui.com/jie/3147/" target="_blank">付费计划</a>
<a href="http://www.layui.com/template/fly/" target="_blank">获取Fly社区模版</a>
<a href="http://fly.layui.com/jie/2461/" target="_blank">微信公众号</a>
</p>
</div>
<script src="../../res/layui/layui.js"></script>
<script>
layui.cache.page = 'user';
layui.cache.user = {
username: '游客'
,uid: -1
,avatar: '../../res/images/avatar/00.jpg'
,experience: 83
,sex: '男'
};
layui.config({
version: "3.0.0"
,base: '../../res/mods/'
}).extend({
fly: 'index'
}).use('fly');
</script>
</body>
</html> | {
"pile_set_name": "Github"
} |
/*
* Created on Mar 27, 2013
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* Copyright @2013 the original author or authors.
*/
package org.fest.assertions.internal;
import static org.fest.assertions.error.ShouldNotBeNull.shouldNotBeNull;
import static org.fest.assertions.error.ShouldNotContain.shouldNotContain;
import static org.fest.test.ExpectedException.none;
import static org.fest.util.Sets.newLinkedHashSet;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import java.util.Set;
import org.fest.assertions.description.Description;
import org.fest.test.ExpectedException;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
/**
* @author Alex Ruiz
* @author Yvonne Wang
*/
public class LongArrays_assertDoesNotContain_Test {
@Rule
public ExpectedException thrown = none();
private LongArrays arrays;
private Description description;
private Failures failures;
@Before
public void setUp() {
arrays = new LongArrays();
description = new TestDescription("testing");
failures = spy(new Failures());
Arrays parent = Arrays.instance();
parent.failures = failures;
}
@Test
public void should_fail_if_actual_is_null() {
long[] other = { 1, 2 };
String message = shouldNotBeNull().create(description);
thrown.expect(AssertionError.class, message);
arrays.assertDoesNotContain(description, null, other);
}
@Test
public void should_fail_if_other_is_null() {
long[] actual = new long[1];
thrown.expect(NullPointerException.class, "The array of values to look for should not be null");
arrays.assertDoesNotContain(description, actual, null);
}
@Test
public void should_fail_if_other_is_empty() {
long[] actual = new long[1];
long[] other = new long[0];
thrown.expect(IllegalArgumentException.class, "The array of values to look for should not be empty");
arrays.assertDoesNotContain(description, actual, other);
}
@Test
public void should_fail_if_actual_contains_partial_other() {
long[] actual = { 1, 2, 3, 4 };
long[] other = { 3, 5 };
Set<Long> found = newLinkedHashSet(3l);
try {
arrays.assertDoesNotContain(description, actual, other);
} catch (AssertionError e) {
verify(failures).failure(description, shouldNotContain(actual, other, found));
}
}
@Test
public void should_fail_if_actual_contains_entire_other() {
long[] actual = { 1, 2, 3, 4 };
long[] other = { 3, 4 };
Set<Long> found = newLinkedHashSet(3l);
found.add(4l);
try {
arrays.assertDoesNotContain(description, actual, other);
} catch (AssertionError e) {
verify(failures).failure(description, shouldNotContain(actual, other, found));
}
}
@Test
public void should_pass_if_actual_does_not_contain_other() {
long[] actual = { 1, 2, 3, 4 };
long[] values = { 5, 6 };
arrays.assertDoesNotContain(description, actual, values);
}
@Test
public void should_pass_if_actual_does_not_contain_other_with_duplicates() {
long[] actual = { 1, 2, 3, 4 };
long[] values = { 5, 5, 6, 6 };
arrays.assertDoesNotContain(description, actual, values);
}
}
| {
"pile_set_name": "Github"
} |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/networking/requests/messages/check_challenge_message.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='pogoprotos/networking/requests/messages/check_challenge_message.proto',
package='pogoprotos.networking.requests.messages',
syntax='proto3',
serialized_pb=_b('\nEpogoprotos/networking/requests/messages/check_challenge_message.proto\x12\'pogoprotos.networking.requests.messages\".\n\x15\x43heckChallengeMessage\x12\x15\n\rdebug_request\x18\x01 \x01(\x08\x62\x06proto3')
)
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
_CHECKCHALLENGEMESSAGE = _descriptor.Descriptor(
name='CheckChallengeMessage',
full_name='pogoprotos.networking.requests.messages.CheckChallengeMessage',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='debug_request', full_name='pogoprotos.networking.requests.messages.CheckChallengeMessage.debug_request', index=0,
number=1, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=114,
serialized_end=160,
)
DESCRIPTOR.message_types_by_name['CheckChallengeMessage'] = _CHECKCHALLENGEMESSAGE
CheckChallengeMessage = _reflection.GeneratedProtocolMessageType('CheckChallengeMessage', (_message.Message,), dict(
DESCRIPTOR = _CHECKCHALLENGEMESSAGE,
__module__ = 'pogoprotos.networking.requests.messages.check_challenge_message_pb2'
# @@protoc_insertion_point(class_scope:pogoprotos.networking.requests.messages.CheckChallengeMessage)
))
_sym_db.RegisterMessage(CheckChallengeMessage)
# @@protoc_insertion_point(module_scope)
| {
"pile_set_name": "Github"
} |
package milkman.ui.main;
import javafx.scene.Scene;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyCodeCombination;
import milkman.PlatformUtil;
import milkman.ui.commands.AppCommand;
import milkman.ui.commands.AppCommand.EditCurrentEnvironment;
import milkman.ui.commands.UiCommand;
import milkman.ui.commands.UiCommand.*;
import milkman.utils.Event;
import javax.inject.Singleton;
@Singleton
public class HotkeyManager {
public final Event<AppCommand> onAppCommand = new Event<AppCommand>();
public final Event<UiCommand> onCommand = new Event<UiCommand>();
public void registerGlobalHotkeys(Scene scene) {
scene.getAccelerators().put(PlatformUtil.getControlKeyCombination(KeyCode.ENTER),
() -> onCommand.invoke(new SubmitActiveRequest()));
scene.getAccelerators().put(PlatformUtil.getControlKeyCombination(KeyCode.N),
() -> onCommand.invoke(new NewRequest(null)));
scene.getAccelerators().put(PlatformUtil.getControlKeyCombination(KeyCode.W),
() -> onCommand.invoke(new CloseActiveRequest()));
scene.getAccelerators().put(PlatformUtil.getControlKeyCombination(KeyCode.R),
() -> onCommand.invoke(new RenameActiveRequest()));
scene.getAccelerators().put(PlatformUtil.getControlKeyCombination(KeyCode.S),
() -> onCommand.invoke(new SaveActiveRequest()));
scene.getAccelerators().put(PlatformUtil.getControlKeyCombination(KeyCode.E),
() -> onAppCommand.invoke(new EditCurrentEnvironment()));
scene.getAccelerators().put(new KeyCodeCombination(KeyCode.ESCAPE),
() -> {
onCommand.invoke(new CancelActiveRequest());
onCommand.invoke(new CancelHighlight());
});
scene.getAccelerators().put(PlatformUtil.getControlKeyCombination(KeyCode.SPACE),
() -> onCommand.invoke(new HighlightVariables()));
}
}
| {
"pile_set_name": "Github"
} |
.PHONY: help
help::
$(ECHO) "Makefile Usage:"
$(ECHO) " make all TARGET=<sw_emu/hw_emu/hw> DEVICE=<FPGA platform>"
$(ECHO) " Command to generate the design for specified Target and Device."
$(ECHO) ""
$(ECHO) " make clean "
$(ECHO) " Command to remove the generated non-hardware files."
$(ECHO) ""
$(ECHO) " make cleanall"
$(ECHO) " Command to remove all the generated files."
$(ECHO) ""
$(ECHO) " make check TARGET=<sw_emu/hw_emu/hw> DEVICE=<FPGA platform>"
$(ECHO) " Command to run application in emulation."
$(ECHO) ""
$(ECHO) " make build TARGET=<sw_emu/hw_emu/hw> DEVICE=<FPGA platform>"
$(ECHO) " Command to build xclbin application."
$(ECHO) ""
$(ECHO) " make run_nimbix DEVICE=<FPGA platform>"
$(ECHO) " Command to run application on Nimbix Cloud."
$(ECHO) ""
$(ECHO) " make aws_build DEVICE=<FPGA platform>"
$(ECHO) " Command to build AWS xclbin application on AWS Cloud."
$(ECHO) ""
# Points to Utility Directory
COMMON_REPO = ../../../
ABS_COMMON_REPO = $(shell readlink -f $(COMMON_REPO))
TARGETS := hw
TARGET := $(TARGETS)
DEVICE := $(DEVICES)
XCLBIN := ./xclbin
include ./utils.mk
DSA := $(call device2dsa, $(DEVICE))
BUILD_DIR := ./_x.$(TARGET).$(DSA)
BUILD_DIR_apply_watermark = $(BUILD_DIR)/apply_watermark
CXX := $(XILINX_SDX)/bin/xcpp
XOCC := $(XILINX_SDX)/bin/xocc
#Include Libraries
include $(ABS_COMMON_REPO)/libs/opencl/opencl.mk
include $(ABS_COMMON_REPO)/libs/xcl2/xcl2.mk
include $(ABS_COMMON_REPO)/libs/bitmap/bitmap.mk
CXXFLAGS += $(xcl2_CXXFLAGS) $(bitmap_CXXFLAGS)
LDFLAGS += $(xcl2_LDFLAGS) $(bitmap_LDFLAGS)
HOST_SRCS += $(xcl2_SRCS) $(bitmap_SRCS)
CXXFLAGS += $(opencl_CXXFLAGS) -Wall -O0 -g -std=c++14
LDFLAGS += $(opencl_LDFLAGS)
HOST_SRCS += src/host.cpp
# Host compiler global settings
CXXFLAGS += -fmessage-length=0
LDFLAGS += -lrt -lstdc++
# Kernel compiler global settings
CLFLAGS += -t $(TARGET) --platform $(DEVICE) --save-temps
CLFLAGS += --max_memory_ports apply_watermark
# Kernel linker flags
LDCLFLAGS += --sp apply_watermark_1.m_axi_gmem0:DDR[0] --sp apply_watermark_1.m_axi_gmem1:DDR[1]
EXECUTABLE = host
CMD_ARGS = $(XCLBIN)/apply_watermark.$(TARGET).$(DSA).xclbin ./data/input.bmp ./data/golden.bmp
EMCONFIG_DIR = $(XCLBIN)/$(DSA)
BINARY_CONTAINERS += $(XCLBIN)/apply_watermark.$(TARGET).$(DSA).xclbin
BINARY_CONTAINER_apply_watermark_OBJS += $(XCLBIN)/apply_watermark.$(TARGET).$(DSA).xo
CP = cp -rf
DATA = ./data
.PHONY: all clean cleanall docs emconfig
all: check-devices $(EXECUTABLE) $(BINARY_CONTAINERS) emconfig
.PHONY: exe
exe: $(EXECUTABLE)
.PHONY: build
build: $(BINARY_CONTAINERS)
# Building kernel
$(XCLBIN)/apply_watermark.$(TARGET).$(DSA).xo: src/apply_watermark.cl
mkdir -p $(XCLBIN)
$(XOCC) $(CLFLAGS) --temp_dir $(BUILD_DIR_apply_watermark) -c -k apply_watermark -I'$(<D)' -o'$@' '$<'
$(XCLBIN)/apply_watermark.$(TARGET).$(DSA).xclbin: $(BINARY_CONTAINER_apply_watermark_OBJS)
mkdir -p $(XCLBIN)
$(XOCC) $(CLFLAGS) --temp_dir $(BUILD_DIR_apply_watermark) -l $(LDCLFLAGS) --nk apply_watermark:1 -o'$@' $(+)
# Building Host
$(EXECUTABLE): check-xrt $(HOST_SRCS) $(HOST_HDRS)
$(CXX) $(CXXFLAGS) $(HOST_SRCS) $(HOST_HDRS) -o '$@' $(LDFLAGS)
emconfig:$(EMCONFIG_DIR)/emconfig.json
$(EMCONFIG_DIR)/emconfig.json:
emconfigutil --platform $(DEVICE) --od $(EMCONFIG_DIR)
check: all
ifeq ($(findstring xilinx_u50_xdma, $(DEVICE)), xilinx_u50_xdma)
$(error Nothing to be done for make)
endif
ifeq ($(findstring xilinx_aws-vu9p-f1-04261818, $(DEVICE)), xilinx_aws-vu9p-f1-04261818)
$(error Nothing to be done for make)
endif
ifeq ($(findstring xilinx:u50:xdma, $(DEVICE)), xilinx:u50:xdma)
$(error Nothing to be done for make)
endif
ifeq ($(findstring xilinx:aws-vu9p-f1-04261818:dynamic, $(DEVICE)), xilinx:aws-vu9p-f1-04261818:dynamic)
$(error Nothing to be done for make)
endif
ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))
$(CP) $(EMCONFIG_DIR)/emconfig.json .
XCL_EMULATION_MODE=$(TARGET) ./$(EXECUTABLE) $(XCLBIN)/apply_watermark.$(TARGET).$(DSA).xclbin ./data/input.bmp ./data/golden.bmp
else
./$(EXECUTABLE) $(XCLBIN)/apply_watermark.$(TARGET).$(DSA).xclbin ./data/input.bmp ./data/golden.bmp
endif
sdx_analyze profile -i profile_summary.csv -f html
run_nimbix: all
$(COMMON_REPO)/utility/nimbix/run_nimbix.py $(EXECUTABLE) $(CMD_ARGS) $(DSA)
aws_build: check-aws_repo $(BINARY_CONTAINERS)
$(COMMON_REPO)/utility/aws/run_aws.py $(BINARY_CONTAINERS)
# Cleaning stuff
clean:
-$(RMDIR) $(EXECUTABLE) $(XCLBIN)/{*sw_emu*,*hw_emu*}
-$(RMDIR) profile_* TempConfig system_estimate.xtxt *.rpt *.csv
-$(RMDIR) src/*.ll _xocc_* .Xil emconfig.json dltmp* xmltmp* *.log *.jou *.wcfg *.wdb
cleanall: clean
-$(RMDIR) $(XCLBIN)
-$(RMDIR) _x.*
-$(RMDIR) ./output.bmp
| {
"pile_set_name": "Github"
} |
# 如何为情感分析准备电影评论数据
> 原文: [https://machinelearningmastery.com/prepare-movie-review-data-sentiment-analysis/](https://machinelearningmastery.com/prepare-movie-review-data-sentiment-analysis/)
每个问题的文本数据准备都不同。
准备工作从简单的步骤开始,例如加载数据,但是对于您正在使用的数据非常具体的清理任务很快就会变得困难。您需要有关从何处开始以及从原始数据到准备建模的数据的步骤的工作顺序的帮助。
在本教程中,您将逐步了解如何为情感分析准备电影评论文本数据。
完成本教程后,您将了解:
* 如何加载文本数据并清除它以删除标点符号和其他非单词。
* 如何开发词汇表,定制它并将其保存到文件中。
* 如何使用清洁和预定义的词汇表准备电影评论,并将其保存到准备建模的新文件中。
让我们开始吧。
* **2017 年 10 月更新**:修正了跳过不匹配文件的小错误,感谢 Jan Zett。
* **2017 年 12 月更新**:修复了完整示例中的小错字,感谢 Ray 和 Zain。

如何为情感分析准备电影评论数据
[Kenneth Lu](https://www.flickr.com/photos/toasty/1125019024/) 的照片,保留一些权利。
## 教程概述
本教程分为 5 个部分;他们是:
1. 电影评论数据集
2. 加载文本数据
3. 清理文本数据
4. 培养词汇量
5. 保存准备好的数据
## 1.电影评论数据集
电影评论数据是 Bo Pang 和 Lillian Lee 在 21 世纪初从 imdb.com 网站上检索到的电影评论的集合。收集的评论作为他们自然语言处理研究的一部分。
评论最初于 2002 年发布,但更新和清理版本于 2004 年发布,称为“ _v2.0_ ”。
该数据集包含 1,000 个正面和 1,000 个负面电影评论,这些评论来自 [IMDB](http://reviews.imdb.com/Reviews) 托管的 rec.arts.movies.reviews 新闻组的存档。作者将该数据集称为“_ 极性数据集 _”。
> 我们的数据包含 2000 年之前写的 1000 份正面和 1000 份负面评论,每位作者的评论上限为 20(每位作者共 312 位)。我们将此语料库称为极性数据集。
- [感伤教育:基于最小削减的主观性总结的情感分析](http://xxx.lanl.gov/abs/cs/0409058),2004。
数据已经有所清理,例如:
* 数据集仅包含英语评论。
* 所有文本都已转换为小写。
* 标点符号周围有空格,如句号,逗号和括号。
* 文本每行被分成一个句子。
该数据已用于一些相关的自然语言处理任务。对于分类,经典模型(例如支持向量机)对数据的表现在高 70%至低 80%(例如 78%至 82%)的范围内。
更复杂的数据准备可以看到高达 86%的结果,交叉验证 10 倍。如果我们想在现代方法的实验中使用这个数据集,这给了我们 80 年代中期的球场。
> ...根据下游极性分类器的选择,我们可以实现高度统计上的显着改善(从 82.8%到 86.4%)
- [感伤教育:基于最小削减的主观性总结的情感分析](http://xxx.lanl.gov/abs/cs/0409058),2004。
您可以从此处下载数据集:
* [电影评论 Polarity Dataset](http://www.cs.cornell.edu/people/pabo/movie-review-data/review_polarity.tar.gz) (review_polarity.tar.gz,3MB)
解压缩文件后,您将有一个名为“ _txt_sentoken_ ”的目录,其中包含两个子目录,其中包含文本“ _neg_ ”和“ _pos_ ”的负数和积极的评论。对于 neg 和 pos 中的每一个,每个文件存储一个评论约定 _cv000_ 到 _cv999_ 。
接下来,我们来看看加载文本数据。
## 2.加载文本数据
在本节中,我们将介绍加载单个文本文件,然后处理文件目录。
我们假设审查数据已下载并在文件夹“ _txt_sentoken_ ”的当前工作目录中可用。
我们可以通过打开它,读取 ASCII 文本和关闭文件来加载单个文本文件。这是标准的文件处理。例如,我们可以加载第一个负面评论文件“ _cv000_29416.txt_ ”,如下所示:
```py
# load one file
filename = 'txt_sentoken/neg/cv000_29416.txt'
# open the file as read only
file = open(filename, 'r')
# read all text
text = file.read()
# close the file
file.close()
```
这会将文档加载为 ASCII 并保留任何空白区域,如新行。
我们可以把它变成一个名为 load_doc()的函数,它接受文档的文件名加载并返回文本。
```py
# load doc into memory
def load_doc(filename):
# open the file as read only
file = open(filename, 'r')
# read all text
text = file.read()
# close the file
file.close()
return text
```
我们有两个目录,每个目录有 1,000 个文档。我们可以依次使用 [listdir()函数](https://docs.python.org/3/library/os.html#os.listdir)获取目录中的文件列表来依次处理每个目录,然后依次加载每个文件。
例如,我们可以使用 _load_doc()_ 函数在负目录中加载每个文档来进行实际加载。
```py
from os import listdir
# load doc into memory
def load_doc(filename):
# open the file as read only
file = open(filename, 'r')
# read all text
text = file.read()
# close the file
file.close()
return text
# specify directory to load
directory = 'txt_sentoken/neg'
# walk through all files in the folder
for filename in listdir(directory):
# skip files that do not have the right extension
if not filename.endswith(".txt"):
continue
# create the full path of the file to open
path = directory + '/' + filename
# load document
doc = load_doc(path)
print('Loaded %s' % filename)
```
运行此示例会在加载后打印每个评论的文件名。
```py
...
Loaded cv995_23113.txt
Loaded cv996_12447.txt
Loaded cv997_5152.txt
Loaded cv998_15691.txt
Loaded cv999_14636.txt
```
我们也可以将文档的处理转换为函数,稍后将其用作模板,以开发清除文件夹中所有文档的函数。例如,下面我们定义一个 _process_docs()_ 函数来做同样的事情。
```py
from os import listdir
# load doc into memory
def load_doc(filename):
# open the file as read only
file = open(filename, 'r')
# read all text
text = file.read()
# close the file
file.close()
return text
# load all docs in a directory
def process_docs(directory):
# walk through all files in the folder
for filename in listdir(directory):
# skip files that do not have the right extension
if not filename.endswith(".txt"):
continue
# create the full path of the file to open
path = directory + '/' + filename
# load document
doc = load_doc(path)
print('Loaded %s' % filename)
# specify directory to load
directory = 'txt_sentoken/neg'
process_docs(directory)
```
现在我们知道了如何加载电影评论文本数据,让我们看一下清理它。
## 3.清理文本数据
在本节中,我们将了解我们可能要对电影评论数据进行哪些数据清理。
我们假设我们将使用一个词袋模型或者可能是一个不需要太多准备的单词嵌入。
分成代币
首先,让我们加载一个文档,然后查看由空格分割的原始标记。我们将使用上一节中开发的 _load_doc()_ 函数。我们可以使用 _split()_ 函数将加载的文档拆分为由空格分隔的标记。
```py
# load doc into memory
def load_doc(filename):
# open the file as read only
file = open(filename, 'r')
# read all text
text = file.read()
# close the file
file.close()
return text
# load the document
filename = 'txt_sentoken/neg/cv000_29416.txt'
text = load_doc(filename)
# split into tokens by white space
tokens = text.split()
print(tokens)
```
运行该示例从文档中提供了很长的原始令牌列表。
```py
...
'years', 'ago', 'and', 'has', 'been', 'sitting', 'on', 'the', 'shelves', 'ever', 'since', '.', 'whatever', '.', '.', '.', 'skip', 'it', '!', "where's", 'joblo', 'coming', 'from', '?', 'a', 'nightmare', 'of', 'elm', 'street', '3', '(', '7/10', ')', '-', 'blair', 'witch', '2', '(', '7/10', ')', '-', 'the', 'crow', '(', '9/10', ')', '-', 'the', 'crow', ':', 'salvation', '(', '4/10', ')', '-', 'lost', 'highway', '(', '10/10', ')', '-', 'memento', '(', '10/10', ')', '-', 'the', 'others', '(', '9/10', ')', '-', 'stir', 'of', 'echoes', '(', '8/10', ')']
```
只要查看原始令牌就可以给我们提供很多想法的想法,例如:
* 从单词中删除标点符号(例如“what's”)。
* 删除只是标点符号的标记(例如“ - ”)。
* 删除包含数字的标记(例如'10 / 10')。
* 删除具有一个字符(例如“a”)的令牌。
* 删除没有多大意义的令牌(例如'和')
一些想法:
* 我们可以使用字符串 _translate()_ 函数从标记中过滤出标点符号。
* 我们可以通过对每个标记使用 _isalpha()_ 检查来删除只是标点符号或包含数字的标记。
* 我们可以使用 NLTK 加载的列表删除英语停用词。
* 我们可以通过检查短标记来过滤掉短标记。
以下是清洁此评论的更新版本。
```py
from nltk.corpus import stopwords
import string
# load doc into memory
def load_doc(filename):
# open the file as read only
file = open(filename, 'r')
# read all text
text = file.read()
# close the file
file.close()
return text
# load the document
filename = 'txt_sentoken/neg/cv000_29416.txt'
text = load_doc(filename)
# split into tokens by white space
tokens = text.split()
# remove punctuation from each token
table = str.maketrans('', '', string.punctuation)
tokens = [w.translate(table) for w in tokens]
# remove remaining tokens that are not alphabetic
tokens = [word for word in tokens if word.isalpha()]
# filter out stop words
stop_words = set(stopwords.words('english'))
tokens = [w for w in tokens if not w in stop_words]
# filter out short tokens
tokens = [word for word in tokens if len(word) > 1]
print(tokens)
```
运行该示例可以提供更清晰的令牌列表
```py
...
'explanation', 'craziness', 'came', 'oh', 'way', 'horror', 'teen', 'slasher', 'flick', 'packaged', 'look', 'way', 'someone', 'apparently', 'assuming', 'genre', 'still', 'hot', 'kids', 'also', 'wrapped', 'production', 'two', 'years', 'ago', 'sitting', 'shelves', 'ever', 'since', 'whatever', 'skip', 'wheres', 'joblo', 'coming', 'nightmare', 'elm', 'street', 'blair', 'witch', 'crow', 'crow', 'salvation', 'lost', 'highway', 'memento', 'others', 'stir', 'echoes']
```
我们可以将它放入一个名为 _clean_doc()_ 的函数中,并在另一个评论中测试它,这次是一个积极的评论。
```py
from nltk.corpus import stopwords
import string
# load doc into memory
def load_doc(filename):
# open the file as read only
file = open(filename, 'r')
# read all text
text = file.read()
# close the file
file.close()
return text
# turn a doc into clean tokens
def clean_doc(doc):
# split into tokens by white space
tokens = doc.split()
# remove punctuation from each token
table = str.maketrans('', '', string.punctuation)
tokens = [w.translate(table) for w in tokens]
# remove remaining tokens that are not alphabetic
tokens = [word for word in tokens if word.isalpha()]
# filter out stop words
stop_words = set(stopwords.words('english'))
tokens = [w for w in tokens if not w in stop_words]
# filter out short tokens
tokens = [word for word in tokens if len(word) > 1]
return tokens
# load the document
filename = 'txt_sentoken/pos/cv000_29590.txt'
text = load_doc(filename)
tokens = clean_doc(text)
print(tokens)
```
同样,清洁程序似乎产生了一组良好的令牌,至少作为第一次切割。
```py
...
'comic', 'oscar', 'winner', 'martin', 'childs', 'shakespeare', 'love', 'production', 'design', 'turns', 'original', 'prague', 'surroundings', 'one', 'creepy', 'place', 'even', 'acting', 'hell', 'solid', 'dreamy', 'depp', 'turning', 'typically', 'strong', 'performance', 'deftly', 'handling', 'british', 'accent', 'ians', 'holm', 'joe', 'goulds', 'secret', 'richardson', 'dalmatians', 'log', 'great', 'supporting', 'roles', 'big', 'surprise', 'graham', 'cringed', 'first', 'time', 'opened', 'mouth', 'imagining', 'attempt', 'irish', 'accent', 'actually', 'wasnt', 'half', 'bad', 'film', 'however', 'good', 'strong', 'violencegore', 'sexuality', 'language', 'drug', 'content']
```
我们可以采取更多的清洁步骤,让我们想象一下。
接下来,让我们看看如何管理一个首选的令牌词汇表。
## 4.培养词汇量
当使用文本的预测模型时,比如词袋模型,存在减小词汇量大小的压力。
词汇量越大,每个单词或文档的表示越稀疏。
为情感分析准备文本的一部分涉及定义和定制模型支持的单词的词汇表。
我们可以通过加载数据集中的所有文档并构建一组单词来完成此操作。我们可能会决定支持所有这些词,或者可能会丢弃一些词。然后可以将最终选择的词汇表保存到文件中供以后使用,例如将来在新文档中过滤单词。
我们可以在[计数器](https://docs.python.org/3/library/collections.html#collections.Counter)中跟踪词汇,这是一个单词及其计数字典,带有一些额外的便利功能。
我们需要开发一个新函数来处理文档并将其添加到词汇表中。该函数需要通过调用先前开发的 _load_doc()_ 函数来加载文档。它需要使用先前开发的 _clean_doc()_ 函数清理加载的文档,然后需要将所有标记添加到 Counter,并更新计数。我们可以通过调用计数器对象上的 _update()_ 函数来完成最后一步。
下面是一个名为 _add_doc_to_vocab()_ 的函数,它将文档文件名和计数器词汇表作为参数。
```py
# load doc and add to vocab
def add_doc_to_vocab(filename, vocab):
# load doc
doc = load_doc(filename)
# clean doc
tokens = clean_doc(doc)
# update counts
vocab.update(tokens)
```
最后,我们可以使用上面的模板处理名为 process_docs()的目录中的所有文档,并将其更新为调用 _add_doc_to_vocab()_。
```py
# load all docs in a directory
def process_docs(directory, vocab):
# walk through all files in the folder
for filename in listdir(directory):
# skip files that do not have the right extension
if not filename.endswith(".txt"):
continue
# create the full path of the file to open
path = directory + '/' + filename
# add doc to vocab
add_doc_to_vocab(path, vocab)
```
我们可以将所有这些放在一起,并从数据集中的所有文档开发完整的词汇表。
```py
from string import punctuation
from os import listdir
from collections import Counter
from nltk.corpus import stopwords
# load doc into memory
def load_doc(filename):
# open the file as read only
file = open(filename, 'r')
# read all text
text = file.read()
# close the file
file.close()
return text
# turn a doc into clean tokens
def clean_doc(doc):
# split into tokens by white space
tokens = doc.split()
# remove punctuation from each token
table = str.maketrans('', '', punctuation)
tokens = [w.translate(table) for w in tokens]
# remove remaining tokens that are not alphabetic
tokens = [word for word in tokens if word.isalpha()]
# filter out stop words
stop_words = set(stopwords.words('english'))
tokens = [w for w in tokens if not w in stop_words]
# filter out short tokens
tokens = [word for word in tokens if len(word) > 1]
return tokens
# load doc and add to vocab
def add_doc_to_vocab(filename, vocab):
# load doc
doc = load_doc(filename)
# clean doc
tokens = clean_doc(doc)
# update counts
vocab.update(tokens)
# load all docs in a directory
def process_docs(directory, vocab):
# walk through all files in the folder
for filename in listdir(directory):
# skip files that do not have the right extension
if not filename.endswith(".txt"):
continue
# create the full path of the file to open
path = directory + '/' + filename
# add doc to vocab
add_doc_to_vocab(path, vocab)
# define vocab
vocab = Counter()
# add all docs to vocab
process_docs('txt_sentoken/neg', vocab)
process_docs('txt_sentoken/pos', vocab)
# print the size of the vocab
print(len(vocab))
# print the top words in the vocab
print(vocab.most_common(50))
```
运行该示例将创建包含数据集中所有文档的词汇表,包括正面和负面评论。
我们可以看到所有评论中有超过 46,000 个独特单词,前 3 个单词是'_ 电影 _',' _one_ '和'_ 电影 _ ”。
```py
46557
[('film', 8860), ('one', 5521), ('movie', 5440), ('like', 3553), ('even', 2555), ('good', 2320), ('time', 2283), ('story', 2118), ('films', 2102), ('would', 2042), ('much', 2024), ('also', 1965), ('characters', 1947), ('get', 1921), ('character', 1906), ('two', 1825), ('first', 1768), ('see', 1730), ('well', 1694), ('way', 1668), ('make', 1590), ('really', 1563), ('little', 1491), ('life', 1472), ('plot', 1451), ('people', 1420), ('movies', 1416), ('could', 1395), ('bad', 1374), ('scene', 1373), ('never', 1364), ('best', 1301), ('new', 1277), ('many', 1268), ('doesnt', 1267), ('man', 1266), ('scenes', 1265), ('dont', 1210), ('know', 1207), ('hes', 1150), ('great', 1141), ('another', 1111), ('love', 1089), ('action', 1078), ('go', 1075), ('us', 1065), ('director', 1056), ('something', 1048), ('end', 1047), ('still', 1038)]
```
也许最不常见的单词,那些仅在所有评论中出现一次的单词,都不具有预测性。也许一些最常见的词也没用。
这些都是好问题,应该用特定的预测模型进行测试。
一般来说,在 2000 条评论中只出现一次或几次的单词可能不具有预测性,可以从词汇表中删除,大大减少了我们需要建模的标记。
我们可以通过单词和它们的计数来执行此操作,并且只保留计数高于所选阈值的计数。这里我们将使用 5 次。
```py
# keep tokens with > 5 occurrence
min_occurane = 5
tokens = [k for k,c in vocab.items() if c >= min_occurane]
print(len(tokens))
```
这将词汇量从 46,557 减少到 14,803 个单词,这是一个巨大的下降。也许至少 5 次发生过于激进;你可以尝试不同的价值观。
然后,我们可以将选择的单词词汇保存到新文件中。我喜欢将词汇表保存为 ASCII,每行一个单词。
下面定义了一个名为 _save_list()_ 的函数来保存项目列表,在这种情况下,标记为文件,每行一个。
```py
def save_list(lines, filename):
data = '\n'.join(lines)
file = open(filename, 'w')
file.write(data)
file.close()
```
下面列出了定义和保存词汇表的完整示例。
```py
from string import punctuation
from os import listdir
from collections import Counter
from nltk.corpus import stopwords
# load doc into memory
def load_doc(filename):
# open the file as read only
file = open(filename, 'r')
# read all text
text = file.read()
# close the file
file.close()
return text
# turn a doc into clean tokens
def clean_doc(doc):
# split into tokens by white space
tokens = doc.split()
# remove punctuation from each token
table = str.maketrans('', '', punctuation)
tokens = [w.translate(table) for w in tokens]
# remove remaining tokens that are not alphabetic
tokens = [word for word in tokens if word.isalpha()]
# filter out stop words
stop_words = set(stopwords.words('english'))
tokens = [w for w in tokens if not w in stop_words]
# filter out short tokens
tokens = [word for word in tokens if len(word) > 1]
return tokens
# load doc and add to vocab
def add_doc_to_vocab(filename, vocab):
# load doc
doc = load_doc(filename)
# clean doc
tokens = clean_doc(doc)
# update counts
vocab.update(tokens)
# load all docs in a directory
def process_docs(directory, vocab):
# walk through all files in the folder
for filename in listdir(directory):
# skip files that do not have the right extension
if not filename.endswith(".txt"):
continue
# create the full path of the file to open
path = directory + '/' + filename
# add doc to vocab
add_doc_to_vocab(path, vocab)
# save list to file
def save_list(lines, filename):
data = '\n'.join(lines)
file = open(filename, 'w')
file.write(data)
file.close()
# define vocab
vocab = Counter()
# add all docs to vocab
process_docs('txt_sentoken/neg', vocab)
process_docs('txt_sentoken/pos', vocab)
# print the size of the vocab
print(len(vocab))
# print the top words in the vocab
print(vocab.most_common(50))
# keep tokens with > 5 occurrence
min_occurane = 5
tokens = [k for k,c in vocab.items() if c >= min_occurane]
print(len(tokens))
# save tokens to a vocabulary file
save_list(tokens, 'vocab.txt')
```
在创建词汇表后运行此最终片段会将所选单词保存到文件中。
最好先查看,甚至研究您选择的词汇表,以便获得更好地准备这些数据或未来文本数据的想法。
```py
hasnt
updating
figuratively
symphony
civilians
might
fisherman
hokum
witch
buffoons
...
```
接下来,我们可以看一下使用词汇表来创建电影评论数据集的准备版本。
## 5.保存准备好的数据
我们可以使用数据清理和选择的词汇表来准备每个电影评论,并保存准备好的评论版本以备建模。
这是一个很好的做法,因为它将数据准备与建模分离,如果您有新想法,则可以专注于建模并循环回数据准备。
我们可以从' _vocab.txt_ '加载词汇开始。
```py
# load doc into memory
def load_doc(filename):
# open the file as read only
file = open(filename, 'r')
# read all text
text = file.read()
# close the file
file.close()
return text
# load vocabulary
vocab_filename = 'review_polarity/vocab.txt'
vocab = load_doc(vocab_filename)
vocab = vocab.split()
vocab = set(vocab)
```
接下来,我们可以清理评论,使用加载的词汇来过滤掉不需要的令牌,并将干净的评论保存在新文件中。
一种方法可以是将所有正面评论保存在一个文件中,将所有负面评论保存在另一个文件中,将过滤后的标记用空格分隔,以便在单独的行上进行每次评审。
首先,我们可以定义一个函数来处理文档,清理它,过滤它,然后将它作为可以保存在文件中的单行返回。下面定义 _doc_to_line()_ 函数,将文件名和词汇(作为一组)作为参数。
它调用先前定义的 _load_doc()_ 函数来加载文档,调用 _clean_doc()_ 来标记文档。
```py
# load doc, clean and return line of tokens
def doc_to_line(filename, vocab):
# load the doc
doc = load_doc(filename)
# clean doc
tokens = clean_doc(doc)
# filter by vocab
tokens = [w for w in tokens if w in vocab]
return ' '.join(tokens)
```
接下来,我们可以定义新版本的 _process_docs()_ 来逐步浏览文件夹中的所有评论,并通过为每个文档调用 _doc_to_line()_ 将它们转换为行。然后返回行列表。
```py
# load all docs in a directory
def process_docs(directory, vocab):
lines = list()
# walk through all files in the folder
for filename in listdir(directory):
# skip files that do not have the right extension
if not filename.endswith(".txt"):
continue
# create the full path of the file to open
path = directory + '/' + filename
# load and clean the doc
line = doc_to_line(path, vocab)
# add to list
lines.append(line)
return lines
```
然后我们可以为正面和负面评论的目录调用 _process_docs()_,然后从上一节调用 _save_list()_ 将每个处理过的评论列表保存到文件中。
完整的代码清单如下。
```py
from string import punctuation
from os import listdir
from collections import Counter
from nltk.corpus import stopwords
# load doc into memory
def load_doc(filename):
# open the file as read only
file = open(filename, 'r')
# read all text
text = file.read()
# close the file
file.close()
return text
# turn a doc into clean tokens
def clean_doc(doc):
# split into tokens by white space
tokens = doc.split()
# remove punctuation from each token
table = str.maketrans('', '', punctuation)
tokens = [w.translate(table) for w in tokens]
# remove remaining tokens that are not alphabetic
tokens = [word for word in tokens if word.isalpha()]
# filter out stop words
stop_words = set(stopwords.words('english'))
tokens = [w for w in tokens if not w in stop_words]
# filter out short tokens
tokens = [word for word in tokens if len(word) > 1]
return tokens
# save list to file
def save_list(lines, filename):
data = '\n'.join(lines)
file = open(filename, 'w')
file.write(data)
file.close()
# load doc, clean and return line of tokens
def doc_to_line(filename, vocab):
# load the doc
doc = load_doc(filename)
# clean doc
tokens = clean_doc(doc)
# filter by vocab
tokens = [w for w in tokens if w in vocab]
return ' '.join(tokens)
# load all docs in a directory
def process_docs(directory, vocab):
lines = list()
# walk through all files in the folder
for filename in listdir(directory):
# skip files that do not have the right extension
if not filename.endswith(".txt"):
continue
# create the full path of the file to open
path = directory + '/' + filename
# load and clean the doc
line = doc_to_line(path, vocab)
# add to list
lines.append(line)
return lines
# load vocabulary
vocab_filename = 'vocab.txt'
vocab = load_doc(vocab_filename)
vocab = vocab.split()
vocab = set(vocab)
# prepare negative reviews
negative_lines = process_docs('txt_sentoken/neg', vocab)
save_list(negative_lines, 'negative.txt')
# prepare positive reviews
positive_lines = process_docs('txt_sentoken/pos', vocab)
save_list(positive_lines, 'positive.txt')
```
运行该示例将保存两个新文件,' _negative.txt_ '和' _positive.txt_ ',分别包含准备好的负面和正面评论。
数据已准备好用于单词包甚至单词嵌入模型。
## 扩展
本节列出了您可能希望探索的一些扩展。
* **Stemming** 。我们可以使用像 Porter stemmer 这样的词干算法将文档中的每个单词减少到它们的词干。
* **N-Grams** 。我们可以使用词汇对词汇,而不是处理单个词汇。我们还可以研究使用更大的群体,例如三胞胎(三卦)和更多(n-gram)。
* **编码字**。我们可以保存单词的整数编码,而不是按原样保存标记,其中词汇表中单词的索引表示单词的唯一整数。这将使建模时更容易处理数据。
* **编码文件**。我们可以使用词袋模型对文档进行编码,并将每个单词编码为布尔存在/不存在标记或使用更复杂的评分,例如 TF-IDF,而不是在文档中保存标记。
如果你尝试任何这些扩展,我很想知道。
在下面的评论中分享您的结果。
## 进一步阅读
如果您要深入了解,本节将提供有关该主题的更多资源。
### 数据集
* [电影评论数据](http://www.cs.cornell.edu/people/pabo/movie-review-data/)
* [一种感伤教育:基于最小削减的主观性总结的情感分析](http://xxx.lanl.gov/abs/cs/0409058),2004。
* [电影评论 Polarity Dataset](http://www.cs.cornell.edu/people/pabo/movie-review-data/review_polarity.tar.gz) (。tgz)
* 数据集自述文件 [v2.0](http://www.cs.cornell.edu/people/pabo/movie-review-data/poldata.README.2.0.txt) 和 [v1.1](http://www.cs.cornell.edu/people/pabo/movie-review-data/README.1.1) 。
### 蜜蜂
* [nltk.tokenize 包 API](http://www.nltk.org/api/nltk.tokenize.html)
* [第 2 章,访问文本语料库和词汇资源](http://www.nltk.org/book/ch02.html)
* [os API 其他操作系统接口](https://docs.python.org/3/library/os.html)
* [集合 API - 容器数据类型](https://docs.python.org/3/library/collections.html)
## 摘要
在本教程中,您逐步了解了如何为情感分析准备电影评论文本数据。
具体来说,你学到了:
* 如何加载文本数据并清除它以删除标点符号和其他非单词。
* 如何开发词汇表,定制它并将其保存到文件中。
* 如何使用清洁和预定义词汇表准备电影评论,并将其保存到准备建模的新文件中。
你有任何问题吗?
在下面的评论中提出您的问题,我会尽力回答。 | {
"pile_set_name": "Github"
} |
{
"forge_marker": 1,
"defaults": {
"model": "mca:rose_gold_block"
},
"variants": {
"normal": [{}],
"inventory": [{}]
}
} | {
"pile_set_name": "Github"
} |
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
namespace Microsoft.Intune.PowerShellGraphSDK.PowerShellCmdlets
{
using System.Management.Automation;
/// <summary>
/// <para type="synopsis">Retrieves "microsoft.graph.managedDevice" objects.</para>
/// <para type="description">Retrieves "microsoft.graph.managedDevice" objects in the "managedDevices" collection.</para>
/// <para type="description">The devices that have the discovered application installed</para>
/// <para type="description">Graph call: GET ~/deviceManagement/detectedApps/{detectedAppId}/managedDevices</para>
/// </summary>
/// <para type="link" uri="https://github.com/Microsoft/Intune-PowerShell-SDK">GitHub Repository</para>
[Cmdlet("Get", "DeviceManagement_DetectedApps_ManagedDevices", DefaultParameterSetName = @"Search")]
[ODataType("microsoft.graph.managedDevice")]
[ResourceTypePropertyName("managedDeviceODataType")]
[Alias("Get-IntuneDetectedAppDevice")]
public class Get_DeviceManagement_DetectedApps_ManagedDevices : GetOrSearchCmdlet
{
/// <summary>
/// <para type="description">A required ID for referencing a "microsoft.graph.detectedApp" object in the "detectedApps" collection.</para>
/// </summary>
[Selectable]
[Expandable]
[IdParameter]
[ValidateNotNullOrEmpty]
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"A required ID for referencing a "microsoft.graph.detectedApp" object in the "detectedApps" collection.")]
public System.String detectedAppId { get; set; }
/// <summary>
/// <para type="description">The ID for a "microsoft.graph.managedDevice" object in the "managedDevices" collection.</para>
/// </summary>
[Selectable]
[Expandable]
[IdParameter]
[ResourceIdParameter]
[ValidateNotNullOrEmpty]
[Parameter(ParameterSetName = @"Get", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"The ID for a "microsoft.graph.managedDevice" object in the "managedDevices" collection.")]
public System.String managedDeviceId { get; set; }
/// <summary>
/// <para type="description">The "userId" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Unique Identifier for the user associated with the device</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String userId { get; set; }
/// <summary>
/// <para type="description">The "deviceName" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Name of the device</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String deviceName { get; set; }
/// <summary>
/// <para type="description">The "managedDeviceOwnerType" property, of type "microsoft.graph.managedDeviceOwnerType".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Ownership of the device. Can be 'company' or 'personal'</para>
/// </summary>
[ODataType("microsoft.graph.managedDeviceOwnerType")]
[Selectable]
[Sortable]
public System.String managedDeviceOwnerType { get; set; }
/// <summary>
/// <para type="description">The "deviceActionResults" property, of type "microsoft.graph.deviceActionResult".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">List of ComplexType deviceActionResult objects.</para>
/// </summary>
[ODataType("microsoft.graph.deviceActionResult", "microsoft.graph.resetPasscodeActionResult", "microsoft.graph.remoteLockActionResult", "microsoft.graph.locateDeviceActionResult", "microsoft.graph.deleteUserFromSharedAppleDeviceActionResult", "microsoft.graph.windowsDefenderScanActionResult")]
[Selectable]
public System.Object[] deviceActionResults { get; set; }
/// <summary>
/// <para type="description">The "enrolledDateTime" property, of type "Edm.DateTimeOffset".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Enrollment time of the device.</para>
/// </summary>
[ODataType("Edm.DateTimeOffset")]
[Selectable]
[Sortable]
public System.DateTimeOffset enrolledDateTime { get; set; }
/// <summary>
/// <para type="description">The "lastSyncDateTime" property, of type "Edm.DateTimeOffset".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">The date and time that the device last completed a successful sync with Intune.</para>
/// </summary>
[ODataType("Edm.DateTimeOffset")]
[Selectable]
[Sortable]
public System.DateTimeOffset lastSyncDateTime { get; set; }
/// <summary>
/// <para type="description">The "operatingSystem" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Operating system of the device. Windows, iOS, etc.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String operatingSystem { get; set; }
/// <summary>
/// <para type="description">The "complianceState" property, of type "microsoft.graph.complianceState".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Compliance state of the device.</para>
/// </summary>
[ODataType("microsoft.graph.complianceState")]
[Selectable]
[Sortable]
public System.String complianceState { get; set; }
/// <summary>
/// <para type="description">The "jailBroken" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">whether the device is jail broken or rooted.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String jailBroken { get; set; }
/// <summary>
/// <para type="description">The "managementAgent" property, of type "microsoft.graph.managementAgentType".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Management channel of the device. Intune, EAS, etc.</para>
/// </summary>
[ODataType("microsoft.graph.managementAgentType")]
[Selectable]
[Sortable]
public System.String managementAgent { get; set; }
/// <summary>
/// <para type="description">The "osVersion" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Operating system version of the device.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String osVersion { get; set; }
/// <summary>
/// <para type="description">The "easActivated" property, of type "Edm.Boolean".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Whether the device is Exchange ActiveSync activated.</para>
/// </summary>
[ODataType("Edm.Boolean")]
[Selectable]
[Sortable]
public System.Boolean easActivated { get; set; }
/// <summary>
/// <para type="description">The "easDeviceId" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Exchange ActiveSync Id of the device.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String easDeviceId { get; set; }
/// <summary>
/// <para type="description">The "easActivationDateTime" property, of type "Edm.DateTimeOffset".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Exchange ActivationSync activation time of the device.</para>
/// </summary>
[ODataType("Edm.DateTimeOffset")]
[Selectable]
[Sortable]
public System.DateTimeOffset easActivationDateTime { get; set; }
/// <summary>
/// <para type="description">The "azureADRegistered" property, of type "Edm.Boolean".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Whether the device is Azure Active Directory registered.</para>
/// </summary>
[ODataType("Edm.Boolean")]
[Selectable]
[Sortable]
public System.Boolean azureADRegistered { get; set; }
/// <summary>
/// <para type="description">The "deviceEnrollmentType" property, of type "microsoft.graph.deviceEnrollmentType".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Enrollment type of the device.</para>
/// </summary>
[ODataType("microsoft.graph.deviceEnrollmentType")]
[Selectable]
[Sortable]
public System.String deviceEnrollmentType { get; set; }
/// <summary>
/// <para type="description">The "activationLockBypassCode" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Code that allows the Activation Lock on a device to be bypassed.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String activationLockBypassCode { get; set; }
/// <summary>
/// <para type="description">The "emailAddress" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Email(s) for the user associated with the device</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String emailAddress { get; set; }
/// <summary>
/// <para type="description">The "azureADDeviceId" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">The unique identifier for the Azure Active Directory device. Read only.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String azureADDeviceId { get; set; }
/// <summary>
/// <para type="description">The "deviceRegistrationState" property, of type "microsoft.graph.deviceRegistrationState".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Device registration state.</para>
/// </summary>
[ODataType("microsoft.graph.deviceRegistrationState")]
[Selectable]
[Sortable]
public System.String deviceRegistrationState { get; set; }
/// <summary>
/// <para type="description">The "deviceCategoryDisplayName" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Device category display name</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String deviceCategoryDisplayName { get; set; }
/// <summary>
/// <para type="description">The "isSupervised" property, of type "Edm.Boolean".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Device supervised status</para>
/// </summary>
[ODataType("Edm.Boolean")]
[Selectable]
[Sortable]
public System.Boolean isSupervised { get; set; }
/// <summary>
/// <para type="description">The "exchangeLastSuccessfulSyncDateTime" property, of type "Edm.DateTimeOffset".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Last time the device contacted Exchange.</para>
/// </summary>
[ODataType("Edm.DateTimeOffset")]
[Selectable]
[Sortable]
public System.DateTimeOffset exchangeLastSuccessfulSyncDateTime { get; set; }
/// <summary>
/// <para type="description">The "exchangeAccessState" property, of type "microsoft.graph.deviceManagementExchangeAccessState".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">The Access State of the device in Exchange.</para>
/// </summary>
[ODataType("microsoft.graph.deviceManagementExchangeAccessState")]
[Selectable]
[Sortable]
public System.String exchangeAccessState { get; set; }
/// <summary>
/// <para type="description">The "exchangeAccessStateReason" property, of type "microsoft.graph.deviceManagementExchangeAccessStateReason".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">The reason for the device's access state in Exchange.</para>
/// </summary>
[ODataType("microsoft.graph.deviceManagementExchangeAccessStateReason")]
[Selectable]
[Sortable]
public System.String exchangeAccessStateReason { get; set; }
/// <summary>
/// <para type="description">The "remoteAssistanceSessionUrl" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Url that allows a Remote Assistance session to be established with the device.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String remoteAssistanceSessionUrl { get; set; }
/// <summary>
/// <para type="description">The "remoteAssistanceSessionErrorDetails" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">An error string that identifies issues when creating Remote Assistance session objects.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String remoteAssistanceSessionErrorDetails { get; set; }
/// <summary>
/// <para type="description">The "isEncrypted" property, of type "Edm.Boolean".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Device encryption status</para>
/// </summary>
[ODataType("Edm.Boolean")]
[Selectable]
[Sortable]
public System.Boolean isEncrypted { get; set; }
/// <summary>
/// <para type="description">The "userPrincipalName" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Device user principal name</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String userPrincipalName { get; set; }
/// <summary>
/// <para type="description">The "model" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Model of the device</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String model { get; set; }
/// <summary>
/// <para type="description">The "manufacturer" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Manufacturer of the device</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String manufacturer { get; set; }
/// <summary>
/// <para type="description">The "imei" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">IMEI</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String imei { get; set; }
/// <summary>
/// <para type="description">The "complianceGracePeriodExpirationDateTime" property, of type "Edm.DateTimeOffset".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">The DateTime when device compliance grace period expires</para>
/// </summary>
[ODataType("Edm.DateTimeOffset")]
[Selectable]
[Sortable]
public System.DateTimeOffset complianceGracePeriodExpirationDateTime { get; set; }
/// <summary>
/// <para type="description">The "serialNumber" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">SerialNumber</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String serialNumber { get; set; }
/// <summary>
/// <para type="description">The "phoneNumber" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Phone number of the device</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String phoneNumber { get; set; }
/// <summary>
/// <para type="description">The "androidSecurityPatchLevel" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Android security patch level</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String androidSecurityPatchLevel { get; set; }
/// <summary>
/// <para type="description">The "userDisplayName" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">User display name</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String userDisplayName { get; set; }
/// <summary>
/// <para type="description">The "configurationManagerClientEnabledFeatures" property, of type "microsoft.graph.configurationManagerClientEnabledFeatures".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">ConfigrMgr client enabled features</para>
/// </summary>
[ODataType("microsoft.graph.configurationManagerClientEnabledFeatures")]
[Selectable]
[Sortable]
public System.Object configurationManagerClientEnabledFeatures { get; set; }
/// <summary>
/// <para type="description">The "wiFiMacAddress" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Wi-Fi MAC</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String wiFiMacAddress { get; set; }
/// <summary>
/// <para type="description">The "deviceHealthAttestationState" property, of type "microsoft.graph.deviceHealthAttestationState".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">The device health attestation state.</para>
/// </summary>
[ODataType("microsoft.graph.deviceHealthAttestationState")]
[Selectable]
[Sortable]
public System.Object deviceHealthAttestationState { get; set; }
/// <summary>
/// <para type="description">The "subscriberCarrier" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Subscriber Carrier</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String subscriberCarrier { get; set; }
/// <summary>
/// <para type="description">The "meid" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">MEID</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String meid { get; set; }
/// <summary>
/// <para type="description">The "totalStorageSpaceInBytes" property, of type "Edm.Int64".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Total Storage in Bytes</para>
/// </summary>
[ODataType("Edm.Int64")]
[Selectable]
[Sortable]
public System.Int64 totalStorageSpaceInBytes { get; set; }
/// <summary>
/// <para type="description">The "freeStorageSpaceInBytes" property, of type "Edm.Int64".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Free Storage in Bytes</para>
/// </summary>
[ODataType("Edm.Int64")]
[Selectable]
[Sortable]
public System.Int64 freeStorageSpaceInBytes { get; set; }
/// <summary>
/// <para type="description">The "managedDeviceName" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Automatically generated name to identify a device. Can be overwritten to a user friendly name.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String managedDeviceName { get; set; }
/// <summary>
/// <para type="description">The "partnerReportedThreatState" property, of type "microsoft.graph.managedDevicePartnerReportedHealthState".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Indicates the threat state of a device when a Mobile Threat Defense partner is in use by the account and device. Read Only.</para>
/// </summary>
[ODataType("microsoft.graph.managedDevicePartnerReportedHealthState")]
[Selectable]
[Sortable]
public System.String partnerReportedThreatState { get; set; }
/// <summary>
/// <para type="description">The "deviceConfigurationStates" property, of type "microsoft.graph.deviceConfigurationState".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Device configuration states for this device.</para>
/// </summary>
[ODataType("microsoft.graph.deviceConfigurationState")]
[Selectable]
[Expandable]
public System.Object[] deviceConfigurationStates { get; set; }
/// <summary>
/// <para type="description">The "deviceCategory" property, of type "microsoft.graph.deviceCategory".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Device category</para>
/// </summary>
[ODataType("microsoft.graph.deviceCategory")]
[Selectable]
[Expandable]
[Sortable]
public System.Object deviceCategory { get; set; }
/// <summary>
/// <para type="description">The "deviceCompliancePolicyStates" property, of type "microsoft.graph.deviceCompliancePolicyState".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Device compliance policy states for this device.</para>
/// </summary>
[ODataType("microsoft.graph.deviceCompliancePolicyState")]
[Selectable]
[Expandable]
public System.Object[] deviceCompliancePolicyStates { get; set; }
internal override System.String GetResourcePath()
{
return $"deviceManagement/detectedApps/{detectedAppId}/managedDevices/{managedDeviceId ?? string.Empty}";
}
}
/// <summary>
/// <para type="synopsis">Retrieves "microsoft.graph.managedDevice" object references.</para>
/// <para type="description">Retrieves "microsoft.graph.managedDevice" object references in the "managedDevices" collection.</para>
/// <para type="description">The devices that have the discovered application installed</para>
/// <para type="description">Graph call: GET ~/deviceManagement/detectedApps/{detectedAppId}/managedDevices/$ref</para>
/// </summary>
/// <para type="link" uri="https://github.com/Microsoft/Intune-PowerShell-SDK">GitHub Repository</para>
[Cmdlet("Get", "DeviceManagement_DetectedApps_ManagedDevicesReferences", DefaultParameterSetName = @"Search")]
[ODataType("microsoft.graph.managedDevice")]
[ResourceTypePropertyName("managedDeviceODataType")]
[Alias("Get-IntuneDetectedAppDeviceReferenceSet")]
public class Get_DeviceManagement_DetectedApps_ManagedDevicesReferences : GetOrSearchCmdlet
{
/// <summary>
/// <para type="description">A required ID for referencing a "microsoft.graph.detectedApp" object in the "detectedApps" collection.</para>
/// </summary>
[Selectable]
[Expandable]
[IdParameter]
[ValidateNotNullOrEmpty]
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"A required ID for referencing a "microsoft.graph.detectedApp" object in the "detectedApps" collection.")]
public System.String detectedAppId { get; set; }
/// <summary>
/// <para type="description">The ID for a "microsoft.graph.managedDevice" object in the "managedDevices" collection.</para>
/// </summary>
[Selectable]
[Expandable]
[IdParameter]
[ResourceIdParameter]
[ValidateNotNullOrEmpty]
[Parameter(ParameterSetName = @"Get", Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"The ID for a "microsoft.graph.managedDevice" object in the "managedDevices" collection.")]
public System.String managedDeviceId { get; set; }
/// <summary>
/// <para type="description">The "userId" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Unique Identifier for the user associated with the device</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String userId { get; set; }
/// <summary>
/// <para type="description">The "deviceName" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Name of the device</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String deviceName { get; set; }
/// <summary>
/// <para type="description">The "managedDeviceOwnerType" property, of type "microsoft.graph.managedDeviceOwnerType".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Ownership of the device. Can be 'company' or 'personal'</para>
/// </summary>
[ODataType("microsoft.graph.managedDeviceOwnerType")]
[Selectable]
[Sortable]
public System.String managedDeviceOwnerType { get; set; }
/// <summary>
/// <para type="description">The "deviceActionResults" property, of type "microsoft.graph.deviceActionResult".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">List of ComplexType deviceActionResult objects.</para>
/// </summary>
[ODataType("microsoft.graph.deviceActionResult", "microsoft.graph.resetPasscodeActionResult", "microsoft.graph.remoteLockActionResult", "microsoft.graph.locateDeviceActionResult", "microsoft.graph.deleteUserFromSharedAppleDeviceActionResult", "microsoft.graph.windowsDefenderScanActionResult")]
[Selectable]
public System.Object[] deviceActionResults { get; set; }
/// <summary>
/// <para type="description">The "enrolledDateTime" property, of type "Edm.DateTimeOffset".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Enrollment time of the device.</para>
/// </summary>
[ODataType("Edm.DateTimeOffset")]
[Selectable]
[Sortable]
public System.DateTimeOffset enrolledDateTime { get; set; }
/// <summary>
/// <para type="description">The "lastSyncDateTime" property, of type "Edm.DateTimeOffset".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">The date and time that the device last completed a successful sync with Intune.</para>
/// </summary>
[ODataType("Edm.DateTimeOffset")]
[Selectable]
[Sortable]
public System.DateTimeOffset lastSyncDateTime { get; set; }
/// <summary>
/// <para type="description">The "operatingSystem" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Operating system of the device. Windows, iOS, etc.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String operatingSystem { get; set; }
/// <summary>
/// <para type="description">The "complianceState" property, of type "microsoft.graph.complianceState".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Compliance state of the device.</para>
/// </summary>
[ODataType("microsoft.graph.complianceState")]
[Selectable]
[Sortable]
public System.String complianceState { get; set; }
/// <summary>
/// <para type="description">The "jailBroken" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">whether the device is jail broken or rooted.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String jailBroken { get; set; }
/// <summary>
/// <para type="description">The "managementAgent" property, of type "microsoft.graph.managementAgentType".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Management channel of the device. Intune, EAS, etc.</para>
/// </summary>
[ODataType("microsoft.graph.managementAgentType")]
[Selectable]
[Sortable]
public System.String managementAgent { get; set; }
/// <summary>
/// <para type="description">The "osVersion" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Operating system version of the device.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String osVersion { get; set; }
/// <summary>
/// <para type="description">The "easActivated" property, of type "Edm.Boolean".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Whether the device is Exchange ActiveSync activated.</para>
/// </summary>
[ODataType("Edm.Boolean")]
[Selectable]
[Sortable]
public System.Boolean easActivated { get; set; }
/// <summary>
/// <para type="description">The "easDeviceId" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Exchange ActiveSync Id of the device.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String easDeviceId { get; set; }
/// <summary>
/// <para type="description">The "easActivationDateTime" property, of type "Edm.DateTimeOffset".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Exchange ActivationSync activation time of the device.</para>
/// </summary>
[ODataType("Edm.DateTimeOffset")]
[Selectable]
[Sortable]
public System.DateTimeOffset easActivationDateTime { get; set; }
/// <summary>
/// <para type="description">The "azureADRegistered" property, of type "Edm.Boolean".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Whether the device is Azure Active Directory registered.</para>
/// </summary>
[ODataType("Edm.Boolean")]
[Selectable]
[Sortable]
public System.Boolean azureADRegistered { get; set; }
/// <summary>
/// <para type="description">The "deviceEnrollmentType" property, of type "microsoft.graph.deviceEnrollmentType".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Enrollment type of the device.</para>
/// </summary>
[ODataType("microsoft.graph.deviceEnrollmentType")]
[Selectable]
[Sortable]
public System.String deviceEnrollmentType { get; set; }
/// <summary>
/// <para type="description">The "activationLockBypassCode" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Code that allows the Activation Lock on a device to be bypassed.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String activationLockBypassCode { get; set; }
/// <summary>
/// <para type="description">The "emailAddress" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Email(s) for the user associated with the device</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String emailAddress { get; set; }
/// <summary>
/// <para type="description">The "azureADDeviceId" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">The unique identifier for the Azure Active Directory device. Read only.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String azureADDeviceId { get; set; }
/// <summary>
/// <para type="description">The "deviceRegistrationState" property, of type "microsoft.graph.deviceRegistrationState".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Device registration state.</para>
/// </summary>
[ODataType("microsoft.graph.deviceRegistrationState")]
[Selectable]
[Sortable]
public System.String deviceRegistrationState { get; set; }
/// <summary>
/// <para type="description">The "deviceCategoryDisplayName" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Device category display name</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String deviceCategoryDisplayName { get; set; }
/// <summary>
/// <para type="description">The "isSupervised" property, of type "Edm.Boolean".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Device supervised status</para>
/// </summary>
[ODataType("Edm.Boolean")]
[Selectable]
[Sortable]
public System.Boolean isSupervised { get; set; }
/// <summary>
/// <para type="description">The "exchangeLastSuccessfulSyncDateTime" property, of type "Edm.DateTimeOffset".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Last time the device contacted Exchange.</para>
/// </summary>
[ODataType("Edm.DateTimeOffset")]
[Selectable]
[Sortable]
public System.DateTimeOffset exchangeLastSuccessfulSyncDateTime { get; set; }
/// <summary>
/// <para type="description">The "exchangeAccessState" property, of type "microsoft.graph.deviceManagementExchangeAccessState".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">The Access State of the device in Exchange.</para>
/// </summary>
[ODataType("microsoft.graph.deviceManagementExchangeAccessState")]
[Selectable]
[Sortable]
public System.String exchangeAccessState { get; set; }
/// <summary>
/// <para type="description">The "exchangeAccessStateReason" property, of type "microsoft.graph.deviceManagementExchangeAccessStateReason".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">The reason for the device's access state in Exchange.</para>
/// </summary>
[ODataType("microsoft.graph.deviceManagementExchangeAccessStateReason")]
[Selectable]
[Sortable]
public System.String exchangeAccessStateReason { get; set; }
/// <summary>
/// <para type="description">The "remoteAssistanceSessionUrl" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Url that allows a Remote Assistance session to be established with the device.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String remoteAssistanceSessionUrl { get; set; }
/// <summary>
/// <para type="description">The "remoteAssistanceSessionErrorDetails" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">An error string that identifies issues when creating Remote Assistance session objects.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String remoteAssistanceSessionErrorDetails { get; set; }
/// <summary>
/// <para type="description">The "isEncrypted" property, of type "Edm.Boolean".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Device encryption status</para>
/// </summary>
[ODataType("Edm.Boolean")]
[Selectable]
[Sortable]
public System.Boolean isEncrypted { get; set; }
/// <summary>
/// <para type="description">The "userPrincipalName" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Device user principal name</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String userPrincipalName { get; set; }
/// <summary>
/// <para type="description">The "model" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Model of the device</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String model { get; set; }
/// <summary>
/// <para type="description">The "manufacturer" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Manufacturer of the device</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String manufacturer { get; set; }
/// <summary>
/// <para type="description">The "imei" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">IMEI</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String imei { get; set; }
/// <summary>
/// <para type="description">The "complianceGracePeriodExpirationDateTime" property, of type "Edm.DateTimeOffset".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">The DateTime when device compliance grace period expires</para>
/// </summary>
[ODataType("Edm.DateTimeOffset")]
[Selectable]
[Sortable]
public System.DateTimeOffset complianceGracePeriodExpirationDateTime { get; set; }
/// <summary>
/// <para type="description">The "serialNumber" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">SerialNumber</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String serialNumber { get; set; }
/// <summary>
/// <para type="description">The "phoneNumber" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Phone number of the device</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String phoneNumber { get; set; }
/// <summary>
/// <para type="description">The "androidSecurityPatchLevel" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Android security patch level</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String androidSecurityPatchLevel { get; set; }
/// <summary>
/// <para type="description">The "userDisplayName" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">User display name</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String userDisplayName { get; set; }
/// <summary>
/// <para type="description">The "configurationManagerClientEnabledFeatures" property, of type "microsoft.graph.configurationManagerClientEnabledFeatures".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">ConfigrMgr client enabled features</para>
/// </summary>
[ODataType("microsoft.graph.configurationManagerClientEnabledFeatures")]
[Selectable]
[Sortable]
public System.Object configurationManagerClientEnabledFeatures { get; set; }
/// <summary>
/// <para type="description">The "wiFiMacAddress" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Wi-Fi MAC</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String wiFiMacAddress { get; set; }
/// <summary>
/// <para type="description">The "deviceHealthAttestationState" property, of type "microsoft.graph.deviceHealthAttestationState".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">The device health attestation state.</para>
/// </summary>
[ODataType("microsoft.graph.deviceHealthAttestationState")]
[Selectable]
[Sortable]
public System.Object deviceHealthAttestationState { get; set; }
/// <summary>
/// <para type="description">The "subscriberCarrier" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Subscriber Carrier</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String subscriberCarrier { get; set; }
/// <summary>
/// <para type="description">The "meid" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">MEID</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String meid { get; set; }
/// <summary>
/// <para type="description">The "totalStorageSpaceInBytes" property, of type "Edm.Int64".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Total Storage in Bytes</para>
/// </summary>
[ODataType("Edm.Int64")]
[Selectable]
[Sortable]
public System.Int64 totalStorageSpaceInBytes { get; set; }
/// <summary>
/// <para type="description">The "freeStorageSpaceInBytes" property, of type "Edm.Int64".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Free Storage in Bytes</para>
/// </summary>
[ODataType("Edm.Int64")]
[Selectable]
[Sortable]
public System.Int64 freeStorageSpaceInBytes { get; set; }
/// <summary>
/// <para type="description">The "managedDeviceName" property, of type "Edm.String".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Automatically generated name to identify a device. Can be overwritten to a user friendly name.</para>
/// </summary>
[ODataType("Edm.String")]
[Selectable]
[Sortable]
public System.String managedDeviceName { get; set; }
/// <summary>
/// <para type="description">The "partnerReportedThreatState" property, of type "microsoft.graph.managedDevicePartnerReportedHealthState".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Indicates the threat state of a device when a Mobile Threat Defense partner is in use by the account and device. Read Only.</para>
/// </summary>
[ODataType("microsoft.graph.managedDevicePartnerReportedHealthState")]
[Selectable]
[Sortable]
public System.String partnerReportedThreatState { get; set; }
/// <summary>
/// <para type="description">The "deviceConfigurationStates" property, of type "microsoft.graph.deviceConfigurationState".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Device configuration states for this device.</para>
/// </summary>
[ODataType("microsoft.graph.deviceConfigurationState")]
[Selectable]
[Expandable]
public System.Object[] deviceConfigurationStates { get; set; }
/// <summary>
/// <para type="description">The "deviceCategory" property, of type "microsoft.graph.deviceCategory".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Device category</para>
/// </summary>
[ODataType("microsoft.graph.deviceCategory")]
[Selectable]
[Expandable]
[Sortable]
public System.Object deviceCategory { get; set; }
/// <summary>
/// <para type="description">The "deviceCompliancePolicyStates" property, of type "microsoft.graph.deviceCompliancePolicyState".</para>
/// <para type="description">This property is on the "microsoft.graph.managedDevice" type.</para>
/// <para type="description">Device compliance policy states for this device.</para>
/// </summary>
[ODataType("microsoft.graph.deviceCompliancePolicyState")]
[Selectable]
[Expandable]
public System.Object[] deviceCompliancePolicyStates { get; set; }
internal override System.String GetResourcePath()
{
return $"deviceManagement/detectedApps/{detectedAppId}/managedDevices/{managedDeviceId ?? string.Empty}/$ref";
}
}
/// <summary>
/// <para type="synopsis">Creates a reference from a "detectedApp" to a "microsoft.graph.managedDevice" object.</para>
/// <para type="description">Creates a reference from the specified "detectedApp" object to a "managedDevice".</para>
/// <para type="description">The devices that have the discovered application installed</para>
/// <para type="description">Graph Call: POST ~/deviceManagement/detectedApps/{detectedAppId}/managedDevices/$ref</para>
/// </summary>
/// <para type="link" uri="https://github.com/Microsoft/Intune-PowerShell-SDK">GitHub Repository</para>
[Cmdlet("New", "DeviceManagement_DetectedApps_ManagedDevicesReferences", ConfirmImpact = ConfirmImpact.Low)]
[ODataType("microsoft.graph.managedDevice")]
[ResourceTypePropertyName("managedDeviceODataType")]
[Alias("New-IntuneDetectedAppDeviceReferenceSet")]
public class New_DeviceManagement_DetectedApps_ManagedDevicesReferences : PostReferenceToCollectionCmdlet
{
/// <summary>
/// <para type="description">The ID for a "microsoft.graph.managedDevice" object in the "managedDevices" collection.</para>
/// </summary>
[Selectable]
[Expandable]
[IdParameter]
[ResourceIdParameter]
public System.String managedDeviceId { get; set; }
/// <summary>
/// <para type="description">A required ID for referencing a "microsoft.graph.detectedApp" object in the "detectedApps" collection.</para>
/// </summary>
[Selectable]
[Expandable]
[IdParameter]
[ValidateNotNullOrEmpty]
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"A required ID for referencing a "microsoft.graph.detectedApp" object in the "detectedApps" collection.")]
public System.String detectedAppId { get; set; }
/// <summary>
/// <para type="description">The URL which should be used to access a "microsoft.graph.managedDevice" object.</para>
/// </summary>
[Selectable]
[Expandable]
[ValidateNotNullOrEmpty]
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"The URL which should be used to access a "microsoft.graph.managedDevice" object.")]
public System.String managedDeviceReferenceUrl { get; set; }
internal override System.String GetResourcePath()
{
return $"deviceManagement/detectedApps/{detectedAppId}/managedDevices/{managedDeviceId}/$ref";
}
internal override System.Object GetContent()
{
return this.GetReferenceRequestContent(managedDeviceReferenceUrl);
}
}
/// <summary>
/// <para type="synopsis">Removes a reference from a "detectedApp" to a "microsoft.graph.managedDevice" object.</para>
/// <para type="description">Removes a reference from the specified "detectedApp" object to a "managedDevice".</para>
/// <para type="description">The devices that have the discovered application installed</para>
/// <para type="description">Graph Call: DELETE ~/deviceManagement/detectedApps/{detectedAppId}/managedDevices/managedDeviceId/$ref</para>
/// </summary>
/// <para type="link" uri="https://github.com/Microsoft/Intune-PowerShell-SDK">GitHub Repository</para>
[Cmdlet("Remove", "DeviceManagement_DetectedApps_ManagedDevicesReferences", ConfirmImpact = ConfirmImpact.High)]
[ODataType("microsoft.graph.managedDevice")]
[ResourceTypePropertyName("managedDeviceODataType")]
[Alias("Remove-IntuneDetectedAppDeviceReferenceSet")]
public class Remove_DeviceManagement_DetectedApps_ManagedDevicesReferences : DeleteCmdlet
{
/// <summary>
/// <para type="description">The ID for a "microsoft.graph.managedDevice" object in the "managedDevices" collection.</para>
/// </summary>
[Selectable]
[Expandable]
[IdParameter]
[ResourceIdParameter]
[ValidateNotNullOrEmpty]
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"The ID for a "microsoft.graph.managedDevice" object in the "managedDevices" collection.")]
public System.String managedDeviceId { get; set; }
/// <summary>
/// <para type="description">A required ID for referencing a "microsoft.graph.detectedApp" object in the "detectedApps" collection.</para>
/// </summary>
[Selectable]
[Expandable]
[IdParameter]
[ValidateNotNullOrEmpty]
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"A required ID for referencing a "microsoft.graph.detectedApp" object in the "detectedApps" collection.")]
public System.String detectedAppId { get; set; }
internal override System.String GetResourcePath()
{
return $"deviceManagement/detectedApps/{detectedAppId}/managedDevices/{managedDeviceId}/$ref";
}
}
} | {
"pile_set_name": "Github"
} |
/*
Copyright The Kubernetes Authors.
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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta1
import (
"time"
v1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
scheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// CustomResourceDefinitionsGetter has a method to return a CustomResourceDefinitionInterface.
// A group's client should implement this interface.
type CustomResourceDefinitionsGetter interface {
CustomResourceDefinitions() CustomResourceDefinitionInterface
}
// CustomResourceDefinitionInterface has methods to work with CustomResourceDefinition resources.
type CustomResourceDefinitionInterface interface {
Create(*v1beta1.CustomResourceDefinition) (*v1beta1.CustomResourceDefinition, error)
Update(*v1beta1.CustomResourceDefinition) (*v1beta1.CustomResourceDefinition, error)
UpdateStatus(*v1beta1.CustomResourceDefinition) (*v1beta1.CustomResourceDefinition, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1beta1.CustomResourceDefinition, error)
List(opts v1.ListOptions) (*v1beta1.CustomResourceDefinitionList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CustomResourceDefinition, err error)
CustomResourceDefinitionExpansion
}
// customResourceDefinitions implements CustomResourceDefinitionInterface
type customResourceDefinitions struct {
client rest.Interface
}
// newCustomResourceDefinitions returns a CustomResourceDefinitions
func newCustomResourceDefinitions(c *ApiextensionsV1beta1Client) *customResourceDefinitions {
return &customResourceDefinitions{
client: c.RESTClient(),
}
}
// Get takes name of the customResourceDefinition, and returns the corresponding customResourceDefinition object, and an error if there is any.
func (c *customResourceDefinitions) Get(name string, options v1.GetOptions) (result *v1beta1.CustomResourceDefinition, err error) {
result = &v1beta1.CustomResourceDefinition{}
err = c.client.Get().
Resource("customresourcedefinitions").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of CustomResourceDefinitions that match those selectors.
func (c *customResourceDefinitions) List(opts v1.ListOptions) (result *v1beta1.CustomResourceDefinitionList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.CustomResourceDefinitionList{}
err = c.client.Get().
Resource("customresourcedefinitions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested customResourceDefinitions.
func (c *customResourceDefinitions) Watch(opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Resource("customresourcedefinitions").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
// Create takes the representation of a customResourceDefinition and creates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any.
func (c *customResourceDefinitions) Create(customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) {
result = &v1beta1.CustomResourceDefinition{}
err = c.client.Post().
Resource("customresourcedefinitions").
Body(customResourceDefinition).
Do().
Into(result)
return
}
// Update takes the representation of a customResourceDefinition and updates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any.
func (c *customResourceDefinitions) Update(customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) {
result = &v1beta1.CustomResourceDefinition{}
err = c.client.Put().
Resource("customresourcedefinitions").
Name(customResourceDefinition.Name).
Body(customResourceDefinition).
Do().
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *customResourceDefinitions) UpdateStatus(customResourceDefinition *v1beta1.CustomResourceDefinition) (result *v1beta1.CustomResourceDefinition, err error) {
result = &v1beta1.CustomResourceDefinition{}
err = c.client.Put().
Resource("customresourcedefinitions").
Name(customResourceDefinition.Name).
SubResource("status").
Body(customResourceDefinition).
Do().
Into(result)
return
}
// Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs.
func (c *customResourceDefinitions) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Resource("customresourcedefinitions").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *customResourceDefinitions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Resource("customresourcedefinitions").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched customResourceDefinition.
func (c *customResourceDefinitions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CustomResourceDefinition, err error) {
result = &v1beta1.CustomResourceDefinition{}
err = c.client.Patch(pt).
Resource("customresourcedefinitions").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "WKUserContentExtensionStoreRef.h"
#include "APIUserContentExtensionStore.h"
#include "WKAPICast.h"
using namespace WebKit;
WKTypeID WKUserContentExtensionStoreGetTypeID()
{
#if ENABLE(CONTENT_EXTENSIONS)
return toAPI(API::UserContentExtensionStore::APIType);
#else
return 0;
#endif
}
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.