text
stringlengths
2
100k
meta
dict
package org.jetbrains.dokka.javadoc.transformers.documentables import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.Platform import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer class JavadocDocumentableJVMSourceSetFilter(val context: DokkaContext) : PreMergeDocumentableTransformer { private val allowedSourceSets = context.configuration.sourceSets.filter { it.analysisPlatform == Platform.jvm } .flatMap { it.getAllDependentSourceSets() }.distinct() private fun DokkaConfiguration.DokkaSourceSet.getAllDependentSourceSets(): List<DokkaConfiguration.DokkaSourceSet> = dependentSourceSets.flatMap { setId -> context.configuration.sourceSets.find { it.sourceSetID == setId }?.getAllDependentSourceSets().orEmpty() } + this override fun invoke(modules: List<DModule>): List<DModule> = modules.filter { module -> allowedSourceSets.containsAll(module.sourceSets) } }
{ "pile_set_name": "Github" }
サン ムーン
{ "pile_set_name": "Github" }
Title: check_http: Improve WATO rule Level: 1 Component: checks Compatible: compat Edition: cre Version: 1.6.0b1 Date: 1553667609 Class: feature The WATO rule to configure the active check 'check_http' now provides a more user friendly way to configure proxy settings.
{ "pile_set_name": "Github" }
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <component xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/component/1.1.3 http://maven.apache.org/xsd/component-1.1.3.xsd"> <dependencySets> <!-- Put the playerglobal swc into the frameworks/libs/player directory --> <dependencySet> <useProjectArtifact>false</useProjectArtifact> <outputDirectory>frameworks/libs/player/${flash.version}</outputDirectory> <includes> <include>com.adobe.flash.framework:playerglobal:swc</include> </includes> <outputFileNameMapping>playerglobal.swc</outputFileNameMapping> </dependencySet> </dependencySets> </component>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?><!-- Copyright TEI Consortium. Dual-licensed under CC-by and BSD2 licences See the file COPYING.txt for details $Date$ $Id$ --><?xml-model href="http://jenkins.tei-c.org/job/TEIP5-dev/lastSuccessfulBuild/artifact/P5/release/xml/tei/odd/p5.nvdl" type="application/xml" schematypens="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"?><elementSpec xmlns="http://www.tei-c.org/ns/1.0" module="core" xml:id="BINARYOBJECT" ident="binaryObject"> <desc versionDate="2013-01-08" xml:lang="en">provides encoded binary data representing an inline graphic, audio, video or other object.</desc> <desc versionDate="2007-12-20" xml:lang="ko">인라인 그래픽 또는 다른 개체를 표상하는 부호화된 이진 데이터를 제시한다.</desc> <desc versionDate="2007-05-02" xml:lang="zh-TW">標記用來表示文本中圖檔或其他檔案的二進位資料。</desc> <desc versionDate="2008-04-21" xml:lang="ja">行中の画像やその他のオブジェクトを示す,符号化されたバイナリデータを 示す.</desc> <desc versionDate="2009-01-06" xml:lang="fr">fournit des données binaires encodées qui représentent une image ou un autre objet insérés dans le texte ou dans un autre objet.</desc> <desc versionDate="2007-05-04" xml:lang="es">proporciona datos binarios codificados que representan un objeto gráfico u otro tipo de objeto inserido en el texto.</desc> <desc versionDate="2007-01-21" xml:lang="it">assegna dati binary codificati che rappresentano un grafico o altro oggetto</desc> <classes> <memberOf key="att.global"/> <memberOf key="model.graphicLike"/> <memberOf key="model.titlepagePart"/> <memberOf key="att.media"/> <memberOf key="att.timed"/> <memberOf key="att.typed"/> </classes> <content> <textNode/> </content> <attList> <attDef ident="url" mode="delete"/> <attDef ident="encoding" usage="opt"> <desc versionDate="2007-06-14" xml:lang="en">The encoding used to encode the binary data. If not specified, this is assumed to be <ref target="http://en.wikipedia.org/wiki/Base64">Base64</ref>.</desc> <desc versionDate="2007-12-20" xml:lang="ko">부호화는 이진 데이터의 부호 변환 방식이다. 별도로 명시되어 있지 않다면, <ref target="http://en.wikipedia.org/wiki/Base64">Base64</ref>로 간주된다.</desc> <desc versionDate="2007-05-02" xml:lang="zh-TW">標記該二進位資料時所使用到的編碼。若未特別指明,則假定為使用Base64編碼</desc> <desc versionDate="2008-04-21" xml:lang="ja">当該バイナリデータの符号化方式.指定がなければ, <ref target="http://en.wikipedia.org/wiki/Base64">Base64</ref> と想定する.</desc> <desc versionDate="2009-01-06" xml:lang="fr">l'encodage utilisé pour encoder les données binaires. Sans autre spécification il est supposé s'agir de <ref target="http://en.wikipedia.org/wiki/Base64">Base64</ref>.</desc> <desc versionDate="2007-05-04" xml:lang="es">La codificación usada para codificar los datos binarios. Si no se espeficica, se supone que es Base64.</desc> <desc versionDate="2007-01-21" xml:lang="it">Codifica utilizzata per codificare dati binari. Se non specificata si presume che sia Base64</desc> <datatype maxOccurs="unbounded"><dataRef key="teidata.word"/></datatype> </attDef> </attList> <exemplum xml:lang="und"> <egXML xmlns="http://www.tei-c.org/ns/Examples"> <binaryObject mimeType="image/gif"> R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwy GHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkVJ +5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSpa/TPg7JpJHxyendzWTBfX0cxOnK PjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJlZeGl9i2icVqaNVailT6F5iJ90m6 mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3u Nna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH hhx4dbgYKAAA7</binaryObject> </egXML> </exemplum> <listRef> <ptr target="#COGR" type="div2"/> </listRef> </elementSpec>
{ "pile_set_name": "Github" }
Widgets ======= Los Widgets son bloques de código reutilizables utilizados en las [vistas](structure-views.md) para crear elementos de interfaz de usuario complejos y configurables de forma orientada a objetos. Por ejemplo, widget DatePicker puede generar un DatePicker de lujo que permita a los usuarios seleccionar una fecha. Todo lo que se tiene que hacer es insertar el siguiente código en una vista. ```php <?php use yii\jui\DatePicker; ?> <?= DatePicker::widget(['name' => 'date']) ?> ``` Hay un buen número de widgets incluidos en Yii, tales como [[yii\widgets\ActiveForm|active form]], [[yii\widgets\Menu|menu]], [Widgets de jQuery UI](widget-jui.md), [widgets de Twitter Bootstrap](widget-bootstrap.md). En adelante, introduciremos las nociones básicas acerca de los widgets. Por favor, refiérase a la documentación de la API de clases si quiere aprender más acerca de el uso de un widget en particular. ## Uso de los Widgets <span id="using-widgets"></span> Los Widgets son usados principalmente en las [vistas](structure-views.md). Se puede llamar al método [[yii\base\Widget::widget()]] para usar un widget en una vista. El método obtiene un array de [configuración](concept-configurations.md) para inicializar el widget y retorna la representación resultante del widget. Por ejemplo, el siguiente código inserta un widget DatePicker que esta configurado para usar el idioma Ruso y mantener la entrada en atributo 'form_date' del '$model'. ```php <?php use yii\jui\DatePicker; ?> <?= DatePicker::widget([ 'model' => $model, 'attribute' => 'from_date', 'language' => 'ru', 'clientOptions' => [ 'dateFormat' => 'yy-mm-dd', ], ]) ?> ``` Algunos widgets pueden coger un bloque de contenido que debería encontrarse entre la invocación de [[yii\base\Widget::begin()]] y [[yii\base\Widget::end()]]. Por ejemplo, el siguiente código usa el widget [[yii\widgets\ActiveForm]] para generar un formulario de inicio de sesión. El widget generará las etiquetas '<form>' de apertura y cierre donde sean llamados 'begin()' y 'end()', respectivamente. Cualquier cosa que este en medio será representado como tal. ```php <?php use yii\widgets\ActiveForm; use yii\helpers\Html; ?> <?php $form = ActiveForm::begin(['id' => 'login-form']); ?> <?= $form->field($model, 'username') ?> <?= $form->field($model, 'password')->passwordInput() ?> <div class="form-group"> <?= Html::submitButton('Login') ?> </div> <?php ActiveForm::end(); ?> ``` Hay que tener en cuenta que a diferencia de [[yii\base\Widget::widget()]] que devuelve la representación resultante del widget, el método [[yii\base\Widget::begin()]] devuelve una instancia del widget que se puede usar para generar el contenido del widget. ## Creación Widgets <span id="creating-widgets"></span> Para crear un widget, se debe extender a [[yii\base\Widget]] y sobrescribir los métodos [[yii\base\Widget::init()]] y/o [[yii\base\Widget::run()]]. Normalmente el método 'init()' debería contener el código que estandariza las propiedades del widget, mientras que el método 'run()' debería contener el código que genere la representación resultante del widget. La representación resultante puede ser "pintada" directamente o devuelta como una cadena por el método 'run()'. En el siguiente ejemplo, 'HelloWidget' codifica en HTML y muestra el contenido asignado a su propiedad 'message'. Si la propiedad no está establecida, mostrará "Hello World" por defecto. ```php namespace app\components; use yii\base\Widget; use yii\helpers\Html; class HelloWidget extends Widget { public $message; public function init() { parent::init(); if ($this->message === null) { $this->message = 'Hello World'; } } public function run() { return Html::encode($this->message); } } ``` Para usar este widget, simplemente inserte el siguiente código en una vista: ```php <?php use app\components\HelloWidget; ?> <?= HelloWidget::widget(['message' => 'Good morning']) ?> ``` Abajo se muestra una variante de 'HelloWidget' obtiene el contenido entre las llamadas 'begin()' y 'end()', lo codifica en HTML y posteriormente lo muestra. ```php namespace app\components; use yii\base\Widget; use yii\helpers\Html; class HelloWidget extends Widget { public function init() { parent::init(); ob_start(); } public function run() { $content = ob_get_clean(); return Html::encode($content); } } ``` Como se puede observar, el búfer de salida PHP es iniciado en 'init()' por tanto cualquier salida entre las llamadas de 'init()' y 'run()' puede ser capturada, procesada y devuelta en 'run()'. > Info: Cuando se llama a [[yii\base\Widget::begin()]], se creará una nueva instancia del widget y el método 'init()' será llamado al final del constructor del widget. Cuando se llama [[yii\base\Widget::end()]], el método 'run()' será llamado el resultado que devuelva será escrito por 'end()'. El siguiente código muestra como usar esta nueva variante de 'HelloWidget': ```php <?php use app\components\HelloWidget; ?> <?php HelloWidget::begin(); ?> content that may contain <tag>'s <?php HelloWidget::end(); ?> ``` A veces, un widget puede necesitar representar una gran cantidad de contenido. Mientras que se puede incrustar el contenido dentro del método 'run()', ponerlo dentro de una [vista](structure-views.md) y llamar [[yii\base\Widget::render()]] para representarla, es un mejor enfoque. Por ejemplo: ```php public function run() { return $this->render('hello'); } ``` Por defecto, las vistas para un widget deberían encontrarse en ficheros dentro del directorio 'WidgetPath/views', donde 'WidgetPath' representa el directorio que contiene el fichero de clase del widget. Por lo tanto, el anterior ejemplo representará el fichero de la vista `@app/components/views/hello.php`, asumiendo que la clase del widget se encuentre en `@app/components`. Se puede sobrescribir el método [[yii\base\Widget::getViewPath()]] para personalizar el directorio que contenga los ficheros de la vista del widget. ## Mejores Prácticas <span id="best-practices"></span> Los widgets son una manera orientada a objetos de reutilizar código de las vistas. Cuando se crean widgets, se debería continuar manteniendo el patrón MVC. En general, se debería mantener la lógica en las clases del widget y mantener la presentación en las [vistas](structure-views.md). Los widgets deberían ser diseñados para ser autónomos. Es decir, cuando se usa un widget, se debería poder poner en una vista sin hacer nada más. Esto puede resultar complicado si un widget requiere recursos externos, tales como CSS, JavaScript, imágenes, etc. Afortunadamente Yii proporciona soporte para [asset bundles](structure-asset-bundles.md) que pueden ser utilizados para resolver el problema. Cuando un widget sólo contiene código de vista, este es muy similar a una [vista](structure-views.md). De hecho, en este caso, su única diferencia es que un widget es una clase redistribuible, mientras que una vista es sólo un script PHP llano que prefiere mantenerse dentro de su aplicación.
{ "pile_set_name": "Github" }
// // MASConstraint+Private.h // Masonry // // Created by Nick Tymchenko on 29/04/14. // Copyright (c) 2014 cloudling. All rights reserved. // #import "MASConstraint.h" @protocol MASConstraintDelegate; @interface MASConstraint () /** * Whether or not to check for an existing constraint instead of adding constraint */ @property (nonatomic, assign) BOOL updateExisting; /** * Usually MASConstraintMaker but could be a parent MASConstraint */ @property (nonatomic, weak) id<MASConstraintDelegate> delegate; /** * Based on a provided value type, is equal to calling: * NSNumber - setOffset: * NSValue with CGPoint - setPointOffset: * NSValue with CGSize - setSizeOffset: * NSValue with MASEdgeInsets - setInsets: */ - (void)setLayoutConstantWithValue:(NSValue *)value; @end @interface MASConstraint (Abstract) /** * Sets the constraint relation to given NSLayoutRelation * returns a block which accepts one of the following: * MASViewAttribute, UIView, NSValue, NSArray * see readme for more details. */ - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation; /** * Override to set a custom chaining behaviour */ - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; @end @protocol MASConstraintDelegate <NSObject> /** * Notifies the delegate when the constraint needs to be replaced with another constraint. For example * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks */ - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint; - (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; @end
{ "pile_set_name": "Github" }
/* PLUGIN _CLOUDFLARE * * Czech language file. * * Author: */ theUILang.cannotLoadCloudscraper = "_cloudflare plugin: cloudscraper module can't be loaded in Python"; thePlugins.get("_cloudflare").langLoaded();
{ "pile_set_name": "Github" }
"""Export pyrh sub classes.""" from . import exceptions from .cache import dump_session, load_session from .robinhood import Robinhood __version__ = "2.0" __all__ = [ "__version__", "Robinhood", "load_session", "dump_session", "exceptions", ]
{ "pile_set_name": "Github" }
/* * Trivial amendments by James Bonfield <[email protected]> to provide an * HTSlib interface. 2015. * * Externally our API uses an opaque hts_md5_context structure. * * Internally either this gets defined and used with the routines here * or it remains incomplete and is cast to the OpenSSL MD5_CTX structure * and used by routines from OpenSSL. */ /* * This is an OpenSSL-compatible implementation of the RSA Data Security, Inc. * MD5 Message-Digest Algorithm (RFC 1321). * * Homepage: * http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5 * * Author: * Alexander Peslyak, better known as Solar Designer <solar at openwall.com> * * This software was written by Alexander Peslyak in 2001. No copyright is * claimed, and the software is hereby placed in the public domain. * In case this attempt to disclaim copyright and place the software in the * public domain is deemed null and void, then the software is * Copyright (c) 2001 Alexander Peslyak and it is hereby released to the * general public under the following terms: * * Redistribution and use in source and binary forms, with or without * modification, are permitted. * * There's ABSOLUTELY NO WARRANTY, express or implied. * * (This is a heavily cut-down "BSD license".) * * This differs from Colin Plumb's older public domain implementation in that * no exactly 32-bit integer data type is required (any 32-bit or wider * unsigned integer data type will do), there's no compile-time endianness * configuration, and the function prototypes match OpenSSL's. No code from * Colin Plumb's implementation has been reused; this comment merely compares * the properties of the two independent implementations. * * The primary goals of this implementation are portability and ease of use. * It is meant to be fast, but not as fast as possible. Some known * optimizations are not included to reduce source code size and avoid * compile-time configuration. */ #include <config.h> #include <stdlib.h> #include "htslib/hts.h" #include "htslib/hts_endian.h" #ifndef HAVE_OPENSSL #include <string.h> /* Any 32-bit or wider unsigned integer data type will do */ typedef unsigned int hts_md5_u32plus; struct hts_md5_context { hts_md5_u32plus lo, hi; hts_md5_u32plus a, b, c, d; unsigned char buffer[64]; hts_md5_u32plus block[16]; }; /* * The basic MD5 functions. * * F and G are optimized compared to their RFC 1321 definitions for * architectures that lack an AND-NOT instruction, just like in Colin Plumb's * implementation. */ #define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) #define G(x, y, z) ((y) ^ ((z) & ((x) ^ (y)))) #define H(x, y, z) (((x) ^ (y)) ^ (z)) #define H2(x, y, z) ((x) ^ ((y) ^ (z))) #define I(x, y, z) ((y) ^ ((x) | ~(z))) /* * The MD5 transformation for all four rounds. */ #define STEP(f, a, b, c, d, x, t, s) \ (a) += f((b), (c), (d)) + (x) + (t); \ (a) = (((a) << (s)) | (((a) & 0xffffffff) >> (32 - (s)))); \ (a) += (b); /* * SET reads 4 input bytes in little-endian byte order and stores them * in a properly aligned word in host byte order. * * The check for little-endian architectures that tolerate unaligned * memory accesses is just an optimization. Nothing will break if it * doesn't work. */ #if defined(HTS_LITTLE_ENDIAN) && HTS_ALLOW_UNALIGNED != 0 #define SET(n) \ (*(hts_md5_u32plus *)&ptr[(n) * 4]) #define GET(n) \ SET(n) #else #define SET(n) \ (ctx->block[(n)] = \ (hts_md5_u32plus)ptr[(n) * 4] | \ ((hts_md5_u32plus)ptr[(n) * 4 + 1] << 8) | \ ((hts_md5_u32plus)ptr[(n) * 4 + 2] << 16) | \ ((hts_md5_u32plus)ptr[(n) * 4 + 3] << 24)) #define GET(n) \ (ctx->block[(n)]) #endif /* * This processes one or more 64-byte data blocks, but does NOT update * the bit counters. There are no alignment requirements. */ static const void *body(hts_md5_context *ctx, const void *data, unsigned long size) { const unsigned char *ptr; hts_md5_u32plus a, b, c, d; hts_md5_u32plus saved_a, saved_b, saved_c, saved_d; ptr = (const unsigned char *)data; a = ctx->a; b = ctx->b; c = ctx->c; d = ctx->d; do { saved_a = a; saved_b = b; saved_c = c; saved_d = d; /* Round 1 */ STEP(F, a, b, c, d, SET(0), 0xd76aa478, 7) STEP(F, d, a, b, c, SET(1), 0xe8c7b756, 12) STEP(F, c, d, a, b, SET(2), 0x242070db, 17) STEP(F, b, c, d, a, SET(3), 0xc1bdceee, 22) STEP(F, a, b, c, d, SET(4), 0xf57c0faf, 7) STEP(F, d, a, b, c, SET(5), 0x4787c62a, 12) STEP(F, c, d, a, b, SET(6), 0xa8304613, 17) STEP(F, b, c, d, a, SET(7), 0xfd469501, 22) STEP(F, a, b, c, d, SET(8), 0x698098d8, 7) STEP(F, d, a, b, c, SET(9), 0x8b44f7af, 12) STEP(F, c, d, a, b, SET(10), 0xffff5bb1, 17) STEP(F, b, c, d, a, SET(11), 0x895cd7be, 22) STEP(F, a, b, c, d, SET(12), 0x6b901122, 7) STEP(F, d, a, b, c, SET(13), 0xfd987193, 12) STEP(F, c, d, a, b, SET(14), 0xa679438e, 17) STEP(F, b, c, d, a, SET(15), 0x49b40821, 22) /* Round 2 */ STEP(G, a, b, c, d, GET(1), 0xf61e2562, 5) STEP(G, d, a, b, c, GET(6), 0xc040b340, 9) STEP(G, c, d, a, b, GET(11), 0x265e5a51, 14) STEP(G, b, c, d, a, GET(0), 0xe9b6c7aa, 20) STEP(G, a, b, c, d, GET(5), 0xd62f105d, 5) STEP(G, d, a, b, c, GET(10), 0x02441453, 9) STEP(G, c, d, a, b, GET(15), 0xd8a1e681, 14) STEP(G, b, c, d, a, GET(4), 0xe7d3fbc8, 20) STEP(G, a, b, c, d, GET(9), 0x21e1cde6, 5) STEP(G, d, a, b, c, GET(14), 0xc33707d6, 9) STEP(G, c, d, a, b, GET(3), 0xf4d50d87, 14) STEP(G, b, c, d, a, GET(8), 0x455a14ed, 20) STEP(G, a, b, c, d, GET(13), 0xa9e3e905, 5) STEP(G, d, a, b, c, GET(2), 0xfcefa3f8, 9) STEP(G, c, d, a, b, GET(7), 0x676f02d9, 14) STEP(G, b, c, d, a, GET(12), 0x8d2a4c8a, 20) /* Round 3 */ STEP(H, a, b, c, d, GET(5), 0xfffa3942, 4) STEP(H2, d, a, b, c, GET(8), 0x8771f681, 11) STEP(H, c, d, a, b, GET(11), 0x6d9d6122, 16) STEP(H2, b, c, d, a, GET(14), 0xfde5380c, 23) STEP(H, a, b, c, d, GET(1), 0xa4beea44, 4) STEP(H2, d, a, b, c, GET(4), 0x4bdecfa9, 11) STEP(H, c, d, a, b, GET(7), 0xf6bb4b60, 16) STEP(H2, b, c, d, a, GET(10), 0xbebfbc70, 23) STEP(H, a, b, c, d, GET(13), 0x289b7ec6, 4) STEP(H2, d, a, b, c, GET(0), 0xeaa127fa, 11) STEP(H, c, d, a, b, GET(3), 0xd4ef3085, 16) STEP(H2, b, c, d, a, GET(6), 0x04881d05, 23) STEP(H, a, b, c, d, GET(9), 0xd9d4d039, 4) STEP(H2, d, a, b, c, GET(12), 0xe6db99e5, 11) STEP(H, c, d, a, b, GET(15), 0x1fa27cf8, 16) STEP(H2, b, c, d, a, GET(2), 0xc4ac5665, 23) /* Round 4 */ STEP(I, a, b, c, d, GET(0), 0xf4292244, 6) STEP(I, d, a, b, c, GET(7), 0x432aff97, 10) STEP(I, c, d, a, b, GET(14), 0xab9423a7, 15) STEP(I, b, c, d, a, GET(5), 0xfc93a039, 21) STEP(I, a, b, c, d, GET(12), 0x655b59c3, 6) STEP(I, d, a, b, c, GET(3), 0x8f0ccc92, 10) STEP(I, c, d, a, b, GET(10), 0xffeff47d, 15) STEP(I, b, c, d, a, GET(1), 0x85845dd1, 21) STEP(I, a, b, c, d, GET(8), 0x6fa87e4f, 6) STEP(I, d, a, b, c, GET(15), 0xfe2ce6e0, 10) STEP(I, c, d, a, b, GET(6), 0xa3014314, 15) STEP(I, b, c, d, a, GET(13), 0x4e0811a1, 21) STEP(I, a, b, c, d, GET(4), 0xf7537e82, 6) STEP(I, d, a, b, c, GET(11), 0xbd3af235, 10) STEP(I, c, d, a, b, GET(2), 0x2ad7d2bb, 15) STEP(I, b, c, d, a, GET(9), 0xeb86d391, 21) a += saved_a; b += saved_b; c += saved_c; d += saved_d; ptr += 64; } while (size -= 64); ctx->a = a; ctx->b = b; ctx->c = c; ctx->d = d; return ptr; } void hts_md5_reset(hts_md5_context *ctx) { ctx->a = 0x67452301; ctx->b = 0xefcdab89; ctx->c = 0x98badcfe; ctx->d = 0x10325476; ctx->lo = 0; ctx->hi = 0; } void hts_md5_update(hts_md5_context *ctx, const void *data, unsigned long size) { hts_md5_u32plus saved_lo; unsigned long used, available; saved_lo = ctx->lo; if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) ctx->hi++; ctx->hi += size >> 29; used = saved_lo & 0x3f; if (used) { available = 64 - used; if (size < available) { memcpy(&ctx->buffer[used], data, size); return; } memcpy(&ctx->buffer[used], data, available); data = (const unsigned char *)data + available; size -= available; body(ctx, ctx->buffer, 64); } if (size >= 64) { data = body(ctx, data, size & ~(unsigned long)0x3f); size &= 0x3f; } memcpy(ctx->buffer, data, size); } void hts_md5_final(unsigned char *result, hts_md5_context *ctx) { unsigned long used, available; used = ctx->lo & 0x3f; ctx->buffer[used++] = 0x80; available = 64 - used; if (available < 8) { memset(&ctx->buffer[used], 0, available); body(ctx, ctx->buffer, 64); used = 0; available = 64; } memset(&ctx->buffer[used], 0, available - 8); ctx->lo <<= 3; ctx->buffer[56] = ctx->lo; ctx->buffer[57] = ctx->lo >> 8; ctx->buffer[58] = ctx->lo >> 16; ctx->buffer[59] = ctx->lo >> 24; ctx->buffer[60] = ctx->hi; ctx->buffer[61] = ctx->hi >> 8; ctx->buffer[62] = ctx->hi >> 16; ctx->buffer[63] = ctx->hi >> 24; body(ctx, ctx->buffer, 64); result[0] = ctx->a; result[1] = ctx->a >> 8; result[2] = ctx->a >> 16; result[3] = ctx->a >> 24; result[4] = ctx->b; result[5] = ctx->b >> 8; result[6] = ctx->b >> 16; result[7] = ctx->b >> 24; result[8] = ctx->c; result[9] = ctx->c >> 8; result[10] = ctx->c >> 16; result[11] = ctx->c >> 24; result[12] = ctx->d; result[13] = ctx->d >> 8; result[14] = ctx->d >> 16; result[15] = ctx->d >> 24; memset(ctx, 0, sizeof(*ctx)); } hts_md5_context *hts_md5_init(void) { hts_md5_context *ctx = malloc(sizeof(*ctx)); if (!ctx) return NULL; hts_md5_reset(ctx); return ctx; } #else #include <openssl/md5.h> #include <assert.h> /* * Wrappers around the OpenSSL libcrypto.so MD5 implementation. * * These are here to ensure they end up in the symbol table of the * library regardless of the static inline in the headers. */ hts_md5_context *hts_md5_init(void) { MD5_CTX *ctx = malloc(sizeof(*ctx)); if (!ctx) return NULL; MD5_Init(ctx); return (hts_md5_context *)ctx; } void hts_md5_reset(hts_md5_context *ctx) { MD5_Init((MD5_CTX *)ctx); } void hts_md5_update(hts_md5_context *ctx, const void *data, unsigned long size) { MD5_Update((MD5_CTX *)ctx, data, size); } void hts_md5_final(unsigned char *result, hts_md5_context *ctx) { MD5_Final(result, (MD5_CTX *)ctx); } #endif void hts_md5_destroy(hts_md5_context *ctx) { if (!ctx) return; free(ctx); } void hts_md5_hex(char *hex, const unsigned char *digest) { int i; for (i = 0; i < 16; i++) { hex[i*2+0] = "0123456789abcdef"[(digest[i]>>4)&0xf]; hex[i*2+1] = "0123456789abcdef"[digest[i]&0xf]; } hex[32] = 0; }
{ "pile_set_name": "Github" }
<div align=left ><img src="https://gitee.com/darren3d/tnn-resource/raw/master/TNN.png"/> # Run a demo from scratch [中文版本](../cn/get_started.md) It is very simple to use TNN. If you have a trained model, the model can be deployed on the target platform through three steps. 1. Convert the trained model into a TNN model. We provide a wealth of tools to help you complete this step, whether you are using Tensorflow, Pytorch, or Caffe, you can easily complete the conversion. Detailed hands-on tutorials can be found here [How to Create TNN Models](./user/convert_en.md). 2. When you have finished converting the model, the second step is to compile the TNN engine of the target platform. You can choose among different acceleration solutions such as ARM/OpenCL/Metal/Npu according to the hardware support. For these platforms, TNN provides convenient one-click scripts to compile. For detailed steps, please refer to [How to Compile TNN](./user/compile_en.md). 3. The final step is to use the compiled TNN engine for inference. You can make program calls to TNN inside your application. We provide a rich and detailed demo as a reference to help you complete. * [Run an iOS Demo](./user/demo_en.md) * [Run an Android Demo](./user/demo_en.md)
{ "pile_set_name": "Github" }
title lldvrm - signed long divide and remainder routine ;*** ;lldvrm.asm - signed long divide and remainder routine ; ; Copyright (c) Microsoft Corporation. All rights reserved. ; ;Purpose: ; defines the signed long divide and remainder routine ; __alldvrm ; ;******************************************************************************* .xlist include vcruntime.inc include mm.inc .list ;*** ;lldvrm - signed long divide and remainder ; ;Purpose: ; Does a signed long divide and remainder of the arguments. Arguments are ; not changed. ; ;Entry: ; Arguments are passed on the stack: ; 1st pushed: divisor (QWORD) ; 2nd pushed: dividend (QWORD) ; ;Exit: ; EDX:EAX contains the quotient (dividend/divisor) ; EBX:ECX contains the remainder (divided % divisor) ; NOTE: this routine removes the parameters from the stack. ; ;Uses: ; ECX ; ;Exceptions: ; ;******************************************************************************* CODESEG _alldvrm PROC NEAR .FPO (3, 4, 0, 0, 1, 0) push edi push esi push ebp ; Set up the local stack and save the index registers. When this is done ; the stack frame will look as follows (assuming that the expression a/b will ; generate a call to alldvrm(a, b)): ; ; ----------------- ; | | ; |---------------| ; | | ; |--divisor (b)--| ; | | ; |---------------| ; | | ; |--dividend (a)-| ; | | ; |---------------| ; | return addr** | ; |---------------| ; | EDI | ; |---------------| ; | ESI | ; |---------------| ; ESP---->| EBP | ; ----------------- ; DVND equ [esp + 16] ; stack address of dividend (a) DVSR equ [esp + 24] ; stack address of divisor (b) ; Determine sign of the quotient (edi = 0 if result is positive, non-zero ; otherwise) and make operands positive. ; Sign of the remainder is kept in ebp. xor edi,edi ; result sign assumed positive xor ebp,ebp ; result sign assumed positive mov eax,HIWORD(DVND) ; hi word of a or eax,eax ; test to see if signed jge short L1 ; skip rest if a is already positive inc edi ; complement result sign flag inc ebp ; complement result sign flag mov edx,LOWORD(DVND) ; lo word of a neg eax ; make a positive neg edx sbb eax,0 mov HIWORD(DVND),eax ; save positive value mov LOWORD(DVND),edx L1: mov eax,HIWORD(DVSR) ; hi word of b or eax,eax ; test to see if signed jge short L2 ; skip rest if b is already positive inc edi ; complement the result sign flag mov edx,LOWORD(DVSR) ; lo word of a neg eax ; make b positive neg edx sbb eax,0 mov HIWORD(DVSR),eax ; save positive value mov LOWORD(DVSR),edx L2: ; ; Now do the divide. First look to see if the divisor is less than 4194304K. ; If so, then we can use a simple algorithm with word divides, otherwise ; things get a little more complex. ; ; NOTE - eax currently contains the high order word of DVSR ; or eax,eax ; check to see if divisor < 4194304K jnz short L3 ; nope, gotta do this the hard way mov ecx,LOWORD(DVSR) ; load divisor mov eax,HIWORD(DVND) ; load high word of dividend xor edx,edx div ecx ; eax <- high order bits of quotient mov ebx,eax ; save high bits of quotient mov eax,LOWORD(DVND) ; edx:eax <- remainder:lo word of dividend div ecx ; eax <- low order bits of quotient mov esi,eax ; ebx:esi <- quotient ; ; Now we need to do a multiply so that we can compute the remainder. ; mov eax,ebx ; set up high word of quotient mul dword ptr LOWORD(DVSR) ; HIWORD(QUOT) * DVSR mov ecx,eax ; save the result in ecx mov eax,esi ; set up low word of quotient mul dword ptr LOWORD(DVSR) ; LOWORD(QUOT) * DVSR add edx,ecx ; EDX:EAX = QUOT * DVSR jmp short L4 ; complete remainder calculation ; ; Here we do it the hard way. Remember, eax contains the high word of DVSR ; L3: mov ebx,eax ; ebx:ecx <- divisor mov ecx,LOWORD(DVSR) mov edx,HIWORD(DVND) ; edx:eax <- dividend mov eax,LOWORD(DVND) L5: shr ebx,1 ; shift divisor right one bit rcr ecx,1 shr edx,1 ; shift dividend right one bit rcr eax,1 or ebx,ebx jnz short L5 ; loop until divisor < 4194304K div ecx ; now divide, ignore remainder mov esi,eax ; save quotient ; ; We may be off by one, so to check, we will multiply the quotient ; by the divisor and check the result against the orignal dividend ; Note that we must also check for overflow, which can occur if the ; dividend is close to 2**64 and the quotient is off by 1. ; mul dword ptr HIWORD(DVSR) ; QUOT * HIWORD(DVSR) mov ecx,eax mov eax,LOWORD(DVSR) mul esi ; QUOT * LOWORD(DVSR) add edx,ecx ; EDX:EAX = QUOT * DVSR jc short L6 ; carry means Quotient is off by 1 ; ; do long compare here between original dividend and the result of the ; multiply in edx:eax. If original is larger or equal, we are ok, otherwise ; subtract one (1) from the quotient. ; cmp edx,HIWORD(DVND) ; compare hi words of result and original ja short L6 ; if result > original, do subtract jb short L7 ; if result < original, we are ok cmp eax,LOWORD(DVND) ; hi words are equal, compare lo words jbe short L7 ; if less or equal we are ok, else subtract L6: dec esi ; subtract 1 from quotient sub eax,LOWORD(DVSR) ; subtract divisor from result sbb edx,HIWORD(DVSR) L7: xor ebx,ebx ; ebx:esi <- quotient L4: ; ; Calculate remainder by subtracting the result from the original dividend. ; Since the result is already in a register, we will do the subtract in the ; opposite direction and negate the result if necessary. ; sub eax,LOWORD(DVND) ; subtract dividend from result sbb edx,HIWORD(DVND) ; ; Now check the result sign flag to see if the result is supposed to be positive ; or negative. It is currently negated (because we subtracted in the 'wrong' ; direction), so if the sign flag is set we are done, otherwise we must negate ; the result to make it positive again. ; dec ebp ; check result sign flag jns short L9 ; result is ok, set up the quotient neg edx ; otherwise, negate the result neg eax sbb edx,0 ; ; Now we need to get the quotient into edx:eax and the remainder into ebx:ecx. ; L9: mov ecx,edx mov edx,ebx mov ebx,ecx mov ecx,eax mov eax,esi ; ; Just the cleanup left to do. edx:eax contains the quotient. Set the sign ; according to the save value, cleanup the stack, and return. ; dec edi ; check to see if result is negative jnz short L8 ; if EDI == 0, result should be negative neg edx ; otherwise, negate the result neg eax sbb edx,0 ; ; Restore the saved registers and return. ; L8: pop ebp pop esi pop edi ret 16 _alldvrm ENDP end
{ "pile_set_name": "Github" }
--- title: "Blog Feature: Art Gallery" date: 2019-11-01 tags: - art - announce - 100th-post --- # Blog Feature: Art Gallery I have just implemented support for my portfolio site to also function as an art gallery. See all of my posted art [here](/gallery). I have been trying to get better at art for a while and I feel I'm at the level where I feel comfortable putting it on my portfolio. Let's see how far this rabbit hole goes. --- Also this is my 100th post! Yay!
{ "pile_set_name": "Github" }
--- title: 031《OneTab》把多个Tab转换为一个列表 --- > OneTab是Chrome的一款插件, 主要用来管理浏览器的标签页,它有两个应用场景 ## 应用场景一: 把多个Tab转换为一个列表 当你发现自己有太多的标签页时,单击OneTab图标,所有标签页会转换成一个列表,当你需要再次访问这些标签页时,点击OneTab图标唤出列表,点击列表恢复标签页 - 当前我在浏览器打开了一组标签页 > ![](https://www.v2fy.com/asset/031_onetab/6418858c3da74e42bde5b76b91be265c.png) - 点击OneTab图标 > ![](https://www.v2fy.com/asset/031_onetab/29a667780cd940c8a08ade699f2c5577.png) - 所有标签页合并为列表(点击列表可恢复) > ![](https://www.v2fy.com/asset/031_onetab/57f3d5d3fe7c4b2bb0a9a860760f5872.png) - 点击恢复页面(点击恢复标签页后, 开启新的标签页) > ![](https://www.v2fy.com/asset/031_onetab/2a2142f68cc14d8388384b0ee1097a1b.png) > 如果关闭了OneTab标签页, 只需点击浏览器插件栏OneTab图标恢复即可! ## 应用场景二: 批量分享网页 可以将**场景一**中 生成的列表页生成二维码, 将二维码分享给别人, 这样别就可以收到你分享的一组网页了! - 将当前6个标签页分享为二维码 > ![](https://www.v2fy.com/asset/031_onetab/c521739fc62349dd91f94f8c45250d68.png) - 扫描二维码即可查看分享的6个网址 > ![](https://www.v2fy.com/asset/031_onetab/6c7fae770bce4f74b4f1e00d5f277cbf.png) - 可以用这个二维码,体验一下 > ![](https://www.v2fy.com/asset/031_onetab/cdce9cc22cbd4e8f81569e5e486244e8.png) - 通过二维码, 在手机端查看 > ![](https://www.v2fy.com/asset/031_onetab/600be59abe4b4f0f82883599b7085411.jpeg) ## 小结 - OneTab官方主打的是第一个功能,宣传口号是**节省高达95%的内存,并减轻标签页混乱现象**, 本质是通过关闭繁多的标签页,让浏览器占用内存变少, 个人认为, OneTab相当于**重新定义了浏览器的历史记录**, 确实是很不错创意 - OneTab第二个功能,是我个人比较喜欢的, 如果别人问你一些比较简单的问题, 你可以打开几个和问题答案相关的网页, 然后一键分享给别人, 让他们自己去看, 也算是**授人以鱼不如授人以渔**了 ## 插件下载地址 [https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall](https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall) --- ## 写在最后(我需要你的支持) - 本文属于**Chrome插件英雄榜** 项目的一部分, 项目Github地址: [https://github.com/zhaoolee/ChromeAppHeroes](https://github.com/zhaoolee/ChromeAppHeroes) - **Chrome插件英雄榜**, 为优秀的Chrome插件写一本中文说明书, 让Chrome插件英雄们造福人类, 如果你喜欢这个项目, 希望你能为本项目添加一颗 🌟星. - ChromeAppHeroes, Write a Chinese manual for the excellent Chrome plugin, let the Chrome plugin heroes benefit the human, If you like this project, I hope you can add a star 🌟 to this project.
{ "pile_set_name": "Github" }
<?php use Swoole\Coroutine as co; co::create(function () { $cli = new co\http\client('127.0.0.1', 9501); $cli->setHeaders(['Host' => 'localhost']); $cli->set(['http_proxy_host' => HTTP_PROXY_HOST, 'http_proxy_port' => HTTP_PROXY_PORT]); $result = $cli->get('/get?json=true'); var_dump($cli->body); // assert($result); // $ret = json_decode($cli->body, true); // assert(is_array($ret) and $ret['json'] == 'true'); });
{ "pile_set_name": "Github" }
package install import ( "fmt" "io" "io/ioutil" "os" "path/filepath" "sort" "time" "github.com/apprenda/kismatic/pkg/tls" "github.com/apprenda/kismatic/pkg/util" "github.com/cloudflare/cfssl/csr" ) const ( adminUser = "admin" adminGroup = "system:masters" adminCertFilename = "admin" adminCertFilenameKETPre133 = "admin" serviceAccountCertFilename = "service-account" serviceAccountCertCommonName = "kube-service-account" schedulerCertFilenamePrefix = "kube-scheduler" schedulerUser = "system:kube-scheduler" controllerManagerCertFilenamePrefix = "kube-controller-manager" controllerManagerUser = "system:kube-controller-manager" kubeletUserPrefix = "system:node" kubeletGroup = "system:nodes" kubeAPIServerKubeletClientClientFilename = "apiserver-kubelet-client" kubeAPIServerKubeletClientClientCommonName = "kube-apiserver-kubelet-client" contivProxyServerCertFilename = "contiv-proxy-server" proxyClientCACommonName = "proxyClientCA" proxyClientCertFilename = "proxy-client" proxyClientCertCommonName = "aggregator" ) // The PKI provides a way for generating certificates for the cluster described by the Plan type PKI interface { CertificateAuthorityExists() (bool, error) GenerateClusterCA(p *Plan) (*tls.CA, error) GetClusterCA() (*tls.CA, error) GenerateProxyClientCA(p *Plan) (*tls.CA, error) GetProxyClientCA() (*tls.CA, error) GenerateClusterCertificates(p *Plan, clusterCA *tls.CA, proxyClientCA *tls.CA) error NodeCertificateExists(node Node) (bool, error) GenerateNodeCertificate(plan *Plan, node Node, ca *tls.CA) error GenerateCertificate(name string, validityPeriod string, commonName string, subjectAlternateNames []string, organizations []string, ca *tls.CA, overwrite bool) (bool, error) } // LocalPKI is a file-based PKI type LocalPKI struct { CACsr string GeneratedCertsDirectory string Log io.Writer } type certificateSpec struct { description string filename string commonName string subjectAlternateNames []string organizations []string ca *tls.CA } func (s certificateSpec) equal(other certificateSpec) bool { prelimEqual := s.description == other.description && s.filename == other.filename && s.commonName == other.commonName && len(s.subjectAlternateNames) == len(other.subjectAlternateNames) && len(s.organizations) == len(other.organizations) if !prelimEqual { return false } // Compare subject alt. names thisSAN := make([]string, len(s.subjectAlternateNames)) otherSAN := make([]string, len(other.subjectAlternateNames)) // Clone and sort copy(thisSAN, s.subjectAlternateNames) copy(otherSAN, other.subjectAlternateNames) sort.Strings(thisSAN) sort.Strings(otherSAN) for _, x := range thisSAN { for _, y := range otherSAN { if x != y { return false } } } // Compare organizations thisOrgs := make([]string, len(s.organizations)) otherOrgs := make([]string, len(other.organizations)) // clone and sort copy(thisOrgs, s.organizations) copy(otherOrgs, other.organizations) sort.Strings(thisOrgs) sort.Strings(otherOrgs) for _, x := range thisOrgs { for _, y := range otherOrgs { if x != y { return false } } } return true } // CertificateAuthorityExists returns true if the CA for the cluster exists func (lp *LocalPKI) CertificateAuthorityExists() (bool, error) { return tls.CertKeyPairExists("ca", lp.GeneratedCertsDirectory) } // GenerateClusterCA creates a Certificate Authority for the cluster func (lp *LocalPKI) GenerateClusterCA(p *Plan) (*tls.CA, error) { exists, err := tls.CertKeyPairExists("ca", lp.GeneratedCertsDirectory) if err != nil { return nil, fmt.Errorf("error verifying CA certificate/key: %v", err) } if exists { return lp.GetClusterCA() } // CA keypair doesn't exist, generate one util.PrettyPrintOk(lp.Log, "Generating cluster Certificate Authority") key, cert, err := tls.NewCACert(lp.CACsr, p.Cluster.Name, p.Cluster.Certificates.CAExpiry) if err != nil { return nil, fmt.Errorf("failed to create CA Cert: %v", err) } if err = tls.WriteCert(key, cert, "ca", lp.GeneratedCertsDirectory); err != nil { return nil, fmt.Errorf("error writing CA files: %v", err) } return &tls.CA{ Cert: cert, Key: key, }, nil } // GetClusterCA returns the cluster CA func (lp *LocalPKI) GetClusterCA() (*tls.CA, error) { key, cert, err := tls.ReadCACert("ca", lp.GeneratedCertsDirectory) if err != nil { return nil, fmt.Errorf("error reading CA certificate/key: %v", err) } return &tls.CA{ Cert: cert, Key: key, }, nil } // GenerateProxyClientCA creates a Certificate Authority for the cluster func (lp *LocalPKI) GenerateProxyClientCA(p *Plan) (*tls.CA, error) { exists, err := tls.CertKeyPairExists("proxy-client-ca", lp.GeneratedCertsDirectory) if err != nil { return nil, fmt.Errorf("error verifying proxy-client CA certificate/key: %v", err) } if exists { return lp.GetProxyClientCA() } // CA keypair doesn't exist, generate one util.PrettyPrintOk(lp.Log, "Generating proxy-client Certificate Authority") key, cert, err := tls.NewCACert(lp.CACsr, proxyClientCACommonName, p.Cluster.Certificates.CAExpiry) if err != nil { return nil, fmt.Errorf("failed to create proxy-client CA Cert: %v", err) } if err = tls.WriteCert(key, cert, "proxy-client-ca", lp.GeneratedCertsDirectory); err != nil { return nil, fmt.Errorf("error writing proxy-client CA files: %v", err) } return &tls.CA{ Cert: cert, Key: key, }, nil } // GetProxyClientCA returns the cluster CA func (lp *LocalPKI) GetProxyClientCA() (*tls.CA, error) { key, cert, err := tls.ReadCACert("proxy-client-ca", lp.GeneratedCertsDirectory) if err != nil { return nil, fmt.Errorf("error reading proxy-client CA certificate/key: %v", err) } return &tls.CA{ Cert: cert, Key: key, }, nil } // GenerateClusterCertificates creates all certificates required for the cluster // described in the plan file. func (lp *LocalPKI) GenerateClusterCertificates(p *Plan, clusterCA *tls.CA, proxyClientCA *tls.CA) error { if lp.Log == nil { lp.Log = ioutil.Discard } manifest, err := p.certSpecs(clusterCA, proxyClientCA) if err != nil { return err } for _, s := range manifest { exists, err := tls.CertKeyPairExists(s.filename, lp.GeneratedCertsDirectory) if err != nil { return err } // Pre-existing admin certificates from KET < 1.3.3 are not valid // due to changes required for RBAC. Rename it if necessary. if exists && s.filename == adminCertFilenameKETPre133 { ok, err := renamePre133AdminCert(s.filename, lp.GeneratedCertsDirectory) if err != nil { return err } // We renamed it, so it doesn't exist anymore if ok { util.PrettyPrintWarn(lp.Log, "Existing admin certificate is invalid. Backing up and regenerating.") exists = false } } if exists { warnings, err := tls.CertValid(s.commonName, s.subjectAlternateNames, s.organizations, s.filename, lp.GeneratedCertsDirectory) if err != nil { return err } if len(warnings) > 0 { util.PrettyPrintErr(lp.Log, "Found certificate for %s, but it is not valid", s.description) util.PrintValidationErrors(lp.Log, warnings) return fmt.Errorf("invalid certificate found for %q", s.description) } // This cert is valid, move onto the next certificate util.PrettyPrintOk(lp.Log, "Found valid certificate for %s", s.description) continue } // Cert doesn't exist. Generate it if err := generateCert(lp.GeneratedCertsDirectory, s, p.Cluster.Certificates.Expiry); err != nil { return err } util.PrettyPrintOk(lp.Log, "Generated certificate for %s", s.description) } return nil } // Validates that the certificate was generated by us. If so, renames it // to make a backup and returns true. Otherwise returns false. func renamePre133AdminCert(filename, dir string) (bool, error) { cert, err := tls.ReadCert(filename, dir) if err != nil { return false, fmt.Errorf("error reading admin certificate: %v", err) } // Ensure it was generated by us if len(cert.Subject.Organization) == 1 && cert.Subject.Organization[0] == "Apprenda" && len(cert.Subject.OrganizationalUnit) == 1 && cert.Subject.OrganizationalUnit[0] == "Kismatic" && len(cert.Subject.Country) == 1 && cert.Subject.Country[0] == "US" && len(cert.Subject.Province) == 1 && cert.Subject.Province[0] == "NY" && len(cert.Subject.Locality) == 1 && cert.Subject.Locality[0] == "Troy" { certFile := filepath.Join(dir, filename+".pem") if err = os.Rename(certFile, certFile+".bak"); err != nil { return false, fmt.Errorf("error backing up existing admin certificate: %v", err) } return true, nil } return false, nil } // ValidateClusterCertificates validates any certificates that already exist // in the expected directory. func (lp *LocalPKI) ValidateClusterCertificates(p *Plan) (warns []error, errs []error) { if lp.Log == nil { lp.Log = ioutil.Discard } manifest, err := p.certSpecs(nil, nil) if err != nil { return nil, []error{err} } for _, s := range manifest { exists, err := tls.CertKeyPairExists(s.filename, lp.GeneratedCertsDirectory) if err != nil { errs = append(errs, err) continue } if !exists { continue // nothing to validate... move on } warn, err := tls.CertValid(s.commonName, s.subjectAlternateNames, s.organizations, s.filename, lp.GeneratedCertsDirectory) if err != nil { errs = append(errs, err) } if len(warn) > 0 { warns = append(warns, warn...) } } return warns, errs } // NodeCertificateExists returns true if the node's key and certificate exist func (lp *LocalPKI) NodeCertificateExists(node Node) (bool, error) { return tls.CertKeyPairExists(node.Host, lp.GeneratedCertsDirectory) } // GenerateNodeCertificate creates a private key and certificate for the given node func (lp *LocalPKI) GenerateNodeCertificate(plan *Plan, node Node, ca *tls.CA) error { m, err := node.certSpecs(*plan, ca) if err != nil { return err } for _, s := range m { exists, err := tls.CertKeyPairExists(s.filename, lp.GeneratedCertsDirectory) if err != nil { return err } if exists { warn, err := tls.CertValid(s.commonName, s.subjectAlternateNames, s.organizations, s.filename, lp.GeneratedCertsDirectory) if err != nil { return err } if len(warn) > 0 { util.PrettyPrintErr(lp.Log, "Found certificate for %s, but it is not valid", s.description) util.PrintValidationErrors(lp.Log, warn) return fmt.Errorf("invalid certificate found for %q", s.description) } // This cert is valid, move on util.PrettyPrintOk(lp.Log, "Found valid certificate for %s", s.description) continue } // Cert doesn't exist. Generate it if err := generateCert(lp.GeneratedCertsDirectory, s, plan.Cluster.Certificates.Expiry); err != nil { return err } util.PrettyPrintOk(lp.Log, "Generated certificate for %s", s.description) } return nil } // GenerateCertificate creates a private key and certificate for the given name, CN, subjectAlternateNames and organizations // If cert exists, will not fail // Pass overwrite to replace an existing cert func (lp *LocalPKI) GenerateCertificate(name string, validityPeriod string, commonName string, subjectAlternateNames []string, organizations []string, ca *tls.CA, overwrite bool) (bool, error) { if name == "" { return false, fmt.Errorf("name cannot be empty") } if validityPeriod == "" { return false, fmt.Errorf("validityPeriod cannot be empty") } if ca == nil { return false, fmt.Errorf("ca cannot be nil") } exists, err := tls.CertKeyPairExists(name, lp.GeneratedCertsDirectory) if err != nil { return false, fmt.Errorf("could not determine if certificate for %s exists: %v", name, err) } // if exists and overwrite == false return // otherwise cert will be created and replaced if exists if exists && !overwrite { return true, nil } spec := certificateSpec{ description: name, filename: name, commonName: commonName, subjectAlternateNames: subjectAlternateNames, organizations: organizations, ca: ca, } if err := generateCert(lp.GeneratedCertsDirectory, spec, validityPeriod); err != nil { return exists, fmt.Errorf("could not generate certificate %s: %v", name, err) } return exists, nil } func generateCert(certDir string, spec certificateSpec, expiryStr string) error { expiry, err := time.ParseDuration(expiryStr) if err != nil { return fmt.Errorf("%q is not a valid duration for certificate expiry", expiryStr) } req := csr.CertificateRequest{ CN: spec.commonName, KeyRequest: &csr.BasicKeyRequest{ A: "rsa", S: 2048, }, } if len(spec.subjectAlternateNames) > 0 { req.Hosts = spec.subjectAlternateNames } for _, org := range spec.organizations { name := csr.Name{O: org} req.Names = append(req.Names, name) } key, cert, err := tls.NewCert(spec.ca, req, expiry) if err != nil { return fmt.Errorf("error generating certs for %q: %v", spec.description, err) } if err = tls.WriteCert(key, cert, spec.filename, certDir); err != nil { return fmt.Errorf("error writing cert for %q: %v", spec.description, err) } return nil } func clusterCertsSubjectAlternateNames(plan Plan) ([]string, error) { kubeServiceIP, err := getKubernetesServiceIP(&plan) if err != nil { return nil, fmt.Errorf("Error getting kubernetes service IP: %v", err) } defaultCertHosts := []string{ "kubernetes", "kubernetes.default", "kubernetes.default.svc", "kubernetes.default.svc.cluster.local", "127.0.0.1", kubeServiceIP, } return defaultCertHosts, nil } func contains(x string, xs []string) bool { for _, s := range xs { if x == s { return true } } return false } func containsAny(x []string, xs []string) bool { for _, s := range x { if contains(s, xs) { return true } } return false } func certSpecInManifest(spec certificateSpec, manifest []certificateSpec) bool { for _, s := range manifest { if s.equal(spec) { return true } } return false }
{ "pile_set_name": "Github" }
# `gnrc_ipv6_ext` test This test utilizes [scapy] to test the IPv6 Extension header parsing. It is intended to just test the basic parsing functionality. For specific extension header types please provide a separate test application. To test, compile and flash the application to any board of your liking (since `ethos` is used to communicate with non-native boards it really doesn't matter as long as the application fits). ``` make flash ``` And run the tests using ``` sudo make test ``` Note that root privileges are required since `scapy` needs to construct Ethernet frames to properly communicate over the TAP interface. The tests succeeds if you see the string `SUCCESS`. If any problems are encountered (i.e. if the test prints the sting `FAILED`), set the echo parameter in the `run()` function at the bottom of the test script (tests/01-run.py) to `True`. The test script will then offer a more detailed output. [scapy]: https://scapy.readthedocs.io/en/latest/
{ "pile_set_name": "Github" }
#ifndef __COMPONENTSTESTSCENE_H__ #define __COMPONENTSTESTSCENE_H__ #include "cocos2d.h" #include "cocos-ext.h" void runComponentsTestLayerTest(); class ComponentsTestLayer : public cocos2d::CCLayerColor { public: ComponentsTestLayer(); ~ComponentsTestLayer(); // Here's a difference. Method 'init' in cocos2d-x returns bool, // instead of returning 'id' in cocos2d-iphone virtual bool init(); // there's no 'id' in cpp, so we recommand to return the exactly class pointer static cocos2d::CCScene* scene(); // implement the "static node()" method manually CREATE_FUNC(ComponentsTestLayer); // init scene cocos2d::CCNode* createGameScene(); //back to Extensions Main Layer void toExtensionsMainLayer(cocos2d::CCObject *sender); }; #endif // __HELLOWORLD_SCENE_H__
{ "pile_set_name": "Github" }
// Copyright 2016 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package translate is a client for the Google Translation API. // See https://cloud.google.com/translation for details. package translate import ( "fmt" "net/http" "google.golang.org/api/option" htransport "google.golang.org/api/transport/http" "cloud.google.com/go/internal/version" raw "cloud.google.com/go/translate/internal/translate/v2" "golang.org/x/net/context" "golang.org/x/text/language" ) const userAgent = "gcloud-golang-translate/20161115" // Scope is the OAuth2 scope required by the Google Cloud Vision API. const Scope = raw.CloudPlatformScope // Client is a client for the translate API. type Client struct { raw *raw.Service } const prodAddr = "https://translation.googleapis.com/language/translate/" // NewClient constructs a new Client that can perform Translation operations. // // You can find or create API key for your project from the Credentials page of // the Developers Console (console.developers.google.com). func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { o := []option.ClientOption{ option.WithEndpoint(prodAddr), option.WithScopes(Scope), option.WithUserAgent(userAgent), } o = append(o, opts...) httpClient, endpoint, err := htransport.NewClient(ctx, o...) if err != nil { return nil, fmt.Errorf("dialing: %v", err) } rawService, err := raw.New(httpClient) if err != nil { return nil, fmt.Errorf("translate client: %v", err) } rawService.BasePath = endpoint return &Client{raw: rawService}, nil } // Close closes any resources held by the client. // Close should be called when the client is no longer needed. // It need not be called at program exit. func (c *Client) Close() error { return nil } // Translate one or more strings of text from a source language to a target // language. All inputs must be in the same language. // // The target parameter supplies the language to translate to. The supported // languages are listed at // https://cloud.google.com/translation/v2/translate-reference#supported_languages. // You can also call the SupportedLanguages method. // // The returned Translations appear in the same order as the inputs. func (c *Client) Translate(ctx context.Context, inputs []string, target language.Tag, opts *Options) ([]Translation, error) { call := c.raw.Translations.List(inputs, target.String()).Context(ctx) setClientHeader(call.Header()) if opts != nil { if s := opts.Source; s != language.Und { call.Source(s.String()) } if f := opts.Format; f != "" { call.Format(string(f)) } if m := opts.Model; m != "" { call.Model(m) } } res, err := call.Do() if err != nil { return nil, err } var ts []Translation for _, t := range res.Translations { var source language.Tag if t.DetectedSourceLanguage != "" { source, err = language.Parse(t.DetectedSourceLanguage) if err != nil { return nil, err } } ts = append(ts, Translation{ Text: t.TranslatedText, Source: source, Model: t.Model, }) } return ts, nil } // Options contains options for Translate. type Options struct { // Source is the language of the input strings. If empty, the service will // attempt to identify the source language automatically and return it within // the response. Source language.Tag // Format describes the format of the input texts. The choices are HTML or // Text. The default is HTML. Format Format // The model to use for translation. The choices are "nmt" or "base". The // default is "base". Model string } // The format of the input text. Used in Options.Format. type Format string // Constants for Options.Format. const ( HTML Format = "html" Text Format = "text" ) // A Translation contains the results of translating a piece of text. type Translation struct { // Text is the input text translated into the target language. Text string // Source is the detected language of the input text, if source was // not supplied to Client.Translate. If source was supplied, this field // will be empty. Source language.Tag // Model is the model that was used for translation. // It may not match the model provided as an option to Client.Translate. Model string } // DetectLanguage attempts to determine the language of the inputs. Each input // string may be in a different language. // // Each slice of Detections in the return value corresponds with one input // string. A slice of Detections holds multiple hypotheses for the language of // a single input string. func (c *Client) DetectLanguage(ctx context.Context, inputs []string) ([][]Detection, error) { call := c.raw.Detections.List(inputs).Context(ctx) setClientHeader(call.Header()) res, err := call.Do() if err != nil { return nil, err } var result [][]Detection for _, raws := range res.Detections { var ds []Detection for _, rd := range raws { tag, err := language.Parse(rd.Language) if err != nil { return nil, err } ds = append(ds, Detection{ Language: tag, Confidence: rd.Confidence, IsReliable: rd.IsReliable, }) } result = append(result, ds) } return result, nil } // Detection represents information about a language detected in an input. type Detection struct { // Language is the code of the language detected. Language language.Tag // Confidence is a number from 0 to 1, with higher numbers indicating more // confidence in the detection. Confidence float64 // IsReliable indicates whether the language detection result is reliable. IsReliable bool } // SupportedLanguages returns a list of supported languages for translation. // The target parameter is the language to use to return localized, human // readable names of supported languages. func (c *Client) SupportedLanguages(ctx context.Context, target language.Tag) ([]Language, error) { call := c.raw.Languages.List().Context(ctx).Target(target.String()) setClientHeader(call.Header()) res, err := call.Do() if err != nil { return nil, err } var ls []Language for _, l := range res.Languages { tag, err := language.Parse(l.Language) if err != nil { return nil, err } ls = append(ls, Language{ Name: l.Name, Tag: tag, }) } return ls, nil } // A Language describes a language supported for translation. type Language struct { // Name is the human-readable name of the language. Name string // Tag is a standard code for the language. Tag language.Tag } func setClientHeader(headers http.Header) { headers.Set("x-goog-api-client", fmt.Sprintf("gl-go/%s gccl/%s", version.Go(), version.Repo)) }
{ "pile_set_name": "Github" }
/*! * depd * Copyright(c) 2014-2015 Douglas Christopher Wilson * MIT Licensed */ 'use strict' /** * Module dependencies. * @private */ var EventEmitter = require('events').EventEmitter /** * Module exports. * @public */ lazyProperty(module.exports, 'callSiteToString', function callSiteToString () { var limit = Error.stackTraceLimit var obj = {} var prep = Error.prepareStackTrace function prepareObjectStackTrace (obj, stack) { return stack } Error.prepareStackTrace = prepareObjectStackTrace Error.stackTraceLimit = 2 // capture the stack Error.captureStackTrace(obj) // slice the stack var stack = obj.stack.slice() Error.prepareStackTrace = prep Error.stackTraceLimit = limit return stack[0].toString ? toString : require('./callsite-tostring') }) lazyProperty(module.exports, 'eventListenerCount', function eventListenerCount () { return EventEmitter.listenerCount || require('./event-listener-count') }) /** * Define a lazy property. */ function lazyProperty (obj, prop, getter) { function get () { var val = getter() Object.defineProperty(obj, prop, { configurable: true, enumerable: true, value: val }) return val } Object.defineProperty(obj, prop, { configurable: true, enumerable: true, get: get }) } /** * Call toString() on the obj */ function toString (obj) { return obj.toString() }
{ "pile_set_name": "Github" }
// mksyscall.pl -tags linux,mips64le syscall_linux.go syscall_linux_mips64x.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build linux,mips64le package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fchmodat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlinkat(dirfd int, path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, times *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimesat(dirfd int, path *byte, times *[2]Timeval) (err error) { _, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(times))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) { r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlJoin(cmd int, arg2 string) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(arg2) if err != nil { return } r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) { var _p0 *byte _p0, err = BytePtrFromString(arg3) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(arg4) if err != nil { return } r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) { var _p0 unsafe.Pointer if len(payload) > 0 { _p0 = unsafe.Pointer(&payload[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0) ret = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { _, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(arg) if err != nil { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) { var _p0 *byte _p0, err = BytePtrFromString(source) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(target) if err != nil { return } var _p2 *byte _p2, err = BytePtrFromString(fstype) if err != nil { return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Acct(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(description) if err != nil { return } var _p2 unsafe.Pointer if len(payload) > 0 { _p2 = unsafe.Pointer(&payload[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0) id = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtimex(buf *Timex) (state int, err error) { r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0) state = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ClockGettime(clockid int32, time *Timespec) (err error) { _, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) { r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(oldfd int) (fd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup3(oldfd int, newfd int, flags int) (err error) { _, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCreate(size int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCreate1(flag int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { _, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Eventfd(initval uint, flags int) (fd int, err error) { r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { Syscall(SYS_EXIT_GROUP, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fallocate(fd int, mode uint32, off int64, len int64) (err error) { _, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdents(fd int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrandom(buf []byte, flags int) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_GETRANDOM, uintptr(_p0), uintptr(len(buf)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettid() (tid int) { r0, _, _ := RawSyscall(SYS_GETTID, 0, 0, 0) tid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getxattr(path string, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(dest) > 0 { _p2 = unsafe.Pointer(&dest[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) { var _p0 *byte _p0, err = BytePtrFromString(pathname) if err != nil { return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyInit1(flags int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) { r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0) success = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, sig syscall.Signal) (err error) { _, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Klogctl(typ int, buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(dest) > 0 { _p2 = unsafe.Pointer(&dest[0]) } else { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listxattr(path string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Llistxattr(path string, dest []byte) (sz int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(dest) > 0 { _p1 = unsafe.Pointer(&dest[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) sz = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lremovexattr(path string, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lsetxattr(path string, attr string, data []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(data) > 0 { _p2 = unsafe.Pointer(&data[0]) } else { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdirat(dirfd int, path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func PivotRoot(newroot string, putold string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(newroot) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(putold) if err != nil { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) { _, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) { _, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PSELECT6, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Removexattr(path string, attr string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(oldpath) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(newpath) if err != nil { return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) { var _p0 *byte _p0, err = BytePtrFromString(keyType) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(description) if err != nil { return } var _p2 *byte _p2, err = BytePtrFromString(callback) if err != nil { return } r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0) id = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setdomainname(p []byte) (err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sethostname(p []byte) (err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setns(fd int, nstype int) (err error) { _, _, e1 := Syscall(SYS_SETNS, uintptr(fd), uintptr(nstype), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setxattr(path string, attr string, data []byte, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(attr) if err != nil { return } var _p2 unsafe.Pointer if len(data) > 0 { _p2 = unsafe.Pointer(&data[0]) } else { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() { Syscall(SYS_SYNC, 0, 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Syncfs(fd int) (err error) { _, _, e1 := Syscall(SYS_SYNCFS, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sysinfo(info *Sysinfo_t) (err error) { _, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Tgkill(tgid int, tid int, sig syscall.Signal) (err error) { _, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Times(tms *Tms) (ticks uintptr, err error) { r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0) ticks = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(mask int) (oldmask int) { r0, _, _ := RawSyscall(SYS_UMASK, uintptr(mask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Uname(buf *Utsname) (err error) { _, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(target string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(target) if err != nil { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unshare(flags int) (err error) { _, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ustat(dev int, ubuf *Ustat_t) (err error) { _, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func exitThread(code int) (err error) { _, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readlen(fd int, p *byte, np int) (n int, err error) { r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writelen(fd int, p *byte, np int) (n int, err error) { r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, advice int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func 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 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 Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func 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_NEWFSTATAT, 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 Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (euid int) { r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) euid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, n int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func 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 Pread(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pwrite(fd int, p []byte, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (off int64, err error) { r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) off = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0) written = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setfsgid(gid int) (err error) { _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setfsuid(uid int) (err error) { _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(resource int, rlim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) { r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags)) n = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, buf *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func SyncFileRange(fd int, off int64, n int64, flags int) (err error) { _, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(n int, list *_Gid_t) (nn int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) nn = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(n int, list *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func 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 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 fstat(fd int, st *stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(st)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func lstat(path string, st *stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func stat(path string, st *stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), 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" }
# 效果展示 <a name="通用ppocr_server_1.1效果展示"></a> ## 通用ppocr_server_1.1效果展示 <div align="center"> <img src="../imgs_results/1101.jpg" width="800"> <img src="../imgs_results/1102.jpg" width="800"> <img src="../imgs_results/1103.jpg" width="800"> <img src="../imgs_results/1104.jpg" width="800"> <img src="../imgs_results/1105.jpg" width="800"> <img src="../imgs_results/1106.jpg" width="800"> </div> <a name="英文识别模型效果展示"></a> ## 英文识别模型效果展示 <div align="center"> <img src="../imgs_results/img_12.jpg" width="800"> </div> <a name="多语言识别模型效果展示"></a> ## 多语言识别模型效果展示 <div align="center"> <img src="../imgs_results/1110.jpg" width="800"> <img src="../imgs_results/1112.jpg" width="800"> </div> <a name="超轻量ppocr_mobile_1.0效果展示"></a> ## 超轻量ppocr_mobile_1.0效果展示 <div align="center"> <img src="../imgs_results/1.jpg" width="800"> <img src="../imgs_results/7.jpg" width="800"> <img src="../imgs_results/6.jpg" width="800"> <img src="../imgs_results/16.png" width="800"> </div> <a name="通用ppocr_server_1.0效果展示"></a> ## 通用ppocr_server_1.0效果展示 <div align="center"> <img src="../imgs_results/chinese_db_crnn_server/11.jpg" width="800"> <img src="../imgs_results/chinese_db_crnn_server/2.jpg" width="800"> <img src="../imgs_results/chinese_db_crnn_server/8.jpg" width="800"> </div>
{ "pile_set_name": "Github" }
/* Configuration defines for installed libtiff. This file maintained for backward compatibility. Do not use definitions from this file in your programs. */ #ifndef _TIFFCONF_ #define _TIFFCONF_ /* Define to 1 if the system has the type `int16'. */ /* #undef HAVE_INT16 */ /* Define to 1 if the system has the type `int32'. */ /* #undef HAVE_INT32 */ /* Define to 1 if the system has the type `int8'. */ /* #undef HAVE_INT8 */ /* The size of a `int', as computed by sizeof. */ #define SIZEOF_INT 4 /* Signed 8-bit type */ #define TIFF_INT8_T signed char /* Unsigned 8-bit type */ #define TIFF_UINT8_T unsigned char /* Signed 16-bit type */ #define TIFF_INT16_T signed short /* Unsigned 16-bit type */ #define TIFF_UINT16_T unsigned short /* Signed 32-bit type formatter */ #define TIFF_INT32_FORMAT "%d" /* Signed 32-bit type */ #define TIFF_INT32_T signed int /* Unsigned 32-bit type formatter */ #define TIFF_UINT32_FORMAT "%u" /* Unsigned 32-bit type */ #define TIFF_UINT32_T unsigned int /* Signed 64-bit type formatter */ #define TIFF_INT64_FORMAT "%I64d" /* Signed 64-bit type */ #define TIFF_INT64_T signed __int64 /* Unsigned 64-bit type formatter */ #define TIFF_UINT64_FORMAT "%I64u" /* Unsigned 64-bit type */ #define TIFF_UINT64_T unsigned __int64 /* Signed size type */ #if defined(_WIN64) #define TIFF_SSIZE_T signed __int64 #else #define TIFF_SSIZE_T signed int #endif /* Signed size type formatter */ #if defined(_WIN64) #define TIFF_SSIZE_FORMAT "%I64d" #else #define TIFF_SSIZE_FORMAT "%ld" #endif /* Pointer difference type */ #define TIFF_PTRDIFF_T long /* Compatibility stuff. */ /* Define as 0 or 1 according to the floating point format suported by the machine */ #define HAVE_IEEEFP 1 /* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */ #define HOST_FILLORDER FILLORDER_LSB2MSB /* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian (Intel) */ #define HOST_BIGENDIAN 0 /* Support CCITT Group 3 & 4 algorithms */ #define CCITT_SUPPORT 1 /* Support JPEG compression (requires IJG JPEG library) */ /* #undef JPEG_SUPPORT */ /* Support JBIG compression (requires JBIG-KIT library) */ /* #undef JBIG_SUPPORT */ /* Support LogLuv high dynamic range encoding */ #define LOGLUV_SUPPORT 1 /* Support LZW algorithm */ #define LZW_SUPPORT 1 /* Support NeXT 2-bit RLE algorithm */ #define NEXT_SUPPORT 1 /* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation fails with unpatched IJG JPEG library) */ /* #undef OJPEG_SUPPORT */ /* Support Macintosh PackBits algorithm */ #define PACKBITS_SUPPORT 1 /* Support Pixar log-format algorithm (requires Zlib) */ /* #undef PIXARLOG_SUPPORT */ /* Support ThunderScan 4-bit RLE algorithm */ #define THUNDER_SUPPORT 1 /* Support Deflate compression */ /* #undef ZIP_SUPPORT */ /* Support strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of ~8Kb to reduce memory usage) */ #define STRIPCHOP_DEFAULT TIFF_STRIPCHOP /* Enable SubIFD tag (330) support */ #define SUBIFD_SUPPORT 1 /* Treat extra sample as alpha (default enabled). The RGBA interface will treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA files but don't mark the alpha properly. */ #define DEFAULT_EXTRASAMPLE_AS_ALPHA 1 /* Pick up YCbCr subsampling info from the JPEG data stream to support files lacking the tag (default enabled). */ #define CHECK_JPEG_YCBCR_SUBSAMPLING 1 /* Support MS MDI magic number files as TIFF */ /* #undef MDI_SUPPORT */ /* * Feature support definitions. * XXX: These macros are obsoleted. Don't use them in your apps! * Macros stays here for backward compatibility and should be always defined. */ #define COLORIMETRY_SUPPORT #define YCBCR_SUPPORT #define CMYK_SUPPORT #define ICC_SUPPORT #define PHOTOSHOP_SUPPORT #define IPTC_SUPPORT #endif /* _TIFFCONF_ */ /* * Local Variables: * mode: c * c-basic-offset: 8 * fill-column: 78 * End: */
{ "pile_set_name": "Github" }
@echo off SET IDEDIR=%~dp0\..\ide SET LAUNCHER=opp_ide SET DEFAULT_WORKSPACE_ARGS=-vmargs -Dosgi.instance.area.default=%IDEDIR%\..\samples echo Starting the OMNEST IDE... start %IDEDIR%\%LAUNCHER% %* %DEFAULT_WORKSPACE_ARGS% >out.log
{ "pile_set_name": "Github" }
<GMLFeatureClassList> <GMLFeatureClass> <Name>SBBdry</Name> <ElementPath>SBBdry</ElementPath> <SRSName>urn:ogc:def:crs:EPSG::6668</SRSName> <GeometryElementPath>loc</GeometryElementPath> <GeometryType>LineString</GeometryType> <PropertyDefn> <Name>fid</Name> <ElementPath>fid</ElementPath> <Type>String</Type> </PropertyDefn> <PropertyDefn> <Name>lfSpanFr</Name> <ElementPath>lfSpanFr|timePosition</ElementPath> <Type>String</Type> </PropertyDefn> <PropertyDefn> <Name>lfSpanTo</Name> <ElementPath>lfSpanTo|timePosition</ElementPath> <Type>String</Type> </PropertyDefn> <PropertyDefn> <Name>devDate</Name> <ElementPath>devDate|timePosition</ElementPath> <Type>String</Type> </PropertyDefn> <PropertyDefn> <Name>orgGILvl</Name> <ElementPath>orgGILvl</ElementPath> <Type>String</Type> </PropertyDefn> <PropertyDefn> <Name>orgMDId</Name> <ElementPath>orgMDId</ElementPath> <Type>String</Type> </PropertyDefn> <PropertyDefn> <Name>vis</Name> <ElementPath>vis</ElementPath> <Type>String</Type> </PropertyDefn> </GMLFeatureClass> </GMLFeatureClassList>
{ "pile_set_name": "Github" }
# Generated by h2py from /usr/include/netinet/in.h IPPROTO_IP = 0 IPPROTO_HOPOPTS = 0 IPPROTO_ICMP = 1 IPPROTO_IGMP = 2 IPPROTO_GGP = 3 IPPROTO_IPV4 = 4 IPPROTO_IPIP = IPPROTO_IPV4 IPPROTO_TCP = 6 IPPROTO_ST = 7 IPPROTO_EGP = 8 IPPROTO_PIGP = 9 IPPROTO_RCCMON = 10 IPPROTO_NVPII = 11 IPPROTO_PUP = 12 IPPROTO_ARGUS = 13 IPPROTO_EMCON = 14 IPPROTO_XNET = 15 IPPROTO_CHAOS = 16 IPPROTO_UDP = 17 IPPROTO_MUX = 18 IPPROTO_MEAS = 19 IPPROTO_HMP = 20 IPPROTO_PRM = 21 IPPROTO_IDP = 22 IPPROTO_TRUNK1 = 23 IPPROTO_TRUNK2 = 24 IPPROTO_LEAF1 = 25 IPPROTO_LEAF2 = 26 IPPROTO_RDP = 27 IPPROTO_IRTP = 28 IPPROTO_TP = 29 IPPROTO_BLT = 30 IPPROTO_NSP = 31 IPPROTO_INP = 32 IPPROTO_SEP = 33 IPPROTO_3PC = 34 IPPROTO_IDPR = 35 IPPROTO_XTP = 36 IPPROTO_DDP = 37 IPPROTO_CMTP = 38 IPPROTO_TPXX = 39 IPPROTO_IL = 40 IPPROTO_IPV6 = 41 IPPROTO_SDRP = 42 IPPROTO_ROUTING = 43 IPPROTO_FRAGMENT = 44 IPPROTO_IDRP = 45 IPPROTO_RSVP = 46 IPPROTO_GRE = 47 IPPROTO_MHRP = 48 IPPROTO_BHA = 49 IPPROTO_ESP = 50 IPPROTO_AH = 51 IPPROTO_INLSP = 52 IPPROTO_SWIPE = 53 IPPROTO_NHRP = 54 IPPROTO_ICMPV6 = 58 IPPROTO_NONE = 59 IPPROTO_DSTOPTS = 60 IPPROTO_AHIP = 61 IPPROTO_CFTP = 62 IPPROTO_HELLO = 63 IPPROTO_SATEXPAK = 64 IPPROTO_KRYPTOLAN = 65 IPPROTO_RVD = 66 IPPROTO_IPPC = 67 IPPROTO_ADFS = 68 IPPROTO_SATMON = 69 IPPROTO_VISA = 70 IPPROTO_IPCV = 71 IPPROTO_CPNX = 72 IPPROTO_CPHB = 73 IPPROTO_WSN = 74 IPPROTO_PVP = 75 IPPROTO_BRSATMON = 76 IPPROTO_ND = 77 IPPROTO_WBMON = 78 IPPROTO_WBEXPAK = 79 IPPROTO_EON = 80 IPPROTO_VMTP = 81 IPPROTO_SVMTP = 82 IPPROTO_VINES = 83 IPPROTO_TTP = 84 IPPROTO_IGP = 85 IPPROTO_DGP = 86 IPPROTO_TCF = 87 IPPROTO_IGRP = 88 IPPROTO_OSPFIGP = 89 IPPROTO_SRPC = 90 IPPROTO_LARP = 91 IPPROTO_MTP = 92 IPPROTO_AX25 = 93 IPPROTO_IPEIP = 94 IPPROTO_MICP = 95 IPPROTO_SCCSP = 96 IPPROTO_ETHERIP = 97 IPPROTO_ENCAP = 98 IPPROTO_APES = 99 IPPROTO_GMTP = 100 IPPROTO_IPCOMP = 108 IPPROTO_PIM = 103 IPPROTO_PGM = 113 IPPROTO_DIVERT = 254 IPPROTO_RAW = 255 IPPROTO_MAX = 256 IPPROTO_DONE = 257 IPPORT_RESERVED = 1024 IPPORT_USERRESERVED = 5000 IPPORT_HIFIRSTAUTO = 49152 IPPORT_HILASTAUTO = 65535 IPPORT_RESERVEDSTART = 600 def IN_CLASSA(i): return (((u_int32_t)(i) & 0x80000000) == 0) IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 24 IN_CLASSA_HOST = 0x00ffffff IN_CLASSA_MAX = 128 def IN_CLASSB(i): return (((u_int32_t)(i) & 0xc0000000) == 0x80000000) IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 16 IN_CLASSB_HOST = 0x0000ffff IN_CLASSB_MAX = 65536 def IN_CLASSC(i): return (((u_int32_t)(i) & 0xe0000000) == 0xc0000000) IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 8 IN_CLASSC_HOST = 0x000000ff def IN_CLASSD(i): return (((u_int32_t)(i) & 0xf0000000) == 0xe0000000) IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 28 IN_CLASSD_HOST = 0x0fffffff def IN_MULTICAST(i): return IN_CLASSD(i) def IN_EXPERIMENTAL(i): return (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) def IN_BADCLASS(i): return (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) INADDR_NONE = 0xffffffff IN_LOOPBACKNET = 127 INET_ADDRSTRLEN = 16 IP_OPTIONS = 1 IP_HDRINCL = 2 IP_TOS = 3 IP_TTL = 4 IP_RECVOPTS = 5 IP_RECVRETOPTS = 6 IP_RECVDSTADDR = 7 IP_RETOPTS = 8 IP_MULTICAST_IF = 9 IP_MULTICAST_TTL = 10 IP_MULTICAST_LOOP = 11 IP_ADD_MEMBERSHIP = 12 IP_DROP_MEMBERSHIP = 13 IP_MULTICAST_VIF = 14 IP_RSVP_ON = 15 IP_RSVP_OFF = 16 IP_RSVP_VIF_ON = 17 IP_RSVP_VIF_OFF = 18 IP_PORTRANGE = 19 IP_RECVIF = 20 IP_IPSEC_POLICY = 21 IP_FAITH = 22 IP_FW_ADD = 50 IP_FW_DEL = 51 IP_FW_FLUSH = 52 IP_FW_ZERO = 53 IP_FW_GET = 54 IP_FW_RESETLOG = 55 IP_DUMMYNET_CONFIGURE = 60 IP_DUMMYNET_DEL = 61 IP_DUMMYNET_FLUSH = 62 IP_DUMMYNET_GET = 64 IP_DEFAULT_MULTICAST_TTL = 1 IP_DEFAULT_MULTICAST_LOOP = 1 IP_MAX_MEMBERSHIPS = 20 IP_PORTRANGE_DEFAULT = 0 IP_PORTRANGE_HIGH = 1 IP_PORTRANGE_LOW = 2 IPPROTO_MAXID = (IPPROTO_AH + 1) IPCTL_FORWARDING = 1 IPCTL_SENDREDIRECTS = 2 IPCTL_DEFTTL = 3 IPCTL_DEFMTU = 4 IPCTL_RTEXPIRE = 5 IPCTL_RTMINEXPIRE = 6 IPCTL_RTMAXCACHE = 7 IPCTL_SOURCEROUTE = 8 IPCTL_DIRECTEDBROADCAST = 9 IPCTL_INTRQMAXLEN = 10 IPCTL_INTRQDROPS = 11 IPCTL_STATS = 12 IPCTL_ACCEPTSOURCEROUTE = 13 IPCTL_FASTFORWARDING = 14 IPCTL_KEEPFAITH = 15 IPCTL_GIF_TTL = 16 IPCTL_MAXID = 17 # Included from netinet6/in6.h # Included from sys/queue.h def SLIST_HEAD_INITIALIZER(head): return \ def SLIST_ENTRY(type): return \ def STAILQ_HEAD_INITIALIZER(head): return \ def STAILQ_ENTRY(type): return \ def LIST_HEAD_INITIALIZER(head): return \ def LIST_ENTRY(type): return \ def TAILQ_HEAD_INITIALIZER(head): return \ def TAILQ_ENTRY(type): return \ def CIRCLEQ_ENTRY(type): return \ __KAME_VERSION = "20000701/FreeBSD-current" IPV6PORT_RESERVED = 1024 IPV6PORT_ANONMIN = 49152 IPV6PORT_ANONMAX = 65535 IPV6PORT_RESERVEDMIN = 600 IPV6PORT_RESERVEDMAX = (IPV6PORT_RESERVED-1) INET6_ADDRSTRLEN = 46 IPV6_ADDR_INT32_ONE = 1 IPV6_ADDR_INT32_TWO = 2 IPV6_ADDR_INT32_MNL = 0xff010000 IPV6_ADDR_INT32_MLL = 0xff020000 IPV6_ADDR_INT32_SMP = 0x0000ffff IPV6_ADDR_INT16_ULL = 0xfe80 IPV6_ADDR_INT16_USL = 0xfec0 IPV6_ADDR_INT16_MLL = 0xff02 IPV6_ADDR_INT32_ONE = 0x01000000 IPV6_ADDR_INT32_TWO = 0x02000000 IPV6_ADDR_INT32_MNL = 0x000001ff IPV6_ADDR_INT32_MLL = 0x000002ff IPV6_ADDR_INT32_SMP = 0xffff0000 IPV6_ADDR_INT16_ULL = 0x80fe IPV6_ADDR_INT16_USL = 0xc0fe IPV6_ADDR_INT16_MLL = 0x02ff def IN6_IS_ADDR_UNSPECIFIED(a): return \ def IN6_IS_ADDR_LOOPBACK(a): return \ def IN6_IS_ADDR_V4COMPAT(a): return \ def IN6_IS_ADDR_V4MAPPED(a): return \ IPV6_ADDR_SCOPE_NODELOCAL = 0x01 IPV6_ADDR_SCOPE_LINKLOCAL = 0x02 IPV6_ADDR_SCOPE_SITELOCAL = 0x05 IPV6_ADDR_SCOPE_ORGLOCAL = 0x08 IPV6_ADDR_SCOPE_GLOBAL = 0x0e __IPV6_ADDR_SCOPE_NODELOCAL = 0x01 __IPV6_ADDR_SCOPE_LINKLOCAL = 0x02 __IPV6_ADDR_SCOPE_SITELOCAL = 0x05 __IPV6_ADDR_SCOPE_ORGLOCAL = 0x08 __IPV6_ADDR_SCOPE_GLOBAL = 0x0e def IN6_IS_ADDR_LINKLOCAL(a): return \ def IN6_IS_ADDR_SITELOCAL(a): return \ def IN6_IS_ADDR_MC_NODELOCAL(a): return \ def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ def IN6_IS_ADDR_MC_SITELOCAL(a): return \ def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ def IN6_IS_ADDR_MC_GLOBAL(a): return \ def IN6_IS_ADDR_MC_NODELOCAL(a): return \ def IN6_IS_ADDR_MC_LINKLOCAL(a): return \ def IN6_IS_ADDR_MC_SITELOCAL(a): return \ def IN6_IS_ADDR_MC_ORGLOCAL(a): return \ def IN6_IS_ADDR_MC_GLOBAL(a): return \ def IN6_IS_SCOPE_LINKLOCAL(a): return \ IPV6_OPTIONS = 1 IPV6_RECVOPTS = 5 IPV6_RECVRETOPTS = 6 IPV6_RECVDSTADDR = 7 IPV6_RETOPTS = 8 IPV6_SOCKOPT_RESERVED1 = 3 IPV6_UNICAST_HOPS = 4 IPV6_MULTICAST_IF = 9 IPV6_MULTICAST_HOPS = 10 IPV6_MULTICAST_LOOP = 11 IPV6_JOIN_GROUP = 12 IPV6_LEAVE_GROUP = 13 IPV6_PORTRANGE = 14 ICMP6_FILTER = 18 IPV6_PKTINFO = 19 IPV6_HOPLIMIT = 20 IPV6_NEXTHOP = 21 IPV6_HOPOPTS = 22 IPV6_DSTOPTS = 23 IPV6_RTHDR = 24 IPV6_PKTOPTIONS = 25 IPV6_CHECKSUM = 26 IPV6_BINDV6ONLY = 27 IPV6_IPSEC_POLICY = 28 IPV6_FAITH = 29 IPV6_FW_ADD = 30 IPV6_FW_DEL = 31 IPV6_FW_FLUSH = 32 IPV6_FW_ZERO = 33 IPV6_FW_GET = 34 IPV6_RTHDR_LOOSE = 0 IPV6_RTHDR_STRICT = 1 IPV6_RTHDR_TYPE_0 = 0 IPV6_DEFAULT_MULTICAST_HOPS = 1 IPV6_DEFAULT_MULTICAST_LOOP = 1 IPV6_PORTRANGE_DEFAULT = 0 IPV6_PORTRANGE_HIGH = 1 IPV6_PORTRANGE_LOW = 2 IPV6PROTO_MAXID = (IPPROTO_PIM + 1) IPV6CTL_FORWARDING = 1 IPV6CTL_SENDREDIRECTS = 2 IPV6CTL_DEFHLIM = 3 IPV6CTL_DEFMTU = 4 IPV6CTL_FORWSRCRT = 5 IPV6CTL_STATS = 6 IPV6CTL_MRTSTATS = 7 IPV6CTL_MRTPROTO = 8 IPV6CTL_MAXFRAGPACKETS = 9 IPV6CTL_SOURCECHECK = 10 IPV6CTL_SOURCECHECK_LOGINT = 11 IPV6CTL_ACCEPT_RTADV = 12 IPV6CTL_KEEPFAITH = 13 IPV6CTL_LOG_INTERVAL = 14 IPV6CTL_HDRNESTLIMIT = 15 IPV6CTL_DAD_COUNT = 16 IPV6CTL_AUTO_FLOWLABEL = 17 IPV6CTL_DEFMCASTHLIM = 18 IPV6CTL_GIF_HLIM = 19 IPV6CTL_KAME_VERSION = 20 IPV6CTL_USE_DEPRECATED = 21 IPV6CTL_RR_PRUNE = 22 IPV6CTL_MAPPED_ADDR = 23 IPV6CTL_BINDV6ONLY = 24 IPV6CTL_RTEXPIRE = 25 IPV6CTL_RTMINEXPIRE = 26 IPV6CTL_RTMAXCACHE = 27 IPV6CTL_MAXID = 28
{ "pile_set_name": "Github" }
export const ADD_NOTIFICATION = 'ADD_NOTIFICATION'; export const ADD_PAY_METHOD = 'ADD_PAY_METHOD'; export const APP_ERROR = 'APP_ERROR'; export const BEGIN_PROCESSING = 'BEGIN_PROCESSING'; export const CLOSE_MODAL = 'CLOSE_MODAL'; export const COMPLETE_TRANSACTION = 'COMPLETE_TRANSACTION'; export const CREDIT_CARD_SUBMISSION_ERRORS = 'CREDIT_CARD_SUBMISSION_ERRORS'; export const DEL_PAY_METHOD = 'DEL_PAY_METHOD'; export const GOT_BRAINTREE_TOKEN = 'GOT_BRAINTREE_TOKEN'; export const GOT_CSRF_TOKEN = 'GOT_CSRF_TOKEN'; export const GOT_PAY_METHODS = 'GOT_PAY_METHODS'; export const GOT_SUBS_BY_PAY_METHOD = 'GOT_SUBS_BY_PAY_METHOD'; export const GOT_USER_SUBS = 'GOT_USER_SUBS'; export const GOT_USER_TRANSACTIONS = 'GOT_USER_TRANSACTIONS'; export const LOADING_SUBS_BY_PAY_METHOD = 'LOADING_SUBS_BY_PAY_METHOD'; export const LOADING_USER_SUBS = 'LOADING_USER_SUBS'; export const LOADING_USER_TRANSACTIONS = 'LOADING_USER_TRANSACTIONS'; export const PAY_WITH_NEW_CARD = 'PAY_WITH_NEW_CARD'; export const REMOVE_NOTIFICATION = 'REMOVE_NOTIFICATION'; export const SHOW_ADD_PAY_METHOD = 'SHOW_ADD_PAY_METHOD'; export const SHOW_CONFIRM_DEL_PAY_METHOD = 'SHOW_CONFIRM_DEL_PAY_METHOD'; export const SHOW_DEL_PAY_METHOD = 'SHOW_DEL_PAY_METHOD'; export const SHOW_HISTORY = 'SHOW_HISTORY'; export const SHOW_MY_ACCOUNT = 'SHOW_MY_ACCOUNT'; export const SHOW_PAY_METHODS = 'SHOW_PAY_METHODS'; export const SHOW_SIGN_IN = 'SHOW_SIGN_IN'; export const SHOW_SIGN_OUT = 'SHOW_SIGN_OUT'; export const SHOW_SUBS = 'SHOW_SUBS'; export const STOP_PROCESSING = 'STOP_PROCESSING'; export const USER_SIGNED_IN = 'USER_SIGNED_IN'; export const USER_SIGNED_OUT = 'USER_SIGNED_OUT';
{ "pile_set_name": "Github" }
# # This is a generic function to test that restoring registers during unwinding work correctly. # .text .globl _unwind_tester _unwind_tester: LFB3: pushq %rbp LCFI45: movq %rsp, %rbp LCFI46: movq %rbx, -40(%rbp) LCFI47: movq %r12, -32(%rbp) LCFI48: movq %r13, -24(%rbp) LCFI49: movq %r14, -16(%rbp) LCFI50: movq %r15, -8(%rbp) LCFI51: subq $48, %rsp LCFI52: # load magic values into non-volatile registers movq $0x1234567887654321, %rbx movq $0x02468ACEECA86420, %r12 movq $0x13579BDFFDB97531, %r13 movq $0x1122334455667788, %r14 movq $0x0022446688AACCEE, %r15 # call test function which will invoke unwinder which "returns" here call *%rdi # verify that non-volatile registers still contain magic values movq $0x1234567887654321, %rax cmpq %rax, %rbx jne L2 movq $0x02468ACEECA86420, %rax cmpq %rax, %r12 jne L2 movq $0x13579BDFFDB97531, %rax cmpq %rax, %r13 jne L2 movq $0x1122334455667788, %rax cmpq %rax, %r14 jne L2 movq $0x0022446688AACCEE, %rax cmpq %rax, %r15 jne L2 movl $0, %eax jmp L3 L2: movl $1, %eax L3: movq -40(%rbp), %rbx movq -32(%rbp), %r12 movq -24(%rbp), %r13 movq -16(%rbp), %r14 movq -8(%rbp), %r15 leave ret LFE3: .section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support EH_frame1: .set L$set$0,LECIE1-LSCIE1 .long L$set$0 # Length of Common Information Entry LSCIE1: .long 0x0 # CIE Identifier Tag .byte 0x1 # CIE Version .ascii "zR\0" # CIE Augmentation .byte 0x1 # uleb128 0x1; CIE Code Alignment Factor .byte 0x78 # sleb128 -8; CIE Data Alignment Factor .byte 0x10 # CIE RA Column .byte 0x1 # uleb128 0x1; Augmentation size .byte 0x10 # FDE Encoding (pcrel) .byte 0xc # DW_CFA_def_cfa .byte 0x7 # uleb128 0x7 .byte 0x8 # uleb128 0x8 .byte 0x90 # DW_CFA_offset, column 0x10 .byte 0x1 # uleb128 0x1 .align 3 LECIE1: .globl _unwind_tester.eh _unwind_tester.eh: LSFDE23: .set L$set$52,LEFDE23-LASFDE23 .long L$set$52 # FDE Length LASFDE23: .long LASFDE23-EH_frame1 # FDE CIE offset .quad LFB3-. # FDE initial location .set L$set$53,LFE3-LFB3 .quad L$set$53 # FDE address range .byte 0x0 # uleb128 0x0; Augmentation size .byte 0x4 # DW_CFA_advance_loc4 .set L$set$54,LCFI45-LFB3 .long L$set$54 .byte 0xe # DW_CFA_def_cfa_offset .byte 0x10 # uleb128 0x10 .byte 0x86 # DW_CFA_offset, column 0x6 .byte 0x2 # uleb128 0x2 .byte 0x4 # DW_CFA_advance_loc4 .set L$set$55,LCFI46-LCFI45 .long L$set$55 .byte 0xd # DW_CFA_def_cfa_register .byte 0x6 # uleb128 0x6 .byte 0x4 # DW_CFA_advance_loc4 .set L$set$56,LCFI52-LCFI46 .long L$set$56 .byte 0x8f # DW_CFA_offset, column 0xf .byte 0x3 # uleb128 0x3 .byte 0x8e # DW_CFA_offset, column 0xe .byte 0x4 # uleb128 0x4 .byte 0x8d # DW_CFA_offset, column 0xd .byte 0x5 # uleb128 0x5 .byte 0x8c # DW_CFA_offset, column 0xc .byte 0x6 # uleb128 0x6 .byte 0x83 # DW_CFA_offset, column 0x3 .byte 0x7 # uleb128 0x7 .align 3 LEFDE23:
{ "pile_set_name": "Github" }
body { font-size: 16px; color: #fff; background-color: #61122f; font-family: 'Oxygen', sans-serif; } /** HEADER **/ #header-nav { background-color: #f6b319; border-radius: 0; border: 0; } #logo-img { background: url('../images/restaurant-logo_large.png') no-repeat; width: 150px; height: 150px; margin: 10px 15px 10px 0; } .navbar-brand { padding-top: 25px; } .navbar-brand h1 { /* Restaurant name */ font-family: 'Lora', serif; color: #557c3e; font-size: 1.5em; text-transform: uppercase; font-weight: bold; text-shadow: 1px 1px 1px #222; margin-top: 0; margin-bottom: 0; line-height: .75; } .navbar-brand a:hover, .navbar-brand a:focus { text-decoration: none; } .navbar-brand p { /* Kosher cert */ color: #000; text-transform: uppercase; font-size: .7em; margin-top: 15px; } .navbar-brand p span { /* Star-K */ vertical-align: middle; } #nav-list { margin-top: 10px; } #nav-list a { color: #951C49; text-align: center; } #nav-list a:hover { background: #E7E7E7; } #nav-list a span { font-size: 1.8em; } #phone { margin-top: 5px; } #phone a { /* Phone number */ text-align: right; padding-bottom: 0; } #phone div { /* We Deliver */ color: #557c3e; text-align: right; padding-right: 15px; } .navbar-header button.navbar-toggle, .navbar-header .icon-bar { border: 1px solid #61122f; } .navbar-header button.navbar-toggle { clear: both; margin-top: -30px; } /* END HEADER */ /* FOOTER */ .panel-footer { margin-top: 30px; padding-top: 35px; padding-bottom: 30px; background-color: #222; border-top: 0; } .panel-footer div.row { margin-bottom: 35px; } #hours, #address { line-height: 2; } #hours > span, #address > span { font-size: 1.3em; } #address p { color: #557c3e; font-size: .8em; line-height: 1.8; } #testimonials { font-style: italic; } #testimonials p:nth-child(2) { margin-top: 25px; } /* END FOOTER */ /* HOME PAGE */ .container .jumbotron { box-shadow: 0 0 50px #3F0C1F; border: 2px solid #3F0C1F; } #menu-tile, #specials-tile, #map-tile { height: 250px; width: 100%; margin-bottom: 15px; position: relative; border: 2px solid #3F0C1F; overflow: hidden; } #menu-tile:hover, #specials-tile:hover, #map-tile:hover { box-shadow: 0 1px 5px 1px #cccccc; } #menu-tile { background: url('../images/menu-tile.jpg') no-repeat; background-position: center; } #specials-tile { background: url('../images/specials-tile.jpg') no-repeat; background-position: center; } #menu-tile span, #specials-tile span, #map-tile span { position: absolute; bottom: 0; right: 0; width: 100%; text-align: center; font-size: 1.6em; text-transform: uppercase; background-color: #000; color: #fff; opacity: .8; } /* END HOME PAGE */ /* MENU CATEGORIES PAGE */ .category-tile { position: relative; border: 2px solid #3F0C1F; overflow: hidden; width: 200px; height: 200px; margin: 0 auto 15px; } .category-tile span { position: absolute; bottom: 0; right: 0; width: 100%; text-align: center; font-size: 1.2em; text-transform: uppercase; background-color: #000; color: #fff; opacity: .8; } .category-tile:hover { box-shadow: 0 1px 5px 1px #cccccc; } #menu-categories-title + div { margin-bottom: 50px; } /* END MENU CATEGORIES PAGE */ /* SINGLE CATEGORY PAGE */ .menu-item-tile { margin-bottom: 25px; } .menu-item-tile hr { width: 80%; } .menu-item-tile .menu-item-price { font-size: 1.1em; text-align: right; margin-top: -15px; margin-right: -15px; } .menu-item-tile .menu-item-price span { font-size: .6em; } .menu-item-photo { position: relative; border: 2px solid #3F0C1F; overflow: hidden; padding: 0; margin-right: -15px; margin-left: auto; margin-bottom: 20px; max-width: 250px; } .menu-item-photo div { position: absolute; bottom: 0; right: 0; width: 80px; background-color: #557c3e; text-align: center; } .menu-item-description { padding-right: 30px; } h3.menu-item-title { margin: 0 0 10px; } .menu-item-details { font-size: .9em; font-style: italic; } /* END SINGLE CATEGORY PAGE */ /********** Large devices only **********/ @media (min-width: 1200px) { .container .jumbotron { background: url('../images/jumbotron_1200.jpg') no-repeat; height: 675px; } } /********** Medium devices only **********/ @media (min-width: 992px) and (max-width: 1199px) { /* Header */ #logo-img { background: url('../images/restaurant-logo_medium.png') no-repeat; width: 100px; height: 100px; margin: 5px 5px 5px 0; } /* End Header */ /* Home Page */ .container .jumbotron { background: url('../images/jumbotron_992.jpg') no-repeat; height: 558px; } /* End Home Page */ } /********** Small devices only **********/ @media (min-width: 768px) and (max-width: 991px) { /* Home Page */ .container .jumbotron { background: url('../images/jumbotron_768.jpg') no-repeat; height: 432px; } /* End Home Page */ } /********** Extra small devices only **********/ @media (max-width: 767px) { /* Header */ .navbar-brand { padding-top: 10px; height: 80px; } .navbar-brand h1 { /* Restaurant name */ padding-top: 10px; font-size: 5vw; /* 1vw = 1% of viewport width */ } .navbar-brand p { /* Kosher cert */ font-size: .6em; margin-top: 12px; } .navbar-brand p img { /* Star-K */ height: 20px; } #collapsable-nav a { /* Collapsed nav menu text */ font-size: 1.2em; } #collapsable-nav a span { /* Collapsed nav menu glyph */ font-size: 1em; margin-right: 5px; } #call-btn > a { font-size: 1.5em; display: block; margin: 0 20px; padding: 10px; border: 2px solid #fff; background-color: #f6b319; color: #951c49; } #xs-deliver { margin-top: 5px; font-size: .7em; letter-spacing: .1em; text-transform: uppercase; } /* End Header */ /* Footer */ .panel-footer section { margin-bottom: 30px; text-align: center; } .panel-footer section:nth-child(3) { margin-bottom: 0; /* margin already exists on the whole row */ } .panel-footer section hr { width: 50%; } /* End Footer */ /* Home Page */ .container .jumbotron { margin-top: 30px; padding: 0; } #menu-tile, #specials-tile { width: 360px; margin: 0 auto 15px; } .menu-item-photo { margin-right: auto; } .menu-item-tile .menu-item-price { text-align: center; } .menu-item-description { text-align: center;; } } /********** Super extra small devices Only :-) (e.g., iPhone 4) **********/ @media (max-width: 479px) { /* Header */ .navbar-brand h1 { /* Restaurant name */ padding-top: 5px; font-size: 6vw; } /* End Header */ /* Home page */ #menu-tile, #specials-tile { width: 280px; margin: 0 auto 15px; } .col-xxs-12 { position: relative; min-height: 1px; padding-right: 15px; padding-left: 15px; float: left; width: 100%; } }
{ "pile_set_name": "Github" }
import React from 'react'; import PropTypes from 'prop-types'; import { injectIntl, intlShape } from 'react-intl'; import FormControl from '@material-ui/core/FormControl'; import Radio from '@material-ui/core/Radio'; import RadioGroup from '@material-ui/core/RadioGroup'; import CloseIcon from '@material-ui/icons/Close'; import MenuItem from '@material-ui/core/MenuItem'; import { InputLabel, Select } from '@material-ui/core'; import IconButton from '../IconButton'; import Circle from './Circle'; import messages from './ColorSelect.messages'; const colorSchemes = [ { name: 'Cboard', colors: ['#bbdefb', '#fff176', '#CE93D8', '#2196F3', '#4CAF50', '#E57373'] }, { name: 'Fitzgerald', colors: [ '#2196F3', '#4CAF50', '#fff176', '#ff6600', '#ffffff', '#ffc0cb', '#800080', '#a52a2a', '#ff0000', '#808080' ] }, { name: 'Goossens', colors: ['#ffc0cb', '#2196F3', '#4CAF50', '#fff176', '#ff6600'] } ]; const propTypes = { intl: intlShape.isRequired, onChange: PropTypes.func.isRequired, selectedColor: PropTypes.string.isRequired }; class ColorSelect extends React.Component { constructor(props) { super(props); this.state = { colorMenu: colorSchemes[0] }; } handleColorSchemeChange = event => { this.setState({ colorMenu: event.target.value }); }; render() { const { intl, onChange, selectedColor } = this.props; const colorLabel = intl.formatMessage(messages.color); const radioGroupStyle = { flexDirection: 'row' }; const radioItemStyle = { padding: '2px' }; return ( <FormControl className="ColorSelect"> <div> <FormControl fullWidth id="color-scheme-menu"> <InputLabel id="color-scheme-menu-label"> {intl.formatMessage(messages.colorScheme)} </InputLabel> <Select id="color-scheme" labelId="color-scheme-menu-label" value={this.state.colorMenu} onChange={this.handleColorSchemeChange} > <MenuItem value={colorSchemes[0]}> {colorSchemes[0].name} </MenuItem> <MenuItem value={colorSchemes[1]}> {colorSchemes[1].name} </MenuItem> <MenuItem value={colorSchemes[2]}> {colorSchemes[2].name} </MenuItem> </Select> </FormControl> </div> <RadioGroup aria-label={colorLabel} name="color" value={selectedColor} style={radioGroupStyle} onChange={onChange} > {this.state.colorMenu.colors.map(color => ( <Radio key={color} value={color} style={radioItemStyle} icon={<Circle fill={color} />} checkedIcon={<Circle fill={color} />} /> ))} {selectedColor && ( <IconButton label={intl.formatMessage(messages.clearSelection)} onClick={() => { onChange(); }} > <CloseIcon /> </IconButton> )} </RadioGroup> </FormControl> ); } } ColorSelect.propTypes = propTypes; export default injectIntl(ColorSelect);
{ "pile_set_name": "Github" }
/* * Copyright (C) 2017 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef JSMarkingConstraintPrivate_h #define JSMarkingConstraintPrivate_h #include <JavaScriptCore/JSContextRef.h> #include <stdbool.h> #ifdef __cplusplus extern "C" { #endif struct JSMarker; typedef struct JSMarker JSMarker; typedef JSMarker *JSMarkerRef; struct JSMarker { bool (*IsMarked)(JSMarkerRef, JSObjectRef); void (*Mark)(JSMarkerRef, JSObjectRef); }; typedef void (*JSMarkingConstraint)(JSMarkerRef, void *userData); JS_EXPORT void JSContextGroupAddMarkingConstraint(JSContextGroupRef, JSMarkingConstraint, void *userData); #ifdef __cplusplus } #endif #endif // JSMarkingConstraintPrivate_h
{ "pile_set_name": "Github" }
/* * QEMU IDE Emulation: microdrive (CF / PCMCIA) * * Copyright (c) 2003 Fabrice Bellard * Copyright (c) 2006 Openedhand Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include <hw/hw.h> #include <hw/i386/pc.h> #include <hw/pcmcia.h> #include "sysemu/block-backend.h" #include "sysemu/dma.h" #include <hw/ide/internal.h> #define TYPE_MICRODRIVE "microdrive" #define MICRODRIVE(obj) OBJECT_CHECK(MicroDriveState, (obj), TYPE_MICRODRIVE) /***********************************************************/ /* CF-ATA Microdrive */ #define METADATA_SIZE 0x20 /* DSCM-1XXXX Microdrive hard disk with CF+ II / PCMCIA interface. */ typedef struct MicroDriveState { /*< private >*/ PCMCIACardState parent_obj; /*< public >*/ IDEBus bus; uint32_t attr_base; uint32_t io_base; /* Card state */ uint8_t opt; uint8_t stat; uint8_t pins; uint8_t ctrl; uint16_t io; uint8_t cycle; } MicroDriveState; /* Register bitfields */ enum md_opt { OPT_MODE_MMAP = 0, OPT_MODE_IOMAP16 = 1, OPT_MODE_IOMAP1 = 2, OPT_MODE_IOMAP2 = 3, OPT_MODE = 0x3f, OPT_LEVIREQ = 0x40, OPT_SRESET = 0x80, }; enum md_cstat { STAT_INT = 0x02, STAT_PWRDWN = 0x04, STAT_XE = 0x10, STAT_IOIS8 = 0x20, STAT_SIGCHG = 0x40, STAT_CHANGED = 0x80, }; enum md_pins { PINS_MRDY = 0x02, PINS_CRDY = 0x20, }; enum md_ctrl { CTRL_IEN = 0x02, CTRL_SRST = 0x04, }; static inline void md_interrupt_update(MicroDriveState *s) { PCMCIACardState *card = PCMCIA_CARD(s); if (card->slot == NULL) { return; } qemu_set_irq(card->slot->irq, !(s->stat & STAT_INT) && /* Inverted */ !(s->ctrl & (CTRL_IEN | CTRL_SRST)) && !(s->opt & OPT_SRESET)); } static void md_set_irq(void *opaque, int irq, int level) { MicroDriveState *s = opaque; if (level) { s->stat |= STAT_INT; } else { s->stat &= ~STAT_INT; } md_interrupt_update(s); } static void md_reset(DeviceState *dev) { MicroDriveState *s = MICRODRIVE(dev); s->opt = OPT_MODE_MMAP; s->stat = 0; s->pins = 0; s->cycle = 0; s->ctrl = 0; ide_bus_reset(&s->bus); } static uint8_t md_attr_read(PCMCIACardState *card, uint32_t at) { MicroDriveState *s = MICRODRIVE(card); PCMCIACardClass *pcc = PCMCIA_CARD_GET_CLASS(card); if (at < s->attr_base) { if (at < pcc->cis_len) { return pcc->cis[at]; } else { return 0x00; } } at -= s->attr_base; switch (at) { case 0x00: /* Configuration Option Register */ return s->opt; case 0x02: /* Card Configuration Status Register */ if (s->ctrl & CTRL_IEN) { return s->stat & ~STAT_INT; } else { return s->stat; } case 0x04: /* Pin Replacement Register */ return (s->pins & PINS_CRDY) | 0x0c; case 0x06: /* Socket and Copy Register */ return 0x00; #ifdef VERBOSE default: printf("%s: Bad attribute space register %02x\n", __FUNCTION__, at); #endif } return 0; } static void md_attr_write(PCMCIACardState *card, uint32_t at, uint8_t value) { MicroDriveState *s = MICRODRIVE(card); at -= s->attr_base; switch (at) { case 0x00: /* Configuration Option Register */ s->opt = value & 0xcf; if (value & OPT_SRESET) { device_reset(DEVICE(s)); } md_interrupt_update(s); break; case 0x02: /* Card Configuration Status Register */ if ((s->stat ^ value) & STAT_PWRDWN) { s->pins |= PINS_CRDY; } s->stat &= 0x82; s->stat |= value & 0x74; md_interrupt_update(s); /* Word 170 in Identify Device must be equal to STAT_XE */ break; case 0x04: /* Pin Replacement Register */ s->pins &= PINS_CRDY; s->pins |= value & PINS_MRDY; break; case 0x06: /* Socket and Copy Register */ break; default: printf("%s: Bad attribute space register %02x\n", __FUNCTION__, at); } } static uint16_t md_common_read(PCMCIACardState *card, uint32_t at) { MicroDriveState *s = MICRODRIVE(card); IDEState *ifs; uint16_t ret; at -= s->io_base; switch (s->opt & OPT_MODE) { case OPT_MODE_MMAP: if ((at & ~0x3ff) == 0x400) { at = 0; } break; case OPT_MODE_IOMAP16: at &= 0xf; break; case OPT_MODE_IOMAP1: if ((at & ~0xf) == 0x3f0) { at -= 0x3e8; } else if ((at & ~0xf) == 0x1f0) { at -= 0x1f0; } break; case OPT_MODE_IOMAP2: if ((at & ~0xf) == 0x370) { at -= 0x368; } else if ((at & ~0xf) == 0x170) { at -= 0x170; } } switch (at) { case 0x0: /* Even RD Data */ case 0x8: return ide_data_readw(&s->bus, 0); /* TODO: 8-bit accesses */ if (s->cycle) { ret = s->io >> 8; } else { s->io = ide_data_readw(&s->bus, 0); ret = s->io & 0xff; } s->cycle = !s->cycle; return ret; case 0x9: /* Odd RD Data */ return s->io >> 8; case 0xd: /* Error */ return ide_ioport_read(&s->bus, 0x1); case 0xe: /* Alternate Status */ ifs = idebus_active_if(&s->bus); if (ifs->blk) { return ifs->status; } else { return 0; } case 0xf: /* Device Address */ ifs = idebus_active_if(&s->bus); return 0xc2 | ((~ifs->select << 2) & 0x3c); default: return ide_ioport_read(&s->bus, at); } return 0; } static void md_common_write(PCMCIACardState *card, uint32_t at, uint16_t value) { MicroDriveState *s = MICRODRIVE(card); at -= s->io_base; switch (s->opt & OPT_MODE) { case OPT_MODE_MMAP: if ((at & ~0x3ff) == 0x400) { at = 0; } break; case OPT_MODE_IOMAP16: at &= 0xf; break; case OPT_MODE_IOMAP1: if ((at & ~0xf) == 0x3f0) { at -= 0x3e8; } else if ((at & ~0xf) == 0x1f0) { at -= 0x1f0; } break; case OPT_MODE_IOMAP2: if ((at & ~0xf) == 0x370) { at -= 0x368; } else if ((at & ~0xf) == 0x170) { at -= 0x170; } } switch (at) { case 0x0: /* Even WR Data */ case 0x8: ide_data_writew(&s->bus, 0, value); break; /* TODO: 8-bit accesses */ if (s->cycle) { ide_data_writew(&s->bus, 0, s->io | (value << 8)); } else { s->io = value & 0xff; } s->cycle = !s->cycle; break; case 0x9: s->io = value & 0xff; s->cycle = !s->cycle; break; case 0xd: /* Features */ ide_ioport_write(&s->bus, 0x1, value); break; case 0xe: /* Device Control */ s->ctrl = value; if (value & CTRL_SRST) { device_reset(DEVICE(s)); } md_interrupt_update(s); break; default: if (s->stat & STAT_PWRDWN) { s->pins |= PINS_CRDY; s->stat &= ~STAT_PWRDWN; } ide_ioport_write(&s->bus, at, value); } } static const VMStateDescription vmstate_microdrive = { .name = "microdrive", .version_id = 3, .minimum_version_id = 0, .fields = (VMStateField[]) { VMSTATE_UINT8(opt, MicroDriveState), VMSTATE_UINT8(stat, MicroDriveState), VMSTATE_UINT8(pins, MicroDriveState), VMSTATE_UINT8(ctrl, MicroDriveState), VMSTATE_UINT16(io, MicroDriveState), VMSTATE_UINT8(cycle, MicroDriveState), VMSTATE_IDE_BUS(bus, MicroDriveState), VMSTATE_IDE_DRIVES(bus.ifs, MicroDriveState), VMSTATE_END_OF_LIST() } }; static const uint8_t dscm1xxxx_cis[0x14a] = { [0x000] = CISTPL_DEVICE, /* 5V Device Information */ [0x002] = 0x03, /* Tuple length = 4 bytes */ [0x004] = 0xdb, /* ID: DTYPE_FUNCSPEC, non WP, DSPEED_150NS */ [0x006] = 0x01, /* Size = 2K bytes */ [0x008] = CISTPL_ENDMARK, [0x00a] = CISTPL_DEVICE_OC, /* Additional Device Information */ [0x00c] = 0x04, /* Tuple length = 4 byest */ [0x00e] = 0x03, /* Conditions: Ext = 0, Vcc 3.3V, MWAIT = 1 */ [0x010] = 0xdb, /* ID: DTYPE_FUNCSPEC, non WP, DSPEED_150NS */ [0x012] = 0x01, /* Size = 2K bytes */ [0x014] = CISTPL_ENDMARK, [0x016] = CISTPL_JEDEC_C, /* JEDEC ID */ [0x018] = 0x02, /* Tuple length = 2 bytes */ [0x01a] = 0xdf, /* PC Card ATA with no Vpp required */ [0x01c] = 0x01, [0x01e] = CISTPL_MANFID, /* Manufacture ID */ [0x020] = 0x04, /* Tuple length = 4 bytes */ [0x022] = 0xa4, /* TPLMID_MANF = 00a4 (IBM) */ [0x024] = 0x00, [0x026] = 0x00, /* PLMID_CARD = 0000 */ [0x028] = 0x00, [0x02a] = CISTPL_VERS_1, /* Level 1 Version */ [0x02c] = 0x12, /* Tuple length = 23 bytes */ [0x02e] = 0x04, /* Major Version = JEIDA 4.2 / PCMCIA 2.1 */ [0x030] = 0x01, /* Minor Version = 1 */ [0x032] = 'I', [0x034] = 'B', [0x036] = 'M', [0x038] = 0x00, [0x03a] = 'm', [0x03c] = 'i', [0x03e] = 'c', [0x040] = 'r', [0x042] = 'o', [0x044] = 'd', [0x046] = 'r', [0x048] = 'i', [0x04a] = 'v', [0x04c] = 'e', [0x04e] = 0x00, [0x050] = CISTPL_ENDMARK, [0x052] = CISTPL_FUNCID, /* Function ID */ [0x054] = 0x02, /* Tuple length = 2 bytes */ [0x056] = 0x04, /* TPLFID_FUNCTION = Fixed Disk */ [0x058] = 0x01, /* TPLFID_SYSINIT: POST = 1, ROM = 0 */ [0x05a] = CISTPL_FUNCE, /* Function Extension */ [0x05c] = 0x02, /* Tuple length = 2 bytes */ [0x05e] = 0x01, /* TPLFE_TYPE = Disk Device Interface */ [0x060] = 0x01, /* TPLFE_DATA = PC Card ATA Interface */ [0x062] = CISTPL_FUNCE, /* Function Extension */ [0x064] = 0x03, /* Tuple length = 3 bytes */ [0x066] = 0x02, /* TPLFE_TYPE = Basic PC Card ATA Interface */ [0x068] = 0x08, /* TPLFE_DATA: Rotating, Unique, Single */ [0x06a] = 0x0f, /* TPLFE_DATA: Sleep, Standby, Idle, Auto */ [0x06c] = CISTPL_CONFIG, /* Configuration */ [0x06e] = 0x05, /* Tuple length = 5 bytes */ [0x070] = 0x01, /* TPCC_RASZ = 2 bytes, TPCC_RMSZ = 1 byte */ [0x072] = 0x07, /* TPCC_LAST = 7 */ [0x074] = 0x00, /* TPCC_RADR = 0200 */ [0x076] = 0x02, [0x078] = 0x0f, /* TPCC_RMSK = 200, 202, 204, 206 */ [0x07a] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */ [0x07c] = 0x0b, /* Tuple length = 11 bytes */ [0x07e] = 0xc0, /* TPCE_INDX = Memory Mode, Default, Iface */ [0x080] = 0xc0, /* TPCE_IF = Memory, no BVDs, no WP, READY */ [0x082] = 0xa1, /* TPCE_FS = Vcc only, no I/O, Memory, Misc */ [0x084] = 0x27, /* NomV = 1, MinV = 1, MaxV = 1, Peakl = 1 */ [0x086] = 0x55, /* NomV: 5.0 V */ [0x088] = 0x4d, /* MinV: 4.5 V */ [0x08a] = 0x5d, /* MaxV: 5.5 V */ [0x08c] = 0x4e, /* Peakl: 450 mA */ [0x08e] = 0x08, /* TPCE_MS = 1 window, 1 byte, Host address */ [0x090] = 0x00, /* Window descriptor: Window length = 0 */ [0x092] = 0x20, /* TPCE_MI: support power down mode, RW */ [0x094] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */ [0x096] = 0x06, /* Tuple length = 6 bytes */ [0x098] = 0x00, /* TPCE_INDX = Memory Mode, no Default */ [0x09a] = 0x01, /* TPCE_FS = Vcc only, no I/O, no Memory */ [0x09c] = 0x21, /* NomV = 1, MinV = 0, MaxV = 0, Peakl = 1 */ [0x09e] = 0xb5, /* NomV: 3.3 V */ [0x0a0] = 0x1e, [0x0a2] = 0x3e, /* Peakl: 350 mA */ [0x0a4] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */ [0x0a6] = 0x0d, /* Tuple length = 13 bytes */ [0x0a8] = 0xc1, /* TPCE_INDX = I/O and Memory Mode, Default */ [0x0aa] = 0x41, /* TPCE_IF = I/O and Memory, no BVD, no WP */ [0x0ac] = 0x99, /* TPCE_FS = Vcc only, I/O, Interrupt, Misc */ [0x0ae] = 0x27, /* NomV = 1, MinV = 1, MaxV = 1, Peakl = 1 */ [0x0b0] = 0x55, /* NomV: 5.0 V */ [0x0b2] = 0x4d, /* MinV: 4.5 V */ [0x0b4] = 0x5d, /* MaxV: 5.5 V */ [0x0b6] = 0x4e, /* Peakl: 450 mA */ [0x0b8] = 0x64, /* TPCE_IO = 16-byte boundary, 16/8 accesses */ [0x0ba] = 0xf0, /* TPCE_IR = MASK, Level, Pulse, Share */ [0x0bc] = 0xff, /* IRQ0..IRQ7 supported */ [0x0be] = 0xff, /* IRQ8..IRQ15 supported */ [0x0c0] = 0x20, /* TPCE_MI = support power down mode */ [0x0c2] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */ [0x0c4] = 0x06, /* Tuple length = 6 bytes */ [0x0c6] = 0x01, /* TPCE_INDX = I/O and Memory Mode */ [0x0c8] = 0x01, /* TPCE_FS = Vcc only, no I/O, no Memory */ [0x0ca] = 0x21, /* NomV = 1, MinV = 0, MaxV = 0, Peakl = 1 */ [0x0cc] = 0xb5, /* NomV: 3.3 V */ [0x0ce] = 0x1e, [0x0d0] = 0x3e, /* Peakl: 350 mA */ [0x0d2] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */ [0x0d4] = 0x12, /* Tuple length = 18 bytes */ [0x0d6] = 0xc2, /* TPCE_INDX = I/O Primary Mode */ [0x0d8] = 0x41, /* TPCE_IF = I/O and Memory, no BVD, no WP */ [0x0da] = 0x99, /* TPCE_FS = Vcc only, I/O, Interrupt, Misc */ [0x0dc] = 0x27, /* NomV = 1, MinV = 1, MaxV = 1, Peakl = 1 */ [0x0de] = 0x55, /* NomV: 5.0 V */ [0x0e0] = 0x4d, /* MinV: 4.5 V */ [0x0e2] = 0x5d, /* MaxV: 5.5 V */ [0x0e4] = 0x4e, /* Peakl: 450 mA */ [0x0e6] = 0xea, /* TPCE_IO = 1K boundary, 16/8 access, Range */ [0x0e8] = 0x61, /* Range: 2 fields, 2 bytes addr, 1 byte len */ [0x0ea] = 0xf0, /* Field 1 address = 0x01f0 */ [0x0ec] = 0x01, [0x0ee] = 0x07, /* Address block length = 8 */ [0x0f0] = 0xf6, /* Field 2 address = 0x03f6 */ [0x0f2] = 0x03, [0x0f4] = 0x01, /* Address block length = 2 */ [0x0f6] = 0xee, /* TPCE_IR = IRQ E, Level, Pulse, Share */ [0x0f8] = 0x20, /* TPCE_MI = support power down mode */ [0x0fa] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */ [0x0fc] = 0x06, /* Tuple length = 6 bytes */ [0x0fe] = 0x02, /* TPCE_INDX = I/O Primary Mode, no Default */ [0x100] = 0x01, /* TPCE_FS = Vcc only, no I/O, no Memory */ [0x102] = 0x21, /* NomV = 1, MinV = 0, MaxV = 0, Peakl = 1 */ [0x104] = 0xb5, /* NomV: 3.3 V */ [0x106] = 0x1e, [0x108] = 0x3e, /* Peakl: 350 mA */ [0x10a] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */ [0x10c] = 0x12, /* Tuple length = 18 bytes */ [0x10e] = 0xc3, /* TPCE_INDX = I/O Secondary Mode, Default */ [0x110] = 0x41, /* TPCE_IF = I/O and Memory, no BVD, no WP */ [0x112] = 0x99, /* TPCE_FS = Vcc only, I/O, Interrupt, Misc */ [0x114] = 0x27, /* NomV = 1, MinV = 1, MaxV = 1, Peakl = 1 */ [0x116] = 0x55, /* NomV: 5.0 V */ [0x118] = 0x4d, /* MinV: 4.5 V */ [0x11a] = 0x5d, /* MaxV: 5.5 V */ [0x11c] = 0x4e, /* Peakl: 450 mA */ [0x11e] = 0xea, /* TPCE_IO = 1K boundary, 16/8 access, Range */ [0x120] = 0x61, /* Range: 2 fields, 2 byte addr, 1 byte len */ [0x122] = 0x70, /* Field 1 address = 0x0170 */ [0x124] = 0x01, [0x126] = 0x07, /* Address block length = 8 */ [0x128] = 0x76, /* Field 2 address = 0x0376 */ [0x12a] = 0x03, [0x12c] = 0x01, /* Address block length = 2 */ [0x12e] = 0xee, /* TPCE_IR = IRQ E, Level, Pulse, Share */ [0x130] = 0x20, /* TPCE_MI = support power down mode */ [0x132] = CISTPL_CFTABLE_ENTRY, /* 16-bit PC Card Configuration */ [0x134] = 0x06, /* Tuple length = 6 bytes */ [0x136] = 0x03, /* TPCE_INDX = I/O Secondary Mode */ [0x138] = 0x01, /* TPCE_FS = Vcc only, no I/O, no Memory */ [0x13a] = 0x21, /* NomV = 1, MinV = 0, MaxV = 0, Peakl = 1 */ [0x13c] = 0xb5, /* NomV: 3.3 V */ [0x13e] = 0x1e, [0x140] = 0x3e, /* Peakl: 350 mA */ [0x142] = CISTPL_NO_LINK, /* No Link */ [0x144] = 0x00, /* Tuple length = 0 bytes */ [0x146] = CISTPL_END, /* Tuple End */ }; #define TYPE_DSCM1XXXX "dscm1xxxx" static int dscm1xxxx_attach(PCMCIACardState *card) { MicroDriveState *md = MICRODRIVE(card); PCMCIACardClass *pcc = PCMCIA_CARD_GET_CLASS(card); md->attr_base = pcc->cis[0x74] | (pcc->cis[0x76] << 8); md->io_base = 0x0; device_reset(DEVICE(md)); md_interrupt_update(md); return 0; } static int dscm1xxxx_detach(PCMCIACardState *card) { MicroDriveState *md = MICRODRIVE(card); device_reset(DEVICE(md)); return 0; } PCMCIACardState *dscm1xxxx_init(DriveInfo *dinfo) { MicroDriveState *md; md = MICRODRIVE(object_new(TYPE_DSCM1XXXX)); qdev_init_nofail(DEVICE(md)); if (dinfo != NULL) { ide_create_drive(&md->bus, 0, dinfo); } md->bus.ifs[0].drive_kind = IDE_CFATA; md->bus.ifs[0].mdata_size = METADATA_SIZE; md->bus.ifs[0].mdata_storage = g_malloc0(METADATA_SIZE); return PCMCIA_CARD(md); } static void dscm1xxxx_class_init(ObjectClass *oc, void *data) { PCMCIACardClass *pcc = PCMCIA_CARD_CLASS(oc); pcc->cis = dscm1xxxx_cis; pcc->cis_len = sizeof(dscm1xxxx_cis); pcc->attach = dscm1xxxx_attach; pcc->detach = dscm1xxxx_detach; } static const TypeInfo dscm1xxxx_type_info = { .name = TYPE_DSCM1XXXX, .parent = TYPE_MICRODRIVE, .class_init = dscm1xxxx_class_init, }; static void microdrive_realize(DeviceState *dev, Error **errp) { MicroDriveState *md = MICRODRIVE(dev); ide_init2(&md->bus, qemu_allocate_irq(md_set_irq, md, 0)); } static void microdrive_init(Object *obj) { MicroDriveState *md = MICRODRIVE(obj); ide_bus_new(&md->bus, sizeof(md->bus), DEVICE(obj), 0, 1); } static void microdrive_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); PCMCIACardClass *pcc = PCMCIA_CARD_CLASS(oc); pcc->attr_read = md_attr_read; pcc->attr_write = md_attr_write; pcc->common_read = md_common_read; pcc->common_write = md_common_write; pcc->io_read = md_common_read; pcc->io_write = md_common_write; dc->realize = microdrive_realize; dc->reset = md_reset; dc->vmsd = &vmstate_microdrive; } static const TypeInfo microdrive_type_info = { .name = TYPE_MICRODRIVE, .parent = TYPE_PCMCIA_CARD, .instance_size = sizeof(MicroDriveState), .instance_init = microdrive_init, .abstract = true, .class_init = microdrive_class_init, }; static void microdrive_register_types(void) { type_register_static(&microdrive_type_info); type_register_static(&dscm1xxxx_type_info); } type_init(microdrive_register_types)
{ "pile_set_name": "Github" }
<!-- SPDX-License-Identifier: CC-BY-4.0 --> <!-- Copyright Contributors to the OpenColorIO Project. --> Corporate Contributor License Agreement ("Agreement") Thank you for your interest in the OpenColorIO Project a Series of LF Projects, LLC (hereinafter "Project"). In order to clarify the intellectual property licenses granted with Contributions from any corporate entity to the Project, LF Projects, LLC ("LF Projects") is required to have a Corporate Contributor License Agreement (CCLA) on file that has been signed by each contributing corporation. Each contributing corporation ("You") must accept and agree that, for any Contribution (as defined below), You and all other individuals and entities that control You, are controlled by You, or are under common control with You, are bound by the licenses granted and representations made as though all such individuals and entities are a single contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "Contribution" means any code, documentation or other original work of authorship that is submitted to LF Projects for inclusion in the Project by Your employee or by any individual or entity that controls You, or is under common control with You or is controlled by You and authorized to make the submission on Your behalf. You accept and agree that all of Your present and future Contributions to the Project shall be: Submitted under a Developer's Certificate of Origin v. 1.1 (DCO); and Licensed under the BSD-3-Clause License. You agree that You shall be bound by the terms of the BSD-3-Clause License for all contributions made by You and Your employees. Your designated employees are those listed by Your CLA Manager(s) on the system of record for the Project. You agree to identify Your initial CLA Manager below and thereafter maintain current CLA Manager records in the Project’s system of record. Initial CLA Manager (Name and Email): ______________________________________ Corporate Signature: Company Name: ____________________________________________ Signature: _______________________________________________ Name: _______________________________________________ Title _______________________________________________ Date: _______________________________________________
{ "pile_set_name": "Github" }
/** * Copyright 2015 Netflix, 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.netflix.hystrix.contrib.javanica.exception; /** * Indicates that something is going wrong with caching logic. * * @author dmgcodevil */ public class HystrixCachingException extends RuntimeException { public HystrixCachingException() { } public HystrixCachingException(String message) { super(message); } public HystrixCachingException(String message, Throwable cause) { super(message, cause); } public HystrixCachingException(Throwable cause) { super(cause); } }
{ "pile_set_name": "Github" }
// // Utility.h // CMPayClient // QQ:1490724 #import <Foundation/Foundation.h> #import <CommonCrypto/CommonHMAC.h> #import <SystemConfiguration/SystemConfiguration.h> #import <netdb.h> #import <arpa/inet.h> @interface Utility : NSObject { } +(NSString *)createMD5:(NSString *)params; +(NSString *)createPostURL:(NSMutableDictionary *)params; +(NSString *)getCurrentDate; +(BOOL) connectedToNetwork; +(BOOL) hostAvailable: (NSString *) theHost; +(BOOL)isValidateEmail:(NSString *)email; +(BOOL)validateEmail:(NSString*)email; +(BOOL)isValidateString:(NSString *)myString; @end
{ "pile_set_name": "Github" }
<div class="search-content__inner-wrap"> {%- assign search_provider = site.search_provider | default: "lunr" -%} {%- case search_provider -%} {%- when "lunr" -%} <input type="text" id="search" class="search-input" tabindex="-1" placeholder="{{ site.data.ui-text[site.locale].search_placeholder_text | default: 'Enter your search term...' }}" /> <div id="results" class="results"></div> {%- when "algolia" -%} <div class="search-searchbar"></div> <div class="search-hits"></div> {%- endcase -%} </div>
{ "pile_set_name": "Github" }
######################################################################## # Extract information about Services # ######################################################################## dynamic.1.name=kodi_desc dynamic.1.source=service kodi status | grep "kodi.service - " dynamic.1.regexp=- (.*) dynamic.2.name=kodi_act dynamic.2.source=service kodi status | grep "Active: " dynamic.2.regexp=(\(.*\)) dynamic.3.name=kodi_runtime dynamic.3.source=service kodi status | grep "Active: " dynamic.3.regexp=; (.*) dynamic.4.name=rpimonitor_desc dynamic.4.source=service rpimonitor status | grep "rpimonitor.service -" dynamic.4.regexp=- (.*) dynamic.5.name=rpimonitor_act dynamic.5.source=service rpimonitor status | grep "Active: " dynamic.5.regexp=(\(.*\)) dynamic.6.name=rpimonitor_runtime dynamic.6.source=service rpimonitor status | grep "Active: " dynamic.6.regexp=; (.*) dynamic.7.name=smbd_desc dynamic.7.source=service smbd status | grep "smbd.service - " dynamic.7.regexp=- (.*) dynamic.8.name=smbd_act dynamic.8.source=service smbd status | grep "Active: " dynamic.8.regexp=(\(.*\)) dynamic.9.name=smbd_runtime dynamic.9.source=service smbd status | grep "Active: " dynamic.9.regexp=; (.*) dynamic.10.name=sslocal_desc dynamic.10.source=service sslocal status | grep "sslocal.service - " dynamic.10.regexp=- (.*) dynamic.11.name=sslocal_act dynamic.11.source=service sslocal status | grep "Active: " dynamic.11.regexp=(\(.*\)) dynamic.12.name=sslocal_runtime dynamic.12.source=service sslocal status | grep "Active: " dynamic.12.regexp=; (.*) dynamic.13.name=ssh_desc dynamic.13.source=service ssh status | grep "ssh.service - " dynamic.13.regexp=- (.*) dynamic.14.name=ssh_act dynamic.14.source=service ssh status | grep "Active: " dynamic.14.regexp=(\(.*\)) dynamic.15.name=ssh_runtime dynamic.15.source=service ssh status | grep "Active: " dynamic.15.regexp=; (.*) dynamic.16.name=xrdp_desc dynamic.16.source=service xrdp status | grep "xrdp.service - " dynamic.16.regexp=- (.*) dynamic.17.name=xrdp_act dynamic.17.source=service xrdp status | grep "Active: " dynamic.17.regexp=(\(.*\)) dynamic.18.name=xrdp_runtime dynamic.18.source=service xrdp status | grep "Active: " dynamic.18.regexp=; (.*) dynamic.19.name=deluge_daemon_desc dynamic.19.source=service deluge-daemon status | grep "deluge-daemon.service - " dynamic.19.regexp=- (.*) dynamic.20.name=deluge_daemon_act dynamic.20.source=service deluge-daemon status | grep "Active: " dynamic.20.regexp=(\(.*\)) dynamic.21.name=deluge_daemon_runtime dynamic.21.source=service deluge-daemon status | grep "Active: " dynamic.21.regexp=; (.*) web.status.1.content.1.title="Services" web.status.1.content.1.icon=daemons.png web.status.1.content.1.line.1="<style type=\"text/css\">.tg331 {border-collapse:collapse;border-spacing:0;}.tg331 tr:nth-child(even){background-color: #f2f2f2}.tg331 table{border: 0px solid #e9e9e9;}.tg331 td{font-family:Arial, sans-serif;font-size:14px;padding:12px 2px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;}.tg331 th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:12px 2px;border-style:solid;border-width:0px;overflow:hidden;word-break:normal;}.tg331 .tg331-yw4l{vertical-align:top;text-align: left;}.tg331 hr {display: block;margin-top: 0.5em;margin-bottom: 0.5em;margin-left: auto;margin-right: auto;border-style: inset; border-width: 1px;}</style><table width=\"100%\" class=\"tg331\"><tr><td><b>Status</b></td><td><b>Service Name</b></td><td><b>Service Description</b></td><td><b>Run Time</b></td></tr><tr><td>"+Label(data.kodi_act,"=='(running)'","OK","success")+Label(data.kodi_act,"!='(running)'","KO","danger")+"</td><td><b>kodi</b></td><td>" + data.kodi_desc + "</td><td>"+Label(data.kodi_act,"=='(running)'",data.kodi_runtime,"default")+Label(data.kodi_act,"!='(running)'","-","default")+"</td></tr><tr><td>"+Label(data.rpimonitor_act,"=='(running)'","OK","success")+Label(data.rpimonitor_act,"!='(running)'","KO","danger")+"</td><td><b>rpimonitor</b></td><td>" + data.rpimonitor_desc + "</td><td>"+Label(data.rpimonitor_act,"=='(running)'",data.rpimonitor_runtime,"default")+Label(data.rpimonitor_act,"!='(running)'","-","default")+"</td></tr><tr><td>"+Label(data.smbd_act,"=='(running)'","OK","success")+Label(data.smbd_act,"!='(running)'","KO","danger")+"</td><td><b>smbd</b></td><td>" + data.smbd_desc + "</td><td>"+Label(data.smbd_act,"=='(running)'",data.smbd_runtime,"default")+Label(data.smbd_act,"!='(running)'","-","default")+"</td></tr><tr><td>"+Label(data.sslocal_act,"=='(running)'","OK","success")+Label(data.sslocal_act,"!='(running)'","KO","danger")+"</td><td><b>sslocal</b></td><td>" + data.sslocal_desc + "</td><td>"+Label(data.sslocal_act,"=='(running)'",data.sslocal_runtime,"default")+Label(data.sslocal_act,"!='(running)'","-","default")+"</td></tr><tr><td>"+Label(data.ssh_act,"=='(running)'","OK","success")+Label(data.ssh_act,"!='(running)'","KO","danger")+"</td><td><b>SSH</b></td><td>" + data.ssh_desc + "</td><td>"+Label(data.ssh_act,"=='(running)'",data.ssh_runtime,"default")+Label(data.ssh_act,"!='(running)'","-","default")+"</td></tr><tr><td>"+Label(data.xrdp_act,"=='(running)'","OK","success")+Label(data.xrdp_act,"!='(running)'","KO","danger")+"</td><td><b>xrdp</b></td><td>" + data.xrdp_desc + "</td><td>"+Label(data.xrdp_act,"=='(running)'",data.xrdp_runtime,"default")+Label(data.xrdp_act,"!='(running)'","-","default")+"</td></tr><tr><td>"+Label(data.deluge_daemon_act,"=='(running)'","OK","success")+Label(data.deluge_daemon_act,"!='(running)'","KO","danger")+"</td><td><b>deluge_daemon</b></td><td>" + data.deluge_daemon_desc + "</td><td>"+Label(data.deluge_daemon_act,"=='(running)'",data.deluge_daemon_runtime,"default")+Label(data.deluge_daemon_act,"!='(running)'","-","default")+"</td></tr></table>"
{ "pile_set_name": "Github" }
#include <Windows.h> #include <Common/Hook.h> #include <Common/Log.h> #include <Win32/MemoryManagement.h> namespace { void limitTo2Gb(SIZE_T& mem); void WINAPI globalMemoryStatus(LPMEMORYSTATUS lpBuffer) { LOG_FUNC("GlobalMemoryStatus", lpBuffer); CALL_ORIG_FUNC(GlobalMemoryStatus)(lpBuffer); limitTo2Gb(lpBuffer->dwTotalPhys); limitTo2Gb(lpBuffer->dwAvailPhys); limitTo2Gb(lpBuffer->dwTotalPageFile); limitTo2Gb(lpBuffer->dwAvailPageFile); limitTo2Gb(lpBuffer->dwTotalVirtual); limitTo2Gb(lpBuffer->dwAvailVirtual); } void limitTo2Gb(SIZE_T& mem) { if (mem > INT_MAX) { mem = INT_MAX; } } } namespace Win32 { namespace MemoryManagement { void installHooks() { HOOK_FUNCTION(kernel32, GlobalMemoryStatus, globalMemoryStatus); } } }
{ "pile_set_name": "Github" }
/** * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH * under one or more contributor license agreements. See the NOTICE file * distributed with this work for additional information regarding copyright * ownership. * * Camunda licenses this file to you under the MIT; you may not use this file * except in compliance with the MIT License. */ import './styles/style.less'; import React from 'react'; import ReactDOM from 'react-dom'; import { AppParent, KeyboardBindings, TabsProvider } from './app'; import { backend, config, dialog, fileSystem, plugins, flags, log, metadata, workspace } from './remote'; import Metadata from './util/Metadata'; import Flags from './util/Flags'; import debug from 'debug'; if (process.env.NODE_ENV !== 'production') { debug.enable('*,-sockjs-client:*'); } Metadata.init(metadata); Flags.init(flags); const isMac = backend.getPlatform() === 'darwin'; const keyboardBindings = new KeyboardBindings({ isMac }); const tabsProvider = new TabsProvider(); const globals = { backend, config, dialog, fileSystem, isMac, log, plugins, workspace }; async function render() { // load plugins plugins.bindHelpers(window); await plugins.loadAll(); const rootElement = document.querySelector('#root'); const onStarted = () => { // mark as finished loading document.querySelector('body > .spinner-border').classList.add('hidden'); }; ReactDOM.render( <AppParent keyboardBindings={ keyboardBindings } globals={ globals } tabsProvider={ tabsProvider } onStarted={ onStarted } />, rootElement ); } render();
{ "pile_set_name": "Github" }
type tupbox[T] = tup(@T); type recbox[T] = rec(@T x); fn tuplift[T](T t) -> tupbox[T] { ret tup(@t); } fn reclift[T](T t) -> recbox[T] { ret rec(x=@t); } fn main() { let int foo = 17; let tupbox[int] tbfoo = tuplift[int](foo); let recbox[int] rbfoo = reclift[int](foo); check (tbfoo._0 == foo); check (rbfoo.x == foo); }
{ "pile_set_name": "Github" }
/* Copyright (C) 2019, 2020 Monomax Software Pty Ltd * * This file is part of Dnote. * * Dnote is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Dnote 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with Dnote. If not, see <https://www.gnu.org/licenses/>. */ @import '../../App/responsive'; @import '../../App/theme'; @import '../../App/rem'; @import '../../App/font'; @import '../../App/variables'; .wrapper { background: $lighter-gray; height: $header-height; width: 100%; position: relative; }
{ "pile_set_name": "Github" }
{ "_from": "tunnel-agent@~0.4.1", "_id": "[email protected]", "_inBundle": false, "_integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", "_location": "/phantomjs/tunnel-agent", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, "raw": "tunnel-agent@~0.4.1", "name": "tunnel-agent", "escapedName": "tunnel-agent", "rawSpec": "~0.4.1", "saveSpec": null, "fetchSpec": "~0.4.1" }, "_requiredBy": [ "/phantomjs/request" ], "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", "_shasum": "6373db76909fe570e08d73583365ed828a74eeeb", "_spec": "tunnel-agent@~0.4.1", "_where": "/Users/pwittroc/Projects/kubebuilder/src/github.com/kubernetes-sigs/kubebuilder/docs/book/node_modules/phantomjs/node_modules/request", "author": { "name": "Mikeal Rogers", "email": "[email protected]", "url": "http://www.futurealoof.com" }, "bugs": { "url": "https://github.com/mikeal/tunnel-agent/issues" }, "bundleDependencies": false, "dependencies": {}, "deprecated": false, "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.", "devDependencies": {}, "engines": { "node": "*" }, "files": [ "index.js" ], "homepage": "https://github.com/mikeal/tunnel-agent#readme", "license": "Apache-2.0", "main": "index.js", "name": "tunnel-agent", "optionalDependencies": {}, "repository": { "url": "git+https://github.com/mikeal/tunnel-agent.git" }, "version": "0.4.3" }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed * under the License is distributed on an "AS IS" BASIS, without warranties or * conditions of any kind, EITHER EXPRESS OR IMPLIED. See the License for the * specific language governing permissions and limitations under the License. */ package com.vmware.xenon.common; import static java.lang.String.format; import java.util.ArrayDeque; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.NavigableMap; import java.util.Queue; import java.util.concurrent.CancellationException; import java.util.concurrent.ConcurrentSkipListMap; public final class RoundRobinOperationQueue { private static final int INITIAL_CAPACITY = 256; private final NavigableMap<String, Queue<Operation>> queues = new ConcurrentSkipListMap<>(); private String activeKey = ""; private String description = ""; private final int limit; private int totalCount; public RoundRobinOperationQueue(String description, int limit) { this.description = description; this.limit = limit; } /** * Queue the operation on the queue associated with the key */ public synchronized boolean offer(String key, Operation op) { if (key == null || op == null) { throw new IllegalArgumentException(format("key and operation are required (%s)", this.description)); } if (this.totalCount >= this.limit) { op.setStatusCode(Operation.STATUS_CODE_UNAVAILABLE); op.fail(new CancellationException(format("Limit for queue %s exceeded: %d", this.description, this.limit))); return false; } Queue<Operation> q = this.queues.computeIfAbsent(key, this::makeQueue); q.offer(op); this.totalCount++; return true; } private Queue<Operation> makeQueue(String key) { return new ArrayDeque<>(INITIAL_CAPACITY); } /** * Determines the active queue, and polls it for an operation. If no operation * is found the queue is removed from the map of queues and the methods proceeds * to check the next queue, until an operation is found. * If all queues are empty and no operation was found, the method returns null */ public synchronized Operation poll() { while (!this.queues.isEmpty()) { Entry<String, Queue<Operation>> nextActive = this.queues.higherEntry(this.activeKey); if (nextActive == null) { nextActive = this.queues.firstEntry(); } this.activeKey = nextActive.getKey(); Operation op = nextActive.getValue().poll(); if (op != null) { this.totalCount--; return op; } else { this.queues.remove(nextActive.getKey()); } } return null; } public boolean isEmpty() { return this.queues.isEmpty(); } public Map<String, Integer> sizesByKey() { Map<String, Integer> sizes = new HashMap<>(); synchronized (this) { for (Entry<String, Queue<Operation>> queueEntry : this.queues.entrySet()) { sizes.put(queueEntry.getKey(), queueEntry.getValue().size()); } } return sizes; } }
{ "pile_set_name": "Github" }
<package> <name>XML-XMLNodeBuilder</name> <namespace>XML</namespace> <prereq>XML-DOM</prereq> <prereq>XML-SAXParser</prereq> <filein>NodeBuilder.st</filein> </package>
{ "pile_set_name": "Github" }
{ "prover": "why3:Alt-Ergo,2.0.0", "verdict": "valid", "time": 0.0267, "steps": 16 }
{ "pile_set_name": "Github" }
#if UNITY_EDITOR using System.Collections; using UnityEditor; namespace UnityEngine.Rendering.HighDefinition { class SceneViewDrawMode { static private bool RejectDrawMode(SceneView.CameraMode cameraMode) { if (cameraMode.drawMode == DrawCameraMode.TexturedWire || cameraMode.drawMode == DrawCameraMode.ShadowCascades || cameraMode.drawMode == DrawCameraMode.RenderPaths || cameraMode.drawMode == DrawCameraMode.AlphaChannel || cameraMode.drawMode == DrawCameraMode.Overdraw || cameraMode.drawMode == DrawCameraMode.Mipmaps || cameraMode.drawMode == DrawCameraMode.DeferredDiffuse || cameraMode.drawMode == DrawCameraMode.DeferredSpecular || cameraMode.drawMode == DrawCameraMode.DeferredSmoothness || cameraMode.drawMode == DrawCameraMode.DeferredNormal || cameraMode.drawMode == DrawCameraMode.ValidateAlbedo || cameraMode.drawMode == DrawCameraMode.ValidateMetalSpecular || cameraMode.drawMode == DrawCameraMode.LightOverlap ) return false; return true; } static public void SetupDrawMode() { ArrayList sceneViewArray = SceneView.sceneViews; foreach (SceneView sceneView in sceneViewArray) sceneView.onValidateCameraMode += RejectDrawMode; } static public void ResetDrawMode() { ArrayList sceneViewArray = SceneView.sceneViews; foreach (SceneView sceneView in sceneViewArray) sceneView.onValidateCameraMode -= RejectDrawMode; } } } #endif
{ "pile_set_name": "Github" }
EXAMPLE addl HYPOTHESES: POINT A B C P; LINE X A C; LINE X B C; LINE X A B; DLINE X P A; DLINE X P C; DLINE X P B; POINT A1 B1 C1 P1; LINE X A1 C1; LINE X B1 C1; LINE X A1 B1; DLINE X P1 A1; DLINE X P1 C1; DLINE X P1 B1; POINT A2 B2 C2 P2; LINE X A2 C2; LINE X B2 C2; LINE X A2 B2; DLINE X P2 A2; DLINE X P2 C2; DLINE X P2 B2; SHOW: NO.
{ "pile_set_name": "Github" }
/* * Renjin : JVM-based interpreter for the R language for the statistical analysis * Copyright © 2010-2019 BeDataDriven Groep B.V. and contributors * * 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, a copy is available at * https://www.gnu.org/licenses/gpl-2.0.txt */ package org.renjin.studio; import org.renjin.aether.AetherPackageLoader; import org.renjin.eval.Context; import org.renjin.eval.Session; import org.renjin.eval.SessionBuilder; import org.renjin.sexp.SEXP; import java.io.PrintWriter; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class StudioSession { private Session session; private final ExecutorService threadPool; public StudioSession() { super(); threadPool = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); AetherPackageLoader packageLoader = new AetherPackageLoader(); this.session = new SessionBuilder() .setPackageLoader(packageLoader) .setClassLoader(packageLoader.getClassLoader()) .setExecutorService(threadPool) .withDefaultPackages().build(); } public void setStdOut(PrintWriter printWriter) { session.setStdOut(printWriter); session.setStdErr(printWriter); } public EvalResult evaluate(SEXP expression) { SEXP exp = session.getTopLevelContext().evaluate(expression); return new EvalResult(exp, session.isInvisible()); } public Session getSession() { return session; } public Context getTopLevelContext() { return session.getTopLevelContext(); } }
{ "pile_set_name": "Github" }
/////////////////////////////////////////////////////////// /////////////// Welcome to Cello ////////////////////// /////////////////////////////////////////////////////////// JobID by date: 0xA6 [ -dateID 0xA6 -figures false -external_directory true -assignment_algorithm abstract_only -verilog /Users/peng/cello/resources/verilog/3-input/0xA6.v -output_or false] /////////////////////////////////////////////////////////// /////////////// Logic synthesis, Wiring diagram /////// /////////////////////////////////////////////////////////// fin_ver /Users/peng/cello/resources/verilog/3-input/0xA6.v Input gates = 3 Logic gates = 6 NOR gates = 6 AND gates = 0 Output gates = 1 ----- Logic Circuit #0 ----- OUTPUT 10100110 out 0 (1) NOR 10100110 ~| 1 (3,2) NOR 00001000 ~| 3 (4,9) NOR 01010001 ~| 2 (4,5) NOR 10100010 ~| 4 (5,9) NOR 00001100 ~| 5 (6,8) NOT 11110000 ~ 6 (7) INPUT 00001111 in1 7 INPUT 00110011 in2 8 INPUT 01010101 in3 9 Cello finished playing. Abstract circuit only.
{ "pile_set_name": "Github" }
# frozen_string_literal: true require "cli/parser" require "commands" module Homebrew # Helper module for printing help output. # # @api private module Help # NOTE: Keep the length of vanilla `--help` less than 25 lines! # This is because the default Terminal height is 25 lines. Scrolling sucks # and concision is important. If more help is needed we should start # specialising help like the gem command does. # NOTE: Keep lines less than 80 characters! Wrapping is just not cricket. HOMEBREW_HELP = <<~EOS Example usage: brew search [TEXT|/REGEX/] brew info [FORMULA...] brew install FORMULA... brew update brew upgrade [FORMULA...] brew uninstall FORMULA... brew list [FORMULA...] Troubleshooting: brew config brew doctor brew install --verbose --debug FORMULA Contributing: brew create [URL [--no-fetch]] brew edit [FORMULA...] Further help: brew commands brew help [COMMAND] man brew https://docs.brew.sh EOS private_constant :HOMEBREW_HELP module_function def help(cmd = nil, empty_argv: false, usage_error: nil, remaining_args: []) if cmd.nil? # Handle `brew` (no arguments). if empty_argv $stderr.puts HOMEBREW_HELP exit 1 end # Handle `brew (-h|--help|--usage|-?|help)` (no other arguments). puts HOMEBREW_HELP exit 0 end # Resolve command aliases and find file containing the implementation. path = Commands.path(cmd) # Display command-specific (or generic) help in response to `UsageError`. if usage_error $stderr.puts path ? command_help(cmd, path, remaining_args: remaining_args) : HOMEBREW_HELP $stderr.puts onoe usage_error exit 1 end # Resume execution in `brew.rb` for unknown commands. return if path.nil? # Display help for internal command (or generic help if undocumented). puts command_help(cmd, path, remaining_args: remaining_args) exit 0 end def command_help(cmd, path, remaining_args:) # Only some types of commands can have a parser. output = if Commands.valid_internal_cmd?(cmd) || Commands.valid_internal_dev_cmd?(cmd) || Commands.external_ruby_v2_cmd_path(cmd) parser_help(path, remaining_args: remaining_args) end output ||= comment_help(path) output ||= if output.blank? opoo "No help text in: #{path}" if Homebrew::EnvConfig.developer? HOMEBREW_HELP end output end private_class_method :command_help def parser_help(path, remaining_args:) # Let OptionParser generate help text for commands which have a parser. cmd_parser = CLI::Parser.from_cmd_path(path) return unless cmd_parser # Try parsing arguments here in order to show formula options in help output. cmd_parser.parse(remaining_args, ignore_invalid_options: true) cmd_parser.generate_help_text end private_class_method :parser_help def command_help_lines(path) path.read .lines .grep(/^#:/) .map { |line| line.slice(2..-1).delete_prefix(" ") } end private_class_method :command_help_lines def comment_help(path) # Otherwise read #: lines from the file. help_lines = command_help_lines(path) return if help_lines.blank? Formatter.wrap(help_lines.join, COMMAND_DESC_WIDTH) .sub("@hide_from_man_page ", "") .sub(/^\* /, "#{Tty.bold}Usage: brew#{Tty.reset} ") .gsub(/`(.*?)`/m, "#{Tty.bold}\\1#{Tty.reset}") .gsub(%r{<([^\s]+?://[^\s]+?)>}) { |url| Formatter.url(url) } .gsub(/<(.*?)>/m, "#{Tty.underline}\\1#{Tty.reset}") .gsub(/\*(.*?)\*/m, "#{Tty.underline}\\1#{Tty.reset}") end private_class_method :comment_help end end
{ "pile_set_name": "Github" }
#!/bin/sh usage () { cat <<EOF Usage: $0 [OPTION]... [VAR=VALUE]... [TARGET] To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Installation directories: --prefix=PREFIX main installation prefix [/usr/local/musl] --exec-prefix=EPREFIX installation prefix for executable files [PREFIX] Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --libdir=DIR library files for the linker [PREFIX/lib] --includedir=DIR include files for the C compiler [PREFIX/include] --syslibdir=DIR location for the dynamic linker [/lib] System types: --target=TARGET configure to run on target TARGET [detected] --host=HOST same as --target Optional features: --enable-optimize=... optimize listed components for speed over size [auto] --enable-debug build with debugging information [disabled] --enable-warnings build with recommended warnings flags [disabled] --enable-gcc-wrapper build musl-gcc toolchain wrapper [auto] --disable-shared inhibit building shared library [enabled] --disable-static inhibit building static library [enabled] Some influential environment variables: CC C compiler command [detected] CFLAGS C compiler flags [-Os -pipe ...] CROSS_COMPILE prefix for cross compiler and tools [none] LIBCC compiler runtime library [detected] Use these variables to override the choices made by configure. EOF exit 0 } # Helper functions quote () { tr '\n' ' ' <<EOF | grep '^[-[:alnum:]_=,./:]* $' >/dev/null 2>&1 && { echo "$1" ; return 0 ; } $1 EOF printf %s\\n "$1" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/" -e "\$s/\$/'/" -e "s#^'\([-[:alnum:]_,./:]*\)=\(.*\)\$#\1='\2#" } echo () { printf "%s\n" "$*" ; } fail () { echo "$*" ; exit 1 ; } fnmatch () { eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac" ; } cmdexists () { type "$1" >/dev/null 2>&1 ; } trycc () { test -z "$CC" && cmdexists "$1" && CC=$1 ; } stripdir () { while eval "fnmatch '*/' \"\${$1}\"" ; do eval "$1=\${$1%/}" ; done } trycppif () { printf "checking preprocessor condition %s... " "$1" echo "typedef int x;" > "$tmpc" echo "#if $1" >> "$tmpc" echo "#error yes" >> "$tmpc" echo "#endif" >> "$tmpc" if $CC $2 -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then printf "false\n" return 1 else printf "true\n" return 0 fi } tryflag () { printf "checking whether compiler accepts %s... " "$2" echo "typedef int x;" > "$tmpc" if $CC "$2" -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then printf "yes\n" eval "$1=\"\${$1} \$2\"" eval "$1=\${$1# }" return 0 else printf "no\n" return 1 fi } tryldflag () { printf "checking whether linker accepts %s... " "$2" echo "typedef int x;" > "$tmpc" if $CC -nostdlib -shared "$2" -o /dev/null "$tmpc" >/dev/null 2>&1 ; then printf "yes\n" eval "$1=\"\${$1} \$2\"" eval "$1=\${$1# }" return 0 else printf "no\n" return 1 fi } # Beginning of actual script CFLAGS_C99FSE= CFLAGS_AUTO= CFLAGS_MEMOPS= LDFLAGS_AUTO= OPTIMIZE_GLOBS= prefix=/usr/local/musl exec_prefix='$(prefix)' bindir='$(exec_prefix)/bin' libdir='$(prefix)/lib' includedir='$(prefix)/include' syslibdir='/lib' target= optimize=auto debug=no warnings=no shared=yes static=yes wrapper=auto for arg ; do case "$arg" in --help) usage ;; --prefix=*) prefix=${arg#*=} ;; --exec-prefix=*) exec_prefix=${arg#*=} ;; --bindir=*) bindir=${arg#*=} ;; --libdir=*) libdir=${arg#*=} ;; --includedir=*) includedir=${arg#*=} ;; --syslibdir=*) syslibdir=${arg#*=} ;; --enable-shared|--enable-shared=yes) shared=yes ;; --disable-shared|--enable-shared=no) shared=no ;; --enable-static|--enable-static=yes) static=yes ;; --disable-static|--enable-static=no) static=no ;; --enable-optimize) optimize=yes ;; --enable-optimize=*) optimize=${arg#*=} ;; --disable-optimize) optimize=no ;; --enable-debug|--enable-debug=yes) debug=yes ;; --disable-debug|--enable-debug=no) debug=no ;; --enable-warnings|--enable-warnings=yes) warnings=yes ;; --disable-warnings|--enable-warnings=no) warnings=no ;; --enable-gcc-wrapper|--enable-gcc-wrapper=yes) wrapper=yes ;; --disable-gcc-wrapper|--enable-gcc-wrapper=no) wrapper=no ;; --enable-*|--disable-*|--with-*|--without-*|--*dir=*|--build=*) ;; --host=*|--target=*) target=${arg#*=} ;; -* ) echo "$0: unknown option $arg" ;; CC=*) CC=${arg#*=} ;; CFLAGS=*) CFLAGS=${arg#*=} ;; CPPFLAGS=*) CPPFLAGS=${arg#*=} ;; LDFLAGS=*) LDFLAGS=${arg#*=} ;; CROSS_COMPILE=*) CROSS_COMPILE=${arg#*=} ;; LIBCC=*) LIBCC=${arg#*=} ;; *=*) ;; *) target=$arg ;; esac done for i in prefix exec_prefix bindir libdir includedir syslibdir ; do stripdir $i done # # Get a temp filename we can use # i=0 set -C while : ; do i=$(($i+1)) tmpc="./conf$$-$PPID-$i.c" 2>|/dev/null > "$tmpc" && break test "$i" -gt 50 && fail "$0: cannot create temporary file $tmpc" done set +C trap 'rm "$tmpc"' EXIT INT QUIT TERM HUP # # Find a C compiler to use # printf "checking for C compiler... " trycc ${CROSS_COMPILE}gcc trycc ${CROSS_COMPILE}c99 trycc ${CROSS_COMPILE}cc printf "%s\n" "$CC" test -n "$CC" || { echo "$0: cannot find a C compiler" ; exit 1 ; } printf "checking whether C compiler works... " echo "typedef int x;" > "$tmpc" if output=$($CC $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" 2>&1) ; then printf "yes\n" else printf "no; compiler output follows:\n%s\n" "$output" exit 1 fi # # Need to know if the compiler is gcc to decide whether to build the # musl-gcc wrapper, and for critical bug detection in some gcc versions. # printf "checking whether compiler is gcc... " if fnmatch '*gcc\ version*' "$($CC -v 2>&1)" ; then cc_is_gcc=yes else cc_is_gcc=no fi echo "$cc_is_gcc" # # Only build musl-gcc wrapper if toolchain does not already target musl # if test "$wrapper" = auto ; then printf "checking whether to build musl-gcc wrapper... " if test "$cc_is_gcc" = yes ; then wrapper=yes while read line ; do case "$line" in */ld-musl-*) wrapper=no ;; esac done <<EOF $($CC -dumpspecs) EOF else wrapper=no fi echo "$wrapper" fi # # Find the target architecture # printf "checking target system type... " test -n "$target" || target=$($CC -dumpmachine 2>/dev/null) || target=unknown printf "%s\n" "$target" # # Convert to just ARCH # case "$target" in # Catch these early to simplify matching for 32-bit archs mips64*|powerpc64*) fail "$0: unsupported target \"$target\"" ;; arm*) ARCH=arm ;; i?86*) ARCH=i386 ;; x86_64-x32*|x32*|x86_64*x32) ARCH=x32 ;; x86_64*) ARCH=x86_64 ;; mips*) ARCH=mips ;; microblaze*) ARCH=microblaze ;; powerpc*) ARCH=powerpc ;; sh[1-9bel-]*|sh|superh*) ARCH=sh ;; unknown) fail "$0: unable to detect target arch; try $0 --target=..." ;; *) fail "$0: unknown or unsupported target \"$target\"" ;; esac # # Try to get a conforming C99 freestanding environment # tryflag CFLAGS_C99FSE -std=c99 tryflag CFLAGS_C99FSE -nostdinc tryflag CFLAGS_C99FSE -ffreestanding \ || tryflag CFLAGS_C99FSE -fno-builtin tryflag CFLAGS_C99FSE -fexcess-precision=standard \ || { test "$ARCH" = i386 && tryflag CFLAGS_C99FSE -ffloat-store ; } tryflag CFLAGS_C99FSE -frounding-math # # We may use the may_alias attribute if __GNUC__ is defined, so # if the compiler defines __GNUC__ but does not provide it, # it must be defined away as part of the CFLAGS. # printf "checking whether compiler needs attribute((may_alias)) suppression... " cat > "$tmpc" <<EOF typedef int #ifdef __GNUC__ __attribute__((__may_alias__)) #endif x; EOF if $CC $CFLAGS_C99FSE -I./arch/$ARCH -I./include $CPPFLAGS $CFLAGS \ -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then printf "no\n" else printf "yes\n" CFLAGS_C99FSE="$CFLAGS_C99FSE -D__may_alias__=" fi # # Check for options that may be needed to prevent the compiler from # generating self-referential versions of memcpy,, memmove, memcmp, # and memset. Really, we should add a check to determine if this # option is sufficient, and if not, add a macro to cripple these # functions with volatile... # tryflag CFLAGS_MEMOPS -fno-tree-loop-distribute-patterns # # If debugging is explicitly enabled, don't auto-enable optimizations # if test "$debug" = yes ; then CFLAGS_AUTO=-g test "$optimize" = auto && optimize=no fi # # Possibly add a -O option to CFLAGS and select modules to optimize with # -O3 based on the status of --enable-optimize and provided CFLAGS. # printf "checking for optimization settings... " case "x$optimize" in xauto) if fnmatch '-O*|*\ -O*' "$CFLAGS_AUTO $CFLAGS" ; then printf "using provided CFLAGS\n" ;optimize=no else printf "using defaults\n" ; optimize=yes fi ;; xsize|xnone) printf "minimize size\n" ; optimize=size ;; xno|x) printf "disabled\n" ; optimize=no ;; *) printf "custom\n" ;; esac test "$optimize" = no || tryflag CFLAGS_AUTO -Os || tryflag CFLAGS_AUTO -O2 test "$optimize" = yes && optimize="internal,malloc,string" if fnmatch 'no|size' "$optimize" ; then : else printf "components to be optimized for speed:" while test "$optimize" ; do case "$optimize" in *,*) this=${optimize%%,*} optimize=${optimize#*,} ;; *) this=$optimize optimize= esac printf " $this" case "$this" in */*.c) ;; */*) this=$this*.c ;; *) this=$this/*.c ;; esac OPTIMIZE_GLOBS="$OPTIMIZE_GLOBS $this" done OPTIMIZE_GLOBS=${OPTIMIZE_GLOBS# } printf "\n" fi # Always try -pipe tryflag CFLAGS_AUTO -pipe # # If debugging is disabled, omit frame pointer. Modern GCC does this # anyway on most archs even when debugging is enabled since the frame # pointer is no longer needed for debugging. # if fnmatch '-g*|*\ -g*' "$CFLAGS_AUTO $CFLAGS" ; then : else tryflag CFLAGS_AUTO -fomit-frame-pointer fi # # Modern GCC wants to put DWARF tables (used for debugging and # unwinding) in the loaded part of the program where they are # unstrippable. These options force them back to debug sections (and # cause them not to get generated at all if debugging is off). # tryflag CFLAGS_AUTO -fno-unwind-tables tryflag CFLAGS_AUTO -fno-asynchronous-unwind-tables # # The GNU toolchain defaults to assuming unmarked files need an # executable stack, potentially exposing vulnerabilities in programs # linked with such object files. Fix this. # tryflag CFLAGS_AUTO -Wa,--noexecstack # # On x86, make sure we don't have incompatible instruction set # extensions enabled by default. This is bad for making static binaries. # We cheat and use i486 rather than i386 because i386 really does not # work anyway (issues with atomic ops). # if test "$ARCH" = "i386" ; then fnmatch '-march=*|*\ -march=*' "$CFLAGS" || tryldflag CFLAGS_AUTO -march=i486 fnmatch '-mtune=*|*\ -mtune=*' "$CFLAGS" || tryldflag CFLAGS_AUTO -mtune=generic fi # # Even with -std=c99, gcc accepts some constructs which are constraint # violations. We want to treat these as errors regardless of whether # other purely stylistic warnings are enabled -- especially implicit # function declarations, which are a dangerous programming error. # tryflag CFLAGS_AUTO -Werror=implicit-function-declaration tryflag CFLAGS_AUTO -Werror=implicit-int tryflag CFLAGS_AUTO -Werror=pointer-sign tryflag CFLAGS_AUTO -Werror=pointer-arith if test "x$warnings" = xyes ; then tryflag CFLAGS_AUTO -Wall tryflag CFLAGS_AUTO -Wno-parentheses tryflag CFLAGS_AUTO -Wno-uninitialized tryflag CFLAGS_AUTO -Wno-missing-braces tryflag CFLAGS_AUTO -Wno-unused-value tryflag CFLAGS_AUTO -Wno-unused-but-set-variable tryflag CFLAGS_AUTO -Wno-unknown-pragmas tryflag CFLAGS_AUTO -Wno-pointer-to-int-cast fi # Some patched GCC builds have these defaults messed up... tryflag CFLAGS_AUTO -fno-stack-protector tryldflag LDFLAGS_AUTO -Wl,--hash-style=both # Disable dynamic linking if ld is broken and can't do -Bsymbolic-functions LDFLAGS_DUMMY= tryldflag LDFLAGS_DUMMY -Wl,-Bsymbolic-functions || { printf "warning: disabling dynamic linking support\n" shared=no } # Find compiler runtime library test -z "$LIBCC" && tryldflag LIBCC -lgcc && tryldflag LIBCC -lgcc_eh test -z "$LIBCC" && tryldflag LIBCC -lcompiler_rt test -z "$LIBCC" && try_libcc=`$CC -print-file-name=libpcc.a 2>/dev/null` \ && tryldflag LIBCC "$try_libcc" printf "using compiler runtime libraries: %s\n" "$LIBCC" # Figure out arch variants for archs with variants SUBARCH= t="$CFLAGS_C99FSE $CPPFLAGS $CFLAGS_AUTO $CFLAGS" if test "$ARCH" = "x86_64" ; then trycppif __ILP32__ "$t" && ARCH=x32 fi if test "$ARCH" = "arm" ; then trycppif __ARMEB__ "$t" && SUBARCH=${SUBARCH}eb trycppif __ARM_PCS_VFP "$t" && SUBARCH=${SUBARCH}hf fi if test "$ARCH" = "mips" ; then trycppif "_MIPSEL || __MIPSEL || __MIPSEL__" "$t" && SUBARCH=${SUBARCH}el trycppif __mips_soft_float "$t" && SUBARCH=${SUBARCH}-sf fi test "$ARCH" = "microblaze" && trycppif __MICROBLAZEEL__ "$t" \ && SUBARCH=${SUBARCH}el if test "$ARCH" = "sh" ; then trycppif __BIG_ENDIAN__ "$t" && SUBARCH=${SUBARCH}eb if trycppif "__SH_FPU_ANY__ || __SH4__" "$t" ; then # Some sh configurations are broken and replace double with float # rather than using softfloat when the fpu is present but only # supports single precision. Reject them. printf "checking whether compiler's double type is IEEE double... " echo 'typedef char dblcheck[(int)sizeof(double)-5];' > "$tmpc" if $CC $CFLAGS_C99FSE $CPPFLAGS $CFLAGS -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then printf "yes\n" else printf "no\n" fail "$0: error: compiler's floating point configuration is unsupported" fi else SUBARCH=${SUBARCH}-nofpu fi fi test "$SUBARCH" \ && printf "configured for %s variant: %s\n" "$ARCH" "$ARCH$SUBARCH" case "$ARCH$SUBARCH" in arm) ASMSUBARCH=el ;; *) ASMSUBARCH=$SUBARCH ;; esac # # Some archs (powerpc) have different possible long double formats # that the compiler can be configured for. The logic for whether this # is supported is in bits/float.h; in general, it is not. We need to # check for mismatches here or code in printf, strotd, and scanf will # be dangerously incorrect because it depends on (1) the macros being # correct, and (2) IEEE semantics. # printf "checking whether compiler's long double definition matches float.h... " echo '#include <float.h>' > "$tmpc" echo '#if LDBL_MANT_DIG == 53' >> "$tmpc" echo 'typedef char ldcheck[9-(int)sizeof(long double)];' >> "$tmpc" echo '#endif' >> "$tmpc" if $CC $CFLAGS_C99FSE -I./arch/$ARCH -I./include $CPPFLAGS $CFLAGS \ -c -o /dev/null "$tmpc" >/dev/null 2>&1 ; then printf "yes\n" else printf "no\n" fail "$0: error: unsupported long double type" fi printf "creating config.mak... " cmdline=$(quote "$0") for i ; do cmdline="$cmdline $(quote "$i")" ; done exec 3>&1 1>config.mak cat << EOF # This version of config.mak was generated by: # $cmdline # Any changes made here will be lost if configure is re-run ARCH = $ARCH SUBARCH = $SUBARCH ASMSUBARCH = $ASMSUBARCH prefix = $prefix exec_prefix = $exec_prefix bindir = $bindir libdir = $libdir includedir = $includedir syslibdir = $syslibdir CC = $CC CFLAGS = $CFLAGS_AUTO $CFLAGS CFLAGS_C99FSE = $CFLAGS_C99FSE CFLAGS_MEMOPS = $CFLAGS_MEMOPS CPPFLAGS = $CPPFLAGS LDFLAGS = $LDFLAGS_AUTO $LDFLAGS CROSS_COMPILE = $CROSS_COMPILE LIBCC = $LIBCC OPTIMIZE_GLOBS = $OPTIMIZE_GLOBS EOF test "x$static" = xno && echo "STATIC_LIBS =" test "x$shared" = xno && echo "SHARED_LIBS =" test "x$wrapper" = xno && echo "ALL_TOOLS =" test "x$wrapper" = xno && echo "TOOL_LIBS =" exec 1>&3 3>&- printf "done\n"
{ "pile_set_name": "Github" }
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipayOpenMiniInneraccountCreateResponse(AlipayResponse): def __init__(self): super(AlipayOpenMiniInneraccountCreateResponse, self).__init__() self._pid = None @property def pid(self): return self._pid @pid.setter def pid(self, value): self._pid = value def parse_response_content(self, response_content): response = super(AlipayOpenMiniInneraccountCreateResponse, self).parse_response_content(response_content) if 'pid' in response: self.pid = response['pid']
{ "pile_set_name": "Github" }
package com.insthub.ecmobile.protocol; import java.util.ArrayList; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import com.external.activeandroid.Model; import com.external.activeandroid.annotation.Column; import com.external.activeandroid.annotation.Table; @Table(name = "usersigninRequest") public class usersigninRequest extends Model { @Column(name = "name") public String name; @Column(name = "password") public String password; public void fromJson(JSONObject jsonObject) throws JSONException { if(null == jsonObject){ return ; } JSONArray subItemArray; this.name = jsonObject.optString("name"); this.password = jsonObject.optString("password"); return ; } public JSONObject toJson() throws JSONException { JSONObject localItemObject = new JSONObject(); JSONArray itemJSONArray = new JSONArray(); localItemObject.put("name", name); localItemObject.put("password", password); return localItemObject; } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" ?> <ldml> <identity> <version number="$Revision: 1.56 $"/> <generation date="$Date: 2009/05/05 23:06:36 $"/> <language type="hi"/> <territory type="IN"/> </identity> </ldml>
{ "pile_set_name": "Github" }
export default { model: { prop: 'selectedIndex', event: 'selectedIndexChange', }, render(h) { return h( 'NativeMDTabs', { on: this.$listeners, attrs: this.$attrs, }, this.$slots.default ); }, methods: { registerTabStrip(tabStrip) { this.$el.setAttribute('tabStrip', tabStrip); }, registerTabContentItem(tabContentItem) { const items = this.$el.nativeView.items || []; this.$el.setAttribute('items', items.concat([tabContentItem])); }, }, };
{ "pile_set_name": "Github" }
/* * Copyright (c) 2005 David Kocher. All rights reserved. * http://cyberduck.ch/ * * 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. * * Bug fixes, suggestions and comments should be sent to: * [email protected] */ #import <FinderSidebarService.h> #import <CoreServices/CoreServices.h> #import <Foundation/Foundation.h> #import <JavaNativeFoundation/JNFString.h> LSSharedFileListItemRef findItem(CFStringRef reference, CFStringRef sharedListName) { LSSharedFileListRef list = LSSharedFileListCreate(kCFAllocatorDefault, sharedListName, NULL); if (!list) { NSLog(@"Error getting shared file list reference"); return NULL; } CFArrayRef items = LSSharedFileListCopySnapshot(list, NULL); if (!items) { NSLog(@"Error getting shared file list items snapshot copy reference"); return NULL; } BOOL found = NO; LSSharedFileListItemRef itemRef; for (CFIndex i = 0; i < CFArrayGetCount(items); i++) { itemRef = (LSSharedFileListItemRef)CFArrayGetValueAtIndex(items, i); // Lookup by reference which allows to find items where referenced file is not found CFStringRef propertyRef = LSSharedFileListItemCopyProperty(itemRef, (CFStringRef)@"Reference"); if (propertyRef) { if(CFEqual(propertyRef, (CFStringRef)reference)) { CFRelease(propertyRef); found = YES; break; } CFRelease(propertyRef); } // For login item lists it looks like the custom property is not returned. CFURLRef urlRef = LSSharedFileListItemCopyResolvedURL(itemRef, kLSSharedFileListNoUserInteraction | kLSSharedFileListDoNotMountVolumes, NULL); if (urlRef) { if(CFEqual((CFURLRef) ((NSURL *)urlRef).URLByStandardizingPath, (CFURLRef)[NSURL fileURLWithPath:(NSString *)reference].URLByStandardizingPath)) { CFRelease(urlRef); found = YES; break; } CFRelease(urlRef); } } if (found) { CFRetain(itemRef); } CFRelease(items); CFRelease(list); if (found) { return itemRef; } return NULL; } JNIEXPORT jboolean JNICALL Java_ch_cyberduck_core_local_FinderSidebarService_containsItem(JNIEnv *env, jobject this, jstring file, jstring sharedListName) { JNF_COCOA_ENTER(env); LSSharedFileListItemRef itemRef = findItem((CFStringRef)JNFJavaToNSString(env, file), (CFStringRef)JNFJavaToNSString(env, sharedListName)); if (itemRef) { CFRelease(itemRef); } return itemRef != NULL; JNF_COCOA_EXIT(env); } JNIEXPORT jboolean JNICALL Java_ch_cyberduck_core_local_FinderSidebarService_addItem(JNIEnv *env, jobject this, jstring file, jstring displayName, jstring sharedListName) { JNF_COCOA_ENTER(env); LSSharedFileListRef list = LSSharedFileListCreate(kCFAllocatorDefault, (CFStringRef)JNFJavaToNSString(env, sharedListName), NULL); if (!list) { NSLog(@"Error getting shared file list reference"); return NO; } NSURL* url = [NSURL fileURLWithPath:JNFJavaToNSString(env, file)].URLByStandardizingPath; LSSharedFileListItemRef itemRef = LSSharedFileListInsertItemURL(list, kLSSharedFileListItemLast, (CFStringRef)JNFJavaToNSString(env, displayName), NULL, (CFURLRef)url, (CFDictionaryRef)[NSDictionary dictionaryWithObject:JNFJavaToNSString(env, file) forKey:@"Reference"], NULL); CFRelease(list); if (!itemRef) { NSLog(@"Error getting shared file list item reference"); return NO; } CFRelease(itemRef); return YES; JNF_COCOA_EXIT(env); } JNIEXPORT jboolean JNICALL Java_ch_cyberduck_core_local_FinderSidebarService_removeItem(JNIEnv *env, jobject this, jstring file, jstring sharedListName) { JNF_COCOA_ENTER(env); LSSharedFileListRef list = LSSharedFileListCreate(kCFAllocatorDefault, (CFStringRef)JNFJavaToNSString(env, sharedListName), NULL); if (!list) { NSLog(@"Error getting shared file list reference"); return NO; } OSStatus err; LSSharedFileListItemRef itemRef = findItem((CFStringRef)JNFJavaToNSString(env, file), (CFStringRef)JNFJavaToNSString(env, sharedListName)); if (itemRef) { err = LSSharedFileListItemRemove(list, itemRef); if(noErr != err) { NSLog(@"Error removing shared file list item. %s", [NSError errorWithDomain:NSOSStatusErrorDomain code:err userInfo:nil].description.UTF8String); } CFRelease(itemRef); } CFRelease(list); return noErr == err; JNF_COCOA_EXIT(env); }
{ "pile_set_name": "Github" }
// 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. // +build darwin dragonfly freebsd linux netbsd openbsd solaris // Package unix contains an interface to the low-level operating system // primitives. OS details vary depending on the underlying system, and // by default, godoc will display OS-specific documentation for the current // system. If you want godoc to display OS documentation for another // system, set $GOOS and $GOARCH to the desired system. For example, if // you want to view documentation for freebsd/arm on linux/amd64, set $GOOS // to freebsd and $GOARCH to arm. // The primary use of this package is inside other packages that provide a more // portable interface to the system, such as "os", "time" and "net". Use // those packages rather than this one if you can. // For details of the functions and data types in this package consult // the manuals for the appropriate operating system. // These calls return err == nil to indicate success; otherwise // err represents an operating system error describing the failure and // holds a value of type syscall.Errno. package unix // import "golang.org/x/sys/unix" // ByteSliceFromString returns a NUL-terminated slice of bytes // containing the text of s. If s contains a NUL byte at any // location, it returns (nil, EINVAL). func ByteSliceFromString(s string) ([]byte, error) { for i := 0; i < len(s); i++ { if s[i] == 0 { return nil, EINVAL } } a := make([]byte, len(s)+1) copy(a, s) return a, nil } // BytePtrFromString returns a pointer to a NUL-terminated array of // bytes containing the text of s. If s contains a NUL byte at any // location, it returns (nil, EINVAL). func BytePtrFromString(s string) (*byte, error) { a, err := ByteSliceFromString(s) if err != nil { return nil, err } return &a[0], nil } // Single-word zero for use when we need a valid pointer to 0 bytes. // See mkunix.pl. var _zero uintptr func (ts *Timespec) Unix() (sec int64, nsec int64) { return int64(ts.Sec), int64(ts.Nsec) } func (tv *Timeval) Unix() (sec int64, nsec int64) { return int64(tv.Sec), int64(tv.Usec) * 1000 } func (ts *Timespec) Nano() int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } func (tv *Timeval) Nano() int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000 } func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }
{ "pile_set_name": "Github" }
/** * Copyright (c) 2016-2017 Netflix, Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef SRC_USERAUTH_USERAUTHENTICATIONDATA_H_ #define SRC_USERAUTH_USERAUTHENTICATIONDATA_H_ #include <io/MslEncodable.h> #include <io/MslEncoderFormat.h> #include <userauth/UserAuthenticationScheme.h> #include <vector> #include <stdint.h> #include <memory> namespace netflix { namespace msl { typedef std::vector<uint8_t> ByteArray; namespace io { class MslObject; } namespace tokens { class MasterToken; } namespace util { class MslContext; } namespace userauth { /** * <p>The user authentication data provides proof of user identity.</p> * * <p>Specific user authentication mechanisms should define their own user * authentication data types.</p> * * <p>User authentication data is represented as * {@code * userauthdata = { * "#mandatory" : [ "scheme"., "authdata" ], * "scheme" : "string", * "authdata" : object * }} where * <ul> * <li>{@code scheme} is the user authentication scheme</li> * <li>{@code authdata} is the scheme-specific authentication data</li> * </ul></p> */ class UserAuthenticationData : public io::MslEncodable { public: virtual ~UserAuthenticationData() {} /** * <p>Construct a new user authentication data instance of the correct type * from the provided MSL object.</p> * * <p>A master token may be required for certain user authentication * schemes.</p> * * @param ctx MSL context. * @param masterToken the master token associated with the user * authentication data. May be {@code null}. * @param userAuthMo the MSL object. * @return the user authentication data concrete instance. * @throws MslEncodingException if there is an error parsing the data. * @throws MslUserAuthException if there is an error instantiating the user * authentication data. * @throws MslCryptoException if there is an error with the entity * authentication data cryptography. */ static std::shared_ptr<UserAuthenticationData> create( std::shared_ptr<util::MslContext> ctx, std::shared_ptr<tokens::MasterToken> masterToken, std::shared_ptr<io::MslObject> userAuthMo); /** * @return the user authentication scheme. */ UserAuthenticationScheme getScheme() const { return scheme_; } /** * Returns the scheme-specific user authentication data. This method is * expected to succeed unless there is an internal error. * * @param encoder the encoder factory. * @param format the encoder format. * @return the authentication data MSL object. * @throws MslEncoderException if there was an error constructing the * MSL object. */ virtual std::shared_ptr<io::MslObject> getAuthData( std::shared_ptr<io::MslEncoderFactory> encoder, const io::MslEncoderFormat& format) const = 0; /* (non-Javadoc) * @see com.netflix.msl.io.MslEncodable#toMslEncoding(com.netflix.msl.io.MslEncoderFactory, com.netflix.msl.io.MslEncoderFormat) */ virtual std::shared_ptr<ByteArray> toMslEncoding(std::shared_ptr<io::MslEncoderFactory> encoder, const io::MslEncoderFormat& format) const; // FIXME: this should be protected, but a test complains /** * Create a new user authentication data object with the specified user * authentication scheme. * * @param scheme the user authentication scheme. */ UserAuthenticationData(const UserAuthenticationScheme& scheme) : scheme_(scheme) {} virtual bool equals(std::shared_ptr<const UserAuthenticationData> that) const; protected: // FIXME: this should be protected, but a test complains (see above) // /** // * Create a new user authentication data object with the specified user // * authentication scheme. // * // * @param scheme the user authentication scheme. // */ // UserAuthenticationData(const UserAuthenticationScheme& scheme) : scheme_(scheme) {} private: /** User authentication scheme. */ const UserAuthenticationScheme scheme_; /** Cached encodings. */ mutable std::map<io::MslEncoderFormat, std::shared_ptr<ByteArray>> encodings_; }; bool operator==(const UserAuthenticationData& a, const UserAuthenticationData& b); inline bool operator!=(const UserAuthenticationData& a, const UserAuthenticationData& b) { return !(a == b); } }}} // namespace netflix::msl::entityauth #endif /* SRC_USERAUTH_USERAUTHENTICATIONDATA_H_ */
{ "pile_set_name": "Github" }
/** * Hex * * Utility class to convert Hex strings to ByteArray or String types. * Copyright (c) 2007 Henri Torgemane * * See LICENSE.txt for full license information. */ package org.mangui.hls.utils { import flash.utils.ByteArray; public class Hex { /** * Generates byte-array from given hexadecimal string * * Supports straight and colon-laced hex (that means 23:03:0e:f0, but *NOT* 23:3:e:f0) * The first nibble (hex digit) may be omitted. * Any whitespace characters are ignored. */ public static function toArray(hex : String) : ByteArray { hex = hex.replace(/^0x|\s|:/gm, ''); var a : ByteArray = new ByteArray; var len : uint = hex.length; if ((len & 1) == 1) hex = "0" + hex; for (var i : uint = 0; i < len; i += 2) { a[i / 2] = parseInt(hex.substr(i, 2), 16); } return a; } /** * Generates lowercase hexadecimal string from given byte-array */ public static function fromArray(array : ByteArray, colons : Boolean = false) : String { var s : String = ""; var len : uint = array.length; for (var i : uint = 0; i < len; i++) { s += ("0" + array[i].toString(16)).substr(-2, 2); if (colons) { if (i < len - 1) s += ":"; } } return s; } } }
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- from pygments.style import Style from pygments.token import Name, Comment, String, Number, Operator, Whitespace class CMakeTemplateStyle(Style): """ for more token names, see pygments/styles.default """ background_color = "#f8f8f8" default_style = "" styles = { Whitespace: "#bbbbbb", Comment: "italic #408080", Operator: "#555555", String: "#217A21", Number: "#105030", Name.Builtin: "#333333", # anything lowercase Name.Function: "#007020", # function Name.Variable: "#1080B0", # <..> Name.Tag: "#bb60d5", # ${..} Name.Constant: "#4070a0", # uppercase only Name.Entity: "italic #70A020", # @..@ Name.Attribute: "#906060", # paths, URLs Name.Label: "#A0A000", # anything left over Name.Exception: "bold #FF0000", # for debugging only }
{ "pile_set_name": "Github" }
import { NgModule } from "@angular/core"; import { BrowserModule } from "@angular/platform-browser"; import { ProductComponent } from "./component"; import { FormsModule, ReactiveFormsModule } from "@angular/forms"; import { PaAttrDirective } from "./attr.directive"; import { PaModel } from "./twoway.directive"; import { PaStructureDirective } from "./structure.directive"; import { PaIteratorDirective } from "./iterator.directive"; import { PaCellColor } from "./cellColor.directive"; import { PaCellColorSwitcher } from "./cellColorSwitcher.directive"; import { ProductTableComponent } from "./productTable.component"; import { ProductFormComponent } from "./productForm.component"; import { PaToggleView } from "./toggleView.component"; @NgModule({ imports: [BrowserModule, FormsModule, ReactiveFormsModule], declarations: [ProductComponent, PaAttrDirective, PaModel, PaStructureDirective, PaIteratorDirective, PaCellColor, PaCellColorSwitcher, ProductTableComponent, ProductFormComponent, PaToggleView], bootstrap: [ProductComponent] }) export class AppModule { }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2015, 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 jdk.internal.net.http.common; import java.net.http.HttpHeaders; import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.function.Supplier; import jdk.internal.net.http.frame.DataFrame; import jdk.internal.net.http.frame.Http2Frame; import jdk.internal.net.http.frame.WindowUpdateFrame; import javax.net.ssl.SNIServerName; import javax.net.ssl.SSLParameters; /** * -Djdk.httpclient.HttpClient.log= * errors,requests,headers, * frames[:control:data:window:all..],content,ssl,trace,channel * * Any of errors, requests, headers or content are optional. * * Other handlers may be added. All logging is at level INFO * * Logger name is "jdk.httpclient.HttpClient" */ // implements System.Logger in order to be skipped when printing the caller's // information public abstract class Log implements System.Logger { static final String logProp = "jdk.httpclient.HttpClient.log"; public static final int OFF = 0; public static final int ERRORS = 0x1; public static final int REQUESTS = 0x2; public static final int HEADERS = 0x4; public static final int CONTENT = 0x8; public static final int FRAMES = 0x10; public static final int SSL = 0x20; public static final int TRACE = 0x40; public static final int CHANNEL = 0x80; static int logging; // Frame types: "control", "data", "window", "all" public static final int CONTROL = 1; // all except DATA and WINDOW_UPDATES public static final int DATA = 2; public static final int WINDOW_UPDATES = 4; public static final int ALL = CONTROL| DATA | WINDOW_UPDATES; static int frametypes; static final System.Logger logger; static { String s = Utils.getNetProperty(logProp); if (s == null) { logging = OFF; } else { String[] vals = s.split(","); for (String val : vals) { switch (val.toLowerCase(Locale.US)) { case "errors": logging |= ERRORS; break; case "requests": logging |= REQUESTS; break; case "headers": logging |= HEADERS; break; case "content": logging |= CONTENT; break; case "ssl": logging |= SSL; break; case "channel": logging |= CHANNEL; break; case "trace": logging |= TRACE; break; case "all": logging |= CONTENT|HEADERS|REQUESTS|FRAMES|ERRORS|TRACE|SSL| CHANNEL; frametypes |= ALL; break; default: // ignore bad values } if (val.startsWith("frames")) { logging |= FRAMES; String[] types = val.split(":"); if (types.length == 1) { frametypes = CONTROL | DATA | WINDOW_UPDATES; } else { for (String type : types) { switch (type.toLowerCase(Locale.US)) { case "control": frametypes |= CONTROL; break; case "data": frametypes |= DATA; break; case "window": frametypes |= WINDOW_UPDATES; break; case "all": frametypes = ALL; break; default: // ignore bad values } } } } } } if (logging != OFF) { logger = System.getLogger("jdk.httpclient.HttpClient"); } else { logger = null; } } public static boolean errors() { return (logging & ERRORS) != 0; } public static boolean requests() { return (logging & REQUESTS) != 0; } public static boolean headers() { return (logging & HEADERS) != 0; } public static boolean trace() { return (logging & TRACE) != 0; } public static boolean ssl() { return (logging & SSL) != 0; } public static boolean frames() { return (logging & FRAMES) != 0; } public static boolean channel() { return (logging & CHANNEL) != 0; } public static void logError(String s, Object... s1) { if (errors()) { logger.log(Level.INFO, "ERROR: " + s, s1); } } public static void logError(Throwable t) { if (errors()) { String s = Utils.stackTrace(t); logger.log(Level.INFO, "ERROR: " + s); } } public static void logSSL(String s, Object... s1) { if (ssl()) { logger.log(Level.INFO, "SSL: " + s, s1); } } public static void logSSL(Supplier<String> msgSupplier) { if (ssl()) { logger.log(Level.INFO, "SSL: " + msgSupplier.get()); } } public static void logChannel(String s, Object... s1) { if (channel()) { logger.log(Level.INFO, "CHANNEL: " + s, s1); } } public static void logChannel(Supplier<String> msgSupplier) { if (channel()) { logger.log(Level.INFO, "CHANNEL: " + msgSupplier.get()); } } public static void logTrace(String s, Object... s1) { if (trace()) { String format = "MISC: " + s; logger.log(Level.INFO, format, s1); } } public static void logRequest(String s, Object... s1) { if (requests()) { logger.log(Level.INFO, "REQUEST: " + s, s1); } } public static void logResponse(Supplier<String> supplier) { if (requests()) { logger.log(Level.INFO, "RESPONSE: " + supplier.get()); } } public static void logHeaders(String s, Object... s1) { if (headers()) { logger.log(Level.INFO, "HEADERS: " + s, s1); } } public static boolean loggingFrame(Class<? extends Http2Frame> clazz) { if (frametypes == ALL) { return true; } if (clazz == DataFrame.class) { return (frametypes & DATA) != 0; } else if (clazz == WindowUpdateFrame.class) { return (frametypes & WINDOW_UPDATES) != 0; } else { return (frametypes & CONTROL) != 0; } } public static void logFrames(Http2Frame f, String direction) { if (frames() && loggingFrame(f.getClass())) { logger.log(Level.INFO, "FRAME: " + direction + ": " + f.toString()); } } public static void logParams(SSLParameters p) { if (!Log.ssl()) { return; } if (p == null) { Log.logSSL("SSLParameters: Null params"); return; } final StringBuilder sb = new StringBuilder("SSLParameters:"); final List<Object> params = new ArrayList<>(); if (p.getCipherSuites() != null) { for (String cipher : p.getCipherSuites()) { sb.append("\n cipher: {") .append(params.size()).append("}"); params.add(cipher); } } // SSLParameters.getApplicationProtocols() can't return null // JDK 8 EXCL START for (String approto : p.getApplicationProtocols()) { sb.append("\n application protocol: {") .append(params.size()).append("}"); params.add(approto); } // JDK 8 EXCL END if (p.getProtocols() != null) { for (String protocol : p.getProtocols()) { sb.append("\n protocol: {") .append(params.size()).append("}"); params.add(protocol); } } if (p.getEndpointIdentificationAlgorithm() != null) { sb.append("\n endpointIdAlg: {") .append(params.size()).append("}"); params.add(p.getEndpointIdentificationAlgorithm()); } if (p.getServerNames() != null) { for (SNIServerName sname : p.getServerNames()) { sb.append("\n server name: {") .append(params.size()).append("}"); params.add(sname.toString()); } } sb.append('\n'); Log.logSSL(sb.toString(), params.toArray()); } public static void dumpHeaders(StringBuilder sb, String prefix, HttpHeaders headers) { if (headers != null) { Map<String,List<String>> h = headers.map(); Set<Map.Entry<String,List<String>>> entries = h.entrySet(); String sep = ""; for (Map.Entry<String,List<String>> entry : entries) { String key = entry.getKey(); List<String> values = entry.getValue(); if (values == null || values.isEmpty()) { // should not happen sb.append(sep); sb.append(prefix).append(key).append(':'); sep = "\n"; continue; } for (String value : values) { sb.append(sep); sb.append(prefix).append(key).append(':'); sb.append(' ').append(value); sep = "\n"; } } sb.append('\n'); } } // not instantiable private Log() {} }
{ "pile_set_name": "Github" }
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var prefix = 'fas'; var iconName = 'user-check'; var width = 640; var height = 512; var ligatures = []; var unicode = 'f4fc'; var svgPathData = 'M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4zm323-128.4l-27.8-28.1c-4.6-4.7-12.1-4.7-16.8-.1l-104.8 104-45.5-45.8c-4.6-4.7-12.1-4.7-16.8-.1l-28.1 27.9c-4.7 4.6-4.7 12.1-.1 16.8l81.7 82.3c4.6 4.7 12.1 4.7 16.8.1l141.3-140.2c4.6-4.7 4.7-12.2.1-16.8z'; exports.definition = { prefix: prefix, iconName: iconName, icon: [ width, height, ligatures, unicode, svgPathData ]}; exports.faUserCheck = exports.definition; exports.prefix = prefix; exports.iconName = iconName; exports.width = width; exports.height = height; exports.ligatures = ligatures; exports.unicode = unicode; exports.svgPathData = svgPathData;
{ "pile_set_name": "Github" }
import React from 'react' import { Label } from '..' describe('Label', () => { test('it renders', () => { const json = rendererCreateWithTheme(<Label />).toJSON() expect(json).toMatchSnapshot() }) test('Label hidden renders', () => { const json = rendererCreateWithTheme(<Label hidden />).toJSON() expect(json).toMatchSnapshot() }) test('Label nowrap renders', () => { const json = rendererCreateWithTheme(<Label nowrap />).toJSON() expect(json).toMatchSnapshot() }) test('Label width renders', () => { const json = rendererCreateWithTheme( <Label width={1 / 2} nowrap /> ).toJSON() expect(json).toMatchSnapshot() }) })
{ "pile_set_name": "Github" }
<?php class actionGroupsGroupActivity extends cmsAction { public $lock_explicit_call = true; public function run($group){ $activity_controller = cmsCore::getController('activity', $this->request); $activity_controller->model->filterEqual('group_id', $group['id']); $page_url = href_to($this->name, $group['slug'], 'activity'); $group['sub_title'] = LANG_GROUPS_PROFILE_ACTIVITY; $this->cms_template->addBreadcrumb(LANG_GROUPS, href_to('groups')); $this->cms_template->addBreadcrumb($group['title'], href_to('groups', $group['slug'])); $this->cms_template->addBreadcrumb($group['sub_title']); return $this->cms_template->render('group_activity', array( 'user' => $this->cms_user, 'group' => $group, 'html' => $activity_controller->renderActivityList($page_url) )); } }
{ "pile_set_name": "Github" }
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/mozilla-1.9.1-win32-xulrunner/build/netwerk/base/public/nsIByteRangeRequest.idl */ #ifndef __gen_nsIByteRangeRequest_h__ #define __gen_nsIByteRangeRequest_h__ #ifndef __gen_nsISupports_h__ #include "nsISupports.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif /* starting interface: nsIByteRangeRequest */ #define NS_IBYTERANGEREQUEST_IID_STR "c1b1f426-7e83-4759-9f88-0e1b17f49366" #define NS_IBYTERANGEREQUEST_IID \ {0xc1b1f426, 0x7e83, 0x4759, \ { 0x9f, 0x88, 0x0e, 0x1b, 0x17, 0xf4, 0x93, 0x66 }} class NS_NO_VTABLE NS_SCRIPTABLE nsIByteRangeRequest : public nsISupports { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IBYTERANGEREQUEST_IID) /** * Returns true IFF this request is a byte range request, otherwise it * returns false (This is effectively the same as checking to see if * |startRequest| is zero and |endRange| is the content length.) */ /* readonly attribute boolean isByteRangeRequest; */ NS_SCRIPTABLE NS_IMETHOD GetIsByteRangeRequest(PRBool *aIsByteRangeRequest) = 0; /** * Absolute start position in remote file for this request. */ /* readonly attribute long long startRange; */ NS_SCRIPTABLE NS_IMETHOD GetStartRange(PRInt64 *aStartRange) = 0; /** * Absolute end postion in remote file for this request */ /* readonly attribute long long endRange; */ NS_SCRIPTABLE NS_IMETHOD GetEndRange(PRInt64 *aEndRange) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIByteRangeRequest, NS_IBYTERANGEREQUEST_IID) /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSIBYTERANGEREQUEST \ NS_SCRIPTABLE NS_IMETHOD GetIsByteRangeRequest(PRBool *aIsByteRangeRequest); \ NS_SCRIPTABLE NS_IMETHOD GetStartRange(PRInt64 *aStartRange); \ NS_SCRIPTABLE NS_IMETHOD GetEndRange(PRInt64 *aEndRange); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSIBYTERANGEREQUEST(_to) \ NS_SCRIPTABLE NS_IMETHOD GetIsByteRangeRequest(PRBool *aIsByteRangeRequest) { return _to GetIsByteRangeRequest(aIsByteRangeRequest); } \ NS_SCRIPTABLE NS_IMETHOD GetStartRange(PRInt64 *aStartRange) { return _to GetStartRange(aStartRange); } \ NS_SCRIPTABLE NS_IMETHOD GetEndRange(PRInt64 *aEndRange) { return _to GetEndRange(aEndRange); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSIBYTERANGEREQUEST(_to) \ NS_SCRIPTABLE NS_IMETHOD GetIsByteRangeRequest(PRBool *aIsByteRangeRequest) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsByteRangeRequest(aIsByteRangeRequest); } \ NS_SCRIPTABLE NS_IMETHOD GetStartRange(PRInt64 *aStartRange) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStartRange(aStartRange); } \ NS_SCRIPTABLE NS_IMETHOD GetEndRange(PRInt64 *aEndRange) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEndRange(aEndRange); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsByteRangeRequest : public nsIByteRangeRequest { public: NS_DECL_ISUPPORTS NS_DECL_NSIBYTERANGEREQUEST nsByteRangeRequest(); private: ~nsByteRangeRequest(); protected: /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsByteRangeRequest, nsIByteRangeRequest) nsByteRangeRequest::nsByteRangeRequest() { /* member initializers and constructor code */ } nsByteRangeRequest::~nsByteRangeRequest() { /* destructor code */ } /* readonly attribute boolean isByteRangeRequest; */ NS_IMETHODIMP nsByteRangeRequest::GetIsByteRangeRequest(PRBool *aIsByteRangeRequest) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute long long startRange; */ NS_IMETHODIMP nsByteRangeRequest::GetStartRange(PRInt64 *aStartRange) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute long long endRange; */ NS_IMETHODIMP nsByteRangeRequest::GetEndRange(PRInt64 *aEndRange) { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif #endif /* __gen_nsIByteRangeRequest_h__ */
{ "pile_set_name": "Github" }
// RUN: %target-sil-opt -enable-sil-verify-all -enable-expand-all -sil-lower-agg-instrs-expand-all -lower-aggregate-instrs %s | %FileCheck %s // This file makes sure that the mechanics of expanding aggregate instructions // work. With that in mind, we expand all structs here ignoring code-size // trade-offs. sil_stage canonical import Swift import Builtin class C1 { var data : Builtin.Int64 init() } class C2 { var data : Builtin.FPIEEE32 init() } class C3 { var data : Builtin.FPIEEE64 init() } struct S2 { var cls1 : C1 var cls2 : C2 var trivial : Builtin.FPIEEE32 } struct S { var trivial : Builtin.Int64 var cls : C3 var inner_struct : S2 } enum E { case NoElement(Void) case TrivialElement(Builtin.Int64) case ReferenceElement(C1) case StructNonTrivialElt(S) case TupleNonTrivialElt((Builtin.Int64, S, C3)) } // A struct for testing that aggregate rebuilding works. struct S3 { var trivial1 : Builtin.Int64 var cls : S var trivial2 : Builtin.Int64 var e : E var trivial3 : Builtin.Int64 } ////////////////// // Destroy Addr // ////////////////// // CHECK-LABEL: sil [ossa] @expand_destroy_addr_trivial // CHECK: bb0 // CHECK: tuple () // CHECK: return sil [ossa] @expand_destroy_addr_trivial : $@convention(thin) (@in Builtin.Int64) -> () { bb0(%0 : $*Builtin.Int64): destroy_addr %0 : $*Builtin.Int64 %1 = tuple() return %1 : $() } // CHECK-LABEL: sil [ossa] @expand_destroy_addr_aggstructnontrivial : // CHECK: bb0([[INPTR:%[0-9]+]] : $*S): // CHECK: [[IN:%[0-9]+]] = load [take] [[INPTR]] : $*S // CHECK: ({{%.*}}, [[cls:%.*]], [[innerstruct:%.*]]) = destructure_struct [[IN]] // CHECK: destroy_value [[cls]] : $C3 // CHECK: ([[innerstruct_cls1:%.*]], [[innerstruct_cls2:%.*]], {{%.*}}) = destructure_struct [[innerstruct]] // CHECK: destroy_value [[innerstruct_cls1]] : $C1 // CHECK: destroy_value [[innerstruct_cls2]] : $C2 // CHECK: } // end sil function 'expand_destroy_addr_aggstructnontrivial' sil [ossa] @expand_destroy_addr_aggstructnontrivial : $@convention(thin) (@in S) -> () { bb0(%0 : $*S): destroy_addr %0 : $*S %1 = tuple() return %1 : $() } // CHECK-LABEL: sil [ossa] @expand_destroy_addr_aggtuplenontrivial : // CHECK: bb0([[INPTR:%[0-9]+]] : $*(S, S2, C1)): // CHECK: [[IN:%[0-9]+]] = load [take] [[INPTR]] : $*(S, S2, C1) // CHECK: ([[ELT0:%.*]], [[ELT1:%.*]], [[ELT2:%.*]]) = destructure_tuple [[IN]] // CHECK: ({{%[0-9]+}}, [[ELT0cls:%[0-9]+]], [[ELT0innerstruct:%[0-9]+]]) = destructure_struct [[ELT0]] // CHECK: destroy_value [[ELT0cls]] // CHECK: ([[ELT0innerstructcls1:%[0-9]+]], [[ELT0innerstructcls2:%[0-9]+]], {{%[0-9]+}}) = destructure_struct [[ELT0innerstruct]] // CHECK: destroy_value [[ELT0innerstructcls1]] // CHECK: destroy_value [[ELT0innerstructcls2]] // CHECK: ([[ELT1cls1:%[0-9]+]], [[ELT1cls2:%[0-9]+]], {{%.*}}) = destructure_struct [[ELT1]] // CHECK: destroy_value [[ELT1cls1]] : $C1 // CHECK: destroy_value [[ELT1cls2]] : $C2 // CHECK: destroy_value [[ELT2]] // CHECK: } // end sil function 'expand_destroy_addr_aggtuplenontrivial' sil [ossa] @expand_destroy_addr_aggtuplenontrivial : $@convention(thin) (@in (S, S2, C1)) -> () { bb0(%0 : $*(S, S2, C1)): destroy_addr %0 : $*(S, S2, C1) %1 = tuple() return %1 : $() } // Do not do anything. sil [ossa] @expand_destroy_addr_addressonly : $@convention(thin) <T> (@in T) -> () { bb0(%0 : $*T): destroy_addr %0 : $*T %1 = tuple() return %1 : $() } // CHECK-LABEL: sil [ossa] @expand_destroy_addr_reference : // CHECK: bb0 // CHECK: load // CHECK: destroy_value // CHECK: tuple // CHECK: } // end sil function 'expand_destroy_addr_reference' sil [ossa] @expand_destroy_addr_reference : $@convention(thin) (@in C1) -> () { bb0(%0 : $*C1): destroy_addr %0 : $*C1 %1 = tuple() return %1 : $() } // CHECK-LABEL: sil [ossa] @expand_destroy_addr_enum : // CHECK: bb0 // CHECK: load // CHECK: destroy_value // CHECK: } // end sil function 'expand_destroy_addr_enum' sil [ossa] @expand_destroy_addr_enum : $@convention(thin) (@in E) -> () { bb0(%0 : $*E): destroy_addr %0 : $*E %1 = tuple() return %1 : $() } /////////////// // Copy Addr // /////////////// // CHECK-LABEL: sil [ossa] @expand_copy_addr_takeinit : // CHECK: bb0([[OUT:%[0-9]+]] : $*S, [[IN:%[0-9]+]] : $*S): // CHECK: [[LOAD:%[0-9]+]] = load [take] [[IN]] // CHECK: store [[LOAD]] to [init] [[OUT]] // CHECK: } // end sil function 'expand_copy_addr_takeinit' sil [ossa] @expand_copy_addr_takeinit : $@convention(thin) (@in S) -> @out S { bb0(%0 : $*S, %1 : $*S): copy_addr [take] %1 to [initialization] %0 : $*S %2 = tuple() return %2 : $() } // CHECK-LABEL: sil [ossa] @expand_copy_addr_init : // CHECK: bb0([[OUT:%[0-9]+]] : $*S, [[IN:%[0-9]+]] : $*S): // CHECK: [[LOADED_IN:%[0-9]+]] = load [copy] [[IN]] : $*S // CHECK: store [[LOADED_IN]] to [init] [[OUT]] // CHECK: } // end sil function 'expand_copy_addr_init' sil [ossa] @expand_copy_addr_init : $@convention(thin) (@in_guaranteed S) -> @out S { bb0(%0 : $*S, %1 : $*S): copy_addr %1 to [initialization] %0 : $*S %2 = tuple() return %2 : $() } // CHECK-LABEL: sil [ossa] @expand_copy_addr_take : // CHECK: bb0([[IN_ARG:%[0-9]+]] : $*S, [[INOUT_ARG:%[0-9]+]] : $*S): // CHECK: [[LOADED_IN_ARG:%[0-9]+]] = load [take] [[IN_ARG]] // CHECK: store [[LOADED_IN_ARG]] to [assign] [[INOUT_ARG]] // CHECK: } // end sil function 'expand_copy_addr_take' sil [ossa] @expand_copy_addr_take : $@convention(thin) (@in S, @inout S) -> () { bb0(%0 : $*S, %1 : $*S): copy_addr [take] %0 to %1 : $*S %2 = tuple() return %2 : $() } // Test expansions for various types (these will become more // interesting when I introduce the actual chopping work). // CHECK-LABEL: sil [ossa] @expand_copy_addr_trivial : // CHECK: bb0 // CHECK: load [trivial] // CHECK: store // CHECK: } // end sil function 'expand_copy_addr_trivial' sil [ossa] @expand_copy_addr_trivial : $@convention(thin) (@inout Builtin.Int64, @inout Builtin.Int64) -> () { bb0(%0 : $*Builtin.Int64, %1 : $*Builtin.Int64): copy_addr %0 to %1 : $*Builtin.Int64 %2 = tuple() return %2 : $() } // CHECK-LABEL: sil [ossa] @expand_copy_addr_aggstructnontrivial : // CHECK: bb0([[INOUT_ARG1:%[0-9]+]] : $*S, [[INOUT_ARG2:%[0-9]+]] : $*S): // CHECK: [[INOUT_ARG1_LOADED:%[0-9]+]] = load [copy] [[INOUT_ARG1]] // CHECK: store [[INOUT_ARG1_LOADED]] to [assign] [[INOUT_ARG2]] // CHECK: } // end sil function 'expand_copy_addr_aggstructnontrivial' sil [ossa] @expand_copy_addr_aggstructnontrivial : $@convention(thin) (@inout S, @inout S) -> () { bb0(%0 : $*S, %1 : $*S): copy_addr %0 to %1 : $*S %2 = tuple() return %2 : $() } // CHECK-LABEL: sil [ossa] @expand_copy_addr_aggtuplenontrivial : // CHECK: bb0([[INOUT_1:%[0-9]+]] : $*(S, S2, C1, E), [[INOUT_2:%[0-9]+]] : $*(S, S2, C1, E)): // CHECK: [[INOUT_1_LOADED:%[0-9]+]] = load [copy] [[INOUT_1]] : $*(S, S2, C1, E) // CHECK: store [[INOUT_1_LOADED]] to [assign] [[INOUT_2]] : $*(S, S2, C1, E) // CHECK: tuple () // CHECK: return sil [ossa] @expand_copy_addr_aggtuplenontrivial : $@convention(thin) (@inout (S, S2, C1, E), @inout (S, S2, C1, E)) -> () { bb0(%0 : $*(S, S2, C1, E), %1 : $*(S, S2, C1, E)): copy_addr %0 to %1 : $*(S, S2, C1, E) %2 = tuple() return %2 : $() } // Do not do anything. // // CHECK-LABEL: sil [ossa] @expand_copy_addr_addressonly : $@convention(thin) <T> (@in T, @inout T) -> () { // CHECK: copy_addr // CHECK: } // end sil function 'expand_copy_addr_addressonly' sil [ossa] @expand_copy_addr_addressonly : $@convention(thin) <T> (@in T, @inout T) -> () { bb0(%0 : $*T, %1 : $*T): copy_addr [take] %0 to %1 : $*T %9999 = tuple() return %9999 : $() } // Just turn into a load + destroy_value. // CHECK-LABEL: sil [ossa] @expand_copy_addr_reference : // CHECK: bb0([[INOUT_1:%[0-9]+]] : $*C1, [[INOUT_2:%[0-9]+]] : $*C1): // CHECK: [[LOAD1:%[0-9]+]] = load [copy] [[INOUT_1]] : $*C1 // CHECK: store [[LOAD1]] to [assign] [[INOUT_2]] // CHECK: } // end sil function 'expand_copy_addr_reference' sil [ossa] @expand_copy_addr_reference : $@convention(thin) (@inout C1, @inout C1) -> () { bb0(%0 : $*C1, %1 : $*C1): copy_addr %0 to %1 : $*C1 %2 = tuple() return %2 : $() } // CHECK-LABEL: sil [ossa] @expand_copy_addr_enum : // CHECK: bb0([[IN1:%[0-9]+]] : $*E, [[IN2:%[0-9]+]] : $*E): // CHECK: [[LOAD1:%[0-9]+]] = load [copy] [[IN1]] : $*E // CHECK: store [[LOAD1]] to [assign] [[IN2]] // CHECK: } // end sil function 'expand_copy_addr_enum' sil [ossa] @expand_copy_addr_enum : $@convention(thin) (@inout E, @inout E) -> () { bb0(%0 : $*E, %1 : $*E): copy_addr %0 to %1 : $*E %2 = tuple() return %2 : $() } /////////////////// // Destroy Value // /////////////////// // CHECK-LABEL: sil [ossa] @expand_destroy_value_aggstructnontrivial : // CHECK: bb0([[IN:%[0-9]+]] : @owned $S): // CHECK: destroy_value [[IN]] // CHECK: } // end sil function 'expand_destroy_value_aggstructnontrivial' sil [ossa] @expand_destroy_value_aggstructnontrivial : $@convention(thin) (@owned S) -> () { bb0(%0 : @owned $S): destroy_value %0 : $S %1 = tuple() return %1 : $() } // CHECK-LABEL: sil [ossa] @expand_destroy_value_aggtuplenontrivial : // CHECK: bb0([[IN:%[0-9]+]] : @owned $(S, S2, C1, E)): // CHECK: destroy_value [[IN]] // CHECK: } // end sil function 'expand_destroy_value_aggtuplenontrivial' sil [ossa] @expand_destroy_value_aggtuplenontrivial : $@convention(thin) (@owned (S, S2, C1, E)) -> () { bb0(%0 : @owned $(S, S2, C1, E)): destroy_value %0 : $(S, S2, C1, E) %1 = tuple() return %1 : $() } // CHECK-LABEL: sil [ossa] @expand_destroy_value_reference : // CHECK: bb0([[IN:%[0-9]+]] : @owned $C1): // CHECK: destroy_value [[IN]] // CHECK: } // end sil function 'expand_destroy_value_reference' sil [ossa] @expand_destroy_value_reference : $@convention(thin) (@owned C1) -> () { bb0(%0 : @owned $C1): destroy_value %0 : $C1 %1 = tuple() return %1 : $() } // CHECK-LABEL: sil [ossa] @expand_destroy_value_enum : // CHECK: bb0([[IN1:%[0-9]+]] : @owned $E): // CHECK: destroy_value // CHECK: } // end sil function 'expand_destroy_value_enum' sil [ossa] @expand_destroy_value_enum : $@convention(thin) (@owned E) -> () { bb0(%0 : @owned $E): destroy_value %0 : $E %1 = tuple() return %1 : $() } //////////////// // Copy Value // //////////////// // CHECK-LABEL: sil [ossa] @expand_copy_value_aggstructnontrivial : // CHECK: bb0([[IN:%[0-9]+]] : @guaranteed $S3): // CHECK: [[COPY:%.*]] = copy_value [[IN]] // CHECK: return [[COPY]] : $S3 // CHECK: } // end sil function 'expand_copy_value_aggstructnontrivial' sil [ossa] @expand_copy_value_aggstructnontrivial : $@convention(thin) (@guaranteed S3) -> @owned S3 { bb0(%0 : @guaranteed $S3): %1 = copy_value %0 : $S3 return %1 : $S3 } // CHECK-LABEL: sil [ossa] @expand_copy_value_aggtuplenontrivial : // CHECK: bb0([[IN:%[0-9]+]] : @guaranteed $(S, Builtin.Int64, S2, C1, Builtin.Int64, E)): // CHECK: [[OUT:%.*]] = copy_value [[IN]] // CHECK: return [[OUT]] // CHECK: } // end sil function 'expand_copy_value_aggtuplenontrivial' sil [ossa] @expand_copy_value_aggtuplenontrivial : $@convention(thin) (@guaranteed (S, Builtin.Int64, S2, C1, Builtin.Int64, E)) -> @owned (S, Builtin.Int64, S2, C1, Builtin.Int64, E) { bb0(%0 : @guaranteed $(S, Builtin.Int64, S2, C1, Builtin.Int64, E)): %1 = copy_value %0 : $(S, Builtin.Int64, S2, C1, Builtin.Int64, E) return %1 : $(S, Builtin.Int64, S2, C1, Builtin.Int64, E) } // CHECK-LABEL: sil [ossa] @expand_copy_value_reference : // CHECK: bb0([[IN:%[0-9]+]] : @guaranteed $C1): // CHECK: [[OUT:%.*]] = copy_value [[IN]] // CHECK: return [[OUT]] // CHECK: } // end sil function 'expand_copy_value_reference' sil [ossa] @expand_copy_value_reference : $@convention(thin) (@guaranteed C1) -> @owned C1 { bb0(%0 : @guaranteed $C1): %1 = copy_value %0 : $C1 return %1 : $C1 } // CHECK-LABEL: sil [ossa] @expand_copy_value_enum : // CHECK: bb0([[IN:%[0-9]+]] : @guaranteed $E): // CHECK: [[OUT:%.*]] = copy_value [[IN]] // CHECk: return [[OUT]] // CHECK: } // end sil function 'expand_copy_value_enum' sil [ossa] @expand_copy_value_enum : $@convention(thin) (@guaranteed E) -> @owned E { bb0(%0 : @guaranteed $E): %1 = copy_value %0 : $E return %1 : $E }
{ "pile_set_name": "Github" }
class InvoicePolicy < ApplicationPolicy def index? permission = user.role.permissions.invoice return true if permission.can_read? end def show? permission = user.role.permissions.invoice return true if permission.can_read? end def new? permission = user.role.permissions.invoice return true if permission.can_create? end def edit? permission = user.role.permissions.invoice return true if permission.can_update? end def create? permission = user.role.permissions.invoice return true if permission.can_create? end def update? permission = user.role.permissions.invoice return true if permission.can_update? end def destroy? permission = user.role.permissions.invoice return true if permission.can_delete? end class Scope < Scope def resolve scope.all end end end
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <settings> <localRepository>target/local-only-repository</localRepository> </settings>
{ "pile_set_name": "Github" }
# SPDX-License-Identifier: GPL-2.0 """ Create submenu for symbols that depend on the preceding one. If a symbols has dependency on the preceding symbol, the menu entry should become the submenu of the preceding one, and displayed with deeper indentation. """ def test(conf): assert conf.oldaskconfig() == 0 assert conf.stdout_contains('expected_stdout')
{ "pile_set_name": "Github" }
#!/usr/bin/env python3 "gin - a Git index file parser" version = "0.1.006" # https://github.com/git/git/blob/master/Documentation/technical/index-format.txt import binascii import collections import json import mmap import struct def check(boolean, message): if not boolean: import sys print("error: " + message, file=sys.stderr) sys.exit(1) def parse(filename, pretty=True): with open(filename, "rb") as o: f = mmap.mmap(o.fileno(), 0, prot=mmap.PROT_READ) def read(format): # "All binary numbers are in network byte order." # Hence "!" = network order, big endian format = "! " + format bytes = f.read(struct.calcsize(format)) return struct.unpack(format, bytes)[0] index = collections.OrderedDict() # 4-byte signature, b"DIRC" index["signature"] = f.read(4).decode("ascii") check(index["signature"] == "DIRC", "Not a Git index file") # 4-byte version number index["version"] = read("I") check(index["version"] in {2, 3}, "Unsupported version: %s" % index["version"]) # 32-bit number of index entries, i.e. 4-byte index["entries"] = read("I") yield index for n in range(index["entries"]): entry = collections.OrderedDict() entry["entry"] = n + 1 entry["ctime_seconds"] = read("I") entry["ctime_nanoseconds"] = read("I") if pretty: entry["ctime"] = entry["ctime_seconds"] entry["ctime"] += entry["ctime_nanoseconds"] / 1000000000 del entry["ctime_seconds"] del entry["ctime_nanoseconds"] entry["mtime_seconds"] = read("I") entry["mtime_nanoseconds"] = read("I") if pretty: entry["mtime"] = entry["mtime_seconds"] entry["mtime"] += entry["mtime_nanoseconds"] / 1000000000 del entry["mtime_seconds"] del entry["mtime_nanoseconds"] entry["dev"] = read("I") entry["ino"] = read("I") # 4-bit object type, 3-bit unused, 9-bit unix permission entry["mode"] = read("I") if pretty: entry["mode"] = "%06o" % entry["mode"] entry["uid"] = read("I") entry["gid"] = read("I") entry["size"] = read("I") entry["sha1"] = binascii.hexlify(f.read(20)).decode("ascii") entry["flags"] = read("H") # 1-bit assume-valid entry["assume-valid"] = bool(entry["flags"] & (0b10000000 << 8)) # 1-bit extended, must be 0 in version 2 entry["extended"] = bool(entry["flags"] & (0b01000000 << 8)) # 2-bit stage (?) stage_one = bool(entry["flags"] & (0b00100000 << 8)) stage_two = bool(entry["flags"] & (0b00010000 << 8)) entry["stage"] = stage_one, stage_two # 12-bit name length, if the length is less than 0xFFF (else, 0xFFF) namelen = entry["flags"] & 0xFFF # 62 bytes so far entrylen = 62 if entry["extended"] and (index["version"] == 3): entry["extra-flags"] = read("H") # 1-bit reserved entry["reserved"] = bool(entry["extra-flags"] & (0b10000000 << 8)) # 1-bit skip-worktree entry["skip-worktree"] = bool(entry["extra-flags"] & (0b01000000 << 8)) # 1-bit intent-to-add entry["intent-to-add"] = bool(entry["extra-flags"] & (0b00100000 << 8)) # 13-bits unused # used = entry["extra-flags"] & (0b11100000 << 8) # check(not used, "Expected unused bits in extra-flags") entrylen += 2 if namelen < 0xFFF: entry["name"] = f.read(namelen).decode("utf-8", "replace") entrylen += namelen else: # Do it the hard way name = [] while True: byte = f.read(1) if byte == "\x00": break name.append(byte) entry["name"] = b"".join(name).decode("utf-8", "replace") entrylen += 1 padlen = (8 - (entrylen % 8)) or 8 nuls = f.read(padlen) check(set(nuls) == {0}, "padding contained non-NUL") yield entry indexlen = len(f) extnumber = 1 while f.tell() < (indexlen - 20): extension = collections.OrderedDict() extension["extension"] = extnumber extension["signature"] = f.read(4).decode("ascii") extension["size"] = read("I") # Seems to exclude the above: # "src_offset += 8; src_offset += extsize;" extension["data"] = f.read(extension["size"]) extension["data"] = extension["data"].decode("iso-8859-1") if pretty: extension["data"] = json.dumps(extension["data"]) yield extension extnumber += 1 checksum = collections.OrderedDict() checksum["checksum"] = True checksum["sha1"] = binascii.hexlify(f.read(20)).decode("ascii") yield checksum f.close() def parse_file(arg, pretty=True): if pretty: properties = { "version": "[header]", "entry": "[entry]", "extension": "[extension]", "checksum": "[checksum]" } else: print("[") for item in parse(arg, pretty=pretty): if pretty: for key, value in properties.items(): if key in item: print(value) break else: print("[?]") if pretty: for key, value in item.items(): print(" ", key, "=", value) else: print(json.dumps(item)) last = "checksum" in item if not last: if pretty: print() else: print(",") if not pretty: print("]") def main(): import argparse import os.path import sys parser = argparse.ArgumentParser(description="parse a Git index file") parser.add_argument("-j", "--json", action="store_true", help="output JSON") parser.add_argument("-v", "--version", action="store_true", help="show script version number") parser.add_argument("path", nargs="?", default=".", help="path to a Git repository or index file") args = parser.parse_args() if args.version: print("gin " + version) sys.exit() if os.path.isdir(args.path): path = os.path.join(args.path, ".git", "index") if os.path.isfile(path): args.path = path else: print("error: couldn't find a .git/index file to use", file=sys.stderr) print("use -h or --help for some documentation", file=sys.stderr) sys.exit(1) if not args.path: parser.print_usage() sys.exit(2) parse_file(args.path, pretty=not args.json) if __name__ == "__main__": main()
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.wicket.protocol.ws.javax; import java.nio.ByteBuffer; import javax.websocket.EndpointConfig; import javax.websocket.MessageHandler; import javax.websocket.Session; import org.apache.wicket.protocol.http.WebApplication; import org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor; /** * An {@link org.apache.wicket.protocol.ws.api.IWebSocketProcessor processor} that integrates with * JSR 356 {@link Session web socket} implementation. * * @since 7.0.0 */ public class JavaxWebSocketProcessor extends AbstractWebSocketProcessor { /** * Constructor. * * @param session * the WebSocket session * @param application * @param endpointConfig */ public JavaxWebSocketProcessor(final Session session, final WebApplication application, EndpointConfig endpointConfig) { super(new JavaxUpgradeHttpRequest(session, endpointConfig), application); onConnect(new JavaxWebSocketConnection(session, this)); session.addMessageHandler(new StringMessageHandler()); session.addMessageHandler(new BinaryMessageHandler()); } @Override public void onOpen(Object containerConnection) { } private class StringMessageHandler implements MessageHandler.Whole<String> { @Override public void onMessage(String message) { JavaxWebSocketProcessor.this.onMessage(message); } } private class BinaryMessageHandler implements MessageHandler.Whole<ByteBuffer> { @Override public void onMessage(ByteBuffer message) { byte[] array = message.array(); JavaxWebSocketProcessor.this.onMessage(array, 0, array.length); } } }
{ "pile_set_name": "Github" }
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # TODO(jochen): make this a .gypi file and include it in content.gyp, once # content.gyp doesn't depend on gyp files from chrome/ anymore: # http://crbug.com/10394 { 'targets': [ { 'target_name': 'content_resources', 'type': 'none', 'variables': { 'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/content', }, 'actions': [ { 'action_name': 'generate_content_resources', 'variables': { 'grit_grd_file': 'content_resources.grd', }, 'includes': [ '../build/grit_action.gypi' ], }, ], 'includes': [ '../build/grit_target.gypi' ], 'copies': [ { 'destination': '<(PRODUCT_DIR)', 'files': [ '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak' ], }, ], }, ], }
{ "pile_set_name": "Github" }
<?php require('../common/body_header.inc.php'); $lm = '$LastChangedDate$'; ?> <h2>Administrator Home</h2> <p>The Administrator Home page is the first screen after logging in. It displays a linked list of the administrative tools, shows new and pending <a href="instructor_requests.php">Instructor Requests</a>, provides the ability to check for the latest version of ATutor by connecting to the atutor.ca website, and basic installation statistics and information.</p> <?php require('../common/body_footer.inc.php'); ?>
{ "pile_set_name": "Github" }
include/master-slave.inc Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. [connection master] ######################################################################### # CONFIGURATION ######################################################################### CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; CREATE TABLE nt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = MyIsam; INSERT INTO tt_1(ddl_case) VALUES(0); INSERT INTO tt_2(ddl_case) VALUES(0); ######################################################################### # CHECK IMPLICT COMMIT ######################################################################### SET AUTOCOMMIT= 0; -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (43); CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB"; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (43) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "LIB" -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (42); DROP FUNCTION myfunc_int; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (42) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DROP FUNCTION myfunc_int -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (41); LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES; Table Op Msg_type Msg_text test.nt_1 preload_keys status OK -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (41) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (40); LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES; Table Op Msg_type Msg_text test.tt_1 preload_keys note The storage engine for the table doesn't support preload_keys test.tt_2 preload_keys note The storage engine for the table doesn't support preload_keys -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (40) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (39); ANALYZE TABLE nt_1; Table Op Msg_type Msg_text test.nt_1 analyze status Table is already up to date -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (39) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; ANALYZE TABLE nt_1 -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (38); CHECK TABLE nt_1; Table Op Msg_type Msg_text test.nt_1 check status OK -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (38) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (37); OPTIMIZE TABLE nt_1; Table Op Msg_type Msg_text test.nt_1 optimize status Table is already up to date -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (37) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; OPTIMIZE TABLE nt_1 -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (36); REPAIR TABLE nt_1; Table Op Msg_type Msg_text test.nt_1 repair status OK -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (36) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; REPAIR TABLE nt_1 -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (35); LOCK TABLES tt_1 WRITE; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (35) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (34); UNLOCK TABLES; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (34) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (33); CREATE USER 'user'@'localhost'; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (33) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; CREATE USER 'user'@'localhost' -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (32); GRANT ALL ON *.* TO 'user'@'localhost'; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (32) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; GRANT ALL ON *.* TO 'user'@'localhost' -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (31); SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass'); -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (31) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; SET PASSWORD FOR 'user'@'localhost'='*D8DECEC305209EEFEC43008E1D420E1AA06B19E0' -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (30); REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost'; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (30) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost' -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (29); RENAME USER 'user'@'localhost' TO 'user_new'@'localhost'; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (29) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; RENAME USER 'user'@'localhost' TO 'user_new'@'localhost' -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (28); DROP USER 'user_new'@'localhost'; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (28) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DROP USER 'user_new'@'localhost' -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (27); CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (27) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1 -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (26); ALTER EVENT evt COMMENT 'evt'; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (26) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; ALTER EVENT evt COMMENT 'evt' -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (25); DROP EVENT evt; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (25) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DROP EVENT evt -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (24); CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (24) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (23); DROP TRIGGER tr; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (23) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DROP TRIGGER tr -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (22); CREATE FUNCTION fc () RETURNS VARCHAR(64) RETURN "fc"; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (22) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `fc`() RETURNS varchar(64) CHARSET latin1 RETURN "fc" -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (21); ALTER FUNCTION fc COMMENT 'fc'; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (21) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; ALTER FUNCTION fc COMMENT 'fc' -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (20); DROP FUNCTION fc; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (20) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DROP FUNCTION fc -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (19); CREATE PROCEDURE pc () UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (19) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `pc`() UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (18); ALTER PROCEDURE pc COMMENT 'pc'; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (18) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; ALTER PROCEDURE pc COMMENT 'pc' -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (17); DROP PROCEDURE pc; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (17) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DROP PROCEDURE pc -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (16); CREATE VIEW v AS SELECT * FROM tt_1; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (16) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS SELECT * FROM tt_1 -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (15); ALTER VIEW v AS SELECT * FROM tt_1; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (15) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS SELECT * FROM tt_1 -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (14); DROP VIEW v; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (14) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DROP VIEW v -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (13); CREATE INDEX ix ON tt_1(ddl_case); -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (13) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; CREATE INDEX ix ON tt_1(ddl_case) -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (12); DROP INDEX ix ON tt_1; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (12) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DROP INDEX ix ON tt_1 -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (11); CREATE TEMPORARY TABLE tt_xx (a int); -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (11) master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx (a int) master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (10); ALTER TABLE tt_xx ADD COLUMN (b int); -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (10) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; ALTER TABLE tt_xx ADD COLUMN (b int) -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (9); ALTER TABLE tt_xx RENAME new_tt_xx; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (9) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; ALTER TABLE tt_xx RENAME new_tt_xx -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (8); DROP TEMPORARY TABLE IF EXISTS new_tt_xx; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (8) master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`new_tt_xx` /* generated by server */ master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (7); CREATE TABLE tt_xx (a int); -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (7) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx (a int) -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (6); ALTER TABLE tt_xx ADD COLUMN (b int); -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (6) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; ALTER TABLE tt_xx ADD COLUMN (b int) -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (5); RENAME TABLE tt_xx TO new_tt_xx; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (5) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; RENAME TABLE tt_xx TO new_tt_xx -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (4); TRUNCATE TABLE new_tt_xx; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (4) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; TRUNCATE TABLE new_tt_xx -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (3); DROP TABLE IF EXISTS tt_xx, new_tt_xx; Warnings: Note 1051 Unknown table 'test.tt_xx' -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (3) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `tt_xx`,`new_tt_xx` /* generated by server */ -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (2); CREATE DATABASE db; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (2) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # CREATE DATABASE db -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (1); DROP DATABASE IF EXISTS db; -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (1) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # DROP DATABASE IF EXISTS db -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- ################################################################################### # CHECK CONSISTENCY ################################################################################### include/sync_slave_sql_with_master.inc include/diff_tables.inc [master:tt_1,slave:tt_1] ################################################################################### # CLEAN ################################################################################### include/sync_slave_sql_with_master.inc include/rpl_end.inc
{ "pile_set_name": "Github" }
// Copyright (c) 2011-2015 ScalaMock Contributors (https://github.com/paulbutcher/ScalaMock/graphs/contributors) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. package org.scalamock.util import MacroAdapter.Context /** * Helper functions to work with Scala macros and to create scala.reflect Trees. */ private[scalamock] class MacroUtils[C <: Context](ctx: C) extends MacroAdapter[C](ctx) { // ctx2 to avoid clash with ctx in MockMaker (eugh!) import ctx2.universe._ // Convert a methodType into its ultimate result type // For nullary and normal methods, this is just the result type // For curried methods, this is the final result type of the result type def finalResultType(methodType: Type): Type = methodType match { case NullaryMethodType(result) => result case MethodType(_, result) => finalResultType(result) case PolyType(_, result) => finalResultType(result) case _ => methodType } // Convert a methodType into a list of lists of params: // UnaryMethodType => Nil // Normal method => List(List(p1, p2, ...)) // Curried method => List(List(p1, p2, ...), List(q1, q2, ...), ...) def paramss(methodType: Type): List[List[Symbol]] = methodType match { case MethodType(params, result) => params :: paramss(result) case PolyType(_, result) => paramss(result) case _ => Nil } def paramCount(methodType: Type): Int = methodType match { case MethodType(params, result) => params.length + paramCount(result) case PolyType(_, result) => paramCount(result) case _ => 0 } def paramTypes(methodType: Type): List[Type] = paramss(methodType).flatten map { _.typeSignature } def isMemberOfObject(s: Symbol) = { val res = TypeTag.Object.tpe.member(s.name) res != NoSymbol && res.typeSignature == s.typeSignature } // <|expr|>.asInstanceOf[<|t|>] def castTo(expr: Tree, t: Type): Tree = TypeApply(selectTerm(expr, "asInstanceOf"), List(TypeTree(t))) val scalaPredef: Tree = selectTerm(Ident(TermName("scala")), "Predef") val scalaSymbol: Tree = selectTerm(Ident(TermName("scala")), "Symbol") val scalaString: Tree = Select(scalaPredef, TypeName("String")) def literal(str: String): Literal = Literal(Constant(str)) def selectTerm(qualifier: Tree, name: String): Tree = Select(qualifier, TermName(name)) def applyListOn(qualifier: Tree, name: String, args: List[Tree]): Tree = Apply(selectTerm(qualifier, name), args) def applyOn(qualifier: Tree, name: String, args: Tree*): Tree = applyListOn(qualifier, name, args.toList) def callConstructor(obj: Tree, args: Tree*): Tree = Apply(selectTerm(obj, "<init>"), args.toList) def reportError(message: String) = { // Report with both info and abort so that the user still sees something, even if this is within an // implicit conversion (see https://issues.scala-lang.org/browse/SI-5902) ctx2.info(ctx2.enclosingPosition, message, true) ctx2.abort(ctx2.enclosingPosition, message) } }
{ "pile_set_name": "Github" }
#ifndef __UITEXT_H__ #define __UITEXT_H__ #pragma once namespace DuiLib { class UILIB_API CTextUI : public CLabelUI { public: CTextUI(); ~CTextUI(); LPCTSTR GetClass() const; UINT GetControlFlags() const; LPVOID GetInterface(LPCTSTR pstrName); virtual void SetText(LPCTSTR pstrText); CDuiString* GetLinkContent(int iIndex); void DoEvent(TEventUI& event); SIZE EstimateSize(SIZE szAvailable); void PaintText(HDC hDC); protected: enum { MAX_LINK = 8 }; int m_nLinks; RECT m_rcLinks[MAX_LINK]; CDuiString m_sLinks[MAX_LINK]; int m_nHoverLink; }; } // namespace DuiLib #endif //__UITEXT_H__
{ "pile_set_name": "Github" }
GPS Trail Auto Zoom button gray panel Date Chooser button
{ "pile_set_name": "Github" }
/******************************************************************************* * Copyright (c) 2007, 2015 Wind River Systems, Inc. and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Anton Leherbauer (Wind River Systems) - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.internal.ui.editor; import java.io.ByteArrayInputStream; import java.io.IOException; import org.eclipse.cdt.core.IBinaryParser; import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.IBinary; import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.resources.FileStorage; import org.eclipse.cdt.internal.ui.util.EditorUtility; import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.cdt.utils.IGnuToolFactory; import org.eclipse.cdt.utils.Objdump; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResourceChangeEvent; import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.core.resources.IResourceDelta; import org.eclipse.core.resources.IResourceDeltaVisitor; import org.eclipse.core.resources.IStorage; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.PlatformObject; import org.eclipse.core.runtime.content.IContentType; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.text.source.IVerticalRuler; import org.eclipse.swt.widgets.Composite; import org.eclipse.ui.IPersistableElement; import org.eclipse.ui.IStorageEditorInput; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.editors.text.StorageDocumentProvider; import org.eclipse.ui.ide.IDE; import org.eclipse.ui.ide.ResourceUtil; import org.eclipse.ui.part.FileEditorInput; import org.eclipse.ui.texteditor.AbstractTextEditor; /** * A readonly editor to view binary files. This default implementation displays the GNU objdump output of the * binary as plain text. If no objdump output can be obtained, the binary content is displayed. */ public class DefaultBinaryFileEditor extends AbstractTextEditor implements IResourceChangeListener { /** * A storage editor input for binary files. */ public static class BinaryFileEditorInput extends PlatformObject implements IStorageEditorInput { private final IBinary fBinary; private IStorage fStorage; /** * Create an editor input from the given binary. * * @param binary */ public BinaryFileEditorInput(IBinary binary) { fBinary = binary; } /* * @see org.eclipse.ui.IEditorInput#exists() */ @Override public boolean exists() { return fBinary.exists(); } /* * @see org.eclipse.ui.IEditorInput#getImageDescriptor() */ @Override public ImageDescriptor getImageDescriptor() { IFile file = (IFile) fBinary.getResource(); IContentType contentType = IDE.getContentType(file); return PlatformUI.getWorkbench().getEditorRegistry().getImageDescriptor(file.getName(), contentType); } /* * @see org.eclipse.ui.IEditorInput#getName() */ @Override public String getName() { return fBinary.getElementName(); } /* * @see org.eclipse.ui.IEditorInput#getPersistable() */ @Override public IPersistableElement getPersistable() { return null; } /* * @see org.eclipse.ui.IEditorInput#getToolTipText() */ @Override public String getToolTipText() { return fBinary.getResource().getFullPath().toString(); } /* * @see org.eclipse.ui.IStorageEditorInput#getStorage() */ @Override public IStorage getStorage() throws CoreException { if (fStorage == null) { IBinaryParser.IBinaryObject object = fBinary.getAdapter(IBinaryParser.IBinaryObject.class); if (object != null) { IGnuToolFactory factory = object.getBinaryParser().getAdapter(IGnuToolFactory.class); if (factory != null) { Objdump objdump = factory.getObjdump(object.getPath()); if (objdump != null) { try { // limit editor to X MB, if more - users should use objdump in command // this is UI blocking call, on 56M binary it takes more than 15 min // and generates at least 2.5G of assembly int limitBytes = 6 * 1024 * 1024; // this can run reasonably within seconds byte[] output = objdump.getOutput(limitBytes); if (output.length >= limitBytes) { // add a message for user String text = CEditorMessages.DefaultBinaryFileEditor_TruncateMessage; String message = "\n\n--- " + text + " ---\n" + objdump.toString(); //$NON-NLS-1$ //$NON-NLS-2$ System.arraycopy(message.getBytes(), 0, output, limitBytes - message.length(), message.length()); } fStorage = new FileStorage(new ByteArrayInputStream(output), object.getPath()); } catch (IOException exc) { CUIPlugin.log(exc); } } } } if (fStorage == null) { // backwards compatibility fStorage = EditorUtility.getStorage(fBinary); if (fStorage == null) { // fall back to binary content fStorage = (IFile) fBinary.getResource(); } } } return fStorage; } } /** * A storage document provider for binary files. */ public static class BinaryFileDocumentProvider extends StorageDocumentProvider { /* * @see org.eclipse.ui.editors.text.StorageDocumentProvider#createDocument(java.lang.Object) */ @Override protected IDocument createDocument(Object element) throws CoreException { IFile file = ResourceUtil.getFile(element); if (file != null) { ICElement cElement = CoreModel.getDefault().create(file); if (cElement instanceof IBinary) { element = new BinaryFileEditorInput((IBinary) cElement); } } return super.createDocument(element); } @Override public long getModificationStamp(Object element) { if (element instanceof FileEditorInput) { return ((FileEditorInput) element).getFile().getModificationStamp(); } return 0; } /* * @see org.eclipse.ui.editors.text.StorageDocumentProvider#isModifiable(java.lang.Object) */ @Override public boolean isModifiable(Object element) { return false; } /* * @see org.eclipse.ui.editors.text.StorageDocumentProvider#isReadOnly(java.lang.Object) */ @Override public boolean isReadOnly(Object element) { return true; } } public DefaultBinaryFileEditor() { super(); setDocumentProvider(new BinaryFileDocumentProvider()); ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE); } /* * @see * org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#createSourceViewer(org.eclipse.swt.widgets.Composite * , org.eclipse.jface.text.source.IVerticalRuler, int) */ @Override protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { ISourceViewer sourceViewer = super.createSourceViewer(parent, ruler, styles); sourceViewer.setEditable(false); return sourceViewer; } @Override public void dispose() { ResourcesPlugin.getWorkspace().removeResourceChangeListener(this); } @Override public void resourceChanged(final IResourceChangeEvent event) { try { if (event.getType() == IResourceChangeEvent.POST_CHANGE) { event.getDelta().accept(new IResourceDeltaVisitor() { @Override public boolean visit(IResourceDelta delta) { if (delta.getResource().getName().equals(getEditorInput().getName())) { refresh(); return false; } return true; } }); } } catch (CoreException e) { CUIPlugin.log(e); } } protected void refresh() { PlatformUI.getWorkbench().getDisplay().asyncExec(() -> { try { doSetInput(getEditorInput()); } catch (CoreException e) { CUIPlugin.log(e); } }); } }
{ "pile_set_name": "Github" }
# # MessagePack cross-language test tool # # $ gem install msgpack # or # $ port install rb_msgpack # MacPorts # begin require 'rubygems' rescue LoadError end require 'msgpack' def run(inio, outio) pac = MessagePack::Unpacker.new(inio) begin pac.each {|obj| outio.write MessagePack.pack(obj) outio.flush } rescue EOFError return 0 rescue $stderr.puts $! return 1 end return 0 end def usage puts <<EOF Usage: #{$0} [in-file] [out-file] This tool is for testing of MessagePack implementation. This does following behavior: 1. Reads objects serialized by MessagePack from <in-file> (default: stdin) 2. Re-serializes the objects using Ruby implementation of MessagePack (Note that Ruby implementation is considered valid) 3. Writes the re-serialized objects into <out-file> (default: stdout) EOF exit 1 end inio = $stdin outio = $stdout if ARGV.length > 2 usage end ARGV.each {|str| if str.size > 1 && str[0] == ?- usage end } if fname = ARGV[0] unless fname == "-" begin inio = File.open(fname) rescue puts "can't open output file: #{$!}" exit 1 end end end if fname = ARGV[1] unless fname == "-" begin outio = File.open(fname, "w") rescue puts "can't open output file: #{$!}" exit 1 end end end code = run(inio, outio) inio.close outio.close exit code
{ "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 internalversion import ( "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" storage "k8s.io/kubernetes/pkg/apis/storage" ) // StorageClassLister helps list StorageClasses. type StorageClassLister interface { // List lists all StorageClasses in the indexer. List(selector labels.Selector) (ret []*storage.StorageClass, err error) // Get retrieves the StorageClass from the index for a given name. Get(name string) (*storage.StorageClass, error) StorageClassListerExpansion } // storageClassLister implements the StorageClassLister interface. type storageClassLister struct { indexer cache.Indexer } // NewStorageClassLister returns a new StorageClassLister. func NewStorageClassLister(indexer cache.Indexer) StorageClassLister { return &storageClassLister{indexer: indexer} } // List lists all StorageClasses in the indexer. func (s *storageClassLister) List(selector labels.Selector) (ret []*storage.StorageClass, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*storage.StorageClass)) }) return ret, err } // Get retrieves the StorageClass from the index for a given name. func (s *storageClassLister) Get(name string) (*storage.StorageClass, error) { obj, exists, err := s.indexer.GetByKey(name) if err != nil { return nil, err } if !exists { return nil, errors.NewNotFound(storage.Resource("storageclass"), name) } return obj.(*storage.StorageClass), nil }
{ "pile_set_name": "Github" }
/* * Author: Garrett Barboza <[email protected]> * * Copyright (c) 2014 Kaprica Security, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */ #include "cgc_string.h" char *cgc_strcpy(char *dest, const char *src) { cgc_size_t i = 0; while (*src) dest[i++] = *src++; dest[i] = '\0'; return dest; }
{ "pile_set_name": "Github" }
// // RegexKitLite.h // http://regexkit.sourceforge.net/ // Licensed under the terms of the BSD License, as specified below. // /* Copyright (c) 2008-2010, John Engelhart 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 the Zang Industries 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. */ #ifdef __OBJC__ #import <Foundation/NSArray.h> #import <Foundation/NSError.h> #import <Foundation/NSObjCRuntime.h> #import <Foundation/NSRange.h> #import <Foundation/NSString.h> #endif // __OBJC__ #include <limits.h> #include <stdint.h> #include <sys/types.h> #include <TargetConditionals.h> #include <AvailabilityMacros.h> #ifdef __cplusplus extern "C" { #endif #ifndef REGEXKITLITE_VERSION_DEFINED #define REGEXKITLITE_VERSION_DEFINED #define _RKL__STRINGIFY(b) #b #define _RKL_STRINGIFY(a) _RKL__STRINGIFY(a) #define _RKL_JOIN_VERSION(a,b) _RKL_STRINGIFY(a##.##b) #define _RKL_VERSION_STRING(a,b) _RKL_JOIN_VERSION(a,b) #define REGEXKITLITE_VERSION_MAJOR 4 #define REGEXKITLITE_VERSION_MINOR 0 #define REGEXKITLITE_VERSION_CSTRING _RKL_VERSION_STRING(REGEXKITLITE_VERSION_MAJOR, REGEXKITLITE_VERSION_MINOR) #define REGEXKITLITE_VERSION_NSSTRING @REGEXKITLITE_VERSION_CSTRING #endif // REGEXKITLITE_VERSION_DEFINED #if !defined(RKL_BLOCKS) && defined(NS_BLOCKS_AVAILABLE) && (NS_BLOCKS_AVAILABLE == 1) #define RKL_BLOCKS 1 #endif #if defined(RKL_BLOCKS) && (RKL_BLOCKS == 1) #define _RKL_BLOCKS_ENABLED 1 #endif // defined(RKL_BLOCKS) && (RKL_BLOCKS == 1) #if defined(_RKL_BLOCKS_ENABLED) && !defined(__BLOCKS__) #warning RegexKitLite support for Blocks is enabled, but __BLOCKS__ is not defined. This compiler may not support Blocks, in which case the behavior is undefined. This will probably cause numerous compiler errors. #endif // defined(_RKL_BLOCKS_ENABLED) && !defined(__BLOCKS__) // For Mac OS X < 10.5. #ifndef NSINTEGER_DEFINED #define NSINTEGER_DEFINED #if defined(__LP64__) || defined(NS_BUILD_32_LIKE_64) typedef long NSInteger; typedef unsigned long NSUInteger; #define NSIntegerMin LONG_MIN #define NSIntegerMax LONG_MAX #define NSUIntegerMax ULONG_MAX #else // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64) typedef int NSInteger; typedef unsigned int NSUInteger; #define NSIntegerMin INT_MIN #define NSIntegerMax INT_MAX #define NSUIntegerMax UINT_MAX #endif // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64) #endif // NSINTEGER_DEFINED #ifndef RKLREGEXOPTIONS_DEFINED #define RKLREGEXOPTIONS_DEFINED // These must be identical to their ICU regex counterparts. See http://www.icu-project.org/userguide/regexp.html enum { RKLNoOptions = 0, RKLCaseless = 2, RKLComments = 4, RKLDotAll = 32, RKLMultiline = 8, RKLUnicodeWordBoundaries = 256 }; typedef uint32_t RKLRegexOptions; // This must be identical to the ICU 'flags' argument type. #endif // RKLREGEXOPTIONS_DEFINED #ifndef RKLREGEXENUMERATIONOPTIONS_DEFINED #define RKLREGEXENUMERATIONOPTIONS_DEFINED enum { RKLRegexEnumerationNoOptions = 0UL, RKLRegexEnumerationCapturedStringsNotRequired = 1UL << 9, RKLRegexEnumerationReleaseStringReturnedByReplacementBlock = 1UL << 10, RKLRegexEnumerationFastCapturedStringsXXX = 1UL << 11, }; typedef NSUInteger RKLRegexEnumerationOptions; #endif // RKLREGEXENUMERATIONOPTIONS_DEFINED #ifndef _REGEXKITLITE_H_ #define _REGEXKITLITE_H_ #if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__APPLE_CC__) && (__APPLE_CC__ >= 5465) #define RKL_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) #else #define RKL_DEPRECATED_ATTRIBUTE #endif #if defined(NS_REQUIRES_NIL_TERMINATION) #define RKL_REQUIRES_NIL_TERMINATION NS_REQUIRES_NIL_TERMINATION #else // defined(NS_REQUIRES_NIL_TERMINATION) #define RKL_REQUIRES_NIL_TERMINATION #endif // defined(NS_REQUIRES_NIL_TERMINATION) // This requires a few levels of rewriting to get the desired results. #define _RKL_CONCAT_2(c,d) c ## d #define _RKL_CONCAT(a,b) _RKL_CONCAT_2(a,b) #ifdef RKL_PREPEND_TO_METHODS #define RKL_METHOD_PREPEND(x) _RKL_CONCAT(RKL_PREPEND_TO_METHODS, x) #else // RKL_PREPEND_TO_METHODS #define RKL_METHOD_PREPEND(x) x #endif // RKL_PREPEND_TO_METHODS // If it looks like low memory notifications might be available, add code to register and respond to them. // This is (should be) harmless if it turns out that this isn't the case, since the notification that we register for, // UIApplicationDidReceiveMemoryWarningNotification, is dynamically looked up via dlsym(). #if ((defined(TARGET_OS_EMBEDDED) && (TARGET_OS_EMBEDDED != 0)) || (defined(TARGET_OS_IPHONE) && (TARGET_OS_IPHONE != 0))) && (!defined(RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS) || (RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS != 0)) #define RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS 1 #endif #ifdef __OBJC__ // NSException exception name. extern NSString * const RKLICURegexException; // NSError error domains and user info keys. extern NSString * const RKLICURegexErrorDomain; extern NSString * const RKLICURegexEnumerationOptionsErrorKey; extern NSString * const RKLICURegexErrorCodeErrorKey; extern NSString * const RKLICURegexErrorNameErrorKey; extern NSString * const RKLICURegexLineErrorKey; extern NSString * const RKLICURegexOffsetErrorKey; extern NSString * const RKLICURegexPreContextErrorKey; extern NSString * const RKLICURegexPostContextErrorKey; extern NSString * const RKLICURegexRegexErrorKey; extern NSString * const RKLICURegexRegexOptionsErrorKey; extern NSString * const RKLICURegexReplacedCountErrorKey; extern NSString * const RKLICURegexReplacedStringErrorKey; extern NSString * const RKLICURegexReplacementStringErrorKey; extern NSString * const RKLICURegexSubjectRangeErrorKey; extern NSString * const RKLICURegexSubjectStringErrorKey; @interface NSString (RegexKitLiteAdditions) + (void)RKL_METHOD_PREPEND(clearStringCache); // Although these are marked as deprecated, a bug in GCC prevents a warning from being issues for + class methods. Filed bug with Apple, #6736857. + (NSInteger)RKL_METHOD_PREPEND(captureCountForRegex):(NSString *)regex RKL_DEPRECATED_ATTRIBUTE; + (NSInteger)RKL_METHOD_PREPEND(captureCountForRegex):(NSString *)regex options:(RKLRegexOptions)options error:(NSError **)error RKL_DEPRECATED_ATTRIBUTE; - (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex; - (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex range:(NSRange)range; - (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error; - (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex; - (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex inRange:(NSRange)range; - (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error; - (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex; - (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex capture:(NSInteger)capture; - (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex inRange:(NSRange)range; - (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range capture:(NSInteger)capture error:(NSError **)error; - (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex; - (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex capture:(NSInteger)capture; - (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex inRange:(NSRange)range; - (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range capture:(NSInteger)capture error:(NSError **)error; - (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement; - (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement range:(NSRange)searchRange; - (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement options:(RKLRegexOptions)options range:(NSRange)searchRange error:(NSError **)error; //// >= 3.0 - (NSInteger)RKL_METHOD_PREPEND(captureCount); - (NSInteger)RKL_METHOD_PREPEND(captureCountWithOptions):(RKLRegexOptions)options error:(NSError **)error; - (BOOL)RKL_METHOD_PREPEND(isRegexValid); - (BOOL)RKL_METHOD_PREPEND(isRegexValidWithOptions):(RKLRegexOptions)options error:(NSError **)error; - (void)RKL_METHOD_PREPEND(flushCachedRegexData); - (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex; - (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex capture:(NSInteger)capture; - (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex range:(NSRange)range; - (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range capture:(NSInteger)capture error:(NSError **)error; - (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex; - (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex range:(NSRange)range; - (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error; - (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex; - (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex range:(NSRange)range; - (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error; //// >= 4.0 - (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; - (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex range:(NSRange)range withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; - (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; - (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withFirstKey:(id)firstKey arguments:(va_list)varArgsList; - (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeys:(id *)keys forCaptures:(int *)captures count:(NSUInteger)count; - (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; - (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex range:(NSRange)range withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; - (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION; - (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withFirstKey:(id)firstKey arguments:(va_list)varArgsList; - (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeys:(id *)keys forCaptures:(int *)captures count:(NSUInteger)count; #ifdef _RKL_BLOCKS_ENABLED - (BOOL)RKL_METHOD_PREPEND(enumerateStringsMatchedByRegex):(NSString *)regex usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; - (BOOL)RKL_METHOD_PREPEND(enumerateStringsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; - (BOOL)RKL_METHOD_PREPEND(enumerateStringsSeparatedByRegex):(NSString *)regex usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; - (BOOL)RKL_METHOD_PREPEND(enumerateStringsSeparatedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; - (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; - (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; #endif // _RKL_BLOCKS_ENABLED @end @interface NSMutableString (RegexKitLiteAdditions) - (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement; - (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement range:(NSRange)searchRange; - (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement options:(RKLRegexOptions)options range:(NSRange)searchRange error:(NSError **)error; //// >= 4.0 #ifdef _RKL_BLOCKS_ENABLED - (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; - (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block; #endif // _RKL_BLOCKS_ENABLED @end #endif // __OBJC__ #endif // _REGEXKITLITE_H_ #ifdef __cplusplus } // extern "C" #endif
{ "pile_set_name": "Github" }
/* * DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/mozilla-1.9.1-win32-xulrunner/build/dom/public/idl/events/nsIDOMMouseEvent.idl */ #ifndef __gen_nsIDOMMouseEvent_h__ #define __gen_nsIDOMMouseEvent_h__ #ifndef __gen_nsIDOMUIEvent_h__ #include "nsIDOMUIEvent.h" #endif /* For IDL files that don't want to include root IDL files. */ #ifndef NS_NO_VTABLE #define NS_NO_VTABLE #endif /* starting interface: nsIDOMMouseEvent */ #define NS_IDOMMOUSEEVENT_IID_STR "ff751edc-8b02-aae7-0010-8301838a3123" #define NS_IDOMMOUSEEVENT_IID \ {0xff751edc, 0x8b02, 0xaae7, \ { 0x00, 0x10, 0x83, 0x01, 0x83, 0x8a, 0x31, 0x23 }} /** * The nsIDOMMouseEvent interface is the datatype for all mouse events * in the Document Object Model. * * For more information on this interface please see * http://www.w3.org/TR/DOM-Level-2-Events/ * * @status FROZEN */ class NS_NO_VTABLE NS_SCRIPTABLE nsIDOMMouseEvent : public nsIDOMUIEvent { public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMMOUSEEVENT_IID) /* readonly attribute long screenX; */ NS_SCRIPTABLE NS_IMETHOD GetScreenX(PRInt32 *aScreenX) = 0; /* readonly attribute long screenY; */ NS_SCRIPTABLE NS_IMETHOD GetScreenY(PRInt32 *aScreenY) = 0; /* readonly attribute long clientX; */ NS_SCRIPTABLE NS_IMETHOD GetClientX(PRInt32 *aClientX) = 0; /* readonly attribute long clientY; */ NS_SCRIPTABLE NS_IMETHOD GetClientY(PRInt32 *aClientY) = 0; /* readonly attribute boolean ctrlKey; */ NS_SCRIPTABLE NS_IMETHOD GetCtrlKey(PRBool *aCtrlKey) = 0; /* readonly attribute boolean shiftKey; */ NS_SCRIPTABLE NS_IMETHOD GetShiftKey(PRBool *aShiftKey) = 0; /* readonly attribute boolean altKey; */ NS_SCRIPTABLE NS_IMETHOD GetAltKey(PRBool *aAltKey) = 0; /* readonly attribute boolean metaKey; */ NS_SCRIPTABLE NS_IMETHOD GetMetaKey(PRBool *aMetaKey) = 0; /* readonly attribute unsigned short button; */ NS_SCRIPTABLE NS_IMETHOD GetButton(PRUint16 *aButton) = 0; /* readonly attribute nsIDOMEventTarget relatedTarget; */ NS_SCRIPTABLE NS_IMETHOD GetRelatedTarget(nsIDOMEventTarget * *aRelatedTarget) = 0; /* void initMouseEvent (in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in nsIDOMAbstractView viewArg, in long detailArg, in long screenXArg, in long screenYArg, in long clientXArg, in long clientYArg, in boolean ctrlKeyArg, in boolean altKeyArg, in boolean shiftKeyArg, in boolean metaKeyArg, in unsigned short buttonArg, in nsIDOMEventTarget relatedTargetArg); */ NS_SCRIPTABLE NS_IMETHOD InitMouseEvent(const nsAString & typeArg, PRBool canBubbleArg, PRBool cancelableArg, nsIDOMAbstractView *viewArg, PRInt32 detailArg, PRInt32 screenXArg, PRInt32 screenYArg, PRInt32 clientXArg, PRInt32 clientYArg, PRBool ctrlKeyArg, PRBool altKeyArg, PRBool shiftKeyArg, PRBool metaKeyArg, PRUint16 buttonArg, nsIDOMEventTarget *relatedTargetArg) = 0; }; NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMMouseEvent, NS_IDOMMOUSEEVENT_IID) /* Use this macro when declaring classes that implement this interface. */ #define NS_DECL_NSIDOMMOUSEEVENT \ NS_SCRIPTABLE NS_IMETHOD GetScreenX(PRInt32 *aScreenX); \ NS_SCRIPTABLE NS_IMETHOD GetScreenY(PRInt32 *aScreenY); \ NS_SCRIPTABLE NS_IMETHOD GetClientX(PRInt32 *aClientX); \ NS_SCRIPTABLE NS_IMETHOD GetClientY(PRInt32 *aClientY); \ NS_SCRIPTABLE NS_IMETHOD GetCtrlKey(PRBool *aCtrlKey); \ NS_SCRIPTABLE NS_IMETHOD GetShiftKey(PRBool *aShiftKey); \ NS_SCRIPTABLE NS_IMETHOD GetAltKey(PRBool *aAltKey); \ NS_SCRIPTABLE NS_IMETHOD GetMetaKey(PRBool *aMetaKey); \ NS_SCRIPTABLE NS_IMETHOD GetButton(PRUint16 *aButton); \ NS_SCRIPTABLE NS_IMETHOD GetRelatedTarget(nsIDOMEventTarget * *aRelatedTarget); \ NS_SCRIPTABLE NS_IMETHOD InitMouseEvent(const nsAString & typeArg, PRBool canBubbleArg, PRBool cancelableArg, nsIDOMAbstractView *viewArg, PRInt32 detailArg, PRInt32 screenXArg, PRInt32 screenYArg, PRInt32 clientXArg, PRInt32 clientYArg, PRBool ctrlKeyArg, PRBool altKeyArg, PRBool shiftKeyArg, PRBool metaKeyArg, PRUint16 buttonArg, nsIDOMEventTarget *relatedTargetArg); /* Use this macro to declare functions that forward the behavior of this interface to another object. */ #define NS_FORWARD_NSIDOMMOUSEEVENT(_to) \ NS_SCRIPTABLE NS_IMETHOD GetScreenX(PRInt32 *aScreenX) { return _to GetScreenX(aScreenX); } \ NS_SCRIPTABLE NS_IMETHOD GetScreenY(PRInt32 *aScreenY) { return _to GetScreenY(aScreenY); } \ NS_SCRIPTABLE NS_IMETHOD GetClientX(PRInt32 *aClientX) { return _to GetClientX(aClientX); } \ NS_SCRIPTABLE NS_IMETHOD GetClientY(PRInt32 *aClientY) { return _to GetClientY(aClientY); } \ NS_SCRIPTABLE NS_IMETHOD GetCtrlKey(PRBool *aCtrlKey) { return _to GetCtrlKey(aCtrlKey); } \ NS_SCRIPTABLE NS_IMETHOD GetShiftKey(PRBool *aShiftKey) { return _to GetShiftKey(aShiftKey); } \ NS_SCRIPTABLE NS_IMETHOD GetAltKey(PRBool *aAltKey) { return _to GetAltKey(aAltKey); } \ NS_SCRIPTABLE NS_IMETHOD GetMetaKey(PRBool *aMetaKey) { return _to GetMetaKey(aMetaKey); } \ NS_SCRIPTABLE NS_IMETHOD GetButton(PRUint16 *aButton) { return _to GetButton(aButton); } \ NS_SCRIPTABLE NS_IMETHOD GetRelatedTarget(nsIDOMEventTarget * *aRelatedTarget) { return _to GetRelatedTarget(aRelatedTarget); } \ NS_SCRIPTABLE NS_IMETHOD InitMouseEvent(const nsAString & typeArg, PRBool canBubbleArg, PRBool cancelableArg, nsIDOMAbstractView *viewArg, PRInt32 detailArg, PRInt32 screenXArg, PRInt32 screenYArg, PRInt32 clientXArg, PRInt32 clientYArg, PRBool ctrlKeyArg, PRBool altKeyArg, PRBool shiftKeyArg, PRBool metaKeyArg, PRUint16 buttonArg, nsIDOMEventTarget *relatedTargetArg) { return _to InitMouseEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg, screenXArg, screenYArg, clientXArg, clientYArg, ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, buttonArg, relatedTargetArg); } /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */ #define NS_FORWARD_SAFE_NSIDOMMOUSEEVENT(_to) \ NS_SCRIPTABLE NS_IMETHOD GetScreenX(PRInt32 *aScreenX) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetScreenX(aScreenX); } \ NS_SCRIPTABLE NS_IMETHOD GetScreenY(PRInt32 *aScreenY) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetScreenY(aScreenY); } \ NS_SCRIPTABLE NS_IMETHOD GetClientX(PRInt32 *aClientX) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetClientX(aClientX); } \ NS_SCRIPTABLE NS_IMETHOD GetClientY(PRInt32 *aClientY) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetClientY(aClientY); } \ NS_SCRIPTABLE NS_IMETHOD GetCtrlKey(PRBool *aCtrlKey) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCtrlKey(aCtrlKey); } \ NS_SCRIPTABLE NS_IMETHOD GetShiftKey(PRBool *aShiftKey) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetShiftKey(aShiftKey); } \ NS_SCRIPTABLE NS_IMETHOD GetAltKey(PRBool *aAltKey) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAltKey(aAltKey); } \ NS_SCRIPTABLE NS_IMETHOD GetMetaKey(PRBool *aMetaKey) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMetaKey(aMetaKey); } \ NS_SCRIPTABLE NS_IMETHOD GetButton(PRUint16 *aButton) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetButton(aButton); } \ NS_SCRIPTABLE NS_IMETHOD GetRelatedTarget(nsIDOMEventTarget * *aRelatedTarget) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRelatedTarget(aRelatedTarget); } \ NS_SCRIPTABLE NS_IMETHOD InitMouseEvent(const nsAString & typeArg, PRBool canBubbleArg, PRBool cancelableArg, nsIDOMAbstractView *viewArg, PRInt32 detailArg, PRInt32 screenXArg, PRInt32 screenYArg, PRInt32 clientXArg, PRInt32 clientYArg, PRBool ctrlKeyArg, PRBool altKeyArg, PRBool shiftKeyArg, PRBool metaKeyArg, PRUint16 buttonArg, nsIDOMEventTarget *relatedTargetArg) { return !_to ? NS_ERROR_NULL_POINTER : _to->InitMouseEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg, screenXArg, screenYArg, clientXArg, clientYArg, ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, buttonArg, relatedTargetArg); } #if 0 /* Use the code below as a template for the implementation class for this interface. */ /* Header file */ class nsDOMMouseEvent : public nsIDOMMouseEvent { public: NS_DECL_ISUPPORTS NS_DECL_NSIDOMMOUSEEVENT nsDOMMouseEvent(); private: ~nsDOMMouseEvent(); protected: /* additional members */ }; /* Implementation file */ NS_IMPL_ISUPPORTS1(nsDOMMouseEvent, nsIDOMMouseEvent) nsDOMMouseEvent::nsDOMMouseEvent() { /* member initializers and constructor code */ } nsDOMMouseEvent::~nsDOMMouseEvent() { /* destructor code */ } /* readonly attribute long screenX; */ NS_IMETHODIMP nsDOMMouseEvent::GetScreenX(PRInt32 *aScreenX) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute long screenY; */ NS_IMETHODIMP nsDOMMouseEvent::GetScreenY(PRInt32 *aScreenY) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute long clientX; */ NS_IMETHODIMP nsDOMMouseEvent::GetClientX(PRInt32 *aClientX) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute long clientY; */ NS_IMETHODIMP nsDOMMouseEvent::GetClientY(PRInt32 *aClientY) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute boolean ctrlKey; */ NS_IMETHODIMP nsDOMMouseEvent::GetCtrlKey(PRBool *aCtrlKey) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute boolean shiftKey; */ NS_IMETHODIMP nsDOMMouseEvent::GetShiftKey(PRBool *aShiftKey) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute boolean altKey; */ NS_IMETHODIMP nsDOMMouseEvent::GetAltKey(PRBool *aAltKey) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute boolean metaKey; */ NS_IMETHODIMP nsDOMMouseEvent::GetMetaKey(PRBool *aMetaKey) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute unsigned short button; */ NS_IMETHODIMP nsDOMMouseEvent::GetButton(PRUint16 *aButton) { return NS_ERROR_NOT_IMPLEMENTED; } /* readonly attribute nsIDOMEventTarget relatedTarget; */ NS_IMETHODIMP nsDOMMouseEvent::GetRelatedTarget(nsIDOMEventTarget * *aRelatedTarget) { return NS_ERROR_NOT_IMPLEMENTED; } /* void initMouseEvent (in DOMString typeArg, in boolean canBubbleArg, in boolean cancelableArg, in nsIDOMAbstractView viewArg, in long detailArg, in long screenXArg, in long screenYArg, in long clientXArg, in long clientYArg, in boolean ctrlKeyArg, in boolean altKeyArg, in boolean shiftKeyArg, in boolean metaKeyArg, in unsigned short buttonArg, in nsIDOMEventTarget relatedTargetArg); */ NS_IMETHODIMP nsDOMMouseEvent::InitMouseEvent(const nsAString & typeArg, PRBool canBubbleArg, PRBool cancelableArg, nsIDOMAbstractView *viewArg, PRInt32 detailArg, PRInt32 screenXArg, PRInt32 screenYArg, PRInt32 clientXArg, PRInt32 clientYArg, PRBool ctrlKeyArg, PRBool altKeyArg, PRBool shiftKeyArg, PRBool metaKeyArg, PRUint16 buttonArg, nsIDOMEventTarget *relatedTargetArg) { return NS_ERROR_NOT_IMPLEMENTED; } /* End of implementation class template. */ #endif #endif /* __gen_nsIDOMMouseEvent_h__ */
{ "pile_set_name": "Github" }
<?xml version='1.0' encoding='utf-8'?> <section xmlns="https://code.dccouncil.us/schemas/dc-library" xmlns:codified="https://code.dccouncil.us/schemas/codified" xmlns:codify="https://code.dccouncil.us/schemas/codify" xmlns:xi="http://www.w3.org/2001/XInclude" containing-doc="D.C. Code"> <num>29-703.02</num> <heading>No agency power of limited partner as limited partner.</heading> <para> <num>(a)</num> <text>A limited partner is not an agent of a limited partnership solely by reason of being a limited partner.</text> </para> <para> <num>(b)</num> <text>A person’s status as a limited partner does not prevent or restrict the law, other than in this title, from imposing liability on a limited partnership because of the person’s conduct.</text> </para> <annotations> <annotation doc="D.C. Law 18-378" type="History">July 2, 2011, D.C. Law 18-378, § 2, 58 DCR 1720</annotation> <annotation doc="D.C. Law 19-210" type="History">Mar. 5, 2013, D.C. Law 19-210, § 2(g)(4)(B), 59 DCR 13171</annotation> <annotation type="Effect of Amendments">The 2013 amendment by <cite doc="D.C. Law 19-210">D.C. Law 19-210</cite> rewrote the section.</annotation> <text type="Editor's Notes">Application of Law 19-210: Section 7 of <cite doc="D.C. Law 19-210">D.C. Law 19-210</cite> provided that the act shall apply as of January 1, 2012.</text> <text type="Editor's Notes">Uniform Law: This section is based on § 302 of the Uniform Limited Partnership Act (2001 Act).</text> </annotations> </section>
{ "pile_set_name": "Github" }
# Introduction to compute-nth-fibbonacci-number TODO: write [great documentation](http://jacobian.org/writing/what-to-write/)
{ "pile_set_name": "Github" }
use feature 'say'; package Other; sub new { my $class = shift; bless { @_ }, $class } sub subr { my $self = shift; my $a = shift; my $b = shift; $a + $b } sub subr2 { my $self = shift; my $a = shift; my $b = shift; my $c = shift; $a + $b + $c } sub my_accessor { $_[0]->{my_accessor} + 1 } package Main; say '1..5'; my $other = Other->new(); my $x = 0; $x = $other->subr( 1, 2 ); if ($x != 3) { print 'not ' } say 'ok 1 - ', $x; $x = 0; $x = Other->subr2( 1, 2, 4 ); if ($x != 7) { print 'not ' } say 'ok 2 - ', $x; my $obj = Other->new( my_accessor => '123' ); print 'not ' if $obj->{my_accessor} ne '123'; say 'ok 3 - ', $obj->{my_accessor}; print 'not ' if $obj->my_accessor ne '124'; say 'ok 4 - ', $obj->my_accessor; print 'not ' if ref($obj) ne 'Other'; say 'ok 5 - ref # ', ref($obj);
{ "pile_set_name": "Github" }
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Contains definitions for the original form of Residual Networks. The 'v1' residual networks (ResNets) implemented in this module were proposed by: [1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun Deep Residual Learning for Image Recognition. arXiv:1512.03385 Other variants were introduced in: [2] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun Identity Mappings in Deep Residual Networks. arXiv: 1603.05027 The networks defined in this module utilize the bottleneck building block of [1] with projection shortcuts only for increasing depths. They employ batch normalization *after* every weight layer. This is the architecture used by MSRA in the Imagenet and MSCOCO 2016 competition models ResNet-101 and ResNet-152. See [2; Fig. 1a] for a comparison between the current 'v1' architecture and the alternative 'v2' architecture of [2] which uses batch normalization *before* every weight layer in the so-called full pre-activation units. Typical use: from tf_slim.nets import resnet_v1 ResNet-101 for image classification into 1000 classes: # inputs has shape [batch, 224, 224, 3] with slim.arg_scope(resnet_v1.resnet_arg_scope()): net, end_points = resnet_v1.resnet_v1_101(inputs, 1000, is_training=False) ResNet-101 for semantic segmentation into 21 classes: # inputs has shape [batch, 513, 513, 3] with slim.arg_scope(resnet_v1.resnet_arg_scope()): net, end_points = resnet_v1.resnet_v1_101(inputs, 21, is_training=False, global_pool=False, output_stride=16) """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v1 as tf import tf_slim as slim from nets import resnet_utils resnet_arg_scope = resnet_utils.resnet_arg_scope class NoOpScope(object): """No-op context manager.""" def __enter__(self): return None def __exit__(self, exc_type, exc_value, traceback): return False @slim.add_arg_scope def bottleneck(inputs, depth, depth_bottleneck, stride, rate=1, outputs_collections=None, scope=None, use_bounded_activations=False): """Bottleneck residual unit variant with BN after convolutions. This is the original residual unit proposed in [1]. See Fig. 1(a) of [2] for its definition. Note that we use here the bottleneck variant which has an extra bottleneck layer. When putting together two consecutive ResNet blocks that use this unit, one should use stride = 2 in the last unit of the first block. Args: inputs: A tensor of size [batch, height, width, channels]. depth: The depth of the ResNet unit output. depth_bottleneck: The depth of the bottleneck layers. stride: The ResNet unit's stride. Determines the amount of downsampling of the units output compared to its input. rate: An integer, rate for atrous convolution. outputs_collections: Collection to add the ResNet unit output. scope: Optional variable_scope. use_bounded_activations: Whether or not to use bounded activations. Bounded activations better lend themselves to quantized inference. Returns: The ResNet unit's output. """ with tf.variable_scope(scope, 'bottleneck_v1', [inputs]) as sc: depth_in = slim.utils.last_dimension(inputs.get_shape(), min_rank=4) if depth == depth_in: shortcut = resnet_utils.subsample(inputs, stride, 'shortcut') else: shortcut = slim.conv2d( inputs, depth, [1, 1], stride=stride, activation_fn=tf.nn.relu6 if use_bounded_activations else None, scope='shortcut') residual = slim.conv2d(inputs, depth_bottleneck, [1, 1], stride=1, scope='conv1') residual = resnet_utils.conv2d_same(residual, depth_bottleneck, 3, stride, rate=rate, scope='conv2') residual = slim.conv2d(residual, depth, [1, 1], stride=1, activation_fn=None, scope='conv3') if use_bounded_activations: # Use clip_by_value to simulate bandpass activation. residual = tf.clip_by_value(residual, -6.0, 6.0) output = tf.nn.relu6(shortcut + residual) else: output = tf.nn.relu(shortcut + residual) return slim.utils.collect_named_outputs(outputs_collections, sc.name, output) def resnet_v1(inputs, blocks, num_classes=None, is_training=True, global_pool=True, output_stride=None, include_root_block=True, spatial_squeeze=True, store_non_strided_activations=False, reuse=None, scope=None): """Generator for v1 ResNet models. This function generates a family of ResNet v1 models. See the resnet_v1_*() methods for specific model instantiations, obtained by selecting different block instantiations that produce ResNets of various depths. Training for image classification on Imagenet is usually done with [224, 224] inputs, resulting in [7, 7] feature maps at the output of the last ResNet block for the ResNets defined in [1] that have nominal stride equal to 32. However, for dense prediction tasks we advise that one uses inputs with spatial dimensions that are multiples of 32 plus 1, e.g., [321, 321]. In this case the feature maps at the ResNet output will have spatial shape [(height - 1) / output_stride + 1, (width - 1) / output_stride + 1] and corners exactly aligned with the input image corners, which greatly facilitates alignment of the features to the image. Using as input [225, 225] images results in [8, 8] feature maps at the output of the last ResNet block. For dense prediction tasks, the ResNet needs to run in fully-convolutional (FCN) mode and global_pool needs to be set to False. The ResNets in [1, 2] all have nominal stride equal to 32 and a good choice in FCN mode is to use output_stride=16 in order to increase the density of the computed features at small computational and memory overhead, cf. http://arxiv.org/abs/1606.00915. Args: inputs: A tensor of size [batch, height_in, width_in, channels]. blocks: A list of length equal to the number of ResNet blocks. Each element is a resnet_utils.Block object describing the units in the block. num_classes: Number of predicted classes for classification tasks. If 0 or None, we return the features before the logit layer. is_training: whether batch_norm layers are in training mode. If this is set to None, the callers can specify slim.batch_norm's is_training parameter from an outer slim.arg_scope. global_pool: If True, we perform global average pooling before computing the logits. Set to True for image classification, False for dense prediction. output_stride: If None, then the output will be computed at the nominal network stride. If output_stride is not None, it specifies the requested ratio of input to output spatial resolution. include_root_block: If True, include the initial convolution followed by max-pooling, if False excludes it. spatial_squeeze: if True, logits is of shape [B, C], if false logits is of shape [B, 1, 1, C], where B is batch_size and C is number of classes. To use this parameter, the input images must be smaller than 300x300 pixels, in which case the output logit layer does not contain spatial information and can be removed. store_non_strided_activations: If True, we compute non-strided (undecimated) activations at the last unit of each block and store them in the `outputs_collections` before subsampling them. This gives us access to higher resolution intermediate activations which are useful in some dense prediction problems but increases 4x the computation and memory cost at the last unit of each block. reuse: whether or not the network and its variables should be reused. To be able to reuse 'scope' must be given. scope: Optional variable_scope. Returns: net: A rank-4 tensor of size [batch, height_out, width_out, channels_out]. If global_pool is False, then height_out and width_out are reduced by a factor of output_stride compared to the respective height_in and width_in, else both height_out and width_out equal one. If num_classes is 0 or None, then net is the output of the last ResNet block, potentially after global average pooling. If num_classes a non-zero integer, net contains the pre-softmax activations. end_points: A dictionary from components of the network to the corresponding activation. Raises: ValueError: If the target output_stride is not valid. """ with tf.variable_scope( scope, 'resnet_v1', [inputs], reuse=reuse) as sc: end_points_collection = sc.original_name_scope + '_end_points' with slim.arg_scope([slim.conv2d, bottleneck, resnet_utils.stack_blocks_dense], outputs_collections=end_points_collection): with (slim.arg_scope([slim.batch_norm], is_training=is_training) if is_training is not None else NoOpScope()): net = inputs if include_root_block: if output_stride is not None: if output_stride % 4 != 0: raise ValueError('The output_stride needs to be a multiple of 4.') output_stride /= 4 net = resnet_utils.conv2d_same(net, 64, 7, stride=2, scope='conv1') net = slim.max_pool2d(net, [3, 3], stride=2, scope='pool1') net = resnet_utils.stack_blocks_dense(net, blocks, output_stride, store_non_strided_activations) # Convert end_points_collection into a dictionary of end_points. end_points = slim.utils.convert_collection_to_dict( end_points_collection) if global_pool: # Global average pooling. net = tf.reduce_mean( input_tensor=net, axis=[1, 2], name='pool5', keepdims=True) end_points['global_pool'] = net if num_classes: net = slim.conv2d(net, num_classes, [1, 1], activation_fn=None, normalizer_fn=None, scope='logits') end_points[sc.name + '/logits'] = net if spatial_squeeze: net = tf.squeeze(net, [1, 2], name='SpatialSqueeze') end_points[sc.name + '/spatial_squeeze'] = net end_points['predictions'] = slim.softmax(net, scope='predictions') return net, end_points resnet_v1.default_image_size = 224 def resnet_v1_block(scope, base_depth, num_units, stride): """Helper function for creating a resnet_v1 bottleneck block. Args: scope: The scope of the block. base_depth: The depth of the bottleneck layer for each unit. num_units: The number of units in the block. stride: The stride of the block, implemented as a stride in the last unit. All other units have stride=1. Returns: A resnet_v1 bottleneck block. """ return resnet_utils.Block(scope, bottleneck, [{ 'depth': base_depth * 4, 'depth_bottleneck': base_depth, 'stride': 1 }] * (num_units - 1) + [{ 'depth': base_depth * 4, 'depth_bottleneck': base_depth, 'stride': stride }]) def resnet_v1_50(inputs, num_classes=None, is_training=True, global_pool=True, output_stride=None, spatial_squeeze=True, store_non_strided_activations=False, min_base_depth=8, depth_multiplier=1, reuse=None, scope='resnet_v1_50'): """ResNet-50 model of [1]. See resnet_v1() for arg and return description.""" depth_func = lambda d: max(int(d * depth_multiplier), min_base_depth) blocks = [ resnet_v1_block('block1', base_depth=depth_func(64), num_units=3, stride=2), resnet_v1_block('block2', base_depth=depth_func(128), num_units=4, stride=2), resnet_v1_block('block3', base_depth=depth_func(256), num_units=6, stride=2), resnet_v1_block('block4', base_depth=depth_func(512), num_units=3, stride=1), ] return resnet_v1(inputs, blocks, num_classes, is_training, global_pool=global_pool, output_stride=output_stride, include_root_block=True, spatial_squeeze=spatial_squeeze, store_non_strided_activations=store_non_strided_activations, reuse=reuse, scope=scope) resnet_v1_50.default_image_size = resnet_v1.default_image_size def resnet_v1_101(inputs, num_classes=None, is_training=True, global_pool=True, output_stride=None, spatial_squeeze=True, store_non_strided_activations=False, min_base_depth=8, depth_multiplier=1, reuse=None, scope='resnet_v1_101'): """ResNet-101 model of [1]. See resnet_v1() for arg and return description.""" depth_func = lambda d: max(int(d * depth_multiplier), min_base_depth) blocks = [ resnet_v1_block('block1', base_depth=depth_func(64), num_units=3, stride=2), resnet_v1_block('block2', base_depth=depth_func(128), num_units=4, stride=2), resnet_v1_block('block3', base_depth=depth_func(256), num_units=23, stride=2), resnet_v1_block('block4', base_depth=depth_func(512), num_units=3, stride=1), ] return resnet_v1(inputs, blocks, num_classes, is_training, global_pool=global_pool, output_stride=output_stride, include_root_block=True, spatial_squeeze=spatial_squeeze, store_non_strided_activations=store_non_strided_activations, reuse=reuse, scope=scope) resnet_v1_101.default_image_size = resnet_v1.default_image_size def resnet_v1_152(inputs, num_classes=None, is_training=True, global_pool=True, output_stride=None, store_non_strided_activations=False, spatial_squeeze=True, min_base_depth=8, depth_multiplier=1, reuse=None, scope='resnet_v1_152'): """ResNet-152 model of [1]. See resnet_v1() for arg and return description.""" depth_func = lambda d: max(int(d * depth_multiplier), min_base_depth) blocks = [ resnet_v1_block('block1', base_depth=depth_func(64), num_units=3, stride=2), resnet_v1_block('block2', base_depth=depth_func(128), num_units=8, stride=2), resnet_v1_block('block3', base_depth=depth_func(256), num_units=36, stride=2), resnet_v1_block('block4', base_depth=depth_func(512), num_units=3, stride=1), ] return resnet_v1(inputs, blocks, num_classes, is_training, global_pool=global_pool, output_stride=output_stride, include_root_block=True, spatial_squeeze=spatial_squeeze, store_non_strided_activations=store_non_strided_activations, reuse=reuse, scope=scope) resnet_v1_152.default_image_size = resnet_v1.default_image_size def resnet_v1_200(inputs, num_classes=None, is_training=True, global_pool=True, output_stride=None, store_non_strided_activations=False, spatial_squeeze=True, min_base_depth=8, depth_multiplier=1, reuse=None, scope='resnet_v1_200'): """ResNet-200 model of [2]. See resnet_v1() for arg and return description.""" depth_func = lambda d: max(int(d * depth_multiplier), min_base_depth) blocks = [ resnet_v1_block('block1', base_depth=depth_func(64), num_units=3, stride=2), resnet_v1_block('block2', base_depth=depth_func(128), num_units=24, stride=2), resnet_v1_block('block3', base_depth=depth_func(256), num_units=36, stride=2), resnet_v1_block('block4', base_depth=depth_func(512), num_units=3, stride=1), ] return resnet_v1(inputs, blocks, num_classes, is_training, global_pool=global_pool, output_stride=output_stride, include_root_block=True, spatial_squeeze=spatial_squeeze, store_non_strided_activations=store_non_strided_activations, reuse=reuse, scope=scope) resnet_v1_200.default_image_size = resnet_v1.default_image_size
{ "pile_set_name": "Github" }
/****************************************************************************** * * Copyright 2014 Paphus Solutions Inc. * * Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html * * 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.botlibre.sdk.config; import java.io.StringWriter; /** * A speech object can be used to invoke server-side text-to-speech. * The object takes a message text, and a voice. */ public class Speech extends Config { public String text; public String voice; public String mod; public String toXML() { StringWriter writer = new StringWriter(); writer.write("<speech"); writeCredentials(writer); if (this.text != null) { writer.write(" text=\"" + this.text + "\""); } if (this.voice != null) { writer.write(" voice=\"" + this.voice + "\""); } if (this.mod != null) { writer.write(" mod=\"" + this.mod.toLowerCase() + "\""); } writer.write("/>"); return writer.toString(); } }
{ "pile_set_name": "Github" }
/* * at91sam9g45.dtsi - Device Tree Include file for AT91SAM9G45 family SoC * applies to AT91SAM9G45, AT91SAM9M10, * AT91SAM9G46, AT91SAM9M11 SoC * * Copyright (C) 2011 Atmel, * 2011 Nicolas Ferre <[email protected]> * * Licensed under GPLv2 or later. */ #include "skeleton.dtsi" #include <dt-bindings/dma/at91.h> #include <dt-bindings/pinctrl/at91.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/clock/at91.h> / { model = "Atmel AT91SAM9G45 family SoC"; compatible = "atmel,at91sam9g45"; interrupt-parent = <&aic>; aliases { serial0 = &dbgu; serial1 = &usart0; serial2 = &usart1; serial3 = &usart2; serial4 = &usart3; gpio0 = &pioA; gpio1 = &pioB; gpio2 = &pioC; gpio3 = &pioD; gpio4 = &pioE; tcb0 = &tcb0; tcb1 = &tcb1; i2c0 = &i2c0; i2c1 = &i2c1; ssc0 = &ssc0; ssc1 = &ssc1; pwm0 = &pwm0; }; cpus { cpu { compatible = "arm,arm926ej-s"; device_type = "cpu"; }; }; memory { reg = <0x70000000 0x10000000>; }; clocks { slow_xtal: slow_xtal { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <0>; }; main_xtal: main_xtal { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <0>; }; adc_op_clk: adc_op_clk{ compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <300000>; }; }; sram: sram@00300000 { compatible = "mmio-sram"; reg = <0x00300000 0x10000>; }; ahb { compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>; ranges; u-boot,dm-pre-reloc; apb { compatible = "simple-bus"; #address-cells = <1>; #size-cells = <1>; ranges; u-boot,dm-pre-reloc; aic: interrupt-controller@fffff000 { #interrupt-cells = <3>; compatible = "atmel,at91rm9200-aic"; interrupt-controller; reg = <0xfffff000 0x200>; atmel,external-irqs = <31>; }; ramc0: ramc@ffffe400 { compatible = "atmel,at91sam9g45-ddramc"; reg = <0xffffe400 0x200>; clocks = <&ddrck>; clock-names = "ddrck"; }; ramc1: ramc@ffffe600 { compatible = "atmel,at91sam9g45-ddramc"; reg = <0xffffe600 0x200>; clocks = <&ddrck>; clock-names = "ddrck"; }; pmc: pmc@fffffc00 { compatible = "atmel,at91sam9g45-pmc", "syscon"; reg = <0xfffffc00 0x100>; interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; interrupt-controller; #address-cells = <1>; #size-cells = <0>; #interrupt-cells = <1>; u-boot,dm-pre-reloc; main_osc: main_osc { compatible = "atmel,at91rm9200-clk-main-osc"; #clock-cells = <0>; interrupts-extended = <&pmc AT91_PMC_MOSCS>; clocks = <&main_xtal>; }; main: mainck { compatible = "atmel,at91rm9200-clk-main"; #clock-cells = <0>; clocks = <&main_osc>; }; plla: pllack@0 { compatible = "atmel,at91rm9200-clk-pll"; #clock-cells = <0>; interrupts-extended = <&pmc AT91_PMC_LOCKA>; clocks = <&main>; reg = <0>; atmel,clk-input-range = <2000000 32000000>; #atmel,pll-clk-output-range-cells = <4>; atmel,pll-clk-output-ranges = <745000000 800000000 0 0 695000000 750000000 1 0 645000000 700000000 2 0 595000000 650000000 3 0 545000000 600000000 0 1 495000000 555000000 1 1 445000000 500000000 2 1 400000000 450000000 3 1>; }; plladiv: plladivck { compatible = "atmel,at91sam9x5-clk-plldiv"; #clock-cells = <0>; clocks = <&plla>; }; utmi: utmick { compatible = "atmel,at91sam9x5-clk-utmi"; #clock-cells = <0>; interrupts-extended = <&pmc AT91_PMC_LOCKU>; clocks = <&main>; }; mck: masterck { compatible = "atmel,at91rm9200-clk-master"; #clock-cells = <0>; interrupts-extended = <&pmc AT91_PMC_MCKRDY>; clocks = <&clk32k>, <&main>, <&plladiv>, <&utmi>; atmel,clk-output-range = <0 133333333>; atmel,clk-divisors = <1 2 4 3>; u-boot,dm-pre-reloc; }; usb: usbck { compatible = "atmel,at91sam9x5-clk-usb"; #clock-cells = <0>; clocks = <&plladiv>, <&utmi>; }; prog: progck { compatible = "atmel,at91sam9g45-clk-programmable"; #address-cells = <1>; #size-cells = <0>; interrupt-parent = <&pmc>; clocks = <&clk32k>, <&main>, <&plladiv>, <&utmi>, <&mck>; prog0: prog@0 { #clock-cells = <0>; reg = <0>; interrupts = <AT91_PMC_PCKRDY(0)>; }; prog1: prog@1 { #clock-cells = <0>; reg = <1>; interrupts = <AT91_PMC_PCKRDY(1)>; }; }; systemck { compatible = "atmel,at91rm9200-clk-system"; #address-cells = <1>; #size-cells = <0>; ddrck: ddrck@2 { #clock-cells = <0>; reg = <2>; clocks = <&mck>; }; uhpck: uhpck@6 { #clock-cells = <0>; reg = <6>; clocks = <&usb>; }; pck0: pck0@8 { #clock-cells = <0>; reg = <8>; clocks = <&prog0>; }; pck1: pck1@9 { #clock-cells = <0>; reg = <9>; clocks = <&prog1>; }; }; periphck { compatible = "atmel,at91rm9200-clk-peripheral"; #address-cells = <1>; #size-cells = <0>; clocks = <&mck>; pioA_clk: pioA_clk@2 { #clock-cells = <0>; reg = <2>; }; pioB_clk: pioB_clk@3 { #clock-cells = <0>; reg = <3>; }; pioC_clk: pioC_clk@4 { #clock-cells = <0>; reg = <4>; }; pioDE_clk: pioDE_clk@5 { #clock-cells = <0>; reg = <5>; }; trng_clk: trng_clk@6 { #clock-cells = <0>; reg = <6>; }; usart0_clk: usart0_clk@7 { #clock-cells = <0>; reg = <7>; }; usart1_clk: usart1_clk@8 { #clock-cells = <0>; reg = <8>; }; usart2_clk: usart2_clk@9 { #clock-cells = <0>; reg = <9>; }; usart3_clk: usart3_clk@10 { #clock-cells = <0>; reg = <10>; }; mci0_clk: mci0_clk@11 { #clock-cells = <0>; reg = <11>; }; twi0_clk: twi0_clk@12 { #clock-cells = <0>; reg = <12>; }; twi1_clk: twi1_clk@13 { #clock-cells = <0>; reg = <13>; }; spi0_clk: spi0_clk@14 { #clock-cells = <0>; reg = <14>; }; spi1_clk: spi1_clk@15 { #clock-cells = <0>; reg = <15>; }; ssc0_clk: ssc0_clk@16 { #clock-cells = <0>; reg = <16>; }; ssc1_clk: ssc1_clk@17 { #clock-cells = <0>; reg = <17>; }; tcb0_clk: tcb0_clk@18 { #clock-cells = <0>; reg = <18>; }; pwm_clk: pwm_clk@19 { #clock-cells = <0>; reg = <19>; }; adc_clk: adc_clk@20 { #clock-cells = <0>; reg = <20>; }; dma0_clk: dma0_clk@21 { #clock-cells = <0>; reg = <21>; }; uhphs_clk: uhphs_clk@22 { #clock-cells = <0>; reg = <22>; }; lcd_clk: lcd_clk@23 { #clock-cells = <0>; reg = <23>; }; ac97_clk: ac97_clk@24 { #clock-cells = <0>; reg = <24>; }; macb0_clk: macb0_clk@25 { #clock-cells = <0>; reg = <25>; }; isi_clk: isi_clk@26 { #clock-cells = <0>; reg = <26>; }; udphs_clk: udphs_clk@27 { #clock-cells = <0>; reg = <27>; }; aestdessha_clk: aestdessha_clk@28 { #clock-cells = <0>; reg = <28>; }; mci1_clk: mci1_clk@29 { #clock-cells = <0>; reg = <29>; }; vdec_clk: vdec_clk@30 { #clock-cells = <0>; reg = <30>; }; }; }; rstc@fffffd00 { compatible = "atmel,at91sam9g45-rstc"; reg = <0xfffffd00 0x10>; clocks = <&clk32k>; }; pit: timer@fffffd30 { compatible = "atmel,at91sam9260-pit"; reg = <0xfffffd30 0xf>; interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; clocks = <&mck>; }; shdwc@fffffd10 { compatible = "atmel,at91sam9rl-shdwc"; reg = <0xfffffd10 0x10>; clocks = <&clk32k>; }; tcb0: timer@fff7c000 { compatible = "atmel,at91rm9200-tcb"; reg = <0xfff7c000 0x100>; interrupts = <18 IRQ_TYPE_LEVEL_HIGH 0>; clocks = <&tcb0_clk>, <&tcb0_clk>, <&tcb0_clk>, <&clk32k>; clock-names = "t0_clk", "t1_clk", "t2_clk", "slow_clk"; }; tcb1: timer@fffd4000 { compatible = "atmel,at91rm9200-tcb"; reg = <0xfffd4000 0x100>; interrupts = <18 IRQ_TYPE_LEVEL_HIGH 0>; clocks = <&tcb0_clk>, <&tcb0_clk>, <&tcb0_clk>, <&clk32k>; clock-names = "t0_clk", "t1_clk", "t2_clk", "slow_clk"; }; dma: dma-controller@ffffec00 { compatible = "atmel,at91sam9g45-dma"; reg = <0xffffec00 0x200>; interrupts = <21 IRQ_TYPE_LEVEL_HIGH 0>; #dma-cells = <2>; clocks = <&dma0_clk>; clock-names = "dma_clk"; }; pinctrl@fffff200 { #address-cells = <1>; #size-cells = <1>; compatible = "atmel,at91rm9200-pinctrl", "simple-bus"; ranges = <0xfffff200 0xfffff200 0xa00>; reg = <0xfffff200 0x200 0xfffff400 0x200 0xfffff600 0x200 0xfffff800 0x200 0xfffffa00 0x200 >; u-boot,dm-pre-reloc; atmel,mux-mask = < /* A B */ 0xffffffff 0xffc003ff /* pioA */ 0xffffffff 0x800f8f00 /* pioB */ 0xffffffff 0x00000e00 /* pioC */ 0xffffffff 0xff0c1381 /* pioD */ 0xffffffff 0x81ffff81 /* pioE */ >; /* shared pinctrl settings */ adc0 { pinctrl_adc0_adtrg: adc0_adtrg { atmel,pins = <AT91_PIOD 28 AT91_PERIPH_A AT91_PINCTRL_NONE>; }; pinctrl_adc0_ad0: adc0_ad0 { atmel,pins = <AT91_PIOD 20 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; }; pinctrl_adc0_ad1: adc0_ad1 { atmel,pins = <AT91_PIOD 21 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; }; pinctrl_adc0_ad2: adc0_ad2 { atmel,pins = <AT91_PIOD 22 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; }; pinctrl_adc0_ad3: adc0_ad3 { atmel,pins = <AT91_PIOD 23 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; }; pinctrl_adc0_ad4: adc0_ad4 { atmel,pins = <AT91_PIOD 24 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; }; pinctrl_adc0_ad5: adc0_ad5 { atmel,pins = <AT91_PIOD 25 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; }; pinctrl_adc0_ad6: adc0_ad6 { atmel,pins = <AT91_PIOD 26 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; }; pinctrl_adc0_ad7: adc0_ad7 { atmel,pins = <AT91_PIOD 27 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; }; }; dbgu { u-boot,dm-pre-reloc; pinctrl_dbgu: dbgu-0 { atmel,pins = <AT91_PIOB 12 AT91_PERIPH_A AT91_PINCTRL_PULL_UP AT91_PIOB 13 AT91_PERIPH_A AT91_PINCTRL_NONE>; }; }; i2c0 { pinctrl_i2c0: i2c0-0 { atmel,pins = <AT91_PIOA 21 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA21 periph A TWCK0 */ AT91_PIOA 20 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PA20 periph A TWD0 */ }; }; i2c1 { pinctrl_i2c1: i2c1-0 { atmel,pins = <AT91_PIOB 11 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB11 periph A TWCK1 */ AT91_PIOB 10 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB10 periph A TWD1 */ }; }; isi { pinctrl_isi_data_0_7: isi-0-data-0-7 { atmel,pins = <AT91_PIOB 20 AT91_PERIPH_A AT91_PINCTRL_NONE /* D0 */ AT91_PIOB 21 AT91_PERIPH_A AT91_PINCTRL_NONE /* D1 */ AT91_PIOB 22 AT91_PERIPH_A AT91_PINCTRL_NONE /* D2 */ AT91_PIOB 23 AT91_PERIPH_A AT91_PINCTRL_NONE /* D3 */ AT91_PIOB 24 AT91_PERIPH_A AT91_PINCTRL_NONE /* D4 */ AT91_PIOB 25 AT91_PERIPH_A AT91_PINCTRL_NONE /* D5 */ AT91_PIOB 26 AT91_PERIPH_A AT91_PINCTRL_NONE /* D6 */ AT91_PIOB 27 AT91_PERIPH_A AT91_PINCTRL_NONE /* D7 */ AT91_PIOB 28 AT91_PERIPH_A AT91_PINCTRL_NONE /* PCK */ AT91_PIOB 29 AT91_PERIPH_A AT91_PINCTRL_NONE /* VSYNC */ AT91_PIOB 30 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* HSYNC */ }; pinctrl_isi_data_8_9: isi-0-data-8-9 { atmel,pins = <AT91_PIOB 8 AT91_PERIPH_B AT91_PINCTRL_NONE /* D8 */ AT91_PIOB 9 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* D9 */ }; pinctrl_isi_data_10_11: isi-0-data-10-11 { atmel,pins = <AT91_PIOB 10 AT91_PERIPH_B AT91_PINCTRL_NONE /* D10 */ AT91_PIOB 11 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* D11 */ }; }; usart0 { pinctrl_usart0: usart0-0 { atmel,pins = <AT91_PIOB 19 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PB19 periph A with pullup */ AT91_PIOB 18 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB18 periph A */ }; pinctrl_usart0_rts: usart0_rts-0 { atmel,pins = <AT91_PIOB 17 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PB17 periph B */ }; pinctrl_usart0_cts: usart0_cts-0 { atmel,pins = <AT91_PIOB 15 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PB15 periph B */ }; }; uart1 { pinctrl_usart1: usart1-0 { atmel,pins = <AT91_PIOB 4 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PB4 periph A with pullup */ AT91_PIOB 5 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB5 periph A */ }; pinctrl_usart1_rts: usart1_rts-0 { atmel,pins = <AT91_PIOD 16 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PD16 periph A */ }; pinctrl_usart1_cts: usart1_cts-0 { atmel,pins = <AT91_PIOD 17 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PD17 periph A */ }; }; usart2 { pinctrl_usart2: usart2-0 { atmel,pins = <AT91_PIOB 6 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PB6 periph A with pullup */ AT91_PIOB 7 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB7 periph A */ }; pinctrl_usart2_rts: usart2_rts-0 { atmel,pins = <AT91_PIOC 9 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PC9 periph B */ }; pinctrl_usart2_cts: usart2_cts-0 { atmel,pins = <AT91_PIOC 11 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PC11 periph B */ }; }; usart3 { pinctrl_usart3: usart3-0 { atmel,pins = <AT91_PIOB 8 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PB9 periph A with pullup */ AT91_PIOB 9 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB8 periph A */ }; pinctrl_usart3_rts: usart3_rts-0 { atmel,pins = <AT91_PIOA 23 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PA23 periph B */ }; pinctrl_usart3_cts: usart3_cts-0 { atmel,pins = <AT91_PIOA 24 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PA24 periph B */ }; }; nand { pinctrl_nand: nand-0 { atmel,pins = <AT91_PIOC 8 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP /* PC8 gpio RDY pin pull_up*/ AT91_PIOC 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>; /* PC14 gpio enable pin pull_up */ }; }; macb { pinctrl_macb_rmii: macb_rmii-0 { atmel,pins = <AT91_PIOA 10 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA10 periph A */ AT91_PIOA 11 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA11 periph A */ AT91_PIOA 12 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA12 periph A */ AT91_PIOA 13 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA13 periph A */ AT91_PIOA 14 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA14 periph A */ AT91_PIOA 15 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA15 periph A */ AT91_PIOA 16 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA16 periph A */ AT91_PIOA 17 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA17 periph A */ AT91_PIOA 18 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA18 periph A */ AT91_PIOA 19 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PA19 periph A */ }; pinctrl_macb_rmii_mii: macb_rmii_mii-0 { atmel,pins = <AT91_PIOA 6 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA6 periph B */ AT91_PIOA 7 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA7 periph B */ AT91_PIOA 8 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA8 periph B */ AT91_PIOA 9 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA9 periph B */ AT91_PIOA 27 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA27 periph B */ AT91_PIOA 28 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA28 periph B */ AT91_PIOA 29 AT91_PERIPH_B AT91_PINCTRL_NONE /* PA29 periph B */ AT91_PIOA 30 AT91_PERIPH_B AT91_PINCTRL_NONE>; /* PA30 periph B */ }; }; mmc0 { pinctrl_mmc0_slot0_clk_cmd_dat0: mmc0_slot0_clk_cmd_dat0-0 { atmel,pins = <AT91_PIOA 0 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA0 periph A */ AT91_PIOA 1 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PA1 periph A with pullup */ AT91_PIOA 2 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>; /* PA2 periph A with pullup */ }; pinctrl_mmc0_slot0_dat1_3: mmc0_slot0_dat1_3-0 { atmel,pins = <AT91_PIOA 3 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PA3 periph A with pullup */ AT91_PIOA 4 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PA4 periph A with pullup */ AT91_PIOA 5 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>; /* PA5 periph A with pullup */ }; pinctrl_mmc0_slot0_dat4_7: mmc0_slot0_dat4_7-0 { atmel,pins = <AT91_PIOA 6 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PA6 periph A with pullup */ AT91_PIOA 7 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PA7 periph A with pullup */ AT91_PIOA 8 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PA8 periph A with pullup */ AT91_PIOA 9 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>; /* PA9 periph A with pullup */ }; }; mmc1 { pinctrl_mmc1_slot0_clk_cmd_dat0: mmc1_slot0_clk_cmd_dat0-0 { atmel,pins = <AT91_PIOA 31 AT91_PERIPH_A AT91_PINCTRL_NONE /* PA31 periph A */ AT91_PIOA 22 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PA22 periph A with pullup */ AT91_PIOA 23 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>; /* PA23 periph A with pullup */ }; pinctrl_mmc1_slot0_dat1_3: mmc1_slot0_dat1_3-0 { atmel,pins = <AT91_PIOA 24 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PA24 periph A with pullup */ AT91_PIOA 25 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PA25 periph A with pullup */ AT91_PIOA 26 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>; /* PA26 periph A with pullup */ }; pinctrl_mmc1_slot0_dat4_7: mmc1_slot0_dat4_7-0 { atmel,pins = <AT91_PIOA 27 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PA27 periph A with pullup */ AT91_PIOA 28 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PA28 periph A with pullup */ AT91_PIOA 29 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PA29 periph A with pullup */ AT91_PIOA 20 AT91_PERIPH_A AT91_PINCTRL_PULL_UP>; /* PA30 periph A with pullup */ }; }; ssc0 { pinctrl_ssc0_tx: ssc0_tx-0 { atmel,pins = <AT91_PIOD 0 AT91_PERIPH_A AT91_PINCTRL_NONE /* PD0 periph A */ AT91_PIOD 1 AT91_PERIPH_A AT91_PINCTRL_NONE /* PD1 periph A */ AT91_PIOD 2 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PD2 periph A */ }; pinctrl_ssc0_rx: ssc0_rx-0 { atmel,pins = <AT91_PIOD 3 AT91_PERIPH_A AT91_PINCTRL_NONE /* PD3 periph A */ AT91_PIOD 4 AT91_PERIPH_A AT91_PINCTRL_NONE /* PD4 periph A */ AT91_PIOD 5 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PD5 periph A */ }; }; ssc1 { pinctrl_ssc1_tx: ssc1_tx-0 { atmel,pins = <AT91_PIOD 10 AT91_PERIPH_A AT91_PINCTRL_NONE /* PD10 periph A */ AT91_PIOD 11 AT91_PERIPH_A AT91_PINCTRL_NONE /* PD11 periph A */ AT91_PIOD 12 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PD12 periph A */ }; pinctrl_ssc1_rx: ssc1_rx-0 { atmel,pins = <AT91_PIOD 13 AT91_PERIPH_A AT91_PINCTRL_NONE /* PD13 periph A */ AT91_PIOD 14 AT91_PERIPH_A AT91_PINCTRL_NONE /* PD14 periph A */ AT91_PIOD 15 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PD15 periph A */ }; }; spi0 { pinctrl_spi0: spi0-0 { atmel,pins = <AT91_PIOB 0 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB0 periph A SPI0_MISO pin */ AT91_PIOB 1 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB1 periph A SPI0_MOSI pin */ AT91_PIOB 2 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB2 periph A SPI0_SPCK pin */ }; }; spi1 { pinctrl_spi1: spi1-0 { atmel,pins = <AT91_PIOB 14 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB14 periph A SPI1_MISO pin */ AT91_PIOB 15 AT91_PERIPH_A AT91_PINCTRL_NONE /* PB15 periph A SPI1_MOSI pin */ AT91_PIOB 16 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PB16 periph A SPI1_SPCK pin */ }; }; tcb0 { pinctrl_tcb0_tclk0: tcb0_tclk0-0 { atmel,pins = <AT91_PIOD 23 AT91_PERIPH_A AT91_PINCTRL_NONE>; }; pinctrl_tcb0_tclk1: tcb0_tclk1-0 { atmel,pins = <AT91_PIOD 29 AT91_PERIPH_A AT91_PINCTRL_NONE>; }; pinctrl_tcb0_tclk2: tcb0_tclk2-0 { atmel,pins = <AT91_PIOC 10 AT91_PERIPH_B AT91_PINCTRL_NONE>; }; pinctrl_tcb0_tioa0: tcb0_tioa0-0 { atmel,pins = <AT91_PIOD 20 AT91_PERIPH_A AT91_PINCTRL_NONE>; }; pinctrl_tcb0_tioa1: tcb0_tioa1-0 { atmel,pins = <AT91_PIOD 21 AT91_PERIPH_A AT91_PINCTRL_NONE>; }; pinctrl_tcb0_tioa2: tcb0_tioa2-0 { atmel,pins = <AT91_PIOD 22 AT91_PERIPH_A AT91_PINCTRL_NONE>; }; pinctrl_tcb0_tiob0: tcb0_tiob0-0 { atmel,pins = <AT91_PIOD 30 AT91_PERIPH_A AT91_PINCTRL_NONE>; }; pinctrl_tcb0_tiob1: tcb0_tiob1-0 { atmel,pins = <AT91_PIOD 31 AT91_PERIPH_A AT91_PINCTRL_NONE>; }; pinctrl_tcb0_tiob2: tcb0_tiob2-0 { atmel,pins = <AT91_PIOA 26 AT91_PERIPH_B AT91_PINCTRL_NONE>; }; }; tcb1 { pinctrl_tcb1_tclk0: tcb1_tclk0-0 { atmel,pins = <AT91_PIOA 0 AT91_PERIPH_B AT91_PINCTRL_NONE>; }; pinctrl_tcb1_tclk1: tcb1_tclk1-0 { atmel,pins = <AT91_PIOA 3 AT91_PERIPH_B AT91_PINCTRL_NONE>; }; pinctrl_tcb1_tclk2: tcb1_tclk2-0 { atmel,pins = <AT91_PIOD 9 AT91_PERIPH_B AT91_PINCTRL_NONE>; }; pinctrl_tcb1_tioa0: tcb1_tioa0-0 { atmel,pins = <AT91_PIOA 1 AT91_PERIPH_B AT91_PINCTRL_NONE>; }; pinctrl_tcb1_tioa1: tcb1_tioa1-0 { atmel,pins = <AT91_PIOA 4 AT91_PERIPH_B AT91_PINCTRL_NONE>; }; pinctrl_tcb1_tioa2: tcb1_tioa2-0 { atmel,pins = <AT91_PIOD 7 AT91_PERIPH_B AT91_PINCTRL_NONE>; }; pinctrl_tcb1_tiob0: tcb1_tiob0-0 { atmel,pins = <AT91_PIOA 2 AT91_PERIPH_B AT91_PINCTRL_NONE>; }; pinctrl_tcb1_tiob1: tcb1_tiob1-0 { atmel,pins = <AT91_PIOA 5 AT91_PERIPH_B AT91_PINCTRL_NONE>; }; pinctrl_tcb1_tiob2: tcb1_tiob2-0 { atmel,pins = <AT91_PIOD 8 AT91_PERIPH_B AT91_PINCTRL_NONE>; }; }; fb { pinctrl_fb: fb-0 { atmel,pins = <AT91_PIOE 0 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE0 periph A */ AT91_PIOE 2 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE2 periph A */ AT91_PIOE 3 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE3 periph A */ AT91_PIOE 4 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE4 periph A */ AT91_PIOE 5 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE5 periph A */ AT91_PIOE 6 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE6 periph A */ AT91_PIOE 7 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE7 periph A */ AT91_PIOE 8 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE8 periph A */ AT91_PIOE 9 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE9 periph A */ AT91_PIOE 10 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE10 periph A */ AT91_PIOE 11 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE11 periph A */ AT91_PIOE 12 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE12 periph A */ AT91_PIOE 13 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE13 periph A */ AT91_PIOE 14 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE14 periph A */ AT91_PIOE 15 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE15 periph A */ AT91_PIOE 16 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE16 periph A */ AT91_PIOE 17 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE17 periph A */ AT91_PIOE 18 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE18 periph A */ AT91_PIOE 19 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE19 periph A */ AT91_PIOE 20 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE20 periph A */ AT91_PIOE 21 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE21 periph A */ AT91_PIOE 22 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE22 periph A */ AT91_PIOE 23 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE23 periph A */ AT91_PIOE 24 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE24 periph A */ AT91_PIOE 25 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE25 periph A */ AT91_PIOE 26 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE26 periph A */ AT91_PIOE 27 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE27 periph A */ AT91_PIOE 28 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE28 periph A */ AT91_PIOE 29 AT91_PERIPH_A AT91_PINCTRL_NONE /* PE29 periph A */ AT91_PIOE 30 AT91_PERIPH_A AT91_PINCTRL_NONE>; /* PE30 periph A */ }; }; }; pioA: gpio@fffff200 { compatible = "atmel,at91rm9200-gpio"; reg = <0xfffff200 0x200>; interrupts = <2 IRQ_TYPE_LEVEL_HIGH 1>; #gpio-cells = <2>; gpio-controller; interrupt-controller; #interrupt-cells = <2>; clocks = <&pioA_clk>; }; pioB: gpio@fffff400 { compatible = "atmel,at91rm9200-gpio"; reg = <0xfffff400 0x200>; interrupts = <3 IRQ_TYPE_LEVEL_HIGH 1>; #gpio-cells = <2>; gpio-controller; interrupt-controller; #interrupt-cells = <2>; clocks = <&pioB_clk>; }; pioC: gpio@fffff600 { compatible = "atmel,at91rm9200-gpio"; reg = <0xfffff600 0x200>; interrupts = <4 IRQ_TYPE_LEVEL_HIGH 1>; #gpio-cells = <2>; gpio-controller; interrupt-controller; #interrupt-cells = <2>; clocks = <&pioC_clk>; }; pioD: gpio@fffff800 { compatible = "atmel,at91rm9200-gpio"; reg = <0xfffff800 0x200>; interrupts = <5 IRQ_TYPE_LEVEL_HIGH 1>; #gpio-cells = <2>; gpio-controller; interrupt-controller; #interrupt-cells = <2>; clocks = <&pioDE_clk>; }; pioE: gpio@fffffa00 { compatible = "atmel,at91rm9200-gpio"; reg = <0xfffffa00 0x200>; interrupts = <5 IRQ_TYPE_LEVEL_HIGH 1>; #gpio-cells = <2>; gpio-controller; interrupt-controller; #interrupt-cells = <2>; clocks = <&pioDE_clk>; }; dbgu: serial@ffffee00 { compatible = "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; reg = <0xffffee00 0x200>; interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_dbgu>; clocks = <&mck>; clock-names = "usart"; status = "disabled"; }; usart0: serial@fff8c000 { compatible = "atmel,at91sam9260-usart"; reg = <0xfff8c000 0x200>; interrupts = <7 IRQ_TYPE_LEVEL_HIGH 5>; atmel,use-dma-rx; atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart0>; clocks = <&usart0_clk>; clock-names = "usart"; status = "disabled"; }; usart1: serial@fff90000 { compatible = "atmel,at91sam9260-usart"; reg = <0xfff90000 0x200>; interrupts = <8 IRQ_TYPE_LEVEL_HIGH 5>; atmel,use-dma-rx; atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart1>; clocks = <&usart1_clk>; clock-names = "usart"; status = "disabled"; }; usart2: serial@fff94000 { compatible = "atmel,at91sam9260-usart"; reg = <0xfff94000 0x200>; interrupts = <9 IRQ_TYPE_LEVEL_HIGH 5>; atmel,use-dma-rx; atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart2>; clocks = <&usart2_clk>; clock-names = "usart"; status = "disabled"; }; usart3: serial@fff98000 { compatible = "atmel,at91sam9260-usart"; reg = <0xfff98000 0x200>; interrupts = <10 IRQ_TYPE_LEVEL_HIGH 5>; atmel,use-dma-rx; atmel,use-dma-tx; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usart3>; clocks = <&usart3_clk>; clock-names = "usart"; status = "disabled"; }; macb0: ethernet@fffbc000 { compatible = "cdns,at91sam9260-macb", "cdns,macb"; reg = <0xfffbc000 0x100>; interrupts = <25 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_macb_rmii>; clocks = <&macb0_clk>, <&macb0_clk>; clock-names = "hclk", "pclk"; status = "disabled"; }; trng@fffcc000 { compatible = "atmel,at91sam9g45-trng"; reg = <0xfffcc000 0x100>; interrupts = <6 IRQ_TYPE_LEVEL_HIGH 0>; clocks = <&trng_clk>; }; i2c0: i2c@fff84000 { compatible = "atmel,at91sam9g10-i2c"; reg = <0xfff84000 0x100>; interrupts = <12 IRQ_TYPE_LEVEL_HIGH 6>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c0>; #address-cells = <1>; #size-cells = <0>; clocks = <&twi0_clk>; status = "disabled"; }; i2c1: i2c@fff88000 { compatible = "atmel,at91sam9g10-i2c"; reg = <0xfff88000 0x100>; interrupts = <13 IRQ_TYPE_LEVEL_HIGH 6>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c1>; #address-cells = <1>; #size-cells = <0>; clocks = <&twi1_clk>; status = "disabled"; }; ssc0: ssc@fff9c000 { compatible = "atmel,at91sam9g45-ssc"; reg = <0xfff9c000 0x4000>; interrupts = <16 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc0_tx &pinctrl_ssc0_rx>; clocks = <&ssc0_clk>; clock-names = "pclk"; status = "disabled"; }; ssc1: ssc@fffa0000 { compatible = "atmel,at91sam9g45-ssc"; reg = <0xfffa0000 0x4000>; interrupts = <17 IRQ_TYPE_LEVEL_HIGH 5>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ssc1_tx &pinctrl_ssc1_rx>; clocks = <&ssc1_clk>; clock-names = "pclk"; status = "disabled"; }; adc0: adc@fffb0000 { compatible = "atmel,at91sam9g45-adc"; reg = <0xfffb0000 0x100>; interrupts = <20 IRQ_TYPE_LEVEL_HIGH 0>; clocks = <&adc_clk>, <&adc_op_clk>; clock-names = "adc_clk", "adc_op_clk"; atmel,adc-channels-used = <0xff>; atmel,adc-vref = <3300>; atmel,adc-startup-time = <40>; atmel,adc-res = <8 10>; atmel,adc-res-names = "lowres", "highres"; atmel,adc-use-res = "highres"; trigger0 { trigger-name = "external-rising"; trigger-value = <0x1>; trigger-external; }; trigger1 { trigger-name = "external-falling"; trigger-value = <0x2>; trigger-external; }; trigger2 { trigger-name = "external-any"; trigger-value = <0x3>; trigger-external; }; trigger3 { trigger-name = "continuous"; trigger-value = <0x6>; }; }; isi@fffb4000 { compatible = "atmel,at91sam9g45-isi"; reg = <0xfffb4000 0x4000>; interrupts = <26 IRQ_TYPE_LEVEL_HIGH 5>; clocks = <&isi_clk>; clock-names = "isi_clk"; status = "disabled"; }; pwm0: pwm@fffb8000 { compatible = "atmel,at91sam9rl-pwm"; reg = <0xfffb8000 0x300>; interrupts = <19 IRQ_TYPE_LEVEL_HIGH 4>; #pwm-cells = <3>; clocks = <&pwm_clk>; status = "disabled"; }; mmc0: mmc@fff80000 { compatible = "atmel,hsmci"; reg = <0xfff80000 0x600>; interrupts = <11 IRQ_TYPE_LEVEL_HIGH 0>; pinctrl-names = "default"; dmas = <&dma 1 AT91_DMA_CFG_PER_ID(0)>; dma-names = "rxtx"; #address-cells = <1>; #size-cells = <0>; clocks = <&mci0_clk>; clock-names = "mci_clk"; status = "disabled"; }; mmc1: mmc@fffd0000 { compatible = "atmel,hsmci"; reg = <0xfffd0000 0x600>; interrupts = <29 IRQ_TYPE_LEVEL_HIGH 0>; pinctrl-names = "default"; dmas = <&dma 1 AT91_DMA_CFG_PER_ID(13)>; dma-names = "rxtx"; #address-cells = <1>; #size-cells = <0>; clocks = <&mci1_clk>; clock-names = "mci_clk"; status = "disabled"; }; watchdog@fffffd40 { compatible = "atmel,at91sam9260-wdt"; reg = <0xfffffd40 0x10>; interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; clocks = <&clk32k>; atmel,watchdog-type = "hardware"; atmel,reset-type = "all"; atmel,dbg-halt; status = "disabled"; }; spi0: spi@fffa4000 { #address-cells = <1>; #size-cells = <0>; compatible = "atmel,at91rm9200-spi"; reg = <0xfffa4000 0x200>; interrupts = <14 4 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi0>; clocks = <&spi0_clk>; clock-names = "spi_clk"; status = "disabled"; }; spi1: spi@fffa8000 { #address-cells = <1>; #size-cells = <0>; compatible = "atmel,at91rm9200-spi"; reg = <0xfffa8000 0x200>; interrupts = <15 4 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_spi1>; clocks = <&spi1_clk>; clock-names = "spi_clk"; status = "disabled"; }; usb2: gadget@fff78000 { #address-cells = <1>; #size-cells = <0>; compatible = "atmel,at91sam9g45-udc"; reg = <0x00600000 0x80000 0xfff78000 0x400>; interrupts = <27 IRQ_TYPE_LEVEL_HIGH 0>; clocks = <&udphs_clk>, <&utmi>; clock-names = "pclk", "hclk"; status = "disabled"; ep@0 { reg = <0>; atmel,fifo-size = <64>; atmel,nb-banks = <1>; }; ep@1 { reg = <1>; atmel,fifo-size = <1024>; atmel,nb-banks = <2>; atmel,can-dma; atmel,can-isoc; }; ep@2 { reg = <2>; atmel,fifo-size = <1024>; atmel,nb-banks = <2>; atmel,can-dma; atmel,can-isoc; }; ep@3 { reg = <3>; atmel,fifo-size = <1024>; atmel,nb-banks = <3>; atmel,can-dma; }; ep@4 { reg = <4>; atmel,fifo-size = <1024>; atmel,nb-banks = <3>; atmel,can-dma; }; ep@5 { reg = <5>; atmel,fifo-size = <1024>; atmel,nb-banks = <3>; atmel,can-dma; atmel,can-isoc; }; ep@6 { reg = <6>; atmel,fifo-size = <1024>; atmel,nb-banks = <3>; atmel,can-dma; atmel,can-isoc; }; }; sckc@fffffd50 { compatible = "atmel,at91sam9x5-sckc"; reg = <0xfffffd50 0x4>; slow_osc: slow_osc { compatible = "atmel,at91sam9x5-clk-slow-osc"; #clock-cells = <0>; atmel,startup-time-usec = <1200000>; clocks = <&slow_xtal>; }; slow_rc_osc: slow_rc_osc { compatible = "atmel,at91sam9x5-clk-slow-rc-osc"; #clock-cells = <0>; atmel,startup-time-usec = <75>; clock-frequency = <32768>; clock-accuracy = <50000000>; }; clk32k: slck { compatible = "atmel,at91sam9x5-clk-slow"; #clock-cells = <0>; clocks = <&slow_rc_osc &slow_osc>; }; }; rtc@fffffd20 { compatible = "atmel,at91sam9260-rtt"; reg = <0xfffffd20 0x10>; interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; clocks = <&clk32k>; status = "disabled"; }; rtc@fffffdb0 { compatible = "atmel,at91rm9200-rtc"; reg = <0xfffffdb0 0x30>; interrupts = <1 IRQ_TYPE_LEVEL_HIGH 7>; clocks = <&clk32k>; status = "disabled"; }; gpbr: syscon@fffffd60 { compatible = "atmel,at91sam9260-gpbr", "syscon"; reg = <0xfffffd60 0x10>; status = "disabled"; }; }; fb0: fb@0x00500000 { compatible = "atmel,at91sam9g45-lcdc"; reg = <0x00500000 0x1000>; interrupts = <23 IRQ_TYPE_LEVEL_HIGH 3>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_fb>; clocks = <&lcd_clk>, <&lcd_clk>; clock-names = "hclk", "lcdc_clk"; status = "disabled"; }; nand0: nand@40000000 { compatible = "atmel,at91rm9200-nand"; #address-cells = <1>; #size-cells = <1>; reg = <0x40000000 0x10000000 0xffffe200 0x200 >; atmel,nand-addr-offset = <21>; atmel,nand-cmd-offset = <22>; atmel,nand-has-dma; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_nand>; gpios = <&pioC 8 GPIO_ACTIVE_HIGH &pioC 14 GPIO_ACTIVE_HIGH 0 >; status = "disabled"; }; usb0: ohci@00700000 { compatible = "atmel,at91rm9200-ohci", "usb-ohci"; reg = <0x00700000 0x100000>; interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; clocks = <&uhphs_clk>, <&uhphs_clk>, <&uhpck>; clock-names = "ohci_clk", "hclk", "uhpck"; status = "disabled"; }; usb1: ehci@00800000 { compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; reg = <0x00800000 0x100000>; interrupts = <22 IRQ_TYPE_LEVEL_HIGH 2>; clocks = <&utmi>, <&uhphs_clk>; clock-names = "usb_clk", "ehci_clk"; status = "disabled"; }; }; i2c-gpio-0 { compatible = "i2c-gpio"; gpios = <&pioA 20 GPIO_ACTIVE_HIGH /* sda */ &pioA 21 GPIO_ACTIVE_HIGH /* scl */ >; i2c-gpio,sda-open-drain; i2c-gpio,scl-open-drain; i2c-gpio,delay-us = <5>; /* ~100 kHz */ #address-cells = <1>; #size-cells = <0>; status = "disabled"; }; };
{ "pile_set_name": "Github" }
// Mantid Repository : https://github.com/mantidproject/mantid // // Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, // NScD Oak Ridge National Laboratory, European Spallation Source, // Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS // SPDX - License - Identifier: GPL - 3.0 + #include "MantidAPI/ScriptRepository.h" #ifdef _WIN32 #define snprintf _snprintf #endif namespace Mantid { namespace API { ScriptRepoException::ScriptRepoException(int err_, const std::string &info, const std::string &file, int line) { if (err_) _system_error = strerror(err_); else { _system_error = "Unknown"; } if (info.empty()) _user_info = _system_error; else _user_info = info; if (file.empty()) { _file_path = "Not provided"; } else { _file_path = file; if (line > 0) { char aux[10]; snprintf(aux, 10, ":%d", line); _file_path.append(aux); } } } ScriptRepoException::ScriptRepoException(const std::string &info, const std::string &system, const std::string &file, int line) { _system_error = system; _user_info = info; if (file.empty()) { _file_path = "Not provided"; } else { _file_path = file; if (line > 0) { char aux[10]; snprintf(aux, 10, ":%d", line); _file_path.append(aux); } } } const char *ScriptRepoException::what() const noexcept { return _user_info.c_str(); } } // namespace API } // namespace Mantid
{ "pile_set_name": "Github" }
#ifndef __PX_XMODEM_CFG_H__ #define __PX_XMODEM_CFG_H__ /* ============================================================================= ____ ___ ____ ___ _ _ ___ __ __ ___ __ __ TM | _ \ |_ _| / ___| / _ \ | \ | | / _ \ | \/ | |_ _| \ \/ / | |_) | | | | | | | | | | \| | | | | | | |\/| | | | \ / | __/ | | | |___ | |_| | | |\ | | |_| | | | | | | | / \ |_| |___| \____| \___/ |_| \_| \___/ |_| |_| |___| /_/\_\ Copyright (c) 2012 Pieter Conradie <https://piconomix.com> License: MIT https://github.com/piconomix/piconomix-fwlib/blob/master/LICENSE.md Title: px_xmodem_cfg.h : XMODEM Peripheral Driver configuration Author(s): Pieter Conradie Creation Date: 2013-01-15 ============================================================================= */ /* _____STANDARD INCLUDES____________________________________________________ */ /* _____PROJECT INCLUDES_____________________________________________________ */ #include "px_defines.h" #include "px_xmodem_glue.h" /* _____DEFINITIONS__________________________________________________________ */ #define PX_XMODEM_CFG_MAX_RETRIES 4 #define PX_XMODEM_CFG_MAX_RETRIES_START 4 /** * See if a received byte is available and store it in the specified location. * * @param[out] data Pointer to location where data byte must be stored * * @retval true Received byte is stored in specified location * @retval false No received data available (receive buffer empty) */ #define PX_XMODEM_CFG_RD_U8(data) px_xmodem_rd_u8(data) /** * Write one byte. * * This function blocks until space is available in the transmit buffer. * * @param[in] data Byte to be written */ #define PX_XMODEM_CFG_WR_U8(data) px_xmodem_wr_u8(data) /** * Start timeout timer. * * This function starts the XMODEM timeout timer. * * @param[in] time_ms Time in milliseconds to wait before timer has expired */ #define PX_XMODEM_CFG_TMR_START(time_ms) px_xmodem_tmr_start(time_ms) /** * See if timer has expired. * * @retval true Timer has expired * @retval true Timer has not expired */ #define PX_XMODEM_CFG_TMR_HAS_EXPIRED() px_xmodem_tmr_has_expired() /// @} #endif // #ifndef __PX_XMODEM_CFG_H__
{ "pile_set_name": "Github" }
FROM mcr.microsoft.com/azure-functions/node:2.0 ENV AzureWebJobsScriptRoot=/home/site/wwwroot \ AzureFunctionsJobHost__Logging__Console__IsEnabled=true COPY . /home/site/wwwroot RUN cd /home/site/wwwroot && \ npm install
{ "pile_set_name": "Github" }
.springboard { padding: 0; } .springboard div { margin: 2px 4px; line-height: 1.1em; } .springboard div a { padding: 4px 6px; } .springboard div.utility a { font-size: 90%; } .springboard a img, .springboard div.utility a img { width: 60px; height: 60px; } .springboard div.separator { clear: both; float: none; width: 100%; height: 10px; } .forminput { width: 89%; height: 1.2em; border-width: 2px; } .imagebutton { float: right; } #search { font-size: 64.7%; } #searchformcontainer { margin-top: 0px; margin-bottom: 1em; padding-top: 0px; } .homelink { float: left; } /* blackberry browsers do not support max-width */ .crumb1 { width: 120px; } .crumb2a { width: 45px; } .crumb2b { width: 50px; } .crumb3a { width: 40px; } .crumb3b { width: 45px; } .crumb3c { width: 50px; } #tabs { margin: 0 0; } #tabs li a { display: block; text-decoration: none; padding: 7px 11px 9px 11px; min-width: 30px; } #tabs.smalltabs li { font-size: 88.235%; margin-right: 3px; } #tabs.smalltabs li a { padding-right: 8px; padding-left: 8px; } #tabs li.active { margin-top: -2px; } #tabs li.active a { padding-top: 8px; padding-bottom: 10px; } #tabbodies { margin: 0 -12px 0 -12px; } .tabbody { display: block; position: relative; min-height: 230px; } .tabbody h3 { margin-top: 22px; } .tabbody h3:first-child { margin-top: 8px; } .tabbody li:first-child h3 { margin-top: 2px; } .tabstrip , #tabstrip { list-style-type: none; height: 32px; -webkit-border-radius: 10px; margin: 0; padding: 0; left: 0; overflow: hidden; } .tabstrip li , #tabstrip li { float: left; margin: 0; text-align: center; height: 33px; } .tabstrip a , #tabstrip a { display: block; height: 32px; line-height: 32px; text-decoration: none; color: #fff; background: url(/common/images/tabstrip.jpg) repeat-x; border-right: 1px solid #999; border-radius: 1px; } .tabstrip li.active a , #tabstrip li.active a { background-image: url(/common/images/tabstrip-active.jpg); } .tabstrip li:first-child a , #tabstrip li:first-child a { -webkit-border-bottom-left-radius: 10px; -webkit-border-top-left-radius: 10px; } .tabstrip li:last-child a , #tabstrip li:last-child a { -webkit-border-bottom-right-radius: 10px; -webkit-border-top-right-radius: 10px; } .twotabs li { width: 50%; } .threetabs li { width: 33.333%; } .fourtabs li { width: 25%; } .fivetabs li { width: 20%; } .fontsize { clear: both; font-size: 75%; padding: 20px 10px; } .fontsize a, .fontsize span { padding: 0 10px; } .fontsmall { font-size: 5pt; } .fontmedium { font-size: 8pt; } .fontlarge { font-size: 11pt; } .fontxlarge { font-size: 14pt; } .homepage .moduleicon { padding-left: 0; margin-right: 8px; margin-left: -2px; float: left; } /* Login-related buttons */ .loginbuttons li.facebook { background-image: url(/common/images/button-facebook-24.png); } .loginbuttons li.google { background-image: url(/common/images/button-google-24.png); } .loginbuttons li.oauth { background-image: url(/common/images/button-oauth-24.png); } .loginbuttons li.openid { background-image: url(/common/images/button-openid-24.png); } .loginbuttons li.twitter { background-image: url(/common/images/button-twitter-24.png); } .loginbuttons li.windows { background-image: url(/common/images/button-windows-24.png); } #shareback { /* for now hide this because height 100% doesn't work right on BB */ display: none; } #sharedialog { border: solid 1px #333; }
{ "pile_set_name": "Github" }
// Copyright Aleksey Gurtovoy 2000-2004 // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // Preprocessed version of "boost/mpl/less_equal.hpp" header // -- DO NOT modify by hand! namespace network_boost { namespace mpl { template< typename Tag1 , typename Tag2 , BOOST_MPL_AUX_NTTP_DECL(int, tag1_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag1)::value , BOOST_MPL_AUX_NTTP_DECL(int, tag2_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag2)::value > struct less_equal_impl : if_c< ( tag1_ > tag2_ ) , aux::cast2nd_impl< less_equal_impl< Tag1,Tag1 >,Tag1, Tag2 > , aux::cast1st_impl< less_equal_impl< Tag2,Tag2 >,Tag1, Tag2 > >::type { }; /// for Digital Mars C++/compilers with no CTPS/TTP support template<> struct less_equal_impl< na,na > { template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); }; }; template<> struct less_equal_impl< na,integral_c_tag > { template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); }; }; template<> struct less_equal_impl< integral_c_tag,na > { template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); }; }; template< typename T > struct less_equal_tag { typedef typename T::tag type; }; template< typename BOOST_MPL_AUX_NA_PARAM(N1) , typename BOOST_MPL_AUX_NA_PARAM(N2) > struct less_equal : aux::msvc_eti_base< typename apply_wrap2< less_equal_impl< typename less_equal_tag<N1>::type , typename less_equal_tag<N2>::type > , N1 , N2 >::type >::type { BOOST_MPL_AUX_LAMBDA_SUPPORT(2, less_equal, (N1, N2)) }; BOOST_MPL_AUX_NA_SPEC2(2, 2, less_equal) }} namespace network_boost { namespace mpl { template<> struct less_equal_impl< integral_c_tag,integral_c_tag > { template< typename N1, typename N2 > struct apply { BOOST_STATIC_CONSTANT(bool, value = ( BOOST_MPL_AUX_VALUE_WKND(N1)::value <= BOOST_MPL_AUX_VALUE_WKND(N2)::value ) ); typedef bool_<value> type; }; }; }}
{ "pile_set_name": "Github" }
// Copyright 2008 The Closure Library Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS-IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. /** * @fileoverview A singleton object for managing Javascript code modules. * */ goog.provide('goog.module.ModuleManager'); goog.provide('goog.module.ModuleManager.CallbackType'); goog.provide('goog.module.ModuleManager.FailureType'); goog.require('goog.Disposable'); goog.require('goog.array'); goog.require('goog.asserts'); goog.require('goog.async.Deferred'); goog.require('goog.debug.Trace'); /** @suppress {extraRequire} */ goog.require('goog.dispose'); goog.require('goog.log'); goog.require('goog.module.ModuleInfo'); goog.require('goog.module.ModuleLoadCallback'); goog.require('goog.object'); /** * The ModuleManager keeps track of all modules in the environment. * Since modules may not have their code loaded, we must keep track of them. * @constructor * @extends {goog.Disposable} */ goog.module.ModuleManager = function() { goog.Disposable.call(this); /** * A mapping from module id to ModuleInfo object. * @type {Object} * @private */ this.moduleInfoMap_ = {}; // TODO (malteubl): Switch this to a reentrant design. /** * The ids of the currently loading modules. If batch mode is disabled, then * this array will never contain more than one element at a time. * @type {Array.<string>} * @private */ this.loadingModuleIds_ = []; /** * The requested ids of the currently loading modules. This does not include * module dependencies that may also be loading. * @type {Array.<string>} * @private */ this.requestedLoadingModuleIds_ = []; // TODO(user): Make these and other arrays that are used as sets be // actual sets. /** * All module ids that have ever been requested. In concurrent loading these * are the ones to subtract from future requests. * @type {!Array.<string>} * @private */ this.requestedModuleIds_ = []; /** * A queue of the ids of requested but not-yet-loaded modules. The zero * position is the front of the queue. This is a 2-D array to group modules * together with other modules that should be batch loaded with them, if * batch loading is enabled. * @type {Array.<Array.<string>>} * @private */ this.requestedModuleIdsQueue_ = []; /** * The ids of the currently loading modules which have been initiated by user * actions. * @type {Array.<string>} * @private */ this.userInitiatedLoadingModuleIds_ = []; /** * A map of callback types to the functions to call for the specified * callback type. * @type {Object} * @private */ this.callbackMap_ = {}; /** * Module info for the base module (the one that contains the module * manager code), which we set as the loading module so one can * register initialization callbacks in the base module. * * The base module is considered loaded when #setAllModuleInfo is called or * #setModuleContext is called, whichever comes first. * * @type {goog.module.ModuleInfo} * @private */ this.baseModuleInfo_ = new goog.module.ModuleInfo([], ''); /** * The module that is currently loading, or null if not loading anything. * @type {goog.module.ModuleInfo} * @private */ this.currentlyLoadingModule_ = this.baseModuleInfo_; /** * The id of the last requested initial module. When it loaded * the deferred in {@code this.initialModulesLoaded_} resolves. * @private {?string} */ this.lastInitialModuleId_ = null; /** * Deferred for when all initial modules have loaded. We currently block * sending additional module requests until this deferred resolves. In a * future optimization it may be possible to use the initial modules as * seeds for the module loader "requested module ids" and start making new * requests even sooner. * @private {!goog.async.Deferred} */ this.initialModulesLoaded_ = new goog.async.Deferred(); }; goog.inherits(goog.module.ModuleManager, goog.Disposable); goog.addSingletonGetter(goog.module.ModuleManager); /** * The type of callbacks that can be registered with the module manager,. * @enum {string} */ goog.module.ModuleManager.CallbackType = { /** * Fired when an error has occurred. */ ERROR: 'error', /** * Fired when it becomes idle and has no more module loads to process. */ IDLE: 'idle', /** * Fired when it becomes active and has module loads to process. */ ACTIVE: 'active', /** * Fired when it becomes idle and has no more user-initiated module loads to * process. */ USER_IDLE: 'userIdle', /** * Fired when it becomes active and has user-initiated module loads to * process. */ USER_ACTIVE: 'userActive' }; /** * A non-HTTP status code indicating a corruption in loaded module. * This should be used by a ModuleLoader as a replacement for the HTTP code * given to the error handler function to indicated that the module was * corrupted. * This will set the forceReload flag on the loadModules method when retrying * module loading. * @type {number} */ goog.module.ModuleManager.CORRUPT_RESPONSE_STATUS_CODE = 8001; /** * A logger. * @type {goog.log.Logger} * @private */ goog.module.ModuleManager.prototype.logger_ = goog.log.getLogger( 'goog.module.ModuleManager'); /** * Whether the batch mode (i.e. the loading of multiple modules with just one * request) has been enabled. * @type {boolean} * @private */ goog.module.ModuleManager.prototype.batchModeEnabled_ = false; /** * Whether the module requests may be sent out of order. * @type {boolean} * @private */ goog.module.ModuleManager.prototype.concurrentLoadingEnabled_ = false; /** * A loader for the modules that implements loadModules(ids, moduleInfoMap, * opt_successFn, opt_errorFn, opt_timeoutFn, opt_forceReload) method. * @type {goog.module.AbstractModuleLoader} * @private */ goog.module.ModuleManager.prototype.loader_ = null; // TODO(user): Remove tracer. /** * Tracer that measures how long it takes to load a module. * @type {?number} * @private */ goog.module.ModuleManager.prototype.loadTracer_ = null; /** * The number of consecutive failures that have happened upon module load * requests. * @type {number} * @private */ goog.module.ModuleManager.prototype.consecutiveFailures_ = 0; /** * Determines if the module manager was just active before the processing of * the last data. * @type {boolean} * @private */ goog.module.ModuleManager.prototype.lastActive_ = false; /** * Determines if the module manager was just user active before the processing * of the last data. The module manager is user active if any of the * user-initiated modules are loading or queued up to load. * @type {boolean} * @private */ goog.module.ModuleManager.prototype.userLastActive_ = false; /** * The module context needed for module initialization. * @type {Object} * @private */ goog.module.ModuleManager.prototype.moduleContext_ = null; /** * Sets the batch mode as enabled or disabled for the module manager. * @param {boolean} enabled Whether the batch mode is to be enabled or not. */ goog.module.ModuleManager.prototype.setBatchModeEnabled = function( enabled) { this.batchModeEnabled_ = enabled; }; /** * Sets the concurrent loading mode as enabled or disabled for the module * manager. Requires a moduleloader implementation that supports concurrent * loads. The default {@see goog.module.ModuleLoader} does not. * @param {boolean} enabled */ goog.module.ModuleManager.prototype.setConcurrentLoadingEnabled = function( enabled) { this.concurrentLoadingEnabled_ = enabled; }; /** * Sets the module info for all modules. Should only be called once. * * @param {Object.<Array.<string>>} infoMap An object that contains a mapping * from module id (String) to list of required module ids (Array). */ goog.module.ModuleManager.prototype.setAllModuleInfo = function(infoMap) { for (var id in infoMap) { this.moduleInfoMap_[id] = new goog.module.ModuleInfo(infoMap[id], id); } if (!this.initialModulesLoaded_.hasFired()) { this.initialModulesLoaded_.callback(); } this.maybeFinishBaseLoad_(); }; /** * Sets the module info for all modules. Should only be called once. Also * marks modules that are currently being loaded. * * @param {string=} opt_info A string representation of the module dependency * graph, in the form: module1:dep1,dep2/module2:dep1,dep2 etc. * Where depX is the base-36 encoded position of the dep in the module list. * @param {Array.<string>=} opt_loadingModuleIds A list of moduleIds that * are currently being loaded. */ goog.module.ModuleManager.prototype.setAllModuleInfoString = function( opt_info, opt_loadingModuleIds) { if (!goog.isString(opt_info)) { // The call to this method is generated in two steps, the argument is added // after some of the compilation passes. This means that the initial code // doesn't have any arguments and causes compiler errors. We make it // optional to satisfy this constraint. return; } var modules = opt_info.split('/'); var moduleIds = []; // Split the string into the infoMap of id->deps for (var i = 0; i < modules.length; i++) { var parts = modules[i].split(':'); var id = parts[0]; var deps; if (parts[1]) { deps = parts[1].split(','); for (var j = 0; j < deps.length; j++) { var index = parseInt(deps[j], 36); goog.asserts.assert( moduleIds[index], 'No module @ %s, dep of %s @ %s', index, id, i); deps[j] = moduleIds[index]; } } else { deps = []; } moduleIds.push(id); this.moduleInfoMap_[id] = new goog.module.ModuleInfo(deps, id); } if (opt_loadingModuleIds && opt_loadingModuleIds.length) { goog.array.extend(this.loadingModuleIds_, opt_loadingModuleIds); // The last module in the list of initial modules. When it has loaded all // initial modules have loaded. this.lastInitialModuleId_ = /** @type {?string} */ ( goog.array.peek(opt_loadingModuleIds)); } else { if (!this.initialModulesLoaded_.hasFired()) { this.initialModulesLoaded_.callback(); } } this.maybeFinishBaseLoad_(); }; /** * Gets a module info object by id. * @param {string} id A module identifier. * @return {goog.module.ModuleInfo} The module info. */ goog.module.ModuleManager.prototype.getModuleInfo = function(id) { return this.moduleInfoMap_[id]; }; /** * Sets the module uris. * * @param {Object} moduleUriMap The map of id/uris pairs for each module. */ goog.module.ModuleManager.prototype.setModuleUris = function(moduleUriMap) { for (var id in moduleUriMap) { this.moduleInfoMap_[id].setUris(moduleUriMap[id]); } }; /** * Gets the application-specific module loader. * @return {goog.module.AbstractModuleLoader} An object that has a * loadModules(ids, moduleInfoMap, opt_successFn, opt_errFn, * opt_timeoutFn, opt_forceReload) method. */ goog.module.ModuleManager.prototype.getLoader = function() { return this.loader_; }; /** * Sets the application-specific module loader. * @param {goog.module.AbstractModuleLoader} loader An object that has a * loadModules(ids, moduleInfoMap, opt_successFn, opt_errFn, * opt_timeoutFn, opt_forceReload) method. */ goog.module.ModuleManager.prototype.setLoader = function(loader) { this.loader_ = loader; }; /** * Gets the module context to use to initialize the module. * @return {Object} The context. */ goog.module.ModuleManager.prototype.getModuleContext = function() { return this.moduleContext_; }; /** * Sets the module context to use to initialize the module. * @param {Object} context The context. */ goog.module.ModuleManager.prototype.setModuleContext = function(context) { this.moduleContext_ = context; this.maybeFinishBaseLoad_(); }; /** * Determines if the ModuleManager is active * @return {boolean} TRUE iff the ModuleManager is active (i.e., not idle). */ goog.module.ModuleManager.prototype.isActive = function() { return this.loadingModuleIds_.length > 0; }; /** * Determines if the ModuleManager is user active * @return {boolean} TRUE iff the ModuleManager is user active (i.e., not idle). */ goog.module.ModuleManager.prototype.isUserActive = function() { return this.userInitiatedLoadingModuleIds_.length > 0; }; /** * Dispatches an ACTIVE or IDLE event if necessary. * @private */ goog.module.ModuleManager.prototype.dispatchActiveIdleChangeIfNeeded_ = function() { var lastActive = this.lastActive_; var active = this.isActive(); if (active != lastActive) { this.executeCallbacks_(active ? goog.module.ModuleManager.CallbackType.ACTIVE : goog.module.ModuleManager.CallbackType.IDLE); // Flip the last active value. this.lastActive_ = active; } // Check if the module manager is user active i.e., there are user initiated // modules being loaded or queued up to be loaded. var userLastActive = this.userLastActive_; var userActive = this.isUserActive(); if (userActive != userLastActive) { this.executeCallbacks_(userActive ? goog.module.ModuleManager.CallbackType.USER_ACTIVE : goog.module.ModuleManager.CallbackType.USER_IDLE); // Flip the last user active value. this.userLastActive_ = userActive; } }; /** * Preloads a module after a short delay. * * @param {string} id The id of the module to preload. * @param {number=} opt_timeout The number of ms to wait before adding the * module id to the loading queue (defaults to 0 ms). Note that the module * will be loaded asynchronously regardless of the value of this parameter. * @return {goog.async.Deferred} A deferred object. */ goog.module.ModuleManager.prototype.preloadModule = function( id, opt_timeout) { var d = new goog.async.Deferred(); window.setTimeout( goog.bind(this.addLoadModule_, this, id, d), opt_timeout || 0); return d; }; /** * Prefetches a JavaScript module and its dependencies, which means that the * module will be downloaded, but not evaluated. To complete the module load, * the caller should also call load or execOnLoad after prefetching the module. * * @param {string} id The id of the module to prefetch. */ goog.module.ModuleManager.prototype.prefetchModule = function(id) { var moduleInfo = this.getModuleInfo(id); if (moduleInfo.isLoaded() || this.isModuleLoading(id)) { throw Error('Module load already requested: ' + id); } else if (this.batchModeEnabled_) { throw Error('Modules prefetching is not supported in batch mode'); } else { var idWithDeps = this.getNotYetLoadedTransitiveDepIds_(id); for (var i = 0; i < idWithDeps.length; i++) { this.loader_.prefetchModule(idWithDeps[i], this.moduleInfoMap_[idWithDeps[i]]); } } }; /** * Loads a single module for use with a given deferred. * * @param {string} id The id of the module to load. * @param {goog.async.Deferred} d A deferred object. * @private */ goog.module.ModuleManager.prototype.addLoadModule_ = function(id, d) { var moduleInfo = this.getModuleInfo(id); if (moduleInfo.isLoaded()) { d.callback(this.moduleContext_); return; } this.registerModuleLoadCallbacks_(id, moduleInfo, false, d); if (!this.isModuleLoading(id)) { this.loadModulesOrEnqueue_([id]); } }; /** * Loads a list of modules or, if some other module is currently being loaded, * appends the ids to the queue of requested module ids. Registers callbacks a * module that is currently loading and returns a fired deferred for a module * that is already loaded. * * @param {Array.<string>} ids The id of the module to load. * @param {boolean=} opt_userInitiated If the load is a result of a user action. * @return {Object.<!goog.async.Deferred>} A mapping from id (String) to * deferred objects that will callback or errback when the load for that * id is finished. * @private */ goog.module.ModuleManager.prototype.loadModulesOrEnqueueIfNotLoadedOrLoading_ = function(ids, opt_userInitiated) { var uniqueIds = []; goog.array.removeDuplicates(ids, uniqueIds); var idsToLoad = []; var deferredMap = {}; for (var i = 0; i < uniqueIds.length; i++) { var id = uniqueIds[i]; var moduleInfo = this.getModuleInfo(id); goog.asserts.assertObject(moduleInfo, 'Unknown module: ' + id); var d = new goog.async.Deferred(); deferredMap[id] = d; if (moduleInfo.isLoaded()) { d.callback(this.moduleContext_); } else { this.registerModuleLoadCallbacks_(id, moduleInfo, !!opt_userInitiated, d); if (!this.isModuleLoading(id)) { idsToLoad.push(id); } } } // If there are ids to load, load them, otherwise, they are all loading or // loaded. if (idsToLoad.length > 0) { this.loadModulesOrEnqueue_(idsToLoad); } return deferredMap; }; /** * Registers the callbacks and handles logic if it is a user initiated module * load. * * @param {string} id The id of the module to possibly load. * @param {!goog.module.ModuleInfo} moduleInfo The module identifier for the * given id. * @param {boolean} userInitiated If the load was user initiated. * @param {goog.async.Deferred} d A deferred object. * @private */ goog.module.ModuleManager.prototype.registerModuleLoadCallbacks_ = function(id, moduleInfo, userInitiated, d) { moduleInfo.registerCallback(d.callback, d); moduleInfo.registerErrback(function(err) { d.errback(Error(err)); }); // If it's already loading, we don't have to do anything besides handle // if it was user initiated if (this.isModuleLoading(id)) { if (userInitiated) { goog.log.info(this.logger_, 'User initiated module already loading: ' + id); this.addUserInitiatedLoadingModule_(id); this.dispatchActiveIdleChangeIfNeeded_(); } } else { if (userInitiated) { goog.log.info(this.logger_, 'User initiated module load: ' + id); this.addUserInitiatedLoadingModule_(id); } else { goog.log.info(this.logger_, 'Initiating module load: ' + id); } } }; /** * Initiates loading of a list of modules or, if a module is currently being * loaded, appends the modules to the queue of requested module ids. * * The caller should verify that the requested modules are not already loaded or * loading. {@link #loadModulesOrEnqueueIfNotLoadedOrLoading_} is a more lenient * alternative to this method. * * @param {Array.<string>} ids The ids of the modules to load. * @private */ goog.module.ModuleManager.prototype.loadModulesOrEnqueue_ = function(ids) { // With concurrent loading we always just send off the request. if (this.concurrentLoadingEnabled_) { // For now we wait for initial modules to have downloaded as this puts the // loader in a good state for calculating the needed deps of additional // loads. // TODO(user): Make this wait unnecessary. this.initialModulesLoaded_.addCallback( goog.bind(this.loadModules_, this, ids)); } else { if (goog.array.isEmpty(this.loadingModuleIds_)) { this.loadModules_(ids); } else { this.requestedModuleIdsQueue_.push(ids); this.dispatchActiveIdleChangeIfNeeded_(); } } }; /** * Gets the amount of delay to wait before sending a request for more modules. * If a certain module request fails, we backoff a little bit and try again. * @return {number} Delay, in ms. * @private */ goog.module.ModuleManager.prototype.getBackOff_ = function() { // 5 seconds after one error, 20 seconds after 2. return Math.pow(this.consecutiveFailures_, 2) * 5000; }; /** * Loads a list of modules and any of their not-yet-loaded prerequisites. * If batch mode is enabled, the prerequisites will be loaded together with the * requested modules and all requested modules will be loaded at the same time. * * The caller should verify that the requested modules are not already loaded * and that no modules are currently loading before calling this method. * * @param {Array.<string>} ids The ids of the modules to load. * @param {boolean=} opt_isRetry If the load is a retry of a previous load * attempt. * @param {boolean=} opt_forceReload Whether to bypass cache while loading the * module. * @private */ goog.module.ModuleManager.prototype.loadModules_ = function( ids, opt_isRetry, opt_forceReload) { if (!opt_isRetry) { this.consecutiveFailures_ = 0; } // Not all modules may be loaded immediately if batch mode is not enabled. var idsToLoadImmediately = this.processModulesForLoad_(ids); goog.log.info(this.logger_, 'Loading module(s): ' + idsToLoadImmediately); this.loadingModuleIds_ = idsToLoadImmediately; if (this.batchModeEnabled_) { this.requestedLoadingModuleIds_ = ids; } else { // If batch mode is disabled, we treat each dependency load as a separate // load. this.requestedLoadingModuleIds_ = goog.array.clone(idsToLoadImmediately); } // Dispatch an active/idle change if needed. this.dispatchActiveIdleChangeIfNeeded_(); if (goog.array.isEmpty(idsToLoadImmediately)) { // All requested modules and deps have been either loaded already or have // already been requested. return; } this.requestedModuleIds_.push.apply(this.requestedModuleIds_, idsToLoadImmediately); var loadFn = goog.bind(this.loader_.loadModules, this.loader_, goog.array.clone(idsToLoadImmediately), this.moduleInfoMap_, null, goog.bind(this.handleLoadError_, this, this.requestedLoadingModuleIds_, idsToLoadImmediately), goog.bind(this.handleLoadTimeout_, this), !!opt_forceReload); var delay = this.getBackOff_(); if (delay) { window.setTimeout(loadFn, delay); } else { loadFn(); } }; /** * Processes a list of module ids for loading. Checks if any of the modules are * already loaded and then gets transitive deps. Queues any necessary modules * if batch mode is not enabled. Returns the list of ids that should be loaded. * * @param {Array.<string>} ids The ids that need to be loaded. * @return {Array.<string>} The ids to load, including dependencies. * @throws {Error} If the module is already loaded. * @private */ goog.module.ModuleManager.prototype.processModulesForLoad_ = function(ids) { for (var i = 0; i < ids.length; i++) { var moduleInfo = this.moduleInfoMap_[ids[i]]; if (moduleInfo.isLoaded()) { throw Error('Module already loaded: ' + ids[i]); } } // Build a list of the ids of this module and any of its not-yet-loaded // prerequisite modules in dependency order. var idsWithDeps = []; for (var i = 0; i < ids.length; i++) { idsWithDeps = idsWithDeps.concat( this.getNotYetLoadedTransitiveDepIds_(ids[i])); } goog.array.removeDuplicates(idsWithDeps); if (!this.batchModeEnabled_ && idsWithDeps.length > 1) { var idToLoad = idsWithDeps.shift(); goog.log.info(this.logger_, 'Must load ' + idToLoad + ' module before ' + ids); // Insert the requested module id and any other not-yet-loaded prereqs // that it has at the front of the queue. var queuedModules = goog.array.map(idsWithDeps, function(id) { return [id]; }); this.requestedModuleIdsQueue_ = queuedModules.concat( this.requestedModuleIdsQueue_); return [idToLoad]; } else { return idsWithDeps; } }; /** * Builds a list of the ids of the not-yet-loaded modules that a particular * module transitively depends on, including itself. * * @param {string} id The id of a not-yet-loaded module. * @return {Array.<string>} An array of module ids in dependency order that's * guaranteed to end with the provided module id. * @private */ goog.module.ModuleManager.prototype.getNotYetLoadedTransitiveDepIds_ = function(id) { // NOTE(user): We want the earliest occurrance of a module, not the first // dependency we find. Therefore we strip duplicates at the end rather than // during. See the tests for concrete examples. var ids = []; if (!goog.array.contains(this.requestedModuleIds_, id)) { ids.push(id); } var depIds = goog.array.clone(this.getModuleInfo(id).getDependencies()); while (depIds.length) { var depId = depIds.pop(); if (!this.getModuleInfo(depId).isLoaded() && !goog.array.contains(this.requestedModuleIds_, depId)) { ids.unshift(depId); // We need to process direct dependencies first. Array.prototype.unshift.apply(depIds, this.getModuleInfo(depId).getDependencies()); } } goog.array.removeDuplicates(ids); return ids; }; /** * If we are still loading the base module, consider the load complete. * @private */ goog.module.ModuleManager.prototype.maybeFinishBaseLoad_ = function() { if (this.currentlyLoadingModule_ == this.baseModuleInfo_) { this.currentlyLoadingModule_ = null; var error = this.baseModuleInfo_.onLoad( goog.bind(this.getModuleContext, this)); if (error) { this.dispatchModuleLoadFailed_( goog.module.ModuleManager.FailureType.INIT_ERROR); } this.dispatchActiveIdleChangeIfNeeded_(); } }; /** * Records that a module was loaded. Also initiates loading the next module if * any module requests are queued. This method is called by code that is * generated and appended to each dynamic module's code at compilation time. * * @param {string} id A module id. */ goog.module.ModuleManager.prototype.setLoaded = function(id) { if (this.isDisposed()) { goog.log.warning(this.logger_, 'Module loaded after module manager was disposed: ' + id); return; } goog.log.info(this.logger_, 'Module loaded: ' + id); var error = this.moduleInfoMap_[id].onLoad( goog.bind(this.getModuleContext, this)); if (error) { this.dispatchModuleLoadFailed_( goog.module.ModuleManager.FailureType.INIT_ERROR); } // Remove the module id from the user initiated set if it existed there. goog.array.remove(this.userInitiatedLoadingModuleIds_, id); // Remove the module id from the loading modules if it exists there. goog.array.remove(this.loadingModuleIds_, id); if (goog.array.isEmpty(this.loadingModuleIds_)) { // No more modules are currently being loaded (e.g. arriving later in the // same HTTP response), so proceed to load the next module in the queue. this.loadNextModules_(); } if (this.lastInitialModuleId_ && id == this.lastInitialModuleId_) { if (!this.initialModulesLoaded_.hasFired()) { this.initialModulesLoaded_.callback(); } } // Dispatch an active/idle change if needed. this.dispatchActiveIdleChangeIfNeeded_(); }; /** * Gets whether a module is currently loading or in the queue, waiting to be * loaded. * @param {string} id A module id. * @return {boolean} TRUE iff the module is loading. */ goog.module.ModuleManager.prototype.isModuleLoading = function(id) { if (goog.array.contains(this.loadingModuleIds_, id)) { return true; } for (var i = 0; i < this.requestedModuleIdsQueue_.length; i++) { if (goog.array.contains(this.requestedModuleIdsQueue_[i], id)) { return true; } } return false; }; /** * Requests that a function be called once a particular module is loaded. * Client code can use this method to safely call into modules that may not yet * be loaded. For consistency, this method always calls the function * asynchronously -- even if the module is already loaded. Initiates loading of * the module if necessary, unless opt_noLoad is true. * * @param {string} moduleId A module id. * @param {Function} fn Function to execute when the module has loaded. * @param {Object=} opt_handler Optional handler under whose scope to execute * the callback. * @param {boolean=} opt_noLoad TRUE iff not to initiate loading of the module. * @param {boolean=} opt_userInitiated TRUE iff the loading of the module was * user initiated. * @param {boolean=} opt_preferSynchronous TRUE iff the function should be * executed synchronously if the module has already been loaded. * @return {goog.module.ModuleLoadCallback} A callback wrapper that exposes * an abort and execute method. */ goog.module.ModuleManager.prototype.execOnLoad = function( moduleId, fn, opt_handler, opt_noLoad, opt_userInitiated, opt_preferSynchronous) { var moduleInfo = this.moduleInfoMap_[moduleId]; var callbackWrapper; if (moduleInfo.isLoaded()) { goog.log.info(this.logger_, moduleId + ' module already loaded'); // Call async so that code paths don't change between loaded and unloaded // cases. callbackWrapper = new goog.module.ModuleLoadCallback(fn, opt_handler); if (opt_preferSynchronous) { callbackWrapper.execute(this.moduleContext_); } else { window.setTimeout( goog.bind(callbackWrapper.execute, callbackWrapper), 0); } } else if (this.isModuleLoading(moduleId)) { goog.log.info(this.logger_, moduleId + ' module already loading'); callbackWrapper = moduleInfo.registerCallback(fn, opt_handler); if (opt_userInitiated) { goog.log.info(this.logger_, 'User initiated module already loading: ' + moduleId); this.addUserInitiatedLoadingModule_(moduleId); this.dispatchActiveIdleChangeIfNeeded_(); } } else { goog.log.info(this.logger_, 'Registering callback for module: ' + moduleId); callbackWrapper = moduleInfo.registerCallback(fn, opt_handler); if (!opt_noLoad) { if (opt_userInitiated) { goog.log.info(this.logger_, 'User initiated module load: ' + moduleId); this.addUserInitiatedLoadingModule_(moduleId); } goog.log.info(this.logger_, 'Initiating module load: ' + moduleId); this.loadModulesOrEnqueue_([moduleId]); } } return callbackWrapper; }; /** * Loads a module, returning a goog.async.Deferred for keeping track of the * result. * * @param {string} moduleId A module id. * @param {boolean=} opt_userInitiated If the load is a result of a user action. * @return {goog.async.Deferred} A deferred object. */ goog.module.ModuleManager.prototype.load = function( moduleId, opt_userInitiated) { return this.loadModulesOrEnqueueIfNotLoadedOrLoading_( [moduleId], opt_userInitiated)[moduleId]; }; /** * Loads a list of modules, returning a goog.async.Deferred for keeping track of * the result. * * @param {Array.<string>} moduleIds A list of module ids. * @param {boolean=} opt_userInitiated If the load is a result of a user action. * @return {Object.<!goog.async.Deferred>} A mapping from id (String) to * deferred objects that will callback or errback when the load for that * id is finished. */ goog.module.ModuleManager.prototype.loadMultiple = function( moduleIds, opt_userInitiated) { return this.loadModulesOrEnqueueIfNotLoadedOrLoading_( moduleIds, opt_userInitiated); }; /** * Ensures that the module with the given id is listed as a user-initiated * module that is being loaded. This method guarantees that a module will never * get listed more than once. * @param {string} id Identifier of the module. * @private */ goog.module.ModuleManager.prototype.addUserInitiatedLoadingModule_ = function( id) { if (!goog.array.contains(this.userInitiatedLoadingModuleIds_, id)) { this.userInitiatedLoadingModuleIds_.push(id); } }; /** * Method called just before a module code is loaded. * @param {string} id Identifier of the module. */ goog.module.ModuleManager.prototype.beforeLoadModuleCode = function(id) { this.loadTracer_ = goog.debug.Trace.startTracer('Module Load: ' + id, 'Module Load'); if (this.currentlyLoadingModule_) { goog.log.error(this.logger_, 'beforeLoadModuleCode called with module "' + id + '" while module "' + this.currentlyLoadingModule_.getId() + '" is loading'); } this.currentlyLoadingModule_ = this.getModuleInfo(id); }; /** * Method called just after module code is loaded * @param {string} id Identifier of the module. */ goog.module.ModuleManager.prototype.afterLoadModuleCode = function(id) { if (!this.currentlyLoadingModule_ || id != this.currentlyLoadingModule_.getId()) { goog.log.error(this.logger_, 'afterLoadModuleCode called with module "' + id + '" while loading module "' + (this.currentlyLoadingModule_ && this.currentlyLoadingModule_.getId()) + '"'); } this.currentlyLoadingModule_ = null; goog.debug.Trace.stopTracer(this.loadTracer_); }; /** * Register an initialization callback for the currently loading module. This * should only be called by script that is executed during the evaluation of * a module's javascript. This is almost equivalent to calling the function * inline, but ensures that all the code from the currently loading module * has been loaded. This makes it cleaner and more robust than calling the * function inline. * * If this function is called from the base module (the one that contains * the module manager code), the callback is held until #setAllModuleInfo * is called, or until #setModuleContext is called, whichever happens first. * * @param {Function} fn A callback function that takes a single argument * which is the module context. * @param {Object=} opt_handler Optional handler under whose scope to execute * the callback. */ goog.module.ModuleManager.prototype.registerInitializationCallback = function( fn, opt_handler) { if (!this.currentlyLoadingModule_) { goog.log.error(this.logger_, 'No module is currently loading'); } else { this.currentlyLoadingModule_.registerEarlyCallback(fn, opt_handler); } }; /** * Register a late initialization callback for the currently loading module. * Callbacks registered via this function are executed similar to * {@see registerInitializationCallback}, but they are fired after all * initialization callbacks are called. * * @param {Function} fn A callback function that takes a single argument * which is the module context. * @param {Object=} opt_handler Optional handler under whose scope to execute * the callback. */ goog.module.ModuleManager.prototype.registerLateInitializationCallback = function(fn, opt_handler) { if (!this.currentlyLoadingModule_) { goog.log.error(this.logger_, 'No module is currently loading'); } else { this.currentlyLoadingModule_.registerCallback(fn, opt_handler); } }; /** * Sets the constructor to use for the module object for the currently * loading module. The constructor should derive from {@see * goog.module.BaseModule}. * @param {Function} fn The constructor function. */ goog.module.ModuleManager.prototype.setModuleConstructor = function(fn) { if (!this.currentlyLoadingModule_) { goog.log.error(this.logger_, 'No module is currently loading'); return; } this.currentlyLoadingModule_.setModuleConstructor(fn); }; /** * The possible reasons for a module load failure callback being fired. * @enum {number} */ goog.module.ModuleManager.FailureType = { /** 401 Status. */ UNAUTHORIZED: 0, /** Error status (not 401) returned multiple times. */ CONSECUTIVE_FAILURES: 1, /** Request timeout. */ TIMEOUT: 2, /** 410 status, old code gone. */ OLD_CODE_GONE: 3, /** The onLoad callbacks failed. */ INIT_ERROR: 4 }; /** * Handles a module load failure. * * @param {!Array.<string>} requestedLoadingModuleIds Modules ids that were * requested in failed request. Does not included calculated dependencies. * @param {!Array.<string>} requestedModuleIdsWithDeps All module ids requested * in the failed request including all dependencies. * @param {?number} status The error status. * @private */ goog.module.ModuleManager.prototype.handleLoadError_ = function( requestedLoadingModuleIds, requestedModuleIdsWithDeps, status) { this.consecutiveFailures_++; // Module manager was not designed to be reentrant. Reinstate the instance // var with actual value when request failed (Other requests may have // started already.) this.requestedLoadingModuleIds_ = requestedLoadingModuleIds; // Pretend we never requested the failed modules. goog.array.forEach(requestedModuleIdsWithDeps, goog.partial(goog.array.remove, this.requestedModuleIds_), this); if (status == 401) { // The user is not logged in. They've cleared their cookies or logged out // from another window. goog.log.info(this.logger_, 'Module loading unauthorized'); this.dispatchModuleLoadFailed_( goog.module.ModuleManager.FailureType.UNAUTHORIZED); // Drop any additional module requests. this.requestedModuleIdsQueue_.length = 0; } else if (status == 410) { // The requested module js is old and not available. this.requeueBatchOrDispatchFailure_( goog.module.ModuleManager.FailureType.OLD_CODE_GONE); this.loadNextModules_(); } else if (this.consecutiveFailures_ >= 3) { goog.log.info(this.logger_, 'Aborting after failure to load: ' + this.loadingModuleIds_); this.requeueBatchOrDispatchFailure_( goog.module.ModuleManager.FailureType.CONSECUTIVE_FAILURES); this.loadNextModules_(); } else { goog.log.info(this.logger_, 'Retrying after failure to load: ' + this.loadingModuleIds_); var forceReload = status == goog.module.ModuleManager.CORRUPT_RESPONSE_STATUS_CODE; this.loadModules_(this.requestedLoadingModuleIds_, true, forceReload); } }; /** * Handles a module load timeout. * @private */ goog.module.ModuleManager.prototype.handleLoadTimeout_ = function() { goog.log.info(this.logger_, 'Aborting after timeout: ' + this.loadingModuleIds_); this.requeueBatchOrDispatchFailure_( goog.module.ModuleManager.FailureType.TIMEOUT); this.loadNextModules_(); }; /** * Requeues batch loads that had more than one requested module * (i.e. modules that were not included as dependencies) as separate loads or * if there was only one requested module, fails that module with the received * cause. * @param {goog.module.ModuleManager.FailureType} cause The reason for the * failure. * @private */ goog.module.ModuleManager.prototype.requeueBatchOrDispatchFailure_ = function(cause) { // The load failed, so if there are more than one requested modules, then we // need to retry each one as a separate load. Otherwise, if there is only one // requested module, remove it and its dependencies from the queue. if (this.requestedLoadingModuleIds_.length > 1) { var queuedModules = goog.array.map(this.requestedLoadingModuleIds_, function(id) { return [id]; }); this.requestedModuleIdsQueue_ = queuedModules.concat( this.requestedModuleIdsQueue_); } else { this.dispatchModuleLoadFailed_(cause); } }; /** * Handles when a module load failed. * @param {goog.module.ModuleManager.FailureType} cause The reason for the * failure. * @private */ goog.module.ModuleManager.prototype.dispatchModuleLoadFailed_ = function( cause) { var failedIds = this.requestedLoadingModuleIds_; this.loadingModuleIds_.length = 0; // If any pending modules depend on the id that failed, // they need to be removed from the queue. var idsToCancel = []; for (var i = 0; i < this.requestedModuleIdsQueue_.length; i++) { var dependentModules = goog.array.filter( this.requestedModuleIdsQueue_[i], /** * Returns true if the requestedId has dependencies on the modules that * just failed to load. * @param {string} requestedId The module to check for dependencies. * @return {boolean} True if the module depends on failed modules. */ function(requestedId) { var requestedDeps = this.getNotYetLoadedTransitiveDepIds_( requestedId); return goog.array.some(failedIds, function(id) { return goog.array.contains(requestedDeps, id); }); }, this); goog.array.extend(idsToCancel, dependentModules); } // Also insert the ids that failed to load as ids to cancel. for (var i = 0; i < failedIds.length; i++) { goog.array.insert(idsToCancel, failedIds[i]); } // Remove ids to cancel from the queues. for (var i = 0; i < idsToCancel.length; i++) { for (var j = 0; j < this.requestedModuleIdsQueue_.length; j++) { goog.array.remove(this.requestedModuleIdsQueue_[j], idsToCancel[i]); } goog.array.remove(this.userInitiatedLoadingModuleIds_, idsToCancel[i]); } // Call the functions for error notification. var errorCallbacks = this.callbackMap_[ goog.module.ModuleManager.CallbackType.ERROR]; if (errorCallbacks) { for (var i = 0; i < errorCallbacks.length; i++) { var callback = errorCallbacks[i]; for (var j = 0; j < idsToCancel.length; j++) { callback(goog.module.ModuleManager.CallbackType.ERROR, idsToCancel[j], cause); } } } // Call the errbacks on the module info. for (var i = 0; i < failedIds.length; i++) { if (this.moduleInfoMap_[failedIds[i]]) { this.moduleInfoMap_[failedIds[i]].onError(cause); } } // Clear the requested loading module ids. this.requestedLoadingModuleIds_.length = 0; this.dispatchActiveIdleChangeIfNeeded_(); }; /** * Loads the next modules on the queue. * @private */ goog.module.ModuleManager.prototype.loadNextModules_ = function() { while (this.requestedModuleIdsQueue_.length) { // Remove modules that are already loaded. var nextIds = goog.array.filter(this.requestedModuleIdsQueue_.shift(), /** @param {string} id The module id. */ function(id) { return !this.getModuleInfo(id).isLoaded(); }, this); if (nextIds.length > 0) { this.loadModules_(nextIds); return; } } // Dispatch an active/idle change if needed. this.dispatchActiveIdleChangeIfNeeded_(); }; /** * The function to call if the module manager is in error. * @param {goog.module.ModuleManager.CallbackType|Array.<goog.module.ModuleManager.CallbackType>} types * The callback type. * @param {Function} fn The function to register as a callback. */ goog.module.ModuleManager.prototype.registerCallback = function( types, fn) { if (!goog.isArray(types)) { types = [types]; } for (var i = 0; i < types.length; i++) { this.registerCallback_(types[i], fn); } }; /** * Register a callback for the specified callback type. * @param {goog.module.ModuleManager.CallbackType} type The callback type. * @param {Function} fn The callback function. * @private */ goog.module.ModuleManager.prototype.registerCallback_ = function(type, fn) { var callbackMap = this.callbackMap_; if (!callbackMap[type]) { callbackMap[type] = []; } callbackMap[type].push(fn); }; /** * Call the callback functions of the specified type. * @param {goog.module.ModuleManager.CallbackType} type The callback type. * @private */ goog.module.ModuleManager.prototype.executeCallbacks_ = function(type) { var callbacks = this.callbackMap_[type]; for (var i = 0; callbacks && i < callbacks.length; i++) { callbacks[i](type); } }; /** @override */ goog.module.ModuleManager.prototype.disposeInternal = function() { goog.module.ModuleManager.superClass_.disposeInternal.call(this); // Dispose of each ModuleInfo object. goog.disposeAll( goog.object.getValues(this.moduleInfoMap_), this.baseModuleInfo_); this.moduleInfoMap_ = null; this.loadingModuleIds_ = null; this.requestedLoadingModuleIds_ = null; this.userInitiatedLoadingModuleIds_ = null; this.requestedModuleIdsQueue_ = null; this.callbackMap_ = null; };
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <shape> <solid android:color="@color/import_export_touch_highlight_dark" /> </shape> <layer-list android:src="@drawable/import_export_item_background_dark" /> </item> <item android:state_focused="true"> <shape> <solid android:color="@color/import_export_touch_highlight_dark" /> </shape> <layer-list android:src="@drawable/import_export_item_background_dark" /> </item> <item android:drawable="@drawable/import_export_item_background_dark" /> </selector>
{ "pile_set_name": "Github" }
//===- SymbolLoader.h -------------------------------------------*- C++ -*-===// // // Copyright (C) 2020 GrammaTech, Inc. // // This code is licensed under the GNU Affero General Public License // as published by the Free Software Foundation, either version 3 of // the License, or (at your option) any later version. See the // LICENSE.txt file in the project root for license terms or visit // https://www.gnu.org/licenses/agpl.txt. // // 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 Affero General Public License for more details. // // This project is sponsored by the Office of Naval Research, One Liberty // Center, 875 N. Randolph Street, Arlington, VA 22203 under contract # // N68335-17-C-0700. The content of the information does not necessarily // reflect the position or policy of the Government and no official // endorsement should be inferred. // //===----------------------------------------------------------------------===// #ifndef SRC_GTIRB_DECODER_CORE_SYMBOLLOADER_H_ #define SRC_GTIRB_DECODER_CORE_SYMBOLLOADER_H_ #include <optional> #include <string> #include <vector> #include <gtirb/gtirb.hpp> #include "../DatalogProgram.h" #include "../Relations.h" // Load symbol information. void SymbolLoader(const gtirb::Module& Module, DatalogProgram& Program); #endif // SRC_GTIRB_DECODER_CORE_SYMBOLLOADER_H_
{ "pile_set_name": "Github" }
### Authenticating SSH with GPG While technically it's certainly possible to authenticate SSH sessions using GPG, `gpg-agent` does not always have a friendly co-existence with `ssh-agent`. Using PIV for authenticating SSH remains the recommended solution. Enable `enable-ssh-support` and `write-env-file` under `~/.gnupg/gpg-agent.conf`: ``` default-cache-ttl 600 max-cache-ttl 7200 pinentry-program /usr/local/MacGPG2/libexec/pinentry-mac.app/Contents/MacOS/pinentry-mac enable-ssh-support write-env-file ```
{ "pile_set_name": "Github" }
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using Microsoft.Coyote.Actors; using Microsoft.Coyote.Actors.Timers; using Microsoft.Coyote.Tasks; using Xunit; using Xunit.Abstractions; using SystemTasks = System.Threading.Tasks; namespace Microsoft.Coyote.Production.Tests.Actors { public class TimerStressTests : BaseProductionTest { public TimerStressTests(ITestOutputHelper output) : base(output) { } private class SetupEvent : Event { public TaskCompletionSource<bool> Tcs; public SetupEvent(TaskCompletionSource<bool> tcs) { this.Tcs = tcs; } } private class T1 : StateMachine { private TaskCompletionSource<bool> Tcs; [Start] [OnEntry(nameof(InitOnEntry))] [OnEventDoAction(typeof(TimerElapsedEvent), nameof(HandleTimeout))] private class Init : State { } private void InitOnEntry(Event e) { this.Tcs = (e as SetupEvent).Tcs; // Start a regular timer. this.StartTimer(TimeSpan.FromTicks(1)); } private void HandleTimeout() { this.Tcs.SetResult(true); this.RaiseHaltEvent(); } } [Fact(Timeout = 6000)] public async SystemTasks.Task TestTimerLifetime() { await this.RunAsync(async r => { int numTimers = 1000; var awaiters = new Task[numTimers]; for (int i = 0; i < numTimers; i++) { var tcs = TaskCompletionSource.Create<bool>(); r.CreateActor(typeof(T1), new SetupEvent(tcs)); awaiters[i] = tcs.Task; } Task task = Task.WhenAll(awaiters); await this.WaitAsync(task); }); } private class T2 : StateMachine { private TaskCompletionSource<bool> Tcs; private int Counter; [Start] [OnEntry(nameof(InitOnEntry))] [OnEventDoAction(typeof(TimerElapsedEvent), nameof(HandleTimeout))] private class Init : State { } private void InitOnEntry(Event e) { this.Tcs = (e as SetupEvent).Tcs; this.Counter = 0; // Start a periodic timer. this.StartPeriodicTimer(TimeSpan.FromTicks(1), TimeSpan.FromTicks(1)); } private void HandleTimeout() { this.Counter++; if (this.Counter == 10) { this.Tcs.SetResult(true); this.RaiseHaltEvent(); } } } [Fact(Timeout = 6000)] public async SystemTasks.Task TestPeriodicTimerLifetime() { await this.RunAsync(async r => { int numTimers = 1000; var awaiters = new Task[numTimers]; for (int i = 0; i < numTimers; i++) { var tcs = TaskCompletionSource.Create<bool>(); r.CreateActor(typeof(T2), new SetupEvent(tcs)); awaiters[i] = tcs.Task; } Task task = Task.WhenAll(awaiters); await this.WaitAsync(task); }); } } }
{ "pile_set_name": "Github" }