text
stringlengths
2
9.78k
meta
dict
<?php /* * $Id$ * * 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. * * This software consists of voluntary contributions made by many individuals * and is licensed under the LGPL. For more information, see * <http://www.doctrine-project.org>. */ /** * Doctrine_Ticket_963_TestCase * * @package Doctrine * @author Konsta Vesterinen <kvesteri@cc.hut.fi> * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @category Object Relational Mapping * @link www.doctrine-project.org * @since 1.0 * @version $Revision$ */ class Doctrine_Ticket_963_TestCase extends Doctrine_UnitTestCase { public function testInit() { $this->dbh = new Doctrine_Adapter_Mock('mysql'); $this->conn = Doctrine_Manager::getInstance()->openConnection($this->dbh); } public function testExportSql() { $sql = $this->conn->export->exportClassesSql(array('Ticket_963_User', 'Ticket_963_Email')); $this->assertEqual(count($sql), 3); $this->assertEqual($sql[0], 'CREATE TABLE ticket_963__user (id BIGINT AUTO_INCREMENT, username VARCHAR(255), password VARCHAR(255), PRIMARY KEY(id)) ENGINE = INNODB'); $this->assertEqual($sql[1], 'CREATE TABLE ticket_963__email (user_id INT, address2 VARCHAR(255), PRIMARY KEY(user_id)) ENGINE = INNODB'); $this->assertEqual($test = isset($sql[2]) ? $sql[2]:null, 'ALTER TABLE ticket_963__email ADD CONSTRAINT ticket_963__email_user_id_ticket_963__user_id FOREIGN KEY (user_id) REFERENCES ticket_963__user(id) ON DELETE CASCADE'); } } class Ticket_963_User extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('username', 'string', 255); $this->hasColumn('password', 'string', 255); } public function setUp() { $this->hasOne('Ticket_963_Email as Email', array('local' => 'id', 'foreign' => 'user_id')); } } class Ticket_963_Email extends Doctrine_Record { public function setTableDefinition() { $this->hasColumn('user_id', 'integer', 4, array('primary' => true)); $this->hasColumn('address2', 'string', 255); } public function setUp() { $this->hasOne('Ticket_963_User as User', array( 'local' => 'user_id', 'foreign' => 'id', 'owningSide' => true, 'onDelete' => 'CASCADE')); } }
{ "pile_set_name": "Github" }
// Copyright (C) 2009 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.gerrit.server.ssh; import com.jcraft.jsch.HostKey; import java.util.List; public interface SshInfo { List<HostKey> getHostKeys(); }
{ "pile_set_name": "Github" }
<?php /** * UserEventApiTest * PHP version 5 * * @category Class * @package Swagger\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ /** * BitMEX API * * ## REST API for the BitMEX Trading Platform [View Changelog](/app/apiChangelog) - #### Getting Started Base URI: [https://www.bitmex.com/api/v1](/api/v1) ##### Fetching Data All REST endpoints are documented below. You can try out any query right from this interface. Most table queries accept `count`, `start`, and `reverse` params. Set `reverse=true` to get rows newest-first. Additional documentation regarding filters, timestamps, and authentication is available in [the main API documentation](/app/restAPI). _All_ table data is available via the [Websocket](/app/wsAPI). We highly recommend using the socket if you want to have the quickest possible data without being subject to ratelimits. ##### Return Types By default, all data is returned as JSON. Send `?_format=csv` to get CSV data or `?_format=xml` to get XML data. ##### Trade Data Queries _This is only a small subset of what is available, to get you started._ Fill in the parameters and click the `Try it out!` button to try any of these queries. - [Pricing Data](#!/Quote/Quote_get) - [Trade Data](#!/Trade/Trade_get) - [OrderBook Data](#!/OrderBook/OrderBook_getL2) - [Settlement Data](#!/Settlement/Settlement_get) - [Exchange Statistics](#!/Stats/Stats_history) Every function of the BitMEX.com platform is exposed here and documented. Many more functions are available. ##### Swagger Specification [⇩ Download Swagger JSON](swagger.json) - ## All API Endpoints Click to expand a section. * * OpenAPI spec version: 1.2.0 * Contact: support@bitmex.com * Generated by: https://github.com/swagger-api/swagger-codegen.git * Swagger Codegen version: 2.4.11-SNAPSHOT */ /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen * Please update the test case below to test the endpoint. */ namespace Swagger\Client; use \Swagger\Client\Configuration; use \Swagger\Client\ApiException; use \Swagger\Client\ObjectSerializer; /** * UserEventApiTest Class Doc Comment * * @category Class * @package Swagger\Client * @author Swagger Codegen team * @link https://github.com/swagger-api/swagger-codegen */ class UserEventApiTest extends \PHPUnit_Framework_TestCase { /** * Setup before running any test cases */ public static function setUpBeforeClass() { } /** * Setup before running each test case */ public function setUp() { } /** * Clean up after running each test case */ public function tearDown() { } /** * Clean up after running all test cases */ public static function tearDownAfterClass() { } /** * Test case for userEventGet * * Get your user events. * */ public function testUserEventGet() { } }
{ "pile_set_name": "Github" }
#ifndef __WON_ROUTINGGROUPNAMECHANGEDOP_H__ #define __WON_ROUTINGGROUPNAMECHANGEDOP_H__ #include "WONShared.h" #include "RoutingOp.h" #include <string> namespace WONAPI { /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// class RoutingGroupNameChangedOp : public RoutingOp { private: unsigned short mGroupId; std::wstring mNewGroupName; virtual WONStatus HandleReply(unsigned char theMsgType, ReadBuffer &theMsg); public: RoutingGroupNameChangedOp(RoutingConnection *theConnection) : RoutingOp(theConnection) {} unsigned short GetGroupId() const { return mGroupId; } const std::wstring& GetNewGroupName() const { return mNewGroupName; } virtual RoutingOpType GetType() const { return RoutingOp_GroupNameChanged; } }; typedef SmartPtr<RoutingGroupNameChangedOp> RoutingGroupNameChangedOpPtr; }; // namespace WONAPI #endif
{ "pile_set_name": "Github" }
// // PersonCard.swift // // Generated by swagger-codegen // https://github.com/swagger-api/swagger-codegen // import Foundation /** This is an card object for a Person derived from BaseCard. */ public struct PersonCard: Codable { public var cardType: String public var firstName: String? public var lastName: String? public init(cardType: String, firstName: String?, lastName: String?) { self.cardType = cardType self.firstName = firstName self.lastName = lastName } }
{ "pile_set_name": "Github" }
/* This code demonstrates how to use the SPI master half duplex mode to read/write a AT932C46D EEPROM (8-bit mode). This example code is in the Public Domain (or CC0 licensed, at your option.) Unless required by applicable law or agreed to in writing, this software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ #pragma once #include "driver/spi_master.h" #include "driver/gpio.h" #include "sdkconfig.h" /// Configurations of the spi_eeprom typedef struct { spi_host_device_t host; ///< The SPI host used, set before calling `spi_eeprom_init()` gpio_num_t cs_io; ///< CS gpio number, set before calling `spi_eeprom_init()` gpio_num_t miso_io; ///< MISO gpio number, set before calling `spi_eeprom_init()` bool intr_used; ///< Whether to use polling or interrupt when waiting for write to be done. Set before calling `spi_eeprom_init()`. } eeprom_config_t; typedef struct eeprom_context_t* eeprom_handle_t; /** * @brief Initialize the hardware. * * @param config Configuration of the EEPROM * @param out_handle Output context of EEPROM communication. * @return * - ESP_OK: on success * - ESP_ERR_INVALID_ARG: If the configuration in the context is incorrect. * - ESP_ERR_NO_MEM: if semaphore create failed. * - or other return value from `spi_bus_add_device()` or `gpio_isr_handler_add()`. */ esp_err_t spi_eeprom_init(const eeprom_config_t *config, eeprom_handle_t* out_handle); /** * @brief Release the resources used by the EEPROM. * * @param handle Context of EEPROM communication. * @return Always ESP_OK */ esp_err_t spi_eeprom_deinit(eeprom_handle_t handle); /** * @brief Read a byte from the EEPROM. * * @param handle Context of EEPROM communication. * @param addr Address to read. * @param out_data Buffer to output the read data. * @return return value from `spi_device_polling_transmit()`. */ esp_err_t spi_eeprom_read(eeprom_handle_t handle, uint8_t addr, uint8_t* out_data); /** * @brief Erase a byte in the EEPROM. * * @param handle Context of EEPROM communication. * @param addr Address to erase. * @return * - ESP_OK: on success * - ESP_ERR_TIMEOUT: if the EEPROM is not able to be ready before the time in the spec. This may mean that the connection is not correct. * - or return value from `spi_device_acquire_bus()` `spi_device_polling_transmit()`. */ esp_err_t spi_eeprom_erase(eeprom_handle_t handle, uint8_t addr); /** * @brief Write a byte into the EEPROM * * @param handle Context of EEPROM communication. * @param addr Address to write. * @param data The byte to write. * @return * - ESP_OK: on success * - ESP_ERR_TIMEOUT: if the EEPROM is not able to be ready before the time in the spec. This may mean that the connection is not correct. * - or return value from `spi_device_acquire_bus()` `spi_device_polling_transmit()`. */ esp_err_t spi_eeprom_write(eeprom_handle_t handle, uint8_t addr, uint8_t data); /** * @brief Enable following write/erase to the EEPROM. * * @param handle Context of EEPROM communication. * @return return value from `spi_device_polling_transmit()`. */ esp_err_t spi_eeprom_write_enable(eeprom_handle_t handle); /** * @brief Disable following write/erase to the EEPROM. * * @param handle Context of EEPROM communication. * @return return value from `spi_device_polling_transmit()`. */ esp_err_t spi_eeprom_write_disable(eeprom_handle_t handle); #if CONFIG_EXAMPLE_5V_COMMANDS /** * @brief Erase all the memory in the EEPROM. * * @note This is only supported when EEPROM VCC is 5V. * @param handle Context of EEPROM communication. * @return * - ESP_OK: on success * - ESP_ERR_TIMEOUT: if the EEPROM is not able to be ready before the time in the spec. This may mean that the connection is not correct. * - or return value from `spi_device_acquire_bus()` `spi_device_polling_transmit()`. */ esp_err_t spi_eeprom_erase_all(eeprom_handle_t handle); /** * @brief write all the memory in the EEPROM to the value given. * * @note This is only supported when EEPROM VCC is 5V. * @param handle Context of EEPROM communication. * @return * - ESP_OK: on success * - ESP_ERR_TIMEOUT: if the EEPROM is not able to be ready before the time in the spec. This may mean that the connection is not correct. * - or return value from `spi_device_acquire_bus()` `spi_device_polling_transmit()`. */ esp_err_t spi_eeprom_write_all(eeprom_handle_t handle, uint8_t data); #endif //CONFIG_EXAMPLE_5V_COMMANDS
{ "pile_set_name": "Github" }
# probabilistic_robotics I am working on detailed solutions of exercises of the book "probabilistic robotics". This is a work in progress, any helpful feedback is welcomed. I also deployed the fastslam nodejs/c++ app on google cloud [here](http://35.242.140.13:8080) (server running from 0000 to 0800 UTC). ![alt text](https://github.com/pptacher/probabilistic_robotics/blob/master/ch12_the_sparse_extended_information_filter/seif.jpg) ***SEIF** algorithm running on Victoria Park dataset* ## references - *Probabilistic robotics*, *MIT press*, Sebastian Thrun, Wolfram Burgard and Dieter Fox, [Probabilistic Robotics](https://mitpress.mit.edu/books/probabilistic-robotics) - *Victoria Park dataset*, The University of Sidney, Eduardo Nebot, [Victoria Park dataset](http://www-personal.acfr.usyd.edu.au/nebot/victoria_park.htm)
{ "pile_set_name": "Github" }
#ifndef HOOKS_H #define HOOKS_H #include <stdint.h> enum __parsec_benchmark { __parsec_blackscholes, }; uint64_t start, stop, res; inline double ticks_to_sec(uint64_t ticks); inline uint64_t rdtsc(void); inline void __parsec_bench_begin(enum __parsec_benchmark __bench) {}; inline void __parsec_bench_end() {}; inline void __parsec_roi_begin() { start = rdtsc(); } inline void __parsec_roi_end() { stop = rdtsc(); printf("Time spent in ROI: %f\n", ticks_to_sec(stop - start)); } #define CPU_FREQ_MHZ 3500 inline uint64_t rdtsc(void) { uint32_t lo, hi; asm volatile ("rdtsc" : "=a"(lo), "=d"(hi) :: "memory"); return ((uint64_t)hi << 32ULL | (uint64_t)lo); } inline double ticks_to_sec(uint64_t ticks) { return (double)ticks * (1.0/((double)CPU_FREQ_MHZ*1000000.0)); } #endif /* HOOKS_H */
{ "pile_set_name": "Github" }
from django.urls import reverse from wakawaka.tests.base import BaseTestCase class RevisionsTestCase(BaseTestCase): """ The Revisions view displays the list of revisions of a given page. """ def test_revisions(self): """ Calling the revisions view without a slug, displays all revisions of all pages. """ # Create a couple of Wiki pages self.create_wikipage('WikiIndex', 'First Content', 'Second Content') self.create_wikipage('CarrotCake', 'Carrot Content') response = self.client.get(reverse('wakawaka_revision_list')) self.assertContains(response, 'Created via API: First Content') self.assertContains(response, 'Created via API: Second Content') self.assertContains(response, 'Created via API: Carrot Content') def test_revisions_for_slug(self): """ Calling the Revisions View with a slug will only display the revisions of this page. """ # Create a couple of Wiki pages self.create_wikipage('WikiIndex', 'First Content', 'Second Content') self.create_wikipage('CarrotCake', 'Carrot Content') response = self.client.get( reverse('wakawaka_revision_list', kwargs={'slug': 'WikiIndex'}) ) self.assertContains(response, 'Created via API: First Content') self.assertContains(response, 'Created via API: Second Content') self.assertNotContains(response, 'Created via API: Carrot Content')
{ "pile_set_name": "Github" }
from celery.utils import uuid from celery.events import Event from html.parser import HTMLParser import xml.etree.ElementTree as ET class HtmlTableParser(HTMLParser): def __init__(self, *args, **kwargs): HTMLParser.__init__(self, *args, **kwargs) self.table = '' self.inTable = False def handle_starttag(self, tag, attrs): if tag == 'table': self.inTable = True if self.inTable: self.table += '<%s' % tag for attr in attrs: self.table += ' %s="%s"' % attr self.table += '>' def handle_endtag(self, tag): if self.inTable: self.table += '</%s>' % tag if tag == 'table': self.inTable = False def handle_data(self, data): if self.inTable: self.table += data def parse(self, source): self.feed(source) def query(self, pattern): root = ET.fromstring(self.table) return root.findall(pattern) def rows(self): return self.query('tbody/tr') def get_row(self, row_id): rows = self.query('tbody/tr') for r in rows: if r.attrib.get('id') == row_id: cells = r.findall('td') return list(map(lambda x: getattr(x, 'text'), cells)) def task_succeeded_events(worker, id=None, name=None, runtime=0.1234, retries=0): id = id or uuid() name = name or 'sometask' return [Event('task-received', uuid=id, name=name, args='(2, 2)', kwargs="{'foo': 'bar'}", retries=retries, eta=None, hostname=worker), Event('task-started', uuid=id, hostname=worker), Event('task-succeeded', uuid=id, result='4', runtime=runtime, hostname=worker)] def task_failed_events(worker, id=None, name=None): id = id or uuid() name = name or 'sometask' return [Event('task-received', uuid=id, name=name, args='(2, 2)', kwargs="{'foo': 'bar'}", retries=0, eta=None, hostname=worker), Event('task-started', uuid=id, hostname=worker), Event('task-failed', uuid=id, exception="KeyError('foo')", traceback='line 1 at main', hostname=worker)]
{ "pile_set_name": "Github" }
// Copyright 2010 Chris Patterson // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use // this file except in compliance with the License. You may obtain a copy of the // License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software distributed // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR // CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. namespace Stact.Internal { using System; using Magnum.Caching; /// <summary> /// Keeps track of a keyed fiber collection /// </summary> /// <typeparam name="TKey"></typeparam> public class KeyedFiberProvider<TKey> : FiberProvider<TKey> { readonly Cache<TKey, Fiber> _cache; readonly TimeSpan _timeout; public KeyedFiberProvider(FiberFactory missingFiberFactory, TimeSpan timeout) { _timeout = timeout; _cache = new ConcurrentCache<TKey, Fiber>(k => missingFiberFactory()); } public Fiber GetFiber(TKey key) { return _cache[key]; } public void Dispose() { _cache.Each(x => x.Shutdown(_timeout)); } } }
{ "pile_set_name": "Github" }
# Copyright 2020 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # 0x00 (module # 0x08 [type] # (type $type0 (func (param i32 i32) (result i32))) # 0x11 [function] # 0x15 (export "mul" (func $func0)) # 0x1e [code] # 0x20 (func $func0 (param $var0 i32) (param $var1 i32) (result i32) # 0x23 get_local $var0 # 0x25 get_local $var1 # 0x27 i32.mul # ) # ) # 0x29 [name] BREAK_ADDRESS_0 = 0x0023 BREAK_ADDRESS_1 = 0x0025 BREAK_ADDRESS_2 = 0x0027 ARG_0 = 21 ARG_1 = 2
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="9,00" Name="libogg_static" ProjectGUID="{15CBFEFF-7965-41F5-B4E2-21E8795C9159}" RootNamespace="libogg" Keyword="Win32Proj" TargetFrameworkVersion="0" > <Platforms> <Platform Name="Win32" /> <Platform Name="x64" /> <Platform Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" /> <Platform Name="Windows Mobile 5.0 Smartphone SDK (ARMV4I)" /> <Platform Name="Windows Mobile 6 Professional SDK (ARMV4I)" /> </Platforms> <ToolFiles> </ToolFiles> <Configurations> <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="4" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\include" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBOGG_EXPORTS" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="4" Detect64BitPortabilityProblems="true" DebugInformationFormat="4" CallingConvention="0" CompileAs="1" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="Debug|x64" OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="4" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" TargetEnvironment="3" /> <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\include" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBOGG_EXPORTS" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="4" Detect64BitPortabilityProblems="true" DebugInformationFormat="3" CallingConvention="0" CompileAs="1" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCPostBuildEventTool" /> </Configuration> <Configuration Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)" OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="4" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" TargetEnvironment="1" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="0" AdditionalIncludeDirectories="..\..\include" PreprocessorDefinitions="_DEBUG;_WINDOWS;_USRDLL;LIBOGG_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_)" MinimalRebuild="true" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" CompileAs="1" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" AdditionalOptions="" /> <Tool Name="VCALinkTool" /> <Tool Name="VCXDCMakeTool" /> <Tool Name="VCBscMakeTool" /> <Tool Name="VCFxCopTool" /> <Tool Name="VCCodeSignTool" /> <Tool Name="VCPostBuildEventTool" /> <DeploymentTool ForceDirty="-1" RemoteDirectory="" RegisterOutput="0" AdditionalFiles="" /> <DebuggerTool /> </Configuration> <Configuration Name="Debug|Windows Mobile 5.0 Smartphone SDK (ARMV4I)" OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)" IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" ConfigurationType="4" CharacterSet="1" > <Tool Name="VCPreBuildEventTool" /> <Tool Name="VCCustomBuildTool" /> <Tool Name="VCXMLDataGeneratorTool" /> <Tool Name="VCWebServiceProxyGeneratorTool" /> <Tool Name="VCMIDLTool" TargetEnvironment="1" /> <Tool Name="VCCLCompilerTool" ExecutionBucket="7" Optimization="0" AdditionalIncludeDirectories="..\..\include" PreprocessorDefinitions="_DEBUG;_WINDOWS;_USRDLL;LIBOGG_EXPORTS;_WIN32_WCE=$(CEVER);UNDER_CE;WINCE;$(ARCHFAM);$(_ARCHFAM_)" MinimalRebuild="true" RuntimeLibrary="3" UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="3" CompileAs="1" /> <Tool Name="VCManagedResourceCompilerTool" /> <Tool Name="VCResourceCompilerTool" /> <Tool Name="VCPreLinkEventTool" /> <Tool Name="VCLibrarianTool" AdditionalOptions="" /> <Tool
{ "pile_set_name": "Github" }
// Generated by CoffeeScript 1.9.1 (function() { var XMLComment, XMLNode, create, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; create = require('lodash/create'); XMLNode = require('./XMLNode'); module.exports = XMLComment = (function(superClass) { extend(XMLComment, superClass); function XMLComment(parent, text) { XMLComment.__super__.constructor.call(this, parent); if (text == null) { throw new Error("Missing comment text"); } this.text = this.stringify.comment(text); } XMLComment.prototype.clone = function() { return create(XMLComment.prototype, this); }; XMLComment.prototype.toString = function(options, level) { var indent, newline, offset, pretty, r, ref, ref1, ref2, space; pretty = (options != null ? options.pretty : void 0) || false; indent = (ref = options != null ? options.indent : void 0) != null ? ref : ' '; offset = (ref1 = options != null ? options.offset : void 0) != null ? ref1 : 0; newline = (ref2 = options != null ? options.newline : void 0) != null ? ref2 : '\n'; level || (level = 0); space = new Array(level + offset + 1).join(indent); r = ''; if (pretty) { r += space; } r += '<!-- ' + this.text + ' -->'; if (pretty) { r += newline; } return r; }; return XMLComment; })(XMLNode); }).call(this);
{ "pile_set_name": "Github" }
<testcase> <info> <keywords> TELNET UPLOAD </keywords> </info> # # Server-side <reply> </reply> # # Client-side <client> <server> http </server> <features> telnet </features> <name> TELNET check of upload with stdout redirected </name> <stdin> GET /ignore/for/1327 HTTP/1.0 </stdin> <file name="log/1327.txt"> GET /we/want/1327 HTTP/1.0 </file> <command option="no-output"> telnet://%HOSTIP:%HTTPPORT -T log/1327.txt </command> </client> # # Verify data after the test has been "shot" <verify> <protocol> GET /we/want/1327 HTTP/1.0 </protocol> </verify> </testcase>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- Written by Eclipse BIRT 2.0 --> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.20"> <page-setup> <graphic-master-page name="My Page"> <contents> <data/> </contents> </graphic-master-page> </page-setup> <data-sources> <script-data-source name="myDataSource"/> </data-sources> <data-sets> <script-data-set name="firstDataSet"> <property name="dataSource">myDataSource</property> </script-data-set> <script-data-set name="secondDataSet"> <property name="dataSource">myDataSource</property> </script-data-set> </data-sets> <cubes> <tabular-cube name="testCube"> <property name="dataSet">firstDataSet</property> <property name="defaultMeasureGroup">testMeasureGroup</property> <property name="autoKey">true</property> <expression name="ACLExpression" type="javascript">ACL expression</expression> <list-property name="filter"> <structure> <property name="operator">lt</property> <expression name="expr">filter expression</expression> <expression name="value1">value1 expression</expression> <expression name="value2">value2 expression</expression> </structure> </list-property> <list-property name="dimensionConditions"> <structure> <property name="hierarchy">testHierarchy</property> <list-property name="joinConditions"> <structure> <property name="cubeKey">cubeKey</property> <property name="hierarchyKey">key</property> <property name="level">testDimension/testLevel</property> </structure> <structure> <property name="cubeKey">cubeKey2</property> <property name="hierarchyKey">key2</property> </structure> <structure> <property name="cubeKey">cubeKey4</property> <property name="hierarchyKey">key4</property> </structure> </list-property> </structure> <structure> <property name="hierarchy">nonExistingHierarchy</property> <list-property name="joinConditions"> <structure> <property name="cubeKey">cubeKey</property> <property name="hierarchyKey">key</property> </structure> </list-property> </structure> </list-property> <property name="dimensions"> <tabular-dimension name="testDimension"> <property name="isTimeType">true</property> <property name="defaultHierarchy">testHierarchy</property> <expression name="ACLExpression" type="javascript">ACL expression</expression> <property name="hierarchies"> <tabular-hierarchy name="testHierarchy"> <property name="dataSet">secondDataSet</property> <list-property name="filter"> <structure> <property name="operator">lt</property> <expression name="expr">filter expression</expression> <expression name="value1">value1 expression</expression> <expression name="value2">value2 expression</expression> </structure> </list-property> <simple-property-list name="primaryKeys"> <value>key</value> <value>key2</value> <value>key4</value> </simple-property-list> <property name="levels"> <tabular-level name="testLevel"> <property name="columnName">column1</property> <property name="displayColumnName">displayColumnName</property> <property name="dataType">integer</property> <property name="dateTimeLevelType">month</property> <property name="dateTimeFormat">mmm</property> <property name="interval">prefix</property> <property name="intervalRange">3.0</property> <property name="intervalBase">Jan</property> <property name="levelType">dynamic</property> <expression name="ACLExpression" type="javascript">ACL expression</expression> <expression name="memberACLExpression" type="javascript">member ACL expression</expression> <property name="alignment">justify</property> <list-property name="staticValues"> <structure> <property name="ruleExpre">rule expression</property> <property name="displayExpre">display expression</property> </structure> <structure> <property name="ruleExpre">rule expression2</property> <property name="displayExpre">display expression2</property> </structure> </list-property> <list-property name="attributes"> <structure> <property name="name">var1</property> <property name="dataType">string</property> </structure> <structure> <property name="name">var2</property> <property name="dataType">integer</property> </structure> </list-property> <structure name="action"> <expression name="uri">http://localhost:8080/bluehero</expression> </structure> <structure name="format"> <property name="category">testLevelFormatCategory</property> <property name="pattern">testLevelFormatPattern</property> <property name="locale">aa</property> </structure> </tabular-level> </property> </tabular-hierarchy> </property> </tabular-dimension> </property> <property name="measureGroups"> <tabular-measure-group name="testMeasureGroup"> <property name="measures"> <tabular-measure name="testMeasure"> <property name="function">min</property> <property name="measureExpression">column</property> <property name="isCalculated">false</property> <property name="dataType">string</property> <expression name="ACLExpression" type="javascript">ACL expression</expression> <property name="alignment">justify</property> <property name="isVisible">false</property> <structure name="action"> <expression name="uri">http://localhost:8080/bluehero</expression> </structure> <structure name="format"> <property name="category">testMeasureFormatCategory</property> <property name="pattern">testMeasureFormatPattern</property> </structure> </tabular-measure> </property> </tabular-measure-group> </property> </tabular-cube> </cubes> </report>
{ "pile_set_name": "Github" }
package cvm import ( "context" "fmt" "github.com/hashicorp/packer/helper/multistep" vpc "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312" ) type stepConfigVPC struct { VpcId string CidrBlock string VpcName string isCreate bool } func (s *stepConfigVPC) Run(ctx context.Context, state multistep.StateBag) multistep.StepAction { vpcClient := state.Get("vpc_client").(*vpc.Client) if len(s.VpcId) != 0 { Say(state, s.VpcId, "Trying to use existing vpc") req := vpc.NewDescribeVpcsRequest() req.VpcIds = []*string{&s.VpcId} var resp *vpc.DescribeVpcsResponse err := Retry(ctx, func(ctx context.Context) error { var e error resp, e = vpcClient.DescribeVpcs(req) return e }) if err != nil { return Halt(state, err, "Failed to get vpc info") } if *resp.Response.TotalCount > 0 { s.isCreate = false state.Put("vpc_id", *resp.Response.VpcSet[0].VpcId) Message(state, *resp.Response.VpcSet[0].VpcName, "Vpc found") return multistep.ActionContinue } return Halt(state, fmt.Errorf("The specified vpc(%s) does not exist", s.VpcId), "") } Say(state, "Trying to create a new vpc", "") req := vpc.NewCreateVpcRequest() req.VpcName = &s.VpcName req.CidrBlock = &s.CidrBlock var resp *vpc.CreateVpcResponse err := Retry(ctx, func(ctx context.Context) error { var e error resp, e = vpcClient.CreateVpc(req) return e }) if err != nil { return Halt(state, err, "Failed to create vpc") } s.isCreate = true s.VpcId = *resp.Response.Vpc.VpcId state.Put("vpc_id", s.VpcId) Message(state, s.VpcId, "Vpc created") return multistep.ActionContinue } func (s *stepConfigVPC) Cleanup(state multistep.StateBag) { if !s.isCreate { return } ctx := context.TODO() vpcClient := state.Get("vpc_client").(*vpc.Client) SayClean(state, "vpc") req := vpc.NewDeleteVpcRequest() req.VpcId = &s.VpcId err := Retry(ctx, func(ctx context.Context) error { _, e := vpcClient.DeleteVpc(req) return e }) if err != nil { Error(state, err, fmt.Sprintf("Failed to delete vpc(%s), please delete it manually", s.VpcId)) } }
{ "pile_set_name": "Github" }
#include <ctype.h> #include <locale.h> #include <stdio.h> #include <stdlib.h> static int do_test (locale_t l); int main (void) { locale_t l; locale_t l2; int result; l = newlocale (1 << LC_ALL, "de_DE.ISO-8859-1", NULL); if (l == NULL) { printf ("newlocale failed: %m\n"); exit (EXIT_FAILURE); } puts ("Running tests of created locale"); result = do_test (l); l2 = duplocale (l); if (l2 == NULL) { printf ("duplocale failed: %m\n"); exit (EXIT_FAILURE); } freelocale (l); puts ("Running tests of duplicated locale"); result |= do_test (l2); return result; } static const char str[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ"; static const char exd[] = "11111111110000000000000000000000000000000000000000"; static const char exa[] = "00000000001111110111111011111111111111111111111111"; static const char exx[] = "11111111111111110111111000000000000000000000000000"; static int do_test (locale_t l) { int result = 0; size_t n; #define DO_TEST(TEST, RES) \ for (n = 0; n < sizeof (str) - 1; ++n) \ if ('0' + (TEST (str[n], l) != 0) != RES[n]) \ { \ printf ("%s(%c) failed\n", #TEST, str[n]); \ result = 1; \ } DO_TEST (isdigit_l, exd); DO_TEST (isalpha_l, exa); DO_TEST (isxdigit_l, exx); return result; }
{ "pile_set_name": "Github" }
#ifndef __CURL_CURLRULES_H #define __CURL_CURLRULES_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* ================================================================ */ /* COMPILE TIME SANITY CHECKS */ /* ================================================================ */ /* * NOTE 1: * ------- * * All checks done in this file are intentionally placed in a public * header file which is pulled by curl/curl.h when an application is * being built using an already built libcurl library. Additionally * this file is also included and used when building the library. * * If compilation fails on this file it is certainly sure that the * problem is elsewhere. It could be a problem in the curlbuild.h * header file, or simply that you are using different compilation * settings than those used to build the library. * * Nothing in this file is intended to be modified or adjusted by the * curl library user nor by the curl library builder. * * Do not deactivate any check, these are done to make sure that the * library is properly built and used. * * You can find further help on the libcurl development mailing list: * http://cool.haxx.se/mailman/listinfo/curl-library/ * * NOTE 2 * ------ * * Some of the following compile time checks are based on the fact * that the dimension of a constant array can not be a negative one. * In this way if the compile time verification fails, the compilation * will fail issuing an error. The error description wording is compiler * dependent but it will be quite similar to one of the following: * * "negative subscript or subscript is too large" * "array must have at least one element" * "-1 is an illegal array size" * "size of array is negative" * * If you are building an application which tries to use an already * built libcurl library and you are getting this kind of errors on * this file, it is a clear indication that there is a mismatch between * how the library was built and how you are trying to use it for your * application. Your already compiled or binary library provider is the * only one who can give you the details you need to properly use it. */ /* * Verify that some macros are actually defined. */ #ifndef CURL_SIZEOF_LONG # error "CURL_SIZEOF_LONG definition is missing!" Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing #endif #ifndef CURL_TYPEOF_CURL_SOCKLEN_T # error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!" Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing #endif #ifndef CURL_SIZEOF_CURL_SOCKLEN_T # error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!" Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing #endif #ifndef CURL_TYPEOF_CURL_OFF_T # error "CURL_TYPEOF_CURL_OFF_T definition is missing!" Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing #endif #ifndef CURL_FORMAT_CURL_OFF_T # error "CURL_FORMAT_CURL_OFF_T definition is missing!" Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing #endif #ifndef CURL_FORMAT_CURL_OFF_TU # error "CURL_FORMAT_CURL_OFF_TU definition is missing!" Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing #endif #ifndef CURL_FORMAT_OFF_T # error "CURL_FORMAT_OFF_T definition is missing!" Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing #endif #ifndef CURL_SIZEOF_CURL_OFF_T # error "CURL_SIZEOF_CURL_OFF_T definition is missing!" Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing #endif #ifndef CURL_SUFFIX_CURL_OFF_T # error "CURL_SUFFIX_CURL_OFF_T definition is missing!" Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing #endif #ifndef CURL_SUFFIX_CURL_OFF_TU # error "CURL_SUFFIX_CURL_OFF_TU definition is missing!" Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing #endif /* * Macros private to this header file. */ #define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1 #define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1 /* * Verify that the size previously defined and expected for long * is the same as the one reported by sizeof() at compile time. */ typedef char __curl_rule_01__ [CurlchkszEQ(long, CURL_SIZEOF_LONG)]; /* * Verify that the size previously defined and expected for * curl_off_t is actually the the same as the one reported * by sizeof() at compile time. */ typedef char __curl_rule_02__ [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)]; /* * Verify at compile time that the size of curl_off_t as reported * by sizeof() is greater or equal than the one reported for long * for the current compilation. */ typedef char __curl_rule_03__ [CurlchkszGE(curl_off_t, long)]; /* * Verify that the size previously defined and expected for * curl_socklen_t is actually the the same as the one reported * by sizeof() at compile time. */ typedef char __curl_rule_04__ [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)]; /* * Verify at compile time that the size of curl_socklen_t as reported * by sizeof() is greater or equal than the one reported for int for * the current compilation. */ typedef char __curl_rule_05__ [CurlchkszGE(curl_socklen_t, int)]; /* ================================================================ */ /* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */ /* ================================================================ */ /* * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow * these to be visible and exported by the external libcurl interface API, * while also making them visible to the library internals, simply including * curl_setup.h, without actually needing to include curl.h internally. * If some day this section would grow big enough, all this should be moved * to its own header file. */ /* * Figure out if we can use the ## preprocessor operator, which is supported * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__ * or __cplusplus so we need to carefully check for them too. */ #if defined(__STDC
{ "pile_set_name": "Github" }
--- title: 把时间当作朋友 date: '2011-03-13' slug: let-time-be-a-friend --- 现在是夜里1点半了,显然我没把时间当朋友,尽管我刚花了五个小时读了《把时间当作朋友》。这本书写得比较踏实,是我还比较喜欢看的,因为感觉有不少真实经历在里面。不过我看完第一遍的感受是,这本书的别名可以是《如何作自我反省》,因为它谈的并不全是管理时间,而是自己扯下自己的面具,或用反省的方式让自己的劣性没有藏身之处,或学习控制自己。本小子一定程度上有同感,这也是本小子需要修炼的。
{ "pile_set_name": "Github" }
/// <reference path="../bower_components/jquery/dist/jquery.js" /> /* jquery-resizable Version 0.27 - 1/10/2018 © 2015-2017 Rick Strahl, West Wind Technologies www.west-wind.com Licensed under MIT License */ (function(factory, undefined) { if (typeof define === 'function' && define.amd) { // AMD define(['jquery'], factory); } else if (typeof module === 'object' && typeof module.exports === 'object') { // CommonJS module.exports = factory(require('jquery')); } else { // Global jQuery factory(jQuery); } }(function($, undefined) { if ($.fn.myresizable) return; $.fn.myresizable = function fnResizable(options) { var defaultOptions = { // selector for handle that starts dragging handleSelector: null, // resize the width resizeWidth: true, // resize the height resizeHeight: true, // the side that the width resizing is relative to resizeWidthFrom: 'right', // the side that the height resizing is relative to resizeHeightFrom: 'bottom', // hook into start drag operation (event passed) onDragStart: null, // hook into stop drag operation (event passed) onDragEnd: null, // hook into each drag operation (event passed) onDrag: null, // disable touch-action on $handle // prevents browser level actions like forward back gestures touchActionNone: true, // instance id instanceId: null }; if (typeof options == "object") defaultOptions = $.extend(defaultOptions, options); return this.each(function () { var opt = $.extend({}, defaultOptions); if (!opt.instanceId) opt.instanceId = "rsz_" + new Date().getTime(); var startPos, startTransition; // get the element to resize var $el = $(this); var $handle; if (options === 'destroy') { opt = $el.data('resizable'); if (!opt) return; $handle = getHandle(opt.handleSelector, $el); $handle.off("mousedown." + opt.instanceId + " touchstart." + opt.instanceId); if (opt.touchActionNone) $handle.css("touch-action", ""); $el.removeClass("resizable"); return; } $el.data('resizable', opt); // get the drag handle $handle = getHandle(opt.handleSelector, $el); if (opt.touchActionNone) $handle.css("touch-action", "none"); $el.addClass("resizable"); $handle.on("mousedown." + opt.instanceId + " touchstart." + opt.instanceId, startDragging); function noop(e) { e.stopPropagation(); e.preventDefault(); }; function startDragging(e) { // Prevent dragging a ghost image in HTML5 / Firefox and maybe others if ( e.preventDefault ) { e.preventDefault(); } startPos = getMousePos(e); startPos.width = parseInt($el.width(), 10); startPos.height = parseInt($el.height(), 10); startTransition = $el.css("transition"); $el.css("transition", "none"); if (opt.onDragStart) { if (opt.onDragStart(e, $el, opt) === false) return; } $(document).on('mousemove.' + opt.instanceId, doDrag); $(document).on('mouseup.' + opt.instanceId, stopDragging); if (window.Touch || navigator.maxTouchPoints) { $(document).on('touchmove.' + opt.instanceId, doDrag); $(document).on('touchend.' + opt.instanceId, stopDragging); } $(document).on('selectstart.' + opt.instanceId, noop); // disable selection } function doDrag(e) { var pos = getMousePos(e), newWidth, newHeight; if (opt.resizeWidthFrom === 'left') newWidth = startPos.width - pos.x + startPos.x; else newWidth = startPos.width + pos.x - startPos.x; if (opt.resizeHeightFrom === 'top') newHeight = startPos.height - pos.y + startPos.y; else newHeight = startPos.height + pos.y - startPos.y; if (!opt.onDrag || opt.onDrag(e, $el, newWidth, newHeight, opt) !== false) { if (opt.resizeHeight) $el.height(newHeight); if (opt.resizeWidth) $el.width(newWidth); } } function stopDragging(e) { e.stopPropagation(); e.preventDefault(); $(document).off('mousemove.' + opt.instanceId); $(document).off('mouseup.' + opt.instanceId); if (window.Touch || navigator.maxTouchPoints) { $(document).off('touchmove.' + opt.instanceId); $(document).off('touchend.' + opt.instanceId); } $(document).off('selectstart.' + opt.instanceId, noop); // reset changed values $el.css("transition", startTransition); if (opt.onDragEnd) opt.onDragEnd(e, $el, opt); return false; } function getMousePos(e) { var pos = { x: 0, y: 0, width: 0, height: 0 }; if (typeof e.clientX === "number") { pos.x = e.clientX; pos.y = e.clientY; } else if (e.originalEvent.touches) { pos.x = e.originalEvent.touches[0].clientX; pos.y = e.originalEvent.touches[0].clientY; } else return null; return pos; } function getHandle(selector, $el) { if (selector && selector.trim()[0] === ">") { selector = selector.trim().replace(/^>\s*/, ""); return $el.find(selector); } // Search for the selector, but only in the parent element to limit the scope // This works for multiple objects on a page (using .class syntax most likely) // as long as each has a separate parent container. return selector ? $el.parent().find(selector) : $el; } }); }; }));
{ "pile_set_name": "Github" }
rule j3f9_05a6e1ed1ee31132 { meta: copyright="Copyright (c) 2014-2018 Support Intelligence Inc, All Rights Reserved." engine="saphire/1.3.1 divinorum/0.998 icewater/0.4" viz_url="http://icewater.io/en/cluster/query?h64=j3f9.05a6e1ed1ee31132" cluster="j3f9.05a6e1ed1ee31132" cluster_size="4" filetype = "application/x-dosexec" tlp = "amber" version = "icewater snowflake" author = "Rick Wesson (@wessorh) rick@support-intelligence.com" date = "20171123" license = "RIL-1.0 [Rick's Internet License] " family="razy malicious malob" md5_hashes="['00da2ef7727c3209b2b9bc8df6cb1550','74c7d64762ab2283aa4d73780ea51ec6','7c9461cdf145dbfeea7f8fcbb325f14e']" strings: $hex_string = { b158045e09801868201523bf143c1251c4b048d2445e3101be9e24c0706c38404dec0e03bc6dfd03c422605cb40ea026619c680c40500058f07919d5064de4a1 } condition: filesize > 4096 and filesize < 16384 and $hex_string }
{ "pile_set_name": "Github" }
/** */ package net.opengis.gml311; import org.eclipse.emf.ecore.EObject; import org.w3.xlink.ActuateType; import org.w3.xlink.ShowType; import org.w3.xlink.TypeType; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Engineering CRS Ref Type</b></em>'. * <!-- end-user-doc --> * * <!-- begin-model-doc --> * Association to an engineering coordinate reference system, either referencing or containing the definition of that reference system. * <!-- end-model-doc --> * * <p> * The following features are supported: * </p> * <ul> * <li>{@link net.opengis.gml311.EngineeringCRSRefType#getEngineeringCRS <em>Engineering CRS</em>}</li> * <li>{@link net.opengis.gml311.EngineeringCRSRefType#getActuate <em>Actuate</em>}</li> * <li>{@link net.opengis.gml311.EngineeringCRSRefType#getArcrole <em>Arcrole</em>}</li> * <li>{@link net.opengis.gml311.EngineeringCRSRefType#getHref <em>Href</em>}</li> * <li>{@link net.opengis.gml311.EngineeringCRSRefType#getRemoteSchema <em>Remote Schema</em>}</li> * <li>{@link net.opengis.gml311.EngineeringCRSRefType#getRole <em>Role</em>}</li> * <li>{@link net.opengis.gml311.EngineeringCRSRefType#getShow <em>Show</em>}</li> * <li>{@link net.opengis.gml311.EngineeringCRSRefType#getTitle <em>Title</em>}</li> * <li>{@link net.opengis.gml311.EngineeringCRSRefType#getType <em>Type</em>}</li> * </ul> * * @see net.opengis.gml311.Gml311Package#getEngineeringCRSRefType() * @model extendedMetaData="name='EngineeringCRSRefType' kind='elementOnly'" * @generated */ public interface EngineeringCRSRefType extends EObject { /** * Returns the value of the '<em><b>Engineering CRS</b></em>' containment reference. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Engineering CRS</em>' containment reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Engineering CRS</em>' containment reference. * @see #setEngineeringCRS(EngineeringCRSType) * @see net.opengis.gml311.Gml311Package#getEngineeringCRSRefType_EngineeringCRS() * @model containment="true" * extendedMetaData="kind='element' name='EngineeringCRS' namespace='##targetNamespace'" * @generated */ EngineeringCRSType getEngineeringCRS(); /** * Sets the value of the '{@link net.opengis.gml311.EngineeringCRSRefType#getEngineeringCRS <em>Engineering CRS</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Engineering CRS</em>' containment reference. * @see #getEngineeringCRS() * @generated */ void setEngineeringCRS(EngineeringCRSType value); /** * Returns the value of the '<em><b>Actuate</b></em>' attribute. * The literals are from the enumeration {@link org.w3.xlink.ActuateType}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Actuate</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Actuate</em>' attribute. * @see org.w3.xlink.ActuateType * @see #isSetActuate() * @see #unsetActuate() * @see #setActuate(ActuateType) * @see net.opengis.gml311.Gml311Package#getEngineeringCRSRefType_Actuate() * @model unsettable="true" * extendedMetaData="kind='attribute' name='actuate' namespace='http://www.w3.org/1999/xlink'" * @generated */ ActuateType getActuate(); /** * Sets the value of the '{@link net.opengis.gml311.EngineeringCRSRefType#getActuate <em>Actuate</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Actuate</em>' attribute. * @see org.w3.xlink.ActuateType * @see #isSetActuate() * @see #unsetActuate() * @see #getActuate() * @generated */ void setActuate(ActuateType value); /** * Unsets the value of the '{@link net.opengis.gml311.EngineeringCRSRefType#getActuate <em>Actuate</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #isSetActuate() * @see #getActuate() * @see #setActuate(ActuateType) * @generated */ void unsetActuate(); /** * Returns whether the value of the '{@link net.opengis.gml311.EngineeringCRSRefType#getActuate <em>Actuate</em>}' attribute is set. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return whether the value of the '<em>Actuate</em>' attribute is set. * @see #unsetActuate() * @see #getActuate() * @see #setActuate(ActuateType) * @generated */ boolean isSetActuate(); /** * Returns the value of the '<em><b>Arcrole</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Arcrole</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Arcrole</em>' attribute. * @see #setArcrole(String) * @see net.opengis.gml311.Gml311Package#getEngineeringCRSRefType_Arcrole() * @model dataType="org.w3.xlink.ArcroleType" * extendedMetaData="kind='attribute' name='arcrole' namespace='http://www.w3.org/1999/xlink'" * @generated */ String getArcrole(); /** * Sets the value of the '{@link net.opengis.gml311.EngineeringCRSRefType#getArcrole <em>Arcrole</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Arcrole</em>' attribute. * @see #getArcrole() * @generated */ void setArcrole(String value); /** * Returns the value of the '<em><b>Href</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Href</em>' attribute isn't clear,
{ "pile_set_name": "Github" }
#include <stdio.h> #include <string.h> int main(void) { char *all = "안녕하세요"; char buf[16]; buf[0] = all[3]; buf[1] = all[4]; buf[2] = all[5]; buf[3] = '\0'; printf("%s\n", all); printf("length= %d\n", strlen(all)); //5? printf("all[3]= %c\n", all[3]); printf("all[3][4][5]= %c%c%c\n", all[3], all[4], all[5]); printf("buf = %s\n", buf); return 0; }
{ "pile_set_name": "Github" }
**This airport has been automatically generated** We have no information about DRRP[*] airport other than its name, ICAO and location (NE). This airport will have to be done from scratch, which includes adding runways, taxiways, parking locations, boundaries... Good luck if you decide to do this airport!
{ "pile_set_name": "Github" }
#include <linux/types.h> #include "event.h" #include "debug.h" #include "sort.h" #include "string.h" #include "strlist.h" #include "thread.h" #include "thread_map.h" static const char *perf_event__names[] = { [0] = "TOTAL", [PERF_RECORD_MMAP] = "MMAP", [PERF_RECORD_LOST] = "LOST", [PERF_RECORD_COMM] = "COMM", [PERF_RECORD_EXIT] = "EXIT", [PERF_RECORD_THROTTLE] = "THROTTLE", [PERF_RECORD_UNTHROTTLE] = "UNTHROTTLE", [PERF_RECORD_FORK] = "FORK", [PERF_RECORD_READ] = "READ", [PERF_RECORD_SAMPLE] = "SAMPLE", [PERF_RECORD_HEADER_ATTR] = "ATTR", [PERF_RECORD_HEADER_EVENT_TYPE] = "EVENT_TYPE", [PERF_RECORD_HEADER_TRACING_DATA] = "TRACING_DATA", [PERF_RECORD_HEADER_BUILD_ID] = "BUILD_ID", [PERF_RECORD_FINISHED_ROUND] = "FINISHED_ROUND", }; const char *perf_event__name(unsigned int id) { if (id >= ARRAY_SIZE(perf_event__names)) return "INVALID"; if (!perf_event__names[id]) return "UNKNOWN"; return perf_event__names[id]; } static struct perf_sample synth_sample = { .pid = -1, .tid = -1, .time = -1, .stream_id = -1, .cpu = -1, .period = 1, }; static pid_t perf_event__get_comm_tgid(pid_t pid, char *comm, size_t len) { char filename[PATH_MAX]; char bf[BUFSIZ]; FILE *fp; size_t size = 0; pid_t tgid = -1; snprintf(filename, sizeof(filename), "/proc/%d/status", pid); fp = fopen(filename, "r"); if (fp == NULL) { pr_debug("couldn't open %s\n", filename); return 0; } while (!comm[0] || (tgid < 0)) { if (fgets(bf, sizeof(bf), fp) == NULL) { pr_warning("couldn't get COMM and pgid, malformed %s\n", filename); break; } if (memcmp(bf, "Name:", 5) == 0) { char *name = bf + 5; while (*name && isspace(*name)) ++name; size = strlen(name) - 1; if (size >= len) size = len - 1; memcpy(comm, name, size); comm[size] = '\0'; } else if (memcmp(bf, "Tgid:", 5) == 0) { char *tgids = bf + 5; while (*tgids && isspace(*tgids)) ++tgids; tgid = atoi(tgids); } } fclose(fp); return tgid; } static pid_t perf_event__synthesize_comm(struct perf_tool *tool, union perf_event *event, pid_t pid, int full, perf_event__handler_t process, struct machine *machine) { char filename[PATH_MAX]; size_t size; DIR *tasks; struct dirent dirent, *next; pid_t tgid; memset(&event->comm, 0, sizeof(event->comm)); tgid = perf_event__get_comm_tgid(pid, event->comm.comm, sizeof(event->comm.comm)); if (tgid < 0) goto out; event->comm.pid = tgid; event->comm.header.type = PERF_RECORD_COMM; size = strlen(event->comm.comm) + 1; size = ALIGN(size, sizeof(u64)); memset(event->comm.comm + size, 0, machine->id_hdr_size); event->comm.header.size = (sizeof(event->comm) - (sizeof(event->comm.comm) - size) + machine->id_hdr_size); if (!full) { event->comm.tid = pid; process(tool, event, &synth_sample, machine); goto out; } snprintf(filename, sizeof(filename), "/proc/%d/task", pid); tasks = opendir(filename); if (tasks == NULL) { pr_debug("couldn't open %s\n", filename); return 0; } while (!readdir_r(tasks, &dirent, &next) && next) { char *end; pid = strtol(dirent.d_name, &end, 10); if (*end) continue; /* already have tgid; jut want to update the comm */ (void) perf_event__get_comm_tgid(pid, event->comm.comm, sizeof(event->comm.comm)); size = strlen(event->comm.comm) + 1; size = ALIGN(size, sizeof(u64)); memset(event->comm.comm + size, 0, machine->id_hdr_size); event->comm.header.size = (sizeof(event->comm) - (sizeof(event->comm.comm) - size) + machine->id_hdr_size); event->comm.tid = pid; process(tool, event, &synth_sample, machine); } closedir(tasks); out: return tgid; } static int perf_event__synthesize_mmap_events(struct perf_tool *tool, union perf_event *event, pid_t pid, pid_t tgid, perf_event__handler_t process, struct machine *machine) { char filename[PATH_MAX]; FILE *fp; snprintf(filename, sizeof(filename), "/proc/%d/maps", pid); fp = fopen(filename, "r"); if (fp == NULL) { /* * We raced with a task exiting - just return: */ pr_debug("couldn't open %s\n", filename); return -1; } event->header.type = PERF_RECORD_MMAP; /* * Just like the kernel, see __perf_event_mmap in kernel/perf_event.c */ event->header.misc = PERF_RECORD_MISC_USER; while (1) { char bf[BUFSIZ], *pbf = bf; int n; size_t size; if (fgets(bf, sizeof(bf), fp) == NULL) break; /* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */ n = hex2u64(pbf, &event->mmap.start); if (n < 0) continue; pbf += n + 1; n = hex2u64(pbf, &event->mmap.len); if (n < 0) continue; pbf += n + 3; if (*pbf == 'x') { /* vm_exec */ char anonstr[] = "//anon\n"; char *execname = strchr(bf, '/'); /* Catch VDSO */ if (execname == NULL) execname = strstr(bf, "[vdso]"); /* Catch anonymous mmaps */ if ((execname == NULL)
{ "pile_set_name": "Github" }
org/bukkit/entity/Damageable _INVALID_damage (I)V damage org/bukkit/entity/Damageable _INVALID_damage (ILorg/bukkit/entity/Entity;)V damage org/bukkit/entity/Damageable _INVALID_getHealth ()I getHealth org/bukkit/entity/Damageable _INVALID_setHealth (I)V setHealth org/bukkit/entity/Damageable _INVALID_getMaxHealth ()I getMaxHealth org/bukkit/entity/Damageable _INVALID_setMaxHealth (I)V setMaxHealth org/bukkit/entity/LivingEntity _INVALID_getLastDamage ()I getLastDamage org/bukkit/entity/LivingEntity _INVALID_setLastDamage (I)V setLastDamage org/bukkit/event/entity/EntityDamageEvent _INVALID_getDamage ()I getDamage org/bukkit/event/entity/EntityDamageEvent _INVALID_setDamage (I)V setDamage org/bukkit/event/vehicle/VehicleDamageEvent _INVALID_getDamage ()I getDamage org/bukkit/event/vehicle/VehicleDamageEvent _INVALID_setDamage (I)V setDamage org/bukkit/event/entity/EntityRegainHealthEvent _INVALID_getAmount ()I getAmount org/bukkit/event/entity/EntityRegainHealthEvent _INVALID_setAmount (I)V setAmount org/bukkit/entity/Minecart _INVALID_getDamage ()I getDamage org/bukkit/entity/Minecart _INVALID_setDamage (I)V setDamage org/bukkit/entity/Projectile _INVALID_getShooter ()Lorg/bukkit/entity/LivingEntity; getShooter org/bukkit/entity/Projectile _INVALID_setShooter (Lorg/bukkit/entity/LivingEntity;)V setShooter org/bukkit/Bukkit _INVALID_getOnlinePlayers ()[Lorg/bukkit/entity/Player; getOnlinePlayers org/bukkit/Server _INVALID_getOnlinePlayers ()[Lorg/bukkit/entity/Player; getOnlinePlayers
{ "pile_set_name": "Github" }
/* * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://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.springframework.jdbc.core; import java.sql.PreparedStatement; import java.sql.SQLException; import org.springframework.lang.Nullable; /** * Simple adapter for {@link PreparedStatementSetter} that applies a given array of arguments. * * @author Juergen Hoeller * @since 3.2.3 */ public class ArgumentPreparedStatementSetter implements PreparedStatementSetter, ParameterDisposer { @Nullable private final Object[] args; /** * Create a new ArgPreparedStatementSetter for the given arguments. * @param args the arguments to set */ public ArgumentPreparedStatementSetter(@Nullable Object[] args) { this.args = args; } @Override public void setValues(PreparedStatement ps) throws SQLException { if (this.args != null) { for (int i = 0; i < this.args.length; i++) { Object arg = this.args[i]; doSetValue(ps, i + 1, arg); } } } /** * Set the value for prepared statements specified parameter index using the passed in value. * This method can be overridden by sub-classes if needed. * @param ps the PreparedStatement * @param parameterPosition index of the parameter position * @param argValue the value to set * @throws SQLException if thrown by PreparedStatement methods */ protected void doSetValue(PreparedStatement ps, int parameterPosition, Object argValue) throws SQLException { if (argValue instanceof SqlParameterValue) { SqlParameterValue paramValue = (SqlParameterValue) argValue; StatementCreatorUtils.setParameterValue(ps, parameterPosition, paramValue, paramValue.getValue()); } else { StatementCreatorUtils.setParameterValue(ps, parameterPosition, SqlTypeValue.TYPE_UNKNOWN, argValue); } } @Override public void cleanupParameters() { StatementCreatorUtils.cleanupParameters(this.args); } }
{ "pile_set_name": "Github" }
out vec4 FragColor; uniform sampler2D strokeColor; uniform sampler2D strokeDepth; uniform float amplitude; uniform float period; uniform float phase; uniform int orientation; uniform vec2 wsize; #define M_PI 3.1415926535897932384626433832795 #define HORIZONTAL 0 #define VERTICAL 1 void main() { vec4 outcolor; ivec2 uv = ivec2(gl_FragCoord.xy); float stroke_depth; float value; if (orientation == HORIZONTAL) { float pval = (uv.x * M_PI) / wsize[0]; value = amplitude * sin((period * pval) + phase); outcolor = texelFetch(strokeColor, ivec2(uv.x, uv.y + value), 0); stroke_depth = texelFetch(strokeDepth, ivec2(uv.x, uv.y + value), 0).r; } else { float pval = (uv.y * M_PI) / wsize[1]; value = amplitude * sin((period * pval) + phase); outcolor = texelFetch(strokeColor, ivec2(uv.x + value, uv.y), 0); stroke_depth = texelFetch(strokeDepth, ivec2(uv.x + value, uv.y), 0).r; } FragColor = outcolor; gl_FragDepth = stroke_depth; if (outcolor.a < 0.02f) { discard; } }
{ "pile_set_name": "Github" }
// https://codeforces.com/contest/1199/problem/C #include <bits/stdc++.h> using namespace std; using mii = map<int, int>; int main() { int n, I, x; cin >> n >> I; mii m; for (int i = 0; i < n; i++) { cin >> x; m[x]++; } int k = (8 * I) / n; int K = 1; for (int i = 0; i < k; i++) { K *= 2; if (K >= m.size()) { cout << 0 << endl; return 0; } } int p = m.size(); vector<int> a; for (auto x : m) a.push_back(x.second); int M = 1000000000; int z = 0; for (int i = 0; i < K; i++) z += a[i]; M = min(M, n - z); for (int i = K; i < p; i++) { z -= a[i - K]; z += a[i]; M = min(M, n - z); } cout << M << endl; }
{ "pile_set_name": "Github" }
# # MSILO usage example # # $ID: daniel $ # udp_workers=2 check_via=no # (cmd. line: -v) dns=off # (cmd. line: -r) rev_dns=off # (cmd. line: -R) # ------------------ module loading ---------------------------------- #set module path mpath="/usr/local/lib/opensips/modules/" loadmodule "textops.so" loadmodule "sl.so" loadmodule "db_mysql.so" loadmodule "maxfwd.so" loadmodule "tm.so" loadmodule "usrloc.so" loadmodule "registrar.so" loadmodule "msilo.so" # ----------------- setting module-specific parameters --------------- # -- registrar params -- modparam("registrar", "default_expires", 120) # -- usrloc params -- modparam("usrloc", "db_mode", 0) # -- msilo params -- modparam("msilo", "db_url", "mysql://opensips:opensipsrw@localhost/opensips") # -- tm params -- modparam("tm", "fr_timer", 10 ) modparam("tm", "fr_inv_timer", 15 ) modparam("tm", "wt_timer", 10 ) route{ if ( !mf_process_maxfwd_header("10") ) { sl_send_reply("483","To Many Hops"); exit; }; if (is_myself("$rd")) { # for testing purposes, simply okay all REGISTERs # is_method("XYZ") is faster than ($rm=="XYZ") # but requires textops module if (is_method("REGISTER")) { save("location"); log("REGISTER received -> dumping messages with MSILO\n"); # MSILO - dumping user's offline messages if (m_dump()) { log("MSILO: offline messages dumped - if they were\n"); } else { log("MSILO: no offline messages dumped\n"); }; exit; }; # backup r-uri for m_dump() in case of delivery failure $avp(11) = $ru; # domestic SIP destinations are handled using our USRLOC DB if(!lookup("location")) { if (! t_newtran()) { sl_reply_error(); exit; }; # we do not care about anything else but MESSAGEs if (!is_method("MESSAGE")) { if (!t_reply("404", "Not found")) { sl_reply_error(); }; exit; }; log("MESSAGE received -> storing using MSILO\n"); # MSILO - storing as offline message if (m_store("$ru")) { log("MSILO: offline message stored\n"); if (!t_reply("202", "Accepted")) { sl_reply_error(); }; }else{ log("MSILO: offline message NOT stored\n"); if (!t_reply("503", "Service Unavailable")) { sl_reply_error(); }; }; exit; }; # if the downstream UA does not support MESSAGE requests # go to failure_route[1] t_on_failure("1"); t_relay(); exit; }; # forward anything else t_relay(); } failure_route[1] { # forwarding failed -- check if the request was a MESSAGE if (!is_method("MESSAGE")) exit; log(1,"MSILO: the downstream UA does not support MESSAGE requests ...\n"); # we have changed the R-URI with the contact address -- ignore it now if (m_store("$avp(11)")) { log("MSILO: offline message stored\n"); t_reply("202", "Accepted"); }else{ log("MSILO: offline message NOT stored\n"); t_reply("503", "Service Unavailable"); }; }
{ "pile_set_name": "Github" }
/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #ifndef BACKENDS_PLUGINS_SDL_H #define BACKENDS_PLUGINS_SDL_H #include "base/plugins.h" #if defined(DYNAMIC_MODULES) && defined(SDL_BACKEND) class SDLPluginProvider : public FilePluginProvider { protected: Plugin* createPlugin(const Common::FSNode &node) const; }; #endif // defined(DYNAMIC_MODULES) && defined(SDL_BACKEND) #endif
{ "pile_set_name": "Github" }
package com.mashibing.controller.base; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.stereotype.Controller; /** * <p> * 自定义类型 前端控制器 * </p> * * @author lian * @since 2020-04-18 */ @Controller @RequestMapping("/tblCustomType") public class TblCustomTypeController { }
{ "pile_set_name": "Github" }
// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) var dP = require('./_object-dp'); var $export = require('./_export'); var anObject = require('./_an-object'); var toPrimitive = require('./_to-primitive'); // MS Edge has broken Reflect.defineProperty - throwing instead of returning false $export($export.S + $export.F * require('./_fails')(function () { // eslint-disable-next-line no-undef Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); }), 'Reflect', { defineProperty: function defineProperty(target, propertyKey, attributes) { anObject(target); propertyKey = toPrimitive(propertyKey, true); anObject(attributes); try { dP.f(target, propertyKey, attributes); return true; } catch (e) { return false; } } });
{ "pile_set_name": "Github" }
# Blender v2.78 (sub 0) OBJ File: '' # www.blender.org o collision_mesh_Cube v 1.670722 -0.127512 -28.506155 v 1.160390 -0.022079 -28.506147 v 1.160390 -0.022079 -29.095850 v 1.670722 -0.127512 -31.214417 v 7.181986 -0.294439 -16.803648 v 4.320757 -3.384111 -17.799223 v 2.375209 -0.294435 -28.506155 v 4.320757 3.466504 -17.799223 v 7.181986 0.376831 -16.803648 v 2.375209 0.376835 -28.506155 v -4.291919 -3.384111 -17.799206 v -2.346404 -0.294435 -28.506147 v 6.440376 -3.384111 -17.061693 v -8.962100 0.339741 -16.478279 v -9.230039 0.724865 -16.478279 v -9.335758 0.530979 -16.796093 v -9.143806 0.255075 -16.796093 v 6.440376 3.466504 -17.061693 v -6.430764 3.466500 -5.229502 v -11.466506 1.405055 -5.576606 v -11.466506 1.405053 -1.420516 v -6.440376 3.466498 -0.152408 v 11.495368 -1.322671 -5.576653 v 11.495352 1.405055 -5.576649 v 11.495353 1.405053 -1.420548 v 11.495377 -1.322673 -1.420551 v -1.117825 -3.384113 -4.703391 v -6.430764 -3.384115 -5.229506 v 6.440376 3.466500 -5.229513 v 6.440376 3.466498 -0.152408 v 6.440376 -3.384115 -5.229515 v 6.440376 -3.384117 -0.152412 v -11.466495 -1.322671 -5.576606 v -6.440376 -3.384117 -0.152412 v -11.466490 -1.322673 -1.420516 v 11.495353 1.405051 5.881690 v 11.495377 -1.322675 5.881690 v 8.197359 -0.587044 5.896743 v 8.197359 0.669419 5.896743 v -5.104052 1.865917 -0.152410 v 5.132942 1.865917 -0.152410 v -5.104052 -1.783537 -0.152410 v -6.354040 -0.596332 -0.152410 v 6.382930 0.678711 -0.152410 v -11.466490 -1.322675 5.881690 v -11.466506 1.405051 5.881690 v -8.168447 0.669420 5.896767 v -8.168447 -0.587044 5.896767 v 6.382931 -0.596332 -0.152410 v 6.440376 -3.384119 5.881690 v 6.986341 -1.783539 5.899220 v -6.440376 -3.384119 5.881690 v -6.957430 -1.783539 5.899240 v -6.440376 3.466492 15.631774 v -11.466506 1.405048 15.631772 v -11.466506 1.405047 19.095119 v -6.440376 3.466492 19.095119 v -12.370783 0.876847 17.207783 v -12.370779 0.409939 16.685438 v -12.370773 -0.327570 16.685438 v -12.370769 -0.794479 17.207783 v -12.370769 -0.794479 17.730131 v -12.370773 -0.328008 18.260187 v -12.370779 0.410377 18.260187 v -12.370783 0.876847 17.730131 v -6.440376 -3.384123 15.631770 v 6.440376 -3.384123 15.631770 v 6.440376 -3.384123 19.095119 v -6.440376 -3.384123 19.095119 v 11.495353 1.405048 15.631772 v 6.440376 3.466492 15.631774 v 6.440376 3.466492 19.095119 v 11.495353 1.405047 19.095119 v 11.495377 -1.322677 15.631772 v 11.495377 -1.322679 19.095119 v -11.466490 -1.322677 15.631772 v -11.466490 -1.322679 19.095119 v -11.466490 -1.300472 15.675435 v -11.466495 -0.336753 16.141020 v -11.466500 0.419122 16.141020 v -11.466506 1.357710 15.724846 v 0.000000 -1.936993 19.095119 v 1.343374 -1.350787 19.095119 v 0.893794 -0.884943 20.184601 v 0.000000 -1.274967 20.184601 v -3.941836 0.041185 19.095119 v -4.493916 1.448328 19.095119 v -4.932480 0.977407 20.184601 v -4.565162 0.041185 20.184601 v -6.354040 0.678712 -0.152410 v -6.957431 1.865915 5.899241 v 5.132942 -1.783537 -0.152410 v 6.986340 1.865915 5.899220 v 6.440376 3.466496 5.881691 v -6.440376 3.466496 5.881691 v -6.425147 3.466502 -9.641721 v -11.466506 1.405057 -9.198973 v 11.495353 -1.322667 -15.302793 v 11.495353 1.405059 -15.302793 v 11.495352 1.405057 -9.199015 v 11.495363 -1.322670 -9.199018 v -11.466500 -0.717729 -8.862511 v -11.466501 -0.298437 -8.753048 v -11.466504 0.380820 -8.753048 v -11.466505 0.797739 -8.861190 v -11.466499 -1.322670 -9.198973 v -6.425147 -3.384113 -9.641729 v 6.440376 -3.384113 -9.641742 v 6.440376 3.466502 -9.641738 v -11.466506 1.405059 -15.302760 v -11.466506 -1.322667 -15.302760 v 11.495367 -0.520921 -6.247777 v 11.495362 -0.520921 -8.527891 v 15.544081 -0.399815 -7.881511 v 15.544086 -0.399815 -6.894135 v -15.515222 -0.
{ "pile_set_name": "Github" }
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, install, // copy or use the software. // // // License Agreement // For Open Source Computer Vision Library // // Copyright (C) 2013, OpenCV Foundation, all rights reserved. // Third party copyrights are property of their respective owners. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistribution's of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // * Redistribution's 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. // // * The name of the copyright holders may not 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 Intel Corporation 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. // //M*/ #ifndef OPENCV_DNN_HPP #define OPENCV_DNN_HPP // This is an umbrealla header to include into you project. // We are free to change headers layout in dnn subfolder, so please include // this header for future compatibility /** @defgroup dnn Deep Neural Network module @{ This module contains: - API for new layers creation, layers are building bricks of neural networks; - set of built-in most-useful Layers; - API to constuct and modify comprehensive neural networks from layers; - functionality for loading serialized networks models from differnet frameworks. Functionality of this module is designed only for forward pass computations (i. e. network testing). A network training is in principle not supported. @} */ #include <opencv2/dnn/dnn.hpp> #endif /* OPENCV_DNN_HPP */
{ "pile_set_name": "Github" }
module.exports = { 'camelCase': require('./string/camelCase'), 'capitalize': require('./string/capitalize'), 'deburr': require('./string/deburr'), 'endsWith': require('./string/endsWith'), 'escape': require('./string/escape'), 'escapeRegExp': require('./string/escapeRegExp'), 'kebabCase': require('./string/kebabCase'), 'pad': require('./string/pad'), 'padLeft': require('./string/padLeft'), 'padRight': require('./string/padRight'), 'parseInt': require('./string/parseInt'), 'repeat': require('./string/repeat'), 'snakeCase': require('./string/snakeCase'), 'startCase': require('./string/startCase'), 'startsWith': require('./string/startsWith'), 'template': require('./string/template'), 'templateSettings': require('./string/templateSettings'), 'trim': require('./string/trim'), 'trimLeft': require('./string/trimLeft'), 'trimRight': require('./string/trimRight'), 'trunc': require('./string/trunc'), 'unescape': require('./string/unescape'), 'words': require('./string/words') };
{ "pile_set_name": "Github" }
import _ from 'lodash'; import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { inputTypes } from 'Helpers/Props'; import Button from 'Components/Link/Button'; import Form from 'Components/Form/Form'; import FormGroup from 'Components/Form/FormGroup'; import FormLabel from 'Components/Form/FormLabel'; import FormInputGroup from 'Components/Form/FormInputGroup'; import ModalContent from 'Components/Modal/ModalContent'; import ModalHeader from 'Components/Modal/ModalHeader'; import ModalBody from 'Components/Modal/ModalBody'; import ModalFooter from 'Components/Modal/ModalFooter'; const posterSizeOptions = [ { key: 'small', value: 'Small' }, { key: 'medium', value: 'Medium' }, { key: 'large', value: 'Large' } ]; class SeriesIndexOverviewOptionsModalContent extends Component { // // Lifecycle constructor(props, context) { super(props, context); this.state = { detailedProgressBar: props.detailedProgressBar, size: props.size, showMonitored: props.showMonitored, showNetwork: props.showNetwork, showQualityProfile: props.showQualityProfile, showPreviousAiring: props.showPreviousAiring, showAdded: props.showAdded, showSeasonCount: props.showSeasonCount, showPath: props.showPath, showSizeOnDisk: props.showSizeOnDisk, showSearchAction: props.showSearchAction }; } componentDidUpdate(prevProps) { const { detailedProgressBar, size, showMonitored, showNetwork, showQualityProfile, showPreviousAiring, showAdded, showSeasonCount, showPath, showSizeOnDisk, showSearchAction } = this.props; const state = {}; if (detailedProgressBar !== prevProps.detailedProgressBar) { state.detailedProgressBar = detailedProgressBar; } if (size !== prevProps.size) { state.size = size; } if (showMonitored !== prevProps.showMonitored) { state.showMonitored = showMonitored; } if (showNetwork !== prevProps.showNetwork) { state.showNetwork = showNetwork; } if (showQualityProfile !== prevProps.showQualityProfile) { state.showQualityProfile = showQualityProfile; } if (showPreviousAiring !== prevProps.showPreviousAiring) { state.showPreviousAiring = showPreviousAiring; } if (showAdded !== prevProps.showAdded) { state.showAdded = showAdded; } if (showSeasonCount !== prevProps.showSeasonCount) { state.showSeasonCount = showSeasonCount; } if (showPath !== prevProps.showPath) { state.showPath = showPath; } if (showSizeOnDisk !== prevProps.showSizeOnDisk) { state.showSizeOnDisk = showSizeOnDisk; } if (showSearchAction !== prevProps.showSearchAction) { state.showSearchAction = showSearchAction; } if (!_.isEmpty(state)) { this.setState(state); } } // // Listeners onChangeOverviewOption = ({ name, value }) => { this.setState({ [name]: value }, () => { this.props.onChangeOverviewOption({ [name]: value }); }); } // // Render render() { const { onModalClose } = this.props; const { detailedProgressBar, size, showMonitored, showNetwork, showQualityProfile, showPreviousAiring, showAdded, showSeasonCount, showPath, showSizeOnDisk, showSearchAction } = this.state; return ( <ModalContent onModalClose={onModalClose}> <ModalHeader> Overview Options </ModalHeader> <ModalBody> <Form> <FormGroup> <FormLabel>Poster Size</FormLabel> <FormInputGroup type={inputTypes.SELECT} name="size" value={size} values={posterSizeOptions} onChange={this.onChangeOverviewOption} /> </FormGroup> <FormGroup> <FormLabel>Detailed Progress Bar</FormLabel> <FormInputGroup type={inputTypes.CHECK} name="detailedProgressBar" value={detailedProgressBar} helpText="Show text on progess bar" onChange={this.onChangeOverviewOption} /> </FormGroup> <FormGroup> <FormLabel>Show Monitored</FormLabel> <FormInputGroup type={inputTypes.CHECK} name="showMonitored" value={showMonitored} onChange={this.onChangeOverviewOption} /> </FormGroup> <FormGroup> <FormLabel>Show Network</FormLabel> <FormInputGroup type={inputTypes.CHECK} name="showNetwork" value={showNetwork} onChange={this.onChangeOverviewOption} /> </FormGroup> <FormGroup> <FormLabel>Show Quality Profile</FormLabel> <FormInputGroup type={inputTypes.CHECK} name="showQualityProfile" value={showQualityProfile} onChange={this.onChangeOverviewOption} /> </FormGroup> <FormGroup> <FormLabel>Show Previous Airing</FormLabel> <FormInputGroup type={inputTypes.CHECK} name="showPreviousAiring" value={showPreviousAiring} onChange={this.onChangeOverviewOption} /> </FormGroup> <FormGroup> <FormLabel>Show Date Added</FormLabel> <FormInputGroup type={inputTypes.CHECK} name="showAdded" value={showAdded} onChange={this.onChangeOverviewOption} /> </FormGroup> <FormGroup> <FormLabel>Show Season Count</FormLabel> <FormInputGroup type={inputTypes.CHECK} name="showSeasonCount" value={showSeasonCount} onChange={this.onChangeOverviewOption} /> </FormGroup> <FormGroup> <FormLabel>Show Path</FormLabel> <FormInputGroup type={inputTypes.CHECK} name="showPath" value={showPath} onChange={this.onChangeOverviewOption} /> </FormGroup> <FormGroup> <FormLabel>Show Size on Disk</FormLabel> <FormInputGroup type={inputTypes.CHECK} name="showSizeOnDisk" value={showSizeOnDisk} onChange={this.onChangeOverviewOption} /> </FormGroup> <FormGroup> <FormLabel>Show Search</FormLabel> <FormInputGroup type={inputTypes.CHECK} name="showSearchAction" value={showSearchAction} helpText="Show search button on hover" onChange={this.onChangeOverviewOption} /> </FormGroup> </Form> </ModalBody> <ModalFooter> <Button onPress={onModalClose} > Close </Button> </ModalFooter> </ModalContent> ); } } SeriesIndexOverviewOptionsModalContent.propTypes = { size: PropTypes.string.isRequired, detailedProgressBar: PropTypes.bool.isRequired, showMonitored: PropTypes.bool.isRequired, showNetwork: PropTypes.bool.isRequired, showQualityProfile: PropTypes.bool.isRequired, showPreviousAiring: PropTypes.bool.isRequired, showAdded: PropTypes.bool.isRequired, showSeasonCount: PropTypes.bool.isRequired,
{ "pile_set_name": "Github" }
using cloudscribe.Multitenancy; namespace Microsoft.AspNetCore.Http { /// <summary> /// Multitenant extensions for <see cref="HttpContext"/>. /// </summary> public static class MultitenancyHttpContextExtensions { private const string TenantContextKey = "cloudscribe.TenantContext"; public static void SetTenantContext<TTenant>(this HttpContext context, TenantContext<TTenant> tenantContext) { Ensure.Argument.NotNull(context, nameof(context)); Ensure.Argument.NotNull(tenantContext, nameof(tenantContext)); context.Items[TenantContextKey] = tenantContext; } public static TenantContext<TTenant> GetTenantContext<TTenant>(this HttpContext context) { Ensure.Argument.NotNull(context, nameof(context)); object tenantContext; if (context.Items.TryGetValue(TenantContextKey, out tenantContext)) { return tenantContext as TenantContext<TTenant>; } return null; } public static TTenant GetTenant<TTenant>(this HttpContext context) { Ensure.Argument.NotNull(context, nameof(context)); var tenantContext = GetTenantContext<TTenant>(context); if (tenantContext != null) { return tenantContext.Tenant; } return default(TTenant); } } }
{ "pile_set_name": "Github" }
# -*- encoding : utf-8 -*- # ClientSideValidations Initializer # Uncomment to disable uniqueness validator, possible security issue # ClientSideValidations::Config.disabled_validators = [:uniqueness] # Uncomment to validate number format with current I18n locale # ClientSideValidations::Config.number_format_with_locale = true # Uncomment the following block if you want each input field to have the validation messages attached. ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| unless html_tag =~ /^<label/ %{<div class="field_with_errors">#{html_tag}<label for="#{instance.send(:tag_id)}" class="message">#{instance.error_message.first}</label></div>}.html_safe else %{<div class="field_with_errors">#{html_tag}</div>}.html_safe end end
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" ?> <office:document-content xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" office:version="1.0"> <office:scripts /> <office:font-face-decls> <style:font-face style:name="Times New Roman" svg:font-family="&apos;Times New Roman&apos;" style:font-family-generic="roman" style:font-pitch="variable" /> <style:font-face style:name="Lucida Sans Unicode" svg:font-family="&apos;Lucida Sans Unicode&apos;" style:font-family-generic="system" style:font-pitch="variable" /> <style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-family-generic="system" style:font-pitch="variable" /> </office:font-face-decls> <office:automatic-styles /> <office:body> <office:text> <office:forms form:automatic-focus="false" form:apply-design-mode="false" /> <text:sequence-decls> <text:sequence-decl text:display-outline-level="0" text:name="Illustration" /> <text:sequence-decl text:display-outline-level="0" text:name="Table" /> <text:sequence-decl text:display-outline-level="0" text:name="Text" /> <text:sequence-decl text:display-outline-level="0" text:name="Drawing" /> </text:sequence-decls> <text:p text:style-name="Standard">Some text</text:p> </office:text> </office:body> </office:document-content>
{ "pile_set_name": "Github" }
--- title: 保護された Web API アプリを構成する |Microsoft titleSuffix: Microsoft identity platform description: 保護された Web API をビルドして、アプリケーションのコードを構成する方法について学習します。 services: active-directory author: jmprieur manager: CelesteDG ms.service: active-directory ms.subservice: develop ms.topic: conceptual ms.workload: identity ms.date: 07/15/2020 ms.author: jmprieur ms.custom: aaddev ms.openlocfilehash: 50de800c94bd0a65fafcff3ef6613d6f063a3797 ms.sourcegitcommit: b33c9ad17598d7e4d66fe11d511daa78b4b8b330 ms.translationtype: HT ms.contentlocale: ja-JP ms.lasthandoff: 08/25/2020 ms.locfileid: "88855486" --- # <a name="protected-web-api-code-configuration"></a>保護された Web API: コード構成 保護された Web API のコードを構成するには、次の点を理解しておく必要があります。 - API を保護対象として定義するもの - ベアラー トークンの構成方法 - トークンの検証方法 ## <a name="what-defines-aspnet-and-aspnet-core-apis-as-protected"></a>ASP.NET と ASP.NET Core の API を保護対象として定義するものとは Web アプリと同じように、ASP.NET と ASP.NET Core の Web API は、そのコントローラー アクションに **[Authorize]** 属性のプレフィックスがあるため、保護されています。 コントローラー アクションは、承認されている ID で API が呼び出された場合にのみ呼び出すことができます。 次の質問について考えてみましょう。 - Web API を呼び出せるのはアプリのみです。 API では、呼び出し元のアプリの ID をどのように認識しますか? - ユーザーの代わりにアプリで API が呼び出される場合、ユーザーの ID は何ですか? ## <a name="bearer-token"></a>ベアラー トークン アプリが呼び出されたときにヘッダーに設定されるベアラー トークンには、アプリ ID に関する情報が保持されます。 また、Web アプリがデーモン アプリからのサービス間の呼び出しを受け入れる場合を除き、ユーザーに関する情報も保持されます。 以下は、.NET 用 Microsoft Authentication Library (MSAL.NET) を使用してトークンを取得した後、API を呼び出すクライアントを示す C# コードの例です。 ```csharp var scopes = new[] {$"api://.../access_as_user"}; var result = await app.AcquireToken(scopes) .ExecuteAsync(); httpClient = new HttpClient(); httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", result.AccessToken); // Call the web API. HttpResponseMessage response = await _httpClient.GetAsync(apiUri); ``` > [!IMPORTANT] > クライアント アプリケーションにより、"*Web API の*" Microsoft ID プラットフォーム エンドポイントにベアラー トークンが要求されます。 Web API は、トークンを検証し、含まれている要求を表示する必要がある唯一のアプリケーションです。 クライアント アプリで、トークンの要求を検査してみることはできません > > 将来、Web API で、トークンの暗号化が要求される可能性があります。 この要件により、アクセス トークンを表示できるクライアント アプリのアクセスが禁止されます。 ## <a name="jwtbearer-configuration"></a>JwtBearer の構成 このセクションでは、ベアラー トークンの構成方法について説明します。 ### <a name="config-file"></a>config ファイル ```Json { "AzureAd": { "Instance": "https://login.microsoftonline.com/", "ClientId": "[Client_id-of-web-api-eg-2ec40e65-ba09-4853-bcde-bcb60029e596]", /* You need specify the TenantId only if you want to accept access tokens from a single tenant (line-of-business app). Otherwise, you can leave them set to common. This can be: - A GUID (Tenant ID = Directory ID) - 'common' (any organization and personal accounts) - 'organizations' (any organization) - 'consumers' (Microsoft personal accounts) */ "TenantId": "common" }, "Logging": { "LogLevel": { "Default": "Warning" } }, "AllowedHosts": "*" } ``` #### <a name="case-where-you-used-a-custom-app-id-uri-for-your-web-api"></a>Web API にカスタム アプリ ID URI を使用したケース アプリ登録ポータルによって提案されたアプリ ID URI を受け入れた場合は、対象ユーザーを指定する必要はありません (「[アプリケーション ID の URI とスコープ](scenario-protected-web-api-app-registration.md#application-id-uri-and-scopes)」を参照してください)。 それ以外の場合は、Web API のアプリ ID URI を値とする `Audience` プロパティを追加する必要があります。 ```Json { "AzureAd": { "Instance": "https://login.microsoftonline.com/", "ClientId": "[Client_id-of-web-api-eg-2ec40e65-ba09-4853-bcde-bcb60029e596]", "TenantId": "common", "Audience": "custom App ID URI for your web API" }, // more lines } ``` ### <a name="code-initialization"></a>コードの初期化 **[Authorize]** 属性を保持するコントローラー アクションでアプリが呼び出されると、ASP.NET と ASP.NET Core により、Authorization ヘッダーのベアラー トークンからアクセス トークンが抽出されます。 その後、アクセス トークンは JwtBearer ミドルウェアに転送され、Microsoft IdentityModel Extensions for .NET が呼び出されます。 #### <a name="using-microsoftidentityweb-templates"></a>Microsoft.Identity.Web テンプレートを使用する Microsoft.Identity.Web プロジェクト テンプレートを使用して、Web API を最初から作成できます。 詳細につ
{ "pile_set_name": "Github" }
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ /* If you are missing that file, acquire a complete release at teeworlds.com. */ #ifndef ENGINE_CLIENT_INPUT_H #define ENGINE_CLIENT_INPUT_H class CInput : public IEngineInput { IEngineGraphics *m_pGraphics; int m_InputGrabbed; int64 m_LastRelease; int64 m_ReleaseDelta; void AddEvent(int Unicode, int Key, int Flags); IEngineGraphics *Graphics() { return m_pGraphics; } public: CInput(); virtual void Init(); virtual void MouseRelative(float *x, float *y); virtual void MouseModeAbsolute(); virtual void MouseModeRelative(); virtual int MouseDoubleClick(); void ClearKeyStates(); int KeyState(int Key); int ButtonPressed(int Button) { return m_aInputState[m_InputCurrent][Button]; } virtual int Update(); }; #endif
{ "pile_set_name": "Github" }
<!DOCTYPE html> html(lang="en") head meta(charset="UTF-8") meta(name="viewport", content="width=device-width, initial-scale=1.0") meta(http-equiv="X-UA-Compatible", content="ie=edge") title Document body h1 Pug
{ "pile_set_name": "Github" }
<?php namespace Ushahidi\App\Http\Controllers\API\Posts; /** * Ushahidi API Posts Revisions Controller * * @author Ushahidi Team <team@ushahidi.com> * @package Ushahidi\Application\Controllers * @copyright 2013 Ushahidi * @license https://www.gnu.org/licenses/agpl-3.0.html GNU Affero General Public License Version 3 (AGPL3) */ class RevisionsController extends PostsController { protected $postType = 'revision'; }
{ "pile_set_name": "Github" }
#ifndef BOOST_MPL_POP_BACK_FWD_HPP_INCLUDED #define BOOST_MPL_POP_BACK_FWD_HPP_INCLUDED // 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) // // See http://www.boost.org/libs/mpl for documentation. // $Id: pop_back_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ // $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $ // $Revision: 49267 $ namespace boost { namespace mpl { template< typename Tag > struct pop_back_impl; template< typename Sequence > struct pop_back; }} #endif // BOOST_MPL_POP_BACK_FWD_HPP_INCLUDED
{ "pile_set_name": "Github" }
15 46 30 82 90 56 17 95 15 48 26 4 58 71 79 92 60 12 21 63 47 19 41 90 85 14 9 52 71 79 16 81 51 95 93 34 10 79 95 61 92 89 88 66 64 92 63 66 64 39 51 27 0 95 12 8 66 47 42 74 69 89 83 66 41 90 78 65 79 90 33 53 29 85 22 33 37 36 68 60 58 36 60 42 42 67 15 16 18 56 79 8 59 61 97 55 81 75 40 90 1 37 35 43 67 12 11 33 93 54 53 26 18 86 70 84 14 31 99 86 30
{ "pile_set_name": "Github" }
(ns prosemirror.commands (:require [prosemirror.core :as pm] ["prosemirror-state" :as state] ["prosemirror-history" :as history] ["prosemirror-commands" :as commands] ["prosemirror-inputrules" :as input-rules] [applied-science.js-interop :as j])) (def chain commands/chainCommands) (def undo history/undo) (def redo history/redo) (def inline-bold (pm/toggle-mark :strong)) (def inline-italic (pm/toggle-mark :em)) (def inline-code (pm/toggle-mark :code)) (def block-list-bullet (pm/wrap-in-list :bullet_list)) (def block-list-ordered (pm/wrap-in-list :ordered_list)) (def block-paragraph (pm/set-block-type :paragraph)) (defn block-heading [i] (pm/set-block-type :heading #js {"level" i})) (def outdent (chain pm/lift-list-item pm/lift)) (def indent (chain pm/sink-list-item block-list-bullet)) (def hard-break (chain commands/exitCode (fn [^js/pm.EditorState state dispatch] (dispatch (->> (j/call (pm/get-node state :hard_break) :create) (.replaceSelectionWith (.-tr state)) (pm/scroll-into-view))) true))) (def newline-in-code commands/newlineInCode) (defn empty-node? [node] (= 0 (j/get-in node [:content :size]))) (defn delete-cursor-node [state dispatch] (let [pos (j/get-in state [:selection :$anchor :pos])] (dispatch (j/call (.-tr state) :.deleteRange (max 0 (dec pos)) (inc pos))))) (def enter (chain pm/split-list-item commands/createParagraphNear commands/liftEmptyBlock commands/splitBlock)) (defn clear-empty-non-paragraph-nodes "If the cursor is in an empty node which is a heading or code-block, convert the node to a paragraph." [state dispatch] (let [node (pm/cursor-node state) $cursor (.-$anchor (.-selection state))] (when (and (#{(pm/get-node state :heading) (pm/get-node state :code_block)} (.-type node)) (or (= 0 (.-size (.-content node))) (= 0 (some-> $cursor (.-parentOffset))))) ((pm/set-block-type :paragraph) state dispatch)))) (def backspace (chain commands/deleteSelection clear-empty-non-paragraph-nodes commands/joinBackward input-rules/undoInputRule)) (def join-up commands/joinUp) (def join-down commands/joinDown) (def select-parent-node commands/selectParentNode) (def select-all commands/selectAll) (def selection-stack (atom '())) (defn clear-selections! [] (reset! selection-stack '())) (defn stack-selection! [n] (when (not= n (first @selection-stack)) (swap! selection-stack conj n))) (defn read-selection! [] (let [n (second @selection-stack)] (swap! selection-stack rest) n)) (defn select-word [state dispatch] ;; TODO ;; implement `select-word` as the first step of `expand-selection` ;; also: select word by default on M1, to match behaviour of code ) (defn expand-selection "Expand selection upwards, by block." [state dispatch] (let [original-selection (.-selection state) had-selected-node? (and (not= (.-from original-selection) (.-to original-selection)) (let [node-selection (.create state/NodeSelection (.-doc state) (.-from original-selection))] (and (= (.-from original-selection) (.-from node-selection)) (= (.-to original-selection) (.-to node-selection)))))] (when (= (.-from original-selection) (.-to original-selection)) (clear-selections!)) (loop [sel original-selection] (let [$from (.-$from sel) to (.-to sel) same (.sharedDepth $from to)] (if (= same 0) (do (stack-selection! 0) (select-all state dispatch)) (let [pos (.before $from same) $pos (.resolve (.-doc state) pos) the-node (.-nodeAfter $pos) node-selection (pm/NodeSelection. $pos)] (if (and (= 1 (.-childCount the-node)) had-selected-node?) (recur node-selection) (when dispatch (stack-selection! pos) (dispatch (.setSelection (.-tr state) node-selection)))))))))) (defn contract-selection [state dispatch] (when dispatch (let [sel (.-selection state)] (if (= (.-from sel) (.-to sel)) (clear-selections!) (dispatch (.setSelection (.-tr state) (if-let [pos (read-selection!)] (pm/NodeSelection. (.resolve (.-doc state) pos)) (.near pm/Selection (.-$anchor sel))))))))) (defn heading->paragraph [state dispatch] (when (pm/is-node-type? state :heading) ((pm/set-block-type :paragraph) state dispatch))) (defn adjust-font-size [f state dispatch] (let [node (pm/cursor-node state)] (when-let [heading-level (condp = (.-type node) (pm/get-node state :paragraph) 4 (pm/get-node state :heading) (let [level (.-level (.-attrs node))] (cond-> level (>= level 4) (inc))) :else nil)] (let [target-index (min (f heading-level) 7)] ((cond (<= target-index 3) (pm/set-block-type :heading #js {:level target-index}) (= target-index 4) (pm/set-block-type :paragraph) :else (pm/set-block-type :heading #js {:level (dec target-index)})) state dispatch))))) (defn clear-stored-marks [state dispatch] (dispatch (reduce (fn [tr mark] (.removeStoredMark tr mark)) (.-tr state) (.. state -selection -$cursor (marks))))) ;;;;;; Input rules ;; TODO: mark input rules, see https://discuss.prosemirror.net/t/input-rules-for-wrapping-marks/537/10 (def rule-blockquote-start (pm/input-rule-wrap-block #"^>\s" :blockquote nil)) (def rule-toggle-code (input-rules/InputRule. #"[^`\\]+`$" (fn [state & _] (pm/toggle-mark-tr state :code)))) (def rule-block-list-bullet-start (pm/input-rule-wrap-block #"^\s*([-+*])\s$" :bullet_list nil)) (def rule-block-list-numbered-start (pm/input-rule-wrap-block #"^(\d+)\.\s$" :ordered_list (fn [match] #js {"order" (second match)}))) (def rule-block-code-start (pm/input-rule-wrap-inline #"^`$" :code_block nil)) (def rule-paragraph-start (pm/input-rule-wrap-inline
{ "pile_set_name": "Github" }
import os from glob import glob import cv2 import numpy as np from tqdm import tqdm def main(): img_size = 96 paths = glob('inputs/data-science-bowl-2018/stage1_train/*') os.makedirs('inputs/dsb2018_%d/images' % img_size, exist_ok=True) os.makedirs('inputs/dsb2018_%d/masks/0' % img_size, exist_ok=True) for i in tqdm(range(len(paths))): path = paths[i] img = cv2.imread(os.path.join(path, 'images', os.path.basename(path) + '.png')) mask = np.zeros((img.shape[0], img.shape[1])) for mask_path in glob(os.path.join(path, 'masks', '*')): mask_ = cv2.imread(mask_path, cv2.IMREAD_GRAYSCALE) > 127 mask[mask_] = 1 if len(img.shape) == 2: img = np.tile(img[..., None], (1, 1, 3)) if img.shape[2] == 4: img = img[..., :3] img = cv2.resize(img, (img_size, img_size)) mask = cv2.resize(mask, (img_size, img_size)) cv2.imwrite(os.path.join('inputs/dsb2018_%d/images' % img_size, os.path.basename(path) + '.png'), img) cv2.imwrite(os.path.join('inputs/dsb2018_%d/masks/0' % img_size, os.path.basename(path) + '.png'), (mask * 255).astype('uint8')) if __name__ == '__main__': main()
{ "pile_set_name": "Github" }
{ "comments": { // symbol used for single line comment. Remove this entry if your language does not support line comments "lineComment": "//", // symbols used for start and end a block comment. Remove this entry if your language does not support block comments "blockComment": [ "/*", "*/" ] }, // symbols used as brackets "brackets": [ [ "{", "}" ], [ "[", "]" ], [ "(", ")" ] ], "autoClosingPairs": [ [ "{", "}" ], [ "[", "]" ], [ "(", ")" ] ] }
{ "pile_set_name": "Github" }
/* * Copyright 2011 The WebRTC Project Authors. All rights reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #include "rtc_base/messagedigest.h" #include <string.h> #include <cstdint> #include <memory> #include "rtc_base/openssldigest.h" #include "rtc_base/stringencode.h" namespace rtc { // From RFC 4572. const char DIGEST_MD5[] = "md5"; const char DIGEST_SHA_1[] = "sha-1"; const char DIGEST_SHA_224[] = "sha-224"; const char DIGEST_SHA_256[] = "sha-256"; const char DIGEST_SHA_384[] = "sha-384"; const char DIGEST_SHA_512[] = "sha-512"; static const size_t kBlockSize = 64; // valid for SHA-256 and down MessageDigest* MessageDigestFactory::Create(const std::string& alg) { MessageDigest* digest = new OpenSSLDigest(alg); if (digest->Size() == 0) { // invalid algorithm delete digest; digest = nullptr; } return digest; } bool IsFips180DigestAlgorithm(const std::string& alg) { // These are the FIPS 180 algorithms. According to RFC 4572 Section 5, // "Self-signed certificates (for which legacy certificates are not a // consideration) MUST use one of the FIPS 180 algorithms (SHA-1, // SHA-224, SHA-256, SHA-384, or SHA-512) as their signature algorithm, // and thus also MUST use it to calculate certificate fingerprints." return alg == DIGEST_SHA_1 || alg == DIGEST_SHA_224 || alg == DIGEST_SHA_256 || alg == DIGEST_SHA_384 || alg == DIGEST_SHA_512; } size_t ComputeDigest(MessageDigest* digest, const void* input, size_t in_len, void* output, size_t out_len) { digest->Update(input, in_len); return digest->Finish(output, out_len); } size_t ComputeDigest(const std::string& alg, const void* input, size_t in_len, void* output, size_t out_len) { std::unique_ptr<MessageDigest> digest(MessageDigestFactory::Create(alg)); return (digest) ? ComputeDigest(digest.get(), input, in_len, output, out_len) : 0; } std::string ComputeDigest(MessageDigest* digest, const std::string& input) { std::unique_ptr<char[]> output(new char[digest->Size()]); ComputeDigest(digest, input.data(), input.size(), output.get(), digest->Size()); return hex_encode(output.get(), digest->Size()); } bool ComputeDigest(const std::string& alg, const std::string& input, std::string* output) { std::unique_ptr<MessageDigest> digest(MessageDigestFactory::Create(alg)); if (!digest) { return false; } *output = ComputeDigest(digest.get(), input); return true; } std::string ComputeDigest(const std::string& alg, const std::string& input) { std::string output; ComputeDigest(alg, input, &output); return output; } // Compute a RFC 2104 HMAC: H(K XOR opad, H(K XOR ipad, text)) size_t ComputeHmac(MessageDigest* digest, const void* key, size_t key_len, const void* input, size_t in_len, void* output, size_t out_len) { // We only handle algorithms with a 64-byte blocksize. // TODO: Add BlockSize() method to MessageDigest. size_t block_len = kBlockSize; if (digest->Size() > 32) { return 0; } // Copy the key to a block-sized buffer to simplify padding. // If the key is longer than a block, hash it and use the result instead. std::unique_ptr<uint8_t[]> new_key(new uint8_t[block_len]); if (key_len > block_len) { ComputeDigest(digest, key, key_len, new_key.get(), block_len); memset(new_key.get() + digest->Size(), 0, block_len - digest->Size()); } else { memcpy(new_key.get(), key, key_len); memset(new_key.get() + key_len, 0, block_len - key_len); } // Set up the padding from the key, salting appropriately for each padding. std::unique_ptr<uint8_t[]> o_pad(new uint8_t[block_len]); std::unique_ptr<uint8_t[]> i_pad(new uint8_t[block_len]); for (size_t i = 0; i < block_len; ++i) { o_pad[i] = 0x5c ^ new_key[i]; i_pad[i] = 0x36 ^ new_key[i]; } // Inner hash; hash the inner padding, and then the input buffer. std::unique_ptr<uint8_t[]> inner(new uint8_t[digest->Size()]); digest->Update(i_pad.get(), block_len); digest->Update(input, in_len); digest->Finish(inner.get(), digest->Size()); // Outer hash; hash the outer padding, and then the result of the inner hash. digest->Update(o_pad.get(), block_len); digest->Update(inner.get(), digest->Size()); return digest->Finish(output, out_len); } size_t ComputeHmac(const std::string& alg, const void* key, size_t key_len, const void* input, size_t in_len, void* output, size_t out_len) { std::unique_ptr<MessageDigest> digest(MessageDigestFactory::Create(alg)); if (!digest) { return 0; } return ComputeHmac(digest.get(), key, key_len, input, in_len, output, out_len); } std::string ComputeHmac(MessageDigest* digest, const std::string& key, const std::string& input) { std::unique_ptr<char[]> output(new char[digest->Size()]); ComputeHmac(digest, key.data(), key.size(), input.data(), input.size(), output.get(), digest->Size()); return hex_encode(output.get(), digest->Size()); } bool ComputeHmac(const std::string& alg, const std::string& key, const std::string& input, std::string* output) { std::unique_ptr<MessageDigest> digest(MessageDigestFactory::Create(alg)); if (!digest) { return false; } *output = ComputeHmac(digest.get(), key, input); return true; } std::string ComputeHmac(const std::string& alg, const std::string& key, const std::string& input) { std::string output; ComputeHmac(alg, key, input, &output); return output; } } // namespace rtc
{ "pile_set_name": "Github" }
<?php /* * This file is part of Respect/Validation. * * (c) Alexandre Gomes Gaigalas <alexandre@gaigalas.net> * * For the full copyright and license information, please view the LICENSE file * that was distributed with this source code. */ declare(strict_types=1); namespace Respect\Validation\Rules; use Respect\Validation\Test\RuleTestCase; use stdClass; /** * @group rule * * @covers \Respect\Validation\Rules\StringType * * @author Alexandre Gomes Gaigalas <alexandre@gaigalas.net> * @author Gabriel Caruso <carusogabriel34@gmail.com> * @author Henrique Moody <henriquemoody@gmail.com> * @author Marcel dos Santos <marcelgsantos@gmail.com> */ final class StringTypeTest extends RuleTestCase { /** * {@inheritDoc} */ public function providerForValidInput(): array { $rule = new StringType(); return [ [$rule, ''], [$rule, '165.7'], ]; } /** * {@inheritDoc} */ public function providerForInvalidInput(): array { $rule = new StringType(); return [ [$rule, null], [$rule, []], [$rule, new stdClass()], [$rule, 150], ]; } }
{ "pile_set_name": "Github" }
var convert = require('./convert'), func = convert('curryRight', require('../curryRight')); func.placeholder = require('./placeholder'); module.exports = func;
{ "pile_set_name": "Github" }
/* Copyright (C) 2003-2008 Fons Adriaensen <fons@kokkinizita.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ //----------------------------------------------------------------------------------- // Common definitions #include "cs_chorus.h" #define NMODS 3 #define VERSION "0.4.0" static const char* maker = "Fons Adriaensen <fons@kokkinizita.net>"; static const char* copyr = "(C) 2003-2008 Fons Adriaensen - License: GPL2"; static void pconnect(LADSPA_Handle H, unsigned long port, LADSPA_Data* data) { ((LadspaPlugin*)H)->setport(port, data); } static void activate(LADSPA_Handle H) { ((LadspaPlugin*)H)->active(true); } static void runplugin(LADSPA_Handle H, unsigned long k) { ((LadspaPlugin*)H)->runproc(k, false); } static void runadding(LADSPA_Handle H, unsigned long k) { ((LadspaPlugin*)H)->runproc(k, true); } static void setadding(LADSPA_Handle H, LADSPA_Data gain) { ((LadspaPlugin*)H)->setgain(gain); } static void deactivate(LADSPA_Handle H) { ((LadspaPlugin*)H)->active(false); } static void cleanup(LADSPA_Handle H) { delete (LadspaPlugin*)H; } //----------------------------------------------------------------------------------- // Plugin definitions static const char* name1 = "Chorus1 - Based on CSound orchestra by Sean Costello"; static const char* label1 = "Chorus1"; static LADSPA_Handle instant1(const struct _LADSPA_Descriptor* desc, unsigned long rate) { return new Ladspa_CS_chorus1(rate); } static const char* name2 = "Chorus2 - Based on CSound orchestra by Sean Costello"; static const char* label2 = "Chorus2"; static LADSPA_Handle instant2(const struct _LADSPA_Descriptor* desc, unsigned long rate) { return new Ladspa_CS_chorus2(rate); } static const char* name3 = "Triple chorus"; static const char* label3 = "TripleChorus"; static LADSPA_Handle instant3(const struct _LADSPA_Descriptor* desc, unsigned long rate) { return new Ladspa_CS_chorus3(rate); } static const LADSPA_PortDescriptor pdesc12[Ladspa_CS_chorus1::NPORT] = { LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO, LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO, LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL }; static const char* const pname12[Ladspa_CS_chorus1::NPORT] = { "Input", "Output", "Delay (ms)", "Mod Frequency 1 (Hz)", "Mod Amplitude 1 (ms)", "Mod Frequency 2 (Hz)", "Mod Amplitude 2 (ms)" }; static const LADSPA_PortRangeHint phint12[Ladspa_CS_chorus1::NPORT] = { { 0, 0, 0 }, { 0, 0, 0 }, { LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0, 0, 30 }, { LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_LOGARITHMIC, 0.003, 10 }, { LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0, 0, 10 }, { LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_LOGARITHMIC, 0.01, 30 }, { LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0, 0, 3 } }; static const LADSPA_PortDescriptor pdesc3[Ladspa_CS_chorus3::NPORT] = { LADSPA_PORT_INPUT | LADSPA_PORT_AUDIO, LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO, LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO, LADSPA_PORT_OUTPUT | LADSPA_PORT_AUDIO, LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL, LADSPA_PORT_INPUT | LADSPA_PORT_CONTROL }; static const char* const pname3[Ladspa_CS_chorus3::NPORT] = { "Input", "Output1", "Output2", "Output3", "Delay (ms)", "Mod Frequency 1 (Hz)", "Mod Amplitude 1 (ms)", "Mod Frequency 2 (Hz)", "Mod Amplitude 2 (ms)" }; static const LADSPA_PortRangeHint phint3[Ladspa_CS_chorus3::NPORT] = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0, 0, 30 }, { LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_LOGARITHMIC, 0.003, 10 }, { LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0, 0, 10 }, { LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_LOGARITHMIC, 0.01, 30 }, { LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_0, 0, 3 } }; static const LADSPA_Descriptor moddescr[NMODS] = { {
{ "pile_set_name": "Github" }
--- kind: Template apiVersion: v1 metadata: annotations: iconClass: icon-jboss tags: rhdm,decisionserver,jboss,kieserver version: "7.6" openshift.io/display-name: Red Hat Decision Manager 7.6 managed KIE Server openshift.io/provider-display-name: Red Hat, Inc. description: Application template for a managed KIE Server, for Red Hat Decision Manager 7.6 - Deprecated template.openshift.io/long-description: This template defines resources needed to execute Rules on Red Hat Decision Manager KIE server 7.6, including application deployment configuration, secure and insecure http communication. Template for Red Hat OpenShift Container Platform version 3.11. Deprecated since Red Hat Decision Manager version 7.5; consider using the Red Hat Business Automation Operator. template.openshift.io/documentation-url: https://access.redhat.com/documentation/en-us/red_hat_decision_manager/7.6/html/deploying_a_red_hat_decision_manager_7.6_managed_server_environment_on_red_hat_openshift_container_platform/ template.openshift.io/support-url: https://access.redhat.com template.openshift.io/bindable: "false" name: rhdm76-kieserver labels: template: rhdm76-kieserver rhdm: "7.6" message: |- A new Decision Manager KIE server application has been created in your project. The user name/password for accessing the KIE server User name: ${KIE_SERVER_USER} Password: ${KIE_SERVER_PWD} Please be sure to create the secret named "${KIE_SERVER_HTTPS_SECRET}" containing the ${KIE_SERVER_HTTPS_KEYSTORE} file used for serving secure content. parameters: - displayName: Application Name description: The name for the application. name: APPLICATION_NAME value: myapp required: true - displayName: Maven mirror URL description: Maven mirror that KIE server must use. If you configure a mirror, this mirror must contain all artifacts that are required for deploying your services. name: MAVEN_MIRROR_URL required: false - displayName: Maven mirror of description: Maven mirror configuration for KIE server. name: MAVEN_MIRROR_OF value: "external:*" required: false - displayName: Maven repository ID description: "The id to use for the maven repository. If set, it can be excluded from the optionally configured mirror by adding it to MAVEN_MIRROR_OF. For example: external:*,!repo-rhdmcentr,!repo-custom. If MAVEN_MIRROR_URL is set but MAVEN_MIRROR_ID is not set, an id will be generated randomly, but won't be usable in MAVEN_MIRROR_OF." name: MAVEN_REPO_ID value: repo-custom required: false - displayName: Maven repository URL description: Fully qualified URL to a Maven repository or service. name: MAVEN_REPO_URL example: http://nexus.nexus-project.svc.cluster.local:8081/nexus/content/groups/public/ required: true - displayName: Maven repository user name description: User name for accessing the Maven repository, if required. name: MAVEN_REPO_USERNAME required: false - displayName: Maven repository password description: Password to access the Maven repository, if required. name: MAVEN_REPO_PASSWORD required: false - displayName: Name of the Decision Central service description: The Service name for the optional Decision Central, where it can be reached, to allow service lookups (for example, maven repo usage), if required. name: DECISION_CENTRAL_SERVICE example: "myapp-rhdmcentr" required: false - displayName: User name for the Maven service hosted by Decision Central description: User name for accessing the Maven service hosted by Decision Central inside EAP. name: DECISION_CENTRAL_MAVEN_USERNAME example: "mavenUser" required: false - displayName: Password for the Maven service hosted by Decision Central description: Password to access the Maven service hosted by Decision Central inside EAP. name: DECISION_CENTRAL_MAVEN_PASSWORD example: "maven1!" required: false - displayName: KIE Admin User description: KIE administrator user name. name: KIE_ADMIN_USER value: adminUser required: false - displayName: KIE Admin Password description: KIE administrator password. name: KIE_ADMIN_PWD from: "[a-zA-Z]{6}[0-9]{1}!" generate: expression required: false - displayName: KIE Server User description: KIE server user name. (Sets the org.kie.server.user system property) name: KIE_SERVER_USER value: executionUser required: false - displayName: KIE Server Password description: KIE server password. (Sets the org.kie.server.pwd system property) name: KIE_SERVER_PWD from: "[a-zA-Z]{6}[0-9]{1}!" generate: expression required: false - displayName: ImageStream Namespace description: Namespace in which the ImageStreams for Red Hat Decision Manager images are installed. These ImageStreams are normally installed in the openshift namespace. You should only need to modify this if you installed the ImageStreams in a different namespace/project. name: IMAGE_STREAM_NAMESPACE value: openshift required: true - displayName: KIE Server ImageStream Name description: The name of the image stream to use for KIE server. Default is "rhdm-kieserver-rhel8". name: KIE_SERVER_IMAGE_STREAM_NAME value: "rhdm-kieserver-rhel8" required: true - displayName: ImageStream Tag description: A named pointer to an image in an image stream. Default is "7.6.0". name: IMAGE_STREAM_TAG value: "7.6.0" required: true - displayName: KIE Server Mode description: "The KIE Server mode. Valid values are 'DEVELOPMENT' or 'PRODUCTION'. In production mode, you can not deploy SNAPSHOT versions of artifacts on the KIE server and can not change the version of an artifact in an existing container. (Sets the org.kie.server.mode system property)." name: KIE_SERVER_MODE value: "PRODUCTION" required: false - displayName: KIE MBeans description: KIE server mbeans enabled/disabled. (Sets the kie.mbeans and kie.scanner.mbeans system properties) name: KIE_MBEANS value: enabled required: false - displayName: Drools Server Filter Classes description: KIE server class filtering. (Sets the org.drools.server.filter.classes system property) name: DROOLS_SERVER_FILTER_CLASSES value: 'true' required: false - displayName: Prometheus Server Extension Disabled description: If set to false, the prometheus server extension will be enabled. (Sets the org.kie.prometheus.server.ext.disabled system property) name: PROMETHEUS_SERVER_EXT_DISABLED example: 'false' required: false - displayName: KIE Server Custom http Route Hostname description: 'Custom hostname for http service route. Leave blank for default hostname, e.g.: insecure-<application-name>-kieserver-<project>.<default-domain-suffix>' name: KIE_SERVER_HOSTNAME_HTTP value: '' required: false - displayName: KIE Server Custom https Route Hostname description: 'Custom hostname for https service route. Leave blank for default hostname, e.g.: <application-name>-kieserver-<project>.<default-domain-suffix>' name: KIE_SERVER_HOSTNAME_HTTPS value: '' required: false
{ "pile_set_name": "Github" }
/* * Copyright 2019. Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.apps.playgames.simpleengine; public class ShaderSource { private static final String COMMON_DECLS = "precision mediump float; \n" + "uniform mat4 u_Matrix; \n" + "uniform vec4 u_Color; \n" + "uniform float u_TintFactor; \n" + "uniform sampler2D u_Sampler; \n " + "varying vec4 v_Color; \n" + "varying vec2 v_TexCoord; \n"; public static final String VERTEX_SHADER = COMMON_DECLS + "attribute vec4 a_Position; \n" + "attribute vec2 a_TexCoord; \n" + "void main() \n" + "{ \n" + " v_Color = u_Color; \n" + " v_TexCoord = a_TexCoord; \n" + " gl_Position = u_Matrix * a_Position; \n" + "} \n"; public static final String FRAG_SHADER = COMMON_DECLS + "void main() \n" + "{ \n" + " vec4 c = mix(texture2D(u_Sampler, v_TexCoord), u_Color, u_TintFactor);\n" + " gl_FragColor = c;\n" + "}\n"; }
{ "pile_set_name": "Github" }
![DynamicColor](http://yannickloriot.com/resources/dynamiccolor-header.png) [![Supported Plateforms](https://cocoapod-badges.herokuapp.com/p/DynamicColor/badge.svg)](http://cocoadocs.org/docsets/DynamicColor/) [![Version](https://cocoapod-badges.herokuapp.com/v/DynamicColor/badge.svg)](http://cocoadocs.org/docsets/DynamicColor/) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Build Status](https://travis-ci.org/yannickl/DynamicColor.png?branch=master)](https://travis-ci.org/yannickl/DynamicColor) DynamicColor provides powerful methods to manipulate colours in an easy way. <p align="center"> <img src="http://yannickloriot.com/resources/dynamiccolor-sample-screenshot.png" alt="example screenshot" width="300" /> </p> ## Usage #### Darken & Lighten These two create a new color by adjusting the lightness of the receiver. You have to use a value between 0 and 1. <p align="center"> <img src="http://yannickloriot.com/resources/dynamiccolor-darkenlighten.png" alt="lighten and darken color" width="280"/> </p> ```swift let originalColor = UIColor(hex: 0xc0392b) let lighterColor = originalColor.lighterColor() // equivalent to // lighterColor = originalColor.lightenColor(0.2) let darkerColor = originalColor.darkerColor() // equivalent to // darkerColor = originalColor.darkenColor(0.2) ``` #### Saturate, Desaturate & Grayscale These will adjust the saturation of the color object, much like `darkenColor` and `lightenColor` adjusted the lightness. Again, you need to use a value between 0 and 1. <p align="center"> <img src="http://yannickloriot.com/resources/dynamiccolor-saturateddesaturatedgrayscale.png" alt="saturate, desaturate and grayscale color" width="373"/> </p> ```swift let originalColor = UIColor(hex: 0xc0392b) let saturatedColor = originalColor.saturatedColor() // equivalent to // saturatedColor = originalColor.saturateColor(0.2) let desaturatedColor = originalColor.desaturatedColor() // equivalent to // desaturatedColor = originalColor.desaturateColor(0.2) let grayscaleColor = originalColor.grayscaledColor() ``` #### Adjust-hue & Complement These adjust the hue value of the color in the same way like the others do. Again, it takes a value between 0 and 1 to update the value. <p align="center"> <img src="http://yannickloriot.com/resources/dynamiccolor-adjustedhuecomplement.png" alt="ajusted-hue and complement color" width="280"/> </p> ```swift let originalColor = UIColor(hex: 0xc0392b) let adjustHueColor = originalColor.adjustedHueColor(45 / 360) let complementColor = originalColor.complementColor() ```` #### Tint & Shade A tint is the mixture of a color with white and a shade is the mixture of a color with black. Again, it takes a value between 0 and 1 to update the value. <p align="center"> <img src="http://yannickloriot.com/resources/dynamiccolor-tintshadecolor.png" alt="tint and shade color" width="280"/> </p> ```swift let originalColor = UIColor(hex: 0xc0392b) let tintColor = originalColor.tintColor() // equivalent to // tintColor = originalColor.tintColor(amount: 0.2) let shadeColor = originalColor.shadeColor() // equivalent to // shadeColor = originalColor.shadeColor(amount: 0.2) ``` #### Invert This can invert the color object. The red, green, and blue values are inverted, while the opacity is left alone. <p align="center"> <img src="http://yannickloriot.com/resources/dynamiccolor-invert.png" alt="invert color" width="187"/> </p> ```swift let originalColor = UIColor(hex: 0xc0392b) let invertColor = originalColor.invertColor() ``` #### Mix This can mix a given color with the receiver. It takes the average of each of the RGB components, optionally weighted by the given percentage (value between 0 and 1). <p align="center"> <img src="http://yannickloriot.com/resources/dynamiccolor-mixcolor.png" alt="mix color" width="373"/> </p> ```swift let originalColor = UIColor(hex: 0xc0392b) let mixColor = originalColor.mixWithColor(UIColor.blueColor()) // equivalent to // mixColor = originalColor.mixWithColor(UIColor.blueColor(), weight: 0.5) ``` #### And many more... `DynamicColor` also provides many another useful methods to manipulate the colors like hex strings, color components, etc. To go further, take a look at the example project. ## Installation #### CocoaPods Install CocoaPods if not already available: ``` bash $ [sudo] gem install cocoapods $ pod setup ``` Go to the directory of your Xcode project, and Create and Edit your Podfile and add _DynamicColor_: ``` bash $ cd /path/to/MyProject $ touch Podfile $ edit Podfile source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks! pod 'DynamicColor', '~> 1.5.4' ``` Install into your project: ``` bash $ pod install ``` Open your project in Xcode from the .xcworkspace file (not the usual project file): ``` bash $ open MyProject.xcworkspace ``` You can now `import DynamicColor` framework into your files. #### Carthage [Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application. You can install Carthage with [Homebrew](http://brew.sh/) using the following command: ```bash $ brew update $ brew install carthage ``` To integrate `DynamicColor` into your Xcode project using Carthage, specify it in your `Cartfile` file: ```ogdl github "yannickl/DynamicColor" >= 1.5.4 ``` #### Manually [Download](https://github.com/YannickL/DynamicColor/archive/master.zip) the project and copy the `DynamicColor` folder into your project to use it in. ## Contact Yannick Loriot - [https://twitter.com/yannickloriot](https://twitter.com/yannickloriot) - [contact@yannickloriot.com](mailto:contact@yannickloriot.com) ## License (MIT) Copyright (c) 2015-present - Yannick Loriot 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
{ "pile_set_name": "Github" }
/* Copyright (C) 2006 StrmnNrmn This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #pragma once #ifndef DYNAREC_ASSEMBLYUTILS_H_ #define DYNAREC_ASSEMBLYUTILS_H_ #include <stdlib.h> #include "Base/Types.h" class CCodeLabel { public: CCodeLabel () : mpLocation( nullptr ) {} explicit CCodeLabel( const void * p_location ) : mpLocation( p_location ) { } bool IsSet() const { return mpLocation != nullptr; } const void * GetTarget() const { return mpLocation; } const u8 * GetTargetU8P() const { return reinterpret_cast< const u8 * >( mpLocation ); } private: const void * mpLocation; // This is the location of an arbitrary block of code }; class CJumpLocation { public: CJumpLocation () : mpLocation( nullptr ) {} explicit CJumpLocation( void * p_location ) : mpLocation( p_location ) { } bool IsSet() const { return mpLocation != nullptr; } s32 GetOffset( const CCodeLabel & label ) const { return label.GetTargetU8P() - GetTargetU8P(); } const u8 * GetTargetU8P() const { return reinterpret_cast< const u8 * >( mpLocation ); } u8 * GetWritableU8P() const { //Todo: PSP return reinterpret_cast< u8 * >( MAKE_UNCACHED_PTR(mpLocation) ); //Todo: Check this //return reinterpret_cast< u8 * >( mpLocation ); } private: void * mpLocation; // This is the location of a jump instruction }; namespace AssemblyUtils { bool PatchJumpLong( CJumpLocation jump, CCodeLabel target ); bool PatchJumpLongAndFlush( CJumpLocation jump, CCodeLabel target ); void ReplaceBranchWithJump( CJumpLocation branch, CCodeLabel target ); } #endif // DYNAREC_ASSEMBLYUTILS_H_
{ "pile_set_name": "Github" }
#ifndef BOOST_METAPARSE_V1_STRING_TAG_HPP #define BOOST_METAPARSE_V1_STRING_TAG_HPP // Copyright Abel Sinkovics (abel@sinkovics.hu) 2013. // 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) namespace boost { namespace metaparse { namespace v1 { struct string_tag { typedef string_tag type; }; } } } #endif
{ "pile_set_name": "Github" }
/* Copyright (c) 2012, Broadcom Europe Ltd 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 copyright holder 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 HOLDER 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. */ /** \file * MMAL test application which plays back video files * Note: this is test code. Do not use this in your app. It *will* change or even be removed without notice. */ #include <memory.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #include <stdarg.h> #include "mmalplay.h" VCOS_LOG_CAT_T mmalplay_log_category; #include "interface/mmal/mmal_logging.h" #include "interface/mmal/util/mmal_util.h" #include "interface/mmal/util/mmal_connection.h" #include "interface/mmal/util/mmal_util_params.h" #include "interface/mmal/util/mmal_default_components.h" #define MMALPLAY_STILL_IMAGE_PAUSE 2000 #define MMALPLAY_MAX_STRING 128 #define MMALPLAY_MAX_CONNECTIONS 16 #define MMALPLAY_MAX_RENDERERS 3 static unsigned int video_render_num; /** Structure describing a mmal component */ typedef struct { struct MMALPLAY_T *ctx; MMAL_COMPONENT_T *comp; /* Used for debug / statistics */ char name[MMALPLAY_MAX_STRING]; int64_t time_setup; int64_t time_cleanup; } MMALPLAY_COMPONENT_T; /** Context for a mmalplay playback instance */ struct MMALPLAY_T { const char *uri; VCOS_SEMAPHORE_T event; unsigned int component_num; MMALPLAY_COMPONENT_T component[MMALPLAY_MAX_CONNECTIONS*2]; unsigned int connection_num; MMAL_CONNECTION_T *connection[MMALPLAY_MAX_CONNECTIONS]; MMAL_STATUS_T status; unsigned int stop; MMAL_BOOL_T is_still_image; MMAL_PORT_T *reader_video; MMAL_PORT_T *reader_audio; MMAL_PORT_T *video_out_port; MMAL_PORT_T *converter_out_port; MMAL_PORT_T *audio_clock; MMAL_PORT_T *video_clock; MMALPLAY_OPTIONS_T options; /* Used for debug / statistics */ int64_t time_playback; unsigned int decoded_frames; }; typedef struct MMALPLAY_CONNECTIONS_T { unsigned int num; struct { MMAL_PORT_T *in; MMAL_PORT_T *out; uint32_t flags; } connection[MMALPLAY_MAX_CONNECTIONS+1]; } MMALPLAY_CONNECTIONS_T; #define MMALPLAY_CONNECTION_IN(cx) (cx)->connection[(cx)->num].in #define MMALPLAY_CONNECTION_OUT(cx) (cx)->connection[(cx)->num].out #define MMALPLAY_CONNECTION_ADD(cx) if (++(cx)->num > MMALPLAY_MAX_CONNECTIONS) goto error #define MMALPLAY_CONNECTION_SET(cx, f) do { (cx)->connection[(cx)->num].flags |= (f); } while(0) static MMAL_COMPONENT_T *mmalplay_component_create(MMALPLAY_T *ctx, const char *name, MMAL_STATUS_T *status); static MMAL_STATUS_T mmalplay_connection_create(MMALPLAY_T *ctx, MMAL_PORT_T *out, MMAL_PORT_T *in, uint32_t flags); /* Utility function to setup the container reader component */ static MMAL_STATUS_T mmalplay_setup_container_reader(MMALPLAY_T *, MMAL_COMPONENT_T *, const char *uri); /* Utility function to setup the container writer component */ static MMAL_STATUS_T mmalplay_setup_container_writer(MMALPLAY_T *, MMAL_COMPONENT_T *, const char *uri); /* Utility function to setup the video decoder component */ static MMAL_STATUS_T mmalplay_setup_video_decoder(MMALPLAY_T *ctx, MMAL_COMPONENT_T *); /* Utility function to setup the splitter component */ static MMAL_STATUS_T mmalplay_setup_splitter(MMALPLAY_T *ctx, MMAL_COMPONENT_T *); /* Utility function to setup the video converter component */ static MMAL_STATUS_T mmalplay_setup_video_converter(MMALPLAY_T *ctx, MMAL_COMPONENT_T *); /* Utility function to setup the video render component */ static MMAL_STATUS_T mmalplay_setup_video_render(MMALPLAY_T *ctx, MMAL_COMPONENT_T *); /* Utility function to setup the video scheduler component */ static MMAL_STATUS_T mmalplay_setup_video_scheduler(MMALPLAY_T *ctx, MMAL_COMPONENT_T *); /* Utility function to setup the audio decoder component */ static MMAL_STATUS_T mmalplay_setup_audio_decoder(MMALPLAY_T *ctx, MMAL_COMPONENT_T *); /* Utility function to setup the audio render component */ static MMAL_STATUS_T mmalplay_setup_audio_render(MMALPLAY_T *ctx, MMAL_COMPONENT_T *); static void log_format(MMAL_ES_FORMAT_T *format, MMAL_PORT_T *port); /*****************************************************************************/ /** Callback from a control port. Error and EOS events stop playback. */ static void mmalplay_bh_control_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) { MMALPLAY_T *ctx = (MMALPLAY_T *)port->userdata; LOG_TRACE("%s(%p),%p,%4.4s", port->name, port, buffer, (char *)&buffer->cmd); if (buffer->cmd == MMAL_EVENT_ERROR || buffer->cmd == MMAL_EVENT_EOS) { if (buffer->cmd == MMAL_EVENT_ERROR) { LOG_INFO("error event from %s: %s", port->name, mmal_status_to_string(*(MMAL_STATUS_T*)buffer->data)); ctx->status = *(MMAL_STATUS_T *)buffer->data; } else if (buffer->cmd == MMAL_EVENT_EOS) LOG_INFO("%s: EOS received", port->name); mmalplay_stop(ctx); } mmal_buffer_header_release(buffer); } /** Callback from the connection. Buffer is available. */ static void mmalplay_connection_cb(MMAL_CONNECTION_T *connection) { MMALPLAY_T *ctx = (MMALPLAY_T *)connection->user_data;
{ "pile_set_name": "Github" }
0.preset.3=eNrTNbQO8ffSNgvQDkksSk8tsTazNgDDtMSc4lQoaW1oam1obWYAlTI2sDY0BAqUFJWmYiUguiwNrE1RjEEmweoMDTBswlRpgKzDzAAATE06Sg== 0.preset.2=eNrTNbT2K83JKcjPzczL13bMydEOLsjMszazNgDDtMSc4lQoaW1oam1obWYAlTI2sDY0tDayLikqTcVKQHQZWhhYm6KYAyER6gwNgCYha8Gi2gAsDwAI4zoF 0.preset.1=eNrTNbR2yslPzk7Kr7A2szYAw7TEnOJUKGltaGptaG1mAJUyNrA2NATSJUWlqSjqMEldQ2tTLMJIOg0NgKah2oapHuocAJ0hN9M\= 0.preset.0=eNrTNbQO8feyNrM2AMO0xJziVChpbWhqbWhtZgCVMjawNjQECpQUlaZiJSC6DC0MrE1RzIGQCHWGBhg2YSo3AKsFADK1NAU\=
{ "pile_set_name": "Github" }
#!/usr/bin/env python from __future__ import division, print_function import os def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('matrixlib', parent_package, top_path) config.add_data_dir('tests') return config if __name__ == "__main__": from numpy.distutils.core import setup config = configuration(top_path='').todict() setup(**config)
{ "pile_set_name": "Github" }
- hosts: localhost roles: - role: create-afs-token # CentOS - role: release-afs-volume afs_volume: mirror.wheel.cent7x64 - role: release-afs-volume afs_volume: mirror.wheel.cent8x64 - role: release-afs-volume afs_volume: mirror.wheel.cent8a64 # Debian - role: release-afs-volume afs_volume: mirror.wheel.busterx64 - role: release-afs-volume afs_volume: mirror.wheel.bustera64 # Ubuntu - role: release-afs-volume afs_volume: mirror.wheel.xenialx64 - role: release-afs-volume afs_volume: mirror.wheel.xeniala64 - role: release-afs-volume afs_volume: mirror.wheel.bionicx64 - role: release-afs-volume afs_volume: mirror.wheel.bionica64 - role: release-afs-volume afs_volume: mirror.wheel.focalx64 - role: release-afs-volume afs_volume: mirror.wheel.focala64 # Fin - role: destroy-afs-token
{ "pile_set_name": "Github" }
/* * Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc. * * This file is part of Jam - see jam.c for Copyright information. */ #ifndef JAM_BUILTINS_H # define JAM_BUILTINS_H # include "frames.h" /* * builtins.h - compile parsed jam statements */ void load_builtins(); void init_set(); void init_path(); void init_regex(); void init_property_set(); void init_sequence(); void init_order(); LIST *builtin_calc( PARSE *parse, FRAME *args ); LIST *builtin_depends( PARSE *parse, FRAME *args ); LIST *builtin_rebuilds( PARSE *parse, FRAME *args ); LIST *builtin_echo( PARSE *parse, FRAME *args ); LIST *builtin_exit( PARSE *parse, FRAME *args ); LIST *builtin_flags( PARSE *parse, FRAME *args ); LIST *builtin_glob( PARSE *parse, FRAME *args ); LIST *builtin_glob_recursive( PARSE *parse, FRAME *frame ); LIST *builtin_subst( PARSE *parse, FRAME *args ); LIST *builtin_match( PARSE *parse, FRAME *args ); LIST *builtin_split_by_characters( PARSE *parse, FRAME *args ); LIST *builtin_hdrmacro( PARSE *parse, FRAME *args ); LIST *builtin_rulenames( PARSE *parse, FRAME *args ); LIST *builtin_varnames( PARSE *parse, FRAME *args ); LIST *builtin_delete_module( PARSE *parse, FRAME *args ); LIST *builtin_import( PARSE *parse, FRAME *args ); LIST *builtin_export( PARSE *parse, FRAME *args ); LIST *builtin_caller_module( PARSE *parse, FRAME *args ); LIST *builtin_backtrace( PARSE *parse, FRAME *args ); LIST *builtin_pwd( PARSE *parse, FRAME *args ); LIST *builtin_update( PARSE *parse, FRAME *args ); LIST *builtin_update_now( PARSE *parse, FRAME *args ); LIST *builtin_search_for_target( PARSE *parse, FRAME *args ); LIST *builtin_import_module( PARSE *parse, FRAME *args ); LIST *builtin_imported_modules( PARSE *parse, FRAME *frame ); LIST *builtin_instance( PARSE *parse, FRAME *frame ); LIST *builtin_sort( PARSE *parse, FRAME *frame ); LIST *builtin_normalize_path( PARSE *parse, FRAME *frame ); LIST *builtin_native_rule( PARSE *parse, FRAME *frame ); LIST *builtin_has_native_rule( PARSE *parse, FRAME *frame ); LIST *builtin_user_module( PARSE *parse, FRAME *frame ); LIST *builtin_nearest_user_location( PARSE *parse, FRAME *frame ); LIST *builtin_check_if_file( PARSE *parse, FRAME *frame ); LIST *builtin_python_import_rule( PARSE *parse, FRAME *frame ); LIST *builtin_shell( PARSE *parse, FRAME *frame ); LIST *builtin_md5( PARSE *parse, FRAME *frame ); LIST *builtin_file_open( PARSE *parse, FRAME *frame ); LIST *builtin_pad( PARSE *parse, FRAME *frame ); LIST *builtin_precious( PARSE *parse, FRAME *frame ); LIST *builtin_self_path( PARSE *parse, FRAME *frame ); LIST *builtin_makedir( PARSE *parse, FRAME *frame ); void backtrace( FRAME *frame ); extern int last_update_now_status; #endif
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Author</key> <string>Lectorius, Inc.</string> <key>Builder Version</key> <string>534.57.2</string> <key>CFBundleDisplayName</key> <string>Mitro Helpers Test</string> <key>CFBundleIdentifier</key> <string>com.mitro.helperstest</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleShortVersionString</key> <string>0.9.1</string> <key>CFBundleVersion</key> <string>1</string> <key>Chrome</key> <dict> <key>Database Quota</key> <real>52428800</real> <key>Global Page</key> <string>background.html</string> <key>Popovers</key> <array> <dict> <key>Filename</key> <string>html/popup.html</string> <key>Height</key> <real>400</real> <key>Identifier</key> <string>Popup</string> <key>Width</key> <real>600</real> </dict> </array> <key>Toolbar Items</key> <array> <dict> <key>Identifier</key> <string>mitro-button</string> <key>Image</key> <string>blank.png</string> <key>Label</key> <string>Button</string> <key>Popover</key> <string>Popup</string> </dict> </array> </dict> <key>Content</key> <dict> <key>Blacklist</key> <array> <string>http://selenium.mitro.co/*</string> <string>safari-extension://*/*</string> </array> <key>Scripts</key> <dict> <key>Start</key> <array /> </dict> </dict> <key>ExtensionInfoDictionaryVersion</key> <string>1.0</string> <key>Permissions</key> <dict> <key>Website Access</key> <dict> <key>Include Secure Pages</key> <true/> <key>Level</key> <string>All</string> </dict> </dict> <key>Website</key> <string>https://www.mitro.co</string> </dict> </plist>
{ "pile_set_name": "Github" }
Fix a bug that reading and writing on the same file may cause race on multiple processes.
{ "pile_set_name": "Github" }
/* * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in * compliance with the License. Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this * file. * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. * * @APPLE_LICENSE_HEADER_END@ */ #ifndef _powermanagement_mig_h_ #define _powermanagement_mig_h_ #define kPMMIGStringLength 1024 typedef char * string_t; enum { kIOPMGetValueDWBTSupportOnAC = 1, kIOPMGetValueDWBTSupportOnBatt = 2 }; /* * Arguments to powermanagement.defs MIG call io_pm_assertion_copy_details * parameter "whichData" */ enum { kIOPMAssertionMIGCopyOneAssertionProperties = 1, kIOPMAssertionMIGCopyAll = 2, kIOPMAssertionMIGCopyStatus = 3, kIOPMAssertionMIGCopyTimedOutAssertions = 4, kIOPMPowerEventsMIGCopyScheduledEvents = 5, kIOPMPowerEventsMIGCopyRepeatEvents = 6, }; /* * Arguments to powermanagement.defs MIG call io_pm_assertion_retain_release * parameter "action" */ enum { kIOPMAssertionMIGDoRetain = 1, kIOPMAssertionMIGDoRelease = -1 }; #endif
{ "pile_set_name": "Github" }
/* * Copyright (c) 2010 Jiri Svoboda * 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. * - The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 P_TYPE_H_ #define P_TYPE_H_ #include "mytypes.h" stree_texpr_t *parse_texpr(parse_t *parse); #endif
{ "pile_set_name": "Github" }
ruby: ext: ['.rb', '.rake'] after: ['^#!', '^#.*encoding:'] comment: open: '#\n' close: '#\n' prefix: '# ' perl: ext: ['.pl'] after: ['^#!', '^#.*encoding:'] comment: open: '#\n' close: '#\n' prefix: '# ' # Support PEP 0263 comments: # coding=<encoding name> # -*- coding: <encoding name> -*- # vim: set fileencoding=<encoding name> : python: ext: ['.py'] after: ['^#!', '^#.*coding:', '^#.*coding=', '^#.*fileencoding='] comment: open: '\n' close: '\n' prefix: '# ' html: ext: ['.html', '.htm', '.xhtml'] comment: open: '<!--\n' close: '-->\n' prefix: ' ' php: ext: ['.php'] after: [ '^#!' ] comment: open: '<?php \n/*\n' close: ' */ ?>\n' prefix: ' * ' javacript: ext: ['.js'] comment: open: '/*\n' close: ' */\n\n' prefix: ' * ' css: ext: ['.css'] comment: open: '/*\n' close: ' */\n\n' prefix: ' * ' c: ext: ['.c', '.h'] comment: open: '/*' close: ' */\n\n' prefix: ' * ' cpp: ext: ['.cpp', '.hpp', '.cc', '.hh'] comment: open: '//\n' close: '//\n\n' prefix: '// ' java: ext: ['.java'] comment: open: '/*\n' close: ' */\n\n' prefix: ' * ' groovy: ext: ['.groovy'] comment: open: '/*\n' close: ' */\n\n' prefix: ' * ' haml: ext: ['.haml', '.hamlc'] comment: open: '-#\n' close: '-#\n' prefix: '-# ' coffee: ext: ['.coffee'] comment: open: '###\n' close: '###\n' prefix: '' # M4 macro language, use #, not dnl m4: ext: ['.m4'] comment: open: '#\n' close: '#\n' prefix: '# ' # Most shells, really shell: ext: ['.sh'] after: ['^#!'] comment: open: '#\n' close: '#\n' prefix: '# ' # Use "-- " to make sure e.g. MySQL understands it sql: ext: ['.sql'] comment: open: '-- \n' close: '-- \n' prefix: '-- ' # XML is *not* the same as HTML, and the comments need to go after a # preprocessing directive, if present. # FIXME: only supports single line directives xml: ext: ['.xml', '.xsd', '.mxml'] after: ['^<\?'] comment: open: '<!--\n' close: '-->\n' prefix: ' ' yaml: ext: ['.yml', '.yaml'] comment: open: '#\n' close: '#\n' prefix: '# ' action_script: ext: ['.as'] comment: open: '//\n' close: '//\n\n' prefix: '// ' sass: ext: ['.sass', '.scss'] comment: open: '/*\n' close: ' */\n\n' prefix: ' * ' go: ext: ['.go'] comment: open: '/*\n' close: ' */\n\n' prefix: ' * '
{ "pile_set_name": "Github" }
/* Copyright 2018 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 client-gen. DO NOT EDIT. // This package has the automatically generated clientset. package kubernetes
{ "pile_set_name": "Github" }
import * as React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon( <path d="M21 5v14h2V5h-2zm-4 14h2V5h-2v14zM15 5H1v14h14V5zM8 7.75c1.24 0 2.25 1.01 2.25 2.25S9.24 12.25 8 12.25 5.75 11.24 5.75 10 6.76 7.75 8 7.75zM12.5 17h-9v-.75c0-1.5 3-2.25 4.5-2.25s4.5.75 4.5 2.25V17z" /> , 'RecentActorsSharp');
{ "pile_set_name": "Github" }
/* Copyright (c) 2009 M. J. D. Powell (mjdp@cam.ac.uk) * Modifications Copyright (c) 2010 Massachusetts Institute of Technology * * 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. */
{ "pile_set_name": "Github" }
syntax = "proto3"; package envoy.service.discovery.v4alpha; import "envoy/service/discovery/v4alpha/discovery.proto"; import "udpa/annotations/status.proto"; import "udpa/annotations/versioning.proto"; option java_package = "io.envoyproxy.envoy.service.discovery.v4alpha"; option java_outer_classname = "AdsProto"; option java_multiple_files = true; option java_generic_services = true; option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE; // [#protodoc-title: Aggregated Discovery Service (ADS)] // [#not-implemented-hide:] Discovery services for endpoints, clusters, routes, // and listeners are retained in the package `envoy.api.v2` for backwards // compatibility with existing management servers. New development in discovery // services should proceed in the package `envoy.service.discovery.v2`. // See https://github.com/lyft/envoy-api#apis for a description of the role of // ADS and how it is intended to be used by a management server. ADS requests // have the same structure as their singleton xDS counterparts, but can // multiplex many resource types on a single stream. The type_url in the // DiscoveryRequest/DiscoveryResponse provides sufficient information to recover // the multiplexed singleton APIs at the Envoy instance and management server. service AggregatedDiscoveryService { // This is a gRPC-only API. rpc StreamAggregatedResources(stream DiscoveryRequest) returns (stream DiscoveryResponse) { } rpc DeltaAggregatedResources(stream DeltaDiscoveryRequest) returns (stream DeltaDiscoveryResponse) { } } // [#not-implemented-hide:] Not configuration. Workaround c++ protobuf issue with importing // services: https://github.com/google/protobuf/issues/4221 message AdsDummy { option (udpa.annotations.versioning).previous_message_type = "envoy.service.discovery.v3.AdsDummy"; }
{ "pile_set_name": "Github" }
// Helper for combining css classes inside components export type IClassName = string | string[] | IClassNameMap; export type IClassNameMap = { [className: string]: boolean | any; }; export function cssNames(...args: IClassName[]): string { const map: IClassNameMap = {}; args.forEach(className => { if (typeof className === "string" || Array.isArray(className)) { [].concat(className).forEach(name => map[name] = true); } else { Object.assign(map, className); } }); return Object.entries(map) .filter(([className, isActive]) => !!isActive) .map(([className]) => className.trim()) .join(' '); }
{ "pile_set_name": "Github" }
{ "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Mozilla Communicator client code, released * March 31, 1998. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1998 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ /** File Name: 15.6.4-1.js ECMA Section: 15.6.4 Properties of the Boolean Prototype Object Description: The Boolean prototype object is itself a Boolean object (its [[Class]] is "Boolean") whose value is false. The value of the internal [[Prototype]] property of the Boolean prototype object is the Object prototype object (15.2.3.1). Author: christine@netscape.com Date: 30 september 1997 */ var VERSION = "ECMA_1" startTest(); var SECTION = "15.6.4-1"; writeHeaderToLog( SECTION + " Properties of the Boolean Prototype Object"); new TestCase( SECTION, "typeof Boolean.prototype == typeof( new Boolean )", true, typeof Boolean.prototype == typeof( new Boolean ) ); new TestCase( SECTION, "typeof( Boolean.prototype )", "object", typeof(Boolean.prototype) ); new TestCase( SECTION, "Boolean.prototype.toString = Object.prototype.toString; Boolean.prototype.toString()", "[object Boolean]", eval("Boolean.prototype.toString = Object.prototype.toString; Boolean.prototype.toString()") ); new TestCase( SECTION, "Boolean.prototype.valueOf()", false, Boolean.prototype.valueOf() ); test();
{ "pile_set_name": "Github" }
/* Copyright 2019 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. ==============================================================================*/ import {DebugElement, NO_ERRORS_SCHEMA} from '@angular/core'; import {TestBed} from '@angular/core/testing'; import {MatButtonModule} from '@angular/material/button'; import {MatTabsModule} from '@angular/material/tabs'; import {MatToolbarModule} from '@angular/material/toolbar'; import {MatSelectModule} from '@angular/material/select'; import {By} from '@angular/platform-browser'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {Store} from '@ngrx/store'; import {provideMockStore, MockStore} from '@ngrx/store/testing'; import {MatIconTestingModule} from '../testing/mat_icon_module'; import {HeaderComponent} from './header_component'; import {PluginSelectorComponent} from './plugin_selector_component'; import {PluginSelectorContainer} from './plugin_selector_container'; import {ReloadContainer} from './reload_container'; import { getPluginsListLoaded, getActivePlugin, getPlugins, } from '../core/store/core_selectors'; import {DataLoadState} from '../types/data'; import {changePlugin, manualReload} from '../core/actions'; import {State} from '../core/store'; import { createPluginMetadata, createState, createCoreState, buildPluginMetadata, } from '../core/testing'; import {PluginId} from '../types/api'; /** @typehack */ import * as _typeHackStore from '@ngrx/store'; describe('header test', () => { let store: MockStore<State>; beforeEach(async () => { await TestBed.configureTestingModule({ imports: [ MatButtonModule, MatIconTestingModule, MatSelectModule, MatTabsModule, MatToolbarModule, NoopAnimationsModule, ], providers: [ provideMockStore({ initialState: createState( createCoreState({ plugins: { foo: createPluginMetadata('Foo Fighter'), bar: createPluginMetadata('Barber'), }, }) ), }), HeaderComponent, ], declarations: [ HeaderComponent, PluginSelectorComponent, PluginSelectorContainer, ReloadContainer, ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); store = TestBed.inject<Store<State>>(Store) as MockStore<State>; store.overrideSelector(getPlugins, { foo: createPluginMetadata('Foo Fighter'), bar: createPluginMetadata('Barber'), }); store.overrideSelector(getActivePlugin, 'foo'); }); function assertDebugElementText(el: DebugElement, text: string) { expect(el.nativeElement.innerText.trim().toUpperCase()).toBe(text); } function setActivePlugin(activePlugin: PluginId | null) { store.overrideSelector(getActivePlugin, activePlugin); store.refreshState(); } it('renders pluginsList', () => { const fixture = TestBed.createComponent(HeaderComponent); fixture.detectChanges(); const els = fixture.debugElement.queryAll(By.css('.mat-tab-label')); expect(els.length).toBe(2); assertDebugElementText(els[0], 'FOO FIGHTER'); assertDebugElementText(els[1], 'BARBER'); }); it('updates list of tabs when pluginsList updates', async () => { const fixture = TestBed.createComponent(HeaderComponent); fixture.detectChanges(); store.overrideSelector(getPlugins, { cat: createPluginMetadata('Meow'), dog: createPluginMetadata('Woof'), elephant: createPluginMetadata('Trumpet'), }); setActivePlugin(null); fixture.detectChanges(); await fixture.whenStable(); const els = fixture.debugElement.queryAll(By.css('.mat-tab-label')); expect(els.length).toBe(3); assertDebugElementText(els[0], 'MEOW'); assertDebugElementText(els[1], 'WOOF'); assertDebugElementText(els[2], 'TRUMPET'); }); it('selects 0th element by default', () => { const fixture = TestBed.createComponent(HeaderComponent); fixture.detectChanges(); const group = fixture.debugElement.query(By.css('mat-tab-group')); expect(group.componentInstance.selectedIndex).toBe(0); }); it('sets tab group selection to match index of activePlugin', async () => { const fixture = TestBed.createComponent(HeaderComponent); fixture.detectChanges(); setActivePlugin('bar'); fixture.detectChanges(); await fixture.whenStable(); const group = fixture.debugElement.query(By.css('mat-tab-group')); expect(group.componentInstance.selectedIndex).toBe(1); }); it('fires an action when a tab is clicked', async () => { const dispatch = spyOn(store, 'dispatch'); const fixture = TestBed.createComponent(HeaderComponent); fixture.detectChanges(); const [, barEl] = fixture.debugElement.queryAll(By.css('.plugin-name')); barEl.nativeElement.click(); fixture.detectChanges(); await fixture.whenStable(); expect(dispatch).toHaveBeenCalledTimes(1); expect(dispatch).toHaveBeenCalledWith(changePlugin({plugin: 'bar'})); }); describe('reload', () => { it('dispatches manual reload when clicking on the reload button', () => { const dispatch = spyOn(store, 'dispatch'); const fixture = TestBed.createComponent(HeaderComponent); fixture.detectChanges(); const button = fixture.debugElement.query( By.css('app-header-reload button') ); button.nativeElement.click(); fixture.detectChanges(); expect(dispatch).toHaveBeenCalledTimes(1); expect(dispatch).toHaveBeenCalledWith(manualReload()); }); it('renders the time of refresh in title', () => { store.overrideSelector(getPluginsListLoaded, { state: DataLoadState.LOADED, lastLoadedTimeInMs: new Date('2000/01/01').getTime(), failureCode: null, }); const fixture = TestBed.createComponent(HeaderComponent); fixture.detectChanges(); const button = fixture.debugElement.query( By.css('app-header-reload button') ); expect(button.properties['title']).toBe( 'Last Updated: Jan 1, 2000, 12:00:00 AM' ); }); it('renders "Loading" if it was never loaded before', () => { store.overrideSelector(getPluginsListLoaded, { state: DataLoadState.NOT_LOADED, lastLoadedTimeInMs: null, failureCode: null, }); const fixture = TestBed.createComponent(HeaderComponent); fixture.detectChanges(); const button = fixture.debugElement.query( By.css('app-header-reload button') ); expect(button.properties['title']).toBe('Loading...'); }); it('spins the indicator when loading', () => { store.overrideSelector(getPluginsListLoaded, { state: DataLoadState.NOT_LOADED, lastLoadedTimeInMs: null, failureCode: null, }); const fixture = TestBed.createComponent(HeaderComponent);
{ "pile_set_name": "Github" }
############## mysql-test\t\concurrent_insert_basic.test ####################### # # # Variable Name: concurrent_insert # # Scope: GLOBAL # # Access Type: Dynamic # # Data Type: Boolean & Numeric # # Default Value: 1 # # Valid Values: 0,1 & 2 # # # # # # Creation Date: 2008-03-07 # # Author: Salman Rawala # # # # Modified: HHunger 2009-02-23 Inserted a wait condition right after the # # "INSERT ..record_6" to wait for the end of # # the insert. # # mleich This test needs some inporovements # # # # Description: Test Cases of Dynamic System Variable "concurrent_insert" # # that checks functionality of this variable # # # # Reference: # # http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # # # ################################################################################ --source include/force_myisam_default.inc # Skip the test if MyISAM is not available --source include/have_myisam.inc --disable_warnings DROP TABLE IF EXISTS t1; --enable_warnings ######################### # Creating new table # ######################### --echo ## Creating new table ## CREATE TABLE t1 ( name VARCHAR(30) ); --echo '#--------------------FN_DYNVARS_018_01-------------------------#' #################################################################### # Setting initial value of concurrent_insert to 1 # concurrent_insert = 1 means Enables concurrent insert # for MyISAM tables that don't have holes #################################################################### SET @start_value= @@global.concurrent_insert; --echo ## Setting initial value of variable to 1 ## SET @@global.concurrent_insert = 1; INSERT INTO t1(name) VALUES('Record_1'); INSERT INTO t1(name) VALUES('Record_2'); INSERT INTO t1(name) VALUES('Record_3'); --echo ## locking table ## LOCK TABLE t1 READ LOCAL; --echo ## Creating new connection to insert some rows in table ## connect (test_con1,localhost,root,,); --echo connection test_con1; connection test_con1; --echo ## New records should come at the end of all rows ## INSERT INTO t1(name) VALUES('Record_4'); SELECT * FROM t1; --echo ## unlocking tables ## --echo connection default; connection default; UNLOCK TABLES; --echo ## deleting record to create hole in table ## DELETE FROM t1 WHERE name ='Record_2'; --echo '#--------------------FN_DYNVARS_018_02-------------------------#' #################################################################### # Setting initial value of concurrent_insert to 1 # concurrent_insert = 1 and trying to insert some values # in MyISAM tables that have holes #################################################################### # lock table and connect with connection1 LOCK TABLE t1 READ LOCAL; --echo connection test_con1; connection test_con1; # setting value of concurrent_insert to 1 SET @@global.concurrent_insert=1; --echo ## send INSERT which should be blocked until unlock of the table ## send INSERT INTO t1(name) VALUES('Record_7'); --echo connection default; connection default; # wait until INSERT will be locked (low performance) let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE state= "Waiting for table level lock" AND info LIKE "INSERT INTO t1%"; --source include/wait_condition.inc --echo ## show processlist info and state ## SELECT state,info FROM INFORMATION_SCHEMA.PROCESSLIST WHERE state= "Waiting for table level lock" AND info LIKE "INSERT INTO t1%"; --echo ## table contents befor UNLOCK ## SELECT * FROM t1; UNLOCK TABLES; --echo ## table contens after UNLOCK ## SELECT * FROM t1; INSERT INTO t1(name) VALUES('Record_6'); let $wait_condition= SELECT COUNT(*) = 5 FROM t1; --source include/wait_condition.inc --echo connection test_con1; connection test_con1; # to complete the send above^ reap; SELECT * FROM t1; --echo connection default; connection default; --echo '#--------------------FN_DYNVARS_018_03-------------------------#' ################################################################################ # Setting value of concurrent_insert to 2 to verify values after inserting # it into table with holes # concurrent_insert = 2 means Enables concurrent insert # for MyISAM tables that have holes but inserts values at the end of all rows ################################################################################ --echo ## lock table and connect with connection1 ## LOCK TABLE t1 READ LOCAL; --echo connection test_con1; connection test_con1; --echo ## setting value of concurrent_insert to 2 ## SET @@global.concurrent_insert=2; --echo ## Inserting record in table, record should go at the end of the table ## INSERT INTO t1(name) VALUES('Record_5'); SELECT * FROM t1; SELECT @@concurrent_insert; --echo connection default; connection default; --echo ## Unlocking table ## UNLOCK TABLES; SELECT * FROM t1; --echo ## Inserting new row, this should go in the hole ## INSERT INTO t1(name) VALUES('Record_6'); SELECT * FROM t1; --echo ## connection test_con1 ## DELETE FROM t1 WHERE name ='Record_3'; SELECT * FROM t1; --echo ## Dropping table ## DROP TABLE t1; --echo ## Disconnecting connection ## disconnect test_con1; SET @@global.concurrent_insert= @start_value;
{ "pile_set_name": "Github" }
/* * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ /* * This code was generated by https://github.com/googleapis/google-api-java-client-services/ * Modify at your own risk. */ package com.google.api.services.content.model; /** * A batch entry encoding a single non-batch datafeeds response. * * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is * transmitted over HTTP when working with the Content API for Shopping. For a detailed explanation * see: * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> * </p> * * @author Google, Inc. */ @SuppressWarnings("javadoc") public final class DatafeedsCustomBatchResponseEntry extends com.google.api.client.json.GenericJson { /** * The ID of the request entry this entry responds to. * The value may be {@code null}. */ @com.google.api.client.util.Key private java.lang.Long batchId; /** * The requested data feed. Defined if and only if the request was successful. * The value may be {@code null}. */ @com.google.api.client.util.Key private Datafeed datafeed; /** * A list of errors defined if and only if the request failed. * The value may be {@code null}. */ @com.google.api.client.util.Key private Errors errors; /** * The ID of the request entry this entry responds to. * @return value or {@code null} for none */ public java.lang.Long getBatchId() { return batchId; } /** * The ID of the request entry this entry responds to. * @param batchId batchId or {@code null} for none */ public DatafeedsCustomBatchResponseEntry setBatchId(java.lang.Long batchId) { this.batchId = batchId; return this; } /** * The requested data feed. Defined if and only if the request was successful. * @return value or {@code null} for none */ public Datafeed getDatafeed() { return datafeed; } /** * The requested data feed. Defined if and only if the request was successful. * @param datafeed datafeed or {@code null} for none */ public DatafeedsCustomBatchResponseEntry setDatafeed(Datafeed datafeed) { this.datafeed = datafeed; return this; } /** * A list of errors defined if and only if the request failed. * @return value or {@code null} for none */ public Errors getErrors() { return errors; } /** * A list of errors defined if and only if the request failed. * @param errors errors or {@code null} for none */ public DatafeedsCustomBatchResponseEntry setErrors(Errors errors) { this.errors = errors; return this; } @Override public DatafeedsCustomBatchResponseEntry set(String fieldName, Object value) { return (DatafeedsCustomBatchResponseEntry) super.set(fieldName, value); } @Override public DatafeedsCustomBatchResponseEntry clone() { return (DatafeedsCustomBatchResponseEntry) super.clone(); } }
{ "pile_set_name": "Github" }
using Nancy.Metadata.Module; using Nancy.Swagger; namespace OmniSharp.CodeActions.Metadata { public class GetCodeActionsMetadataModule : MetadataModule<SwaggerRouteData> { public GetCodeActionsMetadataModule() { Describe["GetCodeActions"] = desc => desc.AsSwagger(builder => builder .ResourcePath("/getcodeactions") .BodyParam<CodeActionRequest>() .Response(200) .Model<GetCodeActionsResponse>()); } } }
{ "pile_set_name": "Github" }
#include "unp.h" void tv_sub(struct timeval *out, struct timeval *in) { if ( (out->tv_usec -= in->tv_usec) < 0) { /* out -= in */ --out->tv_sec; out->tv_usec += 1000000; } out->tv_sec -= in->tv_sec; }
{ "pile_set_name": "Github" }
/*! @file Defines operators for Iterables. @copyright Louis Dionne 2013-2017 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_HANA_DETAIL_OPERATORS_ITERABLE_HPP #define BOOST_HANA_DETAIL_OPERATORS_ITERABLE_HPP #include <boost/hana/config.hpp> #include <boost/hana/fwd/at.hpp> BOOST_HANA_NAMESPACE_BEGIN namespace detail { template <typename Derived> struct iterable_operators { template <typename N> constexpr decltype(auto) operator[](N&& n) & { return hana::at(static_cast<Derived&>(*this), static_cast<N&&>(n)); } template <typename N> constexpr decltype(auto) operator[](N&& n) const& { return hana::at(static_cast<Derived const&>(*this), static_cast<N&&>(n)); } template <typename N> constexpr decltype(auto) operator[](N&& n) && { return hana::at(static_cast<Derived&&>(*this), static_cast<N&&>(n)); } }; } BOOST_HANA_NAMESPACE_END #endif // !BOOST_HANA_DETAIL_OPERATORS_ITERABLE_HPP
{ "pile_set_name": "Github" }
# created by tools/tclZIC.tcl - do not edit set TZData(:Asia/Taipei) { {-9223372036854775808 29160 0 LMT} {-2335248360 28800 0 CST} {-1017820800 32400 0 JST} {-766224000 28800 0 CST} {-745833600 32400 1 CDT} {-733827600 28800 0 CST} {-716889600 32400 1 CDT} {-699613200 28800 0 CST} {-683884800 32400 1 CDT} {-670669200 28800 0 CST} {-652348800 32400 1 CDT} {-639133200 28800 0 CST} {-620812800 32400 1 CDT} {-607597200 28800 0 CST} {-589276800 32400 1 CDT} {-576061200 28800 0 CST} {-562924800 32400 1 CDT} {-541760400 28800 0 CST} {-528710400 32400 1 CDT} {-510224400 28800 0 CST} {-497174400 32400 1 CDT} {-478688400 28800 0 CST} {-465638400 32400 1 CDT} {-449830800 28800 0 CST} {-434016000 32400 1 CDT} {-418208400 28800 0 CST} {-402480000 32400 1 CDT} {-386672400 28800 0 CST} {-370944000 32400 1 CDT} {-355136400 28800 0 CST} {-339408000 32400 1 CDT} {-323600400 28800 0 CST} {-302515200 32400 1 CDT} {-291978000 28800 0 CST} {-270979200 32400 1 CDT} {-260442000 28800 0 CST} {133977600 32400 1 CDT} {149785200 28800 0 CST} {165513600 32400 1 CDT} {181321200 28800 0 CST} {299606400 32400 1 CDT} {307551600 28800 0 CST} }
{ "pile_set_name": "Github" }
# frozen_string_literal: true class Fakes::EndProductStore < Fakes::PersistentStore class << self def redis_ns "end_product_records_#{Rails.env}" end end class Contention < OpenStruct; end class BgsContention < OpenStruct; end # we call it a "child" because even though Redis has only key:value pairs, # logically the object is a child of an EndProduct class ChildStore < Fakes::EndProductStore def initialize(parent_key:, child_key:, child:) @parent_key = parent_key @child_key = child_key.to_s.to_sym @child = child end def create children = fetch_children || {} children[child_key] = child deflate_and_store(parent_key, children) end def update children = fetch_children fail "No values for #{parent_key}" unless children children[child_key] = child deflate_and_store(parent_key, children) end def remove children = fetch_children fail "No values for #{parent_key}" unless children children.delete(child_key) deflate_and_store(parent_key, children) end private attr_reader :parent_key, :child_key, :child def fetch_children fetch_and_inflate(parent_key) end end def store_end_product_record(veteran_id, end_product) claim_id = end_product[:benefit_claim_id] existing_eps = fetch_and_inflate(veteran_id) if existing_eps existing_eps[claim_id] = end_product deflate_and_store(veteran_id, existing_eps) else deflate_and_store(veteran_id, claim_id => end_product) end end def update_ep_status(veteran_id, claim_id, new_status) eps = fetch_and_inflate(veteran_id) eps[claim_id.to_sym][:status_type_code] = new_status deflate_and_store(veteran_id, eps) end # contentions are "children" of End Products but we store by claim_id # rather than veteran_id to make look up easier. Dispositions are similar. def create_contention(contention) contention_child_store(contention).create end def update_contention(contention) contention_child_store(contention).update end def remove_contention(contention) contention_child_store(contention).remove end def inflated_contentions_for(claim_id) children_to_structs(contention_key(claim_id)).map { |struct| Contention.new(struct) } end def inflated_bgs_contentions_for(claim_id) (fetch_and_inflate(contention_key(claim_id)) || {}).values.map do |hash| hash[:table][:reference_id] = hash[:table][:reference_id] || hash[:table][:id] BgsContention.new(hash[:table]) end end def create_disposition(disposition) disposition_child_store(disposition).create end def update_disposition(disposition) disposition_child_store(disposition).update end def remove_disposition(disposition) disposition_child_store(disposition).remove end def inflated_dispositions_for(claim_id) children_to_structs(disposition_key(claim_id)) end private def contention_key(claim_id) "contention_#{claim_id}" end def disposition_key(claim_id) "disposition_#{claim_id}" end def contention_child_store(contention) claim_id = contention.claim_id ChildStore.new( parent_key: contention_key(claim_id), child: contention, child_key: contention.id || contention.reference_id ) end def disposition_child_store(disposition) claim_id = disposition.claim_id ChildStore.new(parent_key: disposition_key(claim_id), child: disposition, child_key: disposition.contention_id) end def children_to_structs(key) (fetch_and_inflate(key) || {}).values.map { |hash| OpenStruct.new(hash[:table]) } end end
{ "pile_set_name": "Github" }
/*----------------------------------------------------------------------------*/ /** * This confidential and proprietary software may be used only as * authorised by a licensing agreement from ARM Limited * (C) COPYRIGHT 2011-2012 ARM Limited * ALL RIGHTS RESERVED * * The entire notice above must be reproduced on all authorised * copies and copies may only be made to the extent permitted * by a licensing agreement from ARM Limited. * * @brief Functions for managing ASTC codec images. */ /*----------------------------------------------------------------------------*/ #include <math.h> #include "astc_codec_internals.h" #include "softfloat.h" #include <stdint.h> #include <stdio.h> // conversion functions between the LNS representation and the FP16 representation. float float_to_lns(float p) { if (astc_isnan(p) || p <= 1.0f / 67108864.0f) { // underflow or NaN value, return 0. // We count underflow if the input value is smaller than 2^-26. return 0; } if (fabs(p) >= 65536.0f) { // overflow, return a +INF value return 65535; } int expo; float normfrac = frexp(p, &expo); float p1; if (expo < -13) { // input number is smaller than 2^-14. In this case, multiply by 2^25. p1 = p * 33554432.0f; expo = 0; } else { expo += 14; p1 = (normfrac - 0.5f) * 4096.0f; } if (p1 < 384.0f) p1 *= 4.0f / 3.0f; else if (p1 <= 1408.0f) p1 += 128.0f; else p1 = (p1 + 512.0f) * (4.0f / 5.0f); p1 += expo * 2048.0f; return p1 + 1.0f; } uint16_t lns_to_sf16(uint16_t p) { uint16_t mc = p & 0x7FF; uint16_t ec = p >> 11; uint16_t mt; if (mc < 512) mt = 3 * mc; else if (mc < 1536) mt = 4 * mc - 512; else mt = 5 * mc - 2048; uint16_t res = (ec << 10) | (mt >> 3); if (res >= 0x7BFF) res = 0x7BFF; return res; } // conversion function from 16-bit LDR value to FP16. // note: for LDR interpolation, it is impossible to get a denormal result; // this simplifies the conversion. // FALSE; we can receive a very small UNORM16 through the constant-block. uint16_t unorm16_to_sf16(uint16_t p) { if (p == 0xFFFF) return 0x3C00; // value of 1.0 . if (p < 4) return p << 8; int lz = clz32(p) - 16; p <<= (lz + 1); p >>= 6; p |= (14 - lz) << 10; return p; } void imageblock_initialize_deriv_from_work_and_orig(imageblock * pb, int pixelcount) { int i; const float *fptr = pb->orig_data; const float *wptr = pb->work_data; float *dptr = pb->deriv_data; for (i = 0; i < pixelcount; i++) { // compute derivatives for RGB first if (pb->rgb_lns[i]) { float r = MAX(fptr[0], 6e-5f); float g = MAX(fptr[1], 6e-5f); float b = MAX(fptr[2], 6e-5f); float rderiv = (float_to_lns(r * 1.05f) - float_to_lns(r)) / (r * 0.05f); float gderiv = (float_to_lns(g * 1.05f) - float_to_lns(g)) / (g * 0.05f); float bderiv = (float_to_lns(b * 1.05f) - float_to_lns(b)) / (b * 0.05f); // the derivative may not actually take values smaller than 1/32 or larger than 2^25; // if it does, we clamp it. if (rderiv < (1.0f / 32.0f)) rderiv = (1.0f / 32.0f); else if (rderiv > 33554432.0f) rderiv = 33554432.0f; if (gderiv < (1.0f / 32.0f)) gderiv = (1.0f / 32.0f); else if (gderiv > 33554432.0f) gderiv = 33554432.0f; if (bderiv < (1.0f / 32.0f)) bderiv = (1.0f / 32.0f); else if (bderiv > 33554432.0f) bderiv = 33554432.0f; dptr[0] = rderiv; dptr[1] = gderiv; dptr[2] = bderiv; } else { dptr[0] = 65535.0f; dptr[1] = 65535.0f; dptr[2] = 65535.0f; } // then compute derivatives for Alpha if (pb->alpha_lns[i]) { float a = MAX(fptr[3], 6e-5f); float aderiv = (float_to_lns(a * 1.05f) - float_to_lns(a)) / (a * 0.05f); // the derivative may not actually take values smaller than 1/32 or larger than 2^25; // if it does, we clamp it. if (aderiv < (1.0f / 32.0f)) aderiv = (1.0f / 32.0f); else if (aderiv > 33554432.0f) aderiv = 33554432.0f; dptr[3] = aderiv; } else { dptr[3] = 65535.0f; } fptr += 4; wptr += 4; dptr += 4; } } // helper function to initialize the work-data from the orig-data void imageblock_initialize_work_from_orig(imageblock * pb, int pixelcount) { int i; float *fptr = pb->orig_data; float *wptr = pb->work_data; for (i = 0; i < pixelcount; i++) { if (pb->rgb_lns[i]) { wptr[0] = float_to_lns(fptr[0]); wptr[1] = float_to_lns(fptr[1]); wptr[2] = float_to_lns(fptr[2]); } else { wptr[0] = fptr[0] * 65535.0f; wptr[1] = fptr[1] * 65535.0f; wptr[2] = fptr[2] * 65535.0f; } if (pb->alpha_lns[i]) { wptr[3] = float_to_lns(fptr[3]); } else { wptr[3] = fptr[3] * 65535.0f; } fptr += 4; wptr += 4; }
{ "pile_set_name": "Github" }
# Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import("//build/buildflag_header.gni") import("//chromecast/chromecast.gni") import("//third_party/protobuf/proto_library.gni") buildflag_header("buildflags") { header = "buildflags.h" flags = [ "HAVE_FULL_MIXER=$have_full_mixer" ] } proto_library("proto") { proto_out_dir = "chromecast/media/audio/mixer_service" sources = [ "mixer_service.proto" ] } cast_source_set("common") { sources = [ "constants.cc", "constants.h", "conversions.cc", "conversions.h", "loopback_interrupt_reason.h", "mixer_socket.cc", "mixer_socket.h", ] deps = [ ":buildflags", "//base", "//chromecast/net:io_buffer_pool", "//chromecast/public", "//chromecast/public/media", "//net", ] public_deps = [ ":proto", "//chromecast/net:small_message_socket", ] } cast_source_set("connection") { sources = [ "mixer_connection.cc", "mixer_connection.h", ] deps = [ ":audio_socket_service", ":common", "//base", "//chromecast/base", "//net", ] } cast_source_set("output_stream_connection") { sources = [ "output_stream_connection.cc", "output_stream_connection.h", ] deps = [ ":common", ":connection", ":proto", "//base", "//chromecast/net:io_buffer_pool", "//net", ] } cast_source_set("control_connection") { sources = [ "control_connection.cc", "control_connection.h", ] deps = [ ":common", ":connection", ":proto", "//base", "//chromecast/public", "//net", ] } cast_source_set("mixer_control") { sources = [ "mixer_control.cc", "mixer_control.h", ] deps = [ ":common", ":control_connection", "//base", "//chromecast/media/audio:audio_io_thread", ] } cast_source_set("loopback_connection") { sources = [ "loopback_connection.cc", "loopback_connection.h", ] public_deps = [ ":common" ] deps = [ ":connection", ":proto", "//base", "//chromecast/net:io_buffer_pool", "//chromecast/public/media", "//net", ] } cast_source_set("redirected_audio_connection") { sources = [ "redirected_audio_connection.cc", "redirected_audio_connection.h", ] deps = [ ":common", ":connection", ":proto", "//base", "//chromecast/net:io_buffer_pool", "//chromecast/public", "//chromecast/public/media", "//net", ] } cast_source_set("audio_socket_service") { sources = [ "audio_socket_service.cc", "audio_socket_service.h", ] if (use_unix_sockets) { sources += [ "audio_socket_service_uds.cc" ] } else { sources += [ "audio_socket_service_tcp.cc" ] } deps = [ "//base", "//net", ] }
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: e85a3776f5266b144a8e170c88e08647 timeCreated: 1493210307 licenseType: Free TextureImporter: fileIDToRecycleName: 8900000: generatedCubemap serializedVersion: 4 mipmaps: mipMapMode: 0 enableMipMap: 1 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 borderMipMap: 0 mipMapFadeDistanceStart: 1 mipMapFadeDistanceEnd: 3 bumpmap: convertToNormalMap: 0 externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 isReadable: 0 grayScaleToAlpha: 0 generateCubemap: 2 cubemapConvolution: 0 seamlessCubemap: 0 textureFormat: 1 maxTextureSize: 2048 textureSettings: filterMode: -1 aniso: -1 mipBias: -1 wrapMode: -1 nPOTScale: 1 lightmap: 0 compressionQuality: 50 spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 spritePivot: {x: 0.5, y: 0.5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 alphaUsage: 1 alphaIsTransparency: 0 spriteTessellationDetail: -1 textureType: 0 textureShape: 2 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 platformSettings: - buildTarget: DefaultTexturePlatform maxTextureSize: 2048 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 - buildTarget: Standalone maxTextureSize: 2048 textureFormat: -1 textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 spriteSheet: serializedVersion: 2 sprites: [] outline: [] spritePackingTag: userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
<?php /** * CodeIgniter * * An open source application development framework for PHP * * This content is released under the MIT License (MIT) * * Copyright (c) 2014 - 2016, British Columbia Institute of Technology * * 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 CodeIgniter * @author EllisLab Dev Team * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/) * @copyright Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/) * @license http://opensource.org/licenses/MIT MIT License * @link https://codeigniter.com * @since Version 1.3.0 * @filesource */ defined('BASEPATH') OR exit('No direct script access allowed'); /** * Postgres Result Class * * This class extends the parent result class: CI_DB_result * * @package CodeIgniter * @subpackage Drivers * @category Database * @author EllisLab Dev Team * @link https://codeigniter.com/user_guide/database/ */ class CI_DB_postgre_result extends CI_DB_result { /** * Number of rows in the result set * * @return int */ public function num_rows() { return is_int($this->num_rows) ? $this->num_rows : $this->num_rows = pg_num_rows($this->result_id); } // -------------------------------------------------------------------- /** * Number of fields in the result set * * @return int */ public function num_fields() { return pg_num_fields($this->result_id); } // -------------------------------------------------------------------- /** * Fetch Field Names * * Generates an array of column names * * @return array */ public function list_fields() { $field_names = array(); for ($i = 0, $c = $this->num_fields(); $i < $c; $i++) { $field_names[] = pg_field_name($this->result_id, $i); } return $field_names; } // -------------------------------------------------------------------- /** * Field data * * Generates an array of objects containing field meta-data * * @return array */ public function field_data() { $retval = array(); for ($i = 0, $c = $this->num_fields(); $i < $c; $i++) { $retval[$i] = new stdClass(); $retval[$i]->name = pg_field_name($this->result_id, $i); $retval[$i]->type = pg_field_type($this->result_id, $i); $retval[$i]->max_length = pg_field_size($this->result_id, $i); } return $retval; } // -------------------------------------------------------------------- /** * Free the result * * @return void */ public function free_result() { if (is_resource($this->result_id)) { pg_free_result($this->result_id); $this->result_id = FALSE; } } // -------------------------------------------------------------------- /** * Data Seek * * Moves the internal pointer to the desired offset. We call * this internally before fetching results to make sure the * result set starts at zero. * * @param int $n * @return bool */ public function data_seek($n = 0) { return pg_result_seek($this->result_id, $n); } // -------------------------------------------------------------------- /** * Result - associative array * * Returns the result set as an array * * @return array */ protected function _fetch_assoc() { return pg_fetch_assoc($this->result_id); } // -------------------------------------------------------------------- /** * Result - object * * Returns the result set as an object * * @param string $class_name * @return object */ protected function _fetch_object($class_name = 'stdClass') { return pg_fetch_object($this->result_id, NULL, $class_name); } }
{ "pile_set_name": "Github" }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Config; use Symfony\Component\Config\Resource\SelfCheckingResourceChecker; /** * ConfigCache caches arbitrary content in files on disk. * * When in debug mode, those metadata resources that implement * \Symfony\Component\Config\Resource\SelfCheckingResourceInterface will * be used to check cache freshness. * * @author Fabien Potencier <fabien@symfony.com> * @author Matthias Pigulla <mp@webfactory.de> */ class ConfigCache extends ResourceCheckerConfigCache { private $debug; /** * @param string $file The absolute cache path * @param bool $debug Whether debugging is enabled or not */ public function __construct($file, $debug) { $this->debug = (bool) $debug; $checkers = []; if (true === $this->debug) { $checkers = [new SelfCheckingResourceChecker()]; } parent::__construct($file, $checkers); } /** * Checks if the cache is still fresh. * * This implementation always returns true when debug is off and the * cache file exists. * * @return bool true if the cache is fresh, false otherwise */ public function isFresh() { if (!$this->debug && is_file($this->getPath())) { return true; } return parent::isFresh(); } }
{ "pile_set_name": "Github" }
<?php /** * Magento * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@magento.com so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade Magento to newer * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magento.com for more information. * * @category Tests * @package Tests_Functional * @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ namespace Mage\Adminhtml\Test\Block\CatalogRule\Promo\Catalog\Edit; use Mage\Adminhtml\Test\Block\Widget\FormTabs; use Magento\Mtf\Client\Element\SimpleElement as Element; use Magento\Mtf\Fixture\FixtureInterface; /** * Form for creation of a Catalog Price Rule. */ class PromoForm extends FormTabs { /** * Fill form with tabs. * * @param FixtureInterface $fixture * @param Element $element * @param array $replace * @return $this|FormTabs */ public function fill(FixtureInterface $fixture, Element $element = null, array $replace = null) { $tabs = $this->getFieldsByTabs($fixture); if ($replace) { $tabs = $this->prepareData($tabs, $replace); } $this->fillTabs($tabs, $element); } /** * Replace placeholders in each values of data. * * @param array $tabs * @param array $replace * @return array */ protected function prepareData(array $tabs, array $replace) { foreach ($replace as $tabName => $fields) { foreach ($fields as $key => $pairs) { if (isset($tabs[$tabName][$key])) { $tabs[$tabName][$key]['value'] = str_replace( array_keys($pairs), array_values($pairs), $tabs[$tabName][$key]['value'] ); } } } return $tabs; } }
{ "pile_set_name": "Github" }
'use strict'; var isImplemented = require('../../../string/from-code-point/is-implemented'); module.exports = function (a) { a(isImplemented(), true); };
{ "pile_set_name": "Github" }
/* NOLINT(build/header_guard) */ /* Copyright 2016 Google Inc. All Rights Reserved. Distributed under MIT license. See file LICENSE for detail or copy at https://opensource.org/licenses/MIT */ /* template parameters: FN, BUCKET_BITS, NUM_BANKS, BANK_BITS, NUM_LAST_DISTANCES_TO_CHECK */ /* A (forgetful) hash table to the data seen by the compressor, to help create backward references to previous data. Hashes are stored in chains which are bucketed to groups. Group of chains share a storage "bank". When more than "bank size" chain nodes are added, oldest nodes are replaced; this way several chains may share a tail. */ #define HashForgetfulChain HASHER() #define BANK_SIZE (1 << BANK_BITS) /* Number of hash buckets. */ #define BUCKET_SIZE (1 << BUCKET_BITS) #define CAPPED_CHAINS 0 static BROTLI_INLINE size_t FN(HashTypeLength)(void) { return 4; } static BROTLI_INLINE size_t FN(StoreLookahead)(void) { return 4; } /* HashBytes is the function that chooses the bucket to place the address in.*/ static BROTLI_INLINE size_t FN(HashBytes)(const uint8_t* BROTLI_RESTRICT data) { const uint32_t h = BROTLI_UNALIGNED_LOAD32LE(data) * kHashMul32; /* The higher bits contain more mixture from the multiplication, so we take our results from there. */ return h >> (32 - BUCKET_BITS); } typedef struct FN(Slot) { uint16_t delta; uint16_t next; } FN(Slot); typedef struct FN(Bank) { FN(Slot) slots[BANK_SIZE]; } FN(Bank); typedef struct HashForgetfulChain { uint16_t free_slot_idx[NUM_BANKS]; /* Up to 1KiB. Move to dynamic? */ size_t max_hops; /* Shortcuts. */ void* extra; HasherCommon* common; /* --- Dynamic size members --- */ /* uint32_t addr[BUCKET_SIZE]; */ /* uint16_t head[BUCKET_SIZE]; */ /* Truncated hash used for quick rejection of "distance cache" candidates. */ /* uint8_t tiny_hash[65536];*/ /* FN(Bank) banks[NUM_BANKS]; */ } HashForgetfulChain; static uint32_t* FN(Addr)(void* extra) { return (uint32_t*)extra; } static uint16_t* FN(Head)(void* extra) { return (uint16_t*)(&FN(Addr)(extra)[BUCKET_SIZE]); } static uint8_t* FN(TinyHash)(void* extra) { return (uint8_t*)(&FN(Head)(extra)[BUCKET_SIZE]); } static FN(Bank)* FN(Banks)(void* extra) { return (FN(Bank)*)(&FN(TinyHash)(extra)[65536]); } static void FN(Initialize)( HasherCommon* common, HashForgetfulChain* BROTLI_RESTRICT self, const BrotliEncoderParams* params) { self->common = common; self->extra = common->extra; self->max_hops = (params->quality > 6 ? 7u : 8u) << (params->quality - 4); } static void FN(Prepare)( HashForgetfulChain* BROTLI_RESTRICT self, BROTLI_BOOL one_shot, size_t input_size, const uint8_t* BROTLI_RESTRICT data) { uint32_t* BROTLI_RESTRICT addr = FN(Addr)(self->extra); uint16_t* BROTLI_RESTRICT head = FN(Head)(self->extra); uint8_t* BROTLI_RESTRICT tiny_hash = FN(TinyHash)(self->extra); /* Partial preparation is 100 times slower (per socket). */ size_t partial_prepare_threshold = BUCKET_SIZE >> 6; if (one_shot && input_size <= partial_prepare_threshold) { size_t i; for (i = 0; i < input_size; ++i) { size_t bucket = FN(HashBytes)(&data[i]); /* See InitEmpty comment. */ addr[bucket] = 0xCCCCCCCC; head[bucket] = 0xCCCC; } } else { /* Fill |addr| array with 0xCCCCCCCC value. Because of wrapping, position processed by hasher never reaches 3GB + 64M; this makes all new chains to be terminated after the first node. */ memset(addr, 0xCC, sizeof(uint32_t) * BUCKET_SIZE); memset(head, 0, sizeof(uint16_t) * BUCKET_SIZE); } memset(tiny_hash, 0, sizeof(uint8_t) * 65536); memset(self->free_slot_idx, 0, sizeof(self->free_slot_idx)); } static BROTLI_INLINE size_t FN(HashMemAllocInBytes)( const BrotliEncoderParams* params, BROTLI_BOOL one_shot, size_t input_size) { BROTLI_UNUSED(params); BROTLI_UNUSED(one_shot); BROTLI_UNUSED(input_size); return sizeof(uint32_t) * BUCKET_SIZE + sizeof(uint16_t) * BUCKET_SIZE + sizeof(uint8_t) * 65536 + sizeof(FN(Bank)) * NUM_BANKS; } /* Look at 4 bytes at &data[ix & mask]. Compute a hash from these, and prepend node to corresponding chain; also update tiny_hash for current position. */ static BROTLI_INLINE void FN(Store)(HashForgetfulChain* BROTLI_RESTRICT self, const uint8_t* BROTLI_RESTRICT data, const size_t mask, const size_t ix) { uint32_t* BROTLI_RESTRICT addr = FN(Addr)(self->extra); uint16_t* BROTLI_RESTRICT head = FN(Head)(self->extra); uint8_t* BROTLI_RESTRICT tiny_hash = FN(TinyHash)(self->extra); FN(Bank)* BROTLI_RESTRICT banks = FN(Banks)(self->extra); const size_t key = FN(HashBytes)(&data[ix & mask]); const size_t bank = key & (NUM_BANKS - 1); const size_t idx = self->free_slot_idx[bank]++ & (BANK_SIZE - 1); size_t delta = ix - addr[key]; tiny_hash[(uint16_t)ix] = (uint8_t)key; if (delta > 0xFFFF) delta = CAPPED_CHAINS ? 0 : 0xFFFF; banks[bank].slots[idx].delta = (uint16_t)delta; banks[bank].slots[idx].next = head[key]; addr[key] = (uint32_t)ix; head[key] = (uint16_t)idx; } static BROTLI_INLINE void FN(StoreRange)( HashForgetfulChain* BROTLI_RESTRICT self, const uint8_t* BROTLI_RESTRICT data, const size_t mask, const size_t ix_start, const size_t ix_end) { size_t i; for (i = ix_start; i < ix_end; ++i) { FN(Store)(self, data, mask, i); } } static BROTLI_INLINE void FN(StitchToPreviousBlock)( HashForgetfulChain* BROTLI_RESTRICT self, size_t num_bytes, size_t position, const uint8_t* ringbuffer, size_t ring_buffer_mask) { if (num_bytes >= FN(HashTypeLength)() - 1 && position >= 3) { /* Prepare the hashes for three last bytes
{ "pile_set_name": "Github" }
# -*- mode: ruby -*- # vi: set ft=ruby : # Provisioning script to install the reference policy $install_refpolicy = <<-SHELL # fail as soon as a command failed set -e # we set to permissive to allow loading and working with reference policy as opposed to fedora's fork echo "Setting SELinux to Permissive Mode..." setenforce 0 # build the reference policy sudo -su vagrant make -C /vagrant bare sudo -su vagrant make -C /vagrant conf sudo -su vagrant make -C /vagrant all sudo -su vagrant make -C /vagrant validate rm -f /usr/share/selinux/refpolicy/*.pp make -C /vagrant install make -C /vagrant install-headers semodule -s refpolicy -i /usr/share/selinux/refpolicy/*.pp # Load the module specific to Vagrant VM semodule -s refpolicy -i /vagrant/support/vagrant-vm.cil if ! (LANG=C sestatus -v | grep '^Loaded policy name:\s*refpolicy$' > /dev/null) then # Use the reference policy sed -i -e 's/^\\(SELINUXTYPE=\\).*/SELINUXTYPE=refpolicy/' /etc/selinux/config fi semodule --reload # allow every domain to use /dev/urandom semanage boolean --modify --on global_ssp # allow opening SSH sessions as unconfined_u and sysadm_u semanage boolean --modify --on ssh_sysadm_login # allow systemd-tmpfiles to manage every file semanage boolean --modify --on systemd_tmpfiles_manage_all # make vagrant user use unconfined_u context if ! (semanage login -l | grep '^vagrant' > /dev/null) then echo "Configuring SELinux context for vagrant user" semanage login -a -s unconfined_u vagrant fi # label /vagrant as vagrant's home files if semanage fcontext --list | grep '^/vagrant(/\.\*)?' then semanage fcontext -m -s unconfined_u -t user_home_t '/vagrant(/.*)?' else semanage fcontext -a -s unconfined_u -t user_home_t '/vagrant(/.*)?' fi # Update interface_info sepolgen-ifgen -o /var/lib/sepolgen/interface_info -i /usr/share/selinux/refpolicy echo "Relabelling the system..." restorecon -RF / echo "If this is a fresh install, you need to reboot in order to enable enforcing mode" SHELL # All Vagrant configuration is done below. The "2" in Vagrant.configure # configures the configuration version (we support older styles for # backwards compatibility). Please don't change it unless you know what # you're doing. Vagrant.configure("2") do |config| # build a Fedora 30 VM config.vm.define "fedora" do |fedora| fedora.vm.box = "fedora/30-cloud-base" # assign a nice hostname fedora.vm.hostname = "selinux-fedora-devel" # give it a private internal IP address fedora.vm.network "private_network", type: "dhcp" # Customize the amount of memory on the VM fedora.vm.provider "virtualbox" do |vb| vb.memory = 1024 end fedora.vm.provider "libvirt" do |lv| lv.memory = 1024 end # Enable provisioning with a shell script. Additional provisioners such as # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the # documentation for more information about their specific syntax and use. fedora.vm.provision "shell", run: "once", inline: <<-SHELL # get the man pages echo "Upgrading DNF and installing man pages..." dnf install -q -y man-pages >/dev/null dnf upgrade -q -y dnf >/dev/null # install a few packages to make this machine ready to go out of the box echo "Installing SELinux dev dependencies..." dnf install -q -y \ bash-completion \ gcc \ man-pages \ vim \ make \ kernel-devel \ selinux-policy-devel \ libselinux-python3 \ >/dev/null # configure the reference policy for Fedora if ! grep '^DISTRO = fedora$' /vagrant/build.conf > /dev/null then echo 'DISTRO = fedora' >> /vagrant/build.conf echo 'SYSTEMD = y' >> /vagrant/build.conf echo 'UBAC = n' >> /vagrant/build.conf fi #{$install_refpolicy} SHELL end # build a Debian 10 VM config.vm.define "debian" do |debian| debian.vm.box = "debian/buster64" # assign a nice hostname debian.vm.hostname = "selinux-debian-devel" # give it a private internal IP address debian.vm.network "private_network", type: "dhcp" # Customize the amount of memory on the VM debian.vm.provider "virtualbox" do |vb| vb.memory = 1024 end debian.vm.provider "libvirt" do |lv| lv.memory = 1024 end # redefine the /vagrant as a synced folder (not an NFS share), in order to work cleanly on it debian.vm.synced_folder ".", "/vagrant", disabled: true debian.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__exclude: ".vagrant/" debian.vm.provision "shell", run: "once", inline: <<-SHELL # install a few packages to make this machine ready to go out of the box echo "Installing SELinux dev dependencies..." export DEBIAN_FRONTEND=noninteractive apt-get -qq update apt-get install --no-install-recommends --no-install-suggests -qy \ bash-completion \ gcc \ git \ libc6-dev \ vim \ make \ auditd \ selinux-basics \ selinux-policy-default \ selinux-policy-dev \ setools # If SELinux is not enabled, enable it with Debian's policy and ask for a reboot if ! selinuxenabled then echo "Enabling SELinux for Debian according to https://wiki.debian.org/SELinux/Setup" selinux-activate echo "Please reboot now in order to enable SELinux:" echo "vagrant reload debian && vagrant provision debian" exit fi # configure the reference policy for Debian if ! grep '^DISTRO = debian$' /vagrant/build.conf > /dev/null then echo 'DISTRO = debian' >> /vagrant/build.conf echo 'SYSTEMD = y' >> /vagrant/build.conf echo 'UBAC = n' >> /vagrant/build.conf fi #{$install_refpolicy} SHELL end end
{ "pile_set_name": "Github" }
13 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
{ "pile_set_name": "Github" }
package com.huantansheng.easyphotos.models.ad; import android.view.View; /** * 广告实体 * Created by huan on 2017/10/24. */ public class AdEntity { public View adView; public int lineIndex; public AdEntity(View adView, int lineIndex) { this.adView = adView; this.lineIndex = lineIndex; } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <groupId>org.opencoweb</groupId> <artifactId>coweb-admin</artifactId> <version>1.0.1-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>admin-jar</artifactId> <packaging>jar</packaging> <name>OpenCoweb :: Java :: Admin :: Jar</name> <dependencies> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>6.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.wink</groupId> <artifactId>wink-json4j</artifactId> <version>1.1.2-incubating</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupId>org.opencoweb</groupId> <artifactId>coweb-server</artifactId> <version>${project.version}</version> <type>jar</type> <scope>provided</scope> </dependency> </dependencies> </project>
{ "pile_set_name": "Github" }
CONFIG_RCU_REF_SCALE_TEST=y CONFIG_PRINTK_TIME=y
{ "pile_set_name": "Github" }
using System; using System.Collections; using System.Collections.Generic; using System.Globalization; namespace SortingDemo { class Program { static void Main() { string[] names = {"Alabama", "Texas", "Washington", "Virginia", "Wisconsin", "Wyoming", "Kentucky", "Missouri", "Utah", "Hawaii", "Kansas", "Louisiana", "Alaska", "Arizona"}; CultureInfo.CurrentCulture = new CultureInfo("fi-FI"); Array.Sort(names); DisplayNames("Sorted using the Finnish culture", names); // sort using the invariant culture Array.Sort(names, Comparer.DefaultInvariant); DisplayNames("Sorted using the invariant culture", names); } public static void DisplayNames(string title, IEnumerable<string> names) { Console.WriteLine(title); Console.WriteLine(string.Join("-", names)); Console.WriteLine(); } } }
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <configuration> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /> </handlers> <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" /> </system.webServer> </configuration>
{ "pile_set_name": "Github" }
#!/usr/bin/env bash # # test of qemu-img convert -n - convert without creation # # Copyright (C) 2009 Red Hat, Inc. # Copyright (C) 2013 Alex Bligh (alex@alex.org.uk) # # 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, see <http://www.gnu.org/licenses/>. # # creator owner=alex@alex.org.uk seq=`basename $0` echo "QA output created by $seq" status=1 # failure is the default! _cleanup() { _cleanup_test_img for img in "$TEST_IMG".{orig,raw1,raw2,target}; do _rm_test_img "$img" done } trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common.rc . ./common.filter . ./common.pattern _supported_fmt qcow qcow2 vmdk qed raw _supported_proto file _unsupported_imgopts "subformat=monolithicFlat" \ "subformat=twoGbMaxExtentFlat" \ "subformat=twoGbMaxExtentSparse" \ "subformat=streamOptimized" _make_test_img 4M echo "== Testing conversion with -n fails with no target file ==" if $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG" "$TEST_IMG.orig" >/dev/null 2>&1; then exit 1 fi echo "== Testing conversion with -n succeeds with a target file ==" _rm_test_img "$TEST_IMG.orig" TEST_IMG="$TEST_IMG.orig" _make_test_img 4M if ! $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG" "$TEST_IMG.orig" ; then exit 1 fi echo "== Testing conversion to raw is the same after conversion with -n ==" # compare the raw files if ! $QEMU_IMG convert -f $IMGFMT -O raw "$TEST_IMG" "$TEST_IMG.raw1" ; then exit 1 fi if ! $QEMU_IMG convert -f $IMGFMT -O raw "$TEST_IMG.orig" "$TEST_IMG.raw2" ; then exit 1 fi if ! cmp "$TEST_IMG.raw1" "$TEST_IMG.raw2" ; then exit 1 fi echo "== Testing conversion back to original format ==" if ! $QEMU_IMG convert -f raw -O $IMGFMT -n "$TEST_IMG.raw2" "$TEST_IMG" ; then exit 1 fi _check_test_img echo "== Testing conversion to a smaller file fails ==" TEST_IMG="$TEST_IMG.target" _make_test_img 2M if $QEMU_IMG convert -f $IMGFMT -O $IMGFMT -n "$TEST_IMG" "$TEST_IMG.target" >/dev/null 2>&1; then exit 1 fi echo "== Regression testing for copy offloading bug ==" _make_test_img 1M TEST_IMG="$TEST_IMG.target" _make_test_img 1M $QEMU_IO -c 'write -P 1 0 512k' -c 'write -P 2 512k 512k' "$TEST_IMG" | _filter_qemu_io $QEMU_IO -c 'write -P 4 512k 512k' -c 'write -P 3 0 512k' "$TEST_IMG.target" | _filter_qemu_io $QEMU_IMG convert -n -O $IMGFMT "$TEST_IMG" "$TEST_IMG.target" $QEMU_IMG compare "$TEST_IMG" "$TEST_IMG.target" echo "*** done" rm -f $seq.full status=0 exit 0
{ "pile_set_name": "Github" }