text
stringlengths
2
99.9k
meta
dict
import json from ..models import UserMailer from .literals import ( TEST_EMAIL_ADDRESS, TEST_EMAIL_FROM_ADDRESS, TEST_USER_MAILER_BACKEND_PATH, TEST_USER_MAILER_LABEL ) class MailerTestMixin(object): def _create_test_user_mailer(self): self.test_user_mailer = UserMailer.objects.create( default=True, enabled=True, label=TEST_USER_MAILER_LABEL, backend_path=TEST_USER_MAILER_BACKEND_PATH, backend_data=json.dumps( obj={ 'from': TEST_EMAIL_FROM_ADDRESS } ) ) class MailerViewTestMixin(object): def _request_test_document_link_send_view(self): return self.post( viewname='mailer:send_document_link', kwargs={ 'document_id': self.test_document.pk }, data={ 'email': getattr( self, 'test_email_address', TEST_EMAIL_ADDRESS ), 'user_mailer': self.test_user_mailer.pk }, ) def _request_test_document_send_view(self): return self.post( viewname='mailer:send_document', kwargs={ 'document_id': self.test_document.pk }, data={ 'email': getattr( self, 'test_email_address', TEST_EMAIL_ADDRESS ), 'user_mailer': self.test_user_mailer.pk } ) def _request_test_user_mailer_create_view(self): return self.post( viewname='mailer:user_mailer_create', kwargs={ 'class_path': TEST_USER_MAILER_BACKEND_PATH }, data={ 'default': True, 'enabled': True, 'label': TEST_USER_MAILER_LABEL, } ) def _request_test_user_mailer_delete_view(self): return self.post( viewname='mailer:user_mailer_delete', kwargs={ 'mailer_id': self.test_user_mailer.pk } ) def _request_test_user_mailer_list_view(self): return self.get( viewname='mailer:user_mailer_list' ) def _request_test_user_mailer_log_entry_view(self): return self.get( viewname='mailer:user_mailer_log', kwargs={ 'mailer_id': self.test_user_mailer.pk } ) def _request_test_user_mailer_test_view(self): return self.post( viewname='mailer:user_mailer_test', kwargs={ 'mailer_id': self.test_user_mailer.pk }, data={ 'email': getattr( self, 'test_email_address', TEST_EMAIL_ADDRESS ) } )
{ "pile_set_name": "Github" }
[Icon Theme] Name=pe_light Comment=Icons by pexner (light) Inherits=multimc Directories=scalable [scalable] Size=48 Type=Scalable MinSize=16 MaxSize=256
{ "pile_set_name": "Github" }
# # Copyright 2007-2016, Kaazing Corporation. 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. # # Autobahn test case 7.1.2 # Case Description # Send two close frames # Case Expectation # Clean close with normal code. Second close frame ignored. connect "tcp://localhost:8555" connected write "GET /echo HTTP/1.1\r\n" write "User-Agent: AutobahnTestSuite/0.6.1-0.8.8\r\n" write "Host: localhost:8555\r\n" write "Upgrade: WebSocket\r\n" write "Connection: Upgrade\r\n" write "Pragma: no-cache\r\n" write "Cache-Control: no-cache\r\n" write "Sec-WebSocket-Key: IQHHd6U4LeI8irvOdP/qPw==\r\n" write "Sec-WebSocket-Version: 13\r\n" write "\r\n" read "HTTP/1.1 101 Web Socket Protocol Handshake\r\n" read "Connection: Upgrade\r\n" read /Date: .*\r\n/ read "Sec-WebSocket-Accept: Js16DE6FitHt16v3YhSV+1AoAf0=\r\n" read "Server: Kaazing Gateway\r\n" read "Upgrade: WebSocket\r\n" read "\r\n" # Send two Websocket close frames resulting in a normal closure (ignore second close frame) write [0x88 0x82 0xb9 0xa1 0x57 0x05 0xba 0x49] write [0x88 0x80 0xb0 0xfa 0x30 0xfb] read [0x88 0x02 0x03 0xe8] close closed
{ "pile_set_name": "Github" }
# platform = McAfee VirusScan Enterprise for Linux # Include source function library. . /usr/share/scap-security-guide/remediation_functions NAILS_CONFIG_FILE="/var/opt/NAI/LinuxShield/etc/ods.cfg" if ! grep -q extensions.mode "$NAILS_CONFIG_FILE"; then sed -i '$a nailsd.profile.ODS_default.filter.extensions.mode: all' "$NAILS_CONFIG_FILE" else replace_or_append "$NAILS_CONFIG_FILE" 'extensions.mode' 'all' '@CCENUM@' '%s: %s' fi
{ "pile_set_name": "Github" }
"""Run the EasyInstall command""" if __name__ == '__main__': from setuptools.command.easy_install import main main()
{ "pile_set_name": "Github" }
**Nella sezione Preferenze puoi verificare e modificare le impostazioni** che vengono utilizzate da tutti i servizi presenti su IO. Qui puoi consultare indirizzo email, numero di telefono e lingua associate all'account e attivare o disattivare il riconoscimento biometrico.
{ "pile_set_name": "Github" }
<html> <head> </head> <body> <script> function dump(event) { var elt = event.target || event.srcElement; document.getElementById('clicked').innerHTML = elt.innerHTML; } </script> <div style='height: 150px'></div> <ul style='overflow: scroll; width: 150px; height: 80px; background-color: yellow' onclick="dump(event)"> <li id='line1'>line1</li> <li id='line2'>line2</li> <li id='line3'>line3</li> <li id='line4'>line4</li> <li id='line5'>line5</li> <li id='line6'>line6</li> <li id='line7'>line7</li> <li id='line8'>line8</li> <li id='line9'>line9</li> </ul> <div> Clicked: <span id='clicked'></span> </div> </body> </html>
{ "pile_set_name": "Github" }
// CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE (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"; CodeMirror.defineMode('mllike', function(_config, parserConfig) { var words = { 'let': 'keyword', 'rec': 'keyword', 'in': 'keyword', 'of': 'keyword', 'and': 'keyword', 'if': 'keyword', 'then': 'keyword', 'else': 'keyword', 'for': 'keyword', 'to': 'keyword', 'while': 'keyword', 'do': 'keyword', 'done': 'keyword', 'fun': 'keyword', 'function': 'keyword', 'val': 'keyword', 'type': 'keyword', 'mutable': 'keyword', 'match': 'keyword', 'with': 'keyword', 'try': 'keyword', 'open': 'builtin', 'ignore': 'builtin', 'begin': 'keyword', 'end': 'keyword' }; var extraWords = parserConfig.extraWords || {}; for (var prop in extraWords) { if (extraWords.hasOwnProperty(prop)) { words[prop] = parserConfig.extraWords[prop]; } } function tokenBase(stream, state) { var ch = stream.next(); if (ch === '"') { state.tokenize = tokenString; return state.tokenize(stream, state); } if (ch === '(') { if (stream.eat('*')) { state.commentLevel++; state.tokenize = tokenComment; return state.tokenize(stream, state); } } if (ch === '~') { stream.eatWhile(/\w/); return 'variable-2'; } if (ch === '`') { stream.eatWhile(/\w/); return 'quote'; } if (ch === '/' && parserConfig.slashComments && stream.eat('/')) { stream.skipToEnd(); return 'comment'; } if (/\d/.test(ch)) { stream.eatWhile(/[\d]/); if (stream.eat('.')) { stream.eatWhile(/[\d]/); } return 'number'; } if ( /[+\-*&%=<>!?|]/.test(ch)) { return 'operator'; } stream.eatWhile(/\w/); var cur = stream.current(); return words[cur] || 'variable'; } function tokenString(stream, state) { var next, end = false, escaped = false; while ((next = stream.next()) != null) { if (next === '"' && !escaped) { end = true; break; } escaped = !escaped && next === '\\'; } if (end && !escaped) { state.tokenize = tokenBase; } return 'string'; }; function tokenComment(stream, state) { var prev, next; while(state.commentLevel > 0 && (next = stream.next()) != null) { if (prev === '(' && next === '*') state.commentLevel++; if (prev === '*' && next === ')') state.commentLevel--; prev = next; } if (state.commentLevel <= 0) { state.tokenize = tokenBase; } return 'comment'; } return { startState: function() {return {tokenize: tokenBase, commentLevel: 0};}, token: function(stream, state) { if (stream.eatSpace()) return null; return state.tokenize(stream, state); }, blockCommentStart: "(*", blockCommentEnd: "*)", lineComment: parserConfig.slashComments ? "//" : null }; }); CodeMirror.defineMIME('text/x-ocaml', { name: 'mllike', extraWords: { 'succ': 'keyword', 'trace': 'builtin', 'exit': 'builtin', 'print_string': 'builtin', 'print_endline': 'builtin', 'true': 'atom', 'false': 'atom', 'raise': 'keyword' } }); CodeMirror.defineMIME('text/x-fsharp', { name: 'mllike', extraWords: { 'abstract': 'keyword', 'as': 'keyword', 'assert': 'keyword', 'base': 'keyword', 'class': 'keyword', 'default': 'keyword', 'delegate': 'keyword', 'downcast': 'keyword', 'downto': 'keyword', 'elif': 'keyword', 'exception': 'keyword', 'extern': 'keyword', 'finally': 'keyword', 'global': 'keyword', 'inherit': 'keyword', 'inline': 'keyword', 'interface': 'keyword', 'internal': 'keyword', 'lazy': 'keyword', 'let!': 'keyword', 'member' : 'keyword', 'module': 'keyword', 'namespace': 'keyword', 'new': 'keyword', 'null': 'keyword', 'override': 'keyword', 'private': 'keyword', 'public': 'keyword', 'return': 'keyword', 'return!': 'keyword', 'select': 'keyword', 'static': 'keyword', 'struct': 'keyword', 'upcast': 'keyword', 'use': 'keyword', 'use!': 'keyword', 'val': 'keyword', 'when': 'keyword', 'yield': 'keyword', 'yield!': 'keyword', 'List': 'builtin', 'Seq': 'builtin', 'Map': 'builtin', 'Set': 'builtin', 'int': 'builtin', 'string': 'builtin', 'raise': 'builtin', 'failwith': 'builtin', 'not': 'builtin', 'true': 'builtin', 'false': 'builtin' }, slashComments: true }); });
{ "pile_set_name": "Github" }
include ../../Makefile.include DEPS=../../Makefile.include Makefile # lib name, version LIBNAME=libudev VERSION=3.2.5 SOURCE=$(LIBNAME)-$(VERSION) ARCHIVE=$(SOURCE).tar.gz # configuration settings CONFIGURE=./configure --prefix=$(PREFIX) --disable-shared --enable-static --enable-introspection=no --disable-programs --disable-blkid --disable-selinux --disable-manpages --disable-kmod --disable-mtd_probe LIBDYLIB=$(PLATFORM)/src/libudev/.libs/libudev.la all: .installed-$(PLATFORM) $(TARBALLS_LOCATION)/$(ARCHIVE): cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM) cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) cd $(PLATFORM); $(AUTORECONF) -vif cd $(PLATFORM); $(CONFIGURE) $(LIBDYLIB): $(PLATFORM) $(MAKE) -C $(PLATFORM) .installed-$(PLATFORM): $(LIBDYLIB) $(MAKE) -C $(PLATFORM) install touch $@ clean: $(MAKE) -C $(PLATFORM) clean rm -f .installed-$(PLATFORM) distclean: rm -rf $(PLATFORM) .installed-$(PLATFORM)
{ "pile_set_name": "Github" }
/* Copyright (c) 2011, Intel Corporation. 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 Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************** * Content : Eigen bindings to Intel(R) MKL * Complex Schur needed to complex unsymmetrical eigenvalues/eigenvectors. ******************************************************************************** */ #ifndef EIGEN_COMPLEX_SCHUR_MKL_H #define EIGEN_COMPLEX_SCHUR_MKL_H #include "Eigen/src/Core/util/MKL_support.h" namespace Eigen { /** \internal Specialization for the data types supported by MKL */ #define EIGEN_MKL_SCHUR_COMPLEX(EIGTYPE, MKLTYPE, MKLPREFIX, MKLPREFIX_U, EIGCOLROW, MKLCOLROW) \ template<> inline \ ComplexSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >& \ ComplexSchur<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> >::compute(const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW>& matrix, bool computeU) \ { \ typedef Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW> MatrixType; \ typedef MatrixType::RealScalar RealScalar; \ typedef std::complex<RealScalar> ComplexScalar; \ \ eigen_assert(matrix.cols() == matrix.rows()); \ \ m_matUisUptodate = false; \ if(matrix.cols() == 1) \ { \ m_matT = matrix.cast<ComplexScalar>(); \ if(computeU) m_matU = ComplexMatrixType::Identity(1,1); \ m_info = Success; \ m_isInitialized = true; \ m_matUisUptodate = computeU; \ return *this; \ } \ lapack_int n = matrix.cols(), sdim, info; \ lapack_int lda = matrix.outerStride(); \ lapack_int matrix_order = MKLCOLROW; \ char jobvs, sort='N'; \ LAPACK_##MKLPREFIX_U##_SELECT1 select = 0; \ jobvs = (computeU) ? 'V' : 'N'; \ m_matU.resize(n, n); \ lapack_int ldvs = m_matU.outerStride(); \ m_matT = matrix; \ Matrix<EIGTYPE, Dynamic, Dynamic> w; \ w.resize(n, 1);\ info = LAPACKE_##MKLPREFIX##gees( matrix_order, jobvs, sort, select, n, (MKLTYPE*)m_matT.data(), lda, &sdim, (MKLTYPE*)w.data(), (MKLTYPE*)m_matU.data(), ldvs ); \ if(info == 0) \ m_info = Success; \ else \ m_info = NoConvergence; \ \ m_isInitialized = true; \ m_matUisUptodate = computeU; \ return *this; \ \ } EIGEN_MKL_SCHUR_COMPLEX(dcomplex, MKL_Complex16, z, Z, ColMajor, LAPACK_COL_MAJOR) EIGEN_MKL_SCHUR_COMPLEX(scomplex, MKL_Complex8, c, C, ColMajor, LAPACK_COL_MAJOR) EIGEN_MKL_SCHUR_COMPLEX(dcomplex, MKL_Complex16, z, Z, RowMajor, LAPACK_ROW_MAJOR) EIGEN_MKL_SCHUR_COMPLEX(scomplex, MKL_Complex8, c, C, RowMajor, LAPACK_ROW_MAJOR) } // end namespace Eigen #endif // EIGEN_COMPLEX_SCHUR_MKL_H
{ "pile_set_name": "Github" }
REQUIRES: shell RUN: ((false | true) && echo true || echo false) | grep false
{ "pile_set_name": "Github" }
## DevOps Guide Topic Wise: ### 1 Programming Language - Python : Scripting for web - Shell : Scripting for servers - Yml : For Configuration of Cloud files - Golang : Servers and Cloud Architectures - Javascript : Good to know for any web-development works - Markdown : For documentation ### 2 OS-Concepts - Process Management - Threads and Concurrency - Sockets - POSIX Basics - Networking concepts - Cron Jobs - I/O Management - Vitualization - Memory Processes and Management - File Systems - Scheduling ### 3 Maintaining Servers - Networking Concepts - Security Concepts - OWASP-Top 10 - Protocols - Reverse Proxy | Proxy | Forward Proxy - Caching Servers - Load Balancer - Firewall - Webservers - Python : WSGI | uWSGI | Tornado - Nginx - Apache - Caddy - IIS - Tomcat - Node.js ### 4 Terminal Commands - Text Manipulation - Process Monitoring - Networking Processes - Bash scripting - Performance Management - vim - AWS CLI - Kubernetes CLI - Docker CLI - Cloud CLIs ### 5 Infrastructure as Code - CI/CD - Travis CI - Circle CI - Gitlab - Jenkins - Azure - Configuration Management - Ansible - Chef - Puppet - salt - Containers - Docker - LXC - Container Orchestration - Kubernetes - Mesos - Docker SWARM - Nomad - Minikube - Openshift - Amazon ECS - Google Kuberenetes Engine (GKE) - Infrsatructure Provisioning - Hashicorp Terraform - AWS Cloudformation - Pulmi - Redhat Ansible - Azure Automation ### 7 Infrastructure Monitoring - Prometheus - Grafana - Nagios - Zabbix ### 6 Application Monitoring - Jaegar - New Relic - Open Tracing - Traceview ### 8 Cloud Providers - Amazon AWS - Google GCP - Microsoft Azure - Digital Ocean - Linode - Vultr ### 9 Log Management - Elastic Stack - Graylog - Splunk - Papertrail ### 10 Version Control - Github - Bitbucket - Mercurial ***************
{ "pile_set_name": "Github" }
// Copyright 2016 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 number import ( "fmt" "testing" "golang.org/x/text/internal/testtext" "golang.org/x/text/language" ) func TestInfo(t *testing.T) { testCases := []struct { lang string sym SymbolType wantSym string wantNine rune }{ {"und", SymDecimal, ".", '9'}, {"de", SymGroup, ".", '9'}, {"de-BE", SymGroup, ".", '9'}, // inherits from de (no number data in CLDR) {"de-BE-oxendict", SymGroup, ".", '9'}, // inherits from de (no compact index) // U+096F DEVANAGARI DIGIT NINE ('९') {"de-BE-u-nu-deva", SymGroup, ".", '\u096f'}, // miss -> latn -> de {"de-Cyrl-BE", SymGroup, ",", '9'}, // inherits from root {"de-CH", SymGroup, "’", '9'}, // overrides values in de {"de-CH-oxendict", SymGroup, "’", '9'}, // inherits from de-CH (no compact index) {"de-CH-u-nu-deva", SymGroup, "’", '\u096f'}, // miss -> latn -> de-CH {"pa", SymExponential, "E", '9'}, // "×۱۰^" -> U+00d7 U+06f1 U+06f0^" // U+06F0 EXTENDED ARABIC-INDIC DIGIT ZERO // U+06F1 EXTENDED ARABIC-INDIC DIGIT ONE // U+06F9 EXTENDED ARABIC-INDIC DIGIT NINE {"pa-u-nu-arabext", SymExponential, "\u00d7\u06f1\u06f0^", '\u06f9'}, // "གྲངས་མེད" - > U+0f42 U+0fb2 U+0f44 U+0f66 U+0f0b U+0f58 U+0f7a U+0f51 // Examples: // U+0F29 TIBETAN DIGIT NINE (༩) {"dz", SymInfinity, "\u0f42\u0fb2\u0f44\u0f66\u0f0b\u0f58\u0f7a\u0f51", '\u0f29'}, // defaults to tibt {"dz-u-nu-latn", SymInfinity, "∞", '9'}, // select alternative {"dz-u-nu-tibt", SymInfinity, "\u0f42\u0fb2\u0f44\u0f66\u0f0b\u0f58\u0f7a\u0f51", '\u0f29'}, {"en-u-nu-tibt", SymInfinity, "∞", '\u0f29'}, // algorithmic number systems fall back to ASCII if Digits is used. {"en-u-nu-hanidec", SymPlusSign, "+", '9'}, {"en-u-nu-roman", SymPlusSign, "+", '9'}, } for _, tc := range testCases { t.Run(fmt.Sprintf("%s:%v", tc.lang, tc.sym), func(t *testing.T) { info := InfoFromTag(language.MustParse(tc.lang)) if got := info.Symbol(tc.sym); got != tc.wantSym { t.Errorf("sym: got %q; want %q", got, tc.wantSym) } if got := info.Digit('9'); got != tc.wantNine { t.Errorf("Digit(9): got %+q; want %+q", got, tc.wantNine) } var buf [4]byte if got := string(buf[:info.WriteDigit(buf[:], '9')]); got != string(tc.wantNine) { t.Errorf("WriteDigit(9): got %+q; want %+q", got, tc.wantNine) } if got := string(info.AppendDigit([]byte{}, 9)); got != string(tc.wantNine) { t.Errorf("AppendDigit(9): got %+q; want %+q", got, tc.wantNine) } }) } } func TestFormats(t *testing.T) { testCases := []struct { lang string pattern string index []byte }{ {"en", "#,##0.###", tagToDecimal}, {"de", "#,##0.###", tagToDecimal}, {"de-CH", "#,##0.###", tagToDecimal}, {"pa", "#,##,##0.###", tagToDecimal}, {"pa-Arab", "#,##0.###", tagToDecimal}, // Does NOT inherit from pa! {"mr", "#,##,##0.###", tagToDecimal}, {"mr-IN", "#,##,##0.###", tagToDecimal}, // Inherits from mr. {"nl", "#E0", tagToScientific}, {"nl-MX", "#E0", tagToScientific}, // Inherits through Tag.Parent. {"zgh", "#,##0 %", tagToPercent}, } for _, tc := range testCases { testtext.Run(t, tc.lang, func(t *testing.T) { got := formatForLang(language.MustParse(tc.lang), tc.index) want, _ := ParsePattern(tc.pattern) if *got != *want { t.Errorf("\ngot %#v;\nwant %#v", got, want) } }) } }
{ "pile_set_name": "Github" }
// // ZZCALayer.m // ZZUIHelper // // Created by 李伯坤 on 2017/3/5. // Copyright © 2017年 李伯坤. All rights reserved. // #import "ZZCALayer.h" @implementation ZZCALayer @synthesize properties = _properties; - (NSMutableArray *)properties { if (!_properties) { _properties = [super properties]; ZZProperty *masksToBounds = [[ZZProperty alloc] initWithPropertyName:@"masksToBounds" type:ZZPropertyTypeBOOL defaultValue:@(NO)]; ZZProperty *cornerRadius = [[ZZProperty alloc] initWithPropertyName:@"cornerRadius" type:ZZPropertyTypeNumber defaultValue:@(0)]; ZZProperty *borderWidth = [[ZZProperty alloc] initWithPropertyName:@"borderWidth" type:ZZPropertyTypeNumber defaultValue:@(0)]; ZZProperty *borderColor = [[ZZProperty alloc] initWithPropertyName:@"borderColor" type:ZZPropertyTypeCGColor defaultValue:@"clearColor"]; ZZProperty *zPosition = [[ZZProperty alloc] initWithPropertyName:@"zPosition" type:ZZPropertyTypeNumber defaultValue:@(0)]; ZZProperty *anchorPoint = [[ZZProperty alloc] initWithPropertyName:@"anchorPoint" type:ZZPropertyTypePoint defaultValue:@{@"x" : @(0.5), @"y" : @(0.5)}]; ZZProperty *contentsScale = [[ZZProperty alloc] initWithPropertyName:@"contentsScale" type:ZZPropertyTypeNumber defaultValue:@(1.0)]; ZZPropertyGroup *group = [[ZZPropertyGroup alloc] initWithGroupName:@"CALayer" properties:@[masksToBounds, cornerRadius, ZZ_PROPERTY_LINE, borderWidth, borderColor, ZZ_PROPERTY_LINE, zPosition, anchorPoint, contentsScale]]; [_properties addObject:group]; } return _properties; } @end
{ "pile_set_name": "Github" }
//// -*- C++ -*- // // Package: HGCalHitValidation // Class: HGCalHitValidation // /**\class HGCalHitValidation HGCalHitValidation.cc Validation/HGCalValidation/plugins/HGCalHitValidation.cc Description: [one line class summary] Implementation: [Notes on implementation] */ #include "Geometry/Records/interface/IdealGeometryRecord.h" #include "Geometry/CaloGeometry/interface/CaloGeometry.h" #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h" #include "Geometry/HGCalCommonData/interface/HGCalGeometryMode.h" #include "Geometry/HGCalGeometry/interface/HGCalGeometry.h" #include "Geometry/HGCalCommonData/interface/HGCalDDDConstants.h" #include "Geometry/HcalCommonData/interface/HcalDDDSimConstants.h" #include "Geometry/HcalCommonData/interface/HcalDDDRecConstants.h" #include "Geometry/HcalCommonData/interface/HcalCellType.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" #include "Geometry/Records/interface/HcalSimNumberingRecord.h" #include "Geometry/Records/interface/HcalRecNumberingRecord.h" #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" #include "DataFormats/HcalRecHit/interface/HBHERecHit.h" #include "DataFormats/HGCRecHit/interface/HGCRecHit.h" #include "DataFormats/HGCRecHit/interface/HGCRecHitCollections.h" #include "DataFormats/ForwardDetId/interface/HGCalDetId.h" #include "DataFormats/ForwardDetId/interface/ForwardSubdetector.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/ESTransientHandle.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/Exception.h" #include "FWCore/Utilities/interface/EDGetToken.h" #include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "DQMServices/Core/interface/DQMStore.h" #include "SimG4CMS/Calo/interface/HGCNumberingScheme.h" #include "SimDataFormats/CaloHit/interface/PCaloHit.h" #include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h" #include "DataFormats/HcalDetId/interface/HcalTestNumbering.h" #include "SimDataFormats/CaloTest/interface/HGCalTestNumbering.h" #include <cmath> #include <memory> #include <iostream> #include <string> #include <vector> //#define EDM_ML_DEBUG class HGCalHitValidation : public DQMEDAnalyzer { public: explicit HGCalHitValidation(const edm::ParameterSet&); ~HGCalHitValidation() override; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); protected: typedef std::tuple<float, float, float, float> HGCHitTuple; void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override; void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override; void analyze(const edm::Event&, const edm::EventSetup&) override; void analyzeHGCalSimHit(edm::Handle<std::vector<PCaloHit>> const& simHits, int idet, MonitorElement* hist, std::map<unsigned int, HGCHitTuple>&); template <class T1> void analyzeHGCalRecHit(T1 const& theHits, std::map<unsigned int, HGCHitTuple> const& hitRefs); private: //HGC Geometry std::vector<const HGCalDDDConstants*> hgcCons_; std::vector<const HGCalGeometry*> hgcGeometry_; const HcalDDDSimConstants* hcCons_; const HcalDDDRecConstants* hcConr_; const CaloSubdetectorGeometry* hcGeometry_; std::vector<std::string> geometrySource_; std::vector<int> ietaExcludeBH_; bool ifHCAL_; bool ifHCALsim_; edm::InputTag eeSimHitSource, fhSimHitSource, bhSimHitSource; edm::EDGetTokenT<std::vector<PCaloHit>> eeSimHitToken_; edm::EDGetTokenT<std::vector<PCaloHit>> fhSimHitToken_; edm::EDGetTokenT<std::vector<PCaloHit>> bhSimHitToken_; edm::EDGetTokenT<HGCeeRecHitCollection> eeRecHitToken_; edm::EDGetTokenT<HGChefRecHitCollection> fhRecHitToken_; edm::EDGetTokenT<HGChebRecHitCollection> bhRecHitTokeng_; edm::EDGetTokenT<HBHERecHitCollection> bhRecHitTokenh_; //histogram related stuff MonitorElement *heedzVsZ, *heedyVsY, *heedxVsX; MonitorElement *hefdzVsZ, *hefdyVsY, *hefdxVsX; MonitorElement *hebdzVsZ, *hebdPhiVsPhi, *hebdEtaVsEta; MonitorElement *heeRecVsSimZ, *heeRecVsSimY, *heeRecVsSimX; MonitorElement *hefRecVsSimZ, *hefRecVsSimY, *hefRecVsSimX; MonitorElement *hebRecVsSimZ, *hebRecVsSimY, *hebRecVsSimX; MonitorElement *heeEnSimRec, *hefEnSimRec, *hebEnSimRec; MonitorElement *hebEnRec, *hebEnSim; MonitorElement *hefEnRec, *hefEnSim; MonitorElement *heeEnRec, *heeEnSim; }; HGCalHitValidation::HGCalHitValidation(const edm::ParameterSet& cfg) { geometrySource_ = cfg.getUntrackedParameter<std::vector<std::string>>("geometrySource"); eeSimHitToken_ = consumes<std::vector<PCaloHit>>(cfg.getParameter<edm::InputTag>("eeSimHitSource")); fhSimHitToken_ = consumes<std::vector<PCaloHit>>(cfg.getParameter<edm::InputTag>("fhSimHitSource")); bhSimHitToken_ = consumes<std::vector<PCaloHit>>(cfg.getParameter<edm::InputTag>("bhSimHitSource")); eeRecHitToken_ = consumes<HGCeeRecHitCollection>(cfg.getParameter<edm::InputTag>("eeRecHitSource")); fhRecHitToken_ = consumes<HGChefRecHitCollection>(cfg.getParameter<edm::InputTag>("fhRecHitSource")); ietaExcludeBH_ = cfg.getParameter<std::vector<int>>("ietaExcludeBH"); ifHCAL_ = cfg.getParameter<bool>("ifHCAL"); ifHCALsim_ = cfg.getParameter<bool>("ifHCALsim"); if (ifHCAL_) bhRecHitTokenh_ = consumes<HBHERecHitCollection>(cfg.getParameter<edm::InputTag>("bhRecHitSource")); else bhRecHitTokeng_ = consumes<HGChebRecHitCollection>(cfg.getParameter<edm::InputTag>("bhRecHitSource")); #ifdef EDM_ML_DEBUG edm::LogInfo("HGCalValid") << "Exclude the following " << ietaExcludeBH_.size() << " ieta values from BH plots (BH " << ifHCAL_ << ") "; for (unsigned int k = 0; k < ietaExcludeBH_.size(); ++k) edm::LogInfo("HGCalValid") << " [" << k << "] " << ietaExcludeBH_[k]; #endif } HGCalHitValidation::~HGCalHitValidation() {} void HGCalHitValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { //The following says we do not know what parameters are allowed so do no validation // Please change this to state exactly what you do use, even if it is no parameters edm::ParameterSetDescription desc; desc.setUnknown(); descriptions.addDefault(desc); } void HGCalHitValidation::bookHistograms(DQMStore::IBooker& iB, edm::Run const&, edm::EventSetup const&) { iB.setCurrentFolder("HGCAL/HGCalSimHitsV/HitValidation"); //initiating histograms heedzVsZ = iB.book2D("heedzVsZ", "", 720, -360, 360, 100, -0.1, 0.1); heedyVsY = iB.book2D("heedyVsY", "", 400, -200, 200, 100, -0.02, 0.02); heedxVsX = iB.book2D("heedxVsX", "", 400, -200, 200, 100, -0.02, 0.02); heeRecVsSimZ = iB.book2D("heeRecVsSimZ", "", 720, -360, 360, 720, -360, 360); heeRecVsSimY = iB.book2D("heeRecVsSimY", "", 400, -200, 200, 400, -200, 200); heeRecVsSimX = iB.book2D("heeRecVsSimX", "", 400, -200, 200, 400, -200, 200); hefdzVsZ = iB.book2D("hefdzVsZ", "", 820, -410, 410, 100, -0.1, 0.1); hefdyVsY = iB.book2D("hefdyVsY", "", 400, -200, 200, 100, -0.02, 0.02); hefdxVsX = iB.book2D("hefdxVsX", "", 400, -200, 200, 100, -0.02, 0.02); hefRecVsSimZ = iB.book2D("hefRecVsSimZ", "", 820, -410, 410, 820, -410, 410); hefRecVsSimY = iB.book2D("hefRecVsSimY", "", 400, -200, 200, 400, -200, 200); hefRecVsSimX = iB.book2D("hefRecVsSimX", "", 400, -200, 200, 400, -200, 200); hebdzVsZ = iB.book2D("hebdzVsZ", "", 1080, -540, 540, 100, -1.0, 1.0); hebdPhiVsPhi = iB.book2D("hebdPhiVsPhi", "", M_PI * 100, -0.5, M_PI + 0.5, 200, -0.2, 0.2); hebdEtaVsEta = iB.book2D("hebdEtaVsEta", "", 1000, -5, 5, 200, -0.1, 0.1); hebRecVsSimZ = iB.book2D("hebRecVsSimZ", "", 1080, -540, 540, 1080, -540, 540); hebRecVsSimY = iB.book2D("hebRecVsSimY", "", 400, -200, 200, 400, -200, 200); hebRecVsSimX = iB.book2D("hebRecVsSimX", "", 400, -200, 200, 400, -200, 200); heeEnRec = iB.book1D("heeEnRec", "", 1000, 0, 10); heeEnSim = iB.book1D("heeEnSim", "", 1000, 0, 0.01); heeEnSimRec = iB.book2D("heeEnSimRec", "", 200, 0, 0.002, 200, 0, 0.2); hefEnRec = iB.book1D("hefEnRec", "", 1000, 0, 10); hefEnSim = iB.book1D("hefEnSim", "", 1000, 0, 0.01); hefEnSimRec = iB.book2D("hefEnSimRec", "", 200, 0, 0.001, 200, 0, 0.5); hebEnRec = iB.book1D("hebEnRec", "", 1000, 0, 15); hebEnSim = iB.book1D("hebEnSim", "", 1000, 0, 0.01); hebEnSimRec = iB.book2D("hebEnSimRec", "", 200, 0, 0.02, 200, 0, 4); } void HGCalHitValidation::dqmBeginRun(edm::Run const& iRun, edm::EventSetup const& iSetup) { //initiating hgc Geometry for (size_t i = 0; i < geometrySource_.size(); i++) { if (geometrySource_[i].find("Hcal") != std::string::npos) { edm::ESHandle<HcalDDDSimConstants> pHSNDC; iSetup.get<HcalSimNumberingRecord>().get(pHSNDC); if (pHSNDC.isValid()) { hcCons_ = pHSNDC.product(); hgcCons_.push_back(nullptr); } else { edm::LogWarning("HGCalValid") << "Cannot initiate HcalDDDSimConstants: " << geometrySource_[i] << std::endl; } edm::ESHandle<HcalDDDRecConstants> pHRNDC; iSetup.get<HcalRecNumberingRecord>().get(pHRNDC); if (pHRNDC.isValid()) { hcConr_ = pHRNDC.product(); } else { edm::LogWarning("HGCalValid") << "Cannot initiate HcalDDDRecConstants: " << geometrySource_[i] << std::endl; } edm::ESHandle<CaloGeometry> caloG; iSetup.get<CaloGeometryRecord>().get(caloG); if (caloG.isValid()) { const CaloGeometry* geo = caloG.product(); hcGeometry_ = geo->getSubdetectorGeometry(DetId::Hcal, HcalBarrel); hgcGeometry_.push_back(nullptr); } else { edm::LogWarning("HGCalValid") << "Cannot initiate HcalGeometry for " << geometrySource_[i] << std::endl; } } else { edm::ESHandle<HGCalDDDConstants> hgcCons; iSetup.get<IdealGeometryRecord>().get(geometrySource_[i], hgcCons); if (hgcCons.isValid()) { hgcCons_.push_back(hgcCons.product()); } else { edm::LogWarning("HGCalValid") << "Cannot initiate HGCalDDDConstants for " << geometrySource_[i] << std::endl; } edm::ESHandle<HGCalGeometry> hgcGeom; iSetup.get<IdealGeometryRecord>().get(geometrySource_[i], hgcGeom); if (hgcGeom.isValid()) { hgcGeometry_.push_back(hgcGeom.product()); } else { edm::LogWarning("HGCalValid") << "Cannot initiate HGCalGeometry for " << geometrySource_[i] << std::endl; } } } } void HGCalHitValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) { std::map<unsigned int, HGCHitTuple> eeHitRefs, fhHitRefs, bhHitRefs; //Accesing ee simhits edm::Handle<std::vector<PCaloHit>> eeSimHits; iEvent.getByToken(eeSimHitToken_, eeSimHits); if (eeSimHits.isValid()) { analyzeHGCalSimHit(eeSimHits, 0, heeEnSim, eeHitRefs); #ifdef EDM_ML_DEBUG for (std::map<unsigned int, HGCHitTuple>::iterator itr = eeHitRefs.begin(); itr != eeHitRefs.end(); ++itr) { int idx = std::distance(eeHitRefs.begin(), itr); edm::LogInfo("HGCalValid") << "EEHit[" << idx << "] " << std::hex << itr->first << std::dec << "; Energy " << std::get<0>(itr->second) << "; Position (" << std::get<1>(itr->second) << ", " << std::get<2>(itr->second) << ", " << std::get<3>(itr->second) << ")"; } #endif } else { edm::LogVerbatim("HGCalValid") << "No EE SimHit Found "; } //Accesing fh simhits edm::Handle<std::vector<PCaloHit>> fhSimHits; iEvent.getByToken(fhSimHitToken_, fhSimHits); if (fhSimHits.isValid()) { analyzeHGCalSimHit(fhSimHits, 1, hefEnSim, fhHitRefs); #ifdef EDM_ML_DEBUG for (std::map<unsigned int, HGCHitTuple>::iterator itr = fhHitRefs.begin(); itr != fhHitRefs.end(); ++itr) { int idx = std::distance(fhHitRefs.begin(), itr); edm::LogInfo("HGCalValid") << "FHHit[" << idx << "] " << std::hex << itr->first << std::dec << "; Energy " << std::get<0>(itr->second) << "; Position (" << std::get<1>(itr->second) << ", " << std::get<2>(itr->second) << ", " << std::get<3>(itr->second) << ")"; } #endif } else { edm::LogVerbatim("HGCalValid") << "No FH SimHit Found "; } //Accessing bh simhits edm::Handle<std::vector<PCaloHit>> bhSimHits; iEvent.getByToken(bhSimHitToken_, bhSimHits); if (bhSimHits.isValid()) { if (ifHCALsim_) { for (std::vector<PCaloHit>::const_iterator simHit = bhSimHits->begin(); simHit != bhSimHits->end(); ++simHit) { int subdet, z, depth, eta, phi, lay; HcalTestNumbering::unpackHcalIndex(simHit->id(), subdet, z, depth, eta, phi, lay); if (subdet == static_cast<int>(HcalEndcap)) { HcalCellType::HcalCell cell = hcCons_->cell(subdet, z, lay, eta, phi); double zp = cell.rz / 10; HcalDDDRecConstants::HcalID idx = hcConr_->getHCID(subdet, eta, phi, lay, depth); int sign = (z == 0) ? (-1) : (1); zp *= sign; HcalDetId id = HcalDetId(HcalEndcap, sign * idx.eta, idx.phi, idx.depth); float energy = simHit->energy(); float energySum(energy); if (bhHitRefs.count(id.rawId()) != 0) energySum += std::get<0>(bhHitRefs[id.rawId()]); hebEnSim->Fill(energy); if (std::find(ietaExcludeBH_.begin(), ietaExcludeBH_.end(), idx.eta) == ietaExcludeBH_.end()) { bhHitRefs[id.rawId()] = std::make_tuple(energySum, cell.eta, cell.phi, zp); #ifdef EDM_ML_DEBUG edm::LogInfo("HGCalValid") << "Accept " << id << std::endl; } else { edm::LogInfo("HGCalValid") << "Reject " << id << std::endl; #endif } } } } else { analyzeHGCalSimHit(bhSimHits, 2, hebEnSim, bhHitRefs); } #ifdef EDM_ML_DEBUG for (std::map<unsigned int, HGCHitTuple>::iterator itr = bhHitRefs.begin(); itr != bhHitRefs.end(); ++itr) { int idx = std::distance(bhHitRefs.begin(), itr); edm::LogInfo("HGCalValid") << "BHHit[" << idx << "] " << std::hex << itr->first << std::dec << "; Energy " << std::get<0>(itr->second) << "; Position (" << std::get<1>(itr->second) << ", " << std::get<2>(itr->second) << ", " << std::get<3>(itr->second) << ")"; } #endif } else { edm::LogVerbatim("HGCalValid") << "No BH SimHit Found "; } //accessing EE Rechit information edm::Handle<HGCeeRecHitCollection> eeRecHit; iEvent.getByToken(eeRecHitToken_, eeRecHit); if (eeRecHit.isValid()) { const HGCeeRecHitCollection* theHits = (eeRecHit.product()); for (auto it = theHits->begin(); it != theHits->end(); ++it) { double energy = it->energy(); heeEnRec->Fill(energy); std::map<unsigned int, HGCHitTuple>::const_iterator itr = eeHitRefs.find(it->id().rawId()); if (itr != eeHitRefs.end()) { GlobalPoint xyz = hgcGeometry_[0]->getPosition(it->id()); heeRecVsSimX->Fill(std::get<1>(itr->second), xyz.x()); heeRecVsSimY->Fill(std::get<2>(itr->second), xyz.y()); heeRecVsSimZ->Fill(std::get<3>(itr->second), xyz.z()); heedxVsX->Fill(std::get<1>(itr->second), (xyz.x() - std::get<1>(itr->second))); heedyVsY->Fill(std::get<2>(itr->second), (xyz.y() - std::get<2>(itr->second))); heedzVsZ->Fill(std::get<3>(itr->second), (xyz.z() - std::get<3>(itr->second))); heeEnSimRec->Fill(std::get<0>(itr->second), energy); #ifdef EDM_ML_DEBUG edm::LogInfo("HGCalValid") << "EEHit: " << std::hex << it->id().rawId() << std::dec << " Sim (" << std::get<0>(itr->second) << ", " << std::get<1>(itr->second) << ", " << std::get<2>(itr->second) << ", " << std::get<3>(itr->second) << ") Rec (" << energy << ", " << xyz.x() << ", " << xyz.y() << ", " << xyz.z() << ")"; #endif } } } else { edm::LogVerbatim("HGCalValid") << "No EE RecHit Found "; } //accessing FH Rechit information edm::Handle<HGChefRecHitCollection> fhRecHit; iEvent.getByToken(fhRecHitToken_, fhRecHit); if (fhRecHit.isValid()) { const HGChefRecHitCollection* theHits = (fhRecHit.product()); for (auto it = theHits->begin(); it != theHits->end(); ++it) { double energy = it->energy(); hefEnRec->Fill(energy); std::map<unsigned int, HGCHitTuple>::const_iterator itr = fhHitRefs.find(it->id().rawId()); if (itr != fhHitRefs.end()) { GlobalPoint xyz = hgcGeometry_[1]->getPosition(it->id()); hefRecVsSimX->Fill(std::get<1>(itr->second), xyz.x()); hefRecVsSimY->Fill(std::get<2>(itr->second), xyz.y()); hefRecVsSimZ->Fill(std::get<3>(itr->second), xyz.z()); hefdxVsX->Fill(std::get<1>(itr->second), (xyz.x() - std::get<1>(itr->second))); hefdyVsY->Fill(std::get<2>(itr->second), (xyz.y() - std::get<2>(itr->second))); hefdzVsZ->Fill(std::get<3>(itr->second), (xyz.z() - std::get<3>(itr->second))); hefEnSimRec->Fill(std::get<0>(itr->second), energy); #ifdef EDM_ML_DEBUG edm::LogInfo("HGCalValid") << "FHHit: " << std::hex << it->id().rawId() << std::dec << " Sim (" << std::get<0>(itr->second) << ", " << std::get<1>(itr->second) << ", " << std::get<2>(itr->second) << ", " << std::get<3>(itr->second) << ") Rec (" << energy << "," << xyz.x() << ", " << xyz.y() << ", " << xyz.z() << ")"; #endif } } } else { edm::LogVerbatim("HGCalValid") << "No FH RecHit Found "; } //accessing BH Rechit information if (ifHCAL_) { edm::Handle<HBHERecHitCollection> bhRecHit; iEvent.getByToken(bhRecHitTokenh_, bhRecHit); if (bhRecHit.isValid()) { const HBHERecHitCollection* theHits = (bhRecHit.product()); analyzeHGCalRecHit(theHits, bhHitRefs); } else { edm::LogVerbatim("HGCalValid") << "No BH RecHit Found "; } } else { edm::Handle<HGChebRecHitCollection> bhRecHit; iEvent.getByToken(bhRecHitTokeng_, bhRecHit); if (bhRecHit.isValid()) { const HGChebRecHitCollection* theHits = (bhRecHit.product()); analyzeHGCalRecHit(theHits, bhHitRefs); } else { edm::LogVerbatim("HGCalValid") << "No BH RecHit Found "; } } } void HGCalHitValidation::analyzeHGCalSimHit(edm::Handle<std::vector<PCaloHit>> const& simHits, int idet, MonitorElement* hist, std::map<unsigned int, HGCHitTuple>& hitRefs) { const HGCalTopology& hTopo = hgcGeometry_[idet]->topology(); for (std::vector<PCaloHit>::const_iterator simHit = simHits->begin(); simHit != simHits->end(); ++simHit) { int subdet, zside, layer, wafer, celltype, cell; HGCalTestNumbering::unpackHexagonIndex(simHit->id(), subdet, zside, layer, wafer, celltype, cell); std::pair<float, float> xy = hgcCons_[idet]->locateCell(cell, layer, wafer, false); float zp = hgcCons_[idet]->waferZ(layer, false); if (zside < 0) zp = -zp; float xp = (zp < 0) ? -xy.first / 10 : xy.first / 10; float yp = xy.second / 10.0; //skip this hit if after ganging it is not valid std::pair<int, int> recoLayerCell = hgcCons_[idet]->simToReco(cell, layer, wafer, hTopo.detectorType()); cell = recoLayerCell.first; layer = recoLayerCell.second; //skip this hit if after ganging it is not valid if (layer < 0 || cell < 0) { } else { //assign the RECO DetId HGCalDetId id = HGCalDetId((ForwardSubdetector)(subdet), zside, layer, celltype, wafer, cell); float energy = simHit->energy(); float energySum(energy); if (hitRefs.count(id.rawId()) != 0) energySum += std::get<0>(hitRefs[id.rawId()]); hitRefs[id.rawId()] = std::make_tuple(energySum, xp, yp, zp); hist->Fill(energy); } } } template <class T1> void HGCalHitValidation::analyzeHGCalRecHit(T1 const& theHits, std::map<unsigned int, HGCHitTuple> const& hitRefs) { for (auto it = theHits->begin(); it != theHits->end(); ++it) { DetId id = it->id(); if (id.det() == DetId::Hcal and id.subdetId() == (int)(HcalEndcap)) { double energy = it->energy(); hebEnRec->Fill(energy); GlobalPoint xyz = hcGeometry_->getGeometry(id)->getPosition(); std::map<unsigned int, HGCHitTuple>::const_iterator itr = hitRefs.find(id.rawId()); if (itr != hitRefs.end()) { float ang3 = xyz.phi().value(); // returns the phi in radians double fac = sinh(std::get<1>(itr->second)); double pT = std::get<3>(itr->second) / fac; double xp = pT * cos(std::get<2>(itr->second)); double yp = pT * sin(std::get<2>(itr->second)); hebRecVsSimX->Fill(xp, xyz.x()); hebRecVsSimY->Fill(yp, xyz.y()); hebRecVsSimZ->Fill(std::get<3>(itr->second), xyz.z()); hebdEtaVsEta->Fill(std::get<1>(itr->second), (xyz.eta() - std::get<1>(itr->second))); hebdPhiVsPhi->Fill(std::get<2>(itr->second), (ang3 - std::get<2>(itr->second))); hebdzVsZ->Fill(std::get<3>(itr->second), (xyz.z() - std::get<3>(itr->second))); hebEnSimRec->Fill(std::get<0>(itr->second), energy); #ifdef EDM_ML_DEBUG edm::LogInfo("HGCalValid") << "BHHit: " << std::hex << id.rawId() << std::dec << " Sim (" << std::get<0>(itr->second) << ", " << std::get<1>(itr->second) << ", " << std::get<2>(itr->second) << ", " << std::get<3>(itr->second) << ") Rec (" << energy << ", " << xyz.x() << ", " << xyz.y() << ", " << xyz.z() << ")\n"; #endif } } } } //define this as a plug-in #include "FWCore/Framework/interface/MakerMacros.h" DEFINE_FWK_MODULE(HGCalHitValidation);
{ "pile_set_name": "Github" }
/** * plugin.js * * Copyright, Moxiecode Systems AB * Released under LGPL License. * * License: http://www.tinymce.com/license * Contributing: http://www.tinymce.com/contributing */ /*global tinymce:true */ tinymce.PluginManager.add('nonbreaking', function(editor) { var setting = editor.getParam('nonbreaking_force_tab'); editor.addCommand('mceNonBreaking', function() { editor.insertContent( (editor.plugins.visualchars && editor.plugins.visualchars.state) ? '<span class="mce-nbsp">&nbsp;</span>' : '&nbsp;' ); editor.dom.setAttrib(editor.dom.select('span.mce-nbsp'), 'data-mce-bogus', '1'); }); editor.addButton('nonbreaking', { title: 'Nonbreaking space', cmd: 'mceNonBreaking' }); editor.addMenuItem('nonbreaking', { text: 'Nonbreaking space', cmd: 'mceNonBreaking', context: 'insert' }); if (setting) { var spaces = +setting > 1 ? +setting : 3; // defaults to 3 spaces if setting is true (or 1) editor.on('keydown', function(e) { if (e.keyCode == 9) { if (e.shiftKey) { return; } e.preventDefault(); for (var i = 0; i < spaces; i++) { editor.execCommand('mceNonBreaking'); } } }); } });
{ "pile_set_name": "Github" }
{ "name": "Fastcoinsha", "symbol": "FSS", "algorithm": "sha256" }
{ "pile_set_name": "Github" }
T0 segment 0 6 Morris T1 segment 7 12 David T2 segment 13 19 Brough T3 segment 20 24 Pert T4 segment 25 28 was T5 segment 29 30 a T6 segment 31 39 Scottish T7 segment 40 48 composer T8 segment 48 49 , T9 segment 50 71 drummer/percussionist T10 segment 71 72 , T11 segment 73 76 and T12 segment 77 84 pianist T13 segment 85 88 who T14 segment 89 97 composed T15 segment 98 100 in T16 segment 101 104 the T17 segment 105 111 fields T18 segment 112 114 of T19 segment 115 119 both T20 segment 120 132 contemporary T21 segment 133 142 classical T22 segment 143 146 and T23 segment 147 156 jazz-rock T24 segment 157 162 music T25 segment 163 164 . R0 compound Arg1:T3 Arg2:T0 R1 s_p Arg1:T3 Arg2:T4 R2 compound Arg1:T3 Arg2:T2 R3 compound Arg1:T3 Arg2:T1 R4 p_o Arg1:T4 Arg2:T7 R5 is-specialized-by Arg1:T7 Arg2:T6 R6 s_p Arg1:T13 Arg2:T14 R7 p_c Arg1:T14 Arg2:T15 R8 c_co Arg1:T15 Arg2:T17 R9 is-specialized-by Arg1:T17 Arg2:T18 R10 c_co Arg1:T18 Arg2:T24 R11 is-specialized-by Arg1:T24 Arg2:T20
{ "pile_set_name": "Github" }
#include "Cookie.h" #include <iostream> #include <cppunit/extensions/HelperMacros.h> #include "Exception.h" #include "util.h" #include "TimeA2.h" #include "TestUtil.h" namespace aria2 { class CookieTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE(CookieTest); CPPUNIT_TEST(testOperatorEqual); CPPUNIT_TEST(testMatch); CPPUNIT_TEST(testIsExpired); CPPUNIT_TEST(testToNsCookieFormat); CPPUNIT_TEST_SUITE_END(); public: void setUp() {} void tearDown() {} void testOperatorEqual(); void testMatch(); void testIsExpired(); void testToNsCookieFormat(); }; CPPUNIT_TEST_SUITE_REGISTRATION(CookieTest); void CookieTest::testOperatorEqual() { auto a = createCookie("k", "v", "localhost", true, "/", false); auto b = createCookie("k", "v", "localhost", true, "/", true); auto wrongPath = createCookie("k", "v", "localhost", true, "/a", false); auto wrongDomain = createCookie("k", "v", "mydomain", true, "/", false); auto wrongName = createCookie("h", "v", "localhost", true, "/a", false); auto caseSensitiveName = createCookie("K", "v", "localhost", true, "/a", false); CPPUNIT_ASSERT(*a == *b); CPPUNIT_ASSERT(!(*a == *wrongPath)); CPPUNIT_ASSERT(!(*a == *wrongDomain)); CPPUNIT_ASSERT(!(*a == *wrongName)); CPPUNIT_ASSERT(!(*a == *caseSensitiveName)); } void CookieTest::testMatch() { auto c = createCookie("k", "v", "aria2.org", false, "/downloads", false); auto c2 = createCookie("k", "v", "aria2.org", false, "/downloads", false); auto c3 = createCookie("k", "v", "aria2.org", true, "/downloads", false); auto c4 = createCookie("k", "v", "localhost", true, "/downloads", false); CPPUNIT_ASSERT(c->match("www.aria2.org", "/downloads", 0, false)); CPPUNIT_ASSERT(c2->match("www.aria2.org", "/downloads", 0, false)); CPPUNIT_ASSERT(!c->match("www.aria.org", "/downloads", 0, false)); CPPUNIT_ASSERT(!c->match("www.aria2.org", "/examples", 0, false)); CPPUNIT_ASSERT(c->match("www.aria2.org", "/downloads", 0, true)); CPPUNIT_ASSERT(c->match("www.aria2.org", "/downloads/latest", 0, false)); CPPUNIT_ASSERT(!c->match("www.aria2.org", "/downloadss/latest", 0, false)); CPPUNIT_ASSERT(!c->match("www.aria2.org", "/DOWNLOADS", 0, false)); CPPUNIT_ASSERT(!c3->match("www.aria2.org", "/downloads", 0, false)); CPPUNIT_ASSERT(c4->match("localhost", "/downloads", 0, false)); auto secureCookie = createCookie("k", "v", "secure.aria2.org", false, "/", true); CPPUNIT_ASSERT(secureCookie->match("secure.aria2.org", "/", 0, true)); CPPUNIT_ASSERT(!secureCookie->match("secure.aria2.org", "/", 0, false)); CPPUNIT_ASSERT(!secureCookie->match("ssecure.aria2.org", "/", 0, true)); CPPUNIT_ASSERT(secureCookie->match("www.secure.aria2.org", "/", 0, true)); auto expireTest = createCookie("k", "v", 1000, "aria2.org", false, "/", false); CPPUNIT_ASSERT(expireTest->match("www.aria2.org", "/", 999, false)); CPPUNIT_ASSERT(expireTest->match("www.aria2.org", "/", 1000, false)); CPPUNIT_ASSERT(!expireTest->match("www.aria2.org", "/", 1001, false)); auto fromNumericHost = createCookie("k", "v", "192.168.1.1", true, "/foo", false); CPPUNIT_ASSERT(fromNumericHost->match("192.168.1.1", "/foo", 0, false)); CPPUNIT_ASSERT(!fromNumericHost->match("www.aria2.org", "/foo", 0, false)); CPPUNIT_ASSERT(!fromNumericHost->match("1.192.168.1.1", "/foo", 0, false)); CPPUNIT_ASSERT(!fromNumericHost->match("192.168.1.1", "/", 0, false)); } void CookieTest::testIsExpired() { auto cookie = createCookie("k", "v", 1000, "localhost", true, "/", false); CPPUNIT_ASSERT(cookie->isExpired(1001)); CPPUNIT_ASSERT(!cookie->isExpired(1000)); CPPUNIT_ASSERT(!cookie->isExpired(999)); auto sessionCookie = createCookie("k", "v", "localhost", true, "/", false); CPPUNIT_ASSERT(!sessionCookie->isExpired(INT32_MAX)); } void CookieTest::testToNsCookieFormat() { CPPUNIT_ASSERT_EQUAL( std::string(".domain.org\tTRUE\t/\tFALSE\t12345678\thello\tworld"), createCookie("hello", "world", 12345678, "domain.org", false, "/", false) ->toNsCookieFormat()); // Session cookie CPPUNIT_ASSERT_EQUAL( std::string("domain.org\tFALSE\t/\tTRUE\t0\thello\tworld"), createCookie("hello", "world", "domain.org", true, "/", true) ->toNsCookieFormat()); } } // namespace aria2
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <project> <property name="jnlp.title" value="JST MultisortHeaderRenderer" /> <property name="jnlp.Name" value="MultisortHeaderRenderer" /> <property name="jnlp.name" value="multisortheaderrenderer" /> <property name="jnlp.codebase" value="https://ateraimemo.com/swing/multisortheaderrenderer" /> <property name="jnlp.homepage" value="https://ateraimemo.com/Swing/MultisortHeaderRenderer.html" /> </project>
{ "pile_set_name": "Github" }
# Session handling with PHP on Google Cloud Platform This directory contains the complete sample code for session handling with PHP using Firestore. Follow the tutorial to run the code: * [Session handling with PHP][sessions] [sessions]: http://cloud.google.com/php/getting-started/sessions
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html> <head> <title>API документация</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta name="viewport" content="width=device-width, initial-scale=1"> <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap.min.css'/> <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/prettify.css'/> <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap-responsive.min.css'/> <link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/application.css'/> <!-- IE6-8 support of HTML5 elements --> <!--[if lt IE 9]> <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <div class="container-fluid"> <div class="row-fluid"> <div id='container'> <ul class='breadcrumb'> <li> <a href='../../../apidoc/v2.ru.html'>Foreman v2</a> <span class='divider'>/</span> </li> <li> <a href='../../../apidoc/v2/hostgroup_classes.ru.html'> Hostgroup classes </a> <span class='divider'>/</span> </li> <li class='active'>create</li> <li class='pull-right'> &nbsp;[ <a href="../../../apidoc/v2/hostgroup_classes/create.pt_BR.html">pt_BR</a> | <a href="../../../apidoc/v2/hostgroup_classes/create.de.html">de</a> | <a href="../../../apidoc/v2/hostgroup_classes/create.it.html">it</a> | <a href="../../../apidoc/v2/hostgroup_classes/create.sv_SE.html">sv_SE</a> | <a href="../../../apidoc/v2/hostgroup_classes/create.zh_CN.html">zh_CN</a> | <a href="../../../apidoc/v2/hostgroup_classes/create.en_GB.html">en_GB</a> | <a href="../../../apidoc/v2/hostgroup_classes/create.cs_CZ.html">cs_CZ</a> | <a href="../../../apidoc/v2/hostgroup_classes/create.fr.html">fr</a> | <b><a href="../../../apidoc/v2/hostgroup_classes/create.ru.html">ru</a></b> | <a href="../../../apidoc/v2/hostgroup_classes/create.ja.html">ja</a> | <a href="../../../apidoc/v2/hostgroup_classes/create.es.html">es</a> | <a href="../../../apidoc/v2/hostgroup_classes/create.ko.html">ko</a> | <a href="../../../apidoc/v2/hostgroup_classes/create.ca.html">ca</a> | <a href="../../../apidoc/v2/hostgroup_classes/create.gl.html">gl</a> | <a href="../../../apidoc/v2/hostgroup_classes/create.en.html">en</a> | <a href="../../../apidoc/v2/hostgroup_classes/create.zh_TW.html">zh_TW</a> | <a href="../../../apidoc/v2/hostgroup_classes/create.nl_NL.html">nl_NL</a> | <a href="../../../apidoc/v2/hostgroup_classes/create.pl.html">pl</a> ] </li> </ul> <div class='page-header'> <h1> POST /api/hostgroups/:hostgroup_id/puppetclass_ids <br> <small>Добавить класс Puppet к группе узлов</small> </h1> </div> <div> <h2>Примеры</h2> <pre class="prettyprint">POST /api/hostgroups/636252244/puppetclass_ids { &quot;puppetclass_id&quot;: 281110143, &quot;hostgroup_class&quot;: { &quot;puppetclass_id&quot;: 281110143 } } 200 { &quot;hostgroup_id&quot;: 636252244, &quot;puppetclass_id&quot;: 281110143 }</pre> <h2>Параметры</h2> <table class='table'> <thead> <tr> <th>Имя параметра</th> <th>Описание</th> </tr> </thead> <tbody> <tr style='background-color:rgb(255,255,255);'> <td> <strong>location_id </strong><br> <small> необязательно </small> </td> <td> <p>Ограничить местоположением</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Integer</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>organization_id </strong><br> <small> необязательно </small> </td> <td> <p>Ограничить организацией</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a Integer</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>hostgroup_id </strong><br> <small> обязательно </small> </td> <td> <p>Код группы узлов</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a String</p> </li> </ul> </td> </tr> <tr style='background-color:rgb(255,255,255);'> <td> <strong>puppetclass_id </strong><br> <small> обязательно </small> </td> <td> <p>Код класса Puppet</p> <p><strong>Validations:</strong></p> <ul> <li> <p>Must be a String</p> </li> </ul> </td> </tr> </tbody> </table> </div> </div> </div> <hr> <footer></footer> </div> <script type='text/javascript' src='../../../apidoc/javascripts/bundled/jquery.js'></script> <script type='text/javascript' src='../../../apidoc/javascripts/bundled/bootstrap-collapse.js'></script> <script type='text/javascript' src='../../../apidoc/javascripts/bundled/prettify.js'></script> <script type='text/javascript' src='../../../apidoc/javascripts/apipie.js'></script> </body> </html>
{ "pile_set_name": "Github" }
compile.on.save=true user.properties.file=C:\\Users\\mafudge\\AppData\\Roaming\\NetBeans\\7.3\\build.properties
{ "pile_set_name": "Github" }
/* * Copyright (C) 2010 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include "WebKitBlobBuilder.h" #include "ArrayBuffer.h" #include "Blob.h" #include "ExceptionCode.h" #include "File.h" #include "LineEnding.h" #include "TextEncoding.h" #include <wtf/PassRefPtr.h> #include <wtf/Vector.h> #include <wtf/text/AtomicString.h> #include <wtf/text/CString.h> namespace WebCore { WebKitBlobBuilder::WebKitBlobBuilder() : m_size(0) { } Vector<char>& WebKitBlobBuilder::getBuffer() { // If the last item is not a data item, create one. Otherwise, we simply append the new string to the last data item. if (m_items.isEmpty() || m_items[m_items.size() - 1].type != BlobDataItem::Data) m_items.append(BlobDataItem(RawData::create())); return *m_items[m_items.size() - 1].data->mutableData(); } void WebKitBlobBuilder::append(const String& text, const String& endingType, ExceptionCode& ec) { bool isEndingTypeTransparent = endingType == "transparent"; bool isEndingTypeNative = endingType == "native"; if (!endingType.isEmpty() && !isEndingTypeTransparent && !isEndingTypeNative) { ec = SYNTAX_ERR; return; } CString utf8Text = UTF8Encoding().encode(text.characters(), text.length(), EntitiesForUnencodables); Vector<char>& buffer = getBuffer(); size_t oldSize = buffer.size(); if (isEndingTypeNative) normalizeLineEndingsToNative(utf8Text, buffer); else buffer.append(utf8Text.data(), utf8Text.length()); m_size += buffer.size() - oldSize; } void WebKitBlobBuilder::append(const String& text, ExceptionCode& ec) { append(text, String(), ec); } #if ENABLE(BLOB) void WebKitBlobBuilder::append(ArrayBuffer* arrayBuffer) { if (!arrayBuffer) return; Vector<char>& buffer = getBuffer(); size_t oldSize = buffer.size(); buffer.append(static_cast<const char*>(arrayBuffer->data()), arrayBuffer->byteLength()); m_size += buffer.size() - oldSize; } #endif void WebKitBlobBuilder::append(Blob* blob) { if (!blob) return; if (blob->isFile()) { // If the blob is file that is not snapshoted, capture the snapshot now. // FIXME: This involves synchronous file operation. We need to figure out how to make it asynchronous. File* file = static_cast<File*>(blob); long long snapshotSize; double snapshotModificationTime; file->captureSnapshot(snapshotSize, snapshotModificationTime); m_size += snapshotSize; m_items.append(BlobDataItem(file->path(), 0, snapshotSize, snapshotModificationTime)); } else { long long blobSize = static_cast<long long>(blob->size()); m_size += blobSize; m_items.append(BlobDataItem(blob->url(), 0, blobSize)); } } PassRefPtr<Blob> WebKitBlobBuilder::getBlob(const String& contentType) { OwnPtr<BlobData> blobData = BlobData::create(); blobData->setContentType(contentType); blobData->swapItems(m_items); RefPtr<Blob> blob = Blob::create(blobData.release(), m_size); // After creating a blob from the current blob data, we do not need to keep the data around any more. Instead, we only // need to keep a reference to the URL of the blob just created. m_items.append(BlobDataItem(blob->url(), 0, m_size)); return blob; } } // namespace WebCore
{ "pile_set_name": "Github" }
var arrayWithHoles = require("./arrayWithHoles"); var iterableToArray = require("./iterableToArray"); var nonIterableRest = require("./nonIterableRest"); function _toArray(arr) { return arrayWithHoles(arr) || iterableToArray(arr) || nonIterableRest(); } module.exports = _toArray;
{ "pile_set_name": "Github" }
/* [auto_generated] boost/numeric/odeint/util/ublas_wrapper.hpp [begin_description] Resizing for ublas::vector and ublas::matrix [end_description] Copyright 2011-2013 Mario Mulansky Copyright 2011-2013 Karsten Ahnert Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_NUMERIC_ODEINT_UTIL_UBLAS_WRAPPER_HPP_INCLUDED #define BOOST_NUMERIC_ODEINT_UTIL_UBLAS_WRAPPER_HPP_INCLUDED #include <boost/type_traits/integral_constant.hpp> #include <boost/numeric/ublas/vector.hpp> #include <boost/numeric/ublas/matrix.hpp> #include <boost/numeric/ublas/lu.hpp> #include <boost/numeric/ublas/vector_expression.hpp> #include <boost/numeric/ublas/matrix_expression.hpp> #include <boost/numeric/odeint/algebra/vector_space_algebra.hpp> #include <boost/numeric/odeint/algebra/default_operations.hpp> #include <boost/numeric/odeint/util/is_resizeable.hpp> #include <boost/numeric/odeint/util/state_wrapper.hpp> /* extend ublas by a few operations */ /* map norm_inf onto reduce( v , default_operations::maximum ) */ namespace boost { namespace numeric { namespace odeint { template< typename T , typename A > struct vector_space_norm_inf< boost::numeric::ublas::vector<T,A> > { typedef T result_type; result_type operator()( const boost::numeric::ublas::vector<T,A> &x ) const { return boost::numeric::ublas::norm_inf( x ); } }; template< class T , class L , class A > struct vector_space_norm_inf< boost::numeric::ublas::matrix<T,L,A> > { typedef T result_type; result_type operator()( const boost::numeric::ublas::matrix<T,L,A> &x ) const { return boost::numeric::ublas::norm_inf( x ); } }; } } } /* additional operations: * abs( v ) * v / w * a + v */ namespace boost { namespace numeric { namespace ublas { // elementwise abs - calculates absolute values of the elements template<class T> struct scalar_abs: public scalar_unary_functor<T> { typedef typename scalar_unary_functor<T>::value_type value_type; typedef typename scalar_unary_functor<T>::argument_type argument_type; typedef typename scalar_unary_functor<T>::result_type result_type; static BOOST_UBLAS_INLINE result_type apply (argument_type t) { using std::abs; return abs (t); } }; // (abs v) [i] = abs (v [i]) template<class E> BOOST_UBLAS_INLINE typename vector_unary_traits<E, scalar_abs<typename E::value_type> >::result_type abs (const vector_expression<E> &e) { typedef typename vector_unary_traits<E, scalar_abs<typename E::value_type> >::expression_type expression_type; return expression_type (e ()); } // (abs m) [i] = abs (m [i]) template<class E> BOOST_UBLAS_INLINE typename matrix_unary1_traits<E, scalar_abs<typename E::value_type> >::result_type abs (const matrix_expression<E> &e) { typedef typename matrix_unary1_traits<E, scalar_abs<typename E::value_type> >::expression_type expression_type; return expression_type (e ()); } // elementwise division (v1 / v2) [i] = v1 [i] / v2 [i] template<class E1, class E2> BOOST_UBLAS_INLINE typename vector_binary_traits<E1, E2, scalar_divides<typename E1::value_type, typename E2::value_type> >::result_type operator / (const vector_expression<E1> &e1, const vector_expression<E2> &e2) { typedef typename vector_binary_traits<E1, E2, scalar_divides<typename E1::value_type, typename E2::value_type> >::expression_type expression_type; return expression_type (e1 (), e2 ()); } // elementwise division (m1 / m2) [i] = m1 [i] / m2 [i] template<class E1, class E2> BOOST_UBLAS_INLINE typename matrix_binary_traits<E1, E2, scalar_divides<typename E1::value_type, typename E2::value_type> >::result_type operator / (const matrix_expression<E1> &e1, const matrix_expression<E2> &e2) { typedef typename matrix_binary_traits<E1, E2, scalar_divides<typename E1::value_type, typename E2::value_type> >::expression_type expression_type; return expression_type (e1 (), e2 ()); } // addition with scalar // (t + v) [i] = t + v [i] template<class T1, class E2> BOOST_UBLAS_INLINE typename enable_if< is_convertible<T1, typename E2::value_type >, typename vector_binary_scalar1_traits<const T1, E2, scalar_plus<T1, typename E2::value_type> >::result_type >::type operator + (const T1 &e1, const vector_expression<E2> &e2) { typedef typename vector_binary_scalar1_traits<const T1, E2, scalar_plus<T1, typename E2::value_type> >::expression_type expression_type; return expression_type (e1, e2 ()); } // addition with scalar // (t + m) [i] = t + m [i] template<class T1, class E2> BOOST_UBLAS_INLINE typename enable_if< is_convertible<T1, typename E2::value_type >, typename matrix_binary_scalar1_traits<const T1, E2, scalar_plus<T1, typename E2::value_type> >::result_type >::type operator + (const T1 &e1, const matrix_expression<E2> &e2) { typedef typename matrix_binary_scalar1_traits<const T1, E2, scalar_plus<T1, typename E2::value_type> >::expression_type expression_type; return expression_type (e1, e2 ()); } } } } /* add resize functionality */ namespace boost { namespace numeric { namespace odeint { /* * resizeable specialization for boost::numeric::ublas::vector */ template< class T , class A > struct is_resizeable< boost::numeric::ublas::vector< T , A > > { typedef boost::true_type type; const static bool value = type::value; }; /* * resizeable specialization for boost::numeric::ublas::matrix */ template< class T , class L , class A > struct is_resizeable< boost::numeric::ublas::matrix< T , L , A > > { typedef boost::true_type type; const static bool value = type::value; }; /* * resizeable specialization for boost::numeric::ublas::permutation_matrix */ template< class T , class A > struct is_resizeable< boost::numeric::ublas::permutation_matrix< T , A > > { typedef boost::true_type type; const static bool value = type::value; }; // specialization for ublas::matrix // same size and resize specialization for matrix-matrix resizing template< class T , class L , class A , class T2 , class L2 , class A2 > struct same_size_impl< boost::numeric::ublas::matrix< T , L , A > , boost::numeric::ublas::matrix< T2 , L2 , A2 > > { static bool same_size( const boost::numeric::ublas::matrix< T , L , A > &m1 , const boost::numeric::ublas::matrix< T2 , L2 , A2 > &m2 ) { return ( ( m1.size1() == m2.size1() ) && ( m1.size2() == m2.size2() ) ); } }; template< class T , class L , class A , class T2 , class L2 , class A2 > struct resize_impl< boost::numeric::ublas::matrix< T , L , A > , boost::numeric::ublas::matrix< T2 , L2 , A2 > > { static void resize( boost::numeric::ublas::matrix< T , L , A > &m1 , const boost::numeric::ublas::matrix< T2 , L2 , A2 > &m2 ) { m1.resize( m2.size1() , m2.size2() ); } }; // same size and resize specialization for matrix-vector resizing template< class T , class L , class A , class T_V , class A_V > struct same_size_impl< boost::numeric::ublas::matrix< T , L , A > , boost::numeric::ublas::vector< T_V , A_V > > { static bool same_size( const boost::numeric::ublas::matrix< T , L , A > &m , const boost::numeric::ublas::vector< T_V , A_V > &v ) { return ( ( m.size1() == v.size() ) && ( m.size2() == v.size() ) ); } }; template< class T , class L , class A , class T_V , class A_V > struct resize_impl< boost::numeric::ublas::matrix< T , L , A > , boost::numeric::ublas::vector< T_V , A_V > > { static void resize( boost::numeric::ublas::matrix< T , L , A > &m , const boost::numeric::ublas::vector< T_V , A_V > &v ) { m.resize( v.size() , v.size() ); } }; // specialization for ublas::permutation_matrix // same size and resize specialization for matrix-vector resizing template< class T , class A , class T_V , class A_V > struct same_size_impl< boost::numeric::ublas::permutation_matrix< T , A > , boost::numeric::ublas::vector< T_V , A_V > > { static bool same_size( const boost::numeric::ublas::permutation_matrix< T , A > &m , const boost::numeric::ublas::vector< T_V , A_V > &v ) { return ( m.size() == v.size() ); // && ( m.size2() == v.size() ) ); } }; template< class T , class A , class T_V , class A_V > struct resize_impl< boost::numeric::ublas::vector< T_V , A_V > , boost::numeric::ublas::permutation_matrix< T , A > > { static void resize( const boost::numeric::ublas::vector< T_V , A_V > &v, boost::numeric::ublas::permutation_matrix< T , A > &m ) { m.resize( v.size() , v.size() ); } }; template< class T , class A > struct state_wrapper< boost::numeric::ublas::permutation_matrix< T , A > > // with resizing { typedef boost::numeric::ublas::permutation_matrix< T , A > state_type; typedef state_wrapper< state_type > state_wrapper_type; state_type m_v; state_wrapper() : m_v( 1 ) // permutation matrix constructor requires a size, choose 1 as default { } }; } } } #endif // BOOST_NUMERIC_ODEINT_UTIL_UBLAS_WRAPPER_HPP_INCLUDED
{ "pile_set_name": "Github" }
// <auto-generated> // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // </auto-generated> namespace k8s.Models { using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// <summary> /// APIServiceCondition describes the state of an APIService at a /// particular point /// </summary> public partial class V1APIServiceCondition { /// <summary> /// Initializes a new instance of the V1APIServiceCondition class. /// </summary> public V1APIServiceCondition() { CustomInit(); } /// <summary> /// Initializes a new instance of the V1APIServiceCondition class. /// </summary> /// <param name="status">Status is the status of the condition. Can be /// True, False, Unknown.</param> /// <param name="type">Type is the type of the condition.</param> /// <param name="lastTransitionTime">Last time the condition /// transitioned from one status to another.</param> /// <param name="message">Human-readable message indicating details /// about last transition.</param> /// <param name="reason">Unique, one-word, CamelCase reason for the /// condition's last transition.</param> public V1APIServiceCondition(string status, string type, System.DateTime? lastTransitionTime = default(System.DateTime?), string message = default(string), string reason = default(string)) { LastTransitionTime = lastTransitionTime; Message = message; Reason = reason; Status = status; Type = type; CustomInit(); } /// <summary> /// An initialization method that performs custom operations like setting defaults /// </summary> partial void CustomInit(); /// <summary> /// Gets or sets last time the condition transitioned from one status /// to another. /// </summary> [JsonProperty(PropertyName = "lastTransitionTime")] public System.DateTime? LastTransitionTime { get; set; } /// <summary> /// Gets or sets human-readable message indicating details about last /// transition. /// </summary> [JsonProperty(PropertyName = "message")] public string Message { get; set; } /// <summary> /// Gets or sets unique, one-word, CamelCase reason for the condition's /// last transition. /// </summary> [JsonProperty(PropertyName = "reason")] public string Reason { get; set; } /// <summary> /// Gets or sets status is the status of the condition. Can be True, /// False, Unknown. /// </summary> [JsonProperty(PropertyName = "status")] public string Status { get; set; } /// <summary> /// Gets or sets type is the type of the condition. /// </summary> [JsonProperty(PropertyName = "type")] public string Type { get; set; } /// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (Status == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Status"); } if (Type == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Type"); } } } }
{ "pile_set_name": "Github" }
$foo $foo-bar $foo_bar #{$foo} #{$foo-bar} #{$foo_bar} ---------------------------------------------------- [ ["variable", "$foo"], ["variable", "$foo-bar"], ["variable", "$foo_bar"], ["variable", "#{$foo}"], ["variable", "#{$foo-bar}"], ["variable", "#{$foo_bar}"] ] ---------------------------------------------------- Checks for variables.
{ "pile_set_name": "Github" }
package com.myimooc.activemq.boot.consumer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageListener; import javax.jms.TextMessage; /** * 消息服务监听类-主题模式 * * @author zc 2017-07-22 */ public class ConsumerTopicMessageListener implements MessageListener { private static final Logger logger = LoggerFactory.getLogger(ConsumerTopicMessageListener.class); /** * 功能:接收到消息后,进行业务逻辑处理 */ @Override public void onMessage(Message message) { TextMessage textMessage = (TextMessage) message; try { logger.info("接收消息:" + textMessage.getText()); } catch (JMSException e) { logger.info("接收消息异常"); e.printStackTrace(); } } }
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.phoenix.end2end; import static org.apache.phoenix.util.TestUtil.ROW1; import static org.apache.phoenix.util.TestUtil.ROW2; import static org.apache.phoenix.util.TestUtil.ROW3; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.sql.Connection; import java.sql.Date; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Timestamp; import java.text.ParseException; import org.apache.phoenix.query.QueryConstants; import org.apache.phoenix.util.DateUtil; import org.apache.phoenix.util.TestUtil; import org.junit.Test; public class TruncateFunctionIT extends ParallelStatsDisabledIT { private static final String DS1 = "1970-01-10 00:58:01.587"; private static final String DS2 = "1970-01-20 01:02:45.906"; private static final String DS3 = "1970-01-30 01:30:24.353"; private static Date toDate(String s) throws ParseException { return DateUtil.parseDate(s); } private static Timestamp toTimestamp(String s) throws ParseException { return DateUtil.parseTimestamp(s); } @Test public void testTruncate() throws Exception { String tenantId = getOrganizationId(); String tableName = generateUniqueName(); ensureTableCreated(url, tableName, TestUtil.ATABLE_NAME, null, null, null); try (Connection conn = DriverManager.getConnection(getUrl())) { PreparedStatement stmt = conn.prepareStatement( "upsert into " + tableName + "(" + " ORGANIZATION_ID, " + " ENTITY_ID, " + " A_DATE, " + " A_TIMESTAMP)" + "VALUES (?, ?, ?, ?)"); stmt.setString(1, tenantId); stmt.setString(2, ROW1); stmt.setDate(3, toDate(DS1)); stmt.setTimestamp(4, toTimestamp(DS1)); stmt.execute(); stmt.setString(1, tenantId); stmt.setString(2, ROW2); stmt.setDate(3, toDate(DS2)); stmt.setTimestamp(4, toTimestamp(DS2)); stmt.execute(); stmt.setString(1, tenantId); stmt.setString(2, ROW3); stmt.setDate(3, toDate(DS3)); stmt.setTimestamp(4, toTimestamp(DS3)); stmt.execute(); conn.commit(); String query = "SELECT entity_id, trunc(a_date, 'day', 7), trunc(a_timestamp, 'second', 10) FROM " + tableName + " WHERE organization_id = ?"; PreparedStatement statement = conn.prepareStatement(query); statement.setString(1, tenantId); ResultSet rs = statement.executeQuery(); assertTrue (rs.next()); assertEquals(ROW1, rs.getString(1)); assertEquals(new Date((long) 7 * QueryConstants.MILLIS_IN_DAY), rs.getDate(2)); assertEquals(toTimestamp("1970-01-10 00:58:00.000"), rs.getTimestamp(3)); assertTrue (rs.next()); assertEquals(ROW2, rs.getString(1)); assertEquals(new Date((long) 14 * QueryConstants.MILLIS_IN_DAY), rs.getDate(2)); assertEquals(toTimestamp("1970-01-20 01:02:40.000"), rs.getTimestamp(3)); assertTrue (rs.next()); assertEquals(ROW3, rs.getString(1)); assertEquals(new Date((long) 28 * QueryConstants.MILLIS_IN_DAY), rs.getDate(2)); assertEquals(toTimestamp("1970-01-30 01:30:20.000"), rs.getTimestamp(3)); assertFalse(rs.next()); } } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>参与和贡献 on ShardingSphere</title> <link>https://shardingsphere.apache.org/document/legacy/3.x/community/cn/contribute/</link> <description>Recent content in 参与和贡献 on ShardingSphere</description> <generator>Hugo -- gohugo.io</generator> <language>en-us</language> <atom:link href="https://shardingsphere.apache.org/document/legacy/3.x/community/cn/contribute/index.xml" rel="self" type="application/rss+xml" /> <item> <title>订阅指南</title> <link>https://shardingsphere.apache.org/document/legacy/3.x/community/cn/contribute/subscribe/</link> <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> <guid>https://shardingsphere.apache.org/document/legacy/3.x/community/cn/contribute/subscribe/</guid> <description>在使用ShardingSphere的过程中,如果您发现任何问题,有新的想法、建议都可以通过Apache邮件列表、gitHub提交issue的方式参与到ShardingSphere的社区建设中。 订阅Apache ShardingSphere(Incubating)的邮件列表 发送订阅邮件 用自己的邮箱向[email protected]发送一封邮件,主题和内容任意(建议用非163邮箱,易被拦截) 接收确认邮件并回复 完成步骤1后,您将收到一封来自[email protected]的确认邮件(如未收到,请确认该邮件是否已被拦截,或已经被自动归入“订阅邮件”、“垃圾邮件”、“推广邮件”等文件夹)。直接回复该邮件,或点击邮件里的链接快捷回复即可,主题和内容任意。 接收欢迎邮件 完成以上步骤后,您会收到一封主题为WELCOME to [email protected]的邮件,至此您已成功订阅Apache ShardingSphere(Incubating)的邮件列表。 gitHub提交issue 可在Issue列表以issue的方式提交您的问题和建议。</description> </item> <item> <title>贡献者指南</title> <link>https://shardingsphere.apache.org/document/legacy/3.x/community/cn/contribute/contributor/</link> <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> <guid>https://shardingsphere.apache.org/document/legacy/3.x/community/cn/contribute/contributor/</guid> <description> 您可以报告bug,提交一个新的功能增强建议或者直接对以上内容提交改进补丁。 提交issue 在提交issue之前,请经过充分的搜索,确定该issue不是通过简单的检索即可以解决的问题。 查看issue列表,确定该issue不是一个重复的问题。 新建一个issue。 使用一个清晰并有描述性的标题来定义issue。 如果您提交的是一个bug,请尽量提供如下信息: 详细的描述复现bug的步骤。包括您使用的SQL,配置情况,预计产生的结果,实际产生的结果。并附加详细的TRACE日志。 ShardingSphere以及操作系统版本。 在github提供用于可以复现问题的项目演示代码。 如果程序抛出异常,请附加完整的堆栈日志。 如有可能,请附上屏幕截图或动态的GIF图,这些图片能帮助演示整个问题的产生过程。 如果涉及性能问题,请附加上CPU,内存或网络磁盘IO的Profile截图。 如果您提交的是一个建议,请尽量提供如下信息: 详细描述增强功能的行为模式。 解释说明为什么该功能是对大多数用户有用的。新功能应该具有广泛的适用性。 如有可能,可以列出其他数据库中间已经具备的类似功能。开源与商用软件均可。 在提交issue之后,对该issue分配合适的标签。如:bug,enhancement,discussion等。 请对自己提交的issue保持关注,在讨论中进一步提供必要信息。 如果问题已经解决,请关闭该issue。如果您不及时关闭,我们将在三天后将其关闭。 如果问题有新的进展,请将之前关闭的issue再次开启。请注意,只有您自己关闭的issue可以再次开启,逾期而被我们关闭的issue您将没有再次开启该issue的权限。 提交pull request 请在选择您要修改的issue。如果是您新发现的问题或想提供issue中没有的功能增强,请先新建一个issue并设置正确的标签。 在选中相关的issue之后,请回复以表明您当前正在这个issue上工作。并在回复的时候为自己设置一个deadline,添加至回复内容中。 在开发者列表中找到一个导师,导师会在设计与功能实现上给予即时的反馈。 您需要fork一个分支到您自己的repo来开始工作。 请您在开发过程中遵循ShardingSphere的开发规范。并在准备提交pull request之前完成相应的检查。 完成后,发送一个pull request到ShardingSphere的dev分支,请不要提交pull request至master分支中。 接着导师做CodeReview,然后他会与您讨论一些细节(包括设计,实现,性能等)。当导师对本次修改满意后,会将提交合并到当前开发版本的分支中。 最后,恭喜您已经成为了ShardingSphere的官方贡献者! </description> </item> <item> <title>提交者指南</title> <link>https://shardingsphere.apache.org/document/legacy/3.x/community/cn/contribute/committer/</link> <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> <guid>https://shardingsphere.apache.org/document/legacy/3.x/community/cn/contribute/committer/</guid> <description> 成为一个提交者 过去的6个月持续的做出贡献 深入理解ShardingSphere核心技术 遵守开发规范 高质量提交 开启Google 2FA(2FA) 维护者责任 维护者是花费大量时间和精力维护项目组件的提交者,这意味着维护者应该: 及时和可靠的评审PR 积极削减PR积压 解答问题 接纳核心更改、bug、特性请求 对于重要的变更,维护者需要确保它完成 改进流程和工具 重构 </description> </item> <item> <title>2FA</title> <link>https://shardingsphere.apache.org/document/legacy/3.x/community/cn/contribute/2fa/</link> <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> <guid>https://shardingsphere.apache.org/document/legacy/3.x/community/cn/contribute/2fa/</guid> <description>双因素认证(2FA) 双因子验证(2FA)是指结合密码以及实物(信用卡、SMS手机、令牌或指纹等生物标志)两种条件对用户进行认证的方法。 为保证提交者账户的安全,我们需要您在GitHub上启用2FA来验证登录用户、并贡献代码。 具体内容可参考2FA。 注意:若您不启用2FA,您将会从本项目中除名,并且无法访问我们的仓库以及来自我们私有仓库的fork仓库。 在GitHub上启用2FA 具体操作,请参考使用TOTP启用双因素认证。 当您开启2FA验证后,您需要使用用户名/密码 + 手机认证码的方式来登录GitHub。 提示:若无法通过页面链接下载对应APP,可在手机的应用市场或是APP Store里搜索并下载Google Authenticator。 如何提交代码 当启用2FA认证后,您需要生成私有访问Token来进行git提交等操作。此时,您将使用用户名 + 私有访问Token 来代替 用户名 + 密码的方式 进行代码的提交。 具体操作,请参考创建私有Token。</description> </item> <item> <title>开发规范</title> <link>https://shardingsphere.apache.org/document/legacy/3.x/community/cn/contribute/code-conduct/</link> <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> <guid>https://shardingsphere.apache.org/document/legacy/3.x/community/cn/contribute/code-conduct/</guid> <description> 开发理念 用心 保持责任心和敬畏心,以工匠精神持续雕琢。 可读 代码无歧义,通过阅读而非调试手段浮现代码意图。 整洁 认同《重构》和《代码整洁之道》的理念,追求整洁优雅代码。 一致 代码风格、命名以及使用方式保持完全一致。 精简 极简代码,以最少的代码表达最正确的意思。高度复用,无重复代码和配置。及时删除无用代码。 抽象 层次划分清晰,概念提炼合理。保持方法、类、包以及模块处于同一抽象层级。 极致 拒绝随意,保证任何一行代码、任何一个字母、任何一个空格都有其存在价值。 代码提交行为规范 确保通过全部测试用例,确保执行mvn clean install可以编译和测试通过。 确保覆盖率不低于dev分支。 确保使用Checkstyle检查代码,违反验证规则的需要有特殊理由。模板位置在sharding-sphere/src/resources/sharding_checks.xml,请使用checkstyle 8.8运行规则。 确保遵守编码规范。 编码规范 使用linux换行符。 缩进(包含空行)和上一行保持一致。 类声明后与下面的变量或方法之间需要空一行。 不应有无意义的空行。 类、方法和变量的命名要做到望文生义,避免使用缩写。 返回值变量使用result命名;循环中使用each命名循环变量;map中使用entry代替each。 捕获的异常名称命名为ex;捕获异常且不做任何事情,异常名称命名为ignored。 配置文件使用驼峰命名,文件名首字母小写。 需要注释解释的代码尽量提成小方法,用方法名称解释。 equals和==条件表达式中,常量在左,变量在右;大于小于等条件表达式中,变量在左,常量在右。 除了用于继承的抽象类之外,尽量将类设计为final。 嵌套循环尽量提成方法。 成员变量定义顺序以及参数传递顺序在各个类和方法中保持一致。 优先使用卫语句。 类和方法的访问权限控制为最小。 方法所用到的私有方法应紧跟该方法,如果有多个私有方法,书写私有方法应与私有方法在原方法的出现顺序相同。 方法入参和返回值不允许为null。 优先使用三目运算符代替if else的返回和赋值语句。 优先使用lombok代替构造器,getter, setter方法和log变量。 优先考虑使用LinkedList,只有在需要通过下标获取集合中元素值时再使用ArrayList。 ArrayList,HashMap等可能产生扩容的集合类型必须指定集合初始大小,避免扩容。 日志与注释一律使用英文。 注释只能包含javadoc,todo和fixme。 公开的类和方法必须有javadoc,其他类和方法以及覆盖自父类的方法无需javadoc。 单元测试规范 测试代码和生产代码需遵守相同代码规范。 如无特殊理由,测试需全覆盖。 每个测试用例需精确断言。 准备环境的代码和测试代码分离。 只有junit Assert,hamcrest CoreMatchers,Mockito相关可以使用static import。 单数据断言,应使用assertTrue,assertFalse,assertNull和assertNotNull。 多数据断言,应使用assertThat。 精确断言,尽量不使用not,containsString断言。 测试用例的真实值应名为为actualXXX,期望值应命名为expectedXXX。 测试类和@Test标注的方法无需javadoc。 </description> </item> <item> <title>外部依赖</title> <link>https://shardingsphere.apache.org/document/legacy/3.x/community/cn/contribute/external-dependency/</link> <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> <guid>https://shardingsphere.apache.org/document/legacy/3.x/community/cn/contribute/external-dependency/</guid> <description>Dependency License scope Guava Apache-2.0 compile Guava Retrying Apache-2.0 compile commons-codec Apache-2.0 compile commons-pool Apache-2.0 test commons-dbcp Apache-2.0 test netty Apache-2.0 compile curator Apache-2.0 compile grpc Apache-2.0 compile protobuf BSD 3-clause compile lombok MIT provided groovy Apache-2.0 compile snakeyaml Apache-2.0 compile spring-context-support Apache-2.</description> </item> <item> <title>测试引擎</title> <link>https://shardingsphere.apache.org/document/legacy/3.x/community/cn/contribute/test-engine/</link> <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate> <guid>https://shardingsphere.apache.org/document/legacy/3.x/community/cn/contribute/test-engine/</guid> <description>ShardingSphere提供了完善的测试引擎。它以XML方式定义SQL,每条SQL由SQL解析单元测试引擎和整合测试引擎驱动,每个引擎分别为H2、MySQL、PostgreSQL、SQLServer和Oracle数据库运行测试用例。 SQL解析单元测试全面覆盖SQL占位符和字面量维度。整合测试进一步拆分为策略和JDBC两个维度,策略维度包括分库分表、仅分表、仅分库、读写分离等策略,JDBC维度包括Statement、PreparedStatement。 因此,1条SQL会驱动5种数据库的解析 * 2种参数传递类型 + 5种数据库 * 5种分片策略 * 2种JDBC运行方式 = 60个测试用例,以达到ShardingSphere对于高质量的追求。 整合测试 测试环境 整合测试由于涉及到真实数据库环境,需要先完成以下准备工作并测试: 在准备测试的数据库上运行resources/integrate/schema/manual_schema_create.sql创建数据库(MySQL、PostgreSQL、SQLServer)及Schema(仅Oracle)。 修改sharding-jdbc/src/test/resources/integrate/env.properties中的databases,指定需要测试的数据库。 运行AllIntegrateTests,检查测试结果。 注意事项 如需测试Oracle,请在pom.xml中增加Oracle驱动依赖。 为了保证测试数据的完整性,整合测试中的分库分表采用了10库10表的方式,因此运行测试用例的时间会比较长。 SQL解析引擎测试 测试环境 SQL解析引擎测试是基于SQL本身的解析,因此无需连接数据库,直接运行AllParsingTests即可。</description> </item> </channel> </rss>
{ "pile_set_name": "Github" }
using System; namespace UniRx.Operators { internal class TimeIntervalObservable<T> : OperatorObservableBase<UniRx.TimeInterval<T>> { readonly IObservable<T> source; readonly IScheduler scheduler; public TimeIntervalObservable(IObservable<T> source, IScheduler scheduler) : base(scheduler == Scheduler.CurrentThread || source.IsRequiredSubscribeOnCurrentThread()) { this.source = source; this.scheduler = scheduler; } protected override IDisposable SubscribeCore(IObserver<UniRx.TimeInterval<T>> observer, IDisposable cancel) { return source.Subscribe(new TimeInterval(this, observer, cancel)); } class TimeInterval : OperatorObserverBase<T, UniRx.TimeInterval<T>> { readonly TimeIntervalObservable<T> parent; DateTimeOffset lastTime; public TimeInterval(TimeIntervalObservable<T> parent, IObserver<UniRx.TimeInterval<T>> observer, IDisposable cancel) : base(observer, cancel) { this.parent = parent; this.lastTime = parent.scheduler.Now; } public override void OnNext(T value) { var now = parent.scheduler.Now; var span = now.Subtract(lastTime); lastTime = now; base.observer.OnNext(new UniRx.TimeInterval<T>(value, span)); } public override void OnError(Exception error) { try { observer.OnError(error); } finally { Dispose(); } } public override void OnCompleted() { try { observer.OnCompleted(); } finally { Dispose(); } } } } }
{ "pile_set_name": "Github" }
"""Use to verify an aligner for a particular application""" from .against_corpus import check_against_corpus __all__ = ["check_against_corpus"]
{ "pile_set_name": "Github" }
<?php /** * Customize API: WP_Customize_Nav_Menu_Location_Control class * * @package WordPress * @subpackage Customize * @since 4.4.0 */ /** * Customize Menu Location Control Class. * * This custom control is only needed for JS. * * @since 4.3.0 * * @see WP_Customize_Control */ class WP_Customize_Nav_Menu_Location_Control extends WP_Customize_Control { /** * Control type. * * @since 4.3.0 * @var string */ public $type = 'nav_menu_location'; /** * Location ID. * * @since 4.3.0 * @var string */ public $location_id = ''; /** * Refresh the parameters passed to JavaScript via JSON. * * @since 4.3.0 * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['locationId'] = $this->location_id; } /** * Render content just like a normal select control. * * @since 4.3.0 * @since 4.9.0 Added a button to create menus. */ public function render_content() { if ( empty( $this->choices ) ) { return; } $value_hidden_class = ''; $no_value_hidden_class = ''; if ( $this->value() ) { $value_hidden_class = ' hidden'; } else { $no_value_hidden_class = ' hidden'; } ?> <label> <?php if ( ! empty( $this->label ) ) : ?> <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> <?php endif; ?> <?php if ( ! empty( $this->description ) ) : ?> <span class="description customize-control-description"><?php echo $this->description; ?></span> <?php endif; ?> <select <?php $this->link(); ?>> <?php foreach ( $this->choices as $value => $label ) : echo '<option value="' . esc_attr( $value ) . '"' . selected( $this->value(), $value, false ) . '>' . $label . '</option>'; endforeach; ?> </select> </label> <button type="button" class="button-link create-menu<?php echo $value_hidden_class; ?>" data-location-id="<?php echo esc_attr( $this->location_id ); ?>" aria-label="<?php esc_attr_e( 'Create a menu for this location' ); ?>"><?php _e( '+ Create New Menu' ); ?></button> <button type="button" class="button-link edit-menu<?php echo $no_value_hidden_class; ?>" aria-label="<?php esc_attr_e( 'Edit selected menu' ); ?>"><?php _e( 'Edit Menu' ); ?></button> <?php } }
{ "pile_set_name": "Github" }
/* * fs/inotify_user.c - inotify support for userspace * * Authors: * John McCutchan <[email protected]> * Robert Love <[email protected]> * * Copyright (C) 2005 John McCutchan * Copyright 2006 Hewlett-Packard Development Company, L.P. * * Copyright (C) 2009 Eric Paris <Red Hat Inc> * inotify was largely rewriten to make use of the fsnotify infrastructure * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2, or (at your option) any * later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. */ #include <linux/dcache.h> /* d_unlinked */ #include <linux/fs.h> /* struct inode */ #include <linux/fsnotify_backend.h> #include <linux/inotify.h> #include <linux/path.h> /* struct path */ #include <linux/slab.h> /* kmem_* */ #include <linux/types.h> #include <linux/sched.h> #include <linux/sched/user.h> #include "inotify.h" /* * Check if 2 events contain the same information. */ static bool event_compare(struct fsnotify_event *old_fsn, struct fsnotify_event *new_fsn) { struct inotify_event_info *old, *new; if (old_fsn->mask & FS_IN_IGNORED) return false; old = INOTIFY_E(old_fsn); new = INOTIFY_E(new_fsn); if ((old_fsn->mask == new_fsn->mask) && (old_fsn->inode == new_fsn->inode) && (old->name_len == new->name_len) && (!old->name_len || !strcmp(old->name, new->name))) return true; return false; } static int inotify_merge(struct list_head *list, struct fsnotify_event *event) { struct fsnotify_event *last_event; last_event = list_entry(list->prev, struct fsnotify_event, list); return event_compare(last_event, event); } int inotify_handle_event(struct fsnotify_group *group, struct inode *inode, u32 mask, const void *data, int data_type, const unsigned char *file_name, u32 cookie, struct fsnotify_iter_info *iter_info) { struct fsnotify_mark *inode_mark = fsnotify_iter_inode_mark(iter_info); struct inotify_inode_mark *i_mark; struct inotify_event_info *event; struct fsnotify_event *fsn_event; int ret; int len = 0; int alloc_len = sizeof(struct inotify_event_info); if (WARN_ON(fsnotify_iter_vfsmount_mark(iter_info))) return 0; if ((inode_mark->mask & FS_EXCL_UNLINK) && (data_type == FSNOTIFY_EVENT_PATH)) { const struct path *path = data; if (d_unlinked(path->dentry)) return 0; } if (file_name) { len = strlen(file_name); alloc_len += len + 1; } pr_debug("%s: group=%p inode=%p mask=%x\n", __func__, group, inode, mask); i_mark = container_of(inode_mark, struct inotify_inode_mark, fsn_mark); event = kmalloc(alloc_len, GFP_KERNEL); if (unlikely(!event)) { /* * Treat lost event due to ENOMEM the same way as queue * overflow to let userspace know event was lost. */ fsnotify_queue_overflow(group); return -ENOMEM; } fsn_event = &event->fse; fsnotify_init_event(fsn_event, inode, mask); event->wd = i_mark->wd; event->sync_cookie = cookie; event->name_len = len; if (len) strcpy(event->name, file_name); ret = fsnotify_add_event(group, fsn_event, inotify_merge); if (ret) { /* Our event wasn't used in the end. Free it. */ fsnotify_destroy_event(group, fsn_event); } if (inode_mark->mask & IN_ONESHOT) fsnotify_destroy_mark(inode_mark, group); return 0; } static void inotify_freeing_mark(struct fsnotify_mark *fsn_mark, struct fsnotify_group *group) { inotify_ignored_and_remove_idr(fsn_mark, group); } /* * This is NEVER supposed to be called. Inotify marks should either have been * removed from the idr when the watch was removed or in the * fsnotify_destroy_mark_by_group() call when the inotify instance was being * torn down. This is only called if the idr is about to be freed but there * are still marks in it. */ static int idr_callback(int id, void *p, void *data) { struct fsnotify_mark *fsn_mark; struct inotify_inode_mark *i_mark; static bool warned = false; if (warned) return 0; warned = true; fsn_mark = p; i_mark = container_of(fsn_mark, struct inotify_inode_mark, fsn_mark); WARN(1, "inotify closing but id=%d for fsn_mark=%p in group=%p still in " "idr. Probably leaking memory\n", id, p, data); /* * I'm taking the liberty of assuming that the mark in question is a * valid address and I'm dereferencing it. This might help to figure * out why we got here and the panic is no worse than the original * BUG() that was here. */ if (fsn_mark) printk(KERN_WARNING "fsn_mark->group=%p wd=%d\n", fsn_mark->group, i_mark->wd); return 0; } static void inotify_free_group_priv(struct fsnotify_group *group) { /* ideally the idr is empty and we won't hit the BUG in the callback */ idr_for_each(&group->inotify_data.idr, idr_callback, group); idr_destroy(&group->inotify_data.idr); if (group->inotify_data.ucounts) dec_inotify_instances(group->inotify_data.ucounts); } static void inotify_free_event(struct fsnotify_event *fsn_event) { kfree(INOTIFY_E(fsn_event)); } /* ding dong the mark is dead */ static void inotify_free_mark(struct fsnotify_mark *fsn_mark) { struct inotify_inode_mark *i_mark; i_mark = container_of(fsn_mark, struct inotify_inode_mark, fsn_mark); kmem_cache_free(inotify_inode_mark_cachep, i_mark); } const struct fsnotify_ops inotify_fsnotify_ops = { .handle_event = inotify_handle_event, .free_group_priv = inotify_free_group_priv, .free_event = inotify_free_event, .freeing_mark = inotify_freeing_mark, .free_mark = inotify_free_mark, };
{ "pile_set_name": "Github" }
/******************************************************************************* * Copyright (c) 2007, 2014 Spring IDE Developers * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-v10.html * * Contributors: * Spring IDE Developers - initial API and implementation *******************************************************************************/ package org.springframework.ide.eclipse.core.model.validation; import java.util.LinkedHashSet; import java.util.Set; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.SubProgressMonitor; import org.springframework.ide.eclipse.core.MarkerUtils; import org.springframework.ide.eclipse.core.internal.model.validation.ValidationRuleDefinition; import org.springframework.ide.eclipse.core.internal.model.validation.ValidationRuleDefinitionFactory; import org.springframework.ide.eclipse.core.model.IModelElement; import org.springframework.ide.eclipse.core.model.IModelElementVisitor; import org.springframework.ide.eclipse.core.model.IResourceModelElement; import org.springframework.ide.eclipse.core.project.DefaultProjectContributorState; import org.springframework.ide.eclipse.core.project.IProjectContributorState; import org.springframework.ide.eclipse.core.project.IProjectContributorStateAware; /** * Base {@link IValidator} implementation that abstracts model visiting and provides implementation hooks for sub * classes. * @author Torsten Juergeleit * @author Christian Dupuis * @author Martin Lippert * @since 2.0 */ public abstract class AbstractValidator implements IValidator, IProjectContributorStateAware { /** Internal state object */ private IProjectContributorState contributorState; /** * unique id that should be used to identify the markers created by this validator */ private String markerId; /** unique id for this validator */ private String validatorId; /** * {@inheritDoc} */ public void cleanup(IResource resource, IProgressMonitor monitor) throws CoreException { MarkerUtils.deleteMarkers(resource, getMarkerId()); } public void setMarkerId(String markerId) { this.markerId = markerId; } /** * {@inheritDoc} */ public void setProjectContributorState(IProjectContributorState contributorState) { this.contributorState = contributorState; this.contributorState.hold(new ValidationProgressState()); } public void setValidatorId(String validatorId) { this.validatorId = validatorId; } /** * {@inheritDoc} */ public final void validate(Set<IResource> affectedResources, int kind, IProgressMonitor monitor) throws CoreException { SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, affectedResources.size()); try { for (IResource resource : affectedResources) { String progressMessage = "Validating '" + resource.getFullPath().toString().substring(1) + "'"; reportProgress(progressMessage, subMonitor); cleanup(resource, subMonitor); if (subMonitor.isCanceled()) { throw new OperationCanceledException(); } IValidationElementLifecycleManager callback = initValidationElementCallback(resource, kind); IResourceModelElement rootElement = callback.getRootElement(); // Check if resource model element is external to the workspace -> if so, do not validate the resource if (rootElement != null && rootElement.isExternal()) { monitor.worked(1); break; } Set<ValidationRuleDefinition> ruleDefinitions = getRuleDefinitions(resource); if (rootElement != null && ruleDefinitions != null && ruleDefinitions.size() > 0) { Set<ValidationProblem> problems = validate(callback, ruleDefinitions, subMonitor); ValidationUtils.createProblemMarkers(resource, problems, getMarkerId()); } // call close on callback to execute any required resource cleanup in template callback.destroy(); subMonitor.worked(1); if (subMonitor.isCanceled()) { throw new OperationCanceledException(); } } } finally { subMonitor.done(); } } private IValidationElementLifecycleManager initValidationElementCallback(IResource resource, int kind) { IValidationElementLifecycleManager callback = createValidationElementLifecycleManager(); if (callback instanceof IValidationElementLifecycleManagerExtension) { ((IValidationElementLifecycleManagerExtension) callback).setKind(kind); } callback.init(resource); return callback; } private Set<ValidationProblem> validate(IValidationElementLifecycleManager callback, Set<ValidationRuleDefinition> ruleDefinitions, SubProgressMonitor subMonitor) { Set<ValidationProblem> problems = new LinkedHashSet<ValidationProblem>(); for (IResourceModelElement contextElement : callback.getContextElements()) { IValidationContext context = createContext(callback.getRootElement(), contextElement); if (context instanceof IProjectContributorStateAware) { ((IProjectContributorStateAware) context).setProjectContributorState(contributorState); } if (context != null) { IModelElementVisitor visitor = new ValidationVisitor(context, ruleDefinitions); callback.getRootElement().accept(visitor, subMonitor); problems.addAll(context.getProblems()); } if (subMonitor.isCanceled()) { throw new OperationCanceledException(); } } return problems; } /** * Returns a newly created {@link IValidationContext} for the given {@link IResourceModelElement root element} and * it's {@link IResourceModelElement context element}. */ protected abstract IValidationContext createContext(IResourceModelElement rootElement, IResourceModelElement contextElement); /** * Returns {@link IValidationElementLifecycleManager}. */ protected abstract IValidationElementLifecycleManager createValidationElementLifecycleManager(); /** * Returns the ID of this validator's {@link IMarker validation problem marker} ID. */ protected String getMarkerId() { return markerId; } /** * Returns the {@link IProjectContributorState}. */ protected synchronized IProjectContributorState getProjectContributorState() { if (contributorState == null) { contributorState = new DefaultProjectContributorState(); } return contributorState; } /** * Returns the list of enabled {@link ValidationRuleDefinition}s for this validator. */ protected Set<ValidationRuleDefinition> getRuleDefinitions(IResource resource) { return ValidationRuleDefinitionFactory.getEnabledRuleDefinitions(getValidatorId(), resource.getProject()); } /** * Returns the validator id */ protected String getValidatorId() { return validatorId; } /** * Report the progress against the given <code>monitor</code>. */ protected void reportProgress(String message, IProgressMonitor monitor, Object... args) { reportProgress(String.format(message, args), monitor); } /** * Report the progress against the given <code>monitor</code>. */ protected void reportProgress(String message, IProgressMonitor monitor) { ValidationProgressState progress = getProjectContributorState().get(ValidationProgressState.class); if (progress != null) { int errorCount = progress.getErrorCount(); int warningCount = progress.getWarningCount(); if (errorCount > 0 || warningCount > 0) { StringBuilder builder = new StringBuilder("(Found "); if (errorCount > 0) { builder.append(errorCount).append((errorCount > 1 ? " errors" : " error")); } if (errorCount > 0 && warningCount > 0) { builder.append(" + "); } if (warningCount > 0) { builder.append(warningCount).append((warningCount > 1 ? " warnings" : " warning")); } builder.append(") ").append(message); monitor.subTask(builder.toString()); } else { monitor.subTask(message); } } else { monitor.subTask(message); } } /** * Returns <code>true</code> if this validator is able to validate the given element. */ protected abstract boolean supports(IModelElement element); /** * provide a hook method to allow validators to skip certain elements during validation * * @param element * @param validationContext * @return */ protected boolean shouldValidate(IModelElement element, IValidationContext validationContext) { return true; } /** * {@link IModelElementVisitor} implementation that validates a specified model tree. */ protected final class ValidationVisitor implements IModelElementVisitor { private IValidationContext context; private Set<ValidationRuleDefinition> ruleDefinitions; public ValidationVisitor(IValidationContext context, Set<ValidationRuleDefinition> ruleDefinitions) { this.ruleDefinitions = ruleDefinitions; this.context = context; } @SuppressWarnings("unchecked") public boolean visit(IModelElement element, IProgressMonitor monitor) { if (supports(element) && shouldValidate(element, context)) { SubProgressMonitor subMonitor = new SubProgressMonitor(monitor, ruleDefinitions.size()); try { for (ValidationRuleDefinition ruleDefinition : ruleDefinitions) { if (subMonitor.isCanceled()) { throw new OperationCanceledException(); } String progressMessage = "Validating element '" + element.getElementName() + "' with rule '" + ruleDefinition.getName() + "'"; reportProgress(progressMessage, subMonitor); IValidationRule rule = ruleDefinition.getRule(); if (rule.supports(element, context)) { context.setCurrentRuleDefinition(ruleDefinition); rule.validate(element, context, monitor); } subMonitor.worked(1); } } finally { subMonitor.done(); } return true; } return false; } } }
{ "pile_set_name": "Github" }
/* ----------------------------------------------------------------------- darwin64.S - Copyright (c) 2006 Free Software Foundation, Inc. Copyright (c) 2008 Red Hat, Inc. derived from unix64.S x86-64 Foreign Function Interface for Darwin. 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 AUTHOR 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. ----------------------------------------------------------------------- */ #ifdef __x86_64__ #define LIBFFI_ASM #include <fficonfig.h> #include <ffi.h> .file "darwin64.S" .text /* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags, void *raddr, void (*fnaddr)(void)); Bit o trickiness here -- ARGS+BYTES is the base of the stack frame for this function. This has been allocated by ffi_call. We also deallocate some of the stack that has been alloca'd. */ .align 3 .globl _ffi_call_unix64 _ffi_call_unix64: LUW0: movq (%rsp), %r10 /* Load return address. */ leaq (%rdi, %rsi), %rax /* Find local stack base. */ movq %rdx, (%rax) /* Save flags. */ movq %rcx, 8(%rax) /* Save raddr. */ movq %rbp, 16(%rax) /* Save old frame pointer. */ movq %r10, 24(%rax) /* Relocate return address. */ movq %rax, %rbp /* Finalize local stack frame. */ LUW1: movq %rdi, %r10 /* Save a copy of the register area. */ movq %r8, %r11 /* Save a copy of the target fn. */ movl %r9d, %eax /* Set number of SSE registers. */ /* Load up all argument registers. */ movq (%r10), %rdi movq 8(%r10), %rsi movq 16(%r10), %rdx movq 24(%r10), %rcx movq 32(%r10), %r8 movq 40(%r10), %r9 testl %eax, %eax jnz Lload_sse Lret_from_load_sse: /* Deallocate the reg arg area. */ leaq 176(%r10), %rsp /* Call the user function. */ call *%r11 /* Deallocate stack arg area; local stack frame in redzone. */ leaq 24(%rbp), %rsp movq 0(%rbp), %rcx /* Reload flags. */ movq 8(%rbp), %rdi /* Reload raddr. */ movq 16(%rbp), %rbp /* Reload old frame pointer. */ LUW2: /* The first byte of the flags contains the FFI_TYPE. */ movzbl %cl, %r10d leaq Lstore_table(%rip), %r11 movslq (%r11, %r10, 4), %r10 addq %r11, %r10 jmp *%r10 Lstore_table: .long Lst_void-Lstore_table /* FFI_TYPE_VOID */ .long Lst_sint32-Lstore_table /* FFI_TYPE_INT */ .long Lst_float-Lstore_table /* FFI_TYPE_FLOAT */ .long Lst_double-Lstore_table /* FFI_TYPE_DOUBLE */ .long Lst_ldouble-Lstore_table /* FFI_TYPE_LONGDOUBLE */ .long Lst_uint8-Lstore_table /* FFI_TYPE_UINT8 */ .long Lst_sint8-Lstore_table /* FFI_TYPE_SINT8 */ .long Lst_uint16-Lstore_table /* FFI_TYPE_UINT16 */ .long Lst_sint16-Lstore_table /* FFI_TYPE_SINT16 */ .long Lst_uint32-Lstore_table /* FFI_TYPE_UINT32 */ .long Lst_sint32-Lstore_table /* FFI_TYPE_SINT32 */ .long Lst_int64-Lstore_table /* FFI_TYPE_UINT64 */ .long Lst_int64-Lstore_table /* FFI_TYPE_SINT64 */ .long Lst_struct-Lstore_table /* FFI_TYPE_STRUCT */ .long Lst_int64-Lstore_table /* FFI_TYPE_POINTER */ .text .align 3 Lst_void: ret .align 3 Lst_uint8: movzbq %al, %rax movq %rax, (%rdi) ret .align 3 Lst_sint8: movsbq %al, %rax movq %rax, (%rdi) ret .align 3 Lst_uint16: movzwq %ax, %rax movq %rax, (%rdi) .align 3 Lst_sint16: movswq %ax, %rax movq %rax, (%rdi) ret .align 3 Lst_uint32: movl %eax, %eax movq %rax, (%rdi) .align 3 Lst_sint32: cltq movq %rax, (%rdi) ret .align 3 Lst_int64: movq %rax, (%rdi) ret .align 3 Lst_float: movss %xmm0, (%rdi) ret .align 3 Lst_double: movsd %xmm0, (%rdi) ret Lst_ldouble: fstpt (%rdi) ret .align 3 Lst_struct: leaq -20(%rsp), %rsi /* Scratch area in redzone. */ /* We have to locate the values now, and since we don't want to write too much data into the user's return value, we spill the value to a 16 byte scratch area first. Bits 8, 9, and 10 control where the values are located. Only one of the three bits will be set; see ffi_prep_cif_machdep for the pattern. */ movd %xmm0, %r10 movd %xmm1, %r11 testl $0x100, %ecx cmovnz %rax, %rdx cmovnz %r10, %rax testl $0x200, %ecx cmovnz %r10, %rdx testl $0x400, %ecx cmovnz %r10, %rax cmovnz %r11, %rdx movq %rax, (%rsi) movq %rdx, 8(%rsi) /* Bits 12-31 contain the true size of the structure. Copy from the scratch area to the true destination. */ shrl $12, %ecx rep movsb ret /* Many times we can avoid loading any SSE registers at all. It's not worth an indirect jump to load the exact set of SSE registers needed; zero or all is a good compromise. */ .align 3 LUW3: Lload_sse: movdqa 48(%r10), %xmm0 movdqa 64(%r10), %xmm1 movdqa 80(%r10), %xmm2 movdqa 96(%r10), %xmm3 movdqa 112(%r10), %xmm4 movdqa 128(%r10), %xmm5 movdqa 144(%r10), %xmm6 movdqa 160(%r10), %xmm7 jmp Lret_from_load_sse LUW4: .align 3 .globl _ffi_closure_unix64 _ffi_closure_unix64: LUW5: /* The carry flag is set by the trampoline iff SSE registers are used. Don't clobber it before the branch instruction. */ leaq -200(%rsp), %rsp LUW6: movq %rdi, (%rsp) movq %rsi, 8(%rsp) movq %rdx, 16(%rsp) movq %rcx, 24(%rsp) movq %r8, 32(%rsp) movq %r9, 40(%rsp) jc Lsave_sse Lret_from_save_sse: movq %r10, %rdi leaq 176(%rsp), %rsi movq %rsp, %rdx leaq 208(%rsp), %rcx call _ffi_closure_unix64_inner /* Deallocate stack frame early; return value is now in redzone. */ addq $200, %rsp LUW7: /* The first byte of the return value contains the FFI_TYPE. */ movzbl %al, %r10d leaq Lload_table(%rip), %r11 movslq (%r11, %r10, 4), %r10 addq %r11, %r10 jmp *%r10 Lload_table: .long Lld_void-Lload_table /* FFI_TYPE_VOID */ .long Lld_int32-Lload_table /* FFI_TYPE_INT */ .long Lld_float-Lload_table /* FFI_TYPE_FLOAT */ .long Lld_double-Lload_table /* FFI_TYPE_DOUBLE */ .long Lld_ldouble-Lload_table /* FFI_TYPE_LONGDOUBLE */ .long Lld_int8-Lload_table /* FFI_TYPE_UINT8 */ .long Lld_int8-Lload_table /* FFI_TYPE_SINT8 */ .long Lld_int16-Lload_table /* FFI_TYPE_UINT16 */ .long Lld_int16-Lload_table /* FFI_TYPE_SINT16 */ .long Lld_int32-Lload_table /* FFI_TYPE_UINT32 */ .long Lld_int32-Lload_table /* FFI_TYPE_SINT32 */ .long Lld_int64-Lload_table /* FFI_TYPE_UINT64 */ .long Lld_int64-Lload_table /* FFI_TYPE_SINT64 */ .long Lld_struct-Lload_table /* FFI_TYPE_STRUCT */ .long Lld_int64-Lload_table /* FFI_TYPE_POINTER */ .text .align 3 Lld_void: ret .align 3 Lld_int8: movzbl -24(%rsp), %eax ret .align 3 Lld_int16: movzwl -24(%rsp), %eax ret .align 3 Lld_int32: movl -24(%rsp), %eax ret .align 3 Lld_int64: movq -24(%rsp), %rax ret .align 3 Lld_float: movss -24(%rsp), %xmm0 ret .align 3 Lld_double: movsd -24(%rsp), %xmm0 ret .align 3 Lld_ldouble: fldt -24(%rsp) ret .align 3 Lld_struct: /* There are four possibilities here, %rax/%rdx, %xmm0/%rax, %rax/%xmm0, %xmm0/%xmm1. We collapse two by always loading both rdx and xmm1 with the second word. For the remaining, bit 8 set means xmm0 gets the second word, and bit 9 means that rax gets the second word. */ movq -24(%rsp), %rcx movq -16(%rsp), %rdx movq -16(%rsp), %xmm1 testl $0x100, %eax cmovnz %rdx, %rcx movd %rcx, %xmm0 testl $0x200, %eax movq -24(%rsp), %rax cmovnz %rdx, %rax ret /* See the comment above Lload_sse; the same logic applies here. */ .align 3 LUW8: Lsave_sse: movdqa %xmm0, 48(%rsp) movdqa %xmm1, 64(%rsp) movdqa %xmm2, 80(%rsp) movdqa %xmm3, 96(%rsp) movdqa %xmm4, 112(%rsp) movdqa %xmm5, 128(%rsp) movdqa %xmm6, 144(%rsp) movdqa %xmm7, 160(%rsp) jmp Lret_from_save_sse LUW9: .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support EH_frame1: .set L$set$0,LECIE1-LSCIE1 /* CIE Length */ .long L$set$0 LSCIE1: .long 0x0 /* CIE Identifier Tag */ .byte 0x1 /* CIE Version */ .ascii "zR\0" /* CIE Augmentation */ .byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */ .byte 0x78 /* sleb128 -8; CIE Data Alignment Factor */ .byte 0x10 /* CIE RA Column */ .byte 0x1 /* uleb128 0x1; Augmentation size */ .byte 0x10 /* FDE Encoding (pcrel sdata4) */ .byte 0xc /* DW_CFA_def_cfa, %rsp offset 8 */ .byte 0x7 /* uleb128 0x7 */ .byte 0x8 /* uleb128 0x8 */ .byte 0x90 /* DW_CFA_offset, column 0x10 */ .byte 0x1 .align 3 LECIE1: .globl _ffi_call_unix64.eh _ffi_call_unix64.eh: LSFDE1: .set L$set$1,LEFDE1-LASFDE1 /* FDE Length */ .long L$set$1 LASFDE1: .long LASFDE1-EH_frame1 /* FDE CIE offset */ .quad LUW0-. /* FDE initial location */ .set L$set$2,LUW4-LUW0 /* FDE address range */ .quad L$set$2 .byte 0x0 /* Augmentation size */ .byte 0x4 /* DW_CFA_advance_loc4 */ .set L$set$3,LUW1-LUW0 .long L$set$3 /* New stack frame based off rbp. This is a itty bit of unwind trickery in that the CFA *has* changed. There is no easy way to describe it correctly on entry to the function. Fortunately, it doesn't matter too much since at all points we can correctly unwind back to ffi_call. Note that the location to which we moved the return address is (the new) CFA-8, so from the perspective of the unwind info, it hasn't moved. */ .byte 0xc /* DW_CFA_def_cfa, %rbp offset 32 */ .byte 0x6 .byte 0x20 .byte 0x80+6 /* DW_CFA_offset, %rbp offset 2*-8 */ .byte 0x2 .byte 0xa /* DW_CFA_remember_state */ .byte 0x4 /* DW_CFA_advance_loc4 */ .set L$set$4,LUW2-LUW1 .long L$set$4 .byte 0xc /* DW_CFA_def_cfa, %rsp offset 8 */ .byte 0x7 .byte 0x8 .byte 0xc0+6 /* DW_CFA_restore, %rbp */ .byte 0x4 /* DW_CFA_advance_loc4 */ .set L$set$5,LUW3-LUW2 .long L$set$5 .byte 0xb /* DW_CFA_restore_state */ .align 3 LEFDE1: .globl _ffi_closure_unix64.eh _ffi_closure_unix64.eh: LSFDE3: .set L$set$6,LEFDE3-LASFDE3 /* FDE Length */ .long L$set$6 LASFDE3: .long LASFDE3-EH_frame1 /* FDE CIE offset */ .quad LUW5-. /* FDE initial location */ .set L$set$7,LUW9-LUW5 /* FDE address range */ .quad L$set$7 .byte 0x0 /* Augmentation size */ .byte 0x4 /* DW_CFA_advance_loc4 */ .set L$set$8,LUW6-LUW5 .long L$set$8 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 208,1 /* uleb128 208 */ .byte 0xa /* DW_CFA_remember_state */ .byte 0x4 /* DW_CFA_advance_loc4 */ .set L$set$9,LUW7-LUW6 .long L$set$9 .byte 0xe /* DW_CFA_def_cfa_offset */ .byte 0x8 .byte 0x4 /* DW_CFA_advance_loc4 */ .set L$set$10,LUW8-LUW7 .long L$set$10 .byte 0xb /* DW_CFA_restore_state */ .align 3 LEFDE3: .subsections_via_symbols #endif /* __x86_64__ */
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.tomee.microprofile.tck.jwt.jwk; import org.apache.tomee.microprofile.jwt.config.JWTAuthConfigurationProperties; import org.apache.tomee.microprofile.jwt.config.JWTAuthConfiguration; import org.eclipse.microprofile.jwt.config.Names; import org.eclipse.microprofile.jwt.tck.TCKConstants; import org.eclipse.microprofile.jwt.tck.util.TokenUtils; import org.jose4j.jwa.AlgorithmConstraints; import org.jose4j.jwt.NumericDate; import org.jose4j.jwt.consumer.JwtConsumer; import org.jose4j.jwt.consumer.JwtConsumerBuilder; import org.jose4j.jwt.consumer.JwtContext; import org.jose4j.keys.resolvers.JwksVerificationKeyResolver; import org.testng.Assert; import org.testng.annotations.Test; import java.nio.file.Paths; import java.security.PrivateKey; import java.util.HashMap; import static org.jose4j.jwa.AlgorithmConstraints.ConstraintType.WHITELIST; import static org.jose4j.jws.AlgorithmIdentifiers.RSA_USING_SHA256; public class PublicKeyAsJWKSTest { @Test public void validateJWKS() throws Exception { System.setProperty(Names.VERIFIER_PUBLIC_KEY, ""); System.setProperty(Names.VERIFIER_PUBLIC_KEY_LOCATION, "file://" + Paths.get("").toAbsolutePath().toString() + "/src/test/resources/signer-keyset4k.jwk"); System.setProperty(Names.ISSUER, TCKConstants.TEST_ISSUER); final PrivateKey privateKey = TokenUtils.readPrivateKey("/privateKey4k.pem"); final String kid = "publicKey4k"; final String token = TokenUtils.generateTokenString(privateKey, kid, "/Token1.json", null, new HashMap<>()); System.out.println("token = " + token); final JWTAuthConfigurationProperties JWTAuthConfigurationProperties = new JWTAuthConfigurationProperties(); JWTAuthConfigurationProperties.init(null); final JWTAuthConfiguration jwtAuthConfiguration = JWTAuthConfigurationProperties.getJWTAuthConfiguration().orElseThrow(IllegalArgumentException::new); final JwtConsumerBuilder jwtConsumerBuilder = new JwtConsumerBuilder() .setRequireExpirationTime() .setRequireSubject() .setSkipDefaultAudienceValidation() .setExpectedIssuer(jwtAuthConfiguration.getIssuer()) .setJwsAlgorithmConstraints(new AlgorithmConstraints(WHITELIST, RSA_USING_SHA256)) .setSkipDefaultAudienceValidation() .setVerificationKey(jwtAuthConfiguration.getPublicKey()); if (jwtAuthConfiguration.getExpGracePeriodSecs() > 0) { jwtConsumerBuilder.setAllowedClockSkewInSeconds(jwtAuthConfiguration.getExpGracePeriodSecs()); } else { jwtConsumerBuilder.setEvaluationTime(NumericDate.fromSeconds(0)); } if (jwtAuthConfiguration.isSingleKey()) { jwtConsumerBuilder.setVerificationKey(jwtAuthConfiguration.getPublicKey()); } else { jwtConsumerBuilder.setVerificationKeyResolver(new JwksVerificationKeyResolver(jwtAuthConfiguration.getPublicKeys())); } final JwtConsumer jwtConsumer = jwtConsumerBuilder.build(); final JwtContext jwtContext = jwtConsumer.process(token); Assert.assertEquals(jwtContext.getJwtClaims().getStringClaimValue("upn"), "[email protected]"); } }
{ "pile_set_name": "Github" }
#include "tommath_private.h" #ifdef BN_MP_INIT_U64_C /* LibTomMath, multiple-precision integer library -- Tom St Denis */ /* SPDX-License-Identifier: Unlicense */ MP_INIT_INT(mp_init_u64, mp_set_u64, uint64_t) #endif
{ "pile_set_name": "Github" }
%p= link_to raw('&larr; back'), '/' %ol.the_sortable_tree{ data: { rebuild_url: rebuild_admin_pages_url } } = build_server_tree @pages, type: :sortable
{ "pile_set_name": "Github" }
require "json" module Ameba::Formatter # A formatter that produces the result in a json format. # # Example: # # ``` # { # "metadata": { # "ameba_version": "x.x.x", # "crystal_version": "x.x.x", # }, # "sources": [ # { # "issues": [ # { # "location": { # "column": 7, # "line": 17, # }, # "end_location": { # "column": 20, # "line": 17, # }, # "message": "Useless assignment to variable `a`", # "rule_name": "UselessAssign", # "severity": "Convention", # }, # { # "location": { # "column": 7, # "line": 18, # }, # "end_location": { # "column": 8, # "line": 18, # }, # "message": "Useless assignment to variable `a`", # "rule_name": "UselessAssign", # }, # { # "location": { # "column": 7, # "line": 19, # }, # "end_location": { # "column": 9, # "line": 19, # }, # "message": "Useless assignment to variable `a`", # "rule_name": "UselessAssign", # "severity": "Convention", # }, # ], # "path": "src/ameba/formatter/json_formatter.cr", # }, # ], # "summary": { # "issues_count": 3, # "target_sources_count": 1, # }, # } # ``` # class JSONFormatter < BaseFormatter def initialize(@output = STDOUT) @result = AsJSON::Result.new end def started(sources) @result.summary.target_sources_count = sources.size end def source_finished(source : Source) json_source = AsJSON::Source.new source.path source.issues.each do |e| next if e.disabled? json_source.issues << AsJSON::Issue.new(e.rule.name, e.rule.severity.to_s, e.location, e.end_location, e.message) @result.summary.issues_count += 1 end @result.sources << json_source end def finished(sources) @result.to_json @output end end private module AsJSON record Result, sources = [] of Source, metadata = Metadata.new, summary = Summary.new do def to_json(json) {sources: sources, metadata: metadata, summary: summary}.to_json(json) end end record Source, path : String, issues = [] of Issue do def to_json(json) {path: path, issues: issues}.to_json(json) end end record Issue, rule_name : String, severity : String, location : Crystal::Location?, end_location : Crystal::Location?, message : String do def to_json(json) json.object do json.field :rule_name, rule_name json.field :severity, severity json.field :message, message json.field :location, {line: location.try &.line_number, column: location.try &.column_number} json.field :end_location, {line: end_location.try &.line_number, column: end_location.try &.column_number} end end end record Metadata, ameba_version : String = Ameba::VERSION, crystal_version : String = Crystal::VERSION do def to_json(json) json.object do json.field :ameba_version, ameba_version json.field :crystal_version, crystal_version end end end class Summary property target_sources_count = 0 property issues_count = 0 def to_json(json) json.object do json.field :target_sources_count, target_sources_count json.field :issues_count, issues_count end end end end end
{ "pile_set_name": "Github" }
## This file is (hopefully) part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## <[email protected]> ## This program is published under a GPLv2 license # scapy.contrib.description = PPI # scapy.contrib.status = loads """ PPI (Per-Packet Information). """ import logging,struct from scapy.config import conf from scapy.packet import * from scapy.fields import * from scapy.layers.l2 import Ether from scapy.layers.dot11 import Dot11 # Dictionary to map the TLV type to the class name of a sub-packet _ppi_types = {} def addPPIType(id, value): _ppi_types[id] = value def getPPIType(id, default="default"): return _ppi_types.get(id, _ppi_types.get(default, None)) # Default PPI Field Header class PPIGenericFldHdr(Packet): name = "PPI Field Header" fields_desc = [ LEShortField('pfh_type', 0), FieldLenField('pfh_length', None, length_of="value", fmt='<H', adjust=lambda p,x:x+4), StrLenField("value", "", length_from=lambda p:p.pfh_length) ] def extract_padding(self, p): return "",p def _PPIGuessPayloadClass(p, **kargs): """ This function tells the PacketListField how it should extract the TLVs from the payload. We pass cls only the length string pfh_len says it needs. If a payload is returned, that means part of the sting was unused. This converts to a Raw layer, and the remainder of p is added as Raw's payload. If there is no payload, the remainder of p is added as out's payload. """ if len(p) >= 4: t,pfh_len = struct.unpack("<HH", p[:4]) # Find out if the value t is in the dict _ppi_types. # If not, return the default TLV class cls = getPPIType(t, "default") pfh_len += 4 out = cls(p[:pfh_len], **kargs) if (out.payload): out.payload = conf.raw_layer(out.payload.load) if (len(p) > pfh_len): out.payload.payload = conf.padding_layer(p[pfh_len:]) elif (len(p) > pfh_len): out.payload = conf.padding_layer(p[pfh_len:]) else: out = conf.raw_layer(p, **kargs) return out class PPI(Packet): name = "PPI Packet Header" fields_desc = [ ByteField('pph_version', 0), ByteField('pph_flags', 0), FieldLenField('pph_len', None, length_of="PPIFieldHeaders", fmt="<H", adjust=lambda p,x:x+8 ), LEIntField('dlt', None), PacketListField("PPIFieldHeaders", [], _PPIGuessPayloadClass, length_from=lambda p:p.pph_len-8,) ] def guess_payload_class(self,payload): return conf.l2types.get(self.dlt, Packet.guess_payload_class(self, payload)) #Register PPI addPPIType("default", PPIGenericFldHdr) conf.l2types.register(192, PPI) conf.l2types.register_num2layer(192, PPI) bind_layers(PPI, Dot11, dlt=conf.l2types.get(Dot11)) bind_layers(Dot11, PPI) bind_layers(PPI, Ether, dlt=conf.l2types.get(Ether)) bind_layers(Dot11, Ether)
{ "pile_set_name": "Github" }
<?php class Mcommerce_Model_Delivery_Method extends Core_Model_Default { protected $_instance; protected $_cart; public function __construct($params = []) { parent::__construct($params); $this->_db_table = 'Mcommerce_Model_Db_Table_Delivery_Method'; return $this; } public function findByStore($id = null) { if(!$id) $id = -1; return $this->getTable()->findByStore($id); } public function saveStoreDatas($store_id, $method_datas) { $this->getTable()->saveStoreDatas($store_id, $method_datas); return $this; } public function getName() { return $this->_($this->getData('name')); } public function getInstance() { if (!$this->_instance) { $class = get_class($this) . "_" . ucfirst(str_replace("_", "", $this->getCode())); try { if (!class_exists($class)) { $class = get_class($this) . "_Default"; } } catch (Exception $ex) { $class = get_class($this) . "_Default"; } $this->_instance = new $class(); $this->_instance->setMethod($this); } return $this->_instance; } public function isAvailable($app = null) { return $this->getInstance()->isAvailable($app); } public function isFree() { return $this->getInstance()->isFree(); } public function customerAddressIsRequired() { return $this->getInstance()->customerAddressIsRequired(); } public function setCart($cart) { $this->_cart = $cart; // $this->getCart()->getSubtotalInclTax(); if($cart->getSubtotalInclTax() > $this->getMinAmountForFreeDelivery()) { $this->setPrice(0); } return $this; } public function getCart() { return $this->_cart ? $this->_cart : new Mcommerce_Model_Cart(); } }
{ "pile_set_name": "Github" }
require('../modules/es6.math.acosh'); require('../modules/es6.math.asinh'); require('../modules/es6.math.atanh'); require('../modules/es6.math.cbrt'); require('../modules/es6.math.clz32'); require('../modules/es6.math.cosh'); require('../modules/es6.math.expm1'); require('../modules/es6.math.fround'); require('../modules/es6.math.hypot'); require('../modules/es6.math.imul'); require('../modules/es6.math.log10'); require('../modules/es6.math.log1p'); require('../modules/es6.math.log2'); require('../modules/es6.math.sign'); require('../modules/es6.math.sinh'); require('../modules/es6.math.tanh'); require('../modules/es6.math.trunc'); module.exports = require('../modules/$.core').Math;
{ "pile_set_name": "Github" }
#!/bin/bash DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)" OS_TYPE=`uname -s` export OSTYPE=${OS_TYPE} pushd ${DIR}/.. case ${OS_TYPE} in Linux) ${MINKO_HOME}/script/premake5.sh $@ --cc=gcc gmake ;; Darwin) ${MINKO_HOME}/script/premake5.sh $@ --cc=gcc gmake ;; CYGWIN*) ${MINKO_HOME}/script/premake5.bat $@ --cc=gcc gmake ;; esac popd
{ "pile_set_name": "Github" }
{ "images" : [ { "size" : "20x20", "idiom" : "iphone", "filename" : "[email protected]", "scale" : "2x" }, { "size" : "20x20", "idiom" : "iphone", "filename" : "[email protected]", "scale" : "3x" }, { "size" : "29x29", "idiom" : "iphone", "filename" : "[email protected]", "scale" : "2x" }, { "size" : "29x29", "idiom" : "iphone", "filename" : "[email protected]", "scale" : "3x" }, { "size" : "40x40", "idiom" : "iphone", "filename" : "[email protected]", "scale" : "2x" }, { "size" : "40x40", "idiom" : "iphone", "filename" : "[email protected]", "scale" : "3x" }, { "size" : "60x60", "idiom" : "iphone", "filename" : "[email protected]", "scale" : "2x" }, { "size" : "60x60", "idiom" : "iphone", "filename" : "[email protected]", "scale" : "3x" }, { "size" : "1024x1024", "idiom" : "ios-marketing", "filename" : "app-icon-app-store.png", "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
BEGIN:VCALENDAR PRODID:-//tzurl.org//NONSGML Olson 2011n//EN VERSION:2.0 BEGIN:VTIMEZONE TZID:Africa/Monrovia TZURL:http://tzurl.org/zoneinfo-global/Africa/Monrovia X-LIC-LOCATION:Africa/Monrovia BEGIN:STANDARD TZOFFSETFROM:-004308 TZOFFSETTO:-004308 TZNAME:MMT DTSTART:18820101T000000 RDATE:18820101T000000 END:STANDARD BEGIN:STANDARD TZOFFSETFROM:-004308 TZOFFSETTO:-004430 TZNAME:LRT DTSTART:19190301T000000 RDATE:19190301T000000 END:STANDARD BEGIN:STANDARD TZOFFSETFROM:-004430 TZOFFSETTO:+0000 TZNAME:GMT DTSTART:19720501T000000 RDATE:19720501T000000 END:STANDARD END:VTIMEZONE END:VCALENDAR
{ "pile_set_name": "Github" }
/* eslint-disable max-classes-per-file */ class Person { constructor(name = 'Anonymous', gender = 'Unknown') { this.name = name; this.gender = gender; } printDetails() { return `${this.name} is ${this.gender}`; } } const person = new Person('Amit Agarwal', 'male'); Logger.log(person.printDetails()); class Employee extends Person { constructor(name, gender, role) { super(name, gender); this.role = role; } printRole() { return `${this.name} is ${this.role}`; } } const employee = new Employee('Amit', 'male', 'Google Developer'); Logger.log(employee.printDetails()); Logger.log(employee.printRole());
{ "pile_set_name": "Github" }
package client import ( "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" ) type Client struct { DatabasesClient *sql.DatabasesClient DatabaseThreatDetectionPoliciesClient *sql.DatabaseThreatDetectionPoliciesClient ElasticPoolsClient *sql.ElasticPoolsClient FirewallRulesClient *sql.FirewallRulesClient FailoverGroupsClient *sql.FailoverGroupsClient ServersClient *sql.ServersClient ServerAzureADAdministratorsClient *sql.ServerAzureADAdministratorsClient VirtualNetworkRulesClient *sql.VirtualNetworkRulesClient } func NewClient(o *common.ClientOptions) *Client { // SQL Azure DatabasesClient := sql.NewDatabasesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&DatabasesClient.Client, o.ResourceManagerAuthorizer) DatabaseThreatDetectionPoliciesClient := sql.NewDatabaseThreatDetectionPoliciesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&DatabaseThreatDetectionPoliciesClient.Client, o.ResourceManagerAuthorizer) ElasticPoolsClient := sql.NewElasticPoolsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&ElasticPoolsClient.Client, o.ResourceManagerAuthorizer) FailoverGroupsClient := sql.NewFailoverGroupsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&FailoverGroupsClient.Client, o.ResourceManagerAuthorizer) FirewallRulesClient := sql.NewFirewallRulesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&FirewallRulesClient.Client, o.ResourceManagerAuthorizer) ServersClient := sql.NewServersClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&ServersClient.Client, o.ResourceManagerAuthorizer) ServerAzureADAdministratorsClient := sql.NewServerAzureADAdministratorsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&ServerAzureADAdministratorsClient.Client, o.ResourceManagerAuthorizer) VirtualNetworkRulesClient := sql.NewVirtualNetworkRulesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&VirtualNetworkRulesClient.Client, o.ResourceManagerAuthorizer) return &Client{ DatabasesClient: &DatabasesClient, DatabaseThreatDetectionPoliciesClient: &DatabaseThreatDetectionPoliciesClient, ElasticPoolsClient: &ElasticPoolsClient, FailoverGroupsClient: &FailoverGroupsClient, FirewallRulesClient: &FirewallRulesClient, ServersClient: &ServersClient, ServerAzureADAdministratorsClient: &ServerAzureADAdministratorsClient, VirtualNetworkRulesClient: &VirtualNetworkRulesClient, } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <maintainer type="person"> <email>[email protected]</email> <name>Brian Dolbec</name> </maintainer> </pkgmetadata>
{ "pile_set_name": "Github" }
/* * encoder.h include file * * Copyright (c) 2000 Mark Taylor * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifndef LAME_ENCODER_H #define LAME_ENCODER_H /*********************************************************************** * * encoder and decoder delays * ***********************************************************************/ /* * layer III enc->dec delay: 1056 (1057?) (observed) * layer II enc->dec delay: 480 (481?) (observed) * * polyphase 256-16 (dec or enc) = 240 * mdct 256+32 (9*32) (dec or enc) = 288 * total: 512+16 * * My guess is that delay of polyphase filterbank is actualy 240.5 * (there are technical reasons for this, see postings in mp3encoder). * So total Encode+Decode delay = ENCDELAY + 528 + 1 */ /* * ENCDELAY The encoder delay. * * Minimum allowed is MDCTDELAY (see below) * * The first 96 samples will be attenuated, so using a value less than 96 * will result in corrupt data for the first 96-ENCDELAY samples. * * suggested: 576 * set to 1160 to sync with FhG. */ #define ENCDELAY 576 /* * make sure there is at least one complete frame after the * last frame containing real data * * Using a value of 288 would be sufficient for a * a very sophisticated decoder that can decode granule-by-granule instead * of frame by frame. But lets not assume this, and assume the decoder * will not decode frame N unless it also has data for frame N+1 * */ /*#define POSTDELAY 288*/ #define POSTDELAY 1152 /* * delay of the MDCT used in mdct.c * original ISO routines had a delay of 528! * Takehiro's routines: */ #define MDCTDELAY 48 #define FFTOFFSET (224+MDCTDELAY) /* * Most decoders, including the one we use, have a delay of 528 samples. */ #define DECDELAY 528 /* number of subbands */ #define SBLIMIT 32 /* parition bands bands */ #define CBANDS 64 /* number of critical bands/scale factor bands where masking is computed*/ #define SBPSY_l 21 #define SBPSY_s 12 /* total number of scalefactor bands encoded */ #define SBMAX_l 22 #define SBMAX_s 13 #define PSFB21 6 #define PSFB12 6 /* FFT sizes */ #define BLKSIZE 1024 #define HBLKSIZE (BLKSIZE/2 + 1) #define BLKSIZE_s 256 #define HBLKSIZE_s (BLKSIZE_s/2 + 1) /* #define switch_pe 1800 */ #define NORM_TYPE 0 #define START_TYPE 1 #define SHORT_TYPE 2 #define STOP_TYPE 3 /* * Mode Extention: * When we are in stereo mode, there are 4 possible methods to store these * two channels. The stereo modes -m? are using a subset of them. * * -ms: MPG_MD_LR_LR * -mj: MPG_MD_LR_LR and MPG_MD_MS_LR * -mf: MPG_MD_MS_LR * -mi: all */ #if 0 #define MPG_MD_LR_LR 0 #define MPG_MD_LR_I 1 #define MPG_MD_MS_LR 2 #define MPG_MD_MS_I 3 #endif enum MPEGChannelMode { MPG_MD_LR_LR = 0 , MPG_MD_LR_I = 1 , MPG_MD_MS_LR = 2 , MPG_MD_MS_I = 3 }; #ifndef lame_internal_flags_defined #define lame_internal_flags_defined struct lame_internal_flags; typedef struct lame_internal_flags lame_internal_flags; #endif int lame_encode_mp3_frame(lame_internal_flags * gfc, sample_t const *inbuf_l, sample_t const *inbuf_r, unsigned char *mp3buf, int mp3buf_size); #endif /* LAME_ENCODER_H */
{ "pile_set_name": "Github" }
#!/bin/bash # Translate the bits making up a GFP mask # (c) 2009, Mel Gorman <[email protected]> # Licensed under the terms of the GNU GPL License version 2 SOURCE= GFPMASK=none # Helper function to report failures and exit die() { echo ERROR: $@ if [ "$TMPFILE" != "" ]; then rm -f $TMPFILE fi exit -1 } usage() { echo "usage: gfp-translate [-h] [ --source DIRECTORY ] gfpmask" exit 0 } # Parse command-line arguments while [ $# -gt 0 ]; do case $1 in --source) SOURCE=$2 shift 2 ;; -h) usage ;; --help) usage ;; *) GFPMASK=$1 shift ;; esac done # Guess the kernel source directory if it's not set. Preference is in order of # o current directory # o /usr/src/linux if [ "$SOURCE" = "" ]; then if [ -r "/usr/src/linux/Makefile" ]; then SOURCE=/usr/src/linux fi if [ -r "`pwd`/Makefile" ]; then SOURCE=`pwd` fi fi # Confirm that a source directory exists if [ ! -r "$SOURCE/Makefile" ]; then die "Could not locate kernel source directory or it is invalid" fi # Confirm that a GFP mask has been specified if [ "$GFPMASK" = "none" ]; then usage fi # Extract GFP flags from the kernel source TMPFILE=`mktemp -t gfptranslate-XXXXXX` || exit 1 grep -q ___GFP $SOURCE/include/linux/gfp.h if [ $? -eq 0 ]; then grep "^#define ___GFP" $SOURCE/include/linux/gfp.h | sed -e 's/u$//' | grep -v GFP_BITS > $TMPFILE else grep "^#define __GFP" $SOURCE/include/linux/gfp.h | sed -e 's/(__force gfp_t)//' | sed -e 's/u)/)/' | grep -v GFP_BITS | sed -e 's/)\//) \//' > $TMPFILE fi # Parse the flags IFS=" " echo Source: $SOURCE echo Parsing: $GFPMASK for LINE in `cat $TMPFILE`; do MASK=`echo $LINE | awk '{print $3}'` if [ $(($GFPMASK&$MASK)) -ne 0 ]; then echo $LINE fi done rm -f $TMPFILE exit 0
{ "pile_set_name": "Github" }
# Event 82 - DUser_ReleaseStagingBuffer ###### Version: 0 ## Description None ## Data Dictionary |Standard Name|Field Name|Type|Description|Sample Value| |---|---|---|---|---| |TBD|surfaceId|Pointer|None|`None`| ## Tags * etw_level_Informational * etw_keywords_DUserSurface * etw_task_DUser_ReleaseStagingBuffer
{ "pile_set_name": "Github" }
module.exports = { preset: 'react-native', moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], }
{ "pile_set_name": "Github" }
#!/usr/bin/env bash # fail on any command exiting non-zero set -eo pipefail if [[ -z $DOCKER_BUILD ]]; then echo echo "Note: this script is intended for use by the Dockerfile and not as a way to build the registry locally" echo exit 1 fi # install required packages (copied from dotcloud/docker-registry Dockerfile) apk add --no-cache \ build-base \ git \ openssl-dev \ python-dev \ libffi-dev \ swig \ libevent-dev \ xz-dev # install pip curl -sSL https://bootstrap.pypa.io/get-pip.py | python - pip==8.1.1 # create a registry user adduser -D -s /bin/bash registry # add the docker registry source from github git clone -b deis-v1-lts --single-branch https://github.com/deis/docker-registry /docker-registry && \ chown -R registry:registry /docker-registry # install boto configuration cp /docker-registry/config/boto.cfg /etc/boto.cfg cd /docker-registry && pip install --disable-pip-version-check --no-cache-dir -r requirements/main.txt # Install core pip install --disable-pip-version-check --no-cache-dir /docker-registry/depends/docker-registry-core # Install registry pip install --disable-pip-version-check --no-cache-dir "file:///docker-registry#egg=docker-registry[bugsnag,newrelic,cors]" # patch boto cd "$(python -c 'import boto; import os; print os.path.dirname(boto.__file__)')" \ && patch -i /docker-registry/contrib/boto_header_patch.diff connection.py # cleanup. indicate that python is a required package. apk del --no-cache \ build-base \ linux-headers \ python-dev
{ "pile_set_name": "Github" }
TIMESTAMP = 1569574235 SHA256 (git-cola-git-cola-v3.5_GH0.tar.gz) = 7fdcfc4326b35e384b97bd4bb2189b4cb5cf258948352759c302e632b41bb2e2 SIZE (git-cola-git-cola-v3.5_GH0.tar.gz) = 970155
{ "pile_set_name": "Github" }
// 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. // // Copyright (c) 2005-2010 Novell, Inc. (http://www.novell.com) // // Authors: // Peter Bartok ([email protected]) // // using System.Collections.Specialized; using System.ComponentModel; using System.Drawing; using System.Security.Permissions; namespace System.Web.UI.WebControls { // CAS [AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)] // attributes [ValidationProperty("SelectedItem")] [SupportsEventValidation] public class DropDownList : ListControl, IPostBackDataHandler { #region Public Constructors public DropDownList() { } #endregion // Public Constructors #region Public Instance Properties [Browsable(false)] public override Color BorderColor { get { return base.BorderColor; } set { base.BorderColor = value; } } [Browsable(false)] public override BorderStyle BorderStyle { get { return base.BorderStyle; } set { base.BorderStyle = value; } } [Browsable(false)] public override Unit BorderWidth { get { return base.BorderWidth; } set { base.BorderWidth = value; } } [DefaultValue(0)] [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] [WebSysDescription ("")] [WebCategory ("Misc")] public override int SelectedIndex { get { int selected; selected = base.SelectedIndex; if ((selected != -1) || (Items.Count == 0)) return selected; Items[0].Selected = true; return 0; } set { base.SelectedIndex = value; } } #if NET_4_0 public override bool SupportsDisabledAttribute { get { return RenderingCompatibilityLessThan40; } } #endif #endregion // Public Instance Properties #region Protected Instance Methods protected override void AddAttributesToRender(HtmlTextWriter writer) { Page page = Page; if (page != null) page.VerifyRenderingInServerForm (this); if (writer == null) return; if (!String.IsNullOrEmpty (UniqueID)) writer.AddAttribute (HtmlTextWriterAttribute.Name, this.UniqueID, true); if (!IsEnabled && SelectedIndex == -1) SelectedIndex = 1; if (AutoPostBack) { string onchange = page != null ? page.ClientScript.GetPostBackEventReference (GetPostBackOptions (), true) : String.Empty; onchange = String.Concat ("setTimeout('", onchange.Replace ("\\", "\\\\").Replace ("'", "\\'"), "', 0)"); writer.AddAttribute (HtmlTextWriterAttribute.Onchange, BuildScriptAttribute ("onchange", onchange)); } base.AddAttributesToRender(writer); } PostBackOptions GetPostBackOptions () { PostBackOptions options = new PostBackOptions (this); options.ActionUrl = null; options.ValidationGroup = null; options.Argument = String.Empty; options.RequiresJavaScriptProtocol = false; options.ClientSubmit = true; Page page = Page; options.PerformValidation = CausesValidation && page != null && page.AreValidatorsUplevel (ValidationGroup); if (options.PerformValidation) options.ValidationGroup = ValidationGroup; return options; } protected override ControlCollection CreateControlCollection () { return base.CreateControlCollection(); } protected internal override void VerifyMultiSelect () { throw new HttpException ("DropDownList only may have a single selected item"); } #endregion // Protected Instance Methods #region Interface Methods protected virtual bool LoadPostData (string postDataKey, NameValueCollection postCollection) { EnsureDataBound (); int index = Items.IndexOf(postCollection[postDataKey]); ValidateEvent (postDataKey, postCollection [postDataKey]); if (index != this.SelectedIndex) { SelectedIndex = index; return true; } return false; } protected virtual void RaisePostDataChangedEvent () { if (CausesValidation) { Page page = Page; if (page != null) page.Validate (ValidationGroup); } OnSelectedIndexChanged(EventArgs.Empty); } bool IPostBackDataHandler.LoadPostData (string postDataKey, NameValueCollection postCollection) { return LoadPostData (postDataKey, postCollection); } void IPostBackDataHandler.RaisePostDataChangedEvent () { RaisePostDataChangedEvent (); } #endregion // Interface Methods } }
{ "pile_set_name": "Github" }
// Copyright (c) 2006-2018 Maxim Khizhinsky // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef CDSSTRESS_PQUEUE_TYPES_H #define CDSSTRESS_PQUEUE_TYPES_H #include <cds/urcu/general_instant.h> #include <cds/urcu/general_buffered.h> #include <cds/urcu/general_threaded.h> #include <cds/urcu/signal_buffered.h> #include <cds/container/mspriority_queue.h> #include <cds/container/fcpriority_queue.h> #include <cds/container/ellen_bintree_set_hp.h> #include <cds/container/ellen_bintree_set_dhp.h> #include <cds/container/ellen_bintree_set_rcu.h> #include <cds/container/skip_list_set_hp.h> #include <cds/container/skip_list_set_dhp.h> #include <cds/container/skip_list_set_rcu.h> #include <cds/sync/spinlock.h> #include <queue> #include <vector> #include <deque> #include <mutex> //unique_lock #include <boost/container/stable_vector.hpp> #include <boost/container/deque.hpp> #include <cds_test/stress_test.h> #include <cds_test/stat_ellenbintree_out.h> #include <cds_test/stat_skiplist_out.h> #include <cds_test/stat_flat_combining_out.h> namespace pqueue { namespace cc = cds::container; namespace co = cds::opt; namespace details { template <typename T, typename Container, typename Lock, typename Less = std::less<typename Container::value_type> > class StdPQueue { public: typedef T value_type; typedef std::priority_queue<value_type, Container, Less> pqueue_type; private: pqueue_type m_PQueue; mutable Lock m_Lock; typedef std::unique_lock<Lock> scoped_lock; public: bool push( value_type const& val ) { scoped_lock l( m_Lock ); m_PQueue.push( val ); return true; } bool pop( value_type& dest ) { scoped_lock l( m_Lock ); if ( !m_PQueue.empty()) { dest = m_PQueue.top(); m_PQueue.pop(); return true; } return false; } template <typename Q, typename MoveFunc> bool pop_with( Q& dest, MoveFunc f ) { scoped_lock l( m_Lock ); if ( !m_PQueue.empty()) { f( dest, m_PQueue.top()); m_PQueue.pop(); return true; } return false; } void clear() { scoped_lock l( m_Lock ); while ( !m_PQueue.empty()) m_PQueue.pop(); } template <typename Func> void clear_with( Func f ) { scoped_lock l( m_Lock ); while ( !m_PQueue.empty()) { f( m_PQueue.top()); m_PQueue.pop(); } } bool empty() const { scoped_lock l( m_Lock ); return m_PQueue.empty(); } size_t size() const { scoped_lock l( m_Lock ); return m_PQueue.size(); } cds::opt::none statistics() const { return cds::opt::none(); } }; // EllenBinTree priority queue template <typename GC> struct EllenBinTreePQueue_pop_max { template <typename T, typename Tree> bool operator()( T& dest, Tree& container ) const { typename Tree::guarded_ptr gp( container.extract_max()); if ( gp ) dest = *gp; return !gp.empty(); } }; template <typename RCU> struct EllenBinTreePQueue_pop_max< cds::urcu::gc<RCU> > { template <typename T, typename Tree> bool operator()( T& dest, Tree& container ) const { typename Tree::exempt_ptr ep( container.extract_max()); if ( ep ) dest = *ep; return !ep.empty(); } }; template <typename GC> struct EllenBinTreePQueue_pop_min { template <typename T, typename Tree> bool operator()( T& dest, Tree& container ) const { typename Tree::guarded_ptr gp( container.extract_min()); if ( gp ) dest = *gp; return !gp.empty(); } }; template <typename RCU> struct EllenBinTreePQueue_pop_min< cds::urcu::gc<RCU> > { template <typename T, typename Tree> bool operator()( T& dest, Tree& container ) const { typename Tree::exempt_ptr ep( container.extract_min()); if ( ep ) dest = *ep; return !ep.empty(); } }; template <typename GC, typename Key, typename T, typename Traits, bool Max = true> class EllenBinTreePQueue : protected cds::container::EllenBinTreeSet< GC, Key, T, Traits > { typedef cds::container::EllenBinTreeSet< GC, Key, T, Traits > base_class; template <typename GC2> friend struct EllenBinTreePQueue_pop_max; template <typename GC2> friend struct EllenBinTreePQueue_pop_min; public: typedef T value_type; bool push( value_type const& val ) { return base_class::insert( val ); } bool pop( value_type& dest ) { return Max ? EllenBinTreePQueue_pop_max< typename base_class::gc >()(dest, *this) : EllenBinTreePQueue_pop_min< typename base_class::gc >()(dest, *this); } void clear() { base_class::clear(); } bool empty() const { return base_class::empty(); } size_t size() const { return base_class::size(); } typename base_class::stat const& statistics() const { return base_class::statistics(); } }; // SkipList property queue template <typename GC> struct SkipListPQueue_pop_max { template <typename T, typename Set> bool operator()( T& dest, Set& container ) const { typename Set::guarded_ptr gp( container.extract_max()); if ( gp ) dest = *gp; return !gp.empty(); } }; template <typename RCU> struct SkipListPQueue_pop_max< cds::urcu::gc<RCU> > { template <typename T, typename Set> bool operator()( T& dest, Set& container ) const { typename Set::exempt_ptr ep( container.extract_max()); if ( ep ) dest = *ep; return !ep.empty(); } }; template <typename GC> struct SkipListPQueue_pop_min { template <typename T, typename Set> bool operator()( T& dest, Set& container ) const { typename Set::guarded_ptr gp( container.extract_min()); if ( gp ) dest = *gp; return !gp.empty(); } }; template <typename RCU> struct SkipListPQueue_pop_min< cds::urcu::gc<RCU> > { template <typename T, typename Set> bool operator()( T& dest, Set& container ) const { typename Set::exempt_ptr ep( container.extract_min()); if ( ep ) dest = *ep; return !ep.empty(); } }; template <typename GC, typename T, typename Traits, bool Max = true> class SkipListPQueue : protected cds::container::SkipListSet< GC, T, Traits > { typedef cds::container::SkipListSet< GC, T, Traits > base_class; template <typename GC2> friend struct SkipListPQueue_pop_max; template <typename GC2> friend struct SkipListPQueue_pop_min; public: typedef T value_type; bool push( value_type const& val ) { return base_class::insert( val ); } bool pop( value_type& dest ) { return Max ? SkipListPQueue_pop_max< typename base_class::gc >()(dest, *this) : SkipListPQueue_pop_min< typename base_class::gc >()(dest, *this); } void clear() { base_class::clear(); } bool empty() const { return base_class::empty(); } size_t size() const { return base_class::size(); } typename base_class::stat const& statistics() const { return base_class::statistics(); } }; } // namespace details template <typename Value> struct Types { static size_t const c_nBoundedCapacity = 1024 * 1024 * 16; typedef std::less<Value> less; struct cmp { int operator()( Value const& v1, Value const& v2 ) const { return less()( v1, v2 ) ? -1 : less()( v2, v1 ) ? 1 : 0; } }; typedef cds::urcu::gc< cds::urcu::general_instant<> > rcu_gpi; typedef cds::urcu::gc< cds::urcu::general_buffered<> > rcu_gpb; typedef cds::urcu::gc< cds::urcu::general_threaded<> > rcu_gpt; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef cds::urcu::gc< cds::urcu::signal_buffered<> > rcu_shb; #endif // MSPriorityQueue struct traits_MSPriorityQueue_static_less : public cc::mspriority_queue::make_traits < co::buffer < co::v::initialized_static_buffer< char, c_nBoundedCapacity > > > ::type {}; typedef cc::MSPriorityQueue< Value, traits_MSPriorityQueue_static_less > MSPriorityQueue_static_less; struct traits_MSPriorityQueue_static_less_stat : public cc::mspriority_queue::traits { typedef co::v::initialized_static_buffer< char, c_nBoundedCapacity > buffer; typedef cc::mspriority_queue::stat<> stat; }; typedef cc::MSPriorityQueue< Value, traits_MSPriorityQueue_static_less_stat > MSPriorityQueue_static_less_stat; struct traits_MSPriorityQueue_static_cmp : public cc::mspriority_queue::make_traits < co::buffer< co::v::initialized_static_buffer< char, c_nBoundedCapacity > > , co::compare < cmp > > ::type {}; typedef cc::MSPriorityQueue< Value, traits_MSPriorityQueue_static_cmp > MSPriorityQueue_static_cmp; struct traits_MSPriorityQueue_static_mutex : public cc::mspriority_queue::make_traits< co::buffer< co::v::initialized_static_buffer< char, c_nBoundedCapacity > > , co::lock_type<std::mutex> >::type {}; typedef cc::MSPriorityQueue< Value, traits_MSPriorityQueue_static_mutex > MSPriorityQueue_static_mutex; struct traits_MSPriorityQueue_dyn: public cc::mspriority_queue::traits { typedef co::v::initialized_dynamic_buffer< char > buffer; }; typedef cc::MSPriorityQueue< Value, traits_MSPriorityQueue_dyn > MSPriorityQueue_dyn_less; struct traits_MSPriorityQueue_dyn_less_stat: public traits_MSPriorityQueue_dyn { typedef cc::mspriority_queue::stat<> stat; }; typedef cc::MSPriorityQueue< Value, traits_MSPriorityQueue_dyn_less_stat > MSPriorityQueue_dyn_less_stat; struct traits_MSPriorityQueue_dyn_cmp : public cc::mspriority_queue::make_traits < co::buffer< co::v::initialized_dynamic_buffer< char > > , co::compare < cmp > > ::type {}; typedef cc::MSPriorityQueue< Value, traits_MSPriorityQueue_dyn_cmp > MSPriorityQueue_dyn_cmp; struct traits_MSPriorityQueue_dyn_mutex : public cc::mspriority_queue::make_traits < co::buffer< co::v::initialized_dynamic_buffer< char > > , co::lock_type < std::mutex > > ::type {}; typedef cc::MSPriorityQueue< Value, traits_MSPriorityQueue_dyn_mutex > MSPriorityQueue_dyn_mutex; // Priority queue based on EllenBinTreeSet struct traits_EllenBinTree_max : public cc::ellen_bintree::make_set_traits< cc::ellen_bintree::key_extractor< typename Value::key_extractor > ,cc::opt::less< std::less<Value> > ,co::stat< cc::ellen_bintree::stat<> > >::type {}; typedef details::EllenBinTreePQueue< cds::gc::HP, typename Value::key_type, Value, traits_EllenBinTree_max > EllenBinTree_HP_max; typedef details::EllenBinTreePQueue< cds::gc::DHP, typename Value::key_type, Value, traits_EllenBinTree_max > EllenBinTree_DHP_max; typedef details::EllenBinTreePQueue< rcu_gpi, typename Value::key_type, Value, traits_EllenBinTree_max > EllenBinTree_RCU_gpi_max; typedef details::EllenBinTreePQueue< rcu_gpb, typename Value::key_type, Value, traits_EllenBinTree_max > EllenBinTree_RCU_gpb_max; typedef details::EllenBinTreePQueue< rcu_gpt, typename Value::key_type, Value, traits_EllenBinTree_max > EllenBinTree_RCU_gpt_max; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef details::EllenBinTreePQueue< rcu_shb, typename Value::key_type, Value, traits_EllenBinTree_max > EllenBinTree_RCU_shb_max; #endif struct traits_EllenBinTree_max_stat : public cc::ellen_bintree::make_set_traits< cc::ellen_bintree::key_extractor< typename Value::key_extractor > ,cc::opt::less< std::less<Value> > ,co::stat< cc::ellen_bintree::stat<> > >::type {}; typedef details::EllenBinTreePQueue< cds::gc::HP, typename Value::key_type, Value, traits_EllenBinTree_max_stat > EllenBinTree_HP_max_stat; typedef details::EllenBinTreePQueue< cds::gc::DHP, typename Value::key_type, Value, traits_EllenBinTree_max_stat > EllenBinTree_DHP_max_stat; typedef details::EllenBinTreePQueue< rcu_gpi, typename Value::key_type, Value, traits_EllenBinTree_max_stat > EllenBinTree_RCU_gpi_max_stat; typedef details::EllenBinTreePQueue< rcu_gpb, typename Value::key_type, Value, traits_EllenBinTree_max_stat > EllenBinTree_RCU_gpb_max_stat; typedef details::EllenBinTreePQueue< rcu_gpt, typename Value::key_type, Value, traits_EllenBinTree_max_stat > EllenBinTree_RCU_gpt_max_stat; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef details::EllenBinTreePQueue< rcu_shb, typename Value::key_type, Value, traits_EllenBinTree_max_stat > EllenBinTree_RCU_shb_max_stat; #endif struct traits_EllenBinTree_min : public cc::ellen_bintree::make_set_traits< cc::ellen_bintree::key_extractor< typename Value::key_extractor > ,cc::opt::less< std::greater<Value> > >::type {}; typedef details::EllenBinTreePQueue< cds::gc::HP, typename Value::key_type, Value, traits_EllenBinTree_min, false > EllenBinTree_HP_min; typedef details::EllenBinTreePQueue< cds::gc::DHP, typename Value::key_type, Value, traits_EllenBinTree_min, false > EllenBinTree_DHP_min; typedef details::EllenBinTreePQueue< rcu_gpi, typename Value::key_type, Value, traits_EllenBinTree_min, false > EllenBinTree_RCU_gpi_min; typedef details::EllenBinTreePQueue< rcu_gpb, typename Value::key_type, Value, traits_EllenBinTree_min, false > EllenBinTree_RCU_gpb_min; typedef details::EllenBinTreePQueue< rcu_gpt, typename Value::key_type, Value, traits_EllenBinTree_min, false > EllenBinTree_RCU_gpt_min; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef details::EllenBinTreePQueue< rcu_shb, typename Value::key_type, Value, traits_EllenBinTree_min, false > EllenBinTree_RCU_shb_min; #endif struct traits_EllenBinTree_min_stat : public cc::ellen_bintree::make_set_traits< cc::ellen_bintree::key_extractor< typename Value::key_extractor > ,cc::opt::less< std::greater<Value> > ,co::stat< cc::ellen_bintree::stat<> > >::type {}; typedef details::EllenBinTreePQueue< cds::gc::HP, typename Value::key_type, Value, traits_EllenBinTree_min_stat, false > EllenBinTree_HP_min_stat; typedef details::EllenBinTreePQueue< cds::gc::DHP, typename Value::key_type, Value, traits_EllenBinTree_min_stat, false > EllenBinTree_DHP_min_stat; typedef details::EllenBinTreePQueue< rcu_gpi, typename Value::key_type, Value, traits_EllenBinTree_min_stat, false > EllenBinTree_RCU_gpi_min_stat; typedef details::EllenBinTreePQueue< rcu_gpb, typename Value::key_type, Value, traits_EllenBinTree_min_stat, false > EllenBinTree_RCU_gpb_min_stat; typedef details::EllenBinTreePQueue< rcu_gpt, typename Value::key_type, Value, traits_EllenBinTree_min_stat, false > EllenBinTree_RCU_gpt_min_stat; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef details::EllenBinTreePQueue< rcu_shb, typename Value::key_type, Value, traits_EllenBinTree_min_stat, false > EllenBinTree_RCU_shb_min_stat; #endif // Priority queue based on SkipListSet struct traits_SkipList_max : public cc::skip_list::make_traits < cc::opt::less < std::less<Value> > > ::type {}; typedef details::SkipListPQueue< cds::gc::HP, Value, traits_SkipList_max > SkipList32_HP_max; typedef details::SkipListPQueue< cds::gc::DHP, Value, traits_SkipList_max > SkipList32_DHP_max; typedef details::SkipListPQueue< rcu_gpi, Value, traits_SkipList_max > SkipList32_RCU_gpi_max; typedef details::SkipListPQueue< rcu_gpb, Value, traits_SkipList_max > SkipList32_RCU_gpb_max; typedef details::SkipListPQueue< rcu_gpt, Value, traits_SkipList_max > SkipList32_RCU_gpt_max; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef details::SkipListPQueue< rcu_shb, Value, traits_SkipList_max > SkipList32_RCU_shb_max; #endif struct traits_SkipList24_max: public traits_SkipList_max { typedef cc::skip_list::turbo24 random_level_generator; }; typedef details::SkipListPQueue< cds::gc::HP, Value, traits_SkipList24_max > SkipList24_HP_max; typedef details::SkipListPQueue< cds::gc::DHP, Value, traits_SkipList24_max > SkipList24_DHP_max; typedef details::SkipListPQueue< rcu_gpi, Value, traits_SkipList24_max > SkipList24_RCU_gpi_max; typedef details::SkipListPQueue< rcu_gpb, Value, traits_SkipList24_max > SkipList24_RCU_gpb_max; typedef details::SkipListPQueue< rcu_gpt, Value, traits_SkipList24_max > SkipList24_RCU_gpt_max; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef details::SkipListPQueue< rcu_shb, Value, traits_SkipList24_max > SkipList24_RCU_shb_max; #endif struct traits_SkipList16_max: public traits_SkipList_max { typedef cc::skip_list::turbo16 random_level_generator; }; typedef details::SkipListPQueue< cds::gc::HP, Value, traits_SkipList16_max > SkipList16_HP_max; typedef details::SkipListPQueue< cds::gc::DHP, Value, traits_SkipList16_max > SkipList16_DHP_max; typedef details::SkipListPQueue< rcu_gpi, Value, traits_SkipList16_max > SkipList16_RCU_gpi_max; typedef details::SkipListPQueue< rcu_gpb, Value, traits_SkipList16_max > SkipList16_RCU_gpb_max; typedef details::SkipListPQueue< rcu_gpt, Value, traits_SkipList16_max > SkipList16_RCU_gpt_max; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef details::SkipListPQueue< rcu_shb, Value, traits_SkipList16_max > SkipList16_RCU_shb_max; #endif struct traits_SkipList_max_stat : public cc::skip_list::make_traits< cc::opt::less< std::less<Value> > ,co::stat< cc::skip_list::stat<> > >::type {}; typedef details::SkipListPQueue< cds::gc::HP, Value, traits_SkipList_max_stat > SkipList32_HP_max_stat; typedef details::SkipListPQueue< cds::gc::DHP, Value, traits_SkipList_max_stat > SkipList32_DHP_max_stat; typedef details::SkipListPQueue< rcu_gpi, Value, traits_SkipList_max_stat > SkipList32_RCU_gpi_max_stat; typedef details::SkipListPQueue< rcu_gpb, Value, traits_SkipList_max_stat > SkipList32_RCU_gpb_max_stat; typedef details::SkipListPQueue< rcu_gpt, Value, traits_SkipList_max_stat > SkipList32_RCU_gpt_max_stat; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef details::SkipListPQueue< rcu_shb, Value, traits_SkipList_max_stat > SkipList32_RCU_shb_max_stat; #endif struct traits_SkipList24_max_stat: public traits_SkipList_max_stat { typedef cc::skip_list::turbo24 random_level_generator; }; typedef details::SkipListPQueue< cds::gc::HP, Value, traits_SkipList24_max_stat > SkipList24_HP_max_stat; typedef details::SkipListPQueue< cds::gc::DHP, Value, traits_SkipList24_max_stat > SkipList24_DHP_max_stat; typedef details::SkipListPQueue< rcu_gpi, Value, traits_SkipList24_max_stat > SkipList24_RCU_gpi_max_stat; typedef details::SkipListPQueue< rcu_gpb, Value, traits_SkipList24_max_stat > SkipList24_RCU_gpb_max_stat; typedef details::SkipListPQueue< rcu_gpt, Value, traits_SkipList24_max_stat > SkipList24_RCU_gpt_max_stat; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef details::SkipListPQueue< rcu_shb, Value, traits_SkipList24_max_stat > SkipList24_RCU_shb_max_stat; #endif struct traits_SkipList16_max_stat: public traits_SkipList_max_stat { typedef cc::skip_list::turbo16 random_level_generator; }; typedef details::SkipListPQueue< cds::gc::HP, Value, traits_SkipList16_max_stat > SkipList16_HP_max_stat; typedef details::SkipListPQueue< cds::gc::DHP, Value, traits_SkipList16_max_stat > SkipList16_DHP_max_stat; typedef details::SkipListPQueue< rcu_gpi, Value, traits_SkipList16_max_stat > SkipList16_RCU_gpi_max_stat; typedef details::SkipListPQueue< rcu_gpb, Value, traits_SkipList16_max_stat > SkipList16_RCU_gpb_max_stat; typedef details::SkipListPQueue< rcu_gpt, Value, traits_SkipList16_max_stat > SkipList16_RCU_gpt_max_stat; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef details::SkipListPQueue< rcu_shb, Value, traits_SkipList16_max_stat > SkipList16_RCU_shb_max_stat; #endif struct traits_SkipList_min : public cc::skip_list::make_traits< cc::opt::less< std::greater<Value> > >::type {}; typedef details::SkipListPQueue< cds::gc::HP, Value, traits_SkipList_min, false > SkipList32_HP_min; typedef details::SkipListPQueue< cds::gc::DHP, Value, traits_SkipList_min, false > SkipList32_DHP_min; typedef details::SkipListPQueue< rcu_gpi, Value, traits_SkipList_min, false > SkipList32_RCU_gpi_min; typedef details::SkipListPQueue< rcu_gpb, Value, traits_SkipList_min, false > SkipList32_RCU_gpb_min; typedef details::SkipListPQueue< rcu_gpt, Value, traits_SkipList_min, false > SkipList32_RCU_gpt_min; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef details::SkipListPQueue< rcu_shb, Value, traits_SkipList_min, false > SkipList32_RCU_shb_min; #endif struct traits_SkipList24_min: public traits_SkipList_min { typedef cc::skip_list::turbo24 random_level_generator; }; typedef details::SkipListPQueue< cds::gc::HP, Value, traits_SkipList24_min > SkipList24_HP_min; typedef details::SkipListPQueue< cds::gc::DHP, Value, traits_SkipList24_min > SkipList24_DHP_min; typedef details::SkipListPQueue< rcu_gpi, Value, traits_SkipList24_min > SkipList24_RCU_gpi_min; typedef details::SkipListPQueue< rcu_gpb, Value, traits_SkipList24_min > SkipList24_RCU_gpb_min; typedef details::SkipListPQueue< rcu_gpt, Value, traits_SkipList24_min > SkipList24_RCU_gpt_min; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef details::SkipListPQueue< rcu_shb, Value, traits_SkipList24_min > SkipList24_RCU_shb_min; #endif struct traits_SkipList16_min: public traits_SkipList_min { typedef cc::skip_list::turbo16 random_level_generator; }; typedef details::SkipListPQueue< cds::gc::HP, Value, traits_SkipList16_min > SkipList16_HP_min; typedef details::SkipListPQueue< cds::gc::DHP, Value, traits_SkipList16_min > SkipList16_DHP_min; typedef details::SkipListPQueue< rcu_gpi, Value, traits_SkipList16_min > SkipList16_RCU_gpi_min; typedef details::SkipListPQueue< rcu_gpb, Value, traits_SkipList16_min > SkipList16_RCU_gpb_min; typedef details::SkipListPQueue< rcu_gpt, Value, traits_SkipList16_min > SkipList16_RCU_gpt_min; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef details::SkipListPQueue< rcu_shb, Value, traits_SkipList16_min > SkipList16_RCU_shb_min; #endif struct traits_SkipList_min_stat : public cc::skip_list::make_traits< cc::opt::less< std::greater<Value> > ,co::stat< cc::skip_list::stat<> > >::type {}; typedef details::SkipListPQueue< cds::gc::HP, Value, traits_SkipList_min_stat, false > SkipList32_HP_min_stat; typedef details::SkipListPQueue< cds::gc::DHP, Value, traits_SkipList_min_stat, false > SkipList32_DHP_min_stat; typedef details::SkipListPQueue< rcu_gpi, Value, traits_SkipList_min_stat, false > SkipList32_RCU_gpi_min_stat; typedef details::SkipListPQueue< rcu_gpb, Value, traits_SkipList_min_stat, false > SkipList32_RCU_gpb_min_stat; typedef details::SkipListPQueue< rcu_gpt, Value, traits_SkipList_min_stat, false > SkipList32_RCU_gpt_min_stat; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef details::SkipListPQueue< rcu_shb, Value, traits_SkipList_min_stat, false > SkipList32_RCU_shb_min_stat; #endif struct traits_SkipList24_min_stat: public traits_SkipList_min_stat { typedef cc::skip_list::turbo24 random_level_generator; }; typedef details::SkipListPQueue< cds::gc::HP, Value, traits_SkipList24_min_stat > SkipList24_HP_min_stat; typedef details::SkipListPQueue< cds::gc::DHP, Value, traits_SkipList24_min_stat > SkipList24_DHP_min_stat; typedef details::SkipListPQueue< rcu_gpi, Value, traits_SkipList24_min_stat > SkipList24_RCU_gpi_min_stat; typedef details::SkipListPQueue< rcu_gpb, Value, traits_SkipList24_min_stat > SkipList24_RCU_gpb_min_stat; typedef details::SkipListPQueue< rcu_gpt, Value, traits_SkipList24_min_stat > SkipList24_RCU_gpt_min_stat; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef details::SkipListPQueue< rcu_shb, Value, traits_SkipList24_min_stat > SkipList24_RCU_shb_min_stat; #endif struct traits_SkipList16_min_stat: public traits_SkipList_min_stat { typedef cc::skip_list::turbo16 random_level_generator; }; typedef details::SkipListPQueue< cds::gc::HP, Value, traits_SkipList16_min_stat > SkipList16_HP_min_stat; typedef details::SkipListPQueue< cds::gc::DHP, Value, traits_SkipList16_min_stat > SkipList16_DHP_min_stat; typedef details::SkipListPQueue< rcu_gpi, Value, traits_SkipList16_min_stat > SkipList16_RCU_gpi_min_stat; typedef details::SkipListPQueue< rcu_gpb, Value, traits_SkipList16_min_stat > SkipList16_RCU_gpb_min_stat; typedef details::SkipListPQueue< rcu_gpt, Value, traits_SkipList16_min_stat > SkipList16_RCU_gpt_min_stat; #ifdef CDS_URCU_SIGNAL_HANDLING_ENABLED typedef details::SkipListPQueue< rcu_shb, Value, traits_SkipList16_min_stat > SkipList16_RCU_shb_min_stat; #endif // FCPriorityQueue struct traits_FCPQueue_stat : public cds::container::fcpqueue::make_traits < cds::opt::stat < cds::container::fcpqueue::stat<> > > ::type {}; typedef cds::container::FCPriorityQueue< Value > FCPQueue_vector; typedef cds::container::FCPriorityQueue< Value ,std::priority_queue<Value> ,traits_FCPQueue_stat > FCPQueue_vector_stat; typedef cds::container::FCPriorityQueue< Value ,std::priority_queue<Value, std::deque<Value> > > FCPQueue_deque; typedef cds::container::FCPriorityQueue< Value ,std::priority_queue<Value, std::deque<Value> > ,traits_FCPQueue_stat > FCPQueue_deque_stat; typedef cds::container::FCPriorityQueue< Value ,std::priority_queue<Value, boost::container::deque<Value> > > FCPQueue_boost_deque; typedef cds::container::FCPriorityQueue< Value ,std::priority_queue<Value, boost::container::deque<Value> > ,traits_FCPQueue_stat > FCPQueue_boost_deque_stat; typedef cds::container::FCPriorityQueue< Value ,std::priority_queue<Value, boost::container::stable_vector<Value> > > FCPQueue_boost_stable_vector; typedef cds::container::FCPriorityQueue< Value ,std::priority_queue<Value, boost::container::stable_vector<Value> > ,traits_FCPQueue_stat > FCPQueue_boost_stable_vector_stat; /// Standard priority_queue typedef details::StdPQueue< Value, std::vector<Value>, cds::sync::spin> StdPQueue_vector_spin; typedef details::StdPQueue< Value, std::vector<Value>, std::mutex > StdPQueue_vector_mutex; typedef details::StdPQueue< Value, std::deque<Value>, cds::sync::spin> StdPQueue_deque_spin; typedef details::StdPQueue< Value, std::deque<Value>, std::mutex > StdPQueue_deque_mutex; }; } // namespace pqueue // ********************************************* // Priority queue statistics namespace cds_test { static inline property_stream& operator <<( property_stream& o, cds::opt::none ) { return o; } static inline property_stream& operator <<( property_stream& o, cds::container::fcpqueue::empty_stat const& ) { return o; } static inline property_stream& operator <<( property_stream& o, cds::container::fcpqueue::stat<> const& s ) { return o << CDSSTRESS_STAT_OUT( s, m_nPush ) << CDSSTRESS_STAT_OUT( s, m_nPushMove ) << CDSSTRESS_STAT_OUT( s, m_nPop ) << CDSSTRESS_STAT_OUT( s, m_nFailedPop ) << static_cast<cds::algo::flat_combining::stat<> const&>(s); } static inline property_stream& operator <<( property_stream& o, cds::container::mspriority_queue::empty_stat const& /*s*/ ) { return o; } static inline property_stream& operator <<( property_stream& o, cds::container::mspriority_queue::stat<> const& s ) { return o << CDSSTRESS_STAT_OUT( s, m_nPushCount ) << CDSSTRESS_STAT_OUT( s, m_nPopCount ) << CDSSTRESS_STAT_OUT( s, m_nPushFailCount ) << CDSSTRESS_STAT_OUT( s, m_nPopFailCount ) << CDSSTRESS_STAT_OUT( s, m_nPushHeapifySwapCount ) << CDSSTRESS_STAT_OUT( s, m_nPopHeapifySwapCount ) << CDSSTRESS_STAT_OUT( s, m_nItemMovedTop ) << CDSSTRESS_STAT_OUT( s, m_nItemMovedUp ) << CDSSTRESS_STAT_OUT( s, m_nPushEmptyPass ); } } // namespace cds_test #endif // #ifndef CDSSTRESS_PQUEUE_TYPES_H
{ "pile_set_name": "Github" }
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>providers vs. viewProviders</title> <base href="/"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="favicon.ico"> </head> <body> <app-root></app-root> </body> </html>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <package xmlns="http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd"> <metadata minClientVersion="2.8.1"> <id>Xam.Plugin.PushNotification</id> <version>1.0.3</version> <title>Push Notification Plugin for Xamarin</title> <authors>rdelrosario</authors> <owners>Rendy Del Rosario</owners> <licenseUrl>https://github.com/rdelrosario/xamarin-plugins/blob/master/LICENSE</licenseUrl> <projectUrl>https://github.com/rdelrosario/xamarin-plugins</projectUrl> <iconUrl>https://raw.githubusercontent.com/rdelrosario/xamarin-plugins/master/PushNotification/Resources/icon.png</iconUrl> <requireLicenseAcceptance>false</requireLicenseAcceptance> <developmentDependency>true</developmentDependency> <description>Handle Push Notifications. Across iOS and Android from a single API.</description> <summary>Cross Platform Push Notifications Support</summary> <releaseNotes>Fixed message category on Android. Is now associated to application package name.</releaseNotes> <tags>xamarin pcl xam.pcl push notification android ios</tags> <dependencies> <group targetFramework="MonoAndroid1.0"> <dependency id="Xamarin.GooglePlayServices" version="22.0.0.2" /> </group> </dependencies> </metadata> <files> <file src="content\MonoAndroid10\PushNotificationStarted.txt.pp" target="content\MonoAndroid10\PushNotificationStarted.txt.pp" /> <file src="content\MonoTouch10\PushNotificationApplicationDelegate.txt.pp" target="content\MonoTouch10\PushNotificationApplicationDelegate.txt.pp" /> <file src="content\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Helpers\CrossPushNotificationListener.txt.pp" target="content\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Helpers\CrossPushNotificationListener.txt.pp" /> <file src="content\Xamarin.iOS10\PushNotificationApplicationDelegate.txt.pp" target="content\Xamarin.iOS10\PushNotificationApplicationDelegate.txt.pp" /> <file src="PushNotification.Plugin.Android\bin\Release\PushNotification.Plugin.Abstractions.dll" target="lib\MonoAndroid10\PushNotification.Plugin.Abstractions.dll" /> <file src="PushNotification.Plugin.Android\bin\Release\PushNotification.Plugin.Abstractions.pdb" target="lib\MonoAndroid10\PushNotification.Plugin.Abstractions.pdb" /> <file src="PushNotification.Plugin.Android\bin\Release\PushNotification.Plugin.Abstractions.xml" target="lib\MonoAndroid10\PushNotification.Plugin.Abstractions.xml" /> <file src="PushNotification.Plugin.Android\bin\Release\PushNotification.Plugin.dll" target="lib\MonoAndroid10\PushNotification.Plugin.dll" /> <file src="PushNotification.Plugin.Android\bin\Release\PushNotification.Plugin.pdb" target="lib\MonoAndroid10\PushNotification.Plugin.pdb" /> <file src="PushNotification.Plugin.Android\bin\Release\PushNotification.Plugin.XML" target="lib\MonoAndroid10\PushNotification.Plugin.XML" /> <file src="PushNotification.Plugin.iOS\bin\iPhone\Release\PushNotification.Plugin.Abstractions.dll" target="lib\MonoTouch10\PushNotification.Plugin.Abstractions.dll" /> <file src="PushNotification.Plugin.iOS\bin\iPhone\Release\PushNotification.Plugin.Abstractions.pdb" target="lib\MonoTouch10\PushNotification.Plugin.Abstractions.pdb" /> <file src="PushNotification.Plugin.iOS\bin\iPhone\Release\PushNotification.Plugin.Abstractions.xml" target="lib\MonoTouch10\PushNotification.Plugin.Abstractions.xml" /> <file src="PushNotification.Plugin.iOS\bin\iPhone\Release\PushNotification.Plugin.dll" target="lib\MonoTouch10\PushNotification.Plugin.dll" /> <file src="PushNotification.Plugin.iOS\bin\iPhone\Release\PushNotification.Plugin.XML" target="lib\MonoTouch10\PushNotification.Plugin.XML" /> <file src="PushNotification.Plugin\bin\Release\PushNotification.Plugin.Abstractions.dll" target="lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\PushNotification.Plugin.Abstractions.dll" /> <file src="PushNotification.Plugin\bin\Release\PushNotification.Plugin.Abstractions.pdb" target="lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\PushNotification.Plugin.Abstractions.pdb" /> <file src="PushNotification.Plugin\bin\Release\PushNotification.Plugin.Abstractions.xml" target="lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\PushNotification.Plugin.Abstractions.xml" /> <file src="PushNotification.Plugin\bin\Release\PushNotification.Plugin.dll" target="lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\PushNotification.Plugin.dll" /> <file src="PushNotification.Plugin\bin\Release\PushNotification.Plugin.pdb" target="lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\PushNotification.Plugin.pdb" /> <file src="PushNotification.Plugin\bin\Release\PushNotification.Plugin.XML" target="lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\PushNotification.Plugin.XML" /> <file src="PushNotification.Plugin.iOSUnified\bin\iPhone\Release\PushNotification.Plugin.Abstractions.dll" target="lib\Xamarin.iOS10\PushNotification.Plugin.Abstractions.dll" /> <file src="PushNotification.Plugin.iOSUnified\bin\iPhone\Release\PushNotification.Plugin.Abstractions.pdb" target="lib\Xamarin.iOS10\PushNotification.Plugin.Abstractions.pdb" /> <file src="PushNotification.Plugin.iOSUnified\bin\iPhone\Release\PushNotification.Plugin.Abstractions.xml" target="lib\Xamarin.iOS10\PushNotification.Plugin.Abstractions.xml" /> <file src="PushNotification.Plugin.iOSUnified\bin\iPhone\Release\PushNotification.Plugin.dll" target="lib\Xamarin.iOS10\PushNotification.Plugin.dll" /> <file src="PushNotification.Plugin.iOSUnified\bin\iPhone\Release\PushNotification.Plugin.XML" target="lib\Xamarin.iOS10\PushNotification.Plugin.XML" /> </files> </package>
{ "pile_set_name": "Github" }
From 504dba5b073a9009ae1e3f2fc53ea9c3aa10c38a Mon Sep 17 00:00:00 2001 From: Felix Fietkau <[email protected]> Date: Wed, 13 May 2015 20:56:38 +0200 Subject: [PATCH] ARM: BCM5301X: Add Buffalo WXR-1900DHP clock and USB power control MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Felix Fietkau <[email protected]> Signed-off-by: Rafał Miłecki <[email protected]> --- arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) --- a/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts +++ b/arch/arm/boot/dts/bcm4709-buffalo-wxr-1900dhp.dts @@ -25,6 +25,23 @@ 0x88000000 0x18000000>; }; + clocks { + clk_periph: periph { + clock-frequency = <500000000>; + }; + }; + + axi@18000000 { + usb2@21000 { + reg = <0x00021000 0x1000>; + + #address-cells = <1>; + #size-cells = <1>; + + vcc-gpio = <&chipcommon 13 GPIO_ACTIVE_HIGH>; + }; + }; + leds { compatible = "gpio-leds";
{ "pile_set_name": "Github" }
// Copyright 2008 The Closure Library Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS-IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * @fileoverview Default renderer for {@link goog.ui.Tab}s. Based on the * original `TabPane` code. * * @author [email protected] (Attila Bodis) */ goog.provide('goog.ui.TabRenderer'); goog.require('goog.a11y.aria.Role'); goog.require('goog.ui.Component'); goog.require('goog.ui.ControlRenderer'); /** * Default renderer for {@link goog.ui.Tab}s, based on the `TabPane` code. * @constructor * @extends {goog.ui.ControlRenderer} */ goog.ui.TabRenderer = function() { goog.ui.ControlRenderer.call(this); }; goog.inherits(goog.ui.TabRenderer, goog.ui.ControlRenderer); goog.addSingletonGetter(goog.ui.TabRenderer); /** * Default CSS class to be applied to the root element of components rendered * by this renderer. * @type {string} */ goog.ui.TabRenderer.CSS_CLASS = goog.getCssName('goog-tab'); /** * Returns the CSS class name to be applied to the root element of all tabs * rendered or decorated using this renderer. * @return {string} Renderer-specific CSS class name. * @override */ goog.ui.TabRenderer.prototype.getCssClass = function() { return goog.ui.TabRenderer.CSS_CLASS; }; /** * Returns the ARIA role to be applied to the tab element. * See http://wiki/Main/ARIA for more info. * @return {goog.a11y.aria.Role} ARIA role. * @override */ goog.ui.TabRenderer.prototype.getAriaRole = function() { return goog.a11y.aria.Role.TAB; }; /** * Returns the tab's contents wrapped in a DIV, with the renderer's own CSS * class and additional state-specific classes applied to it. Creates the * following DOM structure: * * <div class="goog-tab" title="Title">Content</div> * * @param {goog.ui.Control} tab Tab to render. * @return {Element} Root element for the tab. * @override */ goog.ui.TabRenderer.prototype.createDom = function(tab) { var element = goog.ui.TabRenderer.superClass_.createDom.call(this, tab); var tooltip = tab.getTooltip(); if (tooltip) { // Only update the element if the tab has a tooltip. this.setTooltip(element, tooltip); } return element; }; /** * Decorates the element with the tab. Initializes the tab's ID, content, * tooltip, and state based on the ID of the element, its title, child nodes, * and CSS classes, respectively. Returns the element. * @param {goog.ui.Control} tab Tab to decorate the element. * @param {Element} element Element to decorate. * @return {Element} Decorated element. * @override */ goog.ui.TabRenderer.prototype.decorate = function(tab, element) { element = goog.ui.TabRenderer.superClass_.decorate.call(this, tab, element); var tooltip = this.getTooltip(element); if (tooltip) { // Only update the tab if the element has a tooltip. tab.setTooltipInternal(tooltip); } // If the tab is selected and hosted in a tab bar, update the tab bar's // selection model. if (tab.isSelected()) { var tabBar = tab.getParent(); if (tabBar && goog.isFunction(tabBar.setSelectedTab)) { // We need to temporarily deselect the tab, so the tab bar can re-select // it and thereby correctly initialize its state. We use the protected // setState() method to avoid dispatching useless events. tab.setState(goog.ui.Component.State.SELECTED, false); tabBar.setSelectedTab(tab); } } return element; }; /** * Takes a tab's root element, and returns its tooltip text, or the empty * string if the element has no tooltip. * @param {Element} element The tab's root element. * @return {string} The tooltip text (empty string if none). */ goog.ui.TabRenderer.prototype.getTooltip = function(element) { return element.title || ''; }; /** * Takes a tab's root element and a tooltip string, and updates the element * with the new tooltip. If the new tooltip is null or undefined, sets the * element's title to the empty string. * @param {Element} element The tab's root element. * @param {string|null|undefined} tooltip New tooltip text (if any). */ goog.ui.TabRenderer.prototype.setTooltip = function(element, tooltip) { if (element) { element.title = tooltip || ''; } };
{ "pile_set_name": "Github" }
// The MIT License (MIT) // // Copyright (c) 2015 Sergey Makeev, Vadim Slyusarev // // 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. #pragma once #ifndef __MT_EVENT__ #define __MT_EVENT__ #include <MTConfig.h> #if MT_ENABLE_LEGACY_WINDOWSXP_SUPPORT // Windows XP: Conditional variables are not supported. Using kernel mode events. #include "MTEventKernel.h" #else // Conditional variables are supported. Using user mode events. #include "MTEventUser.h" #endif #endif
{ "pile_set_name": "Github" }
<?php class ArgumentsCest { /** @var string */ private $outputFolder; /** @var string */ private $configFolder; public function _before() { @mkdir(codecept_output_dir() . 'arg'); $this->outputFolder = codecept_output_dir('arg'); $this->configFolder = codecept_data_dir('svg' . DIRECTORY_SEPARATOR . 'config'); } public function _after() { array_map('unlink', glob($this->outputFolder . DIRECTORY_SEPARATOR . '*.json')); rmdir(codecept_output_dir() . 'arg'); } /** * @param FunctionalTester $tester */ public function testInvokeArguments(FunctionalTester $tester) { $source = codecept_data_dir('Project' . DIRECTORY_SEPARATOR . 'PackageA' . DIRECTORY_SEPARATOR . 'Controller'); $target = $this->outputFolder . DIRECTORY_SEPARATOR . 'inheritance.json'; $cmd = $tester->getTool() . ' -q analyze ' . $this->configFolder . DIRECTORY_SEPARATOR . 'class.yml ' . '-m inheritance ' . '-s ' . $source . ' ' . '-p *.php ' . '-f "PhpDA\Writer\Strategy\Json" ' . '-t ' . $target; exec($cmd, $output, $return); $expected = [ "PackageA\\Controller\\AbstractController=>Zend\\Mvc\\Controller\\AbstractController", "PackageA\\Controller\\Command=>PackageA\\Controller\\AbstractController", "PackageA\\Controller\\Query=>PackageA\\Controller\\AbstractController", ]; $result = array_keys(json_decode(file_get_contents($target), true)['edges']); $tester->assertSame($expected, $result); $tester->assertSame(0, $return); } }
{ "pile_set_name": "Github" }
package(default_visibility = ["//visibility:public"]) load( "@io_bazel_rules_go//go:def.bzl", "go_library", "go_test", ) go_test( name = "go_default_test", srcs = ["rand_test.go"], importpath = "k8s.io/apimachinery/pkg/util/rand", library = ":go_default_library", ) go_library( name = "go_default_library", srcs = ["rand.go"], importpath = "k8s.io/apimachinery/pkg/util/rand", ) filegroup( name = "package-srcs", srcs = glob(["**"]), tags = ["automanaged"], visibility = ["//visibility:private"], ) filegroup( name = "all-srcs", srcs = [":package-srcs"], tags = ["automanaged"], )
{ "pile_set_name": "Github" }
/* * Broadcom BCM7xxx System Port Ethernet MAC driver * * Copyright (C) 2014 Broadcom Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef __BCM_SYSPORT_H #define __BCM_SYSPORT_H #include <linux/if_vlan.h> /* Receive/transmit descriptor format */ #define DESC_ADDR_HI_STATUS_LEN 0x00 #define DESC_ADDR_HI_SHIFT 0 #define DESC_ADDR_HI_MASK 0xff #define DESC_STATUS_SHIFT 8 #define DESC_STATUS_MASK 0x3ff #define DESC_LEN_SHIFT 18 #define DESC_LEN_MASK 0x7fff #define DESC_ADDR_LO 0x04 /* HW supports 40-bit addressing hence the */ #define DESC_SIZE (WORDS_PER_DESC * sizeof(u32)) /* Default RX buffer allocation size */ #define RX_BUF_LENGTH 2048 /* Body(1500) + EH_SIZE(14) + VLANTAG(4) + BRCMTAG(4) + FCS(4) = 1526. * 1536 is multiple of 256 bytes */ #define ENET_BRCM_TAG_LEN 4 #define ENET_PAD 10 #define UMAC_MAX_MTU_SIZE (ETH_DATA_LEN + ETH_HLEN + VLAN_HLEN + \ ENET_BRCM_TAG_LEN + ETH_FCS_LEN + ENET_PAD) /* Transmit status block */ struct bcm_tsb { u32 pcp_dei_vid; #define PCP_DEI_MASK 0xf #define VID_SHIFT 4 #define VID_MASK 0xfff u32 l4_ptr_dest_map; #define L4_CSUM_PTR_MASK 0x1ff #define L4_PTR_SHIFT 9 #define L4_PTR_MASK 0x1ff #define L4_UDP (1 << 18) #define L4_LENGTH_VALID (1 << 19) #define DEST_MAP_SHIFT 20 #define DEST_MAP_MASK 0x1ff }; /* Receive status block uses the same * definitions as the DMA descriptor */ struct bcm_rsb { u32 rx_status_len; u32 brcm_egress_tag; }; /* Common Receive/Transmit status bits */ #define DESC_L4_CSUM (1 << 7) #define DESC_SOP (1 << 8) #define DESC_EOP (1 << 9) /* Receive Status bits */ #define RX_STATUS_UCAST 0 #define RX_STATUS_BCAST 0x04 #define RX_STATUS_MCAST 0x08 #define RX_STATUS_L2_MCAST 0x0c #define RX_STATUS_ERR (1 << 4) #define RX_STATUS_OVFLOW (1 << 5) #define RX_STATUS_PARSE_FAIL (1 << 6) /* Transmit Status bits */ #define TX_STATUS_VLAN_NO_ACT 0x00 #define TX_STATUS_VLAN_PCP_TSB 0x01 #define TX_STATUS_VLAN_QUEUE 0x02 #define TX_STATUS_VLAN_VID_TSB 0x03 #define TX_STATUS_OWR_CRC (1 << 2) #define TX_STATUS_APP_CRC (1 << 3) #define TX_STATUS_BRCM_TAG_NO_ACT 0 #define TX_STATUS_BRCM_TAG_ZERO 0x10 #define TX_STATUS_BRCM_TAG_ONE_QUEUE 0x20 #define TX_STATUS_BRCM_TAG_ONE_TSB 0x30 #define TX_STATUS_SKIP_BYTES (1 << 6) /* Specific register definitions */ #define SYS_PORT_TOPCTRL_OFFSET 0 #define REV_CNTL 0x00 #define REV_MASK 0xffff #define RX_FLUSH_CNTL 0x04 #define RX_FLUSH (1 << 0) #define TX_FLUSH_CNTL 0x08 #define TX_FLUSH (1 << 0) #define MISC_CNTL 0x0c #define SYS_CLK_SEL (1 << 0) #define TDMA_EOP_SEL (1 << 1) /* Level-2 Interrupt controller offsets and defines */ #define SYS_PORT_INTRL2_0_OFFSET 0x200 #define SYS_PORT_INTRL2_1_OFFSET 0x240 #define INTRL2_CPU_STATUS 0x00 #define INTRL2_CPU_SET 0x04 #define INTRL2_CPU_CLEAR 0x08 #define INTRL2_CPU_MASK_STATUS 0x0c #define INTRL2_CPU_MASK_SET 0x10 #define INTRL2_CPU_MASK_CLEAR 0x14 /* Level-2 instance 0 interrupt bits */ #define INTRL2_0_GISB_ERR (1 << 0) #define INTRL2_0_RBUF_OVFLOW (1 << 1) #define INTRL2_0_TBUF_UNDFLOW (1 << 2) #define INTRL2_0_MPD (1 << 3) #define INTRL2_0_BRCM_MATCH_TAG (1 << 4) #define INTRL2_0_RDMA_MBDONE (1 << 5) #define INTRL2_0_OVER_MAX_THRESH (1 << 6) #define INTRL2_0_BELOW_HYST_THRESH (1 << 7) #define INTRL2_0_FREE_LIST_EMPTY (1 << 8) #define INTRL2_0_TX_RING_FULL (1 << 9) #define INTRL2_0_DESC_ALLOC_ERR (1 << 10) #define INTRL2_0_UNEXP_PKTSIZE_ACK (1 << 11) /* RXCHK offset and defines */ #define SYS_PORT_RXCHK_OFFSET 0x300 #define RXCHK_CONTROL 0x00 #define RXCHK_EN (1 << 0) #define RXCHK_SKIP_FCS (1 << 1) #define RXCHK_BAD_CSUM_DIS (1 << 2) #define RXCHK_BRCM_TAG_EN (1 << 3) #define RXCHK_BRCM_TAG_MATCH_SHIFT 4 #define RXCHK_BRCM_TAG_MATCH_MASK 0xff #define RXCHK_PARSE_TNL (1 << 12) #define RXCHK_VIOL_EN (1 << 13) #define RXCHK_VIOL_DIS (1 << 14) #define RXCHK_INCOM_PKT (1 << 15) #define RXCHK_V6_DUPEXT_EN (1 << 16) #define RXCHK_V6_DUPEXT_DIS (1 << 17) #define RXCHK_ETHERTYPE_DIS (1 << 18) #define RXCHK_L2_HDR_DIS (1 << 19) #define RXCHK_L3_HDR_DIS (1 << 20) #define RXCHK_MAC_RX_ERR_DIS (1 << 21) #define RXCHK_PARSE_AUTH (1 << 22) #define RXCHK_BRCM_TAG0 0x04 #define RXCHK_BRCM_TAG(i) ((i) * RXCHK_BRCM_TAG0) #define RXCHK_BRCM_TAG0_MASK 0x24 #define RXCHK_BRCM_TAG_MASK(i) ((i) * RXCHK_BRCM_TAG0_MASK) #define RXCHK_BRCM_TAG_MATCH_STATUS 0x44 #define RXCHK_ETHERTYPE 0x48 #define RXCHK_BAD_CSUM_CNTR 0x4C #define RXCHK_OTHER_DISC_CNTR 0x50 /* TXCHCK offsets and defines */ #define SYS_PORT_TXCHK_OFFSET 0x380 #define TXCHK_PKT_RDY_THRESH 0x00 /* Receive buffer offset and defines */ #define SYS_PORT_RBUF_OFFSET 0x400 #define RBUF_CONTROL 0x00 #define RBUF_RSB_EN (1 << 0) #define RBUF_4B_ALGN (1 << 1) #define RBUF_BRCM_TAG_STRIP (1 << 2) #define RBUF_BAD_PKT_DISC (1 << 3) #define RBUF_RESUME_THRESH_SHIFT 4 #define RBUF_RESUME_THRESH_MASK 0xff #define RBUF_OK_TO_SEND_SHIFT 12 #define RBUF_OK_TO_SEND_MASK 0xff #define RBUF_CRC_REPLACE (1 << 20) #define RBUF_OK_TO_SEND_MODE (1 << 21) #define RBUF_RSB_SWAP (1 << 22) #define RBUF_ACPI_EN (1 << 23) #define RBUF_PKT_RDY_THRESH 0x04 #define RBUF_STATUS 0x08 #define RBUF_WOL_MODE (1 << 0) #define RBUF_MPD (1 << 1) #define RBUF_ACPI (1 << 2) #define RBUF_OVFL_DISC_CNTR 0x0c #define RBUF_ERR_PKT_CNTR 0x10 /* Transmit buffer offset and defines */ #define SYS_PORT_TBUF_OFFSET 0x600 #define TBUF_CONTROL 0x00 #define TBUF_BP_EN (1 << 0) #define TBUF_MAX_PKT_THRESH_SHIFT 1 #define TBUF_MAX_PKT_THRESH_MASK 0x1f #define TBUF_FULL_THRESH_SHIFT 8 #define TBUF_FULL_THRESH_MASK 0x1f /* UniMAC offset and defines */ #define SYS_PORT_UMAC_OFFSET 0x800 #define UMAC_CMD 0x008 #define CMD_TX_EN (1 << 0) #define CMD_RX_EN (1 << 1) #define CMD_SPEED_SHIFT 2 #define CMD_SPEED_10 0 #define CMD_SPEED_100 1 #define CMD_SPEED_1000 2 #define CMD_SPEED_2500 3 #define CMD_SPEED_MASK 3 #define CMD_PROMISC (1 << 4) #define CMD_PAD_EN (1 << 5) #define CMD_CRC_FWD (1 << 6) #define CMD_PAUSE_FWD (1 << 7) #define CMD_RX_PAUSE_IGNORE (1 << 8) #define CMD_TX_ADDR_INS (1 << 9) #define CMD_HD_EN (1 << 10) #define CMD_SW_RESET (1 << 13) #define CMD_LCL_LOOP_EN (1 << 15) #define CMD_AUTO_CONFIG (1 << 22) #define CMD_CNTL_FRM_EN (1 << 23) #define CMD_NO_LEN_CHK (1 << 24) #define CMD_RMT_LOOP_EN (1 << 25) #define CMD_PRBL_EN (1 << 27) #define CMD_TX_PAUSE_IGNORE (1 << 28) #define CMD_TX_RX_EN (1 << 29) #define CMD_RUNT_FILTER_DIS (1 << 30) #define UMAC_MAC0 0x00c #define UMAC_MAC1 0x010 #define UMAC_MAX_FRAME_LEN 0x014 #define UMAC_TX_FLUSH 0x334 #define UMAC_MIB_START 0x400 /* There is a 0xC gap between the end of RX and beginning of TX stats and then * between the end of TX stats and the beginning of the RX RUNT */ #define UMAC_MIB_STAT_OFFSET 0xc #define UMAC_MIB_CTRL 0x580 #define MIB_RX_CNT_RST (1 << 0) #define MIB_RUNT_CNT_RST (1 << 1) #define MIB_TX_CNT_RST (1 << 2) #define UMAC_MPD_CTRL 0x620 #define MPD_EN (1 << 0) #define MSEQ_LEN_SHIFT 16 #define MSEQ_LEN_MASK 0xff #define PSW_EN (1 << 27) #define UMAC_PSW_MS 0x624 #define UMAC_PSW_LS 0x628 #define UMAC_MDF_CTRL 0x650 #define UMAC_MDF_ADDR 0x654 /* Receive DMA offset and defines */ #define SYS_PORT_RDMA_OFFSET 0x2000 #define RDMA_CONTROL 0x1000 #define RDMA_EN (1 << 0) #define RDMA_RING_CFG (1 << 1) #define RDMA_DISC_EN (1 << 2) #define RDMA_BUF_DATA_OFFSET_SHIFT 4 #define RDMA_BUF_DATA_OFFSET_MASK 0x3ff #define RDMA_STATUS 0x1004 #define RDMA_DISABLED (1 << 0) #define RDMA_DESC_RAM_INIT_BUSY (1 << 1) #define RDMA_BP_STATUS (1 << 2) #define RDMA_SCB_BURST_SIZE 0x1008 #define RDMA_RING_BUF_SIZE 0x100c #define RDMA_RING_SIZE_SHIFT 16 #define RDMA_WRITE_PTR_HI 0x1010 #define RDMA_WRITE_PTR_LO 0x1014 #define RDMA_PROD_INDEX 0x1018 #define RDMA_PROD_INDEX_MASK 0xffff #define RDMA_CONS_INDEX 0x101c #define RDMA_CONS_INDEX_MASK 0xffff #define RDMA_START_ADDR_HI 0x1020 #define RDMA_START_ADDR_LO 0x1024 #define RDMA_END_ADDR_HI 0x1028 #define RDMA_END_ADDR_LO 0x102c #define RDMA_MBDONE_INTR 0x1030 #define RDMA_INTR_THRESH_MASK 0xff #define RDMA_TIMEOUT_SHIFT 16 #define RDMA_TIMEOUT_MASK 0xffff #define RDMA_XON_XOFF_THRESH 0x1034 #define RDMA_XON_XOFF_THRESH_MASK 0xffff #define RDMA_XOFF_THRESH_SHIFT 16 #define RDMA_READ_PTR_HI 0x1038 #define RDMA_READ_PTR_LO 0x103c #define RDMA_OVERRIDE 0x1040 #define RDMA_LE_MODE (1 << 0) #define RDMA_REG_MODE (1 << 1) #define RDMA_TEST 0x1044 #define RDMA_TP_OUT_SEL (1 << 0) #define RDMA_MEM_SEL (1 << 1) #define RDMA_DEBUG 0x1048 /* Transmit DMA offset and defines */ #define TDMA_NUM_RINGS 32 /* rings = queues */ #define TDMA_PORT_SIZE DESC_SIZE /* two 32-bits words */ #define SYS_PORT_TDMA_OFFSET 0x4000 #define TDMA_WRITE_PORT_OFFSET 0x0000 #define TDMA_WRITE_PORT_HI(i) (TDMA_WRITE_PORT_OFFSET + \ (i) * TDMA_PORT_SIZE) #define TDMA_WRITE_PORT_LO(i) (TDMA_WRITE_PORT_OFFSET + \ sizeof(u32) + (i) * TDMA_PORT_SIZE) #define TDMA_READ_PORT_OFFSET (TDMA_WRITE_PORT_OFFSET + \ (TDMA_NUM_RINGS * TDMA_PORT_SIZE)) #define TDMA_READ_PORT_HI(i) (TDMA_READ_PORT_OFFSET + \ (i) * TDMA_PORT_SIZE) #define TDMA_READ_PORT_LO(i) (TDMA_READ_PORT_OFFSET + \ sizeof(u32) + (i) * TDMA_PORT_SIZE) #define TDMA_READ_PORT_CMD_OFFSET (TDMA_READ_PORT_OFFSET + \ (TDMA_NUM_RINGS * TDMA_PORT_SIZE)) #define TDMA_READ_PORT_CMD(i) (TDMA_READ_PORT_CMD_OFFSET + \ (i) * sizeof(u32)) #define TDMA_DESC_RING_00_BASE (TDMA_READ_PORT_CMD_OFFSET + \ (TDMA_NUM_RINGS * sizeof(u32))) /* Register offsets and defines relatives to a specific ring number */ #define RING_HEAD_TAIL_PTR 0x00 #define RING_HEAD_MASK 0x7ff #define RING_TAIL_SHIFT 11 #define RING_TAIL_MASK 0x7ff #define RING_FLUSH (1 << 24) #define RING_EN (1 << 25) #define RING_COUNT 0x04 #define RING_COUNT_MASK 0x7ff #define RING_BUFF_DONE_SHIFT 11 #define RING_BUFF_DONE_MASK 0x7ff #define RING_MAX_HYST 0x08 #define RING_MAX_THRESH_MASK 0x7ff #define RING_HYST_THRESH_SHIFT 11 #define RING_HYST_THRESH_MASK 0x7ff #define RING_INTR_CONTROL 0x0c #define RING_INTR_THRESH_MASK 0x7ff #define RING_EMPTY_INTR_EN (1 << 15) #define RING_TIMEOUT_SHIFT 16 #define RING_TIMEOUT_MASK 0xffff #define RING_PROD_CONS_INDEX 0x10 #define RING_PROD_INDEX_MASK 0xffff #define RING_CONS_INDEX_SHIFT 16 #define RING_CONS_INDEX_MASK 0xffff #define RING_MAPPING 0x14 #define RING_QID_MASK 0x3 #define RING_PORT_ID_SHIFT 3 #define RING_PORT_ID_MASK 0x7 #define RING_IGNORE_STATUS (1 << 6) #define RING_FAILOVER_EN (1 << 7) #define RING_CREDIT_SHIFT 8 #define RING_CREDIT_MASK 0xffff #define RING_PCP_DEI_VID 0x18 #define RING_VID_MASK 0x7ff #define RING_DEI (1 << 12) #define RING_PCP_SHIFT 13 #define RING_PCP_MASK 0x7 #define RING_PKT_SIZE_ADJ_SHIFT 16 #define RING_PKT_SIZE_ADJ_MASK 0xf #define TDMA_DESC_RING_SIZE 28 /* Defininition for a given TX ring base address */ #define TDMA_DESC_RING_BASE(i) (TDMA_DESC_RING_00_BASE + \ ((i) * TDMA_DESC_RING_SIZE)) /* Ring indexed register addreses */ #define TDMA_DESC_RING_HEAD_TAIL_PTR(i) (TDMA_DESC_RING_BASE(i) + \ RING_HEAD_TAIL_PTR) #define TDMA_DESC_RING_COUNT(i) (TDMA_DESC_RING_BASE(i) + \ RING_COUNT) #define TDMA_DESC_RING_MAX_HYST(i) (TDMA_DESC_RING_BASE(i) + \ RING_MAX_HYST) #define TDMA_DESC_RING_INTR_CONTROL(i) (TDMA_DESC_RING_BASE(i) + \ RING_INTR_CONTROL) #define TDMA_DESC_RING_PROD_CONS_INDEX(i) \ (TDMA_DESC_RING_BASE(i) + \ RING_PROD_CONS_INDEX) #define TDMA_DESC_RING_MAPPING(i) (TDMA_DESC_RING_BASE(i) + \ RING_MAPPING) #define TDMA_DESC_RING_PCP_DEI_VID(i) (TDMA_DESC_RING_BASE(i) + \ RING_PCP_DEI_VID) #define TDMA_CONTROL 0x600 #define TDMA_EN (1 << 0) #define TSB_EN (1 << 1) #define TSB_SWAP (1 << 2) #define ACB_ALGO (1 << 3) #define BUF_DATA_OFFSET_SHIFT 4 #define BUF_DATA_OFFSET_MASK 0x3ff #define VLAN_EN (1 << 14) #define SW_BRCM_TAG (1 << 15) #define WNC_KPT_SIZE_UPDATE (1 << 16) #define SYNC_PKT_SIZE (1 << 17) #define ACH_TXDONE_DELAY_SHIFT 18 #define ACH_TXDONE_DELAY_MASK 0xff #define TDMA_STATUS 0x604 #define TDMA_DISABLED (1 << 0) #define TDMA_LL_RAM_INIT_BUSY (1 << 1) #define TDMA_SCB_BURST_SIZE 0x608 #define TDMA_OVER_MAX_THRESH_STATUS 0x60c #define TDMA_OVER_HYST_THRESH_STATUS 0x610 #define TDMA_TPID 0x614 #define TDMA_FREE_LIST_HEAD_TAIL_PTR 0x618 #define TDMA_FREE_HEAD_MASK 0x7ff #define TDMA_FREE_TAIL_SHIFT 11 #define TDMA_FREE_TAIL_MASK 0x7ff #define TDMA_FREE_LIST_COUNT 0x61c #define TDMA_FREE_LIST_COUNT_MASK 0x7ff #define TDMA_TIER2_ARB_CTRL 0x620 #define TDMA_ARB_MODE_RR 0 #define TDMA_ARB_MODE_WEIGHT_RR 0x1 #define TDMA_ARB_MODE_STRICT 0x2 #define TDMA_ARB_MODE_DEFICIT_RR 0x3 #define TDMA_CREDIT_SHIFT 4 #define TDMA_CREDIT_MASK 0xffff #define TDMA_TIER1_ARB_0_CTRL 0x624 #define TDMA_ARB_EN (1 << 0) #define TDMA_TIER1_ARB_0_QUEUE_EN 0x628 #define TDMA_TIER1_ARB_1_CTRL 0x62c #define TDMA_TIER1_ARB_1_QUEUE_EN 0x630 #define TDMA_TIER1_ARB_2_CTRL 0x634 #define TDMA_TIER1_ARB_2_QUEUE_EN 0x638 #define TDMA_TIER1_ARB_3_CTRL 0x63c #define TDMA_TIER1_ARB_3_QUEUE_EN 0x640 #define TDMA_SCB_ENDIAN_OVERRIDE 0x644 #define TDMA_LE_MODE (1 << 0) #define TDMA_REG_MODE (1 << 1) #define TDMA_TEST 0x648 #define TDMA_TP_OUT_SEL (1 << 0) #define TDMA_MEM_TM (1 << 1) #define TDMA_DEBUG 0x64c /* Transmit/Receive descriptor */ struct dma_desc { u32 addr_status_len; u32 addr_lo; }; /* Number of Receive hardware descriptor words */ #define NUM_HW_RX_DESC_WORDS 1024 /* Real number of usable descriptors */ #define NUM_RX_DESC (NUM_HW_RX_DESC_WORDS / WORDS_PER_DESC) /* Internal linked-list RAM has up to 1536 entries */ #define NUM_TX_DESC 1536 #define WORDS_PER_DESC (sizeof(struct dma_desc) / sizeof(u32)) /* Rx/Tx common counter group.*/ struct bcm_sysport_pkt_counters { u32 cnt_64; /* RO Received/Transmited 64 bytes packet */ u32 cnt_127; /* RO Rx/Tx 127 bytes packet */ u32 cnt_255; /* RO Rx/Tx 65-255 bytes packet */ u32 cnt_511; /* RO Rx/Tx 256-511 bytes packet */ u32 cnt_1023; /* RO Rx/Tx 512-1023 bytes packet */ u32 cnt_1518; /* RO Rx/Tx 1024-1518 bytes packet */ u32 cnt_mgv; /* RO Rx/Tx 1519-1522 good VLAN packet */ u32 cnt_2047; /* RO Rx/Tx 1522-2047 bytes packet*/ u32 cnt_4095; /* RO Rx/Tx 2048-4095 bytes packet*/ u32 cnt_9216; /* RO Rx/Tx 4096-9216 bytes packet*/ }; /* RSV, Receive Status Vector */ struct bcm_sysport_rx_counters { struct bcm_sysport_pkt_counters pkt_cnt; u32 pkt; /* RO (0x428) Received pkt count*/ u32 bytes; /* RO Received byte count */ u32 mca; /* RO # of Received multicast pkt */ u32 bca; /* RO # of Receive broadcast pkt */ u32 fcs; /* RO # of Received FCS error */ u32 cf; /* RO # of Received control frame pkt*/ u32 pf; /* RO # of Received pause frame pkt */ u32 uo; /* RO # of unknown op code pkt */ u32 aln; /* RO # of alignment error count */ u32 flr; /* RO # of frame length out of range count */ u32 cde; /* RO # of code error pkt */ u32 fcr; /* RO # of carrier sense error pkt */ u32 ovr; /* RO # of oversize pkt*/ u32 jbr; /* RO # of jabber count */ u32 mtue; /* RO # of MTU error pkt*/ u32 pok; /* RO # of Received good pkt */ u32 uc; /* RO # of unicast pkt */ u32 ppp; /* RO # of PPP pkt */ u32 rcrc; /* RO (0x470),# of CRC match pkt */ }; /* TSV, Transmit Status Vector */ struct bcm_sysport_tx_counters { struct bcm_sysport_pkt_counters pkt_cnt; u32 pkts; /* RO (0x4a8) Transmited pkt */ u32 mca; /* RO # of xmited multicast pkt */ u32 bca; /* RO # of xmited broadcast pkt */ u32 pf; /* RO # of xmited pause frame count */ u32 cf; /* RO # of xmited control frame count */ u32 fcs; /* RO # of xmited FCS error count */ u32 ovr; /* RO # of xmited oversize pkt */ u32 drf; /* RO # of xmited deferral pkt */ u32 edf; /* RO # of xmited Excessive deferral pkt*/ u32 scl; /* RO # of xmited single collision pkt */ u32 mcl; /* RO # of xmited multiple collision pkt*/ u32 lcl; /* RO # of xmited late collision pkt */ u32 ecl; /* RO # of xmited excessive collision pkt*/ u32 frg; /* RO # of xmited fragments pkt*/ u32 ncl; /* RO # of xmited total collision count */ u32 jbr; /* RO # of xmited jabber count*/ u32 bytes; /* RO # of xmited byte count */ u32 pok; /* RO # of xmited good pkt */ u32 uc; /* RO (0x0x4f0)# of xmited unitcast pkt */ }; struct bcm_sysport_mib { struct bcm_sysport_rx_counters rx; struct bcm_sysport_tx_counters tx; u32 rx_runt_cnt; u32 rx_runt_fcs; u32 rx_runt_fcs_align; u32 rx_runt_bytes; u32 rxchk_bad_csum; u32 rxchk_other_pkt_disc; u32 rbuf_ovflow_cnt; u32 rbuf_err_cnt; u32 alloc_rx_buff_failed; u32 rx_dma_failed; u32 tx_dma_failed; }; /* HW maintains a large list of counters */ enum bcm_sysport_stat_type { BCM_SYSPORT_STAT_NETDEV = -1, BCM_SYSPORT_STAT_MIB_RX, BCM_SYSPORT_STAT_MIB_TX, BCM_SYSPORT_STAT_RUNT, BCM_SYSPORT_STAT_RXCHK, BCM_SYSPORT_STAT_RBUF, BCM_SYSPORT_STAT_SOFT, }; /* Macros to help define ethtool statistics */ #define STAT_NETDEV(m) { \ .stat_string = __stringify(m), \ .stat_sizeof = sizeof(((struct net_device_stats *)0)->m), \ .stat_offset = offsetof(struct net_device_stats, m), \ .type = BCM_SYSPORT_STAT_NETDEV, \ } #define STAT_MIB(str, m, _type) { \ .stat_string = str, \ .stat_sizeof = sizeof(((struct bcm_sysport_priv *)0)->m), \ .stat_offset = offsetof(struct bcm_sysport_priv, m), \ .type = _type, \ } #define STAT_MIB_RX(str, m) STAT_MIB(str, m, BCM_SYSPORT_STAT_MIB_RX) #define STAT_MIB_TX(str, m) STAT_MIB(str, m, BCM_SYSPORT_STAT_MIB_TX) #define STAT_RUNT(str, m) STAT_MIB(str, m, BCM_SYSPORT_STAT_RUNT) #define STAT_MIB_SOFT(str, m) STAT_MIB(str, m, BCM_SYSPORT_STAT_SOFT) #define STAT_RXCHK(str, m, ofs) { \ .stat_string = str, \ .stat_sizeof = sizeof(((struct bcm_sysport_priv *)0)->m), \ .stat_offset = offsetof(struct bcm_sysport_priv, m), \ .type = BCM_SYSPORT_STAT_RXCHK, \ .reg_offset = ofs, \ } #define STAT_RBUF(str, m, ofs) { \ .stat_string = str, \ .stat_sizeof = sizeof(((struct bcm_sysport_priv *)0)->m), \ .stat_offset = offsetof(struct bcm_sysport_priv, m), \ .type = BCM_SYSPORT_STAT_RBUF, \ .reg_offset = ofs, \ } struct bcm_sysport_stats { char stat_string[ETH_GSTRING_LEN]; int stat_sizeof; int stat_offset; enum bcm_sysport_stat_type type; /* reg offset from UMAC base for misc counters */ u16 reg_offset; }; /* Software house keeping helper structure */ struct bcm_sysport_cb { struct sk_buff *skb; /* SKB for RX packets */ void __iomem *bd_addr; /* Buffer descriptor PHYS addr */ DEFINE_DMA_UNMAP_ADDR(dma_addr); DEFINE_DMA_UNMAP_LEN(dma_len); }; /* Software view of the TX ring */ struct bcm_sysport_tx_ring { spinlock_t lock; /* Ring lock for tx reclaim/xmit */ struct napi_struct napi; /* NAPI per tx queue */ dma_addr_t desc_dma; /* DMA cookie */ unsigned int index; /* Ring index */ unsigned int size; /* Ring current size */ unsigned int alloc_size; /* Ring one-time allocated size */ unsigned int desc_count; /* Number of descriptors */ unsigned int curr_desc; /* Current descriptor */ unsigned int c_index; /* Last consumer index */ unsigned int p_index; /* Current producer index */ struct bcm_sysport_cb *cbs; /* Transmit control blocks */ struct dma_desc *desc_cpu; /* CPU view of the descriptor */ struct bcm_sysport_priv *priv; /* private context backpointer */ }; /* Driver private structure */ struct bcm_sysport_priv { void __iomem *base; u32 irq0_stat; u32 irq0_mask; u32 irq1_stat; u32 irq1_mask; struct napi_struct napi ____cacheline_aligned; struct net_device *netdev; struct platform_device *pdev; int irq0; int irq1; int wol_irq; /* Transmit rings */ struct bcm_sysport_tx_ring tx_rings[TDMA_NUM_RINGS]; /* Receive queue */ void __iomem *rx_bds; void __iomem *rx_bd_assign_ptr; unsigned int rx_bd_assign_index; struct bcm_sysport_cb *rx_cbs; unsigned int num_rx_bds; unsigned int rx_read_ptr; unsigned int rx_c_index; /* PHY device */ struct device_node *phy_dn; struct phy_device *phydev; phy_interface_t phy_interface; int old_pause; int old_link; int old_duplex; /* Misc fields */ unsigned int rx_chk_en:1; unsigned int tsb_en:1; unsigned int crc_fwd:1; u16 rev; u32 wolopts; unsigned int wol_irq_disabled:1; /* MIB related fields */ struct bcm_sysport_mib mib; /* Ethtool */ u32 msg_enable; }; #endif /* __BCM_SYSPORT_H */
{ "pile_set_name": "Github" }
import RLTable from "./renderless/RLTable"; import VtTableHead from "./VtTableHead"; import VtTableBody from "./VtTableBody"; export default { name: 'VtTable', components: {RLTable, VtTableHead, VtTableBody}, render() { return <r-l-table scopedSlots={ { default: function (props) { var caption = props.caption ? <caption>{props.caption}</caption> : ''; return props.override ? h(props.override, {attrs: {props}}) : <table class={props.tableAttrs.class} summary={props.tableAttrs.summary} > {caption} <vt-table-head/> {props.slots.beforeBody} <vt-table-body ref="vt_table_body"/> {props.slots.afterBody} </table> } } } > </r-l-table> } }
{ "pile_set_name": "Github" }
plugin_register functions/string [[0,0.0,0.0],true] table_create Lexicon TABLE_PAT_KEY ShortText --normalizer NormalizerNFKC121 --default_tokenizer TokenNgram [[0,0.0,0.0],true] table_tokenize Lexicon "ぐるんが" --mode ADD [ [ 0, 0.0, 0.0 ], [ { "value": "ぐる", "position": 0, "force_prefix": false, "force_prefix_search": false }, { "value": "るん", "position": 1, "force_prefix": false, "force_prefix_search": false }, { "value": "んが", "position": 2, "force_prefix": false, "force_prefix_search": false }, { "value": "が", "position": 3, "force_prefix": false, "force_prefix_search": false } ] ] table_create Memos TABLE_HASH_KEY ShortText [[0,0.0,0.0],true] load --table Memos [ {"_key": "ぐるんが"} ] [[0,0.0,0.0],1] select Memos --output_columns '_key, string_tokenize(_key, Lexicon, {"flags": "NONE"})' [ [ 0, 0.0, 0.0 ], [ [ [ 1 ], [ [ "_key", "ShortText" ], [ "string_tokenize", null ] ], [ "ぐるんが", [ "ぐる", "るん", "んが" ] ] ] ] ]
{ "pile_set_name": "Github" }
# Analysis This directory contains the code used for the VAE and mutual information experiments from the paper.
{ "pile_set_name": "Github" }
#ifndef QEMU_HW_LM32_PIC_H #define QEMU_HW_LM32_PIC_H #include "qemu-common.h" uint32_t lm32_pic_get_ip(DeviceState *d); uint32_t lm32_pic_get_im(DeviceState *d); void lm32_pic_set_ip(DeviceState *d, uint32_t ip); void lm32_pic_set_im(DeviceState *d, uint32_t im); void lm32_do_pic_info(Monitor *mon, const QDict *qdict); void lm32_irq_info(Monitor *mon, const QDict *qdict); #endif /* QEMU_HW_LM32_PIC_H */
{ "pile_set_name": "Github" }
/* * USB LED driver - 1.1 * * Copyright (C) 2004 Greg Kroah-Hartman ([email protected]) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, version 2. * */ #include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/usb.h> #define DRIVER_AUTHOR "Greg Kroah-Hartman, [email protected]" #define DRIVER_DESC "USB LED Driver" #define VENDOR_ID 0x0fc5 #define PRODUCT_ID 0x1223 /* table of devices that work with this driver */ static const struct usb_device_id id_table[] = { { USB_DEVICE(VENDOR_ID, PRODUCT_ID) }, { }, }; MODULE_DEVICE_TABLE (usb, id_table); struct usb_led { struct usb_device * udev; unsigned char blue; unsigned char red; unsigned char green; }; #define BLUE 0x04 #define RED 0x02 #define GREEN 0x01 static void change_color(struct usb_led *led) { int retval; unsigned char color = 0x07; unsigned char *buffer; buffer = kmalloc(8, GFP_KERNEL); if (!buffer) { dev_err(&led->udev->dev, "out of memory\n"); return; } if (led->blue) color &= ~(BLUE); if (led->red) color &= ~(RED); if (led->green) color &= ~(GREEN); dev_dbg(&led->udev->dev, "blue = %d, red = %d, green = %d, color = %.2x\n", led->blue, led->red, led->green, color); retval = usb_control_msg(led->udev, usb_sndctrlpipe(led->udev, 0), 0x12, 0xc8, (0x02 * 0x100) + 0x0a, (0x00 * 0x100) + color, buffer, 8, 2000); if (retval) dev_dbg(&led->udev->dev, "retval = %d\n", retval); kfree(buffer); } #define show_set(value) \ static ssize_t show_##value(struct device *dev, struct device_attribute *attr, char *buf) \ { \ struct usb_interface *intf = to_usb_interface(dev); \ struct usb_led *led = usb_get_intfdata(intf); \ \ return sprintf(buf, "%d\n", led->value); \ } \ static ssize_t set_##value(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) \ { \ struct usb_interface *intf = to_usb_interface(dev); \ struct usb_led *led = usb_get_intfdata(intf); \ int temp = simple_strtoul(buf, NULL, 10); \ \ led->value = temp; \ change_color(led); \ return count; \ } \ static DEVICE_ATTR(value, S_IRUGO | S_IWUSR, show_##value, set_##value); show_set(blue); show_set(red); show_set(green); static int led_probe(struct usb_interface *interface, const struct usb_device_id *id) { struct usb_device *udev = interface_to_usbdev(interface); struct usb_led *dev = NULL; int retval = -ENOMEM; dev = kzalloc(sizeof(struct usb_led), GFP_KERNEL); if (dev == NULL) { dev_err(&interface->dev, "Out of memory\n"); goto error_mem; } dev->udev = usb_get_dev(udev); usb_set_intfdata (interface, dev); retval = device_create_file(&interface->dev, &dev_attr_blue); if (retval) goto error; retval = device_create_file(&interface->dev, &dev_attr_red); if (retval) goto error; retval = device_create_file(&interface->dev, &dev_attr_green); if (retval) goto error; dev_info(&interface->dev, "USB LED device now attached\n"); return 0; error: device_remove_file(&interface->dev, &dev_attr_blue); device_remove_file(&interface->dev, &dev_attr_red); device_remove_file(&interface->dev, &dev_attr_green); usb_set_intfdata (interface, NULL); usb_put_dev(dev->udev); kfree(dev); error_mem: return retval; } static void led_disconnect(struct usb_interface *interface) { struct usb_led *dev; dev = usb_get_intfdata (interface); device_remove_file(&interface->dev, &dev_attr_blue); device_remove_file(&interface->dev, &dev_attr_red); device_remove_file(&interface->dev, &dev_attr_green); /* first remove the files, then set the pointer to NULL */ usb_set_intfdata (interface, NULL); usb_put_dev(dev->udev); kfree(dev); dev_info(&interface->dev, "USB LED now disconnected\n"); } static struct usb_driver led_driver = { .name = "usbled", .probe = led_probe, .disconnect = led_disconnect, .id_table = id_table, }; static int __init usb_led_init(void) { int retval = 0; retval = usb_register(&led_driver); if (retval) err("usb_register failed. Error number %d", retval); return retval; } static void __exit usb_led_exit(void) { usb_deregister(&led_driver); } module_init (usb_led_init); module_exit (usb_led_exit); MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL");
{ "pile_set_name": "Github" }
// Copyright 2012 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_BASE_WIN32_HEADERS_H_ #define V8_BASE_WIN32_HEADERS_H_ #ifndef WIN32_LEAN_AND_MEAN // WIN32_LEAN_AND_MEAN implies NOCRYPT and NOGDI. #define WIN32_LEAN_AND_MEAN #endif #ifndef NOMINMAX #define NOMINMAX #endif #ifndef NOKERNEL #define NOKERNEL #endif #ifndef NOUSER #define NOUSER #endif #ifndef NOSERVICE #define NOSERVICE #endif #ifndef NOSOUND #define NOSOUND #endif #ifndef NOMCX #define NOMCX #endif // Require Windows Vista or higher (this is required for the // QueryThreadCycleTime function to be present). #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0600 #endif #include <windows.h> #include <mmsystem.h> // For timeGetTime(). #include <signal.h> // For raise(). #include <time.h> // For LocalOffset() implementation. #ifdef __MINGW32__ // Require Windows XP or higher when compiling with MinGW. This is for MinGW // header files to expose getaddrinfo. #undef _WIN32_WINNT #define _WIN32_WINNT 0x501 #endif // __MINGW32__ #if !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR) #include <dbghelp.h> // For SymLoadModule64 and al. #include <errno.h> // For STRUNCATE #endif // !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR) #include <limits.h> // For INT_MAX and al. #include <tlhelp32.h> // For Module32First and al. // These additional WIN32 includes have to be right here as the #undef's below // makes it impossible to have them elsewhere. #include <winsock2.h> #include <ws2tcpip.h> #ifndef __MINGW32__ #include <wspiapi.h> #endif // __MINGW32__ #include <process.h> // For _beginthreadex(). #include <stdlib.h> #undef VOID #undef DELETE #undef IN #undef THIS #undef CONST #undef NAN #undef UNKNOWN #undef NONE #undef ANY #undef IGNORE #undef STRICT #undef GetObject #undef CreateSemaphore #undef Yield #undef RotateRight32 #undef RotateLeft32 #undef RotateRight64 #undef RotateLeft64 #endif // V8_BASE_WIN32_HEADERS_H_
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <packages> <package id="Microsoft.Extensions.Logging.Abstractions" version="3.1.1" targetFramework="net472" /> <package id="Prism.Core" version="7.0.0.396" targetFramework="net472" /> <package id="System.Reactive" version="4.3.2" targetFramework="net472" /> <package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net472" /> <package id="System.Threading.Tasks.Extensions" version="4.5.3" targetFramework="net472" /> <package id="System.ValueTuple" version="4.5.0" targetFramework="net472" /> </packages>
{ "pile_set_name": "Github" }
CONFIG_EXPERIMENTAL=y # CONFIG_SWAP is not set CONFIG_SYSVIPC=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_BLK_DEV_INITRD=y CONFIG_EMBEDDED=y CONFIG_SLAB=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y # CONFIG_IOSCHED_DEADLINE is not set # CONFIG_IOSCHED_CFQ is not set CONFIG_ARCH_AT91=y CONFIG_MACH_ONEARM=y CONFIG_AT91_PROGRAMMABLE_CLOCKS=y # CONFIG_ARM_THUMB is not set CONFIG_PCCARD=y CONFIG_AT91_CF=y CONFIG_LEDS=y CONFIG_ZBOOT_ROM_TEXT=0x0 CONFIG_ZBOOT_ROM_BSS=0x0 CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs ip=bootp mem=64M" CONFIG_FPE_NWFPE=y CONFIG_NET=y CONFIG_PACKET=y CONFIG_UNIX=y CONFIG_INET=y CONFIG_IP_PNP=y CONFIG_IP_PNP_BOOTP=y CONFIG_IPV6=y # CONFIG_INET6_XFRM_MODE_TRANSPORT is not set # CONFIG_INET6_XFRM_MODE_TUNNEL is not set # CONFIG_INET6_XFRM_MODE_BEET is not set # CONFIG_IPV6_SIT is not set CONFIG_MTD=y CONFIG_MTD_PARTITIONS=y CONFIG_MTD_CMDLINE_PARTS=y CONFIG_MTD_CHAR=y CONFIG_MTD_BLOCK=y CONFIG_MTD_CFI=y CONFIG_MTD_JEDECPROBE=y CONFIG_MTD_CFI_AMDSTD=y CONFIG_MTD_PHYSMAP=y CONFIG_BLK_DEV_NBD=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=8192 CONFIG_NETDEVICES=y CONFIG_NET_ETHERNET=y CONFIG_ARM_AT91_ETHER=y # CONFIG_INPUT_MOUSEDEV_PSAUX is not set # CONFIG_INPUT_KEYBOARD is not set # CONFIG_INPUT_MOUSE is not set # CONFIG_SERIO is not set # CONFIG_VT is not set CONFIG_SERIAL_ATMEL=y CONFIG_SERIAL_ATMEL_CONSOLE=y # CONFIG_HW_RANDOM is not set CONFIG_I2C=y CONFIG_I2C_CHARDEV=y CONFIG_WATCHDOG=y CONFIG_WATCHDOG_NOWAYOUT=y CONFIG_AT91RM9200_WATCHDOG=y # CONFIG_USB_HID is not set CONFIG_USB=y CONFIG_USB_DEBUG=y CONFIG_USB_DEVICEFS=y CONFIG_USB_MON=y CONFIG_USB_OHCI_HCD=y CONFIG_USB_GADGET=y CONFIG_MMC=y CONFIG_EXT2_FS=y CONFIG_INOTIFY=y CONFIG_TMPFS=y CONFIG_CRAMFS=y CONFIG_NFS_FS=y CONFIG_NFS_V3=y CONFIG_NFS_V3_ACL=y CONFIG_ROOT_NFS=y CONFIG_DEBUG_KERNEL=y CONFIG_DEBUG_USER=y CONFIG_DEBUG_LL=y
{ "pile_set_name": "Github" }
// Code generated by linux/mkall.go generatePtracePair("mipsle", "mips64le"). DO NOT EDIT. // +build linux // +build mipsle mips64le package unix import "unsafe" // PtraceRegsMipsle is the registers used by mipsle binaries. type PtraceRegsMipsle struct { Regs [32]uint64 Lo uint64 Hi uint64 Epc uint64 Badvaddr uint64 Status uint64 Cause uint64 } // PtraceGetRegsMipsle fetches the registers used by mipsle binaries. func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error { return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) } // PtraceSetRegsMipsle sets the registers used by mipsle binaries. func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error { return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) } // PtraceRegsMips64le is the registers used by mips64le binaries. type PtraceRegsMips64le struct { Regs [32]uint64 Lo uint64 Hi uint64 Epc uint64 Badvaddr uint64 Status uint64 Cause uint64 } // PtraceGetRegsMips64le fetches the registers used by mips64le binaries. func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error { return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) } // PtraceSetRegsMips64le sets the registers used by mips64le binaries. func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error { return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) }
{ "pile_set_name": "Github" }
b629ac9e1167d13c8010f23427022cb94b5be0baaacbe216b3145d9fd7f67af3b8f817a7c58a67cdc30101c83bf82b9a3369df61e98fdf373035d17e38991b77
{ "pile_set_name": "Github" }
daemonset: extraEnvs: - name: 'ELASTICSEARCH_USERNAME' valueFrom: secretKeyRef: name: elastic-credentials key: username - name: 'ELASTICSEARCH_PASSWORD' valueFrom: secretKeyRef: name: elastic-credentials key: password # Allows you to add any config files in /usr/share/metricbeat # such as metricbeat.yml for daemonset metricbeatConfig: metricbeat.yml: | metricbeat.modules: - module: kubernetes metricsets: - container - node - pod - system - volume period: 10s host: "${NODE_NAME}" hosts: ["https://${NODE_NAME}:10250"] bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token ssl.verification_mode: "none" # If using Red Hat OpenShift remove ssl.verification_mode entry and # uncomment these settings: #ssl.certificate_authorities: #- /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt processors: - add_kubernetes_metadata: ~ - module: kubernetes enabled: true metricsets: - event - module: system period: 10s metricsets: - cpu - load - memory - network - process - process_summary processes: ['.*'] process.include_top_n: by_cpu: 5 by_memory: 5 - module: system period: 1m metricsets: - filesystem - fsstat processors: - drop_event.when.regexp: system.filesystem.mount_point: '^/(sys|cgroup|proc|dev|etc|host|lib)($|/)' output.elasticsearch: username: '${ELASTICSEARCH_USERNAME}' password: '${ELASTICSEARCH_PASSWORD}' protocol: https hosts: ["security-master:9200"] ssl.certificate_authorities: - /usr/share/metricbeat/config/certs/elastic-certificate.pem secretMounts: - name: elastic-certificate-pem secretName: elastic-certificate-pem path: /usr/share/metricbeat/config/certs deployment: extraEnvs: - name: 'ELASTICSEARCH_USERNAME' valueFrom: secretKeyRef: name: elastic-credentials key: username - name: 'ELASTICSEARCH_PASSWORD' valueFrom: secretKeyRef: name: elastic-credentials key: password # Allows you to add any config files in /usr/share/metricbeat # such as metricbeat.yml for deployment metricbeatConfig: metricbeat.yml: | metricbeat.modules: - module: kubernetes enabled: true metricsets: - state_node - state_deployment - state_replicaset - state_pod - state_container period: 10s hosts: ["${KUBE_STATE_METRICS_HOSTS}"] output.elasticsearch: username: '${ELASTICSEARCH_USERNAME}' password: '${ELASTICSEARCH_PASSWORD}' protocol: https hosts: ["security-master:9200"] ssl.certificate_authorities: - /usr/share/metricbeat/config/certs/elastic-certificate.pem secretMounts: - name: elastic-certificate-pem secretName: elastic-certificate-pem path: /usr/share/metricbeat/config/certs
{ "pile_set_name": "Github" }
# Add project specific ProGuard rules here. # By default, the flags in this file are appended to flags specified # in D:\Android\sdk/tools/proguard/proguard-android.txt # You can edit the include path and order by changing the proguardFiles # directive in build.gradle. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html # Add any project specific keep options here: # If your project uses WebView with JS, uncomment the following # and specify the fully qualified class name to the JavaScript interface # class: #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #}
{ "pile_set_name": "Github" }
diff -u -r ../emacs-26.2/lisp/textmodes/ispell.el ./lisp/textmodes/ispell.el --- ../emacs-26.2/lisp/textmodes/ispell.el 2019-02-20 13:44:42.000000000 +0000 +++ ./lisp/textmodes/ispell.el 2019-04-14 18:15:07.894909566 +0000 @@ -215,14 +215,14 @@ :group 'ispell) (defcustom ispell-alternate-dictionary - (cond ((file-readable-p "/usr/dict/web2") "/usr/dict/web2") - ((file-readable-p "/usr/share/dict/web2") "/usr/share/dict/web2") - ((file-readable-p "/usr/dict/words") "/usr/dict/words") - ((file-readable-p "/usr/lib/dict/words") "/usr/lib/dict/words") - ((file-readable-p "/usr/share/dict/words") "/usr/share/dict/words") - ((file-readable-p "/usr/share/lib/dict/words") - "/usr/share/lib/dict/words") - ((file-readable-p "/sys/dict") "/sys/dict")) + (cond ((file-readable-p "@TERMUX_PREFIX@/dict/web2") "/usr/dict/web2") + ((file-readable-p "@TERMUX_PREFIX@/share/dict/web2") "/usr/share/dict/web2") + ((file-readable-p "@TERMUX_PREFIX@/dict/words") "/usr/dict/words") + ((file-readable-p "@TERMUX_PREFIX@/lib/dict/words") "/usr/lib/dict/words") + ((file-readable-p "@TERMUX_PREFIX@/share/dict/words") "/usr/share/dict/words") + ((file-readable-p "@TERMUX_PREFIX@/share/lib/dict/words") + "@TERMUX_PREFIX@/share/lib/dict/words") + ((file-readable-p "@TERMUX_PREFIX@/sys/dict") "@TERMUX_PREFIX@/sys/dict")) "Alternate plain word-list dictionary for spelling help." :type '(choice file (const :tag "None" nil)) :group 'ispell) @@ -266,9 +266,7 @@ :group 'ispell) (defcustom ispell-look-command - (cond ((file-exists-p "/bin/look") "/bin/look") - ((file-exists-p "/usr/local/bin/look") "/usr/local/bin/look") - ((file-exists-p "/usr/bin/look") "/usr/bin/look") + (cond ((file-exists-p "@TERMUX_PREFIX@/bin/look") "@TERMUX_PREFIX@/bin/look") (t "look")) "Name of the look command for search processes. This must be an absolute file name."
{ "pile_set_name": "Github" }
/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <linux/netdevice.h> #include "rmnet_config.h" #include "rmnet_map.h" #include "rmnet_private.h" #include "rmnet_vnd.h" static u8 rmnet_map_do_flow_control(struct sk_buff *skb, struct rmnet_port *port, int enable) { struct rmnet_map_control_command *cmd; struct rmnet_endpoint *ep; struct net_device *vnd; u16 ip_family; u16 fc_seq; u32 qos_id; u8 mux_id; int r; mux_id = RMNET_MAP_GET_MUX_ID(skb); cmd = RMNET_MAP_GET_CMD_START(skb); if (mux_id >= RMNET_MAX_LOGICAL_EP) { kfree_skb(skb); return RX_HANDLER_CONSUMED; } ep = rmnet_get_endpoint(port, mux_id); if (!ep) { kfree_skb(skb); return RX_HANDLER_CONSUMED; } vnd = ep->egress_dev; ip_family = cmd->flow_control.ip_family; fc_seq = ntohs(cmd->flow_control.flow_control_seq_num); qos_id = ntohl(cmd->flow_control.qos_id); /* Ignore the ip family and pass the sequence number for both v4 and v6 * sequence. User space does not support creating dedicated flows for * the 2 protocols */ r = rmnet_vnd_do_flow_control(vnd, enable); if (r) { kfree_skb(skb); return RMNET_MAP_COMMAND_UNSUPPORTED; } else { return RMNET_MAP_COMMAND_ACK; } } static void rmnet_map_send_ack(struct sk_buff *skb, unsigned char type, struct rmnet_port *port) { struct rmnet_map_control_command *cmd; struct net_device *dev = skb->dev; if (port->data_format & RMNET_FLAGS_INGRESS_MAP_CKSUMV4) skb_trim(skb, skb->len - sizeof(struct rmnet_map_dl_csum_trailer)); skb->protocol = htons(ETH_P_MAP); cmd = RMNET_MAP_GET_CMD_START(skb); cmd->cmd_type = type & 0x03; netif_tx_lock(dev); dev->netdev_ops->ndo_start_xmit(skb, dev); netif_tx_unlock(dev); } /* Process MAP command frame and send N/ACK message as appropriate. Message cmd * name is decoded here and appropriate handler is called. */ void rmnet_map_command(struct sk_buff *skb, struct rmnet_port *port) { struct rmnet_map_control_command *cmd; unsigned char command_name; unsigned char rc = 0; cmd = RMNET_MAP_GET_CMD_START(skb); command_name = cmd->command_name; switch (command_name) { case RMNET_MAP_COMMAND_FLOW_ENABLE: rc = rmnet_map_do_flow_control(skb, port, 1); break; case RMNET_MAP_COMMAND_FLOW_DISABLE: rc = rmnet_map_do_flow_control(skb, port, 0); break; default: rc = RMNET_MAP_COMMAND_UNSUPPORTED; kfree_skb(skb); break; } if (rc == RMNET_MAP_COMMAND_ACK) rmnet_map_send_ack(skb, rc, port); }
{ "pile_set_name": "Github" }
track name="Unsorted bed" chr2 178707289 178707561 Hs.666133 0 + 178707289 178707561 0 3 85,177,8, 0,87,264, chr2 178709699 178711955 Hs.377257 0 + 178709699 178711955 0 1 2256, 0, chr2 178711404 178712057 Hs.688767 0 - 178711404 178712057 0 1 653, 0, chr2 179037911 179051526 Hs.410378 0 - 179037911 179051526 0 5 813,179,134,152,275, 0,814,4713,12123,13340, chr2 179052287 179052856 Hs.560940 0 - 179052287 179052856 0 2 291,277, 0,292, chr2 179053444 179078029 Hs.41086 0 + 179053444 179078029 0 8 438,117,156,137,165,44,116,1297, 0,5169,10187,13381,15024,18739,20589,23288, chr2 179053611 179058730 Hs.560270 0 + 179053611 179058730 0 7 105,37,4,23,99,9,107, 0,105,144,148,172,5002,5012, chr2 179078066 179078770 Hs.600801 0 - 179078066 179078770 0 2 350,8, 0,696, chr2 179078529 179079064 Hs.541630 0 + 179078529 179079064 0 1 535, 0, chr2 179087076 179087882 Hs.560768 0 + 179087076 179087882 0 11 586,90,17,10,22,7,14,23,8,13,10, 0,586,680,697,708,730,738,752,775,783,796, chr2 179088297 179088941 Hs.612551 0 + 179088297 179088941 0 7 383,4,214,16,6,5,12, 0,384,389,603,620,626,632, chr2 179088778 179089441 Hs.712123 0 - 179088778 179089441 0 8 7,6,8,7,9,12,17,588, 0,9,17,26,34,44,57,75, chr2 179088997 179089435 Hs.470769 0 - 179088997 179089435 0 1 438, 0, chr2 179095799 179178377 Hs.714450 0 + 179095799 179178377 0 17 34,185,97,331,1193,63,140,135,191,398,421,176,86,118,157,192,675, 0,625,12905,14534,15871,17280,19395,59745,60164,60697,61746,68312,74768,75728,76766,77648,81903, chr2 179098961 179380395 Hs.134602 0 - 179098961 179380395 0 314 1319,303,154,692,157,5609,594,306,576,300,306,585,303,303,300,288,594,282,306,306,297,291,306,303,2067,300,288,294,1767,306,303,300,288,297,303,588,297,17106,303,588,297,198,105,588,288,291,288,306,303,297,288,300,303,300,276,303,300,285,321,2967,294,300,282,309,303,300,282,303,303,38,243,151,149,315,300,295,27,292,300,130,33,149,309,430,191,309,300,294,285,297,300,303,363,303,300,279,306,197,106,300,300,116,187,297,288,122,178,148,152,285,115,188,303,303,270,267,125,409,279,267,267,169,98,267,124,143,127,140,267,267,267,127,140,264,267,264,127,140,276,279,402,51,90,63,90,75,81,69,111,78,108,84,78,84,84,84,84,84,84,84,84,90,78,81,297,75,69,78,96,75,75,297,84,84,84,78,84,162,78,93,75,78,207,81,84,84,84,84,78,81,114,102,84,84,81,84,84,84,81,87,78,78,63,405,48,72,84,60,27,78,210,261,268,90,184,286,93,288,291,288,288,279,279,279,288,279,282,279,282,288,288,279,279,279,288,279,282,279,282,288,288,279,279,279,288,279,282,279,282,279,288,279,279,279,282,279,288,279,279,279,282,279,288,279,279,279,282,564,279,57,189,126,285,232,166,142,261,261,261,264,261,261,264,273,267,282,1694,169,165,272,245,234,206,143,216,64,259,66,282,123,294,138,138,138,126,138,153,331,245,86,288,204,104,211, 0,1457,2285,2539,3971,4252,9993,10949,11353,12551,12957,13393,14079,15293,16275,16673,17080,17845,18212,19399,19831,20223,20611,21014,21418,23581,23997,24978,25641,27513,27925,28464,28876,30859,31264,31659,32352,33322,50540,50934,51613,51999,52622,52817,53572,53950,54333,55510,55917,56307,56951,57618,58287,58680,59083,60516,61129,61527,61910,62549,65610,65989,66390,66786,67184,67579,67972,68355,69518,71549,71587,71918,72516,72758,73156,73564,74863,74890,75275,75668,75892,76012,76292,77886,78718,78997,79424,81031,81411,81795,82188,82616,83218,83694,84100,85003,85382,85768,86067,86287,86783,87171,87761,88062,88476,88857,89317,89651,90489,90739,91130,91335,91789,92199,92594,93631,93998,94227,94725,95112,95485,95850,96680,98475,99283,103311,104251,104814,105044,106157,106536,106928,107197,107423,107827,108376,108733,109175,109450,109973,110408,111379,113709,114058,114551,115251,116247,118558,119930,123827,124174,124761,125253,125463,125676,125894,126106,126274,126468,133015,133182,136976,144228,145100,145981,146417,146645,147643,148324,149049,149931,151631,152135,152424,152757,153349,153609,153904,154264,155089,155386,155671,156707,157221,158009,158340,158676,158916,159263,159528,162121,162687,163063,163300,163525,163823,166026,166507,167619,167932,168609,168839,169358,169875,171131,172853,175130,175538,176050,176178,176464,178157,178520,178887,179184,180464,180872,181536,183576,184645,185072,185954,186325,186707,187095,187907,188302,188996,189503,191105,191533,191953,192332,192705,193174,193564,193993,194395,194931,195857,196269,196669,197056,197428,197866,198270,199378,199778,201100,201595,202120,202510,202901,203298,203674,204103,204515,204935,205315,205703,206076,206450,206844,207249,207624,208338,208717,209521,212092,227134,232994,238187,238537,240391,241769,242024,242683,243689,244070,244422,245221,247119,247472,247848,248217,248931,249366,251159,251430,251714,252884,253239,254010,255131,256222,256549,256816,257730,258080,259630,259858,263370,263988,264718,266082,267414,268409,268932,273497,273835,274405,276148,278562,281223, chr2 179114097 179114772 Hs.596354 0 - 179114097 179114772 0 1 675, 0, chr2 179115873 179116818 Hs.622912 0 - 179115873 179116818 0 2 67,603, 0,342, chr2 179121907 179122356 Hs.609542 0 - 179121907 179122356 0 2 224,224, 0,225, chr2 179122873 179123656 Hs.621944 0 - 179122873 179123656 0 1 783, 0, chr2 179123897 179124349 Hs.619377 0 - 179123897 179124349 0 1 452, 0, chr2 179127533 179131939 Hs.640473 0 + 179127533 179131939 0 1 4406, 0, chr2 179150961 179151480 Hs.609295 0 - 179150961 179151480 0 1 519, 0, chr2 179189619 179190087 Hs.710694 0 + 179189619 179190087 0 12 33,37,18,29,11,179,33,13,34,16,5,52, 0,34,72,91,120,131,311,344,358,393,409,416, chr2 179204887 179205401 Hs.661496 0 - 179204887 179205401 0 2 16,498, 0,16, chr2 179209546 179287210 Hs.620337 0 - 179209546 179287210 0 5 124,358,6,11,109, 0,77179,77537,77544,77555, chr2 179217688 179218151 Hs.603086 0 - 179217688 179218151 0 1 463, 0, chr2 179317750 179337584 Hs.589824 0 + 179317750 179337584 0 6 64,57,54,75,373,53, 0,11487,14212,16161,19407,19781, chr2 179349897 179352934 Hs.570275 0 + 179349897 179352934 0 2 1830,125, 0,2912, chr2 178777793 178778272 Hs.541631 0 - 178777793 178778272 0 1 479, 0, chr2 178908612 178916376 Hs.318775 0 + 178908612 178916376 0 4 2644,3067,464,1588, 0,2645,5712,6176, chr1 178969501 178972156 Hs.593061 0 + 178969501 178972156 0 2 1262,1393, 0,1262, chr2 178969902 178971077 Hs.712020 0 - 178969902 178971077 0 1 1175, 0, chr2 178973806 178974450 Hs.634282 0 + 178973806 178974450 0 1 644, 0, chr2 178974749 178975493 Hs.323349 0 + 178974749 178975493 0 4 337,389,4,13, 0,337,726,731, chr2 179004517 179006503 Hs.632540 0 - 179004517 179006503 0 1 1986, 0, chr2 179004764 179005050 Hs.625283 0 + 179004764 179005050 0 2 9,276, 0,10, chr2 179007083 179007837 Hs.684082 0 + 179007083 179007837 0 5 28,30,20,226,79, 0,72,117,449,675, chr2 179008250 179008984 Hs.685223 0 + 179008250 179008984 0 1 734, 0, chr2 179008373 179013032 Hs.570274 0 + 179008373 179013032 0 3 2710,583,1365, 0,2711,3294, chr2 179011106 179011819 Hs.662660 0 + 179011106 179011819 0 8 556,6,22,98,12,6,6,5, 0,558,564,586,684,696,702,708, chr2 179012189 179013184 Hs.658781 0 - 179012189 179013184 0 7 5,9,22,99,844,4,6, 0,6,16,39,139,984,989, chr2 179018046 179018564 Hs.633180 0 - 179018046 179018564 0 1 518, 0, chr2 179020446 179020899 Hs.605693 0 - 179020446 179020899 0 1 453, 0, chr2 179026223 179034260 Hs.87734 0 + 179026223 179034260 0 5 1276,142,118,99,306, 0,2759,5259,7097,7731, chr2 179033863 179034261 Hs.607684 0 - 179033863 179034261 0 1 398, 0, chr2 179036643 179037341 Hs.645700 0 + 179036643 179037341 0 2 678,19, 0,679, chr2 179360386 179361066 Hs.711672 0 + 179360386 179361066 0 1 680, 0, chr2 179405591 179445166 Hs.324341 0 - 179405591 179445166 0 13 1821,236,352,117,113,184,195,141,150,180,189,126,62, 0,4274,4773,13006,17429,20821,22727,23637,33147,35406,36497,38807,39513, chr3 179433849 179434307 Hs.663044 0 - 179433849 179434307 0 1 458, 0, chr2 179445992 179623031 Hs.591627 0 - 179445992 179623031 0 19 283,2269,402,296,353,208,10,1299,192,120,142,173,195,117,254,109,192,123,220, 0,283,2553,2955,3252,3605,3813,3824,11880,13731,15506,32308,45692,71514,88209,102036,105463,174263,176819, chr2 179531336 179531470 Hs.610180 0 + 179531336 179531470 0 1 134, 0, chr2 179531674 179531995 Hs.610180 0 + 179531674 179531995 0 4 6,17,164,130, 0,10,27,191, chr2 179674663 179837595 Hs.30977 0 - 179674663 179837595 0 18 8337,122,192,123,82,160,115,195,123,212,56,98,114,114,91,109,80,125, 0,11032,13373,14976,15840,20078,22023,22672,30612,41900,44710,47605,49586,70428,74756,81388,90095,162807, chr4 179675396 179681310 Hs.714518 0 + 179675396 179681310 0 2 435,41, 0,5873, chr2 179675483 179675797 Hs.609408 0 + 179675483 179675797 0 1 314, 0, chr2 179698890 179699454 Hs.667783 0 - 179698890 179699454 0 2 436,125, 0,439, chr2 179702362 179702797 Hs.602509 0 + 179702362 179702797 0 1 435, 0, chr2 179714478 179714731 Hs.679403 0 - 179714478 179714731 0 1 253, 0, chr2 179720333 179721089 Hs.686454 0 + 179720333 179721089 0 1 756, 0, chr5 179820582 179821132 Hs.671087 0 + 179820582 179821132 0 1 550, 0, chr2 179820805 179821282 Hs.621019 0 - 179820805 179821282 0 2 264,205, 0,272, chr2 179908392 179909870 Hs.516555 0 - 179908392 179909870 0 3 227,147,6, 0,1115,1472, chr2 179929123 179929744 Hs.541629 0 - 179929123 179929744 0 4 18,41,385,164, 0,30,71,457, chr2 179972131 179973464 Hs.179697 0 - 179972131 179973464 0 3 4,1011,317, 0,5,1016, chr2 179227481 179235392 Hs.678928 0 - 179227481 179235392 0 12 6,15,2,11,72,85,5,79,81,73,8,83, 0,7,23,235,247,402,990,7254,7438,7632,7705,7828, chr2 179266309 179266748 Hs.609465 0 - 179266309 179266748 0 1 439, 0, chr2 179296428 179300012 Hs.623987 0 + 179296428 179300012 0 1 3584, 0, chr2 179302952 179303488 Hs.594545 0 - 179302952 179303488 0 1 536, 0, chr2 179305908 179308754 Hs.595834 0 + 179305908 179308754 0 6 121,194,124,4,13,40, 0,701,1567,1691,2793,2806, chr2 179315565 179317384 Hs.628418 0 - 179315565 179317384 0 1 1819, 0, chr2 179315565 179316076 Hs.670754 0 + 179315565 179316076 0 1 511, 0,
{ "pile_set_name": "Github" }
{ "id": "cache.json#", "properties": { "beforeRequest": { "oneOf": [ { "type": "null" }, { "$ref": "beforeRequest.json#" } ] }, "afterRequest": { "oneOf": [ { "type": "null" }, { "$ref": "afterRequest.json#" } ] }, "comment": { "type": "string" } } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12121" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> <device id="retina4_7" orientation="portrait"> <adaptation id="fullscreen"/> </device> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <objects> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ModalMaskViewViewController"> <connections> <outlet property="demoCollectionView" destination="ugU-x6-Yff" id="ZrQ-ga-47H"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> </connections> </placeholder> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="ugU-x6-Yff"> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="bLI-En-WIm"> <size key="itemSize" width="50" height="50"/> <size key="headerReferenceSize" width="0.0" height="0.0"/> <size key="footerReferenceSize" width="0.0" height="0.0"/> <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/> </collectionViewFlowLayout> </collectionView> </subviews> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <constraints> <constraint firstAttribute="bottom" secondItem="ugU-x6-Yff" secondAttribute="bottom" id="8wQ-q2-nyr"/> <constraint firstItem="ugU-x6-Yff" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="PQP-64-sqf"/> <constraint firstItem="ugU-x6-Yff" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="UYM-rQ-JgR"/> <constraint firstAttribute="trailing" secondItem="ugU-x6-Yff" secondAttribute="trailing" id="ckC-sO-4ix"/> </constraints> </view> </objects> </document>
{ "pile_set_name": "Github" }
![mosra@don-perverzo m.css]$ ls CONTRIBUTING.rst CREDITS.rst doc plugins README.rst COPYING css documentation pelican-theme site ASan reports: =>0x0c287fff8030: 00[fc]fc fc fc fc fc fc fc fc fc fa fa fa fa fa
{ "pile_set_name": "Github" }
// Copyright (c) 2017 Uber Technologies, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package jaeger import opentracing "github.com/opentracing/opentracing-go" // Observer can be registered with the Tracer to receive notifications about // new Spans. // // Deprecated: use jaeger.ContribObserver instead. type Observer interface { OnStartSpan(operationName string, options opentracing.StartSpanOptions) SpanObserver } // SpanObserver is created by the Observer and receives notifications about // other Span events. // // Deprecated: use jaeger.ContribSpanObserver instead. type SpanObserver interface { OnSetOperationName(operationName string) OnSetTag(key string, value interface{}) OnFinish(options opentracing.FinishOptions) } // compositeObserver is a dispatcher to other observers type compositeObserver struct { observers []ContribObserver } // compositeSpanObserver is a dispatcher to other span observers type compositeSpanObserver struct { observers []ContribSpanObserver } // noopSpanObserver is used when there are no observers registered // on the Tracer or none of them returns span observers from OnStartSpan. var noopSpanObserver = &compositeSpanObserver{} func (o *compositeObserver) append(contribObserver ContribObserver) { o.observers = append(o.observers, contribObserver) } func (o *compositeObserver) OnStartSpan(sp opentracing.Span, operationName string, options opentracing.StartSpanOptions) ContribSpanObserver { var spanObservers []ContribSpanObserver for _, obs := range o.observers { spanObs, ok := obs.OnStartSpan(sp, operationName, options) if ok { if spanObservers == nil { spanObservers = make([]ContribSpanObserver, 0, len(o.observers)) } spanObservers = append(spanObservers, spanObs) } } if len(spanObservers) == 0 { return noopSpanObserver } return &compositeSpanObserver{observers: spanObservers} } func (o *compositeSpanObserver) OnSetOperationName(operationName string) { for _, obs := range o.observers { obs.OnSetOperationName(operationName) } } func (o *compositeSpanObserver) OnSetTag(key string, value interface{}) { for _, obs := range o.observers { obs.OnSetTag(key, value) } } func (o *compositeSpanObserver) OnFinish(options opentracing.FinishOptions) { for _, obs := range o.observers { obs.OnFinish(options) } }
{ "pile_set_name": "Github" }
// Copyright (c) 2012, 2013 Ugorji Nwoke. All rights reserved. // Use of this source code is governed by a BSD-style license found in the LICENSE file. package codec import ( "bufio" "io" "net/rpc" "sync" ) // Rpc provides a rpc Server or Client Codec for rpc communication. type Rpc interface { ServerCodec(conn io.ReadWriteCloser, h Handle) rpc.ServerCodec ClientCodec(conn io.ReadWriteCloser, h Handle) rpc.ClientCodec } // RpcCodecBuffered allows access to the underlying bufio.Reader/Writer // used by the rpc connection. It accomodates use-cases where the connection // should be used by rpc and non-rpc functions, e.g. streaming a file after // sending an rpc response. type RpcCodecBuffered interface { BufferedReader() *bufio.Reader BufferedWriter() *bufio.Writer } // ------------------------------------- // rpcCodec defines the struct members and common methods. type rpcCodec struct { rwc io.ReadWriteCloser dec *Decoder enc *Encoder bw *bufio.Writer br *bufio.Reader mu sync.Mutex cls bool } func newRPCCodec(conn io.ReadWriteCloser, h Handle) rpcCodec { bw := bufio.NewWriter(conn) br := bufio.NewReader(conn) return rpcCodec{ rwc: conn, bw: bw, br: br, enc: NewEncoder(bw, h), dec: NewDecoder(br, h), } } func (c *rpcCodec) BufferedReader() *bufio.Reader { return c.br } func (c *rpcCodec) BufferedWriter() *bufio.Writer { return c.bw } func (c *rpcCodec) write(obj1, obj2 interface{}, writeObj2, doFlush bool) (err error) { if c.cls { return io.EOF } if err = c.enc.Encode(obj1); err != nil { return } if writeObj2 { if err = c.enc.Encode(obj2); err != nil { return } } if doFlush && c.bw != nil { return c.bw.Flush() } return } func (c *rpcCodec) read(obj interface{}) (err error) { if c.cls { return io.EOF } //If nil is passed in, we should still attempt to read content to nowhere. if obj == nil { var obj2 interface{} return c.dec.Decode(&obj2) } return c.dec.Decode(obj) } func (c *rpcCodec) Close() error { if c.cls { return io.EOF } c.cls = true return c.rwc.Close() } func (c *rpcCodec) ReadResponseBody(body interface{}) error { return c.read(body) } // ------------------------------------- type goRpcCodec struct { rpcCodec } func (c *goRpcCodec) WriteRequest(r *rpc.Request, body interface{}) error { // Must protect for concurrent access as per API c.mu.Lock() defer c.mu.Unlock() return c.write(r, body, true, true) } func (c *goRpcCodec) WriteResponse(r *rpc.Response, body interface{}) error { c.mu.Lock() defer c.mu.Unlock() return c.write(r, body, true, true) } func (c *goRpcCodec) ReadResponseHeader(r *rpc.Response) error { return c.read(r) } func (c *goRpcCodec) ReadRequestHeader(r *rpc.Request) error { return c.read(r) } func (c *goRpcCodec) ReadRequestBody(body interface{}) error { return c.read(body) } // ------------------------------------- // goRpc is the implementation of Rpc that uses the communication protocol // as defined in net/rpc package. type goRpc struct{} // GoRpc implements Rpc using the communication protocol defined in net/rpc package. // Its methods (ServerCodec and ClientCodec) return values that implement RpcCodecBuffered. var GoRpc goRpc func (x goRpc) ServerCodec(conn io.ReadWriteCloser, h Handle) rpc.ServerCodec { return &goRpcCodec{newRPCCodec(conn, h)} } func (x goRpc) ClientCodec(conn io.ReadWriteCloser, h Handle) rpc.ClientCodec { return &goRpcCodec{newRPCCodec(conn, h)} } var _ RpcCodecBuffered = (*rpcCodec)(nil) // ensure *rpcCodec implements RpcCodecBuffered
{ "pile_set_name": "Github" }
<?php /* * Copyright 2016 Google 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. */ class Google_Service_Directory_MobileDeviceAction extends Google_Model { public $action; public function setAction($action) { $this->action = $action; } public function getAction() { return $this->action; } }
{ "pile_set_name": "Github" }
/* * This program is free software; you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software * Foundation. * * You should have received a copy of the GNU Lesser General Public License along with this * program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html * or from the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * 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. * * Copyright (c) 2001 - 2020 Object Refinery Ltd, Hitachi Vantara and Contributors.. All rights reserved. */ package org.pentaho.reporting.engine.classic.core.modules.output.table.html; import org.pentaho.reporting.engine.classic.core.layout.model.LogicalPageBox; import org.pentaho.reporting.engine.classic.core.layout.output.ContentProcessingException; import org.pentaho.reporting.engine.classic.core.layout.output.DisplayAllFlowSelector; import org.pentaho.reporting.engine.classic.core.layout.output.FlowSelector; import org.pentaho.reporting.engine.classic.core.layout.output.LogicalPageKey; import org.pentaho.reporting.engine.classic.core.layout.output.OutputProcessorMetaData; import org.pentaho.reporting.engine.classic.core.modules.output.table.base.AbstractTableOutputProcessor; import org.pentaho.reporting.engine.classic.core.modules.output.table.base.TableContentProducer; import org.pentaho.reporting.engine.classic.core.modules.output.table.html.helper.HtmlOutputProcessorMetaData; import org.pentaho.reporting.libraries.base.config.Configuration; /** * Creation-Date: 04.05.2007, 16:36:40 * * @author Thomas Morgner */ public class StreamHtmlOutputProcessor extends AbstractTableOutputProcessor implements HtmlOutputProcessor { private HtmlPrinter printer; private OutputProcessorMetaData metaData; private FlowSelector flowSelector; public StreamHtmlOutputProcessor( final Configuration configuration ) { if ( configuration == null ) { throw new NullPointerException(); } this.metaData = new HtmlOutputProcessorMetaData( HtmlOutputProcessorMetaData.PAGINATION_NONE ); this.flowSelector = new DisplayAllFlowSelector(); } protected FlowSelector getFlowSelector() { return flowSelector; } public OutputProcessorMetaData getMetaData() { return metaData; } public HtmlPrinter getPrinter() { return printer; } public void setPrinter( final HtmlPrinter printer ) { this.printer = printer; } protected void processTableContent( final LogicalPageKey logicalPageKey, final LogicalPageBox logicalPage, final TableContentProducer contentProducer ) throws ContentProcessingException { if ( printer == null ) { return; } printer.print( logicalPageKey, logicalPage, contentProducer, metaData, false ); } protected void updateTableContent( final LogicalPageKey logicalPageKey, final LogicalPageBox logicalPageBox, final TableContentProducer tableContentProducer, final boolean performOutput ) throws ContentProcessingException { if ( printer == null ) { return; } printer.print( logicalPageKey, logicalPageBox, tableContentProducer, metaData, true, false ); } protected void processingContentFinished() { if ( isContentGeneratable() == false ) { return; } this.metaData.commit(); } }
{ "pile_set_name": "Github" }
/* fuc microcode for copy engine on gt215- chipsets * * Copyright 2011 Red Hat Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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. * * Authors: Ben Skeggs */ #ifdef GT215 .section #gt215_ce_data #else .section #gf100_ce_data #endif ctx_object: .b32 0 #ifdef GT215 ctx_dma: ctx_dma_query: .b32 0 ctx_dma_src: .b32 0 ctx_dma_dst: .b32 0 #endif .equ #ctx_dma_count 3 ctx_query_address_high: .b32 0 ctx_query_address_low: .b32 0 ctx_query_counter: .b32 0 ctx_src_address_high: .b32 0 ctx_src_address_low: .b32 0 ctx_src_pitch: .b32 0 ctx_src_tile_mode: .b32 0 ctx_src_xsize: .b32 0 ctx_src_ysize: .b32 0 ctx_src_zsize: .b32 0 ctx_src_zoff: .b32 0 ctx_src_xoff: .b32 0 ctx_src_yoff: .b32 0 ctx_src_cpp: .b32 0 ctx_dst_address_high: .b32 0 ctx_dst_address_low: .b32 0 ctx_dst_pitch: .b32 0 ctx_dst_tile_mode: .b32 0 ctx_dst_xsize: .b32 0 ctx_dst_ysize: .b32 0 ctx_dst_zsize: .b32 0 ctx_dst_zoff: .b32 0 ctx_dst_xoff: .b32 0 ctx_dst_yoff: .b32 0 ctx_dst_cpp: .b32 0 ctx_format: .b32 0 ctx_swz_const0: .b32 0 ctx_swz_const1: .b32 0 ctx_xcnt: .b32 0 ctx_ycnt: .b32 0 .align 256 dispatch_table: // mthd 0x0000, NAME .b16 0x000 1 .b32 #ctx_object ~0xffffffff // mthd 0x0100, NOP .b16 0x040 1 .b32 0x00010000 + #cmd_nop ~0xffffffff // mthd 0x0140, PM_TRIGGER .b16 0x050 1 .b32 0x00010000 + #cmd_pm_trigger ~0xffffffff #ifdef GT215 // mthd 0x0180-0x018c, DMA_ .b16 0x060 #ctx_dma_count dispatch_dma: .b32 0x00010000 + #cmd_dma ~0xffffffff .b32 0x00010000 + #cmd_dma ~0xffffffff .b32 0x00010000 + #cmd_dma ~0xffffffff #endif // mthd 0x0200-0x0218, SRC_TILE .b16 0x80 7 .b32 #ctx_src_tile_mode ~0x00000fff .b32 #ctx_src_xsize ~0x0007ffff .b32 #ctx_src_ysize ~0x00001fff .b32 #ctx_src_zsize ~0x000007ff .b32 #ctx_src_zoff ~0x00000fff .b32 #ctx_src_xoff ~0x0007ffff .b32 #ctx_src_yoff ~0x00001fff // mthd 0x0220-0x0238, DST_TILE .b16 0x88 7 .b32 #ctx_dst_tile_mode ~0x00000fff .b32 #ctx_dst_xsize ~0x0007ffff .b32 #ctx_dst_ysize ~0x00001fff .b32 #ctx_dst_zsize ~0x000007ff .b32 #ctx_dst_zoff ~0x00000fff .b32 #ctx_dst_xoff ~0x0007ffff .b32 #ctx_dst_yoff ~0x00001fff // mthd 0x0300-0x0304, EXEC, WRCACHE_FLUSH .b16 0xc0 2 .b32 0x00010000 + #cmd_exec ~0xffffffff .b32 0x00010000 + #cmd_wrcache_flush ~0xffffffff // mthd 0x030c-0x0340, various stuff .b16 0xc3 14 .b32 #ctx_src_address_high ~0x000000ff .b32 #ctx_src_address_low ~0xffffffff .b32 #ctx_dst_address_high ~0x000000ff .b32 #ctx_dst_address_low ~0xffffffff .b32 #ctx_src_pitch ~0x0007ffff .b32 #ctx_dst_pitch ~0x0007ffff .b32 #ctx_xcnt ~0x0000ffff .b32 #ctx_ycnt ~0x00001fff .b32 #ctx_format ~0x0333ffff .b32 #ctx_swz_const0 ~0xffffffff .b32 #ctx_swz_const1 ~0xffffffff .b32 #ctx_query_address_high ~0x000000ff .b32 #ctx_query_address_low ~0xffffffff .b32 #ctx_query_counter ~0xffffffff .b16 0x800 0 #ifdef GT215 .section #gt215_ce_code #else .section #gf100_ce_code #endif main: clear b32 $r0 mov $sp $r0 // setup i0 handler and route fifo and ctxswitch to it mov $r1 #ih mov $iv0 $r1 mov $r1 0x400 movw $r2 0xfff3 sethi $r2 0 iowr I[$r1 + 0x300] $r2 // enable interrupts or $r2 0xc iowr I[$r1] $r2 bset $flags ie0 // enable fifo access and context switching mov $r1 0x1200 mov $r2 3 iowr I[$r1] $r2 // sleep forever, waking for interrupts bset $flags $p0 spin: sleep $p0 bra #spin // i0 handler ih: iord $r1 I[$r0 + 0x200] and $r2 $r1 0x00000008 bra e #ih_no_chsw call #chsw ih_no_chsw: and $r2 $r1 0x00000004 bra e #ih_no_cmd call #dispatch ih_no_cmd: and $r1 $r1 0x0000000c iowr I[$r0 + 0x100] $r1 iret // $p1 direction (0 = unload, 1 = load) // $r3 channel swctx: mov $r4 0x7700 mov $xtargets $r4 #ifdef GT215 // target 7 hardcoded to ctx dma object mov $xdbase $r0 #else // read SCRATCH3 to decide if we are PCOPY0 or PCOPY1 mov $r4 0x2100 iord $r4 I[$r4 + 0] and $r4 1 shl b32 $r4 4 add b32 $r4 0x30 // channel is in vram mov $r15 0x61c shl b32 $r15 6 mov $r5 0x114 iowrs I[$r15] $r5 // read 16-byte PCOPYn info, containing context pointer, from channel shl b32 $r5 $r3 4 add b32 $r5 2 mov $xdbase $r5 mov $r5 $sp // get a chunk of stack space, aligned to 256 byte boundary sub b32 $r5 0x100 mov $r6 0xff not b32 $r6 and $r5 $r6 sethi $r5 0x00020000 xdld $r4 $r5 xdwait sethi $r5 0 // set context pointer, from within channel VM mov $r14 0 iowrs I[$r15] $r14 ld b32 $r4 D[$r5 + 0] shr b32 $r4 8 ld b32 $r6 D[$r5 + 4] shl b32 $r6 24 or $r4 $r6 mov $xdbase $r4 #endif // 256-byte context, at start of data segment mov b32 $r4 $r0 sethi $r4 0x60000 // swap! bra $p1 #swctx_load xdst $r0 $r4 bra #swctx_done swctx_load: xdld $r0 $r4 swctx_done: xdwait ret chsw: // read current channel mov $r2 0x1400 iord $r3 I[$r2] // if it's active, unload it and return xbit $r15 $r3 0x1e bra e #chsw_no_unload bclr $flags $p1 call #swctx bclr $r3 0x1e iowr I[$r2] $r3 mov $r4 1 iowr I[$r2 + 0x200] $r4 ret // read next channel chsw_no_unload: iord $r3 I[$r2 + 0x100] // is there a channel waiting to be loaded? xbit $r13 $r3 0x1e bra e #chsw_finish_load bset $flags $p1 call #swctx #ifdef GT215 // load dma objects back into TARGET regs mov $r5 #ctx_dma mov $r6 #ctx_dma_count chsw_load_ctx_dma: ld b32 $r7 D[$r5 + $r6 * 4] add b32 $r8 $r6 0x180 shl b32 $r8 8 iowr I[$r8] $r7 sub b32 $r6 1 bra nc #chsw_load_ctx_dma #endif chsw_finish_load: mov $r3 2 iowr I[$r2 + 0x200] $r3 ret dispatch: // read incoming fifo command mov $r3 0x1900 iord $r2 I[$r3 + 0x100] iord $r3 I[$r3 + 0x000] and $r4 $r2 0x7ff // $r2 will be used to store exception data shl b32 $r2 0x10 // lookup method in the dispatch table, ILLEGAL_MTHD if not found mov $r5 #dispatch_table clear b32 $r6 clear b32 $r7 dispatch_loop: ld b16 $r6 D[$r5 + 0] ld b16 $r7 D[$r5 + 2] add b32 $r5 4 cmpu b32 $r4 $r6 bra c #dispatch_illegal_mthd add b32 $r7 $r6 cmpu b32 $r4 $r7 bra c #dispatch_valid_mthd sub b32 $r7 $r6 shl b32 $r7 3 add b32 $r5 $r7 bra #dispatch_loop // ensure no bits set in reserved fields, INVALID_BITFIELD dispatch_valid_mthd: sub b32 $r4 $r6 shl b32 $r4 3 add b32 $r4 $r5 ld b32 $r5 D[$r4 + 4] and $r5 $r3 cmpu b32 $r5 0 bra ne #dispatch_invalid_bitfield // depending on dispatch flags: execute method, or save data as state ld b16 $r5 D[$r4 + 0] ld b16 $r6 D[$r4 + 2] cmpu b32 $r6 0 bra ne #dispatch_cmd st b32 D[$r5] $r3 bra #dispatch_done dispatch_cmd: bclr $flags $p1 call $r5 bra $p1 #dispatch_error bra #dispatch_done dispatch_invalid_bitfield: or $r2 2 dispatch_illegal_mthd: or $r2 1 // store exception data in SCRATCH0/SCRATCH1, signal hostirq dispatch_error: mov $r4 0x1000 iowr I[$r4 + 0x000] $r2 iowr I[$r4 + 0x100] $r3 mov $r2 0x40 iowr I[$r0] $r2 hostirq_wait: iord $r2 I[$r0 + 0x200] and $r2 0x40 cmpu b32 $r2 0 bra ne #hostirq_wait dispatch_done: mov $r2 0x1d00 mov $r3 1 iowr I[$r2] $r3 ret // No-operation // // Inputs: // $r1: irqh state // $r2: hostirq state // $r3: data // $r4: dispatch table entry // Outputs: // $r1: irqh state // $p1: set on error // $r2: hostirq state // $r3: data cmd_nop: ret // PM_TRIGGER // // Inputs: // $r1: irqh state // $r2: hostirq state // $r3: data // $r4: dispatch table entry // Outputs: // $r1: irqh state // $p1: set on error // $r2: hostirq state // $r3: data cmd_pm_trigger: mov $r2 0x2200 clear b32 $r3 sethi $r3 0x20000 iowr I[$r2] $r3 ret #ifdef GT215 // SET_DMA_* method handler // // Inputs: // $r1: irqh state // $r2: hostirq state // $r3: data // $r4: dispatch table entry // Outputs: // $r1: irqh state // $p1: set on error // $r2: hostirq state // $r3: data cmd_dma: sub b32 $r4 #dispatch_dma shr b32 $r4 1 bset $r3 0x1e st b32 D[$r4 + #ctx_dma] $r3 add b32 $r4 0x600 shl b32 $r4 6 iowr I[$r4] $r3 ret #endif // Calculates the hw swizzle mask and adjusts the surface's xcnt to match // cmd_exec_set_format: // zero out a chunk of the stack to store the swizzle into add $sp -0x10 st b32 D[$sp + 0x00] $r0 st b32 D[$sp + 0x04] $r0 st b32 D[$sp + 0x08] $r0 st b32 D[$sp + 0x0c] $r0 // extract cpp, src_ncomp and dst_ncomp from FORMAT ld b32 $r4 D[$r0 + #ctx_format] extr $r5 $r4 16:17 add b32 $r5 1 extr $r6 $r4 20:21 add b32 $r6 1 extr $r7 $r4 24:25 add b32 $r7 1 // convert FORMAT swizzle mask to hw swizzle mask bclr $flags $p2 clear b32 $r8 clear b32 $r9 ncomp_loop: and $r10 $r4 0xf shr b32 $r4 4 clear b32 $r11 bpc_loop: cmpu b8 $r10 4 bra nc #cmp_c0 mulu $r12 $r10 $r5 add b32 $r12 $r11 bset $flags $p2 bra #bpc_next cmp_c0: bra ne #cmp_c1 mov $r12 0x10 add b32 $r12 $r11 bra #bpc_next cmp_c1: cmpu b8 $r10 6 bra nc #cmp_zero mov $r12 0x14 add b32 $r12 $r11 bra #bpc_next cmp_zero: mov $r12 0x80 bpc_next: st b8 D[$sp + $r8] $r12 add b32 $r8 1 add b32 $r11 1 cmpu b32 $r11 $r5 bra c #bpc_loop add b32 $r9 1 cmpu b32 $r9 $r7 bra c #ncomp_loop // SRC_XCNT = (xcnt * src_cpp), or 0 if no src ref in swz (hw will hang) mulu $r6 $r5 st b32 D[$r0 + #ctx_src_cpp] $r6 ld b32 $r8 D[$r0 + #ctx_xcnt] mulu $r6 $r8 bra $p2 #dst_xcnt clear b32 $r6 dst_xcnt: mulu $r7 $r5 st b32 D[$r0 + #ctx_dst_cpp] $r7 mulu $r7 $r8 mov $r5 0x810 shl b32 $r5 6 iowr I[$r5 + 0x000] $r6 iowr I[$r5 + 0x100] $r7 add b32 $r5 0x800 ld b32 $r6 D[$r0 + #ctx_dst_cpp] sub b32 $r6 1 shl b32 $r6 8 ld b32 $r7 D[$r0 + #ctx_src_cpp] sub b32 $r7 1 or $r6 $r7 iowr I[$r5 + 0x000] $r6 add b32 $r5 0x100 ld b32 $r6 D[$sp + 0x00] iowr I[$r5 + 0x000] $r6 ld b32 $r6 D[$sp + 0x04] iowr I[$r5 + 0x100] $r6 ld b32 $r6 D[$sp + 0x08] iowr I[$r5 + 0x200] $r6 ld b32 $r6 D[$sp + 0x0c] iowr I[$r5 + 0x300] $r6 add b32 $r5 0x400 ld b32 $r6 D[$r0 + #ctx_swz_const0] iowr I[$r5 + 0x000] $r6 ld b32 $r6 D[$r0 + #ctx_swz_const1] iowr I[$r5 + 0x100] $r6 add $sp 0x10 ret // Setup to handle a tiled surface // // Calculates a number of parameters the hardware requires in order // to correctly handle tiling. // // Offset calculation is performed as follows (Tp/Th/Td from TILE_MODE): // nTx = round_up(w * cpp, 1 << Tp) >> Tp // nTy = round_up(h, 1 << Th) >> Th // Txo = (x * cpp) & ((1 << Tp) - 1) // Tx = (x * cpp) >> Tp // Tyo = y & ((1 << Th) - 1) // Ty = y >> Th // Tzo = z & ((1 << Td) - 1) // Tz = z >> Td // // off = (Tzo << Tp << Th) + (Tyo << Tp) + Txo // off += ((Tz * nTy * nTx)) + (Ty * nTx) + Tx) << Td << Th << Tp; // // Inputs: // $r4: hw command (0x104800) // $r5: ctx offset adjustment for src/dst selection // $p2: set if dst surface // cmd_exec_set_surface_tiled: // translate TILE_MODE into Tp, Th, Td shift values ld b32 $r7 D[$r5 + #ctx_src_tile_mode] extr $r9 $r7 8:11 extr $r8 $r7 4:7 #ifdef GT215 add b32 $r8 2 #else add b32 $r8 3 #endif extr $r7 $r7 0:3 cmp b32 $r7 0xe bra ne #xtile64 mov $r7 4 bra #xtileok xtile64: xbit $r7 $flags $p2 add b32 $r7 17 bset $r4 $r7 mov $r7 6 xtileok: // Op = (x * cpp) & ((1 << Tp) - 1) // Tx = (x * cpp) >> Tp ld b32 $r10 D[$r5 + #ctx_src_xoff] ld b32 $r11 D[$r5 + #ctx_src_cpp] mulu $r10 $r11 mov $r11 1 shl b32 $r11 $r7 sub b32 $r11 1 and $r12 $r10 $r11 shr b32 $r10 $r7 // Tyo = y & ((1 << Th) - 1) // Ty = y >> Th ld b32 $r13 D[$r5 + #ctx_src_yoff] mov $r14 1 shl b32 $r14 $r8 sub b32 $r14 1 and $r11 $r13 $r14 shr b32 $r13 $r8 // YTILE = ((1 << Th) << 12) | ((1 << Th) - Tyo) add b32 $r14 1 shl b32 $r15 $r14 12 sub b32 $r14 $r11 or $r15 $r14 xbit $r6 $flags $p2 add b32 $r6 0x208 shl b32 $r6 8 iowr I[$r6 + 0x000] $r15 // Op += Tyo << Tp shl b32 $r11 $r7 add b32 $r12 $r11 // nTx = ((w * cpp) + ((1 << Tp) - 1) >> Tp) ld b32 $r15 D[$r5 + #ctx_src_xsize] ld b32 $r11 D[$r5 + #ctx_src_cpp] mulu $r15 $r11 mov $r11 1 shl b32 $r11 $r7 sub b32 $r11 1 add b32 $r15 $r11 shr b32 $r15 $r7 push $r15 // nTy = (h + ((1 << Th) - 1)) >> Th ld b32 $r15 D[$r5 + #ctx_src_ysize] mov $r11 1 shl b32 $r11 $r8 sub b32 $r11 1 add b32 $r15 $r11 shr b32 $r15 $r8 push $r15 // Tys = Tp + Th // CFG_YZ_TILE_SIZE = ((1 << Th) >> 2) << Td add b32 $r7 $r8 sub b32 $r8 2 mov $r11 1 shl b32 $r11 $r8 shl b32 $r11 $r9 // Tzo = z & ((1 << Td) - 1) // Tz = z >> Td // Op += Tzo << Tys // Ts = Tys + Td ld b32 $r8 D[$r5 + #ctx_src_zoff] mov $r14 1 shl b32 $r14 $r9 sub b32 $r14 1 and $r15 $r8 $r14 shl b32 $r15 $r7 add b32 $r12 $r15 add b32 $r7 $r9 shr b32 $r8 $r9 // Ot = ((Tz * nTy * nTx) + (Ty * nTx) + Tx) << Ts pop $r15 pop $r9 mulu $r13 $r9 add b32 $r10 $r13 mulu $r8 $r9 mulu $r8 $r15 add b32 $r10 $r8 shl b32 $r10 $r7 // PITCH = (nTx - 1) << Ts sub b32 $r9 1 shl b32 $r9 $r7 iowr I[$r6 + 0x200] $r9 // SRC_ADDRESS_LOW = (Ot + Op) & 0xffffffff // CFG_ADDRESS_HIGH |= ((Ot + Op) >> 32) << 16 ld b32 $r7 D[$r5 + #ctx_src_address_low] ld b32 $r8 D[$r5 + #ctx_src_address_high] add b32 $r10 $r12 add b32 $r7 $r10 adc b32 $r8 0 shl b32 $r8 16 or $r8 $r11 sub b32 $r6 0x600 iowr I[$r6 + 0x000] $r7 add b32 $r6 0x400 iowr I[$r6 + 0x000] $r8 ret // Setup to handle a linear surface // // Nothing to see here.. Sets ADDRESS and PITCH, pretty non-exciting // cmd_exec_set_surface_linear: xbit $r6 $flags $p2 add b32 $r6 0x202 shl b32 $r6 8 ld b32 $r7 D[$r5 + #ctx_src_address_low] iowr I[$r6 + 0x000] $r7 add b32 $r6 0x400 ld b32 $r7 D[$r5 + #ctx_src_address_high] shl b32 $r7 16 iowr I[$r6 + 0x000] $r7 add b32 $r6 0x400 ld b32 $r7 D[$r5 + #ctx_src_pitch] iowr I[$r6 + 0x000] $r7 ret // wait for regs to be available for use cmd_exec_wait: push $r0 push $r1 mov $r0 0x800 shl b32 $r0 6 loop: iord $r1 I[$r0] and $r1 1 bra ne #loop pop $r1 pop $r0 ret cmd_exec_query: // if QUERY_SHORT not set, write out { -, 0, TIME_LO, TIME_HI } xbit $r4 $r3 13 bra ne #query_counter call #cmd_exec_wait mov $r4 0x80c shl b32 $r4 6 ld b32 $r5 D[$r0 + #ctx_query_address_low] add b32 $r5 4 iowr I[$r4 + 0x000] $r5 iowr I[$r4 + 0x100] $r0 mov $r5 0xc iowr I[$r4 + 0x200] $r5 add b32 $r4 0x400 ld b32 $r5 D[$r0 + #ctx_query_address_high] shl b32 $r5 16 iowr I[$r4 + 0x000] $r5 add b32 $r4 0x500 mov $r5 0x00000b00 sethi $r5 0x00010000 iowr I[$r4 + 0x000] $r5 mov $r5 0x00004040 shl b32 $r5 1 sethi $r5 0x80800000 iowr I[$r4 + 0x100] $r5 mov $r5 0x00001110 sethi $r5 0x13120000 iowr I[$r4 + 0x200] $r5 mov $r5 0x00001514 sethi $r5 0x17160000 iowr I[$r4 + 0x300] $r5 mov $r5 0x00002601 sethi $r5 0x00010000 mov $r4 0x800 shl b32 $r4 6 iowr I[$r4 + 0x000] $r5 // write COUNTER query_counter: call #cmd_exec_wait mov $r4 0x80c shl b32 $r4 6 ld b32 $r5 D[$r0 + #ctx_query_address_low] iowr I[$r4 + 0x000] $r5 iowr I[$r4 + 0x100] $r0 mov $r5 0x4 iowr I[$r4 + 0x200] $r5 add b32 $r4 0x400 ld b32 $r5 D[$r0 + #ctx_query_address_high] shl b32 $r5 16 iowr I[$r4 + 0x000] $r5 add b32 $r4 0x500 mov $r5 0x00000300 iowr I[$r4 + 0x000] $r5 mov $r5 0x00001110 sethi $r5 0x13120000 iowr I[$r4 + 0x100] $r5 ld b32 $r5 D[$r0 + #ctx_query_counter] add b32 $r4 0x500 iowr I[$r4 + 0x000] $r5 mov $r5 0x00002601 sethi $r5 0x00010000 mov $r4 0x800 shl b32 $r4 6 iowr I[$r4 + 0x000] $r5 ret // Execute a copy operation // // Inputs: // $r1: irqh state // $r2: hostirq state // $r3: data // 000002000 QUERY_SHORT // 000001000 QUERY // 000000100 DST_LINEAR // 000000010 SRC_LINEAR // 000000001 FORMAT // $r4: dispatch table entry // Outputs: // $r1: irqh state // $p1: set on error // $r2: hostirq state // $r3: data cmd_exec: call #cmd_exec_wait // if format requested, call function to calculate it, otherwise // fill in cpp/xcnt for both surfaces as if (cpp == 1) xbit $r15 $r3 0 bra e #cmd_exec_no_format call #cmd_exec_set_format mov $r4 0x200 bra #cmd_exec_init_src_surface cmd_exec_no_format: mov $r6 0x810 shl b32 $r6 6 mov $r7 1 st b32 D[$r0 + #ctx_src_cpp] $r7 st b32 D[$r0 + #ctx_dst_cpp] $r7 ld b32 $r7 D[$r0 + #ctx_xcnt] iowr I[$r6 + 0x000] $r7 iowr I[$r6 + 0x100] $r7 clear b32 $r4 cmd_exec_init_src_surface: bclr $flags $p2 clear b32 $r5 xbit $r15 $r3 4 bra e #src_tiled call #cmd_exec_set_surface_linear bra #cmd_exec_init_dst_surface src_tiled: call #cmd_exec_set_surface_tiled bset $r4 7 cmd_exec_init_dst_surface: bset $flags $p2 mov $r5 #ctx_dst_address_high - #ctx_src_address_high xbit $r15 $r3 8 bra e #dst_tiled call #cmd_exec_set_surface_linear bra #cmd_exec_kick dst_tiled: call #cmd_exec_set_surface_tiled bset $r4 8 cmd_exec_kick: mov $r5 0x800 shl b32 $r5 6 ld b32 $r6 D[$r0 + #ctx_ycnt] iowr I[$r5 + 0x100] $r6 mov $r6 0x0041 // SRC_TARGET = 1, DST_TARGET = 2 sethi $r6 0x44000000 or $r4 $r6 iowr I[$r5] $r4 // if requested, queue up a QUERY write after the copy has completed xbit $r15 $r3 12 bra e #cmd_exec_done call #cmd_exec_query cmd_exec_done: ret // Flush write cache // // Inputs: // $r1: irqh state // $r2: hostirq state // $r3: data // $r4: dispatch table entry // Outputs: // $r1: irqh state // $p1: set on error // $r2: hostirq state // $r3: data cmd_wrcache_flush: mov $r2 0x2200 clear b32 $r3 sethi $r3 0x10000 iowr I[$r2] $r3 ret .align 0x100
{ "pile_set_name": "Github" }
maxcpus=8 nr_cpus=43 rcutree.gp_preinit_delay=3 rcutree.gp_init_delay=3 rcutree.gp_cleanup_delay=3 rcu_nocbs=0 rcutorture.fwd_progress=0
{ "pile_set_name": "Github" }
% Generated by roxygen2: do not edit by hand % Please edit documentation in R/relocate.R \name{relocate} \alias{relocate} \title{Change column order} \usage{ relocate(.data, ..., .before = NULL, .after = NULL) } \arguments{ \item{.data}{A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). See \emph{Methods}, below, for more details.} \item{...}{<\code{\link[=dplyr_tidy_select]{tidy-select}}> Columns to move.} \item{.before, .after}{<\code{\link[=dplyr_tidy_select]{tidy-select}}> Destination of columns selected by \code{...}. Supplying neither will move columns to the left-hand side; specifying both is an error.} } \value{ An object of the same type as \code{.data}. The output has the following properties: \itemize{ \item Rows are not affected. \item The same columns appear in the output, but (usually) in a different place. \item Data frame attributes are preserved. \item Groups are not affected. } } \description{ Use \code{relocate()} to change column positions, using the same syntax as \code{select()} to make it easy to move blocks of columns at once. } \section{Methods}{ This function is a \strong{generic}, which means that packages can provide implementations (methods) for other classes. See the documentation of individual methods for extra arguments and differences in behaviour. The following methods are currently available in loaded packages: \Sexpr[stage=render,results=rd]{dplyr:::methods_rd("relocate")}. } \examples{ df <- tibble(a = 1, b = 1, c = 1, d = "a", e = "a", f = "a") df \%>\% relocate(f) df \%>\% relocate(a, .after = c) df \%>\% relocate(f, .before = b) df \%>\% relocate(a, .after = last_col()) # Can also select variables based on their type df \%>\% relocate(where(is.character)) df \%>\% relocate(where(is.numeric), .after = last_col()) # Or with any other select helper df \%>\% relocate(any_of(c("a", "e", "i", "o", "u"))) # When .before or .after refers to multiple variables they will be # moved to be immediately before/after the selected variables. df2 <- tibble(a = 1, b = "a", c = 1, d = "a") df2 \%>\% relocate(where(is.numeric), .after = where(is.character)) df2 \%>\% relocate(where(is.numeric), .before = where(is.character)) }
{ "pile_set_name": "Github" }
Language: C# NuGet: Dapper SourceCode: https://github.com/StackExchange/Dapper Tags: - ORM DiscoveryDate: 5/13/2020
{ "pile_set_name": "Github" }
******************************************************************************** Gitblit SSL Client Certificate for $serverHostname ******************************************************************************** Hello $userDisplayname, Your private key, public certificate, and the Gitblit Certificate Authority certificate for $serverHostname are stored in $username.p12, a PKCS#12 certificate store[1], and also in $username.pem, a PEM certificate store. Both of these certificate stores are password-protected. Password Hint: $storePasswordHint Git (All) Installation Instructions ============================================= The provided PEM file can be directly used by your git client. git config [--global] http.sslCert path/to/$username.pem The supplied PEM file is password-protected and you may be prompted for your password multiple times during an exchange with Gitblit. If you desire a password-less git client workflow then you will need to decrypt and export your private key with OpenSSL[2] and then update your git config to use that key. openssl rsa -in path/to/$username.pem -out path/to/$username.key git config [--global] http.sslKey path/to/$username.key Obviously, you should protect access to any decrypted private key. NOTE: Some older git clients may have trouble using the PEM file without explicitly extracting the private key. This has been observed, for example, on Ubuntu 12.04 with git 1.7.9.5. Firefox (All) Installation Instructions ============================================= Firefox maintains it's own certificate store which is separate from the operating system. 1. Navigate to Options->Advanced->Encryption 2. Click "View Certificates" 3. Switch to the "Your Certificates" tab 4. Click "Import..." 5. Navigate your filesystem and select $username.p12 6. At the password prompt enter the certificate store password You have now imported your private key, public certificate, and the CA certificate but now we must manually set the trust settings of the CA certificate. 7. Switch to the "Authorities" tab 8. Scroll down and find "Gitblit-> Gitblit Certificate Authority" 9. Select it and click "Edit Trust..." 10. Check "This certificate can identify websites" and click OK. Chrome/IE (Windows) Installation Instructions ============================================= On Windows, Chrome and IE share their certificate store so configuring one will automatically apply for both. IE ------------------------------------ 1. Navigate to Internet Options->Content 2. Click the "Certificates" button Chrome ------------------------------------ 1. Navigate to Settings->Show Advanced Settings->HTTP/SSL 2. Click the "Manage Certificates..." button Both (Windows) ------------------------------------ 3. Switch to the "Personal" tab 4. Click the "Import..." button 5. Follow the Import Wizard instructions. You will need to change the selected file filter when navigating to $username.p12 6. At the password prompt enter the certificate store password 7. Because both your personal certificate and the CA certifcate are stored in $username.p12, you must choose "Automatically select the certificate store based on the type of certificate". If you choose the default you will not install the CA certificate. Chrome (Linux) Installation Instructions ============================================= On Linux, Chrome maintains it's own certificate store. 1. Navigate to Settings->Show Advanced Settings->HTTP/SSL 2. Click the "Manage Certificates..." button 3. Navigate your filesystem and select $username.p12 4. At the password prompt enter the certificate store password You have now imported your private key, public certificate, and the CA certificate but now we must manually set the trust settings of the CA certificate. 5. Switch to the "Authorities" tab 6. Scroll down and find "Gitblit-> Gitblit Certificate Authority" 7. Select it and click "Edit Trust..." 8. Check "This certificate can identify websites" and click OK. Chrome/Safari (Mac OS X) Installation Instructions ============================================= On Mac OS X, Chrome and Safari both use Keychain Access to store certificates so configuring one will automatically apply for both. 1. Double-click $username.pem 2. At the password prompt enter the certificate store password You have now imported your private key, public certificate, and the CA certificate but now we must manually set the trust settings of the CA certificate. 3. Find the Gitblit Certificate Authority certificate, it should have a red indicator meaning untrusted, and double-click it. 4. Open the "Trust" disclosure triangle and change "When using this certificate" to "Always Trust". 5. Close the certificate view and enter your system password to save the changes to your keychain. [1] PKCS#12 is one of the standard container formats for sharing private keys and public certificates. [2] http://www.openssl.org
{ "pile_set_name": "Github" }
# Quick Reviews 6/5/2019 ## Add protected SecurityDescriptor to ObjectSecurity **Approved** | [#corefx/35993](https://github.com/dotnet/corefx/issues/35993) | [Video](https://www.youtube.com/watch?v=CJLCnj82kSA&t=-2h-47m-50s)
{ "pile_set_name": "Github" }
" A trait for test purposes " Trait { #name : #TCloneTest, #category : #'Collections-Abstract-Tests-Traits' } { #category : #helper } TCloneTest >> empty [ ^ self explicitRequirement ] { #category : #helper } TCloneTest >> nonEmpty [ ^ self explicitRequirement ] { #category : #'tests - fixture' } TCloneTest >> test0FixtureCloneTest [ self nonEmpty. self denyEmpty: self nonEmpty. self empty. self assertEmpty: self empty ] { #category : #'tests - copy - clone' } TCloneTest >> testCopyCreatesNewObject [ | copy | copy := self nonEmpty copy. self deny: self nonEmpty == copy. ] { #category : #'tests - copy - clone' } TCloneTest >> testCopyEmpty [ self assertEmpty: self empty copy ] { #category : #'tests - copy - clone' } TCloneTest >> testCopyNonEmpty [ | copy | copy := self nonEmpty copy. self denyEmpty: copy. self assert: copy size = self nonEmpty size. self nonEmpty do: [ :each | copy includes: each ] ]
{ "pile_set_name": "Github" }
/* _________________________________________________________________________ * * Tachyon : A Self-Hosted JavaScript Virtual Machine * * * This file is part of the Tachyon JavaScript project. Tachyon is * distributed at: * http://github.com/Tachyon-Team/Tachyon * * * Copyright (c) 2011, Universite de Montreal * All rights reserved. * * This software is licensed under the following license (Modified BSD * License): * * 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 the Universite de Montreal 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 UNIVERSITE DE * MONTREAL 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. * _________________________________________________________________________ */ function bubbleSort(list, compOp) { do { var swapped = false; for (i = 1; i < list.length; ++i) { if (compOp(list[i-1], list[i])) { var temp = list[i-1]; list[i-1] = list[i]; list[i] = temp; swapped = true; } } } while (swapped); } function numCompOp(x, y) { return x > y; } function test() { var list = [4,6,34,5,6,8,1,-5,2,7]; var sorted = [-5,1,2,4,5,6,6,7,8,34]; bubbleSort(list, numCompOp); if (String(list) != String(sorted)) return 1; return 0; }
{ "pile_set_name": "Github" }
export declare type ScalabilityMode = { spatialLayers: number; temporalLayers: number; }; export declare function parse(scalabilityMode?: string): ScalabilityMode; //# sourceMappingURL=scalabilityModes.d.ts.map
{ "pile_set_name": "Github" }
require 'spec_helper' describe AccountReadPolicy do let(:account) { double('Account') } let(:user) { double('User') } subject { described_class.new(account, user) } it "grants users access" do allow(account).to receive(:users).and_return( double('Users', include?: true) ) expect(subject).to be_access end it "rejects non-users access" do allow(account).to receive(:users).and_return( double('Users', include?: false) ) expect(subject).to_not be_access end end
{ "pile_set_name": "Github" }
// Copyright 2016 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.api.ads.adwords.awreporting.model.entities; import com.google.api.ads.adwords.awreporting.model.csv.annotation.CsvField; import com.google.api.ads.adwords.awreporting.model.csv.annotation.CsvReport; import com.google.api.ads.adwords.awreporting.model.csv.annotation.MoneyField; import com.google.api.ads.adwords.awreporting.model.util.BigDecimalUtil; import com.google.api.ads.adwords.lib.jaxb.v201809.ReportDefinitionReportType; import java.math.BigDecimal; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; /** * Specific report class for BudgetPerformanceReport. * */ @Entity @Table(name = "AW_BudgetPerformanceReport") @CsvReport(value = ReportDefinitionReportType.BUDGET_PERFORMANCE_REPORT) public class BudgetPerformanceReport extends Report { @Column(name = "DeliveryMethod") @CsvField(value = "Delivery method", reportField = "DeliveryMethod") private String deliveryMethod; @Column(name = "Period") @CsvField(value = "Budget period", reportField = "Period") private String period; @Column(name = "AccountDescriptiveName") @CsvField(value = "Account", reportField = "AccountDescriptiveName") private String accountDescriptiveName; @Column(name = "AllConversionRate") @CsvField(value = "All conv. rate", reportField = "AllConversionRate") private BigDecimal allConversionRate; @Column(name = "AllConversions") @CsvField(value = "All conv.", reportField = "AllConversions") private BigDecimal allConversions; @Column(name = "AllConversionValue") @CsvField(value = "All conv. value", reportField = "AllConversionValue") private BigDecimal allConversionValue; @Column(name = "Amount") @CsvField(value = "Budget", reportField = "Amount") @MoneyField private BigDecimal amount; @Column(name = "AssociatedCampaignId") @CsvField(value = "Campaign ID", reportField = "AssociatedCampaignId") private Long associatedCampaignId; @Column(name = "AssociatedCampaignName") @CsvField(value = "Campaign", reportField = "AssociatedCampaignName") private String associatedCampaignName; @Column(name = "AssociatedCampaignStatus") @CsvField(value = "Campaign state", reportField = "AssociatedCampaignStatus") private String associatedCampaignStatus; @Column(name = "AverageCost") @CsvField(value = "Avg. Cost", reportField = "AverageCost") @MoneyField private BigDecimal averageCost; @Column(name = "AverageCpc") @CsvField(value = "Avg. CPC", reportField = "AverageCpc") @MoneyField private BigDecimal averageCpc; @Column(name = "AverageCpe") @CsvField(value = "Avg. CPE", reportField = "AverageCpe") private BigDecimal averageCpe; @Column(name = "AverageCpm") @CsvField(value = "Avg. CPM", reportField = "AverageCpm") @MoneyField private BigDecimal averageCpm; @Column(name = "AverageCpv") @CsvField(value = "Avg. CPV", reportField = "AverageCpv") private BigDecimal averageCpv; @Column(name = "AveragePosition") @CsvField(value = "Avg. position", reportField = "AveragePosition") private BigDecimal averagePosition; @Column(name = "BudgetCampaignAssociationStatus") @CsvField(value = "Budget usage", reportField = "BudgetCampaignAssociationStatus") private String budgetCampaignAssociationStatus; @Column(name = "BudgetId") @CsvField(value = "Budget ID", reportField = "BudgetId") private Long budgetId; @Column(name = "BudgetName") @CsvField(value = "Budget Name", reportField = "BudgetName") private String budgetName; @Column(name = "BudgetReferenceCount") @CsvField(value = "# Campaigns", reportField = "BudgetReferenceCount") private Integer budgetReferenceCount; @Column(name = "BudgetStatus") @CsvField(value = "Budget state", reportField = "BudgetStatus") private String budgetStatus; @Column(name = "Clicks") @CsvField(value = "Clicks", reportField = "Clicks") private Long clicks; @Column(name = "ConversionCategoryName") @CsvField(value = "Conversion category", reportField = "ConversionCategoryName") private String conversionCategoryName; @Column(name = "ConversionRate") @CsvField(value = "Conv. rate", reportField = "ConversionRate") private BigDecimal conversionRate; @Column(name = "Conversions") @CsvField(value = "Conversions", reportField = "Conversions") private BigDecimal conversions; @Column(name = "ConversionTrackerId") @CsvField(value = "Conversion Tracker Id", reportField = "ConversionTrackerId") private Long conversionTrackerId; @Column(name = "ConversionTypeName") @CsvField(value = "Conversion name", reportField = "ConversionTypeName") private String conversionTypeName; @Column(name = "ConversionValue") @CsvField(value = "Total conv. value", reportField = "ConversionValue") private BigDecimal conversionValue; @Column(name = "Cost") @CsvField(value = "Cost", reportField = "Cost") @MoneyField private BigDecimal cost; @Column(name = "CostPerAllConversion") @CsvField(value = "Cost / all conv.", reportField = "CostPerAllConversion") @MoneyField private BigDecimal costPerAllConversion; @Column(name = "CostPerConversion") @CsvField(value = "Cost / conv.", reportField = "CostPerConversion") @MoneyField private BigDecimal costPerConversion; @Column(name = "CrossDeviceConversions") @CsvField(value = "Cross-device conv.", reportField = "CrossDeviceConversions") private BigDecimal crossDeviceConversions; @Column(name = "Ctr") @CsvField(value = "CTR", reportField = "Ctr") private BigDecimal ctr; @Column(name = "EngagementRate") @CsvField(value = "Engagement rate", reportField = "EngagementRate") private BigDecimal engagementRate; @Column(name = "Engagements") @CsvField(value = "Engagements", reportField = "Engagements") private Long engagements; @Column(name = "ExternalConversionSource") @CsvField(value = "Conversion source", reportField = "ExternalConversionSource") private String externalConversionSource; @Column(name = "HasRecommendedBudget") @CsvField(value = "Has recommended Budget", reportField = "HasRecommendedBudget") private String hasRecommendedBudget; @Column(name = "Impressions") @CsvField(value = "Impressions", reportField = "Impressions") private Long impressions; @Column(name = "InteractionRate") @CsvField(value = "Interaction Rate", reportField = "InteractionRate") private BigDecimal interactionRate; @Column(name = "Interactions") @CsvField(value = "Interactions", reportField = "Interactions") private Long interactions; @Column(name = "InteractionTypes") @CsvField(value = "Interaction Types", reportField = "InteractionTypes") private String interactionTypes; @Column(name = "IsBudgetExplicitlyShared") @CsvField(value = "Explicitly shared", reportField = "IsBudgetExplicitlyShared") private String isBudgetExplicitlyShared; @Column(name = "RecommendedBudgetAmount") @CsvField(value = "Recommended Budget amount", reportField = "RecommendedBudgetAmount") @MoneyField private BigDecimal recommendedBudgetAmount; @Column(name = "RecommendedBudgetEstimatedChangeInWeeklyClicks") @CsvField(value = "Estimated change in weekly clicks at recommended Budget", reportField = "RecommendedBudgetEstimatedChangeInWeeklyClicks") private Long recommendedBudgetEstimatedChangeInWeeklyClicks; @Column(name = "RecommendedBudgetEstimatedChangeInWeeklyCost") @CsvField(value = "Estimated change in weekly cost at recommended Budget", reportField = "RecommendedBudgetEstimatedChangeInWeeklyCost") @MoneyField private BigDecimal recommendedBudgetEstimatedChangeInWeeklyCost; @Column(name = "RecommendedBudgetEstimatedChangeInWeeklyInteractions") @CsvField(value = "Estimated change in weekly interactions at recommended Budget", reportField = "RecommendedBudgetEstimatedChangeInWeeklyInteractions") private Long recommendedBudgetEstimatedChangeInWeeklyInteractions; @Column(name = "RecommendedBudgetEstimatedChangeInWeeklyViews") @CsvField(value = "Estimated change in weekly views at recommended Budget", reportField = "RecommendedBudgetEstimatedChangeInWeeklyViews") private Long recommendedBudgetEstimatedChangeInWeeklyViews; @Column(name = "TotalAmount") @CsvField(value = "Total Budget amount", reportField = "TotalAmount") @MoneyField private BigDecimal totalAmount; @Column(name = "ValuePerAllConversion") @CsvField(value = "Value / all conv.", reportField = "ValuePerAllConversion") private BigDecimal valuePerAllConversion; @Column(name = "ValuePerConversion") @CsvField(value = "Value / conv.", reportField = "ValuePerConversion") private BigDecimal valuePerConversion; @Column(name = "VideoViewRate") @CsvField(value = "View rate", reportField = "VideoViewRate") private BigDecimal videoViewRate; @Column(name = "VideoViews") @CsvField(value = "Views", reportField = "VideoViews") private Long videoViews; @Column(name = "ViewThroughConversions") @CsvField(value = "View-through conv.", reportField = "ViewThroughConversions") private Long viewThroughConversions; /** * Hibernate needs an empty constructor */ public BudgetPerformanceReport() { } public BudgetPerformanceReport(Long topAccountId, Long accountId){ super(topAccountId, accountId); } public String getDeliveryMethod() { return deliveryMethod; } public void setDeliveryMethod(String deliveryMethod) { this.deliveryMethod = deliveryMethod; } public String getPeriod() { return period; } public void setPeriod(String period) { this.period = period; } public String getAccountDescriptiveName() { return accountDescriptiveName; } public void setAccountDescriptiveName(String accountDescriptiveName) { this.accountDescriptiveName = accountDescriptiveName; } public String getAllConversionRate() { return BigDecimalUtil.formatAsReadable(allConversionRate); } public BigDecimal getAllConversionRateBigDecimal() { return allConversionRate; } public void setAllConversionRate(String allConversionRate) { this.allConversionRate = BigDecimalUtil.parseFromNumberString(allConversionRate); } public String getAllConversions() { return BigDecimalUtil.formatAsReadable(allConversions); } public BigDecimal getAllConversionsBigDecimal() { return allConversions; } public void setAllConversions(String allConversions) { this.allConversions = BigDecimalUtil.parseFromNumberString(allConversions); } public String getAllConversionValue() { return BigDecimalUtil.formatAsReadable(allConversionValue); } public BigDecimal getAllConversionValueBigDecimal() { return allConversionValue; } public void setAllConversionValue(String allConversionValue) { this.allConversionValue = BigDecimalUtil.parseFromNumberString(allConversionValue); } public BigDecimal getAmount() { return amount; } public void setAmount(BigDecimal amount) { this.amount = amount; } public Long getAssociatedCampaignId() { return associatedCampaignId; } public void setAssociatedCampaignId(Long associatedCampaignId) { this.associatedCampaignId = associatedCampaignId; } public String getAssociatedCampaignName() { return associatedCampaignName; } public void setAssociatedCampaignName(String associatedCampaignName) { this.associatedCampaignName = associatedCampaignName; } public String getAssociatedCampaignStatus() { return associatedCampaignStatus; } public void setAssociatedCampaignStatus(String associatedCampaignStatus) { this.associatedCampaignStatus = associatedCampaignStatus; } public BigDecimal getAverageCost() { return averageCost; } public void setAverageCost(BigDecimal averageCost) { this.averageCost = averageCost; } public BigDecimal getAverageCpc() { return averageCpc; } public void setAverageCpc(BigDecimal averageCpc) { this.averageCpc = averageCpc; } public String getAverageCpe() { return BigDecimalUtil.formatAsReadable(averageCpe); } public BigDecimal getAverageCpeBigDecimal() { return averageCpe; } public void setAverageCpe(String averageCpe) { this.averageCpe = BigDecimalUtil.parseFromNumberString(averageCpe); } public BigDecimal getAverageCpm() { return averageCpm; } public void setAverageCpm(BigDecimal averageCpm) { this.averageCpm = averageCpm; } public String getAverageCpv() { return BigDecimalUtil.formatAsReadable(averageCpv); } public BigDecimal getAverageCpvBigDecimal() { return averageCpv; } public void setAverageCpv(String averageCpv) { this.averageCpv = BigDecimalUtil.parseFromNumberString(averageCpv); } public String getAveragePosition() { return BigDecimalUtil.formatAsReadable(averagePosition); } public BigDecimal getAveragePositionBigDecimal() { return averagePosition; } public void setAveragePosition(String averagePosition) { this.averagePosition = BigDecimalUtil.parseFromNumberString(averagePosition); } public String getBudgetCampaignAssociationStatus() { return budgetCampaignAssociationStatus; } public void setBudgetCampaignAssociationStatus(String budgetCampaignAssociationStatus) { this.budgetCampaignAssociationStatus = budgetCampaignAssociationStatus; } public Long getBudgetId() { return budgetId; } public void setBudgetId(Long budgetId) { this.budgetId = budgetId; } public String getBudgetName() { return budgetName; } public void setBudgetName(String budgetName) { this.budgetName = budgetName; } public Integer getBudgetReferenceCount() { return budgetReferenceCount; } public void setBudgetReferenceCount(Integer budgetReferenceCount) { this.budgetReferenceCount = budgetReferenceCount; } public String getBudgetStatus() { return budgetStatus; } public void setBudgetStatus(String budgetStatus) { this.budgetStatus = budgetStatus; } public Long getClicks() { return clicks; } public void setClicks(Long clicks) { this.clicks = clicks; } public String getConversionCategoryName() { return conversionCategoryName; } public void setConversionCategoryName(String conversionCategoryName) { this.conversionCategoryName = conversionCategoryName; } public String getConversionRate() { return BigDecimalUtil.formatAsReadable(conversionRate); } public BigDecimal getConversionRateBigDecimal() { return conversionRate; } public void setConversionRate(String conversionRate) { this.conversionRate = BigDecimalUtil.parseFromNumberString(conversionRate); } public String getConversions() { return BigDecimalUtil.formatAsReadable(conversions); } public BigDecimal getConversionsBigDecimal() { return conversions; } public void setConversions(String conversions) { this.conversions = BigDecimalUtil.parseFromNumberString(conversions); } public Long getConversionTrackerId() { return conversionTrackerId; } public void setConversionTrackerId(Long conversionTrackerId) { this.conversionTrackerId = conversionTrackerId; } public String getConversionTypeName() { return conversionTypeName; } public void setConversionTypeName(String conversionTypeName) { this.conversionTypeName = conversionTypeName; } public String getConversionValue() { return BigDecimalUtil.formatAsReadable(conversionValue); } public BigDecimal getConversionValueBigDecimal() { return conversionValue; } public void setConversionValue(String conversionValue) { this.conversionValue = BigDecimalUtil.parseFromNumberString(conversionValue); } public BigDecimal getCost() { return cost; } public void setCost(BigDecimal cost) { this.cost = cost; } public BigDecimal getCostPerAllConversion() { return costPerAllConversion; } public void setCostPerAllConversion(BigDecimal costPerAllConversion) { this.costPerAllConversion = costPerAllConversion; } public BigDecimal getCostPerConversion() { return costPerConversion; } public void setCostPerConversion(BigDecimal costPerConversion) { this.costPerConversion = costPerConversion; } public String getCrossDeviceConversions() { return BigDecimalUtil.formatAsReadable(crossDeviceConversions); } public BigDecimal getCrossDeviceConversionsBigDecimal() { return crossDeviceConversions; } public void setCrossDeviceConversions(String crossDeviceConversions) { this.crossDeviceConversions = BigDecimalUtil.parseFromNumberString(crossDeviceConversions); } public String getCtr() { return BigDecimalUtil.formatAsReadable(ctr); } public BigDecimal getCtrBigDecimal() { return ctr; } public void setCtr(String ctr) { this.ctr = (ctr == null ? null : BigDecimalUtil.parseFromNumberString(ctr.replace("%",""))); } public String getEngagementRate() { return BigDecimalUtil.formatAsReadable(engagementRate); } public BigDecimal getEngagementRateBigDecimal() { return engagementRate; } public void setEngagementRate(String engagementRate) { this.engagementRate = BigDecimalUtil.parseFromNumberString(engagementRate); } public Long getEngagements() { return engagements; } public void setEngagements(Long engagements) { this.engagements = engagements; } public String getExternalConversionSource() { return externalConversionSource; } public void setExternalConversionSource(String externalConversionSource) { this.externalConversionSource = externalConversionSource; } public String getHasRecommendedBudget() { return hasRecommendedBudget; } public void setHasRecommendedBudget(String hasRecommendedBudget) { this.hasRecommendedBudget = hasRecommendedBudget; } public Long getImpressions() { return impressions; } public void setImpressions(Long impressions) { this.impressions = impressions; } public String getInteractionRate() { return BigDecimalUtil.formatAsReadable(interactionRate); } public BigDecimal getInteractionRateBigDecimal() { return interactionRate; } public void setInteractionRate(String interactionRate) { this.interactionRate = BigDecimalUtil.parseFromNumberString(interactionRate); } public Long getInteractions() { return interactions; } public void setInteractions(Long interactions) { this.interactions = interactions; } public String getInteractionTypes() { return interactionTypes; } public void setInteractionTypes(String interactionTypes) { this.interactionTypes = interactionTypes; } public String getIsBudgetExplicitlyShared() { return isBudgetExplicitlyShared; } public void setIsBudgetExplicitlyShared(String isBudgetExplicitlyShared) { this.isBudgetExplicitlyShared = isBudgetExplicitlyShared; } public BigDecimal getRecommendedBudgetAmount() { return recommendedBudgetAmount; } public void setRecommendedBudgetAmount(BigDecimal recommendedBudgetAmount) { this.recommendedBudgetAmount = recommendedBudgetAmount; } public Long getRecommendedBudgetEstimatedChangeInWeeklyClicks() { return recommendedBudgetEstimatedChangeInWeeklyClicks; } public void setRecommendedBudgetEstimatedChangeInWeeklyClicks(Long recommendedBudgetEstimatedChangeInWeeklyClicks) { this.recommendedBudgetEstimatedChangeInWeeklyClicks = recommendedBudgetEstimatedChangeInWeeklyClicks; } public BigDecimal getRecommendedBudgetEstimatedChangeInWeeklyCost() { return recommendedBudgetEstimatedChangeInWeeklyCost; } public void setRecommendedBudgetEstimatedChangeInWeeklyCost(BigDecimal recommendedBudgetEstimatedChangeInWeeklyCost) { this.recommendedBudgetEstimatedChangeInWeeklyCost = recommendedBudgetEstimatedChangeInWeeklyCost; } public Long getRecommendedBudgetEstimatedChangeInWeeklyInteractions() { return recommendedBudgetEstimatedChangeInWeeklyInteractions; } public void setRecommendedBudgetEstimatedChangeInWeeklyInteractions(Long recommendedBudgetEstimatedChangeInWeeklyInteractions) { this.recommendedBudgetEstimatedChangeInWeeklyInteractions = recommendedBudgetEstimatedChangeInWeeklyInteractions; } public Long getRecommendedBudgetEstimatedChangeInWeeklyViews() { return recommendedBudgetEstimatedChangeInWeeklyViews; } public void setRecommendedBudgetEstimatedChangeInWeeklyViews(Long recommendedBudgetEstimatedChangeInWeeklyViews) { this.recommendedBudgetEstimatedChangeInWeeklyViews = recommendedBudgetEstimatedChangeInWeeklyViews; } public BigDecimal getTotalAmount() { return totalAmount; } public void setTotalAmount(BigDecimal totalAmount) { this.totalAmount = totalAmount; } public String getValuePerAllConversion() { return BigDecimalUtil.formatAsReadable(valuePerAllConversion); } public BigDecimal getValuePerAllConversionBigDecimal() { return valuePerAllConversion; } public void setValuePerAllConversion(String valuePerAllConversion) { this.valuePerAllConversion = BigDecimalUtil.parseFromNumberString(valuePerAllConversion); } public String getValuePerConversion() { return BigDecimalUtil.formatAsReadable(valuePerConversion); } public BigDecimal getValuePerConversionBigDecimal() { return valuePerConversion; } public void setValuePerConversion(String valuePerConversion) { this.valuePerConversion = BigDecimalUtil.parseFromNumberString(valuePerConversion); } public String getVideoViewRate() { return BigDecimalUtil.formatAsReadable(videoViewRate); } public BigDecimal getVideoViewRateBigDecimal() { return videoViewRate; } public void setVideoViewRate(String videoViewRate) { this.videoViewRate = BigDecimalUtil.parseFromNumberString(videoViewRate); } public Long getVideoViews() { return videoViews; } public void setVideoViews(Long videoViews) { this.videoViews = videoViews; } public Long getViewThroughConversions() { return viewThroughConversions; } public void setViewThroughConversions(Long viewThroughConversions) { this.viewThroughConversions = viewThroughConversions; } @Override public void setRowId() { // General fields for generating unique id. StringBuilder idBuilder = new StringBuilder(getCustomerId().toString()); if (budgetId != null) { idBuilder.append("-").append(budgetId); } // Include all segmentation fields (if set). if (associatedCampaignId != null) { idBuilder.append("-").append(associatedCampaignId); } if (!StringUtils.isEmpty(associatedCampaignName)) { idBuilder.append("-").append(associatedCampaignName); } if (!StringUtils.isEmpty(associatedCampaignStatus)) { idBuilder.append("-").append(associatedCampaignStatus); } if (!StringUtils.isEmpty(budgetCampaignAssociationStatus)) { idBuilder.append("-").append(budgetCampaignAssociationStatus); } if (!StringUtils.isEmpty(conversionCategoryName)) { idBuilder.append("-").append(conversionCategoryName); } if (conversionTrackerId != null) { idBuilder.append("-").append(conversionTrackerId); } if (!StringUtils.isEmpty(conversionTypeName)) { idBuilder.append("-").append(conversionTypeName); } if (!StringUtils.isEmpty(externalConversionSource)) { idBuilder.append("-").append(externalConversionSource); } this.rowId = idBuilder.toString(); } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (obj.getClass() != getClass()) { return false; } BudgetPerformanceReport other = (BudgetPerformanceReport) obj; return new EqualsBuilder() .appendSuper(super.equals(obj)) .append(deliveryMethod, other.deliveryMethod) .append(period, other.period) .append(accountDescriptiveName, other.accountDescriptiveName) .append(allConversionRate, other.allConversionRate) .append(allConversions, other.allConversions) .append(allConversionValue, other.allConversionValue) .append(amount, other.amount) .append(associatedCampaignId, other.associatedCampaignId) .append(associatedCampaignName, other.associatedCampaignName) .append(associatedCampaignStatus, other.associatedCampaignStatus) .append(averageCost, other.averageCost) .append(averageCpc, other.averageCpc) .append(averageCpe, other.averageCpe) .append(averageCpm, other.averageCpm) .append(averageCpv, other.averageCpv) .append(averagePosition, other.averagePosition) .append(budgetCampaignAssociationStatus, other.budgetCampaignAssociationStatus) .append(budgetId, other.budgetId) .append(budgetName, other.budgetName) .append(budgetReferenceCount, other.budgetReferenceCount) .append(budgetStatus, other.budgetStatus) .append(clicks, other.clicks) .append(conversionCategoryName, other.conversionCategoryName) .append(conversionRate, other.conversionRate) .append(conversions, other.conversions) .append(conversionTrackerId, other.conversionTrackerId) .append(conversionTypeName, other.conversionTypeName) .append(conversionValue, other.conversionValue) .append(cost, other.cost) .append(costPerAllConversion, other.costPerAllConversion) .append(costPerConversion, other.costPerConversion) .append(crossDeviceConversions, other.crossDeviceConversions) .append(ctr, other.ctr) .append(engagementRate, other.engagementRate) .append(engagements, other.engagements) .append(externalConversionSource, other.externalConversionSource) .append(hasRecommendedBudget, other.hasRecommendedBudget) .append(impressions, other.impressions) .append(interactionRate, other.interactionRate) .append(interactions, other.interactions) .append(interactionTypes, other.interactionTypes) .append(isBudgetExplicitlyShared, other.isBudgetExplicitlyShared) .append(recommendedBudgetAmount, other.recommendedBudgetAmount) .append(recommendedBudgetEstimatedChangeInWeeklyClicks, other.recommendedBudgetEstimatedChangeInWeeklyClicks) .append(recommendedBudgetEstimatedChangeInWeeklyCost, other.recommendedBudgetEstimatedChangeInWeeklyCost) .append(recommendedBudgetEstimatedChangeInWeeklyInteractions, other.recommendedBudgetEstimatedChangeInWeeklyInteractions) .append(recommendedBudgetEstimatedChangeInWeeklyViews, other.recommendedBudgetEstimatedChangeInWeeklyViews) .append(totalAmount, other.totalAmount) .append(valuePerAllConversion, other.valuePerAllConversion) .append(valuePerConversion, other.valuePerConversion) .append(videoViewRate, other.videoViewRate) .append(videoViews, other.videoViews) .append(viewThroughConversions, other.viewThroughConversions) .isEquals(); } @Override public int hashCode() { return new HashCodeBuilder(17, 37) .appendSuper(super.hashCode()) .append(deliveryMethod) .append(period) .append(accountDescriptiveName) .append(allConversionRate) .append(allConversions) .append(allConversionValue) .append(amount) .append(associatedCampaignId) .append(associatedCampaignName) .append(associatedCampaignStatus) .append(averageCost) .append(averageCpc) .append(averageCpe) .append(averageCpm) .append(averageCpv) .append(averagePosition) .append(budgetCampaignAssociationStatus) .append(budgetId) .append(budgetName) .append(budgetReferenceCount) .append(budgetStatus) .append(clicks) .append(conversionCategoryName) .append(conversionRate) .append(conversions) .append(conversionTrackerId) .append(conversionTypeName) .append(conversionValue) .append(cost) .append(costPerAllConversion) .append(costPerConversion) .append(crossDeviceConversions) .append(ctr) .append(engagementRate) .append(engagements) .append(externalConversionSource) .append(hasRecommendedBudget) .append(impressions) .append(interactionRate) .append(interactions) .append(interactionTypes) .append(isBudgetExplicitlyShared) .append(recommendedBudgetAmount) .append(recommendedBudgetEstimatedChangeInWeeklyClicks) .append(recommendedBudgetEstimatedChangeInWeeklyCost) .append(recommendedBudgetEstimatedChangeInWeeklyInteractions) .append(recommendedBudgetEstimatedChangeInWeeklyViews) .append(totalAmount) .append(valuePerAllConversion) .append(valuePerConversion) .append(videoViewRate) .append(videoViews) .append(viewThroughConversions) .toHashCode(); } }
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.kafka.common.errors; public class NotControllerException extends RetriableException { private static final long serialVersionUID = 1L; public NotControllerException(String message) { super(message); } public NotControllerException(String message, Throwable cause) { super(message, cause); } }
{ "pile_set_name": "Github" }