text
stringlengths 2
99.9k
| meta
dict |
|---|---|
require 'rails_helper'
# WARNING: Some tests require real backend answers, so make sure you uncomment
# this line and start a test backend.
# CONFIG['global_write_through'] = true
RSpec.describe Webui::Kiwi::ImagesController, type: :controller, vcr: true do
let(:project) { create(:project, name: 'fake_project') }
let(:user) { create(:confirmed_user, :with_home, login: 'tom') }
let(:kiwi_image_with_package_with_kiwi_file) do
create(:kiwi_image_with_package, name: 'package_with_valid_kiwi_file', project: user.home_project, with_kiwi_file: true)
end
describe 'GET #import_from_package' do
include_context 'a kiwi image xml'
include_context 'an invalid kiwi image xml'
before do
login user
end
context 'without a kiwi file' do
let(:package) { create(:package, name: 'package_without_kiwi_file', project: project) }
before do
get :import_from_package, params: { package_id: package.id }
end
it { expect(response).to redirect_to(root_path) }
it { expect(flash[:error]).to eq('There is no KIWI file') }
end
context 'with a kiwi file' do
context 'that is a valid kiwi file' do
let(:kiwi_image) do
create(:kiwi_image_with_package, name: 'package_with_valid_kiwi_file', project: project, with_kiwi_file: true)
end
before do
get :import_from_package, params: { package_id: kiwi_image.package.id }
end
it { expect(response).to redirect_to(kiwi_image_path(kiwi_image)) }
end
context 'that is an invalid kiwi file' do
let(:package_with_kiwi_file) do
create(:package_with_kiwi_file, name: 'package_with_invalid_kiwi_file', project: project, kiwi_file_content: invalid_kiwi_xml)
end
before do
get :import_from_package, params: { package_id: package_with_kiwi_file.id }
end
it 'redirect to package_view_file_path' do
expect(response).to redirect_to(package_view_file_path(project: package_with_kiwi_file.project,
package: package_with_kiwi_file,
filename: "#{package_with_kiwi_file.name}.kiwi"))
end
it { expect(flash[:error]).not_to be_nil }
end
context 'with source_path' do
context 'with obsrepository' do
let(:package_with_kiwi_file) do
create(:package_with_kiwi_file, name: 'package_with_a_kiwi_file',
project: project, kiwi_file_content: kiwi_xml_with_obsrepositories)
end
before do
get :import_from_package, params: { package_id: package_with_kiwi_file.id }
end
it 'redirect to kiwi image show' do
package_with_kiwi_file.reload
expect(response).to redirect_to(kiwi_image_path(package_with_kiwi_file.kiwi_image))
end
end
context 'with obsrepository and others' do
let(:package_with_kiwi_file) do
create(:package_with_kiwi_file, name: 'package_with_invalid_kiwi_file',
project: project, kiwi_file_content: invalid_kiwi_xml_with_obsrepositories)
end
let(:errors) do
{
'Image Errors:' => [
'A repository with source_path "obsrepositories:/" has been set. If you want to use it, please remove the other repositories',
"Preferences can't be blank"
],
title: "Kiwi File 'package_with_invalid_kiwi_file.kiwi' has errors:"
}
end
before do
get :import_from_package, params: { package_id: package_with_kiwi_file.id }
end
it 'redirect to package_view_file_path' do
expect(response).to redirect_to(package_view_file_path(project: package_with_kiwi_file.project,
package: package_with_kiwi_file,
filename: "#{package_with_kiwi_file.name}.kiwi"))
end
it { expect(flash[:error]).to eq(errors) }
end
end
context 'with multiple package_groups' do
context 'with the same type' do
let(:package_with_kiwi_file) do
create(:package_with_kiwi_file, name: 'package_with_invalid_kiwi_file',
project: project, kiwi_file_content: invalid_kiwi_xml_with_multiple_package_groups)
end
let(:errors) do
[
[:title, "Kiwi File 'package_with_invalid_kiwi_file.kiwi' has errors:"],
[
'Image Errors:',
[
'Multiple package groups with same type and profiles are not allowed',
"Preferences can't be blank"
]
]
]
end
before do
get :import_from_package, params: { package_id: package_with_kiwi_file.id }
end
it 'redirect to package_view_file_path' do
expect(response).to redirect_to(package_view_file_path(project: package_with_kiwi_file.project,
package: package_with_kiwi_file,
filename: "#{package_with_kiwi_file.name}.kiwi"))
end
it { expect(flash[:error]).to match_array(errors) }
end
end
end
end
describe 'GET #show' do
before do
login user
end
context 'json' do
subject { get :show, params: { format: :json, id: kiwi_image_with_package_with_kiwi_file.id } }
it { expect(subject.media_type).to eq('application/json') }
it { expect(subject).to have_http_status(:success) }
end
context 'html' do
subject { get :show, params: { id: kiwi_image_with_package_with_kiwi_file.id } }
it { expect(subject).to have_http_status(:success) }
it { expect(subject).to render_template(:show) }
end
end
describe 'POST #update' do
let(:kiwi_repository) { create(:kiwi_repository, image: kiwi_image_with_package_with_kiwi_file) }
let(:kiwi_package_group) { create(:kiwi_package_group, kiwi_type: 'image', image: kiwi_image_with_package_with_kiwi_file) }
let!(:kiwi_package) { create(:kiwi_package, package_group: kiwi_package_group, image: kiwi_image_with_package_with_kiwi_file) }
before do
login user
end
context 'with invalid repositories data' do
let(:invalid_repositories_update_params) do
{
id: kiwi_image_with_package_with_kiwi_file.id,
kiwi_image: {
repositories_attributes: {
'0' => {
id: kiwi_repository.id,
repo_type: 'apt2-deb',
source_path: 'htt://example.com'
}
}
}
}
end
let(:errors) do
{
'Repository: htt://example.com' => [
'Source path has an invalid format',
"Repo type 'apt2-deb' is not included in the list"
],
title: 'Cannot update KIWI Image:'
}
end
subject! { post :update, params: invalid_repositories_update_params }
it { expect(subject.request.flash[:error]).to eq(errors) }
it { expect(subject).to have_http_status(:success) }
it { expect(subject).to render_template(:edit) }
end
context 'with valid repositories data' do
context 'without use_project_repositories' do
let(:update_params) do
{
id: kiwi_image_with_package_with_kiwi_file.id,
kiwi_image: { repositories_attributes: { '0' => {
id: kiwi_repository.id,
repo_type: 'apt-deb',
priority: '',
alias: '',
source_path: 'http://',
username: '',
password: '',
prefer_license: 0,
imageinclude: 0,
replaceable: 0
} }, use_project_repositories: '0' }
}
end
before do
post :update, params: update_params
end
it { expect(response).to redirect_to(action: :edit) }
it { expect(flash[:error]).to be_nil }
end
context 'with use_project_repositories' do
let(:update_params) do
{
id: kiwi_image_with_package_with_kiwi_file.id,
kiwi_image: { repositories_attributes: { '0' => {
id: kiwi_repository.id,
repo_type: 'apt-deb',
priority: '',
alias: '',
source_path: 'http://',
username: '',
password: '',
prefer_license: 0,
imageinclude: 0,
replaceable: 0
} }, use_project_repositories: '1' }
}
end
before do
kiwi_repository
post :update, params: update_params
end
it { expect(response).to redirect_to(action: :edit) }
it { expect(kiwi_image_with_package_with_kiwi_file.repositories.count).to eq(0) }
it { expect(flash[:error]).to be_nil }
end
end
context 'with invalid package: empty name' do
let(:invalid_packages_update_params) do
{
id: kiwi_image_with_package_with_kiwi_file.id,
kiwi_image: {
package_groups_attributes: {
'0' => {
id: kiwi_package.package_group.id,
packages_attributes: {
'0' => {
id: kiwi_package.id,
name: '',
arch: 'x86'
}
}
}
}
}
}
end
let(:errors) do
{
'Package: ' => ["Name can't be blank"],
title: 'Cannot update KIWI Image:'
}
end
subject { post :update, params: invalid_packages_update_params }
it { expect(subject.request.flash[:error]).to eq(errors) }
it { expect(subject).to have_http_status(:success) }
it { expect(subject).to render_template(:edit) }
end
context 'with valid packages data' do
let(:update_params) do
{
id: kiwi_image_with_package_with_kiwi_file.id,
kiwi_image: {
package_groups_attributes: {
'0' => {
id: kiwi_package.package_group.id,
packages_attributes: {
'0' => {
id: kiwi_package.id,
name: kiwi_package.name,
arch: 'x86-876'
}
}
}
}
}
}
end
before do
post :update, params: update_params
kiwi_package.reload
end
it { expect(response).to redirect_to(action: :edit) }
it { expect(flash[:error]).to be_nil }
it { expect(kiwi_package.arch).to eq('x86-876') }
end
end
describe 'GET #autocomplete_binaries' do
let(:binaries_available_sample) do
{ 'apache' => ['i586', 'x86_64'], 'apache2' => ['x86_64'],
'appArmor' => ['i586', 'x86_64'], 'bcrypt' => ['x86_64'] }
end
let(:term) { '' }
before do
login user
allow(Kiwi::Image).to receive(:binaries_available).and_return(binaries_available_sample)
end
subject do
get :autocomplete_binaries, params: { format: :json, id: kiwi_image_with_package_with_kiwi_file.id, term: term }
end
it { expect(subject.media_type).to eq('application/json') }
it { expect(subject).to have_http_status(:success) }
it do
expect(JSON.parse(subject.body)).to eq([{ 'id' => 'apache', 'label' => 'apache', 'value' => 'apache' },
{ 'id' => 'apache2', 'label' => 'apache2', 'value' => 'apache2' },
{ 'id' => 'appArmor', 'label' => 'appArmor', 'value' => 'appArmor' },
{ 'id' => 'bcrypt', 'label' => 'bcrypt', 'value' => 'bcrypt' }])
end
context 'for the term "ap"' do
let(:term) { 'ap' }
it do
expect(JSON.parse(subject.body)).to eq([{ 'id' => 'apache', 'label' => 'apache', 'value' => 'apache' },
{ 'id' => 'apache2', 'label' => 'apache2', 'value' => 'apache2' },
{ 'id' => 'appArmor', 'label' => 'appArmor', 'value' => 'appArmor' }])
end
end
context 'for the term "app"' do
let(:term) { 'app' }
it { expect(JSON.parse(subject.body)).to eq([{ 'id' => 'appArmor', 'label' => 'appArmor', 'value' => 'appArmor' }]) }
end
context 'for the term "b"' do
let(:term) { 'b' }
it { expect(JSON.parse(subject.body)).to eq([{ 'id' => 'bcrypt', 'label' => 'bcrypt', 'value' => 'bcrypt' }]) }
end
context 'for the term "c"' do
let(:term) { 'c' }
it { expect(JSON.parse(subject.body)).to be_empty }
end
end
end
|
{
"pile_set_name": "Github"
}
|
#import "Testing.h"
#import "ObjectTesting.h"
#import <Foundation/NSCalendar.h>
#if defined(GS_USE_ICU)
#define NSCALENDAR_SUPPORTED GS_USE_ICU
#else
#define NSCALENDAR_SUPPORTED 1 /* Assume Apple support */
#endif
int main()
{
START_SET("NSCalendar basic")
if (!NSCALENDAR_SUPPORTED)
SKIP("NSCalendar not supported\nThe ICU library was not available when GNUstep-base was built")
id testObj = [NSCalendar currentCalendar];
test_NSObject(@"NSCalendar", [NSArray arrayWithObject: testObj]);
#if __APPLE__
test_keyed_NSCoding([NSArray arrayWithObject: testObj]);
#else
test_NSCoding([NSArray arrayWithObject: testObj]);
#endif
test_NSCopying(@"NSCalendar", @"NSCalendar",
[NSArray arrayWithObject: testObj], NO, NO);
/* Test first weekday
*/
[testObj setFirstWeekday: 3];
PASS([testObj firstWeekday] == 3, "-firstWeekday returns the correct day");
[testObj setFirstWeekday: 1];
PASS([testObj firstWeekday] == 1, "-setFirstWeekday: works");
[testObj setFirstWeekday: 0];
PASS([testObj firstWeekday] == 0, "-setFirstWeekday: can set zero");
[testObj setFirstWeekday: 10];
PASS([testObj firstWeekday] == 10, "-setFirstWeekday: can set ten");
/* Test minimum days in first week
*/
[testObj setMinimumDaysInFirstWeek: 1];
PASS([testObj minimumDaysInFirstWeek] == 1,
"-minimumDaysInFirstWeek returns the correct count");
[testObj setMinimumDaysInFirstWeek: 4];
PASS([testObj minimumDaysInFirstWeek] == 4,
"-setMinimumDaysInFirstWeek: works");
[testObj setMinimumDaysInFirstWeek: 0];
PASS([testObj minimumDaysInFirstWeek] == 0,
"-setMinimumDaysInFirstWeek: can set zero");
[testObj setMinimumDaysInFirstWeek: 10];
PASS([testObj minimumDaysInFirstWeek] == 10,
"-setMinimumDaysInFirstWeek: can set ten");
END_SET("NSCalendar basic")
return 0;
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build nacl plan9 windows
package ipv4
import (
"net"
"syscall"
)
// ReadFrom reads a payload of the received IPv4 datagram, from the
// endpoint c, copying the payload into b. It returns the number of
// bytes copied into b, the control message cm and the source address
// src of the received datagram.
func (c *payloadHandler) ReadFrom(b []byte) (n int, cm *ControlMessage, src net.Addr, err error) {
if !c.ok() {
return 0, nil, nil, syscall.EINVAL
}
if n, src, err = c.PacketConn.ReadFrom(b); err != nil {
return 0, nil, nil, err
}
return
}
// WriteTo writes a payload of the IPv4 datagram, to the destination
// address dst through the endpoint c, copying the payload from b. It
// returns the number of bytes written. The control message cm allows
// the datagram path and the outgoing interface to be specified.
// Currently only Darwin and Linux support this. The cm may be nil if
// control of the outgoing datagram is not required.
func (c *payloadHandler) WriteTo(b []byte, cm *ControlMessage, dst net.Addr) (n int, err error) {
if !c.ok() {
return 0, syscall.EINVAL
}
if dst == nil {
return 0, errMissingAddress
}
return c.PacketConn.WriteTo(b, dst)
}
|
{
"pile_set_name": "Github"
}
|
app.version=1.0
app.id=com.udacity.gamedev.gamesandscreens.IOSLauncher
app.mainclass=com.udacity.gamedev.gamesandscreens.IOSLauncher
app.executable=IOSLauncher
app.build=1
app.name=GamesAndScreens
|
{
"pile_set_name": "Github"
}
|
fileFormatVersion: 2
guid: 299cb17e556654544a0af672224fc59b
folderAsset: yes
timeCreated: 1522648884
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2016-2019 PSPDFKit GmbH. All rights reserved.
*
* THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
* AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE PSPDFKIT LICENSE AGREEMENT.
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
* This notice may not be removed from this file
*/
package com.pspdfkit.labs.quickdemo
import androidx.test.InstrumentationRegistry
import androidx.test.runner.AndroidJUnit4
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith
/**
* Instrumentation test, which will execute on an Android device.
* @see [Testing documentation](http://d.android.com/tools/testing)
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
@Throws(Exception::class)
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getTargetContext()
assertEquals("com.pspdfkit.demoqstile", appContext.packageName)
}
}
|
{
"pile_set_name": "Github"
}
|
@import (reference) "../../../core/client/less/mt-var.less";
.pagination-border-top {
border-top: 2px solid lighten(@gray-base, 85%);
}
.pagination-border-bottom {
border-bottom: 2px solid lighten(@gray-base, 85%);
}
.follow-list {
padding: 20px 10px;
.follow-item {
position: relative;
padding: 10px;
min-height: 82px;
margin: 10px 0;
border: solid 1px #f5f5f5;
background-color: #f7f8f9;
box-shadow: 2px 2px 2px rgba(128, 128, 128, 0.2);
&:hover {
background-color: #f8f8f8;
border: solid 1px @gray-lighter;
.btn-unfollow {
display: block;
}
}
.follow-avatar {
float: left;
img {
width: 60px;
height: 60px;
}
}
.follow-name {
margin-left: 10px;
font-size: 18px;
font-weight: 500;
}
.follow-vip, .follow-level {
margin-left: 10px;
}
.follow-up-down {
font-size: 12px;
margin-left: 10px;
.torrent-up {
color: #33CC00;
}
.torrent-down {
color: #FF3300;
}
.up-data, .down-data {
color: lighten(@gray-base, 60%);
}
}
.btn-unfollow {
display: none;
position: absolute;
right: 10px;
top: 10px;
}
}
}
.status-tab {
border-bottom: solid 1px #ddd;
background-color: #fafbfc;
.container {
margin-bottom: -1px;
}
}
|
{
"pile_set_name": "Github"
}
|
+++
# A "Meet the Team" section created with the People widget.
# This section displays people from `content/authors/` which belong to the `user_groups` below.
widget = "people" # See https://sourcethemes.com/academic/docs/page-builder/
headless = true # This file represents a page section.
active = false # Activate this widget? true/false
weight = 68 # Order that this section will appear.
title = "Meet the Team"
subtitle = ""
[content]
# Choose which groups/teams of users to display.
# Edit `user_groups` in each user's profile to add them to one or more of these groups.
user_groups = ["Principal Investigators",
"Researchers",
"Grad Students",
"Administration",
"Visitors",
"Alumni"]
[design]
# Show user's social networking links? (true/false)
show_social = false
# Show user's interests? (true/false)
show_interests = true
[design.background]
# Apply a background color, gradient, or image.
# Uncomment (by removing `#`) an option to apply it.
# Choose a light or dark text color by setting `text_color_light`.
# Any HTML color name or Hex value is valid.
# Background color.
# color = "navy"
# Background gradient.
# gradient_start = "DeepSkyBlue"
# gradient_end = "SkyBlue"
# Background image.
# image = "background.jpg" # Name of image in `static/media/`.
# image_darken = 0.6 # Darken the image? Range 0-1 where 0 is transparent and 1 is opaque.
# Text color (true=light or false=dark).
# text_color_light = true
[advanced]
# Custom CSS.
css_style = ""
# CSS class.
css_class = ""
+++
|
{
"pile_set_name": "Github"
}
|
# Setup configure
Configuring TargetSpecificDeps1-0.1...
# Setup build
Preprocessing executable 'lemon' for TargetSpecificDeps1-0.1..
Building executable 'lemon' for TargetSpecificDeps1-0.1..
Preprocessing library for TargetSpecificDeps1-0.1..
Building library for TargetSpecificDeps1-0.1..
|
{
"pile_set_name": "Github"
}
|
s = set([2,3,4])
t = set([3,4,5])
u = set([1,3,5])
print s
s.difference_update(t)
u.difference_update(t)
print s
print u
print s == set([2])
print u == set([1])
s = set([2,3,4])
t = set([3,4,5])
t.difference_update(s, u)
print t
print t == set([5])
|
{
"pile_set_name": "Github"
}
|
- 🖼️ Make attachment grid responsive (for tablets)
- ℹ️ Display some hints for common error responses of the server
- 🌎 Language updates
|
{
"pile_set_name": "Github"
}
|
(*
** Bit-strings
*)
(* ****** ****** *)
%{^
//
#include <pthread.h>
//
%} // end of [%{^]
(* ****** ****** *)
//
#include
"share/atspre_staload.hats"
//
(* ****** ****** *)
//
#staload UN = $UNSAFE
//
(* ****** ****** *)
//
#staload
UNISTD =
"libats/libc/SATS/unistd.sats"
//
(* ****** ****** *)
//
#staload
_ = "libats/DATS/deqarray.dats"
//
(* ****** ****** *)
//
#staload
_ = "libats/DATS/athread.dats"
#staload
_ = "libats/DATS/athread_posix.dats"
//
(* ****** ****** *)
//
#include "./../mylibies.hats"
#staload $INTSET // opening it
#staload $SSNTYPE // opening it
#staload $SSNTYPE2R // opening it
//
(* ****** ****** *)
//
abstype
ssn_list(a:vt@ype)
//
(* ****** ****** *)
//
datatype
chan1neg_list
(a:vt@ype, type) =
| chan1neg_list_nil(a, nil) of ()
| chan1neg_list_cons
(a, snd(a) :: ssn_list(a)) of ()
// chan1neg_list_cons
//
(* ****** ****** *)
//
extern
fun{}
chan1neg_list
{a:vt@ype}
(
chneg:
!chan1neg(ssn_list(a)) >> chan1neg(ss)
) : #[ss:type] chan1neg_list(a, ss)
//
(* ****** ****** *)
//
extern
fun{}
chan1pos_list_nil
{a:vt@ype}
(
chpos:
!chan1pos(ssn_list(a)) >> chan1pos(nil)
) : void // end of [chan1pos_list_nil]
extern
fun{}
chan1pos_list_cons
{a:vt@ype}
(
chpos:
!chan1pos(ssn_list(a)) >> chan1pos(snd(a)::ssn_list(a))
) : void // end of [chan1pos_list_cons]
//
(* ****** ****** *)
implement
{}(*tmp*)
chan1pos_list_nil
(chpos) = () where
{
//
vtypedef
chan0 = $CHANNEL0.channel0(ptr, 2)
//
val
chan0 = $UN.castvwtp1{chan0}(chpos)
//
val () =
$CHANNEL0.channel0_send(chan0, 0, 1, $UN.int2ptr(0))
//
prval () = $UN.cast2void(chan0)
prval () = $UN.castview2void(chpos)
//
} (* end of [chan1pos_list_nil] *)
//
(* ****** ****** *)
implement
{}(*tmp*)
chan1pos_list_cons
(chpos) = () where
{
//
vtypedef
chan0 = $CHANNEL0.channel0(ptr, 2)
//
val
chan0 = $UN.castvwtp1{chan0}(chpos)
//
val () =
$CHANNEL0.channel0_send(chan0, 0, 1, $UN.int2ptr(1))
//
prval () = $UN.cast2void(chan0)
prval () = $UN.castview2void(chpos)
//
} (* end of [chan1pos_list_cons] *)
(* ****** ****** *)
implement
{}(*tmp*)
chan1neg_list
(chneg) = let
//
vtypedef
chan0 = $CHANNEL0.channel0(ptr, 2)
val
chan0 = $UN.castvwtp1{chan0}(chneg)
//
val tag =
$CHANNEL0.channel0_recv_val(chan0, 0, 1)
//
prval () = $UN.cast2void(chan0)
//
in
//
if
iseqz(tag)
then let
prval () = $UN.castview2void(chneg) in chan1neg_list_nil()
end // end of [then]
else let
prval () = $UN.castview2void(chneg) in chan1neg_list_cons()
end // end of [else]
//
end // end of [chan1neg_list]
(* ****** ****** *)
//
abst@ype bit = int
//
macdef B0 = $UN.cast{bit}(0)
macdef B1 = $UN.cast{bit}(1)
//
typedef bit_ = natLt(2)
//
extern castfn bit2bit_(bit): bit_
//
(* ****** ****** *)
//
extern
fun
int2bits
{n:nat}(int(n)): chan1neg(ssn_list(bit))
//
(* ****** ****** *)
implement
int2bits(n) = let
//
fun
fserv{n:nat}
(
n: int(n), chp: chan1pos(ssn_list(bit))
) : void = (
//
if
n > 0
then let
val n2 = half(n)
val bit =
(
if n = 2*n2 then B0 else B1
) : bit // end of [val]
val () = chan1pos_list_cons(chp)
val ((*void*)) = chan1pos_send<bit>(chp, bit)
in
fserv(n2, chp)
end // end of [then]
else let
val () = chan1pos_list_nil(chp) in channel1_close(chp)
end // end of [else]
//
) (* end of [fserv] *)
//
in
chan1neg_create_exn{ssn_list(bit)}(llam(chp) => fserv(n, chp))
end // end of [int2bits]
(* ****** ****** *)
//
extern
fun
succ_bits
(
chneg:
chan1neg(ssn_list(bit))
) : chan1neg(ssn_list(bit))
//
(* ****** ****** *)
implement
succ_bits(chn) = let
//
fun
fserv
(
chp: chan1pos(ssn_list(bit))
, chn: chan1neg(ssn_list(bit))
) : void = let
//
val opt = chan1neg_list(chn)
//
in
//
case+ opt of
| chan1neg_list_nil() => let
val () =
chan1pos_list_cons(chp)
val () =
chan1pos_send<bit>(chp, B1)
val () =
chan1pos_list_nil(chp)
// end of [val]
val () = channel1_close(chp)
val () = channel1_close(chn)
in
// nothing
end // end of [chan1neg_list_nil]
| chan1neg_list_cons() => let
val () =
chan1pos_list_cons (chp)
val bit = chan1neg_send_val<bit> (chn)
val bit_ = bit2bit_(bit)
in
if bit_ > 0
then let
val () =
chan1pos_send (chp, B0)
// end of [val]
in
fserv(chp, chn)
end // end of [then]
else let
val () =
chan1pos_send (chp, B1)
// end of [val]
in
chan1posneg_elim(chp, chn)
end // end of [else]
end // end of [chan1neg_list_cons]
//
end // end of [fserv]
//
in
chan1neg_create_exn{ssn_list(bit)}(llam(chp) => fserv(chp, chn))
end // end of [succ_bits]
(* ****** ****** *)
extern
fun
add_bits_bits
(
chan1neg(ssn_list(bit))
, chan1neg(ssn_list(bit))
) : chan1neg(ssn_list(bit))
(* ****** ****** *)
implement
add_bits_bits
(chn1, chn2) = let
//
fun
fserv
(
chp: chan1pos(ssn_list(bit))
, chn1: chan1neg(ssn_list(bit))
, chn2: chan1neg(ssn_list(bit))
) : void = let
//
val opt1 = chan1neg_list (chn1)
//
in
//
case+ opt1 of
| chan1neg_list_nil() => let
val () = channel1_close(chn1)
in
chan1posneg_elim (chp, chn2)
end // end of [chan1neg_list_nil]
| chan1neg_list_cons() => let
val () =
chan1pos_list_cons (chp)
// end of [val]
val opt2 = chan1neg_list (chn2)
in
case+ opt2 of
| chan1neg_list_nil() => let
val () =
channel1_close(chn2)
// end of [val]
in
chan1posneg_elim(chp, chn1)
end // end of [chan1neg_list_nil]
| chan1neg_list_cons() => let
val b1 = chan1neg_send_val(chn1)
and b2 = chan1neg_send_val(chn2)
val b1_ = bit2bit_(b1) and b2_ = bit2bit_(b2)
in
case+ b1_ of
| 0 => (
chan1pos_send(chp, b2); fserv(chp, chn1, chn2)
) (* end of [0] *)
| 1 => (
case+ b2_ of
| 0 => (chan1pos_send(chp, B1); fserv(chp, chn1, chn2))
| 1 => (chan1pos_send(chp, B0); fserv(chp, chn1, succ_bits(chn2)))
) (* end of [1] *)
end // end of [chan1neg_list_cons]
end // end of [chan1neg_list_cons]
//
end // end of [fserv]
//
in
chan1neg_create_exn{ssn_list(bit)}(llam(chp) => fserv(chp, chn1, chn2))
end // end of [add_bits_bits]
(* ****** ****** *)
//
extern
fun
bits2int
(
chn: chan1neg(ssn_list(bit))
) : intGte(0) // end-of-function
//
(* ****** ****** *)
implement
bits2int(chn) = let
//
fun
loop
(
xs: List0_vt(bit), res: intGte(0)
) : intGte(0) =
(
case+ xs of
| ~list_vt_nil() => res
| ~list_vt_cons(x, xs) =>
loop (xs, 2*res + bit2bit_(x))
) (* end of [loop] *)
//
//
fun
loop2
(
chn: chan1neg(ssn_list(bit)), xs: List0_vt(bit)
) : List0_vt(bit) = let
//
val opt = chan1neg_list(chn)
//
in
//
case+ opt of
| chan1neg_list_nil() => let
val () =
channel1_close(chn) in xs
// end of [val]
end // end of [chan1neg_list_nil]
| chan1neg_list_cons() => let
val x =
chan1neg_send_val<bit> (chn)
// end of [val]
in
loop2(chn, list_vt_cons(x, xs))
end // end of [chan1neg_list_cons]
//
end // end of [loop2]
//
in
loop(loop2(chn, list_vt_nil(*void*)), 0)
end // end of [bits2int]
(* ****** ****** *)
//
extern
fun
succ_int(intGte(0)): intGte(0)
//
(* ****** ****** *)
//
implement
succ_int(x) =
bits2int(succ_bits(int2bits(x)))
//
(* ****** ****** *)
//
extern
fun
add_int_int(intGte(0), intGte(0)): intGte(0)
//
(* ****** ****** *)
//
implement
add_int_int(x, y) =
bits2int(add_bits_bits(int2bits(x), int2bits(y)))
//
(* ****** ****** *)
implement
main0(argc, argv) =
{
//
val a0 =
(
if argc >= 2
then g0string2int(argv[1]) else 0
// end of [if]
) : int // end of [val]
//
val a1 =
(
if argc >= 3
then g0string2int(argv[2]) else 0
// end of [if]
) : int // end of [val]
//
val a0 = g1ofg0(a0)
and a1 = g1ofg0(a1)
//
val () = assertloc (a0 >= 0)
val () = assertloc (a1 >= 0)
//
val () =
println!
(a0, " + ", a1, " = ", add_int_int(a0, a1))
//
val _(*left*) = $UNISTD.usleep(250000u)
//
} (* end of [main0] *)
(* ****** ****** *)
(* end of [bitstr.dats] *)
|
{
"pile_set_name": "Github"
}
|
#include "WinServiceTest.h"
#include "CppUnit/TestCaller.h"
#include "CppUnit/TestSuite.h"
using Poco::Util::WinService;
WinServiceTest::WinServiceTest(const std::string& name) : CppUnit::TestCase(name)
{
}
WinServiceTest::~WinServiceTest()
{
}
void WinServiceTest::testServiceCouldCreatedWithExistingConnection()
{
SC_HANDLE scmHandle = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
assertTrue(scmHandle);
WinService spoolerService{scmHandle, "Spooler"};
assertTrue(spoolerService.isRegistered());
}
void WinServiceTest::testServiceReturnsTrueIfStopped()
{
WinService spoolerService{"Spooler"};
spoolerService.stop();
assertTrue(spoolerService.isStopped());
}
void WinServiceTest::testServiceReturnsFailureActionConfigured()
{
WinService spoolerService{"Spooler"};
auto failureActions = spoolerService.getFailureActions();
assertEqual(3, failureActions.size());
assertEqual(WinService::SVC_RESTART, failureActions[0]);
assertEqual(WinService::SVC_RESTART, failureActions[1]);
assertEqual(WinService::SVC_NONE, failureActions[2]);
}
void WinServiceTest::setUp()
{
}
void WinServiceTest::tearDown()
{
try
{
WinService spoolerService{"Spooler"};
if (spoolerService.isStopped())
{
spoolerService.start();
}
}
catch (...)
{
}
}
CppUnit::Test* WinServiceTest::suite() {
CppUnit::TestSuite* pSuite = new CppUnit::TestSuite("WinServiceTest");
CppUnit_addTest(pSuite, WinServiceTest, testServiceCouldCreatedWithExistingConnection);
CppUnit_addTest(pSuite, WinServiceTest, testServiceReturnsTrueIfStopped);
CppUnit_addTest(pSuite, WinServiceTest, testServiceReturnsFailureActionConfigured);
return pSuite;
}
|
{
"pile_set_name": "Github"
}
|
<template>
<c-scroller></c-scroller>
</template>
<script>
class Toast implements ToastInterface {
props = {
}
data = {
}
beforeCreate() {
}
methods = {
}
}
export default new Toast()
</script>
<style scoped>
</style>
<script cml-type="json">
{
"base": {
"usingComponents": {
"c-scroller": "../../components/scroller/scroller"
}
},
"wx": {
"window": {
"backgroundTextStyle": "dark",
"navigationBarBackgroundColor": "#343434",
"navigationBarTitleText": "CNODE",
"navigationBarTextStyle": "#fff"
},
"component": true
}
}
</script>
|
{
"pile_set_name": "Github"
}
|
align_assign_span=0
align_assign_thresh=20
align_enum_equ_span=2
align_enum_equ_thresh=30
align_func_params=false
align_func_proto_gap=1
align_func_proto_span=2
align_keep_extra_space=false
align_keep_tabs=false
align_left_shift=true
align_mix_var_proto=false
align_nl_cont=true
align_on_operator=true
align_on_tabstop=false
align_pp_define_gap=1
align_pp_define_span=2
align_right_cmt_gap=1
align_right_cmt_mix=true
align_right_cmt_span=2
align_same_func_call_params=false
align_single_line_brace=true
align_single_line_brace_gap=1
align_single_line_func=true
align_struct_init_span=2
align_typedef_amp_style=0
align_typedef_func=2
align_typedef_gap=1
align_typedef_span=2
align_typedef_star_style=0
align_var_def_amp_style=0
align_var_def_attribute=true
align_var_def_colon=true
align_var_def_gap=1
align_var_def_inline=true
align_var_def_span=0
align_var_def_star_style=0
align_var_def_thresh=20
align_var_struct_gap=1
align_var_struct_span=2
align_var_struct_thresh=30
align_var_class_gap=1
align_var_class_span=2
align_var_class_thresh=30
align_with_tabs=false
cmt_c_group=false
cmt_c_nl_end=false
cmt_c_nl_start=false
cmt_cpp_group=false
cmt_cpp_nl_end=false
cmt_cpp_nl_start=false
cmt_cpp_to_c=false
cmt_indent_multi=true
cmt_insert_before_preproc=false
cmt_multi_check_last=true
cmt_reflow_mode=1
cmt_star_cont=false
eat_blanks_after_open_brace=false
eat_blanks_before_close_brace=false
indent_access_spec=-2
indent_access_spec_body=false
indent_align_assign=true
indent_align_string=true
indent_bool_paren=false
indent_brace_parent=false
indent_braces=false
indent_braces_no_class=false
indent_braces_no_func=false
indent_braces_no_struct=false
indent_case_brace=2
indent_class=true
indent_class_colon=true
indent_cmt_with_tabs=false
indent_col1_comment=true
indent_columns=2
indent_comma_paren=false
indent_continue=0
indent_else_if=false
indent_extern=true
indent_first_bool_expr=false
indent_func_call_param=false
indent_func_class_param=false
indent_func_ctor_var_param=false
indent_func_def_param=false
indent_func_param_double=false
indent_func_proto_param=false
indent_namespace=false
indent_paren_nl=false
indent_preserve_sql=false
indent_relative_single_line_comments=false
indent_square_nl=false
indent_template_param=false
indent_var_def_cont=false
indent_with_tabs=1
input_tab_size=2
ls_for_split_full=false
ls_func_split_full=false
mod_full_brace_if_chain=false
mod_full_paren_if_bool=false
mod_move_case_break=false
mod_pawn_semicolon=false
mod_remove_empty_return=false
mod_remove_extra_semicolon=false
mod_sort_import=false
mod_sort_include=false
mod_sort_using=false
newlines=crlf
nl_after_brace_close=false
nl_after_brace_open=true
nl_after_brace_open_cmt=true
nl_after_case=true
nl_after_multiline_comment=false
nl_after_return=false
nl_after_semicolon=true
nl_after_vbrace_close=false
nl_after_vbrace_open=true
nl_after_vbrace_open_empty=true
nl_assign_leave_one_liners=true
nl_before_case=false
nl_brace_brace=force
nl_brace_catch=force
nl_brace_else=force
nl_brace_finally=force
nl_brace_while=force
nl_case_colon_brace=force
nl_catch_brace=force
nl_class_brace=force
nl_class_leave_one_liners=true
nl_collapse_empty_body=false
nl_cpp_lambda_leave_one_liners=true
nl_cpp_ldef_brace=force
nl_create_for_one_liner=false
nl_create_if_one_liner=false
nl_create_while_one_liner=false
nl_define_macro=false
nl_do_brace=force
nl_ds_struct_enum_close_brace=false
nl_ds_struct_enum_cmt=false
nl_else_brace=force
nl_else_if=remove
nl_elseif_brace=force
nl_end_of_file=ignore
nl_end_of_file_min=1
nl_enum_brace=force
nl_enum_leave_one_liners=true
nl_fcall_brace=force
nl_fdef_brace=force
nl_finally_brace=force
nl_for_brace=force
nl_func_leave_one_liners=true
nl_getset_leave_one_liners=true
nl_if_brace=force
nl_if_leave_one_liners=true
nl_max=2
nl_multi_line_cond=false
nl_multi_line_define=false
nl_squeeze_ifdef=false
nl_start_of_file=remove
nl_type_brace_init_lst_close=remove
nl_struct_brace=force
nl_switch_brace=force
nl_try_brace=force
nl_union_brace=force
nl_while_brace=force
output_tab_size=2
pp_define_at_level=false
pp_if_indent_code=false
pp_indent=force
pp_indent_at_level=false
pp_indent_count=2
pp_region_indent_code=false
pp_space=remove
sp_addr=remove
sp_after_angle=force
sp_after_assign=force
sp_after_byref=force
sp_after_byref_func=force
sp_after_cast=ignore
sp_after_class_colon=force
sp_after_comma=force
sp_after_constr_colon=force
sp_after_dc=remove
sp_after_for_colon=force
sp_after_mdatype_commas=ignore
sp_after_new=ignore
sp_after_operator=remove
sp_after_operator_sym=remove
sp_after_ptr_star=force
sp_after_ptr_star_func=force
sp_after_ptr_star_qualifier=force
sp_after_semi=add
sp_after_semi_for=force
sp_after_semi_for_empty=ignore
sp_after_sparen=add
sp_after_tag=ignore
sp_after_throw=ignore
sp_after_tparen_close=ignore
sp_after_type=force
sp_angle_paren=remove
sp_angle_shift=ignore
sp_angle_word=force
sp_arith=force
sp_assign=force
sp_assign_default=force
sp_attribute_paren=ignore
sp_balance_nested_parens=false
sp_before_angle=remove
sp_before_assign=force
sp_before_byref=remove
sp_before_byref_func=remove
sp_before_case_colon=remove
sp_before_class_colon=force
sp_before_comma=remove
sp_before_constr_colon=force
sp_before_dc=remove
sp_before_ellipsis=ignore
sp_before_for_colon=force
sp_before_mdatype_commas=remove
sp_before_nl_cont=add
sp_before_pp_stringify=add
sp_before_ptr_star=remove
sp_before_ptr_star_func=ignore
sp_before_ptr_star_func=remove
sp_before_semi=remove
sp_before_semi_for=ignore
sp_before_semi_for_empty=ignore
sp_before_sparen=force
sp_before_square=remove
sp_before_squares=remove
sp_before_template_paren=remove
sp_before_tr_emb_cmt=ignore
sp_before_unnamed_byref=remove
sp_before_unnamed_ptr_star=remove
sp_between_mdatype_commas=ignore
sp_between_new_paren=remove
sp_between_ptr_star=remove
sp_bool=force
sp_brace_catch=ignore
sp_brace_else=force
sp_brace_finally=ignore
sp_brace_typedef=ignore
sp_case_label=force
sp_catch_brace=ignore
sp_catch_paren=ignore
sp_cmt_cpp_doxygen=true
sp_cmt_cpp_start=ignore
sp_compare=force
sp_cond_colon=force
sp_cond_question=force
sp_cond_ternary_short=add
sp_cparen_oparen=ignore
sp_cpp_cast_paren=ignore
sp_cpp_lambda_assign=remove
sp_cpp_lambda_paren=remove
sp_defined_paren=ignore
sp_deref=remove
sp_else_brace=force
sp_endif_cmt=ignore
sp_enum_after_assign=force
sp_enum_assign=force
sp_enum_before_assign=force
sp_enum_paren=remove
sp_finally_brace=ignore
sp_fparen_brace=ignore
sp_fparen_dbrace=ignore
sp_func_call_paren=remove
sp_func_call_paren_empty=remove
sp_func_call_user_paren=ignore
sp_func_class_paren=remove
sp_func_def_paren=remove
sp_func_proto_paren=remove
sp_getset_brace=ignore
sp_incdec=remove
sp_inside_angle=remove
sp_inside_braces=force
sp_inside_braces_empty=remove
sp_inside_braces_enum=ignore
sp_inside_braces_struct=ignore
sp_inside_fparen=remove
sp_inside_fparens=remove
sp_inside_paren=remove
sp_inside_paren_cast=remove
sp_inside_sparen=remove
sp_inside_sparen_close=ignore
sp_inside_square=remove
sp_inside_tparen=remove
sp_inv=remove
sp_invariant_paren=ignore
sp_macro=ignore
sp_macro_func=ignore
sp_member=remove
sp_not=remove
sp_num_before_tr_emb_cmt=1
sp_paren_brace=add
sp_paren_comma=remove
sp_paren_paren=remove
sp_permit_cpp11_shift=true
sp_pp_concat=force
sp_pp_stringify=force
sp_ptr_star_paren=ignore
sp_range=ignore
sp_return_paren=ignore
sp_scope_paren=ignore
sp_sign=remove
sp_sizeof_paren=remove
sp_sparen_brace=add
sp_special_semi=ignore
sp_square_fparen=ignore
sp_template_angle=remove
sp_throw_paren=remove
sp_try_brace=ignore
sp_type_func=force
sp_version_paren=ignore
sp_word_brace=force
sp_word_brace_ns=ignore
tok_split_gte=false
utf8_byte=false
utf8_force=false
# CRY_ALIGN used like: struct CRY_ALIGN(42) SFoo, by default becomes struct CRY_ALIGN (42)SFoo
set FUNC_CALL CRY_ALIGN
# IF (cond, 1): macro IF treated as function call otherwise (and won't indent next line which looks weird)
set IF IF
set IF IF_LIKELY
set IF IF_UNLIKELY
|
{
"pile_set_name": "Github"
}
|
{
"version":"2.0",
"metadata":{
"apiVersion":"2017-04-28",
"endpointPrefix":"cloudhsmv2",
"jsonVersion":"1.1",
"protocol":"json",
"serviceAbbreviation":"CloudHSM V2",
"serviceFullName":"AWS CloudHSM V2",
"serviceId":"CloudHSM V2",
"signatureVersion":"v4",
"signingName":"cloudhsm",
"targetPrefix":"BaldrApiService",
"uid":"cloudhsmv2-2017-04-28"
},
"operations":{
"CopyBackupToRegion":{
"name":"CopyBackupToRegion",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"CopyBackupToRegionRequest"},
"output":{"shape":"CopyBackupToRegionResponse"},
"errors":[
{"shape":"CloudHsmInternalFailureException"},
{"shape":"CloudHsmServiceException"},
{"shape":"CloudHsmResourceNotFoundException"},
{"shape":"CloudHsmInvalidRequestException"},
{"shape":"CloudHsmAccessDeniedException"}
]
},
"CreateCluster":{
"name":"CreateCluster",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"CreateClusterRequest"},
"output":{"shape":"CreateClusterResponse"},
"errors":[
{"shape":"CloudHsmInternalFailureException"},
{"shape":"CloudHsmServiceException"},
{"shape":"CloudHsmResourceNotFoundException"},
{"shape":"CloudHsmInvalidRequestException"},
{"shape":"CloudHsmAccessDeniedException"}
]
},
"CreateHsm":{
"name":"CreateHsm",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"CreateHsmRequest"},
"output":{"shape":"CreateHsmResponse"},
"errors":[
{"shape":"CloudHsmInternalFailureException"},
{"shape":"CloudHsmServiceException"},
{"shape":"CloudHsmInvalidRequestException"},
{"shape":"CloudHsmResourceNotFoundException"},
{"shape":"CloudHsmAccessDeniedException"}
]
},
"DeleteBackup":{
"name":"DeleteBackup",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"DeleteBackupRequest"},
"output":{"shape":"DeleteBackupResponse"},
"errors":[
{"shape":"CloudHsmInternalFailureException"},
{"shape":"CloudHsmServiceException"},
{"shape":"CloudHsmResourceNotFoundException"},
{"shape":"CloudHsmInvalidRequestException"},
{"shape":"CloudHsmAccessDeniedException"}
]
},
"DeleteCluster":{
"name":"DeleteCluster",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"DeleteClusterRequest"},
"output":{"shape":"DeleteClusterResponse"},
"errors":[
{"shape":"CloudHsmInternalFailureException"},
{"shape":"CloudHsmServiceException"},
{"shape":"CloudHsmResourceNotFoundException"},
{"shape":"CloudHsmInvalidRequestException"},
{"shape":"CloudHsmAccessDeniedException"}
]
},
"DeleteHsm":{
"name":"DeleteHsm",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"DeleteHsmRequest"},
"output":{"shape":"DeleteHsmResponse"},
"errors":[
{"shape":"CloudHsmInternalFailureException"},
{"shape":"CloudHsmServiceException"},
{"shape":"CloudHsmResourceNotFoundException"},
{"shape":"CloudHsmInvalidRequestException"},
{"shape":"CloudHsmAccessDeniedException"}
]
},
"DescribeBackups":{
"name":"DescribeBackups",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"DescribeBackupsRequest"},
"output":{"shape":"DescribeBackupsResponse"},
"errors":[
{"shape":"CloudHsmInternalFailureException"},
{"shape":"CloudHsmServiceException"},
{"shape":"CloudHsmResourceNotFoundException"},
{"shape":"CloudHsmInvalidRequestException"},
{"shape":"CloudHsmAccessDeniedException"}
]
},
"DescribeClusters":{
"name":"DescribeClusters",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"DescribeClustersRequest"},
"output":{"shape":"DescribeClustersResponse"},
"errors":[
{"shape":"CloudHsmInternalFailureException"},
{"shape":"CloudHsmServiceException"},
{"shape":"CloudHsmInvalidRequestException"},
{"shape":"CloudHsmAccessDeniedException"}
]
},
"InitializeCluster":{
"name":"InitializeCluster",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"InitializeClusterRequest"},
"output":{"shape":"InitializeClusterResponse"},
"errors":[
{"shape":"CloudHsmInternalFailureException"},
{"shape":"CloudHsmServiceException"},
{"shape":"CloudHsmResourceNotFoundException"},
{"shape":"CloudHsmInvalidRequestException"},
{"shape":"CloudHsmAccessDeniedException"}
]
},
"ListTags":{
"name":"ListTags",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"ListTagsRequest"},
"output":{"shape":"ListTagsResponse"},
"errors":[
{"shape":"CloudHsmInternalFailureException"},
{"shape":"CloudHsmServiceException"},
{"shape":"CloudHsmResourceNotFoundException"},
{"shape":"CloudHsmInvalidRequestException"},
{"shape":"CloudHsmAccessDeniedException"}
]
},
"RestoreBackup":{
"name":"RestoreBackup",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"RestoreBackupRequest"},
"output":{"shape":"RestoreBackupResponse"},
"errors":[
{"shape":"CloudHsmInternalFailureException"},
{"shape":"CloudHsmServiceException"},
{"shape":"CloudHsmResourceNotFoundException"},
{"shape":"CloudHsmInvalidRequestException"},
{"shape":"CloudHsmAccessDeniedException"}
]
},
"TagResource":{
"name":"TagResource",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"TagResourceRequest"},
"output":{"shape":"TagResourceResponse"},
"errors":[
{"shape":"CloudHsmInternalFailureException"},
{"shape":"CloudHsmServiceException"},
{"shape":"CloudHsmResourceNotFoundException"},
{"shape":"CloudHsmInvalidRequestException"},
{"shape":"CloudHsmAccessDeniedException"}
]
},
"UntagResource":{
"name":"UntagResource",
"http":{
"method":"POST",
"requestUri":"/"
},
"input":{"shape":"UntagResourceRequest"},
"output":{"shape":"UntagResourceResponse"},
"errors":[
{"shape":"CloudHsmInternalFailureException"},
{"shape":"CloudHsmServiceException"},
{"shape":"CloudHsmResourceNotFoundException"},
{"shape":"CloudHsmInvalidRequestException"},
{"shape":"CloudHsmAccessDeniedException"}
]
}
},
"shapes":{
"Backup":{
"type":"structure",
"required":["BackupId"],
"members":{
"BackupId":{"shape":"BackupId"},
"BackupState":{"shape":"BackupState"},
"ClusterId":{"shape":"ClusterId"},
"CreateTimestamp":{"shape":"Timestamp"},
"CopyTimestamp":{"shape":"Timestamp"},
"SourceRegion":{"shape":"Region"},
"SourceBackup":{"shape":"BackupId"},
"SourceCluster":{"shape":"ClusterId"},
"DeleteTimestamp":{"shape":"Timestamp"}
}
},
"BackupId":{
"type":"string",
"pattern":"backup-[2-7a-zA-Z]{11,16}"
},
"BackupPolicy":{
"type":"string",
"enum":["DEFAULT"]
},
"BackupState":{
"type":"string",
"enum":[
"CREATE_IN_PROGRESS",
"READY",
"DELETED",
"PENDING_DELETION"
]
},
"Backups":{
"type":"list",
"member":{"shape":"Backup"}
},
"Boolean":{"type":"boolean"},
"Cert":{
"type":"string",
"max":5000,
"pattern":"[a-zA-Z0-9+-/=\\s]*"
},
"Certificates":{
"type":"structure",
"members":{
"ClusterCsr":{"shape":"Cert"},
"HsmCertificate":{"shape":"Cert"},
"AwsHardwareCertificate":{"shape":"Cert"},
"ManufacturerHardwareCertificate":{"shape":"Cert"},
"ClusterCertificate":{"shape":"Cert"}
}
},
"CloudHsmAccessDeniedException":{
"type":"structure",
"members":{
"Message":{"shape":"errorMessage"}
},
"exception":true
},
"CloudHsmInternalFailureException":{
"type":"structure",
"members":{
"Message":{"shape":"errorMessage"}
},
"exception":true,
"fault":true
},
"CloudHsmInvalidRequestException":{
"type":"structure",
"members":{
"Message":{"shape":"errorMessage"}
},
"exception":true
},
"CloudHsmResourceNotFoundException":{
"type":"structure",
"members":{
"Message":{"shape":"errorMessage"}
},
"exception":true
},
"CloudHsmServiceException":{
"type":"structure",
"members":{
"Message":{"shape":"errorMessage"}
},
"exception":true
},
"Cluster":{
"type":"structure",
"members":{
"BackupPolicy":{"shape":"BackupPolicy"},
"ClusterId":{"shape":"ClusterId"},
"CreateTimestamp":{"shape":"Timestamp"},
"Hsms":{"shape":"Hsms"},
"HsmType":{"shape":"HsmType"},
"PreCoPassword":{"shape":"PreCoPassword"},
"SecurityGroup":{"shape":"SecurityGroup"},
"SourceBackupId":{"shape":"BackupId"},
"State":{"shape":"ClusterState"},
"StateMessage":{"shape":"StateMessage"},
"SubnetMapping":{"shape":"ExternalSubnetMapping"},
"VpcId":{"shape":"VpcId"},
"Certificates":{"shape":"Certificates"}
}
},
"ClusterId":{
"type":"string",
"pattern":"cluster-[2-7a-zA-Z]{11,16}"
},
"ClusterState":{
"type":"string",
"enum":[
"CREATE_IN_PROGRESS",
"UNINITIALIZED",
"INITIALIZE_IN_PROGRESS",
"INITIALIZED",
"ACTIVE",
"UPDATE_IN_PROGRESS",
"DELETE_IN_PROGRESS",
"DELETED",
"DEGRADED"
]
},
"Clusters":{
"type":"list",
"member":{"shape":"Cluster"}
},
"CopyBackupToRegionRequest":{
"type":"structure",
"required":[
"DestinationRegion",
"BackupId"
],
"members":{
"DestinationRegion":{"shape":"Region"},
"BackupId":{"shape":"BackupId"}
}
},
"CopyBackupToRegionResponse":{
"type":"structure",
"members":{
"DestinationBackup":{"shape":"DestinationBackup"}
}
},
"CreateClusterRequest":{
"type":"structure",
"required":[
"SubnetIds",
"HsmType"
],
"members":{
"SubnetIds":{"shape":"SubnetIds"},
"HsmType":{"shape":"HsmType"},
"SourceBackupId":{"shape":"BackupId"}
}
},
"CreateClusterResponse":{
"type":"structure",
"members":{
"Cluster":{"shape":"Cluster"}
}
},
"CreateHsmRequest":{
"type":"structure",
"required":[
"ClusterId",
"AvailabilityZone"
],
"members":{
"ClusterId":{"shape":"ClusterId"},
"AvailabilityZone":{"shape":"ExternalAz"},
"IpAddress":{"shape":"IpAddress"}
}
},
"CreateHsmResponse":{
"type":"structure",
"members":{
"Hsm":{"shape":"Hsm"}
}
},
"DeleteBackupRequest":{
"type":"structure",
"required":["BackupId"],
"members":{
"BackupId":{"shape":"BackupId"}
}
},
"DeleteBackupResponse":{
"type":"structure",
"members":{
"Backup":{"shape":"Backup"}
}
},
"DeleteClusterRequest":{
"type":"structure",
"required":["ClusterId"],
"members":{
"ClusterId":{"shape":"ClusterId"}
}
},
"DeleteClusterResponse":{
"type":"structure",
"members":{
"Cluster":{"shape":"Cluster"}
}
},
"DeleteHsmRequest":{
"type":"structure",
"required":["ClusterId"],
"members":{
"ClusterId":{"shape":"ClusterId"},
"HsmId":{"shape":"HsmId"},
"EniId":{"shape":"EniId"},
"EniIp":{"shape":"IpAddress"}
}
},
"DeleteHsmResponse":{
"type":"structure",
"members":{
"HsmId":{"shape":"HsmId"}
}
},
"DescribeBackupsRequest":{
"type":"structure",
"members":{
"NextToken":{"shape":"NextToken"},
"MaxResults":{"shape":"MaxSize"},
"Filters":{"shape":"Filters"},
"SortAscending":{"shape":"Boolean"}
}
},
"DescribeBackupsResponse":{
"type":"structure",
"members":{
"Backups":{"shape":"Backups"},
"NextToken":{"shape":"NextToken"}
}
},
"DescribeClustersRequest":{
"type":"structure",
"members":{
"Filters":{"shape":"Filters"},
"NextToken":{"shape":"NextToken"},
"MaxResults":{"shape":"MaxSize"}
}
},
"DescribeClustersResponse":{
"type":"structure",
"members":{
"Clusters":{"shape":"Clusters"},
"NextToken":{"shape":"NextToken"}
}
},
"DestinationBackup":{
"type":"structure",
"members":{
"CreateTimestamp":{"shape":"Timestamp"},
"SourceRegion":{"shape":"Region"},
"SourceBackup":{"shape":"BackupId"},
"SourceCluster":{"shape":"ClusterId"}
}
},
"EniId":{
"type":"string",
"pattern":"eni-[0-9a-fA-F]{8,17}"
},
"ExternalAz":{
"type":"string",
"pattern":"[a-z]{2}(-(gov))?-(east|west|north|south|central){1,2}-\\d[a-z]"
},
"ExternalSubnetMapping":{
"type":"map",
"key":{"shape":"ExternalAz"},
"value":{"shape":"SubnetId"}
},
"Field":{
"type":"string",
"pattern":"[a-zA-Z0-9_-]+"
},
"Filters":{
"type":"map",
"key":{"shape":"Field"},
"value":{"shape":"Strings"}
},
"Hsm":{
"type":"structure",
"required":["HsmId"],
"members":{
"AvailabilityZone":{"shape":"ExternalAz"},
"ClusterId":{"shape":"ClusterId"},
"SubnetId":{"shape":"SubnetId"},
"EniId":{"shape":"EniId"},
"EniIp":{"shape":"IpAddress"},
"HsmId":{"shape":"HsmId"},
"State":{"shape":"HsmState"},
"StateMessage":{"shape":"String"}
}
},
"HsmId":{
"type":"string",
"pattern":"hsm-[2-7a-zA-Z]{11,16}"
},
"HsmState":{
"type":"string",
"enum":[
"CREATE_IN_PROGRESS",
"ACTIVE",
"DEGRADED",
"DELETE_IN_PROGRESS",
"DELETED"
]
},
"HsmType":{
"type":"string",
"pattern":"(hsm1\\.medium)"
},
"Hsms":{
"type":"list",
"member":{"shape":"Hsm"}
},
"InitializeClusterRequest":{
"type":"structure",
"required":[
"ClusterId",
"SignedCert",
"TrustAnchor"
],
"members":{
"ClusterId":{"shape":"ClusterId"},
"SignedCert":{"shape":"Cert"},
"TrustAnchor":{"shape":"Cert"}
}
},
"InitializeClusterResponse":{
"type":"structure",
"members":{
"State":{"shape":"ClusterState"},
"StateMessage":{"shape":"StateMessage"}
}
},
"IpAddress":{
"type":"string",
"pattern":"\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"
},
"ListTagsRequest":{
"type":"structure",
"required":["ResourceId"],
"members":{
"ResourceId":{"shape":"ClusterId"},
"NextToken":{"shape":"NextToken"},
"MaxResults":{"shape":"MaxSize"}
}
},
"ListTagsResponse":{
"type":"structure",
"required":["TagList"],
"members":{
"TagList":{"shape":"TagList"},
"NextToken":{"shape":"NextToken"}
}
},
"MaxSize":{
"type":"integer",
"max":100,
"min":1
},
"NextToken":{
"type":"string",
"max":256,
"pattern":".*"
},
"PreCoPassword":{
"type":"string",
"max":32,
"min":7
},
"Region":{
"type":"string",
"pattern":"[a-z]{2}(-(gov))?-(east|west|north|south|central){1,2}-\\d"
},
"RestoreBackupRequest":{
"type":"structure",
"required":["BackupId"],
"members":{
"BackupId":{"shape":"BackupId"}
}
},
"RestoreBackupResponse":{
"type":"structure",
"members":{
"Backup":{"shape":"Backup"}
}
},
"SecurityGroup":{
"type":"string",
"pattern":"sg-[0-9a-fA-F]"
},
"StateMessage":{
"type":"string",
"max":300,
"pattern":".*"
},
"String":{"type":"string"},
"Strings":{
"type":"list",
"member":{"shape":"String"}
},
"SubnetId":{
"type":"string",
"pattern":"subnet-[0-9a-fA-F]{8,17}"
},
"SubnetIds":{
"type":"list",
"member":{"shape":"SubnetId"},
"max":10,
"min":1
},
"Tag":{
"type":"structure",
"required":[
"Key",
"Value"
],
"members":{
"Key":{"shape":"TagKey"},
"Value":{"shape":"TagValue"}
}
},
"TagKey":{
"type":"string",
"max":128,
"min":1,
"pattern":"^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"
},
"TagKeyList":{
"type":"list",
"member":{"shape":"TagKey"},
"max":50,
"min":1
},
"TagList":{
"type":"list",
"member":{"shape":"Tag"},
"max":50,
"min":1
},
"TagResourceRequest":{
"type":"structure",
"required":[
"ResourceId",
"TagList"
],
"members":{
"ResourceId":{"shape":"ClusterId"},
"TagList":{"shape":"TagList"}
}
},
"TagResourceResponse":{
"type":"structure",
"members":{
}
},
"TagValue":{
"type":"string",
"max":256,
"min":0,
"pattern":"^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"
},
"Timestamp":{"type":"timestamp"},
"UntagResourceRequest":{
"type":"structure",
"required":[
"ResourceId",
"TagKeyList"
],
"members":{
"ResourceId":{"shape":"ClusterId"},
"TagKeyList":{"shape":"TagKeyList"}
}
},
"UntagResourceResponse":{
"type":"structure",
"members":{
}
},
"VpcId":{
"type":"string",
"pattern":"vpc-[0-9a-fA-F]"
},
"errorMessage":{"type":"string"}
}
}
|
{
"pile_set_name": "Github"
}
|
function [TmodelC, Cmodel] = addToTmodel(Cmodel, Tmodel, rxnList, metList, varargin)
% Adds reactions and info from a comparison model into the
% master template database, `Tmodel`. Called by `mergeModelsBorg`, calls `cleanTmodel`
%
% USAGE:
%
% [TmodelC, Cmodel] = addToTModel(Cmodel, Tmodel, rxnList, metList)
%
% INPUTS:
% Cmodel: Reaction model to draw new reactions from. Must be in the
% extended COBRA format.
% Tmodel: Template database in which to add information
% and new reactions.
% rxnList: Array the length of `Cmodel.rxns` with corresponding
% matching reaction numbers from `Tmodel`. If a rxn is unique
% in `Cmodel`, it has 0. `rxnList` is the output of
% `reactionCompare` GUI.
% metList: Array the length of `Cmodel.mets` with corresponding
% matching met indexes from `Tmodel`. New mets should already
% have their correct index in `Tmodel`.
%
% OPTIONAL INPUTS:
% 'NoClean': Don't call `cleanTmodel` at the end of this function
% 'Verbose': Ask when performing certain operations. Carries into
% `cleanTmodel`.
%
% OUTPUTS:
% Tmodel: The addended master reaction database.
%
% Please cite:
% `Sauls, J. T., & Buescher, J. M. (2014). Assimilating genome-scale
% metabolic reconstructions with modelBorgifier. Bioinformatics
% (Oxford, England), 30(7), 1036?8`. http://doi.org/10.1093/bioinformatics/btt747
%
% ..
% Edit the above text to modify the response to help addMetInfo
% Last Modified by GUIDE v2.5 06-Dec-2013 14:19:28
% This file is published under Creative Commons BY-NC-SA.
%
% Correspondance:
% johntsauls@gmail.com
%
% Developed at:
% BRAIN Aktiengesellschaft
% Microbial Production Technologies Unit
% Quantitative Biology and Sequencing Platform
% Darmstaeter Str. 34-36
% 64673 Zwingenberg, Germany
% www.brain-biotech.de
verbose = false ; % Declare variables.
if ~isempty(varargin)
if sum(strcmp('Verbose', varargin))
verbose = true ;
end
end
% Number of reactions and metabolites being added.
cRxns = length(rxnList) ;
cMets = length(metList) ;
% Cmodel name.
cName = Cmodel.description ;
% Current model names
TmodelNames = fieldnames(Tmodel.Models) ;
% Check if model name already exists in Tmodel.
modelCheck = sum(strcmp(cName,TmodelNames)) ;
while modelCheck > 1
fprintf(['Cmodel name, ' cName ', already exists in Tmodel.\n'])
prompt = 'Input new model name for Cmodel: ' ;
cName = input(prompt, 's') ;
modelCheck = sum(strcmp(cName, TmodelNames)) ;
end
% Convenient versions for adding information.
cNameNew = strcat(cName, ':') ;
cNameAdd = strcat('|', cName,':') ;
% Fields which are kept model specific.
sepFieldNames = ({'lb' 'ub' 'c'}) ;
% Reaction related field names, excluding .rxns, .rxnID and .rxnEquation.
% anything where getMoDesig = 1 gets model designation.
Tfields = fieldnames(Tmodel) ;
rxnFields = false(size(Tfields)) ;
for itf = 1:length(rxnFields)
if size(Tmodel.(Tfields{itf}),1) == size(Tmodel.rxns, 1) % if size is that of rxns
if ~ismember(Tfields{itf}, [sepFieldNames, 'rxns', 'rxnID', 'rxnEquation' 'metNums' 'rxnMetNames']) % exclude some fields
rxnFields(itf) = true ;
end
end
end
rxnFieldNames = Tfields(rxnFields) ;
% Ensure all rxnFieldNames are also in Cmodel, if not ignore them
% This should not be neccesary and is thus commented out.
% Cfields = fieldnames(Cmodel) ;
% keepRxnFieldNames = true(size(rxnFieldNames)) ;
% for iField = 1:length(rxnFieldNames)
% if strmatch(rxnFieldNames{iField}, Cfields)
% continue
% else
% keepRxnFieldNames(iField) = 0 ;
% end
% end
% rxnFieldNames = rxnFieldNames(keepRxnFieldNames) ;
getMoDesig = false(size(rxnFieldNames)) ;
getMoDegigFields = {'rxnNames', 'subSystems', 'rxnEquations', 'rxnECNumbers', ...
'grRules'} ;
for iField = 1:length(rxnFieldNames)
if strmatch(rxnFieldNames{iField}, getMoDegigFields)
getMoDesig(iField) = 1 ;
end
end
% Metabolite related field names, excluding .mets and metID. None get a
% model designatinon.
metFieldNames = ({'metNames' 'metFormulas' 'metKEGGID' 'metSEEDID' ...
'metChEBIID' 'metPubChemID' 'metInChIString'}) ;
% Add indentity and number arrays for model being added.
Tmodel.Models.(cName).rxns = false(length(Tmodel.rxns), 1) ;
Tmodel.Models.(cName).mets = false(length(Tmodel.mets), 1) ;
for iField = 1:length(sepFieldNames)
Tmodel.(sepFieldNames{iField}).(cName) = 0 ;
end
%% Add genes.
if isfield(Cmodel, 'genes')
Tmodel.Models.(cName).genes = Cmodel.genes ;
end
%% Deal with new reactions (0 in rxnList).
% Number of reactions currently in Tmodel and in the Tmodel to be.
tRxns = length(Tmodel.rxns) ;
tRxnsNow = tRxns ;
% Change 0's (new reactions) in rxnList to their new index in Tmodel.
for cRxn = 1:length(rxnList)
if rxnList(cRxn) == 0
tRxnsNow = tRxnsNow + 1 ;
rxnList(cRxn) = tRxnsNow ;
end
end
if tRxnsNow > tRxns
% Increase size to Tmodel to accomidate new reactions.
Tmodel.rxns(end+1:tRxnsNow) = {''} ;
Tmodel.rxnID(end+1:tRxnsNow) = {''} ;
Tmodel.rxnEquations(end+1:tRxnsNow) = {''} ;
for iField = 1:length(rxnFieldNames)
if iscell(Tmodel.(rxnFieldNames{iField}))
Tmodel.(rxnFieldNames{iField})(end+1:tRxnsNow) = {''} ;
end
end
% Increase length of identity arrays.
% Current models.
for iMo = 1:length(TmodelNames)
Tmodel.Models.(TmodelNames{iMo}).rxns(end+1:tRxnsNow) = false ;
end
% New model.
Tmodel.Models.(cName).rxns(end+1:tRxnsNow, 1) = true ;
% Increase size of number array for new
for iField = 1:length(sepFieldNames)
Tmodel.(sepFieldNames{iField}).(cName)(end+1:tRxnsNow, 1) = 0 ;
for iMo = 1:length(TmodelNames)
Tmodel.(sepFieldNames{iField}). ...
(TmodelNames{iMo})(end+1:tRxnsNow, 1) = 0 ;
end
end
% Increase size of comments array.
Tmodel.rxnNotes(end+1:tRxnsNow, 1) = {''} ;
% Increase size of S matrix
Tmodel.S(:, end+1:tRxnsNow) = 0 ;
end
%% Deal with new metabolites (already have index for Tmodel).
% Number of current metabolites in Tmodel.
tMets = length(Tmodel.mets) ;
% ensure that there are no gaps in the numbering of new mets
numNewMets = sum(metList > tMets) ;
metList(metList > tMets) = tMets + (1:numNewMets) ;
% Number of new metabolites.
tMetsNow = max(metList);
if tMetsNow > tMets
% Increase size to Tmodel to accomidate new metabolites.
Tmodel.mets(end+1:max(metList)) = {''} ;
Tmodel.metID(end+1:max(metList)) = {''} ;
Tmodel.metCharge(end+1:max(metList)) = 0 ;
for iField = 1:length(metFieldNames)
Tmodel.(metFieldNames{iField})(end+1:max(metList)) = {''} ;
end
% Increase size of identity array are by defnition not in old models.
% Current models.
for iMo = 1:length(TmodelNames)
Tmodel.Models.(TmodelNames{iMo}).mets(end+1:tMetsNow) = false ;
end
Tmodel.Models.(cName).mets(end+1:max(metList), 1) = true ;
% Increase size of S matrix.
Tmodel.S(end+1:max(metList), :) = 0 ;
end
% Look to see if new metabolites have names that aleady exist in
% Tmodel.mets. Prompt the user to change the name, and also change the name
% for all sister metabolites (the ones that are in other compartments).
% Change the IDs too.
newMets = find(metList > tMets) ;
% mets from C without comp.
nCmets = length(Cmodel.mets) ;
metsNoComp = cell(nCmets, 1) ;
for iMet = 1:nCmets
metsNoComp{iMet} = Cmodel.mets{iMet}(1:end-3) ;
end
for iMet = 1:length(newMets)
% Is there a duplicate?
if ~isempty(find(strcmp(Cmodel.mets{newMets(iMet)},Tmodel.mets),1))
% Flag to keep asking for a new name as long as it is not unique
notUnique = 1 ;
% Ask for user input
fprintf(['Metabolite ID %s (%s) already exists in Tmodel, ' ...
'with name\n %s.\n'], ...
Cmodel.mets{newMets(iMet)}, ...
Cmodel.metNames{newMets(iMet)}, ...
Tmodel.metNames{find(strcmp(Cmodel.mets{newMets(iMet)}, ...
Tmodel.mets),1)})
while notUnique
prompt = 'Rename (w/o compartment) as: ' ;
newName = input(prompt,'s') ;
% Check to see if name is already taken.
if isempty(find(strncmp(newName,Tmodel.mets,length(newName)),1))
notUnique = 0 ;
else
fprintf('Name already taken./n')
end
end
% Change the name of mets.
% Find sister mets.
sisMetPos = find(strcmp(Cmodel.mets{newMets(iMet)}(1:end-3), ...
metsNoComp)) ;
% Change the name of the metabolites
for iSis = 1:length(sisMetPos)
compartment = Cmodel.mets{sisMetPos(iSis)}(end-2:end) ;
Cmodel.mets{sisMetPos(iSis)} = [newName compartment] ;
end
end
end
%% Add reactions.
% find protons and water
ignoreMets = find(strncmpi(Tmodel.mets, 'h[', 2) + ...
strncmpi(Tmodel.mets, 'h+[', 3) + ...
strncmpi(Tmodel.mets, 'proton[', 7) +...
strncmpi(Tmodel.mets, 'h2o[', 4) + ...
strncmpi(Tmodel.mets, 'water[', 6) ) ;
for cRxn = 1:cRxns
tRxn = rxnList(cRxn) ;
% Update identity array
Tmodel.Models.(cName).rxns(tRxn) = true ;
% For new reactions, add their name from Cmodel and adjust S matrix.
if isempty(Tmodel.rxns{tRxn})
Tmodel.rxns{tRxn} = Cmodel.rxns{cRxn} ;
% Add reaction ID
Tmodel.rxnID{tRxn} = strcat(Tmodel.rxnID{tRxn}, cNameNew, ...
Cmodel.rxnID{cRxn}) ;
% Adjust S matrix
metPos = find(Cmodel.S(:, cRxn)) ;
metStoics = Cmodel.S(metPos, cRxn) ;
for iMet = 1:length(metPos)
Tmodel.S(metList(metPos(iMet)), tRxn) = metStoics(iMet) ;
end
else
Tmodel.rxnID{tRxn} = strcat(Tmodel.rxnID{tRxn}, cNameAdd, ...
Cmodel.rxnID{cRxn}) ;
end
% Fill in information arrays for all reactions. This loop ensures that
% only new information is being added.
for iField = 1:length(rxnFieldNames)
% Current information from C and Tmodel. Makes code cleaner.
Cinfo = Cmodel.(rxnFieldNames{iField}){cRxn} ;
Tinfo = Tmodel.(rxnFieldNames{iField}){tRxn} ;
% If there is information in the Cmodel field, continue to fill.
if ~isempty(Cinfo)
% If there is information already in Tmodel, add to it.
if ~isempty(Tinfo)
% Some get model designations.
if getMoDesig(iField)
Tinfo = strcat(Tinfo, cNameAdd, Cinfo) ;
% And some are simply seperated by a '|'.
else
% Break information from C into parts.
pipePos = [0 strfind(Cinfo,'|') length(Cinfo) + 1] ;
for iP = 1:length(pipePos) - 1
nowInfo = Cinfo(pipePos(iP) + 1:pipePos(iP + 1) - 1) ;
% Only add new pieces of information.
if isempty(strfind(Tinfo, nowInfo))
Tinfo = strcat(Tinfo, '|', nowInfo) ;
end
end
end
% Else, create a new entry. Again note inclusion/absense of
% model designation.
else
if getMoDesig(iField)
Tinfo = strcat(cNameNew, Cinfo) ;
else
Tinfo = Cinfo ;
end
end
% Now update the information in Tmodel with whatever has been made.
Tmodel.(rxnFieldNames{iField}){tRxn} = Tinfo ;
end
end
% Add information for seperate rxn fields (rev, ub, lb, c)
for iField = 1:length(sepFieldNames)
Tmodel.(sepFieldNames{iField}).(cName)(tRxn) = ...
Cmodel.(sepFieldNames{iField})(cRxn) ;
end
% Reverse bounds when reactions have opposite reactants and products.
% Criteria: reaction has match, reaction is not reversible, and the
% products of one match matches the reactants of the other and vice versa.
if rxnList(cRxn) < tRxns
% Collect metabolite information from metList assignments.
cProd = setdiff(metList(Cmodel.S(:,cRxn) > 0) , ignoreMets) ;
tReac = setdiff(find(Tmodel.S(:,tRxn) < 0) , ignoreMets) ;
cReac = setdiff(metList(Cmodel.S(:,cRxn) < 0) , ignoreMets) ;
tProd = setdiff(find(Tmodel.S(:,tRxn) > 0) , ignoreMets);
if mean(ismember(cProd,tReac)) == 1 && mean(ismember(cReac, tProd)) == 1
% Do the deed.
[Tmodel.lb.(cName)(tRxn),Tmodel.ub.(cName)(tRxn)] = ...
deal(-Tmodel.ub.(cName)(tRxn), -Tmodel.lb.(cName)(tRxn)) ;
end
end
end
%% Add metabolites.
for cMet = 1:cMets
tMet = metList(cMet) ; % Index of met in Tmodel.
% Update identity array
Tmodel.Models.(cName).mets(tMet, 1) = true ;
% For brand new metabolites.
if isempty(Tmodel.mets{tMet})
Tmodel.mets{tMet} = Cmodel.mets{cMet} ;
Tmodel.metCharge(tMet) = Cmodel.metCharge(cMet) ;
% Add in ID info
Tmodel.metID{tMet} = strcat(Tmodel.metID{tMet}, cNameNew, ...
Cmodel.metID{cMet}) ;
else
% Add in ID info
Tmodel.metID{tMet} = strcat(Tmodel.metID{tMet}, cNameAdd, ...
Cmodel.metID{cMet}) ;
end
for iField = 1:length(metFieldNames)
% Declare the current info now, makes code cleaner.
Cinfo = Cmodel.(metFieldNames{iField}){cMet} ;
Tinfo = Tmodel.(metFieldNames{iField}){tMet} ;
% Ensure information exists and has not been added
if ~isempty(Cinfo) && isempty(strfind(Tinfo, Cinfo))
% Split information up into parts, only adding new info.
if ~isempty(Tinfo)
pipePos = [0 strfind(Cinfo, '|') length(Cinfo) + 1] ;
for iP = 1:length(pipePos) - 1
nowInfo = Cinfo(pipePos(iP) + 1:pipePos(iP+1) - 1) ;
if isempty(strfind(Tinfo, nowInfo))
Tinfo = strcat(Tinfo, '|', nowInfo) ;
end
end
else
Tinfo = Cinfo ;
end
end
% Update information, for each field.
Tmodel.(metFieldNames{iField}){tMet} = Tinfo ;
end
end
%% output Tmodel
if ~isempty(varargin)
if strcmpi(varargin{1}, 'NoClean')
TmodelC = Tmodel ;
elseif strcmpi(varargin{1}, 'Verbose')
TmodelC = cleanTmodel(Tmodel, 'Verbose') ;
else
TmodelC = cleanTmodel(Tmodel) ;
end
else
TmodelC = cleanTmodel(Tmodel) ;
end
|
{
"pile_set_name": "Github"
}
|
fileFormatVersion: 2
guid: c6cfd14a6d556d94397de381355e22df
NativeFormatImporter:
userData:
|
{
"pile_set_name": "Github"
}
|
<?php
namespace DoctrineExtensions\Tests\Query\Mysql;
class SetTest extends \DoctrineExtensions\Tests\Query\MysqlTestCase
{
public function testFindInSet()
{
$dql = "SELECT p FROM DoctrineExtensions\Tests\Entities\Set p WHERE FIND_IN_SET(p.id, p.set) != 0";
$this->assertDqlProducesSql(
$dql,
'SELECT s0_.id AS id_0, s0_.set AS set_1 FROM Set s0_ WHERE FIND_IN_SET(s0_.id, s0_.set) <> 0'
);
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Backpack - Skyscanner's Design System
*
* Copyright 2016-2020 Skyscanner 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.
*/
/* @flow strict */
import React from 'react';
import { storiesOf } from '@storybook/react';
import BpkBreadcrumb, { BpkBreadcrumbItem } from './index';
storiesOf('bpk-component-breadcrumb', module)
.add('Default', () => (
<BpkBreadcrumb label="Default breadcrumb">
<BpkBreadcrumbItem href="/">Home</BpkBreadcrumbItem>
<BpkBreadcrumbItem href="/page-1">Page 1</BpkBreadcrumbItem>
<BpkBreadcrumbItem active>Page 2</BpkBreadcrumbItem>
</BpkBreadcrumb>
))
.add('Extreme', () => (
<BpkBreadcrumb label="Extreme breadcrumb">
<BpkBreadcrumbItem href="/">Home</BpkBreadcrumbItem>
<BpkBreadcrumbItem
href="/page-1"
id="123"
linkProps={{ target: '_blank' }}
>
Page 1
</BpkBreadcrumbItem>
<BpkBreadcrumbItem href="/page-2">Page 2</BpkBreadcrumbItem>
<BpkBreadcrumbItem href="/page-3">Page 3</BpkBreadcrumbItem>
<BpkBreadcrumbItem href="/page-4">Page 4</BpkBreadcrumbItem>
<BpkBreadcrumbItem href="/page-5">Page 5</BpkBreadcrumbItem>
<BpkBreadcrumbItem href="/page-6">Page 6</BpkBreadcrumbItem>
<BpkBreadcrumbItem href="/page-7">Page 7</BpkBreadcrumbItem>
<BpkBreadcrumbItem href="/page-8">Page 8</BpkBreadcrumbItem>
<BpkBreadcrumbItem href="/page-9">Page 9</BpkBreadcrumbItem>
<BpkBreadcrumbItem href="/page-10">Page 10</BpkBreadcrumbItem>
<BpkBreadcrumbItem href="/page-11">Page 11</BpkBreadcrumbItem>
<BpkBreadcrumbItem href="/page-12">Page 12</BpkBreadcrumbItem>
<BpkBreadcrumbItem href="/page-13">Page 13</BpkBreadcrumbItem>
<BpkBreadcrumbItem href="/page-14">Page 14</BpkBreadcrumbItem>
<BpkBreadcrumbItem href="/page-15">Page 15</BpkBreadcrumbItem>
<BpkBreadcrumbItem active>Page 16</BpkBreadcrumbItem>
</BpkBreadcrumb>
));
|
{
"pile_set_name": "Github"
}
|
/*
Copyright (c) 2015 Ki
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
using System.Xml.Linq;
using dnSpy.BamlDecompiler.Baml;
using dnSpy.BamlDecompiler.Xaml;
namespace dnSpy.BamlDecompiler.Handlers {
internal class OptimizedStaticResourceHandler : IHandler, IDeferHandler {
public BamlRecordType Type => BamlRecordType.OptimizedStaticResource;
public BamlElement Translate(XamlContext ctx, BamlNode node, BamlElement parent) {
var record = (OptimizedStaticResourceRecord)((BamlRecordNode)node).Record;
var key = XamlResourceKey.FindKeyInSiblings(node);
key.StaticResources.Add(node);
return null;
}
public BamlElement TranslateDefer(XamlContext ctx, BamlNode node, BamlElement parent) {
var record = (OptimizedStaticResourceRecord)((BamlRecordNode)node).Record;
var bamlElem = new BamlElement(node);
object key;
if (record.IsType) {
var value = ctx.ResolveType(record.ValueId);
var typeElem = new XElement(ctx.GetXamlNsName("TypeExtension", parent.Xaml));
typeElem.AddAnnotation(ctx.ResolveType(0xfd4d)); // Known type - TypeExtension
typeElem.Add(new XElement(ctx.GetPseudoName("Ctor"), ctx.ToString(parent.Xaml, value)));
key = typeElem;
}
else if (record.IsStatic) {
string attrName;
if (record.ValueId > 0x7fff) {
bool isKey = true;
short bamlId = (short)-record.ValueId;
if (bamlId > 232 && bamlId < 464) {
bamlId -= 232;
isKey = false;
}
else if (bamlId > 464 && bamlId < 467) {
bamlId -= 231;
}
else if (bamlId > 467 && bamlId < 470) {
bamlId -= 234;
isKey = false;
}
var res = ctx.Baml.KnownThings.Resources(bamlId);
string name;
if (isKey)
name = res.Item1 + "." + res.Item2;
else
name = res.Item1 + "." + res.Item3;
var xmlns = ctx.GetXmlNamespace("http://schemas.microsoft.com/winfx/2006/xaml/presentation");
attrName = ctx.ToString(parent.Xaml, xmlns.GetName(name));
}
else {
var value = ctx.ResolveProperty(record.ValueId);
value.DeclaringType.ResolveNamespace(parent.Xaml, ctx);
var xName = value.ToXName(ctx, parent.Xaml);
attrName = ctx.ToString(parent.Xaml, xName);
}
var staticElem = new XElement(ctx.GetXamlNsName("StaticExtension", parent.Xaml));
staticElem.AddAnnotation(ctx.ResolveType(0xfda6)); // Known type - StaticExtension
staticElem.Add(new XElement(ctx.GetPseudoName("Ctor"), attrName));
key = staticElem;
}
else
key = ctx.ResolveString(record.ValueId);
var extType = ctx.ResolveType(0xfda5);
var resElem = new XElement(extType.ToXName(ctx));
resElem.AddAnnotation(extType); // Known type - StaticResourceExtension
bamlElem.Xaml = resElem;
parent.Xaml.Element.Add(resElem);
var attrElem = new XElement(ctx.GetPseudoName("Ctor"));
attrElem.Add(key);
resElem.Add(attrElem);
return bamlElem;
}
}
}
|
{
"pile_set_name": "Github"
}
|
// 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 types
import (
"errors"
"fmt"
"github.com/coreos/go-semver/semver"
ignTypes "github.com/coreos/ignition/config/v2_2/types"
"github.com/coreos/ignition/config/validate/astnode"
"github.com/coreos/ignition/config/validate/report"
)
var (
EtcdVersionTooOld = errors.New("Etcd version specified is not valid (too old)")
EtcdMinorVersionTooNew = errors.New("Etcd minor version specified is too new, only options available in the previous minor version will be accepted")
EtcdMajorVersionTooNew = errors.New("Etcd version is not valid (too new)")
OldestEtcd = *semver.New("2.3.0")
EtcdDefaultVersion = *semver.New("3.0.0")
)
// Options can be the options for any Etcd version
type Options interface{}
type etcdCommon Etcd
type EtcdVersion semver.Version
func (e *EtcdVersion) UnmarshalYAML(unmarshal func(interface{}) error) error {
t := semver.Version(*e)
if err := unmarshal(&t); err != nil {
return err
}
*e = EtcdVersion(t)
return nil
}
func (e EtcdVersion) Validate() report.Report {
v := semver.Version(e)
switch {
case v.LessThan(OldestEtcd):
return report.ReportFromError(EtcdVersionTooOld, report.EntryError)
case v.Major == 2 && v.Minor > 3:
fallthrough
case v.Major == 3 && v.Minor > 3:
return report.ReportFromError(EtcdMinorVersionTooNew, report.EntryWarning)
case v.Major > 3:
return report.ReportFromError(EtcdMajorVersionTooNew, report.EntryError)
}
return report.Report{}
}
func (e EtcdVersion) String() string {
return semver.Version(e).String()
}
// Etcd is a stub for yaml unmarshalling that figures out which
// of the other Etcd structs to use and unmarshals to that. Options needs
// to be an embedded type so that the structure of the yaml tree matches the
// structure of the go config tree
type Etcd struct {
Version *EtcdVersion `yaml:"version"`
Options
}
func (etcd *Etcd) UnmarshalYAML(unmarshal func(interface{}) error) error {
t := etcdCommon(*etcd)
if err := unmarshal(&t); err != nil {
return err
}
*etcd = Etcd(t)
var version semver.Version
if etcd.Version == nil {
version = EtcdDefaultVersion
} else {
version = semver.Version(*etcd.Version)
}
if version.Major == 2 && version.Minor >= 3 {
o := Etcd2{}
if err := unmarshal(&o); err != nil {
return err
}
etcd.Options = o
} else if version.Major == 3 && version.Minor == 0 {
o := Etcd3_0{}
if err := unmarshal(&o); err != nil {
return err
}
etcd.Options = o
} else if version.Major == 3 && version.Minor == 1 {
o := Etcd3_1{}
if err := unmarshal(&o); err != nil {
return err
}
etcd.Options = o
} else if version.Major == 3 && version.Minor == 2 {
o := Etcd3_2{}
if err := unmarshal(&o); err != nil {
return err
}
etcd.Options = o
} else if version.Major == 3 && version.Minor >= 3 {
o := Etcd3_3{}
if err := unmarshal(&o); err != nil {
return err
}
etcd.Options = o
}
return nil
}
func init() {
register(func(in Config, ast astnode.AstNode, out ignTypes.Config, platform string) (ignTypes.Config, report.Report, astnode.AstNode) {
if in.Etcd != nil {
contents, err := etcdContents(*in.Etcd, platform)
if err != nil {
return ignTypes.Config{}, report.ReportFromError(err, report.EntryError), ast
}
out.Systemd.Units = append(out.Systemd.Units, ignTypes.Unit{
Name: "etcd-member.service",
Enable: true,
Dropins: []ignTypes.SystemdDropin{{
Name: "20-clct-etcd-member.conf",
Contents: contents,
}},
})
}
return out, report.Report{}, ast
})
}
// etcdContents creates the string containing the systemd drop in for etcd-member
func etcdContents(etcd Etcd, platform string) (string, error) {
args := getCliArgs(etcd.Options)
var vars []string
if etcd.Version != nil {
vars = []string{fmt.Sprintf("ETCD_IMAGE_TAG=v%s", etcd.Version)}
}
unit, err := assembleUnit("/usr/lib/coreos/etcd-wrapper $ETCD_OPTS", args, vars, platform)
if err != nil {
return "", err
}
return unit.String(), nil
}
type Etcd3_0 struct {
Name *string `yaml:"name" cli:"name"`
DataDir *string `yaml:"data_dir" cli:"data-dir"`
WalDir *string `yaml:"wal_dir" cli:"wal-dir"`
SnapshotCount *int `yaml:"snapshot_count" cli:"snapshot-count"`
HeartbeatInterval *int `yaml:"heartbeat_interval" cli:"heartbeat-interval"`
ElectionTimeout *int `yaml:"election_timeout" cli:"election-timeout"`
EnablePprof *bool `yaml:"enable_pprof" cli:"enable-pprof"`
ListenPeerUrls *string `yaml:"listen_peer_urls" cli:"listen-peer-urls"`
ListenClientUrls *string `yaml:"listen_client_urls" cli:"listen-client-urls"`
MaxSnapshots *int `yaml:"max_snapshots" cli:"max-snapshots"`
MaxWals *int `yaml:"max_wals" cli:"max-wals"`
Cors *string `yaml:"cors" cli:"cors"`
InitialAdvertisePeerUrls *string `yaml:"initial_advertise_peer_urls" cli:"initial-advertise-peer-urls"`
InitialCluster *string `yaml:"initial_cluster" cli:"initial-cluster"`
InitialClusterState *string `yaml:"initial_cluster_state" cli:"initial-cluster-state"`
InitialClusterToken *string `yaml:"initial_cluster_token" cli:"initial-cluster-token"`
AdvertiseClientUrls *string `yaml:"advertise_client_urls" cli:"advertise-client-urls"`
Discovery *string `yaml:"discovery" cli:"discovery"`
DiscoverySrv *string `yaml:"discovery_srv" cli:"discovery-srv"`
DiscoveryFallback *string `yaml:"discovery_fallback" cli:"discovery-fallback"`
DiscoveryProxy *string `yaml:"discovery_proxy" cli:"discovery-proxy"`
StrictReconfigCheck *bool `yaml:"strict_reconfig_check" cli:"strict-reconfig-check"`
AutoCompactionRetention *int `yaml:"auto_compaction_retention" cli:"auto-compaction-retention"`
Proxy *string `yaml:"proxy" cli:"proxy"`
ProxyFailureWait *int `yaml:"proxy_failure_wait" cli:"proxy-failure-wait"`
ProxyRefreshInterval *int `yaml:"proxy_refresh_interval" cli:"proxy-refresh-interval"`
ProxyDialTimeout *int `yaml:"proxy_dial_timeout" cli:"proxy-dial-timeout"`
ProxyWriteTimeout *int `yaml:"proxy_write_timeout" cli:"proxy-write-timeout"`
ProxyReadTimeout *int `yaml:"proxy_read_timeout" cli:"proxy-read-timeout"`
CaFile *string `yaml:"ca_file" cli:"ca-file" deprecated:"ca_file obsoleted by trusted_ca_file and client_cert_auth"`
CertFile *string `yaml:"cert_file" cli:"cert-file"`
KeyFile *string `yaml:"key_file" cli:"key-file"`
ClientCertAuth *bool `yaml:"client_cert_auth" cli:"client-cert-auth"`
TrustedCaFile *string `yaml:"trusted_ca_file" cli:"trusted-ca-file"`
AutoTls *bool `yaml:"auto_tls" cli:"auto-tls"`
PeerCaFile *string `yaml:"peer_ca_file" cli:"peer-ca-file" deprecated:"peer_ca_file obsoleted peer_trusted_ca_file and peer_client_cert_auth"`
PeerCertFile *string `yaml:"peer_cert_file" cli:"peer-cert-file"`
PeerKeyFile *string `yaml:"peer_key_file" cli:"peer-key-file"`
PeerClientCertAuth *bool `yaml:"peer_client_cert_auth" cli:"peer-client-cert-auth"`
PeerTrustedCaFile *string `yaml:"peer_trusted_ca_file" cli:"peer-trusted-ca-file"`
PeerAutoTls *bool `yaml:"peer_auto_tls" cli:"peer-auto-tls"`
Debug *bool `yaml:"debug" cli:"debug"`
LogPackageLevels *string `yaml:"log_package_levels" cli:"log-package-levels"`
ForceNewCluster *bool `yaml:"force_new_cluster" cli:"force-new-cluster"`
}
type Etcd3_1 struct {
Name *string `yaml:"name" cli:"name"`
DataDir *string `yaml:"data_dir" cli:"data-dir"`
WalDir *string `yaml:"wal_dir" cli:"wal-dir"`
SnapshotCount *int `yaml:"snapshot_count" cli:"snapshot-count"`
HeartbeatInterval *int `yaml:"heartbeat_interval" cli:"heartbeat-interval"`
ElectionTimeout *int `yaml:"election_timeout" cli:"election-timeout"`
EnablePprof *bool `yaml:"enable_pprof" cli:"enable-pprof"`
ListenPeerUrls *string `yaml:"listen_peer_urls" cli:"listen-peer-urls"`
ListenClientUrls *string `yaml:"listen_client_urls" cli:"listen-client-urls"`
MaxSnapshots *int `yaml:"max_snapshots" cli:"max-snapshots"`
MaxWals *int `yaml:"max_wals" cli:"max-wals"`
Cors *string `yaml:"cors" cli:"cors"`
InitialAdvertisePeerUrls *string `yaml:"initial_advertise_peer_urls" cli:"initial-advertise-peer-urls"`
InitialCluster *string `yaml:"initial_cluster" cli:"initial-cluster"`
InitialClusterState *string `yaml:"initial_cluster_state" cli:"initial-cluster-state"`
InitialClusterToken *string `yaml:"initial_cluster_token" cli:"initial-cluster-token"`
AdvertiseClientUrls *string `yaml:"advertise_client_urls" cli:"advertise-client-urls"`
Discovery *string `yaml:"discovery" cli:"discovery"`
DiscoverySrv *string `yaml:"discovery_srv" cli:"discovery-srv"`
DiscoveryFallback *string `yaml:"discovery_fallback" cli:"discovery-fallback"`
DiscoveryProxy *string `yaml:"discovery_proxy" cli:"discovery-proxy"`
StrictReconfigCheck *bool `yaml:"strict_reconfig_check" cli:"strict-reconfig-check"`
AutoCompactionRetention *int `yaml:"auto_compaction_retention" cli:"auto-compaction-retention"`
Proxy *string `yaml:"proxy" cli:"proxy"`
ProxyFailureWait *int `yaml:"proxy_failure_wait" cli:"proxy-failure-wait"`
ProxyRefreshInterval *int `yaml:"proxy_refresh_interval" cli:"proxy-refresh-interval"`
ProxyDialTimeout *int `yaml:"proxy_dial_timeout" cli:"proxy-dial-timeout"`
ProxyWriteTimeout *int `yaml:"proxy_write_timeout" cli:"proxy-write-timeout"`
ProxyReadTimeout *int `yaml:"proxy_read_timeout" cli:"proxy-read-timeout"`
CaFile *string `yaml:"ca_file" cli:"ca-file" deprecated:"ca_file obsoleted by trusted_ca_file and client_cert_auth"`
CertFile *string `yaml:"cert_file" cli:"cert-file"`
KeyFile *string `yaml:"key_file" cli:"key-file"`
ClientCertAuth *bool `yaml:"client_cert_auth" cli:"client-cert-auth"`
TrustedCaFile *string `yaml:"trusted_ca_file" cli:"trusted-ca-file"`
AutoTls *bool `yaml:"auto_tls" cli:"auto-tls"`
PeerCaFile *string `yaml:"peer_ca_file" cli:"peer-ca-file" deprecated:"peer_ca_file obsoleted peer_trusted_ca_file and peer_client_cert_auth"`
PeerCertFile *string `yaml:"peer_cert_file" cli:"peer-cert-file"`
PeerKeyFile *string `yaml:"peer_key_file" cli:"peer-key-file"`
PeerClientCertAuth *bool `yaml:"peer_client_cert_auth" cli:"peer-client-cert-auth"`
PeerTrustedCaFile *string `yaml:"peer_trusted_ca_file" cli:"peer-trusted-ca-file"`
PeerAutoTls *bool `yaml:"peer_auto_tls" cli:"peer-auto-tls"`
Debug *bool `yaml:"debug" cli:"debug"`
LogPackageLevels *string `yaml:"log_package_levels" cli:"log-package-levels"`
ForceNewCluster *bool `yaml:"force_new_cluster" cli:"force-new-cluster"`
Metrics *string `yaml:"metrics" cli:"metrics"`
LogOutput *string `yaml:"log_output" cli:"log-output"`
}
type Etcd3_2 struct {
Name *string `yaml:"name" cli:"name"`
DataDir *string `yaml:"data_dir" cli:"data-dir"`
WalDir *string `yaml:"wal_dir" cli:"wal-dir"`
SnapshotCount *int `yaml:"snapshot_count" cli:"snapshot-count"`
HeartbeatInterval *int `yaml:"heartbeat_interval" cli:"heartbeat-interval"`
ElectionTimeout *int `yaml:"election_timeout" cli:"election-timeout"`
EnablePprof *bool `yaml:"enable_pprof" cli:"enable-pprof"`
EnableV2 *bool `yaml:"enable_v2" cli:"enable-v2"`
ListenPeerUrls *string `yaml:"listen_peer_urls" cli:"listen-peer-urls"`
ListenClientUrls *string `yaml:"listen_client_urls" cli:"listen-client-urls"`
MaxSnapshots *int `yaml:"max_snapshots" cli:"max-snapshots"`
MaxWals *int `yaml:"max_wals" cli:"max-wals"`
Cors *string `yaml:"cors" cli:"cors"`
InitialAdvertisePeerUrls *string `yaml:"initial_advertise_peer_urls" cli:"initial-advertise-peer-urls"`
InitialCluster *string `yaml:"initial_cluster" cli:"initial-cluster"`
InitialClusterState *string `yaml:"initial_cluster_state" cli:"initial-cluster-state"`
InitialClusterToken *string `yaml:"initial_cluster_token" cli:"initial-cluster-token"`
AdvertiseClientUrls *string `yaml:"advertise_client_urls" cli:"advertise-client-urls"`
Discovery *string `yaml:"discovery" cli:"discovery"`
DiscoverySrv *string `yaml:"discovery_srv" cli:"discovery-srv"`
DiscoveryFallback *string `yaml:"discovery_fallback" cli:"discovery-fallback"`
DiscoveryProxy *string `yaml:"discovery_proxy" cli:"discovery-proxy"`
StrictReconfigCheck *bool `yaml:"strict_reconfig_check" cli:"strict-reconfig-check"`
AutoCompactionRetention *int `yaml:"auto_compaction_retention" cli:"auto-compaction-retention"`
Proxy *string `yaml:"proxy" cli:"proxy"`
ProxyFailureWait *int `yaml:"proxy_failure_wait" cli:"proxy-failure-wait"`
ProxyRefreshInterval *int `yaml:"proxy_refresh_interval" cli:"proxy-refresh-interval"`
ProxyDialTimeout *int `yaml:"proxy_dial_timeout" cli:"proxy-dial-timeout"`
ProxyWriteTimeout *int `yaml:"proxy_write_timeout" cli:"proxy-write-timeout"`
ProxyReadTimeout *int `yaml:"proxy_read_timeout" cli:"proxy-read-timeout"`
CaFile *string `yaml:"ca_file" cli:"ca-file" deprecated:"ca_file obsoleted by trusted_ca_file and client_cert_auth"`
CertFile *string `yaml:"cert_file" cli:"cert-file"`
KeyFile *string `yaml:"key_file" cli:"key-file"`
ClientCertAuth *bool `yaml:"client_cert_auth" cli:"client-cert-auth"`
TrustedCaFile *string `yaml:"trusted_ca_file" cli:"trusted-ca-file"`
AutoTls *bool `yaml:"auto_tls" cli:"auto-tls"`
PeerCaFile *string `yaml:"peer_ca_file" cli:"peer-ca-file" deprecated:"peer_ca_file obsoleted peer_trusted_ca_file and peer_client_cert_auth"`
PeerCertFile *string `yaml:"peer_cert_file" cli:"peer-cert-file"`
PeerKeyFile *string `yaml:"peer_key_file" cli:"peer-key-file"`
PeerClientCertAuth *bool `yaml:"peer_client_cert_auth" cli:"peer-client-cert-auth"`
PeerTrustedCaFile *string `yaml:"peer_trusted_ca_file" cli:"peer-trusted-ca-file"`
PeerAutoTls *bool `yaml:"peer_auto_tls" cli:"peer-auto-tls"`
AuthToken *string `yaml:"auth_token" cli:"auth-token"`
Debug *bool `yaml:"debug" cli:"debug"`
LogPackageLevels *string `yaml:"log_package_levels" cli:"log-package-levels"`
ForceNewCluster *bool `yaml:"force_new_cluster" cli:"force-new-cluster"`
Metrics *string `yaml:"metrics" cli:"metrics"`
LogOutput *string `yaml:"log_output" cli:"log-output"`
}
type Etcd3_3 struct {
Name *string `yaml:"name" cli:"name"`
DataDir *string `yaml:"data_dir" cli:"data-dir"`
WalDir *string `yaml:"wal_dir" cli:"wal-dir"`
SnapshotCount *int `yaml:"snapshot_count" cli:"snapshot-count"`
HeartbeatInterval *int `yaml:"heartbeat_interval" cli:"heartbeat-interval"`
ElectionTimeout *int `yaml:"election_timeout" cli:"election-timeout"`
EnablePprof *bool `yaml:"enable_pprof" cli:"enable-pprof"`
EnableV2 *bool `yaml:"enable_v2" cli:"enable-v2"`
ListenPeerUrls *string `yaml:"listen_peer_urls" cli:"listen-peer-urls"`
ListenClientUrls *string `yaml:"listen_client_urls" cli:"listen-client-urls"`
MaxSnapshots *int `yaml:"max_snapshots" cli:"max-snapshots"`
MaxWals *int `yaml:"max_wals" cli:"max-wals"`
Cors *string `yaml:"cors" cli:"cors"`
QuotaBackendBytes *int `yaml:"quota_backend_bytes" cli:"quota-backend-bytes"`
MaxTxnOps *int `yaml:"max_txn_ops" cli:"max-txn-ops"`
MaxRequestBytes *int `yaml:"max_request_bytes" cli:"max-request-bytes"`
GrpcKeepaliveMinTime *string `yaml:"grpc_keepalive_min_time" cli:"grpc-keepalive-min-time"`
GrpcKeepaliveInterval *string `yaml:"grpc_keepalive_interval" cli:"grpc-keepalive-interval"`
GrpcKeepaliveTimeout *string `yaml:"grpc_keepalive_timeout" cli:"grpc-keepalive-timeout"`
InitialAdvertisePeerUrls *string `yaml:"initial_advertise_peer_urls" cli:"initial-advertise-peer-urls"`
InitialCluster *string `yaml:"initial_cluster" cli:"initial-cluster"`
InitialClusterState *string `yaml:"initial_cluster_state" cli:"initial-cluster-state"`
InitialClusterToken *string `yaml:"initial_cluster_token" cli:"initial-cluster-token"`
AdvertiseClientUrls *string `yaml:"advertise_client_urls" cli:"advertise-client-urls"`
Discovery *string `yaml:"discovery" cli:"discovery"`
DiscoverySrv *string `yaml:"discovery_srv" cli:"discovery-srv"`
DiscoveryFallback *string `yaml:"discovery_fallback" cli:"discovery-fallback"`
DiscoveryProxy *string `yaml:"discovery_proxy" cli:"discovery-proxy"`
StrictReconfigCheck *bool `yaml:"strict_reconfig_check" cli:"strict-reconfig-check"`
AutoCompactionRetention *string `yaml:"auto_compaction_retention" cli:"auto-compaction-retention"`
AutoCompactionMode *string `yaml:"auto_compaction_mode" cli:"auto-compaction-mode"`
Proxy *string `yaml:"proxy" cli:"proxy"`
ProxyFailureWait *int `yaml:"proxy_failure_wait" cli:"proxy-failure-wait"`
ProxyRefreshInterval *int `yaml:"proxy_refresh_interval" cli:"proxy-refresh-interval"`
ProxyDialTimeout *int `yaml:"proxy_dial_timeout" cli:"proxy-dial-timeout"`
ProxyWriteTimeout *int `yaml:"proxy_write_timeout" cli:"proxy-write-timeout"`
ProxyReadTimeout *int `yaml:"proxy_read_timeout" cli:"proxy-read-timeout"`
CaFile *string `yaml:"ca_file" cli:"ca-file" deprecated:"ca_file obsoleted by trusted_ca_file and client_cert_auth"`
CertFile *string `yaml:"cert_file" cli:"cert-file"`
KeyFile *string `yaml:"key_file" cli:"key-file"`
ClientCertAuth *bool `yaml:"client_cert_auth" cli:"client-cert-auth"`
ClientCrlFile *string `yaml:"client_crl_file" cli:"client-crl-file"`
TrustedCaFile *string `yaml:"trusted_ca_file" cli:"trusted-ca-file"`
AutoTls *bool `yaml:"auto_tls" cli:"auto-tls"`
PeerCaFile *string `yaml:"peer_ca_file" cli:"peer-ca-file" deprecated:"peer_ca_file obsoleted peer_trusted_ca_file and peer_client_cert_auth"`
PeerCertFile *string `yaml:"peer_cert_file" cli:"peer-cert-file"`
PeerKeyFile *string `yaml:"peer_key_file" cli:"peer-key-file"`
PeerClientCertAuth *bool `yaml:"peer_client_cert_auth" cli:"peer-client-cert-auth"`
PeerCrlFile *string `yaml:"peer_crl_file" cli:"peer-crl-file"`
PeerTrustedCaFile *string `yaml:"peer_trusted_ca_file" cli:"peer-trusted-ca-file"`
PeerAutoTls *bool `yaml:"peer_auto_tls" cli:"peer-auto-tls"`
PeerCertAllowedCn *string `yaml:"peer_cert_allowed_cn" cli:"peer-cert-allowed-cn"`
AuthToken *string `yaml:"auth_token" cli:"auth-token"`
Debug *bool `yaml:"debug" cli:"debug"`
LogPackageLevels *string `yaml:"log_package_levels" cli:"log-package-levels"`
ForceNewCluster *bool `yaml:"force_new_cluster" cli:"force-new-cluster"`
Metrics *string `yaml:"metrics" cli:"metrics"`
LogOutput *string `yaml:"log_output" cli:"log-output"`
ListenMetricsUrls *string `yaml:"listen_metrics_urls" cli:"listen-metrics-urls"`
ExperimentalInitialCorruptCheck *bool `yaml:"experimental_initial_corrupt_check" cli:"experimental-initial-corrupt-check"`
ExperimentalCorruptCheckTime *string `yaml:"experimental_corrupt_check_time" cli:"experimental-corrupt-check-time"`
ExperimentalEnableV2V3 *string `yaml:"experimental_enable_v2v3" cli:"experimental-enable-v2v3"`
}
type Etcd2 struct {
AdvertiseClientURLs *string `yaml:"advertise_client_urls" cli:"advertise-client-urls"`
CAFile *string `yaml:"ca_file" cli:"ca-file" deprecated:"ca_file obsoleted by trusted_ca_file and client_cert_auth"`
CertFile *string `yaml:"cert_file" cli:"cert-file"`
ClientCertAuth *bool `yaml:"client_cert_auth" cli:"client-cert-auth"`
CorsOrigins *string `yaml:"cors" cli:"cors"`
DataDir *string `yaml:"data_dir" cli:"data-dir"`
Debug *bool `yaml:"debug" cli:"debug"`
Discovery *string `yaml:"discovery" cli:"discovery"`
DiscoveryFallback *string `yaml:"discovery_fallback" cli:"discovery-fallback"`
DiscoverySRV *string `yaml:"discovery_srv" cli:"discovery-srv"`
DiscoveryProxy *string `yaml:"discovery_proxy" cli:"discovery-proxy"`
ElectionTimeout *int `yaml:"election_timeout" cli:"election-timeout"`
EnablePprof *bool `yaml:"enable_pprof" cli:"enable-pprof"`
ForceNewCluster *bool `yaml:"force_new_cluster" cli:"force-new-cluster"`
HeartbeatInterval *int `yaml:"heartbeat_interval" cli:"heartbeat-interval"`
InitialAdvertisePeerURLs *string `yaml:"initial_advertise_peer_urls" cli:"initial-advertise-peer-urls"`
InitialCluster *string `yaml:"initial_cluster" cli:"initial-cluster"`
InitialClusterState *string `yaml:"initial_cluster_state" cli:"initial-cluster-state"`
InitialClusterToken *string `yaml:"initial_cluster_token" cli:"initial-cluster-token"`
KeyFile *string `yaml:"key_file" cli:"key-file"`
ListenClientURLs *string `yaml:"listen_client_urls" cli:"listen-client-urls"`
ListenPeerURLs *string `yaml:"listen_peer_urls" cli:"listen-peer-urls"`
LogPackageLevels *string `yaml:"log_package_levels" cli:"log-package-levels"`
MaxSnapshots *int `yaml:"max_snapshots" cli:"max-snapshots"`
MaxWALs *int `yaml:"max_wals" cli:"max-wals"`
Name *string `yaml:"name" cli:"name"`
PeerCAFile *string `yaml:"peer_ca_file" cli:"peer-ca-file" deprecated:"peer_ca_file obsoleted peer_trusted_ca_file and peer_client_cert_auth"`
PeerCertFile *string `yaml:"peer_cert_file" cli:"peer-cert-file"`
PeerKeyFile *string `yaml:"peer_key_file" cli:"peer-key-file"`
PeerClientCertAuth *bool `yaml:"peer_client_cert_auth" cli:"peer-client-cert-auth"`
PeerTrustedCAFile *string `yaml:"peer_trusted_ca_file" cli:"peer-trusted-ca-file"`
Proxy *string `yaml:"proxy" cli:"proxy" valid:"^(on|off|readonly)$"`
ProxyDialTimeout *int `yaml:"proxy_dial_timeout" cli:"proxy-dial-timeout"`
ProxyFailureWait *int `yaml:"proxy_failure_wait" cli:"proxy-failure-wait"`
ProxyReadTimeout *int `yaml:"proxy_read_timeout" cli:"proxy-read-timeout"`
ProxyRefreshInterval *int `yaml:"proxy_refresh_interval" cli:"proxy-refresh-interval"`
ProxyWriteTimeout *int `yaml:"proxy_write_timeout" cli:"proxy-write-timeout"`
SnapshotCount *int `yaml:"snapshot_count" cli:"snapshot-count"`
StrictReconfigCheck *bool `yaml:"strict_reconfig_check" cli:"strict-reconfig-check"`
TrustedCAFile *string `yaml:"trusted_ca_file" cli:"trusted-ca-file"`
WalDir *string `yaml:"wal_dir" cli:"wal-dir"`
}
|
{
"pile_set_name": "Github"
}
|
// RUN: %clang_cc1 -std=c++11 -verify %s -Wunused
namespace {
double operator"" _x(long double value) { return double(value); }
int operator"" _ii(long double value) { return int(value); } // expected-warning {{not needed and will not be emitted}}
}
namespace rdar13589856 {
template<class T> double value() { return 3.2_x; }
template<class T> int valuei() { return 3.2_ii; }
double get_value() { return value<double>(); }
}
|
{
"pile_set_name": "Github"
}
|
#
# cookie.rb -- Cookie class
#
# Author: IPR -- Internet Programming with Ruby -- writers
# Copyright (c) 2000, 2001 TAKAHASHI Masayoshi, GOTOU Yuuzou
# Copyright (c) 2002 Internet Programming with Ruby writers. All rights
# reserved.
#
# $IPR: cookie.rb,v 1.16 2002/09/21 12:23:35 gotoyuzo Exp $
require 'time'
require 'webrick/httputils'
module WEBrick
##
# Processes HTTP cookies
class Cookie
##
# The cookie name
attr_reader :name
##
# The cookie value
attr_accessor :value
##
# The cookie version
attr_accessor :version
##
# The cookie domain
attr_accessor :domain
##
# The cookie path
attr_accessor :path
##
# Is this a secure cookie?
attr_accessor :secure
##
# The cookie comment
attr_accessor :comment
##
# The maximum age of the cookie
attr_accessor :max_age
#attr_accessor :comment_url, :discard, :port
##
# Creates a new cookie with the given +name+ and +value+
def initialize(name, value)
@name = name
@value = value
@version = 0 # Netscape Cookie
@domain = @path = @secure = @comment = @max_age =
@expires = @comment_url = @discard = @port = nil
end
##
# Sets the cookie expiration to the time +t+. The expiration time may be
# a false value to disable expiration or a Time or HTTP format time string
# to set the expiration date.
def expires=(t)
@expires = t && (t.is_a?(Time) ? t.httpdate : t.to_s)
end
##
# Retrieves the expiration time as a Time
def expires
@expires && Time.parse(@expires)
end
##
# The cookie string suitable for use in an HTTP header
def to_s
ret = ""
ret << @name << "=" << @value
ret << "; " << "Version=" << @version.to_s if @version > 0
ret << "; " << "Domain=" << @domain if @domain
ret << "; " << "Expires=" << @expires if @expires
ret << "; " << "Max-Age=" << @max_age.to_s if @max_age
ret << "; " << "Comment=" << @comment if @comment
ret << "; " << "Path=" << @path if @path
ret << "; " << "Secure" if @secure
ret
end
##
# Parses a Cookie field sent from the user-agent. Returns an array of
# cookies.
def self.parse(str)
if str
ret = []
cookie = nil
ver = 0
str.split(/[;,]\s+/).each{|x|
key, val = x.split(/=/,2)
val = val ? HTTPUtils::dequote(val) : ""
case key
when "$Version"; ver = val.to_i
when "$Path"; cookie.path = val
when "$Domain"; cookie.domain = val
when "$Port"; cookie.port = val
else
ret << cookie if cookie
cookie = self.new(key, val)
cookie.version = ver
end
}
ret << cookie if cookie
ret
end
end
##
# Parses the cookie in +str+
def self.parse_set_cookie(str)
cookie_elem = str.split(/;/)
first_elem = cookie_elem.shift
first_elem.strip!
key, value = first_elem.split(/=/, 2)
cookie = new(key, HTTPUtils.dequote(value))
cookie_elem.each{|pair|
pair.strip!
key, value = pair.split(/=/, 2)
if value
value = HTTPUtils.dequote(value.strip)
end
case key.downcase
when "domain" then cookie.domain = value
when "path" then cookie.path = value
when "expires" then cookie.expires = value
when "max-age" then cookie.max_age = Integer(value)
when "comment" then cookie.comment = value
when "version" then cookie.version = Integer(value)
when "secure" then cookie.secure = true
end
}
return cookie
end
##
# Parses the cookies in +str+
def self.parse_set_cookies(str)
return str.split(/,(?=[^;,]*=)|,$/).collect{|c|
parse_set_cookie(c)
}
end
end
end
|
{
"pile_set_name": "Github"
}
|
/* Interface between the opcode library and its callers.
Written by Cygnus Support, 1993.
The opcode library (libopcodes.a) provides instruction decoders for
a large variety of instruction sets, callable with an identical
interface, for making instruction-processing programs more independent
of the instruction set being processed. */
#ifndef DISAS_DIS_ASM_H
#define DISAS_DIS_ASM_H
typedef void *PTR;
typedef uint64_t bfd_vma;
typedef int64_t bfd_signed_vma;
typedef uint8_t bfd_byte;
#define sprintf_vma(s,x) sprintf (s, "%0" PRIx64, x)
#define snprintf_vma(s,ss,x) snprintf (s, ss, "%0" PRIx64, x)
#define BFD64
enum bfd_flavour {
bfd_target_unknown_flavour,
bfd_target_aout_flavour,
bfd_target_coff_flavour,
bfd_target_ecoff_flavour,
bfd_target_elf_flavour,
bfd_target_ieee_flavour,
bfd_target_nlm_flavour,
bfd_target_oasys_flavour,
bfd_target_tekhex_flavour,
bfd_target_srec_flavour,
bfd_target_ihex_flavour,
bfd_target_som_flavour,
bfd_target_os9k_flavour,
bfd_target_versados_flavour,
bfd_target_msdos_flavour,
bfd_target_evax_flavour
};
enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
enum bfd_architecture
{
bfd_arch_unknown, /* File arch not known */
bfd_arch_obscure, /* Arch known, not one of these */
bfd_arch_m68k, /* Motorola 68xxx */
#define bfd_mach_m68000 1
#define bfd_mach_m68008 2
#define bfd_mach_m68010 3
#define bfd_mach_m68020 4
#define bfd_mach_m68030 5
#define bfd_mach_m68040 6
#define bfd_mach_m68060 7
#define bfd_mach_cpu32 8
#define bfd_mach_mcf5200 9
#define bfd_mach_mcf5206e 10
#define bfd_mach_mcf5307 11
#define bfd_mach_mcf5407 12
#define bfd_mach_mcf528x 13
#define bfd_mach_mcfv4e 14
#define bfd_mach_mcf521x 15
#define bfd_mach_mcf5249 16
#define bfd_mach_mcf547x 17
#define bfd_mach_mcf548x 18
bfd_arch_vax, /* DEC Vax */
bfd_arch_i960, /* Intel 960 */
/* The order of the following is important.
lower number indicates a machine type that
only accepts a subset of the instructions
available to machines with higher numbers.
The exception is the "ca", which is
incompatible with all other machines except
"core". */
#define bfd_mach_i960_core 1
#define bfd_mach_i960_ka_sa 2
#define bfd_mach_i960_kb_sb 3
#define bfd_mach_i960_mc 4
#define bfd_mach_i960_xa 5
#define bfd_mach_i960_ca 6
#define bfd_mach_i960_jx 7
#define bfd_mach_i960_hx 8
bfd_arch_a29k, /* AMD 29000 */
bfd_arch_sparc, /* SPARC */
#define bfd_mach_sparc 1
/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */
#define bfd_mach_sparc_sparclet 2
#define bfd_mach_sparc_sparclite 3
#define bfd_mach_sparc_v8plus 4
#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns. */
#define bfd_mach_sparc_sparclite_le 6
#define bfd_mach_sparc_v9 7
#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns. */
#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns. */
#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns. */
/* Nonzero if MACH has the v9 instruction set. */
#define bfd_mach_sparc_v9_p(mach) \
((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
&& (mach) != bfd_mach_sparc_sparclite_le)
bfd_arch_mips, /* MIPS Rxxxx */
#define bfd_mach_mips3000 3000
#define bfd_mach_mips3900 3900
#define bfd_mach_mips4000 4000
#define bfd_mach_mips4010 4010
#define bfd_mach_mips4100 4100
#define bfd_mach_mips4300 4300
#define bfd_mach_mips4400 4400
#define bfd_mach_mips4600 4600
#define bfd_mach_mips4650 4650
#define bfd_mach_mips5000 5000
#define bfd_mach_mips6000 6000
#define bfd_mach_mips8000 8000
#define bfd_mach_mips10000 10000
#define bfd_mach_mips16 16
bfd_arch_i386, /* Intel 386 */
#define bfd_mach_i386_i386 0
#define bfd_mach_i386_i8086 1
#define bfd_mach_i386_i386_intel_syntax 2
#define bfd_mach_x86_64 3
#define bfd_mach_x86_64_intel_syntax 4
bfd_arch_we32k, /* AT&T WE32xxx */
bfd_arch_tahoe, /* CCI/Harris Tahoe */
bfd_arch_i860, /* Intel 860 */
bfd_arch_romp, /* IBM ROMP PC/RT */
bfd_arch_alliant, /* Alliant */
bfd_arch_convex, /* Convex */
bfd_arch_m88k, /* Motorola 88xxx */
bfd_arch_pyramid, /* Pyramid Technology */
bfd_arch_h8300, /* Hitachi H8/300 */
#define bfd_mach_h8300 1
#define bfd_mach_h8300h 2
#define bfd_mach_h8300s 3
bfd_arch_powerpc, /* PowerPC */
#define bfd_mach_ppc 0
#define bfd_mach_ppc64 1
#define bfd_mach_ppc_403 403
#define bfd_mach_ppc_403gc 4030
#define bfd_mach_ppc_e500 500
#define bfd_mach_ppc_505 505
#define bfd_mach_ppc_601 601
#define bfd_mach_ppc_602 602
#define bfd_mach_ppc_603 603
#define bfd_mach_ppc_ec603e 6031
#define bfd_mach_ppc_604 604
#define bfd_mach_ppc_620 620
#define bfd_mach_ppc_630 630
#define bfd_mach_ppc_750 750
#define bfd_mach_ppc_860 860
#define bfd_mach_ppc_a35 35
#define bfd_mach_ppc_rs64ii 642
#define bfd_mach_ppc_rs64iii 643
#define bfd_mach_ppc_7400 7400
bfd_arch_rs6000, /* IBM RS/6000 */
bfd_arch_hppa, /* HP PA RISC */
#define bfd_mach_hppa10 10
#define bfd_mach_hppa11 11
#define bfd_mach_hppa20 20
#define bfd_mach_hppa20w 25
bfd_arch_d10v, /* Mitsubishi D10V */
bfd_arch_z8k, /* Zilog Z8000 */
#define bfd_mach_z8001 1
#define bfd_mach_z8002 2
bfd_arch_h8500, /* Hitachi H8/500 */
bfd_arch_sh, /* Hitachi SH */
#define bfd_mach_sh 1
#define bfd_mach_sh2 0x20
#define bfd_mach_sh_dsp 0x2d
#define bfd_mach_sh2a 0x2a
#define bfd_mach_sh2a_nofpu 0x2b
#define bfd_mach_sh2e 0x2e
#define bfd_mach_sh3 0x30
#define bfd_mach_sh3_nommu 0x31
#define bfd_mach_sh3_dsp 0x3d
#define bfd_mach_sh3e 0x3e
#define bfd_mach_sh4 0x40
#define bfd_mach_sh4_nofpu 0x41
#define bfd_mach_sh4_nommu_nofpu 0x42
#define bfd_mach_sh4a 0x4a
#define bfd_mach_sh4a_nofpu 0x4b
#define bfd_mach_sh4al_dsp 0x4d
#define bfd_mach_sh5 0x50
bfd_arch_alpha, /* Dec Alpha */
#define bfd_mach_alpha 1
#define bfd_mach_alpha_ev4 0x10
#define bfd_mach_alpha_ev5 0x20
#define bfd_mach_alpha_ev6 0x30
bfd_arch_arm, /* Advanced Risc Machines ARM */
#define bfd_mach_arm_unknown 0
#define bfd_mach_arm_2 1
#define bfd_mach_arm_2a 2
#define bfd_mach_arm_3 3
#define bfd_mach_arm_3M 4
#define bfd_mach_arm_4 5
#define bfd_mach_arm_4T 6
#define bfd_mach_arm_5 7
#define bfd_mach_arm_5T 8
#define bfd_mach_arm_5TE 9
#define bfd_mach_arm_XScale 10
#define bfd_mach_arm_ep9312 11
#define bfd_mach_arm_iWMMXt 12
#define bfd_mach_arm_iWMMXt2 13
bfd_arch_ns32k, /* National Semiconductors ns32000 */
bfd_arch_w65, /* WDC 65816 */
bfd_arch_tic30, /* Texas Instruments TMS320C30 */
bfd_arch_v850, /* NEC V850 */
#define bfd_mach_v850 0
bfd_arch_arc, /* Argonaut RISC Core */
#define bfd_mach_arc_base 0
bfd_arch_m32r, /* Mitsubishi M32R/D */
#define bfd_mach_m32r 0 /* backwards compatibility */
bfd_arch_mn10200, /* Matsushita MN10200 */
bfd_arch_mn10300, /* Matsushita MN10300 */
bfd_arch_cris, /* Axis CRIS */
#define bfd_mach_cris_v0_v10 255
#define bfd_mach_cris_v32 32
#define bfd_mach_cris_v10_v32 1032
bfd_arch_microblaze, /* Xilinx MicroBlaze. */
bfd_arch_moxie, /* The Moxie core. */
bfd_arch_ia64, /* HP/Intel ia64 */
#define bfd_mach_ia64_elf64 64
#define bfd_mach_ia64_elf32 32
bfd_arch_nios2, /* Nios II */
#define bfd_mach_nios2 0
#define bfd_mach_nios2r1 1
#define bfd_mach_nios2r2 2
bfd_arch_lm32, /* Lattice Mico32 */
#define bfd_mach_lm32 1
bfd_arch_last
};
#define bfd_mach_s390_31 31
#define bfd_mach_s390_64 64
typedef struct symbol_cache_entry
{
const char *name;
union
{
PTR p;
bfd_vma i;
} udata;
} asymbol;
typedef int (*fprintf_function)(FILE *f, const char *fmt, ...)
GCC_FMT_ATTR(2, 3);
enum dis_insn_type {
dis_noninsn, /* Not a valid instruction */
dis_nonbranch, /* Not a branch instruction */
dis_branch, /* Unconditional branch */
dis_condbranch, /* Conditional branch */
dis_jsr, /* Jump to subroutine */
dis_condjsr, /* Conditional jump to subroutine */
dis_dref, /* Data reference instruction */
dis_dref2 /* Two data references in instruction */
};
/* This struct is passed into the instruction decoding routine,
and is passed back out into each callback. The various fields are used
for conveying information from your main routine into your callbacks,
for passing information into the instruction decoders (such as the
addresses of the callback functions), or for passing information
back from the instruction decoders to their callers.
It must be initialized before it is first passed; this can be done
by hand, or using one of the initialization macros below. */
typedef struct disassemble_info {
fprintf_function fprintf_func;
FILE *stream;
PTR application_data;
/* Target description. We could replace this with a pointer to the bfd,
but that would require one. There currently isn't any such requirement
so to avoid introducing one we record these explicitly. */
/* The bfd_flavour. This can be bfd_target_unknown_flavour. */
enum bfd_flavour flavour;
/* The bfd_arch value. */
enum bfd_architecture arch;
/* The bfd_mach value. */
unsigned long mach;
/* Endianness (for bi-endian cpus). Mono-endian cpus can ignore this. */
enum bfd_endian endian;
/* An array of pointers to symbols either at the location being disassembled
or at the start of the function being disassembled. The array is sorted
so that the first symbol is intended to be the one used. The others are
present for any misc. purposes. This is not set reliably, but if it is
not NULL, it is correct. */
asymbol **symbols;
/* Number of symbols in array. */
int num_symbols;
/* For use by the disassembler.
The top 16 bits are reserved for public use (and are documented here).
The bottom 16 bits are for the internal use of the disassembler. */
unsigned long flags;
#define INSN_HAS_RELOC 0x80000000
#define INSN_ARM_BE32 0x00010000
PTR private_data;
/* Function used to get bytes to disassemble. MEMADDR is the
address of the stuff to be disassembled, MYADDR is the address to
put the bytes in, and LENGTH is the number of bytes to read.
INFO is a pointer to this struct.
Returns an errno value or 0 for success. */
int (*read_memory_func)
(bfd_vma memaddr, bfd_byte *myaddr, int length,
struct disassemble_info *info);
/* Function which should be called if we get an error that we can't
recover from. STATUS is the errno value from read_memory_func and
MEMADDR is the address that we were trying to read. INFO is a
pointer to this struct. */
void (*memory_error_func)
(int status, bfd_vma memaddr, struct disassemble_info *info);
/* Function called to print ADDR. */
void (*print_address_func)
(bfd_vma addr, struct disassemble_info *info);
/* Function called to print an instruction. The function is architecture
* specific.
*/
int (*print_insn)(bfd_vma addr, struct disassemble_info *info);
/* Function called to determine if there is a symbol at the given ADDR.
If there is, the function returns 1, otherwise it returns 0.
This is used by ports which support an overlay manager where
the overlay number is held in the top part of an address. In
some circumstances we want to include the overlay number in the
address, (normally because there is a symbol associated with
that address), but sometimes we want to mask out the overlay bits. */
int (* symbol_at_address_func)
(bfd_vma addr, struct disassemble_info * info);
/* These are for buffer_read_memory. */
bfd_byte *buffer;
bfd_vma buffer_vma;
int buffer_length;
/* This variable may be set by the instruction decoder. It suggests
the number of bytes objdump should display on a single line. If
the instruction decoder sets this, it should always set it to
the same value in order to get reasonable looking output. */
int bytes_per_line;
/* the next two variables control the way objdump displays the raw data */
/* For example, if bytes_per_line is 8 and bytes_per_chunk is 4, the */
/* output will look like this:
00: 00000000 00000000
with the chunks displayed according to "display_endian". */
int bytes_per_chunk;
enum bfd_endian display_endian;
/* Results from instruction decoders. Not all decoders yet support
this information. This info is set each time an instruction is
decoded, and is only valid for the last such instruction.
To determine whether this decoder supports this information, set
insn_info_valid to 0, decode an instruction, then check it. */
char insn_info_valid; /* Branch info has been set. */
char branch_delay_insns; /* How many sequential insn's will run before
a branch takes effect. (0 = normal) */
char data_size; /* Size of data reference in insn, in bytes */
enum dis_insn_type insn_type; /* Type of instruction */
bfd_vma target; /* Target address of branch or dref, if known;
zero if unknown. */
bfd_vma target2; /* Second target address for dref2 */
/* Command line options specific to the target disassembler. */
char * disassembler_options;
/* Options for Capstone disassembly. */
int cap_arch;
int cap_mode;
int cap_insn_unit;
int cap_insn_split;
} disassemble_info;
/* Standard disassemblers. Disassemble one instruction at the given
target address. Return number of bytes processed. */
typedef int (*disassembler_ftype) (bfd_vma, disassemble_info *);
int print_insn_tci(bfd_vma, disassemble_info*);
int print_insn_big_mips (bfd_vma, disassemble_info*);
int print_insn_little_mips (bfd_vma, disassemble_info*);
int print_insn_nanomips (bfd_vma, disassemble_info*);
int print_insn_i386 (bfd_vma, disassemble_info*);
int print_insn_m68k (bfd_vma, disassemble_info*);
int print_insn_z8001 (bfd_vma, disassemble_info*);
int print_insn_z8002 (bfd_vma, disassemble_info*);
int print_insn_h8300 (bfd_vma, disassemble_info*);
int print_insn_h8300h (bfd_vma, disassemble_info*);
int print_insn_h8300s (bfd_vma, disassemble_info*);
int print_insn_h8500 (bfd_vma, disassemble_info*);
int print_insn_arm_a64 (bfd_vma, disassemble_info*);
int print_insn_alpha (bfd_vma, disassemble_info*);
disassembler_ftype arc_get_disassembler (int, int);
int print_insn_arm (bfd_vma, disassemble_info*);
int print_insn_sparc (bfd_vma, disassemble_info*);
int print_insn_big_a29k (bfd_vma, disassemble_info*);
int print_insn_little_a29k (bfd_vma, disassemble_info*);
int print_insn_i960 (bfd_vma, disassemble_info*);
int print_insn_sh (bfd_vma, disassemble_info*);
int print_insn_shl (bfd_vma, disassemble_info*);
int print_insn_hppa (bfd_vma, disassemble_info*);
int print_insn_m32r (bfd_vma, disassemble_info*);
int print_insn_m88k (bfd_vma, disassemble_info*);
int print_insn_mn10200 (bfd_vma, disassemble_info*);
int print_insn_mn10300 (bfd_vma, disassemble_info*);
int print_insn_moxie (bfd_vma, disassemble_info*);
int print_insn_ns32k (bfd_vma, disassemble_info*);
int print_insn_big_powerpc (bfd_vma, disassemble_info*);
int print_insn_little_powerpc (bfd_vma, disassemble_info*);
int print_insn_rs6000 (bfd_vma, disassemble_info*);
int print_insn_w65 (bfd_vma, disassemble_info*);
int print_insn_d10v (bfd_vma, disassemble_info*);
int print_insn_v850 (bfd_vma, disassemble_info*);
int print_insn_tic30 (bfd_vma, disassemble_info*);
int print_insn_ppc (bfd_vma, disassemble_info*);
int print_insn_s390 (bfd_vma, disassemble_info*);
int print_insn_crisv32 (bfd_vma, disassemble_info*);
int print_insn_crisv10 (bfd_vma, disassemble_info*);
int print_insn_microblaze (bfd_vma, disassemble_info*);
int print_insn_ia64 (bfd_vma, disassemble_info*);
int print_insn_lm32 (bfd_vma, disassemble_info*);
int print_insn_big_nios2 (bfd_vma, disassemble_info*);
int print_insn_little_nios2 (bfd_vma, disassemble_info*);
int print_insn_xtensa (bfd_vma, disassemble_info*);
int print_insn_riscv32 (bfd_vma, disassemble_info*);
int print_insn_riscv64 (bfd_vma, disassemble_info*);
#if 0
/* Fetch the disassembler for a given BFD, if that support is available. */
disassembler_ftype disassembler(bfd *);
#endif
/* This block of definitions is for particular callers who read instructions
into a buffer before calling the instruction decoder. */
/* Here is a function which callers may wish to use for read_memory_func.
It gets bytes from a buffer. */
int buffer_read_memory(bfd_vma, bfd_byte *, int, struct disassemble_info *);
/* This function goes with buffer_read_memory.
It prints a message using info->fprintf_func and info->stream. */
void perror_memory(int, bfd_vma, struct disassemble_info *);
/* Just print the address in hex. This is included for completeness even
though both GDB and objdump provide their own (to print symbolic
addresses). */
void generic_print_address(bfd_vma, struct disassemble_info *);
/* Always true. */
int generic_symbol_at_address(bfd_vma, struct disassemble_info *);
/* Macro to initialize a disassemble_info struct. This should be called
by all applications creating such a struct. */
#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \
(INFO).flavour = bfd_target_unknown_flavour, \
(INFO).arch = bfd_arch_unknown, \
(INFO).mach = 0, \
(INFO).endian = BFD_ENDIAN_UNKNOWN, \
INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC)
/* Call this macro to initialize only the internal variables for the
disassembler. Architecture dependent things such as byte order, or machine
variant are not touched by this macro. This makes things much easier for
GDB which must initialize these things separately. */
#define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \
(INFO).fprintf_func = (FPRINTF_FUNC), \
(INFO).stream = (STREAM), \
(INFO).symbols = NULL, \
(INFO).num_symbols = 0, \
(INFO).private_data = NULL, \
(INFO).buffer = NULL, \
(INFO).buffer_vma = 0, \
(INFO).buffer_length = 0, \
(INFO).read_memory_func = buffer_read_memory, \
(INFO).memory_error_func = perror_memory, \
(INFO).print_address_func = generic_print_address, \
(INFO).print_insn = NULL, \
(INFO).symbol_at_address_func = generic_symbol_at_address, \
(INFO).flags = 0, \
(INFO).bytes_per_line = 0, \
(INFO).bytes_per_chunk = 0, \
(INFO).display_endian = BFD_ENDIAN_UNKNOWN, \
(INFO).disassembler_options = NULL, \
(INFO).insn_info_valid = 0
#ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED __attribute__((unused))
#endif
/* from libbfd */
bfd_vma bfd_getl64 (const bfd_byte *addr);
bfd_vma bfd_getl32 (const bfd_byte *addr);
bfd_vma bfd_getb32 (const bfd_byte *addr);
bfd_vma bfd_getl16 (const bfd_byte *addr);
bfd_vma bfd_getb16 (const bfd_byte *addr);
typedef bool bfd_boolean;
#endif /* DISAS_DIS_ASM_H */
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2005-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
#include "guilib/DispResource.h"
#include "windowing/VideoSync.h"
#include <atomic>
class CWinSystemX11GLContext;
class CVideoSyncOML : public CVideoSync, IDispResource
{
public:
explicit CVideoSyncOML(void *clock, CWinSystemX11GLContext& winSystem) :
CVideoSync(clock), m_winSystem(winSystem) {};
bool Setup(PUPDATECLOCK func) override;
void Run(CEvent& stopEvent) override;
void Cleanup() override;
float GetFps() override;
void OnResetDisplay() override;
private:
std::atomic_bool m_abort;
CWinSystemX11GLContext &m_winSystem;
};
|
{
"pile_set_name": "Github"
}
|
import Vue from 'vue'
import Main from './message.vue'
const MessageConstructor = Vue.extend(Main)
const typeList = ['info', 'success', 'warning', 'error']
const getMessageContainerElement = () => {
let el = document.body.querySelector('#message__container')
if (!el) {
el = document.createElement('div')
el.id = 'message__container'
document.body.appendChild(el)
}
return el
}
const Message = options => {
if (options === undefined) return
const opts =
typeof options === 'string' ? { type: 'info', message: options } : options
const vm = new MessageConstructor({
data: opts,
}).$mount()
const messageContainerElement = getMessageContainerElement()
messageContainerElement.appendChild(vm.$el)
vm.visible = true
return vm
}
typeList.forEach(type => {
Message[type] = options => {
const opts = typeof options === 'string' ? { message: options } : options
opts.type = type
return Message(opts)
}
})
export default Message
|
{
"pile_set_name": "Github"
}
|
# frozen_string_literal: true
module Gitlab
module Kubernetes
module Pod
PENDING = 'Pending'
RUNNING = 'Running'
SUCCEEDED = 'Succeeded'
FAILED = 'Failed'
UNKNOWN = 'Unknown'
PHASES = [PENDING, RUNNING, SUCCEEDED, FAILED, UNKNOWN].freeze
end
end
end
|
{
"pile_set_name": "Github"
}
|
#!/bin/sh
# PCP QA Test No. 943
# Exercise pmdaproc access permission checking.
#
# Copyright (c) 2013 Red Hat.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
_get_libpcp_config
$unix_domain_sockets || _notrun "No unix domain socket support available"
$authentication || _notrun "No authentication support available"
pminfo proc.nprocs >/dev/null 2>&1 || _notrun "proc PMDA not installed"
status=1 # failure is the default!
$sudo rm -rf $tmp.* $seq.full
trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
_filter_counts()
{
# special case these ones ...
# proc.psinfo.cgroups -61 No data available
# proc.psinfo.cgroups -12350 Metric not supported by this version of monitored application
# proc.psinfo.cpusallowed -12350 Metric not supported by this version of monitored application
# proc.psinfo.ngid -12350 Metric not supported by this version of monitored application
# then map any number of values to COUNT
#
sed \
-e '/proc.id.container/s/-61 No data available/1/' \
-e '/proc.id.container/s/-12350 .* application/1/' \
-e '/proc.psinfo.cgroups/s/-61 No data available/1/' \
-e '/proc.psinfo.cgroups/s/-12350 .* application/1/' \
-e '/proc.psinfo.cpusallowed/s/-12350 .* application/1/' \
-e '/proc.psinfo.ngid/s/-12350 .* application/1/' \
| $PCP_AWK_PROG '$2 >= 0 { $2 = "COUNT" } { print }' \
| LC_COLLATE=POSIX sort
}
# lists of metrics
unprivileged="proc.nprocs proc.runq"
privileged="proc.psinfo proc.memory proc.id proc.fd"
# notes:
# proc.schedstat not present in older nor newer kernels (farewell!)
# proc.io file permissions sometimes prevent reading after seteuid?
# debug: pminfo -L -K add,3,proc/pmda_proc.so,proc_init proc.io -f
# real QA test starts here
echo "== Check unprivileged metric access"
pmprobe -h localhost $unprivileged | _filter_counts
echo "== Check protected per-process metric fetches (expect errors)"
pmprobe -h localhost $privileged | _filter_counts
echo "== Check authentic per-process metric fetches (expect values)"
pmprobe -h unix: $privileged | _filter_counts
# success, all done
status=0
exit
|
{
"pile_set_name": "Github"
}
|
Ember.Application.initializer({
name: 'load-steps',
after: 'store',
initialize: function(container, application) {
var store = container.lookup('store:main');
var steps = {
"steps": [
{ id: 0, name: 'welcome', humanName: "Welcome to the Vault Interactive Tutorial!"},
{ id: 1, name: 'steps', humanName: "Step 1: Overview"},
{ id: 2, name: 'init', humanName: "Step 2: Initialize your Vault"},
{ id: 3, name: 'unseal', humanName: "Step 3: Unsealing your Vault"},
{ id: 4, name: 'auth', humanName: "Step 4: Authorize your requests"},
{ id: 5, name: 'secrets', humanName: "Step 6: Read and write secrets"},
{ id: 6, name: 'seal', humanName: "Step 7: Seal your Vault"},
{ id: 7, name: 'finish', humanName: "You're finished!"},
]
};
application.register('model:step', Demo.Step);
store.pushPayload('step', steps);
},
});
|
{
"pile_set_name": "Github"
}
|
{
"compilerOptions": {
"composite": true,
"declarationDir": "./dist",
"rootDir": "./src",
"tsBuildInfoFile": "./node_modules/.cache/tsc/tsconfig.embark-specialconfigs.tsbuildinfo"
},
"extends": "../../../tsconfig.base.json",
"include": [
"src/**/*"
],
"references": [
{
"path": "../../core/i18n"
},
{
"path": "../../utils/testing"
}
]
}
|
{
"pile_set_name": "Github"
}
|
// (C) Copyright Michael Glassford 2004.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#if !defined(BOOST_TLS_HOOKS_HPP)
#define BOOST_TLS_HOOKS_HPP
#include <boost/thread/detail/config.hpp>
#include <boost/config/abi_prefix.hpp>
#if defined(BOOST_THREAD_WIN32)
namespace boost
{
BOOST_THREAD_DECL void __cdecl on_process_enter(void);
//Function to be called when the exe or dll
//that uses Boost.Threads first starts
//or is first loaded.
//Should be called only before the first call to
//on_thread_enter().
//Called automatically by Boost.Threads when
//a method for doing so has been discovered.
//May be omitted; may be called multiple times.
BOOST_THREAD_DECL void __cdecl on_process_exit(void);
//Function to be called when the exe or dll
//that uses Boost.Threads first starts
//or is first loaded.
//Should be called only after the last call to
//on_exit_thread().
//Called automatically by Boost.Threads when
//a method for doing so has been discovered.
//Must not be omitted; may be called multiple times.
BOOST_THREAD_DECL void __cdecl on_thread_enter(void);
//Function to be called just after a thread starts
//in an exe or dll that uses Boost.Threads.
//Must be called in the context of the thread
//that is starting.
//Called automatically by Boost.Threads when
//a method for doing so has been discovered.
//May be omitted; may be called multiple times.
BOOST_THREAD_DECL void __cdecl on_thread_exit(void);
//Function to be called just be fore a thread ends
//in an exe or dll that uses Boost.Threads.
//Must be called in the context of the thread
//that is ending.
//Called automatically by Boost.Threads when
//a method for doing so has been discovered.
//Must not be omitted; may be called multiple times.
void tss_cleanup_implemented();
//Dummy function used both to detect whether tss cleanup
//cleanup has been implemented and to force
//it to be linked into the Boost.Threads library.
}
#endif //defined(BOOST_THREAD_WIN32)
#include <boost/config/abi_suffix.hpp>
#endif //!defined(BOOST_TLS_HOOKS_HPP)
|
{
"pile_set_name": "Github"
}
|
#include <unittest/unittest.h>
#include <thrust/swap.h>
#include <thrust/iterator/iterator_traits.h>
#include <thrust/iterator/retag.h>
#include <thrust/system/cpp/memory.h>
template<typename ForwardIterator1,
typename ForwardIterator2>
ForwardIterator2 swap_ranges(my_system &system,
ForwardIterator1,
ForwardIterator1,
ForwardIterator2 first2)
{
system.validate_dispatch();
return first2;
}
void TestSwapRangesDispatchExplicit()
{
thrust::device_vector<int> vec(1);
my_system sys(0);
thrust::swap_ranges(sys, vec.begin(), vec.begin(), vec.begin());
ASSERT_EQUAL(true, sys.is_valid());
}
DECLARE_UNITTEST(TestSwapRangesDispatchExplicit);
template<typename ForwardIterator1,
typename ForwardIterator2>
ForwardIterator2 swap_ranges(my_tag,
ForwardIterator1,
ForwardIterator1,
ForwardIterator2 first2)
{
*first2 = 13;
return first2;
}
void TestSwapRangesDispatchImplicit()
{
thrust::device_vector<int> vec(1);
thrust::swap_ranges(thrust::retag<my_tag>(vec.begin()),
thrust::retag<my_tag>(vec.begin()),
thrust::retag<my_tag>(vec.begin()));
ASSERT_EQUAL(13, vec.front());
}
DECLARE_UNITTEST(TestSwapRangesDispatchImplicit);
template <class Vector>
void TestSwapRangesSimple(void)
{
Vector v1(5);
v1[0] = 0; v1[1] = 1; v1[2] = 2; v1[3] = 3; v1[4] = 4;
Vector v2(5);
v2[0] = 5; v2[1] = 6; v2[2] = 7; v2[3] = 8; v2[4] = 9;
thrust::swap_ranges(v1.begin(), v1.end(), v2.begin());
ASSERT_EQUAL(v1[0], 5);
ASSERT_EQUAL(v1[1], 6);
ASSERT_EQUAL(v1[2], 7);
ASSERT_EQUAL(v1[3], 8);
ASSERT_EQUAL(v1[4], 9);
ASSERT_EQUAL(v2[0], 0);
ASSERT_EQUAL(v2[1], 1);
ASSERT_EQUAL(v2[2], 2);
ASSERT_EQUAL(v2[3], 3);
ASSERT_EQUAL(v2[4], 4);
}
DECLARE_VECTOR_UNITTEST(TestSwapRangesSimple);
template <typename T>
void TestSwapRanges(const size_t n)
{
thrust::host_vector<T> a1 = unittest::random_integers<T>(n);
thrust::host_vector<T> a2 = unittest::random_integers<T>(n);
thrust::host_vector<T> h1 = a1;
thrust::host_vector<T> h2 = a2;
thrust::device_vector<T> d1 = a1;
thrust::device_vector<T> d2 = a2;
thrust::swap_ranges(h1.begin(), h1.end(), h2.begin());
thrust::swap_ranges(d1.begin(), d1.end(), d2.begin());
ASSERT_EQUAL(h1, a2);
ASSERT_EQUAL(d1, a2);
ASSERT_EQUAL(h2, a1);
ASSERT_EQUAL(d2, a1);
}
DECLARE_VARIABLE_UNITTEST(TestSwapRanges);
#if (THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_OMP)
void TestSwapRangesForcedIterator(void)
{
thrust::device_vector<int> A(3, 0);
thrust::device_vector<int> B(3, 1);
thrust::swap_ranges(thrust::retag<thrust::cpp::tag>(A.begin()),
thrust::retag<thrust::cpp::tag>(A.end()),
thrust::retag<thrust::cpp::tag>(B.begin()));
ASSERT_EQUAL(A[0], 1);
ASSERT_EQUAL(A[1], 1);
ASSERT_EQUAL(A[2], 1);
ASSERT_EQUAL(B[0], 0);
ASSERT_EQUAL(B[1], 0);
ASSERT_EQUAL(B[2], 0);
}
DECLARE_UNITTEST(TestSwapRangesForcedIterator);
#endif
struct type_with_swap
{
inline __host__ __device__
type_with_swap()
: m_x(), m_swapped(false)
{}
inline __host__ __device__
type_with_swap(int x)
: m_x(x), m_swapped(false)
{}
inline __host__ __device__
type_with_swap(int x, bool s)
: m_x(x), m_swapped(s)
{}
inline __host__ __device__
type_with_swap(const type_with_swap &other)
: m_x(other.m_x), m_swapped(other.m_swapped)
{}
inline __host__ __device__
bool operator==(const type_with_swap &other) const
{
return m_x == other.m_x && m_swapped == other.m_swapped;
}
#if THRUST_CPP_DIALECT >= 2011
type_with_swap & operator=(const type_with_swap &) = default;
#endif
int m_x;
bool m_swapped;
};
inline __host__ __device__
void swap(type_with_swap &a, type_with_swap &b)
{
thrust::swap(a.m_x, b.m_x);
a.m_swapped = true;
b.m_swapped = true;
}
void TestSwapRangesUserSwap(void)
{
thrust::host_vector<type_with_swap> h_A(3, type_with_swap(0));
thrust::host_vector<type_with_swap> h_B(3, type_with_swap(1));
thrust::device_vector<type_with_swap> d_A = h_A;
thrust::device_vector<type_with_swap> d_B = h_B;
// check that nothing is yet swapped
type_with_swap ref = type_with_swap(0, false);
ASSERT_EQUAL_QUIET(ref, h_A[0]);
ASSERT_EQUAL_QUIET(ref, h_A[1]);
ASSERT_EQUAL_QUIET(ref, h_A[2]);
ASSERT_EQUAL_QUIET(ref, d_A[0]);
ASSERT_EQUAL_QUIET(ref, d_A[1]);
ASSERT_EQUAL_QUIET(ref, d_A[2]);
ref = type_with_swap(1, false);
ASSERT_EQUAL_QUIET(ref, h_B[0]);
ASSERT_EQUAL_QUIET(ref, h_B[1]);
ASSERT_EQUAL_QUIET(ref, h_B[2]);
ASSERT_EQUAL_QUIET(ref, d_B[0]);
ASSERT_EQUAL_QUIET(ref, d_B[1]);
ASSERT_EQUAL_QUIET(ref, d_B[2]);
// swap the ranges
thrust::swap_ranges(h_A.begin(), h_A.end(), h_B.begin());
thrust::swap_ranges(d_A.begin(), d_A.end(), d_B.begin());
// check that things were swapped
ref = type_with_swap(1, true);
ASSERT_EQUAL_QUIET(ref, h_A[0]);
ASSERT_EQUAL_QUIET(ref, h_A[1]);
ASSERT_EQUAL_QUIET(ref, h_A[2]);
ASSERT_EQUAL_QUIET(ref, d_A[0]);
ASSERT_EQUAL_QUIET(ref, d_A[1]);
ASSERT_EQUAL_QUIET(ref, d_A[2]);
ref = type_with_swap(0, true);
ASSERT_EQUAL_QUIET(ref, h_B[0]);
ASSERT_EQUAL_QUIET(ref, h_B[1]);
ASSERT_EQUAL_QUIET(ref, h_B[2]);
ASSERT_EQUAL_QUIET(ref, d_B[0]);
ASSERT_EQUAL_QUIET(ref, d_B[1]);
ASSERT_EQUAL_QUIET(ref, d_B[2]);
}
DECLARE_UNITTEST(TestSwapRangesUserSwap);
|
{
"pile_set_name": "Github"
}
|
from django.contrib import admin
from .models import Album, Song
admin.site.register(Album)
admin.site.register(Song)
|
{
"pile_set_name": "Github"
}
|
---
title: Copy, GetFromClipboard, GetText Methods, DataObject Object Example
keywords: fm20.chm5225163
f1_keywords:
- fm20.chm5225163
ms.prod: office
ms.assetid: 6be27a7e-58f2-5cad-5ed0-570520fd61f1
ms.date: 06/08/2017
---
# Copy, GetFromClipboard, GetText Methods, DataObject Object Example
The following example demonstrates data movement from a **TextBox** to the Clipboard, from the Clipboard to a **DataObject**, and from a **DataObject** into another **TextBox**. The **GetFromClipboard** method transfers the data from the Clipboard to a **DataObject**. The **Copy** and **GetText** methods are also used.
To use this example, copy this sample code to the Declarations portion of a form. Make sure that the form contains:
- Two **TextBox** controls named TextBox1 and TextBox2.
- A **CommandButton** named CommandButton1.
```vb
Dim MyData as DataObject
Private Sub CommandButton1_Click()
'Need to select text before copying it to Clipboard
TextBox1.SelStart = 0
TextBox1.SelLength = TextBox1.TextLength
TextBox1.Copy
MyData.GetFromClipboard
TextBox2.Text = MyData.GetText(1)
End Sub
Private Sub UserForm_Initialize()
Set MyData = New DataObject
TextBox1.Text = "Move this data to the " _
&; "Clipboard, to a DataObject, then to "
&; "TextBox2!"
End Sub
```
|
{
"pile_set_name": "Github"
}
|
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows.Input;
using GalaSoft.MvvmLight.Command;
using Plugin.Connectivity;
using TorneoPredicciones.Models;
using TorneoPredicciones.Services;
namespace TorneoPredicciones.ViewModels
{
public class PositionsViewModel : INotifyPropertyChanged
{
#region Events
public event PropertyChangedEventHandler PropertyChanged;
#endregion
#region Attributes
private readonly ApiService _apiService;
private readonly DataService _dataService;
private readonly DialogService _dialogService;
// private NavigationService navigationService;
private bool _isRefreshing ;
private readonly int _tournamentGroupId;
#endregion
#region Properties
public ObservableCollection<TournamentTeamItemViewModel> TournamentTeams { get; set; }
public bool IsRefreshing
{
set {
if (_isRefreshing != value)
{
_isRefreshing = value;
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs("IsRefreshing"));
}
}
}
get {
return _isRefreshing;
}
}
#endregion
#region Constructor
public PositionsViewModel(int tournamentGroupId)
{
//instance = this;
this._tournamentGroupId = tournamentGroupId;
_apiService = new ApiService();
_dialogService = new DialogService();
// navigationService = new NavigationService();
_dataService = new DataService();
TournamentTeams = new ObservableCollection<TournamentTeamItemViewModel>();
LoadTournamentTeams();
}
#endregion
#region Methods
private async void LoadTournamentTeams()
{
if (!CrossConnectivity.Current.IsConnected)
{
await _dialogService.ShowMessage("Error", "Check you internet connection.");
// await navigationService.Clear();
return;
}
var isReachable = await CrossConnectivity.Current.IsRemoteReachable("notasti.com");
if (!isReachable)
{
await _dialogService.ShowMessage("Error", "Check you internet connection.");
// await navigationService.Clear();
return;
}
_isRefreshing = true;
var parameters = _dataService.First<Parameter>(false);
var user = _dataService.First<User>(false);
var response = await _apiService.Get<TournamentTeam>(parameters.UrlBase, "/api", "/TournamentTeams",
user.TokenType, user.AccessToken,_tournamentGroupId);
if (!response.IsSuccess)
{
await _dialogService.ShowMessage("Error", response.Message);
// await navigationService.Clear();
return;
}
ReloadTournamentTeams((List<TournamentTeam>)response.Result);
}
private void ReloadTournamentTeams(List<TournamentTeam> tournamentTeams)
{
TournamentTeams.Clear();
foreach (var tournamentTeam in tournamentTeams)
{
TournamentTeams.Add(new TournamentTeamItemViewModel
{
AgainstGoals = tournamentTeam.AgainstGoals,
FavorGoals = tournamentTeam.FavorGoals,
MatchesLost = tournamentTeam.MatchesLost,
MatchesPlayed = tournamentTeam.MatchesPlayed,
MatchesTied = tournamentTeam.MatchesTied,
MatchesWon = tournamentTeam.MatchesWon,
Points = tournamentTeam.Points,
Position = tournamentTeam.Position,
Team = tournamentTeam.Team,
TeamId = tournamentTeam.TeamId,
TournamentGroupId = tournamentTeam.TournamentGroupId,
TournamentTeamId = tournamentTeam.TournamentTeamId,
});
}
}
#endregion
#region Commands
public ICommand RefreshCommand { get { return new RelayCommand(Refresh); } }
public void Refresh()
{
// IsRefreshing = true;
LoadTournamentTeams();
// IsRefreshing = false;
}
#endregion
}
}
|
{
"pile_set_name": "Github"
}
|
// -*- C++ -*-
//
// $Id: SPIPE_Stream.inl 88707 2010-01-25 18:49:25Z johnnyw $
#include "ace/OS_NS_sys_uio.h"
#include "ace/OS_NS_errno.h"
#include "ace/OS_NS_unistd.h"
#if defined (ACE_WIN32)
#include "ace/OS_NS_sys_socket.h"
#endif
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Create an ACE_SPIPE_Stream.
ACE_INLINE int
ACE_SPIPE_Stream::get_remote_addr (ACE_SPIPE_Addr &remote_sap) const
{
ACE_TRACE ("ACE_SPIPE_Stream::get_remote_addr");
remote_sap = this->remote_addr_;
return 0;
}
// Send exactly N bytes from BUF to this socket. Keeping trying until
// this many bytes are sent.
ACE_INLINE ssize_t
ACE_SPIPE_Stream::send_n (const void *buf, size_t n) const
{
ACE_TRACE ("ACE_SPIPE_Stream::send_n");
return ACE::write_n (this->get_handle (), buf, n);
}
// Receive exactly N bytes from this socket into BUF. Keep trying
// until this many bytes are received.
ACE_INLINE ssize_t
ACE_SPIPE_Stream::recv_n (void *buf, size_t n) const
{
ACE_TRACE ("ACE_SPIPE_Stream::recv_n");
return ACE::read_n (this->get_handle (), buf, n);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::send (const void *buf, size_t n) const
{
ACE_TRACE ("ACE_SPIPE_Stream::send");
return ACE_OS::write (this->get_handle (), (const char *) buf, n);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::recv (void *buf, size_t n) const
{
ACE_TRACE ("ACE_SPIPE_Stream::recv");
return ACE_OS::read (this->get_handle (), (char *) buf, n);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int flags) const
{
ACE_TRACE ("ACE_SPIPE_Stream::send");
return ACE_OS::putmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *flags) const
{
ACE_TRACE ("ACE_SPIPE_Stream::recv");
return ACE_OS::getmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, flags);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::send (const ACE_Str_Buf *cntl, const ACE_Str_Buf *data, int band, int flags) const
{
ACE_TRACE ("ACE_SPIPE_Stream::send");
return ACE_OS::putpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::recv (ACE_Str_Buf *cntl, ACE_Str_Buf *data, int *band, int *flags) const
{
ACE_TRACE ("ACE_SPIPE_Stream::recv");
return ACE_OS::getpmsg (this->get_handle (), (strbuf *) cntl, (strbuf *) data, band, flags);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::send (const iovec iov[], int n) const
{
ACE_TRACE ("ACE_SPIPE_Stream::send");
return ACE_OS::writev (this->get_handle (), iov, n);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::recv (iovec iov[], int n) const
{
ACE_TRACE ("ACE_SPIPE_Stream::recv");
return ACE_OS::readv (this->get_handle (), iov, n);
}
// This routine sends an open file descriptor to this socket.
ACE_INLINE int
ACE_SPIPE_Stream::send_handle (ACE_HANDLE handle) const
{
ACE_TRACE ("ACE_SPIPE_Stream::send_handle");
#if defined (ACE_HAS_STREAM_PIPES)
return ACE_OS::ioctl (this->get_handle (), I_SENDFD, (void *) handle);
#elif defined (ACE_WIN32) && \
(defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)) && \
!defined (ACE_HAS_WINCE) /* CE4 has WS2 but not WSADuplicateSocket */
DWORD procID;
WSAPROTOCOL_INFO protInfo;
ssize_t res = this->recv(&procID, sizeof(procID));
if (res != static_cast <ssize_t> (sizeof(procID)))
{
if(res != -1)
errno = ENXIO;
return -1;
}
if (::WSADuplicateSocket ((SOCKET)handle, procID, &protInfo) == -1)
{
ACE_OS::set_errno_to_wsa_last_error();
return -1;
}
res = this->send(&protInfo, sizeof(protInfo));
if (res != static_cast <ssize_t> (sizeof(protInfo)))
{
if(res != -1)
errno = ENXIO;
return -1;
}
// This is just for synchronization, we will ignore the data
res = this->recv(&procID, sizeof(procID));
if (res != static_cast <ssize_t> (sizeof(procID)))
{
if(res != -1)
errno = ENXIO;
return -1;
}
return 0;
#else
handle = handle;
ACE_NOTSUP_RETURN (-1);
#endif /* ACE_HAS_STREAM_PIPES */
}
// This file receives an open file descriptor from this socket.
ACE_INLINE int
ACE_SPIPE_Stream::recv_handle (ACE_HANDLE &handle) const
{
ACE_TRACE ("ACE_SPIPE_Stream::recv_handle");
#if defined (ACE_HAS_STREAM_PIPES)
strrecvfd recvfd;
if (ACE_OS::ioctl (this->get_handle (), I_RECVFD, (void *) &recvfd) == -1)
return -1;
else
{
handle = recvfd.fd;
return 0;
}
#elif defined (ACE_WIN32) && \
(defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0))
pid_t procID = ACE_OS::getpid();
WSAPROTOCOL_INFO protInfo;
ssize_t res = this->send(&procID, sizeof(procID));
if (res != static_cast <ssize_t> (sizeof(procID)))
{
if(res != -1)
errno = ENXIO;
return -1;
}
res = this->recv(&protInfo, sizeof(protInfo));
if (res != static_cast <ssize_t> (sizeof(protInfo)))
{
if(res != -1)
errno = ENXIO;
return -1;
}
handle = ACE_OS::socket (FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO,
&protInfo, 0, 0);
if (handle == ACE_INVALID_HANDLE)
{
return -1;
}
// Since it does not matter what the data is, just send something to
// synchronize the end of the exchange
res = this->send(&procID, sizeof(procID));
if (res != static_cast <ssize_t> (sizeof(procID)))
{
if(res != -1)
errno = ENXIO;
return -1;
}
return 0;
#else
handle = handle;
ACE_NOTSUP_RETURN (-1);
#endif /* ACE_HAS_STREAM_PIPES */
}
// This file receives an open file descriptor from this socket and
// also passes back the information about the address...
ACE_INLINE int
ACE_SPIPE_Stream::recv_handle (strrecvfd &recvfd) const
{
ACE_TRACE ("ACE_SPIPE_Stream::recv_handle");
#if defined (ACE_HAS_STREAM_PIPES)
return ACE_OS::ioctl (this->get_handle (), I_RECVFD, (void *) &recvfd);
#else
ACE_UNUSED_ARG (recvfd);
ACE_NOTSUP_RETURN (-1);
#endif /* ACE_HAS_STREAM_PIPES */
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::send (const void *buf, size_t n,
ACE_OVERLAPPED *overlapped) const
{
ACE_TRACE ("ACE_SPIPE_Stream::send");
return ACE_OS::write (this->get_handle (),
(const char *) buf, n,
overlapped);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::recv (void *buf, size_t n,
ACE_OVERLAPPED *overlapped) const
{
ACE_TRACE ("ACE_SPIPE_Stream::recv");
return ACE_OS::read (this->get_handle (),
(char *) buf, n,
overlapped);
}
ACE_INLINE ssize_t
ACE_SPIPE_Stream::sendv_n (const iovec iov[],
int n) const
{
ACE_TRACE ("ACE_SPIPE_Stream::sendv_n");
return ACE::writev_n (this->get_handle (),
iov,
n);
}
// Recv an n byte message from the Stream.
ACE_INLINE ssize_t
ACE_SPIPE_Stream::recvv_n (iovec iov[],
int n) const
{
ACE_TRACE ("ACE_SPIPE_Stream::recvv_n");
// @@ Carlos, can you please update this to call the
// new ACE::recvv_n() method that you write?
return ACE_OS::readv (this->get_handle (),
iov,
n);
}
// Send an <iovec> of size <n> to the Stream.
ACE_INLINE ssize_t
ACE_SPIPE_Stream::sendv (const iovec iov[],
int n) const
{
ACE_TRACE ("ACE_SPIPE_Stream::sendv");
return ACE_OS::writev (this->get_handle (),
iov,
n);
}
ACE_END_VERSIONED_NAMESPACE_DECL
|
{
"pile_set_name": "Github"
}
|
// Copyright 2007 Google 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.google.scrollview.ui;
import org.piccolo2d.nodes.PImage;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.xml.bind.DatatypeConverter;
/**
* The ScrollViewImageHandler is a helper class which takes care of image
* processing. It is used to construct an Image from the message-stream and
* basically consists of a number of utility functions to process the input
* stream.
*
* @author wanke@google.com
*/
public class SVImageHandler {
/* All methods are static, so we forbid to construct SVImageHandler objects */
private SVImageHandler() {
}
/**
* Reads size bytes from the stream in and interprets it as an image file,
* encoded as png, and then text-encoded as base 64, returning the decoded
* bitmap.
*
* @param size The size of the image file.
* @param in The input stream from which to read the bytes.
*/
public static PImage readImage(int size, BufferedReader in) {
char[] charbuffer = new char[size];
int numRead = 0;
while (numRead < size) {
int newRead = -1;
try {
newRead = in.read(charbuffer, numRead, size - numRead);
} catch (IOException e) {
System.out.println("Failed to read image data from socket:" + e.getMessage());
return null;
}
if (newRead < 0) {
return null;
}
numRead += newRead;
}
if (numRead != size) {
System.out.println("Failed to read image data from socket");
return null;
}
// Convert the character data to binary.
byte[] binarydata = DatatypeConverter.parseBase64Binary(new String(charbuffer));
// Convert the binary data to a byte stream and parse to image.
ByteArrayInputStream byteStream = new ByteArrayInputStream(binarydata);
try {
PImage img = new PImage(ImageIO.read(byteStream));
return img;
} catch (IOException e) {
System.out.println("Failed to decode image data from socket" + e.getMessage());
}
return null;
}
}
|
{
"pile_set_name": "Github"
}
|
// UVa820 Internet Bandwidth
// Rujia Liu
// 题意:给一个无向网络,求最大流
// 算法:规模不大,用EdmondsKarp算法即可。
#include<cstdio>
#include<cstring>
#include<queue>
#include<vector>
#include<algorithm>
using namespace std;
const int maxn = 100 + 10;
const int INF = 1000000000;
struct Edge {
int from, to, cap, flow;
Edge(int u, int v, int c, int f):from(u),to(v),cap(c),flow(f) {}
};
struct EdmondsKarp {
int n, m;
vector<Edge> edges; // 边数的两倍
vector<int> G[maxn]; // 邻接表,G[i][j]表示结点i的第j条边在e数组中的序号
int a[maxn]; // 当起点到i的可改进量
int p[maxn]; // 最短路树上p的入弧编号
void init(int n) {
for(int i = 0; i < n; i++) G[i].clear();
edges.clear();
}
void AddEdge(int from, int to, int cap) {
edges.push_back(Edge(from, to, cap, 0));
edges.push_back(Edge(to, from, 0, 0));
m = edges.size();
G[from].push_back(m-2);
G[to].push_back(m-1);
}
int Maxflow(int s, int t) {
int flow = 0;
for(;;) {
memset(a, 0, sizeof(a));
queue<int> Q;
Q.push(s);
a[s] = INF;
while(!Q.empty()) {
int x = Q.front(); Q.pop();
for(int i = 0; i < G[x].size(); i++) {
Edge& e = edges[G[x][i]];
if(!a[e.to] && e.cap > e.flow) {
p[e.to] = G[x][i];
a[e.to] = min(a[x], e.cap-e.flow);
Q.push(e.to);
}
}
if(a[t]) break;
}
if(!a[t]) break;
for(int u = t; u != s; u = edges[p[u]].from) {
edges[p[u]].flow += a[t];
edges[p[u]^1].flow -= a[t];
}
flow += a[t];
}
return flow;
}
};
EdmondsKarp g;
int main() {
int n, m, s, t, kase = 0;
while(scanf("%d%d%d%d", &n, &s, &t, &m) == 4 && n) {
g.init(n);
while(m--) {
int u, v, c;
scanf("%d%d%d", &u, &v, &c); u--; v--;
g.AddEdge(u, v, c);
g.AddEdge(v, u, c);
}
printf("Network %d\nThe bandwidth is %d.\n\n", ++kase, g.Maxflow(s-1, t-1));
}
return 0;
}
|
{
"pile_set_name": "Github"
}
|
/* -*- coding: utf-8 -*-
* ----------------------------------------------------------------------
* Copyright © 2012-2013, RedJack, LLC.
* All rights reserved.
*
* Please see the COPYING file in this distribution for license details.
* ----------------------------------------------------------------------
*/
#ifndef LIBCORK_CORK_MEMPOOL_H
#define LIBCORK_CORK_MEMPOOL_H
#include <libcork/config.h>
#include <libcork/core/api.h>
#include <libcork/core/attributes.h>
#include <libcork/core/callbacks.h>
#include <libcork/core/types.h>
#define CORK_MEMPOOL_DEFAULT_BLOCK_SIZE 4096
struct cork_mempool;
CORK_API struct cork_mempool *
cork_mempool_new_size_ex(size_t element_size, size_t block_size);
#define cork_mempool_new_size(element_size) \
(cork_mempool_new_size_ex \
((element_size), CORK_MEMPOOL_DEFAULT_BLOCK_SIZE))
#define cork_mempool_new_ex(type, block_size) \
(cork_mempool_new_size_ex(sizeof(type), (block_size)))
#define cork_mempool_new(type) \
(cork_mempool_new_size(sizeof(type)))
CORK_API void
cork_mempool_free(struct cork_mempool *mp);
CORK_API void
cork_mempool_set_callbacks(struct cork_mempool *mp,
void *user_data, cork_free_f free_user_data,
cork_init_f init_object,
cork_done_f done_object);
CORK_API void *
cork_mempool_new_object(struct cork_mempool *mp);
CORK_API void
cork_mempool_free_object(struct cork_mempool *mp, void *ptr);
#endif /* LIBCORK_CORK_MEMPOOL_H */
|
{
"pile_set_name": "Github"
}
|
/*
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
*/
import { Card } from "antd";
import { React } from "../../app-framework";
import { Icon } from "../../r_misc";
import { SITE_NAME, LIVE_DEMO_REQUEST } from "smc-util/theme";
export function HelpBox() {
return (
<Card
title={
<>
<Icon name="question-circle" /> Help
</>
}
>
<span style={{ color: "#666", fontSize: "11pt" }}>
<ul>
<li>
<a href={LIVE_DEMO_REQUEST} target={"_blank"} rel={"noopener"}>
Request a live demo <Icon name="external-link" />
</a>{" "}
(with a {SITE_NAME} specialist)
</li>
<li>
<a
href={"https://doc.cocalc.com/teaching-instructors.html"}
target={"_blank"}
rel={"noopener"}
>
Instructor Guide for using CoCalc for teaching{" "}
<Icon name="external-link" />
</a>
</li>
<li>
<a
href="http://www.beezers.org/blog/bb/2015/09/grading-in-sagemathcloud/"
target="_blank"
rel={"noopener"}
>
Grading courses <Icon name="external-link" />
</a>
</li>
<li>
<a
href="http://www.beezers.org/blog/bb/2016/01/pennies-a-day-for-sagemathcloud/"
target="_blank"
rel={"noopener"}
>
Course plans and teaching experiences{" "}
<Icon name="external-link" />
</a>
</li>
<li>
<a
href="http://blog.ouseful.info/2015/11/24/course-management-and-collaborative-jupyter-notebooks-via-sagemathcloud/"
target="_blank"
rel={"noopener"}
>
Course management and collaborative Jupyter Notebooks{" "}
<Icon name="external-link" />
</a>
</li>
</ul>
</span>
</Card>
);
}
|
{
"pile_set_name": "Github"
}
|
# Samsung pin control drivers
obj-$(CONFIG_PINCTRL_SAMSUNG) += pinctrl-samsung.o
obj-$(CONFIG_PINCTRL_EXYNOS) += pinctrl-exynos.o
obj-$(CONFIG_PINCTRL_EXYNOS5440) += pinctrl-exynos5440.o
obj-$(CONFIG_PINCTRL_S3C24XX) += pinctrl-s3c24xx.o
obj-$(CONFIG_PINCTRL_S3C64XX) += pinctrl-s3c64xx.o
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:spdx="http://spdx.org/rdf/terms#">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="sites/all/themes/cpstandard/favicon.ico" type="image/vnd.microsoft.icon" />
<title>BSD with attribution | Software Package Data Exchange (SPDX)</title>
<link rel="shortcut icon" href="sites/all/themes/cpstandard/favicon.ico" type="image/vnd.microsoft.icon" />
<link type="text/css" rel="stylesheet" media="all" href="sites/all/themes/cpstandard/css/style.css" />
<link type="text/css" rel="stylesheet" media="all" href="sites/all/themes/cpstandard/css/colors.css" />
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet" />
<!-- GOOGLE FONTS -->
<link href='//fonts.googleapis.com/css?family=Roboto:400,400italic,300,300italic,100italic,100,500,500italic,700,700italic,900,900italic' rel='stylesheet' type='text/css' />
<style type="text/css">
.page {
color: #58595b;
}
#header {
border-bottom: 3px solid #4597cb;
padding-bottom: 50px;
}
.breadcrumb {
margin-top: 25px;
}
#content-header h1 {
color: #58595b;
}
.page h2, h3, h4, h5 {
color: #4597cb;
}
.page h1 {
font-size: 2em;
}
.page h2 {
font-size: 1.5em;
}
a, a:visited, a:hover {
color: #4597cb;
}
#footer-copyright {
margin-top: 25px;
}
.replacable-license-text {
color: #CC0000;
}
.replacable-license-text p var {
color: #CC0000;
}
.optional-license-text {
color: #0000cc;
}
.optional-license-text p var {
color: #0000cc;
}
ul, ol, li {
margin: 10px 0 10px 0;
}
</style>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-3676394-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body typeof="spdx:License">
<div id="lf-header" class="collaborative-projects">
<div class="gray-diagonal">
<div class="container">
<a id="collaborative-projects-logo" href="http://collabprojects.linuxfoundation.org">Linux Foundation Collaborative Projects</a>
</div>
</div>
</div>
<div id="header">
<div id="header-inner">
<a href="/" title="Home" rel="home" id="logo">
<img src="https://spdx.org/sites/cpstandard/files/logo_spdx_250.png" alt="Home" />
</a>
<div id="name-and-slogan">
<div id="site-name">
<h1><a href="/" title="Home" rel="home">Software Package Data Exchange (SPDX)</a></h1>
</div>
</div>
</div>
</div> <!-- /header -->
<div id="highlighted">
<div class="region region-highlighted">
</div>
</div>
<div id="page" class="page">
<div class="breadcrumb"><a href="/">Home</a> » <a href="/licenses">Licenses</a></div>
<h1 property="dc:title">BSD with attribution</h1>
<div style="display:none;"><code property="spdx:deprecated">false</code></div>
<h2>Full name</h2>
<p style="margin-left: 20px;"><code property="spdx:name">BSD with attribution</code></p>
<h2>Short identifier</h2>
<p style="margin-left: 20px;"><code property="spdx:licenseId">BSD-3-Clause-Attribution</code></p>
<h2>Other web pages for this license</h2>
<div style="margin-left: 20px;">
<ul>
<li><a href="https://fedoraproject.org/wiki/Licensing/BSD_with_Attribution" rel="rdfs:seeAlso">https://fedoraproject.org/wiki/Licensing/BSD_with_Attribution</a></li>
</ul>
</div>
<div property="spdx:isOsiApproved" style="display: none;">false</div>
<h2 id="notes">Notes</h2>
<p style="margin-left: 20px;">None</p>
<h2 id="licenseText">Text</h2>
<div property="spdx:licenseText" class="license-text">
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met:</p>
<ul style="list-style:none">
<li>
<var class="replacable-license-text">1.</var>
Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
</li>
<li>
<var class="replacable-license-text">2.</var>
Redistributions in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other materials
provided with the distribution.
</li>
<li>
<var class="replacable-license-text">3.</var>
Neither the name of the copyright holder nor the names of its contributors may be used to
endorse or promote products derived from this software without specific prior written
permission.
</li>
<li>
<var class="replacable-license-text">4.</var>
Redistributions of any form whatsoever must retain the following acknowledgment: 'This
product includes software developed by the
<var class="replacable-license-text">"Universidad de Palermo, Argentina"
(http://www.palermo.edu/).'</var>
</li>
</ul>
<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
</div>
<h2 id="licenseHeader">Standard License Header</h2>
<div property="spdx:standardLicenseHeader" class="license-text">
<p style="font-style: italic">There is no standard license header for the license</p>
</div>
<div property="spdx:standardLicenseTemplate" style="display: none;">
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: <<var;name="bullet";original="1.";match=".{0,20}">> Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. <<var;name="bullet";original="2.";match=".{0,20}">> Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. <<var;name="bullet";original="3.";match=".{0,20}">> Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. <<var;name="bullet";original="4.";match=".{0,20}">> Redistributions of any form whatsoever must retain the following acknowledgment: 'This product includes software developed by the <<var;name="organization";original=""Universidad de Palermo, Argentina" (http://www.palermo.edu/).'";match=".+">> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</div>
</div> <!-- /page -->
<div class="collaborative-projects">
<div class="gray-diagonal">
<div class="container">
<div id="footer-copyright">
<p>© 2018 SPDX Workgroup a Linux Foundation Project. All Rights Reserved. </p>
<p>Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered <a href="http://www.linuxfoundation.org/programs/legal/trademark" title="Linux Mark Institute">trademark</a> of Linus Torvalds.</p>
<p>Please see our <a href="http://www.linuxfoundation.org/privacy">privacy policy</a> and <a href="http://www.linuxfoundation.org/terms">terms of use</a>.</p>
</div>
</div>
</div>
</div>
<div id="top-page-link">
<a href="#"><i class="fa fa-arrow-circle-up"></i><span>top of page</span></a>
</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP866.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
return codecs.charmap_decode(input,errors,decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input, final=False):
return codecs.charmap_encode(input,self.errors,encoding_map)[0]
class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input, final=False):
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
class StreamWriter(Codec,codecs.StreamWriter):
pass
class StreamReader(Codec,codecs.StreamReader):
pass
### encodings module API
def getregentry():
return codecs.CodecInfo(
name='cp866',
encode=Codec().encode,
decode=Codec().decode,
incrementalencoder=IncrementalEncoder,
incrementaldecoder=IncrementalDecoder,
streamreader=StreamReader,
streamwriter=StreamWriter,
)
### Decoding Map
decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
0x0080: 0x0410, # CYRILLIC CAPITAL LETTER A
0x0081: 0x0411, # CYRILLIC CAPITAL LETTER BE
0x0082: 0x0412, # CYRILLIC CAPITAL LETTER VE
0x0083: 0x0413, # CYRILLIC CAPITAL LETTER GHE
0x0084: 0x0414, # CYRILLIC CAPITAL LETTER DE
0x0085: 0x0415, # CYRILLIC CAPITAL LETTER IE
0x0086: 0x0416, # CYRILLIC CAPITAL LETTER ZHE
0x0087: 0x0417, # CYRILLIC CAPITAL LETTER ZE
0x0088: 0x0418, # CYRILLIC CAPITAL LETTER I
0x0089: 0x0419, # CYRILLIC CAPITAL LETTER SHORT I
0x008a: 0x041a, # CYRILLIC CAPITAL LETTER KA
0x008b: 0x041b, # CYRILLIC CAPITAL LETTER EL
0x008c: 0x041c, # CYRILLIC CAPITAL LETTER EM
0x008d: 0x041d, # CYRILLIC CAPITAL LETTER EN
0x008e: 0x041e, # CYRILLIC CAPITAL LETTER O
0x008f: 0x041f, # CYRILLIC CAPITAL LETTER PE
0x0090: 0x0420, # CYRILLIC CAPITAL LETTER ER
0x0091: 0x0421, # CYRILLIC CAPITAL LETTER ES
0x0092: 0x0422, # CYRILLIC CAPITAL LETTER TE
0x0093: 0x0423, # CYRILLIC CAPITAL LETTER U
0x0094: 0x0424, # CYRILLIC CAPITAL LETTER EF
0x0095: 0x0425, # CYRILLIC CAPITAL LETTER HA
0x0096: 0x0426, # CYRILLIC CAPITAL LETTER TSE
0x0097: 0x0427, # CYRILLIC CAPITAL LETTER CHE
0x0098: 0x0428, # CYRILLIC CAPITAL LETTER SHA
0x0099: 0x0429, # CYRILLIC CAPITAL LETTER SHCHA
0x009a: 0x042a, # CYRILLIC CAPITAL LETTER HARD SIGN
0x009b: 0x042b, # CYRILLIC CAPITAL LETTER YERU
0x009c: 0x042c, # CYRILLIC CAPITAL LETTER SOFT SIGN
0x009d: 0x042d, # CYRILLIC CAPITAL LETTER E
0x009e: 0x042e, # CYRILLIC CAPITAL LETTER YU
0x009f: 0x042f, # CYRILLIC CAPITAL LETTER YA
0x00a0: 0x0430, # CYRILLIC SMALL LETTER A
0x00a1: 0x0431, # CYRILLIC SMALL LETTER BE
0x00a2: 0x0432, # CYRILLIC SMALL LETTER VE
0x00a3: 0x0433, # CYRILLIC SMALL LETTER GHE
0x00a4: 0x0434, # CYRILLIC SMALL LETTER DE
0x00a5: 0x0435, # CYRILLIC SMALL LETTER IE
0x00a6: 0x0436, # CYRILLIC SMALL LETTER ZHE
0x00a7: 0x0437, # CYRILLIC SMALL LETTER ZE
0x00a8: 0x0438, # CYRILLIC SMALL LETTER I
0x00a9: 0x0439, # CYRILLIC SMALL LETTER SHORT I
0x00aa: 0x043a, # CYRILLIC SMALL LETTER KA
0x00ab: 0x043b, # CYRILLIC SMALL LETTER EL
0x00ac: 0x043c, # CYRILLIC SMALL LETTER EM
0x00ad: 0x043d, # CYRILLIC SMALL LETTER EN
0x00ae: 0x043e, # CYRILLIC SMALL LETTER O
0x00af: 0x043f, # CYRILLIC SMALL LETTER PE
0x00b0: 0x2591, # LIGHT SHADE
0x00b1: 0x2592, # MEDIUM SHADE
0x00b2: 0x2593, # DARK SHADE
0x00b3: 0x2502, # BOX DRAWINGS LIGHT VERTICAL
0x00b4: 0x2524, # BOX DRAWINGS LIGHT VERTICAL AND LEFT
0x00b5: 0x2561, # BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
0x00b6: 0x2562, # BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
0x00b7: 0x2556, # BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
0x00b8: 0x2555, # BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
0x00b9: 0x2563, # BOX DRAWINGS DOUBLE VERTICAL AND LEFT
0x00ba: 0x2551, # BOX DRAWINGS DOUBLE VERTICAL
0x00bb: 0x2557, # BOX DRAWINGS DOUBLE DOWN AND LEFT
0x00bc: 0x255d, # BOX DRAWINGS DOUBLE UP AND LEFT
0x00bd: 0x255c, # BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
0x00be: 0x255b, # BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
0x00bf: 0x2510, # BOX DRAWINGS LIGHT DOWN AND LEFT
0x00c0: 0x2514, # BOX DRAWINGS LIGHT UP AND RIGHT
0x00c1: 0x2534, # BOX DRAWINGS LIGHT UP AND HORIZONTAL
0x00c2: 0x252c, # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
0x00c3: 0x251c, # BOX DRAWINGS LIGHT VERTICAL AND RIGHT
0x00c4: 0x2500, # BOX DRAWINGS LIGHT HORIZONTAL
0x00c5: 0x253c, # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
0x00c6: 0x255e, # BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
0x00c7: 0x255f, # BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
0x00c8: 0x255a, # BOX DRAWINGS DOUBLE UP AND RIGHT
0x00c9: 0x2554, # BOX DRAWINGS DOUBLE DOWN AND RIGHT
0x00ca: 0x2569, # BOX DRAWINGS DOUBLE UP AND HORIZONTAL
0x00cb: 0x2566, # BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
0x00cc: 0x2560, # BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
0x00cd: 0x2550, # BOX DRAWINGS DOUBLE HORIZONTAL
0x00ce: 0x256c, # BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
0x00cf: 0x2567, # BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
0x00d0: 0x2568, # BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
0x00d1: 0x2564, # BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
0x00d2: 0x2565, # BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
0x00d3: 0x2559, # BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
0x00d4: 0x2558, # BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
0x00d5: 0x2552, # BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
0x00d6: 0x2553, # BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
0x00d7: 0x256b, # BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
0x00d8: 0x256a, # BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
0x00d9: 0x2518, # BOX DRAWINGS LIGHT UP AND LEFT
0x00da: 0x250c, # BOX DRAWINGS LIGHT DOWN AND RIGHT
0x00db: 0x2588, # FULL BLOCK
0x00dc: 0x2584, # LOWER HALF BLOCK
0x00dd: 0x258c, # LEFT HALF BLOCK
0x00de: 0x2590, # RIGHT HALF BLOCK
0x00df: 0x2580, # UPPER HALF BLOCK
0x00e0: 0x0440, # CYRILLIC SMALL LETTER ER
0x00e1: 0x0441, # CYRILLIC SMALL LETTER ES
0x00e2: 0x0442, # CYRILLIC SMALL LETTER TE
0x00e3: 0x0443, # CYRILLIC SMALL LETTER U
0x00e4: 0x0444, # CYRILLIC SMALL LETTER EF
0x00e5: 0x0445, # CYRILLIC SMALL LETTER HA
0x00e6: 0x0446, # CYRILLIC SMALL LETTER TSE
0x00e7: 0x0447, # CYRILLIC SMALL LETTER CHE
0x00e8: 0x0448, # CYRILLIC SMALL LETTER SHA
0x00e9: 0x0449, # CYRILLIC SMALL LETTER SHCHA
0x00ea: 0x044a, # CYRILLIC SMALL LETTER HARD SIGN
0x00eb: 0x044b, # CYRILLIC SMALL LETTER YERU
0x00ec: 0x044c, # CYRILLIC SMALL LETTER SOFT SIGN
0x00ed: 0x044d, # CYRILLIC SMALL LETTER E
0x00ee: 0x044e, # CYRILLIC SMALL LETTER YU
0x00ef: 0x044f, # CYRILLIC SMALL LETTER YA
0x00f0: 0x0401, # CYRILLIC CAPITAL LETTER IO
0x00f1: 0x0451, # CYRILLIC SMALL LETTER IO
0x00f2: 0x0404, # CYRILLIC CAPITAL LETTER UKRAINIAN IE
0x00f3: 0x0454, # CYRILLIC SMALL LETTER UKRAINIAN IE
0x00f4: 0x0407, # CYRILLIC CAPITAL LETTER YI
0x00f5: 0x0457, # CYRILLIC SMALL LETTER YI
0x00f6: 0x040e, # CYRILLIC CAPITAL LETTER SHORT U
0x00f7: 0x045e, # CYRILLIC SMALL LETTER SHORT U
0x00f8: 0x00b0, # DEGREE SIGN
0x00f9: 0x2219, # BULLET OPERATOR
0x00fa: 0x00b7, # MIDDLE DOT
0x00fb: 0x221a, # SQUARE ROOT
0x00fc: 0x2116, # NUMERO SIGN
0x00fd: 0x00a4, # CURRENCY SIGN
0x00fe: 0x25a0, # BLACK SQUARE
0x00ff: 0x00a0, # NO-BREAK SPACE
})
### Decoding Table
decoding_table = (
'\x00' # 0x0000 -> NULL
'\x01' # 0x0001 -> START OF HEADING
'\x02' # 0x0002 -> START OF TEXT
'\x03' # 0x0003 -> END OF TEXT
'\x04' # 0x0004 -> END OF TRANSMISSION
'\x05' # 0x0005 -> ENQUIRY
'\x06' # 0x0006 -> ACKNOWLEDGE
'\x07' # 0x0007 -> BELL
'\x08' # 0x0008 -> BACKSPACE
'\t' # 0x0009 -> HORIZONTAL TABULATION
'\n' # 0x000a -> LINE FEED
'\x0b' # 0x000b -> VERTICAL TABULATION
'\x0c' # 0x000c -> FORM FEED
'\r' # 0x000d -> CARRIAGE RETURN
'\x0e' # 0x000e -> SHIFT OUT
'\x0f' # 0x000f -> SHIFT IN
'\x10' # 0x0010 -> DATA LINK ESCAPE
'\x11' # 0x0011 -> DEVICE CONTROL ONE
'\x12' # 0x0012 -> DEVICE CONTROL TWO
'\x13' # 0x0013 -> DEVICE CONTROL THREE
'\x14' # 0x0014 -> DEVICE CONTROL FOUR
'\x15' # 0x0015 -> NEGATIVE ACKNOWLEDGE
'\x16' # 0x0016 -> SYNCHRONOUS IDLE
'\x17' # 0x0017 -> END OF TRANSMISSION BLOCK
'\x18' # 0x0018 -> CANCEL
'\x19' # 0x0019 -> END OF MEDIUM
'\x1a' # 0x001a -> SUBSTITUTE
'\x1b' # 0x001b -> ESCAPE
'\x1c' # 0x001c -> FILE SEPARATOR
'\x1d' # 0x001d -> GROUP SEPARATOR
'\x1e' # 0x001e -> RECORD SEPARATOR
'\x1f' # 0x001f -> UNIT SEPARATOR
' ' # 0x0020 -> SPACE
'!' # 0x0021 -> EXCLAMATION MARK
'"' # 0x0022 -> QUOTATION MARK
'#' # 0x0023 -> NUMBER SIGN
'$' # 0x0024 -> DOLLAR SIGN
'%' # 0x0025 -> PERCENT SIGN
'&' # 0x0026 -> AMPERSAND
"'" # 0x0027 -> APOSTROPHE
'(' # 0x0028 -> LEFT PARENTHESIS
')' # 0x0029 -> RIGHT PARENTHESIS
'*' # 0x002a -> ASTERISK
'+' # 0x002b -> PLUS SIGN
',' # 0x002c -> COMMA
'-' # 0x002d -> HYPHEN-MINUS
'.' # 0x002e -> FULL STOP
'/' # 0x002f -> SOLIDUS
'0' # 0x0030 -> DIGIT ZERO
'1' # 0x0031 -> DIGIT ONE
'2' # 0x0032 -> DIGIT TWO
'3' # 0x0033 -> DIGIT THREE
'4' # 0x0034 -> DIGIT FOUR
'5' # 0x0035 -> DIGIT FIVE
'6' # 0x0036 -> DIGIT SIX
'7' # 0x0037 -> DIGIT SEVEN
'8' # 0x0038 -> DIGIT EIGHT
'9' # 0x0039 -> DIGIT NINE
':' # 0x003a -> COLON
';' # 0x003b -> SEMICOLON
'<' # 0x003c -> LESS-THAN SIGN
'=' # 0x003d -> EQUALS SIGN
'>' # 0x003e -> GREATER-THAN SIGN
'?' # 0x003f -> QUESTION MARK
'@' # 0x0040 -> COMMERCIAL AT
'A' # 0x0041 -> LATIN CAPITAL LETTER A
'B' # 0x0042 -> LATIN CAPITAL LETTER B
'C' # 0x0043 -> LATIN CAPITAL LETTER C
'D' # 0x0044 -> LATIN CAPITAL LETTER D
'E' # 0x0045 -> LATIN CAPITAL LETTER E
'F' # 0x0046 -> LATIN CAPITAL LETTER F
'G' # 0x0047 -> LATIN CAPITAL LETTER G
'H' # 0x0048 -> LATIN CAPITAL LETTER H
'I' # 0x0049 -> LATIN CAPITAL LETTER I
'J' # 0x004a -> LATIN CAPITAL LETTER J
'K' # 0x004b -> LATIN CAPITAL LETTER K
'L' # 0x004c -> LATIN CAPITAL LETTER L
'M' # 0x004d -> LATIN CAPITAL LETTER M
'N' # 0x004e -> LATIN CAPITAL LETTER N
'O' # 0x004f -> LATIN CAPITAL LETTER O
'P' # 0x0050 -> LATIN CAPITAL LETTER P
'Q' # 0x0051 -> LATIN CAPITAL LETTER Q
'R' # 0x0052 -> LATIN CAPITAL LETTER R
'S' # 0x0053 -> LATIN CAPITAL LETTER S
'T' # 0x0054 -> LATIN CAPITAL LETTER T
'U' # 0x0055 -> LATIN CAPITAL LETTER U
'V' # 0x0056 -> LATIN CAPITAL LETTER V
'W' # 0x0057 -> LATIN CAPITAL LETTER W
'X' # 0x0058 -> LATIN CAPITAL LETTER X
'Y' # 0x0059 -> LATIN CAPITAL LETTER Y
'Z' # 0x005a -> LATIN CAPITAL LETTER Z
'[' # 0x005b -> LEFT SQUARE BRACKET
'\\' # 0x005c -> REVERSE SOLIDUS
']' # 0x005d -> RIGHT SQUARE BRACKET
'^' # 0x005e -> CIRCUMFLEX ACCENT
'_' # 0x005f -> LOW LINE
'`' # 0x0060 -> GRAVE ACCENT
'a' # 0x0061 -> LATIN SMALL LETTER A
'b' # 0x0062 -> LATIN SMALL LETTER B
'c' # 0x0063 -> LATIN SMALL LETTER C
'd' # 0x0064 -> LATIN SMALL LETTER D
'e' # 0x0065 -> LATIN SMALL LETTER E
'f' # 0x0066 -> LATIN SMALL LETTER F
'g' # 0x0067 -> LATIN SMALL LETTER G
'h' # 0x0068 -> LATIN SMALL LETTER H
'i' # 0x0069 -> LATIN SMALL LETTER I
'j' # 0x006a -> LATIN SMALL LETTER J
'k' # 0x006b -> LATIN SMALL LETTER K
'l' # 0x006c -> LATIN SMALL LETTER L
'm' # 0x006d -> LATIN SMALL LETTER M
'n' # 0x006e -> LATIN SMALL LETTER N
'o' # 0x006f -> LATIN SMALL LETTER O
'p' # 0x0070 -> LATIN SMALL LETTER P
'q' # 0x0071 -> LATIN SMALL LETTER Q
'r' # 0x0072 -> LATIN SMALL LETTER R
's' # 0x0073 -> LATIN SMALL LETTER S
't' # 0x0074 -> LATIN SMALL LETTER T
'u' # 0x0075 -> LATIN SMALL LETTER U
'v' # 0x0076 -> LATIN SMALL LETTER V
'w' # 0x0077 -> LATIN SMALL LETTER W
'x' # 0x0078 -> LATIN SMALL LETTER X
'y' # 0x0079 -> LATIN SMALL LETTER Y
'z' # 0x007a -> LATIN SMALL LETTER Z
'{' # 0x007b -> LEFT CURLY BRACKET
'|' # 0x007c -> VERTICAL LINE
'}' # 0x007d -> RIGHT CURLY BRACKET
'~' # 0x007e -> TILDE
'\x7f' # 0x007f -> DELETE
'\u0410' # 0x0080 -> CYRILLIC CAPITAL LETTER A
'\u0411' # 0x0081 -> CYRILLIC CAPITAL LETTER BE
'\u0412' # 0x0082 -> CYRILLIC CAPITAL LETTER VE
'\u0413' # 0x0083 -> CYRILLIC CAPITAL LETTER GHE
'\u0414' # 0x0084 -> CYRILLIC CAPITAL LETTER DE
'\u0415' # 0x0085 -> CYRILLIC CAPITAL LETTER IE
'\u0416' # 0x0086 -> CYRILLIC CAPITAL LETTER ZHE
'\u0417' # 0x0087 -> CYRILLIC CAPITAL LETTER ZE
'\u0418' # 0x0088 -> CYRILLIC CAPITAL LETTER I
'\u0419' # 0x0089 -> CYRILLIC CAPITAL LETTER SHORT I
'\u041a' # 0x008a -> CYRILLIC CAPITAL LETTER KA
'\u041b' # 0x008b -> CYRILLIC CAPITAL LETTER EL
'\u041c' # 0x008c -> CYRILLIC CAPITAL LETTER EM
'\u041d' # 0x008d -> CYRILLIC CAPITAL LETTER EN
'\u041e' # 0x008e -> CYRILLIC CAPITAL LETTER O
'\u041f' # 0x008f -> CYRILLIC CAPITAL LETTER PE
'\u0420' # 0x0090 -> CYRILLIC CAPITAL LETTER ER
'\u0421' # 0x0091 -> CYRILLIC CAPITAL LETTER ES
'\u0422' # 0x0092 -> CYRILLIC CAPITAL LETTER TE
'\u0423' # 0x0093 -> CYRILLIC CAPITAL LETTER U
'\u0424' # 0x0094 -> CYRILLIC CAPITAL LETTER EF
'\u0425' # 0x0095 -> CYRILLIC CAPITAL LETTER HA
'\u0426' # 0x0096 -> CYRILLIC CAPITAL LETTER TSE
'\u0427' # 0x0097 -> CYRILLIC CAPITAL LETTER CHE
'\u0428' # 0x0098 -> CYRILLIC CAPITAL LETTER SHA
'\u0429' # 0x0099 -> CYRILLIC CAPITAL LETTER SHCHA
'\u042a' # 0x009a -> CYRILLIC CAPITAL LETTER HARD SIGN
'\u042b' # 0x009b -> CYRILLIC CAPITAL LETTER YERU
'\u042c' # 0x009c -> CYRILLIC CAPITAL LETTER SOFT SIGN
'\u042d' # 0x009d -> CYRILLIC CAPITAL LETTER E
'\u042e' # 0x009e -> CYRILLIC CAPITAL LETTER YU
'\u042f' # 0x009f -> CYRILLIC CAPITAL LETTER YA
'\u0430' # 0x00a0 -> CYRILLIC SMALL LETTER A
'\u0431' # 0x00a1 -> CYRILLIC SMALL LETTER BE
'\u0432' # 0x00a2 -> CYRILLIC SMALL LETTER VE
'\u0433' # 0x00a3 -> CYRILLIC SMALL LETTER GHE
'\u0434' # 0x00a4 -> CYRILLIC SMALL LETTER DE
'\u0435' # 0x00a5 -> CYRILLIC SMALL LETTER IE
'\u0436' # 0x00a6 -> CYRILLIC SMALL LETTER ZHE
'\u0437' # 0x00a7 -> CYRILLIC SMALL LETTER ZE
'\u0438' # 0x00a8 -> CYRILLIC SMALL LETTER I
'\u0439' # 0x00a9 -> CYRILLIC SMALL LETTER SHORT I
'\u043a' # 0x00aa -> CYRILLIC SMALL LETTER KA
'\u043b' # 0x00ab -> CYRILLIC SMALL LETTER EL
'\u043c' # 0x00ac -> CYRILLIC SMALL LETTER EM
'\u043d' # 0x00ad -> CYRILLIC SMALL LETTER EN
'\u043e' # 0x00ae -> CYRILLIC SMALL LETTER O
'\u043f' # 0x00af -> CYRILLIC SMALL LETTER PE
'\u2591' # 0x00b0 -> LIGHT SHADE
'\u2592' # 0x00b1 -> MEDIUM SHADE
'\u2593' # 0x00b2 -> DARK SHADE
'\u2502' # 0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
'\u2524' # 0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
'\u2561' # 0x00b5 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
'\u2562' # 0x00b6 -> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
'\u2556' # 0x00b7 -> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
'\u2555' # 0x00b8 -> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
'\u2563' # 0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
'\u2551' # 0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
'\u2557' # 0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
'\u255d' # 0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
'\u255c' # 0x00bd -> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
'\u255b' # 0x00be -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
'\u2510' # 0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
'\u2514' # 0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
'\u2534' # 0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
'\u252c' # 0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
'\u251c' # 0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
'\u2500' # 0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
'\u253c' # 0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
'\u255e' # 0x00c6 -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
'\u255f' # 0x00c7 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
'\u255a' # 0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
'\u2554' # 0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
'\u2569' # 0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
'\u2566' # 0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
'\u2560' # 0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
'\u2550' # 0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
'\u256c' # 0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
'\u2567' # 0x00cf -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
'\u2568' # 0x00d0 -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
'\u2564' # 0x00d1 -> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
'\u2565' # 0x00d2 -> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
'\u2559' # 0x00d3 -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
'\u2558' # 0x00d4 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
'\u2552' # 0x00d5 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
'\u2553' # 0x00d6 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
'\u256b' # 0x00d7 -> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
'\u256a' # 0x00d8 -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
'\u2518' # 0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
'\u250c' # 0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
'\u2588' # 0x00db -> FULL BLOCK
'\u2584' # 0x00dc -> LOWER HALF BLOCK
'\u258c' # 0x00dd -> LEFT HALF BLOCK
'\u2590' # 0x00de -> RIGHT HALF BLOCK
'\u2580' # 0x00df -> UPPER HALF BLOCK
'\u0440' # 0x00e0 -> CYRILLIC SMALL LETTER ER
'\u0441' # 0x00e1 -> CYRILLIC SMALL LETTER ES
'\u0442' # 0x00e2 -> CYRILLIC SMALL LETTER TE
'\u0443' # 0x00e3 -> CYRILLIC SMALL LETTER U
'\u0444' # 0x00e4 -> CYRILLIC SMALL LETTER EF
'\u0445' # 0x00e5 -> CYRILLIC SMALL LETTER HA
'\u0446' # 0x00e6 -> CYRILLIC SMALL LETTER TSE
'\u0447' # 0x00e7 -> CYRILLIC SMALL LETTER CHE
'\u0448' # 0x00e8 -> CYRILLIC SMALL LETTER SHA
'\u0449' # 0x00e9 -> CYRILLIC SMALL LETTER SHCHA
'\u044a' # 0x00ea -> CYRILLIC SMALL LETTER HARD SIGN
'\u044b' # 0x00eb -> CYRILLIC SMALL LETTER YERU
'\u044c' # 0x00ec -> CYRILLIC SMALL LETTER SOFT SIGN
'\u044d' # 0x00ed -> CYRILLIC SMALL LETTER E
'\u044e' # 0x00ee -> CYRILLIC SMALL LETTER YU
'\u044f' # 0x00ef -> CYRILLIC SMALL LETTER YA
'\u0401' # 0x00f0 -> CYRILLIC CAPITAL LETTER IO
'\u0451' # 0x00f1 -> CYRILLIC SMALL LETTER IO
'\u0404' # 0x00f2 -> CYRILLIC CAPITAL LETTER UKRAINIAN IE
'\u0454' # 0x00f3 -> CYRILLIC SMALL LETTER UKRAINIAN IE
'\u0407' # 0x00f4 -> CYRILLIC CAPITAL LETTER YI
'\u0457' # 0x00f5 -> CYRILLIC SMALL LETTER YI
'\u040e' # 0x00f6 -> CYRILLIC CAPITAL LETTER SHORT U
'\u045e' # 0x00f7 -> CYRILLIC SMALL LETTER SHORT U
'\xb0' # 0x00f8 -> DEGREE SIGN
'\u2219' # 0x00f9 -> BULLET OPERATOR
'\xb7' # 0x00fa -> MIDDLE DOT
'\u221a' # 0x00fb -> SQUARE ROOT
'\u2116' # 0x00fc -> NUMERO SIGN
'\xa4' # 0x00fd -> CURRENCY SIGN
'\u25a0' # 0x00fe -> BLACK SQUARE
'\xa0' # 0x00ff -> NO-BREAK SPACE
)
### Encoding Map
encoding_map = {
0x0000: 0x0000, # NULL
0x0001: 0x0001, # START OF HEADING
0x0002: 0x0002, # START OF TEXT
0x0003: 0x0003, # END OF TEXT
0x0004: 0x0004, # END OF TRANSMISSION
0x0005: 0x0005, # ENQUIRY
0x0006: 0x0006, # ACKNOWLEDGE
0x0007: 0x0007, # BELL
0x0008: 0x0008, # BACKSPACE
0x0009: 0x0009, # HORIZONTAL TABULATION
0x000a: 0x000a, # LINE FEED
0x000b: 0x000b, # VERTICAL TABULATION
0x000c: 0x000c, # FORM FEED
0x000d: 0x000d, # CARRIAGE RETURN
0x000e: 0x000e, # SHIFT OUT
0x000f: 0x000f, # SHIFT IN
0x0010: 0x0010, # DATA LINK ESCAPE
0x0011: 0x0011, # DEVICE CONTROL ONE
0x0012: 0x0012, # DEVICE CONTROL TWO
0x0013: 0x0013, # DEVICE CONTROL THREE
0x0014: 0x0014, # DEVICE CONTROL FOUR
0x0015: 0x0015, # NEGATIVE ACKNOWLEDGE
0x0016: 0x0016, # SYNCHRONOUS IDLE
0x0017: 0x0017, # END OF TRANSMISSION BLOCK
0x0018: 0x0018, # CANCEL
0x0019: 0x0019, # END OF MEDIUM
0x001a: 0x001a, # SUBSTITUTE
0x001b: 0x001b, # ESCAPE
0x001c: 0x001c, # FILE SEPARATOR
0x001d: 0x001d, # GROUP SEPARATOR
0x001e: 0x001e, # RECORD SEPARATOR
0x001f: 0x001f, # UNIT SEPARATOR
0x0020: 0x0020, # SPACE
0x0021: 0x0021, # EXCLAMATION MARK
0x0022: 0x0022, # QUOTATION MARK
0x0023: 0x0023, # NUMBER SIGN
0x0024: 0x0024, # DOLLAR SIGN
0x0025: 0x0025, # PERCENT SIGN
0x0026: 0x0026, # AMPERSAND
0x0027: 0x0027, # APOSTROPHE
0x0028: 0x0028, # LEFT PARENTHESIS
0x0029: 0x0029, # RIGHT PARENTHESIS
0x002a: 0x002a, # ASTERISK
0x002b: 0x002b, # PLUS SIGN
0x002c: 0x002c, # COMMA
0x002d: 0x002d, # HYPHEN-MINUS
0x002e: 0x002e, # FULL STOP
0x002f: 0x002f, # SOLIDUS
0x0030: 0x0030, # DIGIT ZERO
0x0031: 0x0031, # DIGIT ONE
0x0032: 0x0032, # DIGIT TWO
0x0033: 0x0033, # DIGIT THREE
0x0034: 0x0034, # DIGIT FOUR
0x0035: 0x0035, # DIGIT FIVE
0x0036: 0x0036, # DIGIT SIX
0x0037: 0x0037, # DIGIT SEVEN
0x0038: 0x0038, # DIGIT EIGHT
0x0039: 0x0039, # DIGIT NINE
0x003a: 0x003a, # COLON
0x003b: 0x003b, # SEMICOLON
0x003c: 0x003c, # LESS-THAN SIGN
0x003d: 0x003d, # EQUALS SIGN
0x003e: 0x003e, # GREATER-THAN SIGN
0x003f: 0x003f, # QUESTION MARK
0x0040: 0x0040, # COMMERCIAL AT
0x0041: 0x0041, # LATIN CAPITAL LETTER A
0x0042: 0x0042, # LATIN CAPITAL LETTER B
0x0043: 0x0043, # LATIN CAPITAL LETTER C
0x0044: 0x0044, # LATIN CAPITAL LETTER D
0x0045: 0x0045, # LATIN CAPITAL LETTER E
0x0046: 0x0046, # LATIN CAPITAL LETTER F
0x0047: 0x0047, # LATIN CAPITAL LETTER G
0x0048: 0x0048, # LATIN CAPITAL LETTER H
0x0049: 0x0049, # LATIN CAPITAL LETTER I
0x004a: 0x004a, # LATIN CAPITAL LETTER J
0x004b: 0x004b, # LATIN CAPITAL LETTER K
0x004c: 0x004c, # LATIN CAPITAL LETTER L
0x004d: 0x004d, # LATIN CAPITAL LETTER M
0x004e: 0x004e, # LATIN CAPITAL LETTER N
0x004f: 0x004f, # LATIN CAPITAL LETTER O
0x0050: 0x0050, # LATIN CAPITAL LETTER P
0x0051: 0x0051, # LATIN CAPITAL LETTER Q
0x0052: 0x0052, # LATIN CAPITAL LETTER R
0x0053: 0x0053, # LATIN CAPITAL LETTER S
0x0054: 0x0054, # LATIN CAPITAL LETTER T
0x0055: 0x0055, # LATIN CAPITAL LETTER U
0x0056: 0x0056, # LATIN CAPITAL LETTER V
0x0057: 0x0057, # LATIN CAPITAL LETTER W
0x0058: 0x0058, # LATIN CAPITAL LETTER X
0x0059: 0x0059, # LATIN CAPITAL LETTER Y
0x005a: 0x005a, # LATIN CAPITAL LETTER Z
0x005b: 0x005b, # LEFT SQUARE BRACKET
0x005c: 0x005c, # REVERSE SOLIDUS
0x005d: 0x005d, # RIGHT SQUARE BRACKET
0x005e: 0x005e, # CIRCUMFLEX ACCENT
0x005f: 0x005f, # LOW LINE
0x0060: 0x0060, # GRAVE ACCENT
0x0061: 0x0061, # LATIN SMALL LETTER A
0x0062: 0x0062, # LATIN SMALL LETTER B
0x0063: 0x0063, # LATIN SMALL LETTER C
0x0064: 0x0064, # LATIN SMALL LETTER D
0x0065: 0x0065, # LATIN SMALL LETTER E
0x0066: 0x0066, # LATIN SMALL LETTER F
0x0067: 0x0067, # LATIN SMALL LETTER G
0x0068: 0x0068, # LATIN SMALL LETTER H
0x0069: 0x0069, # LATIN SMALL LETTER I
0x006a: 0x006a, # LATIN SMALL LETTER J
0x006b: 0x006b, # LATIN SMALL LETTER K
0x006c: 0x006c, # LATIN SMALL LETTER L
0x006d: 0x006d, # LATIN SMALL LETTER M
0x006e: 0x006e, # LATIN SMALL LETTER N
0x006f: 0x006f, # LATIN SMALL LETTER O
0x0070: 0x0070, # LATIN SMALL LETTER P
0x0071: 0x0071, # LATIN SMALL LETTER Q
0x0072: 0x0072, # LATIN SMALL LETTER R
0x0073: 0x0073, # LATIN SMALL LETTER S
0x0074: 0x0074, # LATIN SMALL LETTER T
0x0075: 0x0075, # LATIN SMALL LETTER U
0x0076: 0x0076, # LATIN SMALL LETTER V
0x0077: 0x0077, # LATIN SMALL LETTER W
0x0078: 0x0078, # LATIN SMALL LETTER X
0x0079: 0x0079, # LATIN SMALL LETTER Y
0x007a: 0x007a, # LATIN SMALL LETTER Z
0x007b: 0x007b, # LEFT CURLY BRACKET
0x007c: 0x007c, # VERTICAL LINE
0x007d: 0x007d, # RIGHT CURLY BRACKET
0x007e: 0x007e, # TILDE
0x007f: 0x007f, # DELETE
0x00a0: 0x00ff, # NO-BREAK SPACE
0x00a4: 0x00fd, # CURRENCY SIGN
0x00b0: 0x00f8, # DEGREE SIGN
0x00b7: 0x00fa, # MIDDLE DOT
0x0401: 0x00f0, # CYRILLIC CAPITAL LETTER IO
0x0404: 0x00f2, # CYRILLIC CAPITAL LETTER UKRAINIAN IE
0x0407: 0x00f4, # CYRILLIC CAPITAL LETTER YI
0x040e: 0x00f6, # CYRILLIC CAPITAL LETTER SHORT U
0x0410: 0x0080, # CYRILLIC CAPITAL LETTER A
0x0411: 0x0081, # CYRILLIC CAPITAL LETTER BE
0x0412: 0x0082, # CYRILLIC CAPITAL LETTER VE
0x0413: 0x0083, # CYRILLIC CAPITAL LETTER GHE
0x0414: 0x0084, # CYRILLIC CAPITAL LETTER DE
0x0415: 0x0085, # CYRILLIC CAPITAL LETTER IE
0x0416: 0x0086, # CYRILLIC CAPITAL LETTER ZHE
0x0417: 0x0087, # CYRILLIC CAPITAL LETTER ZE
0x0418: 0x0088, # CYRILLIC CAPITAL LETTER I
0x0419: 0x0089, # CYRILLIC CAPITAL LETTER SHORT I
0x041a: 0x008a, # CYRILLIC CAPITAL LETTER KA
0x041b: 0x008b, # CYRILLIC CAPITAL LETTER EL
0x041c: 0x008c, # CYRILLIC CAPITAL LETTER EM
0x041d: 0x008d, # CYRILLIC CAPITAL LETTER EN
0x041e: 0x008e, # CYRILLIC CAPITAL LETTER O
0x041f: 0x008f, # CYRILLIC CAPITAL LETTER PE
0x0420: 0x0090, # CYRILLIC CAPITAL LETTER ER
0x0421: 0x0091, # CYRILLIC CAPITAL LETTER ES
0x0422: 0x0092, # CYRILLIC CAPITAL LETTER TE
0x0423: 0x0093, # CYRILLIC CAPITAL LETTER U
0x0424: 0x0094, # CYRILLIC CAPITAL LETTER EF
0x0425: 0x0095, # CYRILLIC CAPITAL LETTER HA
0x0426: 0x0096, # CYRILLIC CAPITAL LETTER TSE
0x0427: 0x0097, # CYRILLIC CAPITAL LETTER CHE
0x0428: 0x0098, # CYRILLIC CAPITAL LETTER SHA
0x0429: 0x0099, # CYRILLIC CAPITAL LETTER SHCHA
0x042a: 0x009a, # CYRILLIC CAPITAL LETTER HARD SIGN
0x042b: 0x009b, # CYRILLIC CAPITAL LETTER YERU
0x042c: 0x009c, # CYRILLIC CAPITAL LETTER SOFT SIGN
0x042d: 0x009d, # CYRILLIC CAPITAL LETTER E
0x042e: 0x009e, # CYRILLIC CAPITAL LETTER YU
0x042f: 0x009f, # CYRILLIC CAPITAL LETTER YA
0x0430: 0x00a0, # CYRILLIC SMALL LETTER A
0x0431: 0x00a1, # CYRILLIC SMALL LETTER BE
0x0432: 0x00a2, # CYRILLIC SMALL LETTER VE
0x0433: 0x00a3, # CYRILLIC SMALL LETTER GHE
0x0434: 0x00a4, # CYRILLIC SMALL LETTER DE
0x0435: 0x00a5, # CYRILLIC SMALL LETTER IE
0x0436: 0x00a6, # CYRILLIC SMALL LETTER ZHE
0x0437: 0x00a7, # CYRILLIC SMALL LETTER ZE
0x0438: 0x00a8, # CYRILLIC SMALL LETTER I
0x0439: 0x00a9, # CYRILLIC SMALL LETTER SHORT I
0x043a: 0x00aa, # CYRILLIC SMALL LETTER KA
0x043b: 0x00ab, # CYRILLIC SMALL LETTER EL
0x043c: 0x00ac, # CYRILLIC SMALL LETTER EM
0x043d: 0x00ad, # CYRILLIC SMALL LETTER EN
0x043e: 0x00ae, # CYRILLIC SMALL LETTER O
0x043f: 0x00af, # CYRILLIC SMALL LETTER PE
0x0440: 0x00e0, # CYRILLIC SMALL LETTER ER
0x0441: 0x00e1, # CYRILLIC SMALL LETTER ES
0x0442: 0x00e2, # CYRILLIC SMALL LETTER TE
0x0443: 0x00e3, # CYRILLIC SMALL LETTER U
0x0444: 0x00e4, # CYRILLIC SMALL LETTER EF
0x0445: 0x00e5, # CYRILLIC SMALL LETTER HA
0x0446: 0x00e6, # CYRILLIC SMALL LETTER TSE
0x0447: 0x00e7, # CYRILLIC SMALL LETTER CHE
0x0448: 0x00e8, # CYRILLIC SMALL LETTER SHA
0x0449: 0x00e9, # CYRILLIC SMALL LETTER SHCHA
0x044a: 0x00ea, # CYRILLIC SMALL LETTER HARD SIGN
0x044b: 0x00eb, # CYRILLIC SMALL LETTER YERU
0x044c: 0x00ec, # CYRILLIC SMALL LETTER SOFT SIGN
0x044d: 0x00ed, # CYRILLIC SMALL LETTER E
0x044e: 0x00ee, # CYRILLIC SMALL LETTER YU
0x044f: 0x00ef, # CYRILLIC SMALL LETTER YA
0x0451: 0x00f1, # CYRILLIC SMALL LETTER IO
0x0454: 0x00f3, # CYRILLIC SMALL LETTER UKRAINIAN IE
0x0457: 0x00f5, # CYRILLIC SMALL LETTER YI
0x045e: 0x00f7, # CYRILLIC SMALL LETTER SHORT U
0x2116: 0x00fc, # NUMERO SIGN
0x2219: 0x00f9, # BULLET OPERATOR
0x221a: 0x00fb, # SQUARE ROOT
0x2500: 0x00c4, # BOX DRAWINGS LIGHT HORIZONTAL
0x2502: 0x00b3, # BOX DRAWINGS LIGHT VERTICAL
0x250c: 0x00da, # BOX DRAWINGS LIGHT DOWN AND RIGHT
0x2510: 0x00bf, # BOX DRAWINGS LIGHT DOWN AND LEFT
0x2514: 0x00c0, # BOX DRAWINGS LIGHT UP AND RIGHT
0x2518: 0x00d9, # BOX DRAWINGS LIGHT UP AND LEFT
0x251c: 0x00c3, # BOX DRAWINGS LIGHT VERTICAL AND RIGHT
0x2524: 0x00b4, # BOX DRAWINGS LIGHT VERTICAL AND LEFT
0x252c: 0x00c2, # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
0x2534: 0x00c1, # BOX DRAWINGS LIGHT UP AND HORIZONTAL
0x253c: 0x00c5, # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
0x2550: 0x00cd, # BOX DRAWINGS DOUBLE HORIZONTAL
0x2551: 0x00ba, # BOX DRAWINGS DOUBLE VERTICAL
0x2552: 0x00d5, # BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
0x2553: 0x00d6, # BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
0x2554: 0x00c9, # BOX DRAWINGS DOUBLE DOWN AND RIGHT
0x2555: 0x00b8, # BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
0x2556: 0x00b7, # BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
0x2557: 0x00bb, # BOX DRAWINGS DOUBLE DOWN AND LEFT
0x2558: 0x00d4, # BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
0x2559: 0x00d3, # BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
0x255a: 0x00c8, # BOX DRAWINGS DOUBLE UP AND RIGHT
0x255b: 0x00be, # BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
0x255c: 0x00bd, # BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
0x255d: 0x00bc, # BOX DRAWINGS DOUBLE UP AND LEFT
0x255e: 0x00c6, # BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
0x255f: 0x00c7, # BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
0x2560: 0x00cc, # BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
0x2561: 0x00b5, # BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
0x2562: 0x00b6, # BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
0x2563: 0x00b9, # BOX DRAWINGS DOUBLE VERTICAL AND LEFT
0x2564: 0x00d1, # BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
0x2565: 0x00d2, # BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
0x2566: 0x00cb, # BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
0x2567: 0x00cf, # BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
0x2568: 0x00d0, # BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
0x2569: 0x00ca, # BOX DRAWINGS DOUBLE UP AND HORIZONTAL
0x256a: 0x00d8, # BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
0x256b: 0x00d7, # BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
0x256c: 0x00ce, # BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
0x2580: 0x00df, # UPPER HALF BLOCK
0x2584: 0x00dc, # LOWER HALF BLOCK
0x2588: 0x00db, # FULL BLOCK
0x258c: 0x00dd, # LEFT HALF BLOCK
0x2590: 0x00de, # RIGHT HALF BLOCK
0x2591: 0x00b0, # LIGHT SHADE
0x2592: 0x00b1, # MEDIUM SHADE
0x2593: 0x00b2, # DARK SHADE
0x25a0: 0x00fe, # BLACK SQUARE
}
|
{
"pile_set_name": "Github"
}
|
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include "msm_fb.h"
#include "mipi_dsi.h"
#include "mipi_truly_tft540960_1_e.h"
static struct msm_panel_info pinfo;
static struct mipi_dsi_phy_ctrl dsi_video_mode_phy_db = {
/* DSI Bit Clock at 500 MHz, 2 lane, RGB888 */
/* regulator */
{0x03, 0x01, 0x01, 0x00},
/* timing */
{0xb9, 0x8e, 0x1f, 0x00, 0x98, 0x9c, 0x22, 0x90,
0x18, 0x03, 0x04},
/* phy ctrl */
{0x7f, 0x00, 0x00, 0x00},
/* strength */
{0xbb, 0x02, 0x06, 0x00},
/* pll control */
{0x00, 0xec, 0x31, 0xd2, 0x00, 0x40, 0x37, 0x62,
0x01, 0x0f, 0x07,
0x05, 0x14, 0x03, 0x0, 0x0, 0x0, 0x20, 0x0, 0x02, 0x0},
};
static int mipi_video_truly_qhd_pt_init(void)
{
int ret;
if (msm_fb_detect_client("mipi_video_truly_qhd"))
return 0;
pinfo.xres = 540;
pinfo.yres = 960;
pinfo.type = MIPI_VIDEO_PANEL;
pinfo.pdest = DISPLAY_1;
pinfo.wait_cycle = 0;
pinfo.bpp = 24;
pinfo.lcdc.h_back_porch = 100;
pinfo.lcdc.h_front_porch = 100;
pinfo.lcdc.h_pulse_width = 8;
pinfo.lcdc.v_back_porch = 20;
pinfo.lcdc.v_front_porch = 20;
pinfo.lcdc.v_pulse_width = 1;
pinfo.lcdc.border_clr = 0; /* blk */
pinfo.lcdc.underflow_clr = 0xff; /* blue */
/* number of dot_clk cycles HSYNC active edge
is delayed from VSYNC active edge */
pinfo.lcdc.hsync_skew = 0;
pinfo.clk_rate = 699000000;
pinfo.lcd.refx100 = 6000; /* FB driver calc FPS based on this value */
pinfo.bl_max = 255;
pinfo.bl_min = 1;
pinfo.fb_num = 2;
pinfo.mipi.mode = DSI_VIDEO_MODE;
/* send HSA and HE following VS/VE packet */
pinfo.mipi.pulse_mode_hsa_he = TRUE;
pinfo.mipi.hfp_power_stop = TRUE; /* LP-11 during the HFP period */
pinfo.mipi.hbp_power_stop = TRUE; /* LP-11 during the HBP period */
pinfo.mipi.hsa_power_stop = TRUE; /* LP-11 during the HSA period */
/* LP-11 or let Command Mode Engine send packets in
HS or LP mode for the BLLP of the last line of a frame */
pinfo.mipi.eof_bllp_power_stop = TRUE;
/* LP-11 or let Command Mode Engine send packets in
HS or LP mode for packets sent during BLLP period */
pinfo.mipi.bllp_power_stop = TRUE;
pinfo.mipi.traffic_mode = DSI_BURST_MODE;
pinfo.mipi.dst_format = DSI_VIDEO_DST_FORMAT_RGB888;
pinfo.mipi.vc = 0;
pinfo.mipi.rgb_swap = DSI_RGB_SWAP_RGB; /* RGB */
pinfo.mipi.data_lane0 = TRUE;
pinfo.mipi.data_lane1 = TRUE;
pinfo.mipi.t_clk_post = 0x20;
pinfo.mipi.t_clk_pre = 0x2f;
pinfo.mipi.stream = 0; /* dma_p */
pinfo.mipi.mdp_trigger = DSI_CMD_TRIGGER_NONE;
pinfo.mipi.dma_trigger = DSI_CMD_TRIGGER_SW;
pinfo.mipi.frame_rate = 60;
pinfo.mipi.dsi_phy_db = &dsi_video_mode_phy_db;
pinfo.mipi.dlane_swap = 0x01;
/* append EOT at the end of data burst */
pinfo.mipi.tx_eot_append = 0x01;
ret = mipi_truly_tft540960_1_e_device_register(&pinfo, MIPI_DSI_PRIM,
MIPI_DSI_PANEL_WVGA_PT);
if (ret)
pr_err("%s: failed to register device!\n", __func__);
return ret;
}
module_init(mipi_video_truly_qhd_pt_init);
|
{
"pile_set_name": "Github"
}
|
const appPaths = require('../app-paths')
const { fatal } = require('./logger')
module.exports = async function getApi(item) {
try {
const api = require(
require.resolve(`quasar/dist/api/${item}.json`, {
paths: [appPaths.appDir]
})
)
return {
api
}
}
catch (e) {}
const extensionJson = require('../app-extension/extension-json')
const extensions = Object.keys(extensionJson.getList())
if (extensions.length > 0) {
const Extension = require('../app-extension/Extension.js')
for (let ext of extensions) {
const instance = new Extension(ext)
const hooks = await instance.run({})
if (hooks.describeApi !== void 0 && hooks.describeApi[item]) {
const fs = require('fs')
const path = require('path')
let file
const {
callerPath,
relativePath
} = hooks.describeApi[item]
if (relativePath.charAt(0) === '~') {
try {
file = relativePath.slice(1)
file = require.resolve(
file, {
paths: [callerPath, appPaths.appDir]
}
)
}
catch (e) {
fatal(`Extension(${instance.extId}): registerDescribeApi - there is no package "${file}" installed`)
}
}
else {
file = path.resolve(callerPath, relativePath)
if (!fs.existsSync(file)) {
fatal(`Extension(${instance.extId}): registerDescribeApi - there is no file at ${file}`)
}
}
try {
return {
api: require(file),
supplier: instance.extId
}
}
catch (e) {
fatal(`Extension(${instance.extId}): Malformed API file at ${file}`)
}
}
}
}
fatal(`No API found for requested "${item}"\n`)
}
|
{
"pile_set_name": "Github"
}
|
[[template]]
src = "${REMCO_TEMPLATE_DIR}/plugin-s3-logstore.properties"
dst = "${REMCO_TMP_DIR}/framework/plugin-s3-logstore.properties"
mode = "0644"
|
{
"pile_set_name": "Github"
}
|
fileFormatVersion: 2
guid: 9e6a20494274d5045a1b36a770ea76b4
timeCreated: 1468669952
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html>
<head>
<title>Api Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap.min.css'/>
<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/prettify.css'/>
<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap-responsive.min.css'/>
<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/application.css'/>
<!-- IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="container-fluid">
<div class="row-fluid">
<div id='container'>
<ul class='breadcrumb'>
<li>
<a href='../../../apidoc/v2.ko.html'>Foreman v2</a>
<span class='divider'>/</span>
</li>
<li>
<a href='../../../apidoc/v2/subnets.ko.html'>
Subnets
</a>
<span class='divider'>/</span>
</li>
<li class='active'>create</li>
<li class='pull-right'>
[ <a href="../../../apidoc/v2/subnets/create.ca.html">ca</a> | <a href="../../../apidoc/v2/subnets/create.cs_CZ.html">cs_CZ</a> | <a href="../../../apidoc/v2/subnets/create.de.html">de</a> | <a href="../../../apidoc/v2/subnets/create.en.html">en</a> | <a href="../../../apidoc/v2/subnets/create.en_GB.html">en_GB</a> | <a href="../../../apidoc/v2/subnets/create.es.html">es</a> | <a href="../../../apidoc/v2/subnets/create.fr.html">fr</a> | <a href="../../../apidoc/v2/subnets/create.gl.html">gl</a> | <a href="../../../apidoc/v2/subnets/create.it.html">it</a> | <a href="../../../apidoc/v2/subnets/create.ja.html">ja</a> | <b><a href="../../../apidoc/v2/subnets/create.ko.html">ko</a></b> | <a href="../../../apidoc/v2/subnets/create.nl_NL.html">nl_NL</a> | <a href="../../../apidoc/v2/subnets/create.pl.html">pl</a> | <a href="../../../apidoc/v2/subnets/create.pt_BR.html">pt_BR</a> | <a href="../../../apidoc/v2/subnets/create.ru.html">ru</a> | <a href="../../../apidoc/v2/subnets/create.sv_SE.html">sv_SE</a> | <a href="../../../apidoc/v2/subnets/create.zh_CN.html">zh_CN</a> | <a href="../../../apidoc/v2/subnets/create.zh_TW.html">zh_TW</a> ]
</li>
</ul>
<div class='page-header'>
<h1>
POST /api/subnets
<br>
<small>서브넷 생성 </small>
</h1>
</div>
<div>
<h2><span class="translation_missing" title="translation missing: ko.apipie.examples">Examples</span></h2>
<pre class="prettyprint">POST /api/subnets
{
"subnet": {
"name": "QA2",
"network_type": "IPv6",
"network": "2001:db8::",
"mask": "ffff:ffff:ffff:ffff::",
"ipam": "None"
}
}
201
{
"network": "2001:db8::",
"network_type": "IPv6",
"cidr": 64,
"mask": "ffff:ffff:ffff:ffff::",
"priority": null,
"vlanid": null,
"mtu": 1500,
"gateway": null,
"dns_primary": null,
"dns_secondary": null,
"from": null,
"to": null,
"created_at": "2019-11-07 08:38:14 UTC",
"updated_at": "2019-11-07 08:38:14 UTC",
"ipam": "None",
"boot_mode": "DHCP",
"id": 1018350830,
"name": "QA2",
"description": null,
"network_address": "2001:db8::/64",
"dhcp_id": null,
"dhcp_name": null,
"tftp_id": null,
"tftp_name": null,
"httpboot_id": null,
"httpboot_name": null,
"dns_id": null,
"template_id": null,
"template_name": null,
"dhcp": null,
"tftp": null,
"httpboot": null,
"dns": null,
"template": null,
"domains": [],
"interfaces": [],
"parameters": [],
"locations": [],
"organizations": []
}</pre>
<h2><span class="translation_missing" title="translation missing: ko.apipie.params">Params</span></h2>
<table class='table'>
<thead>
<tr>
<th><span class="translation_missing" title="translation missing: ko.apipie.param_name">Param Name</span></th>
<th><span class="translation_missing" title="translation missing: ko.apipie.description">Description</span></th>
</tr>
</thead>
<tbody>
<tr style='background-color:rgb(255,255,255);'>
<td>
<strong>location_id </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
</small>
</td>
<td>
<p>Set the current location context for the request</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a Integer</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(255,255,255);'>
<td>
<strong>organization_id </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
</small>
</td>
<td>
<p>Set the current organization context for the request</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a Integer</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(255,255,255);'>
<td>
<strong>subnet </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.required">Required</span>
</small>
</td>
<td>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a Hash</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[name] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.required">Required</span>
</small>
</td>
<td>
<p>서브넷 이름</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a String</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[description] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>Subnet description</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a String</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[network_type] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>Type or protocol, IPv4 or IPv6, defaults to IPv4</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be one of: <code>IPv4</code>, <code>IPv6</code>.</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[network] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.required">Required</span>
</small>
</td>
<td>
<p>서브넷 네트워크</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a String</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[mask] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.required">Required</span>
</small>
</td>
<td>
<p>서브넷의 넷마스크</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a String</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[gateway] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>Subnet gateway</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a String</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[dns_primary] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>서브넷의 1차 DNS</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a String</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[dns_secondary] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>서브넷의 2차 DNS</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a String</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[ipam] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>이 서브넷의 IP 주소 자동 추천 모드입니다. 유효한 값은 “DHCP”, “내부 DB”, “없음”입니다</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a String</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[from] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>IP 자동 제안의 시작 IP 주소</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a String</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[to] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>IP 자동 제안의 종료 IP 주소</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a String</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[vlanid] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>서브넷의 VLAN ID</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a String</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[mtu] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>MTU for this subnet</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a Integer</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[domain_ids] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>서브넷이 포함된 도메인</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be an array of any type</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[dhcp_id] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>DHCP Proxy ID to use within this subnet</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a number.</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[tftp_id] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>TFTP Proxy ID to use within this subnet</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a number.</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[httpboot_id] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>HTTPBoot Proxy ID to use within this subnet</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a number.</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[dns_id] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>DNS Proxy ID to use within this subnet</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a number.</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[template_id] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>Template HTTP(S) Proxy ID to use within this subnet</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a number.</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[boot_mode] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>이 서브넷에 할당된 인터페이스의 기본 부팅 모드입니다. 유효한 값은 “고정”, “DHCP”입니다</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a String</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[subnet_parameters_attributes] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>매개 변수 (이름, 값)의 배열</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be an array of any type</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[location_ids] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>지정된 ID로 위치를 변경합니다</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be an array of any type</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>subnet[organization_ids] </strong><br>
<small>
<span class="translation_missing" title="translation missing: ko.apipie.optional">Optional</span>
, <span class="translation_missing" title="translation missing: ko.apipie.nil_allowed">Nil Allowed</span>
</small>
</td>
<td>
<p>지정된 ID로 조직을 변경합니다</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be an array of any type</p>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<hr>
<footer></footer>
</div>
<script type='text/javascript' src='../../../apidoc/javascripts/bundled/jquery.js'></script>
<script type='text/javascript' src='../../../apidoc/javascripts/bundled/bootstrap-collapse.js'></script>
<script type='text/javascript' src='../../../apidoc/javascripts/bundled/prettify.js'></script>
<script type='text/javascript' src='../../../apidoc/javascripts/apipie.js'></script>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file PhysicsListMessenger.hh
/// \brief Definition of the PhysicsListMessenger class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef PhysicsListMessenger_h
#define PhysicsListMessenger_h 1
#include "G4UImessenger.hh"
#include "globals.hh"
class PhysicsList;
class G4UIdirectory;
class G4UIcmdWithAString;
class G4UIcmdWithADoubleAndUnit;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
class PhysicsListMessenger: public G4UImessenger
{
public:
PhysicsListMessenger(PhysicsList* );
~PhysicsListMessenger();
virtual void SetNewValue(G4UIcommand*, G4String);
inline G4double GetMaxChargedStep() const { return fMaxChargedStep; }
private:
PhysicsList* fPhysicsList;
G4UIdirectory* fPhysDir;
G4UIcmdWithAString* fListCmd;
G4UIcmdWithADoubleAndUnit* fStepMaxCmd;
G4double fMaxChargedStep;
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#endif
|
{
"pile_set_name": "Github"
}
|
<%--
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
The contents of this file are subject to the terms
of the Common Development and Distribution License
(the License). You may not use this file except in
compliance with the License.
You can obtain a copy of the License at
https://opensso.dev.java.net/public/CDDLv1.0.html or
opensso/legal/CDDLv1.0.txt
See the License for the specific language governing
permission and limitations under the License.
When distributing Covered Code, include this CDDL
Header Notice in each file and include the License file
at opensso/legal/CDDLv1.0.txt.
If applicable, add the following below the CDDL Header,
with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
$Id: SubSchemaTypeSelect.jsp,v 1.2 2008/06/25 05:44:54 qcheng Exp $
--%>
<%@ page info="SubSchemaTypeSelect" language="java" %>
<%@taglib uri="/WEB-INF/jato.tld" prefix="jato" %>
<%@taglib uri="/WEB-INF/cc.tld" prefix="cc" %>
<jato:useViewBean
className="com.sun.identity.console.service.SubSchemaTypeSelectViewBean"
fireChildDisplayEvents="true" >
<cc:i18nbundle baseName="amConsole" id="amConsole"
locale="<%=((com.sun.identity.console.base.AMViewBeanBase)viewBean).getUserLocale()%>"/>
<cc:header name="hdrCommon" pageTitle="webconsole.title" bundleID="amConsole" copyrightYear="2004" fireDisplayEvents="true">
<cc:form name="SubSchemaTypeSelect" method="post" defaultCommandChild="/button1">
<script language="javascript">
function confirmLogout() {
return confirm("<cc:text name="txtLogout" defaultValue="masthead.logoutMessage" bundleID="amConsole"/>");
}
</script>
<cc:primarymasthead name="mhCommon" bundleID="amConsole" logoutOnClick="return confirmLogout();"/>
<cc:breadcrumbs name="breadCrumb" bundleID="amConsole" />
<table border="0" cellpadding="10" cellspacing="0" width="100%">
<tr>
<td>
<cc:alertinline name="ialertCommon" bundleID="amConsole" />
</td>
</tr>
</table>
<%-- PAGE CONTENT --------------------------------------------------------- --%>
<cc:pagetitle name="pgtitleTwoBtns" bundleID="amConsole" pageTitleText="page.title.services.sub.schema.select" showPageTitleSeparator="true" viewMenuLabel="" pageTitleHelpMessage="" showPageButtonsTop="true" showPageButtonsBottom="false" />
<cc:propertysheet name="propertyAttributes" bundleID="amConsole" />
</cc:form>
</cc:header>
</jato:useViewBean>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2017-2020. Nitrite 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
*
* 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.dizitart.no2.repository.data;
import lombok.Data;
import org.dizitart.no2.collection.Document;
import org.dizitart.no2.index.IndexType;
import org.dizitart.no2.mapper.Mappable;
import org.dizitart.no2.mapper.NitriteMapper;
import org.dizitart.no2.repository.annotations.Entity;
import org.dizitart.no2.repository.annotations.Id;
import org.dizitart.no2.repository.annotations.Index;
import java.util.Date;
import java.util.UUID;
/**
* @author Anindya Chatterjee
*/
@Data
@Entity(value = "MyPerson", indices = {
@Index(value = "name", type = IndexType.Fulltext),
@Index(value = "status", type = IndexType.NonUnique)
})
public class PersonEntity implements Mappable {
@Id
private String uuid;
private String name;
private String status;
private PersonEntity friend;
private Date dateCreated;
public PersonEntity() {
this.uuid = UUID.randomUUID().toString();
this.dateCreated = new Date();
}
public PersonEntity(String name) {
this.uuid = UUID.randomUUID().toString();
this.name = name;
this.dateCreated = new Date();
}
@Override
public Document write(NitriteMapper mapper) {
return Document.createDocument("uuid", uuid)
.put("name", name)
.put("status", status)
.put("friend", friend != null ? friend.write(mapper) : null)
.put("dateCreated", dateCreated);
}
@Override
public void read(NitriteMapper mapper, Document document) {
if (document != null) {
uuid = document.get("uuid", String.class);
name = document.get("name", String.class);
status = document.get("status", String.class);
dateCreated = document.get("dateCreated", Date.class);
friend = new PersonEntity();
friend.read(mapper, document.get("friend", Document.class));
}
}
}
|
{
"pile_set_name": "Github"
}
|
// @flow
import React, { Component } from 'react'
import { type ProgressState } from 'spunky'
import { FormattedMessage, IntlShape } from 'react-intl'
import QrCodeScanner from '../../components/QrCodeScanner'
import Button from '../../components/Button'
import PasswordInput from '../../components/Inputs/PasswordInput'
import LoginIcon from '../../assets/icons/login.svg'
import styles from '../Home/Home.scss'
import GridIcon from '../../assets/icons/grid.svg'
import Close from '../../assets/icons/close.svg'
type Props = {
loading: boolean,
loginNep2: Function,
cameraAvailable: boolean,
progress: ProgressState,
intl: IntlShape,
}
type State = {
encryptedWIF: string,
passphrase: string,
scannerActive: boolean,
}
export default class LoginNep2 extends Component<Props, State> {
state = {
encryptedWIF: '',
passphrase: '',
scannerActive: false,
}
toggleScanner = () => {
this.setState(prevState => ({ scannerActive: !prevState.scannerActive }))
}
render() {
const { loading, cameraAvailable, progress, intl } = this.props
const { encryptedWIF, passphrase, scannerActive } = this.state
return (
<div id="loginNep2" className={styles.flexContainer}>
<form onSubmit={this.handleSubmit}>
{scannerActive ? (
<React.Fragment>
<div className={styles.scannerContainer}>
<QrCodeScanner
callback={encryptedWIF =>
this.setState({ encryptedWIF, scannerActive: false })
}
callbackProgress={progress}
width="316"
height="178"
/>
</div>
<div className={styles.loginButtonRowScannerActive}>
<Button
id="scan-private-key-qr-button"
renderIcon={Close}
onClick={this.toggleScanner}
>
<FormattedMessage id="auth.cancel" />
</Button>
</div>
</React.Fragment>
) : (
<React.Fragment>
<div className={styles.inputMargin}>
<PasswordInput
placeholder={intl.formatMessage({
id: 'inputEncryptedPlaceholder',
})}
autoFocus
value={encryptedWIF}
disabled={loading}
onChange={e =>
this.setState({ encryptedWIF: e.target.value })
}
/>
</div>
<FormattedMessage id="inputPasswordPlaceholder">
{translaction => (
<PasswordInput
placeholder={translaction}
value={passphrase}
disabled={loading}
onChange={e =>
this.setState({ passphrase: e.target.value })
}
/>
)}
</FormattedMessage>
<div className={styles.loginButtonRow}>
<Button
id="scan-private-key-qr-button"
primary
renderIcon={GridIcon}
onClick={this.toggleScanner}
disabled={!cameraAvailable}
>
<FormattedMessage id="authScanQRButton" />
</Button>
<Button
id="loginButton"
primary
type="submit"
className={styles.loginButtonMargin}
renderIcon={LoginIcon}
disabled={loading || !this.isValid()}
shouldCenterButtonLabelText
>
<FormattedMessage id="authLogin" />
</Button>
</div>
</React.Fragment>
)}
</form>
</div>
)
}
handleSubmit = (event: Object) => {
const { loading, loginNep2 } = this.props
const { passphrase, encryptedWIF } = this.state
event.preventDefault()
if (!loading) {
loginNep2(passphrase, encryptedWIF)
}
}
isValid = () => this.state.encryptedWIF !== '' && this.state.passphrase !== ''
}
|
{
"pile_set_name": "Github"
}
|
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "tensorflow/core/lib/core/coding.h"
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/core/status_test_util.h"
#include "tensorflow/core/lib/hash/crc32c.h"
#include "tensorflow/core/lib/io/record_reader.h"
#include "tensorflow/core/lib/io/record_writer.h"
#include "tensorflow/core/lib/random/simple_philox.h"
#include "tensorflow/core/platform/env.h"
#include "tensorflow/core/platform/test.h"
namespace tensorflow {
namespace io {
// Construct a string of the specified length made out of the supplied
// partial string.
static string BigString(const string& partial_string, size_t n) {
string result;
while (result.size() < n) {
result.append(partial_string);
}
result.resize(n);
return result;
}
// Construct a string from a number
static string NumberString(int n) {
char buf[50];
snprintf(buf, sizeof(buf), "%d.", n);
return string(buf);
}
// Return a skewed potentially long string
static string RandomSkewedString(int i, random::SimplePhilox* rnd) {
return BigString(NumberString(i), rnd->Skewed(17));
}
class RecordioTest : public ::testing::Test {
private:
class StringDest : public WritableFile {
public:
string contents_;
Status Close() override { return Status::OK(); }
Status Flush() override { return Status::OK(); }
Status Sync() override { return Status::OK(); }
Status Append(const StringPiece& slice) override {
contents_.append(slice.data(), slice.size());
return Status::OK();
}
};
class StringSource : public RandomAccessFile {
public:
StringPiece contents_;
mutable bool force_error_;
mutable bool returned_partial_;
StringSource() : force_error_(false), returned_partial_(false) {}
Status Read(uint64 offset, size_t n, StringPiece* result,
char* scratch) const override {
EXPECT_FALSE(returned_partial_) << "must not Read() after eof/error";
if (force_error_) {
force_error_ = false;
returned_partial_ = true;
return errors::DataLoss("read error");
}
if (offset >= contents_.size()) {
return errors::OutOfRange("end of file");
}
if (contents_.size() < offset + n) {
n = contents_.size() - offset;
returned_partial_ = true;
}
*result = StringPiece(contents_.data() + offset, n);
return Status::OK();
}
};
StringDest dest_;
StringSource source_;
bool reading_;
uint64 readpos_;
RecordWriter* writer_;
RecordReader* reader_;
public:
RecordioTest()
: reading_(false),
readpos_(0),
writer_(new RecordWriter(&dest_)),
reader_(new RecordReader(&source_)) {}
~RecordioTest() override {
delete writer_;
delete reader_;
}
void Write(const string& msg) {
ASSERT_TRUE(!reading_) << "Write() after starting to read";
TF_ASSERT_OK(writer_->WriteRecord(StringPiece(msg)));
}
size_t WrittenBytes() const { return dest_.contents_.size(); }
string Read() {
if (!reading_) {
reading_ = true;
source_.contents_ = StringPiece(dest_.contents_);
}
string record;
Status s = reader_->ReadRecord(&readpos_, &record);
if (s.ok()) {
return record;
} else if (errors::IsOutOfRange(s)) {
return "EOF";
} else {
return s.ToString();
}
}
void IncrementByte(int offset, int delta) {
dest_.contents_[offset] += delta;
}
void SetByte(int offset, char new_byte) {
dest_.contents_[offset] = new_byte;
}
void ShrinkSize(int bytes) {
dest_.contents_.resize(dest_.contents_.size() - bytes);
}
void FixChecksum(int header_offset, int len) {
// Compute crc of type/len/data
uint32_t crc = crc32c::Value(&dest_.contents_[header_offset + 6], 1 + len);
crc = crc32c::Mask(crc);
core::EncodeFixed32(&dest_.contents_[header_offset], crc);
}
void ForceError() { source_.force_error_ = true; }
void StartReadingAt(uint64_t initial_offset) { readpos_ = initial_offset; }
void CheckOffsetPastEndReturnsNoRecords(uint64_t offset_past_end) {
Write("foo");
Write("bar");
Write(BigString("x", 10000));
reading_ = true;
source_.contents_ = StringPiece(dest_.contents_);
uint64 offset = WrittenBytes() + offset_past_end;
string record;
Status s = reader_->ReadRecord(&offset, &record);
ASSERT_TRUE(errors::IsOutOfRange(s)) << s;
}
};
TEST_F(RecordioTest, Empty) { ASSERT_EQ("EOF", Read()); }
TEST_F(RecordioTest, ReadWrite) {
Write("foo");
Write("bar");
Write("");
Write("xxxx");
ASSERT_EQ("foo", Read());
ASSERT_EQ("bar", Read());
ASSERT_EQ("", Read());
ASSERT_EQ("xxxx", Read());
ASSERT_EQ("EOF", Read());
ASSERT_EQ("EOF", Read()); // Make sure reads at eof work
}
TEST_F(RecordioTest, ManyRecords) {
for (int i = 0; i < 100000; i++) {
Write(NumberString(i));
}
for (int i = 0; i < 100000; i++) {
ASSERT_EQ(NumberString(i), Read());
}
ASSERT_EQ("EOF", Read());
}
TEST_F(RecordioTest, RandomRead) {
const int N = 500;
{
random::PhiloxRandom philox(301, 17);
random::SimplePhilox rnd(&philox);
for (int i = 0; i < N; i++) {
Write(RandomSkewedString(i, &rnd));
}
}
{
random::PhiloxRandom philox(301, 17);
random::SimplePhilox rnd(&philox);
for (int i = 0; i < N; i++) {
ASSERT_EQ(RandomSkewedString(i, &rnd), Read());
}
}
ASSERT_EQ("EOF", Read());
}
// Tests of all the error paths in log_reader.cc follow:
static void AssertHasSubstr(StringPiece s, StringPiece expected) {
EXPECT_TRUE(StringPiece(s).contains(expected)) << s << " does not contain "
<< expected;
}
TEST_F(RecordioTest, ReadError) {
Write("foo");
ForceError();
AssertHasSubstr(Read(), "Data loss");
}
TEST_F(RecordioTest, CorruptLength) {
Write("foo");
IncrementByte(6, 100);
AssertHasSubstr(Read(), "Data loss");
}
TEST_F(RecordioTest, CorruptLengthCrc) {
Write("foo");
IncrementByte(10, 100);
AssertHasSubstr(Read(), "Data loss");
}
TEST_F(RecordioTest, CorruptData) {
Write("foo");
IncrementByte(14, 10);
AssertHasSubstr(Read(), "Data loss");
}
TEST_F(RecordioTest, CorruptDataCrc) {
Write("foo");
IncrementByte(WrittenBytes() - 1, 10);
AssertHasSubstr(Read(), "Data loss");
}
TEST_F(RecordioTest, ReadEnd) { CheckOffsetPastEndReturnsNoRecords(0); }
TEST_F(RecordioTest, ReadPastEnd) { CheckOffsetPastEndReturnsNoRecords(5); }
} // namespace io
} // namespace tensorflow
|
{
"pile_set_name": "Github"
}
|
{
"images": [
{
"idiom": "universal"
},
{
"scale": "1x",
"idiom": "universal"
},
{
"scale": "2x",
"idiom": "universal"
},
{
"scale": "3x",
"idiom": "universal"
},
{
"idiom": "iphone"
},
{
"scale": "1x",
"idiom": "iphone"
},
{
"scale": "2x",
"idiom": "iphone"
},
{
"subtype": "retina4",
"scale": "2x",
"idiom": "iphone"
},
{
"scale": "3x",
"idiom": "iphone"
},
{
"idiom": "ipad"
},
{
"scale": "1x",
"idiom": "ipad"
},
{
"scale": "2x",
"idiom": "ipad"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2013 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
// with the distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --allow-natives-syntax
var a = {
compare_null: function(x) { return null != x; },
kaboom: function() {}
}
function crash(x) {
var b = a;
b.compare_null(x) && b.kaboom();
return "ok";
}
assertEquals("ok", crash(null));
assertEquals("ok", crash(null));
%OptimizeFunctionOnNextCall(crash);
// Used to throw: "TypeError: Cannot call method 'kaboom' of undefined".
assertEquals("ok", crash(1));
|
{
"pile_set_name": "Github"
}
|
go-radix [](https://travis-ci.org/armon/go-radix)
=========
Provides the `radix` package that implements a [radix tree](http://en.wikipedia.org/wiki/Radix_tree).
The package only provides a single `Tree` implementation, optimized for sparse nodes.
As a radix tree, it provides the following:
* O(k) operations. In many cases, this can be faster than a hash table since
the hash function is an O(k) operation, and hash tables have very poor cache locality.
* Minimum / Maximum value lookups
* Ordered iteration
For an immutable variant, see [go-immutable-radix](https://github.com/hashicorp/go-immutable-radix).
Documentation
=============
The full documentation is available on [Godoc](http://godoc.org/github.com/armon/go-radix).
Example
=======
Below is a simple example of usage
```go
// Create a tree
r := radix.New()
r.Insert("foo", 1)
r.Insert("bar", 2)
r.Insert("foobar", 2)
// Find the longest prefix match
m, _, _ := r.LongestPrefix("foozip")
if m != "foo" {
panic("should be foo")
}
```
|
{
"pile_set_name": "Github"
}
|
好奇心原文链接:[雪球_广告_好奇心日报-](https://www.qdaily.com/articles/57978.html)
WebArchive归档链接:[雪球_广告_好奇心日报-](http://web.archive.org/web/20190623194732/https://www.qdaily.com/articles/57978.html)

|
{
"pile_set_name": "Github"
}
|
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2009- Spyder Kernels Contributors
#
# Licensed under the terms of the MIT License
# (see spyder_kernels/__init__.py for details)
# -----------------------------------------------------------------------------
import sys
import os
if __name__ == '__main__':
# Remove the current working directory from sys.path for Python 3.7+
# because since that version it's added by default to sys.path when
# using 'python -m'.
if sys.version_info[0] == 3 and sys.version_info[1] >= 7:
cwd = os.getcwd()
if cwd in sys.path:
sys.path.remove(cwd)
from spyder_kernels.console import start
start.main()
|
{
"pile_set_name": "Github"
}
|
" A simple wiki plugin for Vim
"
" Maintainer: Karl Yngve Lervåg
" Email: karl.yngve@gmail.com
"
function! wiki#url#wiki#parse(url) abort " {{{1
let l:url = deepcopy(s:parser)
" Extract anchor
let l:anchors = split(a:url.stripped, '#', 1)
let l:url.anchor = len(l:anchors) > 1 ? join(l:anchors[1:], '#') : ''
let l:url.anchor = substitute(l:url.anchor, '#$', '', '')
" Parse the file path relative to wiki root
if empty(l:anchors[0])
let l:fname = fnamemodify(a:url.origin, ':p:t:r')
else
let l:fname = l:anchors[0]
\ . (l:anchors[0] =~# '/$' ? b:wiki.index_name : '')
endif
" Extract the full path
let l:url.path = l:fname[0] ==# '/'
\ ? wiki#get_root() . l:fname
\ : (empty(a:url.origin)
\ ? wiki#get_root()
\ : fnamemodify(a:url.origin, ':p:h')) . '/' . l:fname
let l:url.path = simplify(l:url.path)
let l:url.dir = fnamemodify(l:url.path, ':p:h')
" Determine the proper extension (if necessary)
let l:extensions = wiki#u#uniq_unsorted(
\ (exists('b:wiki.extension') ? [b:wiki.extension] : [])
\ + g:wiki_filetypes)
if index(l:extensions, fnamemodify(l:fname, ':e')) < 0
let l:path = l:url.path
let l:url.path .= '.' . l:extensions[0]
if !filereadable(l:url.path) && len(l:extensions) > 1
for l:ext in l:extensions[1:]
let l:newpath = l:path . '.' . l:ext
if filereadable(l:newpath)
let l:url.path = l:newpath
break
endif
endfor
endif
endif
return l:url
endfunction
" }}}1
let s:parser = {}
function! s:parser.open(...) abort dict " {{{1
let l:cmd = a:0 > 0 ? a:1 : 'edit'
" Check if dir exists
let l:dir = fnamemodify(self.path, ':p:h')
if !isdirectory(l:dir)
call mkdir(l:dir, 'p')
endif
" Open wiki file
let l:same_file = resolve(self.path) ==# resolve(expand('%:p'))
if !l:same_file
if !empty(self.origin)
\ && resolve(self.origin) ==# resolve(expand('%:p'))
let l:old_position = [expand('%:p'), getpos('.')]
elseif &filetype ==# 'wiki'
let l:old_position = [self.origin, []]
endif
execute l:cmd fnameescape(self.path)
if exists('l:old_position')
let b:wiki = get(b:, 'wiki', {})
call wiki#nav#add_to_stack(l:old_position)
endif
endif
" Go to anchor
if !empty(self.anchor)
" Manually add position to jumplist (necessary if we in same file)
if l:same_file
normal! m'
endif
call self.open_anchor()
endif
" Focus
if &foldenable
if l:same_file
normal! zv
else
normal! zx
endif
endif
if exists('#User#WikiLinkOpened')
doautocmd <nomodeline> User WikiLinkOpened
endif
endfunction
"}}}1
function! s:parser.open_anchor() abort dict " {{{1
let l:old_pos = getpos('.')
call cursor(1, 1)
for l:part in split(self.anchor, '#', 0)
let l:part = substitute(l:part, '[- ]', '[- ]', 'g')
let l:header = '^#\{1,6}\s*' . l:part . '\s*$'
let l:bold = wiki#rx#surrounded(l:part, '*')
if !(search(l:header, 'Wc') || search(l:bold, 'Wc'))
call setpos('.', l:old_pos)
break
endif
let l:old_pos = getpos('.')
endfor
endfunction
" }}}1
|
{
"pile_set_name": "Github"
}
|
/*
* AUTHOR:Yan Zhenjie
*
* DESCRIPTION:create the File, and add the content.
*
* Copyright © www.mamaqunaer.com. All Rights Reserved
*
*/
package com.yanzhenjie.nohttp.sample.http;
import com.yanzhenjie.nohttp.RequestMethod;
/**
* <p>请求String。</p>
* Created by Yan Zhenjie on 2016/11/16.
*/
public class StringRequest extends AbstractRequest<String> {
public StringRequest(String url, RequestMethod requestMethod) {
super(url, requestMethod);
}
@Override
protected String parseEntity(String responseBody) throws Throwable {
return responseBody;
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_tab" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="horizontal" >
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:textColor="#fff"
android:textStyle="bold" />
</LinearLayout>
</FrameLayout>
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>Introduction_to_Algorithms: src/string_matching_algorithms/kmp_match Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
$(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Introduction_to_Algorithms
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('dir_f901912d53098349b2b404fe3b20acc5.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">kmp_match Directory Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
Files</h2></td></tr>
<tr class="memitem:kmp_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="kmp_8h.html">kmp.h</a> <a href="kmp_8h_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:kmp__test_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="kmp__test_8h.html">kmp_test.h</a> <a href="kmp__test_8h_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_8ed9dba4cd616b67da9b1338594e34e0.html">src</a></li><li class="navelem"><a class="el" href="dir_f4a7ab032f7e09156dc21182a68c14c9.html">string_matching_algorithms</a></li><li class="navelem"><a class="el" href="dir_f901912d53098349b2b404fe3b20acc5.html">kmp_match</a></li>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.10 </li>
</ul>
</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.internal.module;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.module.ModuleDescriptor;
import java.nio.ByteBuffer;
import java.util.Map;
import java.util.stream.Stream;
import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.ModuleVisitor;
import jdk.internal.org.objectweb.asm.Opcodes;
import jdk.internal.org.objectweb.asm.commons.ModuleTargetAttribute;
import static jdk.internal.org.objectweb.asm.Opcodes.*;
/**
* Utility class to write a ModuleDescriptor as a module-info.class.
*/
public final class ModuleInfoWriter {
private static final Map<ModuleDescriptor.Modifier, Integer>
MODULE_MODS_TO_FLAGS = Map.of(
ModuleDescriptor.Modifier.OPEN, ACC_OPEN,
ModuleDescriptor.Modifier.SYNTHETIC, ACC_SYNTHETIC,
ModuleDescriptor.Modifier.MANDATED, ACC_MANDATED
);
private static final Map<ModuleDescriptor.Requires.Modifier, Integer>
REQUIRES_MODS_TO_FLAGS = Map.of(
ModuleDescriptor.Requires.Modifier.TRANSITIVE, ACC_TRANSITIVE,
ModuleDescriptor.Requires.Modifier.STATIC, ACC_STATIC_PHASE,
ModuleDescriptor.Requires.Modifier.SYNTHETIC, ACC_SYNTHETIC,
ModuleDescriptor.Requires.Modifier.MANDATED, ACC_MANDATED
);
private static final Map<ModuleDescriptor.Exports.Modifier, Integer>
EXPORTS_MODS_TO_FLAGS = Map.of(
ModuleDescriptor.Exports.Modifier.SYNTHETIC, ACC_SYNTHETIC,
ModuleDescriptor.Exports.Modifier.MANDATED, ACC_MANDATED
);
private static final Map<ModuleDescriptor.Opens.Modifier, Integer>
OPENS_MODS_TO_FLAGS = Map.of(
ModuleDescriptor.Opens.Modifier.SYNTHETIC, ACC_SYNTHETIC,
ModuleDescriptor.Opens.Modifier.MANDATED, ACC_MANDATED
);
private static final String[] EMPTY_STRING_ARRAY = new String[0];
private ModuleInfoWriter() { }
/**
* Writes the given module descriptor to a module-info.class file,
* returning it in a byte array.
*/
private static byte[] toModuleInfo(ModuleDescriptor md, ModuleTarget target) {
ClassWriter cw = new ClassWriter(0);
cw.visit(Opcodes.V10, ACC_MODULE, "module-info", null, null, null);
int moduleFlags = md.modifiers().stream()
.map(MODULE_MODS_TO_FLAGS::get)
.reduce(0, (x, y) -> (x | y));
String vs = md.rawVersion().orElse(null);
ModuleVisitor mv = cw.visitModule(md.name(), moduleFlags, vs);
// requires
for (ModuleDescriptor.Requires r : md.requires()) {
int flags = r.modifiers().stream()
.map(REQUIRES_MODS_TO_FLAGS::get)
.reduce(0, (x, y) -> (x | y));
vs = r.rawCompiledVersion().orElse(null);
mv.visitRequire(r.name(), flags, vs);
}
// exports
for (ModuleDescriptor.Exports e : md.exports()) {
int flags = e.modifiers().stream()
.map(EXPORTS_MODS_TO_FLAGS::get)
.reduce(0, (x, y) -> (x | y));
String[] targets = e.targets().toArray(EMPTY_STRING_ARRAY);
mv.visitExport(e.source().replace('.', '/'), flags, targets);
}
// opens
for (ModuleDescriptor.Opens opens : md.opens()) {
int flags = opens.modifiers().stream()
.map(OPENS_MODS_TO_FLAGS::get)
.reduce(0, (x, y) -> (x | y));
String[] targets = opens.targets().toArray(EMPTY_STRING_ARRAY);
mv.visitOpen(opens.source().replace('.', '/'), flags, targets);
}
// uses
md.uses().stream().map(sn -> sn.replace('.', '/')).forEach(mv::visitUse);
// provides
for (ModuleDescriptor.Provides p : md.provides()) {
mv.visitProvide(p.service().replace('.', '/'),
p.providers()
.stream()
.map(pn -> pn.replace('.', '/'))
.toArray(String[]::new));
}
// add the ModulePackages attribute when there are packages that aren't
// exported or open
Stream<String> exported = md.exports().stream()
.map(ModuleDescriptor.Exports::source);
Stream<String> open = md.opens().stream()
.map(ModuleDescriptor.Opens::source);
long exportedOrOpen = Stream.concat(exported, open).distinct().count();
if (md.packages().size() > exportedOrOpen) {
md.packages().stream()
.map(pn -> pn.replace('.', '/'))
.forEach(mv::visitPackage);
}
// ModuleMainClass attribute
md.mainClass()
.map(mc -> mc.replace('.', '/'))
.ifPresent(mv::visitMainClass);
mv.visitEnd();
// write ModuleTarget attribute if there is a target platform
if (target != null && target.targetPlatform().length() > 0) {
cw.visitAttribute(new ModuleTargetAttribute(target.targetPlatform()));
}
cw.visitEnd();
return cw.toByteArray();
}
/**
* Writes a module descriptor to the given output stream as a
* module-info.class.
*/
public static void write(ModuleDescriptor descriptor,
ModuleTarget target,
OutputStream out)
throws IOException
{
byte[] bytes = toModuleInfo(descriptor, target);
out.write(bytes);
}
/**
* Writes a module descriptor to the given output stream as a
* module-info.class.
*/
public static void write(ModuleDescriptor descriptor, OutputStream out)
throws IOException
{
write(descriptor, null, out);
}
/**
* Returns a {@code ByteBuffer} containing the given module descriptor
* in module-info.class format.
*/
public static ByteBuffer toByteBuffer(ModuleDescriptor descriptor) {
byte[] bytes = toModuleInfo(descriptor, null);
return ByteBuffer.wrap(bytes);
}
}
|
{
"pile_set_name": "Github"
}
|
# Title

The Title component is a block element with a bold weight.
## How to use
```json
"title": {
"prototype": "digit/ui/title.reel",
"properties": {
"element": {"#": "title"}
}
}
```
```html
<h3 data-montage-id="title"></h3>
```
## Available properties
* `value` - The text of the Title component.
## Customizing with CSS
* `.digit-Title` - The Title element
```css
.digit-Title {
color: red;
}
```
## Browser support
* Chrome (latest)
* Firefox (latest)
* Opera (latest)
* IE 10+
* Safari 7+
|
{
"pile_set_name": "Github"
}
|
# 自定义spine边界
使用自定义边界来限制脊椎范围的spine演示。

```python
import numpy as np
import matplotlib.pyplot as plt
# Fixing random state for reproducibility
np.random.seed(19680801)
x = np.linspace(0, 2*np.pi, 50)
y = np.sin(x)
y2 = y + 0.1 * np.random.normal(size=x.shape)
fig, ax = plt.subplots()
ax.plot(x, y, 'k--')
ax.plot(x, y2, 'ro')
# set ticks and tick labels
ax.set_xlim((0, 2*np.pi))
ax.set_xticks([0, np.pi, 2*np.pi])
ax.set_xticklabels(['0', r'$\pi$', r'2$\pi$'])
ax.set_ylim((-1.5, 1.5))
ax.set_yticks([-1, 0, 1])
# Only draw spine between the y-ticks
ax.spines['left'].set_bounds(-1, 1)
# Hide the right and top spines
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
# Only show ticks on the left and bottom spines
ax.yaxis.set_ticks_position('left')
ax.xaxis.set_ticks_position('bottom')
plt.show()
```
## 下载这个示例
- [下载python源码: spines_bounds.py](https://matplotlib.org/_downloads/spines_bounds.py)
- [下载Jupyter notebook: spines_bounds.ipynb](https://matplotlib.org/_downloads/spines_bounds.ipynb)
|
{
"pile_set_name": "Github"
}
|
/* ====================================================================
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
* ====================================================================
*/
#include <apr_pools.h>
#include <apr_mmap.h>
#include "serf.h"
#include "serf_bucket_util.h"
#if APR_HAS_MMAP
typedef struct {
apr_mmap_t *mmap;
void *current;
apr_off_t offset;
apr_off_t remaining;
} mmap_context_t;
serf_bucket_t *serf_bucket_mmap_create(
apr_mmap_t *file_mmap,
serf_bucket_alloc_t *allocator)
{
mmap_context_t *ctx;
ctx = serf_bucket_mem_alloc(allocator, sizeof(*ctx));
ctx->mmap = file_mmap;
ctx->current = NULL;
ctx->offset = 0;
ctx->remaining = ctx->mmap->size;
return serf_bucket_create(&serf_bucket_type_mmap, allocator, ctx);
}
static apr_status_t serf_mmap_read(serf_bucket_t *bucket,
apr_size_t requested,
const char **data, apr_size_t *len)
{
mmap_context_t *ctx = bucket->data;
if (requested == SERF_READ_ALL_AVAIL || requested > ctx->remaining) {
*len = ctx->remaining;
}
else {
*len = requested;
}
/* ### Would it be faster to call this once and do the offset ourselves? */
apr_mmap_offset((void**)data, ctx->mmap, ctx->offset);
/* For the next read... */
ctx->offset += *len;
ctx->remaining -= *len;
if (ctx->remaining == 0) {
return APR_EOF;
}
return APR_SUCCESS;
}
static apr_status_t serf_mmap_readline(serf_bucket_t *bucket,
int acceptable, int *found,
const char **data, apr_size_t *len)
{
mmap_context_t *ctx = bucket->data;
const char *end;
/* ### Would it be faster to call this once and do the offset ourselves? */
apr_mmap_offset((void**)data, ctx->mmap, ctx->offset);
end = *data;
/* XXX An overflow is generated if we pass &ctx->remaining to readline.
* Not real clear why.
*/
*len = ctx->remaining;
serf_util_readline(&end, len, acceptable, found);
*len = end - *data;
ctx->offset += *len;
ctx->remaining -= *len;
if (ctx->remaining == 0) {
return APR_EOF;
}
return APR_SUCCESS;
}
static apr_status_t serf_mmap_peek(serf_bucket_t *bucket,
const char **data,
apr_size_t *len)
{
/* Oh, bah. */
return APR_ENOTIMPL;
}
const serf_bucket_type_t serf_bucket_type_mmap = {
"MMAP",
serf_mmap_read,
serf_mmap_readline,
serf_default_read_iovec,
serf_default_read_for_sendfile,
serf_default_read_bucket,
serf_mmap_peek,
serf_default_destroy_and_data,
};
#else /* !APR_HAS_MMAP */
serf_bucket_t *serf_bucket_mmap_create(apr_mmap_t *file_mmap,
serf_bucket_alloc_t *allocator)
{
return NULL;
}
const serf_bucket_type_t serf_bucket_type_mmap = {
"MMAP",
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
};
#endif
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>DbEditorPP</ProjectName>
<ProjectGuid>{9C6040B8-1173-40FA-A3DB-DE044CCD8250}</ProjectGuid>
</PropertyGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(ProjectDir)..\..\build\vc.common\plugin.props" />
</ImportGroup>
<ItemGroup>
<ClCompile Include="src\copymodule.cpp" />
<ClCompile Include="src\deletemodule.cpp" />
<ClCompile Include="src\exportimport.cpp" />
<ClCompile Include="src\findwindow.cpp" />
<ClCompile Include="src\icons.cpp" />
<ClCompile Include="src\main.cpp" />
<ClCompile Include="src\main_window.cpp" />
<ClCompile Include="src\modsettingenum.cpp" />
<ClCompile Include="src\moduletree.cpp" />
<ClCompile Include="src\options.cpp" />
<ClCompile Include="src\renamemodule.cpp" />
<ClCompile Include="src\settinglist.cpp" />
<ClCompile Include="src\settingsdlg.cpp" />
<ClCompile Include="src\stdafx.cxx">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="src\watchedvars.cpp" />
<ClInclude Include="src\resource.h" />
<ClInclude Include="src\stdafx.h" />
<ClInclude Include="src\version.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\resource.rc" />
<ResourceCompile Include="res\Version.rc" />
</ItemGroup>
</Project>
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<Site BuildName="Linux-g++-4.1-LesionSizingSandbox_Debug"
BuildStamp="20090223-0710-Experimental"
Name="camelot.kitware"
Generator="ctest2.7-20080827" OSName="Linux"
Hostname="Camelot"
OSRelease="2.6.20-17-generic"
OSVersion="#2 SMP Wed Aug 20 16:47:34 UTC 2008"
OSPlatform="i686"
Is64Bits="0"
VendorString="GenuineIntel"
VendorID="Intel Corporation"
FamilyID="15"
ModelID="4"
ProcessorCacheSize="1024"
NumberOfLogicalCPU="2"
NumberOfPhysicalCPU="1"
TotalVirtualMemory="1906"
TotalPhysicalMemory="1003"
LogicalProcessorsPerPhysical="2"
ProcessorClockFrequency="2992.84"
>
<Configure>
<StartDateTime>Feb 23 02:10 EST</StartDateTime>
<StartConfigureTime>1235373038</StartConfigureTime>
<ConfigureCommand>"/home/ibanez/local/bin/cmake" "/home/ibanez/src/LesionSizingKit/Sandbox"</ConfigureCommand>
<Log>-- Configuring done
-- Generating done
-- Build files have been written to: /home/ibanez/bin/LesionSizingKitGcc4.1/Sandbox/Debug
</Log>
<ConfigureStatus>0</ConfigureStatus>
<EndDateTime>Feb 23 02:10 EST</EndDateTime>
<EndConfigureTime>1235373038</EndConfigureTime>
<ElapsedMinutes>0</ElapsedMinutes></Configure>
</Site>
|
{
"pile_set_name": "Github"
}
|
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
export PHOENIX_HOME="/usr/lib/phoenix"
export PHOENIX_LIB_DIR="$PHOENIX_HOME"
# Add the Phoenix server side jar to the HBase classpath
export HBASE_CLASSPATH="$HBASE_CLASSPATH $PHOENIX_HOME/phoenix-server.jar"
|
{
"pile_set_name": "Github"
}
|
# 「一入 Java 深似海 」系列课程 - 第一期 第二节:Java 面向对象设计
## Java 接⼝设计
### 通⽤设计 - 可访问性
#### 四种修饰符
- public
- (default)
- protected:不能用于修饰最外层 class
- private:不能用于修饰最外层 class
### 通⽤设计 - 可继承性
### 具体类设计
### 常⻅场景
- 功能组件
- HashMap
- 接⼝/抽象类实现
- HashMap <- AbstractMap <- Map
- 数据对象
- POJO
- ⼯具辅助
- *Utils
- ViewHelper
- Helper
### 抽象类设计
#### 常⻅场景
- 接⼝通⽤实现(模板模式)
- AbstractList
- AbstractSet
- AbstractMap
- 状态/⾏为继承
### 接口设计
- Serializable
- Cloneable
- AutoCloseable
- EventListener
## 枚举设计
- 枚举(enum) 实际是 final class
- 枚举(enum) 成员修饰符为 public static final
- `values()` 是 Java 编译器做的字节码提升
|
{
"pile_set_name": "Github"
}
|
package com.jeecms.core.tpl;
import java.util.Date;
/**
* 模板接口
*
* @author liufang
*
*/
public interface Tpl {
/**
* 获得模板完整名称,是文件的唯一标识。
*
* @return
*/
public String getName();
/**
* 获得路径,不包含文件名的路径。
*
* @return
*/
public String getPath();
/**
* 获得模板名称,不包含路径的文件名。
*
* @return
*/
public String getFilename();
/**
* 获得模板内容
*
* @return
*/
public String getSource();
/**
* 获得最后修改时间(毫秒)
*
* @return
*/
public long getLastModified();
/**
* 获得最后修改时间(日期)
*
* @return
*/
public Date getLastModifiedDate();
/**
* 获得文件大小,单位bytes
*
* @return
*/
public long getLength();
/**
* 获得文件大小,单位K bytes
*
* @return
*/
public int getSize();
/**
* 是否目录
*
* @return
*/
public boolean isDirectory();
}
|
{
"pile_set_name": "Github"
}
|
#ifndef __wglext_h_
#define __wglext_h_ 1
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright (c) 2013-2014 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
** "Materials"), to deal in the Materials without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Materials, and to
** permit persons to whom the Materials are 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 Materials.
**
** THE MATERIALS ARE 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
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/
/*
** This header is generated from the Khronos OpenGL / OpenGL ES XML
** API Registry. The current version of the Registry, generator scripts
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
** Khronos $Revision: 27684 $ on $Date: 2014-08-11 01:21:35 -0700 (Mon, 11 Aug 2014) $
*/
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#endif
#define WGL_WGLEXT_VERSION 20140810
/* Generated C header for:
* API: wgl
* Versions considered: .*
* Versions emitted: _nomatch_^
* Default extensions included: wgl
* Additional extensions included: _nomatch_^
* Extensions removed: _nomatch_^
*/
#ifndef WGL_ARB_buffer_region
#define WGL_ARB_buffer_region 1
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
#ifdef WGL_WGLEXT_PROTOTYPES
HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType);
VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion);
BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height);
BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
#endif
#endif /* WGL_ARB_buffer_region */
#ifndef WGL_ARB_context_flush_control
#define WGL_ARB_context_flush_control 1
#define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097
#define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0
#define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098
#endif /* WGL_ARB_context_flush_control */
#ifndef WGL_ARB_create_context
#define WGL_ARB_create_context 1
#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
#define WGL_CONTEXT_FLAGS_ARB 0x2094
#define ERROR_INVALID_VERSION_ARB 0x2095
typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
#ifdef WGL_WGLEXT_PROTOTYPES
HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList);
#endif
#endif /* WGL_ARB_create_context */
#ifndef WGL_ARB_create_context_profile
#define WGL_ARB_create_context_profile 1
#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
#define ERROR_INVALID_PROFILE_ARB 0x2096
#endif /* WGL_ARB_create_context_profile */
#ifndef WGL_ARB_create_context_robustness
#define WGL_ARB_create_context_robustness 1
#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
#endif /* WGL_ARB_create_context_robustness */
#ifndef WGL_ARB_extensions_string
#define WGL_ARB_extensions_string 1
typedef const char *(WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
#ifdef WGL_WGLEXT_PROTOTYPES
const char *WINAPI wglGetExtensionsStringARB (HDC hdc);
#endif
#endif /* WGL_ARB_extensions_string */
#ifndef WGL_ARB_framebuffer_sRGB
#define WGL_ARB_framebuffer_sRGB 1
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
#endif /* WGL_ARB_framebuffer_sRGB */
#ifndef WGL_ARB_make_current_read
#define WGL_ARB_make_current_read 1
#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
HDC WINAPI wglGetCurrentReadDCARB (void);
#endif
#endif /* WGL_ARB_make_current_read */
#ifndef WGL_ARB_multisample
#define WGL_ARB_multisample 1
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
#define WGL_SAMPLES_ARB 0x2042
#endif /* WGL_ARB_multisample */
#ifndef WGL_ARB_pbuffer
#define WGL_ARB_pbuffer 1
DECLARE_HANDLE(HPBUFFERARB);
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
#define WGL_PBUFFER_LARGEST_ARB 0x2033
#define WGL_PBUFFER_WIDTH_ARB 0x2034
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
#define WGL_PBUFFER_LOST_ARB 0x2036
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
#ifdef WGL_WGLEXT_PROTOTYPES
HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer);
int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC);
BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer);
BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
#endif
#endif /* WGL_ARB_pbuffer */
#ifndef WGL_ARB_pixel_format
#define WGL_ARB_pixel_format 1
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
#define WGL_ACCELERATION_ARB 0x2003
#define WGL_NEED_PALETTE_ARB 0x2004
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
#define WGL_SWAP_METHOD_ARB 0x2007
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
#define WGL_TRANSPARENT_ARB 0x200A
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
#define WGL_SHARE_DEPTH_ARB 0x200C
#define WGL_SHARE_STENCIL_ARB 0x200D
#define WGL_SHARE_ACCUM_ARB 0x200E
#define WGL_SUPPORT_GDI_ARB 0x200F
#define WGL_SUPPORT_OPENGL_ARB 0x2010
#define WGL_DOUBLE_BUFFER_ARB 0x2011
#define WGL_STEREO_ARB 0x2012
#define WGL_PIXEL_TYPE_ARB 0x2013
#define WGL_COLOR_BITS_ARB 0x2014
#define WGL_RED_BITS_ARB 0x2015
#define WGL_RED_SHIFT_ARB 0x2016
#define WGL_GREEN_BITS_ARB 0x2017
#define WGL_GREEN_SHIFT_ARB 0x2018
#define WGL_BLUE_BITS_ARB 0x2019
#define WGL_BLUE_SHIFT_ARB 0x201A
#define WGL_ALPHA_BITS_ARB 0x201B
#define WGL_ALPHA_SHIFT_ARB 0x201C
#define WGL_ACCUM_BITS_ARB 0x201D
#define WGL_ACCUM_RED_BITS_ARB 0x201E
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
#define WGL_DEPTH_BITS_ARB 0x2022
#define WGL_STENCIL_BITS_ARB 0x2023
#define WGL_AUX_BUFFERS_ARB 0x2024
#define WGL_NO_ACCELERATION_ARB 0x2025
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
#define WGL_FULL_ACCELERATION_ARB 0x2027
#define WGL_SWAP_EXCHANGE_ARB 0x2028
#define WGL_SWAP_COPY_ARB 0x2029
#define WGL_SWAP_UNDEFINED_ARB 0x202A
#define WGL_TYPE_RGBA_ARB 0x202B
#define WGL_TYPE_COLORINDEX_ARB 0x202C
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#endif
#endif /* WGL_ARB_pixel_format */
#ifndef WGL_ARB_pixel_format_float
#define WGL_ARB_pixel_format_float 1
#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
#endif /* WGL_ARB_pixel_format_float */
#ifndef WGL_ARB_render_texture
#define WGL_ARB_render_texture 1
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
#define WGL_TEXTURE_FORMAT_ARB 0x2072
#define WGL_TEXTURE_TARGET_ARB 0x2073
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
#define WGL_TEXTURE_RGB_ARB 0x2075
#define WGL_TEXTURE_RGBA_ARB 0x2076
#define WGL_NO_TEXTURE_ARB 0x2077
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
#define WGL_TEXTURE_1D_ARB 0x2079
#define WGL_TEXTURE_2D_ARB 0x207A
#define WGL_MIPMAP_LEVEL_ARB 0x207B
#define WGL_CUBE_MAP_FACE_ARB 0x207C
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
#define WGL_FRONT_LEFT_ARB 0x2083
#define WGL_FRONT_RIGHT_ARB 0x2084
#define WGL_BACK_LEFT_ARB 0x2085
#define WGL_BACK_RIGHT_ARB 0x2086
#define WGL_AUX0_ARB 0x2087
#define WGL_AUX1_ARB 0x2088
#define WGL_AUX2_ARB 0x2089
#define WGL_AUX3_ARB 0x208A
#define WGL_AUX4_ARB 0x208B
#define WGL_AUX5_ARB 0x208C
#define WGL_AUX6_ARB 0x208D
#define WGL_AUX7_ARB 0x208E
#define WGL_AUX8_ARB 0x208F
#define WGL_AUX9_ARB 0x2090
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList);
#endif
#endif /* WGL_ARB_render_texture */
#ifndef WGL_ARB_robustness_application_isolation
#define WGL_ARB_robustness_application_isolation 1
#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
#endif /* WGL_ARB_robustness_application_isolation */
#ifndef WGL_ARB_robustness_share_group_isolation
#define WGL_ARB_robustness_share_group_isolation 1
#endif /* WGL_ARB_robustness_share_group_isolation */
#ifndef WGL_3DFX_multisample
#define WGL_3DFX_multisample 1
#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
#define WGL_SAMPLES_3DFX 0x2061
#endif /* WGL_3DFX_multisample */
#ifndef WGL_3DL_stereo_control
#define WGL_3DL_stereo_control 1
#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);
#endif
#endif /* WGL_3DL_stereo_control */
#ifndef WGL_AMD_gpu_association
#define WGL_AMD_gpu_association 1
#define WGL_GPU_VENDOR_AMD 0x1F00
#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
#define WGL_GPU_RAM_AMD 0x21A3
#define WGL_GPU_CLOCK_AMD 0x21A4
#define WGL_GPU_NUM_PIPES_AMD 0x21A5
#define WGL_GPU_NUM_SIMD_AMD 0x21A6
#define WGL_GPU_NUM_RB_AMD 0x21A7
#define WGL_GPU_NUM_SPI_AMD 0x21A8
typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, int property, GLenum dataType, UINT size, void *data);
typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);
typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
#ifdef WGL_WGLEXT_PROTOTYPES
UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids);
INT WINAPI wglGetGPUInfoAMD (UINT id, int property, GLenum dataType, UINT size, void *data);
UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);
HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id);
HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList);
BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc);
BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc);
HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
#endif
#endif /* WGL_AMD_gpu_association */
#ifndef WGL_ATI_pixel_format_float
#define WGL_ATI_pixel_format_float 1
#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
#endif /* WGL_ATI_pixel_format_float */
#ifndef WGL_EXT_create_context_es2_profile
#define WGL_EXT_create_context_es2_profile 1
#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
#endif /* WGL_EXT_create_context_es2_profile */
#ifndef WGL_EXT_create_context_es_profile
#define WGL_EXT_create_context_es_profile 1
#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004
#endif /* WGL_EXT_create_context_es_profile */
#ifndef WGL_EXT_depth_float
#define WGL_EXT_depth_float 1
#define WGL_DEPTH_FLOAT_EXT 0x2040
#endif /* WGL_EXT_depth_float */
#ifndef WGL_EXT_display_color_table
#define WGL_EXT_display_color_table 1
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
#ifdef WGL_WGLEXT_PROTOTYPES
GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id);
GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length);
GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id);
VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id);
#endif
#endif /* WGL_EXT_display_color_table */
#ifndef WGL_EXT_extensions_string
#define WGL_EXT_extensions_string 1
typedef const char *(WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
#ifdef WGL_WGLEXT_PROTOTYPES
const char *WINAPI wglGetExtensionsStringEXT (void);
#endif
#endif /* WGL_EXT_extensions_string */
#ifndef WGL_EXT_framebuffer_sRGB
#define WGL_EXT_framebuffer_sRGB 1
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
#endif /* WGL_EXT_framebuffer_sRGB */
#ifndef WGL_EXT_make_current_read
#define WGL_EXT_make_current_read 1
#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
HDC WINAPI wglGetCurrentReadDCEXT (void);
#endif
#endif /* WGL_EXT_make_current_read */
#ifndef WGL_EXT_multisample
#define WGL_EXT_multisample 1
#define WGL_SAMPLE_BUFFERS_EXT 0x2041
#define WGL_SAMPLES_EXT 0x2042
#endif /* WGL_EXT_multisample */
#ifndef WGL_EXT_pbuffer
#define WGL_EXT_pbuffer 1
DECLARE_HANDLE(HPBUFFEREXT);
#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
#define WGL_PBUFFER_LARGEST_EXT 0x2033
#define WGL_PBUFFER_WIDTH_EXT 0x2034
#define WGL_PBUFFER_HEIGHT_EXT 0x2035
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
#ifdef WGL_WGLEXT_PROTOTYPES
HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer);
int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC);
BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer);
BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
#endif
#endif /* WGL_EXT_pbuffer */
#ifndef WGL_EXT_pixel_format
#define WGL_EXT_pixel_format 1
#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
#define WGL_DRAW_TO_WINDOW_EXT 0x2001
#define WGL_DRAW_TO_BITMAP_EXT 0x2002
#define WGL_ACCELERATION_EXT 0x2003
#define WGL_NEED_PALETTE_EXT 0x2004
#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
#define WGL_SWAP_METHOD_EXT 0x2007
#define WGL_NUMBER_OVERLAYS_EXT 0x2008
#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
#define WGL_TRANSPARENT_EXT 0x200A
#define WGL_TRANSPARENT_VALUE_EXT 0x200B
#define WGL_SHARE_DEPTH_EXT 0x200C
#define WGL_SHARE_STENCIL_EXT 0x200D
#define WGL_SHARE_ACCUM_EXT 0x200E
#define WGL_SUPPORT_GDI_EXT 0x200F
#define WGL_SUPPORT_OPENGL_EXT 0x2010
#define WGL_DOUBLE_BUFFER_EXT 0x2011
#define WGL_STEREO_EXT 0x2012
#define WGL_PIXEL_TYPE_EXT 0x2013
#define WGL_COLOR_BITS_EXT 0x2014
#define WGL_RED_BITS_EXT 0x2015
#define WGL_RED_SHIFT_EXT 0x2016
#define WGL_GREEN_BITS_EXT 0x2017
#define WGL_GREEN_SHIFT_EXT 0x2018
#define WGL_BLUE_BITS_EXT 0x2019
#define WGL_BLUE_SHIFT_EXT 0x201A
#define WGL_ALPHA_BITS_EXT 0x201B
#define WGL_ALPHA_SHIFT_EXT 0x201C
#define WGL_ACCUM_BITS_EXT 0x201D
#define WGL_ACCUM_RED_BITS_EXT 0x201E
#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
#define WGL_DEPTH_BITS_EXT 0x2022
#define WGL_STENCIL_BITS_EXT 0x2023
#define WGL_AUX_BUFFERS_EXT 0x2024
#define WGL_NO_ACCELERATION_EXT 0x2025
#define WGL_GENERIC_ACCELERATION_EXT 0x2026
#define WGL_FULL_ACCELERATION_EXT 0x2027
#define WGL_SWAP_EXCHANGE_EXT 0x2028
#define WGL_SWAP_COPY_EXT 0x2029
#define WGL_SWAP_UNDEFINED_EXT 0x202A
#define WGL_TYPE_RGBA_EXT 0x202B
#define WGL_TYPE_COLORINDEX_EXT 0x202C
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#endif
#endif /* WGL_EXT_pixel_format */
#ifndef WGL_EXT_pixel_format_packed_float
#define WGL_EXT_pixel_format_packed_float 1
#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
#endif /* WGL_EXT_pixel_format_packed_float */
#ifndef WGL_EXT_swap_control
#define WGL_EXT_swap_control 1
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglSwapIntervalEXT (int interval);
int WINAPI wglGetSwapIntervalEXT (void);
#endif
#endif /* WGL_EXT_swap_control */
#ifndef WGL_EXT_swap_control_tear
#define WGL_EXT_swap_control_tear 1
#endif /* WGL_EXT_swap_control_tear */
#ifndef WGL_I3D_digital_video_control
#define WGL_I3D_digital_video_control 1
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue);
BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue);
#endif
#endif /* WGL_I3D_digital_video_control */
#ifndef WGL_I3D_gamma
#define WGL_I3D_gamma 1
#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue);
BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue);
BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
#endif
#endif /* WGL_I3D_gamma */
#ifndef WGL_I3D_genlock
#define WGL_I3D_genlock 1
#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045
#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046
#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047
#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglEnableGenlockI3D (HDC hDC);
BOOL WINAPI wglDisableGenlockI3D (HDC hDC);
BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag);
BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource);
BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource);
BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge);
BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge);
BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate);
BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate);
BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay);
BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay);
BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
#endif
#endif /* WGL_I3D_genlock */
#ifndef WGL_I3D_image_buffer
#define WGL_I3D_image_buffer 1
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
#ifdef WGL_WGLEXT_PROTOTYPES
LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags);
BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress);
BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count);
#endif
#endif /* WGL_I3D_image_buffer */
#ifndef WGL_I3D_swap_frame_lock
#define WGL_I3D_swap_frame_lock 1
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglEnableFrameLockI3D (void);
BOOL WINAPI wglDisableFrameLockI3D (void);
BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag);
BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag);
#endif
#endif /* WGL_I3D_swap_frame_lock */
#ifndef WGL_I3D_swap_frame_usage
#define WGL_I3D_swap_frame_usage 1
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglGetFrameUsageI3D (float *pUsage);
BOOL WINAPI wglBeginFrameTrackingI3D (void);
BOOL WINAPI wglEndFrameTrackingI3D (void);
BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
#endif
#endif /* WGL_I3D_swap_frame_usage */
#ifndef WGL_NV_DX_interop
#define WGL_NV_DX_interop 1
#define WGL_ACCESS_READ_ONLY_NV 0x00000000
#define WGL_ACCESS_READ_WRITE_NV 0x00000001
#define WGL_ACCESS_WRITE_DISCARD_NV 0x00000002
typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void *dxObject, HANDLE shareHandle);
typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void *dxDevice);
typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice);
typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject);
typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);
typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglDXSetResourceShareHandleNV (void *dxObject, HANDLE shareHandle);
HANDLE WINAPI wglDXOpenDeviceNV (void *dxDevice);
BOOL WINAPI wglDXCloseDeviceNV (HANDLE hDevice);
HANDLE WINAPI wglDXRegisterObjectNV (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
BOOL WINAPI wglDXUnregisterObjectNV (HANDLE hDevice, HANDLE hObject);
BOOL WINAPI wglDXObjectAccessNV (HANDLE hObject, GLenum access);
BOOL WINAPI wglDXLockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
BOOL WINAPI wglDXUnlockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
#endif
#endif /* WGL_NV_DX_interop */
#ifndef WGL_NV_DX_interop2
#define WGL_NV_DX_interop2 1
#endif /* WGL_NV_DX_interop2 */
#ifndef WGL_NV_copy_image
#define WGL_NV_copy_image 1
typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
#endif
#endif /* WGL_NV_copy_image */
#ifndef WGL_NV_delay_before_swap
#define WGL_NV_delay_before_swap 1
typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglDelayBeforeSwapNV (HDC hDC, GLfloat seconds);
#endif
#endif /* WGL_NV_delay_before_swap */
#ifndef WGL_NV_float_buffer
#define WGL_NV_float_buffer 1
#define WGL_FLOAT_COMPONENTS_NV 0x20B0
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
#endif /* WGL_NV_float_buffer */
#ifndef WGL_NV_gpu_affinity
#define WGL_NV_gpu_affinity 1
DECLARE_HANDLE(HGPUNV);
struct _GPU_DEVICE {
DWORD cb;
CHAR DeviceName[32];
CHAR DeviceString[128];
DWORD Flags;
RECT rcVirtualScreen;
};
typedef struct _GPU_DEVICE *PGPU_DEVICE;
#define ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
#define ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu);
BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList);
BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
BOOL WINAPI wglDeleteDCNV (HDC hdc);
#endif
#endif /* WGL_NV_gpu_affinity */
#ifndef WGL_NV_multisample_coverage
#define WGL_NV_multisample_coverage 1
#define WGL_COVERAGE_SAMPLES_NV 0x2042
#define WGL_COLOR_SAMPLES_NV 0x20B9
#endif /* WGL_NV_multisample_coverage */
#ifndef WGL_NV_present_video
#define WGL_NV_present_video 1
DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);
#ifdef WGL_WGLEXT_PROTOTYPES
int WINAPI wglEnumerateVideoDevicesNV (HDC hDC, HVIDEOOUTPUTDEVICENV *phDeviceList);
BOOL WINAPI wglBindVideoDeviceNV (HDC hDC, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue);
#endif
#endif /* WGL_NV_present_video */
#ifndef WGL_NV_render_depth_texture
#define WGL_NV_render_depth_texture 1
#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
#define WGL_DEPTH_COMPONENT_NV 0x20A7
#endif /* WGL_NV_render_depth_texture */
#ifndef WGL_NV_render_texture_rectangle
#define WGL_NV_render_texture_rectangle 1
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
#endif /* WGL_NV_render_texture_rectangle */
#ifndef WGL_NV_swap_group
#define WGL_NV_swap_group 1
typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier);
typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count);
typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group);
BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier);
BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier);
BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count);
BOOL WINAPI wglResetFrameCountNV (HDC hDC);
#endif
#endif /* WGL_NV_swap_group */
#ifndef WGL_NV_vertex_array_range
#define WGL_NV_vertex_array_range 1
typedef void *(WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
#ifdef WGL_WGLEXT_PROTOTYPES
void *WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
void WINAPI wglFreeMemoryNV (void *pointer);
#endif
#endif /* WGL_NV_vertex_array_range */
#ifndef WGL_NV_video_capture
#define WGL_NV_video_capture 1
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
#define WGL_UNIQUE_ID_NV 0x20CE
#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
#endif
#endif /* WGL_NV_video_capture */
#ifndef WGL_NV_video_output
#define WGL_NV_video_output 1
DECLARE_HANDLE(HPVIDEODEV);
#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
#define WGL_VIDEO_OUT_FRAME 0x20C8
#define WGL_VIDEO_OUT_FIELD_1 0x20C9
#define WGL_VIDEO_OUT_FIELD_2 0x20CA
#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice);
BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer);
BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
#endif
#endif /* WGL_NV_video_output */
#ifndef WGL_OML_sync_control
#define WGL_OML_sync_control 1
typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator);
INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
#endif
#endif /* WGL_OML_sync_control */
#ifdef __cplusplus
}
#endif
#endif
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
|
{
"pile_set_name": "Github"
}
|
### FILE="Main.annotation"
## Copyright: Public domain.
## Filename: UPDATE_PROGRAM.agc
## Purpose: A section of Artemis revision 071.
## It is part of the reconstructed source code for the first
## release of the flight software for the Command Module's
## (CM) Apollo Guidance Computer (AGC) for Apollo 15 through
## 17. The code has been recreated from a copy of Artemis 072.
## It has been adapted such that the resulting bugger words
## exactly match those specified for Artemis 071 in NASA
## drawing 2021154-, which gives relatively high confidence
## that the reconstruction is correct.
## Reference: 1490
## Assembler: yaYUL
## Contact: Ron Burkey <info@sandroid.org>.
## Website: www.ibiblio.org/apollo/index.html
## Mod history: 2019-08-14 MAS Created from Artemis 072.
## Page 1490
# PROGRAM NAME: P27
# WRITTEN BY: KILROY/ DE WOLF
#
# MOD NO: 6
# MOD BY: KILROY
# DATE: 01DEC67
#
# LOG SECTION: UPDATE PROGRAM.
#
# FUNCT. DESCR: P27 (THE UPDATE PROGRAM) PROCESSES COMMANDS AND DATA
# INSERTIONS REQUESTED BY THE GROUND VIA UPLINK.
# THE P27 PROGRAM WILL ACCEPT UPDATES
# ONLY DURING P00 FOR THE LM, AND ONLY DURING P00,
# P02, AND FRESH START FOR THE CSM
#
# CALLING SEQ: PROGRAM IS INITIATED BY UPLINK ENTRY OF VERBS 70, 71, 72 AND 73.
#
# SUBROUTINES: TESTXACT, NEWMODEX, NEWMODEX +3, GOXDSPF, BANKCALL, FINDVAC, INTPRET, INTSTALL, TPAGREE,
# INTWAKEU, ENDEXT, POSTJUMP, FALTON, NEWPHASE, PHASCHNG
#
# NORMAL EXIT: TC ENDEXT
#
# ALARM/ABORT: TC FALTON FOLLOWED BY TC ENDEXT
#
# RESTARTS: P27 IS RESTART PROTECTED IN TWO WAYS...
# 1. PRIOR TO VERIFLAG INVERSION (WHICH IS CAUSED BY THE GROUND/ASTRONAUT'S VERIFICATION OF UPDATE
# DATA BY SENDING A V33E WHEN V21N02 IS FLASHING)---
# NO PROTECTION EXCEPT PRE-P27 MODE IS RESTORED, COAST + ALIGN DOWNLIST IS SELECTED AND UPLINK
# ACTIVITY LIGHT IS TURNED OFF. (JUST AS IF A V34E WAS SENT DURING P27 DATA LOADS).
# V70,V71,V72 OR V73 WILL HAVE TO BE COMPLETELY RESENT BY USER.
# 2. AFTER VERIFLAG INVERSION (WHEN UPDATE OF THE SPECIFIED ERASABLES IS BEING PERFORMED)---
# PROTECTED AGAINST RESTARTS.
#
# DEBRIS: UPBUFF (20D) TEMP STORAGE FOR ADDRESSES AND CONTENTS.
# UPVERB (1) VERB NUMBER MINUS 70D (E.G. FOR V72, UPVERB = 72D - 70D = 2)
# UPOLDMOD(1) FOR MAJOR MODE INTERRUPTED BY P27.
# COMPNUMB(1) TOTAL NUMBER OF COMPONENTS TO BE TRANSMITTED.
# UPCOUNT (1) ACTUAL NUMBER OF COMPONENTS RECEIVED.
# UPTEMP (1) SCRATCH, BUT USUALLY CONTAINS COMPONENT NUMBER TO BE CHANGED DURING VERIFY CYCLE
#
# INPUT:
#
# ENTRY: DESCRIPTION
#
# V70EXXXXXEXXXXXE (LIFTOFF TIME INCREMENT) DOUBLE PRECISION OCTAL TIME INCREMENT, XXXXX XXXXX,
# IS ADDED TO TEPHEM, SUBTRACTED FROM AGC CLOCK(TIME2,TIME1), SUBTRACTED FROM CSM STATE
# VECTOR TIME(TETCSM) AND SUBTRACTED FROM LEM STATE VECTOR TIME (TETLEM).
# THE DP OCTAL TIME INCREMENT IS SCALED AT 2(28).
## Page 1491
#
# V71EIIEAAAAE (CONTIGUOUS BLOCK UPDATE) II-2 OCTAL COMPONENTS, XXXXX,
# XXXXXE ARE LOADED INTO ERASABLE STARTING AT ECADR, AAAA.
# XXXXXE IT IS .GE. 3 .AND. .LE. 20D.,
# AND (AAAA + II - 3) DOES NOT PRODUCE AN ADDRESS IN THE
# 9 NEXT BANK
# . SCALING IS SAME AS INTERNAL REGISTERS.
#
# V72EIIE (SCATTER UPDATE) (II-1)/2 OCTAL COMPONENTS, XXXXX, ARE
# AAAAEXXXXXE LOADED INTO ERASABLE LOCATIONS, AAAA.
# AAAAEXXXXXE II IS .GE. 3 .AND. .LE. 19D, AND MUST BE ODD.
# . SCALING IS SAME AS INTERNAL REGISTERS.
#
# V73EXXXXXEXXXXXE (OCTAL CLOCK INCREMENT) DOUBLE PRECISION OCTAL TIME
# INCREMENT XXXXX XXXXX, IS ADDED TO THE AGC CLOCK, IN
# CENTISECONDS SCALED AT (2)28.
# THIS LOAD IS THE OCTAL EQUIVALENT OF V55.
#
# OUTPUT: IN ADDITION TO THE ABOVE REGISTER LOADS, ALL UPDATES
# COMPLEMENT BIT3 OF FLAGWORD7.
#
# ADDITIONAL NOTES: VERB 71, JUST DEFINED ABOVE WILL BE USED TO PERFORM BUT NOT LIMITED TO THE FOLLOWING UPDATES --
# 1. CSM/LM STATE VECTOR UPDATE
# 2. REFSMMAT UPDATE
#
#
# THE FOLLOWING COMMENTS DELINEATE EACH SPECIAL UPDATE----
#
# 1. CSM/LM STATE VECTOR UPDATE (ALL DATA ENTRIES IN OCTAL)
#
# ENTRIES: DATA DEFINITION: SCALE FACTORS:
# V71E CONTIGUOUS BLOCK UPDATE VERB
# 21E NUMBER OF COMPONENTS FOR STATE VECTOR UPDATE
# AAAAE ECADR OF 'UPSVFLAG'
# XXXXXE STATE VECTOR IDENTIFIER: 00001 FOR CSM, 77776 FOR LEM - EARTH SPHERE OF INFLUENCE SCALING
# 00002 FOR CSM, 77775 FOR LEM - LUNAR SPHERE OF INFLUENCE SCALING
# XXXXXEXXXXXE X POSITION
# XXXXXEXXXXXE Y POSITION
# XXXXXEXXXXXE Z POSITION
# XXXXXEXXXXXE X VELOCITY
# XXXXXEXXXXXE Y VELOCITY
# XXXXXEXXXXXE Z VELOCITY
# XXXXXEXXXXXE TIME FROM AGC CLOCK ZERO
# V33E VERB 33 TO SIGNAL THAT THE STATE VECTOR IS READY TO BE STORED.
#
#
# 2. REFSMMAT (ALL DATA ENTRIES IN OCTAL)
# ENTRIES: DATA DEFINITIONS: SCALE FACTORS:
## Page 1492
# V71E CONTIGUOUS BLOCK UPDATE VERB
# 24E NUMBER OF COMPONENTS FOR REFSMMAT UPDATE
# AAAAE ECADR OF 'REFSMMAT'
# XXXXXEXXXXXE ROW 1 COLUMN 1 2(-1)
# XXXXXEXXXXXE ROW 1 COLUMN 2 2(-1)
# XXXXXEXXXXXE ROW 1 COLUMN 3 2(-1)
# XXXXXEXXXXXE ROW 2 COLUMN 1 2(-1)
# XXXXXEXXXXXE ROW 2 COLUMN 2 2(-1)
# XXXXXEXXXXXE ROW 2 COLUMN 3 2(-1)
# XXXXXEXXXXXE ROW 3 COLUMN 1 2(-1)
# XXXXXEXXXXXE ROW 3 COLUMN 2 2(-1)
# XXXXXEXXXXXE ROW 3 COLUMN 3 2(-1)
# V33E VERB 33 TO SIGNAL THAT REFSMMAT IS READY TO BE STORED.
SETLOC EXTVERBS
BANK
EBANK= TEPHEM
COUNT* $$/P27
V70UPDAT CAF UP70 # COMES HERE ON V70E
TCF V73UPDAT +1
V71UPDAT CAF UP71 # COMES HERE ON V71E
TCF V73UPDAT +1
V72UPDAT CAF UP72 # COMES HERE ON V72E
TCF V73UPDAT +1
V73UPDAT CAF UP73 # COMES HERE ON V73E
+1 TS UPVERBSV # SAVE UPVERB UNTIL IT'S OK TO ENTER P27
TC TESTXACT # GRAB DISPLAY IF AVAILABLE, OTHERWISE
# TURN *OPERATOR ERROR* ON AND TERMINATE JOB
CA MODREG # CHECK IF UPDATE ALLOWED
EXTEND # FIRST CHECK FOR MODREG = +0, -0
BZF UPDATEOK # FRESH START OR P00
CS FLAGWRD8
MASK UTBIT
CCS A
TCF +5
CS MODREG
AD OCT24
## Page 1493
EXTEND
BZF UPDATEOK
CS TWO
MASK MODREG
EXTEND
BZF +2 # P02
TCF UPERROR
UPDATEOK CAE MODREG # UPDATE ALLOWED.
TS UPOLDMOD # SAVE CURRENT MAJOR MODE
CAE UPVERBSV # SET UPVERB TO INDICATE TO P27
TS UPVERB # WHICH EXTENDED VERB CALLED IT.
CAF ONE
TS UPCOUNT # INITIALIZE UPCOUNT TO 1
TC POSTJUMP # LEAVE EXTENDED VERB BANK AND
CADR UPPART2 # GO TO UPDATE PROGRAM (P27) BANK.
UPERROR TC FALTON # TURN ON OP. ERROR
TC UPACTOFF # TURN OFF UPLINK ACT LITE
TCF ENDEXT # (RESTART GROUP NOT ESTABLISHED YET)
UP70 EQUALS ZERO
UP71 EQUALS ONE
UP72 EQUALS TWO
UP73 EQUALS THREE
SETLOC UPDATE3
BANK
COUNT* $$/P27
UPPART2 EQUALS # UPDATE PROGRAM - PART 2
TC PHASCHNG # SET RESTART GROUP 6 TO RESTORE OLD MODE
OCT 07026 # AND DOWNLIST AND EXIT IF RESTART OCCURS.
OCT 30000 # PRIORITY SAME AS CHRPRIO
EBANK= UPBUFF
2CADR UPOUT +1
CAF ONE
TS DNLSTCOD # DOWNLIST
TC NEWMODEX # SET MAJOR MODE = 27
DEC 27
## Page 1494
INDEX UPVERB # BRANCH DEPENDING ON WHETHER THE UPDATE
TCF +1 # VERB REQUIRES A FIXED OR VARIABLE NUMBER
TCF +3 # V70 FIXED. (OF COMPONENTS.
TCF OHWELL1 # V71 VARIABLE - GO GET NO. OF COMPONENTS
TCF OHWELL1 # V72 VARIABLE - GO GET NO. OF COMPONENTS
CA TWO # V73 (AND V70) FIXED
TS COMPNUMB # SET NUMBER OF COMPONENTS TO 2.
TCF OHWELL2 # GO GET THE TWO UPDATE COMPONENTS
OHWELL1 CAF ADUPBUFF # * REQUEST USER TO SEND NUMBER *
TS MPAC +2 # * OF COMPONENTS PARAMETER(II). *
+2 CAF UPLOADNV # (CK4V32 RETURNS HERE IF V32 ENCOUNTERED)
TC BANKCALL # DISPLAY A FLASHING V21N01
CADR GOXDSPF # TO REQUEST II.
TCF UPOUT4 # V34 TERMINATE UPDATE (P27) RETURN
TCF OHWELL1 +2
TC CK4V32 # DATA OR V32 RETURN
CS BIT2
AD UPBUFF # IS II (NUMBER OF COMPONENTS PARAMETER)
EXTEND # .GE. 3 AND .LE. 20D.
BZMF OHWELL1 +2
CS UPBUFF
AD UP21
EXTEND
BZMF OHWELL1 +2
CAE UPBUFF
TS COMPNUMB # SAVE II IN COMPNUMB
# UPBUFF LOADING SEQUENCE
-1 INCR UPCOUNT # INCREMENT COUNT OF COMPONENTS RECEIVED
OHWELL2 CAF ADUPBFM1 # CALCULATE LOCATION (ECADR) IN UPBUFF
AD UPCOUNT # WHERE NEXT COMPONENT SHOULD BE STORED.
+2 TS MPAC +2 # PLACE ECADR INTO R3.
+3 CAF UPLOADNV # (CK4V32 RETURNS HERE IF V32 ENCOUNTERED)
TC BANKCALL # DISPLAY A FLASHING V21N01
CADR GOXDSPF # TO REQUEST DATA.
TCF UPOUT4 # V34 TERMINATE UPDATE (P27) RETURN.
TCF OHWELL2 +3 # V33 PROCEED RETURN
TC CK4V32 # DATA OR V32 RETURN
CS UPCOUNT # HAVE WE FINISHED RECEIVING ALL
AD COMPNUMB # THE DATA WE EXPECTED.
EXTEND
BZMF UPVERIFY # YES - GO TO VERIFICATION SEQUENCE
TCF OHWELL2 -1 # NO - REQUEST ADDITIONAL DATA.
# VERIFY SEQUENCE
## Page 1495
UPVERIFY CAF ADUPTEMP # PLACE ECADR WHERE COMPONENT NO. INDEX
TS MPAC +2 # IS TO BE STORED INTO R3.
CAF UPVRFYNV # (CK4V32 RETURNS HERE IF V32 ENCOUNTERED)
TC BANKCALL # DISPLAY A FLASHING V21N02 TO REQUEST
CADR GOXDSPF # DATA CORRECTION OR VERIFICATION.
TCF UPOUT4 # V34 TERMINATE UPDATE(P27) RETURN
TCF UPSTORE # V33 DATA SENT IS GOOD. GO STORE IT.
TC CK4V32 # COMPONENT NO. INDEX OR V32 RETURN
CA UPTEMP # DOES THE COMPONENT NO. INDEX JUST SENT
EXTEND # SPECIFY A LEGAL COMPONENT NUMBER?
BZMF UPVERIFY # NO, IT IS NOT POSITIVE NONZERO
CS UPTEMP
AD COMPNUMB
AD BIT1
EXTEND
BZMF UPVERIFY # NO
CAF ADUPBFM1 # YES - BASED ON THE COMPONENT NO. INDEX
AD UPTEMP # CALCULATE THE ECADR OF LOCATION IN
TCF OHWELL2 +2 # UPBUFF WHICH USER WANTS TO CHANGE.
UPOUT4 TC POSTJUMP # COMES HERE ON V34 TO TERMINATE UPDATE
CADR UPOUT +1
# CHECK FOR VERB 32 SEQUENCE
CK4V32 CS MPAC # ON DATA RETURN FROM 'GOXDSPF'
MASK BIT6 # ON DATA RETURN FROM "GOXDSP"& THE CON-
CCS A # TENTS OF MPAC = VERB. SO TEST FOR V32.
TC Q # IT'S NOT A V32, IT'S DATA. PROCEED.
INDEX Q
TC 0 -6 # V32 ENCOUNTERED - GO BACK AND GET DATA
ADUPTEMP ADRES UPTEMP # ADDRESS OF TEMP STORAGE FOR CORRECTIONS
ADUPBUFF ADRES UPBUFF # ADDRESS OF UPDATE DATA STORAGE BUFFER
ADUPBFM1 ADRES UPBUFF -1 # SAME AS ADUPBUFF BUT LESS ONE
UPLOADNV VN 2101 # VERB 21 NOUN 01
UPVRFYNV VN 2102 # VERB 21 NOUN 02
UP21 = MD1 # DEC 21 = MAX NO OF COMPONENTS +1
UPDTPHAS EQUALS FIVE
# PRE-STORE AND FAN TO APPROPRIATE BRANCH SEQUENCE
UPSTORE EQUALS # GROUND HAS VERIFIED UPDATE. STORE DATA.
INHINT
CAE FLAGWRD7 # INVERT VERIFLAG(BIT3 OF FLAGWRD7) TO
XCH L # INDICATE TO THE GROUND(VIA DOWNLINK)
CAF VERIFBIT # THAT THE V33 (WHICH THE GROUND SENT TO
EXTEND # VERIFY THE UPDATE) HAS BEEN SUCCESSFULLY
## Page 1496
RXOR LCHAN # RECEIVED BY THE UPDATE PROGRAM
TS FLAGWRD7
TC PHASCHNG # SET RESTART GROUP 6 TO REDO THE UPDATE
OCT 04026 # DATA STORE IF A RESTART OCCURS.
INHINT # (BECAUSE PHASCHNG DID A RELINT)
CS TWO # GO TO UPFNDVAC IF INSTALL IS REQUIRED,
AD UPVERB # THAT IS, IF IT'S A V70 - V72.
EXTEND # GO TO UPEND73 IF IT'S A V73.
BZMF UPFNDVAC
TC POSTJUMP
CADR UPEND73
UPFNDVAC CAF CHRPRIO # (USE EXTENDED VERB PRIORITY)
TC FINDVAC # GET VAC AREA FOR 'CALL INTSTALL'
EBANK= TEPHEM
2CADR UPJOB # (NOTE: THIS WILL ALSO SET EBANK FOR
TC ENDOFJOB # 'TEPHEM' UPDATE BY V70)
SETLOC UPDATE2
BANK
COUNT* $$/P27
UPJOB TC INTPRET # THIS COULD BE A STATE VECTOR UPDATE--SO
CALL # WAIT(PUT JOB TO SLEEP) IF ORBIT INT(OI)
INTSTALL # IS IN PROGRESS--OR--GRAB OI AND RETURN
# TO UPWAKE IF OI IS NOT IN PROGRESS.
UPWAKE EXIT
TC PHASCHNG # RESTART PROTECT(GROUP 6)
OCT 04026
TC UPFLAG # SET INTEGRATION RESTART BIT
ADRES REINTFLG
INHINT
UPPART3 EQUALS
INDEX UPVERB # BRANCH TO THE APPROPRIATE UPDATE VERB
TCF +1 # ROUTINE TO ACTUALLY PERFORM THE UPDATE
TCF UPEND70 # V70
TCF UPEND71 # V71
TCF UPEND72 # V72
# ROUTINE TO INCREMENT CLOCK (TIME2,TIME1) WITH CONTENTS OF DP WORD AT UPBUFF.
## Page 1497
TIMEDIDL EXTEND
QXCH UPTEMP # SAVE Q FOR RETURN
CAF ZERO # ZERO AND SAVE TIME2,TIME1
ZL
DXCH TIME2
DXCH UPBUFF +18D # STORE IN CASE OF OVERFLOW
CAF UPDTPHAS # DO
TS L # A
COM # QUICK
DXCH -PHASE6 # PHASCHNG
6P5SPT1 = 6.5SPOT
TIMEDIDR INHINT
CAF ZERO
ZL # PICK UP INCREMENTER(AND ZERO
TS MPAC +2 # IT IN CASE OF RESTARTS) AND
DXCH UPBUFF +8D # STORE IT
DXCH MPAC # INTO MPAC FOR TPAGREE.
EXTEND
DCA UPBUFF +18D
DAS MPAC # FORM SUM IN MPAC
EXTEND
BZF DELTATOK # TEST FOR OVERFLOW
CAF ZERO
DXCH UPBUFF +18D # OVERFLOW, RESTORE OLD VALUE OF CLOCK
DAS TIME2 # AND TURN ON OPERATOR ERROR
TC PHASCHNG # RESTART PROTECT (GROUP 6)
OCT 04026
TC UPTEMP # GO TO ERROR EXIT
DELTATOK TC TPAGREE # FORCE SIGN AGREEMENT
DXCH MPAC
DAS TIME2 # INCREMENT TIME2,TIME1
TC PHASCHNG # RESTART PROTECT (GROUP 6)
OCT 04026
INHINT
INDEX UPTEMP # (CODED THIS WAY FOR RESTART PROTECTION)
TC 1 # NORMAL RETURN
# VERB 71 BRANCH
UPEND71 CAE UPBUFF +1 # SET EBANK
TS EBANK # AND
MASK LOW8 # CALCULATE
## Page 1498
TS UPTEMP # S-REG VALUE OF RECEIVING AREA
AD NEG3 # IN THE PROCESS OF
AD COMPNUMB # PERFORMING
EXTEND # THIS UPDATE
BZF STORLP71 # WILL WE
MASK BIT9 # OVERFLOW
CCS A # INTO THE NEXT EBANK....
TCF UPERROUT # YES
CA NEG3 # NO - CALCULATE NUMBER OF
AD COMPNUMB # WORDS TO BE STORED MINUS ONE
STORLP71 TS MPAC # SAVE NO. OF WORDS REMAINING MINUS ONE
INDEX A # TAKE NEXT UPDATE WORD FROM
CA UPBUFF +2 # UPBUFF AND
TS L # SAVE IT IN L
CA MPAC # CALCULATE NEXT
AD UPTEMP # RECEIVING ADDRESS
INDEX A
EBANK= 1400
LXCH 1400 # UPDATE THE REGISTER BY CONTENTS OF L
EBANK= TEPHEM
CCS MPAC # ARE THERE ANY WORDS LEFT TO BE STORED
TCF STORLP71 # YES
TCF UPOUT # NO - THEN EXIT UPDATE PROGRAM
UPERROUT TC FALTON # TURN ON OP ERROR, CCS CANT GET HERE
TCF UPOUT # NO - EXIT UPDATE (HERE WHEN COMPNUMB = 3)
# VERB 72 BRANCH
UPEND72 CAF BIT1 # HAVE AN ODD NO. OF COMPONENTS
MASK COMPNUMB # BEEN SENT FOR A V72 UPDATE...
CCS A
TCF +2 # YES
TCF UPERROUT # ERROR - SHOULD BE ODD NO. OF COMPONENTS
CS BIT2
AD COMPNUMB
LDLOOP72 TS MPAC # NOW PERFORM THE UPDATE
INDEX A
CAE UPBUFF +1 # PICK UP NEXT UPDATE WORD
LXCH A
CCS MPAC # SET POINTER TO ECADR (MUST BE CCS)
TS MPAC
INDEX A
CAE UPBUFF +1 # PICK UP NEXT ECADR OF REG TO BE UPDATED
TS EBANK # SET EBANK
MASK LOW8 # ISOLATE RELATIVE ADDRESS
INDEX A
EBANK= 1400
## Page 1499
LXCH 1400 # UPDATE THE REGISTER BY CONTENTS OF L
EBANK= TEPHEM
CCS MPAC # ARE WE THROUGH THE V72 UPDATE...
TCF LDLOOP72 # NO
# NORMAL FINISH OF P27
UPOUT EQUALS
TC INTWAKEU # RELEASE GRAB OF ORBITAL INTEGRATION
+1 CAE UPOLDMOD # RESTORE PRIOR P27 MODE
TC NEWMODEA
CS BIT1
AD MODREG
CCS A
CCS A
CAF TWO
TS DNLSTCOD
TC UPACTOFF # TURN OFF 'UPLINK ACTIVITY' LIGHT
TC BANKCALL # KILL GROUP 6
CADR UPKLEAN
TC ENDEXT # EXTENDED VERB EXIT
# VERB 70 BRANCH
UPEND70 EXTEND # V70 DOES THE FOLLOWING WITH DP DELTA
DCS UPBUFF # TIME IN UPBUFF
DXCH UPBUFF +8D
TC TIMEDIDL # DECREMENT AGC CLOCK
TC UPERROUT # ERROR WHILE DECREMENTING CLOCK -- EXIT
EBANK= TEPHEM
EXTEND
DCS UPBUFF # COPY DECREMENTERS FOR
DXCH UPBUFF +10D # RESTART PROTECTION
EXTEND
DCS UPBUFF
DXCH UPBUFF +12D
TC PHASCHNG # RESTART PROTECT (GROUP 6)
OCT 04026
CAF ZERO
ZL
DXCH UPBUFF +10D # DECREMENT CSM STATE VECTOR TIME
DAS TETCSM
## Page 1500
CAF ZERO
ZL
DXCH UPBUFF +12D # DECREMENT LEM STATE VECTOR TIME
DAS TETLEM
CAF ZERO
ZL
DXCH UPBUFF
DAS TEPHEM +1 # INCREMENT TP TEPHEM
ADS TEPHEM
TC PHASCHNG # RESTART PROTECT (GROUP 6)
OCT 04026
EBANK= UPBUFF
TC UPOUT # GO TO STANDARD UPDATE PROGRAM EXIT
# VERB 73 BRANCH
UPEND73 EXTEND
DCA UPBUFF
DXCH UPBUFF +8D
TC TIMEDIDL
TC FALTON
TC UPOUT +1
# ERROR SEQUENCE
SBANK= LOWSUPER
|
{
"pile_set_name": "Github"
}
|
File=pdfsettings.kcfg
ClassName=PDFSettings
Mutators=true
Singleton=true
|
{
"pile_set_name": "Github"
}
|
---
layout: base
title: 'Statistics of orphan in UD_Classical_Chinese-Kyoto'
udver: '2'
---
## Treebank Statistics: UD_Classical_Chinese-Kyoto: Relations: `orphan`
This relation is universal.
2 nodes (0%) are attached to their parents as `orphan`.
2 instances of `orphan` (100%) are left-to-right (parent precedes child).
Average distance between parent and child is 1.
The following 1 pairs of parts of speech are connected with `orphan`: <tt><a href="lzh_kyoto-pos-VERB.html">VERB</a></tt>-<tt><a href="lzh_kyoto-pos-CCONJ.html">CCONJ</a></tt> (2; 100% instances).
~~~ conllu
# visual-style 2 bgColor:blue
# visual-style 2 fgColor:white
# visual-style 1 bgColor:blue
# visual-style 1 fgColor:white
# visual-style 1 2 orphan color:blue
1 學 學 VERB v,動詞,行為,動作 _ 3 acl _ Gloss=study|SpaceAfter=No
2 而 而 CCONJ p,助詞,接続,並列 _ 1 orphan _ Gloss=and|SpaceAfter=No
3 篇 篇 NOUN n,名詞,可搬,伝達 _ 0 root _ Gloss=section-of-a-book|SpaceAfter=No
4 第 第 NOUN n,名詞,数量,* _ 3 list _ Gloss=order-in-a-sequence|SpaceAfter=No
5 一 一 NUM n,数詞,数字,* _ 4 nummod _ Gloss=one|SpacesAfter=\n
~~~
|
{
"pile_set_name": "Github"
}
|
// Copyright 2019 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.
package aip0231
import (
"github.com/googleapis/api-linter/lint"
"github.com/googleapis/api-linter/rules/internal/utils"
"github.com/jhump/protoreflect/desc"
)
// Batch Get methods should use the HTTP GET verb.
var httpVerb = &lint.MethodRule{
Name: lint.NewRuleName(231, "http-method"),
OnlyIf: isBatchGetMethod,
LintMethod: func(m *desc.MethodDescriptor) []lint.Problem {
// Rule check: Establish that the RPC uses HTTP GET.
for _, httpRule := range utils.GetHTTPRules(m) {
if httpRule.Method != "GET" {
return []lint.Problem{{
Message: "Batch Get methods must use the HTTP GET verb.",
Descriptor: m,
}}
}
}
return nil
},
}
|
{
"pile_set_name": "Github"
}
|
/* Generated by RuntimeBrowser
Image: /System/Library/PrivateFrameworks/CoreSuggestions.framework/CoreSuggestions
*/
@interface SGMNLEventInBanner : NSObject {
PETScalarEventTracker * _tracker;
}
@property (nonatomic, readonly) PETScalarEventTracker *tracker;
- (void).cxx_destruct;
- (id)init;
- (void)trackEventWithScalar:(unsigned long long)arg1 app:(struct SGMBannerDisplayApp_ { unsigned long long x1; })arg2 eventType:(id)arg3;
- (id)tracker;
@end
|
{
"pile_set_name": "Github"
}
|
' 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 Microsoft.CodeAnalysis.Editor.UnitTests
Imports Microsoft.VisualStudio.Composition
Imports Microsoft.VisualStudio.LanguageServices.CSharp.CodeModel
Imports Microsoft.VisualStudio.LanguageServices.VisualBasic.CodeModel
Namespace Microsoft.VisualStudio.LanguageServices.UnitTests
Public Module VisualStudioTestExportProvider
Private ReadOnly _exportProvider As ExportProvider
Private ReadOnly _partCatalog As ComposableCatalog
Sub New()
Dim additionalAssemblies = {GetType(CSharpCodeModelService).Assembly,
GetType(VisualBasicCodeModelService).Assembly}
_partCatalog = TestExportProvider.EntireAssemblyCatalogWithCSharpAndVisualBasic.WithParts(MinimalTestExportProvider.CreateAssemblyCatalog(additionalAssemblies))
_exportProvider = MinimalTestExportProvider.CreateExportProvider(_partCatalog)
End Sub
Public ReadOnly Property ExportProvider As ExportProvider
Get
Return _exportProvider
End Get
End Property
Public ReadOnly Property PartCatalog As ComposableCatalog
Get
Return _partCatalog
End Get
End Property
End Module
End Namespace
|
{
"pile_set_name": "Github"
}
|
/*global QUnit */
/*eslint no-undef:1, no-unused-vars:1, strict: 1 */
sap.ui.define([
"sap/ui/qunit/utils/createAndAppendDiv",
"sap/m/HBox",
"sap/ui/core/HTML",
"sap/m/FlexItemData",
"sap/m/VBox",
"sap/m/App",
"sap/m/Page",
"jquery.sap.global",
"sap/ui/dom/includeStylesheet"
], function(
createAndAppendDiv,
HBox,
HTML,
FlexItemData,
VBox,
App,
Page,
jQuery,
includeStylesheet
) {
createAndAppendDiv("content");
var outerhboxWidth,
outerhboxHeight,
vboxWidth,
vboxHeight,
innerhboxWidth,
innerhboxHeight,
item1Width,
item1Height,
item2Width,
item2Height,
item3Width,
item3Height,
item4Width,
item4Height,
item5Width,
item5Height,
item6Width,
item6Height;
var oOuterHBox = new HBox("outerHBox", {
items: [
new HTML("panel1", {
content: "<div></div>",
layoutData: new FlexItemData({ growFactor: 2, id: "item1" })
}),
new HTML("panel2", {
content: "<div></div>",
layoutData: new FlexItemData({ growFactor: 3, id: "item2" })
}),
new VBox("vbox", {
items: [
new HTML("panel3", {
content: "<div></div>",
layoutData: new FlexItemData({ growFactor: 5, id: "item3" })
}),
new HBox("innerHBox", {
items: [
new HTML("panel4", {
content: "<div></div>",
layoutData: new FlexItemData({ growFactor: 1, id: "item4" })
}),
new HTML("panel5", {
content: "<div></div>",
layoutData: new FlexItemData({ growFactor: 1, id: "item5" })
})
],
fitContainer: true,
alignItems: "Stretch",
layoutData: new FlexItemData({ growFactor: 3 })
})
],
fitContainer: true,
layoutData: new FlexItemData({ growFactor: 5 })
}),
new HTML("panel6", {
content:"<div></div>",
layoutData: new FlexItemData({ growFactor: 5, id: "item6" })
})
],
fitContainer: true,
alignItems: "Stretch"
});
var app = new App();
app.placeAt("content");
app.addPage(new Page("page", {
enableScrolling: false,
content: [
oOuterHBox
]
}));
QUnit.test("Flex Boxes rendered", function(assert) {
assert.ok(jQuery.sap.domById("outerHBox"), "Outer HBox should be rendered");
assert.ok(jQuery.sap.domById("item1"), "item 1 should be rendered");
assert.ok(jQuery.sap.domById("item2"), "Item 2 should be rendered");
assert.ok(jQuery.sap.domById("vbox"), "VBox should be rendered");
assert.ok(jQuery.sap.domById("item3"), "Item 3 should be rendered");
assert.ok(jQuery.sap.domById("innerHBox"), "Inner HBox should be rendered");
assert.ok(jQuery.sap.domById("item4"), "Item 4 should be rendered");
assert.ok(jQuery.sap.domById("item5"), "Item 5 should be rendered");
assert.ok(jQuery.sap.domById("item6"), "Item 6 should be rendered");
});
QUnit.test("Width and height correct", function(assert) {
assert.ok(Math.abs(jQuery.sap.domById("outerHBox").offsetWidth - outerhboxWidth) <= 1, "Outer HBox should have the correct width");
assert.ok(Math.abs(jQuery.sap.domById("outerHBox").offsetHeight - outerhboxHeight) <= 1, "Outer HBox should have the correct height");
assert.ok(Math.abs(jQuery.sap.domById("vbox").offsetWidth - vboxWidth) <= 1, "VBox should have the correct width");
assert.ok(Math.abs(jQuery.sap.domById("vbox").offsetHeight - vboxHeight) <= 1, "VBox should have the correct height");
assert.ok(Math.abs(jQuery.sap.domById("innerHBox").offsetWidth - innerhboxWidth) <= 1, "Inner HBox should have the correct width");
assert.ok(Math.abs(jQuery.sap.domById("innerHBox").offsetHeight - innerhboxHeight) <= 1, "Inner HBox should have the correct height");
assert.ok(Math.abs(jQuery.sap.domById("item1").offsetWidth - item1Width) <= 1, "Item 1 should have the correct width");
assert.ok(Math.abs(jQuery.sap.domById("item1").offsetHeight - item1Height) <= 1, "Item 1 should have the correct height");
assert.ok(Math.abs(jQuery.sap.domById("item2").offsetWidth - item2Width) <= 1, "Item 2 should have the correct width");
assert.ok(Math.abs(jQuery.sap.domById("item2").offsetHeight - item2Height) <= 1, "Item 2 should have the correct height");
assert.ok(Math.abs(jQuery.sap.domById("item3").offsetWidth - item3Width) <= 1, "Item 3 should have the correct width");
assert.ok(Math.abs(jQuery.sap.domById("item3").offsetHeight - item3Height) <= 1, "Item 3 should have the correct height");
assert.ok(Math.abs(jQuery.sap.domById("item4").offsetWidth - item4Width) <= 1, "Item 4 should have the correct width");
assert.ok(Math.abs(jQuery.sap.domById("item4").offsetHeight - item4Height) <= 1, "Item 4 should have the correct height");
assert.ok(Math.abs(jQuery.sap.domById("item5").offsetWidth - item5Width) <= 1, "Item 5 should have the correct width");
assert.ok(Math.abs(jQuery.sap.domById("item5").offsetHeight - item5Height) <= 1, "Item 5 should have the correct height");
assert.ok(Math.abs(jQuery.sap.domById("item6").offsetWidth - item6Width) <= 1, "Item 6 should have the correct width");
assert.ok(Math.abs(jQuery.sap.domById("item6").offsetHeight - item6Height) <= 1, "Item 6 should have the correct height");
});
// include stylesheet, wait for it + 1000ms then calculate expected sizes.
// test starter will wait for the returned promise
return includeStylesheet({
url: sap.ui.require.toUrl("test-resources/sap/m/qunit/FlexBoxFit.css")
}).then(function() {
// HACK: enforce scrollbars
// - with a dedicated *.qunit.html page, the QUnit header + 100% body always enforced a scrollbar
// - with the generic test starter, the QUnit header get a height only after all tests have been created
document.getElementById("qunit").setAttribute("style", "height:200px;");
return new Promise(function(resolve) {
setTimeout(function() {
// Calculate width and height for the elements
outerhboxWidth = jQuery.sap.domById("page-cont").offsetWidth;
outerhboxHeight = jQuery.sap.domById("page-cont").offsetHeight;
vboxWidth = outerhboxWidth * ( 5 / 15 );
vboxHeight = outerhboxHeight;
innerhboxWidth = outerhboxWidth * ( 5 / 15 );
innerhboxHeight = outerhboxHeight * ( 3 / 8 );
item1Width = outerhboxWidth * ( 2 / 15 );
item1Height = outerhboxHeight;
item2Width = outerhboxWidth * ( 3 / 15 );
item2Height = outerhboxHeight;
item3Width = outerhboxWidth * ( 5 / 15 );
item3Height = outerhboxHeight * ( 5 / 8 );
item4Width = outerhboxWidth * ( 5 / 15 ) / 2;
item4Height = outerhboxHeight * ( 3 / 8 );
item5Width = outerhboxWidth * ( 5 / 15 ) / 2;
item5Height = outerhboxHeight * ( 3 / 8 );
item6Width = outerhboxWidth * ( 5 / 15 );
item6Height = outerhboxHeight;
resolve();
}, 1000);
});
});
});
|
{
"pile_set_name": "Github"
}
|
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2016 The Go Authors. All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package proto
import (
"errors"
"fmt"
"io"
"math"
"reflect"
"strconv"
"strings"
"sync"
"sync/atomic"
"unicode/utf8"
)
// Unmarshal is the entry point from the generated .pb.go files.
// This function is not intended to be used by non-generated code.
// This function is not subject to any compatibility guarantee.
// msg contains a pointer to a protocol buffer struct.
// b is the data to be unmarshaled into the protocol buffer.
// a is a pointer to a place to store cached unmarshal information.
func (a *InternalMessageInfo) Unmarshal(msg Message, b []byte) error {
// Load the unmarshal information for this message type.
// The atomic load ensures memory consistency.
u := atomicLoadUnmarshalInfo(&a.unmarshal)
if u == nil {
// Slow path: find unmarshal info for msg, update a with it.
u = getUnmarshalInfo(reflect.TypeOf(msg).Elem())
atomicStoreUnmarshalInfo(&a.unmarshal, u)
}
// Then do the unmarshaling.
err := u.unmarshal(toPointer(&msg), b)
return err
}
type unmarshalInfo struct {
typ reflect.Type // type of the protobuf struct
// 0 = only typ field is initialized
// 1 = completely initialized
initialized int32
lock sync.Mutex // prevents double initialization
dense []unmarshalFieldInfo // fields indexed by tag #
sparse map[uint64]unmarshalFieldInfo // fields indexed by tag #
reqFields []string // names of required fields
reqMask uint64 // 1<<len(reqFields)-1
unrecognized field // offset of []byte to put unrecognized data (or invalidField if we should throw it away)
extensions field // offset of extensions field (of type proto.XXX_InternalExtensions), or invalidField if it does not exist
oldExtensions field // offset of old-form extensions field (of type map[int]Extension)
extensionRanges []ExtensionRange // if non-nil, implies extensions field is valid
isMessageSet bool // if true, implies extensions field is valid
bytesExtensions field // offset of XXX_extensions with type []byte
}
// An unmarshaler takes a stream of bytes and a pointer to a field of a message.
// It decodes the field, stores it at f, and returns the unused bytes.
// w is the wire encoding.
// b is the data after the tag and wire encoding have been read.
type unmarshaler func(b []byte, f pointer, w int) ([]byte, error)
type unmarshalFieldInfo struct {
// location of the field in the proto message structure.
field field
// function to unmarshal the data for the field.
unmarshal unmarshaler
// if a required field, contains a single set bit at this field's index in the required field list.
reqMask uint64
name string // name of the field, for error reporting
}
var (
unmarshalInfoMap = map[reflect.Type]*unmarshalInfo{}
unmarshalInfoLock sync.Mutex
)
// getUnmarshalInfo returns the data structure which can be
// subsequently used to unmarshal a message of the given type.
// t is the type of the message (note: not pointer to message).
func getUnmarshalInfo(t reflect.Type) *unmarshalInfo {
// It would be correct to return a new unmarshalInfo
// unconditionally. We would end up allocating one
// per occurrence of that type as a message or submessage.
// We use a cache here just to reduce memory usage.
unmarshalInfoLock.Lock()
defer unmarshalInfoLock.Unlock()
u := unmarshalInfoMap[t]
if u == nil {
u = &unmarshalInfo{typ: t}
// Note: we just set the type here. The rest of the fields
// will be initialized on first use.
unmarshalInfoMap[t] = u
}
return u
}
// unmarshal does the main work of unmarshaling a message.
// u provides type information used to unmarshal the message.
// m is a pointer to a protocol buffer message.
// b is a byte stream to unmarshal into m.
// This is top routine used when recursively unmarshaling submessages.
func (u *unmarshalInfo) unmarshal(m pointer, b []byte) error {
if atomic.LoadInt32(&u.initialized) == 0 {
u.computeUnmarshalInfo()
}
if u.isMessageSet {
return unmarshalMessageSet(b, m.offset(u.extensions).toExtensions())
}
var reqMask uint64 // bitmask of required fields we've seen.
var errLater error
for len(b) > 0 {
// Read tag and wire type.
// Special case 1 and 2 byte varints.
var x uint64
if b[0] < 128 {
x = uint64(b[0])
b = b[1:]
} else if len(b) >= 2 && b[1] < 128 {
x = uint64(b[0]&0x7f) + uint64(b[1])<<7
b = b[2:]
} else {
var n int
x, n = decodeVarint(b)
if n == 0 {
return io.ErrUnexpectedEOF
}
b = b[n:]
}
tag := x >> 3
wire := int(x) & 7
// Dispatch on the tag to one of the unmarshal* functions below.
var f unmarshalFieldInfo
if tag < uint64(len(u.dense)) {
f = u.dense[tag]
} else {
f = u.sparse[tag]
}
if fn := f.unmarshal; fn != nil {
var err error
b, err = fn(b, m.offset(f.field), wire)
if err == nil {
reqMask |= f.reqMask
continue
}
if r, ok := err.(*RequiredNotSetError); ok {
// Remember this error, but keep parsing. We need to produce
// a full parse even if a required field is missing.
if errLater == nil {
errLater = r
}
reqMask |= f.reqMask
continue
}
if err != errInternalBadWireType {
if err == errInvalidUTF8 {
if errLater == nil {
fullName := revProtoTypes[reflect.PtrTo(u.typ)] + "." + f.name
errLater = &invalidUTF8Error{fullName}
}
continue
}
return err
}
// Fragments with bad wire type are treated as unknown fields.
}
// Unknown tag.
if !u.unrecognized.IsValid() {
// Don't keep unrecognized data; just skip it.
var err error
b, err = skipField(b, wire)
if err != nil {
return err
}
continue
}
// Keep unrecognized data around.
// maybe in extensions, maybe in the unrecognized field.
z := m.offset(u.unrecognized).toBytes()
var emap map[int32]Extension
var e Extension
for _, r := range u.extensionRanges {
if uint64(r.Start) <= tag && tag <= uint64(r.End) {
if u.extensions.IsValid() {
mp := m.offset(u.extensions).toExtensions()
emap = mp.extensionsWrite()
e = emap[int32(tag)]
z = &e.enc
break
}
if u.oldExtensions.IsValid() {
p := m.offset(u.oldExtensions).toOldExtensions()
emap = *p
if emap == nil {
emap = map[int32]Extension{}
*p = emap
}
e = emap[int32(tag)]
z = &e.enc
break
}
if u.bytesExtensions.IsValid() {
z = m.offset(u.bytesExtensions).toBytes()
break
}
panic("no extensions field available")
}
}
// Use wire type to skip data.
var err error
b0 := b
b, err = skipField(b, wire)
if err != nil {
return err
}
*z = encodeVarint(*z, tag<<3|uint64(wire))
*z = append(*z, b0[:len(b0)-len(b)]...)
if emap != nil {
emap[int32(tag)] = e
}
}
if reqMask != u.reqMask && errLater == nil {
// A required field of this message is missing.
for _, n := range u.reqFields {
if reqMask&1 == 0 {
errLater = &RequiredNotSetError{n}
}
reqMask >>= 1
}
}
return errLater
}
// computeUnmarshalInfo fills in u with information for use
// in unmarshaling protocol buffers of type u.typ.
func (u *unmarshalInfo) computeUnmarshalInfo() {
u.lock.Lock()
defer u.lock.Unlock()
if u.initialized != 0 {
return
}
t := u.typ
n := t.NumField()
// Set up the "not found" value for the unrecognized byte buffer.
// This is the default for proto3.
u.unrecognized = invalidField
u.extensions = invalidField
u.oldExtensions = invalidField
u.bytesExtensions = invalidField
// List of the generated type and offset for each oneof field.
type oneofField struct {
ityp reflect.Type // interface type of oneof field
field field // offset in containing message
}
var oneofFields []oneofField
for i := 0; i < n; i++ {
f := t.Field(i)
if f.Name == "XXX_unrecognized" {
// The byte slice used to hold unrecognized input is special.
if f.Type != reflect.TypeOf(([]byte)(nil)) {
panic("bad type for XXX_unrecognized field: " + f.Type.Name())
}
u.unrecognized = toField(&f)
continue
}
if f.Name == "XXX_InternalExtensions" {
// Ditto here.
if f.Type != reflect.TypeOf(XXX_InternalExtensions{}) {
panic("bad type for XXX_InternalExtensions field: " + f.Type.Name())
}
u.extensions = toField(&f)
if f.Tag.Get("protobuf_messageset") == "1" {
u.isMessageSet = true
}
continue
}
if f.Name == "XXX_extensions" {
// An older form of the extensions field.
if f.Type == reflect.TypeOf((map[int32]Extension)(nil)) {
u.oldExtensions = toField(&f)
continue
} else if f.Type == reflect.TypeOf(([]byte)(nil)) {
u.bytesExtensions = toField(&f)
continue
}
panic("bad type for XXX_extensions field: " + f.Type.Name())
}
if f.Name == "XXX_NoUnkeyedLiteral" || f.Name == "XXX_sizecache" {
continue
}
oneof := f.Tag.Get("protobuf_oneof")
if oneof != "" {
oneofFields = append(oneofFields, oneofField{f.Type, toField(&f)})
// The rest of oneof processing happens below.
continue
}
tags := f.Tag.Get("protobuf")
tagArray := strings.Split(tags, ",")
if len(tagArray) < 2 {
panic("protobuf tag not enough fields in " + t.Name() + "." + f.Name + ": " + tags)
}
tag, err := strconv.Atoi(tagArray[1])
if err != nil {
panic("protobuf tag field not an integer: " + tagArray[1])
}
name := ""
for _, tag := range tagArray[3:] {
if strings.HasPrefix(tag, "name=") {
name = tag[5:]
}
}
// Extract unmarshaling function from the field (its type and tags).
unmarshal := fieldUnmarshaler(&f)
// Required field?
var reqMask uint64
if tagArray[2] == "req" {
bit := len(u.reqFields)
u.reqFields = append(u.reqFields, name)
reqMask = uint64(1) << uint(bit)
// TODO: if we have more than 64 required fields, we end up
// not verifying that all required fields are present.
// Fix this, perhaps using a count of required fields?
}
// Store the info in the correct slot in the message.
u.setTag(tag, toField(&f), unmarshal, reqMask, name)
}
// Find any types associated with oneof fields.
// gogo: len(oneofFields) > 0 is needed for embedded oneof messages, without a marshaler and unmarshaler
if len(oneofFields) > 0 {
var oneofImplementers []interface{}
switch m := reflect.Zero(reflect.PtrTo(t)).Interface().(type) {
case oneofFuncsIface:
_, _, _, oneofImplementers = m.XXX_OneofFuncs()
case oneofWrappersIface:
oneofImplementers = m.XXX_OneofWrappers()
}
for _, v := range oneofImplementers {
tptr := reflect.TypeOf(v) // *Msg_X
typ := tptr.Elem() // Msg_X
f := typ.Field(0) // oneof implementers have one field
baseUnmarshal := fieldUnmarshaler(&f)
tags := strings.Split(f.Tag.Get("protobuf"), ",")
fieldNum, err := strconv.Atoi(tags[1])
if err != nil {
panic("protobuf tag field not an integer: " + tags[1])
}
var name string
for _, tag := range tags {
if strings.HasPrefix(tag, "name=") {
name = strings.TrimPrefix(tag, "name=")
break
}
}
// Find the oneof field that this struct implements.
// Might take O(n^2) to process all of the oneofs, but who cares.
for _, of := range oneofFields {
if tptr.Implements(of.ityp) {
// We have found the corresponding interface for this struct.
// That lets us know where this struct should be stored
// when we encounter it during unmarshaling.
unmarshal := makeUnmarshalOneof(typ, of.ityp, baseUnmarshal)
u.setTag(fieldNum, of.field, unmarshal, 0, name)
}
}
}
}
// Get extension ranges, if any.
fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray")
if fn.IsValid() {
if !u.extensions.IsValid() && !u.oldExtensions.IsValid() && !u.bytesExtensions.IsValid() {
panic("a message with extensions, but no extensions field in " + t.Name())
}
u.extensionRanges = fn.Call(nil)[0].Interface().([]ExtensionRange)
}
// Explicitly disallow tag 0. This will ensure we flag an error
// when decoding a buffer of all zeros. Without this code, we
// would decode and skip an all-zero buffer of even length.
// [0 0] is [tag=0/wiretype=varint varint-encoded-0].
u.setTag(0, zeroField, func(b []byte, f pointer, w int) ([]byte, error) {
return nil, fmt.Errorf("proto: %s: illegal tag 0 (wire type %d)", t, w)
}, 0, "")
// Set mask for required field check.
u.reqMask = uint64(1)<<uint(len(u.reqFields)) - 1
atomic.StoreInt32(&u.initialized, 1)
}
// setTag stores the unmarshal information for the given tag.
// tag = tag # for field
// field/unmarshal = unmarshal info for that field.
// reqMask = if required, bitmask for field position in required field list. 0 otherwise.
// name = short name of the field.
func (u *unmarshalInfo) setTag(tag int, field field, unmarshal unmarshaler, reqMask uint64, name string) {
i := unmarshalFieldInfo{field: field, unmarshal: unmarshal, reqMask: reqMask, name: name}
n := u.typ.NumField()
if tag >= 0 && (tag < 16 || tag < 2*n) { // TODO: what are the right numbers here?
for len(u.dense) <= tag {
u.dense = append(u.dense, unmarshalFieldInfo{})
}
u.dense[tag] = i
return
}
if u.sparse == nil {
u.sparse = map[uint64]unmarshalFieldInfo{}
}
u.sparse[uint64(tag)] = i
}
// fieldUnmarshaler returns an unmarshaler for the given field.
func fieldUnmarshaler(f *reflect.StructField) unmarshaler {
if f.Type.Kind() == reflect.Map {
return makeUnmarshalMap(f)
}
return typeUnmarshaler(f.Type, f.Tag.Get("protobuf"))
}
// typeUnmarshaler returns an unmarshaler for the given field type / field tag pair.
func typeUnmarshaler(t reflect.Type, tags string) unmarshaler {
tagArray := strings.Split(tags, ",")
encoding := tagArray[0]
name := "unknown"
ctype := false
isTime := false
isDuration := false
isWktPointer := false
proto3 := false
validateUTF8 := true
for _, tag := range tagArray[3:] {
if strings.HasPrefix(tag, "name=") {
name = tag[5:]
}
if tag == "proto3" {
proto3 = true
}
if strings.HasPrefix(tag, "customtype=") {
ctype = true
}
if tag == "stdtime" {
isTime = true
}
if tag == "stdduration" {
isDuration = true
}
if tag == "wktptr" {
isWktPointer = true
}
}
validateUTF8 = validateUTF8 && proto3
// Figure out packaging (pointer, slice, or both)
slice := false
pointer := false
if t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 {
slice = true
t = t.Elem()
}
if t.Kind() == reflect.Ptr {
pointer = true
t = t.Elem()
}
if ctype {
if reflect.PtrTo(t).Implements(customType) {
if slice {
return makeUnmarshalCustomSlice(getUnmarshalInfo(t), name)
}
if pointer {
return makeUnmarshalCustomPtr(getUnmarshalInfo(t), name)
}
return makeUnmarshalCustom(getUnmarshalInfo(t), name)
} else {
panic(fmt.Sprintf("custom type: type: %v, does not implement the proto.custom interface", t))
}
}
if isTime {
if pointer {
if slice {
return makeUnmarshalTimePtrSlice(getUnmarshalInfo(t), name)
}
return makeUnmarshalTimePtr(getUnmarshalInfo(t), name)
}
if slice {
return makeUnmarshalTimeSlice(getUnmarshalInfo(t), name)
}
return makeUnmarshalTime(getUnmarshalInfo(t), name)
}
if isDuration {
if pointer {
if slice {
return makeUnmarshalDurationPtrSlice(getUnmarshalInfo(t), name)
}
return makeUnmarshalDurationPtr(getUnmarshalInfo(t), name)
}
if slice {
return makeUnmarshalDurationSlice(getUnmarshalInfo(t), name)
}
return makeUnmarshalDuration(getUnmarshalInfo(t), name)
}
if isWktPointer {
switch t.Kind() {
case reflect.Float64:
if pointer {
if slice {
return makeStdDoubleValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdDoubleValuePtrUnmarshaler(getUnmarshalInfo(t), name)
}
if slice {
return makeStdDoubleValueSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdDoubleValueUnmarshaler(getUnmarshalInfo(t), name)
case reflect.Float32:
if pointer {
if slice {
return makeStdFloatValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdFloatValuePtrUnmarshaler(getUnmarshalInfo(t), name)
}
if slice {
return makeStdFloatValueSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdFloatValueUnmarshaler(getUnmarshalInfo(t), name)
case reflect.Int64:
if pointer {
if slice {
return makeStdInt64ValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdInt64ValuePtrUnmarshaler(getUnmarshalInfo(t), name)
}
if slice {
return makeStdInt64ValueSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdInt64ValueUnmarshaler(getUnmarshalInfo(t), name)
case reflect.Uint64:
if pointer {
if slice {
return makeStdUInt64ValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdUInt64ValuePtrUnmarshaler(getUnmarshalInfo(t), name)
}
if slice {
return makeStdUInt64ValueSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdUInt64ValueUnmarshaler(getUnmarshalInfo(t), name)
case reflect.Int32:
if pointer {
if slice {
return makeStdInt32ValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdInt32ValuePtrUnmarshaler(getUnmarshalInfo(t), name)
}
if slice {
return makeStdInt32ValueSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdInt32ValueUnmarshaler(getUnmarshalInfo(t), name)
case reflect.Uint32:
if pointer {
if slice {
return makeStdUInt32ValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdUInt32ValuePtrUnmarshaler(getUnmarshalInfo(t), name)
}
if slice {
return makeStdUInt32ValueSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdUInt32ValueUnmarshaler(getUnmarshalInfo(t), name)
case reflect.Bool:
if pointer {
if slice {
return makeStdBoolValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdBoolValuePtrUnmarshaler(getUnmarshalInfo(t), name)
}
if slice {
return makeStdBoolValueSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdBoolValueUnmarshaler(getUnmarshalInfo(t), name)
case reflect.String:
if pointer {
if slice {
return makeStdStringValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdStringValuePtrUnmarshaler(getUnmarshalInfo(t), name)
}
if slice {
return makeStdStringValueSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdStringValueUnmarshaler(getUnmarshalInfo(t), name)
case uint8SliceType:
if pointer {
if slice {
return makeStdBytesValuePtrSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdBytesValuePtrUnmarshaler(getUnmarshalInfo(t), name)
}
if slice {
return makeStdBytesValueSliceUnmarshaler(getUnmarshalInfo(t), name)
}
return makeStdBytesValueUnmarshaler(getUnmarshalInfo(t), name)
default:
panic(fmt.Sprintf("unknown wktpointer type %#v", t))
}
}
// We'll never have both pointer and slice for basic types.
if pointer && slice && t.Kind() != reflect.Struct {
panic("both pointer and slice for basic type in " + t.Name())
}
switch t.Kind() {
case reflect.Bool:
if pointer {
return unmarshalBoolPtr
}
if slice {
return unmarshalBoolSlice
}
return unmarshalBoolValue
case reflect.Int32:
switch encoding {
case "fixed32":
if pointer {
return unmarshalFixedS32Ptr
}
if slice {
return unmarshalFixedS32Slice
}
return unmarshalFixedS32Value
case "varint":
// this could be int32 or enum
if pointer {
return unmarshalInt32Ptr
}
if slice {
return unmarshalInt32Slice
}
return unmarshalInt32Value
case "zigzag32":
if pointer {
return unmarshalSint32Ptr
}
if slice {
return unmarshalSint32Slice
}
return unmarshalSint32Value
}
case reflect.Int64:
switch encoding {
case "fixed64":
if pointer {
return unmarshalFixedS64Ptr
}
if slice {
return unmarshalFixedS64Slice
}
return unmarshalFixedS64Value
case "varint":
if pointer {
return unmarshalInt64Ptr
}
if slice {
return unmarshalInt64Slice
}
return unmarshalInt64Value
case "zigzag64":
if pointer {
return unmarshalSint64Ptr
}
if slice {
return unmarshalSint64Slice
}
return unmarshalSint64Value
}
case reflect.Uint32:
switch encoding {
case "fixed32":
if pointer {
return unmarshalFixed32Ptr
}
if slice {
return unmarshalFixed32Slice
}
return unmarshalFixed32Value
case "varint":
if pointer {
return unmarshalUint32Ptr
}
if slice {
return unmarshalUint32Slice
}
return unmarshalUint32Value
}
case reflect.Uint64:
switch encoding {
case "fixed64":
if pointer {
return unmarshalFixed64Ptr
}
if slice {
return unmarshalFixed64Slice
}
return unmarshalFixed64Value
case "varint":
if pointer {
return unmarshalUint64Ptr
}
if slice {
return unmarshalUint64Slice
}
return unmarshalUint64Value
}
case reflect.Float32:
if pointer {
return unmarshalFloat32Ptr
}
if slice {
return unmarshalFloat32Slice
}
return unmarshalFloat32Value
case reflect.Float64:
if pointer {
return unmarshalFloat64Ptr
}
if slice {
return unmarshalFloat64Slice
}
return unmarshalFloat64Value
case reflect.Map:
panic("map type in typeUnmarshaler in " + t.Name())
case reflect.Slice:
if pointer {
panic("bad pointer in slice case in " + t.Name())
}
if slice {
return unmarshalBytesSlice
}
return unmarshalBytesValue
case reflect.String:
if validateUTF8 {
if pointer {
return unmarshalUTF8StringPtr
}
if slice {
return unmarshalUTF8StringSlice
}
return unmarshalUTF8StringValue
}
if pointer {
return unmarshalStringPtr
}
if slice {
return unmarshalStringSlice
}
return unmarshalStringValue
case reflect.Struct:
// message or group field
if !pointer {
switch encoding {
case "bytes":
if slice {
return makeUnmarshalMessageSlice(getUnmarshalInfo(t), name)
}
return makeUnmarshalMessage(getUnmarshalInfo(t), name)
}
}
switch encoding {
case "bytes":
if slice {
return makeUnmarshalMessageSlicePtr(getUnmarshalInfo(t), name)
}
return makeUnmarshalMessagePtr(getUnmarshalInfo(t), name)
case "group":
if slice {
return makeUnmarshalGroupSlicePtr(getUnmarshalInfo(t), name)
}
return makeUnmarshalGroupPtr(getUnmarshalInfo(t), name)
}
}
panic(fmt.Sprintf("unmarshaler not found type:%s encoding:%s", t, encoding))
}
// Below are all the unmarshalers for individual fields of various types.
func unmarshalInt64Value(b []byte, f pointer, w int) ([]byte, error) {
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := int64(x)
*f.toInt64() = v
return b, nil
}
func unmarshalInt64Ptr(b []byte, f pointer, w int) ([]byte, error) {
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := int64(x)
*f.toInt64Ptr() = &v
return b, nil
}
func unmarshalInt64Slice(b []byte, f pointer, w int) ([]byte, error) {
if w == WireBytes { // packed
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
res := b[x:]
b = b[:x]
for len(b) > 0 {
x, n = decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := int64(x)
s := f.toInt64Slice()
*s = append(*s, v)
}
return res, nil
}
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := int64(x)
s := f.toInt64Slice()
*s = append(*s, v)
return b, nil
}
func unmarshalSint64Value(b []byte, f pointer, w int) ([]byte, error) {
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := int64(x>>1) ^ int64(x)<<63>>63
*f.toInt64() = v
return b, nil
}
func unmarshalSint64Ptr(b []byte, f pointer, w int) ([]byte, error) {
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := int64(x>>1) ^ int64(x)<<63>>63
*f.toInt64Ptr() = &v
return b, nil
}
func unmarshalSint64Slice(b []byte, f pointer, w int) ([]byte, error) {
if w == WireBytes { // packed
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
res := b[x:]
b = b[:x]
for len(b) > 0 {
x, n = decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := int64(x>>1) ^ int64(x)<<63>>63
s := f.toInt64Slice()
*s = append(*s, v)
}
return res, nil
}
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := int64(x>>1) ^ int64(x)<<63>>63
s := f.toInt64Slice()
*s = append(*s, v)
return b, nil
}
func unmarshalUint64Value(b []byte, f pointer, w int) ([]byte, error) {
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := uint64(x)
*f.toUint64() = v
return b, nil
}
func unmarshalUint64Ptr(b []byte, f pointer, w int) ([]byte, error) {
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := uint64(x)
*f.toUint64Ptr() = &v
return b, nil
}
func unmarshalUint64Slice(b []byte, f pointer, w int) ([]byte, error) {
if w == WireBytes { // packed
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
res := b[x:]
b = b[:x]
for len(b) > 0 {
x, n = decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := uint64(x)
s := f.toUint64Slice()
*s = append(*s, v)
}
return res, nil
}
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := uint64(x)
s := f.toUint64Slice()
*s = append(*s, v)
return b, nil
}
func unmarshalInt32Value(b []byte, f pointer, w int) ([]byte, error) {
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := int32(x)
*f.toInt32() = v
return b, nil
}
func unmarshalInt32Ptr(b []byte, f pointer, w int) ([]byte, error) {
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := int32(x)
f.setInt32Ptr(v)
return b, nil
}
func unmarshalInt32Slice(b []byte, f pointer, w int) ([]byte, error) {
if w == WireBytes { // packed
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
res := b[x:]
b = b[:x]
for len(b) > 0 {
x, n = decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := int32(x)
f.appendInt32Slice(v)
}
return res, nil
}
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := int32(x)
f.appendInt32Slice(v)
return b, nil
}
func unmarshalSint32Value(b []byte, f pointer, w int) ([]byte, error) {
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := int32(x>>1) ^ int32(x)<<31>>31
*f.toInt32() = v
return b, nil
}
func unmarshalSint32Ptr(b []byte, f pointer, w int) ([]byte, error) {
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := int32(x>>1) ^ int32(x)<<31>>31
f.setInt32Ptr(v)
return b, nil
}
func unmarshalSint32Slice(b []byte, f pointer, w int) ([]byte, error) {
if w == WireBytes { // packed
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
res := b[x:]
b = b[:x]
for len(b) > 0 {
x, n = decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := int32(x>>1) ^ int32(x)<<31>>31
f.appendInt32Slice(v)
}
return res, nil
}
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := int32(x>>1) ^ int32(x)<<31>>31
f.appendInt32Slice(v)
return b, nil
}
func unmarshalUint32Value(b []byte, f pointer, w int) ([]byte, error) {
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := uint32(x)
*f.toUint32() = v
return b, nil
}
func unmarshalUint32Ptr(b []byte, f pointer, w int) ([]byte, error) {
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := uint32(x)
*f.toUint32Ptr() = &v
return b, nil
}
func unmarshalUint32Slice(b []byte, f pointer, w int) ([]byte, error) {
if w == WireBytes { // packed
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
res := b[x:]
b = b[:x]
for len(b) > 0 {
x, n = decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := uint32(x)
s := f.toUint32Slice()
*s = append(*s, v)
}
return res, nil
}
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
v := uint32(x)
s := f.toUint32Slice()
*s = append(*s, v)
return b, nil
}
func unmarshalFixed64Value(b []byte, f pointer, w int) ([]byte, error) {
if w != WireFixed64 {
return b, errInternalBadWireType
}
if len(b) < 8 {
return nil, io.ErrUnexpectedEOF
}
v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
*f.toUint64() = v
return b[8:], nil
}
func unmarshalFixed64Ptr(b []byte, f pointer, w int) ([]byte, error) {
if w != WireFixed64 {
return b, errInternalBadWireType
}
if len(b) < 8 {
return nil, io.ErrUnexpectedEOF
}
v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
*f.toUint64Ptr() = &v
return b[8:], nil
}
func unmarshalFixed64Slice(b []byte, f pointer, w int) ([]byte, error) {
if w == WireBytes { // packed
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
res := b[x:]
b = b[:x]
for len(b) > 0 {
if len(b) < 8 {
return nil, io.ErrUnexpectedEOF
}
v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
s := f.toUint64Slice()
*s = append(*s, v)
b = b[8:]
}
return res, nil
}
if w != WireFixed64 {
return b, errInternalBadWireType
}
if len(b) < 8 {
return nil, io.ErrUnexpectedEOF
}
v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
s := f.toUint64Slice()
*s = append(*s, v)
return b[8:], nil
}
func unmarshalFixedS64Value(b []byte, f pointer, w int) ([]byte, error) {
if w != WireFixed64 {
return b, errInternalBadWireType
}
if len(b) < 8 {
return nil, io.ErrUnexpectedEOF
}
v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56
*f.toInt64() = v
return b[8:], nil
}
func unmarshalFixedS64Ptr(b []byte, f pointer, w int) ([]byte, error) {
if w != WireFixed64 {
return b, errInternalBadWireType
}
if len(b) < 8 {
return nil, io.ErrUnexpectedEOF
}
v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56
*f.toInt64Ptr() = &v
return b[8:], nil
}
func unmarshalFixedS64Slice(b []byte, f pointer, w int) ([]byte, error) {
if w == WireBytes { // packed
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
res := b[x:]
b = b[:x]
for len(b) > 0 {
if len(b) < 8 {
return nil, io.ErrUnexpectedEOF
}
v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56
s := f.toInt64Slice()
*s = append(*s, v)
b = b[8:]
}
return res, nil
}
if w != WireFixed64 {
return b, errInternalBadWireType
}
if len(b) < 8 {
return nil, io.ErrUnexpectedEOF
}
v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56
s := f.toInt64Slice()
*s = append(*s, v)
return b[8:], nil
}
func unmarshalFixed32Value(b []byte, f pointer, w int) ([]byte, error) {
if w != WireFixed32 {
return b, errInternalBadWireType
}
if len(b) < 4 {
return nil, io.ErrUnexpectedEOF
}
v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
*f.toUint32() = v
return b[4:], nil
}
func unmarshalFixed32Ptr(b []byte, f pointer, w int) ([]byte, error) {
if w != WireFixed32 {
return b, errInternalBadWireType
}
if len(b) < 4 {
return nil, io.ErrUnexpectedEOF
}
v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
*f.toUint32Ptr() = &v
return b[4:], nil
}
func unmarshalFixed32Slice(b []byte, f pointer, w int) ([]byte, error) {
if w == WireBytes { // packed
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
res := b[x:]
b = b[:x]
for len(b) > 0 {
if len(b) < 4 {
return nil, io.ErrUnexpectedEOF
}
v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
s := f.toUint32Slice()
*s = append(*s, v)
b = b[4:]
}
return res, nil
}
if w != WireFixed32 {
return b, errInternalBadWireType
}
if len(b) < 4 {
return nil, io.ErrUnexpectedEOF
}
v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
s := f.toUint32Slice()
*s = append(*s, v)
return b[4:], nil
}
func unmarshalFixedS32Value(b []byte, f pointer, w int) ([]byte, error) {
if w != WireFixed32 {
return b, errInternalBadWireType
}
if len(b) < 4 {
return nil, io.ErrUnexpectedEOF
}
v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24
*f.toInt32() = v
return b[4:], nil
}
func unmarshalFixedS32Ptr(b []byte, f pointer, w int) ([]byte, error) {
if w != WireFixed32 {
return b, errInternalBadWireType
}
if len(b) < 4 {
return nil, io.ErrUnexpectedEOF
}
v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24
f.setInt32Ptr(v)
return b[4:], nil
}
func unmarshalFixedS32Slice(b []byte, f pointer, w int) ([]byte, error) {
if w == WireBytes { // packed
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
res := b[x:]
b = b[:x]
for len(b) > 0 {
if len(b) < 4 {
return nil, io.ErrUnexpectedEOF
}
v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24
f.appendInt32Slice(v)
b = b[4:]
}
return res, nil
}
if w != WireFixed32 {
return b, errInternalBadWireType
}
if len(b) < 4 {
return nil, io.ErrUnexpectedEOF
}
v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24
f.appendInt32Slice(v)
return b[4:], nil
}
func unmarshalBoolValue(b []byte, f pointer, w int) ([]byte, error) {
if w != WireVarint {
return b, errInternalBadWireType
}
// Note: any length varint is allowed, even though any sane
// encoder will use one byte.
// See https://github.com/golang/protobuf/issues/76
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
// TODO: check if x>1? Tests seem to indicate no.
v := x != 0
*f.toBool() = v
return b[n:], nil
}
func unmarshalBoolPtr(b []byte, f pointer, w int) ([]byte, error) {
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
v := x != 0
*f.toBoolPtr() = &v
return b[n:], nil
}
func unmarshalBoolSlice(b []byte, f pointer, w int) ([]byte, error) {
if w == WireBytes { // packed
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
res := b[x:]
b = b[:x]
for len(b) > 0 {
x, n = decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
v := x != 0
s := f.toBoolSlice()
*s = append(*s, v)
b = b[n:]
}
return res, nil
}
if w != WireVarint {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
v := x != 0
s := f.toBoolSlice()
*s = append(*s, v)
return b[n:], nil
}
func unmarshalFloat64Value(b []byte, f pointer, w int) ([]byte, error) {
if w != WireFixed64 {
return b, errInternalBadWireType
}
if len(b) < 8 {
return nil, io.ErrUnexpectedEOF
}
v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56)
*f.toFloat64() = v
return b[8:], nil
}
func unmarshalFloat64Ptr(b []byte, f pointer, w int) ([]byte, error) {
if w != WireFixed64 {
return b, errInternalBadWireType
}
if len(b) < 8 {
return nil, io.ErrUnexpectedEOF
}
v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56)
*f.toFloat64Ptr() = &v
return b[8:], nil
}
func unmarshalFloat64Slice(b []byte, f pointer, w int) ([]byte, error) {
if w == WireBytes { // packed
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
res := b[x:]
b = b[:x]
for len(b) > 0 {
if len(b) < 8 {
return nil, io.ErrUnexpectedEOF
}
v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56)
s := f.toFloat64Slice()
*s = append(*s, v)
b = b[8:]
}
return res, nil
}
if w != WireFixed64 {
return b, errInternalBadWireType
}
if len(b) < 8 {
return nil, io.ErrUnexpectedEOF
}
v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56)
s := f.toFloat64Slice()
*s = append(*s, v)
return b[8:], nil
}
func unmarshalFloat32Value(b []byte, f pointer, w int) ([]byte, error) {
if w != WireFixed32 {
return b, errInternalBadWireType
}
if len(b) < 4 {
return nil, io.ErrUnexpectedEOF
}
v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24)
*f.toFloat32() = v
return b[4:], nil
}
func unmarshalFloat32Ptr(b []byte, f pointer, w int) ([]byte, error) {
if w != WireFixed32 {
return b, errInternalBadWireType
}
if len(b) < 4 {
return nil, io.ErrUnexpectedEOF
}
v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24)
*f.toFloat32Ptr() = &v
return b[4:], nil
}
func unmarshalFloat32Slice(b []byte, f pointer, w int) ([]byte, error) {
if w == WireBytes { // packed
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
res := b[x:]
b = b[:x]
for len(b) > 0 {
if len(b) < 4 {
return nil, io.ErrUnexpectedEOF
}
v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24)
s := f.toFloat32Slice()
*s = append(*s, v)
b = b[4:]
}
return res, nil
}
if w != WireFixed32 {
return b, errInternalBadWireType
}
if len(b) < 4 {
return nil, io.ErrUnexpectedEOF
}
v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24)
s := f.toFloat32Slice()
*s = append(*s, v)
return b[4:], nil
}
func unmarshalStringValue(b []byte, f pointer, w int) ([]byte, error) {
if w != WireBytes {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
v := string(b[:x])
*f.toString() = v
return b[x:], nil
}
func unmarshalStringPtr(b []byte, f pointer, w int) ([]byte, error) {
if w != WireBytes {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
v := string(b[:x])
*f.toStringPtr() = &v
return b[x:], nil
}
func unmarshalStringSlice(b []byte, f pointer, w int) ([]byte, error) {
if w != WireBytes {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
v := string(b[:x])
s := f.toStringSlice()
*s = append(*s, v)
return b[x:], nil
}
func unmarshalUTF8StringValue(b []byte, f pointer, w int) ([]byte, error) {
if w != WireBytes {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
v := string(b[:x])
*f.toString() = v
if !utf8.ValidString(v) {
return b[x:], errInvalidUTF8
}
return b[x:], nil
}
func unmarshalUTF8StringPtr(b []byte, f pointer, w int) ([]byte, error) {
if w != WireBytes {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
v := string(b[:x])
*f.toStringPtr() = &v
if !utf8.ValidString(v) {
return b[x:], errInvalidUTF8
}
return b[x:], nil
}
func unmarshalUTF8StringSlice(b []byte, f pointer, w int) ([]byte, error) {
if w != WireBytes {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
v := string(b[:x])
s := f.toStringSlice()
*s = append(*s, v)
if !utf8.ValidString(v) {
return b[x:], errInvalidUTF8
}
return b[x:], nil
}
var emptyBuf [0]byte
func unmarshalBytesValue(b []byte, f pointer, w int) ([]byte, error) {
if w != WireBytes {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
// The use of append here is a trick which avoids the zeroing
// that would be required if we used a make/copy pair.
// We append to emptyBuf instead of nil because we want
// a non-nil result even when the length is 0.
v := append(emptyBuf[:], b[:x]...)
*f.toBytes() = v
return b[x:], nil
}
func unmarshalBytesSlice(b []byte, f pointer, w int) ([]byte, error) {
if w != WireBytes {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
v := append(emptyBuf[:], b[:x]...)
s := f.toBytesSlice()
*s = append(*s, v)
return b[x:], nil
}
func makeUnmarshalMessagePtr(sub *unmarshalInfo, name string) unmarshaler {
return func(b []byte, f pointer, w int) ([]byte, error) {
if w != WireBytes {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
// First read the message field to see if something is there.
// The semantics of multiple submessages are weird. Instead of
// the last one winning (as it is for all other fields), multiple
// submessages are merged.
v := f.getPointer()
if v.isNil() {
v = valToPointer(reflect.New(sub.typ))
f.setPointer(v)
}
err := sub.unmarshal(v, b[:x])
if err != nil {
if r, ok := err.(*RequiredNotSetError); ok {
r.field = name + "." + r.field
} else {
return nil, err
}
}
return b[x:], err
}
}
func makeUnmarshalMessageSlicePtr(sub *unmarshalInfo, name string) unmarshaler {
return func(b []byte, f pointer, w int) ([]byte, error) {
if w != WireBytes {
return b, errInternalBadWireType
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
v := valToPointer(reflect.New(sub.typ))
err := sub.unmarshal(v, b[:x])
if err != nil {
if r, ok := err.(*RequiredNotSetError); ok {
r.field = name + "." + r.field
} else {
return nil, err
}
}
f.appendPointer(v)
return b[x:], err
}
}
func makeUnmarshalGroupPtr(sub *unmarshalInfo, name string) unmarshaler {
return func(b []byte, f pointer, w int) ([]byte, error) {
if w != WireStartGroup {
return b, errInternalBadWireType
}
x, y := findEndGroup(b)
if x < 0 {
return nil, io.ErrUnexpectedEOF
}
v := f.getPointer()
if v.isNil() {
v = valToPointer(reflect.New(sub.typ))
f.setPointer(v)
}
err := sub.unmarshal(v, b[:x])
if err != nil {
if r, ok := err.(*RequiredNotSetError); ok {
r.field = name + "." + r.field
} else {
return nil, err
}
}
return b[y:], err
}
}
func makeUnmarshalGroupSlicePtr(sub *unmarshalInfo, name string) unmarshaler {
return func(b []byte, f pointer, w int) ([]byte, error) {
if w != WireStartGroup {
return b, errInternalBadWireType
}
x, y := findEndGroup(b)
if x < 0 {
return nil, io.ErrUnexpectedEOF
}
v := valToPointer(reflect.New(sub.typ))
err := sub.unmarshal(v, b[:x])
if err != nil {
if r, ok := err.(*RequiredNotSetError); ok {
r.field = name + "." + r.field
} else {
return nil, err
}
}
f.appendPointer(v)
return b[y:], err
}
}
func makeUnmarshalMap(f *reflect.StructField) unmarshaler {
t := f.Type
kt := t.Key()
vt := t.Elem()
tagArray := strings.Split(f.Tag.Get("protobuf"), ",")
valTags := strings.Split(f.Tag.Get("protobuf_val"), ",")
for _, t := range tagArray {
if strings.HasPrefix(t, "customtype=") {
valTags = append(valTags, t)
}
if t == "stdtime" {
valTags = append(valTags, t)
}
if t == "stdduration" {
valTags = append(valTags, t)
}
if t == "wktptr" {
valTags = append(valTags, t)
}
}
unmarshalKey := typeUnmarshaler(kt, f.Tag.Get("protobuf_key"))
unmarshalVal := typeUnmarshaler(vt, strings.Join(valTags, ","))
return func(b []byte, f pointer, w int) ([]byte, error) {
// The map entry is a submessage. Figure out how big it is.
if w != WireBytes {
return nil, fmt.Errorf("proto: bad wiretype for map field: got %d want %d", w, WireBytes)
}
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
b = b[n:]
if x > uint64(len(b)) {
return nil, io.ErrUnexpectedEOF
}
r := b[x:] // unused data to return
b = b[:x] // data for map entry
// Note: we could use #keys * #values ~= 200 functions
// to do map decoding without reflection. Probably not worth it.
// Maps will be somewhat slow. Oh well.
// Read key and value from data.
var nerr nonFatal
k := reflect.New(kt)
v := reflect.New(vt)
for len(b) > 0 {
x, n := decodeVarint(b)
if n == 0 {
return nil, io.ErrUnexpectedEOF
}
wire := int(x) & 7
b = b[n:]
var err error
switch x >> 3 {
case 1:
b, err = unmarshalKey(b, valToPointer(k), wire)
case 2:
b, err = unmarshalVal(b, valToPointer(v), wire)
default:
err = errInternalBadWireType // skip unknown tag
}
if nerr.Merge(err) {
continue
}
if err != errInternalBadWireType {
return nil, err
}
// Skip past unknown fields.
b, err = skipField(b, wire)
if err != nil {
return nil, err
}
}
// Get map, allocate if needed.
m := f.asPointerTo(t).Elem() // an addressable map[K]T
if m.IsNil() {
m.Set(reflect.MakeMap(t))
}
// Insert into map.
m.SetMapIndex(k.Elem(), v.Elem())
return r, nerr.E
}
}
// makeUnmarshalOneof makes an unmarshaler for oneof fields.
// for:
// message Msg {
// oneof F {
// int64 X = 1;
// float64 Y = 2;
// }
// }
// typ is the type of the concrete entry for a oneof case (e.g. Msg_X).
// ityp is the interface type of the oneof field (e.g. isMsg_F).
// unmarshal is the unmarshaler for the base type of the oneof case (e.g. int64).
// Note that this function will be called once for each case in the oneof.
func makeUnmarshalOneof(typ, ityp reflect.Type, unmarshal unmarshaler) unmarshaler {
sf := typ.Field(0)
field0 := toField(&sf)
return func(b []byte, f pointer, w int) ([]byte, error) {
// Allocate holder for value.
v := reflect.New(typ)
// Unmarshal data into holder.
// We unmarshal into the first field of the holder object.
var err error
var nerr nonFatal
b, err = unmarshal(b, valToPointer(v).offset(field0), w)
if !nerr.Merge(err) {
return nil, err
}
// Write pointer to holder into target field.
f.asPointerTo(ityp).Elem().Set(v)
return b, nerr.E
}
}
// Error used by decode internally.
var errInternalBadWireType = errors.New("proto: internal error: bad wiretype")
// skipField skips past a field of type wire and returns the remaining bytes.
func skipField(b []byte, wire int) ([]byte, error) {
switch wire {
case WireVarint:
_, k := decodeVarint(b)
if k == 0 {
return b, io.ErrUnexpectedEOF
}
b = b[k:]
case WireFixed32:
if len(b) < 4 {
return b, io.ErrUnexpectedEOF
}
b = b[4:]
case WireFixed64:
if len(b) < 8 {
return b, io.ErrUnexpectedEOF
}
b = b[8:]
case WireBytes:
m, k := decodeVarint(b)
if k == 0 || uint64(len(b)-k) < m {
return b, io.ErrUnexpectedEOF
}
b = b[uint64(k)+m:]
case WireStartGroup:
_, i := findEndGroup(b)
if i == -1 {
return b, io.ErrUnexpectedEOF
}
b = b[i:]
default:
return b, fmt.Errorf("proto: can't skip unknown wire type %d", wire)
}
return b, nil
}
// findEndGroup finds the index of the next EndGroup tag.
// Groups may be nested, so the "next" EndGroup tag is the first
// unpaired EndGroup.
// findEndGroup returns the indexes of the start and end of the EndGroup tag.
// Returns (-1,-1) if it can't find one.
func findEndGroup(b []byte) (int, int) {
depth := 1
i := 0
for {
x, n := decodeVarint(b[i:])
if n == 0 {
return -1, -1
}
j := i
i += n
switch x & 7 {
case WireVarint:
_, k := decodeVarint(b[i:])
if k == 0 {
return -1, -1
}
i += k
case WireFixed32:
if len(b)-4 < i {
return -1, -1
}
i += 4
case WireFixed64:
if len(b)-8 < i {
return -1, -1
}
i += 8
case WireBytes:
m, k := decodeVarint(b[i:])
if k == 0 {
return -1, -1
}
i += k
if uint64(len(b)-i) < m {
return -1, -1
}
i += int(m)
case WireStartGroup:
depth++
case WireEndGroup:
depth--
if depth == 0 {
return j, i
}
default:
return -1, -1
}
}
}
// encodeVarint appends a varint-encoded integer to b and returns the result.
func encodeVarint(b []byte, x uint64) []byte {
for x >= 1<<7 {
b = append(b, byte(x&0x7f|0x80))
x >>= 7
}
return append(b, byte(x))
}
// decodeVarint reads a varint-encoded integer from b.
// Returns the decoded integer and the number of bytes read.
// If there is an error, it returns 0,0.
func decodeVarint(b []byte) (uint64, int) {
var x, y uint64
if len(b) == 0 {
goto bad
}
x = uint64(b[0])
if x < 0x80 {
return x, 1
}
x -= 0x80
if len(b) <= 1 {
goto bad
}
y = uint64(b[1])
x += y << 7
if y < 0x80 {
return x, 2
}
x -= 0x80 << 7
if len(b) <= 2 {
goto bad
}
y = uint64(b[2])
x += y << 14
if y < 0x80 {
return x, 3
}
x -= 0x80 << 14
if len(b) <= 3 {
goto bad
}
y = uint64(b[3])
x += y << 21
if y < 0x80 {
return x, 4
}
x -= 0x80 << 21
if len(b) <= 4 {
goto bad
}
y = uint64(b[4])
x += y << 28
if y < 0x80 {
return x, 5
}
x -= 0x80 << 28
if len(b) <= 5 {
goto bad
}
y = uint64(b[5])
x += y << 35
if y < 0x80 {
return x, 6
}
x -= 0x80 << 35
if len(b) <= 6 {
goto bad
}
y = uint64(b[6])
x += y << 42
if y < 0x80 {
return x, 7
}
x -= 0x80 << 42
if len(b) <= 7 {
goto bad
}
y = uint64(b[7])
x += y << 49
if y < 0x80 {
return x, 8
}
x -= 0x80 << 49
if len(b) <= 8 {
goto bad
}
y = uint64(b[8])
x += y << 56
if y < 0x80 {
return x, 9
}
x -= 0x80 << 56
if len(b) <= 9 {
goto bad
}
y = uint64(b[9])
x += y << 63
if y < 2 {
return x, 10
}
bad:
return 0, 0
}
|
{
"pile_set_name": "Github"
}
|
@@toc { depth=3 }
《Scala 实用指南》
一本写给Java开发者的Scala快速入门书。
@@@ index
* [目录](contents.md)
@@@
|
{
"pile_set_name": "Github"
}
|
import Header from './Header'
export default Header
|
{
"pile_set_name": "Github"
}
|
//
// PrefsSleep.m
// KisMAC
//
// Created by Michael Thole on Mon Jan 20 2003.
// Copyright (c) 2003 Michael Thole. All rights reserved.
//
#import "PrefsSleep.h"
#import "WaveHelper.h"
@implementation PrefsSleep
-(void)updateUI {
[aNoSleep setState:[[controller objectForKey:@"disableSleepMode"] boolValue]];
}
-(IBAction)setValueForSender:(id)sender {
if(sender == aNoSleep) {
[controller setObject:[NSNumber numberWithBool:[sender state]] forKey:@"disableSleepMode"];
}
else {
NSLog(@"Error: Invalid sender(%@) in setValueForSender:",sender);
}
}
@end
|
{
"pile_set_name": "Github"
}
|
" smcl.vim -- Vim syntax file for smcl files.
" Language: SMCL -- Stata Markup and Control Language
" Maintainer: Jeff Pitblado <jpitblado@stata.com>
" Last Change: 26apr2006
" Version: 1.1.2
" Log:
" 20mar2003 updated the match definition for cmdab
" 14apr2006 'syntax clear' only under version control
" check for 'b:current_syntax', removed 'did_smcl_syntax_inits'
" 26apr2006 changed 'stata_smcl' to 'smcl'
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
syntax case match
syn keyword smclCCLword current_date contained
syn keyword smclCCLword current_time contained
syn keyword smclCCLword rmsg_time contained
syn keyword smclCCLword stata_version contained
syn keyword smclCCLword version contained
syn keyword smclCCLword born_date contained
syn keyword smclCCLword flavor contained
syn keyword smclCCLword SE contained
syn keyword smclCCLword mode contained
syn keyword smclCCLword console contained
syn keyword smclCCLword os contained
syn keyword smclCCLword osdtl contained
syn keyword smclCCLword machine_type contained
syn keyword smclCCLword byteorder contained
syn keyword smclCCLword sysdir_stata contained
syn keyword smclCCLword sysdir_updates contained
syn keyword smclCCLword sysdir_base contained
syn keyword smclCCLword sysdir_site contained
syn keyword smclCCLword sysdir_plus contained
syn keyword smclCCLword sysdir_personal contained
syn keyword smclCCLword sysdir_oldplace contained
syn keyword smclCCLword adopath contained
syn keyword smclCCLword pwd contained
syn keyword smclCCLword dirsep contained
syn keyword smclCCLword max_N_theory contained
syn keyword smclCCLword max_N_current contained
syn keyword smclCCLword max_k_theory contained
syn keyword smclCCLword max_k_current contained
syn keyword smclCCLword max_width_theory contained
syn keyword smclCCLword max_width_current contained
syn keyword smclCCLword max_matsize contained
syn keyword smclCCLword min_matsize contained
syn keyword smclCCLword max_macrolen contained
syn keyword smclCCLword macrolen contained
syn keyword smclCCLword max_cmdlen contained
syn keyword smclCCLword cmdlen contained
syn keyword smclCCLword namelen contained
syn keyword smclCCLword mindouble contained
syn keyword smclCCLword maxdouble contained
syn keyword smclCCLword epsdouble contained
syn keyword smclCCLword minfloat contained
syn keyword smclCCLword maxfloat contained
syn keyword smclCCLword epsfloat contained
syn keyword smclCCLword minlong contained
syn keyword smclCCLword maxlong contained
syn keyword smclCCLword minint contained
syn keyword smclCCLword maxint contained
syn keyword smclCCLword minbyte contained
syn keyword smclCCLword maxbyte contained
syn keyword smclCCLword maxstrvarlen contained
syn keyword smclCCLword memory contained
syn keyword smclCCLword maxvar contained
syn keyword smclCCLword matsize contained
syn keyword smclCCLword N contained
syn keyword smclCCLword k contained
syn keyword smclCCLword width contained
syn keyword smclCCLword changed contained
syn keyword smclCCLword filename contained
syn keyword smclCCLword filedate contained
syn keyword smclCCLword more contained
syn keyword smclCCLword rmsg contained
syn keyword smclCCLword dp contained
syn keyword smclCCLword linesize contained
syn keyword smclCCLword pagesize contained
syn keyword smclCCLword logtype contained
syn keyword smclCCLword linegap contained
syn keyword smclCCLword scrollbufsize contained
syn keyword smclCCLword varlabelpos contained
syn keyword smclCCLword reventries contained
syn keyword smclCCLword graphics contained
syn keyword smclCCLword scheme contained
syn keyword smclCCLword printcolor contained
syn keyword smclCCLword adosize contained
syn keyword smclCCLword maxdb contained
syn keyword smclCCLword virtual contained
syn keyword smclCCLword checksum contained
syn keyword smclCCLword timeout1 contained
syn keyword smclCCLword timeout2 contained
syn keyword smclCCLword httpproxy contained
syn keyword smclCCLword h_current contained
syn keyword smclCCLword max_matsize contained
syn keyword smclCCLword min_matsize contained
syn keyword smclCCLword max_macrolen contained
syn keyword smclCCLword macrolen contained
syn keyword smclCCLword max_cmdlen contained
syn keyword smclCCLword cmdlen contained
syn keyword smclCCLword namelen contained
syn keyword smclCCLword mindouble contained
syn keyword smclCCLword maxdouble contained
syn keyword smclCCLword epsdouble contained
syn keyword smclCCLword minfloat contained
syn keyword smclCCLword maxfloat contained
syn keyword smclCCLword epsfloat contained
syn keyword smclCCLword minlong contained
syn keyword smclCCLword maxlong contained
syn keyword smclCCLword minint contained
syn keyword smclCCLword maxint contained
syn keyword smclCCLword minbyte contained
syn keyword smclCCLword maxbyte contained
syn keyword smclCCLword maxstrvarlen contained
syn keyword smclCCLword memory contained
syn keyword smclCCLword maxvar contained
syn keyword smclCCLword matsize contained
syn keyword smclCCLword N contained
syn keyword smclCCLword k contained
syn keyword smclCCLword width contained
syn keyword smclCCLword changed contained
syn keyword smclCCLword filename contained
syn keyword smclCCLword filedate contained
syn keyword smclCCLword more contained
syn keyword smclCCLword rmsg contained
syn keyword smclCCLword dp contained
syn keyword smclCCLword linesize contained
syn keyword smclCCLword pagesize contained
syn keyword smclCCLword logtype contained
syn keyword smclCCLword linegap contained
syn keyword smclCCLword scrollbufsize contained
syn keyword smclCCLword varlabelpos contained
syn keyword smclCCLword reventries contained
syn keyword smclCCLword graphics contained
syn keyword smclCCLword scheme contained
syn keyword smclCCLword printcolor contained
syn keyword smclCCLword adosize contained
syn keyword smclCCLword maxdb contained
syn keyword smclCCLword virtual contained
syn keyword smclCCLword checksum contained
syn keyword smclCCLword timeout1 contained
syn keyword smclCCLword timeout2 contained
syn keyword smclCCLword httpproxy contained
syn keyword smclCCLword httpproxyhost contained
syn keyword smclCCLword httpproxyport contained
syn keyword smclCCLword httpproxyauth contained
syn keyword smclCCLword httpproxyuser contained
syn keyword smclCCLword httpproxypw contained
syn keyword smclCCLword trace contained
syn keyword smclCCLword tracedepth contained
syn keyword smclCCLword tracesep contained
syn keyword smclCCLword traceindent contained
syn keyword smclCCLword traceexapnd contained
syn keyword smclCCLword tracenumber contained
syn keyword smclCCLword type contained
syn keyword smclCCLword level contained
syn keyword smclCCLword seed contained
syn keyword smclCCLword searchdefault contained
syn keyword smclCCLword pi contained
syn keyword smclCCLword rc contained
" Directive for the contant and current-value class
syn region smclCCL start=/{ccl / end=/}/ oneline contains=smclCCLword
" The order of the following syntax definitions is roughly that of the on-line
" documentation for smcl in Stata, from within Stata see help smcl.
" Format directives for line and paragraph modes
syn match smclFormat /{smcl}/
syn match smclFormat /{sf\(\|:[^}]\+\)}/
syn match smclFormat /{it\(\|:[^}]\+\)}/
syn match smclFormat /{bf\(\|:[^}]\+\)}/
syn match smclFormat /{inp\(\|:[^}]\+\)}/
syn match smclFormat /{input\(\|:[^}]\+\)}/
syn match smclFormat /{err\(\|:[^}]\+\)}/
syn match smclFormat /{error\(\|:[^}]\+\)}/
syn match smclFormat /{res\(\|:[^}]\+\)}/
syn match smclFormat /{result\(\|:[^}]\+\)}/
syn match smclFormat /{txt\(\|:[^}]\+\)}/
syn match smclFormat /{text\(\|:[^}]\+\)}/
syn match smclFormat /{com\(\|:[^}]\+\)}/
syn match smclFormat /{cmd\(\|:[^}]\+\)}/
syn match smclFormat /{cmdab:[^:}]\+:[^:}()]*\(\|:\|:(\|:()\)}/
syn match smclFormat /{hi\(\|:[^}]\+\)}/
syn match smclFormat /{hilite\(\|:[^}]\+\)}/
syn match smclFormat /{ul \(on\|off\)}/
syn match smclFormat /{ul:[^}]\+}/
syn match smclFormat /{hline\(\| \d\+\| -\d\+\|:[^}]\+\)}/
syn match smclFormat /{dup \d\+:[^}]\+}/
syn match smclFormat /{c [^}]\+}/
syn match smclFormat /{char [^}]\+}/
syn match smclFormat /{reset}/
" Formatting directives for line mode
syn match smclFormat /{title:[^}]\+}/
syn match smclFormat /{center:[^}]\+}/
syn match smclFormat /{centre:[^}]\+}/
syn match smclFormat /{center \d\+:[^}]\+}/
syn match smclFormat /{centre \d\+:[^}]\+}/
syn match smclFormat /{right:[^}]\+}/
syn match smclFormat /{lalign \d\+:[^}]\+}/
syn match smclFormat /{ralign \d\+:[^}]\+}/
syn match smclFormat /{\.\.\.}/
syn match smclFormat /{col \d\+}/
syn match smclFormat /{space \d\+}/
syn match smclFormat /{tab}/
" Formatting directives for paragraph mode
syn match smclFormat /{bind:[^}]\+}/
syn match smclFormat /{break}/
syn match smclFormat /{p}/
syn match smclFormat /{p \d\+}/
syn match smclFormat /{p \d\+ \d\+}/
syn match smclFormat /{p \d\+ \d\+ \d\+}/
syn match smclFormat /{pstd}/
syn match smclFormat /{psee}/
syn match smclFormat /{phang\(\|2\|3\)}/
syn match smclFormat /{pmore\(\|2\|3\)}/
syn match smclFormat /{pin\(\|2\|3\)}/
syn match smclFormat /{p_end}/
syn match smclFormat /{opt \w\+\(\|:\w\+\)\(\|([^)}]*)\)}/
syn match smclFormat /{opth \w*\(\|:\w\+\)(\w*)}/
syn match smclFormat /{opth "\w\+\((\w\+:[^)}]\+)\)"}/
syn match smclFormat /{opth \w\+:\w\+(\w\+:[^)}]\+)}/
syn match smclFormat /{dlgtab\s*\(\|\d\+\|\d\+\s\+\d\+\):[^}]\+}/
syn match smclFormat /{p2colset\s\+\d\+\s\+\d\+\s\+\d\+\s\+\d\+}/
syn match smclFormat /{p2col\s\+:[^{}]*}.*{p_end}/
syn match smclFormat /{p2col\s\+:{[^{}]*}}.*{p_end}/
syn match smclFormat /{p2coldent\s*:[^{}]*}.*{p_end}/
syn match smclFormat /{p2coldent\s*:{[^{}]*}}.*{p_end}/
syn match smclFormat /{p2line\s*\(\|\d\+\s\+\d\+\)}/
syn match smclFormat /{p2colreset}/
syn match smclFormat /{synoptset\s\+\d\+\s\+\w\+}/
syn match smclFormat /{synopt\s*:[^{}]*}.*{p_end}/
syn match smclFormat /{synopt\s*:{[^{}]*}}.*{p_end}/
syn match smclFormat /{syntab\s*:[^{}]*}/
syn match smclFormat /{synopthdr}/
syn match smclFormat /{synoptline}/
" Link directive for line and paragraph modes
syn match smclLink /{help [^}]\+}/
syn match smclLink /{helpb [^}]\+}/
syn match smclLink /{help_d:[^}]\+}/
syn match smclLink /{search [^}]\+}/
syn match smclLink /{search_d:[^}]\+}/
syn match smclLink /{browse [^}]\+}/
syn match smclLink /{view [^}]\+}/
syn match smclLink /{view_d:[^}]\+}/
syn match smclLink /{news:[^}]\+}/
syn match smclLink /{net [^}]\+}/
syn match smclLink /{net_d:[^}]\+}/
syn match smclLink /{netfrom_d:[^}]\+}/
syn match smclLink /{ado [^}]\+}/
syn match smclLink /{ado_d:[^}]\+}/
syn match smclLink /{update [^}]\+}/
syn match smclLink /{update_d:[^}]\+}/
syn match smclLink /{dialog [^}]\+}/
syn match smclLink /{back:[^}]\+}/
syn match smclLink /{clearmore:[^}]\+}/
syn match smclLink /{stata [^}]\+}/
syn match smclLink /{newvar\(\|:[^}]\+\)}/
syn match smclLink /{var\(\|:[^}]\+\)}/
syn match smclLink /{varname\(\|:[^}]\+\)}/
syn match smclLink /{vars\(\|:[^}]\+\)}/
syn match smclLink /{varlist\(\|:[^}]\+\)}/
syn match smclLink /{depvar\(\|:[^}]\+\)}/
syn match smclLink /{depvars\(\|:[^}]\+\)}/
syn match smclLink /{depvarlist\(\|:[^}]\+\)}/
syn match smclLink /{indepvars\(\|:[^}]\+\)}/
syn match smclLink /{dtype}/
syn match smclLink /{ifin}/
syn match smclLink /{weight}/
" Comment
syn region smclComment start=/{\*/ end=/}/ oneline
" Strings
syn region smclString matchgroup=Nothing start=/"/ end=/"/ oneline
syn region smclEString matchgroup=Nothing start=/`"/ end=/"'/ oneline contains=smclEString
" assign highlight groups
hi def link smclEString smclString
hi def link smclCCLword Statement
hi def link smclCCL Type
hi def link smclFormat Statement
hi def link smclLink Underlined
hi def link smclComment Comment
hi def link smclString String
let b:current_syntax = "smcl"
" vim: ts=8
|
{
"pile_set_name": "Github"
}
|
from datetime import tzinfo,timedelta
class TomlTz(tzinfo):
def __init__(A,toml_offset):
B=toml_offset
if B=='Z':A._raw_offset='+00:00'
else:A._raw_offset=B
A._sign=-1 if A._raw_offset[0]=='-'else 1;A._hours=int(A._raw_offset[1:3]);A._minutes=int(A._raw_offset[4:6])
def tzname(A,dt):return'UTC'+A._raw_offset
def utcoffset(A,dt):return A._sign*timedelta(hours=A._hours,minutes=A._minutes)
def dst(A,dt):return timedelta(0)
|
{
"pile_set_name": "Github"
}
|
# Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundation. You may not use, modify or
# distribute this program under any other version of the GNU General
# Public License.
#
# Volatility is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Volatility. If not, see <http://www.gnu.org/licenses/>.
#
"""
@author: Andrew Case
@license: GNU General Public License 2.0
@contact: atcuno@gmail.com
@organization:
"""
import volatility.obj as obj
import volatility.plugins.linux.flags as linux_flags
import volatility.plugins.linux.common as linux_common
import volatility.plugins.linux.pslist as linux_pslist
class linux_mount(linux_common.AbstractLinuxCommand):
"""Gather mounted fs/devices"""
def calculate(self):
linux_common.set_plugin_members(self)
mntptr = obj.Object("Pointer", offset = self.addr_space.profile.get_symbol("mount_hashtable"), vm = self.addr_space)
mnt_list = obj.Object(theType = "Array", offset = mntptr.v(), vm = self.addr_space, targetType = "list_head", count = 512)
if self.profile.has_type("mount"):
mnttype = "mount"
for task in linux_pslist.linux_pslist(self._config).calculate():
if task.pid == 1:
ns = task.nsproxy.mnt_ns
break
else:
mnttype = "vfsmount"
ns = None
# get each list_head out of the array
for outerlist in mnt_list:
for mnt in outerlist.list_of_type(mnttype, "mnt_hash"):
yield (mnt, ns)
def parse_mnt(self, data):
'''
We use seen for 3.x kernels with mount namespaces
The same mount can be in multiple namespaces and we do not want to repeat output
'''
for (mnt, ns) in data:
dev_name = mnt.mnt_devname.dereference_as("String", length = linux_common.MAX_STRING_LENGTH)
if not dev_name.is_valid() or len(dev_name) == 0:
continue
fstype = mnt.mnt_sb.s_type.name.dereference_as("String", length = linux_common.MAX_STRING_LENGTH)
if not fstype.is_valid() or len(fstype) == 0:
continue
path = linux_common.do_get_path(mnt.mnt_sb.s_root, mnt.mnt_parent, mnt.mnt_root, mnt)
if path == []:
continue
mnt_string = self.calc_mnt_string(mnt)
if (mnt.mnt_flags & 0x40) or (mnt.mnt_sb.s_flags & 0x1):
rr = "ro"
else:
rr = "rw"
if not ns or ns == mnt.mnt_ns:
yield mnt.mnt_sb, dev_name, path, fstype, rr, mnt_string
def render_text(self, outfd, data):
data = self.parse_mnt(data)
for (_sb, dev_name, path, fstype, rr, mnt_string) in data:
outfd.write("{0:25s} {1:35s} {2:12s} {3:2s}{4:64s}\n".format(dev_name, path, fstype, rr, mnt_string))
def calc_mnt_string(self, mnt):
ret = ""
for mflag in linux_flags.mnt_flags:
if mflag & mnt.mnt_flags:
ret = ret + linux_flags.mnt_flags[mflag]
return ret
|
{
"pile_set_name": "Github"
}
|
//todo: not converted initially - pending
//export = BasicAuthModuleForUTF8;
|
{
"pile_set_name": "Github"
}
|
/*
* Sonatype Nexus (TM) Open Source Version
* Copyright (c) 2018-present Sonatype, Inc.
* All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
*
* This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
* which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
*
* Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
* Eclipse Foundation. All other trademarks are the property of their respective owners.
*/
package org.sonatype.nexus.repository.composer.internal;
import javax.inject.Inject;
import javax.inject.Named;
import org.sonatype.nexus.repository.security.ContentPermissionChecker;
import org.sonatype.nexus.repository.security.SecurityFacetSupport;
import org.sonatype.nexus.repository.security.VariableResolverAdapter;
/**
* Composer format security facet.
*/
@Named
public class ComposerSecurityFacet
extends SecurityFacetSupport
{
@Inject
public ComposerSecurityFacet(final ComposerFormatSecurityContributor securityContributor,
@Named("simple") final VariableResolverAdapter variableResolverAdapter,
final ContentPermissionChecker contentPermissionChecker)
{
super(securityContributor, variableResolverAdapter, contentPermissionChecker);
}
}
|
{
"pile_set_name": "Github"
}
|
using System;
using UnityEngine;
namespace UnityStandardAssets.ImageEffects
{
[ExecuteInEditMode]
[RequireComponent (typeof(Camera))]
[AddComponentMenu ("Image Effects/Bloom and Glow/Bloom")]
public class Bloom : PostEffectsBase
{
public enum LensFlareStyle
{
Ghosting = 0,
Anamorphic = 1,
Combined = 2,
}
public enum TweakMode
{
Basic = 0,
Complex = 1,
}
public enum HDRBloomMode
{
Auto = 0,
On = 1,
Off = 2,
}
public enum BloomScreenBlendMode
{
Screen = 0,
Add = 1,
}
public enum BloomQuality
{
Cheap = 0,
High = 1,
}
public TweakMode tweakMode = 0;
public BloomScreenBlendMode screenBlendMode = BloomScreenBlendMode.Add;
public HDRBloomMode hdr = HDRBloomMode.Auto;
private bool doHdr = false;
public float sepBlurSpread = 2.5f;
public BloomQuality quality = BloomQuality.High;
public float bloomIntensity = 0.5f;
public float bloomThreshold = 0.5f;
public Color bloomThresholdColor = Color.white;
public int bloomBlurIterations = 2;
public int hollywoodFlareBlurIterations = 2;
public float flareRotation = 0.0f;
public LensFlareStyle lensflareMode = (LensFlareStyle) 1;
public float hollyStretchWidth = 2.5f;
public float lensflareIntensity = 0.0f;
public float lensflareThreshold = 0.3f;
public float lensFlareSaturation = 0.75f;
public Color flareColorA = new Color (0.4f, 0.4f, 0.8f, 0.75f);
public Color flareColorB = new Color (0.4f, 0.8f, 0.8f, 0.75f);
public Color flareColorC = new Color (0.8f, 0.4f, 0.8f, 0.75f);
public Color flareColorD = new Color (0.8f, 0.4f, 0.0f, 0.75f);
public Texture2D lensFlareVignetteMask;
public Shader lensFlareShader;
private Material lensFlareMaterial;
public Shader screenBlendShader;
private Material screenBlend;
public Shader blurAndFlaresShader;
private Material blurAndFlaresMaterial;
public Shader brightPassFilterShader;
private Material brightPassFilterMaterial;
public override bool CheckResources ()
{
CheckSupport (false);
screenBlend = CheckShaderAndCreateMaterial (screenBlendShader, screenBlend);
lensFlareMaterial = CheckShaderAndCreateMaterial(lensFlareShader,lensFlareMaterial);
blurAndFlaresMaterial = CheckShaderAndCreateMaterial (blurAndFlaresShader, blurAndFlaresMaterial);
brightPassFilterMaterial = CheckShaderAndCreateMaterial(brightPassFilterShader, brightPassFilterMaterial);
if (!isSupported)
ReportAutoDisable ();
return isSupported;
}
public void OnRenderImage (RenderTexture source, RenderTexture destination)
{
if (CheckResources()==false)
{
Graphics.Blit (source, destination);
return;
}
// screen blend is not supported when HDR is enabled (will cap values)
doHdr = false;
if (hdr == HDRBloomMode.Auto)
doHdr = source.format == RenderTextureFormat.ARGBHalf && GetComponent<Camera>().hdr;
else {
doHdr = hdr == HDRBloomMode.On;
}
doHdr = doHdr && supportHDRTextures;
BloomScreenBlendMode realBlendMode = screenBlendMode;
if (doHdr)
realBlendMode = BloomScreenBlendMode.Add;
var rtFormat= (doHdr) ? RenderTextureFormat.ARGBHalf : RenderTextureFormat.Default;
var rtW2= source.width/2;
var rtH2= source.height/2;
var rtW4= source.width/4;
var rtH4= source.height/4;
float widthOverHeight = (1.0f * source.width) / (1.0f * source.height);
float oneOverBaseSize = 1.0f / 512.0f;
// downsample
RenderTexture quarterRezColor = RenderTexture.GetTemporary (rtW4, rtH4, 0, rtFormat);
RenderTexture halfRezColorDown = RenderTexture.GetTemporary (rtW2, rtH2, 0, rtFormat);
if (quality > BloomQuality.Cheap) {
Graphics.Blit (source, halfRezColorDown, screenBlend, 2);
RenderTexture rtDown4 = RenderTexture.GetTemporary (rtW4, rtH4, 0, rtFormat);
Graphics.Blit (halfRezColorDown, rtDown4, screenBlend, 2);
Graphics.Blit (rtDown4, quarterRezColor, screenBlend, 6);
RenderTexture.ReleaseTemporary(rtDown4);
}
else {
Graphics.Blit (source, halfRezColorDown);
Graphics.Blit (halfRezColorDown, quarterRezColor, screenBlend, 6);
}
RenderTexture.ReleaseTemporary (halfRezColorDown);
// cut colors (thresholding)
RenderTexture secondQuarterRezColor = RenderTexture.GetTemporary (rtW4, rtH4, 0, rtFormat);
BrightFilter (bloomThreshold * bloomThresholdColor, quarterRezColor, secondQuarterRezColor);
// blurring
if (bloomBlurIterations < 1) bloomBlurIterations = 1;
else if (bloomBlurIterations > 10) bloomBlurIterations = 10;
for (int iter = 0; iter < bloomBlurIterations; iter++)
{
float spreadForPass = (1.0f + (iter * 0.25f)) * sepBlurSpread;
// vertical blur
RenderTexture blur4 = RenderTexture.GetTemporary (rtW4, rtH4, 0, rtFormat);
blurAndFlaresMaterial.SetVector ("_Offsets", new Vector4 (0.0f, spreadForPass * oneOverBaseSize, 0.0f, 0.0f));
Graphics.Blit (secondQuarterRezColor, blur4, blurAndFlaresMaterial, 4);
RenderTexture.ReleaseTemporary(secondQuarterRezColor);
secondQuarterRezColor = blur4;
// horizontal blur
blur4 = RenderTexture.GetTemporary (rtW4, rtH4, 0, rtFormat);
blurAndFlaresMaterial.SetVector ("_Offsets", new Vector4 ((spreadForPass / widthOverHeight) * oneOverBaseSize, 0.0f, 0.0f, 0.0f));
Graphics.Blit (secondQuarterRezColor, blur4, blurAndFlaresMaterial, 4);
RenderTexture.ReleaseTemporary (secondQuarterRezColor);
secondQuarterRezColor = blur4;
if (quality > BloomQuality.Cheap)
{
if (iter == 0)
{
Graphics.SetRenderTarget(quarterRezColor);
GL.Clear(false, true, Color.black); // Clear to avoid RT restore
Graphics.Blit (secondQuarterRezColor, quarterRezColor);
}
else
{
quarterRezColor.MarkRestoreExpected(); // using max blending, RT restore expected
Graphics.Blit (secondQuarterRezColor, quarterRezColor, screenBlend, 10);
}
}
}
if (quality > BloomQuality.Cheap)
{
Graphics.SetRenderTarget(secondQuarterRezColor);
GL.Clear(false, true, Color.black); // Clear to avoid RT restore
Graphics.Blit (quarterRezColor, secondQuarterRezColor, screenBlend, 6);
}
// lens flares: ghosting, anamorphic or both (ghosted anamorphic flares)
if (lensflareIntensity > Mathf.Epsilon)
{
RenderTexture rtFlares4 = RenderTexture.GetTemporary (rtW4, rtH4, 0, rtFormat);
if (lensflareMode == 0)
{
// ghosting only
BrightFilter (lensflareThreshold, secondQuarterRezColor, rtFlares4);
if (quality > BloomQuality.Cheap)
{
// smooth a little
blurAndFlaresMaterial.SetVector ("_Offsets", new Vector4 (0.0f, (1.5f) / (1.0f * quarterRezColor.height), 0.0f, 0.0f));
Graphics.SetRenderTarget(quarterRezColor);
GL.Clear(false, true, Color.black); // Clear to avoid RT restore
Graphics.Blit (rtFlares4, quarterRezColor, blurAndFlaresMaterial, 4);
blurAndFlaresMaterial.SetVector ("_Offsets", new Vector4 ((1.5f) / (1.0f * quarterRezColor.width), 0.0f, 0.0f, 0.0f));
Graphics.SetRenderTarget(rtFlares4);
GL.Clear(false, true, Color.black); // Clear to avoid RT restore
Graphics.Blit (quarterRezColor, rtFlares4, blurAndFlaresMaterial, 4);
}
// no ugly edges!
Vignette (0.975f, rtFlares4, rtFlares4);
BlendFlares (rtFlares4, secondQuarterRezColor);
}
else
{
//Vignette (0.975ff, rtFlares4, rtFlares4);
//DrawBorder(rtFlares4, screenBlend, 8);
float flareXRot = 1.0f * Mathf.Cos(flareRotation);
float flareyRot = 1.0f * Mathf.Sin(flareRotation);
float stretchWidth = (hollyStretchWidth * 1.0f / widthOverHeight) * oneOverBaseSize;
blurAndFlaresMaterial.SetVector ("_Offsets", new Vector4 (flareXRot, flareyRot, 0.0f, 0.0f));
blurAndFlaresMaterial.SetVector ("_Threshhold", new Vector4 (lensflareThreshold, 1.0f, 0.0f, 0.0f));
blurAndFlaresMaterial.SetVector ("_TintColor", new Vector4 (flareColorA.r, flareColorA.g, flareColorA.b, flareColorA.a) * flareColorA.a * lensflareIntensity);
blurAndFlaresMaterial.SetFloat ("_Saturation", lensFlareSaturation);
// "pre and cut"
quarterRezColor.DiscardContents();
Graphics.Blit (rtFlares4, quarterRezColor, blurAndFlaresMaterial, 2);
// "post"
rtFlares4.DiscardContents();
Graphics.Blit (quarterRezColor, rtFlares4, blurAndFlaresMaterial, 3);
blurAndFlaresMaterial.SetVector ("_Offsets", new Vector4 (flareXRot * stretchWidth, flareyRot * stretchWidth, 0.0f, 0.0f));
// stretch 1st
blurAndFlaresMaterial.SetFloat ("_StretchWidth", hollyStretchWidth);
quarterRezColor.DiscardContents();
Graphics.Blit (rtFlares4, quarterRezColor, blurAndFlaresMaterial, 1);
// stretch 2nd
blurAndFlaresMaterial.SetFloat ("_StretchWidth", hollyStretchWidth * 2.0f);
rtFlares4.DiscardContents();
Graphics.Blit (quarterRezColor, rtFlares4, blurAndFlaresMaterial, 1);
// stretch 3rd
blurAndFlaresMaterial.SetFloat ("_StretchWidth", hollyStretchWidth * 4.0f);
quarterRezColor.DiscardContents();
Graphics.Blit (rtFlares4, quarterRezColor, blurAndFlaresMaterial, 1);
// additional blur passes
for (int iter = 0; iter < hollywoodFlareBlurIterations; iter++)
{
stretchWidth = (hollyStretchWidth * 2.0f / widthOverHeight) * oneOverBaseSize;
blurAndFlaresMaterial.SetVector ("_Offsets", new Vector4 (stretchWidth * flareXRot, stretchWidth * flareyRot, 0.0f, 0.0f));
rtFlares4.DiscardContents();
Graphics.Blit (quarterRezColor, rtFlares4, blurAndFlaresMaterial, 4);
blurAndFlaresMaterial.SetVector ("_Offsets", new Vector4 (stretchWidth * flareXRot, stretchWidth * flareyRot, 0.0f, 0.0f));
quarterRezColor.DiscardContents();
Graphics.Blit (rtFlares4, quarterRezColor, blurAndFlaresMaterial, 4);
}
if (lensflareMode == (LensFlareStyle) 1)
// anamorphic lens flares
AddTo (1.0f, quarterRezColor, secondQuarterRezColor);
else
{
// "combined" lens flares
Vignette (1.0f, quarterRezColor, rtFlares4);
BlendFlares (rtFlares4, quarterRezColor);
AddTo (1.0f, quarterRezColor, secondQuarterRezColor);
}
}
RenderTexture.ReleaseTemporary (rtFlares4);
}
int blendPass = (int) realBlendMode;
//if (Mathf.Abs(chromaticBloom) < Mathf.Epsilon)
// blendPass += 4;
screenBlend.SetFloat ("_Intensity", bloomIntensity);
screenBlend.SetTexture ("_ColorBuffer", source);
if (quality > BloomQuality.Cheap)
{
RenderTexture halfRezColorUp = RenderTexture.GetTemporary (rtW2, rtH2, 0, rtFormat);
Graphics.Blit (secondQuarterRezColor, halfRezColorUp);
Graphics.Blit (halfRezColorUp, destination, screenBlend, blendPass);
RenderTexture.ReleaseTemporary (halfRezColorUp);
}
else
Graphics.Blit (secondQuarterRezColor, destination, screenBlend, blendPass);
RenderTexture.ReleaseTemporary (quarterRezColor);
RenderTexture.ReleaseTemporary (secondQuarterRezColor);
}
private void AddTo (float intensity_, RenderTexture from, RenderTexture to)
{
screenBlend.SetFloat ("_Intensity", intensity_);
to.MarkRestoreExpected(); // additive blending, RT restore expected
Graphics.Blit (from, to, screenBlend, 9);
}
private void BlendFlares (RenderTexture from, RenderTexture to)
{
lensFlareMaterial.SetVector ("colorA", new Vector4 (flareColorA.r, flareColorA.g, flareColorA.b, flareColorA.a) * lensflareIntensity);
lensFlareMaterial.SetVector ("colorB", new Vector4 (flareColorB.r, flareColorB.g, flareColorB.b, flareColorB.a) * lensflareIntensity);
lensFlareMaterial.SetVector ("colorC", new Vector4 (flareColorC.r, flareColorC.g, flareColorC.b, flareColorC.a) * lensflareIntensity);
lensFlareMaterial.SetVector ("colorD", new Vector4 (flareColorD.r, flareColorD.g, flareColorD.b, flareColorD.a) * lensflareIntensity);
to.MarkRestoreExpected(); // additive blending, RT restore expected
Graphics.Blit (from, to, lensFlareMaterial);
}
private void BrightFilter (float thresh, RenderTexture from, RenderTexture to)
{
brightPassFilterMaterial.SetVector ("_Threshhold", new Vector4 (thresh, thresh, thresh, thresh));
Graphics.Blit (from, to, brightPassFilterMaterial, 0);
}
private void BrightFilter (Color threshColor, RenderTexture from, RenderTexture to)
{
brightPassFilterMaterial.SetVector ("_Threshhold", threshColor);
Graphics.Blit (from, to, brightPassFilterMaterial, 1);
}
private void Vignette (float amount, RenderTexture from, RenderTexture to)
{
if (lensFlareVignetteMask)
{
screenBlend.SetTexture ("_ColorBuffer", lensFlareVignetteMask);
to.MarkRestoreExpected(); // using blending, RT restore expected
Graphics.Blit (from == to ? null : from, to, screenBlend, from == to ? 7 : 3);
}
else if (from != to)
{
Graphics.SetRenderTarget (to);
GL.Clear(false, true, Color.black); // clear destination to avoid RT restore
Graphics.Blit (from, to);
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
# $Id: lt.po,v 1.6 2006/03/22 04:21:02 mindless Exp $
#
# Gallery - a web based photo album viewer and editor
# Copyright (C) 2000-2006 Bharat Mediratta
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#
# Previous translators (as far as known, add yourself here, please):
# Darius Žitkevičius <skystis@splius.lt>, 2006.
#
msgid ""
msgstr ""
"Project-Id-Version: Gallery: Remote 1.0.6\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2006-03-12 23:31+0200\n"
"PO-Revision-Date: 2006-01-25 23:56+0200\n"
"Last-Translator: Darius Žitkevičius <skystis@splius.lt>\n"
"Language-Team: Lithuanian <komp_lt@konferencijos.lt>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%"
"100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: KBabel 1.10.2\n"
msgid "Gallery Remote"
msgstr "Nutolusi galerija"
msgid "Remote"
msgstr "Nutolusi"
msgid "Implementation for the remote control protocol"
msgstr "Nuotolinio galerijos valdymo protokolo realizacija"
msgid "Import"
msgstr "Importas"
msgid ""
"Gallery Remote is a Java application that runs on your desktop computer and "
"provides a rich interface to Gallery. With Gallery Remote you can drag and "
"drop to photos to upload them to Gallery, rotate and resize your images "
"before uploading, and even view the photos in your Gallery in a slideshow on "
"your desktop computer. You must install Gallery Remote 1.4 or newer to use "
"it with this version of Gallery."
msgstr ""
"Nutolusi galerija, tai Java programa, kuri veikia jūsų kompiuteryje ir "
"pateikia patogią galerijos aplinką. Nutolusios galerijos pagalba "
"fotografijas įkelti galima pelės pagalba. Prieš įkeliant į galerija vaizdus "
"galima pasukti, pakeisti matmenis, galima netgi peržiūrėti galerijos vaizdus "
"skaidrių peržiūros pagalba. Su šia galerijos versija veikia Nutolusi "
"galerija 1.4 ar naujesnė."
msgid "Download Gallery Remote"
msgstr "Atsisiųsti Nutolusią galeriją"
msgid "Remote Settings"
msgstr "Nutolusios galerijos nustatymai"
msgid "Settings saved successfully"
msgstr "Nustatymai išsaugoti sėkmingai"
msgid "Show information about Gallery Remote in \"add items\" view"
msgstr "Naujo elemento puslapyje rodyti informaciją apie Nutolusią galeriją"
msgid "Save"
msgstr "Išsaugoti"
msgid "Reset"
msgstr "Anuliuoti"
|
{
"pile_set_name": "Github"
}
|
// This file is part of CPAchecker,
// a tool for configurable software verification:
// https://cpachecker.sosy-lab.org
//
// SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
//
// SPDX-License-Identifier: Apache-2.0
package org.sosy_lab.cpachecker.util.coverage;
import com.google.common.collect.Multiset;
import java.io.IOException;
import java.io.Writer;
import java.nio.file.Paths;
import java.util.Map;
import org.sosy_lab.cpachecker.util.coverage.FileCoverageInformation.FunctionInfo;
/** Generate coverage information in Gcov format (http://gcc.gnu.org/onlinedocs/gcc/Gcov.html). */
public class CoverageReportGcov {
//String constants from gcov format
private final static String TEXTNAME = "TN:";
private final static String SOURCEFILE = "SF:";
private final static String FUNCTION = "FN:";
private final static String FUNCTIONDATA = "FNDA:";
private final static String LINEDATA = "DA:";
public static void write(CoverageData pCoverage, Writer w) throws IOException {
for (Map.Entry<String, FileCoverageInformation> entry :
pCoverage.getInfosPerFile().entrySet()) {
String sourcefile = entry.getKey();
FileCoverageInformation fileInfos = entry.getValue();
//Convert ./test.c -> /full/path/test.c
w.append(TEXTNAME + "\n");
w.append(SOURCEFILE + Paths.get(sourcefile).toAbsolutePath() + "\n");
for (FunctionInfo info : fileInfos.allFunctions) {
w.append(FUNCTION + info.firstLine + "," + info.name + "\n");
//Information about function end isn't used by lcov, but it is useful for some postprocessing
//But lcov ignores all unknown lines, so, this additional information can't affect on its work
w.append("#" + FUNCTION + info.lastLine + "\n");
}
for (Multiset.Entry<String> functionEntry : fileInfos.visitedFunctions.entrySet()) {
w.append(FUNCTIONDATA + functionEntry.getCount() + "," + functionEntry.getElement() + "\n");
}
/* Now save information about lines
*/
for (Integer line : fileInfos.allLines) {
w.append(LINEDATA + line + "," + fileInfos.getVisitedLine(line) + "\n");
}
w.append("end_of_record\n");
}
}
}
|
{
"pile_set_name": "Github"
}
|
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
[Defines]
INF_VERSION = 0x00010006
BASE_NAME = UefiShellSpiFlashLib
FILE_GUID = 2f2dd8c9-221f-4acf-afe5-5897264c5774
MODULE_TYPE = UEFI_APPLICATION
VERSION_STRING = 0.1
LIBRARY_CLASS = NULL|UEFI_APPLICATION UEFI_DRIVER
CONSTRUCTOR = ShellSpiFlashLibConstructor
DESTRUCTOR = ShellSpiFlashLibDestructor
[Sources]
SpiFlashCmd.c
SpiFlashCmd.uni
[Packages]
EmbeddedPkg/EmbeddedPkg.dec
MdePkg/MdePkg.dec
ShellPkg/ShellPkg.dec
MdeModulePkg/MdeModulePkg.dec
Silicon/Marvell/Marvell.dec
[LibraryClasses]
UefiLib
UefiBootServicesTableLib
MemoryAllocationLib
BaseLib
BaseMemoryLib
DebugLib
ShellCommandLib
ShellLib
UefiLib
UefiRuntimeServicesTableLib
PcdLib
HiiLib
FileHandleLib
[Pcd]
gMarvellTokenSpaceGuid.PcdSpiFlashCs
gMarvellTokenSpaceGuid.PcdSpiFlashMode
[Protocols]
gMarvellSpiFlashProtocolGuid
gMarvellSpiMasterProtocolGuid
[Guids]
gShellSfHiiGuid
|
{
"pile_set_name": "Github"
}
|
///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// 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.
///////////////////////////////////////////////////////////////////////////////////
#if(defined(GLM_MESSAGES))
# pragma message("GLM: GLM_GTX_ulp extension is deprecated, include GLM_GTC_ulp (glm/gtc/ulp.hpp) instead")
#endif
// Promoted:
#include "../gtc/ulp.hpp"
|
{
"pile_set_name": "Github"
}
|
Newsgroups: sci.electronics
Path: cantaloupe.srv.cs.cmu.edu!magnesium.club.cc.cmu.edu!news.sei.cmu.edu!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!hpscit.sc.hp.com!cupnews0.cup.hp.com!dclaar
From: dclaar@cup.hp.com (Doug Claar)
Subject: Los Angeles Freeway traffic reports
Sender: news@cupnews0.cup.hp.com (News Admin)
Message-ID: <C5sLMB.9w6@cup.hp.com>
Date: Tue, 20 Apr 1993 17:22:59 GMT
Nntp-Posting-Host: hprtnyc.cup.hp.com
Organization: Hewlett-Packard
X-Newsreader: TIN [version 1.1 PL8.9]
Lines: 8
While driving through the middle of nowhere, I picked up KNBR, AM 1070,
a clear-channel station based in Los Angeles. They had an ad
claiming that they were able to get traffic flow information from
all of the thousands of traffic sensors that CalTrans has placed
under the pavement. Does CalTrans sell this info? Does KNBR have
an exclusive? What's the deal?
==Doug "Former L.A. commuter" Claar
|
{
"pile_set_name": "Github"
}
|
#ifndef TEXTURERUNLENGTHFEATURES_H
#define TEXTURERUNLENGTHFEATURES_H
namespace ants
{
extern int TextureRunLengthFeatures( std::vector<std::string>, // equivalent to argv of command line parameters to main()
std::ostream* out_stream // [optional] output stream to write
);
} // namespace ants
#endif // THRESHOLDIMAGE_H
|
{
"pile_set_name": "Github"
}
|
//
// HomePageHeadView.m
// mokoo
//
// Created by Mac on 15/8/24.
// Copyright (c) 2015年 Mac. All rights reserved.
//
#define kDeviceWidth [UIScreen mainScreen].bounds.size.width
#define kDeviceHeight [UIScreen mainScreen].bounds.size.height
#import "HomePageHeadView.h"
@implementation HomePageHeadView
-(id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
UIView *styleView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kDeviceWidth/3, 38)];
[self addSubview:styleView];
UIView *typeView = [[UIView alloc]initWithFrame:CGRectMake(kDeviceWidth/3, 0, kDeviceWidth/3, 38)];
[self addSubview:typeView];
UIView *moreView = [[UIView alloc]initWithFrame:CGRectMake(2*kDeviceWidth/3, 0, kDeviceWidth/3, 38)];
[self addSubview:moreView];
_styleBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, kDeviceWidth/4, 38)];
_styleBtn.center = CGPointMake(kDeviceWidth/6, 38/2);
[_styleBtn setTitle:@"风格" forState:UIControlStateNormal];
[_styleBtn.titleLabel setFont:[UIFont systemFontOfSize:14]];
[_styleBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
UIImageView *styleImageView = [[UIImageView alloc]initWithFrame:CGRectMake(kDeviceWidth/8 +35, 17, 9, 5)];
styleImageView.image = [UIImage imageNamed:@"home_re_arrow_down.pdf"];
[_styleBtn addSubview:styleImageView];
// [_styleBtn setImage:[UIImage imageNamed:@"home_re_arrow_down.pdf"] forState:UIControlStateNormal];
CALayer *lineLayer = [[CALayer alloc]init];
lineLayer.backgroundColor = [[UIColor blackColor] CGColor];
lineLayer.frame = CGRectMake(kDeviceWidth/3-1, 10, 1, 18);
CALayer *typeLineLayer = [[CALayer alloc]init];
typeLineLayer.backgroundColor = [[UIColor blackColor] CGColor];
typeLineLayer.frame = CGRectMake(kDeviceWidth/3-1, 10, 1, 18);
CALayer *moreLineLayer = [[CALayer alloc]init];
moreLineLayer.backgroundColor = [[UIColor blackColor] CGColor];
moreLineLayer.frame = CGRectMake(kDeviceWidth/3-1, 10, 1, 18);
[styleView.layer addSublayer:lineLayer];
// [_styleBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, -9, 0, 9)];
// [_styleBtn setImageEdgeInsets:UIEdgeInsetsMake(0, _styleBtn.titleLabel.bounds.size.width, 0, -_styleBtn.titleLabel.bounds.size.width)];
_typeBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, kDeviceWidth/4, 38)];
_typeBtn.center = CGPointMake(kDeviceWidth/6, 38/2);
[_typeBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[_typeBtn setTitle:@"类型" forState:UIControlStateNormal];
[_typeBtn.titleLabel setFont:[UIFont systemFontOfSize:14]];
UIImageView *typeImageView = [[UIImageView alloc]initWithFrame:CGRectMake(kDeviceWidth/8 +35, 16, 9, 5)];
typeImageView.image = [UIImage imageNamed:@"home_re_arrow_down.pdf"];
// [_typeBtn setImage:[UIImage imageNamed:@"home_re_arrow_down.pdf"] forState:UIControlStateNormal];
[_typeBtn addSubview:typeImageView];
[typeView.layer addSublayer:typeLineLayer];
[typeView addSubview:_typeBtn];
_moreBtn = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, kDeviceWidth/4, 38)];
_moreBtn.center = CGPointMake(kDeviceWidth/6 +13, 38/2);
[_moreBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[_moreBtn setTitle:@"筛选" forState:UIControlStateNormal];
[_moreBtn.titleLabel setFont:[UIFont systemFontOfSize:14]];
// UIImageView *moreImageView = [[UIImageView alloc]initWithFrame:CGRectMake(kDeviceWidth/8 +25, 16, 9, 5)];
// moreImageView.image = [UIImage imageNamed:@"home_re_arrow_down.pdf"];
// [_moreBtn addSubview:moreImageView];
UIImageView *moreImageView = [[UIImageView alloc]initWithFrame:CGRectMake(5, 11, 16, 16)];
moreImageView.image = [UIImage imageNamed:@"home_refine.pdf"];
[_moreBtn addSubview:moreImageView];
// [_moreBtn setImage:[UIImage imageNamed:@"home_refine.pdf"] forState:UIControlStateNormal];
[moreView.layer addSublayer:moreLineLayer];
[moreView addSubview:_moreBtn];
[styleView addSubview:_styleBtn];
CALayer *lineBoLayer = [[CALayer alloc]init];
lineBoLayer.frame = CGRectMake(0, 37.5f, kDeviceWidth, 0.5f);
lineBoLayer.backgroundColor = [[UIColor blackColor] CGColor];
[self.layer addSublayer:lineBoLayer];
self.backgroundColor = [UIColor whiteColor];
}
return self;
}
@end
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2007, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* François Revol <revol@free.fr>
*
* Copyright 2004, Axel Dörfler, axeld@pinc-software.de
* Distributed under the terms of the MIT License.
*/
#include <KernelExport.h>
#include <boot/stage2.h>
#include <arch/smp.h>
#include <debug.h>
#include <int.h>
status_t
arch_smp_init(kernel_args *args)
{
return B_OK;
}
status_t
arch_smp_per_cpu_init(kernel_args *args, int32 cpu)
{
return B_OK;
}
void
arch_smp_send_multicast_ici(CPUSet& cpuSet)
{
#if KDEBUG
if (are_interrupts_enabled())
panic("arch_smp_send_multicast_ici: called with interrupts enabled");
#endif
}
void
arch_smp_send_ici(int32 target_cpu)
{
panic("called arch_smp_send_ici!\n");
}
void
arch_smp_send_broadcast_ici()
{
panic("called arch_smp_send_broadcast_ici\n");
}
|
{
"pile_set_name": "Github"
}
|
.\" $NetBSD: seq.1,v 1.6 2008/11/26 15:03:47 ginsbach Exp $
.\"
.\" Copyright (c) 2005 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Brian Ginsbach.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $FreeBSD: src/usr.bin/seq/seq.1,v 1.1 2010/02/19 23:54:12 delphij Exp $
.\"
.Dd February 19, 2010
.Dt SEQ 1
.Os
.Sh NAME
.Nm seq
.Nd print sequences of numbers
.Sh SYNOPSIS
.Nm
.Op Fl w
.Op Fl f Ar format
.Op Fl s Ar string
.Op Fl t Ar string
.Op Ar first Op Ar incr
.Ar last
.Sh DESCRIPTION
The
.Nm
utility prints a sequence of numbers, one per line
.Pq default ,
from
.Ar first
.Pq default 1 ,
to near
.Ar last
as possible, in increments of
.Ar incr
.Pq default 1 .
When
.Ar first
is larger than
.Ar last
the default
.Ar incr
is -1.
.Pp
All numbers are interpreted as floating point.
.Pp
Normally integer values are printed as decimal integers.
.Pp
The
.Nm
utility accepts the following options:
.Bl -tag -width Ar
.It Fl f Ar format
Use a
.Xr printf 3
style
.Ar format
to print each number.
Only the
.Cm E ,
.Cm e ,
.Cm f ,
.Cm G ,
.Cm g ,
and
.Cm %
conversion characters are valid, along with any optional
flags and an optional numeric minimum field width or precision.
The
.Ar format
can contain character escape sequences in backslash notation as
defined in
.St -ansiC .
The default is
.Cm %g .
.It Fl s Ar string
Use
.Ar string
to separate numbers.
The
.Ar string
can contain character escape sequences in backslash notation as
defined in
.St -ansiC .
The default is
.Cm \en .
.It Fl t Ar string
Use
.Ar string
to terminate sequence of numbers.
The
.Ar string
can contain character escape sequences in backslash notation as
defined in
.St -ansiC .
This option is useful when the default separator
does not contain a
.Cm \en .
.It Fl w
Equalize the widths of all numbers by padding with zeros as necessary.
This option has no effect with the
.Fl f
option.
If any sequence numbers will be printed in exponential notation,
the default conversion is changed to
.Cm %e .
.El
.Pp
The
.Nm
utility exits 0 on success and non-zero if an error occurs.
.Sh EXAMPLES
.Bd -literal -offset indent
# seq 1 3
1
2
3
# seq 3 1
3
2
1
# seq -w 0 .05 .1
0.00
0.05
0.10
.Ed
.Sh SEE ALSO
.Xr jot 1 ,
.Xr printf 1 ,
.Xr printf 3
.Sh HISTORY
The
.Nm
command first appeared in
.Tn "Plan 9 from Bell Labs" .
A
.Nm
command appeared in
.Nx 3.0 ,
and ported to
.Fx 9.0 .
This command was based on the command of the same name in
.Tn "Plan 9 from Bell Labs"
and the
.Tn GNU
core utilities.
The
.Tn GNU
.Nm
command first appeared in the 1.13 shell utilities release.
.Sh BUGS
The
.Fl w
option does not handle the transition from pure floating point
to exponent representation very well.
The
.Nm
command is not bug for bug compatible with the
.Tn "Plan 9 from Bell Labs"
or
.Tn GNU
versions of
.Nm .
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.