text stringlengths 2 99k | meta dict |
|---|---|
load("//java/private:common.bzl", "has_maven_deps")
load("//java/private:dist_info.bzl", "DistZipInfo", "dist_aspect", "separate_first_and_third_party")
def _java_dist_zip_impl(ctx):
files = []
for file in ctx.files.files:
files.append("%s=%s" % (file.basename, file.path))
infos = [d[DistZipInfo] for d in ctx.attr.deps]
combined = depset(transitive = [i.dist_infos for i in infos]).to_list()
inputs = depset(
ctx.files.files,
transitive = [i.binary_jars for i in combined] + [i.source_jars for i in combined],
)
(first, third) = separate_first_and_third_party(ctx.attr.third_party_prefixes, infos)
first_party = []
third_party = []
for info in first:
[first_party.append("%s.jar=%s" % (info.name, fp.path)) for fp in info.binary_jars.to_list()]
[first_party.append("%s-sources.jar=%s" % (info.name, fp.path)) for fp in info.source_jars.to_list()]
for info in third:
[third_party.append("lib/%s.jar=%s" % (info.name, tp.path)) for tp in info.binary_jars.to_list()]
out = ctx.actions.declare_file("%s.zip" % ctx.attr.name)
args = ctx.actions.args()
args.add_all(["c", out])
args.add_all(sorted(files))
args.add_all(sorted(first_party))
args.add_all(sorted(third_party))
ctx.actions.run(
executable = ctx.executable._zip,
arguments = [args],
outputs = [out],
inputs = inputs,
)
return [
DefaultInfo(files = depset([out])),
]
java_dist_zip = rule(
_java_dist_zip_impl,
attrs = {
"files": attr.label_list(
default = [],
allow_files = True,
),
"deps": attr.label_list(
providers = [
[DistZipInfo],
],
aspects = [
dist_aspect,
has_maven_deps,
],
),
"third_party_prefixes": attr.string_list(),
"_zip": attr.label(
default = "@bazel_tools//tools/zip:zipper",
executable = True,
cfg = "host",
),
},
)
| {
"pile_set_name": "Github"
} |
fileFormatVersion: 2
guid: 42f11f8cb765e6f4b9f31598c6fd2178
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 10
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 1
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 0
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 32
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 1
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: c6ca1fe9de45a2945a18997595334da7
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
| {
"pile_set_name": "Github"
} |
{
"symbol": "NUSD",
"address": "0x0C6144c16af288948C8fdB37fD8fEc94bfF3d1d9",
"overview":{
"en": "Neutral Dollar (NUSD) is the world’s first metastable token backed by a basket of stablecoins. The instrument is built by Neutral."
},
"email": "hello@neutralproject.com",
"website": "https://neutralproject.com/",
"whitepaper": "https://neutralproject.com/",
"state": "NORMAL",
"published_on": "2019-05-15",
"initial_price": {
"USD": "1.00 USD"
},
"links": {
"blog": "https://blog.neutralproject.com",
"twitter": "https://twitter.com/neutral_project",
"telegram": "https://t.me/neutralproject",
"github": "https://github.com/NeutralGroup",
"facebook": "https://www.facebook.com/Neutral-Project-391548818084169/",
"medium": "https://medium.com/@neutralproject"
}
}
| {
"pile_set_name": "Github"
} |
# /* **************************************************************************
# * *
# * (C) Copyright Edward Diener 2014.
# * Distributed under the Boost Software License, Version 1.0. (See
# * accompanying file LICENSE_1_0.txt or copy at
# * http://www.boost.org/LICENSE_1_0.txt)
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
#ifndef BOOST_PREPROCESSOR_DETAIL_IS_BEGIN_PARENS_HPP
#define BOOST_PREPROCESSOR_DETAIL_IS_BEGIN_PARENS_HPP
#if BOOST_PP_VARIADICS_MSVC
#include <boost/preprocessor/facilities/empty.hpp>
#define BOOST_PP_DETAIL_VD_IBP_CAT(a, b) BOOST_PP_DETAIL_VD_IBP_CAT_I(a, b)
#define BOOST_PP_DETAIL_VD_IBP_CAT_I(a, b) BOOST_PP_DETAIL_VD_IBP_CAT_II(a ## b)
#define BOOST_PP_DETAIL_VD_IBP_CAT_II(res) res
#define BOOST_PP_DETAIL_IBP_SPLIT(i, ...) \
BOOST_PP_DETAIL_VD_IBP_CAT(BOOST_PP_DETAIL_IBP_PRIMITIVE_CAT(BOOST_PP_DETAIL_IBP_SPLIT_,i)(__VA_ARGS__),BOOST_PP_EMPTY()) \
/**/
#define BOOST_PP_DETAIL_IBP_IS_VARIADIC_C(...) 1 1
#else
#define BOOST_PP_DETAIL_IBP_SPLIT(i, ...) \
BOOST_PP_DETAIL_IBP_PRIMITIVE_CAT(BOOST_PP_DETAIL_IBP_SPLIT_,i)(__VA_ARGS__) \
/**/
#define BOOST_PP_DETAIL_IBP_IS_VARIADIC_C(...) 1
#endif /* BOOST_PP_VARIADICS_MSVC */
#define BOOST_PP_DETAIL_IBP_SPLIT_0(a, ...) a
#define BOOST_PP_DETAIL_IBP_SPLIT_1(a, ...) __VA_ARGS__
#define BOOST_PP_DETAIL_IBP_CAT(a, ...) BOOST_PP_DETAIL_IBP_PRIMITIVE_CAT(a,__VA_ARGS__)
#define BOOST_PP_DETAIL_IBP_PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__
#define BOOST_PP_DETAIL_IBP_IS_VARIADIC_R_1 1,
#define BOOST_PP_DETAIL_IBP_IS_VARIADIC_R_BOOST_PP_DETAIL_IBP_IS_VARIADIC_C 0,
#endif /* BOOST_PREPROCESSOR_DETAIL_IS_BEGIN_PARENS_HPP */
| {
"pile_set_name": "Github"
} |
<?php
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Monolog\Logger;
class ElasticaFormatterTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!class_exists("Elastica\Document")) {
$this->markTestSkipped("ruflin/elastica not installed");
}
}
/**
* @covers Monolog\Formatter\ElasticaFormatter::__construct
* @covers Monolog\Formatter\ElasticaFormatter::format
* @covers Monolog\Formatter\ElasticaFormatter::getDocument
*/
public function testFormat()
{
// test log message
$msg = array(
'level' => Logger::ERROR,
'level_name' => 'ERROR',
'channel' => 'meh',
'context' => array('foo' => 7, 'bar', 'class' => new \stdClass),
'datetime' => new \DateTime("@0"),
'extra' => array(),
'message' => 'log',
);
// expected values
$expected = $msg;
$expected['datetime'] = '1970-01-01T00:00:00+0000';
$expected['context'] = array(
'class' => '[object] (stdClass: {})',
'foo' => 7,
0 => 'bar',
);
// format log message
$formatter = new ElasticaFormatter('my_index', 'doc_type');
$doc = $formatter->format($msg);
$this->assertInstanceOf('Elastica\Document', $doc);
// Document parameters
$params = $doc->getParams();
$this->assertEquals('my_index', $params['_index']);
$this->assertEquals('doc_type', $params['_type']);
// Document data values
$data = $doc->getData();
foreach (array_keys($expected) as $key) {
$this->assertEquals($expected[$key], $data[$key]);
}
}
/**
* @covers Monolog\Formatter\ElasticaFormatter::getIndex
* @covers Monolog\Formatter\ElasticaFormatter::getType
*/
public function testGetters()
{
$formatter = new ElasticaFormatter('my_index', 'doc_type');
$this->assertEquals('my_index', $formatter->getIndex());
$this->assertEquals('doc_type', $formatter->getType());
}
}
| {
"pile_set_name": "Github"
} |
<html><head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="Start" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of extensions" rel=Appendix href="index_extensions.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Arg" rel="Chapter" href="Arg.html">
<link title="Array" rel="Chapter" href="Array.html">
<link title="ArrayLabels" rel="Chapter" href="ArrayLabels.html">
<link title="Bigarray" rel="Chapter" href="Bigarray.html">
<link title="Bool" rel="Chapter" href="Bool.html">
<link title="Buffer" rel="Chapter" href="Buffer.html">
<link title="Bytes" rel="Chapter" href="Bytes.html">
<link title="BytesLabels" rel="Chapter" href="BytesLabels.html">
<link title="Callback" rel="Chapter" href="Callback.html">
<link title="CamlinternalFormat" rel="Chapter" href="CamlinternalFormat.html">
<link title="CamlinternalFormatBasics" rel="Chapter" href="CamlinternalFormatBasics.html">
<link title="CamlinternalLazy" rel="Chapter" href="CamlinternalLazy.html">
<link title="CamlinternalMod" rel="Chapter" href="CamlinternalMod.html">
<link title="CamlinternalOO" rel="Chapter" href="CamlinternalOO.html">
<link title="Char" rel="Chapter" href="Char.html">
<link title="Complex" rel="Chapter" href="Complex.html">
<link title="Condition" rel="Chapter" href="Condition.html">
<link title="Digest" rel="Chapter" href="Digest.html">
<link title="Dynlink" rel="Chapter" href="Dynlink.html">
<link title="Ephemeron" rel="Chapter" href="Ephemeron.html">
<link title="Event" rel="Chapter" href="Event.html">
<link title="Filename" rel="Chapter" href="Filename.html">
<link title="Float" rel="Chapter" href="Float.html">
<link title="Format" rel="Chapter" href="Format.html">
<link title="Fun" rel="Chapter" href="Fun.html">
<link title="Gc" rel="Chapter" href="Gc.html">
<link title="Genlex" rel="Chapter" href="Genlex.html">
<link title="Graphics" rel="Chapter" href="Graphics.html">
<link title="GraphicsX11" rel="Chapter" href="GraphicsX11.html">
<link title="Hashtbl" rel="Chapter" href="Hashtbl.html">
<link title="Int" rel="Chapter" href="Int.html">
<link title="Int32" rel="Chapter" href="Int32.html">
<link title="Int64" rel="Chapter" href="Int64.html">
<link title="Lazy" rel="Chapter" href="Lazy.html">
<link title="Lexing" rel="Chapter" href="Lexing.html">
<link title="List" rel="Chapter" href="List.html">
<link title="ListLabels" rel="Chapter" href="ListLabels.html">
<link title="Map" rel="Chapter" href="Map.html">
<link title="Marshal" rel="Chapter" href="Marshal.html">
<link title="MoreLabels" rel="Chapter" href="MoreLabels.html">
<link title="Mutex" rel="Chapter" href="Mutex.html">
<link title="Nativeint" rel="Chapter" href="Nativeint.html">
<link title="Obj" rel="Chapter" href="Obj.html">
<link title="Ocaml_operators" rel="Chapter" href="Ocaml_operators.html">
<link title="Oo" rel="Chapter" href="Oo.html">
<link title="Option" rel="Chapter" href="Option.html">
<link title="Parsing" rel="Chapter" href="Parsing.html">
<link title="Pervasives" rel="Chapter" href="Pervasives.html">
<link title="Printexc" rel="Chapter" href="Printexc.html">
<link title="Printf" rel="Chapter" href="Printf.html">
<link title="Queue" rel="Chapter" href="Queue.html">
<link title="Random" rel="Chapter" href="Random.html">
<link title="Result" rel="Chapter" href="Result.html">
<link title="Scanf" rel="Chapter" href="Scanf.html">
<link title="Seq" rel="Chapter" href="Seq.html">
<link title="Set" rel="Chapter" href="Set.html">
<link title="Spacetime" rel="Chapter" href="Spacetime.html">
<link title="Stack" rel="Chapter" href="Stack.html">
<link title="StdLabels" rel="Chapter" href="StdLabels.html">
<link title="Stdlib" rel="Chapter" href="Stdlib.html">
<link title="Str" rel="Chapter" href="Str.html">
<link title="Stream" rel="Chapter" href="Stream.html">
<link title="String" rel="Chapter" href="String.html">
<link title="StringLabels" rel="Chapter" href="StringLabels.html">
<link title="Sys" rel="Chapter" href="Sys.html">
<link title="Thread" rel="Chapter" href="Thread.html">
<link title="ThreadUnix" rel="Chapter" href="ThreadUnix.html">
<link title="Uchar" rel="Chapter" href="Uchar.html">
<link title="Unit" rel="Chapter" href="Unit.html">
<link title="Unix" rel="Chapter" href="Unix.html">
<link title="UnixLabels" rel="Chapter" href="UnixLabels.html">
<link title="Weak" rel="Chapter" href="Weak.html"><title>Stdlib.ArrayLabels</title>
</head>
<body>
<code class="code">(<span class="keyword">module</span> <span class="constructor">Stdlib__arrayLabels</span>)</code></body></html>
| {
"pile_set_name": "Github"
} |
import * as dr from '../../dynamicUI/reducer'
Object.assign(exports, {...dr,...exports}) | {
"pile_set_name": "Github"
} |
//
// MTTDatabaseUtil.h
// Duoduo
//
// Created by zuoye on 14-3-21.
// Copyright (c) 2015年 MoguIM All rights reserved.
//
#import <Foundation/Foundation.h>
#import "FMDB.h"
@class MTTDepartment;
@class MTTMessageEntity;
@class MTTGroupEntity;
@class MTTSessionEntity;
@class MessageEntity,MTTUserEntity;
@interface MTTDatabaseUtil : NSObject
@property(strong)NSString *recentsession;
//在数据库上的操作
@property (nonatomic,readonly)dispatch_queue_t databaseMessageQueue;
+ (instancetype)instance;
- (void)openCurrentUserDB;
@end
typedef void(^LoadMessageInSessionCompletion)(NSArray* messages,NSError* error);
typedef void(^MessageCountCompletion)(NSInteger count);
typedef void(^DeleteSessionCompletion)(BOOL success);
typedef void(^DDDBGetLastestMessageCompletion)(MTTMessageEntity* message,NSError* error);
typedef void(^DDUpdateMessageCompletion)(BOOL result);
typedef void(^DDGetLastestCommodityMessageCompletion)(MTTMessageEntity* message);
@interface MTTDatabaseUtil(Message)
/**
* 在|databaseMessageQueue|执行查询操作,分页获取聊天记录
*
* @param sessionID 会话ID
* @param pagecount 每页消息数
* @param page 页数
* @param completion 完成获取
*/
- (void)loadMessageForSessionID:(NSString*)sessionID pageCount:(int)pagecount index:(NSInteger)index completion:(LoadMessageInSessionCompletion)completion;
- (void)loadMessageForSessionID:(NSString*)sessionID afterMessage:(MTTMessageEntity*)message completion:(LoadMessageInSessionCompletion)completion;
- (void)searchHistory:(NSString*)key completion:(LoadMessageInSessionCompletion)completion;
- (void)searchHistoryBySessionId:(NSString*)key sessionId:(NSString *)sessionId completion:(LoadMessageInSessionCompletion)completion;
/**
* 获取对应的Session的最新的自己发送的商品气泡
*
* @param sessionID 会话ID
* @param completion 完成获取
*/
- (void)getLasetCommodityTypeImageForSession:(NSString*)sessionID completion:(DDGetLastestCommodityMessageCompletion)completion;
/**
* 在|databaseMessageQueue|执行查询操作,获取DB中
*
* @param sessionID sessionID
* @param completion 完成获取最新的消息
*/
- (void)getLastestMessageForSessionID:(NSString*)sessionID completion:(DDDBGetLastestMessageCompletion)completion;
/**
* 在|databaseMessageQueue|执行查询操作,分页获取聊天记录
*
* @param sessionID 会话ID
* @param completion 完成block
*/
- (void)getMessagesCountForSessionID:(NSString*)sessionID completion:(MessageCountCompletion)completion;
/**
* 批量插入message,需要用户必须在线,避免插入离线时阅读的消息
*
* @param messages message集合
* @param success 插入成功
* @param failure 插入失败
*/
- (void)insertMessages:(NSArray*)messages
success:(void(^)())success
failure:(void(^)(NSString* errorDescripe))failure;
/**
* 删除相应会话的所有消息
*
* @param sessionID 会话
* @param completion 完成删除
*/
- (void)deleteMesagesForSession:(NSString*)sessionID completion:(DeleteSessionCompletion)completion;
/**
* 更新数据库中的某条消息
*
* @param message 更新后的消息
* @param completion 完成更新
*/
- (void)updateMessageForMessage:(MTTMessageEntity*)message completion:(DDUpdateMessageCompletion)completion;
@end
//-----------------------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------------------
typedef void(^LoadRecentContactsComplection)(NSArray* contacts,NSError* error);
typedef void(^LoadAllContactsComplection)(NSArray* contacts,NSError* error);
typedef void(^LoadAllSessionsComplection)(NSArray* session,NSError* error);
typedef void(^UpdateRecentContactsComplection)(NSError* error);
typedef void(^InsertsRecentContactsCOmplection)(NSError* error);
@interface MTTDatabaseUtil(Users)
/**
* 加载本地数据库的最近联系人列表
*
* @param completion 完成加载
*/
- (void)loadContactsCompletion:(LoadRecentContactsComplection)completion;
/**
* 更新本地数据库的最近联系人信息
*
* @param completion 完成更新本地数据库
*/
- (void)updateContacts:(NSArray*)users inDBCompletion:(UpdateRecentContactsComplection)completion;
/**
* 更新本地数据库某个用户的信息
*
* @param user 某个用户
* @param completion 完成更新本地数据库
*/
/**
* 插入本地数据库的最近联系人信息
*
* @param users 最近联系人数组
* @param completion 完成插入
*/
- (void)insertUsers:(NSArray*)users completion:(InsertsRecentContactsCOmplection)completion;
/**
* 插入组织架构信息
*
* @param departments 组织架构数组
* @param completion 完成插入
*/
- (void)insertDepartments:(NSArray*)departments completion:(InsertsRecentContactsCOmplection)completion;
- (void)getDepartmentFromID:(NSString*)departmentID completion:(void(^)(MTTDepartment *department))completion;
- (void)insertAllUser:(NSArray*)users completion:(InsertsRecentContactsCOmplection)completion;
- (void)getAllUsers:(LoadAllContactsComplection )completion;
- (void)getUserFromID:(NSString*)userID completion:(void(^)(MTTUserEntity *user))completion;
- (void)updateRecentGroup:(MTTGroupEntity *)group completion:(InsertsRecentContactsCOmplection)completion;
- (void)updateRecentSessions:(NSArray *)sessions completion:(InsertsRecentContactsCOmplection)completion;
- (void)updateRecentSession:(MTTSessionEntity *)session completion:(InsertsRecentContactsCOmplection)completion;
- (void)loadGroupsCompletion:(LoadRecentContactsComplection)completion;
- (void)loadSessionsCompletion:(LoadAllSessionsComplection)completion;
-(void)removeSession:(NSString *)sessionID;
- (void)deleteMesages:(MTTMessageEntity * )message completion:(DeleteSessionCompletion)completion;
- (void)loadGroupByIDCompletion:(NSString *)groupID Block:(LoadRecentContactsComplection)completion;
@end | {
"pile_set_name": "Github"
} |
/* calibrate.c: default delay calibration
*
* Excised from init/main.c
* Copyright (C) 1991, 1992 Linus Torvalds
*/
#include <linux/jiffies.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/timex.h>
#include <linux/smp.h>
unsigned long lpj_fine;
unsigned long preset_lpj;
static int __init lpj_setup(char *str)
{
preset_lpj = simple_strtoul(str,NULL,0);
return 1;
}
__setup("lpj=", lpj_setup);
#ifdef ARCH_HAS_READ_CURRENT_TIMER
/* This routine uses the read_current_timer() routine and gets the
* loops per jiffy directly, instead of guessing it using delay().
* Also, this code tries to handle non-maskable asynchronous events
* (like SMIs)
*/
#define DELAY_CALIBRATION_TICKS ((HZ < 100) ? 1 : (HZ/100))
#define MAX_DIRECT_CALIBRATION_RETRIES 5
static unsigned long __cpuinit calibrate_delay_direct(void)
{
unsigned long pre_start, start, post_start;
unsigned long pre_end, end, post_end;
unsigned long start_jiffies;
unsigned long timer_rate_min, timer_rate_max;
unsigned long good_timer_sum = 0;
unsigned long good_timer_count = 0;
int i;
if (read_current_timer(&pre_start) < 0 )
return 0;
/*
* A simple loop like
* while ( jiffies < start_jiffies+1)
* start = read_current_timer();
* will not do. As we don't really know whether jiffy switch
* happened first or timer_value was read first. And some asynchronous
* event can happen between these two events introducing errors in lpj.
*
* So, we do
* 1. pre_start <- When we are sure that jiffy switch hasn't happened
* 2. check jiffy switch
* 3. start <- timer value before or after jiffy switch
* 4. post_start <- When we are sure that jiffy switch has happened
*
* Note, we don't know anything about order of 2 and 3.
* Now, by looking at post_start and pre_start difference, we can
* check whether any asynchronous event happened or not
*/
for (i = 0; i < MAX_DIRECT_CALIBRATION_RETRIES; i++) {
pre_start = 0;
read_current_timer(&start);
start_jiffies = jiffies;
while (jiffies <= (start_jiffies + 1)) {
pre_start = start;
read_current_timer(&start);
}
read_current_timer(&post_start);
pre_end = 0;
end = post_start;
while (jiffies <=
(start_jiffies + 1 + DELAY_CALIBRATION_TICKS)) {
pre_end = end;
read_current_timer(&end);
}
read_current_timer(&post_end);
timer_rate_max = (post_end - pre_start) /
DELAY_CALIBRATION_TICKS;
timer_rate_min = (pre_end - post_start) /
DELAY_CALIBRATION_TICKS;
/*
* If the upper limit and lower limit of the timer_rate is
* >= 12.5% apart, redo calibration.
*/
if (pre_start != 0 && pre_end != 0 &&
(timer_rate_max - timer_rate_min) < (timer_rate_max >> 3)) {
good_timer_count++;
good_timer_sum += timer_rate_max;
}
}
if (good_timer_count)
return (good_timer_sum/good_timer_count);
printk(KERN_WARNING "calibrate_delay_direct() failed to get a good "
"estimate for loops_per_jiffy.\nProbably due to long platform interrupts. Consider using \"lpj=\" boot option.\n");
return 0;
}
#else
static unsigned long __cpuinit calibrate_delay_direct(void) {return 0;}
#endif
/*
* This is the number of bits of precision for the loops_per_jiffy. Each
* bit takes on average 1.5/HZ seconds. This (like the original) is a little
* better than 1%
* For the boot cpu we can skip the delay calibration and assign it a value
* calculated based on the timer frequency.
* For the rest of the CPUs we cannot assume that the timer frequency is same as
* the cpu frequency, hence do the calibration for those.
*/
#define LPS_PREC 8
void __cpuinit calibrate_delay(void)
{
unsigned long ticks, loopbit;
int lps_precision = LPS_PREC;
static bool printed;
if (preset_lpj) {
loops_per_jiffy = preset_lpj;
if (!printed)
pr_info("Calibrating delay loop (skipped) "
"preset value.. ");
} else if ((!printed) && lpj_fine) {
loops_per_jiffy = lpj_fine;
pr_info("Calibrating delay loop (skipped), "
"value calculated using timer frequency.. ");
} else if ((loops_per_jiffy = calibrate_delay_direct()) != 0) {
if (!printed)
pr_info("Calibrating delay using timer "
"specific routine.. ");
} else {
loops_per_jiffy = (1<<12);
if (!printed)
pr_info("Calibrating delay loop... ");
while ((loops_per_jiffy <<= 1) != 0) {
/* wait for "start of" clock tick */
ticks = jiffies;
while (ticks == jiffies)
/* nothing */;
/* Go .. */
ticks = jiffies;
__delay(loops_per_jiffy);
ticks = jiffies - ticks;
if (ticks)
break;
}
/*
* Do a binary approximation to get loops_per_jiffy set to
* equal one clock (up to lps_precision bits)
*/
loops_per_jiffy >>= 1;
loopbit = loops_per_jiffy;
while (lps_precision-- && (loopbit >>= 1)) {
loops_per_jiffy |= loopbit;
ticks = jiffies;
while (ticks == jiffies)
/* nothing */;
ticks = jiffies;
__delay(loops_per_jiffy);
if (jiffies != ticks) /* longer than 1 tick */
loops_per_jiffy &= ~loopbit;
}
}
if (!printed)
pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
loops_per_jiffy/(500000/HZ),
(loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy);
printed = true;
}
| {
"pile_set_name": "Github"
} |
Problem: mod_search error might get deallocated too early
| {
"pile_set_name": "Github"
} |
/*************************************************************************
*
* Copyright © Microsoft Corporation. All rights reserved.
* Copyright © Broadcom Inc. All rights reserved.
* Licensed under the MIT License.
*
*************************************************************************/
module cr_kme_hmac_sha256_stub (
hash_cmdfifo_ack, hash_keyfifo_ack, hash_len_data_out_ack,
hash_in_stall, sha_tag_data, sha_tag_valid, sha_tag_last,
clk, rst_n, scan_en, scan_mode, scan_rst_n, cmdfifo_hash_valid,
cmdfifo_hash_skip, cmdfifo_hash_small_size, keyfifo_hash_data,
keyfifo_hash_valid, hash_len_data_out, hash_len_data_out_valid,
in_hash_valid, in_hash_eof, in_hash_eoc, in_hash_num_bytes,
in_hash_data, sha_tag_stall
);
input clk;
input rst_n;
input scan_en;
input scan_mode;
input scan_rst_n;
input cmdfifo_hash_valid;
input cmdfifo_hash_skip;
input cmdfifo_hash_small_size;
output hash_cmdfifo_ack;
input [255:0] keyfifo_hash_data;
input keyfifo_hash_valid;
output hash_keyfifo_ack;
input [31:0] hash_len_data_out;
input hash_len_data_out_valid;
output hash_len_data_out_ack;
input in_hash_valid;
input in_hash_eof;
input in_hash_eoc;
input [4:0] in_hash_num_bytes;
input [127:0] in_hash_data;
output hash_in_stall;
output [127:0] sha_tag_data;
output sha_tag_valid;
output sha_tag_last;
input sha_tag_stall;
assign hash_cmdfifo_ack = 1'b1;
assign hash_keyfifo_ack = 1'b1;
assign hash_len_data_out_ack = 1'b1;
assign hash_in_stall = 1'b0;
assign sha_tag_data = 128'h0;
assign sha_tag_valid = sha_tag_stall ? 1'b0 : 1'b1;
assign sha_tag_last = 1'b0;
endmodule
| {
"pile_set_name": "Github"
} |
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: residue backend 0, 1 and 2 implementation
last mod: $Id: res0.c,v 1.8 2008-02-02 15:53:54 richardash1981 Exp $
********************************************************************/
/* Slow, slow, slow, simpleminded and did I mention it was slow? The
encode/decode loops are coded for clarity and performance is not
yet even a nagging little idea lurking in the shadows. Oh and BTW,
it's slow. */
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ogg/ogg.h>
#include "vorbis/codec.h"
#include "codec_internal.h"
#include "registry.h"
#include "codebook.h"
#include "misc.h"
#include "os.h"
#if defined(TRAIN_RES) || defined (TRAIN_RESAUX)
#include <stdio.h>
#endif
typedef struct {
vorbis_info_residue0 *info;
int parts;
int stages;
codebook *fullbooks;
codebook *phrasebook;
codebook ***partbooks;
int partvals;
int **decodemap;
long postbits;
long phrasebits;
long frames;
#if defined(TRAIN_RES) || defined(TRAIN_RESAUX)
int train_seq;
long *training_data[8][64];
float training_max[8][64];
float training_min[8][64];
float tmin;
float tmax;
#endif
} vorbis_look_residue0;
void res0_free_info(vorbis_info_residue *i){
vorbis_info_residue0 *info=(vorbis_info_residue0 *)i;
if(info){
memset(info,0,sizeof(*info));
_ogg_free(info);
}
}
void res0_free_look(vorbis_look_residue *i){
int j;
if(i){
vorbis_look_residue0 *look=(vorbis_look_residue0 *)i;
#ifdef TRAIN_RES
{
int j,k,l;
for(j=0;j<look->parts;j++){
/*fprintf(stderr,"partition %d: ",j);*/
for(k=0;k<8;k++)
if(look->training_data[k][j]){
char buffer[80];
FILE *of;
codebook *statebook=look->partbooks[j][k];
/* long and short into the same bucket by current convention */
sprintf(buffer,"res_part%d_pass%d.vqd",j,k);
of=fopen(buffer,"a");
for(l=0;l<statebook->entries;l++)
fprintf(of,"%d:%ld\n",l,look->training_data[k][j][l]);
fclose(of);
/*fprintf(stderr,"%d(%.2f|%.2f) ",k,
look->training_min[k][j],look->training_max[k][j]);*/
_ogg_free(look->training_data[k][j]);
look->training_data[k][j]=NULL;
}
/*fprintf(stderr,"\n");*/
}
}
fprintf(stderr,"min/max residue: %g::%g\n",look->tmin,look->tmax);
/*fprintf(stderr,"residue bit usage %f:%f (%f total)\n",
(float)look->phrasebits/look->frames,
(float)look->postbits/look->frames,
(float)(look->postbits+look->phrasebits)/look->frames);*/
#endif
/*vorbis_info_residue0 *info=look->info;
fprintf(stderr,
"%ld frames encoded in %ld phrasebits and %ld residue bits "
"(%g/frame) \n",look->frames,look->phrasebits,
look->resbitsflat,
(look->phrasebits+look->resbitsflat)/(float)look->frames);
for(j=0;j<look->parts;j++){
long acc=0;
fprintf(stderr,"\t[%d] == ",j);
for(k=0;k<look->stages;k++)
if((info->secondstages[j]>>k)&1){
fprintf(stderr,"%ld,",look->resbits[j][k]);
acc+=look->resbits[j][k];
}
fprintf(stderr,":: (%ld vals) %1.2fbits/sample\n",look->resvals[j],
acc?(float)acc/(look->resvals[j]*info->grouping):0);
}
fprintf(stderr,"\n");*/
for(j=0;j<look->parts;j++)
if(look->partbooks[j])_ogg_free(look->partbooks[j]);
_ogg_free(look->partbooks);
for(j=0;j<look->partvals;j++)
_ogg_free(look->decodemap[j]);
_ogg_free(look->decodemap);
memset(look,0,sizeof(*look));
_ogg_free(look);
}
}
static int ilog(unsigned int v){
int ret=0;
while(v){
ret++;
v>>=1;
}
return(ret);
}
static int icount(unsigned int v){
int ret=0;
while(v){
ret+=v&1;
v>>=1;
}
return(ret);
}
void res0_pack(vorbis_info_residue *vr,oggpack_buffer *opb){
vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
int j,acc=0;
oggpack_write(opb,info->begin,24);
oggpack_write(opb,info->end,24);
oggpack_write(opb,info->grouping-1,24); /* residue vectors to group and
code with a partitioned book */
oggpack_write(opb,info->partitions-1,6); /* possible partition choices */
oggpack_write(opb,info->groupbook,8); /* group huffman book */
/* secondstages is a bitmask; as encoding progresses pass by pass, a
bitmask of one indicates this partition class has bits to write
this pass */
for(j=0;j<info->partitions;j++){
if(ilog(info->secondstages[j])>3){
/* yes, this is a minor hack due to not thinking ahead */
oggpack_write(opb,info->secondstages[j],3);
oggpack_write(opb,1,1);
oggpack_write(opb,info->secondstages[j]>>3,5);
}else
oggpack_write(opb,info->secondstages[j],4); /* trailing zero */
acc+=icount(info->secondstages[j]);
}
for(j=0;j<acc;j++)
oggpack_write(opb,info->booklist[j],8);
}
/* vorbis_info is for range checking */
vorbis_info_residue *res0_unpack(vorbis_info *vi,oggpack_buffer *opb){
int j,acc=0;
vorbis_info_residue0 *info=_ogg_calloc(1,sizeof(*info));
codec_setup_info *ci=vi->codec_setup;
info->begin=oggpack_read(opb,24);
info->end=oggpack_read(opb,24);
info->grouping=oggpack_read(opb,24)+1;
info->partitions=oggpack_read(opb,6)+1;
info->groupbook=oggpack_read(opb,8);
for(j=0;j<info->partitions;j++){
int cascade=oggpack_read(opb,3);
if(oggpack_read(opb,1))
cascade|=(oggpack_read(opb,5)<<3);
info->secondstages[j]=cascade;
acc+=icount(cascade);
}
for(j=0;j<acc;j++)
info->booklist[j]=oggpack_read(opb,8);
if(info->groupbook>=ci->books)goto errout;
for(j=0;j<acc;j++)
if(info->booklist[j]>=ci->books)goto errout;
return(info);
errout:
res0_free_info(info);
return(NULL);
}
vorbis_look_residue *res0_look(vorbis_dsp_state *vd,
vorbis_info_residue *vr){
vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr;
vorbis_look_residue0 *look=_ogg_calloc(1,sizeof(*look));
codec_setup_info *ci=vd->vi->codec_setup;
int j,k,acc=0;
int dim;
int maxstage=0;
look->info=info;
look->parts=info->partitions;
look->fullbooks=ci->fullbooks;
look->phrasebook=ci->fullbooks+info->groupbook;
dim=look->phrasebook->dim;
look->partbooks=_ogg_calloc(look->parts,sizeof(*look->partbooks));
for(j=0;j<look->parts;j++){
int stages=ilog(info->secondstages[j]);
if(stages){
if(stages>maxstage)maxstage=stages;
look->partbooks[j]=_ogg_calloc(stages,sizeof(*look->partbooks[j]));
for(k=0;k<stages;k++)
if(info->secondstages[j]&(1<<k)){
look->partbooks[j][k]=ci->fullbooks+info->booklist[acc++];
#ifdef TRAIN_RES
look->training_data[k][j]=_ogg_calloc(look->partbooks[j][k]->entries,
sizeof(***look->training_data));
#endif
}
}
}
look->partvals=rint(pow((float)look->parts,(float)dim));
look->stages=maxstage;
look->decodemap=_ogg_malloc(look->partvals*sizeof(*look->decodemap));
for(j=0;j<look->partvals;j++){
long val=j;
long mult=look->partvals/look->parts;
look->decodemap[j]=_ogg_malloc(dim*sizeof(*look->decodemap[j]));
for(k=0;k<dim;k++){
long deco=val/mult;
val-=deco*mult;
mult/=look->parts;
look->decodemap[j][k]=deco;
}
}
#if defined(TRAIN_RES) || defined (TRAIN_RESAUX)
{
static int train_seq=0;
look->train_seq=train_seq++;
}
#endif
return(look);
}
/* break an abstraction and copy some code for performance purposes */
static int local_book_besterror(codebook *book,float *a){
int dim=book->dim,i,k,o;
int best=0;
encode_aux_threshmatch *tt=book->c->thresh_tree;
/* find the quant val of each scalar */
for(k=0,o=dim;k<dim;++k){
float val=a[--o];
i=tt->threshvals>>1;
if(val<tt->quantthresh[i]){
if(val<tt->quantthresh[i-1]){
for(--i;i>0;--i)
if(val>=tt->quantthresh[i-1])
break;
}
}else{
for(++i;i<tt->threshvals-1;++i)
if(val<tt->quantthresh[i])break;
}
best=(best*tt->quantvals)+tt->quantmap[i];
}
/* regular lattices are easy :-) */
if(book->c->lengthlist[best]<=0){
const static_codebook *c=book->c;
int i,j;
float bestf=0.f;
float *e=book->valuelist;
best=-1;
for(i=0;i<book->entries;i++){
if(c->lengthlist[i]>0){
float this=0.f;
for(j=0;j<dim;j++){
float val=(e[j]-a[j]);
this+=val*val;
}
if(best==-1 || this<bestf){
bestf=this;
best=i;
}
}
e+=dim;
}
}
if(best>-1){
float *ptr=book->valuelist+best*dim;
for(i=0;i<dim;i++)
*a++ -= *ptr++;
}
return(best);
}
static int _encodepart(oggpack_buffer *opb,float *vec, int n,
codebook *book,long *acc){
int i,bits=0;
int dim=book->dim;
int step=n/dim;
for(i=0;i<step;i++){
int entry=local_book_besterror(book,vec+i*dim);
#ifdef TRAIN_RES
if(entry>0)
acc[entry]++;
#endif
bits+=vorbis_book_encode(book,entry,opb);
}
return(bits);
}
static long **_01class(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int ch){
long i,j,k;
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
vorbis_info_residue0 *info=look->info;
vorbis_info *vi=vb->vd->vi;
codec_setup_info *ci=vi->codec_setup;
/* move all this setup out later */
int samples_per_partition=info->grouping;
int possible_partitions=info->partitions;
int n=info->end-info->begin;
int partvals=n/samples_per_partition;
long **partword=_vorbis_block_alloc(vb,ch*sizeof(*partword));
float scale=100./samples_per_partition;
/* we find the partition type for each partition of each
channel. We'll go back and do the interleaved encoding in a
bit. For now, clarity */
for(i=0;i<ch;i++){
partword[i]=_vorbis_block_alloc(vb,n/samples_per_partition*sizeof(*partword[i]));
memset(partword[i],0,n/samples_per_partition*sizeof(*partword[i]));
}
for(i=0;i<partvals;i++){
int offset=i*samples_per_partition+info->begin;
for(j=0;j<ch;j++){
float max=0.;
float ent=0.;
for(k=0;k<samples_per_partition;k++){
if(fabs(in[j][offset+k])>max)max=fabs(in[j][offset+k]);
ent+=fabs(rint(in[j][offset+k]));
}
ent*=scale;
for(k=0;k<possible_partitions-1;k++)
if(max<=info->classmetric1[k] &&
(info->classmetric2[k]<0 || (int)ent<info->classmetric2[k]))
break;
partword[j][i]=k;
}
}
#ifdef TRAIN_RESAUX
{
FILE *of;
char buffer[80];
for(i=0;i<ch;i++){
sprintf(buffer,"resaux_%d.vqd",look->train_seq);
of=fopen(buffer,"a");
for(j=0;j<partvals;j++)
fprintf(of,"%ld, ",partword[i][j]);
fprintf(of,"\n");
fclose(of);
}
}
#endif
look->frames++;
return(partword);
}
/* designed for stereo or other modes where the partition size is an
integer multiple of the number of channels encoded in the current
submap */
static long **_2class(vorbis_block *vb,vorbis_look_residue *vl,float **in,
int ch){
long i,j,k,l;
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
vorbis_info_residue0 *info=look->info;
/* move all this setup out later */
int samples_per_partition=info->grouping;
int possible_partitions=info->partitions;
int n=info->end-info->begin;
int partvals=n/samples_per_partition;
long **partword=_vorbis_block_alloc(vb,sizeof(*partword));
#if defined(TRAIN_RES) || defined (TRAIN_RESAUX)
FILE *of;
char buffer[80];
#endif
partword[0]=_vorbis_block_alloc(vb,n*ch/samples_per_partition*sizeof(*partword[0]));
memset(partword[0],0,n*ch/samples_per_partition*sizeof(*partword[0]));
for(i=0,l=info->begin/ch;i<partvals;i++){
float magmax=0.f;
float angmax=0.f;
for(j=0;j<samples_per_partition;j+=ch){
if(fabs(in[0][l])>magmax)magmax=fabs(in[0][l]);
for(k=1;k<ch;k++)
if(fabs(in[k][l])>angmax)angmax=fabs(in[k][l]);
l++;
}
for(j=0;j<possible_partitions-1;j++)
if(magmax<=info->classmetric1[j] &&
angmax<=info->classmetric2[j])
break;
partword[0][i]=j;
}
#ifdef TRAIN_RESAUX
sprintf(buffer,"resaux_%d.vqd",look->train_seq);
of=fopen(buffer,"a");
for(i=0;i<partvals;i++)
fprintf(of,"%ld, ",partword[0][i]);
fprintf(of,"\n");
fclose(of);
#endif
look->frames++;
return(partword);
}
static int _01forward(oggpack_buffer *opb,
vorbis_block *vb,vorbis_look_residue *vl,
float **in,int ch,
long **partword,
int (*encode)(oggpack_buffer *,float *,int,
codebook *,long *)){
long i,j,k,s;
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
vorbis_info_residue0 *info=look->info;
vorbis_dsp_state *vd=vb->vd;
/* move all this setup out later */
int samples_per_partition=info->grouping;
int possible_partitions=info->partitions;
int partitions_per_word=look->phrasebook->dim;
int n=info->end-info->begin;
int partvals=n/samples_per_partition;
long resbits[128];
long resvals[128];
#ifdef TRAIN_RES
for(i=0;i<ch;i++)
for(j=info->begin;j<end;j++){
if(in[i][j]>look->tmax)look->tmax=in[i][j];
if(in[i][j]<look->tmin)look->tmin=in[i][j];
}
#endif
memset(resbits,0,sizeof(resbits));
memset(resvals,0,sizeof(resvals));
/* we code the partition words for each channel, then the residual
words for a partition per channel until we've written all the
residual words for that partition word. Then write the next
partition channel words... */
for(s=0;s<look->stages;s++){
for(i=0;i<partvals;){
/* first we encode a partition codeword for each channel */
if(s==0){
for(j=0;j<ch;j++){
long val=partword[j][i];
for(k=1;k<partitions_per_word;k++){
val*=possible_partitions;
if(i+k<partvals)
val+=partword[j][i+k];
}
/* training hack */
if(val<look->phrasebook->entries)
look->phrasebits+=vorbis_book_encode(look->phrasebook,val,opb);
#if 0 /*def TRAIN_RES*/
else
fprintf(stderr,"!");
#endif
}
}
/* now we encode interleaved residual values for the partitions */
for(k=0;k<partitions_per_word && i<partvals;k++,i++){
long offset=i*samples_per_partition+info->begin;
for(j=0;j<ch;j++){
if(s==0)resvals[partword[j][i]]+=samples_per_partition;
if(info->secondstages[partword[j][i]]&(1<<s)){
codebook *statebook=look->partbooks[partword[j][i]][s];
if(statebook){
int ret;
long *accumulator=NULL;
#ifdef TRAIN_RES
accumulator=look->training_data[s][partword[j][i]];
{
int l;
float *samples=in[j]+offset;
for(l=0;l<samples_per_partition;l++){
if(samples[l]<look->training_min[s][partword[j][i]])
look->training_min[s][partword[j][i]]=samples[l];
if(samples[l]>look->training_max[s][partword[j][i]])
look->training_max[s][partword[j][i]]=samples[l];
}
}
#endif
ret=encode(opb,in[j]+offset,samples_per_partition,
statebook,accumulator);
look->postbits+=ret;
resbits[partword[j][i]]+=ret;
}
}
}
}
}
}
/*{
long total=0;
long totalbits=0;
fprintf(stderr,"%d :: ",vb->mode);
for(k=0;k<possible_partitions;k++){
fprintf(stderr,"%ld/%1.2g, ",resvals[k],(float)resbits[k]/resvals[k]);
total+=resvals[k];
totalbits+=resbits[k];
}
fprintf(stderr,":: %ld:%1.2g\n",total,(double)totalbits/total);
}*/
return(0);
}
/* a truncated packet here just means 'stop working'; it's not an error */
static int _01inverse(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int ch,
long (*decodepart)(codebook *, float *,
oggpack_buffer *,int)){
long i,j,k,l,s;
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
vorbis_info_residue0 *info=look->info;
/* move all this setup out later */
int samples_per_partition=info->grouping;
int partitions_per_word=look->phrasebook->dim;
int max=vb->pcmend>>1;
int end=(info->end<max?info->end:max);
int n=end-info->begin;
if(n>0){
int partvals=n/samples_per_partition;
int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
int ***partword=alloca(ch*sizeof(*partword));
for(j=0;j<ch;j++)
partword[j]=_vorbis_block_alloc(vb,partwords*sizeof(*partword[j]));
for(s=0;s<look->stages;s++){
/* each loop decodes on partition codeword containing
partitions_per_word partitions */
for(i=0,l=0;i<partvals;l++){
if(s==0){
/* fetch the partition word for each channel */
for(j=0;j<ch;j++){
int temp=vorbis_book_decode(look->phrasebook,&vb->opb);
if(temp==-1)goto eopbreak;
partword[j][l]=look->decodemap[temp];
if(partword[j][l]==NULL)goto errout;
}
}
/* now we decode residual values for the partitions */
for(k=0;k<partitions_per_word && i<partvals;k++,i++)
for(j=0;j<ch;j++){
long offset=info->begin+i*samples_per_partition;
if(info->secondstages[partword[j][l][k]]&(1<<s)){
codebook *stagebook=look->partbooks[partword[j][l][k]][s];
if(stagebook){
if(decodepart(stagebook,in[j]+offset,&vb->opb,
samples_per_partition)==-1)goto eopbreak;
}
}
}
}
}
}
errout:
eopbreak:
return(0);
}
#if 0
/* residue 0 and 1 are just slight variants of one another. 0 is
interleaved, 1 is not */
long **res0_class(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int *nonzero,int ch){
/* we encode only the nonzero parts of a bundle */
int i,used=0;
for(i=0;i<ch;i++)
if(nonzero[i])
in[used++]=in[i];
if(used)
/*return(_01class(vb,vl,in,used,_interleaved_testhack));*/
return(_01class(vb,vl,in,used));
else
return(0);
}
int res0_forward(vorbis_block *vb,vorbis_look_residue *vl,
float **in,float **out,int *nonzero,int ch,
long **partword){
/* we encode only the nonzero parts of a bundle */
int i,j,used=0,n=vb->pcmend/2;
for(i=0;i<ch;i++)
if(nonzero[i]){
if(out)
for(j=0;j<n;j++)
out[i][j]+=in[i][j];
in[used++]=in[i];
}
if(used){
int ret=_01forward(vb,vl,in,used,partword,
_interleaved_encodepart);
if(out){
used=0;
for(i=0;i<ch;i++)
if(nonzero[i]){
for(j=0;j<n;j++)
out[i][j]-=in[used][j];
used++;
}
}
return(ret);
}else{
return(0);
}
}
#endif
int res0_inverse(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int *nonzero,int ch){
int i,used=0;
for(i=0;i<ch;i++)
if(nonzero[i])
in[used++]=in[i];
if(used)
return(_01inverse(vb,vl,in,used,vorbis_book_decodevs_add));
else
return(0);
}
int res1_forward(oggpack_buffer *opb,vorbis_block *vb,vorbis_look_residue *vl,
float **in,float **out,int *nonzero,int ch,
long **partword){
int i,j,used=0,n=vb->pcmend/2;
for(i=0;i<ch;i++)
if(nonzero[i]){
if(out)
for(j=0;j<n;j++)
out[i][j]+=in[i][j];
in[used++]=in[i];
}
if(used){
int ret=_01forward(opb,vb,vl,in,used,partword,_encodepart);
if(out){
used=0;
for(i=0;i<ch;i++)
if(nonzero[i]){
for(j=0;j<n;j++)
out[i][j]-=in[used][j];
used++;
}
}
return(ret);
}else{
return(0);
}
}
long **res1_class(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int *nonzero,int ch){
int i,used=0;
for(i=0;i<ch;i++)
if(nonzero[i])
in[used++]=in[i];
if(used)
return(_01class(vb,vl,in,used));
else
return(0);
}
int res1_inverse(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int *nonzero,int ch){
int i,used=0;
for(i=0;i<ch;i++)
if(nonzero[i])
in[used++]=in[i];
if(used)
return(_01inverse(vb,vl,in,used,vorbis_book_decodev_add));
else
return(0);
}
long **res2_class(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int *nonzero,int ch){
int i,used=0;
for(i=0;i<ch;i++)
if(nonzero[i])used++;
if(used)
return(_2class(vb,vl,in,ch));
else
return(0);
}
/* res2 is slightly more different; all the channels are interleaved
into a single vector and encoded. */
int res2_forward(oggpack_buffer *opb,
vorbis_block *vb,vorbis_look_residue *vl,
float **in,float **out,int *nonzero,int ch,
long **partword){
long i,j,k,n=vb->pcmend/2,used=0;
/* don't duplicate the code; use a working vector hack for now and
reshape ourselves into a single channel res1 */
/* ugly; reallocs for each coupling pass :-( */
float *work=_vorbis_block_alloc(vb,ch*n*sizeof(*work));
for(i=0;i<ch;i++){
float *pcm=in[i];
if(nonzero[i])used++;
for(j=0,k=i;j<n;j++,k+=ch)
work[k]=pcm[j];
}
if(used){
int ret=_01forward(opb,vb,vl,&work,1,partword,_encodepart);
/* update the sofar vector */
if(out){
for(i=0;i<ch;i++){
float *pcm=in[i];
float *sofar=out[i];
for(j=0,k=i;j<n;j++,k+=ch)
sofar[j]+=pcm[j]-work[k];
}
}
return(ret);
}else{
return(0);
}
}
/* duplicate code here as speed is somewhat more important */
int res2_inverse(vorbis_block *vb,vorbis_look_residue *vl,
float **in,int *nonzero,int ch){
long i,k,l,s;
vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl;
vorbis_info_residue0 *info=look->info;
/* move all this setup out later */
int samples_per_partition=info->grouping;
int partitions_per_word=look->phrasebook->dim;
int max=(vb->pcmend*ch)>>1;
int end=(info->end<max?info->end:max);
int n=end-info->begin;
if(n>0){
int partvals=n/samples_per_partition;
int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
int **partword=_vorbis_block_alloc(vb,partwords*sizeof(*partword));
for(i=0;i<ch;i++)if(nonzero[i])break;
if(i==ch)return(0); /* no nonzero vectors */
for(s=0;s<look->stages;s++){
for(i=0,l=0;i<partvals;l++){
if(s==0){
/* fetch the partition word */
int temp=vorbis_book_decode(look->phrasebook,&vb->opb);
if(temp==-1)goto eopbreak;
partword[l]=look->decodemap[temp];
if(partword[l]==NULL)goto errout;
}
/* now we decode residual values for the partitions */
for(k=0;k<partitions_per_word && i<partvals;k++,i++)
if(info->secondstages[partword[l][k]]&(1<<s)){
codebook *stagebook=look->partbooks[partword[l][k]][s];
if(stagebook){
if(vorbis_book_decodevv_add(stagebook,in,
i*samples_per_partition+info->begin,ch,
&vb->opb,samples_per_partition)==-1)
goto eopbreak;
}
}
}
}
}
errout:
eopbreak:
return(0);
}
vorbis_func_residue residue0_exportbundle={
NULL,
&res0_unpack,
&res0_look,
&res0_free_info,
&res0_free_look,
NULL,
NULL,
&res0_inverse
};
vorbis_func_residue residue1_exportbundle={
&res0_pack,
&res0_unpack,
&res0_look,
&res0_free_info,
&res0_free_look,
&res1_class,
&res1_forward,
&res1_inverse
};
vorbis_func_residue residue2_exportbundle={
&res0_pack,
&res0_unpack,
&res0_look,
&res0_free_info,
&res0_free_look,
&res2_class,
&res2_forward,
&res2_inverse
};
| {
"pile_set_name": "Github"
} |
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stddef.h>
#include <stdint.h>
#include "net/proxy/proxy_list.h"
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
net::ProxyList list;
std::string input(data, data + size);
list.Set(input);
return 0;
}
| {
"pile_set_name": "Github"
} |
{"name":"qstorage","vers":"0.1.0","deps":[],"cksum":"17ed63bc00adfd171627ae0c4ad60089d567b19cc021ed032ea98aa6b272b2b7","features":{},"yanked":false,"links":null}
| {
"pile_set_name": "Github"
} |
<!--
***********************************************************************************************
Xamarin.WatchOS.Common.props
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
This file defines default properties for iOS App Extension projects.
Copyright (C) 2015-2016 Xamarin. All rights reserved.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.props"
Condition="Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).Before.props')"/>
<Import Project="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.props"
Condition="Exists('$(MSBuildThisFileDirectory)$(MSBuildThisFileName).After.props')"/>
</Project>
| {
"pile_set_name": "Github"
} |
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vJoyInterface", "vJoyInterface2012.vcxproj", "{9E1FC894-F587-4FBA-8599-2F8C544E061A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vJoyFeeder", "..\..\vJoyFeeder\vJoyFeeder.vcxproj", "{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}"
ProjectSection(ProjectDependencies) = postProject
{9E1FC894-F587-4FBA-8599-2F8C544E061A} = {9E1FC894-F587-4FBA-8599-2F8C544E061A}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D3627350-BA2C-4736-BF25-2E1E947F2D86}"
ProjectSection(SolutionItems) = preProject
Performance1.psess = Performance1.psess
Performance2.psess = Performance2.psess
Performance3.psess = Performance3.psess
Performance4.psess = Performance4.psess
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|Win32 = Release|Win32
Release|x64 = Release|x64
Vista Debug|Any CPU = Vista Debug|Any CPU
Vista Debug|Win32 = Vista Debug|Win32
Vista Debug|x64 = Vista Debug|x64
Vista Release|Any CPU = Vista Release|Any CPU
Vista Release|Win32 = Vista Release|Win32
Vista Release|x64 = Vista Release|x64
Win7 Debug|Any CPU = Win7 Debug|Any CPU
Win7 Debug|Win32 = Win7 Debug|Win32
Win7 Debug|x64 = Win7 Debug|x64
Win7 Release|Any CPU = Win7 Release|Any CPU
Win7 Release|Win32 = Win7 Release|Win32
Win7 Release|x64 = Win7 Release|x64
Win8 Debug|Any CPU = Win8 Debug|Any CPU
Win8 Debug|Win32 = Win8 Debug|Win32
Win8 Debug|x64 = Win8 Debug|x64
Win8 Release|Any CPU = Win8 Release|Any CPU
Win8 Release|Win32 = Win8 Release|Win32
Win8 Release|x64 = Win8 Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Debug|Any CPU.ActiveCfg = Win7 Debug|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Debug|Win32.ActiveCfg = Debug|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Debug|Win32.Build.0 = Debug|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Debug|Win32.Deploy.0 = Debug|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Debug|x64.ActiveCfg = Debug|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Debug|x64.Build.0 = Debug|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Release|Any CPU.ActiveCfg = Release|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Release|Win32.ActiveCfg = Win8 Release|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Release|Win32.Build.0 = Win8 Release|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Release|Win32.Deploy.0 = Win8 Release|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Release|x64.ActiveCfg = Release|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Release|x64.Build.0 = Release|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Vista Debug|Any CPU.ActiveCfg = Vista Debug|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Vista Debug|Win32.ActiveCfg = Vista Debug|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Vista Debug|Win32.Build.0 = Vista Debug|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Vista Debug|Win32.Deploy.0 = Vista Debug|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Vista Debug|x64.ActiveCfg = Vista Debug|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Vista Debug|x64.Build.0 = Vista Debug|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Vista Debug|x64.Deploy.0 = Vista Debug|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Vista Release|Any CPU.ActiveCfg = Vista Release|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Vista Release|Win32.ActiveCfg = Vista Release|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Vista Release|Win32.Build.0 = Vista Release|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Vista Release|Win32.Deploy.0 = Vista Release|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Vista Release|x64.ActiveCfg = Vista Release|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Vista Release|x64.Build.0 = Vista Release|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Vista Release|x64.Deploy.0 = Vista Release|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win7 Debug|Any CPU.ActiveCfg = Win7 Debug|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win7 Debug|Win32.ActiveCfg = Win7 Debug|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win7 Debug|Win32.Build.0 = Win7 Debug|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win7 Debug|Win32.Deploy.0 = Win7 Debug|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win7 Debug|x64.ActiveCfg = Win7 Debug|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win7 Debug|x64.Build.0 = Win7 Debug|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win7 Debug|x64.Deploy.0 = Win7 Debug|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win7 Release|Any CPU.ActiveCfg = Win7 Release|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win7 Release|Win32.ActiveCfg = Win7 Release|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win7 Release|Win32.Build.0 = Win7 Release|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win7 Release|Win32.Deploy.0 = Win7 Release|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win7 Release|x64.ActiveCfg = Win7 Release|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win7 Release|x64.Build.0 = Win7 Release|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win7 Release|x64.Deploy.0 = Win7 Release|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win8 Debug|Any CPU.ActiveCfg = Win8 Debug|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win8 Debug|Win32.ActiveCfg = Win8 Debug|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win8 Debug|Win32.Build.0 = Win8 Debug|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win8 Debug|Win32.Deploy.0 = Win8 Debug|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win8 Debug|x64.ActiveCfg = Win8 Debug|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win8 Debug|x64.Build.0 = Win8 Debug|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win8 Debug|x64.Deploy.0 = Win8 Debug|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win8 Release|Any CPU.ActiveCfg = Win8 Release|Win32
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win8 Release|Win32.ActiveCfg = Win8 Release|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win8 Release|Win32.Build.0 = Win8 Release|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win8 Release|Win32.Deploy.0 = Win8 Release|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win8 Release|x64.ActiveCfg = Win8 Release|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win8 Release|x64.Build.0 = Win8 Release|x64
{9E1FC894-F587-4FBA-8599-2F8C544E061A}.Win8 Release|x64.Deploy.0 = Win8 Release|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Debug|Any CPU.ActiveCfg = Debug|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Debug|Win32.ActiveCfg = Debug|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Debug|Win32.Build.0 = Debug|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Debug|x64.ActiveCfg = Debug|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Debug|x64.Build.0 = Debug|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Release|Any CPU.ActiveCfg = Release|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Release|Win32.ActiveCfg = Release|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Release|Win32.Build.0 = Release|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Release|x64.ActiveCfg = Release|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Release|x64.Build.0 = Release|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Vista Debug|Any CPU.ActiveCfg = Debug|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Vista Debug|Win32.ActiveCfg = Debug|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Vista Debug|Win32.Build.0 = Debug|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Vista Debug|x64.ActiveCfg = Debug|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Vista Debug|x64.Build.0 = Debug|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Vista Release|Any CPU.ActiveCfg = Release|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Vista Release|Win32.ActiveCfg = Release|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Vista Release|Win32.Build.0 = Release|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Vista Release|x64.ActiveCfg = Release|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Vista Release|x64.Build.0 = Release|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win7 Debug|Any CPU.ActiveCfg = Debug|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win7 Debug|Win32.ActiveCfg = Debug|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win7 Debug|Win32.Build.0 = Debug|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win7 Debug|x64.ActiveCfg = Debug|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win7 Debug|x64.Build.0 = Debug|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win7 Release|Any CPU.ActiveCfg = Release|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win7 Release|Win32.ActiveCfg = Release|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win7 Release|Win32.Build.0 = Release|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win7 Release|x64.ActiveCfg = Release|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win7 Release|x64.Build.0 = Release|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win8 Debug|Any CPU.ActiveCfg = Debug|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win8 Debug|Win32.ActiveCfg = Debug|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win8 Debug|Win32.Build.0 = Debug|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win8 Debug|x64.ActiveCfg = Debug|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win8 Debug|x64.Build.0 = Debug|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win8 Release|Any CPU.ActiveCfg = Release|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win8 Release|Win32.ActiveCfg = Release|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win8 Release|Win32.Build.0 = Release|Win32
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win8 Release|x64.ActiveCfg = Release|x64
{0B6F020D-754E-4B0D-9575-BAA03E0FBABD}.Win8 Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
| {
"pile_set_name": "Github"
} |
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* If y>0 and x is -0, Math.atan2(y,x) is an implementation-dependent approximation to +PI/2
*
* @path ch15/15.8/15.8.2/15.8.2.5/S15.8.2.5_A3.js
* @description Checking if Math.atan2(y,x) is an approximation to +PI/2, where y>0 and x is -0
*/
$INCLUDE("math_precision.js");
$INCLUDE("math_isequal.js");
// CHECK#1
x = -0;
//prec = 0.00000000000001;
y = new Array();
y[0] = 0.000000000000001;
y[2] = +Infinity;
y[1] = 1;
ynum = 3;
for (i = 0; i < ynum; i++)
{
if (!isEqual(Math.atan2(y[i],x), (Math.PI)/2))
$FAIL("#1: Math.abs(Math.atan2(" + y[i] + ", " + x + ") - ((Math.PI)/2)) >= " + prec);
}
| {
"pile_set_name": "Github"
} |
const { Plugin } = require('elements')
const { MutationObserver } = window
module.exports = class react extends Plugin {
async preload () {
this.observer = new MutationObserver(mutation => this.onMutate(mutation))
}
load () {
// start with a clean setup
this.observer.disconnect()
this.observer.observe(document.getElementById('app-mount'), {
childList: true,
subtree: true
})
this.observer.observe(document.querySelector('html'), {
attributes: true
})
}
get iconURL () {
return '//discordinjections.xyz/img/logo.png'
}
getReactInstance (node) {
const key = Object.keys(node).find(key =>
key.startsWith('__reactInternalInstance')
)
return node[key]
}
createElement (text) {
return document.createRange().createContextualFragment(text)
}
createModal (content) {
const root = document.querySelector('#app-mount')
if (this._modal) this.destroyModal()
this._modal = this.createElement(`
<div class="theme-dark DI-modal">
<div class="callout-backdrop"></div>
<div class="DI-modal-outer" style="opacity: 1">
<div class="DI-modal-inner expanded">
<div class="DI-modal-body">
${content}
</div>
</div>
</div>
</div>
`)
this._modal
.querySelector('.DI-modal-inner')
.addEventListener('click', event => {
event.stopPropagation()
})
let close = this._modal.querySelector('.DI-modal-close-button')
if (close) close.addEventListener('click', this.destroyModal.bind(this))
if (!this._hasSetKeyListener) {
document.body.addEventListener('keyup', this._modalKeypress.bind(this))
document.body.addEventListener('click', this.destroyModal.bind(this))
this._hasSetKeyListener = true
}
root.appendChild(this._modal)
this._modal = root.querySelector('.DI-modal')
const backdrop = this._modal.querySelector('.callout-backdrop')
setTimeout(() => {
backdrop.style.opacity = 0.6
}, 1)
}
_modalKeypress (e) {
if (e.code === 'Escape') this.destroyModal()
}
destroyModal () {
if (this._modal) {
let backdrop = this._modal.querySelector('.callout-backdrop')
let inner = this._modal.querySelector('.DI-modal-inner')
let close = this._modal.querySelector('.DI-modal-close-button')
backdrop.style.opacity = 0
inner.classList.remove('expanded')
setTimeout(() => {
if (close) close.addEventListener('click', this.destroyModal.bind(this))
document.body.removeEventListener(
'keyup',
this._modalKeypress.bind(this)
)
document.body.removeEventListener('click', this.destroyModal.bind(this))
this._modal.parentNode.removeChild(this._modal)
this._modal = null
}, 200)
}
}
get settingsTabs () {
return {
'User Settings': 'userSettings',
'My Account': 'userAccount',
'Privacy & Safety': 'privacySettings',
'Authorized Apps': 'authorizedApps',
Connections: 'connections',
'Discord Nitro': 'nitro',
'App Settings': 'appSettings',
Voice: 'voiceSettings',
Overlay: 'overlaySettings',
Notifications: 'notificationSettings',
Keybindings: 'keybindingSettings',
Games: 'gameSettings',
'Text & Images': 'messageSettings',
Appearance: 'appearanceSettings',
'Streamer Mode': 'streamerSettings',
Language: 'languageSettings',
'Change Log': 'changelog',
'Log Out': 'logout'
}
}
onMutate (muts) {
this.emit('mutation', muts)
// change of language.
if (
muts.length === 1 &&
muts[0].type === 'attributes' &&
muts[0].attributeName === 'lang'
) {
return this.emit('languageChange', muts[0].target.attributes.lang.value)
}
muts.forEach(mut => {
if (mut.addedNodes.length + mut.removedNodes.length === 0) {
return
}
const changed = (mut.addedNodes.length
? mut.addedNodes
: mut.removedNodes)[0]
const added = mut.addedNodes.length > 0
// Settings
if (changed.classList && changed.matches('[class*=layer]')) {
const programSettings = !!changed.querySelector(
'[class*="socialLinks"]'
)
if (programSettings && changed.childNodes.length > 0) {
const child = changed.childNodes[0]
let sidebarView = changed.querySelector('[class*="standardSidebarView"]')
if (sidebarView) {
if (added) {
this.emit('settingsOpened', mut)
} else {
this.emit('settingsClosed', mut)
}
}
}
} else if (
added &&
changed.closest &&
changed.closest('.content-region')
) {
//! TODO: make this multilingual
const element = document.querySelector(
'[class*="layer"] .sidebar [class*="selected"]'
)
this.emit(
'settingsTab',
this.settingsTabs[element.innerText] || 'unknown',
mut
)
} else if (changed.classList && changed.classList.contains('chat')) {
// Chat
if (added) {
this.emit('chatOpened', mut)
} else {
this.emit('chatClosed', mut)
}
} else if (
changed.className &&
changed.className.match &&
changed.className.match(/\bchannelTextArea-/) &&
added
) {
this.emit('channelChanged', mut)
} else if (changed.id === 'friends') {
// FriendsList
if (added) {
this.emit('friendsListOpened', mut)
} else {
this.emit('friendsListClosed', mut)
}
}
})
}
}
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
// Code generated. DO NOT EDIT.
// Core Services API
//
// API covering the Networking (https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/overview.htm),
// Compute (https://docs.cloud.oracle.com/iaas/Content/Compute/Concepts/computeoverview.htm), and
// Block Volume (https://docs.cloud.oracle.com/iaas/Content/Block/Concepts/overview.htm) services. Use this API
// to manage resources such as virtual cloud networks (VCNs), compute instances, and
// block storage volumes.
//
package core
import (
"github.com/oracle/oci-go-sdk/common"
)
// ChangeNatGatewayCompartmentDetails The configuration details for the move operation.
type ChangeNatGatewayCompartmentDetails struct {
// The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment to move the NAT gateway to.
CompartmentId *string `mandatory:"true" json:"compartmentId"`
}
func (m ChangeNatGatewayCompartmentDetails) String() string {
return common.PointerString(m)
}
| {
"pile_set_name": "Github"
} |
#region Copyright (C) 2007-2018 Team MediaPortal
/*
Copyright (C) 2007-2018 Team MediaPortal
http://www.team-mediaportal.com
This file is part of MediaPortal 2
MediaPortal 2 is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
MediaPortal 2 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 MediaPortal 2. If not, see <http://www.gnu.org/licenses/>.
*/
#endregion
using System;
namespace MediaPortal.Common.MediaManagement.DefaultItemAspects
{
/// <summary>
/// Contains the metadata specification of a stub.
/// </summary>
public static class StubAspect
{
/// <summary>
/// Media item aspect id of the stub aspect.
/// </summary>
public static readonly Guid ASPECT_ID = new Guid("39CE567C-278F-489C-B846-D0E0671AD4C2");
/// <summary>
/// Disc name in windows explorer.
/// </summary>
public static readonly MediaItemAspectMetadata.SingleAttributeSpecification ATTR_DISC_NAME =
MediaItemAspectMetadata.CreateSingleStringAttributeSpecification("DiscName", 250, Cardinality.Inline, true);
/// <summary>
/// Message to show when the disc is needed.
/// </summary>
public static readonly MediaItemAspectMetadata.SingleAttributeSpecification ATTR_MESSAGE =
MediaItemAspectMetadata.CreateSingleStringAttributeSpecification("Message", 250, Cardinality.Inline, false);
public static readonly SingleMediaItemAspectMetadata Metadata = new SingleMediaItemAspectMetadata(
ASPECT_ID, "StubItem", new[] {
ATTR_DISC_NAME,
ATTR_MESSAGE
});
}
}
| {
"pile_set_name": "Github"
} |
<?php
return array(
'assigned_to' => 'Desemnata catre',
'checkout' => 'Predat/Primit',
'id' => 'ID',
'license_email' => 'E-mail licenta',
'license_name' => 'Licentiat catre',
'purchase_date' => 'Data achizitie',
'purchased' => 'Achizitionat',
'seats' => 'Locuri',
'hardware' => 'Hardware',
'serial' => 'Serial',
'title' => 'Licenta',
);
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2009-2010 WSO2, Inc. http://wso2.com
*
* 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.
*/
#ifndef ADB_EXCEPTION_H
#define ADB_EXCEPTION_H
/**
* adb_Exception.h
*
* This file was auto-generated from WSDL
* by the Apache Axis2/Java version: #axisVersion# #today#
*/
/**
* adb_Exception class
*/
#include <stdio.h>
#include <axiom.h>
#include <axis2_util.h>
#include <axiom_soap.h>
#include <axis2_client.h>
#include "axis2_extension_mapper.h"
#ifdef __cplusplus
extern "C"
{
#endif
#define ADB_DEFAULT_DIGIT_LIMIT 1024
#define ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT 64
typedef struct adb_Exception adb_Exception_t;
/******************************* Create and Free functions *********************************/
/**
* Constructor for creating adb_Exception_t
* @param env pointer to environment struct
* @return newly created adb_Exception_t object
*/
adb_Exception_t* AXIS2_CALL
adb_Exception_create(
const axutil_env_t *env );
/**
* Wrapper for the "free" function, will invoke the extension mapper instead
* @param _Exception adb_Exception_t object to free
* @param env pointer to environment struct
* @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
*/
axis2_status_t AXIS2_CALL
adb_Exception_free (
adb_Exception_t* _Exception,
const axutil_env_t *env);
/**
* Free adb_Exception_t object
* @param _Exception adb_Exception_t object to free
* @param env pointer to environment struct
* @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
*/
axis2_status_t AXIS2_CALL
adb_Exception_free_obj (
adb_Exception_t* _Exception,
const axutil_env_t *env);
/********************************** Getters and Setters **************************************/
/**
* Getter for Exception.
* @param _Exception adb_Exception_t object
* @param env pointer to environment struct
* @return axiom_node_t*
*/
axiom_node_t* AXIS2_CALL
adb_Exception_get_Exception(
adb_Exception_t* _Exception,
const axutil_env_t *env);
/**
* Setter for Exception.
* @param _Exception adb_Exception_t object
* @param env pointer to environment struct
* @param arg_Exception axiom_node_t*
* @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
*/
axis2_status_t AXIS2_CALL
adb_Exception_set_Exception(
adb_Exception_t* _Exception,
const axutil_env_t *env,
axiom_node_t* arg_Exception);
/**
* Resetter for Exception
* @param _Exception adb_Exception_t object
* @param env pointer to environment struct
* @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
*/
axis2_status_t AXIS2_CALL
adb_Exception_reset_Exception(
adb_Exception_t* _Exception,
const axutil_env_t *env);
/******************************* Checking and Setting NIL values *********************************/
/**
* NOTE: set_nil is only available for nillable properties
*/
/**
* Check whether Exception is nill
* @param _Exception adb_Exception_t object
* @param env pointer to environment struct
* @return AXIS2_TRUE if the element is nil or AXIS2_FALSE otherwise
*/
axis2_bool_t AXIS2_CALL
adb_Exception_is_Exception_nil(
adb_Exception_t* _Exception,
const axutil_env_t *env);
/**
* Set Exception to nill (currently the same as reset)
* @param _Exception adb_Exception_t object
* @param env pointer to environment struct
* @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
*/
axis2_status_t AXIS2_CALL
adb_Exception_set_Exception_nil(
adb_Exception_t* _Exception,
const axutil_env_t *env);
/**************************** Serialize and Deserialize functions ***************************/
/*********** These functions are for use only inside the generated code *********************/
/**
* Wrapper for the deserialization function, will invoke the extension mapper instead
* @param _Exception adb_Exception_t object
* @param env pointer to environment struct
* @param dp_parent double pointer to the parent node to deserialize
* @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?)
* @param dont_care_minoccurs Dont set errors on validating minoccurs,
* (Parent will order this in a case of choice)
* @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
*/
axis2_status_t AXIS2_CALL
adb_Exception_deserialize(
adb_Exception_t* _Exception,
const axutil_env_t *env,
axiom_node_t** dp_parent,
axis2_bool_t *dp_is_early_node_valid,
axis2_bool_t dont_care_minoccurs);
/**
* Deserialize an XML to adb objects
* @param _Exception adb_Exception_t object
* @param env pointer to environment struct
* @param dp_parent double pointer to the parent node to deserialize
* @param dp_is_early_node_valid double pointer to a flag (is_early_node_valid?)
* @param dont_care_minoccurs Dont set errors on validating minoccurs,
* (Parent will order this in a case of choice)
* @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
*/
axis2_status_t AXIS2_CALL
adb_Exception_deserialize_obj(
adb_Exception_t* _Exception,
const axutil_env_t *env,
axiom_node_t** dp_parent,
axis2_bool_t *dp_is_early_node_valid,
axis2_bool_t dont_care_minoccurs);
/**
* Declare namespace in the most parent node
* @param _Exception adb_Exception_t object
* @param env pointer to environment struct
* @param parent_element parent element
* @param namespaces hash of namespace uri to prefix
* @param next_ns_index pointer to an int which contain the next namespace index
*/
void AXIS2_CALL
adb_Exception_declare_parent_namespaces(
adb_Exception_t* _Exception,
const axutil_env_t *env, axiom_element_t *parent_element,
axutil_hash_t *namespaces, int *next_ns_index);
/**
* Wrapper for the serialization function, will invoke the extension mapper instead
* @param _Exception adb_Exception_t object
* @param env pointer to environment struct
* @param Exception_om_node node to serialize from
* @param Exception_om_element parent element to serialize from
* @param tag_closed whether the parent tag is closed or not
* @param namespaces hash of namespace uri to prefix
* @param next_ns_index an int which contain the next namespace index
* @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
*/
axiom_node_t* AXIS2_CALL
adb_Exception_serialize(
adb_Exception_t* _Exception,
const axutil_env_t *env,
axiom_node_t* Exception_om_node, axiom_element_t *Exception_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index);
/**
* Serialize to an XML from the adb objects
* @param _Exception adb_Exception_t object
* @param env pointer to environment struct
* @param Exception_om_node node to serialize from
* @param Exception_om_element parent element to serialize from
* @param tag_closed whether the parent tag is closed or not
* @param namespaces hash of namespace uri to prefix
* @param next_ns_index an int which contain the next namespace index
* @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
*/
axiom_node_t* AXIS2_CALL
adb_Exception_serialize_obj(
adb_Exception_t* _Exception,
const axutil_env_t *env,
axiom_node_t* Exception_om_node, axiom_element_t *Exception_om_element, int tag_closed, axutil_hash_t *namespaces, int *next_ns_index);
/**
* Check whether the adb_Exception is a particle class (E.g. group, inner sequence)
* @return whether this is a particle class.
*/
axis2_bool_t AXIS2_CALL
adb_Exception_is_particle();
/******************************* Alternatives for Create and Free functions *********************************/
/**
* Constructor for creating adb_Exception_t
* @param env pointer to environment struct
* @param _Exception axiom_node_t*
* @return newly created adb_Exception_t object
*/
adb_Exception_t* AXIS2_CALL
adb_Exception_create_with_values(
const axutil_env_t *env,
axiom_node_t* _Exception);
/**
* Free adb_Exception_t object and return the property value.
* You can use this to free the adb object as returning the property value. If there are
* many properties, it will only return the first property. Other properties will get freed with the adb object.
* @param _Exception adb_Exception_t object to free
* @param env pointer to environment struct
* @return the property value holded by the ADB object, if there are many properties only returns the first.
*/
axiom_node_t* AXIS2_CALL
adb_Exception_free_popping_value(
adb_Exception_t* _Exception,
const axutil_env_t *env);
/******************************* get the value by the property number *********************************/
/************NOTE: This method is introduced to resolve a problem in unwrapping mode *******************/
/**
* Getter for Exception by property number (1)
* @param _Exception adb_Exception_t object
* @param env pointer to environment struct
* @return axiom_node_t*
*/
axiom_node_t* AXIS2_CALL
adb_Exception_get_property1(
adb_Exception_t* _Exception,
const axutil_env_t *env);
#ifdef __cplusplus
}
#endif
#endif /* ADB_EXCEPTION_H */
| {
"pile_set_name": "Github"
} |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Runtime.InteropServices;
internal static partial class Interop
{
internal static partial class UiaCore
{
[ComImport]
[Guid("b9734fa6-771f-4d78-9c90-2517999349cd")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ITableItemProvider
{
[return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)]
object[]? /*IRawElementProviderSimple[]*/ GetRowHeaderItems();
[return: MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UNKNOWN)]
object[]? /*IRawElementProviderSimple[]*/ GetColumnHeaderItems();
}
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 1999-2000 Harri Porten (porten@kde.org)
* Copyright (C) 2008 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef ObjectPrototype_h
#define ObjectPrototype_h
#include "JSObject.h"
namespace JSC {
class ObjectPrototype : public JSObject {
public:
ObjectPrototype(ExecState*, NonNullPassRefPtr<Structure>, Structure* prototypeFunctionStructure);
private:
virtual void put(ExecState*, const Identifier&, JSValue, PutPropertySlot&);
virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
bool m_hasNoPropertiesWithUInt32Names;
};
JSValue JSC_HOST_CALL objectProtoFuncToString(ExecState*, JSObject*, JSValue, const ArgList&);
} // namespace JSC
#endif // ObjectPrototype_h
| {
"pile_set_name": "Github"
} |
<?php
namespace Security\HTMLPurifier\HTMLPurifier\Token;
/**
* Concrete text token class.
*
* Text tokens comprise of regular parsed character data (PCDATA) and raw
* character data (from the CDATA sections). Internally, their
* data is parsed with all entities expanded. Surprisingly, the text token
* does have a "tag name" called #PCDATA, which is how the DTD represents it
* in permissible child nodes.
*/
use Security\HTMLPurifier\HTMLPurifier\HTMLPurifier_Token;
use Security\HTMLPurifier\HTMLPurifier\Node\HTMLPurifier_Node_Text;
class HTMLPurifier_Token_Text extends HTMLPurifier_Token
{
/**
* @type string
*/
public $name = '#PCDATA';
/**< PCDATA tag name compatible with DTD. */
/**
* @type string
*/
public $data;
/**< Parsed character data of text. */
/**
* @type bool
*/
public $is_whitespace;
/**< Bool indicating if node is whitespace. */
/**
* Constructor, accepts data and determines if it is whitespace.
* @param string $data String parsed character data.
* @param int $line
* @param int $col
*/
public function __construct($data, $line = null, $col = null)
{
$this->data = $data;
$this->is_whitespace = ctype_space($data);
$this->line = $line;
$this->col = $col;
}
public function toNode()
{
return new HTMLPurifier_Node_Text($this->data, $this->is_whitespace, $this->line, $this->col);
}
}
| {
"pile_set_name": "Github"
} |
# ipam is the IPAM mode to use.
#
# Possible values:
# - cluster-pool
# - kubernetes
# - eni
# - azure
# - crd
#ipam: "cluster-pool"
# identityChangeGracePeriod is the grace period that needs to pass
# before an endpoint that has changed its identity will start using
# that new identity. During the grace period, the new identity has
# already been allocated and other nodes in the cluster have a chance
# to whitelist the new upcoming identity of the endpoint.
#identityChangeGracePeriod: "5s"
#enableCnpStatusUpdates: false
# bpfMapDynamicSizeRatio is the ratio (0.0-1.0) of total system memory to use
# for dynamic sizing of CT, NAT, neighbor and SockRevNAT BPF maps. If set to
# 0.0, dynamic sizing of BPF maps is disabled. The default value of 0.0025
# (0.25%) leads to approximately the default CT size kube-proxy sets on a
# node with 16 GiB of total system memory.
#bpfMapDynamicSizeRatio: 0.0025
# bpfMasquerade enables masquerading with BPF instead of iptables
#bpfMasquerade: true
# bpfClockProbe enables the probing and potential of a more efficient clock
# source for the BPF datapath
#bpfClockProbe: true
# bpfTProxy enables the use of transparent proxying via mechanisms available
# in Linux 5.7 or later.
#bpfTProxy: false
# sessionAffinity enable support for service sessionAffinity
#sessionAffinity: true
#healthChecking: true
#synchronizeK8sNodes: true
# enables non-drop mode for installed policies. In audit mode
# packets affected by policies will not be dropped. Policy related
# decisions can be checked via the policy verdict messages.
#policyAuditMode: false
# enables passing identity on local routes by using the mark fields. However,
# in cases where this conflicts with a chained CNI plugin it may be disabled.
#enableIdentityMark: true
# Operator will exit if CRDs are not available within this duration upon
# startup.
#crdWaitTimeout: 5m
# A list of labels to include or exclude from Cilium identity evaluation.
#labels: "k8s:io.kubernetes.pod.namespace k8s:k8s-app k8s:app k8s:name"
#disableEnvoyVersionCheck: false
# Set the connection-tracking garbage collection interval. If not set, the value will be
# calculated automatically on startup of cilium-agent. A low value will consume more CPU cycles.
#conntrackGCInterval: "0s"
| {
"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
//
// 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 mmf
import (
"fmt"
"log"
"time"
"open-match.dev/open-match/pkg/matchfunction"
"open-match.dev/open-match/pkg/pb"
)
// This match function fetches all the Tickets for all the pools specified in
// the profile. It uses a configured number of tickets from each pool to generate
// a Match Proposal. It continues to generate proposals till one of the pools
// runs out of Tickets.
const (
matchName = "basic-matchfunction"
ticketsPerPoolPerMatch = 4
)
// Run is this match function's implementation of the gRPC call defined in api/matchfunction.proto.
func (s *MatchFunctionService) Run(req *pb.RunRequest, stream pb.MatchFunction_RunServer) error {
// Fetch tickets for the pools specified in the Match Profile.
log.Printf("Generating proposals for function %v", req.GetProfile().GetName())
poolTickets, err := matchfunction.QueryPools(stream.Context(), s.queryServiceClient, req.GetProfile().GetPools())
if err != nil {
log.Printf("Failed to query tickets for the given pools, got %s", err.Error())
return err
}
// Generate proposals.
proposals, err := makeMatches(req.GetProfile(), poolTickets)
if err != nil {
log.Printf("Failed to generate matches, got %s", err.Error())
return err
}
log.Printf("Streaming %v proposals to Open Match", len(proposals))
// Stream the generated proposals back to Open Match.
for _, proposal := range proposals {
if err := stream.Send(&pb.RunResponse{Proposal: proposal}); err != nil {
log.Printf("Failed to stream proposals to Open Match, got %s", err.Error())
return err
}
}
return nil
}
func makeMatches(p *pb.MatchProfile, poolTickets map[string][]*pb.Ticket) ([]*pb.Match, error) {
var matches []*pb.Match
count := 0
for {
insufficientTickets := false
matchTickets := []*pb.Ticket{}
for pool, tickets := range poolTickets {
if len(tickets) < ticketsPerPoolPerMatch {
// This pool is completely drained out. Stop creating matches.
insufficientTickets = true
break
}
// Remove the Tickets from this pool and add to the match proposal.
matchTickets = append(matchTickets, tickets[0:ticketsPerPoolPerMatch]...)
poolTickets[pool] = tickets[ticketsPerPoolPerMatch:]
}
if insufficientTickets {
break
}
matches = append(matches, &pb.Match{
MatchId: fmt.Sprintf("profile-%v-time-%v-%v", p.GetName(), time.Now().Format("2006-01-02T15:04:05.00"), count),
MatchProfile: p.GetName(),
MatchFunction: matchName,
Tickets: matchTickets,
})
count++
}
return matches, nil
}
| {
"pile_set_name": "Github"
} |
--- Class CBoneEntityManipulator
-- @classmod Sim.CBoneEntityManipulator
---
-- derived from IAniManipulator
function CBoneEntityManipulator:base()
end
---
--
function CBoneEntityManipulator:moho.BoneEntityManipulator()
end
| {
"pile_set_name": "Github"
} |
/*
Copyright 2015 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package spdy
import (
"bufio"
"bytes"
"crypto/tls"
"encoding/base64"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/http/httputil"
"net/url"
"strings"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/util/httpstream"
utilnet "k8s.io/apimachinery/pkg/util/net"
"k8s.io/apimachinery/third_party/forked/golang/netutil"
)
// SpdyRoundTripper knows how to upgrade an HTTP request to one that supports
// multiplexed streams. After RoundTrip() is invoked, Conn will be set
// and usable. SpdyRoundTripper implements the UpgradeRoundTripper interface.
type SpdyRoundTripper struct {
//tlsConfig holds the TLS configuration settings to use when connecting
//to the remote server.
tlsConfig *tls.Config
/* TODO according to http://golang.org/pkg/net/http/#RoundTripper, a RoundTripper
must be safe for use by multiple concurrent goroutines. If this is absolutely
necessary, we could keep a map from http.Request to net.Conn. In practice,
a client will create an http.Client, set the transport to a new insteace of
SpdyRoundTripper, and use it a single time, so this hopefully won't be an issue.
*/
// conn is the underlying network connection to the remote server.
conn net.Conn
// Dialer is the dialer used to connect. Used if non-nil.
Dialer *net.Dialer
// proxier knows which proxy to use given a request, defaults to http.ProxyFromEnvironment
// Used primarily for mocking the proxy discovery in tests.
proxier func(req *http.Request) (*url.URL, error)
// followRedirects indicates if the round tripper should examine responses for redirects and
// follow them.
followRedirects bool
}
var _ utilnet.TLSClientConfigHolder = &SpdyRoundTripper{}
var _ httpstream.UpgradeRoundTripper = &SpdyRoundTripper{}
var _ utilnet.Dialer = &SpdyRoundTripper{}
// NewRoundTripper creates a new SpdyRoundTripper that will use
// the specified tlsConfig.
func NewRoundTripper(tlsConfig *tls.Config, followRedirects bool) httpstream.UpgradeRoundTripper {
return NewSpdyRoundTripper(tlsConfig, followRedirects)
}
// NewSpdyRoundTripper creates a new SpdyRoundTripper that will use
// the specified tlsConfig. This function is mostly meant for unit tests.
func NewSpdyRoundTripper(tlsConfig *tls.Config, followRedirects bool) *SpdyRoundTripper {
return &SpdyRoundTripper{tlsConfig: tlsConfig, followRedirects: followRedirects}
}
// TLSClientConfig implements pkg/util/net.TLSClientConfigHolder for proper TLS checking during
// proxying with a spdy roundtripper.
func (s *SpdyRoundTripper) TLSClientConfig() *tls.Config {
return s.tlsConfig
}
// Dial implements k8s.io/apimachinery/pkg/util/net.Dialer.
func (s *SpdyRoundTripper) Dial(req *http.Request) (net.Conn, error) {
conn, err := s.dial(req)
if err != nil {
return nil, err
}
if err := req.Write(conn); err != nil {
conn.Close()
return nil, err
}
return conn, nil
}
// dial dials the host specified by req, using TLS if appropriate, optionally
// using a proxy server if one is configured via environment variables.
func (s *SpdyRoundTripper) dial(req *http.Request) (net.Conn, error) {
proxier := s.proxier
if proxier == nil {
proxier = utilnet.NewProxierWithNoProxyCIDR(http.ProxyFromEnvironment)
}
proxyURL, err := proxier(req)
if err != nil {
return nil, err
}
if proxyURL == nil {
return s.dialWithoutProxy(req.URL)
}
// ensure we use a canonical host with proxyReq
targetHost := netutil.CanonicalAddr(req.URL)
// proxying logic adapted from http://blog.h6t.eu/post/74098062923/golang-websocket-with-http-proxy-support
proxyReq := http.Request{
Method: "CONNECT",
URL: &url.URL{},
Host: targetHost,
}
if pa := s.proxyAuth(proxyURL); pa != "" {
proxyReq.Header = http.Header{}
proxyReq.Header.Set("Proxy-Authorization", pa)
}
proxyDialConn, err := s.dialWithoutProxy(proxyURL)
if err != nil {
return nil, err
}
proxyClientConn := httputil.NewProxyClientConn(proxyDialConn, nil)
_, err = proxyClientConn.Do(&proxyReq)
if err != nil && err != httputil.ErrPersistEOF {
return nil, err
}
rwc, _ := proxyClientConn.Hijack()
if req.URL.Scheme != "https" {
return rwc, nil
}
host, _, err := net.SplitHostPort(targetHost)
if err != nil {
return nil, err
}
tlsConfig := s.tlsConfig
switch {
case tlsConfig == nil:
tlsConfig = &tls.Config{ServerName: host}
case len(tlsConfig.ServerName) == 0:
tlsConfig = tlsConfig.Clone()
tlsConfig.ServerName = host
}
tlsConn := tls.Client(rwc, tlsConfig)
// need to manually call Handshake() so we can call VerifyHostname() below
if err := tlsConn.Handshake(); err != nil {
return nil, err
}
// Return if we were configured to skip validation
if tlsConfig.InsecureSkipVerify {
return tlsConn, nil
}
if err := tlsConn.VerifyHostname(tlsConfig.ServerName); err != nil {
return nil, err
}
return tlsConn, nil
}
// dialWithoutProxy dials the host specified by url, using TLS if appropriate.
func (s *SpdyRoundTripper) dialWithoutProxy(url *url.URL) (net.Conn, error) {
dialAddr := netutil.CanonicalAddr(url)
if url.Scheme == "http" {
if s.Dialer == nil {
return net.Dial("tcp", dialAddr)
} else {
return s.Dialer.Dial("tcp", dialAddr)
}
}
// TODO validate the TLSClientConfig is set up?
var conn *tls.Conn
var err error
if s.Dialer == nil {
conn, err = tls.Dial("tcp", dialAddr, s.tlsConfig)
} else {
conn, err = tls.DialWithDialer(s.Dialer, "tcp", dialAddr, s.tlsConfig)
}
if err != nil {
return nil, err
}
// Return if we were configured to skip validation
if s.tlsConfig != nil && s.tlsConfig.InsecureSkipVerify {
return conn, nil
}
host, _, err := net.SplitHostPort(dialAddr)
if err != nil {
return nil, err
}
if s.tlsConfig != nil && len(s.tlsConfig.ServerName) > 0 {
host = s.tlsConfig.ServerName
}
err = conn.VerifyHostname(host)
if err != nil {
return nil, err
}
return conn, nil
}
// proxyAuth returns, for a given proxy URL, the value to be used for the Proxy-Authorization header
func (s *SpdyRoundTripper) proxyAuth(proxyURL *url.URL) string {
if proxyURL == nil || proxyURL.User == nil {
return ""
}
credentials := proxyURL.User.String()
encodedAuth := base64.StdEncoding.EncodeToString([]byte(credentials))
return fmt.Sprintf("Basic %s", encodedAuth)
}
// RoundTrip executes the Request and upgrades it. After a successful upgrade,
// clients may call SpdyRoundTripper.Connection() to retrieve the upgraded
// connection.
func (s *SpdyRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
header := utilnet.CloneHeader(req.Header)
header.Add(httpstream.HeaderConnection, httpstream.HeaderUpgrade)
header.Add(httpstream.HeaderUpgrade, HeaderSpdy31)
var (
conn net.Conn
rawResponse []byte
err error
)
if s.followRedirects {
conn, rawResponse, err = utilnet.ConnectWithRedirects(req.Method, req.URL, header, req.Body, s)
} else {
clone := utilnet.CloneRequest(req)
clone.Header = header
conn, err = s.Dial(clone)
}
if err != nil {
return nil, err
}
responseReader := bufio.NewReader(
io.MultiReader(
bytes.NewBuffer(rawResponse),
conn,
),
)
resp, err := http.ReadResponse(responseReader, nil)
if err != nil {
if conn != nil {
conn.Close()
}
return nil, err
}
s.conn = conn
return resp, nil
}
// NewConnection validates the upgrade response, creating and returning a new
// httpstream.Connection if there were no errors.
func (s *SpdyRoundTripper) NewConnection(resp *http.Response) (httpstream.Connection, error) {
connectionHeader := strings.ToLower(resp.Header.Get(httpstream.HeaderConnection))
upgradeHeader := strings.ToLower(resp.Header.Get(httpstream.HeaderUpgrade))
if (resp.StatusCode != http.StatusSwitchingProtocols) || !strings.Contains(connectionHeader, strings.ToLower(httpstream.HeaderUpgrade)) || !strings.Contains(upgradeHeader, strings.ToLower(HeaderSpdy31)) {
defer resp.Body.Close()
responseError := ""
responseErrorBytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
responseError = "unable to read error from server response"
} else {
// TODO: I don't belong here, I should be abstracted from this class
if obj, _, err := statusCodecs.UniversalDecoder().Decode(responseErrorBytes, nil, &metav1.Status{}); err == nil {
if status, ok := obj.(*metav1.Status); ok {
return nil, &apierrors.StatusError{ErrStatus: *status}
}
}
responseError = string(responseErrorBytes)
responseError = strings.TrimSpace(responseError)
}
return nil, fmt.Errorf("unable to upgrade connection: %s", responseError)
}
return NewClientConnection(s.conn)
}
// statusScheme is private scheme for the decoding here until someone fixes the TODO in NewConnection
var statusScheme = runtime.NewScheme()
// ParameterCodec knows about query parameters used with the meta v1 API spec.
var statusCodecs = serializer.NewCodecFactory(statusScheme)
func init() {
statusScheme.AddUnversionedTypes(metav1.SchemeGroupVersion,
&metav1.Status{},
)
}
| {
"pile_set_name": "Github"
} |
package com.horstmann.violet.framework.graphics.shape;
import com.horstmann.violet.framework.graphics.content.Content;
import java.awt.*;
import java.awt.geom.GeneralPath;
/**
* TODO javadoc
* This ...
*
* @author Adrian Bobrowski <adrian071993@gmail.com>
* @date 27.02.2016
*/
public class ContentInsideDiamond extends ContentInsideCustomShape
{
public ContentInsideDiamond(Content content)
{
this(content, 45);
}
/**
* @param content
* @param degrees left and right degrees
*/
public ContentInsideDiamond(Content content, double degrees)
{
super(content, new DiamondShape(degrees));
}
private static final class DiamondShape implements ContentInsideCustomShape.ShapeCreator
{
public DiamondShape(double degrees)
{
if(0 == (degrees)%90 && 0 != (degrees)%180)
{
throw new ArithmeticException("tangent is infinity");
}
tangent = Math.tan(Math.toRadians(degrees));
}
/**
* @param contentWidth width of diamond
* @param contentHeight height of diamond
* @return shape described in the diamond
*/
@Override
public Shape createShape(double contentWidth, double contentHeight)
{
double width = contentWidth + contentHeight * tangent;
double height = contentHeight + contentWidth / tangent;
GeneralPath diamond = new GeneralPath();
diamond.moveTo(0, height/2);
diamond.lineTo(width/2, 0);
diamond.lineTo(width, height/2);
diamond.lineTo(width/2, height);
diamond.lineTo(0, height/2);
return diamond;
}
private double tangent;
}
}
| {
"pile_set_name": "Github"
} |
To delete epic attachments send a DELETE specifying the epic attachment id in the url
include::../generated/epics-attachments-delete-cmd.adoc[]
When delete succeeded, the HTTP response is a 204 NO CONTENT with an empty body response
| {
"pile_set_name": "Github"
} |
# Security configuration in light framework.
---
# Enable JWT verification flag.
enableVerifyJwt: false
# Enable JWT scope verification. Only valid when enableVerifyJwt is true.
enableVerifyScope: true
# User for test only. should be always be false on official environment.
enableMockJwt: false
# JWT signature public certificates. kid and certificate path mappings.
jwt:
certificate:
'100': primary.crt
'101': secondary.crt
clockSkewInSeconds: 60
# Enable or disable JWT token logging
logJwtToken: true
# Enable or disable client_id, user_id and scope logging.
logClientUserScope: false
# If OAuth2 provider support http2 protocol. If using light-oauth2, set this to true.
oauthHttp2Support: true
# Enable JWT token cache to speed up verification. This will only verify expired time
# and skip the signature verification as it takes more CPU power and long time.
enableJwtCache: true
| {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class oracle.kubernetes.operator.rest.resource.ClusterResource (operator-runtime 2.1 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class oracle.kubernetes.operator.rest.resource.ClusterResource (operator-runtime 2.1 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../oracle/kubernetes/operator/rest/resource/ClusterResource.html" title="class in oracle.kubernetes.operator.rest.resource">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?oracle/kubernetes/operator/rest/resource/class-use/ClusterResource.html" target="_top">Frames</a></li>
<li><a href="ClusterResource.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class oracle.kubernetes.operator.rest.resource.ClusterResource" class="title">Uses of Class<br>oracle.kubernetes.operator.rest.resource.ClusterResource</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../oracle/kubernetes/operator/rest/resource/ClusterResource.html" title="class in oracle.kubernetes.operator.rest.resource">ClusterResource</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#oracle.kubernetes.operator.rest.resource">oracle.kubernetes.operator.rest.resource</a></td>
<td class="colLast">
<div class="block">REST resources.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="oracle.kubernetes.operator.rest.resource">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../oracle/kubernetes/operator/rest/resource/ClusterResource.html" title="class in oracle.kubernetes.operator.rest.resource">ClusterResource</a> in <a href="../../../../../../oracle/kubernetes/operator/rest/resource/package-summary.html">oracle.kubernetes.operator.rest.resource</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../oracle/kubernetes/operator/rest/resource/package-summary.html">oracle.kubernetes.operator.rest.resource</a> that return <a href="../../../../../../oracle/kubernetes/operator/rest/resource/ClusterResource.html" title="class in oracle.kubernetes.operator.rest.resource">ClusterResource</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../oracle/kubernetes/operator/rest/resource/ClusterResource.html" title="class in oracle.kubernetes.operator.rest.resource">ClusterResource</a></code></td>
<td class="colLast"><span class="typeNameLabel">ClustersResource.</span><code><span class="memberNameLink"><a href="../../../../../../oracle/kubernetes/operator/rest/resource/ClustersResource.html#getClusterResource-java.lang.String-">getClusterResource</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> cluster)</code>
<div class="block">Construct and return a 'cluster' jaxrs child resource.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../oracle/kubernetes/operator/rest/resource/ClusterResource.html" title="class in oracle.kubernetes.operator.rest.resource">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?oracle/kubernetes/operator/rest/resource/class-use/ClusterResource.html" target="_top">Frames</a></li>
<li><a href="ClusterResource.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small><p>Copyright 2018, 2019, <a href="http://www.oracle.com">Oracle Corporation</a> and/or its affiliates. All rights reserved. <br />Licensed under the Universal Permissive License v 1.0 as shown at <a href="http://oss.oracle.com/licenses/upl">http://oss.oracle.com/licenses/upl</a>.<p></small></p>
</body>
</html>
| {
"pile_set_name": "Github"
} |
/*
* Cryptographic API.
*
* Tiger hashing Algorithm
*
* Copyright (C) 1998 Free Software Foundation, Inc.
*
* The Tiger algorithm was developed by Ross Anderson and Eli Biham.
* It was optimized for 64-bit processors while still delievering
* decent performance on 32 and 16-bit processors.
*
* This version is derived from the GnuPG implementation and the
* Tiger-Perl interface written by Rafael Sevilla
*
* Adapted for Linux Kernel Crypto by Aaron Grothe
* ajgrothe@yahoo.com, February 22, 2005
*
* 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.
*
*/
#include <crypto/internal/hash.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <asm/byteorder.h>
#include <linux/types.h>
#define TGR192_DIGEST_SIZE 24
#define TGR160_DIGEST_SIZE 20
#define TGR128_DIGEST_SIZE 16
#define TGR192_BLOCK_SIZE 64
struct tgr192_ctx {
u64 a, b, c;
u8 hash[64];
int count;
u32 nblocks;
};
static const u64 sbox1[256] = {
0x02aab17cf7e90c5eULL, 0xac424b03e243a8ecULL, 0x72cd5be30dd5fcd3ULL,
0x6d019b93f6f97f3aULL, 0xcd9978ffd21f9193ULL, 0x7573a1c9708029e2ULL,
0xb164326b922a83c3ULL, 0x46883eee04915870ULL, 0xeaace3057103ece6ULL,
0xc54169b808a3535cULL, 0x4ce754918ddec47cULL, 0x0aa2f4dfdc0df40cULL,
0x10b76f18a74dbefaULL, 0xc6ccb6235ad1ab6aULL, 0x13726121572fe2ffULL,
0x1a488c6f199d921eULL, 0x4bc9f9f4da0007caULL, 0x26f5e6f6e85241c7ULL,
0x859079dbea5947b6ULL, 0x4f1885c5c99e8c92ULL, 0xd78e761ea96f864bULL,
0x8e36428c52b5c17dULL, 0x69cf6827373063c1ULL, 0xb607c93d9bb4c56eULL,
0x7d820e760e76b5eaULL, 0x645c9cc6f07fdc42ULL, 0xbf38a078243342e0ULL,
0x5f6b343c9d2e7d04ULL, 0xf2c28aeb600b0ec6ULL, 0x6c0ed85f7254bcacULL,
0x71592281a4db4fe5ULL, 0x1967fa69ce0fed9fULL, 0xfd5293f8b96545dbULL,
0xc879e9d7f2a7600bULL, 0x860248920193194eULL, 0xa4f9533b2d9cc0b3ULL,
0x9053836c15957613ULL, 0xdb6dcf8afc357bf1ULL, 0x18beea7a7a370f57ULL,
0x037117ca50b99066ULL, 0x6ab30a9774424a35ULL, 0xf4e92f02e325249bULL,
0x7739db07061ccae1ULL, 0xd8f3b49ceca42a05ULL, 0xbd56be3f51382f73ULL,
0x45faed5843b0bb28ULL, 0x1c813d5c11bf1f83ULL, 0x8af0e4b6d75fa169ULL,
0x33ee18a487ad9999ULL, 0x3c26e8eab1c94410ULL, 0xb510102bc0a822f9ULL,
0x141eef310ce6123bULL, 0xfc65b90059ddb154ULL, 0xe0158640c5e0e607ULL,
0x884e079826c3a3cfULL, 0x930d0d9523c535fdULL, 0x35638d754e9a2b00ULL,
0x4085fccf40469dd5ULL, 0xc4b17ad28be23a4cULL, 0xcab2f0fc6a3e6a2eULL,
0x2860971a6b943fcdULL, 0x3dde6ee212e30446ULL, 0x6222f32ae01765aeULL,
0x5d550bb5478308feULL, 0xa9efa98da0eda22aULL, 0xc351a71686c40da7ULL,
0x1105586d9c867c84ULL, 0xdcffee85fda22853ULL, 0xccfbd0262c5eef76ULL,
0xbaf294cb8990d201ULL, 0xe69464f52afad975ULL, 0x94b013afdf133e14ULL,
0x06a7d1a32823c958ULL, 0x6f95fe5130f61119ULL, 0xd92ab34e462c06c0ULL,
0xed7bde33887c71d2ULL, 0x79746d6e6518393eULL, 0x5ba419385d713329ULL,
0x7c1ba6b948a97564ULL, 0x31987c197bfdac67ULL, 0xde6c23c44b053d02ULL,
0x581c49fed002d64dULL, 0xdd474d6338261571ULL, 0xaa4546c3e473d062ULL,
0x928fce349455f860ULL, 0x48161bbacaab94d9ULL, 0x63912430770e6f68ULL,
0x6ec8a5e602c6641cULL, 0x87282515337ddd2bULL, 0x2cda6b42034b701bULL,
0xb03d37c181cb096dULL, 0xe108438266c71c6fULL, 0x2b3180c7eb51b255ULL,
0xdf92b82f96c08bbcULL, 0x5c68c8c0a632f3baULL, 0x5504cc861c3d0556ULL,
0xabbfa4e55fb26b8fULL, 0x41848b0ab3baceb4ULL, 0xb334a273aa445d32ULL,
0xbca696f0a85ad881ULL, 0x24f6ec65b528d56cULL, 0x0ce1512e90f4524aULL,
0x4e9dd79d5506d35aULL, 0x258905fac6ce9779ULL, 0x2019295b3e109b33ULL,
0xf8a9478b73a054ccULL, 0x2924f2f934417eb0ULL, 0x3993357d536d1bc4ULL,
0x38a81ac21db6ff8bULL, 0x47c4fbf17d6016bfULL, 0x1e0faadd7667e3f5ULL,
0x7abcff62938beb96ULL, 0xa78dad948fc179c9ULL, 0x8f1f98b72911e50dULL,
0x61e48eae27121a91ULL, 0x4d62f7ad31859808ULL, 0xeceba345ef5ceaebULL,
0xf5ceb25ebc9684ceULL, 0xf633e20cb7f76221ULL, 0xa32cdf06ab8293e4ULL,
0x985a202ca5ee2ca4ULL, 0xcf0b8447cc8a8fb1ULL, 0x9f765244979859a3ULL,
0xa8d516b1a1240017ULL, 0x0bd7ba3ebb5dc726ULL, 0xe54bca55b86adb39ULL,
0x1d7a3afd6c478063ULL, 0x519ec608e7669eddULL, 0x0e5715a2d149aa23ULL,
0x177d4571848ff194ULL, 0xeeb55f3241014c22ULL, 0x0f5e5ca13a6e2ec2ULL,
0x8029927b75f5c361ULL, 0xad139fabc3d6e436ULL, 0x0d5df1a94ccf402fULL,
0x3e8bd948bea5dfc8ULL, 0xa5a0d357bd3ff77eULL, 0xa2d12e251f74f645ULL,
0x66fd9e525e81a082ULL, 0x2e0c90ce7f687a49ULL, 0xc2e8bcbeba973bc5ULL,
0x000001bce509745fULL, 0x423777bbe6dab3d6ULL, 0xd1661c7eaef06eb5ULL,
0xa1781f354daacfd8ULL, 0x2d11284a2b16affcULL, 0xf1fc4f67fa891d1fULL,
0x73ecc25dcb920adaULL, 0xae610c22c2a12651ULL, 0x96e0a810d356b78aULL,
0x5a9a381f2fe7870fULL, 0xd5ad62ede94e5530ULL, 0xd225e5e8368d1427ULL,
0x65977b70c7af4631ULL, 0x99f889b2de39d74fULL, 0x233f30bf54e1d143ULL,
0x9a9675d3d9a63c97ULL, 0x5470554ff334f9a8ULL, 0x166acb744a4f5688ULL,
0x70c74caab2e4aeadULL, 0xf0d091646f294d12ULL, 0x57b82a89684031d1ULL,
0xefd95a5a61be0b6bULL, 0x2fbd12e969f2f29aULL, 0x9bd37013feff9fe8ULL,
0x3f9b0404d6085a06ULL, 0x4940c1f3166cfe15ULL, 0x09542c4dcdf3defbULL,
0xb4c5218385cd5ce3ULL, 0xc935b7dc4462a641ULL, 0x3417f8a68ed3b63fULL,
0xb80959295b215b40ULL, 0xf99cdaef3b8c8572ULL, 0x018c0614f8fcb95dULL,
0x1b14accd1a3acdf3ULL, 0x84d471f200bb732dULL, 0xc1a3110e95e8da16ULL,
0x430a7220bf1a82b8ULL, 0xb77e090d39df210eULL, 0x5ef4bd9f3cd05e9dULL,
0x9d4ff6da7e57a444ULL, 0xda1d60e183d4a5f8ULL, 0xb287c38417998e47ULL,
0xfe3edc121bb31886ULL, 0xc7fe3ccc980ccbefULL, 0xe46fb590189bfd03ULL,
0x3732fd469a4c57dcULL, 0x7ef700a07cf1ad65ULL, 0x59c64468a31d8859ULL,
0x762fb0b4d45b61f6ULL, 0x155baed099047718ULL, 0x68755e4c3d50baa6ULL,
0xe9214e7f22d8b4dfULL, 0x2addbf532eac95f4ULL, 0x32ae3909b4bd0109ULL,
0x834df537b08e3450ULL, 0xfa209da84220728dULL, 0x9e691d9b9efe23f7ULL,
0x0446d288c4ae8d7fULL, 0x7b4cc524e169785bULL, 0x21d87f0135ca1385ULL,
0xcebb400f137b8aa5ULL, 0x272e2b66580796beULL, 0x3612264125c2b0deULL,
0x057702bdad1efbb2ULL, 0xd4babb8eacf84be9ULL, 0x91583139641bc67bULL,
0x8bdc2de08036e024ULL, 0x603c8156f49f68edULL, 0xf7d236f7dbef5111ULL,
0x9727c4598ad21e80ULL, 0xa08a0896670a5fd7ULL, 0xcb4a8f4309eba9cbULL,
0x81af564b0f7036a1ULL, 0xc0b99aa778199abdULL, 0x959f1ec83fc8e952ULL,
0x8c505077794a81b9ULL, 0x3acaaf8f056338f0ULL, 0x07b43f50627a6778ULL,
0x4a44ab49f5eccc77ULL, 0x3bc3d6e4b679ee98ULL, 0x9cc0d4d1cf14108cULL,
0x4406c00b206bc8a0ULL, 0x82a18854c8d72d89ULL, 0x67e366b35c3c432cULL,
0xb923dd61102b37f2ULL, 0x56ab2779d884271dULL, 0xbe83e1b0ff1525afULL,
0xfb7c65d4217e49a9ULL, 0x6bdbe0e76d48e7d4ULL, 0x08df828745d9179eULL,
0x22ea6a9add53bd34ULL, 0xe36e141c5622200aULL, 0x7f805d1b8cb750eeULL,
0xafe5c7a59f58e837ULL, 0xe27f996a4fb1c23cULL, 0xd3867dfb0775f0d0ULL,
0xd0e673de6e88891aULL, 0x123aeb9eafb86c25ULL, 0x30f1d5d5c145b895ULL,
0xbb434a2dee7269e7ULL, 0x78cb67ecf931fa38ULL, 0xf33b0372323bbf9cULL,
0x52d66336fb279c74ULL, 0x505f33ac0afb4eaaULL, 0xe8a5cd99a2cce187ULL,
0x534974801e2d30bbULL, 0x8d2d5711d5876d90ULL, 0x1f1a412891bc038eULL,
0xd6e2e71d82e56648ULL, 0x74036c3a497732b7ULL, 0x89b67ed96361f5abULL,
0xffed95d8f1ea02a2ULL, 0xe72b3bd61464d43dULL, 0xa6300f170bdc4820ULL,
0xebc18760ed78a77aULL
};
static const u64 sbox2[256] = {
0xe6a6be5a05a12138ULL, 0xb5a122a5b4f87c98ULL, 0x563c6089140b6990ULL,
0x4c46cb2e391f5dd5ULL, 0xd932addbc9b79434ULL, 0x08ea70e42015aff5ULL,
0xd765a6673e478cf1ULL, 0xc4fb757eab278d99ULL, 0xdf11c6862d6e0692ULL,
0xddeb84f10d7f3b16ULL, 0x6f2ef604a665ea04ULL, 0x4a8e0f0ff0e0dfb3ULL,
0xa5edeef83dbcba51ULL, 0xfc4f0a2a0ea4371eULL, 0xe83e1da85cb38429ULL,
0xdc8ff882ba1b1ce2ULL, 0xcd45505e8353e80dULL, 0x18d19a00d4db0717ULL,
0x34a0cfeda5f38101ULL, 0x0be77e518887caf2ULL, 0x1e341438b3c45136ULL,
0xe05797f49089ccf9ULL, 0xffd23f9df2591d14ULL, 0x543dda228595c5cdULL,
0x661f81fd99052a33ULL, 0x8736e641db0f7b76ULL, 0x15227725418e5307ULL,
0xe25f7f46162eb2faULL, 0x48a8b2126c13d9feULL, 0xafdc541792e76eeaULL,
0x03d912bfc6d1898fULL, 0x31b1aafa1b83f51bULL, 0xf1ac2796e42ab7d9ULL,
0x40a3a7d7fcd2ebacULL, 0x1056136d0afbbcc5ULL, 0x7889e1dd9a6d0c85ULL,
0xd33525782a7974aaULL, 0xa7e25d09078ac09bULL, 0xbd4138b3eac6edd0ULL,
0x920abfbe71eb9e70ULL, 0xa2a5d0f54fc2625cULL, 0xc054e36b0b1290a3ULL,
0xf6dd59ff62fe932bULL, 0x3537354511a8ac7dULL, 0xca845e9172fadcd4ULL,
0x84f82b60329d20dcULL, 0x79c62ce1cd672f18ULL, 0x8b09a2add124642cULL,
0xd0c1e96a19d9e726ULL, 0x5a786a9b4ba9500cULL, 0x0e020336634c43f3ULL,
0xc17b474aeb66d822ULL, 0x6a731ae3ec9baac2ULL, 0x8226667ae0840258ULL,
0x67d4567691caeca5ULL, 0x1d94155c4875adb5ULL, 0x6d00fd985b813fdfULL,
0x51286efcb774cd06ULL, 0x5e8834471fa744afULL, 0xf72ca0aee761ae2eULL,
0xbe40e4cdaee8e09aULL, 0xe9970bbb5118f665ULL, 0x726e4beb33df1964ULL,
0x703b000729199762ULL, 0x4631d816f5ef30a7ULL, 0xb880b5b51504a6beULL,
0x641793c37ed84b6cULL, 0x7b21ed77f6e97d96ULL, 0x776306312ef96b73ULL,
0xae528948e86ff3f4ULL, 0x53dbd7f286a3f8f8ULL, 0x16cadce74cfc1063ULL,
0x005c19bdfa52c6ddULL, 0x68868f5d64d46ad3ULL, 0x3a9d512ccf1e186aULL,
0x367e62c2385660aeULL, 0xe359e7ea77dcb1d7ULL, 0x526c0773749abe6eULL,
0x735ae5f9d09f734bULL, 0x493fc7cc8a558ba8ULL, 0xb0b9c1533041ab45ULL,
0x321958ba470a59bdULL, 0x852db00b5f46c393ULL, 0x91209b2bd336b0e5ULL,
0x6e604f7d659ef19fULL, 0xb99a8ae2782ccb24ULL, 0xccf52ab6c814c4c7ULL,
0x4727d9afbe11727bULL, 0x7e950d0c0121b34dULL, 0x756f435670ad471fULL,
0xf5add442615a6849ULL, 0x4e87e09980b9957aULL, 0x2acfa1df50aee355ULL,
0xd898263afd2fd556ULL, 0xc8f4924dd80c8fd6ULL, 0xcf99ca3d754a173aULL,
0xfe477bacaf91bf3cULL, 0xed5371f6d690c12dULL, 0x831a5c285e687094ULL,
0xc5d3c90a3708a0a4ULL, 0x0f7f903717d06580ULL, 0x19f9bb13b8fdf27fULL,
0xb1bd6f1b4d502843ULL, 0x1c761ba38fff4012ULL, 0x0d1530c4e2e21f3bULL,
0x8943ce69a7372c8aULL, 0xe5184e11feb5ce66ULL, 0x618bdb80bd736621ULL,
0x7d29bad68b574d0bULL, 0x81bb613e25e6fe5bULL, 0x071c9c10bc07913fULL,
0xc7beeb7909ac2d97ULL, 0xc3e58d353bc5d757ULL, 0xeb017892f38f61e8ULL,
0xd4effb9c9b1cc21aULL, 0x99727d26f494f7abULL, 0xa3e063a2956b3e03ULL,
0x9d4a8b9a4aa09c30ULL, 0x3f6ab7d500090fb4ULL, 0x9cc0f2a057268ac0ULL,
0x3dee9d2dedbf42d1ULL, 0x330f49c87960a972ULL, 0xc6b2720287421b41ULL,
0x0ac59ec07c00369cULL, 0xef4eac49cb353425ULL, 0xf450244eef0129d8ULL,
0x8acc46e5caf4deb6ULL, 0x2ffeab63989263f7ULL, 0x8f7cb9fe5d7a4578ULL,
0x5bd8f7644e634635ULL, 0x427a7315bf2dc900ULL, 0x17d0c4aa2125261cULL,
0x3992486c93518e50ULL, 0xb4cbfee0a2d7d4c3ULL, 0x7c75d6202c5ddd8dULL,
0xdbc295d8e35b6c61ULL, 0x60b369d302032b19ULL, 0xce42685fdce44132ULL,
0x06f3ddb9ddf65610ULL, 0x8ea4d21db5e148f0ULL, 0x20b0fce62fcd496fULL,
0x2c1b912358b0ee31ULL, 0xb28317b818f5a308ULL, 0xa89c1e189ca6d2cfULL,
0x0c6b18576aaadbc8ULL, 0xb65deaa91299fae3ULL, 0xfb2b794b7f1027e7ULL,
0x04e4317f443b5bebULL, 0x4b852d325939d0a6ULL, 0xd5ae6beefb207ffcULL,
0x309682b281c7d374ULL, 0xbae309a194c3b475ULL, 0x8cc3f97b13b49f05ULL,
0x98a9422ff8293967ULL, 0x244b16b01076ff7cULL, 0xf8bf571c663d67eeULL,
0x1f0d6758eee30da1ULL, 0xc9b611d97adeb9b7ULL, 0xb7afd5887b6c57a2ULL,
0x6290ae846b984fe1ULL, 0x94df4cdeacc1a5fdULL, 0x058a5bd1c5483affULL,
0x63166cc142ba3c37ULL, 0x8db8526eb2f76f40ULL, 0xe10880036f0d6d4eULL,
0x9e0523c9971d311dULL, 0x45ec2824cc7cd691ULL, 0x575b8359e62382c9ULL,
0xfa9e400dc4889995ULL, 0xd1823ecb45721568ULL, 0xdafd983b8206082fULL,
0xaa7d29082386a8cbULL, 0x269fcd4403b87588ULL, 0x1b91f5f728bdd1e0ULL,
0xe4669f39040201f6ULL, 0x7a1d7c218cf04adeULL, 0x65623c29d79ce5ceULL,
0x2368449096c00bb1ULL, 0xab9bf1879da503baULL, 0xbc23ecb1a458058eULL,
0x9a58df01bb401eccULL, 0xa070e868a85f143dULL, 0x4ff188307df2239eULL,
0x14d565b41a641183ULL, 0xee13337452701602ULL, 0x950e3dcf3f285e09ULL,
0x59930254b9c80953ULL, 0x3bf299408930da6dULL, 0xa955943f53691387ULL,
0xa15edecaa9cb8784ULL, 0x29142127352be9a0ULL, 0x76f0371fff4e7afbULL,
0x0239f450274f2228ULL, 0xbb073af01d5e868bULL, 0xbfc80571c10e96c1ULL,
0xd267088568222e23ULL, 0x9671a3d48e80b5b0ULL, 0x55b5d38ae193bb81ULL,
0x693ae2d0a18b04b8ULL, 0x5c48b4ecadd5335fULL, 0xfd743b194916a1caULL,
0x2577018134be98c4ULL, 0xe77987e83c54a4adULL, 0x28e11014da33e1b9ULL,
0x270cc59e226aa213ULL, 0x71495f756d1a5f60ULL, 0x9be853fb60afef77ULL,
0xadc786a7f7443dbfULL, 0x0904456173b29a82ULL, 0x58bc7a66c232bd5eULL,
0xf306558c673ac8b2ULL, 0x41f639c6b6c9772aULL, 0x216defe99fda35daULL,
0x11640cc71c7be615ULL, 0x93c43694565c5527ULL, 0xea038e6246777839ULL,
0xf9abf3ce5a3e2469ULL, 0x741e768d0fd312d2ULL, 0x0144b883ced652c6ULL,
0xc20b5a5ba33f8552ULL, 0x1ae69633c3435a9dULL, 0x97a28ca4088cfdecULL,
0x8824a43c1e96f420ULL, 0x37612fa66eeea746ULL, 0x6b4cb165f9cf0e5aULL,
0x43aa1c06a0abfb4aULL, 0x7f4dc26ff162796bULL, 0x6cbacc8e54ed9b0fULL,
0xa6b7ffefd2bb253eULL, 0x2e25bc95b0a29d4fULL, 0x86d6a58bdef1388cULL,
0xded74ac576b6f054ULL, 0x8030bdbc2b45805dULL, 0x3c81af70e94d9289ULL,
0x3eff6dda9e3100dbULL, 0xb38dc39fdfcc8847ULL, 0x123885528d17b87eULL,
0xf2da0ed240b1b642ULL, 0x44cefadcd54bf9a9ULL, 0x1312200e433c7ee6ULL,
0x9ffcc84f3a78c748ULL, 0xf0cd1f72248576bbULL, 0xec6974053638cfe4ULL,
0x2ba7b67c0cec4e4cULL, 0xac2f4df3e5ce32edULL, 0xcb33d14326ea4c11ULL,
0xa4e9044cc77e58bcULL, 0x5f513293d934fcefULL, 0x5dc9645506e55444ULL,
0x50de418f317de40aULL, 0x388cb31a69dde259ULL, 0x2db4a83455820a86ULL,
0x9010a91e84711ae9ULL, 0x4df7f0b7b1498371ULL, 0xd62a2eabc0977179ULL,
0x22fac097aa8d5c0eULL
};
static const u64 sbox3[256] = {
0xf49fcc2ff1daf39bULL, 0x487fd5c66ff29281ULL, 0xe8a30667fcdca83fULL,
0x2c9b4be3d2fcce63ULL, 0xda3ff74b93fbbbc2ULL, 0x2fa165d2fe70ba66ULL,
0xa103e279970e93d4ULL, 0xbecdec77b0e45e71ULL, 0xcfb41e723985e497ULL,
0xb70aaa025ef75017ULL, 0xd42309f03840b8e0ULL, 0x8efc1ad035898579ULL,
0x96c6920be2b2abc5ULL, 0x66af4163375a9172ULL, 0x2174abdcca7127fbULL,
0xb33ccea64a72ff41ULL, 0xf04a4933083066a5ULL, 0x8d970acdd7289af5ULL,
0x8f96e8e031c8c25eULL, 0xf3fec02276875d47ULL, 0xec7bf310056190ddULL,
0xf5adb0aebb0f1491ULL, 0x9b50f8850fd58892ULL, 0x4975488358b74de8ULL,
0xa3354ff691531c61ULL, 0x0702bbe481d2c6eeULL, 0x89fb24057deded98ULL,
0xac3075138596e902ULL, 0x1d2d3580172772edULL, 0xeb738fc28e6bc30dULL,
0x5854ef8f63044326ULL, 0x9e5c52325add3bbeULL, 0x90aa53cf325c4623ULL,
0xc1d24d51349dd067ULL, 0x2051cfeea69ea624ULL, 0x13220f0a862e7e4fULL,
0xce39399404e04864ULL, 0xd9c42ca47086fcb7ULL, 0x685ad2238a03e7ccULL,
0x066484b2ab2ff1dbULL, 0xfe9d5d70efbf79ecULL, 0x5b13b9dd9c481854ULL,
0x15f0d475ed1509adULL, 0x0bebcd060ec79851ULL, 0xd58c6791183ab7f8ULL,
0xd1187c5052f3eee4ULL, 0xc95d1192e54e82ffULL, 0x86eea14cb9ac6ca2ULL,
0x3485beb153677d5dULL, 0xdd191d781f8c492aULL, 0xf60866baa784ebf9ULL,
0x518f643ba2d08c74ULL, 0x8852e956e1087c22ULL, 0xa768cb8dc410ae8dULL,
0x38047726bfec8e1aULL, 0xa67738b4cd3b45aaULL, 0xad16691cec0dde19ULL,
0xc6d4319380462e07ULL, 0xc5a5876d0ba61938ULL, 0x16b9fa1fa58fd840ULL,
0x188ab1173ca74f18ULL, 0xabda2f98c99c021fULL, 0x3e0580ab134ae816ULL,
0x5f3b05b773645abbULL, 0x2501a2be5575f2f6ULL, 0x1b2f74004e7e8ba9ULL,
0x1cd7580371e8d953ULL, 0x7f6ed89562764e30ULL, 0xb15926ff596f003dULL,
0x9f65293da8c5d6b9ULL, 0x6ecef04dd690f84cULL, 0x4782275fff33af88ULL,
0xe41433083f820801ULL, 0xfd0dfe409a1af9b5ULL, 0x4325a3342cdb396bULL,
0x8ae77e62b301b252ULL, 0xc36f9e9f6655615aULL, 0x85455a2d92d32c09ULL,
0xf2c7dea949477485ULL, 0x63cfb4c133a39ebaULL, 0x83b040cc6ebc5462ULL,
0x3b9454c8fdb326b0ULL, 0x56f56a9e87ffd78cULL, 0x2dc2940d99f42bc6ULL,
0x98f7df096b096e2dULL, 0x19a6e01e3ad852bfULL, 0x42a99ccbdbd4b40bULL,
0xa59998af45e9c559ULL, 0x366295e807d93186ULL, 0x6b48181bfaa1f773ULL,
0x1fec57e2157a0a1dULL, 0x4667446af6201ad5ULL, 0xe615ebcacfb0f075ULL,
0xb8f31f4f68290778ULL, 0x22713ed6ce22d11eULL, 0x3057c1a72ec3c93bULL,
0xcb46acc37c3f1f2fULL, 0xdbb893fd02aaf50eULL, 0x331fd92e600b9fcfULL,
0xa498f96148ea3ad6ULL, 0xa8d8426e8b6a83eaULL, 0xa089b274b7735cdcULL,
0x87f6b3731e524a11ULL, 0x118808e5cbc96749ULL, 0x9906e4c7b19bd394ULL,
0xafed7f7e9b24a20cULL, 0x6509eadeeb3644a7ULL, 0x6c1ef1d3e8ef0edeULL,
0xb9c97d43e9798fb4ULL, 0xa2f2d784740c28a3ULL, 0x7b8496476197566fULL,
0x7a5be3e6b65f069dULL, 0xf96330ed78be6f10ULL, 0xeee60de77a076a15ULL,
0x2b4bee4aa08b9bd0ULL, 0x6a56a63ec7b8894eULL, 0x02121359ba34fef4ULL,
0x4cbf99f8283703fcULL, 0x398071350caf30c8ULL, 0xd0a77a89f017687aULL,
0xf1c1a9eb9e423569ULL, 0x8c7976282dee8199ULL, 0x5d1737a5dd1f7abdULL,
0x4f53433c09a9fa80ULL, 0xfa8b0c53df7ca1d9ULL, 0x3fd9dcbc886ccb77ULL,
0xc040917ca91b4720ULL, 0x7dd00142f9d1dcdfULL, 0x8476fc1d4f387b58ULL,
0x23f8e7c5f3316503ULL, 0x032a2244e7e37339ULL, 0x5c87a5d750f5a74bULL,
0x082b4cc43698992eULL, 0xdf917becb858f63cULL, 0x3270b8fc5bf86ddaULL,
0x10ae72bb29b5dd76ULL, 0x576ac94e7700362bULL, 0x1ad112dac61efb8fULL,
0x691bc30ec5faa427ULL, 0xff246311cc327143ULL, 0x3142368e30e53206ULL,
0x71380e31e02ca396ULL, 0x958d5c960aad76f1ULL, 0xf8d6f430c16da536ULL,
0xc8ffd13f1be7e1d2ULL, 0x7578ae66004ddbe1ULL, 0x05833f01067be646ULL,
0xbb34b5ad3bfe586dULL, 0x095f34c9a12b97f0ULL, 0x247ab64525d60ca8ULL,
0xdcdbc6f3017477d1ULL, 0x4a2e14d4decad24dULL, 0xbdb5e6d9be0a1eebULL,
0x2a7e70f7794301abULL, 0xdef42d8a270540fdULL, 0x01078ec0a34c22c1ULL,
0xe5de511af4c16387ULL, 0x7ebb3a52bd9a330aULL, 0x77697857aa7d6435ULL,
0x004e831603ae4c32ULL, 0xe7a21020ad78e312ULL, 0x9d41a70c6ab420f2ULL,
0x28e06c18ea1141e6ULL, 0xd2b28cbd984f6b28ULL, 0x26b75f6c446e9d83ULL,
0xba47568c4d418d7fULL, 0xd80badbfe6183d8eULL, 0x0e206d7f5f166044ULL,
0xe258a43911cbca3eULL, 0x723a1746b21dc0bcULL, 0xc7caa854f5d7cdd3ULL,
0x7cac32883d261d9cULL, 0x7690c26423ba942cULL, 0x17e55524478042b8ULL,
0xe0be477656a2389fULL, 0x4d289b5e67ab2da0ULL, 0x44862b9c8fbbfd31ULL,
0xb47cc8049d141365ULL, 0x822c1b362b91c793ULL, 0x4eb14655fb13dfd8ULL,
0x1ecbba0714e2a97bULL, 0x6143459d5cde5f14ULL, 0x53a8fbf1d5f0ac89ULL,
0x97ea04d81c5e5b00ULL, 0x622181a8d4fdb3f3ULL, 0xe9bcd341572a1208ULL,
0x1411258643cce58aULL, 0x9144c5fea4c6e0a4ULL, 0x0d33d06565cf620fULL,
0x54a48d489f219ca1ULL, 0xc43e5eac6d63c821ULL, 0xa9728b3a72770dafULL,
0xd7934e7b20df87efULL, 0xe35503b61a3e86e5ULL, 0xcae321fbc819d504ULL,
0x129a50b3ac60bfa6ULL, 0xcd5e68ea7e9fb6c3ULL, 0xb01c90199483b1c7ULL,
0x3de93cd5c295376cULL, 0xaed52edf2ab9ad13ULL, 0x2e60f512c0a07884ULL,
0xbc3d86a3e36210c9ULL, 0x35269d9b163951ceULL, 0x0c7d6e2ad0cdb5faULL,
0x59e86297d87f5733ULL, 0x298ef221898db0e7ULL, 0x55000029d1a5aa7eULL,
0x8bc08ae1b5061b45ULL, 0xc2c31c2b6c92703aULL, 0x94cc596baf25ef42ULL,
0x0a1d73db22540456ULL, 0x04b6a0f9d9c4179aULL, 0xeffdafa2ae3d3c60ULL,
0xf7c8075bb49496c4ULL, 0x9cc5c7141d1cd4e3ULL, 0x78bd1638218e5534ULL,
0xb2f11568f850246aULL, 0xedfabcfa9502bc29ULL, 0x796ce5f2da23051bULL,
0xaae128b0dc93537cULL, 0x3a493da0ee4b29aeULL, 0xb5df6b2c416895d7ULL,
0xfcabbd25122d7f37ULL, 0x70810b58105dc4b1ULL, 0xe10fdd37f7882a90ULL,
0x524dcab5518a3f5cULL, 0x3c9e85878451255bULL, 0x4029828119bd34e2ULL,
0x74a05b6f5d3ceccbULL, 0xb610021542e13ecaULL, 0x0ff979d12f59e2acULL,
0x6037da27e4f9cc50ULL, 0x5e92975a0df1847dULL, 0xd66de190d3e623feULL,
0x5032d6b87b568048ULL, 0x9a36b7ce8235216eULL, 0x80272a7a24f64b4aULL,
0x93efed8b8c6916f7ULL, 0x37ddbff44cce1555ULL, 0x4b95db5d4b99bd25ULL,
0x92d3fda169812fc0ULL, 0xfb1a4a9a90660bb6ULL, 0x730c196946a4b9b2ULL,
0x81e289aa7f49da68ULL, 0x64669a0f83b1a05fULL, 0x27b3ff7d9644f48bULL,
0xcc6b615c8db675b3ULL, 0x674f20b9bcebbe95ULL, 0x6f31238275655982ULL,
0x5ae488713e45cf05ULL, 0xbf619f9954c21157ULL, 0xeabac46040a8eae9ULL,
0x454c6fe9f2c0c1cdULL, 0x419cf6496412691cULL, 0xd3dc3bef265b0f70ULL,
0x6d0e60f5c3578a9eULL
};
static const u64 sbox4[256] = {
0x5b0e608526323c55ULL, 0x1a46c1a9fa1b59f5ULL, 0xa9e245a17c4c8ffaULL,
0x65ca5159db2955d7ULL, 0x05db0a76ce35afc2ULL, 0x81eac77ea9113d45ULL,
0x528ef88ab6ac0a0dULL, 0xa09ea253597be3ffULL, 0x430ddfb3ac48cd56ULL,
0xc4b3a67af45ce46fULL, 0x4ececfd8fbe2d05eULL, 0x3ef56f10b39935f0ULL,
0x0b22d6829cd619c6ULL, 0x17fd460a74df2069ULL, 0x6cf8cc8e8510ed40ULL,
0xd6c824bf3a6ecaa7ULL, 0x61243d581a817049ULL, 0x048bacb6bbc163a2ULL,
0xd9a38ac27d44cc32ULL, 0x7fddff5baaf410abULL, 0xad6d495aa804824bULL,
0xe1a6a74f2d8c9f94ULL, 0xd4f7851235dee8e3ULL, 0xfd4b7f886540d893ULL,
0x247c20042aa4bfdaULL, 0x096ea1c517d1327cULL, 0xd56966b4361a6685ULL,
0x277da5c31221057dULL, 0x94d59893a43acff7ULL, 0x64f0c51ccdc02281ULL,
0x3d33bcc4ff6189dbULL, 0xe005cb184ce66af1ULL, 0xff5ccd1d1db99beaULL,
0xb0b854a7fe42980fULL, 0x7bd46a6a718d4b9fULL, 0xd10fa8cc22a5fd8cULL,
0xd31484952be4bd31ULL, 0xc7fa975fcb243847ULL, 0x4886ed1e5846c407ULL,
0x28cddb791eb70b04ULL, 0xc2b00be2f573417fULL, 0x5c9590452180f877ULL,
0x7a6bddfff370eb00ULL, 0xce509e38d6d9d6a4ULL, 0xebeb0f00647fa702ULL,
0x1dcc06cf76606f06ULL, 0xe4d9f28ba286ff0aULL, 0xd85a305dc918c262ULL,
0x475b1d8732225f54ULL, 0x2d4fb51668ccb5feULL, 0xa679b9d9d72bba20ULL,
0x53841c0d912d43a5ULL, 0x3b7eaa48bf12a4e8ULL, 0x781e0e47f22f1ddfULL,
0xeff20ce60ab50973ULL, 0x20d261d19dffb742ULL, 0x16a12b03062a2e39ULL,
0x1960eb2239650495ULL, 0x251c16fed50eb8b8ULL, 0x9ac0c330f826016eULL,
0xed152665953e7671ULL, 0x02d63194a6369570ULL, 0x5074f08394b1c987ULL,
0x70ba598c90b25ce1ULL, 0x794a15810b9742f6ULL, 0x0d5925e9fcaf8c6cULL,
0x3067716cd868744eULL, 0x910ab077e8d7731bULL, 0x6a61bbdb5ac42f61ULL,
0x93513efbf0851567ULL, 0xf494724b9e83e9d5ULL, 0xe887e1985c09648dULL,
0x34b1d3c675370cfdULL, 0xdc35e433bc0d255dULL, 0xd0aab84234131be0ULL,
0x08042a50b48b7eafULL, 0x9997c4ee44a3ab35ULL, 0x829a7b49201799d0ULL,
0x263b8307b7c54441ULL, 0x752f95f4fd6a6ca6ULL, 0x927217402c08c6e5ULL,
0x2a8ab754a795d9eeULL, 0xa442f7552f72943dULL, 0x2c31334e19781208ULL,
0x4fa98d7ceaee6291ULL, 0x55c3862f665db309ULL, 0xbd0610175d53b1f3ULL,
0x46fe6cb840413f27ULL, 0x3fe03792df0cfa59ULL, 0xcfe700372eb85e8fULL,
0xa7be29e7adbce118ULL, 0xe544ee5cde8431ddULL, 0x8a781b1b41f1873eULL,
0xa5c94c78a0d2f0e7ULL, 0x39412e2877b60728ULL, 0xa1265ef3afc9a62cULL,
0xbcc2770c6a2506c5ULL, 0x3ab66dd5dce1ce12ULL, 0xe65499d04a675b37ULL,
0x7d8f523481bfd216ULL, 0x0f6f64fcec15f389ULL, 0x74efbe618b5b13c8ULL,
0xacdc82b714273e1dULL, 0xdd40bfe003199d17ULL, 0x37e99257e7e061f8ULL,
0xfa52626904775aaaULL, 0x8bbbf63a463d56f9ULL, 0xf0013f1543a26e64ULL,
0xa8307e9f879ec898ULL, 0xcc4c27a4150177ccULL, 0x1b432f2cca1d3348ULL,
0xde1d1f8f9f6fa013ULL, 0x606602a047a7ddd6ULL, 0xd237ab64cc1cb2c7ULL,
0x9b938e7225fcd1d3ULL, 0xec4e03708e0ff476ULL, 0xfeb2fbda3d03c12dULL,
0xae0bced2ee43889aULL, 0x22cb8923ebfb4f43ULL, 0x69360d013cf7396dULL,
0x855e3602d2d4e022ULL, 0x073805bad01f784cULL, 0x33e17a133852f546ULL,
0xdf4874058ac7b638ULL, 0xba92b29c678aa14aULL, 0x0ce89fc76cfaadcdULL,
0x5f9d4e0908339e34ULL, 0xf1afe9291f5923b9ULL, 0x6e3480f60f4a265fULL,
0xeebf3a2ab29b841cULL, 0xe21938a88f91b4adULL, 0x57dfeff845c6d3c3ULL,
0x2f006b0bf62caaf2ULL, 0x62f479ef6f75ee78ULL, 0x11a55ad41c8916a9ULL,
0xf229d29084fed453ULL, 0x42f1c27b16b000e6ULL, 0x2b1f76749823c074ULL,
0x4b76eca3c2745360ULL, 0x8c98f463b91691bdULL, 0x14bcc93cf1ade66aULL,
0x8885213e6d458397ULL, 0x8e177df0274d4711ULL, 0xb49b73b5503f2951ULL,
0x10168168c3f96b6bULL, 0x0e3d963b63cab0aeULL, 0x8dfc4b5655a1db14ULL,
0xf789f1356e14de5cULL, 0x683e68af4e51dac1ULL, 0xc9a84f9d8d4b0fd9ULL,
0x3691e03f52a0f9d1ULL, 0x5ed86e46e1878e80ULL, 0x3c711a0e99d07150ULL,
0x5a0865b20c4e9310ULL, 0x56fbfc1fe4f0682eULL, 0xea8d5de3105edf9bULL,
0x71abfdb12379187aULL, 0x2eb99de1bee77b9cULL, 0x21ecc0ea33cf4523ULL,
0x59a4d7521805c7a1ULL, 0x3896f5eb56ae7c72ULL, 0xaa638f3db18f75dcULL,
0x9f39358dabe9808eULL, 0xb7defa91c00b72acULL, 0x6b5541fd62492d92ULL,
0x6dc6dee8f92e4d5bULL, 0x353f57abc4beea7eULL, 0x735769d6da5690ceULL,
0x0a234aa642391484ULL, 0xf6f9508028f80d9dULL, 0xb8e319a27ab3f215ULL,
0x31ad9c1151341a4dULL, 0x773c22a57bef5805ULL, 0x45c7561a07968633ULL,
0xf913da9e249dbe36ULL, 0xda652d9b78a64c68ULL, 0x4c27a97f3bc334efULL,
0x76621220e66b17f4ULL, 0x967743899acd7d0bULL, 0xf3ee5bcae0ed6782ULL,
0x409f753600c879fcULL, 0x06d09a39b5926db6ULL, 0x6f83aeb0317ac588ULL,
0x01e6ca4a86381f21ULL, 0x66ff3462d19f3025ULL, 0x72207c24ddfd3bfbULL,
0x4af6b6d3e2ece2ebULL, 0x9c994dbec7ea08deULL, 0x49ace597b09a8bc4ULL,
0xb38c4766cf0797baULL, 0x131b9373c57c2a75ULL, 0xb1822cce61931e58ULL,
0x9d7555b909ba1c0cULL, 0x127fafdd937d11d2ULL, 0x29da3badc66d92e4ULL,
0xa2c1d57154c2ecbcULL, 0x58c5134d82f6fe24ULL, 0x1c3ae3515b62274fULL,
0xe907c82e01cb8126ULL, 0xf8ed091913e37fcbULL, 0x3249d8f9c80046c9ULL,
0x80cf9bede388fb63ULL, 0x1881539a116cf19eULL, 0x5103f3f76bd52457ULL,
0x15b7e6f5ae47f7a8ULL, 0xdbd7c6ded47e9ccfULL, 0x44e55c410228bb1aULL,
0xb647d4255edb4e99ULL, 0x5d11882bb8aafc30ULL, 0xf5098bbb29d3212aULL,
0x8fb5ea14e90296b3ULL, 0x677b942157dd025aULL, 0xfb58e7c0a390acb5ULL,
0x89d3674c83bd4a01ULL, 0x9e2da4df4bf3b93bULL, 0xfcc41e328cab4829ULL,
0x03f38c96ba582c52ULL, 0xcad1bdbd7fd85db2ULL, 0xbbb442c16082ae83ULL,
0xb95fe86ba5da9ab0ULL, 0xb22e04673771a93fULL, 0x845358c9493152d8ULL,
0xbe2a488697b4541eULL, 0x95a2dc2dd38e6966ULL, 0xc02c11ac923c852bULL,
0x2388b1990df2a87bULL, 0x7c8008fa1b4f37beULL, 0x1f70d0c84d54e503ULL,
0x5490adec7ece57d4ULL, 0x002b3c27d9063a3aULL, 0x7eaea3848030a2bfULL,
0xc602326ded2003c0ULL, 0x83a7287d69a94086ULL, 0xc57a5fcb30f57a8aULL,
0xb56844e479ebe779ULL, 0xa373b40f05dcbce9ULL, 0xd71a786e88570ee2ULL,
0x879cbacdbde8f6a0ULL, 0x976ad1bcc164a32fULL, 0xab21e25e9666d78bULL,
0x901063aae5e5c33cULL, 0x9818b34448698d90ULL, 0xe36487ae3e1e8abbULL,
0xafbdf931893bdcb4ULL, 0x6345a0dc5fbbd519ULL, 0x8628fe269b9465caULL,
0x1e5d01603f9c51ecULL, 0x4de44006a15049b7ULL, 0xbf6c70e5f776cbb1ULL,
0x411218f2ef552bedULL, 0xcb0c0708705a36a3ULL, 0xe74d14754f986044ULL,
0xcd56d9430ea8280eULL, 0xc12591d7535f5065ULL, 0xc83223f1720aef96ULL,
0xc3a0396f7363a51fULL
};
static void tgr192_round(u64 * ra, u64 * rb, u64 * rc, u64 x, int mul)
{
u64 a = *ra;
u64 b = *rb;
u64 c = *rc;
c ^= x;
a -= sbox1[c & 0xff] ^ sbox2[(c >> 16) & 0xff]
^ sbox3[(c >> 32) & 0xff] ^ sbox4[(c >> 48) & 0xff];
b += sbox4[(c >> 8) & 0xff] ^ sbox3[(c >> 24) & 0xff]
^ sbox2[(c >> 40) & 0xff] ^ sbox1[(c >> 56) & 0xff];
b *= mul;
*ra = a;
*rb = b;
*rc = c;
}
static void tgr192_pass(u64 * ra, u64 * rb, u64 * rc, u64 * x, int mul)
{
u64 a = *ra;
u64 b = *rb;
u64 c = *rc;
tgr192_round(&a, &b, &c, x[0], mul);
tgr192_round(&b, &c, &a, x[1], mul);
tgr192_round(&c, &a, &b, x[2], mul);
tgr192_round(&a, &b, &c, x[3], mul);
tgr192_round(&b, &c, &a, x[4], mul);
tgr192_round(&c, &a, &b, x[5], mul);
tgr192_round(&a, &b, &c, x[6], mul);
tgr192_round(&b, &c, &a, x[7], mul);
*ra = a;
*rb = b;
*rc = c;
}
static void tgr192_key_schedule(u64 * x)
{
x[0] -= x[7] ^ 0xa5a5a5a5a5a5a5a5ULL;
x[1] ^= x[0];
x[2] += x[1];
x[3] -= x[2] ^ ((~x[1]) << 19);
x[4] ^= x[3];
x[5] += x[4];
x[6] -= x[5] ^ ((~x[4]) >> 23);
x[7] ^= x[6];
x[0] += x[7];
x[1] -= x[0] ^ ((~x[7]) << 19);
x[2] ^= x[1];
x[3] += x[2];
x[4] -= x[3] ^ ((~x[2]) >> 23);
x[5] ^= x[4];
x[6] += x[5];
x[7] -= x[6] ^ 0x0123456789abcdefULL;
}
/****************
* Transform the message DATA which consists of 512 bytes (8 words)
*/
static void tgr192_transform(struct tgr192_ctx *tctx, const u8 * data)
{
u64 a, b, c, aa, bb, cc;
u64 x[8];
int i;
const __le64 *ptr = (const __le64 *)data;
for (i = 0; i < 8; i++)
x[i] = le64_to_cpu(ptr[i]);
/* save */
a = aa = tctx->a;
b = bb = tctx->b;
c = cc = tctx->c;
tgr192_pass(&a, &b, &c, x, 5);
tgr192_key_schedule(x);
tgr192_pass(&c, &a, &b, x, 7);
tgr192_key_schedule(x);
tgr192_pass(&b, &c, &a, x, 9);
/* feedforward */
a ^= aa;
b -= bb;
c += cc;
/* store */
tctx->a = a;
tctx->b = b;
tctx->c = c;
}
static int tgr192_init(struct shash_desc *desc)
{
struct tgr192_ctx *tctx = shash_desc_ctx(desc);
tctx->a = 0x0123456789abcdefULL;
tctx->b = 0xfedcba9876543210ULL;
tctx->c = 0xf096a5b4c3b2e187ULL;
tctx->nblocks = 0;
tctx->count = 0;
return 0;
}
/* Update the message digest with the contents
* of INBUF with length INLEN. */
static int tgr192_update(struct shash_desc *desc, const u8 *inbuf,
unsigned int len)
{
struct tgr192_ctx *tctx = shash_desc_ctx(desc);
if (tctx->count == 64) { /* flush the buffer */
tgr192_transform(tctx, tctx->hash);
tctx->count = 0;
tctx->nblocks++;
}
if (!inbuf) {
return 0;
}
if (tctx->count) {
for (; len && tctx->count < 64; len--) {
tctx->hash[tctx->count++] = *inbuf++;
}
tgr192_update(desc, NULL, 0);
if (!len) {
return 0;
}
}
while (len >= 64) {
tgr192_transform(tctx, inbuf);
tctx->count = 0;
tctx->nblocks++;
len -= 64;
inbuf += 64;
}
for (; len && tctx->count < 64; len--) {
tctx->hash[tctx->count++] = *inbuf++;
}
return 0;
}
/* The routine terminates the computation */
static int tgr192_final(struct shash_desc *desc, u8 * out)
{
struct tgr192_ctx *tctx = shash_desc_ctx(desc);
__be64 *dst = (__be64 *)out;
__be64 *be64p;
__le32 *le32p;
u32 t, msb, lsb;
tgr192_update(desc, NULL, 0); /* flush */ ;
msb = 0;
t = tctx->nblocks;
if ((lsb = t << 6) < t) { /* multiply by 64 to make a byte count */
msb++;
}
msb += t >> 26;
t = lsb;
if ((lsb = t + tctx->count) < t) { /* add the count */
msb++;
}
t = lsb;
if ((lsb = t << 3) < t) { /* multiply by 8 to make a bit count */
msb++;
}
msb += t >> 29;
if (tctx->count < 56) { /* enough room */
tctx->hash[tctx->count++] = 0x01; /* pad */
while (tctx->count < 56) {
tctx->hash[tctx->count++] = 0; /* pad */
}
} else { /* need one extra block */
tctx->hash[tctx->count++] = 0x01; /* pad character */
while (tctx->count < 64) {
tctx->hash[tctx->count++] = 0;
}
tgr192_update(desc, NULL, 0); /* flush */ ;
memset(tctx->hash, 0, 56); /* fill next block with zeroes */
}
/* append the 64 bit count */
le32p = (__le32 *)&tctx->hash[56];
le32p[0] = cpu_to_le32(lsb);
le32p[1] = cpu_to_le32(msb);
tgr192_transform(tctx, tctx->hash);
be64p = (__be64 *)tctx->hash;
dst[0] = be64p[0] = cpu_to_be64(tctx->a);
dst[1] = be64p[1] = cpu_to_be64(tctx->b);
dst[2] = be64p[2] = cpu_to_be64(tctx->c);
return 0;
}
static int tgr160_final(struct shash_desc *desc, u8 * out)
{
u8 D[64];
tgr192_final(desc, D);
memcpy(out, D, TGR160_DIGEST_SIZE);
memset(D, 0, TGR192_DIGEST_SIZE);
return 0;
}
static int tgr128_final(struct shash_desc *desc, u8 * out)
{
u8 D[64];
tgr192_final(desc, D);
memcpy(out, D, TGR128_DIGEST_SIZE);
memset(D, 0, TGR192_DIGEST_SIZE);
return 0;
}
static struct shash_alg tgr192 = {
.digestsize = TGR192_DIGEST_SIZE,
.init = tgr192_init,
.update = tgr192_update,
.final = tgr192_final,
.descsize = sizeof(struct tgr192_ctx),
.base = {
.cra_name = "tgr192",
.cra_flags = CRYPTO_ALG_TYPE_SHASH,
.cra_blocksize = TGR192_BLOCK_SIZE,
.cra_module = THIS_MODULE,
}
};
static struct shash_alg tgr160 = {
.digestsize = TGR160_DIGEST_SIZE,
.init = tgr192_init,
.update = tgr192_update,
.final = tgr160_final,
.descsize = sizeof(struct tgr192_ctx),
.base = {
.cra_name = "tgr160",
.cra_flags = CRYPTO_ALG_TYPE_SHASH,
.cra_blocksize = TGR192_BLOCK_SIZE,
.cra_module = THIS_MODULE,
}
};
static struct shash_alg tgr128 = {
.digestsize = TGR128_DIGEST_SIZE,
.init = tgr192_init,
.update = tgr192_update,
.final = tgr128_final,
.descsize = sizeof(struct tgr192_ctx),
.base = {
.cra_name = "tgr128",
.cra_flags = CRYPTO_ALG_TYPE_SHASH,
.cra_blocksize = TGR192_BLOCK_SIZE,
.cra_module = THIS_MODULE,
}
};
static int __init tgr192_mod_init(void)
{
int ret = 0;
ret = crypto_register_shash(&tgr192);
if (ret < 0) {
goto out;
}
ret = crypto_register_shash(&tgr160);
if (ret < 0) {
crypto_unregister_shash(&tgr192);
goto out;
}
ret = crypto_register_shash(&tgr128);
if (ret < 0) {
crypto_unregister_shash(&tgr192);
crypto_unregister_shash(&tgr160);
}
out:
return ret;
}
static void __exit tgr192_mod_fini(void)
{
crypto_unregister_shash(&tgr192);
crypto_unregister_shash(&tgr160);
crypto_unregister_shash(&tgr128);
}
MODULE_ALIAS("tgr160");
MODULE_ALIAS("tgr128");
module_init(tgr192_mod_init);
module_exit(tgr192_mod_fini);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Tiger Message Digest Algorithm");
| {
"pile_set_name": "Github"
} |
form=七绝
tags=
劝郎莫上南高峰,
劝郎莫上北高峰,
南高峰云北高雨,
云雨相催愁杀侬。
| {
"pile_set_name": "Github"
} |
proto: int semid, struct sembuf __user *tsops, unsigned nsops
parms: semid, tsops, nsops
errors:
- E2BIG
- EACCES
- EAGAIN
- EFAULT
- EFBIG
- EIDRM
- EINTR
- EINVAL
- ENOMEM
- ERANGE
profiles:
- ipc
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
<head>
<!--
*
* Copyright 2009, Haiku. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Humdinger <humdingerb@gmail.com>
* Translators:
* Humdinger
* Matthias
* taos
*
-->
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="robots" content="all" />
<title>WonderBrush</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="../../Haiku-doc.css" />
</head>
<body>
<div id="banner">
<div><span>User guide</span></div>
</div>
<div class="nav">
<div class="inner">
<ul class="lang-menu">
<li class="now">Deutsch <span class="dropdown-caret">▼</span></li>
<li><a href="../../id/applications/wonderbrush.html">Bahasa Indonesia</a></li>
<li><a href="../../ca/applications/wonderbrush.html">Català</a></li>
<li><a href="../../en/applications/wonderbrush.html">English</a></li>
<li><a href="../../es/applications/wonderbrush.html">Español</a></li>
<li><a href="../../fr/applications/wonderbrush.html">Français</a></li>
<li><a href="../../fur/applications/wonderbrush.html">Furlan</a></li>
<li><a href="../../it/applications/wonderbrush.html">Italiano</a></li>
<li><a href="../../hu/applications/wonderbrush.html">Magyar</a></li>
<li><a href="../../pl/applications/wonderbrush.html">Polski</a></li>
<li><a href="../../pt_PT/applications/wonderbrush.html">Português</a></li>
<li><a href="../../pt_BR/applications/wonderbrush.html">Português (Brazil)</a></li>
<li><a href="../../ro/applications/wonderbrush.html">Română</a></li>
<li><a href="../../sk/applications/wonderbrush.html">Slovenčina</a></li>
<li><a href="../../fi/applications/wonderbrush.html">Suomi</a></li>
<li><a href="../../sv_SE/applications/wonderbrush.html">Svenska</a></li>
<li><a href="../../tr/applications/wonderbrush.html">Türkçe</a></li>
<li><a href="../../zh_CN/applications/wonderbrush.html"> 中文 [中文]</a></li>
<li><a href="../../ru/applications/wonderbrush.html">Русский</a></li>
<li><a href="../../uk/applications/wonderbrush.html">Українська</a></li>
<li><a href="../../jp/applications/wonderbrush.html">日本語</a></li>
</ul>
<span>
« <a href="vision.html">Vision</a>
:: <a href="../applications.html#list-of-bundled-apps" class="uplink">Anwendungen</a>
</span></div>
</div>
<div id="content">
<div>
<h2><img src="../../images/apps-images/wonderbrush-icon_64.png" alt="wonderbrush-icon_64.png" width="64" height="64" />WonderBrush</h2>
<table summary="layout" border="0" cellspacing="0" cellpadding="2">
<tr><td>Deskbar:</td><td style="width:15px;"></td><td><span class="menu">Anwendungen</span></td></tr>
<tr><td>Ort:</td><td></td><td><span class="path">/boot/system/apps/WonderBrush/WonderBrush</span></td></tr>
<tr><td>Benutzerhandbuch:</td><td></td><td><span class="path">/boot/system/apps/WonderBrush/Documentation de</span></td></tr>
<tr><td>Einstellungen:</td><td></td><td><span class="path">~/config/settings/WonderBrush</span></td></tr>
</table>
<p><br /></p>
<p>WonderBrush ist ein Bitmap- und Vektorgraphik Editor. Nähere Informationen können auf der Webseite von <a href="http://yellowbites.com/wonderbrush.html">YellowBites</a>, den Entwicklern dieses Programms, und in der Haiku beigefügten <a href="file:///boot/system/apps/WonderBrush/Documentation%20de/introduction.html">Dokumentation</a> nachgelesen werden.</p>
</div>
</div>
<!--
<div class="nav">
<div class="inner"><span>
« <a href="vision.html">Vision</a>
:: <a href="../applications.html#list-of-bundled-apps" class="uplink">Anwendungen</a>
</span></div>
</div>
-->
</body>
</html>
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.kafka</groupId>
<artifactId>connect-mongodb</artifactId>
<version>1.1</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<inherited>true</inherited>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>connect-api</artifactId>
<version>0.10.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-easymock</artifactId>
<version>1.6.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>de.flapdoodle.embed</groupId>
<artifactId>de.flapdoodle.embed.mongo</artifactId>
<version>1.50.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.4</version>
<scope>test</scope>
</dependency>
</dependencies>
</project> | {
"pile_set_name": "Github"
} |
foobar()
foo_bar_42()
about
abs
addAttr
addAttributeEditorNodeHelp
addDynamic
addNewShelfTab
addPP
addPanelCategory
addPrefixToName
advanceToNextDrivenKey
affectedNet
affects
aimConstraint
air
alias
aliasAttr
align
alignCtx
alignCurve
alignSurface
allViewFit
ambientLight
angle
angleBetween
animCone
animCurveEditor
animDisplay
animView
annotate
appendStringArray
applicationName
applyAttrPreset
applyTake
arcLenDimContext
arcLengthDimension
arclen
arrayMapper
art3dPaintCtx
artAttrCtx
artAttrPaintVertexCtx
artAttrSkinPaintCtx
artAttrTool
artBuildPaintMenu
artFluidAttrCtx
artPuttyCtx
artSelectCtx
artSetPaintCtx
artUserPaintCtx
assignCommand
assignInputDevice
assignViewportFactories
attachCurve
attachDeviceAttr
attachSurface
attrColorSliderGrp
attrCompatibility
attrControlGrp
attrEnumOptionMenu
attrEnumOptionMenuGrp
attrFieldGrp
attrFieldSliderGrp
attrNavigationControlGrp
attrPresetEditWin
attributeExists
attributeInfo
attributeMenu
attributeQuery
autoKeyframe
autoPlace
bakeClip
bakeFluidShading
bakePartialHistory
bakeResults
bakeSimulation
basename
basenameEx
batchRender
bessel
bevel
bevelPlus
binMembership
bindSkin
blend2
blendShape
blendShapeEditor
blendShapePanel
blendTwoAttr
blindDataType
boneLattice
boundary
boxDollyCtx
boxZoomCtx
bufferCurve
buildBookmarkMenu
buildKeyframeMenu
button
buttonManip
CBG
cacheFile
cacheFileCombine
cacheFileMerge
cacheFileTrack
camera
cameraView
canCreateManip
canvas
capitalizeString
catch
catchQuiet
ceil
changeSubdivComponentDisplayLevel
changeSubdivRegion
channelBox
character
characterMap
characterOutlineEditor
characterize
chdir
checkBox
checkBoxGrp
checkDefaultRenderGlobals
choice
circle
circularFillet
clamp
clear
clearCache
clip
clipEditor
clipEditorCurrentTimeCtx
clipSchedule
clipSchedulerOutliner
clipTrimBefore
closeCurve
closeSurface
cluster
cmdFileOutput
cmdScrollFieldExecuter
cmdScrollFieldReporter
cmdShell
coarsenSubdivSelectionList
collision
color
colorAtPoint
colorEditor
colorIndex
colorIndexSliderGrp
colorSliderButtonGrp
colorSliderGrp
columnLayout
commandEcho
commandLine
commandPort
compactHairSystem
componentEditor
compositingInterop
computePolysetVolume
condition
cone
confirmDialog
connectAttr
connectControl
connectDynamic
connectJoint
connectionInfo
constrain
constrainValue
constructionHistory
container
containsMultibyte
contextInfo
control
convertFromOldLayers
convertIffToPsd
convertLightmap
convertSolidTx
convertTessellation
convertUnit
copyArray
copyFlexor
copyKey
copySkinWeights
cos
cpButton
cpCache
cpClothSet
cpCollision
cpConstraint
cpConvClothToMesh
cpForces
cpGetSolverAttr
cpPanel
cpProperty
cpRigidCollisionFilter
cpSeam
cpSetEdit
cpSetSolverAttr
cpSolver
cpSolverTypes
cpTool
cpUpdateClothUVs
createDisplayLayer
createDrawCtx
createEditor
createLayeredPsdFile
createMotionField
createNewShelf
createNode
createRenderLayer
createSubdivRegion
cross
crossProduct
ctxAbort
ctxCompletion
ctxEditMode
ctxTraverse
currentCtx
currentTime
currentTimeCtx
currentUnit
curve
curveAddPtCtx
curveCVCtx
curveEPCtx
curveEditorCtx
curveIntersect
curveMoveEPCtx
curveOnSurface
curveSketchCtx
cutKey
cycleCheck
cylinder
dagPose
date
defaultLightListCheckBox
defaultNavigation
defineDataServer
defineVirtualDevice
deformer
deg_to_rad
delete
deleteAttr
deleteShadingGroupsAndMaterials
deleteShelfTab
deleteUI
deleteUnusedBrushes
delrandstr
detachCurve
detachDeviceAttr
detachSurface
deviceEditor
devicePanel
dgInfo
dgdirty
dgeval
dgtimer
dimWhen
directKeyCtx
directionalLight
dirmap
dirname
disable
disconnectAttr
disconnectJoint
diskCache
displacementToPoly
displayAffected
displayColor
displayCull
displayLevelOfDetail
displayPref
displayRGBColor
displaySmoothness
displayStats
displayString
displaySurface
distanceDimContext
distanceDimension
doBlur
dolly
dollyCtx
dopeSheetEditor
dot
dotProduct
doubleProfileBirailSurface
drag
dragAttrContext
draggerContext
dropoffLocator
duplicate
duplicateCurve
duplicateSurface
dynCache
dynControl
dynExport
dynExpression
dynGlobals
dynPaintEditor
dynParticleCtx
dynPref
dynRelEdPanel
dynRelEditor
dynamicLoad
editAttrLimits
editDisplayLayerGlobals
editDisplayLayerMembers
editRenderLayerAdjustment
editRenderLayerGlobals
editRenderLayerMembers
editor
editorTemplate
effector
emit
emitter
enableDevice
encodeString
endString
endsWith
env
equivalent
equivalentTol
erf
error
eval
evalDeferred
evalEcho
event
exactWorldBoundingBox
exclusiveLightCheckBox
exec
executeForEachObject
exists
exp
expression
expressionEditorListen
extendCurve
extendSurface
extrude
fcheck
fclose
feof
fflush
fgetline
fgetword
file
fileBrowserDialog
fileDialog
fileExtension
fileInfo
filetest
filletCurve
filter
filterCurve
filterExpand
filterStudioImport
findAllIntersections
findAnimCurves
findKeyframe
findMenuItem
findRelatedSkinCluster
finder
firstParentOf
fitBspline
flexor
floatEq
floatField
floatFieldGrp
floatScrollBar
floatSlider
floatSlider2
floatSliderButtonGrp
floatSliderGrp
floor
flow
fluidCacheInfo
fluidEmitter
fluidVoxelInfo
flushUndo
fmod
fontDialog
fopen
formLayout
format
fprint
frameLayout
fread
freeFormFillet
frewind
fromNativePath
fwrite
gamma
gauss
geometryConstraint
getApplicationVersionAsFloat
getAttr
getClassification
getDefaultBrush
getFileList
getFluidAttr
getInputDeviceRange
getMayaPanelTypes
getModifiers
getPanel
getParticleAttr
getPluginResource
getenv
getpid
glRender
glRenderEditor
globalStitch
gmatch
goal
gotoBindPose
grabColor
gradientControl
gradientControlNoAttr
graphDollyCtx
graphSelectContext
graphTrackCtx
gravity
grid
gridLayout
group
groupObjectsByName
HfAddAttractorToAS
HfAssignAS
HfBuildEqualMap
HfBuildFurFiles
HfBuildFurImages
HfCancelAFR
HfConnectASToHF
HfCreateAttractor
HfDeleteAS
HfEditAS
HfPerformCreateAS
HfRemoveAttractorFromAS
HfSelectAttached
HfSelectAttractors
HfUnAssignAS
hardenPointCurve
hardware
hardwareRenderPanel
headsUpDisplay
headsUpMessage
help
helpLine
hermite
hide
hilite
hitTest
hotBox
hotkey
hotkeyCheck
hsv_to_rgb
hudButton
hudSlider
hudSliderButton
hwReflectionMap
hwRender
hwRenderLoad
hyperGraph
hyperPanel
hyperShade
hypot
iconTextButton
iconTextCheckBox
iconTextRadioButton
iconTextRadioCollection
iconTextScrollList
iconTextStaticLabel
ikHandle
ikHandleCtx
ikHandleDisplayScale
ikSolver
ikSplineHandleCtx
ikSystem
ikSystemInfo
ikfkDisplayMethod
illustratorCurves
image
imfPlugins
inheritTransform
insertJoint
insertJointCtx
insertKeyCtx
insertKnotCurve
insertKnotSurface
instance
instanceable
instancer
intField
intFieldGrp
intScrollBar
intSlider
intSliderGrp
interToUI
internalVar
intersect
iprEngine
isAnimCurve
isConnected
isDirty
isParentOf
isSameObject
isTrue
isValidObjectName
isValidString
isValidUiName
isolateSelect
itemFilter
itemFilterAttr
itemFilterRender
itemFilterType
joint
jointCluster
jointCtx
jointDisplayScale
jointLattice
keyTangent
keyframe
keyframeOutliner
keyframeRegionCurrentTimeCtx
keyframeRegionDirectKeyCtx
keyframeRegionDollyCtx
keyframeRegionInsertKeyCtx
keyframeRegionMoveKeyCtx
keyframeRegionScaleKeyCtx
keyframeRegionSelectKeyCtx
keyframeRegionSetKeyCtx
keyframeRegionTrackCtx
keyframeStats
lassoContext
lattice
latticeDeformKeyCtx
launch
launchImageEditor
layerButton
layeredShaderPort
layeredTexturePort
layout
layoutDialog
lightList
lightListEditor
lightListPanel
lightlink
lineIntersection
linearPrecision
linstep
listAnimatable
listAttr
listCameras
listConnections
listDeviceAttachments
listHistory
listInputDeviceAxes
listInputDeviceButtons
listInputDevices
listMenuAnnotation
listNodeTypes
listPanelCategories
listRelatives
listSets
listTransforms
listUnselected
listerEditor
loadFluid
loadNewShelf
loadPlugin
loadPluginLanguageResources
loadPrefObjects
localizedPanelLabel
lockNode
loft
log
longNameOf
lookThru
ls
lsThroughFilter
lsType
lsUI
Mayatomr
mag
makeIdentity
makeLive
makePaintable
makeRoll
makeSingleSurface
makeTubeOn
makebot
manipMoveContext
manipMoveLimitsCtx
manipOptions
manipRotateContext
manipRotateLimitsCtx
manipScaleContext
manipScaleLimitsCtx
marker
match
max
memory
menu
menuBarLayout
menuEditor
menuItem
menuItemToShelf
menuSet
menuSetPref
messageLine
min
minimizeApp
mirrorJoint
modelCurrentTimeCtx
modelEditor
modelPanel
mouse
movIn
movOut
move
moveIKtoFK
moveKeyCtx
moveVertexAlongDirection
multiProfileBirailSurface
mute
nParticle
nameCommand
nameField
namespace
namespaceInfo
newPanelItems
newton
nodeCast
nodeIconButton
nodeOutliner
nodePreset
nodeType
noise
nonLinear
normalConstraint
normalize
nurbsBoolean
nurbsCopyUVSet
nurbsCube
nurbsEditUV
nurbsPlane
nurbsSelect
nurbsSquare
nurbsToPoly
nurbsToPolygonsPref
nurbsToSubdiv
nurbsToSubdivPref
nurbsUVSet
nurbsViewDirectionVector
objExists
objectCenter
objectLayer
objectType
objectTypeUI
obsoleteProc
oceanNurbsPreviewPlane
offsetCurve
offsetCurveOnSurface
offsetSurface
openGLExtension
openMayaPref
optionMenu
optionMenuGrp
optionVar
orbit
orbitCtx
orientConstraint
outlinerEditor
outlinerPanel
overrideModifier
paintEffectsDisplay
pairBlend
palettePort
paneLayout
panel
panelConfiguration
panelHistory
paramDimContext
paramDimension
paramLocator
parent
parentConstraint
particle
particleExists
particleInstancer
particleRenderInfo
partition
pasteKey
pathAnimation
pause
pclose
percent
performanceOptions
pfxstrokes
pickWalk
picture
pixelMove
planarSrf
plane
play
playbackOptions
playblast
plugAttr
plugNode
pluginInfo
pluginResourceUtil
pointConstraint
pointCurveConstraint
pointLight
pointMatrixMult
pointOnCurve
pointOnSurface
pointPosition
poleVectorConstraint
polyAppend
polyAppendFacetCtx
polyAppendVertex
polyAutoProjection
polyAverageNormal
polyAverageVertex
polyBevel
polyBlendColor
polyBlindData
polyBoolOp
polyBridgeEdge
polyCacheMonitor
polyCheck
polyChipOff
polyClipboard
polyCloseBorder
polyCollapseEdge
polyCollapseFacet
polyColorBlindData
polyColorDel
polyColorPerVertex
polyColorSet
polyCompare
polyCone
polyCopyUV
polyCrease
polyCreaseCtx
polyCreateFacet
polyCreateFacetCtx
polyCube
polyCut
polyCutCtx
polyCylinder
polyCylindricalProjection
polyDelEdge
polyDelFacet
polyDelVertex
polyDuplicateAndConnect
polyDuplicateEdge
polyEditUV
polyEditUVShell
polyEvaluate
polyExtrudeEdge
polyExtrudeFacet
polyExtrudeVertex
polyFlipEdge
polyFlipUV
polyForceUV
polyGeoSampler
polyHelix
polyInfo
polyInstallAction
polyLayoutUV
polyListComponentConversion
polyMapCut
polyMapDel
polyMapSew
polyMapSewMove
polyMergeEdge
polyMergeEdgeCtx
polyMergeFacet
polyMergeFacetCtx
polyMergeUV
polyMergeVertex
polyMirrorFace
polyMoveEdge
polyMoveFacet
polyMoveFacetUV
polyMoveUV
polyMoveVertex
polyNormal
polyNormalPerVertex
polyNormalizeUV
polyOptUvs
polyOptions
polyOutput
polyPipe
polyPlanarProjection
polyPlane
polyPlatonicSolid
polyPoke
polyPrimitive
polyPrism
polyProjection
polyPyramid
polyQuad
polyQueryBlindData
polyReduce
polySelect
polySelectConstraint
polySelectConstraintMonitor
polySelectCtx
polySelectEditCtx
polySeparate
polySetToFaceNormal
polySewEdge
polyShortestPathCtx
polySmooth
polySoftEdge
polySphere
polySphericalProjection
polySplit
polySplitCtx
polySplitEdge
polySplitRing
polySplitVertex
polyStraightenUVBorder
polySubdivideEdge
polySubdivideFacet
polyToSubdiv
polyTorus
polyTransfer
polyTriangulate
polyUVSet
polyUnite
polyWedgeFace
popen
popupMenu
pose
pow
preloadRefEd
print
progressBar
progressWindow
projFileViewer
projectCurve
projectTangent
projectionContext
projectionManip
promptDialog
propModCtx
propMove
psdChannelOutliner
psdEditTextureFile
psdExport
psdTextureFile
putenv
pwd
python
querySubdiv
quit
rad_to_deg
radial
radioButton
radioButtonGrp
radioCollection
radioMenuItemCollection
rampColorPort
rand
randomizeFollicles
randstate
rangeControl
readTake
rebuildCurve
rebuildSurface
recordAttr
recordDevice
redo
reference
referenceEdit
referenceQuery
refineSubdivSelectionList
refresh
refreshAE
registerPluginResource
rehash
reloadImage
removeJoint
removeMultiInstance
removePanelCategory
rename
renameAttr
renameSelectionList
renameUI
render
renderGlobalsNode
renderInfo
renderLayerButton
renderLayerParent
renderLayerPostProcess
renderLayerUnparent
renderManip
renderPartition
renderQualityNode
renderSettings
renderThumbnailUpdate
renderWindowEditor
renderWindowSelectContext
renderer
reorder
reorderDeformers
requires
reroot
resampleFluid
resetAE
resetPfxToPolyCamera
resetTool
resolutionNode
retarget
reverseCurve
reverseSurface
revolve
rgb_to_hsv
rigidBody
rigidSolver
roll
rollCtx
rootOf
rot
rotate
rotationInterpolation
roundConstantRadius
rowColumnLayout
rowLayout
runTimeCommand
runup
sampleImage
saveAllShelves
saveAttrPreset
saveFluid
saveImage
saveInitialState
saveMenu
savePrefObjects
savePrefs
saveShelf
saveToolSettings
scale
scaleBrushBrightness
scaleComponents
scaleConstraint
scaleKey
scaleKeyCtx
sceneEditor
sceneUIReplacement
scmh
scriptCtx
scriptEditorInfo
scriptJob
scriptNode
scriptTable
scriptToShelf
scriptedPanel
scriptedPanelType
scrollField
scrollLayout
sculpt
searchPathArray
seed
selLoadSettings
select
selectContext
selectCurveCV
selectKey
selectKeyCtx
selectKeyframeRegionCtx
selectMode
selectPref
selectPriority
selectType
selectedNodes
selectionConnection
separator
setAttr
setAttrEnumResource
setAttrMapping
setAttrNiceNameResource
setConstraintRestPosition
setDefaultShadingGroup
setDrivenKeyframe
setDynamic
setEditCtx
setEditor
setFluidAttr
setFocus
setInfinity
setInputDeviceMapping
setKeyCtx
setKeyPath
setKeyframe
setKeyframeBlendshapeTargetWts
setMenuMode
setNodeNiceNameResource
setNodeTypeFlag
setParent
setParticleAttr
setPfxToPolyCamera
setPluginResource
setProject
setStampDensity
setStartupMessage
setState
setToolTo
setUITemplate
setXformManip
sets
shadingConnection
shadingGeometryRelCtx
shadingLightRelCtx
shadingNetworkCompare
shadingNode
shapeCompare
shelfButton
shelfLayout
shelfTabLayout
shellField
shortNameOf
showHelp
showHidden
showManipCtx
showSelectionInTitle
showShadingGroupAttrEditor
showWindow
sign
simplify
sin
singleProfileBirailSurface
size
sizeBytes
skinCluster
skinPercent
smoothCurve
smoothTangentSurface
smoothstep
snap2to2
snapKey
snapMode
snapTogetherCtx
snapshot
soft
softMod
softModCtx
sort
sound
soundControl
source
spaceLocator
sphere
sphrand
spotLight
spotLightPreviewPort
spreadSheetEditor
spring
sqrt
squareSurface
srtContext
stackTrace
startString
startsWith
stitchAndExplodeShell
stitchSurface
stitchSurfacePoints
strcmp
stringArrayCatenate
stringArrayContains
stringArrayCount
stringArrayInsertAtIndex
stringArrayIntersector
stringArrayRemove
stringArrayRemoveAtIndex
stringArrayRemoveDuplicates
stringArrayRemoveExact
stringArrayToString
stringToStringArray
strip
stripPrefixFromName
stroke
subdAutoProjection
subdCleanTopology
subdCollapse
subdDuplicateAndConnect
subdEditUV
subdListComponentConversion
subdMapCut
subdMapSewMove
subdMatchTopology
subdMirror
subdToBlind
subdToPoly
subdTransferUVsToCache
subdiv
subdivCrease
subdivDisplaySmoothness
substitute
substituteAllString
substituteGeometry
substring
surface
surfaceSampler
surfaceShaderList
swatchDisplayPort
switchTable
symbolButton
symbolCheckBox
sysFile
system
tabLayout
tan
tangentConstraint
texLatticeDeformContext
texManipContext
texMoveContext
texMoveUVShellContext
texRotateContext
texScaleContext
texSelectContext
texSelectShortestPathCtx
texSmudgeUVContext
texWinToolCtx
text
textCurves
textField
textFieldButtonGrp
textFieldGrp
textManip
textScrollList
textToShelf
textureDisplacePlane
textureHairColor
texturePlacementContext
textureWindow
threadCount
threePointArcCtx
timeControl
timePort
timerX
toNativePath
toggle
toggleAxis
toggleWindowVisibility
tokenize
tokenizeList
tolerance
tolower
toolButton
toolCollection
toolDropped
toolHasOptions
toolPropertyWindow
torus
toupper
trace
track
trackCtx
transferAttributes
transformCompare
transformLimits
translator
trim
trunc
truncateFluidCache
truncateHairCache
tumble
tumbleCtx
turbulence
twoPointArcCtx
uiRes
uiTemplate
unassignInputDevice
undo
undoInfo
ungroup
uniform
unit
unloadPlugin
untangleUV
untitledFileName
untrim
upAxis
updateAE
userCtx
uvLink
uvSnapshot
validateShelfName
vectorize
view2dToolCtx
viewCamera
viewClipPlane
viewFit
viewHeadOn
viewLookAt
viewManip
viewPlace
viewSet
visor
volumeAxis
vortex
waitCursor
warning
webBrowser
webBrowserPrefs
whatIs
window
windowPref
wire
wireContext
workspace
wrinkle
wrinkleContext
writeTake
xbmLangPathList
xform
----------------------------------------------------
[
["function", "foobar"], ["punctuation", "("], ["punctuation", ")"],
["function", "foo_bar_42"], ["punctuation", "("], ["punctuation", ")"],
["function", "about"],
["function", "abs"],
["function", "addAttr"],
["function", "addAttributeEditorNodeHelp"],
["function", "addDynamic"],
["function", "addNewShelfTab"],
["function", "addPP"],
["function", "addPanelCategory"],
["function", "addPrefixToName"],
["function", "advanceToNextDrivenKey"],
["function", "affectedNet"],
["function", "affects"],
["function", "aimConstraint"],
["function", "air"],
["function", "alias"],
["function", "aliasAttr"],
["function", "align"],
["function", "alignCtx"],
["function", "alignCurve"],
["function", "alignSurface"],
["function", "allViewFit"],
["function", "ambientLight"],
["function", "angle"],
["function", "angleBetween"],
["function", "animCone"],
["function", "animCurveEditor"],
["function", "animDisplay"],
["function", "animView"],
["function", "annotate"],
["function", "appendStringArray"],
["function", "applicationName"],
["function", "applyAttrPreset"],
["function", "applyTake"],
["function", "arcLenDimContext"],
["function", "arcLengthDimension"],
["function", "arclen"],
["function", "arrayMapper"],
["function", "art3dPaintCtx"],
["function", "artAttrCtx"],
["function", "artAttrPaintVertexCtx"],
["function", "artAttrSkinPaintCtx"],
["function", "artAttrTool"],
["function", "artBuildPaintMenu"],
["function", "artFluidAttrCtx"],
["function", "artPuttyCtx"],
["function", "artSelectCtx"],
["function", "artSetPaintCtx"],
["function", "artUserPaintCtx"],
["function", "assignCommand"],
["function", "assignInputDevice"],
["function", "assignViewportFactories"],
["function", "attachCurve"],
["function", "attachDeviceAttr"],
["function", "attachSurface"],
["function", "attrColorSliderGrp"],
["function", "attrCompatibility"],
["function", "attrControlGrp"],
["function", "attrEnumOptionMenu"],
["function", "attrEnumOptionMenuGrp"],
["function", "attrFieldGrp"],
["function", "attrFieldSliderGrp"],
["function", "attrNavigationControlGrp"],
["function", "attrPresetEditWin"],
["function", "attributeExists"],
["function", "attributeInfo"],
["function", "attributeMenu"],
["function", "attributeQuery"],
["function", "autoKeyframe"],
["function", "autoPlace"],
["function", "bakeClip"],
["function", "bakeFluidShading"],
["function", "bakePartialHistory"],
["function", "bakeResults"],
["function", "bakeSimulation"],
["function", "basename"],
["function", "basenameEx"],
["function", "batchRender"],
["function", "bessel"],
["function", "bevel"],
["function", "bevelPlus"],
["function", "binMembership"],
["function", "bindSkin"],
["function", "blend2"],
["function", "blendShape"],
["function", "blendShapeEditor"],
["function", "blendShapePanel"],
["function", "blendTwoAttr"],
["function", "blindDataType"],
["function", "boneLattice"],
["function", "boundary"],
["function", "boxDollyCtx"],
["function", "boxZoomCtx"],
["function", "bufferCurve"],
["function", "buildBookmarkMenu"],
["function", "buildKeyframeMenu"],
["function", "button"],
["function", "buttonManip"],
["function", "CBG"],
["function", "cacheFile"],
["function", "cacheFileCombine"],
["function", "cacheFileMerge"],
["function", "cacheFileTrack"],
["function", "camera"],
["function", "cameraView"],
["function", "canCreateManip"],
["function", "canvas"],
["function", "capitalizeString"],
["function", "catch"],
["function", "catchQuiet"],
["function", "ceil"],
["function", "changeSubdivComponentDisplayLevel"],
["function", "changeSubdivRegion"],
["function", "channelBox"],
["function", "character"],
["function", "characterMap"],
["function", "characterOutlineEditor"],
["function", "characterize"],
["function", "chdir"],
["function", "checkBox"],
["function", "checkBoxGrp"],
["function", "checkDefaultRenderGlobals"],
["function", "choice"],
["function", "circle"],
["function", "circularFillet"],
["function", "clamp"],
["function", "clear"],
["function", "clearCache"],
["function", "clip"],
["function", "clipEditor"],
["function", "clipEditorCurrentTimeCtx"],
["function", "clipSchedule"],
["function", "clipSchedulerOutliner"],
["function", "clipTrimBefore"],
["function", "closeCurve"],
["function", "closeSurface"],
["function", "cluster"],
["function", "cmdFileOutput"],
["function", "cmdScrollFieldExecuter"],
["function", "cmdScrollFieldReporter"],
["function", "cmdShell"],
["function", "coarsenSubdivSelectionList"],
["function", "collision"],
["function", "color"],
["function", "colorAtPoint"],
["function", "colorEditor"],
["function", "colorIndex"],
["function", "colorIndexSliderGrp"],
["function", "colorSliderButtonGrp"],
["function", "colorSliderGrp"],
["function", "columnLayout"],
["function", "commandEcho"],
["function", "commandLine"],
["function", "commandPort"],
["function", "compactHairSystem"],
["function", "componentEditor"],
["function", "compositingInterop"],
["function", "computePolysetVolume"],
["function", "condition"],
["function", "cone"],
["function", "confirmDialog"],
["function", "connectAttr"],
["function", "connectControl"],
["function", "connectDynamic"],
["function", "connectJoint"],
["function", "connectionInfo"],
["function", "constrain"],
["function", "constrainValue"],
["function", "constructionHistory"],
["function", "container"],
["function", "containsMultibyte"],
["function", "contextInfo"],
["function", "control"],
["function", "convertFromOldLayers"],
["function", "convertIffToPsd"],
["function", "convertLightmap"],
["function", "convertSolidTx"],
["function", "convertTessellation"],
["function", "convertUnit"],
["function", "copyArray"],
["function", "copyFlexor"],
["function", "copyKey"],
["function", "copySkinWeights"],
["function", "cos"],
["function", "cpButton"],
["function", "cpCache"],
["function", "cpClothSet"],
["function", "cpCollision"],
["function", "cpConstraint"],
["function", "cpConvClothToMesh"],
["function", "cpForces"],
["function", "cpGetSolverAttr"],
["function", "cpPanel"],
["function", "cpProperty"],
["function", "cpRigidCollisionFilter"],
["function", "cpSeam"],
["function", "cpSetEdit"],
["function", "cpSetSolverAttr"],
["function", "cpSolver"],
["function", "cpSolverTypes"],
["function", "cpTool"],
["function", "cpUpdateClothUVs"],
["function", "createDisplayLayer"],
["function", "createDrawCtx"],
["function", "createEditor"],
["function", "createLayeredPsdFile"],
["function", "createMotionField"],
["function", "createNewShelf"],
["function", "createNode"],
["function", "createRenderLayer"],
["function", "createSubdivRegion"],
["function", "cross"],
["function", "crossProduct"],
["function", "ctxAbort"],
["function", "ctxCompletion"],
["function", "ctxEditMode"],
["function", "ctxTraverse"],
["function", "currentCtx"],
["function", "currentTime"],
["function", "currentTimeCtx"],
["function", "currentUnit"],
["function", "curve"],
["function", "curveAddPtCtx"],
["function", "curveCVCtx"],
["function", "curveEPCtx"],
["function", "curveEditorCtx"],
["function", "curveIntersect"],
["function", "curveMoveEPCtx"],
["function", "curveOnSurface"],
["function", "curveSketchCtx"],
["function", "cutKey"],
["function", "cycleCheck"],
["function", "cylinder"],
["function", "dagPose"],
["function", "date"],
["function", "defaultLightListCheckBox"],
["function", "defaultNavigation"],
["function", "defineDataServer"],
["function", "defineVirtualDevice"],
["function", "deformer"],
["function", "deg_to_rad"],
["function", "delete"],
["function", "deleteAttr"],
["function", "deleteShadingGroupsAndMaterials"],
["function", "deleteShelfTab"],
["function", "deleteUI"],
["function", "deleteUnusedBrushes"],
["function", "delrandstr"],
["function", "detachCurve"],
["function", "detachDeviceAttr"],
["function", "detachSurface"],
["function", "deviceEditor"],
["function", "devicePanel"],
["function", "dgInfo"],
["function", "dgdirty"],
["function", "dgeval"],
["function", "dgtimer"],
["function", "dimWhen"],
["function", "directKeyCtx"],
["function", "directionalLight"],
["function", "dirmap"],
["function", "dirname"],
["function", "disable"],
["function", "disconnectAttr"],
["function", "disconnectJoint"],
["function", "diskCache"],
["function", "displacementToPoly"],
["function", "displayAffected"],
["function", "displayColor"],
["function", "displayCull"],
["function", "displayLevelOfDetail"],
["function", "displayPref"],
["function", "displayRGBColor"],
["function", "displaySmoothness"],
["function", "displayStats"],
["function", "displayString"],
["function", "displaySurface"],
["function", "distanceDimContext"],
["function", "distanceDimension"],
["function", "doBlur"],
["function", "dolly"],
["function", "dollyCtx"],
["function", "dopeSheetEditor"],
["function", "dot"],
["function", "dotProduct"],
["function", "doubleProfileBirailSurface"],
["function", "drag"],
["function", "dragAttrContext"],
["function", "draggerContext"],
["function", "dropoffLocator"],
["function", "duplicate"],
["function", "duplicateCurve"],
["function", "duplicateSurface"],
["function", "dynCache"],
["function", "dynControl"],
["function", "dynExport"],
["function", "dynExpression"],
["function", "dynGlobals"],
["function", "dynPaintEditor"],
["function", "dynParticleCtx"],
["function", "dynPref"],
["function", "dynRelEdPanel"],
["function", "dynRelEditor"],
["function", "dynamicLoad"],
["function", "editAttrLimits"],
["function", "editDisplayLayerGlobals"],
["function", "editDisplayLayerMembers"],
["function", "editRenderLayerAdjustment"],
["function", "editRenderLayerGlobals"],
["function", "editRenderLayerMembers"],
["function", "editor"],
["function", "editorTemplate"],
["function", "effector"],
["function", "emit"],
["function", "emitter"],
["function", "enableDevice"],
["function", "encodeString"],
["function", "endString"],
["function", "endsWith"],
["function", "env"],
["function", "equivalent"],
["function", "equivalentTol"],
["function", "erf"],
["function", "error"],
["function", "eval"],
["function", "evalDeferred"],
["function", "evalEcho"],
["function", "event"],
["function", "exactWorldBoundingBox"],
["function", "exclusiveLightCheckBox"],
["function", "exec"],
["function", "executeForEachObject"],
["function", "exists"],
["function", "exp"],
["function", "expression"],
["function", "expressionEditorListen"],
["function", "extendCurve"],
["function", "extendSurface"],
["function", "extrude"],
["function", "fcheck"],
["function", "fclose"],
["function", "feof"],
["function", "fflush"],
["function", "fgetline"],
["function", "fgetword"],
["function", "file"],
["function", "fileBrowserDialog"],
["function", "fileDialog"],
["function", "fileExtension"],
["function", "fileInfo"],
["function", "filetest"],
["function", "filletCurve"],
["function", "filter"],
["function", "filterCurve"],
["function", "filterExpand"],
["function", "filterStudioImport"],
["function", "findAllIntersections"],
["function", "findAnimCurves"],
["function", "findKeyframe"],
["function", "findMenuItem"],
["function", "findRelatedSkinCluster"],
["function", "finder"],
["function", "firstParentOf"],
["function", "fitBspline"],
["function", "flexor"],
["function", "floatEq"],
["function", "floatField"],
["function", "floatFieldGrp"],
["function", "floatScrollBar"],
["function", "floatSlider"],
["function", "floatSlider2"],
["function", "floatSliderButtonGrp"],
["function", "floatSliderGrp"],
["function", "floor"],
["function", "flow"],
["function", "fluidCacheInfo"],
["function", "fluidEmitter"],
["function", "fluidVoxelInfo"],
["function", "flushUndo"],
["function", "fmod"],
["function", "fontDialog"],
["function", "fopen"],
["function", "formLayout"],
["function", "format"],
["function", "fprint"],
["function", "frameLayout"],
["function", "fread"],
["function", "freeFormFillet"],
["function", "frewind"],
["function", "fromNativePath"],
["function", "fwrite"],
["function", "gamma"],
["function", "gauss"],
["function", "geometryConstraint"],
["function", "getApplicationVersionAsFloat"],
["function", "getAttr"],
["function", "getClassification"],
["function", "getDefaultBrush"],
["function", "getFileList"],
["function", "getFluidAttr"],
["function", "getInputDeviceRange"],
["function", "getMayaPanelTypes"],
["function", "getModifiers"],
["function", "getPanel"],
["function", "getParticleAttr"],
["function", "getPluginResource"],
["function", "getenv"],
["function", "getpid"],
["function", "glRender"],
["function", "glRenderEditor"],
["function", "globalStitch"],
["function", "gmatch"],
["function", "goal"],
["function", "gotoBindPose"],
["function", "grabColor"],
["function", "gradientControl"],
["function", "gradientControlNoAttr"],
["function", "graphDollyCtx"],
["function", "graphSelectContext"],
["function", "graphTrackCtx"],
["function", "gravity"],
["function", "grid"],
["function", "gridLayout"],
["function", "group"],
["function", "groupObjectsByName"],
["function", "HfAddAttractorToAS"],
["function", "HfAssignAS"],
["function", "HfBuildEqualMap"],
["function", "HfBuildFurFiles"],
["function", "HfBuildFurImages"],
["function", "HfCancelAFR"],
["function", "HfConnectASToHF"],
["function", "HfCreateAttractor"],
["function", "HfDeleteAS"],
["function", "HfEditAS"],
["function", "HfPerformCreateAS"],
["function", "HfRemoveAttractorFromAS"],
["function", "HfSelectAttached"],
["function", "HfSelectAttractors"],
["function", "HfUnAssignAS"],
["function", "hardenPointCurve"],
["function", "hardware"],
["function", "hardwareRenderPanel"],
["function", "headsUpDisplay"],
["function", "headsUpMessage"],
["function", "help"],
["function", "helpLine"],
["function", "hermite"],
["function", "hide"],
["function", "hilite"],
["function", "hitTest"],
["function", "hotBox"],
["function", "hotkey"],
["function", "hotkeyCheck"],
["function", "hsv_to_rgb"],
["function", "hudButton"],
["function", "hudSlider"],
["function", "hudSliderButton"],
["function", "hwReflectionMap"],
["function", "hwRender"],
["function", "hwRenderLoad"],
["function", "hyperGraph"],
["function", "hyperPanel"],
["function", "hyperShade"],
["function", "hypot"],
["function", "iconTextButton"],
["function", "iconTextCheckBox"],
["function", "iconTextRadioButton"],
["function", "iconTextRadioCollection"],
["function", "iconTextScrollList"],
["function", "iconTextStaticLabel"],
["function", "ikHandle"],
["function", "ikHandleCtx"],
["function", "ikHandleDisplayScale"],
["function", "ikSolver"],
["function", "ikSplineHandleCtx"],
["function", "ikSystem"],
["function", "ikSystemInfo"],
["function", "ikfkDisplayMethod"],
["function", "illustratorCurves"],
["function", "image"],
["function", "imfPlugins"],
["function", "inheritTransform"],
["function", "insertJoint"],
["function", "insertJointCtx"],
["function", "insertKeyCtx"],
["function", "insertKnotCurve"],
["function", "insertKnotSurface"],
["function", "instance"],
["function", "instanceable"],
["function", "instancer"],
["function", "intField"],
["function", "intFieldGrp"],
["function", "intScrollBar"],
["function", "intSlider"],
["function", "intSliderGrp"],
["function", "interToUI"],
["function", "internalVar"],
["function", "intersect"],
["function", "iprEngine"],
["function", "isAnimCurve"],
["function", "isConnected"],
["function", "isDirty"],
["function", "isParentOf"],
["function", "isSameObject"],
["function", "isTrue"],
["function", "isValidObjectName"],
["function", "isValidString"],
["function", "isValidUiName"],
["function", "isolateSelect"],
["function", "itemFilter"],
["function", "itemFilterAttr"],
["function", "itemFilterRender"],
["function", "itemFilterType"],
["function", "joint"],
["function", "jointCluster"],
["function", "jointCtx"],
["function", "jointDisplayScale"],
["function", "jointLattice"],
["function", "keyTangent"],
["function", "keyframe"],
["function", "keyframeOutliner"],
["function", "keyframeRegionCurrentTimeCtx"],
["function", "keyframeRegionDirectKeyCtx"],
["function", "keyframeRegionDollyCtx"],
["function", "keyframeRegionInsertKeyCtx"],
["function", "keyframeRegionMoveKeyCtx"],
["function", "keyframeRegionScaleKeyCtx"],
["function", "keyframeRegionSelectKeyCtx"],
["function", "keyframeRegionSetKeyCtx"],
["function", "keyframeRegionTrackCtx"],
["function", "keyframeStats"],
["function", "lassoContext"],
["function", "lattice"],
["function", "latticeDeformKeyCtx"],
["function", "launch"],
["function", "launchImageEditor"],
["function", "layerButton"],
["function", "layeredShaderPort"],
["function", "layeredTexturePort"],
["function", "layout"],
["function", "layoutDialog"],
["function", "lightList"],
["function", "lightListEditor"],
["function", "lightListPanel"],
["function", "lightlink"],
["function", "lineIntersection"],
["function", "linearPrecision"],
["function", "linstep"],
["function", "listAnimatable"],
["function", "listAttr"],
["function", "listCameras"],
["function", "listConnections"],
["function", "listDeviceAttachments"],
["function", "listHistory"],
["function", "listInputDeviceAxes"],
["function", "listInputDeviceButtons"],
["function", "listInputDevices"],
["function", "listMenuAnnotation"],
["function", "listNodeTypes"],
["function", "listPanelCategories"],
["function", "listRelatives"],
["function", "listSets"],
["function", "listTransforms"],
["function", "listUnselected"],
["function", "listerEditor"],
["function", "loadFluid"],
["function", "loadNewShelf"],
["function", "loadPlugin"],
["function", "loadPluginLanguageResources"],
["function", "loadPrefObjects"],
["function", "localizedPanelLabel"],
["function", "lockNode"],
["function", "loft"],
["function", "log"],
["function", "longNameOf"],
["function", "lookThru"],
["function", "ls"],
["function", "lsThroughFilter"],
["function", "lsType"],
["function", "lsUI"],
["function", "Mayatomr"],
["function", "mag"],
["function", "makeIdentity"],
["function", "makeLive"],
["function", "makePaintable"],
["function", "makeRoll"],
["function", "makeSingleSurface"],
["function", "makeTubeOn"],
["function", "makebot"],
["function", "manipMoveContext"],
["function", "manipMoveLimitsCtx"],
["function", "manipOptions"],
["function", "manipRotateContext"],
["function", "manipRotateLimitsCtx"],
["function", "manipScaleContext"],
["function", "manipScaleLimitsCtx"],
["function", "marker"],
["function", "match"],
["function", "max"],
["function", "memory"],
["function", "menu"],
["function", "menuBarLayout"],
["function", "menuEditor"],
["function", "menuItem"],
["function", "menuItemToShelf"],
["function", "menuSet"],
["function", "menuSetPref"],
["function", "messageLine"],
["function", "min"],
["function", "minimizeApp"],
["function", "mirrorJoint"],
["function", "modelCurrentTimeCtx"],
["function", "modelEditor"],
["function", "modelPanel"],
["function", "mouse"],
["function", "movIn"],
["function", "movOut"],
["function", "move"],
["function", "moveIKtoFK"],
["function", "moveKeyCtx"],
["function", "moveVertexAlongDirection"],
["function", "multiProfileBirailSurface"],
["function", "mute"],
["function", "nParticle"],
["function", "nameCommand"],
["function", "nameField"],
["function", "namespace"],
["function", "namespaceInfo"],
["function", "newPanelItems"],
["function", "newton"],
["function", "nodeCast"],
["function", "nodeIconButton"],
["function", "nodeOutliner"],
["function", "nodePreset"],
["function", "nodeType"],
["function", "noise"],
["function", "nonLinear"],
["function", "normalConstraint"],
["function", "normalize"],
["function", "nurbsBoolean"],
["function", "nurbsCopyUVSet"],
["function", "nurbsCube"],
["function", "nurbsEditUV"],
["function", "nurbsPlane"],
["function", "nurbsSelect"],
["function", "nurbsSquare"],
["function", "nurbsToPoly"],
["function", "nurbsToPolygonsPref"],
["function", "nurbsToSubdiv"],
["function", "nurbsToSubdivPref"],
["function", "nurbsUVSet"],
["function", "nurbsViewDirectionVector"],
["function", "objExists"],
["function", "objectCenter"],
["function", "objectLayer"],
["function", "objectType"],
["function", "objectTypeUI"],
["function", "obsoleteProc"],
["function", "oceanNurbsPreviewPlane"],
["function", "offsetCurve"],
["function", "offsetCurveOnSurface"],
["function", "offsetSurface"],
["function", "openGLExtension"],
["function", "openMayaPref"],
["function", "optionMenu"],
["function", "optionMenuGrp"],
["function", "optionVar"],
["function", "orbit"],
["function", "orbitCtx"],
["function", "orientConstraint"],
["function", "outlinerEditor"],
["function", "outlinerPanel"],
["function", "overrideModifier"],
["function", "paintEffectsDisplay"],
["function", "pairBlend"],
["function", "palettePort"],
["function", "paneLayout"],
["function", "panel"],
["function", "panelConfiguration"],
["function", "panelHistory"],
["function", "paramDimContext"],
["function", "paramDimension"],
["function", "paramLocator"],
["function", "parent"],
["function", "parentConstraint"],
["function", "particle"],
["function", "particleExists"],
["function", "particleInstancer"],
["function", "particleRenderInfo"],
["function", "partition"],
["function", "pasteKey"],
["function", "pathAnimation"],
["function", "pause"],
["function", "pclose"],
["function", "percent"],
["function", "performanceOptions"],
["function", "pfxstrokes"],
["function", "pickWalk"],
["function", "picture"],
["function", "pixelMove"],
["function", "planarSrf"],
["function", "plane"],
["function", "play"],
["function", "playbackOptions"],
["function", "playblast"],
["function", "plugAttr"],
["function", "plugNode"],
["function", "pluginInfo"],
["function", "pluginResourceUtil"],
["function", "pointConstraint"],
["function", "pointCurveConstraint"],
["function", "pointLight"],
["function", "pointMatrixMult"],
["function", "pointOnCurve"],
["function", "pointOnSurface"],
["function", "pointPosition"],
["function", "poleVectorConstraint"],
["function", "polyAppend"],
["function", "polyAppendFacetCtx"],
["function", "polyAppendVertex"],
["function", "polyAutoProjection"],
["function", "polyAverageNormal"],
["function", "polyAverageVertex"],
["function", "polyBevel"],
["function", "polyBlendColor"],
["function", "polyBlindData"],
["function", "polyBoolOp"],
["function", "polyBridgeEdge"],
["function", "polyCacheMonitor"],
["function", "polyCheck"],
["function", "polyChipOff"],
["function", "polyClipboard"],
["function", "polyCloseBorder"],
["function", "polyCollapseEdge"],
["function", "polyCollapseFacet"],
["function", "polyColorBlindData"],
["function", "polyColorDel"],
["function", "polyColorPerVertex"],
["function", "polyColorSet"],
["function", "polyCompare"],
["function", "polyCone"],
["function", "polyCopyUV"],
["function", "polyCrease"],
["function", "polyCreaseCtx"],
["function", "polyCreateFacet"],
["function", "polyCreateFacetCtx"],
["function", "polyCube"],
["function", "polyCut"],
["function", "polyCutCtx"],
["function", "polyCylinder"],
["function", "polyCylindricalProjection"],
["function", "polyDelEdge"],
["function", "polyDelFacet"],
["function", "polyDelVertex"],
["function", "polyDuplicateAndConnect"],
["function", "polyDuplicateEdge"],
["function", "polyEditUV"],
["function", "polyEditUVShell"],
["function", "polyEvaluate"],
["function", "polyExtrudeEdge"],
["function", "polyExtrudeFacet"],
["function", "polyExtrudeVertex"],
["function", "polyFlipEdge"],
["function", "polyFlipUV"],
["function", "polyForceUV"],
["function", "polyGeoSampler"],
["function", "polyHelix"],
["function", "polyInfo"],
["function", "polyInstallAction"],
["function", "polyLayoutUV"],
["function", "polyListComponentConversion"],
["function", "polyMapCut"],
["function", "polyMapDel"],
["function", "polyMapSew"],
["function", "polyMapSewMove"],
["function", "polyMergeEdge"],
["function", "polyMergeEdgeCtx"],
["function", "polyMergeFacet"],
["function", "polyMergeFacetCtx"],
["function", "polyMergeUV"],
["function", "polyMergeVertex"],
["function", "polyMirrorFace"],
["function", "polyMoveEdge"],
["function", "polyMoveFacet"],
["function", "polyMoveFacetUV"],
["function", "polyMoveUV"],
["function", "polyMoveVertex"],
["function", "polyNormal"],
["function", "polyNormalPerVertex"],
["function", "polyNormalizeUV"],
["function", "polyOptUvs"],
["function", "polyOptions"],
["function", "polyOutput"],
["function", "polyPipe"],
["function", "polyPlanarProjection"],
["function", "polyPlane"],
["function", "polyPlatonicSolid"],
["function", "polyPoke"],
["function", "polyPrimitive"],
["function", "polyPrism"],
["function", "polyProjection"],
["function", "polyPyramid"],
["function", "polyQuad"],
["function", "polyQueryBlindData"],
["function", "polyReduce"],
["function", "polySelect"],
["function", "polySelectConstraint"],
["function", "polySelectConstraintMonitor"],
["function", "polySelectCtx"],
["function", "polySelectEditCtx"],
["function", "polySeparate"],
["function", "polySetToFaceNormal"],
["function", "polySewEdge"],
["function", "polyShortestPathCtx"],
["function", "polySmooth"],
["function", "polySoftEdge"],
["function", "polySphere"],
["function", "polySphericalProjection"],
["function", "polySplit"],
["function", "polySplitCtx"],
["function", "polySplitEdge"],
["function", "polySplitRing"],
["function", "polySplitVertex"],
["function", "polyStraightenUVBorder"],
["function", "polySubdivideEdge"],
["function", "polySubdivideFacet"],
["function", "polyToSubdiv"],
["function", "polyTorus"],
["function", "polyTransfer"],
["function", "polyTriangulate"],
["function", "polyUVSet"],
["function", "polyUnite"],
["function", "polyWedgeFace"],
["function", "popen"],
["function", "popupMenu"],
["function", "pose"],
["function", "pow"],
["function", "preloadRefEd"],
["function", "print"],
["function", "progressBar"],
["function", "progressWindow"],
["function", "projFileViewer"],
["function", "projectCurve"],
["function", "projectTangent"],
["function", "projectionContext"],
["function", "projectionManip"],
["function", "promptDialog"],
["function", "propModCtx"],
["function", "propMove"],
["function", "psdChannelOutliner"],
["function", "psdEditTextureFile"],
["function", "psdExport"],
["function", "psdTextureFile"],
["function", "putenv"],
["function", "pwd"],
["function", "python"],
["function", "querySubdiv"],
["function", "quit"],
["function", "rad_to_deg"],
["function", "radial"],
["function", "radioButton"],
["function", "radioButtonGrp"],
["function", "radioCollection"],
["function", "radioMenuItemCollection"],
["function", "rampColorPort"],
["function", "rand"],
["function", "randomizeFollicles"],
["function", "randstate"],
["function", "rangeControl"],
["function", "readTake"],
["function", "rebuildCurve"],
["function", "rebuildSurface"],
["function", "recordAttr"],
["function", "recordDevice"],
["function", "redo"],
["function", "reference"],
["function", "referenceEdit"],
["function", "referenceQuery"],
["function", "refineSubdivSelectionList"],
["function", "refresh"],
["function", "refreshAE"],
["function", "registerPluginResource"],
["function", "rehash"],
["function", "reloadImage"],
["function", "removeJoint"],
["function", "removeMultiInstance"],
["function", "removePanelCategory"],
["function", "rename"],
["function", "renameAttr"],
["function", "renameSelectionList"],
["function", "renameUI"],
["function", "render"],
["function", "renderGlobalsNode"],
["function", "renderInfo"],
["function", "renderLayerButton"],
["function", "renderLayerParent"],
["function", "renderLayerPostProcess"],
["function", "renderLayerUnparent"],
["function", "renderManip"],
["function", "renderPartition"],
["function", "renderQualityNode"],
["function", "renderSettings"],
["function", "renderThumbnailUpdate"],
["function", "renderWindowEditor"],
["function", "renderWindowSelectContext"],
["function", "renderer"],
["function", "reorder"],
["function", "reorderDeformers"],
["function", "requires"],
["function", "reroot"],
["function", "resampleFluid"],
["function", "resetAE"],
["function", "resetPfxToPolyCamera"],
["function", "resetTool"],
["function", "resolutionNode"],
["function", "retarget"],
["function", "reverseCurve"],
["function", "reverseSurface"],
["function", "revolve"],
["function", "rgb_to_hsv"],
["function", "rigidBody"],
["function", "rigidSolver"],
["function", "roll"],
["function", "rollCtx"],
["function", "rootOf"],
["function", "rot"],
["function", "rotate"],
["function", "rotationInterpolation"],
["function", "roundConstantRadius"],
["function", "rowColumnLayout"],
["function", "rowLayout"],
["function", "runTimeCommand"],
["function", "runup"],
["function", "sampleImage"],
["function", "saveAllShelves"],
["function", "saveAttrPreset"],
["function", "saveFluid"],
["function", "saveImage"],
["function", "saveInitialState"],
["function", "saveMenu"],
["function", "savePrefObjects"],
["function", "savePrefs"],
["function", "saveShelf"],
["function", "saveToolSettings"],
["function", "scale"],
["function", "scaleBrushBrightness"],
["function", "scaleComponents"],
["function", "scaleConstraint"],
["function", "scaleKey"],
["function", "scaleKeyCtx"],
["function", "sceneEditor"],
["function", "sceneUIReplacement"],
["function", "scmh"],
["function", "scriptCtx"],
["function", "scriptEditorInfo"],
["function", "scriptJob"],
["function", "scriptNode"],
["function", "scriptTable"],
["function", "scriptToShelf"],
["function", "scriptedPanel"],
["function", "scriptedPanelType"],
["function", "scrollField"],
["function", "scrollLayout"],
["function", "sculpt"],
["function", "searchPathArray"],
["function", "seed"],
["function", "selLoadSettings"],
["function", "select"],
["function", "selectContext"],
["function", "selectCurveCV"],
["function", "selectKey"],
["function", "selectKeyCtx"],
["function", "selectKeyframeRegionCtx"],
["function", "selectMode"],
["function", "selectPref"],
["function", "selectPriority"],
["function", "selectType"],
["function", "selectedNodes"],
["function", "selectionConnection"],
["function", "separator"],
["function", "setAttr"],
["function", "setAttrEnumResource"],
["function", "setAttrMapping"],
["function", "setAttrNiceNameResource"],
["function", "setConstraintRestPosition"],
["function", "setDefaultShadingGroup"],
["function", "setDrivenKeyframe"],
["function", "setDynamic"],
["function", "setEditCtx"],
["function", "setEditor"],
["function", "setFluidAttr"],
["function", "setFocus"],
["function", "setInfinity"],
["function", "setInputDeviceMapping"],
["function", "setKeyCtx"],
["function", "setKeyPath"],
["function", "setKeyframe"],
["function", "setKeyframeBlendshapeTargetWts"],
["function", "setMenuMode"],
["function", "setNodeNiceNameResource"],
["function", "setNodeTypeFlag"],
["function", "setParent"],
["function", "setParticleAttr"],
["function", "setPfxToPolyCamera"],
["function", "setPluginResource"],
["function", "setProject"],
["function", "setStampDensity"],
["function", "setStartupMessage"],
["function", "setState"],
["function", "setToolTo"],
["function", "setUITemplate"],
["function", "setXformManip"],
["function", "sets"],
["function", "shadingConnection"],
["function", "shadingGeometryRelCtx"],
["function", "shadingLightRelCtx"],
["function", "shadingNetworkCompare"],
["function", "shadingNode"],
["function", "shapeCompare"],
["function", "shelfButton"],
["function", "shelfLayout"],
["function", "shelfTabLayout"],
["function", "shellField"],
["function", "shortNameOf"],
["function", "showHelp"],
["function", "showHidden"],
["function", "showManipCtx"],
["function", "showSelectionInTitle"],
["function", "showShadingGroupAttrEditor"],
["function", "showWindow"],
["function", "sign"],
["function", "simplify"],
["function", "sin"],
["function", "singleProfileBirailSurface"],
["function", "size"],
["function", "sizeBytes"],
["function", "skinCluster"],
["function", "skinPercent"],
["function", "smoothCurve"],
["function", "smoothTangentSurface"],
["function", "smoothstep"],
["function", "snap2to2"],
["function", "snapKey"],
["function", "snapMode"],
["function", "snapTogetherCtx"],
["function", "snapshot"],
["function", "soft"],
["function", "softMod"],
["function", "softModCtx"],
["function", "sort"],
["function", "sound"],
["function", "soundControl"],
["function", "source"],
["function", "spaceLocator"],
["function", "sphere"],
["function", "sphrand"],
["function", "spotLight"],
["function", "spotLightPreviewPort"],
["function", "spreadSheetEditor"],
["function", "spring"],
["function", "sqrt"],
["function", "squareSurface"],
["function", "srtContext"],
["function", "stackTrace"],
["function", "startString"],
["function", "startsWith"],
["function", "stitchAndExplodeShell"],
["function", "stitchSurface"],
["function", "stitchSurfacePoints"],
["function", "strcmp"],
["function", "stringArrayCatenate"],
["function", "stringArrayContains"],
["function", "stringArrayCount"],
["function", "stringArrayInsertAtIndex"],
["function", "stringArrayIntersector"],
["function", "stringArrayRemove"],
["function", "stringArrayRemoveAtIndex"],
["function", "stringArrayRemoveDuplicates"],
["function", "stringArrayRemoveExact"],
["function", "stringArrayToString"],
["function", "stringToStringArray"],
["function", "strip"],
["function", "stripPrefixFromName"],
["function", "stroke"],
["function", "subdAutoProjection"],
["function", "subdCleanTopology"],
["function", "subdCollapse"],
["function", "subdDuplicateAndConnect"],
["function", "subdEditUV"],
["function", "subdListComponentConversion"],
["function", "subdMapCut"],
["function", "subdMapSewMove"],
["function", "subdMatchTopology"],
["function", "subdMirror"],
["function", "subdToBlind"],
["function", "subdToPoly"],
["function", "subdTransferUVsToCache"],
["function", "subdiv"],
["function", "subdivCrease"],
["function", "subdivDisplaySmoothness"],
["function", "substitute"],
["function", "substituteAllString"],
["function", "substituteGeometry"],
["function", "substring"],
["function", "surface"],
["function", "surfaceSampler"],
["function", "surfaceShaderList"],
["function", "swatchDisplayPort"],
["function", "switchTable"],
["function", "symbolButton"],
["function", "symbolCheckBox"],
["function", "sysFile"],
["function", "system"],
["function", "tabLayout"],
["function", "tan"],
["function", "tangentConstraint"],
["function", "texLatticeDeformContext"],
["function", "texManipContext"],
["function", "texMoveContext"],
["function", "texMoveUVShellContext"],
["function", "texRotateContext"],
["function", "texScaleContext"],
["function", "texSelectContext"],
["function", "texSelectShortestPathCtx"],
["function", "texSmudgeUVContext"],
["function", "texWinToolCtx"],
["function", "text"],
["function", "textCurves"],
["function", "textField"],
["function", "textFieldButtonGrp"],
["function", "textFieldGrp"],
["function", "textManip"],
["function", "textScrollList"],
["function", "textToShelf"],
["function", "textureDisplacePlane"],
["function", "textureHairColor"],
["function", "texturePlacementContext"],
["function", "textureWindow"],
["function", "threadCount"],
["function", "threePointArcCtx"],
["function", "timeControl"],
["function", "timePort"],
["function", "timerX"],
["function", "toNativePath"],
["function", "toggle"],
["function", "toggleAxis"],
["function", "toggleWindowVisibility"],
["function", "tokenize"],
["function", "tokenizeList"],
["function", "tolerance"],
["function", "tolower"],
["function", "toolButton"],
["function", "toolCollection"],
["function", "toolDropped"],
["function", "toolHasOptions"],
["function", "toolPropertyWindow"],
["function", "torus"],
["function", "toupper"],
["function", "trace"],
["function", "track"],
["function", "trackCtx"],
["function", "transferAttributes"],
["function", "transformCompare"],
["function", "transformLimits"],
["function", "translator"],
["function", "trim"],
["function", "trunc"],
["function", "truncateFluidCache"],
["function", "truncateHairCache"],
["function", "tumble"],
["function", "tumbleCtx"],
["function", "turbulence"],
["function", "twoPointArcCtx"],
["function", "uiRes"],
["function", "uiTemplate"],
["function", "unassignInputDevice"],
["function", "undo"],
["function", "undoInfo"],
["function", "ungroup"],
["function", "uniform"],
["function", "unit"],
["function", "unloadPlugin"],
["function", "untangleUV"],
["function", "untitledFileName"],
["function", "untrim"],
["function", "upAxis"],
["function", "updateAE"],
["function", "userCtx"],
["function", "uvLink"],
["function", "uvSnapshot"],
["function", "validateShelfName"],
["function", "vectorize"],
["function", "view2dToolCtx"],
["function", "viewCamera"],
["function", "viewClipPlane"],
["function", "viewFit"],
["function", "viewHeadOn"],
["function", "viewLookAt"],
["function", "viewManip"],
["function", "viewPlace"],
["function", "viewSet"],
["function", "visor"],
["function", "volumeAxis"],
["function", "vortex"],
["function", "waitCursor"],
["function", "warning"],
["function", "webBrowser"],
["function", "webBrowserPrefs"],
["function", "whatIs"],
["function", "window"],
["function", "windowPref"],
["function", "wire"],
["function", "wireContext"],
["function", "workspace"],
["function", "wrinkle"],
["function", "wrinkleContext"],
["function", "writeTake"],
["function", "xbmLangPathList"],
["function", "xform"]
]
----------------------------------------------------
Checks for functions. | {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package com.sun.enterprise.security.auth.realm.file;
import java.util.*;
import com.sun.enterprise.security.auth.realm.NoSuchRealmException;
import com.sun.enterprise.security.auth.realm.Realm;
import com.sun.enterprise.security.auth.realm.User;
import org.glassfish.security.common.FileRealmHelper;
/**
* Represents a FileRealm user.
*
*
*/
public class FileRealmUser implements User
{
FileRealmHelper.User user;
Hashtable attributes = new Hashtable();
String realm;
/**
* Constructor.
*
*/
public FileRealmUser(FileRealmHelper.User user, String realm)
{
this.user = user;
this.realm = realm;
}
public String[] getGroups() {
return user.getGroups();
}
/**
* Returns the realm with which this user is associated
*
* @return Realm name.
* @exception NoSuchRealmException if the realm associated this user
* no longer exist
*
*/
@Override
public Realm getRealm() throws NoSuchRealmException
{
return Realm.getInstance(realm);
}
/**
* Return the requested attribute for the user.
* <P>Not really needed.
*
* @param key string identifies the attribute.
*/
@Override
public Object getAttribute (String key)
{
return attributes.get(key);
}
/**
* Return the names of the supported attributes for this user.
* <P>Not really needed.
*/
@Override
public Enumeration getAttributeNames () {
return attributes.keys();
}
@Override
public String getName() {
return user.getName();
}
}
| {
"pile_set_name": "Github"
} |
package main
import (
"context"
"fmt"
"os"
"path/filepath"
"sync"
"time"
"github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options"
"github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/stats"
"github.com/Microsoft/hcsshim/internal/cmd"
"github.com/Microsoft/hcsshim/internal/cow"
"github.com/Microsoft/hcsshim/internal/hcs"
"github.com/Microsoft/hcsshim/internal/hcsoci"
"github.com/Microsoft/hcsshim/internal/log"
"github.com/Microsoft/hcsshim/internal/oci"
"github.com/Microsoft/hcsshim/internal/resources"
"github.com/Microsoft/hcsshim/internal/schema1"
hcsschema "github.com/Microsoft/hcsshim/internal/schema2"
"github.com/Microsoft/hcsshim/internal/shimdiag"
"github.com/Microsoft/hcsshim/internal/uvm"
"github.com/Microsoft/hcsshim/osversion"
eventstypes "github.com/containerd/containerd/api/events"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/runtime"
"github.com/containerd/containerd/runtime/v2/task"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"go.opencensus.io/trace"
)
func newHcsStandaloneTask(ctx context.Context, events publisher, req *task.CreateTaskRequest, s *specs.Spec) (shimTask, error) {
log.G(ctx).WithField("tid", req.ID).Debug("newHcsStandaloneTask")
ct, _, err := oci.GetSandboxTypeAndID(s.Annotations)
if err != nil {
return nil, err
}
if ct != oci.KubernetesContainerTypeNone {
return nil, errors.Wrapf(
errdefs.ErrFailedPrecondition,
"cannot create standalone task, expected no annotation: '%s': got '%s'",
oci.KubernetesContainerTypeAnnotation,
ct)
}
owner := filepath.Base(os.Args[0])
var parent *uvm.UtilityVM
if osversion.Get().Build >= osversion.RS5 && oci.IsIsolated(s) {
// Create the UVM parent
opts, err := oci.SpecToUVMCreateOpts(ctx, s, fmt.Sprintf("%s@vm", req.ID), owner)
if err != nil {
return nil, err
}
switch opts.(type) {
case *uvm.OptionsLCOW:
lopts := (opts).(*uvm.OptionsLCOW)
parent, err = uvm.CreateLCOW(ctx, lopts)
if err != nil {
return nil, err
}
case *uvm.OptionsWCOW:
wopts := (opts).(*uvm.OptionsWCOW)
// In order for the UVM sandbox.vhdx not to collide with the actual
// nested Argon sandbox.vhdx we append the \vm folder to the last
// entry in the list.
layersLen := len(s.Windows.LayerFolders)
layers := make([]string, layersLen)
copy(layers, s.Windows.LayerFolders)
vmPath := filepath.Join(layers[layersLen-1], "vm")
err := os.MkdirAll(vmPath, 0)
if err != nil {
return nil, err
}
layers[layersLen-1] = vmPath
wopts.LayerFolders = layers
parent, err = uvm.CreateWCOW(ctx, wopts)
if err != nil {
return nil, err
}
}
err = parent.Start(ctx)
if err != nil {
parent.Close()
}
} else if !oci.IsWCOW(s) {
return nil, errors.Wrap(errdefs.ErrFailedPrecondition, "oci spec does not contain WCOW or LCOW spec")
}
shim, err := newHcsTask(ctx, events, parent, true, req, s)
if err != nil {
if parent != nil {
parent.Close()
}
return nil, err
}
return shim, nil
}
// newHcsTask creates a container within `parent` and its init exec process in
// the `shimExecCreated` state and returns the task that tracks its lifetime.
//
// If `parent == nil` the container is created on the host.
func newHcsTask(
ctx context.Context,
events publisher,
parent *uvm.UtilityVM,
ownsParent bool,
req *task.CreateTaskRequest,
s *specs.Spec) (_ shimTask, err error) {
log.G(ctx).WithFields(logrus.Fields{
"tid": req.ID,
"ownsParent": ownsParent,
}).Debug("newHcsTask")
owner := filepath.Base(os.Args[0])
io, err := cmd.NewNpipeIO(ctx, req.Stdin, req.Stdout, req.Stderr, req.Terminal)
if err != nil {
return nil, err
}
var netNS string
if s.Windows != nil &&
s.Windows.Network != nil {
netNS = s.Windows.Network.NetworkNamespace
}
opts := hcsoci.CreateOptions{
ID: req.ID,
Owner: owner,
Spec: s,
HostingSystem: parent,
NetworkNamespace: netNS,
}
system, resources, err := hcsoci.CreateContainer(ctx, &opts)
if err != nil {
return nil, err
}
ht := &hcsTask{
events: events,
id: req.ID,
isWCOW: oci.IsWCOW(s),
c: system,
cr: resources,
ownsHost: ownsParent,
host: parent,
closed: make(chan struct{}),
}
ht.init = newHcsExec(
ctx,
events,
req.ID,
parent,
system,
req.ID,
req.Bundle,
ht.isWCOW,
s.Process,
io)
if parent != nil {
// We have a parent UVM. Listen for its exit and forcibly close this
// task. This is not expected but in the event of a UVM crash we need to
// handle this case.
go ht.waitForHostExit()
}
// In the normal case the `Signal` call from the caller killed this task's
// init process.
go ht.waitInitExit()
// Publish the created event
ht.events.publishEvent(
ctx,
runtime.TaskCreateEventTopic,
&eventstypes.TaskCreate{
ContainerID: req.ID,
Bundle: req.Bundle,
Rootfs: req.Rootfs,
IO: &eventstypes.TaskIO{
Stdin: req.Stdin,
Stdout: req.Stdout,
Stderr: req.Stderr,
Terminal: req.Terminal,
},
Checkpoint: "",
Pid: uint32(ht.init.Pid()),
})
return ht, nil
}
var _ = (shimTask)(&hcsTask{})
// hcsTask is a generic task that represents a WCOW Container (process or
// hypervisor isolated), or a LCOW Container. This task MAY own the UVM the
// container is in but in the case of a POD it may just track the UVM for
// container lifetime management. In the case of ownership when the init
// task/exec is stopped the UVM itself will be stopped as well.
type hcsTask struct {
events publisher
// id is the id of this task when it is created.
//
// It MUST be treated as read only in the liftetime of the task.
id string
// isWCOW is set to `true` if this is a task representing a Windows container.
//
// It MUST be treated as read only in the liftetime of the task.
isWCOW bool
// c is the container backing this task.
//
// It MUST be treated as read only in the lifetime of this task EXCEPT after
// a Kill to the init task in which it must be shutdown.
c cow.Container
// cr is the container resources this task is holding.
//
// It MUST be treated as read only in the lifetime of this task EXCEPT after
// a Kill to the init task in which all resources must be released.
cr *resources.Resources
// init is the init process of the container.
//
// Note: the invariant `container state == init.State()` MUST be true. IE:
// if the init process exits the container as a whole and all exec's MUST
// exit.
//
// It MUST be treated as read only in the lifetime of the task.
init shimExec
// ownsHost is `true` if this task owns `host`. If so when this tasks init
// exec shuts down it is required that `host` be shut down as well.
ownsHost bool
// host is the hosting VM for this exec if hypervisor isolated. If
// `host==nil` this is an Argon task so no UVM cleanup is required.
//
// NOTE: if `osversion.Get().Build < osversion.RS5` this will always be
// `nil`.
host *uvm.UtilityVM
// ecl is the exec create lock for all non-init execs and MUST be held
// durring create to prevent ID duplication.
ecl sync.Mutex
execs sync.Map
closed chan struct{}
closeOnce sync.Once
// closeHostOnce is used to close `host`. This will only be used if
// `ownsHost==true` and `host != nil`.
closeHostOnce sync.Once
}
func (ht *hcsTask) ID() string {
return ht.id
}
func (ht *hcsTask) CreateExec(ctx context.Context, req *task.ExecProcessRequest, spec *specs.Process) error {
ht.ecl.Lock()
defer ht.ecl.Unlock()
// If the task exists or we got a request for "" which is the init task
// fail.
if _, loaded := ht.execs.Load(req.ExecID); loaded || req.ExecID == "" {
return errors.Wrapf(errdefs.ErrAlreadyExists, "exec: '%s' in task: '%s' already exists", req.ExecID, ht.id)
}
if ht.init.State() != shimExecStateRunning {
return errors.Wrapf(errdefs.ErrFailedPrecondition, "exec: '' in task: '%s' must be running to create additional execs", ht.id)
}
io, err := cmd.NewNpipeIO(ctx, req.Stdin, req.Stdout, req.Stderr, req.Terminal)
if err != nil {
return err
}
he := newHcsExec(ctx, ht.events, ht.id, ht.host, ht.c, req.ExecID, ht.init.Status().Bundle, ht.isWCOW, spec, io)
ht.execs.Store(req.ExecID, he)
// Publish the created event
ht.events.publishEvent(
ctx,
runtime.TaskExecAddedEventTopic,
&eventstypes.TaskExecAdded{
ContainerID: ht.id,
ExecID: req.ExecID,
})
return nil
}
func (ht *hcsTask) GetExec(eid string) (shimExec, error) {
if eid == "" {
return ht.init, nil
}
raw, loaded := ht.execs.Load(eid)
if !loaded {
return nil, errors.Wrapf(errdefs.ErrNotFound, "exec: '%s' in task: '%s' not found", eid, ht.id)
}
return raw.(shimExec), nil
}
func (ht *hcsTask) KillExec(ctx context.Context, eid string, signal uint32, all bool) error {
e, err := ht.GetExec(eid)
if err != nil {
return err
}
if all && eid != "" {
return errors.Wrapf(errdefs.ErrFailedPrecondition, "cannot signal all for non-empty exec: '%s'", eid)
}
if all {
// We are in a kill all on the init task. Signal everything.
ht.execs.Range(func(key, value interface{}) bool {
err := value.(shimExec).Kill(ctx, signal)
if err != nil {
log.G(ctx).WithFields(logrus.Fields{
"eid": key,
logrus.ErrorKey: err,
}).Warn("failed to kill exec in task")
}
// iterate all
return false
})
}
if signal == 0x9 && eid == "" && ht.host != nil {
// If this is a SIGKILL against the init process we start a background
// timer and wait on either the timer expiring or the process exiting
// cleanly. If the timer exires first we forcibly close the UVM as we
// assume the guest is misbehaving for some reason.
go func() {
t := time.NewTimer(30 * time.Second)
execExited := make(chan struct{})
go func() {
e.Wait()
close(execExited)
}()
select {
case <-execExited:
t.Stop()
case <-t.C:
// Safe to call multiple times if called previously on
// successful shutdown.
ht.host.Close()
}
}()
}
return e.Kill(ctx, signal)
}
func (ht *hcsTask) DeleteExec(ctx context.Context, eid string) (int, uint32, time.Time, error) {
e, err := ht.GetExec(eid)
if err != nil {
return 0, 0, time.Time{}, err
}
if eid == "" {
// We are deleting the init exec. Forcibly exit any additional exec's.
ht.execs.Range(func(key, value interface{}) bool {
ex := value.(shimExec)
if s := ex.State(); s != shimExecStateExited {
ex.ForceExit(ctx, 1)
}
// iterate next
return false
})
}
switch state := e.State(); state {
case shimExecStateCreated:
e.ForceExit(ctx, 0)
case shimExecStateRunning:
return 0, 0, time.Time{}, newExecInvalidStateError(ht.id, eid, state, "delete")
}
status := e.Status()
if eid != "" {
ht.execs.Delete(eid)
}
// Publish the deleted event
ht.events.publishEvent(
ctx,
runtime.TaskDeleteEventTopic,
&eventstypes.TaskDelete{
ContainerID: ht.id,
ID: eid,
Pid: status.Pid,
ExitStatus: status.ExitStatus,
ExitedAt: status.ExitedAt,
})
return int(status.Pid), status.ExitStatus, status.ExitedAt, nil
}
func (ht *hcsTask) Pids(ctx context.Context) ([]options.ProcessDetails, error) {
// Map all user created exec's to pid/exec-id
pidMap := make(map[int]string)
ht.execs.Range(func(key, value interface{}) bool {
ex := value.(shimExec)
pidMap[ex.Pid()] = ex.ID()
// Iterate all
return false
})
pidMap[ht.init.Pid()] = ht.init.ID()
// Get the guest pids
props, err := ht.c.Properties(ctx, schema1.PropertyTypeProcessList)
if err != nil {
return nil, err
}
// Copy to pid/exec-id pair's
pairs := make([]options.ProcessDetails, len(props.ProcessList))
for i, p := range props.ProcessList {
pairs[i].ImageName = p.ImageName
pairs[i].CreatedAt = p.CreateTimestamp
pairs[i].KernelTime_100Ns = p.KernelTime100ns
pairs[i].MemoryCommitBytes = p.MemoryCommitBytes
pairs[i].MemoryWorkingSetPrivateBytes = p.MemoryWorkingSetPrivateBytes
pairs[i].MemoryWorkingSetSharedBytes = p.MemoryWorkingSetSharedBytes
pairs[i].ProcessID = p.ProcessId
pairs[i].UserTime_100Ns = p.KernelTime100ns
if eid, ok := pidMap[int(p.ProcessId)]; ok {
pairs[i].ExecID = eid
}
}
return pairs, nil
}
func (ht *hcsTask) Wait() *task.StateResponse {
<-ht.closed
return ht.init.Wait()
}
func (ht *hcsTask) waitInitExit() {
ctx, span := trace.StartSpan(context.Background(), "hcsTask::waitInitExit")
defer span.End()
span.AddAttributes(trace.StringAttribute("tid", ht.id))
// Wait for it to exit on its own
ht.init.Wait()
// Close the host and event the exit
ht.close(ctx)
}
// waitForHostExit waits for the host virtual machine to exit. Once exited
// forcibly exits all additional exec's in this task.
//
// This MUST be called via a goroutine to wait on a background thread.
//
// Note: For Windows process isolated containers there is no host virtual
// machine so this should not be called.
func (ht *hcsTask) waitForHostExit() {
ctx, span := trace.StartSpan(context.Background(), "hcsTask::waitForHostExit")
defer span.End()
span.AddAttributes(trace.StringAttribute("tid", ht.id))
err := ht.host.Wait()
if err != nil {
log.G(ctx).WithError(err).Error("failed to wait for host virtual machine exit")
} else {
log.G(ctx).Debug("host virtual machine exited")
}
ht.execs.Range(func(key, value interface{}) bool {
ex := value.(shimExec)
ex.ForceExit(ctx, 1)
// iterate all
return false
})
ht.init.ForceExit(ctx, 1)
ht.closeHost(ctx)
}
// close shuts down the container that is owned by this task and if
// `ht.ownsHost` will shutdown the hosting VM the container was placed in.
//
// NOTE: For Windows process isolated containers `ht.ownsHost==true && ht.host
// == nil`.
func (ht *hcsTask) close(ctx context.Context) {
ht.closeOnce.Do(func() {
log.G(ctx).Debug("hcsTask::closeOnce")
// ht.c should never be nil for a real task but in testing we stub
// this to avoid a nil dereference. We really should introduce a
// method or interface for ht.c operations that we can stub for
// testing.
if ht.c != nil {
// Do our best attempt to tear down the container.
var werr error
ch := make(chan struct{})
go func() {
werr = ht.c.Wait()
close(ch)
}()
err := ht.c.Shutdown(ctx)
if err != nil {
log.G(ctx).WithError(err).Error("failed to shutdown container")
} else {
t := time.NewTimer(time.Second * 30)
select {
case <-ch:
err = werr
t.Stop()
if err != nil {
log.G(ctx).WithError(err).Error("failed to wait for container shutdown")
}
case <-t.C:
log.G(ctx).WithError(hcs.ErrTimeout).Error("failed to wait for container shutdown")
}
}
if err != nil {
err = ht.c.Terminate(ctx)
if err != nil {
log.G(ctx).WithError(err).Error("failed to terminate container")
} else {
t := time.NewTimer(time.Second * 30)
select {
case <-ch:
err = werr
t.Stop()
if err != nil {
log.G(ctx).WithError(err).Error("failed to wait for container terminate")
}
case <-t.C:
log.G(ctx).WithError(hcs.ErrTimeout).Error("failed to wait for container terminate")
}
}
}
// Release any resources associated with the container.
if err := resources.ReleaseResources(ctx, ht.cr, ht.host, true); err != nil {
log.G(ctx).WithError(err).Error("failed to release container resources")
}
// Close the container handle invalidating all future access.
if err := ht.c.Close(); err != nil {
log.G(ctx).WithError(err).Error("failed to close container")
}
}
ht.closeHost(ctx)
})
}
// closeHost safely closes the hosting UVM if this task is the owner. Once
// closed and all resources released it events the `runtime.TaskExitEventTopic`
// for all upstream listeners.
//
// Note: If this is a process isolated task the hosting UVM is simply a `noop`.
//
// This call is idempotent and safe to call multiple times.
func (ht *hcsTask) closeHost(ctx context.Context) {
ht.closeHostOnce.Do(func() {
log.G(ctx).Debug("hcsTask::closeHostOnce")
if ht.ownsHost && ht.host != nil {
if err := ht.host.Close(); err != nil {
log.G(ctx).WithError(err).Error("failed host vm shutdown")
}
}
// Send the `init` exec exit notification always.
exit := ht.init.Status()
ht.events.publishEvent(
ctx,
runtime.TaskExitEventTopic,
&eventstypes.TaskExit{
ContainerID: ht.id,
ID: exit.ID,
Pid: uint32(exit.Pid),
ExitStatus: exit.ExitStatus,
ExitedAt: exit.ExitedAt,
})
close(ht.closed)
})
}
func (ht *hcsTask) ExecInHost(ctx context.Context, req *shimdiag.ExecProcessRequest) (int, error) {
if ht.host == nil {
return 0, errors.New("task is not isolated")
}
return cmd.ExecInUvm(ctx, ht.host, req)
}
func (ht *hcsTask) DumpGuestStacks(ctx context.Context) string {
if ht.host != nil {
stacks, err := ht.host.DumpStacks(ctx)
if err != nil {
log.G(ctx).WithError(err).Warn("failed to capture guest stacks")
} else {
return stacks
}
}
return ""
}
func (ht *hcsTask) Share(ctx context.Context, req *shimdiag.ShareRequest) error {
if ht.host == nil {
return errors.New("task is not isolated")
}
// For hyper-v isolated WCOW the task used isn't the standard hcsTask so we
// only have to deal with the LCOW case here.
st, err := os.Stat(req.HostPath)
if err != nil {
return fmt.Errorf("could not open '%s' path on host: %s", req.HostPath, err)
}
var (
hostPath string = req.HostPath
restrictAccess bool
fileName string
allowedNames []string
)
if !st.IsDir() {
hostPath, fileName = filepath.Split(hostPath)
allowedNames = append(allowedNames, fileName)
restrictAccess = true
}
_, err = ht.host.AddPlan9(ctx, hostPath, req.UvmPath, req.ReadOnly, restrictAccess, allowedNames)
return err
}
func hcsPropertiesToWindowsStats(props *hcsschema.Properties) *stats.Statistics_Windows {
wcs := &stats.Statistics_Windows{Windows: &stats.WindowsContainerStatistics{}}
if props.Statistics != nil {
wcs.Windows.Timestamp = props.Statistics.Timestamp
wcs.Windows.ContainerStartTime = props.Statistics.ContainerStartTime
wcs.Windows.UptimeNS = props.Statistics.Uptime100ns * 100
if props.Statistics.Processor != nil {
wcs.Windows.Processor = &stats.WindowsContainerProcessorStatistics{
TotalRuntimeNS: props.Statistics.Processor.TotalRuntime100ns * 100,
RuntimeUserNS: props.Statistics.Processor.RuntimeUser100ns * 100,
RuntimeKernelNS: props.Statistics.Processor.RuntimeKernel100ns * 100,
}
}
if props.Statistics.Memory != nil {
wcs.Windows.Memory = &stats.WindowsContainerMemoryStatistics{
MemoryUsageCommitBytes: props.Statistics.Memory.MemoryUsageCommitBytes,
MemoryUsageCommitPeakBytes: props.Statistics.Memory.MemoryUsageCommitPeakBytes,
MemoryUsagePrivateWorkingSetBytes: props.Statistics.Memory.MemoryUsagePrivateWorkingSetBytes,
}
}
if props.Statistics.Storage != nil {
wcs.Windows.Storage = &stats.WindowsContainerStorageStatistics{
ReadCountNormalized: props.Statistics.Storage.ReadCountNormalized,
ReadSizeBytes: props.Statistics.Storage.ReadSizeBytes,
WriteCountNormalized: props.Statistics.Storage.WriteCountNormalized,
WriteSizeBytes: props.Statistics.Storage.WriteSizeBytes,
}
}
}
return wcs
}
func (ht *hcsTask) Stats(ctx context.Context) (*stats.Statistics, error) {
s := &stats.Statistics{}
props, err := ht.c.PropertiesV2(ctx, hcsschema.PTStatistics)
if err != nil {
return nil, err
}
if ht.isWCOW {
s.Container = hcsPropertiesToWindowsStats(props)
} else {
s.Container = &stats.Statistics_Linux{Linux: props.Metrics}
}
if ht.ownsHost && ht.host != nil {
vmStats, err := ht.host.Stats(ctx)
if err != nil {
return nil, err
}
s.VM = vmStats
}
return s, nil
}
| {
"pile_set_name": "Github"
} |
##
## IMAP specific settings
##
protocol imap {
# Maximum IMAP command line length. Some clients generate very long command
# lines with huge mailboxes, so you may need to raise this if you get
# "Too long argument" or "IMAP command line too large" errors often.
#imap_max_line_length = 64k
# Maximum number of IMAP connections allowed for a user from each IP address.
# NOTE: The username is compared case-sensitively.
#mail_max_userip_connections = 10
# Space separated list of plugins to load (default is global mail_plugins).
#mail_plugins = $mail_plugins
# IMAP logout format string:
# %i - total number of bytes read from client
# %o - total number of bytes sent to client
#imap_logout_format = bytes=%i/%o
# Override the IMAP CAPABILITY response. If the value begins with '+',
# add the given capabilities on top of the defaults (e.g. +XFOO XBAR).
#imap_capability =
# How long to wait between "OK Still here" notifications when client is
# IDLEing.
#imap_idle_notify_interval = 2 mins
# ID field names and values to send to clients. Using * as the value makes
# Dovecot use the default value. The following fields have default values
# currently: name, version, os, os-version, support-url, support-email.
#imap_id_send =
# ID fields sent by client to log. * means everything.
#imap_id_log =
# Workarounds for various client bugs:
# delay-newmail:
# Send EXISTS/RECENT new mail notifications only when replying to NOOP
# and CHECK commands. Some clients ignore them otherwise, for example OSX
# Mail (<v2.1). Outlook Express breaks more badly though, without this it
# may show user "Message no longer in server" errors. Note that OE6 still
# breaks even with this workaround if synchronization is set to
# "Headers Only".
# tb-extra-mailbox-sep:
# Thunderbird gets somehow confused with LAYOUT=fs (mbox and dbox) and
# adds extra '/' suffixes to mailbox names. This option causes Dovecot to
# ignore the extra '/' instead of treating it as invalid mailbox name.
# tb-lsub-flags:
# Show \Noselect flags for LSUB replies with LAYOUT=fs (e.g. mbox).
# This makes Thunderbird realize they aren't selectable and show them
# greyed out, instead of only later giving "not selectable" popup error.
#
# The list is space-separated.
#imap_client_workarounds =
}
| {
"pile_set_name": "Github"
} |
package org.slf4j.impl;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import java.io.PrintStream;
import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
import static org.apache.maven.shared.utils.logging.MessageUtils.level;
/**
* Logger for Maven, that support colorization of levels and stacktraces. This class implements 2 methods introduced in
* slf4j-simple provider local copy.
*
* @since 3.5.0
*/
public class MavenSimpleLogger extends SimpleLogger
{
MavenSimpleLogger( String name )
{
super( name );
}
@Override
protected String renderLevel( int level )
{
switch ( level )
{
case LOG_LEVEL_TRACE:
return level().debug( "TRACE" );
case LOG_LEVEL_DEBUG:
return level().debug( "DEBUG" );
case LOG_LEVEL_INFO:
return level().info( "INFO" );
case LOG_LEVEL_WARN:
return level().warning( "WARNING" );
case LOG_LEVEL_ERROR:
default:
return level().error( "ERROR" );
}
}
@Override
protected void writeThrowable( Throwable t, PrintStream stream )
{
if ( t == null )
{
return;
}
stream.print( buffer().failure( t.getClass().getName() ) );
if ( t.getMessage() != null )
{
stream.print( ": " );
stream.print( buffer().failure( t.getMessage() ) );
}
stream.println();
while ( t != null )
{
for ( StackTraceElement e : t.getStackTrace() )
{
stream.print( " " );
stream.print( buffer().strong( "at" ) );
stream.print( " " + e.getClassName() + "." + e.getMethodName() );
stream.print( buffer().a( " (" ).strong( getLocation( e ) ).a( ")" ) );
stream.println();
}
t = t.getCause();
if ( t != null )
{
stream.print( buffer().strong( "Caused by" ).a( ": " ).a( t.getClass().getName() ) );
if ( t.getMessage() != null )
{
stream.print( ": " );
stream.print( buffer().failure( t.getMessage() ) );
}
stream.println();
}
}
}
protected String getLocation( final StackTraceElement e )
{
assert e != null;
if ( e.isNativeMethod() )
{
return "Native Method";
}
else if ( e.getFileName() == null )
{
return "Unknown Source";
}
else if ( e.getLineNumber() >= 0 )
{
return String.format( "%s:%s", e.getFileName(), e.getLineNumber() );
}
else
{
return e.getFileName();
}
}
}
| {
"pile_set_name": "Github"
} |
h1 {
font-size: 24px;
margin-top: 0;
margin-bottom: 25px;
}
h2 {
font-size: 20px;
}
code {
background-color: transparent;
padding: 0;
}
pre {
-moz-border-radius: 0;
-webkit-border-radius: 0;
-ms-border-radius: 0;
border-radius: 0;
}
.navbar .navbar-brand {
position: relative;
bottom: 8px;
}
.navbar .navbar-brand p {
margin-top: -1px;
}
.syntaxhighlighter .line {
white-space: nowrap;
}
.syntaxhighlighter textarea {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
| {
"pile_set_name": "Github"
} |
--TEST--
PostgreSQL pg_insert()
--SKIPIF--
<?php
include("skipif.inc");
skip_bytea_not_escape();
?>
--FILE--
<?php
error_reporting(E_ALL);
include 'config.inc';
$db = pg_connect($conn_str);
$fields = array('num'=>'1234', 'str'=>'AAA', 'bin'=>'BBB');
pg_insert($db, $table_name, $fields) or print "Error in test 1\n";
echo pg_insert($db, $table_name, $fields, PGSQL_DML_STRING)."\n";
echo "Ok\n";
?>
--EXPECT--
INSERT INTO "php_pgsql_test" ("num","str","bin") VALUES (1234,E'AAA',E'BBB');
Ok
| {
"pile_set_name": "Github"
} |
#config-chain
USE THIS MODULE TO LOAD ALL YOUR CONFIGURATIONS
``` js
//npm install config-chain
var cc = require('config-chain')
, opts = require('optimist').argv //ALWAYS USE OPTIMIST FOR COMMAND LINE OPTIONS.
, env = opts.env || process.env.YOUR_APP_ENV || 'dev' //SET YOUR ENV LIKE THIS.
// EACH ARG TO CONFIGURATOR IS LOADED INTO CONFIGURATION CHAIN
// EARLIER ITEMS OVERIDE LATER ITEMS
// PUTS COMMAND LINE OPTS FIRST, AND DEFAULTS LAST!
//strings are interpereted as filenames.
//will be loaded synchronously
var conf =
cc(
//OVERRIDE SETTINGS WITH COMMAND LINE OPTS
opts,
//ENV VARS IF PREFIXED WITH 'myApp_'
cc.env('myApp_'), //myApp_foo = 'like this'
//FILE NAMED BY ENV
path.join(__dirname, 'config.' + env + '.json'),
//IF `env` is PRODUCTION
env === 'prod'
? path.join(__dirname, 'special.json') //load a special file
: null //NULL IS IGNORED!
//SUBDIR FOR ENV CONFIG
path.join(__dirname, 'config', env, 'config.json'),
//SEARCH PARENT DIRECTORIES FROM CURRENT DIR FOR FILE
cc.find('config.json'),
//PUT DEFAULTS LAST
{
host: 'localhost'
port: 8000
})
var host = conf.get('host')
// or
var host = conf.store.host
```
FINALLY, EASY FLEXIBLE CONFIGURATIONS!
##see also: [proto-list](https://github.com/isaacs/proto-list/)
WHATS THAT YOU SAY?
YOU WANT A "CLASS" SO THAT YOU CAN DO CRAYCRAY JQUERY CRAPS?
EXTEND WITH YOUR OWN FUNCTIONALTY!?
## CONFIGCHAIN LIVES TO SERVE ONLY YOU!
```javascript
var cc = require('config-chain')
// all the stuff you did before
var config = cc({
some: 'object'
},
cc.find('config.json'),
cc.env('myApp_')
)
// CONFIGS AS A SERVICE, aka "CaaS", aka EVERY DEVOPS DREAM OMG!
.addUrl('http://configurator:1234/my-configs')
// ASYNC FTW!
.addFile('/path/to/file.json')
// OBJECTS ARE OK TOO, they're SYNC but they still ORDER RIGHT
// BECAUSE PROMISES ARE USED BUT NO, NOT *THOSE* PROMISES, JUST
// ACTUAL PROMISES LIKE YOU MAKE TO YOUR MOM, KEPT OUT OF LOVE
.add({ another: 'object' })
// DIE A THOUSAND DEATHS IF THIS EVER HAPPENS!!
.on('error', function (er) {
// IF ONLY THERE WAS SOMETHIGN HARDER THAN THROW
// MY SORROW COULD BE ADEQUATELY EXPRESSED. /o\
throw er
})
// THROW A PARTY IN YOUR FACE WHEN ITS ALL LOADED!!
.on('load', function (config) {
console.awesome('HOLY SHIT!')
})
```
# BORING API DOCS
## cc(...args)
MAKE A CHAIN AND ADD ALL THE ARGS.
If the arg is a STRING, then it shall be a JSON FILENAME.
SYNC I/O!
RETURN THE CHAIN!
## cc.json(...args)
Join the args INTO A JSON FILENAME!
SYNC I/O!
## cc.find(relativePath)
SEEK the RELATIVE PATH by climbing the TREE OF DIRECTORIES.
RETURN THE FOUND PATH!
SYNC I/O!
## cc.parse(content, file, type)
Parse the content string, and guess the type from either the
specified type or the filename.
RETURN THE RESULTING OBJECT!
NO I/O!
## cc.env(prefix, env=process.env)
Get all the keys on the provided env object (or process.env) which are
prefixed by the specified prefix, and put the values on a new object.
RETURN THE RESULTING OBJECT!
NO I/O!
## cc.ConfigChain()
The ConfigChain class for CRAY CRAY JQUERY STYLE METHOD CHAINING!
One of these is returned by the main exported function, as well.
It inherits (prototypically) from
[ProtoList](https://github.com/isaacs/proto-list/), and also inherits
(parasitically) from
[EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter)
It has all the methods from both, and except where noted, they are
unchanged.
### LET IT BE KNOWN THAT chain IS AN INSTANCE OF ConfigChain.
## chain.sources
A list of all the places where it got stuff. The keys are the names
passed to addFile or addUrl etc, and the value is an object with some
info about the data source.
## chain.addFile(filename, type, [name=filename])
Filename is the name of the file. Name is an arbitrary string to be
used later if you desire. Type is either 'ini' or 'json', and will
try to guess intelligently if omitted.
Loaded files can be saved later.
## chain.addUrl(url, type, [name=url])
Same as the filename thing, but with a url.
Can't be saved later.
## chain.addEnv(prefix, env, [name='env'])
Add all the keys from the env object that start with the prefix.
## chain.addString(data, file, type, [name])
Parse the string and add it to the set. (Mainly used internally.)
## chain.add(object, [name])
Add the object to the set.
## chain.root {Object}
The root from which all the other config objects in the set descend
prototypically.
Put your defaults here.
## chain.set(key, value, name)
Set the key to the value on the named config object. If name is
unset, then set it on the first config object in the set. (That is,
the one with the highest priority, which was added first.)
## chain.get(key, [name])
Get the key from the named config object explicitly, or from the
resolved configs if not specified.
## chain.save(name, type)
Write the named config object back to its origin.
Currently only supported for env and file config types.
For files, encode the data according to the type.
## chain.on('save', function () {})
When one or more files are saved, emits `save` event when they're all
saved.
## chain.on('load', function (chain) {})
When the config chain has loaded all the specified files and urls and
such, the 'load' event fires.
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never" default-locale="fr-FR">
<info>
<title>Revue d'élevage et de médecine vétérinaire des pays tropicaux (French)</title>
<title-short>Rev.Elev.Med.Vet.Pays.Trop.</title-short>
<id>http://www.zotero.org/styles/revue-d-elevage-et-de-medecine-veterinaire-des-pays-tropicaux</id>
<link href="http://www.zotero.org/styles/revue-d-elevage-et-de-medecine-veterinaire-des-pays-tropicaux" rel="self"/>
<link href="http://www.zotero.org/styles/journal-of-zoology" rel="template"/>
<link href="http://remvt.cirad.fr/gb/presentation/note.html" rel="documentation"/>
<author>
<name>Cirad-Dist</name>
</author>
<category citation-format="author-date"/>
<category field="biology"/>
<category field="zoology"/>
<issn>0035-1865</issn>
<eissn>1951-6711</eissn>
<updated>2017-03-28T02:57:19+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<locale xml:lang="fr">
<terms>
<term name="editor" form="short">
<single>Ed.</single>
<multiple>Eds.</multiple>
</term>
</terms>
</locale>
<macro name="container">
<choose>
<if type="article-journal">
<text variable="container-title" font-style="italic" form="short"/>
</if>
</choose>
<choose>
<if type="chapter paper-conference" match="any">
<group>
<text term="in" text-case="capitalize-first" suffix=": "/>
<text variable="container-title"/>
<text variable="collection-title" prefix=","/>
<names variable="editor" delimiter=", " prefix=" (" suffix=")">
<label form="short" suffix=". " text-case="capitalize-first" strip-periods="true"/>
<name name-as-sort-order="all" sort-separator=" " initialize-with="." delimiter=", " delimiter-precedes-last="never"/>
</names>
</group>
<group>
<text variable="event"/>
</group>
</if>
</choose>
<choose>
<if type="webpage">
<group>
<text variable="container-title" form="short" suffix=", "/>
</group>
</if>
</choose>
</macro>
<macro name="author">
<names variable="author">
<name name-as-sort-order="all" sort-separator=" " initialize-with="." delimiter=", " delimiter-precedes-last="never"/>
<label form="short" prefix=" (" suffix=")" text-case="capitalize-first"/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text macro="title"/>
</substitute>
</names>
</macro>
<macro name="author-short">
<names variable="author">
<name form="short" and="symbol" delimiter=", " initialize-with=". " delimiter-precedes-last="never"/>
<et-al font-style="italic"/>
<substitute>
<names variable="editor"/>
<names variable="translator"/>
<choose>
<if type="bill book graphic legal_case legislation motion_picture report song" match="any">
<text variable="title" form="short" font-style="italic"/>
</if>
<else>
<text variable="title" form="short" quotes="true"/>
</else>
</choose>
</substitute>
</names>
</macro>
<macro name="access">
<choose>
<if type="webpage">
<choose>
<if variable="URL">
<group delimiter=" ">
<group delimiter=": ">
<text variable="URL"/>
</group>
<group prefix="(consulté le " suffix=")" delimiter=": ">
<date variable="accessed">
<date-part name="day" form="numeric-leading-zeros" suffix=" "/>
<date-part name="month" form="long" suffix=" " strip-periods="true"/>
<date-part name="year" form="long"/>
</date>
</group>
</group>
</if>
</choose>
</if>
</choose>
</macro>
<macro name="title">
<choose>
<if type="report" match="any">
<text variable="title" font-style="italic"/>
<group prefix=" (" suffix=")">
<text variable="genre"/>
<text variable="number" prefix=" No. "/>
</group>
</if>
<else-if type="bill book thesis graphic legal_case legislation motion_picture song speech" match="any">
<text variable="title"/>
</else-if>
<else-if type="webpage">
<text variable="title"/>
</else-if>
<else>
<text variable="title"/>
</else>
</choose>
</macro>
<macro name="publisher">
<choose>
<if type="report">
<group delimiter=", ">
<text variable="publisher"/>
<text variable="publisher-place"/>
</group>
</if>
<else-if type="thesis">
<group delimiter=", ">
<text variable="genre"/>
<text variable="publisher"/>
<text variable="publisher-place"/>
<text variable="number-of-pages" suffix=" p."/>
</group>
</else-if>
<else-if type="book">
<group delimiter=" ">
<text variable="genre"/>
<text variable="publisher" suffix=", "/>
<text variable="publisher-place" suffix=", "/>
<text variable="number-of-pages" suffix=" p."/>
<text variable="collection-title" prefix="(Coll. " suffix=")"/>
</group>
</else-if>
<else>
<text variable="genre" suffix=", "/>
<group delimiter=", ">
<text variable="publisher" text-case="uppercase"/>
<text variable="publisher-place"/>
<text variable="number-of-pages" suffix=" p."/>
<text variable="collection-title" prefix="(Coll. " suffix=")"/>
</group>
</else>
</choose>
</macro>
<macro name="event">
<choose>
<if variable="event">
<text variable="container-title" text-case="capitalize-first" suffix=" "/>
</if>
</choose>
</macro>
<macro name="issued">
<choose>
<if variable="issued">
<date variable="issued">
<date-part name="year"/>
</date>
</if>
<else-if variable="accessed">
<choose>
<if type="webpage">
<date variable="accessed">
<date-part name="year"/>
</date>
</if>
<else>
<text term="no date" form="short"/>
</else>
</choose>
</else-if>
<else>
<text term="no date" form="short"/>
</else>
</choose>
</macro>
<macro name="edition">
<choose>
<if is-numeric="edition">
<group delimiter=" ">
<number variable="edition" form="ordinal"/>
<text value="edn"/>
</group>
</if>
<else>
<text variable="edition" suffix="."/>
</else>
</choose>
</macro>
<macro name="locators">
<choose>
<if type="article-journal article-magazine article-newspaper" match="any">
<group prefix="" delimiter="">
<group>
<text variable="volume" font-weight="bold" prefix=", "/>
<text variable="issue" prefix=" (" suffix="): "/>
<text variable="note" prefix=": e" suffix=""/>
</group>
<text variable="page"/>
<text variable="DOI" prefix=", doi: " suffix=""/>
</group>
</if>
<else-if type="bill book graphic thesis legal_case legislation motion_picture report song" match="any">
<group delimiter=". " prefix=". ">
<text macro="edition"/>
<text macro="event"/>
<text macro="publisher"/>
</group>
</else-if>
<else-if type="chapter paper-conference" match="any">
<group delimiter=", " prefix=", ">
<text variable="note" prefix="" suffix=""/>
</group>
<group delimiter=", " prefix=". ">
<text macro="publisher"/>
<text variable="page" prefix=" "/>
</group>
</else-if>
</choose>
</macro>
<citation et-al-min="4" et-al-use-first="1" et-al-subsequent-min="3" et-al-subsequent-use-first="1" disambiguate-add-year-suffix="true" collapse="year">
<sort>
<key macro="issued" sort="ascending"/>
<key macro="author"/>
</sort>
<layout prefix="(" suffix=")" delimiter="; ">
<group delimiter=", ">
<text macro="author-short"/>
<text macro="issued"/>
</group>
</layout>
</citation>
<bibliography hanging-indent="true">
<sort>
<key macro="author"/>
<key macro="issued" sort="ascending"/>
</sort>
<layout>
<group suffix="">
<text macro="author" suffix=","/>
<text macro="issued" prefix=" " suffix=". "/>
<group delimiter=". ">
<text macro="title"/>
<text macro="container"/>
</group>
<text macro="locators"/>
</group>
<text macro="access" prefix=" "/>
</layout>
</bibliography>
</style>
| {
"pile_set_name": "Github"
} |
# This file isn't really meant to be run as a test, though it won't really
# make a difference.
import gc
# Sometimes pointer objects from popped stack frames remain up the stack
# and end up being marked when the GC conservatively scans the stack, but
# this causes flaky tests because we really want the object to be collected.
# By having a deep recursive function, we ensure that the object we want to
# collect is really far in the stack and won't get scanned.
def call_function_far_up_the_stack(fn, num_calls_left=200):
if num_calls_left == 0:
return fn()
else:
return call_function_far_up_the_stack(fn, num_calls_left - 1)
# It's useful to call the GC at different locations in the stack in case that it's the
# call to the GC itself that left a lingering pointer (e.g. the pointer could be the
# __del__ attribute of an object we'd like to collect).
def call_gc_throughout_the_stack(number_of_gc_calls, num_calls_left=30):
if num_calls_left > 0:
call_gc_throughout_the_stack(number_of_gc_calls, num_calls_left - 1)
if number_of_gc_calls >= num_calls_left:
gc.collect()
# test_gc takes in a function fn that presumably allocations some objects and
# attempts to collect those objects in order to trigger a call to the finalizers.
#
# The problem is that it's actually quite hard to guarantee finalizer calls
# because with conservative scanning, there can always be lingering pointers
# on the stack. This function has a bunch of hacks to attempt to clear those
# lingering pointers.
def test_gc(fn, number_of_gc_calls=3):
class DummyNewObject(object):
pass
class DummyOldObject():
pass
def dummyFunctionThatDoesSomeAllocation():
# Allocating a few objects on the heap seems to be helpful.
for _ in xrange(100):
n, o = DummyNewObject(), DummyOldObject()
objs = [DummyNewObject() for _ in xrange(100)]
# Call fn after a few recursive calls to get those allocations.
val = call_function_far_up_the_stack(fn)
# Call a dummy function in the same way as fn. By following the same
# code path, there is a better chance of clearing lingering references.
call_function_far_up_the_stack(dummyFunctionThatDoesSomeAllocation)
# Force garbage collection.
call_gc_throughout_the_stack(number_of_gc_calls - 1)
gc.collect()
return val
| {
"pile_set_name": "Github"
} |
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/browser/ui/safe_mode/safe_mode_coordinator.h"
#import "base/logging.h"
#include "ios/chrome/browser/crash_loop_detection_util.h"
#import "ios/chrome/browser/ui/safe_mode/safe_mode_view_controller.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
namespace {
const int kStartupCrashLoopThreshold = 2;
}
@interface SafeModeCoordinator ()<SafeModeViewControllerDelegate>
@end
@implementation SafeModeCoordinator {
__weak UIWindow* _window;
}
@synthesize delegate = _delegate;
#pragma mark - Public class methods
+ (BOOL)shouldStart {
// Check whether there appears to be a startup crash loop. If not, don't look
// at anything else.
if (crash_util::GetFailedStartupAttemptCount() < kStartupCrashLoopThreshold)
return NO;
return [SafeModeViewController hasSuggestions];
}
#pragma mark - ChromeCoordinator implementation
- (void)start {
// Create the SafeModeViewController and make it the root view controller for
// the window. The window has ownership of it and will dispose of it when
// another view controller is made root.
//
// General note: Safe mode should be safe; it should not depend on other
// objects being created. Be extremely conservative when adding code to this
// method.
SafeModeViewController* viewController =
[[SafeModeViewController alloc] initWithDelegate:self];
[self.window setRootViewController:viewController];
// Reset the crash count; the user may change something based on the recovery
// UI that will fix the crash, and having the next launch start in recovery
// mode would be strange.
crash_util::ResetFailedStartupAttemptCount();
}
// Override of ChildCoordinators method, which is not supported in this class.
- (MutableCoordinatorArray*)childCoordinators {
NOTREACHED() << "Do not add child coordinators to SafeModeCoordinator.";
return nil;
}
#pragma mark - SafeModeViewControllerDelegate implementation
- (void)startBrowserFromSafeMode {
[self.delegate coordinatorDidExitSafeMode:self];
}
@end
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<MixxxMIDIPreset schemaVersion="1" mixxxVersion="1.9.0">
<info>
<name>Stanton SCS.1d (unfinished)</name>
<author>Sean M. Pappalardo</author>
<description>This is a work-in-progress preset for a single Stanton SCS.1d turntable controller.
Requires scripting and native HSS1394 support on OSX and Windows,
or ALSA's HSS1394 MIDI driver on Linux (in the ALSA tree as of 12 November 2012.)</description>
<manual>stanton_scs1d</manual>
</info>
<controller id="Stanton SCS.1d">
<scriptfiles>
<file filename="Stanton-SCS1d-scripts.js" functionprefix="StantonSCS1d"/>
</scriptfiles>
<controls>
<control> <!-- Firmware version response, platter message on Linux -->
<status>0xf0</status>
<group>[Master]</group>
<key>StantonSCS1d.inboundSysex</key>
<options>
<Script-Binding/>
</options>
</control>
<!-- Encoder section -->
<control>
<status>0x90</status>
<midino>0x04</midino>
<group>[Master]</group>
<key>StantonSCS1d.encoderBank</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x04</midino>
<group>[Master]</group>
<key>StantonSCS1d.encoderBank</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0xb0</status>
<midino>0x7c</midino>
<group>[Master]</group>
<key>StantonSCS1d.encoder4</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x03</midino>
<group>[Master]</group>
<key>StantonSCS1d.encoder4</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x03</midino>
<group>[Master]</group>
<key>StantonSCS1d.encoder4</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x11</midino>
<group>[Master]</group>
<key>StantonSCS1d.display4button</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x11</midino>
<group>[Master]</group>
<key>StantonSCS1d.display4button</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0xb0</status>
<midino>0x7d</midino>
<group>[Master]</group>
<key>StantonSCS1d.encoder3</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x02</midino>
<group>[Master]</group>
<key>StantonSCS1d.encoder3</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x02</midino>
<group>[Master]</group>
<key>StantonSCS1d.encoder3</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x10</midino>
<group>[Master]</group>
<key>StantonSCS1d.display3button</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x10</midino>
<group>[Master]</group>
<key>StantonSCS1d.display3button</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0xb0</status>
<midino>0x7e</midino>
<group>[Master]</group>
<key>StantonSCS1d.encoder2</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x1</midino>
<group>[Master]</group>
<key>StantonSCS1d.encoder2</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x1</midino>
<group>[Master]</group>
<key>StantonSCS1d.encoder2</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x18</midino>
<group>[Master]</group>
<key>StantonSCS1d.display2button</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x18</midino>
<group>[Master]</group>
<key>StantonSCS1d.display2button</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0xb0</status>
<midino>0x7f</midino>
<group>[Master]</group>
<key>StantonSCS1d.encoder1</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x0</midino>
<group>[Master]</group>
<key>StantonSCS1d.encoder1</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x0</midino>
<group>[Master]</group>
<key>StantonSCS1d.encoder1</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x19</midino>
<group>[Master]</group>
<key>StantonSCS1d.display1button</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x19</midino>
<group>[Master]</group>
<key>StantonSCS1d.display1button</key>
<options>
<Script-Binding/>
</options>
</control>
<!-- Transport Buttons -->
<control>
<status>0x90</status>
<midino>0x37</midino>
<group>[Master]</group>
<key>StantonSCS1d.pfl</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x37</midino>
<group>[Master]</group>
<key>StantonSCS1d.pfl</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x29</midino>
<group>[Master]</group>
<key>StantonSCS1d.playButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x29</midino>
<group>[Master]</group>
<key>StantonSCS1d.playButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x2b</midino>
<group>[Master]</group>
<key>StantonSCS1d.cueButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x2b</midino>
<group>[Master]</group>
<key>StantonSCS1d.cueButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x2a</midino>
<group>[Master]</group>
<key>StantonSCS1d.syncButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x2a</midino>
<group>[Master]</group>
<key>StantonSCS1d.syncButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x28</midino>
<group>[Master]</group>
<key>StantonSCS1d.bpmButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x28</midino>
<group>[Master]</group>
<key>StantonSCS1d.bpmButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x2e</midino>
<group>[Master]</group>
<key>StantonSCS1d.ffwd</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x2e</midino>
<group>[Master]</group>
<key>StantonSCS1d.ffwd</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x2f</midino>
<group>[Master]</group>
<key>StantonSCS1d.rew</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x2f</midino>
<group>[Master]</group>
<key>StantonSCS1d.rew</key>
<options>
<Script-Binding/>
</options>
</control>
<!-- Platter -->
<control>
<status>0xf9</status>
<group>[Master]</group>
<key>StantonSCS1d.vinylMoved</key>
<options>
<Script-Binding/>
</options>
</control>
<!-- Mode button section -->
<control>
<status>0x90</status>
<midino>0x1E</midino>
<group>[Master]</group>
<key>StantonSCS1d.EnterButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x1E</midino>
<group>[Master]</group>
<key>StantonSCS1d.EnterButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x40</midino>
<group>[Master]</group>
<key>StantonSCS1d.DeckChange</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x40</midino>
<group>[Master]</group>
<key>StantonSCS1d.DeckChange</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x1A</midino>
<group>[Master]</group>
<key>StantonSCS1d.setupButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x1A</midino>
<group>[Master]</group>
<key>StantonSCS1d.setupButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x1B</midino>
<group>[Master]</group>
<key>StantonSCS1d.controlButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x1B</midino>
<group>[Master]</group>
<key>StantonSCS1d.controlButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x1C</midino>
<group>[Master]</group>
<key>StantonSCS1d.browseButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x1C</midino>
<group>[Master]</group>
<key>StantonSCS1d.browseButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x1D</midino>
<group>[Master]</group>
<key>StantonSCS1d.vinylButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x1D</midino>
<group>[Master]</group>
<key>StantonSCS1d.vinylButton</key>
<options>
<Script-Binding/>
</options>
</control>
<!-- Pitch slider section -->
<control>
<status>0x90</status>
<midino>0x06</midino>
<group>[Master]</group>
<key>StantonSCS1d.rangeButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x06</midino>
<group>[Master]</group>
<key>StantonSCS1d.rangeButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x07</midino>
<group>[Master]</group>
<key>StantonSCS1d.pitchReset</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x07</midino>
<group>[Master]</group>
<key>StantonSCS1d.pitchReset</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0xb0</status>
<midino>0x00</midino>
<group>[Master]</group>
<key>StantonSCS1d.pitchSlider</key>
<options>
<Script-Binding/>
</options>
</control>
<!-- Trigger pad section -->
<control>
<status>0x90</status>
<midino>0x20</midino>
<group>[Master]</group>
<key>StantonSCS1d.pad</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x20</midino>
<group>[Master]</group>
<key>StantonSCS1d.pad</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x21</midino>
<group>[Master]</group>
<key>StantonSCS1d.pad</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x21</midino>
<group>[Master]</group>
<key>StantonSCS1d.pad</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x22</midino>
<group>[Master]</group>
<key>StantonSCS1d.pad</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x22</midino>
<group>[Master]</group>
<key>StantonSCS1d.pad</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x23</midino>
<group>[Master]</group>
<key>StantonSCS1d.pad</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x23</midino>
<group>[Master]</group>
<key>StantonSCS1d.pad</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x30</midino>
<group>[Master]</group>
<key>StantonSCS1d.padTop1</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x30</midino>
<group>[Master]</group>
<key>StantonSCS1d.padTop1</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x31</midino>
<group>[Master]</group>
<key>StantonSCS1d.padTop2</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x31</midino>
<group>[Master]</group>
<key>StantonSCS1d.padTop2</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x32</midino>
<group>[Master]</group>
<key>StantonSCS1d.padTop3</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x32</midino>
<group>[Master]</group>
<key>StantonSCS1d.padTop3</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x33</midino>
<group>[Master]</group>
<key>StantonSCS1d.padTop4</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x33</midino>
<group>[Master]</group>
<key>StantonSCS1d.padTop4</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x34</midino>
<group>[Master]</group>
<key>StantonSCS1d.velocityButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x34</midino>
<group>[Master]</group>
<key>StantonSCS1d.velocityButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x35</midino>
<group>[Master]</group>
<key>StantonSCS1d.padBankButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x35</midino>
<group>[Master]</group>
<key>StantonSCS1d.padBankButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x36</midino>
<group>[Master]</group>
<key>StantonSCS1d.padBankButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x36</midino>
<group>[Master]</group>
<key>StantonSCS1d.padBankButton</key>
<options>
<Script-Binding/>
</options>
</control>
<!-- Trigger/Loop Buttons - Banks -->
<control>
<status>0x90</status>
<midino>0x16</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerBankSelect</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x16</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerBankSelect</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x17</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerBankSelect</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x17</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerBankSelect</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>0x5</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerBankSelect</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>0x5</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerBankSelect</key>
<options>
<Script-Binding/>
</options>
</control>
<!-- Trigger/Loop Buttons -->
<control>
<status>0x90</status>
<midino>8</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>8</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>9</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>9</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>10</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>10</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>11</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>11</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>12</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>12</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>13</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>13</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>14</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>14</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>15</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>15</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>18</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>18</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>19</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>19</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>20</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>20</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x90</status>
<midino>21</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
<control>
<status>0x80</status>
<midino>21</midino>
<group>[Master]</group>
<key>StantonSCS1d.triggerButton</key>
<options>
<Script-Binding/>
</options>
</control>
</controls>
</controller>
</MixxxMIDIPreset>
| {
"pile_set_name": "Github"
} |
import pytest
from django.utils import timezone
from api.preprint_providers.serializers import DeprecatedPreprintProviderSerializer
from api.preprints.serializers import PreprintSerializer
from osf_tests.factories import (
PreprintProviderFactory,
PreprintFactory,
)
from tests.utils import make_drf_request_with_version
@pytest.fixture()
def preprint():
return PreprintFactory()
@pytest.mark.django_db
class TestRetractedPreprintSerialization:
def test_hidden_fields_on_retracted_preprint(self, preprint):
hide_if_withdrawal_fields = {
'is_published', 'is_preprint_orphan', 'license_record',
'preprint_doi_created'
}
hide_if_not_withdrawal_fields = {'withdrawal_justification'}
always_show_fields = {
'date_created', 'date_modified', 'date_published', 'original_publication_date',
'doi', 'title', 'description', 'date_withdrawn', 'tags'}
# test_non_retracted
req = make_drf_request_with_version()
result = PreprintSerializer(
preprint,
context={'request': req}).data
data = result['data']
attributes = set(data['attributes'])
assert not preprint.is_retracted
assert hide_if_not_withdrawal_fields.isdisjoint(attributes)
assert always_show_fields.issubset(attributes)
assert hide_if_withdrawal_fields.issubset(attributes)
# test_retracted
preprint.date_withdrawn = timezone.now()
preprint.save()
preprint.reload()
result = PreprintSerializer(
preprint,
context={'request': req}).data
data = result['data']
attributes = set(data['attributes'])
assert preprint.is_retracted
assert always_show_fields.issubset(attributes)
assert hide_if_not_withdrawal_fields.issubset(attributes)
assert all(list([data['attributes'][field] is None for field in list(hide_if_withdrawal_fields)]))
@pytest.mark.django_db
class TestDeprecatedPreprintProviderSerializer:
@pytest.fixture()
def preprint_provider(self):
return PreprintProviderFactory()
def test_preprint_provider_serialization_versions(self, preprint_provider):
# test_preprint_provider_serialization_v2
req = make_drf_request_with_version(version='2.0')
result = DeprecatedPreprintProviderSerializer(
preprint_provider,
context={'request': req}
).data
data = result['data']
attributes = data['attributes']
assert data['id'] == preprint_provider._id
assert data['type'] == 'preprint_providers'
assert 'banner_path' in attributes
assert 'logo_path' in attributes
assert 'header_text' in attributes
assert 'email_contact' in attributes
assert 'email_support' in attributes
assert 'social_facebook' in attributes
assert 'social_instagram' in attributes
assert 'social_twitter' in attributes
assert 'subjects_acceptable' in attributes
# test_preprint_provider_serialization_v24
req = make_drf_request_with_version(version='2.4')
result = DeprecatedPreprintProviderSerializer(
preprint_provider,
context={'request': req}
).data
data = result['data']
attributes = data['attributes']
assert data['id'] == preprint_provider._id
assert data['type'] == 'preprint_providers'
assert 'banner_path' not in attributes
assert 'logo_path' not in attributes
assert 'header_text' not in attributes
assert 'email_contact' not in attributes
assert 'social_facebook' not in attributes
assert 'social_instagram' not in attributes
assert 'social_twitter' not in attributes
# # test_preprint_provider_serialization_v25
req = make_drf_request_with_version(version='2.5')
result = DeprecatedPreprintProviderSerializer(
preprint_provider,
context={'request': req}
).data
data = result['data']
attributes = data['attributes']
assert data['id'] == preprint_provider._id
assert data['type'] == 'preprint_providers'
assert 'banner_path' not in attributes
assert 'logo_path' not in attributes
assert 'header_text' not in attributes
assert 'email_contact' not in attributes
assert 'social_facebook' not in attributes
assert 'social_instagram' not in attributes
assert 'social_twitter' not in attributes
assert 'subjects_acceptable' not in attributes
assert 'name' in attributes
assert 'description' in attributes
assert 'advisory_board' in attributes
assert 'example' in attributes
assert 'domain' in attributes
assert 'domain_redirect_enabled' in attributes
assert 'footer_links' in attributes
assert 'share_source' in attributes
assert 'share_publish_type' in attributes
assert 'email_support' in attributes
assert 'preprint_word' in attributes
assert 'allow_submissions' in attributes
assert 'additional_providers' in attributes
| {
"pile_set_name": "Github"
} |
vimlparser: E475: Invalid argument: White space is not allowed before comma: line 19 col 14
| {
"pile_set_name": "Github"
} |
#ifndef CAFFE_CONV_LAYER_HPP_
#define CAFFE_CONV_LAYER_HPP_
#include <vector>
#include "caffe/blob.hpp"
#include "caffe/layer.hpp"
#include "caffe/proto/caffe.pb.h"
#include "caffe/layers/base_conv_layer.hpp"
namespace caffe {
/**
* @brief Convolves the input image with a bank of learned filters,
* and (optionally) adds biases.
*
* Caffe convolves by reduction to matrix multiplication. This achieves
* high-throughput and generality of input and filter dimensions but comes at
* the cost of memory for matrices. This makes use of efficiency in BLAS.
*
* The input is "im2col" transformed to a channel K' x H x W data matrix
* for multiplication with the N x K' x H x W filter matrix to yield a
* N' x H x W output matrix that is then "col2im" restored. K' is the
* input channel * kernel height * kernel width dimension of the unrolled
* inputs so that the im2col matrix has a column for each input region to
* be filtered. col2im restores the output spatial structure by rolling up
* the output channel N' columns of the output matrix.
*/
template <typename Dtype>
class ConvolutionLayer : public BaseConvolutionLayer<Dtype> {
public:
/**
* @param param provides ConvolutionParameter convolution_param,
* with ConvolutionLayer options:
* - num_output. The number of filters.
* - kernel_size / kernel_h / kernel_w. The filter dimensions, given by
* kernel_size for square filters or kernel_h and kernel_w for rectangular
* filters.
* - stride / stride_h / stride_w (\b optional, default 1). The filter
* stride, given by stride_size for equal dimensions or stride_h and stride_w
* for different strides. By default the convolution is dense with stride 1.
* - pad / pad_h / pad_w (\b optional, default 0). The zero-padding for
* convolution, given by pad for equal dimensions or pad_h and pad_w for
* different padding. Input padding is computed implicitly instead of
* actually padding.
* - dilation (\b optional, default 1). The filter
* dilation, given by dilation_size for equal dimensions for different
* dilation. By default the convolution has dilation 1.
* - group (\b optional, default 1). The number of filter groups. Group
* convolution is a method for reducing parameterization by selectively
* connecting input and output channels. The input and output channel dimensions must be divisible
* by the number of groups. For group @f$ \geq 1 @f$, the
* convolutional filters' input and output channels are separated s.t. each
* group takes 1 / group of the input channels and makes 1 / group of the
* output channels. Concretely 4 input channels, 8 output channels, and
* 2 groups separate input channels 1-2 and output channels 1-4 into the
* first group and input channels 3-4 and output channels 5-8 into the second
* group.
* - bias_term (\b optional, default true). Whether to have a bias.
* - engine: convolution has CAFFE (matrix multiplication) and CUDNN (library
* kernels + stream parallelism) engines.
*/
explicit ConvolutionLayer(const LayerParameter& param)
: BaseConvolutionLayer<Dtype>(param) {}
virtual inline const char* type() const { return "Convolution"; }
protected:
virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
virtual void Forward_gpu(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
virtual void Backward_cpu(const vector<Blob<Dtype>*>& top,
const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
virtual void Backward_gpu(const vector<Blob<Dtype>*>& top,
const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
virtual inline bool reverse_dimensions() { return false; }
virtual void compute_output_shape();
};
} // namespace caffe
#endif // CAFFE_CONV_LAYER_HPP_
| {
"pile_set_name": "Github"
} |
# -*- coding: utf-8 -*-
# Copyright 2014 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.
"""Utility functions and class for listing commands such as ls and du."""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import fnmatch
import sys
import six
from gslib.cloud_api import EncryptionException
from gslib.exception import CommandException
from gslib.plurality_checkable_iterator import PluralityCheckableIterator
from gslib.storage_url import GenerationFromUrlAndString
from gslib.utils.constants import S3_ACL_MARKER_GUID
from gslib.utils.constants import S3_DELETE_MARKER_GUID
from gslib.utils.constants import S3_MARKER_GUIDS
from gslib.utils.constants import UTF8
from gslib.utils.system_util import IS_WINDOWS
from gslib.utils.translation_helper import AclTranslation
from gslib.utils import text_util
from gslib.wildcard_iterator import StorageUrlFromString
ENCRYPTED_FIELDS = [
'md5Hash',
'crc32c',
]
UNENCRYPTED_FULL_LISTING_FIELDS = [
'acl',
'cacheControl',
'componentCount',
'contentDisposition',
'contentEncoding',
'contentLanguage',
'contentType',
'kmsKeyName',
'customerEncryption',
'etag',
'eventBasedHold',
'generation',
'metadata',
'metageneration',
'retentionExpirationTime',
'size',
'storageClass',
'temporaryHold',
'timeCreated',
'timeDeleted',
'timeStorageClassUpdated',
'updated',
]
def MakeMetadataLine(label, value, indent=1):
"""Returns a string with a vertically aligned label and value.
Labels of the same indentation level will start at the same column. Values
will all start at the same column (unless the combined left-indent and
label length is excessively long). If a value spans multiple lines,
indentation will only be applied to the first line. Example output from
several calls:
Label1: Value (default indent of 1 was used)
Sublabel1: Value (used indent of 2 here)
Label2: Value
Args:
label: The label to print in the first column.
value: The value to print in the second column.
indent: (4 * indent) spaces will be placed before the label.
Returns:
A string with a vertically aligned label and value.
"""
return '{}{}'.format(((' ' * indent * 4) + label + ':').ljust(28), value)
def PrintBucketHeader(bucket_listing_ref): # pylint: disable=unused-argument
"""Default function for printing headers for buckets.
Header is printed prior to listing the contents of the bucket.
Args:
bucket_listing_ref: BucketListingRef of type BUCKET.
"""
pass
def PrintDir(bucket_listing_ref):
"""Default function for printing buckets or prefixes.
Args:
bucket_listing_ref: BucketListingRef of type BUCKET or PREFIX.
"""
text_util.print_to_fd(bucket_listing_ref.url_string)
# pylint: disable=unused-argument
def PrintDirSummary(num_bytes, bucket_listing_ref):
"""Off-by-default function for printing buckets or prefix size summaries.
Args:
num_bytes: Number of bytes contained in the directory.
bucket_listing_ref: BucketListingRef of type BUCKET or PREFIX.
"""
pass
def PrintDirHeader(bucket_listing_ref):
"""Default function for printing headers for prefixes.
Header is printed prior to listing the contents of the prefix.
Args:
bucket_listing_ref: BucketListingRef of type PREFIX.
"""
text_util.print_to_fd('{}:'.format(bucket_listing_ref.url_string))
def PrintNewLine():
"""Default function for printing new lines between directories."""
text_util.print_to_fd()
# pylint: disable=too-many-statements
def PrintFullInfoAboutObject(bucket_listing_ref, incl_acl=True):
"""Print full info for given object (like what displays for gsutil ls -L).
Args:
bucket_listing_ref: BucketListingRef being listed.
Must have ref_type OBJECT and a populated root_object
with the desired fields.
incl_acl: True if ACL info should be output.
Returns:
Tuple (number of objects, object_length)
Raises:
Exception: if calling bug encountered.
"""
url_str = bucket_listing_ref.url_string
storage_url = StorageUrlFromString(url_str)
obj = bucket_listing_ref.root_object
if (obj.metadata and
S3_DELETE_MARKER_GUID in obj.metadata.additionalProperties):
num_bytes = 0
num_objs = 0
url_str += '<DeleteMarker>'
else:
num_bytes = obj.size
num_objs = 1
text_util.print_to_fd('{}:'.format(url_str))
if obj.timeCreated:
text_util.print_to_fd(
MakeMetadataLine('Creation time',
obj.timeCreated.strftime('%a, %d %b %Y %H:%M:%S GMT')))
if obj.updated:
text_util.print_to_fd(
MakeMetadataLine('Update time',
obj.updated.strftime('%a, %d %b %Y %H:%M:%S GMT')))
if (obj.timeStorageClassUpdated and
obj.timeStorageClassUpdated != obj.timeCreated):
text_util.print_to_fd(
MakeMetadataLine(
'Storage class update time',
obj.timeStorageClassUpdated.strftime('%a, %d %b %Y %H:%M:%S GMT')))
if obj.storageClass:
text_util.print_to_fd(MakeMetadataLine('Storage class', obj.storageClass))
if obj.temporaryHold:
text_util.print_to_fd(MakeMetadataLine('Temporary Hold', 'Enabled'))
if obj.eventBasedHold:
text_util.print_to_fd(MakeMetadataLine('Event-Based Hold', 'Enabled'))
if obj.retentionExpirationTime:
text_util.print_to_fd(
MakeMetadataLine(
'Retention Expiration',
obj.retentionExpirationTime.strftime('%a, %d %b %Y %H:%M:%S GMT')))
if obj.kmsKeyName:
text_util.print_to_fd(MakeMetadataLine('KMS key', obj.kmsKeyName))
if obj.cacheControl:
text_util.print_to_fd(MakeMetadataLine('Cache-Control', obj.cacheControl))
if obj.contentDisposition:
text_util.print_to_fd(
MakeMetadataLine('Content-Disposition', obj.contentDisposition))
if obj.contentEncoding:
text_util.print_to_fd(
MakeMetadataLine('Content-Encoding', obj.contentEncoding))
if obj.contentLanguage:
text_util.print_to_fd(
MakeMetadataLine('Content-Language', obj.contentLanguage))
text_util.print_to_fd(MakeMetadataLine('Content-Length', obj.size))
text_util.print_to_fd(MakeMetadataLine('Content-Type', obj.contentType))
if obj.componentCount:
text_util.print_to_fd(
MakeMetadataLine('Component-Count', obj.componentCount))
if obj.timeDeleted:
text_util.print_to_fd(
MakeMetadataLine('Archived time',
obj.timeDeleted.strftime('%a, %d %b %Y %H:%M:%S GMT')))
marker_props = {}
if obj.metadata and obj.metadata.additionalProperties:
non_marker_props = []
for add_prop in obj.metadata.additionalProperties:
if add_prop.key not in S3_MARKER_GUIDS:
non_marker_props.append(add_prop)
else:
marker_props[add_prop.key] = add_prop.value
if non_marker_props:
text_util.print_to_fd(MakeMetadataLine('Metadata', ''))
for ap in non_marker_props:
ap_key = '{}'.format(ap.key)
ap_value = '{}'.format(ap.value)
meta_data_line = MakeMetadataLine(ap_key, ap_value, indent=2)
text_util.print_to_fd(meta_data_line)
if obj.customerEncryption:
if not obj.crc32c:
text_util.print_to_fd(MakeMetadataLine('Hash (crc32c)', 'encrypted'))
if not obj.md5Hash:
text_util.print_to_fd(MakeMetadataLine('Hash (md5)', 'encrypted'))
text_util.print_to_fd(
MakeMetadataLine('Encryption algorithm',
obj.customerEncryption.encryptionAlgorithm))
text_util.print_to_fd(
MakeMetadataLine('Encryption key SHA256',
obj.customerEncryption.keySha256))
if obj.crc32c:
text_util.print_to_fd(MakeMetadataLine('Hash (crc32c)', obj.crc32c))
if obj.md5Hash:
text_util.print_to_fd(MakeMetadataLine('Hash (md5)', obj.md5Hash))
text_util.print_to_fd(MakeMetadataLine('ETag', obj.etag.strip('"\'')))
if obj.generation:
generation_str = GenerationFromUrlAndString(storage_url, obj.generation)
text_util.print_to_fd(MakeMetadataLine('Generation', generation_str))
if obj.metageneration:
text_util.print_to_fd(MakeMetadataLine('Metageneration',
obj.metageneration))
if incl_acl:
# JSON API won't return acls as part of the response unless we have
# full control scope
if obj.acl:
text_util.print_to_fd(
MakeMetadataLine('ACL', AclTranslation.JsonFromMessage(obj.acl)))
elif S3_ACL_MARKER_GUID in marker_props:
text_util.print_to_fd(
MakeMetadataLine('ACL', marker_props[S3_ACL_MARKER_GUID]))
else:
# Empty ACLs are possible with Bucket Policy Only and no longer imply
# ACCESS DENIED anymore.
text_util.print_to_fd(MakeMetadataLine('ACL', '[]'))
return (num_objs, num_bytes)
def PrintObject(bucket_listing_ref):
"""Default printing function for objects.
Args:
bucket_listing_ref: BucketListingRef of type OBJECT.
Returns:
(num_objects, num_bytes).
"""
try:
text_util.print_to_fd(bucket_listing_ref.url_string)
except IOError as e:
# Windows throws an IOError 0 here for object names containing Unicode
# chars. Ignore it.
if not (IS_WINDOWS and e.errno == 0):
raise
return (1, 0)
class LsHelper(object):
"""Helper class for ls and du."""
def __init__(self,
iterator_func,
logger,
print_object_func=PrintObject,
print_dir_func=PrintDir,
print_dir_header_func=PrintDirHeader,
print_bucket_header_func=PrintBucketHeader,
print_dir_summary_func=PrintDirSummary,
print_newline_func=PrintNewLine,
all_versions=False,
should_recurse=False,
exclude_patterns=None,
fields=('name',),
list_subdir_contents=True):
"""Initializes the helper class to prepare for listing.
Args:
iterator_func: Function for instantiating iterator.
Inputs-
url_string- Url string to iterate on. May include
wildcards.
all_versions=False- If true, iterate over all object
versions.
logger: Logger for outputting warnings / errors.
print_object_func: Function for printing objects.
print_dir_func: Function for printing buckets/prefixes.
print_dir_header_func: Function for printing header line for buckets
or prefixes.
print_bucket_header_func: Function for printing header line for buckets
or prefixes.
print_dir_summary_func: Function for printing size summaries about
buckets/prefixes.
print_newline_func: Function for printing new lines between dirs.
all_versions: If true, list all object versions.
should_recurse: If true, recursively listing buckets/prefixes.
exclude_patterns: Patterns to exclude when listing.
fields: Fields to request from bucket listings; this should
include all fields that need to be populated in
objects so they can be listed. Can be set to None
to retrieve all object fields. Defaults to short
listing fields.
list_subdir_contents: If true, return the directory and any contents,
otherwise return only the directory itself.
"""
self._iterator_func = iterator_func
self.logger = logger
self._print_object_func = print_object_func
self._print_dir_func = print_dir_func
self._print_dir_header_func = print_dir_header_func
self._print_bucket_header_func = print_bucket_header_func
self._print_dir_summary_func = print_dir_summary_func
self._print_newline_func = print_newline_func
self.all_versions = all_versions
self.should_recurse = should_recurse
self.exclude_patterns = exclude_patterns
self.bucket_listing_fields = fields
self.list_subdir_contents = list_subdir_contents
def ExpandUrlAndPrint(self, url):
"""Iterates over the given URL and calls print functions.
Args:
url: StorageUrl to iterate over.
Returns:
(num_objects, num_bytes) total number of objects and bytes iterated.
"""
num_objects = 0
num_dirs = 0
num_bytes = 0
print_newline = False
if url.IsBucket() or self.should_recurse:
# IsBucket() implies a top-level listing.
if url.IsBucket():
self._print_bucket_header_func(url)
return self._RecurseExpandUrlAndPrint(url.url_string,
print_initial_newline=False)
else:
# User provided a prefix or object URL, but it's impossible to tell
# which until we do a listing and see what matches.
top_level_iterator = PluralityCheckableIterator(
self._iterator_func(
url.CreatePrefixUrl(wildcard_suffix=None),
all_versions=self.all_versions).IterAll(
expand_top_level_buckets=True,
bucket_listing_fields=self.bucket_listing_fields))
plurality = top_level_iterator.HasPlurality()
try:
top_level_iterator.PeekException()
except EncryptionException:
# Detailed listing on a single object can perform a GetObjectMetadata
# call, which raises if a matching encryption key isn't found.
# Re-iterate without requesting encrypted fields.
top_level_iterator = PluralityCheckableIterator(
self._iterator_func(
url.CreatePrefixUrl(wildcard_suffix=None),
all_versions=self.all_versions).IterAll(
expand_top_level_buckets=True,
bucket_listing_fields=UNENCRYPTED_FULL_LISTING_FIELDS))
plurality = top_level_iterator.HasPlurality()
for blr in top_level_iterator:
if self._MatchesExcludedPattern(blr):
continue
if blr.IsObject():
nd = 0
no, nb = self._print_object_func(blr)
print_newline = True
elif blr.IsPrefix():
if print_newline:
self._print_newline_func()
else:
print_newline = True
if plurality and self.list_subdir_contents:
self._print_dir_header_func(blr)
elif plurality and not self.list_subdir_contents:
print_newline = False
expansion_url_str = StorageUrlFromString(
blr.url_string).CreatePrefixUrl(
wildcard_suffix='*' if self.list_subdir_contents else None)
nd, no, nb = self._RecurseExpandUrlAndPrint(expansion_url_str)
self._print_dir_summary_func(nb, blr)
else:
# We handle all buckets at the top level, so this should never happen.
raise CommandException(
'Sub-level iterator returned a CsBucketListingRef of type Bucket')
num_objects += no
num_dirs += nd
num_bytes += nb
return num_dirs, num_objects, num_bytes
def _RecurseExpandUrlAndPrint(self, url_str, print_initial_newline=True):
"""Iterates over the given URL string and calls print functions.
Args:
url_str: String describing StorageUrl to iterate over.
Must be of depth one or higher.
print_initial_newline: If true, print a newline before recursively
expanded prefixes.
Returns:
(num_objects, num_bytes) total number of objects and bytes iterated.
"""
num_objects = 0
num_dirs = 0
num_bytes = 0
for blr in self._iterator_func(
'%s' % url_str, all_versions=self.all_versions).IterAll(
expand_top_level_buckets=True,
bucket_listing_fields=self.bucket_listing_fields):
if self._MatchesExcludedPattern(blr):
continue
if blr.IsObject():
nd = 0
no, nb = self._print_object_func(blr)
elif blr.IsPrefix():
if self.should_recurse:
if print_initial_newline:
self._print_newline_func()
else:
print_initial_newline = True
self._print_dir_header_func(blr)
expansion_url_str = StorageUrlFromString(
blr.url_string).CreatePrefixUrl(wildcard_suffix='*')
nd, no, nb = self._RecurseExpandUrlAndPrint(expansion_url_str)
self._print_dir_summary_func(nb, blr)
else:
nd, no, nb = 1, 0, 0
self._print_dir_func(blr)
else:
# We handle all buckets at the top level, so this should never happen.
raise CommandException(
'Sub-level iterator returned a bucketListingRef of type Bucket')
num_dirs += nd
num_objects += no
num_bytes += nb
return num_dirs, num_objects, num_bytes
def _MatchesExcludedPattern(self, blr):
"""Checks bucket listing reference against patterns to exclude.
Args:
blr: BucketListingRef to check.
Returns:
True if reference matches a pattern and should be excluded.
"""
if self.exclude_patterns:
tomatch = six.ensure_str(blr.url_string)
for pattern in self.exclude_patterns:
if fnmatch.fnmatch(tomatch, six.ensure_str(pattern)):
return True
return False
| {
"pile_set_name": "Github"
} |
---
description: "Compiler Error CS0739"
title: "Compiler Error CS0739"
ms.date: 07/20/2015
f1_keywords:
- "CS0739"
helpviewer_keywords:
- "CS0739"
ms.assetid: c2a83015-401c-4d85-bb19-ed29800904c1
---
# Compiler Error CS0739
'type name' duplicate TypeForwardedToAttribute.
An assembly can have no more than one <xref:System.Runtime.CompilerServices.TypeForwardedToAttribute> to an external type.
## To correct this error
1. Locate and remove the duplicate <xref:System.Runtime.CompilerServices.TypeForwardedToAttribute>.
## Example
The following code generates CS0739:
```csharp
// CS0739.cs
// CS0739
// Assume that a class Test is declared in a separate dll
// with a namespace that is named cs739dll.
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(cs739dll.Test))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(cs739dll.Test))]
namespace cs0739
{
class Program
{
static void Main(string[] args)
{
}
}
}
```
## See also
- <xref:System.Runtime.CompilerServices.TypeForwardedToAttribute>
| {
"pile_set_name": "Github"
} |
namespace CGAL {
/*!
\ingroup PkgSegmentDelaunayGraph2Ref
The class `Segment_Delaunay_graph_2` represents the segment Delaunay graph (which is
the dual graph of the 2D segment Voronoi diagram).
Currently it supports only insertions of sites.
\tparam Gt must be a model of `SegmentDelaunayGraphTraits_2`
\tparam DS must be a model of `SegmentDelaunayGraphDataStructure_2`.
`DS` defaults to
`CGAL::Triangulation_data_structure_2< CGAL::Segment_Delaunay_graph_vertex_base_2<Gt>, CGAL::Triangulation_face_base_2<Gt> >`.
\cgalHeading{Traversal of the Segment Delaunay Graph}
A segment Delaunay graph can be seen as a container of faces and
vertices. Therefore the `Segment_Delaunay_graph_2` class provides several iterators
and circulators that allow to traverse it (completely or partially).
\cgalModels `DelaunayGraph_2`
\sa `DelaunayGraph_2`
\sa `SegmentDelaunayGraphTraits_2`
\sa `SegmentDelaunayGraphDataStructure_2`
\sa `SegmentDelaunayGraphVertexBase_2`
\sa `TriangulationFaceBase_2`
\sa `CGAL::Segment_Delaunay_graph_hierarchy_2<Gt,STag,DS>`
\sa `CGAL::Segment_Delaunay_graph_traits_2<K,MTag>`
\sa `CGAL::Segment_Delaunay_graph_traits_without_intersections_2<K,MTag>`
\sa `CGAL::Segment_Delaunay_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>`
\sa `CGAL::Segment_Delaunay_graph_filtered_traits_without_intersections_2<CK,CM,EK,EM,FK,FM>`
\sa `CGAL::Triangulation_data_structure_2<Vb,Fb>`
\sa `CGAL::Segment_Delaunay_graph_vertex_base_2<Gt,SSTag>`
\sa `CGAL::Triangulation_face_base_2<Gt>`
*/
template< typename Gt, typename DS >
class Segment_Delaunay_graph_2 {
public:
/// \name Types
/// @{
/*!
A type for the geometric traits.
*/
typedef Gt Geom_traits;
/*!
A type for the underlying
data structure.
*/
typedef DS Data_structure;
/*!
This type has been added so that the `Segment_Delaunay_graph_2` class is a model of
the `DelaunayGraph_2` concept.
*/
typedef Data_structure Triangulation_data_structure;
/*!
Size type (an unsigned integral type)
*/
typedef typename DS::size_type size_type;
/*!
A type for the
point defined in the geometric traits.
*/
typedef typename Gt::Point_2 Point_2;
/*!
A type for the segment Delaunay graph site, defined in the geometric
traits.
*/
typedef typename Gt::Site_2 Site_2;
/*!
A type for the container of points.
*/
typedef unspecified_type Point_container;
/*!
A handle for points in the point container.
*/
typedef typename Point_container::iterator Point_handle;
/// @}
/// \name Iterators and Handles
/// The vertices and faces of the segment Delaunay graph are accessed
/// through `handles`, `iterators` and `circulators`. The iterators
/// and circulators are all bidirectional and non-mutable. The
/// circulators and iterators are assignable to the corresponding
/// handle types, and they are also convertible to the corresponding
/// handles. The edges of the segment Delaunay graph can also be
/// visited through iterators and circulators, the edge circulators
/// and iterators are also bidirectional and non-mutable. In the
/// following, we call <I>infinite</I> any face or edge incident to
/// the infinite vertex and the infinite vertex itself. Any other
/// feature (face, edge or vertex) of the segment Delaunay graph is
/// said to be <I>finite</I>. Some iterators (the `All` iterators )
/// allow to visit finite or infinite features while the others (the
/// `Finite` iterators) visit only finite features. Circulators visit
/// both infinite and finite features.
/// @{
/*!
The edge type.
The `Edge(f,i)` is the edge common to faces `f` and
`f.neighbor(i)`. It is also the edge joining the vertices
`vertex(cw(i))` and `vertex(ccw(i))` of `f`.
\pre `i` must be `0`, `1` or `2`.
*/
typedef typename DS::Edge Edge;
/*!
A type for a vertex.
*/
typedef typename DS::Vertex Vertex;
/*!
A type for a face.
*/
typedef typename DS::Face Face;
/*!
A type for a handle to a vertex.
*/
typedef typename DS::Vertex_handle Vertex_handle;
/*!
A type for a handle to a face.
*/
typedef typename DS::Face_handle Face_handle;
/*!
A type for a circulator over vertices incident to a given vertex.
*/
typedef typename DS::Vertex_circulator Vertex_circulator;
/*!
A type for a circulator over faces incident to a given vertex.
*/
typedef typename DS::Face_circulator Face_circulator;
/*!
A type for a circulator over edges incident to a given vertex.
*/
typedef typename DS::Edge_circulator Edge_circulator;
/*!
A type for an iterator over all vertices.
*/
typedef typename DS::Vertex_iterator All_vertices_iterator;
/*!
A type for an iterator over all faces.
*/
typedef typename DS::Face_iterator All_faces_iterator;
/*!
A type for an iterator over all edges.
*/
typedef typename DS::Edge_iterator All_edges_iterator;
/*!
A type for an iterator over finite vertices.
*/
typedef unspecified_type Finite_vertices_iterator;
/*!
A type for an iterator over finite faces.
*/
typedef unspecified_type Finite_faces_iterator;
/*!
A type for an iterator over finite edges.
*/
typedef unspecified_type Finite_edges_iterator;
/// @}
/// \name Site Iterators
/// In addition to iterators and circulators for vertices and faces,
/// iterators for sites are provided. In particular there are
/// iterators for the set of input sites and the set of output
/// sites. The set of input sites is the set of sites inserted by the
/// user using the `insert` methods of this class. If a site is
/// inserted multiple times, every instance of this site will be
/// reported. The set of output sites is the set of sites in the
/// segment Delaunay graph. The value type of these iterators is
/// `Site_2`.
/// @{
/*!
A type for a bidirectional iterator over all input sites.
*/
typedef unspecified_type Input_sites_iterator;
/*!
A type for a bidirectional iterator over all output sites (the sites
in the Delaunay graph).
*/
typedef unspecified_type Output_sites_iterator;
/// @}
/// \name Creation
/// In addition to the default and copy constructors the following
/// constructors are defined:
/// @{
/*!
Creates the
segment Delaunay graph using `gt` as geometric traits.
*/
Segment_Delaunay_graph_2(Gt gt=Gt());
/*!
Creates the segment Delaunay graph using `gt` as geometric traits
and inserts all sites in the range [`first`, `beyond`).
\pre `Input_iterator` must be a model of `InputIterator`. The value type of `Input_iterator` must be either `Point_2` or `Site_2`.
*/
template< class Input_iterator >
Segment_Delaunay_graph_2(Input_iterator first, Input_iterator beyond,
Gt gt=Gt());
/// @}
/// \name Access Functions
/// @{
/*!
Returns a reference to the segment Delaunay graph traits object.
*/
Geom_traits geom_traits();
/*!
Returns the dimension of the segment Delaunay graph. The dimension
is \f$ -1\f$ if the graph contains no sites, \f$ 0\f$ if the graph
contains one site, \f$ 1\f$ if it contains two sites and \f$ 2\f$ if it
contains three or more sites.
*/
int dimension();
/*!
Returns the number of finite vertices of the segment Delaunay graph.
*/
size_type number_of_vertices();
/*!
Returns the number of faces (both finite and infinite) of the
segment Delaunay graph.
*/
size_type number_of_faces();
/*!
Return the number of input sites.
*/
size_type number_of_input_sites();
/*!
Return the number of output sites. This is equal to the number of
vertices in the segment Delaunay graph.
*/
size_type number_of_output_sites();
/*!
Returns a face incident to the `infinite_vertex`.
*/
Face_handle infinite_face();
/*!
Returns the `infinite_vertex`.
*/
Vertex_handle
infinite_vertex();
/*!
Returns a vertex distinct from the `infinite_vertex`.
\pre The number of sites in the segment Delaunay graph must be at least one.
*/
Vertex_handle finite_vertex();
/*!
Returns a reference to the
segment Delaunay graph data structure object.
*/
Data_structure data_structure();
/*!
Same as `data_structure()`. It
has been added for compliance to the `DelaunayGraph_2` concept.
*/
Data_structure tds();
/*!
Returns a reference to
the point container object.
*/
Point_container point_container();
/// @}
/// \name Finite Face, Edge and Vertex Iterators
/// The following iterators allow respectively to visit finite faces,
/// finite edges and finite vertices of the segment Delaunay
/// graph. These iterators are non-mutable, bidirectional and their
/// value types are respectively `Face`, `Edge` and `Vertex`. They are
/// all invalidated by any change in the segment Delaunay graph.
/// @{
/*!
Starts at an arbitrary finite vertex.
*/
Finite_vertices_iterator finite_vertices_begin();
/*!
Past-the-end iterator.
*/
Finite_vertices_iterator finite_vertices_end();
/*!
Starts at an arbitrary finite edge.
*/
Finite_edges_iterator finite_edges_begin();
/*!
Past-the-end iterator.
*/
Finite_edges_iterator finite_edges_end();
/*!
Starts at an arbitrary finite face.
*/
Finite_faces_iterator finite_faces_begin();
/*!
Past-the-end iterator.
*/
Finite_faces_iterator finite_faces_end()
const;
/// @}
/// \name Infinite Face, Edge, and Vertex Iterators
/// The following iterators allow respectively to visit all (both
/// finite and infinite) faces, edges and vertices of the segment
/// Delaunay graph. These iterators are non-mutable, bidirectional and
/// their value types are respectively `Face`, `Edge` and
/// `Vertex`. They are all invalidated by any change in the segment
/// Delaunay graph.
/// @{
/*!
Starts at an arbitrary vertex.
*/
All_vertices_iterator all_vertices_begin();
/*!
Past-the-end iterator.
*/
All_vertices_iterator all_vertices_end();
/*!
Starts at an arbitrary edge.
*/
All_edges_iterator all_edges_begin();
/*!
Past-the-end iterator.
*/
All_edges_iterator all_edges_end();
/*!
Starts at an arbitrary face.
*/
All_faces_iterator all_faces_begin();
/*!
Past-the-end iterator.
*/
All_faces_iterator all_faces_end();
/// @}
/// \name Site Iterators
/// The following iterators allow respectively to visit all
/// sites. These iterators are non-mutable, bidirectional and their
/// value type is `Site_2`. They are all invalidated by any change in
/// the segment Delaunay graph.
/// @{
/*!
Starts at an arbitrary input site.
*/
Input_sites_iterator input_sites_begin();
/*!
Past-the-end iterator.
*/
Input_sites_iterator input_sites_end();
/*!
Starts at an arbitrary output site.
*/
Output_sites_iterator output_sites_begin();
/*!
Past-the-end iterator.
*/
Output_sites_iterator output_sites_end();
/// @}
/// \name Face, Edge and Vertex Circulators
/// The `Segment_Delaunay_graph_2` class also provides circulators
/// that allow to visit respectively all faces or edges incident to a
/// given vertex or all vertices adjacent to a given vertex. These
/// circulators are non-mutable and bidirectional. The operator
/// `operator++` moves the circulator counterclockwise around the
/// vertex while the `operator-` moves clockwise. A face circulator is
/// invalidated by any modification of the face pointed to. An edge
/// circulator is invalidated by any modification in one of the two
/// faces incident to the edge pointed to. A vertex circulator is
/// invalidated by any modification in any of the faces adjacent to
/// the vertex pointed to.
///
/// Applied on the `infinite_vertex` the above methods allow to visit
/// the vertices on the convex hull and the infinite edges and
/// faces. Note that a counterclockwise traversal of the vertices
/// adjacent to the `infinite_vertex` is a clockwise traversal of the
/// convex hull.
/// @{
/*!
Starts at an arbitrary face incident
to `v`.
*/
Face_circulator incident_faces(Vertex_handle v);
/*!
Starts at face `f`.
\pre Face `f` is incident to vertex `v`.
*/
Face_circulator incident_faces(Vertex_handle v, Face_handle f);
/*!
Starts at an arbitrary edge incident
to `v`.
*/
Edge_circulator incident_edges(Vertex_handle v);
/*!
Starts at the first edge of `f` incident to
`v`, in counterclockwise order around `v`.
\pre Face `f` is incident to vertex `v`.
*/
Edge_circulator incident_edges(Vertex_handle v, Face_handle f);
/*!
Starts at an arbitrary vertex incident
to `v`.
*/
Vertex_circulator incident_vertices(Vertex_handle v);
/*!
Starts at the first vertex of `f` adjacent to `v`
in counterclockwise order around `v`.
\pre Face `f` is incident to vertex `v`.
*/
Vertex_circulator incident_vertices(Vertex_handle v, Face_handle f);
/// @}
/// \name Predicates
/// The class `Segment_Delaunay_graph_2` provides methods to test the
/// finite or infinite character of any feature.
/// @{
/*!
`true`, iff `v` is the `infinite_vertex`.
*/
bool is_infinite(Vertex_handle v) const;
/*!
`true`, iff face `f` is infinite.
*/
bool is_infinite(Face_handle f) const;
/*!
`true`, iff edge `(f,i)` is infinite.
*/
bool is_infinite(Face_handle f, int i) const;
/*!
`true`, iff edge `e` is infinite.
*/
bool is_infinite(Edge e) const;
/*!
`true`, iff edge `*ec` is infinite.
*/
bool is_infinite(Edge_circulator ec) const;
/// @}
/// \name Insertion
/// @{
/*!
Inserts the sites in the range
[`first`,`beyond`). The number of additional sites inserted in
the Delaunay graph is returned. `Input_iterator` must be a model of
`InputIterator` and its value type must be
either `Point_2` or `Site_2`.
*/
template< class Input_iterator >
size_type insert(Input_iterator first, Input_iterator beyond);
/*!
Same as the previous method. `Input_iterator` must be a model of
`InputIterator` and its value type must be
either `Point_2` or `Site_2`.
*/
template< class Input_iterator >
size_type insert(Input_iterator first, Input_iterator beyond, Tag_false);
/*!
Decomposes the range [first,beyond) into a range of input points and a range of input segments
that are respectively passed to `insert_segments()` and `insert_points()`.
Non-input sites are first random_shuffled and then inserted one by one.
`Input_iterator` must be a model of `InputIterator` and its value type must be
either `Point_2`, `Segment_2` or `Site_2`.
\return the number of sites inserted in the Delaunay graph
*/
template< class Input_iterator >
size_type insert(Input_iterator first, Input_iterator beyond, Tag_true);
/*!
Inserts the points in the range [first,beyond) as sites.
Note that this function is not guaranteed to insert the points
following the order of `PointInputIterator`, as `spatial_sort()`
is used to improve efficiency.
\return the number of points inserted in the Delaunay graph
\tparam PointIterator must be an input iterator `Point_2` or `Site_2` as value_type.
*/
template <class PointIterator>
std::size_t insert_points(PointIterator first, PointIterator beyond);
/*!
Inserts the segments in the range [first,beyond) as sites.
Note that this function is not guaranteed to insert the segments
following the order of `SegmentIterator`, as `spatial_sort()`
is used to improve efficiency.
\return the number of segments inserted in the Delaunay graph
\tparam SegmentIterator must be an input iterator with `Site_2`, `Segment_2` or `std::pair<Point_2,Point_2>` as value type.
*/
template <class SegmentIterator>
std::size_t insert_segments(SegmentIterator first, SegmentIterator beyond);
/*!
Same as above except that each segment is given as a pair of indices of the points
in the range [points_first, points_beyond). The indices must start from 0 to `std::distance(points_first, points_beyond)`
\tparam PointIterator is an input iterator with `Point_2` as value type.
\tparam IndicesIterator is an input iterator with `std::pair<std::size_t, std::size_t>` as value type.
*/
template <class PointIterator, class IndicesIterator>
std::size_t insert_segments(PointIterator points_first, PointIterator points_beyond,
IndicesIterator indices_first, IndicesIterator indices_beyond);
/*!
Inserts the
point `p` in the segment Delaunay graph. If `p` has already
been inserted, then the vertex handle of its already inserted copy is
returned. If `p` has not been inserted yet, the vertex handle of
`p` is returned.
*/
Vertex_handle insert(Point_2 p);
/*!
Inserts `p` in the segment Delaunay graph using the site
associated with `vnear` as an estimate for the nearest neighbor
of `p`. The vertex handle returned has the same semantics as
the vertex handle returned by the method
`Vertex_handle insert(Point_2 p)`.
*/
Vertex_handle insert(Point_2 p, Vertex_handle vnear);
/*!
Inserts the
closed segment with endpoints `p1` and `p2` in the segment
Delaunay graph. If the segment has already been inserted in the
Delaunay graph then the vertex handle of its already inserted copy is
returned. If the segment does not intersect any segment in the
existing diagram, the vertex handle corresponding to its
corresponding open segment is returned. Finally, if the segment
intersects other segments in the existing Delaunay graph, the
vertex handle to one of its open subsegments is returned.
*/
Vertex_handle insert(Point_2 p1, Point_2 p2);
/*!
Inserts the segment whose endpoints are `p1` and `p2`
in the segment Delaunay graph using the site
associated with `vnear` as an estimate for the nearest neighbor
of `p1`. The vertex handle returned has the same semantics as the
vertex handle returned by the method
`Vertex_handle insert(Point_2 p1, Point_2 p2)`.
*/
Vertex_handle insert(Point_2 p1, Point_2 p2, Vertex_handle
vnear);
/*!
Inserts the site `s` in the
segment Delaunay graph. The vertex handle returned has the same
semantics as the vertex handle returned by the methods
`Vertex_handle insert(Point_2 p)` and `Vertex_handle insert(Point_2 p1, Point_2 p2)`, depending on whether `s`
represents a point or a segment respectively.
\pre `s.is_input()` must be `true`.
*/
Vertex_handle insert(Site_2 s);
/*!
Inserts `s` in the segment Delaunay graph using the site
associated with `vnear` as an estimate for the nearest neighbor of
`s`, if `s` is a point, or the first endpoint of `s`, if
`s` is a segment. The vertex handle returned has the same
semantics as the vertex handle returned by the method
`Vertex_handle insert(Site_2 s)`.
\pre `s.is_input()` must be `true`.
*/
Vertex_handle insert(Site_2 s, Vertex_handle
vnear);
/// @}
/// \name Nearest neighbor location
/// @{
/*!
Finds the nearest neighbor of the point `p`. In other words it
finds the site whose segment Voronoi diagram cell contains
`p`. Ties are broken arbitrarily and one of the nearest neighbors
of `p` is returned. If there are no sites in the
segment Delaunay graph `Vertex_handle()` is returned.
*/
Vertex_handle nearest_neighbor(Point_2 p);
/*!
Finds the nearest neighbor of the point
`p` using the site associated with `vnear` as an
estimate for the nearest neighbor of `p`. Ties are broken
arbitrarily and one of the nearest neighbors of `p` is
returned. If there are no sites in the segment Delaunay graph
`Vertex_handle()` is returned.
*/
Vertex_handle nearest_neighbor(Point_2 p,
Vertex_handle vnear);
/// @}
/// \name I/O
/// @{
/*!
Draws the segment Voronoi
diagram to the stream `str`. The following operators must be
defined:
`Stream& operator<<(Stream&, Gt::Segment_2)`
`Stream& operator<<(Stream&, Gt::Ray_2)`
`Stream& operator<<(Stream&, Gt::Line_2)`
*/
template < class Stream >
Stream& draw_dual(Stream& str);
/*!
Draws the segment Voronoi
diagram to the stream `str`, except the edges of the diagram
corresponding to a segment and its endpoints.
The following operators must be defined:
`Stream& operator<<(Stream&, Gt::Segment_2)`
`Stream& operator<<(Stream&, Gt::Ray_2)`
`Stream& operator<<(Stream&, Gt::Line_2)`
*/
template < class Stream >
Stream& draw_skeleton(Stream& str);
/*!
Draws the edge `e` of
the segment Voronoi diagram to the stream `str`.
The following operators must be defined:
`Stream& operator<<(Stream&, Gt::Segment_2)`
`Stream& operator<<(Stream&, Gt::Ray_2)`
`Stream& operator<<(Stream&, Gt::Line_2)`
\pre `e` must be a finite edge.
*/
template< class Stream >
Stream& draw_dual_edge(Edge e, Stream& str);
/*!
Draws the edge `*ec` of the segment Voronoi diagram to the stream
`str`.
The following operators must be defined:
`Stream& operator<<(Stream&, Gt::Segment_2)`
`Stream& operator<<(Stream&, Gt::Ray_2)`
`Stream& operator<<(Stream&, Gt::Line_2)`
\pre `*ec` must be a finite edge.
*/
template< class Stream >
Stream& draw_dual_edge(Edge_circulator ec, Stream& str);
/*!
Draws the edge `*eit` of the segment Voronoi diagram to the
stream `str`.
The following operators must be defined:
`Stream& operator<<(Stream&, Gt::Segment_2)`
`Stream& operator<<(Stream&, Gt::Ray_2)`
`Stream& operator<<(Stream&, Gt::Line_2)`
\pre `*eit` must be a finite edge.
*/
template< class Stream >
Stream& draw_dual_edge(All_edges_iterator eit, Stream& str);
/*!
Draws the edge `*eit` of the segment Voronoi diagram to the
stream `str`.
The following operators must be defined:
`Stream& operator<<(Stream&, Gt::Segment_2)`
`Stream& operator<<(Stream&, Gt::Ray_2)`
`Stream& operator<<(Stream&, Gt::Line_2)`
*/
template< class Stream >
Stream& draw_dual_edge(Finite_edges_iterator eit, Stream& str);
/*!
Writes the current
state of the segment Delaunay graph to an output stream. In particular,
all sites in the diagram are written to the stream (represented
through appropriate input sites), as well as the underlying
combinatorial data structure.
*/
void file_output(std::ostream& os);
/*!
Reads the state of the
segment Delaunay graph from an input stream.
*/
void file_input(std::istream& is);
/*!
Writes the current state of the segment Delaunay graph to an output stream.
*/
std::ostream& operator<<(std::ostream& os, Segment_Delaunay_graph_2<Gt,DS> sdg);
/*!
Reads the state of the segment Delaunay graph from an input stream.
*/
std::istream& operator>>(std::istream& is, Segment_Delaunay_graph_2<Gt,DS> sdg);
/// @}
/// \name Validity check
/// @{
/*!
Checks the validity of the segment Delaunay graph. If `verbose`
is `true` a short message is sent to `std::cerr`. If
`level` is 0, only the data structure is validated. If
`level` is 1, then both the data structure and the segment
Delaunay graph are validated. Negative values of `level` always
return true, and values greater than 1 are equivalent to `level`
being 1.
*/
bool is_valid(bool verbose = false, int level = 1);
/// @}
/// \name Miscellaneous
/// @{
/*!
Clears all contents of the segment Delaunay graph.
*/
void clear();
/*!
The segment Delaunay graphs
`other` and `*this` are swapped. For a segment Delaunay graph `sdg`, the operation
`sdg`.`swap(other)` should be preferred to `sdg``= other` or to `sdg``(other)` if
`other` is deleted afterwards.
*/
void swap(Segment_Delaunay_graph_2<Gt,DS>
other);
/// @}
}; /* end Segment_Delaunay_graph_2 */
} /* end namespace CGAL */
| {
"pile_set_name": "Github"
} |
<Type Name="GenericBase<U>+NestedCollection" FullName="Mono.DocTest.Generic.GenericBase<U>+NestedCollection">
<TypeSignature Language="C#" Value="public class GenericBase<U>.NestedCollection" />
<TypeSignature Language="ILAsm" Value=".class nested public auto ansi beforefieldinit GenericBase`1/NestedCollection<U> extends System.Object" />
<AssemblyInfo>
<AssemblyName>DocTest</AssemblyName>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeParameters>
<TypeParameter Name="U" />
</TypeParameters>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>To be added.</summary>
<remarks>T:Mono.DocTest.Generic.GenericBase`1.NestedCollection</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public NestedCollection ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyVersion>0.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>
| {
"pile_set_name": "Github"
} |
// Copyright 2008, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * 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.
//
// The Google C++ Testing and Mocking Framework (Google Test)
//
// This header file provides classes and functions used internally
// for testing Google Test itself.
#ifndef GTEST_TEST_GTEST_PARAM_TEST_TEST_H_
#define GTEST_TEST_GTEST_PARAM_TEST_TEST_H_
#include "gtest/gtest.h"
// Test fixture for testing definition and instantiation of a test
// in separate translation units.
class ExternalInstantiationTest : public ::testing::TestWithParam<int> {
};
// Test fixture for testing instantiation of a test in multiple
// translation units.
class InstantiationInMultipleTranslaionUnitsTest
: public ::testing::TestWithParam<int> {
};
#endif // GTEST_TEST_GTEST_PARAM_TEST_TEST_H_
| {
"pile_set_name": "Github"
} |
/******************************************************************************/
/******************************************************************************/
class Obj : ObjData
{
static int ComparePtr(Obj*C &a, Obj*C &b);
Area *area;
bool selected, highlighted,
invalid_refs,
visible; // this should be reflection of the 'World.obj_visible'
EDIT_OBJ_TYPE edit_type;
MeshPtr mesh, mesh_proper; // 'mesh_proper' is set to proper MeshPtr to avoid reloading/unloading meshes in case they are empty because 'mesh' will be forced to 'WorldEdit.dummy_mesh' if empty
int mesh_variation;
PhysBodyPtr phys;
ImagePtr icon;
Particles particles;
Vec light_col;
flt light_angle, light_falloff;
bool light_cast_shadows;
~Obj();
// get
bool setInvalidRefs();
bool invalidRefs()C;
cchar8* variationName()C;
Matrix drawMatrix();
Vec pos();
Vec center();
bool getBox(Box &box);
bool onGround();
bool embedded();
void getCol(Color &col_lit, Color&col_shape);
PhysPath physPath()C;
// operations
void attach(WorldData &world, Area *a=null);
void detach();
void setUpdatability();
void setVisibility();
void removeChanged();
void remove();
void create(C Obj &src);
bool sync(C ObjData &src, cchar *edit_path);
bool undo(C ObjData &src, cchar *edit_path);
Obj& setChangedEmbed(C VecI2 *area_xy=null); // must be called after 'changedObj' and before 'setChangedPaths'
Obj& setChangedPaths(); // must be called after 'setChangedEmbed'
Obj& setChanged(bool matrix=false); // this needs to be called after making all changes
void setUndo(cptr type=WorldUndo::ObjType, bool as_new=false);
void moveTo(C Vec &pos, cptr undo_type=WorldUndo::ObjType);
void moveTo(C Matrix3 &orn, cptr undo_type=WorldUndo::ObjType);
void moveTo(C Matrix &matrix, cptr undo_type=WorldUndo::ObjType);
void scaleBy (flt f);
void scaleXBy(flt f);
void scaleYBy(flt f);
void scaleZBy(flt f);
void randomRot();
void resetRot();
void alignGrid();
void alignTerrain(bool force, cptr undo_type=WorldUndo::ObjType);
void alignNormal(int axis=-1, flt blend=1);
// update
void update();
// draw
bool skipDraw();
void draw();
void drawShadow();
void drawParticle();
void drawSelected();
void drawHelper(bool box, bool phys);
// io
void setDraw();
void setMeshVariation();
void setMeshPhys();
bool save(File &f);
bool load(File &f); // 'setMeshPhys' doesn't need to be called because it will be called in 'attach->removeChanged'
public:
Obj();
};
/******************************************************************************/
/******************************************************************************/
/******************************************************************************/
| {
"pile_set_name": "Github"
} |
"Filed out from Dolphin Smalltalk 7"!
ArrayedCollection variableSubclass: #WeakArray
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
classInstanceVariableNames: ''!
WeakArray guid: (GUID fromString: '{87b4c515-026e-11d3-9fd7-00a0cc3e4a32}')!
WeakArray comment: ''!
!WeakArray categoriesForClass!Collections-Arrayed!Collections-Weak! !
!WeakArray methodsFor!
add: newElement
"Add newElement to the receiver by replacing any available Corpses, or failing that by
appending it."
self addAnsweringIndex: newElement.
^newElement
!
addAnsweringIndex: newElement
"Add newElement to the receiver by overwriting the first corpse. If there are no corpses
then append it. This is a very useful method in many system support tasks (e.g. the Dependency
mechanism)."
^self replaceIdentity: DeadObject current with: newElement
!
corpsesDo: aBlock
"Locate each indexable variable of the receiver which formally housed an Object
which has sadly expired, and pass its index to aBlock for evaluation. This
method is non-destructive and may be evaluated repeatedly. Should you require
to clear the slots formerly occuppied by corpses so that they are not
subsequently treated as deaths, use the #nilCorpsesAndDo: message"
| deathAt size corpse |
size := self basicSize.
corpse := DeadObject current.
deathAt := self basicIdentityIndexOf: corpse from: 1 to: size.
[deathAt > 0] whileTrue: [
aBlock value: deathAt.
deathAt := self basicIdentityIndexOf: corpse from: deathAt+1 to: size]!
initialize
"Initialize the receiver's state.
By default the receiver only weakly references its elements."
self beWeak!
nilCorpsesAndDo: aBlock
"Locate each indexable variable of the receiver which formally housed an Object
which has sadly expired, nil the slot, and pass its index to aBlock for evaluation.
This is destructive, and is suitable for use where each death is to be processed only
once. Should you not wish to nil out the corpses, use #corpsesDo:.
N.B. We allow for aBlock to modify the contents of the receiver by continuing the search
from position of the Corpse we've just nilled, just in case aBlock moves a Corpse
there. This can be useful behavior and has negligible effect on performance."
| deathAt size corpse |
size := self basicSize.
corpse := DeadObject current.
deathAt := self basicIdentityIndexOf: corpse from: 1 to: size.
[deathAt > 0] whileTrue: [
self at: deathAt put: nil.
aBlock value: deathAt.
deathAt := self basicIdentityIndexOf: corpse from: deathAt to: size]!
nonCorpsesDo: aBlock
"Evaluate aBlock for all non-Corpse elements of the receiver. Answer the receiver."
| corpse |
corpse := DeadObject current.
1 to: self basicSize
do:
[:index |
| element |
element := self at: index.
element == corpse ifFalse: [aBlock value: element]]!
remove: oldElement ifAbsent: exceptionHandler
"Private - Remove the argument, oldElement, as an element of the receiver by overwriting it with
the Corpse object, and answer oldElement. If oldElement is not an element of the receiver, then
answer the result of evaluating the niladic valuable, exceptionHandler."
| index |
index := self basicIdentityIndexOf: oldElement from: 1 to: self basicSize.
^index == 0
ifTrue: [exceptionHandler value]
ifFalse: [self basicAt: index put: DeadObject current. oldElement]!
species
"Answer the kind of Collection that should result from enumerations such as #collect:
and #select: when applied against the receiver"
^Array! !
!WeakArray categoriesFor: #add:!adding!public! !
!WeakArray categoriesFor: #addAnsweringIndex:!adding!public! !
!WeakArray categoriesFor: #corpsesDo:!enumerating!public! !
!WeakArray categoriesFor: #initialize!initializing!public! !
!WeakArray categoriesFor: #nilCorpsesAndDo:!enumerating!public! !
!WeakArray categoriesFor: #nonCorpsesDo:!enumerating!public! !
!WeakArray categoriesFor: #remove:ifAbsent:!private!removing! !
!WeakArray categoriesFor: #species!accessing!public! !
!WeakArray class methodsFor!
new: anInteger
"Answer a new instance of the receiver with anInteger indexed instance variables
The new instance is registered with the memory manager as a weakling"
^(super new: anInteger) initialize! !
!WeakArray class categoriesFor: #new:!instance creation!public! !
| {
"pile_set_name": "Github"
} |
# Do not edit. Source files are in /res/country_metadata
isLeftHandTraffic: true
mobileCountryCode: 539
officialLanguages: [to, en]
orchardProduces: [coconut, lemon, lime, orange, tomato, banana, vanilla, coffee]
| {
"pile_set_name": "Github"
} |
package com.brandongogetap.stickyheaders;
import android.content.Context;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.brandongogetap.stickyheaders.ViewRetriever.RecyclerViewRetriever;
import com.brandongogetap.stickyheaders.exposed.StickyHeader;
import com.brandongogetap.stickyheaders.exposed.StickyHeaderHandler;
import com.brandongogetap.stickyheaders.exposed.StickyHeaderListener;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public class StickyLayoutManager extends LinearLayoutManager {
private StickyHeaderPositioner positioner;
private StickyHeaderHandler headerHandler;
private List<Integer> headerPositions = new ArrayList<>();
private RecyclerViewRetriever viewRetriever;
private int headerElevation = StickyHeaderPositioner.NO_ELEVATION;
/**
* If {@code false}, the {@link android.view.ViewParent} of this layout manager's {@link RecyclerView}
* will not be validated against supported types.
* <p>
* See {@link #disableParentViewRestrictions()}
*/
private boolean enforceParentViewRestrictions = true;
@Nullable
private StickyHeaderListener listener;
public StickyLayoutManager(Context context, StickyHeaderHandler headerHandler) {
this(context, VERTICAL, false, headerHandler);
init(headerHandler);
}
public StickyLayoutManager(Context context, int orientation, boolean reverseLayout, StickyHeaderHandler headerHandler) {
super(context, orientation, reverseLayout);
init(headerHandler);
}
private void init(StickyHeaderHandler stickyHeaderHandler) {
Preconditions.checkNotNull(stickyHeaderHandler, "StickyHeaderHandler == null");
this.headerHandler = stickyHeaderHandler;
}
/**
* Register a callback to be invoked when a header is attached/re-bound or detached.
*
* @param listener The callback that will be invoked, or null to unset.
*/
public void setStickyHeaderListener(@Nullable StickyHeaderListener listener) {
this.listener = listener;
if (positioner != null) {
positioner.setListener(listener);
}
}
/**
* Enable or disable elevation for Sticky Headers.
* <p>
* If you want to specify a specific amount of elevation, use
* {@link StickyLayoutManager#elevateHeaders(int)}
*
* @param elevateHeaders Enable Sticky Header elevation. Default is false.
*/
public void elevateHeaders(boolean elevateHeaders) {
this.headerElevation = elevateHeaders ?
StickyHeaderPositioner.DEFAULT_ELEVATION : StickyHeaderPositioner.NO_ELEVATION;
elevateHeaders(headerElevation);
}
/**
* Enable Sticky Header elevation with a specific amount.
*
* @param dp elevation in dp
*/
public void elevateHeaders(int dp) {
this.headerElevation = dp;
if (positioner != null) {
positioner.setElevateHeaders(dp);
}
}
/**
* Used to override the default behavior of validating supported
* {@link android.view.ViewParent}s of the {@link RecyclerView}.
* <p>
* This is opt-in because of broken behavior that may occur when, for example, the RecyclerView
* parent is a LinearLayout.
*/
public void disableParentViewRestrictions() {
this.enforceParentViewRestrictions = false;
}
@Override
public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
super.onLayoutChildren(recycler, state);
cacheHeaderPositions();
if (positioner != null) {
runPositionerInit();
}
}
@Override
public int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler, RecyclerView.State state) {
int scroll = super.scrollVerticallyBy(dy, recycler, state);
if (Math.abs(scroll) > 0) {
if (positioner != null) {
positioner.updateHeaderState(
findFirstVisibleItemPosition(), getVisibleHeaders(), viewRetriever, findFirstCompletelyVisibleItemPosition() == 0);
}
}
return scroll;
}
@Override
public int scrollHorizontallyBy(int dx, RecyclerView.Recycler recycler, RecyclerView.State state) {
int scroll = super.scrollHorizontallyBy(dx, recycler, state);
if (Math.abs(scroll) > 0) {
if (positioner != null) {
positioner.updateHeaderState(
findFirstVisibleItemPosition(), getVisibleHeaders(), viewRetriever, findFirstCompletelyVisibleItemPosition() == 0);
}
}
return scroll;
}
@Override
public void removeAndRecycleAllViews(RecyclerView.Recycler recycler) {
super.removeAndRecycleAllViews(recycler);
if (positioner != null) {
positioner.clearHeader();
}
}
@Override
public void onAttachedToWindow(RecyclerView view) {
if (enforceParentViewRestrictions) {
Preconditions.validateParentView(view);
}
viewRetriever = new RecyclerViewRetriever(view);
positioner = new StickyHeaderPositioner(view);
positioner.setElevateHeaders(headerElevation);
positioner.setListener(listener);
if (headerPositions.size() > 0) {
// Layout has already happened and header positions are cached. Catch positioner up.
positioner.setHeaderPositions(headerPositions);
runPositionerInit();
}
super.onAttachedToWindow(view);
}
@Override
public void onDetachedFromWindow(RecyclerView view, RecyclerView.Recycler recycler) {
if (positioner != null) {
positioner.clearVisibilityObserver();
}
super.onDetachedFromWindow(view, recycler);
}
private void runPositionerInit() {
positioner.reset(getOrientation());
positioner.updateHeaderState(findFirstVisibleItemPosition(), getVisibleHeaders(), viewRetriever, findFirstCompletelyVisibleItemPosition() == 0);
}
private Map<Integer, View> getVisibleHeaders() {
Map<Integer, View> visibleHeaders = new LinkedHashMap<>();
for (int i = 0; i < getChildCount(); i++) {
View view = getChildAt(i);
int dataPosition = getPosition(view);
if (headerPositions.contains(dataPosition)) {
visibleHeaders.put(dataPosition, view);
}
}
return visibleHeaders;
}
private void cacheHeaderPositions() {
headerPositions.clear();
List<?> adapterData = headerHandler.getAdapterData();
if (adapterData == null) {
if (positioner != null) {
positioner.setHeaderPositions(headerPositions);
}
return;
}
for (int i = 0; i < adapterData.size(); i++) {
if (adapterData.get(i) instanceof StickyHeader) {
headerPositions.add(i);
}
}
if (positioner != null) {
positioner.setHeaderPositions(headerPositions);
}
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2012-present Oliver Eilhard. All rights reserved.
// Use of this source code is governed by a MIT-license.
// See http://olivere.mit-license.org/license.txt for details.
package elastic
// BucketScriptAggregation is a parent pipeline aggregation which executes
// a script which can perform per bucket computations on specified metrics
// in the parent multi-bucket aggregation. The specified metric must be
// numeric and the script must return a numeric value.
//
// For more details, see
// https://www.elastic.co/guide/en/elasticsearch/reference/6.0/search-aggregations-pipeline-bucket-script-aggregation.html
type BucketScriptAggregation struct {
format string
gapPolicy string
script *Script
subAggregations map[string]Aggregation
meta map[string]interface{}
bucketsPathsMap map[string]string
}
// NewBucketScriptAggregation creates and initializes a new BucketScriptAggregation.
func NewBucketScriptAggregation() *BucketScriptAggregation {
return &BucketScriptAggregation{
subAggregations: make(map[string]Aggregation),
bucketsPathsMap: make(map[string]string),
}
}
func (a *BucketScriptAggregation) Format(format string) *BucketScriptAggregation {
a.format = format
return a
}
// GapPolicy defines what should be done when a gap in the series is discovered.
// Valid values include "insert_zeros" or "skip". Default is "insert_zeros".
func (a *BucketScriptAggregation) GapPolicy(gapPolicy string) *BucketScriptAggregation {
a.gapPolicy = gapPolicy
return a
}
// GapInsertZeros inserts zeros for gaps in the series.
func (a *BucketScriptAggregation) GapInsertZeros() *BucketScriptAggregation {
a.gapPolicy = "insert_zeros"
return a
}
// GapSkip skips gaps in the series.
func (a *BucketScriptAggregation) GapSkip() *BucketScriptAggregation {
a.gapPolicy = "skip"
return a
}
// Script is the script to run.
func (a *BucketScriptAggregation) Script(script *Script) *BucketScriptAggregation {
a.script = script
return a
}
// SubAggregation adds a sub-aggregation to this aggregation.
func (a *BucketScriptAggregation) SubAggregation(name string, subAggregation Aggregation) *BucketScriptAggregation {
a.subAggregations[name] = subAggregation
return a
}
// Meta sets the meta data to be included in the aggregation response.
func (a *BucketScriptAggregation) Meta(metaData map[string]interface{}) *BucketScriptAggregation {
a.meta = metaData
return a
}
// BucketsPathsMap sets the paths to the buckets to use for this pipeline aggregator.
func (a *BucketScriptAggregation) BucketsPathsMap(bucketsPathsMap map[string]string) *BucketScriptAggregation {
a.bucketsPathsMap = bucketsPathsMap
return a
}
// AddBucketsPath adds a bucket path to use for this pipeline aggregator.
func (a *BucketScriptAggregation) AddBucketsPath(name, path string) *BucketScriptAggregation {
if a.bucketsPathsMap == nil {
a.bucketsPathsMap = make(map[string]string)
}
a.bucketsPathsMap[name] = path
return a
}
func (a *BucketScriptAggregation) Source() (interface{}, error) {
source := make(map[string]interface{})
params := make(map[string]interface{})
source["bucket_script"] = params
if a.format != "" {
params["format"] = a.format
}
if a.gapPolicy != "" {
params["gap_policy"] = a.gapPolicy
}
if a.script != nil {
src, err := a.script.Source()
if err != nil {
return nil, err
}
params["script"] = src
}
// Add buckets paths
if len(a.bucketsPathsMap) > 0 {
params["buckets_path"] = a.bucketsPathsMap
}
// AggregationBuilder (SubAggregations)
if len(a.subAggregations) > 0 {
aggsMap := make(map[string]interface{})
source["aggregations"] = aggsMap
for name, aggregate := range a.subAggregations {
src, err := aggregate.Source()
if err != nil {
return nil, err
}
aggsMap[name] = src
}
}
// Add Meta data if available
if len(a.meta) > 0 {
source["meta"] = a.meta
}
return source, nil
}
| {
"pile_set_name": "Github"
} |
//
// Scratch and See
//
// The project provides en effect when the user swipes the finger over one texture
// and by swiping reveals the texture underneath it. The effect can be applied for
// scratch-card action or wiping a misted glass.
//
// Copyright (C) 2012 http://moqod.com Andrew Kopanev <andrew@moqod.com>
//
// 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.
//
#ifndef _MATRIX_H_
#define _MATRIX_H_
#import <Foundation/Foundation.h>
typedef struct {
size_t x;
size_t y;
} MDSize;
MDSize MDSizeMake(size_t x,size_t y){
MDSize r = {x,y};
return r;
}
@interface MDMatrix : NSObject
-(id)initWithMaxX:(size_t)x MaxY:(size_t)y;
-(id)initWithMax:(MDSize) maxCoords;
-(char)valueForCoordinates:(size_t)x y:(size_t)y;
-(void)setValue:(char)value forCoordinates:(size_t)x y:(size_t)y;
-(void)fillWithValue:(char)value;
@property (readonly, assign) MDSize max;
@end
#endif //_MATRIX_H_ | {
"pile_set_name": "Github"
} |
.pb-editor-dragging {
.pb-disable {
z-index: 10000000;
opacity: 0.5;
background-color: red;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
/* Append this class to the DOM elements you want to disable during element dragging. */
.pb-editor-dragging--disabled {
&:before {
content: " ";
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 10;
background-color: #b0b0b0;
}
iframe {
pointer-events: none;
}
}
}
.pb-editor-resizing {
/* Append this class to the DOM elements you want to disable during element resizing. */
.pb-editor-resizing--disabled {
&:before {
content: " ";
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 10;
background-color: #b0b0b0;
}
iframe {
pointer-events: none;
}
}
}
.pb-editor {
&.pb-editor-no-highlight {
.type {
display: none !important;
}
.webiny-pb-page-element-container::after {
content: none;
}
}
}
| {
"pile_set_name": "Github"
} |
/**
* @author rkereskenyi / https://github.com/rkereskenyi
*/
@import "Port";
$min-width: 65px;
$height: 40px;
$border: 1px solid #000000;
$padding: 3px;
$background-color: #ECECEC;
//$box-shadow: inset 0px 0px 7px 0px rgba(0, 0, 0, .15);
$selected-background-color: #DBEAFC;
$selected-border: 1px solid #52A8EC;
$ports-background-color: #000000;
$left-ports-background-color: rgba(255, 255, 0, 0.5);
$right-ports-background-color: rgba(0, 0, 255, 0.5);
$center-ports-background-color: rgba(0, 255, 0, 0.5);
$ports-width: 50px;
$ports-separator-width: 15px;
$accept-droppable-background-color: #00FF00 !important;
$ptr-hover-background-color: rgba(82, 168, 236, 0.8);
$ptr-hover-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
$model-name-height: 16px;
$abstract-class-name-color: #AAAAAA;
@mixin model_decorator_core {
.model-decorator {
min-width: $min-width;
min-height: $height;
border: $border;
background-color: $background-color;
padding: $padding;
text-align: center;
position: relative;
//-webkit-box-shadow: $box-shadow;
//-moz-box-shadow: $box-shadow;
//box-shadow: $box-shadow;
.name {
white-space: nowrap;
font-size: 11px;
font-weight: bold;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
//text-transform: uppercase;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
width: $ports-width * 2 + $ports-separator-width + $padding * 2;
border-bottom: none;
height: $model-name-height;
line-height: $model-name-height;
}
div.conn-type {
font-size: 9px;
line-height: 12px;
color: $abstract-class-name-color;
}
.ports {
font-size: 10px;
min-height: 16px;
width: $ports-width * 2 + $ports-separator-width + $padding * 2;
position: relative;
.left {
display: inline-block;
vertical-align: top;
width: $ports-width;
min-height: 1px;
}
.center {
display: inline-block;
vertical-align: top;
width: $ports-separator-width;
height: 1px;
}
.right {
display: inline-block;
vertical-align: top;
width: $ports-width;
min-height: 1px;
}
@include port($ports-width, $padding, 'WE');
}
.top-ports {
width: 100%;
left: 0;
height: 0;
position: absolute;
align-items: center;
justify-content: center;
display: flex;
@include port(10px, $padding, 'N');
}
.bottom-ports {
width: 100%;
left: 0;
height: 0;
position: absolute;
align-items: center;
justify-content: center;
display: flex;
@include port(10px, $padding, 'S');
}
.progress-bar {
.loader-progressbar {
position: relative;
left: 50%;
margin-left: -8px;
}
}
.ptr {
position: absolute;
top: 0;
right: 2px;
height: 15px;
width: 15px;
margin-top: 2px;
border-radius: 5px;
&.ptr-nonset {
opacity: 0.4;
}
&.inverse-on-hover:hover {
background-color: $ptr-hover-background-color;
-webkit-box-shadow: $ptr-hover-shadow;
-moz-box-shadow: $ptr-hover-shadow;
box-shadow: $ptr-hover-shadow;
[class^="icon-"]:not(.icon-white),
[class*=" icon-"]:not(.icon-white) {
background-image: url("../../../img/glyphicons-halflings-white.png");
}
}
[class^="icon-"],
[class*=" icon-"] {
margin-top: -2px;
}
}
.set {
position: absolute;
bottom: 0;
right: 2px;
height: 15px;
width: 15px;
margin-bottom: 2px;
border-radius: 2px;
&:hover {
background-color: $ptr-hover-background-color;
-webkit-box-shadow: $ptr-hover-shadow;
-moz-box-shadow: $ptr-hover-shadow;
box-shadow: $ptr-hover-shadow;
[class^="icon-"]:not(.icon-white),
[class*=" icon-"]:not(.icon-white) {
background-image: url("../../../img/glyphicons-halflings-white.png");
}
}
[class^="icon-"],
[class*=" icon-"] {
margin-top: -2px;
}
}
.replaceable {
position: absolute;
bottom: 0;
left: 2px;
height: 15px;
width: 15px;
margin-bottom: 2px;
border-radius: 2px;
&:hover {
background-color: $ptr-hover-background-color;
-webkit-box-shadow: $ptr-hover-shadow;
-moz-box-shadow: $ptr-hover-shadow;
box-shadow: $ptr-hover-shadow;
[class^="icon-"]:not(.icon-white),
[class*=" icon-"]:not(.icon-white) {
background-image: url("../../../img/glyphicons-halflings-white.png");
}
}
[class^="icon-"],
[class*=" icon-"] {
margin-top: -2px;
}
}
&.abstract {
.name {
font-style: italic;
color: $abstract-class-name-color;
}
}
img.embeddedsvg {
width: 40px;
position: relative;
}
}
} | {
"pile_set_name": "Github"
} |
/***************************************************************************/
/* */
/* ftstream.h */
/* */
/* Stream handling (specification). */
/* */
/* Copyright 1996-2002, 2004-2006, 2011, 2013 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTSTREAM_H__
#define __FTSTREAM_H__
#include <ft2build.h>
#include FT_SYSTEM_H
#include FT_INTERNAL_OBJECTS_H
FT_BEGIN_HEADER
/* format of an 8-bit frame_op value: */
/* */
/* bit 76543210 */
/* xxxxxxes */
/* */
/* s is set to 1 if the value is signed. */
/* e is set to 1 if the value is little-endian. */
/* xxx is a command. */
#define FT_FRAME_OP_SHIFT 2
#define FT_FRAME_OP_SIGNED 1
#define FT_FRAME_OP_LITTLE 2
#define FT_FRAME_OP_COMMAND( x ) ( x >> FT_FRAME_OP_SHIFT )
#define FT_MAKE_FRAME_OP( command, little, sign ) \
( ( command << FT_FRAME_OP_SHIFT ) | ( little << 1 ) | sign )
#define FT_FRAME_OP_END 0
#define FT_FRAME_OP_START 1 /* start a new frame */
#define FT_FRAME_OP_BYTE 2 /* read 1-byte value */
#define FT_FRAME_OP_SHORT 3 /* read 2-byte value */
#define FT_FRAME_OP_LONG 4 /* read 4-byte value */
#define FT_FRAME_OP_OFF3 5 /* read 3-byte value */
#define FT_FRAME_OP_BYTES 6 /* read a bytes sequence */
typedef enum FT_Frame_Op_
{
ft_frame_end = 0,
ft_frame_start = FT_MAKE_FRAME_OP( FT_FRAME_OP_START, 0, 0 ),
ft_frame_byte = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 0 ),
ft_frame_schar = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE, 0, 1 ),
ft_frame_ushort_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 0 ),
ft_frame_short_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 1 ),
ft_frame_ushort_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 0 ),
ft_frame_short_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ),
ft_frame_ulong_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ),
ft_frame_long_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ),
ft_frame_ulong_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ),
ft_frame_long_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ),
ft_frame_uoff3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ),
ft_frame_off3_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ),
ft_frame_uoff3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),
ft_frame_off3_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),
ft_frame_bytes = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),
ft_frame_skip = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )
} FT_Frame_Op;
typedef struct FT_Frame_Field_
{
FT_Byte value;
FT_Byte size;
FT_UShort offset;
} FT_Frame_Field;
/* Construct an FT_Frame_Field out of a structure type and a field name. */
/* The structure type must be set in the FT_STRUCTURE macro before */
/* calling the FT_FRAME_START() macro. */
/* */
#define FT_FIELD_SIZE( f ) \
(FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )
#define FT_FIELD_SIZE_DELTA( f ) \
(FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )
#define FT_FIELD_OFFSET( f ) \
(FT_UShort)( offsetof( FT_STRUCTURE, f ) )
#define FT_FRAME_FIELD( frame_op, field ) \
{ \
frame_op, \
FT_FIELD_SIZE( field ), \
FT_FIELD_OFFSET( field ) \
}
#define FT_MAKE_EMPTY_FIELD( frame_op ) { frame_op, 0, 0 }
#define FT_FRAME_START( size ) { ft_frame_start, 0, size }
#define FT_FRAME_END { ft_frame_end, 0, 0 }
#define FT_FRAME_LONG( f ) FT_FRAME_FIELD( ft_frame_long_be, f )
#define FT_FRAME_ULONG( f ) FT_FRAME_FIELD( ft_frame_ulong_be, f )
#define FT_FRAME_SHORT( f ) FT_FRAME_FIELD( ft_frame_short_be, f )
#define FT_FRAME_USHORT( f ) FT_FRAME_FIELD( ft_frame_ushort_be, f )
#define FT_FRAME_OFF3( f ) FT_FRAME_FIELD( ft_frame_off3_be, f )
#define FT_FRAME_UOFF3( f ) FT_FRAME_FIELD( ft_frame_uoff3_be, f )
#define FT_FRAME_BYTE( f ) FT_FRAME_FIELD( ft_frame_byte, f )
#define FT_FRAME_CHAR( f ) FT_FRAME_FIELD( ft_frame_schar, f )
#define FT_FRAME_LONG_LE( f ) FT_FRAME_FIELD( ft_frame_long_le, f )
#define FT_FRAME_ULONG_LE( f ) FT_FRAME_FIELD( ft_frame_ulong_le, f )
#define FT_FRAME_SHORT_LE( f ) FT_FRAME_FIELD( ft_frame_short_le, f )
#define FT_FRAME_USHORT_LE( f ) FT_FRAME_FIELD( ft_frame_ushort_le, f )
#define FT_FRAME_OFF3_LE( f ) FT_FRAME_FIELD( ft_frame_off3_le, f )
#define FT_FRAME_UOFF3_LE( f ) FT_FRAME_FIELD( ft_frame_uoff3_le, f )
#define FT_FRAME_SKIP_LONG { ft_frame_long_be, 0, 0 }
#define FT_FRAME_SKIP_SHORT { ft_frame_short_be, 0, 0 }
#define FT_FRAME_SKIP_BYTE { ft_frame_byte, 0, 0 }
#define FT_FRAME_BYTES( field, count ) \
{ \
ft_frame_bytes, \
count, \
FT_FIELD_OFFSET( field ) \
}
#define FT_FRAME_SKIP_BYTES( count ) { ft_frame_skip, count, 0 }
/*************************************************************************/
/* */
/* Integer extraction macros -- the `buffer' parameter must ALWAYS be of */
/* type `char*' or equivalent (1-byte elements). */
/* */
#define FT_BYTE_( p, i ) ( ((const FT_Byte*)(p))[(i)] )
#define FT_INT16( x ) ( (FT_Int16)(x) )
#define FT_UINT16( x ) ( (FT_UInt16)(x) )
#define FT_INT32( x ) ( (FT_Int32)(x) )
#define FT_UINT32( x ) ( (FT_UInt32)(x) )
#define FT_BYTE_U16( p, i, s ) ( FT_UINT16( FT_BYTE_( p, i ) ) << (s) )
#define FT_BYTE_U32( p, i, s ) ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )
#define FT_PEEK_SHORT( p ) FT_INT16( FT_BYTE_U16( p, 0, 8) | \
FT_BYTE_U16( p, 1, 0) )
#define FT_PEEK_USHORT( p ) FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \
FT_BYTE_U16( p, 1, 0 ) )
#define FT_PEEK_LONG( p ) FT_INT32( FT_BYTE_U32( p, 0, 24 ) | \
FT_BYTE_U32( p, 1, 16 ) | \
FT_BYTE_U32( p, 2, 8 ) | \
FT_BYTE_U32( p, 3, 0 ) )
#define FT_PEEK_ULONG( p ) FT_UINT32( FT_BYTE_U32( p, 0, 24 ) | \
FT_BYTE_U32( p, 1, 16 ) | \
FT_BYTE_U32( p, 2, 8 ) | \
FT_BYTE_U32( p, 3, 0 ) )
#define FT_PEEK_OFF3( p ) FT_INT32( FT_BYTE_U32( p, 0, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 2, 0 ) )
#define FT_PEEK_UOFF3( p ) FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 2, 0 ) )
#define FT_PEEK_SHORT_LE( p ) FT_INT16( FT_BYTE_U16( p, 1, 8 ) | \
FT_BYTE_U16( p, 0, 0 ) )
#define FT_PEEK_USHORT_LE( p ) FT_UINT16( FT_BYTE_U16( p, 1, 8 ) | \
FT_BYTE_U16( p, 0, 0 ) )
#define FT_PEEK_LONG_LE( p ) FT_INT32( FT_BYTE_U32( p, 3, 24 ) | \
FT_BYTE_U32( p, 2, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 0, 0 ) )
#define FT_PEEK_ULONG_LE( p ) FT_UINT32( FT_BYTE_U32( p, 3, 24 ) | \
FT_BYTE_U32( p, 2, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 0, 0 ) )
#define FT_PEEK_OFF3_LE( p ) FT_INT32( FT_BYTE_U32( p, 2, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 0, 0 ) )
#define FT_PEEK_UOFF3_LE( p ) FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 0, 0 ) )
#define FT_NEXT_CHAR( buffer ) \
( (signed char)*buffer++ )
#define FT_NEXT_BYTE( buffer ) \
( (unsigned char)*buffer++ )
#define FT_NEXT_SHORT( buffer ) \
( (short)( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) ) )
#define FT_NEXT_USHORT( buffer ) \
( (unsigned short)( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) ) )
#define FT_NEXT_OFF3( buffer ) \
( (long)( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) ) )
#define FT_NEXT_UOFF3( buffer ) \
( (unsigned long)( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) ) )
#define FT_NEXT_LONG( buffer ) \
( (long)( buffer += 4, FT_PEEK_LONG( buffer - 4 ) ) )
#define FT_NEXT_ULONG( buffer ) \
( (unsigned long)( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) ) )
#define FT_NEXT_SHORT_LE( buffer ) \
( (short)( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) ) )
#define FT_NEXT_USHORT_LE( buffer ) \
( (unsigned short)( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) ) )
#define FT_NEXT_OFF3_LE( buffer ) \
( (long)( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) ) )
#define FT_NEXT_UOFF3_LE( buffer ) \
( (unsigned long)( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) ) )
#define FT_NEXT_LONG_LE( buffer ) \
( (long)( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) ) )
#define FT_NEXT_ULONG_LE( buffer ) \
( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )
/*************************************************************************/
/* */
/* Each GET_xxxx() macro uses an implicit `stream' variable. */
/* */
#if 0
#define FT_GET_MACRO( type ) FT_NEXT_ ## type ( stream->cursor )
#define FT_GET_CHAR() FT_GET_MACRO( CHAR )
#define FT_GET_BYTE() FT_GET_MACRO( BYTE )
#define FT_GET_SHORT() FT_GET_MACRO( SHORT )
#define FT_GET_USHORT() FT_GET_MACRO( USHORT )
#define FT_GET_OFF3() FT_GET_MACRO( OFF3 )
#define FT_GET_UOFF3() FT_GET_MACRO( UOFF3 )
#define FT_GET_LONG() FT_GET_MACRO( LONG )
#define FT_GET_ULONG() FT_GET_MACRO( ULONG )
#define FT_GET_TAG4() FT_GET_MACRO( ULONG )
#define FT_GET_SHORT_LE() FT_GET_MACRO( SHORT_LE )
#define FT_GET_USHORT_LE() FT_GET_MACRO( USHORT_LE )
#define FT_GET_LONG_LE() FT_GET_MACRO( LONG_LE )
#define FT_GET_ULONG_LE() FT_GET_MACRO( ULONG_LE )
#else
#define FT_GET_MACRO( func, type ) ( (type)func( stream ) )
#define FT_GET_CHAR() FT_GET_MACRO( FT_Stream_GetChar, FT_Char )
#define FT_GET_BYTE() FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )
#define FT_GET_SHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_Short )
#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )
#define FT_GET_OFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_Long )
#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )
#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetULong, FT_Long )
#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
#define FT_GET_TAG4() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
#define FT_GET_SHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Short )
#define FT_GET_USHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UShort )
#define FT_GET_LONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_Long )
#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )
#endif
#define FT_READ_MACRO( func, type, var ) \
( var = (type)func( stream, &error ), \
error != FT_Err_Ok )
#define FT_READ_BYTE( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )
#define FT_READ_CHAR( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )
#define FT_READ_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )
#define FT_READ_USHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_UShort, var )
#define FT_READ_OFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_Long, var )
#define FT_READ_UOFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_ULong, var )
#define FT_READ_LONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_Long, var )
#define FT_READ_ULONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_ULong, var )
#define FT_READ_SHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Short, var )
#define FT_READ_USHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UShort, var )
#define FT_READ_LONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Long, var )
#define FT_READ_ULONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_ULong, var )
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
/* initialize a stream for reading a regular system stream */
FT_BASE( FT_Error )
FT_Stream_Open( FT_Stream stream,
const char* filepathname );
#endif /* FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
/* create a new (input) stream from an FT_Open_Args structure */
FT_BASE( FT_Error )
FT_Stream_New( FT_Library library,
const FT_Open_Args* args,
FT_Stream *astream );
/* free a stream */
FT_BASE( void )
FT_Stream_Free( FT_Stream stream,
FT_Int external );
/* initialize a stream for reading in-memory data */
FT_BASE( void )
FT_Stream_OpenMemory( FT_Stream stream,
const FT_Byte* base,
FT_ULong size );
/* close a stream (does not destroy the stream structure) */
FT_BASE( void )
FT_Stream_Close( FT_Stream stream );
/* seek within a stream. position is relative to start of stream */
FT_BASE( FT_Error )
FT_Stream_Seek( FT_Stream stream,
FT_ULong pos );
/* skip bytes in a stream */
FT_BASE( FT_Error )
FT_Stream_Skip( FT_Stream stream,
FT_Long distance );
/* return current stream position */
FT_BASE( FT_Long )
FT_Stream_Pos( FT_Stream stream );
/* read bytes from a stream into a user-allocated buffer, returns an */
/* error if not all bytes could be read. */
FT_BASE( FT_Error )
FT_Stream_Read( FT_Stream stream,
FT_Byte* buffer,
FT_ULong count );
/* read bytes from a stream at a given position */
FT_BASE( FT_Error )
FT_Stream_ReadAt( FT_Stream stream,
FT_ULong pos,
FT_Byte* buffer,
FT_ULong count );
/* try to read bytes at the end of a stream; return number of bytes */
/* really available */
FT_BASE( FT_ULong )
FT_Stream_TryRead( FT_Stream stream,
FT_Byte* buffer,
FT_ULong count );
/* Enter a frame of `count' consecutive bytes in a stream. Returns an */
/* error if the frame could not be read/accessed. The caller can use */
/* the FT_Stream_Get_XXX functions to retrieve frame data without */
/* error checks. */
/* */
/* You must _always_ call FT_Stream_ExitFrame() once you have entered */
/* a stream frame! */
/* */
FT_BASE( FT_Error )
FT_Stream_EnterFrame( FT_Stream stream,
FT_ULong count );
/* exit a stream frame */
FT_BASE( void )
FT_Stream_ExitFrame( FT_Stream stream );
/* Extract a stream frame. If the stream is disk-based, a heap block */
/* is allocated and the frame bytes are read into it. If the stream */
/* is memory-based, this function simply set a pointer to the data. */
/* */
/* Useful to optimize access to memory-based streams transparently. */
/* */
/* All extracted frames must be `freed' with a call to the function */
/* FT_Stream_ReleaseFrame(). */
/* */
FT_BASE( FT_Error )
FT_Stream_ExtractFrame( FT_Stream stream,
FT_ULong count,
FT_Byte** pbytes );
/* release an extract frame (see FT_Stream_ExtractFrame) */
FT_BASE( void )
FT_Stream_ReleaseFrame( FT_Stream stream,
FT_Byte** pbytes );
/* read a byte from an entered frame */
FT_BASE( FT_Char )
FT_Stream_GetChar( FT_Stream stream );
/* read a 16-bit big-endian unsigned integer from an entered frame */
FT_BASE( FT_UShort )
FT_Stream_GetUShort( FT_Stream stream );
/* read a 24-bit big-endian unsigned integer from an entered frame */
FT_BASE( FT_ULong )
FT_Stream_GetUOffset( FT_Stream stream );
/* read a 32-bit big-endian unsigned integer from an entered frame */
FT_BASE( FT_ULong )
FT_Stream_GetULong( FT_Stream stream );
/* read a 16-bit little-endian unsigned integer from an entered frame */
FT_BASE( FT_UShort )
FT_Stream_GetUShortLE( FT_Stream stream );
/* read a 32-bit little-endian unsigned integer from an entered frame */
FT_BASE( FT_ULong )
FT_Stream_GetULongLE( FT_Stream stream );
/* read a byte from a stream */
FT_BASE( FT_Char )
FT_Stream_ReadChar( FT_Stream stream,
FT_Error* error );
/* read a 16-bit big-endian unsigned integer from a stream */
FT_BASE( FT_UShort )
FT_Stream_ReadUShort( FT_Stream stream,
FT_Error* error );
/* read a 24-bit big-endian unsigned integer from a stream */
FT_BASE( FT_ULong )
FT_Stream_ReadUOffset( FT_Stream stream,
FT_Error* error );
/* read a 32-bit big-endian integer from a stream */
FT_BASE( FT_ULong )
FT_Stream_ReadULong( FT_Stream stream,
FT_Error* error );
/* read a 16-bit little-endian unsigned integer from a stream */
FT_BASE( FT_UShort )
FT_Stream_ReadUShortLE( FT_Stream stream,
FT_Error* error );
/* read a 32-bit little-endian unsigned integer from a stream */
FT_BASE( FT_ULong )
FT_Stream_ReadULongLE( FT_Stream stream,
FT_Error* error );
/* Read a structure from a stream. The structure must be described */
/* by an array of FT_Frame_Field records. */
FT_BASE( FT_Error )
FT_Stream_ReadFields( FT_Stream stream,
const FT_Frame_Field* fields,
void* structure );
#define FT_STREAM_POS() \
FT_Stream_Pos( stream )
#define FT_STREAM_SEEK( position ) \
FT_SET_ERROR( FT_Stream_Seek( stream, \
(FT_ULong)(position) ) )
#define FT_STREAM_SKIP( distance ) \
FT_SET_ERROR( FT_Stream_Skip( stream, \
(FT_Long)(distance) ) )
#define FT_STREAM_READ( buffer, count ) \
FT_SET_ERROR( FT_Stream_Read( stream, \
(FT_Byte*)(buffer), \
(FT_ULong)(count) ) )
#define FT_STREAM_READ_AT( position, buffer, count ) \
FT_SET_ERROR( FT_Stream_ReadAt( stream, \
(FT_ULong)(position), \
(FT_Byte*)buffer, \
(FT_ULong)(count) ) )
#define FT_STREAM_READ_FIELDS( fields, object ) \
FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )
#define FT_FRAME_ENTER( size ) \
FT_SET_ERROR( \
FT_DEBUG_INNER( FT_Stream_EnterFrame( stream, \
(FT_ULong)(size) ) ) )
#define FT_FRAME_EXIT() \
FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )
#define FT_FRAME_EXTRACT( size, bytes ) \
FT_SET_ERROR( \
FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream, \
(FT_ULong)(size), \
(FT_Byte**)&(bytes) ) ) )
#define FT_FRAME_RELEASE( bytes ) \
FT_DEBUG_INNER( FT_Stream_ReleaseFrame( stream, \
(FT_Byte**)&(bytes) ) )
FT_END_HEADER
#endif /* __FTSTREAM_H__ */
/* END */
| {
"pile_set_name": "Github"
} |
{
"compilerOptions": {
"target": "es6",
"module": "es2015",
"inlineSourceMap": true,
"inlineSources": true,
"moduleResolution": "node",
"experimentalDecorators": true,
"types": [
"qunit"
]
},
"exclude": [
"node_modules",
"tmp",
"dist"
]
}
| {
"pile_set_name": "Github"
} |
1. Ledger - a single, ever-growing, append-only Merkle Tree of identity events
2. MTH - Merkle Tree Hash
3. STH - Signed Tree Head | {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: BSD-2-Clause
/* Copyright (C) 2015 - 2020 Intel Corporation. */
#include "StressIncreaseToMax.h"
void StressIncreaseToMax::run()
{
//Generate constant allocation sizes.
VectorIterator<size_t> allocation_sizes =
AllocationSizes::generate_random_sizes(task_conf.allocation_sizes_conf,
task_conf.seed);
//Generate only mallocs.
VectorIterator<int> func_calls =
FunctionCalls::generate_random_allocator_func_calls(task_conf.n, task_conf.seed,
task_conf.func_calls);
unsigned type;
for (type = 0; type < AllocatorTypes::NUM_OF_ALLOCATOR_TYPES; type++) {
if(task_conf.allocators_types.is_enabled(type))
break; //Assume that there is only one type.
}
AllocatorFactory allocator_factory;
VectorIterator<Allocator *> allocators_calls =
allocator_factory.generate_random_allocator_calls(task_conf.n, task_conf.seed,
task_conf.allocators_types);
ScenarioWorkload scenario_workload(
&allocators_calls,
&allocation_sizes,
&func_calls
);
scenario_workload.enable_touch_memory_on_allocation(task_conf.touch_memory);
test_status.is_allocation_error = false;
size_t requested_memory = 0;
bool has_reach_memory_request_limit = false;
while (!has_reach_memory_request_limit &&
!test_status.is_allocation_error &&
(test_status.has_next_memory_operation = scenario_workload.run())) {
memory_operation data = scenario_workload.get_allocations_info().back();
test_status.is_allocation_error = (data.error_code == ENOMEM) ||
(data.ptr == NULL);
if(data.allocation_method != FunctionCalls::FREE) {
requested_memory += data.size_of_allocation;
has_reach_memory_request_limit = requested_memory >= req_mem_limit;
}
}
if(!(scenario_workload.get_allocations_info().size() < task_conf.n) &&
!has_reach_memory_request_limit)
printf("\nWARNING: Too few memory operations to reach the limit.\n");
if(test_status.is_allocation_error) printf("\nWARNING: Allocation error. \n");
results = scenario_workload.get_allocations_info();
}
std::vector<iteration_result> StressIncreaseToMax::execute_test_iterations(
const TaskConf &task_conf,
unsigned time,
size_t requested_memory_limit)
{
TimerSysTime timer;
unsigned itr = 0;
std::vector<iteration_result> results;
std::ofstream csv_file;
csv::Row row;
row.append("Iteration");
row.append("Allocated memory (MB)");
row.append("Elapsed time (seconds)");
if(task_conf.is_csv_log_enabled) {
csv_file.open("stress_test_increase_to_max.csv");
csv_file << row.export_row();
}
printf("%s", row.export_row().c_str());
timer.start();
while (timer.getElapsedTime() < time) {
StressIncreaseToMax stress_test(task_conf, requested_memory_limit);
stress_test.run();
float elapsed_time = timer.getElapsedTime();
TimeStats stats;
stats += stress_test.get_results();
results.push_back(stress_test.get_test_status());
//Log every iteration of StressIncreaseToMax test.
csv::Row row;
row.append(itr);
row.append(convert_bytes_to_mb(stats.get_allocated()));
row.append(elapsed_time);
if(task_conf.is_csv_log_enabled) {
csv_file << row.export_row();
}
printf("%s", row.export_row().c_str());
fflush(stdout);
itr++;
}
printf("\nStress test (StressIncreaseToMax) finish in time %f.\n",
timer.getElapsedTime());
csv_file.close();
return results;
}
| {
"pile_set_name": "Github"
} |
1.d0
-1.d0
1.d-5
-1.D5
342.e+12
12.
12
.23
-.23
1.E4
1E4
1D-4
var1
va1r
mo_tot_8 = 1./(0.4*log(float(elec_num_tot_8+0.4)))
6_ikind
1_c_short
6.666666666666666_DBL
| {
"pile_set_name": "Github"
} |
$(document).ready(function() {
module("HgCoordsFinder");
var tester = {
_before: function() {
;
},
_after: function() {
},
runTests: function() {
var me = this;
test("all", function(assert) {
var test = function(tests) {
me._before.call(me);
for(var i = 0; i < tests.length; i++)
me["_" + tests[i]].call(me, assert);
me._after.call(me);
}
test([
"find"
]);
});
},
_find: function() {
srManager = {};
srManager.itemSizes = function(item) {
if(item.guid != 1) return;
return {width: 100, height: 200};
};
var coordsFinder = new HgCoordsFinder();
var sizes = coordsFinder.find(OPS.APPEND, {guid: 1}, {x: 300, y: 400});
ok(sizes.x1 == 300 && sizes.x2 == 399 && sizes.y1 == 400 && sizes.y2 == 599,
"find on OPS.APPEND ok");
sizes = coordsFinder.find(OPS.REV_APPEND, {guid: 1}, {x: 300, y: 400});
ok(sizes.x1 == 300 && sizes.x2 == 399 && sizes.y1 == 201 && sizes.y2 == 400,
"find on OPS.REV_APPEND ok");
sizes = coordsFinder.find(OPS.PREPEND, {guid: 1}, {x: 300, y: 400});
ok(sizes.x1 == 201 && sizes.x2 == 300 && sizes.y1 == 201 && sizes.y2 == 400,
"find on OPS.PREPEND ok");
sizes = coordsFinder.find(OPS.REV_PREPEND, {guid: 1}, {x: 300, y: 400});
ok(sizes.x1 == 201 && sizes.x2 == 300 && sizes.y1 == 400 && sizes.y2 == 599,
"find on OPS.REV_PREPEND ok");
clearTestData();
}
}
tester.runTests();
clearTestData();
}); | {
"pile_set_name": "Github"
} |
import { IRssResultsTemplateContext } from './';
import { BaseTemplateService } from '../../../../services/TemplateService';
export interface IRssResultsTemplateProps {
/**
* The template helper instance
*/
templateService: BaseTemplateService;
/**
* The template context
*/
templateContext: IRssResultsTemplateContext;
/**
* The Handlebars raw template content for a single item
*/
templateContent: string;
}
| {
"pile_set_name": "Github"
} |
<?php
namespace AppBundle\Command;
use Biz\Util\PluginUtil;
use Topxia\Service\Common\ServiceKernel;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class UpgradeScriptCommand extends BaseCommand
{
protected function configure()
{
$this->setName('util:upgrade-script')
->addArgument('version', InputArgument::REQUIRED, '要升级的版本号')
->setDescription('用于命令行中执行指定版本的升级脚本');
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->initServiceKernel();
$code = 'MAIN';
$version = $input->getArgument('version');
$this->executeScript($code, $version);
$output->writeln('<info>执行脚本</info>');
$this->removeCache();
$output->writeln('<info>删除缓存</info>');
$this->updateApp($code, $version);
$output->writeln('<info>元数据更新</info>');
}
protected function executeScript($code, $version, $index = 0)
{
$scriptFile = $this->getServiceKernel()->getParameter('kernel.root_dir')."/../scripts/upgrade-{$version}.php";
if (!file_exists($scriptFile)) {
return;
}
include_once $scriptFile;
$upgrade = new \EduSohoUpgrade($this->getServiceKernel()->getBiz());
if (method_exists($upgrade, 'update')) {
$info = $upgrade->update($index);
if (isset($info) && !empty($info['index'])) {
$this->executeScript($code, $version, $info['index']);
}
}
}
protected function removeCache()
{
$cachePath = $this->getServiceKernel()->getParameter('kernel.root_dir').'/cache/'.$this->getServiceKernel(
)->getEnvironment();
$filesystem = new Filesystem();
$filesystem->remove($cachePath);
if (empty($errors)) {
PluginUtil::refresh();
}
}
protected function updateApp($code, $version)
{
$app = $this->getAppService()->getAppByCode($code);
$newApp = array(
'code' => $code,
'version' => $version,
'fromVersion' => $app['version'],
'updatedTime' => time(),
);
$this->getLogService()->info('system', 'update_app_version', "命令行更新应用「{$app['name']}」版本为「{$version}」");
return $this->getAppDao()->update($app['id'], $newApp);
}
protected function getAppDao()
{
$biz = $this->getServiceKernel()->getBiz();
return $biz->dao('CloudPlatform:CloudAppDao');
}
protected function getAppService()
{
return $this->getServiceKernel()->createService('CloudPlatform:AppService');
}
protected function getLogService()
{
return ServiceKernel::instance()->createService('System:LogService');
}
}
| {
"pile_set_name": "Github"
} |
package mekanism.client.gui.element;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import java.util.function.Supplier;
import mekanism.client.gui.GuiMekanism;
import mekanism.client.gui.GuiUtils;
import mekanism.client.gui.IGuiWrapper;
import mekanism.client.gui.element.button.GuiCloseButton;
import mekanism.client.render.MekanismRenderer;
import mekanism.common.inventory.container.IEmptyContainer;
import mekanism.common.lib.Color;
import net.minecraft.inventory.container.Container;
import org.lwjgl.glfw.GLFW;
public class GuiWindow extends GuiTexturedElement {
private static final Color OVERLAY_COLOR = Color.rgbai(60, 60, 60, 128);
private Runnable closeListener;
private Runnable reattachListener;
private boolean dragging = false;
private double dragX, dragY;
private int prevDX, prevDY;
protected InteractionStrategy interactionStrategy = InteractionStrategy.CONTAINER;
public GuiWindow(IGuiWrapper gui, int x, int y, int width, int height) {
super(GuiMekanism.BASE_BACKGROUND, gui, x, y, width, height);
isOverlay = true;
active = true;
if (!isFocusOverlay()) {
addCloseButton();
}
}
protected void addCloseButton() {
addChild(new GuiCloseButton(getGuiObj(), this.x + 6, this.y + 6, this));
}
@Override
public boolean mouseClicked(double mouseX, double mouseY, int button) {
boolean ret = super.mouseClicked(mouseX, mouseY, button);
// drag 'safe area'
if (isMouseOver(mouseX, mouseY)) {
if (mouseY < y + 18) {
dragging = true;
dragX = mouseX;
dragY = mouseY;
prevDX = 0;
prevDY = 0;
}
} else if (!ret && interactionStrategy.allowContainer()) {
if (guiObj instanceof GuiMekanism) {
Container c = ((GuiMekanism<?>) guiObj).getContainer();
if (!(c instanceof IEmptyContainer)) {
// allow interaction with slots
if (mouseX >= guiObj.getLeft() && mouseX < guiObj.getLeft() + guiObj.getWidth() && mouseY >= guiObj.getTop() + guiObj.getHeight() - 90) {
return false;
}
}
}
}
// always return true to prevent background clicking
return ret || !interactionStrategy.allowAll();
}
@Override
public void onDrag(double mouseX, double mouseY, double mouseXOld, double mouseYOld) {
super.onDrag(mouseX, mouseY, mouseXOld, mouseYOld);
if (dragging) {
int newDX = (int) Math.round(mouseX - dragX), newDY = (int) Math.round(mouseY - dragY);
int changeX = Math.max(-x, Math.min(minecraft.getMainWindow().getScaledWidth() - (x + width), newDX - prevDX));
int changeY = Math.max(-y, Math.min(minecraft.getMainWindow().getScaledHeight() - (y + height), newDY - prevDY));
prevDX = newDX;
prevDY = newDY;
move(changeX, changeY);
}
}
@Override
public void onRelease(double mouseX, double mouseY) {
super.onRelease(mouseX, mouseY);
dragging = false;
}
@Override
public void renderBackgroundOverlay(MatrixStack matrix, int mouseX, int mouseY) {
if (isFocusOverlay()) {
MekanismRenderer.renderColorOverlay(matrix, 0, 0, minecraft.getMainWindow().getScaledWidth(), minecraft.getMainWindow().getScaledHeight(), OVERLAY_COLOR.rgba());
} else {
RenderSystem.color4f(1, 1, 1, 0.75F);
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
GuiUtils.renderBackgroundTexture(matrix, GuiMekanism.SHADOW, 4, 4, getButtonX() - 3, getButtonY() - 3, getButtonWidth() + 6, getButtonHeight() + 6, 256, 256);
MekanismRenderer.resetColor();
}
minecraft.textureManager.bindTexture(getResource());
renderBackgroundTexture(matrix, getResource(), 4, 4);
}
@Override
public boolean keyPressed(int keyCode, int scanCode, int modifiers) {
if (super.keyPressed(keyCode, scanCode, modifiers)) {
return true;
}
if (keyCode == GLFW.GLFW_KEY_ESCAPE) {
close();
return true;
}
return false;
}
public void setListenerTab(Supplier<? extends GuiElement> elementSupplier) {
closeListener = () -> elementSupplier.get().active = true;
reattachListener = () -> elementSupplier.get().active = false;
}
@Override
public void resize(int prevLeft, int prevTop, int left, int top) {
super.resize(prevLeft, prevTop, left, top);
if (reattachListener != null) {
reattachListener.run();
}
}
public void renderBlur(MatrixStack matrix) {
RenderSystem.color4f(1, 1, 1, 0.3F);
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
GuiUtils.renderBackgroundTexture(matrix, GuiMekanism.BLUR, 4, 4, relativeX, relativeY, width, height, 256, 256);
MekanismRenderer.resetColor();
}
public void close() {
children.forEach(GuiElement::onWindowClose);
guiObj.removeWindow(this);
if (guiObj instanceof GuiMekanism) {
((GuiMekanism<?>) guiObj).setListener(null);
}
if (closeListener != null) {
closeListener.run();
}
}
protected boolean isFocusOverlay() {
return false;
}
public enum InteractionStrategy {
NONE,
CONTAINER,
ALL;
boolean allowContainer() {
return this != NONE;
}
boolean allowAll() {
return this == ALL;
}
}
}
| {
"pile_set_name": "Github"
} |
# -*- coding: utf-8 -*-
"""
@author: David Siroky (siroky@dasir.cz)
@license: MIT License (see LICENSE.txt or
U{http://www.opensource.org/licenses/mit-license.php})
"""
import threading
from collections import deque
# TODO utilize io module
############################################################################
############################################################################
MAX_BUF_CHUNK_SIZE = 64 * 1024
############################################################################
############################################################################
class BufferException(Exception):
pass
class BufferTimeout(BufferException):
pass
class BufferTooLarge(BufferException):
"""
Raised when you want to put larger piece then the buffer max size.
"""
pass
############################################################################
############################################################################
class StreamBuffer(object):
def __init__(self):
self.size = 0 #: current size of the buffer
self.max_size = None
self.queue = deque()
self.not_full_cond = threading.Condition()
############################################################
def __del__(self):
self.clear()
############################################################
def clear(self):
with self.not_full_cond:
self.queue.clear()
self.size = 0
self.not_full_cond.notify()
############################################################
def set_max_size(self, max_size):
"""
@param max_size: None or number of bytes: L{StreamBuffer.put} will
block if the content will be bigger then C{max_size}.
WARNING: there must be only one thread inserting data at
a time
"""
assert (max_size is None) or (max_size > 0)
self.max_size = max_size
############################################################
def put(self, data, timeout=None):
"""
Add to the right side. It will block if the buffer will exceed C{max_size}.
If C{max_size} is set then C{len(data)} must not be longer then the maximal
size.
"""
assert type(data) == bytes
if not data:
# do not insert an empty string
return
data_len = len(data)
if self.max_size and (data_len > self.max_size):
raise BufferTooLarge("len(data)=%i > max_size=%i" %
(data_len, self.max_size))
with self.not_full_cond:
if self.max_size and (self.size + data_len > self.max_size):
self.not_full_cond.wait(timeout)
if self.size + data_len > self.max_size:
raise BufferTimeout
self.size += data_len
for i in range(len(data) // MAX_BUF_CHUNK_SIZE + 1):
chunk = data[i * MAX_BUF_CHUNK_SIZE:(i + 1) * MAX_BUF_CHUNK_SIZE]
if not chunk:
break
self.queue.append(chunk)
del chunk
del data
############################################################
def get(self, size, cut=True):
"""
Get from the left side.
@param cut: True = remove returned data from buffer
@return: max N-bytes from the buffer.
"""
assert (((self.size > 0) and (len(self.queue) > 0))
or ((self.size == 0) and (len(self.queue) == 0)))
retbuf = []
i = 0
with self.not_full_cond:
orig_size = self.size
while size and self.queue:
if cut:
fragment = self.queue.popleft()
else:
fragment = self.queue[i]
if len(fragment) > size:
if cut:
# paste back the rest
self.queue.appendleft(fragment[size:])
# get only needed
fragment = fragment[:size]
frag_len = size
else:
frag_len = len(fragment)
retbuf.append(fragment)
del fragment
size -= frag_len
if cut:
self.size -= frag_len
else:
i += 1
if i == len(self.queue):
break
if (self.max_size and (orig_size >= self.max_size) and
(self.size < self.max_size)):
self.not_full_cond.notify()
return b"".join(retbuf)
############################################################
def cut(self, size):
"""
More efficient version of get(cut=True) and no data will be returned.
"""
assert (((self.size > 0) and (len(self.queue) > 0))
or ((self.size == 0) and (len(self.queue) == 0)))
with self.not_full_cond:
orig_size = self.size
while size and self.queue:
fragment = self.queue.popleft()
if len(fragment) > size:
# paste back the rest
self.queue.appendleft(fragment[size:])
frag_len = size
else:
frag_len = len(fragment)
del fragment
size -= frag_len
self.size -= frag_len
if (self.max_size and (orig_size >= self.max_size) and
(self.size < self.max_size)):
self.not_full_cond.notify()
############################################################
def __len__(self):
assert sum([len(item) for item in self.queue]) == self.size
return self.size
| {
"pile_set_name": "Github"
} |
/* ---------------------------------------------------------------------------------------------------------------------------------
_
| |
_ __ ___ _ __ ___ _ __ ___ __ _ _ __ | |__
| '_ \ / _ \| '_ ` _ \| '_ ` _ \ / _` | '__| | '_ \
| | | | (_) | | | | | | | | | | | (_| | | _ | | | |
|_| |_|\___/|_| |_| |_|_| |_| |_|\__, |_| (_)|_| |_|
__/ |
|___/
Memory manager & tracking software
Best viewed with 8-character tabs and (at least) 132 columns
---------------------------------------------------------------------------------------------------------------------------------
Restrictions & freedoms pertaining to usage and redistribution of this software:
* This software is 100% free
* If you use this software (in part or in whole) you must credit the author.
* This software may not be re-distributed (in part or in whole) in a modified
form without clear documentation on how to obtain a copy of the original work.
* You may not use this software to directly or indirectly cause harm to others.
* This software is provided as-is and without warrantee. Use at your own risk.
For more information, visit HTTP://www.FluidStudios.com
---------------------------------------------------------------------------------------------------------------------------------
Originally created on 12/22/2000 by Paul Nettle
Copyright 2000, Fluid Studios, Inc., all rights reserved.
---------------------------------------------------------------------------------------------------------------------------------
*/
#ifdef new
#undef new
#endif
#ifdef delete
#undef delete
#endif
#ifdef malloc
#undef malloc
#endif
#ifdef calloc
#undef calloc
#endif
#ifdef realloc
#undef realloc
#endif
#ifdef free
#undef free
#endif
// ---------------------------------------------------------------------------------------------------------------------------------
// nommgr.h - End of file
// ---------------------------------------------------------------------------------------------------------------------------------
| {
"pile_set_name": "Github"
} |
// This is a part of the Active Template Library.
// Copyright (C) Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Active Template Library Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Active Template Library product.
#ifndef __ATLFILE_H__
#define __ATLFILE_H__
#pragma once
#include <atlbase.h>
#pragma pack(push,_ATL_PACKING)
namespace ATL
{
class CAtlFile : public CHandle
{
public:
CAtlFile() throw()
{
}
CAtlFile( _In_ CAtlFile& file ) throw() :
CHandle( file ) // Transfers ownership
{
}
explicit CAtlFile( _In_ HANDLE hFile ) throw() :
CHandle( hFile ) // Takes ownership
{
}
HRESULT Create(
_In_ LPCTSTR szFilename,
_In_ DWORD dwDesiredAccess,
_In_ DWORD dwShareMode,
_In_ DWORD dwCreationDisposition,
_In_ DWORD dwFlagsAndAttributes = FILE_ATTRIBUTE_NORMAL,
_In_opt_ LPSECURITY_ATTRIBUTES lpsa = NULL,
_In_opt_ HANDLE hTemplateFile = NULL) throw()
{
ATLASSUME(m_h == NULL);
HANDLE hFile = ::CreateFile(
szFilename,
dwDesiredAccess,
dwShareMode,
lpsa,
dwCreationDisposition,
dwFlagsAndAttributes,
hTemplateFile);
if (hFile == INVALID_HANDLE_VALUE)
return AtlHresultFromLastError();
Attach(hFile);
return S_OK;
}
HRESULT Read(
_Out_bytecap_(nBufSize) LPVOID pBuffer,
DWORD nBufSize) throw()
{
ATLASSUME(m_h != NULL);
DWORD nBytesRead = 0;
BOOL bSuccess = ::ReadFile(m_h, pBuffer, nBufSize, &nBytesRead, NULL);
if (!bSuccess )
return AtlHresultFromLastError();
if (nBytesRead != nBufSize)
return HRESULT_FROM_WIN32( ERROR_HANDLE_EOF );
return S_OK;
}
HRESULT Read(
_Out_bytecap_(nBufSize) LPVOID pBuffer,
_In_ DWORD nBufSize,
_Out_ DWORD& nBytesRead) throw()
{
ATLASSUME(m_h != NULL);
BOOL b = ::ReadFile(m_h, pBuffer, nBufSize, &nBytesRead, NULL);
if (!b)
return AtlHresultFromLastError();
return S_OK;
}
// this function will usually return HRESULT_FROM_WIN32(ERROR_IO_PENDING)
// indicating succesful queueing of the operation
HRESULT Read(
_Out_bytecap_(nBufSize) LPVOID pBuffer,
_In_ DWORD nBufSize,
_In_opt_ LPOVERLAPPED pOverlapped) throw()
{
ATLASSUME(m_h != NULL);
BOOL b = ::ReadFile(m_h, pBuffer, nBufSize, NULL, pOverlapped);
if (!b)
return AtlHresultFromLastError();
return S_OK;
}
HRESULT Read(
_In_bytecount_(nBufSize) LPVOID pBuffer,
_In_ DWORD nBufSize,
_Inout_ LPOVERLAPPED pOverlapped,
_In_ LPOVERLAPPED_COMPLETION_ROUTINE pfnCompletionRoutine) throw()
{
ATLASSUME(m_h != NULL);
BOOL b = ::ReadFileEx(m_h, pBuffer, nBufSize, pOverlapped, pfnCompletionRoutine);
if (!b)
return AtlHresultFromLastError();
return S_OK;
}
HRESULT Write(
_In_bytecount_(nBufSize) LPCVOID pBuffer,
_In_ DWORD nBufSize,
_Out_opt_ DWORD* pnBytesWritten = NULL) throw()
{
ATLASSUME(m_h != NULL);
DWORD nBytesWritten;
if (pnBytesWritten == NULL)
pnBytesWritten = &nBytesWritten;
BOOL b = ::WriteFile(m_h, pBuffer, nBufSize, pnBytesWritten, NULL);
if (!b)
return AtlHresultFromLastError();
return S_OK;
}
// this function will usually return HRESULT_FROM_WIN32(ERROR_IO_PENDING)
// indicating succesful queueing of the operation
HRESULT Write(
_In_bytecount_(nBufSize) LPCVOID pBuffer,
_In_ DWORD nBufSize,
_In_opt_ LPOVERLAPPED pOverlapped) throw()
{
ATLASSUME(m_h != NULL);
BOOL b = ::WriteFile(m_h, pBuffer, nBufSize, NULL, pOverlapped);
if (!b)
return AtlHresultFromLastError();
return S_OK;
}
HRESULT Write(
_In_bytecount_(nBufSize) LPCVOID pBuffer,
_In_ DWORD nBufSize,
_Inout_ LPOVERLAPPED pOverlapped,
_In_ LPOVERLAPPED_COMPLETION_ROUTINE pfnCompletionRoutine) throw()
{
ATLASSUME(m_h != NULL);
BOOL b = ::WriteFileEx(m_h, pBuffer, nBufSize, pOverlapped, pfnCompletionRoutine);
if (!b)
return AtlHresultFromLastError();
return S_OK;
}
// this function returns HRESULT_FROM_WIN32(ERROR_IO_INCOMPLETE)
// if bWait is false and the operation is still pending
HRESULT GetOverlappedResult(
_In_ LPOVERLAPPED pOverlapped,
_Out_ DWORD& dwBytesTransferred,
_In_ BOOL bWait) throw()
{
BOOL b = ::GetOverlappedResult(m_h, pOverlapped, &dwBytesTransferred, bWait);
if (!b)
return AtlHresultFromLastError();
return S_OK;
}
HRESULT Seek(_In_ LONGLONG nOffset, _In_ DWORD dwFrom = FILE_CURRENT) throw()
{
ATLASSUME(m_h != NULL);
ATLASSERT(dwFrom == FILE_BEGIN || dwFrom == FILE_END || dwFrom == FILE_CURRENT);
LARGE_INTEGER liOffset;
liOffset.QuadPart = nOffset;
DWORD nNewPos = ::SetFilePointer(m_h, liOffset.LowPart, &liOffset.HighPart, dwFrom);
if (nNewPos == INVALID_SET_FILE_POINTER)
{
HRESULT hr;
hr = AtlHresultFromLastError();
if (FAILED(hr))
return hr;
}
return S_OK;
}
HRESULT GetPosition(_Out_ ULONGLONG& nPos) const throw()
{
ATLASSUME(m_h != NULL);
LARGE_INTEGER liOffset;
liOffset.QuadPart = 0;
liOffset.LowPart = ::SetFilePointer(m_h, 0, &liOffset.HighPart, FILE_CURRENT);
if (liOffset.LowPart == INVALID_SET_FILE_POINTER)
{
HRESULT hr;
hr = AtlHresultFromLastError();
if (FAILED(hr))
return hr;
}
nPos = liOffset.QuadPart;
return S_OK;
}
HRESULT Flush() throw()
{
ATLASSUME(m_h != NULL);
if (!::FlushFileBuffers(m_h))
return AtlHresultFromLastError();
return S_OK;
}
HRESULT LockRange(_In_ ULONGLONG nPos, _In_ ULONGLONG nCount) throw()
{
ATLASSUME(m_h != NULL);
LARGE_INTEGER liPos;
liPos.QuadPart = nPos;
LARGE_INTEGER liCount;
liCount.QuadPart = nCount;
if (!::LockFile(m_h, liPos.LowPart, liPos.HighPart, liCount.LowPart, liCount.HighPart))
return AtlHresultFromLastError();
return S_OK;
}
HRESULT UnlockRange(_In_ ULONGLONG nPos, _In_ ULONGLONG nCount) throw()
{
ATLASSUME(m_h != NULL);
LARGE_INTEGER liPos;
liPos.QuadPart = nPos;
LARGE_INTEGER liCount;
liCount.QuadPart = nCount;
if (!::UnlockFile(m_h, liPos.LowPart, liPos.HighPart, liCount.LowPart, liCount.HighPart))
return AtlHresultFromLastError();
return S_OK;
}
HRESULT SetSize(_In_ ULONGLONG nNewLen) throw()
{
ATLASSUME(m_h != NULL);
HRESULT hr = Seek(nNewLen, FILE_BEGIN);
if (FAILED(hr))
return hr;
if (!::SetEndOfFile(m_h))
return AtlHresultFromLastError();
return S_OK;
}
HRESULT GetSize(_Out_ ULONGLONG& nLen) const throw()
{
ATLASSUME(m_h != NULL);
ULARGE_INTEGER liFileSize;
liFileSize.LowPart = ::GetFileSize(m_h, &liFileSize.HighPart);
if (liFileSize.LowPart == INVALID_FILE_SIZE)
{
HRESULT hr;
hr = AtlHresultFromLastError();
if (FAILED(hr))
return hr;
}
nLen = liFileSize.QuadPart;
return S_OK;
}
};
// This class allows the creation of a temporary file that is written to.
// When the entire file has been successfully written it will be closed and given
// it's proper file name if required.
class CAtlTemporaryFile
{
public:
CAtlTemporaryFile() throw()
{
}
~CAtlTemporaryFile() throw()
{
// Ensure that the temporary file is closed and deleted,
// if necessary.
if (m_file.m_h != NULL)
{
Close();
}
}
HRESULT Create(_In_opt_ LPCTSTR pszDir = NULL, _In_ DWORD dwDesiredAccess = GENERIC_WRITE) throw()
{
TCHAR szPath[_MAX_PATH];
TCHAR tmpFileName[_MAX_PATH];
ATLASSUME(m_file.m_h == NULL);
if (pszDir == NULL)
{
DWORD dwRet = GetTempPath(_MAX_DIR, szPath);
if (dwRet == 0)
{
// Couldn't find temporary path;
return AtlHresultFromLastError();
}
else if (dwRet > _MAX_DIR)
{
return DISP_E_BUFFERTOOSMALL;
}
}
else
{
if(Checked::tcsncpy_s(szPath, _countof(szPath), pszDir, _TRUNCATE)==STRUNCATE)
{
return DISP_E_BUFFERTOOSMALL;
}
}
if (!GetTempFileName(szPath, _T("TFR"), 0, tmpFileName))
{
// Couldn't create temporary filename;
return AtlHresultFromLastError();
}
tmpFileName[_countof(tmpFileName)-1]='\0';
Checked::tcsncpy_s(m_szTempFileName, _countof(m_szTempFileName), tmpFileName, _TRUNCATE);
SECURITY_ATTRIBUTES secatt;
secatt.nLength = sizeof(secatt);
secatt.lpSecurityDescriptor = NULL;
secatt.bInheritHandle = TRUE;
m_dwAccess = dwDesiredAccess;
return m_file.Create(
m_szTempFileName,
m_dwAccess,
0,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED | FILE_ATTRIBUTE_TEMPORARY,
&secatt);
}
HRESULT Close(_In_opt_ LPCTSTR szNewName = NULL) throw()
{
ATLASSUME(m_file.m_h != NULL);
// This routine is called when we are finished writing to the
// temporary file, so we now just want to close it and copy
// it to the actual filename we want it to be called.
// So let's close it first.
m_file.Close();
// no new name so delete it
if (szNewName == NULL)
{
::DeleteFile(m_szTempFileName);
return S_OK;
}
// delete any existing file and move our temp file into it's place
if (!::DeleteFile(szNewName))
{
DWORD dwError = GetLastError();
if (dwError != ERROR_FILE_NOT_FOUND)
return AtlHresultFromWin32(dwError);
}
if (!::MoveFile(m_szTempFileName, szNewName))
return AtlHresultFromLastError();
return S_OK;
}
HRESULT HandsOff() throw()
{
m_file.Flush();
m_file.Close();
return S_OK;
}
HRESULT HandsOn() throw()
{
HRESULT hr = m_file.Create(
m_szTempFileName,
m_dwAccess,
0,
OPEN_EXISTING);
if (FAILED(hr))
return hr;
return m_file.Seek(0, FILE_END);
}
HRESULT Read(
_Out_bytecap_(nBufSize) LPVOID pBuffer,
_In_ DWORD nBufSize,
_Out_ DWORD& nBytesRead) throw()
{
return m_file.Read(pBuffer, nBufSize, nBytesRead);
}
HRESULT Write(
_In_bytecount_(nBufSize) LPCVOID pBuffer,
_In_ DWORD nBufSize,
_Out_opt_ DWORD* pnBytesWritten = NULL) throw()
{
return m_file.Write(pBuffer, nBufSize, pnBytesWritten);
}
HRESULT Seek(_In_ LONGLONG nOffset, _In_ DWORD dwFrom = FILE_CURRENT) throw()
{
return m_file.Seek(nOffset, dwFrom);
}
HRESULT GetPosition(_Out_ ULONGLONG& nPos) const throw()
{
return m_file.GetPosition(nPos);
}
HRESULT Flush() throw()
{
return m_file.Flush();
}
HRESULT LockRange(_In_ ULONGLONG nPos, _In_ ULONGLONG nCount) throw()
{
return m_file.LockRange(nPos, nCount);
}
HRESULT UnlockRange(_In_ ULONGLONG nPos, _In_ ULONGLONG nCount) throw()
{
return m_file.UnlockRange(nPos, nCount);
}
HRESULT SetSize(_In_ ULONGLONG nNewLen) throw()
{
return m_file.SetSize(nNewLen);
}
HRESULT GetSize(_Out_ ULONGLONG& nLen) const throw()
{
return m_file.GetSize(nLen);
}
operator HANDLE() throw()
{
return m_file;
}
LPCTSTR TempFileName() throw()
{
return m_szTempFileName;
}
private:
CAtlFile m_file;
TCHAR m_szTempFileName[_MAX_FNAME+1];
DWORD m_dwAccess;
};
class CAtlFileMappingBase
{
public:
CAtlFileMappingBase() throw()
{
m_pData = NULL;
m_hMapping = NULL;
}
~CAtlFileMappingBase() throw()
{
Unmap();
}
HRESULT MapFile(
_In_ HANDLE hFile,
_In_ SIZE_T nMappingSize = 0,
_In_ ULONGLONG nOffset = 0,
_In_ DWORD dwMappingProtection = PAGE_READONLY,
_In_ DWORD dwViewDesiredAccess = FILE_MAP_READ) throw()
{
ATLASSUME(m_pData == NULL);
ATLASSUME(m_hMapping == NULL);
ATLASSERT(hFile != INVALID_HANDLE_VALUE && hFile != NULL);
ULARGE_INTEGER liFileSize;
liFileSize.LowPart = ::GetFileSize(hFile, &liFileSize.HighPart);
if (liFileSize.QuadPart < nMappingSize)
liFileSize.QuadPart = nMappingSize;
m_hMapping = ::CreateFileMapping(hFile, NULL, dwMappingProtection, liFileSize.HighPart, liFileSize.LowPart, 0);
if (m_hMapping == NULL)
return AtlHresultFromLastError();
if (nMappingSize == 0)
m_nMappingSize = (SIZE_T) (liFileSize.QuadPart - nOffset);
else
m_nMappingSize = nMappingSize;
m_dwViewDesiredAccess = dwViewDesiredAccess;
m_nOffset.QuadPart = nOffset;
m_pData = ::MapViewOfFileEx(m_hMapping, m_dwViewDesiredAccess, m_nOffset.HighPart, m_nOffset.LowPart, m_nMappingSize, NULL);
if (m_pData == NULL)
{
HRESULT hr;
hr = AtlHresultFromLastError();
::CloseHandle(m_hMapping);
m_hMapping = NULL;
return hr;
}
return S_OK;
}
HRESULT MapSharedMem(
_In_ SIZE_T nMappingSize,
_In_ LPCTSTR szName,
_Out_opt_ BOOL* pbAlreadyExisted = NULL,
_In_opt_ LPSECURITY_ATTRIBUTES lpsa = NULL,
_In_ DWORD dwMappingProtection = PAGE_READWRITE,
_In_ DWORD dwViewDesiredAccess = FILE_MAP_ALL_ACCESS) throw()
{
ATLASSUME(m_pData == NULL);
ATLASSUME(m_hMapping == NULL);
ATLASSERT(nMappingSize > 0);
ATLASSERT(szName != NULL); // if you just want a regular chunk of memory, use a heap allocator
m_nMappingSize = nMappingSize;
ULARGE_INTEGER nSize;
nSize.QuadPart = nMappingSize;
m_hMapping = ::CreateFileMapping(INVALID_HANDLE_VALUE, lpsa, dwMappingProtection, nSize.HighPart, nSize.LowPart, szName);
if (m_hMapping == NULL)
return AtlHresultFromLastError();
if (pbAlreadyExisted != NULL)
*pbAlreadyExisted = (GetLastError() == ERROR_ALREADY_EXISTS);
m_dwViewDesiredAccess = dwViewDesiredAccess;
m_nOffset.QuadPart = 0;
m_pData = ::MapViewOfFileEx(m_hMapping, m_dwViewDesiredAccess, m_nOffset.HighPart, m_nOffset.LowPart, m_nMappingSize, NULL);
if (m_pData == NULL)
{
HRESULT hr;
hr = AtlHresultFromLastError();
::CloseHandle(m_hMapping);
m_hMapping = NULL;
return hr;
}
return S_OK;
}
HRESULT OpenMapping(
_In_ LPCTSTR szName,
_In_ SIZE_T nMappingSize,
_In_ ULONGLONG nOffset = 0,
_In_ DWORD dwViewDesiredAccess = FILE_MAP_ALL_ACCESS) throw()
{
ATLASSUME(m_pData == NULL);
ATLASSUME(m_hMapping == NULL);
ATLASSERT(szName != NULL); // if you just want a regular chunk of memory, use a heap allocator
m_nMappingSize = nMappingSize;
m_dwViewDesiredAccess = dwViewDesiredAccess;
m_hMapping = ::OpenFileMapping(m_dwViewDesiredAccess, FALSE, szName);
if (m_hMapping == NULL)
return AtlHresultFromLastError();
m_dwViewDesiredAccess = dwViewDesiredAccess;
m_nOffset.QuadPart = nOffset;
m_pData = ::MapViewOfFileEx(m_hMapping, m_dwViewDesiredAccess, m_nOffset.HighPart, m_nOffset.LowPart, m_nMappingSize, NULL);
if (m_pData == NULL)
{
HRESULT hr;
hr = AtlHresultFromLastError();
::CloseHandle(m_hMapping);
m_hMapping = NULL;
return hr;
}
return S_OK;
}
HRESULT Unmap() throw()
{
HRESULT hr = S_OK;
if (m_pData != NULL)
{
if (!::UnmapViewOfFile(m_pData))
hr = AtlHresultFromLastError();
m_pData = NULL;
}
if (m_hMapping != NULL)
{
if (!::CloseHandle(m_hMapping) && SUCCEEDED(hr))
hr = AtlHresultFromLastError();
m_hMapping = NULL;
}
return hr;
}
void* GetData() const throw()
{
return m_pData;
}
HANDLE GetHandle() const throw()
{
return m_hMapping;
}
SIZE_T GetMappingSize() throw()
{
return m_nMappingSize;
}
HRESULT CopyFrom(_In_ CAtlFileMappingBase& orig) throw()
{
if (this == &orig)
return S_OK;
ATLASSUME(m_pData == NULL);
ATLASSUME(m_hMapping == NULL);
ATLASSERT(orig.m_pData != NULL);
ATLENSURE_RETURN_VAL(orig.m_hMapping != NULL, E_FAIL);
m_dwViewDesiredAccess = orig.m_dwViewDesiredAccess;
m_nOffset.QuadPart = orig.m_nOffset.QuadPart;
m_nMappingSize = orig.m_nMappingSize;
if (!::DuplicateHandle(GetCurrentProcess(), orig.m_hMapping, GetCurrentProcess(),
&m_hMapping, NULL, TRUE, DUPLICATE_SAME_ACCESS))
return AtlHresultFromLastError();
m_pData = ::MapViewOfFileEx(m_hMapping, m_dwViewDesiredAccess, m_nOffset.HighPart, m_nOffset.LowPart, m_nMappingSize, NULL);
if (m_pData == NULL)
{
HRESULT hr;
hr = AtlHresultFromLastError();
::CloseHandle(m_hMapping);
m_hMapping = NULL;
return hr;
}
return S_OK;
}
CAtlFileMappingBase(_In_ CAtlFileMappingBase& orig)
{
m_pData = NULL;
m_hMapping = NULL;
HRESULT hr = CopyFrom(orig);
if (FAILED(hr))
AtlThrow(hr);
}
CAtlFileMappingBase& operator=(_In_ CAtlFileMappingBase& orig)
{
HRESULT hr = CopyFrom(orig);
if (FAILED(hr))
AtlThrow(hr);
return *this;
}
private:
void* m_pData;
SIZE_T m_nMappingSize;
HANDLE m_hMapping;
ULARGE_INTEGER m_nOffset;
DWORD m_dwViewDesiredAccess;
};
template <typename T = char>
class CAtlFileMapping : public CAtlFileMappingBase
{
public:
operator T*() const throw()
{
return reinterpret_cast<T*>(GetData());
}
};
}; //namespace ATL
#pragma pack(pop)
#endif //__ATLFILE_H__
| {
"pile_set_name": "Github"
} |
import cv2
import numpy as np
import torch
from torch.utils.data import Dataset
import string
import random
class TestDataset(Dataset):
def __init__(self,
epoch_len = 10000,
seq_len = 8,
transform=None,
abc=string.digits):
super().__init__()
self.abc = abc
self.epoch_len = epoch_len
self.seq_len = seq_len
self.transform = transform
def __len__(self):
return self.epoch_len
def get_abc(self):
return self.abc
def set_mode(self, mode='train'):
return
def generate_string(self):
return ''.join(random.choice(self.abc) for _ in range(self.seq_len))
def get_sample(self):
h, w = 64, int(self.seq_len * 64 * 2.5)
pw = int(w / self.seq_len)
seq = []
img = np.zeros((h, w), dtype=np.uint8)
text = self.generate_string()
for i in range(len(text)):
c = text[i]
seq.append(self.abc.find(c) + 1)
hs, ws = 32, 32
symb = np.zeros((hs, ws), dtype=np.uint8)
font = cv2.FONT_HERSHEY_SIMPLEX
cv2.putText(symb, str(c), (3, 30), font, 1.2, (255), 2, cv2.LINE_AA)
# Rotation
angle = 60
ang_rot = np.random.uniform(angle) - angle/2
transform = cv2.getRotationMatrix2D((ws/2, hs/2), ang_rot, 1)
symb = cv2.warpAffine(symb, transform, (ws, hs), borderValue = 0)
# Scale
scale = np.random.uniform(0.7, 1.0)
transform = np.float32([[scale, 0, 0],[0, scale, 0]])
symb = cv2.warpAffine(symb, transform, (ws, hs), borderValue = 0)
y = np.random.randint(hs, h)
x = np.random.randint(i * pw, (i + 1) * pw - ws)
img[y-hs:y, x:x+ws] = symb
nw = int(w * 32 / h)
img = cv2.resize(img, (nw, 32))
img = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR)
return img, seq
def __getitem__(self, idx):
img, seq = self.get_sample()
sample = {"img": img, "seq": seq, "seq_len": len(seq), "aug": True}
if self.transform:
sample = self.transform(sample)
return sample
| {
"pile_set_name": "Github"
} |
---
id: 5a24c314108439a4d403618b
title: Give Sibling Elements a Unique Key Attribute
challengeType: 6
videoUrl: ''
localeTitle: Dar a los elementos hermanos un atributo clave único
---
## Description
<section id="description"> El último desafío mostró cómo se usa el método de <code>map</code> para generar dinámicamente una serie de elementos basados en la entrada del usuario. Sin embargo, faltaba una pieza importante en ese ejemplo. Cuando crea una matriz de elementos, cada uno necesita un atributo de <code>key</code> establecido en un valor único. React utiliza estas teclas para realizar un seguimiento de los elementos que se agregan, cambian o eliminan. Esto ayuda a hacer que el proceso de representación sea más eficiente cuando la lista se modifica de alguna manera. Tenga en cuenta que las claves solo tienen que ser únicas entre elementos hermanos, no tienen que ser únicas a nivel mundial en su aplicación. </section>
## Instructions
<section id="instructions"> El editor de código tiene una matriz con algunos marcos front-end y un componente funcional sin estado llamado <code>Frameworks()</code> . <code>Frameworks()</code> necesita asignar la matriz a una lista desordenada, como en el último desafío. Termine de escribir la devolución de llamada del <code>map</code> para devolver un elemento <code>li</code> para cada marco en la matriz <code>frontEndFrameworks</code> . Esta vez, asegúrese de dar a cada <code>li</code> un atributo <code>key</code> , establecido en un valor único. Normalmente, desea que la clave sea algo que identifique de forma única el elemento que se está representando. Como último recurso, se puede usar el índice de matriz, pero normalmente debe intentar usar una identificación única. </section>
## Tests
<section id='tests'>
```yml
tests:
- text: El componente <code>Frameworks</code> debería existir y renderizarse a la página.
testString: 'assert(Enzyme.mount(React.createElement(Frameworks)).find("Frameworks").length === 1, "The <code>Frameworks</code> component should exist and render to the page.");'
- text: <code>Frameworks</code> deberían representar un elemento <code>h1</code> .
testString: 'assert(Enzyme.mount(React.createElement(Frameworks)).find("h1").length === 1, "<code>Frameworks</code> should render an <code>h1</code> element.");'
- text: <code>Frameworks</code> deberían representar un elemento <code>ul</code> .
testString: 'assert(Enzyme.mount(React.createElement(Frameworks)).find("ul").length === 1, "<code>Frameworks</code> should render a <code>ul</code> element.");'
- text: La etiqueta <code>ul</code> debe mostrar 6 elementos <code>li</code> secundarios.
testString: 'assert(Enzyme.mount(React.createElement(Frameworks)).find("ul").children().length === 6 && Enzyme.mount(React.createElement(Frameworks)).find("ul").childAt(0).name() === "li" && Enzyme.mount(React.createElement(Frameworks)).find("li").length === 6, "The <code>ul</code> tag should render 6 child <code>li</code> elements.");'
- text: Cada elemento del elemento de la lista debe tener un atributo de <code>key</code> único.
testString: 'assert((() => { const ul = Enzyme.mount(React.createElement(Frameworks)).find("ul"); const keys = new Set([ ul.childAt(0).key(), ul.childAt(1).key(), ul.childAt(2).key(), ul.childAt(3).key(), ul.childAt(4).key(), ul.childAt(5).key(), ]); return keys.size === 6; })(), "Each list item element should have a unique <code>key</code> attribute.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='jsx-seed'>
```jsx
const frontEndFrameworks = [
'React',
'Angular',
'Ember',
'Knockout',
'Backbone',
'Vue'
];
function Frameworks() {
const renderFrameworks = null; // change code here
return (
<div>
<h1>Popular Front End JavaScript Frameworks</h1>
<ul>
{renderFrameworks}
</ul>
</div>
);
};
```
</div>
### After Test
<div id='jsx-teardown'>
```js
console.info('after the test');
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>
| {
"pile_set_name": "Github"
} |
Feature extraction
==================
The term *Feature Extraction*
refers to techniques aiming at extracting added value information from
images. These extracted items named *features* can be local statistical
moments, edges, radiometric indices, morphological and textural
properties. For example, such features can be used as input data for
other image processing methods like *Segmentation* and
`Classification <https://www.orfeo-toolbox.org/CookBook/recipes/pbclassif.html#feature-classification>`_ .
Local statistics extraction
---------------------------
This application computes the 4 local statistical moments on every pixel
in the selected channel of the input image, over a specified
neighborhood. The output image is multi band with one statistical moment
(feature) per band. Thus, the 4 output features are the Mean, the
Variance, the Skewness and the Kurtosis. They are provided in this exact
order in the output image.
The *LocalStatisticExtraction* application has the following input
parameters:
-``-in`` the input image to compute the features on
-``-channel`` the selected channel index in the input image to be
processed (default value is 1)
-``-radius`` the computational window radius (default value is 3
pixels)
-``-out`` the output image containing the local statistical moments
The application can be used like this:
::
otbcli_LocalStatisticExtraction -in InputImage.tif
-channel 1
-radius 3
-out OutputImage.tif
Edge extraction
---------------
This application Computes edge features on every pixel in the selected
channel of the input image.
The *EdgeExtraction* application has the following input parameters:
-``-in`` the input image to compute the features on
-``-channel`` the selected channel index in the input image to be
processed (default value is 1)
- ``-filter`` the choice of edge detection method (gradient/sobel/touzi) (default value is gradient)
-``(-filter.touzi.xradius)`` the X Radius of the Touzi processing neighborhood (only if filter==touzi) (default value is 1 pixel) __
- ``(-filter.touzi.yradius)`` the Y Radius of the Touzi processing neighborhood (only if filter==touzi) (default value is 1 pixel)
-``-out`` the output mono band image containing the edge features
The application can be used like this:
::
otbcli_EdgeExtraction -in InputImage
-channel 1
-filter sobel
-out OutputImage
or like this if filter==touzi:
::
otbcli_EdgeExtraction -in InputImage
-channel 1
-filter touzi
-filter.touzi.xradius 2
-filter.touzi.yradius 2
-out OutputImage
Radiometric indices extraction
------------------------------
This application computes radiometric indices using the channels of the
input image. The output is a multi band image into which each channel is
one of the selected indices.
The *RadiometricIndices* application has the following input parameters:
-``-in`` the input image to compute the features on
-``-out`` the output image containing the radiometric indices
-``-channels.blue`` the Blue channel index in the input image (default
value is 1)
-``-channels.green`` the Green channel index in the input image
(default value is 1)
-``-channels.red`` the Red channel index in the input image (default
value is 1)
-``-channels.nir`` the Near Infrared channel index in the input image
(default value is 1)
-``-channels.mir`` the Mid-Infrared channel index in the input image
(default value is 1)
-``-list`` the list of available radiometric indices (default value is
``Vegetation:NDVI``)
Note that band numbering starts at 1.
The available radiometric indices to be listed into ``-list`` with their
relevant channels in brackets are:
+------------------------------+----------------------------------------------------------+---------------+
|Index |Description |Required bands |
+==============================+==========================================================+===============+
|Vegetation:NDVI |Normalized difference vegetation index |Red, NIR |
+------------------------------+----------------------------------------------------------+---------------+
|Vegetation:TNDVI |Transformed normalized difference vegetation index |Red, NIR |
+------------------------------+----------------------------------------------------------+---------------+
|Vegetation:RVI |Ratio vegetation index |Red, NIR |
+------------------------------+----------------------------------------------------------+---------------+
|Vegetation:SAVI |Soil adjusted vegetation index |Red, NIR |
+------------------------------+----------------------------------------------------------+---------------+
|Vegetation:TSAVI |Transformed soil adjusted vegetation index |Red, NIR |
+------------------------------+----------------------------------------------------------+---------------+
|Vegetation:MSAVI |Modified soil adjusted vegetation index |Red, NIR |
+------------------------------+----------------------------------------------------------+---------------+
|Vegetation:MSAVI2 |Modified soil adjusted vegetation index 2 |Red, NIR |
+------------------------------+----------------------------------------------------------+---------------+
|Vegetation:GEMI |Global environment monitoring index |Red, NIR |
+------------------------------+----------------------------------------------------------+---------------+
|Vegetation:IPVI |Infrared percentage vegetation index |Red, NIR |
+------------------------------+----------------------------------------------------------+---------------+
|Vegetation:LAIFromNDVILog |Leaf Area Index from log NDVI |Red, NIR |
+------------------------------+----------------------------------------------------------+---------------+
|Vegetation::LAIFromReflLinear |Leaf Area Index from reflectances with linear combination |Red, NIR |
+------------------------------+----------------------------------------------------------+---------------+
|Vegetation::LAIFromNDVIFormo |Leaf Area Index from Formosat 2 TOC |Red, NIR |
+------------------------------+----------------------------------------------------------+---------------+
|Water:NDWI |Normalized difference water index (Gao 1996) |NIR, MIR |
+------------------------------+----------------------------------------------------------+---------------+
|Water:NDWI2 |Normalized difference water index (Mc Feeters 1996) |Green, NIR |
+------------------------------+----------------------------------------------------------+---------------+
|Water:MNDWI |Modified normalized difference water index (Xu 2006) |Green, MIR |
+------------------------------+----------------------------------------------------------+---------------+
|Water:NDTI |Normalized difference turbidity index (Lacaux et al.) |Green, Red |
+------------------------------+----------------------------------------------------------+---------------+
|Soil:RI |Redness index |Green, Red |
+------------------------------+----------------------------------------------------------+---------------+
|Soil:CI |Color index |Green, Red |
+------------------------------+----------------------------------------------------------+---------------+
|Soil:BI |Brightness index |Green, Red |
+------------------------------+----------------------------------------------------------+---------------+
|Soil:BI2 |Brightness index 2 |Green, Red, NIR|
+------------------------------+----------------------------------------------------------+---------------+
|BuiltUp:ISU |Built Surfaces Index |Red, NIR |
+------------------------------+----------------------------------------------------------+---------------+
The application can be used as follows, which would produce an output image
containing 3 bands, respectively with the ``Vegetation:NDVI``, ``Vegetation:RVI`` and
``Vegetation:IPVI`` radiometric indices in this exact order:
::
otbcli_RadiometricIndices -in InputImage
-out OutputImage
-channels.red 3
-channels.green 2
-channels.nir 4
-list Vegetation:NDVI Vegetation:RVI
Vegetation:IPVI
or as follows, which would produce a single band output image with the
``Water:NDWI2`` radiometric index:
::
otbcli_RadiometricIndices -in InputImage
-out OutputImage
-channels.red 3
-channels.green 2
-channels.nir 4
-list Water:NDWI2
Morphological features extraction
---------------------------------
Morphological features can be highlighted by using image filters based
on mathematical morphology either on binary or gray scale images.
Binary morphological operations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This application performs binary morphological operations (dilation,
erosion, opening and closing) on a mono band image with a specific
structuring element (a ball or a cross) having one radius along X and
another one along Y. NB: the cross shaped structuring element has a
fixed radius equal to 1 pixel in both X and Y directions.
The *BinaryMorphologicalOperation* application has the following input
parameters:
-``-in`` the input image to be filtered
-``-channel`` the selected channel index in the input image to be
processed (default value is 1)
-``-structype`` the choice of the structuring element type
(ball/cross) (default value is ball)
-``(-xradius)`` the ball structuring element X Radius
(default value is 5 pixels)
-``(-yradius)`` the ball structuring element Y Radius
(default value is 5 pixels)
-``-filter`` the choice of the morphological operation
(dilate/erode/opening/closing) (default value is dilate)
-``(-foreval)`` the foreground value
(Used for dilate/erode/opening/closing morphological operations) (default value is 1)
-``(-backval)`` the background value
(Used for dilate/erode/opening morphological operations) (default value is 0)
-``-out`` the output filtered image
The application can be used as follows:
::
otbcli_BinaryMorphologicalOperation -in InputImage
-channel 1
-structype ball
-structype.ball.xradius 10
-structype.ball.yradius 5
-filter opening
-foreval 1.0
-backval 0.0
-out OutputImage
Gray scale morphological operations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This application performs morphological operations (dilation, erosion,
opening and closing) on a gray scale mono band image with a specific
structuring element (a ball or a cross) having one radius along X and
another one along Y. NB: the cross shaped structuring element has a
fixed radius equal to 1 pixel in both X and Y directions.
The *GrayScaleMorphologicalOperation* application has the following
input parameters:
-``-in`` the input image to be filtered
-``-channel`` the selected channel index in the input image to be
processed (default value is 1)
-``-structype`` the choice of the structuring element type
(ball/cross) (default value is ball)
-``(-structype.ball.xradius)`` the ball structuring element X Radius
(only if structype==ball) (default value is 5 pixels)
-``(-structype.ball.yradius)`` the ball structuring element Y Radius
(only if structype==ball) (default value is 5 pixels)
-``-filter`` the choice of the morphological operation
(dilate/erode/opening/closing) (default value is dilate)
-``-out`` the output filtered image
The application can be used as follows:
::
otbcli_GrayScaleMorphologicalOperation -in InputImage
-channel 1
-structype ball
-structype.ball.xradius 10
-structype.ball.yradius 5
-filter opening
-out OutputImage
Textural features extraction
----------------------------
Texture features can be extracted with the help of image filters based
on texture analysis methods like Haralick and structural feature set
(SFS).
Haralick texture features
~~~~~~~~~~~~~~~~~~~~~~~~~
This application computes Haralick, advanced and higher order texture
features on every pixel in the selected channel of the input image. The
output image is multi band with a feature per band.
The *HaralickTextureExtraction* application has the following input
parameters:
-``-in`` the input image to compute the features on
-``-channel`` the selected channel index in the input image to be
processed (default value is 1)
-``-texture`` the texture set selection [simple/advanced/higher]
(default value is simple)
-``-parameters.min`` the input image minimum (default value is 0)
-``-parameters.max`` the input image maximum (default value is 255)
-``-parameters.xrad`` the X Radius of the processing neighborhood
(default value is 2 pixels)
-``-parameters.yrad`` the Y Radius of the processing neighborhood
(default value is 2 pixels)
-``-parameters.xoff`` the :math:`\Delta`\ X Offset for the
co-occurrence computation (default value is 1 pixel)
-``-parameters.yoff`` the :math:`\Delta`\ Y Offset for the
co-occurrence computation (default value is 1 pixel)
-``-parameters.nbbin`` the number of bin per axis for histogram
generation (default value is 8)
-``-out`` the output multi band image containing the selected texture
features (one feature per band)
The available values for -texture with their relevant features are:
-``-texture=simple:`` In this case, 8 local Haralick textures features
will be processed. The 8 output image channels are: Energy, Entropy,
Correlation, Inverse Difference Moment, Inertia, Cluster Shade,
Cluster Prominence and Haralick Correlation. They are provided in
this exact order in the output image. Thus, this application computes
the following Haralick textures over a neighborhood with user defined
radius. To improve the speed of computation, a variant of Grey Level
Co-occurrence Matrix(GLCM) called Grey Level Co-occurrence Indexed
List (GLCIL) is used. Given below is the mathematical explanation on
the computation of each textures. Here :math:`g(i, j)` is the
frequency of element in the GLCIL whose index is i, j. GLCIL stores a
pair of frequency of two pixels taken from the given offset and the
cell index (i, j) of the pixel in the neighborhood window. :(where
each element in GLCIL is a pair of pixel index and it’s frequency,
:math:`g(i, j)` is the frequency value of the pair having index is
i, j).
“Energy” :math:`= f_1 = \sum_{i, j}g(i, j)^2`
“Entropy” :math:`= f_2 = -\sum_{i, j}g(i, j) \log_2 g(i, j)`, or 0
if :math:`g(i, j) = 0`
“Correlation”
:math:`= f_3 = \sum_{i, j}\frac{(i - \mu)(j - \mu)g(i, j)}{\sigma^2}`
“Inverse Difference Moment”
:math:`= f_4 = \sum_{i, j}\frac{1}{1 + (i - j)^2}g(i, j)`
“Inertia” :math:`= f_5 = \sum_{i, j}(i - j)^2g(i, j)` (sometimes
called “contrast”)
“Cluster Shade”
:math:`= f_6 = \sum_{i, j}((i - \mu) + (j - \mu))^3 g(i, j)`
“Cluster Prominence”
:math:`= f_7 = \sum_{i, j}((i - \mu) + (j - \mu))^4 g(i, j)`
“Haralick’s Correlation”
:math:`= f_8 = \frac{\sum_{i, j}(i, j) g(i, j) -\mu_t^2}{\sigma_t^2}`
where :math:`\mu_t` and :math:`\sigma_t` are the mean and standard
deviation of the row (or column, due to symmetry) sums. Above,
:math:`\mu =` (weighted pixel average)
:math:`= \sum_{i, j}i \cdot g(i, j) = \sum_{i, j}j \cdot g(i, j)`
(due to matrix symmetry), and :math:`\sigma =` (weighted pixel
variance)
:math:`= \sum_{i, j}(i - \mu)^2 \cdot g(i, j) = \sum_{i, j}(j - \mu)^2 \cdot g(i, j)`
(due to matrix symmetry).
-``-texture=advanced:`` In this case, 10 advanced texture features
will be processed. The 10 output image channels are: Mean, Variance,
Dissimilarity, Sum Average, Sum Variance, Sum Entropy, Difference of
Entropies, Difference of Variances, IC1 and IC2. They are provided in
this exact order in the output image. The textures are computed over
a sliding window with user defined radius.
To improve the speed of computation, a variant of Grey Level
Co-occurrence Matrix(GLCM) called Grey Level Co-occurrence Indexed
List (GLCIL) is used. Given below is the mathematical explanation on
the computation of each textures. Here :math:`g(i, j)` is the
frequency of element in the GLCIL whose index is i, j. GLCIL stores a
pair of frequency of two pixels taken from the given offset and the
cell index (i, j) of the pixel in the neighborhood window. :(where
each element in GLCIL is a pair of pixel index and it’s frequency,
:math:`g(i, j)` is the frequency value of the pair having index is
i, j).
“Mean” :math:`= \sum_{i, j}i g(i, j)`
“Sum of squares: Variance”
:math:`= f_4 = \sum_{i, j}(i - \mu)^2 g(i, j)`
“Dissimilarity” :math:`= f_5 = \sum_{i, j}(i - j) g(i, j)^2`
“Sum average” :math:`= f_6 = -\sum_{i}i g_{x+y}(i)`
“Sum Variance” :math:`= f_7 = \sum_{i}(i - f_8)^2 g_{x+y}(i)`
“Sum Entropy” :math:`= f_8 = -\sum_{i}g_{x+y}(i) log (g_{x+y}(i))`
“Difference variance” :math:`= f_10 = variance of g_{x-y}(i)`
“Difference entropy”
:math:`= f_11 = -\sum_{i}g_{x-y}(i) log (g_{x-y}(i))`
“Information Measures of Correlation IC1”
:math:`= f_12 = \frac{f_9 - HXY1}{H}`
“Information Measures of Correlation IC2”
:math:`= f_13 = \sqrt{1 - \exp{-2}|HXY2 - f_9|}`
Above, :math:`\mu =` (weighted pixel average)
:math:`= \sum_{i, j}i \cdot g(i, j) = \sum_{i, j}j \cdot g(i, j)`
(due to matrix summetry), and
:math:`g_{x+y}(k) = \sum_{i}\sum_{j}g(i)` where :math:`i+j=k`
and :math:`k = 2, 3, .., 2N_{g}` and
:math:`g_{x-y}(k) = \sum_{i}\sum_{j}g(i)` where :math:`i-j=k`
and :math:`k = 0, 1, .., N_{g}-1`
-``-texture=higher:`` In this case, 11 local higher order statistics
texture coefficients based on the grey level run-length matrix will
be processed. The 11 output image channels are: Short Run Emphasis,
Long Run Emphasis, Grey-Level Nonuniformity, Run Length
Nonuniformity, Run Percentage, Low Grey-Level Run Emphasis, High
Grey-Level Run Emphasis, Short Run Low Grey-Level Emphasis, Short Run
High Grey-Level Emphasis, Long Run Low Grey-Level Emphasis and Long
Run High Grey-Level Emphasis. They are provided in this exact order
in the output image. Thus, this application computes the following
Haralick textures over a sliding window with user defined radius:
(where :math:`p(i, j)` is the element in cell i, j of a normalized
Run Length Matrix, :math:`n_r` is the total number of runs and
:math:`n_p` is the total number of pixels):
“Short Run Emphasis”
:math:`= SRE = \frac{1}{n_r} \sum_{i, j}\frac{p(i, j)}{j^2}`
“Long Run Emphasis”
:math:`= LRE = \frac{1}{n_r} \sum_{i, j}p(i, j) * j^2`
“Grey-Level Nonuniformity”
:math:`= GLN = \frac{1}{n_r} \sum_{i} \left( \sum_{j}{p(i, j)} \right)^2`
“Run Length Nonuniformity”
:math:`= RLN = \frac{1}{n_r} \sum_{j} \left( \sum_{i}{p(i, j)} \right)^2`
“Run Percentage” :math:`= RP = \frac{n_r}{n_p}`
“Low Grey-Level Run Emphasis”
:math:`= LGRE = \frac{1}{n_r} \sum_{i, j}\frac{p(i, j)}{i^2}`
“High Grey-Level Run Emphasis”
:math:`= HGRE = \frac{1}{n_r} \sum_{i, j}p(i, j) * i^2`
“Short Run Low Grey-Level Emphasis”
:math:`= SRLGE = \frac{1}{n_r} \sum_{i, j}\frac{p(i, j)}{i^2 j^2}`
“Short Run High Grey-Level Emphasis”
:math:`= SRHGE = \frac{1}{n_r} \sum_{i, j}\frac{p(i, j) * i^2}{j^2}`
“Long Run Low Grey-Level Emphasis”
:math:`= LRLGE = \frac{1}{n_r} \sum_{i, j}\frac{p(i, j) * j^2}{i^2}`
“Long Run High Grey-Level Emphasis”
:math:`= LRHGE = \frac{1}{n_r} \sum_{i, j} p(i, j) i^2 j^2`
The application can be used like this:
::
otbcli_HaralickTextureExtraction -in InputImage
-channel 1
-texture simple
-parameters.min 0
-parameters.max 255
-out OutputImage
SFS texture extraction
~~~~~~~~~~~~~~~~~~~~~~
This application computes Structural Feature Set textures on every pixel
in the selected channel of the input image. The output image is multi
band with a feature per band. The 6 output texture features are
SFS’Length, SFS’Width, SFS’PSI, SFS’W-Mean, SFS’Ratio and SFS’SD. They
are provided in this exact order in the output image.
It is based on line direction estimation and described in the following
publication. Please refer to Xin Huang, Liangpei Zhang and Pingxiang Li
publication, Classification and Extraction of Spatial Features in Urban
Areas Using High-Resolution Multispectral Imagery. IEEE Geoscience and
Remote Sensing Letters, vol. 4, n. 2, 2007, pp 260-264.
The texture is computed for each pixel using its neighborhood. User can
set the spatial threshold that is the max line length, the spectral
threshold that is the max difference authorized between a pixel of the
line and the center pixel of the current neighborhood. The adjustement
constant alpha and the ratio Maximum Consideration Number, which
describes the shape contour around the central pixel, are used to
compute the :math:`w - mean` value.
The *SFSTextureExtraction* application has the following input
parameters:
-``-in`` the input image to compute the features on
-``-channel`` the selected channel index in the input image to be
processed (default value is 1)
-``-parameters.spethre`` the spectral threshold (default value is 50)
-``-parameters.spathre`` the spatial threshold (default value is 100
pixels)
-``-parameters.nbdir`` the number of directions (default value is 20)
-``-parameters.alpha`` the alpha value (default value is 1)
-``-parameters.maxcons`` the ratio Maximum Consideration Number
(default value is 5)
-``-out`` the output multi band image containing the selected texture
features (one feature per band)
The application can be used like this:
::
otbcli_SFSTextureExtraction -in InputImage
-channel 1
-out OutputImage
| {
"pile_set_name": "Github"
} |
"""lazy_balancer URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home')
Including another URLconf
1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from . import views
#from django.views.generic.base import RedirectView
urlpatterns = [
url(r'^$', views.view),
url(r'^save/$', views.save),
]
| {
"pile_set_name": "Github"
} |
using System;
namespace Calamari.Common.Plumbing.Variables
{
public static class JavaVariables
{
public static readonly string JavaLibraryEnvVar = "JavaIntegrationLibraryPackagePath";
}
} | {
"pile_set_name": "Github"
} |
/* Transmit and receive messages through SocketCAN on Linux
*
* Uses the Serial port to send/receive CAN messages in an ASCII
* protocol called SLCAN.
*
* Summary of commands a computer can send to the Carloop:
*
* O\r Opens the CAN connection
* C\r Close the CAN connection
* Sn\r Sets the CAN bit rate (defaults to 500 kbit/s)
* This takes effect the next time the CAN is opened.
*
* The following values are available:
* S0 10 kbit/s
* S1 20 kbit/s
* S2 50 kbit/s
* S3 100 kbit/s
* S4 125 kbit/s
* S5 250 kbit/s
* S6 500 kbit/s
* S7 800 kbit/s
* S8 1 Mbit/s
* t<id><len><data>\n Transmits a CAN message
* <id> must be 3 character hex number
* <len> must be a 1 character hex number
* <data> must be the data byte values in hex
*
* Example:
* t1234aabbccdd\n transmits message 0x123 with data 0xaabbccdd
*
* Where \r stands for ASCII character 0x0a, new line.
*
* When the Carloop receives a CAN message it prints it to the Serial
* port in the t<id><len><data> format
*
* Copyright 2016 Julien Vanier
*
* Distributed under the MIT license. See LICENSE.txt for more details.
*/
#include "application.h"
#include "carloop.h"
SYSTEM_THREAD(ENABLED);
void receiveMessages();
void printReceivedMessage(const CANMessage &message);
void parseInput(char c);
void openCAN();
void closeCAN();
void changeCANSpeed(const char *buf, unsigned n);
void transmitMessage(const char *buf, unsigned n);
Carloop<CarloopRevision2> carloop;
const char NEW_LINE = '\r';
char inputBuffer[40];
unsigned inputPos = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
if (carloop.can().isEnabled()) {
receiveMessages();
}
}
void receiveMessages()
{
CANMessage message;
while(carloop.can().receive(message))
{
printReceivedMessage(message);
}
}
void printReceivedMessage(const CANMessage &message)
{
Serial.printf("t%03x%d", message.id, message.len);
for(auto i = 0; i < message.len; i++) {
Serial.printf("%02x", message.data[i]);
}
Serial.write(NEW_LINE);
}
void serialEvent()
{
parseInput(Serial.read());
}
void parseInput(char c)
{
if (inputPos < sizeof(inputBuffer))
{
inputBuffer[inputPos] = c;
inputPos++;
}
if (c == NEW_LINE)
{
switch (inputBuffer[0])
{
case 'O':
openCAN();
break;
case 'C':
closeCAN();
break;
case 'S':
changeCANSpeed(&inputBuffer[1], inputPos - 2);
break;
case 't':
transmitMessage(&inputBuffer[1], inputPos - 2);
break;
}
inputPos = 0;
}
}
bool opened()
{
return carloop.can().isEnabled();
}
void openCAN()
{
if (opened())
{
return;
}
carloop.enableCAN();
}
void closeCAN()
{
if (!opened())
{
return;
}
carloop.disableCAN();
}
void changeCANSpeed(const char *buf, unsigned n)
{
if (n == 0)
{
return;
}
unsigned speed = 0;
switch (buf[0])
{
case '0': speed = 10000; break;
case '1': speed = 20000; break;
case '2': speed = 50000; break;
case '3': speed = 100000; break;
case '4': speed = 125000; break;
case '5': speed = 250000; break;
case '6': speed = 500000; break;
case '7': speed = 800000; break;
case '8': speed = 1000000; break;
default: return;
}
carloop.setCANSpeed(speed);
}
unsigned hex2int(char c)
{
if (c >= '0' && c <= '9')
{
return c - '0';
}
else if (c >= 'a' && c <= 'f')
{
return c - 'a' + 10;
}
else if (c >= 'A' && c <= 'F')
{
return c - 'A' + 10;
}
return 0;
}
void transmitMessage(const char *buf, unsigned n)
{
if (!opened())
{
return;
}
CANMessage message;
if (n < 4) {
return;
}
message.id = (hex2int(buf[0]) << 8) | (hex2int(buf[1]) << 4) | hex2int(buf[2]);
message.len = hex2int(buf[3]);
buf += 4;
n -= 4;
if (message.len > 8)
{
return;
}
for (unsigned i = 0; i < message.len && n >= 2; i++, buf += 2, n -= 2)
{
message.data[i] = (hex2int(buf[0]) << 4) | hex2int(buf[1]);
}
carloop.can().transmit(message);
}
| {
"pile_set_name": "Github"
} |
config CRYPTO_DEV_NX_ENCRYPT
tristate "Encryption acceleration support on pSeries platform"
depends on PPC_PSERIES && IBMVIO && !CPU_LITTLE_ENDIAN
default y
select CRYPTO_AES
select CRYPTO_CCM
help
Support for PowerPC Nest (NX) encryption acceleration. This
module supports acceleration for AES and SHA2 algorithms on
the pSeries platform. If you choose 'M' here, this module
will be called nx_crypto.
config CRYPTO_DEV_NX_COMPRESS
tristate "Compression acceleration support"
default y
select CRYPTO_ALGAPI
select 842_DECOMPRESS
help
Support for PowerPC Nest (NX) compression acceleration. This
module supports acceleration for compressing memory with the 842
algorithm using the cryptographic API. One of the platform
drivers must be selected also. If you choose 'M' here, this
module will be called nx_compress.
if CRYPTO_DEV_NX_COMPRESS
config CRYPTO_DEV_NX_COMPRESS_PSERIES
tristate "Compression acceleration support on pSeries platform"
depends on PPC_PSERIES && IBMVIO
default y
help
Support for PowerPC Nest (NX) compression acceleration. This
module supports acceleration for compressing memory with the 842
algorithm. This supports NX hardware on the pSeries platform.
If you choose 'M' here, this module will be called nx_compress_pseries.
config CRYPTO_DEV_NX_COMPRESS_POWERNV
tristate "Compression acceleration support on PowerNV platform"
depends on PPC_POWERNV
depends on PPC_VAS
default y
help
Support for PowerPC Nest (NX) compression acceleration. This
module supports acceleration for compressing memory with the 842
algorithm. This supports NX hardware on the PowerNV platform.
If you choose 'M' here, this module will be called nx_compress_powernv.
endif
| {
"pile_set_name": "Github"
} |
// go run mksyscall.go -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build freebsd,arm
package unix
import (
"syscall"
"unsafe"
)
var _ syscall.Errno
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func setgroups(ngid int, gid *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func socket(domain int, typ int, proto int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Shutdown(s int, how int) (err error) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {
r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
var _p0 unsafe.Pointer
if len(mib) > 0 {
_p0 = unsafe.Pointer(&mib[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func utimes(path string, timeval *[2]Timeval) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func futimes(fd int, timeval *[2]Timeval) (err error) {
_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func fcntl(fd int, cmd int, arg int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
val = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Madvise(b []byte, behav int) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mlock(b []byte) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mlockall(flags int) (err error) {
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mprotect(b []byte, prot int) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Msync(b []byte, flags int) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Munlock(b []byte) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Munlockall() (err error) {
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pipe2(p *[2]_C_int, flags int) (err error) {
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getcwd(buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ioctl(fd int, req uint, arg uintptr) (err error) {
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Access(path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func CapEnter() (err error) {
_, _, e1 := Syscall(SYS_CAP_ENTER, 0, 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func capRightsGet(version int, fd int, rightsp *CapRights) (err error) {
_, _, e1 := Syscall(SYS___CAP_RIGHTS_GET, uintptr(version), uintptr(fd), uintptr(unsafe.Pointer(rightsp)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func capRightsLimit(fd int, rightsp *CapRights) (err error) {
_, _, e1 := Syscall(SYS_CAP_RIGHTS_LIMIT, uintptr(fd), uintptr(unsafe.Pointer(rightsp)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Chdir(path string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Chflags(path string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Chmod(path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Chown(path string, uid int, gid int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Chroot(path string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Dup(fd int) (nfd int, err error) {
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
nfd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Dup2(from int, to int) (err error) {
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Exit(code int) {
Syscall(SYS_EXIT, uintptr(code), 0, 0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(attrname)
if err != nil {
return
}
r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(attrname)
if err != nil {
return
}
r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(attrname)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ExtattrListFd(fd int, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {
r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FD, uintptr(fd), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(file)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attrname)
if err != nil {
return
}
r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(file)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attrname)
if err != nil {
return
}
r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(file)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attrname)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(file)
if err != nil {
return
}
r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(link)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attrname)
if err != nil {
return
}
r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(link)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attrname)
if err != nil {
return
}
r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(link)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attrname)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(link)
if err != nil {
return
}
r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
_, _, e1 := Syscall9(SYS_POSIX_FADVISE, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchflags(fd int, flags int) (err error) {
_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fpathconf(fd int, name int) (val int, err error) {
r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
val = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func fstat(fd int, stat *stat_freebsd11_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func fstat_freebsd12(fd int, stat *Stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func fstatat(fd int, path string, stat *stat_freebsd11_t, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func fstatat_freebsd12(fd int, path string, stat *Stat_t, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_FSTATAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func fstatfs(fd int, stat *statfs_freebsd11_t) (err error) {
_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func fstatfs_freebsd12(fd int, stat *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_FSTATFS_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall6(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getdirentries_freebsd12(fd int, buf []byte, basep *uintptr) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES_FREEBSD12, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getdtablesize() (size int) {
r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)
size = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getegid() (egid int) {
r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)
egid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Geteuid() (uid int) {
r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)
uid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getgid() (gid int) {
r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)
gid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpgrp() (pgrp int) {
r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)
pgrp = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpid() (pid int) {
r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
pid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getppid() (ppid int) {
r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)
ppid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpriority(which int, who int) (prio int, err error) {
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
prio = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getsid(pid int) (sid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
sid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Gettimeofday(tv *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getuid() (uid int) {
r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)
uid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Issetugid() (tainted bool) {
r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0)
tainted = bool(r0 != 0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Kill(pid int, signum syscall.Signal) (err error) {
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Kqueue() (fd int, err error) {
r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Lchown(path string, uid int, gid int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Link(path string, link string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(link)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(link)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Listen(s int, backlog int) (err error) {
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func lstat(path string, stat *stat_freebsd11_t) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mkdir(path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mkfifo(path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func mknod(path string, mode uint32, dev int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func mknodat(fd int, path string, mode uint32, dev int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func mknodat_freebsd12(fd int, path string, mode uint32, dev uint64) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_MKNODAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Open(path string, mode int, perm uint32) (fd int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Openat(fdat int, path string, mode int, perm uint32) (fd int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(fdat), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Pathconf(path string, name int) (val int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)
val = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Pread(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), 0, uintptr(offset), uintptr(offset>>32))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Readlink(path string, buf []byte) (n int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 unsafe.Pointer
if len(buf) > 0 {
_p1 = unsafe.Pointer(&buf[0])
} else {
_p1 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 unsafe.Pointer
if len(buf) > 0 {
_p1 = unsafe.Pointer(&buf[0])
} else {
_p1 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Rename(from string, to string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(from)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(to)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Renameat(fromfd int, from string, tofd int, to string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(from)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(to)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Revoke(path string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Rmdir(path string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(whence), 0)
newoffset = int64(int64(r1)<<32 | int64(r0))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) {
_, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setegid(egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Seteuid(euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setgid(gid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setlogin(name string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(name)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setpriority(which int, who int, prio int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setresgid(rgid int, egid int, sgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setresuid(ruid int, euid int, suid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setrlimit(which int, lim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Settimeofday(tp *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setuid(uid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func stat(path string, stat *stat_freebsd11_t) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func statfs(path string, stat *statfs_freebsd11_t) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func statfs_freebsd12(path string, stat *Statfs_t) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_STATFS_FREEBSD12, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Symlink(path string, link string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(link)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(oldpath)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(newpath)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Sync() (err error) {
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Truncate(path string, length int64) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Umask(newmask int) (oldmask int) {
r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)
oldmask = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Undelete(path string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Unlink(path string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Unlinkat(dirfd int, path string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Unmount(path string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func write(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0)
ret = uintptr(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) {
r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)
nfd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
| {
"pile_set_name": "Github"
} |
using System;
using System.Runtime.InteropServices;
namespace CSharpGL
{
[StructLayout(LayoutKind.Sequential)]
internal struct BitmapInfo
{
public Int32 biSize;
public Int32 biWidth;
public Int32 biHeight;
public Int16 biPlanes;
public Int16 biBitCount;
public Int32 biCompression;
public Int32 biSizeImage;
public Int32 biXPelsPerMeter;
public Int32 biYPelsPerMeter;
public Int32 biClrUsed;
public Int32 biClrImportant;
public void Init()
{
biSize = Marshal.SizeOf(this);
}
}
} | {
"pile_set_name": "Github"
} |
package com.tencent.mm.ui;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.os.Looper;
import android.view.MenuItem;
import android.view.MenuItem.OnMenuItemClickListener;
import android.view.View;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.ListView;
import com.tencent.mm.e.b.p;
import com.tencent.mm.model.ah;
import com.tencent.mm.model.ar.a;
import com.tencent.mm.model.i;
import com.tencent.mm.modelmulti.m;
import com.tencent.mm.modelmulti.o;
import com.tencent.mm.pluginsdk.i.a;
import com.tencent.mm.pluginsdk.i.t;
import com.tencent.mm.pluginsdk.i.u;
import com.tencent.mm.pluginsdk.ui.applet.ContactListExpandPreference;
import com.tencent.mm.pluginsdk.ui.applet.ContactListExpandPreference.a;
import com.tencent.mm.pluginsdk.ui.d;
import com.tencent.mm.sdk.platformtools.ac;
import com.tencent.mm.storage.aj;
import com.tencent.mm.storage.ap;
import com.tencent.mm.storage.aq;
import com.tencent.mm.storage.k;
import com.tencent.mm.storage.q;
import com.tencent.mm.ui.base.preference.CheckBoxPreference;
import com.tencent.mm.ui.base.preference.MMPreference;
import com.tencent.mm.ui.base.preference.Preference;
import com.tencent.mm.ui.base.preference.f;
import com.tencent.mm.ui.base.preference.h;
import com.tencent.mm.ui.chatting.gallery.ImageGalleryGridUI;
import com.tencent.mm.ui.contact.e;
import java.util.LinkedList;
import java.util.List;
public class SingleChatInfoUI
extends MMPreference
implements i.t
{
private static boolean cEA = false;
private String ajT;
private SharedPreferences bpi = null;
private k cFh;
private int cXP = -1;
private String cXY = "";
private ContactListExpandPreference cXe;
private CheckBoxPreference cXf;
private CheckBoxPreference cXg;
private boolean cXm;
private d cXt = new d(new AbsListView.OnScrollListener()
{
public final void onScroll(AbsListView paramAnonymousAbsListView, int paramAnonymousInt1, int paramAnonymousInt2, int paramAnonymousInt3) {}
public final void onScrollStateChanged(AbsListView paramAnonymousAbsListView, int paramAnonymousInt) {}
});
boolean cXu = false;
private f ckp;
private ac handler = new ac(Looper.getMainLooper());
private void Pe()
{
if (bpi == null) {
bpi = getSharedPreferences(getPackageName() + "_preferences", 0);
}
cXm = cFh.oU();
if (cXm)
{
rV(0);
if (cXf != null) {
bpi.edit().putBoolean("room_notify_new_msg", true).commit();
}
}
for (;;)
{
ckp.notifyDataSetChanged();
return;
rV(8);
if (cXf != null) {
bpi.edit().putBoolean("room_notify_new_msg", false).commit();
}
}
}
public final int GK()
{
return 2131099711;
}
protected final void Gy()
{
ckp = lla;
Ah(getString(2131234676));
cXe = ((ContactListExpandPreference)ckp.IR("roominfo_contact_anchor"));
cXe.a(ckp, cXe.cgq);
cXe.gM(true).gN(false);
if ((cFh != null) && (cFh.field_deleteFlag == 1)) {
cXe.gM(false);
}
cXf = ((CheckBoxPreference)ckp.IR("room_notify_new_msg"));
cXg = ((CheckBoxPreference)ckp.IR("room_placed_to_the_top"));
if (bpi == null) {
bpi = getSharedPreferences(getPackageName() + "_preferences", 0);
}
if (cFh != null)
{
bpi.edit().putBoolean("room_placed_to_the_top", ah.tE().ru().GU(cFh.field_username)).commit();
cXm = cFh.oU();
bpi.edit().putBoolean("room_notify_new_msg", cXm).commit();
}
for (;;)
{
cXP = ah.tE().rt().HI(ajT);
ckp.notifyDataSetChanged();
if (cXe != null)
{
LinkedList localLinkedList = new LinkedList();
localLinkedList.add(ajT);
cXe.p(ajT, localLinkedList);
eLC.setOnScrollListener(cXt);
cXe.a(cXt);
cXe.a(new ContactListExpandPreference.a()
{
public final void Pl() {}
public final void Pm()
{
if (SingleChatInfoUI.b(SingleChatInfoUI.this) != null) {
SingleChatInfoUI.b(SingleChatInfoUI.this).aWd();
}
}
public final void gA(int paramAnonymousInt)
{
SingleChatInfoUI.c(SingleChatInfoUI.this);
}
public final void gy(int paramAnonymousInt) {}
public final void gz(int paramAnonymousInt)
{
String str = SingleChatInfoUI.b(SingleChatInfoUI.this).qd(paramAnonymousInt);
Object localObject2 = com.tencent.mm.platformtools.s.li(SingleChatInfoUI.b(SingleChatInfoUI.this).qf(paramAnonymousInt));
Object localObject1 = localObject2;
if (com.tencent.mm.platformtools.s.kf((String)localObject2))
{
ap localap = ah.tE().rs().HY(str);
localObject1 = localObject2;
if (localap != null)
{
localObject1 = localObject2;
if (!com.tencent.mm.platformtools.s.kf(field_encryptUsername)) {
localObject1 = field_conRemark;
}
}
}
if (com.tencent.mm.platformtools.s.kf(str)) {
return;
}
localObject2 = new Intent();
((Intent)localObject2).putExtra("Contact_User", str);
((Intent)localObject2).putExtra("Contact_RemarkName", (String)localObject1);
((Intent)localObject2).putExtra("Contact_Nick", com.tencent.mm.platformtools.s.li(SingleChatInfoUI.b(SingleChatInfoUI.this).qe(paramAnonymousInt)));
((Intent)localObject2).putExtra("Contact_RoomMember", true);
localObject1 = ah.tE().rr().GD(str);
if ((localObject1 != null) && ((int)bjS > 0) && (com.tencent.mm.i.a.cy(field_type))) {
e.a((Intent)localObject2, str);
}
((Intent)localObject2).putExtra("Kdel_from", 0);
com.tencent.mm.av.c.a(SingleChatInfoUI.this, "profile", ".ui.ContactInfoUI", (Intent)localObject2, 0);
}
});
}
b(new MenuItem.OnMenuItemClickListener()
{
public final boolean onMenuItemClick(MenuItem paramAnonymousMenuItem)
{
finish();
return true;
}
});
return;
bpi.edit().putBoolean("room_notify_new_msg", false).commit();
cXm = false;
}
}
public final h a(SharedPreferences paramSharedPreferences)
{
return new com.tencent.mm.ui.base.preference.a(this, paramSharedPreferences);
}
public final boolean a(f paramf, Preference paramPreference)
{
boolean bool = true;
paramf = cgq;
if (paramf.equals("room_notify_new_msg")) {
if (!cXm)
{
cXm = bool;
if (!cXm) {
break label134;
}
i.l(cFh);
label42:
cFh = ah.tE().rr().GD(ajT);
if (bpi == null) {
bpi = getSharedPreferences(getPackageName() + "_preferences", 0);
}
bpi.edit().putBoolean("room_notify_new_msg", cXm).commit();
Pe();
}
}
label134:
label253:
do
{
do
{
return false;
bool = false;
break;
i.m(cFh);
break label42;
if (!paramf.equals("room_placed_to_the_top")) {
break label253;
}
paramf = getSharedPreferences(cXY, 0);
} while (cFh == null);
if (ah.tE().ru().GU(cFh.field_username)) {
i.l(cFh.field_username, true);
}
for (;;)
{
paramf.edit().putBoolean("room_placed_to_the_top", ah.tE().ru().GU(cFh.field_username)).commit();
return false;
i.k(cFh.field_username, true);
}
if (paramf.equals("room_chatting_images"))
{
paramf = com.tencent.mm.plugin.report.service.g.gdY;
com.tencent.mm.plugin.report.service.g.b(219L, 12L, 1L, true);
paramf = new Intent();
paramf.setClass(kNN.kOg, ImageGalleryGridUI.class);
paramf.addFlags(67108864);
paramf.putExtra("kintent_intent_source", 1);
paramf.putExtra("kintent_talker", ajT);
paramf.putExtra("kintent_image_count", cXP);
if (cXP > 0) {
paramf.putExtra("kintent_image_index", ah.tE().rt().HH(ajT) - 1);
}
com.tencent.mm.plugin.report.service.g.gdY.h(11627, new Object[] { Integer.valueOf(1) });
startActivity(paramf);
return false;
}
if (paramf.equals("room_set_chatting_background"))
{
paramf = new Intent();
paramf.putExtra("isApplyToAll", false);
paramf.putExtra("username", cFh.field_username);
com.tencent.mm.av.c.a(this, "setting", ".ui.setting.SettingsChattingBackgroundUI", paramf, 2);
return false;
}
if (paramf.equals("room_search_chatting_content"))
{
paramf = new Intent();
paramf.putExtra("detail_username", ajT);
com.tencent.mm.av.c.c(this, "search", ".ui.FTSChattingTalkerUI", paramf);
return false;
}
if (paramf.equals("room_clear_chatting_history"))
{
paramf = getString(2131232841, new Object[] { cFh.pc() });
com.tencent.mm.ui.base.g.a(kNN.kOg, paramf, "", getString(2131230876), getString(2131230873), new DialogInterface.OnClickListener()
{
public final void onClick(DialogInterface paramAnonymousDialogInterface, int paramAnonymousInt)
{
SingleChatInfoUI.d(SingleChatInfoUI.this);
}
}, null, 2131689507);
return false;
}
} while (!paramf.equals("room_expose"));
paramf = new Intent();
paramf.putExtra("k_username", ajT);
paramf.putExtra("showShare", false);
paramf.putExtra("rawUrl", "https://weixin110.qq.com/security/readtemplate?t=weixin_report/w_type&scene=39");
com.tencent.mm.av.c.c(this, "webview", ".ui.tools.WebViewUI", paramf);
return false;
}
protected void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
{
super.onActivityResult(paramInt1, paramInt2, paramIntent);
if (paramInt2 != -1) {}
do
{
return;
switch (paramInt1)
{
default:
return;
}
} while (paramInt2 != -1);
finish();
}
public void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
if (i.a.iUZ != null) {
i.a.iUZ.a(this);
}
ajT = getIntent().getStringExtra("Single_Chat_Talker");
cFh = ah.tE().rr().GD(ajT);
cXY = (getPackageName() + "_preferences");
Gy();
}
public void onDestroy()
{
if (i.a.iUZ != null) {
i.a.iUZ.b(this);
}
super.onDestroy();
}
public void onPause()
{
super.onPause();
}
public void onResume()
{
Pe();
Object localObject;
if (cXe != null)
{
localObject = new LinkedList();
((List)localObject).add(ajT);
cXe.p(ajT, (List)localObject);
}
ckp.notifyDataSetChanged();
super.onResume();
if (!cXu)
{
localObject = getIntent().getStringExtra("need_matte_high_light_item");
if (!com.tencent.mm.platformtools.s.kf((String)localObject))
{
final int i = ckp.IT((String)localObject);
setSelection(i - 3);
new ac().postDelayed(new Runnable()
{
public final void run()
{
View localView = ((com.tencent.mm.ui.base.preference.a)SingleChatInfoUI.a(SingleChatInfoUI.this)).a(i, eLC);
if (localView != null) {
com.tencent.mm.ui.g.a.b(kNN.kOg, localView);
}
}
}, 10L);
}
cXu = true;
}
}
public final void s(String paramString1, String paramString2, String paramString3)
{
if ((paramString1.equals(ajT)) && (cXe != null)) {
cXe.notifyChanged();
}
}
private static final class a
implements DialogInterface.OnCancelListener
{
public final void onCancel(DialogInterface paramDialogInterface)
{
SingleChatInfoUI.bgG();
}
}
}
/* Location:
* Qualified Name: com.tencent.mm.ui.SingleChatInfoUI
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | {
"pile_set_name": "Github"
} |
FILE(GLOB Eigen_SparseCholesky_SRCS "*.h")
INSTALL(FILES
${Eigen_SparseCholesky_SRCS}
DESTINATION ${INCLUDE_INSTALL_DIR}/Eigen/src/SparseCholesky COMPONENT Devel
)
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
use anyhow::{Error, Result};
use edenapi_types::WireHistoryEntry;
use mononoke_types::MPath;
use std::convert::TryFrom;
use types::{Parents, RepoPathBuf as ClientRepoPathBuf};
use crate::blobnode::HgParents;
use crate::nodehash::{HgChangesetId, HgFileNodeId, NULL_HASH};
/// Mercurial revlogs and remotefilelog pack files have different formats of storing parents
/// if a file was copied or moved. This function converts from mercurial revlog format to
/// remotefilelog format
pub fn convert_parents_to_remotefilelog_format<'a>(
parents: &HgParents,
copyfrom: Option<&'a (MPath, HgFileNodeId)>,
) -> (HgFileNodeId, HgFileNodeId, Option<&'a MPath>) {
let (p1, p2) = match parents {
HgParents::None => (NULL_HASH, NULL_HASH),
HgParents::One(p) => (p.clone(), NULL_HASH),
HgParents::Two(p1, p2) => (p1.clone(), p2.clone()),
};
if let Some((ref copied_from, copied_rev)) = copyfrom {
// Mercurial has a complicated copy/renames logic.
// If (path1, filenode1) is copied/renamed from (path2, filenode2),
// filenode1's p1 is set to filenode2, and copy_from path is set to path2
// filenode1's p2 is null for non-merge commits. It might be non-null for merges.
(*copied_rev, HgFileNodeId::new(p1), Some(copied_from))
} else {
(HgFileNodeId::new(p1), HgFileNodeId::new(p2), None)
}
}
/// Represents a file history entry in Mercurial's loose file format.
#[derive(Clone, Eq, PartialEq, Debug)]
pub struct HgFileHistoryEntry {
node: HgFileNodeId,
parents: HgParents,
linknode: HgChangesetId,
copyfrom: Option<(MPath, HgFileNodeId)>,
}
impl HgFileHistoryEntry {
pub fn new(
node: HgFileNodeId,
parents: HgParents,
linknode: HgChangesetId,
copyfrom: Option<(MPath, HgFileNodeId)>,
) -> Self {
Self {
node,
parents,
linknode,
copyfrom,
}
}
pub fn filenode(&self) -> &HgFileNodeId {
&self.node
}
pub fn parents(&self) -> &HgParents {
&self.parents
}
pub fn linknode(&self) -> &HgChangesetId {
&self.linknode
}
pub fn copyfrom(&self) -> &Option<(MPath, HgFileNodeId)> {
&self.copyfrom
}
}
impl TryFrom<HgFileHistoryEntry> for WireHistoryEntry {
type Error = Error;
/// Convert from a representation of a history entry using Mononoke's types to
/// a representation that uses the Mercurial client's types.
fn try_from(entry: HgFileHistoryEntry) -> Result<Self> {
let node = entry.node.into_nodehash().into();
let linknode = entry.linknode.into_nodehash().into();
let (parents, copyfrom) = match entry.copyfrom {
Some((copypath, copyrev)) => {
let copypath = ClientRepoPathBuf::from_utf8(copypath.to_vec())?;
let copyrev = copyrev.into_nodehash().into();
let (p1, _) = Parents::from(entry.parents).into_nodes();
let parents = Parents::new(copyrev, p1);
(parents, Some(copypath))
}
None => (entry.parents.into(), None),
};
Ok(Self {
node,
parents,
linknode,
copyfrom,
})
}
}
| {
"pile_set_name": "Github"
} |
[
{
"type": "mapgen",
"method": "json",
"om_terrain": [ "s_liquor" ],
"weight": 1000,
"object": {
"fill_ter": "t_floor",
"rows": [
" ",
" ",
" --:---------+--:-- ",
" |#..#####....cs..| ",
" |#..##.......c...| ",
" |#..##..##...ccc.| ",
" |#..##..##.......| ",
" |#..##..........&| ",
" |.......#####...&| ",
" |--+-...#####...&| ",
" |S..|...........&| ",
" |U..|.........&&&| ",
" ---------+-------- ",
" _4{{{|K=====<|..L| ",
" __{{{|KK=====+..B| ",
" _____|KKK====|..L| ",
" _____|KKK====|---| ",
" _____|KK====*|{{{_ ",
" _____-^^^^^^--____ ",
" ____________*_____ ",
" __________________ ",
" __________________ ",
" __________________ ",
" __________________ "
],
"terrain": {
" ": [ "t_grass", "t_grass", "t_grass", "t_dirt" ],
"-": "t_wall_g",
".": "t_floor",
":": "t_window",
"_": "t_pavement",
"{": "t_pavement",
"|": "t_wall_g",
"=": "t_thconc_floor",
"K": "t_thconc_floor",
"<": "t_ladder_up",
"^": "t_door_metal_locked",
"*": "t_gates_mech_control",
"4": "t_gutter_downspout",
"+": "t_door_c"
},
"furniture": {
"#": "f_rack",
"&": "f_glass_fridge",
"c": "f_counter",
"s": "f_stool",
"B": "f_bench",
"L": "f_locker",
"S": "f_sink",
"{": "f_dumpster"
},
"place_items": [
{ "item": "alcohol", "x": 4, "y": [ 3, 7 ], "chance": 96, "repeat": [ 1, 6 ] },
{ "item": "alcohol", "x": [ 7, 11 ], "y": 3, "chance": 96, "repeat": [ 1, 6 ] },
{ "item": "alcohol", "x": [ 7, 8 ], "y": [ 4, 7 ], "chance": 96, "repeat": [ 1, 6 ] },
{ "item": "alcohol", "x": [ 11, 15 ], "y": [ 8, 9 ], "chance": 96, "repeat": [ 1, 6 ] },
{ "item": "snacks", "x": [ 11, 12 ], "y": [ 5, 6 ], "chance": 85, "repeat": [ 1, 12 ] },
{ "item": "fridgesnacks", "x": 19, "y": [ 7, 10 ], "chance": 90, "repeat": [ 1, 12 ] },
{ "item": "fridgesnacks", "x": [ 17, 19 ], "y": 11, "chance": 90, "repeat": [ 1, 12 ] },
{ "item": "behindcounter", "x": [ 17, 19 ], "y": [ 3, 4 ], "chance": 80, "repeat": [ 1, 6 ] },
{ "item": "liqstore_brew", "x": 16, "y": [ 3, 5 ], "chance": 70, "repeat": [ 1, 12 ] },
{ "item": "liqstore_brew", "x": [ 17, 18 ], "y": 5, "chance": 70, "repeat": [ 1, 12 ] },
{ "item": "trash", "x": [ 5, 7 ], "y": 14, "chance": 30, "repeat": [ 1, 2 ] },
{ "item": "trash", "x": 18, "y": [ 15, 17 ], "chance": 30, "repeat": [ 1, 2 ] }
],
"items": { "K": { "item": "keg_beer", "chance": 70 }, "L": { "item": "jackets", "chance": 50 } },
"toilets": { "U": { } },
"place_monsters": [ { "monster": "GROUP_ZOMBIE", "x": [ 0, 0 ], "y": [ 23, 23 ], "chance": 2, "repeat": [ 2, 3 ] } ],
"vehicles": { ".": { "vehicle": "shopping_cart", "chance": 1, "status": 1 } }
}
},
{
"type": "mapgen",
"method": "json",
"om_terrain": "s_liquor_roof",
"object": {
"fill_ter": "t_flat_roof",
"rows": [
" ",
" ",
" 222222222222222222 ",
" |................3 ",
" |................3 ",
" |................3 ",
" |................3 ",
" |................3 ",
" |................3 ",
" |................3 ",
" |.&..............3 ",
" |.=..............3 ",
" -5----...........3 ",
" |......>....3 ",
" |...........3 ",
" |...........3 ",
" |.......3---3 ",
" |.......3 ",
" --------3 ",
" ",
" ",
" ",
" ",
" "
],
"terrain": {
".": "t_flat_roof",
" ": "t_open_air",
"2": "t_gutter_north",
"-": "t_gutter_south",
"3": "t_gutter_east",
"|": "t_gutter_west",
">": "t_ladder_down",
"5": "t_gutter_drop"
},
"furniture": { "&": "f_roof_turbine_vent", "=": "f_vent_pipe" },
"place_nested": [
{
"chunks": [
[ "null", 20 ],
[ "roof_2x2_utilities_b", 15 ],
[ "roof_2x2_utilities_c", 5 ],
[ "roof_2x2_utilities_d", 40 ],
[ "roof_2x2_golf", 20 ],
[ "roof_3x3_wine", 10 ]
],
"x": [ 10, 11 ],
"y": 12
},
{
"chunks": [
[ "null", 50 ],
[ "roof_4x4_party", 10 ],
[ "roof_4x4_holdout", 5 ],
[ "roof_4x4_utility", 40 ],
[ "roof_4x4_survivor", 5 ]
],
"x": [ 5, 15 ],
"y": [ 4, 5 ]
}
]
}
}
]
| {
"pile_set_name": "Github"
} |
/*
* Your rights to use code governed by this license http://o-s-a.net/doc/license_simple_engine.pdf
*Ваши права на использования кода регулируются данной лицензией http://o-s-a.net/doc/license_simple_engine.pdf
*/
using System;
using System.Windows;
using System.Windows.Forms;
using OsEngine.Language;
using MessageBox = System.Windows.MessageBox;
using TextBox = System.Windows.Forms.TextBox;
namespace OsEngine.Charts.CandleChart.Indicators
{
/// <summary>
/// Interaction logic for BollingerUi.xaml
/// Логика взаимодействия для BollingerUi.xaml
/// </summary>
public partial class BollingerUi
{
/// <summary>
/// indicator
/// индикатор который мы настраиваем
/// </summary>
private Bollinger _bollinger;
/// <summary>
/// whether indicator settings have been changed
/// изменились ли настройки
/// </summary>
public bool IsChange;
/// <summary>
/// constructor
/// конструктор
/// </summary>
/// <param name="bollinger">configuration indicator/индикатор который мы будем настраивать</param>
public BollingerUi(Bollinger bollinger)
{
InitializeComponent();
_bollinger = bollinger;
TextBoxDeviation.Text = _bollinger.Deviation.ToString();
TextBoxLenght.Text = _bollinger.Lenght.ToString();
HostColorUp.Child = new TextBox();
HostColorUp.Child.BackColor = _bollinger.ColorUp;
HostColorDown.Child = new TextBox();
HostColorDown.Child.BackColor = _bollinger.ColorDown;
CheckBoxPaintOnOff.IsChecked = _bollinger.PaintOn;
ButtonColorUp.Content = OsLocalization.Charts.LabelButtonIndicatorColorUp;
ButtonColorDown.Content = OsLocalization.Charts.LabelButtonIndicatorColorDown;
CheckBoxPaintOnOff.Content = OsLocalization.Charts.LabelPaintIntdicatorIsVisible;
ButtonAccept.Content = OsLocalization.Charts.LabelButtonIndicatorAccept;
LabelIndicatorPeriod.Content = OsLocalization.Charts.LabelIndicatorPeriod;
LabelIndicatorDeviation.Content = OsLocalization.Charts.LabelIndicatorDeviation;
}
/// <summary>
/// accept button
/// кнопка принять
/// </summary>
private void ButtonAccept_Click(object sender, RoutedEventArgs e)
{
try
{
if (Convert.ToInt32(TextBoxLenght.Text) <= 0 ||
Convert.ToDecimal(TextBoxDeviation.Text) <= 0)
{
throw new Exception("error");
}
}
catch (Exception)
{
MessageBox.Show("Процесс сохранения прерван. В одном из полей недопустимые значения");
return;
}
_bollinger.ColorUp = HostColorUp.Child.BackColor;
_bollinger.ColorDown = HostColorDown.Child.BackColor;
_bollinger.Deviation = Convert.ToDecimal(TextBoxDeviation.Text);
_bollinger.Lenght = Convert.ToInt32(TextBoxLenght.Text);
if (CheckBoxPaintOnOff.IsChecked.HasValue)
{
_bollinger.PaintOn = CheckBoxPaintOnOff.IsChecked.Value;
}
_bollinger.Save();
IsChange = true;
Close();
}
/// <summary>
/// top line color button
/// кнопка цвет верхней линии
/// </summary>
private void ButtonColorUp_Click(object sender, RoutedEventArgs e)
{
ColorDialog dialog = new ColorDialog();
dialog.Color = HostColorUp.Child.BackColor;
dialog.ShowDialog();
HostColorUp.Child.BackColor = dialog.Color;
}
/// <summary>
/// bottom line color button
/// кнопка цвет нижней линии
/// </summary>
private void ButtonColorDown_Click(object sender, RoutedEventArgs e)
{
ColorDialog dialog = new ColorDialog();
dialog.Color = HostColorDown.Child.BackColor;
dialog.ShowDialog();
HostColorDown.Child.BackColor = dialog.Color;
}
}
}
| {
"pile_set_name": "Github"
} |
; RUN: opt -S -jump-threading %s | FileCheck %s
; When simplify a branch based on LVI predicates, we should replace the
; comparison itself with a constant (when possible) in case it's otherwise used.
define i32 @test(i32* %p) {
; CHECK-LABEL: @test
; CHECK: icmp eq
; CHECK-NEXT: br i1 %cmp, label %exit2, label %exit1
; CHECK-NOT: icmp ne
entry:
%cmp = icmp eq i32* %p, null
br i1 %cmp, label %is_null, label %not_null
is_null:
%cmp2 = icmp ne i32* %p, null
br i1 %cmp2, label %exit1, label %exit2
not_null:
%cmp3 = icmp ne i32* %p, null
br i1 %cmp3, label %exit1, label %exit2
exit1:
ret i32 0
exit2:
ret i32 1
}
declare void @use(i1)
; It would not be legal to replace %cmp2 (well, in this case it actually is,
; but that's a CSE problem, not a LVI/jump threading problem)
define i32 @test_negative(i32* %p) {
; CHECK-LABEL: @test
; CHECK: icmp ne
; CHECK: icmp eq
; CHECK-NEXT: br i1 %cmp, label %exit2, label %exit1
; CHECK-NOT: icmp ne
entry:
%cmp2 = icmp ne i32* %p, null
call void @use(i1 %cmp2)
%cmp = icmp eq i32* %p, null
br i1 %cmp, label %is_null, label %not_null
is_null:
br i1 %cmp2, label %exit1, label %exit2
not_null:
br i1 %cmp2, label %exit1, label %exit2
exit1:
ret i32 0
exit2:
ret i32 1
}
; In this case, we can remove cmp2 because it's otherwise unused
define i32 @test2(i32* %p) {
; CHECK-LABEL: @test
; CHECK-LABEL: entry:
; CHECK-NEXT: icmp eq
; CHECK-NEXT: br i1 %cmp, label %exit2, label %exit1
; CHECK-NOT: icmp ne
entry:
%cmp2 = icmp ne i32* %p, null
%cmp = icmp eq i32* %p, null
br i1 %cmp, label %is_null, label %not_null
is_null:
br i1 %cmp2, label %exit1, label %exit2
not_null:
br i1 %cmp2, label %exit1, label %exit2
exit1:
ret i32 0
exit2:
ret i32 1
}
| {
"pile_set_name": "Github"
} |
#!/bin/sh
# script for execution of deployed applications
#
# Sets up the MCR environment for the current $ARCH and executes
# the specified command.
#
exe_name=$0
exe_dir=`dirname "$0"`
echo "------------------------------------------"
if [ "x$1" = "x" ]; then
echo Usage:
echo $0 \<deployedMCRroot\> args
else
echo Setting up environment variables
MCRROOT="$1"
echo ---
MCRJRE=${MCRROOT}/sys/java/jre/glnxa64/jre/lib/amd64 ;
export XAPPLRESDIR=${MCRROOT}/X11/app-defaults ;
unset JAVA_TOOL_OPTIONS
export LD_LIBRARY_PATH_MCR_SNAPSHOT="$LD_LIBRARY_PATH"
MCR_LD_LIBRARY_PATH=${MCRROOT}/runtime/glnxa64:${MCRROOT}/bin/glnxa64:${MCRROOT}/sys/os/glnxa64:${MCRJRE}/native_threads:${MCRJRE}/server:${MCRJRE}/client:${MCRJRE}
export LD_LIBRARY_PATH=".:${MCR_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}"
echo LD_LIBRARY_PATH is $LD_LIBRARY_PATH
shift 1
args=
while [ $# -gt 0 ]; do
token=$1
args="${args} ${token}"
shift
done
RANDOMNUMBER=$(od -vAn -N4 -tu4 < /dev/urandom) ;
MCR_CACHE_ROOT=$( echo "/tmp/MCR_${RANDOMNUMBER}/" | tr -d ' ' ) ;
export MCR_CACHE_ROOT;
eval "${exe_dir}/segmentSubjectT2_autoEstimateAlveusML $args"
returnVal=$?
rm -rf $MCR_CACHE_ROOT
fi
exit $returnVal
| {
"pile_set_name": "Github"
} |
import FWCore.ParameterSet.Config as cms
particleFlowDisplacedVertex = cms.EDProducer("PFDisplacedVertexProducer",
vertexCandidatesLabel = cms.InputTag("particleFlowDisplacedVertexCandidate"),
# verbosity
verbose = cms.untracked.bool(False),
# Debug flag
debug = cms.untracked.bool(False),
# maximum transverse distance between two points to be used in Seed
transvSize = cms.double(1.0),
# maximum longitudinal distance between two points to be used in Seed
longSize = cms.double(5),
# minimal radius below which we do not reconstruct interactions
# typically the position of the first Pixel layer or beam pipe
primaryVertexCut = cms.double(1.8),
# radius below which we don't wamt to reconstruct displaced
# vertices
tobCut = cms.double(100),
# z below which we don't want to reconstruct displaced
# vertices
tecCut = cms.double(220),
# the minimal accepted weight for the tracks calculated in the
# adaptive vertex fitter to be associated to the displaced vertex
# this correspond to the sigmacut of 6
minAdaptWeight = cms.double(0.5),
# this flag is designed to reduce the timing of the algorithm in the high pile-up conditions. 2 tracks
# vertices are the most sensitives to the pile-ups.
switchOff2TrackVertex = cms.untracked.bool(True),
# ------------ Paramemeters for the track selection ------------
# Primary vertex information used for dxy calculation
mainVertexLabel = cms.InputTag("offlinePrimaryVertices", ""),
offlineBeamSpotLabel = cms.InputTag("offlineBeamSpot", ""),
# Parameters used to apply cuts
tracksSelectorParameters = cms.PSet(
bSelectTracks = cms.bool(True),
# If a track is high purity it is always kept
quality = cms.string("HighPurity"),
# Following cuts are applyed to non high purity tracks
# nChi2_max and pt_min cuts are applyed to the primary and secondary tracks
nChi2_max = cms.double(5.),
pt_min = cms.double(.2),
# nChi2_min applyed only to primary tracks which may be short
# remove fake pixel triplets
nChi2_min = cms.double(.5),
# Cuts applyed to the secondary tracks long and displaced
dxy_min = cms.double(.2),
nHits_min = cms.int32(6),
nOuterHits_max = cms.int32(9)
),
# ------------ Paramemeters for the vertex identification ------------
vertexIdentifierParameters = cms.PSet(
bIdentifyVertices = cms.bool(True),
# Minimal sum pt of secondary tracks for displaced vertices.
# Below this value we find either loopers splitted in two parts eiter
# fake vertices in forward direction
pt_min = cms.double(0.5),
# Minimal pT and log10(P_primary/P_secondary) for primary track in kinks (Primary+Secondary)
# which are not identifier as K-+ decays
pt_kink_min = cms.double(3.0),
logPrimSec_min = cms.double(0.0),
# maximum absoluta value of eta for loopers
looper_eta_max = cms.double(0.1),
# Masses cuts for selections
# CVmin K0min K0max K-min K-max Ldmin Ldmax Nuclmin_ee
masses = cms.vdouble(0.050, 0.485, 0.515, 0.480, 0.520, 1.107, 1.125, 0.200),
# Angle between the primaryVertex-secondaryVertex direction and secondary tracks direction
# this angle means that the final system shall propagate in the same direction than initial system
# all_max, CV and V0 max
angles = cms.vdouble(15, 15)
),
# Adaptive Vertex Fitter parameters identical to the default ones except sigmacut.
# The default value is sigmacut = 3 too tight for displaced vertices
# see CMS NOTE-2008/033 for more details
avfParameters = cms.PSet(
sigmacut = cms.double(6.),
Tini = cms.double(256.),
ratio = cms.double(0.25)
)
)
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2015, Google Inc, Pubref Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * 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 org.pubref.rules_protobuf.examples.helloworld.client;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import io.grpc.StatusRuntimeException;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.pubref.rules_protobuf.examples.helloworld.GreeterGrpc;
import org.pubref.rules_protobuf.examples.helloworld.HelloRequest;
import org.pubref.rules_protobuf.examples.helloworld.HelloReply;
/**
* A simple client that requests a greeting from the {@link
* HelloWorldServer}.
*/
public class HelloWorldClient {
private static final Logger logger = Logger.getLogger(HelloWorldClient.class.getName());
private final ManagedChannel channel;
private final GreeterGrpc.GreeterBlockingStub blockingStub;
/** Construct client connecting to HelloWorld server at {@code host:port}. */
public HelloWorldClient(String host, int port) {
channel = ManagedChannelBuilder.forAddress(host, port)
.usePlaintext(true)
.build();
blockingStub = GreeterGrpc.newBlockingStub(channel);
}
public void shutdown() throws InterruptedException {
channel.shutdown().awaitTermination(5, TimeUnit.SECONDS);
}
/** Say hello to server. */
public String greet(String name) {
logger.info("Will try to greet " + name + " ...");
HelloRequest request = HelloRequest.newBuilder().setName(name).build();
HelloReply response;
try {
response = blockingStub.sayHello(request);
logger.info("Greeting: " + response.getMessage());
return response.getMessage();
} catch (StatusRuntimeException e) {
String msg = "RPC failed: " + e.getStatus();
logger.log(Level.WARNING, msg);
return msg;
}
}
/**
* Greet server. If provided, the first element of {@code args} is
* the name to use in the greeting.
*/
public static void main(String[] args) throws Exception {
HelloWorldClient client = new HelloWorldClient("localhost", 50051);
try {
/* Access a service running on the local machine on port 50051 */
String user = "world";
if (args.length > 0) {
user = args[0]; /* Use the arg as the name to greet if provided */
}
client.greet(user);
} finally {
client.shutdown();
}
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2019, 2020, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
package com.oracle.coherence.cdi;
import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;
import javax.enterprise.util.Nonbinding;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Tests for the {@link AnnotationInstance} class.
*
* @author Jonathan Knight 2019.10.24
*/
public class AnnotationInstanceTest
{
static Stream<Annotation> getBeanAnnotations()
{
return Stream.of(BeanOne.class.getAnnotations());
}
static Stream<Arguments> getBeanOneBeanTwoAnnotationsPairs()
{
List<Arguments> arguments = new ArrayList<>();
Annotation[] annotations = BeanOne.class.getAnnotations();
for (Annotation annotation : annotations)
{
arguments.add(Arguments.of(annotation, BeanTwo.class.getAnnotation(annotation.annotationType())));
}
return arguments.stream();
}
static Stream<Arguments> getBeanOneBeanThreeAnnotationsPairs()
{
List<Arguments> arguments = new ArrayList<>();
Annotation[] annotations = BeanOne.class.getAnnotations();
for (Annotation annotation : annotations)
{
arguments.add(Arguments.of(annotation, BeanThree.class.getAnnotation(annotation.annotationType())));
}
return arguments.stream();
}
@Test
void shouldBeEqualForSimpleAnnotation()
{
AnnotationInstance one = AnnotationInstance.create(Simple.class.getAnnotation(AnnOne.class));
AnnotationInstance two = AnnotationInstance.create(Simple.class.getAnnotation(AnnOne.class));
assertThat(one.equals(two), is(true));
assertThat(two.equals(one), is(true));
}
@Test
void shouldHaveZeroHashCodeSimpleAnnotation()
{
AnnotationInstance instance = AnnotationInstance.create(Simple.class.getAnnotation(AnnOne.class));
assertThat(instance.hashCode(), is(0));
}
@ParameterizedTest
@MethodSource("getBeanAnnotations")
void shouldBeEqual(Annotation annotation)
{
AnnotationInstance one = AnnotationInstance.create(annotation);
AnnotationInstance two = AnnotationInstance.create(annotation);
assertThat(one.equals(two), is(true));
assertThat(two.equals(one), is(true));
}
@Test
void shouldBNoteEqualIfDifferentAnnotation()
{
AnnotationInstance one = AnnotationInstance.create(BeanOne.class.getAnnotation(AnnString.class));
AnnotationInstance two = AnnotationInstance.create(BeanOne.class.getAnnotation(AnnFloat.class));
assertThat(one.equals(two), is(false));
assertThat(two.equals(one), is(false));
}
@Test
void shouldBNoteEqualToNonAnnotationInstance()
{
AnnotationInstance one = AnnotationInstance.create(BeanOne.class.getAnnotation(AnnString.class));
assertThat(one.equals("foo"), is(false));
}
@Test
void shouldBNoteEqualToNull()
{
AnnotationInstance one = AnnotationInstance.create(BeanOne.class.getAnnotation(AnnString.class));
assertThat(one.equals(null), is(false));
}
@ParameterizedTest
@MethodSource("getBeanAnnotations")
void shouldHaveSameHashCode(Annotation annotation)
{
AnnotationInstance one = AnnotationInstance.create(annotation);
AnnotationInstance two = AnnotationInstance.create(annotation);
assertThat(one.hashCode(), is(two.hashCode()));
}
@ParameterizedTest
@MethodSource("getBeanAnnotations")
void shouldHaveToString(Annotation annotation)
{
AnnotationInstance instance = AnnotationInstance.create(annotation);
assertThat(instance.toString(), is(notNullValue()));
assertThat(instance.toString(), is(not("")));
}
@ParameterizedTest
@MethodSource("getBeanOneBeanTwoAnnotationsPairs")
void shouldNotBeEqual(Annotation annotationOne, Annotation annotationTwo)
{
AnnotationInstance one = AnnotationInstance.create(annotationOne);
AnnotationInstance two = AnnotationInstance.create(annotationTwo);
assertThat(one.equals(two), is(false));
assertThat(two.equals(one), is(false));
}
@ParameterizedTest
@MethodSource("getBeanOneBeanTwoAnnotationsPairs")
void shouldNotHaveSameHashCode(Annotation annotationOne, Annotation annotationTwo)
{
AnnotationInstance one = AnnotationInstance.create(annotationOne);
AnnotationInstance two = AnnotationInstance.create(annotationTwo);
assertThat(one.hashCode(), is(not(two.hashCode())));
}
@ParameterizedTest
@MethodSource("getBeanOneBeanThreeAnnotationsPairs")
void shouldBeEqualIgnoringNonBindingValues(Annotation annotationOne, Annotation annotationTwo)
{
AnnotationInstance one = AnnotationInstance.create(annotationOne);
AnnotationInstance two = AnnotationInstance.create(annotationTwo);
assertThat(one.equals(two), is(true));
assertThat(two.equals(one), is(true));
}
@ParameterizedTest
@MethodSource("getBeanOneBeanThreeAnnotationsPairs")
void shouldHaveSameHashCodeIgnoringNonBindingValues(Annotation annotationOne, Annotation annotationTwo)
{
AnnotationInstance one = AnnotationInstance.create(annotationOne);
AnnotationInstance two = AnnotationInstance.create(annotationTwo);
assertThat(one.hashCode(), is(two.hashCode()));
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnOne
{
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnByteArray
{
byte[] value() default {1, 2, 3};
@Nonbinding byte[] nonBinding() default {1, 2, 3};
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnShortArray
{
short[] value() default {4, 5, 6};
@Nonbinding short[] nonBinding() default {4, 5, 6};
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnIntArray
{
int[] value() default {7, 8, 9};
@Nonbinding int[] nonBinding() default {7, 8, 9};
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnLongArray
{
long[] value() default {10L, 11L, 12L};
@Nonbinding long[] nonBinding() default {10L, 11L, 12L};
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnFloatArray
{
float[] value() default {13.1f, 14.2f, 15.3f};
@Nonbinding float[] nonBinding() default {13.1f, 14.2f, 15.3f};
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnDoubleArray
{
double[] value() default {16.1d, 17.2d, 18.3d};
@Nonbinding double[] nonBinding() default {16.1d, 17.2d, 18.3d};
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnCharArray
{
char[] value() default {'a', 'b', 'c'};
@Nonbinding char[] nonBinding() default {'a', 'b', 'c'};
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnBooleanArray
{
boolean[] value() default {true, false};
@Nonbinding boolean[] nonBinding() default {true, false};
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnStringArray
{
String[] value() default {"one", "two", "three"};
@Nonbinding String[] nonBinding() default {"one", "two", "three"};
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnClassArray
{
Class[] value() default {Integer.class, Byte.class};
@Nonbinding Class[] nonBinding() default {Integer.class, Byte.class};
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnByte
{
byte value() default 1;
@Nonbinding byte nonBinding() default 1;
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnShort
{
short value() default 2;
@Nonbinding short nonBinding() default 2;
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnInt
{
int value() default 3;
@Nonbinding int nonBinding() default 3;
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnLong
{
long value() default 4L;
@Nonbinding long nonBinding() default 4L;
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnFloat
{
float value() default 5.6f;
@Nonbinding float nonBinding() default 5.6f;
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnDouble
{
double value() default 7.8f;
@Nonbinding double nonBinding() default 7.8f;
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnChar
{
char value() default 'z';
@Nonbinding char nonBinding() default 'z';
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnBoolean
{
boolean value() default true;
@Nonbinding boolean nonBinding() default true;
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnString
{
String value() default "foo";
@Nonbinding String nonBinding() default "foo";
}
@Documented
@Retention(RetentionPolicy.RUNTIME)
@interface AnnClass
{
Class value() default String.class;
@Nonbinding Class nonBinding() default String.class;
}
@AnnOne
static class Simple
{
}
@AnnByteArray
@AnnShortArray
@AnnIntArray
@AnnLongArray
@AnnFloatArray
@AnnDoubleArray
@AnnCharArray
@AnnBooleanArray
@AnnStringArray
@AnnClassArray
@AnnByte
@AnnShort
@AnnInt
@AnnLong
@AnnFloat
@AnnDouble
@AnnChar
@AnnBoolean
@AnnString
@AnnClass
static class BeanOne
{
}
@AnnByteArray(value = {101, 102, 103})
@AnnShortArray(value = {104, 105, 106})
@AnnIntArray(value = {107, 108, 109})
@AnnLongArray(value = {110L, 111L, 112L})
@AnnFloatArray(value = {113.1f, 114.2f, 115.3f})
@AnnDoubleArray(value = {116.1d, 117.2d, 118.3d})
@AnnCharArray(value = {'x', 'y', 'z'})
@AnnBooleanArray(value = {false, true})
@AnnStringArray(value = {"three", "four"})
@AnnClassArray(value = {Float.class, Double.class})
@AnnByte(value = 100)
@AnnShort(value = 100)
@AnnInt(value = 300)
@AnnLong(value = 400L)
@AnnFloat(value = 500.1f)
@AnnDouble(value = 600.1d)
@AnnChar(value = 'n')
@AnnBoolean(value = false)
@AnnString(value = "bar")
@AnnClass(value = Boolean.class)
static class BeanTwo
{
}
@AnnByteArray(nonBinding = {101, 102, 103})
@AnnShortArray(nonBinding = {104, 105, 106})
@AnnIntArray(nonBinding = {107, 108, 109})
@AnnLongArray(nonBinding = {110L, 111L, 112L})
@AnnFloatArray(nonBinding = {113.1f, 114.2f, 115.3f})
@AnnDoubleArray(nonBinding = {116.1d, 117.2d, 118.3d})
@AnnCharArray(nonBinding = {'x', 'y', 'z'})
@AnnBooleanArray(nonBinding = {false, true})
@AnnStringArray(nonBinding = {"three", "four"})
@AnnClassArray(nonBinding = {Float.class, Double.class})
@AnnByte(nonBinding = 100)
@AnnShort(nonBinding = 100)
@AnnInt(nonBinding = 300)
@AnnLong(nonBinding = 400L)
@AnnFloat(nonBinding = 500.1f)
@AnnDouble(nonBinding = 600.1d)
@AnnChar(nonBinding = 'n')
@AnnBoolean(nonBinding = false)
@AnnString(nonBinding = "bar")
@AnnClass(nonBinding = Boolean.class)
static class BeanThree
{
}
}
| {
"pile_set_name": "Github"
} |
/*
* xen/arch/arm/platforms/xilinx-zynqmp-eemi.c
*
* Xilinx ZynqMP EEMI API
*
* Copyright (c) 2018 Xilinx Inc.
* Written by Edgar E. Iglesias <edgar.iglesias@xilinx.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms and conditions of the GNU General Public
* License, 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 <asm/regs.h>
#include <xen/sched.h>
#include <asm/smccc.h>
#include <asm/platforms/xilinx-zynqmp-eemi.h>
/*
* EEMI firmware API:
* https://www.xilinx.com/support/documentation/user_guides/ug1200-eemi-api.pdf
*
* IPI firmware API:
* https://github.com/ARM-software/arm-trusted-firmware/blob/master/plat/xilinx/zynqmp/ipi_mailbox_service/ipi_mailbox_svc.h
*
* Power domain node_ids identify the area of effect of the power
* management operations. They are the first parameter passed to power
* management EEMI calls.
*
* Reset IDs identify the area of effect of a reset operation. They are
* the first parameter passed to reset EEMI calls.
*
* For now, let the hardware domain access to all power domain nodes and
* all reset lines. In the future, we'll check for ownership of
* resources by specific virtual machines.
*/
static inline bool domain_has_node_access(struct domain *d, uint32_t nodeid)
{
return is_hardware_domain(d);
}
static inline bool domain_has_reset_access(struct domain *d, uint32_t rst)
{
return is_hardware_domain(d);
}
bool zynqmp_eemi(struct cpu_user_regs *regs)
{
struct arm_smccc_res res;
uint32_t fid = get_user_reg(regs, 0);
uint32_t nodeid = get_user_reg(regs, 1);
unsigned int pm_fn = fid & 0xFFFF;
enum pm_ret_status ret;
switch ( fid )
{
/* Mandatory SMC32 functions. */
case ARM_SMCCC_CALL_COUNT_FID(SIP):
case ARM_SMCCC_CALL_UID_FID(SIP):
case ARM_SMCCC_REVISION_FID(SIP):
goto forward_to_fw;
/*
* We can't allow CPUs to suspend without Xen knowing about it.
* We accept but ignore the request and wait for the guest to issue
* a WFI or PSCI call which Xen will trap and act accordingly upon.
*/
case EEMI_FID(PM_SELF_SUSPEND):
ret = XST_PM_SUCCESS;
goto done;
case EEMI_FID(PM_GET_NODE_STATUS):
/* API for PUs. */
case EEMI_FID(PM_REQ_SUSPEND):
case EEMI_FID(PM_FORCE_POWERDOWN):
case EEMI_FID(PM_ABORT_SUSPEND):
case EEMI_FID(PM_REQ_WAKEUP):
case EEMI_FID(PM_SET_WAKEUP_SOURCE):
/* API for slaves. */
case EEMI_FID(PM_REQ_NODE):
case EEMI_FID(PM_RELEASE_NODE):
case EEMI_FID(PM_SET_REQUIREMENT):
case EEMI_FID(PM_SET_MAX_LATENCY):
if ( !domain_has_node_access(current->domain, nodeid) )
{
gprintk(XENLOG_WARNING,
"zynqmp-pm: fn=%u No access to node %u\n", pm_fn, nodeid);
ret = XST_PM_NO_ACCESS;
goto done;
}
goto forward_to_fw;
case EEMI_FID(PM_RESET_ASSERT):
case EEMI_FID(PM_RESET_GET_STATUS):
if ( !domain_has_reset_access(current->domain, nodeid) )
{
gprintk(XENLOG_WARNING,
"zynqmp-pm: fn=%u No access to reset %u\n", pm_fn, nodeid);
ret = XST_PM_NO_ACCESS;
goto done;
}
goto forward_to_fw;
/* These calls are safe and always allowed. */
case EEMI_FID(PM_GET_TRUSTZONE_VERSION):
case EEMI_FID(PM_GET_API_VERSION):
case EEMI_FID(PM_GET_CHIPID):
goto forward_to_fw;
/* No MMIO access is allowed from non-secure domains */
case EEMI_FID(PM_MMIO_WRITE):
case EEMI_FID(PM_MMIO_READ):
gprintk(XENLOG_WARNING,
"zynqmp-pm: fn=%u No MMIO access to %u\n", pm_fn, nodeid);
ret = XST_PM_NO_ACCESS;
goto done;
/* Exclusive to the hardware domain. */
case EEMI_FID(PM_INIT):
case EEMI_FID(PM_SET_CONFIGURATION):
case EEMI_FID(PM_FPGA_LOAD):
case EEMI_FID(PM_FPGA_GET_STATUS):
case EEMI_FID(PM_SECURE_SHA):
case EEMI_FID(PM_SECURE_RSA):
case EEMI_FID(PM_PINCTRL_SET_FUNCTION):
case EEMI_FID(PM_PINCTRL_REQUEST):
case EEMI_FID(PM_PINCTRL_RELEASE):
case EEMI_FID(PM_PINCTRL_GET_FUNCTION):
case EEMI_FID(PM_PINCTRL_CONFIG_PARAM_GET):
case EEMI_FID(PM_PINCTRL_CONFIG_PARAM_SET):
case EEMI_FID(PM_IOCTL):
case EEMI_FID(PM_QUERY_DATA):
case EEMI_FID(PM_CLOCK_ENABLE):
case EEMI_FID(PM_CLOCK_DISABLE):
case EEMI_FID(PM_CLOCK_GETSTATE):
case EEMI_FID(PM_CLOCK_GETDIVIDER):
case EEMI_FID(PM_CLOCK_SETDIVIDER):
case EEMI_FID(PM_CLOCK_SETRATE):
case EEMI_FID(PM_CLOCK_GETRATE):
case EEMI_FID(PM_CLOCK_SETPARENT):
case EEMI_FID(PM_CLOCK_GETPARENT):
if ( !is_hardware_domain(current->domain) )
{
gprintk(XENLOG_WARNING, "eemi: fn=%u No access", pm_fn);
ret = XST_PM_NO_ACCESS;
goto done;
}
goto forward_to_fw;
/* These calls are never allowed. */
case EEMI_FID(PM_SYSTEM_SHUTDOWN):
ret = XST_PM_NO_ACCESS;
goto done;
case IPI_MAILBOX_FID(IPI_MAILBOX_OPEN):
case IPI_MAILBOX_FID(IPI_MAILBOX_RELEASE):
case IPI_MAILBOX_FID(IPI_MAILBOX_STATUS_ENQUIRY):
case IPI_MAILBOX_FID(IPI_MAILBOX_NOTIFY):
case IPI_MAILBOX_FID(IPI_MAILBOX_ACK):
case IPI_MAILBOX_FID(IPI_MAILBOX_ENABLE_IRQ):
case IPI_MAILBOX_FID(IPI_MAILBOX_DISABLE_IRQ):
if ( !is_hardware_domain(current->domain) )
{
gprintk(XENLOG_WARNING, "IPI mailbox: fn=%u No access", pm_fn);
ret = XST_PM_NO_ACCESS;
goto done;
}
goto forward_to_fw;
default:
gprintk(XENLOG_WARNING, "zynqmp-pm: Unhandled PM Call: %u\n", fid);
return false;
}
forward_to_fw:
/*
* ZynqMP firmware calls (EEMI) take an argument that specifies the
* area of effect of the function called. Specifically, node ids for
* power management functions and reset ids for reset functions.
*
* The code above checks if a virtual machine has access rights over
* the node id, reset id, etc. Now that the check has been done, we
* can forward the whole command to firmware without additional
* parameters checks.
*/
arm_smccc_1_1_smc(get_user_reg(regs, 0),
get_user_reg(regs, 1),
get_user_reg(regs, 2),
get_user_reg(regs, 3),
get_user_reg(regs, 4),
get_user_reg(regs, 5),
get_user_reg(regs, 6),
get_user_reg(regs, 7),
&res);
set_user_reg(regs, 0, res.a0);
set_user_reg(regs, 1, res.a1);
set_user_reg(regs, 2, res.a2);
set_user_reg(regs, 3, res.a3);
return true;
done:
set_user_reg(regs, 0, ret);
return true;
}
/*
* Local variables:
* mode: C
* c-file-style: "BSD"
* c-basic-offset: 4
* indent-tabs-mode: nil
* End:
*/
| {
"pile_set_name": "Github"
} |
## What the example does
The example continually prints illuminance in lux to serial console. An
example:
```
I (43) boot: ESP-IDF v3.2-18-gf1b9e15b-dirty 2nd stage bootloader
I (43) boot: compile time 15:41:21
I (44) qio_mode: Enabling default flash chip QIO
I (52) boot: SPI Speed : 40MHz
I (58) boot: SPI Mode : QIO
I (64) boot: SPI Flash Size : 2MB
I (71) boot: Partition Table:
I (76) boot: ## Label Usage Type ST Offset Length
I (87) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (99) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (110) boot: 2 factory factory app 00 00 00010000 000f0000
I (122) boot: End of partition table
I (128) esp_image: segment 0: paddr=0x00010010 vaddr=0x40210010 size=0x338ac (211116) map
I (203) esp_image: segment 1: paddr=0x000438c4 vaddr=0x3ffe8000 size=0x0051c ( 1308) load
I (204) esp_image: segment 2: paddr=0x00043de8 vaddr=0x3ffe851c size=0x0019c ( 412) load
I (215) esp_image: segment 3: paddr=0x00043f8c vaddr=0x40100000 size=0x05adc ( 23260) load
I (234) boot: Loaded app from partition at offset 0x10000
I (281) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (291) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (481) phy_init: phy ver: 1055_12
I (491) reset_reason: RTC reset 2 wakeup 0 store 0, reason is 2
I (491) gpio: GPIO[4]| InputEn: 0| OutputEn: 1| OpenDrain: 1| Pullup: 0| Pulldown: 0| Intr:0
I (501) gpio: GPIO[5]| InputEn: 0| OutputEn: 1| OpenDrain: 1| Pullup: 0| Pulldown: 0| Intr:0
Found TSL2561 in package T/FN/CL
Lux: 1245
Lux: 1252
Lux: 1250
Lux: 1248
Lux: 1248
Lux: 1247
...
```
## Connecting
| `TSL2561` | `ESP8266` | `ESP32` | `NodeMCU` |
|-----------|-----------|---------|-----------|
| `SCL` | `GPIO5` | `GPIO19`| `D1` |
| `SDA` | `GPIO4` | `GPIO18`| `D2` |
| {
"pile_set_name": "Github"
} |
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2013 Free Software Foundation, Inc.
timestamp='2013-11-29'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
# Originally written by Per Bothner.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
#
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int x;" > $dummy.c ;
for c in cc gcc c89 c99 ; do
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac ; set_cc_for_build= ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case "${UNAME_SYSTEM}" in
Linux|GNU|GNU/*)
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
LIBC=gnu
eval $set_cc_for_build
cat <<-EOF > $dummy.c
#include <features.h>
#if defined(__UCLIBC__)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
#else
LIBC=gnu
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
;;
esac
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE_ARCH}" in
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case "${UNAME_VERSION}" in
Debian*)
release='-gnu'
;;
*)
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
*:SolidBSD:*:*)
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
exit ;;
macppc:MirBSD:*:*)
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
UNAME_MACHINE="alpha" ;;
"EV4.5 (21064)")
UNAME_MACHINE="alpha" ;;
"LCA4 (21066/21068)")
UNAME_MACHINE="alpha" ;;
"EV5 (21164)")
UNAME_MACHINE="alphaev5" ;;
"EV5.6 (21164A)")
UNAME_MACHINE="alphaev56" ;;
"EV5.6 (21164PC)")
UNAME_MACHINE="alphapca56" ;;
"EV5.7 (21164PC)")
UNAME_MACHINE="alphapca57" ;;
"EV6 (21264)")
UNAME_MACHINE="alphaev6" ;;
"EV6.7 (21264A)")
UNAME_MACHINE="alphaev67" ;;
"EV6.8CB (21264C)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8AL (21264B)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8CX (21264D)")
UNAME_MACHINE="alphaev68" ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE="alphaev69" ;;
"EV7 (21364)")
UNAME_MACHINE="alphaev7" ;;
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
exit ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit ;;
*:z/VM:*:*)
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
s390x:SunOS:*:*)
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
echo i386-pc-auroraux${UNAME_RELEASE}
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build
SUN_ARCH="i386"
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH="x86_64"
fi
fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
;;
sun4)
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
exit ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c &&
dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
SYSTEM_NAME=`$dummy $dummyarg` &&
{ echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos${UNAME_RELEASE}
exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <sys/systemcfg.h>
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
then
echo "$SYSTEM_NAME"
else
echo rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit ;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include <stdlib.h>
#include <unistd.h>
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
eval $set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
# generating 64-bit code. GNU and HP use different nomenclature:
#
# $ CC_FOR_BUILD=cc ./config.guess
# => hppa2.0w-hp-hpux11.23
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
HP_ARCH="hppa2.0w"
else
HP_ARCH="hppa64"
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
exit ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <unistd.h>
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
exit ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
exit ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
*:UNICOS/mp:*:*)
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
*:MINGW64*:*)
echo ${UNAME_MACHINE}-pc-mingw64
exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
*:Interix*:*)
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
authenticamd | genuineintel | EM64T)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
echo ia64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
8664:Windows_NT:*)
echo x86_64-pc-mks
exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
exit ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
aarch64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
else
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
cris:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
crisv32:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
frv:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
hexagon:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:Linux:*:*)
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef ${UNAME_MACHINE}
#undef ${UNAME_MACHINE}el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=${UNAME_MACHINE}el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=${UNAME_MACHINE}
#else
CPU=
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
or1k:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
or32:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-${LIBC}
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-${LIBC}
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
*) echo hppa-unknown-linux-${LIBC} ;;
esac
exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-${LIBC}
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-${LIBC}
exit ;;
ppc64le:Linux:*:*)
echo powerpc64le-unknown-linux-${LIBC}
exit ;;
ppcle:Linux:*:*)
echo powerpcle-unknown-linux-${LIBC}
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
tile*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit ;;
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
paragon:*:*:*)
echo i860-intel-osf1
exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
exit ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
echo ${UNAME_MACHINE}-stratus-vos
exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
exit ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
x86_64:Haiku:*:*)
echo x86_64-unknown-haiku
exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
SX-7:SUPER-UX:*:*)
echo sx7-nec-superux${UNAME_RELEASE}
exit ;;
SX-8:SUPER-UX:*:*)
echo sx8-nec-superux${UNAME_RELEASE}
exit ;;
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
eval $set_cc_for_build
if test "$UNAME_PROCESSOR" = unknown ; then
UNAME_PROCESSOR=powerpc
fi
if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
# Avoid executing cc on OS X 10.9, as it ships with a stub
# that puts up a graphical alert prompting to install
# developer tools. Any system running Mac OS X 10.7 or
# later (Darwin 11 and later) is required to have a 64-bit
# processor. This is not true of the ARM version of Darwin
# that Apple uses in portable devices.
UNAME_PROCESSOR=x86_64
fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = "386"; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
esac ;;
*:XENIX:*:SysV)
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
exit ;;
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
esac
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix\n"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
# if !defined (ultrix)
# include <sys/param.h>
# if defined (BSD)
# if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
# else
# if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# endif
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# else
printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
# Convex versions that predate uname can use getsysinfo(1)
if [ -x /usr/convex/getsysinfo ]
then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
exit ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
c34*)
echo c34-convex-bsd
exit ;;
c38*)
echo c38-convex-bsd
exit ;;
c4*)
echo c4-convex-bsd
exit ;;
esac
fi
cat >&2 <<EOF
$0: unable to guess system type
This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = $timestamp
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.