text
stringlengths
2
99.9k
meta
dict
HTML.Proprietary TYPE: bool VERSION: 3.1.0 DEFAULT: false --DESCRIPTION-- <p> Whether or not to allow proprietary elements and attributes in your documents, as per <code>HTMLPurifier_HTMLModule_Proprietary</code>. <strong>Warning:</strong> This can cause your documents to stop validating! </p>
{ "pile_set_name": "Github" }
// +build !go1.6 package testsuite_test import ( "io/ioutil" "os" "path/filepath" . "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo/ginkgo/testsuite" . "github.com/onsi/gomega" ) var _ = Describe("TestSuite", func() { var tmpDir string var relTmpDir string writeFile := func(folder string, filename string, content string, mode os.FileMode) { path := filepath.Join(tmpDir, folder) err := os.MkdirAll(path, 0700) Ω(err).ShouldNot(HaveOccurred()) path = filepath.Join(path, filename) ioutil.WriteFile(path, []byte(content), mode) } var origVendor string BeforeSuite(func() { origVendor = os.Getenv("GO15VENDOREXPERIMENT") }) AfterSuite(func() { os.Setenv("GO15VENDOREXPERIMENT", origVendor) }) BeforeEach(func() { var err error tmpDir, err = ioutil.TempDir("/tmp", "ginkgo") Ω(err).ShouldNot(HaveOccurred()) cwd, err := os.Getwd() Ω(err).ShouldNot(HaveOccurred()) relTmpDir, err = filepath.Rel(cwd, tmpDir) Ω(err).ShouldNot(HaveOccurred()) //go files in the root directory (no tests) writeFile("/", "main.go", "package main", 0666) //non-go files in a nested directory writeFile("/redherring", "big_test.jpg", "package ginkgo", 0666) //non-ginkgo tests in a nested directory writeFile("/professorplum", "professorplum_test.go", `import "testing"`, 0666) //ginkgo tests in a nested directory writeFile("/colonelmustard", "colonelmustard_test.go", `import "github.com/onsi/ginkgo"`, 0666) //ginkgo tests in a deeply nested directory writeFile("/colonelmustard/library", "library_test.go", `import "github.com/onsi/ginkgo"`, 0666) //ginkgo tests deeply nested in a vendored dependency writeFile("/vendor/mrspeacock/lounge", "lounge_test.go", `import "github.com/onsi/ginkgo"`, 0666) //a precompiled ginkgo test writeFile("/precompiled-dir", "precompiled.test", `fake-binary-file`, 0777) writeFile("/precompiled-dir", "some-other-binary", `fake-binary-file`, 0777) writeFile("/precompiled-dir", "nonexecutable.test", `fake-binary-file`, 0666) }) AfterEach(func() { os.RemoveAll(tmpDir) }) Describe("Finding precompiled test suites", func() { Context("if pointed at an executable file that ends with .test", func() { It("should return a precompiled test suite", func() { suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "precompiled.test")) Ω(err).ShouldNot(HaveOccurred()) Ω(suite).Should(Equal(TestSuite{ Path: relTmpDir + "/precompiled-dir", PackageName: "precompiled", IsGinkgo: true, Precompiled: true, })) }) }) Context("if pointed at a directory", func() { It("should error", func() { suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir")) Ω(suite).Should(BeZero()) Ω(err).Should(HaveOccurred()) }) }) Context("if pointed at an executable that doesn't have .test", func() { It("should error", func() { suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "some-other-binary")) Ω(suite).Should(BeZero()) Ω(err).Should(HaveOccurred()) }) }) Context("if pointed at a .test that isn't executable", func() { It("should error", func() { suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "nonexecutable.test")) Ω(suite).Should(BeZero()) Ω(err).Should(HaveOccurred()) }) }) Context("if pointed at a nonexisting file", func() { It("should error", func() { suite, err := PrecompiledTestSuite(filepath.Join(tmpDir, "precompiled-dir", "nope-nothing-to-see-here")) Ω(suite).Should(BeZero()) Ω(err).Should(HaveOccurred()) }) }) }) Describe("scanning for suites in a directory", func() { Context("when there are no tests in the specified directory", func() { It("should come up empty", func() { suites := SuitesInDir(tmpDir, false) Ω(suites).Should(BeEmpty()) }) }) Context("when there are ginkgo tests in the specified directory", func() { It("should return an appropriately configured suite", func() { suites := SuitesInDir(filepath.Join(tmpDir, "colonelmustard"), false) Ω(suites).Should(HaveLen(1)) Ω(suites[0].Path).Should(Equal(relTmpDir + "/colonelmustard")) Ω(suites[0].PackageName).Should(Equal("colonelmustard")) Ω(suites[0].IsGinkgo).Should(BeTrue()) Ω(suites[0].Precompiled).Should(BeFalse()) }) }) Context("when there are non-ginkgo tests in the specified directory", func() { It("should return an appropriately configured suite", func() { suites := SuitesInDir(filepath.Join(tmpDir, "professorplum"), false) Ω(suites).Should(HaveLen(1)) Ω(suites[0].Path).Should(Equal(relTmpDir + "/professorplum")) Ω(suites[0].PackageName).Should(Equal("professorplum")) Ω(suites[0].IsGinkgo).Should(BeFalse()) Ω(suites[0].Precompiled).Should(BeFalse()) }) }) Context("given GO15VENDOREXPERIMENT", func() { BeforeEach(func() { os.Setenv("GO15VENDOREXPERIMENT", "1") }) AfterEach(func() { os.Setenv("GO15VENDOREXPERIMENT", "") }) It("should skip vendor dirs", func() { suites := SuitesInDir(filepath.Join(tmpDir+"/vendor"), false) Ω(suites).Should(HaveLen(0)) }) It("should not recurse into vendor dirs", func() { suites := SuitesInDir(filepath.Join(tmpDir), true) Ω(suites).Should(HaveLen(3)) }) }) Context("when recursively scanning", func() { It("should return suites for corresponding test suites, only", func() { suites := SuitesInDir(tmpDir, true) Ω(suites).Should(HaveLen(4)) Ω(suites).Should(ContainElement(TestSuite{ Path: relTmpDir + "/colonelmustard", PackageName: "colonelmustard", IsGinkgo: true, Precompiled: false, })) Ω(suites).Should(ContainElement(TestSuite{ Path: relTmpDir + "/professorplum", PackageName: "professorplum", IsGinkgo: false, Precompiled: false, })) Ω(suites).Should(ContainElement(TestSuite{ Path: relTmpDir + "/colonelmustard/library", PackageName: "library", IsGinkgo: true, Precompiled: false, })) }) }) }) })
{ "pile_set_name": "Github" }
#pragma warning disable using System; using System.Runtime.InteropServices; namespace Warewolf.Studio.Core { public class CookieHelper { public const int InternetOptionEndBrowserSession = 42; protected CookieHelper() { } [DllImport("wininet.dll", SetLastError = true)] public static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int lpdwBufferLength); } }
{ "pile_set_name": "Github" }
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> </PropertyGroup> <ItemGroup> </ItemGroup> <ItemGroup> <ProjectReference Include="..\FSharpTestA1\FSharpTestA1.fsproj" /> <ProjectReference Include="..\FSharpTestA2\FSharpTestA2.fsproj" /> <ProjectReference Include="..\FSharpTestA3\FSharpTestA3.fsproj" /> <ProjectReference Include="..\FSharpTestA4\FSharpTestA4.fsproj" /> <ProjectReference Include="..\FSharpTestA5\FSharpTestA5.fsproj" /> <ProjectReference Include="..\FSharpTestA6\FSharpTestA6.fsproj" /> <ProjectReference Include="..\FSharpTestA7\FSharpTestA7.fsproj" /> <ProjectReference Include="..\FSharpTestA8\FSharpTestA8.fsproj" /> <ProjectReference Include="..\FSharpTestA9\FSharpTestA9.fsproj" /> <ProjectReference Include="..\FSharpTestA10\FSharpTestA10.fsproj" /> <ProjectReference Include="..\FSharpTestA11\FSharpTestA11.fsproj" /> <ProjectReference Include="..\FSharpTestA12\FSharpTestA12.fsproj" /> <ProjectReference Include="..\FSharpTestA13\FSharpTestA13.fsproj" /> <ProjectReference Include="..\FSharpTestA14\FSharpTestA14.fsproj" /> <ProjectReference Include="..\FSharpTestA15\FSharpTestA15.fsproj" /> <ProjectReference Include="..\FSharpTestA16\FSharpTestA16.fsproj" /> <ProjectReference Include="..\FSharpTestA17\FSharpTestA17.fsproj" /> <ProjectReference Include="..\FSharpTestA18\FSharpTestA18.fsproj" /> <ProjectReference Include="..\FSharpTestA19\FSharpTestA19.fsproj" /> <ProjectReference Include="..\FSharpTestA20\FSharpTestA20.fsproj" /> <ProjectReference Include="..\FSharpTestA21\FSharpTestA21.fsproj" /> <ProjectReference Include="..\FSharpTestA22\FSharpTestA22.fsproj" /> <ProjectReference Include="..\FSharpTestA23\FSharpTestA23.fsproj" /> <ProjectReference Include="..\FSharpTestA24\FSharpTestA24.fsproj" /> <ProjectReference Include="..\FSharpTestA25\FSharpTestA25.fsproj" /> <ProjectReference Include="..\FSharpTestA26\FSharpTestA26.fsproj" /> <ProjectReference Include="..\FSharpTestA27\FSharpTestA27.fsproj" /> <ProjectReference Include="..\FSharpTestA28\FSharpTestA28.fsproj" /> <ProjectReference Include="..\FSharpTestA29\FSharpTestA29.fsproj" /> <ProjectReference Include="..\FSharpTestA30\FSharpTestA30.fsproj" /> <ProjectReference Include="..\FSharpTestA31\FSharpTestA31.fsproj" /> <ProjectReference Include="..\FSharpTestA32\FSharpTestA32.fsproj" /> <ProjectReference Include="..\FSharpTestA33\FSharpTestA33.fsproj" /> <ProjectReference Include="..\FSharpTestA34\FSharpTestA34.fsproj" /> <ProjectReference Include="..\FSharpTestA35\FSharpTestA35.fsproj" /> <ProjectReference Include="..\FSharpTestA36\FSharpTestA36.fsproj" /> <ProjectReference Include="..\FSharpTestA37\FSharpTestA37.fsproj" /> <ProjectReference Include="..\FSharpTestA38\FSharpTestA38.fsproj" /> <ProjectReference Include="..\FSharpTestA39\FSharpTestA39.fsproj" /> <ProjectReference Include="..\FSharpTestA40\FSharpTestA40.fsproj" /> <ProjectReference Include="..\FSharpTestA41\FSharpTestA41.fsproj" /> <ProjectReference Include="..\FSharpTestA42\FSharpTestA42.fsproj" /> <ProjectReference Include="..\FSharpTestA43\FSharpTestA43.fsproj" /> <ProjectReference Include="..\FSharpTestA44\FSharpTestA44.fsproj" /> <ProjectReference Include="..\FSharpTestA45\FSharpTestA45.fsproj" /> <ProjectReference Include="..\FSharpTestA46\FSharpTestA46.fsproj" /> <ProjectReference Include="..\FSharpTestA47\FSharpTestA47.fsproj" /> <ProjectReference Include="..\FSharpTestA48\FSharpTestA48.fsproj" /> <ProjectReference Include="..\FSharpTestA49\FSharpTestA49.fsproj" /> <ProjectReference Include="..\FSharpTestA50\FSharpTestA50.fsproj" /> </ItemGroup> <ItemGroup> </ItemGroup> </Project>
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Oct 15 2018 10:31:50). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard. // @class NSData; @protocol FxCustomParameterDefinition - (id)valueFromData:(NSData *)arg1; - (NSData *)dataFromValue:(id)arg1; @end
{ "pile_set_name": "Github" }
// Module included in the following assemblies: // // * installing/installing_aws/installing-aws-user-infra.adoc // * installing/installing_bare_metal/installing-bare-metal.adoc // * installing/installing_aws/installing-restricted-networks-aws.adoc // * installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc // * installing/installing_vsphere/installing-restricted-networks-vsphere.adoc // * installing/installing_vsphere/installing-vsphere.adoc // * installing/installing_ibm_z/installing-ibm-z.adoc [id="installation-registry-storage-non-production_{context}"] = Configuring storage for the image registry in non-production clusters You must configure storage for the image registry Operator. For non-production clusters, you can set the image registry to an empty directory. If you do so, all images are lost if you restart the registry. .Procedure * To set the image registry storage to an empty directory: + [source,terminal] ---- $ oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"storage":{"emptyDir":{}}}}' ---- + [WARNING] ==== Configure this option for only non-production clusters. ==== + If you run this command before the Image Registry Operator initializes its components, the `oc patch` command fails with the following error: + [source,terminal] ---- Error from server (NotFound): configs.imageregistry.operator.openshift.io "cluster" not found ---- + Wait a few minutes and run the command again.
{ "pile_set_name": "Github" }
using UnityEngine; using System.Collections; namespace GameMachine { public enum ControllerType { Local, Remote } }
{ "pile_set_name": "Github" }
// Copyright (c) 2010 Martin Knafve / hMailServer.com. // http://www.hmailserver.com #pragma once namespace HM { class TestConnect { public: bool PerformTest(ConnectionSecurity connection_security, const String &localAddressStr, const String &server, int port, String &result); }; }
{ "pile_set_name": "Github" }
/****************************************************************************** * * This file is provided under a dual BSD/GPLv2 license. When using or * redistributing this file, you may do so under either license. * * GPL LICENSE SUMMARY * * Copyright(c) 2005 - 2011 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * 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, * USA * * The full GNU General Public License is included in this distribution * in the file called LICENSE.GPL. * * Contact Information: * Intel Linux Wireless <ilw@linux.intel.com> * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 * * BSD LICENSE * * Copyright(c) 2005 - 2011 Intel Corporation. All rights reserved. * 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 Intel Corporation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #ifndef __il_prph_h__ #define __il_prph_h__ /* * Registers in this file are internal, not PCI bus memory mapped. * Driver accesses these via HBUS_TARG_PRPH_* registers. */ #define PRPH_BASE (0x00000) #define PRPH_END (0xFFFFF) /* APMG (power management) constants */ #define APMG_BASE (PRPH_BASE + 0x3000) #define APMG_CLK_CTRL_REG (APMG_BASE + 0x0000) #define APMG_CLK_EN_REG (APMG_BASE + 0x0004) #define APMG_CLK_DIS_REG (APMG_BASE + 0x0008) #define APMG_PS_CTRL_REG (APMG_BASE + 0x000c) #define APMG_PCIDEV_STT_REG (APMG_BASE + 0x0010) #define APMG_RFKILL_REG (APMG_BASE + 0x0014) #define APMG_RTC_INT_STT_REG (APMG_BASE + 0x001c) #define APMG_RTC_INT_MSK_REG (APMG_BASE + 0x0020) #define APMG_DIGITAL_SVR_REG (APMG_BASE + 0x0058) #define APMG_ANALOG_SVR_REG (APMG_BASE + 0x006C) #define APMS_CLK_VAL_MRB_FUNC_MODE (0x00000001) #define APMG_CLK_VAL_DMA_CLK_RQT (0x00000200) #define APMG_CLK_VAL_BSM_CLK_RQT (0x00000800) #define APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS (0x00400000) #define APMG_PS_CTRL_VAL_RESET_REQ (0x04000000) #define APMG_PS_CTRL_MSK_PWR_SRC (0x03000000) #define APMG_PS_CTRL_VAL_PWR_SRC_VMAIN (0x00000000) #define APMG_PS_CTRL_VAL_PWR_SRC_MAX (0x01000000) /* 3945 only */ #define APMG_PS_CTRL_VAL_PWR_SRC_VAUX (0x02000000) #define APMG_SVR_VOLTAGE_CONFIG_BIT_MSK (0x000001E0) /* bit 8:5 */ #define APMG_SVR_DIGITAL_VOLTAGE_1_32 (0x00000060) #define APMG_PCIDEV_STT_VAL_L1_ACT_DIS (0x00000800) /** * BSM (Bootstrap State Machine) * * The Bootstrap State Machine (BSM) stores a short bootstrap uCode program * in special SRAM that does not power down when the embedded control * processor is sleeping (e.g. for periodic power-saving shutdowns of radio). * * When powering back up after sleeps (or during initial uCode load), the BSM * internally loads the short bootstrap program from the special SRAM into the * embedded processor's instruction SRAM, and starts the processor so it runs * the bootstrap program. * * This bootstrap program loads (via PCI busmaster DMA) instructions and data * images for a uCode program from host DRAM locations. The host driver * indicates DRAM locations and sizes for instruction and data images via the * four BSM_DRAM_* registers. Once the bootstrap program loads the new program, * the new program starts automatically. * * The uCode used for open-source drivers includes two programs: * * 1) Initialization -- performs hardware calibration and sets up some * internal data, then notifies host via "initialize alive" notification * (struct il_init_alive_resp) that it has completed all of its work. * After signal from host, it then loads and starts the runtime program. * The initialization program must be used when initially setting up the * NIC after loading the driver. * * 2) Runtime/Protocol -- performs all normal runtime operations. This * notifies host via "alive" notification (struct il_alive_resp) that it * is ready to be used. * * When initializing the NIC, the host driver does the following procedure: * * 1) Load bootstrap program (instructions only, no data image for bootstrap) * into bootstrap memory. Use dword writes starting at BSM_SRAM_LOWER_BOUND * * 2) Point (via BSM_DRAM_*) to the "initialize" uCode data and instruction * images in host DRAM. * * 3) Set up BSM to copy from BSM SRAM into uCode instruction SRAM when asked: * BSM_WR_MEM_SRC_REG = 0 * BSM_WR_MEM_DST_REG = RTC_INST_LOWER_BOUND * BSM_WR_MEM_DWCOUNT_REG = # dwords in bootstrap instruction image * * 4) Load bootstrap into instruction SRAM: * BSM_WR_CTRL_REG = BSM_WR_CTRL_REG_BIT_START * * 5) Wait for load completion: * Poll BSM_WR_CTRL_REG for BSM_WR_CTRL_REG_BIT_START = 0 * * 6) Enable future boot loads whenever NIC's power management triggers it: * BSM_WR_CTRL_REG = BSM_WR_CTRL_REG_BIT_START_EN * * 7) Start the NIC by removing all reset bits: * CSR_RESET = 0 * * The bootstrap uCode (already in instruction SRAM) loads initialization * uCode. Initialization uCode performs data initialization, sends * "initialize alive" notification to host, and waits for a signal from * host to load runtime code. * * 4) Point (via BSM_DRAM_*) to the "runtime" uCode data and instruction * images in host DRAM. The last register loaded must be the instruction * byte count register ("1" in MSbit tells initialization uCode to load * the runtime uCode): * BSM_DRAM_INST_BYTECOUNT_REG = byte count | BSM_DRAM_INST_LOAD * * 5) Wait for "alive" notification, then issue normal runtime commands. * * Data caching during power-downs: * * Just before the embedded controller powers down (e.g for automatic * power-saving modes, or for RFKILL), uCode stores (via PCI busmaster DMA) * a current snapshot of the embedded processor's data SRAM into host DRAM. * This caches the data while the embedded processor's memory is powered down. * Location and size are controlled by BSM_DRAM_DATA_* registers. * * NOTE: Instruction SRAM does not need to be saved, since that doesn't * change during operation; the original image (from uCode distribution * file) can be used for reload. * * When powering back up, the BSM loads the bootstrap program. Bootstrap looks * at the BSM_DRAM_* registers, which now point to the runtime instruction * image and the cached (modified) runtime data (*not* the initialization * uCode). Bootstrap reloads these runtime images into SRAM, and restarts the * uCode from where it left off before the power-down. * * NOTE: Initialization uCode does *not* run as part of the save/restore * procedure. * * This save/restore method is mostly for autonomous power management during * normal operation (result of C_POWER_TBL). Platform suspend/resume and * RFKILL should use complete restarts (with total re-initialization) of uCode, * allowing total shutdown (including BSM memory). * * Note that, during normal operation, the host DRAM that held the initial * startup data for the runtime code is now being used as a backup data cache * for modified data! If you need to completely re-initialize the NIC, make * sure that you use the runtime data image from the uCode distribution file, * not the modified/saved runtime data. You may want to store a separate * "clean" runtime data image in DRAM to avoid disk reads of distribution file. */ /* BSM bit fields */ #define BSM_WR_CTRL_REG_BIT_START (0x80000000) /* start boot load now */ #define BSM_WR_CTRL_REG_BIT_START_EN (0x40000000) /* enable boot after pwrup */ #define BSM_DRAM_INST_LOAD (0x80000000) /* start program load now */ /* BSM addresses */ #define BSM_BASE (PRPH_BASE + 0x3400) #define BSM_END (PRPH_BASE + 0x3800) #define BSM_WR_CTRL_REG (BSM_BASE + 0x000) /* ctl and status */ #define BSM_WR_MEM_SRC_REG (BSM_BASE + 0x004) /* source in BSM mem */ #define BSM_WR_MEM_DST_REG (BSM_BASE + 0x008) /* dest in SRAM mem */ #define BSM_WR_DWCOUNT_REG (BSM_BASE + 0x00C) /* bytes */ #define BSM_WR_STATUS_REG (BSM_BASE + 0x010) /* bit 0: 1 == done */ /* * Pointers and size regs for bootstrap load and data SRAM save/restore. * NOTE: 3945 pointers use bits 31:0 of DRAM address. * 4965 pointers use bits 35:4 of DRAM address. */ #define BSM_DRAM_INST_PTR_REG (BSM_BASE + 0x090) #define BSM_DRAM_INST_BYTECOUNT_REG (BSM_BASE + 0x094) #define BSM_DRAM_DATA_PTR_REG (BSM_BASE + 0x098) #define BSM_DRAM_DATA_BYTECOUNT_REG (BSM_BASE + 0x09C) /* * BSM special memory, stays powered on during power-save sleeps. * Read/write, address range from LOWER_BOUND to (LOWER_BOUND + SIZE -1) */ #define BSM_SRAM_LOWER_BOUND (PRPH_BASE + 0x3800) #define BSM_SRAM_SIZE (1024) /* bytes */ /* 3945 Tx scheduler registers */ #define ALM_SCD_BASE (PRPH_BASE + 0x2E00) #define ALM_SCD_MODE_REG (ALM_SCD_BASE + 0x000) #define ALM_SCD_ARASTAT_REG (ALM_SCD_BASE + 0x004) #define ALM_SCD_TXFACT_REG (ALM_SCD_BASE + 0x010) #define ALM_SCD_TXF4MF_REG (ALM_SCD_BASE + 0x014) #define ALM_SCD_TXF5MF_REG (ALM_SCD_BASE + 0x020) #define ALM_SCD_SBYP_MODE_1_REG (ALM_SCD_BASE + 0x02C) #define ALM_SCD_SBYP_MODE_2_REG (ALM_SCD_BASE + 0x030) /** * Tx Scheduler * * The Tx Scheduler selects the next frame to be transmitted, choosing TFDs * (Transmit Frame Descriptors) from up to 16 circular Tx queues resident in * host DRAM. It steers each frame's Tx command (which contains the frame * data) into one of up to 7 prioritized Tx DMA FIFO channels within the * device. A queue maps to only one (selectable by driver) Tx DMA channel, * but one DMA channel may take input from several queues. * * Tx DMA FIFOs have dedicated purposes. For 4965, they are used as follows * (cf. default_queue_to_tx_fifo in 4965.c): * * 0 -- EDCA BK (background) frames, lowest priority * 1 -- EDCA BE (best effort) frames, normal priority * 2 -- EDCA VI (video) frames, higher priority * 3 -- EDCA VO (voice) and management frames, highest priority * 4 -- Commands (e.g. RXON, etc.) * 5 -- unused (HCCA) * 6 -- unused (HCCA) * 7 -- not used by driver (device-internal only) * * * Driver should normally map queues 0-6 to Tx DMA/FIFO channels 0-6. * In addition, driver can map the remaining queues to Tx DMA/FIFO * channels 0-3 to support 11n aggregation via EDCA DMA channels. * * The driver sets up each queue to work in one of two modes: * * 1) Scheduler-Ack, in which the scheduler automatically supports a * block-ack (BA) win of up to 64 TFDs. In this mode, each queue * contains TFDs for a unique combination of Recipient Address (RA) * and Traffic Identifier (TID), that is, traffic of a given * Quality-Of-Service (QOS) priority, destined for a single station. * * In scheduler-ack mode, the scheduler keeps track of the Tx status of * each frame within the BA win, including whether it's been transmitted, * and whether it's been acknowledged by the receiving station. The device * automatically processes block-acks received from the receiving STA, * and reschedules un-acked frames to be retransmitted (successful * Tx completion may end up being out-of-order). * * The driver must maintain the queue's Byte Count table in host DRAM * (struct il4965_sched_queue_byte_cnt_tbl) for this mode. * This mode does not support fragmentation. * * 2) FIFO (a.k.a. non-Scheduler-ACK), in which each TFD is processed in order. * The device may automatically retry Tx, but will retry only one frame * at a time, until receiving ACK from receiving station, or reaching * retry limit and giving up. * * The command queue (#4/#9) must use this mode! * This mode does not require use of the Byte Count table in host DRAM. * * Driver controls scheduler operation via 3 means: * 1) Scheduler registers * 2) Shared scheduler data base in internal 4956 SRAM * 3) Shared data in host DRAM * * Initialization: * * When loading, driver should allocate memory for: * 1) 16 TFD circular buffers, each with space for (typically) 256 TFDs. * 2) 16 Byte Count circular buffers in 16 KBytes contiguous memory * (1024 bytes for each queue). * * After receiving "Alive" response from uCode, driver must initialize * the scheduler (especially for queue #4/#9, the command queue, otherwise * the driver can't issue commands!): */ /** * Max Tx win size is the max number of contiguous TFDs that the scheduler * can keep track of at one time when creating block-ack chains of frames. * Note that "64" matches the number of ack bits in a block-ack packet. * Driver should use SCD_WIN_SIZE and SCD_FRAME_LIMIT values to initialize * IL49_SCD_CONTEXT_QUEUE_OFFSET(x) values. */ #define SCD_WIN_SIZE 64 #define SCD_FRAME_LIMIT 64 /* SCD registers are internal, must be accessed via HBUS_TARG_PRPH regs */ #define IL49_SCD_START_OFFSET 0xa02c00 /* * 4965 tells driver SRAM address for internal scheduler structs via this reg. * Value is valid only after "Alive" response from uCode. */ #define IL49_SCD_SRAM_BASE_ADDR (IL49_SCD_START_OFFSET + 0x0) /* * Driver may need to update queue-empty bits after changing queue's * write and read pointers (idxes) during (re-)initialization (i.e. when * scheduler is not tracking what's happening). * Bit fields: * 31-16: Write mask -- 1: update empty bit, 0: don't change empty bit * 15-00: Empty state, one for each queue -- 1: empty, 0: non-empty * NOTE: This register is not used by Linux driver. */ #define IL49_SCD_EMPTY_BITS (IL49_SCD_START_OFFSET + 0x4) /* * Physical base address of array of byte count (BC) circular buffers (CBs). * Each Tx queue has a BC CB in host DRAM to support Scheduler-ACK mode. * This register points to BC CB for queue 0, must be on 1024-byte boundary. * Others are spaced by 1024 bytes. * Each BC CB is 2 bytes * (256 + 64) = 740 bytes, followed by 384 bytes pad. * (Index into a queue's BC CB) = (idx into queue's TFD CB) = (SSN & 0xff). * Bit fields: * 25-00: Byte Count CB physical address [35:10], must be 1024-byte aligned. */ #define IL49_SCD_DRAM_BASE_ADDR (IL49_SCD_START_OFFSET + 0x10) /* * Enables any/all Tx DMA/FIFO channels. * Scheduler generates requests for only the active channels. * Set this to 0xff to enable all 8 channels (normal usage). * Bit fields: * 7- 0: Enable (1), disable (0), one bit for each channel 0-7 */ #define IL49_SCD_TXFACT (IL49_SCD_START_OFFSET + 0x1c) /* * Queue (x) Write Pointers (idxes, really!), one for each Tx queue. * Initialized and updated by driver as new TFDs are added to queue. * NOTE: If using Block Ack, idx must correspond to frame's * Start Sequence Number; idx = (SSN & 0xff) * NOTE: Alternative to HBUS_TARG_WRPTR, which is what Linux driver uses? */ #define IL49_SCD_QUEUE_WRPTR(x) (IL49_SCD_START_OFFSET + 0x24 + (x) * 4) /* * Queue (x) Read Pointers (idxes, really!), one for each Tx queue. * For FIFO mode, idx indicates next frame to transmit. * For Scheduler-ACK mode, idx indicates first frame in Tx win. * Initialized by driver, updated by scheduler. */ #define IL49_SCD_QUEUE_RDPTR(x) (IL49_SCD_START_OFFSET + 0x64 + (x) * 4) /* * Select which queues work in chain mode (1) vs. not (0). * Use chain mode to build chains of aggregated frames. * Bit fields: * 31-16: Reserved * 15-00: Mode, one bit for each queue -- 1: Chain mode, 0: one-at-a-time * NOTE: If driver sets up queue for chain mode, it should be also set up * Scheduler-ACK mode as well, via SCD_QUEUE_STATUS_BITS(x). */ #define IL49_SCD_QUEUECHAIN_SEL (IL49_SCD_START_OFFSET + 0xd0) /* * Select which queues interrupt driver when scheduler increments * a queue's read pointer (idx). * Bit fields: * 31-16: Reserved * 15-00: Interrupt enable, one bit for each queue -- 1: enabled, 0: disabled * NOTE: This functionality is apparently a no-op; driver relies on interrupts * from Rx queue to read Tx command responses and update Tx queues. */ #define IL49_SCD_INTERRUPT_MASK (IL49_SCD_START_OFFSET + 0xe4) /* * Queue search status registers. One for each queue. * Sets up queue mode and assigns queue to Tx DMA channel. * Bit fields: * 19-10: Write mask/enable bits for bits 0-9 * 9: Driver should init to "0" * 8: Scheduler-ACK mode (1), non-Scheduler-ACK (i.e. FIFO) mode (0). * Driver should init to "1" for aggregation mode, or "0" otherwise. * 7-6: Driver should init to "0" * 5: Window Size Left; indicates whether scheduler can request * another TFD, based on win size, etc. Driver should init * this bit to "1" for aggregation mode, or "0" for non-agg. * 4-1: Tx FIFO to use (range 0-7). * 0: Queue is active (1), not active (0). * Other bits should be written as "0" * * NOTE: If enabling Scheduler-ACK mode, chain mode should also be enabled * via SCD_QUEUECHAIN_SEL. */ #define IL49_SCD_QUEUE_STATUS_BITS(x)\ (IL49_SCD_START_OFFSET + 0x104 + (x) * 4) /* Bit field positions */ #define IL49_SCD_QUEUE_STTS_REG_POS_ACTIVE (0) #define IL49_SCD_QUEUE_STTS_REG_POS_TXF (1) #define IL49_SCD_QUEUE_STTS_REG_POS_WSL (5) #define IL49_SCD_QUEUE_STTS_REG_POS_SCD_ACK (8) /* Write masks */ #define IL49_SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN (10) #define IL49_SCD_QUEUE_STTS_REG_MSK (0x0007FC00) /** * 4965 internal SRAM structures for scheduler, shared with driver ... * * Driver should clear and initialize the following areas after receiving * "Alive" response from 4965 uCode, i.e. after initial * uCode load, or after a uCode load done for error recovery: * * SCD_CONTEXT_DATA_OFFSET (size 128 bytes) * SCD_TX_STTS_BITMAP_OFFSET (size 256 bytes) * SCD_TRANSLATE_TBL_OFFSET (size 32 bytes) * * Driver accesses SRAM via HBUS_TARG_MEM_* registers. * Driver reads base address of this scheduler area from SCD_SRAM_BASE_ADDR. * All OFFSET values must be added to this base address. */ /* * Queue context. One 8-byte entry for each of 16 queues. * * Driver should clear this entire area (size 0x80) to 0 after receiving * "Alive" notification from uCode. Additionally, driver should init * each queue's entry as follows: * * LS Dword bit fields: * 0-06: Max Tx win size for Scheduler-ACK. Driver should init to 64. * * MS Dword bit fields: * 16-22: Frame limit. Driver should init to 10 (0xa). * * Driver should init all other bits to 0. * * Init must be done after driver receives "Alive" response from 4965 uCode, * and when setting up queue for aggregation. */ #define IL49_SCD_CONTEXT_DATA_OFFSET 0x380 #define IL49_SCD_CONTEXT_QUEUE_OFFSET(x) \ (IL49_SCD_CONTEXT_DATA_OFFSET + ((x) * 8)) #define IL49_SCD_QUEUE_CTX_REG1_WIN_SIZE_POS (0) #define IL49_SCD_QUEUE_CTX_REG1_WIN_SIZE_MSK (0x0000007F) #define IL49_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_POS (16) #define IL49_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK (0x007F0000) /* * Tx Status Bitmap * * Driver should clear this entire area (size 0x100) to 0 after receiving * "Alive" notification from uCode. Area is used only by device itself; * no other support (besides clearing) is required from driver. */ #define IL49_SCD_TX_STTS_BITMAP_OFFSET 0x400 /* * RAxTID to queue translation mapping. * * When queue is in Scheduler-ACK mode, frames placed in a that queue must be * for only one combination of receiver address (RA) and traffic ID (TID), i.e. * one QOS priority level destined for one station (for this wireless link, * not final destination). The SCD_TRANSLATE_TBL area provides 16 16-bit * mappings, one for each of the 16 queues. If queue is not in Scheduler-ACK * mode, the device ignores the mapping value. * * Bit fields, for each 16-bit map: * 15-9: Reserved, set to 0 * 8-4: Index into device's station table for recipient station * 3-0: Traffic ID (tid), range 0-15 * * Driver should clear this entire area (size 32 bytes) to 0 after receiving * "Alive" notification from uCode. To update a 16-bit map value, driver * must read a dword-aligned value from device SRAM, replace the 16-bit map * value of interest, and write the dword value back into device SRAM. */ #define IL49_SCD_TRANSLATE_TBL_OFFSET 0x500 /* Find translation table dword to read/write for given queue */ #define IL49_SCD_TRANSLATE_TBL_OFFSET_QUEUE(x) \ ((IL49_SCD_TRANSLATE_TBL_OFFSET + ((x) * 2)) & 0xfffffffc) #define IL_SCD_TXFIFO_POS_TID (0) #define IL_SCD_TXFIFO_POS_RA (4) #define IL_SCD_QUEUE_RA_TID_MAP_RATID_MSK (0x01FF) /*********************** END TX SCHEDULER *************************************/ #endif /* __il_prph_h__ */
{ "pile_set_name": "Github" }
/* This file is part of LIA_RAL which is a set of software based on ALIZE toolkit for speaker recognition. ALIZE toolkit is required to use LIA_RAL. LIA_RAL project is a development project was initiated by the computer science laboratory of Avignon / France (Laboratoire Informatique d'Avignon - LIA) [http://lia.univ-avignon.fr <http://lia.univ-avignon.fr/>]. Then it was supported by two national projects of the French Research Ministry: - TECHNOLANGUE program [http://www.technolangue.net] - MISTRAL program [http://mistral.univ-avignon.fr] LIA_RAL is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version. LIA_RAL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with LIA_RAL. If not, see [http://www.gnu.org/licenses/]. The LIA team as well as the LIA_RAL project team wants to highlight the limits of voice authentication in a forensic context. The "Person Authentification by Voice: A Need of Caution" paper proposes a good overview of this point (cf. "Person Authentification by Voice: A Need of Caution", Bonastre J.F., Bimbot F., Boe L.J., Campbell J.P., Douglas D.A., Magrin- chagnolleau I., Eurospeech 2003, Genova]. The conclusion of the paper of the paper is proposed bellow: [Currently, it is not possible to completely determine whether the similarity between two recordings is due to the speaker or to other factors, especially when: (a) the speaker does not cooperate, (b) there is no control over recording equipment, (c) recording conditions are not known, (d) one does not know whether the voice was disguised and, to a lesser extent, (e) the linguistic content of the message is not controlled. Caution and judgment must be exercised when applying speaker recognition techniques, whether human or automatic, to account for these uncontrolled factors. Under more constrained or calibrated situations, or as an aid for investigative purposes, judicious application of these techniques may be suitable, provided they are not considered as infallible. At the present time, there is no scientific process that enables one to uniquely characterize a persones voice or to identify with absolute certainty an individual from his or her voice.] Copyright (C) 2004-2010 Laboratoire d'informatique d'Avignon [http://lia.univ-avignon.fr] LIA_RAL admin [alize@univ-avignon.fr] Jean-Francois Bonastre [jean-francois.bonastre@univ-avignon.fr] */ #if !defined(ALIZE_TrainTarget_h) #define ALIZE_TrainTarget_h #include "alize.h" using namespace alize; using namespace std; int TrainTarget(alize::Config&); int TrainTargetLFA(alize::Config&); int TrainTargetJFA(alize::Config&); int TrainTargetByLabel(alize::Config&); #endif // !defined(TrainTarget)
{ "pile_set_name": "Github" }
# Polish translation for hidetopbar extension # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # Piotr Sokół <psokol.l10n@gmail.com>, 2017. # msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-10-24 15:24+0800\n" "PO-Revision-Date: 2017-01-15 17:21+0100\n" "Last-Translator: Piotr Sokół <psokol.l10n@gmail.com>\n" "Language-Team: polski <>\n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bits\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2;\n" "X-Generator: Gtranslator 2.91.7\n" #: prefs.js:26 msgid "<b>Sensitivity</b>" msgstr "<b>Czułość</b>" #: prefs.js:33 msgid "Show panel when mouse approaches edge of the screen" msgstr "Wyświetlenie panelu przenosząc wskaźnik myszy do krawędzi ekranu" #: prefs.js:34 msgid "Keep hot corner sensitive, even in hidden state" msgstr "Utrzymanie czułości naroża nawet przy ukrytym panelu" #: prefs.js:35 msgid "In the above case show overview, too" msgstr "Wyświetlanie ekranu podglądu" #: prefs.js:61 msgid "Pressure barrier's threshold." msgstr "Próg nacisku" #: prefs.js:62 msgid "Pressure barrier's timeout." msgstr "Czas nacisku" #: prefs.js:92 msgid "<b>Animation</b>" msgstr "<b>Animacja</b>" #: prefs.js:99 msgid "Slide animation time when entering/leaving overview." msgstr "Czas animacji wysuwania przełączając ekran podglądu" #: prefs.js:100 msgid "Slide animation time when mouse approaches edge of the screen." msgstr "Czas animacji wysuwania przenosząc wskaźnik do krawędzi ekranu" #: prefs.js:130 msgid "<b>Keyboard shortcuts</b>" msgstr "<b>Skróty klawiszowe</b>" #: prefs.js:194 msgid "Key that triggers the bar to be shown." msgstr "Przełączenie wyświetlania paska" #: prefs.js:215 msgid "Delay before the bar rehides after key press." msgstr "Opóźnienie ponownego ukrycia po wciśnięciu skrótu" #: prefs.js:231 msgid "Pressing the shortcut again rehides the panel." msgstr "Ponowne ukrywanie panelu wciśnięciem skrótu" #: prefs.js:261 msgid "<b>Intellihide</b>" msgstr "<b>Inteligentne ukrywanie</b>" #: prefs.js:268 msgid "Only hide panel when a window takes the space" msgstr "Ukrywanie tylko przed oknami" #: prefs.js:269 msgid "Only when the active window takes the space" msgstr "Ukrywanie tylko przed uaktywnionymi oknami"
{ "pile_set_name": "Github" }
#include "Dwarf.h" int Dwarf::get_race_int() const { return Races::Dwarf; } QString Dwarf::get_name() const { return "Dwarf"; } unsigned Dwarf::get_base_strength() const { return 22; } unsigned Dwarf::get_base_agility() const { return 16; } unsigned Dwarf::get_base_stamina() const { return 23; } unsigned Dwarf::get_base_intellect() const { return 19; } unsigned Dwarf::get_base_spirit() const { return 19; } double Dwarf::get_int_multiplier() const { return 1.0; } double Dwarf::get_spirit_multiplier() const { return 1.0; } unsigned Dwarf::get_axe_bonus() const { return 0; } unsigned Dwarf::get_sword_bonus() const { return 0; } unsigned Dwarf::get_mace_bonus() const { return 0; } unsigned Dwarf::get_bow_bonus() const { return 0; } unsigned Dwarf::get_gun_bonus() const { return 5; } unsigned Dwarf::get_thrown_bonus() const { return 0; }
{ "pile_set_name": "Github" }
// // main.m // SSIDCard // // Created by 753331342@qq.com on 04/26/2018. // Copyright (c) 2018 753331342@qq.com. All rights reserved. // @import UIKit; #import "SSAppDelegate.h" int main(int argc, char * argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([SSAppDelegate class])); } }
{ "pile_set_name": "Github" }
<META HTTP-EQUIV="REFRESH" CONTENT="900; URL=SessionExpired.aspx?lang=eng"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script language="javascript"> sitesection = "csol" navsection = "my account" pagetitle = "My Account" navmenu = "" subnavmenu = "" AcctOK = "False" Language = "English" Source = "" </script> <script> homePage = false</script> <script src="../Includes/g_jsnav.js"></script> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="ctl00_Head1"><title> </title><link rel="stylesheet" type="text/css" href="../Style/global.css" /> </head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="getSecondaryNav()"> <form name="aspnetForm" method="post" action="ChangePwd.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="aspnetForm"> <div> <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMjAwNzcwNjExMQ9kFgJmD2QWAgIDD2QWCAIDDxYCHgtfIUl0ZW1Db3VudAIFFgpmD2QWAgIBDw8WAh4LTmF2aWdhdGVVcmwFFGh0dHA6Ly93d3cuY29uZWQuY29tZBYCZg8PFgIeBFRleHQFDmNvbkVkLmNvbSBob21lZGQCAQ9kFgICAQ8PFgIfAQVHfi9TZXNzaW9uVHJhbnNmZXIuYXNweD9kaXI9MmFzcCZ1cmw9e2FzcHNlcnZlcn0vTWFpbkhvbWUuYXNwP3NyYz1ET1RORVRkFgJmDw8WAh8CBQ9teSBhY2NvdW50IGhvbWVkZAICD2QWAgIBDw8WAh8BBSZ+L01lbWJlclBhZ2VzL015QWNjb3VudHMuYXNweD9sYW5nPWVuZ2QWAmYPDxYCHwIFEm1hbmFnZSBteSBhY2NvdW50c2RkAgMPZBYCAgEPDxYCHwEFIn4vTm9uTWVtYmVyUGFnZXMvRkFRLmFzcHg/bGFuZz1lbmdkFgJmDw8WAh8CBQRoZWxwZGQCBA9kFgICAQ8PFgIfAQUNfi9Mb2dvZmYuYXNweGQWAmYPDxYCHwIFB0xvZyBPZmZkZAIFDw8WBB4ISW1hZ2VVcmwFJH4vSW1hZ2VzL3RpdGxlcy90aXRsZV9teV9hY2NvdW50LmdpZh4NQWx0ZXJuYXRlVGV4dAUKbXkgYWNjb3VudGRkAgkPZBYIZg8PFgIfAQUtaHR0cHM6Ly9hcHBzMS5jb25lZC5jb20vY3NvbC9yZXBvcnRvdXRhZ2UuYXNwZGQCAQ8PFgIfAQUtaHR0cHM6Ly9hcHBzMS5jb25lZC5jb20vY3NvbC9yZXBvcnRvdXRhZ2UuYXNwZGQCAg8PFgIfAQUvaHR0cHM6Ly9hcHBzMS5jb25lZC5jb20vY3NvbC9yZXBvcnRvdXRhZ2VzcC5hc3BkZAIDDw8WAh8BBS9odHRwczovL2FwcHMxLmNvbmVkLmNvbS9jc29sL3JlcG9ydG91dGFnZXNwLmFzcGRkAg0PDxYCHwEFLWh0dHBzOi8vYXBwczEuY29uZWQuY29tL2Nzb2wvcmVwb3J0b3V0YWdlLmFzcGRkGAIFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBUFjdGwwMCRNYWluJENoYW5nZVBhc3N3b3JkMSRTdWNjZXNzQ29udGFpbmVySUQkQ29udGludWVJbWFnZUJ1dHRvbgUaY3RsMDAkTWFpbiRDaGFuZ2VQYXNzd29yZDEPEGRmBQlhZGFtaGlsc3Nk" /> </div> <script type="text/javascript"> //<![CDATA[ var theForm = document.forms['aspnetForm']; if (!theForm) { theForm = document.aspnetForm; } function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } //]]> </script> <script src="/cemyaccount/WebResource.axd?d=S0Bdo2AMinIfse70yYIHjBQIseUAUbq3wQ-x8wji1lw_FcGuJaCv0MOlTRZwtBRneIsGOJOZ94xUgsWvNV6gctqPqpE1&amp;t=635120336057308985" type="text/javascript"></script> <script src="/cemyaccount/WebResource.axd?d=k1ty9xN0K-r0X2dHjL1wqKgW7DF_Tq-YWkXmUu09IfyvZmx75WVokK4Dxp2O311-C_dTdSF6wCN8BrQWKaxqtLrgkCI1&amp;t=635120336057308985" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ function WebForm_OnSubmit() { if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false; return true; } //]]> </script> <div> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBgK6lbCzCAKx4rmiBgKQwoPjDgKjw7DKDQL62p7bDgL79cydCA==" /> </div> <!-- DYNAMIC LAYER CONSTRUCT --> <div id="secondarynav"></div> <div id="secondarysubnav"></div> <div id="subnavigation"></div> <!-- DYNAMIC LAYER CONSTRUCT END --> <!-- HEADER TABLE CONSTRUCT --> <table cellspacing="0" cellpadding="0" border="0" width="100%"> <tr> <td bgcolor="#0090dd"> <a href="http://www.coned.com/"><img src="../Images/primary_logo.gif" alt="Consolidated Edison Company of New York" border="0" WIDTH="200" HEIGHT="75"></a> </td> <td bgcolor="#0090dd" width="100%"><img src="../Images/headers/header_myaccount.jpg" alt="my account header image" title="my account header image" border="0"></td> </tr> <tr> <td bgcolor="#0090dd"></td> <td> <table bgcolor="#0090dd" cellspacing="0" cellpadding="0" border="0"> <tr> <td><img src="../Images/topnav/top_nav_separator.gif" WIDTH="1" HEIGHT="17"></td> <td> <a href="#" onmouseover="liteNav(&quot;myaccount&quot;,1);showSubnav(&quot;myaccount&quot;)" onmouseout="liteNav(&quot;myaccount&quot;,0)"><img name="navimg_myaccount" id="navimg_myaccount" border="0" src="../Images/topnav/top_nav_myaccount.gif" WIDTH="65" HEIGHT="17"></a> <!--<a id="ctl00_LinkLanguage" onmouseover="liteNav(&quot;myaccount&quot;,1);showSubnav(&quot;myaccount&quot;)" onmouseout="liteNav(&quot;myaccount&quot;,0)"><img name="navimg_myaccount" id="Img1" border="0" src="../Images/topnav/top_nav_myaccount.gif" WIDTH="65" HEIGHT="17"></a>--> </td> <td><img src="../Images/topnav/top_nav_separator.gif" WIDTH="1" HEIGHT="17"></td> <td><a href="http://www.coned.com/customercentral/" onmouseover="liteNav(&quot;customercentral&quot;,1);showSubnav(&quot;customercentral&quot;)" onmouseout="liteNav(&quot;customercentral&quot;,0)"><img name="navimg_customercentral" id="navimg_customercentral" border="0" src="../Images/topnav/top_nav_customercentral.gif" WIDTH="92" HEIGHT="17"></a></td> <td><img src="../Images/topnav/top_nav_separator.gif" WIDTH="1" HEIGHT="17"></td> <td><a href="http://www.coned.com/business/" onmouseover="liteNav(&quot;businesscenter&quot;,1);showSubnav(&quot;businesscenter&quot;)" onmouseout="liteNav(&quot;businesscenter&quot;,0)"><img name="navimg_businesscenter" id="navimg_businesscenter" border="0" src="../Images/topnav/top_nav_businesscenter.gif" WIDTH="87" HEIGHT="17"></a></td> <td><img src="../Images/topnav/top_nav_separator.gif" WIDTH="1" HEIGHT="17"></td> <td><a href="http://investor.conedison.com" onmouseover="liteNav(&quot;investor&quot;,1);showSubnav(&quot;investor&quot;)" onmouseout="liteNav(&quot;investor&quot;,0)"><img name="navimg_investor" id="navimg_investor" border="0" src="../Images/topnav/top_nav_investor.gif" WIDTH="54" HEIGHT="17"></a></td> <td><img src="../Images/topnav/top_nav_separator.gif" WIDTH="1" HEIGHT="17"></td> <td><a href="http://www.coned.com/community/" onmouseover="liteNav(&quot;community&quot;,1);showSubnav(&quot;community&quot;)" onmouseout="liteNav(&quot;community&quot;,0)"><img name="navimg_community" id="navimg_community" border="0" src="../Images/topnav/top_nav_community.gif" WIDTH="64" HEIGHT="17"></a></td> <td><img src="../Images/topnav/top_nav_separator.gif" WIDTH="1" HEIGHT="17"></td> <td><a href="http://www.coned.com/newsroom/" onmouseover="liteNav(&quot;news&quot;,1);showSubnav(&quot;news&quot;)" onmouseout="liteNav(&quot;news&quot;,0)"><img name="navimg_news" id="navimg_news" border="0" src="../Images/topnav/top_nav_news.gif" WIDTH="34" HEIGHT="17"></a></td> <td><img src="../Images/topnav/top_nav_separator.gif" WIDTH="1" HEIGHT="17"></td> <td><a href="http://www.coned.com/aboutus/" onmouseover="liteNav(&quot;aboutus&quot;,1);showSubnav(&quot;aboutus&quot;)" onmouseout="liteNav(&quot;aboutus&quot;,0)"><img name="navimg_aboutus" id="navimg_aboutus" border="0" src="../Images/topnav/top_nav_aboutus.gif" WIDTH="51" HEIGHT="17"></a></td> <td><img src="../Images/topnav/top_nav_separator.gif"></td> <td><a href="http://www.coned.com/contactus.asp" onmouseover="liteNav(&quot;contactus&quot;,1)" onmouseout="liteNav(&quot;contactus&quot;,0)"><img name="navimg_contactus" id="navimg_contactus" border="0" src="../Images/topnav/top_nav_contactus.gif"></a></td> <td><img src="../Images/topnav/top_nav_separator.gif"></td> <td width="100%"><img src="../Images/topnav/1px.gif" width="1" height="17" border="0"></td> </tr> </table> </td> </tr> <tr> <td bgcolor="#66676a" colspan="2"><img src="../Images/1px.gif" WIDTH="1" HEIGHT="1"></td> </tr> </table> <!-- HEADER TABLE CONSTRUCT END --> <!-- MAIN CONSTRUCT --> <div id="main"> <br> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td valign=top> <table> <tr> <td> <ul class="leftnav" style="list-style-type: none; padding-left: 0px; margin-left:0px;"> <li class="leftnav" style="list-style-type: none; margin-left:0px;"> <a id="ctl00_rptMenu_ctl00_hrefAction" class="leftnav" onmouseover="this.style.color='#0090dd'" onmouseout="this.style.color='black'" href="http://www.coned.com" style="display:inline-block;width:170px;"><span id="ctl00_rptMenu_ctl00_lblText">conEd.com home</span></a> </li> <li class="leftnav" style="list-style-type: none; margin-left:0px;"> <a id="ctl00_rptMenu_ctl01_hrefAction" class="leftnav" onmouseover="this.style.color='#0090dd'" onmouseout="this.style.color='black'" href="../SessionTransfer.aspx?dir=2asp&amp;url={aspserver}/MainHome.asp?src=DOTNET" style="display:inline-block;width:170px;"><span id="ctl00_rptMenu_ctl01_lblText">my account home</span></a> </li> <li class="leftnav" style="list-style-type: none; margin-left:0px;"> <a id="ctl00_rptMenu_ctl02_hrefAction" class="leftnav" onmouseover="this.style.color='#0090dd'" onmouseout="this.style.color='black'" href="MyAccounts.aspx?lang=eng" style="display:inline-block;width:170px;"><span id="ctl00_rptMenu_ctl02_lblText">manage my accounts</span></a> </li> <li class="leftnav" style="list-style-type: none; margin-left:0px;"> <a id="ctl00_rptMenu_ctl03_hrefAction" class="leftnav" onmouseover="this.style.color='#0090dd'" onmouseout="this.style.color='black'" href="../NonMemberPages/FAQ.aspx?lang=eng" style="display:inline-block;width:170px;"><span id="ctl00_rptMenu_ctl03_lblText">help</span></a> </li> <li class="leftnav" style="list-style-type: none; margin-left:0px;"> <a id="ctl00_rptMenu_ctl04_hrefAction" class="leftnav" onmouseover="this.style.color='#0090dd'" onmouseout="this.style.color='black'" href="../Logoff.aspx" style="display:inline-block;width:170px;"><span id="ctl00_rptMenu_ctl04_lblText">Log Off</span></a> </li> </ul> </td> </tr> </table> </td><!-- <td valign="top" width="1"> <img src="../Images/1px.gif" width="168" height="1"> </td> --><td valign="bottom" width="1"><img src="../Images/1px.gif" width="1" height="1"></td><td valign="top" width="100%"> <img id="ctl00_imgApplicationName" src="../Images/titles/title_my_account.gif" alt="my account" align="absmiddle" style="border-width:0px;" /> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top" width="100%"> <!-- BEGIN CONTENT --> <body> <table border="0" cellspacing="0" cellpadding="0" align="left"> <tr><td>&nbsp;</td></tr> <tr><td colspan=3> <span class="title1"> <span id="ctl00_Main_lblChangePwd">Change Password</span> </span> </td> </tr> <tr><td>&nbsp;</td></tr> <tr> <td valign="top"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td> <table width="500px" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="11"><img src="../Images/corner_light_blue_top_left.gif" width="11" height="10"></td> <td background="../Images/bckgr_light_blue_top.gif"><img src="../Images/trans.gif" width="1" height="1"></td> <td width="11"><img src="../Images/corner_light_blue_top_right.gif" width="11" height="10"></td> </tr> <tr> <td width="11" background="../Images/bckgr_light_blue_left.gif"><img src="../Images/1px.gif" width="5" height="130"></td> <td valign="top" bgcolor="#EFF7FF"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td align="left" valign="top" bgcolor="#EFF7FF" colspan=2><br> <span id="ctl00_Main_LblChangePwdHints">Create a new password and confirm it.</span> <br> </td> </tr> <tr align="right"> <td colspan=2 align="right"><span><font color="red">*</font></span> <span id="ctl00_Main_LblRequiredField">Indicates required fields</span> </td> </tr> <tr> <td> <table id="ctl00_Main_ChangePassword1" cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;"> <tr> <td> <table border="0" cellpadding="1" cellspacing="0" style="border-collapse:collapse;"> <tr> <td> <table border="0" cellpadding="0"> <tr> <td align="left" width="45%"> <label for="ctl00_Main_ChangePassword1_ChangePasswordContainerID_CurrentPassword" id="ctl00_Main_ChangePassword1_ChangePasswordContainerID_CurrentPasswordLabel"> <strong class="loginblk" __designer:mapid="281d"><font color="red" __designer:mapid="281e">* </font>Enter old password </strong> </label> </td> <td> <input name="ctl00$Main$ChangePassword1$ChangePasswordContainerID$CurrentPassword" type="password" id="ctl00_Main_ChangePassword1_ChangePasswordContainerID_CurrentPassword" /> <span id="ctl00_Main_ChangePassword1_ChangePasswordContainerID_CurrentPasswordRequired" title="Password is required." style="color:Red;visibility:hidden;">*</span> </td> </tr> <tr> <td align="left" width="45%"> <label for="ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPassword" id="ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordLabel"> <strong class="loginblk" __designer:mapid="2825"><font color="red" __designer:mapid="2826">* </font>New password </strong> </label> </td> <td> <input name="ctl00$Main$ChangePassword1$ChangePasswordContainerID$NewPassword" type="password" id="ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPassword" /> <span id="ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordRequired" title="New Password is required." style="color:Red;visibility:hidden;">*</span> </td> </tr> <tr> <td></td> <td><font color=gray size="1"> <span id="ctl00_Main_ChangePassword1_ChangePasswordContainerID_LblPwdHints">Passwords must contain at least 8 to 15 characters with one capital letter and at least 1 number.Passwords are case sensitive.</span> </font> </td> </tr> <tr> <td align="left"> <label for="ctl00_Main_ChangePassword1_ChangePasswordContainerID_ConfirmNewPassword" id="ctl00_Main_ChangePassword1_ChangePasswordContainerID_ConfirmNewPasswordLabel"> <strong class="loginblk" __designer:mapid="2832"><font color="red" __designer:mapid="2833">* </font>Confirm password </strong> </label> </td> <td> <input name="ctl00$Main$ChangePassword1$ChangePasswordContainerID$ConfirmNewPassword" type="password" id="ctl00_Main_ChangePassword1_ChangePasswordContainerID_ConfirmNewPassword" /> <span id="ctl00_Main_ChangePassword1_ChangePasswordContainerID_ConfirmNewPasswordRequired" title="Confirm New Password is required." style="color:Red;visibility:hidden;">*</span> </td> </tr> <tr> <td align="center" colspan="2"> <span id="ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordCompare" style="color:Red;display:none;">The password and confirmation password must match.Please try again.</span> </td> </tr> <tr> <td align="center" colspan="2"> <span id="ctl00_Main_ChangePassword1_ChangePasswordContainerID_RegExpPwd" style="color:Red;display:none;">Passwords must contain at least 8 to 15 characters with one capital letter and at least one number.Passwords are case sensitive.</span> </td> </tr> <tr> <td align="center" colspan="2" style="color:Red;"> </td> </tr> <tr><td>&nbsp;</td></tr> <tr> <td align="center" colspan="2" style="color: red"> <span id="ctl00_Main_ChangePassword1_ChangePasswordContainerID_ValidationMessage"></span> </td> </tr> <tr> <td align="right" valign="top" colspan="2"> <input type="submit" name="ctl00$Main$ChangePassword1$ChangePasswordContainerID$ChangePasswordPushButton" value="Submit" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$Main$ChangePassword1$ChangePasswordContainerID$ChangePasswordPushButton&quot;, &quot;&quot;, true, &quot;ChangePassword1&quot;, &quot;&quot;, false, false))" id="ctl00_Main_ChangePassword1_ChangePasswordContainerID_ChangePasswordPushButton" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="submit" name="ctl00$Main$ChangePassword1$ChangePasswordContainerID$CancelPushButton" value=" Reset " id="ctl00_Main_ChangePassword1_ChangePasswordContainerID_CancelPushButton" /> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </td> <td width="11" background="../Images/bckgr_light_blue_right.gif"> <img src="../Images/trans.gif" width="1" height="1"> </td> </tr> <tr> <td width="11"><img src="../Images/corner_light_blue_btm_left.gif" width="11" height="10"></td> <td background="../Images/bckgr_light_blue_btm.gif"><img src="../Images/trans.gif" width="1" height="1"></td> <td width="11"><img src="../Images/corner_light_blue_btm_right.gif" width="11" height="10"></td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </body> <!-- END CONTENT --> </td> </tr> </table> </td> <!-- BEGIN RIGHT PANEL --> <td valign="top" width="15">&nbsp;</td> <td id="ctl00_tdBarker" valign="top" width="300" align="right"> <a id="ctl00_LinkRptOutage1" href="https://apps1.coned.com/csol/reportoutage.asp"> <image SRC="../Images/right_barker_outage.gif" BORDER="0"> </a> <br> <a id="ctl00_LinkRptOutage2" href="https://apps1.coned.com/csol/reportoutage.asp"> <image SRC="../Images/right_barker_chkservice.gif" BORDER="0"> </a> <br> <a href="http://www.coned.com/lawclaims"> <image SRC="../Images/right_barker_claimsinfo.gif" BORDER="0"></a><br><br> <a href="https://mysteamaccount.coned.com"> <image SRC="../Images/bkr_steambill.gif" BORDER="0"></a><br> </td> <!-- END RIGHT PANEL --></tr> <!-- BEGIN FOOTER --> <tr><td>&nbsp;</td></tr> <tr><td>&nbsp;</td></tr> <tr> <td valign="top" width="1"> <img src="../Images/1px.gif" width="168" height="1"> </td> <td valign="bottom" width="16"><img src="../Images/1px.gif" width="16" height="1"></td> <td valign="bottom" colspan="3">&nbsp; <p> <font face="arial, helvetica" size="2"> <span id="ctl00_lblPageFooter">Con Edison's account services and customer-specific information are solely intended for use by the customer who is the account holder or the customer's authorized agent. Any unauthorized entry or use of Con Edison's My Account service center is prohibited. Violators will be prosecuted.</font> <br> <br> To enter this system, you must use a JavaScript enabled browser such as <a href="http://www.microsoft.com/windows/ie/">Microsoft Internet Explorer</a>. </p> </span> <p> <a id="ctl00_LinkPageFooter" href="https://apps1.coned.com/csol/reportoutage.asp">Click here</a> <span id="ctl00_lblPageFooter1">to report trouble with your electric service or to check on the status of a previously reported electric service problem.<br> For gas emergencies, please call our toll-free number 1-800-752-6633. DO NOT send an e-mail.</span> </p> Copyright 2011, Consolidated Edison, Inc. </td> <td width="15" valign="top">&nbsp;</td> <td width="300" valign="top">&nbsp;</td> </tr> <tr> <td valign="top" width="1"> <img src="../Images/1px.gif" width="168" height="1"> </td> <td valign="bottom" width="16"> <img src="../Images/1px.gif" width="16" height="1"> </td> <td> <!-- TERTIARY NAV CONSTRUCT --> <br> <br> <br> <br> <p align="center" class="tertiary"><a href="http://www.coned.com/contactus.asp">contact</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="http://www.coned.com/coned_search/search_frameset.asp">search</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="http://www.coned.com/careers">careers</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="http://www.coned.com/sitemap.asp">site&nbsp;map</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="http://www.conedison.com" target="_blank">consolidated&nbsp;edison,&nbsp;inc.</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href="http://www.coned.com/privacy" target="_top">privacy&nbsp;policy</a></span></p> <!-- TERTIARY NAV CONSTRUCT END --> </td> </tr> </table> </div> <script type="text/javascript"> //<![CDATA[ var Page_Validators = new Array(document.getElementById("ctl00_Main_ChangePassword1_ChangePasswordContainerID_CurrentPasswordRequired"), document.getElementById("ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordRequired"), document.getElementById("ctl00_Main_ChangePassword1_ChangePasswordContainerID_ConfirmNewPasswordRequired"), document.getElementById("ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordCompare"), document.getElementById("ctl00_Main_ChangePassword1_ChangePasswordContainerID_RegExpPwd")); //]]> </script> <script type="text/javascript"> //<![CDATA[ var ctl00_Main_ChangePassword1_ChangePasswordContainerID_CurrentPasswordRequired = document.all ? document.all["ctl00_Main_ChangePassword1_ChangePasswordContainerID_CurrentPasswordRequired"] : document.getElementById("ctl00_Main_ChangePassword1_ChangePasswordContainerID_CurrentPasswordRequired"); ctl00_Main_ChangePassword1_ChangePasswordContainerID_CurrentPasswordRequired.controltovalidate = "ctl00_Main_ChangePassword1_ChangePasswordContainerID_CurrentPassword"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_CurrentPasswordRequired.errormessage = "Password is required."; ctl00_Main_ChangePassword1_ChangePasswordContainerID_CurrentPasswordRequired.validationGroup = "ChangePassword1"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_CurrentPasswordRequired.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_CurrentPasswordRequired.initialvalue = ""; var ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordRequired = document.all ? document.all["ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordRequired"] : document.getElementById("ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordRequired"); ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordRequired.controltovalidate = "ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPassword"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordRequired.errormessage = "New Password is required."; ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordRequired.validationGroup = "ChangePassword1"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordRequired.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordRequired.initialvalue = ""; var ctl00_Main_ChangePassword1_ChangePasswordContainerID_ConfirmNewPasswordRequired = document.all ? document.all["ctl00_Main_ChangePassword1_ChangePasswordContainerID_ConfirmNewPasswordRequired"] : document.getElementById("ctl00_Main_ChangePassword1_ChangePasswordContainerID_ConfirmNewPasswordRequired"); ctl00_Main_ChangePassword1_ChangePasswordContainerID_ConfirmNewPasswordRequired.controltovalidate = "ctl00_Main_ChangePassword1_ChangePasswordContainerID_ConfirmNewPassword"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_ConfirmNewPasswordRequired.errormessage = "Confirm New Password is required."; ctl00_Main_ChangePassword1_ChangePasswordContainerID_ConfirmNewPasswordRequired.validationGroup = "ChangePassword1"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_ConfirmNewPasswordRequired.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_ConfirmNewPasswordRequired.initialvalue = ""; var ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordCompare = document.all ? document.all["ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordCompare"] : document.getElementById("ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordCompare"); ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordCompare.controltovalidate = "ctl00_Main_ChangePassword1_ChangePasswordContainerID_ConfirmNewPassword"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordCompare.errormessage = "The password and confirmation password must match.Please try again."; ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordCompare.display = "Dynamic"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordCompare.validationGroup = "ChangePassword1"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordCompare.evaluationfunction = "CompareValidatorEvaluateIsValid"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordCompare.controltocompare = "ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPassword"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPasswordCompare.controlhookup = "ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPassword"; var ctl00_Main_ChangePassword1_ChangePasswordContainerID_RegExpPwd = document.all ? document.all["ctl00_Main_ChangePassword1_ChangePasswordContainerID_RegExpPwd"] : document.getElementById("ctl00_Main_ChangePassword1_ChangePasswordContainerID_RegExpPwd"); ctl00_Main_ChangePassword1_ChangePasswordContainerID_RegExpPwd.controltovalidate = "ctl00_Main_ChangePassword1_ChangePasswordContainerID_NewPassword"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_RegExpPwd.focusOnError = "t"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_RegExpPwd.errormessage = "Passwords must contain at least 8 to 15 characters with one capital letter and at least one number.Passwords are case sensitive."; ctl00_Main_ChangePassword1_ChangePasswordContainerID_RegExpPwd.display = "Dynamic"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_RegExpPwd.validationGroup = "ChangePassword1"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_RegExpPwd.evaluationfunction = "RegularExpressionValidatorEvaluateIsValid"; ctl00_Main_ChangePassword1_ChangePasswordContainerID_RegExpPwd.validationexpression = "^(?=.*\\d+)(?=.*[A-Z]+)[0-9a-zA-Z]{8,15}$"; //]]> </script> <script type="text/javascript"> //<![CDATA[ var Page_ValidationActive = false; if (typeof(ValidatorOnLoad) == "function") { ValidatorOnLoad(); } function ValidatorOnSubmit() { if (Page_ValidationActive) { return ValidatorCommonOnSubmit(); } else { return true; } } //]]> </script> </form> </body> </html>
{ "pile_set_name": "Github" }
// !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 46; objects = { /* Begin PBXBuildFile section */ 00B9955B1B128DF400A5C623 /* IOSurface.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B995591B128DF400A5C623 /* IOSurface.framework */; }; 00B9955A1B128DF400A5C623 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B995581B128DF400A5C623 /* IOKit.framework */; }; 006D720419952D00008149E2 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 006D720219952D00008149E2 /* AVFoundation.framework */; }; 006D720519952D00008149E2 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 006D720319952D00008149E2 /* CoreMedia.framework */; }; 0091D8F90E81B9330029341E /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0091D8F80E81B9330029341E /* OpenGL.framework */; }; 00B784B30FF439BC000DE1D7 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B784AF0FF439BC000DE1D7 /* Accelerate.framework */; }; 00B784B40FF439BC000DE1D7 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B784B00FF439BC000DE1D7 /* AudioToolbox.framework */; }; 00B784B50FF439BC000DE1D7 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B784B10FF439BC000DE1D7 /* AudioUnit.framework */; }; 00B784B60FF439BC000DE1D7 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B784B20FF439BC000DE1D7 /* CoreAudio.framework */; }; 00BDDB3C19EB22480006CBCF /* assets in Resources */ = {isa = PBXBuildFile; fileRef = 00BDDB3B19EB22480006CBCF /* assets */; }; 5323E6B20EAFCA74003A9687 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5323E6B10EAFCA74003A9687 /* CoreVideo.framework */; }; 5323E6B60EAFCA7E003A9687 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5323E6B50EAFCA7E003A9687 /* QTKit.framework */; }; 6461169764D2460CBD54E2E8 /* SuperformulaGPUApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 050A9728476E4499B335754A /* SuperformulaGPUApp.cpp */; }; 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 9478909BA2134106B49C73C2 /* CinderApp.icns in Resources */ = {isa = PBXBuildFile; fileRef = FA7763291A984FC4A425CFD9 /* CinderApp.icns */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 00B995591B128DF400A5C623 /* IOSurface.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOSurface.framework; path = System/Library/Frameworks/IOSurface.framework; sourceTree = SDKROOT; }; 00B995581B128DF400A5C623 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; 006D720219952D00008149E2 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 006D720319952D00008149E2 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; 0091D8F80E81B9330029341E /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; }; 00B784AF0FF439BC000DE1D7 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; 00B784B00FF439BC000DE1D7 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 00B784B10FF439BC000DE1D7 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = System/Library/Frameworks/AudioUnit.framework; sourceTree = SDKROOT; }; 00B784B20FF439BC000DE1D7 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; 00BDDB3B19EB22480006CBCF /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = assets; path = ../assets; sourceTree = "<group>"; }; 050A9728476E4499B335754A /* SuperformulaGPUApp.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.cpp; name = SuperformulaGPUApp.cpp; path = ../src/SuperformulaGPUApp.cpp; sourceTree = "<group>"; }; 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; }; 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; }; 5323E6B10EAFCA74003A9687 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = "<absolute>"; }; 5323E6B50EAFCA7E003A9687 /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = /System/Library/Frameworks/QTKit.framework; sourceTree = "<absolute>"; }; 62E320D0DB3A4C2FADBF5780 /* SuperformulaGPU_Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = "\"\""; path = SuperformulaGPU_Prefix.pch; sourceTree = "<group>"; }; 8D1107320486CEB800E47090 /* SuperformulaGPU.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SuperformulaGPU.app; sourceTree = BUILT_PRODUCTS_DIR; }; ACEE0F85260946DB97D046E8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; CF6C652432B5470BA544E70A /* Resources.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Resources.h; path = ../include/Resources.h; sourceTree = "<group>"; }; FA7763291A984FC4A425CFD9 /* CinderApp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = CinderApp.icns; path = ../../../data/CinderApp.icns; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 8D11072E0486CEB800E47090 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 00B9955B1B128DF400A5C623 /* IOSurface.framework in Frameworks */, 00B9955A1B128DF400A5C623 /* IOKit.framework in Frameworks */, 006D720419952D00008149E2 /* AVFoundation.framework in Frameworks */, 006D720519952D00008149E2 /* CoreMedia.framework in Frameworks */, 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 0091D8F90E81B9330029341E /* OpenGL.framework in Frameworks */, 5323E6B20EAFCA74003A9687 /* CoreVideo.framework in Frameworks */, 5323E6B60EAFCA7E003A9687 /* QTKit.framework in Frameworks */, 00B784B30FF439BC000DE1D7 /* Accelerate.framework in Frameworks */, 00B784B40FF439BC000DE1D7 /* AudioToolbox.framework in Frameworks */, 00B784B50FF439BC000DE1D7 /* AudioUnit.framework in Frameworks */, 00B784B60FF439BC000DE1D7 /* CoreAudio.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 01B97315FEAEA392516A2CEA /* Blocks */ = { isa = PBXGroup; children = ( ); name = Blocks; sourceTree = "<group>"; }; 080E96DDFE201D6D7F000001 /* Source */ = { isa = PBXGroup; children = ( 050A9728476E4499B335754A /* SuperformulaGPUApp.cpp */, ); name = Source; sourceTree = "<group>"; }; 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { isa = PBXGroup; children = ( 00B995581B128DF400A5C623 /* IOKit.framework */, 00B995591B128DF400A5C623 /* IOSurface.framework */, 006D720219952D00008149E2 /* AVFoundation.framework */, 006D720319952D00008149E2 /* CoreMedia.framework */, 00B784AF0FF439BC000DE1D7 /* Accelerate.framework */, 00B784B00FF439BC000DE1D7 /* AudioToolbox.framework */, 00B784B10FF439BC000DE1D7 /* AudioUnit.framework */, 00B784B20FF439BC000DE1D7 /* CoreAudio.framework */, 5323E6B50EAFCA7E003A9687 /* QTKit.framework */, 5323E6B10EAFCA74003A9687 /* CoreVideo.framework */, 0091D8F80E81B9330029341E /* OpenGL.framework */, 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, ); name = "Linked Frameworks"; sourceTree = "<group>"; }; 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { isa = PBXGroup; children = ( 29B97324FDCFA39411CA2CEA /* AppKit.framework */, 29B97325FDCFA39411CA2CEA /* Foundation.framework */, ); name = "Other Frameworks"; sourceTree = "<group>"; }; 19C28FACFE9D520D11CA2CBB /* Products */ = { isa = PBXGroup; children = ( 8D1107320486CEB800E47090 /* SuperformulaGPU.app */, ); name = Products; sourceTree = "<group>"; }; 29B97314FDCFA39411CA2CEA /* SuperformulaGPU */ = { isa = PBXGroup; children = ( 00BDDB3B19EB22480006CBCF /* assets */, 01B97315FEAEA392516A2CEA /* Blocks */, 29B97315FDCFA39411CA2CEA /* Headers */, 080E96DDFE201D6D7F000001 /* Source */, 29B97317FDCFA39411CA2CEA /* Resources */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, ); name = SuperformulaGPU; sourceTree = "<group>"; }; 29B97315FDCFA39411CA2CEA /* Headers */ = { isa = PBXGroup; children = ( CF6C652432B5470BA544E70A /* Resources.h */, 62E320D0DB3A4C2FADBF5780 /* SuperformulaGPU_Prefix.pch */, ); name = Headers; sourceTree = "<group>"; }; 29B97317FDCFA39411CA2CEA /* Resources */ = { isa = PBXGroup; children = ( FA7763291A984FC4A425CFD9 /* CinderApp.icns */, ACEE0F85260946DB97D046E8 /* Info.plist */, ); name = Resources; sourceTree = "<group>"; }; 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, ); name = Frameworks; sourceTree = "<group>"; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ 8D1107260486CEB800E47090 /* SuperformulaGPU */ = { isa = PBXNativeTarget; buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "SuperformulaGPU" */; buildPhases = ( 8D1107290486CEB800E47090 /* Resources */, 8D11072C0486CEB800E47090 /* Sources */, 8D11072E0486CEB800E47090 /* Frameworks */, ); buildRules = ( ); dependencies = ( ); name = SuperformulaGPU; productInstallPath = "$(HOME)/Applications"; productName = SuperformulaGPU; productReference = 8D1107320486CEB800E47090 /* SuperformulaGPU.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SuperformulaGPU" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 1; knownRegions = ( English, Japanese, French, German, ); mainGroup = 29B97314FDCFA39411CA2CEA /* SuperformulaGPU */; projectDirPath = ""; projectRoot = ""; targets = ( 8D1107260486CEB800E47090 /* SuperformulaGPU */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 8D1107290486CEB800E47090 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( 9478909BA2134106B49C73C2 /* CinderApp.icns in Resources */, 00BDDB3C19EB22480006CBCF /* assets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 8D11072C0486CEB800E47090 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 6461169764D2460CBD54E2E8 /* SuperformulaGPUApp.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ C01FCF4B08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; GCC_DYNAMIC_NO_PIC = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = SuperformulaGPU_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; OTHER_LDFLAGS = "\"$(CINDER_PATH)/lib/macosx/$(CONFIGURATION)/libcinder.a\""; PRODUCT_NAME = SuperformulaGPU; SYMROOT = ./build; WRAPPER_EXTENSION = app; }; name = Debug; }; C01FCF4C08A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { COMBINE_HIDPI_IMAGES = YES; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; GCC_FAST_MATH = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_INLINES_ARE_PRIVATE_EXTERN = YES; GCC_OPTIMIZATION_LEVEL = 3; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = SuperformulaGPU_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ( "NDEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Applications"; OTHER_LDFLAGS = "\"$(CINDER_PATH)/lib/macosx/$(CONFIGURATION)/libcinder.a\""; PRODUCT_NAME = SuperformulaGPU; STRIP_INSTALLED_PRODUCT = YES; SYMROOT = ./build; WRAPPER_EXTENSION = app; }; name = Release; }; C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = x86_64; CINDER_PATH = ../../../..; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "\"$(CINDER_PATH)/include\""; MACOSX_DEPLOYMENT_TARGET = 10.8; SDKROOT = macosx; USER_HEADER_SEARCH_PATHS = "\"$(CINDER_PATH)/include\" ../include"; }; name = Debug; }; C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = x86_64; CINDER_PATH = ../../../..; CLANG_CXX_LANGUAGE_STANDARD = "c++0x"; CLANG_CXX_LIBRARY = "libc++"; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = "\"$(CINDER_PATH)/include\""; MACOSX_DEPLOYMENT_TARGET = 10.8; SDKROOT = macosx; USER_HEADER_SEARCH_PATHS = "\"$(CINDER_PATH)/include\" ../include"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "SuperformulaGPU" */ = { isa = XCConfigurationList; buildConfigurations = ( C01FCF4B08A954540054247B /* Debug */, C01FCF4C08A954540054247B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SuperformulaGPU" */ = { isa = XCConfigurationList; buildConfigurations = ( C01FCF4F08A954540054247B /* Debug */, C01FCF5008A954540054247B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; }
{ "pile_set_name": "Github" }
/*! * Bootstrap's Gruntfile * http://getbootstrap.com * Copyright 2013-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ module.exports = function (grunt) { 'use strict'; // Force use of Unix newlines grunt.util.linefeed = '\n'; RegExp.quote = function (string) { return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&'); }; var fs = require('fs'); var path = require('path'); var generateGlyphiconsData = require('./grunt/bs-glyphicons-data-generator.js'); var BsLessdocParser = require('./grunt/bs-lessdoc-parser.js'); var getLessVarsData = function () { var filePath = path.join(__dirname, 'less/variables.less'); var fileContent = fs.readFileSync(filePath, { encoding: 'utf8' }); var parser = new BsLessdocParser(fileContent); return { sections: parser.parseFile() }; }; var generateRawFiles = require('./grunt/bs-raw-files-generator.js'); var generateCommonJSModule = require('./grunt/bs-commonjs-generator.js'); var configBridge = grunt.file.readJSON('./grunt/configBridge.json', { encoding: 'utf8' }); Object.keys(configBridge.paths).forEach(function (key) { configBridge.paths[key].forEach(function (val, i, arr) { arr[i] = path.join('./docs/assets', val); }); }); // Project configuration. grunt.initConfig({ // Metadata. pkg: grunt.file.readJSON('package.json'), banner: '/*!\n' + ' * Bootstrap v<%= pkg.version %> (<%= pkg.homepage %>)\n' + ' * Copyright 2011-<%= grunt.template.today("yyyy") %> <%= pkg.author %>\n' + ' * Licensed under the <%= pkg.license %> license\n' + ' */\n', jqueryCheck: configBridge.config.jqueryCheck.join('\n'), jqueryVersionCheck: configBridge.config.jqueryVersionCheck.join('\n'), // Task configuration. clean: { dist: 'dist', docs: 'docs/dist' }, jshint: { options: { jshintrc: 'js/.jshintrc' }, grunt: { options: { jshintrc: 'grunt/.jshintrc' }, src: ['Gruntfile.js', 'package.js', 'grunt/*.js'] }, core: { src: 'js/*.js' }, test: { options: { jshintrc: 'js/tests/unit/.jshintrc' }, src: 'js/tests/unit/*.js' }, assets: { src: ['docs/assets/js/src/*.js', 'docs/assets/js/*.js', '!docs/assets/js/*.min.js'] } }, jscs: { options: { config: 'js/.jscsrc' }, grunt: { src: '<%= jshint.grunt.src %>' }, core: { src: '<%= jshint.core.src %>' }, test: { src: '<%= jshint.test.src %>' }, assets: { options: { requireCamelCaseOrUpperCaseIdentifiers: null }, src: '<%= jshint.assets.src %>' } }, concat: { options: { banner: '<%= banner %>\n<%= jqueryCheck %>\n<%= jqueryVersionCheck %>', stripBanners: false }, bootstrap: { src: [ 'js/transition.js', 'js/alert.js', 'js/button.js', 'js/carousel.js', 'js/collapse.js', 'js/dropdown.js', 'js/modal.js', 'js/tooltip.js', 'js/popover.js', 'js/scrollspy.js', 'js/tab.js', 'js/affix.js' ], dest: 'dist/js/<%= pkg.name %>.js' } }, uglify: { options: { compress: { warnings: false }, mangle: true, preserveComments: /^!|@preserve|@license|@cc_on/i }, core: { src: '<%= concat.bootstrap.dest %>', dest: 'dist/js/<%= pkg.name %>.min.js' }, customize: { src: configBridge.paths.customizerJs, dest: 'docs/assets/js/customize.min.js' }, docsJs: { src: configBridge.paths.docsJs, dest: 'docs/assets/js/docs.min.js' } }, qunit: { options: { inject: 'js/tests/unit/phantom.js' }, files: 'js/tests/index.html' }, less: { compileCore: { options: { strictMath: true, sourceMap: true, outputSourceFiles: true, sourceMapURL: '<%= pkg.name %>.css.map', sourceMapFilename: 'dist/css/<%= pkg.name %>.css.map' }, src: 'less/bootstrap.less', dest: 'dist/css/<%= pkg.name %>.css' }, compileTheme: { options: { strictMath: true, sourceMap: true, outputSourceFiles: true, sourceMapURL: '<%= pkg.name %>-theme.css.map', sourceMapFilename: 'dist/css/<%= pkg.name %>-theme.css.map' }, src: 'less/theme.less', dest: 'dist/css/<%= pkg.name %>-theme.css' } }, autoprefixer: { options: { browsers: configBridge.config.autoprefixerBrowsers }, core: { options: { map: true }, src: 'dist/css/<%= pkg.name %>.css' }, theme: { options: { map: true }, src: 'dist/css/<%= pkg.name %>-theme.css' }, docs: { src: ['docs/assets/css/src/docs.css'] }, examples: { expand: true, cwd: 'docs/examples/', src: ['**/*.css'], dest: 'docs/examples/' } }, csslint: { options: { csslintrc: 'less/.csslintrc' }, dist: [ 'dist/css/bootstrap.css', 'dist/css/bootstrap-theme.css' ], examples: [ 'docs/examples/**/*.css' ], docs: { options: { ids: false, 'overqualified-elements': false }, src: 'docs/assets/css/src/docs.css' } }, cssmin: { options: { // TODO: disable `zeroUnits` optimization once clean-css 3.2 is released // and then simplify the fix for https://github.com/twbs/bootstrap/issues/14837 accordingly compatibility: 'ie8', keepSpecialComments: '*', sourceMap: true, sourceMapInlineSources: true, advanced: false }, minifyCore: { src: 'dist/css/<%= pkg.name %>.css', dest: 'dist/css/<%= pkg.name %>.min.css' }, minifyTheme: { src: 'dist/css/<%= pkg.name %>-theme.css', dest: 'dist/css/<%= pkg.name %>-theme.min.css' }, docs: { src: [ 'docs/assets/css/ie10-viewport-bug-workaround.css', 'docs/assets/css/src/pygments-manni.css', 'docs/assets/css/src/docs.css' ], dest: 'docs/assets/css/docs.min.css' } }, csscomb: { options: { config: 'less/.csscomb.json' }, dist: { expand: true, cwd: 'dist/css/', src: ['*.css', '!*.min.css'], dest: 'dist/css/' }, examples: { expand: true, cwd: 'docs/examples/', src: '**/*.css', dest: 'docs/examples/' }, docs: { src: 'docs/assets/css/src/docs.css', dest: 'docs/assets/css/src/docs.css' } }, copy: { fonts: { expand: true, src: 'fonts/**', dest: 'dist/' }, docs: { expand: true, cwd: 'dist/', src: [ '**/*' ], dest: 'docs/dist/' } }, connect: { server: { options: { port: 3000, base: '.' } } }, jekyll: { options: { bundleExec: true, config: '_config.yml', incremental: false }, docs: {}, github: { options: { raw: 'github: true' } } }, htmlmin: { dist: { options: { collapseBooleanAttributes: true, collapseWhitespace: true, conservativeCollapse: true, decodeEntities: false, minifyCSS: { compatibility: 'ie8', keepSpecialComments: 0 }, minifyJS: true, minifyURLs: false, processConditionalComments: true, removeAttributeQuotes: true, removeComments: true, removeOptionalAttributes: true, removeOptionalTags: true, removeRedundantAttributes: true, removeScriptTypeAttributes: true, removeStyleLinkTypeAttributes: true, removeTagWhitespace: false, sortAttributes: true, sortClassName: true }, expand: true, cwd: '_gh_pages', dest: '_gh_pages', src: [ '**/*.html', '!examples/**/*.html' ] } }, pug: { options: { pretty: true, data: getLessVarsData }, customizerVars: { src: 'docs/_pug/customizer-variables.pug', dest: 'docs/_includes/customizer-variables.html' }, customizerNav: { src: 'docs/_pug/customizer-nav.pug', dest: 'docs/_includes/nav/customize.html' } }, htmllint: { options: { ignore: [ 'Attribute "autocomplete" not allowed on element "button" at this point.', 'Attribute "autocomplete" is only allowed when the input type is "color", "date", "datetime", "datetime-local", "email", "hidden", "month", "number", "password", "range", "search", "tel", "text", "time", "url", or "week".', 'Element "img" is missing required attribute "src".' ] }, src: '_gh_pages/**/*.html' }, watch: { src: { files: '<%= jshint.core.src %>', tasks: ['jshint:core', 'qunit', 'concat'] }, test: { files: '<%= jshint.test.src %>', tasks: ['jshint:test', 'qunit'] }, less: { files: 'less/**/*.less', tasks: 'less' } }, 'saucelabs-qunit': { all: { options: { build: process.env.TRAVIS_JOB_ID, throttled: 10, maxRetries: 3, maxPollRetries: 4, urls: ['http://127.0.0.1:3000/js/tests/index.html?hidepassed'], browsers: grunt.file.readYAML('grunt/sauce_browsers.yml') } } }, exec: { npmUpdate: { command: 'npm update' } }, compress: { main: { options: { archive: 'bootstrap-<%= pkg.version %>-dist.zip', mode: 'zip', level: 9, pretty: true }, files: [ { expand: true, cwd: 'dist/', src: ['**'], dest: 'bootstrap-<%= pkg.version %>-dist' } ] } } }); // These plugins provide necessary tasks. require('load-grunt-tasks')(grunt, { scope: 'devDependencies' }); require('time-grunt')(grunt); // Docs HTML validation task grunt.registerTask('validate-html', ['jekyll:docs', 'htmllint']); var runSubset = function (subset) { return !process.env.TWBS_TEST || process.env.TWBS_TEST === subset; }; var isUndefOrNonZero = function (val) { return val === undefined || val !== '0'; }; // Test task. var testSubtasks = []; // Skip core tests if running a different subset of the test suite if (runSubset('core') && // Skip core tests if this is a Savage build process.env.TRAVIS_REPO_SLUG !== 'twbs-savage/bootstrap') { testSubtasks = testSubtasks.concat(['dist-css', 'dist-js', 'csslint:dist', 'test-js', 'docs']); } // Skip HTML validation if running a different subset of the test suite if (runSubset('validate-html') && // Skip HTML5 validator on Travis when [skip validator] is in the commit message isUndefOrNonZero(process.env.TWBS_DO_VALIDATOR)) { testSubtasks.push('validate-html'); } // Only run Sauce Labs tests if there's a Sauce access key if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined' && // Skip Sauce if running a different subset of the test suite runSubset('sauce-js-unit') && // Skip Sauce on Travis when [skip sauce] is in the commit message isUndefOrNonZero(process.env.TWBS_DO_SAUCE)) { testSubtasks.push('connect'); testSubtasks.push('saucelabs-qunit'); } grunt.registerTask('test', testSubtasks); grunt.registerTask('test-js', ['jshint:core', 'jshint:test', 'jshint:grunt', 'jscs:core', 'jscs:test', 'jscs:grunt', 'qunit']); // JS distribution task. grunt.registerTask('dist-js', ['concat', 'uglify:core', 'commonjs']); // CSS distribution task. grunt.registerTask('less-compile', ['less:compileCore', 'less:compileTheme']); grunt.registerTask('dist-css', ['less-compile', 'autoprefixer:core', 'autoprefixer:theme', 'csscomb:dist', 'cssmin:minifyCore', 'cssmin:minifyTheme']); // Full distribution task. grunt.registerTask('dist', ['clean:dist', 'dist-css', 'copy:fonts', 'dist-js']); // Default task. grunt.registerTask('default', ['clean:dist', 'copy:fonts', 'test']); grunt.registerTask('build-glyphicons-data', function () { generateGlyphiconsData.call(this, grunt); }); // task for building customizer grunt.registerTask('build-customizer', ['build-customizer-html', 'build-raw-files']); grunt.registerTask('build-customizer-html', 'pug'); grunt.registerTask('build-raw-files', 'Add scripts/less files to customizer.', function () { var banner = grunt.template.process('<%= banner %>'); generateRawFiles(grunt, banner); }); grunt.registerTask('commonjs', 'Generate CommonJS entrypoint module in dist dir.', function () { var srcFiles = grunt.config.get('concat.bootstrap.src'); var destFilepath = 'dist/js/npm.js'; generateCommonJSModule(grunt, srcFiles, destFilepath); }); // Docs task. grunt.registerTask('docs-css', ['autoprefixer:docs', 'autoprefixer:examples', 'csscomb:docs', 'csscomb:examples', 'cssmin:docs']); grunt.registerTask('lint-docs-css', ['csslint:docs', 'csslint:examples']); grunt.registerTask('docs-js', ['uglify:docsJs', 'uglify:customize']); grunt.registerTask('lint-docs-js', ['jshint:assets', 'jscs:assets']); grunt.registerTask('docs', ['docs-css', 'lint-docs-css', 'docs-js', 'lint-docs-js', 'clean:docs', 'copy:docs', 'build-glyphicons-data', 'build-customizer']); grunt.registerTask('docs-github', ['jekyll:github', 'htmlmin']); grunt.registerTask('prep-release', ['dist', 'docs', 'docs-github', 'compress']); };
{ "pile_set_name": "Github" }
# Copyright 2015-2020 the openage authors. See copying.md for legal info. """ CMake build helpers; see doc/buildsystem.md for further info. Modules in the 'buildsystem' package are not intended to be installed with openage, or used from outside the build process; otherwise, they would be in the 'openage' package. """
{ "pile_set_name": "Github" }
import sys from collections import defaultdict def get_cmd_arg(name): """Extracts argument value by name. (@author: Chris Schaefer) Assumes the exec (default) spring-cloud-deployer-k8s argument passing mode. Args: name: argument name. Returns: value of the requested argument. """ d = defaultdict(list) for k, v in ((k.lstrip('-'), v) for k, v in (a.split('=') for a in sys.argv[1:])): d[k].append(v) if bool(d[name]): return d[name][0] else: return None def get_db_url(): """Computes sqlalchemy connection URL Uses the s.d.username, s.d.password and s.d.url properties to compute the sqlalchemy url. This provides access to the SCDF internal DB and tables such as TASK_EXECUTION. Returns: sqlalchemy compatible URL compatible with the target DB. """ username = get_cmd_arg('spring.datasource.username') password = get_cmd_arg('spring.datasource.password') jdbc_url = get_cmd_arg('spring.datasource.url') return str(jdbc_url) \ .replace('jdbc:', '') \ .replace('sqlserver:', 'mssql+pyodbc:') \ .replace('//', '//{username}:{password}@'.format(username=username, password=password)) def get_task_id(): """Task ID as handled inside SCDF. When launching tasks SCDF provides the spring.cloud.task.executionid as command line argument. Returns: The task id as handled inside SCDF. """ return get_cmd_arg('spring.cloud.task.executionid') def get_task_name(): return get_cmd_arg('spring.cloud.task.name')
{ "pile_set_name": "Github" }
--- prometheus_all_gauge_columns: true
{ "pile_set_name": "Github" }
/* * Copyright (C) 2010 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.googlecode.leptonica.android; import android.support.annotation.IntDef; import java.lang.annotation.Retention; import static java.lang.annotation.RetentionPolicy.SOURCE; /** * Leptonica constants. * * @author alanv@google.com (Alan Viverette) */ public class Constants { /*-------------------------------------------------------------------------* * Access and storage flags * *-------------------------------------------------------------------------*/ /* * For Pix, Box, Pta and Numa, there are 3 standard methods for handling the * retrieval or insertion of a struct: (1) direct insertion (Don't do this * if there is another handle somewhere to this same struct!) (2) copy * (Always safe, sets up a refcount of 1 on the new object. Can be * undesirable if very large, such as an image or an array of images.) (3) * clone (Makes another handle to the same struct, and bumps the refcount up * by 1. Safe to do unless you're changing data through one of the handles * but don't want those changes to be seen by the other handle.) For Pixa * and Boxa, which are structs that hold an array of clonable structs, there * is an additional method: (4) copy-clone (Makes a new higher-level struct * with a refcount of 1, but clones all the structs in the array.) Unlike * the other structs, when retrieving a string from an Sarray, you are * allowed to get a handle without a copy or clone (i.e., that you don't * own!). You must not free or insert such a string! Specifically, for an * Sarray, the copyflag for retrieval is either: TRUE (or 1 or L_COPY) or * FALSE (or 0 or L_NOCOPY) For insertion, the copyflag is either: TRUE (or * 1 or L_COPY) or FALSE (or 0 or L_INSERT) Note that L_COPY is always 1, * and L_INSERT and L_NOCOPY are always 0. */ @Retention(SOURCE) @IntDef({L_INSERT, L_COPY, L_CLONE}) public @interface StorageFlag {} /* Stuff it in; no copy, clone or copy-clone */ public static final int L_INSERT = 0; /* Make/use a copy of the object */ public static final int L_COPY = 1; /* Make/use clone (ref count) of the object */ public static final int L_CLONE = 2; /* * Make a new object and fill with with clones of each object in the * array(s) */ public static final int L_COPY_CLONE = 3; /*--------------------------------------------------------------------------* * Sort flags * *--------------------------------------------------------------------------*/ @Retention(SOURCE) @IntDef({L_SORT_INCREASING, L_SORT_DECREASING}) public @interface SortOrder {} /* Sort in increasing order */ public static final int L_SORT_INCREASING = 1; /* Sort in decreasing order */ public static final int L_SORT_DECREASING = 2; @Retention(SOURCE) @IntDef({L_SORT_BY_X, L_SORT_BY_Y, L_SORT_BY_WIDTH, L_SORT_BY_HEIGHT, L_SORT_BY_MIN_DIMENSION, L_SORT_BY_MAX_DIMENSION, L_SORT_BY_PERIMETER, L_SORT_BY_ASPECT_RATIO}) public @interface SortBy {} /* Sort box or c.c. by horiz location */ public static final int L_SORT_BY_X = 3; /* Sort box or c.c. by vert location */ public static final int L_SORT_BY_Y = 4; /* Sort box or c.c. by width */ public static final int L_SORT_BY_WIDTH = 5; /* Sort box or c.c. by height */ public static final int L_SORT_BY_HEIGHT = 6; /* Sort box or c.c. by min dimension */ public static final int L_SORT_BY_MIN_DIMENSION = 7; /* Sort box or c.c. by max dimension */ public static final int L_SORT_BY_MAX_DIMENSION = 8; /* Sort box or c.c. by perimeter */ public static final int L_SORT_BY_PERIMETER = 9; /* Sort box or c.c. by area */ public static final int L_SORT_BY_AREA = 10; /* Sort box or c.c. by width/height ratio */ public static final int L_SORT_BY_ASPECT_RATIO = 11; /* ------------------ Image file format types -------------- */ /* * The IFF_DEFAULT flag is used to write the file out in the same (input) * file format that the pix was read from. If the pix was not read from * file, the input format field will be IFF_UNKNOWN and the output file * format will be chosen to be compressed and lossless; namely, IFF_TIFF_G4 * for d = 1 and IFF_PNG for everything else. IFF_JP2 is for jpeg2000. */ public static final int IFF_UNKNOWN = 0; public static final int IFF_BMP = 1; public static final int IFF_JFIF_JPEG = 2; public static final int IFF_PNG = 3; public static final int IFF_TIFF = 4; public static final int IFF_TIFF_PACKBITS = 5; public static final int IFF_TIFF_RLE = 6; public static final int IFF_TIFF_G3 = 7; public static final int IFF_TIFF_G4 = 8; public static final int IFF_TIFF_LZW = 9; public static final int IFF_TIFF_ZIP = 10; public static final int IFF_PNM = 11; public static final int IFF_PS = 12; public static final int IFF_GIF = 13; public static final int IFF_JP2 = 14; public static final int IFF_DEFAULT = 15; public static final int IFF_SPIX = 16; }
{ "pile_set_name": "Github" }
/* * Copyright (c) 2017-2020 Software Architecture Group, Hasso Plattner Institute * * Licensed under the MIT License. */ package de.hpi.swa.trufflesqueak.aot; import java.util.Collections; import java.util.List; import org.graalvm.nativeimage.Platform; import org.graalvm.nativeimage.c.CContext; public final class SDLCContext implements CContext.Directives { @Override public List<String> getHeaderFiles() { return Collections.singletonList("<SDL2/SDL.h>"); } @Override public List<String> getLibraries() { return Collections.singletonList("SDL2"); } @Override public List<String> getOptions() { /* `sdl2-config --cflags` */ if (Platform.includedIn(Platform.LINUX.class)) { return Collections.singletonList("-I/usr/include/SDL2 -D_REENTRANT"); } else if (Platform.includedIn(Platform.DARWIN.class)) { return Collections.singletonList("-I/usr/local/include/SDL2 -D_THREAD_SAFE"); } else { throw new UnsupportedOperationException("Unsupported OS"); } } }
{ "pile_set_name": "Github" }
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import DS from 'ember-data'; import Ember from 'ember'; import Converter from 'yarn-ui/utils/converter'; import AbstractAdapter from './abstract'; export default AbstractAdapter.extend({ address: 'rmWebAddress', headers: { Accept: 'text/plain' }, host: Ember.computed("address", function () { let address = this.get("address"); return this.get(`hosts.${address}`); }), pathForType(type) { return 'conf'; }, urlForFindRecord(id, modelName, snapshot) { var extension = this.get("host").split('/').pop(); if (extension != id) { this.host = this.get("host") + id; } var url = this._buildURL(); return url; }, ajax(url, method, hash) { hash = hash || {}; hash.crossDomain = true; hash.xhrFields = {withCredentials: true}; hash.targetServer = "RM"; return this._super(url, method, hash); }, /** * Override options so that result is not expected to be JSON */ ajaxOptions: function (url, type, options) { var hash = options || {}; hash.url = url; hash.type = type; // Make sure jQuery does not try to convert response to JSON. hash.dataType = 'text'; hash.context = this; var headers = Ember.get(this, 'headers'); if (headers != undefined) { hash.beforeSend = function (xhr) { Object.keys(headers).forEach(function (key) { return xhr.setRequestHeader(key, headers[key]); }); }; } return hash; }, });
{ "pile_set_name": "Github" }
version https://git-lfs.github.com/spec/v1 oid sha256:b452e0ff1fd09e13f4762d3423e27c3325efae493a8b20edaacb6e8cbc293b97 size 15657
{ "pile_set_name": "Github" }
################################################################################ # # opentyrian # ################################################################################ OPENTYRIAN_VERSION = 9c9f0ec3532b OPENTYRIAN_SITE = https://bitbucket.org/opentyrian/opentyrian OPENTYRIAN_SITE_METHOD = hg OPENTYRIAN_LICENSE = GPL-2.0+ OPENTYRIAN_LICENSE_FILES = COPYING OPENTYRIAN_DEPENDENCIES = sdl ifeq ($(BR2_PACKAGE_OPENTYRIAN_NET),y) OPENTYRIAN_DEPENDENCIES += sdl_net OPENTYRIAN_NETWORK = true else OPENTYRIAN_NETWORK = false endif define OPENTYRIAN_BUILD_CMDS $(TARGET_MAKE_ENV) $(MAKE) PLATFORM=UNIX \ CC="$(TARGET_CC)" \ STRIP="/bin/true" \ SDL_CONFIG="$(STAGING_DIR)/usr/bin/sdl-config" \ LDFLAGS="$(TARGET_LDFLAGS) -lm" \ WITH_NETWORK="$(OPENTYRIAN_NETWORK)" \ -C $(@D) release endef define OPENTYRIAN_INSTALL_TARGET_CMDS $(INSTALL) -D -m 0755 $(@D)/opentyrian $(TARGET_DIR)/usr/bin/opentyrian endef $(eval $(generic-package))
{ "pile_set_name": "Github" }
# Minimal makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build SPHINXPROJ = LexNLP SOURCEDIR = source BUILDDIR = build # Put it first so that "make" without argument is like "make help". help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) .PHONY: help Makefile # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
{ "pile_set_name": "Github" }
var expect = require("chai").expect; module.exports = function(helpers) { var counter = 0; var component = helpers.mount(require.resolve("./index"), { counter: counter }); expect(component.el.querySelector(".unpreserved-counter").innerHTML).to.equal( "0" ); expect(component.getEl("preserve").getAttribute("data-counter")).to.equal( "0" ); expect(component.el.querySelector(".preserved-counter").innerHTML).to.equal( "0" ); component.input = { counter: ++counter }; component.update(); expect(component.el.querySelector(".unpreserved-counter").innerHTML).to.equal( "1" ); expect(component.getEl("preserve").getAttribute("data-counter")).to.equal( "0" ); expect(component.el.querySelector(".preserved-counter").innerHTML).to.equal( "0" ); };
{ "pile_set_name": "Github" }
{ "asset": { "version": "2.0", "generator": "babylon.js glTF exporter for maya 2018 v1.0.0", "copyright": "2017 (c) BabylonJS" }, "scene": 0, "scenes": [ { "nodes": [ 0, 1, 2, 3 ] } ], "nodes": [ { "mesh": 0, "translation": [ 0, 0, 0 ], "rotation": [ 0, 0, 0, 1 ], "scale": [ 1, 1, 1 ], "name": "pCube1" }, { "mesh": 1, "translation": [ 1.68157125, 0, 0 ], "rotation": [ 0, 0, 0, 1 ], "scale": [ 1, 1, 1 ], "name": "pCube2" }, { "mesh": 2, "translation": [ 2.95393562, 0, 0 ], "rotation": [ 0, 0, 0, 1 ], "scale": [ 0.4003061, 0.4003061, 0.4003061 ], "name": "pSphere1" }, { "mesh": 3, "translation": [ 3.96833062, 0, 0 ], "rotation": [ 0, 0, 0, 1 ], "scale": [ 0.4003061, 0.4003061, 0.4003061 ], "name": "pSphere2" } ], "meshes": [ { "primitives": [ { "attributes": { "POSITION": 1, "NORMAL": 2, "TEXCOORD_0": 3 }, "indices": 0, "mode": 4, "material": 0 }, { "attributes": { "POSITION": 5, "NORMAL": 6, "TEXCOORD_0": 7 }, "indices": 4, "mode": 4, "material": 1 } ], "name": "pCube1" }, { "primitives": [ { "attributes": { "POSITION": 9, "NORMAL": 10, "TEXCOORD_0": 11 }, "indices": 8, "mode": 4, "material": 2 }, { "attributes": { "POSITION": 13, "NORMAL": 14, "TEXCOORD_0": 15 }, "indices": 12, "mode": 4, "material": 1 } ], "name": "pCube2" }, { "primitives": [ { "attributes": { "POSITION": 17, "NORMAL": 18, "TEXCOORD_0": 19 }, "indices": 16, "mode": 4, "material": 0 } ], "name": "pSphere1" }, { "primitives": [ { "attributes": { "POSITION": 21, "NORMAL": 22, "TEXCOORD_0": 23 }, "indices": 20, "mode": 4, "material": 2 } ], "name": "pSphere2" } ], "accessors": [ { "bufferView": 0, "componentType": 5123, "count": 30, "type": "SCALAR", "name": "accessorIndices" }, { "bufferView": 1, "componentType": 5126, "count": 20, "max": [ 0.5, 0.5, 0.5 ], "min": [ -0.5, -0.5, -0.5 ], "type": "VEC3", "name": "accessorPositions" }, { "bufferView": 1, "byteOffset": 240, "componentType": 5126, "count": 20, "type": "VEC3", "name": "accessorNormals" }, { "bufferView": 2, "componentType": 5126, "count": 20, "type": "VEC2", "name": "accessorUVs" }, { "bufferView": 0, "byteOffset": 60, "componentType": 5123, "count": 6, "type": "SCALAR", "name": "accessorIndices" }, { "bufferView": 1, "byteOffset": 480, "componentType": 5126, "count": 4, "max": [ 0.5, 0.5, 0.5 ], "min": [ 0.5, -0.5, -0.5 ], "type": "VEC3", "name": "accessorPositions" }, { "bufferView": 1, "byteOffset": 528, "componentType": 5126, "count": 4, "type": "VEC3", "name": "accessorNormals" }, { "bufferView": 2, "byteOffset": 160, "componentType": 5126, "count": 4, "type": "VEC2", "name": "accessorUVs" }, { "bufferView": 0, "byteOffset": 72, "componentType": 5123, "count": 30, "type": "SCALAR", "name": "accessorIndices" }, { "bufferView": 1, "byteOffset": 576, "componentType": 5126, "count": 20, "max": [ 0.5, 0.5, 0.5 ], "min": [ -0.5, -0.5, -0.5 ], "type": "VEC3", "name": "accessorPositions" }, { "bufferView": 1, "byteOffset": 816, "componentType": 5126, "count": 20, "type": "VEC3", "name": "accessorNormals" }, { "bufferView": 2, "byteOffset": 192, "componentType": 5126, "count": 20, "type": "VEC2", "name": "accessorUVs" }, { "bufferView": 0, "byteOffset": 132, "componentType": 5123, "count": 6, "type": "SCALAR", "name": "accessorIndices" }, { "bufferView": 1, "byteOffset": 1056, "componentType": 5126, "count": 4, "max": [ 0.5, 0.5, 0.5 ], "min": [ 0.5, -0.5, -0.5 ], "type": "VEC3", "name": "accessorPositions" }, { "bufferView": 1, "byteOffset": 1104, "componentType": 5126, "count": 4, "type": "VEC3", "name": "accessorNormals" }, { "bufferView": 2, "byteOffset": 352, "componentType": 5126, "count": 4, "type": "VEC2", "name": "accessorUVs" }, { "bufferView": 0, "byteOffset": 144, "componentType": 5123, "count": 2280, "type": "SCALAR", "name": "accessorIndices" }, { "bufferView": 1, "byteOffset": 1152, "componentType": 5126, "count": 439, "max": [ 1, 1, 1.00000012 ], "min": [ -1.00000024, -1, -1.00000048 ], "type": "VEC3", "name": "accessorPositions" }, { "bufferView": 1, "byteOffset": 6420, "componentType": 5126, "count": 439, "type": "VEC3", "name": "accessorNormals" }, { "bufferView": 2, "byteOffset": 384, "componentType": 5126, "count": 439, "type": "VEC2", "name": "accessorUVs" }, { "bufferView": 0, "byteOffset": 4704, "componentType": 5123, "count": 2280, "type": "SCALAR", "name": "accessorIndices" }, { "bufferView": 1, "byteOffset": 11688, "componentType": 5126, "count": 439, "max": [ 1, 1, 1.00000012 ], "min": [ -1.00000024, -1, -1.00000048 ], "type": "VEC3", "name": "accessorPositions" }, { "bufferView": 1, "byteOffset": 16956, "componentType": 5126, "count": 439, "type": "VEC3", "name": "accessorNormals" }, { "bufferView": 2, "byteOffset": 3896, "componentType": 5126, "count": 439, "type": "VEC2", "name": "accessorUVs" } ], "bufferViews": [ { "buffer": 0, "byteLength": 9264, "name": "bufferViewScalar" }, { "buffer": 0, "byteOffset": 9264, "byteLength": 22224, "byteStride": 12, "name": "bufferViewFloatVec3" }, { "buffer": 0, "byteOffset": 31488, "byteLength": 7408, "byteStride": 8, "name": "bufferViewFloatVec2" } ], "buffers": [ { "uri": "MultiMatOpacity.bin", "byteLength": 38896 } ], "materials": [ { "pbrMetallicRoughness": { "baseColorFactor": [ 1, 0, 0, 1 ], "metallicFactor": 0, "roughnessFactor": 0.1 }, "emissiveFactor": [ 0, 0, 0 ], "alphaMode": "OPAQUE", "name": "aiStandardSurface1" }, { "pbrMetallicRoughness": { "baseColorFactor": [ 0.263597846, 1, 0.263597846, 1 ], "metallicFactor": 0.5470188, "roughnessFactor": 0.5678072 }, "emissiveFactor": [ 0, 0, 0 ], "alphaMode": "OPAQUE", "name": "phong1" }, { "pbrMetallicRoughness": { "baseColorFactor": [ 1, 0, 0, 0.1958042 ], "metallicFactor": 0, "roughnessFactor": 0.1 }, "emissiveFactor": [ 0, 0, 0 ], "alphaMode": "BLEND", "name": "aiStandardSurface1" } ] }
{ "pile_set_name": "Github" }
module['exports'] = function view (opts, callback) { var $ = this.$, req = opts.req; $ = req.white($); callback(null, $.html()); };
{ "pile_set_name": "Github" }
/* * Copyright 2008-2013 Various Authors * Copyright 2004-2005 Timo Hirvonen * * sun.c by alex <pukpuk@gmx.de> * * 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/>. */ #include <sys/types.h> #include <sys/ioctl.h> #include <sys/audioio.h> #include <sys/stat.h> #include <errno.h> #include <fcntl.h> #include <string.h> #include <unistd.h> #include "../op.h" #include "../sf.h" #include "../xmalloc.h" static sample_format_t sun_sf; static int sun_fd = -1; static char *sun_audio_device = NULL; static int sun_reset(void) { if (ioctl(sun_fd, AUDIO_FLUSH, NULL) == -1) return -1; return 0; } static int sun_set_sf(sample_format_t sf) { struct audio_info ainf; AUDIO_INITINFO(&ainf); sun_reset(); sun_sf = sf; ainf.play.channels = sf_get_channels(sun_sf); ainf.play.sample_rate = sf_get_rate(sun_sf); ainf.play.pause = 0; ainf.mode = AUMODE_PLAY; switch (sf_get_bits(sun_sf)) { case 16: ainf.play.precision = 16; if (sf_get_signed(sun_sf)) { if (sf_get_bigendian(sun_sf)) ainf.play.encoding = AUDIO_ENCODING_SLINEAR_BE; else ainf.play.encoding = AUDIO_ENCODING_SLINEAR_LE; } else { if (sf_get_bigendian(sun_sf)) ainf.play.encoding = AUDIO_ENCODING_ULINEAR_BE; else ainf.play.encoding = AUDIO_ENCODING_ULINEAR_LE; } break; case 8: ainf.play.precision = 8; if (sf_get_signed(sun_sf)) ainf.play.encoding = AUDIO_ENCODING_SLINEAR; else ainf.play.encoding = AUDIO_ENCODING_ULINEAR; break; default: return -1; } if (ioctl(sun_fd, AUDIO_SETINFO, &ainf) == -1) return -1; if (ioctl(sun_fd, AUDIO_GETINFO, &ainf) == -1) return -1; /* FIXME: check if sample rate is supported */ return 0; } static int sun_device_exists(const char *dev) { struct stat s; if (stat(dev, &s)) return 0; return 1; } static int sun_init(void) { const char *audio_dev = "/dev/audio"; if (sun_audio_device != NULL) { if (sun_device_exists(sun_audio_device)) return 0; free(sun_audio_device); sun_audio_device = NULL; return -1; } if (sun_device_exists(audio_dev)) { sun_audio_device = xstrdup(audio_dev); return 0; } return -1; } static int sun_exit(void) { if (sun_audio_device != NULL) { free(sun_audio_device); sun_audio_device = NULL; } return 0; } static int sun_close(void) { if (sun_fd != -1) { close(sun_fd); sun_fd = -1; } return 0; } static int sun_open(sample_format_t sf, const channel_position_t *channel_map) { sun_fd = open(sun_audio_device, O_WRONLY); if (sun_fd == -1) return -1; if (sun_set_sf(sf) == -1) { sun_close(); return -1; } return 0; } static int sun_write(const char *buf, int cnt) { const char *t; cnt /= 4; cnt *= 4; t = buf; while (cnt > 0) { int rc = write(sun_fd, buf, cnt); if (rc == -1) { if (errno == EINTR) continue; else return rc; } buf += rc; cnt -= rc; } return (buf - t); } static int sun_pause(void) { struct audio_info ainf; AUDIO_INITINFO(&ainf); ainf.play.pause = 1; if (ioctl(sun_fd, AUDIO_SETINFO, &ainf) == -1) return -1; return 0; } static int sun_unpause(void) { struct audio_info ainf; AUDIO_INITINFO(&ainf); ainf.play.pause = 0; if (ioctl(sun_fd, AUDIO_SETINFO, &ainf) == -1) return -1; return 0; } static int sun_buffer_space(void) { struct audio_info ainf; int sp; AUDIO_INITINFO(&ainf); if (ioctl(sun_fd, AUDIO_GETINFO, &ainf) == -1) return -1; sp = ainf.play.buffer_size; return sp; } static int op_sun_set_device(const char *val) { free(sun_audio_device); sun_audio_device = xstrdup(val); return 0; } static int op_sun_get_device(char **val) { if (sun_audio_device) *val = xstrdup(sun_audio_device); return 0; } const struct output_plugin_ops op_pcm_ops = { .init = sun_init, .exit = sun_exit, .open = sun_open, .close = sun_close, .write = sun_write, .pause = sun_pause, .unpause = sun_unpause, .buffer_space = sun_buffer_space, }; const struct output_plugin_opt op_pcm_options[] = { OPT(op_sun, device), { NULL }, }; const int op_priority = 0; const unsigned op_abi_version = OP_ABI_VERSION;
{ "pile_set_name": "Github" }
syntax = "proto2"; package object_detection.protos; // Configuration proto for ArgMaxMatcher. See // matchers/argmax_matcher.py for details. message ArgMaxMatcher { // Threshold for positive matches. optional float matched_threshold = 1 [default = 0.5]; // Threshold for negative matches. optional float unmatched_threshold = 2 [default = 0.5]; // Whether to construct ArgMaxMatcher without thresholds. optional bool ignore_thresholds = 3 [default = false]; // If True then negative matches are the ones below the unmatched_threshold, // whereas ignored matches are in between the matched and umatched // threshold. If False, then negative matches are in between the matched // and unmatched threshold, and everything lower than unmatched is ignored. optional bool negatives_lower_than_unmatched = 4 [default = true]; // Whether to ensure each row is matched to at least one column. optional bool force_match_for_each_row = 5 [default = false]; // Force constructed match objects to use matrix multiplication based gather // instead of standard tf.gather optional bool use_matmul_gather = 6 [default = false]; }
{ "pile_set_name": "Github" }
<?php /** * @package Joomla.Administrator * @subpackage com_templates * * @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('_JEXEC') or die; JLoader::register('InstallerModelInstall', JPATH_ADMINISTRATOR . '/components/com_installer/models/install.php'); /** * Template style controller class. * * @since 1.6 */ class TemplatesControllerTemplate extends JControllerLegacy { /** * Constructor. * * @param array $config An optional associative array of configuration settings. * * @see JControllerLegacy * @since 3.2 */ public function __construct($config = array()) { parent::__construct($config); // Apply, Save & New, and Save As copy should be standard on forms. $this->registerTask('apply', 'save'); } /** * Method for closing the template. * * @return void. * * @since 3.2 */ public function cancel() { $this->setRedirect(JRoute::_('index.php?option=com_templates&view=templates', false)); } /** * Method for closing a file. * * @return void. * * @since 3.2 */ public function close() { $app = JFactory::getApplication(); $file = base64_encode('home'); $id = $app->input->get('id'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } /** * Method for copying the template. * * @return boolean true on success, false otherwise * * @since 3.2 */ public function copy() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $this->input->set('installtype', 'folder'); $newName = $this->input->get('new_name'); $newNameRaw = $this->input->get('new_name', null, 'string'); $templateID = $this->input->getInt('id', 0); $file = $this->input->get('file'); $this->setRedirect('index.php?option=com_templates&view=template&id=' . $templateID . '&file=' . $file); $model = $this->getModel('Template', 'TemplatesModel'); $model->setState('new_name', $newName); $model->setState('tmp_prefix', uniqid('template_copy_')); $model->setState('to_path', JFactory::getConfig()->get('tmp_path') . '/' . $model->getState('tmp_prefix')); // Process only if we have a new name entered if (strlen($newName) > 0) { if (!JFactory::getUser()->authorise('core.create', 'com_templates')) { // User is not authorised to delete $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_CREATE_NOT_PERMITTED'), 'error'); return false; } // Set FTP credentials, if given JClientHelper::setCredentialsFromRequest('ftp'); // Check that new name is valid if (($newNameRaw !== null) && ($newName !== $newNameRaw)) { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_INVALID_TEMPLATE_NAME'), 'error'); return false; } // Check that new name doesn't already exist if (!$model->checkNewName()) { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_DUPLICATE_TEMPLATE_NAME'), 'error'); return false; } // Check that from name does exist and get the folder name $fromName = $model->getFromName(); if (!$fromName) { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_INVALID_FROM_NAME'), 'error'); return false; } // Call model's copy method if (!$model->copy()) { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_COULD_NOT_COPY'), 'error'); return false; } // Call installation model $this->input->set('install_directory', JFactory::getConfig()->get('tmp_path') . '/' . $model->getState('tmp_prefix')); $installModel = $this->getModel('Install', 'InstallerModel'); JFactory::getLanguage()->load('com_installer'); if (!$installModel->install()) { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_COULD_NOT_INSTALL'), 'error'); return false; } $this->setMessage(JText::sprintf('COM_TEMPLATES_COPY_SUCCESS', $newName)); $model->cleanup(); return true; } } /** * Method to get a model object, loading it if required. * * @param string $name The model name. Optional. * @param string $prefix The class prefix. Optional. * @param array $config Configuration array for model. Optional (note, the empty array is atypical compared to other models). * * @return JModelLegacy The model. * * @since 3.2 */ public function getModel($name = 'Template', $prefix = 'TemplatesModel', $config = array()) { $model = parent::getModel($name, $prefix, $config); return $model; } /** * Method to check if you can add a new record. * * @return boolean * * @since 3.2 */ protected function allowEdit() { return JFactory::getUser()->authorise('core.edit', 'com_templates'); } /** * Method to check if you can save a new or existing record. * * @return boolean * * @since 3.2 */ protected function allowSave() { return $this->allowEdit(); } /** * Saves a template source file. * * @return void * * @since 3.2 */ public function save() { // Check for request forgeries. JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $data = $this->input->post->get('jform', array(), 'array'); $task = $this->getTask(); $model = $this->getModel(); $fileName = $app->input->get('file'); $explodeArray = explode(':', base64_decode($fileName)); // Access check. if (!$this->allowSave()) { $app->enqueueMessage(JText::_('JERROR_SAVE_NOT_PERMITTED'), 'error'); return false; } // Match the stored id's with the submitted. if (empty($data['extension_id']) || empty($data['filename'])) { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_SOURCE_ID_FILENAME_MISMATCH'), 'error'); return false; } elseif ($data['extension_id'] != $model->getState('extension.id')) { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_SOURCE_ID_FILENAME_MISMATCH'), 'error'); return false; } elseif ($data['filename'] != end($explodeArray)) { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_SOURCE_ID_FILENAME_MISMATCH'), 'error'); return false; } // Validate the posted data. $form = $model->getForm(); if (!$form) { $app->enqueueMessage($model->getError(), 'error'); return false; } $data = $model->validate($form, $data); // Check for validation errors. if ($data === false) { // Get the validation messages. $errors = $model->getErrors(); // Push up to three validation messages out to the user. for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) { if ($errors[$i] instanceof Exception) { $app->enqueueMessage($errors[$i]->getMessage(), 'warning'); } else { $app->enqueueMessage($errors[$i], 'warning'); } } // Redirect back to the edit screen. $url = 'index.php?option=com_templates&view=template&id=' . $model->getState('extension.id') . '&file=' . $fileName; $this->setRedirect(JRoute::_($url, false)); return false; } // Attempt to save the data. if (!$model->save($data)) { // Redirect back to the edit screen. $this->setMessage(JText::sprintf('JERROR_SAVE_FAILED', $model->getError()), 'warning'); $url = 'index.php?option=com_templates&view=template&id=' . $model->getState('extension.id') . '&file=' . $fileName; $this->setRedirect(JRoute::_($url, false)); return false; } $this->setMessage(JText::_('COM_TEMPLATES_FILE_SAVE_SUCCESS')); // Redirect the user based on the chosen task. switch ($task) { case 'apply': // Redirect back to the edit screen. $url = 'index.php?option=com_templates&view=template&id=' . $model->getState('extension.id') . '&file=' . $fileName; $this->setRedirect(JRoute::_($url, false)); break; default: // Redirect to the list screen. $file = base64_encode('home'); $id = $app->input->get('id'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); break; } } /** * Method for creating override. * * @return void * * @since 3.2 */ public function overrides() { $app = JFactory::getApplication(); $model = $this->getModel(); $file = $app->input->get('file'); $override = base64_decode($app->input->get('folder')); $id = $app->input->get('id'); if ($model->createOverride($override)) { $this->setMessage(JText::_('COM_TEMPLATES_OVERRIDE_SUCCESS')); } // Redirect back to the edit screen. $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } /** * Method for compiling LESS. * * @return void * * @since 3.2 */ public function less() { $app = JFactory::getApplication(); $model = $this->getModel(); $id = $app->input->get('id'); $file = $app->input->get('file'); if ($model->compileLess($file)) { $this->setMessage(JText::_('COM_TEMPLATES_COMPILE_SUCCESS')); } else { $app->enqueueMessage(JText::_('COM_TEMPLATES_COMPILE_ERROR'), 'error'); } $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } /** * Method for deleting a file. * * @return void * * @since 3.2 */ public function delete() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $model = $this->getModel(); $id = $app->input->get('id'); $file = $app->input->get('file'); if (base64_decode(urldecode($file)) == 'index.php') { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_INDEX_DELETE'), 'warning'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } elseif ($model->deleteFile($file)) { $this->setMessage(JText::_('COM_TEMPLATES_FILE_DELETE_SUCCESS')); $file = base64_encode('home'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } else { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_FILE_DELETE'), 'error'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } } /** * Method for creating a new file. * * @return void * * @since 3.2 */ public function createFile() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $model = $this->getModel(); $id = $app->input->get('id'); $file = $app->input->get('file'); $name = $app->input->get('name'); $location = base64_decode($app->input->get('address')); $type = $app->input->get('type'); if ($type == 'null') { $app->enqueueMessage(JText::_('COM_TEMPLATES_INVALID_FILE_TYPE'), 'error'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } elseif (!preg_match('/^[a-zA-Z0-9-_]+$/', $name)) { $app->enqueueMessage(JText::_('COM_TEMPLATES_INVALID_FILE_NAME'), 'error'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } elseif ($model->createFile($name, $type, $location)) { $this->setMessage(JText::_('COM_TEMPLATES_FILE_CREATE_SUCCESS')); $file = urlencode(base64_encode($location . '/' . $name . '.' . $type)); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } else { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_FILE_CREATE'), 'error'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } } /** * Method for uploading a file. * * @return void * * @since 3.2 */ public function uploadFile() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $model = $this->getModel(); $id = $app->input->get('id'); $file = $app->input->get('file'); $upload = $app->input->files->get('files'); $location = base64_decode($app->input->get('address')); if ($return = $model->uploadFile($upload, $location)) { $app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_UPLOAD_SUCCESS') . $upload['name']); $redirect = base64_encode($return); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $redirect; $this->setRedirect(JRoute::_($url, false)); } else { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_FILE_UPLOAD'), 'error'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } } /** * Method for creating a new folder. * * @return void * * @since 3.2 */ public function createFolder() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $model = $this->getModel(); $id = $app->input->get('id'); $file = $app->input->get('file'); $name = $app->input->get('name'); $location = base64_decode($app->input->get('address')); if (!preg_match('/^[a-zA-Z0-9-_.]+$/', $name)) { $app->enqueueMessage(JText::_('COM_TEMPLATES_INVALID_FOLDER_NAME'), 'error'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } elseif ($model->createFolder($name, $location)) { $this->setMessage(JText::_('COM_TEMPLATES_FOLDER_CREATE_SUCCESS')); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } else { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_FOLDER_CREATE'), 'error'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } } /** * Method for deleting a folder. * * @return void * * @since 3.2 */ public function deleteFolder() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $model = $this->getModel(); $id = $app->input->get('id'); $file = $app->input->get('file'); $location = base64_decode($app->input->get('address')); if (empty($location)) { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_ROOT_DELETE'), 'warning'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } elseif ($model->deleteFolder($location)) { $this->setMessage(JText::_('COM_TEMPLATES_FOLDER_DELETE_SUCCESS')); if (stristr(base64_decode($file), $location) != false) { $file = base64_encode('home'); } $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } else { $app->enqueueMessage(JText::_('COM_TEMPLATES_FOLDER_DELETE_ERROR'), 'error'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } } /** * Method for renaming a file. * * @return void * * @since 3.2 */ public function renameFile() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $model = $this->getModel(); $id = $app->input->get('id'); $file = $app->input->get('file'); $newName = $app->input->get('new_name'); if (base64_decode(urldecode($file)) == 'index.php') { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_RENAME_INDEX'), 'warning'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } elseif (!preg_match('/^[a-zA-Z0-9-_]+$/', $newName)) { $app->enqueueMessage(JText::_('COM_TEMPLATES_INVALID_FILE_NAME'), 'error'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } elseif ($rename = $model->renameFile($file, $newName)) { $this->setMessage(JText::_('COM_TEMPLATES_FILE_RENAME_SUCCESS')); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $rename; $this->setRedirect(JRoute::_($url, false)); } else { $app->enqueueMessage(JText::_('COM_TEMPLATES_ERROR_FILE_RENAME'), 'error'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } } /** * Method for cropping an image. * * @return void * * @since 3.2 */ public function cropImage() { $app = JFactory::getApplication(); $id = $app->input->get('id'); $file = $app->input->get('file'); $x = $app->input->get('x'); $y = $app->input->get('y'); $w = $app->input->get('w'); $h = $app->input->get('h'); $model = $this->getModel(); if (empty($w) && empty($h) && empty($x) && empty($y)) { $app->enqueueMessage(JText::_('COM_TEMPLATES_CROP_AREA_ERROR'), 'error'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } elseif ($model->cropImage($file, $w, $h, $x, $y)) { $app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_CROP_SUCCESS')); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } else { $app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_CROP_ERROR'), 'error'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } } /** * Method for resizing an image. * * @return void * * @since 3.2 */ public function resizeImage() { $app = JFactory::getApplication(); $id = $app->input->get('id'); $file = $app->input->get('file'); $width = $app->input->get('width'); $height = $app->input->get('height'); $model = $this->getModel(); if ($model->resizeImage($file, $width, $height)) { $app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_RESIZE_SUCCESS')); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } else { $app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_RESIZE_ERROR'), 'error'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } } /** * Method for copying a file. * * @return void * * @since 3.2 */ public function copyFile() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $id = $app->input->get('id'); $file = $app->input->get('file'); $newName = $app->input->get('new_name'); $location = base64_decode($app->input->get('address')); $model = $this->getModel(); if (!preg_match('/^[a-zA-Z0-9-_]+$/', $newName)) { $app->enqueueMessage(JText::_('COM_TEMPLATES_INVALID_FILE_NAME'), 'error'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } elseif ($model->copyFile($newName, $location, $file)) { $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } else { $app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_COPY_FAIL'), 'error'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } } /** * Method for extracting an archive file. * * @return void * * @since 3.2 */ public function extractArchive() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $id = $app->input->get('id'); $file = $app->input->get('file'); $model = $this->getModel(); if ($model->extractArchive($file)) { $app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_ARCHIVE_EXTRACT_SUCCESS')); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } else { $app->enqueueMessage(JText::_('COM_TEMPLATES_FILE_ARCHIVE_EXTRACT_FAIL'), 'error'); $url = 'index.php?option=com_templates&view=template&id=' . $id . '&file=' . $file; $this->setRedirect(JRoute::_($url, false)); } } }
{ "pile_set_name": "Github" }
{ "images" : [ { "idiom" : "universal", "filename" : "ic_addoption.png", "scale" : "1x" }, { "idiom" : "universal", "filename" : "ic_addoption@2x.png", "scale" : "2x" }, { "idiom" : "universal", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
{ "status": "廢止", "name": "交通銀行條例", "revision": [ { "date": "1928.11.16", "content": { "1": { "num": 1, "zh": "第一條", "article": "交通銀行經國民政府之特許,為發展全國實業之銀行,依照股份有限公司條例組織之。" }, "2": { "num": 2, "zh": "第二條", "article": "交通銀行資本總額定為國幣一千萬元,分為十萬股,每股國幣一百元,除政府於資本總額中,先後認股二萬股外,餘由人民承購。交通銀行因業務上之必要,須增加股本時,得由股東總會議決,呈請財政部核准之。" }, "3": { "num": 3, "zh": "第三條", "article": "交通銀行設總行於上海,並於實業上必要區域,設立分支行或與其他銀行號,訂立代理契約。" }, "4": { "num": 4, "zh": "第四條", "article": "交通銀行股票概用記名式,其買賣讓與以有中華民國國籍為限。" }, "5": { "num": 5, "zh": "第五條", "article": "交通銀行營業期限,自本條例公布日起算滿三十年為期,期滿時經股東總會議決,並經財政部核准得延長之。" }, "6": { "num": 6, "zh": "第六條", "article": "交通銀行受政府之委託,得經理左列各項事務:一、代理公共實業機關發行債票及經理還本付息事宜。二、代理交通事業之公款出入事項。三、辦理其他獎勵及發展實業事項。四、經理一部份之國庫事項。" }, "7": { "num": 7, "zh": "第七條", "article": "交通銀行經財政部之特准,得發行兌換券,但須遵照兌換券條例辦理。" }, "8": { "num": 8, "zh": "第八條", "article": "交通銀行得為左列各項業務:一、國家地方或公司債票之經理應募或承受。二、國家地方或公司債票及確實股票為擔保之放款。三、實業用動產、不動產及實業繁盛地域不動產為擔保之放款,但放款總額不得超過已繳資本二分之一。四、商業確實期票之貼現。五、收受存款。六、信託業務。七、代理收解各種款項。" }, "9": { "num": 9, "zh": "第九條", "article": "交通銀行除第八條所列各項營業外,不得經營左列各項及其他事業:一、無擔保品之各種放款及保證。二、收買本銀行股票並以本行股票為擔保之放款。三、買賣不動產但業務上必要之不動產,不在此限。" }, "10": { "num": 10, "zh": "第十條", "article": "交通銀行設董事十五人,監察人五人,由財政部指派董事三人,監察人一人,其餘董事十二人,監察人四人,由股東總會商股股東在百股以上之商股股東中選任之,董事任期四年,監察人任期三年,期滿得連舉連任。" }, "11": { "num": 11, "zh": "第十一條", "article": "交通銀行設常務董事五人,由董事互選之,並由常務董事中由財政部指派一人為董事長。交通銀行設總理一人,由常務董事中互選之,呈請財政部備案,總理有事故不能執行職務時,由常務董事中互推一人代理之。" }, "12": { "num": 12, "zh": "第十二條", "article": "交通銀行之股東總會分為左列兩種:一、通常股東總會。二、臨時股東總會。" }, "13": { "num": 13, "zh": "第十三條", "article": "通常股東總會每年於總行所在地開會一次,由董事會召集之。" }, "14": { "num": 14, "zh": "第十四條", "article": "董事會認為重要事件必須會議時,可召集臨時股東總會。" }, "15": { "num": 15, "zh": "第十五條", "article": "董事會遇有董事過半數,或監察人全體或股東總會會員五十人以上,並佔有股份全額百分之十以上者,因重要事件請求會議,可召集臨時股東總會。" }, "16": { "num": 16, "zh": "第十六條", "article": "股東總會開會時,有十股以上或代表十股以上之股東,於開會日六十日以前註冊者,始有會員資格列席會議。" }, "17": { "num": 17, "zh": "第十七條", "article": "股東總會會員,因有事故不能到會時,其委託代理人,以會員為限。" }, "18": { "num": 18, "zh": "第十八條", "article": "每年營業所得淨利總額內須提十分之一以上作為公積金,始得攤派股利。前項公積金及股利,須經股東總會之議決,呈報財政部核准備案。" }, "19": { "num": 19, "zh": "第十九條", "article": "前項公積金用途如左:一、填補資本之損失。二、維持股利之平均。" }, "20": { "num": 20, "zh": "第二十條", "article": "交通銀行有違背本條例及本行章程之行為,或不利於政府之事件,財政部得制止之。" }, "21": { "num": 21, "zh": "第二十一條", "article": "交通銀行須照本條例主旨,詳訂章程付股東總會議決,呈請財政部核准備案,遇有須改訂增損時亦同。" }, "22": { "num": 22, "zh": "第二十二條", "article": "本條例遇有修改時,須經股東總會議決,由董事會呈請財政部核准之。" }, "23": { "num": 23, "zh": "第二十三條", "article": "本條例自公布日施行。" } } }, { "date": "1935.6.4", "content": { "1": { "num": 1, "zh": "第一條", "article": "交通銀行經國民政府之特許,為發展全國實業之銀行,以股份有限公司之組織設立之。" }, "2": { "num": 2, "zh": "第二條", "article": "交通銀行股本總額定為國幣二千萬元,分為二十萬股,每股國幣一百元,官股十二萬股,商股八萬股,均一次繳足。如有增加商股之必要時,得由股東總會議決,呈請財政部核准增加之。三十三年二月財政部核准修正,修正條文如下:交通銀行股本總額定為國幣六千萬元,分為六十萬股,每股國幣一百元,官股五十二萬股,商股八萬股,均一次繳足。如有增加商股之必要時,得由股東總會議決,呈請財政部核准增加之。" }, "3": { "num": 3, "zh": "第三條", "article": "交通銀行設總行於上海,並於實業上必要之處設立分支行或與其他銀行號訂立代理契約。" }, "4": { "num": 4, "zh": "第四條", "article": "交通銀行股票概用記名式,股東以有中華民國國籍者為限。" }, "5": { "num": 5, "zh": "第五條", "article": "交通銀行營業期限,自本條例公布日起算滿三十年為期。期滿時得由股東總會議決,經財政部核准延長之。" }, "6": { "num": 6, "zh": "第六條", "article": "交通銀行股利,官股年利五釐,商股年利七釐。" }, "7": { "num": 7, "zh": "第七條", "article": "每年營業所得淨利總額內,須提十分之一以上為公積金,始得攤派股利紅利,其攤派次序先付商股股利,次付官股股利,如尚有餘額,平均按股分攤紅利。前項公積金及股利紅利之攤提,經股東總會通過後,呈報財政部備案。" }, "8": { "num": 8, "zh": "第八條", "article": "公積金之用途,為填補資本之損失及維持股利之平均。" }, "9": { "num": 9, "zh": "第九條", "article": "交通銀行受政府及中央銀行之委託,辦理左列各項事務:一、經募政府公債庫券及經理還本付息事宜。二、代理公共實業機關發行債票及經理還本付息事宜。三、代理交通事業之公款出入事項。四、辦理其他獎勵及發展實業事項。五、經理一部份之國庫事項。" }, "10": { "num": 10, "zh": "第十條", "article": "交通銀行經財政部之特准,得發行兌換券,但須遵照兌換券條例辦理。" }, "11": { "num": 11, "zh": "第十一條", "article": "交通銀行營業之種類如左:一、實業公司發行之公司債經理應募或承受。二、有確實擔保品為抵押之放款及實業工廠商號往來放款。三、實業用動產不動產為擔保之放款;但放款總額不得超過已繳股本二分之一。四、商業確實期票及匯票之貼現或買入。五、經收各種存款,並代人保管證券票據及其他一切貴重物品。六、信託儲蓄業務。七、代理收解各種款項。八、國內外匯兌及貨物押匯。九、買賣證券生金銀及各國貨幣。十、倉庫運輸及保險業務。十一、發展實業之投資,但投資數額不得超過已繳股本四分之一。" }, "12": { "num": 12, "zh": "第十二條", "article": "交通銀行除第十一條所列各項營業外,不得經營左列各項及其他事業:一、無擔保之各種放款及保證。二、收買本銀行股票並以本銀行股票為擔保之放款。三、買賣不動產,但營業上必要之不動產不在此限。" }, "13": { "num": 13, "zh": "第十三條", "article": "交通銀行設董事二十一人,監察人七人,由財政部指派董事九人,監察人三人,其餘董事十二人,監察人四人,由股東總會商股股東在百股以上之商股股東中選任之,董事任期四年,監察人任期三年,期滿均得連任。三十三年二月財政部核准修正,修正條文如下:交通銀行設董事二十五人,監察人九人,由財政部指派董事十三人,監察人五人,其餘董事十二人,監察人四人,由股東總會商股股東在百股以上之商股股東中選任之,董事任期四年,監察人任期三年,期滿均得連任。" }, "14": { "num": 14, "zh": "第十四條", "article": "交通銀行設常務董事七人,由董事互選之,並由財政部於常務董事中指派一人為董事長。交通銀行設總經理一人,由董事長商同常務董事於董事中選定,提經董事會同意聘任,呈報財政部核准備案。" }, "15": { "num": 15, "zh": "第十五條", "article": "交通銀行之股東總會分為左列兩種:一、通常股東總會。二、臨時股東總會。" }, "16": { "num": 16, "zh": "第十六條", "article": "通常股東總會每年於總行所在地開會一次,由董事會召集之。" }, "17": { "num": 17, "zh": "第十七條", "article": "董事會認為重要事件必須會議時,得召集臨時股東總會。" }, "18": { "num": 18, "zh": "第十八條", "article": "董事會遇有董事過半數,或監察人全體,或股東總會會員五十人以上並占有股份全額百分之十以上者,因重要事件請求會議時,得召集臨時股東總會。" }, "19": { "num": 19, "zh": "第十九條", "article": "股東總會開會時,有十股以上或代表十股以上之股東於開會六十日以前註冊者,始有會員資格,列席會議。" }, "20": { "num": 20, "zh": "第二十條", "article": "股東總會會員之投票權,每十股有一權,百股以上每二十股遞增一權。" }, "21": { "num": 21, "zh": "第二十一條", "article": "股東總會商股會員因有事故不能到會時,其委託代理人以會員為限。" }, "22": { "num": 22, "zh": "第二十二條", "article": "交通銀行有違背本條例及本行章程之行為或不利於政府之事件,財政部得制止之。" }, "23": { "num": 23, "zh": "第二十三條", "article": "交通銀行須照本條例主旨詳訂章程,付股東總會議決,呈請財政部核准備案,遇有須改訂增損時亦同。" }, "24": { "num": 24, "zh": "第二十四條", "article": "本條例未規定事項,得准照公司法辦理。" }, "25": { "num": 25, "zh": "第二十五條", "article": "本條例遇有修改時得經股東總會議決,由董事長呈請財政部核定修正之。" }, "26": { "num": 26, "zh": "第二十六條", "article": "本條例自公布日施行。" } } }, { "date": "1950.5.31", "content": { "3": { "num": 3, "zh": "第三條", "article": "交通銀行總管理處設在中央政府所在地,並於實業上必要之處設立分支行或與其他銀行訂立代理契約。" } } }, { "date": "1979.1.16", "content": { "1": { "num": 1, "zh": "第一條", "article": "交通銀行(以下簡稱本行)經政府特許為發展全國工、礦、交通及其他公用事業之開發銀行。並依股份有限公司之組織設立之。" }, "2": { "num": 2, "zh": "第二條", "article": "本行資本總額定為新臺幣壹百億元。前項資本總額如有增減必要時,得由董事會議決,報經財政部核轉行政院核准之。" }, "3": { "num": 3, "zh": "第三條", "article": "本行之股東,以中華民國國民或法人為限。" }, "4": { "num": 4, "zh": "第四條", "article": "本行總管理處設於中華民國中央政府所在地,必要時得設分支機構。" }, "5": { "num": 5, "zh": "第五條", "article": "本行經營左列業務:一、辦理中長期開發性放款、保證及有關配合性之短期授信;存款及代人保管證券、票據及其他貴重物品。二、主動參加創導性之投資。三、輔導、協助授信與投資事業,改進生產技術與經營管理。四、辦理證券之認購、承銷及保證。五、辦理國內外匯兌及貨物押匯。六、其他經財政部核定或中央銀行特許辦理之業務。前項第一款至第四款業務對象,以工、礦、交通及其他公用事業為限。" }, "6": { "num": 6, "zh": "第六條", "article": "本行對創導性事業投資於每一企業之金額,除經財政部核准者外,不得超過本行淨值百分之五及該企業資本總額百分之二十五。前項投資及其股權,應於被投資事業營運正常時,經本行董事會通過後出讓之。" }, "7": { "num": 7, "zh": "第七條", "article": "本行對工、礦、交通及其他公用事業中長期開發性之授信,不得少於其授信總額百分之七十。" }, "8": { "num": 8, "zh": "第八條", "article": "本行為籌措資金,得向國外借款及經財政部核准接受政府指定之基金存款與在國內外發行金融債券。" }, "9": { "num": 9, "zh": "第九條", "article": "本行置董事十五人,組織董事會。公股及民股董事名額照股權比例分配之。公股董事由財政部指定,民股董事由股東會就民股股東中選任之;任期均三年,期滿連選得連任。" }, "10": { "num": 10, "zh": "第十條", "article": "本行置常務董事七人,由董事互選之,並由常務董事互選一人為董事長;其任期與董事同。" }, "11": { "num": 11, "zh": "第十一條", "article": "董事會之職權如左:一、業務方針及計畫之核定事項。二、分支機構之設立、撤銷或變更事項。三、預算、決算之審議事項。四、放款、保證與投資業務授權額度之審定,及超過授權額度案件之核定事項。五、高級職員任免之審定事項。六、重要章則及契約之審定事項。七、本條例及本行章程規定之其他事項。前項各款職權,董事會得以一部或全部授權常務董事會;常務董事會之決議應彙報董事會核備。" }, "12": { "num": 12, "zh": "第十二條", "article": "本行置監察人五人,組織監察人會。公股及民股監察人名額,照股權比例分配之。公股監察人由財政部指定,民股監察人由股東會就民股股東中選任之;任期均三年,期滿連選得連任。本行置常駐監察人一人,由監察人互選之;其任期與監察人同。" }, "13": { "num": 13, "zh": "第十三條", "article": "監察人會之職權如左:一、各項帳目之查核及資產、負債之定期檢查事項。二、年終決算之審核事項。三、違背本條例及本行章則之檢舉事項。四、依照法令及本行章程規定之其他事項。前項各款職權,監察人會得以一部或全部授權常駐監察人;常駐監察人所作之處理事項應彙報於監察人會。" }, "14": { "num": 14, "zh": "第十四條", "article": "本行置總經理一人,副總經理一人至三人,由董事長提經董事會同意,並報請財政部核准後聘任之。" }, "15": { "num": 15, "zh": "第十五條", "article": "本行每年營業所得純利,應先提取百分之四十為法定盈餘公積,並得另提特別盈餘公積。" }, "16": { "num": 16, "zh": "第十六條", "article": "本行經營業務所發生呆帳之核銷,由財政部依所得稅法,核定額度,授權董事會辦理。" }, "17": { "num": 17, "zh": "第十七條", "article": "本條例未規定事項,依銀行法、公司法及其他有關法律規定辦理。" }, "18": { "num": 18, "zh": "第十八條", "article": "本條例自公布日施行。" } } }, { "date": "1991.1.15", "content": { "2": { "num": 2, "zh": "第二條", "article": "本行資本總額定為新臺幣二百億元。前項資本總額如有增減必要時,由董事會議決,報經財政部核轉行政院核准之。", "reason": "為配合金融自由化、國際化政策,提高國際信用地位,強化市場競爭能力,充實自有資本,增加營運資金,以辦理政策性融資業務發揮專業銀行之功能,爰將該行資本總額由新臺幣一百億元修正提高為二百億元,並酌作文字修正。" }, "5": { "num": 5, "zh": "第五條", "article": "本行經營左列業務:一、辦理中、長期開發性放款、保證等授信業務。二、主動參加創導性之投資。三、輔導、協助授信與投資事業,改進生產技術與經營管理。四、辦理證券之認購、承銷及保證。五、辦理中、短期放款、保證等授信業務,以及收受存款、代人保管證券、票據與其他貴重物品。六、辦理國內外匯兌及貨物押匯。七、其他經財政部核定或中央銀行特許辦理之業務。", "reason": "一、將現行條文第一項第一款前段之中長期開發性放款、保證業務單獨列為第一款,明定該行具開發銀行之特性。二、現行條文第一項第一款後段有關配合性短期授信、存款、代人保管證券、票據與其他貴重物品移列第五款,並將配合性短期授信擴充為一般性授信,以明定該行除開發性業務外,亦辦理一般商業銀行業務。三、現行條文第一項第五款、第六款分別改列為第六款及第七款。四、第七條已定有該行對工、礦、交通及其他公用事業中長期開發性之授信,不得少於其授信總額百分之七十之規定,為擴大該行之服務層面爰刪除現行條文之第二項之規定。" } } }, { "date": "2000.1.15", "content": { "2": { "num": 2, "zh": "第二條", "article": "(刪除)", "reason": "一、本條刪除。二、為避免該行資本額變動即需修法,且該行已依公司法規定,於公司章程中載明資本額,本條文已無存在必要,爰刪除之。" }, "3": { "num": 3, "zh": "第三條", "article": "(刪除)", "reason": "一、本條刪除。二、現行華僑及外國人投資證券管理辦法及銀行法,對於外國人投資任一發行公司股票之股份總額及同一人、同一關係人持有銀行股票均有其限額之規定,爰刪除本條文。" }, "9": { "num": 9, "zh": "第九條", "article": "本行置董事十五人,組織董事會,董事由股東會就股東中選任之。董事任期三年,得連選連任。本行置常務董事七人,由董事互選之,並由常務董事互選一人為董事長,任期與董事同。", "reason": "一、公司法第一百九十八條規定,股東會選任董事時,每一股份有與應選出董事人數相同之選舉權,得集中選舉一人,或分配選舉數人,由所得選票代表選舉權較多者,當選為董事。因此,公司法對董事之選任方式已有明確規定,爰將現行條文有關公股及民股董事名額照股權比例分配之規定刪除,並列為第一項。二、另為期體例一致,爰參照修正條文第十二條規定,將現行條文第十條有關常務董事及董事長之選任及任期移列為本條第二項規定。" }, "10": { "num": 10, "zh": "第十條", "article": "(刪除)", "reason": "一、本條刪除。二、現行條文規範內容已移列為修正條文第九條第二項,爰刪除本條文。" }, "12": { "num": 12, "zh": "第十二條", "article": "本行置監察人五人,組織監察人會,監察人由股東會就股東中選任之。監察人任期三年,得連選連任。本行置常駐監察人一人,由監察人互選之,任期與監察人同。", "reason": "依公司法第二百二十七條規定,該法第一百九十八條有關董事選任之方式規定於監察人準用之。因此,公司法對監察人之選任方式亦已有明確規定,爰將現行條文有關公股及民股監察人名額照股權比例分配之規定刪除,並列為第一項。" }, "15": { "num": 15, "zh": "第十五條", "article": "(刪除)", "reason": "一、本條刪除。二、銀行法第五十條對法定盈餘公積之提存已有明確規定,爰刪除本條文。" }, "16": { "num": 16, "zh": "第十六條", "article": "(刪除)", "reason": "一、本條刪除。二、各銀行有關呆帳之核銷,應依所得稅法及中央主管機關相關規定辦理,爰刪除現行條文之規定。" } } } ] }
{ "pile_set_name": "Github" }
--- title: 调试Pods和Replication Controllers --- {{< toc >}} ## 调试Pods 调试一个pod的第一步是观察它。使用下面的命令检查这个pod的当前状态和最近事件: $ kubectl describe pods ${POD_NAME} 看看pod中的容器的状态。他们都是`Running`吗?有最近重启了吗? 根据pod的状态继续调试。 ### 我的Pod保持Pending 如果一个pod被卡在`Pending`中,就意味着它不能调度在某个节点上。一般来说,这是因为某种类型的资源不足 阻止调度。 看看上面的命令`kubectl describe ...`的输出。调度器的消息中应该会包含无法调度Pod的原因。 理由包括: #### 资源不足 您可能已经耗尽了集群中供应的CPU或内存。在这个情况下你可以尝试几件事情: * [添加更多节点](/docs/admin/cluster-management/#resizing-a-cluster) 到集群。 * [终止不需要的pod](/docs/user-guide/pods/single-container/#deleting_a_pod) 为pending中的pods提供空间。 * 检查该pod是否不大于您的节点。例如,如果全部节点具有`cpu:1`容量,那么具有`cpu: 1.1`请求的pod永远不会被调度。 您可以使用`kubectl get nodes -o <format>`命令来检查节点容量。 下面是一些能够提取必要信息的命令示例: kubectl get nodes -o yaml | grep '\sname\|cpu\|memory' kubectl get nodes -o json | jq '.items[] | {name: .metadata.name, cap: .status.capacity}' 可以考虑配置[资源配额](/docs/concepts/policy/resource-quotas/)来限制可耗用的资源总量。如果与命名空间一起使用,它可以防止一个团队吞噬所有的资源。 #### 使用hostPort 当你将一个pod绑定到一个`hostPort`时,这个pod能被调度的位置数量有限。 在大多数情况下,`hostPort`是不必要的; 尝试使用服务对象来暴露您的pod。 如果你需要`hostPort`,那么你可以调度的Pod数量不能超过集群的节点个数。 ### 我的Pod一直在Waiting 如果一个pod被卡在`Waiting`状态,那么它已被调度在某个工作节点,但它不能在该机器上运行。 再次,来自`kubectl describe ...`的内容应该是可以提供信息的。 最常见的原因`Waiting`的pod是无法拉取镜像。有三件事要检查: * 确保您的镜像的名称正确。 * 您是否将镜像推送到存储库? * 在您的机器上手动运行`docker pull <image>`,看看是否可以拉取镜像。 ### 我的Pod一直Crashing或者有别的不健康状态 首先,查看当前容器的日志: $ kubectl logs ${POD_NAME} ${CONTAINER_NAME} 如果您的容器先前已崩溃,则可以访问上一个容器的崩溃日志: $ kubectl logs --previous ${POD_NAME} ${CONTAINER_NAME} 或者,您可以使用`exec`在该容器内运行命令: $ kubectl exec ${POD_NAME} -c ${CONTAINER_NAME} -- ${CMD} ${ARG1} ${ARG2} ... ${ARGN} 请注意,`-c ${CONTAINER_NAME}`是可选的,对于pod只包含一个容器可以省略。 例如,要查看正在运行的Cassandra pod的日志,可以运行: $ kubectl exec cassandra -- cat /var/log/cassandra/system.log 如果这些方法都不起作用,您可以找到该运行pod所在的主机并SSH到该主机。 ## 调试Replication Controllers Replication Controllers相当简单。他们能或不能创建pod。如果他们无法创建pod,那么请参考 [上面的说明](#debugging_pods)来调试你的pod。 您也可以使用`kubectl describe rc ${CONTROLLER_NAME}`来检查和Replication Controllers有关的事件。
{ "pile_set_name": "Github" }
/* * Copyright (C) 2011 Baidu.com Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.baidu.cafe; import com.baidu.cafe.remote.Armser; import android.app.Service; import android.test.ServiceTestCase; /** * @author luxiaoyu01@baidu.com * @date 2011-9-20 * @version * @todo */ public class CafeServiceTestCase<T extends Service> extends ServiceTestCase<T> { protected static Armser remote = null; private static String mPackageName = null; private TearDownHelper mTearDownHelper = null; public CafeServiceTestCase(Class<T> serviceClass) { super(serviceClass); } @Override protected void setUp() throws Exception { super.setUp(); mPackageName = this.getClass().getName(); remote = new Armser(getContext()); remote.bind(getContext()); mTearDownHelper = new TearDownHelper(remote); } @Override protected void tearDown() throws Exception { mTearDownHelper.backToHome(); mTearDownHelper.killWindowsFromBirthToNow(); mTearDownHelper = null; remote.waitForAllDumpCompleted(); remote = null; super.tearDown(); } }
{ "pile_set_name": "Github" }
**** FAQs **** This section provides answers to frequently asked questions about gprMax and its uses. **What applications can gprMax simulate?** gprMax is electromagnetic wave simulation software that is based on the Finite-Difference Time-Domain (FDTD) method. Many of its features have been designed to benefit simulating Ground Penetrating Radar (GPR), however it can be used to simulate many other applications in areas such as engineering, geophysics, archaeology, and medicine. **Why does gprMax not have a GUI?** We considered developing a CAD-based graphical user interface (GUI) but, for now, decided against it. There were two guiding principals behind this design decision: firstly, users most often perform a series of related simulations with varying parameters to solve or optimize a particular problem; and secondly, we decided the limited resources we had were best concentrated on developing advanced modelling features for GPR within software that could easily be interfaced with other tools. Although a CAD-based GUI is useful for creating single simulations it becomes increasingly cumbersome for a series of simulations or where simulations contain heterogeneities, e.g. a model of a soil with stochastically varying electrical properties. **How is gprMax licensed?** gprMax is released under the `GNU General Public License v3 or higher <http://www.gnu.org/copyleft/gpl.html>`_. This means when distributing derived works, the source code of the work must be made available under the same license. **Where does the name gprMax come from?** The name gprMax comes from the joining of the acroymn for Ground Penetrating Radar - **gpr** - and the name of the Scottish scientist who formulated the classical theory of electromagnetic radiation, `James Clerk Maxwell <https://en.wikipedia.org/wiki/James_Clerk_Maxwell>`_ - **Max**. **Do I need to learn Python to use gprMax?** No, but it can be beneficial to know a little Python. We have made it easier to create more complex simulations in gprMax through scripting in the input file. This is achieved by allowing blocks of Python code to be written in the input file which are executed when the file is read by gprMax. **Can I still do all my pre/post-processing for gprMax in MATLAB?** Yes, `MATLAB has built-in functions to read HDF5 files <http://uk.mathworks.com/help/matlab/high-level-functions.html>`_. **Can I convert my output file to a text file, e.g. to import into Microsoft Excel** Yes, we recommend you download `HDFView <https://support.hdfgroup.org/products/java/hdfview/>`_ which is free viewer for HDF files. You can then export any of datasets in the output file to a text (ASCII) file that can be imported into Microsoft Excel. To do so right-click on the dataset in HDFView and choose Export Dataset -> Export Data to Text File. **But converting my input file from the old version of gprMax will be really painful** Hopefully not! We have provided a Python module to help you convert input files from the old version of gprMax to use syntax introduced in version 3. **How do I choose a spatial resolution for my simulation?** Spatial resolution should be chosen to mitigate numerical dispersion and to adequately resolve geometry in your simulation. :ref:`A 2D example of modelling a metal cylinder in a dielectric <example-2D-Ascan>` provides guidance on how to determine spatial resolution. **I specified a certain piece of geometry but I don’t see it when I view my geometry file.** gprMax builds objects in a model in the order the objects were specified in the input file, using a layered canvas approach. This means, for example, a cylinder object which comes after a box object in the input file will overwrite the properties of the box object at any locations where they overlap. This approach allows complex geometries to be created using basic object building blocks. **Can I run gprMax on my HPC/cluster?** Yes. gprMax has been parallelised using OpenMP and features a task farm based on MPI. For more information read the :ref:`parallel performance section of the User Guide <openmp-mpi>`
{ "pile_set_name": "Github" }
/* Sun-$Revision: 30.7 $ */ /* Copyright 1992-2012 AUTHORS. See the LICENSE file for license information. */ // on Sparcs, this is exact almost to the microsecond private: timeval start_time; timeval t;
{ "pile_set_name": "Github" }
// GetThreadTimes.hpp --------------------------------------------------------------// // Copyright 2010 Vicente J. Botet Escriba // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt #ifndef BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP #define BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP #include <boost/detail/winapi/time.hpp> #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif namespace boost { namespace detail { namespace winapi { #if defined( BOOST_USE_WINDOWS_H ) using ::GetThreadTimes; #else extern "C" __declspec(dllimport) BOOL_ WINAPI GetThreadTimes( HANDLE_ hThread, LPFILETIME_ lpCreationTime, LPFILETIME_ lpExitTime, LPFILETIME_ lpKernelTime, LPFILETIME_ lpUserTime ); #endif } } } #endif // BOOST_DETAIL_WINAPI_GETTHREADTIMES_HPP
{ "pile_set_name": "Github" }
package ecs //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 Alibaba Cloud SDK Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. // ShareGroups is a nested struct in ecs response type ShareGroups struct { ShareGroup []ShareGroup `json:"ShareGroup" xml:"ShareGroup"` }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- /** * Copyright (c) 2016, 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. */ --> <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="car_guest" msgid="3738772168718508650">"ଅତିଥି"</string> <string name="start_guest_session" msgid="7055742120180595689">"ଅତିଥି"</string> <string name="car_add_user" msgid="5245196248349230898">"ୟୁଜର୍‍ଙ୍କୁ ଯୋଡ଼ନ୍ତୁ"</string> <string name="car_new_user" msgid="8142927244990323906">"ନୂଆ ୟୁଜର୍‍"</string> <string name="user_add_user_message_setup" msgid="1791011504259527329">"ଯେତେବେଳେ ଆପଣ ଜଣେ ନୂଆ ୟୁଜର୍‍ଙ୍କୁ ଯୋଡ଼ିବେ, ସେହି ବ୍ୟକ୍ତିଙ୍କୁ ନିଜ ପାଇଁ ସ୍ପେସ୍‍ ସେଟ‍ଅପ୍ କରିବାକୁ ପଡ଼ିବ।"</string> <string name="user_add_user_message_update" msgid="3383320289232716179">"ଯେକୌଣସି ୟୁଜର୍ ଅନ୍ୟ ସମସ୍ତ ୟୁଜରଙ୍କ ପାଇଁ ଆପ୍‍କୁ ଅପଡେଟ୍ କରିପାରିବେ।"</string> </resources>
{ "pile_set_name": "Github" }
/* * Copyright 2011-2020 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.data.neo4j.core; import static org.neo4j.cypherdsl.core.Cypher.asterisk; import static org.neo4j.cypherdsl.core.Cypher.parameter; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.function.Function; import java.util.stream.Collectors; import org.apache.commons.logging.LogFactory; import org.apiguardian.api.API; import org.neo4j.cypherdsl.core.Condition; import org.neo4j.cypherdsl.core.Functions; import org.neo4j.cypherdsl.core.Statement; import org.neo4j.cypherdsl.core.renderer.Renderer; import org.neo4j.driver.exceptions.NoSuchRecordException; import org.neo4j.driver.summary.ResultSummary; import org.neo4j.driver.summary.SummaryCounters; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.core.log.LogAccessor; import org.springframework.dao.IncorrectResultSizeDataAccessException; import org.springframework.dao.OptimisticLockingFailureException; import org.springframework.data.mapping.AssociationHandler; import org.springframework.data.mapping.PersistentPropertyAccessor; import org.springframework.data.mapping.callback.EntityCallbacks; import org.springframework.data.neo4j.core.NestedRelationshipProcessingStateMachine.ProcessState; import org.springframework.data.neo4j.core.mapping.Neo4jMappingContext; import org.springframework.data.neo4j.core.mapping.Neo4jPersistentEntity; import org.springframework.data.neo4j.core.mapping.Neo4jPersistentProperty; import org.springframework.data.neo4j.core.schema.Constants; import org.springframework.data.neo4j.core.schema.CypherGenerator; import org.springframework.data.neo4j.core.schema.NodeDescription; import org.springframework.data.neo4j.core.schema.RelationshipDescription; import org.springframework.data.neo4j.repository.NoResultException; import org.springframework.data.neo4j.repository.event.BeforeBindCallback; import org.springframework.data.util.ClassTypeInformation; import org.springframework.lang.Nullable; import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; /** * @author Michael J. Simons * @author Philipp Tölle * @soundtrack Motörhead - We Are Motörhead * @since 6.0 */ @API(status = API.Status.STABLE, since = "6.0") public final class Neo4jTemplate implements Neo4jOperations, BeanFactoryAware { private static final LogAccessor log = new LogAccessor(LogFactory.getLog(Neo4jTemplate.class)); private static final String OPTIMISTIC_LOCKING_ERROR_MESSAGE = "An entity with the required version does not exist."; private static final Renderer renderer = Renderer.getDefaultRenderer(); private final Neo4jClient neo4jClient; private final Neo4jMappingContext neo4jMappingContext; private final CypherGenerator cypherGenerator; private Neo4jEvents eventSupport; private final DatabaseSelectionProvider databaseSelectionProvider; public Neo4jTemplate(Neo4jClient neo4jClient) { this(neo4jClient, new Neo4jMappingContext(), DatabaseSelectionProvider.getDefaultSelectionProvider()); } public Neo4jTemplate(Neo4jClient neo4jClient, Neo4jMappingContext neo4jMappingContext, DatabaseSelectionProvider databaseSelectionProvider) { this(neo4jClient, neo4jMappingContext, databaseSelectionProvider, EntityCallbacks.create()); } public Neo4jTemplate(Neo4jClient neo4jClient, Neo4jMappingContext neo4jMappingContext, DatabaseSelectionProvider databaseSelectionProvider, EntityCallbacks entityCallbacks) { Assert.notNull(neo4jClient, "The Neo4jClient is required"); Assert.notNull(neo4jMappingContext, "The Neo4jMappingContext is required"); Assert.notNull(databaseSelectionProvider, "The database name provider is required"); this.neo4jClient = neo4jClient; this.neo4jMappingContext = neo4jMappingContext; this.cypherGenerator = CypherGenerator.INSTANCE; this.eventSupport = new Neo4jEvents(entityCallbacks); this.databaseSelectionProvider = databaseSelectionProvider; } @Override public long count(Class<?> domainType) { Neo4jPersistentEntity entityMetaData = neo4jMappingContext.getPersistentEntity(domainType); Statement statement = cypherGenerator.prepareMatchOf(entityMetaData).returning(Functions.count(asterisk())).build(); return count(statement); } @Override public long count(Statement statement) { return count(statement, Collections.emptyMap()); } @Override public long count(Statement statement, Map<String, Object> parameters) { return count(renderer.render(statement), parameters); } @Override public long count(String cypherQuery) { return count(cypherQuery, Collections.emptyMap()); } @Override public long count(String cypherQuery, Map<String, Object> parameters) { PreparedQuery<Long> preparedQuery = PreparedQuery.queryFor(Long.class).withCypherQuery(cypherQuery) .withParameters(parameters).build(); return toExecutableQuery(preparedQuery).getRequiredSingleResult(); } @Override public <T> List<T> findAll(Class<T> domainType) { Neo4jPersistentEntity entityMetaData = neo4jMappingContext.getPersistentEntity(domainType); Statement statement = cypherGenerator.prepareMatchOf(entityMetaData) .returning(cypherGenerator.createReturnStatementForMatch(entityMetaData)).build(); return createExecutableQuery(domainType, statement).getResults(); } @Override public <T> List<T> findAll(Statement statement, Class<T> domainType) { return createExecutableQuery(domainType, statement).getResults(); } @Override public <T> List<T> findAll(Statement statement, Map<String, Object> parameters, Class<T> domainType) { return createExecutableQuery(domainType, statement, parameters).getResults(); } @Override public <T> Optional<T> findOne(Statement statement, Map<String, Object> parameters, Class<T> domainType) { return createExecutableQuery(domainType, statement, parameters).getSingleResult(); } @Override public <T> List<T> findAll(String cypherQuery, Class<T> domainType) { return createExecutableQuery(domainType, cypherQuery).getResults(); } @Override public <T> List<T> findAll(String cypherQuery, Map<String, Object> parameters, Class<T> domainType) { return createExecutableQuery(domainType, cypherQuery, parameters).getResults(); } @Override public <T> Optional<T> findOne(String cypherQuery, Map<String, Object> parameters, Class<T> domainType) { return createExecutableQuery(domainType, cypherQuery, parameters).getSingleResult(); } @Override public <T> Optional<T> findById(Object id, Class<T> domainType) { Neo4jPersistentEntity entityMetaData = neo4jMappingContext.getPersistentEntity(domainType); Statement statement = cypherGenerator .prepareMatchOf(entityMetaData, entityMetaData.getIdExpression().isEqualTo(parameter(Constants.NAME_OF_ID))) .returning(cypherGenerator.createReturnStatementForMatch(entityMetaData)).build(); return createExecutableQuery(domainType, statement, Collections .singletonMap(Constants.NAME_OF_ID, convertIdValues(id))) .getSingleResult(); } @Override public <T> List<T> findAllById(Iterable<?> ids, Class<T> domainType) { Neo4jPersistentEntity entityMetaData = neo4jMappingContext.getPersistentEntity(domainType); Statement statement = cypherGenerator .prepareMatchOf(entityMetaData, entityMetaData.getIdExpression().in((parameter(Constants.NAME_OF_IDS)))) .returning(cypherGenerator.createReturnStatementForMatch(entityMetaData)).build(); return createExecutableQuery(domainType, statement, Collections .singletonMap(Constants.NAME_OF_IDS, convertIdValues(ids))) .getResults(); } private Object convertIdValues(Object idValues) { return neo4jMappingContext.getConverter().writeValueFromProperty(idValues, ClassTypeInformation.from(idValues.getClass())); } @Override public <T> T save(T instance) { return saveImpl(instance, getDatabaseName()); } private <T> T saveImpl(T instance, @Nullable String inDatabase) { Neo4jPersistentEntity entityMetaData = neo4jMappingContext.getPersistentEntity(instance.getClass()); T entityToBeSaved = eventSupport.maybeCallBeforeBind(instance); DynamicLabels dynamicLabels = determineDynamicLabels(entityToBeSaved, entityMetaData, inDatabase); Optional<Long> optionalInternalId = neo4jClient .query(() -> renderer.render(cypherGenerator.prepareSaveOf(entityMetaData, dynamicLabels))).in(inDatabase) .bind((T) entityToBeSaved) .with(neo4jMappingContext.getRequiredBinderFunctionFor((Class<T>) entityToBeSaved.getClass())) .fetchAs(Long.class).one(); if (entityMetaData.hasVersionProperty() && !optionalInternalId.isPresent()) { throw new OptimisticLockingFailureException(OPTIMISTIC_LOCKING_ERROR_MESSAGE); } PersistentPropertyAccessor<T> propertyAccessor = entityMetaData.getPropertyAccessor(entityToBeSaved); if (!entityMetaData.isUsingInternalIds()) { processRelations(entityMetaData, entityToBeSaved, inDatabase); return entityToBeSaved; } else { propertyAccessor.setProperty(entityMetaData.getRequiredIdProperty(), optionalInternalId.get()); processRelations(entityMetaData, entityToBeSaved, inDatabase); return propertyAccessor.getBean(); } } private <T> DynamicLabels determineDynamicLabels(T entityToBeSaved, Neo4jPersistentEntity<?> entityMetaData, @Nullable String inDatabase) { return entityMetaData.getDynamicLabelsProperty().map(p -> { PersistentPropertyAccessor propertyAccessor = entityMetaData.getPropertyAccessor(entityToBeSaved); Neo4jClient.RunnableSpecTightToDatabase runnableQuery = neo4jClient .query(() -> renderer.render(cypherGenerator.createStatementReturningDynamicLabels(entityMetaData))) .in(inDatabase).bind(propertyAccessor.getProperty(entityMetaData.getRequiredIdProperty())) .to(Constants.NAME_OF_ID).bind(entityMetaData.getStaticLabels()).to(Constants.NAME_OF_STATIC_LABELS_PARAM); if (entityMetaData.hasVersionProperty()) { runnableQuery = runnableQuery .bind((Long) propertyAccessor.getProperty(entityMetaData.getRequiredVersionProperty()) - 1) .to(Constants.NAME_OF_VERSION_PARAM); } Optional<Map<String, Object>> optionalResult = runnableQuery.fetch().one(); return new DynamicLabels(optionalResult.map(r -> (Collection<String>) r.get(Constants.NAME_OF_LABELS)) .orElseGet(Collections::emptyList), (Collection<String>) propertyAccessor.getProperty(p)); }).orElse(DynamicLabels.EMPTY); } @Override public <T> List<T> saveAll(Iterable<T> instances) { String databaseName = getDatabaseName(); Collection<T> entities; if (instances instanceof Collection) { entities = (Collection<T>) instances; } else { entities = new ArrayList<>(); instances.forEach(entities::add); } if (entities.isEmpty()) { return Collections.emptyList(); } Class<T> domainClass = (Class<T>) CollectionUtils.findCommonElementType(entities); Neo4jPersistentEntity entityMetaData = neo4jMappingContext.getPersistentEntity(domainClass); if (entityMetaData.isUsingInternalIds() || entityMetaData.hasVersionProperty()) { log.debug("Saving entities using single statements."); return entities.stream().map(e -> saveImpl(e, databaseName)).collect(Collectors.toList()); } List<T> entitiesToBeSaved = entities.stream().map(eventSupport::maybeCallBeforeBind).collect(Collectors.toList()); // Save roots Function<T, Map<String, Object>> binderFunction = neo4jMappingContext.getRequiredBinderFunctionFor(domainClass); List<Map<String, Object>> entityList = entitiesToBeSaved.stream().map(binderFunction).collect(Collectors.toList()); ResultSummary resultSummary = neo4jClient .query(() -> renderer.render(cypherGenerator.prepareSaveOfMultipleInstancesOf(entityMetaData))).in(databaseName) .bind(entityList).to(Constants.NAME_OF_ENTITY_LIST_PARAM).run(); // Save related entitiesToBeSaved.forEach(entityToBeSaved -> processRelations(entityMetaData, entityToBeSaved, databaseName)); SummaryCounters counters = resultSummary.counters(); log.debug(() -> String.format( "Created %d and deleted %d nodes, created %d and deleted %d relationships and set %d properties.", counters.nodesCreated(), counters.nodesDeleted(), counters.relationshipsCreated(), counters.relationshipsDeleted(), counters.propertiesSet())); return entitiesToBeSaved; } @Override public <T> void deleteById(Object id, Class<T> domainType) { Neo4jPersistentEntity entityMetaData = neo4jMappingContext.getPersistentEntity(domainType); String nameOfParameter = "id"; Condition condition = entityMetaData.getIdExpression().isEqualTo(parameter(nameOfParameter)); log.debug(() -> String.format("Deleting entity with id %s ", id)); Statement statement = cypherGenerator.prepareDeleteOf(entityMetaData, condition); ResultSummary summary = this.neo4jClient.query(renderer.render(statement)).in(getDatabaseName()).bind(convertIdValues(id)) .to(nameOfParameter).run(); log.debug(() -> String.format("Deleted %d nodes and %d relationships.", summary.counters().nodesDeleted(), summary.counters().relationshipsDeleted())); } @Override public <T> void deleteAllById(Iterable<?> ids, Class<T> domainType) { Neo4jPersistentEntity entityMetaData = neo4jMappingContext.getPersistentEntity(domainType); String nameOfParameter = "ids"; Condition condition = entityMetaData.getIdExpression().in(parameter(nameOfParameter)); log.debug(() -> String.format("Deleting all entities with the following ids: %s ", ids)); Statement statement = cypherGenerator.prepareDeleteOf(entityMetaData, condition); ResultSummary summary = this.neo4jClient.query(renderer.render(statement)).in(getDatabaseName()).bind(convertIdValues(ids)) .to(nameOfParameter).run(); log.debug(() -> String.format("Deleted %d nodes and %d relationships.", summary.counters().nodesDeleted(), summary.counters().relationshipsDeleted())); } @Override public void deleteAll(Class<?> domainType) { Neo4jPersistentEntity entityMetaData = neo4jMappingContext.getPersistentEntity(domainType); log.debug(() -> String.format("Deleting all nodes with primary label %s", entityMetaData.getPrimaryLabel())); Statement statement = cypherGenerator.prepareDeleteOf(entityMetaData); ResultSummary summary = this.neo4jClient.query(renderer.render(statement)).in(getDatabaseName()).run(); log.debug(() -> String.format("Deleted %d nodes and %d relationships.", summary.counters().nodesDeleted(), summary.counters().relationshipsDeleted())); } private <T> ExecutableQuery<T> createExecutableQuery(Class<T> domainType, Statement statement) { return createExecutableQuery(domainType, statement, Collections.emptyMap()); } private <T> ExecutableQuery<T> createExecutableQuery(Class<T> domainType, String cypherStatement) { return createExecutableQuery(domainType, cypherStatement, Collections.emptyMap()); } private <T> ExecutableQuery<T> createExecutableQuery(Class<T> domainType, Statement statement, Map<String, Object> parameters) { return createExecutableQuery(domainType, renderer.render(statement), parameters); } private <T> ExecutableQuery<T> createExecutableQuery(Class<T> domainType, String cypherStatement, Map<String, Object> parameters) { Assert.notNull(neo4jMappingContext.getPersistentEntity(domainType), "Cannot get or create persistent entity."); PreparedQuery<T> preparedQuery = PreparedQuery.queryFor(domainType).withCypherQuery(cypherStatement) .withParameters(parameters).usingMappingFunction(neo4jMappingContext.getRequiredMappingFunctionFor(domainType)) .build(); return toExecutableQuery(preparedQuery); } private void processRelations(Neo4jPersistentEntity<?> neo4jPersistentEntity, Object parentObject, @Nullable String inDatabase) { processNestedRelations(neo4jPersistentEntity, parentObject, inDatabase, new NestedRelationshipProcessingStateMachine()); } private void processNestedRelations(Neo4jPersistentEntity<?> neo4jPersistentEntity, Object parentObject, @Nullable String inDatabase, NestedRelationshipProcessingStateMachine stateMachine) { PersistentPropertyAccessor<?> propertyAccessor = neo4jPersistentEntity.getPropertyAccessor(parentObject); Object fromId = propertyAccessor.getProperty(neo4jPersistentEntity.getRequiredIdProperty()); neo4jPersistentEntity.doWithAssociations((AssociationHandler<Neo4jPersistentProperty>) association -> { // create context to bundle parameters NestedRelationshipContext relationshipContext = NestedRelationshipContext.of(association, propertyAccessor, neo4jPersistentEntity); Collection<?> relatedValuesToStore = MappingSupport.unifyRelationshipValue(relationshipContext.getInverse(), relationshipContext.getValue()); RelationshipDescription relationshipDescription = relationshipContext.getRelationship(); RelationshipDescription relationshipDescriptionObverse = relationshipDescription.getRelationshipObverse(); // break recursive procession and deletion of previously created relationships ProcessState processState = stateMachine.getStateOf(relationshipDescriptionObverse, relatedValuesToStore); if (processState == ProcessState.PROCESSED_BOTH) { return; } // remove all relationships before creating all new if the entity is not new // this avoids the usage of cache but might have significant impact on overall performance if (!neo4jPersistentEntity.isNew(parentObject)) { Neo4jPersistentEntity<?> previouslyRelatedPersistentEntity = neo4jMappingContext .getPersistentEntity(relationshipContext.getAssociationTargetType()); Statement relationshipRemoveQuery = cypherGenerator.createRelationshipRemoveQuery(neo4jPersistentEntity, relationshipDescription, previouslyRelatedPersistentEntity); neo4jClient.query(renderer.render(relationshipRemoveQuery)).in(inDatabase).bind(convertIdValues(fromId)) .to(Constants.FROM_ID_PARAMETER_NAME).run(); } // nothing to do because there is nothing to map if (relationshipContext.inverseValueIsEmpty()) { return; } stateMachine.markAsProcessed(relationshipDescription, relatedValuesToStore); for (Object relatedValueToStore : relatedValuesToStore) { // here map entry is not always anymore a dynamic association Object relatedNode = relationshipContext.identifyAndExtractRelationshipTargetNode(relatedValueToStore); relatedNode = eventSupport.maybeCallBeforeBind(relatedNode); Neo4jPersistentEntity<?> targetNodeDescription = neo4jMappingContext .getPersistentEntity(relatedNode.getClass()); Long relatedInternalId = saveRelatedNode(relatedNode, relationshipContext.getAssociationTargetType(), targetNodeDescription, inDatabase); RelationshipStatementHolder statementHolder = RelationshipStatementHolder.createStatement(neo4jMappingContext, neo4jPersistentEntity, relationshipContext, relatedInternalId, relatedValueToStore); neo4jClient.query(renderer.render(statementHolder.getRelationshipCreationQuery())).in(inDatabase) .bind(convertIdValues(fromId)).to(Constants.FROM_ID_PARAMETER_NAME).bindAll(statementHolder.getProperties()) .run(); // if an internal id is used this must get set to link this entity in the next iteration if (targetNodeDescription.isUsingInternalIds()) { PersistentPropertyAccessor<?> targetPropertyAccessor = targetNodeDescription .getPropertyAccessor(relatedNode); targetPropertyAccessor.setProperty(targetNodeDescription.getRequiredIdProperty(), relatedInternalId); } if (processState != ProcessState.PROCESSED_ALL_VALUES) { processNestedRelations(targetNodeDescription, relatedNode, inDatabase, stateMachine); } } }); } private <Y> Long saveRelatedNode(Object entity, Class<Y> entityType, NodeDescription targetNodeDescription, @Nullable String inDatabase) { DynamicLabels dynamicLabels = determineDynamicLabels(entity, (Neo4jPersistentEntity) targetNodeDescription, inDatabase); Optional<Long> optionalSavedNodeId = neo4jClient .query(() -> renderer.render(cypherGenerator.prepareSaveOf(targetNodeDescription, dynamicLabels))) .in(inDatabase).bind((Y) entity).with(neo4jMappingContext.getRequiredBinderFunctionFor(entityType)) .fetchAs(Long.class).one(); if (((Neo4jPersistentEntity) targetNodeDescription).hasVersionProperty() && !optionalSavedNodeId.isPresent()) { throw new OptimisticLockingFailureException(OPTIMISTIC_LOCKING_ERROR_MESSAGE); } return optionalSavedNodeId.get(); } private String getDatabaseName() { return this.databaseSelectionProvider.getDatabaseSelection().getValue(); } @Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { this.eventSupport = new Neo4jEvents(EntityCallbacks.create(beanFactory)); } @Override public <T> ExecutableQuery<T> toExecutableQuery(PreparedQuery<T> preparedQuery) { Neo4jClient.MappingSpec<T> mappingSpec = this.neo4jClient.query(preparedQuery.getCypherQuery()) .in(getDatabaseName()).bindAll(preparedQuery.getParameters()).fetchAs(preparedQuery.getResultType()); Neo4jClient.RecordFetchSpec<T> fetchSpec = preparedQuery.getOptionalMappingFunction() .map(f -> mappingSpec.mappedBy(f)).orElse(mappingSpec); return new DefaultExecutableQuery<>(preparedQuery, fetchSpec); } final class DefaultExecutableQuery<T> implements ExecutableQuery<T> { private final PreparedQuery<T> preparedQuery; private final Neo4jClient.RecordFetchSpec<T> fetchSpec; DefaultExecutableQuery(PreparedQuery<T> preparedQuery, Neo4jClient.RecordFetchSpec<T> fetchSpec) { this.preparedQuery = preparedQuery; this.fetchSpec = fetchSpec; } public List<T> getResults() { return fetchSpec.all().stream().collect(Collectors.toList()); } public Optional<T> getSingleResult() { try { return fetchSpec.one(); } catch (NoSuchRecordException e) { // This exception is thrown by the driver in both cases when there are 0 or 1+n records // So there has been an incorrect result size, but not to few results but to many. throw new IncorrectResultSizeDataAccessException(1); } } public T getRequiredSingleResult() { return fetchSpec.one().orElseThrow(() -> new NoResultException(1, preparedQuery.getCypherQuery())); } } /** * Utility class that orchestrates {@link EntityCallbacks}. All the methods provided here check for their availability * and do nothing when an event cannot be published. */ final class Neo4jEvents { private final EntityCallbacks entityCallbacks; Neo4jEvents(EntityCallbacks entityCallbacks) { this.entityCallbacks = entityCallbacks; } public <T> T maybeCallBeforeBind(T object) { return entityCallbacks.callback(BeforeBindCallback.class, object); } } }
{ "pile_set_name": "Github" }
# Copyright 2017 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/config/ui.gni") import("//extensions/buildflags/buildflags.gni") assert(enable_extensions) source_set("views") { sources = [ "app_window_frame_view.cc", "app_window_frame_view.h", ] deps = [ "//cc/paint", "//chrome/app/theme:theme_resources", "//extensions/browser", "//extensions/common", "//skia", "//ui/gfx", "//ui/strings", "//ui/views", ] }
{ "pile_set_name": "Github" }
// Go support for Protocol Buffers - Google's data interchange format // // Copyright 2016 The Go Authors. All rights reserved. // https://github.com/golang/protobuf // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package ptypes // This file implements operations on google.protobuf.Timestamp. import ( "errors" "fmt" "time" tspb "github.com/golang/protobuf/ptypes/timestamp" ) const ( // Seconds field of the earliest valid Timestamp. // This is time.Date(1, 1, 1, 0, 0, 0, 0, time.UTC).Unix(). minValidSeconds = -62135596800 // Seconds field just after the latest valid Timestamp. // This is time.Date(10000, 1, 1, 0, 0, 0, 0, time.UTC).Unix(). maxValidSeconds = 253402300800 ) // validateTimestamp determines whether a Timestamp is valid. // A valid timestamp represents a time in the range // [0001-01-01, 10000-01-01) and has a Nanos field // in the range [0, 1e9). // // If the Timestamp is valid, validateTimestamp returns nil. // Otherwise, it returns an error that describes // the problem. // // Every valid Timestamp can be represented by a time.Time, but the converse is not true. func validateTimestamp(ts *tspb.Timestamp) error { if ts == nil { return errors.New("timestamp: nil Timestamp") } if ts.Seconds < minValidSeconds { return fmt.Errorf("timestamp: %v before 0001-01-01", ts) } if ts.Seconds >= maxValidSeconds { return fmt.Errorf("timestamp: %v after 10000-01-01", ts) } if ts.Nanos < 0 || ts.Nanos >= 1e9 { return fmt.Errorf("timestamp: %v: nanos not in range [0, 1e9)", ts) } return nil } // Timestamp converts a google.protobuf.Timestamp proto to a time.Time. // It returns an error if the argument is invalid. // // Unlike most Go functions, if Timestamp returns an error, the first return value // is not the zero time.Time. Instead, it is the value obtained from the // time.Unix function when passed the contents of the Timestamp, in the UTC // locale. This may or may not be a meaningful time; many invalid Timestamps // do map to valid time.Times. // // A nil Timestamp returns an error. The first return value in that case is // undefined. func Timestamp(ts *tspb.Timestamp) (time.Time, error) { // Don't return the zero value on error, because corresponds to a valid // timestamp. Instead return whatever time.Unix gives us. var t time.Time if ts == nil { t = time.Unix(0, 0).UTC() // treat nil like the empty Timestamp } else { t = time.Unix(ts.Seconds, int64(ts.Nanos)).UTC() } return t, validateTimestamp(ts) } // TimestampProto converts the time.Time to a google.protobuf.Timestamp proto. // It returns an error if the resulting Timestamp is invalid. func TimestampProto(t time.Time) (*tspb.Timestamp, error) { seconds := t.Unix() nanos := int32(t.Sub(time.Unix(seconds, 0))) ts := &tspb.Timestamp{ Seconds: seconds, Nanos: nanos, } if err := validateTimestamp(ts); err != nil { return nil, err } return ts, nil } // TimestampString returns the RFC 3339 string for valid Timestamps. For invalid // Timestamps, it returns an error message in parentheses. func TimestampString(ts *tspb.Timestamp) string { t, err := Timestamp(ts) if err != nil { return fmt.Sprintf("(%v)", err) } return t.Format(time.RFC3339Nano) }
{ "pile_set_name": "Github" }
package server import ( "fmt" "net/http" "github.com/fnproject/fn/api/models" "github.com/gin-gonic/gin" ) func (s *Server) handleFnList(c *gin.Context) { ctx := c.Request.Context() var filter models.FnFilter filter.Cursor, filter.PerPage = pageParams(c) filter.AppID = c.Query("app_id") filter.Name = c.Query("name") fns, err := s.datastore.GetFns(ctx, &filter) if err != nil { handleErrorResponse(c, err) return } // Annotate the outbound fns // this is fairly cludgy bit hard to do in datastore middleware confidently appCache := make(map[string]*models.App) for idx, f := range fns.Items { app, ok := appCache[f.AppID] if !ok { gotApp, err := s.Datastore().GetAppByID(ctx, f.AppID) if err != nil { handleErrorResponse(c, fmt.Errorf("failed to get app for fn %s", err)) return } app = gotApp appCache[app.ID] = gotApp } newF, err := s.fnAnnotator.AnnotateFn(c, app, f) if err != nil { handleErrorResponse(c, err) return } fns.Items[idx] = newF } c.JSON(http.StatusOK, fns) }
{ "pile_set_name": "Github" }
Add-CakeResque-Config.patch
{ "pile_set_name": "Github" }
-- Created on: 1994-01-17 -- Created by: Modelistation -- Copyright (c) 1994-1999 Matra Datavision -- Copyright (c) 1999-2014 OPEN CASCADE SAS -- -- This file is part of Open CASCADE Technology software library. -- -- This library is free software; you can redistribute it and/or modify it under -- the terms of the GNU Lesser General Public License version 2.1 as published -- by the Free Software Foundation, with special exception defined in the file -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -- distribution for complete text of the license and disclaimer of any warranty. -- -- Alternatively, this file may be used under the terms of Open CASCADE -- commercial license or contractual agreement. class PlaneAspect from Prs3d inherits BasicAspect from Prs3d ---Purpose: A framework to define the display of planes. uses LineAspect from Prs3d, Length from Quantity, PlaneAngle from Quantity is Create returns PlaneAspect from Prs3d; ---Purpose: Constructs an empty framework for the display of planes. EdgesAspect(me) returns LineAspect from Prs3d; ---Purpose: Returns the attributes of displayed edges involved in the presentation of planes. IsoAspect(me) returns LineAspect from Prs3d; ---Purpose: Returns the attributes of displayed isoparameters involved in the presentation of planes. ArrowAspect(me) returns LineAspect from Prs3d; ---Purpose: Returns the settings for displaying an arrow. SetArrowsLength(me:mutable; L : Length from Quantity); ArrowsLength(me) returns Length from Quantity; --- Purpose: Returns the length of the arrow shaft used in the display of arrows. SetArrowsSize(me:mutable; L : Length from Quantity); ---Purpose: Sets the angle of the arrowhead used in the display of planes. ArrowsSize(me) returns Length from Quantity; ---Purpose: Returns the size of arrows used in the display of planes. SetArrowsAngle(me:mutable; ang : PlaneAngle from Quantity); ---Purpose: Sets the angle of the arrowhead used in the display -- of arrows involved in the presentation of planes. ArrowsAngle(me) returns PlaneAngle from Quantity; ---Purpose: Returns the angle of the arrowhead used in the -- display of arrows involved in the presentation of planes. SetDisplayCenterArrow(me:mutable ; draw: Boolean from Standard); ---Purpose: Sets the display attributes defined in DisplayCenterArrow to active. DisplayCenterArrow(me) returns Boolean from Standard; ---Purpose: Returns true if the display of center arrows is allowed. SetDisplayEdgesArrows(me:mutable ; draw: Boolean from Standard); ---Purpose: Sets the display attributes defined in DisplayEdgesArrows to active. DisplayEdgesArrows(me) returns Boolean from Standard; --- Purpose: Returns true if the display of edge arrows is allowed. SetDisplayEdges(me:mutable ; draw: Boolean from Standard); DisplayEdges(me) returns Boolean from Standard; SetDisplayIso(me:mutable ; draw: Boolean from Standard); ---Purpose: Sets the display attributes defined in DisplayIso to active. DisplayIso(me) returns Boolean from Standard; --- Purpose: Returns true if the display of isoparameters is allowed. SetPlaneLength(me:mutable; LX,LY: Length from Quantity); PlaneXLength(me) returns Length from Quantity; --- Purpose: Returns the length of the x axis used in the display of planes. PlaneYLength(me) returns Length from Quantity; ---Purpose: Returns the length of the y axis used in the display of planes. SetIsoDistance(me:mutable; L: Length from Quantity); ---Purpose: Sets the distance L between isoparameters used in the display of planes. IsoDistance(me) returns Length from Quantity; ---Purpose: Returns the distance between isoparameters used in the display of planes. fields myEdgesAspect: LineAspect from Prs3d; myIsoAspect: LineAspect from Prs3d; myArrowAspect: LineAspect from Prs3d; myArrowsLength: Length from Quantity; myArrowsSize: Length from Quantity; myArrowsAngle: PlaneAngle from Quantity; myDrawCenterArrow: Boolean from Standard; myDrawEdgesArrows: Boolean from Standard; myDrawEdges: Boolean from Standard; myDrawIso: Boolean from Standard; myPlaneXLength : Length from Quantity; myPlaneYLength : Length from Quantity; myIsoDistance: Length from Quantity; end PlaneAspect from Prs3d;
{ "pile_set_name": "Github" }
/* global describe, it, assert L */ import { getTileUrls } from '../src/TileManager'; describe('TileManager', () => { it('calculates openstreetmap tiles at level 16', () => { const layer = L.tileLayer.offline('http://a.tile.openstreetmap.org/{z}/{x}/{y}.png'); const bounds = new L.Bounds( new L.Point(8621975, 5543267.999999999), new L.Point(8621275, 5542538), ); const tiles = getTileUrls(layer, bounds, 16); assert.lengthOf(tiles, 16); const urls = tiles.map((t) => t.url); assert.include(urls, 'http://a.tile.openstreetmap.org/16/33677/21651.png'); const keys = tiles.map((t) => t.key); assert.include(keys, 'http://a.tile.openstreetmap.org/16/33677/21651.png'); }); it('calculates mobox tiles at level 16', () => { const layer = L.tileLayer.offline('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', { id: 'mapbox.streets', accessToken: 'xyz', }); const bounds = new L.Bounds( new L.Point(8621975, 5543267.999999999), new L.Point(8621275, 5542538), ); const tiles = getTileUrls(layer, bounds, 16); assert.lengthOf(tiles, 16); const urls = tiles.map((t) => t.url); assert.include(urls, 'https://api.tiles.mapbox.com/v4/mapbox.streets/16/33677/21651.png?access_token=xyz'); const keys = tiles.map((t) => t.key); assert.include(keys, 'https://api.tiles.mapbox.com/v4/mapbox.streets/16/33677/21651.png?access_token=xyz'); }); });
{ "pile_set_name": "Github" }
// // System.Windows.Rect structure // // Contact: // Moonlight List (moonlight-list@lists.ximian.com) // // Copyright (C) 2007 Novell, Inc (http://www.novell.com) // // 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. // using Mono; using System; using System.Runtime.InteropServices; namespace System.Windows { public struct Rect : IFormattable { private double x, y, w, h; public Rect (double x, double y, double width, double height) : this () { this.x = x; this.y = y; Width = width; Height = height; } public Rect(Point point1, Point point2) { this.x = Math.Min (point1.X, point2.X); this.y = Math.Min (point1.Y, point2.Y); this.w = Math.Abs (point2.X - point1.X); this.h = Math.Abs (point2.Y - point1.Y); } public Rect (Point location, Size size) { this.x = location.X; this.y = location.Y; this.w = size.Width; this.h = size.Height; } public override string ToString () { if (IsEmpty) return "Empty"; return String.Format ("{0},{1},{2},{3}", x, y, w, h); } public string ToString (IFormatProvider provider) { return (this as IFormattable).ToString (null, provider); } public double X { get { return x; } set { x = value; } } public double Y { get { return y; } set { y = value; } } public double Width { get { return w; } set { if (value < 0) throw new ArgumentException (); w = value; } } public double Height { get { return h; } set { if (value < 0) throw new ArgumentException (); h = value; } } public bool Contains (Point point) { double px = point.X; if (px < x) return false; if (px > x+w) return false; double py = point.Y; if (py < y) return false; if (py > y + h) return false; return true; } public static Rect Empty { get { Rect empty = new Rect (Double.PositiveInfinity, Double.PositiveInfinity, 0, 0); empty.w = empty.h = Double.NegativeInfinity; return empty; } } public bool IsEmpty { get { return (w < 0 && h < 0); } } public double Left { get { return x; } } public double Top { get { return y; } } public double Right { get { return IsEmpty ? Double.NegativeInfinity : x + w; } } public double Bottom { get { return IsEmpty ? Double.NegativeInfinity : y + h; } } public void Intersect(Rect rect) { if (IsEmpty || rect.IsEmpty) { this = Rect.Empty; return; } double new_x = Math.Max (x, rect.x); double new_y = Math.Max (y, rect.y); double new_w = Math.Min (Right, rect.Right) - new_x; double new_h = Math.Min (Bottom, rect.Bottom) - new_y; x = new_x; y = new_y; w = new_w; h = new_h; if (w < 0 || h < 0) this = Rect.Empty; } public void Union(Rect rect) { if (IsEmpty) { this.x = rect.x; this.y = rect.y; this.h = rect.h; this.w = rect.w; return; } else if (!rect.IsEmpty) { double new_x = Math.Min (Left, rect.Left); double new_y = Math.Min (Top, rect.Top); double new_w = Math.Max (Right, rect.Right) - new_x; double new_h = Math.Max (Bottom, rect.Bottom) - new_y; x = new_x; y = new_y; w = new_w; h = new_h; } } public void Union(Point point) { Union (new Rect (point, point)); } public static bool operator ==(Rect rect1, Rect rect2) { return rect1.x == rect2.x && rect1.y == rect2.y && rect1.w == rect2.w && rect1.h == rect2.h; } public static bool operator !=(Rect rect1, Rect rect2) { return !(rect1 == rect2); } public override bool Equals(object o) { if (o is Rect) { return this == (Rect) o; } else { return false; } } public bool Equals(Rect value) { return this == value; } public override int GetHashCode () { return x.GetHashCode () ^ y.GetHashCode () ^ w.GetHashCode () ^ h.GetHashCode (); } internal static Rect FromString (string str) { if (String.IsNullOrEmpty (str)) throw new ArgumentNullException ("str"); IntPtr ptr = NativeMethods.rect_from_str (str); if (ptr == IntPtr.Zero) return new Rect (); Rect r = (Rect) Marshal.PtrToStructure (ptr, typeof (Rect)); return r; } string System.IFormattable.ToString (string format, IFormatProvider provider) { if (String.IsNullOrEmpty (format)) format = null; if (provider != null) { ICustomFormatter cp = (ICustomFormatter) provider.GetFormat (typeof (ICustomFormatter)); if (cp != null) { return String.Format ("{0}{1}{2}{3}{4}{5}{6}", cp.Format (format, x, provider), cp.Format (null, ',', provider), cp.Format (format, y, provider), cp.Format (null, ',', provider), cp.Format (format, w, provider), cp.Format (null, ',', provider), cp.Format (format, h, provider)); } } return String.Format ("{0},{1},{2},{3}", x.ToString (format, provider), y.ToString (format, provider), w.ToString (format, provider), h.ToString (format, provider)); } } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Debug|x64"> <Configuration>Debug</Configuration> <Platform>x64</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|Win32"> <Configuration>Release</Configuration> <Platform>Win32</Platform> </ProjectConfiguration> <ProjectConfiguration Include="Release|x64"> <Configuration>Release</Configuration> <Platform>x64</Platform> </ProjectConfiguration> </ItemGroup> <ItemGroup> <ClCompile Include="..\..\programs\pkey\dh_server.c" /> </ItemGroup> <ItemGroup> <ProjectReference Include="mbedTLS.vcxproj"> <Project>{46cf2d25-6a36-4189-b59c-e4815388e554}</Project> <LinkLibraryDependencies>true</LinkLibraryDependencies> </ProjectReference> </ItemGroup> <PropertyGroup Label="Globals"> <ProjectGuid>{8D91B804-E2CE-142D-8E06-FBB037ED1F65}</ProjectGuid> <Keyword>Win32Proj</Keyword> <RootNamespace>dh_server</RootNamespace> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> <PlatformToolset>Windows7.1SDK</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <PropertyGroup Label="UserMacros" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <LinkIncremental>true</LinkIncremental> <IntDir>$(Configuration)\$(TargetName)\</IntDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <LinkIncremental>true</LinkIncremental> <IntDir>$(Configuration)\$(TargetName)\</IntDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <LinkIncremental>false</LinkIncremental> <IntDir>$(Configuration)\$(TargetName)\</IntDir> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <LinkIncremental>false</LinkIncremental> <IntDir>$(Configuration)\$(TargetName)\</IntDir> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <PrecompiledHeader> </PrecompiledHeader> <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <ShowProgress>NotSet</ShowProgress> <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalLibraryDirectories>Debug</AdditionalLibraryDirectories> </Link> <ProjectReference> <LinkLibraryDependencies>false</LinkLibraryDependencies> </ProjectReference> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ClCompile> <PrecompiledHeader> </PrecompiledHeader> <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <ShowProgress>NotSet</ShowProgress> <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalLibraryDirectories>Debug</AdditionalLibraryDirectories> </Link> <ProjectReference> <LinkLibraryDependencies>false</LinkLibraryDependencies> </ProjectReference> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <PrecompiledHeader> </PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> <AdditionalLibraryDirectories>Release</AdditionalLibraryDirectories> <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> </Link> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> <WarningLevel>Level3</WarningLevel> <PrecompiledHeader> </PrecompiledHeader> <Optimization>MaxSpeed</Optimization> <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <AdditionalIncludeDirectories>../../include</AdditionalIncludeDirectories> </ClCompile> <Link> <SubSystem>Console</SubSystem> <GenerateDebugInformation>true</GenerateDebugInformation> <EnableCOMDATFolding>true</EnableCOMDATFolding> <OptimizeReferences>true</OptimizeReferences> <AdditionalLibraryDirectories>Release</AdditionalLibraryDirectories> <AdditionalDependencies>%(AdditionalDependencies);</AdditionalDependencies> </Link> </ItemDefinitionGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> </Project>
{ "pile_set_name": "Github" }
# Locally calculated sha256 288b14ccbaefb5e3234065c2778c247797ccb3c7afbb6746bb37dc12c620d360 ibrdtn-1.0.1.tar.gz
{ "pile_set_name": "Github" }
/**************************************************************************\ * Copyright (c) Kongsberg Oil & Gas Technologies AS * 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. \**************************************************************************/ #include "io/SoWriterefCounter.h" #include <assert.h> #include <Inventor/C/tidbits.h> #include <Inventor/SoOutput.h> #include <Inventor/errors/SoDebugError.h> #include <Inventor/misc/SoBase.h> #include <Inventor/nodes/SoNode.h> #include "tidbitsp.h" #include "threads/threadsutilp.h" #include "misc/SbHash.h" // ************************************************************************* class SoWriterefCounterBaseData { public: SoWriterefCounterBaseData() { writeref = 0; ingraph = FALSE; } int32_t writeref; SbBool ingraph; }; // ************************************************************************* typedef SbHash<const SoBase *, SoWriterefCounterBaseData *> SoBase2SoWriterefCounterBaseDataMap; class SoWriterefCounterOutputData { public: SoBase2SoWriterefCounterBaseDataMap writerefdict; SoWriterefCounterOutputData() : writerefdict(1051), refcount(0) { } // need refcounter since dict can be shared among several SoOutputs void ref(void) { this->refcount++; } void unref(void) { if (--this->refcount == 0) { this->cleanup(); delete this; } } void debugCleanup(void) { #if COIN_DEBUG for( SoBase2SoWriterefCounterBaseDataMap::const_iterator iter = writerefdict.const_begin(); iter!=writerefdict.const_end(); ++iter ) { const SoBase * base = iter->key; SbName name = base->getName(); if (name == "") name = "<noname>"; SoDebugError::postWarning("SoWriterefCounter::<cleanup>", "Not removed from writerefdict: %p, %s:%s", base, base->getTypeId().getName().getString(), name.getString()); } #endif // COIN_DEBUG this->cleanup(); } protected: ~SoWriterefCounterOutputData() { } private: int refcount; void cleanup(void) { for( SoBase2SoWriterefCounterBaseDataMap::const_iterator iter = writerefdict.const_begin(); iter!=writerefdict.const_end(); ++iter ) { delete iter->obj; } this->writerefdict.clear(); } }; // ************************************************************************* typedef SbHash<SoOutput *, SoWriterefCounter *> SoOutput2SoWriterefCounterMap; typedef SbHash<const SoBase *, int> SoBase2Id; class SoWriterefCounterP { public: SoWriterefCounterP(SoWriterefCounter * master, SoOutput * out, SoWriterefCounterP * dataCopy) : master(master), out(out) { if (dataCopy) { this->outputdata = dataCopy->outputdata; this->sobase2id = new SoBase2Id(*dataCopy->sobase2id); } else { this->outputdata = new SoWriterefCounterOutputData; this->sobase2id = new SoBase2Id; } this->outputdata->ref(); this->nextreferenceid = 0; } ~SoWriterefCounterP() { this->outputdata->unref(); delete this->sobase2id; } void appendPostfix(const SoBase *base, SbString &name, int refid) { // Fix to avoid writing DEFs starting with an illegal // character (e.g. '+') if (name.getLength() == 0 && base->isOfType(SoNode::getClassTypeId()) && !SbName::isBaseNameStartChar((*refwriteprefix)[0])) { name += "_"; } name += SoWriterefCounterP::refwriteprefix->getString(); name.addIntString(refid); } SoWriterefCounter * master; SoOutput * out; SoWriterefCounterOutputData * outputdata; SoBase2Id * sobase2id; int nextreferenceid; static void * mutex; static SoOutput2SoWriterefCounterMap * outputdict; static SoWriterefCounter * current; // used to be backwards compatible static SbString * refwriteprefix; static void atexit_cleanup(void) { current = NULL; delete refwriteprefix; refwriteprefix = NULL; delete outputdict; outputdict = NULL; CC_MUTEX_DESTRUCT(mutex); } }; void * SoWriterefCounterP::mutex; SoOutput2SoWriterefCounterMap * SoWriterefCounterP::outputdict; SoWriterefCounter * SoWriterefCounterP::current = NULL; // used to be backwards compatible SbString * SoWriterefCounterP::refwriteprefix; #define PRIVATE(obj) obj->pimpl // ************************************************************************* SoWriterefCounter::SoWriterefCounter(SoOutput * out, SoOutput * copyfrom) { SoWriterefCounterP * datafrom = NULL; if (copyfrom) { SoWriterefCounter * frominst = SoWriterefCounter::instance(copyfrom); datafrom = frominst->pimpl; } PRIVATE(this) = new SoWriterefCounterP(this, out, datafrom); } SoWriterefCounter::~SoWriterefCounter() { delete PRIVATE(this); } void SoWriterefCounter::create(SoOutput * out, SoOutput * copyfrom) { SoWriterefCounter * inst = new SoWriterefCounter(out, copyfrom); CC_MUTEX_LOCK(SoWriterefCounterP::mutex); SbBool ret = SoWriterefCounterP::outputdict->put(out, inst); assert(ret && "writeref instance already exists!"); CC_MUTEX_UNLOCK(SoWriterefCounterP::mutex); } void SoWriterefCounter::destruct(SoOutput * out) { SoWriterefCounter * inst = SoWriterefCounter::instance(out); assert(inst && "instance not found!"); CC_MUTEX_LOCK(SoWriterefCounterP::mutex); (void) SoWriterefCounterP::outputdict->erase(out); delete inst; CC_MUTEX_UNLOCK(SoWriterefCounterP::mutex); } void SoWriterefCounter::initClass(void) { CC_MUTEX_CONSTRUCT(SoWriterefCounterP::mutex); SoWriterefCounterP::outputdict = new SoOutput2SoWriterefCounterMap; SoWriterefCounterP::refwriteprefix = new SbString("+"); coin_atexit((coin_atexit_f*) SoWriterefCounterP::atexit_cleanup, CC_ATEXIT_NORMAL); } void SoWriterefCounter::debugCleanup(void) { PRIVATE(this)->sobase2id->clear(); PRIVATE(this)->outputdata->debugCleanup(); } void SoWriterefCounter::setInstancePrefix(const SbString & s) { (*SoWriterefCounterP::refwriteprefix) = s; } SoWriterefCounter * SoWriterefCounter::instance(SoOutput * out) { if (out == NULL) { // to be backwards compatible with old code return SoWriterefCounterP::current; } CC_MUTEX_LOCK(SoWriterefCounterP::mutex); SoWriterefCounter * inst = NULL; const SbBool ok = SoWriterefCounterP::outputdict->get(out, inst); assert(ok && "no instance"); SoWriterefCounterP::current = inst; CC_MUTEX_UNLOCK(SoWriterefCounterP::mutex); return inst; } SbBool SoWriterefCounter::shouldWrite(const SoBase * base) const { SoWriterefCounterBaseData * data; if (PRIVATE(this)->outputdata->writerefdict.get(base, data)) { return data->ingraph; } return FALSE; } SbBool SoWriterefCounter::hasMultipleWriteRefs(const SoBase * base) const { SoWriterefCounterBaseData * data; if (PRIVATE(this)->outputdata->writerefdict.get(base, data)) { return data->writeref > 1; } return FALSE; } int SoWriterefCounter::getWriteref(const SoBase * base) const { SoWriterefCounterBaseData * data; if (PRIVATE(this)->outputdata->writerefdict.get(base, data)) { return data->writeref; } return 0; } void SoWriterefCounter::setWriteref(const SoBase * base, const int ref) { // for debugging // SbName name = base->getName(); // fprintf(stderr,"writeref: %s, %d, ingraph: %d\n", name.getString(), ref, // isInGraph(base)); // } SoWriterefCounterBaseData * data; if (PRIVATE(this)->outputdata->writerefdict.get(base, data)) { data->writeref = ref; } else { data = new SoWriterefCounterBaseData; data->writeref = ref; (void) PRIVATE(this)->outputdata->writerefdict.put(base, data); } if (ref == 0) { SoOutput * out = PRIVATE(this)->out; // for better debugging this->removeWriteref(base); // Ouch. Does this to avoid having two subsequent write actions on // the same SoOutput to write "USE ..." when it should write a // full node/subgraph specification on the second run. -mortene. // // FIXME: accessing out->removeSoBase2IdRef() directly takes a // "friend SoBase" in the SoOutput class definition. Should fix // with proper design for next major Coin release. 20020426 mortene. if (out->findReference(base) != FIRSTWRITE) { out->removeSoBase2IdRef(base); } } if (ref < 0) { SbName name = base->getName(); if (name == "") name = "<noname>"; SoDebugError::postWarning("SoWriterefCounter::setWriteref", "writeref < 0 for %s <%p>", name.getString(), base); } } void SoWriterefCounter::decrementWriteref(const SoBase * base) { this->setWriteref(base, this->getWriteref(base) - 1); } SbBool SoWriterefCounter::isInGraph(const SoBase * base) const { SoWriterefCounterBaseData * data; if (PRIVATE(this)->outputdata->writerefdict.get(base, data)) { return data->ingraph; } return FALSE; } void SoWriterefCounter::setInGraph(const SoBase * base, const SbBool ingraph) { SoWriterefCounterBaseData * data; if (PRIVATE(this)->outputdata->writerefdict.get(base, data)) { data->ingraph = ingraph; } else { data = new SoWriterefCounterBaseData; data->ingraph = ingraph; (void)PRIVATE(this)->outputdata->writerefdict.put(base, data); } } void SoWriterefCounter::removeWriteref(const SoBase * base) { SoWriterefCounterBaseData * data; if (PRIVATE(this)->outputdata->writerefdict.get(base, data)) { delete data; (void) PRIVATE(this)->outputdata->writerefdict.erase(base); } else { assert(0 && "writedata not found"); } } // // If this environment variable is set to 1, we try to preserve // the original node names as far as possible instead of appending // a "+<refid>" suffix. // static SbBool dont_mangle_output_names(const SoBase *base) { static int COIN_DONT_MANGLE_OUTPUT_NAMES = -1; // Always unmangle node names in VRML1 and VRML2 if (base->isOfType(SoNode::getClassTypeId()) && (((SoNode *)base)->getNodeType()==SoNode::VRML1 || ((SoNode *)base)->getNodeType()==SoNode::VRML2)) return TRUE; if (COIN_DONT_MANGLE_OUTPUT_NAMES < 0) { COIN_DONT_MANGLE_OUTPUT_NAMES = 0; const char * env = coin_getenv("COIN_DONT_MANGLE_OUTPUT_NAMES"); if (env) COIN_DONT_MANGLE_OUTPUT_NAMES = atoi(env); } return COIN_DONT_MANGLE_OUTPUT_NAMES ? TRUE : FALSE; } SbName SoWriterefCounter::getWriteName(const SoBase * base) const { SoOutput * out = PRIVATE(this)->out; SbName name = base->getName(); int refid = out->findReference(base); SbBool firstwrite = (refid == (int) FIRSTWRITE); SbBool multiref = this->hasMultipleWriteRefs(base); // Find what node name to write SbString writename; if (!firstwrite) { writename = name.getString(); // We have used a suffix when DEF'ing the node if (refid != (int) NOSUFFIX) { PRIVATE(this)->appendPostfix(base, writename, refid); } // Detects last USE of a node, enables reuse of DEF's // if dont_mangle_output_names(base) is true; // Try to keep the original node names as far as possible. // Weaknesses (FIXME kintel 20020429): // o We should try to reuse refid's as well. // o We should try to let "important" (=toplevel?) nodes // keep their original node names before some subnode "captures" it. // if (!multiref && dont_mangle_output_names(base)) out->removeDEFNode(SbName(writename)); } else { SbBool found = out->lookupDEFNode(name); writename = name.getString(); if (!found && (!multiref || name.getLength() > 0)) { // We can use the node without a suffix if (multiref) out->addDEFNode(name); out->setReference(base, (int) NOSUFFIX); } if ((found && name.getLength()>0) || (multiref && name.getLength()==0)) { // Node name is already DEF'ed or an unnamed multiref => use a suffix. PRIVATE(this)->appendPostfix(base, writename, out->addReference(base)); out->addDEFNode(SbName(writename)); } } return writename; } /*! Makes a unique id for \a base and adds a mapping into our dictionary. */ int SoWriterefCounter::addReference(const SoBase * base) { if (!PRIVATE(this)->sobase2id) PRIVATE(this)->sobase2id = new SoBase2Id; const int id = PRIVATE(this)->nextreferenceid++; PRIVATE(this)->sobase2id->put(base, id); return id; } /*! Returns the unique identifier for \a base or -1 if not found. */ int SoWriterefCounter::findReference(const SoBase * base) const { int id; const SbBool ok = PRIVATE(this)->sobase2id && PRIVATE(this)->sobase2id->get(base, id); return ok ? id : -1; } /*! Sets the reference for \a base manually. */ void SoWriterefCounter::setReference(const SoBase * base, int refid) { if (!PRIVATE(this)->sobase2id) PRIVATE(this)->sobase2id = new SoBase2Id; PRIVATE(this)->sobase2id->put(base, refid); } void SoWriterefCounter::removeSoBase2IdRef(const SoBase * base) { PRIVATE(this)->sobase2id->erase(base); } /*! Returns TRUE if the user wants extra debugging information regarding writerefs (COIN_DEBUG_WRITEREFS=1) */ SbBool SoWriterefCounter::debugWriterefs(void) { static int dbg = -1; if (dbg == -1) { const char * env = coin_getenv("COIN_DEBUG_WRITEREFS"); dbg = (env && (atoi(env) > 0)) ? 1 : 0; } return dbg; } /**********************************************************************/ #undef PRIVATE
{ "pile_set_name": "Github" }
<p> <%:The firmware is currently being upgraded.%> <strong><%:Don't switch off the device in any circumstance!%></strong> <%:The upgrade will take a few minutes. When it is finished, your node will reboot automatically.%> </p>
{ "pile_set_name": "Github" }
# dependencies import clr clr.AddReference('System.Windows.Forms') clr.AddReference('IronPython.Wpf') # find the path of ui.xaml from pyrevit import UI from pyrevit import script xamlfile = script.get_bundle_file('ui.xaml') # import WPF creator and base Window import wpf from System import Windows class MyWindow(Windows.Window): def __init__(self): wpf.LoadComponent(self, xamlfile) @property def user_name(self): return self.textbox.Text def say_hello(self, sender, args): UI.TaskDialog.Show( "Hello World", "Hello {}".format(self.user_name or 'World') ) # let's show the window (modal) MyWindow().ShowDialog()
{ "pile_set_name": "Github" }
.footer{ background-color: $white-color; line-height: $line-height; nav > ul{ list-style: none; margin: 0; padding: 0; font-weight: normal; a:not(.btn){ color: $dark-gray; display: block; margin-bottom: 3px; &:hover, &:focus{ color: $default-states-color; } } } .social-area{ padding: 15px 0; h5{ padding-bottom: 15px; } } .social-area > a:not(.btn){ color: $dark-gray; display: inline-block; vertical-align: top; padding: $padding-social-a; font-size: $font-size-large-navbar; font-weight: normal; line-height: $line-height; text-align: center; &:hover, &:focus{ color: $default-states-color; } } .copyright{ color: $default-states-color; padding: 10px 15px; margin: 10px 3px; line-height: 20px; font-size: $font-size-base; } hr{ border-color: $medium-gray; } .title{ color: $default-states-color; } } .footer-default{ background-color: $smoke-bg; } .footer:not(.footer-big){ nav > ul{ font-size: $font-size-base; li{ margin-left: 20px; float: left; } a{ padding: 10px 0px; margin: 10px 10px 10px 0px; } } }
{ "pile_set_name": "Github" }
# Get the exercise name from the current directory get_filename_component(exercise ${CMAKE_CURRENT_SOURCE_DIR} NAME) # Basic CMake project cmake_minimum_required(VERSION 3.5.1) # Name the project after the exercise project(${exercise} CXX) # Get a source filename from the exercise name by replacing -'s with _'s string(REPLACE "-" "_" file ${exercise}) # Implementation could be only a header if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.cpp) set(exercise_cpp ${file}.cpp) else() set(exercise_cpp "") endif() # Use the common Catch library? if(EXERCISM_COMMON_CATCH) # For Exercism track development only add_executable(${exercise} ${file}_test.cpp ${exercise_cpp} ${file}.h $<TARGET_OBJECTS:catchlib>) else() # Build executable from sources and headers add_executable(${exercise} ${file}_test.cpp ${exercise_cpp} ${file}.h test/tests-main.cpp) endif() set_target_properties(${exercise} PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED OFF CXX_EXTENSIONS OFF ) set(CMAKE_BUILD_TYPE Debug) if("${CMAKE_CXX_COMPILER_ID}" MATCHES "(GNU|Clang)") set_target_properties(${exercise} PROPERTIES COMPILE_FLAGS "-Wall -Wextra -Wpedantic -Werror" ) endif() # Configure to run all the tests? if(${EXERCISM_RUN_ALL_TESTS}) target_compile_definitions(${exercise} PRIVATE EXERCISM_RUN_ALL_TESTS) endif() # Tell MSVC not to warn us about unchecked iterators in debug builds if(${MSVC}) set_target_properties(${exercise} PROPERTIES COMPILE_DEFINITIONS_DEBUG _SCL_SECURE_NO_WARNINGS) endif() # Run the tests on every build add_custom_target(test_${exercise} ALL DEPENDS ${exercise} COMMAND ${exercise})
{ "pile_set_name": "Github" }
/* * Copyright (C) 2016-2017 Yusuke Suzuki <utatane.tea@gmail.com>. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ @constructor @globalPrivate function MapIterator(iteratedObject, kind) { "use strict"; @assert(@isMap(iteratedObject)); @putByIdDirectPrivate(this, "iteratedObject", iteratedObject); @putByIdDirectPrivate(this, "mapIteratorKind", kind); @putByIdDirectPrivate(this, "mapBucket", @mapBucketHead(iteratedObject)); } function values() { "use strict"; if (!@isMap(this)) @throwTypeError("Map.prototype.values requires that |this| be Map"); return new @MapIterator(this, @iterationKindValue); } function keys() { "use strict"; if (!@isMap(this)) @throwTypeError("Map.prototype.keys requires that |this| be Map"); return new @MapIterator(this, @iterationKindKey); } function entries() { "use strict"; if (!@isMap(this)) @throwTypeError("Map.prototype.entries requires that |this| be Map"); return new @MapIterator(this, @iterationKindKeyValue); } function forEach(callback /*, thisArg */) { "use strict"; if (!@isMap(this)) @throwTypeError("Map operation called on non-Map object"); if (typeof callback !== 'function') @throwTypeError("Map.prototype.forEach callback must be a function"); var thisArg = @argument(1); var bucket = @mapBucketHead(this); do { bucket = @mapBucketNext(bucket); if (bucket === @sentinelMapBucket) break; callback.@call(thisArg, @mapBucketValue(bucket), @mapBucketKey(bucket), this); } while (true); }
{ "pile_set_name": "Github" }
/***************************************************************************/ /* */ /* ftgrays.c */ /* */ /* A new `perfect' anti-aliasing renderer (body). */ /* */ /* Copyright 2000-2015 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ /* modified, and distributed under the terms of the FreeType project */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* this file you indicate that you have read the license and */ /* understand and accept it fully. */ /* */ /***************************************************************************/ /*************************************************************************/ /* */ /* This file can be compiled without the rest of the FreeType engine, by */ /* defining the _STANDALONE_ macro when compiling it. You also need to */ /* put the files `ftgrays.h' and `ftimage.h' into the current */ /* compilation directory. Typically, you could do something like */ /* */ /* - copy `src/smooth/ftgrays.c' (this file) to your current directory */ /* */ /* - copy `include/freetype/ftimage.h' and `src/smooth/ftgrays.h' to the */ /* same directory */ /* */ /* - compile `ftgrays' with the _STANDALONE_ macro defined, as in */ /* */ /* cc -c -D_STANDALONE_ ftgrays.c */ /* */ /* The renderer can be initialized with a call to */ /* `ft_gray_raster.raster_new'; an anti-aliased bitmap can be generated */ /* with a call to `ft_gray_raster.raster_render'. */ /* */ /* See the comments and documentation in the file `ftimage.h' for more */ /* details on how the raster works. */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* This is a new anti-aliasing scan-converter for FreeType 2. The */ /* algorithm used here is _very_ different from the one in the standard */ /* `ftraster' module. Actually, `ftgrays' computes the _exact_ */ /* coverage of the outline on each pixel cell. */ /* */ /* It is based on ideas that I initially found in Raph Levien's */ /* excellent LibArt graphics library (see http://www.levien.com/libart */ /* for more information, though the web pages do not tell anything */ /* about the renderer; you'll have to dive into the source code to */ /* understand how it works). */ /* */ /* Note, however, that this is a _very_ different implementation */ /* compared to Raph's. Coverage information is stored in a very */ /* different way, and I don't use sorted vector paths. Also, it doesn't */ /* use floating point values. */ /* */ /* This renderer has the following advantages: */ /* */ /* - It doesn't need an intermediate bitmap. Instead, one can supply a */ /* callback function that will be called by the renderer to draw gray */ /* spans on any target surface. You can thus do direct composition on */ /* any kind of bitmap, provided that you give the renderer the right */ /* callback. */ /* */ /* - A perfect anti-aliaser, i.e., it computes the _exact_ coverage on */ /* each pixel cell. */ /* */ /* - It performs a single pass on the outline (the `standard' FT2 */ /* renderer makes two passes). */ /* */ /* - It can easily be modified to render to _any_ number of gray levels */ /* cheaply. */ /* */ /* - For small (< 20) pixel sizes, it is faster than the standard */ /* renderer. */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* The macro FT_COMPONENT is used in trace mode. It is an implicit */ /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */ /* messages during execution. */ /* */ #undef FT_COMPONENT #define FT_COMPONENT trace_smooth #ifdef _STANDALONE_ /* The size in bytes of the render pool used by the scan-line converter */ /* to do all of its work. */ #define FT_RENDER_POOL_SIZE 16384L /* Auxiliary macros for token concatenation. */ #define FT_ERR_XCAT( x, y ) x ## y #define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y ) #define FT_BEGIN_STMNT do { #define FT_END_STMNT } while ( 0 ) #define FT_MAX( a, b ) ( (a) > (b) ? (a) : (b) ) #define FT_ABS( a ) ( (a) < 0 ? -(a) : (a) ) /* * Approximate sqrt(x*x+y*y) using the `alpha max plus beta min' * algorithm. We use alpha = 1, beta = 3/8, giving us results with a * largest error less than 7% compared to the exact value. */ #define FT_HYPOT( x, y ) \ ( x = FT_ABS( x ), \ y = FT_ABS( y ), \ x > y ? x + ( 3 * y >> 3 ) \ : y + ( 3 * x >> 3 ) ) /* define this to dump debugging information */ /* #define FT_DEBUG_LEVEL_TRACE */ #ifdef FT_DEBUG_LEVEL_TRACE #include <stdio.h> #include <stdarg.h> #endif #include <stddef.h> #include <string.h> #include <setjmp.h> #include <limits.h> #define FT_UINT_MAX UINT_MAX #define FT_INT_MAX INT_MAX #define ft_memset memset #define ft_setjmp setjmp #define ft_longjmp longjmp #define ft_jmp_buf jmp_buf typedef ptrdiff_t FT_PtrDist; #define ErrRaster_Invalid_Mode -2 #define ErrRaster_Invalid_Outline -1 #define ErrRaster_Invalid_Argument -3 #define ErrRaster_Memory_Overflow -4 #define FT_BEGIN_HEADER #define FT_END_HEADER #include "ftimage.h" #include "ftgrays.h" /* This macro is used to indicate that a function parameter is unused. */ /* Its purpose is simply to reduce compiler warnings. Note also that */ /* simply defining it as `(void)x' doesn't avoid warnings with certain */ /* ANSI compilers (e.g. LCC). */ #define FT_UNUSED( x ) (x) = (x) /* we only use level 5 & 7 tracing messages; cf. ftdebug.h */ #ifdef FT_DEBUG_LEVEL_TRACE void FT_Message( const char* fmt, ... ) { va_list ap; va_start( ap, fmt ); vfprintf( stderr, fmt, ap ); va_end( ap ); } /* empty function useful for setting a breakpoint to catch errors */ int FT_Throw( int error, int line, const char* file ) { FT_UNUSED( error ); FT_UNUSED( line ); FT_UNUSED( file ); return 0; } /* we don't handle tracing levels in stand-alone mode; */ #ifndef FT_TRACE5 #define FT_TRACE5( varformat ) FT_Message varformat #endif #ifndef FT_TRACE7 #define FT_TRACE7( varformat ) FT_Message varformat #endif #ifndef FT_ERROR #define FT_ERROR( varformat ) FT_Message varformat #endif #define FT_THROW( e ) \ ( FT_Throw( FT_ERR_CAT( ErrRaster, e ), \ __LINE__, \ __FILE__ ) | \ FT_ERR_CAT( ErrRaster, e ) ) #else /* !FT_DEBUG_LEVEL_TRACE */ #define FT_TRACE5( x ) do { } while ( 0 ) /* nothing */ #define FT_TRACE7( x ) do { } while ( 0 ) /* nothing */ #define FT_ERROR( x ) do { } while ( 0 ) /* nothing */ #define FT_THROW( e ) FT_ERR_CAT( ErrRaster_, e ) #endif /* !FT_DEBUG_LEVEL_TRACE */ #define FT_DEFINE_OUTLINE_FUNCS( class_, \ move_to_, line_to_, \ conic_to_, cubic_to_, \ shift_, delta_ ) \ static const FT_Outline_Funcs class_ = \ { \ move_to_, \ line_to_, \ conic_to_, \ cubic_to_, \ shift_, \ delta_ \ }; #define FT_DEFINE_RASTER_FUNCS( class_, glyph_format_, \ raster_new_, raster_reset_, \ raster_set_mode_, raster_render_, \ raster_done_ ) \ const FT_Raster_Funcs class_ = \ { \ glyph_format_, \ raster_new_, \ raster_reset_, \ raster_set_mode_, \ raster_render_, \ raster_done_ \ }; #else /* !_STANDALONE_ */ #include <ft2build.h> #include "ftgrays.h" #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_DEBUG_H #include FT_OUTLINE_H #include "ftsmerrs.h" #include "ftspic.h" #define Smooth_Err_Invalid_Mode Smooth_Err_Cannot_Render_Glyph #define Smooth_Err_Memory_Overflow Smooth_Err_Out_Of_Memory #define ErrRaster_Memory_Overflow Smooth_Err_Out_Of_Memory #endif /* !_STANDALONE_ */ #ifndef FT_MEM_SET #define FT_MEM_SET( d, s, c ) ft_memset( d, s, c ) #endif #ifndef FT_MEM_ZERO #define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count ) #endif /* as usual, for the speed hungry :-) */ #undef RAS_ARG #undef RAS_ARG_ #undef RAS_VAR #undef RAS_VAR_ #ifndef FT_STATIC_RASTER #define RAS_ARG gray_PWorker worker #define RAS_ARG_ gray_PWorker worker, #define RAS_VAR worker #define RAS_VAR_ worker, #else /* FT_STATIC_RASTER */ #define RAS_ARG /* empty */ #define RAS_ARG_ /* empty */ #define RAS_VAR /* empty */ #define RAS_VAR_ /* empty */ #endif /* FT_STATIC_RASTER */ /* must be at least 6 bits! */ #define PIXEL_BITS 8 #undef FLOOR #undef CEILING #undef TRUNC #undef SCALED #define ONE_PIXEL ( 1L << PIXEL_BITS ) #define TRUNC( x ) ( (TCoord)( (x) >> PIXEL_BITS ) ) #define SUBPIXELS( x ) ( (TPos)(x) << PIXEL_BITS ) #define FLOOR( x ) ( (x) & -ONE_PIXEL ) #define CEILING( x ) ( ( (x) + ONE_PIXEL - 1 ) & -ONE_PIXEL ) #define ROUND( x ) ( ( (x) + ONE_PIXEL / 2 ) & -ONE_PIXEL ) #if PIXEL_BITS >= 6 #define UPSCALE( x ) ( (x) << ( PIXEL_BITS - 6 ) ) #define DOWNSCALE( x ) ( (x) >> ( PIXEL_BITS - 6 ) ) #else #define UPSCALE( x ) ( (x) >> ( 6 - PIXEL_BITS ) ) #define DOWNSCALE( x ) ( (x) << ( 6 - PIXEL_BITS ) ) #endif /* Compute `dividend / divisor' and return both its quotient and */ /* remainder, cast to a specific type. This macro also ensures that */ /* the remainder is always positive. */ #define FT_DIV_MOD( type, dividend, divisor, quotient, remainder ) \ FT_BEGIN_STMNT \ (quotient) = (type)( (dividend) / (divisor) ); \ (remainder) = (type)( (dividend) % (divisor) ); \ if ( (remainder) < 0 ) \ { \ (quotient)--; \ (remainder) += (type)(divisor); \ } \ FT_END_STMNT #ifdef __arm__ /* Work around a bug specific to GCC which make the compiler fail to */ /* optimize a division and modulo operation on the same parameters */ /* into a single call to `__aeabi_idivmod'. See */ /* */ /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43721 */ #undef FT_DIV_MOD #define FT_DIV_MOD( type, dividend, divisor, quotient, remainder ) \ FT_BEGIN_STMNT \ (quotient) = (type)( (dividend) / (divisor) ); \ (remainder) = (type)( (dividend) - (quotient) * (divisor) ); \ if ( (remainder) < 0 ) \ { \ (quotient)--; \ (remainder) += (type)(divisor); \ } \ FT_END_STMNT #endif /* __arm__ */ /*************************************************************************/ /* */ /* TYPE DEFINITIONS */ /* */ /* don't change the following types to FT_Int or FT_Pos, since we might */ /* need to define them to "float" or "double" when experimenting with */ /* new algorithms */ typedef long TCoord; /* integer scanline/pixel coordinate */ typedef long TPos; /* sub-pixel coordinate */ /* determine the type used to store cell areas. This normally takes at */ /* least PIXEL_BITS*2 + 1 bits. On 16-bit systems, we need to use */ /* `long' instead of `int', otherwise bad things happen */ #if PIXEL_BITS <= 7 typedef int TArea; #else /* PIXEL_BITS >= 8 */ /* approximately determine the size of integers using an ANSI-C header */ #if FT_UINT_MAX == 0xFFFFU typedef long TArea; #else typedef int TArea; #endif #endif /* PIXEL_BITS >= 8 */ /* maximum number of gray spans in a call to the span callback */ #define FT_MAX_GRAY_SPANS 32 typedef struct TCell_* PCell; typedef struct TCell_ { TPos x; /* same with gray_TWorker.ex */ TCoord cover; /* same with gray_TWorker.cover */ TArea area; PCell next; } TCell; #if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */ /* We disable the warning `structure was padded due to */ /* __declspec(align())' in order to compile cleanly with */ /* the maximum level of warnings. */ #pragma warning( push ) #pragma warning( disable : 4324 ) #endif /* _MSC_VER */ typedef struct gray_TWorker_ { ft_jmp_buf jump_buffer; TCoord ex, ey; TPos min_ex, max_ex; TPos min_ey, max_ey; TPos count_ex, count_ey; TArea area; TCoord cover; int invalid; PCell cells; FT_PtrDist max_cells; FT_PtrDist num_cells; TPos x, y; FT_Vector bez_stack[32 * 3 + 1]; int lev_stack[32]; FT_Outline outline; FT_Bitmap target; FT_BBox clip_box; FT_Span gray_spans[FT_MAX_GRAY_SPANS]; int num_gray_spans; FT_Raster_Span_Func render_span; void* render_span_data; int span_y; int band_size; int band_shoot; void* buffer; long buffer_size; PCell* ycells; TPos ycount; } gray_TWorker, *gray_PWorker; #if defined( _MSC_VER ) #pragma warning( pop ) #endif #ifndef FT_STATIC_RASTER #define ras (*worker) #else static gray_TWorker ras; #endif typedef struct gray_TRaster_ { void* memory; } gray_TRaster, *gray_PRaster; /*************************************************************************/ /* */ /* Initialize the cells table. */ /* */ static void gray_init_cells( RAS_ARG_ void* buffer, long byte_size ) { ras.buffer = buffer; ras.buffer_size = byte_size; ras.ycells = (PCell*) buffer; ras.cells = NULL; ras.max_cells = 0; ras.num_cells = 0; ras.area = 0; ras.cover = 0; ras.invalid = 1; } /*************************************************************************/ /* */ /* Compute the outline bounding box. */ /* */ static void gray_compute_cbox( RAS_ARG ) { FT_Outline* outline = &ras.outline; FT_Vector* vec = outline->points; FT_Vector* limit = vec + outline->n_points; if ( outline->n_points <= 0 ) { ras.min_ex = ras.max_ex = 0; ras.min_ey = ras.max_ey = 0; return; } ras.min_ex = ras.max_ex = vec->x; ras.min_ey = ras.max_ey = vec->y; vec++; for ( ; vec < limit; vec++ ) { TPos x = vec->x; TPos y = vec->y; if ( x < ras.min_ex ) ras.min_ex = x; if ( x > ras.max_ex ) ras.max_ex = x; if ( y < ras.min_ey ) ras.min_ey = y; if ( y > ras.max_ey ) ras.max_ey = y; } /* truncate the bounding box to integer pixels */ ras.min_ex = ras.min_ex >> 6; ras.min_ey = ras.min_ey >> 6; ras.max_ex = ( ras.max_ex + 63 ) >> 6; ras.max_ey = ( ras.max_ey + 63 ) >> 6; } /*************************************************************************/ /* */ /* Record the current cell in the table. */ /* */ static PCell gray_find_cell( RAS_ARG ) { PCell *pcell, cell; TPos x = ras.ex; if ( x > ras.count_ex ) x = ras.count_ex; pcell = &ras.ycells[ras.ey]; for (;;) { cell = *pcell; if ( cell == NULL || cell->x > x ) break; if ( cell->x == x ) goto Exit; pcell = &cell->next; } if ( ras.num_cells >= ras.max_cells ) ft_longjmp( ras.jump_buffer, 1 ); cell = ras.cells + ras.num_cells++; cell->x = x; cell->area = 0; cell->cover = 0; cell->next = *pcell; *pcell = cell; Exit: return cell; } static void gray_record_cell( RAS_ARG ) { if ( ras.area | ras.cover ) { PCell cell = gray_find_cell( RAS_VAR ); cell->area += ras.area; cell->cover += ras.cover; } } /*************************************************************************/ /* */ /* Set the current cell to a new position. */ /* */ static void gray_set_cell( RAS_ARG_ TCoord ex, TCoord ey ) { /* Move the cell pointer to a new position. We set the `invalid' */ /* flag to indicate that the cell isn't part of those we're interested */ /* in during the render phase. This means that: */ /* */ /* . the new vertical position must be within min_ey..max_ey-1. */ /* . the new horizontal position must be strictly less than max_ex */ /* */ /* Note that if a cell is to the left of the clipping region, it is */ /* actually set to the (min_ex-1) horizontal position. */ /* All cells that are on the left of the clipping region go to the */ /* min_ex - 1 horizontal position. */ ey -= ras.min_ey; if ( ex > ras.max_ex ) ex = ras.max_ex; ex -= ras.min_ex; if ( ex < 0 ) ex = -1; /* are we moving to a different cell ? */ if ( ex != ras.ex || ey != ras.ey ) { /* record the current one if it is valid */ if ( !ras.invalid ) gray_record_cell( RAS_VAR ); ras.area = 0; ras.cover = 0; ras.ex = ex; ras.ey = ey; } ras.invalid = ( (unsigned int)ey >= (unsigned int)ras.count_ey || ex >= ras.count_ex ); } /*************************************************************************/ /* */ /* Start a new contour at a given cell. */ /* */ static void gray_start_cell( RAS_ARG_ TCoord ex, TCoord ey ) { if ( ex > ras.max_ex ) ex = (TCoord)( ras.max_ex ); if ( ex < ras.min_ex ) ex = (TCoord)( ras.min_ex - 1 ); ras.area = 0; ras.cover = 0; ras.ex = ex - ras.min_ex; ras.ey = ey - ras.min_ey; ras.invalid = 0; gray_set_cell( RAS_VAR_ ex, ey ); } /*************************************************************************/ /* */ /* Render a scanline as one or more cells. */ /* */ static void gray_render_scanline( RAS_ARG_ TCoord ey, TPos x1, TCoord y1, TPos x2, TCoord y2 ) { TCoord ex1, ex2, fx1, fx2, delta, mod; long p, first, dx; int incr; dx = x2 - x1; ex1 = TRUNC( x1 ); ex2 = TRUNC( x2 ); fx1 = (TCoord)( x1 - SUBPIXELS( ex1 ) ); fx2 = (TCoord)( x2 - SUBPIXELS( ex2 ) ); /* trivial case. Happens often */ if ( y1 == y2 ) { gray_set_cell( RAS_VAR_ ex2, ey ); return; } /* everything is located in a single cell. That is easy! */ /* */ if ( ex1 == ex2 ) { delta = y2 - y1; ras.area += (TArea)(( fx1 + fx2 ) * delta); ras.cover += delta; return; } /* ok, we'll have to render a run of adjacent cells on the same */ /* scanline... */ /* */ p = ( ONE_PIXEL - fx1 ) * ( y2 - y1 ); first = ONE_PIXEL; incr = 1; if ( dx < 0 ) { p = fx1 * ( y2 - y1 ); first = 0; incr = -1; dx = -dx; } FT_DIV_MOD( TCoord, p, dx, delta, mod ); ras.area += (TArea)(( fx1 + first ) * delta); ras.cover += delta; ex1 += incr; gray_set_cell( RAS_VAR_ ex1, ey ); y1 += delta; if ( ex1 != ex2 ) { TCoord lift, rem; p = ONE_PIXEL * ( y2 - y1 + delta ); FT_DIV_MOD( TCoord, p, dx, lift, rem ); mod -= (int)dx; do { delta = lift; mod += rem; if ( mod >= 0 ) { mod -= (TCoord)dx; delta++; } ras.area += (TArea)(ONE_PIXEL * delta); ras.cover += delta; y1 += delta; ex1 += incr; gray_set_cell( RAS_VAR_ ex1, ey ); } while ( ex1 != ex2 ); } delta = y2 - y1; ras.area += (TArea)(( fx2 + ONE_PIXEL - first ) * delta); ras.cover += delta; } /*************************************************************************/ /* */ /* Render a given line as a series of scanlines. */ /* */ static void gray_render_line( RAS_ARG_ TPos to_x, TPos to_y ) { TCoord ey1, ey2, fy1, fy2, mod; TPos dx, dy, x, x2; long p, first; int delta, rem, lift, incr; ey1 = TRUNC( ras.y ); ey2 = TRUNC( to_y ); /* if (ey2 >= ras.max_ey) ey2 = ras.max_ey-1; */ fy1 = (TCoord)( ras.y - SUBPIXELS( ey1 ) ); fy2 = (TCoord)( to_y - SUBPIXELS( ey2 ) ); dx = to_x - ras.x; dy = to_y - ras.y; /* perform vertical clipping */ if ( ( ey1 >= ras.max_ey && ey2 >= ras.max_ey ) || ( ey1 < ras.min_ey && ey2 < ras.min_ey ) ) goto End; /* everything is on a single scanline */ if ( ey1 == ey2 ) { gray_render_scanline( RAS_VAR_ ey1, ras.x, fy1, to_x, fy2 ); goto End; } /* vertical line - avoid calling gray_render_scanline */ incr = 1; if ( dx == 0 ) { TCoord ex = TRUNC( ras.x ); TCoord two_fx = (TCoord)( ( ras.x - SUBPIXELS( ex ) ) << 1 ); TArea area; first = ONE_PIXEL; if ( dy < 0 ) { first = 0; incr = -1; } delta = (int)( first - fy1 ); ras.area += (TArea)two_fx * delta; ras.cover += delta; ey1 += incr; gray_set_cell( RAS_VAR_ ex, ey1 ); delta = (int)( first + first - ONE_PIXEL ); area = (TArea)two_fx * delta; while ( ey1 != ey2 ) { ras.area += area; ras.cover += delta; ey1 += incr; gray_set_cell( RAS_VAR_ ex, ey1 ); } delta = (int)( fy2 - ONE_PIXEL + first ); ras.area += (TArea)two_fx * delta; ras.cover += delta; goto End; } /* ok, we have to render several scanlines */ p = ( ONE_PIXEL - fy1 ) * dx; first = ONE_PIXEL; incr = 1; if ( dy < 0 ) { p = fy1 * dx; first = 0; incr = -1; dy = -dy; } FT_DIV_MOD( int, p, dy, delta, mod ); x = ras.x + delta; gray_render_scanline( RAS_VAR_ ey1, ras.x, fy1, x, (TCoord)first ); ey1 += incr; gray_set_cell( RAS_VAR_ TRUNC( x ), ey1 ); if ( ey1 != ey2 ) { p = ONE_PIXEL * dx; FT_DIV_MOD( int, p, dy, lift, rem ); mod -= (int)dy; do { delta = lift; mod += rem; if ( mod >= 0 ) { mod -= (int)dy; delta++; } x2 = x + delta; gray_render_scanline( RAS_VAR_ ey1, x, (TCoord)( ONE_PIXEL - first ), x2, (TCoord)first ); x = x2; ey1 += incr; gray_set_cell( RAS_VAR_ TRUNC( x ), ey1 ); } while ( ey1 != ey2 ); } gray_render_scanline( RAS_VAR_ ey1, x, (TCoord)( ONE_PIXEL - first ), to_x, fy2 ); End: ras.x = to_x; ras.y = to_y; } static void gray_split_conic( FT_Vector* base ) { TPos a, b; base[4].x = base[2].x; b = base[1].x; a = base[3].x = ( base[2].x + b ) / 2; b = base[1].x = ( base[0].x + b ) / 2; base[2].x = ( a + b ) / 2; base[4].y = base[2].y; b = base[1].y; a = base[3].y = ( base[2].y + b ) / 2; b = base[1].y = ( base[0].y + b ) / 2; base[2].y = ( a + b ) / 2; } static void gray_render_conic( RAS_ARG_ const FT_Vector* control, const FT_Vector* to ) { TPos dx, dy; TPos min, max, y; int top, level; int* levels; FT_Vector* arc; levels = ras.lev_stack; arc = ras.bez_stack; arc[0].x = UPSCALE( to->x ); arc[0].y = UPSCALE( to->y ); arc[1].x = UPSCALE( control->x ); arc[1].y = UPSCALE( control->y ); arc[2].x = ras.x; arc[2].y = ras.y; top = 0; dx = FT_ABS( arc[2].x + arc[0].x - 2 * arc[1].x ); dy = FT_ABS( arc[2].y + arc[0].y - 2 * arc[1].y ); if ( dx < dy ) dx = dy; if ( dx < ONE_PIXEL / 4 ) goto Draw; /* short-cut the arc that crosses the current band */ min = max = arc[0].y; y = arc[1].y; if ( y < min ) min = y; if ( y > max ) max = y; y = arc[2].y; if ( y < min ) min = y; if ( y > max ) max = y; if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey ) goto Draw; level = 0; do { dx >>= 2; level++; } while ( dx > ONE_PIXEL / 4 ); levels[0] = level; do { level = levels[top]; if ( level > 0 ) { gray_split_conic( arc ); arc += 2; top++; levels[top] = levels[top - 1] = level - 1; continue; } Draw: gray_render_line( RAS_VAR_ arc[0].x, arc[0].y ); top--; arc -= 2; } while ( top >= 0 ); } static void gray_split_cubic( FT_Vector* base ) { TPos a, b, c, d; base[6].x = base[3].x; c = base[1].x; d = base[2].x; base[1].x = a = ( base[0].x + c ) / 2; base[5].x = b = ( base[3].x + d ) / 2; c = ( c + d ) / 2; base[2].x = a = ( a + c ) / 2; base[4].x = b = ( b + c ) / 2; base[3].x = ( a + b ) / 2; base[6].y = base[3].y; c = base[1].y; d = base[2].y; base[1].y = a = ( base[0].y + c ) / 2; base[5].y = b = ( base[3].y + d ) / 2; c = ( c + d ) / 2; base[2].y = a = ( a + c ) / 2; base[4].y = b = ( b + c ) / 2; base[3].y = ( a + b ) / 2; } static void gray_render_cubic( RAS_ARG_ const FT_Vector* control1, const FT_Vector* control2, const FT_Vector* to ) { FT_Vector* arc; TPos min, max, y; arc = ras.bez_stack; arc[0].x = UPSCALE( to->x ); arc[0].y = UPSCALE( to->y ); arc[1].x = UPSCALE( control2->x ); arc[1].y = UPSCALE( control2->y ); arc[2].x = UPSCALE( control1->x ); arc[2].y = UPSCALE( control1->y ); arc[3].x = ras.x; arc[3].y = ras.y; /* Short-cut the arc that crosses the current band. */ min = max = arc[0].y; y = arc[1].y; if ( y < min ) min = y; if ( y > max ) max = y; y = arc[2].y; if ( y < min ) min = y; if ( y > max ) max = y; y = arc[3].y; if ( y < min ) min = y; if ( y > max ) max = y; if ( TRUNC( min ) >= ras.max_ey || TRUNC( max ) < ras.min_ey ) goto Draw; for (;;) { /* Decide whether to split or draw. See `Rapid Termination */ /* Evaluation for Recursive Subdivision of Bezier Curves' by Thomas */ /* F. Hain, at */ /* http://www.cis.southalabama.edu/~hain/general/Publications/Bezier/Camera-ready%20CISST02%202.pdf */ { TPos dx, dy, dx_, dy_; TPos dx1, dy1, dx2, dy2; TPos L, s, s_limit; /* dx and dy are x and y components of the P0-P3 chord vector. */ dx = dx_ = arc[3].x - arc[0].x; dy = dy_ = arc[3].y - arc[0].y; L = FT_HYPOT( dx_, dy_ ); /* Avoid possible arithmetic overflow below by splitting. */ if ( L > 32767 ) goto Split; /* Max deviation may be as much as (s/L) * 3/4 (if Hain's v = 1). */ s_limit = L * (TPos)( ONE_PIXEL / 6 ); /* s is L * the perpendicular distance from P1 to the line P0-P3. */ dx1 = arc[1].x - arc[0].x; dy1 = arc[1].y - arc[0].y; s = FT_ABS( dy * dx1 - dx * dy1 ); if ( s > s_limit ) goto Split; /* s is L * the perpendicular distance from P2 to the line P0-P3. */ dx2 = arc[2].x - arc[0].x; dy2 = arc[2].y - arc[0].y; s = FT_ABS( dy * dx2 - dx * dy2 ); if ( s > s_limit ) goto Split; /* Split super curvy segments where the off points are so far from the chord that the angles P0-P1-P3 or P0-P2-P3 become acute as detected by appropriate dot products. */ if ( dx1 * ( dx1 - dx ) + dy1 * ( dy1 - dy ) > 0 || dx2 * ( dx2 - dx ) + dy2 * ( dy2 - dy ) > 0 ) goto Split; /* No reason to split. */ goto Draw; } Split: gray_split_cubic( arc ); arc += 3; continue; Draw: gray_render_line( RAS_VAR_ arc[0].x, arc[0].y ); if ( arc == ras.bez_stack ) return; arc -= 3; } } static int gray_move_to( const FT_Vector* to, gray_PWorker worker ) { TPos x, y; /* record current cell, if any */ if ( !ras.invalid ) gray_record_cell( RAS_VAR ); /* start to a new position */ x = UPSCALE( to->x ); y = UPSCALE( to->y ); gray_start_cell( RAS_VAR_ TRUNC( x ), TRUNC( y ) ); worker->x = x; worker->y = y; return 0; } static int gray_line_to( const FT_Vector* to, gray_PWorker worker ) { gray_render_line( RAS_VAR_ UPSCALE( to->x ), UPSCALE( to->y ) ); return 0; } static int gray_conic_to( const FT_Vector* control, const FT_Vector* to, gray_PWorker worker ) { gray_render_conic( RAS_VAR_ control, to ); return 0; } static int gray_cubic_to( const FT_Vector* control1, const FT_Vector* control2, const FT_Vector* to, gray_PWorker worker ) { gray_render_cubic( RAS_VAR_ control1, control2, to ); return 0; } static void gray_render_span( int y, int count, const FT_Span* spans, gray_PWorker worker ) { unsigned char* p; FT_Bitmap* map = &worker->target; /* first of all, compute the scanline offset */ p = (unsigned char*)map->buffer - y * map->pitch; if ( map->pitch >= 0 ) p += ( map->rows - 1 ) * (unsigned int)map->pitch; for ( ; count > 0; count--, spans++ ) { unsigned char coverage = spans->coverage; if ( coverage ) { /* For small-spans it is faster to do it by ourselves than * calling `memset'. This is mainly due to the cost of the * function call. */ if ( spans->len >= 8 ) FT_MEM_SET( p + spans->x, (unsigned char)coverage, spans->len ); else { unsigned char* q = p + spans->x; switch ( spans->len ) { case 7: *q++ = (unsigned char)coverage; case 6: *q++ = (unsigned char)coverage; case 5: *q++ = (unsigned char)coverage; case 4: *q++ = (unsigned char)coverage; case 3: *q++ = (unsigned char)coverage; case 2: *q++ = (unsigned char)coverage; case 1: *q = (unsigned char)coverage; default: ; } } } } } static void gray_hline( RAS_ARG_ TCoord x, TCoord y, TPos area, TCoord acount ) { int coverage; /* compute the coverage line's coverage, depending on the */ /* outline fill rule */ /* */ /* the coverage percentage is area/(PIXEL_BITS*PIXEL_BITS*2) */ /* */ coverage = (int)( area >> ( PIXEL_BITS * 2 + 1 - 8 ) ); /* use range 0..256 */ if ( coverage < 0 ) coverage = -coverage; if ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) { coverage &= 511; if ( coverage > 256 ) coverage = 512 - coverage; else if ( coverage == 256 ) coverage = 255; } else { /* normal non-zero winding rule */ if ( coverage >= 256 ) coverage = 255; } y += (TCoord)ras.min_ey; x += (TCoord)ras.min_ex; /* FT_Span.x is a 16-bit short, so limit our coordinates appropriately */ if ( x >= 32767 ) x = 32767; /* FT_Span.y is an integer, so limit our coordinates appropriately */ if ( y >= FT_INT_MAX ) y = FT_INT_MAX; if ( coverage ) { FT_Span* span; int count; /* see whether we can add this span to the current list */ count = ras.num_gray_spans; span = ras.gray_spans + count - 1; if ( count > 0 && ras.span_y == y && (int)span->x + span->len == (int)x && span->coverage == coverage ) { span->len = (unsigned short)( span->len + acount ); return; } if ( ras.span_y != y || count >= FT_MAX_GRAY_SPANS ) { if ( ras.render_span && count > 0 ) ras.render_span( ras.span_y, count, ras.gray_spans, ras.render_span_data ); #ifdef FT_DEBUG_LEVEL_TRACE if ( count > 0 ) { int n; FT_TRACE7(( "y = %3d ", ras.span_y )); span = ras.gray_spans; for ( n = 0; n < count; n++, span++ ) FT_TRACE7(( "[%d..%d]:%02x ", span->x, span->x + span->len - 1, span->coverage )); FT_TRACE7(( "\n" )); } #endif /* FT_DEBUG_LEVEL_TRACE */ ras.num_gray_spans = 0; ras.span_y = (int)y; span = ras.gray_spans; } else span++; /* add a gray span to the current list */ span->x = (short)x; span->len = (unsigned short)acount; span->coverage = (unsigned char)coverage; ras.num_gray_spans++; } } #ifdef FT_DEBUG_LEVEL_TRACE /* to be called while in the debugger -- */ /* this function causes a compiler warning since it is unused otherwise */ static void gray_dump_cells( RAS_ARG ) { int yindex; for ( yindex = 0; yindex < ras.ycount; yindex++ ) { PCell cell; printf( "%3d:", yindex ); for ( cell = ras.ycells[yindex]; cell != NULL; cell = cell->next ) printf( " (%3ld, c:%4ld, a:%6d)", cell->x, cell->cover, cell->area ); printf( "\n" ); } } #endif /* FT_DEBUG_LEVEL_TRACE */ static void gray_sweep( RAS_ARG_ const FT_Bitmap* target ) { int yindex; FT_UNUSED( target ); if ( ras.num_cells == 0 ) return; ras.num_gray_spans = 0; FT_TRACE7(( "gray_sweep: start\n" )); for ( yindex = 0; yindex < ras.ycount; yindex++ ) { PCell cell = ras.ycells[yindex]; TCoord cover = 0; TCoord x = 0; for ( ; cell != NULL; cell = cell->next ) { TPos area; if ( cell->x > x && cover != 0 ) gray_hline( RAS_VAR_ x, yindex, cover * ( ONE_PIXEL * 2 ), cell->x - x ); cover += cell->cover; area = cover * ( ONE_PIXEL * 2 ) - cell->area; if ( area != 0 && cell->x >= 0 ) gray_hline( RAS_VAR_ cell->x, yindex, area, 1 ); x = cell->x + 1; } if ( cover != 0 ) gray_hline( RAS_VAR_ x, yindex, cover * ( ONE_PIXEL * 2 ), ras.count_ex - x ); } if ( ras.render_span && ras.num_gray_spans > 0 ) ras.render_span( ras.span_y, ras.num_gray_spans, ras.gray_spans, ras.render_span_data ); #ifdef FT_DEBUG_LEVEL_TRACE if ( ras.num_gray_spans > 0 ) { FT_Span* span; int n; FT_TRACE7(( "y = %3d ", ras.span_y )); span = ras.gray_spans; for ( n = 0; n < ras.num_gray_spans; n++, span++ ) FT_TRACE7(( "[%d..%d]:%02x ", span->x, span->x + span->len - 1, span->coverage )); FT_TRACE7(( "\n" )); } FT_TRACE7(( "gray_sweep: end\n" )); #endif /* FT_DEBUG_LEVEL_TRACE */ } #ifdef _STANDALONE_ /*************************************************************************/ /* */ /* The following function should only compile in stand-alone mode, */ /* i.e., when building this component without the rest of FreeType. */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ /* <Function> */ /* FT_Outline_Decompose */ /* */ /* <Description> */ /* Walk over an outline's structure to decompose it into individual */ /* segments and Bézier arcs. This function is also able to emit */ /* `move to' and `close to' operations to indicate the start and end */ /* of new contours in the outline. */ /* */ /* <Input> */ /* outline :: A pointer to the source target. */ /* */ /* func_interface :: A table of `emitters', i.e., function pointers */ /* called during decomposition to indicate path */ /* operations. */ /* */ /* <InOut> */ /* user :: A typeless pointer which is passed to each */ /* emitter during the decomposition. It can be */ /* used to store the state during the */ /* decomposition. */ /* */ /* <Return> */ /* Error code. 0 means success. */ /* */ static int FT_Outline_Decompose( const FT_Outline* outline, const FT_Outline_Funcs* func_interface, void* user ) { #undef SCALED #define SCALED( x ) ( ( (x) << shift ) - delta ) FT_Vector v_last; FT_Vector v_control; FT_Vector v_start; FT_Vector* point; FT_Vector* limit; char* tags; int error; int n; /* index of contour in outline */ int first; /* index of first point in contour */ char tag; /* current point's state */ int shift; TPos delta; if ( !outline ) return FT_THROW( Invalid_Outline ); if ( !func_interface ) return FT_THROW( Invalid_Argument ); shift = func_interface->shift; delta = func_interface->delta; first = 0; for ( n = 0; n < outline->n_contours; n++ ) { int last; /* index of last point in contour */ FT_TRACE5(( "FT_Outline_Decompose: Outline %d\n", n )); last = outline->contours[n]; if ( last < 0 ) goto Invalid_Outline; limit = outline->points + last; v_start = outline->points[first]; v_start.x = SCALED( v_start.x ); v_start.y = SCALED( v_start.y ); v_last = outline->points[last]; v_last.x = SCALED( v_last.x ); v_last.y = SCALED( v_last.y ); v_control = v_start; point = outline->points + first; tags = outline->tags + first; tag = FT_CURVE_TAG( tags[0] ); /* A contour cannot start with a cubic control point! */ if ( tag == FT_CURVE_TAG_CUBIC ) goto Invalid_Outline; /* check first point to determine origin */ if ( tag == FT_CURVE_TAG_CONIC ) { /* first point is conic control. Yes, this happens. */ if ( FT_CURVE_TAG( outline->tags[last] ) == FT_CURVE_TAG_ON ) { /* start at last point if it is on the curve */ v_start = v_last; limit--; } else { /* if both first and last points are conic, */ /* start at their middle and record its position */ /* for closure */ v_start.x = ( v_start.x + v_last.x ) / 2; v_start.y = ( v_start.y + v_last.y ) / 2; v_last = v_start; } point--; tags--; } FT_TRACE5(( " move to (%.2f, %.2f)\n", v_start.x / 64.0, v_start.y / 64.0 )); error = func_interface->move_to( &v_start, user ); if ( error ) goto Exit; while ( point < limit ) { point++; tags++; tag = FT_CURVE_TAG( tags[0] ); switch ( tag ) { case FT_CURVE_TAG_ON: /* emit a single line_to */ { FT_Vector vec; vec.x = SCALED( point->x ); vec.y = SCALED( point->y ); FT_TRACE5(( " line to (%.2f, %.2f)\n", vec.x / 64.0, vec.y / 64.0 )); error = func_interface->line_to( &vec, user ); if ( error ) goto Exit; continue; } case FT_CURVE_TAG_CONIC: /* consume conic arcs */ v_control.x = SCALED( point->x ); v_control.y = SCALED( point->y ); Do_Conic: if ( point < limit ) { FT_Vector vec; FT_Vector v_middle; point++; tags++; tag = FT_CURVE_TAG( tags[0] ); vec.x = SCALED( point->x ); vec.y = SCALED( point->y ); if ( tag == FT_CURVE_TAG_ON ) { FT_TRACE5(( " conic to (%.2f, %.2f)" " with control (%.2f, %.2f)\n", vec.x / 64.0, vec.y / 64.0, v_control.x / 64.0, v_control.y / 64.0 )); error = func_interface->conic_to( &v_control, &vec, user ); if ( error ) goto Exit; continue; } if ( tag != FT_CURVE_TAG_CONIC ) goto Invalid_Outline; v_middle.x = ( v_control.x + vec.x ) / 2; v_middle.y = ( v_control.y + vec.y ) / 2; FT_TRACE5(( " conic to (%.2f, %.2f)" " with control (%.2f, %.2f)\n", v_middle.x / 64.0, v_middle.y / 64.0, v_control.x / 64.0, v_control.y / 64.0 )); error = func_interface->conic_to( &v_control, &v_middle, user ); if ( error ) goto Exit; v_control = vec; goto Do_Conic; } FT_TRACE5(( " conic to (%.2f, %.2f)" " with control (%.2f, %.2f)\n", v_start.x / 64.0, v_start.y / 64.0, v_control.x / 64.0, v_control.y / 64.0 )); error = func_interface->conic_to( &v_control, &v_start, user ); goto Close; default: /* FT_CURVE_TAG_CUBIC */ { FT_Vector vec1, vec2; if ( point + 1 > limit || FT_CURVE_TAG( tags[1] ) != FT_CURVE_TAG_CUBIC ) goto Invalid_Outline; point += 2; tags += 2; vec1.x = SCALED( point[-2].x ); vec1.y = SCALED( point[-2].y ); vec2.x = SCALED( point[-1].x ); vec2.y = SCALED( point[-1].y ); if ( point <= limit ) { FT_Vector vec; vec.x = SCALED( point->x ); vec.y = SCALED( point->y ); FT_TRACE5(( " cubic to (%.2f, %.2f)" " with controls (%.2f, %.2f) and (%.2f, %.2f)\n", vec.x / 64.0, vec.y / 64.0, vec1.x / 64.0, vec1.y / 64.0, vec2.x / 64.0, vec2.y / 64.0 )); error = func_interface->cubic_to( &vec1, &vec2, &vec, user ); if ( error ) goto Exit; continue; } FT_TRACE5(( " cubic to (%.2f, %.2f)" " with controls (%.2f, %.2f) and (%.2f, %.2f)\n", v_start.x / 64.0, v_start.y / 64.0, vec1.x / 64.0, vec1.y / 64.0, vec2.x / 64.0, vec2.y / 64.0 )); error = func_interface->cubic_to( &vec1, &vec2, &v_start, user ); goto Close; } } } /* close the contour with a line segment */ FT_TRACE5(( " line to (%.2f, %.2f)\n", v_start.x / 64.0, v_start.y / 64.0 )); error = func_interface->line_to( &v_start, user ); Close: if ( error ) goto Exit; first = last + 1; } FT_TRACE5(( "FT_Outline_Decompose: Done\n", n )); return 0; Exit: FT_TRACE5(( "FT_Outline_Decompose: Error %d\n", error )); return error; Invalid_Outline: return FT_THROW( Invalid_Outline ); } #endif /* _STANDALONE_ */ typedef struct gray_TBand_ { TPos min, max; } gray_TBand; FT_DEFINE_OUTLINE_FUNCS( func_interface, (FT_Outline_MoveTo_Func) gray_move_to, (FT_Outline_LineTo_Func) gray_line_to, (FT_Outline_ConicTo_Func)gray_conic_to, (FT_Outline_CubicTo_Func)gray_cubic_to, 0, 0 ) static int gray_convert_glyph_inner( RAS_ARG ) { volatile int error = 0; #ifdef FT_CONFIG_OPTION_PIC FT_Outline_Funcs func_interface; Init_Class_func_interface(&func_interface); #endif if ( ft_setjmp( ras.jump_buffer ) == 0 ) { error = FT_Outline_Decompose( &ras.outline, &func_interface, &ras ); if ( !ras.invalid ) gray_record_cell( RAS_VAR ); } else error = FT_THROW( Memory_Overflow ); return error; } static int gray_convert_glyph( RAS_ARG ) { gray_TBand bands[40]; gray_TBand* volatile band; int volatile n, num_bands; TPos volatile min, max, max_y; FT_BBox* clip; /* Set up state in the raster object */ gray_compute_cbox( RAS_VAR ); /* clip to target bitmap, exit if nothing to do */ clip = &ras.clip_box; if ( ras.max_ex <= clip->xMin || ras.min_ex >= clip->xMax || ras.max_ey <= clip->yMin || ras.min_ey >= clip->yMax ) return 0; if ( ras.min_ex < clip->xMin ) ras.min_ex = clip->xMin; if ( ras.min_ey < clip->yMin ) ras.min_ey = clip->yMin; if ( ras.max_ex > clip->xMax ) ras.max_ex = clip->xMax; if ( ras.max_ey > clip->yMax ) ras.max_ey = clip->yMax; ras.count_ex = ras.max_ex - ras.min_ex; ras.count_ey = ras.max_ey - ras.min_ey; /* set up vertical bands */ num_bands = (int)( ( ras.max_ey - ras.min_ey ) / ras.band_size ); if ( num_bands == 0 ) num_bands = 1; if ( num_bands >= 39 ) num_bands = 39; ras.band_shoot = 0; min = ras.min_ey; max_y = ras.max_ey; for ( n = 0; n < num_bands; n++, min = max ) { max = min + ras.band_size; if ( n == num_bands - 1 || max > max_y ) max = max_y; bands[0].min = min; bands[0].max = max; band = bands; do { TPos bottom, top, middle; int error; { PCell cells_max; int yindex; long cell_start, cell_end, cell_mod; ras.ycells = (PCell*)ras.buffer; ras.ycount = band->max - band->min; cell_start = (long)sizeof ( PCell ) * ras.ycount; cell_mod = cell_start % (long)sizeof ( TCell ); if ( cell_mod > 0 ) cell_start += (long)sizeof ( TCell ) - cell_mod; cell_end = ras.buffer_size; cell_end -= cell_end % (long)sizeof ( TCell ); cells_max = (PCell)( (char*)ras.buffer + cell_end ); ras.cells = (PCell)( (char*)ras.buffer + cell_start ); if ( ras.cells >= cells_max ) goto ReduceBands; ras.max_cells = cells_max - ras.cells; if ( ras.max_cells < 2 ) goto ReduceBands; for ( yindex = 0; yindex < ras.ycount; yindex++ ) ras.ycells[yindex] = NULL; } ras.num_cells = 0; ras.invalid = 1; ras.min_ey = band->min; ras.max_ey = band->max; ras.count_ey = band->max - band->min; error = gray_convert_glyph_inner( RAS_VAR ); if ( !error ) { gray_sweep( RAS_VAR_ &ras.target ); band--; continue; } else if ( error != ErrRaster_Memory_Overflow ) return 1; ReduceBands: /* render pool overflow; we will reduce the render band by half */ bottom = band->min; top = band->max; middle = bottom + ( ( top - bottom ) >> 1 ); /* This is too complex for a single scanline; there must */ /* be some problems. */ if ( middle == bottom ) { #ifdef FT_DEBUG_LEVEL_TRACE FT_TRACE7(( "gray_convert_glyph: rotten glyph\n" )); #endif return 1; } if ( bottom-top >= ras.band_size ) ras.band_shoot++; band[1].min = bottom; band[1].max = middle; band[0].min = middle; band[0].max = top; band++; } while ( band >= bands ); } if ( ras.band_shoot > 8 && ras.band_size > 16 ) ras.band_size = ras.band_size / 2; return 0; } static int gray_raster_render( gray_PRaster raster, const FT_Raster_Params* params ) { const FT_Outline* outline = (const FT_Outline*)params->source; const FT_Bitmap* target_map = params->target; gray_TWorker worker[1]; TCell buffer[FT_MAX( FT_RENDER_POOL_SIZE, 2048 ) / sizeof ( TCell )]; long buffer_size = sizeof ( buffer ); int band_size = (int)( buffer_size / (long)( sizeof ( TCell ) * 8 ) ); if ( !raster ) return FT_THROW( Invalid_Argument ); if ( !outline ) return FT_THROW( Invalid_Outline ); /* return immediately if the outline is empty */ if ( outline->n_points == 0 || outline->n_contours <= 0 ) return 0; if ( !outline->contours || !outline->points ) return FT_THROW( Invalid_Outline ); if ( outline->n_points != outline->contours[outline->n_contours - 1] + 1 ) return FT_THROW( Invalid_Outline ); /* if direct mode is not set, we must have a target bitmap */ if ( !( params->flags & FT_RASTER_FLAG_DIRECT ) ) { if ( !target_map ) return FT_THROW( Invalid_Argument ); /* nothing to do */ if ( !target_map->width || !target_map->rows ) return 0; if ( !target_map->buffer ) return FT_THROW( Invalid_Argument ); } /* this version does not support monochrome rendering */ if ( !( params->flags & FT_RASTER_FLAG_AA ) ) return FT_THROW( Invalid_Mode ); /* compute clipping box */ if ( !( params->flags & FT_RASTER_FLAG_DIRECT ) ) { /* compute clip box from target pixmap */ ras.clip_box.xMin = 0; ras.clip_box.yMin = 0; ras.clip_box.xMax = (FT_Pos)target_map->width; ras.clip_box.yMax = (FT_Pos)target_map->rows; } else if ( params->flags & FT_RASTER_FLAG_CLIP ) ras.clip_box = params->clip_box; else { ras.clip_box.xMin = -32768L; ras.clip_box.yMin = -32768L; ras.clip_box.xMax = 32767L; ras.clip_box.yMax = 32767L; } gray_init_cells( RAS_VAR_ buffer, buffer_size ); ras.outline = *outline; ras.num_cells = 0; ras.invalid = 1; ras.band_size = band_size; ras.num_gray_spans = 0; ras.span_y = 0; if ( params->flags & FT_RASTER_FLAG_DIRECT ) { ras.render_span = (FT_Raster_Span_Func)params->gray_spans; ras.render_span_data = params->user; } else { ras.target = *target_map; ras.render_span = (FT_Raster_Span_Func)gray_render_span; ras.render_span_data = &ras; } return gray_convert_glyph( RAS_VAR ); } /**** RASTER OBJECT CREATION: In stand-alone mode, we simply use *****/ /**** a static object. *****/ #ifdef _STANDALONE_ static int gray_raster_new( void* memory, FT_Raster* araster ) { static gray_TRaster the_raster; FT_UNUSED( memory ); *araster = (FT_Raster)&the_raster; FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) ); return 0; } static void gray_raster_done( FT_Raster raster ) { /* nothing */ FT_UNUSED( raster ); } #else /* !_STANDALONE_ */ static int gray_raster_new( FT_Memory memory, FT_Raster* araster ) { FT_Error error; gray_PRaster raster = NULL; *araster = 0; if ( !FT_ALLOC( raster, sizeof ( gray_TRaster ) ) ) { raster->memory = memory; *araster = (FT_Raster)raster; } return error; } static void gray_raster_done( FT_Raster raster ) { FT_Memory memory = (FT_Memory)((gray_PRaster)raster)->memory; FT_FREE( raster ); } #endif /* !_STANDALONE_ */ static void gray_raster_reset( FT_Raster raster, char* pool_base, long pool_size ) { FT_UNUSED( raster ); FT_UNUSED( pool_base ); FT_UNUSED( pool_size ); } static int gray_raster_set_mode( FT_Raster raster, unsigned long mode, void* args ) { FT_UNUSED( raster ); FT_UNUSED( mode ); FT_UNUSED( args ); return 0; /* nothing to do */ } FT_DEFINE_RASTER_FUNCS( ft_grays_raster, FT_GLYPH_FORMAT_OUTLINE, (FT_Raster_New_Func) gray_raster_new, (FT_Raster_Reset_Func) gray_raster_reset, (FT_Raster_Set_Mode_Func)gray_raster_set_mode, (FT_Raster_Render_Func) gray_raster_render, (FT_Raster_Done_Func) gray_raster_done ) /* END */ /* Local Variables: */ /* coding: utf-8 */ /* End: */
{ "pile_set_name": "Github" }
// SPDX-License-Identifier: BSD-3-Clause /*============================================================================ This C source file is part of the SoftFloat IEEE Floating-Point Arithmetic Package, Release 3a, by John R. Hauser. Copyright 2011, 2012, 2013, 2014 The Regents of the University of California. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the University 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 REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =============================================================================*/ #include <stdint.h> #include "platform.h" #include "internals.h" #include "softfloat.h" #ifdef SOFTFLOAT_FAST_INT64 void i32_to_f128M( int32_t a, float128_t *zPtr ) { *zPtr = i32_to_f128( a ); } #else void i32_to_f128M( int32_t a, float128_t *zPtr ) { uint32_t *zWPtr; uint32_t uiZ96, uiZ64; bool sign; uint32_t absA; int_fast8_t shiftCount; uint64_t normAbsA; zWPtr = (uint32_t *) zPtr; uiZ96 = 0; uiZ64 = 0; if ( a ) { sign = (a < 0); absA = sign ? -(uint32_t) a : (uint32_t) a; shiftCount = softfloat_countLeadingZeros32( absA ) + 17; normAbsA = (uint64_t) absA<<shiftCount; uiZ96 = packToF128UI96( sign, 0x402E - shiftCount, normAbsA>>32 ); uiZ64 = normAbsA; } zWPtr[indexWord( 4, 3 )] = uiZ96; zWPtr[indexWord( 4, 2 )] = uiZ64; zWPtr[indexWord( 4, 1 )] = 0; zWPtr[indexWord( 4, 0 )] = 0; } #endif
{ "pile_set_name": "Github" }
--- layout: docs title: JavaScript description: Bring Bootstrap to life with our optional JavaScript plugins built on jQuery. Learn about each plugin, our data and programmatic API options, and more. group: getting-started toc: true --- ## Individual or compiled Plugins can be included individually (using Bootstrap's individual `js/dist/*.js`), or all at once using `bootstrap.js` or the minified `bootstrap.min.js` (don't include both). If you use a bundler (Webpack, Rollup...), you can use `/js/dist/*.js` files which are UMD ready. ## Dependencies Some plugins and CSS components depend on other plugins. If you include plugins individually, make sure to check for these dependencies in the docs. Also note that **all plugins depend on jQuery** (this means jQuery must be included **before** the plugin files). [Consult our `package.json`]({{ site.repo }}/blob/v{{ site.current_version }}/package.json) to see which versions of jQuery are supported. Our dropdowns, popovers and tooltips also depend on [Popper.js](https://popper.js.org/). ## Data attributes Nearly all Bootstrap plugins can be enabled and configured through HTML alone with data attributes (our preferred way of using JavaScript functionality). Be sure to **only use one set of data attributes on a single element** (e.g., you cannot trigger a tooltip and modal from the same button.) However, in some situations it may be desirable to disable this functionality. To disable the data attribute API, unbind all events on the document namespaced with `data-api` like so: {% highlight js %} $(document).off('.data-api') {% endhighlight %} Alternatively, to target a specific plugin, just include the plugin's name as a namespace along with the data-api namespace like this: {% highlight js %} $(document).off('.alert.data-api') {% endhighlight %} {% capture callout %} ## Selectors Currently to query DOM elements we use the native methods `querySelector` and `querySelectorAll` for performance reasons, so you have to use [valid selectors](https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier). If you use special selectors, for example: `collapse:Example` be sure to escape them. {% endcapture %} {% include callout.html content=callout type="warning" %} ## Events Bootstrap provides custom events for most plugins' unique actions. Generally, these come in an infinitive and past participle form - where the infinitive (ex. `show`) is triggered at the start of an event, and its past participle form (ex. `shown`) is triggered on the completion of an action. All infinitive events provide [`preventDefault()`](https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) functionality. This provides the ability to stop the execution of an action before it starts. Returning false from an event handler will also automatically call `preventDefault()`. {% highlight js %} $('#myModal').on('show.bs.modal', function (e) { if (!data) { return e.preventDefault() // stops modal from being shown } }) {% endhighlight %} ## Programmatic API We also believe you should be able to use all Bootstrap plugins purely through the JavaScript API. All public APIs are single, chainable methods, and return the collection acted upon. {% highlight js %} $('.btn.danger').button('toggle').addClass('fat') {% endhighlight %} All methods should accept an optional options object, a string which targets a particular method, or nothing (which initiates a plugin with default behavior): {% highlight js %} $('#myModal').modal() // initialized with defaults $('#myModal').modal({ keyboard: false }) // initialized with no keyboard $('#myModal').modal('show') // initializes and invokes show immediately {% endhighlight %} Each plugin also exposes its raw constructor on a `Constructor` property: `$.fn.popover.Constructor`. If you'd like to get a particular plugin instance, retrieve it directly from an element: `$('[rel="popover"]').data('popover')`. ### Asynchronous functions and transitions All programmatic API methods are **asynchronous** and return to the caller once the transition is started but **before it ends**. In order to execute an action once the transition is complete, you can listen to the corresponding event. {% highlight js %} $('#myCollapse').on('shown.bs.collapse', function (e) { // Action to execute once the collapsible area is expanded }) {% endhighlight %} In addition a method call on a **transitioning component will be ignored**. {% highlight js %} $('#myCarousel').on('slid.bs.carousel', function (e) { $('#myCarousel').carousel('2') // Will slide to the slide 2 as soon as the transition to slide 1 is finished }) $('#myCarousel').carousel('1') // Will start sliding to the slide 1 and returns to the caller $('#myCarousel').carousel('2') // !! Will be ignored, as the transition to the slide 1 is not finished !! {% endhighlight %} ### Default settings You can change the default settings for a plugin by modifying the plugin's `Constructor.Default` object: {% highlight js %} // changes default for the modal plugin's `keyboard` option to false $.fn.modal.Constructor.Default.keyboard = false {% endhighlight %} ## No conflict Sometimes it is necessary to use Bootstrap plugins with other UI frameworks. In these circumstances, namespace collisions can occasionally occur. If this happens, you may call `.noConflict` on the plugin you wish to revert the value of. {% highlight js %} var bootstrapButton = $.fn.button.noConflict() // return $.fn.button to previously assigned value $.fn.bootstrapBtn = bootstrapButton // give $().bootstrapBtn the Bootstrap functionality {% endhighlight %} ## Version numbers The version of each of Bootstrap's jQuery plugins can be accessed via the `VERSION` property of the plugin's constructor. For example, for the tooltip plugin: {% highlight js %} $.fn.tooltip.Constructor.VERSION // => "{{ site.current_version }}" {% endhighlight %} ## No special fallbacks when JavaScript is disabled Bootstrap's plugins don't fall back particularly gracefully when JavaScript is disabled. If you care about the user experience in this case, use [`<noscript>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript) to explain the situation (and how to re-enable JavaScript) to your users, and/or add your own custom fallbacks. {% capture callout %} ##### Third-party libraries **Bootstrap does not officially support third-party JavaScript libraries** like Prototype or jQuery UI. Despite `.noConflict` and namespaced events, there may be compatibility problems that you need to fix on your own. {% endcapture %} {% include callout.html content=callout type="warning" %} ## Util All Bootstrap's JavaScript files depend on `util.js` and it has to be included alongside the other JavaScript files. If you're using the compiled (or minified) `bootstrap.js`, there is no need to include this—it's already there. `util.js` includes utility functions and a basic helper for `transitionEnd` events as well as a CSS transition emulator. It's used by the other plugins to check for CSS transition support and to catch hanging transitions. ## Sanitizer Tooltips and Popovers use our built-in sanitizer to sanitize options which accept HTML. The default `whiteList` value is the following: {% highlight js %} var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i var DefaultWhitelist = { // Global attributes allowed on any supplied element below. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], a: ['target', 'href', 'title', 'rel'], area: [], b: [], br: [], col: [], code: [], div: [], em: [], hr: [], h1: [], h2: [], h3: [], h4: [], h5: [], h6: [], i: [], img: ['src', 'alt', 'title', 'width', 'height'], li: [], ol: [], p: [], pre: [], s: [], small: [], span: [], sub: [], sup: [], strong: [], u: [], ul: [] } {% endhighlight %} If you want to add new values to this default `whiteList` you can do the following: {% highlight js %} var myDefaultWhiteList = $.fn.tooltip.Constructor.Default.whiteList // To allow table elements myDefaultWhiteList.table = [] // To allow td elements and data-option attributes on td elements myDefaultWhiteList.td = ['data-option'] // You can push your custom regex to validate your attributes. // Be careful about your regular expressions being too lax var myCustomRegex = /^data-my-app-[\w-]+/ myDefaultWhiteList['*'].push(myCustomRegex) {% endhighlight %} If you want to bypass our sanitizer because you prefer to use a dedicated library, for example [DOMPurify](https://www.npmjs.com/package/dompurify), you should do the following: {% highlight js %} $('#yourTooltip').tooltip({ sanitizeFn: function (content) { return DOMPurify.sanitize(content) } }) {% endhighlight %}
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ namespace Apache.Ignite.Core.Transactions { using System; using System.Runtime.Serialization; using Apache.Ignite.Core.Common; /// <summary> /// Exception thrown whenever Ignite transactions fail optimistically. /// </summary> [Serializable] public class TransactionOptimisticException : IgniteException { /// <summary> /// Initializes a new instance of the <see cref="TransactionOptimisticException"/> class. /// </summary> public TransactionOptimisticException() { // No-op. } /// <summary> /// Initializes a new instance of the <see cref="TransactionOptimisticException"/> class. /// </summary> /// <param name="message">The message that describes the error.</param> public TransactionOptimisticException(string message) : base(message) { // No-op. } /// <summary> /// Initializes a new instance of the <see cref="TransactionOptimisticException"/> class. /// </summary> /// <param name="message">The message.</param> /// <param name="cause">The cause.</param> public TransactionOptimisticException(string message, Exception cause) : base(message, cause) { // No-op. } /// <summary> /// Initializes a new instance of the <see cref="TransactionOptimisticException"/> class. /// </summary> /// <param name="info">Serialization information.</param> /// <param name="ctx">Streaming context.</param> protected TransactionOptimisticException(SerializationInfo info, StreamingContext ctx) : base(info, ctx) { // No-op. } } }
{ "pile_set_name": "Github" }
"""Identity related views.""" from reversion import revisions as reversion from django.contrib.auth import mixins as auth_mixins from django.contrib.auth.decorators import ( login_required, permission_required, user_passes_test ) from django.shortcuts import render from django.template.loader import render_to_string from django.utils.translation import ugettext as _, ungettext from django.views import generic from django.views.decorators.csrf import ensure_csrf_cookie from modoboa.core.models import User from modoboa.lib.exceptions import BadRequest, PermDeniedException from modoboa.lib.listing import get_listing_page, get_sort_order from modoboa.lib.web_utils import render_to_json_response from .. import signals from ..forms import AccountForm, AccountWizard from ..lib import get_identities from ..models import Domain, Mailbox @login_required @user_passes_test( lambda u: u.has_perm("core.add_user") or u.has_perm("admin.add_alias") ) def _identities(request): filters = { fname: request.GET.get(fname, None) for fname in ["searchquery", "idtfilter", "grpfilter"] } request.session["identities_filters"] = filters idents_list = get_identities(request.user, **filters) sort_order, sort_dir = get_sort_order(request.GET, "identity", ["identity", "name_or_rcpt", "tags"]) if sort_order in ["identity", "name_or_rcpt"]: objects = sorted(idents_list, key=lambda o: getattr(o, sort_order), reverse=sort_dir == "-") else: objects = sorted(idents_list, key=lambda o: o.tags[0]["label"], reverse=sort_dir == "-") context = { "handle_mailboxes": request.localconfig.parameters.get_value( "handle_mailboxes", raise_exception=False) } page = get_listing_page(objects, request.GET.get("page", 1)) context["headers"] = render_to_string( "admin/identity_headers.html", {}, request) if page is None: context["length"] = 0 else: context["rows"] = render_to_string( "admin/identities_table.html", { "identities": page.object_list }, request ) context["pages"] = [page.number] return render_to_json_response(context) @login_required @permission_required("admin.add_mailbox") def list_quotas(request): from modoboa.lib.db_utils import db_type sort_order, sort_dir = get_sort_order(request.GET, "address") mboxes = Mailbox.objects.get_for_admin( request.user, request.GET.get("searchquery", None) ) mboxes = mboxes.exclude(quota=0) if sort_order in ["address", "quota"]: mboxes = mboxes.order_by("%s%s" % (sort_dir, sort_order)) elif sort_order in ("quota_value__bytes", "quota_usage"): db_type = db_type() if db_type == "mysql": where = "CONCAT(admin_mailbox.address,'@',admin_domain.name)" else: where = "admin_mailbox.address||'@'||admin_domain.name" if sort_order == "quota_value__bytes": mboxes = mboxes.extra( select={"quota_value__bytes": "admin_quota.bytes"}, where=["admin_quota.username=%s" % where], tables=["admin_quota", "admin_domain"], order_by=["%s%s" % (sort_dir, sort_order)] ) else: if db_type == "postgres": select = ( "(admin_quota.bytes::float / (CAST(admin_mailbox.quota " "AS BIGINT) * 1048576)) * 100" ) else: select = ( "(admin_quota.bytes * 1.0 / (admin_mailbox.quota " "* 1048576)) * 100" ) mboxes = mboxes.extra( select={"quota_usage": select}, where=["admin_quota.username=%s" % where], tables=["admin_quota", "admin_domain"], order_by=["%s%s" % (sort_dir, sort_order)] ) else: raise BadRequest(_("Invalid request")) page = get_listing_page(mboxes, request.GET.get("page", 1)) context = { "headers": render_to_string( "admin/identities_quota_headers.html", {}, request ) } if page is None: context["length"] = 0 else: context["rows"] = render_to_string( "admin/identities_quotas.html", {"mboxes": page}, request ) context["pages"] = [page.number] return render_to_json_response(context) @login_required @user_passes_test( lambda u: u.has_perm("core.add_user") or u.has_perm("admin.add_alias") or u.has_perm("admin.add_mailbox") ) def get_next_page(request): """Return the next page of the identity list.""" if request.GET.get("objtype", "identity") == "identity": return _identities(request) return list_quotas(request) @login_required @user_passes_test( lambda u: u.has_perm("core.add_user") or u.has_perm("admin.add_alias") ) @ensure_csrf_cookie def identities(request, tplname="admin/identities.html"): return render(request, tplname, { "selection": "identities", "deflocation": "list/" }) @login_required @permission_required("core.add_user") def accounts_list(request): accs = User.objects.filter(is_superuser=False) \ .exclude(groups__name="SimpleUsers") res = [a.username for a in accs.all()] return render_to_json_response(res) @login_required @permission_required("core.add_user") @reversion.create_revision() def newaccount(request): """Create a new account.""" return AccountWizard(request).process() @login_required @permission_required("core.change_user") @reversion.create_revision() def editaccount(request, pk): account = User.objects.get(pk=pk) if not request.user.can_access(account): raise PermDeniedException mb = account.mailbox if hasattr(account, "mailbox") else None instances = { "general": account, "profile": account, "mail": mb, "perms": account } results = signals.get_account_form_instances.send( sender="editaccount", user=request.user, account=account) for result in results: instances.update(result[1]) return AccountForm(request, instances=instances).process() @login_required @permission_required("core.delete_user") def delaccount(request, pk): User.objects.get(pk=pk).delete() return render_to_json_response( ungettext("Account deleted", "Accounts deleted", 1) ) @login_required @permission_required("admin.add_domain") def remove_permission(request): domid = request.GET.get("domid", None) daid = request.GET.get("daid", None) if domid is None or daid is None: raise BadRequest(_("Invalid request")) try: account = User.objects.get(pk=daid) domain = Domain.objects.get(pk=domid) except (User.DoesNotExist, Domain.DoesNotExist): raise BadRequest(_("Invalid request")) if not request.user.can_access(account) or \ not request.user.can_access(domain): raise PermDeniedException domain.remove_admin(account) return render_to_json_response({}) class AccountDetailView( auth_mixins.PermissionRequiredMixin, generic.DetailView): """DetailView for Account.""" model = User permission_required = "core.add_user" template_name = "admin/account_detail.html" def has_permission(self): """Check object-level access.""" result = super(AccountDetailView, self).has_permission() if not result: return result return self.request.user.can_access(self.get_object()) def get_context_data(self, **kwargs): """Add information to context.""" context = super(AccountDetailView, self).get_context_data(**kwargs) del context["user"] result = signals.extra_account_dashboard_widgets.send( self.__class__, user=self.request.user, account=self.object) context["templates"] = {"left": [], "right": []} for _receiver, widgets in result: for widget in widgets: context["templates"][widget["column"]].append( widget["template"]) context.update(widget["context"]) if self.object.role in ["Resellers", "DomainAdmins"]: context["domains"] = Domain.objects.get_for_admin(self.object) context["selection"] = "identities" return context
{ "pile_set_name": "Github" }
///<reference types="svelte" /> <></>;function render() { let b = 7; let d = 5; let e = 5; ; () => (<> <div> <slot a={b}>Hello</slot> <slot name="test" c={d} e={e}></slot> <slot name="abc-cde.113"></slot> </div></>); return { props: {}, slots: {'default': {a:b}, 'test': {c:d, e:e}, 'abc-cde.113': {}}, getters: {}, events: {} }} export default class Input__SvelteComponent_ extends createSvelte2TsxComponent(__sveltets_partial(__sveltets_with_any_event(render))) { }
{ "pile_set_name": "Github" }
1. On click -- replace `innerHTML` of the cell by `<textarea>` with same sizes and no border. Can use JavaScript or CSS to set the right size. 2. Set `textarea.value` to `td.innerHTML`. 3. Focus on the textarea. 4. Show buttons OK/CANCEL under the cell, handle clicks on them.
{ "pile_set_name": "Github" }
# Chapter 3 labs ## Lab 3-1 1. According to PEid it is packed/encrypted using "PEncrypt 3.1 Final -> junkcode". There are a bunch of readable strings: A few registry keys and application names. PEview only shows two sections: Text and Data, and only one import: ExitProcess from _kernel32.dll_. 2. I couldn't get AbateDNS to work so I used a python script (https://github.com/Crypt0s/FakeDns) to respond to all DNS requests with localhost as the address. I then set up netcat to listen on ports 80 and 443 (http and https) as suggested by the book and set up Wireshark to listen in on all traffic. Finally, I opened process explorer and procmon to see what the malware was trying to do. When I executed the malware you can see that the process is creating a new file (probably a copy of itself) to _C:\Windows\system32\vmx32to64.exe_ and it then wrote this path to the registry to autorun (HKLM/SOFTWARE/Microsoft/Windows/CurrentVersion/Run/VideoDriver). Viewing 'handles' in procmon we see it creates a mutex (mutant) named WinVMX32. 3. fakedns.py reports a periodic dns request to "www.practicalmalwareanalysis.com" and (after spoofing) connects to my netcat listening on port 443 (https). The data we receive does not look like the start of a https transfer, though, and changes every time it makes a connection. Wireshark seemed to only pick up 'raw' tcp data and it was hard to distinguish from other data. It didn't appear to have anything going localhost->localhost. ## Lab 3-2 ### Basic Static Analysis - **strings**: A bunch of imports/exports, "practicalmalwareanalysis.com", some service-related error messages, and some registry addresses. - **PEiD**: "Microsoft Visual C++ 6.0 DLL [Overlay]" - **Dependency Walker**: Exports `Install`, `ServiceMain`, `UninstallService`, `installA` and `uninstallA`. Imports a lot, including many calls from _WININET.DLL_ (Http and Internet-related), CreateService, DeleteService, CreateProcess, etc. - **PEview**: Normal sections names, date, etc. ### Basic Dynamic Analysis - Using Regshot and procmon I tracked what registry keys it would modify when run. To protect myself from it auto updating I had fakedns.py running. Since it's clearly a service that needs to be installed I installed it using _rundll32.exe._ Comparing the before and after screenshots I see it added six new keys (in HKLM\SYSTEM\ControlSet001\Services\IPRIP and HKLM\SYSTEM\CurrentControlSet\Services\IPRIP) and 20 values *point to the service dll, name, description, etc. The service appears to be called "Intranet Network Awarenes (INA+)" with a short name of IPRIP. - Once installed, I set up procmon to track svchost and started the service with `net start IPRIP` and see messages about the service starting. After some time I see a valid HTTP GET request to _practicalmalwareanalysis.com_ on port 80 (which we guessed it would be based on the HTTP methods the DLL imports. In process explorer we can find the instance of _svchost.exe_ that has loaded the malware by searching for the DLL by name. We can also easily find the PID of the svchost instance using `tasklist /svc` to see which install lists 'IPRIP' and find the PID in the column to the left. ### Questions 1. We can install this as a service with _rundll32.exe:_ `rundll32.exe Lab03-02.dll,installA` 2. We can start this service with `net start IPRIP`. We can run `msconfig` to see all installed services, and we can disable it from here, as well. 3. Running `tasklist /svc` from the cmd prompt shows all processes running services, from here we can find IPRIP and find the PID. We can also search for the DLL handle in process explorer to find any processes that have it loaded. 4. We can set a filter in process monitor to only track calls from the PID of the svchost instance that is running out instance, but this would include other services running in this same process. 5. This malware installs as a service that says the manufacturer is "Microsort Corporation" with the name "Intranet Network Awareness (INA+)" and description "Depends INA+, Collects and stores network configuration and location information, and notifies applications when this information changes.". The service is installed to "HKLM\SYSTEM\CurrentControlSet\Services\IPRIP", where it registers the dll name, location, etc. 6. This malware tries to connect to "practicalmalwareanalysis.com" on port 80 and sends a valid HTTP GET request. The User-Agent is "repc Windows XP 6.11", but in the book it is "MalwareAnalysis2 Windows XP 6.11". Turns out the first part of the User-Agent is just the global environment variable '%ComputerName%'. ## Lab 3-3 ### Basic Dynamic Analysis - Setting up procmon to watch for a process called _Lab03-03.exe_ and setting up fakedns.py to block all outgoing dns requests, I simply double clicked the file to see what it did. There are calls to read the binary itself, as well as a bunch of calls to create files such as _svchost.exe._ Looking in process explorer we see an instance of _svchost.exe_ running with no parent, but the parent PID was 3224: The same as the PID of the malware. It appears this malware is trying to replace _svchost.exe_ with its own version, but doesn't seem to replace it on disk. Viewing the properties of the process we see that the strings are very different, including references to _practicalmalwareanalysis.log_. Switching the filter on process explorer to the pid of this new svchost process we see it is writing to a file with this name. Looking at the log file it appears to be logging my keystrokes, including the process that I wrote it in and special characters, though it doesn't seem to catch special characters correctly. Although I found some weird registry entries adding on the second shot in regshot, I don't believe they are related to this keylogger, and it doesn't seem to write to any config files, so the logger shouldn't autorun. ### Questions 1. Using procmon in combination with process explorer I see that it is replacing a new instance of _svchost.exe_ in memory with a new process. The parent PID of this process is the same as the PID that the executable ran with before ending. 2. It tries to create file mappings to _svchost.exe_, which I believe may be to have the subsequent ProcessCreate call execute some malware instead. Looking at this process in memory (particularly the strings) we can see it does not match the strings in the _svchost.exe_ binary on disk. 3. The malware creates a file called _practicalmalwareanalysis.log_. 4. This program is a keylogger. It creates a process called _svchost.exe_ (but that doesn't match C:\WINDOWS\system32\svchost.exe) which logs all key presses to a file in the local directory (of the original malware) named _practicalmalwareanalysis.org_ and writes to this file all of the user's key presses, including the window in which they were focused. ## Lab 3-4 ### Basic Static Analysis - **strings**: references to 'http://www.practicalmalwareanalysys.com', '%SYSTEMROOT%\system32\', what might be commands: 'DOWNLOAD', 'UPLOAD', 'SLEEP', the start of an HTTP header: 'HTTP/1.0', etc, what look like command-line options, plus a bunch of imports. - **PEiD**: "Microsoft Visual C++ 6.0" - **Dependency Walker**: Imports a lot, including `ShellExecute`, raw socket stuff from WS2_32.DLL, Service-related imports, Registry-related imports, rw files, etc. - **PEview**: Normal looking PE other than the huge amount of imports. ### Basic Dynamic Analysis - We set ourselves up the same as before: reg shot, dns spoofing to localhost, nc on port 80, procmon and process explorer all running. When executed by double-clicking on the binary I see a lot of registry querying as well as reading a bunch of dll files. It also reads its own binary (probably to copy it somewhere). The process runs for only a fraction of a second before closing with status 0. We see it's executing cmd.exe, and if we double click the line in procmon we see that the arguments are to delete the binary itself. Other activity looks benign. ### Questions 1. Closes immediately. On subsequent runs (through cmd) it deletes itself from the disk. Every run _attempts_ to delete the file, but for some reason the attempts fail when double clicked. 2. The malware seems to detect it is not being executed correctly and is terminating immediately (plus attempting to delete the malware). 3. A few dummy tries with the command-line arguments we found in strings ('-in', '-re', '-cc') yielded nothing, but the attempt by the malware to delete itself worked in these cases.
{ "pile_set_name": "Github" }
<h2><span class="editsection">[<a href="/index.php?title=CoreModule&amp;action=edit&amp;section=14" title="Edit section: user">edit</a>]</span> <span class="mw-headline" id="user"> user </span></h2><table class="directive-ref-table"> <tbody> <tr> <td class="drt-td1"><b>Syntax:</b></td> <td class="drt-td2"> <b>user</b> <i>user</i> [ <i>group</i> ]</td> </tr> <tr> <td><b>Default:</b></td> <td> <i>nobody nobody</i></td> </tr> <tr> <td><b>Context:</b></td> <td> main</td> </tr> <tr> <td><b>Reference:</b></td> <td><a rel="nofollow" class="external text" href="http://nginx.org/en/docs/ngx_core_module.html#user">user</a></td> </tr> </tbody> </table><p> <!-- NewPP limit report Preprocessor node count: 111/1000000 Post-expand include size: 0/2097152 bytes Template argument size: 0/2097152 bytes Expensive parser function count: 0/100 --> </p><p><br /> If the master process is run as root, then nginx will setuid()/setgid() to USER/GROUP. If GROUP is not specified, then nginx uses the same name as USER. By default it's <code>nobody</code> user and <code>nobody</code> or <code>nogroup</code> group or the <code>--user=USER</code> and <code>--group=GROUP</code> from the <code>./configure</code> script. </p><p>Example: </p><div dir="ltr" class="mw-geshi" style="text-align: left;"> <div class="nginx source-nginx"> <pre class="de1"><a href="/NginxHttpCoreModule#user"><span class="kw1">user</span></a> www users<span class="sy0">;</span></pre> </div> </div><br><i>Module: CoreModule</i>
{ "pile_set_name": "Github" }
// mkerrors.sh -Wall -Werror -static -I/tmp/include // Code generated by the command above; see README.md. DO NOT EDIT. // +build ppc64le,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go package unix import "syscall" const ( B1000000 = 0x17 B115200 = 0x11 B1152000 = 0x18 B1500000 = 0x19 B2000000 = 0x1a B230400 = 0x12 B2500000 = 0x1b B3000000 = 0x1c B3500000 = 0x1d B4000000 = 0x1e B460800 = 0x13 B500000 = 0x14 B57600 = 0x10 B576000 = 0x15 B921600 = 0x16 BLKBSZGET = 0x40081270 BLKBSZSET = 0x80081271 BLKFLSBUF = 0x20001261 BLKFRAGET = 0x20001265 BLKFRASET = 0x20001264 BLKGETSIZE = 0x20001260 BLKGETSIZE64 = 0x40081272 BLKPBSZGET = 0x2000127b BLKRAGET = 0x20001263 BLKRASET = 0x20001262 BLKROGET = 0x2000125e BLKROSET = 0x2000125d BLKRRPART = 0x2000125f BLKSECTGET = 0x20001267 BLKSECTSET = 0x20001266 BLKSSZGET = 0x20001268 BOTHER = 0x1f BS1 = 0x8000 BSDLY = 0x8000 CBAUD = 0xff CBAUDEX = 0x0 CIBAUD = 0xff0000 CLOCAL = 0x8000 CR1 = 0x1000 CR2 = 0x2000 CR3 = 0x3000 CRDLY = 0x3000 CREAD = 0x800 CS6 = 0x100 CS7 = 0x200 CS8 = 0x300 CSIZE = 0x300 CSTOPB = 0x400 ECHOCTL = 0x40 ECHOE = 0x2 ECHOK = 0x4 ECHOKE = 0x1 ECHONL = 0x10 ECHOPRT = 0x20 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000000 FF1 = 0x4000 FFDLY = 0x4000 FLUSHO = 0x800000 FS_IOC_ENABLE_VERITY = 0x80806685 FS_IOC_GETFLAGS = 0x40086601 FS_IOC_GET_ENCRYPTION_POLICY = 0x800c6615 FS_IOC_GET_ENCRYPTION_PWSALT = 0x80106614 FS_IOC_SET_ENCRYPTION_POLICY = 0x400c6613 F_GETLK = 0x5 F_GETLK64 = 0xc F_GETOWN = 0x9 F_RDLCK = 0x0 F_SETLK = 0x6 F_SETLK64 = 0xd F_SETLKW = 0x7 F_SETLKW64 = 0xe F_SETOWN = 0x8 F_UNLCK = 0x2 F_WRLCK = 0x1 HUPCL = 0x4000 ICANON = 0x100 IEXTEN = 0x400 IN_CLOEXEC = 0x80000 IN_NONBLOCK = 0x800 IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x200007b9 ISIG = 0x80 IUCLC = 0x1000 IXOFF = 0x400 IXON = 0x200 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 MAP_EXECUTABLE = 0x1000 MAP_GROWSDOWN = 0x100 MAP_HUGETLB = 0x40000 MAP_LOCKED = 0x80 MAP_NONBLOCK = 0x10000 MAP_NORESERVE = 0x40 MAP_POPULATE = 0x8000 MAP_STACK = 0x20000 MAP_SYNC = 0x80000 MCL_CURRENT = 0x2000 MCL_FUTURE = 0x4000 MCL_ONFAULT = 0x8000 NFDBITS = 0x40 NL2 = 0x200 NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 NS_GET_PARENT = 0x2000b702 NS_GET_USERNS = 0x2000b701 OLCUC = 0x4 ONLCR = 0x2 O_APPEND = 0x400 O_ASYNC = 0x2000 O_CLOEXEC = 0x80000 O_CREAT = 0x40 O_DIRECT = 0x20000 O_DIRECTORY = 0x4000 O_DSYNC = 0x1000 O_EXCL = 0x80 O_FSYNC = 0x101000 O_LARGEFILE = 0x0 O_NDELAY = 0x800 O_NOATIME = 0x40000 O_NOCTTY = 0x100 O_NOFOLLOW = 0x8000 O_NONBLOCK = 0x800 O_PATH = 0x200000 O_RSYNC = 0x101000 O_SYNC = 0x101000 O_TMPFILE = 0x404000 O_TRUNC = 0x200 PARENB = 0x1000 PARODD = 0x2000 PENDIN = 0x20000000 PERF_EVENT_IOC_DISABLE = 0x20002401 PERF_EVENT_IOC_ENABLE = 0x20002400 PERF_EVENT_IOC_ID = 0x40082407 PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x8008240b PERF_EVENT_IOC_PAUSE_OUTPUT = 0x80042409 PERF_EVENT_IOC_PERIOD = 0x80082404 PERF_EVENT_IOC_QUERY_BPF = 0xc008240a PERF_EVENT_IOC_REFRESH = 0x20002402 PERF_EVENT_IOC_RESET = 0x20002403 PERF_EVENT_IOC_SET_BPF = 0x80042408 PERF_EVENT_IOC_SET_FILTER = 0x80082406 PERF_EVENT_IOC_SET_OUTPUT = 0x20002405 PPPIOCATTACH = 0x8004743d PPPIOCATTCHAN = 0x80047438 PPPIOCCONNECT = 0x8004743a PPPIOCDETACH = 0x8004743c PPPIOCDISCONN = 0x20007439 PPPIOCGASYNCMAP = 0x40047458 PPPIOCGCHAN = 0x40047437 PPPIOCGDEBUG = 0x40047441 PPPIOCGFLAGS = 0x4004745a PPPIOCGIDLE = 0x4010743f PPPIOCGIDLE32 = 0x4008743f PPPIOCGIDLE64 = 0x4010743f PPPIOCGL2TPSTATS = 0x40487436 PPPIOCGMRU = 0x40047453 PPPIOCGRASYNCMAP = 0x40047455 PPPIOCGUNIT = 0x40047456 PPPIOCGXASYNCMAP = 0x40207450 PPPIOCSACTIVE = 0x80107446 PPPIOCSASYNCMAP = 0x80047457 PPPIOCSCOMPRESS = 0x8010744d PPPIOCSDEBUG = 0x80047440 PPPIOCSFLAGS = 0x80047459 PPPIOCSMAXCID = 0x80047451 PPPIOCSMRRU = 0x8004743b PPPIOCSMRU = 0x80047452 PPPIOCSNPMODE = 0x8008744b PPPIOCSPASS = 0x80107447 PPPIOCSRASYNCMAP = 0x80047454 PPPIOCSXASYNCMAP = 0x8020744f PPPIOCXFERUNIT = 0x2000744e PROT_SAO = 0x10 PR_SET_PTRACER_ANY = 0xffffffffffffffff PTRACE_GETEVRREGS = 0x14 PTRACE_GETFPREGS = 0xe PTRACE_GETREGS64 = 0x16 PTRACE_GETVRREGS = 0x12 PTRACE_GETVSRREGS = 0x1b PTRACE_GET_DEBUGREG = 0x19 PTRACE_SETEVRREGS = 0x15 PTRACE_SETFPREGS = 0xf PTRACE_SETREGS64 = 0x17 PTRACE_SETVRREGS = 0x13 PTRACE_SETVSRREGS = 0x1c PTRACE_SET_DEBUGREG = 0x1a PTRACE_SINGLEBLOCK = 0x100 PTRACE_SYSEMU = 0x1d PTRACE_SYSEMU_SINGLESTEP = 0x1e PT_CCR = 0x26 PT_CTR = 0x23 PT_DAR = 0x29 PT_DSCR = 0x2c PT_DSISR = 0x2a PT_FPR0 = 0x30 PT_FPSCR = 0x50 PT_LNK = 0x24 PT_MSR = 0x21 PT_NIP = 0x20 PT_ORIG_R3 = 0x22 PT_R0 = 0x0 PT_R1 = 0x1 PT_R10 = 0xa PT_R11 = 0xb PT_R12 = 0xc PT_R13 = 0xd PT_R14 = 0xe PT_R15 = 0xf PT_R16 = 0x10 PT_R17 = 0x11 PT_R18 = 0x12 PT_R19 = 0x13 PT_R2 = 0x2 PT_R20 = 0x14 PT_R21 = 0x15 PT_R22 = 0x16 PT_R23 = 0x17 PT_R24 = 0x18 PT_R25 = 0x19 PT_R26 = 0x1a PT_R27 = 0x1b PT_R28 = 0x1c PT_R29 = 0x1d PT_R3 = 0x3 PT_R30 = 0x1e PT_R31 = 0x1f PT_R4 = 0x4 PT_R5 = 0x5 PT_R6 = 0x6 PT_R7 = 0x7 PT_R8 = 0x8 PT_R9 = 0x9 PT_REGS_COUNT = 0x2c PT_RESULT = 0x2b PT_SOFTE = 0x27 PT_TRAP = 0x28 PT_VR0 = 0x52 PT_VRSAVE = 0x94 PT_VSCR = 0x93 PT_VSR0 = 0x96 PT_VSR31 = 0xd4 PT_XER = 0x25 RLIMIT_AS = 0x9 RLIMIT_MEMLOCK = 0x8 RLIMIT_NOFILE = 0x7 RLIMIT_NPROC = 0x6 RLIMIT_RSS = 0x5 RNDADDENTROPY = 0x80085203 RNDADDTOENTCNT = 0x80045201 RNDCLEARPOOL = 0x20005206 RNDGETENTCNT = 0x40045200 RNDGETPOOL = 0x40085202 RNDRESEEDCRNG = 0x20005207 RNDZAPENTCNT = 0x20005204 RTC_AIE_OFF = 0x20007002 RTC_AIE_ON = 0x20007001 RTC_ALM_READ = 0x40247008 RTC_ALM_SET = 0x80247007 RTC_EPOCH_READ = 0x4008700d RTC_EPOCH_SET = 0x8008700e RTC_IRQP_READ = 0x4008700b RTC_IRQP_SET = 0x8008700c RTC_PIE_OFF = 0x20007006 RTC_PIE_ON = 0x20007005 RTC_PLL_GET = 0x40207011 RTC_PLL_SET = 0x80207012 RTC_RD_TIME = 0x40247009 RTC_SET_TIME = 0x8024700a RTC_UIE_OFF = 0x20007004 RTC_UIE_ON = 0x20007003 RTC_VL_CLR = 0x20007014 RTC_VL_READ = 0x40047013 RTC_WIE_OFF = 0x20007010 RTC_WIE_ON = 0x2000700f RTC_WKALM_RD = 0x40287010 RTC_WKALM_SET = 0x8028700f SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a SCM_TIMESTAMPNS = 0x23 SCM_TXTIME = 0x3d SCM_WIFI_STATUS = 0x29 SFD_CLOEXEC = 0x80000 SFD_NONBLOCK = 0x800 SIOCATMARK = 0x8905 SIOCGPGRP = 0x8904 SIOCGSTAMPNS_NEW = 0x40108907 SIOCGSTAMP_NEW = 0x40108906 SIOCINQ = 0x4004667f SIOCOUTQ = 0x40047473 SIOCSPGRP = 0x8902 SOCK_CLOEXEC = 0x80000 SOCK_DGRAM = 0x2 SOCK_NONBLOCK = 0x800 SOCK_STREAM = 0x1 SOL_SOCKET = 0x1 SO_ACCEPTCONN = 0x1e SO_ATTACH_BPF = 0x32 SO_ATTACH_REUSEPORT_CBPF = 0x33 SO_ATTACH_REUSEPORT_EBPF = 0x34 SO_BINDTODEVICE = 0x19 SO_BINDTOIFINDEX = 0x3e SO_BPF_EXTENSIONS = 0x30 SO_BROADCAST = 0x6 SO_BSDCOMPAT = 0xe SO_BUSY_POLL = 0x2e SO_CNX_ADVICE = 0x35 SO_COOKIE = 0x39 SO_DETACH_REUSEPORT_BPF = 0x44 SO_DOMAIN = 0x27 SO_DONTROUTE = 0x5 SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c SO_MARK = 0x24 SO_MAX_PACING_RATE = 0x2f SO_MEMINFO = 0x37 SO_NOFCS = 0x2b SO_OOBINLINE = 0xa SO_PASSCRED = 0x14 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x15 SO_PEERGROUPS = 0x3b SO_PEERSEC = 0x1f SO_PROTOCOL = 0x26 SO_RCVBUF = 0x8 SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x10 SO_RCVTIMEO = 0x12 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x12 SO_REUSEADDR = 0x2 SO_REUSEPORT = 0xf SO_RXQ_OVFL = 0x28 SO_SECURITY_AUTHENTICATION = 0x16 SO_SECURITY_ENCRYPTION_NETWORK = 0x18 SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 SO_SELECT_ERR_QUEUE = 0x2d SO_SNDBUF = 0x7 SO_SNDBUFFORCE = 0x20 SO_SNDLOWAT = 0x11 SO_SNDTIMEO = 0x13 SO_SNDTIMEO_NEW = 0x43 SO_SNDTIMEO_OLD = 0x13 SO_TIMESTAMPING = 0x25 SO_TIMESTAMPING_NEW = 0x41 SO_TIMESTAMPING_OLD = 0x25 SO_TIMESTAMPNS = 0x23 SO_TIMESTAMPNS_NEW = 0x40 SO_TIMESTAMPNS_OLD = 0x23 SO_TIMESTAMP_NEW = 0x3f SO_TXTIME = 0x3d SO_TYPE = 0x3 SO_WIFI_STATUS = 0x29 SO_ZEROCOPY = 0x3c TAB1 = 0x400 TAB2 = 0x800 TAB3 = 0xc00 TABDLY = 0xc00 TCFLSH = 0x2000741f TCGETA = 0x40147417 TCGETS = 0x402c7413 TCSAFLUSH = 0x2 TCSBRK = 0x2000741d TCSBRKP = 0x5425 TCSETA = 0x80147418 TCSETAF = 0x8014741c TCSETAW = 0x80147419 TCSETS = 0x802c7414 TCSETSF = 0x802c7416 TCSETSW = 0x802c7415 TCXONC = 0x2000741e TFD_CLOEXEC = 0x80000 TFD_NONBLOCK = 0x800 TIOCCBRK = 0x5428 TIOCCONS = 0x541d TIOCEXCL = 0x540c TIOCGDEV = 0x40045432 TIOCGETC = 0x40067412 TIOCGETD = 0x5424 TIOCGETP = 0x40067408 TIOCGEXCL = 0x40045440 TIOCGICOUNT = 0x545d TIOCGISO7816 = 0x40285442 TIOCGLCKTRMIOS = 0x5456 TIOCGLTC = 0x40067474 TIOCGPGRP = 0x40047477 TIOCGPKT = 0x40045438 TIOCGPTLCK = 0x40045439 TIOCGPTN = 0x40045430 TIOCGPTPEER = 0x20005441 TIOCGRS485 = 0x542e TIOCGSERIAL = 0x541e TIOCGSID = 0x5429 TIOCGSOFTCAR = 0x5419 TIOCGWINSZ = 0x40087468 TIOCINQ = 0x4004667f TIOCLINUX = 0x541c TIOCMBIC = 0x5417 TIOCMBIS = 0x5416 TIOCMGET = 0x5415 TIOCMIWAIT = 0x545c TIOCMSET = 0x5418 TIOCM_CAR = 0x40 TIOCM_CD = 0x40 TIOCM_CTS = 0x20 TIOCM_DSR = 0x100 TIOCM_LOOP = 0x8000 TIOCM_OUT1 = 0x2000 TIOCM_OUT2 = 0x4000 TIOCM_RI = 0x80 TIOCM_RNG = 0x80 TIOCM_SR = 0x10 TIOCM_ST = 0x8 TIOCNOTTY = 0x5422 TIOCNXCL = 0x540d TIOCOUTQ = 0x40047473 TIOCPKT = 0x5420 TIOCSBRK = 0x5427 TIOCSCTTY = 0x540e TIOCSERCONFIG = 0x5453 TIOCSERGETLSR = 0x5459 TIOCSERGETMULTI = 0x545a TIOCSERGSTRUCT = 0x5458 TIOCSERGWILD = 0x5454 TIOCSERSETMULTI = 0x545b TIOCSERSWILD = 0x5455 TIOCSER_TEMT = 0x1 TIOCSETC = 0x80067411 TIOCSETD = 0x5423 TIOCSETN = 0x8006740a TIOCSETP = 0x80067409 TIOCSIG = 0x80045436 TIOCSISO7816 = 0xc0285443 TIOCSLCKTRMIOS = 0x5457 TIOCSLTC = 0x80067475 TIOCSPGRP = 0x80047476 TIOCSPTLCK = 0x80045431 TIOCSRS485 = 0x542f TIOCSSERIAL = 0x541f TIOCSSOFTCAR = 0x541a TIOCSTART = 0x2000746e TIOCSTI = 0x5412 TIOCSTOP = 0x2000746f TIOCSWINSZ = 0x80087467 TIOCVHANGUP = 0x5437 TOSTOP = 0x400000 TUNATTACHFILTER = 0x801054d5 TUNDETACHFILTER = 0x801054d6 TUNGETDEVNETNS = 0x200054e3 TUNGETFEATURES = 0x400454cf TUNGETFILTER = 0x401054db TUNGETIFF = 0x400454d2 TUNGETSNDBUF = 0x400454d3 TUNGETVNETBE = 0x400454df TUNGETVNETHDRSZ = 0x400454d7 TUNGETVNETLE = 0x400454dd TUNSETCARRIER = 0x800454e2 TUNSETDEBUG = 0x800454c9 TUNSETFILTEREBPF = 0x400454e1 TUNSETGROUP = 0x800454ce TUNSETIFF = 0x800454ca TUNSETIFINDEX = 0x800454da TUNSETLINK = 0x800454cd TUNSETNOCSUM = 0x800454c8 TUNSETOFFLOAD = 0x800454d0 TUNSETOWNER = 0x800454cc TUNSETPERSIST = 0x800454cb TUNSETQUEUE = 0x800454d9 TUNSETSNDBUF = 0x800454d4 TUNSETSTEERINGEBPF = 0x400454e0 TUNSETTXFILTER = 0x800454d1 TUNSETVNETBE = 0x800454de TUNSETVNETHDRSZ = 0x800454d8 TUNSETVNETLE = 0x800454dc UBI_IOCATT = 0x80186f40 UBI_IOCDET = 0x80046f41 UBI_IOCEBCH = 0x80044f02 UBI_IOCEBER = 0x80044f01 UBI_IOCEBISMAP = 0x40044f05 UBI_IOCEBMAP = 0x80084f03 UBI_IOCEBUNMAP = 0x80044f04 UBI_IOCMKVOL = 0x80986f00 UBI_IOCRMVOL = 0x80046f01 UBI_IOCRNVOL = 0x91106f03 UBI_IOCRPEB = 0x80046f04 UBI_IOCRSVOL = 0x800c6f02 UBI_IOCSETVOLPROP = 0x80104f06 UBI_IOCSPEB = 0x80046f05 UBI_IOCVOLCRBLK = 0x80804f07 UBI_IOCVOLRMBLK = 0x20004f08 UBI_IOCVOLUP = 0x80084f00 VDISCARD = 0x10 VEOF = 0x4 VEOL = 0x6 VEOL2 = 0x8 VMIN = 0x5 VREPRINT = 0xb VSTART = 0xd VSTOP = 0xe VSUSP = 0xc VSWTC = 0x9 VT1 = 0x10000 VTDLY = 0x10000 VTIME = 0x7 VWERASE = 0xa WDIOC_GETBOOTSTATUS = 0x40045702 WDIOC_GETPRETIMEOUT = 0x40045709 WDIOC_GETSTATUS = 0x40045701 WDIOC_GETSUPPORT = 0x40285700 WDIOC_GETTEMP = 0x40045703 WDIOC_GETTIMELEFT = 0x4004570a WDIOC_GETTIMEOUT = 0x40045707 WDIOC_KEEPALIVE = 0x40045705 WDIOC_SETOPTIONS = 0x40045704 WORDSIZE = 0x40 XCASE = 0x4000 XTABS = 0xc00 ) // Errors const ( EADDRINUSE = syscall.Errno(0x62) EADDRNOTAVAIL = syscall.Errno(0x63) EADV = syscall.Errno(0x44) EAFNOSUPPORT = syscall.Errno(0x61) EALREADY = syscall.Errno(0x72) EBADE = syscall.Errno(0x34) EBADFD = syscall.Errno(0x4d) EBADMSG = syscall.Errno(0x4a) EBADR = syscall.Errno(0x35) EBADRQC = syscall.Errno(0x38) EBADSLT = syscall.Errno(0x39) EBFONT = syscall.Errno(0x3b) ECANCELED = syscall.Errno(0x7d) ECHRNG = syscall.Errno(0x2c) ECOMM = syscall.Errno(0x46) ECONNABORTED = syscall.Errno(0x67) ECONNREFUSED = syscall.Errno(0x6f) ECONNRESET = syscall.Errno(0x68) EDEADLK = syscall.Errno(0x23) EDEADLOCK = syscall.Errno(0x3a) EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) EIDRM = syscall.Errno(0x2b) EILSEQ = syscall.Errno(0x54) EINPROGRESS = syscall.Errno(0x73) EISCONN = syscall.Errno(0x6a) EISNAM = syscall.Errno(0x78) EKEYEXPIRED = syscall.Errno(0x7f) EKEYREJECTED = syscall.Errno(0x81) EKEYREVOKED = syscall.Errno(0x80) EL2HLT = syscall.Errno(0x33) EL2NSYNC = syscall.Errno(0x2d) EL3HLT = syscall.Errno(0x2e) EL3RST = syscall.Errno(0x2f) ELIBACC = syscall.Errno(0x4f) ELIBBAD = syscall.Errno(0x50) ELIBEXEC = syscall.Errno(0x53) ELIBMAX = syscall.Errno(0x52) ELIBSCN = syscall.Errno(0x51) ELNRNG = syscall.Errno(0x30) ELOOP = syscall.Errno(0x28) EMEDIUMTYPE = syscall.Errno(0x7c) EMSGSIZE = syscall.Errno(0x5a) EMULTIHOP = syscall.Errno(0x48) ENAMETOOLONG = syscall.Errno(0x24) ENAVAIL = syscall.Errno(0x77) ENETDOWN = syscall.Errno(0x64) ENETRESET = syscall.Errno(0x66) ENETUNREACH = syscall.Errno(0x65) ENOANO = syscall.Errno(0x37) ENOBUFS = syscall.Errno(0x69) ENOCSI = syscall.Errno(0x32) ENODATA = syscall.Errno(0x3d) ENOKEY = syscall.Errno(0x7e) ENOLCK = syscall.Errno(0x25) ENOLINK = syscall.Errno(0x43) ENOMEDIUM = syscall.Errno(0x7b) ENOMSG = syscall.Errno(0x2a) ENONET = syscall.Errno(0x40) ENOPKG = syscall.Errno(0x41) ENOPROTOOPT = syscall.Errno(0x5c) ENOSR = syscall.Errno(0x3f) ENOSTR = syscall.Errno(0x3c) ENOSYS = syscall.Errno(0x26) ENOTCONN = syscall.Errno(0x6b) ENOTEMPTY = syscall.Errno(0x27) ENOTNAM = syscall.Errno(0x76) ENOTRECOVERABLE = syscall.Errno(0x83) ENOTSOCK = syscall.Errno(0x58) ENOTSUP = syscall.Errno(0x5f) ENOTUNIQ = syscall.Errno(0x4c) EOPNOTSUPP = syscall.Errno(0x5f) EOVERFLOW = syscall.Errno(0x4b) EOWNERDEAD = syscall.Errno(0x82) EPFNOSUPPORT = syscall.Errno(0x60) EPROTO = syscall.Errno(0x47) EPROTONOSUPPORT = syscall.Errno(0x5d) EPROTOTYPE = syscall.Errno(0x5b) EREMCHG = syscall.Errno(0x4e) EREMOTE = syscall.Errno(0x42) EREMOTEIO = syscall.Errno(0x79) ERESTART = syscall.Errno(0x55) ERFKILL = syscall.Errno(0x84) ESHUTDOWN = syscall.Errno(0x6c) ESOCKTNOSUPPORT = syscall.Errno(0x5e) ESRMNT = syscall.Errno(0x45) ESTALE = syscall.Errno(0x74) ESTRPIPE = syscall.Errno(0x56) ETIME = syscall.Errno(0x3e) ETIMEDOUT = syscall.Errno(0x6e) ETOOMANYREFS = syscall.Errno(0x6d) EUCLEAN = syscall.Errno(0x75) EUNATCH = syscall.Errno(0x31) EUSERS = syscall.Errno(0x57) EXFULL = syscall.Errno(0x36) ) // Signals const ( SIGBUS = syscall.Signal(0x7) SIGCHLD = syscall.Signal(0x11) SIGCLD = syscall.Signal(0x11) SIGCONT = syscall.Signal(0x12) SIGIO = syscall.Signal(0x1d) SIGPOLL = syscall.Signal(0x1d) SIGPROF = syscall.Signal(0x1b) SIGPWR = syscall.Signal(0x1e) SIGSTKFLT = syscall.Signal(0x10) SIGSTOP = syscall.Signal(0x13) SIGSYS = syscall.Signal(0x1f) SIGTSTP = syscall.Signal(0x14) SIGTTIN = syscall.Signal(0x15) SIGTTOU = syscall.Signal(0x16) SIGURG = syscall.Signal(0x17) SIGUSR1 = syscall.Signal(0xa) SIGUSR2 = syscall.Signal(0xc) SIGVTALRM = syscall.Signal(0x1a) SIGWINCH = syscall.Signal(0x1c) SIGXCPU = syscall.Signal(0x18) SIGXFSZ = syscall.Signal(0x19) ) // Error table var errorList = [...]struct { num syscall.Errno name string desc string }{ {1, "EPERM", "operation not permitted"}, {2, "ENOENT", "no such file or directory"}, {3, "ESRCH", "no such process"}, {4, "EINTR", "interrupted system call"}, {5, "EIO", "input/output error"}, {6, "ENXIO", "no such device or address"}, {7, "E2BIG", "argument list too long"}, {8, "ENOEXEC", "exec format error"}, {9, "EBADF", "bad file descriptor"}, {10, "ECHILD", "no child processes"}, {11, "EAGAIN", "resource temporarily unavailable"}, {12, "ENOMEM", "cannot allocate memory"}, {13, "EACCES", "permission denied"}, {14, "EFAULT", "bad address"}, {15, "ENOTBLK", "block device required"}, {16, "EBUSY", "device or resource busy"}, {17, "EEXIST", "file exists"}, {18, "EXDEV", "invalid cross-device link"}, {19, "ENODEV", "no such device"}, {20, "ENOTDIR", "not a directory"}, {21, "EISDIR", "is a directory"}, {22, "EINVAL", "invalid argument"}, {23, "ENFILE", "too many open files in system"}, {24, "EMFILE", "too many open files"}, {25, "ENOTTY", "inappropriate ioctl for device"}, {26, "ETXTBSY", "text file busy"}, {27, "EFBIG", "file too large"}, {28, "ENOSPC", "no space left on device"}, {29, "ESPIPE", "illegal seek"}, {30, "EROFS", "read-only file system"}, {31, "EMLINK", "too many links"}, {32, "EPIPE", "broken pipe"}, {33, "EDOM", "numerical argument out of domain"}, {34, "ERANGE", "numerical result out of range"}, {35, "EDEADLK", "resource deadlock avoided"}, {36, "ENAMETOOLONG", "file name too long"}, {37, "ENOLCK", "no locks available"}, {38, "ENOSYS", "function not implemented"}, {39, "ENOTEMPTY", "directory not empty"}, {40, "ELOOP", "too many levels of symbolic links"}, {42, "ENOMSG", "no message of desired type"}, {43, "EIDRM", "identifier removed"}, {44, "ECHRNG", "channel number out of range"}, {45, "EL2NSYNC", "level 2 not synchronized"}, {46, "EL3HLT", "level 3 halted"}, {47, "EL3RST", "level 3 reset"}, {48, "ELNRNG", "link number out of range"}, {49, "EUNATCH", "protocol driver not attached"}, {50, "ENOCSI", "no CSI structure available"}, {51, "EL2HLT", "level 2 halted"}, {52, "EBADE", "invalid exchange"}, {53, "EBADR", "invalid request descriptor"}, {54, "EXFULL", "exchange full"}, {55, "ENOANO", "no anode"}, {56, "EBADRQC", "invalid request code"}, {57, "EBADSLT", "invalid slot"}, {58, "EDEADLOCK", "file locking deadlock error"}, {59, "EBFONT", "bad font file format"}, {60, "ENOSTR", "device not a stream"}, {61, "ENODATA", "no data available"}, {62, "ETIME", "timer expired"}, {63, "ENOSR", "out of streams resources"}, {64, "ENONET", "machine is not on the network"}, {65, "ENOPKG", "package not installed"}, {66, "EREMOTE", "object is remote"}, {67, "ENOLINK", "link has been severed"}, {68, "EADV", "advertise error"}, {69, "ESRMNT", "srmount error"}, {70, "ECOMM", "communication error on send"}, {71, "EPROTO", "protocol error"}, {72, "EMULTIHOP", "multihop attempted"}, {73, "EDOTDOT", "RFS specific error"}, {74, "EBADMSG", "bad message"}, {75, "EOVERFLOW", "value too large for defined data type"}, {76, "ENOTUNIQ", "name not unique on network"}, {77, "EBADFD", "file descriptor in bad state"}, {78, "EREMCHG", "remote address changed"}, {79, "ELIBACC", "can not access a needed shared library"}, {80, "ELIBBAD", "accessing a corrupted shared library"}, {81, "ELIBSCN", ".lib section in a.out corrupted"}, {82, "ELIBMAX", "attempting to link in too many shared libraries"}, {83, "ELIBEXEC", "cannot exec a shared library directly"}, {84, "EILSEQ", "invalid or incomplete multibyte or wide character"}, {85, "ERESTART", "interrupted system call should be restarted"}, {86, "ESTRPIPE", "streams pipe error"}, {87, "EUSERS", "too many users"}, {88, "ENOTSOCK", "socket operation on non-socket"}, {89, "EDESTADDRREQ", "destination address required"}, {90, "EMSGSIZE", "message too long"}, {91, "EPROTOTYPE", "protocol wrong type for socket"}, {92, "ENOPROTOOPT", "protocol not available"}, {93, "EPROTONOSUPPORT", "protocol not supported"}, {94, "ESOCKTNOSUPPORT", "socket type not supported"}, {95, "ENOTSUP", "operation not supported"}, {96, "EPFNOSUPPORT", "protocol family not supported"}, {97, "EAFNOSUPPORT", "address family not supported by protocol"}, {98, "EADDRINUSE", "address already in use"}, {99, "EADDRNOTAVAIL", "cannot assign requested address"}, {100, "ENETDOWN", "network is down"}, {101, "ENETUNREACH", "network is unreachable"}, {102, "ENETRESET", "network dropped connection on reset"}, {103, "ECONNABORTED", "software caused connection abort"}, {104, "ECONNRESET", "connection reset by peer"}, {105, "ENOBUFS", "no buffer space available"}, {106, "EISCONN", "transport endpoint is already connected"}, {107, "ENOTCONN", "transport endpoint is not connected"}, {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"}, {109, "ETOOMANYREFS", "too many references: cannot splice"}, {110, "ETIMEDOUT", "connection timed out"}, {111, "ECONNREFUSED", "connection refused"}, {112, "EHOSTDOWN", "host is down"}, {113, "EHOSTUNREACH", "no route to host"}, {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, {117, "EUCLEAN", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, {121, "EREMOTEIO", "remote I/O error"}, {122, "EDQUOT", "disk quota exceeded"}, {123, "ENOMEDIUM", "no medium found"}, {124, "EMEDIUMTYPE", "wrong medium type"}, {125, "ECANCELED", "operation canceled"}, {126, "ENOKEY", "required key not available"}, {127, "EKEYEXPIRED", "key has expired"}, {128, "EKEYREVOKED", "key has been revoked"}, {129, "EKEYREJECTED", "key was rejected by service"}, {130, "EOWNERDEAD", "owner died"}, {131, "ENOTRECOVERABLE", "state not recoverable"}, {132, "ERFKILL", "operation not possible due to RF-kill"}, {133, "EHWPOISON", "memory page has hardware error"}, } // Signal table var signalList = [...]struct { num syscall.Signal name string desc string }{ {1, "SIGHUP", "hangup"}, {2, "SIGINT", "interrupt"}, {3, "SIGQUIT", "quit"}, {4, "SIGILL", "illegal instruction"}, {5, "SIGTRAP", "trace/breakpoint trap"}, {6, "SIGABRT", "aborted"}, {7, "SIGBUS", "bus error"}, {8, "SIGFPE", "floating point exception"}, {9, "SIGKILL", "killed"}, {10, "SIGUSR1", "user defined signal 1"}, {11, "SIGSEGV", "segmentation fault"}, {12, "SIGUSR2", "user defined signal 2"}, {13, "SIGPIPE", "broken pipe"}, {14, "SIGALRM", "alarm clock"}, {15, "SIGTERM", "terminated"}, {16, "SIGSTKFLT", "stack fault"}, {17, "SIGCHLD", "child exited"}, {18, "SIGCONT", "continued"}, {19, "SIGSTOP", "stopped (signal)"}, {20, "SIGTSTP", "stopped"}, {21, "SIGTTIN", "stopped (tty input)"}, {22, "SIGTTOU", "stopped (tty output)"}, {23, "SIGURG", "urgent I/O condition"}, {24, "SIGXCPU", "CPU time limit exceeded"}, {25, "SIGXFSZ", "file size limit exceeded"}, {26, "SIGVTALRM", "virtual timer expired"}, {27, "SIGPROF", "profiling timer expired"}, {28, "SIGWINCH", "window changed"}, {29, "SIGIO", "I/O possible"}, {30, "SIGPWR", "power failure"}, {31, "SIGSYS", "bad system call"}, }
{ "pile_set_name": "Github" }
from packaging.tags import Tag from poetry.core.packages.utils.link import Link from poetry.installation.chef import Chef from poetry.utils._compat import Path from poetry.utils.env import MockEnv def test_get_cached_archive_for_link(config, mocker): chef = Chef( config, MockEnv( version_info=(3, 8, 3), marker_env={"interpreter_name": "cpython", "interpreter_version": "3.8.3"}, supported_tags=[ Tag("cp38", "cp38", "macosx_10_15_x86_64"), Tag("py3", "none", "any"), ], ), ) mocker.patch.object( chef, "get_cached_archives_for_link", return_value=[ Link("file:///foo/demo-0.1.0-py2.py3-none-any"), Link("file:///foo/demo-0.1.0.tar.gz"), Link("file:///foo/demo-0.1.0-cp38-cp38-macosx_10_15_x86_64.whl"), Link("file:///foo/demo-0.1.0-cp37-cp37-macosx_10_15_x86_64.whl"), ], ) archive = chef.get_cached_archive_for_link( Link("https://files.python-poetry.org/demo-0.1.0.tar.gz") ) assert Link("file:///foo/demo-0.1.0-cp38-cp38-macosx_10_15_x86_64.whl") == archive def test_get_cached_archives_for_link(config, mocker): chef = Chef( config, MockEnv( marker_env={"interpreter_name": "cpython", "interpreter_version": "3.8.3"} ), ) distributions = Path(__file__).parent.parent.joinpath("fixtures/distributions") mocker.patch.object( chef, "get_cache_directory_for_link", return_value=distributions, ) archives = chef.get_cached_archives_for_link( Link("https://files.python-poetry.org/demo-0.1.0.tar.gz") ) assert archives assert set(archives) == { Link(path.as_uri()) for path in distributions.glob("demo-0.1.0*") } def test_get_cache_directory_for_link(config): chef = Chef( config, MockEnv( marker_env={"interpreter_name": "cpython", "interpreter_version": "3.8.3"} ), ) directory = chef.get_cache_directory_for_link( Link("https://files.python-poetry.org/poetry-1.1.0.tar.gz") ) expected = Path( "/foo/artifacts/ba/63/13/283a3b3b7f95f05e9e6f84182d276f7bb0951d5b0cc24422b33f7a4648" ) assert expected == directory
{ "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>com.apple.developer.siri</key> <true/> <key>com.apple.security.application-groups</key> <array> <string>group.com.example.apple-samplecode.Payments</string> </array> </dict> </plist>
{ "pile_set_name": "Github" }
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build linux // +build ppc64le ppc64 // +build !gccgo package unix import "syscall" func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { return syscall.Syscall(trap, a1, a2, a3) } func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) } func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { return syscall.RawSyscall(trap, a1, a2, a3) } func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) }
{ "pile_set_name": "Github" }
// // RHDownstreamBuffer.m // Example // // Created by zhuruhong on 2019/9/8. // Copyright © 2019年 zhuruhong. All rights reserved. // #import "RHDownstreamBuffer.h" @implementation RHDownstreamBuffer - (instancetype)init { self = [super init]; if (self) { _dataBuffer = [[NSMutableData alloc] init]; _maxBufferSize = 8192; } return self; } - (void)appendReceiveData:(NSData *)receiveData decode:(RHDownstreamBufferDecode)decodeCallback overflow:(RHDownstreamBufferOverflow)overflowCallback { if (receiveData.length == 0) { return; } if (nil == decodeCallback) { #ifdef DEBUG NSAssert(YES, @"[Error]: downstream buffer decodeCallback is nil :("); #endif return; } @synchronized (self) { [self.dataBuffer appendData:receiveData]; NSInteger decodedLength = 0; if (decodeCallback) { decodedLength = decodeCallback(self.dataBuffer); } if (decodedLength > 0) { NSRange remainRange = NSMakeRange(decodedLength, self.dataBuffer.length - decodedLength); NSData *remainData = [self.dataBuffer subdataWithRange:remainRange]; [self.dataBuffer setData:remainData]; } if (overflowCallback && self.dataBuffer.length > self.maxBufferSize) { overflowCallback(self); } } } @end
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 0762b2157086f9f43a3345a2afec412f timeCreated: 1433120444 licenseType: Store MonoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
{ "name": "unimodules-barcode-scanner-interface", "version": "5.3.0", "description": "An interface for bar code scanners", "main": "index.js", "keywords": [ "barcode-scanner", "barcode", "unimodules" ], "repository": { "type": "git", "url": "https://github.com/expo/expo.git", "directory": "packages/unimodules-barcode-scanner-interface" }, "bugs": { "url": "https://github.com/expo/expo/issues" }, "author": "650 Industries, Inc.", "license": "MIT", "homepage": "https://github.com/expo/expo/tree/master/packages/unimodules-barcode-scanner-interface" }
{ "pile_set_name": "Github" }
/************************************************************************************************* * Common symbols for command line utilities * Copyright (C) 2009-2012 FAL Labs * This file is part of Kyoto Tycoon. * 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 * 3 of the License, or 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/>. *************************************************************************************************/ #ifndef _CMDCOMMON_H // duplication check #define _CMDCOMMON_H #include <ktcommon.h> #include <ktutil.h> #include <ktsocket.h> #include <ktthserv.h> #include <kthttp.h> #include <ktrpc.h> #include <ktulog.h> #include <ktshlib.h> #include <kttimeddb.h> #include <ktdbext.h> #include <ktremotedb.h> #include <ktplugserv.h> #include <ktplugdb.h> #include "myscript.h" namespace kc = kyotocabinet; namespace kt = kyototycoon; // constants const int32_t OPENDBMAX = 200; // maximum number of open databases const int32_t THREADMAX = 64; // maximum number of threads const size_t RECBUFSIZ = 64; // buffer size for a record const size_t RECBUFSIZL = 1024; // buffer size for a long record const size_t LINEBUFSIZ = 8192; // buffer size for a line const double DEFTOUT = 30; // default networking timeout const int32_t DEFTHNUM = 16; // default number of threads const double DEFRIV = 0.04; // default interval of replication const int64_t DEFULIM = 256LL << 20; // default limit size of update log file const double DEFBGSI = 180; // default interval of background saver const char* const BGSPATHEXT = "ktss"; // extension of a snapshot file // global variables uint64_t g_rnd_x = 123456789; uint64_t g_rnd_y = 362436069; uint64_t g_rnd_z = 521288629; uint64_t g_rnd_w = 88675123; // function prototypes void mysrand(int64_t seed); int64_t myrand(int64_t range); int64_t memusage(); void oprintf(const char* format, ...); void oputchar(char c); void eprintf(const char* format, ...); void printversion(); void printdata(const char* buf, int32_t size, bool px); bool mygetline(std::istream* is, std::string* str); std::string unitnumstr(int64_t num); std::string unitnumstrbyte(int64_t num); kt::RPCServer::Logger* stdlogger(const char* prefix, std::ostream* strm); kc::BasicDB::Logger* stddblogger(const char* prefix, std::ostream* strm); void printdb(kc::BasicDB* db, bool px = false); // checker to show progress by printing dots class DotChecker : public kc::BasicDB::ProgressChecker { public: explicit DotChecker(std::ostream* strm, int64_t freq) : strm_(strm), freq_(freq), cnt_(0) {} int64_t count() { return cnt_; } private: bool check(const char* name, const char* message, int64_t curcnt, int64_t allcnt) { if (std::strcmp(message, "processing") || freq_ == 0) return true; if (freq_ < 0) { cnt_++; if (cnt_ % -freq_ == 0) { oputchar('.'); if (cnt_ % (-freq_ * 50) == 0) oprintf(" (%lld)\n", (long long)cnt_); } } else { if (curcnt > cnt_) { cnt_ = curcnt; if (cnt_ % freq_ == 0) { oputchar('.'); if (cnt_ % (freq_ * 50) == 0) oprintf(" (%lld)\n", (long long)cnt_); } } } return true; } std::ostream* strm_; int64_t freq_; int64_t cnt_; }; // update logger for timed database. class DBUpdateLogger : public kt::TimedDB::UpdateTrigger { public: explicit DBUpdateLogger() : ulog_(NULL), sid_(0), dbid_(0), rsid_(), tran_(false), trlock_(), trcache_() {} void initialize(kt::UpdateLogger* ulog, uint16_t sid, uint16_t dbid) { ulog_ = ulog; sid_ = sid; dbid_ = dbid; } void trigger(const char* mbuf, size_t msiz) { int32_t rsid = (int32_t)(intptr_t)rsid_.get(); uint16_t sid = rsid == 0 ? sid_ : (uint16_t)(rsid - 1); size_t nsiz = sizeof(sid) + sizeof(dbid_) + msiz; char* nbuf = new char[nsiz]; char* wp = nbuf; kc::writefixnum(wp, sid, sizeof(sid)); wp += sizeof(sid); kc::writefixnum(wp, dbid_, sizeof(dbid_)); wp += sizeof(dbid_); std::memcpy(wp, mbuf, msiz); if (tran_) { trlock_.lock(); trcache_.push_back(std::string(nbuf, nsiz)); delete[] nbuf; trlock_.unlock(); } else { ulog_->write_volatile(nbuf, nsiz); } } void begin_transaction() { tran_ = true; } void end_transaction(bool commit) { if (commit && !trcache_.empty()) ulog_->write_bulk(trcache_); trcache_.clear(); tran_ = false; } void set_rsid(uint16_t sid) { rsid_.set((void*)(intptr_t)(sid + 1)); } void clear_rsid() { rsid_.set(0); } static const char* parse(const char* mbuf, size_t msiz, size_t* sp, uint16_t* sidp, uint16_t* dbidp) { if (msiz < sizeof(uint16_t) + sizeof(uint16_t)) return NULL; const char* rp = mbuf; *sidp = kc::readfixnum(rp, sizeof(uint16_t)); rp += sizeof(uint16_t); *dbidp = kc::readfixnum(rp, sizeof(uint16_t)); rp += sizeof(uint16_t); *sp = msiz - sizeof(uint16_t) - sizeof(uint16_t); return rp; } private: kt::UpdateLogger* ulog_; uint16_t sid_; uint16_t dbid_; kc::TSDKey rsid_; bool tran_; kc::SpinLock trlock_; std::vector<std::string> trcache_; }; // get the random seed inline void mysrand(int64_t seed) { g_rnd_x = seed; for (int32_t i = 0; i < 16; i++) { myrand(1); } } // get a random number inline int64_t myrand(int64_t range) { uint64_t t = g_rnd_x ^ (g_rnd_x << 11); g_rnd_x = g_rnd_y; g_rnd_y = g_rnd_z; g_rnd_z = g_rnd_w; g_rnd_w = (g_rnd_w ^ (g_rnd_w >> 19)) ^ (t ^ (t >> 8)); return (g_rnd_w & kc::INT64MAX) % range; } // get the current memory usage inline int64_t memusage() { std::map<std::string, std::string> info; kc::getsysinfo(&info); return kc::atoi(info["mem_rss"].c_str()); } // print formatted information string and flush the buffer inline void oprintf(const char* format, ...) { std::string msg; va_list ap; va_start(ap, format); kc::vstrprintf(&msg, format, ap); va_end(ap); std::cout << msg; std::cout.flush(); } // print a character and flush the buffer inline void oputchar(char c) { std::cout << c; std::cout.flush(); } // print formatted error string and flush the buffer inline void eprintf(const char* format, ...) { std::string msg; va_list ap; va_start(ap, format); kc::vstrprintf(&msg, format, ap); va_end(ap); std::cerr << msg; std::cerr.flush(); } // print the versin information inline void printversion() { oprintf("Kyoto Tycoon %s (%d.%d) on %s (Kyoto Cabinet %s)\n", kt::VERSION, kt::LIBVER, kt::LIBREV, kc::OSNAME, kc::VERSION); } // print record data inline void printdata(const char* buf, int32_t size, bool px) { size_t cnt = 0; char numbuf[kc::NUMBUFSIZ]; while (size-- > 0) { if (px) { if (cnt++ > 0) putchar(' '); std::sprintf(numbuf, "%02X", *(unsigned char*)buf); std::cout << numbuf; } else { std::cout << *buf; } buf++; } } // read a line from a file descriptor inline bool mygetline(std::istream* is, std::string* str) { str->clear(); bool hit = false; char c; while (is->get(c)) { hit = true; if (c == '\0' || c == '\r') continue; if (c == '\n') break; str->append(1, c); } return hit; } // convert a number into the string with the decimal unit inline std::string unitnumstr(int64_t num) { if (num >= std::pow(1000.0, 6)) { return kc::strprintf("%.3Lf quintillion", (long double)num / std::pow(1000.0, 6)); } else if (num >= std::pow(1000.0, 5)) { return kc::strprintf("%.3Lf quadrillion", (long double)num / std::pow(1000.0, 5)); } else if (num >= std::pow(1000.0, 4)) { return kc::strprintf("%.3Lf trillion", (long double)num / std::pow(1000.0, 4)); } else if (num >= std::pow(1000.0, 3)) { return kc::strprintf("%.3Lf billion", (long double)num / std::pow(1000.0, 3)); } else if (num >= std::pow(1000.0, 2)) { return kc::strprintf("%.3Lf million", (long double)num / std::pow(1000.0, 2)); } else if (num >= std::pow(1000.0, 1)) { return kc::strprintf("%.3Lf thousand", (long double)num / std::pow(1000.0, 1)); } return kc::strprintf("%lld", (long long)num); } // convert a number into the string with the byte unit inline std::string unitnumstrbyte(int64_t num) { if ((unsigned long long)num >= 1ULL << 60) { return kc::strprintf("%.3Lf EiB", (long double)num / (1ULL << 60)); } else if ((unsigned long long)num >= 1ULL << 50) { return kc::strprintf("%.3Lf PiB", (long double)num / (1ULL << 50)); } else if ((unsigned long long)num >= 1ULL << 40) { return kc::strprintf("%.3Lf TiB", (long double)num / (1ULL << 40)); } else if ((unsigned long long)num >= 1ULL << 30) { return kc::strprintf("%.3Lf GiB", (long double)num / (1ULL << 30)); } else if ((unsigned long long)num >= 1ULL << 20) { return kc::strprintf("%.3Lf MiB", (long double)num / (1ULL << 20)); } else if ((unsigned long long)num >= 1ULL << 10) { return kc::strprintf("%.3Lf KiB", (long double)num / (1ULL << 10)); } return kc::strprintf("%lld B", (long long)num); } // get the logger into the standard stream inline kt::RPCServer::Logger* stdlogger(const char* prefix, std::ostream* strm) { class LoggerImpl : public kt::RPCServer::Logger { public: explicit LoggerImpl(std::ostream* strm, const char* prefix) : strm_(strm), prefix_(prefix) {} void log(Kind kind, const char* message) { const char* kstr = "MISC"; switch (kind) { case kt::RPCServer::Logger::DEBUG: kstr = "DEBUG"; break; case kt::RPCServer::Logger::INFO: kstr = "INFO"; break; case kt::RPCServer::Logger::SYSTEM: kstr = "SYSTEM"; break; case kt::RPCServer::Logger::ERROR: kstr = "ERROR"; break; } *strm_ << prefix_ << ": [" << kstr << "]: " << message << std::endl; } private: std::ostream* strm_; const char* prefix_; }; static LoggerImpl logger(strm, prefix); return &logger; } // get the database logger into the standard stream inline kc::BasicDB::Logger* stddblogger(const char* prefix, std::ostream* strm) { class LoggerImpl : public kc::BasicDB::Logger { public: explicit LoggerImpl(std::ostream* strm, const char* prefix) : strm_(strm), prefix_(prefix) {} void log(const char* file, int32_t line, const char* func, Kind kind, const char* message) { const char* kstr = "MISC"; switch (kind) { case kc::BasicDB::Logger::DEBUG: kstr = "DEBUG"; break; case kc::BasicDB::Logger::INFO: kstr = "INFO"; break; case kc::BasicDB::Logger::WARN: kstr = "WARN"; break; case kc::BasicDB::Logger::ERROR: kstr = "ERROR"; break; } *strm_ << prefix_ << ": [" << kstr << "]: " << file << ": " << line << ": " << func << ": " << message << std::endl; } private: std::ostream* strm_; const char* prefix_; }; static LoggerImpl logger(strm, prefix); return &logger; } // print all record of a database inline void printdb(kc::BasicDB* db, bool px) { class Printer : public kc::DB::Visitor { public: explicit Printer(bool px) : px_(px) {} private: const char* visit_full(const char* kbuf, size_t ksiz, const char* vbuf, size_t vsiz, size_t* sp) { printdata(kbuf, ksiz, px_); oputchar('\t'); printdata(vbuf, vsiz, px_); oputchar('\n'); return NOP; } bool px_; } printer(px); db->iterate(&printer, false); } #endif // duplication check // END OF FILE
{ "pile_set_name": "Github" }
source: relations.py # Serializer relations > Bad programmers worry about the code. > Good programmers worry about data structures and their relationships. > > &mdash; [Linus Torvalds][cite] Relational fields are used to represent model relationships. They can be applied to `ForeignKey`, `ManyToManyField` and `OneToOneField` relationships, as well as to reverse relationships, and custom relationships such as `GenericForeignKey`. --- **Note:** The relational fields are declared in `relations.py`, but by convention you should import them from the `serializers` module, using `from rest_framework import serializers` and refer to fields as `serializers.<FieldName>`. --- #### Inspecting relationships. When using the `ModelSerializer` class, serializer fields and relationships will be automatically generated for you. Inspecting these automatically generated fields can be a useful tool for determining how to customize the relationship style. To do so, open the Django shell, using `python manage.py shell`, then import the serializer class, instantiate it, and print the object representation… >>> from myapp.serializers import AccountSerializer >>> serializer = AccountSerializer() >>> print repr(serializer) # Or `print(repr(serializer))` in Python 3.x. AccountSerializer(): id = IntegerField(label='ID', read_only=True) name = CharField(allow_blank=True, max_length=100, required=False) owner = PrimaryKeyRelatedField(queryset=User.objects.all()) # API Reference In order to explain the various types of relational fields, we'll use a couple of simple models for our examples. Our models will be for music albums, and the tracks listed on each album. class Album(models.Model): album_name = models.CharField(max_length=100) artist = models.CharField(max_length=100) class Track(models.Model): album = models.ForeignKey(Album, related_name='tracks', on_delete=models.CASCADE) order = models.IntegerField() title = models.CharField(max_length=100) duration = models.IntegerField() class Meta: unique_together = ('album', 'order') ordering = ['order'] def __unicode__(self): return '%d: %s' % (self.order, self.title) ## StringRelatedField `StringRelatedField` may be used to represent the target of the relationship using its `__unicode__` method. For example, the following serializer. class AlbumSerializer(serializers.ModelSerializer): tracks = serializers.StringRelatedField(many=True) class Meta: model = Album fields = ('album_name', 'artist', 'tracks') Would serialize to the following representation. { 'album_name': 'Things We Lost In The Fire', 'artist': 'Low', 'tracks': [ '1: Sunflower', '2: Whitetail', '3: Dinosaur Act', ... ] } This field is read only. **Arguments**: * `many` - If applied to a to-many relationship, you should set this argument to `True`. ## PrimaryKeyRelatedField `PrimaryKeyRelatedField` may be used to represent the target of the relationship using its primary key. For example, the following serializer: class AlbumSerializer(serializers.ModelSerializer): tracks = serializers.PrimaryKeyRelatedField(many=True, read_only=True) class Meta: model = Album fields = ('album_name', 'artist', 'tracks') Would serialize to a representation like this: { 'album_name': 'Undun', 'artist': 'The Roots', 'tracks': [ 89, 90, 91, ... ] } By default this field is read-write, although you can change this behavior using the `read_only` flag. **Arguments**: * `queryset` - The queryset used for model instance lookups when validating the field input. Relationships must either set a queryset explicitly, or set `read_only=True`. * `many` - If applied to a to-many relationship, you should set this argument to `True`. * `allow_null` - If set to `True`, the field will accept values of `None` or the empty string for nullable relationships. Defaults to `False`. * `pk_field` - Set to a field to control serialization/deserialization of the primary key's value. For example, `pk_field=UUIDField(format='hex')` would serialize a UUID primary key into its compact hex representation. ## HyperlinkedRelatedField `HyperlinkedRelatedField` may be used to represent the target of the relationship using a hyperlink. For example, the following serializer: class AlbumSerializer(serializers.ModelSerializer): tracks = serializers.HyperlinkedRelatedField( many=True, read_only=True, view_name='track-detail' ) class Meta: model = Album fields = ('album_name', 'artist', 'tracks') Would serialize to a representation like this: { 'album_name': 'Graceland', 'artist': 'Paul Simon', 'tracks': [ 'http://www.example.com/api/tracks/45/', 'http://www.example.com/api/tracks/46/', 'http://www.example.com/api/tracks/47/', ... ] } By default this field is read-write, although you can change this behavior using the `read_only` flag. --- **Note**: This field is designed for objects that map to a URL that accepts a single URL keyword argument, as set using the `lookup_field` and `lookup_url_kwarg` arguments. This is suitable for URLs that contain a single primary key or slug argument as part of the URL. If you require more complex hyperlinked representation you'll need to customize the field, as described in the [custom hyperlinked fields](#custom-hyperlinked-fields) section, below. --- **Arguments**: * `view_name` - The view name that should be used as the target of the relationship. If you're using [the standard router classes][routers] this will be a string with the format `<modelname>-detail`. **required**. * `queryset` - The queryset used for model instance lookups when validating the field input. Relationships must either set a queryset explicitly, or set `read_only=True`. * `many` - If applied to a to-many relationship, you should set this argument to `True`. * `allow_null` - If set to `True`, the field will accept values of `None` or the empty string for nullable relationships. Defaults to `False`. * `lookup_field` - The field on the target that should be used for the lookup. Should correspond to a URL keyword argument on the referenced view. Default is `'pk'`. * `lookup_url_kwarg` - The name of the keyword argument defined in the URL conf that corresponds to the lookup field. Defaults to using the same value as `lookup_field`. * `format` - If using format suffixes, hyperlinked fields will use the same format suffix for the target unless overridden by using the `format` argument. ## SlugRelatedField `SlugRelatedField` may be used to represent the target of the relationship using a field on the target. For example, the following serializer: class AlbumSerializer(serializers.ModelSerializer): tracks = serializers.SlugRelatedField( many=True, read_only=True, slug_field='title' ) class Meta: model = Album fields = ('album_name', 'artist', 'tracks') Would serialize to a representation like this: { 'album_name': 'Dear John', 'artist': 'Loney Dear', 'tracks': [ 'Airport Surroundings', 'Everything Turns to You', 'I Was Only Going Out', ... ] } By default this field is read-write, although you can change this behavior using the `read_only` flag. When using `SlugRelatedField` as a read-write field, you will normally want to ensure that the slug field corresponds to a model field with `unique=True`. **Arguments**: * `slug_field` - The field on the target that should be used to represent it. This should be a field that uniquely identifies any given instance. For example, `username`. **required** * `queryset` - The queryset used for model instance lookups when validating the field input. Relationships must either set a queryset explicitly, or set `read_only=True`. * `many` - If applied to a to-many relationship, you should set this argument to `True`. * `allow_null` - If set to `True`, the field will accept values of `None` or the empty string for nullable relationships. Defaults to `False`. ## HyperlinkedIdentityField This field can be applied as an identity relationship, such as the `'url'` field on a HyperlinkedModelSerializer. It can also be used for an attribute on the object. For example, the following serializer: class AlbumSerializer(serializers.HyperlinkedModelSerializer): track_listing = serializers.HyperlinkedIdentityField(view_name='track-list') class Meta: model = Album fields = ('album_name', 'artist', 'track_listing') Would serialize to a representation like this: { 'album_name': 'The Eraser', 'artist': 'Thom Yorke', 'track_listing': 'http://www.example.com/api/track_list/12/', } This field is always read-only. **Arguments**: * `view_name` - The view name that should be used as the target of the relationship. If you're using [the standard router classes][routers] this will be a string with the format `<model_name>-detail`. **required**. * `lookup_field` - The field on the target that should be used for the lookup. Should correspond to a URL keyword argument on the referenced view. Default is `'pk'`. * `lookup_url_kwarg` - The name of the keyword argument defined in the URL conf that corresponds to the lookup field. Defaults to using the same value as `lookup_field`. * `format` - If using format suffixes, hyperlinked fields will use the same format suffix for the target unless overridden by using the `format` argument. --- # Nested relationships Nested relationships can be expressed by using serializers as fields. If the field is used to represent a to-many relationship, you should add the `many=True` flag to the serializer field. ## Example For example, the following serializer: class TrackSerializer(serializers.ModelSerializer): class Meta: model = Track fields = ('order', 'title', 'duration') class AlbumSerializer(serializers.ModelSerializer): tracks = TrackSerializer(many=True, read_only=True) class Meta: model = Album fields = ('album_name', 'artist', 'tracks') Would serialize to a nested representation like this: >>> album = Album.objects.create(album_name="The Grey Album", artist='Danger Mouse') >>> Track.objects.create(album=album, order=1, title='Public Service Announcement', duration=245) <Track: Track object> >>> Track.objects.create(album=album, order=2, title='What More Can I Say', duration=264) <Track: Track object> >>> Track.objects.create(album=album, order=3, title='Encore', duration=159) <Track: Track object> >>> serializer = AlbumSerializer(instance=album) >>> serializer.data { 'album_name': 'The Grey Album', 'artist': 'Danger Mouse', 'tracks': [ {'order': 1, 'title': 'Public Service Announcement', 'duration': 245}, {'order': 2, 'title': 'What More Can I Say', 'duration': 264}, {'order': 3, 'title': 'Encore', 'duration': 159}, ... ], } ## Writable nested serializers By default nested serializers are read-only. If you want to support write-operations to a nested serializer field you'll need to create `create()` and/or `update()` methods in order to explicitly specify how the child relationships should be saved. class TrackSerializer(serializers.ModelSerializer): class Meta: model = Track fields = ('order', 'title', 'duration') class AlbumSerializer(serializers.ModelSerializer): tracks = TrackSerializer(many=True) class Meta: model = Album fields = ('album_name', 'artist', 'tracks') def create(self, validated_data): tracks_data = validated_data.pop('tracks') album = Album.objects.create(**validated_data) for track_data in tracks_data: Track.objects.create(album=album, **track_data) return album >>> data = { 'album_name': 'The Grey Album', 'artist': 'Danger Mouse', 'tracks': [ {'order': 1, 'title': 'Public Service Announcement', 'duration': 245}, {'order': 2, 'title': 'What More Can I Say', 'duration': 264}, {'order': 3, 'title': 'Encore', 'duration': 159}, ], } >>> serializer = AlbumSerializer(data=data) >>> serializer.is_valid() True >>> serializer.save() <Album: Album object> --- # Custom relational fields In rare cases where none of the existing relational styles fit the representation you need, you can implement a completely custom relational field, that describes exactly how the output representation should be generated from the model instance. To implement a custom relational field, you should override `RelatedField`, and implement the `.to_representation(self, value)` method. This method takes the target of the field as the `value` argument, and should return the representation that should be used to serialize the target. The `value` argument will typically be a model instance. If you want to implement a read-write relational field, you must also implement the `.to_internal_value(self, data)` method. To provide a dynamic queryset based on the `context`, you can also override `.get_queryset(self)` instead of specifying `.queryset` on the class or when initializing the field. ## Example For example, we could define a relational field to serialize a track to a custom string representation, using its ordering, title, and duration. import time class TrackListingField(serializers.RelatedField): def to_representation(self, value): duration = time.strftime('%M:%S', time.gmtime(value.duration)) return 'Track %d: %s (%s)' % (value.order, value.name, duration) class AlbumSerializer(serializers.ModelSerializer): tracks = TrackListingField(many=True) class Meta: model = Album fields = ('album_name', 'artist', 'tracks') This custom field would then serialize to the following representation. { 'album_name': 'Sometimes I Wish We Were an Eagle', 'artist': 'Bill Callahan', 'tracks': [ 'Track 1: Jim Cain (04:39)', 'Track 2: Eid Ma Clack Shaw (04:19)', 'Track 3: The Wind and the Dove (04:34)', ... ] } --- # Custom hyperlinked fields In some cases you may need to customize the behavior of a hyperlinked field, in order to represent URLs that require more than a single lookup field. You can achieve this by overriding `HyperlinkedRelatedField`. There are two methods that may be overridden: **get_url(self, obj, view_name, request, format)** The `get_url` method is used to map the object instance to its URL representation. May raise a `NoReverseMatch` if the `view_name` and `lookup_field` attributes are not configured to correctly match the URL conf. **get_object(self, queryset, view_name, view_args, view_kwargs)** If you want to support a writable hyperlinked field then you'll also want to override `get_object`, in order to map incoming URLs back to the object they represent. For read-only hyperlinked fields there is no need to override this method. The return value of this method should the object that corresponds to the matched URL conf arguments. May raise an `ObjectDoesNotExist` exception. ## Example Say we have a URL for a customer object that takes two keyword arguments, like so: /api/<organization_slug>/customers/<customer_pk>/ This cannot be represented with the default implementation, which accepts only a single lookup field. In this case we'd need to override `HyperlinkedRelatedField` to get the behavior we want: from rest_framework import serializers from rest_framework.reverse import reverse class CustomerHyperlink(serializers.HyperlinkedRelatedField): # We define these as class attributes, so we don't need to pass them as arguments. view_name = 'customer-detail' queryset = Customer.objects.all() def get_url(self, obj, view_name, request, format): url_kwargs = { 'organization_slug': obj.organization.slug, 'customer_pk': obj.pk } return reverse(view_name, kwargs=url_kwargs, request=request, format=format) def get_object(self, view_name, view_args, view_kwargs): lookup_kwargs = { 'organization__slug': view_kwargs['organization_slug'], 'pk': view_kwargs['customer_pk'] } return self.get_queryset().get(**lookup_kwargs) Note that if you wanted to use this style together with the generic views then you'd also need to override `.get_object` on the view in order to get the correct lookup behavior. Generally we recommend a flat style for API representations where possible, but the nested URL style can also be reasonable when used in moderation. --- # Further notes ## The `queryset` argument The `queryset` argument is only ever required for *writable* relationship field, in which case it is used for performing the model instance lookup, that maps from the primitive user input, into a model instance. In version 2.x a serializer class could *sometimes* automatically determine the `queryset` argument *if* a `ModelSerializer` class was being used. This behavior is now replaced with *always* using an explicit `queryset` argument for writable relational fields. Doing so reduces the amount of hidden 'magic' that `ModelSerializer` provides, makes the behavior of the field more clear, and ensures that it is trivial to move between using the `ModelSerializer` shortcut, or using fully explicit `Serializer` classes. ## Customizing the HTML display The built-in `__str__` method of the model will be used to generate string representations of the objects used to populate the `choices` property. These choices are used to populate select HTML inputs in the browsable API. To provide customized representations for such inputs, override `display_value()` of a `RelatedField` subclass. This method will receive a model object, and should return a string suitable for representing it. For example: class TrackPrimaryKeyRelatedField(serializers.PrimaryKeyRelatedField): def display_value(self, instance): return 'Track: %s' % (instance.title) ## Select field cutoffs When rendered in the browsable API relational fields will default to only displaying a maximum of 1000 selectable items. If more items are present then a disabled option with "More than 1000 items…" will be displayed. This behavior is intended to prevent a template from being unable to render in an acceptable timespan due to a very large number of relationships being displayed. There are two keyword arguments you can use to control this behavior: - `html_cutoff` - If set this will be the maximum number of choices that will be displayed by a HTML select drop down. Set to `None` to disable any limiting. Defaults to `1000`. - `html_cutoff_text` - If set this will display a textual indicator if the maximum number of items have been cutoff in an HTML select drop down. Defaults to `"More than {count} items…"` You can also control these globally using the settings `HTML_SELECT_CUTOFF` and `HTML_SELECT_CUTOFF_TEXT`. In cases where the cutoff is being enforced you may want to instead use a plain input field in the HTML form. You can do so using the `style` keyword argument. For example: assigned_to = serializers.SlugRelatedField( queryset=User.objects.all(), slug_field='username', style={'base_template': 'input.html'} ) ## Reverse relations Note that reverse relationships are not automatically included by the `ModelSerializer` and `HyperlinkedModelSerializer` classes. To include a reverse relationship, you must explicitly add it to the fields list. For example: class AlbumSerializer(serializers.ModelSerializer): class Meta: fields = ('tracks', ...) You'll normally want to ensure that you've set an appropriate `related_name` argument on the relationship, that you can use as the field name. For example: class Track(models.Model): album = models.ForeignKey(Album, related_name='tracks', on_delete=models.CASCADE) ... If you have not set a related name for the reverse relationship, you'll need to use the automatically generated related name in the `fields` argument. For example: class AlbumSerializer(serializers.ModelSerializer): class Meta: fields = ('track_set', ...) See the Django documentation on [reverse relationships][reverse-relationships] for more details. ## Generic relationships If you want to serialize a generic foreign key, you need to define a custom field, to determine explicitly how you want to serialize the targets of the relationship. For example, given the following model for a tag, which has a generic relationship with other arbitrary models: class TaggedItem(models.Model): """ Tags arbitrary model instances using a generic relation. See: https://docs.djangoproject.com/en/stable/ref/contrib/contenttypes/ """ tag_name = models.SlugField() content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) object_id = models.PositiveIntegerField() tagged_object = GenericForeignKey('content_type', 'object_id') def __unicode__(self): return self.tag_name And the following two models, which may have associated tags: class Bookmark(models.Model): """ A bookmark consists of a URL, and 0 or more descriptive tags. """ url = models.URLField() tags = GenericRelation(TaggedItem) class Note(models.Model): """ A note consists of some text, and 0 or more descriptive tags. """ text = models.CharField(max_length=1000) tags = GenericRelation(TaggedItem) We could define a custom field that could be used to serialize tagged instances, using the type of each instance to determine how it should be serialized. class TaggedObjectRelatedField(serializers.RelatedField): """ A custom field to use for the `tagged_object` generic relationship. """ def to_representation(self, value): """ Serialize tagged objects to a simple textual representation. """ if isinstance(value, Bookmark): return 'Bookmark: ' + value.url elif isinstance(value, Note): return 'Note: ' + value.text raise Exception('Unexpected type of tagged object') If you need the target of the relationship to have a nested representation, you can use the required serializers inside the `.to_representation()` method: def to_representation(self, value): """ Serialize bookmark instances using a bookmark serializer, and note instances using a note serializer. """ if isinstance(value, Bookmark): serializer = BookmarkSerializer(value) elif isinstance(value, Note): serializer = NoteSerializer(value) else: raise Exception('Unexpected type of tagged object') return serializer.data Note that reverse generic keys, expressed using the `GenericRelation` field, can be serialized using the regular relational field types, since the type of the target in the relationship is always known. For more information see [the Django documentation on generic relations][generic-relations]. ## ManyToManyFields with a Through Model By default, relational fields that target a ``ManyToManyField`` with a ``through`` model specified are set to read-only. If you explicitly specify a relational field pointing to a ``ManyToManyField`` with a through model, be sure to set ``read_only`` to ``True``. --- # Third Party Packages The following third party packages are also available. ## DRF Nested Routers The [drf-nested-routers package][drf-nested-routers] provides routers and relationship fields for working with nested resources. ## Rest Framework Generic Relations The [rest-framework-generic-relations][drf-nested-relations] library provides read/write serialization for generic foreign keys. [cite]: http://lwn.net/Articles/193245/ [reverse-relationships]: https://docs.djangoproject.com/en/stable/topics/db/queries/#following-relationships-backward [routers]: http://www.django-rest-framework.org/api-guide/routers#defaultrouter [generic-relations]: https://docs.djangoproject.com/en/stable/ref/contrib/contenttypes/#id1 [2.2-announcement]: ../topics/2.2-announcement.md [drf-nested-routers]: https://github.com/alanjds/drf-nested-routers [drf-nested-relations]: https://github.com/Ian-Foote/rest-framework-generic-relations
{ "pile_set_name": "Github" }
(function(angular) { 'use strict'; angular.module('scopeExample', []) .controller('GreetController', ['$scope', '$rootScope', function($scope, $rootScope) { $scope.name = 'World'; $rootScope.department = 'Angular'; }]) .controller('ListController', ['$scope', function($scope) { $scope.names = ['Igor', 'Misko', 'Vojta']; }]); })(window.angular);
{ "pile_set_name": "Github" }
/* Copyright James E. King III, 2017 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef MSGPACK_PREDEF_PLAT_WINDOWS_SYSTEM_H #define MSGPACK_PREDEF_PLAT_WINDOWS_SYSTEM_H #include <msgpack/predef/make.h> #include <msgpack/predef/os/windows.h> #include <msgpack/predef/platform/windows_uwp.h> #include <msgpack/predef/version_number.h> /*` [heading `MSGPACK_PLAT_WINDOWS_SYSTEM`] [@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP] for Windows System development. [table [[__predef_symbol__] [__predef_version__]] [[`WINAPI_FAMILY == WINAPI_FAMILY_SYSTEM`] [__predef_detection__]] ] */ #define MSGPACK_PLAT_WINDOWS_SYSTEM MSGPACK_VERSION_NUMBER_NOT_AVAILABLE #if MSGPACK_OS_WINDOWS && \ defined(WINAPI_FAMILY_SYSTEM) && WINAPI_FAMILY == WINAPI_FAMILY_SYSTEM # undef MSGPACK_PLAT_WINDOWS_SYSTEM # define MSGPACK_PLAT_WINDOWS_SYSTEM MSGPACK_VERSION_NUMBER_AVAILABLE #endif #if MSGPACK_PLAT_WINDOWS_SYSTEM # define MSGPACK_PLAT_WINDOWS_SYSTEM_AVAILABLE # include <msgpack/predef/detail/platform_detected.h> #endif #define MSGPACK_PLAT_WINDOWS_SYSTEM_NAME "Windows Drivers and Tools" #endif #include <msgpack/predef/detail/test.h> MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_PLAT_WINDOWS_SYSTEM,MSGPACK_PLAT_WINDOWS_SYSTEM_NAME)
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <thing:thing-descriptions bindingId="tradfri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0" xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd"> <bridge-type id="gateway"> <label>TRÅDFRI Gateway</label> <description>IKEA TRÅDFRI IP Gateway</description> <config-description-ref uri="bridge-type:tradfri:gateway" /> </bridge-type> <!-- thing types for devices --> <!-- their IDs refer to the Zigbee Lightlink device ids (see chapter 2.2 in https://www.nxp.com/documents/user_manual/JN-UG-3091.pdf) --> <thing-type id="0010"> <supported-bridge-type-refs> <bridge-type-ref id="gateway" /> </supported-bridge-type-refs> <label>On/Off Plug</label> <description>A plug that can be switched on and off.</description> <channels> <channel id="power" typeId="system.power" /> </channels> <representation-property>id</representation-property> <config-description-ref uri="thing-type:tradfri:device" /> </thing-type> <thing-type id="0100"> <supported-bridge-type-refs> <bridge-type-ref id="gateway" /> </supported-bridge-type-refs> <label>Dimmable Light</label> <description>A light that has continuous brightness control.</description> <channels> <channel id="brightness" typeId="brightness" /> </channels> <representation-property>id</representation-property> <config-description-ref uri="thing-type:tradfri:device" /> </thing-type> <thing-type id="0220"> <supported-bridge-type-refs> <bridge-type-ref id="gateway" /> </supported-bridge-type-refs> <label>Color Temperature Light</label> <description>A dimmable light that supports different color temperature settings.</description> <channels> <channel id="brightness" typeId="brightness" /> <channel id="color_temperature" typeId="color_temperature" /> </channels> <representation-property>id</representation-property> <config-description-ref uri="thing-type:tradfri:device" /> </thing-type> <thing-type id="0210"> <supported-bridge-type-refs> <bridge-type-ref id="gateway" /> </supported-bridge-type-refs> <label>Color Light</label> <description>A dimmable light that supports full colors and color temperature settings.</description> <channels> <channel id="color_temperature" typeId="color_temperature" /> <channel id="color" typeId="color" /> </channels> <representation-property>id</representation-property> <config-description-ref uri="thing-type:tradfri:device" /> </thing-type> <thing-type id="0107"> <supported-bridge-type-refs> <bridge-type-ref id="gateway" /> </supported-bridge-type-refs> <label>Occupancy Sensor</label> <description>This represents the motion sensor capable of reporting the battery level.</description> <channels> <channel id="battery_level" typeId="system.battery-level" /> <channel id="battery_low" typeId="system.low-battery" /> </channels> <representation-property>id</representation-property> <config-description-ref uri="thing-type:tradfri:device" /> </thing-type> <thing-type id="0820" listed="false"> <supported-bridge-type-refs> <bridge-type-ref id="gateway" /> </supported-bridge-type-refs> <label>Non-Colour Controller</label> <description>This represents the wireless dimmer sensor capable of reporting the battery level.</description> <channels> <channel id="battery_level" typeId="system.battery-level" /> <channel id="battery_low" typeId="system.low-battery" /> </channels> <representation-property>id</representation-property> <config-description-ref uri="thing-type:tradfri:device" /> </thing-type> <thing-type id="0830"> <supported-bridge-type-refs> <bridge-type-ref id="gateway" /> </supported-bridge-type-refs> <label>Non-Colour Scene Controller</label> <description>This represents the remote control capable of reporting the battery level.</description> <channels> <channel id="battery_level" typeId="system.battery-level" /> <channel id="battery_low" typeId="system.low-battery" /> </channels> <representation-property>id</representation-property> <config-description-ref uri="thing-type:tradfri:device" /> </thing-type> <channel-type id="brightness"> <item-type>Dimmer</item-type> <label>Brightness</label> <description>Control the brightness and switch the light on and off.</description> <category>DimmableLight</category> <tags> <tag>Lighting</tag> </tags> </channel-type> <channel-type id="color_temperature"> <item-type>Dimmer</item-type> <label>Color Temperature</label> <description>Control the color temperature of the light.</description> <category>ColorLight</category> </channel-type> <channel-type id="color"> <item-type>Color</item-type> <label>Color</label> <description>Control the color of the light.</description> <category>ColorLight</category> </channel-type> </thing:thing-descriptions>
{ "pile_set_name": "Github" }
var fs = require('fs') var zlib = require('zlib') var strs = require('stringstream') var utf8Stream = fs.createReadStream('massiveLogFile.gz') .pipe(zlib.createGunzip()) .pipe(strs('utf8')) utf8Stream.pipe(process.stdout) // Stream from utf8 to hex to base64... Why not, ay. var hex64Stream = fs.createReadStream('myFile') .pipe(strs('utf8', 'hex')) .pipe(strs('hex', 'base64')) hex64Stream.pipe(process.stdout) // Deals with base64 correctly by aligning chunks var stream = fs.createReadStream('myFile').pipe(strs('base64')) var base64Str = '' stream.on('data', function(data) { base64Str += data }) stream.on('end', function() { console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding() console.log('Original file is: ' + new Buffer(base64Str, 'base64')) })
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8" ?> <!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> <hosts> <host name="localhost"> <alias>host1</alias> <alias>host2</alias> <alias>host3</alias> </host> </hosts>
{ "pile_set_name": "Github" }
<div class="footer-attr"> Champion.gg isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc. </div> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-64942437-1', 'auto'); ga('send', 'pageview'); </script> <script> ga('create', 'UA-45985961-1', 'solomidnetwork.com'); ga('send', 'pageview'); </script> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> </div> <!-- Quantcast Tag --> <script type="text/javascript"> var _qevents = _qevents || []; (function() { var elem = document.createElement('script'); elem.src = (document.location.protocol == "https:" ? "https://secure" : "http://edge") + ".quantserve.com/quant.js"; elem.async = true; elem.type = "text/javascript"; var scpt = document.getElementsByTagName('script')[0]; scpt.parentNode.insertBefore(elem, scpt); })(); _qevents.push({ qacct:"p-gZzLr0R4qLK_S" }); </script> <noscript> <div style="display:none;"> <img src="//pixel.quantserve.com/pixel/p-gZzLr0R4qLK_S.gif" border="0" height="1" width="1" alt="Quantcast"/> </div> </noscript> <!-- End Quantcast tag --> </body> </html> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> [].forEach.call(document.querySelectorAll('.adsbygoogle'), function(){ (adsbygoogle = window.adsbygoogle || []).push({}); }); </script>
{ "pile_set_name": "Github" }
/* * Copyright 2014 Effektif GmbH. * * 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.effektif.example.cli.command; import java.io.PrintWriter; import com.effektif.workflow.api.Configuration; /** * Outputs a list of commands. */ public class HelpCommand implements CommandImpl { @Override public void execute(CommandLine command, Configuration configuration, PrintWriter out) { out.println("Commands:"); out.println(" complete [ID] Completes a task (task ID)"); out.println(" help List commands"); out.println(" start [ID] Start a workflow (workflow ID)"); out.println(" tasks List open tasks for all workflows"); out.println(" task [ID] Show task details (task ID)"); out.println(" workflows List deployed workflows"); out.println(" quit Exit command line"); out.println(""); } }
{ "pile_set_name": "Github" }
/* * Copyright 2002-2019 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.test.context.junit4.spr9604; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.transaction.AfterTransaction; import org.springframework.test.context.transaction.BeforeTransaction; import org.springframework.tests.transaction.CallCountingTransactionManager; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.TransactionManagementConfigurer; import org.springframework.transaction.annotation.Transactional; import static org.junit.Assert.assertEquals; /** * Integration tests that verify the behavior requested in * <a href="https://jira.spring.io/browse/SPR-9604">SPR-9604</a>. * * @author Sam Brannen * @since 3.2 */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration @Transactional public class LookUpTxMgrViaTransactionManagementConfigurerTests { private static final CallCountingTransactionManager txManager1 = new CallCountingTransactionManager(); private static final CallCountingTransactionManager txManager2 = new CallCountingTransactionManager(); @Configuration static class Config implements TransactionManagementConfigurer { @Override public PlatformTransactionManager annotationDrivenTransactionManager() { return txManager1(); } @Bean public PlatformTransactionManager txManager1() { return txManager1; } @Bean public PlatformTransactionManager txManager2() { return txManager2; } } @BeforeTransaction public void beforeTransaction() { txManager1.clear(); txManager2.clear(); } @Test public void transactionalTest() { assertEquals(1, txManager1.begun); assertEquals(1, txManager1.inflight); assertEquals(0, txManager1.commits); assertEquals(0, txManager1.rollbacks); assertEquals(0, txManager2.begun); assertEquals(0, txManager2.inflight); assertEquals(0, txManager2.commits); assertEquals(0, txManager2.rollbacks); } @AfterTransaction public void afterTransaction() { assertEquals(1, txManager1.begun); assertEquals(0, txManager1.inflight); assertEquals(0, txManager1.commits); assertEquals(1, txManager1.rollbacks); assertEquals(0, txManager2.begun); assertEquals(0, txManager2.inflight); assertEquals(0, txManager2.commits); assertEquals(0, txManager2.rollbacks); } }
{ "pile_set_name": "Github" }
/**************************************************************************/ /* */ /* WWIV Version 5.x */ /* Copyright (C)2014-2020, WWIV Software Services */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ /* You may obtain a copy of the License at */ /* */ /* http://www.apache.org/licenses/LICENSE-2.0 */ /* */ /* Unless required by applicable law or agreed to in writing, */ /* software distributed under the License is distributed on an */ /* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, */ /* either express or implied. See the License for the specific */ /* language governing permissions and limitations under the License. */ /**************************************************************************/ #ifndef __INCLUDED_NETORKB_CONFIG_EXCEPTIONS_H__ #define __INCLUDED_NETORKB_CONFIG_EXCEPTIONS_H__ #include <exception> #include <stdexcept> namespace wwiv { namespace net { struct config_error : public std::runtime_error { config_error(const std::string& message) : std::runtime_error(message) {} }; } // namespace net } // namespace wwiv #endif // __INCLUDED_NETORKB_CONFIG_EXCEPTIONS_H__
{ "pile_set_name": "Github" }
// Library // -------- // Model. Stores settings for a given asset library type, e.g. a local file // directory or an Amazon S3 bucket. model = Backbone.Model.extend(); model.prototype.schema = { 'type': 'object', 'properties': { 'id': { 'type': 'string', 'required': true }, 'location': { 'type': 'string', 'description': 'Current working dir or URL location.' }, 'assets': { 'type': 'array', 'description': 'Objects in this library.', 'items': { 'type': 'object', 'properties': { 'name': { 'type': 'string', 'description': 'Human readable name of this asset.' }, 'location': { 'type': 'string', 'description': 'Asset changes the Library\'s location.' }, 'uri': { 'type': 'string', 'description': 'URI of this asset.' } } } } } }; model.prototype.url = function() { var url = '/api/Library/' + this.id; if (!Bones.server && this.get('location') && this.get('project')) { url += '?' + $.param({location:this.get('location'), project:this.get('project')}); } return url; }; model.prototype.initialize = function(attributes, options) { options = options || {}; if (options.location) this.set({'location': options.location, project:options.project}); };
{ "pile_set_name": "Github" }
// Matching enum E0 { E0_Val0 = 'a', E0_Val1 = (17), E0_Val2 = (1 << 2), E0_Val3 = E0_Val2, E0_Val4 = sizeof(int*), E0_Val5 = (unsigned int)-1 };
{ "pile_set_name": "Github" }
import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { ReactiveFormsModule } from '@angular/forms'; import { StockInventoryComponent } from './containers/stock-inventory/stock-inventory.component'; @NgModule({ declarations: [ StockInventoryComponent ], imports: [ CommonModule, ReactiveFormsModule ], exports: [ StockInventoryComponent ] }) export class StockInventoryModule {}
{ "pile_set_name": "Github" }
subroutine testprogram call sumseries(4) call sumseries(20) return end subroutine sumseries(ni) real, dimension (:), allocatable :: xs real sum allocate(xs(1:ni),stat=ierr) xs(ni) = 200 return end
{ "pile_set_name": "Github" }
/* spew out a thoroughly gigantic file designed so that bzip2 can compress it reasonably rapidly. This is to help test support for large files (> 2GB) in a reasonable amount of time. I suggest you use the undocumented --exponential option to bzip2 when compressing the resulting file; this saves a bit of time. Note: *don't* bother with --exponential when compressing Real Files; it'll just waste a lot of CPU time :-) (but is otherwise harmless). */ /* ------------------------------------------------------------------ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. bzip2/libbzip2 version 1.0.6 of 6 September 2010 Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org> Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. This program is released under the terms of the license contained in the file LICENSE. ------------------------------------------------------------------ */ #define _FILE_OFFSET_BITS 64 #include <stdio.h> #include <stdlib.h> /* The number of megabytes of junk to spew out (roughly) */ #define MEGABYTES 5000 #define N_BUF 1000000 char buf[N_BUF]; int main ( int argc, char** argv ) { int ii, kk, p; srandom(1); setbuffer ( stdout, buf, N_BUF ); for (kk = 0; kk < MEGABYTES * 515; kk+=3) { p = 25+random()%50; for (ii = 0; ii < p; ii++) printf ( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ); for (ii = 0; ii < p-1; ii++) printf ( "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" ); for (ii = 0; ii < p+1; ii++) printf ( "ccccccccccccccccccccccccccccccccccccc" ); } fflush(stdout); return 0; }
{ "pile_set_name": "Github" }
/* * Copyright © 2016 Intel Corporation * * 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 (including the next * paragraph) 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. * */ #ifndef __HUGE_GEM_OBJECT_H #define __HUGE_GEM_OBJECT_H struct drm_i915_gem_object * huge_gem_object(struct drm_i915_private *i915, phys_addr_t phys_size, dma_addr_t dma_size); static inline phys_addr_t huge_gem_object_phys_size(struct drm_i915_gem_object *obj) { return obj->scratch; } static inline dma_addr_t huge_gem_object_dma_size(struct drm_i915_gem_object *obj) { return obj->base.size; } #endif /* !__HUGE_GEM_OBJECT_H */
{ "pile_set_name": "Github" }
# -*- mode: Perl -*- # /=====================================================================\ # # | amsbook | # # | Implementation for LaTeXML | # # |=====================================================================| # # | Part of LaTeXML: | # # | Public domain software, produced as part of work done by the | # # | United States Government & not subject to copyright in the US. | # # |---------------------------------------------------------------------| # # | Thanks to the arXMLiv group for initial implementation | # # | http://arxmliv.kwarc.info/ | # # | Released to the Public Domain | # # |---------------------------------------------------------------------| # # | Bruce Miller <bruce.miller@nist.gov> #_# | # # | http://dlmf.nist.gov/LaTeXML/ (o o) | # # \=========================================================ooo==U==ooo=/ # package LaTeXML::Package::Pool; use strict; use warnings; use LaTeXML::Package; foreach my $option (qw(a4paper letterpaper landscape portrait oneside twoside draft final e-only titlepage notitlepage openright openany onecolumn twocolumn nomath noamsfonts psamsfonts centertags tbtags 8pt 9pt 10pt 11pt 12pt makeidx)) { DeclareOption($option, undef); } AssignMapping('DOCUMENT_CLASSES', ltx_leqno => 1); # Default is left! DeclareOption('leqno', sub { AssignMapping('DOCUMENT_CLASSES', ltx_leqno => 1); }); DeclareOption('reqno', sub { AssignMapping('DOCUMENT_CLASSES', ltx_leqno => undef); }); DeclareOption('fleqn', sub { AssignMapping('DOCUMENT_CLASSES', ltx_fleqn => 1); }); ProcessOptions(); # I think all options are (non)handled above, so don't need to pass any. LoadClass('book'); RequirePackage('ams_support'); # #====================================================================== # # Sec 8 Monograph Formatting: # \documentclass{..} # preamble # \begin{document} # \frontmatter DefPrimitive('\frontmatter', undef); # Do we need this? # frontmatter stuff # \maketitle # \include various preface, introduction, etc # \mainmatter DefPrimitive('\mainmatter', undef); # \include various chapters, appendices # \backmatter DefPrimitive('\backmatter', undef); # commands for bibliography, indices # \end{document} # #====================================================================== 1;
{ "pile_set_name": "Github" }
/* Copyright (C) 2017 Julian Löhr All rights reserved. Filename: Status.cpp Abstract: Implementation of the Status Class */ #include "stdafx.h" #include "Status.h" #include "Log.h" #include "../HID Wiimote/DeviceInterfacePublic.h" namespace HIDWiimote { namespace UserModeLib { Status::Status() { SetLEDState(0x00); } Status::Status(const WIIMOTE_STATUS_IOCTL_DATA & StatusData) { BatteryLevel = StatusData.BatteryLevel; Extension = (UserModeLib::Extension)StatusData.Extension; SetLEDState(StatusData.LEDs); } void Status::SetLEDState(UCHAR LEDs) { LEDState = gcnew array<System::Boolean>(4); LEDState[0] = (LEDs & WIIMOTE_LEDS_ONE); LEDState[1] = (LEDs & WIIMOTE_LEDS_TWO); LEDState[2] = (LEDs & WIIMOTE_LEDS_THREE); LEDState[3] = (LEDs & WIIMOTE_LEDS_FOUR); } } }
{ "pile_set_name": "Github" }
PHP 以前的版本有扩展 apc,apc缓存分为系统缓存和用户缓存。 php5.5以后,opcache将代替apc做为php加速的位置,也就是代替其系统缓存的位置。 用户缓存功能独立出来,开启新的组件,这个组件名称叫做apcu。 所以这两个扩展不冲突。
{ "pile_set_name": "Github" }
Occidental College
{ "pile_set_name": "Github" }
//===-- XCoreTargetMachine.cpp - Define TargetMachine for XCore -----------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // //===----------------------------------------------------------------------===// #include "XCoreTargetMachine.h" #include "MCTargetDesc/XCoreMCTargetDesc.h" #include "XCore.h" #include "XCoreTargetObjectFile.h" #include "XCoreTargetTransformInfo.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/STLExtras.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/CodeGen/Passes.h" #include "llvm/CodeGen/TargetPassConfig.h" #include "llvm/Support/CodeGen.h" #include "llvm/Support/TargetRegistry.h" using namespace llvm; static Reloc::Model getEffectiveRelocModel(Optional<Reloc::Model> RM) { if (!RM.hasValue()) return Reloc::Static; return *RM; } /// Create an ILP32 architecture model /// XCoreTargetMachine::XCoreTargetMachine(const Target &T, const Triple &TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Optional<Reloc::Model> RM, CodeModel::Model CM, CodeGenOpt::Level OL) : LLVMTargetMachine( T, "e-m:e-p:32:32-i1:8:32-i8:8:32-i16:16:32-i64:32-f64:32-a:0:32-n32", TT, CPU, FS, Options, getEffectiveRelocModel(RM), CM, OL), TLOF(llvm::make_unique<XCoreTargetObjectFile>()), Subtarget(TT, CPU, FS, *this) { initAsmInfo(); } XCoreTargetMachine::~XCoreTargetMachine() = default; namespace { /// XCore Code Generator Pass Configuration Options. class XCorePassConfig : public TargetPassConfig { public: XCorePassConfig(XCoreTargetMachine &TM, PassManagerBase &PM) : TargetPassConfig(TM, PM) {} XCoreTargetMachine &getXCoreTargetMachine() const { return getTM<XCoreTargetMachine>(); } void addIRPasses() override; bool addPreISel() override; bool addInstSelector() override; void addPreEmitPass() override; }; } // end anonymous namespace TargetPassConfig *XCoreTargetMachine::createPassConfig(PassManagerBase &PM) { return new XCorePassConfig(*this, PM); } void XCorePassConfig::addIRPasses() { addPass(createAtomicExpandPass()); TargetPassConfig::addIRPasses(); } bool XCorePassConfig::addPreISel() { addPass(createXCoreLowerThreadLocalPass()); return false; } bool XCorePassConfig::addInstSelector() { addPass(createXCoreISelDag(getXCoreTargetMachine(), getOptLevel())); return false; } void XCorePassConfig::addPreEmitPass() { addPass(createXCoreFrameToArgsOffsetEliminationPass(), false); } // Force static initialization. extern "C" void LLVMInitializeXCoreTarget() { RegisterTargetMachine<XCoreTargetMachine> X(getTheXCoreTarget()); } TargetIRAnalysis XCoreTargetMachine::getTargetIRAnalysis() { return TargetIRAnalysis([this](const Function &F) { return TargetTransformInfo(XCoreTTIImpl(this, F)); }); }
{ "pile_set_name": "Github" }
<testcase> <info> <keywords> POP3 SASL SASL AUTH NTLM SASL AUTH PLAIN SASL DOWNGRADE RFC1734 RFC5034 </keywords> </info> # # Server-side <reply> <servercmd> AUTH NTLM PLAIN REPLY "AUTH NTLM" + REPLY TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= + Rubbish REPLY * -ERR AUTH exchange cancelled by client REPLY "AUTH PLAIN" + REPLY AHVzZXIAc2VjcmV0 +OK Login successful </servercmd> <data> From: me@somewhere To: fake@nowhere body -- yours sincerely </data> </reply> # # Client-side <client> <server> pop3 </server> <features> NTLM SSL !SSPI </features> <name> POP3 NTLM authentication with SASL downgrade </name> <setenv> # we force our own host name, in order to make the test machine independent CURL_GETHOSTNAME=curlhost # we try to use the LD_PRELOAD hack, if not a debug build LD_PRELOAD=%PWD/libtest/.libs/libhostname.so </setenv> <command> pop3://%HOSTIP:%POP3PORT/880 -u user:secret </command> <precheck> chkhostname curlhost </precheck> </client> # # Verify data after the test has been "shot" <verify> <protocol> CAPA AUTH NTLM TlRMTVNTUAABAAAABoIIAAAAAAAAAAAAAAAAAAAAAAA= * AUTH PLAIN AHVzZXIAc2VjcmV0 RETR 880 QUIT </protocol> </verify> </testcase>
{ "pile_set_name": "Github" }
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */ package com.microsoft.azure.management.network.v2020_03_01; import com.microsoft.azure.arm.collection.SupportsCreating; import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; import rx.Observable; import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; import com.microsoft.azure.arm.collection.SupportsListing; import com.microsoft.azure.management.network.v2020_03_01.implementation.DdosProtectionPlansInner; import com.microsoft.azure.arm.model.HasInner; /** * Type representing DdosProtectionPlans. */ public interface DdosProtectionPlans extends SupportsCreating<DdosProtectionPlan.DefinitionStages.Blank>, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup<DdosProtectionPlan>, SupportsListingByResourceGroup<DdosProtectionPlan>, SupportsListing<DdosProtectionPlan>, HasInner<DdosProtectionPlansInner> { }
{ "pile_set_name": "Github" }
#include <tommath.h> #ifdef BN_MP_MUL_C /* LibTomMath, multiple-precision integer library -- Tom St Denis * * LibTomMath is a library that provides multiple-precision * integer arithmetic as well as number theoretic functionality. * * The library was designed directly after the MPI library by * Michael Fromberger but has been written from scratch with * additional optimizations in place. * * The library is free for all purposes without any express * guarantee it works. * * Tom St Denis, tomstdenis@gmail.com, http://math.libtomcrypt.com */ /* high level multiplication (handles sign) */ int mp_mul (mp_int * a, mp_int * b, mp_int * c) { int res, neg; neg = (a->sign == b->sign) ? MP_ZPOS : MP_NEG; /* use Toom-Cook? */ #ifdef BN_MP_TOOM_MUL_C if (MIN (a->used, b->used) >= TOOM_MUL_CUTOFF) { res = mp_toom_mul(a, b, c); } else #endif #ifdef BN_MP_KARATSUBA_MUL_C /* use Karatsuba? */ if (MIN (a->used, b->used) >= KARATSUBA_MUL_CUTOFF) { res = mp_karatsuba_mul (a, b, c); } else #endif { /* can we use the fast multiplier? * * The fast multiplier can be used if the output will * have less than MP_WARRAY digits and the number of * digits won't affect carry propagation */ int digs = a->used + b->used + 1; #ifdef BN_FAST_S_MP_MUL_DIGS_C if ((digs < MP_WARRAY) && MIN(a->used, b->used) <= (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { res = fast_s_mp_mul_digs (a, b, c, digs); } else #endif #ifdef BN_S_MP_MUL_DIGS_C res = s_mp_mul (a, b, c); /* uses s_mp_mul_digs */ #else res = MP_VAL; #endif } c->sign = (c->used > 0) ? neg : MP_ZPOS; return res; } #endif /* $Source: /cvs/libtom/libtommath/bn_mp_mul.c,v $ */ /* $Revision: 1.3 $ */ /* $Date: 2006/03/31 14:18:44 $ */
{ "pile_set_name": "Github" }
#ifndef ASTERA_DEBUG_HEADER #define ASTERA_DEBUG_HEADER #define ASTERA_DEBUG_INCLUDED /* Macro Options * ASTERA_DEBUG_OUTPUT - Enable the debug output macro (configured with * cmake build type) */ #ifdef __cplusplus extern "C" { #endif #include <stdint.h> typedef struct { uint8_t silent, logging, timestamp; const char* log_fp; char time_buff[16]; } d_ctx; // Create the global context to use, and initialize it static d_ctx _d_ctx; /* Get a pointer to the debug context paramters * returns: pointer to the debug context */ d_ctx* d_ctx_get(); /* Disable / Enable & set usage of outputting the log to file * log - 1 = use log, 0 = don't * fp - the filepath (optional if disabling) */ void d_set_log(uint8_t log, const char* fp); /* Set the file to use for log output * fp - the file path*/ void d_set_log_fp(const char* fp); /* Enable / disable usage of the timestamp * timestamp - use timestamp, 0 = don't */ void d_use_timestamp(uint8_t timestamp); /* If we're outputting the log to file * returns: logging = 1, not logging = 0 */ uint8_t d_is_logging(); /* Post the output file to a unique timestamped error file * returns: success = 1, failure = 0 */ uint8_t d_post_to_err(); /* Remove any files created by runtime (except for error files) * returns: success = 1, failure = 0 */ uint8_t d_cleanup(); void _l(const char* format, ...); void _e(const char* format, ...); // TODO fix this #if defined(ASTERA_DEBUG_OUTPUT) && !defined(_MSC_VER) #define ASTERA_DBG(fmt, ...) _l(fmt, ##__VA_ARGS__) #define ASTERA_FUNC_DBG(fmt, ...) \ _l("%s: ", __FUNCTION__); \ _l(fmt, ##__VA_ARGS__); #else #define ASTERA_DBG(fmt, ...) #define ASTERA_FUNC_DBG(fmt, ...) #endif // EOF #endif
{ "pile_set_name": "Github" }
/* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ package org.apache.poi.ss.usermodel; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import org.junit.Test; /** * @author Yegor Kozlov */ public final class TestIndexedColors { @Test public void fromInt() { int[] illegalIndices = { -1, 65 }; for (int index : illegalIndices) { try { IndexedColors.fromInt(index); fail("Expected IllegalArgumentException: " + index); } catch (final IllegalArgumentException e) { // expected } } assertEquals(IndexedColors.BLACK, IndexedColors.fromInt(8)); assertEquals(IndexedColors.GOLD, IndexedColors.fromInt(51)); assertEquals(IndexedColors.AUTOMATIC, IndexedColors.fromInt(64)); } @Test public void getIndex() { assertEquals(51, IndexedColors.GOLD.getIndex()); } @Test public void index() { assertEquals(51, IndexedColors.GOLD.index); } }
{ "pile_set_name": "Github" }
/*********************************************************************************************************************** * DISCLAIMER * This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No * other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all * applicable laws, including copyright laws. * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM * EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES * SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS * SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of * this software. By using this software, you agree to the additional terms and conditions found by accessing the * following link: * http://www.renesas.com/disclaimer * * Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved. ***********************************************************************************************************************/ /*********************************************************************************************************************** * File Name : r_bsp_config_reference.c * Device(s) : RX111 * Description : The file r_bsp_config.h is used to configure your BSP. r_bsp_config.h should be included * somewhere in your package so that the r_bsp code has access to it. This file (r_bsp_config_reference.h) * is just a reference file that the user can use to make their own r_bsp_config.h file. ************************************************************************************************************************ * History : DD.MM.YYYY Version Description * : 07.11.2012 0.01 Beta Release ***********************************************************************************************************************/ #ifndef R_BSP_CONFIG_REF_HEADER_FILE #define R_BSP_CONFIG_REF_HEADER_FILE /*********************************************************************************************************************** Configuration Options ***********************************************************************************************************************/ /* Enter the product part number for your MCU. This information will be used to obtain information about your MCU such as package and memory size. To help parse this information, the part number will be defined using multiple macros. R 5 F 51 11 5 A D FM | | | | | | | | | Macro Name Description | | | | | | | | |__MCU_PART_PACKAGE = Package type, number of pins, and pin pitch | | | | | | | |____not used = Products with wide temperature range (D: -40 to 85C G: -40 to 105C) | | | | | | |______not used = Blank | | | | | |________MCU_PART_MEMORY_SIZE = ROM, RAM, and Data Flash Capacity | | | | |___________MCU_PART_GROUP = Group name | | | |______________MCU_PART_SERIES = Series name | | |________________MCU_PART_MEMORY_TYPE = Type of memory (Flash) | |__________________not used = Renesas MCU |____________________not used = Renesas semiconductor product. */ /* Package type. Set the macro definition based on values below: Character(s) = Value for macro = Package Type/Number of Pins/Pin Pitch FM = 0x0 = LFQFP/64/0.50 FK = 0x1 = LQFP/64/0.80 LF = 0x2 = TFLGA/64/0.50 FL = 0x3 = LFQFP/48/0.50 NE = 0x4 = VQFN/48/0.50 NC = 0x5 = HWQFN/36/0.50 LM = 0x6 = WFLGA/36/0.50 SB = 0x7 = SSOP/36/0.80 */ #define MCU_PART_PACKAGE (0x0) /* ROM, RAM, and Data Flash Capacity. Character(s) = Value for macro = ROM Size/Ram Size/Data Flash Size 5 = 0x5 = 128KB/16KB/8KB 4 = 0x4 = 96KB/16KB/8KB 3 = 0x3 = 64KB/10KB/8KB 1 = 0x1 = 32KB/10KB/8KB J = 0x0 = 16KB/8KB/8KB */ #define MCU_PART_MEMORY_SIZE (0x5) /* Group name. Character(s) = Value for macro = Description 10 = 0x0 = RX110 Group 11 = 0x1 = RX111 Group */ #define MCU_PART_GROUP (0x1) /* Series name. Character(s) = Value for macro = Description 51 = 0x0 = RX100 Series */ #define MCU_PART_SERIES (0x0) /* Memory type. Character(s) = Value for macro = Description F = 0x0 = Flash memory version */ #define MCU_PART_MEMORY_TYPE (0x0) /* The 'BSP_DECLARE_STACK' macro is checked so that the stack is only declared in one place (resetprg.c). Every time a '#pragma stacksize' is encountered, the stack size is increased. This prevents multiplication of stack size. */ #if defined(BSP_DECLARE_STACK) /* User Stack size in bytes. The Renesas RX toolchain sets the stack size using the #pragma stacksize directive. */ #pragma stacksize su=0x400 /* Interrupt Stack size in bytes. The Renesas RX toolchain sets the stack size using the #pragma stacksize directive. */ #pragma stacksize si=0x100 #endif /* Heap size in bytes. */ #define HEAP_BYTES (0x001) /* After reset MCU will operate in Supervisor mode. To switch to User mode, set this macro to '1'. For more information on the differences between these 2 modes see the CPU >> Processor Mode section of your MCU's hardware manual. 0 = Stay in Supervisor mode. 1 = Switch to User mode. */ #define RUN_IN_USER_MODE (0) /* This macro lets other modules no if a RTOS is being used. 0 = RTOS is not used. 1 = RTOS is used. */ #define RTOS_USED (0) /* Clock source select (CKSEL). 0 = Low Speed On-Chip Oscillator (LOCO) 1 = High Speed On-Chip Oscillator (HOCO) 2 = Main Clock Oscillator 3 = Sub-Clock Oscillator 4 = PLL Circuit */ #define CLOCK_SOURCE (4) // GI org 4 /* Clock configuration options. The input clock frequency is specified and then the system clocks are set by specifying the multipliers used. The multiplier settings are used to set the clock registers in resetprg.c. If a 16MHz clock is used and the ICLK is 24MHz, PCLKB is 24MHz, FCLK is 24MHz, PCLKD is 24MHz, and CKO is 1MHz then the settings would be: XTAL_HZ = 16000000 PLL_DIV = 2 PLL_MUL = 6 (16MHz x 3 = 48MHz) ICK_DIV = 2 : System Clock (ICLK) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / ICK_DIV) = 24MHz PCKB_DIV = 2 : Peripheral Clock B (PCLKB) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / PCKB_DIV) = 24MHz PCKD_DIV = 2 : Peripheral Clock D (PCLKD) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / PCKD_DIV) = 24MHz FCK_DIV = 2 : Flash IF Clock (FCLK) = (((XTAL_HZ/PLL_DIV) * PLL_MUL) / FCK_DIV) = 24MHz */ /* XTAL - Input clock frequency in Hz */ #define XTAL_HZ (16000000) /* PLL Input Frequency Divider Select (PLIDIV). Available divisors = /1 (no division), /2, /4 */ #define PLL_DIV (2) // GI org 2 /* PLL Frequency Multiplication Factor Select (STC). Available multipliers = x6, x8 */ #define PLL_MUL (6) // GI org 6 /* System Clock Divider (ICK). Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64 */ #define ICK_DIV (2) // NOTE: ICLK CANNOT BE SLOWER THAN PCLK! /* Peripheral Module Clock B Divider (PCKB). Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64 */ #define PCKB_DIV (2) // GI org 2 /* Peripheral Module Clock D Divider (PCKD). Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64 */ #define PCKD_DIV (2) /* Flash IF Clock Divider (FCK). Available divisors = /1 (no division), /2, /4, /8, /16, /32, /64 */ #define FCK_DIV (2) /* Below are callback functions that can be used for detecting MCU exceptions, undefined interrupt sources, and bus errors. If the user wishes to be alerted of these events then they will need to define the macro as a function to be called when the event occurs. For example, if the user wanted the function excep_undefined_instr_isr() to be called when an undefined interrupt source ISR is triggered then they would do the following: #define UNDEFINED_INT_ISR_CALLBACK undefined_interrupt_cb If the user does not wish to be alerted of these events then they should comment out the macros. NOTE: When a callback function is called it will be called from within a ISR. This means that the function will essentially be an interrupt and will hold off other interrupts that occur in the system while it is executing. For this reason, it is recommended to keep these callback functions short as to not decrease the real-time response of your system. */ /* Callback for Supervisor Instruction Violation Exception. */ //#define EXCEP_SUPERVISOR_ISR_CALLBACK supervisor_instr_cb /* Callback for Undefined Instruction Exception. */ //#define EXCEP_UNDEFINED_INSTR_ISR_CALLBACK undefined_instr_cb /* Callback for Non-maskable Interrupt. */ //#define NMI_ISR_CALLBACK nmi_cb /* Callback for all undefined interrupt vectors. User can set a breakpoint in this function to determine which source is creating unwanted interrupts. */ //#define UNDEFINED_INT_ISR_CALLBACK undefined_interrupt_cb /* Callback for Bus Error Interrupt. */ //#define BUS_ERROR_ISR_CALLBACK bus_error_cb /* The user has the option of separately choosing little or big endian for the User Application Area */ /* Endian mode for User Application. 0 = Big Endian Else = Little Endian (Default) */ #define USER_APP_ENDIAN (1) /* Configure WDT and IWDT settings. OFS0 - Option Function Select Register 0 OFS0 - Option Function Select Register 0 b31:b15 Reserved (set to 1) b14 IWDTSLCSTP - IWDT Sleep Mode Count Stop Control - (0=can't stop count, 1=stop w/some low power modes) b13 Reserved (set to 1) b12 IWDTRSTIRQS - IWDT Reset Interrupt Request - What to do on underflow (0=take interrupt, 1=reset MCU) b11:b10 IWDTRPSS - IWDT Window Start Position Select - (0=25%, 1=50%, 2=75%, 3=100%,don't use) b9:b8 IWDTRPES - IWDT Window End Position Select - (0=75%, 1=50%, 2=25%, 3=0%,don't use) b7:b4 IWDTCKS - IWDT Clock Frequency Division Ratio - (0=none, 2=/16, 3 = /32, 4=/64, 0xF=/128, 5=/256) b3:b2 IWDTTOPS - IWDT Timeout Period Select - (0=128 cycles, 1=512, 2=1024, 3=2048) b1 IWDTSTRT - IWDT Start Mode Select - (0=auto-start after reset, 1=halt after reset) b0 Reserved (set to 1) */ #define OFS0_REG_VALUE (0xFFFFFFFF) //Disable by default /* Configure whether voltage detection 1 circuit and HOCO are enabled after reset. OFS1 - Option Function Select Register 1 b31:b9 Reserved (set to 1) b8 HOCOEN - Enable/disable HOCO oscillation after a reset (0=enable, 1=disable) b7:b4 STUPLVD1LVL - Startup Voltage Monitoring 1 Reset Detection Level Select 0 1 0 0: 3.10 V 0 1 0 1: 3.00 V 0 1 1 0: 2.90 V 0 1 1 1: 2.79 V 1 0 0 0: 2.68 V 1 0 0 1: 2.58 V 1 0 1 0: 2.48 V 1 0 1 1: 2.06 V 1 1 0 0: 1.96 V 1 1 0 1: 1.86 V b3:b2 Reserved (set to 1) b2 STUPLVD1REN - Startup Voltage Monitoring 1 Reset Enable (1=monitoring disabled) b0 FASTSTUP - Power-On Fast Startup Time (1=normal; read only) */ #define OFS1_REG_VALUE (0xFFFFFFFF) //Disable by default /* Initializes C input & output library functions. 0 = Disable I/O library initialization in resetprg.c. If you are not using stdio then use this value. 1 = Enable I/O library initialization in resetprg.c. This is default and needed if you are using stdio. */ #define IO_LIB_ENABLE (0) #endif /* R_BSP_CONFIG_REF_HEADER_FILE */
{ "pile_set_name": "Github" }