text
stringlengths
2
99.9k
meta
dict
<karteikasten>{ for $book in doc("books.xml")//book for $anzahl in (1 to 2) where $anzahl=count($book/author) return <gruppe anzahl="{$anzahl}">{$book}</gruppe> }</karteikasten>
{ "pile_set_name": "Github" }
// Copyright 2019 The Prometheus 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 tsdb import ( "context" "fmt" "os" "path/filepath" "github.com/go-kit/kit/log" "github.com/prometheus/prometheus/pkg/labels" ) var ErrInvalidTimes = fmt.Errorf("max time is lesser than min time") type MetricSample struct { TimestampMs int64 Value float64 Labels labels.Labels } // CreateHead creates a TSDB writer head to write the sample data to. func CreateHead(samples []*MetricSample, chunkRange int64, chunkDir string, logger log.Logger) (*Head, error) { head, err := NewHead(nil, logger, nil, chunkRange, chunkDir, nil, DefaultStripeSize, nil) if err != nil { return nil, err } app := head.Appender(context.TODO()) for _, sample := range samples { _, err = app.Add(sample.Labels, sample.TimestampMs, sample.Value) if err != nil { return nil, err } } err = app.Commit() if err != nil { return nil, err } return head, nil } // CreateBlock creates a chunkrange block from the samples passed to it, and writes it to disk. func CreateBlock(samples []*MetricSample, dir string, mint, maxt int64, logger log.Logger) (string, error) { chunkRange := maxt - mint if chunkRange == 0 { chunkRange = DefaultBlockDuration } if chunkRange < 0 { return "", ErrInvalidTimes } chunkDir := filepath.Join(dir, "chunks_tmp") defer func() { os.RemoveAll(chunkDir) }() head, err := CreateHead(samples, chunkRange, chunkDir, logger) if err != nil { return "", err } defer head.Close() compactor, err := NewLeveledCompactor(context.Background(), nil, logger, ExponentialBlockRanges(DefaultBlockDuration, 3, 5), nil) if err != nil { return "", err } err = os.MkdirAll(dir, 0777) if err != nil { return "", err } ulid, err := compactor.Write(dir, head, mint, maxt, nil) if err != nil { return "", err } return filepath.Join(dir, ulid.String()), nil }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // #import <SAObjects/SABaseCommand.h> #import <SAObjects/SAServerBoundCommand-Protocol.h> @class NSString, NSURL; @interface SAUIAppPunchOutEvent : SABaseCommand <SAServerBoundCommand> { } + (id)appPunchOutEventWithDictionary:(id)arg1 context:(id)arg2; + (id)appPunchOutEvent; - (BOOL)requiresResponse; @property(copy, nonatomic) NSURL *punchOutUri; @property(copy, nonatomic) NSString *punchOutName; @property(copy, nonatomic) NSString *originalCommandId; @property(copy, nonatomic) NSString *bundleId; @property(copy, nonatomic) NSString *appDisplayName; - (id)encodedClassName; - (id)groupIdentifier; // Remaining properties @property(copy, nonatomic) NSString *aceId; // @dynamic aceId; @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(copy, nonatomic) NSString *refId; // @dynamic refId; @property(readonly) Class superclass; @end
{ "pile_set_name": "Github" }
module.exports = { ROOT : 0, GROUP : 1, POSITION : 2, SET : 3, RANGE : 4, REPETITION : 5, REFERENCE : 6, CHAR : 7, };
{ "pile_set_name": "Github" }
// // ICChatMessageVideoCell.h // XZ_WeChat // // Created by 郭现壮 on 16/3/13. // Copyright © 2016年 gxz All rights reserved. // #import "ICChatMessageBaseCell.h" @interface ICChatMessageVideoCell : ICChatMessageBaseCell - (void)stopVideo; @end
{ "pile_set_name": "Github" }
<html> <head> <link rel="stylesheet" type="text/css" href="asciinema-player.css" /> </head> <body> <asciinema-player src="asciicast.json"></asciinema-player> <script src="asciinema-player.js"></script> </body> </html>
{ "pile_set_name": "Github" }
using System; using SLua; using System.Collections.Generic; [UnityEngine.Scripting.Preserve] public class Lua_UnityEngine_HumanPoseHandler : LuaObject { [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] [UnityEngine.Scripting.Preserve] static public int constructor(IntPtr l) { try { UnityEngine.HumanPoseHandler o; UnityEngine.Avatar a1; checkType(l,2,out a1); UnityEngine.Transform a2; checkType(l,3,out a2); o=new UnityEngine.HumanPoseHandler(a1,a2); pushValue(l,true); pushValue(l,o); return 2; } catch(Exception e) { return error(l,e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] [UnityEngine.Scripting.Preserve] static public int Dispose(IntPtr l) { try { UnityEngine.HumanPoseHandler self=(UnityEngine.HumanPoseHandler)checkSelf(l); self.Dispose(); pushValue(l,true); return 1; } catch(Exception e) { return error(l,e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] [UnityEngine.Scripting.Preserve] static public int GetHumanPose(IntPtr l) { try { UnityEngine.HumanPoseHandler self=(UnityEngine.HumanPoseHandler)checkSelf(l); UnityEngine.HumanPose a1; checkValueType(l,2,out a1); self.GetHumanPose(ref a1); pushValue(l,true); pushValue(l,a1); return 2; } catch(Exception e) { return error(l,e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] [UnityEngine.Scripting.Preserve] static public int SetHumanPose(IntPtr l) { try { UnityEngine.HumanPoseHandler self=(UnityEngine.HumanPoseHandler)checkSelf(l); UnityEngine.HumanPose a1; checkValueType(l,2,out a1); self.SetHumanPose(ref a1); pushValue(l,true); pushValue(l,a1); return 2; } catch(Exception e) { return error(l,e); } } [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))] [UnityEngine.Scripting.Preserve] static public int Dispose_s(IntPtr l) { try { int argc = LuaDLL.lua_gettop(l); pushValue(l,false); LuaDLL.lua_pushstring(l,"No matched override function to call"); return 2; } catch(Exception e) { return error(l,e); } } [UnityEngine.Scripting.Preserve] static public void reg(IntPtr l) { getTypeTable(l,"UnityEngine.HumanPoseHandler"); addMember(l,Dispose); addMember(l,GetHumanPose); addMember(l,SetHumanPose); addMember(l,Dispose_s); createTypeMetatable(l,constructor, typeof(UnityEngine.HumanPoseHandler)); } }
{ "pile_set_name": "Github" }
/* * Default plugin options */ var defaults = { horizontal: false, // horizontal mode layout ? inline: false, //forces to show the colorpicker as an inline element color: false, //forces a color format: false, //forces a format input: 'input', // children input selector container: false, // container selector component: '.add-on, .input-group-addon', // children component selector fallbackColor: false, // fallback color value. null = keeps current color. fallbackFormat: 'hex', // fallback color format hexNumberSignPrefix: true, // put a '#' (number sign) before hex strings sliders: { saturation: { maxLeft: 100, maxTop: 100, callLeft: 'setSaturation', callTop: 'setBrightness' }, hue: { maxLeft: 0, maxTop: 100, callLeft: false, callTop: 'setHue' }, alpha: { maxLeft: 0, maxTop: 100, callLeft: false, callTop: 'setAlpha' } }, slidersHorz: { saturation: { maxLeft: 100, maxTop: 100, callLeft: 'setSaturation', callTop: 'setBrightness' }, hue: { maxLeft: 100, maxTop: 0, callLeft: 'setHue', callTop: false }, alpha: { maxLeft: 100, maxTop: 0, callLeft: 'setAlpha', callTop: false } }, template: '<div class="colorpicker dropdown-menu">' + '<div class="colorpicker-saturation"><i><b></b></i></div>' + '<div class="colorpicker-hue"><i></i></div>' + '<div class="colorpicker-alpha"><i></i></div>' + '<div class="colorpicker-color"><div /></div>' + '<div class="colorpicker-selectors"></div>' + '</div>', align: 'right', customClass: null, // custom class added to the colorpicker element colorSelectors: null // custom color aliases };
{ "pile_set_name": "Github" }
# test default compression stores if smaller; print progress return 0 args -n test.zip print_progress add compressable aaaaaaaaaaaaaa add uncompressable uncompressable add_nul large-compressable 8200 add_file large-uncompressable large-uncompressable 0 -1 file-new test.zip cm-default.zip file large-uncompressable large-uncompressable large-uncompressable stdout 0.0% done stdout 25.0% done stdout 50.0% done stdout 75.0% done stdout 100.0% done
{ "pile_set_name": "Github" }
/* * cocos2d for iPhone: http://www.cocos2d-iphone.org * * Copyright (C) 2010 Lam Pham * Copyright (c) 2013-2014 Cocos2D Authors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ #import "CCActionProgressTimer.h" @implementation CCActionProgressTo +(instancetype) actionWithDuration: (CCTime) t percent: (float) v { return [[ self alloc] initWithDuration: t percent: v]; } -(id) initWithDuration: (CCTime) t percent: (float) v { if( (self=[super initWithDuration: t] ) ) _to = v; return self; } -(id) copyWithZone: (NSZone*) zone { CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:_duration percent:_to]; return copy; } -(void) startWithTarget:(id) aTarget; { [super startWithTarget:aTarget]; _from = [(CCProgressNode*)_target percentage]; // XXX: Is this correct ? // Adding it to support CCRepeat if( _from == 100) _from = 0; } -(void) update: (CCTime) t { [(CCProgressNode*)_target setPercentage: _from + ( _to - _from ) * t]; } @end @implementation CCActionProgressFromTo +(instancetype) actionWithDuration: (CCTime) t from:(float)fromPercentage to:(float) toPercentage { return [[self alloc] initWithDuration: t from: fromPercentage to: toPercentage]; } -(id) initWithDuration: (CCTime) t from:(float)fromPercentage to:(float) toPercentage { if( (self=[super initWithDuration: t] ) ){ _to = toPercentage; _from = fromPercentage; } return self; } -(id) copyWithZone: (NSZone*) zone { CCAction *copy = [[[self class] allocWithZone: zone] initWithDuration:_duration from:_from to:_to]; return copy; } - (CCActionInterval *) reverse { return [[self class] actionWithDuration:_duration from:_to to:_from]; } -(void) startWithTarget:(id) aTarget; { [super startWithTarget:aTarget]; } -(void) update: (CCTime) t { [(CCProgressNode*)_target setPercentage: _from + ( _to - _from ) * t]; } @end
{ "pile_set_name": "Github" }
<html> <!-- 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. --> <!-- $Revision$ $Date$ --> <body> Decimal floating point library for Java <p>Another floating point class. This one is built using radix 10000 which is 10<sup>4</sup>, so its almost decimal.</p> <p>The design goals here are: <ol> <li>Decimal math, or close to it</li> <li>Settable precision (but no mix between numbers using different settings)</li> <li>Portability. Code should be keep as portable as possible.</li> <li>Performance</li> <li>Accuracy - Results should always be +/- 1 ULP for basic algebraic operation</li> <li>Comply with IEEE 854-1987 as much as possible. (See IEEE 854-1987 notes below)</li> </ol></p> <p>Trade offs: <ol> <li>Memory foot print. I'm using more memory than necessary to represent numbers to get better performance.</li> <li>Digits are bigger, so rounding is a greater loss. So, if you really need 12 decimal digits, better use 4 base 10000 digits there can be one partially filled.</li> </ol></p> <p>Numbers are represented in the following form: <pre> n = sign &times; mant &times; (radix)<sup>exp</sup>;</p> </pre> where sign is &plusmn;1, mantissa represents a fractional number between zero and one. mant[0] is the least significant digit. exp is in the range of -32767 to 32768</p> <p>IEEE 854-1987 Notes and differences</p> <p>IEEE 854 requires the radix to be either 2 or 10. The radix here is 10000, so that requirement is not met, but it is possible that a subclassed can be made to make it behave as a radix 10 number. It is my opinion that if it looks and behaves as a radix 10 number then it is one and that requirement would be met.</p> <p>The radix of 10000 was chosen because it should be faster to operate on 4 decimal digits at once instead of one at a time. Radix 10 behavior can be realized by add an additional rounding step to ensure that the number of decimal digits represented is constant.</p> <p>The IEEE standard specifically leaves out internal data encoding, so it is reasonable to conclude that such a subclass of this radix 10000 system is merely an encoding of a radix 10 system.</p> <p>IEEE 854 also specifies the existence of "sub-normal" numbers. This class does not contain any such entities. The most significant radix 10000 digit is always non-zero. Instead, we support "gradual underflow" by raising the underflow flag for numbers less with exponent less than expMin, but don't flush to zero until the exponent reaches MIN_EXP-digits. Thus the smallest number we can represent would be: 1E(-(MIN_EXP-digits-1)*4), eg, for digits=5, MIN_EXP=-32767, that would be 1e-131092.</p> <p>IEEE 854 defines that the implied radix point lies just to the right of the most significant digit and to the left of the remaining digits. This implementation puts the implied radix point to the left of all digits including the most significant one. The most significant digit here is the one just to the right of the radix point. This is a fine detail and is really only a matter of definition. Any side effects of this can be rendered invisible by a subclass.</p> </body> </html>
{ "pile_set_name": "Github" }
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportHeight="24.0" android:viewportWidth="24.0"> <path android:fillColor="#FF000000" android:pathData="M22,16V4c0,-1.1 -0.9,-2 -2,-2H8c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2zm-11,-4l2.03,2.71L16,11l4,5H8l3,-4zM2,6v14c0,1.1 0.9,2 2,2h14v-2H4V6H2z"/> </vector>
{ "pile_set_name": "Github" }
Additional IP Rights Grant (Patents) "This implementation" means the copyrightable works distributed by Google as part of the Go project. Google hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, transfer and otherwise run, modify and propagate the contents of this implementation of Go, where such license applies only to those patent claims, both currently owned or controlled by Google and acquired in the future, licensable by Google that are necessarily infringed by this implementation of Go. This grant does not include claims that would be infringed only as a consequence of further modification of this implementation. If you or your agent or exclusive licensee institute or order or agree to the institution of patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that this implementation of Go or any code incorporated within this implementation of Go constitutes direct or contributory patent infringement, or inducement of patent infringement, then any patent rights granted to you under this License for this implementation of Go shall terminate as of the date such litigation is filed.
{ "pile_set_name": "Github" }
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.model.container; import com.yahoo.config.model.ConfigModel; import com.yahoo.config.model.ConfigModelContext; import com.yahoo.config.model.ConfigModelRepo; import com.yahoo.config.model.deploy.DeployState; import com.yahoo.vespa.model.content.Content; import com.yahoo.vespa.model.search.AbstractSearchCluster; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.TreeMap; /** * A model of a container cluster. * * TODO: Add type parameter for CLUSTER instead of using wildcard '? extends Container' * * @author Tony Vaagenes */ public class ContainerModel extends ConfigModel { // TODO: Move to referer public static final String DOCPROC_RESERVED_NAME = "docproc"; private ContainerCluster<? extends Container> containerCluster; public ContainerModel(ConfigModelContext context) { super(context); } public void setCluster(ContainerCluster<? extends Container> containerCluster) { this.containerCluster = containerCluster; } public ContainerCluster<? extends Container> getCluster() { return containerCluster; } @Override public void prepare(ConfigModelRepo plugins, DeployState deployState) { assert (getCluster() != null) : "Null container cluster!"; getCluster().prepare(deployState); } @Override public void initialize(ConfigModelRepo configModelRepo) { List<AbstractSearchCluster> searchClusters = Content.getSearchClusters(configModelRepo); Map<String, AbstractSearchCluster> searchClustersByName = new TreeMap<>(); for (AbstractSearchCluster c : searchClusters) searchClustersByName.put(c.getClusterName(), c); getCluster().initialize(searchClustersByName); } public static Collection<ContainerCluster> containerClusters(ConfigModelRepo models) { List<ContainerCluster> containerClusters = new ArrayList<>(); for (ContainerModel model: models.getModels(ContainerModel.class)) containerClusters.add(model.getCluster()); return containerClusters; } }
{ "pile_set_name": "Github" }
/* ztbmv.f -- translated by f2c (version 20100827). You must link the resulting object file with libf2c: on Microsoft Windows system, link with libf2c.lib; on Linux or Unix systems, link with .../path/to/libf2c.a -lm or, if you install libf2c.a in a standard place, with -lf2c -lm -- in that order, at the end of the command line, as in cc *.o -lf2c -lm Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., http://www.netlib.org/f2c/libf2c.zip */ #include "datatypes.h" /* Subroutine */ int ztbmv_(char *uplo, char *trans, char *diag, integer *n, integer *k, doublecomplex *a, integer *lda, doublecomplex *x, integer *incx, ftnlen uplo_len, ftnlen trans_len, ftnlen diag_len) { /* System generated locals */ integer a_dim1, a_offset, i__1, i__2, i__3, i__4, i__5; doublecomplex z__1, z__2, z__3; /* Builtin functions */ void d_cnjg(doublecomplex *, doublecomplex *); /* Local variables */ integer i__, j, l, ix, jx, kx, info; doublecomplex temp; extern logical lsame_(char *, char *, ftnlen, ftnlen); integer kplus1; extern /* Subroutine */ int xerbla_(char *, integer *, ftnlen); logical noconj, nounit; /* .. Scalar Arguments .. */ /* .. */ /* .. Array Arguments .. */ /* .. */ /* Purpose */ /* ======= */ /* ZTBMV performs one of the matrix-vector operations */ /* x := A*x, or x := A'*x, or x := conjg( A' )*x, */ /* where x is an n element vector and A is an n by n unit, or non-unit, */ /* upper or lower triangular band matrix, with ( k + 1 ) diagonals. */ /* Arguments */ /* ========== */ /* UPLO - CHARACTER*1. */ /* On entry, UPLO specifies whether the matrix is an upper or */ /* lower triangular matrix as follows: */ /* UPLO = 'U' or 'u' A is an upper triangular matrix. */ /* UPLO = 'L' or 'l' A is a lower triangular matrix. */ /* Unchanged on exit. */ /* TRANS - CHARACTER*1. */ /* On entry, TRANS specifies the operation to be performed as */ /* follows: */ /* TRANS = 'N' or 'n' x := A*x. */ /* TRANS = 'T' or 't' x := A'*x. */ /* TRANS = 'C' or 'c' x := conjg( A' )*x. */ /* Unchanged on exit. */ /* DIAG - CHARACTER*1. */ /* On entry, DIAG specifies whether or not A is unit */ /* triangular as follows: */ /* DIAG = 'U' or 'u' A is assumed to be unit triangular. */ /* DIAG = 'N' or 'n' A is not assumed to be unit */ /* triangular. */ /* Unchanged on exit. */ /* N - INTEGER. */ /* On entry, N specifies the order of the matrix A. */ /* N must be at least zero. */ /* Unchanged on exit. */ /* K - INTEGER. */ /* On entry with UPLO = 'U' or 'u', K specifies the number of */ /* super-diagonals of the matrix A. */ /* On entry with UPLO = 'L' or 'l', K specifies the number of */ /* sub-diagonals of the matrix A. */ /* K must satisfy 0 .le. K. */ /* Unchanged on exit. */ /* A - COMPLEX*16 array of DIMENSION ( LDA, n ). */ /* Before entry with UPLO = 'U' or 'u', the leading ( k + 1 ) */ /* by n part of the array A must contain the upper triangular */ /* band part of the matrix of coefficients, supplied column by */ /* column, with the leading diagonal of the matrix in row */ /* ( k + 1 ) of the array, the first super-diagonal starting at */ /* position 2 in row k, and so on. The top left k by k triangle */ /* of the array A is not referenced. */ /* The following program segment will transfer an upper */ /* triangular band matrix from conventional full matrix storage */ /* to band storage: */ /* DO 20, J = 1, N */ /* M = K + 1 - J */ /* DO 10, I = MAX( 1, J - K ), J */ /* A( M + I, J ) = matrix( I, J ) */ /* 10 CONTINUE */ /* 20 CONTINUE */ /* Before entry with UPLO = 'L' or 'l', the leading ( k + 1 ) */ /* by n part of the array A must contain the lower triangular */ /* band part of the matrix of coefficients, supplied column by */ /* column, with the leading diagonal of the matrix in row 1 of */ /* the array, the first sub-diagonal starting at position 1 in */ /* row 2, and so on. The bottom right k by k triangle of the */ /* array A is not referenced. */ /* The following program segment will transfer a lower */ /* triangular band matrix from conventional full matrix storage */ /* to band storage: */ /* DO 20, J = 1, N */ /* M = 1 - J */ /* DO 10, I = J, MIN( N, J + K ) */ /* A( M + I, J ) = matrix( I, J ) */ /* 10 CONTINUE */ /* 20 CONTINUE */ /* Note that when DIAG = 'U' or 'u' the elements of the array A */ /* corresponding to the diagonal elements of the matrix are not */ /* referenced, but are assumed to be unity. */ /* Unchanged on exit. */ /* LDA - INTEGER. */ /* On entry, LDA specifies the first dimension of A as declared */ /* in the calling (sub) program. LDA must be at least */ /* ( k + 1 ). */ /* Unchanged on exit. */ /* X - COMPLEX*16 array of dimension at least */ /* ( 1 + ( n - 1 )*abs( INCX ) ). */ /* Before entry, the incremented array X must contain the n */ /* element vector x. On exit, X is overwritten with the */ /* tranformed vector x. */ /* INCX - INTEGER. */ /* On entry, INCX specifies the increment for the elements of */ /* X. INCX must not be zero. */ /* Unchanged on exit. */ /* Further Details */ /* =============== */ /* Level 2 Blas routine. */ /* -- Written on 22-October-1986. */ /* Jack Dongarra, Argonne National Lab. */ /* Jeremy Du Croz, Nag Central Office. */ /* Sven Hammarling, Nag Central Office. */ /* Richard Hanson, Sandia National Labs. */ /* ===================================================================== */ /* .. Parameters .. */ /* .. */ /* .. Local Scalars .. */ /* .. */ /* .. External Functions .. */ /* .. */ /* .. External Subroutines .. */ /* .. */ /* .. Intrinsic Functions .. */ /* .. */ /* Test the input parameters. */ /* Parameter adjustments */ a_dim1 = *lda; a_offset = 1 + a_dim1; a -= a_offset; --x; /* Function Body */ info = 0; if (! lsame_(uplo, "U", (ftnlen)1, (ftnlen)1) && ! lsame_(uplo, "L", ( ftnlen)1, (ftnlen)1)) { info = 1; } else if (! lsame_(trans, "N", (ftnlen)1, (ftnlen)1) && ! lsame_(trans, "T", (ftnlen)1, (ftnlen)1) && ! lsame_(trans, "C", (ftnlen)1, ( ftnlen)1)) { info = 2; } else if (! lsame_(diag, "U", (ftnlen)1, (ftnlen)1) && ! lsame_(diag, "N", (ftnlen)1, (ftnlen)1)) { info = 3; } else if (*n < 0) { info = 4; } else if (*k < 0) { info = 5; } else if (*lda < *k + 1) { info = 7; } else if (*incx == 0) { info = 9; } if (info != 0) { xerbla_("ZTBMV ", &info, (ftnlen)6); return 0; } /* Quick return if possible. */ if (*n == 0) { return 0; } noconj = lsame_(trans, "T", (ftnlen)1, (ftnlen)1); nounit = lsame_(diag, "N", (ftnlen)1, (ftnlen)1); /* Set up the start point in X if the increment is not unity. This */ /* will be ( N - 1 )*INCX too small for descending loops. */ if (*incx <= 0) { kx = 1 - (*n - 1) * *incx; } else if (*incx != 1) { kx = 1; } /* Start the operations. In this version the elements of A are */ /* accessed sequentially with one pass through A. */ if (lsame_(trans, "N", (ftnlen)1, (ftnlen)1)) { /* Form x := A*x. */ if (lsame_(uplo, "U", (ftnlen)1, (ftnlen)1)) { kplus1 = *k + 1; if (*incx == 1) { i__1 = *n; for (j = 1; j <= i__1; ++j) { i__2 = j; if (x[i__2].r != 0. || x[i__2].i != 0.) { i__2 = j; temp.r = x[i__2].r, temp.i = x[i__2].i; l = kplus1 - j; /* Computing MAX */ i__2 = 1, i__3 = j - *k; i__4 = j - 1; for (i__ = max(i__2,i__3); i__ <= i__4; ++i__) { i__2 = i__; i__3 = i__; i__5 = l + i__ + j * a_dim1; z__2.r = temp.r * a[i__5].r - temp.i * a[i__5].i, z__2.i = temp.r * a[i__5].i + temp.i * a[ i__5].r; z__1.r = x[i__3].r + z__2.r, z__1.i = x[i__3].i + z__2.i; x[i__2].r = z__1.r, x[i__2].i = z__1.i; /* L10: */ } if (nounit) { i__4 = j; i__2 = j; i__3 = kplus1 + j * a_dim1; z__1.r = x[i__2].r * a[i__3].r - x[i__2].i * a[ i__3].i, z__1.i = x[i__2].r * a[i__3].i + x[i__2].i * a[i__3].r; x[i__4].r = z__1.r, x[i__4].i = z__1.i; } } /* L20: */ } } else { jx = kx; i__1 = *n; for (j = 1; j <= i__1; ++j) { i__4 = jx; if (x[i__4].r != 0. || x[i__4].i != 0.) { i__4 = jx; temp.r = x[i__4].r, temp.i = x[i__4].i; ix = kx; l = kplus1 - j; /* Computing MAX */ i__4 = 1, i__2 = j - *k; i__3 = j - 1; for (i__ = max(i__4,i__2); i__ <= i__3; ++i__) { i__4 = ix; i__2 = ix; i__5 = l + i__ + j * a_dim1; z__2.r = temp.r * a[i__5].r - temp.i * a[i__5].i, z__2.i = temp.r * a[i__5].i + temp.i * a[ i__5].r; z__1.r = x[i__2].r + z__2.r, z__1.i = x[i__2].i + z__2.i; x[i__4].r = z__1.r, x[i__4].i = z__1.i; ix += *incx; /* L30: */ } if (nounit) { i__3 = jx; i__4 = jx; i__2 = kplus1 + j * a_dim1; z__1.r = x[i__4].r * a[i__2].r - x[i__4].i * a[ i__2].i, z__1.i = x[i__4].r * a[i__2].i + x[i__4].i * a[i__2].r; x[i__3].r = z__1.r, x[i__3].i = z__1.i; } } jx += *incx; if (j > *k) { kx += *incx; } /* L40: */ } } } else { if (*incx == 1) { for (j = *n; j >= 1; --j) { i__1 = j; if (x[i__1].r != 0. || x[i__1].i != 0.) { i__1 = j; temp.r = x[i__1].r, temp.i = x[i__1].i; l = 1 - j; /* Computing MIN */ i__1 = *n, i__3 = j + *k; i__4 = j + 1; for (i__ = min(i__1,i__3); i__ >= i__4; --i__) { i__1 = i__; i__3 = i__; i__2 = l + i__ + j * a_dim1; z__2.r = temp.r * a[i__2].r - temp.i * a[i__2].i, z__2.i = temp.r * a[i__2].i + temp.i * a[ i__2].r; z__1.r = x[i__3].r + z__2.r, z__1.i = x[i__3].i + z__2.i; x[i__1].r = z__1.r, x[i__1].i = z__1.i; /* L50: */ } if (nounit) { i__4 = j; i__1 = j; i__3 = j * a_dim1 + 1; z__1.r = x[i__1].r * a[i__3].r - x[i__1].i * a[ i__3].i, z__1.i = x[i__1].r * a[i__3].i + x[i__1].i * a[i__3].r; x[i__4].r = z__1.r, x[i__4].i = z__1.i; } } /* L60: */ } } else { kx += (*n - 1) * *incx; jx = kx; for (j = *n; j >= 1; --j) { i__4 = jx; if (x[i__4].r != 0. || x[i__4].i != 0.) { i__4 = jx; temp.r = x[i__4].r, temp.i = x[i__4].i; ix = kx; l = 1 - j; /* Computing MIN */ i__4 = *n, i__1 = j + *k; i__3 = j + 1; for (i__ = min(i__4,i__1); i__ >= i__3; --i__) { i__4 = ix; i__1 = ix; i__2 = l + i__ + j * a_dim1; z__2.r = temp.r * a[i__2].r - temp.i * a[i__2].i, z__2.i = temp.r * a[i__2].i + temp.i * a[ i__2].r; z__1.r = x[i__1].r + z__2.r, z__1.i = x[i__1].i + z__2.i; x[i__4].r = z__1.r, x[i__4].i = z__1.i; ix -= *incx; /* L70: */ } if (nounit) { i__3 = jx; i__4 = jx; i__1 = j * a_dim1 + 1; z__1.r = x[i__4].r * a[i__1].r - x[i__4].i * a[ i__1].i, z__1.i = x[i__4].r * a[i__1].i + x[i__4].i * a[i__1].r; x[i__3].r = z__1.r, x[i__3].i = z__1.i; } } jx -= *incx; if (*n - j >= *k) { kx -= *incx; } /* L80: */ } } } } else { /* Form x := A'*x or x := conjg( A' )*x. */ if (lsame_(uplo, "U", (ftnlen)1, (ftnlen)1)) { kplus1 = *k + 1; if (*incx == 1) { for (j = *n; j >= 1; --j) { i__3 = j; temp.r = x[i__3].r, temp.i = x[i__3].i; l = kplus1 - j; if (noconj) { if (nounit) { i__3 = kplus1 + j * a_dim1; z__1.r = temp.r * a[i__3].r - temp.i * a[i__3].i, z__1.i = temp.r * a[i__3].i + temp.i * a[ i__3].r; temp.r = z__1.r, temp.i = z__1.i; } /* Computing MAX */ i__4 = 1, i__1 = j - *k; i__3 = max(i__4,i__1); for (i__ = j - 1; i__ >= i__3; --i__) { i__4 = l + i__ + j * a_dim1; i__1 = i__; z__2.r = a[i__4].r * x[i__1].r - a[i__4].i * x[ i__1].i, z__2.i = a[i__4].r * x[i__1].i + a[i__4].i * x[i__1].r; z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i; temp.r = z__1.r, temp.i = z__1.i; /* L90: */ } } else { if (nounit) { d_cnjg(&z__2, &a[kplus1 + j * a_dim1]); z__1.r = temp.r * z__2.r - temp.i * z__2.i, z__1.i = temp.r * z__2.i + temp.i * z__2.r; temp.r = z__1.r, temp.i = z__1.i; } /* Computing MAX */ i__4 = 1, i__1 = j - *k; i__3 = max(i__4,i__1); for (i__ = j - 1; i__ >= i__3; --i__) { d_cnjg(&z__3, &a[l + i__ + j * a_dim1]); i__4 = i__; z__2.r = z__3.r * x[i__4].r - z__3.i * x[i__4].i, z__2.i = z__3.r * x[i__4].i + z__3.i * x[ i__4].r; z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i; temp.r = z__1.r, temp.i = z__1.i; /* L100: */ } } i__3 = j; x[i__3].r = temp.r, x[i__3].i = temp.i; /* L110: */ } } else { kx += (*n - 1) * *incx; jx = kx; for (j = *n; j >= 1; --j) { i__3 = jx; temp.r = x[i__3].r, temp.i = x[i__3].i; kx -= *incx; ix = kx; l = kplus1 - j; if (noconj) { if (nounit) { i__3 = kplus1 + j * a_dim1; z__1.r = temp.r * a[i__3].r - temp.i * a[i__3].i, z__1.i = temp.r * a[i__3].i + temp.i * a[ i__3].r; temp.r = z__1.r, temp.i = z__1.i; } /* Computing MAX */ i__4 = 1, i__1 = j - *k; i__3 = max(i__4,i__1); for (i__ = j - 1; i__ >= i__3; --i__) { i__4 = l + i__ + j * a_dim1; i__1 = ix; z__2.r = a[i__4].r * x[i__1].r - a[i__4].i * x[ i__1].i, z__2.i = a[i__4].r * x[i__1].i + a[i__4].i * x[i__1].r; z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i; temp.r = z__1.r, temp.i = z__1.i; ix -= *incx; /* L120: */ } } else { if (nounit) { d_cnjg(&z__2, &a[kplus1 + j * a_dim1]); z__1.r = temp.r * z__2.r - temp.i * z__2.i, z__1.i = temp.r * z__2.i + temp.i * z__2.r; temp.r = z__1.r, temp.i = z__1.i; } /* Computing MAX */ i__4 = 1, i__1 = j - *k; i__3 = max(i__4,i__1); for (i__ = j - 1; i__ >= i__3; --i__) { d_cnjg(&z__3, &a[l + i__ + j * a_dim1]); i__4 = ix; z__2.r = z__3.r * x[i__4].r - z__3.i * x[i__4].i, z__2.i = z__3.r * x[i__4].i + z__3.i * x[ i__4].r; z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i; temp.r = z__1.r, temp.i = z__1.i; ix -= *incx; /* L130: */ } } i__3 = jx; x[i__3].r = temp.r, x[i__3].i = temp.i; jx -= *incx; /* L140: */ } } } else { if (*incx == 1) { i__3 = *n; for (j = 1; j <= i__3; ++j) { i__4 = j; temp.r = x[i__4].r, temp.i = x[i__4].i; l = 1 - j; if (noconj) { if (nounit) { i__4 = j * a_dim1 + 1; z__1.r = temp.r * a[i__4].r - temp.i * a[i__4].i, z__1.i = temp.r * a[i__4].i + temp.i * a[ i__4].r; temp.r = z__1.r, temp.i = z__1.i; } /* Computing MIN */ i__1 = *n, i__2 = j + *k; i__4 = min(i__1,i__2); for (i__ = j + 1; i__ <= i__4; ++i__) { i__1 = l + i__ + j * a_dim1; i__2 = i__; z__2.r = a[i__1].r * x[i__2].r - a[i__1].i * x[ i__2].i, z__2.i = a[i__1].r * x[i__2].i + a[i__1].i * x[i__2].r; z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i; temp.r = z__1.r, temp.i = z__1.i; /* L150: */ } } else { if (nounit) { d_cnjg(&z__2, &a[j * a_dim1 + 1]); z__1.r = temp.r * z__2.r - temp.i * z__2.i, z__1.i = temp.r * z__2.i + temp.i * z__2.r; temp.r = z__1.r, temp.i = z__1.i; } /* Computing MIN */ i__1 = *n, i__2 = j + *k; i__4 = min(i__1,i__2); for (i__ = j + 1; i__ <= i__4; ++i__) { d_cnjg(&z__3, &a[l + i__ + j * a_dim1]); i__1 = i__; z__2.r = z__3.r * x[i__1].r - z__3.i * x[i__1].i, z__2.i = z__3.r * x[i__1].i + z__3.i * x[ i__1].r; z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i; temp.r = z__1.r, temp.i = z__1.i; /* L160: */ } } i__4 = j; x[i__4].r = temp.r, x[i__4].i = temp.i; /* L170: */ } } else { jx = kx; i__3 = *n; for (j = 1; j <= i__3; ++j) { i__4 = jx; temp.r = x[i__4].r, temp.i = x[i__4].i; kx += *incx; ix = kx; l = 1 - j; if (noconj) { if (nounit) { i__4 = j * a_dim1 + 1; z__1.r = temp.r * a[i__4].r - temp.i * a[i__4].i, z__1.i = temp.r * a[i__4].i + temp.i * a[ i__4].r; temp.r = z__1.r, temp.i = z__1.i; } /* Computing MIN */ i__1 = *n, i__2 = j + *k; i__4 = min(i__1,i__2); for (i__ = j + 1; i__ <= i__4; ++i__) { i__1 = l + i__ + j * a_dim1; i__2 = ix; z__2.r = a[i__1].r * x[i__2].r - a[i__1].i * x[ i__2].i, z__2.i = a[i__1].r * x[i__2].i + a[i__1].i * x[i__2].r; z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i; temp.r = z__1.r, temp.i = z__1.i; ix += *incx; /* L180: */ } } else { if (nounit) { d_cnjg(&z__2, &a[j * a_dim1 + 1]); z__1.r = temp.r * z__2.r - temp.i * z__2.i, z__1.i = temp.r * z__2.i + temp.i * z__2.r; temp.r = z__1.r, temp.i = z__1.i; } /* Computing MIN */ i__1 = *n, i__2 = j + *k; i__4 = min(i__1,i__2); for (i__ = j + 1; i__ <= i__4; ++i__) { d_cnjg(&z__3, &a[l + i__ + j * a_dim1]); i__1 = ix; z__2.r = z__3.r * x[i__1].r - z__3.i * x[i__1].i, z__2.i = z__3.r * x[i__1].i + z__3.i * x[ i__1].r; z__1.r = temp.r + z__2.r, z__1.i = temp.i + z__2.i; temp.r = z__1.r, temp.i = z__1.i; ix += *incx; /* L190: */ } } i__4 = jx; x[i__4].r = temp.r, x[i__4].i = temp.i; jx += *incx; /* L200: */ } } } } return 0; /* End of ZTBMV . */ } /* ztbmv_ */
{ "pile_set_name": "Github" }
/* eslint-disable import/no-extraneous-dependencies */ import fs from 'fs'; import { gzipSync } from 'zlib'; import jsonStableStringify from 'json-stable-stringify'; import gaApi from 'ga-api'; import moment from 'moment'; import random from 'random'; // Custom dimensions, see: https://intoli.com/blog/user-agents/ const customDimensionMap = { 'ga:dimension1': 'appName', 'ga:dimension2': 'connection', 'ga:dimension3': 'cpuClass', 'ga:dimension5': 'oscpu', 'ga:dimension6': 'platform', 'ga:dimension7': 'pluginsLength', 'ga:dimension8': 'vendor', 'ga:dimension9': 'userAgent', }; // And the special timestamp session ID that we'll use for joining data. const sessionIdDimension = 'ga:dimension10'; // Standard dimensions used by Google Analytics. const standardDimensionMap = { 'ga:browserSize': 'browserSize', 'ga:deviceCategory': 'deviceCategory', 'ga:screenResolution': 'screenResolution', }; // These primarily help map missing data to `null`/`undefined` properly. const parseCustomDimension = (value, json = false) => { if (value === 'null') { return null; } if (value === 'undefined') { return undefined; } if (json && value) { try { return parseCustomDimension(JSON.parse(value)); } catch (error) { console.error(`Error parsing "${value}" as JSON.`, error); return null; } } if (typeof value === 'object' && value !== null) { const parsedObject = {}; Object.entries(value).forEach(([key, childValue]) => { parsedObject[key] = parseCustomDimension(childValue); }); return parsedObject; } return value; }; const parseStandardDimension = value => ( value === '(not set)' ? null : value ); const fetchAnalyticsRows = (dimensions, page = 0) => new Promise((resolve, reject) => { // Fetch session data from the last 24-48 hours. const maximumAgeInDays = parseInt(process.env.MAXIMUM_AGE || 1, 10); const endDate = moment().format('YYYY-MM-DD'); const startDate = moment().subtract(maximumAgeInDays, 'days').format('YYYY-MM-DD'); // This is the maximum value allowed by the API. const maxResults = 10000; const startIndex = 1 + (page * maxResults); gaApi({ // Credential details. clientId: 'user-agents-npm-package-update.apps.googleusercontent.com', email: 'user-agents-npm-package-update@user-agents-npm-package.iam.gserviceaccount.com', key: 'google-analytics-credentials.json', ids: 'ga:115995502', // Request details. endDate, dimensions: dimensions.join(','), maxResults, metrics: 'ga:sessions', sort: sessionIdDimension, startDate, startIndex, }, (error, data) => { if (error) { return reject(error); } return resolve(data.rows); }, { cacheDir: '.' }); }); const getRawSessions = async () => { // We can request a maximum of 7 dimensions at once, so we need to break these up into groups // of 6 + 1 (the 1 being the session ID). We can then join these together into higher dimensional // objects based on the common session IDs. const maximumDimensionsPerRequest = 7; const dimensions = Object.keys(customDimensionMap).concat(Object.keys(standardDimensionMap)); const dimensionGroupCount = Math.ceil(dimensions.length / (maximumDimensionsPerRequest - 1)); const dimensionGroups = []; for (let i = 0; i < dimensionGroupCount; i += 1) { const startIndex = (maximumDimensionsPerRequest - 1) * i; const endIndex = (startIndex + maximumDimensionsPerRequest) - 1; dimensionGroups.push([sessionIdDimension].concat(dimensions.slice(startIndex, endIndex))); } // Now we loop through and paginate the results, joining the dimensions by session ID as we go. const sessions = {}; const groupCounts = {}; let page = 0; let newRowCount; do { newRowCount = 0; for (let groupIndex = 0; groupIndex < dimensionGroupCount; groupIndex += 1) { const dimensionGroup = dimensionGroups[groupIndex]; const rows = (await fetchAnalyticsRows(dimensionGroup, page)) || []; newRowCount = Math.max(newRowCount, rows.length); rows.forEach((row) => { const sessionId = row[0]; groupCounts[sessionId] = (groupCounts[sessionId] || 0) + 1; sessions[sessionId] = sessions[sessionId] || {}; // Exclude the session ID (first) and the session count metric (last). row.slice(1, -1).forEach((value, index) => { sessions[sessionId][dimensionGroup[index + 1]] = value; }); }); } // Move on to the next page of requests if necessary. page += 1; } while (newRowCount > 0); // Delete any partial data. Object.keys(sessions).forEach((sessionId) => { if (groupCounts[sessionId] !== dimensionGroupCount) { delete sessions[sessionId]; } }); return sessions; }; const parseSessions = (rawSessions) => { const sessions = {}; Object.entries(rawSessions).forEach(([sessionId, rawSession]) => { const session = { timestamp: parseInt(sessionId.split('-')[0], 10), }; Object.entries(customDimensionMap).forEach(([rawDimension, dimension]) => { const json = dimension === 'connection'; session[dimension] = parseCustomDimension(rawSession[rawDimension], json); if (dimension === 'connection' && session[dimension]) { if (session[dimension].rtt) { session[dimension].rtt = parseInt(session[dimension].rtt, 10); } if (session[dimension].downlink) { session[dimension].downlink = parseFloat(session[dimension].downlink); } if (session[dimension].downlinkMax) { session[dimension].downlinkMax = parseFloat(session[dimension].downlinkMax); } } if (dimension === 'pluginsLength') { session[dimension] = parseInt(session[dimension], 10); } }); Object.entries(standardDimensionMap).forEach(([rawDimension, dimension]) => { const value = parseStandardDimension(rawSession[rawDimension]); if (dimension === 'browserSize' || dimension === 'screenResolution') { let height = null; let width = null; if (/\d+x\d+/.test(value)) { [width, height] = value.split('x').map(pixels => parseInt(pixels, 10)); } const dimensionPrefix = dimension === 'browserSize' ? 'viewport' : 'screen'; session[`${dimensionPrefix}Height`] = height; session[`${dimensionPrefix}Width`] = width; } else { session[dimension] = value; } }); sessions[sessionId] = session; }); return sessions; }; const getUserAgentTable = async () => { // Fetch the sessions and process them into parsed objects. const rawSessions = await getRawSessions(); const sessions = parseSessions(rawSessions); // Calculate the number of unique occurrences of each fingerprint. const uniqueSessions = {}; Object.values(sessions).forEach((session) => { // Exclude headless browser user agents. if (/headless/i.test(session.userAgent)) { return; } const uniqueKey = jsonStableStringify(session); if (!uniqueSessions[uniqueKey]) { uniqueSessions[uniqueKey] = { ...session, weight: 0, }; delete uniqueSessions[uniqueKey].timestamp; } uniqueSessions[uniqueKey].weight += 1; }); // Normalize the weights to 1. let totalWeight = 0; const n = () => random.normal(); Object.values(uniqueSessions).forEach((session) => { // eslint-disable-next-line no-param-reassign session.weight = Array(2 * session.weight).fill().reduce(sum => sum + (n()() ** 2), 0) / 2; totalWeight += session.weight; }); Object.values(uniqueSessions).forEach((session) => { // eslint-disable-next-line no-param-reassign session.weight /= totalWeight; }); // Sort them by descreasing weight. const sessionList = Object.values(uniqueSessions); sessionList.sort((a, b) => b.weight - a.weight); return sessionList; }; if (!module.parent) { const filename = process.argv[2]; if (!filename) { throw new Error('An output filename must be passed as an argument to the command.'); } getUserAgentTable().then(async (userAgents) => { const stringifiedUserAgents = JSON.stringify(userAgents, null, 2); // Compress the content if the extension ends with `.gz`. const content = filename.endsWith('.gz') ? gzipSync(stringifiedUserAgents) : stringifiedUserAgents; fs.writeFileSync(filename, content); }) .catch((error) => { // eslint-disable-next-line no-console console.error(error); process.exit(1); }); } export default getUserAgentTable;
{ "pile_set_name": "Github" }
package k8sraw import "fmt" // ClusterConfig represents Kubernetes cluster configuration specific for K8s raw plugin type ClusterConfig struct { DataNamespace string `yaml:",omitempty"` } func (p *Plugin) parseClusterConfig() error { clusterConfig := &ClusterConfig{} err := p.cluster.ParseConfigInto(clusterConfig) if err != nil { return fmt.Errorf("error while parsing k8s raw specific config of cluster %s: %s", p.cluster.Name, err) } p.dataNamespace = "aptomi" if len(p.config.DataNamespace) > 0 { p.dataNamespace = clusterConfig.DataNamespace } if len(clusterConfig.DataNamespace) > 0 { p.dataNamespace = clusterConfig.DataNamespace } return nil }
{ "pile_set_name": "Github" }
import Vue from 'vue' import App from './index' const app = new Vue(App) app.$mount() export default { config: { // 这儿添加要用的小程序组件 usingComponents: { 'i-cell-group': '../../static/dist/cell-group/index', 'i-cell': '../../static/dist/cell/index', 'i-icon': '../../static/dist/icon/index' } } }
{ "pile_set_name": "Github" }
/* * SonarQube JavaScript Plugin * Copyright (C) 2011-2020 SonarSource SA * mailto:info AT sonarsource DOT com * * This program 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 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import { RuleTester } from 'eslint'; const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 2018, sourceType: 'module' } }); import { rule } from 'rules/file-name-differ-from-class'; ruleTester.run('Class names and file names should match', rule, { valid: [ { code: `class MyClass {} export default MyClass;`, filename: 'MyClass.js', }, { code: `class MyClass {} export default MySuperClass;`, filename: 'my-super-class.js', }, { code: `class MyClass {} export default MyClass;`, filename: 'my_class.js', }, { code: `class MyClass1 {} export default MyClass1;`, filename: 'myclass1.js', }, { code: `function MyFunction() {} export default MyFunction;`, filename: 'MyFunction.js', }, { code: `const myConst = 3.14 export default myConst;`, filename: 'myConst.js', }, { code: `class MyClass {} export default MyClass; export function foo() {}`, filename: 'ok_several_exports.js', }, { code: `export default class {}`, filename: 'ok_anonymous_class.js', }, { code: `export default 42;`, filename: 'ok_anonymous_constant.js', }, { code: `export default function () {}`, filename: 'ok_anonymous_function.js', }, { code: `const pi = 3.14; export default pi * 42;`, filename: 'ok_expression.js', }, { code: `class MyClass {} export default MyClass;`, filename: 'MyClass.dev.js', //ignore postfix }, { code: `const myConst = 3.14; export default myConst;`, filename: 'index.js', //ignore index.js }, { code: `let myConst = 3.14; export default myConst;`, //Not a const filename: 'nok_constant.js', }, { code: `class MyClass {} export default MyClass;`, filename: '\\var\\www\\www.example.com\\MyClass.js', }, { code: `class MyClass {} export default MyClass;`, filename: 'C:/www/JS/src/MyClass.js', }, { code: `const MY_CONST = 3.14; export default MY_CONST;`, filename: 'MY_CONST.js', }, ], invalid: [ { code: `foo(); function myFunc () {} export default myFunc;`, filename: 'nok_function_export.js', errors: [ { message: 'Rename this file to "myFunc"', line: 0, column: 1, }, ], }, { code: `class MyClass {} export default MyClass;`, filename: 'nok_identifier.js', errors: [ { message: 'Rename this file to "MyClass"', }, ], }, { code: `export default class MyClass {}`, filename: 'nok_class_declaration.js', errors: [ { message: 'Rename this file to "MyClass"', }, ], }, { code: `export default function MyFunction() {};`, filename: 'nok_MyFunction.js', errors: [ { message: 'Rename this file to "MyFunction"', }, ], }, { code: `const myConst = 3.14; export default myConst;`, filename: 'nok_constant.js', errors: [ { message: 'Rename this file to "myConst"', }, ], }, { code: `const myConst = 3.14; export default myConst;`, filename: 'no_extension', errors: [ { message: 'Rename this file to "myConst"', }, ], }, ], });
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminCheckConfigurableProductAttributeValueUniquenessTest"> <annotations> <features value="ConfigurableProduct"/> <stories value="Configurable Product"/> <title value="Attribute value validation (check for uniqueness) in configurable products"/> <description value="Attribute value validation (check for uniqueness) in configurable products"/> <severity value="MAJOR"/> <testCaseId value="MC-17450"/> <useCaseId value="MAGETWO-99443"/> <group value="ConfigurableProduct"/> </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> <createData entity="dropdownProductAttribute" stepKey="createProductAttribute"/> </before> <after> <!--Delete created data--> <comment userInput="Delete created data" stepKey="deleteCreatedData"/> <actionGroup ref="DeleteProductUsingProductGridActionGroup" stepKey="deleteConfigurableProductAndOptions"> <argument name="product" value="$$createConfigProduct$$"/> </actionGroup> <waitForPageLoad stepKey="waitForProductIndexPage"/> <actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetProductGridColumnsInitial"/> <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> <deleteData createDataKey="createProductAttribute" stepKey="deleteAttribute"/> <actionGroup ref="AdminLogoutActionGroup" stepKey="logOut"/> <!-- Reindex invalidated indices after product attribute has been created/deleted --> <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> </after> <!--Create configurable product--> <comment userInput="Create configurable product" stepKey="createConfProd"/> <createData entity="ApiCategory" stepKey="createCategory"/> <createData entity="ApiConfigurableProduct" stepKey="createConfigProduct"> <requiredEntity createDataKey="createCategory"/> </createData> <!--Go to created product page--> <comment userInput="Go to created product page" stepKey="goToProdPage"/> <actionGroup ref="AdminProductCatalogPageOpenActionGroup" stepKey="goToProductGrid"/> <actionGroup ref="FilterProductGridByName2ActionGroup" stepKey="filterByName"> <argument name="name" value="$$createConfigProduct.name$$"/> </actionGroup> <actionGroup ref="AdminProductGridSectionClickFirstRowActionGroup" stepKey="clickOnProductName"/> <!--Create configurations for the product--> <comment userInput="Create configurations for the product" stepKey="createConfigurations"/> <conditionalClick selector="{{AdminProductFormConfigurationsSection.sectionHeader}}" dependentSelector="{{AdminProductFormConfigurationsSection.createConfigurations}}" visible="false" stepKey="expandConfigurationsTab1"/> <click selector="{{AdminProductFormConfigurationsSection.createConfigurations}}" stepKey="clickOnCreateConfigurations1"/> <waitForPageLoad stepKey="waitForSelectAttributesPage1"/> <actionGroup ref="SelectCreatedAttributeAndCreateTwoOptionsActionGroup" stepKey="selectCreatedAttributeAndCreateOptions"> <argument name="attribute" value="dropdownProductAttribute"/> <argument name="firstOption" value="productAttributeOption1"/> <argument name="secondOption" value="productAttributeOption1"/> </actionGroup> <!--Check that system does not allow to save 2 options with same name--> <comment userInput="Check that system does not allow to save 2 options with same name" stepKey="checkOptionNameUniqueness"/> <seeElement selector="{{AdminCreateProductConfigurationsPanel.attributeNameWithError}}" stepKey="seeThatOptionWithSameNameIsNotSaved"/> <!--Click next and assert error message--> <comment userInput="Click next and assert error message" stepKey="clickNextAndAssertErrMssg"/> <click selector="{{AdminCreateProductConfigurationsPanel.next}}" stepKey="clickNext"/> <waitForPageLoad time="10" stepKey="waitForPageLoad"/> <grabTextFrom selector="{{AdminCreateProductConfigurationsPanel.attributeNameInTitle}}" stepKey="grabErrMsg"/> <see userInput='The value of attribute "$grabErrMsg" must be unique' stepKey="verifyAttributesValueUniqueness"/> </test> </tests>
{ "pile_set_name": "Github" }
export var defaultCalendar = { sameDay : '[Today at] LT', nextDay : '[Tomorrow at] LT', nextWeek : 'dddd [at] LT', lastDay : '[Yesterday at] LT', lastWeek : '[Last] dddd [at] LT', sameElse : 'L' }; import isFunction from '../utils/is-function'; export function calendar (key, mom, now) { var output = this._calendar[key] || this._calendar['sameElse']; return isFunction(output) ? output.call(mom, now) : output; }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2019, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.ballerinalang.langlib.decimal; import org.ballerinalang.jvm.scheduling.Strand; import org.ballerinalang.jvm.values.ArrayValue; import org.ballerinalang.jvm.values.DecimalValue; import org.ballerinalang.model.types.TypeKind; import org.ballerinalang.natives.annotations.Argument; import org.ballerinalang.natives.annotations.BallerinaFunction; import org.ballerinalang.natives.annotations.ReturnType; import static org.ballerinalang.util.BLangCompilerConstants.DECIMAL_VERSION; /** * Native implementation of lang.decimal:min(decimal, decimal...). * * @since 1.0 */ @BallerinaFunction( orgName = "ballerina", packageName = "lang.decimal", version = DECIMAL_VERSION, functionName = "min", args = {@Argument(name = "n", type = TypeKind.DECIMAL), @Argument(name = "ns", type = TypeKind.ARRAY)}, returnType = {@ReturnType(type = TypeKind.DECIMAL)}, isPublic = true ) public class Min { public static DecimalValue min(Strand strand, DecimalValue n, ArrayValue ns) { DecimalValue min = n; int size = ns.size(); for (int i = 0; i < size; i++) { DecimalValue current = (DecimalValue) ns.getRefValue(i); min = current.value().compareTo(min.value()) <= 0 ? current : min; } return min; } }
{ "pile_set_name": "Github" }
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" @class DYShaderAnalyzer; @interface DYShaderProfiler : NSObject { id <DYShaderProfilerDelegate> _delegate; struct dispatch_queue_s *_queue; DYShaderAnalyzer *_shaderAnalyzer; int _pendingRequestLock; unsigned int _pendingRequest; BOOL _harvestDrawCallFootprint; } + (void)removeTemporaryDirectory; + (id)temporaryDirectory; + (BOOL)isDisassemblerAvailable; + (BOOL)isFramebufferFetchWithEvents:(void *)arg1 type:(unsigned int)arg2; + (BOOL)isRenderBeginWithEvents:(void *)arg1 type:(unsigned int)arg2; + (BOOL)isRenderEndWithEvents:(void *)arg1 type:(unsigned int)arg2; + (id)newShaderProfilerWithDelegate:(id)arg1; + (id)_shaderInfoDictForProgram:(unsigned int)arg1 stages:(unsigned int)arg2 contextStateMirror:(ContextStateMirror_c03a0fb6 *)arg3 archiveModifier:(id)arg4; @property(readonly, nonatomic) id <DYShaderProfilerDelegate> delegate; // @synthesize delegate=_delegate; - (void).cxx_destruct; - (void)_calculateUtilizations:(id)arg1 result:(id)arg2; - (void)_calculateFrameTime:(id)arg1 result:(id)arg2; - (BOOL)isDeviceSupported; - (BOOL)_isAlwaysEnabled; - (id)profileShader:(id)arg1; - (id)_getShaderList; - (void)_initializeShaderAnalyzer; - (int)_getRendererType; - (_Bool)_isSimulator; - (void)dealloc; - (id)initWithDelegate:(id)arg1; - (id)init; @end
{ "pile_set_name": "Github" }
@import "bulma/bulma" @import "fresh/core"
{ "pile_set_name": "Github" }
(module SMA_Standard (layer F.Cu) (tedit 5AC56647) (descr "Diode SMA") (tags "Diode SMA") (attr smd) (fp_text reference D2 (at 0 -2.25) (layer F.SilkS) (effects (font (size 0.8 0.8) (thickness 0.2))) ) (fp_text value "ES1J R2" (at 0 2.5) (layer F.Fab) (effects (font (size 1 1) (thickness 0.15))) ) (fp_line (start -3.75 1.25) (end -2.75 1.25) (layer F.SilkS) (width 0.15)) (fp_line (start -3.75 -1.25) (end -3.75 1.25) (layer F.SilkS) (width 0.15)) (fp_line (start -2.75 -1.25) (end -3.75 -1.25) (layer F.SilkS) (width 0.15)) (fp_circle (center 0 0) (end 0.20066 -0.0508) (layer F.Adhes) (width 0.381)) (fp_line (start -1.75 1.5) (end -1.75 1.25) (layer F.SilkS) (width 0.15)) (fp_line (start 2.25 1.5) (end 2.25 1.25) (layer F.SilkS) (width 0.15)) (fp_line (start 2.25 -1.25) (end 2.25 -1.5) (layer F.SilkS) (width 0.15)) (fp_line (start -2.25 1.5) (end 2.25 1.5) (layer F.SilkS) (width 0.15)) (fp_line (start -2.25 -1.5) (end 2.25 -1.5) (layer F.SilkS) (width 0.15)) (fp_line (start -2.25 1.5) (end -2.25 1.25) (layer F.SilkS) (width 0.15)) (fp_line (start -2.25 -1.25) (end -2.25 -1.5) (layer F.SilkS) (width 0.15)) (fp_line (start -1.75 -1.25) (end -1.75 -1.5) (layer F.SilkS) (width 0.15)) (pad 2 smd roundrect (at 2 0) (size 2.5 1.75) (layers F.Cu F.Paste F.Mask)(roundrect_rratio 0.25) (zone_connect 2)) (pad 1 smd roundrect (at -2 0) (size 2.5 1.75) (layers F.Cu F.Paste F.Mask)(roundrect_rratio 0.25)) (model ${KIPRJMOD}/../lib/stmbl.pretty/sma.wrl (at (xyz 0 0 0)) (scale (xyz 393.7 393.7 393.7)) (rotate (xyz 0 0 0)) ) )
{ "pile_set_name": "Github" }
/* ***** BEGIN LICENSE BLOCK ***** * Distributed under the BSD license: * * Copyright (c) 2012, Ajax.org B.V. * 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 Ajax.org B.V. 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 AJAX.ORG B.V. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * ***** END LICENSE BLOCK ***** */ /* This file was autogenerated from tm bundles\erlang.tmbundle\Syntaxes\Erlang.plist (uuid: ) */ /**************************************************************************************** * IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. * * fileTypes * ****************************************************************************************/ define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; var ErlangHighlightRules = function() { // regexp must not have capturing parentheses. Use (?:) instead. // regexps are ordered -> the first match is used this.$rules = { start: [ { include: '#module-directive' }, { include: '#import-export-directive' }, { include: '#behaviour-directive' }, { include: '#record-directive' }, { include: '#define-directive' }, { include: '#macro-directive' }, { include: '#directive' }, { include: '#function' }, { include: '#everything-else' } ], '#atom': [ { token: 'punctuation.definition.symbol.begin.erlang', regex: '\'', push: [ { token: 'punctuation.definition.symbol.end.erlang', regex: '\'', next: 'pop' }, { token: [ 'punctuation.definition.escape.erlang', 'constant.other.symbol.escape.erlang', 'punctuation.definition.escape.erlang', 'constant.other.symbol.escape.erlang', 'constant.other.symbol.escape.erlang' ], regex: '(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' }, { token: 'invalid.illegal.atom.erlang', regex: '\\\\\\^?.?' }, { defaultToken: 'constant.other.symbol.quoted.single.erlang' } ] }, { token: 'constant.other.symbol.unquoted.erlang', regex: '[a-z][a-zA-Z\\d@_]*' } ], '#behaviour-directive': [ { token: [ 'meta.directive.behaviour.erlang', 'punctuation.section.directive.begin.erlang', 'meta.directive.behaviour.erlang', 'keyword.control.directive.behaviour.erlang', 'meta.directive.behaviour.erlang', 'punctuation.definition.parameters.begin.erlang', 'meta.directive.behaviour.erlang', 'entity.name.type.class.behaviour.definition.erlang', 'meta.directive.behaviour.erlang', 'punctuation.definition.parameters.end.erlang', 'meta.directive.behaviour.erlang', 'punctuation.section.directive.end.erlang' ], regex: '^(\\s*)(-)(\\s*)(behaviour)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\))(\\s*)(\\.)' } ], '#binary': [ { token: 'punctuation.definition.binary.begin.erlang', regex: '<<', push: [ { token: 'punctuation.definition.binary.end.erlang', regex: '>>', next: 'pop' }, { token: [ 'punctuation.separator.binary.erlang', 'punctuation.separator.value-size.erlang' ], regex: '(,)|(:)' }, { include: '#internal-type-specifiers' }, { include: '#everything-else' }, { defaultToken: 'meta.structure.binary.erlang' } ] } ], '#character': [ { token: [ 'punctuation.definition.character.erlang', 'punctuation.definition.escape.erlang', 'constant.character.escape.erlang', 'punctuation.definition.escape.erlang', 'constant.character.escape.erlang', 'constant.character.escape.erlang' ], regex: '(\\$)(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' }, { token: 'invalid.illegal.character.erlang', regex: '\\$\\\\\\^?.?' }, { token: [ 'punctuation.definition.character.erlang', 'constant.character.erlang' ], regex: '(\\$)(\\S)' }, { token: 'invalid.illegal.character.erlang', regex: '\\$.?' } ], '#comment': [ { token: 'punctuation.definition.comment.erlang', regex: '%.*$', push_: [ { token: 'comment.line.percentage.erlang', regex: '$', next: 'pop' }, { defaultToken: 'comment.line.percentage.erlang' } ] } ], '#define-directive': [ { token: [ 'meta.directive.define.erlang', 'punctuation.section.directive.begin.erlang', 'meta.directive.define.erlang', 'keyword.control.directive.define.erlang', 'meta.directive.define.erlang', 'punctuation.definition.parameters.begin.erlang', 'meta.directive.define.erlang', 'entity.name.function.macro.definition.erlang', 'meta.directive.define.erlang', 'punctuation.separator.parameters.erlang' ], regex: '^(\\s*)(-)(\\s*)(define)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(,)', push: [ { token: [ 'punctuation.definition.parameters.end.erlang', 'meta.directive.define.erlang', 'punctuation.section.directive.end.erlang' ], regex: '(\\))(\\s*)(\\.)', next: 'pop' }, { include: '#everything-else' }, { defaultToken: 'meta.directive.define.erlang' } ] }, { token: 'meta.directive.define.erlang', regex: '(?=^\\s*-\\s*define\\s*\\(\\s*[a-zA-Z\\d@_]+\\s*\\()', push: [ { token: [ 'punctuation.definition.parameters.end.erlang', 'meta.directive.define.erlang', 'punctuation.section.directive.end.erlang' ], regex: '(\\))(\\s*)(\\.)', next: 'pop' }, { token: [ 'text', 'punctuation.section.directive.begin.erlang', 'text', 'keyword.control.directive.define.erlang', 'text', 'punctuation.definition.parameters.begin.erlang', 'text', 'entity.name.function.macro.definition.erlang', 'text', 'punctuation.definition.parameters.begin.erlang' ], regex: '^(\\s*)(-)(\\s*)(define)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(\\()', push: [ { token: [ 'punctuation.definition.parameters.end.erlang', 'text', 'punctuation.separator.parameters.erlang' ], regex: '(\\))(\\s*)(,)', next: 'pop' }, { token: 'punctuation.separator.parameters.erlang', regex: ',' }, { include: '#everything-else' } ] }, { token: 'punctuation.separator.define.erlang', regex: '\\|\\||\\||:|;|,|\\.|->' }, { include: '#everything-else' }, { defaultToken: 'meta.directive.define.erlang' } ] } ], '#directive': [ { token: [ 'meta.directive.erlang', 'punctuation.section.directive.begin.erlang', 'meta.directive.erlang', 'keyword.control.directive.erlang', 'meta.directive.erlang', 'punctuation.definition.parameters.begin.erlang' ], regex: '^(\\s*)(-)(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\(?)', push: [ { token: [ 'punctuation.definition.parameters.end.erlang', 'meta.directive.erlang', 'punctuation.section.directive.end.erlang' ], regex: '(\\)?)(\\s*)(\\.)', next: 'pop' }, { include: '#everything-else' }, { defaultToken: 'meta.directive.erlang' } ] }, { token: [ 'meta.directive.erlang', 'punctuation.section.directive.begin.erlang', 'meta.directive.erlang', 'keyword.control.directive.erlang', 'meta.directive.erlang', 'punctuation.section.directive.end.erlang' ], regex: '^(\\s*)(-)(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\.)' } ], '#everything-else': [ { include: '#comment' }, { include: '#record-usage' }, { include: '#macro-usage' }, { include: '#expression' }, { include: '#keyword' }, { include: '#textual-operator' }, { include: '#function-call' }, { include: '#tuple' }, { include: '#list' }, { include: '#binary' }, { include: '#parenthesized-expression' }, { include: '#character' }, { include: '#number' }, { include: '#atom' }, { include: '#string' }, { include: '#symbolic-operator' }, { include: '#variable' } ], '#expression': [ { token: 'keyword.control.if.erlang', regex: '\\bif\\b', push: [ { token: 'keyword.control.end.erlang', regex: '\\bend\\b', next: 'pop' }, { include: '#internal-expression-punctuation' }, { include: '#everything-else' }, { defaultToken: 'meta.expression.if.erlang' } ] }, { token: 'keyword.control.case.erlang', regex: '\\bcase\\b', push: [ { token: 'keyword.control.end.erlang', regex: '\\bend\\b', next: 'pop' }, { include: '#internal-expression-punctuation' }, { include: '#everything-else' }, { defaultToken: 'meta.expression.case.erlang' } ] }, { token: 'keyword.control.receive.erlang', regex: '\\breceive\\b', push: [ { token: 'keyword.control.end.erlang', regex: '\\bend\\b', next: 'pop' }, { include: '#internal-expression-punctuation' }, { include: '#everything-else' }, { defaultToken: 'meta.expression.receive.erlang' } ] }, { token: [ 'keyword.control.fun.erlang', 'text', 'entity.name.type.class.module.erlang', 'text', 'punctuation.separator.module-function.erlang', 'text', 'entity.name.function.erlang', 'text', 'punctuation.separator.function-arity.erlang' ], regex: '\\b(fun)(\\s*)(?:([a-z][a-zA-Z\\d@_]*)(\\s*)(:)(\\s*))?([a-z][a-zA-Z\\d@_]*)(\\s*)(/)' }, { token: 'keyword.control.fun.erlang', regex: '\\bfun\\b', push: [ { token: 'keyword.control.end.erlang', regex: '\\bend\\b', next: 'pop' }, { token: 'text', regex: '(?=\\()', push: [ { token: 'punctuation.separator.clauses.erlang', regex: ';|(?=\\bend\\b)', next: 'pop' }, { include: '#internal-function-parts' } ] }, { include: '#everything-else' }, { defaultToken: 'meta.expression.fun.erlang' } ] }, { token: 'keyword.control.try.erlang', regex: '\\btry\\b', push: [ { token: 'keyword.control.end.erlang', regex: '\\bend\\b', next: 'pop' }, { include: '#internal-expression-punctuation' }, { include: '#everything-else' }, { defaultToken: 'meta.expression.try.erlang' } ] }, { token: 'keyword.control.begin.erlang', regex: '\\bbegin\\b', push: [ { token: 'keyword.control.end.erlang', regex: '\\bend\\b', next: 'pop' }, { include: '#internal-expression-punctuation' }, { include: '#everything-else' }, { defaultToken: 'meta.expression.begin.erlang' } ] }, { token: 'keyword.control.query.erlang', regex: '\\bquery\\b', push: [ { token: 'keyword.control.end.erlang', regex: '\\bend\\b', next: 'pop' }, { include: '#everything-else' }, { defaultToken: 'meta.expression.query.erlang' } ] } ], '#function': [ { token: [ 'meta.function.erlang', 'entity.name.function.definition.erlang', 'meta.function.erlang' ], regex: '^(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(?=\\()', push: [ { token: 'punctuation.terminator.function.erlang', regex: '\\.', next: 'pop' }, { token: [ 'text', 'entity.name.function.erlang', 'text' ], regex: '^(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(?=\\()' }, { token: 'text', regex: '(?=\\()', push: [ { token: 'punctuation.separator.clauses.erlang', regex: ';|(?=\\.)', next: 'pop' }, { include: '#parenthesized-expression' }, { include: '#internal-function-parts' } ] }, { include: '#everything-else' }, { defaultToken: 'meta.function.erlang' } ] } ], '#function-call': [ { token: 'meta.function-call.erlang', regex: '(?=(?:[a-z][a-zA-Z\\d@_]*|\'[^\']*\')\\s*(?:\\(|:\\s*(?:[a-z][a-zA-Z\\d@_]*|\'[^\']*\')\\s*\\())', push: [ { token: 'punctuation.definition.parameters.end.erlang', regex: '\\)', next: 'pop' }, { token: [ 'entity.name.type.class.module.erlang', 'text', 'punctuation.separator.module-function.erlang', 'text', 'entity.name.function.guard.erlang', 'text', 'punctuation.definition.parameters.begin.erlang' ], regex: '(?:(erlang)(\\s*)(:)(\\s*))?(is_atom|is_binary|is_constant|is_float|is_function|is_integer|is_list|is_number|is_pid|is_port|is_reference|is_tuple|is_record|abs|element|hd|length|node|round|self|size|tl|trunc)(\\s*)(\\()', push: [ { token: 'text', regex: '(?=\\))', next: 'pop' }, { token: 'punctuation.separator.parameters.erlang', regex: ',' }, { include: '#everything-else' } ] }, { token: [ 'entity.name.type.class.module.erlang', 'text', 'punctuation.separator.module-function.erlang', 'text', 'entity.name.function.erlang', 'text', 'punctuation.definition.parameters.begin.erlang' ], regex: '(?:([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(:)(\\s*))?([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(\\()', push: [ { token: 'text', regex: '(?=\\))', next: 'pop' }, { token: 'punctuation.separator.parameters.erlang', regex: ',' }, { include: '#everything-else' } ] }, { defaultToken: 'meta.function-call.erlang' } ] } ], '#import-export-directive': [ { token: [ 'meta.directive.import.erlang', 'punctuation.section.directive.begin.erlang', 'meta.directive.import.erlang', 'keyword.control.directive.import.erlang', 'meta.directive.import.erlang', 'punctuation.definition.parameters.begin.erlang', 'meta.directive.import.erlang', 'entity.name.type.class.module.erlang', 'meta.directive.import.erlang', 'punctuation.separator.parameters.erlang' ], regex: '^(\\s*)(-)(\\s*)(import)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(,)', push: [ { token: [ 'punctuation.definition.parameters.end.erlang', 'meta.directive.import.erlang', 'punctuation.section.directive.end.erlang' ], regex: '(\\))(\\s*)(\\.)', next: 'pop' }, { include: '#internal-function-list' }, { defaultToken: 'meta.directive.import.erlang' } ] }, { token: [ 'meta.directive.export.erlang', 'punctuation.section.directive.begin.erlang', 'meta.directive.export.erlang', 'keyword.control.directive.export.erlang', 'meta.directive.export.erlang', 'punctuation.definition.parameters.begin.erlang' ], regex: '^(\\s*)(-)(\\s*)(export)(\\s*)(\\()', push: [ { token: [ 'punctuation.definition.parameters.end.erlang', 'meta.directive.export.erlang', 'punctuation.section.directive.end.erlang' ], regex: '(\\))(\\s*)(\\.)', next: 'pop' }, { include: '#internal-function-list' }, { defaultToken: 'meta.directive.export.erlang' } ] } ], '#internal-expression-punctuation': [ { token: [ 'punctuation.separator.clause-head-body.erlang', 'punctuation.separator.clauses.erlang', 'punctuation.separator.expressions.erlang' ], regex: '(->)|(;)|(,)' } ], '#internal-function-list': [ { token: 'punctuation.definition.list.begin.erlang', regex: '\\[', push: [ { token: 'punctuation.definition.list.end.erlang', regex: '\\]', next: 'pop' }, { token: [ 'entity.name.function.erlang', 'text', 'punctuation.separator.function-arity.erlang' ], regex: '([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(/)', push: [ { token: 'punctuation.separator.list.erlang', regex: ',|(?=\\])', next: 'pop' }, { include: '#everything-else' } ] }, { include: '#everything-else' }, { defaultToken: 'meta.structure.list.function.erlang' } ] } ], '#internal-function-parts': [ { token: 'text', regex: '(?=\\()', push: [ { token: 'punctuation.separator.clause-head-body.erlang', regex: '->', next: 'pop' }, { token: 'punctuation.definition.parameters.begin.erlang', regex: '\\(', push: [ { token: 'punctuation.definition.parameters.end.erlang', regex: '\\)', next: 'pop' }, { token: 'punctuation.separator.parameters.erlang', regex: ',' }, { include: '#everything-else' } ] }, { token: 'punctuation.separator.guards.erlang', regex: ',|;' }, { include: '#everything-else' } ] }, { token: 'punctuation.separator.expressions.erlang', regex: ',' }, { include: '#everything-else' } ], '#internal-record-body': [ { token: 'punctuation.definition.class.record.begin.erlang', regex: '\\{', push: [ { token: 'meta.structure.record.erlang', regex: '(?=\\})', next: 'pop' }, { token: [ 'variable.other.field.erlang', 'variable.language.omitted.field.erlang', 'text', 'keyword.operator.assignment.erlang' ], regex: '(?:([a-z][a-zA-Z\\d@_]*|\'[^\']*\')|(_))(\\s*)(=|::)', push: [ { token: 'punctuation.separator.class.record.erlang', regex: ',|(?=\\})', next: 'pop' }, { include: '#everything-else' } ] }, { token: [ 'variable.other.field.erlang', 'text', 'punctuation.separator.class.record.erlang' ], regex: '([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)((?:,)?)' }, { include: '#everything-else' }, { defaultToken: 'meta.structure.record.erlang' } ] } ], '#internal-type-specifiers': [ { token: 'punctuation.separator.value-type.erlang', regex: '/', push: [ { token: 'text', regex: '(?=,|:|>>)', next: 'pop' }, { token: [ 'storage.type.erlang', 'storage.modifier.signedness.erlang', 'storage.modifier.endianness.erlang', 'storage.modifier.unit.erlang', 'punctuation.separator.type-specifiers.erlang' ], regex: '(integer|float|binary|bytes|bitstring|bits)|(signed|unsigned)|(big|little|native)|(unit)|(-)' } ] } ], '#keyword': [ { token: 'keyword.control.erlang', regex: '\\b(?:after|begin|case|catch|cond|end|fun|if|let|of|query|try|receive|when)\\b' } ], '#list': [ { token: 'punctuation.definition.list.begin.erlang', regex: '\\[', push: [ { token: 'punctuation.definition.list.end.erlang', regex: '\\]', next: 'pop' }, { token: 'punctuation.separator.list.erlang', regex: '\\||\\|\\||,' }, { include: '#everything-else' }, { defaultToken: 'meta.structure.list.erlang' } ] } ], '#macro-directive': [ { token: [ 'meta.directive.ifdef.erlang', 'punctuation.section.directive.begin.erlang', 'meta.directive.ifdef.erlang', 'keyword.control.directive.ifdef.erlang', 'meta.directive.ifdef.erlang', 'punctuation.definition.parameters.begin.erlang', 'meta.directive.ifdef.erlang', 'entity.name.function.macro.erlang', 'meta.directive.ifdef.erlang', 'punctuation.definition.parameters.end.erlang', 'meta.directive.ifdef.erlang', 'punctuation.section.directive.end.erlang' ], regex: '^(\\s*)(-)(\\s*)(ifdef)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(\\))(\\s*)(\\.)' }, { token: [ 'meta.directive.ifndef.erlang', 'punctuation.section.directive.begin.erlang', 'meta.directive.ifndef.erlang', 'keyword.control.directive.ifndef.erlang', 'meta.directive.ifndef.erlang', 'punctuation.definition.parameters.begin.erlang', 'meta.directive.ifndef.erlang', 'entity.name.function.macro.erlang', 'meta.directive.ifndef.erlang', 'punctuation.definition.parameters.end.erlang', 'meta.directive.ifndef.erlang', 'punctuation.section.directive.end.erlang' ], regex: '^(\\s*)(-)(\\s*)(ifndef)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(\\))(\\s*)(\\.)' }, { token: [ 'meta.directive.undef.erlang', 'punctuation.section.directive.begin.erlang', 'meta.directive.undef.erlang', 'keyword.control.directive.undef.erlang', 'meta.directive.undef.erlang', 'punctuation.definition.parameters.begin.erlang', 'meta.directive.undef.erlang', 'entity.name.function.macro.erlang', 'meta.directive.undef.erlang', 'punctuation.definition.parameters.end.erlang', 'meta.directive.undef.erlang', 'punctuation.section.directive.end.erlang' ], regex: '^(\\s*)(-)(\\s*)(undef)(\\s*)(\\()(\\s*)([a-zA-Z\\d@_]+)(\\s*)(\\))(\\s*)(\\.)' } ], '#macro-usage': [ { token: [ 'keyword.operator.macro.erlang', 'meta.macro-usage.erlang', 'entity.name.function.macro.erlang' ], regex: '(\\?\\??)(\\s*)([a-zA-Z\\d@_]+)' } ], '#module-directive': [ { token: [ 'meta.directive.module.erlang', 'punctuation.section.directive.begin.erlang', 'meta.directive.module.erlang', 'keyword.control.directive.module.erlang', 'meta.directive.module.erlang', 'punctuation.definition.parameters.begin.erlang', 'meta.directive.module.erlang', 'entity.name.type.class.module.definition.erlang', 'meta.directive.module.erlang', 'punctuation.definition.parameters.end.erlang', 'meta.directive.module.erlang', 'punctuation.section.directive.end.erlang' ], regex: '^(\\s*)(-)(\\s*)(module)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*)(\\s*)(\\))(\\s*)(\\.)' } ], '#number': [ { token: 'text', regex: '(?=\\d)', push: [ { token: 'text', regex: '(?!\\d)', next: 'pop' }, { token: [ 'constant.numeric.float.erlang', 'punctuation.separator.integer-float.erlang', 'constant.numeric.float.erlang', 'punctuation.separator.float-exponent.erlang' ], regex: '(\\d+)(\\.)(\\d+)((?:[eE][\\+\\-]?\\d+)?)' }, { token: [ 'constant.numeric.integer.binary.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.binary.erlang' ], regex: '(2)(#)([0-1]+)' }, { token: [ 'constant.numeric.integer.base-3.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-3.erlang' ], regex: '(3)(#)([0-2]+)' }, { token: [ 'constant.numeric.integer.base-4.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-4.erlang' ], regex: '(4)(#)([0-3]+)' }, { token: [ 'constant.numeric.integer.base-5.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-5.erlang' ], regex: '(5)(#)([0-4]+)' }, { token: [ 'constant.numeric.integer.base-6.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-6.erlang' ], regex: '(6)(#)([0-5]+)' }, { token: [ 'constant.numeric.integer.base-7.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-7.erlang' ], regex: '(7)(#)([0-6]+)' }, { token: [ 'constant.numeric.integer.octal.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.octal.erlang' ], regex: '(8)(#)([0-7]+)' }, { token: [ 'constant.numeric.integer.base-9.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-9.erlang' ], regex: '(9)(#)([0-8]+)' }, { token: [ 'constant.numeric.integer.decimal.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.decimal.erlang' ], regex: '(10)(#)(\\d+)' }, { token: [ 'constant.numeric.integer.base-11.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-11.erlang' ], regex: '(11)(#)([\\daA]+)' }, { token: [ 'constant.numeric.integer.base-12.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-12.erlang' ], regex: '(12)(#)([\\da-bA-B]+)' }, { token: [ 'constant.numeric.integer.base-13.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-13.erlang' ], regex: '(13)(#)([\\da-cA-C]+)' }, { token: [ 'constant.numeric.integer.base-14.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-14.erlang' ], regex: '(14)(#)([\\da-dA-D]+)' }, { token: [ 'constant.numeric.integer.base-15.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-15.erlang' ], regex: '(15)(#)([\\da-eA-E]+)' }, { token: [ 'constant.numeric.integer.hexadecimal.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.hexadecimal.erlang' ], regex: '(16)(#)([\\da-fA-F]+)' }, { token: [ 'constant.numeric.integer.base-17.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-17.erlang' ], regex: '(17)(#)([\\da-gA-G]+)' }, { token: [ 'constant.numeric.integer.base-18.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-18.erlang' ], regex: '(18)(#)([\\da-hA-H]+)' }, { token: [ 'constant.numeric.integer.base-19.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-19.erlang' ], regex: '(19)(#)([\\da-iA-I]+)' }, { token: [ 'constant.numeric.integer.base-20.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-20.erlang' ], regex: '(20)(#)([\\da-jA-J]+)' }, { token: [ 'constant.numeric.integer.base-21.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-21.erlang' ], regex: '(21)(#)([\\da-kA-K]+)' }, { token: [ 'constant.numeric.integer.base-22.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-22.erlang' ], regex: '(22)(#)([\\da-lA-L]+)' }, { token: [ 'constant.numeric.integer.base-23.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-23.erlang' ], regex: '(23)(#)([\\da-mA-M]+)' }, { token: [ 'constant.numeric.integer.base-24.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-24.erlang' ], regex: '(24)(#)([\\da-nA-N]+)' }, { token: [ 'constant.numeric.integer.base-25.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-25.erlang' ], regex: '(25)(#)([\\da-oA-O]+)' }, { token: [ 'constant.numeric.integer.base-26.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-26.erlang' ], regex: '(26)(#)([\\da-pA-P]+)' }, { token: [ 'constant.numeric.integer.base-27.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-27.erlang' ], regex: '(27)(#)([\\da-qA-Q]+)' }, { token: [ 'constant.numeric.integer.base-28.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-28.erlang' ], regex: '(28)(#)([\\da-rA-R]+)' }, { token: [ 'constant.numeric.integer.base-29.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-29.erlang' ], regex: '(29)(#)([\\da-sA-S]+)' }, { token: [ 'constant.numeric.integer.base-30.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-30.erlang' ], regex: '(30)(#)([\\da-tA-T]+)' }, { token: [ 'constant.numeric.integer.base-31.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-31.erlang' ], regex: '(31)(#)([\\da-uA-U]+)' }, { token: [ 'constant.numeric.integer.base-32.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-32.erlang' ], regex: '(32)(#)([\\da-vA-V]+)' }, { token: [ 'constant.numeric.integer.base-33.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-33.erlang' ], regex: '(33)(#)([\\da-wA-W]+)' }, { token: [ 'constant.numeric.integer.base-34.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-34.erlang' ], regex: '(34)(#)([\\da-xA-X]+)' }, { token: [ 'constant.numeric.integer.base-35.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-35.erlang' ], regex: '(35)(#)([\\da-yA-Y]+)' }, { token: [ 'constant.numeric.integer.base-36.erlang', 'punctuation.separator.base-integer.erlang', 'constant.numeric.integer.base-36.erlang' ], regex: '(36)(#)([\\da-zA-Z]+)' }, { token: 'invalid.illegal.integer.erlang', regex: '\\d+#[\\da-zA-Z]+' }, { token: 'constant.numeric.integer.decimal.erlang', regex: '\\d+' } ] } ], '#parenthesized-expression': [ { token: 'punctuation.section.expression.begin.erlang', regex: '\\(', push: [ { token: 'punctuation.section.expression.end.erlang', regex: '\\)', next: 'pop' }, { include: '#everything-else' }, { defaultToken: 'meta.expression.parenthesized' } ] } ], '#record-directive': [ { token: [ 'meta.directive.record.erlang', 'punctuation.section.directive.begin.erlang', 'meta.directive.record.erlang', 'keyword.control.directive.import.erlang', 'meta.directive.record.erlang', 'punctuation.definition.parameters.begin.erlang', 'meta.directive.record.erlang', 'entity.name.type.class.record.definition.erlang', 'meta.directive.record.erlang', 'punctuation.separator.parameters.erlang' ], regex: '^(\\s*)(-)(\\s*)(record)(\\s*)(\\()(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(,)', push: [ { token: [ 'punctuation.definition.class.record.end.erlang', 'meta.directive.record.erlang', 'punctuation.definition.parameters.end.erlang', 'meta.directive.record.erlang', 'punctuation.section.directive.end.erlang' ], regex: '(\\})(\\s*)(\\))(\\s*)(\\.)', next: 'pop' }, { include: '#internal-record-body' }, { defaultToken: 'meta.directive.record.erlang' } ] } ], '#record-usage': [ { token: [ 'keyword.operator.record.erlang', 'meta.record-usage.erlang', 'entity.name.type.class.record.erlang', 'meta.record-usage.erlang', 'punctuation.separator.record-field.erlang', 'meta.record-usage.erlang', 'variable.other.field.erlang' ], regex: '(#)(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')(\\s*)(\\.)(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')' }, { token: [ 'keyword.operator.record.erlang', 'meta.record-usage.erlang', 'entity.name.type.class.record.erlang' ], regex: '(#)(\\s*)([a-z][a-zA-Z\\d@_]*|\'[^\']*\')', push: [ { token: 'punctuation.definition.class.record.end.erlang', regex: '\\}', next: 'pop' }, { include: '#internal-record-body' }, { defaultToken: 'meta.record-usage.erlang' } ] } ], '#string': [ { token: 'punctuation.definition.string.begin.erlang', regex: '"', push: [ { token: 'punctuation.definition.string.end.erlang', regex: '"', next: 'pop' }, { token: [ 'punctuation.definition.escape.erlang', 'constant.character.escape.erlang', 'punctuation.definition.escape.erlang', 'constant.character.escape.erlang', 'constant.character.escape.erlang' ], regex: '(\\\\)(?:([bdefnrstv\\\\\'"])|(\\^)([@-_])|([0-7]{1,3}))' }, { token: 'invalid.illegal.string.erlang', regex: '\\\\\\^?.?' }, { token: [ 'punctuation.definition.placeholder.erlang', 'punctuation.separator.placeholder-parts.erlang', 'constant.other.placeholder.erlang', 'punctuation.separator.placeholder-parts.erlang', 'punctuation.separator.placeholder-parts.erlang', 'constant.other.placeholder.erlang', 'punctuation.separator.placeholder-parts.erlang', 'punctuation.separator.placeholder-parts.erlang', 'punctuation.separator.placeholder-parts.erlang', 'constant.other.placeholder.erlang', 'constant.other.placeholder.erlang' ], regex: '(~)(?:((?:\\-)?)(\\d+)|(\\*))?(?:(\\.)(?:(\\d+)|(\\*)))?(?:(\\.)(?:(\\*)|(.)))?([~cfegswpWPBX#bx\\+ni])' }, { token: [ 'punctuation.definition.placeholder.erlang', 'punctuation.separator.placeholder-parts.erlang', 'constant.other.placeholder.erlang', 'constant.other.placeholder.erlang' ], regex: '(~)((?:\\*)?)((?:\\d+)?)([~du\\-#fsacl])' }, { token: 'invalid.illegal.string.erlang', regex: '~.?' }, { defaultToken: 'string.quoted.double.erlang' } ] } ], '#symbolic-operator': [ { token: 'keyword.operator.symbolic.erlang', regex: '\\+\\+|\\+|--|-|\\*|/=|/|=/=|=:=|==|=<|=|<-|<|>=|>|!|::' } ], '#textual-operator': [ { token: 'keyword.operator.textual.erlang', regex: '\\b(?:andalso|band|and|bxor|xor|bor|orelse|or|bnot|not|bsl|bsr|div|rem)\\b' } ], '#tuple': [ { token: 'punctuation.definition.tuple.begin.erlang', regex: '\\{', push: [ { token: 'punctuation.definition.tuple.end.erlang', regex: '\\}', next: 'pop' }, { token: 'punctuation.separator.tuple.erlang', regex: ',' }, { include: '#everything-else' }, { defaultToken: 'meta.structure.tuple.erlang' } ] } ], '#variable': [ { token: [ 'variable.other.erlang', 'variable.language.omitted.erlang' ], regex: '(_[a-zA-Z\\d@_]+|[A-Z][a-zA-Z\\d@_]*)|(_)' } ] } this.normalizeRules(); }; ErlangHighlightRules.metaData = { comment: 'The recognition of function definitions and compiler directives (such as module, record and macro definitions) requires that each of the aforementioned constructs must be the first string inside a line (except for whitespace). Also, the function/module/record/macro names must be given unquoted. -- desp', fileTypes: [ 'erl', 'hrl' ], keyEquivalent: '^~E', name: 'Erlang', scopeName: 'source.erlang' } oop.inherits(ErlangHighlightRules, TextHighlightRules); exports.ErlangHighlightRules = ErlangHighlightRules; });
{ "pile_set_name": "Github" }
/* Copyright (c) 2018 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package tags import ( "context" "fmt" "net/http" "strings" "github.com/vmware/govmomi/vapi/internal" "github.com/vmware/govmomi/vapi/rest" ) // Manager extends rest.Client, adding tag related methods. type Manager struct { *rest.Client } // NewManager creates a new Manager instance with the given client. func NewManager(client *rest.Client) *Manager { return &Manager{ Client: client, } } // isName returns true if the id is not a urn. func isName(id string) bool { return !strings.HasPrefix(id, "urn:") } // Tag provides methods to create, read, update, delete, and enumerate tags. type Tag struct { ID string `json:"id,omitempty"` Description string `json:"description,omitempty"` Name string `json:"name,omitempty"` CategoryID string `json:"category_id,omitempty"` UsedBy []string `json:"used_by,omitempty"` } // Patch merges updates from the given src. func (t *Tag) Patch(src *Tag) { if src.Name != "" { t.Name = src.Name } if src.Description != "" { t.Description = src.Description } if src.CategoryID != "" { t.CategoryID = src.CategoryID } } // CreateTag creates a new tag with the given Name, Description and CategoryID. func (c *Manager) CreateTag(ctx context.Context, tag *Tag) (string, error) { // create avoids the annoyance of CreateTag requiring a "description" key to be included in the request, // even though the field value can be empty. type create struct { Name string `json:"name"` Description string `json:"description"` CategoryID string `json:"category_id"` } spec := struct { Tag create `json:"create_spec"` }{ Tag: create{ Name: tag.Name, Description: tag.Description, CategoryID: tag.CategoryID, }, } if isName(tag.CategoryID) { cat, err := c.GetCategory(ctx, tag.CategoryID) if err != nil { return "", err } spec.Tag.CategoryID = cat.ID } url := internal.URL(c, internal.TagPath) var res string return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) } // UpdateTag can update one or both of the tag Description and Name fields. func (c *Manager) UpdateTag(ctx context.Context, tag *Tag) error { spec := struct { Tag Tag `json:"update_spec"` }{ Tag: Tag{ Name: tag.Name, Description: tag.Description, }, } url := internal.URL(c, internal.TagPath).WithID(tag.ID) return c.Do(ctx, url.Request(http.MethodPatch, spec), nil) } // DeleteTag deletes an existing tag. func (c *Manager) DeleteTag(ctx context.Context, tag *Tag) error { url := internal.URL(c, internal.TagPath).WithID(tag.ID) return c.Do(ctx, url.Request(http.MethodDelete), nil) } // GetTag fetches the tag information for the given identifier. // The id parameter can be a Tag ID or Tag Name. func (c *Manager) GetTag(ctx context.Context, id string) (*Tag, error) { if isName(id) { tags, err := c.GetTags(ctx) if err != nil { return nil, err } for i := range tags { if tags[i].Name == id { return &tags[i], nil } } } url := internal.URL(c, internal.TagPath).WithID(id) var res Tag return &res, c.Do(ctx, url.Request(http.MethodGet), &res) } // GetTagForCategory fetches the tag information for the given identifier in the given category. func (c *Manager) GetTagForCategory(ctx context.Context, id, category string) (*Tag, error) { if category == "" { return c.GetTag(ctx, id) } ids, err := c.ListTagsForCategory(ctx, category) if err != nil { return nil, err } for _, id := range ids { tag, err := c.GetTag(ctx, id) if err != nil { return nil, fmt.Errorf("get tag for category %s %s: %s", category, id, err) } if tag.ID == id || tag.Name == id { return tag, nil } } return nil, fmt.Errorf("tag %q not found in category %q", id, category) } // ListTags returns all tag IDs in the system. func (c *Manager) ListTags(ctx context.Context) ([]string, error) { url := internal.URL(c, internal.TagPath) var res []string return res, c.Do(ctx, url.Request(http.MethodGet), &res) } // GetTags fetches an array of tag information in the system. func (c *Manager) GetTags(ctx context.Context) ([]Tag, error) { ids, err := c.ListTags(ctx) if err != nil { return nil, fmt.Errorf("get tags failed for: %s", err) } var tags []Tag for _, id := range ids { tag, err := c.GetTag(ctx, id) if err != nil { return nil, fmt.Errorf("get category %s failed for %s", id, err) } tags = append(tags, *tag) } return tags, nil } // The id parameter can be a Category ID or Category Name. func (c *Manager) ListTagsForCategory(ctx context.Context, id string) ([]string, error) { if isName(id) { cat, err := c.GetCategory(ctx, id) if err != nil { return nil, err } id = cat.ID } body := struct { ID string `json:"category_id"` }{id} url := internal.URL(c, internal.TagPath).WithID(id).WithAction("list-tags-for-category") var res []string return res, c.Do(ctx, url.Request(http.MethodPost, body), &res) } // The id parameter can be a Category ID or Category Name. func (c *Manager) GetTagsForCategory(ctx context.Context, id string) ([]Tag, error) { ids, err := c.ListTagsForCategory(ctx, id) if err != nil { return nil, err } var tags []Tag for _, id := range ids { tag, err := c.GetTag(ctx, id) if err != nil { return nil, fmt.Errorf("get tag %s: %s", id, err) } tags = append(tags, *tag) } return tags, nil }
{ "pile_set_name": "Github" }
class Vcs < Formula desc "Creates video contact sheets (previews) of videos" homepage "https://p.outlyer.net/vcs/" url "https://p.outlyer.net/files/vcs/vcs-1.13.4.tar.gz" sha256 "dc1d6145e10eeed61d16c3591cfe3496a6ac392c9c2f7c2393cbdb0cf248544b" livecheck do url "https://p.outlyer.net/files/vcs/?C=M&O=D" regex(/href=.*?vcs[._-]v?(\d+(?:\.\d+)+)\.t/i) end bottle do cellar :any_skip_relocation sha256 "d93ff1a5972e0f9e961bf66ee8bbd99e6037505de83d73f22e69f8683d0ad1b6" => :catalina sha256 "d93ff1a5972e0f9e961bf66ee8bbd99e6037505de83d73f22e69f8683d0ad1b6" => :mojave sha256 "0873f5c80cc698e7b2ce6d653a43bb51ef363c5e0325997565b30d540e87cb86" => :high_sierra end depends_on "ffmpeg" depends_on "ghostscript" depends_on "gnu-getopt" depends_on "imagemagick" def install inreplace "vcs", "declare GETOPT=getopt", "declare GETOPT=#{Formula["gnu-getopt"].opt_bin}/getopt" system "make", "install", "prefix=#{prefix}" end test do system Formula["ffmpeg"].bin/"ffmpeg", "-f", "rawvideo", "-s", "hd720", "-pix_fmt", "yuv420p", "-r", "30", "-t", "5", "-i", "/dev/zero", testpath/"video.mp4" assert_predicate testpath/"video.mp4", :exist? system bin/"vcs", "-i", "1", "-o", testpath/"sheet.png", testpath/"video.mp4" assert_predicate testpath/"sheet.png", :exist? end end
{ "pile_set_name": "Github" }
<?php namespace Faker; /** * Proxy for other generators, to return only unique values. Works with * Faker\Generator\Base->unique() */ class UniqueGenerator { protected $generator; protected $maxRetries; protected $uniques = array(); /** * @param Generator $generator * @param $maxRetries */ public function __construct(Generator $generator, $maxRetries) { $this->generator = $generator; $this->maxRetries = $maxRetries; } /** * Catch and proxy all generator calls but return only unique values * @param string $attribute * @return mixed */ public function __get($attribute) { return $this->__call($attribute, array()); } /** * Catch and proxy all generator calls with arguments but return only unique values * @param string $name * @param array $arguments * @return mixed */ public function __call($name, $arguments) { if (!isset($this->uniques[$name])) { $this->uniques[$name] = array(); } $i = 0; do { $res = call_user_func_array(array($this->generator, $name), $arguments); $i++; if ($i > $this->maxRetries) { throw new \OverflowException(sprintf('Maximum retries of %d reached without finding a unique value', $this->maxRetries)); } } while (array_key_exists(serialize($res), $this->uniques[$name])); $this->uniques[$name][serialize($res)]= null; return $res; } }
{ "pile_set_name": "Github" }
// PHZ // 2018-5-15 #ifndef XOP_NET_INTERFACE_H #define XOP_NET_INTERFACE_H #include <string> namespace xop { class NetInterface { public: static std::string GetLocalIPAddress(); }; } #endif
{ "pile_set_name": "Github" }
Metadata-Version: 2.0 Name: ForgeryPy Version: 0.1 Summary: An easy to use forged data generator for Python Home-page: http://tomekwojcik.github.com/ForgeryPy/ Author: Tomasz Wójcik Author-email: labs@tomekwojcik.pl License: https://github.com/tomekwojcik/ForgeryPy/blob/master/LICENSE Download-URL: http://github.com/tomekwojcik/ForgeryPy/tarball/v0.1 Platform: UNKNOWN Classifier: Development Status :: 3 - Alpha Classifier: Environment :: Other Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Topic :: Software Development :: Libraries :: Python Modules ForgeryPy ========= ForgeryPy is an easy to use forged data generator. It's a (somewhat incomplete) port of `forgery Ruby gem <http://rubygems.org/gems/forgery>`_. Example usage ------------- >>> import forgery_py >>> forgery_py.address.street_address() u'4358 Shopko Junction' >>> forgery_py.basic.hex_color() '3F0A59' >>> forgery_py.currency.description() u'Slovenia Tolars' >>> forgery_py.date.date() datetime.date(2012, 7, 27) >>> forgery_py.internet.email_address() u'brian@zazio.mil' >>> forgery_py.lorem_ipsum.title() u'Pretium nam rhoncus ultrices!' >>> forgery_py.name.full_name() u'Mary Peters' >>> forgery_py.personal.language() u'Hungarian' Credits ------- The project uses dictionary files from `forgery Ruby gem <https://github.com/sevenwire/forgery>`_. License ------- MIT-style, see LICENSE
{ "pile_set_name": "Github" }
/* Copyright 2017 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 v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" scheme "k8s.io/client-go/kubernetes/scheme" v1 "k8s.io/client-go/pkg/api/v1" rest "k8s.io/client-go/rest" ) // ResourceQuotasGetter has a method to return a ResourceQuotaInterface. // A group's client should implement this interface. type ResourceQuotasGetter interface { ResourceQuotas(namespace string) ResourceQuotaInterface } // ResourceQuotaInterface has methods to work with ResourceQuota resources. type ResourceQuotaInterface interface { Create(*v1.ResourceQuota) (*v1.ResourceQuota, error) Update(*v1.ResourceQuota) (*v1.ResourceQuota, error) UpdateStatus(*v1.ResourceQuota) (*v1.ResourceQuota, error) Delete(name string, options *meta_v1.DeleteOptions) error DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error Get(name string, options meta_v1.GetOptions) (*v1.ResourceQuota, error) List(opts meta_v1.ListOptions) (*v1.ResourceQuotaList, error) Watch(opts meta_v1.ListOptions) (watch.Interface, error) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ResourceQuota, err error) ResourceQuotaExpansion } // resourceQuotas implements ResourceQuotaInterface type resourceQuotas struct { client rest.Interface ns string } // newResourceQuotas returns a ResourceQuotas func newResourceQuotas(c *CoreV1Client, namespace string) *resourceQuotas { return &resourceQuotas{ client: c.RESTClient(), ns: namespace, } } // Create takes the representation of a resourceQuota and creates it. Returns the server's representation of the resourceQuota, and an error, if there is any. func (c *resourceQuotas) Create(resourceQuota *v1.ResourceQuota) (result *v1.ResourceQuota, err error) { result = &v1.ResourceQuota{} err = c.client.Post(). Namespace(c.ns). Resource("resourcequotas"). Body(resourceQuota). Do(). Into(result) return } // Update takes the representation of a resourceQuota and updates it. Returns the server's representation of the resourceQuota, and an error, if there is any. func (c *resourceQuotas) Update(resourceQuota *v1.ResourceQuota) (result *v1.ResourceQuota, err error) { result = &v1.ResourceQuota{} err = c.client.Put(). Namespace(c.ns). Resource("resourcequotas"). Name(resourceQuota.Name). Body(resourceQuota). Do(). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclientstatus=false comment above the type to avoid generating UpdateStatus(). func (c *resourceQuotas) UpdateStatus(resourceQuota *v1.ResourceQuota) (result *v1.ResourceQuota, err error) { result = &v1.ResourceQuota{} err = c.client.Put(). Namespace(c.ns). Resource("resourcequotas"). Name(resourceQuota.Name). SubResource("status"). Body(resourceQuota). Do(). Into(result) return } // Delete takes name of the resourceQuota and deletes it. Returns an error if one occurs. func (c *resourceQuotas) Delete(name string, options *meta_v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("resourcequotas"). Name(name). Body(options). Do(). Error() } // DeleteCollection deletes a collection of objects. func (c *resourceQuotas) DeleteCollection(options *meta_v1.DeleteOptions, listOptions meta_v1.ListOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("resourcequotas"). VersionedParams(&listOptions, scheme.ParameterCodec). Body(options). Do(). Error() } // Get takes name of the resourceQuota, and returns the corresponding resourceQuota object, and an error if there is any. func (c *resourceQuotas) Get(name string, options meta_v1.GetOptions) (result *v1.ResourceQuota, err error) { result = &v1.ResourceQuota{} err = c.client.Get(). Namespace(c.ns). Resource("resourcequotas"). Name(name). VersionedParams(&options, scheme.ParameterCodec). Do(). Into(result) return } // List takes label and field selectors, and returns the list of ResourceQuotas that match those selectors. func (c *resourceQuotas) List(opts meta_v1.ListOptions) (result *v1.ResourceQuotaList, err error) { result = &v1.ResourceQuotaList{} err = c.client.Get(). Namespace(c.ns). Resource("resourcequotas"). VersionedParams(&opts, scheme.ParameterCodec). Do(). Into(result) return } // Watch returns a watch.Interface that watches the requested resourceQuotas. func (c *resourceQuotas) Watch(opts meta_v1.ListOptions) (watch.Interface, error) { opts.Watch = true return c.client.Get(). Namespace(c.ns). Resource("resourcequotas"). VersionedParams(&opts, scheme.ParameterCodec). Watch() } // Patch applies the patch and returns the patched resourceQuota. func (c *resourceQuotas) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ResourceQuota, err error) { result = &v1.ResourceQuota{} err = c.client.Patch(pt). Namespace(c.ns). Resource("resourcequotas"). SubResource(subresources...). Name(name). Body(data). Do(). Into(result) return }
{ "pile_set_name": "Github" }
package leafnodes import ( "time" "github.com/onsi/ginkgo/internal/failer" "github.com/onsi/ginkgo/types" ) type ItNode struct { runner *runner flag types.FlagType text string } func NewItNode(text string, body interface{}, flag types.FlagType, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer, componentIndex int) *ItNode { return &ItNode{ runner: newRunner(body, codeLocation, timeout, failer, types.SpecComponentTypeIt, componentIndex), flag: flag, text: text, } } func (node *ItNode) Run() (outcome types.SpecState, failure types.SpecFailure) { return node.runner.run() } func (node *ItNode) Type() types.SpecComponentType { return types.SpecComponentTypeIt } func (node *ItNode) Text() string { return node.text } func (node *ItNode) Flag() types.FlagType { return node.flag } func (node *ItNode) CodeLocation() types.CodeLocation { return node.runner.codeLocation } func (node *ItNode) Samples() int { return 1 }
{ "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 framework import ( "bytes" "fmt" "math" "sort" "strconv" "strings" "sync" "text/tabwriter" "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/kubernetes/pkg/client/clientset_generated/clientset" "k8s.io/kubernetes/pkg/util/system" ) const ( resourceDataGatheringPeriod = 60 * time.Second probeDuration = 15 * time.Second ) type ResourceConstraint struct { CPUConstraint float64 MemoryConstraint uint64 } type SingleContainerSummary struct { Name string Cpu float64 Mem uint64 } // we can't have int here, as JSON does not accept integer keys. type ResourceUsageSummary map[string][]SingleContainerSummary func (s *ResourceUsageSummary) PrintHumanReadable() string { buf := &bytes.Buffer{} w := tabwriter.NewWriter(buf, 1, 0, 1, ' ', 0) for perc, summaries := range *s { buf.WriteString(fmt.Sprintf("%v percentile:\n", perc)) fmt.Fprintf(w, "container\tcpu(cores)\tmemory(MB)\n") for _, summary := range summaries { fmt.Fprintf(w, "%q\t%.3f\t%.2f\n", summary.Name, summary.Cpu, float64(summary.Mem)/(1024*1024)) } w.Flush() } return buf.String() } func (s *ResourceUsageSummary) PrintJSON() string { return PrettyPrintJSON(*s) } func (s *ResourceUsageSummary) SummaryKind() string { return "ResourceUsageSummary" } func computePercentiles(timeSeries []ResourceUsagePerContainer, percentilesToCompute []int) map[int]ResourceUsagePerContainer { if len(timeSeries) == 0 { return make(map[int]ResourceUsagePerContainer) } dataMap := make(map[string]*usageDataPerContainer) for i := range timeSeries { for name, data := range timeSeries[i] { if dataMap[name] == nil { dataMap[name] = &usageDataPerContainer{ cpuData: make([]float64, len(timeSeries)), memUseData: make([]uint64, len(timeSeries)), memWorkSetData: make([]uint64, len(timeSeries)), } } dataMap[name].cpuData = append(dataMap[name].cpuData, data.CPUUsageInCores) dataMap[name].memUseData = append(dataMap[name].memUseData, data.MemoryUsageInBytes) dataMap[name].memWorkSetData = append(dataMap[name].memWorkSetData, data.MemoryWorkingSetInBytes) } } for _, v := range dataMap { sort.Float64s(v.cpuData) sort.Sort(uint64arr(v.memUseData)) sort.Sort(uint64arr(v.memWorkSetData)) } result := make(map[int]ResourceUsagePerContainer) for _, perc := range percentilesToCompute { data := make(ResourceUsagePerContainer) for k, v := range dataMap { percentileIndex := int(math.Ceil(float64(len(v.cpuData)*perc)/100)) - 1 data[k] = &ContainerResourceUsage{ Name: k, CPUUsageInCores: v.cpuData[percentileIndex], MemoryUsageInBytes: v.memUseData[percentileIndex], MemoryWorkingSetInBytes: v.memWorkSetData[percentileIndex], } } result[perc] = data } return result } func leftMergeData(left, right map[int]ResourceUsagePerContainer) map[int]ResourceUsagePerContainer { result := make(map[int]ResourceUsagePerContainer) for percentile, data := range left { result[percentile] = data if _, ok := right[percentile]; !ok { continue } for k, v := range right[percentile] { result[percentile][k] = v } } return result } type resourceGatherWorker struct { c clientset.Interface nodeName string wg *sync.WaitGroup containerIDs []string stopCh chan struct{} dataSeries []ResourceUsagePerContainer finished bool inKubemark bool } func (w *resourceGatherWorker) singleProbe() { data := make(ResourceUsagePerContainer) if w.inKubemark { kubemarkData := GetKubemarkMasterComponentsResourceUsage() if data == nil { return } for k, v := range kubemarkData { data[k] = &ContainerResourceUsage{ Name: v.Name, MemoryWorkingSetInBytes: v.MemoryWorkingSetInBytes, CPUUsageInCores: v.CPUUsageInCores, } } } else { nodeUsage, err := getOneTimeResourceUsageOnNode(w.c, w.nodeName, probeDuration, func() []string { return w.containerIDs }) if err != nil { Logf("Error while reading data from %v: %v", w.nodeName, err) return } for k, v := range nodeUsage { data[k] = v } } w.dataSeries = append(w.dataSeries, data) } func (w *resourceGatherWorker) gather(initialSleep time.Duration) { defer utilruntime.HandleCrash() defer w.wg.Done() defer Logf("Closing worker for %v", w.nodeName) defer func() { w.finished = true }() select { case <-time.After(initialSleep): w.singleProbe() for { select { case <-time.After(resourceDataGatheringPeriod): w.singleProbe() case <-w.stopCh: return } } case <-w.stopCh: return } } func (g *containerResourceGatherer) getKubeSystemContainersResourceUsage(c clientset.Interface) { if len(g.workers) == 0 { return } delayPeriod := resourceDataGatheringPeriod / time.Duration(len(g.workers)) delay := time.Duration(0) for i := range g.workers { go g.workers[i].gather(delay) delay += delayPeriod } g.workerWg.Wait() } type containerResourceGatherer struct { client clientset.Interface stopCh chan struct{} workers []resourceGatherWorker workerWg sync.WaitGroup containerIDs []string options ResourceGathererOptions } type ResourceGathererOptions struct { inKubemark bool masterOnly bool } func NewResourceUsageGatherer(c clientset.Interface, options ResourceGathererOptions) (*containerResourceGatherer, error) { g := containerResourceGatherer{ client: c, stopCh: make(chan struct{}), containerIDs: make([]string, 0), options: options, } if options.inKubemark { g.workerWg.Add(1) g.workers = append(g.workers, resourceGatherWorker{ inKubemark: true, stopCh: g.stopCh, wg: &g.workerWg, finished: false, }) } else { pods, err := c.Core().Pods("kube-system").List(metav1.ListOptions{}) if err != nil { Logf("Error while listing Pods: %v", err) return nil, err } for _, pod := range pods.Items { for _, container := range pod.Status.ContainerStatuses { g.containerIDs = append(g.containerIDs, container.Name) } } nodeList, err := c.Core().Nodes().List(metav1.ListOptions{}) if err != nil { Logf("Error while listing Nodes: %v", err) return nil, err } for _, node := range nodeList.Items { if !options.masterOnly || system.IsMasterNode(node.Name) { g.workerWg.Add(1) g.workers = append(g.workers, resourceGatherWorker{ c: c, nodeName: node.Name, wg: &g.workerWg, containerIDs: g.containerIDs, stopCh: g.stopCh, finished: false, inKubemark: false, }) if options.masterOnly { break } } } } return &g, nil } // startGatheringData blocks until stopAndSummarize is called. func (g *containerResourceGatherer) startGatheringData() { g.getKubeSystemContainersResourceUsage(g.client) } func (g *containerResourceGatherer) stopAndSummarize(percentiles []int, constraints map[string]ResourceConstraint) (*ResourceUsageSummary, error) { close(g.stopCh) Logf("Closed stop channel. Waiting for %v workers", len(g.workers)) finished := make(chan struct{}) go func() { g.workerWg.Wait() finished <- struct{}{} }() select { case <-finished: Logf("Waitgroup finished.") case <-time.After(2 * time.Minute): unfinished := make([]string, 0) for i := range g.workers { if !g.workers[i].finished { unfinished = append(unfinished, g.workers[i].nodeName) } } Logf("Timed out while waiting for waitgroup, some workers failed to finish: %v", unfinished) } if len(percentiles) == 0 { Logf("Warning! Empty percentile list for stopAndPrintData.") return &ResourceUsageSummary{}, fmt.Errorf("Failed to get any resource usage data") } data := make(map[int]ResourceUsagePerContainer) for i := range g.workers { if g.workers[i].finished { stats := computePercentiles(g.workers[i].dataSeries, percentiles) data = leftMergeData(stats, data) } } // Workers has been stopped. We need to gather data stored in them. sortedKeys := []string{} for name := range data[percentiles[0]] { sortedKeys = append(sortedKeys, name) } sort.Strings(sortedKeys) violatedConstraints := make([]string, 0) summary := make(ResourceUsageSummary) for _, perc := range percentiles { for _, name := range sortedKeys { usage := data[perc][name] summary[strconv.Itoa(perc)] = append(summary[strconv.Itoa(perc)], SingleContainerSummary{ Name: name, Cpu: usage.CPUUsageInCores, Mem: usage.MemoryWorkingSetInBytes, }) // Verifying 99th percentile of resource usage if perc == 99 { // Name has a form: <pod_name>/<container_name> containerName := strings.Split(name, "/")[1] if constraint, ok := constraints[containerName]; ok { if usage.CPUUsageInCores > constraint.CPUConstraint { violatedConstraints = append( violatedConstraints, fmt.Sprintf("Container %v is using %v/%v CPU", name, usage.CPUUsageInCores, constraint.CPUConstraint, ), ) } if usage.MemoryWorkingSetInBytes > constraint.MemoryConstraint { violatedConstraints = append( violatedConstraints, fmt.Sprintf("Container %v is using %v/%v MB of memory", name, float64(usage.MemoryWorkingSetInBytes)/(1024*1024), float64(constraint.MemoryConstraint)/(1024*1024), ), ) } } } } } if len(violatedConstraints) > 0 { return &summary, fmt.Errorf(strings.Join(violatedConstraints, "\n")) } return &summary, nil }
{ "pile_set_name": "Github" }
// mksyscall.pl -tags linux,arm64 syscall_linux.go syscall_linux_arm64.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,arm64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fchmodat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FCHMODAT, 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 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 Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (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 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), 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 openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 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 ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 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 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 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 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 utimes(path string, times *[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(times)), 0) 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 } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) { _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times))) 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 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 KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 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 KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret 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_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 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 keyctlJoin(cmd int, arg2 string) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(arg2) if err != nil { return } r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 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 keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(arg3) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(arg4) if err != nil { return } r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 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 keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) { var _p0 unsafe.Pointer if len(payload) > 0 { _p0 = unsafe.Pointer(&payload[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret 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_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 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 ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(arg) if err != nil { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), 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 mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) { var _p0 *byte _p0, err = BytePtrFromString(source) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(target) if err != nil { return } var _p2 *byte _p2, err = BytePtrFromString(fstype) if err != nil { return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Acct(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCT, 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 AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(description) if err != nil { return } var _p2 unsafe.Pointer if len(payload) > 0 { _p2 = unsafe.Pointer(&payload[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0) id = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtimex(buf *Timex) (state int, err error) { r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0) state = int(r0) 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 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 ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 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 CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), 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 Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 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 Dup3(oldfd int, newfd int, flags int) (err error) { _, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCreate(size int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 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 EpollCreate1(flag int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 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 EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { _, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Eventfd(initval uint, flags int) (fd int, err error) { r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 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 Exit(code int) { Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0) 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 Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 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 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 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 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 Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, 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 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 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 Getdents(fd int, 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_GETDENTS64, uintptr(fd), uintptr(_p0), 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 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 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 Getrandom(buf []byte, flags int) (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_GETRANDOM, uintptr(_p0), uintptr(len(buf)), 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 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 Gettid() (tid int) { r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) tid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getxattr(path string, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(dest) > 0 { _p2 = unsafe.Pointer(&dest[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) if err != nil { return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyInit1(flags int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 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 InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0) success = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, sig syscall.Signal) (err error) { _, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Klogctl(typ int, 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_SYSLOG, uintptr(typ), uintptr(_p0), 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 Lgetxattr(path string, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(dest) > 0 { _p2 = unsafe.Pointer(&dest[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listxattr(path string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Llistxattr(path string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lremovexattr(path string, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := Syscall(SYS_LREMOVEXATTR, 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 Lsetxattr(path string, attr string, data []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(data) > 0 { _p2 = unsafe.Pointer(&data[0]) } else { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 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 Mknodat(dirfd 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(dirfd), 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 PivotRoot(newroot string, putold string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(newroot) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(putold) if err != nil { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, 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 prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { _, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PSELECT6, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask))) 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 Removexattr(path string, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, 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(olddirfd int, 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 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), 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 RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(description) if err != nil { return } var _p2 *byte _p2, err = BytePtrFromString(callback) if err != nil { return } r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0) id = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setdomainname(p []byte) (err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sethostname(p []byte) (err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 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 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(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, 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 Setns(fd int, nstype int) (err error) { _, _, e1 := Syscall(SYS_SETNS, uintptr(fd), uintptr(nstype), 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 Setxattr(path string, attr string, data []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(data) > 0 { _p2 = unsafe.Pointer(&data[0]) } else { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() { Syscall(SYS_SYNC, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Syncfs(fd int) (err error) { _, _, e1 := Syscall(SYS_SYNCFS, 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 Sysinfo(info *Sysinfo_t) (err error) { _, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tgkill(tgid int, tid int, sig syscall.Signal) (err error) { _, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Times(tms *Tms) (ticks uintptr, err error) { r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) ticks = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(mask int) (oldmask int) { r0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Uname(buf *Utsname) (err error) { _, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(target string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(target) if err != nil { return } _, _, e1 := Syscall(SYS_UMOUNT2, 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 Unshare(flags int) (err error) { _, _, e1 := Syscall(SYS_UNSHARE, 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 Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 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 exitThread(code int) (err error) { _, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 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, p *byte, np int) (n int, err error) { r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) 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, p *byte, np int) (n int, err error) { r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) n = int(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 Madvise(b []byte, advice 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(advice)) 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 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 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 EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_PWAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 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 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 Fstat(fd int, stat *Stat_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 Fstatat(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, 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, buf *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 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 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } 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() (euid int) { r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) euid = 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 Getrlimit(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 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 Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) 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_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 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 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_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 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 Seek(fd int, offset int64, whence int) (off int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) off = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setfsgid(gid int) (err error) { _, _, e1 := Syscall(SYS_SETFSGID, 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 Setfsuid(uid int) (err error) { _, _, e1 := Syscall(SYS_SETFSUID, 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 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 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(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 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 Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, 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 Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, buf *Statfs_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(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), 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 Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) 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 accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 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 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 getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) 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 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 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 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 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 mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) xaddr = uintptr(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 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 }
{ "pile_set_name": "Github" }
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package pbkdf2 implements the key derivation function PBKDF2 as defined in RFC 2898 / PKCS #5 v2.0. A key derivation function is useful when encrypting data based on a password or any other not-fully-random data. It uses a pseudorandom function to derive a secure encryption key based on the password. While v2.0 of the standard defines only one pseudorandom function to use, HMAC-SHA1, the drafted v2.1 specification allows use of all five FIPS Approved Hash Functions SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512 for HMAC. To choose, you can pass the `New` functions from the different SHA packages to pbkdf2.Key. */ package pbkdf2 // import "golang.org/x/crypto/pbkdf2" import ( "crypto/hmac" "hash" ) // Key derives a key from the password, salt and iteration count, returning a // []byte of length keylen that can be used as cryptographic key. The key is // derived based on the method described as PBKDF2 with the HMAC variant using // the supplied hash function. // // For example, to use a HMAC-SHA-1 based PBKDF2 key derivation function, you // can get a derived key for e.g. AES-256 (which needs a 32-byte key) by // doing: // // dk := pbkdf2.Key([]byte("some password"), salt, 4096, 32, sha1.New) // // Remember to get a good random salt. At least 8 bytes is recommended by the // RFC. // // Using a higher iteration count will increase the cost of an exhaustive // search but will also make derivation proportionally slower. func Key(password, salt []byte, iter, keyLen int, h func() hash.Hash) []byte { prf := hmac.New(h, password) hashLen := prf.Size() numBlocks := (keyLen + hashLen - 1) / hashLen var buf [4]byte dk := make([]byte, 0, numBlocks*hashLen) U := make([]byte, hashLen) for block := 1; block <= numBlocks; block++ { // N.B.: || means concatenation, ^ means XOR // for each block T_i = U_1 ^ U_2 ^ ... ^ U_iter // U_1 = PRF(password, salt || uint(i)) prf.Reset() prf.Write(salt) buf[0] = byte(block >> 24) buf[1] = byte(block >> 16) buf[2] = byte(block >> 8) buf[3] = byte(block) prf.Write(buf[:4]) dk = prf.Sum(dk) T := dk[len(dk)-hashLen:] copy(U, T) // U_n = PRF(password, U_(n-1)) for n := 2; n <= iter; n++ { prf.Reset() prf.Write(U) U = U[:0] U = prf.Sum(U) for x := range U { T[x] ^= U[x] } } } return dk[:keyLen] }
{ "pile_set_name": "Github" }
--- -api-id: M:Windows.UI.Xaml.Controls.InkToolbarIsStencilButtonCheckedChangedEventArgs.#ctor -api-type: winrt method --- <!-- Method syntax. public InkToolbarIsStencilButtonCheckedChangedEventArgs.InkToolbarIsStencilButtonCheckedChangedEventArgs() --> # Windows.UI.Xaml.Controls.InkToolbarIsStencilButtonCheckedChangedEventArgs.InkToolbarIsStencilButtonCheckedChangedEventArgs ## -description Initializes a new instance of the [InkToolbarIsStencilButtonCheckedChangedEventArgs](inktoolbarisstencilbuttoncheckedchangedeventargs.md) class. ## -remarks ## -examples ## -see-also [Pen and stylus interactions](/windows/uwp/input-and-devices/pen-and-stylus-interactions), [Add an InkToolbar to a Universal Windows Platform (UWP) app](/windows/uwp/input-and-devices/ink-toolbar), [Get Started Tutorial: Support ink in your UWP app](/windows/uwp/get-started/ink-walkthrough), [InkToolbarIsStencilButtonCheckedChangedEventArgs](inktoolbarisstencilbuttoncheckedchangedeventargs.md), [Ink sample (JavaScript)](https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/Ink), [Get Started Tutorial: Support ink in your UWP app](https://aka.ms/appsample-ink), [Coloring book sample](https://aka.ms/cpubsample-coloringbook), [Family notes sample](https://aka.ms/cpubsample-familynotessample)
{ "pile_set_name": "Github" }
# ESP-CAM的简易使用指南-1Z实验室 作者: 阿凯 (QQ 244561792) 1Z实验室(1zlab)出品 : make things easy ## 概要 在ESP-CAM的固件上面, 默认执行的程序为`WIFI传图`. ESP-CAM开启热点, 电脑连接ESP-CAM的热点, 然后在浏览器中输入对应的URL就可以获取到摄像头拍摄的画面/视频流. ## 目录 使用ESP-CAM 仅需要如下几步 [1ESP-CAM初始化](#1ESP-CAM初始化) [2连接WIFI](#2连接WIFI) [3查看IP地址](#3查看IP地址) [4浏览图片/视频流](#4浏览图片/视频流) [5问题与解决方案](#5问题与解决方案) ## 1ESP-CAM初始化 首先ESP-CAM需要通过TypeC接口供电, 红色指示灯会亮. 然后上电运行代码, 你也可以使用侧面的复位按键`RST`,重新初始化. ## 2连接WIFI 在**电脑/手机**上面连接热点**M5Cam**, 没有密码, 直接连上. > 当然, 如果你会修改固件的话, 也可以修改为其他名字. ![wifi](./IMG/wifi.png) **注意: ESP-CAM一次只允许连接一个设备.** ## 3查看IP地址 > 备注: 这部分其实不是很必要, 但是可以让你多学一点知识. > > ESP-CAM的默认IP就是**192.168.4.1** , 这个不会变. 如果你的操作系统不是Ubuntu可以跳过此部分. 所谓`网关(Gateway)`其实本质上就是**ESP-CAM的IP地址**. 如果你使用的是Ubuntu操作系统, 你可以通过如下命令行查看网关: ```bash ip route show ``` ![IP route show](./IMG/ip-route-show.png) 可以看到当前的ESP-CAM对应的IP地址是**192.168.4.1**. 执行下面的语句 ``` ifconfig ``` 我们可以看到, 当前PC分配到的IP地址为**192.168.4.2** ![ifconfig](./IMG/ifconfig.png) ## 4浏览图片/视频流 打开浏览器, 直接输入**192.168.4.1** 会显示视频流, 画面会实时刷新. ![jpg](./IMG/jpg_demo_pic.png) ## 5问题与解决方案 声明: 这里所描述的问题, 是我在使用ESP-CAM的过程中踩的坑. **ESP-CAM是一个比较有创意的产品,但是一开始可能会存在一些不稳定, 存在一些硬件缺陷, 希望我们可以用比较包容的心态看待这些问题, 一起让它变得更好.** ### 问题1: Firefox下面访问视频流刷新慢, 部分图像缺失 解决方案: 试一下在Chrome浏览器下访问, 就会好很多. 暂时不知道底层原因. 效果视频见: `./VIDEO/问题1-演示视频.mkv` ### 问题2: 画面怪异 ![bad-issue](./IMG/bad-issue.png) 这个是由于ESP-CAM散热问题导致的, 因为我买的是旧版没带散热片, 所以温度过高,导致感光芯片工作异常. 效果视频见: `./VIDEO/问题2-演示视频.mkv` 解决方案: 1. 拆掉外壳, 添加散热片. 2. 带她(ESP-CAM)吹一下空调.
{ "pile_set_name": "Github" }
form=词 tags= 昨夜月初圆, 今日春才半。 自是元君并旦生, 岂在称遐算。 花诰看加封, 玉斝休辞满。 绮席来年谁与同, 笑揖麻姑伴。
{ "pile_set_name": "Github" }
# OpKernels for data factorization and clustering. licenses(["notice"]) # Apache 2.0 exports_files(["LICENSE"]) package(default_visibility = ["//tensorflow:__subpackages__"]) load("//tensorflow:tensorflow.bzl", "tf_kernel_library") cc_library( name = "all_kernels", deps = [ ":clustering_ops", ":wals_solver_ops", "@protobuf//:protobuf", ], ) cc_library( name = "wals_solver_ops", srcs = ["wals_solver_ops.cc"], deps = [ "//tensorflow/core:framework_headers_lib", "//third_party/eigen3", "@protobuf//:protobuf", ], alwayslink = 1, ) cc_library( name = "clustering_ops", srcs = ["clustering_ops.cc"], deps = [ "//tensorflow/core:framework_headers_lib", "//third_party/eigen3", "@protobuf//:protobuf", ], alwayslink = 1, ) cc_test( name = "clustering_ops_test", srcs = ["clustering_ops_test.cc"], deps = [ ":clustering_ops", "//tensorflow/contrib/factorization:clustering_ops_op_lib", "//tensorflow/core:core_cpu", "//tensorflow/core:framework", "//tensorflow/core:lib", "//tensorflow/core:protos_all_cc", "//tensorflow/core:test", "//tensorflow/core:test_main", "//tensorflow/core:testlib", ], ) filegroup( name = "all_files", srcs = glob( ["**/*"], exclude = [ "**/METADATA", "**/OWNERS", ], ), )
{ "pile_set_name": "Github" }
package org.jsoup.internal; import org.jsoup.helper.Validate; import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.SocketTimeoutException; import java.nio.ByteBuffer; /** * A jsoup internal class (so don't use it as there is no contract API) that enables constraints on an Input Stream, * namely a maximum read size, and the ability to Thread.interrupt() the read. */ public final class ConstrainableInputStream extends BufferedInputStream { private static final int DefaultSize = 1024 * 32; private final boolean capped; private final int maxSize; private long startTime; private long timeout = 0; // optional max time of request private int remaining; private boolean interrupted; private ConstrainableInputStream(InputStream in, int bufferSize, int maxSize) { super(in, bufferSize); Validate.isTrue(maxSize >= 0); this.maxSize = maxSize; remaining = maxSize; capped = maxSize != 0; startTime = System.nanoTime(); } /** * If this InputStream is not already a ConstrainableInputStream, let it be one. * @param in the input stream to (maybe) wrap * @param bufferSize the buffer size to use when reading * @param maxSize the maximum size to allow to be read. 0 == infinite. * @return a constrainable input stream */ public static ConstrainableInputStream wrap(InputStream in, int bufferSize, int maxSize) { return in instanceof ConstrainableInputStream ? (ConstrainableInputStream) in : new ConstrainableInputStream(in, bufferSize, maxSize); } @Override public int read(byte[] b, int off, int len) throws IOException { if (interrupted || capped && remaining <= 0) return -1; if (Thread.interrupted()) { // interrupted latches, because parse() may call twice (and we still want the thread interupt to clear) interrupted = true; return -1; } if (expired()) throw new SocketTimeoutException("Read timeout"); if (capped && len > remaining) len = remaining; // don't read more than desired, even if available try { final int read = super.read(b, off, len); remaining -= read; return read; } catch (SocketTimeoutException e) { return 0; } } /** * Reads this inputstream to a ByteBuffer. The supplied max may be less than the inputstream's max, to support * reading just the first bytes. */ public ByteBuffer readToByteBuffer(int max) throws IOException { Validate.isTrue(max >= 0, "maxSize must be 0 (unlimited) or larger"); final boolean localCapped = max > 0; // still possibly capped in total stream final int bufferSize = localCapped && max < DefaultSize ? max : DefaultSize; final byte[] readBuffer = new byte[bufferSize]; final ByteArrayOutputStream outStream = new ByteArrayOutputStream(bufferSize); int read; int remaining = max; while (true) { read = read(readBuffer); if (read == -1) break; if (localCapped) { // this local byteBuffer cap may be smaller than the overall maxSize (like when reading first bytes) if (read >= remaining) { outStream.write(readBuffer, 0, remaining); break; } remaining -= read; } outStream.write(readBuffer, 0, read); } return ByteBuffer.wrap(outStream.toByteArray()); } @Override public void reset() throws IOException { super.reset(); remaining = maxSize - markpos; } public ConstrainableInputStream timeout(long startTimeNanos, long timeoutMillis) { this.startTime = startTimeNanos; this.timeout = timeoutMillis * 1000000; return this; } private boolean expired() { if (timeout == 0) return false; final long now = System.nanoTime(); final long dur = now - startTime; return (dur > timeout); } }
{ "pile_set_name": "Github" }
diff --git a/drivers/mfd/tps6591x.c b/drivers/mfd/tps6591x.c index 42d0065..e9d0f86 100755 --- a/drivers/mfd/tps6591x.c +++ b/drivers/mfd/tps6591x.c @@ -385,17 +385,17 @@ static void tps6591x_power_off(void) pr_err("%s(): Setting power off seq\n", __func__); ret = tps6591x_set_bits(dev, TPS6591X_DEVCTRL, DEVCTRL_PWR_OFF_SEQ); if (ret < 0) - return ret; + return; pr_err("%s(): Clearing DEV_SLP\n", __func__); ret = tps6591x_clr_bits(dev, TPS6591X_DEVCTRL, DEVCTRL_DEV_SLP); if (ret < 0) - return ret; + return; pr_err("%s(): Setting device off and clearing dev-on\n", __func__); ret = tps6591x_update(dev, TPS6591X_DEVCTRL, DEVCTRL_DEV_OFF, DEVCTRL_DEV_OFF | DEVCTRL_DEV_ON); - return ret; + return; } static int tps6591x_gpio_get(struct gpio_chip *gc, unsigned offset)
{ "pile_set_name": "Github" }
<Type Name="UpdatePhases" FullName="LineaProSdk.UpdatePhases"> <TypeSignature Language="C#" Value="public enum UpdatePhases" /> <TypeSignature Language="ILAsm" Value=".class public auto ansi sealed UpdatePhases extends System.Enum" /> <AssemblyInfo> <AssemblyName>LineaProSdk</AssemblyName> <AssemblyVersion>0.0.0.0</AssemblyVersion> </AssemblyInfo> <Base> <BaseTypeName>System.Enum</BaseTypeName> </Base> <Docs> <summary>To be added.</summary> <remarks>To be added.</remarks> </Docs> <Members> <Member MemberName="Completing"> <MemberSignature Language="C#" Value="Completing" /> <MemberSignature Language="ILAsm" Value=".field public static literal valuetype LineaProSdk.UpdatePhases Completing = int32(4)" /> <MemberType>Field</MemberType> <AssemblyInfo> <AssemblyVersion>0.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>LineaProSdk.UpdatePhases</ReturnType> </ReturnValue> <Docs> <summary>To be added.</summary> </Docs> </Member> <Member MemberName="Erase"> <MemberSignature Language="C#" Value="Erase" /> <MemberSignature Language="ILAsm" Value=".field public static literal valuetype LineaProSdk.UpdatePhases Erase = int32(1)" /> <MemberType>Field</MemberType> <AssemblyInfo> <AssemblyVersion>0.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>LineaProSdk.UpdatePhases</ReturnType> </ReturnValue> <Docs> <summary>To be added.</summary> </Docs> </Member> <Member MemberName="Finish"> <MemberSignature Language="C#" Value="Finish" /> <MemberSignature Language="ILAsm" Value=".field public static literal valuetype LineaProSdk.UpdatePhases Finish = int32(3)" /> <MemberType>Field</MemberType> <AssemblyInfo> <AssemblyVersion>0.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>LineaProSdk.UpdatePhases</ReturnType> </ReturnValue> <Docs> <summary>To be added.</summary> </Docs> </Member> <Member MemberName="Init"> <MemberSignature Language="C#" Value="Init" /> <MemberSignature Language="ILAsm" Value=".field public static literal valuetype LineaProSdk.UpdatePhases Init = int32(0)" /> <MemberType>Field</MemberType> <AssemblyInfo> <AssemblyVersion>0.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>LineaProSdk.UpdatePhases</ReturnType> </ReturnValue> <Docs> <summary>To be added.</summary> </Docs> </Member> <Member MemberName="Write"> <MemberSignature Language="C#" Value="Write" /> <MemberSignature Language="ILAsm" Value=".field public static literal valuetype LineaProSdk.UpdatePhases Write = int32(2)" /> <MemberType>Field</MemberType> <AssemblyInfo> <AssemblyVersion>0.0.0.0</AssemblyVersion> </AssemblyInfo> <ReturnValue> <ReturnType>LineaProSdk.UpdatePhases</ReturnType> </ReturnValue> <Docs> <summary>To be added.</summary> </Docs> </Member> </Members> </Type>
{ "pile_set_name": "Github" }
-define(TEST_DATA_DIR, "../../../../test/data").
{ "pile_set_name": "Github" }
import isFunction from 'tui-code-snippet/type/isFunction'; import forEachOwnProperties from 'tui-code-snippet/collection/forEachOwnProperties'; import { getMdStartLine, getMdStartCh, getMdEndLine, getMdEndCh, addChPos, setChPos } from './utils/markdown'; const CLS_PREFIX = 'tui-md-'; const classNameMap = applyClsToValue({ DELIM: 'delimiter', META: 'meta', TEXT: 'marked-text', THEMATIC_BREAK: 'thematic-break', CODE_BLOCK: 'code-block', TABLE: 'table', HTML: 'html' }); const delimSize = { strong: 2, emph: 1, strike: 2 }; function cls(...names) { return names.map(className => `${CLS_PREFIX}${className}`).join(' '); } function applyClsToValue(obj) { forEachOwnProperties(obj, (value, key) => { obj[key] = cls(value); }); return obj; } function markInfo(start, end, className) { return { start, end, className }; } function heading({ level, headingType }, start, end) { const marks = [markInfo(start, end, cls('heading', `heading${level}`))]; if (headingType === 'atx') { marks.push(markInfo(start, addChPos(start, level), classNameMap.DELIM)); } else { marks.push(markInfo(setChPos(end, 0), end, `${classNameMap.DELIM} setext`)); } return { marks }; } function emphasisAndStrikethrough({ type }, start, end) { return { marks: [ markInfo(start, end, cls(`${type}`)), markInfo(start, addChPos(start, delimSize[type]), classNameMap.DELIM), markInfo(addChPos(end, -delimSize[type]), end, classNameMap.DELIM) ] }; } function markLink(start, end, linkTextStart, lastChildCh) { return [ markInfo(start, end, cls('link')), markInfo(linkTextStart, setChPos(end, lastChildCh), cls('link-desc')), markInfo( setChPos(start, linkTextStart.ch + 1), setChPos(end, lastChildCh - 1), classNameMap.TEXT ), markInfo(setChPos(end, lastChildCh), end, cls('link-url')), markInfo(setChPos(end, lastChildCh + 1), addChPos(end, -1), classNameMap.TEXT) ]; } function image({ lastChild }, start, end) { const lastChildCh = lastChild ? getMdEndCh(lastChild) + 1 : 3; // 3: length of '![]' const linkTextEnd = addChPos(start, 1); return { marks: [ markInfo(start, linkTextEnd, classNameMap.META), ...markLink(start, end, linkTextEnd, lastChildCh) ] }; } function link({ lastChild, extendedAutolink }, start, end) { const lastChildCh = lastChild ? getMdEndCh(lastChild) + 1 : 2; // 2: length of '[]' const marks = extendedAutolink ? [markInfo(start, end, `${cls('link', 'link-desc')} ${classNameMap.TEXT}`)] : markLink(start, end, start, lastChildCh); return { marks }; } function code({ tickCount }, start, end) { const openDelimEnd = addChPos(start, tickCount); const closeDelimStart = addChPos(end, -tickCount); return { marks: [ markInfo(start, end, cls('code')), markInfo(start, openDelimEnd, `${classNameMap.DELIM} start`), markInfo(openDelimEnd, closeDelimStart, classNameMap.TEXT), markInfo(closeDelimStart, end, `${classNameMap.DELIM} end`) ] }; } function codeBlock(node, start, end, endLine) { const { fenceOffset, fenceLength, fenceChar, info, infoPadding, parent } = node; const fenceEnd = fenceOffset + fenceLength; const marks = [markInfo(setChPos(start, 0), end, classNameMap.CODE_BLOCK)]; if (fenceChar) { marks.push(markInfo(start, addChPos(start, fenceEnd), classNameMap.DELIM)); } if (info) { marks.push( markInfo( setChPos(start, fenceEnd), setChPos(start, fenceEnd + infoPadding + info.length), classNameMap.META ) ); } const codeBlockEnd = `^(\\s{0,3})(${fenceChar}{${fenceLength},})`; const CLOSED_RX = new RegExp(codeBlockEnd); if (CLOSED_RX.test(endLine)) { marks.push(markInfo(setChPos(end, 0), end, classNameMap.DELIM)); } const lineBackground = parent.type !== 'item' && parent.type !== 'blockQuote' ? { start: start.line, end: end.line, className: classNameMap.CODE_BLOCK } : null; return { marks, lineBackground: { ...lineBackground } }; } function markListItemChildren(node, className) { const marks = []; while (node) { const { type } = node; if (type === 'paragraph' || type === 'codeBlock') { marks.push( markInfo( { line: getMdStartLine(node) - 1, ch: getMdStartCh(node) - 1 }, { line: getMdEndLine(node) - 1, ch: getMdEndCh(node) }, className ) ); } node = node.next; } return marks; } function markParagraphInBlockQuote(node) { const marks = []; while (node) { marks.push( markInfo( { line: getMdStartLine(node) - 1, ch: getMdStartCh(node) - 1 }, { line: getMdEndLine(node) - 1, ch: getMdEndCh(node) }, classNameMap.TEXT ) ); node = node.next; } return marks; } function blockQuote(node, start, end) { let marks = node.parent && node.parent.type !== 'blockQuote' ? [markInfo(start, end, cls('block-quote'))] : []; if (node.firstChild) { let childMarks = []; if (node.firstChild.type === 'paragraph') { childMarks = markParagraphInBlockQuote(node.firstChild.firstChild, classNameMap.TEXT); } else if (node.firstChild.type === 'list') { childMarks = markListItemChildren(node.firstChild, classNameMap.TEXT); } marks = [...marks, ...childMarks]; } return { marks }; } function getClassNameOfListItem(node) { let depth = 0; while (node.parent.parent && node.parent.parent.type === 'item') { node = node.parent.parent; depth += 1; } const newClassName = ['list-item-odd', 'list-item-even'][depth % 2]; // @TODO remove it in the next major version // these class names are for the legacy style 'old.css' const oldClassName = ['fisrt', 'second', 'third'][depth % 3]; return `${cls('list-item', `${newClassName}`)} ${oldClassName}`; } function item(node, start) { const itemClassName = getClassNameOfListItem(node); const { padding, task } = node.listData; return { marks: [ markInfo(start, addChPos(start, padding), `${itemClassName} ${cls('list-item-bullet')}`), ...(task ? [ markInfo( addChPos(start, padding), addChPos(start, padding + 3), `${itemClassName} ${classNameMap.DELIM}` ), markInfo(addChPos(start, padding + 1), addChPos(start, padding + 2), classNameMap.META) ] : []), ...markListItemChildren(node.firstChild, `${itemClassName} ${classNameMap.TEXT}`) ] }; } const markNodeFuncMap = { heading, strong: emphasisAndStrikethrough, emph: emphasisAndStrikethrough, strike: emphasisAndStrikethrough, link, image, code, codeBlock, blockQuote, item }; const simpleMarkClassNameMap = { thematicBreak: classNameMap.THEMATIC_BREAK, table: classNameMap.TABLE, tableCell: classNameMap.TEXT, htmlInline: classNameMap.HTML }; /** * Gets mark information to the markdown node. * @param {Object} node - node returned from ToastMark * @param {Object} start - start node's data * @param {Object} end - end node's data * @param {Object} endLine - end line's data * @returns {?Object} mark information * @ignore */ export function getMarkInfo(node, start, end, endLine) { const { type } = node; if (isFunction(markNodeFuncMap[type])) { return markNodeFuncMap[type](node, start, end, endLine); } if (simpleMarkClassNameMap[type]) { return { marks: [markInfo(start, end, simpleMarkClassNameMap[type])] }; } return null; }
{ "pile_set_name": "Github" }
// // File.m // // // Created by life on 15/6/14. // // #import "CellInfo.h" @implementation CellInfo static CellInfo *cellInfo = nil; + (CellInfo *) getCellInfo:(Notebook *) notebook { // if (!cellInfo) { // cellInfo = [[CellInfo alloc] init]; // } // 不能是单例, 不然文字宽度都是一样的! CellInfo *cellInfo = [[CellInfo alloc] init]; // cellInfo.idd = notebook.notebookId; cellInfo.title = notebook.title; cellInfo.count = notebook.noteCount; cellInfo.isDirty = [notebook.isDirty boolValue]; cellInfo.status = notebook.status; return cellInfo; } + (CellInfo *) getCellInfoByTag:(Tag *) tag { // if (!cellInfo) { // cellInfo = [[CellInfo alloc] init]; // } // 不能是单例, 不然文字宽度都是一样的! CellInfo *cellInfo = [[CellInfo alloc] init]; cellInfo.title = tag.title; cellInfo.count = tag.noteCount; cellInfo.isDirty = [tag.isDirty boolValue]; cellInfo.status = tag.status; return cellInfo; } @end
{ "pile_set_name": "Github" }
package com.github.eclipsecolortheme.mapper; import org.eclipse.core.runtime.preferences.IEclipsePreferences; import org.osgi.service.prefs.Preferences; import com.github.eclipsecolortheme.ColorThemeMapping; import com.github.eclipsecolortheme.ColorThemeSetting; public class StatetBaseEditorMapper extends GenericMapper { private class Mapping extends ColorThemeMapping { public Mapping(String pluginKey, String themeKey) { super(pluginKey, themeKey); } @Override public void putPreferences(IEclipsePreferences preferences, ColorThemeSetting setting) { if (pluginKey.startsWith("editors/options/")) { Preferences pref = preferences.parent().node("de.walware.statet.base.ui/editors/options"); pref.put(pluginKey.substring(16), setting.getColor().asRGB()); } else { preferences.put(pluginKey, setting.getColor().asRGB()); } } } @Override protected ColorThemeMapping createMapping(String pluginKey, String themeKey) { return new Mapping(pluginKey, themeKey); } }
{ "pile_set_name": "Github" }
--TEST-- Test array_column() function: error conditions --FILE-- <?php /* Prototype: * array array_column(array $input, mixed $column_key[, mixed $index_key]); * Description: * Returns an array containing all the values from * the specified "column" in a two-dimensional array. */ echo "*** Testing array_column() : error conditions ***\n"; echo "\n-- Testing array_column() function with Zero arguments --\n"; var_dump(array_column()); echo "\n-- Testing array_column() function with One argument --\n"; var_dump(array_column(array())); echo "\n-- Testing array_column() function with string as first parameter --\n"; var_dump(array_column('foo', 0)); echo "\n-- Testing array_column() function with int as first parameter --\n"; var_dump(array_column(1, 'foo')); echo "\n-- Testing array_column() column key parameter should be a string or an integer (testing bool) --\n"; var_dump(array_column(array(), true)); echo "\n-- Testing array_column() column key parameter should be a string or integer (testing array) --\n"; var_dump(array_column(array(), array())); echo "\n-- Testing array_column() index key parameter should be a string or an integer (testing bool) --\n"; var_dump(array_column(array(), 'foo', true)); echo "\n-- Testing array_column() index key parameter should be a string or integer (testing array) --\n"; var_dump(array_column(array(), 'foo', array())); echo "Done\n"; ?> --EXPECTF-- *** Testing array_column() : error conditions *** -- Testing array_column() function with Zero arguments -- Warning: array_column() expects at least 2 parameters, 0 given in %s on line %d NULL -- Testing array_column() function with One argument -- Warning: array_column() expects at least 2 parameters, 1 given in %s on line %d NULL -- Testing array_column() function with string as first parameter -- Warning: array_column() expects parameter 1 to be array, string given in %s on line %d NULL -- Testing array_column() function with int as first parameter -- Warning: array_column() expects parameter 1 to be array, integer given in %s on line %d NULL -- Testing array_column() column key parameter should be a string or an integer (testing bool) -- Warning: array_column(): The column key should be either a string or an integer in %s on line %d bool(false) -- Testing array_column() column key parameter should be a string or integer (testing array) -- Warning: array_column(): The column key should be either a string or an integer in %s on line %d bool(false) -- Testing array_column() index key parameter should be a string or an integer (testing bool) -- Warning: array_column(): The index key should be either a string or an integer in %s on line %d bool(false) -- Testing array_column() index key parameter should be a string or integer (testing array) -- Warning: array_column(): The index key should be either a string or an integer in %s on line %d bool(false) Done
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="wrap_content" android:id="@+id/daimajia_indicator_wrapper" android:layout_gravity="center" android:layout_height="wrap_content"> </LinearLayout>
{ "pile_set_name": "Github" }
class Foo { as: i32; declare: i32; delete: i32; from: i32; for: i32; get: i32; instanceof: i32; is: i32; keyof: i32; module: i32; namespace: i32; null: i32; readonly: i32; set: i32; type: i32; void: i32; } var as: i32; var constructor: i32; var declare: i32; var from: i32; var get: i32; var is: i32; var keyof: i32; var module: i32; var namespace: i32; var readonly: i32; var set: i32; // -- illegal -- // var delete: i32; // var for: i32; // var instanceof: i32; // var null: i32; // var type: i32; // var void: i32;
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#FF4444"> <LinearLayout android:id="@+id/view_list_repo_action_container" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="right" android:orientation="horizontal"> <TextView android:id="@+id/view_list_repo_action_delete" android:layout_width="80dp" android:layout_height="match_parent" android:gravity="center" android:padding="@dimen/x12" android:text="Delete" android:textColor="@android:color/white"/> <TextView android:id="@+id/view_list_repo_action_update" android:layout_width="@dimen/x80" android:layout_height="match_parent" android:background="#8BC34A" android:gravity="center" android:padding="@dimen/x12" android:text="Refresh" android:textColor="@android:color/white"/> </LinearLayout> </FrameLayout>
{ "pile_set_name": "Github" }
/* * Copyright (C) 2013 Manuel Peinado * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.manuelpeinado.quickreturnheader; import android.view.View; import android.widget.AbsListView; import android.widget.AbsListView.OnScrollListener; import android.widget.ListView; public class ListViewScrollObserver implements OnScrollListener { private OnListViewScrollListener listener; private int lastFirstVisibleItem; private int lastTop; private int scrollPosition; private int lastHeight; public interface OnListViewScrollListener { void onScrollUpDownChanged(int delta, int scrollPosition, boolean exact); void onScrollIdle(); } public ListViewScrollObserver(ListView listView) { listView.setOnScrollListener(this); } public void setOnScrollUpAndDownListener(OnListViewScrollListener listener) { this.listener = listener; } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { View firstChild = view.getChildAt(0); if (firstChild == null) { return; } int top = firstChild.getTop(); int height = firstChild.getHeight(); int delta; int skipped = 0; if (lastFirstVisibleItem == firstVisibleItem) { delta = lastTop - top; } else if (firstVisibleItem > lastFirstVisibleItem) { skipped = firstVisibleItem - lastFirstVisibleItem - 1; delta = skipped * height + lastHeight + lastTop - top; } else { skipped = lastFirstVisibleItem - firstVisibleItem - 1; delta = skipped * -height + lastTop - (height + top); } boolean exact = skipped > 0; scrollPosition += -delta; if (listener != null) { listener.onScrollUpDownChanged(-delta, scrollPosition, exact); } lastFirstVisibleItem = firstVisibleItem; lastTop = top; lastHeight = firstChild.getHeight(); } @Override public void onScrollStateChanged(AbsListView view, int scrollState) { if (listener != null && scrollState == SCROLL_STATE_IDLE) { listener.onScrollIdle(); } } }
{ "pile_set_name": "Github" }
# What: WebVTT # Why: To allow formats intended for marking up external text track resources. # http://dev.w3.org/html5/webvtt/ # Added by: niftylettuce text/vtt vtt # What: Google Chrome Extension # Why: To allow apps to (work) be served with the right content type header. # http://codereview.chromium.org/2830017 # Added by: niftylettuce application/x-chrome-extension crx # What: HTC support # Why: To properly render .htc files such as CSS3PIE # Added by: niftylettuce text/x-component htc # What: HTML5 application cache manifest # Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps # per https://developer.mozilla.org/en/offline_resources_in_firefox # Added by: louisremi text/cache-manifest appcache manifest # What: node binary buffer format # Why: semi-standard extension w/in the node community # Added by: tootallnate application/octet-stream buffer # What: The "protected" MP-4 formats used by iTunes. # Why: Required for streaming music to browsers (?) # Added by: broofa application/mp4 m4p audio/mp4 m4a # What: Video format, Part of RFC1890 # Why: See https://github.com/bentomas/node-mime/pull/6 # Added by: mjrusso video/MP2T ts # What: EventSource mime type # Why: mime type of Server-Sent Events stream # http://www.w3.org/TR/eventsource/#text-event-stream # Added by: francois2metz text/event-stream event-stream # What: Mozilla App manifest mime type # Why: https://developer.mozilla.org/en/Apps/Manifest#Serving_manifests # Added by: ednapiranha application/x-web-app-manifest+json webapp # What: Lua file types # Why: Googling around shows de-facto consensus on these # Added by: creationix (Issue #45) text/x-lua lua application/x-lua-bytecode luac # What: Markdown files, as per http://daringfireball.net/projects/markdown/syntax # Why: http://stackoverflow.com/questions/10701983/what-is-the-mime-type-for-markdown # Added by: avoidwork text/x-markdown markdown md mkd
{ "pile_set_name": "Github" }
// // MASConstraint.h // Masonry // // Created by Jonas Budelmann on 20/07/13. // Copyright (c) 2013 cloudling. All rights reserved. // #import "MASViewAttribute.h" #import "MASConstraint.h" #import "MASLayoutConstraint.h" #import "MASUtilities.h" /** * A single constraint. * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view */ @interface MASViewConstraint : MASConstraint <NSCopying> /** * First item/view and first attribute of the NSLayoutConstraint */ @property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute; /** * Second item/view and second attribute of the NSLayoutConstraint */ @property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute; /** * initialises the MASViewConstraint with the first part of the equation * * @param firstViewAttribute view.mas_left, view.mas_width etc. * * @return a new view constraint */ - (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute; /** * Returns all MASViewConstraints installed with this view as a first item. * * @param view A view to retrieve constraints for. * * @return An array of MASViewConstraints. */ + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view; @end
{ "pile_set_name": "Github" }
/* * Copyright (C) 2013, 2015 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include "JSInjectedScriptHostPrototype.h" #include "Error.h" #include "GetterSetter.h" #include "Identifier.h" #include "InjectedScriptHost.h" #include "JSCInlines.h" #include "JSFunction.h" #include "JSInjectedScriptHost.h" using namespace JSC; namespace Inspector { static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionSubtype(ExecState*); static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionFunctionDetails(ExecState*); static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionGetInternalProperties(ExecState*); static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionInternalConstructorName(ExecState*); static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection(ExecState*); static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakMapSize(ExecState*); static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakMapEntries(ExecState*); static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakSetSize(ExecState*); static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakSetEntries(ExecState*); static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionIteratorEntries(ExecState*); static EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeAttributeEvaluate(ExecState*); const ClassInfo JSInjectedScriptHostPrototype::s_info = { "InjectedScriptHost", &Base::s_info, 0, CREATE_METHOD_TABLE(JSInjectedScriptHostPrototype) }; void JSInjectedScriptHostPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject) { Base::finishCreation(vm); ASSERT(inherits(info())); vm.prototypeMap.addPrototype(this); JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("subtype", jsInjectedScriptHostPrototypeFunctionSubtype, DontEnum, 1); JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("functionDetails", jsInjectedScriptHostPrototypeFunctionFunctionDetails, DontEnum, 1); JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("getInternalProperties", jsInjectedScriptHostPrototypeFunctionGetInternalProperties, DontEnum, 1); JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("internalConstructorName", jsInjectedScriptHostPrototypeFunctionInternalConstructorName, DontEnum, 1); JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("isHTMLAllCollection", jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection, DontEnum, 1); JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("weakMapSize", jsInjectedScriptHostPrototypeFunctionWeakMapSize, DontEnum, 1); JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("weakMapEntries", jsInjectedScriptHostPrototypeFunctionWeakMapEntries, DontEnum, 1); JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("weakSetSize", jsInjectedScriptHostPrototypeFunctionWeakSetSize, DontEnum, 1); JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("weakSetEntries", jsInjectedScriptHostPrototypeFunctionWeakSetEntries, DontEnum, 1); JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("iteratorEntries", jsInjectedScriptHostPrototypeFunctionIteratorEntries, DontEnum, 1); Identifier evaluateIdentifier = Identifier::fromString(&vm, "evaluate"); GetterSetter* accessor = GetterSetter::create(vm, globalObject); JSFunction* function = JSFunction::create(vm, globalObject, 0, evaluateIdentifier.string(), jsInjectedScriptHostPrototypeAttributeEvaluate); accessor->setGetter(vm, globalObject, function); putDirectNonIndexAccessor(vm, evaluateIdentifier, accessor, DontEnum | Accessor); } EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeAttributeEvaluate(ExecState* exec) { JSValue thisValue = exec->thisValue(); JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue); if (!castedThis) return throwVMTypeError(exec); ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); return JSValue::encode(castedThis->evaluate(exec)); } EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionInternalConstructorName(ExecState* exec) { JSValue thisValue = exec->thisValue(); JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue); if (!castedThis) return throwVMTypeError(exec); ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); return JSValue::encode(castedThis->internalConstructorName(exec)); } EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionIsHTMLAllCollection(ExecState* exec) { JSValue thisValue = exec->thisValue(); JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue); if (!castedThis) return throwVMTypeError(exec); ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); return JSValue::encode(castedThis->isHTMLAllCollection(exec)); } EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakMapSize(ExecState* exec) { JSValue thisValue = exec->thisValue(); JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue); if (!castedThis) return throwVMTypeError(exec); ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); return JSValue::encode(castedThis->weakMapSize(exec)); } EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakMapEntries(ExecState* exec) { JSValue thisValue = exec->thisValue(); JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue); if (!castedThis) return throwVMTypeError(exec); ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); return JSValue::encode(castedThis->weakMapEntries(exec)); } EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakSetSize(ExecState* exec) { JSValue thisValue = exec->thisValue(); JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue); if (!castedThis) return throwVMTypeError(exec); ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); return JSValue::encode(castedThis->weakSetSize(exec)); } EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionWeakSetEntries(ExecState* exec) { JSValue thisValue = exec->thisValue(); JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue); if (!castedThis) return throwVMTypeError(exec); ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); return JSValue::encode(castedThis->weakSetEntries(exec)); } EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionIteratorEntries(ExecState* exec) { JSValue thisValue = exec->thisValue(); JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue); if (!castedThis) return throwVMTypeError(exec); ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); return JSValue::encode(castedThis->iteratorEntries(exec)); } EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionSubtype(ExecState* exec) { JSValue thisValue = exec->thisValue(); JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue); if (!castedThis) return throwVMTypeError(exec); ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); return JSValue::encode(castedThis->subtype(exec)); } EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionFunctionDetails(ExecState* exec) { JSValue thisValue = exec->thisValue(); JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue); if (!castedThis) return throwVMTypeError(exec); ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); return JSValue::encode(castedThis->functionDetails(exec)); } EncodedJSValue JSC_HOST_CALL jsInjectedScriptHostPrototypeFunctionGetInternalProperties(ExecState* exec) { JSValue thisValue = exec->thisValue(); JSInjectedScriptHost* castedThis = jsDynamicCast<JSInjectedScriptHost*>(thisValue); if (!castedThis) return throwVMTypeError(exec); ASSERT_GC_OBJECT_INHERITS(castedThis, JSInjectedScriptHost::info()); return JSValue::encode(castedThis->getInternalProperties(exec)); } } // namespace Inspector
{ "pile_set_name": "Github" }
import { IconDefinition, IconPrefix, IconName } from "@fortawesome/fontawesome-common-types"; export const definition: IconDefinition; export const faUserCircle: IconDefinition; export const prefix: IconPrefix; export const iconName: IconName; export const width: number; export const height: number; export const ligatures: string[]; export const unicode: string; export const svgPathData: string;
{ "pile_set_name": "Github" }
// Package godo is the DigtalOcean API v2 client for Go. package godo
{ "pile_set_name": "Github" }
const fetchFullProjectCache = require(`./fetchFullProjectCache`); const SourceProject = require(`../model/SourceProject`); const getProjectTags = require(`./getProjectTags`); /** * Fetch all the projects in a given category. * Resolves to an object like { projects: [...], errors: [...] }. * Should never return a rejection. */ module.exports = function fetchAllFullProjects( githubClient, categoryData, cache ) { if (!categoryData.projects) { return Promise.resolve({ projects: [], errors: [] }); } const sourceProjects = categoryData.projects .filter(x => !x.deprecated) .map(url => new SourceProject(url)); let promise = Promise.resolve({ projects: [], errors: [], }); sourceProjects.forEach(sourceProject => { const index = sourceProjects.indexOf(sourceProject); promise = promise.then( info => // This promise is always resolved. // If there is an error while fetching a full project, we simply do not include that // project in the results. new Promise(resolve => { fetchFullProjectCache( githubClient, sourceProject, categoryData.fetchPackageJson, cache, index, sourceProjects.length ) .then(project => { project.tags = (project.tags || []).concat( getProjectTags(project, categoryData.tags) ); resolve({ projects: info.projects.concat(project), errors: info.errors, }); }) .catch(err => { console.error( `Error fetching project ${sourceProject.githubPath}`, err ); resolve({ projects: info.projects, errors: info.errors.concat(err), }); }); }) ); }); return promise; };
{ "pile_set_name": "Github" }
package main // Copyright 2017 Microsoft Corporation // // 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. import ( "crypto/rsa" "crypto/x509" "encoding/json" "flag" "fmt" "io/ioutil" "log" "net/http" "strings" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/adal" "github.com/Azure/go-autorest/autorest/azure" "golang.org/x/crypto/pkcs12" ) const ( resourceGroupURLTemplate = "https://management.azure.com" apiVersion = "2015-01-01" nativeAppClientID = "a87032a7-203c-4bf7-913c-44c50d23409a" resource = "https://management.core.windows.net/" ) var ( mode string tenantID string subscriptionID string applicationID string tokenCachePath string forceRefresh bool impatient bool certificatePath string ) func init() { flag.StringVar(&mode, "mode", "device", "mode of operation for SPT creation") flag.StringVar(&certificatePath, "certificatePath", "", "path to pk12/pfx certificate") flag.StringVar(&applicationID, "applicationId", "", "application id") flag.StringVar(&tenantID, "tenantId", "", "tenant id") flag.StringVar(&subscriptionID, "subscriptionId", "", "subscription id") flag.StringVar(&tokenCachePath, "tokenCachePath", "", "location of oauth token cache") flag.BoolVar(&forceRefresh, "forceRefresh", false, "pass true to force a token refresh") flag.Parse() log.Printf("mode(%s) certPath(%s) appID(%s) tenantID(%s), subID(%s)\n", mode, certificatePath, applicationID, tenantID, subscriptionID) if mode == "certificate" && (strings.TrimSpace(tenantID) == "" || strings.TrimSpace(subscriptionID) == "") { log.Fatalln("Bad usage. Using certificate mode. Please specify tenantID, subscriptionID") } if mode != "certificate" && mode != "device" { log.Fatalln("Bad usage. Mode must be one of 'certificate' or 'device'.") } if mode == "device" && strings.TrimSpace(applicationID) == "" { log.Println("Using device mode auth. Will use `azkube` clientID since none was specified on the comand line.") applicationID = nativeAppClientID } if mode == "certificate" && strings.TrimSpace(certificatePath) == "" { log.Fatalln("Bad usage. Mode 'certificate' requires the 'certificatePath' argument.") } if strings.TrimSpace(tenantID) == "" || strings.TrimSpace(subscriptionID) == "" || strings.TrimSpace(applicationID) == "" { log.Fatalln("Bad usage. Must specify the 'tenantId' and 'subscriptionId'") } } func getSptFromCachedToken(oauthConfig adal.OAuthConfig, clientID, resource string, callbacks ...adal.TokenRefreshCallback) (*adal.ServicePrincipalToken, error) { token, err := adal.LoadToken(tokenCachePath) if err != nil { return nil, fmt.Errorf("failed to load token from cache: %v", err) } spt, _ := adal.NewServicePrincipalTokenFromManualToken( oauthConfig, clientID, resource, *token, callbacks...) return spt, nil } func decodePkcs12(pkcs []byte, password string) (*x509.Certificate, *rsa.PrivateKey, error) { privateKey, certificate, err := pkcs12.Decode(pkcs, password) if err != nil { return nil, nil, err } rsaPrivateKey, isRsaKey := privateKey.(*rsa.PrivateKey) if !isRsaKey { return nil, nil, fmt.Errorf("PKCS#12 certificate must contain an RSA private key") } return certificate, rsaPrivateKey, nil } func getSptFromCertificate(oauthConfig adal.OAuthConfig, clientID, resource, certicatePath string, callbacks ...adal.TokenRefreshCallback) (*adal.ServicePrincipalToken, error) { certData, err := ioutil.ReadFile(certificatePath) if err != nil { return nil, fmt.Errorf("failed to read the certificate file (%s): %v", certificatePath, err) } certificate, rsaPrivateKey, err := decodePkcs12(certData, "") if err != nil { return nil, fmt.Errorf("failed to decode pkcs12 certificate while creating spt: %v", err) } spt, _ := adal.NewServicePrincipalTokenFromCertificate( oauthConfig, clientID, certificate, rsaPrivateKey, resource, callbacks...) return spt, nil } func getSptFromDeviceFlow(oauthConfig adal.OAuthConfig, clientID, resource string, callbacks ...adal.TokenRefreshCallback) (*adal.ServicePrincipalToken, error) { oauthClient := &autorest.Client{} deviceCode, err := adal.InitiateDeviceAuth(oauthClient, oauthConfig, clientID, resource) if err != nil { return nil, fmt.Errorf("failed to start device auth flow: %s", err) } fmt.Println(*deviceCode.Message) token, err := adal.WaitForUserCompletion(oauthClient, deviceCode) if err != nil { return nil, fmt.Errorf("failed to finish device auth flow: %s", err) } spt, err := adal.NewServicePrincipalTokenFromManualToken( oauthConfig, clientID, resource, *token, callbacks...) if err != nil { return nil, fmt.Errorf("failed to get oauth token from device flow: %v", err) } return spt, nil } func printResourceGroups(client *autorest.Client) error { p := map[string]interface{}{"subscription-id": subscriptionID} q := map[string]interface{}{"api-version": apiVersion} req, _ := autorest.Prepare(&http.Request{}, autorest.AsGet(), autorest.WithBaseURL(resourceGroupURLTemplate), autorest.WithPathParameters("/subscriptions/{subscription-id}/resourcegroups", p), autorest.WithQueryParameters(q)) resp, err := autorest.SendWithSender(client, req) if err != nil { return err } value := struct { ResourceGroups []struct { Name string `json:"name"` } `json:"value"` }{} defer resp.Body.Close() dec := json.NewDecoder(resp.Body) err = dec.Decode(&value) if err != nil { return err } var groupNames = make([]string, len(value.ResourceGroups)) for i, name := range value.ResourceGroups { groupNames[i] = name.Name } log.Println("Groups:", strings.Join(groupNames, ", ")) return err } func saveToken(spt adal.Token) { if tokenCachePath != "" { err := adal.SaveToken(tokenCachePath, 0600, spt) if err != nil { log.Println("error saving token", err) } else { log.Println("saved token to", tokenCachePath) } } } func main() { var spt *adal.ServicePrincipalToken var err error callback := func(t adal.Token) error { log.Println("refresh callback was called") saveToken(t) return nil } oauthConfig, err := adal.NewOAuthConfig(azure.PublicCloud.ActiveDirectoryEndpoint, tenantID) if err != nil { panic(err) } if tokenCachePath != "" { log.Println("tokenCachePath specified; attempting to load from", tokenCachePath) spt, err = getSptFromCachedToken(*oauthConfig, applicationID, resource, callback) if err != nil { spt = nil // just in case, this is the condition below log.Println("loading from cache failed:", err) } } if spt == nil { log.Println("authenticating via 'mode'", mode) switch mode { case "device": spt, err = getSptFromDeviceFlow(*oauthConfig, applicationID, resource, callback) case "certificate": spt, err = getSptFromCertificate(*oauthConfig, applicationID, resource, certificatePath, callback) } if err != nil { log.Fatalln("failed to retrieve token:", err) } // should save it as soon as you get it since Refresh won't be called for some time if tokenCachePath != "" { saveToken(spt.Token()) } } client := &autorest.Client{} client.Authorizer = autorest.NewBearerAuthorizer(spt) printResourceGroups(client) if forceRefresh { err = spt.Refresh() if err != nil { panic(err) } printResourceGroups(client) } }
{ "pile_set_name": "Github" }
import { Style } from 'sku/treat'; type SelectorMap = Style['selectors']; export const debugTouchable = ({ after = false } = {}): SelectorMap => process.env.NODE_ENV === 'production' ? {} : { [`[data-braid-debug] &${after ? ':after' : ''}`]: { background: 'red', opacity: 0.2, }, };
{ "pile_set_name": "Github" }
! erlich8.scl ! Two 12-tET scales 15 cents shifted, Paul Erlich 24 ! 15.00000 100.00000 115.00000 200.00000 215.00000 300.00000 315.00000 400.00000 415.00000 500.00000 515.00000 600.00000 615.00000 700.00000 715.00000 800.00000 815.00000 900.00000 915.00000 1000.00000 1015.00000 1100.00000 1115.00000 2/1
{ "pile_set_name": "Github" }
/******************************************************************************* * Copyright (c) 2016 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. *******************************************************************************/ package jsettlers.main.swing.lookandfeel.factory; import java.awt.Graphics2D; import javax.swing.JComponent; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.PanelUI; import jsettlers.main.swing.lookandfeel.DrawHelper; import jsettlers.main.swing.lookandfeel.ELFStyle; import jsettlers.main.swing.lookandfeel.ui.UIDefaults; /** * Panel UI factory * * @author Andreas Butti */ public final class PanelUiFactory { /** * Transparent panel */ private static final PanelUI DEFAULT_PANEL = new PanelUI() { @Override public void installUI(JComponent c) { super.installUI(c); c.setOpaque(false); } }; /** * Half transparent dark panel */ private static final PanelUI DARK_PANEL = new PanelUI() { @Override public void installUI(JComponent c) { super.installUI(c); c.setOpaque(false); } @Override public void paint(java.awt.Graphics g1, JComponent c) { Graphics2D g = DrawHelper.enableAntialiasing(g1); g.setColor(UIDefaults.HALFTRANSPARENT_BLACK); int arc = 15; g.fillRoundRect(0, 0, c.getWidth(), c.getHeight(), arc, arc); } }; /** * Supports transparent background colors */ private static final PanelUI DRAW_PANEL_TRANSPARENT_BACKGROUND = new PanelUI() { @Override public void installUI(JComponent c) { super.installUI(c); c.setOpaque(false); } @Override public void paint(java.awt.Graphics g, JComponent c) { g.setColor(c.getBackground()); g.fillRect(0, 0, c.getWidth(), c.getHeight()); } }; /** * This is only a factory so no objects need to be created. */ private PanelUiFactory() { } /** * Create PLAF * * @param c * Component which need the UI * @return UI */ public static ComponentUI createUI(JComponent c) { if (ELFStyle.PANEL_DARK == c.getClientProperty(ELFStyle.KEY)) { return DARK_PANEL; } if (ELFStyle.PANEL_DRAW_BG_CUSTOM == c.getClientProperty(ELFStyle.KEY)) { return DRAW_PANEL_TRANSPARENT_BACKGROUND; } return DEFAULT_PANEL; } }
{ "pile_set_name": "Github" }
/** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ package com.facebook.react.animation; import android.view.View; /** * Subclass of {@link AnimationPropertyUpdater} for animating view's rotation */ public class RotationAnimationPropertyUpdater extends AbstractSingleFloatProperyUpdater { public RotationAnimationPropertyUpdater(float toValue) { super(toValue); } @Override protected float getProperty(View view) { return view.getRotation(); } @Override protected void setProperty(View view, float propertyValue) { view.setRotation((float) Math.toDegrees(propertyValue)); } }
{ "pile_set_name": "Github" }
/* Copyright The containerd 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 sysx import ( "syscall" ) const ENODATA = syscall.ENODATA
{ "pile_set_name": "Github" }
/** Generated Model - DO NOT CHANGE */ package org.compiere.model; import java.math.BigDecimal; import java.sql.ResultSet; import java.util.Properties; /** Generated Model for C_PaySelectionLine * @author Adempiere (generated) */ @SuppressWarnings("javadoc") public class X_C_PaySelectionLine extends org.compiere.model.PO implements I_C_PaySelectionLine, org.compiere.model.I_Persistent { /** * */ private static final long serialVersionUID = 1643620282L; /** Standard Constructor */ public X_C_PaySelectionLine (Properties ctx, int C_PaySelectionLine_ID, String trxName) { super (ctx, C_PaySelectionLine_ID, trxName); /** if (C_PaySelectionLine_ID == 0) { setC_Invoice_ID (0); setC_PaySelection_ID (0); setC_PaySelectionLine_ID (0); setDifferenceAmt (BigDecimal.ZERO); setDiscountAmt (BigDecimal.ZERO); setIsManual (false); setIsSOTrx (false); setLine (0); // @SQL=SELECT COALESCE(MAX(Line),0)+10 AS DefaultValue FROM C_PaySelectionLine WHERE C_PaySelection_ID=@C_PaySelection_ID@ setOpenAmt (BigDecimal.ZERO); setPayAmt (BigDecimal.ZERO); setPaymentRule (null); // P } */ } /** Load Constructor */ public X_C_PaySelectionLine (Properties ctx, ResultSet rs, String trxName) { super (ctx, rs, trxName); } /** Load Meta Data */ @Override protected org.compiere.model.POInfo initPO (Properties ctx) { org.compiere.model.POInfo poi = org.compiere.model.POInfo.getPOInfo (ctx, Table_Name, get_TrxName()); return poi; } /** Set Bankauszug. @param C_BankStatement_ID Bank Statement of account */ @Override public void setC_BankStatement_ID (int C_BankStatement_ID) { if (C_BankStatement_ID < 1) set_Value (COLUMNNAME_C_BankStatement_ID, null); else set_Value (COLUMNNAME_C_BankStatement_ID, Integer.valueOf(C_BankStatement_ID)); } /** Get Bankauszug. @return Bank Statement of account */ @Override public int getC_BankStatement_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_BankStatement_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Auszugs-Position. @param C_BankStatementLine_ID Position auf einem Bankauszug zu dieser Bank */ @Override public void setC_BankStatementLine_ID (int C_BankStatementLine_ID) { if (C_BankStatementLine_ID < 1) set_Value (COLUMNNAME_C_BankStatementLine_ID, null); else set_Value (COLUMNNAME_C_BankStatementLine_ID, Integer.valueOf(C_BankStatementLine_ID)); } /** Get Auszugs-Position. @return Position auf einem Bankauszug zu dieser Bank */ @Override public int getC_BankStatementLine_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_BankStatementLine_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Bankstatementline Reference. @param C_BankStatementLine_Ref_ID Bankstatementline Reference */ @Override public void setC_BankStatementLine_Ref_ID (int C_BankStatementLine_Ref_ID) { if (C_BankStatementLine_Ref_ID < 1) set_Value (COLUMNNAME_C_BankStatementLine_Ref_ID, null); else set_Value (COLUMNNAME_C_BankStatementLine_Ref_ID, Integer.valueOf(C_BankStatementLine_Ref_ID)); } /** Get Bankstatementline Reference. @return Bankstatementline Reference */ @Override public int getC_BankStatementLine_Ref_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_BankStatementLine_Ref_ID); if (ii == null) return 0; return ii.intValue(); } @Override public org.compiere.model.I_C_BP_BankAccount getC_BP_BankAccount() { return get_ValueAsPO(COLUMNNAME_C_BP_BankAccount_ID, org.compiere.model.I_C_BP_BankAccount.class); } @Override public void setC_BP_BankAccount(org.compiere.model.I_C_BP_BankAccount C_BP_BankAccount) { set_ValueFromPO(COLUMNNAME_C_BP_BankAccount_ID, org.compiere.model.I_C_BP_BankAccount.class, C_BP_BankAccount); } /** Set Bankverbindung. @param C_BP_BankAccount_ID Bank Account of the Business Partner */ @Override public void setC_BP_BankAccount_ID (int C_BP_BankAccount_ID) { if (C_BP_BankAccount_ID < 1) set_Value (COLUMNNAME_C_BP_BankAccount_ID, null); else set_Value (COLUMNNAME_C_BP_BankAccount_ID, Integer.valueOf(C_BP_BankAccount_ID)); } /** Get Bankverbindung. @return Bank Account of the Business Partner */ @Override public int getC_BP_BankAccount_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_BP_BankAccount_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Geschäftspartner. @param C_BPartner_ID Bezeichnet einen Geschäftspartner */ @Override public void setC_BPartner_ID (int C_BPartner_ID) { if (C_BPartner_ID < 1) set_ValueNoCheck (COLUMNNAME_C_BPartner_ID, null); else set_ValueNoCheck (COLUMNNAME_C_BPartner_ID, Integer.valueOf(C_BPartner_ID)); } /** Get Geschäftspartner. @return Bezeichnet einen Geschäftspartner */ @Override public int getC_BPartner_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_BPartner_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Währung. @param C_Currency_ID Die Währung für diesen Eintrag */ @Override public void setC_Currency_ID (int C_Currency_ID) { throw new IllegalArgumentException ("C_Currency_ID is virtual column"); } /** Get Währung. @return Die Währung für diesen Eintrag */ @Override public int getC_Currency_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_Currency_ID); if (ii == null) return 0; return ii.intValue(); } @Override public org.compiere.model.I_C_Invoice getC_Invoice() { return get_ValueAsPO(COLUMNNAME_C_Invoice_ID, org.compiere.model.I_C_Invoice.class); } @Override public void setC_Invoice(org.compiere.model.I_C_Invoice C_Invoice) { set_ValueFromPO(COLUMNNAME_C_Invoice_ID, org.compiere.model.I_C_Invoice.class, C_Invoice); } /** Set Rechnung. @param C_Invoice_ID Invoice Identifier */ @Override public void setC_Invoice_ID (int C_Invoice_ID) { if (C_Invoice_ID < 1) set_Value (COLUMNNAME_C_Invoice_ID, null); else set_Value (COLUMNNAME_C_Invoice_ID, Integer.valueOf(C_Invoice_ID)); } /** Get Rechnung. @return Invoice Identifier */ @Override public int getC_Invoice_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_Invoice_ID); if (ii == null) return 0; return ii.intValue(); } @Override public org.compiere.model.I_C_Payment getC_Payment() { return get_ValueAsPO(COLUMNNAME_C_Payment_ID, org.compiere.model.I_C_Payment.class); } @Override public void setC_Payment(org.compiere.model.I_C_Payment C_Payment) { set_ValueFromPO(COLUMNNAME_C_Payment_ID, org.compiere.model.I_C_Payment.class, C_Payment); } /** Set Zahlung. @param C_Payment_ID Zahlung */ @Override public void setC_Payment_ID (int C_Payment_ID) { if (C_Payment_ID < 1) set_Value (COLUMNNAME_C_Payment_ID, null); else set_Value (COLUMNNAME_C_Payment_ID, Integer.valueOf(C_Payment_ID)); } /** Get Zahlung. @return Zahlung */ @Override public int getC_Payment_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_Payment_ID); if (ii == null) return 0; return ii.intValue(); } @Override public org.compiere.model.I_C_PaySelection getC_PaySelection() { return get_ValueAsPO(COLUMNNAME_C_PaySelection_ID, org.compiere.model.I_C_PaySelection.class); } @Override public void setC_PaySelection(org.compiere.model.I_C_PaySelection C_PaySelection) { set_ValueFromPO(COLUMNNAME_C_PaySelection_ID, org.compiere.model.I_C_PaySelection.class, C_PaySelection); } /** Set Zahlung Anweisen. @param C_PaySelection_ID Zahlung Anweisen */ @Override public void setC_PaySelection_ID (int C_PaySelection_ID) { if (C_PaySelection_ID < 1) set_ValueNoCheck (COLUMNNAME_C_PaySelection_ID, null); else set_ValueNoCheck (COLUMNNAME_C_PaySelection_ID, Integer.valueOf(C_PaySelection_ID)); } /** Get Zahlung Anweisen. @return Zahlung Anweisen */ @Override public int getC_PaySelection_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_PaySelection_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Zahlungsauswahl- Position. @param C_PaySelectionLine_ID Payment Selection Line */ @Override public void setC_PaySelectionLine_ID (int C_PaySelectionLine_ID) { if (C_PaySelectionLine_ID < 1) set_ValueNoCheck (COLUMNNAME_C_PaySelectionLine_ID, null); else set_ValueNoCheck (COLUMNNAME_C_PaySelectionLine_ID, Integer.valueOf(C_PaySelectionLine_ID)); } /** Get Zahlungsauswahl- Position. @return Payment Selection Line */ @Override public int getC_PaySelectionLine_ID () { Integer ii = (Integer)get_Value(COLUMNNAME_C_PaySelectionLine_ID); if (ii == null) return 0; return ii.intValue(); } /** Set Beschreibung. @param Description Beschreibung */ @Override public void setDescription (java.lang.String Description) { set_Value (COLUMNNAME_Description, Description); } /** Get Beschreibung. @return Beschreibung */ @Override public java.lang.String getDescription () { return (java.lang.String)get_Value(COLUMNNAME_Description); } /** Set Differenz. @param DifferenceAmt Difference Amount */ @Override public void setDifferenceAmt (java.math.BigDecimal DifferenceAmt) { set_ValueNoCheck (COLUMNNAME_DifferenceAmt, DifferenceAmt); } /** Get Differenz. @return Difference Amount */ @Override public java.math.BigDecimal getDifferenceAmt () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_DifferenceAmt); if (bd == null) return BigDecimal.ZERO; return bd; } /** Set Skonto. @param DiscountAmt Calculated amount of discount */ @Override public void setDiscountAmt (java.math.BigDecimal DiscountAmt) { set_Value (COLUMNNAME_DiscountAmt, DiscountAmt); } /** Get Skonto. @return Calculated amount of discount */ @Override public java.math.BigDecimal getDiscountAmt () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_DiscountAmt); if (bd == null) return BigDecimal.ZERO; return bd; } /** Set Has Open Credit Memo. @param HasOpenCreditMemos Has Open Credit Memo Invoices */ @Override public void setHasOpenCreditMemos (boolean HasOpenCreditMemos) { throw new IllegalArgumentException ("HasOpenCreditMemos is virtual column"); } /** Get Has Open Credit Memo. @return Has Open Credit Memo Invoices */ @Override public boolean isHasOpenCreditMemos () { Object oo = get_Value(COLUMNNAME_HasOpenCreditMemos); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set Has Open Outgoing payments. @param HasOpenOutgoingPayments Has Open Outgoing payments */ @Override public void setHasOpenOutgoingPayments (boolean HasOpenOutgoingPayments) { throw new IllegalArgumentException ("HasOpenOutgoingPayments is virtual column"); } /** Get Has Open Outgoing payments. @return Has Open Outgoing payments */ @Override public boolean isHasOpenOutgoingPayments () { Object oo = get_Value(COLUMNNAME_HasOpenOutgoingPayments); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set Manuell. @param IsManual This is a manual process */ @Override public void setIsManual (boolean IsManual) { set_Value (COLUMNNAME_IsManual, Boolean.valueOf(IsManual)); } /** Get Manuell. @return This is a manual process */ @Override public boolean isManual () { Object oo = get_Value(COLUMNNAME_IsManual); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set Verkaufs-Transaktion. @param IsSOTrx This is a Sales Transaction */ @Override public void setIsSOTrx (boolean IsSOTrx) { set_Value (COLUMNNAME_IsSOTrx, Boolean.valueOf(IsSOTrx)); } /** Get Verkaufs-Transaktion. @return This is a Sales Transaction */ @Override public boolean isSOTrx () { Object oo = get_Value(COLUMNNAME_IsSOTrx); if (oo != null) { if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); return "Y".equals(oo); } return false; } /** Set Zeile Nr.. @param Line Unique line for this document */ @Override public void setLine (int Line) { set_Value (COLUMNNAME_Line, Integer.valueOf(Line)); } /** Get Zeile Nr.. @return Unique line for this document */ @Override public int getLine () { Integer ii = (Integer)get_Value(COLUMNNAME_Line); if (ii == null) return 0; return ii.intValue(); } /** Set Offener Betrag. @param OpenAmt Offener Betrag */ @Override public void setOpenAmt (java.math.BigDecimal OpenAmt) { set_ValueNoCheck (COLUMNNAME_OpenAmt, OpenAmt); } /** Get Offener Betrag. @return Offener Betrag */ @Override public java.math.BigDecimal getOpenAmt () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_OpenAmt); if (bd == null) return BigDecimal.ZERO; return bd; } /** Set Offene Zahlungszuordnung. @param OpenPaymentAllocationForm Offene Zahlungszuordnung */ @Override public void setOpenPaymentAllocationForm (java.lang.String OpenPaymentAllocationForm) { set_Value (COLUMNNAME_OpenPaymentAllocationForm, OpenPaymentAllocationForm); } /** Get Offene Zahlungszuordnung. @return Offene Zahlungszuordnung */ @Override public java.lang.String getOpenPaymentAllocationForm () { return (java.lang.String)get_Value(COLUMNNAME_OpenPaymentAllocationForm); } /** Set Zahlungsbetrag. @param PayAmt Amount being paid */ @Override public void setPayAmt (java.math.BigDecimal PayAmt) { set_Value (COLUMNNAME_PayAmt, PayAmt); } /** Get Zahlungsbetrag. @return Amount being paid */ @Override public java.math.BigDecimal getPayAmt () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_PayAmt); if (bd == null) return BigDecimal.ZERO; return bd; } /** * PaymentRule AD_Reference_ID=195 * Reference name: _Payment Rule */ public static final int PAYMENTRULE_AD_Reference_ID=195; /** Cash = B */ public static final String PAYMENTRULE_Cash = "B"; /** CreditCard = K */ public static final String PAYMENTRULE_CreditCard = "K"; /** DirectDeposit = T */ public static final String PAYMENTRULE_DirectDeposit = "T"; /** Check = S */ public static final String PAYMENTRULE_Check = "S"; /** OnCredit = P */ public static final String PAYMENTRULE_OnCredit = "P"; /** DirectDebit = D */ public static final String PAYMENTRULE_DirectDebit = "D"; /** Mixed = M */ public static final String PAYMENTRULE_Mixed = "M"; /** PayPal = L */ public static final String PAYMENTRULE_PayPal = "L"; /** Set Zahlungsweise. @param PaymentRule How you pay the invoice */ @Override public void setPaymentRule (java.lang.String PaymentRule) { set_Value (COLUMNNAME_PaymentRule, PaymentRule); } /** Get Zahlungsweise. @return How you pay the invoice */ @Override public java.lang.String getPaymentRule () { return (java.lang.String)get_Value(COLUMNNAME_PaymentRule); } /** Set Referenz. @param Reference Bezug für diesen Eintrag */ @Override public void setReference (java.lang.String Reference) { set_Value (COLUMNNAME_Reference, Reference); } /** Get Referenz. @return Bezug für diesen Eintrag */ @Override public java.lang.String getReference () { return (java.lang.String)get_Value(COLUMNNAME_Reference); } }
{ "pile_set_name": "Github" }
### 当代“文字狱” 又一例因拍摄并发布疫情信息被抓(视频) ------------------------ #### [首页](https://github.com/gfw-breaker/banned-news/blob/master/README.md) &nbsp;&nbsp;|&nbsp;&nbsp; [手把手翻墙教程](https://github.com/gfw-breaker/guides/wiki) &nbsp;&nbsp;|&nbsp;&nbsp; [禁闻聚合安卓版](https://github.com/gfw-breaker/bn-android) &nbsp;&nbsp;|&nbsp;&nbsp; [网门安卓版](https://github.com/oGate2/oGate) &nbsp;&nbsp;|&nbsp;&nbsp; [神州正道安卓版](https://github.com/SzzdOgate/update) <div class="article_right" style="fone-color:#000"> <div id="story_video" style="text-align: center;margin-top: 20px;"> </div> <p> 当代的文字狱!中国又一例因拍摄并发布疫情信息被抓。 <span id="hideid" name="hideid" style="color:red;display:none;"> <span href="https://www.secretchina.com"> </span> </span> <center> <div> <div id="txt-mid2-t22-2017" style="display: block; max-height: 351px; overflow: hidden;"> <div id="SC-21xxx"> </div> <ins class="adsbygoogle" data-ad-client="ca-pub-1276641434651360" data-ad-format="auto" data-ad-slot="4301710469" data-full-width-responsive="true" style="display:block"> </ins> </div> </div> </center> <div style="padding-top:12px;"> </div> </p> </div> <hr/> 手机上长按并复制下列链接或二维码分享本文章:<br/> https://github.com/gfw-breaker/banned-news/blob/master/pages/p1/923090.md <br/> <a href='https://github.com/gfw-breaker/banned-news/blob/master/pages/p1/923090.md'><img src='https://github.com/gfw-breaker/banned-news/blob/master/pages/p1/923090.md.png'/></a> <br/> 原文地址(需翻墙访问):https://www.secretchina.com/news/gb/2020/02/15/923090.html ------------------------ #### [首页](https://github.com/gfw-breaker/banned-news/blob/master/README.md) &nbsp;|&nbsp; [一键翻墙软件](https://github.com/gfw-breaker/nogfw/blob/master/README.md) &nbsp;| [《九评共产党》](https://github.com/gfw-breaker/9ping.md/blob/master/README.md#九评之一评共产党是什么) | [《解体党文化》](https://github.com/gfw-breaker/jtdwh.md/blob/master/README.md) | [《共产主义的终极目的》](https://github.com/gfw-breaker/gczydzjmd.md/blob/master/README.md) <img src='http://gfw-breaker.win/banned-news/pages/p1/923090.md' width='0px' height='0px'/>
{ "pile_set_name": "Github" }
#ifndef MAP_SPRITE_H #define MAP_SPRITE_H #include "core/buffer.h" /** * @file * Grid to store bridge/animation sprites. * For the lack of better naming. This grid stores: * 1) for bridges: which bridge part is where * 2) for buildings: which offset in the animation cycle is currently shown */ int map_sprite_animation_at(int grid_offset); void map_sprite_animation_set(int grid_offset, int value); int map_sprite_bridge_at(int grid_offset); void map_sprite_bridge_set(int grid_offset, int value); void map_sprite_clear_tile(int grid_offset); void map_sprite_clear(void); void map_sprite_backup(void); void map_sprite_restore(void); void map_sprite_save_state(buffer *buf, buffer *backup); void map_sprite_load_state(buffer *buf, buffer *backup); #endif // MAP_SPRITE_H
{ "pile_set_name": "Github" }
module Ferry module DSL module Stages def stages Dir[stage_definitions].map { |f| File.basename(f, '.rb') } end def stage_definitions stage_config_path.join('*.rb') end def stage_set? !!fetch(:stage, false) end end end end
{ "pile_set_name": "Github" }
p q r s - o r g _ _ c p p - o s x - s e s s i o n
{ "pile_set_name": "Github" }
// // Licensed under the terms in License.txt // // Copyright 2010 Allen Ding. All rights reserved. // #import "KWBeIdenticalToMatcher.h" #import "KWFormatter.h" @interface KWBeIdenticalToMatcher() #pragma mark - Properties @property (nonatomic, readwrite, strong) id otherSubject; @end @implementation KWBeIdenticalToMatcher #pragma mark - Getting Matcher Strings + (NSArray *)matcherStrings { return @[@"beIdenticalTo:"]; } #pragma mark - Matching - (BOOL)evaluate { return self.subject == self.otherSubject; } #pragma mark - Getting Failure Messages - (NSString *)failureMessageForShould { return [NSString stringWithFormat:@"expected subject to be identical to %@ (%p), got %@ (%p)", [KWFormatter formatObject:self.otherSubject], self.otherSubject, [KWFormatter formatObject:self.subject], self.subject]; } - (NSString *)failureMessageForShouldNot { return [NSString stringWithFormat:@"expected subject not to be identical to %@ (%p)", [KWFormatter formatObject:self.otherSubject], self.otherSubject]; } - (NSString *)description { return [NSString stringWithFormat:@"be identical to %@", self.otherSubject]; } #pragma mark - Configuring Matchers - (void)beIdenticalTo:(id)anObject { self.otherSubject = anObject; } @end
{ "pile_set_name": "Github" }
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2016 Rasmus Munk Larsen (rmlarsen@google.com) // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef EIGEN_CONDITIONESTIMATOR_H #define EIGEN_CONDITIONESTIMATOR_H namespace Eigen { namespace internal { template <typename Vector, typename RealVector, bool IsComplex> struct rcond_compute_sign { static inline Vector run(const Vector& v) { const RealVector v_abs = v.cwiseAbs(); return (v_abs.array() == static_cast<typename Vector::RealScalar>(0)) .select(Vector::Ones(v.size()), v.cwiseQuotient(v_abs)); } }; // Partial specialization to avoid elementwise division for real vectors. template <typename Vector> struct rcond_compute_sign<Vector, Vector, false> { static inline Vector run(const Vector& v) { return (v.array() < static_cast<typename Vector::RealScalar>(0)) .select(-Vector::Ones(v.size()), Vector::Ones(v.size())); } }; /** * \returns an estimate of ||inv(matrix)||_1 given a decomposition of * \a matrix that implements .solve() and .adjoint().solve() methods. * * This function implements Algorithms 4.1 and 5.1 from * http://www.maths.manchester.ac.uk/~higham/narep/narep135.pdf * which also forms the basis for the condition number estimators in * LAPACK. Since at most 10 calls to the solve method of dec are * performed, the total cost is O(dims^2), as opposed to O(dims^3) * needed to compute the inverse matrix explicitly. * * The most common usage is in estimating the condition number * ||matrix||_1 * ||inv(matrix)||_1. The first term ||matrix||_1 can be * computed directly in O(n^2) operations. * * Supports the following decompositions: FullPivLU, PartialPivLU, LDLT, and * LLT. * * \sa FullPivLU, PartialPivLU, LDLT, LLT. */ template <typename Decomposition> typename Decomposition::RealScalar rcond_invmatrix_L1_norm_estimate(const Decomposition& dec) { typedef typename Decomposition::MatrixType MatrixType; typedef typename Decomposition::Scalar Scalar; typedef typename Decomposition::RealScalar RealScalar; typedef typename internal::plain_col_type<MatrixType>::type Vector; typedef typename internal::plain_col_type<MatrixType, RealScalar>::type RealVector; const bool is_complex = (NumTraits<Scalar>::IsComplex != 0); eigen_assert(dec.rows() == dec.cols()); const Index n = dec.rows(); if (n == 0) return 0; // Disable Index to float conversion warning #ifdef __INTEL_COMPILER #pragma warning push #pragma warning ( disable : 2259 ) #endif Vector v = dec.solve(Vector::Ones(n) / Scalar(n)); #ifdef __INTEL_COMPILER #pragma warning pop #endif // lower_bound is a lower bound on // ||inv(matrix)||_1 = sup_v ||inv(matrix) v||_1 / ||v||_1 // and is the objective maximized by the ("super-") gradient ascent // algorithm below. RealScalar lower_bound = v.template lpNorm<1>(); if (n == 1) return lower_bound; // Gradient ascent algorithm follows: We know that the optimum is achieved at // one of the simplices v = e_i, so in each iteration we follow a // super-gradient to move towards the optimal one. RealScalar old_lower_bound = lower_bound; Vector sign_vector(n); Vector old_sign_vector; Index v_max_abs_index = -1; Index old_v_max_abs_index = v_max_abs_index; for (int k = 0; k < 4; ++k) { sign_vector = internal::rcond_compute_sign<Vector, RealVector, is_complex>::run(v); if (k > 0 && !is_complex && sign_vector == old_sign_vector) { // Break if the solution stagnated. break; } // v_max_abs_index = argmax |real( inv(matrix)^T * sign_vector )| v = dec.adjoint().solve(sign_vector); v.real().cwiseAbs().maxCoeff(&v_max_abs_index); if (v_max_abs_index == old_v_max_abs_index) { // Break if the solution stagnated. break; } // Move to the new simplex e_j, where j = v_max_abs_index. v = dec.solve(Vector::Unit(n, v_max_abs_index)); // v = inv(matrix) * e_j. lower_bound = v.template lpNorm<1>(); if (lower_bound <= old_lower_bound) { // Break if the gradient step did not increase the lower_bound. break; } if (!is_complex) { old_sign_vector = sign_vector; } old_v_max_abs_index = v_max_abs_index; old_lower_bound = lower_bound; } // The following calculates an independent estimate of ||matrix||_1 by // multiplying matrix by a vector with entries of slowly increasing // magnitude and alternating sign: // v_i = (-1)^{i} (1 + (i / (dim-1))), i = 0,...,dim-1. // This improvement to Hager's algorithm above is due to Higham. It was // added to make the algorithm more robust in certain corner cases where // large elements in the matrix might otherwise escape detection due to // exact cancellation (especially when op and op_adjoint correspond to a // sequence of backsubstitutions and permutations), which could cause // Hager's algorithm to vastly underestimate ||matrix||_1. Scalar alternating_sign(RealScalar(1)); for (Index i = 0; i < n; ++i) { // The static_cast is needed when Scalar is a complex and RealScalar implements expression templates v[i] = alternating_sign * static_cast<RealScalar>(RealScalar(1) + (RealScalar(i) / (RealScalar(n - 1)))); alternating_sign = -alternating_sign; } v = dec.solve(v); const RealScalar alternate_lower_bound = (2 * v.template lpNorm<1>()) / (3 * RealScalar(n)); return numext::maxi(lower_bound, alternate_lower_bound); } /** \brief Reciprocal condition number estimator. * * Computing a decomposition of a dense matrix takes O(n^3) operations, while * this method estimates the condition number quickly and reliably in O(n^2) * operations. * * \returns an estimate of the reciprocal condition number * (1 / (||matrix||_1 * ||inv(matrix)||_1)) of matrix, given ||matrix||_1 and * its decomposition. Supports the following decompositions: FullPivLU, * PartialPivLU, LDLT, and LLT. * * \sa FullPivLU, PartialPivLU, LDLT, LLT. */ template <typename Decomposition> typename Decomposition::RealScalar rcond_estimate_helper(typename Decomposition::RealScalar matrix_norm, const Decomposition& dec) { typedef typename Decomposition::RealScalar RealScalar; eigen_assert(dec.rows() == dec.cols()); if (dec.rows() == 0) return NumTraits<RealScalar>::infinity(); if (matrix_norm == RealScalar(0)) return RealScalar(0); if (dec.rows() == 1) return RealScalar(1); const RealScalar inverse_matrix_norm = rcond_invmatrix_L1_norm_estimate(dec); return (inverse_matrix_norm == RealScalar(0) ? RealScalar(0) : (RealScalar(1) / inverse_matrix_norm) / matrix_norm); } } // namespace internal } // namespace Eigen #endif
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>BuildMachineOSBuild</key> <string>19E287</string> <key>CFBundleIdentifier</key> <string>as.acidanthera.injector.BrcmBluetoothInjector</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>BrcmBluetoothInjector</string> <key>CFBundlePackageType</key> <string>KEXT</string> <key>CFBundleShortVersionString</key> <string>2.5.3</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleSupportedPlatforms</key> <array> <string>MacOSX</string> </array> <key>CFBundleVersion</key> <string>2.5.3</string> <key>DTCompiler</key> <string>com.apple.compilers.llvm.clang.1_0</string> <key>DTPlatformBuild</key> <string>11E503a</string> <key>DTPlatformVersion</key> <string>GM</string> <key>DTSDKBuild</key> <string>19E258</string> <key>DTSDKName</key> <string>macosx10.15</string> <key>DTXcode</key> <string>1141</string> <key>DTXcodeBuild</key> <string>11E503a</string> <key>IOKitPersonalities</key> <dict> <key>03f0_231d no firmware</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8989</integer> <key>idVendor</key> <integer>1008</integer> </dict> <key>0489_e032</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>57394</integer> <key>idVendor</key> <integer>1161</integer> </dict> <key>0489_e042</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>57410</integer> <key>idVendor</key> <integer>1161</integer> </dict> <key>0489_e046</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>57414</integer> <key>idVendor</key> <integer>1161</integer> </dict> <key>0489_e04f</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>57423</integer> <key>idVendor</key> <integer>1161</integer> </dict> <key>0489_e052</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>57426</integer> <key>idVendor</key> <integer>1161</integer> </dict> <key>0489_e055</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>57429</integer> <key>idVendor</key> <integer>1161</integer> </dict> <key>0489_e059</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>57433</integer> <key>idVendor</key> <integer>1161</integer> </dict> <key>0489_e079</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>57465</integer> <key>idVendor</key> <integer>1161</integer> </dict> <key>0489_e07a</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>57466</integer> <key>idVendor</key> <integer>1161</integer> </dict> <key>0489_e087</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>57479</integer> <key>idVendor</key> <integer>1161</integer> </dict> <key>0489_e096</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>57494</integer> <key>idVendor</key> <integer>1161</integer> </dict> <key>0489_e0a1</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>57505</integer> <key>idVendor</key> <integer>1161</integer> </dict> <key>04ca_2003</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8195</integer> <key>idVendor</key> <integer>1226</integer> </dict> <key>04ca_2004</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8196</integer> <key>idVendor</key> <integer>1226</integer> </dict> <key>04ca_2005</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8197</integer> <key>idVendor</key> <integer>1226</integer> </dict> <key>04ca_2006</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8198</integer> <key>idVendor</key> <integer>1226</integer> </dict> <key>04ca_2009</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8201</integer> <key>idVendor</key> <integer>1226</integer> </dict> <key>04ca_200a</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8202</integer> <key>idVendor</key> <integer>1226</integer> </dict> <key>04ca_200b</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8203</integer> <key>idVendor</key> <integer>1226</integer> </dict> <key>04ca_200c</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8204</integer> <key>idVendor</key> <integer>1226</integer> </dict> <key>04ca_200e</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8206</integer> <key>idVendor</key> <integer>1226</integer> </dict> <key>04ca_200f</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8207</integer> <key>idVendor</key> <integer>1226</integer> </dict> <key>04ca_2012</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8210</integer> <key>idVendor</key> <integer>1226</integer> </dict> <key>04ca_2016</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8214</integer> <key>idVendor</key> <integer>1226</integer> </dict> <key>04f2_b4a1</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>46241</integer> <key>idVendor</key> <integer>1266</integer> </dict> <key>050d_065a</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>1626</integer> <key>idVendor</key> <integer>1293</integer> </dict> <key>0930_021e</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>542</integer> <key>idVendor</key> <integer>2352</integer> </dict> <key>0930_021f</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>543</integer> <key>idVendor</key> <integer>2352</integer> </dict> <key>0930_0221</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>545</integer> <key>idVendor</key> <integer>2352</integer> </dict> <key>0930_0223</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>547</integer> <key>idVendor</key> <integer>2352</integer> </dict> <key>0930_0225</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>549</integer> <key>idVendor</key> <integer>2352</integer> </dict> <key>0930_0226</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>550</integer> <key>idVendor</key> <integer>2352</integer> </dict> <key>0930_0229</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>553</integer> <key>idVendor</key> <integer>2352</integer> </dict> <key>0a5c_2168</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8552</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_2169</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8553</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_216a</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8554</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_216b</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8555</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_216c</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8556</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_216d</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8557</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_216e</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8558</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_216f</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8559</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_21d7</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8663</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_21de</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8670</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_21e1</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8673</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_21e3</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8675</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_21e6</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8678</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_21e8</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8680</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_21ec</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8684</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_21f1</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8689</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_21f3</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8691</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_21f4</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8692</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_21fb</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8699</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_21fd</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8701</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_22be</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>8894</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_640b</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>25611</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_6410</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>25616</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_6412</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>25618</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_6413</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>25619</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_6414</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>25620</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_6417</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>25623</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_6418</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>25624</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0a5c_7460</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>29792</integer> <key>idVendor</key> <integer>2652</integer> </dict> <key>0b05_17b5</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>6069</integer> <key>idVendor</key> <integer>2821</integer> </dict> <key>0b05_17cb</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>6091</integer> <key>idVendor</key> <integer>2821</integer> </dict> <key>0b05_17cf</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>6095</integer> <key>idVendor</key> <integer>2821</integer> </dict> <key>0b05_180a</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>6154</integer> <key>idVendor</key> <integer>2821</integer> </dict> <key>0bb4_0306</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>774</integer> <key>idVendor</key> <integer>2996</integer> </dict> <key>105b_e065</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>57445</integer> <key>idVendor</key> <integer>4187</integer> </dict> <key>105b_e066</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>57446</integer> <key>idVendor</key> <integer>4187</integer> </dict> <key>13d3_3295 no firmware</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>12949</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>13d3_3384</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>13188</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>13d3_3388</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>13192</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>13d3_3389</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>13193</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>13d3_3392</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>13202</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>13d3_3404</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>13316</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>13d3_3411</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>13329</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>13d3_3413</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>13331</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>13d3_3418</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>13336</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>13d3_3427</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>13351</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>13d3_3435</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>13365</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>13d3_3456</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>13398</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>13d3_3482</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>13442</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>13d3_3484</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>13444</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>13d3_3504</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>13572</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>13d3_3508</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>13576</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>13d3_3517</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>13591</integer> <key>idVendor</key> <integer>5075</integer> </dict> <key>145f_01a3</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>419</integer> <key>idVendor</key> <integer>5215</integer> </dict> <key>19ff_0239</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>569</integer> <key>idVendor</key> <integer>6655</integer> </dict> <key>413c_8143</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>33091</integer> <key>idVendor</key> <integer>16700</integer> </dict> <key>413c_8197</key> <dict> <key>CFBundleIdentifier</key> <string>com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport</string> <key>IOClass</key> <string>BroadcomBluetoothHostControllerUSBTransport</string> <key>IOProbeScore</key> <integer>3000</integer> <key>IOProviderClass</key> <string>IOUSBHostDevice</string> <key>idProduct</key> <integer>33175</integer> <key>idVendor</key> <integer>16700</integer> </dict> </dict> <key>LSMinimumSystemVersion</key> <string>10.9</string> <key>OSBundleRequired</key> <string>Root</string> </dict> </plist>
{ "pile_set_name": "Github" }
# frozen_string_literal: true # Use singleton class Spree::Preferences::Store.instance to access # require 'singleton' module Spree::Preferences class StoreInstance def initialize @cache = Rails.cache end def set(key, value) @cache.write(key, value) persist(key, value) end alias_method :[]=, :set def exist?(key) @cache.exist?(key) || should_persist? && Spree::Preference.where(key: key).exists? end def get(key) # return the retrieved value, if it's in the cache # use unless nil? incase the value is actually boolean false # unless (val = @cache.read(key)).nil? return val end if should_persist? # If it's not in the cache, maybe it's in the database, but # has been cleared from the cache # does it exist in the database? if preference = Spree::Preference.find_by(key: key) # it does exist val = preference.value else # use the fallback value val = yield end # Cache either the value from the db or the fallback value. # This avoids hitting the db with subsequent queries. @cache.write(key, val) return val else yield end end alias_method :fetch, :get def delete(key) @cache.delete(key) destroy(key) end def clear_cache @cache.clear end private def persist(cache_key, value) return unless should_persist? preference = Spree::Preference.where(key: cache_key).first_or_initialize preference.value = value preference.save end def destroy(cache_key) return unless should_persist? preference = Spree::Preference.find_by(key: cache_key) preference.destroy if preference end def should_persist? Spree::Preference.table_exists? end end class Store < StoreInstance include Singleton end end
{ "pile_set_name": "Github" }
lttng-enable-rotation(1) ======================== :revdate: 13 November 2018 NAME ---- lttng-enable-rotation - Set a tracing session's rotation schedule SYNOPSIS -------- [verse] *lttng* ['linkgenoptions:(GENERAL OPTIONS)'] *enable-rotation* [option:--session='SESSION'] (option:--timer='PERIOD' | option:--size='SIZE' | option:--timer='PERIOD' option:--size='SIZE') DESCRIPTION ----------- The `lttng enable-rotation` command sets a rotation schedule for the current tracing session, or for the tracing session named 'SESSION' if provided. See man:lttng-rotate(1) for more information about the concepts of a tracing session _rotation_ and a _trace chunk_. With the option:--timer option, the rotation schedule is set so that an automatic rotation occurs at least every 'PERIOD' (microseconds without a unit suffix). With the option:--size option, the rotation schedule is set so that an automatic rotation occurs every time the total size of the flushed part of the current trace chunk is at least 'SIZE' (bytes without a unit suffix). For both option:--timer and option:--size options, LTTng checks the schedule condition periodically using the monitor timers of the tracing session's channels (see the nloption:--monitor-timer option of the man:lttng-enable-channel(1) command). This means that: * With the option:--timer option, the automatic rotation can occur when the elapsed time since the last automatic rotation is slightly greater than 'PERIOD'. The exact precision is governed by the monitor timer's precision, which relies on the precision of the platform's implementation of POSIX timers. * With the option:--size option, the automatic rotation can occur when the size of the flushed part of the current trace chunk is greater than 'SIZE'. You can combine the option:--timer and option:--size options. The naming convention of a trace chunk archive which an automatic rotation creates is the same as with the immediate rotation command, man:lttng-rotate(1). You can unset a rotation schedule with the man:lttng-disable-rotation(1) command. See <<limitations,LIMITATIONS>> for important limitations regarding this command. include::common-cmd-options-head.txt[] Rotation schedule condition ~~~~~~~~~~~~~~~~~~~~~~~~~~~ option:--size='SIZE':: Set a rotation schedule so that an automatic rotation occurs every time the total size of the flushed part of the current trace chunk is at least 'SIZE' bytes. The `k` (kiB), `M` (MiB), and `G` (GiB) suffixes are supported. option:--timer='PERIOD':: Set a rotation schedule so that an automatic rotation occurs at least every 'PERIOD' microseconds. The `ms` (milliseconds), `s` (seconds), `m` (minutes), and `h` (hours) suffixes are supported. Target ~~~~~~ option:-s 'SESSION', option:--session='SESSION':: Set a rotation schedule for the tracing session named 'SESSION' instead of the current tracing session. include::common-cmd-help-options.txt[] [[limitations]] LIMITATIONS ----------- The `lttng enable-rotation` command only works when: * The tracing session is created in normal mode or in network streaming mode (see man:lttng-create(1)). * No channel was created with a configured trace file count or size limit (see the nloption:--tracefile-size and nloption:--tracefile-count options in man:lttng-enable-channel(1)). For a given tracing session, LTTng only performs an automatic rotation when no other rotation is currently happening. include::common-cmd-footer.txt[] SEE ALSO -------- man:lttng-rotate(1), man:lttng-disable-rotation(1), man:lttng(1)
{ "pile_set_name": "Github" }
/* Copyright 2016 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 workqueue import ( "testing" "time" "k8s.io/apimachinery/pkg/util/clock" ) func TestRateLimitingQueue(t *testing.T) { limiter := NewItemExponentialFailureRateLimiter(1*time.Millisecond, 1*time.Second) queue := NewRateLimitingQueue(limiter).(*rateLimitingType) fakeClock := clock.NewFakeClock(time.Now()) delayingQueue := &delayingType{ Interface: New(), clock: fakeClock, heartbeat: fakeClock.NewTicker(maxWait), stopCh: make(chan struct{}), waitingForAddCh: make(chan *waitFor, 1000), metrics: newRetryMetrics(""), } queue.DelayingInterface = delayingQueue queue.AddRateLimited("one") waitEntry := <-delayingQueue.waitingForAddCh if e, a := 1*time.Millisecond, waitEntry.readyAt.Sub(fakeClock.Now()); e != a { t.Errorf("expected %v, got %v", e, a) } queue.AddRateLimited("one") waitEntry = <-delayingQueue.waitingForAddCh if e, a := 2*time.Millisecond, waitEntry.readyAt.Sub(fakeClock.Now()); e != a { t.Errorf("expected %v, got %v", e, a) } if e, a := 2, queue.NumRequeues("one"); e != a { t.Errorf("expected %v, got %v", e, a) } queue.AddRateLimited("two") waitEntry = <-delayingQueue.waitingForAddCh if e, a := 1*time.Millisecond, waitEntry.readyAt.Sub(fakeClock.Now()); e != a { t.Errorf("expected %v, got %v", e, a) } queue.AddRateLimited("two") waitEntry = <-delayingQueue.waitingForAddCh if e, a := 2*time.Millisecond, waitEntry.readyAt.Sub(fakeClock.Now()); e != a { t.Errorf("expected %v, got %v", e, a) } queue.Forget("one") if e, a := 0, queue.NumRequeues("one"); e != a { t.Errorf("expected %v, got %v", e, a) } queue.AddRateLimited("one") waitEntry = <-delayingQueue.waitingForAddCh if e, a := 1*time.Millisecond, waitEntry.readyAt.Sub(fakeClock.Now()); e != a { t.Errorf("expected %v, got %v", e, a) } }
{ "pile_set_name": "Github" }
Python ctypes-based bindings libvlc =================================== The bindings use ctypes to directly call the libvlc dynamic lib, and the code is generated from the include files defining the public API. The same module should be compatible with various versions of libvlc 3.*. However, there may be incompatible changes between major versions. License ------- The generated module is licensed, like libvlc, under the GNU Lesser General Public License 2.1 or later. Installing the module --------------------- You can install the module through PyPI: pip install python-vlc Using the module ---------------- Documentation building needs epydoc. An online build is available at <http://olivieraubert.net/vlc/python-ctypes/> The module offers two ways of accessing the API - a raw access to all exported methods, and more convenient wrapper classes. Using wrapper classes +++++++++++++++++++++ Most major structures of the libvlc API (Instance, Media, MediaPlayer, etc) are wrapped as classes, with shorter method names and some adaptations to provide a more pythonic API: >>> import vlc >>> p=vlc.MediaPlayer('file:///tmp/foo.avi') >>> p.play() >>> p.get_instance() # returns the corresponding instance In this case, a default ``vlc.Instance`` will be instanciated and stored in ``vlc._default_instance``. It will be used to instanciate the various classes (``Media``, ``MediaList``, ``MediaPlayer``, etc). You also can use wrapper methods closer to the original libvlc API: >>> import vlc >>> i=vlc.Instance('--no-audio', '--fullscreen') >>> i.audio_get_volume() 50 >>> p=i.media_player_new() >>> m=i.media_new('file:///tmp/foo.avi') >>> m.get_mrl() 'file:///tmp/foo.avi' >>> p.set_media(m) >>> p.play() Using raw access ++++++++++++++++ Libvlc methods are available as attributes of the vlc module (as vlc.libvlc_*). Use their docstring (any introspective shell like ipython is your friend) to explore them, or refer to the online documentation at http://olivieraubert.net/vlc/python-ctypes/ >>> import vlc >>> vlc.libvlc_get_version() '3.0.0-rc2 Vetinari' >>> e=vlc.VLCException() >>> i=vlc.libvlc_new(0, [], e) >>> i <vlc.Instance object at 0x8384a4c> >>> vlc.libvlc_audio_get_volume(i,e) 50
{ "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 (1.8.0_181) on Fri Apr 03 16:05:24 UTC 2020 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>CascadeClassifier (OpenCV 4.3.0 Java documentation)</title> <meta name="date" content="2020-04-03"> <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="CascadeClassifier (OpenCV 4.3.0 Java documentation)"; } } catch(err) { } //--> var methods = {"i0":9,"i1":9,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </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 class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"> <script> var url = window.location.href; var pos = url.lastIndexOf('/javadoc/'); url = pos >= 0 ? (url.substring(0, pos) + '/javadoc/mymath.js') : (window.location.origin + '/mymath.js'); var script = document.createElement('script'); script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML,' + url; document.getElementsByTagName('head')[0].appendChild(script); </script> </div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../org/opencv/objdetect/BaseCascadeClassifier.html" title="class in org.opencv.objdetect"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../org/opencv/objdetect/HOGDescriptor.html" title="class in org.opencv.objdetect"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?org/opencv/objdetect/CascadeClassifier.html" target="_top">Frames</a></li> <li><a href="CascadeClassifier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All&nbsp;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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.opencv.objdetect</div> <h2 title="Class CascadeClassifier" class="title">Class CascadeClassifier</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>org.opencv.objdetect.CascadeClassifier</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="typeNameLabel">CascadeClassifier</span> extends java.lang.Object</pre> <div class="block">Cascade classifier class for object detection.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#CascadeClassifier--">CascadeClassifier</a></span>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#CascadeClassifier-java.lang.String-">CascadeClassifier</a></span>(java.lang.String&nbsp;filename)</code> <div class="block">Loads a classifier from a file.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>static <a href="../../../org/opencv/objdetect/CascadeClassifier.html" title="class in org.opencv.objdetect">CascadeClassifier</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#Z:Z__fromPtr__-long-">__fromPtr__</a></span>(long&nbsp;addr)</code>&nbsp;</td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>static boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#convert-java.lang.String-java.lang.String-">convert</a></span>(java.lang.String&nbsp;oldcascade, java.lang.String&nbsp;newcascade)</code>&nbsp;</td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale-org.opencv.core.Mat-org.opencv.core.MatOfRect-">detectMultiScale</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects)</code> <div class="block">Detects objects of different sizes in the input image.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale-org.opencv.core.Mat-org.opencv.core.MatOfRect-double-">detectMultiScale</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, double&nbsp;scaleFactor)</code> <div class="block">Detects objects of different sizes in the input image.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale-org.opencv.core.Mat-org.opencv.core.MatOfRect-double-int-">detectMultiScale</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, double&nbsp;scaleFactor, int&nbsp;minNeighbors)</code> <div class="block">Detects objects of different sizes in the input image.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale-org.opencv.core.Mat-org.opencv.core.MatOfRect-double-int-int-">detectMultiScale</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags)</code> <div class="block">Detects objects of different sizes in the input image.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale-org.opencv.core.Mat-org.opencv.core.MatOfRect-double-int-int-org.opencv.core.Size-">detectMultiScale</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;minSize)</code> <div class="block">Detects objects of different sizes in the input image.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale-org.opencv.core.Mat-org.opencv.core.MatOfRect-double-int-int-org.opencv.core.Size-org.opencv.core.Size-">detectMultiScale</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;minSize, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;maxSize)</code> <div class="block">Detects objects of different sizes in the input image.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale2-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-">detectMultiScale2</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;numDetections)</code>&nbsp;</td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale2-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-double-">detectMultiScale2</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;numDetections, double&nbsp;scaleFactor)</code>&nbsp;</td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale2-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-double-int-">detectMultiScale2</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;numDetections, double&nbsp;scaleFactor, int&nbsp;minNeighbors)</code>&nbsp;</td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale2-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-double-int-int-">detectMultiScale2</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;numDetections, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags)</code>&nbsp;</td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale2-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-double-int-int-org.opencv.core.Size-">detectMultiScale2</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;numDetections, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;minSize)</code>&nbsp;</td> </tr> <tr id="i13" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale2-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-double-int-int-org.opencv.core.Size-org.opencv.core.Size-">detectMultiScale2</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;numDetections, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;minSize, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;maxSize)</code>&nbsp;</td> </tr> <tr id="i14" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale3-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-org.opencv.core.MatOfDouble-">detectMultiScale3</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;rejectLevels, <a href="../../../org/opencv/core/MatOfDouble.html" title="class in org.opencv.core">MatOfDouble</a>&nbsp;levelWeights)</code> <div class="block">This function allows you to retrieve the final stage decision certainty of classification.</div> </td> </tr> <tr id="i15" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale3-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-org.opencv.core.MatOfDouble-double-">detectMultiScale3</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;rejectLevels, <a href="../../../org/opencv/core/MatOfDouble.html" title="class in org.opencv.core">MatOfDouble</a>&nbsp;levelWeights, double&nbsp;scaleFactor)</code> <div class="block">This function allows you to retrieve the final stage decision certainty of classification.</div> </td> </tr> <tr id="i16" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale3-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-org.opencv.core.MatOfDouble-double-int-">detectMultiScale3</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;rejectLevels, <a href="../../../org/opencv/core/MatOfDouble.html" title="class in org.opencv.core">MatOfDouble</a>&nbsp;levelWeights, double&nbsp;scaleFactor, int&nbsp;minNeighbors)</code> <div class="block">This function allows you to retrieve the final stage decision certainty of classification.</div> </td> </tr> <tr id="i17" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale3-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-org.opencv.core.MatOfDouble-double-int-int-">detectMultiScale3</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;rejectLevels, <a href="../../../org/opencv/core/MatOfDouble.html" title="class in org.opencv.core">MatOfDouble</a>&nbsp;levelWeights, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags)</code> <div class="block">This function allows you to retrieve the final stage decision certainty of classification.</div> </td> </tr> <tr id="i18" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale3-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-org.opencv.core.MatOfDouble-double-int-int-org.opencv.core.Size-">detectMultiScale3</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;rejectLevels, <a href="../../../org/opencv/core/MatOfDouble.html" title="class in org.opencv.core">MatOfDouble</a>&nbsp;levelWeights, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;minSize)</code> <div class="block">This function allows you to retrieve the final stage decision certainty of classification.</div> </td> </tr> <tr id="i19" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale3-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-org.opencv.core.MatOfDouble-double-int-int-org.opencv.core.Size-org.opencv.core.Size-">detectMultiScale3</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;rejectLevels, <a href="../../../org/opencv/core/MatOfDouble.html" title="class in org.opencv.core">MatOfDouble</a>&nbsp;levelWeights, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;minSize, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;maxSize)</code> <div class="block">This function allows you to retrieve the final stage decision certainty of classification.</div> </td> </tr> <tr id="i20" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#detectMultiScale3-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-org.opencv.core.MatOfDouble-double-int-int-org.opencv.core.Size-org.opencv.core.Size-boolean-">detectMultiScale3</a></span>(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;rejectLevels, <a href="../../../org/opencv/core/MatOfDouble.html" title="class in org.opencv.core">MatOfDouble</a>&nbsp;levelWeights, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;minSize, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;maxSize, boolean&nbsp;outputRejectLevels)</code> <div class="block">This function allows you to retrieve the final stage decision certainty of classification.</div> </td> </tr> <tr id="i21" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#empty--">empty</a></span>()</code> <div class="block">Checks whether the classifier has been loaded.</div> </td> </tr> <tr id="i22" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#getFeatureType--">getFeatureType</a></span>()</code>&nbsp;</td> </tr> <tr id="i23" class="rowColor"> <td class="colFirst"><code>long</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#getNativeObjAddr--">getNativeObjAddr</a></span>()</code>&nbsp;</td> </tr> <tr id="i24" class="altColor"> <td class="colFirst"><code><a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#getOriginalWindowSize--">getOriginalWindowSize</a></span>()</code>&nbsp;</td> </tr> <tr id="i25" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#isOldFormatCascade--">isOldFormatCascade</a></span>()</code>&nbsp;</td> </tr> <tr id="i26" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../org/opencv/objdetect/CascadeClassifier.html#load-java.lang.String-">load</a></span>(java.lang.String&nbsp;filename)</code> <div class="block">Loads a classifier from a file.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="CascadeClassifier--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>CascadeClassifier</h4> <pre>public&nbsp;CascadeClassifier()</pre> </li> </ul> <a name="CascadeClassifier-java.lang.String-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>CascadeClassifier</h4> <pre>public&nbsp;CascadeClassifier(java.lang.String&nbsp;filename)</pre> <div class="block">Loads a classifier from a file.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>filename</code> - Name of the file from which the classifier is loaded.</dd> </dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="Z:Z__fromPtr__-long-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>__fromPtr__</h4> <pre>public static&nbsp;<a href="../../../org/opencv/objdetect/CascadeClassifier.html" title="class in org.opencv.objdetect">CascadeClassifier</a>&nbsp;__fromPtr__(long&nbsp;addr)</pre> </li> </ul> <a name="convert-java.lang.String-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>convert</h4> <pre>public static&nbsp;boolean&nbsp;convert(java.lang.String&nbsp;oldcascade, java.lang.String&nbsp;newcascade)</pre> </li> </ul> <a name="detectMultiScale-org.opencv.core.Mat-org.opencv.core.MatOfRect-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale</h4> <pre>public&nbsp;void&nbsp;detectMultiScale(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects)</pre> <div class="block">Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - Matrix of the type CV_8U containing an image where objects are detected.</dd> <dd><code>objects</code> - Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image. to retain it. cvHaarDetectObjects. It is not used for a new cascade. The function is parallelized with the TBB library. <b>Note:</b> <ul> <li> (Python) A face detection example using cascade classifiers can be found at opencv_source_code/samples/python/facedetect.py </li> </ul></dd> </dl> </li> </ul> <a name="detectMultiScale-org.opencv.core.Mat-org.opencv.core.MatOfRect-double-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale</h4> <pre>public&nbsp;void&nbsp;detectMultiScale(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, double&nbsp;scaleFactor)</pre> <div class="block">Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - Matrix of the type CV_8U containing an image where objects are detected.</dd> <dd><code>objects</code> - Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.</dd> <dd><code>scaleFactor</code> - Parameter specifying how much the image size is reduced at each image scale. to retain it. cvHaarDetectObjects. It is not used for a new cascade. The function is parallelized with the TBB library. <b>Note:</b> <ul> <li> (Python) A face detection example using cascade classifiers can be found at opencv_source_code/samples/python/facedetect.py </li> </ul></dd> </dl> </li> </ul> <a name="detectMultiScale-org.opencv.core.Mat-org.opencv.core.MatOfRect-double-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale</h4> <pre>public&nbsp;void&nbsp;detectMultiScale(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, double&nbsp;scaleFactor, int&nbsp;minNeighbors)</pre> <div class="block">Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - Matrix of the type CV_8U containing an image where objects are detected.</dd> <dd><code>objects</code> - Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.</dd> <dd><code>scaleFactor</code> - Parameter specifying how much the image size is reduced at each image scale.</dd> <dd><code>minNeighbors</code> - Parameter specifying how many neighbors each candidate rectangle should have to retain it. cvHaarDetectObjects. It is not used for a new cascade. The function is parallelized with the TBB library. <b>Note:</b> <ul> <li> (Python) A face detection example using cascade classifiers can be found at opencv_source_code/samples/python/facedetect.py </li> </ul></dd> </dl> </li> </ul> <a name="detectMultiScale-org.opencv.core.Mat-org.opencv.core.MatOfRect-double-int-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale</h4> <pre>public&nbsp;void&nbsp;detectMultiScale(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags)</pre> <div class="block">Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - Matrix of the type CV_8U containing an image where objects are detected.</dd> <dd><code>objects</code> - Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.</dd> <dd><code>scaleFactor</code> - Parameter specifying how much the image size is reduced at each image scale.</dd> <dd><code>minNeighbors</code> - Parameter specifying how many neighbors each candidate rectangle should have to retain it.</dd> <dd><code>flags</code> - Parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. It is not used for a new cascade. The function is parallelized with the TBB library. <b>Note:</b> <ul> <li> (Python) A face detection example using cascade classifiers can be found at opencv_source_code/samples/python/facedetect.py </li> </ul></dd> </dl> </li> </ul> <a name="detectMultiScale-org.opencv.core.Mat-org.opencv.core.MatOfRect-double-int-int-org.opencv.core.Size-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale</h4> <pre>public&nbsp;void&nbsp;detectMultiScale(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;minSize)</pre> <div class="block">Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - Matrix of the type CV_8U containing an image where objects are detected.</dd> <dd><code>objects</code> - Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.</dd> <dd><code>scaleFactor</code> - Parameter specifying how much the image size is reduced at each image scale.</dd> <dd><code>minNeighbors</code> - Parameter specifying how many neighbors each candidate rectangle should have to retain it.</dd> <dd><code>flags</code> - Parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. It is not used for a new cascade.</dd> <dd><code>minSize</code> - Minimum possible object size. Objects smaller than that are ignored. The function is parallelized with the TBB library. <b>Note:</b> <ul> <li> (Python) A face detection example using cascade classifiers can be found at opencv_source_code/samples/python/facedetect.py </li> </ul></dd> </dl> </li> </ul> <a name="detectMultiScale-org.opencv.core.Mat-org.opencv.core.MatOfRect-double-int-int-org.opencv.core.Size-org.opencv.core.Size-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale</h4> <pre>public&nbsp;void&nbsp;detectMultiScale(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;minSize, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;maxSize)</pre> <div class="block">Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - Matrix of the type CV_8U containing an image where objects are detected.</dd> <dd><code>objects</code> - Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.</dd> <dd><code>scaleFactor</code> - Parameter specifying how much the image size is reduced at each image scale.</dd> <dd><code>minNeighbors</code> - Parameter specifying how many neighbors each candidate rectangle should have to retain it.</dd> <dd><code>flags</code> - Parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. It is not used for a new cascade.</dd> <dd><code>minSize</code> - Minimum possible object size. Objects smaller than that are ignored.</dd> <dd><code>maxSize</code> - Maximum possible object size. Objects larger than that are ignored. If <code>maxSize == minSize</code> model is evaluated on single scale. The function is parallelized with the TBB library. <b>Note:</b> <ul> <li> (Python) A face detection example using cascade classifiers can be found at opencv_source_code/samples/python/facedetect.py </li> </ul></dd> </dl> </li> </ul> <a name="detectMultiScale2-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale2</h4> <pre>public&nbsp;void&nbsp;detectMultiScale2(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;numDetections)</pre> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - Matrix of the type CV_8U containing an image where objects are detected.</dd> <dd><code>objects</code> - Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.</dd> <dd><code>numDetections</code> - Vector of detection numbers for the corresponding objects. An object's number of detections is the number of neighboring positively classified rectangles that were joined together to form the object. to retain it. cvHaarDetectObjects. It is not used for a new cascade.</dd> </dl> </li> </ul> <a name="detectMultiScale2-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-double-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale2</h4> <pre>public&nbsp;void&nbsp;detectMultiScale2(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;numDetections, double&nbsp;scaleFactor)</pre> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - Matrix of the type CV_8U containing an image where objects are detected.</dd> <dd><code>objects</code> - Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.</dd> <dd><code>numDetections</code> - Vector of detection numbers for the corresponding objects. An object's number of detections is the number of neighboring positively classified rectangles that were joined together to form the object.</dd> <dd><code>scaleFactor</code> - Parameter specifying how much the image size is reduced at each image scale. to retain it. cvHaarDetectObjects. It is not used for a new cascade.</dd> </dl> </li> </ul> <a name="detectMultiScale2-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-double-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale2</h4> <pre>public&nbsp;void&nbsp;detectMultiScale2(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;numDetections, double&nbsp;scaleFactor, int&nbsp;minNeighbors)</pre> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - Matrix of the type CV_8U containing an image where objects are detected.</dd> <dd><code>objects</code> - Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.</dd> <dd><code>numDetections</code> - Vector of detection numbers for the corresponding objects. An object's number of detections is the number of neighboring positively classified rectangles that were joined together to form the object.</dd> <dd><code>scaleFactor</code> - Parameter specifying how much the image size is reduced at each image scale.</dd> <dd><code>minNeighbors</code> - Parameter specifying how many neighbors each candidate rectangle should have to retain it. cvHaarDetectObjects. It is not used for a new cascade.</dd> </dl> </li> </ul> <a name="detectMultiScale2-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-double-int-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale2</h4> <pre>public&nbsp;void&nbsp;detectMultiScale2(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;numDetections, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags)</pre> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - Matrix of the type CV_8U containing an image where objects are detected.</dd> <dd><code>objects</code> - Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.</dd> <dd><code>numDetections</code> - Vector of detection numbers for the corresponding objects. An object's number of detections is the number of neighboring positively classified rectangles that were joined together to form the object.</dd> <dd><code>scaleFactor</code> - Parameter specifying how much the image size is reduced at each image scale.</dd> <dd><code>minNeighbors</code> - Parameter specifying how many neighbors each candidate rectangle should have to retain it.</dd> <dd><code>flags</code> - Parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. It is not used for a new cascade.</dd> </dl> </li> </ul> <a name="detectMultiScale2-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-double-int-int-org.opencv.core.Size-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale2</h4> <pre>public&nbsp;void&nbsp;detectMultiScale2(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;numDetections, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;minSize)</pre> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - Matrix of the type CV_8U containing an image where objects are detected.</dd> <dd><code>objects</code> - Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.</dd> <dd><code>numDetections</code> - Vector of detection numbers for the corresponding objects. An object's number of detections is the number of neighboring positively classified rectangles that were joined together to form the object.</dd> <dd><code>scaleFactor</code> - Parameter specifying how much the image size is reduced at each image scale.</dd> <dd><code>minNeighbors</code> - Parameter specifying how many neighbors each candidate rectangle should have to retain it.</dd> <dd><code>flags</code> - Parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. It is not used for a new cascade.</dd> <dd><code>minSize</code> - Minimum possible object size. Objects smaller than that are ignored.</dd> </dl> </li> </ul> <a name="detectMultiScale2-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-double-int-int-org.opencv.core.Size-org.opencv.core.Size-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale2</h4> <pre>public&nbsp;void&nbsp;detectMultiScale2(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;numDetections, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;minSize, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;maxSize)</pre> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - Matrix of the type CV_8U containing an image where objects are detected.</dd> <dd><code>objects</code> - Vector of rectangles where each rectangle contains the detected object, the rectangles may be partially outside the original image.</dd> <dd><code>numDetections</code> - Vector of detection numbers for the corresponding objects. An object's number of detections is the number of neighboring positively classified rectangles that were joined together to form the object.</dd> <dd><code>scaleFactor</code> - Parameter specifying how much the image size is reduced at each image scale.</dd> <dd><code>minNeighbors</code> - Parameter specifying how many neighbors each candidate rectangle should have to retain it.</dd> <dd><code>flags</code> - Parameter with the same meaning for an old cascade as in the function cvHaarDetectObjects. It is not used for a new cascade.</dd> <dd><code>minSize</code> - Minimum possible object size. Objects smaller than that are ignored.</dd> <dd><code>maxSize</code> - Maximum possible object size. Objects larger than that are ignored. If <code>maxSize == minSize</code> model is evaluated on single scale.</dd> </dl> </li> </ul> <a name="detectMultiScale3-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-org.opencv.core.MatOfDouble-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale3</h4> <pre>public&nbsp;void&nbsp;detectMultiScale3(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;rejectLevels, <a href="../../../org/opencv/core/MatOfDouble.html" title="class in org.opencv.core">MatOfDouble</a>&nbsp;levelWeights)</pre> <div class="block">This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to set <code>outputRejectLevels</code> on true and provide the <code>rejectLevels</code> and <code>levelWeights</code> parameter. For each resulting detection, <code>levelWeights</code> will then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications. A code sample on how to use it efficiently can be found below: <code> Mat img; vector&lt;double&gt; weights; vector&lt;int&gt; levels; vector&lt;Rect&gt; detections; CascadeClassifier model("/path/to/your/model.xml"); model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true); cerr &lt;&lt; "Detection " &lt;&lt; detections[0] &lt;&lt; " with weight " &lt;&lt; weights[0] &lt;&lt; endl; </code></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - automatically generated</dd> <dd><code>objects</code> - automatically generated</dd> <dd><code>rejectLevels</code> - automatically generated</dd> <dd><code>levelWeights</code> - automatically generated</dd> </dl> </li> </ul> <a name="detectMultiScale3-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-org.opencv.core.MatOfDouble-double-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale3</h4> <pre>public&nbsp;void&nbsp;detectMultiScale3(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;rejectLevels, <a href="../../../org/opencv/core/MatOfDouble.html" title="class in org.opencv.core">MatOfDouble</a>&nbsp;levelWeights, double&nbsp;scaleFactor)</pre> <div class="block">This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to set <code>outputRejectLevels</code> on true and provide the <code>rejectLevels</code> and <code>levelWeights</code> parameter. For each resulting detection, <code>levelWeights</code> will then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications. A code sample on how to use it efficiently can be found below: <code> Mat img; vector&lt;double&gt; weights; vector&lt;int&gt; levels; vector&lt;Rect&gt; detections; CascadeClassifier model("/path/to/your/model.xml"); model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true); cerr &lt;&lt; "Detection " &lt;&lt; detections[0] &lt;&lt; " with weight " &lt;&lt; weights[0] &lt;&lt; endl; </code></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - automatically generated</dd> <dd><code>objects</code> - automatically generated</dd> <dd><code>rejectLevels</code> - automatically generated</dd> <dd><code>levelWeights</code> - automatically generated</dd> <dd><code>scaleFactor</code> - automatically generated</dd> </dl> </li> </ul> <a name="detectMultiScale3-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-org.opencv.core.MatOfDouble-double-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale3</h4> <pre>public&nbsp;void&nbsp;detectMultiScale3(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;rejectLevels, <a href="../../../org/opencv/core/MatOfDouble.html" title="class in org.opencv.core">MatOfDouble</a>&nbsp;levelWeights, double&nbsp;scaleFactor, int&nbsp;minNeighbors)</pre> <div class="block">This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to set <code>outputRejectLevels</code> on true and provide the <code>rejectLevels</code> and <code>levelWeights</code> parameter. For each resulting detection, <code>levelWeights</code> will then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications. A code sample on how to use it efficiently can be found below: <code> Mat img; vector&lt;double&gt; weights; vector&lt;int&gt; levels; vector&lt;Rect&gt; detections; CascadeClassifier model("/path/to/your/model.xml"); model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true); cerr &lt;&lt; "Detection " &lt;&lt; detections[0] &lt;&lt; " with weight " &lt;&lt; weights[0] &lt;&lt; endl; </code></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - automatically generated</dd> <dd><code>objects</code> - automatically generated</dd> <dd><code>rejectLevels</code> - automatically generated</dd> <dd><code>levelWeights</code> - automatically generated</dd> <dd><code>scaleFactor</code> - automatically generated</dd> <dd><code>minNeighbors</code> - automatically generated</dd> </dl> </li> </ul> <a name="detectMultiScale3-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-org.opencv.core.MatOfDouble-double-int-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale3</h4> <pre>public&nbsp;void&nbsp;detectMultiScale3(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;rejectLevels, <a href="../../../org/opencv/core/MatOfDouble.html" title="class in org.opencv.core">MatOfDouble</a>&nbsp;levelWeights, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags)</pre> <div class="block">This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to set <code>outputRejectLevels</code> on true and provide the <code>rejectLevels</code> and <code>levelWeights</code> parameter. For each resulting detection, <code>levelWeights</code> will then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications. A code sample on how to use it efficiently can be found below: <code> Mat img; vector&lt;double&gt; weights; vector&lt;int&gt; levels; vector&lt;Rect&gt; detections; CascadeClassifier model("/path/to/your/model.xml"); model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true); cerr &lt;&lt; "Detection " &lt;&lt; detections[0] &lt;&lt; " with weight " &lt;&lt; weights[0] &lt;&lt; endl; </code></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - automatically generated</dd> <dd><code>objects</code> - automatically generated</dd> <dd><code>rejectLevels</code> - automatically generated</dd> <dd><code>levelWeights</code> - automatically generated</dd> <dd><code>scaleFactor</code> - automatically generated</dd> <dd><code>minNeighbors</code> - automatically generated</dd> <dd><code>flags</code> - automatically generated</dd> </dl> </li> </ul> <a name="detectMultiScale3-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-org.opencv.core.MatOfDouble-double-int-int-org.opencv.core.Size-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale3</h4> <pre>public&nbsp;void&nbsp;detectMultiScale3(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;rejectLevels, <a href="../../../org/opencv/core/MatOfDouble.html" title="class in org.opencv.core">MatOfDouble</a>&nbsp;levelWeights, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;minSize)</pre> <div class="block">This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to set <code>outputRejectLevels</code> on true and provide the <code>rejectLevels</code> and <code>levelWeights</code> parameter. For each resulting detection, <code>levelWeights</code> will then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications. A code sample on how to use it efficiently can be found below: <code> Mat img; vector&lt;double&gt; weights; vector&lt;int&gt; levels; vector&lt;Rect&gt; detections; CascadeClassifier model("/path/to/your/model.xml"); model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true); cerr &lt;&lt; "Detection " &lt;&lt; detections[0] &lt;&lt; " with weight " &lt;&lt; weights[0] &lt;&lt; endl; </code></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - automatically generated</dd> <dd><code>objects</code> - automatically generated</dd> <dd><code>rejectLevels</code> - automatically generated</dd> <dd><code>levelWeights</code> - automatically generated</dd> <dd><code>scaleFactor</code> - automatically generated</dd> <dd><code>minNeighbors</code> - automatically generated</dd> <dd><code>flags</code> - automatically generated</dd> <dd><code>minSize</code> - automatically generated</dd> </dl> </li> </ul> <a name="detectMultiScale3-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-org.opencv.core.MatOfDouble-double-int-int-org.opencv.core.Size-org.opencv.core.Size-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale3</h4> <pre>public&nbsp;void&nbsp;detectMultiScale3(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;rejectLevels, <a href="../../../org/opencv/core/MatOfDouble.html" title="class in org.opencv.core">MatOfDouble</a>&nbsp;levelWeights, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;minSize, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;maxSize)</pre> <div class="block">This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to set <code>outputRejectLevels</code> on true and provide the <code>rejectLevels</code> and <code>levelWeights</code> parameter. For each resulting detection, <code>levelWeights</code> will then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications. A code sample on how to use it efficiently can be found below: <code> Mat img; vector&lt;double&gt; weights; vector&lt;int&gt; levels; vector&lt;Rect&gt; detections; CascadeClassifier model("/path/to/your/model.xml"); model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true); cerr &lt;&lt; "Detection " &lt;&lt; detections[0] &lt;&lt; " with weight " &lt;&lt; weights[0] &lt;&lt; endl; </code></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - automatically generated</dd> <dd><code>objects</code> - automatically generated</dd> <dd><code>rejectLevels</code> - automatically generated</dd> <dd><code>levelWeights</code> - automatically generated</dd> <dd><code>scaleFactor</code> - automatically generated</dd> <dd><code>minNeighbors</code> - automatically generated</dd> <dd><code>flags</code> - automatically generated</dd> <dd><code>minSize</code> - automatically generated</dd> <dd><code>maxSize</code> - automatically generated</dd> </dl> </li> </ul> <a name="detectMultiScale3-org.opencv.core.Mat-org.opencv.core.MatOfRect-org.opencv.core.MatOfInt-org.opencv.core.MatOfDouble-double-int-int-org.opencv.core.Size-org.opencv.core.Size-boolean-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>detectMultiScale3</h4> <pre>public&nbsp;void&nbsp;detectMultiScale3(<a href="../../../org/opencv/core/Mat.html" title="class in org.opencv.core">Mat</a>&nbsp;image, <a href="../../../org/opencv/core/MatOfRect.html" title="class in org.opencv.core">MatOfRect</a>&nbsp;objects, <a href="../../../org/opencv/core/MatOfInt.html" title="class in org.opencv.core">MatOfInt</a>&nbsp;rejectLevels, <a href="../../../org/opencv/core/MatOfDouble.html" title="class in org.opencv.core">MatOfDouble</a>&nbsp;levelWeights, double&nbsp;scaleFactor, int&nbsp;minNeighbors, int&nbsp;flags, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;minSize, <a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;maxSize, boolean&nbsp;outputRejectLevels)</pre> <div class="block">This function allows you to retrieve the final stage decision certainty of classification. For this, one needs to set <code>outputRejectLevels</code> on true and provide the <code>rejectLevels</code> and <code>levelWeights</code> parameter. For each resulting detection, <code>levelWeights</code> will then contain the certainty of classification at the final stage. This value can then be used to separate strong from weaker classifications. A code sample on how to use it efficiently can be found below: <code> Mat img; vector&lt;double&gt; weights; vector&lt;int&gt; levels; vector&lt;Rect&gt; detections; CascadeClassifier model("/path/to/your/model.xml"); model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true); cerr &lt;&lt; "Detection " &lt;&lt; detections[0] &lt;&lt; " with weight " &lt;&lt; weights[0] &lt;&lt; endl; </code></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>image</code> - automatically generated</dd> <dd><code>objects</code> - automatically generated</dd> <dd><code>rejectLevels</code> - automatically generated</dd> <dd><code>levelWeights</code> - automatically generated</dd> <dd><code>scaleFactor</code> - automatically generated</dd> <dd><code>minNeighbors</code> - automatically generated</dd> <dd><code>flags</code> - automatically generated</dd> <dd><code>minSize</code> - automatically generated</dd> <dd><code>maxSize</code> - automatically generated</dd> <dd><code>outputRejectLevels</code> - automatically generated</dd> </dl> </li> </ul> <a name="empty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>empty</h4> <pre>public&nbsp;boolean&nbsp;empty()</pre> <div class="block">Checks whether the classifier has been loaded.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>automatically generated</dd> </dl> </li> </ul> <a name="getFeatureType--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getFeatureType</h4> <pre>public&nbsp;int&nbsp;getFeatureType()</pre> </li> </ul> <a name="getNativeObjAddr--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getNativeObjAddr</h4> <pre>public&nbsp;long&nbsp;getNativeObjAddr()</pre> </li> </ul> <a name="getOriginalWindowSize--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getOriginalWindowSize</h4> <pre>public&nbsp;<a href="../../../org/opencv/core/Size.html" title="class in org.opencv.core">Size</a>&nbsp;getOriginalWindowSize()</pre> </li> </ul> <a name="isOldFormatCascade--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isOldFormatCascade</h4> <pre>public&nbsp;boolean&nbsp;isOldFormatCascade()</pre> </li> </ul> <a name="load-java.lang.String-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>load</h4> <pre>public&nbsp;boolean&nbsp;load(java.lang.String&nbsp;filename)</pre> <div class="block">Loads a classifier from a file.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>filename</code> - Name of the file from which the classifier is loaded. The file may contain an old HAAR classifier trained by the haartraining application or a new cascade classifier trained by the traincascade application.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>automatically generated</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= 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 class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"> <script> var url = window.location.href; var pos = url.lastIndexOf('/javadoc/'); url = pos >= 0 ? (url.substring(0, pos) + '/javadoc/mymath.js') : (window.location.origin + '/mymath.js'); var script = document.createElement('script'); script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS-MML_HTMLorMML,' + url; document.getElementsByTagName('head')[0].appendChild(script); </script> </div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../org/opencv/objdetect/BaseCascadeClassifier.html" title="class in org.opencv.objdetect"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../org/opencv/objdetect/HOGDescriptor.html" title="class in org.opencv.objdetect"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?org/opencv/objdetect/CascadeClassifier.html" target="_top">Frames</a></li> <li><a href="CascadeClassifier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.html">All&nbsp;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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Generated on 2020-04-03 16:05:20 / OpenCV 4.3.0</small></p> </body> </html>
{ "pile_set_name": "Github" }
package io.digdag.standards.operator.param; import io.digdag.spi.ParamServerClientConnection; import io.digdag.spi.ParamServerClientConnectionManager; public class DummyServerClientConnectionManager implements ParamServerClientConnectionManager { @Override public ParamServerClientConnection getConnection() { return new DummyServerClientConnection(); } @Override public void shutdown() { } }
{ "pile_set_name": "Github" }
<?xml version="1.0" standalone="yes"?> <programlisting> for (auto &amp; s : seq) s.<methodname alt="boost::process::extend::handler::on_setup">on_setup</methodname>(*this); if (<methodname alt="boost::process::extend::posix_executor::error">error</methodname>()) { for (auto &amp; s : seq) s.<methodname alt="boost::process::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::extend::posix_executor::error">error</methodname>()); return <classname alt="boost::process::child">child</classname>(); } pid = <ulink url="http://pubs.opengroup.org/onlinepubs/009695399/functions/fork.html">fork()</ulink> <methodname alt="boost::process::extend::handler::on_setup">on_setup</methodname>(*this); if (pid == -1) //fork error { <methodname alt="boost::process::extend::posix_executor::set_error">set_error</methodname>(<functionname alt="boost::process::extend::get_last_error">get_last_error</functionname>()); for (auto &amp; s : seq) s.<methodname alt="boost::process::extend::handler::on_fork_error">on_fork_error</methodname>(*this, <methodname alt="boost::process::extend::posix_executor::error">error</methodname>()); for (auto &amp; s : seq) s.<methodname alt="boost::process::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::extend::posix_executor::error">error</methodname>()); return <classname alt="boost::process::child">child</classname>() } else if (pid == 0) //child process { for (auto &amp; s : seq) s.<methodname alt="boost::process::extend::handler::on_exec_setup">on_exec_setup</methodname>(*this); <ulink url="http://pubs.opengroup.org/onlinepubs/009695399/functions/exec.html">execve</ulink>(exe, cmd_line, env); auto ec = <functionname alt="boost::process::extend::get_last_error">get_last_error</functionname>(); for (auto &amp; s : seq) s.<methodname alt="boost::process::extend::handler::on_exec_error">on_exec_error</methodname>(*this); <emphasis>unspecified();</emphasis>//here the error is send to the father process interally <ulink url="http://en.cppreference.com/w/cpp/utility/program/exit">std::exit</ulink>(<ulink url="http://en.cppreference.com/w/c/program/EXIT_status">EXIT_FAILURE</ulink>); return <classname alt="boost::process::child">child</classname>(); //for C++ compliance } <classname alt="boost::process::child">child</classname> c(pid, exit_code); <emphasis>unspecified();</emphasis>//here, we read the the error from the child process if (<methodname alt="boost::process::extend::posix_executor::error">error</methodname>()) for (auto &amp; s : seq) s.<methodname alt="boost::process::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::extend::posix_executor::error">error</methodname>()); else for (auto &amp; s : seq) s.<methodname alt="boost::process::extend::handler::on_error">on_success</methodname>(*this); //now we check again, because a on_success handler might've errored. if (<methodname alt="boost::process::extend::posix_executor::error">error</methodname>()) { for (auto &amp; s : seq) s.<methodname alt="boost::process::extend::handler::on_error">on_error</methodname>(*this, <methodname alt="boost::process::extend::posix_executor::error">error</methodname>()); return <classname alt="boost::process::child">child</classname>(); } else return c; </programlisting>
{ "pile_set_name": "Github" }
function f(type) { for (var i = 0; i < 3; i++) {} assertEq((new String) instanceof type, true); } f(String);
{ "pile_set_name": "Github" }
#!/bin/bash set -euo pipefail release_type=$1 script-log state "Pulling latest" git pull script-log state "Bumping version" npm version "$release_type" -m "Release %s" script-log state "Pushing" git push --set-upstream origin master git push --tags script-log state "Done"
{ "pile_set_name": "Github" }
--- third_party/crashpad/crashpad/util/misc/capture_context.h.orig 2019-12-12 12:41:25 UTC +++ third_party/crashpad/crashpad/util/misc/capture_context.h @@ -21,7 +21,7 @@ #include <mach/mach.h> #elif defined(OS_WIN) #include <windows.h> -#elif defined(OS_LINUX) || defined(OS_ANDROID) +#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_BSD) #include <ucontext.h> #elif defined(OS_FUCHSIA) #include <signal.h> @@ -35,7 +35,7 @@ using NativeCPUContext = x86_thread_state; #endif #elif defined(OS_WIN) using NativeCPUContext = CONTEXT; -#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FUCHSIA) +#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FUCHSIA) || defined(OS_BSD) using NativeCPUContext = ucontext_t; #endif // OS_MACOSX
{ "pile_set_name": "Github" }
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.action.admin.indices.create; import org.elasticsearch.action.admin.indices.alias.Alias; import org.elasticsearch.action.admin.indices.shrink.ResizeType; import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.cluster.ack.ClusterStateUpdateRequest; import org.elasticsearch.cluster.block.ClusterBlock; import org.elasticsearch.cluster.metadata.IndexMetadata; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.Index; import java.util.HashSet; import java.util.Set; /** * Cluster state update request that allows to create an index */ public class CreateIndexClusterStateUpdateRequest extends ClusterStateUpdateRequest<CreateIndexClusterStateUpdateRequest> { private final String cause; private final String index; private String dataStreamName; private final String providedName; private Index recoverFrom; private ResizeType resizeType; private boolean copySettings; private Settings settings = Settings.Builder.EMPTY_SETTINGS; private String mappings = "{}"; private final Set<Alias> aliases = new HashSet<>(); private final Set<ClusterBlock> blocks = new HashSet<>(); private ActiveShardCount waitForActiveShards = ActiveShardCount.DEFAULT; public CreateIndexClusterStateUpdateRequest(String cause, String index, String providedName) { this.cause = cause; this.index = index; this.providedName = providedName; } public CreateIndexClusterStateUpdateRequest settings(Settings settings) { this.settings = settings; return this; } public CreateIndexClusterStateUpdateRequest mappings(String mappings) { this.mappings = mappings; return this; } public CreateIndexClusterStateUpdateRequest aliases(Set<Alias> aliases) { this.aliases.addAll(aliases); return this; } public CreateIndexClusterStateUpdateRequest recoverFrom(Index recoverFrom) { this.recoverFrom = recoverFrom; return this; } public CreateIndexClusterStateUpdateRequest waitForActiveShards(ActiveShardCount waitForActiveShards) { this.waitForActiveShards = waitForActiveShards; return this; } public CreateIndexClusterStateUpdateRequest resizeType(ResizeType resizeType) { this.resizeType = resizeType; return this; } public CreateIndexClusterStateUpdateRequest copySettings(final boolean copySettings) { this.copySettings = copySettings; return this; } public String cause() { return cause; } public String index() { return index; } public Settings settings() { return settings; } public String mappings() { return mappings; } public Set<Alias> aliases() { return aliases; } public Set<ClusterBlock> blocks() { return blocks; } public Index recoverFrom() { return recoverFrom; } /** * The name that was provided by the user. This might contain a date math expression. * @see IndexMetadata#SETTING_INDEX_PROVIDED_NAME */ public String getProvidedName() { return providedName; } public ActiveShardCount waitForActiveShards() { return waitForActiveShards; } /** * Returns the resize type or null if this is an ordinary create index request */ public ResizeType resizeType() { return resizeType; } public boolean copySettings() { return copySettings; } /** * Returns the name of the data stream this new index will be part of. * If this new index will not be part of a data stream then this returns <code>null</code>. */ public String dataStreamName() { return dataStreamName; } public CreateIndexClusterStateUpdateRequest dataStreamName(String dataStreamName) { this.dataStreamName = dataStreamName; return this; } @Override public String toString() { return "CreateIndexClusterStateUpdateRequest{" + "cause='" + cause + '\'' + ", index='" + index + '\'' + ", dataStreamName='" + dataStreamName + '\'' + ", providedName='" + providedName + '\'' + ", recoverFrom=" + recoverFrom + ", resizeType=" + resizeType + ", copySettings=" + copySettings + ", settings=" + settings + ", aliases=" + aliases + ", blocks=" + blocks + ", waitForActiveShards=" + waitForActiveShards + '}'; } }
{ "pile_set_name": "Github" }
% 9.5.07 % This is a sample documentation for Compass in the tex format. % We restrict the use of tex to the following subset of commands: % % \section, \subsection, \subsubsection, \paragraph % \begin{enumerate} (no-nesting), \begin{quote}, \item % {\tt ... }, {\bf ...}, {\it ... } % \htmladdnormallink{}{} % \begin{verbatim}...\end{verbatim} is reserved for code segments % ...'' % \section{Non Virtual Redefinition} \label{NonVirtualRedefinition::overview} Calls of nonvirtual member functions are resolved at compile time, not run time. Redefinition of an inherited nonvirtual function in a derived class has different semantics that can result in surprising behavior and should therefore be avoided. This checker reports cases where a class redefines a function that was declared nonvirtual in one of its superclasses. \subsection{Parameter Requirements} This checker does not require any parameters. \subsection{Non-Compliant Code Example} \begin{verbatim} namespace NonCompliant { class Base { public: virtual void overrideIfYouWish(int); void doNotOverride(int); }; class Inherited: public Base { public: void doNotOverride(int); // trying to override nonvirtual function }; } \end{verbatim} \subsection{Compliant Solution} \begin{verbatim} namespace Compliant { class Base { public: virtual void overrideIfYouWish(int); void doNotOverride(int); }; class Inherited: public Base { public: void overrideIfYouWish(int); // overriding virtual function }; } \end{verbatim} \subsection{Mitigation Strategies} \subsubsection{Static Analysis} Compliance with this rule can be checked using structural static analysis checkers using the following algorithm: \begin{enumerate} \item For every member function declaration, traverse the inheritance DAG of the enclosing class. \item Identify any functions that may be overridden by the current one (by checking name and type). \item Issue a diagnostic if the overridden function is not declared virtual. \end{enumerate} \subsection{References} % Write some references % ex. \htmladdnormallink{ISO/IEC 9899-1999:TC2}{https://www.securecoding.cert.org/confluence/display/seccode/AA.+C+References} Forward, Section 6.9.1, Function definitions'' A reference for this checker is: S.~Meyers: ``Effective C++ Second Edition'', Item~37: ``Never redefine an inherited nonvirtual function.''
{ "pile_set_name": "Github" }
define( [ "../var/support" ], function( support ) { support.focusin = "onfocusin" in window; return support; } );
{ "pile_set_name": "Github" }
// Tests for RxJS-BackPressure TypeScript definitions // Tests by Igor Oleinikov <https://github.com/Igorbek> ///<reference path="rx.d.ts" /> ///<reference path="rx.backpressure.d.ts" /> function testPausable() { var o: Rx.Observable<string>; var pauser = new Rx.Subject<boolean>(); var p = o.pausable(pauser); p = o.pausableBuffered(pauser); } function testControlled() { var o: Rx.Observable<string>; var c = o.controlled(); var d: Rx.IDisposable = c.request(); d = c.request(5); }
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <!-- Don't disable Type 1 fonts. Make sure to run this as root if having problems: fc-cache -f --> <selectfont> <acceptfont> <pattern> <patelt name="fontformat" > <string>Type 1</string> </patelt> </pattern> </acceptfont> </selectfont> </fontconfig>
{ "pile_set_name": "Github" }
<template functional> <div class="md-container"> <!-- eslint-disable-next-line vue/no-v-html --> <div class="dynamic-content" v-html="props.md"></div> </div> </template> <script> export default { name: 'MdContainer', props: { md: { type: String, default: '' } } }; </script> <style lang="scss" scoped> .md-container { padding: 20px; } </style> <style lang="scss"> @import 'MdContainer.scss'; </style>
{ "pile_set_name": "Github" }
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE // Author: Aliaksei Chapyzhenka (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; function toWordList(words) { var ret = []; words.split(' ').forEach(function(e){ ret.push({name: e}); }); return ret; } var coreWordList = toWordList( 'INVERT AND OR XOR\ 2* 2/ LSHIFT RSHIFT\ 0= = 0< < > U< MIN MAX\ 2DROP 2DUP 2OVER 2SWAP ?DUP DEPTH DROP DUP OVER ROT SWAP\ >R R> R@\ + - 1+ 1- ABS NEGATE\ S>D * M* UM*\ FM/MOD SM/REM UM/MOD */ */MOD / /MOD MOD\ HERE , @ ! CELL+ CELLS C, C@ C! CHARS 2@ 2!\ ALIGN ALIGNED +! ALLOT\ CHAR [CHAR] [ ] BL\ FIND EXECUTE IMMEDIATE COUNT LITERAL STATE\ ; DOES> >BODY\ EVALUATE\ SOURCE >IN\ <# # #S #> HOLD SIGN BASE >NUMBER HEX DECIMAL\ FILL MOVE\ . CR EMIT SPACE SPACES TYPE U. .R U.R\ ACCEPT\ TRUE FALSE\ <> U> 0<> 0>\ NIP TUCK ROLL PICK\ 2>R 2R@ 2R>\ WITHIN UNUSED MARKER\ I J\ TO\ COMPILE, [COMPILE]\ SAVE-INPUT RESTORE-INPUT\ PAD ERASE\ 2LITERAL DNEGATE\ D- D+ D0< D0= D2* D2/ D< D= DMAX DMIN D>S DABS\ M+ M*/ D. D.R 2ROT DU<\ CATCH THROW\ FREE RESIZE ALLOCATE\ CS-PICK CS-ROLL\ GET-CURRENT SET-CURRENT FORTH-WORDLIST GET-ORDER SET-ORDER\ PREVIOUS SEARCH-WORDLIST WORDLIST FIND ALSO ONLY FORTH DEFINITIONS ORDER\ -TRAILING /STRING SEARCH COMPARE CMOVE CMOVE> BLANK SLITERAL'); var immediateWordList = toWordList('IF ELSE THEN BEGIN WHILE REPEAT UNTIL RECURSE [IF] [ELSE] [THEN] ?DO DO LOOP +LOOP UNLOOP LEAVE EXIT AGAIN CASE OF ENDOF ENDCASE'); CodeMirror.defineMode('forth', function() { function searchWordList (wordList, word) { var i; for (i = wordList.length - 1; i >= 0; i--) { if (wordList[i].name === word.toUpperCase()) { return wordList[i]; } } return undefined; } return { startState: function() { return { state: '', base: 10, coreWordList: coreWordList, immediateWordList: immediateWordList, wordList: [] }; }, token: function (stream, stt) { var mat; if (stream.eatSpace()) { return null; } if (stt.state === '') { // interpretation if (stream.match(/^(\]|:NONAME)(\s|$)/i)) { stt.state = ' compilation'; return 'builtin compilation'; } mat = stream.match(/^(\:)\s+(\S+)(\s|$)+/); if (mat) { stt.wordList.push({name: mat[2].toUpperCase()}); stt.state = ' compilation'; return 'def' + stt.state; } mat = stream.match(/^(VARIABLE|2VARIABLE|CONSTANT|2CONSTANT|CREATE|POSTPONE|VALUE|WORD)\s+(\S+)(\s|$)+/i); if (mat) { stt.wordList.push({name: mat[2].toUpperCase()}); return 'def' + stt.state; } mat = stream.match(/^(\'|\[\'\])\s+(\S+)(\s|$)+/); if (mat) { return 'builtin' + stt.state; } } else { // compilation // ; [ if (stream.match(/^(\;|\[)(\s)/)) { stt.state = ''; stream.backUp(1); return 'builtin compilation'; } if (stream.match(/^(\;|\[)($)/)) { stt.state = ''; return 'builtin compilation'; } if (stream.match(/^(POSTPONE)\s+\S+(\s|$)+/)) { return 'builtin'; } } // dynamic wordlist mat = stream.match(/^(\S+)(\s+|$)/); if (mat) { if (searchWordList(stt.wordList, mat[1]) !== undefined) { return 'variable' + stt.state; } // comments if (mat[1] === '\\') { stream.skipToEnd(); return 'comment' + stt.state; } // core words if (searchWordList(stt.coreWordList, mat[1]) !== undefined) { return 'builtin' + stt.state; } if (searchWordList(stt.immediateWordList, mat[1]) !== undefined) { return 'keyword' + stt.state; } if (mat[1] === '(') { stream.eatWhile(function (s) { return s !== ')'; }); stream.eat(')'); return 'comment' + stt.state; } // // strings if (mat[1] === '.(') { stream.eatWhile(function (s) { return s !== ')'; }); stream.eat(')'); return 'string' + stt.state; } if (mat[1] === 'S"' || mat[1] === '."' || mat[1] === 'C"') { stream.eatWhile(function (s) { return s !== '"'; }); stream.eat('"'); return 'string' + stt.state; } // numbers if (mat[1] - 0xfffffffff) { return 'number' + stt.state; } // if (mat[1].match(/^[-+]?[0-9]+\.[0-9]*/)) { // return 'number' + stt.state; // } return 'atom' + stt.state; } } }; }); CodeMirror.defineMIME("text/x-forth", "forth"); });
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <playground version='5.0' target-platform='osx' requires-full-environment='true'> <timeline fileName='timeline.xctimeline'/> </playground>
{ "pile_set_name": "Github" }
set( stlab_Clang_base_flags -Wall -Wextra -Wpedantic -Werror -ftemplate-backtrace-limit=0 -DBOOST_NO_AUTO_PTR=1 -D_GLIBCXX_USE_CXX11_ABI=0) set( stlab_Clang_debug_flags -gdwarf-3 ) set( stlab_Clang_coverage_flags --coverage ) set( stlab_Clang_release_flags ) string(CONCAT generator "${stlab_Clang_base_flags};" "$<$<OR:$<CONFIG:DEBUG>," "$<CONFIG:RELWITHDEBINFO>>:${stlab_Clang_debug_flags};>" "$<$<OR:$<CONFIG:RELEASE>," "$<CONFIG:RELWITHDEBINFO>," "$<CONFIG:MINSIZEREL>>:${stlab_Clang_release_flags};>" "$<$<AND:$<CONFIG:DEBUG>," "$<BOOL:${stlab.coverage}>>:${stlab_Clang_debug_flags};>") target_compile_options(development INTERFACE $<$<CXX_COMPILER_ID:Clang>:${generator}>) target_link_libraries(development INTERFACE $<$<CXX_COMPILER_ID:Clang>:${generator}>)
{ "pile_set_name": "Github" }
function test() { return typeof Map.prototype.delete === "function"; } if (!test()) throw new Error("Test failed");
{ "pile_set_name": "Github" }
/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ****************************************************************************/ #include "cppfunctionsfilter.h" #include "cpptoolsconstants.h" #include <utils/fileutils.h> using namespace CppTools; using namespace CppTools::Internal; CppFunctionsFilter::CppFunctionsFilter(CppLocatorData *locatorData) : CppLocatorFilter(locatorData) { setId(Constants::FUNCTIONS_FILTER_ID); setDisplayName(Constants::FUNCTIONS_FILTER_DISPLAY_NAME); setShortcutString("m"); setIncludedByDefault(false); } CppFunctionsFilter::~CppFunctionsFilter() = default; Core::LocatorFilterEntry CppFunctionsFilter::filterEntryFromIndexItem(IndexItem::Ptr info) { const QVariant id = QVariant::fromValue(info); QString name = info->symbolName(); QString extraInfo = info->symbolScope(); info->unqualifiedNameAndScope(name, &name, &extraInfo); if (extraInfo.isEmpty()) { extraInfo = info->shortNativeFilePath(); } else { extraInfo.append(" (" + Utils::FilePath::fromString(info->fileName()).fileName() + ')'); } Core::LocatorFilterEntry filterEntry(this, name + info->symbolType(), id, info->icon()); filterEntry.extraInfo = extraInfo; return filterEntry; }
{ "pile_set_name": "Github" }
using System; using NHapi.Base; using NHapi.Base.Parser; using NHapi.Base.Model; using NHapi.Model.V251.Datatype; using NHapi.Base.Log; namespace NHapi.Model.V251.Segment{ ///<summary> /// Represents an HL7 QPD message segment. /// This segment has the following fields:<ol> ///<li>QPD-1: Message Query Name (CE)</li> ///<li>QPD-2: Query Tag (ST)</li> ///<li>QPD-3: User Parameters (in successive fields) (varies)</li> ///</ol> /// The get...() methods return data from individual fields. These methods /// do not throw exceptions and may therefore have to handle exceptions internally. /// If an exception is handled internally, it is logged and null is returned. /// This is not expected to happen - if it does happen this indicates not so much /// an exceptional circumstance as a bug in the code for this class. ///</summary> [Serializable] public class QPD : AbstractSegment { /** * Creates a QPD (Query Parameter Definition) segment object that belongs to the given * message. */ public QPD(IGroup parent, IModelClassFactory factory) : base(parent,factory) { IMessage message = Message; try { this.add(typeof(CE), true, 1, 250, new System.Object[]{message}, "Message Query Name"); this.add(typeof(ST), false, 1, 32, new System.Object[]{message}, "Query Tag"); this.add(typeof(Varies), false, 1, 256, new System.Object[]{message}, "User Parameters (in successive fields)"); } catch (HL7Exception he) { HapiLogFactory.GetHapiLog(GetType()).Error("Can't instantiate " + GetType().Name, he); } } ///<summary> /// Returns Message Query Name(QPD-1). ///</summary> public CE MessageQueryName { get{ CE ret = null; try { IType t = this.GetField(1, 0); ret = (CE)t; } catch (HL7Exception he) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value. This is a bug.", he); throw new System.Exception("An unexpected error ocurred", he); } catch (System.Exception ex) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value. This is a bug.", ex); throw new System.Exception("An unexpected error ocurred", ex); } return ret; } } ///<summary> /// Returns Query Tag(QPD-2). ///</summary> public ST QueryTag { get{ ST ret = null; try { IType t = this.GetField(2, 0); ret = (ST)t; } catch (HL7Exception he) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value. This is a bug.", he); throw new System.Exception("An unexpected error ocurred", he); } catch (System.Exception ex) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value. This is a bug.", ex); throw new System.Exception("An unexpected error ocurred", ex); } return ret; } } ///<summary> /// Returns User Parameters (in successive fields)(QPD-3). ///</summary> public Varies UserParametersInsuccessivefields { get{ Varies ret = null; try { IType t = this.GetField(3, 0); ret = (Varies)t; } catch (HL7Exception he) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value. This is a bug.", he); throw new System.Exception("An unexpected error ocurred", he); } catch (System.Exception ex) { HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value. This is a bug.", ex); throw new System.Exception("An unexpected error ocurred", ex); } return ret; } } }}
{ "pile_set_name": "Github" }
--- http_interactions: - request: method: get uri: http://ps.pndsn.com/v1/channel-registration/sub-key/sub-a-mock-key/channel-group/demo?add=demo&auth=ruby-test-auth-client-one&pnsdk=PubNub-Ruby/4.1.0&uuid=ruby-test-uuid-client-one body: encoding: UTF-8 string: '' headers: User-Agent: - HTTPClient/1.0 (2.8.0, ruby 2.3.0 (2015-12-25)) Accept: - "*/*" Date: - Wed, 25 May 2016 14:35:00 GMT response: status: code: 200 message: OK headers: Date: - Wed, 25 May 2016 14:35:00 GMT Content-Type: - text/javascript; charset="UTF-8" Content-Length: - '79' Connection: - keep-alive Cache-Control: - no-cache Access-Control-Allow-Origin: - "*" Access-Control-Allow-Methods: - GET Accept-Ranges: - bytes Age: - '0' Server: - Pubnub body: encoding: UTF-8 string: '{"status": 200, "message": "OK", "service": "channel-registry", "error": false}' http_version: recorded_at: Wed, 25 May 2016 14:35:00 GMT recorded_with: VCR 3.0.1
{ "pile_set_name": "Github" }
package converters import ( rbac "k8s.io/api/rbac/v1" "github.com/koki/short/types" ) func Convert_Kube_Role_to_Koki(kube *rbac.Role) (*types.RoleWrapper, error) { koki := &types.Role{} koki.Name = kube.Name koki.Namespace = kube.Namespace koki.Version = kube.APIVersion koki.Cluster = kube.ClusterName koki.Labels = kube.Labels koki.Annotations = kube.Annotations koki.Rules = convertPolicyRules(kube.Rules) return &types.RoleWrapper{ Role: *koki, }, nil }
{ "pile_set_name": "Github" }
/* * Copyright (C) 2010-2015 Marvell International Ltd. * Copyright (C) 2002-2010 Kinoma, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef __MPEG_X_DEMUXER_H__ #define __MPEG_X_DEMUXER_H__ // #define STAND_ALONE // #define MPEG_DEBUG_MESSAGE #ifdef STAND_ALONE #ifndef FskErr #define FskErr int #endif #ifndef kFskErrBadData #define kFskErrBadData -23 #endif #define BAIL_IF_ERR(err) do { if ((err) != 0) { goto bail; } } while(0) #define GET_TIME_64(t) \ ( \ (FskInt64)(((FskInt64)GET_TIME_64_Hi(t))<<32)| \ (FskInt64)GET_TIME_64_Lo(t) \ ) #define UInt16 unsigned short #define SInt32 signed long #define UInt32 unsigned long #define FskInt64 long long #define FskMemPtr unsigned char * #define kFskErrNone 0 #define kFskErrUnknownElement -12 #define FskMemMove memmove void FskMemCopy(void *dst, const void *src, UInt32 count); void FskMemSet(void *dst, char fill, UInt32 count); FskErr FskMemPtrNew(UInt32 size, FskMemPtr *newMemory); FskErr FskMemPtrNewClear(UInt32 size, FskMemPtr *newMemory); FskErr FskMemPtrDisposeAt(void **ptr); #else #include "FskMemory.h" #endif #include "stdio.h" #include "stdlib.h" #include "string.h" #ifdef MPEG_DEBUG_MESSAGE //#define MY_DUMP_FILE_PATGH "E:\\debug_log\\mpeg_err.txt" //#define MY_DUMP_FILE_PATGH "/sdcard/e" //#define MY_DUMP_FILE_PATGH "/data/data/com.kinoma.kinomaplay/files/Download/mpg_r" #define MY_DUMP_FILE_PATGH "/tmp/ermp2" extern FILE *fMPEGErr; #define dlog(...) \ { \ if( fMPEGErr == NULL ) \ fMPEGErr = fopen(MY_DUMP_FILE_PATGH, "w"); \ \ if( fMPEGErr != NULL ) \ { \ fprintf(fMPEGErr, "%d: ",__LINE__); \ fprintf(fMPEGErr,__VA_ARGS__); \ fflush( fMPEGErr ); \ } \ } #define viewerr_exit(err) { dlog("XXXXXXXXXXXXXXXXXXXXXXXXXXXX err = %d, exiting!!!\n", (int)err); exit(-1); } #define viewerr_safe(err) { dlog("XXXXXXXXXXXXXXXXXXXXXXXXXXXX err = %d\n", (int)err);} #else #define dlog(...) #define viewerr_exit(err) #define viewerr_safe(err) #endif #define MAX_PROGRAM_NUM 8 #define MAX_TRACK 5 #define MIN_FRAME_SAMPLE_BUFFER_SIZE 1024*16 #define MAX_COUNT_FOR_FRAME_RATE 11 #define MPEG_TS_SYNC_BYTE 0x47 #define NALU_LEN 4 // NAL unit definitions //#define NAL_STORAGE_IDC_BITS 0x60 #define NAL_UNITTYPE_BITS 0x1f #define MPEG_VIDEO_DEFAULT_TIME_SCALE 90000 #define kMPEGDemuxerErrNeedMoreTime -202 #define ID_VIDEO 0xE0 #define ID_AUDIO 0xC0 //PF.J 2012.01.11 /* MPEG start code IDs */ #define PICTURE_START_CODE 0x100 #define SLICE_START_CODE_MIN 0x101 #define SLICE_START_CODE_MAX 0x1AF #define USER_DATA_START_CODE 0x1B2 #define SEQUENCE_HEADER_CODE 0x1B3 #define SEQUENCE_ERROR_CODE 0x1B4 #define EXTENSION_START_CODE 0x1B5 #define SEQUENCE_END_CODE 0x1B7 #define GROUP_START_CODE 0x1B8 /* extension start code IDs */ #define SEQUENCE_EXTENSION_ID 1 #define SEQUENCE_DISPLAY_EXTENSION_ID 2 #define QUANT_MATRIX_EXTENSION_ID 3 #define COPYRIGHT_EXTENSION_ID 4 #define SEQUENCE_SCALABLE_EXTENSION_ID 5 #define PICTURE_DISPLAY_EXTENSION_ID 7 #define PICTURE_CODING_EXTENSION_ID 8 #define PICTURE_SPATIAL_SCALABLE_EXTENSION_ID 9 #define PICTURE_TEMPORAL_SCALABLE_EXTENSION_ID 10 typedef enum { NAL_UT_RESERVED = 0x00, // Reserved NAL_UT_SLICE = 0x01, // Coded Slice - slice_layer_no_partioning_rbsp NAL_UT_DPA = 0x02, // Coded Data partition A - dpa_layer_rbsp NAL_UT_DPB = 0x03, // Coded Data partition A - dpa_layer_rbsp NAL_UT_DPC = 0x04, // Coded Data partition A - dpa_layer_rbsp NAL_UT_IDR_SLICE = 0x05, // Coded Slice of a IDR Picture - slice_layer_no_partioning_rbsp NAL_UT_SEI = 0x06, // Supplemental Enhancement Information - sei_rbsp NAL_UT_SPS = 0x07, // Sequence Parameter Set - seq_parameter_set_rbsp NAL_UT_PPS = 0x08, // Picture Parameter Set - pic_parameter_set_rbsp NAL_UT_PD = 0x09, // Picture Delimiter - pic_delimiter_rbsp NAL_UT_FD = 0x0a // Filler Data - filler_data_rbsp } NAL_Unit_Type; typedef enum { TRACK_MPEG1V = 0x01, TRACK_MPEG2V = 0x02, TRACK_MPEGA = 0x03, TRACK_MPEGA_x = 0x04, TRACK_AAC = 0x0F, TRACK_MPEG4V = 0x10, TRACK_AAC_x = 0x11, TRACK_H264 = 0x1A, TRACK_H264_x = 0x1B, TRACK_AC3 = 0x81, TRACK_LPCM = 0x83 } MPEG_Stream_Type; #define IS_VIDEO_FORMAT(x) ((x==TRACK_MPEG1V)||(x==TRACK_MPEG2V) ||(x==TRACK_MPEG4V)||(x==TRACK_H264 )||(x==TRACK_H264_x)) #define IS_AUDIO_FORMAT(x) ((x==TRACK_MPEGA )||(x==TRACK_MPEGA_x)||(x==TRACK_AAC )||(x==TRACK_AAC_x)||(x==TRACK_AC3 )||(x==TRACK_LPCM )) typedef struct { unsigned char configurationVersion; unsigned char AVCProfileIndication; unsigned char profile_compatibility; unsigned char ACVLevelIndication; unsigned char naluLengthSize; unsigned char numberofPictureParameterSets; unsigned char numberofSequenceParameterSets; unsigned char *sps; unsigned short spsSize; unsigned char *pps; unsigned short ppsSize; unsigned char spspps[256]; unsigned short spsppsSize; } mpeg_AVCC; typedef struct { unsigned long hi; unsigned long lo; }TIME_64; #if 0 #define MAX_U32_VALUE 0xffffffff #define IS_VALID_TIME(t) ((t)->hi!= MAX_U32_VALUE && (t)->lo!= MAX_U32_VALUE ) #define INVALIDATE_TIME(t) {(t)->hi = MAX_U32_VALUE; (t)->lo = MAX_U32_VALUE;} #define BIGGER_TIME(t1, t2 ) ( (t1)->lo > (t2)->lo ) //***bnie: not regarding hi bit yet //#define DIFF_TIME(t1, t2 ) ( (t1)->lo - (t2)->lo ) //***bnie: not regarding hi bit yet #define MY_64_ABS(a) ((a)->lo=(a)->lo>=0?(a)->lo:-(a)->lo) #define DIFF_TIME_64(t0, t1, t2 ) {(t0)->hi = 0; (t0)->lo = (t1)->lo - (t2)->lo;} //***bnie: not regarding hi bit yet #define DIFF_TIME_64_ABS(t0, t1, t2) { DIFF_TIME_64(t0, t1, t2 ); MY_64_ABS(t0); } //***bnie: not regarding hi bit yet #define GET_TIME_64(t ) ( (t)->lo ) //***bnie: not regarding hi bit yet #else #define MAX_U32_VALUE 0xffffffff #define IS_VALID_TIME(t) ((t)->hi!= MAX_U32_VALUE && (t)->lo!= MAX_U32_VALUE ) #define INVALIDATE_TIME(t) {(t)->hi = MAX_U32_VALUE; (t)->lo = MAX_U32_VALUE;} #define GET_TIME_64_Hi(t ) ( (t)->hi ) #define GET_TIME_64_Lo(t ) ( (t)->lo ) #define BIGGER_TIME(t1, t2 ) ( \ (t1)->hi == (t2)->hi ? \ ( (t1)->lo > (t2)->lo ) \ : \ ( (t1)->hi > (t2)->hi ? 1 : 0 ) \ ) #define IS_DIFFERENT_TIME( a, b ) ( \ IS_VALID_TIME(a) && \ IS_VALID_TIME(b) && \ ( \ ((a)->hi!=(b)->hi) || \ ((a)->lo!=(b)->lo) \ ) \ ) #define DIFF_TIME_64_ABS(t0, t1, t2) { \ TIME_64 *a, *b; \ if( BIGGER_TIME( t1, t2 ) ) \ { \ a = (t1); \ b = (t2); \ } \ else \ { \ b = (t1); \ a = (t2); \ } \ \ if( a->hi == b->hi ) \ { \ (t0)->hi = 0; \ (t0)->lo = a->lo - b->lo; \ } \ else \ { \ unsigned long hi = a->hi - b->hi; \ unsigned long lo = (a->lo >= b->lo) ? a->lo - b->lo : b->lo - a->lo; \ \ if( a->lo < b->lo) \ { \ hi--; \ lo = MAX_U32_VALUE - lo; \ } \ \ (t0)->hi = hi; \ (t0)->lo = lo; \ } \ } #endif typedef struct { int pid; int stream_id; TIME_64 time_pre; TIME_64 time_dec; int size; unsigned char *buf; int buf_size; int has_frame; }FRAME_BUFFER; typedef struct { int is_valid; int stream_id; int pes_packet_length; int always_10; int pes_scrambling_control; int pes_priority; int data_alignment_indicator; int copy_right; int original_or_copy; int pts_dts_flag; int escr_flag; int es_rate_flag; int dsm_trick_mode_flag; int additional_copy_info_flag; int pes_crc_flag; int pes_extension_flag; TIME_64 presentation_time_stamp; TIME_64 decoding_time_stamp; int pes_header_data_length; int ES_rate; int trick_mode_control; int field; int intra_slice_refresh; int frequency_truncation; int rep_cntrl; int additional_copy_info; int previous_PES_packet_CRC; }PES_HEADER; //PF.J 2012.01.12 MPEG HEADER typedef struct { int horizontal_size; int vertical_size; int aspect_fatio_information; int frame_rate_code; int bit_rate_code; int mp2_video_flag; }MPEG_SEQ_HEADER; typedef struct { int profile_and_level_indication; int progressive_sequence; int chroma_format; int horizontal_size_extension; int vertical_size_extension; int bit_rate_extension; int low_delay; int frame_rate_extension_n; int frame_rate_extension_d; }MPEG_SEQEXT_HEADER; typedef struct { int initialized; int video_header_initialized; int video_elementary_pid; int video_format; int video_timescale; //PF.J 2012.01.12 int video_bitrate; float video_framerate; int video_height; int video_width; int video_profile; int video_level; int audio_header_initialized; int audio_elementary_pid; int audio_format; int audio_sample_offset; //Pf.J 2012.01.13 UInt32 audio_profile; UInt32 audio_level; int audio_bitrate; int audio_samplerate; int audio_channel_total; int audio_layer; FRAME_BUFFER fb_ary[MAX_TRACK]; unsigned char *audio_codec_header_data; int audio_codec_header_data_size; unsigned char *video_codec_header_data; int video_codec_header_data_size; void *priv; int frame_total; int frame_offsets[64]; int frame_sizes[64]; //PF.J 2012.01.12 MPEG_SEQ_HEADER msh; MPEG_SEQEXT_HEADER mseh; }MPEG_DEMUXER; #define SHOW_BYTE(d, p) { d = ((p[0]<<0)); } #define SHOW_SHORT_BE(d, p) { d = ((p[0]<<8)|(p[1]<<0)); } #define SHOW_LONG_BE(d, p) { d = ((p[0]<<24)|(p[1]<<16)|(p[2]<<8)|(p[3]<<0)); } #define GET_BYTE(d, p) { d = ((p[0]<<0)); p++; } #define GET_SHORT_BE(d, p) { d = ((p[0]<<8)|(p[1]<<0)); p+= 2; } #define GET_24BITS_BE(d, p) { d = ((p[0]<<16)|(p[1]<<8)|(p[0]<<0)); p+= 3; } #define GET_LONG_BE(d, p) { d = ((p[0]<<24)|(p[1]<<16)|(p[2]<<8)|(p[3]<<0)); p += 4; } #define TS_LENGTH 188 #define IS_AUDIO_STREAM(id) ((id&0xe0) == 0xc0 ) #define IS_VIDEO_STREAM(id) ((id&0xf0) == 0xe0 ) #define IS_PADDING_STREAM(id) ((id ) == 0xbe ) #define IS_PRIVATE_STREAM(id) ((id ) == 0xbd ) #define IS_PROGRAM_ASSOCIATION_TABLE(id) ((id) == 0x00 ) #define LONGB2N(a) (((a>>24)&0x000000ff) | \ ((a>>8 )&0x0000ff00) | \ ((a<<8 )&0x00ff0000) | \ ((a<<24)&0xff000000) ) #define DECODE_TS(p_x, hi_x, lo_x, ref_x ) \ { \ int bits_00xx; \ int marker_bit; \ int bits_3; \ int bits_15_1; \ int bits_15_2; \ int tmp_x; \ \ tmp_x = p_x[0]; p_x++; \ bits_00xx = (tmp_x>>4)&0x0f; \ if( bits_00xx != ref_x ) \ { \ dlog( "wrong time stamp start marker!!!\n"); \ } \ bits_3 = (tmp_x>>1)&0x07; \ marker_bit= (tmp_x>>0)&0x01; \ \ GET_LONG_BE(tmp_x, p) \ bits_15_1 = (tmp_x>>17)&0x7fff; \ marker_bit= (tmp_x>>16)&0x0001; \ bits_15_2 = (tmp_x>> 1)&0x7fff; \ marker_bit= (tmp_x>> 0)&0x0001; \ \ hi_x = bits_3>>2; \ lo_x = (bits_3<<30)|(bits_15_1<<15)|bits_15_2; \ } #ifdef __cplusplus extern "C" { #endif int md_new( MPEG_DEMUXER **md_out ); void md_dispose( MPEG_DEMUXER *md ); int md_reset_buffer( MPEG_DEMUXER *md ); void find_mp3_boundary_from_end( unsigned char *src, int size, int *boundary ); int parse_pes_packet( unsigned char *p, PES_HEADER *ph, int *offset, int *size ); int pars_mp3_header(unsigned char *header, long size, long *sampleRate, long *channelCount); int divide_adts( unsigned char *s, int size, int *total, int offset, int *sizes, int *offsets ); int divide_mp3( unsigned char *s, int size, int *total, int *sizes, int *offsets ); int check_avc_sample_integrity(unsigned char *src, int size, int naluLengthSize ); int check_nalu( int is_startcode, unsigned char *data, int size, long *nalu_type_out, long *ref_idc_out ); void my_assert(int is_true ); int md_ps_parse_header_x( MPEG_DEMUXER *md, unsigned char *mpeg_bytes, int *is_audio, PES_HEADER *pesh_x, int *pes_offset, int *pes_size ); int md_ts_parse_header( MPEG_DEMUXER *md, unsigned char *mpeg_bytes ); int md_ps_reassemble_sample ( MPEG_DEMUXER *md, PES_HEADER *pesh_x, int use_raw, unsigned char *pes_bytes, int pes_size, int *is_video, unsigned char **bs_bytes_out, int *bs_size, int sc_flag, int sc_size, TIME_64 *time_pre, TIME_64 *time_dec); int md_parse_video_codec( MPEG_DEMUXER *md, unsigned char *bs_bytes, int bs_size ); int md_parse_audio_codec( MPEG_DEMUXER *md, unsigned char *bs_bytes, int bs_size ); FRAME_BUFFER *get_fb_by_idx( FRAME_BUFFER *track, int pid, int stream_id ); int startcode2len( unsigned char *data, int size, unsigned char *qt_data, int *out_size ); int startcode2lenskip( unsigned char *data, int size, unsigned char *qt_data, int *out_size, int *skip_bytes ); int checkframestart( unsigned char *data, int size, int *hasframe ); void rest_frame_buffer( FRAME_BUFFER *f ); void refit_frame_buffer( FRAME_BUFFER *f, int size ); int check_start_code(unsigned char *data, int size, int *offset, int format); //PF.J 2012.01.11 void sequence_header(MPEG_DEMUXER *md, unsigned char *mpeg_bytes); void group_of_pictures_header(MPEG_DEMUXER *md, unsigned char *mpeg_bytes); void picture_header(MPEG_DEMUXER *md, unsigned char *mpeg_bytes); void extension_and_user_data(MPEG_DEMUXER *md, unsigned char *mpeg_bytes); #ifdef __cplusplus } #endif #endif
{ "pile_set_name": "Github" }
//----------------------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.Runtime.Serialization { using System; using System.Collections.Generic; using System.Reflection; using System.Security; using System.Security.Permissions; using System.Threading; using System.Xml; using System.Xml.Schema; using System.Xml.Serialization; using DataContractDictionary = System.Collections.Generic.Dictionary<System.Xml.XmlQualifiedName, DataContract>; internal delegate IXmlSerializable CreateXmlSerializableDelegate(); #if USE_REFEMIT public sealed class XmlDataContract : DataContract #else internal sealed class XmlDataContract : DataContract #endif { [Fx.Tag.SecurityNote(Critical = "Holds instance of CriticalHelper which keeps state that is cached statically for serialization." + " Static fields are marked SecurityCritical or readonly to prevent data from being modified or leaked to other components in appdomain.")] [SecurityCritical] XmlDataContractCriticalHelper helper; [Fx.Tag.SecurityNote(Critical = "Initializes SecurityCritical field 'helper'.", Safe = "Doesn't leak anything.")] [SecuritySafeCritical] internal XmlDataContract() : base(new XmlDataContractCriticalHelper()) { helper = base.Helper as XmlDataContractCriticalHelper; } [Fx.Tag.SecurityNote(Critical = "Initializes SecurityCritical field 'helper'.", Safe = "Doesn't leak anything.")] [SecuritySafeCritical] internal XmlDataContract(Type type) : base(new XmlDataContractCriticalHelper(type)) { helper = base.Helper as XmlDataContractCriticalHelper; } internal override DataContractDictionary KnownDataContracts { [Fx.Tag.SecurityNote(Critical = "Fetches the critical KnownDataContracts property.", Safe = "KnownDataContracts only needs to be protected for write.")] [SecuritySafeCritical] get { return helper.KnownDataContracts; } [Fx.Tag.SecurityNote(Critical = "Sets the critical KnownDataContracts property.")] [SecurityCritical] set { helper.KnownDataContracts = value; } } internal XmlSchemaType XsdType { [Fx.Tag.SecurityNote(Critical = "Fetches the critical XsdType property.", Safe = "XsdType only needs to be protected for write.")] [SecuritySafeCritical] get { return helper.XsdType; } [Fx.Tag.SecurityNote(Critical = "Sets the critical XsdType property.")] [SecurityCritical] set { helper.XsdType = value; } } internal bool IsAnonymous { [Fx.Tag.SecurityNote(Critical = "Fetches the critical IsAnonymous property.", Safe = "IsAnonymous only needs to be protected for write.")] [SecuritySafeCritical] get { return helper.IsAnonymous; } } internal override bool HasRoot { [Fx.Tag.SecurityNote(Critical = "Fetches the critical HasRoot property.", Safe = "HasRoot only needs to be protected for write.")] [SecuritySafeCritical] get { return helper.HasRoot; } [Fx.Tag.SecurityNote(Critical = "Sets the critical HasRoot property.")] [SecurityCritical] set { helper.HasRoot = value; } } internal override XmlDictionaryString TopLevelElementName { [Fx.Tag.SecurityNote(Critical = "Fetches the critical TopLevelElementName property.", Safe = "TopLevelElementName only needs to be protected for write.")] [SecuritySafeCritical] get { return helper.TopLevelElementName; } [Fx.Tag.SecurityNote(Critical = "Sets the critical TopLevelElementName property.")] [SecurityCritical] set { helper.TopLevelElementName = value; } } internal override XmlDictionaryString TopLevelElementNamespace { [Fx.Tag.SecurityNote(Critical = "Fetches the critical TopLevelElementNamespace property.", Safe = "TopLevelElementNamespace only needs to be protected for write.")] [SecuritySafeCritical] get { return helper.TopLevelElementNamespace; } [Fx.Tag.SecurityNote(Critical = "Sets the critical TopLevelElementNamespace property.")] [SecurityCritical] set { helper.TopLevelElementNamespace = value; } } internal bool IsTopLevelElementNullable { [Fx.Tag.SecurityNote(Critical = "Fetches the critical IsTopLevelElementNullable property.", Safe = "IsTopLevelElementNullable only needs to be protected for write.")] [SecuritySafeCritical] get { return helper.IsTopLevelElementNullable; } [Fx.Tag.SecurityNote(Critical = "Sets the critical IsTopLevelElementNullable property.")] [SecurityCritical] set { helper.IsTopLevelElementNullable = value; } } internal bool IsTypeDefinedOnImport { [Fx.Tag.SecurityNote(Critical = "Fetches the critical IsTypeDefinedOnImport property.", Safe = "IsTypeDefinedOnImport only needs to be protected for write.")] [SecuritySafeCritical] get { return helper.IsTypeDefinedOnImport; } [Fx.Tag.SecurityNote(Critical = "Sets the critical IsTypeDefinedOnImport property.")] [SecurityCritical] set { helper.IsTypeDefinedOnImport = value; } } internal CreateXmlSerializableDelegate CreateXmlSerializableDelegate { [Fx.Tag.SecurityNote(Critical = "Fetches the critical CreateXmlSerializableDelegate property.", Safe = "CreateXmlSerializableDelegate only needs to be protected for write; initialized in getter if null.")] [SecuritySafeCritical] get { if (helper.CreateXmlSerializableDelegate == null) { lock (this) { if (helper.CreateXmlSerializableDelegate == null) { CreateXmlSerializableDelegate tempCreateXmlSerializable = GenerateCreateXmlSerializableDelegate(); Thread.MemoryBarrier(); helper.CreateXmlSerializableDelegate = tempCreateXmlSerializable; } } } return helper.CreateXmlSerializableDelegate; } } internal override bool CanContainReferences { get { return false; } } internal override bool IsBuiltInDataContract { get { return UnderlyingType == Globals.TypeOfXmlElement || UnderlyingType == Globals.TypeOfXmlNodeArray; } } [Fx.Tag.SecurityNote(Critical = "Holds all state used for for (de)serializing XML types." + " Since the data is cached statically, we lock down access to it.")] [SecurityCritical(SecurityCriticalScope.Everything)] class XmlDataContractCriticalHelper : DataContract.DataContractCriticalHelper { DataContractDictionary knownDataContracts; bool isKnownTypeAttributeChecked; XmlDictionaryString topLevelElementName; XmlDictionaryString topLevelElementNamespace; bool isTopLevelElementNullable; bool isTypeDefinedOnImport; XmlSchemaType xsdType; bool hasRoot; CreateXmlSerializableDelegate createXmlSerializable; internal XmlDataContractCriticalHelper() { } internal XmlDataContractCriticalHelper(Type type) : base(type) { if (type.IsDefined(Globals.TypeOfDataContractAttribute, false)) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.IXmlSerializableCannotHaveDataContract, DataContract.GetClrTypeFullName(type)))); if (type.IsDefined(Globals.TypeOfCollectionDataContractAttribute, false)) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.IXmlSerializableCannotHaveCollectionDataContract, DataContract.GetClrTypeFullName(type)))); XmlSchemaType xsdType; bool hasRoot; XmlQualifiedName stableName; SchemaExporter.GetXmlTypeInfo(type, out stableName, out xsdType, out hasRoot); this.StableName = stableName; this.XsdType = xsdType; this.HasRoot = hasRoot; XmlDictionary dictionary = new XmlDictionary(); this.Name = dictionary.Add(StableName.Name); this.Namespace = dictionary.Add(StableName.Namespace); object[] xmlRootAttributes = (UnderlyingType == null) ? null : UnderlyingType.GetCustomAttributes(Globals.TypeOfXmlRootAttribute, false); if (xmlRootAttributes == null || xmlRootAttributes.Length == 0) { if (hasRoot) { topLevelElementName = Name; topLevelElementNamespace = (this.StableName.Namespace == Globals.SchemaNamespace) ? DictionaryGlobals.EmptyString : Namespace; isTopLevelElementNullable = true; } } else { if (hasRoot) { XmlRootAttribute xmlRootAttribute = (XmlRootAttribute)xmlRootAttributes[0]; isTopLevelElementNullable = xmlRootAttribute.IsNullable; string elementName = xmlRootAttribute.ElementName; topLevelElementName = (elementName == null || elementName.Length == 0) ? Name : dictionary.Add(DataContract.EncodeLocalName(elementName)); string elementNs = xmlRootAttribute.Namespace; topLevelElementNamespace = (elementNs == null || elementNs.Length == 0) ? DictionaryGlobals.EmptyString : dictionary.Add(elementNs); } else { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.IsAnyCannotHaveXmlRoot, DataContract.GetClrTypeFullName(UnderlyingType)))); } } } internal override DataContractDictionary KnownDataContracts { get { if (!isKnownTypeAttributeChecked && UnderlyingType != null) { lock (this) { if (!isKnownTypeAttributeChecked) { knownDataContracts = DataContract.ImportKnownTypeAttributes(this.UnderlyingType); Thread.MemoryBarrier(); isKnownTypeAttributeChecked = true; } } } return knownDataContracts; } set { knownDataContracts = value; } } internal XmlSchemaType XsdType { get { return xsdType; } set { xsdType = value; } } internal bool IsAnonymous { get { return xsdType != null; } } internal override bool HasRoot { get { return hasRoot; } set { hasRoot = value; } } internal override XmlDictionaryString TopLevelElementName { get { return topLevelElementName; } set { topLevelElementName = value; } } internal override XmlDictionaryString TopLevelElementNamespace { get { return topLevelElementNamespace; } set { topLevelElementNamespace = value; } } internal bool IsTopLevelElementNullable { get { return isTopLevelElementNullable; } set { isTopLevelElementNullable = value; } } internal bool IsTypeDefinedOnImport { get { return isTypeDefinedOnImport; } set { isTypeDefinedOnImport = value; } } internal CreateXmlSerializableDelegate CreateXmlSerializableDelegate { get { return createXmlSerializable; } set { createXmlSerializable = value; } } } ConstructorInfo GetConstructor() { Type type = UnderlyingType; if (type.IsValueType) return null; ConstructorInfo ctor = type.GetConstructor(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public, null, Globals.EmptyTypeArray, null); if (ctor == null) throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.IXmlSerializableMustHaveDefaultConstructor, DataContract.GetClrTypeFullName(type)))); return ctor; } [Fx.Tag.SecurityNote(Critical = "Sets critical properties on XmlDataContract.")] [SecurityCritical] internal void SetTopLevelElementName(XmlQualifiedName elementName) { if (elementName != null) { XmlDictionary dictionary = new XmlDictionary(); this.TopLevelElementName = dictionary.Add(elementName.Name); this.TopLevelElementNamespace = dictionary.Add(elementName.Namespace); } } [Fx.Tag.SecurityNote(Critical = "Calls CodeGenerator.BeginMethod which is SecurityCritical.", Safe = "Self-contained: returns the delegate to the generated IL but otherwise all IL generation is self-contained here.")] [SecuritySafeCritical] internal CreateXmlSerializableDelegate GenerateCreateXmlSerializableDelegate() { Type type = this.UnderlyingType; CodeGenerator ilg = new CodeGenerator(); bool memberAccessFlag = RequiresMemberAccessForCreate(null); try { ilg.BeginMethod("Create" + DataContract.GetClrTypeFullName(type), typeof(CreateXmlSerializableDelegate), memberAccessFlag); } catch (SecurityException securityException) { if (memberAccessFlag && securityException.PermissionType.Equals(typeof(ReflectionPermission))) { RequiresMemberAccessForCreate(securityException); } else { throw; } } if (type.IsValueType) { System.Reflection.Emit.LocalBuilder local = ilg.DeclareLocal(type, type.Name + "Value"); ilg.Ldloca(local); ilg.InitObj(type); ilg.Ldloc(local); } else { ilg.New(GetConstructor()); } ilg.ConvertValue(this.UnderlyingType, Globals.TypeOfIXmlSerializable); ilg.Ret(); return (CreateXmlSerializableDelegate)ilg.EndMethod(); } [Fx.Tag.SecurityNote(Miscellaneous = "RequiresReview - Calculates whether this Xml type requires MemberAccessPermission for deserialization." + " Since this information is used to determine whether to give the generated code access" + " permissions to private members, any changes to the logic should be reviewed.")] bool RequiresMemberAccessForCreate(SecurityException securityException) { if (!IsTypeVisible(UnderlyingType)) { if (securityException != null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new SecurityException(SR.GetString(SR.PartialTrustIXmlSerializableTypeNotPublic, DataContract.GetClrTypeFullName(UnderlyingType)), securityException)); } return true; } if (ConstructorRequiresMemberAccess(GetConstructor())) { if (securityException != null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new SecurityException(SR.GetString(SR.PartialTrustIXmlSerialzableNoPublicConstructor, DataContract.GetClrTypeFullName(UnderlyingType)), securityException)); } return true; } return false; } internal override bool Equals(object other, Dictionary<DataContractPairKey, object> checkedContracts) { if (IsEqualOrChecked(other, checkedContracts)) return true; XmlDataContract dataContract = other as XmlDataContract; if (dataContract != null) { if (this.HasRoot != dataContract.HasRoot) return false; if (this.IsAnonymous) { return dataContract.IsAnonymous; } else { return (StableName.Name == dataContract.StableName.Name && StableName.Namespace == dataContract.StableName.Namespace); } } return false; } public override int GetHashCode() { return base.GetHashCode(); } public override void WriteXmlValue(XmlWriterDelegator xmlWriter, object obj, XmlObjectSerializerWriteContext context) { if (context == null) XmlObjectSerializerWriteContext.WriteRootIXmlSerializable(xmlWriter, obj); else context.WriteIXmlSerializable(xmlWriter, obj); } public override object ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) { object o; if (context == null) { o = XmlObjectSerializerReadContext.ReadRootIXmlSerializable(xmlReader, this, true /*isMemberType*/); } else { o = context.ReadIXmlSerializable(xmlReader, this, true /*isMemberType*/); context.AddNewObject(o); } xmlReader.ReadEndElement(); return o; } } }
{ "pile_set_name": "Github" }
<!-- Automatically generated HTML file from DocOnce source (https://github.com/hplgit/doconce/) --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="DocOnce: https://github.com/hplgit/doconce/" /> <meta name="description" content="Introduction to Monte Carlo methods"> <title>Introduction to Monte Carlo methods</title> <!-- Bootstrap style: bootstrap --> <link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"> <!-- not necessary <link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> --> <script src="http://sagecell.sagemath.org/static/jquery.min.js"></script> <script src="http://sagecell.sagemath.org/embedded_sagecell.js"></script> <link rel="stylesheet" type="text/css" href="https://sagecell.sagemath.org/static/sagecell_embed.css"> <script> $(function () { // Make the div with id 'mycell' a Sage cell sagecell.makeSagecell({inputLocation: '#mycell', template: sagecell.templates.minimal, evalButtonText: 'Activate'}); // Make *any* div with class 'compute' a Sage cell sagecell.makeSagecell({inputLocation: 'div.compute', evalButtonText: 'Evaluate'}); }); </script> </head> <!-- tocinfo {'highest level': 1, 'sections': [('Monte Carlo methods, plan for the lectures', 2, None, '___sec0'), ('Monte Carlo: Enhances algorithmic thinking!', 2, None, '___sec1'), ('Domains and probabilities', 2, None, '___sec2'), ('Monte Carlo methods, tossing a dice', 2, None, '___sec3'), ('Stochastic variables', 2, None, '___sec4'), ('Stochastic variables and the main concepts, the discrete case', 2, None, '___sec5'), ('Stochastic variables and the main concepts, the continuous case', 2, None, '___sec6'), ('The cumulative probability', 2, None, '___sec7'), ('Properties of PDFs', 2, None, '___sec8'), ('Important distributions, the uniform distribution', 2, None, '___sec9'), ('Gaussian distribution', 2, None, '___sec10'), ('Exponential distribution', 2, None, '___sec11'), ('Expectation values', 2, None, '___sec12'), ('Stochastic variables and the main concepts, mean values', 2, None, '___sec13'), ('Stochastic variables and the main concepts, central moments, the variance', 2, None, '___sec14'), ('First Illustration of the Use of Monte-Carlo Methods, integration', 2, None, '___sec15'), ('First Illustration of the Use of Monte-Carlo Methods, integration', 2, None, '___sec16'), ('First Illustration of the Use of Monte-Carlo Methods, variance in integration', 2, None, '___sec17'), ('Monte-Carlo integration, meaning of variance', 2, None, '___sec18'), ('First Illustration of the Use of Monte-Carlo Methods, integration', 2, None, '___sec19'), ('Important aspects of Monte-Carlo Methods', 2, None, '___sec20'), ('Why Monte Carlo integration?', 2, None, '___sec21'), ('Why Monte Carlo integration?', 2, None, '___sec22'), ('Why Monte Carlo integration? Example', 2, None, '___sec23'), ('Monte Carlo integration, simple example', 2, None, '___sec24'), ('Monte Carlo integration, simple example', 2, None, '___sec25'), ('Monte Carlo integration, simple example', 2, None, '___sec26'), ('Monte Carlo integration, simple example', 2, None, '___sec27'), ('Monte Carlo integration, algorithm', 2, None, '___sec28'), ('Monte Carlo integration, simple example, the program', 2, None, '___sec29'), ('Monte Carlo integration, simple example and the results', 2, None, '___sec30'), ('Testing against the trapezoidal rule for a one-dimensional integral', 2, None, '___sec31'), ('Second example, particles in a box', 2, None, '___sec32'), ('Second example, particles in a box', 2, None, '___sec33'), ('Second example, particles in a box', 2, None, '___sec34'), ('Second example, particles in a box, discussion', 2, None, '___sec35'), ('Second example, particles in a box, discussion', 2, None, '___sec36'), ('Simple demonstration using python', 2, None, '___sec37'), ('Brief Summary', 2, None, '___sec38'), ('Probability Distribution Functions', 2, None, '___sec39'), ('Probability Distribution Functions', 2, None, '___sec40'), ('The three famous Probability Distribution Functions', 2, None, '___sec41'), ('Probability Distribution Functions, the normal distribution', 2, None, '___sec42'), ('Probability Distribution Functions, the normal distribution', 2, None, '___sec43'), ('Probability Distribution Functions, the cumulative distribution', 2, None, '___sec44'), ('Probability Distribution Functions, other important distribution', 2, None, '___sec45'), ('Probability Distribution Functions, the binomial distribution', 2, None, '___sec46'), ("Probability Distribution Functions, Poisson's distribution", 2, None, '___sec47'), ("Probability Distribution Functions, Poisson's distribution", 2, None, '___sec48'), ('Meet the covariance!', 2, None, '___sec49'), ('Meet the covariance in matrix disguise', 2, None, '___sec50'), ('Meet the covariance, uncorrelated events', 2, None, '___sec51'), ('Numerical experiments and the covariance', 2, None, '___sec52'), ('Numerical experiments and the covariance', 2, None, '___sec53'), ('Numerical experiments and the covariance, actual situations', 2, None, '___sec54'), ('Numerical experiments and the covariance, our observables', 2, None, '___sec55'), ('Numerical experiments and the covariance, the sample variance', 2, None, '___sec56'), ('Numerical experiments and the covariance, central limit theorem', 2, None, '___sec57'), ('Definition of Correlation Functions and Standard Deviation', 2, None, '___sec58'), ('Definition of Correlation Functions and Standard Deviation', 2, None, '___sec59'), ('Definition of Correlation Functions and Standard Deviation', 2, None, '___sec60'), ('Definition of Correlation Functions and Standard Deviation', 2, None, '___sec61'), ('Definition of Correlation Functions and Standard Deviation, sample variance', 2, None, '___sec62'), ('Definition of Correlation Functions and Standard Deviation', 2, None, '___sec63'), ('Random Numbers', 1, None, '___sec64'), ('Random Numbers, better name: pseudo random numbers', 1, None, '___sec65'), ('Random number generator RNG', 1, None, '___sec66'), ('Random number generator RNG and periodic outputs', 1, None, '___sec67'), ('Random number generator RNG and its period', 1, None, '___sec68'), ('Random number generator RNG, other examples', 1, None, '___sec69'), ('Random number generator RNG, other examples', 1, None, '___sec70'), ('Random number generator RNG, RAN0', 1, None, '___sec71'), ('Random number generator RNG, RAN0', 1, None, '___sec72'), ('Random number generator RNG, RAN0', 1, None, '___sec73'), ('Random number generator RNG, RAN0', 1, None, '___sec74'), ('Random number generator RNG, RAN0 code', 1, None, '___sec75'), ('Properties of Selected Random Number Generators', 2, None, '___sec76'), ('Properties of Selected Random Number Generators', 2, None, '___sec77'), ('Properties of Selected Random Number Generators', 2, None, '___sec78'), ('Simple demonstration of RNGs using python', 2, None, '___sec79'), ('Properties of Selected Random Number Generators', 2, None, '___sec80'), ('Improved Monte Carlo Integration', 1, None, '___sec81'), ('Change of Variables', 2, None, '___sec82'), ('Change of Variables', 2, None, '___sec83'), ('Transformed Uniform Distribution', 2, None, '___sec84'), ('Exponential Distribution', 2, None, '___sec85'), ('Exponential Distribution', 2, None, '___sec86'), ('Exponential Distribution', 2, None, '___sec87'), ('Normal Distribution', 2, None, '___sec88'), ('Normal Distribution', 2, None, '___sec89'), ('Normal Distribution', 2, None, '___sec90'), ('Normal Distribution', 2, None, '___sec91'), ('Normal Distribution', 2, None, '___sec92'), ('Importance Sampling', 2, None, '___sec93'), ('Importance Sampling', 2, None, '___sec94'), ('Importance Sampling', 2, None, '___sec95'), ('Importance Sampling', 2, None, '___sec96'), ('Importance Sampling', 2, None, '___sec97'), ('Importance Sampling', 2, None, '___sec98'), ('Acceptance-Rejection Method', 2, None, '___sec99'), ('Acceptance-Rejection Method', 2, None, '___sec100'), ('Acceptance-Rejection Method', 2, None, '___sec101'), ('Monte Carlo Integration of Multidimensional Integrals', 2, None, '___sec102'), ('Monte Carlo Integration of Multidimensional Integrals', 2, None, '___sec103'), ('Monte Carlo Integration of Multidimensional Integrals', 2, None, '___sec104'), ('Monte Carlo Integration of Multidimensional Integrals', 2, None, '___sec105'), ('Monte Carlo Integration of Multidimensional Integrals', 2, None, '___sec106'), ('Brute Force Integration', 2, None, '___sec107'), ('Importance Sampling', 2, None, '___sec108'), ('Results', 2, None, '___sec109')]} end of tocinfo --> <body> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ TeX: { equationNumbers: { autoNumber: "none" }, extensions: ["AMSmath.js", "AMSsymbols.js", "autobold.js", "color.js"] } }); </script> <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script> <!-- Bootstrap navigation bar --> <div class="navbar navbar-default navbar-fixed-top"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="mcint.do.txt-bs.html">Introduction to Monte Carlo methods</a> </div> <div class="navbar-collapse collapse navbar-responsive-collapse"> <ul class="nav navbar-nav navbar-right"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Contents <b class="caret"></b></a> <ul class="dropdown-menu"> <!-- navigation toc: --> <li><a href="._mcint.do.txt-bs065.html#___sec64" style="font-size: 80%;">Random Numbers</a></li> <!-- navigation toc: --> <li><a href="._mcint.do.txt-bs066.html#___sec65" style="font-size: 80%;">Random Numbers, better name: pseudo random numbers</a></li> <!-- navigation toc: --> <li><a href="._mcint.do.txt-bs067.html#___sec66" style="font-size: 80%;">Random number generator RNG</a></li> <!-- navigation toc: --> <li><a href="._mcint.do.txt-bs068.html#___sec67" style="font-size: 80%;">Random number generator RNG and periodic outputs</a></li> <!-- navigation toc: --> <li><a href="._mcint.do.txt-bs069.html#___sec68" style="font-size: 80%;">Random number generator RNG and its period</a></li> <!-- navigation toc: --> <li><a href="._mcint.do.txt-bs070.html#___sec69" style="font-size: 80%;">Random number generator RNG, other examples</a></li> <!-- navigation toc: --> <li><a href="._mcint.do.txt-bs071.html#___sec70" style="font-size: 80%;">Random number generator RNG, other examples</a></li> <!-- navigation toc: --> <li><a href="._mcint.do.txt-bs072.html#___sec71" style="font-size: 80%;">Random number generator RNG, RAN0</a></li> <!-- navigation toc: --> <li><a href="._mcint.do.txt-bs073.html#___sec72" style="font-size: 80%;">Random number generator RNG, RAN0</a></li> <!-- navigation toc: --> <li><a href="._mcint.do.txt-bs074.html#___sec73" style="font-size: 80%;">Random number generator RNG, RAN0</a></li> <!-- navigation toc: --> <li><a href="._mcint.do.txt-bs075.html#___sec74" style="font-size: 80%;">Random number generator RNG, RAN0</a></li> <!-- navigation toc: --> <li><a href="._mcint.do.txt-bs076.html#___sec75" style="font-size: 80%;">Random number generator RNG, RAN0 code</a></li> <!-- navigation toc: --> <li><a href="._mcint.do.txt-bs082.html#___sec81" style="font-size: 80%;">Improved Monte Carlo Integration</a></li> </ul> </li> </ul> </div> </div> </div> <!-- end of navigation bar --> <div class="container"> <p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> <!-- add vertical space --> <a name="part0000"></a> <!-- ------------------- main content ---------------------- --> <div class="jumbotron"> <center><h1>Introduction to Monte Carlo methods</h1></center> <!-- document title --> <p> <!-- author(s): Morten Hjorth-Jensen Email morten.hjorth-jensen@fys.uio.no --> <center> <b>Morten Hjorth-Jensen Email morten.hjorth-jensen@fys.uio.no</b> [1, 2] </center> <p> <!-- institution(s) --> <center>[1] <b>Department of Physics and Center of Mathematics for Applications, University of Oslo</b></center> <center>[2] <b>National Superconducting Cyclotron Laboratory, Michigan State University</b></center> <br> <p> <center><h4>Fall 2015</h4></center> <!-- date --> <br> <p> <p><a href="._mcint.do.txt-bs001.html" class="btn btn-primary btn-lg">Read &raquo;</a></p> </div> <!-- end jumbotron --> <p> <!-- navigation buttons at the bottom of the page --> <ul class="pagination"> <li class="active"><a href="._mcint.do.txt-bs000.html">1</a></li> <li><a href="._mcint.do.txt-bs001.html">2</a></li> <li><a href="._mcint.do.txt-bs002.html">3</a></li> <li><a href="._mcint.do.txt-bs003.html">4</a></li> <li><a href="._mcint.do.txt-bs004.html">5</a></li> <li><a href="._mcint.do.txt-bs005.html">6</a></li> <li><a href="._mcint.do.txt-bs006.html">7</a></li> <li><a href="._mcint.do.txt-bs007.html">8</a></li> <li><a href="._mcint.do.txt-bs008.html">9</a></li> <li><a href="._mcint.do.txt-bs009.html">10</a></li> <li><a href="">...</a></li> <li><a href="._mcint.do.txt-bs110.html">111</a></li> <li><a href="._mcint.do.txt-bs001.html">&raquo;</a></li> </ul> <!-- ------------------- end of main content --------------- --> </div> <!-- end container --> <!-- include javascript, jQuery *first* --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <!-- Bootstrap footer <footer> <a href="http://..."><img width="250" align=right src="http://..."></a> </footer> --> <center style="font-size:80%"> <!-- copyright --> &copy; 1999-2015, Morten Hjorth-Jensen Email morten.hjorth-jensen@fys.uio.no. Released under CC Attribution-NonCommercial 4.0 license </center> </body> </html>
{ "pile_set_name": "Github" }
{ "_args": [ [ "caseless@0.12.0", "/Users/eshanker/Code/fsevents" ] ], "_from": "caseless@0.12.0", "_id": "caseless@0.12.0", "_inBundle": true, "_integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", "_location": "/fsevents/caseless", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, "raw": "caseless@0.12.0", "name": "caseless", "escapedName": "caseless", "rawSpec": "0.12.0", "saveSpec": null, "fetchSpec": "0.12.0" }, "_requiredBy": [ "/fsevents/request" ], "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "_spec": "0.12.0", "_where": "/Users/eshanker/Code/fsevents", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com" }, "bugs": { "url": "https://github.com/mikeal/caseless/issues" }, "description": "Caseless object set/get/has, very useful when working with HTTP headers.", "devDependencies": { "tape": "^2.10.2" }, "homepage": "https://github.com/mikeal/caseless#readme", "keywords": [ "headers", "http", "caseless" ], "license": "Apache-2.0", "main": "index.js", "name": "caseless", "repository": { "type": "git", "url": "git+https://github.com/mikeal/caseless.git" }, "scripts": { "test": "node test.js" }, "test": "node test.js", "version": "0.12.0" }
{ "pile_set_name": "Github" }