code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
---|---|---|---|---|---|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/compute-optimizer/model/ExportLambdaFunctionRecommendationsResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>
#include <utility>
using namespace Aws::ComputeOptimizer::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;
ExportLambdaFunctionRecommendationsResult::ExportLambdaFunctionRecommendationsResult()
{
}
ExportLambdaFunctionRecommendationsResult::ExportLambdaFunctionRecommendationsResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
*this = result;
}
ExportLambdaFunctionRecommendationsResult& ExportLambdaFunctionRecommendationsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
JsonView jsonValue = result.GetPayload().View();
if(jsonValue.ValueExists("jobId"))
{
m_jobId = jsonValue.GetString("jobId");
}
if(jsonValue.ValueExists("s3Destination"))
{
m_s3Destination = jsonValue.GetObject("s3Destination");
}
return *this;
}
|
awslabs/aws-sdk-cpp
|
aws-cpp-sdk-compute-optimizer/source/model/ExportLambdaFunctionRecommendationsResult.cpp
|
C++
|
apache-2.0
| 1,219 |
#!/usr/bin/env python2.7
# Copyright 2015 Cisco Systems, 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.
"""
Demonstrate how to discover network devices that have 'static route' capabilities.
If there are no such devices then all sample scripts prefixed with
`05_static_route_` are unable to perform their demonstrations.
"""
from __future__ import print_function
from pydoc import render_doc as doc, plain
from basics.context import sys_exit, EX_OK, EX_TEMPFAIL
from basics.routes import capability_ns, capability_name
from basics.inventory import capability_discovery
from basics.render import print_table
from inspect import cleandoc
def demonstrate():
''' Apply function 'capability_discovery' to the specified device for required capability. '''
print('capability_discovery(capability_name=%s, capability_ns=%s)' % (capability_name, capability_ns))
discoveries = capability_discovery(capability_name=capability_name, capability_ns=capability_ns)
print_table([(
discovered.device_name,
discovered.capability.revision
) for discovered in discoveries], headers=(
'device-name',
'revision'
))
return discoveries
def main():
''' Document and demonstrate the function until a capable device is found.'''
print(cleandoc(__doc__))
print()
discoveries = demonstrate()
if not discoveries:
print()
print("There are no 'static route' capable network devices. Demonstration insufficient.")
return EX_TEMPFAIL
return EX_OK
if __name__ == "__main__":
try:
sys_exit(main())
finally:
print()
print('Function Reference:')
print(plain(doc(capability_discovery)))
|
tbarrongh/cosc-learning-labs
|
src/learning_lab/04_static_route_capability.py
|
Python
|
apache-2.0
| 2,227 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>Sofia Software Solutions - TeachEasy & LearnEasy</title>
<!-- Bootstrap Core CSS -->
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
<!-- Custom Fonts -->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Merriweather:400,300,300italic,400italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css" type="text/css">
<!-- Plugin CSS -->
<link rel="stylesheet" href="css/animate.min.css" type="text/css">
<!-- Custom CSS -->
<link rel="stylesheet" href="css/creative.css" type="text/css">
<script type="text/javascript" src="js/banner1.js"></script>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="js/modernizr.custom.41769.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body id="page-top">
<nav id="mainNav" class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand page-scroll" href="index.html">S O F I A</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
</div>
<!-- /.navbar-collapse -->
</div>
<!-- /.container-fluid -->
</nav>
<header >
<div class="header-content">
<div class="header-content-inner">
<h1>Website under contruction</h1>
<hr>
<p><img style="width: 324px; height: 368px;" src="/img/LE.png">
<img style="width: 324px; height: 368px;" src="/img/TE.png">
</p>
<a href="index.html">Press S O F I A to return to homepage</a>
</div>
</div>
</header>
</body>
</html>
|
SofiaSoftware/SofiaSoftware.github.io
|
websiteunderconstruction.html
|
HTML
|
apache-2.0
| 3,347 |
set -e
#---------
# Download
#---------
OPENSSL_DOWNLOAD=$DOWNLOAD_CACHE/openssl-$OPENSSL
OPENRESTY_DOWNLOAD=$DOWNLOAD_CACHE/openresty-$OPENRESTY
LUAROCKS_DOWNLOAD=$DOWNLOAD_CACHE/luarocks-$LUAROCKS
SERF_DOWNLOAD=$DOWNLOAD_CACHE/serf-$SERF
mkdir -p $OPENSSL_DOWNLOAD $OPENRESTY_DOWNLOAD $LUAROCKS_DOWNLOAD $SERF_DOWNLOAD
if [ ! "$(ls -A $OPENSSL_DOWNLOAD)" ]; then
pushd $DOWNLOAD_CACHE
curl -L http://www.openssl.org/source/openssl-$OPENSSL.tar.gz | tar xz
popd
fi
if [ ! "$(ls -A $OPENRESTY_DOWNLOAD)" ]; then
pushd $DOWNLOAD_CACHE
curl -L https://openresty.org/download/openresty-$OPENRESTY.tar.gz | tar xz
popd
fi
if [ ! "$(ls -A $LUAROCKS_DOWNLOAD)" ]; then
git clone https://github.com/keplerproject/luarocks.git $LUAROCKS_DOWNLOAD
fi
if [ ! "$(ls -A $SERF_DOWNLOAD)" ]; then
pushd $SERF_DOWNLOAD
wget https://releases.hashicorp.com/serf/${SERF}/serf_${SERF}_linux_amd64.zip
unzip serf_${SERF}_linux_amd64.zip
popd
fi
#--------
# Install
#--------
OPENSSL_INSTALL=$INSTALL_CACHE/openssl-$OPENSSL
OPENRESTY_INSTALL=$INSTALL_CACHE/openresty-$OPENRESTY
LUAROCKS_INSTALL=$INSTALL_CACHE/luarocks-$LUAROCKS
SERF_INSTALL=$INSTALL_CACHE/serf-$SERF
mkdir -p $OPENSSL_INSTALL $OPENRESTY_INSTALL $LUAROCKS_INSTALL $SERF_INSTALL
if [ ! "$(ls -A $OPENSSL_INSTALL)" ]; then
pushd $OPENSSL_DOWNLOAD
./config shared --prefix=$OPENSSL_INSTALL
make
make install
popd
fi
if [ ! "$(ls -A $OPENRESTY_INSTALL)" ]; then
pushd $OPENRESTY_DOWNLOAD
./configure \
--prefix=$OPENRESTY_INSTALL \
--with-openssl=$OPENSSL_DOWNLOAD \
--with-ipv6 \
--with-pcre-jit \
--with-http_ssl_module \
--with-http_realip_module \
--with-http_stub_status_module
make
make install
popd
fi
if [ ! "$(ls -A $LUAROCKS_INSTALL)" ]; then
pushd $LUAROCKS_DOWNLOAD
git checkout v$LUAROCKS
./configure \
--prefix=$LUAROCKS_INSTALL \
--lua-suffix=jit \
--with-lua=$OPENRESTY_INSTALL/luajit \
--with-lua-include=$OPENRESTY_INSTALL/luajit/include/luajit-2.1
make build
make install
popd
fi
if [ ! "$(ls -A $SERF_INSTALL)" ]; then
ln -s $SERF_DOWNLOAD/serf $SERF_INSTALL/serf
fi
export OPENSSL_DIR=$OPENSSL_INSTALL # for LuaSec install
export SERF_PATH=$SERF_INSTALL/serf # for our test instance (not in default bin/sh $PATH)
export PATH=$PATH:$OPENRESTY_INSTALL/nginx/sbin:$OPENRESTY_INSTALL/bin:$LUAROCKS_INSTALL/bin:$SERF_INSTALL
eval `luarocks path`
# -------------------------------------
# Install ccm & setup Cassandra cluster
# -------------------------------------
if [[ "$TEST_SUITE" != "unit" ]] && [[ "$TEST_SUITE" != "lint" ]]; then
pip install --user PyYAML six ccm==2.4.6
ccm create test -v binary:$CASSANDRA -n 1 -d
ccm start -v
ccm status
fi
nginx -V
resty -V
luarocks --version
serf version
|
Vermeille/kong
|
.ci/setup_env.sh
|
Shell
|
apache-2.0
| 2,833 |
/**
* @license
* Copyright 2018 Google LLC
*
* Use of this source code is governed by an MIT-style
* license that can be found in the LICENSE file or at
* https://opensource.org/licenses/MIT.
* =============================================================================
*/
import * as types_utils from './types_utils';
describe('isArrayOfShapes', () => {
it('returns false for a single non-empty shape', () => {
expect(types_utils.isArrayOfShapes([1, 2, 3])).toEqual(false);
});
it('returns false for a single empty shape', () => {
expect(types_utils.isArrayOfShapes([])).toEqual(false);
});
it('returns true for an array of shapes', () => {
expect(types_utils.isArrayOfShapes([[1], [2, 3]])).toEqual(true);
});
it('returns true for an array of shapes that includes empty shapes', () => {
expect(types_utils.isArrayOfShapes([[], [2, 3]])).toEqual(true);
expect(types_utils.isArrayOfShapes([[]])).toEqual(true);
expect(types_utils.isArrayOfShapes([[], []])).toEqual(true);
});
});
describe('normalizeShapeList', () => {
it('returns an empty list if an empty list is passed in.', () => {
expect(types_utils.normalizeShapeList([])).toEqual([]);
});
it('returns a list of shapes if a single shape is passed in.', () => {
expect(types_utils.normalizeShapeList([1])).toEqual([[1]]);
});
it('returns a list of shapes if an empty shape is passed in.', () => {
expect(types_utils.normalizeShapeList([[]])).toEqual([[]]);
});
it('returns a list of shapes if a list of shapes is passed in.', () => {
expect(types_utils.normalizeShapeList([[1]])).toEqual([[1]]);
});
});
describe('getExactlyOneShape', () => {
it('single instance', () => {
expect(types_utils.getExactlyOneShape([1, 2, 3])).toEqual([1, 2, 3]);
expect(types_utils.getExactlyOneShape([null, 8])).toEqual([null, 8]);
expect(types_utils.getExactlyOneShape([])).toEqual([]);
});
it('Array of length 1', () => {
expect(types_utils.getExactlyOneShape([[1, 2]])).toEqual([1, 2]);
expect(types_utils.getExactlyOneShape([[]])).toEqual([]);
});
it('Array of length 2: ValueError', () => {
expect(() => types_utils.getExactlyOneShape([
[1], [2]
])).toThrowError(/Expected exactly 1 Shape; got 2/);
});
});
|
tensorflow/tfjs
|
tfjs-layers/src/utils/types_utils_test.ts
|
TypeScript
|
apache-2.0
| 2,283 |
#!/usr/bin/env ruby
require 'spec_helper'
describe Puppet::Type.type(:dsc_xscvmmmanagementserverupdate) do
let :dsc_xscvmmmanagementserverupdate do
Puppet::Type.type(:dsc_xscvmmmanagementserverupdate).new(
:name => 'foo',
:dsc_ensure => 'Present',
)
end
it "should stringify normally" do
expect(dsc_xscvmmmanagementserverupdate.to_s).to eq("Dsc_xscvmmmanagementserverupdate[foo]")
end
it 'should default to ensure => present' do
expect(dsc_xscvmmmanagementserverupdate[:ensure]).to eq :present
end
it 'should require that dsc_ensure is specified' do
#dsc_xscvmmmanagementserverupdate[:dsc_ensure]
expect { Puppet::Type.type(:dsc_xscvmmmanagementserverupdate).new(
:name => 'foo',
:dsc_sourcepath => 'foo',
:dsc_sourcefolder => 'foo',
:dsc_setupcredential => {"user"=>"user", "password"=>"password"},
:dsc_update => 'foo',
)}.to raise_error(Puppet::Error, /dsc_ensure is a required attribute/)
end
it 'should accept dsc_ensure predefined value Present' do
dsc_xscvmmmanagementserverupdate[:dsc_ensure] = 'Present'
expect(dsc_xscvmmmanagementserverupdate[:dsc_ensure]).to eq('Present')
end
it 'should accept dsc_ensure predefined value present' do
dsc_xscvmmmanagementserverupdate[:dsc_ensure] = 'present'
expect(dsc_xscvmmmanagementserverupdate[:dsc_ensure]).to eq('present')
end
it 'should accept dsc_ensure predefined value present and update ensure with this value (ensure end value should be a symbol)' do
dsc_xscvmmmanagementserverupdate[:dsc_ensure] = 'present'
expect(dsc_xscvmmmanagementserverupdate[:ensure]).to eq(dsc_xscvmmmanagementserverupdate[:dsc_ensure].downcase.to_sym)
end
it 'should accept dsc_ensure predefined value Absent' do
dsc_xscvmmmanagementserverupdate[:dsc_ensure] = 'Absent'
expect(dsc_xscvmmmanagementserverupdate[:dsc_ensure]).to eq('Absent')
end
it 'should accept dsc_ensure predefined value absent' do
dsc_xscvmmmanagementserverupdate[:dsc_ensure] = 'absent'
expect(dsc_xscvmmmanagementserverupdate[:dsc_ensure]).to eq('absent')
end
it 'should accept dsc_ensure predefined value absent and update ensure with this value (ensure end value should be a symbol)' do
dsc_xscvmmmanagementserverupdate[:dsc_ensure] = 'absent'
expect(dsc_xscvmmmanagementserverupdate[:ensure]).to eq(dsc_xscvmmmanagementserverupdate[:dsc_ensure].downcase.to_sym)
end
it 'should not accept values not equal to predefined values' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_ensure] = 'invalid value'}.to raise_error(Puppet::ResourceError)
end
it 'should not accept array for dsc_ensure' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_ensure] = ["foo", "bar", "spec"]}.to raise_error(Puppet::ResourceError)
end
it 'should not accept boolean for dsc_ensure' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_ensure] = true}.to raise_error(Puppet::ResourceError)
end
it 'should not accept int for dsc_ensure' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_ensure] = -16}.to raise_error(Puppet::ResourceError)
end
it 'should not accept uint for dsc_ensure' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_ensure] = 16}.to raise_error(Puppet::ResourceError)
end
it 'should not accept array for dsc_sourcepath' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_sourcepath] = ["foo", "bar", "spec"]}.to raise_error(Puppet::ResourceError)
end
it 'should not accept boolean for dsc_sourcepath' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_sourcepath] = true}.to raise_error(Puppet::ResourceError)
end
it 'should not accept int for dsc_sourcepath' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_sourcepath] = -16}.to raise_error(Puppet::ResourceError)
end
it 'should not accept uint for dsc_sourcepath' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_sourcepath] = 16}.to raise_error(Puppet::ResourceError)
end
it 'should not accept array for dsc_sourcefolder' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_sourcefolder] = ["foo", "bar", "spec"]}.to raise_error(Puppet::ResourceError)
end
it 'should not accept boolean for dsc_sourcefolder' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_sourcefolder] = true}.to raise_error(Puppet::ResourceError)
end
it 'should not accept int for dsc_sourcefolder' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_sourcefolder] = -16}.to raise_error(Puppet::ResourceError)
end
it 'should not accept uint for dsc_sourcefolder' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_sourcefolder] = 16}.to raise_error(Puppet::ResourceError)
end
it "should not accept empty password for dsc_setupcredential" do
expect{dsc_xscvmmmanagementserverupdate[:dsc_setupcredential] = {"user"=>"user", "password"=>""}}.to raise_error(Puppet::ResourceError)
end
it 'should not accept array for dsc_setupcredential' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_setupcredential] = ["foo", "bar", "spec"]}.to raise_error(Puppet::ResourceError)
end
it 'should not accept boolean for dsc_setupcredential' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_setupcredential] = true}.to raise_error(Puppet::ResourceError)
end
it 'should not accept int for dsc_setupcredential' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_setupcredential] = -16}.to raise_error(Puppet::ResourceError)
end
it 'should not accept uint for dsc_setupcredential' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_setupcredential] = 16}.to raise_error(Puppet::ResourceError)
end
it 'should not accept array for dsc_update' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_update] = ["foo", "bar", "spec"]}.to raise_error(Puppet::ResourceError)
end
it 'should not accept boolean for dsc_update' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_update] = true}.to raise_error(Puppet::ResourceError)
end
it 'should not accept int for dsc_update' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_update] = -16}.to raise_error(Puppet::ResourceError)
end
it 'should not accept uint for dsc_update' do
expect{dsc_xscvmmmanagementserverupdate[:dsc_update] = 16}.to raise_error(Puppet::ResourceError)
end
# Configuration PROVIDER TESTS
describe "powershell provider tests" do
it "should successfully instanciate the provider" do
described_class.provider(:powershell).new(dsc_xscvmmmanagementserverupdate)
end
before(:each) do
@provider = described_class.provider(:powershell).new(dsc_xscvmmmanagementserverupdate)
end
describe "when dscmeta_module_name existing/is defined " do
it "should compute powershell dsc test script with Invoke-DscResource" do
expect(@provider.ps_script_content('test')).to match(/Invoke-DscResource/)
end
it "should compute powershell dsc test script with method Test" do
expect(@provider.ps_script_content('test')).to match(/Method\s+=\s*'test'/)
end
it "should compute powershell dsc set script with Invoke-DscResource" do
expect(@provider.ps_script_content('set')).to match(/Invoke-DscResource/)
end
it "should compute powershell dsc test script with method Set" do
expect(@provider.ps_script_content('set')).to match(/Method\s+=\s*'set'/)
end
end
describe "when dsc_ensure is 'present'" do
before(:each) do
dsc_xscvmmmanagementserverupdate.original_parameters[:dsc_ensure] = 'present'
dsc_xscvmmmanagementserverupdate[:dsc_ensure] = 'present'
@provider = described_class.provider(:powershell).new(dsc_xscvmmmanagementserverupdate)
end
it "should update :ensure to :present" do
expect(dsc_xscvmmmanagementserverupdate[:ensure]).to eq(:present)
end
it "should compute powershell dsc test script in which ensure value is 'present'" do
expect(@provider.ps_script_content('test')).to match(/ensure = 'present'/)
end
it "should compute powershell dsc set script in which ensure value is 'present'" do
expect(@provider.ps_script_content('set')).to match(/ensure = 'present'/)
end
end
describe "when dsc_ensure is 'absent'" do
before(:each) do
dsc_xscvmmmanagementserverupdate.original_parameters[:dsc_ensure] = 'absent'
dsc_xscvmmmanagementserverupdate[:dsc_ensure] = 'absent'
@provider = described_class.provider(:powershell).new(dsc_xscvmmmanagementserverupdate)
end
it "should update :ensure to :absent" do
expect(dsc_xscvmmmanagementserverupdate[:ensure]).to eq(:absent)
end
it "should compute powershell dsc test script in which ensure value is 'present'" do
expect(@provider.ps_script_content('test')).to match(/ensure = 'present'/)
end
it "should compute powershell dsc set script in which ensure value is 'absent'" do
expect(@provider.ps_script_content('set')).to match(/ensure = 'absent'/)
end
end
describe "when dsc_resource has credentials" do
it "should convert credential hash to a pscredential object" do
expect(@provider.ps_script_content('test')).to match(/| new-pscredential'/)
end
end
end
end
|
t3377/MyPuppet
|
modules/dsc/spec/unit/puppet/type/dsc_xscvmmmanagementserverupdate_spec.rb
|
Ruby
|
apache-2.0
| 9,269 |
# Copyright 2015 Cisco Systems, 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.
from __future__ import print_function
from basics.inventory import device_control, inventory_mounted, mounted, device_dismount, inventory_unmounted
from helpers import mount_from_settings
from unittest.case import TestCase
from unittest import main
class Test(TestCase):
def setUp(self):
mounted_list = inventory_mounted()
if mounted_list:
for device_name in mounted_list:
device_dismount(device_name)
self.assertFalse(mounted(device_name), 'Expected dismount: ' + device_name)
def test_device_mount(self):
device_names = inventory_unmounted()
self.assertTrue(device_names, 'One or more devices must be configured.')
for device_name in device_names:
expected = mount_from_settings(device_name)
self.assertTrue(mounted(device_name), 'Expected mounted: ' + device_name)
actual = device_control(device_name)
self.assertEqual(device_name, actual.device_name)
self.assertEqual(expected.device_name, actual.device_name)
self.assertEqual(expected.address, actual.address)
self.assertEqual(expected.port, actual.port)
self.assertEqual(expected.username, actual.username)
self.assertEqual(expected.password, actual.password)
if __name__ == '__main__':
main()
|
tbarrongh/cosc-learning-labs
|
test/test_device_mount.py
|
Python
|
apache-2.0
| 1,963 |
/**
* Copyright 2015 StreamSets Inc.
*
* Licensed under the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.streamsets.datacollector.runner;
import com.codahale.metrics.ExponentiallyDecayingReservoir;
import com.google.common.annotations.VisibleForTesting;
import com.streamsets.pipeline.api.impl.Utils;
import com.streamsets.pipeline.lib.executor.SafeScheduledExecutorService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.TimeUnit;
public class ResourceControlledScheduledExecutor {
private static final long DELAY_MINIMUM = 5000; // ms
private static final Logger LOG = LoggerFactory.getLogger(ResourceControlledScheduledExecutor.class);
private final SafeScheduledExecutorService scheduledExecutorService;
private final List<Runnable> tasks = new CopyOnWriteArrayList<>();
public ResourceControlledScheduledExecutor(final float maxCpuConsumption) {
this(maxCpuConsumption, DELAY_MINIMUM);
}
public ResourceControlledScheduledExecutor(final float maxCpuConsumption, final long minimumDelay) {
Utils.checkArgument(maxCpuConsumption > 0, "Max CPU Consumption cannot be less than zero");
scheduledExecutorService = new SafeScheduledExecutorService(2, "ResourceControlledScheduledExecutor");
scheduledExecutorService.scheduleAndForget(new Runnable() {
private final ExponentiallyDecayingReservoir decayingReservoir =
new ExponentiallyDecayingReservoir();
@Override
public void run() {
long start = System.currentTimeMillis();
boolean anyThrewError = false;
for (Runnable task : tasks) {
try {
task.run();
} catch (Throwable throwable) {
anyThrewError = true;
// unfortunately ScheduledExecutorService will eat throwables
// and then stop scheduling runnables which threw them
LOG.error("Task " + task + " had error: " + throwable, throwable);
}
}
long delay = minimumDelay;
if (!tasks.isEmpty()) {
decayingReservoir.update(System.currentTimeMillis() - start);
delay = calculateDelay(decayingReservoir.getSnapshot().getMedian(), maxCpuConsumption);
}
if (anyThrewError) {
// if a task fails with an exception it may have failed very quickly in which
// cause we will spin quite quickly spewing exceptions to the logs. If anything
// errors then we should proceed with caution
delay = Math.max(delay, TimeUnit.MINUTES.toMillis(1));
} else if (delay < minimumDelay) {
delay = minimumDelay;
}
try {
scheduledExecutorService.scheduleAndForget(this, delay, TimeUnit.MILLISECONDS);
} catch (RejectedExecutionException e) {
if (!scheduledExecutorService.isShutdown()) {
throw e;
}
}
}
}, 10, TimeUnit.MILLISECONDS);
}
public void submit(final Runnable runnable) {
tasks.add(runnable);
}
public void shutdown() {
scheduledExecutorService.shutdown();
}
@VisibleForTesting
static long calculateDelay(double average, double maxCpuConsumption) {
return ((long)(average / maxCpuConsumption)) - (long)average;
}
}
|
studanshu/datacollector
|
container/src/main/java/com/streamsets/datacollector/runner/ResourceControlledScheduledExecutor.java
|
Java
|
apache-2.0
| 4,123 |
// Copyright 2014 The Bazel 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.
package com.google.devtools.build.lib.rules.cpp;
import com.google.common.collect.ImmutableList;
import com.google.devtools.build.lib.actions.Action;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.ArtifactRoot;
import com.google.devtools.build.lib.analysis.buildinfo.BuildInfoCollection;
import com.google.devtools.build.lib.analysis.buildinfo.BuildInfoFactory;
import com.google.devtools.build.lib.analysis.buildinfo.BuildInfoKey;
import com.google.devtools.build.lib.analysis.config.BuildConfigurationValue;
import com.google.devtools.build.lib.cmdline.RepositoryName;
import com.google.devtools.build.lib.collect.nestedset.NestedSet;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
import com.google.devtools.build.lib.collect.nestedset.Order;
import com.google.devtools.build.lib.vfs.PathFragment;
import java.util.ArrayList;
import java.util.List;
/**
* C++ build info creation - generates header files that contain the corresponding build-info data.
*/
public final class CppBuildInfo implements BuildInfoFactory {
public static final BuildInfoKey KEY = new BuildInfoKey("C++");
private static final PathFragment BUILD_INFO_NONVOLATILE_HEADER_NAME =
PathFragment.create("build-info-nonvolatile.h");
private static final PathFragment BUILD_INFO_VOLATILE_HEADER_NAME =
PathFragment.create("build-info-volatile.h");
// TODO(bazel-team): (2011) Get rid of the redacted build info. We should try to make
// the linkstamping process handle the case where those values are undefined.
private static final PathFragment BUILD_INFO_REDACTED_HEADER_NAME =
PathFragment.create("build-info-redacted.h");
@Override
public BuildInfoCollection create(
BuildInfoContext buildInfoContext,
BuildConfigurationValue config,
Artifact buildInfo,
Artifact buildChangelist) {
List<Action> actions = new ArrayList<>();
WriteBuildInfoHeaderAction redactedInfo =
getHeader(
buildInfoContext,
config,
BUILD_INFO_REDACTED_HEADER_NAME,
NestedSetBuilder.emptySet(Order.STABLE_ORDER),
true,
true);
WriteBuildInfoHeaderAction nonvolatileInfo =
getHeader(
buildInfoContext,
config,
BUILD_INFO_NONVOLATILE_HEADER_NAME,
NestedSetBuilder.create(Order.STABLE_ORDER, buildInfo),
false,
true);
WriteBuildInfoHeaderAction volatileInfo =
getHeader(
buildInfoContext,
config,
BUILD_INFO_VOLATILE_HEADER_NAME,
NestedSetBuilder.create(Order.STABLE_ORDER, buildChangelist),
true,
false);
actions.add(redactedInfo);
actions.add(nonvolatileInfo);
actions.add(volatileInfo);
return new BuildInfoCollection(
actions,
ImmutableList.of(nonvolatileInfo.getPrimaryOutput(), volatileInfo.getPrimaryOutput()),
ImmutableList.of(redactedInfo.getPrimaryOutput()));
}
private WriteBuildInfoHeaderAction getHeader(
BuildInfoContext buildInfoContext,
BuildConfigurationValue config,
PathFragment headerName,
NestedSet<Artifact> inputs,
boolean writeVolatileInfo,
boolean writeNonVolatileInfo) {
ArtifactRoot outputPath = config.getBuildInfoDirectory(RepositoryName.MAIN);
final Artifact header =
buildInfoContext.getBuildInfoArtifact(
headerName,
outputPath,
writeVolatileInfo && !inputs.isEmpty()
? BuildInfoType.NO_REBUILD
: BuildInfoType.FORCE_REBUILD_IF_CHANGED);
return new WriteBuildInfoHeaderAction(
inputs, header, writeVolatileInfo, writeNonVolatileInfo);
}
@Override
public BuildInfoKey getKey() {
return KEY;
}
@Override
public boolean isEnabled(BuildConfigurationValue config) {
return config.hasFragment(CppConfiguration.class);
}
}
|
bazelbuild/bazel
|
src/main/java/com/google/devtools/build/lib/rules/cpp/CppBuildInfo.java
|
Java
|
apache-2.0
| 4,603 |
<?php
namespace League\FactoryMuffin\Exceptions;
/**
* This is the delete method not found exception class.
*
* This is thrown when the delete method of a model does not exist. This class
* extends MethodNotFoundException and ModelException, so you may want to try
* to catch one of those exceptions instead, if you want to be more general.
*
* @package League\FactoryMuffin\Exceptions
* @author Scott Robertson <[email protected]>
* @author Graham Campbell <[email protected]>
* @license <https://github.com/thephpleague/factory-muffin/blob/master/LICENSE> MIT
*/
class DeleteMethodNotFoundException extends MethodNotFoundException
{
/**
* The model instance.
*
* @var object
*/
private $object;
/**
* Create a new instance.
*
* @param object $object
* @param string $method
* @param string|null $message
*
* @return void
*/
public function __construct($object, $method, $message = null)
{
$this->object = $object;
$model = get_class($object);
if (!$message) {
$message = "The delete method '$method' was not found on the model of type: '$model'.";
}
parent::__construct($model, $method, $message);
}
/**
* Get the model instance.
*
* @return object
*/
public function getObject()
{
return $this->object;
}
}
|
dodanghien23693/codeisfun
|
vendor/league/factory-muffin/src/Exceptions/DeleteMethodNotFoundException.php
|
PHP
|
apache-2.0
| 1,423 |
# etcd
README version 0.4.4
A highly-available key value store for shared configuration and service discovery.
etcd is inspired by [Apache ZooKeeper][zookeeper] and [doozer][doozer], with a focus on being:
* *Simple*: curl'able user facing API (HTTP+JSON)
* *Secure*: optional SSL client cert authentication
* *Fast*: benchmarked 1000s of writes/s per instance
* *Reliable*: properly distributed using Raft
etcd is written in Go and uses the [Raft][raft] consensus algorithm to manage a highly-available replicated log.
See [etcdctl][etcdctl] for a simple command line client.
Or feel free to just use curl, as in the examples below.
[zookeeper]: http://zookeeper.apache.org/
[doozer]: https://github.com/ha/doozerd
[raft]: http://raftconsensus.github.io/
[etcdctl]: http://github.com/coreos/etcdctl/
If you're considering etcd for production use, please see: [production-ready.md](./Documentation/production-ready.md)
## Getting Started
### Getting etcd
The latest release and setup instructions are available at [GitHub][github-release].
[github-release]: https://github.com/coreos/etcd/releases/
### Building
You can build etcd from source:
```sh
git clone https://github.com/coreos/etcd
cd etcd
./build
```
This will generate a binary called `./bin/etcd`.
_NOTE_: you need go 1.2+. Please check your installation with
```
go version
```
See the [development tools documentation][development-tools] for alternative build methods like using Vagrant.
[development-tools]: https://github.com/coreos/etcd/blob/master/Documentation/development-tools.md
### Running
First start a single-machine cluster of etcd:
```sh
./bin/etcd
```
This will bring up etcd listening on port 4001 for client communication and on port 7001 for server-to-server communication.
Next, let's set a single key, and then retrieve it:
```
curl -L http://127.0.0.1:4001/v2/keys/mykey -XPUT -d value="this is awesome"
curl -L http://127.0.0.1:4001/v2/keys/mykey
```
You have successfully started an etcd on a single machine and written a key to the store. Now it's time to dig into the full etcd API and other guides.
### Next Steps
- Explore the full [API][api].
- Set up a [multi-machine cluster][clustering].
- Learn the [config format, env variables and flags][configuration].
- Find [language bindings and tools][libraries-and-tools].
- Learn about the dashboard, lock and leader election [modules][modules].
- Use TLS to [secure an etcd cluster][security].
- [Tune etcd][tuning].
- [Upgrade from old version][upgrade].
[api]: https://github.com/coreos/etcd/blob/master/Documentation/api.md
[clustering]: https://github.com/coreos/etcd/blob/master/Documentation/clustering.md
[configuration]: https://github.com/coreos/etcd/blob/master/Documentation/configuration.md
[libraries-and-tools]: https://github.com/coreos/etcd/blob/master/Documentation/libraries-and-tools.md
[modules]: https://github.com/coreos/etcd/blob/master/Documentation/modules.md
[security]: https://github.com/coreos/etcd/blob/master/Documentation/security.md
[tuning]: https://github.com/coreos/etcd/blob/master/Documentation/tuning.md
[upgrade]: https://github.com/coreos/etcd/blob/master/Documentation/upgrade.md
## Contact
- Mailing list: [etcd-dev](https://groups.google.com/forum/?hl=en#!forum/etcd-dev)
- IRC: #[coreos](irc://irc.freenode.org:6667/#coreos) on freenode.org
- Planning/Roadmap: [milestones](https://github.com/coreos/etcd/issues/milestones)
- Bugs: [issues](https://github.com/coreos/etcd/issues)
## Contributing
See [CONTRIBUTING](CONTRIBUTING.md) for details on submitting patches and the contribution workflow.
## Project Details
### Versioning
#### Service Versioning
etcd uses [semantic versioning](http://semver.org)
New minor versions may add additional features to the API.
You can get the version of etcd by issuing a request to /version:
```sh
curl -L http://127.0.0.1:4001/version
```
#### API Versioning
Clients are encouraged to use the `v2` API. The `v1` API will not change.
The `v2` API responses should not change after the 0.2.0 release but new features will be added over time.
During the pre-v1.0.0 series of releases we may break the API as we fix bugs and get feedback.
#### 32bit systems
etcd has known issues on 32bit systems. We plan to address these issues after the 0.4 release.
### License
etcd is under the Apache 2.0 license. See the [LICENSE](LICENSE) file for details.
|
cvik/etcd
|
README.md
|
Markdown
|
apache-2.0
| 4,416 |
Orchestrator Vagrant Instructions
=================================
Orchestrator's Vagrant defaults to installing five (5) CentOS 6.6 boxes in the following replication topology, with a separate "admin" node:
db1<->db2
| |
v v
db3 db4
It is possible to override what gets installed by the use of environmental variables:
VAGRANT_SERVER_URL defaults to 'https://atlas.hashicorp.com'
VAGRANT_DEFAULT_PROVIDER defaults to 'virtualbox'
VAGRANT_BOX defaults to 'nrel/CentOS-6.6-x86_64
The MySQL configuration is such that it is the minimum required to set up replication. For testing such features as delayed replication, RBR/SBR, GTID, it is simply a matter of editing the vagrant/dbX-my.cnf before running the `vagrant up` command.
FAQ
===
Q: By default, there are still a lot of steps that I have to do within each virtual machine to get going
A: That is by design. Vagrant will execute `db-post-install.sh`, `dbX-post-install.sh`, and `admin-post-install.sh` in the vagrant/ directory (they are .gitignore'd) for any custom work that you want to have done (i.e. build Orchestrator, etc etc)
Q: I run some other distribution of Linux. Why don't you support that?
A: Pull Requests are welcome! If you update any of the `vagrant/*.sh` scripts, they must work with at least CentOS 6 and Ubuntu 12
Tips & Tricks
=============
Specify GTID Usage
------------------
If you want to use GTID Replication, you must update all of the vagrant/dbX-my.cnf files with the following options in [mysqld]:
enforce-gtid-consistency
gtid-mode=ON
Specify RBR/SBR
---------------
vagrant/dbX-my.cnf files are copied directly to the virtual machines. If you'd like to specify SBR/RBR/MIXED, add one of the following lines to the [mysqld] section of the my.cnf template:
binlog_format=MIXED
binlog_format=STATEMENT
binlog_format=ROW
This is not global because we want to be able to test out non-standard replication configurations.
Use VMWare vs. VirtualBox
-------------------------
%> export VAGRANT_DEFAULT_PROVIDER='vmware_fusion'
%> vagrant up
CentOS
------
This is the default. Nothing special is required:
%> vagrant up
Ubuntu
------
%> export VAGRANT_SERVER_URL="https://atlas.hashicorp.com"
%> export VAGRANT_BOX='chef/ubuntu-12.04'
%> vagrant up
TO DO
=====
- Support other MySQL's (5.5, 5.7, MariaDB)
- Support customizable replication configurations
- Better my.cnf templates
|
grierj/orchestrator
|
vagrant/README.md
|
Markdown
|
apache-2.0
| 2,407 |
/// <reference path="angularjs/angular.d.ts" />
/// <reference path="jquery/jquery.d.ts" />
/// <reference path="angular-ui-router/angular-ui-router.d.ts" />
/// <reference path="angular-translate/angular-translate.d.ts" />
|
JeroMiya/OSVR-Config
|
src/ConfigUtil/wwwroot/typings/tsd.d.ts
|
TypeScript
|
apache-2.0
| 225 |
/***
Copyright (c) 2008-2012 CommonsWare, LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License.
From _The Busy Coder's Guide to Android Development_
https://commonsware.com/Android
*/
package com.commonsware.android.downloader;
import android.app.IntentService;
import android.content.Intent;
import android.os.Environment;
import android.support.v4.content.LocalBroadcastManager;
import android.util.Log;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class Downloader extends IntentService {
public static final String ACTION_COMPLETE=
"com.commonsware.android.downloader.action.COMPLETE";
public Downloader() {
super("Downloader");
}
@Override
public void onHandleIntent(Intent i) {
try {
File root=
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
root.mkdirs();
File output=new File(root, i.getData().getLastPathSegment());
if (output.exists()) {
output.delete();
}
URL url=new URL(i.getData().toString());
HttpURLConnection c=(HttpURLConnection)url.openConnection();
FileOutputStream fos=new FileOutputStream(output.getPath());
BufferedOutputStream out=new BufferedOutputStream(fos);
try {
InputStream in=c.getInputStream();
byte[] buffer=new byte[8192];
int len=0;
while ((len=in.read(buffer)) >= 0) {
out.write(buffer, 0, len);
}
out.flush();
}
finally {
fos.getFD().sync();
out.close();
c.disconnect();
}
LocalBroadcastManager.getInstance(this)
.sendBroadcast(new Intent(ACTION_COMPLETE));
}
catch (IOException e2) {
Log.e(getClass().getName(), "Exception in download", e2);
}
}
}
|
janzoner/cw-omnibus
|
Service/DownloaderMNC/app/src/main/java/com/commonsware/android/downloader/Downloader.java
|
Java
|
apache-2.0
| 2,448 |
# Single release of fabric8-devops
Triggers a single release of [fabric8-devops](https://github.com/fabric8io/fabric8-devops)
The workflow will first check to see if there's a newer version of any fabric8 dependencies from a previous stage available, if there are then the workflow will update the dependency and submit a pull request so that the CI tests run. Upon success of the CI job the dependency update pull request will be merged.
##Example pipeline view

|
fabric8io/jenkins-workflow-library
|
workflows/fabric8-release/Single-fabric8-devops/ReadMe.md
|
Markdown
|
apache-2.0
| 486 |
/***
Copyright (c) 2009-11 CommonsWare, LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package com.commonsware.cwac.wakeful.demo2;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Toast;
public class DemoActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
sendBroadcast(new Intent(this, OnBootReceiver.class));
Toast.makeText(this, R.string.alarms_active,
Toast.LENGTH_LONG).show();
finish();
}
}
|
commonsguy/cwac-wakeful
|
demo2/src/com/commonsware/cwac/wakeful/demo2/DemoActivity.java
|
Java
|
apache-2.0
| 1,090 |
/**
* Copyright 2011-2017 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.gatling.core.session
import scala.annotation.tailrec
import scala.reflect.ClassTag
import io.gatling.commons.NotNothing
import io.gatling.commons.stats.{ KO, OK, Status }
import io.gatling.commons.util.ClockSingleton.nowMillis
import io.gatling.commons.util.TypeCaster
import io.gatling.commons.util.TypeHelper._
import io.gatling.commons.validation._
import io.gatling.core.session.el.ElMessages
import io.gatling.core.action.Action
import com.typesafe.scalalogging.LazyLogging
/**
* Private Gatling Session attributes
*/
object SessionPrivateAttributes {
val PrivateAttributePrefix = "gatling."
}
case class SessionAttribute(session: Session, key: String) {
def as[T: NotNothing]: T = session.attributes(key).asInstanceOf[T]
def asOption[T: TypeCaster: ClassTag: NotNothing]: Option[T] = session.attributes.get(key).flatMap(_.asOption[T])
def validate[T: TypeCaster: ClassTag: NotNothing]: Validation[T] = session.attributes.get(key) match {
case Some(value) => value.asValidation[T]
case None => ElMessages.undefinedSessionAttribute(key)
}
}
object Session {
val MarkAsFailedUpdate: Session => Session = _.markAsFailed
val Identity: Session => Session = identity[Session]
val NothingOnExit: Session => Unit = _ => ()
}
/**
* Session class representing the session passing through a scenario for a given user
*
* This session stores all needed data between requests
*
* @constructor creates a new session
* @param scenario the name of the current scenario
* @param userId the id of the current user
* @param attributes the map that stores all values needed
* @param startDate when the user was started
* @param drift the cumulated time that was spent in Gatling on computation and that wasn't compensated for
* @param baseStatus the status when not in a TryMax blocks hierarchy
* @param blockStack the block stack
* @param onExit hook to execute once the user reaches the exit
*/
case class Session(
scenario: String,
userId: Long,
attributes: Map[String, Any] = Map.empty,
startDate: Long = nowMillis,
drift: Long = 0L,
baseStatus: Status = OK,
blockStack: List[Block] = Nil,
onExit: Session => Unit = Session.NothingOnExit
) extends LazyLogging {
def apply(name: String) = SessionAttribute(this, name)
def setAll(newAttributes: (String, Any)*): Session = setAll(newAttributes.toIterable)
def setAll(newAttributes: Iterable[(String, Any)]): Session = copy(attributes = attributes ++ newAttributes)
def set(key: String, value: Any) = copy(attributes = attributes + (key -> value))
def remove(key: String) = if (contains(key)) copy(attributes = attributes - key) else this
def removeAll(keys: String*) = keys.foldLeft(this)(_ remove _)
def contains(attributeKey: String) = attributes.contains(attributeKey)
def reset = copy(attributes = Map.empty)
private[gatling] def setDrift(drift: Long) = copy(drift = drift)
private[gatling] def increaseDrift(time: Long) = copy(drift = time + drift)
private def timestampName(counterName: String) = "timestamp." + counterName
def loopCounterValue(counterName: String) = attributes(counterName).asInstanceOf[Int]
def loopTimestampValue(counterName: String) = attributes(timestampName(counterName)).asInstanceOf[Long]
private[gatling] def enterGroup(groupName: String) = {
val groupHierarchy = blockStack.collectFirst { case g: GroupBlock => g.hierarchy } match {
case None => List(groupName)
case Some(l) => l :+ groupName
}
copy(blockStack = GroupBlock(groupHierarchy) :: blockStack)
}
private[gatling] def exitGroup = blockStack match {
case head :: tail if head.isInstanceOf[GroupBlock] => copy(blockStack = tail)
case _ =>
logger.error(s"exitGroup called but stack head $blockStack isn't a GroupBlock, please report.")
this
}
private[gatling] def logGroupRequest(responseTime: Int, status: Status) = blockStack match {
case Nil => this
case _ =>
copy(blockStack = blockStack.map {
case g: GroupBlock => g.copy(cumulatedResponseTime = g.cumulatedResponseTime + responseTime, status = if (status == KO) KO else g.status)
case b => b
})
}
def groupHierarchy: List[String] = {
@tailrec
def gh(blocks: List[Block]): List[String] = blocks match {
case Nil => Nil
case head :: tail => head match {
case g: GroupBlock => g.hierarchy
case _ => gh(tail)
}
}
gh(blockStack)
}
private[gatling] def enterTryMax(counterName: String, loopAction: Action) =
copy(blockStack = TryMaxBlock(counterName, loopAction) :: blockStack).initCounter(counterName, withTimestamp = false)
private[gatling] def exitTryMax: Session = blockStack match {
case TryMaxBlock(counterName, _, status) :: tail =>
copy(blockStack = tail).updateStatus(status).removeCounter(counterName)
case _ =>
logger.error(s"exitTryMax called but stack head $blockStack isn't a TryMaxBlock, please report.")
this
}
def isFailed = baseStatus == KO || blockStack.exists {
case TryMaxBlock(_, _, KO) => true
case _ => false
}
def status: Status = if (isFailed) KO else OK
private def failStatusUntilFirstTryMaxBlock: List[Block] = {
var firstTryMaxBlockNotReached = true
blockStack.map {
case tryMaxBlock: TryMaxBlock if firstTryMaxBlockNotReached && tryMaxBlock.status == OK =>
firstTryMaxBlockNotReached = false
tryMaxBlock.copy(status = KO)
case groupBlock: GroupBlock if firstTryMaxBlockNotReached && groupBlock.status == OK =>
groupBlock.copy(status = KO)
case b => b
}
}
private def restoreFirstTryMaxBlockStatus: List[Block] = {
var firstTryMaxBlockNotReached = true
blockStack.map {
case tryMaxBlock: TryMaxBlock if firstTryMaxBlockNotReached && tryMaxBlock.status == KO =>
firstTryMaxBlockNotReached = false
tryMaxBlock.copy(status = OK)
case b => b
}
}
private def updateStatus(newStatus: Status): Session =
if (newStatus == OK) {
markAsSucceeded
} else {
markAsFailed
}
private def isWithinTryMax: Boolean = blockStack.exists(_.isInstanceOf[TryMaxBlock])
def markAsSucceeded: Session =
if (isWithinTryMax) {
copy(blockStack = restoreFirstTryMaxBlockStatus)
} else if (baseStatus == KO) {
copy(baseStatus = OK)
} else {
this
}
def markAsFailed: Session =
if (baseStatus == KO && blockStack.isEmpty) {
this
} else {
val updatedStatus = if (isWithinTryMax) baseStatus else KO
copy(baseStatus = updatedStatus, blockStack = failStatusUntilFirstTryMaxBlock)
}
private[gatling] def enterLoop(counterName: String, condition: Expression[Boolean], exitAction: Action, exitASAP: Boolean, timeBased: Boolean): Session = {
val newBlock =
if (exitASAP)
ExitAsapLoopBlock(counterName, condition, exitAction)
else
ExitOnCompleteLoopBlock(counterName)
copy(blockStack = newBlock :: blockStack).initCounter(counterName, withTimestamp = timeBased)
}
private[gatling] def exitLoop: Session = blockStack match {
case LoopBlock(counterName) :: tail => copy(blockStack = tail).removeCounter(counterName)
case _ =>
logger.error(s"exitLoop called but stack head $blockStack isn't a Loop Block, please report.")
this
}
private[gatling] def initCounter(counterName: String, withTimestamp: Boolean): Session = {
val withCounter = attributes.updated(counterName, 0)
val newAttributes =
if (withTimestamp)
withCounter.updated(timestampName(counterName), nowMillis)
else
withCounter
copy(attributes = newAttributes)
}
private[gatling] def incrementCounter(counterName: String): Session =
attributes.get(counterName) match {
case Some(counterValue: Int) => copy(attributes = attributes.updated(counterName, counterValue + 1))
case _ =>
logger.error(s"incrementCounter called but attribute for counterName $counterName is missing, please report.")
this
}
private[gatling] def removeCounter(counterName: String): Session =
attributes.get(counterName) match {
case Some(counterValue: Int) =>
copy(attributes = attributes - counterName - timestampName(counterName))
case _ =>
logger.error(s"removeCounter called but attribute for counterName $counterName is missing, please report.")
this
}
def update(updates: Iterable[Session => Session]): Session = updates.foldLeft(this) {
(session, update) => update(session)
}
def exit(): Unit = onExit(this)
}
|
timve/gatling
|
gatling-core/src/main/scala/io/gatling/core/session/Session.scala
|
Scala
|
apache-2.0
| 9,399 |
// Copyright 2011-2016 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.security.zynamics.binnavi.disassembly.Modules;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.google.common.base.Preconditions;
import com.google.security.zynamics.binnavi.CUtilityFunctions;
import com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException;
import com.google.security.zynamics.binnavi.Exceptions.MaybeNullException;
import com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.Interfaces.IComment;
import com.google.security.zynamics.binnavi.disassembly.CFunctionListenerAdapter;
import com.google.security.zynamics.binnavi.disassembly.INaviFunction;
import com.google.security.zynamics.binnavi.disassembly.INaviModule;
import com.google.security.zynamics.binnavi.disassembly.views.INaviView;
import com.google.security.zynamics.zylib.disassembly.IAddress;
import com.google.security.zynamics.zylib.disassembly.IFunction;
import com.google.security.zynamics.zylib.disassembly.IFunctionListener;
import com.google.security.zynamics.zylib.types.lists.FilledList;
import com.google.security.zynamics.zylib.types.lists.IFilledList;
/**
* Contains functions for working with the functions of a module.
*/
public final class CFunctionContainer {
/**
* The module the functions belong to.
*/
private final INaviModule m_module;
/**
* Address => Function map for fast lookup of functions by address.
*/
private final Map<IAddress, INaviFunction> m_functionMap = new HashMap<>();
/**
* The functions of the module.
*/
private final IFilledList<INaviFunction> m_functions;
/**
* Synchronizes the module with its functions.
*/
private final IFunctionListener<IComment> m_functionListener = new InternalFunctionListener();
/**
* Creates a new function container object.
*
* @param module The module the functions belong to.
* @param functions The functions of the module.
*/
public CFunctionContainer(final INaviModule module, final List<INaviFunction> functions) {
m_module = Preconditions.checkNotNull(module, "IE02399: module argument can not be null");
m_functions =
new FilledList<INaviFunction>(Preconditions.checkNotNull(functions,
"IE02400: functions argument can not be null"));
for (final INaviFunction function : functions) {
m_functionMap.put(function.getAddress(), function);
}
for (final INaviFunction function : functions) {
function.addListener(m_functionListener);
}
}
/**
* Closes the function container.
*
* @return True, if the container was closed. False, if something prevented the container from
* closing.
*/
public boolean close() {
for (final INaviFunction function : m_functions) {
if (function.isLoaded() && function.close()) {
return false;
}
}
return true;
}
/**
* Tries to find a function inside the module that starts at a given start address.
*
* @param address The start address of the function.
*
* @return The function of the module that starts at the given address or null if there is no such
* address.
*/
public INaviFunction getFunction(final IAddress address) {
Preconditions.checkNotNull(address, "IE00197: Address argument can not be null");
return m_functionMap.get(address);
}
/**
* Returns a function identified by name.
*
* @param name The function name to search for.
*
* @return The function with the given name.
*
* @throws MaybeNullException Thrown if there is no function with the given name in the module.
*/
public INaviFunction getFunction(final String name) throws MaybeNullException {
Preconditions.checkNotNull(name, "IE00176: Name argument can not be null");
for (final INaviFunction function : m_functions) {
if (function.getName().equals(name)) {
return function;
}
}
throw new MaybeNullException();
}
/**
* Returns the number of functions in this module. This number equals the number of native Flow
* graph views.
*
* @return The number of functions in this module.
*/
public int getFunctionCount() {
return m_functions.size();
}
/**
* Returns all functions of the module.
*
* @return All functions of the module.
*/
public List<INaviFunction> getFunctions() {
return new ArrayList<INaviFunction>(m_functions);
}
/**
* Synchronizes the module with its functions.
*/
private class InternalFunctionListener extends CFunctionListenerAdapter {
@Override
public void changedName(final IFunction function, final String name) {
final INaviView view =
m_module.getContent().getViewContainer().getView((INaviFunction) function);
try {
view.getConfiguration().setName(name);
} catch (final CouldntSaveDataException e) {
CUtilityFunctions.logException(e);
}
}
}
}
|
mayl8822/binnavi
|
src/main/java/com/google/security/zynamics/binnavi/disassembly/Modules/CFunctionContainer.java
|
Java
|
apache-2.0
| 5,569 |
/*
* Copyright (C) 2014-2016 LinkedIn Corp. 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.
*/
package gobblin.kafka.serialize;
import java.io.IOException;
import org.apache.avro.generic.GenericRecord;
import org.apache.kafka.common.errors.SerializationException;
import org.apache.kafka.common.serialization.Serializer;
import gobblin.kafka.schemareg.SchemaRegistryException;
/**
* LinkedIn's implementation of Avro-schema based serialization for Kafka
* TODO: Implement this for IndexedRecord not just GenericRecord
*
*/
public class LiAvroSerializer extends LiAvroSerializerBase implements Serializer<GenericRecord> {
@Override
public byte[] serialize(String topic, GenericRecord data) {
try {
return super.serialize(topic, data);
} catch (gobblin.kafka.serialize.SerializationException e) {
throw new SerializationException(e);
}
}
}
|
yukuai518/gobblin
|
gobblin-modules/gobblin-kafka-09/src/main/java/gobblin/kafka/serialize/LiAvroSerializer.java
|
Java
|
apache-2.0
| 1,298 |
package net.ros.common.steam;
import net.minecraft.item.ItemStack;
import javax.annotation.Nonnull;
public interface ISteamHandlerItem extends ISteamHandler
{
@Nonnull
ItemStack getContainer();
}
|
mantal/Qbar
|
common/src/main/java/net/ros/common/steam/ISteamHandlerItem.java
|
Java
|
apache-2.0
| 207 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# - Find PLASMA (plasma/client.h, libplasma.a, libplasma.so)
# This module defines
# PLASMA_INCLUDE_DIR, directory containing headers
# PLASMA_LIBS, directory containing plasma libraries
# PLASMA_STATIC_LIB, path to libplasma.a
# PLASMA_SHARED_LIB, path to libplasma's shared library
# PLASMA_SHARED_IMP_LIB, path to libplasma's import library (MSVC only)
# PLASMA_FOUND, whether plasma has been found
include(FindPkgConfig)
if ("$ENV{ARROW_HOME}" STREQUAL "")
pkg_check_modules(PLASMA plasma)
if (PLASMA_FOUND)
pkg_get_variable(PLASMA_EXECUTABLE plasma executable)
pkg_get_variable(PLASMA_SO_VERSION plasma so_version)
set(PLASMA_ABI_VERSION ${PLASMA_SO_VERSION})
message(STATUS "Plasma SO and ABI version: ${PLASMA_SO_VERSION}")
pkg_get_variable(PLASMA_FULL_SO_VERSION plasma full_so_version)
message(STATUS "Plasma full SO version: ${PLASMA_FULL_SO_VERSION}")
set(PLASMA_INCLUDE_DIR ${PLASMA_INCLUDE_DIRS})
set(PLASMA_LIBS ${PLASMA_LIBRARY_DIRS})
set(PLASMA_SEARCH_LIB_PATH ${PLASMA_LIBRARY_DIRS})
endif()
else()
set(PLASMA_HOME "$ENV{ARROW_HOME}")
set(PLASMA_EXECUTABLE ${PLASMA_HOME}/bin/plasma_store_server)
set(PLASMA_SEARCH_HEADER_PATHS
${PLASMA_HOME}/include
)
set(PLASMA_SEARCH_LIB_PATH
${PLASMA_HOME}/lib
)
find_path(PLASMA_INCLUDE_DIR plasma/client.h PATHS
${PLASMA_SEARCH_HEADER_PATHS}
# make sure we don't accidentally pick up a different version
NO_DEFAULT_PATH
)
endif()
find_library(PLASMA_LIB_PATH NAMES plasma
PATHS
${PLASMA_SEARCH_LIB_PATH}
NO_DEFAULT_PATH)
get_filename_component(PLASMA_LIBS ${PLASMA_LIB_PATH} DIRECTORY)
if (PLASMA_INCLUDE_DIR AND PLASMA_LIBS)
set(PLASMA_FOUND TRUE)
set(PLASMA_LIB_NAME plasma)
set(PLASMA_STATIC_LIB ${PLASMA_LIBS}/lib${PLASMA_LIB_NAME}.a)
set(PLASMA_SHARED_LIB ${PLASMA_LIBS}/lib${PLASMA_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
if (PLASMA_FOUND)
if (NOT Plasma_FIND_QUIETLY)
message(STATUS "Found the Plasma core library: ${PLASMA_LIB_PATH}")
message(STATUS "Found Plasma executable: ${PLASMA_EXECUTABLE}")
endif ()
else ()
if (NOT Plasma_FIND_QUIETLY)
set(PLASMA_ERR_MSG "Could not find the Plasma library. Looked for headers")
set(PLASMA_ERR_MSG "${PLASMA_ERR_MSG} in ${PLASMA_SEARCH_HEADER_PATHS}, and for libs")
set(PLASMA_ERR_MSG "${PLASMA_ERR_MSG} in ${PLASMA_SEARCH_LIB_PATH}")
if (Plasma_FIND_REQUIRED)
message(FATAL_ERROR "${PLASMA_ERR_MSG}")
else (Plasma_FIND_REQUIRED)
message(STATUS "${PLASMA_ERR_MSG}")
endif (Plasma_FIND_REQUIRED)
endif ()
set(PLASMA_FOUND FALSE)
endif ()
mark_as_advanced(
PLASMA_INCLUDE_DIR
PLASMA_STATIC_LIB
PLASMA_SHARED_LIB
)
|
pcmoritz/arrow
|
cpp/cmake_modules/FindPlasma.cmake
|
CMake
|
apache-2.0
| 3,490 |
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect behavior and will be lost if the code is
* regenerated.
*/
'use strict';
/**
* Class representing a ControllerList.
*/
class ControllerList extends Array {
/**
* Create a ControllerList.
* @member {string} [nextLink] The URI that can be used to request the next
* page for list of Azure Dev Spaces Controllers.
*/
constructor() {
super();
}
/**
* Defines the metadata of ControllerList
*
* @returns {object} metadata of ControllerList
*
*/
mapper() {
return {
required: false,
serializedName: 'ControllerList',
type: {
name: 'Composite',
className: 'ControllerList',
modelProperties: {
value: {
required: false,
serializedName: '',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'ControllerElementType',
type: {
name: 'Composite',
className: 'Controller'
}
}
}
},
nextLink: {
required: false,
readOnly: true,
serializedName: 'nextLink',
type: {
name: 'String'
}
}
}
}
};
}
}
module.exports = ControllerList;
|
xingwu1/azure-sdk-for-node
|
lib/services/devspacesManagement/lib/models/controllerList.js
|
JavaScript
|
apache-2.0
| 1,619 |
namespace MakerJs.measure {
/**
* Find out if two angles are equal.
*
* @param angleA First angle.
* @param angleB Second angle.
* @returns true if angles are the same, false if they are not
*/
export function isAngleEqual(angleA: number, angleB: number, accuracy: number = .0001) {
var a = angle.noRevolutions(angleA);
var b = angle.noRevolutions(angleB);
var d = angle.noRevolutions(round(b - a, accuracy));
return d == 0;
}
/**
* @private
*/
interface IPathAreEqualMap {
[type: string]: (pathA: IPath, pathB: IPath, withinPointDistance?: number) => boolean;
}
/**
* @private
*/
var pathAreEqualMap: IPathAreEqualMap = {};
pathAreEqualMap[pathType.Line] = function (lineA: IPathLine, lineB: IPathLine, withinPointDistance?: number): boolean {
return (isPointEqual(lineA.origin, lineB.origin, withinPointDistance) && isPointEqual(lineA.end, lineB.end, withinPointDistance))
|| (isPointEqual(lineA.origin, lineB.end, withinPointDistance) && isPointEqual(lineA.end, lineB.origin, withinPointDistance));
};
pathAreEqualMap[pathType.Circle] = function (circleA: IPathCircle, circleB: IPathCircle, withinPointDistance): boolean {
return isPointEqual(circleA.origin, circleB.origin, withinPointDistance) && circleA.radius == circleB.radius;
};
pathAreEqualMap[pathType.Arc] = function (arcA: IPathArc, arcB: IPathArc, withinPointDistance): boolean {
return pathAreEqualMap[pathType.Circle](arcA, arcB, withinPointDistance) && isAngleEqual(arcA.startAngle, arcB.startAngle) && isAngleEqual(arcA.endAngle, arcB.endAngle);
};
/**
* Find out if two paths are equal.
*
* @param pathA First path.
* @param pathB Second path.
* @returns true if paths are the same, false if they are not
*/
export function isPathEqual(pathA: IPath, pathB: IPath, withinPointDistance?: number, pathAOffset?: IPoint, pathBOffset?: IPoint): boolean {
var result = false;
if (pathA.type == pathB.type) {
var fn = pathAreEqualMap[pathA.type];
if (fn) {
function getResult() {
result = fn(pathA, pathB, withinPointDistance);
}
if (pathAOffset || pathBOffset) {
path.moveTemporary([pathA, pathB], [pathAOffset, pathBOffset], getResult);
} else {
getResult();
}
}
}
return result;
}
/**
* Find out if two points are equal.
*
* @param a First point.
* @param b Second point.
* @returns true if points are the same, false if they are not
*/
export function isPointEqual(a: IPoint, b: IPoint, withinDistance?: number): boolean {
if (!withinDistance) {
return a[0] == b[0] && a[1] == b[1];
} else {
if (!a || !b) return false;
var distance = measure.pointDistance(a, b);
return distance <= withinDistance;
}
}
/**
* Find out if point is on a slope.
*
* @param p Point to check.
* @param b Slope.
* @returns true if point is on the slope
*/
export function isPointOnSlope(p: IPoint, slope: ISlope, withinDistance?: number): boolean {
if (slope.hasSlope) {
// y = mx * b
return round(p[1] - (slope.slope * p[0] + slope.yIntercept)) === 0;
} else {
//vertical slope
return round(p[0] - slope.line.origin[0]) === 0;
}
}
/**
* Check for slope equality.
*
* @param slopeA The ISlope to test.
* @param slopeB The ISlope to check for equality.
* @returns Boolean true if slopes are equal.
*/
export function isSlopeEqual(slopeA: ISlope, slopeB: ISlope): boolean {
if (!slopeA.hasSlope && !slopeB.hasSlope) {
//lines are both vertical, see if x are the same
return round(slopeA.line.origin[0] - slopeB.line.origin[0]) == 0;
}
if (slopeA.hasSlope && slopeB.hasSlope && (round(slopeA.slope - slopeB.slope, .00001) == 0)) {
//lines are parallel, but not vertical, see if y-intercept is the same
return round(slopeA.yIntercept - slopeB.yIntercept, .00001) == 0;
}
return false;
}
}
|
AllenBootung/makerjsphp
|
src/core/equal.ts
|
TypeScript
|
apache-2.0
| 4,448 |
/*
* Copyright 2016 Confluent 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.
*/
package io.confluent.connect.jdbc.sink.metadata;
import org.apache.kafka.connect.data.Schema;
import java.util.Map;
public class SinkRecordField {
private final Schema schema;
private final String name;
private final boolean isPrimaryKey;
public SinkRecordField(Schema schema, String name, boolean isPrimaryKey) {
this.schema = schema;
this.name = name;
this.isPrimaryKey = isPrimaryKey;
}
public String schemaName() {
return schema.name();
}
public Map<String, String> schemaParameters() {
return schema.parameters();
}
public Schema.Type schemaType() {
return schema.type();
}
public String name() {
return name;
}
public boolean isOptional() {
return !isPrimaryKey && schema.isOptional();
}
public Object defaultValue() {
return schema.defaultValue();
}
public boolean isPrimaryKey() {
return isPrimaryKey;
}
@Override
public String toString() {
return "SinkRecordField{" +
"schema=" + schema +
", name='" + name + '\'' +
", isPrimaryKey=" + isPrimaryKey +
'}';
}
}
|
amitkumard/DemoRepo
|
src/main/java/io/confluent/connect/jdbc/sink/metadata/SinkRecordField.java
|
Java
|
apache-2.0
| 1,709 |
#!/bin/bash
echo "Starting..."
sleep 4
exit 1
|
marc0der/gradle-spawn-plugin
|
src/test/resources/startAndDie.sh
|
Shell
|
apache-2.0
| 46 |
package core.resources.pcu;
import java.util.List;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import core.classes.pcu.PcuExpireditems;
import core.classes.pcu.PcuItemstockday;
import core.classes.pcu.PcuPrescriptiondispense;
import core.classes.pcu.PcuViewinventory;
import core.classes.pcu.PcuViewinventoryId;
import flexjson.JSONSerializer;
import lib.driver.pcu.driver_class.PcuMainDBDriver;
@Path("PcuMain")
public class PcuMainResource {
PcuMainDBDriver pcuMainDBDriver = new PcuMainDBDriver();
@GET
@Path("/getInventoryItems")
@Produces(MediaType.APPLICATION_JSON)
public String GetPrescriptionDispensedItems() {
String result="";
try {
List<PcuViewinventory> ItemList=pcuMainDBDriver.GetInventoryItems();
JSONSerializer serializer = new JSONSerializer();
return serializer.exclude("*.class").serialize(ItemList);
} catch (Exception e) {
return e.getMessage();
}
}
@GET
@Path("/getReorderCount")
@Produces(MediaType.APPLICATION_JSON)
public String GetReorderCount() {
String result="";
try {
int count =pcuMainDBDriver.ItemsBelowCount();
JSONSerializer serializer = new JSONSerializer();
return serializer.exclude("*.class").serialize(count);
} catch (Exception e) {
return e.getMessage();
}
}
@GET
@Path("/getReorderItems")
@Produces(MediaType.APPLICATION_JSON)
public String GetReorderItems() {
String result="";
try {
List<PcuViewinventory> ItemList=pcuMainDBDriver.GetItemsBelow();
JSONSerializer serializer = new JSONSerializer();
return serializer.exclude("*.class").serialize(ItemList);
} catch (Exception e) {
return e.getMessage();
}
}
@GET
@Path("/getExpiredCount")
@Produces(MediaType.APPLICATION_JSON)
public String GetExpiredCount() {
String result="";
try {
int count =pcuMainDBDriver.ItemsExpiredCount();
JSONSerializer serializer = new JSONSerializer();
return serializer.exclude("*.class").serialize(count);
} catch (Exception e) {
return e.getMessage();
}
}
@GET
@Path("/getExpiredItems")
@Produces(MediaType.APPLICATION_JSON)
public String GetExpiredItems() {
String result="";
try {
List<PcuExpireditems> ItemList=pcuMainDBDriver.GetExpiredItems();
JSONSerializer serializer = new JSONSerializer();
return serializer.exclude("*.class").serialize(ItemList);
} catch (Exception e) {
return e.getMessage();
}
}
@GET
@Path("/getStocks")
@Produces(MediaType.APPLICATION_JSON)
public String GetStock() {
String result="";
try {
List<PcuItemstockday> ItemList=pcuMainDBDriver.GetStockPerDay();
JSONSerializer serializer = new JSONSerializer();
return serializer.exclude("*.class").serialize(ItemList);
} catch (Exception e) {
return e.getMessage();
}
}
}
|
wimarsha93/Digital-Pulz-for-Hospitals
|
HIS_Latest_Project_29-07-2016/Backend/NewWorkspace_2016/HIS_API/src/main/java/core/resources/pcu/PcuMainResource.java
|
Java
|
apache-2.0
| 2,886 |
---
layout: documentation
title: ReactiveX - Count operator
id: count
---
<ol class="breadcrumb">
<li><a href="{{ site.url }}/documentation/operators.html">Operators</a></li>
<li><a href="{{ site.url }}/documentation/operators.html#mathematical">Mathematical and Aggregate</a></li>
<li class="active">Count</li>
</ol>
<h1>Count</h1>
<h3>count the number of items emitted by the source Observable and emit only this value</h3>
<figure class="rxmarbles-figure">
<rx-marbles key="count"></rx-marbles>
<figcaption><p>
The <span class="operator">Count</span> operator transforms an Observable that emits items into
an Observable that emits a single value that represents the number of items emitted by the
source Observable.
</p><p>
If the source Observable terminates with an error, <span class="operator">Count</span> will pass
this error notification along without emitting an item first. If the source Observable does not
terminate at all, <span class="operator">Count</span> will neither emit an item nor terminate.
</p></figcaption>
</figure>
<h4>See Also</h4>
<ul>
<li><a href="http://www.introtorx.com/Content/v1.0.10621.0/07_Aggregation.html#Count"><cite>Introduction to Rx</cite>: Count</a></li>
<li><a href="http://rxmarbles.com/#count">RxMarbles: <code>count</code></a></li>
</ul>
<h2>Language-Specific Information:</h2>
<div class="panel-group operators-by-language" id="accordion" role="tablist" aria-multiselectable="true">
{% lang_operator RxClojure count longCount %}
<p>
RxClojure has both <code>count</code> and <code>longCount</code> variants of this operator,
but both of these in fact return long values.
</p>
{% endlang_operator %}
{% lang_operator RxCpp count %}
<p>
RxCpp implements this operator as <code>count</code>.
</p>
{% endlang_operator %}
{% lang_operator RxGroovy count countLong %}
<p>
In RxGroovy the operator is called <code>count</code> and the Observable it creates emits an
Integer value. There is also a <code>countLong</code> whose Observable emits a Long value.
</p>
<h4>Sample Code</h4>
<div class="code groovy"><pre>
def myObservable = Observable.create({ aSubscriber ->
if(false == aSubscriber.isUnsubscribed()) aSubscriber.onNext('Three');
if(false == aSubscriber.isUnsubscribed()) aSubscriber.onNext('Two');
if(false == aSubscriber.isUnsubscribed()) aSubscriber.onNext('One');
if(false == aSubscriber.isUnsubscribed()) aSubscriber.onCompleted();
});
myObservable.count().subscribe(
{ println(it); }, // onNext
{ println("Error: " + it.getMessage()); }, // onError
{ println("Sequence complete"); } // onCompleted
);</pre></div>
<div class="output"><pre>
3
Sequence complete</pre></div>
<ul>
<li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#count()"><code>count()</code></a></li>
<li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#countLong()"><code>countLong()</code></a></li>
</ul>
{% endlang_operator %}
{% lang_operator RxJava count countLong %}
<p>
In RxJava the operator is called <code>count</code> and the Observable it creates emits an
Integer value. There is also a <code>countLong</code> whose Observable emits a Long value.
</p>
<h4>Sample Code</h4>
<div class="code java"><pre>
String[] items = new String[] { "one", "two", "three" };
assertEquals( new Integer(3), Observable.from(items).count().toBlocking().single() );</pre></div>
<ul>
<li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#count()"><code>count()</code></a></li>
<li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#countLong()"><code>countLong()</code></a></li>
</ul>
{% endlang_operator %}
{% lang_operator RxJS count %}
<p>
In RxJS the operator <code>count</code> counts the number of items in the source Observable
that satisfy a specified predicate. That predicate takes the form of a function that takes
three parameters:
</p>
<ol>
<li>the emitted item</li>
<li>the index of that item in the sequence of emitted items</li>
<li>the source Observable</li>
</ol>
<p>
If the predicate function returns <code>true</code>, <code>count</code> will increment the
tally of items that it will report when the source Observable completes. If you want to count
<em>all</em> of the items emitted by the source Observable, simply pass <code>count</code> a
predicate that always returns <code>true</code>:
</p>
<h4>Sample Code</h4>
<div class="code javascript"><pre>
numberOfItems = someObservable.count(function() { return true; });</pre></div>
<p>
<code>count</code> is part of the following packages:
</p>
<ul>
<li><code>rx.all.js</code></li>
<li><code>rx.all.compat.js</code></li>
<li><code>rx.aggregates.js</code></li>
</ul>
<p>
<code>count</code> requires one of any of the following packages:
</p>
<ul>
<li><code>rx.js</code></li>
<li><code>rx.compat.js</code></li>
<li><code>rx.lite.js</code></li>
<li><code>rx.lite.compat.js</code></li>
</ul>
{% endlang_operator %}
{% lang_operator RxKotlin count %}
<p>
RxKotlin implements this operator as <code>count</code>.
</p>
<h4>Sample Code</h4>
<div class="code kotlin"><pre>
val list = listOf(1, 2, 3, 4, 5)
assertEquals( 5, Observable.from(list)!!.count()!!.toBlocking()!!.single() )</pre></div>
{% endlang_operator %}
{% lang_operator Rx.NET Count LongCount %}
<p>
In Rx.NET the Observable this operator creates emits an Integer value, but there is also a
<code>LongCount</code> whose Observable emits a Long value. With both variants, you can either
pass the source Observable in to the operator as a parameter or you can call the operator as
an instance method of the source Observable (in which case you omit the parameter).
</p>
{% endlang_operator %}
{% lang_operator RxPHP count %}
<figure class="variant">
<figcaption>
<p>
RxPHP implements this operator as <code>count</code>.
</p>
<p>
Returns an observable sequence containing a value that represents how many elements in the specified observable sequence satisfy a condition if provided, else the count of items.
</p>
<h4>Sample Code</h4>
<div class="code php">
<pre>
//from https://github.com/ReactiveX/RxPHP/blob/master/demo/count/count.php
$source = \Rx\Observable::fromArray(range(1, 10));
$subscription = $source->count()->subscribe($stdoutObserver);
</pre>
</div>
<div class="output">
<pre>
Next value: 10
Complete!
</pre>
</div>
</figcaption>
</figure>
{% endlang_operator %}
{% lang_operator RxPY count %}
<p>
In RxPY you have the option to pass <code>count</code> a predicate that takes an item emitted
by the source Observable as a parameter. If you do so, <code>count</code> will emit a count
only of those items from the source Observable that the predicate evaluates as
<code>true</code>. Otherwise, it will emit a count of all items emitted by the source
Observable.
</p>
<h4>Sample Code</h4>
<div class="code python"><pre>
numberOfItems = someObservable.count()
numberOfNegativeItems = someObservable.count(lambda x: x < 0)</pre></div>
{% endlang_operator %}
{% lang_operator Rx.rb count %}
<p>
In Rx.rb you have the option to pass <code>count</code> a predicate that takes an item emitted
by the source Observable as a parameter. If you do so, <code>count</code> will emit a count
only of those items from the source Observable that the predicate evaluates as
<code>true</code>. Otherwise it will emit a count of all items emitted by the source
Observable.
</p>
{% endlang_operator %}
{% lang_operator RxScala count length longCount size %}
<p>
In RxScala the operator <code>count</code> counts the number of items in the source Observable
that satisfy a specified predicate. That predicate accepts an emitted item as a parameter and
returns a Boolean. <code>count</code> will emit a count of all items for which this predicate
returned <code>true</code>.
</p><p>
Use <code>length</code> or <code>size</code> instead if you want to count <em>all</em> of the
items emitted by the source Observable and emit this count as an Integer, or use
<code>longCount</code> to emit it as a Long.
</p>
{% endlang_operator %}
</div>
|
phajduk/reactivex.github.io
|
documentation/operators/count.html
|
HTML
|
apache-2.0
| 8,765 |
// Japanese euc variables
tinyMCE.addToLang('',{
fullscreen_title : 'Á´²èÌÌɽ¼¨',
fullscreen_desc : 'Á´²èÌÌɽ¼¨¤ò¥È¥°¥ë'
});
|
WilliamGoossen/epsos-common-components.gnomonportal
|
webapps/ROOT/html/js/editor/tiny_mce/plugins/fullscreen/langs/ja_euc-jp.js
|
JavaScript
|
apache-2.0
| 126 |
package com.perforce.p4java.tests.dev.unit.features132;
import com.perforce.p4java.core.IDepot;
import com.perforce.p4java.core.IStream;
import com.perforce.p4java.core.IStreamSummary;
import com.perforce.p4java.impl.generic.core.Stream;
import com.perforce.p4java.option.server.GetStreamsOptions;
import com.perforce.p4java.option.server.ReloadOptions;
import com.perforce.p4java.option.server.StreamOptions;
import com.perforce.p4java.option.server.UnloadOptions;
import com.perforce.p4java.server.IOptionsServer;
import com.perforce.p4java.tests.UnicodeServerRule;
import com.perforce.p4java.tests.dev.annotations.Jobs;
import com.perforce.p4java.tests.dev.annotations.TestId;
import com.perforce.p4java.tests.dev.unit.P4JavaRshTestCase;
import org.junit.After;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
import static org.hamcrest.core.IsNull.notNullValue;
import static org.hamcrest.core.StringContains.containsString;
/**
* Test unload and reload task stream
*/
@Jobs({"job066055"})
@TestId("Dev132_UnloadReloadTaskStreamTest")
public class UnloadReloadTaskStreamTest extends P4JavaRshTestCase {
@ClassRule
public static UnicodeServerRule p4d = new UnicodeServerRule("r16.1",UnloadReloadTaskStreamTest.class.getSimpleName());
private IOptionsServer superServer = null;
final String streamsDepotName = "p4java_stream";
final String streamDepth = "//" + streamsDepotName + "/1";
final String unloadDepotName = "p4java_unload";
final int randNum = getRandomInt();
final String streamName = "testmain" + randNum;
final String newStreamPath = "//" + streamsDepotName + "/" + streamName;
final String streamName2 = "testtask" + randNum;
final String newStreamPath2 = "//" + streamsDepotName + "/" + streamName2;
IDepot streamsDepot;
IDepot unloadDepot;
@Before
public void setUp() throws Exception {
setupServer(p4d.getRSHURL(), userName, password, true, null);
client = getClient(server);
streamsDepot = createStreamsDepot(streamsDepotName, server, streamDepth);
unloadDepot = createUnloadDepot(unloadDepotName, server);
superServer = getSuperConnection(p4d.getRSHURL());
}
@After
public void tearDown() {
afterEach(server, superServer);
}
/**
* Test unload and reload task stream
*/
@Test
public void testUnloadReloadTaskStreams() throws Exception {
try {
// Create a stream
IStream newStream = Stream.newStream(server, newStreamPath,
"mainline", null, null, null, null, null, null, null);
String retVal = server.createStream(newStream);
// The stream should be created
assertThat(retVal, notNullValue());
assertThat(retVal, is("Stream " + newStreamPath + " saved."));
// Get the newly created stream
IStream returnedStream = server.getStream(newStreamPath);
assertThat(returnedStream, notNullValue());
// Validate the content of the stream
assertThat(returnedStream.getStream(), is(newStreamPath));
assertThat(returnedStream.getParent(), is("none"));
assertThat(returnedStream.getType().toString().toLowerCase(Locale.ENGLISH), is("mainline"));
assertThat(returnedStream.getOptions().toString(), is("allsubmit unlocked toparent fromparent"));
assertThat(returnedStream.getName(), is(streamName));
assertThat(returnedStream.getDescription(), containsString(Stream.DEFAULT_DESCRIPTION));
assertThat(returnedStream.getStreamView().getSize(), is(1));
assertThat(returnedStream.getRemappedView().getSize(), is(0));
assertThat(returnedStream.getIgnoredView().getSize(), is(0));
String options = "locked ownersubmit notoparent nofromparent";
String[] viewPaths = new String[]{
"share ...",
"share core/GetOpenedFilesTest/src/gnu/getopt/...",
"isolate readonly/sync/p4cmd/*",
"import core/GetOpenedFilesTest/bin/gnu/... //p4java_stream/main/core/GetOpenedFilesTest/bin/gnu/...",
"exclude core/GetOpenedFilesTest/src/com/perforce/p4cmd/..."};
String[] remappedPaths = new String[]{
"core/GetOpenedFilesTest/... core/GetOpenedFilesTest/src/...",
"core/GetOpenedFilesTest/src/... core/GetOpenedFilesTest/src/gnu/..."};
String[] ignoredPaths = new String[]{"/temp", "/temp/...",
".tmp", ".class"};
IStream newStream2 = Stream.newStream(server, newStreamPath2,
"task", newStreamPath, "Task stream",
"The task stream of " + newStreamPath, options,
viewPaths, remappedPaths, ignoredPaths);
retVal = server.createStream(newStream2);
// The stream should be created
assertThat(retVal, notNullValue());
assertThat(retVal, is("Stream " + newStreamPath2 + " saved."));
// Get the newly created stream
returnedStream = server.getStream(newStreamPath2);
assertThat(returnedStream, notNullValue());
// Validate the content of the stream
assertThat(returnedStream.getStream(), is(newStreamPath2));
assertThat(returnedStream.getParent(), is(newStreamPath));
assertThat(returnedStream.getType().toString().toLowerCase(Locale.ENGLISH), is("task"));
assertThat(returnedStream.getOptions().toString(), is("ownersubmit locked notoparent nofromparent"));
assertThat(returnedStream.getName(), is("Task stream"));
assertThat(returnedStream.getDescription(), containsString("The task stream of " + newStreamPath));
assertThat(returnedStream.getStreamView().getSize(), is(5));
assertThat(returnedStream.getRemappedView().getSize(), is(2));
assertThat(returnedStream.getIgnoredView().getSize(), is(4));
// Use stream update() and refresh() methods
returnedStream.setDescription("New updated description.");
returnedStream.update();
returnedStream.refresh();
assertThat(returnedStream.getDescription(), containsString("New updated description."));
// Get all the streams
List<IStreamSummary> streams = server.getStreams(
null,
new GetStreamsOptions());
assertThat(streams, notNullValue());
// Get only the two new streams
streams = server.getStreams(Arrays.asList(newStreamPath, newStreamPath2),
new GetStreamsOptions());
assertThat(streams, notNullValue());
assertThat(streams.size(), is(2));
// Unload task stream
retVal = server.unload(new UnloadOptions().setStream(newStreamPath2).setLocked(true));
assertThat(retVal, notNullValue());
assertThat(retVal, containsString("Stream " + newStreamPath2 + " unloaded."));
// Check temp task stream has been unloaded
boolean found = false;
List<IStreamSummary> unloadedStreams = server.getStreams(null, new GetStreamsOptions().setUnloaded(true));
assertThat(unloadedStreams, notNullValue());
for (IStreamSummary ss : unloadedStreams) {
if (ss.getStream().equalsIgnoreCase(newStreamPath2)) {
found = true;
break;
}
}
assertThat(found, is(true));
// Reload task stream
retVal = server.reload(new ReloadOptions().setStream(newStreamPath2));
assertThat(retVal, containsString("Stream " + newStreamPath2 + " reloaded."));
} finally {
if (superServer != null) {
try {
String serverMessage = superServer.deleteStream(
newStreamPath2,
new StreamOptions().setForceUpdate(true));
assertThat(serverMessage, notNullValue());
serverMessage = superServer.deleteStream(
newStreamPath,
new StreamOptions().setForceUpdate(true));
assertThat(serverMessage, notNullValue());
} catch (Exception ignore) {
// Nothing much we can do here...
}
}
}
}
}
|
groboclown/p4ic4idea
|
p4java/src/test/java/com/perforce/p4java/tests/dev/unit/features132/UnloadReloadTaskStreamTest.java
|
Java
|
apache-2.0
| 7,985 |
/*
* Copyright 2014 JBoss, by Red Hat, 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.
*/
package org.uberfire.metadata.backend.lucene.index.directory;
import java.io.File;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.PostingsFormat;
import org.apache.lucene.codecs.lucene40.Lucene40Codec;
import org.apache.lucene.index.IndexWriterConfig;
import org.uberfire.metadata.backend.lucene.index.LuceneIndex;
import org.uberfire.metadata.backend.lucene.index.LuceneIndexFactory;
import org.uberfire.metadata.backend.lucene.model.KClusterImpl;
import org.uberfire.metadata.model.KCluster;
import static org.apache.lucene.util.Version.*;
import static org.uberfire.commons.validation.PortablePreconditions.*;
public class DirectoryFactory implements LuceneIndexFactory {
private static final String REPOSITORIES_ROOT_DIR = ".index";
private final Map<KCluster, LuceneIndex> clusters = new ConcurrentHashMap<KCluster, LuceneIndex>();
private final DirectoryType type;
private final Analyzer analyzer;
public DirectoryFactory( final DirectoryType type,
final Analyzer analyzer ) {
this.analyzer = analyzer;
this.type = type;
final File[] files = defaultHostingDir().listFiles();
if ( files != null && files.length > 0 ) {
for ( final File file : files ) {
if ( file.isDirectory() ) {
final KCluster cluster = new KClusterImpl( file.getName() );
clusters.put( cluster, type.newIndex( cluster, newConfig( analyzer ) ) );
}
}
}
}
private IndexWriterConfig newConfig( final Analyzer analyzer ) {
final IndexWriterConfig config = new IndexWriterConfig( LUCENE_40, analyzer );
final Codec codec = new Lucene40Codec() {
@Override
public PostingsFormat getPostingsFormatForField( String field ) {
if ( field.equals( "id" ) ) {
return PostingsFormat.forName( "Memory" );
} else {
return PostingsFormat.forName( "Lucene40" );
}
}
};
config.setCodec( codec );
return config;
}
@Override
public LuceneIndex newCluster( final KCluster kcluster ) {
checkCondition( "Cluster already exists", !clusters.containsKey( checkNotNull( "kcluster", kcluster ) ) );
final LuceneIndex newIndex = type.newIndex( kcluster, newConfig( analyzer ) );
clusters.put( kcluster, newIndex );
return newIndex;
}
@Override
public void remove( KCluster cluster ) {
clusters.remove( cluster );
}
@Override
public Map<? extends KCluster, ? extends LuceneIndex> getIndexes() {
return Collections.unmodifiableMap( clusters );
}
@Override
public synchronized void dispose() {
for ( final LuceneIndex luceneIndex : clusters.values() ) {
luceneIndex.dispose();
}
}
public static File defaultHostingDir() {
final String value = System.getProperty( "org.uberfire.metadata.index.dir" );
if ( value == null || value.trim().isEmpty() ) {
return new File( REPOSITORIES_ROOT_DIR );
} else {
return new File( value.trim(), REPOSITORIES_ROOT_DIR );
}
}
}
|
hernsys/uberfire-0.4.0.CR1
|
uberfire-metadata/uberfire-metadata-backends/uberfire-metadata-backend-lucene/src/main/java/org/uberfire/metadata/backend/lucene/index/directory/DirectoryFactory.java
|
Java
|
apache-2.0
| 4,044 |
# Uninstall-ChocolateyEnvironmentVariable
**NOTE:** Administrative Access Required when `-VariableType 'Machine'.`
Removes a persistent environment variable.
## Syntax
~~~powershell
Uninstall-ChocolateyEnvironmentVariable `
-VariableName <String> `
[-VariableType {Process | User | Machine}] `
[-IgnoredArguments <Object[]>] [<CommonParameters>]
~~~
## Description
Uninstall-ChocolateyEnvironmentVariable removes an environment variable
with the specified name and value. The variable can be scoped either to
the User or to the Machine. If Machine level scoping is specified, the
command is elevated to an administrative session.
## Notes
Available in 0.9.10+. If you need compatibility with older versions,
use Install-ChocolateyEnvironmentVariable and set `-VariableValue $null`
This command will assert UAC/Admin privileges on the machine when
`-VariableType Machine`.
This will remove the environment variable from the current session.
## Aliases
None
## Examples
**EXAMPLE 1**
~~~powershell
# Remove an environment variable
Uninstall-ChocolateyEnvironmentVariable -VariableName 'bob'
~~~
**EXAMPLE 2**
~~~powershell
# Remove an environment variable from Machine
Uninstall-ChocolateyEnvironmentVariable -VariableName 'bob' -VariableType 'Machine'
~~~
## Inputs
None
## Outputs
None
## Parameters
### -VariableName <String>
The name or key of the environment variable to remove.
Property | Value
---------------------- | -----
Aliases |
Required? | true
Position? | 1
Default Value |
Accept Pipeline Input? | false
### -VariableType
Specifies whether this variable is at either the individual User level
or at the Machine level.
Valid options: Process, User, Machine
Property | Value
---------------------- | -----
Aliases |
Required? | false
Position? | 2
Default Value | User
Accept Pipeline Input? | false
### -IgnoredArguments [<Object[]>]
Allows splatting with arguments that do not apply. Do not use directly.
Property | Value
---------------------- | -----
Aliases |
Required? | false
Position? | named
Default Value |
Accept Pipeline Input? | false
### <CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see `about_CommonParameters` http://go.microsoft.com/fwlink/p/?LinkID=113216 .
## Links
* [[Install-ChocolateyEnvironmentVariable|HelpersInstallChocolateyEnvironmentVariable]]
* [[Set-EnvironmentVariable|HelpersSetEnvironmentVariable]]
* [[Install-ChocolateyPath|HelpersInstallChocolateyPath]]
[[Function Reference|HelpersReference]]
***NOTE:*** This documentation has been automatically generated from `Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" -Force; Get-Help Uninstall-ChocolateyEnvironmentVariable -Full`.
|
sideeffffect/choco
|
docs/generated/HelpersUninstallChocolateyEnvironmentVariable.md
|
Markdown
|
apache-2.0
| 3,159 |
(function() {
function HomeCtrl($scope, Room) {
$scope.rooms = Room.all;
}
angular
.module('blocChat')
.controller('HomeCtrl', ['$scope', 'Room', HomeCtrl] );
})();
|
rrmcburn/Bloc-Chat
|
dist/scripts/controllers/HomeCtrl.js
|
JavaScript
|
apache-2.0
| 208 |
# Migrating Between Configuration Versions
Occasionally, there are changes made to Ignition's configuration that break backward compatibility. While this is not a concern for running machines (since Ignition only runs one time during first boot), it is a concern for those who maintain configuration files. This document serves to detail each of the breaking changes and tries to provide some reasoning for the change. This does not cover all of the changes to the spec - just those that need to be considered when migrating from one version to the next.
## From Version 2.0.0 to 2.1.0
There are not any breaking changes between versions 2.0.0 and versions 2.1.0 of the configuration specification. Any valid 2.0.0 configuration can be updated to a 2.1.0 configuration by simply changing the version string in the config.
The 2.1.0 version of the configuration is greatly improved over version 2.0.0, with many new fields and behaviors added to the specification.
The following is a list of notable new features, deprecations, and changes.
### HTTP timeouts
The values used to control the backoff when retrying in HTTP requests can now be set in the config. For details on how the backoff logic works, please see the section in the [operator's notes][operator-notes].
The fields to do this are in a new object called `timeouts`, and they can alter the time spent waiting for HTTP response headers and the total time limit for the operation.
```json ignition
{
"ignition": {
"version": "2.1.0",
"timeouts": {
"httpResponseHeaders": 20,
"httpTotal": 600
}
}
}
```
### Partition GUIDs
The GPT unique partition GUID can now be set on partitions in a configuration.
```json ignition
{
"ignition": {
"version": "2.1.0"
},
"storage": {
"disks": [
{
"device": "/dev/disk/by-uuid/ecdbeb92-174e-4d24-9d6f-fbd9cb668a48",
"partitions": [
{
"guid": "8a7a6e26-5e8f-4cca-a654-46215d4696ac"
}
]
}
]
}
}
```
### Directories, links, and files
Version 2.1.0 of the configuration specification now supports specifying directories and links (both symbolic and hard) to be created, and when creating either of these or creating a file the owner's user and group can be specified by name in addition to UID and GID.
```json ignition
{
"ignition": { "version": "2.1.0" },
"storage": {
"files": [{
"filesystem": "root",
"path": "/home/core/foo.txt",
"mode": 420,
"contents": { "source": "data:,helloworld" },
"user": {
"name": "core"
},
"group": {
"name": "core"
}
}],
"directories": [{
"filesystem": "root",
"path": "/home/core/bar",
"mode": 493,
"user": {
"name": "core"
},
"group": {
"name": "core"
}
}],
"links": [{
"filesystem": "root",
"path": "/home/core/baz.txt",
"target": "/home/core/foo.txt",
"hard": true,
"user": {
"name": "core"
},
"group": {
"name": "core"
}
}]
}
}
```
### Filesystem create object deprecation
Version 2.0.0 of the configuration specification included an object named `create` in the `mount` object under the `filesystems` section.
```json ignition
{
"ignition": {
"version": "2.1.0"
},
"storage": {
"filesystems": [
{
"name": "data",
"mount": {
"device": "/dev/disk/by-uuid/ecdbeb92-174e-4d24-9d6f-fbd9cb668a48",
"format": "ext4",
"create": {
"force": true,
"options": ["-L", "DATA", "-b", "1024"]
}
}
}
]
}
}
```
This `create` object has been deprecated. Configurations of version 2.1.0 that use the `create` object will still work, but will cause Ignition to log a warning.
It is now advised to use the new fields that have been added to the `mount` object.
```json ignition
{
"ignition": {
"version": "2.1.0"
},
"storage": {
"filesystems": [
{
"name": "data",
"mount": {
"device": "/dev/disk/by-uuid/ecdbeb92-174e-4d24-9d6f-fbd9cb668a48",
"format": "ext4",
"wipeFilesystem": true,
"label": "DATA",
"options": ["-b", "1024"]
}
}
]
}
}
```
The `wipeFilesystem` flag that replaces the `force` flag has rather different semantics, and can allow for existing filesystems to be reused. For more information, please see the [filesystems document][filesystems].
### Passwd create object deprecation
Similar to the `create` object in the `filesystems` section, version 2.0.0 of the configuration specification included an object named `create` in the `users` list in the `passwd` object.
```json ignition
{
"ignition": {
"version": "2.1.0"
},
"passwd": {
"users": [
{
"name": "test",
"create": {
"uid": 1010,
"gecos": "user creation test",
"noCreateHome": true,
"noUserGroup": true
},
}
]
}
}
```
This `create` object has been deprecated. Configurations of version 2.1.0 that use the `create` object will still work, but will cause Ignition to log a warning.
The fields that existed in the `create` object have been added directly to the `users` object, and it's advised to use these new fields instead of the `create` object.
```json ignition
{
"ignition": {
"version": "2.1.0"
},
"passwd": {
"users": [
{
"name": "test",
"uid": 1010,
"gecos": "user creation test",
"noCreateHome": true,
"noUserGroup": true
}
]
}
}
```
## From Version 1 to 2.0.0
This section will cover the breaking changes made between versions 1 and 2.0.0 of the configuration specification.
### Version
One of the more notable changes was the representation of the config version, moving from an integer to a [Semantic Version][semver] string. Using a Semantic Version will allow the configuration specification to pick up additions and other backward-compatible changes in the future without necessarily requiring the user to update their config. The version number has also moved locations and is now in an Ignition metadata section named "ignition".
The following shows the changes to the version section:
```json ignition
{
"ignitionVersion": 1
}
```
```json ignition
{
"ignition": {
"version": "2.0.0"
}
}
```
### Files
The `files` section was moved out from under `filesystems` and is now directly under the `storage` section. This was done in order to decouple file definitions from filesystem definitions. This is particularly useful when merging multiple configs together. One config may define a filesystem while another can write files to that filesystem without needing to know the specifics of that filesystem. A common example of this is referencing the universally-defined "root" filesystem which is defined by default inside of Ignition.
The following shows this particular change to the files section:
```json ignition
{
"storage": {
"filesystems": [
{
"device": "/dev/sdb1",
"format": "ext4",
"files": [
{
"path": "/foo/bar"
}
]
}
]
}
}
```
```json ignition
{
"storage": {
"filesystems": [
{
"name": "example",
"device": "/dev/sdb1",
"format": "ext4"
}
],
"files": [
{
"filesystem": "example",
"path": "/foo/bar"
}
]
}
}
```
#### Contents
The `contents` section was changed from a simple string to an object. This allows extra properties to be added to file contents (e.g. compression type, content hashs). The source for the file contents has also changed from being inline in the config to a URL. This provides the ability to include the contents inline (via a [data URL][rfc2397]) or to reference a remote resource (via an http URL).
The following shows the changes to the file contents (snipped for clarity):
```json ignition
...
"files": [
{
"path": "/foo/bar",
"contents": "example file\n"
}
]
...
```
```json ignition
...
"files": [
{
"path": "/foo/bar",
"contents": {
"source": "data:,example%20file%0A"
}
}
]
...
```
#### User and Group
The `uid` and `gid` sections have been moved into new `id` sections under new `user` and `group` sections. This will allow alternate methods of identifying a user or a group (e.g. by name) in the future.
The following shows the changes to the file uid and gid:
```json ignition
...
"files": [
{
"path": "/foo/bar",
"uid": 500,
"gid": 500
}
]
...
```
```json ignition
...
"files": [
{
"path": "/foo/bar",
"user": {
"id": 500
},
"group": {
"id": 500
}
}
]
...
```
[semver]: http://semver.org
[rfc2397]: https://tools.ietf.org/html/rfc2397
[operator-notes]: operator-notes.md
[filesystems]: operator-notes.md#filesystem-reuse-semantics
|
deasmi/terraform-provider-libvirt
|
vendor/github.com/coreos/ignition/doc/migrating-configs.md
|
Markdown
|
apache-2.0
| 9,026 |
#!/usr/bin/env python
class BytesIO:
def __init__(self, buffer):
self._data = buffer
if not self._data:
self._data = str()
self._pos = 0
def getvalue(self):
return self._data
def close(self):
pass
def readline(self):
return self.read(self._data[self._pos:].find('\n') + 1)
def read(self, n=None):
if n == None:
n = -1
if not isinstance(n, (int, long)):
raise TypeError("Argument must be an integer")
if n < 0:
n = len(self._data)
if len(self._data) <= self._pos:
return ''
newpos = min(len(self._data), self._pos + n)
b = self._data[self._pos : newpos]
self._pos = newpos
return b
def readable(self):
return True
def writable(self):
return True
def seekable(self):
return False
|
silenceli/oga-windows
|
ovirt-guest-agent/bytesio.py
|
Python
|
apache-2.0
| 914 |
"""Representation of Z-Wave thermostats."""
from __future__ import annotations
from typing import Any, cast
from zwave_js_server.client import Client as ZwaveClient
from zwave_js_server.const import CommandClass
from zwave_js_server.const.command_class.thermostat import (
THERMOSTAT_CURRENT_TEMP_PROPERTY,
THERMOSTAT_HUMIDITY_PROPERTY,
THERMOSTAT_MODE_PROPERTY,
THERMOSTAT_MODE_SETPOINT_MAP,
THERMOSTAT_MODES,
THERMOSTAT_OPERATING_STATE_PROPERTY,
THERMOSTAT_SETPOINT_PROPERTY,
ThermostatMode,
ThermostatOperatingState,
ThermostatSetpointType,
)
from zwave_js_server.model.value import Value as ZwaveValue
from homeassistant.components.climate import (
DEFAULT_MAX_TEMP,
DEFAULT_MIN_TEMP,
ClimateEntity,
)
from homeassistant.components.climate.const import (
ATTR_HVAC_MODE,
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW,
CURRENT_HVAC_COOL,
CURRENT_HVAC_FAN,
CURRENT_HVAC_HEAT,
CURRENT_HVAC_IDLE,
DOMAIN as CLIMATE_DOMAIN,
HVAC_MODE_COOL,
HVAC_MODE_DRY,
HVAC_MODE_FAN_ONLY,
HVAC_MODE_HEAT,
HVAC_MODE_HEAT_COOL,
HVAC_MODE_OFF,
PRESET_NONE,
SUPPORT_FAN_MODE,
SUPPORT_PRESET_MODE,
SUPPORT_TARGET_TEMPERATURE,
SUPPORT_TARGET_TEMPERATURE_RANGE,
)
from homeassistant.components.zwave_js.discovery_data_template import (
DynamicCurrentTempClimateDataTemplate,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_TEMPERATURE,
PRECISION_TENTHS,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.temperature import convert_temperature
from .const import DATA_CLIENT, DOMAIN
from .discovery import ZwaveDiscoveryInfo
from .entity import ZWaveBaseEntity
from .helpers import get_value_of_zwave_value
# Map Z-Wave HVAC Mode to Home Assistant value
# Note: We treat "auto" as "heat_cool" as most Z-Wave devices
# report auto_changeover as auto without schedule support.
ZW_HVAC_MODE_MAP: dict[int, str] = {
ThermostatMode.OFF: HVAC_MODE_OFF,
ThermostatMode.HEAT: HVAC_MODE_HEAT,
ThermostatMode.COOL: HVAC_MODE_COOL,
# Z-Wave auto mode is actually heat/cool in the hass world
ThermostatMode.AUTO: HVAC_MODE_HEAT_COOL,
ThermostatMode.AUXILIARY: HVAC_MODE_HEAT,
ThermostatMode.FAN: HVAC_MODE_FAN_ONLY,
ThermostatMode.FURNANCE: HVAC_MODE_HEAT,
ThermostatMode.DRY: HVAC_MODE_DRY,
ThermostatMode.AUTO_CHANGE_OVER: HVAC_MODE_HEAT_COOL,
ThermostatMode.HEATING_ECON: HVAC_MODE_HEAT,
ThermostatMode.COOLING_ECON: HVAC_MODE_COOL,
ThermostatMode.AWAY: HVAC_MODE_HEAT_COOL,
ThermostatMode.FULL_POWER: HVAC_MODE_HEAT,
}
HVAC_CURRENT_MAP: dict[int, str] = {
ThermostatOperatingState.IDLE: CURRENT_HVAC_IDLE,
ThermostatOperatingState.PENDING_HEAT: CURRENT_HVAC_IDLE,
ThermostatOperatingState.HEATING: CURRENT_HVAC_HEAT,
ThermostatOperatingState.PENDING_COOL: CURRENT_HVAC_IDLE,
ThermostatOperatingState.COOLING: CURRENT_HVAC_COOL,
ThermostatOperatingState.FAN_ONLY: CURRENT_HVAC_FAN,
ThermostatOperatingState.VENT_ECONOMIZER: CURRENT_HVAC_FAN,
ThermostatOperatingState.AUX_HEATING: CURRENT_HVAC_HEAT,
ThermostatOperatingState.SECOND_STAGE_HEATING: CURRENT_HVAC_HEAT,
ThermostatOperatingState.SECOND_STAGE_COOLING: CURRENT_HVAC_COOL,
ThermostatOperatingState.SECOND_STAGE_AUX_HEAT: CURRENT_HVAC_HEAT,
ThermostatOperatingState.THIRD_STAGE_AUX_HEAT: CURRENT_HVAC_HEAT,
}
ATTR_FAN_STATE = "fan_state"
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up Z-Wave climate from config entry."""
client: ZwaveClient = hass.data[DOMAIN][config_entry.entry_id][DATA_CLIENT]
@callback
def async_add_climate(info: ZwaveDiscoveryInfo) -> None:
"""Add Z-Wave Climate."""
entities: list[ZWaveBaseEntity] = []
if info.platform_hint == "dynamic_current_temp":
entities.append(DynamicCurrentTempClimate(config_entry, client, info))
else:
entities.append(ZWaveClimate(config_entry, client, info))
async_add_entities(entities)
config_entry.async_on_unload(
async_dispatcher_connect(
hass,
f"{DOMAIN}_{config_entry.entry_id}_add_{CLIMATE_DOMAIN}",
async_add_climate,
)
)
class ZWaveClimate(ZWaveBaseEntity, ClimateEntity):
"""Representation of a Z-Wave climate."""
def __init__(
self, config_entry: ConfigEntry, client: ZwaveClient, info: ZwaveDiscoveryInfo
) -> None:
"""Initialize thermostat."""
super().__init__(config_entry, client, info)
self._hvac_modes: dict[str, int | None] = {}
self._hvac_presets: dict[str, int | None] = {}
self._unit_value: ZwaveValue | None = None
self._current_mode = self.get_zwave_value(
THERMOSTAT_MODE_PROPERTY, command_class=CommandClass.THERMOSTAT_MODE
)
self._setpoint_values: dict[ThermostatSetpointType, ZwaveValue] = {}
for enum in ThermostatSetpointType:
self._setpoint_values[enum] = self.get_zwave_value(
THERMOSTAT_SETPOINT_PROPERTY,
command_class=CommandClass.THERMOSTAT_SETPOINT,
value_property_key=enum.value,
add_to_watched_value_ids=True,
)
# Use the first found non N/A setpoint value to always determine the
# temperature unit
if (
not self._unit_value
and enum != ThermostatSetpointType.NA
and self._setpoint_values[enum]
):
self._unit_value = self._setpoint_values[enum]
self._operating_state = self.get_zwave_value(
THERMOSTAT_OPERATING_STATE_PROPERTY,
command_class=CommandClass.THERMOSTAT_OPERATING_STATE,
add_to_watched_value_ids=True,
check_all_endpoints=True,
)
self._current_temp = self.get_zwave_value(
THERMOSTAT_CURRENT_TEMP_PROPERTY,
command_class=CommandClass.SENSOR_MULTILEVEL,
add_to_watched_value_ids=True,
check_all_endpoints=True,
)
if not self._unit_value:
self._unit_value = self._current_temp
self._current_humidity = self.get_zwave_value(
THERMOSTAT_HUMIDITY_PROPERTY,
command_class=CommandClass.SENSOR_MULTILEVEL,
add_to_watched_value_ids=True,
check_all_endpoints=True,
)
self._fan_mode = self.get_zwave_value(
THERMOSTAT_MODE_PROPERTY,
CommandClass.THERMOSTAT_FAN_MODE,
add_to_watched_value_ids=True,
check_all_endpoints=True,
)
self._fan_state = self.get_zwave_value(
THERMOSTAT_OPERATING_STATE_PROPERTY,
CommandClass.THERMOSTAT_FAN_STATE,
add_to_watched_value_ids=True,
check_all_endpoints=True,
)
self._set_modes_and_presets()
self._supported_features = 0
if len(self._hvac_presets) > 1:
self._supported_features |= SUPPORT_PRESET_MODE
# If any setpoint value exists, we can assume temperature
# can be set
if any(self._setpoint_values.values()):
self._supported_features |= SUPPORT_TARGET_TEMPERATURE
if HVAC_MODE_HEAT_COOL in self.hvac_modes:
self._supported_features |= SUPPORT_TARGET_TEMPERATURE_RANGE
if self._fan_mode:
self._supported_features |= SUPPORT_FAN_MODE
def _setpoint_value(self, setpoint_type: ThermostatSetpointType) -> ZwaveValue:
"""Optionally return a ZwaveValue for a setpoint."""
if (val := self._setpoint_values[setpoint_type]) is None:
raise ValueError("Value requested is not available")
return val
def _set_modes_and_presets(self) -> None:
"""Convert Z-Wave Thermostat modes into Home Assistant modes and presets."""
all_modes: dict[str, int | None] = {}
all_presets: dict[str, int | None] = {PRESET_NONE: None}
# Z-Wave uses one list for both modes and presets.
# Iterate over all Z-Wave ThermostatModes and extract the hvac modes and presets.
if self._current_mode is None:
self._hvac_modes = {
ZW_HVAC_MODE_MAP[ThermostatMode.HEAT]: ThermostatMode.HEAT
}
return
for mode_id, mode_name in self._current_mode.metadata.states.items():
mode_id = int(mode_id)
if mode_id in THERMOSTAT_MODES:
# treat value as hvac mode
if hass_mode := ZW_HVAC_MODE_MAP.get(mode_id):
all_modes[hass_mode] = mode_id
else:
# treat value as hvac preset
all_presets[mode_name] = mode_id
self._hvac_modes = all_modes
self._hvac_presets = all_presets
@property
def _current_mode_setpoint_enums(self) -> list[ThermostatSetpointType | None]:
"""Return the list of enums that are relevant to the current thermostat mode."""
if self._current_mode is None:
# Thermostat(valve) with no support for setting a mode is considered heating-only
return [ThermostatSetpointType.HEATING]
return THERMOSTAT_MODE_SETPOINT_MAP.get(int(self._current_mode.value), []) # type: ignore
@property
def temperature_unit(self) -> str:
"""Return the unit of measurement used by the platform."""
if (
self._unit_value
and self._unit_value.metadata.unit
and "f" in self._unit_value.metadata.unit.lower()
):
return TEMP_FAHRENHEIT
return TEMP_CELSIUS
@property
def precision(self) -> float:
"""Return the precision of 0.1."""
return PRECISION_TENTHS
@property
def hvac_mode(self) -> str:
"""Return hvac operation ie. heat, cool mode."""
if self._current_mode is None:
# Thermostat(valve) with no support for setting a mode is considered heating-only
return HVAC_MODE_HEAT
if self._current_mode.value is None:
# guard missing value
return HVAC_MODE_HEAT
return ZW_HVAC_MODE_MAP.get(int(self._current_mode.value), HVAC_MODE_HEAT_COOL)
@property
def hvac_modes(self) -> list[str]:
"""Return the list of available hvac operation modes."""
return list(self._hvac_modes)
@property
def hvac_action(self) -> str | None:
"""Return the current running hvac operation if supported."""
if not self._operating_state:
return None
if self._operating_state.value is None:
# guard missing value
return None
return HVAC_CURRENT_MAP.get(int(self._operating_state.value))
@property
def current_humidity(self) -> int | None:
"""Return the current humidity level."""
return get_value_of_zwave_value(self._current_humidity)
@property
def current_temperature(self) -> float | None:
"""Return the current temperature."""
return get_value_of_zwave_value(self._current_temp)
@property
def target_temperature(self) -> float | None:
"""Return the temperature we try to reach."""
if self._current_mode and self._current_mode.value is None:
# guard missing value
return None
try:
temp = self._setpoint_value(self._current_mode_setpoint_enums[0])
except (IndexError, ValueError):
return None
return get_value_of_zwave_value(temp)
@property
def target_temperature_high(self) -> float | None:
"""Return the highbound target temperature we try to reach."""
if self._current_mode and self._current_mode.value is None:
# guard missing value
return None
try:
temp = self._setpoint_value(self._current_mode_setpoint_enums[1])
except (IndexError, ValueError):
return None
return get_value_of_zwave_value(temp)
@property
def target_temperature_low(self) -> float | None:
"""Return the lowbound target temperature we try to reach."""
if self._current_mode and self._current_mode.value is None:
# guard missing value
return None
if len(self._current_mode_setpoint_enums) > 1:
return self.target_temperature
return None
@property
def preset_mode(self) -> str | None:
"""Return the current preset mode, e.g., home, away, temp."""
if self._current_mode and self._current_mode.value is None:
# guard missing value
return None
if self._current_mode and int(self._current_mode.value) not in THERMOSTAT_MODES:
return_val: str = self._current_mode.metadata.states.get(
str(self._current_mode.value)
)
return return_val
return PRESET_NONE
@property
def preset_modes(self) -> list[str] | None:
"""Return a list of available preset modes."""
return list(self._hvac_presets)
@property
def fan_mode(self) -> str | None:
"""Return the fan setting."""
if (
self._fan_mode
and self._fan_mode.value is not None
and str(self._fan_mode.value) in self._fan_mode.metadata.states
):
return cast(str, self._fan_mode.metadata.states[str(self._fan_mode.value)])
return None
@property
def fan_modes(self) -> list[str] | None:
"""Return the list of available fan modes."""
if self._fan_mode and self._fan_mode.metadata.states:
return list(self._fan_mode.metadata.states.values())
return None
@property
def extra_state_attributes(self) -> dict[str, str] | None:
"""Return the optional state attributes."""
if (
self._fan_state
and self._fan_state.value is not None
and str(self._fan_state.value) in self._fan_state.metadata.states
):
return {
ATTR_FAN_STATE: self._fan_state.metadata.states[
str(self._fan_state.value)
]
}
return None
@property
def supported_features(self) -> int:
"""Return the list of supported features."""
return self._supported_features
@property
def min_temp(self) -> float:
"""Return the minimum temperature."""
min_temp = DEFAULT_MIN_TEMP
base_unit = TEMP_CELSIUS
try:
temp = self._setpoint_value(self._current_mode_setpoint_enums[0])
if temp.metadata.min:
min_temp = temp.metadata.min
base_unit = self.temperature_unit
# In case of any error, we fallback to the default
except (IndexError, ValueError, TypeError):
pass
return convert_temperature(min_temp, base_unit, self.temperature_unit)
@property
def max_temp(self) -> float:
"""Return the maximum temperature."""
max_temp = DEFAULT_MAX_TEMP
base_unit = TEMP_CELSIUS
try:
temp = self._setpoint_value(self._current_mode_setpoint_enums[0])
if temp.metadata.max:
max_temp = temp.metadata.max
base_unit = self.temperature_unit
# In case of any error, we fallback to the default
except (IndexError, ValueError, TypeError):
pass
return convert_temperature(max_temp, base_unit, self.temperature_unit)
async def async_set_fan_mode(self, fan_mode: str) -> None:
"""Set new target fan mode."""
if not self._fan_mode:
return
try:
new_state = int(
next(
state
for state, label in self._fan_mode.metadata.states.items()
if label == fan_mode
)
)
except StopIteration:
raise ValueError(f"Received an invalid fan mode: {fan_mode}") from None
await self.info.node.async_set_value(self._fan_mode, new_state)
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
hvac_mode: str | None = kwargs.get(ATTR_HVAC_MODE)
if hvac_mode is not None:
await self.async_set_hvac_mode(hvac_mode)
if len(self._current_mode_setpoint_enums) == 1:
setpoint: ZwaveValue = self._setpoint_value(
self._current_mode_setpoint_enums[0]
)
target_temp: float | None = kwargs.get(ATTR_TEMPERATURE)
if target_temp is not None:
await self.info.node.async_set_value(setpoint, target_temp)
elif len(self._current_mode_setpoint_enums) == 2:
setpoint_low: ZwaveValue = self._setpoint_value(
self._current_mode_setpoint_enums[0]
)
setpoint_high: ZwaveValue = self._setpoint_value(
self._current_mode_setpoint_enums[1]
)
target_temp_low: float | None = kwargs.get(ATTR_TARGET_TEMP_LOW)
target_temp_high: float | None = kwargs.get(ATTR_TARGET_TEMP_HIGH)
if target_temp_low is not None:
await self.info.node.async_set_value(setpoint_low, target_temp_low)
if target_temp_high is not None:
await self.info.node.async_set_value(setpoint_high, target_temp_high)
async def async_set_hvac_mode(self, hvac_mode: str) -> None:
"""Set new target hvac mode."""
if (hvac_mode_id := self._hvac_modes.get(hvac_mode)) is None:
raise ValueError(f"Received an invalid hvac mode: {hvac_mode}")
if not self._current_mode:
# Thermostat(valve) has no support for setting a mode, so we make it a no-op
return
await self.info.node.async_set_value(self._current_mode, hvac_mode_id)
async def async_set_preset_mode(self, preset_mode: str) -> None:
"""Set new target preset mode."""
if preset_mode == PRESET_NONE:
# try to restore to the (translated) main hvac mode
await self.async_set_hvac_mode(self.hvac_mode)
return
preset_mode_value = self._hvac_presets.get(preset_mode)
if preset_mode_value is None:
raise ValueError(f"Received an invalid preset mode: {preset_mode}")
await self.info.node.async_set_value(self._current_mode, preset_mode_value)
class DynamicCurrentTempClimate(ZWaveClimate):
"""Representation of a thermostat that can dynamically use a different Zwave Value for current temp."""
def __init__(
self, config_entry: ConfigEntry, client: ZwaveClient, info: ZwaveDiscoveryInfo
) -> None:
"""Initialize thermostat."""
super().__init__(config_entry, client, info)
self.data_template = cast(
DynamicCurrentTempClimateDataTemplate, self.info.platform_data_template
)
@property
def current_temperature(self) -> float | None:
"""Return the current temperature."""
assert self.info.platform_data
val = get_value_of_zwave_value(
self.data_template.current_temperature_value(self.info.platform_data)
)
return val if val is not None else super().current_temperature
|
jawilson/home-assistant
|
homeassistant/components/zwave_js/climate.py
|
Python
|
apache-2.0
| 19,729 |
/*!
* Ext JS Library 3.3.1
* Copyright(c) 2006-2010 Sencha Inc.
* [email protected]
* http://www.sencha.com/license
*/
.x-resizable-handle {
background-color:#fff;
color: #000;
}
.x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east,
.x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west
{
background-image:url(../images/access/sizer/e-handle.gif);
}
.x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south,
.x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north
{
background-image:url(../images/access/sizer/s-handle.gif);
}
.x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north{
background-image:url(../images/access/sizer/s-handle.gif);
}
.x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{
background-image:url(../images/access/sizer/se-handle.gif);
}
.x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{
background-image:url(../images/access/sizer/nw-handle.gif);
}
.x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{
background-image:url(../images/access/sizer/ne-handle.gif);
}
.x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{
background-image:url(../images/access/sizer/sw-handle.gif);
}
.x-resizable-proxy{
border-color:#3b5a82;
}
.x-resizable-overlay{
background-color:#fff;
}
|
srinivasiyerb/Scholst
|
target/Scholastic/static/js/ext/resources/css/theme-access/resizable.css
|
CSS
|
apache-2.0
| 1,652 |
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.kie.dmn.feel.runtime.functions;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.kie.dmn.api.feel.runtime.events.FEELEvent;
import org.kie.dmn.api.feel.runtime.events.FEELEvent.Severity;
import org.kie.dmn.feel.runtime.events.InvalidParametersEvent;
import org.kie.dmn.feel.runtime.functions.FEELFnResult;
public class MaxFunction
extends BaseFEELFunction {
public MaxFunction() {
super( "max" );
}
public FEELFnResult<Object> invoke(@ParameterName("list") List list) {
if ( list == null ) {
return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "list", "cannot be null"));
} else {
return FEELFnResult.ofResult( Collections.max( list ) );
}
}
public FEELFnResult<Object> invoke(@ParameterName("c") Object[] list) {
if ( list == null ) {
// Arrays.asList does not accept null as parameter
return FEELFnResult.ofError(new InvalidParametersEvent(Severity.ERROR, "c", "cannot be null"));
}
return invoke( Arrays.asList( list ) );
}
}
|
ngs-mtech/drools
|
kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/runtime/functions/MaxFunction.java
|
Java
|
apache-2.0
| 1,776 |
# AUTOGENERATED FILE
FROM balenalib/am571x-evm-alpine:edge-build
# Default to UTF-8 file.encoding
ENV LANG C.UTF-8
# add a simple script that can auto-detect the appropriate JAVA_HOME value
# based on whether the JDK or only the JRE is installed
RUN { \
echo '#!/bin/sh'; \
echo 'set -e'; \
echo; \
echo 'dirname "$(dirname "$(readlink -f "$(which javac || which java)")")"'; \
} > /usr/local/bin/docker-java-home \
&& chmod +x /usr/local/bin/docker-java-home
ENV JAVA_HOME /usr/lib/jvm/java-1.7-openjdk
ENV PATH $PATH:/usr/lib/jvm/java-1.7-openjdk/jre/bin:/usr/lib/jvm/java-1.7-openjdk/bin
RUN set -x \
&& apk add --no-cache \
openjdk7-jre \
&& [ "$JAVA_HOME" = "$(docker-java-home)" ]
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Alpine Linux edge \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nOpenJDK v7-jre \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo $'#!/bin/bash\nbalena-info\nbusybox ln -sf /bin/busybox /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& ln -f /bin/sh /bin/sh.real \
&& ln -f /bin/sh-shim /bin/sh
|
nghiant2710/base-images
|
balena-base-images/openjdk/am571x-evm/alpine/edge/7-jre/build/Dockerfile
|
Dockerfile
|
apache-2.0
| 1,763 |
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/lightsail/Lightsail_EXPORTS.h>
#include <aws/lightsail/LightsailRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace Lightsail
{
namespace Model
{
/**
*/
class AWS_LIGHTSAIL_API GetBlueprintsRequest : public LightsailRequest
{
public:
GetBlueprintsRequest();
Aws::String SerializePayload() const override;
Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
/**
* <p>A Boolean value indicating whether to include inactive results in your
* request.</p>
*/
inline bool GetIncludeInactive() const{ return m_includeInactive; }
/**
* <p>A Boolean value indicating whether to include inactive results in your
* request.</p>
*/
inline void SetIncludeInactive(bool value) { m_includeInactiveHasBeenSet = true; m_includeInactive = value; }
/**
* <p>A Boolean value indicating whether to include inactive results in your
* request.</p>
*/
inline GetBlueprintsRequest& WithIncludeInactive(bool value) { SetIncludeInactive(value); return *this;}
/**
* <p>A token used for advancing to the next page of results from your get
* blueprints request.</p>
*/
inline const Aws::String& GetPageToken() const{ return m_pageToken; }
/**
* <p>A token used for advancing to the next page of results from your get
* blueprints request.</p>
*/
inline void SetPageToken(const Aws::String& value) { m_pageTokenHasBeenSet = true; m_pageToken = value; }
/**
* <p>A token used for advancing to the next page of results from your get
* blueprints request.</p>
*/
inline void SetPageToken(Aws::String&& value) { m_pageTokenHasBeenSet = true; m_pageToken = std::move(value); }
/**
* <p>A token used for advancing to the next page of results from your get
* blueprints request.</p>
*/
inline void SetPageToken(const char* value) { m_pageTokenHasBeenSet = true; m_pageToken.assign(value); }
/**
* <p>A token used for advancing to the next page of results from your get
* blueprints request.</p>
*/
inline GetBlueprintsRequest& WithPageToken(const Aws::String& value) { SetPageToken(value); return *this;}
/**
* <p>A token used for advancing to the next page of results from your get
* blueprints request.</p>
*/
inline GetBlueprintsRequest& WithPageToken(Aws::String&& value) { SetPageToken(std::move(value)); return *this;}
/**
* <p>A token used for advancing to the next page of results from your get
* blueprints request.</p>
*/
inline GetBlueprintsRequest& WithPageToken(const char* value) { SetPageToken(value); return *this;}
private:
bool m_includeInactive;
bool m_includeInactiveHasBeenSet;
Aws::String m_pageToken;
bool m_pageTokenHasBeenSet;
};
} // namespace Model
} // namespace Lightsail
} // namespace Aws
|
chiaming0914/awe-cpp-sdk
|
aws-cpp-sdk-lightsail/include/aws/lightsail/model/GetBlueprintsRequest.h
|
C
|
apache-2.0
| 3,553 |
/* ---------------------------------------------------------------------------- */
/* Atmel Microcontroller Software Support */
/* SAM Software Package License */
/* ---------------------------------------------------------------------------- */
/* Copyright (c) 2014, Atmel Corporation */
/* */
/* All rights reserved. */
/* */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following condition is met: */
/* */
/* - Redistributions of source code must retain the above copyright notice, */
/* this list of conditions and the disclaimer below. */
/* */
/* Atmel's name may not be used to endorse or promote products derived from */
/* this software without specific prior written permission. */
/* */
/* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */
/* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */
/* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */
/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
/* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
/* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
/* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
/* ---------------------------------------------------------------------------- */
#ifndef _SAM3U4E_PIO_
#define _SAM3U4E_PIO_
#define PIO_PA0 (1u << 0) /**< \brief Pin Controlled by PA0 */
#define PIO_PA1 (1u << 1) /**< \brief Pin Controlled by PA1 */
#define PIO_PA2 (1u << 2) /**< \brief Pin Controlled by PA2 */
#define PIO_PA3 (1u << 3) /**< \brief Pin Controlled by PA3 */
#define PIO_PA4 (1u << 4) /**< \brief Pin Controlled by PA4 */
#define PIO_PA5 (1u << 5) /**< \brief Pin Controlled by PA5 */
#define PIO_PA6 (1u << 6) /**< \brief Pin Controlled by PA6 */
#define PIO_PA7 (1u << 7) /**< \brief Pin Controlled by PA7 */
#define PIO_PA8 (1u << 8) /**< \brief Pin Controlled by PA8 */
#define PIO_PA9 (1u << 9) /**< \brief Pin Controlled by PA9 */
#define PIO_PA10 (1u << 10) /**< \brief Pin Controlled by PA10 */
#define PIO_PA11 (1u << 11) /**< \brief Pin Controlled by PA11 */
#define PIO_PA12 (1u << 12) /**< \brief Pin Controlled by PA12 */
#define PIO_PA13 (1u << 13) /**< \brief Pin Controlled by PA13 */
#define PIO_PA14 (1u << 14) /**< \brief Pin Controlled by PA14 */
#define PIO_PA15 (1u << 15) /**< \brief Pin Controlled by PA15 */
#define PIO_PA16 (1u << 16) /**< \brief Pin Controlled by PA16 */
#define PIO_PA17 (1u << 17) /**< \brief Pin Controlled by PA17 */
#define PIO_PA18 (1u << 18) /**< \brief Pin Controlled by PA18 */
#define PIO_PA19 (1u << 19) /**< \brief Pin Controlled by PA19 */
#define PIO_PA20 (1u << 20) /**< \brief Pin Controlled by PA20 */
#define PIO_PA21 (1u << 21) /**< \brief Pin Controlled by PA21 */
#define PIO_PA22 (1u << 22) /**< \brief Pin Controlled by PA22 */
#define PIO_PA23 (1u << 23) /**< \brief Pin Controlled by PA23 */
#define PIO_PA24 (1u << 24) /**< \brief Pin Controlled by PA24 */
#define PIO_PA25 (1u << 25) /**< \brief Pin Controlled by PA25 */
#define PIO_PA26 (1u << 26) /**< \brief Pin Controlled by PA26 */
#define PIO_PA27 (1u << 27) /**< \brief Pin Controlled by PA27 */
#define PIO_PA28 (1u << 28) /**< \brief Pin Controlled by PA28 */
#define PIO_PA29 (1u << 29) /**< \brief Pin Controlled by PA29 */
#define PIO_PA30 (1u << 30) /**< \brief Pin Controlled by PA30 */
#define PIO_PA31 (1u << 31) /**< \brief Pin Controlled by PA31 */
#define PIO_PB0 (1u << 0) /**< \brief Pin Controlled by PB0 */
#define PIO_PB1 (1u << 1) /**< \brief Pin Controlled by PB1 */
#define PIO_PB2 (1u << 2) /**< \brief Pin Controlled by PB2 */
#define PIO_PB3 (1u << 3) /**< \brief Pin Controlled by PB3 */
#define PIO_PB4 (1u << 4) /**< \brief Pin Controlled by PB4 */
#define PIO_PB5 (1u << 5) /**< \brief Pin Controlled by PB5 */
#define PIO_PB6 (1u << 6) /**< \brief Pin Controlled by PB6 */
#define PIO_PB7 (1u << 7) /**< \brief Pin Controlled by PB7 */
#define PIO_PB8 (1u << 8) /**< \brief Pin Controlled by PB8 */
#define PIO_PB9 (1u << 9) /**< \brief Pin Controlled by PB9 */
#define PIO_PB10 (1u << 10) /**< \brief Pin Controlled by PB10 */
#define PIO_PB11 (1u << 11) /**< \brief Pin Controlled by PB11 */
#define PIO_PB12 (1u << 12) /**< \brief Pin Controlled by PB12 */
#define PIO_PB13 (1u << 13) /**< \brief Pin Controlled by PB13 */
#define PIO_PB14 (1u << 14) /**< \brief Pin Controlled by PB14 */
#define PIO_PB15 (1u << 15) /**< \brief Pin Controlled by PB15 */
#define PIO_PB16 (1u << 16) /**< \brief Pin Controlled by PB16 */
#define PIO_PB17 (1u << 17) /**< \brief Pin Controlled by PB17 */
#define PIO_PB18 (1u << 18) /**< \brief Pin Controlled by PB18 */
#define PIO_PB19 (1u << 19) /**< \brief Pin Controlled by PB19 */
#define PIO_PB20 (1u << 20) /**< \brief Pin Controlled by PB20 */
#define PIO_PB21 (1u << 21) /**< \brief Pin Controlled by PB21 */
#define PIO_PB22 (1u << 22) /**< \brief Pin Controlled by PB22 */
#define PIO_PB23 (1u << 23) /**< \brief Pin Controlled by PB23 */
#define PIO_PB24 (1u << 24) /**< \brief Pin Controlled by PB24 */
#define PIO_PB25 (1u << 25) /**< \brief Pin Controlled by PB25 */
#define PIO_PB26 (1u << 26) /**< \brief Pin Controlled by PB26 */
#define PIO_PB27 (1u << 27) /**< \brief Pin Controlled by PB27 */
#define PIO_PB28 (1u << 28) /**< \brief Pin Controlled by PB28 */
#define PIO_PB29 (1u << 29) /**< \brief Pin Controlled by PB29 */
#define PIO_PB30 (1u << 30) /**< \brief Pin Controlled by PB30 */
#define PIO_PB31 (1u << 31) /**< \brief Pin Controlled by PB31 */
#define PIO_PC0 (1u << 0) /**< \brief Pin Controlled by PC0 */
#define PIO_PC1 (1u << 1) /**< \brief Pin Controlled by PC1 */
#define PIO_PC2 (1u << 2) /**< \brief Pin Controlled by PC2 */
#define PIO_PC3 (1u << 3) /**< \brief Pin Controlled by PC3 */
#define PIO_PC4 (1u << 4) /**< \brief Pin Controlled by PC4 */
#define PIO_PC5 (1u << 5) /**< \brief Pin Controlled by PC5 */
#define PIO_PC6 (1u << 6) /**< \brief Pin Controlled by PC6 */
#define PIO_PC7 (1u << 7) /**< \brief Pin Controlled by PC7 */
#define PIO_PC8 (1u << 8) /**< \brief Pin Controlled by PC8 */
#define PIO_PC9 (1u << 9) /**< \brief Pin Controlled by PC9 */
#define PIO_PC10 (1u << 10) /**< \brief Pin Controlled by PC10 */
#define PIO_PC11 (1u << 11) /**< \brief Pin Controlled by PC11 */
#define PIO_PC12 (1u << 12) /**< \brief Pin Controlled by PC12 */
#define PIO_PC13 (1u << 13) /**< \brief Pin Controlled by PC13 */
#define PIO_PC14 (1u << 14) /**< \brief Pin Controlled by PC14 */
#define PIO_PC15 (1u << 15) /**< \brief Pin Controlled by PC15 */
#define PIO_PC16 (1u << 16) /**< \brief Pin Controlled by PC16 */
#define PIO_PC17 (1u << 17) /**< \brief Pin Controlled by PC17 */
#define PIO_PC18 (1u << 18) /**< \brief Pin Controlled by PC18 */
#define PIO_PC19 (1u << 19) /**< \brief Pin Controlled by PC19 */
#define PIO_PC20 (1u << 20) /**< \brief Pin Controlled by PC20 */
#define PIO_PC21 (1u << 21) /**< \brief Pin Controlled by PC21 */
#define PIO_PC22 (1u << 22) /**< \brief Pin Controlled by PC22 */
#define PIO_PC23 (1u << 23) /**< \brief Pin Controlled by PC23 */
#define PIO_PC24 (1u << 24) /**< \brief Pin Controlled by PC24 */
#define PIO_PC25 (1u << 25) /**< \brief Pin Controlled by PC25 */
#define PIO_PC26 (1u << 26) /**< \brief Pin Controlled by PC26 */
#define PIO_PC27 (1u << 27) /**< \brief Pin Controlled by PC27 */
#define PIO_PC28 (1u << 28) /**< \brief Pin Controlled by PC28 */
#define PIO_PC29 (1u << 29) /**< \brief Pin Controlled by PC29 */
#define PIO_PC30 (1u << 30) /**< \brief Pin Controlled by PC30 */
#define PIO_PC31 (1u << 31) /**< \brief Pin Controlled by PC31 */
/* ========== Pio definition for ADC peripheral ========== */
#define PIO_PB5X1_AD0 (1u << 5) /**< \brief Adc signal: AD0 */
#define PIO_PB6X1_AD1 (1u << 6) /**< \brief Adc signal: AD1 */
#define PIO_PB7X1_AD2 (1u << 7) /**< \brief Adc signal: AD2 */
#define PIO_PB8X1_AD3 (1u << 8) /**< \brief Adc signal: AD3 */
#define PIO_PC28X1_AD4 (1u << 28) /**< \brief Adc signal: AD4 */
#define PIO_PC29X1_AD5 (1u << 29) /**< \brief Adc signal: AD5 */
#define PIO_PC30X1_AD6 (1u << 30) /**< \brief Adc signal: AD6 */
#define PIO_PC31X1_AD7 (1u << 31) /**< \brief Adc signal: AD7 */
#define PIO_PA17B_ADTRG (1u << 17) /**< \brief Adc signal: ADTRG */
/* ========== Pio definition for ADC12B peripheral ========== */
#define PIO_PA22X1_AD12B0 (1u << 22) /**< \brief Adc12b signal: AD12B0 */
#define PIO_PA30X1_AD12B1 (1u << 30) /**< \brief Adc12b signal: AD12B1 */
#define PIO_PB3X1_AD12B2 (1u << 3) /**< \brief Adc12b signal: AD12B2 */
#define PIO_PB4X1_AD12B3 (1u << 4) /**< \brief Adc12b signal: AD12B3 */
#define PIO_PC15X1_AD12B4 (1u << 15) /**< \brief Adc12b signal: AD12B4 */
#define PIO_PC16X1_AD12B5 (1u << 16) /**< \brief Adc12b signal: AD12B5 */
#define PIO_PC17X1_AD12B6 (1u << 17) /**< \brief Adc12b signal: AD12B6 */
#define PIO_PC18X1_AD12B7 (1u << 18) /**< \brief Adc12b signal: AD12B7 */
#define PIO_PA2B_AD12BTRG (1u << 2) /**< \brief Adc12b signal: AD12BTRG */
/* ========== Pio definition for EBI peripheral ========== */
#define PIO_PB7B_A0 (1u << 7) /**< \brief Ebi signal: A0/NBS0 */
#define PIO_PB7B_NBS0 (1u << 7) /**< \brief Ebi signal: A0/NBS0 */
#define PIO_PB8B_A1 (1u << 8) /**< \brief Ebi signal: A1 */
#define PIO_PC8A_A10 (1u << 8) /**< \brief Ebi signal: A10 */
#define PIO_PC9A_A11 (1u << 9) /**< \brief Ebi signal: A11 */
#define PIO_PC10A_A12 (1u << 10) /**< \brief Ebi signal: A12 */
#define PIO_PC11A_A13 (1u << 11) /**< \brief Ebi signal: A13 */
#define PIO_PC20A_A14 (1u << 20) /**< \brief Ebi signal: A14 */
#define PIO_PC21A_A15 (1u << 21) /**< \brief Ebi signal: A15 */
#define PIO_PC22A_A16 (1u << 22) /**< \brief Ebi signal: A16 */
#define PIO_PC23A_A17 (1u << 23) /**< \brief Ebi signal: A17 */
#define PIO_PC24A_A18 (1u << 24) /**< \brief Ebi signal: A18 */
#define PIO_PC25A_A19 (1u << 25) /**< \brief Ebi signal: A19 */
#define PIO_PB0B_A2 (1u << 0) /**< \brief Ebi signal: A2 */
#define PIO_PC0A_A2 (1u << 0) /**< \brief Ebi signal: A2 */
#define PIO_PC13A_A2 (1u << 13) /**< \brief Ebi signal: A2 */
#define PIO_PC26A_A20 (1u << 26) /**< \brief Ebi signal: A20 */
#define PIO_PB21A_A21 (1u << 21) /**< \brief Ebi signal: A21/NANDALE */
#define PIO_PB21A_NANDALE (1u << 21) /**< \brief Ebi signal: A21/NANDALE */
#define PIO_PB22A_A22 (1u << 22) /**< \brief Ebi signal: A22/NANDCLE */
#define PIO_PB22A_NANDCLE (1u << 22) /**< \brief Ebi signal: A22/NANDCLE */
#define PIO_PC27A_A23 (1u << 27) /**< \brief Ebi signal: A23 */
#define PIO_PB1B_A3 (1u << 1) /**< \brief Ebi signal: A3 */
#define PIO_PC1A_A3 (1u << 1) /**< \brief Ebi signal: A3 */
#define PIO_PC14A_A3 (1u << 14) /**< \brief Ebi signal: A3 */
#define PIO_PB2B_A4 (1u << 2) /**< \brief Ebi signal: A4 */
#define PIO_PC2A_A4 (1u << 2) /**< \brief Ebi signal: A4 */
#define PIO_PB3B_A5 (1u << 3) /**< \brief Ebi signal: A5 */
#define PIO_PC3A_A5 (1u << 3) /**< \brief Ebi signal: A5 */
#define PIO_PB4B_A6 (1u << 4) /**< \brief Ebi signal: A6 */
#define PIO_PC4A_A6 (1u << 4) /**< \brief Ebi signal: A6 */
#define PIO_PB5B_A7 (1u << 5) /**< \brief Ebi signal: A7 */
#define PIO_PC5A_A7 (1u << 5) /**< \brief Ebi signal: A7 */
#define PIO_PC6A_A8 (1u << 6) /**< \brief Ebi signal: A8 */
#define PIO_PC7A_A9 (1u << 7) /**< \brief Ebi signal: A9 */
#define PIO_PB9A_D0 (1u << 9) /**< \brief Ebi signal: D0 */
#define PIO_PB10A_D1 (1u << 10) /**< \brief Ebi signal: D1 */
#define PIO_PB27A_D10 (1u << 27) /**< \brief Ebi signal: D10 */
#define PIO_PB28A_D11 (1u << 28) /**< \brief Ebi signal: D11 */
#define PIO_PB29A_D12 (1u << 29) /**< \brief Ebi signal: D12 */
#define PIO_PB30A_D13 (1u << 30) /**< \brief Ebi signal: D13 */
#define PIO_PB31A_D14 (1u << 31) /**< \brief Ebi signal: D14 */
#define PIO_PB6B_D15 (1u << 6) /**< \brief Ebi signal: D15 */
#define PIO_PB11A_D2 (1u << 11) /**< \brief Ebi signal: D2 */
#define PIO_PB12A_D3 (1u << 12) /**< \brief Ebi signal: D3 */
#define PIO_PB13A_D4 (1u << 13) /**< \brief Ebi signal: D4 */
#define PIO_PB14A_D5 (1u << 14) /**< \brief Ebi signal: D5 */
#define PIO_PB15A_D6 (1u << 15) /**< \brief Ebi signal: D6 */
#define PIO_PB16A_D7 (1u << 16) /**< \brief Ebi signal: D7 */
#define PIO_PB25A_D8 (1u << 25) /**< \brief Ebi signal: D8 */
#define PIO_PB26A_D9 (1u << 26) /**< \brief Ebi signal: D9 */
#define PIO_PB17A_NANDOE (1u << 17) /**< \brief Ebi signal: NANDOE */
#define PIO_PB24A_NANDRDY (1u << 24) /**< \brief Ebi signal: NANDRDY */
#define PIO_PB18A_NANDWE (1u << 18) /**< \brief Ebi signal: NANDWE */
#define PIO_PB20A_NCS0 (1u << 20) /**< \brief Ebi signal: NCS0 */
#define PIO_PA16B_NCS1 (1u << 16) /**< \brief Ebi signal: NCS1 */
#define PIO_PC12A_NCS1 (1u << 12) /**< \brief Ebi signal: NCS1 */
#define PIO_PC16A_NCS2 (1u << 16) /**< \brief Ebi signal: NCS2 */
#define PIO_PC17A_NCS3 (1u << 17) /**< \brief Ebi signal: NCS3 */
#define PIO_PB19A_NRD (1u << 19) /**< \brief Ebi signal: NRD */
#define PIO_PC18A_NWAIT (1u << 18) /**< \brief Ebi signal: NWAIT */
#define PIO_PB23A_NWR0 (1u << 23) /**< \brief Ebi signal: NWR0/NWE */
#define PIO_PB23A_NWE (1u << 23) /**< \brief Ebi signal: NWR0/NWE */
#define PIO_PC15A_NWR1 (1u << 15) /**< \brief Ebi signal: NWR1/NBS1 */
#define PIO_PC15A_NBS1 (1u << 15) /**< \brief Ebi signal: NWR1/NBS1 */
/* ========== Pio definition for HSMCI peripheral ========== */
#define PIO_PA4A_MCCDA (1u << 4) /**< \brief Hsmci signal: MCCDA */
#define PIO_PA3A_MCCK (1u << 3) /**< \brief Hsmci signal: MCCK */
#define PIO_PA5A_MCDA0 (1u << 5) /**< \brief Hsmci signal: MCDA0 */
#define PIO_PA6A_MCDA1 (1u << 6) /**< \brief Hsmci signal: MCDA1 */
#define PIO_PA7A_MCDA2 (1u << 7) /**< \brief Hsmci signal: MCDA2 */
#define PIO_PA8A_MCDA3 (1u << 8) /**< \brief Hsmci signal: MCDA3 */
#define PIO_PC28B_MCDA4 (1u << 28) /**< \brief Hsmci signal: MCDA4 */
#define PIO_PC29B_MCDA5 (1u << 29) /**< \brief Hsmci signal: MCDA5 */
#define PIO_PC30B_MCDA6 (1u << 30) /**< \brief Hsmci signal: MCDA6 */
#define PIO_PC31B_MCDA7 (1u << 31) /**< \brief Hsmci signal: MCDA7 */
/* ========== Pio definition for PMC peripheral ========== */
#define PIO_PA21B_PCK0 (1u << 21) /**< \brief Pmc signal: PCK0 */
#define PIO_PA27B_PCK0 (1u << 27) /**< \brief Pmc signal: PCK0 */
#define PIO_PA3B_PCK1 (1u << 3) /**< \brief Pmc signal: PCK1 */
#define PIO_PB24B_PCK1 (1u << 24) /**< \brief Pmc signal: PCK1 */
#define PIO_PB23B_PCK2 (1u << 23) /**< \brief Pmc signal: PCK2 */
/* ========== Pio definition for PWM peripheral ========== */
#define PIO_PA11B_PWMFI0 (1u << 11) /**< \brief Pwm signal: PWMFI0 */
#define PIO_PA12B_PWMFI1 (1u << 12) /**< \brief Pwm signal: PWMFI1 */
#define PIO_PA18B_PWMFI2 (1u << 18) /**< \brief Pwm signal: PWMFI2 */
#define PIO_PA4B_PWMH0 (1u << 4) /**< \brief Pwm signal: PWMH0 */
#define PIO_PA28B_PWMH0 (1u << 28) /**< \brief Pwm signal: PWMH0 */
#define PIO_PB0A_PWMH0 (1u << 0) /**< \brief Pwm signal: PWMH0 */
#define PIO_PB13B_PWMH0 (1u << 13) /**< \brief Pwm signal: PWMH0 */
#define PIO_PC24B_PWMH0 (1u << 24) /**< \brief Pwm signal: PWMH0 */
#define PIO_PA5B_PWMH1 (1u << 5) /**< \brief Pwm signal: PWMH1 */
#define PIO_PA29B_PWMH1 (1u << 29) /**< \brief Pwm signal: PWMH1 */
#define PIO_PB1A_PWMH1 (1u << 1) /**< \brief Pwm signal: PWMH1 */
#define PIO_PB14B_PWMH1 (1u << 14) /**< \brief Pwm signal: PWMH1 */
#define PIO_PC25B_PWMH1 (1u << 25) /**< \brief Pwm signal: PWMH1 */
#define PIO_PA6B_PWMH2 (1u << 6) /**< \brief Pwm signal: PWMH2 */
#define PIO_PA15B_PWMH2 (1u << 15) /**< \brief Pwm signal: PWMH2 */
#define PIO_PB2A_PWMH2 (1u << 2) /**< \brief Pwm signal: PWMH2 */
#define PIO_PB15B_PWMH2 (1u << 15) /**< \brief Pwm signal: PWMH2 */
#define PIO_PC26B_PWMH2 (1u << 26) /**< \brief Pwm signal: PWMH2 */
#define PIO_PA20B_PWMH3 (1u << 20) /**< \brief Pwm signal: PWMH3 */
#define PIO_PB3A_PWMH3 (1u << 3) /**< \brief Pwm signal: PWMH3 */
#define PIO_PB16B_PWMH3 (1u << 16) /**< \brief Pwm signal: PWMH3 */
#define PIO_PC27B_PWMH3 (1u << 27) /**< \brief Pwm signal: PWMH3 */
#define PIO_PA7B_PWML0 (1u << 7) /**< \brief Pwm signal: PWML0 */
#define PIO_PB17B_PWML0 (1u << 17) /**< \brief Pwm signal: PWML0 */
#define PIO_PB25B_PWML0 (1u << 25) /**< \brief Pwm signal: PWML0 */
#define PIO_PC6B_PWML0 (1u << 6) /**< \brief Pwm signal: PWML0 */
#define PIO_PC29A_PWML0 (1u << 29) /**< \brief Pwm signal: PWML0 */
#define PIO_PA8B_PWML1 (1u << 8) /**< \brief Pwm signal: PWML1 */
#define PIO_PB18B_PWML1 (1u << 18) /**< \brief Pwm signal: PWML1 */
#define PIO_PB26B_PWML1 (1u << 26) /**< \brief Pwm signal: PWML1 */
#define PIO_PC7B_PWML1 (1u << 7) /**< \brief Pwm signal: PWML1 */
#define PIO_PC30A_PWML1 (1u << 30) /**< \brief Pwm signal: PWML1 */
#define PIO_PA9B_PWML2 (1u << 9) /**< \brief Pwm signal: PWML2 */
#define PIO_PB19B_PWML2 (1u << 19) /**< \brief Pwm signal: PWML2 */
#define PIO_PB27B_PWML2 (1u << 27) /**< \brief Pwm signal: PWML2 */
#define PIO_PC8B_PWML2 (1u << 8) /**< \brief Pwm signal: PWML2 */
#define PIO_PC31A_PWML2 (1u << 31) /**< \brief Pwm signal: PWML2 */
#define PIO_PA10B_PWML3 (1u << 10) /**< \brief Pwm signal: PWML3 */
#define PIO_PB20B_PWML3 (1u << 20) /**< \brief Pwm signal: PWML3 */
#define PIO_PB28B_PWML3 (1u << 28) /**< \brief Pwm signal: PWML3 */
#define PIO_PC9B_PWML3 (1u << 9) /**< \brief Pwm signal: PWML3 */
#define PIO_PC16B_PWML3 (1u << 16) /**< \brief Pwm signal: PWML3 */
/* ========== Pio definition for SPI peripheral ========== */
#define PIO_PA13A_MISO (1u << 13) /**< \brief Spi signal: MISO */
#define PIO_PA14A_MOSI (1u << 14) /**< \brief Spi signal: MOSI */
#define PIO_PA16A_NPCS0 (1u << 16) /**< \brief Spi signal: NPCS0 */
#define PIO_PA0B_NPCS1 (1u << 0) /**< \brief Spi signal: NPCS1 */
#define PIO_PC3B_NPCS1 (1u << 3) /**< \brief Spi signal: NPCS1 */
#define PIO_PC19B_NPCS1 (1u << 19) /**< \brief Spi signal: NPCS1 */
#define PIO_PA1B_NPCS2 (1u << 1) /**< \brief Spi signal: NPCS2 */
#define PIO_PC4B_NPCS2 (1u << 4) /**< \brief Spi signal: NPCS2 */
#define PIO_PC14B_NPCS2 (1u << 14) /**< \brief Spi signal: NPCS2 */
#define PIO_PA19B_NPCS3 (1u << 19) /**< \brief Spi signal: NPCS3 */
#define PIO_PC5B_NPCS3 (1u << 5) /**< \brief Spi signal: NPCS3 */
#define PIO_PA15A_SPCK (1u << 15) /**< \brief Spi signal: SPCK */
/* ========== Pio definition for SSC peripheral ========== */
#define PIO_PA27A_RD (1u << 27) /**< \brief Ssc signal: RD */
#define PIO_PA31A_RF (1u << 31) /**< \brief Ssc signal: RF */
#define PIO_PA29A_RK (1u << 29) /**< \brief Ssc signal: RK */
#define PIO_PA26A_TD (1u << 26) /**< \brief Ssc signal: TD */
#define PIO_PA30A_TF (1u << 30) /**< \brief Ssc signal: TF */
#define PIO_PA28A_TK (1u << 28) /**< \brief Ssc signal: TK */
/* ========== Pio definition for TC0 peripheral ========== */
#define PIO_PA2A_TCLK0 (1u << 2) /**< \brief Tc0 signal: TCLK0 */
#define PIO_PB4A_TCLK1 (1u << 4) /**< \brief Tc0 signal: TCLK1 */
#define PIO_PA26B_TCLK2 (1u << 26) /**< \brief Tc0 signal: TCLK2 */
#define PIO_PA1A_TIOA0 (1u << 1) /**< \brief Tc0 signal: TIOA0 */
#define PIO_PB5A_TIOA1 (1u << 5) /**< \brief Tc0 signal: TIOA1 */
#define PIO_PA30B_TIOA2 (1u << 30) /**< \brief Tc0 signal: TIOA2 */
#define PIO_PA0A_TIOB0 (1u << 0) /**< \brief Tc0 signal: TIOB0 */
#define PIO_PB6A_TIOB1 (1u << 6) /**< \brief Tc0 signal: TIOB1 */
#define PIO_PA31B_TIOB2 (1u << 31) /**< \brief Tc0 signal: TIOB2 */
/* ========== Pio definition for TWI0 peripheral ========== */
#define PIO_PA10A_TWCK0 (1u << 10) /**< \brief Twi0 signal: TWCK0 */
#define PIO_PA9A_TWD0 (1u << 9) /**< \brief Twi0 signal: TWD0 */
/* ========== Pio definition for TWI1 peripheral ========== */
#define PIO_PA25A_TWCK1 (1u << 25) /**< \brief Twi1 signal: TWCK1 */
#define PIO_PA24A_TWD1 (1u << 24) /**< \brief Twi1 signal: TWD1 */
/* ========== Pio definition for UART peripheral ========== */
#define PIO_PA11A_URXD (1u << 11) /**< \brief Uart signal: URXD */
#define PIO_PA12A_UTXD (1u << 12) /**< \brief Uart signal: UTXD */
/* ========== Pio definition for USART0 peripheral ========== */
#define PIO_PB8A_CTS0 (1u << 8) /**< \brief Usart0 signal: CTS0 */
#define PIO_PB11B_DCD0 (1u << 11) /**< \brief Usart0 signal: DCD0 */
#define PIO_PB10B_DSR0 (1u << 10) /**< \brief Usart0 signal: DSR0 */
#define PIO_PB9B_DTR0 (1u << 9) /**< \brief Usart0 signal: DTR0 */
#define PIO_PB12B_RI0 (1u << 12) /**< \brief Usart0 signal: RI0 */
#define PIO_PB7A_RTS0 (1u << 7) /**< \brief Usart0 signal: RTS0 */
#define PIO_PA19A_RXD0 (1u << 19) /**< \brief Usart0 signal: RXD0 */
#define PIO_PA17A_SCK0 (1u << 17) /**< \brief Usart0 signal: SCK0 */
#define PIO_PA18A_TXD0 (1u << 18) /**< \brief Usart0 signal: TXD0 */
/* ========== Pio definition for USART1 peripheral ========== */
#define PIO_PA23B_CTS1 (1u << 23) /**< \brief Usart1 signal: CTS1 */
#define PIO_PA22B_RTS1 (1u << 22) /**< \brief Usart1 signal: RTS1 */
#define PIO_PA21A_RXD1 (1u << 21) /**< \brief Usart1 signal: RXD1 */
#define PIO_PA24B_SCK1 (1u << 24) /**< \brief Usart1 signal: SCK1 */
#define PIO_PA20A_TXD1 (1u << 20) /**< \brief Usart1 signal: TXD1 */
/* ========== Pio definition for USART2 peripheral ========== */
#define PIO_PB22B_CTS2 (1u << 22) /**< \brief Usart2 signal: CTS2 */
#define PIO_PB21B_RTS2 (1u << 21) /**< \brief Usart2 signal: RTS2 */
#define PIO_PA23A_RXD2 (1u << 23) /**< \brief Usart2 signal: RXD2 */
#define PIO_PA25B_SCK2 (1u << 25) /**< \brief Usart2 signal: SCK2 */
#define PIO_PA22A_TXD2 (1u << 22) /**< \brief Usart2 signal: TXD2 */
/* ========== Pio definition for USART3 peripheral ========== */
#define PIO_PC10B_CTS3 (1u << 10) /**< \brief Usart3 signal: CTS3 */
#define PIO_PC11B_RTS3 (1u << 11) /**< \brief Usart3 signal: RTS3 */
#define PIO_PC13B_RXD3 (1u << 13) /**< \brief Usart3 signal: RXD3 */
#define PIO_PC19A_SCK3 (1u << 19) /**< \brief Usart3 signal: SCK3 */
#define PIO_PC12B_TXD3 (1u << 12) /**< \brief Usart3 signal: TXD3 */
/* ========== Pio indexes ========== */
#define PIO_PA0_IDX 0
#define PIO_PA1_IDX 1
#define PIO_PA2_IDX 2
#define PIO_PA3_IDX 3
#define PIO_PA4_IDX 4
#define PIO_PA5_IDX 5
#define PIO_PA6_IDX 6
#define PIO_PA7_IDX 7
#define PIO_PA8_IDX 8
#define PIO_PA9_IDX 9
#define PIO_PA10_IDX 10
#define PIO_PA11_IDX 11
#define PIO_PA12_IDX 12
#define PIO_PA13_IDX 13
#define PIO_PA14_IDX 14
#define PIO_PA15_IDX 15
#define PIO_PA16_IDX 16
#define PIO_PA17_IDX 17
#define PIO_PA18_IDX 18
#define PIO_PA19_IDX 19
#define PIO_PA20_IDX 20
#define PIO_PA21_IDX 21
#define PIO_PA22_IDX 22
#define PIO_PA23_IDX 23
#define PIO_PA24_IDX 24
#define PIO_PA25_IDX 25
#define PIO_PA26_IDX 26
#define PIO_PA27_IDX 27
#define PIO_PA28_IDX 28
#define PIO_PA29_IDX 29
#define PIO_PA30_IDX 30
#define PIO_PA31_IDX 31
#define PIO_PB0_IDX 32
#define PIO_PB1_IDX 33
#define PIO_PB2_IDX 34
#define PIO_PB3_IDX 35
#define PIO_PB4_IDX 36
#define PIO_PB5_IDX 37
#define PIO_PB6_IDX 38
#define PIO_PB7_IDX 39
#define PIO_PB8_IDX 40
#define PIO_PB9_IDX 41
#define PIO_PB10_IDX 42
#define PIO_PB11_IDX 43
#define PIO_PB12_IDX 44
#define PIO_PB13_IDX 45
#define PIO_PB14_IDX 46
#define PIO_PB15_IDX 47
#define PIO_PB16_IDX 48
#define PIO_PB17_IDX 49
#define PIO_PB18_IDX 50
#define PIO_PB19_IDX 51
#define PIO_PB20_IDX 52
#define PIO_PB21_IDX 53
#define PIO_PB22_IDX 54
#define PIO_PB23_IDX 55
#define PIO_PB24_IDX 56
#define PIO_PB25_IDX 57
#define PIO_PB26_IDX 58
#define PIO_PB27_IDX 59
#define PIO_PB28_IDX 60
#define PIO_PB29_IDX 61
#define PIO_PB30_IDX 62
#define PIO_PB31_IDX 63
#define PIO_PC0_IDX 64
#define PIO_PC1_IDX 65
#define PIO_PC2_IDX 66
#define PIO_PC3_IDX 67
#define PIO_PC4_IDX 68
#define PIO_PC5_IDX 69
#define PIO_PC6_IDX 70
#define PIO_PC7_IDX 71
#define PIO_PC8_IDX 72
#define PIO_PC9_IDX 73
#define PIO_PC10_IDX 74
#define PIO_PC11_IDX 75
#define PIO_PC12_IDX 76
#define PIO_PC13_IDX 77
#define PIO_PC14_IDX 78
#define PIO_PC15_IDX 79
#define PIO_PC16_IDX 80
#define PIO_PC17_IDX 81
#define PIO_PC18_IDX 82
#define PIO_PC19_IDX 83
#define PIO_PC20_IDX 84
#define PIO_PC21_IDX 85
#define PIO_PC22_IDX 86
#define PIO_PC23_IDX 87
#define PIO_PC24_IDX 88
#define PIO_PC25_IDX 89
#define PIO_PC26_IDX 90
#define PIO_PC27_IDX 91
#define PIO_PC28_IDX 92
#define PIO_PC29_IDX 93
#define PIO_PC30_IDX 94
#define PIO_PC31_IDX 95
#endif /* _SAM3U4E_PIO_ */
|
LabAixBidouille/EmbeddedTeam
|
courses/examples/CMSIS/Device/ATMEL/sam3u/include/pio/sam3u4e.h
|
C
|
apache-2.0
| 27,173 |
#!/bin/bash
##
# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
# This file is part of openmano
# 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.
#
# For those usages not covered by the Apache License, Version 2.0 please
# contact with: [email protected]
##
DBUSER="vim"
DBPASS=""
DBHOST="localhost"
DBPORT="3306"
DBNAME="vim_db"
# Detect paths
MYSQL=$(which mysql)
AWK=$(which awk)
GREP=$(which grep)
DIRNAME=`dirname $0`
function usage(){
echo -e "Usage: $0 OPTIONS"
echo -e " Dumps openvim database content"
echo -e " OPTIONS"
echo -e " -u USER database user. '$DBUSER' by default. Prompts if DB access fails"
echo -e " -p PASS database password. 'No password' by default. Prompts if DB access fails"
echo -e " -P PORT database port. '$DBPORT' by default"
echo -e " -h HOST database host. '$DBHOST' by default"
echo -e " -d NAME database name. '$DBNAME' by default. Prompts if DB access fails"
echo -e " --help shows this help"
}
while getopts ":u:p:P:h:-:" o; do
case "${o}" in
u)
DBUSER="$OPTARG"
;;
p)
DBPASS="$OPTARG"
;;
P)
DBPORT="$OPTARG"
;;
d)
DBNAME="$OPTARG"
;;
h)
DBHOST="$OPTARG"
;;
-)
[ "${OPTARG}" == "help" ] && usage && exit 0
echo "Invalid option: --$OPTARG" >&2 && usage >&2
exit 1
;;
\?)
echo "Invalid option: -$OPTARG" >&2 && usage >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2 && usage >&2
exit 1
;;
*)
usage >&2
exit -1
;;
esac
done
shift $((OPTIND-1))
#check and ask for database user password
DBUSER_="-u$DBUSER"
DBPASS_=""
[ -n "$DBPASS" ] && DBPASS_="-p$DBPASS"
DBHOST_="-h$DBHOST"
DBPORT_="-P$DBPORT"
while ! echo ";" | mysql $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ $DBNAME >/dev/null 2>&1
do
[ -n "$logintry" ] && echo -e "\nInvalid database credentials!!!. Try again (Ctrl+c to abort)"
[ -z "$logintry" ] && echo -e "\nProvide database name and credentials"
read -e -p "mysql database name($DBNAME): " KK
[ -n "$KK" ] && DBNAME="$KK"
read -e -p "mysql user($DBUSER): " KK
[ -n "$KK" ] && DBUSER="$KK" && DBUSER_="-u$DBUSER"
read -e -s -p "mysql password: " DBPASS
[ -n "$DBPASS" ] && DBPASS_="-p$DBPASS"
[ -z "$DBPASS" ] && DBPASS_=""
logintry="yes"
echo
done
#echo structure, including the content of schema_version
mysqldump $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ --no-data --add-drop-table --add-drop-database --routines --databases $DBNAME > ${DIRNAME}/${DBNAME}_structure.sql
echo -e "\n\n\n\n" >> ${DIRNAME}/${DBNAME}_structure.sql
mysqldump $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ --no-create-info $DBNAME --tables schema_version 2>/dev/null >> ${DIRNAME}/${DBNAME}_structure.sql
echo " ${DIRNAME}/${DBNAME}_structure.sql"
#echo only data
mysqldump $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ --no-create-info $DBNAME > ${DIRNAME}/${DBNAME}_data.sql
echo " ${DIRNAME}/${DBNAME}_data.sql"
#echo all
mysqldump $DBHOST_ $DBPORT_ $DBUSER_ $DBPASS_ --add-drop-table --add-drop-database --routines --databases $DBNAME > ${DIRNAME}/${DBNAME}_all.sql
echo " ${DIRNAME}/${DBNAME}_all.sql"
|
312v/openmano
|
openvim/database_utils/dump_db.sh
|
Shell
|
apache-2.0
| 4,000 |
//
// XSMainViewCell.h
// XieshiPrivate
//
// Created by Tesiro on 16/7/20.
// Copyright © 2016年 Lessu. All rights reserved.
//
#import "XSTableViewCell.h"
@interface XSMainViewCell : XSTableViewCell
@property (nonatomic, strong)UIView *viewBG;
@property (nonatomic, strong)UIImageView *imageViewHead;
@property (nonatomic, strong)UILabel *labelContent;
@property (nonatomic, strong)UIView *viewBottomLine;
@end
|
huxiheng/DiTu
|
iosReal百度2.6.0/ios 2Real/Classes/XSMainVC/XSMainViewCell.h
|
C
|
apache-2.0
| 466 |
import Horizontal from './Horizontal.vue'
export default Horizontal
|
sailengsi/sls-admin
|
src/components/echarts/bar/horizontal/index.js
|
JavaScript
|
apache-2.0
| 69 |
/*
* #%L
* Protempa Framework
* %%
* Copyright (C) 2012 - 2013 Emory University
* %%
* 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.
* #L%
*/
package org.protempa.backend;
import org.arp.javautil.serviceloader.SingletonServiceLoader;
/**
* Class for getting PROTEMPA configurations.
*
* Uses Java's {@link ServiceLoader} to load a {@link ConfigurationsProvider}.
* By default, it configures {@link ServiceLoader} to use the current thread's
* context class loader. The {@link ConfigurationsProvider} is loaded lazily
* upon calls to {@link #getConfigurations()} or
* {@link #getConfigurationsProvider()}. Use
* {@link #setConfigurationsProviderClassLoader} to specify a different class
* loader. The {@link ConfigurationsProvider} in turn is used to get
* {@link Configurations}.
*
* A program can also explicitly set a configurations provider using the
* {@link #setConfigurationsProvider} method. This will override the use of {@link ServiceLoader}.
*
* @author Andrew Post
*/
public final class ConfigurationsProviderManager {
private static ConfigurationsProvider configurationsProvider;
private static ClassLoader configurationsProviderClassLoader;
private static boolean configurationsProviderClassLoaderSpecified;
public static void setConfigurationsProviderClassLoader(
ClassLoader loader) {
configurationsProviderClassLoader = loader;
configurationsProviderClassLoaderSpecified = true;
}
public static ClassLoader getConfigurationsProviderClassLoader() {
return configurationsProviderClassLoader;
}
/**
* Indicates whether {@link #setConfigurationsProviderClassLoader} has been
* called.
*
* @return whether {@link #setConfigurationsProviderClassLoader} has been
* called.
*/
public static boolean isConfigurationsProviderClassLoaderSpecified() {
return configurationsProviderClassLoaderSpecified;
}
/**
* Sets the configurations provider, overriding any configurations provider
* that was found by service discovery.
*
* @param configurationsProvider a {@link ConfigurationsProvider}.
*/
public static void setConfigurationsProvider(
ConfigurationsProvider configurationsProvider) {
ConfigurationsProviderManager.configurationsProvider =
configurationsProvider;
}
/**
* Gets the configurations provider found by service discovery or set with
* {@link #setConfigurationsProvider(org.protempa.backend.ConfigurationsProvider).
*
* @return a {@link ConfigurationsProvider}.
*/
public static ConfigurationsProvider getConfigurationsProvider() {
loadConfigurationsProviderIfNeeded();
return configurationsProvider;
}
/**
* Convenience static method for getting configurations, like calling
* {@link #getConfigurationsProvider()} followed by
* {@link ConfigurationsProvider#getConfigurations()}.
*
* @return a {@link Configurations} instance.
*/
public static Configurations getConfigurations() {
loadConfigurationsProviderIfNeeded();
return configurationsProvider.getConfigurations();
}
private static void loadConfigurationsProviderIfNeeded() {
if (configurationsProvider == null) {
if (configurationsProviderClassLoaderSpecified) {
configurationsProvider =
SingletonServiceLoader.load(ConfigurationsProvider.class,
configurationsProviderClassLoader);
} else {
configurationsProvider =
SingletonServiceLoader.load(ConfigurationsProvider.class);
}
}
if (configurationsProvider == null) {
throw new IllegalStateException("No configurationsProvider found by service discovery or set with setConfigurationsProvider");
}
}
}
|
eurekaclinical/protempa
|
protempa-framework/src/main/java/org/protempa/backend/ConfigurationsProviderManager.java
|
Java
|
apache-2.0
| 4,468 |
/*
* Copyright 2016-present Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.openstacknetworking;
import org.onosproject.openstackinterface.OpenstackPort;
/**
* Represents OpenstackSecurityGroupService Interface.
*/
public interface OpenstackSecurityGroupService {
/**
* Updates the flow rules for Security Group for the VM (OpenstackPort).
*
* @param osPort OpenstackPort information for the VM
*/
void updateSecurityGroup(OpenstackPort osPort);
}
|
Shashikanth-Huawei/bmp
|
apps/openstacknetworking/api/src/main/java/org/onosproject/openstacknetworking/OpenstackSecurityGroupService.java
|
Java
|
apache-2.0
| 1,047 |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.beam.runners.spark.translation.streaming;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import static org.apache.beam.runners.spark.translation.TranslationUtils.rejectSplittable;
import static org.apache.beam.runners.spark.translation.TranslationUtils.rejectStateAndTimers;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.LinkedBlockingQueue;
import javax.annotation.Nonnull;
import org.apache.beam.runners.core.metrics.MetricsContainerStepMap;
import org.apache.beam.runners.spark.aggregators.AggregatorsAccumulator;
import org.apache.beam.runners.spark.aggregators.NamedAggregators;
import org.apache.beam.runners.spark.coders.CoderHelpers;
import org.apache.beam.runners.spark.io.ConsoleIO;
import org.apache.beam.runners.spark.io.CreateStream;
import org.apache.beam.runners.spark.io.SparkUnboundedSource;
import org.apache.beam.runners.spark.metrics.MetricsAccumulator;
import org.apache.beam.runners.spark.stateful.SparkGroupAlsoByWindowViaWindowSet;
import org.apache.beam.runners.spark.translation.BoundedDataset;
import org.apache.beam.runners.spark.translation.Dataset;
import org.apache.beam.runners.spark.translation.EvaluationContext;
import org.apache.beam.runners.spark.translation.GroupCombineFunctions;
import org.apache.beam.runners.spark.translation.MultiDoFnFunction;
import org.apache.beam.runners.spark.translation.SparkAssignWindowFn;
import org.apache.beam.runners.spark.translation.SparkKeyedCombineFn;
import org.apache.beam.runners.spark.translation.SparkPCollectionView;
import org.apache.beam.runners.spark.translation.SparkPipelineTranslator;
import org.apache.beam.runners.spark.translation.SparkRuntimeContext;
import org.apache.beam.runners.spark.translation.TransformEvaluator;
import org.apache.beam.runners.spark.translation.TranslationUtils;
import org.apache.beam.runners.spark.translation.WindowingHelpers;
import org.apache.beam.runners.spark.util.GlobalWatermarkHolder;
import org.apache.beam.runners.spark.util.SideInputBroadcast;
import org.apache.beam.sdk.coders.Coder;
import org.apache.beam.sdk.coders.KvCoder;
import org.apache.beam.sdk.io.Read;
import org.apache.beam.sdk.transforms.Combine;
import org.apache.beam.sdk.transforms.CombineWithContext;
import org.apache.beam.sdk.transforms.DoFn;
import org.apache.beam.sdk.transforms.Flatten;
import org.apache.beam.sdk.transforms.GroupByKey;
import org.apache.beam.sdk.transforms.PTransform;
import org.apache.beam.sdk.transforms.ParDo;
import org.apache.beam.sdk.transforms.Reshuffle;
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
import org.apache.beam.sdk.transforms.windowing.GlobalWindow;
import org.apache.beam.sdk.transforms.windowing.PaneInfo;
import org.apache.beam.sdk.transforms.windowing.Window;
import org.apache.beam.sdk.transforms.windowing.WindowFn;
import org.apache.beam.sdk.util.CombineFnUtil;
import org.apache.beam.sdk.util.WindowedValue;
import org.apache.beam.sdk.values.KV;
import org.apache.beam.sdk.values.PCollection;
import org.apache.beam.sdk.values.PValue;
import org.apache.beam.sdk.values.TimestampedValue;
import org.apache.beam.sdk.values.TupleTag;
import org.apache.beam.sdk.values.WindowingStrategy;
import org.apache.spark.Accumulator;
import org.apache.spark.api.java.JavaPairRDD;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.Function;
import org.apache.spark.streaming.api.java.JavaDStream;
import org.apache.spark.streaming.api.java.JavaInputDStream;
import org.apache.spark.streaming.api.java.JavaPairDStream;
import org.apache.spark.streaming.api.java.JavaStreamingContext;
/**
* Supports translation between a Beam transform, and Spark's operations on DStreams.
*/
public final class StreamingTransformTranslator {
private StreamingTransformTranslator() {
}
private static <T> TransformEvaluator<ConsoleIO.Write.Unbound<T>> print() {
return new TransformEvaluator<ConsoleIO.Write.Unbound<T>>() {
@Override
public void evaluate(ConsoleIO.Write.Unbound<T> transform, EvaluationContext context) {
@SuppressWarnings("unchecked")
JavaDStream<WindowedValue<T>> dstream =
((UnboundedDataset<T>) (context).borrowDataset(transform)).getDStream();
dstream.map(WindowingHelpers.<T>unwindowFunction()).print(transform.getNum());
}
@Override
public String toNativeString() {
return ".print(...)";
}
};
}
private static <T> TransformEvaluator<Read.Unbounded<T>> readUnbounded() {
return new TransformEvaluator<Read.Unbounded<T>>() {
@Override
public void evaluate(Read.Unbounded<T> transform, EvaluationContext context) {
final String stepName = context.getCurrentTransform().getFullName();
context.putDataset(
transform,
SparkUnboundedSource.read(
context.getStreamingContext(),
context.getRuntimeContext(),
transform.getSource(),
stepName));
}
@Override
public String toNativeString() {
return "streamingContext.<readFrom(<source>)>()";
}
};
}
private static <T> TransformEvaluator<CreateStream<T>> createFromQueue() {
return new TransformEvaluator<CreateStream<T>>() {
@Override
public void evaluate(CreateStream<T> transform, EvaluationContext context) {
Coder<T> coder = context.getOutput(transform).getCoder();
JavaStreamingContext jssc = context.getStreamingContext();
Queue<Iterable<TimestampedValue<T>>> values = transform.getBatches();
WindowedValue.FullWindowedValueCoder<T> windowCoder =
WindowedValue.FullWindowedValueCoder.of(coder, GlobalWindow.Coder.INSTANCE);
// create the DStream from queue.
Queue<JavaRDD<WindowedValue<T>>> rddQueue = new LinkedBlockingQueue<>();
for (Iterable<TimestampedValue<T>> tv : values) {
Iterable<WindowedValue<T>> windowedValues =
Iterables.transform(
tv,
new com.google.common.base.Function<TimestampedValue<T>, WindowedValue<T>>() {
@Override
public WindowedValue<T> apply(@Nonnull TimestampedValue<T> timestampedValue) {
return WindowedValue.of(
timestampedValue.getValue(),
timestampedValue.getTimestamp(),
GlobalWindow.INSTANCE,
PaneInfo.NO_FIRING);
}
});
JavaRDD<WindowedValue<T>> rdd =
jssc.sparkContext()
.parallelize(CoderHelpers.toByteArrays(windowedValues, windowCoder))
.map(CoderHelpers.fromByteFunction(windowCoder));
rddQueue.offer(rdd);
}
JavaInputDStream<WindowedValue<T>> inputDStream = jssc.queueStream(rddQueue, true);
UnboundedDataset<T> unboundedDataset = new UnboundedDataset<T>(
inputDStream, Collections.singletonList(inputDStream.inputDStream().id()));
// add pre-baked Watermarks for the pre-baked batches.
Queue<GlobalWatermarkHolder.SparkWatermarks> times = transform.getTimes();
GlobalWatermarkHolder.addAll(
ImmutableMap.of(unboundedDataset.getStreamSources().get(0), times));
context.putDataset(transform, unboundedDataset);
}
@Override
public String toNativeString() {
return "streamingContext.queueStream(...)";
}
};
}
private static <T> TransformEvaluator<Flatten.PCollections<T>> flattenPColl() {
return new TransformEvaluator<Flatten.PCollections<T>>() {
@SuppressWarnings("unchecked")
@Override
public void evaluate(Flatten.PCollections<T> transform, EvaluationContext context) {
Map<TupleTag<?>, PValue> pcs = context.getInputs(transform);
// since this is a streaming pipeline, at least one of the PCollections to "flatten" are
// unbounded, meaning it represents a DStream.
// So we could end up with an unbounded unified DStream.
final List<JavaDStream<WindowedValue<T>>> dStreams = new ArrayList<>();
final List<Integer> streamingSources = new ArrayList<>();
for (PValue pv : pcs.values()) {
checkArgument(
pv instanceof PCollection,
"Flatten had non-PCollection value in input: %s of type %s",
pv,
pv.getClass().getSimpleName());
PCollection<T> pcol = (PCollection<T>) pv;
Dataset dataset = context.borrowDataset(pcol);
if (dataset instanceof UnboundedDataset) {
UnboundedDataset<T> unboundedDataset = (UnboundedDataset<T>) dataset;
streamingSources.addAll(unboundedDataset.getStreamSources());
dStreams.add(unboundedDataset.getDStream());
} else {
// create a single RDD stream.
Queue<JavaRDD<WindowedValue<T>>> q = new LinkedBlockingQueue<>();
q.offer(((BoundedDataset) dataset).getRDD());
//TODO: this is not recoverable from checkpoint!
JavaDStream<WindowedValue<T>> dStream = context.getStreamingContext().queueStream(q);
dStreams.add(dStream);
}
}
// start by unifying streams into a single stream.
JavaDStream<WindowedValue<T>> unifiedStreams =
context.getStreamingContext().union(dStreams.remove(0), dStreams);
context.putDataset(transform, new UnboundedDataset<>(unifiedStreams, streamingSources));
}
@Override
public String toNativeString() {
return "streamingContext.union(...)";
}
};
}
private static <T, W extends BoundedWindow> TransformEvaluator<Window.Assign<T>> window() {
return new TransformEvaluator<Window.Assign<T>>() {
@Override
public void evaluate(final Window.Assign<T> transform, EvaluationContext context) {
@SuppressWarnings("unchecked")
UnboundedDataset<T> unboundedDataset =
((UnboundedDataset<T>) context.borrowDataset(transform));
JavaDStream<WindowedValue<T>> dStream = unboundedDataset.getDStream();
JavaDStream<WindowedValue<T>> outputStream;
if (TranslationUtils.skipAssignWindows(transform, context)) {
// do nothing.
outputStream = dStream;
} else {
outputStream = dStream.transform(
new Function<JavaRDD<WindowedValue<T>>, JavaRDD<WindowedValue<T>>>() {
@Override
public JavaRDD<WindowedValue<T>> call(JavaRDD<WindowedValue<T>> rdd) throws Exception {
return rdd.map(new SparkAssignWindowFn<>(transform.getWindowFn()));
}
});
}
context.putDataset(transform,
new UnboundedDataset<>(outputStream, unboundedDataset.getStreamSources()));
}
@Override
public String toNativeString() {
return "map(new <windowFn>())";
}
};
}
private static <K, V, W extends BoundedWindow> TransformEvaluator<GroupByKey<K, V>> groupByKey() {
return new TransformEvaluator<GroupByKey<K, V>>() {
@Override
public void evaluate(GroupByKey<K, V> transform, EvaluationContext context) {
@SuppressWarnings("unchecked") UnboundedDataset<KV<K, V>> inputDataset =
(UnboundedDataset<KV<K, V>>) context.borrowDataset(transform);
List<Integer> streamSources = inputDataset.getStreamSources();
JavaDStream<WindowedValue<KV<K, V>>> dStream = inputDataset.getDStream();
@SuppressWarnings("unchecked")
final KvCoder<K, V> coder = (KvCoder<K, V>) context.getInput(transform).getCoder();
final SparkRuntimeContext runtimeContext = context.getRuntimeContext();
@SuppressWarnings("unchecked")
final WindowingStrategy<?, W> windowingStrategy =
(WindowingStrategy<?, W>) context.getInput(transform).getWindowingStrategy();
@SuppressWarnings("unchecked")
final WindowFn<Object, W> windowFn = (WindowFn<Object, W>) windowingStrategy.getWindowFn();
//--- coders.
final WindowedValue.WindowedValueCoder<V> wvCoder =
WindowedValue.FullWindowedValueCoder.of(coder.getValueCoder(), windowFn.windowCoder());
//--- group by key only.
JavaDStream<WindowedValue<KV<K, Iterable<WindowedValue<V>>>>> groupedByKeyStream =
dStream.transform(new Function<JavaRDD<WindowedValue<KV<K, V>>>,
JavaRDD<WindowedValue<KV<K, Iterable<WindowedValue<V>>>>>>() {
@Override
public JavaRDD<WindowedValue<KV<K, Iterable<WindowedValue<V>>>>> call(
JavaRDD<WindowedValue<KV<K, V>>> rdd) throws Exception {
return GroupCombineFunctions.groupByKeyOnly(
rdd, coder.getKeyCoder(), wvCoder);
}
});
//--- now group also by window.
JavaDStream<WindowedValue<KV<K, Iterable<V>>>> outStream =
SparkGroupAlsoByWindowViaWindowSet.groupAlsoByWindow(
groupedByKeyStream,
coder.getKeyCoder(),
wvCoder,
windowingStrategy,
runtimeContext,
streamSources);
context.putDataset(transform, new UnboundedDataset<>(outStream, streamSources));
}
@Override
public String toNativeString() {
return "groupByKey()";
}
};
}
private static <K, InputT, OutputT> TransformEvaluator<Combine.GroupedValues<K, InputT, OutputT>>
combineGrouped() {
return new TransformEvaluator<Combine.GroupedValues<K, InputT, OutputT>>() {
@Override
public void evaluate(final Combine.GroupedValues<K, InputT, OutputT> transform,
EvaluationContext context) {
// get the applied combine function.
PCollection<? extends KV<K, ? extends Iterable<InputT>>> input =
context.getInput(transform);
final WindowingStrategy<?, ?> windowingStrategy = input.getWindowingStrategy();
@SuppressWarnings("unchecked")
final CombineWithContext.CombineFnWithContext<InputT, ?, OutputT> fn =
(CombineWithContext.CombineFnWithContext<InputT, ?, OutputT>)
CombineFnUtil.toFnWithContext(transform.getFn());
@SuppressWarnings("unchecked")
UnboundedDataset<KV<K, Iterable<InputT>>> unboundedDataset =
((UnboundedDataset<KV<K, Iterable<InputT>>>) context.borrowDataset(transform));
JavaDStream<WindowedValue<KV<K, Iterable<InputT>>>> dStream = unboundedDataset.getDStream();
final SparkRuntimeContext runtimeContext = context.getRuntimeContext();
final SparkPCollectionView pviews = context.getPViews();
JavaDStream<WindowedValue<KV<K, OutputT>>> outStream = dStream.transform(
new Function<JavaRDD<WindowedValue<KV<K, Iterable<InputT>>>>,
JavaRDD<WindowedValue<KV<K, OutputT>>>>() {
@Override
public JavaRDD<WindowedValue<KV<K, OutputT>>>
call(JavaRDD<WindowedValue<KV<K, Iterable<InputT>>>> rdd)
throws Exception {
SparkKeyedCombineFn<K, InputT, ?, OutputT> combineFnWithContext =
new SparkKeyedCombineFn<>(fn, runtimeContext,
TranslationUtils.getSideInputs(transform.getSideInputs(),
new JavaSparkContext(rdd.context()), pviews),
windowingStrategy);
return rdd.map(
new TranslationUtils.CombineGroupedValues<>(combineFnWithContext));
}
});
context.putDataset(transform,
new UnboundedDataset<>(outStream, unboundedDataset.getStreamSources()));
}
@Override
public String toNativeString() {
return "map(new <fn>())";
}
};
}
private static <InputT, OutputT> TransformEvaluator<ParDo.MultiOutput<InputT, OutputT>> parDo() {
return new TransformEvaluator<ParDo.MultiOutput<InputT, OutputT>>() {
public void evaluate(
final ParDo.MultiOutput<InputT, OutputT> transform, final EvaluationContext context) {
final DoFn<InputT, OutputT> doFn = transform.getFn();
rejectSplittable(doFn);
rejectStateAndTimers(doFn);
final SparkRuntimeContext runtimeContext = context.getRuntimeContext();
final SparkPCollectionView pviews = context.getPViews();
final WindowingStrategy<?, ?> windowingStrategy =
context.getInput(transform).getWindowingStrategy();
@SuppressWarnings("unchecked")
UnboundedDataset<InputT> unboundedDataset =
((UnboundedDataset<InputT>) context.borrowDataset(transform));
JavaDStream<WindowedValue<InputT>> dStream = unboundedDataset.getDStream();
final String stepName = context.getCurrentTransform().getFullName();
JavaPairDStream<TupleTag<?>, WindowedValue<?>> all =
dStream.transformToPair(
new Function<
JavaRDD<WindowedValue<InputT>>,
JavaPairRDD<TupleTag<?>, WindowedValue<?>>>() {
@Override
public JavaPairRDD<TupleTag<?>, WindowedValue<?>> call(
JavaRDD<WindowedValue<InputT>> rdd) throws Exception {
final Accumulator<NamedAggregators> aggAccum =
AggregatorsAccumulator.getInstance();
final Accumulator<MetricsContainerStepMap> metricsAccum =
MetricsAccumulator.getInstance();
final Map<TupleTag<?>, KV<WindowingStrategy<?, ?>, SideInputBroadcast<?>>>
sideInputs =
TranslationUtils.getSideInputs(
transform.getSideInputs(),
JavaSparkContext.fromSparkContext(rdd.context()),
pviews);
return rdd.mapPartitionsToPair(
new MultiDoFnFunction<>(
aggAccum,
metricsAccum,
stepName,
doFn,
runtimeContext,
transform.getMainOutputTag(),
sideInputs,
windowingStrategy));
}
});
Map<TupleTag<?>, PValue> outputs = context.getOutputs(transform);
if (outputs.size() > 1) {
// cache the DStream if we're going to filter it more than once.
all.cache();
}
for (Map.Entry<TupleTag<?>, PValue> output : outputs.entrySet()) {
@SuppressWarnings("unchecked")
JavaPairDStream<TupleTag<?>, WindowedValue<?>> filtered =
all.filter(new TranslationUtils.TupleTagFilter(output.getKey()));
@SuppressWarnings("unchecked")
// Object is the best we can do since different outputs can have different tags
JavaDStream<WindowedValue<Object>> values =
(JavaDStream<WindowedValue<Object>>)
(JavaDStream<?>) TranslationUtils.dStreamValues(filtered);
context.putDataset(
output.getValue(),
new UnboundedDataset<>(values, unboundedDataset.getStreamSources()));
}
}
@Override
public String toNativeString() {
return "mapPartitions(new <fn>())";
}
};
}
private static <K, V, W extends BoundedWindow> TransformEvaluator<Reshuffle<K, V>> reshuffle() {
return new TransformEvaluator<Reshuffle<K, V>>() {
@Override
public void evaluate(Reshuffle<K, V> transform, EvaluationContext context) {
@SuppressWarnings("unchecked") UnboundedDataset<KV<K, V>> inputDataset =
(UnboundedDataset<KV<K, V>>) context.borrowDataset(transform);
List<Integer> streamSources = inputDataset.getStreamSources();
JavaDStream<WindowedValue<KV<K, V>>> dStream = inputDataset.getDStream();
@SuppressWarnings("unchecked")
final KvCoder<K, V> coder = (KvCoder<K, V>) context.getInput(transform).getCoder();
@SuppressWarnings("unchecked")
final WindowingStrategy<?, W> windowingStrategy =
(WindowingStrategy<?, W>) context.getInput(transform).getWindowingStrategy();
@SuppressWarnings("unchecked")
final WindowFn<Object, W> windowFn = (WindowFn<Object, W>) windowingStrategy.getWindowFn();
final WindowedValue.WindowedValueCoder<V> wvCoder =
WindowedValue.FullWindowedValueCoder.of(coder.getValueCoder(), windowFn.windowCoder());
JavaDStream<WindowedValue<KV<K, V>>> reshuffledStream =
dStream.transform(new Function<JavaRDD<WindowedValue<KV<K, V>>>,
JavaRDD<WindowedValue<KV<K, V>>>>() {
@Override
public JavaRDD<WindowedValue<KV<K, V>>> call(
JavaRDD<WindowedValue<KV<K, V>>> rdd) throws Exception {
return GroupCombineFunctions.reshuffle(rdd, coder.getKeyCoder(), wvCoder);
}
});
context.putDataset(transform, new UnboundedDataset<>(reshuffledStream, streamSources));
}
@Override public String toNativeString() {
return "repartition(...)";
}
};
}
private static final Map<Class<? extends PTransform>, TransformEvaluator<?>> EVALUATORS =
Maps.newHashMap();
static {
EVALUATORS.put(Read.Unbounded.class, readUnbounded());
EVALUATORS.put(GroupByKey.class, groupByKey());
EVALUATORS.put(Combine.GroupedValues.class, combineGrouped());
EVALUATORS.put(ParDo.MultiOutput.class, parDo());
EVALUATORS.put(ConsoleIO.Write.Unbound.class, print());
EVALUATORS.put(CreateStream.class, createFromQueue());
EVALUATORS.put(Window.Assign.class, window());
EVALUATORS.put(Flatten.PCollections.class, flattenPColl());
EVALUATORS.put(Reshuffle.class, reshuffle());
}
/**
* Translator matches Beam transformation with the appropriate evaluator.
*/
public static class Translator implements SparkPipelineTranslator {
private final SparkPipelineTranslator batchTranslator;
public Translator(SparkPipelineTranslator batchTranslator) {
this.batchTranslator = batchTranslator;
}
@Override
public boolean hasTranslation(Class<? extends PTransform<?, ?>> clazz) {
// streaming includes rdd/bounded transformations as well
return EVALUATORS.containsKey(clazz);
}
@Override
public <TransformT extends PTransform<?, ?>> TransformEvaluator<TransformT>
translateBounded(Class<TransformT> clazz) {
TransformEvaluator<TransformT> transformEvaluator = batchTranslator.translateBounded(clazz);
checkState(transformEvaluator != null,
"No TransformEvaluator registered for BOUNDED transform %s", clazz);
return transformEvaluator;
}
@Override
public <TransformT extends PTransform<?, ?>> TransformEvaluator<TransformT>
translateUnbounded(Class<TransformT> clazz) {
@SuppressWarnings("unchecked") TransformEvaluator<TransformT> transformEvaluator =
(TransformEvaluator<TransformT>) EVALUATORS.get(clazz);
checkState(transformEvaluator != null,
"No TransformEvaluator registered for UNBOUNDED transform %s", clazz);
return transformEvaluator;
}
}
}
|
dhalperi/beam
|
runners/spark/src/main/java/org/apache/beam/runners/spark/translation/streaming/StreamingTransformTranslator.java
|
Java
|
apache-2.0
| 24,813 |
from __future__ import unicode_literals
import logging
from rest_framework import viewsets
from notify.models import Notification, NotificationSerializer
logger = logging.getLogger(__name__)
class NotificationViewSet(viewsets.ModelViewSet):
model = Notification
serializer_class = NotificationSerializer
paginate_by = 10
paginate_by_param = 'num_notifications'
max_paginate_by = 20
def get_queryset(self):
user = self.request.user
return Notification.objects.filter(user=user)
|
incrowdio/incrowd
|
incrowd/notify/api.py
|
Python
|
apache-2.0
| 522 |
<?php
/* ============================================================================
* Copyright 2020 Zindex Software
*
* 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.
* ============================================================================ */
namespace Opis\Colibri\RestAPI;
use Opis\Colibri\Http\Request;
use Opis\Colibri\Routing\{Route, Mixin};
use function Opis\Colibri\controller;
abstract class ControllerResolver extends Mixin
{
/**
* @param Route $route
* @param array|null $config
*
* Use $config['no-cors'] = true to disable the CORSMiddleware
*/
public function __invoke(Route $route, ?array $config): void
{
// Bind methods
$class = static::class;
$route
// Resolves controller class
->bind('controllerClassName', "{$class}::bindControllerClassName")
// Resolves controller method
->bind('controllerMethodName', "{$class}::bindControllerMethodName")
// Resolves request body
->bind('data', "{$class}::bindData")
;
if ($config['no-cors'] ?? false) {
// Do not add CORSMiddleware
return;
}
// Add cors middleware
if ($middleware = $route->getMiddleware()) {
$route->middleware(CORSMiddleware::class, ...$middleware);
} else {
$route->middleware(CORSMiddleware::class);
}
}
/**
* This is a proxy to controller('@controllerClassName', '@controllerMethodName')
* @return callable
*/
final public static function controller(): callable
{
return controller('@controllerClassName', '@controllerMethodName');
}
/**
* @param Request $request
* @return mixed
* @internal
*/
public static function bindData(Request $request): mixed
{
$body = $request->getBody();
if (!$body) {
return null;
}
$body = (string)$body;
if ($body === '') {
return null;
}
return json_decode($body, false);
}
/**
* @param string|null $controller
* @return string|null
* @internal
*/
public static function bindControllerClassName(?string $controller = null): ?string
{
if (!$controller) {
return null;
}
return static::controllers()[$controller] ?? null;
}
/**
* @param Request $request
* @param string|null $controllerClassName Controller class name
* @param string|null $action
* @return string
* @internal
*/
public static function bindControllerMethodName(Request $request, ?string $controllerClassName, ?string $action = null): string
{
if (!$controllerClassName ||
!class_exists($controllerClassName) ||
!is_subclass_of($controllerClassName, RestController::class)) {
return 'http404';
}
$config = $controllerClassName::actions()[$action ?? 'default'] ?? null;
if (!$config) {
return 'http404';
}
$httpMethod = strtolower($request->getMethod());
return $config[$httpMethod] ?? 'http405';
}
/**
* List of the controller names and their corresponding RestController class
*
* [
* 'my-controller' => MyClassExtendingRestController::class,
* ]
*
* @return string[]
*/
abstract protected static function controllers(): array;
}
|
opis/colibri
|
src/RestAPI/ControllerResolver.php
|
PHP
|
apache-2.0
| 4,014 |
package com.bignerdranch.android.criminalintent.database;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import com.bignerdranch.android.criminalintent.database.CrimeDbSchema.CrimeTable;
public class CrimeBaseHelper extends SQLiteOpenHelper {
private static final int VERSION = 1;
private static final String DATABASE_NAME = "crimeBase.db";
public CrimeBaseHelper(Context context) {
super(context, DATABASE_NAME, null, VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("create table " + CrimeTable.NAME + "(" +
" _id integer primary key autoincrement, " + CrimeTable.Cols.UUID + ", " + CrimeTable.Cols.TITLE + ", " +
CrimeTable.Cols.DATE + ", " +
CrimeTable.Cols.SOLVED + ", " +
CrimeTable.Cols.SUSPECT +
")"
);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
}
|
hermantai/samples
|
android/AndroidProgramming3e-master/15_ImplicitIntents/java/CriminalIntent/app/src/main/java/com/bignerdranch/android/criminalintent/database/CrimeBaseHelper.java
|
Java
|
apache-2.0
| 1,059 |
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.Collections.Immutable
Imports System.Threading
Imports System.Xml.Linq
Imports Microsoft.CodeAnalysis.Editor.UnitTests.Extensions
Imports Microsoft.CodeAnalysis.Text
Namespace Microsoft.CodeAnalysis.VisualBasic.EditAndContinue.UnitTests
<Trait(Traits.Feature, Traits.Features.DebuggingBreakpoints)>
Public Class BreakpointSpansTests
#Region "Helpers"
Private Sub TestSpan(markup As String)
Test(markup, isMissing:=False, isLine:=False)
End Sub
Private Sub TestSpan(markup As XElement)
Test(markup.NormalizedValue, isMissing:=False, isLine:=False)
End Sub
Private Sub TestMissing(markup As XElement)
Test(markup.NormalizedValue, isMissing:=True, isLine:=False)
End Sub
Private Sub TestLine(markup As XElement)
Test(markup.NormalizedValue, isMissing:=False, isLine:=True)
End Sub
Private Sub TestAll(markup As XElement)
TestAll(markup.NormalizedValue)
End Sub
Private Sub Test(markup As String, isMissing As Boolean, isLine As Boolean)
Dim position As Integer? = Nothing
Dim expectedSpan As TextSpan? = Nothing
Dim source As String = Nothing
MarkupTestFile.GetPositionAndSpan(markup, source, position, expectedSpan)
Dim tree = SyntaxFactory.ParseSyntaxTree(source)
Dim breakpointSpan As TextSpan
Dim hasBreakpoint = BreakpointSpans.TryGetBreakpointSpan(tree,
position.Value,
CancellationToken.None,
breakpointSpan)
If isLine Then
Assert.True(hasBreakpoint)
Assert.True(breakpointSpan.Length = 0)
ElseIf isMissing Then
Assert.False(hasBreakpoint)
Else
Assert.True(hasBreakpoint)
Assert.True(expectedSpan.Value = breakpointSpan,
String.Format(vbCrLf & "Expected: {0} ""{1}""" & vbCrLf & "Actual: {2} ""{3}""",
expectedSpan.Value,
source.Substring(expectedSpan.Value.Start, expectedSpan.Value.Length),
breakpointSpan,
source.Substring(breakpointSpan.Start, breakpointSpan.Length)))
End If
End Sub
Private Sub TestAll(markup As String)
Dim position As Integer = Nothing
Dim expectedSpans As ImmutableArray(Of TextSpan) = Nothing
Dim source As String = Nothing
MarkupTestFile.GetPositionAndSpans(markup, source, position, expectedSpans)
Dim tree = SyntaxFactory.ParseSyntaxTree(source)
Dim root = tree.GetRoot()
Dim actualSpans = GetBreakpointSequence(root, position).ToArray()
AssertEx.Equal(expectedSpans,
actualSpans,
itemSeparator:=vbCrLf,
itemInspector:=Function(span) "[|" & source.Substring(span.Start, span.Length) & "|]")
End Sub
Public Shared Iterator Function GetBreakpointSequence(root As SyntaxNode, position As Integer) As IEnumerable(Of TextSpan)
Dim endPosition = root.Span.End
Dim lastSpanEnd = 0
While position < endPosition
Dim span As TextSpan = Nothing
If BreakpointSpans.TryGetEnclosingBreakpointSpan(root, position, minLength:=0, span) AndAlso span.End > lastSpanEnd Then
position = span.End
lastSpanEnd = span.End
Yield span
Else
position += 1
End If
End While
End Function
#End Region
<Fact>
Public Sub TestEmptyFile()
TestMissing(<text>
$$
</text>)
End Sub
<Fact>
Public Sub TestTokenKind0()
TestMissing(<text>'$$</text>)
End Sub
#Region "Top-Level Statements"
<Fact>
Public Sub TopLevel()
TestMissing(<text>Option $$Explicit</text>)
TestMissing(<text>Imports $$Goo</text>)
TestMissing(<text>Class C(O$$f Action) : End Class</text>)
TestMissing(<text>Class C(Of Action) : End $$Class</text>)
TestMissing(<text>Struc$$ture S : End Structure</text>)
TestMissing(<text>Structure S : End Str$$ucture</text>)
TestMissing(<text>Enum E$$ : End Enum</text>)
TestMissing(<text>Enum E : End $$Enum</text>)
TestMissing(<text>Interface E$$ : End Interface</text>)
TestMissing(<text>Interface E : End $$Interface</text>)
TestMissing(<text>Module E$$ : End Module</text>)
TestMissing(<text>Module E : End $$Module</text>)
TestMissing(<text>Namespace E$$ : End Namespace</text>)
TestMissing(<text>Namespace E : End $$Namespace</text>)
End Sub
<Fact>
Public Sub CustomProperties1()
TestMissing(<text>
Class C
P$$roperty P
Get
End Get
Set(value)
End Set
End Property
End Class
</text>)
End Sub
<Fact>
Public Sub CustomProperties2()
TestMissing(<text>
Class C
Property P
Get
End Get
Set(value)
End Set
End$$ Property
End Class
</text>)
End Sub
<Fact>
Public Sub CustomEvents1()
TestMissing(<text>
Class C
Custom $$Event E As Action
AddHandler(value As Action)
End AddHandler
RemoveHandler(value As Action)
End RemoveHandler
RaiseEvent()
End RaiseEvent
End Event
End Class
</text>)
End Sub
<Fact>
Public Sub CustomEvents2()
TestMissing(<text>
Class C
Custom Event E As Action
AddHandler(value As Action)
End AddHandler
RemoveHandler(value As Action)
End RemoveHandler
RaiseEvent()
End RaiseEvent
End $$Event
End Class
</text>)
End Sub
#End Region
#Region "Methods, Constructors, Operators, Accessors"
<Fact>
Public Sub Sub_Header()
TestSpan(<text>
Class C
[|$$Sub Goo()|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Sub_Header_WithAttributes()
TestSpan("
Class C
<A>[|$$Sub Goo()|]
End Sub
End Class
")
End Sub
<Fact>
Public Sub Sub_Header_WithImplementsClause()
TestSpan("
Class C
[|$$Sub Goo() Implements I.Goo|]
End Sub
End Class
")
End Sub
<Fact>
Public Sub Sub_End()
TestSpan(<text>
Class C
Sub Goo()
[|$$End Sub|]
End Class
</text>)
End Sub
<Fact>
Public Sub SubNew()
TestSpan(<text>
Class C
[|Sub $$New()|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub SubNew_WithAttributes()
TestSpan("
Class C
<A>[|Sub $$New()|]
End Sub
End Class
")
End Sub
<Fact>
Public Sub Function1()
TestSpan(<text>
Class C
[|$$Function Goo()|]
End Function
End Class
</text>)
End Sub
<Fact>
Public Sub Function2()
TestSpan(<text>
Class C
Function Goo()
[|$$End Function|]
End Class
</text>)
End Sub
<Fact>
Public Sub Function_WithAttributes()
TestSpan("
Class C
<A>[|$$Function Goo()|]
End Function
End Class
")
End Sub
<Fact>
Public Sub Function_WithImplementsClause()
TestSpan("
Class C
[|$$Function Goo() Implements I.F|]
End Function
End Class
")
End Sub
<Fact>
Public Sub Operator1()
TestSpan(<text>
Class C
[|Shared $$Operator *(a As C, b As C) As Integer|]
End Operator
End Class
</text>)
End Sub
<Fact>
Public Sub Operator2()
TestSpan(<text>
Class C
Shared Operator *(a As C, b As C) As Integer
[|End $$Operator|]
End Class
</text>)
End Sub
<Fact>
Public Sub Operator_WithAttributes()
TestSpan("
Class C
<A>[|Shared $$Operator *(a As C, b As C) As Integer|]
End Operator
End Class
")
End Sub
<Fact>
Public Sub Get1()
TestSpan(<text>
Class C
Property P
[|G$$et|]
End Get
Set(value)
End Set
End Property
End Class
</text>)
End Sub
<Fact>
Public Sub Get2()
TestSpan(<text>
Class C
Property P
Get
[|End Get|] $$
Set(value)
End Set
End Property
End Class
</text>)
End Sub
<Fact>
Public Sub Get_WithAttributes()
TestSpan("
Class C
Property P
<A>[|G$$et|]
End Get
Set(value)
End Set
End Property
End Class
")
End Sub
<Fact>
Public Sub Set1()
TestSpan(<text>
Class C
Property P
Get
End Get
[|Set($$value)|]
End Set
End Property
End Class
</text>)
End Sub
<Fact>
Public Sub Set2()
TestSpan(<text>
Class C
Property P
Get
End Get
Set(value)
[|End Set|] $$
End Property
End Class
</text>)
End Sub
<Fact>
Public Sub Set_WithAttributes()
TestSpan("
Class C
Property P
Get
End Get
<A>[|Set($$value)|]
End Set
End Property
End Class
")
End Sub
<Fact>
Public Sub AddHandler1()
TestSpan(<text>
Class C
Custom Event E As Action
$$ [|AddHandler(value As Action)|]
End AddHandler
RemoveHandler(value As Action)
End RemoveHandler
RaiseEvent()
End RaiseEvent
End Event
End Class
</text>)
End Sub
<Fact>
Public Sub AddHandler2()
TestSpan(<text>
Class C
Custom Event E As Action
AddHandler(value As Action)
$$ [|End AddHandler|]
RemoveHandler(value As Action)
End RemoveHandler
RaiseEvent()
End RaiseEvent
End Event
End Class
</text>)
End Sub
<Fact>
Public Sub AddHandler_WithAttributes()
TestSpan("
Class C
Custom Event E As Action
$$ <A>[|AddHandler(value As Action)|]
End AddHandler
RemoveHandler(value As Action)
End RemoveHandler
RaiseEvent()
End RaiseEvent
End Event
End Class
")
End Sub
<Fact>
Public Sub RemoveHandler1()
TestSpan(<text>
Class C
Custom Event E As Action
AddHandler(value As Action)
End AddHandler
[|Remove$$Handler(value As Action)|]
End RemoveHandler
RaiseEvent()
End RaiseEvent
End Event
End Class
</text>)
End Sub
<Fact>
Public Sub RemoveHandler2()
TestSpan(<text>
Class C
Custom Event E As Action
AddHandler(value As Action)
End AddHandler
RemoveHandler(value As Action)
[|End Remove$$Handler|]
RaiseEvent()
End RaiseEvent
End Event
End Class
</text>)
End Sub
<Fact>
Public Sub RemoveHandler_WithAttributes()
TestSpan("
Class C
Custom Event E As Action
AddHandler(value As Action)
End AddHandler
<A>[|Remove$$Handler(value As Action)|]
End RemoveHandler
RaiseEvent()
End RaiseEvent
End Event
End Class
")
End Sub
<Fact>
Public Sub RaiseEvent1()
TestSpan(<text>
Class C
Custom Event E As Action
AddHandler(value As Action)
End AddHandler
RemoveHandler(value As Action)
End RemoveHandler
[|RaiseEvent($$)|]
End RaiseEvent
End Event
End Class
</text>)
End Sub
<Fact>
Public Sub RaiseEvent2()
TestSpan(<text>
Class C
Custom Event E As Action
AddHandler(value As Action)
End AddHandler
RemoveHandler(value As Action)
End RemoveHandler
RaiseEvent()
[|End $$RaiseEvent|]
End Event
End Class
</text>)
End Sub
<Fact>
Public Sub RaiseEvent_WithAttributes()
TestSpan("
Class C
Custom Event E As Action
AddHandler(value As Action)
End AddHandler
RemoveHandler(value As Action)
End RemoveHandler
<A>[|RaiseEvent($$)|]
End RaiseEvent
End Event
End Class
")
End Sub
#End Region
#Region "Auto-Properties"
<Fact>
Public Sub AutoProperty_NoInitializer1()
TestMissing(<text>
Class C
Property P$$
End Class
</text>)
End Sub
<Fact>
Public Sub AutoProperty_NoInitializer2()
TestMissing(<text>
Class C
Property P As Integer$$
End Class
</text>)
End Sub
<Fact>
Public Sub AutoProperty_Initializer1()
TestSpan(<text>
Class C
$$Property [|P As Integer = 1|] Implements I.P
End Class
</text>)
End Sub
<Fact>
Public Sub AutoProperty_Initializer2()
TestSpan(<text>
Class C
Property [|P $$As Integer = 1|] Implements I.P
End Class
</text>)
End Sub
<Fact>
Public Sub AutoProperty_Initializer3()
TestSpan(<text>
Class C
Property [|P As Integer = 1|] Implements $$I.P
End Class
</text>)
End Sub
<Fact>
Public Sub AutoProperty_Initializer4()
TestSpan(<text>
Class C
Property [|P = 1|] Implements $$I.P
End Class
</text>)
End Sub
<Fact>
Public Sub AutoProperty_AsNewInitializer1()
TestSpan(<text>
Class C
$$Property [|P As New C()|] Implements I.P
End Class
</text>)
End Sub
#End Region
#Region "Fields"
<Fact>
Public Sub Field_NoInitializer1()
TestMissing(<text>
Class C
Dim A As Integer$$
End Class
</text>)
End Sub
<Fact>
Public Sub Field_NoInitializer2()
TestMissing(<text>
Class C
Dim a, b$$
End Class
</text>)
End Sub
<Fact>
Public Sub Field_NoInitializer3()
TestMissing(<text>
Class C
Dim a$$, b
End Class
</text>)
End Sub
<Fact>
Public Sub Field_NoInitializer4()
TestSpan(<text>
Class C
Dim a $$As Integer, [|b = 1|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_NoInitializer5()
TestSpan(<text>
Class C
Dim [|a As Integer = 1|], b As Integer$$, c As Integer = 1
End Class
</text>)
End Sub
<Fact>
Public Sub Field_NoInitializer6()
TestSpan(<text>
Class C
Dim a As Integer = 1, b As Integer,$$ c As Integer, [|d As Integer = 1|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_NoInitializer7()
TestSpan(<text>
Class C
Dim $$ a As Integer, b As Integer, c As Integer, [|d As New Integer|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_NoInitializer8()
TestSpan(<text>
Class C
Dim [|a As New Integer|], b As Integer, c As Integer, $$ d As Integer
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Const1()
TestMissing(<text>
Class C
Const A As Integer = $$0
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Const2()
TestMissing(<text>
Class C
Con$$st A As Integer = 0
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Const3()
TestMissing(<text>
Class C
Const A$$A As Integer = 0
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_Untyped1()
TestSpan(<text>
Class C
$$ Dim [|a = 1|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_Untyped2()
TestSpan(<text>
Class C
Dim$$ [|a = 1|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_Untyped3()
TestSpan(<text>
Class C
Dim [|a$$a = 1|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_Untyped4()
TestSpan(<text>
Class C
Dim [|aa = 1$$|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_Untyped5()
TestSpan(<text>
Class C
Dim [|a = 1|] $$
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_Untyped1()
TestSpan(<text>
Class C
$$ Dim [|a = 1|], b = 1
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_Untyped2()
TestSpan(<text>
Class C
Dim$$ [|a = 1|], b = 1
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_Untyped3()
TestSpan(<text>
Class C
Dim [|$$a = 1|], b = 1
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_Untyped4()
TestSpan(<text>
Class C
Dim [|a = 1|]$$, b = 1
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_Untyped5()
TestSpan(<text>
Class C
Dim a = 1,$$ [|b = 1|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_Untyped6()
TestSpan(<text>
Class C
Dim a = 1, [|b = 1|] $$
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_Typed1()
TestSpan(<text>
Class C
$$ Dim [|a As Integer = 1|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_Typed2()
TestSpan(<text>
Class C
Dim [|a As Int$$eger = 1|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_Typed3()
TestSpan(<text>
Class C
Dim [|a As Integer = 1$$|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_Typed()
' syntax error, so it doesn't really matter what we do as long as it's not totally off
TestSpan(<text>
Class C
Dim [|a$$|], b As Integer = 1
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_AsNew1()
TestSpan(<text>
Class C
$$ Dim [|a As New C()|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_AsNew2()
TestSpan(<text>
Class C
Dim [|a$$a As New C()|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_AsNew3()
TestSpan(<text>
Class C
Dim [|a As New $$C()|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_AsNew4()
TestSpan(<text>
Class C
Dim [|a As New C()|] $$
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_AsNew1()
TestSpan(<text>
Class C
$$ Dim [|a|], b As New C()
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_AsNew2()
TestSpan(<text>
Class C
Dim $$[|a|], b As New C()
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_AsNew3()
TestSpan(<text>
Class C
Dim [|a|]$$, b As New C()
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_AsNew4()
TestSpan(<text>
Class C
Dim a,$$ [|b|] As New C()
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_AsNew5()
TestSpan(<text>
Class C
Dim a, [|b|] As $$New C()
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_AsNew6()
TestSpan(<text>
Class C
Dim a, [|b|] As New C() $$
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_ArrayInitialized_Untyped1()
TestSpan(<text>
Class C
Dim [|b(1)|] $$
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_ArrayInitialized_Untyped2()
TestSpan(<text>
Class C
Dim [|b($$1)|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_ArrayInitialized_Untyped3()
TestSpan(<text>
Class C
$$Dim [|b(1)|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_ArrayInitialized_Typed1()
TestSpan(<text>
Class C
Dim [|b(1)|] As Integer $$
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_ArrayInitialized_Typed2()
TestSpan(<text>
Class C
Dim [|b($$1)|] As Integer
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Single_ArrayInitialized_Typed3()
TestSpan(<text>
Class C
$$Dim [|b(1)|] As Integer
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_ArrayInitializedAndInitializerMix1()
TestSpan(<text>
Class C
Dim a, b, c(1), d, [|e(1,2)|], f As Integer, $$g As Double, h As Single = 1.0, i(4)
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_ArrayInitializedAndInitializerMix2()
TestSpan(<text>
Class C
Dim a, b, c(1), d, [|e(1,2)|], $$f As Integer, g As Double, h As Single = 1.0, i(4)
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_ArrayInitializedAndInitializerMix3()
TestSpan(<text>
Class C
Dim a, $$b, [|c(1)|], d, e(1,2), f As Integer, g As Double, h As Single = 1.0, i(4)
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_ArrayInitializedAndInitializerMix4()
TestSpan(<text>
Class C
Dim a, b, c(1), d, e(1,2), f As Integer, g As Double, h As Single = 1.0,$$ [|i(4)|]
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_ArrayInitializedAndInitializerMix5()
TestSpan(<text>
Class C
Dim a, b, c(1), d, e(1,2), f As Integer, g As Double, [|h As Single = 1.0|]$$, i(4)
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_MixAll1()
TestSpan(<text>
Class C
Dim $$a As Integer, [|b|], c, d As New B(), e As Boolean(), f(1) As Integer, g() As Boolean, h = 2, i As Integer = 3, j
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_MixAll2()
TestSpan(<text>
Class C
Dim a As Integer, b,$$ [|c|], d As New B(), e As Boolean(), f(1) As Integer, g() As Boolean, h = 2, i As Integer = 3, j
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_MixAll3()
TestSpan(<text>
Class C
Dim a As Integer, b, c, [|d|] As New B(), e As $$Boolean(), f(1) As Integer, g() As Boolean, h = 2, i As Integer = 3, j
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_MixAll4()
TestSpan(<text>
Class C
Dim a As Integer, b, c, d As New B(), e As Boolean(), [|f(1)|] As Integer, $$g() As Boolean, h = 2, i As Integer = 3, j
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_MixAll5()
TestSpan(<text>
Class C
Dim a As Integer, b, c, d As New B(), e As Boolean(), f(1) As Integer, g() As Boolean, [|h = $$2|], i As Integer = 3, j
End Class
</text>)
End Sub
<Fact>
Public Sub Field_Multiple_MixAll6()
TestSpan(<text>
Class C
Dim a As Integer, b, c, d As New B(), e As Boolean(), f(1) As Integer, g() As Boolean, h = 2, [|i As Integer = 3|], j $$
End Class
</text>)
End Sub
#End Region
#Region "Local Variable Declaration"
<Fact>
Public Sub Local_NoInitializer1()
TestMissing(<text>
Class C
Sub M
Dim A As Integer$$
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_NoInitializer2()
TestMissing(<text>
Class C
Sub M
Dim a, b$$
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_NoInitializer3()
TestMissing(<text>
Class C
Sub M
Dim a$$, b
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_NoInitializer4()
TestSpan(<text>
Class C
Sub M
Dim a $$As Integer, [|b = 1|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_NoInitializer5()
TestSpan(<text>
Class C
Sub M
Dim [|a As Integer = 1|], b As Integer$$, c As Integer = 1
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_NoInitializer6()
TestSpan(<text>
Class C
Sub M
Dim a As Integer = 1, b As Integer,$$ c As Integer, [|d As Integer = 1|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_NoInitializer7()
TestSpan(<text>
Class C
Sub M
Dim $$ a As Integer, b As Integer, c As Integer, [|d As New Integer|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_NoInitializer8()
TestSpan(<text>
Class C
Sub M
Dim [|a As New Integer|], b As Integer, c As Integer, $$ d As Integer
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Const1()
TestMissing(<text>
Class C
Sub M
Const A As Integer = $$0
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Const2()
TestMissing(<text>
Class C
Sub M
Con$$st A As Integer = 0
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Const3()
TestMissing(<text>
Class C
Sub M
Const A$$A As Integer = 0
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_Untyped1()
TestSpan(<text>
Class C
Sub M
$$ Dim [|a = 1|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_Untyped2()
TestSpan(<text>
Class C
Sub M
Dim$$ [|a = 1|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_Untyped3()
TestSpan(<text>
Class C
Sub M
Dim [|a$$a = 1|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_Untyped4()
TestSpan(<text>
Class C
Sub M
Dim [|aa = 1$$|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_Untyped5()
TestSpan(<text>
Class C
Sub M
Dim [|a = 1|] $$
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_Untyped1()
TestSpan(<text>
Class C
Sub M
$$ Dim [|a = 1|], b = 1
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_Untyped2()
TestSpan(<text>
Class C
Sub M
Dim$$ [|a = 1|], b = 1
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_Untyped3()
TestSpan(<text>
Class C
Sub M
Dim [|$$a = 1|], b = 1
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_Untyped4()
TestSpan(<text>
Class C
Sub M
Dim [|a = 1|]$$, b = 1
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_Untyped5()
TestSpan(<text>
Class C
Sub M
Dim a = 1,$$ [|b = 1|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_Untyped6()
TestSpan(<text>
Class C
Sub M
Dim a = 1, [|b = 1|] $$
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_Typed1()
TestSpan(<text>
Class C
Sub M
$$ Dim [|a As Integer = 1|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_Typed2()
TestSpan(<text>
Class C
Sub M
Dim [|a As Int$$eger = 1|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_Typed3()
TestSpan(<text>
Class C
Sub M
Dim [|a As Integer = 1$$|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_Typed()
' syntax error, so it doesn't really matter what we do as long as it's not totally off
TestSpan(<text>
Class C
Sub M
Dim [|a$$|], b As Integer = 1
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_AsNew1()
TestSpan(<text>
Class C
Sub M
$$ Dim [|a As New C()|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_AsNew2()
TestSpan(<text>
Class C
Sub M
Dim [|a$$a As New C()|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_AsNew3()
TestSpan(<text>
Class C
Sub M
Dim [|a As New $$C()|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_AsNew4()
TestSpan(<text>
Class C
Sub M
Dim [|a As New C()|] $$
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_AsNew1()
TestSpan(<text>
Class C
Sub M
$$ Dim [|a|], b As New C()
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_AsNew2()
TestSpan(<text>
Class C
Sub M
Dim $$[|a|], b As New C()
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_AsNew3()
TestSpan(<text>
Class C
Sub M
Dim [|a|]$$, b As New C()
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_AsNew4()
TestSpan(<text>
Class C
Sub M
Dim a,$$ [|b|] As New C()
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_AsNew5()
TestSpan(<text>
Class C
Sub M
Dim a, [|b|] As $$New C()
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_AsNew6()
TestSpan(<text>
Class C
Sub M
Dim a, [|b|] As New C() $$
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Static()
TestSpan(<text>
Class C
Sub M
Static$$ [|a As Integer = 1|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_ArrayInitialized_Untyped1()
TestSpan(<text>
Class C
Sub M
Dim [|b(1)|] $$
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_ArrayInitialized_Untyped2()
TestSpan(<text>
Class C
Sub M
Dim [|b($$1)|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_ArrayInitialized_Untyped3()
TestSpan(<text>
Class C
Sub M
$$Dim [|b(1)|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_ArrayInitialized_Typed1()
TestSpan(<text>
Class C
Sub M
Dim [|b(1)|] As Integer $$
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_ArrayInitialized_Typed2()
TestSpan(<text>
Class C
Sub M
Dim [|b($$1)|] As Integer
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Single_ArrayInitialized_Typed3()
TestSpan(<text>
Class C
Sub M
$$Dim [|b(1)|] As Integer
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_ArrayInitializedAndInitializerMix1()
TestSpan(<text>
Class C
Sub M
Dim a, b, c(1), d, [|e(1,2)|], f As Integer, $$g As Double, h As Single = 1.0, i(4)
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_ArrayInitializedAndInitializerMix2()
TestSpan(<text>
Class C
Sub M
Dim a, b, c(1), d, [|e(1,2)|], $$f As Integer, g As Double, h As Single = 1.0, i(4)
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_ArrayInitializedAndInitializerMix3()
TestSpan(<text>
Class C
Sub M
Dim a, $$b, [|c(1)|], d, e(1,2), f As Integer, g As Double, h As Single = 1.0, i(4)
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_ArrayInitializedAndInitializerMix4()
TestSpan(<text>
Class C
Sub M
Dim a, b, c(1), d, e(1,2), f As Integer, g As Double, h As Single = 1.0,$$ [|i(4)|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_ArrayInitializedAndInitializerMix5()
TestSpan(<text>
Class C
Sub M
Dim a, b, c(1), d, e(1,2), f As Integer, g As Double, [|h As Single = 1.0|]$$, i(4)
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_MixAll1()
TestSpan(<text>
Class C
Sub M
Dim $$a As Integer, [|b|], c, d As New B(), e As Boolean(), f(1) As Integer, g() As Boolean, h = 2, i As Integer = 3, j
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_MixAll2()
TestSpan(<text>
Class C
Sub M
Dim a As Integer, b,$$ [|c|], d As New B(), e As Boolean(), f(1) As Integer, g() As Boolean, h = 2, i As Integer = 3, j
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_MixAll3()
TestSpan(<text>
Class C
Sub M
Dim a As Integer, b, c, [|d|] As New B(), e As $$Boolean(), f(1) As Integer, g() As Boolean, h = 2, i As Integer = 3, j
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_MixAll4()
TestSpan(<text>
Class C
Sub M
Dim a As Integer, b, c, d As New B(), e As Boolean(), [|f(1)|] As Integer, $$g() As Boolean, h = 2, i As Integer = 3, j
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_MixAll5()
TestSpan(<text>
Class C
Sub M
Dim a As Integer, b, c, d As New B(), e As Boolean(), f(1) As Integer, g() As Boolean, [|h = $$2|], i As Integer = 3, j
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Local_Multiple_MixAll6()
TestSpan(<text>
Class C
Sub M
Dim a As Integer, b, c, d As New B(), e As Boolean(), f(1) As Integer, g() As Boolean, h = 2, [|i As Integer = 3|], j $$
End Sub
End Class
</text>)
End Sub
#End Region
#Region "Method Body Statements"
<WorkItem(538820, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/538820")>
<Fact>
Public Sub TestEndOfStatement()
TestSpan(<text>
class C
sub Goo()
[|Console.WriteLine()$$|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub If1()
TestSpan(<text>
Class C
Sub M
[|If$$ True Then|]
End If
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Else1()
TestSpan(<text>
Class C
Sub M
If True Then
[|Else$$|]
End If
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub ElseIf1()
TestSpan(<text>
Class C
Sub M
If True Then
[|Else$$ If False|]
End If
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub EndIf1()
TestSpan(<text>
Class C
Sub M
If True Then
[|End $$If|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub SingleLineIf1()
TestSpan(<text>
Class C
Sub M
[|If$$ True Then|] Goo() Else Bar()
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub SingleLineIf2()
TestSpan(<text>
Class C
Sub M
If True Then [|Goo()|] $$
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub SingleLineIf3()
TestSpan(<text>
Class C
Sub M
If True Then Goo() [|E$$lse|] Bar()
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub SingleLineIf4()
TestSpan(<text>
Class C
Sub M
If True Then Goo() Else [|Bar($$)|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Using1()
TestSpan(<text>
Class C
Sub M
[|Using $$Goo|]
End Using
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub EndUsing1()
TestSpan(<text>
Class C
Sub M
Using Goo
[|End$$ Using|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub SyncLock1()
TestSpan(<text>
Class C
Sub M
[|SyncLock $$Goo|]
End SyncLock
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub EndSyncLock1()
TestSpan(<text>
Class C
Sub M
SyncLock Goo
[|End$$ SyncLock|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub With1()
TestSpan(<text>
Class C
Sub M
[|With $$Goo|]
End With
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub EndWith1()
TestSpan(<text>
Class C
Sub M
With Goo
[|End$$ With|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Do1()
TestSpan(<text>
Class C
Sub M
[|Do$$|]
Loop
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Loop1()
TestSpan(<text>
Class C
Sub M
Do
$$ [|Loop|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub While1()
TestSpan(<text>
Class C
Sub M
[|While True$$|]
End While
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub EndWhile1()
TestSpan(<text>
Class C
Sub M
While True
$$ [|End While|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub For1()
TestSpan(<text>
Class C
Sub M
[|For $$a = 1 To 10 Step 2|]
Next
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub ForEach1()
TestSpan(<text>
Class C
Sub M
[|ForEach $$a in b|]
Next
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Next1()
TestSpan(<text>
Class C
Sub M
For a = 1 To 10 Step 2
$$ [|Next|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Select1()
TestSpan(<text>
Class C
Sub M
[|$$Select Case a|]
Case = 3
Case Else
End Select
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Case1()
TestSpan(<text>
Class C
Sub M
Select Case a
[|$$Case 3|]
Case Else
End Select
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Case2()
TestSpan(<text>
Class C
Sub M
Select Case a
[|$$Case < 3|]
Case Else
End Select
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub CaseElse1()
TestSpan(<text>
Class C
Sub M
Select Case a
Case 3
[|$$Case Else|]
End Select
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub EndSelect1()
TestSpan(<text>
Class C
Sub M
Select Case a
Case 3
Case Else
[|$$End Select|]
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Try1()
TestSpan(<text>
Class C
Sub M
[|Tr$$y|]
Finally
End Try
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Catch1()
TestSpan(<text>
Class C
Sub M
Try
[|Catch $$e As Exception|]
End Try
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub CatchWhen1()
TestSpan(<text>
Class C
Sub M
Try
[|Catch e As Exception When $$F(e)|]
End Try
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub Finally1()
TestSpan(<text>
Class C
Sub M
Try
[|Fi$$nally|]
End Try
End Sub
End Class
</text>)
End Sub
<Fact>
Public Sub EndTry1()
TestSpan(<text>
Class C
Sub M
Try
Finally
[|End $$Try|]
End Sub
End Class
</text>)
End Sub
#End Region
#Region "Lambdas"
<Fact>
Public Sub Lambda_SingleLine_Header1()
TestSpan(<text>
Class C
Sub Goo()
Console.WriteLine([|Funct$$ion(x)|] x + x)
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub Lambda_SingleLine_Header2()
TestSpan(<text>
Class C
Sub Goo()
Console.WriteLine([|$$Async Function()|] x + x)
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub Lambda_SingleLine_Header_Nested()
TestSpan(<text>
Class C
Sub Goo()
Dim x = Function(a) [|$$Function(b)|] a + b
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub Lambda_SingleLine_Header3()
TestSpan(<text>
Class C
Sub Goo()
Console.WriteLine([|Sub($$)|] M())
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub Lambda_SingleLine_Header4()
TestSpan(<text>
Class C
Sub Goo()
[|Console.WriteLine( $$ Sub() M())|]
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub Lambda_SingleLine_Body1()
TestSpan(<text>
Class C
Sub Goo()
Console.WriteLine(Function(x) [|x $$+ x|])
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub Lambda_SingleLine_Body2()
TestSpan(<text>
Class C
Sub Goo()
[|Console.WriteLine(Sub(x) M()$$)|]
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub Lambda_SingleLine_Body3()
TestSpan(<text>
Class C
Sub Goo()
Console.WriteLine( Sub() [|M()|] $$ )
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub Lambda_SingleLine_Body4()
TestSpan(<text>
Class C
Sub Goo()
[|Console.WriteLine( Sub() M()
$$ )|]
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub Lambda_SingleLine_Body5()
TestSpan(<text>
Class C
Sub Goo()
Private a As New D(Function() [|$$1|])
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub Lambda_MultiLine_Header1()
TestSpan(<text>
Class C
Sub Goo()
Console.WriteLine([|Funct$$ion(x)|]
x + x
End Function)
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub Lambda_MultiLine_Header2()
TestSpan(<text>
Class C
Sub Goo()
Console.WriteLine([|$$Async Function()|]
x + x
End Function)
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub Lambda_MultiLine_Header3()
TestSpan(<text>
Class C
Sub Goo()
Console.WriteLine([|Sub($$)|]
End Sub)
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub Lambda_MultiLine_Header4()
TestSpan(<text>
Class C
Sub Goo()
[|Console.WriteLine( $$ Sub()
M()
End Sub)|]
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub Lambda_MultiLine_Body1()
TestSpan(<text>
Class C
Sub Goo()
Console.WriteLine(Function(x)
[|F()|] $$
End Function)
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub Lambda_MultiLine_Footer1()
TestSpan(<text>
Class C
Sub Goo()
Console.WriteLine(Function(x)
F()
[|End Function|] $$ )
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub Lambda_MultiLine_Footer2()
TestSpan(<text>
Class C
Sub Goo()
Console.WriteLine(Sub()
[|$$End Sub|])
End Sub
End Class</text>)
End Sub
#End Region
#Region "Queries"
<Fact>
Public Sub TestFromClause1()
TestSpan(<text>
class C
sub Goo()
dim q = from x in $$customers, e in [|employees|]
select x
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestFromClause2()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers, e in [|$$employees|]
select x
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestFromClause3()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
from e in [|$$employees|]
select x
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestFromInQueryContinuation1()
TestSpan(<text>
Class C
Sub Goo()
Dim q = From x In customers
From e In employees
Group e By x Into g
From m In [|g.$$Count()|]
Select m.blah()
End Sub
End Class</text>)
End Sub
<WorkItem(544959, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544959")>
<Fact>
Public Sub TestBeforeFromInQueryContinuation1()
TestSpan(<text>
Class C
Sub Goo()
Dim q = From x In customers
$$ From e In [|employees|]
Group e By x Into g
From m In g.Count()
Select m.blah()
End Sub
End Class</text>)
End Sub
<WorkItem(544959, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544959")>
<Fact>
Public Sub TestBeforeFromInQueryContinuation2()
TestSpan(<text>
Class C
Sub Goo()
Dim q =
$$ From x In customers, e In [|employees|]
Group e By x Into g
From m In g.Count()
Select m.blah()
End Sub
End Class</text>)
End Sub
<WorkItem(544959, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544959")>
<Fact>
Public Sub TestBeforeFromInQueryContinuation3()
TestSpan(<text>
Class C
Sub Goo()
Dim q = From x In customers
From e In employees
Group e By x Into g
$$ From m In [|g.Count()|]
Select m.blah()
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub TestJoin1()
TestSpan(<text>
class C
sub Goo()
dim [|q = from x in customers
join ord in $$orders on c.Id Equals ord.Id
select x|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestJoin2()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
join ord in orders on [|$$c.Id|] Equals ord.Id
select x
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestJoin3()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
join ord in orders on c.Id Equals [|$$ord.Id|]
select x
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestLet1()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let m = $$[|x.y|]
select x
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestLet2()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0, m = $$[|x.y|]
select x
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestLet3()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
$$ let n = [|0|], m = x.y
select x
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestLet4()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = [|0|]$$, m = x.y
select x
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestLet5()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0,$$ m = [|x.y|]
select x
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestLet6()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = [|F($$0)|], m = x.y
select x
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestLet7()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let $$n = [|F(0)|], m = x.y
select x
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestSelect1()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0, m = x.y
select [|$$x + 1|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestSelect2()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0, m = x.y
select m = [|$$x + 1|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestSelect3()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0, m = x.y
select [|n = 2, m = $$x + 1|]
end sub
end class</text>)
End Sub
<WorkItem(544960, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544960")>
<Fact>
Public Sub TestSelect4()
TestSpan(<text>
Class A
Public Sub Test()
Dim query = From c In categories
Group Join p In productList On c Equals p.Category Into Group
Select [|Category = c, $$Products = Group|]
End Sub
End Class</text>)
End Sub
<WorkItem(544963, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544963")>
<Fact>
Public Sub TestSelect5()
TestSpan(<text>
Class A
Public Sub Test()
Dim numbers() = {5, 4, 1, 3, 9, 8, 6, 7, 2, 0}
Dim numsPlusOne =
From n In numbers
Select $$z = [|n + 1|]
Order By z
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub TestSelect6()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0, m = x.y
select [|n = 2, $$m = x + 1|]
end sub
end class</text>)
End Sub
<WorkItem(544964, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544964")>
<Fact>
Public Sub TestBeforeSelectClause()
TestSpan(<text>
Class A
Public Sub Test()
Dim q = From x In customers
Let n = 0, m = x.y
$$ Select [|x + 1|]
End Sub
End Class</text>)
End Sub
<Fact>
Public Sub TestWhereClauseExpression()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0, m = x.y
where [|$$x + 1 > 0|]
end sub
end class</text>)
End Sub
<WorkItem(544965, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544965")>
<Fact>
Public Sub TestBeforeWhereClause()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0, m = x.y
$$ where [|x + 1 > 0|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestTakeWhile1()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0, m = x.y
Take While [|$$x + 1 > 0|]
end sub
end class</text>)
End Sub
<WorkItem(544966, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544966")>
<Fact>
Public Sub TestBeforeTakeWhile()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0, m = x.y
$$ Take While [|x + 1 > 0|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestSkipWhile1()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0, m = x.y
Skip While [|$$x + 1 > 0|]
end sub
end class</text>)
End Sub
<WorkItem(544966, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544966")>
<Fact>
Public Sub TestBeforeSkipWhile()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0, m = x.y
$$ Skip While [|x + 1 > 0|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestOrderBy1()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0, m = x.y
order by [|$$x|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestOrderBy2()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0, m = x.y
order by [|$$x|] ascending
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestOrderBy3()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0, m = x.y
order by [|$$x|] descending
end sub
end class</text>)
End Sub
<WorkItem(544967, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544967")>
<Fact>
Public Sub TestBeforeOrderBy()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0, m = x.y
$$ order by [|x|] descending
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestThenBy1()
TestSpan(<text>
class C
sub Goo()
Dim digits() = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}
Dim sortedDigits = From d In digits
Select d
Order By d.Length, [|$$d|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestThenBy2()
TestSpan(<text>
class C
sub Goo()
Dim digits() = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}
Dim sortedDigits = From d In digits
Select d
Order By [|$$d.Length|], d
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestThenBy3()
TestSpan(<text>
class C
sub Goo()
Dim digits() = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}
Dim sortedDigits = From d In digits
Order By [|d.Le$$ngth|], d
Select d
end sub
end class</text>)
End Sub
<WorkItem(544968, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544968")>
<Fact>
Public Sub TestThenBy4()
TestSpan(<text>
class C
sub Goo()
Dim digits() = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}
Dim sortedDigits = From d In digits
Order By d.Length, [|$$d|]
Select d
end sub
end class</text>)
End Sub
<WorkItem(544967, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/544967")>
<Fact>
Public Sub TestBeforeOrderByAndThenBy()
TestSpan(<text>
class C
sub Goo()
Dim digits() = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"}
Dim sortedDigits = From d In digits
$$ Order By [|d.Length|], d
Select d
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestFunctionAggregation1()
TestSpan(<text>
class C
sub Goo()
dim q = from x in customers
let n = 0, m = x.y
order by x descending
group y = x * 10 into sum([|$$x + 1|])
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy1a()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
$$ Group [|y = x * 10, z = x * 100|] By evenOdd = x Mod 2 Into Sum(y + 1)
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy1b()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
$$ Group y = [|x * 10|] By evenOdd = x Mod 2 Into Sum(y + 1)
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy1c()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = [|x *$$ 10|] By evenOdd = x Mod 2 Into Sum(y + 1)
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy2()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group [|y =$$ x * 10, z = x * 100|] By evenOdd = x Mod 2 Into Sum(y + 1)
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy3()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group [|y = x * 10, z = x * 100|] $$ By evenOdd = x Mod 2 Into Sum(y + 1)
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy4()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 $$By [|evenOdd = x Mod 2 Into x1 = Sum(y + 1), x2 = Sum(y + 2)|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy5a()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 By $$ [|evenOdd = x Mod 2 Into x1 = Sum(y + 1), x2 = Sum(y + 2)|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy5b()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 By $$evenOdd = [|x Mod 2|] Into x1 = Sum(y + 1), x2 = Sum(y + 2)
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy5c()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 By $$
[|evenOdd = x Mod 2 Into x1 = Sum(y + 1), x2 = Sum(y + 2)|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy5d()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 By
$$ [|evenOdd = x Mod 2 Into x1 = Sum(y + 1), x2 = Sum(y + 2)|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy5f()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 By $$
[|evenOdd = x Mod 2 Into x1 = Sum(y + 1), x2 = Sum(y + 2)|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy6a()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 By evenOdd $$= [|x Mod 2|] Into x1 = Sum(y + 1), x2 = Sum(y + 2)
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy6b()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 By evenOdd = [|x $$Mod 2|] Into x1 = Sum(y + 1), x2 = Sum(y + 2)
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy7a()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 By [|$$evenOdd = x Mod 2, y = Mod 3|] Into x1 = Sum(y + 1), x2 = Sum(y + 2)
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy7b()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 By [|evenOdd = x Mod 2, y$$ = Mod 3|] Into x1 = Sum(y + 1), x2 = Sum(y + 2)
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy8()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 By
[|evenOdd = x Mod 2, y = Mod 3 $$Into x1 = Sum(y + 1), x2 = Sum(y + 2)|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy9()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 By
evenOdd = x Mod 2, y = Mod 3 Into x1 = Sum([|$$y + 1|]), x2 = Sum(y + 2)
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy10()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 By
evenOdd = x Mod 2, y = Mod 3 Into x1 = Sum(y + 1), x2 = Sum([|$$y + 2|])
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy11()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 By
evenOdd = x Mod 2, y = Mod 3 Into x1 = S$$um([|y + 1|]), x2 = Sum(y + 2)
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy12()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 By
evenOdd = x Mod 2, y = Mod 3 Into x1 = Sum(y + 1), x2 = S$$um([|y + 2|])
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy13()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 By
[|evenOdd = x Mod 2, y = Mod 3 Into x1 = Sum(y + 1),$$ x2 = Sum(y + 2)|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub GroupBy14()
TestSpan(<text>
class C
sub Goo()
Dim q = From x In Nums()
Let n = 0, m = x.ToString()
Order By x Descending
Group y = x * 10, z = x * 100 By
[|evenOdd = x Mod 2, y = Mod 3 Into x1 $$= Sum(y + 1), x2 = Sum(y + 2)|]
end sub
end class</text>)
End Sub
<Fact>
Public Sub TestGroupByNested()
TestSpan(<text>
Imports System.Linq
Class C
Public Class Customer
Public CompanyName As String
Public Orders As Order()
End Class
Public Class Order
Public OrderDate As DateTime
End Class
Public Sub NestedGroupBy()
Dim customers As List(Of Customer) = Nothing
Dim customerOrderGroups = From c In customers
Select New With {c.CompanyName,
.YearGroups =
From o In c.Orders
Group o By o.OrderDate.Year Into Group
Select New With {.Year = Year,
.MonthGroups =
From o In Group
Group o By [|o.Order$$Date.Month|] Into MonthGroup = Group
Select New With {.Month = Month,
.Orders = MonthGroup}}}
End Sub
End Class
</text>)
End Sub
#End Region
End Class
End Namespace
|
aelij/roslyn
|
src/EditorFeatures/VisualBasicTest/EditAndContinue/BreakpointSpansTests.vb
|
Visual Basic
|
apache-2.0
| 66,031 |
/**
* Copyright (c) 2008, http://www.snakeyaml.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.yaml.snakeyaml.nodes;
import java.net.URI;
import java.net.URISyntaxException;
import junit.framework.TestCase;
public class TagTest extends TestCase {
public void testCreate() {
try {
new Tag((String) null);
fail();
} catch (Exception e) {
assertEquals("Tag must be provided.", e.getMessage());
}
try {
new Tag("");
fail();
} catch (Exception e) {
assertEquals("Tag must not be empty.", e.getMessage());
}
try {
new Tag("!Dice ");
fail();
} catch (Exception e) {
assertEquals("Tag must not contain leading or trailing spaces.", e.getMessage());
}
Tag tag = new Tag(TagTest.class);
assertEquals(Tag.PREFIX + "org.yaml.snakeyaml.nodes.TagTest", tag.getValue());
}
public void testCreate2() {
try {
new Tag((Class<?>) null);
fail();
} catch (Exception e) {
assertEquals("Class for tag must be provided.", e.getMessage());
}
}
public void testGetClassName() {
Tag tag = new Tag(Tag.PREFIX + "org.yaml.snakeyaml.nodes.TagTest");
assertEquals("org.yaml.snakeyaml.nodes.TagTest", tag.getClassName());
}
public void testGetClassNameError() {
try {
Tag tag = new Tag("!TagTest");
tag.getClassName();
fail("Class name is only available for global tag");
} catch (Exception e) {
assertEquals("Invalid tag: !TagTest", e.getMessage());
}
}
public void testLength() {
String t = Tag.PREFIX + "org.yaml.snakeyaml.nodes.TagTest";
Tag tag = new Tag(t);
assertEquals(t.length(), tag.getLength());
}
public void testToString() {
Tag tag = new Tag("!car");
assertEquals("!car", tag.toString());
}
public void testUri1() {
Tag tag = new Tag("!Académico");
assertEquals("!Acad%C3%A9mico", tag.toString());
}
public void testUri2() {
Tag tag = new Tag("!ruby/object:Test::Module::Sub2");
assertEquals("!ruby/object:Test::Module::Sub2", tag.getValue());
}
public void testCompare() {
Tag tag = new Tag("!car");
assertEquals(0, tag.compareTo(new Tag("!car")));
}
public void testEqualsObject() {
Tag tag = new Tag("!car");
assertEquals(tag, tag);
assertEquals(tag, new Tag("!car"));
assertFalse(tag.equals(new Tag("!!str")));
assertFalse(tag.equals(null));
assertFalse(tag.equals(25));
}
}
|
bmoliveira/snake-yaml
|
src/test/java/org/yaml/snakeyaml/nodes/TagTest.java
|
Java
|
apache-2.0
| 3,266 |
public class Ex_1_1_07 {
public static void main(String[] args)
{
double t = 9.0;
while (Math.abs(t - 9.0/t) > .00001)
{
t = (9.0/t + t) / 2.0;
StdOut.printf("%.5f\n", t);
}
// System.out.println('b' + 'c');
}
}
|
wz12406/accumulate
|
algorithm/src/webapp/doc/算法 第四版/AlgorithmsSedgewick-master/1-Fundamentals/1-1-BasicProgModel/Ex_1_1_07.java
|
Java
|
apache-2.0
| 300 |
using System;
using System.Collections;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
namespace CrossApplication.Core.Wpf.Themes.Controls
{
public class NavigationBar : Control, INotifyPropertyChanged
{
public int MaximumCountVisibleElements
{
get { return (int) GetValue(MaximumCountVisibleElementsProperty); }
set { SetValue(MaximumCountVisibleElementsProperty, value); }
}
public DataTemplate BarItemContextMenuTemplate
{
get { return (DataTemplate) GetValue(BarItemContextMenuTemplateProperty); }
set { SetValue(BarItemContextMenuTemplateProperty, value); }
}
public DataTemplate BarItemTemplate
{
get { return (DataTemplate) GetValue(BarItemTemplateProperty); }
set { SetValue(BarItemTemplateProperty, value); }
}
public IEnumerable ItemsSource
{
get { return (IEnumerable) GetValue(ItemsSourceProperty); }
set
{
if (value == null)
ClearValue(ItemsControl.ItemsSourceProperty);
else
SetValue(ItemsControl.ItemsSourceProperty, value);
}
}
public Style ItemContainerStyle
{
get { return (Style) GetValue(ItemContainerStyleProperty); }
set { SetValue(ItemContainerStyleProperty, value); }
}
public Orientation BarItemsOrientation
{
get { return (Orientation) GetValue(BarItemsOrientationProperty); }
set { SetValue(BarItemsOrientationProperty, value); }
}
public IEnumerable BarItems
{
get
{
if (_barItems == null)
CreateItemCollection();
if (_barItems == null || _barItems.Count == 0)
yield break;
var min = Math.Min(_barItems.Count, MaximumCountVisibleElements);
for (var i = 0; i < min; ++i)
yield return _barItems.GetItemAt(i);
if (_barItems.Count > MaximumCountVisibleElements)
yield return null;
}
}
public IEnumerable ContextItems
{
get
{
if (_barItems == null)
CreateItemCollection();
if (_barItems == null)
yield break;
for (var i = MaximumCountVisibleElements; i < _barItems.Count; ++i)
yield return _barItems.GetItemAt(i);
}
}
static NavigationBar()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(NavigationBar), new FrameworkPropertyMetadata(typeof(NavigationBar)));
}
public event PropertyChangedEventHandler PropertyChanged;
private void CreateItemCollection()
{
if (ItemsSource == null)
return;
_barItems = new CollectionView(ItemsSource);
}
public override void OnApplyTemplate()
{
}
private static void OnItemsSourceChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs eventArgs)
{
((NavigationBar) dependencyObject).OnItemsSourceChanged(eventArgs);
}
private void OnItemsSourceChanged(DependencyPropertyChangedEventArgs eventArgs)
{
if (eventArgs.OldValue is INotifyCollectionChanged)
{
var collection = (INotifyCollectionChanged) eventArgs.OldValue;
collection.CollectionChanged -= OnCollectionChanged;
}
if (eventArgs.NewValue is INotifyCollectionChanged)
{
var collection = (INotifyCollectionChanged) eventArgs.NewValue;
collection.CollectionChanged += OnCollectionChanged;
}
}
private void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs)
{
OnPropertyChanged("BarItems");
OnPropertyChanged("ContextItems");
}
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
public static readonly DependencyProperty ItemContainerStyleProperty = DependencyProperty.Register(
"ItemContainerStyle", typeof(Style), typeof(NavigationBar), new PropertyMetadata(default(Style)));
public static readonly DependencyProperty BarItemContextMenuTemplateProperty = DependencyProperty.Register(
"BarItemContextMenuTemplate", typeof(DataTemplate), typeof(NavigationBar), new PropertyMetadata(null));
public static readonly DependencyProperty BarItemsOrientationProperty = DependencyProperty.Register(
"BarItemsOrientation", typeof(Orientation), typeof(NavigationBar), new PropertyMetadata(Orientation.Horizontal));
public static readonly DependencyProperty BarItemTemplateProperty = DependencyProperty.Register(
"BarItemTemplate", typeof(DataTemplate), typeof(NavigationBar), new PropertyMetadata(null));
public static readonly DependencyProperty ItemsSourceProperty = DependencyProperty.Register("ItemsSource", typeof(IEnumerable), typeof(NavigationBar),
new FrameworkPropertyMetadata(null, OnItemsSourceChanged));
public static readonly DependencyProperty MaximumCountVisibleElementsProperty = DependencyProperty.Register("MaximumCountVisibleElements", typeof(int),
typeof(NavigationBar), new PropertyMetadata(default(int)));
private CollectionView _barItems;
}
}
|
jan-schubert/CrossMailing
|
Source/Core/CrossApplication.Core.Wpf.Themes/Controls/NavigationBar.cs
|
C#
|
apache-2.0
| 5,954 |
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.flowable.cmmn.rest.service.api.runtime;
import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.entry;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.ObjectOutputStream;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpDelete;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.entity.StringEntity;
import org.flowable.cmmn.api.runtime.CaseInstance;
import org.flowable.cmmn.engine.test.CmmnDeployment;
import org.flowable.cmmn.rest.service.BaseSpringRestTestCase;
import org.flowable.cmmn.rest.service.HttpMultipartHelper;
import org.flowable.cmmn.rest.service.api.CmmnRestUrls;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import net.javacrumbs.jsonunit.core.Option;
/**
* Test for all REST-operations related to Case instance variables.
*
* @author Tijs Rademakers
*/
public class CaseInstanceVariablesCollectionResourceTest extends BaseSpringRestTestCase {
/**
* Test getting all case variables. GET cmmn-runtime/case-instances/{caseInstanceId}/variables
*/
@CmmnDeployment(resources = { "org/flowable/cmmn/rest/service/api/repository/oneHumanTaskCase.cmmn" })
public void testGetCaseVariables() throws Exception {
Calendar cal = Calendar.getInstance();
// Start process with all types of variables
Map<String, Object> caseVariables = new HashMap<>();
caseVariables.put("stringProcVar", "This is a ProcVariable");
caseVariables.put("intProcVar", 123);
caseVariables.put("longProcVar", 1234L);
caseVariables.put("shortProcVar", (short) 123);
caseVariables.put("doubleProcVar", 99.99);
caseVariables.put("booleanProcVar", Boolean.TRUE);
caseVariables.put("dateProcVar", cal.getTime());
caseVariables.put("byteArrayProcVar", "Some raw bytes".getBytes());
caseVariables.put("overlappingVariable", "process-value");
CaseInstance caseInstance = runtimeService.createCaseInstanceBuilder().caseDefinitionKey("oneHumanTaskCase").variables(caseVariables).start();
// Request all variables (no scope provides) which include global an local
CloseableHttpResponse response = executeRequest(new HttpGet(SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(
CmmnRestUrls.URL_CASE_INSTANCE_VARIABLE_COLLECTION, caseInstance.getId())), HttpStatus.SC_OK);
JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
closeResponse(response);
assertThat(responseNode).isNotNull();
assertThat(responseNode.isArray()).isTrue();
assertThat(responseNode).hasSize(9);
}
/**
* Test creating a single case variable. POST cmmn-runtime/case-instance/{caseInstanceId}/variables
*/
@CmmnDeployment(resources = { "org/flowable/cmmn/rest/service/api/repository/oneHumanTaskCase.cmmn" })
public void testCreateSingleProcessInstanceVariable() throws Exception {
CaseInstance caseInstance = runtimeService.createCaseInstanceBuilder().caseDefinitionKey("oneHumanTaskCase").start();
ArrayNode requestNode = objectMapper.createArrayNode();
ObjectNode variableNode = requestNode.addObject();
variableNode.put("name", "myVariable");
variableNode.put("value", "simple string value");
variableNode.put("type", "string");
// Create a new local variable
HttpPost httpPost = new HttpPost(
SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_CASE_INSTANCE_VARIABLE_COLLECTION, caseInstance.getId()));
httpPost.setEntity(new StringEntity(requestNode.toString()));
CloseableHttpResponse response = executeBinaryRequest(httpPost, HttpStatus.SC_CREATED);
JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent()).get(0);
closeResponse(response);
assertThat(responseNode).isNotNull();
assertThatJson(responseNode)
.when(Option.IGNORING_EXTRA_FIELDS)
.isEqualTo("{"
+ " name: 'myVariable',"
+ " value: 'simple string value',"
+ " scope: 'global',"
+ " type: 'string'"
+ "}");
assertThat(runtimeService.hasVariable(caseInstance.getId(), "myVariable")).isTrue();
assertThat(runtimeService.getVariable(caseInstance.getId(), "myVariable")).isEqualTo("simple string value");
}
/**
* Test creating a single case variable using a binary stream. POST cmmn-runtime/case-instances/{caseInstanceId}/variables
*/
@CmmnDeployment(resources = { "org/flowable/cmmn/rest/service/api/repository/oneHumanTaskCase.cmmn" })
public void testCreateSingleBinaryProcessVariable() throws Exception {
CaseInstance caseInstance = runtimeService.createCaseInstanceBuilder().caseDefinitionKey("oneHumanTaskCase").start();
InputStream binaryContent = new ByteArrayInputStream("This is binary content".getBytes());
// Add name, type and scope
Map<String, String> additionalFields = new HashMap<>();
additionalFields.put("name", "binaryVariable");
additionalFields.put("type", "binary");
HttpPost httpPost = new HttpPost(
SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_CASE_INSTANCE_VARIABLE_COLLECTION, caseInstance.getId()));
httpPost.setEntity(HttpMultipartHelper.getMultiPartEntity("value", "application/octet-stream", binaryContent, additionalFields));
CloseableHttpResponse response = executeBinaryRequest(httpPost, HttpStatus.SC_CREATED);
JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
closeResponse(response);
assertThat(responseNode).isNotNull();
assertThatJson(responseNode)
.when(Option.IGNORING_EXTRA_FIELDS)
.isEqualTo("{"
+ " name: 'binaryVariable',"
+ " value: null,"
+ " scope: 'local',"
+ " type: 'binary',"
+ " valueUrl: '" + SERVER_URL_PREFIX + CmmnRestUrls
.createRelativeResourceUrl(CmmnRestUrls.URL_CASE_INSTANCE_VARIABLE_DATA, caseInstance.getId(), "binaryVariable") + "'"
+ "}");
// Check actual value of variable in engine
Object variableValue = runtimeService.getVariable(caseInstance.getId(), "binaryVariable");
assertThat(variableValue).isInstanceOf(byte[].class);
assertThat(new String((byte[]) variableValue)).isEqualTo("This is binary content");
}
/**
* Test creating a single process variable using a binary stream containing a serializable. POST runtime/process-instances/{processInstanceId}/variables
*/
@CmmnDeployment(resources = { "org/flowable/cmmn/rest/service/api/repository/oneHumanTaskCase.cmmn" })
public void testCreateSingleSerializableProcessVariable() throws Exception {
CaseInstance caseInstance = runtimeService.createCaseInstanceBuilder().caseDefinitionKey("oneHumanTaskCase").start();
TestSerializableVariable serializable = new TestSerializableVariable();
serializable.setSomeField("some value");
// Serialize object to readable stream for representation
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
ObjectOutputStream output = new ObjectOutputStream(buffer);
output.writeObject(serializable);
output.close();
InputStream binaryContent = new ByteArrayInputStream(buffer.toByteArray());
// Add name, type and scope
Map<String, String> additionalFields = new HashMap<>();
additionalFields.put("name", "serializableVariable");
additionalFields.put("type", "serializable");
// Upload a valid BPMN-file using multipart-data
HttpPost httpPost = new HttpPost(
SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_CASE_INSTANCE_VARIABLE_COLLECTION, caseInstance.getId()));
httpPost.setEntity(HttpMultipartHelper.getMultiPartEntity("value", "application/x-java-serialized-object", binaryContent, additionalFields));
CloseableHttpResponse response = executeBinaryRequest(httpPost, HttpStatus.SC_CREATED);
JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
closeResponse(response);
assertThat(responseNode).isNotNull();
assertThatJson(responseNode)
.when(Option.IGNORING_EXTRA_FIELDS)
.isEqualTo("{"
+ " name: 'serializableVariable',"
+ " value: null,"
+ " scope: 'local',"
+ " type: 'serializable',"
+ " valueUrl: '" + SERVER_URL_PREFIX + CmmnRestUrls
.createRelativeResourceUrl(CmmnRestUrls.URL_CASE_INSTANCE_VARIABLE_DATA, caseInstance.getId(), "serializableVariable") + "'"
+ "}");
// Check actual value of variable in engine
Object variableValue = runtimeService.getVariable(caseInstance.getId(), "serializableVariable");
assertThat(variableValue).isInstanceOf(TestSerializableVariable.class);
assertThat(((TestSerializableVariable) variableValue).getSomeField()).isEqualTo("some value");
}
/**
* Test creating a single case variable, testing edge case exceptions. POST cmmn-runtime/case-instances/{caseInstanceId}/variables
*/
@CmmnDeployment(resources = { "org/flowable/cmmn/rest/service/api/repository/oneHumanTaskCase.cmmn" })
public void testCreateSingleCaseVariableEdgeCases() throws Exception {
// Test adding variable to unexisting execution
ArrayNode requestNode = objectMapper.createArrayNode();
ObjectNode variableNode = requestNode.addObject();
variableNode.put("name", "existingVariable");
variableNode.put("value", "simple string value");
variableNode.put("type", "string");
HttpPost httpPost = new HttpPost(
SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_CASE_INSTANCE_VARIABLE_COLLECTION, "unexisting"));
httpPost.setEntity(new StringEntity(requestNode.toString()));
closeResponse(executeRequest(httpPost, HttpStatus.SC_NOT_FOUND));
// Test trying to create already existing variable
CaseInstance caseInstance = runtimeService.createCaseInstanceBuilder().caseDefinitionKey("oneHumanTaskCase").start();
runtimeService.setVariable(caseInstance.getId(), "existingVariable", "I already exist");
httpPost = new HttpPost(
SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_CASE_INSTANCE_VARIABLE_COLLECTION, caseInstance.getId()));
httpPost.setEntity(new StringEntity(requestNode.toString()));
closeResponse(executeRequest(httpPost, HttpStatus.SC_CREATED));
// Test creating nameless variable
variableNode.removeAll();
variableNode.put("value", "simple string value");
httpPost = new HttpPost(
SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_CASE_INSTANCE_VARIABLE_COLLECTION, caseInstance.getId()));
httpPost.setEntity(new StringEntity(requestNode.toString()));
closeResponse(executeRequest(httpPost, HttpStatus.SC_BAD_REQUEST));
// Test passing in empty array
requestNode.removeAll();
httpPost = new HttpPost(
SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_CASE_INSTANCE_VARIABLE_COLLECTION, caseInstance.getId()));
httpPost.setEntity(new StringEntity(requestNode.toString()));
closeResponse(executeRequest(httpPost, HttpStatus.SC_BAD_REQUEST));
// Test passing in object instead of array
httpPost = new HttpPost(
SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_CASE_INSTANCE_VARIABLE_COLLECTION, caseInstance.getId()));
httpPost.setEntity(new StringEntity(objectMapper.createObjectNode().toString()));
closeResponse(executeRequest(httpPost, HttpStatus.SC_BAD_REQUEST));
}
/**
* Test creating a single case variable, testing default types when omitted. POST cmmn-runtime/case-instances/{caseInstanceId}/variables
*/
@CmmnDeployment(resources = { "org/flowable/cmmn/rest/service/api/repository/oneHumanTaskCase.cmmn" })
public void testCreateSingleProcessVariableDefaultTypes() throws Exception {
CaseInstance caseInstance = runtimeService.createCaseInstanceBuilder().caseDefinitionKey("oneHumanTaskCase").start();
// String type detection
ArrayNode requestNode = objectMapper.createArrayNode();
ObjectNode varNode = requestNode.addObject();
varNode.put("name", "stringVar");
varNode.put("value", "String value");
HttpPost httpPost = new HttpPost(
SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_CASE_INSTANCE_VARIABLE_COLLECTION, caseInstance.getId()));
httpPost.setEntity(new StringEntity(requestNode.toString()));
closeResponse(executeRequest(httpPost, HttpStatus.SC_CREATED));
assertThat(runtimeService.getVariable(caseInstance.getId(), "stringVar")).isEqualTo("String value");
// Integer type detection
varNode.put("name", "integerVar");
varNode.put("value", 123);
httpPost.setEntity(new StringEntity(requestNode.toString()));
closeResponse(executeRequest(httpPost, HttpStatus.SC_CREATED));
assertThat(runtimeService.getVariable(caseInstance.getId(), "integerVar")).isEqualTo(123);
// Double type detection
varNode.put("name", "doubleVar");
varNode.put("value", 123.456);
httpPost.setEntity(new StringEntity(requestNode.toString()));
closeResponse(executeRequest(httpPost, HttpStatus.SC_CREATED));
assertThat(runtimeService.getVariable(caseInstance.getId(), "doubleVar")).isEqualTo(123.456);
// Boolean type detection
varNode.put("name", "booleanVar");
varNode.put("value", Boolean.TRUE);
httpPost.setEntity(new StringEntity(requestNode.toString()));
closeResponse(executeRequest(httpPost, HttpStatus.SC_CREATED));
assertThat(runtimeService.getVariable(caseInstance.getId(), "booleanVar")).isEqualTo(Boolean.TRUE);
}
/**
* Test creating multiple case variables in a single call. POST cmmn-runtime/case-instance/{caseInstanceId}/variables
*/
@CmmnDeployment(resources = { "org/flowable/cmmn/rest/service/api/repository/oneHumanTaskCase.cmmn" })
public void testCreateMultipleProcessVariables() throws Exception {
CaseInstance caseInstance = runtimeService.createCaseInstanceBuilder().caseDefinitionKey("oneHumanTaskCase").start();
ArrayNode requestNode = objectMapper.createArrayNode();
// String variable
ObjectNode stringVarNode = requestNode.addObject();
stringVarNode.put("name", "stringVariable");
stringVarNode.put("value", "simple string value");
stringVarNode.put("type", "string");
// Integer
ObjectNode integerVarNode = requestNode.addObject();
integerVarNode.put("name", "integerVariable");
integerVarNode.put("value", 1234);
integerVarNode.put("type", "integer");
// Short
ObjectNode shortVarNode = requestNode.addObject();
shortVarNode.put("name", "shortVariable");
shortVarNode.put("value", 123);
shortVarNode.put("type", "short");
// Long
ObjectNode longVarNode = requestNode.addObject();
longVarNode.put("name", "longVariable");
longVarNode.put("value", 4567890L);
longVarNode.put("type", "long");
// Double
ObjectNode doubleVarNode = requestNode.addObject();
doubleVarNode.put("name", "doubleVariable");
doubleVarNode.put("value", 123.456);
doubleVarNode.put("type", "double");
// Boolean
ObjectNode booleanVarNode = requestNode.addObject();
booleanVarNode.put("name", "booleanVariable");
booleanVarNode.put("value", Boolean.TRUE);
booleanVarNode.put("type", "boolean");
// Date
Calendar varCal = Calendar.getInstance();
String isoString = getISODateString(varCal.getTime());
ObjectNode dateVarNode = requestNode.addObject();
dateVarNode.put("name", "dateVariable");
dateVarNode.put("value", isoString);
dateVarNode.put("type", "date");
// Create local variables with a single request
HttpPost httpPost = new HttpPost(
SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_CASE_INSTANCE_VARIABLE_COLLECTION, caseInstance.getId()));
httpPost.setEntity(new StringEntity(requestNode.toString()));
CloseableHttpResponse response = executeRequest(httpPost, HttpStatus.SC_CREATED);
JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
closeResponse(response);
assertThat(responseNode).isNotNull();
assertThat(responseNode.isArray()).isTrue();
assertThat(responseNode).hasSize(7);
// Check if engine has correct variables set
Map<String, Object> variables = runtimeService.getVariables(caseInstance.getId());
assertThat(variables)
.containsOnly(
entry("stringVariable", "simple string value"),
entry("integerVariable", 1234),
entry("shortVariable", (short) 123),
entry("longVariable", 4567890L),
entry("doubleVariable", 123.456),
entry("booleanVariable", Boolean.TRUE),
entry("dateVariable", longDateFormat.parse(isoString))
);
}
/**
* Test creating multiple case variables in a single call. POST cmmn-runtime/case-instance/{caseInstanceId}/variables?override=true
*/
@CmmnDeployment(resources = { "org/flowable/cmmn/rest/service/api/repository/oneHumanTaskCase.cmmn" })
public void testCreateMultipleCaseVariablesWithOverride() throws Exception {
CaseInstance caseInstance = runtimeService.createCaseInstanceBuilder().caseDefinitionKey("oneHumanTaskCase").start();
runtimeService.setVariable(caseInstance.getId(), "stringVariable", "initialValue");
ArrayNode requestNode = objectMapper.createArrayNode();
// String variable
ObjectNode stringVarNode = requestNode.addObject();
stringVarNode.put("name", "stringVariable");
stringVarNode.put("value", "simple string value");
stringVarNode.put("type", "string");
ObjectNode anotherVariable = requestNode.addObject();
anotherVariable.put("name", "stringVariable2");
anotherVariable.put("value", "another string value");
anotherVariable.put("type", "string");
// Create local variables with a single request
HttpPut httpPut = new HttpPut(
SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_CASE_INSTANCE_VARIABLE_COLLECTION, caseInstance.getId()));
httpPut.setEntity(new StringEntity(requestNode.toString()));
CloseableHttpResponse response = executeRequest(httpPut, HttpStatus.SC_CREATED);
JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
closeResponse(response);
assertThat(responseNode).isNotNull();
assertThat(responseNode.isArray()).isTrue();
assertThat(responseNode).hasSize(2);
// Check if engine has correct variables set
Map<String, Object> variables = runtimeService.getVariables(caseInstance.getId());
assertThat(variables)
.containsOnly(
entry("stringVariable", "simple string value"),
entry("stringVariable2", "another string value")
);
}
/**
* Test deleting all case variables. DELETE cmmn-runtime/case-instance/{caseInstanceId}/variables
*/
@CmmnDeployment(resources = { "org/flowable/cmmn/rest/service/api/repository/oneHumanTaskCase.cmmn" })
public void testDeleteAllCasesVariables() throws Exception {
Map<String, Object> caseVariables = new HashMap<>();
caseVariables.put("var1", "This is a CaseVariable");
caseVariables.put("var2", 123);
CaseInstance caseInstance = runtimeService.createCaseInstanceBuilder().caseDefinitionKey("oneHumanTaskCase").variables(caseVariables).start();
HttpDelete httpDelete = new HttpDelete(
SERVER_URL_PREFIX + CmmnRestUrls.createRelativeResourceUrl(CmmnRestUrls.URL_CASE_INSTANCE_VARIABLE_COLLECTION, caseInstance.getId()));
closeResponse(executeRequest(httpDelete, HttpStatus.SC_NO_CONTENT));
// Check if local variables are gone and global remain unchanged
assertThat(runtimeService.getVariables(caseInstance.getId())).isEmpty();
}
}
|
dbmalkovsky/flowable-engine
|
modules/flowable-cmmn-rest/src/test/java/org/flowable/cmmn/rest/service/api/runtime/CaseInstanceVariablesCollectionResourceTest.java
|
Java
|
apache-2.0
| 22,479 |
#------------------------------------------------------------------------------
# File: ja.pm
#
# Description: ExifTool Japanese language translations
#
# Notes: This file generated automatically by Image::ExifTool::TagInfoXML
#------------------------------------------------------------------------------
package Image::ExifTool::Lang::ja;
use strict;
use vars qw($VERSION);
$VERSION = '1.19';
%Image::ExifTool::Lang::ja::Translate = (
'AEAperture' => 'AE絞り',
'AEBAutoCancel' => {
Description => 'ブラケティング自動解除',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'AEBBracketValue' => 'AEBブラケット値',
'AEBSequence' => 'ブラケティング順序',
'AEBSequenceAutoCancel' => {
Description => 'ブラケティング順序/自動解除',
PrintConv => {
'-,0,+/Disabled' => '-→0 →+/しない',
'-,0,+/Enabled' => '-→0 →+/する',
'0,-,+/Disabled' => '0 →-→+/しない',
'0,-,+/Enabled' => '0 →-→+/する',
},
},
'AEBShotCount' => 'ブラケティング時の撮影枚数',
'AEBXv' => 'AEブラケット 露出補正',
'AEExposureTime' => 'AE露出時間',
'AEExtra' => 'AE特別?',
'AEInfo' => '自動露出情報',
'AELock' => {
Description => 'AEロック',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'AELockButton' => {
Description => 'AE-L/AF-L',
PrintConv => {
'AE-L/AF Area' => 'AE-L/AFエリア',
'AE-L/AF-L/AF Area' => 'AE-L/AF-L/AFエリア',
'AF-L/AF Area' => 'AF-L/AFエリア',
'AF-ON/AF Area' => 'AFオン/AFエリア',
'FV Lock' => 'FVロック',
'Focus Area Selection' => 'フォーカスエリア選択',
},
},
'AEMaxAperture' => 'AE最大絞り',
'AEMaxAperture2' => 'AE最大絞り(2)',
'AEMeteringMode' => {
Description => 'AE測光モード',
PrintConv => {
'Multi-segment' => 'パターン',
},
},
'AEMeteringSegments' => '自動露出測光値',
'AEMinAperture' => 'AE最小絞り',
'AEMinExposureTime' => 'AE最小露出時間',
'AEProgramMode' => {
Description => 'AEプログラムモード',
PrintConv => {
'Av, B or X' => 'Av, BかX',
'Candlelight' => 'キャンドルライト',
'DOF Program' => '深度優先プログラム',
'DOF Program (P-Shift)' => '深度優先プログラム(Pシフト)',
'Hi-speed Program' => '高速優先プログラム',
'Hi-speed Program (P-Shift)' => '高速優先プログラム(Pシフト)',
'Kids' => 'キッズ',
'Landscape' => '風景',
'M, P or TAv' => 'M, PかTAv',
'MTF Program' => 'MTF優先プログラム',
'MTF Program (P-Shift)' => 'MTF優先プログラム(Pシフト)',
'Macro' => 'マクロ',
'Museum' => 'ミュージアム',
'Night Scene' => '夜景',
'Night Scene Portrait' => '人物、夜景',
'No Flash' => 'フラッシュ無し',
'Pet' => 'ペット',
'Portrait' => 'ポートレート',
'Sport' => 'スポーツ',
'Standard' => 'スタンダード',
'Sunset' => '夕日',
'Surf & Snow' => 'サーフ&スノー',
'Sv or Green Mode' => 'Svかグリーンモード',
'Text' => 'テキスト',
},
},
'AESetting' => {
Description => '自動露出設定',
PrintConv => {
'Exposure Compensation' => '露出補正',
},
},
'AEXv' => 'AE 露出補正',
'AE_ISO' => 'AE ISO感度',
'AF-CPrioritySelection' => {
Description => 'AF-Cプライオリティー選択',
PrintConv => {
'Focus' => 'フォーカス',
'Release' => 'レリーズ',
'Release + Focus' => 'レリーズ+フォーカス',
},
},
'AF-OnForMB-D10' => {
Description => 'MB-D10用AFオン',
PrintConv => {
'AE Lock (hold)' => 'AEロック(ホールド)',
'AE Lock (reset on release)' => 'AEロック(レリーズ時リセット)',
'AE Lock Only' => 'AEロックのみ',
'AE/AF Lock' => 'AE/AFロック',
'AF Lock Only' => 'AFロックのみ',
'AF-On' => 'AFオン',
'Same as FUNC Button' => 'ファンクションボタンと同一',
},
},
'AF-SPrioritySelection' => {
Description => 'AF-Sプライオリティー選択',
PrintConv => {
'Focus' => 'フォーカス',
'Release' => 'レリーズ',
},
},
'AFActivation' => {
Description => 'AFアクティベーション',
PrintConv => {
'AF-On Only' => 'AFオンのみ',
'Shutter/AF-On' => 'シャッター/AFオン',
},
},
'AFAdjustment' => 'AF微調整',
'AFArea' => 'AFエリア',
'AFAreaHeight' => 'AFエリア高さ',
'AFAreaHeights' => 'AFエリア高さ',
'AFAreaIllumination' => {
Description => 'AFエリアイルミネーション',
PrintConv => {
'Auto' => 'オート',
'Off' => 'オフ',
'On' => 'オン',
},
},
'AFAreaMode' => {
Description => 'AFエリアモード',
PrintConv => {
'1-area' => '1点',
'1-area (high speed)' => '高速1点',
'3-area (center)?' => '3点中央?',
'3-area (left)?' => '3点左?',
'3-area (right)?' => '3点右?',
'5-area' => '5点',
'Auto-area' => '自動エリアAF',
'Dynamic Area' => 'ダイナミックエリア',
'Dynamic Area (closest subject)' => 'ダイナミック(重点主題)',
'Dynamic Area (wide)' => 'ダイナミック(ワイド)',
'Face Detect AF' => '顔優先',
'Group Dynamic' => 'グループダイナミック',
'Normal?' => 'ノーマル?',
'Single Area' => 'シングルポイント',
'Single Area (wide)' => 'シングルポイント(ワイド)',
'Spot Focusing' => 'スポットフォーカス',
'Spot Mode On' => 'スポットモードオン',
},
},
'AFAreaModeSetting' => {
Description => 'AFエリアモード',
PrintConv => {
'Closest Subject' => 'オートエリア',
'Dynamic Area' => 'ダイナミックエリア',
'Single Area' => 'シングルポイント',
},
},
'AFAreaWidth' => 'AFエリア幅',
'AFAreaWidths' => 'AFエリア幅',
'AFAreas' => 'AFエリア',
'AFAssist' => {
Description => 'AFアシスト',
PrintConv => {
'Does not emit/Fires' => 'しない/する',
'Emits/Does not fire' => 'する/しない',
'Emits/Fires' => 'する/する',
'Off' => 'オフ',
'On' => 'オン',
'Only ext. flash emits/Fires' => '外部ストロボのみする/する',
},
},
'AFAssistBeam' => {
Description => 'AF補助光の投光',
PrintConv => {
'Does not emit' => 'しない',
'Emits' => 'する',
'Only ext. flash emits' => '外部ストロボのみする',
},
},
'AFDefocus' => 'AFぼけ量',
'AFDuringLiveView' => {
Description => 'ライブビュー撮影中のAF',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
'Live mode' => 'ライブモード',
'Quick mode' => 'クイックモード',
},
},
'AFFineTune' => 'AFファインチューン',
'AFFineTuneAdj' => 'AFファインチューン',
'AFImageHeight' => 'AF画像高さ',
'AFImageWidth' => 'AF画像幅',
'AFInfo' => 'AFモード',
'AFInfo2' => 'AF情報',
'AFInfo2Version' => 'AF情報バージョン',
'AFIntegrationTime' => 'AF集積時間',
'AFMicroadjustment' => {
Description => 'AFマイクロアジャストメント',
PrintConv => {
'Adjust all by same amount' => '全レンズ一律調整',
'Adjust by lens' => 'レンズごとに調整',
'Disable' => 'しない',
},
},
'AFMode' => 'AFモード',
'AFOnAELockButtonSwitch' => {
Description => 'AF-ON/AEロックボタン入替',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
},
},
'AFPoint' => {
Description => 'AF選択ポイント',
PrintConv => {
'Auto AF point selection' => 'オートAFポイント選択',
'Bottom' => '下',
'Center' => '中央',
'Face Detect' => '顔認識',
'Left' => '左',
'Manual AF point selection' => 'マニュアルAFポイント選択',
'Mid-left' => '中央左',
'Mid-right' => '中央右',
'None' => '無し',
'None (MF)' => '無し(MF)',
'Right' => '右',
'Top' => '上',
},
},
'AFPointActivationArea' => {
Description => 'AFフレームの領域拡大',
PrintConv => {
'Standard' => 'スタンダード',
},
},
'AFPointAreaExpansion' => {
Description => '任意選択時のAFフレーム領域拡大',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
'Left/right AF points' => 'する(左右1領域アシスト有効)',
'Surrounding AF points' => 'する(周囲1領域アシスト有効)',
},
},
'AFPointAutoSelection' => {
Description => 'AFフレーム自動選択の選択可否',
PrintConv => {
'Control-direct:disable/Main:disable' => 'サブ電子ダイヤル直接:不可/メイン電子ダイヤル→不可',
'Control-direct:disable/Main:enable' => 'サブ電子ダイヤル直接:不可/メイン電子ダイヤル→可',
'Control-direct:enable/Main:enable' => 'サブ電子ダイヤル直接:可/メイン電子ダイヤル→可',
},
},
'AFPointBrightness' => {
Description => 'AFフレーム点灯輝度',
PrintConv => {
'Brighter' => '明るい',
'Normal' => '標準',
},
},
'AFPointDisplayDuringFocus' => {
Description => '測距時のAFフレーム表示',
PrintConv => {
'Off' => 'しない',
'On' => 'する',
'On (when focus achieved)' => 'する(合焦時)',
},
},
'AFPointIllumination' => {
Description => 'AFポイントイルミネーション',
PrintConv => {
'Auto' => 'オート',
'Off' => 'オフ',
'On' => 'オン',
},
},
'AFPointMode' => {
Description => 'AF測距点モード',
PrintConv => {
'Auto' => 'オート',
},
},
'AFPointRegistration' => {
Description => 'AFフレームの登録',
PrintConv => {
'Automatic' => 'オート',
'Bottom' => '下',
'Center' => '中央',
'Extreme Left' => '左端',
'Extreme Right' => '右端',
'Left' => '左',
'Right' => '右',
'Top' => '上',
},
},
'AFPointSelected' => {
Description => 'AF測距点',
PrintConv => {
'Auto' => 'オート',
'Automatic Tracking AF' => '自動追尾',
'Bottom' => '下',
'Center' => '中央',
'Face Detect AF' => '顔認識',
'Fixed Center' => '中央固定',
'Left' => '左',
'Lower-left' => '左下',
'Lower-right' => '右下',
'Mid-left' => '中央左',
'Mid-right' => '中央右',
'Right' => '右',
'Top' => '上',
'Upper-left' => '左上',
'Upper-right' => '右上',
},
},
'AFPointSelected2' => {
Description => 'AF測距点選択2',
PrintConv => {
'Auto' => 'オート',
},
},
'AFPointSelection' => {
Description => 'AFポイント選択',
PrintConv => {
'11 Points' => '11点',
'51 Points' => '51点(3Dトラッキング)',
},
},
'AFPointSelectionMethod' => {
Description => 'AFフレーム選択方法',
PrintConv => {
'Multi-controller direct' => 'マルチコントローラーダイレクト',
'Normal' => '標準',
'Quick Control Dial direct' => 'サブ電子ダイヤルダイレクト',
},
},
'AFPointSpotMetering' => 'AFフレーム数/スポット測光',
'AFPoints' => 'AFポイント',
'AFPointsInFocus' => {
Description => 'AF測距点',
PrintConv => {
'All' => '全て',
'Bottom' => '下',
'Bottom, Center' => '下+中央',
'Bottom-center' => '中央下',
'Bottom-left' => '左下',
'Bottom-right' => '右下',
'Center' => '中央',
'Center (horizontal)' => '中央(水平)',
'Center (vertical)' => '中央(水平)',
'Center+Right' => '中央+右',
'Fixed Center or Multiple' => '中央固定または複数',
'Left' => '左',
'Left+Center' => '左+中央',
'Left+Right' => '左+右',
'Lower-left, Bottom' => '左下+下',
'Lower-left, Mid-left' => '左下+中央左',
'Lower-right, Bottom' => '右下+下',
'Lower-right, Mid-right' => '右下+中央右',
'Mid-left' => '中央左',
'Mid-left, Center' => '中央左+中央',
'Mid-right' => '中央右',
'Mid-right, Center' => '中央右+中央',
'None' => '無し',
'None (MF)' => '無し(MF)',
'Right' => '右',
'Top' => '上',
'Top, Center' => '上+中央',
'Top-center' => '中央上',
'Top-left' => '左上',
'Top-right' => '右上',
'Upper-left, Mid-left' => '左上+中央左',
'Upper-left, Top' => '左上+上',
'Upper-right, Mid-right' => '右上+中央右',
'Upper-right, Top' => '右上+上',
},
},
'AFPointsInFocus1D' => 'AF測距点(1D)',
'AFPointsInFocus5D' => 'AF測距点',
'AFPointsSelected' => 'AFポイント選択',
'AFPointsUnknown2' => {
Description => 'AF測距点 未確認2?',
PrintConv => {
'Auto' => 'オート',
},
},
'AFPointsUsed' => {
Description => 'AF測距点',
PrintConv => {
'Bottom' => '下',
'Center' => '中央',
'Mid-left' => '中央左',
'Mid-right' => '中央右',
'Top' => '上',
},
},
'AFPredictor' => 'AF予測',
'AFResponse' => 'AFレスポンス',
'AFResult' => 'AF結果',
'AFSearch' => {
Description => 'AFサーチ',
PrintConv => {
'Not Ready' => '準備ができていない',
'Ready' => '準備完了',
},
},
'AIServoContinuousShooting' => 'AI SERVO 連続撮影・撮影速度優先',
'AIServoImagePriority' => {
Description => 'AIサーボ1コマ目/2コマ目以降動作',
PrintConv => {
'1: AF, 2: Drive speed' => 'ピント優先/撮影速度優先',
'1: AF, 2: Tracking' => 'ピント優先/被写体追従優先',
'1: Release, 2: Drive speed' => 'レリーズ優先/撮影速度最優先',
},
},
'AIServoTrackingMethod' => {
Description => 'AIサーボ時の測距点選択特性',
PrintConv => {
'Continuous AF track priority' => '測距連続性優先',
'Main focus point priority' => '測距中心優先',
},
},
'AIServoTrackingSensitivity' => {
Description => 'AIサーボ時の被写体追従敏感度',
PrintConv => {
'Fast' => '速い',
'Slow' => '遅い',
'Standard' => 'スタンダード',
},
},
'APEVersion' => 'APEバージョン',
'ARMIdentifier' => 'ARM識別子',
'ARMVersion' => 'ARMバージョン',
'AToB0' => 'AからB0',
'AToB1' => 'AからB1',
'AToB2' => 'AからB2',
'AccessoryType' => 'アクセサリータイプ',
'ActionAdvised' => '動作推奨',
'ActiveArea' => 'アクティブ領域',
'ActiveD-Lighting' => {
Description => 'アクティブDライティング',
PrintConv => {
'High' => '高い',
'Low' => 'ソフト',
'Normal' => '標準',
'Off' => 'オフ',
'On' => 'オン',
},
},
'ActiveD-LightingMode' => {
PrintConv => {
'High' => '高い',
'Low' => 'ソフト',
'Normal' => '標準',
'Off' => 'オフ',
},
},
'AddAspectRatioInfo' => {
Description => 'アスペクト比情報の付加',
PrintConv => {
'Off' => 'オフ',
},
},
'AddOriginalDecisionData' => {
Description => 'オリジナル画像判定用データの付加',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'AdjustmentMode' => '調整モード',
'AdultContentWarning' => {
PrintConv => {
'Unknown' => '不明',
},
},
'AdvancedRaw' => {
Description => 'アドバンスRAW',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'AdvancedSceneMode' => {
PrintConv => {
'Auto' => 'インテリジェントオート',
},
},
'Album' => 'アルバム',
'AlphaByteCount' => 'アルファバイト数',
'AlphaDataDiscard' => {
Description => 'アルファデータ破棄',
PrintConv => {
'Flexbits Discarded' => 'フレックスビット破棄',
'Full Resolution' => '完全な解像度',
'HighPass Frequency Data Discarded' => 'ハイパス周波数データ破棄',
'Highpass and LowPass Frequency Data Discarded' => 'ハイパスとローパス周波数データ破棄',
},
},
'AlphaOffset' => 'アルファオフセット',
'AnalogBalance' => 'アナログバランス',
'Annotations' => 'フォトショップ注釈',
'Anti-Blur' => {
PrintConv => {
'Off' => 'オフ',
'On (Continuous)' => 'オン(連写)',
'On (Shooting)' => 'オン(撮影)',
'n/a' => '該当無し',
},
},
'AntiAliasStrength' => 'カメラのアンチエイリアスフィルタの相対的な強度',
'Aperture' => '絞り',
'ApertureRange' => {
Description => '絞り数値の制御範囲の設定',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
},
},
'ApertureRingUse' => {
Description => '絞りリングの使用',
PrintConv => {
'Permitted' => '許可',
'Prohibited' => '禁止',
},
},
'ApertureValue' => '絞り',
'ApplicationRecordVersion' => 'アプリケーションレコードバージョン',
'ApplyShootingMeteringMode' => {
Description => '撮影・測光モードの呼出',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
},
},
'Artist' => '画像作成者',
'AsShotICCProfile' => '撮影時ICCプロファイル',
'AsShotNeutral' => 'ニュートラルショット',
'AsShotPreProfileMatrix' => '撮影時プロファイルマトリックス',
'AsShotProfileName' => '撮影時プロフィール名',
'AsShotWhiteXY' => 'ホワイトX-Yショット',
'AssignFuncButton' => {
Description => 'FUNC.ボタンの機能',
PrintConv => {
'Exposure comp./AEB setting' => '露出補正/AEB設定',
'Image jump with main dial' => 'メイン電子ダイヤル での画像送り',
'Image quality' => '記録画質選択',
'LCD brightness' => '液晶の明るさ',
'Live view function settings' => 'ライブビュー機能設定',
},
},
'AssistButtonFunction' => {
Description => 'アシストボタンの機能',
PrintConv => {
'Av+/- (AF point by QCD)' => 'Av±(サブ電子:AFフレーム選択)',
'FE lock' => 'FEロック',
'Normal' => '標準',
'Select HP (while pressing)' => 'HPに移動(押している間)',
'Select Home Position' => 'HPに移動',
},
},
'Audio' => {
Description => '音声',
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'AudioDuration' => 'オーディオ時間',
'AudioOutcue' => 'オーディオ終了合図',
'AudioSamplingRate' => 'オーディオサンプリングレート',
'AudioSamplingResolution' => 'オーディオサンプリング解像度',
'AudioType' => 'オーディオタイプ',
'Author' => '作者',
'AuthorsPosition' => '役職名',
'AutoAperture' => {
Description => '自動絞り',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'AutoBracket' => 'オートブラケット',
'AutoBracketModeM' => {
Description => 'オートブラケット(モードM)',
PrintConv => {
'Flash Only' => 'フラッシュのみ',
'Flash/Aperture' => 'フラッシュ/絞り',
'Flash/Speed' => 'フラッシュ/シャッター速度',
'Flash/Speed/Aperture' => 'フラッシュ/シャッター速度/絞り',
},
},
'AutoBracketOrder' => 'ブラケット順',
'AutoBracketSet' => {
Description => 'オートブラケット設定',
PrintConv => {
'AE & Flash' => '自動露出&フラッシュ',
'AE Only' => '自動露出のみ',
'Flash Only' => 'フラッシュのみ',
'WB Bracketing' => 'ホワイトバランスブラケット',
},
},
'AutoBracketing' => {
Description => 'オートブラケット',
PrintConv => {
'No flash & flash' => 'フラッシュ無し&フラッシュ有り',
'Off' => 'オフ',
'On' => 'オン',
},
},
'AutoExposureBracketing' => {
Description => 'フラッシュバイアス',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
'On (shot 1)' => 'オン(ショット1)',
'On (shot 2)' => 'オン(ショット2)',
'On (shot 3)' => 'オン(ショット3)',
},
},
'AutoFP' => {
Description => 'オートFP',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'AutoFocus' => {
Description => 'オートフォーカス',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'AutoISO' => {
Description => 'ISOオート',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'AutoISOMax' => 'ISOオート 最大感度',
'AutoISOMinShutterSpeed' => 'ISOオート 最小シャッター速度',
'AutoLightingOptimizer' => {
Description => 'オートライティングオプティマイザ',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
'Low' => 'ソフト',
'Off' => 'オフ',
'Standard' => 'スタンダード',
'Strong' => '強',
'n/a' => '該当無し',
},
},
'AutoLightingOptimizerOn' => {
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'AutoRedEye' => {
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'AutoRotate' => {
Description => '自動回転',
PrintConv => {
'None' => '無し',
'Rotate 180' => '180度回転',
'Rotate 270 CW' => '270度回転 CW',
'Rotate 90 CW' => '90度回転 CW',
'n/a' => 'ソフトウェアで回転',
},
},
'AuxiliaryLens' => '補助レンズ',
'AvApertureSetting' => 'Av絞り設定',
'AvSettingWithoutLens' => {
Description => 'レンズ未装着時の絞り数値設定',
PrintConv => {
'Disable' => '不可',
'Enable' => '可',
},
},
'BToA0' => 'BからA0',
'BToA1' => 'BからA1',
'BToA2' => 'BからA2',
'BWFilter' => '白黒フィルター',
'BWMode' => {
Description => '白黒モード',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'BabyAge' => '赤ちゃん/ペットの年齢',
'BackgroundColorIndicator' => '背景色指標',
'BackgroundColorValue' => '背景色値',
'BackgroundTiling' => {
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'BadFaxLines' => '粗悪なFAX線',
'BannerImageType' => {
PrintConv => {
'None' => '無し',
},
},
'BaseExposureCompensation' => '基本露出補正',
'BaseISO' => 'ベース感度',
'BaselineExposure' => 'ベースライン露出',
'BaselineNoise' => 'ベースラインノイズ',
'BaselineSharpness' => 'ベースラインシャープネス',
'BatteryInfo' => '電源',
'BatteryLevel' => 'バッテリーレベル',
'BatteryOrder' => {
Description => 'バッテリー順',
PrintConv => {
'Camera Battery First' => 'カメラのバッテリーを最初に使う',
'MB-D10 First' => 'MB-D10のバッテリーを最初に使う',
},
},
'BayerGreenSplit' => 'ベイヤーグリーン分割',
'Beep' => {
Description => 'ビープ',
PrintConv => {
'High' => '高い',
'Low' => '低い',
'Off' => 'オフ',
'On' => 'オン',
},
},
'BestQualityScale' => '高品質スケール',
'BestShotMode' => {
Description => 'ベストショットモード',
PrintConv => {
'Off' => 'オフ',
},
},
'BitDepth' => 'ビット深度',
'BitsPerComponent' => 'コンポーネントあたりビット',
'BitsPerExtendedRunLength' => '拡張ランレングスあたりのビット',
'BitsPerRunLength' => 'ランレングスあたりのビット',
'BitsPerSample' => 'コンポーネントのビット数',
'BlackLevel' => '黒レベル',
'BlackLevel2' => '黒レベル2',
'BlackLevelDeltaH' => '黒レベルデルタH',
'BlackLevelDeltaV' => '黒レベルデルタV',
'BlackLevelRepeatDim' => '黒レベル反復値',
'BlackPoint' => '黒点',
'BlueBalance' => 'ブルーバランス',
'BlueMatrixColumn' => '青色マトリックス列',
'BlueTRC' => '青色調増殖曲線',
'BlurWarning' => {
Description => '手振れ警告',
PrintConv => {
'Blur Warning' => '手振れ警告',
'None' => '無し',
},
},
'BodyBatteryADLoad' => '電源A/D本体起動時',
'BodyBatteryADNoLoad' => '電源A/D本体オフ時',
'BodyBatteryState' => '電源状態本体',
'BodyFirmwareVersion' => '本体ファームウェアバージョン',
'BracketMode' => {
Description => 'ブラケットモード',
PrintConv => {
'Off' => 'オフ',
},
},
'BracketSequence' => 'ブラケットシーケンス',
'BracketShotNumber' => {
Description => 'ブラケットショット数',
PrintConv => {
'n/a' => '該当無し',
},
},
'BracketStep' => {
Description => 'ブラケットステップ',
PrintConv => {
'1 EV' => '1ステップ',
'1/3 EV' => '1/3ステップ',
'2/3 EV' => '2/3ステップ',
},
},
'BracketValue' => 'ブラケット値',
'Brightness' => 'ブライトネス',
'BrightnessData' => 'ブライトネスデータ',
'BrightnessValue' => 'ブライトネス',
'BulbDuration' => 'バルブ時間',
'BurstMode' => {
Description => 'ブラストモード',
PrintConv => {
'Infinite' => '無限',
'Off' => 'オフ',
'On' => 'オン',
},
},
'ButtonFunctionControlOff' => {
Description => 'サブ電子ダイヤル〈OFF〉時のボタン操作',
PrintConv => {
'Disable main, Control, Multi-control' => 'メイン電子ダイヤル、サブ電子ダイヤル、マルチコントローラーは無効',
'Normal (enable)' => '通常(有効)',
},
},
'By-line' => '製作者',
'By-lineTitle' => '製作者の職種',
'CCDScanMode' => {
Description => 'CCDスキャンモード',
PrintConv => {
'Interlaced' => 'インタレース',
'Progressive' => 'プログレッシブ',
},
},
'CFALayout' => 'CFAレイアウト',
'CFAPattern' => 'CFAパターン',
'CFAPattern2' => 'CFAパターン2',
'CFAPlaneColor' => 'CFAプレーン色',
'CFARepeatPatternDim' => 'CFA反復パターン特性',
'CLModeShootingSpeed' => 'CLモード撮影速度',
'CMContrast' => 'CMコントラスト',
'CMExposureCompensation' => 'CM露出補正',
'CMHue' => 'CM色相',
'CMMFlags' => 'CMMフラグ',
'CMSaturation' => 'CM彩度',
'CMSharpness' => 'CMシャープネス',
'CMWhiteBalance' => 'CMホワイトバランス',
'CMWhiteBalanceComp' => 'CMホワイトバランス補正',
'CMWhiteBalanceGrayPoint' => 'CMホワイトバランスグレーポイント',
'CMYKEquivalent' => 'CMYK等価物',
'CPUFirmwareVersion' => 'CPUファームウエアバージョン',
'CPUType' => {
PrintConv => {
'None' => '無し',
},
},
'CalibrationDateTime' => 'キャリブレーション日時',
'CalibrationIlluminant1' => {
Description => '光源キャリブレーション1',
PrintConv => {
'Cloudy' => '曇り',
'Cool White Fluorescent' => '白色蛍光灯',
'Day White Fluorescent' => '昼白色蛍光灯',
'Daylight' => '昼光',
'Daylight Fluorescent' => '昼光色蛍光灯',
'Fine Weather' => '良い天気',
'Flash' => 'ストロボ',
'Fluorescent' => '蛍光灯',
'ISO Studio Tungsten' => 'ISOスタジオタングステン',
'Other' => 'その他の光源',
'Shade' => '日陰',
'Standard Light A' => '標準ライトA',
'Standard Light B' => '標準ライトB',
'Standard Light C' => '標準ライトC',
'Tungsten (Incandescent)' => 'タングステン(白熱灯)',
'Unknown' => '不明',
'Warm White Fluorescent' => '暖白光色蛍光灯',
'White Fluorescent' => '温白色蛍光灯',
},
},
'CalibrationIlluminant2' => {
Description => '光源キャリブレーション2',
PrintConv => {
'Cloudy' => '曇り',
'Cool White Fluorescent' => '白色蛍光灯',
'Day White Fluorescent' => '昼白色蛍光灯',
'Daylight' => '昼光',
'Daylight Fluorescent' => '昼光色蛍光灯',
'Fine Weather' => '良い天気',
'Flash' => 'ストロボ',
'Fluorescent' => '蛍光灯',
'ISO Studio Tungsten' => 'ISOスタジオタングステン',
'Other' => 'その他の光源',
'Shade' => '日陰',
'Standard Light A' => '標準ライトA',
'Standard Light B' => '標準ライトB',
'Standard Light C' => '標準ライトC',
'Tungsten (Incandescent)' => 'タングステン(白熱灯)',
'Unknown' => '不明',
'Warm White Fluorescent' => '暖白光色蛍光灯',
'White Fluorescent' => '温白色蛍光灯',
},
},
'CameraCalibration1' => 'カメラキャリブレーション1',
'CameraCalibration2' => 'カメラキャリブレーション2',
'CameraCalibrationSig' => 'カメラキャリブレーションサイン',
'CameraID' => 'カメラID',
'CameraISO' => 'カメラISO',
'CameraInfo' => 'ペンタックスモデル',
'CameraOrientation' => {
Description => '画像の向き',
PrintConv => {
'Horizontal (normal)' => '水平(標準)',
'Rotate 270 CW' => '270度回転 CW',
'Rotate 90 CW' => '90度回転 CW',
},
},
'CameraParameters' => 'カメラパラメーター',
'CameraSerialNumber' => 'カメラシリアル番号',
'CameraSettings' => 'カメラ設定',
'CameraSettingsVersion' => 'カメラ設定バージョン',
'CameraTemperature' => 'カメラ温度',
'CameraType' => {
Description => 'カメラタイプ',
PrintConv => {
'Compact' => 'コンパクト',
'DV Camera' => 'DVカメラ',
'EOS High-end' => 'EOSハイエンド',
'EOS Mid-range' => 'EOSミドルレンジ',
},
},
'CameraType2' => 'カメラタイプ2',
'CanonAFInfo' => 'AF情報',
'CanonAFInfo2' => 'AF情報2',
'CanonExposureMode' => {
Description => '露出モード',
PrintConv => {
'Aperture-priority AE' => '絞り優先',
'Bulb' => 'バルブ',
'Depth-of-field AE' => '被写界深度AE',
'Easy' => '簡単',
'Manual' => 'マニュアル',
'Program AE' => 'プログラムAE',
'Shutter speed priority AE' => 'シャッター優先',
},
},
'CanonFileInfo' => 'ファイル情報',
'CanonFileLength' => 'ファイル長',
'CanonFirmwareVersion' => 'ファームウェアバージョン',
'CanonFlashMode' => {
Description => 'フラッシュモード',
PrintConv => {
'Auto' => 'オート',
'External flash' => '外付フラッシュ',
'Off' => 'オフ',
'On' => 'オン',
'Red-eye reduction' => '赤目軽減',
'Red-eye reduction (Auto)' => '赤目軽減(オート)',
'Red-eye reduction (On)' => '赤目軽減(オン)',
'Slow-sync' => 'スローシンクロ',
},
},
'CanonFocalLength' => 'フォーカスタイプ',
'CanonImageHeight' => '画像高さ',
'CanonImageSize' => {
Description => 'イメージサイズ',
PrintConv => {
'Large' => 'ラージ',
'Medium' => 'ミドル',
'Medium 1' => 'ミドル1',
'Medium 2' => 'ミドル2',
'Medium 3' => 'ミドル3',
'Medium Movie' => 'ミディアム動画',
'Postcard' => 'ハガキ',
'Small' => 'スモール',
'Small 1' => 'スモール1',
'Small 2' => 'スモール2',
'Small 3' => 'スモール3',
'Small Movie' => 'スモール動画',
'Widescreen' => 'ワイド画面',
},
},
'CanonImageType' => 'イメージタイプ',
'CanonImageWidth' => '画像幅',
'CanonModelID' => 'モデルID',
'Caption-Abstract' => '表題/説明',
'CaptionWriter' => 'キャプション作成者',
'CasioImageSize' => 'カシオイメージサイズ',
'Categories' => 'カテゴリー',
'Category' => 'カテゴリー',
'CellLength' => 'セル長',
'CellWidth' => 'セル幅',
'CenterAFArea' => {
Description => '中央AFエリア',
PrintConv => {
'Normal Zone' => 'ノーマルゾーン',
'Wide Zone' => 'ワイドゾーン',
},
},
'CenterWeightedAreaSize' => {
Description => '中央重点エリア',
PrintConv => {
'Average' => '平均',
},
},
'CharTarget' => '目的文字',
'CharacterSet' => 'キャラクターセット',
'ChromaBlurRadius' => '彩度ぼけ半径',
'ChromaticAdaptation' => '色彩順応化',
'Chromaticity' => '色度',
'ChrominanceNR_TIFF_JPEG' => {
PrintConv => {
'High' => '高い',
'Low' => 'ソフト',
'Off' => 'オフ',
},
},
'ChrominanceNoiseReduction' => {
PrintConv => {
'High' => '高い',
'Low' => 'ソフト',
'Off' => 'オフ',
},
},
'City' => '都市',
'ClassifyState' => '分類状態',
'CleanFaxData' => '純粋なFAXデータ',
'ClipPath' => 'クリップパス',
'CodedCharacterSet' => 'キャラクタセットコード',
'ColorAberrationControl' => {
Description => '色収差コントロール',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ColorAdjustment' => '色調整',
'ColorAdjustmentMode' => {
Description => '色調整モード',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ColorBalance' => 'カラーバランス',
'ColorBalanceAdj' => {
Description => 'カラーバランス調整',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ColorBalanceBlue' => 'カラーバランス青',
'ColorBalanceGreen' => 'カラーバランス緑',
'ColorBalanceRed' => 'カラーバランス赤',
'ColorBoostData' => 'カラーブーストデータ',
'ColorBoostLevel' => 'カラーブーストレベル1',
'ColorBoostType' => {
Description => 'カラーブーストタイプ',
PrintConv => {
'Nature' => '自然',
'People' => '人々',
},
},
'ColorBooster' => {
Description => 'カラーブースター',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ColorCalibrationMatrix' => 'カラーキャリブレーションマトリックステーブル',
'ColorCharacterization' => 'カラー特徴描写',
'ColorControl' => 'カラーコントロール',
'ColorEffect' => {
Description => 'カラーエフェクト',
PrintConv => {
'Black & White' => '白黒',
'Cool' => '冷色',
'Off' => 'オフ',
'Sepia' => 'セピア',
'Warm' => '暖色',
},
},
'ColorFilter' => {
Description => 'カラーフィルター',
PrintConv => {
'Black & White' => '白黒',
'Blue' => '青',
'Green' => '緑',
'Off' => 'オフ',
'Pink' => 'ピンク',
'Purple' => '紫',
'Red' => '赤',
'Sepia' => 'セピア',
'Yellow' => '黄色',
},
},
'ColorGain' => 'カラーゲイン',
'ColorHue' => '色相',
'ColorInfo' => '色情報',
'ColorMap' => 'カラーマップ',
'ColorMatrix' => 'カラーマトリックス',
'ColorMatrix1' => 'カラーマトリックス1',
'ColorMatrix2' => 'カラーマトリックス2',
'ColorMatrixNumber' => 'カラーマトリックス番号',
'ColorMode' => {
Description => 'カラーモード',
PrintConv => {
'Autumn Leaves' => '紅葉',
'B & W' => '白黒',
'B&W' => '白黒',
'Black & White' => '白黒',
'Chrome' => 'クローム',
'Clear' => 'クリアー',
'Deep' => 'ディープ',
'Evening' => '夕焼け',
'Landscape' => '風景',
'Light' => 'ライト',
'Natural' => 'ナチュラル',
'Natural color' => 'ナチュラルカラー',
'Natural sRGB' => 'ナチュラル sRGB',
'Natural+ sRGB' => 'ナチュラル+ sRGB',
'Neutral' => 'ニュートラル',
'Night Portrait' => '人物夜景',
'Night Scene' => '夜景',
'Night View' => 'ナイトビュー',
'Night View/Portrait' => '夜景/夜景ポートレート',
'Normal' => 'ノーマル',
'Off' => 'オフ',
'Portrait' => 'ポートレート',
'Sepia' => 'セピア',
'Solarization' => 'ソラリゼーション',
'Standard' => 'スタンダード',
'Sunset' => '夕日',
'Vivid' => 'ビビッド',
'Vivid color' => 'ビビッドカラー',
},
},
'ColorMoireReduction' => {
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ColorMoireReductionMode' => {
Description => '色モアレリダクション',
PrintConv => {
'High' => '高い',
'Low' => 'ソフト',
'Off' => 'オフ',
},
},
'ColorPalette' => 'カラーパレット',
'ColorProfile' => {
Description => 'カラープロフィール',
PrintConv => {
'Embedded' => '埋め込み',
'Not Embedded' => '埋め込み無し',
},
},
'ColorRepresentation' => '色表現',
'ColorReproduction' => '色再現',
'ColorResponseUnit' => '色応答単位',
'ColorSequence' => 'カラーシーケンス',
'ColorSpace' => {
Description => '色空間',
PrintConv => {
'ICC Profile' => 'ICCプロフィール',
'Monochrome' => 'モノトーン',
'Uncalibrated' => '未調整',
},
},
'ColorSpaceData' => 'カラースペースデータ',
'ColorTable' => 'カラーテーブル',
'ColorTemperature' => '色温度',
'ColorTone' => {
Description => 'カラートーン',
PrintConv => {
'Normal' => '標準',
},
},
'ColorToneFaithful' => 'カラートーン忠実設定',
'ColorToneLandscape' => 'カラートーン風景',
'ColorToneNeutral' => 'カラートーンニュートラル',
'ColorTonePortrait' => 'カラートーンポートレート',
'ColorToneStandard' => 'カラートーンスタンダード',
'ColorToneUserDef1' => 'カラートーンユーザ設定1',
'ColorToneUserDef2' => 'カラートーンユーザ設定2',
'ColorToneUserDef3' => 'カラートーンユーザ設定3',
'ColorantOrder' => '着色順',
'ColorantTable' => '着色テーブル',
'ColorimetricReference' => '比色分析参照',
'CommandDials' => {
Description => 'コマンダーダイヤル',
PrintConv => {
'Reversed (Main Aperture, Sub Shutter)' => 'リバース',
'Standard (Main Shutter, Sub Aperture)' => 'デフォルト',
},
},
'CommandDialsApertureSetting' => {
Description => 'コマンドダイヤルカスタマイズ 絞り設定',
PrintConv => {
'Aperture Ring' => '絞りリング',
'Sub-command Dial' => 'サブコントロールダイヤル',
},
},
'CommandDialsChangeMainSub' => {
Description => 'コマンドダイヤルカスタマイズ メイン/サブ変更',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'CommandDialsMenuAndPlayback' => {
Description => 'コマンドダイヤルカスタマイズ メニューと再生',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'CommandDialsReverseRotation' => {
Description => 'コマンドダイヤルカスタマイズ 回転保持',
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'CommanderChannel' => 'コマンダーモード チャンネル',
'CommanderGroupAManualOutput' => 'コマンダーモード グループA M 補正',
'CommanderGroupAMode' => {
Description => 'コマンダーモード グループA モード',
PrintConv => {
'Auto Aperture' => '自動絞り(AA)',
'Manual' => 'マニュアル',
'Off' => 'オフ',
},
},
'CommanderGroupA_TTL-AAComp' => 'コマンダーモード 内蔵フラッシュ TTL/AA 補正',
'CommanderGroupBManualOutput' => 'コマンダーモード グループB M 補正',
'CommanderGroupBMode' => {
Description => 'コマンダーモード グループB モード',
PrintConv => {
'Auto Aperture' => '自動絞り(AA)',
'Manual' => 'マニュアル',
'Off' => 'オフ',
},
},
'CommanderGroupB_TTL-AAComp' => 'コマンダーモード グループB TTL/AA 補正',
'CommanderInternalFlash' => {
Description => 'コマンダーモード 内蔵フラッシュ モード',
PrintConv => {
'Manual' => 'マニュアル',
'Off' => 'オフ',
},
},
'CommanderInternalManualOutput' => 'コマンダーモード 内蔵フラッシュ M 補正',
'CommanderInternalTTLComp' => 'コマンダーモード 内蔵フラッシュ TTL 補正',
'Comment' => 'コメント',
'Compilation' => {
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'ComponentsConfiguration' => '各構成要素の意味',
'CompressedBitsPerPixel' => '画像圧縮モード',
'CompressedImageSize' => '圧縮画像サイズ',
'Compression' => {
Description => '圧縮計画',
PrintConv => {
'JPEG' => 'JPEG圧縮率',
'JPEG (old-style)' => 'JPEG(古い形式)',
'None' => '無し',
'Uncompressed' => '非圧縮',
},
},
'CompressionRatio' => '圧縮率',
'CompressionType' => {
PrintConv => {
'None' => '無し',
},
},
'ConditionalFEC' => 'フラッシュ露出補正',
'ConnectionSpaceIlluminant' => '接続スペース光源',
'ConsecutiveBadFaxLines' => '連続的に粗悪なFAX線',
'Contact' => '連絡',
'ContentLocationCode' => '内容位置コード',
'ContentLocationName' => '内容位置名',
'ContinuousDrive' => {
Description => 'ドライブモード',
PrintConv => {
'Continuous' => '連続撮影',
'Continuous, High' => '連写(High)',
'Continuous, Low' => '連写(Low)',
'Continuous, Speed Priority' => '高速連写',
'Movie' => '動画',
'Single' => '1コマ撮影',
},
},
'ContinuousShootingSpeed' => {
Description => '連続撮影速度',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
},
},
'ContinuousShotLimit' => {
Description => '連続撮影時の撮影枚数制限',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
},
},
'Contrast' => {
Description => 'コントラスト',
PrintConv => {
'Film Simulation' => 'フィルムシミュレーション',
'High' => 'ハード',
'Low' => 'ソフト',
'Med High' => '少し高い',
'Med Low' => '少し低い',
'Medium High' => '少し高い',
'Medium Low' => '少し低い',
'Normal' => 'スタンダード',
'Very High' => 'かなり高い',
'Very Low' => 'かなり低い',
},
},
'ContrastCurve' => 'コントラストカーブ',
'ContrastFaithful' => 'コントラスト忠実設定',
'ContrastLandscape' => 'コントラスト風景',
'ContrastMonochrome' => 'コントラストモノクロ',
'ContrastNeutral' => 'コントラストニュートラル',
'ContrastPortrait' => 'コントラストポートレート',
'ContrastSetting' => 'コントラスト設定',
'ContrastStandard' => 'コントラストスタンダード',
'ContrastUserDef1' => 'コントラストユーザ設定1',
'ContrastUserDef2' => 'コントラストユーザ設定2',
'ContrastUserDef3' => 'コントラストユーザ設定3',
'ControlMode' => {
Description => 'コントロールモード',
PrintConv => {
'Camera Local Control' => 'カメラローカルコントロール',
'Computer Remote Control' => 'コンピュータリモートコントロール',
'n/a' => '該当無し',
},
},
'ConversionLens' => {
Description => 'コンバージョンレンズ',
PrintConv => {
'Macro' => 'マクロ',
'Off' => 'オフ',
'Telephoto' => 'テレフォト',
'Wide' => 'ワイド',
},
},
'Converter' => 'コンバーター',
'Copyright' => '版権所有者',
'CopyrightNotice' => '著作権表示',
'CopyrightStatus' => {
PrintConv => {
'Unknown' => '不明',
},
},
'CoringFilter' => 'コアリングフィルタ',
'CoringValues' => 'コアリング値',
'Country' => '国名',
'Country-PrimaryLocationCode' => 'ISO国コード',
'Country-PrimaryLocationName' => '国',
'CreateDate' => 'デジタルデータ作成日時',
'CreationDate' => '作成日時',
'CreativeStyle' => {
Description => 'クリエイティブスタイル',
PrintConv => {
'Autumn' => '秋',
'Autumn Leaves' => '紅葉',
'B&W' => '白黒',
'Clear' => 'クリアー',
'Deep' => 'ディープ',
'Landscape' => '風景',
'Light' => 'ライト',
'Neutral' => 'ニュートラル',
'Night View/Portrait' => '夜景/夜景ポートレート',
'Portrait' => 'ポートレート',
'Sepia' => 'セピア',
'Standard' => 'スタンダード',
'Sunset' => '夕日',
'Vivid' => 'ビビッド',
},
},
'Creator' => '製作者',
'CreatorAddress' => 'クリエーター - 住所',
'CreatorCity' => 'クリエーター - 街',
'CreatorCountry' => 'クリエーター - 国',
'CreatorPostalCode' => 'クリエーター - 郵便番号',
'CreatorRegion' => 'クリエーター - 国/州',
'CreatorWorkEmail' => 'クリエーター - 電子メール',
'CreatorWorkTelephone' => 'クリエーター - 電話番号',
'CreatorWorkURL' => 'クリエーター - WEBサイト',
'Credit' => 'プロバイダー',
'CropActive' => {
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'CropData' => 'クロップデータ',
'CropHeight' => '最終高さ',
'CropHiSpeed' => 'ハイスピードクロップ',
'CropLeft' => '開始オフセットX',
'CropTop' => '開始オフセットY',
'CropWidth' => '最終幅',
'CurrentICCProfile' => 'カレントICCプロファイル',
'CurrentPreProfileMatrix' => 'カレントプロファイルマトリックス',
'Curves' => {
Description => 'カーブ',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'Custom1' => 'カスタム1',
'Custom2' => 'カスタム2',
'Custom3' => 'カスタム3',
'Custom4' => 'カスタム4',
'CustomRendered' => {
Description => 'カスタム画像処理',
PrintConv => {
'Custom' => 'カスタム処理',
'Normal' => '標準処理',
},
},
'CustomSaturation' => 'カスタム彩度',
'D-LightingHQ' => {
Description => 'DライティングHQ',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'D-LightingHQColorBoost' => 'DライティングHQカラーブースト',
'D-LightingHQHighlight' => 'DライティングHQハイライト',
'D-LightingHQSelected' => {
Description => 'DライティングHQ選択',
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'D-LightingHQShadow' => 'DライティングHQシャドウ',
'D-LightingHS' => {
Description => 'DライティングHS',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'D-LightingHSAdjustment' => 'DライティングHS調整',
'D-LightingHSColorBoost' => 'DライティングHSカラーブースト',
'DECPosition' => {
Description => 'DEC位置',
PrintConv => {
'Contrast' => 'コントラスト',
'Exposure' => '露出',
'Filter' => 'フィルター',
'Saturation' => '彩度',
},
},
'DNGBackwardVersion' => 'DNGバックワードバージョン',
'DNGLensInfo' => 'レンズ情報',
'DNGVersion' => 'DNGバージョン',
'DSPFirmwareVersion' => 'DSPファームウエアバージョン',
'DataCompressionMethod' => 'データ圧縮アルゴリズム プロバイダー/オーナー',
'DataDump' => 'データダンプ',
'DataImprint' => {
Description => 'データインプリント',
PrintConv => {
'None' => '無し',
'Text' => 'テキスト',
},
},
'DataType' => '日付型',
'Date' => '日付',
'DateCreated' => '作成日付',
'DateDisplayFormat' => {
Description => '日付形式',
PrintConv => {
'D/M/Y' => '日/月/年',
'M/D/Y' => '月/日/年',
'Y/M/D' => '年/月/日',
},
},
'DateSent' => '発送日付',
'DateStampMode' => {
Description => '日付スタンプモード',
PrintConv => {
'Date' => '日付',
'Off' => 'オフ',
},
},
'DateTime' => 'ファイル作成日時',
'DateTimeOriginal' => 'オリジナルデータ作成日時',
'DaylightSavings' => {
Description => '夏時間',
PrintConv => {
'No' => 'オフ',
'Yes' => 'オン',
},
},
'DefaultCropOrigin' => 'デフォルト切取り基点',
'DefaultCropSize' => 'デフォルト切取りサイズ',
'DefaultScale' => 'デフォルトスケール',
'DeletedImageCount' => '削除イメージカウント',
'Description' => '説明',
'Destination' => '宛先',
'DestinationCity' => '目的地',
'DestinationCityCode' => '目的地コード',
'DestinationDST' => {
Description => '目的地DST',
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'DevelopmentDynamicRange' => '進化ダイナミックレンジ',
'DeviceAttributes' => '機器属性',
'DeviceManufacturer' => '機器メーカー',
'DeviceMfgDesc' => '機器メーカー説明',
'DeviceModel' => '機器モデル',
'DeviceModelDesc' => '機器モデル説明',
'DeviceSettingDescription' => 'デバイス設定の説明',
'DialDirectionTvAv' => {
Description => 'Tv/Av値設定時のダイヤル回転',
PrintConv => {
'Normal' => '通常',
'Reversed' => '設定方向を反転',
},
},
'DigitalCreationDate' => 'デジタル作成日付',
'DigitalCreationTime' => 'デジタル作成時間',
'DigitalGEM' => 'デジタルGEM',
'DigitalICE' => 'デジタルICE',
'DigitalROC' => 'デジタルROC',
'DigitalZoom' => {
Description => 'デジタルズーム',
PrintConv => {
'None' => '無し',
'Off' => 'オフ',
'Other' => '未確認',
},
},
'DigitalZoomOn' => {
Description => 'デジタルズームオン',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'DigitalZoomRatio' => 'デジタルズーム比率',
'Directory' => 'ファイルの場所',
'DirectoryIndex' => 'ディレクトリ索引',
'DirectoryNumber' => 'ディレクトリ番号',
'DisplayAperture' => '絞り表示',
'DisplaySize' => {
PrintConv => {
'Normal' => '標準',
},
},
'DistortionCorrection' => {
Description => '歪曲修正',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'DistortionCorrection2' => {
Description => '歪曲補正編集',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'DjVuVersion' => 'DjVuバージョン',
'DocumentHistory' => '文書履歴',
'DocumentName' => 'ドキュメント名',
'DocumentNotes' => '文書ノート',
'DotRange' => 'ドット範囲',
'DriveMode' => {
Description => 'ドライブモード',
PrintConv => {
'Bracketing' => 'ブラケット',
'Burst' => '高速連射',
'Continuous' => '連続撮影',
'Continuous High' => '連射 (Hi)',
'Continuous Shooting' => '連続撮影',
'HS continuous' => 'HS連写',
'Interval' => 'インターバル',
'Multiple Exposure' => '複数の露出',
'No Timer' => 'タイマー無し',
'Off' => 'オフ',
'Remote Control' => 'リモコン',
'Remote Control (3 s delay)' => 'リモコン (3秒後レリーズ)',
'Self-timer' => 'セルフタイマー',
'Self-timer (12 s)' => 'セルフタイマー (12秒)',
'Self-timer (2 s)' => 'セルフタイマー (2秒)',
'Self-timer Operation' => 'セルフタイマー',
'Shutter Button' => 'シャッターボタン',
'Single' => '1コマ撮影',
'Single Exposure' => 'シングル露出',
'Single Frame' => '1コマ撮影',
'Single Shot' => '1コマ撮影',
'Single-frame' => '1コマ撮影',
'Single-frame Shooting' => '1コマ撮影',
'UHS continuous' => 'UHS連写',
},
},
'DriveMode2' => {
Description => '多重露光',
PrintConv => {
'Single-frame' => '1コマ撮影',
},
},
'DynamicAFArea' => {
Description => 'ダイナミックAFエリア',
PrintConv => {
'21 Points' => '21点',
'51 Points' => '51点',
'51 Points (3D-tracking)' => '51点(3Dトラッキング)',
'9 Points' => '9点',
},
},
'DynamicRange' => {
Description => 'ダイナミックレンジ',
PrintConv => {
'Standard' => 'スタンダード',
'Wide' => 'ワイド',
},
},
'DynamicRangeExpansion' => {
Description => 'ダイナミックレンジ拡大',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'DynamicRangeOptimizer' => {
Description => 'Dレンジオプティマイザー',
PrintConv => {
'Advanced Auto' => 'アドバンスオート',
'Advanced Lv1' => 'アドバンスLv1',
'Advanced Lv2' => 'アドバンスLv2',
'Advanced Lv3' => 'アドバンスLv3',
'Advanced Lv4' => 'アドバンスLv4',
'Advanced Lv5' => 'アドバンスLv5',
'Auto' => 'オート',
'Off' => 'オフ',
'Standard' => 'スタンダード',
},
},
'DynamicRangeSetting' => 'ダイナミックレンジ設定',
'E-DialInProgram' => {
Description => '電子ダイヤルプログラム',
PrintConv => {
'P Shift' => 'Pシフト',
'Tv or Av' => 'TvかAv',
},
},
'ETTLII' => {
PrintConv => {
'Average' => '平均',
'Evaluative' => '評価',
},
},
'EVStepInfo' => 'EVステップ情報',
'EVStepSize' => {
Description => 'EVステップ',
PrintConv => {
'1/2 EV' => '1/2ステップ',
'1/3 EV' => '1/3ステップ',
},
},
'EVSteps' => {
Description => '露出ステップ',
PrintConv => {
'1/2 EV Steps' => '1/2 EVステップ',
'1/3 EV Steps' => '1/3 EVステップ',
},
},
'EasyExposureCompensation' => {
Description => '簡単な露出補正',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
'On (auto reset)' => 'オン(自動リセット)',
},
},
'EasyMode' => {
Description => '簡単モード',
PrintConv => {
'Aquarium' => '水族館',
'Beach' => 'ビーチ',
'Black & White' => '白黒',
'Color Accent' => 'カラーアクセント',
'Color Swap' => 'スイッチカラー',
'Digital Macro' => 'デジタルマクロ',
'Fast shutter' => '高速シャッター',
'Fireworks' => '花火',
'Flash Off' => 'フラッシュオフ',
'Foliage' => '葉',
'Full auto' => 'フルオート',
'Gray Scale' => 'グレースケール',
'ISO 3200' => 'ISO3200',
'Indoor' => '室内',
'Kids & Pets' => 'キッズ&ペット',
'Landscape' => '風景',
'Long Shutter' => '長秒シャッター',
'Macro' => 'マクロ',
'Manual' => 'マニュアル',
'My Colors' => 'ワンポイントカラー',
'Neutral' => 'ニュートラル',
'Night' => '夜景',
'Night Scene' => '夜景',
'Night Snapshot' => 'ナイトスナップ',
'Pan focus' => 'パンフォーカス',
'Portrait' => 'ポートレート',
'Sepia' => 'セピア',
'Slow shutter' => 'スローシャッター',
'Snow' => 'スノー',
'Sports' => 'スポーツ',
'Still Image' => '静止画像',
'Sunset' => '夕焼け',
'Super Macro' => 'スーパーマクロ',
'Underwater' => '水中',
'Vivid' => 'ビビッド',
},
},
'EdgeNoiseReduction' => {
Description => 'エッジノイズリダクション',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'EditStatus' => '編集状態',
'EditorialUpdate' => {
Description => '更新編集',
PrintConv => {
'Additional language' => '追加言語',
},
},
'EffectiveLV' => '効果レベル',
'Emphasis' => {
PrintConv => {
'None' => '無し',
},
},
'EncodingProcess' => 'JPEGの符号化処理',
'EndPoints' => '末端',
'EnhanceDarkTones' => {
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'Enhancement' => {
Description => '強度',
PrintConv => {
'Blue' => '青',
'Flesh Tones' => '肌調',
'Green' => '緑',
'Off' => 'オフ',
'Red' => '赤',
},
},
'Enhancer' => '増大値2',
'EnhancerValues' => '増大値',
'EnvelopeNumber' => 'エンベロープ数',
'EnvelopePriority' => {
Description => 'エンベロープ優先度',
PrintConv => {
'0 (reserved)' => '0 (将来拡張用)',
'1 (most urgent)' => '1 (高い緊急性)',
'5 (normal urgency)' => '5 (普通の緊急性)',
'8 (least urgent)' => '8 (低い緊急性)',
'9 (user-defined priority)' => '9 (ユーザ定義優先度)',
},
},
'EnvelopeRecordVersion' => 'エンベロープレコードバージョン',
'EpsonImageHeight' => 'エプソン画像高',
'EpsonImageWidth' => 'エプソン画像幅',
'EpsonSoftware' => 'エプソンソフトウェア',
'Equipment' => 'イクイップメントIFDポインター',
'EquipmentVersion' => 'イクイップメントバージョン',
'ExcursionTolerance' => '振幅許容範囲',
'ExifCameraInfo' => 'Exifカメラ情報',
'ExifImageHeight' => '画像高さ',
'ExifImageWidth' => '画像幅',
'ExifOffset' => 'Exif IFDへのポインタ',
'ExifToolVersion' => 'ExifToolバージョン',
'ExifVersion' => 'Exifバージョン',
'ExpandFilm' => '拡張フイルム',
'ExpandFilterLens' => '拡張レンズフィルター',
'ExpandFlashLamp' => '拡張フラッシュランプ',
'ExpandLens' => '拡張レンズ',
'ExpandScanner' => '拡張スキャナー',
'ExpandSoftware' => '拡張ソフト',
'ExpirationDate' => '有効日付',
'ExpirationTime' => '有効時間',
'Exposure' => '露出',
'ExposureBracketStepSize' => '露出ブラケットステップサイズ',
'ExposureBracketValue' => '露出ブラケット値',
'ExposureCompStepSize' => {
Description => '露出補正/ファインチューン',
PrintConv => {
'1 EV' => '1ステップ',
'1/2 EV' => '1/2ステップ',
'1/3 EV' => '1/3ステップ',
},
},
'ExposureCompensation' => '露出補正値',
'ExposureControlStepSize' => {
Description => '露出制御のEVステップ',
PrintConv => {
'1 EV' => '1ステップ',
'1/2 EV' => '1/2ステップ',
'1/3 EV' => '1/3ステップ',
},
},
'ExposureDelayMode' => {
Description => '露出遅延モード',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ExposureDifference' => '露出差',
'ExposureIndex' => '露出指標',
'ExposureLevelIncrements' => {
Description => '露出制御のEVステップ',
PrintConv => {
'1-stop set, 1/3-stop comp.' => '設定1 露出補正1/3',
'1/2 Stop' => '1/2ステップ',
'1/2-stop set, 1/2-stop comp.' => '設定1/2 露出補正1/2',
'1/3 Stop' => '1/3ステップ',
'1/3-stop set, 1/3-stop comp.' => '設定1/3 露出補正1/3',
},
},
'ExposureMode' => {
Description => '露光モード',
PrintConv => {
'Aperture Priority' => '絞り優先',
'Aperture-priority AE' => '絞り優先',
'Auto' => '自動露出',
'Auto bracket' => 'オートブラケット',
'Bulb' => 'バルブ',
'Landscape' => '風景',
'Manual' => 'マニュアル露出',
'Night Scene / Twilight' => '夜景',
'Portrait' => 'ポートレート',
'Program' => 'プログラム',
'Program AE' => 'プログラムAE',
'Program-shift' => 'プログラムシフト',
'Shutter Priority' => 'シャッター優先',
'Shutter speed priority AE' => 'シャッター優先',
'n/a' => '未設定',
},
},
'ExposureModeInManual' => {
Description => 'マニュアル露出時の測光モード',
PrintConv => {
'Center-weighted average' => '中央重点',
'Evaluative metering' => '評価測光',
'Partial metering' => '部分',
'Specified metering mode' => '設定測光モード',
'Spot metering' => 'スポット',
},
},
'ExposureProgram' => {
Description => '露出プログラム',
PrintConv => {
'Action (High speed)' => 'スポーツモード(高速シャッター優先)',
'Aperture Priority' => '絞り優先',
'Aperture-priority AE' => '絞り優先',
'Bulb' => 'バルブ',
'Creative (Slow speed)' => 'クリエイティブプログラム(被写界深度優先)',
'Landscape' => '風景モード',
'Manual' => 'マニュアル',
'Not Defined' => '未定義',
'Portrait' => 'ポートレートモード',
'Program' => 'プログラム',
'Program AE' => 'ノーマルプログラム',
'Shutter Priority' => 'シャッター優先',
'Shutter speed priority AE' => 'シャッター優先',
},
},
'ExposureTime' => '露出時間',
'ExposureTime2' => '露出時間 2',
'ExposureWarning' => {
Description => '露出警告',
PrintConv => {
'Bad exposure' => '露出失敗',
'Good' => '適正',
},
},
'ExtendedWBDetect' => {
Description => '延長WB検出',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'Extender' => 'エクステンダー',
'ExtenderFirmwareVersion' => 'エクステンダーファームウェアバージョン',
'ExtenderModel' => 'エクステンダーモデル',
'ExtenderSerialNumber' => 'エクステンダーシリアル番号',
'ExternalFlash' => {
Description => '外付フラッシュ',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ExternalFlashAE1' => '外付フラッシュAE1?',
'ExternalFlashAE1_0' => '外付フラッシュAE1(0)?',
'ExternalFlashAE2' => '外付フラッシュAE2?',
'ExternalFlashAE2_0' => '外付フラッシュAE2(0)?',
'ExternalFlashBounce' => {
Description => '外付フラッシュバウンス',
PrintConv => {
'Bounce' => 'バウンス',
'Bounce or Off' => 'バウンスかオフ',
'Direct' => 'ダイレクト',
'No' => 'いいえ',
'Yes' => 'はい',
'n/a' => '該当無し',
},
},
'ExternalFlashExposureComp' => {
Description => '外付ストロボ露出補正',
PrintConv => {
'n/a' => '未設定(オフかオートモード)',
'n/a (Manual Mode)' => '未設定(マニュアルモード)',
},
},
'ExternalFlashFlags' => '外付フラッシュフラグ',
'ExternalFlashGuideNumber' => '外付フラッシュガイドナンバー?',
'ExternalFlashMode' => {
Description => '外付フラッシュモード',
PrintConv => {
'Off' => 'オフ',
'On, Auto' => 'オン、オート',
'On, Contrast-control Sync' => 'オン、光量比制御シンクロ',
'On, Flash Problem' => 'オン、フラッシュの問題?',
'On, High-speed Sync' => 'オン、ハイスピードシンクロ',
'On, Manual' => 'オン、マニュアル',
'On, P-TTL Auto' => 'オン、P-TTLオート',
'On, Wireless' => 'オン、ワイヤレス',
'On, Wireless, High-speed Sync' => 'オン、ワイヤレス、ハイスピードシンクロ',
'n/a - Off-Auto-Aperture' => '該当なし-自動絞りオフ',
},
},
'ExternalFlashZoom' => '外付フラッシュズーム',
'ExtraSamples' => '特別サンプル',
'FNumber' => 'F値',
'Face0Position' => '顔0位置',
'Face1Position' => '顔1位置',
'Face2Position' => '顔2位置',
'Face3Position' => '顔3位置',
'Face4Position' => '顔4位置',
'Face5Position' => '顔5位置',
'Face6Position' => '顔6位置',
'Face7Position' => '顔7位置',
'Face8Position' => '顔8位置',
'Face9Position' => '顔9位置',
'FaceDetect' => {
Description => '顔認識',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'FaceDetectArea' => '顔エリア',
'FaceDetectFrameSize' => 'フレームサイズ',
'FaceOrientation' => {
PrintConv => {
'Horizontal (normal)' => '水平(標準)',
'Rotate 180' => '180度回転',
'Rotate 270 CW' => '270度回転 CW',
'Rotate 90 CW' => '90度回転 CW',
},
},
'FacesDetected' => '顔認識',
'FastSeek' => {
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'FaxProfile' => {
PrintConv => {
'Unknown' => '不明',
},
},
'FaxRecvParams' => 'FAX受信パラメータ',
'FaxRecvTime' => 'FAX受信時間',
'FaxSubAddress' => 'FAXサブアドレス',
'FileFormat' => 'ファイル形式',
'FileIndex' => 'ファイル索引',
'FileInfo' => 'ファイル情報',
'FileInfoVersion' => 'ファイル情報バージョン',
'FileModifyDate' => '更新日時',
'FileName' => 'ファイル名',
'FileNumber' => 'ファイル番号',
'FileNumberMemory' => {
Description => 'ファイル番号メモリ',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'FileNumberSequence' => {
Description => 'ファイル番号連番',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'FileSize' => 'ファイルのサイズ',
'FileSource' => {
Description => 'ファイルソース',
PrintConv => {
'Digital Camera' => 'デジタルカメラ',
'Film Scanner' => 'フィルムスキャナー',
'Reflection Print Scanner' => '反射印刷スキャナー',
},
},
'FileType' => 'ファイルタイプ',
'FileVersion' => 'ファイル形式バージョン',
'Filename' => 'ファイル名',
'FillFlashAutoReduction' => {
Description => '日中シンクロ・ストロボ露出自動低減制御',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
},
},
'FillOrder' => {
Description => 'フルオーダー',
PrintConv => {
'Normal' => '標準',
},
},
'FilmMode' => {
Description => 'フィルムモード',
PrintConv => {
'Dynamic (B&W)' => 'ダイナミック(白黒)',
'Dynamic (color)' => 'ダイナミック(カラー)',
'Nature (color)' => 'ナチュラル(カラー)',
'Smooth (B&W)' => '滑らか(白黒)',
'Smooth (color)' => '滑らか(カラー)',
'Standard (B&W)' => 'スタンダード(白黒)',
'Standard (color)' => 'スタンダード(カラー)',
},
},
'FilmType' => 'フィルムタイプ',
'Filter' => {
Description => 'フィルター',
PrintConv => {
'Off' => 'オフ',
},
},
'FilterEffect' => {
Description => 'フィルター効果',
PrintConv => {
'Green' => '緑',
'None' => '無し',
'Off' => 'オフ',
'Orange' => 'オレンジ',
'Red' => '赤',
'Yellow' => '黄色',
'n/a' => '該当無し',
},
},
'FilterEffectMonochrome' => {
Description => 'モノクロフィルター効果',
PrintConv => {
'Green' => '緑',
'None' => '無し',
'Orange' => 'オレンジ',
'Red' => '赤',
'Yellow' => '黄色',
},
},
'FinderDisplayDuringExposure' => {
Description => '露光中のファインダー内表示',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'FineTuneOptCenterWeighted' => '最適露出微調整 中央重点測光',
'FineTuneOptMatrixMetering' => '最適露出微調整 分割測光',
'FineTuneOptSpotMetering' => '最適露出微調整 スポット測光',
'Firmware' => 'ファームウェア',
'FirmwareDate' => 'ファームウェア日付',
'FirmwareRevision' => 'ファームウェアリビジョン',
'FirmwareVersion' => 'ファームウェアバージョン',
'FixtureIdentifier' => 'フィクチャー識別子',
'Flash' => {
Description => 'ストロボ',
PrintConv => {
'Auto, Did not fire' => 'フラッシュ未発光、オートモード',
'Auto, Did not fire, Red-eye reduction' => 'オート、フラッシュ未発光、赤目軽減モード',
'Auto, Fired' => 'フラッシュ発光、オートモード',
'Auto, Fired, Red-eye reduction' => 'フラッシュ発光、オートモード、赤目軽減モード',
'Auto, Fired, Red-eye reduction, Return detected' => 'フラッシュ発光、オートモード、ストロボ光検知、赤目軽減モード',
'Auto, Fired, Red-eye reduction, Return not detected' => 'フラッシュ発光、オートモード、ストロボ光未検知、赤目軽減モード',
'Auto, Fired, Return detected' => 'フラッシュ発光、オートモード、ストロボ光検知',
'Auto, Fired, Return not detected' => 'フラッシュ発光、オートモード、ストロボ光未検知',
'Did not fire' => 'フラッシュ未発光',
'Fired' => 'フラッシュ発光',
'Fired, Red-eye reduction' => 'フラッシュ発光、赤目軽減モード',
'Fired, Red-eye reduction, Return detected' => 'フラッシュ発光、赤目軽減モード、ストロボ光検知',
'Fired, Red-eye reduction, Return not detected' => 'フラッシュ発光、赤目軽減モード、ストロボ光未検知',
'Fired, Return detected' => 'ストロボ光検知',
'Fired, Return not detected' => 'ストロボ光未検知',
'No Flash' => 'フラッシュ未発光',
'No flash function' => 'フラッシュ機能無し',
'Off' => 'オフ',
'Off, Did not fire' => 'フラッシュ未発光、強制発光モード',
'Off, Did not fire, Return not detected' => 'オフ、フラッシュ未発光、ストロボ光未検知',
'Off, No flash function' => 'オフ、フラッシュ機能無し',
'Off, Red-eye reduction' => 'オフ、赤目軽減モード',
'On' => 'オン',
'On, Did not fire' => 'オン、フラッシュ未発光',
'On, Fired' => 'フラッシュ発光、強制発光モード',
'On, Red-eye reduction' => 'フラッシュ発光、強制発光モード、赤目軽減モード',
'On, Red-eye reduction, Return detected' => 'フラッシュ発光、強制発光モード、赤目軽減モード、ストロボ光検知',
'On, Red-eye reduction, Return not detected' => 'フラッシュ発光、強制発光モード、赤目軽減モード、ストロボ光未検知',
'On, Return detected' => 'フラッシュ発光、強制発光モード、ストロボ光検知',
'On, Return not detected' => 'フラッシュ発光、強制発光モード、ストロボ光未検知',
},
},
'FlashActivity' => 'フラッシュ稼働',
'FlashBias' => 'フラッシュバイアス',
'FlashBits' => 'フラッシュ詳細',
'FlashChargeLevel' => 'フラッシュチャージレベル',
'FlashCommanderMode' => {
Description => 'コマンダーモード',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'FlashCompensation' => 'フラッシュ補正',
'FlashControlMode' => {
Description => 'フラッシュコントロールモード',
PrintConv => {
'Auto Aperture' => '自動絞り(AA)',
'Manual' => 'マニュアル',
'Off' => 'オフ',
'Repeating Flash' => 'リピーティングフラッシュ',
},
},
'FlashDevice' => {
Description => 'フラッシュデバイス',
PrintConv => {
'External' => '外付け',
'Internal' => '内蔵',
'Internal + External' => '内蔵+外付け',
'None' => '無し',
},
},
'FlashDistance' => 'フラッシュ強度',
'FlashEnergy' => 'フラッシュ強度',
'FlashExposureBracketValue' => 'フラッシュ露出ブラケット値',
'FlashExposureComp' => 'フラッシュ露出補正',
'FlashExposureCompSet' => 'ストロボ露出補正設定',
'FlashExposureLock' => {
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'FlashFired' => {
Description => 'フラッシュ発光',
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'FlashFiring' => {
Description => 'ストロボの発光',
PrintConv => {
'Does not fire' => 'しない',
'Fires' => 'する',
},
},
'FlashFirmwareVersion' => 'フラッシュファームウェアバージョン',
'FlashFocalLength' => 'フラッシュ焦点距離',
'FlashGroupACompensation' => 'グループAフラッシュ補正',
'FlashGroupAControlMode' => {
Description => 'グループAフラッシュコントロールモード',
PrintConv => {
'Auto Aperture' => '自動絞り(AA)',
'Manual' => 'マニュアル',
'Off' => 'オフ',
'Repeating Flash' => 'リピーティングフラッシュ',
},
},
'FlashGroupAOutput' => 'グループAフラッシュ出力',
'FlashGroupBCompensation' => 'グループBフラッシュ補正',
'FlashGroupBControlMode' => {
Description => 'グループBフラッシュコントロールモード',
PrintConv => {
'Auto Aperture' => '自動絞り(AA)',
'Manual' => 'マニュアル',
'Off' => 'オフ',
'Repeating Flash' => 'リピーティングフラッシュ',
},
},
'FlashGroupBOutput' => 'グループBフラッシュ出力',
'FlashGroupCCompensation' => 'グループCフラッシュ補正',
'FlashGroupCControlMode' => {
Description => 'グループCフラッシュコントロールモード',
PrintConv => {
'Auto Aperture' => '自動絞り(AA)',
'Manual' => 'マニュアル',
'Off' => 'オフ',
'Repeating Flash' => 'リピーティングフラッシュ',
},
},
'FlashGroupCOutput' => 'グループCフラッシュ出力',
'FlashGuideNumber' => 'フラッシュガイドナンバー',
'FlashInfo' => 'ストロボ情報',
'FlashInfoVersion' => 'フラッシュ情報バージョン',
'FlashIntensity' => {
Description => 'フラッシュ強度',
PrintConv => {
'High' => '高い',
'Low' => '低い',
'Normal' => '標準',
'Strong' => '強い',
'Weak' => '弱い',
},
},
'FlashLevel' => 'フラッシュ補正',
'FlashMetering' => 'フラッシュ計測',
'FlashMeteringSegments' => 'フラッシュ測光値',
'FlashMode' => {
Description => 'フラッシュモード',
PrintConv => {
'Auto' => 'オート',
'Auto, Did not fire' => 'オート、発光無し',
'Auto, Did not fire, Red-eye reduction' => 'オート、発光無し、赤目軽減',
'Auto, Fired' => 'オート、発光',
'Auto, Fired, Red-eye reduction' => 'オート、発光、赤目軽減',
'Did Not Fire' => '発光禁止',
'External, Auto' => '外付、オート',
'External, Contrast-control Sync' => '外付、光量比制御シンクロ',
'External, Flash Problem' => '外付、フラッシュの問題?',
'External, High-speed Sync' => '外付、ハイスピードシンクロ',
'External, Manual' => '外付、マニュアル',
'External, P-TTL Auto' => '外付、P-TTL自動調光',
'External, Wireless' => '外付、ワイヤレス',
'External, Wireless, High-speed Sync' => '外付、ワイヤレス、ハイスピードシンクロ',
'Fill flash' => '強制発光',
'Fired, Commander Mode' => '発光、コマンダーモード',
'Fired, External' => '発光、外付',
'Fired, Manual' => '発光、マニュアル',
'Fired, TTL Mode' => '発光、TTLモード',
'Internal' => '内蔵',
'Normal' => '標準',
'Off' => 'オフ',
'Off, Did not fire' => 'オフ',
'Off?' => 'オフ?',
'On' => 'オン',
'On, Did not fire' => 'オン、発光無し',
'On, Fired' => 'オン',
'On, Red-eye reduction' => 'オン、赤目軽減',
'On, Slow-sync' => 'オン、スローシンクロ',
'On, Slow-sync, Red-eye reduction' => 'オン、スローシンクロ、赤目軽減',
'On, Soft' => 'オン、ソフト',
'On, Trailing-curtain Sync' => 'オン、後幕シンクロ',
'On, Wireless (Control)' => 'オン、ワイヤレス (コントロール)',
'On, Wireless (Master)' => 'オン、ワイヤレス (マスター)',
'Rear flash sync' => 'リアフラッシュシンクロ',
'Red-eye Reduction' => '赤目軽減',
'Red-eye reduction' => '赤目軽減',
'Unknown' => '不明',
'Wireless' => 'ワイヤレス',
'n/a - Off-Auto-Aperture' => '該当なし-自動絞りオフ',
},
},
'FlashModel' => {
Description => 'フラッシュモデル',
PrintConv => {
'None' => '無し',
},
},
'FlashOptions' => {
Description => 'フラッシュオプション',
PrintConv => {
'Auto' => 'オート',
'Auto, Red-eye reduction' => 'オート、赤目軽減',
'Normal' => '標準',
'Red-eye reduction' => '赤目軽減',
'Slow-sync' => 'スローシンクロ',
'Slow-sync, Red-eye reduction' => 'スローシンクロ、赤目軽減',
'Trailing-curtain Sync' => '後幕シンクロ',
'Wireless (Control)' => 'ワイヤレス(コントロール発光)',
'Wireless (Master)' => 'ワイヤレス(マスター発光)',
},
},
'FlashOptions2' => {
Description => 'ストロボオプション(2)',
PrintConv => {
'Auto' => 'オート',
'Auto, Red-eye reduction' => 'オート、赤目軽減',
'Normal' => '標準',
'Red-eye reduction' => '赤目軽減',
'Slow-sync' => 'スローシンクロ',
'Slow-sync, Red-eye reduction' => 'スローシンクロ、赤目軽減',
'Trailing-curtain Sync' => '後幕シンクロ',
'Wireless (Control)' => 'ワイヤレス(コントロール発光)',
'Wireless (Master)' => 'ワイヤレス(マスター発光)',
},
},
'FlashOutput' => 'フラッシュ出力',
'FlashRemoteControl' => 'フラッシュリモートコントロール',
'FlashSerialNumber' => 'フラッシュシリアル番号',
'FlashSetting' => 'フラッシュ設定',
'FlashShutterSpeed' => 'フラッシュシャッター速度',
'FlashStatus' => {
Description => 'ストロボ状態',
PrintConv => {
'External, Did not fire' => '外付、未発光',
'External, Fired' => '外付、発光',
'Internal, Did not fire' => '内蔵、未発光',
'Internal, Fired' => '内蔵、発光',
'Off' => 'オフ',
},
},
'FlashSyncSpeed' => 'フラッシュ同調速度',
'FlashSyncSpeedAv' => {
Description => 'Avモード時のストロボ同調速度',
PrintConv => {
'1/200 Fixed' => '1/200秒固定',
'1/250 Fixed' => '1/250秒固定',
'1/300 Fixed' => '1/300秒固定',
'Auto' => 'オート',
},
},
'FlashType' => {
Description => 'フラッシュタイプ',
PrintConv => {
'E-System' => 'E-システム',
'None' => '無し',
'Simple E-System' => 'シンプルE-システム',
},
},
'FlashWarning' => {
Description => 'フラッシュ警告',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'FlashpixVersion' => 'サポートフラッシュピックスバージョン',
'FlickerReduce' => {
Description => 'フリッカー軽減',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'FlipHorizontal' => {
Description => '横フリップ',
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'FocalLength' => 'レンズ焦点距離',
'FocalLength35efl' => 'レンズ焦点距離',
'FocalLengthIn35mmFormat' => '35mmフイルム換算焦点距離',
'FocalPlaneDiagonal' => '焦点面対角線',
'FocalPlaneResolutionUnit' => {
Description => '焦点面解像度単位',
PrintConv => {
'None' => '無し',
'inches' => 'インチ',
},
},
'FocalPlaneXResolution' => '焦点面X解像度',
'FocalPlaneXSize' => '焦点面Xサイズ',
'FocalPlaneXUnknown' => '焦点面Xサイズ',
'FocalPlaneYResolution' => '焦点面Y解像度',
'FocalPlaneYSize' => '焦点面Yサイズ',
'FocalPlaneYUnknown' => '焦点面Yサイズ',
'FocalType' => {
Description => 'フォーカスタイプ',
PrintConv => {
'Fixed' => '固定',
'Zoom' => 'ズーム',
},
},
'FocalUnits' => '焦点単位/mm',
'Focus' => {
Description => 'フォーカス',
PrintConv => {
'Manual' => 'マニュアル',
},
},
'FocusArea' => 'フォーカスエリア',
'FocusAreaSelection' => {
Description => 'フォーカスポイントラップアラウンド',
PrintConv => {
'No Wrap' => 'ノーラップ',
'Wrap' => 'ラップ',
},
},
'FocusContinuous' => {
Description => '連続フォーカス',
PrintConv => {
'Continuous' => '連続',
'Manual' => 'マニュアル',
'Single' => 'シングル',
},
},
'FocusDistance' => '被写体距離',
'FocusDistanceLower' => '焦点距離低部分',
'FocusDistanceUpper' => '焦点距離高部分',
'FocusMode' => {
Description => 'フォーカスモード',
PrintConv => {
'AI Focus AF' => 'AIフォーカスAF',
'AI Servo AF' => 'AIサーボAF',
'Auto' => 'オート',
'Auto, Continuous' => 'オート、コンティニュアス',
'Auto, Focus button' => 'オート、フォーカスボタン',
'Continuous' => '連写',
'Continuous AF' => 'コンティニュアスAF',
'Custom' => 'カスタム',
'Infinity' => '無限遠',
'Macro' => 'マクロ',
'Macro (1)' => 'マクロ(1)',
'Macro (2)' => 'マクロ(2)',
'Manual' => 'マニュアル',
'Manual Focus (3)' => 'マニュアルフォーカス(3)',
'Manual Focus (6)' => 'マニュアルフォーカス(6)',
'Multi AF' => 'マルチAF',
'Normal' => '標準',
'One-shot AF' => 'ワンショットAF',
'Pan Focus' => 'パンフォーカス',
'Sequential shooting AF' => 'シーケンシャルシューティングAF',
'Single' => 'シングル',
'Single AF' => 'シングルAF',
'Super Macro' => 'スーパーマクロ',
},
},
'FocusMode2' => 'フォーカスモード2',
'FocusModeSetting' => {
Description => 'フォーカスモード',
PrintConv => {
'Manual' => 'マニュアル',
},
},
'FocusPixel' => '焦点解像度',
'FocusPointWrap' => {
Description => 'フォーカスポイントラップアラウンド',
PrintConv => {
'No Wrap' => 'ノーラップ',
'Wrap' => 'ラップ',
},
},
'FocusPosition' => 'フォーカス距離',
'FocusProcess' => {
Description => 'フォーカスプロセス',
PrintConv => {
'AF Not Used' => 'AF未使用',
'AF Used' => 'AF使用',
},
},
'FocusRange' => {
Description => 'フォーカスレンジ',
PrintConv => {
'Auto' => 'オート',
'Close' => '近景',
'Far Range' => '遠景',
'Infinity' => '無限遠',
'Macro' => 'マクロ',
'Manual' => 'マニュアル',
'Middle Range' => '中間範囲',
'Normal' => 'ノーマル',
'Not Known' => '不明',
'Pan Focus' => 'パンフォーカス',
'Super Macro' => 'スーパーマクロ',
'Very Close' => '近接',
},
},
'FocusSetting' => 'フォーカス設定',
'FocusStepCount' => 'フォーカスステップ数',
'FocusStepInfinity' => '無限レンズステップ',
'FocusStepNear' => 'ニアステップ数',
'FocusTrackingLockOn' => {
Description => 'フォーカストラッキングとロックオン',
PrintConv => {
'Long' => 'ロング',
'Normal' => '標準',
'Off' => 'オフ',
'Short' => 'ショート',
},
},
'FocusWarning' => {
Description => 'フォーカス警告',
PrintConv => {
'Good' => 'ジャスピン',
'Out of focus' => 'ピンボケ',
},
},
'FocusingScreen' => 'フォーカシングスクリーン',
'FolderName' => 'フォルダ名',
'ForwardMatrix1' => '前行列1',
'ForwardMatrix2' => '前行列2',
'FrameHeight' => 'フレーム高',
'FrameNumber' => 'フレーム番号',
'FrameRate' => 'フレームレート',
'FrameSize' => 'フレームサイズ',
'FrameWidth' => 'フレーム幅',
'FreeByteCounts' => 'フリーバイト数',
'FreeMemoryCardImages' => 'フリーメモリーカードイメージ',
'FreeOffsets' => 'フリーオフセット',
'FujiFlashMode' => {
Description => 'フラッシュモード',
PrintConv => {
'Auto' => 'オート',
'External' => '外付フラッシュ',
'Off' => 'オフ',
'On' => 'オン',
'Red-eye reduction' => '赤目軽減',
},
},
'FunctionButton' => {
Description => 'FUNCボタン',
PrintConv => {
'AF-area Mode' => 'AFエリアモード',
'Center AF Area' => '中央AFエリア',
'Center-weighted' => '中央重点測光',
'FV Lock' => 'FVロック',
'Flash Off' => 'フラッシュオフ',
'Framing Grid' => 'フレーミンググリッド',
'ISO Display' => 'ISO表示',
'Matrix Metering' => '分割測光',
'Spot Metering' => 'スポット測光',
},
},
'GEMInfo' => 'GEM情報',
'GEModel' => 'モデル',
'GIFVersion' => 'GIFバージョン',
'GPSAltitude' => '高度',
'GPSAltitudeRef' => {
Description => '参照高度',
PrintConv => {
'Above Sea Level' => '海水面',
'Below Sea Level' => '参照海水面(負の値)',
},
},
'GPSAreaInformation' => 'GPSエリアの名称',
'GPSDOP' => '測定精度',
'GPSDateStamp' => 'GPSデータ',
'GPSDateTime' => 'GPS時間(原子時計)',
'GPSDestBearing' => '目的地の方向',
'GPSDestBearingRef' => {
Description => '目的地の方向の参照',
PrintConv => {
'Magnetic North' => '磁気の方向',
'True North' => '正常な方向',
},
},
'GPSDestDistance' => '目的地の距離',
'GPSDestDistanceRef' => {
Description => '目的地の距離の参照',
PrintConv => {
'Kilometers' => 'キロメートル',
'Miles' => 'マイル',
'Nautical Miles' => 'ノット',
},
},
'GPSDestLatitude' => '目的地の緯度',
'GPSDestLatitudeRef' => {
Description => '目的地の緯度のための参照',
PrintConv => {
'North' => '北緯',
'South' => '南緯',
},
},
'GPSDestLongitude' => '目的地の経度',
'GPSDestLongitudeRef' => {
Description => '目的地の経度のための参照',
PrintConv => {
'East' => '東経',
'West' => '西経',
},
},
'GPSDifferential' => {
Description => 'GPS誤差修正',
PrintConv => {
'Differential Corrected' => '誤差修正あり',
'No Correction' => '誤差修正無し',
},
},
'GPSImgDirection' => 'イメージの方向',
'GPSImgDirectionRef' => {
Description => '画像方向参照',
PrintConv => {
'Magnetic North' => '磁気の方向',
'True North' => '本当の方向',
},
},
'GPSInfo' => 'GPS IFDへのポインタ',
'GPSLatitude' => '緯度',
'GPSLatitudeRef' => {
Description => '北緯または南緯',
PrintConv => {
'North' => '北緯',
'South' => '南緯',
},
},
'GPSLongitude' => '経度',
'GPSLongitudeRef' => {
Description => '東経または西経',
PrintConv => {
'East' => '東経',
'West' => '西経',
},
},
'GPSMapDatum' => 'データが使った測地測量',
'GPSMeasureMode' => {
Description => 'GPS測定モード',
PrintConv => {
'2-D' => '2次元測定',
'2-Dimensional' => '2次元測定',
'2-Dimensional Measurement' => '2次元測定',
'3-D' => '3次元測定',
'3-Dimensional' => '3次元測定',
'3-Dimensional Measurement' => '3次元測定',
},
},
'GPSProcessingMethod' => 'GPS処理方法の名称',
'GPSSatellites' => '測定のために使われたGPS衛星',
'GPSSpeed' => 'GPS受信機のスピード',
'GPSSpeedRef' => {
Description => 'スピード単位',
PrintConv => {
'km/h' => '時速(km)',
'knots' => 'ノット',
'mph' => '時速(マイル)',
},
},
'GPSStatus' => {
Description => 'GPS受信機ステータス',
PrintConv => {
'Measurement Active' => '測定アクティブ',
'Measurement Void' => '測定無効',
},
},
'GPSTimeStamp' => 'GPS時間(原子時計)',
'GPSTrack' => '動作方向',
'GPSTrackRef' => {
Description => '動作方向の参照',
PrintConv => {
'Magnetic North' => '磁気の方向',
'True North' => '本当の方向',
},
},
'GPSVersionID' => 'GPSタグバージョン',
'GainBase' => '基本ゲイン',
'GainControl' => {
Description => 'ゲインコントロール',
PrintConv => {
'High gain down' => '高いゲインダウン',
'High gain up' => '高いゲインアップ',
'Low gain down' => '低いゲインダウン',
'Low gain up' => '低いゲインアップ',
'None' => '無し',
},
},
'Gamma' => 'ガンマ',
'GammaCompensatedValue' => 'ガンマ補償値',
'Gamut' => '全域',
'Gapless' => {
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'GeoTiffAsciiParams' => 'ジオアスキー設定タグ',
'GeoTiffDirectory' => 'ジオキーディレクトリタグ',
'GeoTiffDoubleParams' => 'ジオダブル設定タグ',
'Gradation' => 'グラデーション',
'GrayPoint' => 'グレーポイント',
'GrayResponseCurve' => 'グレー反応曲線',
'GrayResponseUnit' => {
Description => 'グレー反応単位',
PrintConv => {
'0.0001' => '単位の数は1000を表す',
'0.001' => '単位の数は100を表す',
'0.1' => '単位の数は10を表す',
'1e-05' => '単位の数は10-1000を表す',
'1e-06' => '単位の数は100-1000を表す',
},
},
'GrayScale' => 'グレースケール',
'GrayTRC' => '灰色調増殖曲線',
'GreenMatrixColumn' => '緑色マトリックス列',
'GreenTRC' => '緑色調増殖曲線',
'GridDisplay' => {
Description => 'ビューファインダーグリッド表示',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'GripBatteryADLoad' => '電源A/Dグリップ起動時',
'GripBatteryADNoLoad' => '電源A/Dグリップオフ時',
'GripBatteryState' => '電源状態グリップ',
'HCUsage' => 'HC使用',
'HDR' => {
Description => 'オートHDR',
PrintConv => {
'Off' => '切',
},
},
'HalftoneHints' => 'ハーフトーンヒント',
'Headline' => 'ヘッドライン',
'HeightResolution' => '高さ方向の画像解像度',
'HighISONoiseReduction' => {
Description => '高感度ノイズリダクション',
PrintConv => {
'Auto' => 'オート',
'High' => '高い',
'Low' => 'ソフト',
'Minimal' => '最小',
'Normal' => '標準',
'Off' => 'オフ',
'On' => 'オン',
'Standard' => 'スタンダード',
'Strong' => '強',
'Weak' => '弱',
'Weakest' => '微弱',
},
},
'Highlight' => 'ハイライト',
'HighlightTonePriority' => {
Description => '高輝度側・階調優先',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
'Off' => 'オフ',
'On' => 'オン',
},
},
'HometownCity' => '現在地',
'HometownCityCode' => '現在地コード',
'HometownDST' => {
Description => '現在地DST',
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'HostComputer' => 'ホストコンピューター',
'Hue' => '色相',
'HueAdjustment' => '色相調整',
'HueSetting' => '色相設定',
'ICCProfile' => 'ICCプロフィール',
'ICC_Profile' => 'ICC入力色プロフィール',
'IPTC-NAA' => 'IPTC-NAAメタデータ',
'IPTCBitsPerSample' => 'サンプルあたりビット数',
'IPTCData' => 'IPTCデータ',
'IPTCImageHeight' => 'ライン数',
'IPTCImageRotation' => 'イメージ回転',
'IPTCImageWidth' => 'ラインあたりのピクセル数',
'IPTCPictureNumber' => '写真番号',
'IPTCPixelHeight' => 'スキャン方向垂直ピクセルサイズ',
'IPTCPixelWidth' => 'スキャン方向ピクセルサイズ',
'ISO' => 'ISOスピードレート',
'ISO2' => 'ISO(2)',
'ISOAuto' => 'ISOオート',
'ISODisplay' => 'ISO表示',
'ISOExpansion' => {
Description => 'ISO感度拡張',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ISOExpansion2' => {
Description => 'ISO拡大(2)',
PrintConv => {
'Off' => 'オフ',
},
},
'ISOFloor' => '最低感度',
'ISOInfo' => 'ISO情報',
'ISOSelection' => 'ISO選択',
'ISOSetting' => {
Description => 'ISO設定',
PrintConv => {
'Auto' => 'オート',
'Manual' => 'マニュアル',
},
},
'ISOSpeedExpansion' => {
Description => 'ISO感度拡張',
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'ISOSpeedIncrements' => {
Description => 'ISO感度ステップ値',
PrintConv => {
'1 Stop' => '1ステップ',
'1/3 Stop' => '1/3ステップ',
},
},
'ISOSpeedRange' => {
Description => 'ISO感度の制御範囲の設定',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
},
},
'ISOStepSize' => {
Description => 'ISO感度ステップ値',
PrintConv => {
'1 EV' => '1ステップ',
'1/2 EV' => '1/2ステップ',
'1/3 EV' => '1/3ステップ',
},
},
'ISOValue' => 'ISO感度',
'IT8Header' => 'IT8ヘッダー',
'Illumination' => {
Description => 'イルミネーション',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'Image::ExifTool::NikonCapture::RedEyeData' => 'Nikon Capture 赤目データ',
'ImageAdjustment' => 'イメージ調整',
'ImageAreaOffset' => 'イメージ領域オフセット',
'ImageAuthentication' => {
Description => 'イメージ認証',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ImageBoundary' => 'イメージ境界線',
'ImageByteCount' => '画像バイト数',
'ImageColorIndicator' => '画像色指標',
'ImageColorValue' => '画像色値',
'ImageCount' => 'イメージカウント',
'ImageDataDiscard' => {
Description => 'イメージデータ廃棄',
PrintConv => {
'Flexbits Discarded' => 'フレックスビット破棄',
'Full Resolution' => '完全な解像度',
'HighPass Frequency Data Discarded' => 'ハイパス周波数データ破棄',
'Highpass and LowPass Frequency Data Discarded' => 'ハイパスとローパス周波数データ破棄',
},
},
'ImageDataSize' => 'イメージデータサイズ',
'ImageDepth' => 'イメージの深さ',
'ImageDescription' => 'イメージ説明',
'ImageDustOff' => {
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ImageEditCount' => '画像処理カウント',
'ImageEditing' => {
Description => 'イメージ処理',
PrintConv => {
'Cropped' => 'クロップ',
'Digital Filter' => 'デジタルフィルター',
'Frame Synthesis?' => 'フレーム合成?',
'None' => '未処理',
},
},
'ImageHeight' => '画像高さ',
'ImageHistory' => '画像履歴',
'ImageID' => 'イメージID',
'ImageInfo' => '画像情報',
'ImageLayer' => 'イメージレイヤー',
'ImageNumber' => 'イメージ番号',
'ImageNumber2' => 'イメージ番号(2)',
'ImageOffset' => 'イメージオフセット',
'ImageOptimization' => 'イメージ最適化',
'ImageOrientation' => {
Description => 'イメージ方向',
PrintConv => {
'Landscape' => 'ランドスケープ',
'Portrait' => 'ポートレート',
'Square' => '正方形',
},
},
'ImageProcessing' => 'イメージ処理',
'ImageProcessingVersion' => '画像処理バージョン',
'ImageQuality' => {
Description => '画像品質',
PrintConv => {
'High' => '高い',
'Motion Picture' => '動画',
'Normal' => '標準',
},
},
'ImageQuality2' => 'イメージ品質2',
'ImageResourceBlocks' => 'イメージリソースブロック',
'ImageReview' => {
Description => '画像評価',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ImageReviewTime' => '自動オフタイマー 画像評価時間',
'ImageRotated' => {
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'ImageSize' => 'イメージサイズ',
'ImageSourceData' => 'イメージソースデータ',
'ImageStabilization' => {
Description => 'イメージスタビライザー',
PrintConv => {
'Best Shot' => 'ベストショット',
'Off' => 'オフ',
'On' => 'オン',
'On, Mode 1' => 'オン、モード1',
'On, Mode 2' => 'オン、モード2',
},
},
'ImageTone' => {
Description => '画像仕上',
PrintConv => {
'Bright' => '鮮やか',
'Landscape' => '風景',
'Monochrome' => 'モノトーン',
'Natural' => 'ナチュラル',
'Portrait' => 'ポートレート',
'Vibrant' => '雅(MIYABI)',
},
},
'ImageType' => 'ページ',
'ImageUniqueID' => 'ユニークなイメージID',
'ImageWidth' => '画像幅',
'Index' => '目次',
'Indexed' => 'インデックス',
'InfoButtonWhenShooting' => {
Description => '撮影時のINFOボタン',
PrintConv => {
'Displays camera settings' => 'カメラ設定内容を表示',
'Displays shooting functions' => '撮影機能の設定状態を表示',
},
},
'InitialZoomSetting' => {
Description => '初期ズーム設定',
PrintConv => {
'High Magnification' => '高い拡大',
'Low Magnification' => '低い拡大',
'Medium Magnification' => '中間拡大',
},
},
'InkNames' => 'インク名',
'InkSet' => 'インクセット',
'Instructions' => '詳細',
'IntellectualGenre' => 'インテリジャンル',
'IntelligentAuto' => 'インテリジェントオート',
'IntensityStereo' => {
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'IntergraphMatrix' => '相互グラフマトリックスタグ',
'Interlace' => 'インタレース',
'InternalFlash' => {
Description => '内蔵フラッシュコントロール',
PrintConv => {
'Commander Mode' => 'コマンダーモード',
'Fired' => 'フラッシュ発光',
'Manual' => 'マニュアル',
'No' => 'フラッシュ未発光',
'Off' => 'オフ',
'On' => 'オン',
'Repeating Flash' => 'リピーティングフラッシュ',
},
},
'InternalFlashAE1' => '内蔵フラッシュAE1?',
'InternalFlashAE1_0' => '内蔵フラッシュAE1(0)?',
'InternalFlashAE2' => '内蔵フラッシュAE2?',
'InternalFlashAE2_0' => '内蔵フラッシュAE2(0)?',
'InternalFlashMode' => {
Description => '内蔵ストロボモード',
PrintConv => {
'Did not fire, (Unknown 0xf4)' => 'オフ(未確認 0xF4?)',
'Did not fire, Auto' => 'オフ、オート',
'Did not fire, Auto, Red-eye reduction' => 'オフ、オート、赤目軽減',
'Did not fire, Normal' => 'オフ、標準',
'Did not fire, Red-eye reduction' => 'オフ、赤目軽減',
'Did not fire, Slow-sync' => 'オフ、スローシンクロ',
'Did not fire, Slow-sync, Red-eye reduction' => 'オフ、スローシンクロ、赤目軽減',
'Did not fire, Trailing-curtain Sync' => 'オフ、後幕シンクロ',
'Did not fire, Wireless (Control)' => 'オフ、ワイヤレス(コントロール発光)',
'Did not fire, Wireless (Master)' => 'オフ、ワイヤレス(マスター発光)',
'Fired' => 'オン',
'Fired, Auto' => 'オン、オート',
'Fired, Auto, Red-eye reduction' => 'オン、オート、赤目軽減',
'Fired, Red-eye reduction' => 'オン、赤目軽減',
'Fired, Slow-sync' => 'オン、スローシンクロ',
'Fired, Slow-sync, Red-eye reduction' => 'オン、スローシンクロ、赤目軽減',
'Fired, Trailing-curtain Sync' => 'オン、後幕シンクロ',
'Fired, Wireless (Control)' => 'オン、ワイヤレス(コントロール発光)',
'Fired, Wireless (Master)' => 'オン、ワイヤレス(マスター発光)',
'n/a - Off-Auto-Aperture' => '該当なし-自動絞りオフ',
},
},
'InternalFlashStrength' => '内蔵フラッシュ強度',
'InternalFlashTable' => '内蔵フラッシュテーブル',
'InternalSerialNumber' => '内部シリアル番号',
'InteropIndex' => {
Description => 'インターオペラビリティID',
PrintConv => {
'R03 - DCF option file (Adobe RGB)' => 'R03: DCFオプションファイル(Adobe RGB)',
'R98 - DCF basic file (sRGB)' => 'R98: DCF基本ファイル(sRGB)',
'THM - DCF thumbnail file' => 'THM: DCFサムネイルファイル',
},
},
'InteropOffset' => '互換性IFDへのポインタ',
'InteropVersion' => 'インターオペラビリティバージョン',
'IntervalLength' => 'インターバル長',
'IntervalMode' => 'インターバルモード',
'IntervalNumber' => 'インターバル数',
'JFIFVersion' => 'JFIFバージョン',
'JPEGACTables' => 'JPEG AC テーブル',
'JPEGDCTables' => 'JPEG DC テーブル',
'JPEGLosslessPredictors' => 'JPEGロスレス予測',
'JPEGPointTransforms' => 'JPEG位置変換',
'JPEGProc' => 'JPEG処理',
'JPEGQTables' => 'JPEG Q テーブル',
'JPEGQuality' => {
Description => 'JPEG 品質',
PrintConv => {
'Extra Fine' => 'エクストラファイン',
'Fine' => 'ファイン',
'Standard' => 'ノーマル',
'n/a' => '未設定',
},
},
'JPEGRestartInterval' => 'JPEG再開間隔',
'JPEGTables' => 'JPEGテーブル',
'JobID' => 'ジョブID',
'JpgRecordedPixels' => 'JPEG記録サイズ',
'Keyword' => 'キーワード',
'Keywords' => 'キーワード',
'LC1' => 'レンズデータ',
'LC10' => 'Mv\' nv\' データ',
'LC11' => 'AVC 1/EXP データ',
'LC12' => 'Mv1 Avminsifデータ',
'LC14' => 'UNT_12 UNT_6 データ',
'LC15' => '統合フラッシュ最適エンドデータ',
'LC2' => '距離コードデータ',
'LC3' => 'K値(',
'LC4' => '近距離収差訂正データ',
'LC5' => '明色収差訂正データ',
'LC6' => 'オープン収差データ',
'LC7' => 'AF最低作動状態データ(LC7)',
'LCDDisplayAtPowerOn' => {
Description => '電源スイッチ〈ON〉時の液晶点灯',
PrintConv => {
'Display' => '点灯',
'Retain power off status' => '電源〈OFF〉時の状態を保持',
},
},
'LCDDisplayReturnToShoot' => {
Description => '液晶モニター表示中の撮影状態復帰',
PrintConv => {
'Also with * etc.' => '*ボタンなどでも復帰',
'With Shutter Button only' => 'シャッターボタンでのみ復帰',
},
},
'LCDIllumination' => {
Description => 'LCDイルミネーション',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'LCDIlluminationDuringBulb' => {
Description => 'バルブ撮影中の表示パネル照明',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'LCDPanels' => '上面表示パネル/背面表示パネル',
'LCHEditor' => {
Description => 'LCHエディター',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'LanguageIdentifier' => '言語識別子',
'LastFileNumber' => '最終ファイル番号',
'LeafData' => 'リーフデータ',
'Lens' => 'レンズ',
'Lens35efl' => 'レンズ',
'LensAFStopButton' => {
Description => 'レンズ・AFストップボタンの機能',
PrintConv => {
'AE lock' => 'AEロック',
'AE lock while metering' => 'AEロック(タイマー中)',
'AF Stop' => 'AFストップ',
'AF point: M->Auto/Auto->ctr' => '測距点 任意→自動/自動→中央',
'AF start' => 'AFスタート',
'AF stop' => 'AFストップ',
'IS start' => '手ブレ補正機能作動',
'One Shot <-> AI servo' => 'ワンショット/AIサーボ',
'Switch to registered AF point' => '登録AFフレームへの切り換え',
},
},
'LensApertureRange' => 'レンズ絞り範囲',
'LensData' => 'K値(LC3)',
'LensDistortionParams' => 'レンズ歪曲パラメータ',
'LensDriveNoAF' => {
Description => 'AF測距不能時のレンズ動作',
PrintConv => {
'Focus search off' => '駆動しない',
'Focus search on' => 'サーチ駆動する',
},
},
'LensFStops' => 'レンズF値',
'LensFirmwareVersion' => 'レンズファームウェアバージョン',
'LensID' => 'レンズID',
'LensInfo' => 'レンズ情報',
'LensKind' => 'レンズ種類/バージョン(LC0)',
'LensProperties' => 'レンズ機能?',
'LensSerialNumber' => 'レンズシリアル番号',
'LensSpec' => 'レンズ',
'LensTemperature' => 'レンズ温度',
'LensType' => 'レンズタイプ',
'LicenseType' => {
PrintConv => {
'Unknown' => '不明',
},
},
'LightCondition' => 'ライトコンディション',
'LightReading' => 'ライトリーディング',
'LightSource' => {
Description => '光源',
PrintConv => {
'Cloudy' => '曇り',
'Cool White Fluorescent' => '白色蛍光灯',
'Custom 1-4' => 'カスタム1-4',
'Day White Fluorescent' => '昼白色蛍光灯',
'Daylight' => '昼光',
'Daylight Fluorescent' => '昼光色蛍光灯',
'Fine Weather' => '良い天気',
'Flash' => 'ストロボ',
'Fluorescent' => '蛍光灯',
'ISO Studio Tungsten' => 'ISOスタジオタングステン',
'Other' => 'その他の光源',
'Shade' => '日陰',
'Standard Light A' => '標準ライトA',
'Standard Light B' => '標準ライトB',
'Standard Light C' => '標準ライトC',
'Tungsten (Incandescent)' => 'タングステン(白熱灯)',
'Unknown' => '不明',
'Warm White Fluorescent' => '暖白光色蛍光灯',
'White Fluorescent' => '温白色蛍光灯',
},
},
'LightSourceSpecial' => {
Description => '光源スペシャル',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'Lightness' => '明度',
'LinearResponseLimit' => '線型反応限界',
'LinearizationTable' => '線形化テーブル',
'Lit' => {
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'LiveViewExposureSimulation' => {
Description => 'ライブビュー露出シミュレーション',
PrintConv => {
'Disable (LCD auto adjust)' => 'しない(適正表示)',
'Enable (simulates exposure)' => 'する(撮影露出イメージ表示)',
},
},
'LiveViewShooting' => {
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'LocalizedCameraModel' => '限定カメラモデル',
'Location' => '撮影場所',
'LockMicrophoneButton' => {
Description => 'プロテクト/録音ボタン タンの機能',
PrintConv => {
'Protect (hold:record memo)' => 'プロテクト(長押しで録音)',
'Record memo (protect:disable)' => '録音(プロテクト不可)',
},
},
'LongExposureNoiseReduction' => {
Description => '長秒露光ノイズリダクション',
PrintConv => {
'Auto' => 'オート',
'Off' => 'オフ',
'On' => 'オン',
'n/a' => '未設定',
},
},
'LookupTable' => 'ルックアップテーブル',
'LoopStyle' => {
PrintConv => {
'Normal' => '標準',
},
},
'Luminance' => '輝度',
'LuminanceNoiseReduction' => {
PrintConv => {
'High' => '高い',
'Low' => 'ソフト',
'Off' => 'オフ',
},
},
'MB-D10Batteries' => 'MB-D10電源タイプ',
'MB-D10BatteryType' => 'MB-D10電源タイプ',
'MB-D80Batteries' => 'MB-D80バッテリー',
'MIEVersion' => 'MIEバージョン',
'MIMEType' => 'MIMEタイプ',
'MSStereo' => {
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'Macro' => {
Description => 'マクロ',
PrintConv => {
'Macro' => 'マクロ',
'Manual' => 'マニュアル',
'Normal' => '標準',
'Off' => 'オフ',
'On' => 'オン',
'Super Macro' => 'スーパーマクロ',
'n/a' => '未設定',
},
},
'MacroMode' => {
Description => 'マクロモード',
PrintConv => {
'Macro' => 'マクロ',
'Normal' => 'ノーマル',
'Off' => 'オフ',
'On' => 'オン',
'Super Macro' => 'スーパーマクロ',
'Tele-Macro' => 'テレマクロ',
},
},
'MagnifiedView' => {
Description => '拡大ズーム表示',
PrintConv => {
'Image playback only' => '再生時のみ',
'Image review and playback' => '撮影直後と再生時',
},
},
'MainDialExposureComp' => {
Description => 'Main Dial 露出補正',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'Make' => 'メーカー',
'MakeAndModel' => '作成とモデル',
'MakerNote' => 'DNGプライベートデータ',
'MakerNoteOffset' => 'メーカーノートオフセット',
'MakerNoteSafety' => {
Description => 'メーカーノートセーフティ',
PrintConv => {
'Safe' => '安全',
'Unsafe' => '危険',
},
},
'MakerNoteType' => 'メーカーノートタイプ',
'MakerNoteVersion' => 'メーカーノートバージョン',
'MakerNotes' => 'メーカーノート',
'ManometerPressure' => '気圧計圧力',
'ManometerReading' => '気圧計高度',
'ManualFlash' => 'マニュアルフラッシュ',
'ManualFlashOutput' => {
Description => 'マニュアルフラッシュ出力',
PrintConv => {
'Low' => 'ソフト',
'n/a' => '該当無し',
},
},
'ManualFocusDistance' => 'マニュアルフォーカス距離',
'ManualTv' => {
Description => 'マニュアル露出時Tv、Av値設定',
PrintConv => {
'Tv=Control/Av=Main' => 'Tv値=サブ電子ダイヤル/Av値=メイン電子ダイヤル',
'Tv=Main/Av=Control' => 'Tv値=メイン電子ダイヤル/Av値=サブ電子ダイヤル',
},
},
'ManufactureDate' => '製造日付?',
'MaskedAreas' => 'マスク領域',
'MasterDocumentID' => 'マスタ文書ID',
'MasterGain' => 'マスターゲイン',
'Matteing' => 'マッチング',
'MaxAperture' => '最大絞り',
'MaxApertureAtCurrentFocal' => '現在焦点距離の最大絞り',
'MaxApertureAtMaxFocal' => '最大焦点時最大絞り',
'MaxApertureAtMinFocal' => '最小焦点時最大絞り',
'MaxApertureValue' => '最大レンズ口径',
'MaxContinuousRelease' => '最大連写レリーズ',
'MaxFocalLength' => '最大焦点距離',
'MaxSampleValue' => '最大サンプル値',
'MaximumDensityRange' => '最大密度範囲',
'MeasuredEV' => '計測EV',
'Measurement' => '測定オブザーバー',
'MeasurementBacking' => 'バック測定',
'MeasurementFlare' => 'フレア測定',
'MeasurementGeometry' => '幾何学測定',
'MeasurementIlluminant' => '光源測定',
'MeasurementObserver' => '測定オブザーバー',
'MediaBlackPoint' => 'メディア黒点',
'MediaType' => {
PrintConv => {
'Movie' => '動画',
'Normal' => '標準',
},
},
'MediaWhitePoint' => 'メディア白点',
'Medium' => 'ミドル',
'MenuButtonDisplayPosition' => {
Description => 'メニューの表示位置',
PrintConv => {
'Previous' => '直前のメニュー',
'Previous (top if power off)' => '直前のメニュー(電源切で先頭)',
'Top' => 'メニューの先頭',
},
},
'MenuButtonReturn' => {
PrintConv => {
'Previous' => '直前のメニュー',
'Top' => '上',
},
},
'Metering' => {
Description => '測光',
PrintConv => {
'Center-weighted' => '中央重点',
'Matrix' => '分割',
'Spot' => 'スポット',
},
},
'MeteringMode' => {
Description => '測光モード',
PrintConv => {
'Average' => '平均',
'Center-weighted average' => '中央重点',
'Default' => 'デフォルト',
'Evaluative' => '評価',
'Multi-segment' => 'パターン',
'Multi-spot' => 'マルチスポット',
'Other' => 'その他',
'Partial' => '部分',
'Pattern+AF' => 'パターン+AF',
'Spot' => 'スポット',
'Spot+Highlight control' => 'スポット+ハイライトコントロール',
'Spot+Shadow control' => 'スポット+シャドウコントロール',
'Unknown' => '不明',
},
},
'MeteringMode2' => {
Description => '測光モード2',
PrintConv => {
'Multi-segment' => 'パターン',
},
},
'MeteringMode3' => {
Description => '測光モード3',
PrintConv => {
'Multi-segment' => 'パターン',
},
},
'MeteringTime' => '自動オフタイマー メータオフ時間',
'MinAperture' => '最小絞り',
'MinFocalLength' => '最小焦点距離',
'MinSampleValue' => '最小サンプル値',
'MinoltaCameraSettings2' => 'カメラ設定2',
'MinoltaCameraSettings5D' => 'カメラ設定(5D)',
'MinoltaCameraSettings7D' => 'カメラ設定(7D)',
'MinoltaDate' => '日付',
'MinoltaImageSize' => {
Description => 'イメージサイズ',
PrintConv => {
'Full' => 'フル',
'Large' => 'ラージ',
'Medium' => 'ミドル',
'Small' => 'スモール',
},
},
'MinoltaMakerNote' => 'ミノルタメーカーノート',
'MinoltaModelID' => 'モデルID',
'MinoltaQuality' => {
Description => 'イメージ品質',
PrintConv => {
'Economy' => 'エコノミー',
'Extra Fine' => 'エクストラファイン',
'Extra fine' => 'エクストラファイン',
'Fine' => 'ファイン',
'Normal' => '標準',
'Standard' => 'スタンダード',
'Super Fine' => 'スーパーファイン',
},
},
'MinoltaTime' => '時間',
'MirrorLockup' => {
Description => 'ミラーアップ撮影',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
'Enable: Down with Set' => 'する(SETボタンでダウン)',
},
},
'Model' => '画像入力機器モデル',
'Model2' => '画像入力機器モデル(2)',
'ModelTiePoint' => 'モデル拘束ポイントタグ',
'ModelTransform' => 'モデル変化タグ',
'ModelingFlash' => {
Description => 'モデリングフラッシュ',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ModifiedPictureStyle' => {
PrintConv => {
'CM Set 1' => 'CMセット1',
'CM Set 2' => 'CMセット2',
'Faithful' => '忠実設定',
'High Saturation' => '高彩度',
'Landscape' => '風景',
'Low Saturation' => '低彩度',
'Monochrome' => 'モノトーン',
'Neutral' => 'ニュートラル',
'None' => '無し',
'Portrait' => 'ポートレート',
'Standard' => 'スタンダード',
'User Def. 1' => 'ユーザ設定1',
'User Def. 2' => 'ユーザ設定2',
'User Def. 3' => 'ユーザ設定3',
},
},
'ModifiedSaturation' => {
Description => '彩度修正',
PrintConv => {
'CM1 (Red Enhance)' => 'CM1 (赤増)',
'CM2 (Green Enhance)' => 'CM2 (緑増)',
'CM3 (Blue Enhance)' => 'CM3 (青増)',
'CM4 (Skin Tones)' => 'CM4 (肌色増)',
'Off' => 'オフ',
},
},
'ModifiedSharpnessFreq' => {
PrintConv => {
'High' => '高い',
'Low' => 'ソフト',
'Standard' => 'スタンダード',
'n/a' => '該当無し',
},
},
'ModifiedToneCurve' => {
PrintConv => {
'Custom' => 'カスタム',
'Manual' => 'マニュアル',
'Standard' => 'スタンダード',
},
},
'ModifiedWhiteBalance' => {
PrintConv => {
'Auto' => 'オート',
'Black & White' => '白黒',
'Cloudy' => '曇り',
'Custom' => 'カスタム',
'Custom 1' => 'カスタム1',
'Custom 2' => 'カスタム2',
'Custom 3' => 'カスタム3',
'Custom 4' => 'カスタム4',
'Daylight' => '昼光',
'Daylight Fluorescent' => '昼光色蛍光灯',
'Flash' => 'ストロボ',
'Fluorescent' => '蛍光灯',
'Manual Temperature (Kelvin)' => 'マニュアル白熱灯(ケルビン)',
'PC Set1' => 'PC設定1',
'PC Set2' => 'PC設定2',
'PC Set3' => 'PC設定3',
'PC Set4' => 'PC設定4',
'PC Set5' => 'PC設定5',
'Shade' => '日陰',
'Tungsten' => 'タングステン(白熱灯)',
'Underwater' => '水中',
},
},
'ModifyDate' => 'ファイル作成日時',
'MoireFilter' => {
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'MonitorOffTime' => 'モニターオフ遅延時間',
'MonochromeFilterEffect' => {
PrintConv => {
'Green' => '緑',
'None' => '無し',
'Orange' => 'オレンジ',
'Red' => '赤',
'Yellow' => '黄色',
},
},
'MonochromeLinear' => {
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'MonochromeToningEffect' => {
PrintConv => {
'Blue' => '青',
'Green' => '緑',
'None' => '無し',
'Purple' => '紫',
'Sepia' => 'セピア',
},
},
'MultiExposure' => '多重露出データ',
'MultiExposureAutoGain' => {
Description => '多重露出自動ゲイン',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'MultiExposureMode' => {
Description => '多重露出モード',
PrintConv => {
'Image Overlay' => 'イメージオーバーレイ',
'Multiple Exposure' => '多重露出',
'Off' => 'オフ',
},
},
'MultiExposureShots' => '多重露出ショット',
'MultiExposureVersion' => '多重露出データバージョン',
'MultiFrameNoiseReduction' => {
Description => 'マルチショットノイズリダクション',
PrintConv => {
'Off' => '切',
'On' => '入',
},
},
'MultiSample' => 'マルチサンプル',
'MultiSelector' => {
Description => 'マルチ選択',
PrintConv => {
'Do Nothing' => '何もしない',
'Reset Meter-off Delay' => 'メーターオフ遅延時間リセット',
},
},
'MultiSelectorPlaybackMode' => {
Description => 'マルチ選択 再生モード',
PrintConv => {
'Choose Folder' => 'フォルダー選択',
'Thumbnail On/Off' => 'サムネイル オン/オフ',
'View Histograms' => 'ヒストグラム表示',
'Zoom On/Off' => 'ズーム オン/オフ',
},
},
'MultiSelectorShootMode' => {
Description => 'マルチ選択 撮影モード',
PrintConv => {
'Highlight Active Focus Point' => 'ハイライトアクティブフォーカスポイント',
'Not Used' => '未使用',
'Select Center Focus Point' => '中央フォーカスポイント選択',
},
},
'MultipleExposureSet' => {
Description => '多重露出設定',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'Mute' => {
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'MyColorMode' => {
Description => 'マイカラーモード',
PrintConv => {
'B&W' => '白黒',
'Color Accent' => 'カラーアクセント',
'Color Swap' => 'スイッチカラー',
'Custom' => 'カスタム',
'Dark Skin Tone' => 'ダークスキン調',
'Light Skin Tone' => 'ライトスカイ調',
'Neutral' => 'ニュートラル',
'Off' => 'オフ',
'Positive Film' => 'ポジフィルム',
'Sepia' => 'セピア',
'Vivid' => 'ビビッド',
'Vivid Blue' => 'ビビッド青',
'Vivid Green' => 'ビビッド緑',
'Vivid Red' => 'ビビッド赤',
},
},
'MyColors' => 'マイカラーモード',
'NDFilter' => {
Description => 'NDフィルター',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'NEFCompression' => {
Description => 'RAW圧縮',
PrintConv => {
'Lossless' => 'ロスレス',
'Lossy (type 1)' => '圧縮(タイプ1)',
'Lossy (type 2)' => '圧縮(タイプ2)',
'Uncompressed' => '非圧縮',
},
},
'NEFLinearizationTable' => '線形化表',
'NamedColor2' => '色名称2',
'NativeDisplayInfo' => 'ネイティブディスプレイ情報',
'NewsPhotoVersion' => '報道写真レコードバージョン',
'NikonCaptureData' => 'ニコンキャプチャーデータ',
'NikonCaptureOffsets' => 'ニコンキャプチャーオフセット',
'NikonCaptureVersion' => 'ニコンキャプチャーバージョン',
'NoMemoryCard' => {
Description => 'メモリーカード無し',
PrintConv => {
'Enable Release' => 'レリーズ可能',
'Release Locked' => 'レリーズロック',
},
},
'Noise' => 'ノイズ',
'NoiseFilter' => {
Description => 'ピクチャーモードノイズフィルター',
PrintConv => {
'High' => '高い',
'Low' => 'ソフト',
'Off' => 'オフ',
'Standard' => 'スタンダード',
},
},
'NoiseReduction' => {
Description => 'ノイズリダクション',
PrintConv => {
'Auto' => 'オート',
'Low' => '低い',
'Normal' => '標準',
'Off' => 'オフ',
'On' => 'オン',
'Standard' => 'スタンダード',
},
},
'NoiseReduction2' => 'ノイズリダクション2',
'NoiseReductionApplied' => '適用ノイズリダクション',
'NoiseReductionData' => 'ノイズリダクションデータ',
'NoiseReductionIntensity' => 'ノイズリダクション強度',
'NoiseReductionMethod' => 'ノイズリダクション方法',
'NoiseReductionSharpness' => 'ノイズリダクションシャープネス',
'NominalMaxAperture' => '最大絞り',
'NominalMinAperture' => '最小絞り',
'NumAFPoints' => 'AFポイント番号',
'NumIndexEntries' => 'インデックスエントリ数',
'NumberofInks' => 'インク番号',
'OPIProxy' => 'OPIプロキシー',
'ObjectAttributeReference' => 'インテリジャンル',
'ObjectCycle' => 'オブジェクトサイクル',
'ObjectDistance' => '被写体との距離',
'ObjectFileType' => {
PrintConv => {
'None' => '無し',
'Unknown' => '不明',
},
},
'ObjectName' => 'タイトル',
'ObjectPreviewData' => 'オブジェクトデータプレビューデータ',
'ObjectPreviewFileFormat' => 'オブジェクトデータプレビューファイル形式',
'ObjectPreviewFileVersion' => 'オブジェクトデータプレビューファイル形式バージョン',
'ObjectTypeReference' => 'オブジェクトタイプ参照',
'OffsetSchema' => 'オフセットの概要',
'OlympusImageHeight' => 'イメージ高',
'OlympusImageWidth' => 'イメージ幅',
'OneTouchWB' => {
Description => 'ワンタッチホワイトバランス',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
'On (Preset)' => 'オン(プリセット)',
},
},
'OpticalZoomCode' => '光学ズームコード',
'OpticalZoomMode' => {
Description => '光学ズームモード',
PrintConv => {
'Extended' => 'EX光学',
'Standard' => 'スタンダード',
},
},
'OpticalZoomOn' => {
Description => '光学ズームオン',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'Opto-ElectricConvFactor' => '光電交換関数',
'OrderNumber' => 'オーダー番号',
'Orientation' => {
Description => '画像の向き',
PrintConv => {
'Horizontal (normal)' => '水平(標準)',
'Rotate 180' => '180度回転',
'Rotate 270 CW' => '270度回転 CW',
'Rotate 90 CW' => '90度回転 CW',
},
},
'OriginalDecisionDataOffset' => 'オリジナル決定データオフセット',
'OriginalRawFileData' => 'オリジナルRAWファイルデータ',
'OriginalRawFileDigest' => 'オリジナルRAWファイル要約',
'OriginalRawFileName' => 'オリジナルRAWファイル名',
'OriginalTransmissionReference' => '作業識別子',
'OriginatingProgram' => '開始プログラム',
'OutputResponse' => '出力反応',
'OwnerID' => 'オーナーID',
'OwnerName' => 'オーナー名',
'PEFVersion' => 'PEFバージョン',
'Padding' => '引き伸ばし',
'PageName' => 'ページ名',
'PageNumber' => 'ページ番号',
'PanasonicExifVersion' => 'パナソニックExifバージョン',
'PanasonicRawVersion' => 'パナソニックRAWバージョン',
'PanasonicTitle' => 'タイトル',
'PanoramaDirection' => 'F値',
'PanoramaMode' => 'パノラマモード',
'PentaxImageSize' => 'ペンタックスイメージサイズ',
'PentaxModelID' => 'ペンタックスモデル',
'PentaxVersion' => 'ペンタックスバージョン',
'People' => '人々',
'PhaseDetectAF' => {
Description => 'オートフォーカス',
PrintConv => {
'Off' => 'オフ',
'On (51-point)' => 'オン',
},
},
'PhotoEffect' => {
Description => '写真効果',
PrintConv => {
'B&W' => '白黒',
'Custom' => 'カスタム',
'Neutral' => 'ニュートラル',
'Off' => 'オフ',
'Sepia' => 'セピア',
'Vivid' => 'ビビッド',
},
},
'PhotoEffects' => {
Description => 'フォトエフェクト',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'PhotoEffectsBlue' => 'フォトエフェクト青',
'PhotoEffectsData' => 'フォトエフェクトデータ',
'PhotoEffectsGreen' => 'フォトエフェクト緑',
'PhotoEffectsRed' => 'フォトエフェクト赤',
'PhotoEffectsType' => {
Description => 'フォトエフェクトタイプ',
PrintConv => {
'B&W' => '白黒',
'None' => '無し',
'Sepia' => 'セピア',
'Tinted' => '淡調',
},
},
'PhotoInfoPlayback' => {
Description => '写真情報/再生',
PrintConv => {
'Info Left-right, Playback Up-down' => '情報<>/再生',
'Info Up-down, Playback Left-right' => '情報/再生<>',
},
},
'PhotometricInterpretation' => {
Description => 'ピクセル形式',
PrintConv => {
'BlackIsZero' => '黒はゼロ',
'Color Filter Array' => 'CFA (カラーフィルターマトリックス)',
'Pixar LogL' => 'CIE Log2(L) (ログ輝度)',
'Pixar LogLuv' => 'CIE Log2(L)(u\',v\') (ログ輝度と基準色)',
'RGB Palette' => 'パレット色',
'Transparency Mask' => '透明度マスク',
'WhiteIsZero' => '白はゼロ',
},
},
'PhotoshopAnnotations' => 'フォトショップ注釈',
'PhotoshopFormat' => {
PrintConv => {
'Standard' => 'スタンダード',
},
},
'PictInfo' => '写真情報',
'PictureControl' => {
Description => 'ピクチャーコントロール',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'PictureControlActive' => {
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'PictureControlAdjust' => {
Description => 'ピクチャーコントロール調整',
PrintConv => {
'Default Settings' => 'デフォルト設定',
'Full Control' => 'フルコントロール',
'Quick Adjust' => 'クイック調整',
},
},
'PictureControlBase' => 'ピクチャーコントロールベース',
'PictureControlName' => 'ピクチャーコントロール名',
'PictureControlQuickAdjust' => 'ピクチャーコントロールクイック調整',
'PictureControlVersion' => 'ピクチャーコントロールバージョン',
'PictureFinish' => {
Description => 'ピクチャーフィニッシュ',
PrintConv => {
'Monochrome' => 'モノトーン',
'Natural' => 'ナチュラル',
'Night Portrait' => '人物夜景',
'Night Scene' => '夜景',
'Portrait' => 'ポートレート',
},
},
'PictureMode' => {
Description => 'ピクチャーモード',
PrintConv => {
'1/2 EV steps' => '1/2 EVステップ',
'1/3 EV steps' => '1/3 EVステップ',
'Anti-blur' => '手振れ補正',
'Aperture Priority' => '絞り優先',
'Aperture Priority, Off-Auto-Aperture' => '絞り優先(自動絞りOFF)',
'Aperture-priority AE' => '絞り優先',
'Auto' => 'オート',
'Auto PICT (Landscape)' => 'オートピクチャー(風景)',
'Auto PICT (Macro)' => 'オートピクチャー(マクロ)',
'Auto PICT (Portrait)' => 'オートピクチャー(ポートレート)',
'Auto PICT (Sport)' => 'オートピクチャー(スポーツ)',
'Auto PICT (Standard)' => 'オートピクチャー(標準)',
'Autumn' => '秋',
'Beach' => 'ビーチ',
'Beach & Snow' => 'ビーチ&スノー',
'Blur Reduction' => 'Digital SR',
'Bulb' => 'バルブ',
'Bulb, Off-Auto-Aperture' => 'バルブ(自動絞りOFF)',
'Candlelight' => 'キャンドルライト',
'DOF Program' => '深度優先プログラム',
'DOF Program (HyP)' => '深度優先プログラム(ハイパープログラム)',
'Dark Pet' => 'ペット黒色',
'Digital Filter' => 'デジタルフィルター',
'Fireworks' => '花火',
'Flash X-Sync Speed AE' => 'ストロボ同調速度AE',
'Flower' => '花',
'Food' => '料理',
'Frame Composite' => 'フレーム合成',
'Green Mode' => 'グリーンモード',
'Hi-speed Program' => '高速優先プログラム',
'Hi-speed Program (HyP)' => '高速優先プログラム(ハイパープログラム)',
'Illustrations' => 'イラスト',
'Kids' => 'キッズ',
'Landscape' => '風景',
'Light Pet' => 'ペット白色',
'MTF Program' => 'MTF優先プログラム',
'MTF Program (HyP)' => 'MTF優先プログラム(ハイパープログラム)',
'Macro' => 'マクロ',
'Manual' => 'マニュアル',
'Manual, Off-Auto-Aperture' => 'マニュアル(自動絞りOFF)',
'Medium Pet' => 'ペット灰色',
'Monotone' => 'モノトーン',
'Museum' => '美術館',
'Muted' => '弱める',
'Natural' => 'ナチュラル',
'Natural Light' => 'ナチュラルフォト',
'Natural Light & Flash' => 'ナチュラルフォト&フラッシュ',
'Natural Skin Tone' => '美肌',
'Night Scene' => '夜景',
'Night Scene Portrait' => '人物、夜景',
'No Flash' => 'フラッシュ無し',
'Panorama' => 'パノラマ',
'Party' => 'パーティ',
'Pet' => 'ペット',
'Portrait' => 'ポートレート',
'Program' => 'プログラム',
'Program (HyP)' => 'プログラムAE(ハイパープログラム)',
'Program AE' => 'プログラムAE',
'Program Av Shift' => 'プログラムAvシフト',
'Program Tv Shift' => 'プログラムTvシフト',
'Self Portrait' => '自分撮り',
'Sensitivity Priority AE' => '感度優先AE',
'Sepia' => 'セピア',
'Shutter & Aperture Priority AE' => 'シャッター&絞り優先AE',
'Shutter Speed Priority' => 'シャッター優先',
'Shutter speed priority AE' => 'シャッター優先',
'Snow' => 'スノー',
'Soft' => 'ソフト',
'Sport' => 'スポーツ',
'Sports' => 'スポーツ',
'Standard' => 'スタンダード',
'Sunset' => '夕日',
'Surf & Snow' => 'サーフ&スノー',
'Synchro Sound Record' => 'ボイスレコーディング',
'Text' => 'テキスト',
'Underwater' => '水中',
'Vivid' => 'ビビッド',
},
},
'PictureMode2' => {
Description => 'ピクチャーモード 2',
PrintConv => {
'Aperture Priority' => '絞り優先',
'Aperture Priority, Off-Auto-Aperture' => '絞り優先(自動絞りオフ)',
'Auto PICT' => 'オートピクチャ',
'Bulb' => 'バルブ',
'Bulb, Off-Auto-Aperture' => 'バルブ(自動絞りオフ)',
'Flash X-Sync Speed AE' => 'ストロボ同調速度AE',
'Green Mode' => 'グリーンモード',
'Manual' => 'マニュアル',
'Manual, Off-Auto-Aperture' => 'マニュアル(自動絞りオフ)',
'Program AE' => 'プログラムAE',
'Program Av Shift' => 'プログラムAvシフト',
'Program Tv Shift' => 'プログラムTvシフト',
'Scene Mode' => 'シーンモード',
'Sensitivity Priority AE' => '感度優先AE',
'Shutter & Aperture Priority AE' => 'シャッター&絞り優先AE',
'Shutter Speed Priority' => 'シャッター優先',
},
},
'PictureModeBWFilter' => {
Description => 'ピクチャーモードBWフィルター',
PrintConv => {
'Green' => '緑',
'Neutral' => 'ニュートラル',
'Orange' => 'オレンジ',
'Red' => '赤',
'Yellow' => '黄色',
'n/a' => '該当無し',
},
},
'PictureModeContrast' => 'ピクチャーモードコントラスト',
'PictureModeHue' => 'ピクチャーモード色相?',
'PictureModeSaturation' => 'ピクチャーモード彩度',
'PictureModeSharpness' => 'ピクチャーモードシャープネス',
'PictureModeTone' => {
Description => 'ピクチャーモードトーン',
PrintConv => {
'Blue' => '青',
'Green' => '緑',
'Neutral' => 'ニュートラル',
'Purple' => '紫',
'Sepia' => 'セピア',
'n/a' => '該当無し',
},
},
'PictureStyle' => {
Description => 'ピクチャースタイル',
PrintConv => {
'CM Set 1' => 'CMセット1',
'CM Set 2' => 'CMセット2',
'Faithful' => '忠実設定',
'High Saturation' => '高彩度',
'Landscape' => '風景',
'Low Saturation' => '低彩度',
'Monochrome' => 'モノトーン',
'Neutral' => 'ニュートラル',
'None' => '無し',
'Portrait' => 'ポートレート',
'Standard' => 'スタンダード',
'User Def. 1' => 'ユーザ設定1',
'User Def. 2' => 'ユーザ設定2',
'User Def. 3' => 'ユーザ設定3',
},
},
'PixelFormat' => {
Description => 'ピクセルフォーマット',
PrintConv => {
'Black & White' => '白黒',
},
},
'PixelIntensityRange' => 'ピクセル強度範囲',
'PixelScale' => 'モデル画素スケールタグ',
'PixelUnits' => {
PrintConv => {
'Unknown' => '不明',
},
},
'PlanarConfiguration' => {
Description => '画像データの並び',
PrintConv => {
'Chunky' => '点順次形式 (重ね合わせ)',
'Planar' => '平面形式',
},
},
'PowerSource' => {
Description => '電源',
PrintConv => {
'Body Battery' => '本体電源',
'External Power Supply' => '外部電源',
'Grip Battery' => 'バッテリーグリップ',
},
},
'PreCaptureFrames' => 'プレキャプチャーフレーム',
'Predictor' => '指標',
'Preview' => 'プレビューIFDポインター',
'Preview0' => 'プレビュー0',
'Preview1' => 'プレビュー1',
'Preview2' => 'プレビュー2',
'PreviewApplicationName' => 'プレビューアプリケーション名',
'PreviewApplicationVersion' => 'プレビューアプリケーションバージョン',
'PreviewColorSpace' => {
Description => 'プレビュー色空間',
PrintConv => {
'Unknown' => '不明',
},
},
'PreviewDateTime' => 'プレビュー日時',
'PreviewIFD' => 'プレビューIFDポインター',
'PreviewImage' => 'プレビューイメージ',
'PreviewImageBorders' => 'プレビュー画像境界',
'PreviewImageData' => 'プレビュー画像データ',
'PreviewImageLength' => 'プレビューイメージ容量',
'PreviewImageSize' => 'プレビューイメージサイズ',
'PreviewImageStart' => 'プレビューイメージ開始',
'PreviewImageValid' => {
Description => '有効プレビュー画像',
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'PreviewQuality' => {
PrintConv => {
'Economy' => 'エコノミー',
'Fine' => 'ファイン',
'Normal' => '標準',
'Normal Movie' => '標準動画',
'Superfine' => 'S.ファイン',
},
},
'PreviewSettingsDigest' => 'プレビュー設定要約',
'PreviewSettingsName' => 'プレビュー設定名',
'PrimaryAFPoint' => {
Description => 'プライマリAFポイント',
PrintConv => {
'Bottom' => '下',
'C6 (Center)' => 'C6 (中央)',
'Center' => '中央',
'Mid-left' => '中央左',
'Mid-right' => '中央右',
'Top' => '上',
},
},
'PrimaryChromaticities' => '原色色度',
'PrimaryPlatform' => '主要プラットフォーム',
'PrintIM' => 'プリントイメージマッチング',
'ProcessingSoftware' => '処理ソフトウェア',
'ProductID' => '製品ID',
'ProductionCode' => 'カメラが修理されたか?',
'ProfileCMMType' => 'CMMタイププロフィール',
'ProfileCalibrationSig' => 'プロフィールキャリブレーションサイン',
'ProfileClass' => {
Description => 'プロフィールクラス',
PrintConv => {
'Abstract Profile' => '抜粋プロフィール',
'ColorSpace Conversion Profile' => '色空間変換プロフィール',
'DeviceLink Profile' => 'デバイスリンクプロフィール',
'Display Device Profile' => '表示装置プロフィール',
'Input Device Profile' => '入力装置プロフィール',
'NamedColor Profile' => '色名称プロフィール',
'Nikon Input Device Profile (NON-STANDARD!)' => 'ニコンプロフィール("nkpf")',
'Output Device Profile' => '出力装置プロフィール',
},
},
'ProfileConnectionSpace' => '接続スペースプロフィール',
'ProfileCopyright' => 'プロフィール著作権',
'ProfileCreator' => 'プロフィール製作者',
'ProfileDateTime' => 'プロフィール日時',
'ProfileDescription' => 'プロフィール説明',
'ProfileDescriptionML' => 'プロフィール説明ML',
'ProfileEmbedPolicy' => {
Description => 'プロフィール埋め込み方針',
PrintConv => {
'Allow Copying' => 'コピー許可',
'Embed if Used' => '埋め込み使用',
'Never Embed' => '埋め込み禁止',
'No Restrictions' => '無制限',
},
},
'ProfileFileSignature' => 'プロフィールファイルシグネーチャ',
'ProfileHueSatMapData1' => '色相Sat.マップデータプロフィール1',
'ProfileHueSatMapData2' => '色相Sat.マップデータプロフィール2',
'ProfileHueSatMapDims' => '色境界',
'ProfileID' => 'プロフィールID',
'ProfileLookTableData' => '表示テーブルデータプロフィール',
'ProfileLookTableDims' => '色境界',
'ProfileName' => 'プロフィール名',
'ProfileSequenceDesc' => 'プロフィールシーケンス説明',
'ProfileToneCurve' => 'トーンカーブプロフィール',
'ProfileVersion' => 'プロフィールバージョン',
'ProgramISO' => 'プログラムISO',
'ProgramLine' => {
Description => 'プログラムライン',
PrintConv => {
'Depth' => '深度優先',
'Hi Speed' => '高速優先',
'MTF' => 'MTF優先',
'Normal' => 'ノーマル',
},
},
'ProgramMode' => {
PrintConv => {
'Night Portrait' => '人物夜景',
'None' => '無し',
'Portrait' => 'ポートレート',
'Sports' => 'スポーツ',
'Sunset' => '夕日',
'Text' => 'テキスト',
},
},
'ProgramShift' => 'プログラムシフト',
'ProgramVersion' => 'プログラムバージョン',
'Province-State' => '行政区/州',
'Quality' => {
Description => '品質',
PrintConv => {
'Best' => 'S.ファイン',
'Better' => 'ファイン',
'Compressed RAW' => 'cRAW',
'Compressed RAW + JPEG' => 'cRAW+JPEG',
'Economy' => 'エコノミー',
'Extra Fine' => 'エクストラファイン',
'Fine' => 'ファイン',
'Good' => 'エコノミー',
'Low' => '低画質',
'Normal' => 'ノーマル',
'Premium' => 'プレミアム',
'RAW + JPEG' => 'RAW+JPEG',
'Standard' => 'スタンダード',
'n/a' => '未設定',
},
},
'QualityMode' => {
Description => '品質モード',
PrintConv => {
'Economy' => 'エコノミー',
'Fine' => 'ファイン',
'Normal' => 'ノーマル',
},
},
'QuantizationMethod' => '量子化方法',
'QuickAdjust' => 'クイック調整',
'QuickControlDialInMeter' => {
Description => '測光タイマー中のサブ電子ダイヤル',
PrintConv => {
'AF point selection' => 'AFフレーム選択',
'Exposure comp/Aperture' => '露出補正/絞り数値',
'ISO speed' => 'ISO感度',
},
},
'QuickShot' => {
Description => 'クイックショット',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'RAFVersion' => 'RAFバージョン',
'ROCInfo' => 'ROC情報',
'RasterPadding' => 'ラスタパディング',
'RasterizedCaption' => 'ラスタ化表題',
'Rating' => '格付け',
'RatingPercent' => '格付け(%)',
'RawAndJpgRecording' => {
Description => 'RAWとJPEG記録',
PrintConv => {
'RAW+Large/Fine' => 'RAW+ラージ/ファイン',
'RAW+Large/Normal' => 'RAW+ラージ/ノーマル',
'RAW+Medium/Fine' => 'RAW+ミドル/ファイン',
'RAW+Medium/Normal' => 'RAW+ミドル/ノーマル',
'RAW+Small/Fine' => 'RAW+スモール/ファイン',
'RAW+Small/Normal' => 'RAW+スモール/ノーマル',
},
},
'RawColorAdj' => {
PrintConv => {
'Custom' => 'カスタム',
'Faithful' => '忠実設定',
},
},
'RawDataOffset' => 'RAWデータオフセット',
'RawDataUniqueID' => 'RAWデータユニークID',
'RawDevAutoGradation' => {
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'RawDevColorSpace' => '色空間',
'RawDevContrastValue' => 'コントラスト値',
'RawDevEditStatus' => {
Description => '編集状態',
PrintConv => {
'Edited (Landscape)' => 'スタジオ(風景)',
'Edited (Portrait)' => 'スタジオ(ポートレート)',
'Original' => 'オリジナル',
},
},
'RawDevEngine' => {
Description => 'エンジン',
PrintConv => {
'Advanced High Speed' => 'アドバンス高速',
'High Function' => '高機能',
'High Speed' => '高速',
},
},
'RawDevExposureBiasValue' => '露出バイアス値',
'RawDevGrayPoint' => 'グレーポイント',
'RawDevMemoryColorEmphasis' => '記憶色強調',
'RawDevNoiseReduction' => 'ノイズフィルター(増感)',
'RawDevPMPictureTone' => {
PrintConv => {
'Blue' => '青',
'Green' => '緑',
'Neutral' => 'ニュートラル',
'Purple' => '紫',
'Sepia' => 'セピア',
},
},
'RawDevPM_BWFilter' => {
PrintConv => {
'Green' => '緑',
'Neutral' => 'ニュートラル',
'Orange' => 'オレンジ',
'Red' => '赤',
'Yellow' => '黄色',
},
},
'RawDevPictureMode' => {
PrintConv => {
'Natural' => 'ナチュラル',
'Sepia' => 'セピア',
'Vivid' => 'ビビッド',
},
},
'RawDevSaturationEmphasis' => '彩度強調',
'RawDevSettings' => 'ノイズリダクション',
'RawDevSharpnessValue' => 'コントラスト値',
'RawDevVersion' => 'RAW展開バージョン',
'RawDevWBFineAdjustment' => 'ホワイトバランス微調整',
'RawDevWhiteBalance' => {
PrintConv => {
'Color Temperature' => '色温度',
},
},
'RawDevWhiteBalanceValue' => 'ホワイトバランス値',
'RawImageCenter' => 'RAWイメージセンター',
'RawImageDigest' => 'RAWイメージ要約',
'RawImageHeight' => 'イメージ高さ',
'RawImageSegmentation' => 'RAWイメージ部分番号',
'RawImageSize' => 'RAWイメージサイズ',
'RawImageWidth' => 'イメージ幅',
'RawInfoVersion' => 'RAW情報バージョン',
'RawJpgQuality' => {
Description => 'RAW JPEG 品質',
PrintConv => {
'Economy' => 'エコノミー',
'Fine' => 'ファイン',
'Normal' => '標準',
'Normal Movie' => '標準動画',
'Superfine' => 'S.ファイン',
},
},
'RawJpgSize' => {
Description => 'RAW JPEG サイズ',
PrintConv => {
'Large' => 'ラージ',
'Medium' => 'ミドル',
'Medium 1' => 'ミドル1',
'Medium 2' => 'ミドル2',
'Medium 3' => 'ミドル3',
'Medium Movie' => 'ミディアム動画',
'Postcard' => 'ハガキ',
'Small' => 'スモール',
'Small Movie' => 'スモール動画',
'Widescreen' => 'ワイド画面',
},
},
'RecordMode' => {
Description => '記録モード',
PrintConv => {
'Aperture Priority' => '絞り優先',
'Best Shot' => 'ベストショット',
'Manual' => 'マニュアル',
'Movie' => '動画',
'Movie (19)' => '動画(19)',
'Program AE' => 'プログラムAE',
'Shutter Priority' => 'シャッター優先',
'YouTube Movie' => 'YouTube動画',
},
},
'RecordShutterRelease' => 'レコードシャッターレリーズ',
'RecordingMode' => {
Description => '記録モード',
PrintConv => {
'Auto' => 'オート',
'Landscape' => '風景',
'Manual' => 'マニュアル',
'Night Scene' => '夜景',
'Panorama' => 'パノラマ',
'Portrait' => 'ポートレート',
'Single Shutter' => 'シングルシャッター',
},
},
'RedBalance' => 'レッドバランス',
'RedEyeCorrection' => {
PrintConv => {
'Automatic' => 'オート',
'Off' => 'オフ',
},
},
'RedEyeData' => '赤目データ',
'RedEyeReduction' => {
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'RedMatrixColumn' => '赤色マトリックス列',
'RedTRC' => '赤色調増殖曲線',
'ReductionMatrix1' => '縮小マトリックス1',
'ReductionMatrix2' => '縮小マトリックス2',
'ReferenceBlackWhite' => '白黒の基準値の一組',
'ReferenceDate' => '参照日付',
'ReferenceNumber' => '参照数',
'ReferenceService' => '参照サービス',
'RelatedImageFileFormat' => '関連イメージファイル形式',
'RelatedImageHeight' => '関連イメージ高',
'RelatedImageWidth' => '関連イメージ幅',
'RelatedSoundFile' => '関連オーディオファイル',
'ReleaseButtonToUseDial' => {
Description => 'レリーズボタンから使用ダイヤル',
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'ReleaseDate' => 'リリース日付',
'ReleaseTime' => 'リリース時間',
'RemoteOnDuration' => 'リモート持続時間',
'RenderingIntent' => {
Description => '意思表現',
PrintConv => {
'ICC-Absolute Colorimetric' => '絶対比色分析',
'Media-Relative Colorimetric' => '相対比色分析',
'Perceptual' => '知覚的',
'Saturation' => '飽和',
},
},
'RepeatingFlashCount' => 'リピーティングフラッシュ 時間',
'RepeatingFlashOutput' => 'リピーティングフラッシュ 出力',
'RepeatingFlashRate' => 'リピーティングフラッシュ 周波数',
'ResampleParamsQuality' => {
PrintConv => {
'High' => '高い',
'Low' => 'ソフト',
},
},
'Resaved' => {
Description => '予約',
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'ResolutionMode' => '解像度モード',
'ResolutionUnit' => {
Description => 'XとY解像度単位',
PrintConv => {
'None' => '無し',
'cm' => 'ピクセル/cm',
'inches' => 'インチ',
},
},
'RetouchHistory' => {
Description => 'レタッチ履歴',
PrintConv => {
'None' => '無し',
'Sepia' => 'セピア',
},
},
'ReverseIndicators' => '指標逆転',
'Rotation' => {
Description => '回転',
PrintConv => {
'Horizontal' => '水平(標準)',
'Horizontal (Normal)' => '水平(標準)',
'Horizontal (normal)' => '水平(標準)',
'Rotate 180' => '180度回転',
'Rotate 270 CW' => '270度回転 CW',
'Rotate 90 CW' => '90度回転 CW',
'Rotated 180' => '180度回転',
'Rotated 270 CW' => '270度回転 CW',
'Rotated 90 CW' => '90度回転 CW',
},
},
'RowInterleaveFactor' => '列を挟む要因',
'RowsPerStrip' => '1片の列数',
'SMaxSampleValue' => 'S 最大サンプル値',
'SMinSampleValue' => 'S 最小サンプル値',
'SPIFFVersion' => 'SPIFFバージョン',
'SRAWQuality' => {
PrintConv => {
'n/a' => '該当無し',
},
},
'SRActive' => {
Description => '手ぶれ補正状態',
PrintConv => {
'No' => 'オフ',
'Yes' => 'オン',
},
},
'SRFocalLength' => 'SR焦点距離',
'SRHalfPressTime' => 'シャッター半押し時間',
'SRResult' => {
Description => 'SR効果',
PrintConv => {
'Not stabilized' => 'なし',
},
},
'SVGVersion' => 'SVGバージョン',
'SafetyShift' => {
Description => 'セイフティシフト',
PrintConv => {
'Disable' => 'しない',
'Enable (ISO speed)' => 'する(ISO感度)',
'Enable (Tv/Av)' => 'する(Tv/Av値)',
},
},
'SafetyShiftInAvOrTv' => {
Description => 'セイフティシフトの設定',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
},
},
'SampleFormat' => 'サンプル形式',
'SampleStructure' => 'サンプリング構造',
'SamplesPerPixel' => 'コンポーネント数',
'SanyoQuality' => 'サンヨー品質',
'SanyoThumbnail' => 'サンヨーサムネイル',
'Saturation' => {
Description => '彩度',
PrintConv => {
'Film Simulation' => 'フィルムシミュレーション',
'High' => '高い彩度',
'Low' => '低い彩度',
'Med High' => '少し高い',
'Med Low' => '少し低い',
'Medium High' => '少し高い',
'Medium Low' => '少し低い',
'None' => '未設定',
'None (B&W)' => '無し(黒&白)',
'Normal' => '標準',
'Very High' => 'かなり高い',
'Very Low' => 'かなり低い',
},
},
'SaturationFaithful' => '彩度忠実設定',
'SaturationLandscape' => '彩度風景',
'SaturationNeutral' => '彩度ニュートラル',
'SaturationPortrait' => '彩度ポートレート',
'SaturationSetting' => '彩度設定',
'SaturationStandard' => '彩度スタンダード',
'SaturationUserDef1' => '彩度ユーザ設定1',
'SaturationUserDef2' => '彩度ユーザ設定2',
'SaturationUserDef3' => '彩度ユーザ設定3',
'ScanImageEnhancer' => {
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ScanningDirection' => '走査方向',
'Scene' => '場面',
'SceneArea' => 'シーンエリア?',
'SceneAssist' => 'シーン調整',
'SceneCaptureType' => {
Description => 'シーンキャプチャタイプ',
PrintConv => {
'Landscape' => '風景',
'Night' => '夜景',
'Portrait' => 'ポートレート',
'Standard' => 'スタンダード',
},
},
'SceneDetect' => 'シーン検出',
'SceneDetectData' => 'シーン検出データ?',
'SceneMode' => {
Description => 'シーンモード',
PrintConv => {
'2 in 1' => '2イン1',
'3D Sweep Panorama' => '3D',
'Aerial Photo' => '空撮',
'Anti Motion Blur' => '人物ブレ軽減',
'Aperture Priority' => '絞り優先',
'Auction' => 'アクション',
'Auto' => 'オート',
'Auto+' => 'Auto アドバンス',
'Available Light' => '自然光',
'Baby' => '赤ちゃん',
'Beach' => 'ビーチ',
'Beach & Snow' => 'ビーチ&スノー',
'Behind Glass' => 'ガラス越し',
'Candle' => 'キャンドル',
'Candlelight' => 'キャンドルライト',
'Children' => '子供',
'Color Effects' => 'カラーエフェクト',
'Cont. Priority AE' => '連続撮影優先AE',
'Cuisine' => '料理',
'Digital Image Stabilization' => 'デジタル手振れ補正',
'Documents' => '文書',
'Face Portrait' => '寝顔',
'Fireworks' => '花火',
'Food' => '料理',
'Handheld Night Shot' => '手持ち夜景',
'High Key' => 'ハイキー',
'High Sensitivity' => '高感度',
'High Speed Continuous Shooting' => '高速連写',
'Indoor' => '屋内撮影',
'Intelligent Auto' => 'インテリジェントオート',
'Intelligent ISO' => 'インテリジェントISO',
'Landscape' => '風景',
'Landscape+Portrait' => '風景+人物',
'Low Key' => 'ローキー',
'Macro' => 'マクロ',
'Manual' => 'マニュアル',
'Movie' => '動画',
'Movie Preview' => '動画プレビュー',
'Museum' => '美術館',
'My Mode' => 'マイモード',
'Nature Macro' => '自然マクロ',
'Night Portrait' => '人物夜景',
'Night Scene' => '夜景',
'Night Scenery' => '夜景',
'Night View/Portrait' => 'ナイトビュー/ポートレイト',
'Night+Portrait' => '夜景+人物',
'Normal' => 'ノーマル',
'Off' => 'オフ',
'Panning' => 'パンニング',
'Panorama' => 'パノラマ',
'Panorama Assist' => 'パノラマアシスト',
'Party' => 'パーティ',
'Pet' => 'ペット',
'Portrait' => 'ポートレート',
'Program' => 'プログラム',
'Scenery' => '風景',
'Self Portrait' => '自分撮り',
'Self Portrait+Self Timer' => '自分撮り+セルフタイマー',
'Self Protrait+Timer' => '自分撮り+セルフタイマー',
'Shoot & Select' => 'ショット&セレクト',
'Shoot & Select1' => 'ショット&セレクト1',
'Shoot & Select2' => 'ショット&セレクト2',
'Shooting Guide' => '撮影ガイド',
'Shutter Priority' => 'シャッター優先',
'Simple' => 'シンプル',
'Smile Shot' => 'スマイルショット',
'Snow' => 'スノー',
'Soft Skin' => 'ソフトスキン',
'Sport' => 'スポーツ',
'Sports' => 'スポーツ',
'Spot' => 'スポット',
'Standard' => 'スタンダード',
'Starry Night' => '星空',
'Sunset' => '夕日',
'Super Macro' => 'スーパーマクロ',
'Sweep Panorama' => 'スイングパノラマ',
'Text' => 'テキスト',
'Underwater' => '水中',
'Underwater Macro' => '水中マクロ',
'Underwater Snapshot' => '水中スナップ',
'Underwater Wide1' => '水中ワイド1',
'Underwater Wide2' => '水中ワイド2',
'Vivid' => 'ビビッド',
},
},
'SceneModeUsed' => {
Description => 'シーンモード',
PrintConv => {
'Aperture Priority' => '絞り優先',
'Beach' => 'ビーチ',
'Candlelight' => 'キャンドルライト',
'Fireworks' => '花火',
'Landscape' => '風景',
'Macro' => 'マクロ',
'Manual' => 'マニュアル',
'Night Portrait' => '人物夜景',
'Portrait' => 'ポートレート',
'Program' => 'プログラム',
'Shutter Priority' => 'シャッター優先',
'Snow' => 'スノー',
'Sunset' => '夕日',
'Text' => 'テキスト',
},
},
'SceneSelect' => {
Description => 'シーン選択',
PrintConv => {
'Lamp' => 'ランプ',
'Night' => '夜景',
'Off' => 'オフ',
'Sport' => 'スポーツ',
'TV' => 'テレビ',
'User 1' => 'ユーザー1',
'User 2' => 'ユーザー2',
},
},
'SceneType' => {
Description => 'シーンタイプ',
PrintConv => {
'Directly photographed' => '直接撮影画像',
},
},
'SecurityClassification' => {
Description => 'セキュリティ区分',
PrintConv => {
'Confidential' => '機密文書',
'Restricted' => '限定',
'Secret' => '秘密',
'Top Secret' => '最高機密',
'Unclassified' => '未分類',
},
},
'SelectableAFPoint' => {
Description => '任意選択可能なAFフレーム',
PrintConv => {
'11 points' => '11点',
'19 points' => '19点',
'45 points' => '45点',
'Inner 9 points' => '9点(内側)',
'Outer 9 points' => '9点(外側)',
},
},
'SelfTimer' => {
Description => 'セルフタイマー長',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'SelfTimer2' => 'セルフタイマー(2)',
'SelfTimerMode' => 'セルフタイマーモード',
'SelfTimerTime' => 'セルフタイマー遅延時間',
'SensingMethod' => {
Description => 'センサー方式',
PrintConv => {
'Color sequential area' => 'シーケンシャルカラーセンサー',
'Color sequential linear' => 'シーケンシャルカラーラインセンサー',
'Monochrome area' => 'モノクロエリアセンサー',
'Monochrome linear' => 'モノクロラインセンサー',
'Not defined' => '未定義',
'One-chip color area' => '単板式カラーセンサー',
'Three-chip color area' => '3板式カラーセンサー',
'Trilinear' => '3ラインセンサー',
'Two-chip color area' => '2板式カラーセンサー',
},
},
'SensitivityAdjust' => '感度調節',
'SensitivitySteps' => {
Description => '感度ステップ',
PrintConv => {
'1 EV Steps' => '1EVステップ',
'As EV Steps' => '露出ステップに従う',
},
},
'SensorCleaning' => {
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
},
},
'SensorHeight' => 'センサー高さ',
'SensorImageHeight' => 'センサー高さ',
'SensorImageWidth' => 'センサー幅',
'SensorLeftBorder' => 'イメージ左部',
'SensorPixelSize' => 'センサーピクセルサイズ',
'SensorTemperature' => 'センサー温度',
'SensorTopBorder' => 'イメージ上部',
'SensorWidth' => 'センサー幅',
'Sequence' => 'シーケンス',
'SequenceNumber' => 'シーケンス番号',
'SequenceShotInterval' => 'シーケンスショットインターバル',
'SequentialShot' => {
Description => 'シーケンシャルショット',
PrintConv => {
'None' => '無し',
'Standard' => 'スタンダード',
},
},
'SerialNumber' => 'シリアル番号',
'SerialNumberFormat' => 'シリアル番号形式',
'ServiceIdentifier' => 'サービス識別子',
'SetButtonCrossKeysFunc' => {
Description => 'SETボタン/十字キー機能',
PrintConv => {
'Cross keys: AF point select' => '十字キー:AFフレーム選択',
'Normal' => '標準',
'Set: Flash Exposure Comp' => 'SET:調光補正',
'Set: Parameter' => 'SET:現像パラメーター選択',
'Set: Picture Style' => 'SET:ピクチャースタイル',
'Set: Playback' => 'SET:画像の再生',
'Set: Quality' => 'SET:記録画質',
},
},
'SetButtonWhenShooting' => {
Description => '撮影時のSETボタン',
PrintConv => {
'Change parameters' => '現像パラメーター選択',
'Default (no function)' => '通常(なし)',
'Disabled' => '無効',
'Flash exposure compensation' => '調光補正',
'ISO speed' => 'ISO感度',
'Image playback' => '画像再生',
'Image quality' => '記録画質選択',
'Image size' => '画像サイズ',
'LCD monitor On/Off' => '液晶モニターの入/切',
'Menu display' => 'メニュー表示',
'Normal (disabled)' => '通常(無効)',
'Picture style' => 'ピクチャースタイル',
'Quick control screen' => 'クイック設定画面',
'Record func. + media/folder' => '記録機能とメディア・フォルダ',
'Record movie (Live View)' => '動画撮影(ライブビュー)',
'White balance' => 'ホワイトバランス',
},
},
'SetFunctionWhenShooting' => {
Description => '撮影時のセットボタン機能',
PrintConv => {
'Change Parameters' => '現像パラメーター選択',
'Change quality' => '記録画質選択',
'Default (no function)' => '通常(なし)',
'Image replay' => '画像の再生',
'Menu display' => 'メニュー表示',
},
},
'ShadingCompensation' => {
Description => '陰影修正',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ShadingCompensation2' => {
Description => '陰影補正編集',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'Shadow' => 'シャドウ',
'ShadowScale' => 'シャドウスケール',
'Shadows' => 'シャドウ',
'ShakeReduction' => {
Description => '手ぶれ補正(設定)',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ShakeReductionInfo' => 'SR効果',
'Sharpness' => {
Description => 'シャープネス',
PrintConv => {
'Film Simulation' => 'フィルムシミュレーション',
'Hard' => 'ハード',
'Hard2' => 'ハード2',
'Med Hard' => '少しハード',
'Med Soft' => '少しソフト',
'Medium Hard' => 'ミドルハード',
'Medium Soft' => 'ミドルソフト',
'Normal' => 'ノーマル',
'Sharp' => 'シャープ',
'Soft' => 'ソフト',
'Soft2' => 'ソフト2',
'Very Hard' => 'かなりハード',
'Very Soft' => 'かなりソフト',
'n/a' => '該当無し',
},
},
'SharpnessFactor' => 'シャープネス要因',
'SharpnessFaithful' => 'シャープネス忠実設定',
'SharpnessFrequency' => {
PrintConv => {
'High' => '高い',
'Low' => 'ソフト',
'Standard' => 'スタンダード',
'n/a' => '該当無し',
},
},
'SharpnessLandscape' => 'シャープネス風景',
'SharpnessMonochrome' => 'シャープネスモノクロ',
'SharpnessNeutral' => 'シャープネスニュートラル',
'SharpnessPortrait' => 'シャープネスポートレート',
'SharpnessSetting' => 'シャープネス設定',
'SharpnessStandard' => 'シャープネススタンダード',
'SharpnessUserDef1' => 'シャープネスユーザ設定1',
'SharpnessUserDef2' => 'シャープネスユーザ設定2',
'SharpnessUserDef3' => 'シャープネスユーザ設定3',
'ShootingInfoDisplay' => {
Description => '撮影情報表示',
PrintConv => {
'Auto' => 'オート',
'Manual (dark on light)' => '手動-黒地に白',
'Manual (light on dark)' => '手動-白地に黒',
},
},
'ShootingMode' => {
Description => '撮影モード',
PrintConv => {
'Aerial Photo' => '空撮',
'Aperture Priority' => '絞り優先',
'Baby' => '赤ちゃん',
'Beach' => 'ビーチ',
'Candlelight' => 'キャンドルライト',
'Clipboard' => 'メモ',
'Color Effects' => 'カラーエフェクト',
'Economy' => 'エコモード',
'Fireworks' => '花火',
'Food' => '料理',
'High Sensitivity' => '高感度',
'High Speed Continuous Shooting' => '高速連写',
'Intelligent Auto' => 'インテリジェントオート',
'Intelligent ISO' => 'インテリジェントISO',
'Macro' => 'マクロ',
'Manual' => 'マニュアル',
'Movie Preview' => '動画プレビュー',
'Night Portrait' => '人物夜景',
'Night Scenery' => '夜景',
'Normal' => '標準',
'Panning' => 'パンニング',
'Panorama Assist' => 'パノラマアシスト',
'Party' => 'パーティ',
'Pet' => 'ペット',
'Portrait' => 'ポートレート',
'Program' => 'プログラム',
'Scenery' => '風景',
'Self Portrait' => '自分撮り',
'Shutter Priority' => 'シャッター優先',
'Simple' => 'シンプル',
'Snow' => 'スノー',
'Soft Skin' => 'ソフトスキン',
'Sports' => 'スポーツ',
'Spot' => 'スポット',
'Starry Night' => '星空',
'Sunset' => '夕日',
'Underwater' => '水中',
},
},
'ShootingModeSetting' => {
Description => '撮影モード',
PrintConv => {
'Continuous' => '連続撮影',
'Delayed Remote' => '遅延リモート',
'Quick-response Remote' => '即時リモート',
'Self-timer' => 'セルフタイマー',
'Single Frame' => '1コマ撮影',
},
},
'ShortDocumentID' => '短文書ID',
'ShortOwnerName' => '短いオーナー名',
'ShortReleaseTimeLag' => {
Description => 'レリーズタイムラグ最速化',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
},
},
'ShotInfoVersion' => 'ショット情報バージョン',
'Shutter-AELock' => {
Description => 'シャッターボタン/AEロックボタン',
PrintConv => {
'AE lock/AF' => 'AEロック/AF',
'AE/AF, No AE lock' => 'AE/AF(AEロックなし)',
'AF/AE lock' => 'AF/AEロック',
'AF/AF lock' => 'AF/AFロック',
'AF/AF lock, No AE lock' => 'AF/AFロック(AEロックなし)',
},
},
'ShutterAELButton' => 'シャッターボタン/AEロックボタン',
'ShutterButtonAFOnButton' => {
Description => 'シャッター/AF-ONボタン',
PrintConv => {
'AE lock/Metering + AF start' => 'AEロック/測光・AF開始',
'Metering + AF start' => '測光・AF開始',
'Metering + AF start/AF stop' => '測光・AF開始/AFストップ',
'Metering + AF start/disable' => '測光・AF開始/無効',
'Metering start/Meter + AF start' => '測光開始/測光・AF開始',
},
},
'ShutterCount' => 'シャッター回数',
'ShutterCurtainSync' => {
Description => 'ストロボのシンクロタイミング',
PrintConv => {
'1st-curtain sync' => '先幕シンクロ',
'2nd-curtain sync' => '後幕シンクロ',
},
},
'ShutterMode' => {
PrintConv => {
'Aperture Priority' => '絞り優先',
'Auto' => 'オート',
},
},
'ShutterReleaseButtonAE-L' => {
Description => 'シャッターレリーズボタン AE-L',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ShutterReleaseNoCFCard' => {
Description => 'CFカード未装填時のレリーズ',
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'ShutterSpeed' => '露出時間',
'ShutterSpeedRange' => {
Description => 'シャッター速度の制御範囲の設定',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
},
},
'ShutterSpeedValue' => 'シャッタースピード',
'SimilarityIndex' => '類似インデックス',
'Site' => 'サイト',
'SlaveFlashMeteringSegments' => 'スレーブフラッシュ測光値',
'SlideShow' => {
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'SlowShutter' => {
Description => 'スローシャッター',
PrintConv => {
'Night Scene' => '夜景',
'None' => '無し',
'Off' => 'オフ',
'On' => 'オン',
},
},
'SlowSync' => {
Description => 'スローシンクロ',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'Software' => 'ソフトウェア',
'SoftwareVersion' => 'ソフトウェアバージョン',
'Source' => 'ソース',
'SpatialFrequencyResponse' => '空間周波数特性',
'SpecialEffectsOpticalFilter' => {
PrintConv => {
'None' => '無し',
},
},
'SpecialInstructions' => '手順',
'SpecialMode' => 'スペシャルモード',
'SpectralSensitivity' => 'スペクトル感度',
'SpotFocusPointX' => 'スポットフォーカスポイントX',
'SpotFocusPointY' => 'スポットフォーカスポイントY',
'SpotMeterLinkToAFPoint' => {
Description => '測距点連動スポット測光',
PrintConv => {
'Disable (use center AF point)' => 'しない(中央固定',
'Enable (use active AF point)' => 'する(測距点連動)',
},
},
'SpotMeteringMode' => {
Description => 'スポットメーターモード',
PrintConv => {
'Center' => '中央',
},
},
'State' => '都道府県名',
'StoNits' => 'Stoニット',
'StraightenAngle' => 'ストレートアングル',
'StreamType' => {
PrintConv => {
'Text' => 'テキスト',
},
},
'StripByteCounts' => '圧縮片のバイト数',
'StripOffsets' => '画像データ位置',
'Sub-location' => '場所',
'SubSecCreateDate' => 'デジタルデータ作成日時',
'SubSecDateTimeOriginal' => 'オリジナルデータ作成日時',
'SubSecModifyDate' => 'ファイル作成日時',
'SubSecTime' => 'DateTimeサブ秒',
'SubSecTimeDigitized' => 'DateTimeDigitizedサブ秒',
'SubSecTimeOriginal' => 'DateTimeOriginalサブ秒',
'SubTileBlockSize' => 'サブタイトルブロックサイズ',
'SubfileType' => '新規サブファイルタイプ',
'SubimageColor' => {
PrintConv => {
'Monochrome' => 'モノトーン',
},
},
'Subject' => 'サブジェクト',
'SubjectArea' => '対象領域',
'SubjectDistance' => '対象距離',
'SubjectDistanceRange' => {
Description => '被写体距離範囲',
PrintConv => {
'Close' => '近景',
'Distant' => '遠景',
'Macro' => 'マクロ',
'Unknown' => '不明',
},
},
'SubjectLocation' => '対象領域',
'SubjectProgram' => {
Description => '被写体プログラム',
PrintConv => {
'Night portrait' => '人物夜景',
'None' => '無し',
'Portrait' => 'ポートレート',
'Sports action' => 'スポーツアクション',
'Sunset' => '夕日',
'Text' => 'テキスト',
},
},
'SubjectReference' => 'サブジェクトコード',
'Subsystem' => {
PrintConv => {
'Unknown' => '不明',
},
},
'SuperMacro' => {
Description => 'スーパーマクロ',
PrintConv => {
'Off' => 'オフ',
'On (1)' => 'オン(1)',
'On (2)' => 'オン(2)',
},
},
'SuperimposedDisplay' => {
Description => 'スーパーインポーズの表示',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'SupplementalCategories' => '補足カテゴリー',
'SupplementalType' => '補足タイプ',
'SvISOSetting' => 'SVISO感度設定',
'SwitchToRegisteredAFPoint' => {
Description => '登録AFフレームへの切り換え',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
},
},
'T4Options' => 'T4オプション',
'T6Options' => 'T6オプション',
'TIFF-EPStandardID' => 'TIFF/EP標準ID',
'TTL_DA_ADown' => 'TTL D/A Aチャンネル ダウン',
'TTL_DA_AUp' => 'TTL D/A Aチャンネル アップ',
'TTL_DA_BDown' => 'TTL D/A Bチャンネル ダウン',
'TTL_DA_BUp' => 'TTL D/A Bチャンネル アップ',
'Tagged' => {
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'TargetAperture' => 'ターゲット絞り',
'TargetExposureTime' => 'ターゲット露出時間',
'TargetPrinter' => '標的プリンタ',
'Technology' => {
Description => 'テクノロジー',
PrintConv => {
'Active Matrix Display' => 'アクティブマトリクス型ディスプレイ',
'Cathode Ray Tube Display' => 'CRTディスプレイ',
'Digital Camera' => 'デジタルカメラ',
'Dye Sublimation Printer' => '昇華型プリンター',
'Electrophotographic Printer' => '静電記録式プリンター',
'Electrostatic Printer' => '静電気プリンター',
'Film Scanner' => 'フイルムスキャナー',
'Film Writer' => 'フィルムライター',
'Flexography' => 'アニリン印刷',
'Gravure' => 'グラビア印刷',
'Ink Jet Printer' => 'インクジェットプリンター',
'Offset Lithography' => 'オフセット印刷',
'Passive Matrix Display' => '単純マトリクス型ディスプレイ',
'Photo CD' => 'フォトCD',
'Photo Image Setter' => 'フォトイメージセッター',
'Photographic Paper Printer' => '印画紙プリンター',
'Projection Television' => 'プロジェクションテレビ',
'Reflective Scanner' => '反射スキャナ',
'Silkscreen' => 'シルクスクリーン印刷',
'Thermal Wax Printer' => '熱転写プリンター',
'Video Camera' => 'ビデオカメラ',
'Video Monitor' => 'ビデオモニター',
},
},
'Teleconverter' => {
PrintConv => {
'None' => '無し',
},
},
'Text' => 'テキスト',
'TextInfo' => 'テキスト情報',
'TextStamp' => {
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'Thresholding' => '閾値化',
'ThumbnailImage' => 'サムネイル画像',
'ThumbnailImageSize' => 'サムネイルサイズ',
'ThumbnailImageValidArea' => 'サムネイル画像有効領域',
'TileByteCounts' => 'タイルのバイト数',
'TileDepth' => 'タイルの深さ',
'TileLength' => 'タイルの長さ',
'TileOffsets' => 'タイルのオフセット',
'TileWidth' => 'タイルの幅',
'Time' => '時間',
'TimeCreated' => '作成時間',
'TimeScaleParamsQuality' => {
PrintConv => {
'High' => '高い',
'Low' => 'ソフト',
},
},
'TimeSent' => '発送時間',
'TimeSincePowerOn' => '電源オン経過時間',
'TimeStamp' => 'タイムスタンプ',
'TimeStamp1' => 'タイムスタンプ1',
'TimeZone' => 'タイムゾーン',
'TimeZoneOffset' => 'タイムゾーンオフセット',
'TimerFunctionButton' => {
Description => 'ファンクションボタン',
PrintConv => {
'ISO' => 'ISO感度',
'Image Quality/Size' => '画像品質/サイズ',
'Self-timer' => 'セルフタイマー',
'Shooting Mode' => '撮影モード',
'White Balance' => 'ホワイトバランス',
},
},
'TimerLength' => {
Description => '各種タイマー保持時間',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
},
},
'Timezone' => 'タイムゾーン',
'Title' => 'タイトル',
'ToneComp' => 'トーン補正',
'ToneCurve' => {
Description => 'トーンカーブ',
PrintConv => {
'Custom' => 'カスタム',
'Manual' => 'マニュアル',
'Standard' => 'スタンダード',
},
},
'ToneCurveActive' => {
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'ToneCurveName' => {
PrintConv => {
'Custom' => 'カスタム',
},
},
'ToneCurves' => 'トーンカーブ(s)',
'ToningEffect' => {
Description => 'トーン効果',
PrintConv => {
'B&W' => '白黒',
'Blue' => '青',
'Blue-green' => '青緑',
'Cyanotype' => '青写真',
'Green' => '緑',
'None' => '無し',
'Purple' => '紫',
'Purple-blue' => '青紫',
'Red' => '赤',
'Red-purple' => '赤紫',
'Sepia' => 'セピア',
'Yellow' => '黄色',
'n/a' => '該当無し',
},
},
'ToningEffectMonochrome' => {
Description => 'モノクロトーン効果',
PrintConv => {
'Blue' => '青',
'Green' => '緑',
'None' => '無し',
'Purple' => '紫',
'Sepia' => 'セピア',
},
},
'ToningSaturation' => '彩度トーン',
'TransferFunction' => '転送機能',
'TransferRange' => '転送範囲',
'Transformation' => {
Description => '変形',
PrintConv => {
'Horizontal (normal)' => '水平(標準)',
'Rotate 180' => '180度回転',
'Rotate 270 CW' => '270度回転 CW',
'Rotate 90 CW' => '90度回転 CW',
},
},
'TransmissionReference' => '送信元記録',
'TransparencyIndicator' => '透明度指標',
'TrapIndicator' => 'トラップインジケーター',
'Trapped' => {
PrintConv => {
'Unknown' => '不明',
},
},
'TravelDay' => 'トラベル日付',
'TvExposureTimeSetting' => 'Tv露出時間設定',
'Type' => 'タイプ',
'USMLensElectronicMF' => {
Description => 'USMレンズの電子式手動フォーカス',
PrintConv => {
'Disable after one-shot AF' => 'ワンショットAF作動後・不可',
'Disable in AF mode' => 'AF時すべて不可',
'Enable after one-shot AF' => 'ワンショットAF作動後・可',
},
},
'Uncompressed' => {
Description => '非圧縮',
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'UniqueCameraModel' => 'ユニークカメラモデル',
'UniqueDocumentID' => 'ユニーク文書ID',
'UniqueObjectName' => 'ユニーク・ネーム・オブ・オブジェクト',
'Unknown' => '不明',
'Unsharp1Color' => {
Description => 'アンシャープ1カラー',
PrintConv => {
'Blue' => '青',
'Cyan' => 'シアン',
'Green' => '緑',
'Magenta' => 'マゼンダ',
'Red' => '赤',
'Yellow' => '黄色',
},
},
'Unsharp1HaloWidth' => 'アンシャープ1円光幅',
'Unsharp1Intensity' => 'アンシャープ1強度',
'Unsharp1Threshold' => 'アンシャープ1起点',
'Unsharp2Color' => {
Description => 'アンシャープ2カラー',
PrintConv => {
'Blue' => '青',
'Cyan' => 'シアン',
'Green' => '緑',
'Magenta' => 'マゼンダ',
'Red' => '赤',
'Yellow' => '黄色',
},
},
'Unsharp2HaloWidth' => 'アンシャープ2円光幅',
'Unsharp2Intensity' => 'アンシャープ2強度',
'Unsharp2Threshold' => 'アンシャープ2起点',
'Unsharp3Color' => {
Description => 'アンシャープ3カラー',
PrintConv => {
'Blue' => '青',
'Cyan' => 'シアン',
'Green' => '緑',
'Magenta' => 'マゼンダ',
'Red' => '赤',
'Yellow' => '黄色',
},
},
'Unsharp3HaloWidth' => 'アンシャープ3円光幅',
'Unsharp3Intensity' => 'アンシャープ3強度',
'Unsharp3Threshold' => 'アンシャープ3起点',
'Unsharp4Color' => {
Description => 'アンシャープ4カラー',
PrintConv => {
'Blue' => '青',
'Cyan' => 'シアン',
'Green' => '緑',
'Magenta' => 'マゼンダ',
'Red' => '赤',
'Yellow' => '黄色',
},
},
'Unsharp4HaloWidth' => 'アンシャープ4円光幅',
'Unsharp4Intensity' => 'アンシャープ4強度',
'Unsharp4Threshold' => 'アンシャープ4起点',
'UnsharpCount' => 'アンシャープカウント',
'UnsharpData' => 'アンシャープデータ',
'UnsharpMask' => {
Description => 'アンシャープマスク',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'Urgency' => '緊急性',
'UsableMeteringModes' => {
Description => '測光モードの限定',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
},
},
'UsableShootingModes' => {
Description => '撮影モードの限定',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
},
},
'UserComment' => 'ユーザーコメント',
'UserDef1PictureStyle' => {
Description => 'ユーザ設定1 ピクチャースタイル',
PrintConv => {
'Faithful' => '忠実設定',
'Landscape' => '風景',
'Monochrome' => 'モノトーン',
'Neutral' => 'ニュートラル',
'Portrait' => 'ポートレート',
'Standard' => 'スタンダード',
},
},
'UserDef2PictureStyle' => {
Description => 'ユーザ設定2 ピクチャースタイル',
PrintConv => {
'Faithful' => '忠実設定',
'Landscape' => '風景',
'Monochrome' => 'モノトーン',
'Neutral' => 'ニュートラル',
'Portrait' => 'ポートレート',
'Standard' => 'スタンダード',
},
},
'UserDef3PictureStyle' => {
Description => 'ユーザ設定3 ピクチャースタイル',
PrintConv => {
'Faithful' => '忠実設定',
'Landscape' => '風景',
'Monochrome' => 'モノトーン',
'Neutral' => 'ニュートラル',
'Portrait' => 'ポートレート',
'Standard' => 'スタンダード',
},
},
'VRDVersion' => 'VRDバージョン',
'VRInfo' => 'VR(手振れ補正)情報',
'VRInfoVersion' => 'VR情報バージョン',
'VR_0x66' => {
PrintConv => {
'Off' => 'オフ',
'On (active)' => 'オン(アクティブ)',
'On (normal)' => 'オン(ノーマル)',
},
},
'ValidAFPoints' => '有効なAFポイント',
'ValidBits' => 'ピクセルにつき有効なビット',
'VariProgram' => 'バリプログラム',
'Version' => 'バージョン',
'VibrationReduction' => {
Description => '手振れ補正(VR)',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
'On (1)' => 'オン(1)',
'On (2)' => 'オン(2)',
'On (3)' => 'オン(3)',
'n/a' => '該当無し',
},
},
'VideoCardGamma' => 'ビデオカードガンマ',
'ViewInfoDuringExposure' => {
Description => '露光中のファインダー内表示',
PrintConv => {
'Disable' => 'しない',
'Enable' => 'する',
},
},
'ViewfinderWarning' => {
Description => 'ビューファインダー警告表示',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'ViewingCondDesc' => '視聴状態説明',
'ViewingCondIlluminant' => '視聴状態光源',
'ViewingCondIlluminantType' => '視聴状態光源タイプ',
'ViewingCondSurround' => '視聴状態周辺',
'ViewingConditions' => '視聴状態光源',
'VignetteControl' => {
Description => 'ビネットコントロール',
PrintConv => {
'High' => '高い',
'Low' => '低い',
'Normal' => '標準',
'Off' => 'オフ',
'On' => 'オン',
},
},
'VignetteControlIntensity' => 'ビネットコントロール強度',
'VoiceMemo' => {
Description => 'ボイスメモ',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'WBAdjData' => 'ホワイトバランス調整データ',
'WBAdjLighting' => {
Description => 'ホワイトバランス調整、ライティング',
PrintConv => {
'Daylight' => '昼光',
'Flash' => 'ストロボ',
'High Color Rendering Fluorescent' => 'ハイカラーレンダリング蛍光灯',
'Incandescent' => '電球',
'None' => '無し',
'Standard Fluorescent' => '標準蛍光灯',
},
},
'WBAdjMode' => {
Description => 'ホワイトバランス調整モード',
PrintConv => {
'Calculate Automatically' => '自動計算',
'Recorded Value' => '記録値',
'Use Gray Point' => 'グレーポイント使用',
'Use Temperature' => '温度使用',
},
},
'WBAdjTemperature' => 'ホワイトバランス調整、色温度',
'WBBlueLevel' => 'ホワイトバランス青レベル',
'WBBracketMode' => {
Description => 'ホワイトバランスブラケットモード',
PrintConv => {
'Off' => 'オフ',
'On (shift AB)' => 'オン(シフトAB)',
'On (shift GM)' => 'オン(シフトGM)',
},
},
'WBBracketValueAB' => 'ホワイトバランスブラケット値AB',
'WBBracketValueGM' => 'ホワイトバランスブラケット値GM',
'WBFineTuneActive' => {
PrintConv => {
'No' => 'いいえ',
'Yes' => 'はい',
},
},
'WBGreenLevel' => 'ホワイトバランス緑レベル',
'WBMediaImageSizeSetting' => {
Description => 'WB/メディア・画像サイズの設定',
PrintConv => {
'LCD monitor' => '液晶モニター',
'Rear LCD panel' => '背面表示パネル',
},
},
'WBMode' => {
Description => 'ホワイトバランスモード',
PrintConv => {
'Auto' => 'オート',
},
},
'WBRedLevel' => 'ホワイトバランス赤レベル',
'WBShiftAB' => 'WB AB補正',
'WBShiftGM' => 'WB GM補正',
'WB_GBRGLevels' => 'WB GBRG レベル',
'WB_GRBGLevels' => 'WB GRBG レベル',
'WB_GRGBLevels' => 'WB GRGB レベル',
'WB_RBGGLevels' => 'WB RBGG レベル',
'WB_RBLevels' => 'WB RBレベル',
'WB_RBLevels3000K' => 'WB RGGB3000Kレベル',
'WB_RBLevels3300K' => 'WB RGGB3300Kレベル',
'WB_RBLevels3600K' => 'WB RGGB3600Kレベル',
'WB_RBLevels3900K' => 'WB RGGB3800Kレベル',
'WB_RBLevels4000K' => 'WB RGGB4000Kレベル',
'WB_RBLevels4300K' => 'WB RGGB4300Kレベル',
'WB_RBLevels4500K' => 'WB RGGB4500Kレベル',
'WB_RBLevels4800K' => 'WB RGGB4800Kレベル',
'WB_RBLevels5300K' => 'WB RGGB5300Kレベル',
'WB_RBLevels6000K' => 'WB RGGB6000Kレベル',
'WB_RBLevels6600K' => 'WB RGGB6600Kレベル',
'WB_RBLevels7500K' => 'WB RGGB7500Kレベル',
'WB_RBLevelsAuto' => 'WB RB レベル オート',
'WB_RBLevelsCloudy' => 'WB RB レベル 曇天',
'WB_RBLevelsCoolWhiteFluor' => 'WB RB レベル 冷白蛍光灯',
'WB_RBLevelsDayWhiteFluor' => 'WB RB レベル 昼白蛍光灯',
'WB_RBLevelsDaylightFluor' => 'WB RB レベル 昼光蛍光灯',
'WB_RBLevelsEveningSunlight' => 'WB RB レベル 夕日',
'WB_RBLevelsFineWeather' => 'WB RB レベル 晴天',
'WB_RBLevelsShade' => 'WB RB レベル 日陰',
'WB_RBLevelsTungsten' => 'WB RB レベル 白熱灯',
'WB_RBLevelsUsed' => 'WB RB レベル使用',
'WB_RBLevelsWhiteFluorescent' => 'WB RB レベル 白蛍光灯',
'WB_RGBGLevels' => 'WB RGBG レベル',
'WB_RGBLevels' => 'WB RGB レベル',
'WB_RGBLevelsCloudy' => 'WB RGB レベル 曇天',
'WB_RGBLevelsDaylight' => 'WB RGB レベル 昼光',
'WB_RGBLevelsFlash' => 'WB RGB レベル ストロボ',
'WB_RGBLevelsFluorescent' => 'WB RGGB レベル 蛍光灯',
'WB_RGBLevelsShade' => 'WB RGB レベル 日陰',
'WB_RGBLevelsTungsten' => 'WB RGB レベル 白熱灯',
'WB_RGGBLevels' => 'WB RGGB レベル',
'WB_RGGBLevelsCloudy' => 'WB RGGB レベル 曇天',
'WB_RGGBLevelsDaylight' => 'WB RGGB レベル 昼光',
'WB_RGGBLevelsFlash' => 'WB RGGB レベル ストロボ',
'WB_RGGBLevelsFluorescent' => 'WB RGGB レベル 蛍光灯',
'WB_RGGBLevelsFluorescentD' => 'WB RGGB レベル 蛍光灯(D)',
'WB_RGGBLevelsFluorescentN' => 'WB RGGB レベル 蛍光灯(N)',
'WB_RGGBLevelsFluorescentW' => 'WB RGGB レベル 蛍光灯(W)',
'WB_RGGBLevelsShade' => 'WB RGGB レベル 日陰',
'WB_RGGBLevelsTungsten' => 'WB RGGB レベル 白熱灯',
'WCSProfiles' => 'Windowsカラーシステムプロフィール',
'WhiteBalance' => {
Description => 'ホワイトバランス',
PrintConv => {
'Auto' => 'オート',
'Black & White' => '白黒',
'Cloudy' => '曇り',
'Color Temperature/Color Filter' => '色温度マニュアル指定',
'Cool White Fluorescent' => '白色蛍光灯',
'Custom' => 'カスタム',
'Custom 1' => 'カスタム1',
'Custom 2' => 'カスタム2',
'Custom 3' => 'カスタム3',
'Custom 4' => 'カスタム4',
'Custom2' => 'カスタム2',
'Custom3' => 'カスタム3',
'Custom4' => 'カスタム4',
'Custom5' => 'カスタム5',
'Day White Fluorescent' => '昼白色蛍光灯',
'Daylight' => '昼光',
'Daylight Fluorescent' => '昼光色蛍光灯',
'Flash' => 'ストロボ',
'Fluorescent' => '蛍光灯',
'Incandescent' => '電球',
'Kelvin' => 'ケルビン',
'Living Room Warm White Fluorescent' => 'リビング暖白光色蛍光灯',
'Manual' => 'マニュアル',
'Manual Temperature (Kelvin)' => 'マニュアル白熱灯(ケルビン)',
'PC Set1' => 'PC設定1',
'PC Set2' => 'PC設定2',
'PC Set3' => 'PC設定3',
'PC Set4' => 'PC設定4',
'PC Set5' => 'PC設定5',
'Shade' => '日陰',
'Tungsten' => 'タングステン(白熱灯)',
'Underwater' => '水中',
'Unknown' => '不明',
'User-Selected' => 'ユーザ選択',
'Warm White Fluorescent' => '暖白光色蛍光灯',
'White Fluorescent' => '温白色蛍光灯',
},
},
'WhiteBalance2' => {
Description => 'ホワイトバランス2',
PrintConv => {
'3000K (Tungsten light)' => '3000K (白熱電球)',
'3600K (Tungsten light-like)' => '3600K (白熱電球-like)',
'4000K (Cool white fluorescent)' => '4000K (蛍光灯1)',
'4500K (Neutral white fluorescent)' => '4500K (蛍光灯2)',
'5300K (Fine Weather)' => '5300K (晴天)',
'6000K (Cloudy)' => '6000K (曇り)',
'6600K (Daylight fluorescent)' => '6600K (蛍光灯3)',
'7500K (Fine Weather with Shade)' => '7500K (晴天と影)',
'Auto' => 'オート',
'Custom WB 1' => 'カスタムホワイトバランス1',
'Custom WB 2' => 'カスタムホワイトバランス2',
'Custom WB 2900K' => 'カスタムホワイトバランス2900K',
'Custom WB 3' => 'カスタムホワイトバランス3',
'Custom WB 4' => 'カスタムホワイトバランス4',
'Custom WB 5400K' => 'カスタムホワイトバランス5400K',
'Custom WB 8000K' => 'カスタムホワイトバランス8000K',
},
},
'WhiteBalanceAdj' => {
Description => 'ホワイトバランス調整',
PrintConv => {
'Auto' => 'オート',
'Cloudy' => '曇り',
'Daylight' => '昼光',
'Flash' => 'ストロボ',
'Fluorescent' => '蛍光灯',
'Off' => 'オフ',
'On' => 'オン',
'Shade' => '日陰',
'Tungsten' => 'タングステン(白熱灯)',
},
},
'WhiteBalanceBias' => 'ホワイトバランスバイアス',
'WhiteBalanceBracket' => 'ホワイトバランスブラケット',
'WhiteBalanceComp' => 'ホワイトバランス補正',
'WhiteBalanceFineTune' => 'ホワイトバランスファインチューン',
'WhiteBalanceMode' => {
Description => 'ホワイトバランスモード',
PrintConv => {
'Auto (Cloudy)' => 'オート(曇天)',
'Auto (Day White Fluorescent)' => 'オート(昼白色蛍光灯)',
'Auto (Daylight Fluorescent)' => 'オート(昼光色蛍光灯)',
'Auto (Daylight)' => 'オート(昼光)',
'Auto (Flash)' => 'オート(ストロボ)',
'Auto (Shade)' => 'オート(日陰)',
'Auto (Tungsten)' => 'オート(白熱灯)',
'Auto (White Fluorescent)' => 'オート(白色蛍光灯)',
'Unknown' => '不明',
'User-Selected' => 'ユーザー選択',
},
},
'WhiteBalanceSet' => {
Description => 'ホワイトバランス設定',
PrintConv => {
'Auto' => 'オート',
'Cloudy' => '曇り',
'Day White Fluorescent' => '昼白色蛍光灯',
'Daylight' => '昼光',
'Daylight Fluorescent' => '昼光色蛍光灯',
'Flash' => 'ストロボ',
'Manual' => 'マニュアル',
'Set Color Temperature 1' => '色温度設定1',
'Set Color Temperature 2' => '色温度設定2',
'Set Color Temperature 3' => '色温度設定3',
'Shade' => '日陰',
'Tungsten' => 'タングステン(白熱灯)',
'White Fluorescent' => '温白色蛍光灯',
},
},
'WhiteBalanceTemperature' => 'ホワイトバランス温度',
'WhiteBoard' => 'ホワイトボード',
'WhiteLevel' => '白レベル',
'WhitePoint' => '白点色度',
'Wide' => 'ワイド',
'WideFocusZone' => 'ワイドフォーカスゾーン',
'WideRange' => {
Description => 'ワイドレンジ',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'WidthResolution' => '幅方向の画像解像度',
'WorldTime' => 'タイムゾーン',
'WorldTimeLocation' => {
Description => 'ワールドタイム位置',
PrintConv => {
'Destination' => '目的地',
'Home' => '自宅',
'Hometown' => '現在地',
},
},
'Writer-Editor' => '表題/説明の作家',
'X3FillLight' => 'X3光を満たす',
'XClipPathUnits' => 'Xクリップパス単位',
'XMP' => 'XMPメタデータ',
'XPAuthor' => '作者',
'XPComment' => 'コメント',
'XPKeywords' => 'キーワード',
'XPSubject' => 'サブジェクト',
'XPTitle' => 'タイトル',
'XPosition' => 'X位置',
'XResolution' => '画像幅の解像度',
'YCbCrCoefficients' => 'カラースペース変化マトリックス係数',
'YCbCrPositioning' => {
Description => 'YとCの位置',
PrintConv => {
'Centered' => '中央',
'Co-sited' => '相互配置',
},
},
'YCbCrSubSampling' => 'YとCのサブサンプリング比率',
'YClipPathUnits' => 'Yクリップパス単位',
'YPosition' => 'Y位置',
'YResolution' => '画像高さの解像度',
'ZoneMatching' => {
Description => 'ゾーンマッチング',
PrintConv => {
'High Key' => 'ハイキー',
'ISO Setting Used' => 'オフ(ISO設定使用)',
'Low Key' => 'ローキー',
},
},
'ZoneMatchingOn' => {
Description => 'ゾーンマッチング',
PrintConv => {
'Off' => 'オフ',
'On' => 'オン',
},
},
'Zoom' => 'ズーム',
'ZoomSourceWidth' => 'ズームソース幅',
'ZoomStepCount' => 'ズームステップ数',
'ZoomTargetWidth' => 'ズームターゲット幅',
);
1; # end
__END__
=head1 NAME
Image::ExifTool::Lang::ja.pm - ExifTool Japanese language translations
=head1 DESCRIPTION
This file is used by Image::ExifTool to generate localized tag descriptions
and values.
=head1 AUTHOR
Copyright 2003-2014, Phil Harvey (phil at owl.phy.queensu.ca)
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=head1 ACKNOWLEDGEMENTS
Thanks to Jens Duttke and Kazunari Nishina for providing this translation.
=head1 SEE ALSO
L<Image::ExifTool(3pm)|Image::ExifTool>,
L<Image::ExifTool::TagInfoXML(3pm)|Image::ExifTool::TagInfoXML>
=cut
|
pericles-project/pet
|
nativeTools/exiftool_OSX/lib/Image/ExifTool/Lang/ja.pm
|
Perl
|
apache-2.0
| 207,422 |
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// 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.
// Generated code. DO NOT EDIT!
namespace Google.Cloud.Datastore.Admin.V1.Snippets
{
// [START datastore_v1_generated_DatastoreAdmin_ListIndexes_async]
using Google.Api.Gax;
using System;
using System.Linq;
using System.Threading.Tasks;
using gcdav = Google.Cloud.Datastore.Admin.V1;
public sealed partial class GeneratedDatastoreAdminClientSnippets
{
/// <summary>Snippet for ListIndexesAsync</summary>
/// <remarks>
/// This snippet has been automatically generated for illustrative purposes only.
/// It may require modifications to work in your environment.
/// </remarks>
public async Task ListIndexesRequestObjectAsync()
{
// Create client
DatastoreAdminClient datastoreAdminClient = await DatastoreAdminClient.CreateAsync();
// Initialize request argument(s)
ListIndexesRequest request = new ListIndexesRequest
{
ProjectId = "",
Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListIndexesResponse, gcdav::Index> response = datastoreAdminClient.ListIndexesAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((gcdav::Index item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListIndexesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (gcdav::Index item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<gcdav::Index> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (gcdav::Index item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
}
}
// [END datastore_v1_generated_DatastoreAdmin_ListIndexes_async]
}
|
googleapis/google-cloud-dotnet
|
apis/Google.Cloud.Datastore.Admin.V1/Google.Cloud.Datastore.Admin.V1.GeneratedSnippets/DatastoreAdminClient.ListIndexesRequestObjectAsyncSnippet.g.cs
|
C#
|
apache-2.0
| 3,337 |
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.support.v4.view.accessibility;
import android.os.Build;
import android.view.accessibility.AccessibilityEvent;
/**
* Helper for accessing features in {@link AccessibilityEvent}
* introduced after API level 4 in a backwards compatible fashion.
*/
public class AccessibilityEventCompat {
static interface AccessibilityEventVersionImpl {
public int getRecordCount(AccessibilityEvent event);
public void appendRecord(AccessibilityEvent event, Object record);
public Object getRecord(AccessibilityEvent event, int index);
}
static class AccessibilityEventStubImpl implements AccessibilityEventVersionImpl {
@Override
public void appendRecord(AccessibilityEvent event, Object record) {
}
@Override
public Object getRecord(AccessibilityEvent event, int index) {
return null;
}
@Override
public int getRecordCount(AccessibilityEvent event) {
return 0;
}
}
static class AccessibilityEventIcsImpl extends AccessibilityEventStubImpl {
@Override
public void appendRecord(AccessibilityEvent event, Object record) {
AccessibilityEventCompatIcs.appendRecord(event, record);
}
@Override
public Object getRecord(AccessibilityEvent event, int index) {
return AccessibilityEventCompatIcs.getRecord(event, index);
}
@Override
public int getRecordCount(AccessibilityEvent event) {
return AccessibilityEventCompatIcs.getRecordCount(event);
}
}
private final static AccessibilityEventVersionImpl IMPL;
static {
if (Build.VERSION.SDK_INT >= 14) { // ICS
IMPL = new AccessibilityEventIcsImpl();
} else {
IMPL = new AccessibilityEventStubImpl();
}
}
/**
* Represents the event of a hover enter over a {@link android.view.View}.
*/
public static final int TYPE_VIEW_HOVER_ENTER = 0x00000080;
/**
* Represents the event of a hover exit over a {@link android.view.View}.
*/
public static final int TYPE_VIEW_HOVER_EXIT = 0x00000100;
/**
* Represents the event of starting a touch exploration gesture.
*/
public static final int TYPE_TOUCH_EXPLORATION_GESTURE_START = 0x00000200;
/**
* Represents the event of ending a touch exploration gesture.
*/
public static final int TYPE_TOUCH_EXPLORATION_GESTURE_END = 0x00000400;
/**
* Represents the event of changing the content of a window.
*/
public static final int TYPE_WINDOW_CONTENT_CHANGED = 0x00000800;
/**
* Represents the event of scrolling a view.
*/
public static final int TYPE_VIEW_SCROLLED = 0x00001000;
/**
* Represents the event of changing the selection in an {@link android.widget.EditText}.
*/
public static final int TYPE_VIEW_TEXT_SELECTION_CHANGED = 0x00002000;
/**
* Represents the event of an application making an announcement.
*/
public static final int TYPE_ANNOUNCEMENT = 0x00004000;
/**
* Represents the event of gaining accessibility focus.
*/
public static final int TYPE_VIEW_ACCESSIBILITY_FOCUSED = 0x00008000;
/**
* Represents the event of clearing accessibility focus.
*/
public static final int TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED = 0x00010000;
/**
* Represents the event of traversing the text of a view at a given movement granularity.
*/
public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY = 0x00020000;
/**
* Represents the event of beginning gesture detection.
*/
public static final int TYPE_GESTURE_DETECTION_START = 0x00040000;
/**
* Represents the event of ending gesture detection.
*/
public static final int TYPE_GESTURE_DETECTION_END = 0x00080000;
/**
* Represents the event of the user starting to touch the screen.
*/
public static final int TYPE_TOUCH_INTERACTION_START = 0x00100000;
/**
* Represents the event of the user ending to touch the screen.
*/
public static final int TYPE_TOUCH_INTERACTION_END = 0x00200000;
/**
* Mask for {@link AccessibilityEvent} all types.
*
* @see AccessibilityEvent#TYPE_VIEW_CLICKED
* @see AccessibilityEvent#TYPE_VIEW_LONG_CLICKED
* @see AccessibilityEvent#TYPE_VIEW_SELECTED
* @see AccessibilityEvent#TYPE_VIEW_FOCUSED
* @see AccessibilityEvent#TYPE_VIEW_TEXT_CHANGED
* @see AccessibilityEvent#TYPE_WINDOW_STATE_CHANGED
* @see AccessibilityEvent#TYPE_NOTIFICATION_STATE_CHANGED
* @see #TYPE_VIEW_HOVER_ENTER
* @see #TYPE_VIEW_HOVER_EXIT
* @see #TYPE_TOUCH_EXPLORATION_GESTURE_START
* @see #TYPE_TOUCH_EXPLORATION_GESTURE_END
* @see #TYPE_WINDOW_CONTENT_CHANGED
* @see #TYPE_VIEW_SCROLLED
* @see #TYPE_VIEW_TEXT_SELECTION_CHANGED
* @see #TYPE_ANNOUNCEMENT
* @see #TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY
* @see #TYPE_GESTURE_DETECTION_START
* @see #TYPE_GESTURE_DETECTION_END
* @see #TYPE_TOUCH_INTERACTION_START
* @see #TYPE_TOUCH_INTERACTION_END
*/
public static final int TYPES_ALL_MASK = 0xFFFFFFFF;
/*
* Hide constructor from clients.
*/
private AccessibilityEventCompat() {
}
/**
* Gets the number of records contained in the event.
*
* @return The number of records.
*/
public static int getRecordCount(AccessibilityEvent event) {
return IMPL.getRecordCount(event);
}
/**
* Appends an {@link android.view.accessibility.AccessibilityRecord} to the end of
* event records.
*
* @param record The record to append.
*
* @throws IllegalStateException If called from an AccessibilityService.
*/
public static void appendRecord(AccessibilityEvent event, AccessibilityRecordCompat record) {
IMPL.appendRecord(event, record.getImpl());
}
/**
* Gets the record at a given index.
*
* @param index The index.
* @return The record at the specified index.
*/
public static AccessibilityRecordCompat getRecord(AccessibilityEvent event, int index) {
return new AccessibilityRecordCompat(IMPL.getRecord(event, index));
}
}
|
haikuowuya/android_system_code
|
src/android/support/v4/view/accessibility/AccessibilityEventCompat.java
|
Java
|
apache-2.0
| 6,987 |
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package accesscontrol
import (
"encoding/base64"
"encoding/pem"
"sync"
"time"
"github.com/hyperledger/fabric/common/util"
"github.com/spf13/viper"
"golang.org/x/net/context"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/peer"
)
var ttl = time.Minute * 10
type certHash string
type certMapper struct {
keyGen KeyGenFunc
sync.RWMutex
m map[certHash]string
tls bool
}
func newCertMapper(keyGen KeyGenFunc) *certMapper {
return &certMapper{
keyGen: keyGen,
tls: viper.GetBool("peer.tls.enabled"),
m: make(map[certHash]string),
}
}
func (r *certMapper) lookup(h certHash) string {
r.RLock()
defer r.RUnlock()
return r.m[h]
}
func (r *certMapper) register(hash certHash, name string) {
r.Lock()
defer r.Unlock()
r.m[hash] = name
time.AfterFunc(ttl, func() {
r.purge(hash)
})
}
func (r *certMapper) purge(hash certHash) {
r.Lock()
defer r.Unlock()
delete(r.m, hash)
}
func certKeyPairFromString(privKey string, pubKey string) (*certKeyPair, error) {
priv, err := base64.StdEncoding.DecodeString(privKey)
if err != nil {
return nil, err
}
pub, err := base64.StdEncoding.DecodeString(pubKey)
if err != nil {
return nil, err
}
return &certKeyPair{
CertKeyPair: &CertKeyPair{
Key: priv,
Cert: pub,
},
}, nil
}
func (r *certMapper) genCert(name string) (*certKeyPair, error) {
keyPair, err := r.keyGen()
if err != nil {
return nil, err
}
hash := util.ComputeSHA256(keyPair.cert.Raw)
r.register(certHash(hash), name)
return keyPair, nil
}
func encodePEM(keyType string, data []byte) []byte {
return pem.EncodeToMemory(&pem.Block{Type: keyType, Bytes: data})
}
// ExtractCertificateHash extracts the hash of the certificate from the stream
func extractCertificateHashFromContext(ctx context.Context) []byte {
pr, extracted := peer.FromContext(ctx)
if !extracted {
return nil
}
authInfo := pr.AuthInfo
if authInfo == nil {
return nil
}
tlsInfo, isTLSConn := authInfo.(credentials.TLSInfo)
if !isTLSConn {
return nil
}
certs := tlsInfo.State.PeerCertificates
if len(certs) == 0 {
return nil
}
raw := certs[0].Raw
if len(raw) == 0 {
return nil
}
return util.ComputeSHA256(raw)
}
|
lukehuangch/fabric
|
core/chaincode/accesscontrol/mapper.go
|
GO
|
apache-2.0
| 2,279 |
package org.apache.lucene.codecs.idversion;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.IOException;
import org.apache.lucene.index.PostingsEnum;
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef;
class SingleDocsEnum extends PostingsEnum {
private int doc;
private int singleDocID;
private Bits liveDocs;
/** For reuse */
public void reset(int singleDocID, Bits liveDocs) {
doc = -1;
this.liveDocs = liveDocs;
this.singleDocID = singleDocID;
}
@Override
public int nextDoc() {
if (doc == -1 && (liveDocs == null || liveDocs.get(singleDocID))) {
doc = singleDocID;
} else {
doc = NO_MORE_DOCS;
}
return doc;
}
@Override
public int docID() {
return doc;
}
@Override
public int advance(int target) {
if (doc == -1 && target <= singleDocID && (liveDocs == null || liveDocs.get(singleDocID))) {
doc = singleDocID;
} else {
doc = NO_MORE_DOCS;
}
return doc;
}
@Override
public long cost() {
return 1;
}
@Override
public int freq() {
return 1;
}
@Override
public int nextPosition() throws IOException {
return -1;
}
@Override
public int startOffset() throws IOException {
return -1;
}
@Override
public int endOffset() throws IOException {
return -1;
}
@Override
public BytesRef getPayload() throws IOException {
throw new UnsupportedOperationException();
}
}
|
q474818917/solr-5.2.0
|
lucene/sandbox/src/java/org/apache/lucene/codecs/idversion/SingleDocsEnum.java
|
Java
|
apache-2.0
| 2,233 |
.version.index3 /* version checker */
{
color: #0000F8;
background-color: #2D4A8E;
}
.html
{
background: #FFFFFF url("../images/wallpaper.jpg") no-repeat left top scroll;
background-size: cover;
}
#page
{
z-index: 1;
width: 1024px;
min-height: 1024px;
background-image: none;
border-style: none;
border-color: #000000;
background-color: transparent;
margin-left: auto;
margin-right: auto;
}
#page_position_content
{
padding-bottom: 924px;
width: 0.01px;
}
#u209
{
z-index: 2;
width: 100px;
min-height: 100px;
border-style: none;
border-color: transparent;
background-color: transparent;
left: -100px;
position: relative;
}
body
{
position: relative;
min-width: 1024px;
}
#page .verticalspacer
{
clear: both;
}
|
mendix/ChainableCustomWidget
|
test/theme/css/index3.css
|
CSS
|
apache-2.0
| 743 |
package v1
import (
kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/watch/versioned"
)
const (
GroupName = "quota.openshift.io"
LegacyGroupName = ""
)
// SchemeGroupVersion is group version used to register these objects
var (
SchemeGroupVersion = unversioned.GroupVersion{Group: GroupName, Version: "v1"}
LegacySchemeGroupVersion = unversioned.GroupVersion{Group: LegacyGroupName, Version: "v1"}
LegacySchemeBuilder = runtime.NewSchemeBuilder(addLegacyKnownTypes)
AddToSchemeInCoreGroup = LegacySchemeBuilder.AddToScheme
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
AddToScheme = SchemeBuilder.AddToScheme
)
// Kind takes an unqualified kind and returns back a Group qualified GroupKind
func Kind(kind string) unversioned.GroupKind {
return SchemeGroupVersion.WithKind(kind).GroupKind()
}
// Resource takes an unqualified resource and returns back a Group qualified GroupResource
func Resource(resource string) unversioned.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
// Adds the list of known types to api.Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
types := []runtime.Object{
&ClusterResourceQuota{},
&ClusterResourceQuotaList{},
&AppliedClusterResourceQuota{},
&AppliedClusterResourceQuotaList{},
}
scheme.AddKnownTypes(SchemeGroupVersion,
append(types,
&unversioned.Status{}, // TODO: revisit in 1.6 when Status is actually registered as unversioned
&kapi.ListOptions{},
&kapi.DeleteOptions{},
&kapi.ExportOptions{},
)...,
)
versioned.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
func addLegacyKnownTypes(scheme *runtime.Scheme) error {
types := []runtime.Object{
&ClusterResourceQuota{},
&ClusterResourceQuotaList{},
&AppliedClusterResourceQuota{},
&AppliedClusterResourceQuotaList{},
}
scheme.AddKnownTypes(LegacySchemeGroupVersion, types...)
return nil
}
|
dmage/origin
|
pkg/quota/api/v1/register.go
|
GO
|
apache-2.0
| 2,003 |
wget https://dist.thingsboard.io/thingsboard-3.3pe.rpm
|
volodymyr-babak/thingsboard.github.io
|
docs/user-guide/install/pe/resources/3.3pe/thingsboard-centos-download.sh
|
Shell
|
apache-2.0
| 55 |
/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package org.apache.batik.anim.timing;
import org.apache.batik.dom.events.DOMKeyEvent;
import org.apache.batik.dom.events.NodeEventTarget;
import org.apache.batik.constants.XMLConstants;
import org.w3c.dom.events.Event;
import org.w3c.dom.events.EventListener;
import org.w3c.dom.events.EventTarget;
import org.apache.batik.w3c.dom.events.KeyboardEvent;
/**
* A class to handle SMIL access key timing specifiers.
*
* @author <a href="mailto:cam%40mcc%2eid%2eau">Cameron McCormack</a>
* @version $Id$
*/
public class AccesskeyTimingSpecifier
extends EventLikeTimingSpecifier
implements EventListener {
/**
* The accesskey.
*/
protected char accesskey;
/**
* Whether this access key specifier uses SVG 1.2 syntax.
*/
protected boolean isSVG12AccessKey;
/**
* The DOM 3 key name for SVG 1.2 access key specifiers.
*/
protected String keyName;
/**
* Creates a new AccesskeyTimingSpecifier object using SVG 1.1
* or SMIL syntax.
*/
public AccesskeyTimingSpecifier(TimedElement owner, boolean isBegin,
float offset, char accesskey) {
super(owner, isBegin, offset);
this.accesskey = accesskey;
}
/**
* Creates a new AccesskeyTimingSpecifier object using SVG 1.2 syntax.
*/
public AccesskeyTimingSpecifier(TimedElement owner, boolean isBegin,
float offset, String keyName) {
super(owner, isBegin, offset);
this.isSVG12AccessKey = true;
this.keyName = keyName;
}
/**
* Returns a string representation of this timing specifier.
*/
public String toString() {
if (isSVG12AccessKey) {
return "accessKey(" + keyName + ")"
+ (offset != 0 ? super.toString() : "");
}
return "accesskey(" + accesskey + ")"
+ (offset != 0 ? super.toString() : "");
}
/**
* Initializes this timing specifier by adding the initial instance time
* to the owner's instance time list or setting up any event listeners.
*/
public void initialize() {
if (isSVG12AccessKey) {
NodeEventTarget eventTarget =
(NodeEventTarget) owner.getRootEventTarget();
eventTarget.addEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "keydown",
this, false, null);
} else {
EventTarget eventTarget = owner.getRootEventTarget();
eventTarget.addEventListener("keypress", this, false);
}
}
/**
* Deinitializes this timing specifier by removing any event listeners.
*/
public void deinitialize() {
if (isSVG12AccessKey) {
NodeEventTarget eventTarget =
(NodeEventTarget) owner.getRootEventTarget();
eventTarget.removeEventListenerNS
(XMLConstants.XML_EVENTS_NAMESPACE_URI, "keydown",
this, false);
} else {
EventTarget eventTarget = owner.getRootEventTarget();
eventTarget.removeEventListener("keypress", this, false);
}
}
// EventListener /////////////////////////////////////////////////////////
/**
* Handles key events fired by the eventbase element.
*/
public void handleEvent(Event e) {
boolean matched;
if (e.getType().charAt(3) == 'p') {
// DOM 2 key draft keypress
DOMKeyEvent evt = (DOMKeyEvent) e;
matched = evt.getCharCode() == accesskey;
} else {
// DOM 3 keydown
KeyboardEvent evt = (KeyboardEvent) e;
matched = evt.getKeyIdentifier().equals(keyName);
}
if (matched) {
owner.eventOccurred(this, e);
}
}
/**
* Invoked to resolve an event-like timing specifier into an instance time.
*/
public void resolve(Event e) {
float time = owner.getRoot().convertEpochTime(e.getTimeStamp());
InstanceTime instance = new InstanceTime(this, time + offset, true);
owner.addInstanceTime(instance, isBegin);
}
}
|
apache/batik
|
batik-anim/src/main/java/org/apache/batik/anim/timing/AccesskeyTimingSpecifier.java
|
Java
|
apache-2.0
| 4,985 |
/*******************************************************************************
* Copyright (c) 2015-2018 Skymind, Inc.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available 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.
*
* SPDX-License-Identifier: Apache-2.0
******************************************************************************/
package org.nd4j.aeron.ipc;
import org.nd4j.linalg.api.ndarray.INDArray;
/**
* An ndarray listener
* @author Adam Gibson
*/
public interface NDArrayCallback {
/**
* A listener for ndarray message
* @param message the message for the callback
*/
void onNDArrayMessage(NDArrayMessage message);
/**
* Used for partial updates using tensor along
* dimension
* @param arr the array to count as an update
* @param idx the index for the tensor along dimension
* @param dimensions the dimensions to act on for the tensor along dimension
*/
void onNDArrayPartial(INDArray arr, long idx, int... dimensions);
/**
* Setup an ndarray
* @param arr
*/
void onNDArray(INDArray arr);
}
|
deeplearning4j/deeplearning4j
|
nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/NDArrayCallback.java
|
Java
|
apache-2.0
| 1,526 |
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*/
package org.springframework.boot.actuate.health;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import org.springframework.util.Assert;
/**
* Default {@link HealthAggregator} implementation that aggregates {@link Health}
* instances and determines the final system state based on a simple ordered list.
* <p>
* If a different order is required or a new {@link Status} type will be used, the order
* can be set by calling {@link #setStatusOrder(List)}.
*
* @author Christian Dupuis
* @since 1.1.0
*/
public class OrderedHealthAggregator extends AbstractHealthAggregator {
private List<String> statusOrder;
/**
* Create a new {@link OrderedHealthAggregator} instance.
*/
public OrderedHealthAggregator() {
setStatusOrder(Status.DOWN, Status.OUT_OF_SERVICE, Status.UP, Status.UNKNOWN);
}
/**
* Set the ordering of the status.
* @param statusOrder an ordered list of the status
*/
public void setStatusOrder(Status... statusOrder) {
String[] order = new String[statusOrder.length];
for (int i = 0; i < statusOrder.length; i++) {
order[i] = statusOrder[i].getCode();
}
setStatusOrder(Arrays.asList(order));
}
/**
* Set the ordering of the status.
* @param statusOrder an ordered list of the status codes
*/
public void setStatusOrder(List<String> statusOrder) {
Assert.notNull(statusOrder, "StatusOrder must not be null");
this.statusOrder = statusOrder;
}
@Override
protected Status aggregateStatus(List<Status> candidates) {
// Only sort those status instances that we know about
List<Status> filteredCandidates = new ArrayList<>();
for (Status candidate : candidates) {
if (this.statusOrder.contains(candidate.getCode())) {
filteredCandidates.add(candidate);
}
}
// If no status is given return UNKNOWN
if (filteredCandidates.isEmpty()) {
return Status.UNKNOWN;
}
// Sort given Status instances by configured order
filteredCandidates.sort(new StatusComparator(this.statusOrder));
return filteredCandidates.get(0);
}
/**
* {@link Comparator} used to order {@link Status}.
*/
private class StatusComparator implements Comparator<Status> {
private final List<String> statusOrder;
StatusComparator(List<String> statusOrder) {
this.statusOrder = statusOrder;
}
@Override
public int compare(Status s1, Status s2) {
int i1 = this.statusOrder.indexOf(s1.getCode());
int i2 = this.statusOrder.indexOf(s2.getCode());
return (i1 < i2) ? -1 : (i1 != i2) ? 1 : s1.getCode().compareTo(s2.getCode());
}
}
}
|
kdvolder/spring-boot
|
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/OrderedHealthAggregator.java
|
Java
|
apache-2.0
| 3,204 |
<?php
namespace Admin\Controller;
use Common\Controller\CommonController;
/**
* 空模块,主要用于显示404页面,请不要删除
*/
class EmptyController extends CommonController{
//没有任何方法,直接执行HomeController的_empty方法
//请不要删除该控制器
//空操作
public function _empty(){
header("HTTP/1.0 404 Not Found");
$this->display('Public:404');
}
public function index() {
header ( "HTTP/1.0 404 Not Found" );
$this->display ( 'Public:404' );
}
}
|
gaowanyao/trading
|
App/Admin/Controller/EmptyController.class.php
|
PHP
|
apache-2.0
| 566 |
<?php namespace Fungku\NetSuite\Classes;
class CustomerCurrencyList {
public $currency;
public $replaceAll;
static $paramtypesmap = array(
"currency" => "CustomerCurrency[]",
"replaceAll" => "boolean",
);
}
|
Arkitecht/netsuite-php
|
src/Classes/CustomerCurrencyList.php
|
PHP
|
apache-2.0
| 217 |
public class Foo {
{
Foo foo = null;
Foo bar = id(foo);
<caret>
}
Foo id(Foo foo) {return foo;}
}
|
jexp/idea2
|
java/java-tests/testData/codeInsight/completion/smartType/SmartFinish-out.java
|
Java
|
apache-2.0
| 137 |
/**
* @fileoverview Provides AmpElement interface for typechecking. Includes
* smaller interfaces that modules can type-check against to keep expected
* API surfaces narrow, so it's clear what properties and methods are
* expected/required.
*
* @externs
*/
/**
* An interface for elements with pause functionality.
* @interface
*/
class PausableInterface {
/** @function */
pause() {}
}
/**
* Just an element, but used with AMP custom elements..
* @constructor
* @extends {HTMLElement}
* @implements {PausableInterface}
*/
let AmpElement = function () {};
/** @type {function(number=):!Promise} */
AmpElement.prototype.ensureLoaded;
/** @type {function():Promise} */
AmpElement.prototype.unmount;
/** @type {function():?Element} */
AmpElement.prototype.getPlaceholder;
|
jpettitt/amphtml
|
src/core/dom/amp-element.extern.js
|
JavaScript
|
apache-2.0
| 793 |
// CloudTableEntity.cs
// Script#/Libraries/Node/Azure
// This source code is subject to terms and conditions of the Apache License, Version 2.0.
//
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
namespace NodeApi.WindowsAzure.Storage {
[ScriptImport]
[ScriptIgnoreNamespace]
[ScriptName("Object")]
public sealed class CloudTableEntity {
public CloudTableEntity() {
}
public CloudTableEntity(params object[] nameValuePairs) {
}
[ScriptField]
[ScriptName(PreserveCase = true)]
public string PartitionKey {
get {
return null;
}
set {
}
}
[ScriptField]
[ScriptName(PreserveCase = true)]
public string RowKey {
get {
return null;
}
set {
}
}
[ScriptField]
public object this[string key] {
get {
return null;
}
set {
}
}
public static implicit operator Dictionary<string, object>(CloudTableEntity entity) {
return null;
}
public static implicit operator CloudTableEntity(Dictionary<string, object> data) {
return null;
}
}
}
|
nikhilk/scriptsharp
|
src/Libraries/Node/Node.Azure/Storage/CloudTableEntity.cs
|
C#
|
apache-2.0
| 1,358 |
/*
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/java/org/apache/commons/httpclient/params/HttpParamsFactory.java,v 1.5 2004/05/13 04:01:22 mbecke Exp $
* $Revision: 155418 $
* $Date: 2005-02-26 08:01:52 -0500 (Sat, 26 Feb 2005) $
*
* ====================================================================
*
* Copyright 1999-2004 The Apache Software Foundation
*
* 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.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.commons.httpclient.params;
/**
* A factory for getting the default set of parameters to use when creating an instance of
* <code>HttpParams</code>.
*
* @see org.apache.commons.httpclient.params.DefaultHttpParams#setHttpParamsFactory(HttpParamsFactory)
*
* @since 3.0
*/
public interface HttpParamsFactory {
/**
* Gets the default parameters. This method may be called more than once and is not required
* to always return the same value.
*
* @return an instance of HttpParams
*/
HttpParams getDefaultParams();
}
|
magneticmoon/httpclient3-ntml
|
src/java/org/apache/commons/httpclient/params/HttpParamsFactory.java
|
Java
|
apache-2.0
| 1,879 |
--TEST--
GetMany - correct arguments, with options but without filter bins
--FILE--
<?php
include dirname(__FILE__)."/../../astestframework/astest-phpt-loader.inc";
aerospike_phpt_runtest("GetMany", "testGetManyWithOptionsPositive");
--EXPECT--
OK
|
aerospike/aerospike-client-php
|
src/tests/phpt/GetMany/TestGetManyWithOptionsPositive.phpt
|
PHP
|
apache-2.0
| 250 |
if (process.platform === 'darwin') {
var gui = require('nw.gui');
var menuBar = new gui.Menu({
type: "menubar"
});
menuBar.createMacBuiltin(gui.App.manifest.name);
gui.Window.get().menu = menuBar;
}
(function() {
var gui = require('nw.gui');
var mainWindow;
var width = 400;
var height = 500;
global.openMainWindow = function() {
if (!mainWindow) {
mainWindow = gui.Window.open(
'index.main.html', {
title: gui.App.manifest.name,
show: false,
toolbar: false,
frame: true,
width: width,
height: height,
min_width: width,
min_height: 300,
position: "center",
icon: 'configuration/favicon.png',
focus: true,
});
mainWindow.on('document-end', function() {
mainWindow.title = gui.App.manifest.name;
mainWindow.show();
mainWindow.focus();
});
mainWindow.on('closed', function() {
mainWindow = null;
});
mainWindow.on('new-win-policy', function(frame, url, policy) {
gui.Shell.openExternal(url);
policy.ignore();
});
} else {
mainWindow.show();
mainWindow.focus();
}
};
global.closeMainWindow = function() {
if (mainWindow) {
mainWindow.close();
mainWindow = null;
}
};
})();
(function() {
var gui = require('nw.gui');
function getConferenceUri(argv) {
var result;
var re = /pexip:(\S+)/i;
argv.forEach(function(arg) {
var match = re.exec(arg);
if (match) {
result = match[1];
}
});
return result;
}
function main(argv) {
console.log("main: argv", argv);
var conferenceUri = argv && getConferenceUri(argv);
console.log("main: conferenceUri", conferenceUri);
if (conferenceUri) {
global.join(conferenceUri);
} else {
global.openMainWindow();
}
}
gui.App.on('open', function(cmdline) {
console.log("App.on('open')", cmdline);
var argv = cmdline.split(/\s/);
main(argv);
});
gui.App.on('reopen', function(argv) {
console.log("App.on('reopen')", argv);
main(argv);
});
gui.Window.get().on('loaded', function() {
main(gui.App.argv);
});
})();
|
gzwfdy/zone
|
src/main/webapp/static/app/desktop-client/js/main.js
|
JavaScript
|
apache-2.0
| 2,677 |
/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.wso2.carbon.identity.user.store.count.jdbc.internal;
/**
* Constants that are used in internal store for count users and roles.
*/
public class InternalStoreCountConstants {
public static final String APPLICATION_DOMAIN = "Application";
public static final String COUNT_INTERNAL_ROLES_SQL = "SELECT COUNT(UM_ID) AS RESULT FROM UM_HYBRID_ROLE WHERE " +
"UM_ROLE_NAME LIKE ? AND " + "UM_TENANT_ID = ?";
public static final String COUNT_INTERNAL_ONLY_ROLES_SQL = "SELECT COUNT(UM_ID) AS RESULT FROM UM_HYBRID_ROLE " +
"WHERE UM_ROLE_NAME NOT LIKE '" + APPLICATION_DOMAIN + "%' AND UM_ROLE_NAME LIKE ? AND UM_TENANT_ID = ?";
}
|
omindu/carbon-identity-framework
|
components/user-store/org.wso2.carbon.identity.user.store.count/src/main/java/org/wso2/carbon/identity/user/store/count/jdbc/internal/InternalStoreCountConstants.java
|
Java
|
apache-2.0
| 1,347 |
<!DOCTYPE html>
<html lang="en">
<head>
<title>IdentifiedLanguage Struct Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Struct/IdentifiedLanguage" class="dashAnchor"></a>
<a title="IdentifiedLanguage Struct Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html"> Docs</a></p>
<p class="header-right"><a href="https://github.com/watson-developer-cloud/ios-sdk"><img src="../img/gh.png"/>View on GitHub</a></p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html"> Reference</a>
<img id="carat" src="../img/carat.png" />
IdentifiedLanguage Struct Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/LanguageTranslator.html">LanguageTranslator</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Enums.html">Enums</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Enums/TrainingStatus.html">TrainingStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Structs.html">Structs</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Structs/IdentifiableLanguage.html">IdentifiableLanguage</a>
</li>
<li class="nav-group-task">
<a href="../Structs/IdentifiedLanguage.html">IdentifiedLanguage</a>
</li>
<li class="nav-group-task">
<a href="../Structs/MonitorTraining.html">MonitorTraining</a>
</li>
<li class="nav-group-task">
<a href="../Structs/TranslateResponse.html">TranslateResponse</a>
</li>
<li class="nav-group-task">
<a href="../Structs/Translation.html">Translation</a>
</li>
<li class="nav-group-task">
<a href="../Structs/TranslationModel.html">TranslationModel</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>IdentifiedLanguage</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">IdentifiedLanguage</span><span class="p">:</span> <span class="kt">JSONDecodable</span></code></pre>
</div>
</div>
<p>An identified language.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:vV20LanguageTranslatorV218IdentifiedLanguage8languageSS"></a>
<a name="//apple_ref/swift/Property/language" class="dashAnchor"></a>
<a class="token" href="#/s:vV20LanguageTranslatorV218IdentifiedLanguage8languageSS">language</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The code of the identified language.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">language</span><span class="p">:</span> <span class="kt">String</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:vV20LanguageTranslatorV218IdentifiedLanguage10confidenceSd"></a>
<a name="//apple_ref/swift/Property/confidence" class="dashAnchor"></a>
<a class="token" href="#/s:vV20LanguageTranslatorV218IdentifiedLanguage10confidenceSd">confidence</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The confidence score of the identified language.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">confidence</span><span class="p">:</span> <span class="kt">Double</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:FV20LanguageTranslatorV218IdentifiedLanguagecFzT4jsonV7RestKit4JSON_S0_"></a>
<a name="//apple_ref/swift/Method/init(json:)" class="dashAnchor"></a>
<a class="token" href="#/s:FV20LanguageTranslatorV218IdentifiedLanguagecFzT4jsonV7RestKit4JSON_S0_">init(json:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Used internally to initialize an <code>IdentifiedLanguage</code> model from JSON.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">(</span><span class="nv">json</span><span class="p">:</span> <span class="kt">JSON</span><span class="p">)</span> <span class="k">throws</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>© 2017 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2017-03-02)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.7.3</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>
|
tad-iizuka/swift-sdk
|
docs/swift-api/services/LanguageTranslatorV2/docsets/.docset/Contents/Resources/Documents/Structs/IdentifiedLanguage.html
|
HTML
|
apache-2.0
| 8,162 |
/*
* Copyright (c) 2008-2020, Hazelcast, Inc. 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.
*/
package com.hazelcast.cp.internal.datastructures.atomiclong.operation;
import com.hazelcast.cp.IAtomicLong;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.cp.CPGroupId;
import com.hazelcast.cp.internal.datastructures.atomiclong.AtomicLongDataSerializerHook;
import com.hazelcast.cp.internal.datastructures.atomiclong.AtomicLong;
import java.io.IOException;
/**
* Operation for {@link IAtomicLong#getAndSet(long)}
*/
public class GetAndSetOp extends AbstractAtomicLongOp {
private long value;
public GetAndSetOp() {
}
public GetAndSetOp(String name, long value) {
super(name);
this.value = value;
}
@Override
public Object run(CPGroupId groupId, long commitIndex) {
AtomicLong atomic = getAtomicLong(groupId);
return atomic.getAndSet(value);
}
@Override
public void writeData(ObjectDataOutput out) throws IOException {
super.writeData(out);
out.writeLong(value);
}
@Override
public void readData(ObjectDataInput in) throws IOException {
super.readData(in);
value = in.readLong();
}
@Override
public int getClassId() {
return AtomicLongDataSerializerHook.GET_AND_SET_OP;
}
@Override
protected void toString(StringBuilder sb) {
super.toString(sb);
sb.append(", value=").append(value);
}
}
|
mdogan/hazelcast
|
hazelcast/src/main/java/com/hazelcast/cp/internal/datastructures/atomiclong/operation/GetAndSetOp.java
|
Java
|
apache-2.0
| 2,053 |
/*
* Author: Landon Fuller <[email protected]>
*
* Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc.
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#import "ApigeePLCrashAsyncMObject.h"
#import <stdint.h>
#import <inttypes.h>
/**
* @internal
* @ingroup plcrash_async
*
* Implements async-safe cross-task memory mapping.
*
* @{
*/
/**
* Map pages starting at @a task_addr from @a task into the current process. The mapping
* will be copy-on-write, and will be checked to ensure a minimum protection value of
* VM_PROT_READ.
*
* @param task The task from which the memory will be mapped.
* @param task_address The task-relative address of the memory to be mapped. This is not required to fall on a page boundry.
* @param length The total size of the mapping to create.
* @param require_full If false, short mappings will be permitted in the case where a memory object of the requested length
* does not exist at the target address. It is the caller's responsibility to validate the resulting length of the
* mapping, eg, using plcrash_async_mobject_remap_address() and similar. If true, and the entire requested page range is
* not valid, the mapping request will fail.
* @param result[out] The in-process address at which the pages were mapped.
* @param result_length[out] The total size, in bytes, of the mapped pages.
*
* @return On success, returns PLCRASH_ESUCCESS. On failure, one of the plcrash_error_t error values will be returned, and no
* mapping will be performed.
*
* @note
* This code previously used vm_remap() to perform atomic remapping of process memory. However, this appeared
* to trigger a kernel bug (and resulting panic) on iOS 6.0 through 6.1.2, possibly fixed in 6.1.3. Note that
* no stable release of PLCrashReporter shipped with the vm_remap() code.
*
* Investigation of the failure seems to show an over-release of the target vm_map and backing vm_object, leading to
* NULL dereference, invalid memory references, and in some cases, deadlocks that result in watchdog timeouts.
*
* In one example case, the crash occurs in update_first_free_ll() as a NULL dereference of the vm_map_entry_t parameter.
* Analysis of the limited reports shows that this is called via vm_map_store_update_first_free(). No backtrace is
* available from the kernel panics, but analyzing the register state demonstrates:
* - A reference to vm_map_store_update_first_free() remains in the link register.
* - Of the following callers, one can be eliminated by register state:
* - vm_map_enter - not possible, r3 should be equal to r0
* - vm_map_clip_start - possible
* - vm_map_clip_unnest - possible
* - vm_map_clip_end - possible
*
* In the other panic seen in vm_object_reap_pages(), a value of 0x8008 is loaded and deferenced from the next pointer
* of an element within the vm_object's resident page queue (object->memq).
*
* Unfortunately, our ability to investigate has been extremely constrained by the following issues;
* - The panic is not easily or reliably reproducible
* - Apple's does not support iOS kernel debugging
* - There is no support for jailbreak kernel debugging against iOS 6.x devices at the time of writing.
*
* The work-around used here is to split the vm_remap() into distinct calls to mach_make_memory_entry_64() and
* vm_map(); this follows a largely distinct code path from vm_remap(). In testing by a large-scale user of PLCrashReporter,
* they were no longer able to reproduce the issue with this fix in place. Additionally, they've not been able to reproduce
* the issue on 6.1.3 devices, or had any reports of the issue occuring on 6.1.3 devices.
*
* The mach_make_memory_entry_64() API may not actually return an entry for the full requested length; this requires
* that we loop through the full range, requesting an entry for the remaining unallocated pages, and then mapping
* the pages in question. Since this requires multiple calls to vm_map(), we pre-allocate a contigious range of pages
* for the target mappings into which we'll insert (via overwrite) our own mappings.
*
* @note
* As a work-around for bugs in Apple's Mach-O/dyld implementation, we provide the @a require_full flag; if false,
* a successful mapping that is smaller than the requested range may be made, and will not return an error. This is necessary
* to allow our callers to work around bugs in update_dyld_shared_cache(1), which writes out a larger Mach-O VM segment
* size value than is actually available and mappable. See the plcrash_async_macho_map_segment() API documentation for
* more details. This bug has been reported to Apple as rdar://13707406.
*/
static apigee_plcrash_error_t apigee_plcrash_async_mobject_remap_pages_workaround (mach_port_t task,
pl_vm_address_t task_addr,
pl_vm_size_t length,
bool require_full,
pl_vm_address_t *result,
pl_vm_size_t *result_length)
{
kern_return_t kt;
/* Compute the total required page size. */
pl_vm_address_t base_addr = mach_vm_trunc_page(task_addr);
pl_vm_size_t total_size = mach_vm_round_page(length + (task_addr - base_addr));
/*
* If short mappings are permitted, determine the actual mappable size of the target range. Due
* to rdar://13707406 (update_dyld_shared_cache appears to write invalid LINKEDIT vmsize), an
* LC_SEGMENT-reported VM size may be far larger than the actual mapped pages. This would result
* in us making large (eg, 36MB) allocations in cases where the mappable range is actually much
* smaller, which can trigger out-of-memory conditions on smaller devices.
*/
if (!require_full) {
pl_vm_size_t verified_size = 0;
while (verified_size < total_size) {
memory_object_size_t entry_length = total_size - verified_size;
mach_port_t mem_handle;
/* Fetch an entry reference */
kt = mach_make_memory_entry_64(task, &entry_length, base_addr + verified_size, VM_PROT_READ, &mem_handle, MACH_PORT_NULL);
if (kt != KERN_SUCCESS) {
/* Once we hit an unmappable page, break */
break;
}
/* Drop the reference */
kt = mach_port_mod_refs(mach_task_self(), mem_handle, MACH_PORT_RIGHT_SEND, -1);
if (kt != KERN_SUCCESS) {
PLCF_DEBUG("mach_port_mod_refs(-1) failed: %d", kt);
}
/* Note the size */
verified_size += entry_length;
}
/* No valid page found at the task_addr */
if (verified_size == 0) {
PLCF_DEBUG("No mappable pages found at 0x%" PRIx64, (uint64_t) task_addr);
return APIGEE_PLCRASH_ENOMEM;
}
/* Reduce the total size to the verified size */
if (verified_size < total_size)
total_size = verified_size;
}
/*
* Set aside a memory range large enough for the total requested number of pages. Ideally the kernel
* will lazy-allocate the backing physical pages so that we don't waste actual memory on this
* pre-emptive page range reservation.
*/
pl_vm_address_t mapping_addr = 0x0;
pl_vm_size_t mapped_size = 0;
#ifdef PL_HAVE_MACH_VM
kt = mach_vm_allocate(mach_task_self(), &mapping_addr, total_size, VM_FLAGS_ANYWHERE);
#else
kt = vm_allocate(mach_task_self(), &mapping_addr, total_size, VM_FLAGS_ANYWHERE);
#endif
if (kt != KERN_SUCCESS) {
PLCF_DEBUG("Failed to allocate a target page range for the page remapping: %d", kt);
return APIGEE_PLCRASH_EINTERNAL;
}
/* Map the source pages into the allocated region, overwriting the existing page mappings */
while (mapped_size < total_size) {
/* Create a reference to the target pages. The returned entry may be smaller than the total length. */
memory_object_size_t entry_length = total_size - mapped_size;
mach_port_t mem_handle;
kt = mach_make_memory_entry_64(task, &entry_length, base_addr + mapped_size, VM_PROT_READ, &mem_handle, MACH_PORT_NULL);
if (kt != KERN_SUCCESS) {
/* No pages are found at the target. When validating the total length above, we already verified the
* availability of the requested pages; if they've now disappeared, we can treat it as an error,
* even if !require_full was specified */
PLCF_DEBUG("mach_make_memory_entry_64() failed: %d", kt);
/* Clean up the reserved pages */
kt = vm_deallocate(mach_task_self(), mapping_addr, total_size);
if (kt != KERN_SUCCESS) {
PLCF_DEBUG("vm_deallocate() failed: %d", kt);
}
/* Return error */
return APIGEE_PLCRASH_ENOMEM;
}
/* Map the pages into our local task, overwriting the allocation used to reserve the target space above. */
pl_vm_address_t target_address = mapping_addr + mapped_size;
#ifdef PL_HAVE_MACH_VM
kt = mach_vm_map(mach_task_self(), &target_address, entry_length, 0x0, VM_FLAGS_FIXED|VM_FLAGS_OVERWRITE, mem_handle, 0x0, TRUE, VM_PROT_READ, VM_PROT_READ, VM_INHERIT_COPY);
#else
kt = vm_map(mach_task_self(), &target_address, entry_length, 0x0, VM_FLAGS_FIXED|VM_FLAGS_OVERWRITE, mem_handle, 0x0, TRUE, VM_PROT_READ, VM_PROT_READ, VM_INHERIT_COPY);
#endif /* !PL_HAVE_MACH_VM */
/* Drop the memory handle */
kt = mach_port_mod_refs(mach_task_self(), mem_handle, MACH_PORT_RIGHT_SEND, -1);
if (kt != KERN_SUCCESS) {
PLCF_DEBUG("mach_port_mod_refs(-1) failed: %d", kt);
}
if (kt != KERN_SUCCESS) {
PLCF_DEBUG("vm_map() failure: %d", kt);
/* Clean up the reserved pages */
kt = vm_deallocate(mach_task_self(), mapping_addr, total_size);
if (kt != KERN_SUCCESS) {
PLCF_DEBUG("vm_deallocate() failed: %d", kt);
}
return APIGEE_PLCRASH_ENOMEM;
}
/* Adjust the total mapping size */
mapped_size += entry_length;
}
*result = mapping_addr;
*result_length = mapped_size;
return APIGEE_PLCRASH_ESUCCESS;
}
/**
* Initialize a new memory object reference, mapping @a task_addr from @a task into the current process. The mapping
* will be copy-on-write, and will be checked to ensure a minimum protection value of VM_PROT_READ.
*
* @param mobj Memory object to be initialized.
* @param task The task from which the memory will be mapped.
* @param task_address The task-relative address of the memory to be mapped. This is not required to fall on a page boundry.
* @param length The total size of the mapping to create.
* @param require_full If false, short mappings will be permitted in the case where a memory object of the requested length
* does not exist at the target address. It is the caller's responsibility to validate the resulting length of the
* mapping, eg, using plcrash_async_mobject_remap_address() and similar. If true, and the entire requested page range is
* not valid, the mapping request will fail.
*
* @return On success, returns PLCRASH_ESUCCESS. On failure, one of the plcrash_error_t error values will be returned, and no
* mapping will be performed.
*/
apigee_plcrash_error_t apigee_plcrash_async_mobject_init (apigee_plcrash_async_mobject_t *mobj, mach_port_t task, pl_vm_address_t task_addr, pl_vm_size_t length, bool require_full) {
apigee_plcrash_error_t err;
/* Perform the page mapping */
err = apigee_plcrash_async_mobject_remap_pages_workaround(task, task_addr, length, require_full, &mobj->vm_address, &mobj->vm_length);
if (err != APIGEE_PLCRASH_ESUCCESS)
return err;
/* Determine the offset and length of the actual data */
mobj->address = mobj->vm_address + (task_addr - mach_vm_trunc_page(task_addr));
mobj->length = mobj->vm_length - (mobj->address - mobj->vm_address);
/* Ensure that the length is capped to the user's requested length, rather than the total length once rounded up
* to a full page. The length might already be smaller than the requested length if require_full is false. */
if (mobj->length > length)
mobj->length = length;
/* Determine the difference between the target and local mappings. Note that this needs to be computed on either two page
* aligned addresses, or two non-page aligned addresses. Mixing task_addr and vm_address would return an incorrect offset. */
mobj->vm_slide = task_addr - mobj->address;
/* Save the task-relative address */
mobj->task_address = task_addr;
/* Save the task reference */
mobj->task = task;
mach_port_mod_refs(mach_task_self(), mobj->task, MACH_PORT_RIGHT_SEND, 1);
return APIGEE_PLCRASH_ESUCCESS;
}
/**
* Return the base (target process relative) address for this mapping.
*
* @param mobj An initialized memory object.
*/
pl_vm_address_t apigee_plcrash_async_mobject_base_address (apigee_plcrash_async_mobject_t *mobj) {
return mobj->task_address;
}
/**
* Return the length of this mapping.
*
* @param mobj An initialized memory object.
*/
pl_vm_address_t apigee_plcrash_async_mobject_length (apigee_plcrash_async_mobject_t *mobj) {
return mobj->length;
}
/**
* Return a borrowed reference to the backing task for this mapping.
*
* @param mobj An initialized memory object.
*/
task_t apigee_plcrash_async_mobject_task (apigee_plcrash_async_mobject_t *mobj) {
return mobj->task;
}
/**
* Verify that @a length bytes starting at local @a address is within @a mobj's mapped range.
*
* @param mobj An initialized memory object.
* @param address An address within the current task's memory space.
* @param offset An offset to be applied to @a address prior to verifying the address range.
* @param length The number of bytes that should be readable at @a address + @a offset.
*/
bool apigee_plcrash_async_mobject_verify_local_pointer (apigee_plcrash_async_mobject_t *mobj, uintptr_t address, pl_vm_off_t offset, size_t length) {
/* Verify that the offset value won't overrun a native pointer */
if (offset > 0 && UINTPTR_MAX - offset < address) {
return false;
} else if (offset < 0 && (offset * -1) > address) {
return false;
}
/* Adjust the address using the verified offset */
address += offset;
/* Verify that the address starts within range */
if (address < mobj->address) {
// PLCF_DEBUG("Address %" PRIx64 " < base address %" PRIx64 "", (uint64_t) address, (uint64_t) mobj->address);
return false;
}
/* Verify that the address value won't overrun */
if (UINTPTR_MAX - length < address)
return false;
/* Check that the block ends within range */
if (mobj->address + mobj->length < address + length) {
// PLCF_DEBUG("Address %" PRIx64 " out of range %" PRIx64 " + %" PRIx64, (uint64_t) address, (uint64_t) mobj->address, (uint64_t) mobj->length);
return false;
}
return true;
}
/**
* Validate a target process' address pointer's availability via @a mobj, verifying that @a length bytes can be read
* from @a mobj at @a address, and return the pointer from which a @a length read may be performed.
*
* @param mobj An initialized memory object.
* @param address The base address to be read. This address should be relative to the target task's address space.
* @param offset An offset to be applied to @a address prior to verifying the address range.
* @param length The total number of bytes that should be readable at @a address.
*
* @return Returns the validated pointer, or NULL if the requested bytes are not within @a mobj's range.
*/
void *apigee_plcrash_async_mobject_remap_address (apigee_plcrash_async_mobject_t *mobj, pl_vm_address_t address, pl_vm_off_t offset, size_t length) {
/* Map into our memory space */
pl_vm_address_t remapped = address - mobj->vm_slide;
if (!apigee_plcrash_async_mobject_verify_local_pointer(mobj, (uintptr_t) remapped, offset, length))
return NULL;
return (void *) remapped + offset;
}
/**
* Read a single byte from @a mobj.
*
* @param mobj Memory object from which to read the value.
* @param address The base address to be read. This address should be relative to the target task's address space.
* @param offset An offset to be applied to @a address.
* @param result The destination to which the data will be written.
*
* @return Returns PLCRASH_ESUCCESS on success, PLCRASH_EINVAL if the target address does not fall within the @a mobj address
* range, or one of the plcrash_error_t constants for other error conditions.
*/
apigee_plcrash_error_t apigee_plcrash_async_mobject_read_uint8 (apigee_plcrash_async_mobject_t *mobj, pl_vm_address_t address, pl_vm_off_t offset, uint8_t *result) {
uint8_t *input = apigee_plcrash_async_mobject_remap_address(mobj, address, offset, sizeof(uint8_t));
if (input == NULL)
return APIGEE_PLCRASH_EINVAL;
*result = *input;
return APIGEE_PLCRASH_ESUCCESS;
}
/**
* Read a 16-bit value from @a mobj.
*
* @param mobj Memory object from which to read the value.
* @param byteorder Byte order of the target value.
* @param address The base address to be read. This address should be relative to the target task's address space.
* @param offset An offset to be applied to @a address.
* @param result The destination to which the data will be written, after @a byteorder has been applied.
*
* @return Returns PLCRASH_ESUCCESS on success, PLCRASH_EINVAL if the target address does not fall within the @a mobj address
* range, or one of the plcrash_error_t constants for other error conditions.
*/
apigee_plcrash_error_t apigee_plcrash_async_mobject_read_uint16 (apigee_plcrash_async_mobject_t *mobj, const apigee_plcrash_async_byteorder_t *byteorder,
pl_vm_address_t address, pl_vm_off_t offset, uint16_t *result)
{
uint16_t *input = apigee_plcrash_async_mobject_remap_address(mobj, address, offset, sizeof(uint16_t));
if (input == NULL)
return APIGEE_PLCRASH_EINVAL;
*result = byteorder->swap16(*input);
return APIGEE_PLCRASH_ESUCCESS;
}
/**
* Read a 32-bit value from @a mobj.
*
* @param mobj Memory object from which to read the value.
* @param byteorder Byte order of the target value.
* @param address The base address to be read. This address should be relative to the target task's address space.
* @param offset An offset to be applied to @a address.
* @param result The destination to which the data will be written, after @a byteorder has been applied.
*
* @return Returns PLCRASH_ESUCCESS on success, PLCRASH_EINVAL if the target address does not fall within the @a mobj address
* range, or one of the plcrash_error_t constants for other error conditions.
*/
apigee_plcrash_error_t apigee_plcrash_async_mobject_read_uint32 (apigee_plcrash_async_mobject_t *mobj, const apigee_plcrash_async_byteorder_t *byteorder,
pl_vm_address_t address, pl_vm_off_t offset, uint32_t *result)
{
uint32_t *input = apigee_plcrash_async_mobject_remap_address(mobj, address, offset, sizeof(uint32_t));
if (input == NULL)
return APIGEE_PLCRASH_EINVAL;
*result = byteorder->swap32(*input);
return APIGEE_PLCRASH_ESUCCESS;
}
/**
* Read a 64-bit value from @a mobj.
*
* @param mobj Memory object from which to read the value.
* @param byteorder Byte order of the target value.
* @param address The base address to be read. This address should be relative to the target task's address space.
* @param offset An offset to be applied to @a address.
* @param result The destination to which the data will be written, after @a byteorder has been applied.
*
* @return Returns PLCRASH_ESUCCESS on success, PLCRASH_EINVAL if the target address does not fall within the @a mobj address
* range, or one of the plcrash_error_t constants for other error conditions.
*/
apigee_plcrash_error_t apigee_plcrash_async_mobject_read_uint64 (apigee_plcrash_async_mobject_t *mobj, const apigee_plcrash_async_byteorder_t *byteorder,
pl_vm_address_t address, pl_vm_off_t offset, uint64_t *result)
{
uint64_t *input = apigee_plcrash_async_mobject_remap_address(mobj, address, offset, sizeof(uint64_t));
if (input == NULL)
return APIGEE_PLCRASH_EINVAL;
*result = byteorder->swap64(*input);
return APIGEE_PLCRASH_ESUCCESS;
}
/**
* Free the memory mapping.
*
* @note Unlike most free() functions in this API, this function is async-safe.
*/
void apigee_plcrash_async_mobject_free (apigee_plcrash_async_mobject_t *mobj) {
kern_return_t kt;
#ifdef PL_HAVE_MACH_VM
kt = mach_vm_deallocate(mach_task_self(), mobj->vm_address, mobj->vm_length);
#else
kt = vm_deallocate(mach_task_self(), mobj->vm_address, mobj->vm_length);
#endif
if (kt != KERN_SUCCESS)
PLCF_DEBUG("vm_deallocate() failure: %d", kt);
/* Decrement our task refcount */
mach_port_mod_refs(mach_task_self(), mobj->task, MACH_PORT_RIGHT_SEND, -1);
}
/**
* @} plcrash_async
*/
|
pauldardeau/apigee-ios-sdk
|
source/Classes/CrashReporter/ApigeePLCrashAsyncMObject.c
|
C
|
apache-2.0
| 22,758 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.jackrabbit.spi2dav;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import org.junit.Test;
public class IdURICacheTest {
@Test
public void testException() {
String wspuri = "https://example.org/foo/";
IdURICache cache = new IdURICache(wspuri);
String test;
// port number
test = "https://example.org:443/foo/x";
try {
cache.add(test, null);
fail("should throw");
} catch (IllegalArgumentException ex) {
assertEquals("Workspace mismatch: '" + test + "' not under workspace '" + wspuri
+ "' (position 18: '{https://example.org}:443/foo/x', expected: '/foo/')", ex.getMessage());
}
// protocol
test = "http://example.org/foo/x";
try {
cache.add(test, null);
fail("should throw");
} catch (IllegalArgumentException ex) {
assertEquals("Workspace mismatch: '" + test + "' not under workspace '" + wspuri
+ "' (position 3: '{http}://example.org/foo/x', expected: 's://example.org/foo/')", ex.getMessage());
}
// hostname
test = "https://example.com/foo/x";
try {
cache.add(test, null);
fail("should throw");
} catch (IllegalArgumentException ex) {
assertEquals("Workspace mismatch: '" + test + "' not under workspace '" + wspuri
+ "' (position 15: '{https://example.}com/foo/x', expected: 'org/foo/')", ex.getMessage());
}
// root path
test = "https://example.org/bar/x";
try {
cache.add(test, null);
fail("should throw");
} catch (IllegalArgumentException ex) {
assertEquals("Workspace mismatch: '" + test + "' not under workspace '" + wspuri
+ "' (position 19: '{https://example.org/}bar/x', expected: 'foo/')", ex.getMessage());
}
// too short
test = "https://example.org/fo/x";
try {
cache.add(test, null);
fail("should throw");
} catch (IllegalArgumentException ex) {
assertEquals("Workspace mismatch: '" + test + "' not under workspace '" + wspuri
+ "' (position 21: '{https://example.org/fo}/x', expected: 'o/')", ex.getMessage());
}
// way too short
test = "https://x.org/foo/x";
try {
cache.add(test, null);
fail("should throw");
} catch (IllegalArgumentException ex) {
assertEquals("Workspace mismatch: '" + test + "' not under workspace '" + wspuri
+ "' (position 7: '{https://}x.org/foo/x', expected: 'example.org/foo/')", ex.getMessage());
}
}
}
|
apache/jackrabbit
|
jackrabbit-spi2dav/src/test/java/org/apache/jackrabbit/spi2dav/IdURICacheTest.java
|
Java
|
apache-2.0
| 3,631 |
#pragma once
#include "resource.h"
///
/// The method puts the TCP connections window in its own thread
///
void thread_Proc2();
class TCPForm : public CDialog
{
DECLARE_DYNAMIC(TCPForm)
public:
TCPForm(CWnd* pParent = NULL); // standart constructor
void TCPForm::HideLabel();
virtual ~TCPForm();
// dialog window data
enum { IDD = IDD_DIALOG2 };
protected:
virtual void DoDataExchange(CDataExchange* pDX); //DDX/DDV support
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedOk();
afx_msg void OnBnClickedUpdate();
};
|
Vukiz/OSNetShield
|
OSNetShield/OSNetShield/TCPForm.h
|
C
|
apache-2.0
| 542 |
//
// MKAnnotationView+WebCache.h
// CMSDWebImage
//
// Created by Olivier Poitrey on 14/03/12.
// Copyright (c) 2012 Dailymotion. All rights reserved.
//
#import "MapKit/MapKit.h"
#import "CMSDWebImageManager.h"
/**
* Integrates CMSDWebImage async downloading and caching of remote images with MKAnnotationView.
*/
@interface MKAnnotationView (CMWebCache)
/**
* Get the current image URL.
*
* Note that because of the limitations of categories this property can get out of sync
* if you use CMSD_setImage: directly.
*/
- (NSURL *)CMSD_imageURL;
/**
* Set the imageView `image` with an `url`.
*
* The download is asynchronous and cached.
*
* @param url The url for the image.
*/
- (void)CMSD_setImageWithURL:(NSURL *)url;
/**
* Set the imageView `image` with an `url` and a placeholder.
*
* The download is asynchronous and cached.
*
* @param url The url for the image.
* @param placeholder The image to be set initially, until the image request finishes.
* @see CMSD_setImageWithURL:placeholderImage:options:
*/
- (void)CMSD_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder;
/**
* Set the imageView `image` with an `url`, placeholder and custom options.
*
* The download is asynchronous and cached.
*
* @param url The url for the image.
* @param placeholder The image to be set initially, until the image request finishes.
* @param options The options to use when downloading the image. @see CMSDWebImageOptions for the possible values.
*/
- (void)CMSD_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(CMSDWebImageOptions)options;
/**
* Set the imageView `image` with an `url`.
*
* The download is asynchronous and cached.
*
* @param url The url for the image.
* @param completedBlock A block called when operation has been completed. This block has no return value
* and takes the requested UIImage as first parameter. In case of error the image parameter
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
* indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url.
*/
- (void)CMSD_setImageWithURL:(NSURL *)url completed:(CMSDWebImageCompletionBlock)completedBlock;
/**
* Set the imageView `image` with an `url`, placeholder.
*
* The download is asynchronous and cached.
*
* @param url The url for the image.
* @param placeholder The image to be set initially, until the image request finishes.
* @param completedBlock A block called when operation has been completed. This block has no return value
* and takes the requested UIImage as first parameter. In case of error the image parameter
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
* indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url.
*/
- (void)CMSD_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(CMSDWebImageCompletionBlock)completedBlock;
/**
* Set the imageView `image` with an `url`, placeholder and custom options.
*
* The download is asynchronous and cached.
*
* @param url The url for the image.
* @param placeholder The image to be set initially, until the image request finishes.
* @param options The options to use when downloading the image. @see CMSDWebImageOptions for the possible values.
* @param completedBlock A block called when operation has been completed. This block has no return value
* and takes the requested UIImage as first parameter. In case of error the image parameter
* is nil and the second parameter may contain an NSError. The third parameter is a Boolean
* indicating if the image was retrieved from the local cache or from the network.
* The fourth parameter is the original image url.
*/
- (void)CMSD_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(CMSDWebImageOptions)options completed:(CMSDWebImageCompletionBlock)completedBlock;
/**
* Cancel the current download
*/
- (void)CMSD_cancelCurrentImageLoad;
@end
@interface MKAnnotationView (WebCacheDeprecated)
- (NSURL *)imageURL __deprecated_msg("Use `CMSD_imageURL`");
- (void)setImageWithURL:(NSURL *)url __deprecated_msg("Method deprecated. Use `CMSD_setImageWithURL:`");
- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder __deprecated_msg("Method deprecated. Use `CMSD_setImageWithURL:placeholderImage:`");
- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(CMSDWebImageOptions)options __deprecated_msg("Method deprecated. Use `CMSD_setImageWithURL:placeholderImage:options:`");
- (void)setImageWithURL:(NSURL *)url completed:(CMSDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `CMSD_setImageWithURL:completed:`");
- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completed:(CMSDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `CMSD_setImageWithURL:placeholderImage:completed:`");
- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder options:(CMSDWebImageOptions)options completed:(CMSDWebImageCompletedBlock)completedBlock __deprecated_msg("Method deprecated. Use `CMSD_setImageWithURL:placeholderImage:options:completed:`");
- (void)cancelCurrentImageLoad __deprecated_msg("Use `CMSD_cancelCurrentImageLoad`");
@end
|
cwxatlm/MXScrollView
|
MXScrollView/CMSDWebImage/MKAnnotationView+CMWebCache.h
|
C
|
apache-2.0
| 5,813 |
/* Copyright 2015 Yurii Litvinov and CyberTech Labs Ltd.
*
* 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. */
#pragma once
#include <QtCore/QStringList>
#include <trikHal/trikHalDeclSpec.h>
namespace trikHal {
/// Represents console of an OS.
class TRIKHAL_EXPORT SystemConsoleInterface
{
Q_DISABLE_COPY(SystemConsoleInterface)
public:
virtual ~SystemConsoleInterface() = default;
SystemConsoleInterface() = default;
/// Executes given command on a system console. Returns return code of a command.
virtual int system(const QString &command) = 0;
/// Asynchronously starts given process with given arguments.
/// @returns true, if process was started successfully.
virtual bool startProcess(const QString &processName, const QStringList &arguments) = 0;
/// Synchronously starts given process with given arguments.
/// @returns true, if process was started successfully.
virtual bool startProcessSynchronously(const QString &processName, const QStringList &arguments
, QString * output = nullptr) = 0;
};
}
|
iakov/trikRuntime
|
trikHal/include/trikHal/systemConsoleInterface.h
|
C
|
apache-2.0
| 1,538 |
# please insert nothing before this line: -*- mode: cperl; cperl-indent-level: 4; cperl-continued-statement-offset: 4; indent-tabs-mode: nil -*-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package ModPerl::PerlRun;
use strict;
use warnings FATAL => 'all';
# we try to develop so we reload ourselves without die'ing on the warning
no warnings qw(redefine); # XXX, this should go away in production!
our $VERSION = '1.99';
use base qw(ModPerl::RegistryCooker);
sub handler : method {
my $class = (@_ >= 2) ? shift : __PACKAGE__;
my $r = shift;
return $class->new($r)->default_handler();
}
my $parent = 'ModPerl::RegistryCooker';
# the following code:
# - specifies package's behavior different from default of $parent class
# - speeds things up by shortcutting @ISA search, so even if the
# default is used we still use the alias
my %aliases = (
new => 'new',
init => 'init',
default_handler => 'default_handler',
run => 'run',
can_compile => 'can_compile',
make_namespace => 'make_namespace',
namespace_root => 'namespace_root',
namespace_from => 'namespace_from_filename',
is_cached => 'FALSE',
should_compile => 'TRUE',
flush_namespace => 'flush_namespace_normal',
cache_table => 'cache_table_common',
cache_it => 'NOP',
read_script => 'read_script',
shebang_to_perl => 'shebang_to_perl',
get_script_name => 'get_script_name',
chdir_file => 'NOP',
get_mark_line => 'get_mark_line',
compile => 'compile',
error_check => 'error_check',
should_reset_inc_hash => 'TRUE',
strip_end_data_segment => 'strip_end_data_segment',
convert_script_to_compiled_handler => 'convert_script_to_compiled_handler',
);
# in this module, all the methods are inherited from the same parent
# class, so we fixup aliases instead of using the source package in
# first place.
$aliases{$_} = $parent . "::" . $aliases{$_} for keys %aliases;
__PACKAGE__->install_aliases(\%aliases);
1;
__END__
|
dreamhost/dpkg-ndn-perl-mod-perl
|
ModPerl-Registry/lib/ModPerl/PerlRun.pm
|
Perl
|
apache-2.0
| 2,821 |
/*
* Copyright (C) 2013 The Android Open Source Project
*
* 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 LOG_TAG "GraphicBuffer"
#include "jni.h"
#include "JNIHelp.h"
#include "android_os_Parcel.h"
#include "android_view_GraphicBuffer.h"
#include "android/graphics/GraphicsJNI.h"
#include <android_runtime/AndroidRuntime.h>
#include <binder/Parcel.h>
#include <ui/GraphicBuffer.h>
#include <ui/PixelFormat.h>
#include <gui/IGraphicBufferAlloc.h>
#include <gui/ISurfaceComposer.h>
#include <SkCanvas.h>
#include <SkBitmap.h>
#include <private/gui/ComposerService.h>
#include "core_jni_helpers.h"
namespace android {
// ----------------------------------------------------------------------------
// Defines
// ----------------------------------------------------------------------------
// Debug
static const bool kDebugGraphicBuffer = false;
#define LOCK_CANVAS_USAGE GraphicBuffer::USAGE_SW_READ_OFTEN | GraphicBuffer::USAGE_SW_WRITE_OFTEN
// ----------------------------------------------------------------------------
// JNI Helpers
// ----------------------------------------------------------------------------
static struct {
jfieldID mNativeObject;
} gGraphicBufferClassInfo;
static struct {
jmethodID set;
jfieldID left;
jfieldID top;
jfieldID right;
jfieldID bottom;
} gRectClassInfo;
#define GET_INT(object, field) \
env->GetIntField(object, field)
#define SET_INT(object, field, value) \
env->SetIntField(object, field, value)
#define GET_LONG(object, field) \
env->GetLongField(object, field)
#define SET_LONG(object, field, value) \
env->SetLongField(object, field, value)
#define INVOKEV(object, method, ...) \
env->CallVoidMethod(object, method, __VA_ARGS__)
// ----------------------------------------------------------------------------
// Types
// ----------------------------------------------------------------------------
class GraphicBufferWrapper {
public:
GraphicBufferWrapper(const sp<GraphicBuffer>& buffer): buffer(buffer) {
}
sp<GraphicBuffer> buffer;
};
// ----------------------------------------------------------------------------
// GraphicBuffer lifecycle
// ----------------------------------------------------------------------------
static jlong android_view_GraphiceBuffer_create(JNIEnv* env, jobject clazz,
jint width, jint height, jint format, jint usage) {
sp<ISurfaceComposer> composer(ComposerService::getComposerService());
sp<IGraphicBufferAlloc> alloc(composer->createGraphicBufferAlloc());
if (alloc == NULL) {
if (kDebugGraphicBuffer) {
ALOGW("createGraphicBufferAlloc() failed in GraphicBuffer.create()");
}
return NULL;
}
status_t error;
sp<GraphicBuffer> buffer(alloc->createGraphicBuffer(width, height, format, usage, &error));
if (buffer == NULL) {
if (kDebugGraphicBuffer) {
ALOGW("createGraphicBuffer() failed in GraphicBuffer.create()");
}
return NULL;
}
GraphicBufferWrapper* wrapper = new GraphicBufferWrapper(buffer);
return reinterpret_cast<jlong>(wrapper);
}
static void android_view_GraphiceBuffer_destroy(JNIEnv* env, jobject clazz,
jlong wrapperHandle) {
GraphicBufferWrapper* wrapper =
reinterpret_cast<GraphicBufferWrapper*>(wrapperHandle);
delete wrapper;
}
// ----------------------------------------------------------------------------
// Canvas management
// ----------------------------------------------------------------------------
static inline SkColorType convertPixelFormat(int32_t format) {
switch (format) {
case PIXEL_FORMAT_RGBA_8888:
return kN32_SkColorType;
case PIXEL_FORMAT_RGBX_8888:
return kN32_SkColorType;
case PIXEL_FORMAT_RGB_565:
return kRGB_565_SkColorType;
default:
return kUnknown_SkColorType;
}
}
static jboolean android_view_GraphicBuffer_lockCanvas(JNIEnv* env, jobject,
jlong wrapperHandle, jobject canvas, jobject dirtyRect) {
GraphicBufferWrapper* wrapper =
reinterpret_cast<GraphicBufferWrapper*>(wrapperHandle);
if (!wrapper) {
return JNI_FALSE;
}
sp<GraphicBuffer> buffer(wrapper->buffer);
Rect rect;
if (dirtyRect) {
rect.left = GET_INT(dirtyRect, gRectClassInfo.left);
rect.top = GET_INT(dirtyRect, gRectClassInfo.top);
rect.right = GET_INT(dirtyRect, gRectClassInfo.right);
rect.bottom = GET_INT(dirtyRect, gRectClassInfo.bottom);
} else {
rect.set(Rect(buffer->getWidth(), buffer->getHeight()));
}
void* bits = NULL;
status_t status = buffer->lock(LOCK_CANVAS_USAGE, rect, &bits);
if (status) return JNI_FALSE;
if (!bits) {
buffer->unlock();
return JNI_FALSE;
}
ssize_t bytesCount = buffer->getStride() * bytesPerPixel(buffer->getPixelFormat());
SkBitmap bitmap;
bitmap.setInfo(SkImageInfo::Make(buffer->getWidth(), buffer->getHeight(),
convertPixelFormat(buffer->getPixelFormat()),
kPremul_SkAlphaType),
bytesCount);
if (buffer->getWidth() > 0 && buffer->getHeight() > 0) {
bitmap.setPixels(bits);
} else {
bitmap.setPixels(NULL);
}
Canvas* nativeCanvas = GraphicsJNI::getNativeCanvas(env, canvas);
nativeCanvas->setBitmap(bitmap);
nativeCanvas->clipRect(rect.left, rect.top, rect.right, rect.bottom);
if (dirtyRect) {
INVOKEV(dirtyRect, gRectClassInfo.set,
int(rect.left), int(rect.top), int(rect.right), int(rect.bottom));
}
return JNI_TRUE;
}
static jboolean android_view_GraphicBuffer_unlockCanvasAndPost(JNIEnv* env, jobject,
jlong wrapperHandle, jobject canvas) {
GraphicBufferWrapper* wrapper =
reinterpret_cast<GraphicBufferWrapper*>(wrapperHandle);
Canvas* nativeCanvas = GraphicsJNI::getNativeCanvas(env, canvas);
nativeCanvas->setBitmap(SkBitmap());
if (wrapper) {
status_t status = wrapper->buffer->unlock();
return status == 0 ? JNI_TRUE : JNI_FALSE;
}
return JNI_FALSE;
}
// ----------------------------------------------------------------------------
// Serialization
// ----------------------------------------------------------------------------
static void android_view_GraphiceBuffer_write(JNIEnv* env, jobject clazz,
jlong wrapperHandle, jobject dest) {
GraphicBufferWrapper* wrapper =
reinterpret_cast<GraphicBufferWrapper*>(wrapperHandle);
Parcel* parcel = parcelForJavaObject(env, dest);
if (parcel) {
parcel->write(*wrapper->buffer);
}
}
static jlong android_view_GraphiceBuffer_read(JNIEnv* env, jobject clazz,
jobject in) {
Parcel* parcel = parcelForJavaObject(env, in);
if (parcel) {
sp<GraphicBuffer> buffer = new GraphicBuffer();
parcel->read(*buffer);
return reinterpret_cast<jlong>(new GraphicBufferWrapper(buffer));
}
return NULL;
}
// ----------------------------------------------------------------------------
// External helpers
// ----------------------------------------------------------------------------
sp<GraphicBuffer> graphicBufferForJavaObject(JNIEnv* env, jobject obj) {
if (obj) {
jlong nativeObject = env->GetLongField(obj, gGraphicBufferClassInfo.mNativeObject);
GraphicBufferWrapper* wrapper = (GraphicBufferWrapper*) nativeObject;
if (wrapper != NULL) {
sp<GraphicBuffer> buffer(wrapper->buffer);
return buffer;
}
}
return NULL;
}
// ----------------------------------------------------------------------------
// JNI Glue
// ----------------------------------------------------------------------------
const char* const kClassPathName = "android/view/GraphicBuffer";
static JNINativeMethod gMethods[] = {
{ "nCreateGraphicBuffer", "(IIII)J", (void*) android_view_GraphiceBuffer_create },
{ "nDestroyGraphicBuffer", "(J)V", (void*) android_view_GraphiceBuffer_destroy },
{ "nWriteGraphicBufferToParcel", "(JLandroid/os/Parcel;)V",
(void*) android_view_GraphiceBuffer_write },
{ "nReadGraphicBufferFromParcel", "(Landroid/os/Parcel;)J",
(void*) android_view_GraphiceBuffer_read },
{ "nLockCanvas", "(JLandroid/graphics/Canvas;Landroid/graphics/Rect;)Z",
(void*) android_view_GraphicBuffer_lockCanvas },
{ "nUnlockCanvasAndPost", "(JLandroid/graphics/Canvas;)Z",
(void*) android_view_GraphicBuffer_unlockCanvasAndPost },
};
int register_android_view_GraphicBuffer(JNIEnv* env) {
jclass clazz = FindClassOrDie(env, "android/view/GraphicBuffer");
gGraphicBufferClassInfo.mNativeObject = GetFieldIDOrDie(env, clazz, "mNativeObject", "J");
clazz = FindClassOrDie(env, "android/graphics/Rect");
gRectClassInfo.set = GetMethodIDOrDie(env, clazz, "set", "(IIII)V");
gRectClassInfo.left = GetFieldIDOrDie(env, clazz, "left", "I");
gRectClassInfo.top = GetFieldIDOrDie(env, clazz, "top", "I");
gRectClassInfo.right = GetFieldIDOrDie(env, clazz, "right", "I");
gRectClassInfo.bottom = GetFieldIDOrDie(env, clazz, "bottom", "I");
return RegisterMethodsOrDie(env, kClassPathName, gMethods, NELEM(gMethods));
}
};
|
Ant-Droid/android_frameworks_base_OLD
|
core/jni/android_view_GraphicBuffer.cpp
|
C++
|
apache-2.0
| 9,906 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.component.mina;
import java.net.SocketAddress;
import org.apache.camel.Consumer;
import org.apache.camel.Exchange;
import org.apache.camel.MultipleConsumersSupport;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.impl.DefaultEndpoint;
import org.apache.camel.util.ObjectHelper;
import org.apache.mina.common.IoAcceptor;
import org.apache.mina.common.IoAcceptorConfig;
import org.apache.mina.common.IoConnector;
import org.apache.mina.common.IoConnectorConfig;
import org.apache.mina.common.IoSession;
/**
* Endpoint for Camel MINA.
*
* @version
*/
public class MinaEndpoint extends DefaultEndpoint implements MultipleConsumersSupport {
/** The key of the IoSession which is stored in the message header*/
@Deprecated
public static final transient String HEADER_MINA_IOSESSION = "CamelMinaIoSession";
/** The socket address of local machine that received the message. */
@Deprecated
public static final transient String HEADER_LOCAL_ADDRESS = "CamelMinaLocalAddress";
/** The socket address of the remote machine that send the message. */
@Deprecated
public static final transient String HEADER_REMOTE_ADDRESS = "CamelMinaRemoteAddress";
private SocketAddress address;
private IoAcceptor acceptor;
private IoConnector connector;
private IoAcceptorConfig acceptorConfig;
private IoConnectorConfig connectorConfig;
private MinaConfiguration configuration;
public MinaEndpoint() {
}
public MinaEndpoint(String endpointUri, MinaComponent component) {
super(endpointUri, component);
}
public Producer createProducer() throws Exception {
ObjectHelper.notNull(configuration, "configuration");
ObjectHelper.notNull(address, "address");
ObjectHelper.notNull(connector, "connector");
// wm protocol does not have config
if (!configuration.getProtocol().equalsIgnoreCase("vm")) {
ObjectHelper.notNull(connectorConfig, "connectorConfig");
}
return new MinaProducer(this);
}
public Consumer createConsumer(Processor processor) throws Exception {
ObjectHelper.notNull(configuration, "configuration");
ObjectHelper.notNull(address, "address");
ObjectHelper.notNull(acceptor, "acceptor");
// wm protocol does not have config
if (!configuration.getProtocol().equalsIgnoreCase("vm")) {
ObjectHelper.notNull(acceptorConfig, "acceptorConfig");
}
return new MinaConsumer(this, processor);
}
public Exchange createExchange(IoSession session, Object payload) {
Exchange exchange = createExchange();
exchange.getIn().setHeader(MinaConstants.MINA_IOSESSION, session);
exchange.getIn().setHeader(MinaConstants.MINA_LOCAL_ADDRESS, session.getLocalAddress());
exchange.getIn().setHeader(MinaConstants.MINA_REMOTE_ADDRESS, session.getRemoteAddress());
MinaPayloadHelper.setIn(exchange, payload);
return exchange;
}
public boolean isSingleton() {
return true;
}
public boolean isMultipleConsumersSupported() {
// only datagram should allow multiple consumers
return configuration.isDatagramProtocol();
}
// Properties
// -------------------------------------------------------------------------
public MinaConfiguration getConfiguration() {
return configuration;
}
public void setConfiguration(MinaConfiguration configuration) {
this.configuration = configuration;
}
public SocketAddress getAddress() {
return address;
}
public void setAddress(SocketAddress address) {
this.address = address;
}
public IoAcceptor getAcceptor() {
return acceptor;
}
public void setAcceptor(IoAcceptor acceptor) {
this.acceptor = acceptor;
}
public IoConnector getConnector() {
return connector;
}
public void setConnector(IoConnector connector) {
this.connector = connector;
}
public IoAcceptorConfig getAcceptorConfig() {
return acceptorConfig;
}
public void setAcceptorConfig(IoAcceptorConfig acceptorConfig) {
this.acceptorConfig = acceptorConfig;
}
public IoConnectorConfig getConnectorConfig() {
return connectorConfig;
}
public void setConnectorConfig(IoConnectorConfig connectorConfig) {
this.connectorConfig = connectorConfig;
}
}
|
cexbrayat/camel
|
components/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java
|
Java
|
apache-2.0
| 5,328 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.shardingsphere.sql.parser.sql.common.util;
import org.junit.Test;
import java.math.BigDecimal;
import java.math.BigInteger;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
public final class SQLUtilTest {
@Test
public void assertGetExactlyNumberForInteger() {
assertThat(SQLUtil.getExactlyNumber("100000", 10), is(100000));
assertThat(SQLUtil.getExactlyNumber("100000", 16), is(1048576));
assertThat(SQLUtil.getExactlyNumber(String.valueOf(Integer.MIN_VALUE), 10), is(Integer.MIN_VALUE));
assertThat(SQLUtil.getExactlyNumber(String.valueOf(Integer.MAX_VALUE), 10), is(Integer.MAX_VALUE));
}
@Test
public void assertGetExactlyNumberForLong() {
assertThat(SQLUtil.getExactlyNumber("100000000000", 10), is(100000000000L));
assertThat(SQLUtil.getExactlyNumber("100000000000", 16), is(17592186044416L));
assertThat(SQLUtil.getExactlyNumber(String.valueOf(Long.MIN_VALUE), 10), is(Long.MIN_VALUE));
assertThat(SQLUtil.getExactlyNumber(String.valueOf(Long.MAX_VALUE), 10), is(Long.MAX_VALUE));
}
@Test
public void assertGetExactlyNumberForBigInteger() {
assertThat(SQLUtil.getExactlyNumber("10000000000000000000", 10), is(new BigInteger("10000000000000000000")));
assertThat(SQLUtil.getExactlyNumber("10000000000000000000", 16), is(new BigInteger("75557863725914323419136")));
assertThat(SQLUtil.getExactlyNumber(String.valueOf(Long.MIN_VALUE + 1), 10), is(Long.MIN_VALUE + 1));
assertThat(SQLUtil.getExactlyNumber(String.valueOf(Long.MAX_VALUE - 1), 10), is(Long.MAX_VALUE - 1));
}
@Test
public void assertGetExactlyNumberForBigDecimal() {
assertThat(SQLUtil.getExactlyNumber("1.1", 10), is(new BigDecimal("1.1")));
}
@Test
public void assertGetExactlyValue() {
assertThat(SQLUtil.getExactlyValue("`xxx`"), is("xxx"));
assertThat(SQLUtil.getExactlyValue("[xxx]"), is("xxx"));
assertThat(SQLUtil.getExactlyValue("\"xxx\""), is("xxx"));
assertThat(SQLUtil.getExactlyValue("'xxx'"), is("xxx"));
}
@Test
public void assertGetExactlyValueWithReservedCharacters() {
assertThat(SQLUtil.getExactlyValue("`xxx`", "`"), is("`xxx`"));
assertThat(SQLUtil.getExactlyValue("[xxx]", "[]"), is("[xxx]"));
assertThat(SQLUtil.getExactlyValue("\"xxx\"", "\""), is("\"xxx\""));
assertThat(SQLUtil.getExactlyValue("'xxx'", "'"), is("'xxx'"));
}
@Test
public void assertGetExactlyValueUsingNull() {
assertNull(SQLUtil.getExactlyValue(null));
}
@Test
public void assertGetExactlyExpressionUsingAndReturningNull() {
assertNull(SQLUtil.getExactlyExpression(null));
}
@Test
public void assertGetExactlyExpressionUsingAndReturningEmptyString() {
assertThat(SQLUtil.getExactlyExpression(""), is(""));
}
@Test
public void assertGetExactlyExpression() {
assertThat(SQLUtil.getExactlyExpression("((a + b*c))"), is("((a+b*c))"));
}
@Test
public void assertGetExpressionWithoutOutsideParentheses() {
assertThat(SQLUtil.getExpressionWithoutOutsideParentheses("((a + b*c))"), is("a + b*c"));
assertThat(SQLUtil.getExpressionWithoutOutsideParentheses(""), is(""));
}
@Test
public void assertConvertLikePatternToRegexWhenEndWithPattern() {
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding_'"), is("SHOW DATABASES LIKE 'sharding.'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding%'"), is("SHOW DATABASES LIKE 'sharding.*'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding%_'"), is("SHOW DATABASES LIKE 'sharding.*.'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding\\_'"), is("SHOW DATABASES LIKE 'sharding_'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding\\%'"), is("SHOW DATABASES LIKE 'sharding%'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding\\%\\_'"), is("SHOW DATABASES LIKE 'sharding%_'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding_\\_'"), is("SHOW DATABASES LIKE 'sharding._'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding%\\%'"), is("SHOW DATABASES LIKE 'sharding.*%'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding_\\%'"), is("SHOW DATABASES LIKE 'sharding.%'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding\\_%'"), is("SHOW DATABASES LIKE 'sharding_.*'"));
}
@Test
public void assertConvertLikePatternToRegexWhenStartWithPattern() {
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE '_sharding'"), is("SHOW DATABASES LIKE '.sharding'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE '%sharding'"), is("SHOW DATABASES LIKE '.*sharding'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE '%_sharding'"), is("SHOW DATABASES LIKE '.*.sharding'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE '\\_sharding'"), is("SHOW DATABASES LIKE '_sharding'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE '\\%sharding'"), is("SHOW DATABASES LIKE '%sharding'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE '\\%\\_sharding'"), is("SHOW DATABASES LIKE '%_sharding'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE '_\\_sharding'"), is("SHOW DATABASES LIKE '._sharding'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE '%\\%sharding'"), is("SHOW DATABASES LIKE '.*%sharding'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE '_\\%sharding'"), is("SHOW DATABASES LIKE '.%sharding'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE '\\_%sharding'"), is("SHOW DATABASES LIKE '_.*sharding'"));
}
@Test
public void assertConvertLikePatternToRegexWhenContainsPattern() {
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding_db'"), is("SHOW DATABASES LIKE 'sharding.db'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding%db'"), is("SHOW DATABASES LIKE 'sharding.*db'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding%_db'"), is("SHOW DATABASES LIKE 'sharding.*.db'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding\\_db'"), is("SHOW DATABASES LIKE 'sharding_db'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding\\%db'"), is("SHOW DATABASES LIKE 'sharding%db'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding\\%\\_db'"), is("SHOW DATABASES LIKE 'sharding%_db'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding_\\_db'"), is("SHOW DATABASES LIKE 'sharding._db'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding%\\%db'"), is("SHOW DATABASES LIKE 'sharding.*%db'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding_\\%db'"), is("SHOW DATABASES LIKE 'sharding.%db'"));
assertThat(SQLUtil.convertLikePatternToRegex("SHOW DATABASES LIKE 'sharding\\_%db'"), is("SHOW DATABASES LIKE 'sharding_.*db'"));
}
}
|
apache/incubator-shardingsphere
|
shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/test/java/org/apache/shardingsphere/sql/parser/sql/common/util/SQLUtilTest.java
|
Java
|
apache-2.0
| 8,516 |
/*
* Copyright (c) 2014-2017 Neil Ellis
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package dollar.api.execution;
import dollar.api.DollarException;
import dollar.api.Value;
import dollar.api.script.Source;
import org.jetbrains.annotations.NotNull;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import static java.lang.Runtime.getRuntime;
import static java.util.concurrent.Executors.newFixedThreadPool;
public class DefaultDollarExecutor implements DollarExecutor {
@NotNull
public ForkJoinPool forkJoinPool;
@NotNull
private ExecutorService backgroundExecutor;
@NotNull
private ScheduledExecutorService scheduledExecutor;
public DefaultDollarExecutor() {
getRuntime().addShutdownHook(new Thread(this::forceStop));
start();
}
@NotNull
@Override
public DollarExecutor copy() {
return this;
}
@Override
public int priority() {
return 0;
}
@NotNull
@Override
public <T> Future<T> executeInBackground(@NotNull Callable<T> callable) {
return backgroundExecutor.submit(callable);
}
@NotNull
@Override
public <T> Future<T> executeNow(@NotNull Callable<T> callable) {
final FutureTask<T> tFutureTask = new FutureTask<>(callable);
tFutureTask.run();
return tFutureTask;
}
@Override
public void forceStop() {
backgroundExecutor.shutdownNow();
forkJoinPool.shutdownNow();
scheduledExecutor.shutdownNow();
}
@NotNull
@Override
public Value fork(@NotNull Source source, @NotNull Value in, @NotNull Function<Value, Value> call) {
try {
return submit(() -> call.apply(in)).get();
} catch (InterruptedException | ExecutionException e) {
throw new DollarException(e);
}
}
@NotNull
@Override
public Value forkAndReturnId(@NotNull Source source, @NotNull Value in, @NotNull Function<Value, Value> call) {
throw new UnsupportedOperationException();
}
@Override
public void restart() {
stop();
start();
}
@NotNull
@Override
public Future<?> scheduleEvery(long millis, @NotNull Runnable runnable) {
return scheduledExecutor.scheduleAtFixedRate(runnable, millis, millis, TimeUnit.MILLISECONDS);
}
@NotNull
@Override
public <T> Future<T> submit(@NotNull Callable<T> callable) {
return forkJoinPool.submit(callable);
}
@Override
public void start() {
forkJoinPool = new ForkJoinPool(getRuntime().availableProcessors() * 8);
backgroundExecutor = newFixedThreadPool(getRuntime().availableProcessors());
scheduledExecutor = Executors.newScheduledThreadPool(getRuntime().availableProcessors());
}
@Override
public void stop() {
backgroundExecutor.shutdown();
forkJoinPool.shutdown();
scheduledExecutor.shutdown();
}
}
|
neilellis/dollar
|
dollar-core/src/main/java/dollar/api/execution/DefaultDollarExecutor.java
|
Java
|
apache-2.0
| 3,860 |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.language.spel;
import org.junit.Test;
import org.apache.camel.ContextTestSupport;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import static org.apache.camel.language.spel.SpelExpression.spel;
public class SpelRouteTest extends ContextTestSupport {
@Test
public void testSpelRoute() throws Exception {
MockEndpoint resultEndpoint = getMockEndpoint("mock:result");
resultEndpoint.expectedBodiesReceived("Hello World! What a beautiful day");
template.sendBodyAndHeader("direct:test", "World", "dayOrNight", "day");
resultEndpoint.assertIsSatisfied();
}
@Test
public void testSpelWithLoop() throws Exception {
MockEndpoint resultEndpoint = getMockEndpoint("mock:loopResult");
resultEndpoint.expectedBodiesReceived("A:0", "A:0:1", "A:0:1:2", "A:0:1:2:3");
template.sendBody("direct:loop", "A");
resultEndpoint.assertIsSatisfied();
}
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() {
from("direct:test").setBody(spel("Hello #{request.body}! What a beautiful #{request.headers['dayOrNight']}")).to("mock:result");
from("direct:loop").loop(4).setBody(spel("#{body + ':' + properties['CamelLoopIndex']}")).to("mock:loopResult");
}
};
}
}
|
jamesnetherton/camel
|
components/camel-spring/src/test/java/org/apache/camel/language/spel/SpelRouteTest.java
|
Java
|
apache-2.0
| 2,298 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.jackrabbit.oak.security.authorization.restriction;
import com.google.common.collect.Iterables;
import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.api.Tree;
import org.apache.jackrabbit.oak.commons.PathUtils;
import org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionPattern;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
class SubtreePattern implements RestrictionPattern {
private static final String SEGMENT_DELIM = "/";
private final String oakPath;
private final int oakPathLength;
private final String[] targets;
private final String[] subtrees;
SubtreePattern(@NotNull String oakPath, @NotNull Iterable<String> subtrees) {
this.oakPath = oakPath;
this.oakPathLength = oakPath.length();
int size = Iterables.size(subtrees);
List<String> tl = new ArrayList<>(size);
List<String> sl = new ArrayList<>(size);
subtrees.forEach(s -> {
if (s != null && !s.isEmpty()) {
if (s.endsWith(SEGMENT_DELIM)) {
sl.add(s);
} else {
tl.add(s);
sl.add((s + SEGMENT_DELIM));
}
}
});
this.targets = tl.toArray(new String[0]);
this.subtrees = sl.toArray(new String[0]);
}
@Override
public boolean matches(@NotNull Tree tree, @Nullable PropertyState property) {
String path = (property == null) ? tree.getPath() : PathUtils.concat(tree.getPath(), property.getName());
return matches(path);
}
@Override
public boolean matches(@NotNull String path) {
if (path.indexOf(oakPath) != 0) {
return false;
}
for (String subtree : subtrees) {
if (path.indexOf(subtree, oakPathLength) > -1) {
return true;
}
}
for (String target : targets) {
if (path.endsWith(target)) {
return true;
}
}
return false;
}
@Override
public boolean matches() {
return false;
}
@Override
public int hashCode() {
return Objects.hash(oakPath, Arrays.hashCode(targets), Arrays.hashCode(subtrees));
}
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof SubtreePattern) {
SubtreePattern other = (SubtreePattern) obj;
return oakPath.equals(other.oakPath) && Arrays.equals(targets, other.targets) && Arrays.equals(subtrees, other.subtrees);
}
return false;
}
}
|
apache/jackrabbit-oak
|
oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/restriction/SubtreePattern.java
|
Java
|
apache-2.0
| 3,656 |
# Data Services
## What does a Data Service Do?
A data service is a design pattern within Learning Registry that when followed, will allow you to leverage the _extract_ service to:
* Define custom logic to select resource data of interest.
* Request resource data to get:
> * Resource Locator by Discriminator
> * Resource Locator by start of Discriminator
> * Resource Locator by Timestamp
> * Discriminator by Resource Locator
> * Discriminator by start of Resource Locator
> * Discriminator by Timestamp
> * Discriminated Resource Locator by Timestamp
> * All Discriminated Resources
The Prototype implementation is designed to use the _extract_ service to retrieve Resource Data that contains **Alignment to Standards** resource data. In this prototype, we are using the following criteria to determine if a Resource Data Description Document contains _Alignment to Standards_ data:
> * The resource_data is inline
> * If the resource_data contains XML using the Dublin Core Terms (dct) schema, http://purl.org/dc/terms/, to extract `<dct:conformsTo>` elements that match one of the patterns within `ASNPatterns`.
> * If the resource_data contains JSON using the _LR Paradata 1.0_ specification, when the Paradata's `activity.verb.action` is `"matched"` or `"aligned"` and a `activity.related[n].id` matches one of the patterns within the `ASNPatterns`.
`ASNPatterns` is currently defined within _./standards-alignment/lib/alignment.js_ as:
> > var ASNPatterns = [
> > /https?:\/\/purl\.org\/ASN\/resources\/[A-Z0-9]+/g, // legacy Jes&Co Achievement Standards Network (ASN) ID
> > /https?:\/\/asn\.jesandco\.org\/resources\/[A-Z0-9]+/g // new Jes&Co Achievement Standards Network (ASN) ID
> > ];
The **Alignment to Standards** prototype implementation cat provide a Data Service that will allow use of the _extract_ service to request resource data and aggregations where ASN's are Discriminators, `resource_locator`'s are Resource resource_locator, and `node_timestamp`'s are Timestamps, which will enable us to get:
> * `resource_locator` by ASN
> * `resource_locator` by start of ASN
> * `resource_locator` by `node_timestamp`
> * ASN by `resource_locator`
> * ASN by start of `resource_locator`
> * ASN by `node_timestamp`
> * ASN `resource_locator`s by `node_timestamp`
> * All ASN `resource_locator`s
Timestamps SHALL be a long integer value representing seconds since epoch from UTC+0 timezone.
## Design Pattern
For the following, we will define as example data:
> Resource Locator : "http://www.example.com/educational/resource" (`resource_locator`)
> Discriminator : "http://purl.com/ASN/resources/S000000" (ASN)
> Timestamp : 1330552901 (`node_timestamp` is "2012-02-29T22:01:32Z")
You will need to define MapReduce views in CouchDB the emit keys in the following convention:
"discriminator-by-resource" : [ Resource Locator, Discriminator ]
"discriminator-by-resource-ts" : [ Resource Locator, Timestamp, Discriminator ]
"resource-by-discriminator" : [ Discriminator, Resource Locator ]
"resource-by-discriminator-ts" : [ Discriminator, Timestamp, Resource Locator ]
"resource-by-ts" : [ Timestamp, Resource Locator ]
"discriminator-by-ts" : [ Timestamp, Discriminator ]
Each view should **not** implement a reduce function.
Using example data:
"discriminator-by-resource" : key=[ "http://www.example.com/educational/resource", "http://purl.com/ASN/resources/S000000" ]
"discriminator-by-resource-ts" : key=[ "http://www.example.com/educational/resource", 1330552901, "http://purl.com/ASN/resources/S000000" ]
"resource-by-discriminator" : key=[ "http://purl.com/ASN/resources/S000000", "http://www.example.com/educational/resource" ]
"resource-by-discriminator-ts" : key=[ "http://purl.com/ASN/resources/S000000", 1330552901, "http://www.example.com/educational/resource" ]
"resource-by-ts" : key=[ 1330552901, "http://www.example.com/educational/resource" ]
"discriminator-by-ts" : key=[ 1330552901, "http://purl.com/ASN/resources/S000000" ]
Definition of CouchDB keys in this manner will allow one to query CouchDB in the following manner:
* To get "All ASNs by Resource Locator":
- CouchDB API:
> curl -g -X GET 'http://<couchdb>/resource_data/_design/standards-alignment/_list/to-json/discriminator-by-resource?startkey=["<resource_locator>"]&endkey=["<resource_locator>",{}]'
- Extract API:
> curl -g -X GET 'http://<node address>/extract/standards-alignment/discriminator-by-resource?resource=<resource_locator>'
* To get "All ASNs by Resource Locator from Timestamp1 to until Timestamp2":
- CouchDB API:
> curl -g -X GET 'http://<couchdb>/resource_data/_design/standards-alignment/_list/to-json/discriminator-by-resource-ts?startkey=["<resource_locator>",<timestamp1>]&endkey=["<resource_locator>",<timestamp2>,{}]'
- Extract API:
> curl -g -X GET 'http://<node address>/extract/standards-alignment/discriminator-by-resource-ts?resource=<resource_locator>&from=<ISO8601timestamp1>&until=<ISO8601timestamp2>'
* To get "All ASNs by Resource Locator prefix":
- CouchDB API:
> curl -g -X GET 'http://<couchdb>/resource_data/_design/standards-alignment/_list/to-json/discriminator-by-resource?startkey=["<resource_locator>"]&endkey=["<resource_locator>\uD7AF"]&reduce=true&group_level=2'
- Extract API:
> curl -g -X GET 'http://<node address>/extract/standards-alignment/discriminator-by-resource?resource-starts-with=<resource_locator>'
* To get "All Resource Locators by ASN":
- CouchDB API:
> curl -g -X GET 'http://<couchdb>/resource_data/_design/standards-alignment/_list/to-json/resource-by-discriminator?startkey=["<asn>"]&endkey=["<asn>",{}]'
- Extract API:
> curl -g -X GET 'http://<node address>/extract/standards-alignment/resource-by-discriminator?discriminator=<asn>'
* To get "All Resource Locators by ASN from Timestamp1 to until Timestamp2":
- CouchDB API:
> curl -g -X GET 'http://<couchdb>/resource_data/_design/standards-alignment/_list/to-json/resource-by-discriminator-ts?startkey=["<asn>",<timestamp1>]&endkey=["<asn>",<timestamp2>,null]'
- Extract API:
> curl -g -X GET 'http://<node address>/extract/standards-alignment/resource-by-discriminator-ts?discriminator=<asn>&from=<ISO8601timestamp1>&until=<ISO8601timestamp2>'
* To get "All Resource Locators by ASN prefix":
- CouchDB API:
> curl -g -X GET 'http://<couchdb>/resource_data/_design/standards-alignment/_list/to-json/resource-by-discriminator?startkey=["<asn>"]&endkey=["<asn>\uD7AF"]'
- Extract API:
> curl -g -X GET 'http://<node address>/extract/standards-alignment/resource-by-discriminator?discriminator-starts-with=<asn>'
* To get "All ASN Resource Locators":
- CouchDB API:
> curl -g -X GET 'http://<couchdb>/resource_data/_design/standards-alignment/_list/to-json/discriminator-by-resource'
- Extract API:
> curl -g -X GET 'http://<node address>/extract/standards-alignment/discriminator-by-resource'
* To get "All ASN Resource Locators from Timestamp1 to until Timestamp2":
- CouchDB API:
> curl -g -X GET 'http://<couchdb>/resource_data/_design/standards-alignment/_list/to-json/resource-by-ts?startkey=[<timestamp1>]&endkey=[<timestamp2>,{}]'
- Extract API:
> curl -g -X GET 'http://<node address>/extract/standards-alignment/resource-by-ts?from=<ISO8601timestamp1>&until=<ISO8601timestamp2>'
* To get "All ASNs":
- CouchDB API:
> curl -g -X GET 'http://<couchdb>/resource_data/_design/standards-alignment/_list/to-json/resource-by-discriminator'
- Extract API:
> curl -g -X GET 'http://<node address>/extract/standards-alignment/resource-by-discriminator'
* To get "All ASNs from Timestamp1 to until Timestamp2":
- CouchDB API:
> curl -g -X GET 'http://<couchdb>/resource_data/_design/standards-alignment/_list/to-json/discriminator-by-ts?startkey=[<timestamp1>]&endkey=[<timestamp2>,{}]'
- Extract API:
> curl -g -X GET 'http://<node address>/extract/standards-alignment/discriminator-by-ts?from=<ISO8601timestamp1>&until=<ISO8601timestamp2>'
## TODO / Notes
* Indentification of data service design documents.
> Add a extra map field onto the root of the design doc named `dataservices` that contains extended information about the data service (name, description, spec, etc.) See dataservices.json in standards-alignment design document, and in the data-services design document, the view named `list`, which might be used to discover data services.
* Convention driven design.
> We've identified a range of supported queries that would be supported in a generic fashion through the presence of specific views; it would make sense that a custom node may only need a limited set, so they should be able to reduce the number of views implemented, and the service api calling the views should detect what type of views are present, and only allow the subset queries.
* Why aren't there 'prefix' queries by date?
> These can't be done with a CouchDB view only, and the date filtering functionality would need to be encapsulated in a _list_ function. See _How to deal with list functions_ above regarding advanced stuff. To do this is possible, but just throws a wrench into complexity - this is supposed to be a K.I.S.S. solution towards extraction, follow the recipies and stuff should just work with batteries included.
* Why 'prefix' queries instead of regex?
> CouchDB views don't support regex. You'd have to do the regex pattern match within a list function, which would eliminate the efficiency of the b-tree index. So this falls into one of those advanced list function use cases. It could be done, but to make it work more efficiently, you'd have to combine the regex with a range query so you're not iterating over the entire list. Based upon the type of things we heard the community ask for; all YouTube aligned resources, a sub-set of some site based upon URL paths; we think 'prefixes' work relatively well.
* What's with the wierd UTF-8 character in the 'prefix' query endkey?
> CouchDB follows UCS collation rules for UTF-8 strings, and different ranges within the 0x0 - 0xFFFF char code range that is _somewhat_ fully supported in Spidermonkey makes the last character in the collation sequence `\uD7AF`. Since it's non-printable, it should be okay to be non-inclusive. See this Gist: https://gist.github.com/1904807 if you want to understand this better.
## Possible OUTPUT
{
"documents":[
{
"result_data": {
/*
MapReduce aggregation formatted, could be in a paradata 'assertion'
*/
},
"supplemental_data" : {
},
"resource_data": [
/* doc ids of full docs */
]
},
{
"result_data": {
/* paradata */
},
"supplemental_data" : {
},
"resource_data": [
/* doc ids of full docs */
]
},
{
"result_data": {
/* paradata */
},
"supplemental_data" : {
},
"resource_data": [
/* doc ids of full docs */
]
}
]
}
|
LearningRegistry/LearningRegistry
|
data_services/README.md
|
Markdown
|
apache-2.0
| 12,261 |
<!doctype html>
<html>
<title>npm-restart</title>
<meta http-equiv="content-type" value="text/html;utf-8">
<link rel="stylesheet" type="text/css" href="../../static/style.css">
<link rel="canonical" href="https://www.npmjs.org/doc/cli/npm-restart.html">
<script async=true src="../../static/toc.js"></script>
<body>
<div id="wrapper">
<h1><a href="../cli/npm-restart.html">npm-restart</a></h1> <p>Restart a package</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm restart [-- <args>]
</code></pre><h2 id="description">DESCRIPTION</h2>
<p>This restarts a package.</p>
<p>This runs a package's "stop", "restart", and "start" scripts, and associated
pre- and post- scripts, in the order given below:</p>
<ol>
<li>prerestart</li>
<li>prestop</li>
<li>stop</li>
<li>poststop</li>
<li>restart</li>
<li>prestart</li>
<li>start</li>
<li>poststart</li>
<li>postrestart</li>
</ol>
<h2 id="note">NOTE</h2>
<p>Note that the "restart" script is run <strong>in addition to</strong> the "stop"
and "start" scripts, not instead of them.</p>
<p>This is the behavior as of <code>npm</code> major version 2. A change in this
behavior will be accompanied by an increase in major version number</p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-run-script.html">npm-run-script(1)</a></li>
<li><a href="../misc/npm-scripts.html">npm-scripts(7)</a></li>
<li><a href="../cli/npm-test.html">npm-test(1)</a></li>
<li><a href="../cli/npm-start.html">npm-start(1)</a></li>
<li><a href="../cli/npm-stop.html">npm-stop(1)</a></li>
<li><a href="../api/npm-restart.html">npm-restart(3)</a></li>
</ul>
</div>
<table border=0 cellspacing=0 cellpadding=0 id=npmlogo>
<tr><td style="width:180px;height:10px;background:rgb(237,127,127)" colspan=18> </td></tr>
<tr><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)"> </td><td style="width:40px;height:10px;background:#fff" colspan=4> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4> </td><td style="width:40px;height:10px;background:#fff" colspan=4> </td><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)"> </td><td colspan=6 style="width:60px;height:10px;background:#fff"> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4> </td></tr>
<tr><td colspan=2 style="width:20px;height:30px;background:#fff" rowspan=3> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3> </td><td style="width:10px;height:10px;background:#fff" rowspan=3> </td><td style="width:20px;height:10px;background:#fff" rowspan=4 colspan=2> </td><td style="width:10px;height:20px;background:rgb(237,127,127)" rowspan=2> </td><td style="width:10px;height:10px;background:#fff" rowspan=3> </td><td style="width:20px;height:10px;background:#fff" rowspan=3 colspan=2> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3> </td><td style="width:10px;height:10px;background:#fff" rowspan=3> </td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3> </td></tr>
<tr><td style="width:10px;height:10px;background:#fff" rowspan=2> </td></tr>
<tr><td style="width:10px;height:10px;background:#fff"> </td></tr>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
<p id="footer">npm-restart — [email protected]</p>
|
stefobark/moodlemobile
|
node_modules/npm/html/doc/cli/npm-restart.html
|
HTML
|
apache-2.0
| 3,837 |
package ledcli
import (
"fmt"
"testing"
. "github.com/smartystreets/goconvey/convey"
. "go.chromium.org/luci/common/testing/assertions"
bbpb "go.chromium.org/luci/buildbucket/proto"
"go.chromium.org/luci/common/errors"
)
func TestParseCLURL(t *testing.T) {
t.Parallel()
cases := []struct {
url string
err string
cl *bbpb.GerritChange
resolvePatchset int64
}{
{
url: "",
err: "only *-review.googlesource.com URLs are supported",
},
{
url: "%20://",
err: "URL_TO_CHANGELIST: parse",
},
{
url: "https://other.domain.example.com/stuff/things",
err: "only *-review.googlesource.com URLs are supported",
},
{
url: "https://thing-review.googlesource.com/",
err: "old/empty",
},
{
url: "https://thing-review.googlesource.com/#/c/oldstyle",
err: "old/empty",
},
{
url: "https://thing-review.googlesource.com/wat",
err: "Unknown changelist URL",
},
{
url: "https://thing-review.googlesource.com/c/+/1235",
err: "missing project",
},
{
url: "https://thing-review.googlesource.com/c/project/+",
err: "missing change/patchset",
},
{
url: "https://thing-review.googlesource.com/c/project/+/nan",
err: "parsing change",
},
{
url: "https://thing-review.googlesource.com/c/project/+/123/nan",
err: "parsing patchset",
},
{
url: "https://thing-review.googlesource.com/c/project/+/1111",
err: "TEST: resolvePatchset not set",
},
{
url: "https://thing-review.googlesource.com/c/project/+/123",
resolvePatchset: 1024,
cl: &bbpb.GerritChange{
Host: "thing-review.googlesource.com",
Project: "project",
Change: 123,
Patchset: 1024,
},
},
{
url: "https://thing-review.googlesource.com/c/project/+/123/1337",
cl: &bbpb.GerritChange{
Host: "thing-review.googlesource.com",
Project: "project",
Change: 123,
Patchset: 1337,
},
},
}
Convey(`parseCrChangeListURL`, t, func() {
for _, tc := range cases {
tc := tc
Convey(fmt.Sprintf("%q", tc.url), func() {
cl, err := parseCrChangeListURL(tc.url, func(string, int64) (int64, error) {
if tc.resolvePatchset != 0 {
return tc.resolvePatchset, nil
}
return 0, errors.New("TEST: resolvePatchset not set")
})
if tc.err != "" {
So(err, ShouldErrLike, tc.err)
So(cl, ShouldBeNil)
} else {
So(err, ShouldBeNil)
So(cl, ShouldResembleProto, tc.cl)
}
})
}
})
}
|
luci/luci-go
|
led/ledcli/edit_cr_cl_test.go
|
GO
|
apache-2.0
| 2,504 |
// Copyright 2016 CoreOS, 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.
package v3rpc
import (
"time"
"github.com/coreos/etcd/Godeps/_workspace/src/golang.org/x/net/context"
"github.com/coreos/etcd/Godeps/_workspace/src/google.golang.org/grpc"
"github.com/coreos/etcd/Godeps/_workspace/src/google.golang.org/grpc/codes"
"github.com/coreos/etcd/etcdserver"
pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
"github.com/coreos/etcd/pkg/types"
)
type ClusterServer struct {
cluster etcdserver.Cluster
server etcdserver.Server
raftTimer etcdserver.RaftTimer
}
func NewClusterServer(s *etcdserver.EtcdServer) *ClusterServer {
return &ClusterServer{
cluster: s.Cluster(),
server: s,
raftTimer: s,
}
}
func (cs *ClusterServer) MemberAdd(ctx context.Context, r *pb.MemberAddRequest) (*pb.MemberAddResponse, error) {
urls, err := types.NewURLs(r.PeerURLs)
if err != nil {
return nil, ErrMemberBadURLs
}
now := time.Now()
m := etcdserver.NewMember("", urls, "", &now)
err = cs.server.AddMember(ctx, *m)
switch {
case err == etcdserver.ErrIDExists:
return nil, ErrMemberExist
case err == etcdserver.ErrPeerURLexists:
return nil, ErrPeerURLExist
case err != nil:
return nil, grpc.Errorf(codes.Internal, err.Error())
}
return &pb.MemberAddResponse{
Header: cs.header(),
Member: &pb.Member{ID: uint64(m.ID), IsLeader: m.ID == cs.server.Leader(), PeerURLs: m.PeerURLs},
}, nil
}
func (cs *ClusterServer) MemberRemove(ctx context.Context, r *pb.MemberRemoveRequest) (*pb.MemberRemoveResponse, error) {
err := cs.server.RemoveMember(ctx, r.ID)
switch {
case err == etcdserver.ErrIDRemoved:
fallthrough
case err == etcdserver.ErrIDNotFound:
return nil, ErrMemberNotFound
case err != nil:
return nil, grpc.Errorf(codes.Internal, err.Error())
}
return &pb.MemberRemoveResponse{Header: cs.header()}, nil
}
func (cs *ClusterServer) MemberUpdate(ctx context.Context, r *pb.MemberUpdateRequest) (*pb.MemberUpdateResponse, error) {
m := etcdserver.Member{
ID: types.ID(r.ID),
RaftAttributes: etcdserver.RaftAttributes{PeerURLs: r.PeerURLs},
}
err := cs.server.UpdateMember(ctx, m)
switch {
case err == etcdserver.ErrPeerURLexists:
return nil, ErrPeerURLExist
case err == etcdserver.ErrIDNotFound:
return nil, ErrMemberNotFound
case err != nil:
return nil, grpc.Errorf(codes.Internal, err.Error())
}
return &pb.MemberUpdateResponse{Header: cs.header()}, nil
}
func (cs *ClusterServer) MemberList(ctx context.Context, r *pb.MemberListRequest) (*pb.MemberListResponse, error) {
membs := cs.cluster.Members()
protoMembs := make([]*pb.Member, len(membs))
for i := range membs {
protoMembs[i] = &pb.Member{
Name: membs[i].Name,
ID: uint64(membs[i].ID),
IsLeader: membs[i].ID == cs.server.Leader(),
PeerURLs: membs[i].PeerURLs,
ClientURLs: membs[i].ClientURLs,
}
}
return &pb.MemberListResponse{Header: cs.header(), Members: protoMembs}, nil
}
func (cs *ClusterServer) header() *pb.ResponseHeader {
return &pb.ResponseHeader{ClusterId: uint64(cs.cluster.ID()), MemberId: uint64(cs.server.ID()), RaftTerm: cs.raftTimer.Term()}
}
|
youtube/doorman
|
vendor/github.com/coreos/etcd/etcdserver/api/v3rpc/member.go
|
GO
|
apache-2.0
| 3,671 |
/*
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the elasticache-2015-02-02.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.ElastiCache.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
namespace Amazon.ElastiCache.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for RemoveTagsFromResource operation
/// </summary>
public class RemoveTagsFromResourceResponseUnmarshaller : XmlResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
{
RemoveTagsFromResourceResponse response = new RemoveTagsFromResourceResponse();
context.Read();
int targetDepth = context.CurrentDepth;
while (context.ReadAtDepth(targetDepth))
{
if (context.IsStartElement)
{
if(context.TestExpression("RemoveTagsFromResourceResult", 2))
{
UnmarshallResult(context, response);
continue;
}
if (context.TestExpression("ResponseMetadata", 2))
{
response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context);
}
}
}
return response;
}
private static void UnmarshallResult(XmlUnmarshallerContext context, RemoveTagsFromResourceResponse response)
{
int originalDepth = context.CurrentDepth;
int targetDepth = originalDepth + 1;
if (context.IsStartOfDocument)
targetDepth += 2;
while (context.ReadAtDepth(originalDepth))
{
if (context.IsStartElement || context.IsAttribute)
{
if (context.TestExpression("TagList/Tag", targetDepth))
{
var unmarshaller = TagUnmarshaller.Instance;
var item = unmarshaller.Unmarshall(context);
response.TagList.Add(item);
continue;
}
}
}
return;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(XmlUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
ErrorResponse errorResponse = ErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
if (errorResponse.Code != null && errorResponse.Code.Equals("CacheClusterNotFound"))
{
return new CacheClusterNotFoundException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidARN"))
{
return new InvalidARNException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("SnapshotNotFoundFault"))
{
return new SnapshotNotFoundException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
if (errorResponse.Code != null && errorResponse.Code.Equals("TagNotFound"))
{
return new TagNotFoundException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
return new AmazonElastiCacheException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
}
private static RemoveTagsFromResourceResponseUnmarshaller _instance = new RemoveTagsFromResourceResponseUnmarshaller();
internal static RemoveTagsFromResourceResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static RemoveTagsFromResourceResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
}
|
mwilliamson-firefly/aws-sdk-net
|
sdk/src/Services/ElastiCache/Generated/Model/Internal/MarshallTransformations/RemoveTagsFromResourceResponseUnmarshaller.cs
|
C#
|
apache-2.0
| 5,796 |
/**
* Licensed to Neo Technology under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Neo Technology licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.neo4j.examples;
import org.neo4j.graphdb.Direction;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.Transaction;
import org.neo4j.kernel.EmbeddedGraphDatabase;
public class EmbeddedNeo4j
{
private static final String DB_PATH = "neo4j-store";
private static final String NAME_KEY = "name";
// START SNIPPET: createReltype
private static enum ExampleRelationshipTypes implements RelationshipType
{
EXAMPLE
}
// END SNIPPET: createReltype
public static void main( final String[] args )
{
// START SNIPPET: startDb
GraphDatabaseService graphDb = new EmbeddedGraphDatabase( DB_PATH );
registerShutdownHook( graphDb );
// END SNIPPET: startDb
// START SNIPPET: operationsInATransaction
// Encapsulate operations in a transaction
Transaction tx = graphDb.beginTx();
try
{
Node firstNode = graphDb.createNode();
firstNode.setProperty( NAME_KEY, "Hello" );
Node secondNode = graphDb.createNode();
secondNode.setProperty( NAME_KEY, "World" );
firstNode.createRelationshipTo( secondNode,
ExampleRelationshipTypes.EXAMPLE );
String greeting = firstNode.getProperty( NAME_KEY ) + " "
+ secondNode.getProperty( NAME_KEY );
System.out.println( greeting );
// END SNIPPET: operationsInATransaction
// START SNIPPET: removingData
// let's remove the data before committing
firstNode.getSingleRelationship( ExampleRelationshipTypes.EXAMPLE,
Direction.OUTGOING ).delete();
firstNode.delete();
secondNode.delete();
tx.success();
}
finally
{
tx.finish();
}
// END SNIPPET: removingData
System.out.println( "Shutting down database ..." );
// START SNIPPET: shutdownServer
graphDb.shutdown();
// END SNIPPET: shutdownServer
}
private static void registerShutdownHook( final GraphDatabaseService graphDb )
{
// Registers a shutdown hook for the Neo4j instance so that it
// shuts down nicely when the VM exits (even if you "Ctrl-C" the
// running example before it's completed)
Runtime.getRuntime().addShutdownHook( new Thread()
{
@Override
public void run()
{
graphDb.shutdown();
}
} );
}
}
|
neo4j-attic/examples
|
src/main/java/org/neo4j/examples/EmbeddedNeo4j.java
|
Java
|
apache-2.0
| 3,426 |
package ca.uhn.fhir.jpa.bulk.export.job;
/*-
* #%L
* HAPI FHIR Storage api
* %%
* Copyright (C) 2014 - 2022 Smile CDR, 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.
* #L%
*/
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.interceptor.model.RequestPartitionId;
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDao;
import ca.uhn.fhir.jpa.api.model.DaoMethodOutcome;
import ca.uhn.fhir.jpa.batch.config.BatchConstants;
import ca.uhn.fhir.jpa.batch.log.Logs;
import ca.uhn.fhir.jpa.partition.SystemRequestDetails;
import ca.uhn.fhir.parser.IParser;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.util.BinaryUtil;
import org.hl7.fhir.instance.model.api.IBaseBinary;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType;
import org.slf4j.Logger;
import org.springframework.batch.item.ItemWriter;
import org.springframework.beans.factory.annotation.Value;
import java.io.ByteArrayOutputStream;
import java.io.OutputStreamWriter;
import java.util.List;
import java.util.Optional;
public abstract class BaseResourceToFileWriter implements ItemWriter<List<IBaseResource>> {
protected static final Logger ourLog = Logs.getBatchTroubleshootingLog();
protected FhirContext myFhirContext;
protected DaoRegistry myDaoRegistry;
protected ByteArrayOutputStream myOutputStream;
@Value("#{stepExecutionContext['" + BatchConstants.JOB_COLLECTION_ENTITY_ID + "']}")
protected Long myBulkExportCollectionEntityId;
@Value("#{stepExecutionContext['" + BatchConstants.JOB_EXECUTION_RESOURCE_TYPE + "']}")
protected String myResourceType;
protected IFhirResourceDao myBinaryDao;
private final OutputStreamWriter myWriter;
private final IParser myParser;
protected BaseResourceToFileWriter(FhirContext theFhirContext, DaoRegistry theDaoRegistry) {
myFhirContext = theFhirContext;
myDaoRegistry = theDaoRegistry;
myParser = myFhirContext.newJsonParser().setPrettyPrint(false);
myOutputStream = new ByteArrayOutputStream();
myWriter = new OutputStreamWriter(myOutputStream, Constants.CHARSET_UTF8);
}
protected IIdType createBinaryFromOutputStream() {
IBaseBinary binary = BinaryUtil.newBinary(myFhirContext);
binary.setContentType(Constants.CT_FHIR_NDJSON);
binary.setContent(myOutputStream.toByteArray());
DaoMethodOutcome outcome = myBinaryDao.create(binary, new SystemRequestDetails().setRequestPartitionId(RequestPartitionId.defaultPartition()));
return outcome.getResource().getIdElement();
}
@Override
public void write(List<? extends List<IBaseResource>> theList) throws Exception {
int count = 0;
for (List<IBaseResource> resourceList : theList) {
for (IBaseResource nextFileResource : resourceList) {
myParser.encodeResourceToWriter(nextFileResource, myWriter);
myWriter.append("\n");
count++;
}
}
Optional<IIdType> createdId = flushToFiles();
if (createdId.isPresent()) {
ourLog.info("Created {} resources for bulk export file containing {} resources of type {} ", count, createdId.get().toUnqualifiedVersionless().getValue(), myResourceType);
}
}
protected abstract Optional<IIdType> flushToFiles();
}
|
aemay2/hapi-fhir
|
hapi-fhir-storage/src/main/java/ca/uhn/fhir/jpa/bulk/export/job/BaseResourceToFileWriter.java
|
Java
|
apache-2.0
| 3,712 |
<!DOCTYPE html >
<html>
<head>
<title>text - sparkpipe-core 0.9.8 API - software.uncharted.sparkpipe.ops.core.dataframe.text</title>
<meta name="description" content="text - sparkpipe - core 0.9.8 API - software.uncharted.sparkpipe.ops.core.dataframe.text" />
<meta name="keywords" content="text sparkpipe core 0.9.8 API software.uncharted.sparkpipe.ops.core.dataframe.text" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="../../../../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
<link href="../../../../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />
<script type="text/javascript" src="../../../../../../../lib/jquery.js" id="jquery-js"></script>
<script type="text/javascript" src="../../../../../../../lib/jquery-ui.js"></script>
<script type="text/javascript" src="../../../../../../../lib/template.js"></script>
<script type="text/javascript" src="../../../../../../../lib/tools.tooltip.js"></script>
<script type="text/javascript">
if(top === self) {
var url = '../../../../../../../index.html';
var hash = 'software.uncharted.sparkpipe.ops.core.dataframe.text.package';
var anchor = window.location.hash;
var anchor_opt = '';
if (anchor.length >= 1)
anchor_opt = '@' + anchor.substring(1);
window.location.href = url + '#' + hash + anchor_opt;
}
</script>
</head>
<body class="value">
<div id="definition">
<img alt="Package" src="../../../../../../../lib/package_big.png" />
<p id="owner"><a href="../../../../../../package.html" class="extype" name="software">software</a>.<a href="../../../../../package.html" class="extype" name="software.uncharted">uncharted</a>.<a href="../../../../package.html" class="extype" name="software.uncharted.sparkpipe">sparkpipe</a>.<a href="../../../package.html" class="extype" name="software.uncharted.sparkpipe.ops">ops</a>.<a href="../../package.html" class="extype" name="software.uncharted.sparkpipe.ops.core">core</a>.<a href="../package.html" class="extype" name="software.uncharted.sparkpipe.ops.core.dataframe">dataframe</a></p>
<h1>text</h1><span class="permalink">
<a href="../../../../../../../index.html#software.uncharted.sparkpipe.ops.core.dataframe.text.package" title="Permalink" target="_top">
<img src="../../../../../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
</div>
<h4 id="signature" class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<span class="name">text</span>
</span>
</h4>
<div id="comment" class="fullcommenttop"><div class="comment cmt"><p>Common pipeline operations for dealing with textual data
</p></div><div class="toggleContainer block">
<span class="toggle">Linear Supertypes</span>
<div class="superTypes hiddenContent"><span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div>
</div></div>
<div id="mbrsel">
<div id="textfilter"><span class="pre"></span><span class="input"><input id="mbrsel-input" type="text" accesskey="/" /></span><span class="post"></span></div>
<div id="order">
<span class="filtertype">Ordering</span>
<ol>
<li class="alpha in"><span>Alphabetic</span></li>
<li class="inherit out"><span>By Inheritance</span></li>
</ol>
</div>
<div id="ancestors">
<span class="filtertype">Inherited<br />
</span>
<ol id="linearization">
<li class="in" name="software.uncharted.sparkpipe.ops.core.dataframe.text"><span>text</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li>
</ol>
</div><div id="ancestors">
<span class="filtertype"></span>
<ol>
<li class="hideall out"><span>Hide All</span></li>
<li class="showall in"><span>Show All</span></li>
</ol>
</div>
<div id="visbl">
<span class="filtertype">Visibility</span>
<ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol>
</div>
</div>
<div id="template">
<div id="allMembers">
<div id="values" class="values members">
<h3>Value Members</h3>
<ol><li name="software.uncharted.sparkpipe.ops.core.dataframe.text.docs" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="docs"></a>
<a id="docs:docs"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">object</span>
</span>
<span class="symbol">
<a href="docs$.html"><span class="name">docs</span></a>
</span>
</h4><span class="permalink">
<a href="../../../../../../../index.html#software.uncharted.sparkpipe.ops.core.dataframe.text.package@docs" title="Permalink" target="_top">
<img src="../../../../../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<p class="shortcomment cmt">Stub object necessary due to <a href="https://issues.scala-lang.org/browse/SI-8124" target="_blank">https://issues.scala-lang.org/browse/SI-8124</a></p><div class="fullcomment"><div class="comment cmt"><p>Stub object necessary due to <a href="https://issues.scala-lang.org/browse/SI-8124" target="_blank">https://issues.scala-lang.org/browse/SI-8124</a></p><p>Documentation for <code>ops.core.dataframe.text</code> can be found at <a href="" class="extype" name="software.uncharted.sparkpipe.ops.core.dataframe.text">software.uncharted.sparkpipe.ops.core.dataframe.text</a></p></div><dl class="attributes block"> <dt>Attributes</dt><dd>protected[this] </dd><dt>See also</dt><dd><span class="cmt"><p><a href="" class="extype" name="software.uncharted.sparkpipe.ops.core.dataframe.text">software.uncharted.sparkpipe.ops.core.dataframe.text</a></p></span></dd></dl></div>
</li><li name="software.uncharted.sparkpipe.ops.core.dataframe.text#includeTermFilter" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="includeTermFilter(arrayCol:String,includePattern:scala.util.matching.Regex)(input:org.apache.spark.sql.DataFrame):org.apache.spark.sql.DataFrame"></a>
<a id="includeTermFilter(String,Regex)(DataFrame):DataFrame"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">includeTermFilter</span><span class="params">(<span name="arrayCol">arrayCol: <span class="extype" name="scala.Predef.String">String</span></span>, <span name="includePattern">includePattern: <span class="extype" name="scala.util.matching.Regex">Regex</span></span>)</span><span class="params">(<span name="input">input: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>)</span><span class="result">: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>
</span>
</h4><span class="permalink">
<a href="../../../../../../../index.html#software.uncharted.sparkpipe.ops.core.dataframe.text.package@includeTermFilter(arrayCol:String,includePattern:scala.util.matching.Regex)(input:org.apache.spark.sql.DataFrame):org.apache.spark.sql.DataFrame" title="Permalink" target="_top">
<img src="../../../../../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<p class="shortcomment cmt">Pipeline op to filter a string column down to terms which match a certain pattern
</p><div class="fullcomment"><div class="comment cmt"><p>Pipeline op to filter a string column down to terms which match a certain pattern
</p></div><dl class="paramcmts block"><dt class="param">arrayCol</dt><dd class="cmt"><p>The name of an ArrayType(StringType) column in the input DataFrame</p></dd><dt class="param">includePattern</dt><dd class="cmt"><p>A Regex pattern describing words to include</p></dd><dt class="param">input</dt><dd class="cmt"><p>Input pipeline data to filter.</p></dd><dt>returns</dt><dd class="cmt"><p>Transformed pipeline data, with non-matching words removed from the specified column</p></dd></dl></div>
</li><li name="software.uncharted.sparkpipe.ops.core.dataframe.text#includeTermFilter" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="includeTermFilter(arrayCol:String,includeTerms:Set[String])(input:org.apache.spark.sql.DataFrame):org.apache.spark.sql.DataFrame"></a>
<a id="includeTermFilter(String,Set[String])(DataFrame):DataFrame"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">includeTermFilter</span><span class="params">(<span name="arrayCol">arrayCol: <span class="extype" name="scala.Predef.String">String</span></span>, <span name="includeTerms">includeTerms: <span class="extype" name="scala.Predef.Set">Set</span>[<span class="extype" name="scala.Predef.String">String</span>]</span>)</span><span class="params">(<span name="input">input: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>)</span><span class="result">: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>
</span>
</h4><span class="permalink">
<a href="../../../../../../../index.html#software.uncharted.sparkpipe.ops.core.dataframe.text.package@includeTermFilter(arrayCol:String,includeTerms:Set[String])(input:org.apache.spark.sql.DataFrame):org.apache.spark.sql.DataFrame" title="Permalink" target="_top">
<img src="../../../../../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<p class="shortcomment cmt">Pipeline op to filter a string column down to terms of interest
</p><div class="fullcomment"><div class="comment cmt"><p>Pipeline op to filter a string column down to terms of interest
</p></div><dl class="paramcmts block"><dt class="param">arrayCol</dt><dd class="cmt"><p>The name of an ArrayType(StringType) column in the input DataFrame</p></dd><dt class="param">includeTerms</dt><dd class="cmt"><p>A Set[String] of words to filter to</p></dd><dt class="param">input</dt><dd class="cmt"><p>Input pipeline data to filter.</p></dd><dt>returns</dt><dd class="cmt"><p>Transformed pipeline data, with the specified column filterd down to terms of interest</p></dd></dl></div>
</li><li name="software.uncharted.sparkpipe.ops.core.dataframe.text#mapTerms" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="mapTerms[O](arrayCol:String,mapFcn:String=>O)(input:org.apache.spark.sql.DataFrame)(implicittag:reflect.runtime.universe.TypeTag[O]):org.apache.spark.sql.DataFrame"></a>
<a id="mapTerms[O](String,(String)⇒O)(DataFrame)(scala.reflect.api.JavaUniverse.TypeTag[O]):DataFrame"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">mapTerms</span><span class="tparams">[<span name="O">O</span>]</span><span class="params">(<span name="arrayCol">arrayCol: <span class="extype" name="scala.Predef.String">String</span></span>, <span name="mapFcn">mapFcn: (<span class="extype" name="scala.Predef.String">String</span>) ⇒ <span class="extype" name="software.uncharted.sparkpipe.ops.core.dataframe.text.mapTerms.O">O</span></span>)</span><span class="params">(<span name="input">input: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>)</span><span class="params">(<span class="implicit">implicit </span><span name="tag">tag: <span class="extype" name="scala.reflect.api.TypeTags.TypeTag">scala.reflect.api.JavaUniverse.TypeTag</span>[<span class="extype" name="software.uncharted.sparkpipe.ops.core.dataframe.text.mapTerms.O">O</span>]</span>)</span><span class="result">: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>
</span>
</h4><span class="permalink">
<a href="../../../../../../../index.html#software.uncharted.sparkpipe.ops.core.dataframe.text.package@mapTerms[O](arrayCol:String,mapFcn:String=>O)(input:org.apache.spark.sql.DataFrame)(implicittag:reflect.runtime.universe.TypeTag[O]):org.apache.spark.sql.DataFrame" title="Permalink" target="_top">
<img src="../../../../../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<p class="shortcomment cmt">Apply a transformation to every String in an Array[String] column.</p><div class="fullcomment"><div class="comment cmt"><p>Apply a transformation to every String in an Array[String] column.
</p></div><dl class="paramcmts block"><dt class="param">arrayCol</dt><dd class="cmt"><p>The name of an ArrayType(StringType) column in the input DataFrame</p></dd><dt class="param">mapFcn</dt><dd class="cmt"><p>A transformation function String => O</p></dd><dt class="param">input</dt><dd class="cmt"><p>Input pipeline data to transform</p></dd><dt>returns</dt><dd class="cmt"><p>Transformed pipeline data, with the mapFcn applied to every term in every row of the Array[String] column</p></dd></dl></div>
</li><li name="software.uncharted.sparkpipe.ops.core.dataframe.text#removeAll" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="removeAll(stringCol:String,pattern:scala.util.matching.Regex)(input:org.apache.spark.sql.DataFrame):org.apache.spark.sql.DataFrame"></a>
<a id="removeAll(String,Regex)(DataFrame):DataFrame"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">removeAll</span><span class="params">(<span name="stringCol">stringCol: <span class="extype" name="scala.Predef.String">String</span></span>, <span name="pattern">pattern: <span class="extype" name="scala.util.matching.Regex">Regex</span></span>)</span><span class="params">(<span name="input">input: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>)</span><span class="result">: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>
</span>
</h4><span class="permalink">
<a href="../../../../../../../index.html#software.uncharted.sparkpipe.ops.core.dataframe.text.package@removeAll(stringCol:String,pattern:scala.util.matching.Regex)(input:org.apache.spark.sql.DataFrame):org.apache.spark.sql.DataFrame" title="Permalink" target="_top">
<img src="../../../../../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<p class="shortcomment cmt">Removes all occurrences of pattern in a String column
</p><div class="fullcomment"><div class="comment cmt"><p>Removes all occurrences of pattern in a String column
</p></div><dl class="paramcmts block"><dt class="param">pattern</dt><dd class="cmt"><p>a regular expression</p></dd><dt class="param">input</dt><dd class="cmt"><p>Input pipeline data to transform</p></dd><dt>returns</dt><dd class="cmt"><p>Transformed pipeline data, with instances of the given pattern in input removed</p></dd></dl></div>
</li><li name="software.uncharted.sparkpipe.ops.core.dataframe.text#replaceAll" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="replaceAll(stringCol:String,pattern:scala.util.matching.Regex,sub:String)(input:org.apache.spark.sql.DataFrame):org.apache.spark.sql.DataFrame"></a>
<a id="replaceAll(String,Regex,String)(DataFrame):DataFrame"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">replaceAll</span><span class="params">(<span name="stringCol">stringCol: <span class="extype" name="scala.Predef.String">String</span></span>, <span name="pattern">pattern: <span class="extype" name="scala.util.matching.Regex">Regex</span></span>, <span name="sub">sub: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="params">(<span name="input">input: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>)</span><span class="result">: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>
</span>
</h4><span class="permalink">
<a href="../../../../../../../index.html#software.uncharted.sparkpipe.ops.core.dataframe.text.package@replaceAll(stringCol:String,pattern:scala.util.matching.Regex,sub:String)(input:org.apache.spark.sql.DataFrame):org.apache.spark.sql.DataFrame" title="Permalink" target="_top">
<img src="../../../../../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<p class="shortcomment cmt">Replaces all occurrences of pattern in a String column with sub
</p><div class="fullcomment"><div class="comment cmt"><p>Replaces all occurrences of pattern in a String column with sub
</p></div><dl class="paramcmts block"><dt class="param">pattern</dt><dd class="cmt"><p>a regular expression</p></dd><dt class="param">sub</dt><dd class="cmt"><p>the string to substitute for the pattern</p></dd><dt class="param">input</dt><dd class="cmt"><p>Input pipeline data to transform</p></dd><dt>returns</dt><dd class="cmt"><p>Transformed pipeline data, with instances of the given pattern in input replaced with sub</p></dd></dl></div>
</li><li name="software.uncharted.sparkpipe.ops.core.dataframe.text#split" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="split(stringCol:String,delimiter:String)(input:org.apache.spark.sql.DataFrame):org.apache.spark.sql.DataFrame"></a>
<a id="split(String,String)(DataFrame):DataFrame"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">split</span><span class="params">(<span name="stringCol">stringCol: <span class="extype" name="scala.Predef.String">String</span></span>, <span name="delimiter">delimiter: <span class="extype" name="scala.Predef.String">String</span> = <span class="symbol">"\\s+"</span></span>)</span><span class="params">(<span name="input">input: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>)</span><span class="result">: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>
</span>
</h4><span class="permalink">
<a href="../../../../../../../index.html#software.uncharted.sparkpipe.ops.core.dataframe.text.package@split(stringCol:String,delimiter:String)(input:org.apache.spark.sql.DataFrame):org.apache.spark.sql.DataFrame" title="Permalink" target="_top">
<img src="../../../../../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<p class="shortcomment cmt">Splits a String column into an Array[String] column using a delimiter
(whitespace, by default)
</p><div class="fullcomment"><div class="comment cmt"><p>Splits a String column into an Array[String] column using a delimiter
(whitespace, by default)
</p></div><dl class="paramcmts block"><dt class="param">stringCol</dt><dd class="cmt"><p>the name of a String column in the input DataFrame</p></dd><dt class="param">delimiter</dt><dd class="cmt"><p>a delimiter to split the String column on</p></dd><dt class="param">input</dt><dd class="cmt"><p>Input pipeline data to transform</p></dd><dt>returns</dt><dd class="cmt"><p>Transformed pipeline data, with the given string column split on the delimiter</p></dd></dl></div>
</li><li name="software.uncharted.sparkpipe.ops.core.dataframe.text#stopTermFilter" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="stopTermFilter(arrayCol:String,stopPattern:scala.util.matching.Regex)(input:org.apache.spark.sql.DataFrame):org.apache.spark.sql.DataFrame"></a>
<a id="stopTermFilter(String,Regex)(DataFrame):DataFrame"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">stopTermFilter</span><span class="params">(<span name="arrayCol">arrayCol: <span class="extype" name="scala.Predef.String">String</span></span>, <span name="stopPattern">stopPattern: <span class="extype" name="scala.util.matching.Regex">Regex</span></span>)</span><span class="params">(<span name="input">input: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>)</span><span class="result">: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>
</span>
</h4><span class="permalink">
<a href="../../../../../../../index.html#software.uncharted.sparkpipe.ops.core.dataframe.text.package@stopTermFilter(arrayCol:String,stopPattern:scala.util.matching.Regex)(input:org.apache.spark.sql.DataFrame):org.apache.spark.sql.DataFrame" title="Permalink" target="_top">
<img src="../../../../../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<p class="shortcomment cmt">Pipeline op to remove stop patterns from a string column
</p><div class="fullcomment"><div class="comment cmt"><p>Pipeline op to remove stop patterns from a string column
</p></div><dl class="paramcmts block"><dt class="param">arrayCol</dt><dd class="cmt"><p>The name of an ArrayType(StringType) column in the input DataFrame</p></dd><dt class="param">stopPattern</dt><dd class="cmt"><p>A Regex pattern describing words to remove</p></dd><dt class="param">input</dt><dd class="cmt"><p>Input pipeline data to filter.</p></dd><dt>returns</dt><dd class="cmt"><p>Transformed pipeline data, with matching words removed from the specified column</p></dd></dl></div>
</li><li name="software.uncharted.sparkpipe.ops.core.dataframe.text#stopTermFilter" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="stopTermFilter(arrayCol:String,stopTerms:Set[String])(input:org.apache.spark.sql.DataFrame):org.apache.spark.sql.DataFrame"></a>
<a id="stopTermFilter(String,Set[String])(DataFrame):DataFrame"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">stopTermFilter</span><span class="params">(<span name="arrayCol">arrayCol: <span class="extype" name="scala.Predef.String">String</span></span>, <span name="stopTerms">stopTerms: <span class="extype" name="scala.Predef.Set">Set</span>[<span class="extype" name="scala.Predef.String">String</span>]</span>)</span><span class="params">(<span name="input">input: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>)</span><span class="result">: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>
</span>
</h4><span class="permalink">
<a href="../../../../../../../index.html#software.uncharted.sparkpipe.ops.core.dataframe.text.package@stopTermFilter(arrayCol:String,stopTerms:Set[String])(input:org.apache.spark.sql.DataFrame):org.apache.spark.sql.DataFrame" title="Permalink" target="_top">
<img src="../../../../../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<p class="shortcomment cmt">Pipeline op to remove stop words from a string column
</p><div class="fullcomment"><div class="comment cmt"><p>Pipeline op to remove stop words from a string column
</p></div><dl class="paramcmts block"><dt class="param">arrayCol</dt><dd class="cmt"><p>The name of an ArrayType(StringType) column in the input DataFrame</p></dd><dt class="param">stopTerms</dt><dd class="cmt"><p>A Set[String] of words to remove</p></dd><dt class="param">input</dt><dd class="cmt"><p>Input pipeline data to filter.</p></dd><dt>returns</dt><dd class="cmt"><p>Transformed pipeline data, with stop words removed from the specified column</p></dd></dl></div>
</li><li name="software.uncharted.sparkpipe.ops.core.dataframe.text#uniqueTerms" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="uniqueTerms(arrayCol:String)(input:org.apache.spark.sql.DataFrame):scala.collection.mutable.Map[String,Int]"></a>
<a id="uniqueTerms(String)(DataFrame):Map[String,Int]"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">uniqueTerms</span><span class="params">(<span name="arrayCol">arrayCol: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="params">(<span name="input">input: <span class="extype" name="org.apache.spark.sql.DataFrame">DataFrame</span></span>)</span><span class="result">: <span class="extype" name="scala.collection.mutable.Map">Map</span>[<span class="extype" name="scala.Predef.String">String</span>, <span class="extype" name="scala.Int">Int</span>]</span>
</span>
</h4><span class="permalink">
<a href="../../../../../../../index.html#software.uncharted.sparkpipe.ops.core.dataframe.text.package@uniqueTerms(arrayCol:String)(input:org.apache.spark.sql.DataFrame):scala.collection.mutable.Map[String,Int]" title="Permalink" target="_top">
<img src="../../../../../../../lib/permalink.png" alt="Permalink" />
</a>
</span>
<p class="shortcomment cmt">Produces a Map[String,Int] of unique terms from an Array[String] column
along with associated counts
</p><div class="fullcomment"><div class="comment cmt"><p>Produces a Map[String,Int] of unique terms from an Array[String] column
along with associated counts
</p></div><dl class="paramcmts block"><dt class="param">arrayCol</dt><dd class="cmt"><p>The name of an ArrayType(StringType) column in the input DataFrame</p></dd><dt class="param">input</dt><dd class="cmt"><p>Input pipeline data to analyze</p></dd><dt>returns</dt><dd class="cmt"><p>the Map[String, Int] of unique terms and their counts</p></dd></dl></div>
</li></ol>
</div>
</div>
<div id="inheritedMembers">
<div class="parent" name="scala.AnyRef">
<h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3>
</div><div class="parent" name="scala.Any">
<h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3>
</div>
</div>
<div id="groupedMembers">
<div class="group" name="Ungrouped">
<h3>Ungrouped</h3>
</div>
</div>
</div>
<div id="tooltip"></div>
<div id="footer"> </div>
</body>
</html>
|
unchartedsoftware/sparkpipe
|
docs/0.9.8/software/uncharted/sparkpipe/ops/core/dataframe/text/package.html
|
HTML
|
apache-2.0
| 27,793 |
//===------------------------ ConstantnessSemaDiagnostics.cpp -------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// This file implements checks for checking whether certain arguments to some
// specific APIs are compile-time constants (see below for the definition of
// constants). In particular, this code checks whether the new os_log APIs are
// invoked with constant arguments, and whether the primitive atomic operations
// are invoked with constant "orderings". These APIs are identified through
// @_semantics attributes.
//
// A "compile-time constant" is either a literal (including
// string/integer/float/boolean/string-interpolation literal) or a call to a
// "constant_evaluable" function (or property) with compile-time constant
// arguments. A closure expression is also considered a compile-time constant
// (it is a constant of a function type).
//===----------------------------------------------------------------------===//
#include "MiscDiagnostics.h"
#include "TypeChecker.h"
#include "swift/AST/ASTContext.h"
#include "swift/AST/ASTWalker.h"
#include "swift/AST/ParameterList.h"
#include "swift/AST/SemanticAttrs.h"
using namespace swift;
/// Check whether a given \p decl has a @_semantics attribute with the given
/// attribute name \c attrName.
static bool hasSemanticsAttr(ValueDecl *decl, StringRef attrName) {
return decl->getAttrs().hasSemanticsAttr(attrName);
}
/// Return true iff the given \p structDecl has a name that matches one of the
/// known atomic orderings structs.
static bool isAtomicOrderingDecl(StructDecl *structDecl) {
ASTContext &astContext = structDecl->getASTContext();
Identifier structName = structDecl->getName();
return (structName == astContext.Id_AtomicLoadOrdering ||
structName == astContext.Id_AtomicStoreOrdering ||
structName == astContext.Id_AtomicUpdateOrdering);
}
/// Return true iff the given nominal type decl \p nominal has a name that
/// matches one of the known OSLog types that need not be a constant in the new
/// os_log APIs.
static bool isOSLogDynamicObject(NominalTypeDecl *nominal) {
ASTContext &astContext = nominal->getASTContext();
Identifier name = nominal->getName();
return (name == astContext.Id_OSLog || name == astContext.Id_OSLogType);
}
/// Return true iff the parameter \p param of function \c funDecl is required to
/// be a constant. This is true if either the function is an os_log function or
/// it is an atomics operation and the parameter represents the ordering.
static bool isParamRequiredToBeConstant(AbstractFunctionDecl *funcDecl, ParamDecl *param) {
assert(funcDecl && param && "funcDecl and param must not be null");
Type paramType;
NominalTypeDecl *nominal;
StructDecl *structDecl;
if (hasSemanticsAttr(funcDecl, semantics::OSLOG_REQUIRES_CONSTANT_ARGUMENTS))
return true;
if (hasSemanticsAttr(funcDecl, semantics::OSLOG_LOG_WITH_LEVEL)) {
// We are looking at a top-level os_log function that accepts level and
// possibly custom log object. Those need not be constants, but every other
// parameter must be.
paramType = param->getType();
nominal = paramType->getNominalOrBoundGenericNominal();
return !nominal || !isOSLogDynamicObject(nominal);
}
if (!hasSemanticsAttr(funcDecl,
semantics::ATOMICS_REQUIRES_CONSTANT_ORDERINGS))
return false;
paramType = param->getType();
structDecl = paramType->getStructOrBoundGenericStruct();
if (!structDecl)
return false;
return isAtomicOrderingDecl(structDecl);
}
/// Return true iff the \c decl is annotated as
/// @_semantics("constant_evaluable").
static bool hasConstantEvaluableAttr(ValueDecl *decl) {
return hasSemanticsAttr(decl, semantics::CONSTANT_EVALUABLE);
}
/// Return true iff the \p decl is annotated with oslog.message.init semantics
/// attribute.
static bool isOSLogMessageInitializer(ValueDecl *decl) {
return hasSemanticsAttr(decl, semantics::OSLOG_MESSAGE_INIT_STRING_LITERAL) ||
hasSemanticsAttr(decl, semantics::OSLOG_MESSAGE_INIT_INTERPOLATION);
}
/// Check whether \p expr is a compile-time constant. It must either be a
/// literal_expr, which does not include array and dictionary literal, or a
/// closure expression, which is considered a compile-time constant of a
/// function type, or a call to a "constant_evaluable" function (or property)
/// whose arguments are themselves compile-time constants.
static Expr *checkConstantness(Expr *expr) {
SmallVector<Expr *, 4> expressionsToCheck;
expressionsToCheck.push_back(expr);
while (!expressionsToCheck.empty()) {
Expr *expr = expressionsToCheck.pop_back_val();
// Lookthrough identity_expr, tuple, binary_expr and inject_into_optional expressions.
if (IdentityExpr *identityExpr = dyn_cast<IdentityExpr>(expr)) {
expressionsToCheck.push_back(identityExpr->getSubExpr());
continue;
}
if (TupleExpr *tupleExpr = dyn_cast<TupleExpr>(expr)) {
for (Expr *element : tupleExpr->getElements())
expressionsToCheck.push_back(element);
continue;
}
if (BinaryExpr *binaryExpr = dyn_cast<BinaryExpr>(expr)) {
expressionsToCheck.push_back(binaryExpr->getLHS());
expressionsToCheck.push_back(binaryExpr->getRHS());
continue;
}
if (InjectIntoOptionalExpr *optionalExpr =
dyn_cast<InjectIntoOptionalExpr>(expr)) {
expressionsToCheck.push_back(optionalExpr->getSubExpr());
continue;
}
// Literal expressions also includes InterpolatedStringLiteralExpr.
if (isa<LiteralExpr>(expr))
continue;
if (isa<TypeExpr>(expr))
continue;
// Closure expressions are always treated as constants. They are
// constants of function types.
if (isa<AbstractClosureExpr>(expr))
continue;
// Default argument expressions of a constant_evaluable or a
// requires_constant function must be ensured to be a constant by the
// definition of the function.
if (isa<DefaultArgumentExpr>(expr))
continue;
// If this is a member-ref, it has to be annotated constant evaluable.
if (MemberRefExpr *memberRef = dyn_cast<MemberRefExpr>(expr)) {
if (ValueDecl *memberDecl = memberRef->getMember().getDecl()) {
if (hasConstantEvaluableAttr(memberDecl))
continue;
}
return expr;
}
// If this is a variable, it has to be a known constant parameter of the
// enclosing function.
if (DeclRefExpr *declRef = dyn_cast<DeclRefExpr>(expr)) {
ValueDecl *decl = declRef->getDecl();
if (!decl)
return expr;
ParamDecl *paramDecl = dyn_cast<ParamDecl>(decl);
if (!paramDecl)
return expr;
Decl *declContext = paramDecl->getDeclContext()->getAsDecl();
if (!declContext)
return expr;
AbstractFunctionDecl *funcDecl = dyn_cast<AbstractFunctionDecl>(declContext);
if (!funcDecl || !isParamRequiredToBeConstant(funcDecl, paramDecl))
return expr;
continue;
}
if (!isa<ApplyExpr>(expr))
return expr;
ApplyExpr *apply = cast<ApplyExpr>(expr);
ValueDecl *calledValue = apply->getCalledValue();
if (!calledValue)
return expr;
// If this is an enum case, check whether the arguments are constants.
if (isa<EnumElementDecl>(calledValue)) {
for (auto arg : *apply->getArgs())
expressionsToCheck.push_back(arg.getExpr());
continue;
}
AbstractFunctionDecl *callee = dyn_cast<AbstractFunctionDecl>(calledValue);
if (!callee)
return expr;
// If this is an application of OSLogMessage initializer, fail the check
// as this type must be created from string interpolations.
if (isOSLogMessageInitializer(callee))
return expr;
// If this is a constant_evaluable function, check whether the arguments are
// constants.
if (!hasConstantEvaluableAttr(callee))
return expr;
for (auto arg : *apply->getArgs())
expressionsToCheck.push_back(arg.getExpr());
}
return nullptr;
}
/// Return true iff the given \p type is a Stdlib integer type.
static bool isIntegerType(Type type) {
return type->isInt() || type->isInt8() || type->isInt16() ||
type->isInt32() || type->isInt64() || type->isUInt() ||
type->isUInt8() || type->isUInt16() || type->isUInt32() ||
type->isUInt64();
}
/// Return true iff the given \p type is a Float type.
static bool isFloatType(Type type) {
return type->isFloat() || type->isDouble() || type->isFloat80();
}
/// Given an error expression \p errorExpr, diagnose the error based on the type
/// of the expression. For instance, if the expression's type is expressible by
/// a literal e.g. integer, boolean etc. report that it must be a literal.
/// Otherwise, if the expression is a nominal type, report that it must be
/// static member of the type.
static void diagnoseError(Expr *errorExpr, const ASTContext &astContext,
AbstractFunctionDecl *funcDecl) {
DiagnosticEngine &diags = astContext.Diags;
Type exprType = errorExpr->getType();
SourceLoc errorLoc = errorExpr->getLoc();
// Diagnose atomics ordering related error here.
if (hasSemanticsAttr(funcDecl,
semantics::ATOMICS_REQUIRES_CONSTANT_ORDERINGS)) {
NominalTypeDecl *nominalDecl = exprType->getNominalOrBoundGenericNominal();
if (!nominalDecl) {
// This case should normally not happen. This is a safe guard against
// possible mismatch between the atomics library and the compiler.
diags.diagnose(errorLoc, diag::argument_must_be_constant);
}
diags.diagnose(errorLoc, diag::atomics_ordering_must_be_constant,
nominalDecl->getName());
return;
}
// Diagnose os_log specific errors here.
// Diagnose primitive stdlib types.
if (exprType->isBool()) {
diags.diagnose(errorLoc, diag::oslog_arg_must_be_bool_literal);
return;
}
if (exprType->isString()) {
diags.diagnose(errorLoc, diag::oslog_arg_must_be_string_literal);
return;
}
if (isIntegerType(exprType)) {
diags.diagnose(errorLoc, diag::oslog_arg_must_be_integer_literal);
return;
}
if (isFloatType(exprType)) {
diags.diagnose(errorLoc, diag::oslog_arg_must_be_float_literal);
return;
}
if (exprType->is<MetatypeType>()) {
diags.diagnose(errorLoc, diag::oslog_arg_must_be_metatype_literal);
return;
}
if (exprType->is<AnyFunctionType>()) {
diags.diagnose(errorLoc, diag::oslog_arg_must_be_closure);
return;
}
if (EnumDecl *enumDecl = exprType->getEnumOrBoundGenericEnum()) {
diags.diagnose(errorLoc, diag::oslog_arg_must_be_enum_case,
enumDecl->getName());
return;
}
NominalTypeDecl *nominalDecl = exprType->getNominalOrBoundGenericNominal();
if (!nominalDecl) {
// This case should normally not happen. This is a safe guard against
// possible mismatch between the os overlay and the compiler.
diags.diagnose(errorLoc, diag::argument_must_be_constant);
return;
}
// If this is OSLogMessage, it should be a string-interpolation literal.
Identifier declName = nominalDecl->getName();
if (declName == astContext.Id_OSLogMessage ||
nominalDecl->hasSemanticsAttr(semantics::OSLOG_MESSAGE_TYPE)) {
diags.diagnose(errorLoc, diag::oslog_message_must_be_string_interpolation);
return;
}
diags.diagnose(errorLoc, diag::oslog_arg_must_be_type_member_access,
declName);
}
/// Given a call \c callExpr, if some or all of its arguments are required to be
/// constants, check that property on the arguments.
static void diagnoseConstantArgumentRequirementOfCall(const CallExpr *callExpr,
const ASTContext &ctx) {
assert(callExpr && callExpr->getType() &&
"callExpr should have a valid type");
ValueDecl *calledDecl = callExpr->getCalledValue();
if (!calledDecl || !isa<AbstractFunctionDecl>(calledDecl))
return;
AbstractFunctionDecl *callee = cast<AbstractFunctionDecl>(calledDecl);
// Collect argument indices that are required to be constants.
SmallVector<unsigned, 4> constantArgumentIndices;
auto paramList = callee->getParameters();
for (unsigned i = 0; i < paramList->size(); ++i) {
ParamDecl *param = paramList->get(i);
if (isParamRequiredToBeConstant(callee, param))
constantArgumentIndices.push_back(i);
}
if (constantArgumentIndices.empty())
return;
// Check that the arguments at the constantArgumentIndices are constants.
SmallVector<Expr *, 4> arguments;
for (auto arg : *callExpr->getArgs())
arguments.push_back(arg.getExpr());
for (unsigned constantIndex : constantArgumentIndices) {
assert(constantIndex < arguments.size() &&
"constantIndex exceeds the number of arguments to the function");
Expr *argument = arguments[constantIndex];
Expr *errorExpr = checkConstantness(argument);
if (errorExpr)
diagnoseError(errorExpr, ctx, callee);
}
}
void swift::diagnoseConstantArgumentRequirement(
const Expr *expr, const DeclContext *declContext) {
class ConstantReqCallWalker : public ASTWalker {
DeclContext *DC;
public:
ConstantReqCallWalker(DeclContext *DC) : DC(DC) {}
// Descend until we find a call expressions. Note that the input expression
// could be an assign expression or another expression that contains the
// call.
std::pair<bool, Expr *> walkToExprPre(Expr *expr) override {
// Handle closure expressions separately as we may need to
// manually descend into the body.
if (auto *closureExpr = dyn_cast<ClosureExpr>(expr)) {
return walkToClosureExprPre(closureExpr);
}
// Interpolated expressions' bodies will be type checked
// separately so exit early to avoid duplicate diagnostics.
if (!expr || isa<ErrorExpr>(expr) || !expr->getType() ||
isa<InterpolatedStringLiteralExpr>(expr))
return {false, expr};
if (auto *callExpr = dyn_cast<CallExpr>(expr)) {
diagnoseConstantArgumentRequirementOfCall(callExpr, DC->getASTContext());
}
return {true, expr};
}
std::pair<bool, Expr *> walkToClosureExprPre(ClosureExpr *closure) {
if (closure->hasSingleExpressionBody()) {
// Single expression closure bodies are not visited directly
// by the ASTVisitor, so we must descend into the body manually
// and set the DeclContext to that of the closure.
DC = closure;
return {true, closure};
}
return {false, closure};
}
Expr *walkToExprPost(Expr *expr) override {
if (auto *closureExpr = dyn_cast<ClosureExpr>(expr)) {
// Reset the DeclContext to the outer scope if we descended
// into a closure expr.
DC = closureExpr->getParent();
}
return expr;
}
std::pair<bool, Stmt *> walkToStmtPre(Stmt *stmt) override {
return {true, stmt};
}
};
ConstantReqCallWalker walker(const_cast<DeclContext *>(declContext));
const_cast<Expr *>(expr)->walk(walker);
}
|
JGiola/swift
|
lib/Sema/ConstantnessSemaDiagnostics.cpp
|
C++
|
apache-2.0
| 15,508 |
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class jpigpio_Pigpio */
#ifndef _Included_jpigpio_Pigpio
#define _Included_jpigpio_Pigpio
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: jpigpio_Pigpio
* Method: gpioInitialize
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_jpigpio_Pigpio_gpioInitialize
(JNIEnv *, jobject);
/*
* Class: jpigpio_Pigpio
* Method: gpioTerminate
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_jpigpio_Pigpio_gpioTerminate
(JNIEnv *, jobject);
/*
* Class: jpigpio_Pigpio
* Method: gpioSetMode
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_jpigpio_Pigpio_gpioSetMode
(JNIEnv *, jobject, jint, jint);
/*
* Class: jpigpio_Pigpio
* Method: gpioGetMode
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_jpigpio_Pigpio_gpioGetMode
(JNIEnv *, jobject, jint);
/*
* Class: jpigpio_Pigpio
* Method: gpioSetPullUpDown
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_jpigpio_Pigpio_gpioSetPullUpDown
(JNIEnv *, jobject, jint, jint);
/*
* Class: jpigpio_Pigpio
* Method: gpioRead
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_jpigpio_Pigpio_gpioRead
(JNIEnv *, jobject, jint);
/*
* Class: jpigpio_Pigpio
* Method: gpioWrite
* Signature: (IZ)V
*/
JNIEXPORT void JNICALL Java_jpigpio_Pigpio_gpioWrite
(JNIEnv *, jobject, jint, jboolean);
/*
* Class: jpigpio_Pigpio
* Method: i2cOpen
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_jpigpio_Pigpio_i2cOpen
(JNIEnv *, jobject, jint, jint);
/*
* Class: jpigpio_Pigpio
* Method: i2cClose
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_jpigpio_Pigpio_i2cClose
(JNIEnv *, jobject, jint);
/*
* Class: jpigpio_Pigpio
* Method: i2cReadDevice
* Signature: (I[B)I
*/
JNIEXPORT jint JNICALL Java_jpigpio_Pigpio_i2cReadDevice
(JNIEnv *, jobject, jint, jbyteArray);
/*
* Class: jpigpio_Pigpio
* Method: i2cWriteDevice
* Signature: (I[B)V
*/
JNIEXPORT void JNICALL Java_jpigpio_Pigpio_i2cWriteDevice
(JNIEnv *, jobject, jint, jbyteArray);
/*
* Class: jpigpio_Pigpio
* Method: gpioDelay
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_jpigpio_Pigpio_gpioDelay
(JNIEnv *, jobject, jlong);
/*
* Class: jpigpio_Pigpio
* Method: gpioTick
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_jpigpio_Pigpio_gpioTick
(JNIEnv *, jobject);
/*
* Class: jpigpio_Pigpio
* Method: gpioServo
* Signature: (II)V
*/
JNIEXPORT void JNICALL Java_jpigpio_Pigpio_gpioServo
(JNIEnv *, jobject, jint, jint);
/*
* Class: jpigpio_Pigpio
* Method: gpioSetAlertFunc
* Signature: (ILjpigpio/Alert;)V
*/
JNIEXPORT void JNICALL Java_jpigpio_Pigpio_gpioSetAlertFunc
(JNIEnv *, jobject, jint, jobject);
/*
* Class: jpigpio_Pigpio
* Method: gpioTrigger
* Signature: (IJZ)V
*/
JNIEXPORT void JNICALL Java_jpigpio_Pigpio_gpioTrigger
(JNIEnv *, jobject, jint, jlong, jboolean);
/*
* Class: jpigpio_Pigpio
* Method: spiOpen
* Signature: (III)I
*/
JNIEXPORT jint JNICALL Java_jpigpio_Pigpio_spiOpen
(JNIEnv *, jobject, jint, jint, jint);
/*
* Class: jpigpio_Pigpio
* Method: spiClose
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_jpigpio_Pigpio_spiClose
(JNIEnv *, jobject, jint);
/*
* Class: jpigpio_Pigpio
* Method: spiRead
* Signature: (I[B)I
*/
JNIEXPORT jint JNICALL Java_jpigpio_Pigpio_spiRead
(JNIEnv *, jobject, jint, jbyteArray);
/*
* Class: jpigpio_Pigpio
* Method: spiWrite
* Signature: (I[B)I
*/
JNIEXPORT jint JNICALL Java_jpigpio_Pigpio_spiWrite
(JNIEnv *, jobject, jint, jbyteArray);
/*
* Class: jpigpio_Pigpio
* Method: spiXfer
* Signature: (I[B[B)I
*/
JNIEXPORT jint JNICALL Java_jpigpio_Pigpio_spiXfer
(JNIEnv *, jobject, jint, jbyteArray, jbyteArray);
/*
* Class: jpigpio_Pigpio
* Method: setDebug
* Signature: (Z)V
*/
JNIEXPORT void JNICALL Java_jpigpio_Pigpio_setDebug
(JNIEnv *, jobject, jboolean);
/*
* Class: jpigpio_Pigpio
* Method: gpioxPulseAndWait
* Signature: (IIJJZ)J
*/
JNIEXPORT jlong JNICALL Java_jpigpio_Pigpio_gpioxPulseAndWait
(JNIEnv *, jobject, jint, jint, jlong, jlong, jboolean);
#ifdef __cplusplus
}
#endif
#endif
|
nkolban/jpigpio
|
JPigpioC/jpigpio_Pigpio.h
|
C
|
apache-2.0
| 4,246 |
/*
* Copyright (c) 2005-2010 Grameen Foundation USA
* 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.
*
* See also http://www.apache.org/licenses/LICENSE-2.0.html for an
* explanation of the license and how it is applied.
*/
package org.mifos.accounts.business;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.mifos.accounts.business.service.AccountBusinessService;
import org.mifos.accounts.savings.util.helpers.SavingsConstants;
import org.mifos.accounts.util.helpers.AccountState;
import org.mifos.accounts.util.helpers.AccountStateFlag;
import org.mifos.accounts.util.helpers.AccountStates;
import org.mifos.accounts.util.helpers.AccountTypes;
import org.mifos.application.master.business.StateEntity;
import org.mifos.config.ProcessFlowRules;
import org.mifos.customers.api.CustomerLevel;
import org.mifos.customers.business.CustomerStatusEntity;
import org.mifos.customers.business.CustomerStatusFlagEntity;
import org.mifos.customers.persistence.CustomerPersistence;
import org.mifos.customers.util.helpers.CustomerConstants;
import org.mifos.customers.util.helpers.CustomerStatus;
import org.mifos.customers.util.helpers.CustomerStatusFlag;
import org.mifos.framework.components.stateMachineFactory.StateXMLParser;
import org.mifos.framework.exceptions.ApplicationException;
import org.mifos.framework.exceptions.PersistenceException;
import org.mifos.framework.exceptions.ServiceException;
import org.mifos.framework.exceptions.StatesInitializationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* At first glance this code seems to be part of the excessively complicated
* machinery ({@link StateEntity} for example), which is being replaced by enums
* ({@link AccountState} for example).
*/
public class AccountStateMachines {
private static AccountStateMachines statemachine = new AccountStateMachines();
private AccountStateMachines() {
}
public static AccountStateMachines getInstance() {
return statemachine;
}
private Map<StateEntity, List<StateEntity>> statesMapForLoan = new HashMap<StateEntity, List<StateEntity>>();
private Map<Short, List<AccountStateEntity>> statesViewMapForLoan = new HashMap<Short, List<AccountStateEntity>>();
private Map<StateEntity, List<StateEntity>> statesMapForSavings = new HashMap<StateEntity, List<StateEntity>>();
private Map<Short, List<AccountStateEntity>> statesViewMapForSavings = new HashMap<Short, List<AccountStateEntity>>();
private Map<StateEntity, List<StateEntity>> statesMapForCenter = new HashMap<StateEntity, List<StateEntity>>();
private Map<Short, List<CustomerStatusEntity>> statesViewMapForCenter = new HashMap<Short, List<CustomerStatusEntity>>();
private Map<StateEntity, List<StateEntity>> statesMapForClient = new HashMap<StateEntity, List<StateEntity>>();
private Map<Short, List<CustomerStatusEntity>> statesViewMapForClient = new HashMap<Short, List<CustomerStatusEntity>>();
private Map<StateEntity, List<StateEntity>> statesMapForGroup = new HashMap<StateEntity, List<StateEntity>>();
private Map<Short, List<CustomerStatusEntity>> statesViewMapForGroup = new HashMap<Short, List<CustomerStatusEntity>>();
private List<AccountStateEntity> accountStateEntityListForLoan = new ArrayList<AccountStateEntity>();
private List<AccountStateEntity> accountStateEntityListForSavings = new ArrayList<AccountStateEntity>();
private List<CustomerStatusEntity> customerStatusListForCenter = new ArrayList<CustomerStatusEntity>();
private List<CustomerStatusEntity> customerStatusListForClient = new ArrayList<CustomerStatusEntity>();
private List<CustomerStatusEntity> customerStatusListForGroup = new ArrayList<CustomerStatusEntity>();
private static final Logger logger = LoggerFactory.getLogger(AccountStateMachines.class);
public void initializeLoanStates() throws StatesInitializationException {
AccountTypes accountType = AccountTypes.LOAN_ACCOUNT;
CustomerLevel level = null;
String configName = getConfigurationName(accountType, level);
try {
statesMapForLoan = loadMap(AccountStates.TRANSITION_CONFIG_FILE_PATH_LOAN, configName);
accountStateEntityListForLoan = retrieveAllAccountStateList(accountType);
removeLoanReversalFlagForCancelState();
populateLoanStatesViewMap();
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
public void initializeSavingsStates() throws StatesInitializationException {
AccountTypes accountType = AccountTypes.SAVINGS_ACCOUNT;
CustomerLevel level = null;
String configName = getConfigurationName(accountType, level);
try {
statesMapForSavings = loadMap(AccountStates.TRANSITION_CONFIG_FILE_PATH_SAVINGS, configName);
accountStateEntityListForSavings = retrieveAllAccountStateList(accountType);
populateSavingsStatesViewMap();
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
public void initializeCenterStates() throws StatesInitializationException {
AccountTypes accountType = AccountTypes.CUSTOMER_ACCOUNT;
CustomerLevel level = CustomerLevel.CENTER;
String configName = getConfigurationName(accountType, level);
try {
statesMapForCenter = loadMap(CustomerConstants.TRANSITION_CONFIG_FILE_PATH_CENTER, configName);
customerStatusListForCenter = retrieveAllCustomerStatusList(level);
populateCenterStatesViewMap();
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
public void initializeGroupStates() throws StatesInitializationException {
AccountTypes accountType = AccountTypes.CUSTOMER_ACCOUNT;
CustomerLevel level = CustomerLevel.GROUP;
String configName = getConfigurationName(accountType, level);
try {
statesMapForGroup = loadMap(CustomerConstants.TRANSITION_CONFIG_FILE_PATH_GROUP, configName);
customerStatusListForGroup = retrieveAllCustomerStatusList(level);
populateGroupStatesViewMap();
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
public void initializeClientStates() throws StatesInitializationException {
AccountTypes accountType = AccountTypes.CUSTOMER_ACCOUNT;
CustomerLevel level = CustomerLevel.CLIENT;
String configName = getConfigurationName(accountType, level);
try {
statesMapForClient = loadMap(CustomerConstants.TRANSITION_CONFIG_FILE_PATH_CLIENT, configName);
customerStatusListForClient = retrieveAllCustomerStatusList(level);
populateClientStatesViewMap();
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
public void initialize(AccountTypes accountType, CustomerLevel level)
throws StatesInitializationException {
logger.debug("In AccountStateMachines::initialize()");
String configName = getConfigurationName(accountType, level);
try {
if (accountType.equals(AccountTypes.LOAN_ACCOUNT)) {
statesMapForLoan = loadMap(AccountStates.TRANSITION_CONFIG_FILE_PATH_LOAN, configName);
accountStateEntityListForLoan = retrieveAllAccountStateList(accountType);
removeLoanReversalFlagForCancelState();
populateLoanStatesViewMap();
} else if (accountType.equals(AccountTypes.SAVINGS_ACCOUNT)) {
statesMapForSavings = loadMap(AccountStates.TRANSITION_CONFIG_FILE_PATH_SAVINGS, configName);
accountStateEntityListForSavings = retrieveAllAccountStateList(accountType);
populateSavingsStatesViewMap();
} else if (accountType.equals(AccountTypes.CUSTOMER_ACCOUNT)) {
if (level.equals(CustomerLevel.CENTER)) {
statesMapForCenter = loadMap(CustomerConstants.TRANSITION_CONFIG_FILE_PATH_CENTER, configName);
customerStatusListForCenter = retrieveAllCustomerStatusList(level);
populateCenterStatesViewMap();
} else if (level.equals(CustomerLevel.GROUP)) {
statesMapForGroup = loadMap(CustomerConstants.TRANSITION_CONFIG_FILE_PATH_GROUP, configName);
customerStatusListForGroup = retrieveAllCustomerStatusList(level);
populateGroupStatesViewMap();
} else if (level.equals(CustomerLevel.CLIENT)) {
statesMapForClient = loadMap(CustomerConstants.TRANSITION_CONFIG_FILE_PATH_CLIENT, configName);
customerStatusListForClient = retrieveAllCustomerStatusList(level);
populateClientStatesViewMap();
}
}
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
public String getAccountStatusName(AccountState accountState, AccountTypes accountType) {
logger.debug("In AccountStateMachines::getAccountStatusName()");
if (accountType.equals(AccountTypes.LOAN_ACCOUNT)) {
for (AccountStateEntity accountStateEntityObj : accountStateEntityListForLoan) {
if (accountStateEntityObj.getId().equals(accountState.getValue())) {
return accountStateEntityObj.getName();
}
}
} else if (accountType.equals(AccountTypes.SAVINGS_ACCOUNT)) {
for (AccountStateEntity accountStateEntityObj : accountStateEntityListForSavings) {
if (accountStateEntityObj.getId().equals(accountState.getValue())) {
return accountStateEntityObj.getName();
}
}
}
return null;
}
public String getAccountFlagName(AccountStateFlag flag, AccountTypes accountType) {
logger.debug("In AccountStateMachines::getAccountFlagName()");
if (accountType.equals(AccountTypes.LOAN_ACCOUNT)) {
for (AccountStateEntity accountStateEntity : accountStateEntityListForLoan) {
for (AccountStateFlagEntity accountStateFlagEntity : accountStateEntity.getFlagSet()) {
if (accountStateFlagEntity.getId().equals(flag.getValue())) {
return accountStateFlagEntity.getName();
}
}
}
} else if (accountType.equals(AccountTypes.SAVINGS_ACCOUNT)) {
for (AccountStateEntity accountStateEntity : accountStateEntityListForSavings) {
for (AccountStateFlagEntity accountStateFlagEntity : accountStateEntity.getFlagSet()) {
if (accountStateFlagEntity.getId().equals(flag.getValue())) {
return accountStateFlagEntity.getName();
}
}
}
}
return null;
}
public String getCustomerStatusName(CustomerStatus customerStatus, CustomerLevel customerLevel) {
logger.debug("In AccountStateMachines::getCustomerStatusName()");
if (customerLevel.equals(CustomerLevel.CENTER)) {
for (CustomerStatusEntity customerStatusEntity : customerStatusListForCenter) {
if (customerStatusEntity.getId().equals(customerStatus.getValue())) {
return customerStatusEntity.getName();
}
}
} else if (customerLevel.equals(CustomerLevel.GROUP)) {
for (CustomerStatusEntity customerStatusEntity : customerStatusListForGroup) {
if (customerStatusEntity.getId().equals(customerStatus.getValue())) {
return customerStatusEntity.getName();
}
}
} else if (customerLevel.equals(CustomerLevel.CLIENT)) {
for (CustomerStatusEntity customerStatusEntity : customerStatusListForClient) {
if (customerStatusEntity.getId().equals(customerStatus.getValue())) {
return customerStatusEntity.getName();
}
}
}
return null;
}
public String getCustomerFlagName(CustomerStatusFlag customerStatusFlag, CustomerLevel customerLevel) {
logger.debug("In AccountStateMachines::getCustomerFlagName()");
if (customerStatusFlag == null) {
return "";
}
if (customerLevel.equals(CustomerLevel.CENTER)) {
for (CustomerStatusEntity customerStatus : customerStatusListForCenter) {
for (CustomerStatusFlagEntity customerStateFlagEntity : customerStatus.getFlagSet()) {
if (null != customerStateFlagEntity.getId()) {
if (customerStateFlagEntity.getId().equals(customerStatusFlag.getValue())) {
return customerStateFlagEntity.getName();
}
}
}
}
} else if (customerLevel.equals(CustomerLevel.GROUP)) {
for (CustomerStatusEntity customerStatus : customerStatusListForGroup) {
for (CustomerStatusFlagEntity customerStateFlagEntity : customerStatus.getFlagSet()) {
if (null != customerStateFlagEntity.getId()) {
if (customerStateFlagEntity.getId().equals(customerStatusFlag.getValue())) {
return customerStateFlagEntity.getName();
}
}
}
}
} else if (customerLevel.equals(CustomerLevel.CLIENT)) {
for (CustomerStatusEntity customerStatus : customerStatusListForClient) {
for (CustomerStatusFlagEntity customerStateFlagEntity : customerStatus.getFlagSet()) {
if (null != customerStateFlagEntity.getId()) {
if (customerStateFlagEntity.getId().equals(customerStatusFlag.getValue())) {
return customerStateFlagEntity.getName();
}
}
}
}
}
return "";
}
public List<AccountStateEntity> getLoanStatusList(AccountStateEntity accountStateEntity) {
return statesViewMapForLoan.get(accountStateEntity.getId());
}
public List<AccountStateEntity> getSavingsStatusList(AccountStateEntity accountStateEntity) {
return statesViewMapForSavings.get(accountStateEntity.getId());
}
public List<CustomerStatusEntity> getCenterStatusList(CustomerStatusEntity customerStatusEntity) {
if (statesViewMapForCenter.containsKey(customerStatusEntity.getId())) {
return statesViewMapForCenter.get(customerStatusEntity.getId());
}
return new ArrayList<CustomerStatusEntity>();
}
public List<CustomerStatusEntity> getGroupStatusList(CustomerStatusEntity customerStatusEntity) {
if (statesViewMapForGroup.containsKey(customerStatusEntity.getId())) {
return statesViewMapForGroup.get(customerStatusEntity.getId());
}
return new ArrayList<CustomerStatusEntity>();
}
public List<CustomerStatusEntity> getClientStatusList(CustomerStatusEntity customerStatusEntity) {
if (statesViewMapForClient.containsKey(customerStatusEntity.getId())) {
return statesViewMapForClient.get(customerStatusEntity.getId());
}
return new ArrayList<CustomerStatusEntity>();
}
public List<AccountStateEntity> getStatusList(AccountStateEntity accountStateEntity, AccountTypes accountTypes) {
logger.debug("In AccountStateMachines::getStatusList()");
if (accountTypes.equals(AccountTypes.LOAN_ACCOUNT)) {
return statesViewMapForLoan.get(accountStateEntity.getId());
} else if (accountTypes.equals(AccountTypes.SAVINGS_ACCOUNT)) {
return statesViewMapForSavings.get(accountStateEntity.getId());
}
return null;
}
public List<CustomerStatusEntity> getStatusList(CustomerStatusEntity customerStatus, CustomerLevel customerLevel) {
logger.debug("In AccountStateMachines::getStatusList()");
if (customerLevel.equals(CustomerLevel.CENTER)) {
if (statesViewMapForCenter.containsKey(customerStatus.getId())) {
return statesViewMapForCenter.get(customerStatus.getId());
}
} else if (customerLevel.equals(CustomerLevel.GROUP)) {
if (statesViewMapForGroup.containsKey(customerStatus.getId())) {
return statesViewMapForGroup.get(customerStatus.getId());
}
} else if (customerLevel.equals(CustomerLevel.CLIENT)) {
if (statesViewMapForClient.containsKey(customerStatus.getId())) {
return statesViewMapForClient.get(customerStatus.getId());
}
}
return null;
}
private void removeLoanReversalFlagForCancelState() {
if (accountStateEntityListForLoan != null && accountStateEntityListForLoan.size() > 0) {
for (AccountStateEntity accountState : accountStateEntityListForLoan) {
if (accountState.getId().equals(AccountState.LOAN_CANCELLED.getValue())) {
for (Iterator<AccountStateFlagEntity> iter = accountState.getFlagSet().iterator(); iter.hasNext();) {
AccountStateFlagEntity accountStateFlag = iter.next();
if (accountStateFlag.getId().equals(AccountStateFlag.LOAN_REVERSAL.getValue())) {
iter.remove();
}
}
}
}
}
}
private String getConfigurationName(AccountTypes accountType, CustomerLevel level) {
logger.debug("In AccountStateMachines::getConfigurationName()");
String configurationName = null;
if (accountType.equals(AccountTypes.LOAN_ACCOUNT)) {
if (ProcessFlowRules.isLoanPendingApprovalStateEnabled()) {
configurationName = "configuration 3";
} else {
configurationName = "configuration 4";
}
} else if (accountType.equals(AccountTypes.SAVINGS_ACCOUNT)) {
if (ProcessFlowRules.isSavingsPendingApprovalStateEnabled()) {
configurationName = "configuration 1";
} else {
configurationName = "configuration 2";
}
} else if (accountType.equals(AccountTypes.CUSTOMER_ACCOUNT)) {
if (level.equals(CustomerLevel.CENTER)) {
configurationName = "configuration 1";
} else if (level.equals(CustomerLevel.GROUP)) {
if (ProcessFlowRules.isGroupPendingApprovalStateEnabled()) {
configurationName = "configuration 1";
} else {
configurationName = "configuration 2";
}
} else if (level.equals(CustomerLevel.CLIENT)) {
if (ProcessFlowRules.isClientPendingApprovalStateEnabled()) {
configurationName = "configuration 1";
} else {
configurationName = "configuration 2";
}
}
}
return configurationName;
}
private List<CustomerStatusEntity> retrieveAllCustomerStatusList(CustomerLevel customerLevel)
throws StatesInitializationException {
logger.debug("In AccountStateMachines::retrieveAllCustomerStatusList()");
try {
return new CustomerPersistence().retrieveAllCustomerStatusList(customerLevel.getValue());
} catch (PersistenceException pe) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, pe);
}
}
private void populateCenterStatesViewMap() throws StatesInitializationException {
logger.debug("In AccountStateMachines::populateCenterStatesViewMap()");
if (null != statesMapForCenter) {
Set<StateEntity> customerStatusEntityKeySet = statesMapForCenter.keySet();
try {
if (null != customerStatusListForCenter && null != customerStatusListForCenter) {
for (StateEntity customerStateEntity : customerStatusEntityKeySet) {
for (CustomerStatusEntity customerStateEntityQueryResultObj : customerStatusListForCenter) {
if (customerStateEntity.sameId(customerStateEntityQueryResultObj)) {
statesViewMapForCenter.put(customerStateEntityQueryResultObj.getId(),
retrieveNextPossibleCustomerStateForCenter(customerStateEntity));
break;
}
}
}
}
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
}
private void populateGroupStatesViewMap() throws StatesInitializationException {
logger.debug("In AccountStateMachines::populateGroupStatesViewMap()");
if (null != statesMapForGroup) {
Set<StateEntity> customerStatusEntityKeySet = statesMapForGroup.keySet();
try {
if (null != customerStatusListForGroup && null != customerStatusListForGroup) {
for (StateEntity customerStateEntity : customerStatusEntityKeySet) {
for (CustomerStatusEntity customerStateEntityQueryResultObj : customerStatusListForGroup) {
if (customerStateEntity.sameId(customerStateEntityQueryResultObj)) {
statesViewMapForGroup.put(customerStateEntityQueryResultObj.getId(),
retrieveNextPossibleCustomerStateForGroup(customerStateEntity));
break;
}
}
}
}
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
}
private void populateClientStatesViewMap() throws StatesInitializationException {
logger.debug("In AccountStateMachines::populateClientStatesViewMap()");
if (null != statesMapForClient) {
Set<StateEntity> customerStatusEntityKeySet = statesMapForClient.keySet();
try {
if (null != customerStatusListForClient && null != customerStatusListForClient) {
for (StateEntity customerStateEntity : customerStatusEntityKeySet) {
for (CustomerStatusEntity customerStateEntityQueryResultObj : customerStatusListForClient) {
if (customerStateEntity.sameId(customerStateEntityQueryResultObj)) {
statesViewMapForClient.put(customerStateEntityQueryResultObj.getId(),
retrieveNextPossibleCustomerStateForClient(customerStateEntity));
break;
}
}
}
}
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
}
private List<CustomerStatusEntity> retrieveNextPossibleCustomerStateForCenter(StateEntity customerStateEntityObj)
throws ApplicationException {
logger.debug("In AccountStateMachines::retrieveNextPossibleCustomerStateForCenter()");
List<CustomerStatusEntity> stateEntityList = new ArrayList<CustomerStatusEntity>();
try {
List<StateEntity> stateList = statesMapForCenter.get(customerStateEntityObj);
if (null != stateList) {
for (StateEntity customerStateEntity : stateList) {
for (CustomerStatusEntity customerStatusEntry : customerStatusListForCenter) {
if (customerStatusEntry.sameId(customerStateEntity)) {
stateEntityList.add(customerStatusEntry);
break;
}
}
}
}
return stateEntityList;
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
private List<CustomerStatusEntity> retrieveNextPossibleCustomerStateForGroup(StateEntity customerStateEntityObj)
throws ApplicationException {
logger.debug("In AccountStateMachines::retrieveNextPossibleCustomerStateForGroup()");
List<CustomerStatusEntity> stateEntityList = new ArrayList<CustomerStatusEntity>();
try {
List<StateEntity> stateList = statesMapForGroup.get(customerStateEntityObj);
if (null != stateList) {
for (StateEntity customerStateEntity : stateList) {
for (CustomerStatusEntity customerStatusEntry : customerStatusListForGroup) {
if (customerStatusEntry.sameId(customerStateEntity)) {
stateEntityList.add(customerStatusEntry);
break;
}
}
}
}
return stateEntityList;
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
private List<CustomerStatusEntity> retrieveNextPossibleCustomerStateForClient(StateEntity customerStateEntityObj)
throws ApplicationException {
logger.debug("In AccountStateMachines::retrieveNextPossibleCustomerStateForClient()");
List<CustomerStatusEntity> stateEntityList = new ArrayList<CustomerStatusEntity>();
try {
List<StateEntity> stateList = statesMapForClient.get(customerStateEntityObj);
if (null != stateList) {
for (StateEntity customerStateEntity : stateList) {
for (CustomerStatusEntity customerStatusEntry : customerStatusListForClient) {
if (customerStatusEntry.sameId(customerStateEntity)) {
stateEntityList.add(customerStatusEntry);
break;
}
}
}
}
return stateEntityList;
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
private List<AccountStateEntity> retrieveNextPossibleAccountStateObjectsForLoan(StateEntity accountStateEntityObj)
throws ApplicationException {
logger.debug("In AccountStateMachines::retrieveNextPossibleAccountStateObjectsForLoan()");
List<AccountStateEntity> stateEntityList = new ArrayList<AccountStateEntity>();
try {
List<StateEntity> stateList = statesMapForLoan.get(accountStateEntityObj);
if (null != stateList) {
for (StateEntity accountStateEntity : stateList) {
for (AccountStateEntity accountStateEnty : accountStateEntityListForLoan) {
if (accountStateEntity.sameId(accountStateEnty)) {
stateEntityList.add(accountStateEnty);
break;
}
}
}
}
return stateEntityList;
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
private List<AccountStateEntity> retrieveNextPossibleAccountStateObjectsForSavings(StateEntity accountStateEntityObj)
throws ApplicationException {
logger.debug("In AccountStateMachines::retrieveNextPossibleAccountStateObjectsForSavings()");
List<AccountStateEntity> stateEntityList = new ArrayList<AccountStateEntity>();
try {
List<StateEntity> stateList = statesMapForSavings.get(accountStateEntityObj);
if (null != stateList) {
for (StateEntity accountStateEntity : stateList) {
for (AccountStateEntity accountStateEnty : accountStateEntityListForSavings) {
if (accountStateEntity.sameId(accountStateEnty)) {
stateEntityList.add(accountStateEnty);
break;
}
}
}
}
return stateEntityList;
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
private List<AccountStateEntity> retrieveAllAccountStateList(AccountTypes accountType) throws ApplicationException {
logger.debug("In AccountStateMachines::retrieveAllAccountStateList()");
try {
return new AccountBusinessService().retrieveAllAccountStateList(accountType);
} catch (ServiceException e) {
throw new ApplicationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
private void populateLoanStatesViewMap() throws StatesInitializationException {
logger.debug("In AccountStateMachines::populateLoanStatesViewMap()");
if (null != statesMapForLoan) {
Set<StateEntity> accountStateEntityKeySet = statesMapForLoan.keySet();
try {
if (null != accountStateEntityKeySet && null != accountStateEntityListForLoan) {
for (StateEntity accountStateEntity : accountStateEntityKeySet) {
for (AccountStateEntity accountStateEntityQueryResultObj : accountStateEntityListForLoan) {
if (accountStateEntity.sameId(accountStateEntityQueryResultObj)) {
statesViewMapForLoan.put(accountStateEntityQueryResultObj.getId(),
retrieveNextPossibleAccountStateObjectsForLoan(accountStateEntity));
break;
}
}
}
}
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
}
private void populateSavingsStatesViewMap() throws StatesInitializationException {
logger.debug("In AccountStateMachines::populateSavingsStatesViewMap()");
if (null != statesMapForSavings) {
Set<StateEntity> accountStateEntityKeySet = statesMapForSavings.keySet();
try {
if (null != accountStateEntityKeySet && null != accountStateEntityListForSavings) {
for (StateEntity accountStateEntity : accountStateEntityKeySet) {
for (AccountStateEntity accountStateEntityQueryResultObj : accountStateEntityListForSavings) {
if (accountStateEntity.sameId(accountStateEntityQueryResultObj)) {
statesViewMapForSavings.put(accountStateEntityQueryResultObj.getId(),
retrieveNextPossibleAccountStateObjectsForSavings(accountStateEntity));
break;
}
}
}
}
} catch (Exception e) {
throw new StatesInitializationException(SavingsConstants.STATEINITIALIZATION_EXCEPTION, e);
}
}
}
private Map<StateEntity, List<StateEntity>> loadMap(String filename, String configurationName) {
return StateXMLParser.getInstance().loadMapFromXml(filename, configurationName);
}
}
|
vorburger/mifos-head
|
application/src/main/java/org/mifos/accounts/business/AccountStateMachines.java
|
Java
|
apache-2.0
| 33,209 |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional information regarding
* copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License. You may obtain a
* copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.apache.geode.cache.query.data;
import java.io.Serializable;
import java.sql.Timestamp;
/*
* author: Prafulla Chaudhari
*/
public class SecurityMaster implements Serializable {
public String cusip; // VARCHAR(9)
public String cusip_prohibited;// VARCHAR(1)
public String security_number;// VARCHAR(7)
public String security_type;// VARCHAR(1)
public String sbs_product_code;// VARCHAR(10)
public String sbs_product_group;// _CODE VARCHAR(20)
public String is_callable;// VARCHAR(1)
public Timestamp dated_date;// TIMESTAMP
public Timestamp maturity_date;// TIMESTAMP
public Timestamp coupon_date;// TIMESTAMP
public double coupon_rate;// DOUBLE
public Timestamp issue_date;// TIMESTAMP
public double issuer_price;// DOUBLE
public String moody_rating;// VARCHAR(10)
public String snp_rating;// VARCHAR(10)
public String security_description;// VARCHAR(200)
public String state_code;// VARCHAR(2)
public String country_code;// VARCHAR(3)
public Timestamp first_settlement_date;// TIMESTAMP
public Timestamp next_settlement_date; // TIMESTAMP
public Timestamp first_coupon_date;// TIMESTAMP
public Timestamp next_last_coupon_date; // TIMESTAMP
public Timestamp last_coupon_date; // TIMESTAMP
public String call_type;// VARCHAR(10)
public Timestamp pre_refunded_date; // TIMESTAMP
public double pre_refunded_price;// DOUBLE
public String put_type;// VARCHAR(5)
public String coupon_frequency;// VARCHAR(15)
public String sinking_fund_type;// VARCHAR(5)
public String escrow_type;// VARCHAR(5)
public String pre_refund_type;// VARCHAR(5)
public String insurance_type;// VARCHAR(5)
public String insurer_name;// VARCHAR(60)
public String exchange;// VARCHAR(4)
public String is_escrow;// VARCHAR(1)
public String is_prerefunded;// VARCHAR(1)
public String is_insured;// VARCHAR(1)
public String is_taxable;// VARCHAR(1)
public String is_subj_amt;// VARCHAR(1)
public String is_exmt_amt;// VARCHAR(1)
public String is_bank_qualified;// VARCHAR(1)
public String is_general_oblig;// VARCHAR(1)
public String is_revenue;// VARCHAR(1)
public String legal_defeasance_status;// VARCHAR(1)
public String alternative_minimum_tax_status;// VARCHAR(1)
public String tax_indicator;// VARCHAR(1)
public String bank_qualified_status;// VARCHAR(1)
public String taxable_status;// VARCHAR(1)
public String advalorem_tax_status;// VARCHAR(1)
public String source;// VARCHAR(8)
public String accrual_daycount_code;// VARCHAR(22)
public String is_endof_monthpayment;// VARCHAR(10)
public String symbol;// VARCHAR(9)
public String short_description;// VARCHAR(48)
public String moody_watch;// VARCHAR(10)
public String snp_watch;// VARCHAR(10)
public double article_counter;// DOUBLE
public String coupon_type;// VARCHAR(10)
public Timestamp update_date;// TIMESTAMP
public String is_perpetual;// VARCHAR(1)
public String tba_cusip;// VARCHAR(7)
public String coupon_class;// VARCHAR(10)
public int amortization_term;// INTEGER
public String mbs_class_code;// VARCHAR(1)
public String mbscc_eligibility_flag;// VARCHAR(1)
public String additional_sec_desc;// VARCHAR(256)
public String hand_figure_ind;// VARCHAR(1)
public String trading_flat_ind;// VARCHAR(1)
public String monetary_default_ind;// VARCHAR(1)
public String investment_grade;// VARCHAR(1)
//////// constructor of class SecurityMaster
protected String[] tempArr;
protected int i = 0;
protected String tempStr;
protected int tempInt;
protected double tempDouble;
public SecurityMaster(String inputStr) {
tempArr = inputStr.split(",");
cusip = tempArr[i++].replaceAll("\"", " ").trim(); // VARCHAR(9)
cusip_prohibited = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
security_number = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(7)
security_type = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
sbs_product_code = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(10)
sbs_product_group = tempArr[i++].replaceAll("\"", " ").trim();// _CODE VARCHAR(20)
is_callable = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
tempStr = tempArr[i++];
if (!tempStr.equalsIgnoreCase("NULL")) {
dated_date = Timestamp.valueOf(tempStr.replaceAll("\"", " ").trim());// TIMESTAMP
}
tempStr = tempArr[i++];
if (!tempStr.equalsIgnoreCase("NULL")) {
maturity_date = Timestamp.valueOf(tempStr.replaceAll("\"", " ").trim());// TIMESTAMP
}
tempStr = tempArr[i++];
if (!tempStr.equalsIgnoreCase("NULL")) {
coupon_date = Timestamp.valueOf(tempStr.replaceAll("\"", " ").trim());// TIMESTAMP
}
tempStr = tempArr[i++];
if (!tempStr.equalsIgnoreCase("NULL")) {
coupon_rate = Double.parseDouble(tempStr.replaceAll("\"", " ").trim());// DOUBLE
}
tempStr = tempArr[i++];
if (!tempStr.equalsIgnoreCase("NULL")) {
issue_date = Timestamp.valueOf(tempStr.replaceAll("\"", " ").trim());// TIMESTAMP
}
tempStr = tempArr[i++];
if (!tempStr.equalsIgnoreCase("NULL")) {
issuer_price = Double.parseDouble(tempStr.replaceAll("\"", " ").trim());// DOUBLE
}
moody_rating = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(10)
snp_rating = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(10)
tempStr = tempArr[i++];
tempStr = tempStr.replaceFirst("\"", " ").trim();
if (tempStr.lastIndexOf("\"") == -1) {
tempStr = tempStr + tempArr[i++];
}
security_description = tempStr.replaceAll("\"", " ").trim();// VARCHAR(200)
state_code = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(2)
country_code = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(3)
tempStr = tempArr[i++];
if (!tempStr.equalsIgnoreCase("NULL")) {
first_settlement_date = Timestamp.valueOf(tempStr.replaceAll("\"", " ").trim());// TIMESTAMP
}
tempStr = tempArr[i++];
if (!tempStr.equalsIgnoreCase("NULL")) {
next_settlement_date = Timestamp.valueOf(tempStr.replaceAll("\"", " ").trim());// TIMESTAMP
}
tempStr = tempArr[i++];
if (!tempStr.equalsIgnoreCase("NULL")) {
first_coupon_date = Timestamp.valueOf(tempStr.replaceAll("\"", " ").trim());// TIMESTAMP
}
tempStr = tempArr[i++];
if (!tempStr.equalsIgnoreCase("NULL")) {
next_last_coupon_date = Timestamp.valueOf(tempStr.replaceAll("\"", " ").trim());// TIMESTAMP
}
tempStr = tempArr[i++];
if (!tempStr.equalsIgnoreCase("NULL")) {
last_coupon_date = Timestamp.valueOf(tempStr.replaceAll("\"", " ").trim());// TIMESTAMP
}
call_type = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(10)
tempStr = tempArr[i++];
if (!tempStr.equalsIgnoreCase("NULL")) {
pre_refunded_date = Timestamp.valueOf(tempStr.replaceAll("\"", " ").trim());// TIMESTAMP
}
tempStr = tempArr[i++];
if (!tempStr.equalsIgnoreCase("NULL")) {
pre_refunded_price = Double.parseDouble(tempStr.replaceAll("\"", " ").trim());// DOUBLE
}
put_type = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(5)
coupon_frequency = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(15)
sinking_fund_type = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(5)
escrow_type = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(5)
pre_refund_type = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(5)
insurance_type = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(5)
insurer_name = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(60)
exchange = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(4)
is_escrow = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
is_prerefunded = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
is_insured = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
is_taxable = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
is_subj_amt = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
is_exmt_amt = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
is_bank_qualified = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
is_general_oblig = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
is_revenue = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
legal_defeasance_status = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
alternative_minimum_tax_status = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
tax_indicator = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
bank_qualified_status = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
taxable_status = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
advalorem_tax_status = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
source = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(8)
accrual_daycount_code = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(22)
is_endof_monthpayment = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(10)
symbol = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(9)
short_description = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(48)
moody_watch = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(10)
snp_watch = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(10)
tempStr = tempArr[i++];
if (!tempStr.equalsIgnoreCase("NULL")) {
article_counter = Double.parseDouble(tempStr.replaceAll("\"", " ").trim());// DOUBLE
}
coupon_type = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(10)
tempStr = tempArr[i++];
if (!tempStr.equalsIgnoreCase("NULL")) {
update_date = Timestamp.valueOf(tempStr.replaceAll("\"", " ").trim());// TIMESTAMP
}
is_perpetual = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
tba_cusip = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(7)
coupon_class = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(10)
tempStr = tempArr[i++];
if (!tempStr.equalsIgnoreCase("NULL")) {
amortization_term = Integer.parseInt(tempStr.replaceAll("\"", " ").trim());// INTEGER
}
mbs_class_code = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
mbscc_eligibility_flag = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
additional_sec_desc = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(256)
hand_figure_ind = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
trading_flat_ind = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
monetary_default_ind = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
investment_grade = tempArr[i++].replaceAll("\"", " ").trim();// VARCHAR(1)
}// end of SecurityMaster constructor
}// end of class
|
jdeppe-pivotal/geode
|
geode-junit/src/main/java/org/apache/geode/cache/query/data/SecurityMaster.java
|
Java
|
apache-2.0
| 11,614 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.