text
stringlengths 2
14k
| meta
dict |
|---|---|
/*
* linux/sound/soc/ep93xx-i2s.c
* EP93xx I2S driver
*
* Copyright (C) 2010 Ryan Mallon <ryan@bluewatersys.com>
*
* Based on the original driver by:
* Copyright (C) 2007 Chase Douglas <chasedouglas@gmail>
* Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
#include <sound/initval.h>
#include <sound/soc.h>
#include <mach/hardware.h>
#include <mach/ep93xx-regs.h>
#include <mach/dma.h>
#include "ep93xx-pcm.h"
#define EP93XX_I2S_TXCLKCFG 0x00
#define EP93XX_I2S_RXCLKCFG 0x04
#define EP93XX_I2S_GLCTRL 0x0C
#define EP93XX_I2S_TXLINCTRLDATA 0x28
#define EP93XX_I2S_TXCTRL 0x2C
#define EP93XX_I2S_TXWRDLEN 0x30
#define EP93XX_I2S_TX0EN 0x34
#define EP93XX_I2S_RXLINCTRLDATA 0x58
#define EP93XX_I2S_RXCTRL 0x5C
#define EP93XX_I2S_RXWRDLEN 0x60
#define EP93XX_I2S_RX0EN 0x64
#define EP93XX_I2S_WRDLEN_16 (0 << 0)
#define EP93XX_I2S_WRDLEN_24 (1 << 0)
#define EP93XX_I2S_WRDLEN_32 (2 << 0)
#define EP93XX_I2S_LINCTRLDATA_R_JUST (1 << 2) /* Right justify */
#define EP93XX_I2S_CLKCFG_LRS (1 << 0) /* lrclk polarity */
#define EP93XX_I2S_CLKCFG_CKP (1 << 1) /* Bit clock polarity */
#define EP93XX_I2S_CLKCFG_REL (1 << 2) /* First bit transition */
#define EP93XX_I2S_CLKCFG_MASTER (1 << 3) /* Master mode */
#define EP93XX_I2S_CLKCFG_NBCG (1 << 4) /* Not bit clock gating */
struct ep93xx_i2s_info {
struct clk *mclk;
struct clk *sclk;
struct clk *lrclk;
struct ep93xx_pcm_dma_params *dma_params;
struct resource *mem;
void __iomem *regs;
};
struct ep93xx_pcm_dma_params ep93xx_i2s_dma_params[] = {
[SNDRV_PCM_STREAM_PLAYBACK] = {
.name = "i2s-pcm-out",
.dma_port = EP93XX_DMA_M2P_PORT_I2S1,
},
[SNDRV_PCM_STREAM_CAPTURE] = {
.name = "i2s-pcm-in",
.dma_port = EP93XX_DMA_M2P_PORT_I2S1,
},
};
static inline void ep93xx_i2s_write_reg(struct ep93xx_i2s_info *info,
unsigned reg, unsigned val)
{
__raw_writel(val, info->regs + reg);
}
static inline unsigned ep93xx_i2s_read_reg(struct ep93xx_i2s_info *info,
unsigned reg)
{
return __raw_readl(info->regs + reg);
}
static void ep93xx_i2s_enable(struct ep93xx_i2s_info *info, int stream)
{
unsigned base_reg;
int i;
if ((ep93xx_i2s_read_reg(info, EP93XX_I2S_TX0EN) & 0x1) == 0 &&
(ep93xx_i2s_read_reg(info, EP93XX_I2S_RX0EN) & 0x1) == 0) {
/* Enable clocks */
clk_enable(info->mclk);
clk_enable(info->sclk);
clk_enable(info->lrclk);
/* Enable i2s */
ep93xx_i2s_write_reg(info, EP93XX_I2S_GLCTRL, 1);
}
/* Enable fifos */
if (stream == SNDRV_PCM_STREAM_PLAYBACK)
base_reg = EP93XX_I2S_TX0EN;
else
base_reg = EP93XX_I2S_RX0EN;
for (i = 0; i < 3; i++)
ep93xx_i2s_write_reg(info, base_reg + (i * 4), 1);
}
static void ep93xx_i2s_disable(struct ep93xx_i2s_info *info, int stream)
{
unsigned base_reg;
int i;
/* Disable fifos */
if (stream == SNDRV_PCM_STREAM_PLAYBACK)
base_reg = EP93XX_I2S_TX0EN;
else
base_reg = EP93XX_I2S_RX0EN;
for (i = 0; i < 3; i++)
ep93xx_i2s_write_reg(info, base_reg + (i * 4), 0);
if ((ep93xx_i2s_read_reg(info, EP93XX_I2S_TX0EN) & 0x1) == 0 &&
(ep93xx_i2s_read_reg(info, EP93XX_I2S_RX0EN) & 0x1) == 0) {
/* Disable i2s */
ep93xx_i2s_write_reg(info, EP93XX_I2S_GLCTRL, 0);
/* Disable clocks */
clk_disable(info->lrclk);
clk_disable(info->sclk);
clk_disable(info->mclk);
}
}
static int ep93xx_i2s_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct ep93xx_i2s_info *info = snd_soc_dai_get_drvdata(dai);
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
snd_soc_dai_set_dma_data(cpu_dai, substream,
&info->dma_params[substream->stream]);
return 0;
}
static void ep93xx_i2s_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct ep93xx_i2s_info *info = snd_soc_dai_get_drvdata(dai);
ep93xx_i2s_disable(info, substream->stream);
}
static int ep93xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai,
unsigned int fmt)
{
struct ep93xx_i2s_info *info = snd_soc_dai_get_drvdata(cpu_dai);
unsigned int clk_cfg, lin_ctrl
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2019-2020 Hans-Kristian Arntzen
*
* 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 SPIRV_CROSS_C_API_H
#define SPIRV_CROSS_C_API_H
#include <stddef.h>
#include "spirv.h"
/*
* C89-compatible wrapper for SPIRV-Cross' API.
* Documentation here is sparse unless the behavior does not map 1:1 with C++ API.
* It is recommended to look at the canonical C++ API for more detailed information.
*/
#ifdef __cplusplus
extern "C" {
#endif
/* Bumped if ABI or API breaks backwards compatibility. */
#define SPVC_C_API_VERSION_MAJOR 0
/* Bumped if APIs or enumerations are added in a backwards compatible way. */
#define SPVC_C_API_VERSION_MINOR 30
/* Bumped if internal implementation details change. */
#define SPVC_C_API_VERSION_PATCH 0
#if !defined(SPVC_PUBLIC_API)
#if defined(SPVC_EXPORT_SYMBOLS)
/* Exports symbols. Standard C calling convention is used. */
#if defined(__GNUC__)
#define SPVC_PUBLIC_API __attribute__((visibility("default")))
#elif defined(_MSC_VER)
#define SPVC_PUBLIC_API __declspec(dllexport)
#else
#define SPVC_PUBLIC_API
#endif
#else
#define SPVC_PUBLIC_API
#endif
#endif
/*
* Gets the SPVC_C_API_VERSION_* used to build this library.
* Can be used to check for ABI mismatch if so-versioning did not catch it.
*/
SPVC_PUBLIC_API void spvc_get_version(unsigned *major, unsigned *minor, unsigned *patch);
/* Gets a human readable version string to identify which commit a particular binary was created from. */
SPVC_PUBLIC_API const char *spvc_get_commit_revision_and_timestamp(void);
/* These types are opaque to the user. */
typedef struct spvc_context_s *spvc_context;
typedef struct spvc_parsed_ir_s *spvc_parsed_ir;
typedef struct spvc_compiler_s *spvc_compiler;
typedef struct spvc_compiler_options_s *spvc_compiler_options;
typedef struct spvc_resources_s *spvc_resources;
struct spvc_type_s;
typedef const struct spvc_type_s *spvc_type;
typedef struct spvc_constant_s *spvc_constant;
struct spvc_set_s;
typedef const struct spvc_set_s *spvc_set;
/*
* Shallow typedefs. All SPIR-V IDs are plain 32-bit numbers, but this helps communicate which data is used.
* Maps to a SPIRType.
*/
typedef SpvId spvc_type_id;
/* Maps to a SPIRVariable. */
typedef SpvId spvc_variable_id;
/* Maps to a SPIRConstant. */
typedef SpvId spvc_constant_id;
/* See C++ API. */
typedef struct spvc_reflected_resource
{
spvc_variable_id id;
spvc_type_id base_type_id;
spvc_type_id type_id;
const char *name;
} spvc_reflected_resource;
/* See C++ API. */
typedef struct spvc_entry_point
{
SpvExecutionModel execution_model;
const char *name;
} spvc_entry_point;
/* See C++ API. */
typedef struct spvc_combined_image_sampler
{
spvc_variable_id combined_id;
spvc_variable_id image_id;
spvc_variable_id sampler_id;
} spvc_combined_image_sampler;
/* See C++ API. */
typedef struct spvc_specialization_constant
{
spvc_constant_id id;
unsigned constant_id;
} spvc_specialization_constant;
/* See C++ API. */
typedef struct spvc_buffer_range
{
unsigned index;
size_t offset;
size_t range;
} spvc_buffer_range;
/* See C++ API. */
typedef struct spvc_hlsl_root_constants
{
unsigned start;
unsigned end;
unsigned binding;
unsigned space;
} spvc_hlsl_root_constants;
/* See C++ API. */
typedef struct spvc_hlsl_vertex_attribute_remap
{
unsigned location;
const char *semantic;
} spvc_hlsl_vertex_attribute_remap;
/*
* Be compatible with non-C99 compilers, which do not have stdbool.
* Only recent MSVC compilers supports this for example, and ideally SPIRV-Cross should be linkable
* from a wide range of compilers in its C wrapper.
*/
typedef unsigned char spvc_bool;
#define SPVC_TRUE ((spvc_bool)1)
#define SPVC_FALSE ((spvc_bool)0)
typedef enum spvc_result
{
/* Success. */
SPVC_SUCCESS = 0,
/* The SPIR-V is invalid. Should have been caught by validation ideally. */
SPVC_ERROR_INVALID_SPIRV = -1,
/* The SPIR-V might be valid or invalid, but SPIRV-Cross currently cannot correctly translate this to your target language. */
SPVC_ERROR_UNSUPPORTED_SPIRV = -2,
/* If for some reason we hit this, new or malloc failed. */
SPVC_ERROR_OUT_OF_MEMORY = -3,
/* Invalid API argument. */
SPVC_ERROR_INVALID_ARGUMENT = -4,
SPVC_ERROR_INT_MAX = 0x7fffffff
} spvc_result;
typedef enum spvc_capture_mode
{
/* The Parsed IR payload will be copied, and the handle can be reused to create other compiler instances. */
SPVC_CAPTURE_MODE_COPY = 0,
/*
* The payload will now be owned by the compiler.
* parsed_ir should now be considered a dead blob and must not be used further.
* This is optimal for performance and should be the go-to option.
*/
SPVC_CAPTURE_MODE_TAKE_OWNERSHIP = 1,
SPVC_CAPTURE_MODE_INT_MAX = 0x7fffffff
} spvc_capture_mode;
typedef enum spvc_backend
{
/* This backend can only perform reflection, no compiler options are supported. Maps to spirv_cross::Compiler. */
SPVC_BACKEND_NONE = 0,
SPVC_BACKEND_GLSL = 1, /* spirv_cross::CompilerGLSL */
SPVC_BACKEND_HLSL = 2, /* CompilerHLSL */
SPVC_BACKEND_MSL = 3, /* CompilerMSL */
SPVC_BACKEND_CPP = 4, /* CompilerCPP */
SPVC_BACKEND_JSON = 5, /* CompilerReflection w/ JSON backend */
SPVC_BACKEND_INT_MAX = 0x7fffffff
} spvc_backend;
/* Maps to C++ API. */
typedef enum spvc_resource_type
{
SPVC_RESOURCE_TYPE_UNKNOWN = 0,
SPVC_RESOURCE_TYPE_UNIFORM_BUFFER = 1,
SPVC_RESOURCE_TYPE_STORAGE_BUFFER = 2,
SPVC_RESOURCE_TYPE_STAGE_INPUT = 3,
SPVC_RESOURCE_TYPE_STAGE_OUTPUT = 4,
SPVC_RESOURCE_TYPE_SUBPASS_INPUT = 5,
SPVC_RESOURCE_TYPE_STORAGE_IMAGE = 6,
SPVC_RESOURCE_TYPE_SAM
|
{
"pile_set_name": "Github"
}
|
## API documentation
See our [API documentation](https://moov-io.github.io/ach/api/) for Moov ACH endpoints.
## Setup our ACH file
Creating an Automated Clearing House (ACH) file can be done several ways:
- [using Go and our generated client](#go-client)
- [uploading a JSON representation](#upload-a-json-representation)
- [uploading a raw ACH file](#upload-a-json-representation)
### Go Client
We have an example of [using our Go client and uploading the JSON representation](https://github.com/moov-io/ach/blob/master/examples/http/main.go). The basic idea follows this structure:
1. Create a [BatchHeader](https://godoc.org/github.com/moov-io/ach#BatchHeader) record with `ach.NewBatchHeader()`.
1. Create an [EntryDetail](https://godoc.org/github.com/moov-io/ach#EntryDetail) record with `ach.NewEntryDetail()`.
1. Create a [Batch](https://godoc.org/github.com/moov-io/ach#Batch) from our `BatchHeader` and `EntryDetail`.
1. Using a constructor like `batch := ach.NewBatchPPD(batchHeader)` and adding the batch with `batch.AddEntry(entry)`.
1. Call and verify `batch.Create()` returns no error.
1. Create our ACH File record `file := ach.NewFile()` and [FileHeader](https://godoc.org/github.com/moov-io/ach#FileHeader) with `ach.NewFileHeader()`
1. Add the `FileHeader` (via `file.SetHeader(fileHeader)`) and `Batch` records to the file (via `file.AddBatch(batch)`).
1. Call and verify `file.Create()` returns no error.
1. Encode the `File` to JSON (via `json.NewEncoder(&buf).Encode(&file)`) for a `net/http` request.
### Upload a JSON representation
In Ruby we have an example of [creating an ACH file from JSON](https://github.com/moov-io/ruby-ach-demo/blob/master/main.rb). The JSON structure corresponds to our [api endpoint for creating files](https://api.moov.io/#operation/createFile) that the ACH HTTP server expects.
We have [example ACH files](https://github.com/moov-io/ach/blob/master/test/testdata/ppd-valid.json) in JSON.
Note: The header `Content-Type: application/json` must be set.
### Upload a raw ACH file
Our ACH HTTP server also handles [uploading raw ACH files](https://api.moov.io/#operation/createFile) which is the NACHA text format. We have example files in their NACHA format and example code for creating the files and reading the files
| SEC Code | Description | Example ACH File | Read | Create
| :---: | :---: | :---: | :--- | :--- |
| ACK | Acknowledgment Entry for CCD | [Credit](https://github.com/moov-io/ach/blob/master/test/ach-ack-read/ack-read.ach) | [ACK Read](https://github.com/moov-io/ach/blob/master/examples/ach-ack-read/main.go) | [ACK Create](https://github.com/moov-io/ach/blob/master/examples/ach-ack-write/main.go) |
| ADV | Automated Accounting Advice | [Prenote Debit](https://github.com/moov-io/ach/blob/master/test/ach-adv-read/adv-read.ach) | [ADV Read](https://github.com/moov-io/ach/blob/master/examples/ach-adv-read/main.go) | [ADV Create](https://github.com/moov-io/ach/blob/master/examples/ach-adv-write/main.go) |
| ARC | Accounts Receivable Entry | [Debit](https://github.com/moov-io/ach/blob/master/test/ach-arc-read/arc-debit.ach) | [ARC Read](https://github.com/moov-io/ach/blob/master/examples/ach-arc-read/main.go) | [ARC Create](https://github.com/moov-io/ach/blob/master/examples/ach-arc-write/main.go) |
| ATX | Acknowledgment Entry for CTX | [Credit](https://github.com/moov-io/ach/blob/master/test/ach-atx-read/atx-read.ach) | [ATX Read](https://github.com/moov-io/ach/blob/master/examples/ach-atx-read/main.go) | [ATX Create](https://github.com/moov-io/ach/blob/master/examples/ach-atx-write/main.go) |
| BOC | Back Office Conversion | [Debit](https://github.com/moov-io/ach/blob/master/test/ach-boc-read/boc-debit.ach) | [BOC Read](https://github.com/moov-io/ach/blob/master/examples/ach-boc-read/main.go) | [BOC Create](https://github.com/moov-io/ach/blob/master/examples/ach-boc-write/main.go) |
| CCD | Corporate credit or debit | [Debit](https://github.com/moov-io/ach/blob/master/test/ach-ccd-read/ccd-debit.ach) | [CCD Read](https://github.com/moov-io/ach/blob/master/examples/ach-ccd-read/main.go) | [CCD Create](https://github.com/moov-io/ach/blob/master/examples/ach-ccd-write/main.go) |
| CIE | Customer-Initiated Entry | [Credit](https://github.com/moov-io/ach/blob/master/test/ach-cie-read/cie-credit.ach) | [CIE Read](https://github.com/moov-io/ach/blob/master/examples/ach-cie-read/main.go) | [CIE Create](https://github.com/moov-io/ach/blob/master/examples/ach-cie-write/main.go) |
| COR | Automated Notification of Change(NOC) | [NOC](https://github.com/moov-io/ach/blob/master/test/ach-cor-read/cor-read.ach) | [COR Read](https://github.com/moov-io/ach/blob/master/examples/ach-cor-read/main.go) | [COR Create](https://github.com/moov-io/ach/blob/master/examples/ach-cor-write/main.go) |
| CTX | Corporate Trade Exchange | [Debit](https://github.com/moov-io/ach/blob/master/test/ach-ctx-read/ctx-debit.ach) | [CTX Read](https://github.com/moov-io/ach/blob/master/examples/ach-ctx-read/main.go) | [CTX Create](https://github.com/moov-io/ach/blob/master/examples/ach-ctx-write/main.go) |
| DNE | Death Notification Entry | [DNE](https://github.com/moov-io/ach/blob/master/test/ach-dne-read/dne-read.ach) | [DNE Read](https://github.com/moov-io/ach/blob/master/examples/ach-dne-read/main.go) | [DNE Create](https://github.com/moov-io/ach/blob/master/examples/ach-dne-write/main.go) |
| ENR | Automatic Enrollment Entry | [ENR](https://github.com/moov-io/ach/blob/master/test/ach-enr-read/enr-read.ach) | [ENR Read](https://github.com/moov-io/ach/blob/master/examples/ach-enr-read/main.go) | [ENR Create](https://github.com/moov-io/ach/blob/master/examples/ach-enr-write/main.go) |
| IAT | International
|
{
"pile_set_name": "Github"
}
|
/*
//@HEADER
// ************************************************************************
//
// Kokkos v. 3.0
// Copyright (2020) National Technology & Engineering
// Solutions of Sandia, LLC (NTESS).
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// 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 Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY NTESS "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 NTESS OR THE
// 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.
//
// Questions? Contact Christian R. Trott (crtrott@sandia.gov)
//
// ************************************************************************
//@HEADER
*/
#include <threads/TestThreads_Category.hpp>
#include <TestViewSubview.hpp>
namespace Test {
TEST(threads, view_subview_2d_from_3d_atomic) {
TestViewSubview::test_2d_subview_3d<TEST_EXECSPACE,
Kokkos::MemoryTraits<Kokkos::Atomic> >();
}
} // namespace Test
|
{
"pile_set_name": "Github"
}
|
class NSArray : NSObject, NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration {
var count: Int { get }
func object(at index: Int) -> AnyObject
init(objects objects: UnsafePointer<AnyObject?>, count cnt: Int)
init?(coder aDecoder: NSCoder)
func copy(with zone: NSZone = nil) -> AnyObject
func mutableCopy(with zone: NSZone = nil) -> AnyObject
class func supportsSecureCoding() -> Bool
func encode(with aCoder: NSCoder)
func countByEnumerating(with state: UnsafeMutablePointer<NSFastEnumerationState>, objects buffer: AutoreleasingUnsafeMutablePointer<AnyObject?>, count len: Int) -> Int
}
extension NSArray : ArrayLiteralConvertible {
}
extension NSArray : SequenceType {
}
extension NSArray {
convenience init(objects elements: AnyObject...)
}
extension NSArray {
@objc(_swiftInitWithArray_NSArray:) convenience init(array anArray: NSArray)
}
extension NSArray : CustomReflectable {
}
extension NSArray {
func adding(_ anObject: AnyObject) -> [AnyObject]
func addingObjects(from otherArray: [AnyObject]) -> [AnyObject]
func componentsJoined(by separator: String) -> String
func contains(_ anObject: AnyObject) -> Bool
func description(withLocale locale: AnyObject?) -> String
func description(withLocale locale: AnyObject?, indent level: Int) -> String
func firstObjectCommon(with otherArray: [AnyObject]) -> AnyObject?
func getObjects(_ objects: AutoreleasingUnsafeMutablePointer<AnyObject?>, range range: NSRange)
func index(of anObject: AnyObject) -> Int
func index(of anObject: AnyObject, in range: NSRange) -> Int
func indexOfObjectIdentical(to anObject: AnyObject) -> Int
func indexOfObjectIdentical(to anObject: AnyObject, in range: NSRange) -> Int
func isEqual(to otherArray: [AnyObject]) -> Bool
@available(watchOS 2.0, *)
var firstObject: AnyObject? { get }
var lastObject: AnyObject? { get }
func objectEnumerator() -> NSEnumerator
func reverseObjectEnumerator() -> NSEnumerator
@NSCopying var sortedArrayHint: NSData { get }
func sortedArray(_ comparator: @convention(c) (AnyObject, AnyObject, UnsafeMutablePointer<Void>) -> Int, context context: UnsafeMutablePointer<Void>) -> [AnyObject]
func sortedArray(_ comparator: @convention(c) (AnyObject, AnyObject, UnsafeMutablePointer<Void>) -> Int, context context: UnsafeMutablePointer<Void>, hint hint: NSData?) -> [AnyObject]
func sortedArray(using comparator: Selector) -> [AnyObject]
func subarray(with range: NSRange) -> [AnyObject]
func write(toFile path: String, atomically useAuxiliaryFile: Bool) -> Bool
func write(to url: NSURL, atomically atomically: Bool) -> Bool
func objects(at indexes: NSIndexSet) -> [AnyObject]
@available(watchOS 2.0, *)
subscript(_ idx: Int) -> AnyObject { get }
@available(watchOS 2.0, *)
func enumerateObjects(_ block: (AnyObject, Int, UnsafeMutablePointer<ObjCBool>) -> Void)
@available(watchOS 2.0, *)
func enumerateObjects(_ opts: NSEnumerationOptions = [], using block: (AnyObject, Int, UnsafeMutablePointer<ObjCBool>) -> Void)
@available(watchOS 2.0, *)
func enumerateObjects(at s: NSIndexSet, options opts: NSEnumerationOptions = [], using block: (AnyObject, Int, UnsafeMutablePointer<ObjCBool>) -> Void)
@available(watchOS 2.0, *)
func indexOfObject(passingTest predicate: (AnyObject, Int, UnsafeMutablePointer<ObjCBool>) -> Bool) -> Int
@available(watchOS 2.0, *)
func indexOfObject(_ opts: NSEnumerationOptions = [], passingTest predicate: (AnyObject, Int, UnsafeMutablePointer<ObjCBool>) -> Bool) -> Int
@available(watchOS 2.0, *)
func indexOfObject(at s: NSIndexSet, options opts: NSEnumerationOptions = [], passingTest predicate: (AnyObject, Int, UnsafeMutablePointer<ObjCBool>) -> Bool) -> Int
@available(watchOS 2.0, *)
func indexesOfObjects(passingTest predicate: (AnyObject, Int, UnsafeMutablePointer<ObjCBool>) -> Bool) -> NSIndexSet
@available(watchOS 2.0, *)
func indexesOfObjects(_ opts: NSEnumerationOptions = [], passingTest predicate: (AnyObject, Int, UnsafeMutablePointer<ObjCBool>) -> Bool) -> NSIndexSet
@available(watchOS 2.0, *)
func indexesOfObjects(at s: NSIndexSet, options opts: NSEnumerationOptions = [], passingTest predicate: (AnyObject, Int, UnsafeMutablePointer<ObjCBool>) -> Bool) -> NSIndexSet
@available(watchOS 2.0, *)
func sortedArray(comparator cmptr: NSComparator) -> [AnyObject]
@available(watchOS 2.0, *)
func sortedArray(_ opts: NSSortOptions = [], usingComparator cmptr: NSComparator) -> [AnyObject]
@available(watchOS 2.0, *)
func index(of obj: AnyObject, inSortedRange r: NSRange, options opts: NSBinarySearchingOptions = [], usingComparator cmp: NSComparator) -> Int
}
struct NSBinarySearchingOptions : OptionSetType {
init(rawValue rawValue: UInt)
let rawValue: UInt
static var firstEqual: NSBinarySearchingOptions { get }
static var lastEqual: NSBinarySearchingOptions { get }
static var insertionIndex: NSBinarySearchingOptions { get }
}
extension NSArray {
convenience init(object anObject: AnyObject)
convenience init(array array: [AnyObject])
convenience init(array array: [AnyObject], copyItems flag: Bool)
convenience init?(contentsOfFile path: String)
convenience init?(contentsOf url: NSURL)
}
extension NSArray {
func getObjects(_ objects: AutoreleasingUnsafeMutablePointer<AnyObject?>)
}
class NSMutableArray : NSArray {
func add(_ anObject: AnyObject)
func insert(_ anObject: AnyObject, at index: Int)
func removeLastObject()
func removeObject(at index: Int)
func replaceObject(at index: Int, with anObject: AnyObject)
init(capacity numItems: Int)
}
extension NSMutableArray {
func addObjects(from otherArray: [AnyObject])
func exchangeObject(at idx1: Int, withObjectAt idx2: Int)
func removeAllObjects()
func remove(_ anObject: AnyObject, in range: NSRange)
func remove(_ anObject: AnyObject)
func removeObjectIdentical(to anObject: AnyObject, in range: NSRange)
func removeObjectIdentical(to anObject: AnyObject)
@available(watchOS, introduced=2.0, deprecated=2.0)
func removeObjects(fromIndices indices: UnsafeMutablePointer<Int>, numIndices cnt: Int)
func removeObjects(in otherArray: [AnyObject])
func removeObjects(in range: NSRange)
func replaceObjects(in range: NSRange, withObjectsFrom otherArray: [AnyObject], range otherRange: NSRange)
func replaceObjects(in range: NSRange, withObjectsFrom otherArray: [AnyObject])
func setArray(_ otherArray: [AnyObject])
func sort(_ compare: @convention(c) (AnyObject, AnyObject, UnsafeMutablePointer<Void>) -> Int, context context: UnsafeMutablePointer<Void>)
func sort(using comparator: Selector)
func insert(_ objects: [AnyObject], at indexes: NSIndexSet)
func removeObjects(at indexes: NSIndexSet)
func replaceObjects(at indexes: NSIndexSet, with objects: [AnyObject])
@
|
{
"pile_set_name": "Github"
}
|
/*
* Matrix test.
*/
#include "io/streams/cout.hh"
#include "lang/array.hh"
#include "math/matrices/matrix.hh"
#include "lang/exceptions/ex_index_out_of_bounds.hh"
using io::streams::cout;
using lang::array;
using math::matrices::matrix;
int main() {
try {
matrix<> m(3,2);
m(0,0) = 0.1;
m(0,1) = 0.02;
m(1,0) = 1.0;
m(1,1) = 2.0;
m(2,0) = 10;
m(2,1) = 30;
matrix<> m_ramp = matrix<>::ramp(-0.5, 0.25, 0.5);
array<unsigned long> dims1(1);
dims1[0] = m_ramp.size();
matrix<> m_ramp1 = reshape(m_ramp,dims1);
cout << m << "\n";
cout << m_ramp << "\n";
cout << m_ramp1 << "\n";
cout << "--- convolution 1D (full) ---\n";
cout << conv(m_ramp1,m_ramp1) << "\n";
cout << "--- convolution 1D (cropped) ---\n";
cout << conv_crop(m_ramp1,m_ramp1) << "\n";
cout << "--- convolution 1D (cropped strict) ---\n";
cout << conv_crop_strict(m_ramp1,m_ramp1) << "\n";
cout << "--- convolution 2D (full) ---\n";
cout << conv(m,m) << "\n";
cout << conv(m,transpose(m)) << "\n";
cout << conv(m,m_ramp) << "\n";
cout << conv(m_ramp,m) << "\n";
cout << conv(m_ramp,transpose(m_ramp)) << "\n";
cout << "--- convolution 2D (cropped) ---\n";
cout << conv_crop(m,m) << "\n";
cout << conv_crop(m,transpose(m)) << "\n";
cout << conv_crop(m,m_ramp) << "\n";
cout << conv_crop(m_ramp,m) << "\n";
cout << conv_crop(m_ramp,transpose(m_ramp)) << "\n";
cout << "--- convolution 2D (cropped strict) ---\n";
cout << conv_crop_strict(m,m) << "\n";
cout << conv_crop_strict(m,transpose(m)) << "\n";
cout << conv_crop_strict(m,m_ramp) << "\n";
cout << conv_crop_strict(m_ramp,m) << "\n";
cout << conv_crop_strict(m_ramp,transpose(m_ramp)) << "\n";
cout << "--- min, max, sum, prod ---\n";
cout << min(m,0) << "\n";
cout << min(m,1) << "\n";
cout << max(m,0) << "\n";
cout << max(m,1) << "\n";
cout << sum(m,0) << "\n";
cout << sum(m,1) << "\n";
cout << prod(m,0) << "\n";
cout << prod(m,1) << "\n";
cout << "--- cumsum, cumprod ---\n";
cout << cumsum(m,0) << "\n";
cout << cumsum(m,1) << "\n";
cout << cumprod(m,0) << "\n";
cout << cumprod(m,1) << "\n";
cout << "--- mean, var ---\n";
cout << mean(m) << "\n";
cout << var(m) << "\n";
cout << mean(m,0) << "\n";
cout << mean(m,1) << "\n";
cout << var(m,0) << "\n";
cout << var(m,1) << "\n";
cout << "--- gradient ---\n";
cout << gradient(m,0) << "\n";
cout << gradient(m,1) << "\n";
cout << "--- reverse ---\n";
cout << m.reverse(0) << "\n";
cout << m.reverse(1) << "\n";
cout << "--- vertcat, horzcat, concat ---\n";
cout << vertcat(m,m) << "\n";
cout << horzcat(m,m) << "\n";
cout << concat(m,m,4) << "\n";
cout << "--- resize, transpose ---\n";
cout << resize(m,2,2) << "\n";
cout << resize(m,4,4) << "\n";
cout << transpose(resize(m,4,4)) << "\n";
array<unsigned long> order(3);
order[0] = 2;
order[1] = 1;
order[2] = 0;
cout << permute_dimensions(resize(m,4,4),order) << "\n";
order[1] = 3;
order.resize(2);
cout << "--- repmat ---\n";
cout << repmat(m,order) << "\n";
cout << "--- sort ---\n";
cout << m << "\n";
cout << m.sort_idx(0) << "\n";
cout << m << "\n";
cout << m.sort_idx(1) << "\n";
cout << m << "\n";
} catch (lang::exceptions::ex_index_out_of_bounds& e) {
cout << e << "\n";
cout << e.index() << "\n";
}
return 0;
}
|
{
"pile_set_name": "Github"
}
|
(*
* OWL - OCaml Scientific and Engineering Computing
* Copyright (c) 2016-2020 Liang Wang <liang.wang@cl.cam.ac.uk>
*)
open Owl_types
(* Functor of making a Lazy engine, just an alias of CPU engine. *)
module Make (A : Ndarray_Mutable) = struct
include Owl_computation_cpu_engine.Make (A)
end
(* Make functor ends *)
|
{
"pile_set_name": "Github"
}
|
import React from "react";
import { mount, shallow } from "enzyme";
import $ from "jquery";
import { Component, ComponentList } from "../js/src/components/component-list";
import { Metrics } from "../js/src/components/metrics";
describe('ComponentList', () => {
it('fetches the components url', () => {
var ajax = $.ajax;
$.ajax = jest.fn();
const componentList = mount(
<ComponentList url={"components.json"}/>
);
expect($.ajax.mock.calls.length).toBe(1);
expect($.ajax.mock.calls[0][0].url).toBe("components.json");
$.ajax = ajax;
});
it('has component-list as classname', () => {
const componentList = shallow(<ComponentList />);
expect(componentList.find(".component-list").length).toBe(1);
});
it('renders a component for each one that was fetched', () => {
$.getJSON= jest.fn();
var ajax = $.ajax;
$.ajax = jest.fn((obj) => {
obj.success({components: ["registry", "big-sibling"]});
});
const componentList = mount(<ComponentList />);
var components = componentList.find(Component);
expect(components.length).toBe(2);
expect(components.first().props().name).toBe("registry");
expect(components.last().props().name).toBe("big-sibling");
$.ajax = ajax;
});
});
describe('Component', () => {
it('renders Metrics for the component', () => {
var ajax = $.ajax;
$.ajax = jest.fn();
const component = mount(
<Component name={"big-sibling"}/>
);
var metrics = component.find(Metrics);
expect(metrics.length).toBe(1);
expect(metrics.props().targetName).toBe("big-sibling");
expect(metrics.props().targetType).toBe("component");
$.ajax = ajax;
});
it('has component as classname', () => {
const component = shallow(<Component />);
expect(component.find(".component").length).toBe(1);
});
});
|
{
"pile_set_name": "Github"
}
|
// RUN: %compile-run-and-check
#include <omp.h>
#include <stdio.h>
int main() {
int res = 0;
#pragma omp parallel num_threads(2) reduction(+:res)
{
int tid = omp_get_thread_num();
#pragma omp target teams distribute reduction(+:res)
for (int i = tid; i < 2; i++)
++res;
}
// The first thread makes 2 iterations, the second - 1. Expected result of the
// reduction res is 3.
// CHECK: res = 3.
printf("res = %d.\n", res);
return 0;
}
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule isNode
* @typechecks
*/
/**
* @param {*} object The object to check.
* @return {boolean} Whether or not the object is a DOM node.
*/
function isNode(object) {
return !!(object && (
typeof Node === 'function' ? object instanceof Node :
typeof object === 'object' &&
typeof object.nodeType === 'number' &&
typeof object.nodeName === 'string'
));
}
module.exports = isNode;
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* @package Gantry5
* @author RocketTheme http://www.rockettheme.com
* @copyright Copyright (C) 2007 - 2017 RocketTheme, LLC
* @license Dual License: MIT or GNU/GPLv2 and later
*
* http://opensource.org/licenses/MIT
* http://www.gnu.org/licenses/gpl-2.0.html
*
* Gantry Framework code that extends GPL code is considered GNU/GPLv2 and later
*/
namespace Gantry\Component\Layout\Version;
/**
* Read layout from simplified yaml file.
*/
class Format1
{
protected $scopes = [0 => 'grid', 1 => 'block'];
protected $data;
protected $keys = [];
public function __construct(array $data)
{
$this->data = $data;
}
public function load()
{
$data = &$this->data;
// Check if we have preset.
$preset = [];
if (isset($data['preset']) && is_array($data['preset']) && isset($data['layout']) && is_array($data['layout'])) {
$preset = $data['preset'];
$data = $data['layout'];
}
// We have user entered file; let's build the layout.
// Two last items are always offcanvas and atoms.
$offcanvas = isset($data['offcanvas']) ? $data['offcanvas'] : [];
$atoms = isset($data['atoms']) ? $data['atoms'] : [];
unset($data['offcanvas'], $data['atoms']);
$data['offcanvas'] = $offcanvas;
if ($atoms) {
$data['atoms'] = $atoms;
}
$result = [];
foreach ($data as $field => $params) {
$child = $this->parse($field, (array) $params, 0);
unset($child->size);
$result[] = $child;
}
return ['preset' => $preset] + $result;
}
public function store(array $preset, array $structure)
{
return ['preset' => $preset, 'children' => $structure];
}
protected function normalize(&$item, $container = false)
{
if ($item->type === 'pagecontent') {
// Update pagecontent to match the new standards.
$item->type = 'system';
if (!$item->subtype || $item->subtype == 'pagecontent') {
$item->subtype = 'content';
$item->title = 'Page Content';
} else {
$item->subtype ='messages';
$item->title = 'System Messages';
}
}
if ($item->type === 'section') {
// Update section to match the new standards.
$section = strtolower($item->title);
$item->id = $section;
$item->subtype = (in_array($section, ['aside', 'nav', 'article', 'header', 'footer', 'main']) ? $section : 'section');
} elseif ($item->type === 'offcanvas') {
$item->id = $item->subtype = $item->type;
unset ($item->attributes->name, $item->attributes->boxed);
return;
} else {
// Update all ids to match the new standards.
$item->id = $this->id($item->type, $item->subtype);
}
if (!empty($item->attributes->extra)) {
foreach ($item->attributes->extra as $i => $extra) {
$v = reset($extra);
$k = key($extra);
if ($k === 'id') {
$item->id = preg_replace('/^g-/', '', $v);
$item->attributes->id = $v;
unset ($item->attributes->extra[$i]);
}
}
if (empty($item->attributes->extra)) {
unset ($item->attributes->extra);
}
}
$item->subtype = $item->subtype ?: $item->type;
$item->layout = in_array($item->type, ['container', 'section', 'grid', 'block', 'offcanvas']);
if (isset($item->attributes->boxed)) {
// Boxed already set, just change boxed=0 to boxed='' to use default settings.
$item->attributes->boxed = $item->attributes->boxed ?: '';
return;
}
if (!$container) {
return;
}
// Update boxed model to match the new standards.
if (isset($item->children) && count($item->children) === 1) {
$child = reset($item->children);
if ($item->type === 'container') {
// Remove parent container only if the only child is a section.
if ($child->type === 'section') {
$child->attributes->boxed = 1;
$item = $child;
}
$item->attributes->boxed = '';
} elseif ($child->type === 'container') {
// Remove child container.
$item->attributes->boxed = '';
$item->children = $child->children;
}
}
}
/**
* @param int|string $field
* @param array $content
* @param int $scope
* @param bool|null $container
* @return array
*/
protected function parse($field, array $content, $scope, $container = true)
{
if (is_numeric($field)) {
// Row or block
$type = $this->scopes[$scope];
$result = (object) ['id' => null, 'type' => $type, 'subtype' => $type, 'layout' => true, 'attributes' => (object) []];
$scope = ($scope + 1) % 2;
} elseif (substr($field, 0, 9) == 'container') {
// Container
$type = 'container';
$result = (object) ['id' => null, 'type' => $type, 'subtype' => $type, 'layout' => true, 'attributes' => (object) []];
$id = substr($field, 10) ?: null;
if ($id !== null) {
$result->attributes->id = $id;
}
} else {
// Section
$list = explode(' ', $field, 2);
$field = array_shift($list);
$size = ((float) array_shift($list)) ?: null;
$type = in_array($field, ['atoms', 'offcanvas']) ? $field : 'section';
$subtype = in_array($field, ['aside', 'nav', 'article', 'header', 'footer', 'main']) ? $field : 'section';
$result = (object) [
'id' => null,
'type' => $type,
'subtype' => $subtype,
'layout' => true,
'title' => ucfirst($field),
'attributes' => (object) ['id' => 'g-' . $field]
];
if ($size) {
$result->size = $size;
}
}
if (!empty($content)) {
$result->children = [];
foreach ($content as $child => $params) {
if (is_array($params)) {
$child = $this->parse($child, $params, $scope, false);
} else {
$child = $this->resolve($params, $scope);
}
if (!empty($child->size)) {
$result->attributes->size = $child->size;
}
unset($child->size);
$result->children[] = $child;
}
}
$this->normalize($result, $container);
return $result;
}
/**
* @param string $field
* @param int $scope
* @return array
*/
protected function resolve($field, $scope)
{
$list = explode(' ', $field, 2);
$list2 = explode('-', array_shift($list), 2);
$size = ((float) array_shift($list)) ?:
|
{
"pile_set_name": "Github"
}
|
/*
Copyright (C) 2015 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
The EAGLView class is a UIView subclass that renders OpenGL scene.
*/
#import "EAGLView.h"
#import "ES2Renderer.h"
@interface EAGLView ()
{
ES2Renderer* _renderer;
EAGLContext* _context;
NSInteger _animationFrameInterval;
CADisplayLink* _displayLink;
}
@end
@implementation EAGLView
// Must return the CAEAGLLayer class so that CA allocates an EAGLLayer backing for this view
+ (Class) layerClass
{
return [CAEAGLLayer class];
}
// The GL view is stored in the storyboard file. When it's unarchived it's sent -initWithCoder:
- (instancetype) initWithCoder:(NSCoder*)coder
{
if ((self = [super initWithCoder:coder]))
{
// Get the layer
CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;
eaglLayer.opaque = TRUE;
eaglLayer.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:FALSE], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil];
_context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
if (!_context || ![EAGLContext setCurrentContext:_context])
{
return nil;
}
_renderer = [[ES2Renderer alloc] initWithContext:_context AndDrawable:(id<EAGLDrawable>)self.layer];
if (!_renderer)
{
return nil;
}
_animating = FALSE;
_animationFrameInterval = 1;
_displayLink = nil;
}
return self;
}
- (void) drawView:(id)sender
{
[EAGLContext setCurrentContext:_context];
[_renderer render];
}
- (void) layoutSubviews
{
[_renderer resizeFromLayer:(CAEAGLLayer*)self.layer];
[self drawView:nil];
}
- (NSInteger) animationFrameInterval
{
return _animationFrameInterval;
}
- (void) setAnimationFrameInterval:(NSInteger)frameInterval
{
// Frame interval defines how many display frames must pass between each time the
// display link fires. The display link will only fire 30 times a second when the
// frame internal is two on a display that refreshes 60 times a second. The default
// frame interval setting of one will fire 60 times a second when the display refreshes
// at 60 times a second. A frame interval setting of less than one results in undefined
// behavior.
if (frameInterval >= 1)
{
_animationFrameInterval = frameInterval;
if (_animating)
{
[self stopAnimation];
[self startAnimation];
}
}
}
- (void) startAnimation
{
if (!_animating)
{
// Create the display link and set the callback to our drawView method
_displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(drawView:)];
// Set it to our _animationFrameInterval
[_displayLink setFrameInterval:_animationFrameInterval];
// Have the display link run on the default runn loop (and the main thread)
[_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
_animating = TRUE;
}
}
- (void)stopAnimation
{
if (_animating)
{
[_displayLink invalidate];
_displayLink = nil;
_animating = FALSE;
}
}
- (void) dealloc
{
// tear down context
if ([EAGLContext currentContext] == _context)
[EAGLContext setCurrentContext:nil];
}
@end
|
{
"pile_set_name": "Github"
}
|
% Penalised least squares objective function and derivatives
% phi(u) = 1/lambda * ||X*u-y||_2^2 + 2*sum( pen(s) ), s=B*u-t
%
% [f,df,d2f] = phi(u,X,y,B,t,lam,pen,varargin) where penaliser is evaluated
% by feval(pen,s,varargin{:})
%
% The return arguments have the following meaning:
% f = phi(u), [1,1] scalar
% df = d phi(u) / du, and [n,1] gradient vector (same size as u)
% d2f = d^2 phi(u) / du^2. [n,n] Hessian matrix
%
% See also PLSALGORITHMS.M.
%
% (c) by Hannes Nickisch, Philips Research, 2013 August 30
function [f,df,d2f] = phi(u,X,y,B,t,lam,pen,varargin)
s = B*u-t; r = X*u-y;
if nargout==1
p = feval(pen,s,varargin{:});
elseif nargout==2
[p,dp] = feval(pen,s,varargin{:});
else
[p,dp,d2p] = feval(pen,s,varargin{:});
end
f = norm(r,2)^2/lam + 2*sum(p);
if nargout>1
df = 2*([X']*r/lam + [B']*dp);
if nargout>2 % evaluation of the Hessian is dangerous for large n
if numel(dp)==numel(d2p)
d2f = 2*(X'*X/lam + B'*diag(d2p)*B); % d2p is a vector
else
d2f = 2*(X'*X/lam + B'*d2p*B); % d2p is a scalar or a full matrix
end
end
end
|
{
"pile_set_name": "Github"
}
|
(function (g) {
function t(a, b, d) {
return "rgba(" + [Math.round(a[0] + (b[0] - a[0]) * d), Math.round(a[1] + (b[1] - a[1]) * d), Math.round(a[2] + (b[2] - a[2]) * d), a[3] + (b[3] - a[3]) * d].join(",") + ")"
}
var u = function () {
}, o = g.getOptions(), i = g.each, p = g.extend, z = g.format, A = g.pick, q = g.wrap, l = g.Chart, n = g.seriesTypes, v = n.pie, m = n.column, w = HighchartsAdapter.fireEvent, x = HighchartsAdapter.inArray, r = [];
p(o.lang, {drillUpText: "◁ Back to {series.name}"});
o.drilldown = {
activeAxisLabelStyle: {
cursor: "pointer", color: "#0d233a", fontWeight: "bold",
textDecoration: "underline"
},
activeDataLabelStyle: {cursor: "pointer", color: "#0d233a", fontWeight: "bold", textDecoration: "underline"},
animation: {duration: 500},
drillUpButton: {position: {align: "right", x: -10, y: 10}}
};
g.SVGRenderer.prototype.Element.prototype.fadeIn = function (a) {
this.attr({opacity: 0.1, visibility: "inherit"}).animate({opacity: A(this.newOpacity, 1)}, a || {duration: 250})
};
l.prototype.addSeriesAsDrilldown = function (a, b) {
this.addSingleSeriesAsDrilldown(a, b);
this.applyDrilldown()
};
l.prototype.addSingleSeriesAsDrilldown =
function (a, b) {
var d = a.series, c = d.xAxis, f = d.yAxis, h;
h = a.color || d.color;
var e, y = [], g = [], k;
k = d.levelNumber || 0;
b = p({color: h}, b);
e = x(a, d.points);
i(d.chart.series, function (a) {
if (a.xAxis === c)y.push(a), g.push(a.userOptions), a.levelNumber = a.levelNumber || k
});
h = {
levelNumber: k,
seriesOptions: d.userOptions,
levelSeriesOptions: g,
levelSeries: y,
shapeArgs: a.shapeArgs,
bBox: a.graphic.getBBox(),
color: h,
lowerSeriesOptions: b,
pointOptions: d.options.data[e],
pointIndex: e,
oldExtremes: {
xMin: c && c.userMin, xMax: c && c.userMax, yMin: f &&
f.userMin, yMax: f && f.userMax
}
};
if (!this.drilldownLevels)this.drilldownLevels = [];
this.drilldownLevels.push(h);
h = h.lowerSeries = this.addSeries(b, !1);
h.levelNumber = k + 1;
if (c)c.oldPos = c.pos, c.userMin = c.userMax = null, f.userMin = f.userMax = null;
if (d.type === h.type)h.animate = h.animateDrilldown || u, h.options.animation = !0
};
l.prototype.applyDrilldown = function () {
var a = this.drilldownLevels, b;
if (a && a.length > 0)b = a[a.length - 1].levelNumber, i(this.drilldownLevels, function (a) {
a.levelNumber === b && i(a.levelSeries, function (a) {
a.levelNumber ===
b && a.remove(!1)
})
});
this.redraw();
this.showDrillUpButton()
};
l.prototype.getDrilldownBackText = function () {
var a = this.drilldownLevels;
if (a && a.length > 0)return a = a[a.length - 1], a.series = a.seriesOptions, z(this.options.lang.drillUpText, a)
};
l.prototype.showDrillUpButton = function () {
var a = this, b = this.getDrilldownBackText(), d = a.options.drilldown.drillUpButton, c, f;
this.drillUpButton ? this.drillUpButton.attr({text: b}).align() : (f = (c = d.theme) && c.states, this.drillUpButton = this.renderer.button(b, null, null, function () {
a.drillUp()
},
c, f && f.hover, f && f.select).attr({
align: d.position.align,
zIndex: 9
}).add().align(d.position, !1, d.relativeTo || "plotBox"))
};
l.prototype.drillUp = function () {
for (var a = this, b = a.drilldownLevels, d = b[b.length - 1].levelNumber, c = b.length, f = a.series, h = f.length, e, g, j, k, l = function (b) {
var c;
i(f, function (a) {
a.userOptions === b && (c = a)
});
c = c || a.addSeries(b, !1);
if (c.type === g.type && c.animateDrillupTo)c.animate = c.animateDrillupTo;
b === e.seriesOptions && (j = c)
}; c--;)if (e = b[c], e.levelNumber === d) {
b.pop();
g = e.lowerSeries;
if (!g.chart)for (; h--;)if (f[h].options.id ===
e.lowerSeriesOptions.id) {
g = f[h];
break
}
g.xData = [];
i(e.levelSeriesOptions, l);
w(a, "drillup", {seriesOptions: e.seriesOptions});
if (j.type === g.type)j.drilldownLevel = e, j.options.animation = a.options.drilldown.animation, g.animateDrillupFrom && g.animateDrillupFrom(e);
j.levelNumber = d;
g.remove(!1);
if (j.xAxis)k = e.oldExtremes, j.xAxis.setExtremes(k.xMin, k.xMax, !1), j.yAxis.setExtremes(k.yMin, k.yMax, !1)
}
this.redraw();
this.drilldownLevels.length === 0 ? this.drillUpButton = this.drillUpButton.destroy() : this.drillUpButton.attr({text: this.getDrilldownBackText()}).align();
r.length = []
};
m.prototype.supportsDrilldown = !0;
m.prototype.animateDrillupTo = function (a) {
if (!a) {
var b = this, d = b.drilldownLevel;
i(this.points, function (a) {
a.graphic.hide();
a.dataLabel && a.dataLabel.hide();
a.connector && a.connector.hide()
});
setTimeout(function () {
i(b.points, function (a, b) {
var h = b === (d && d.pointIndex) ? "show" : "fadeIn", e = h === "show" ? !0 : void 0;
a.graphic[h](e);
if (a.dataLabel)a.dataLabel[
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0"?>
<tallies>
<mesh id="1">
<type>regular</type>
<lower_left>-10 -1 -1 </lower_left>
<upper_right>10 1 1</upper_right>
<dimension>10 1 1</dimension>
</mesh>
<filter id="1">
<type>mesh</type>
<bins>1</bins>
</filter>
<tally id="1">
<filters>1</filters>
<scores>flux</scores>
</tally>
</tallies>
|
{
"pile_set_name": "Github"
}
|
module tests.it.runtime.regressions;
import tests.it.runtime;
import reggae.reggae;
import std.path;
@("Issue 14: builddir not expanded")
@Tags(["ninja", "regressions"])
unittest {
with(immutable ReggaeSandbox()) {
writeFile("reggaefile.d", q{
import reggae;
enum ao = objectFile(SourceFile("a.c"));
enum liba = Target("$builddir/liba.a", "ar rcs $out $in", [ao]);
mixin build!(liba);
});
writeFile("a.c");
runReggae("-b", "ninja");
ninja.shouldExecuteOk;
}
}
@("Issue 12: can't set executable as a dependency")
@Tags(["ninja", "regressions"])
unittest {
with(immutable ReggaeSandbox()) {
writeFile("reggaefile.d", q{
import reggae;
alias app = scriptlike!(App(SourceFileName("main.d"),
BinaryFileName("$builddir/myapp")),
Flags("-g -debug"),
ImportPaths(["/path/to/imports"])
);
alias code_gen = target!("out.c", "./myapp $in $out", target!"in.txt", app);
mixin build!(code_gen);
});
writeFile("main.d", q{
import std.stdio;
import std.algorithm;
import std.conv;
void main(string[] args) {
auto inFileName = args[1];
auto outFileName = args[2];
auto lines = File(inFileName).byLine.
map!(a => a.to!string).
map!(a => a ~ ` ` ~ a);
auto outFile = File(outFileName, `w`);
foreach(line; lines) outFile.writeln(line);
}
});
writeFile("in.txt", ["foo", "bar", "baz"]);
runReggae("-b", "ninja");
ninja.shouldExecuteOk;
["cat", "out.c"].shouldExecuteOk;
shouldEqualLines("out.c",
["foo foo",
"bar bar",
"baz baz"]);
}
}
@("Issue 10: dubConfigurationTarget doesn't work for unittest builds")
@Tags(["ninja", "regressions"])
unittest {
import std.path;
import std.file;
with(immutable ReggaeSandbox()) {
writeFile("dub.json", `
{
"name": "dubproj",
"configurations": [
{ "name": "executable", "targetName": "foo"},
{ "name": "unittest", "targetName": "ut"}
]
}`);
writeFile("reggaefile.d", q{
import reggae;
alias ut = dubConfigurationTarget!(Configuration(`unittest`),
CompilerFlags(`-g -debug -cov`));
mixin build!ut;
});
mkdir(buildPath(testPath, "source"));
writeFile(buildPath("source", "src.d"), q{
unittest { static assert(false, `oopsie`); }
int add(int i, int j) { return i + j; }
});
writeFile(buildPath("source", "main.d"), q{
import src;
void main() {}
});
runReggae("-b", "ninja");
ninja.shouldFailToExecute(testPath);
}
}
|
{
"pile_set_name": "Github"
}
|
from pyomo.environ import *
# create the concrete model
model = ConcreteModel()
# set the data (native python data)
k1 = 5.0/6.0 # min^-1
k2 = 5.0/3.0 # min^-1
k3 = 1.0/6000.0 # m^3/(gmol min)
caf = 10000.0 # gmol/m^3
# create the variables
model.sv = Var(initialize = 1.0, within=PositiveReals)
model.ca = Var(initialize = 5000.0, within=PositiveReals)
model.cb = Var(initialize = 2000.0, within=PositiveReals)
model.cc = Var(initialize = 2000.0, within=PositiveReals)
model.cd = Var(initialize = 1000.0, within=PositiveReals)
# create the objective
model.obj = Objective(expr = model.cb, sense=maximize)
# create the constraints
model.ca_bal = Constraint(expr = (0 == model.sv * caf \
- model.sv * model.ca - k1 * model.ca \
- 2.0 * k3 * model.ca ** 2.0))
model.cb_bal = Constraint(expr=(0 == -model.sv * model.cb \
+ k1 * model.ca - k2 * model.cb))
model.cc_bal = Constraint(expr=(0 == -model.sv * model.cc \
+ k2 * model.cb))
model.cd_bal = Constraint(expr=(0 == -model.sv * model.cd \
+ k3 * model.ca ** 2.0))
# run the sequence of square problems
solver = SolverFactory('ipopt')
model.sv.fixed = True
sv_values = [1.0 + v * 0.05 for v in range(1, 20)]
print(" %s %s" % (str('sv'.rjust(10)), str('cb'.rjust(10))))
for sv_value in sv_values:
model.sv = sv_value
solver.solve(model)
print(" %s %s" %(str(model.sv.value).rjust(10),\
str(model.cb.value).rjust(15)))
|
{
"pile_set_name": "Github"
}
|
<template lang="html">
<div>
<b-modal
ref="tokenModal"
:title="$t('interface.tokens.modal.title')"
hide-footer
class="bootstrap-modal nopadding max-height-1"
centered
static
lazy
@hidden="resetCompState"
>
<form class="tokens-modal-body" @keydown.enter.prevent>
<div>
<input
v-model="tokenAddress"
v-validate="'required'"
:class="[
'custom-input-text-1',
tokenAddress !== '' && !validAddress ? 'invalid-address' : ''
]"
:placeholder="$t('interface.tokens.modal.ph-contract-addr')"
name="Address"
type="text"
/>
<span
v-show="tokenAddress !== '' && !validAddress"
class="error-message"
>
{{ $t('interface.tokens.modal.error.addr') }}
</span>
<input
v-model="tokenSymbol"
:placeholder="$t('interface.tokens.modal.ph-symbol')"
name="Symbol"
type="text"
class="custom-input-text-1"
/>
<input
v-model="tokenDecimal"
:placeholder="$t('interface.tokens.modal.ph-decimals')"
name="Decimal"
type="number"
min="0"
max="18"
class="custom-input-text-1"
/>
<span
v-show="tokenDecimal < 0 || tokenDecimal > 18"
class="error-message"
>
{{ $t('interface.tokens.modal.error.decimals') }}
</span>
</div>
<div class="button-block">
<button
:class="[
allFieldsValid ? '' : 'disabled',
'save-button large-round-button-green-filled clickable'
]"
@click.prevent="addToken(tokenAddress, tokenSymbol, tokenDecimal)"
>
{{ $t('common.save') }}
</button>
<interface-bottom-text
:link-text="$t('common.help-center')"
:question="$t('common.dont-know')"
link="https://kb.myetherwallet.com"
/>
</div>
</form>
</b-modal>
</div>
</template>
<script>
import InterfaceBottomText from '@/components/InterfaceBottomText';
import { mapState } from 'vuex';
import { isAddress } from '@/helpers/addressUtils';
export default {
components: {
'interface-bottom-text': InterfaceBottomText
},
props: {
addToken: {
type: Function,
default: function () {}
}
},
data() {
return {
tokenAddress: '',
tokenSymbol: '',
tokenDecimal: '',
validAddress: false
};
},
computed: {
...mapState('main', ['web3']),
allFieldsValid() {
if (!this.validAddress) return false;
if (this.tokenSymbol === '') return false;
if (
this.tokenDecimal < 0 ||
this.tokenDecimal > 18 ||
this.tokenDecimal === ''
)
return false;
if (
this.errors.has('address') ||
this.errors.has('symbol') ||
this.errors.has('decimal')
)
return false;
return true;
}
},
watch: {
tokenAddress(newVal) {
const strippedWhitespace = newVal.toLowerCase().trim();
const regTest = new RegExp(/[a-zA-Z0-9]/g);
this.validAddress =
regTest.test(strippedWhitespace) && isAddress(strippedWhitespace);
this.toAddress = strippedWhitespace;
this.tokenAddress = strippedWhitespace;
},
tokenSymbol(newVal) {
this.tokenSymbol = newVal.substr(0, 7);
}
},
methods: {
resetCompState() {
this.tokenAddress = '';
this.tokenSymbol = '';
this.tokenDecimal = '';
this.validAddress = false;
}
}
};
</script>
<style lang="scss" scoped>
@import 'InterfaceTokensModal.scss';
</style>
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magento.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magento.com for more information.
*
* @category design
* @package base_default
* @copyright Copyright (c) 2006-2020 Magento, Inc. (http://www.magento.com)
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<div class="page-title">
<h1><?php echo $this->__('Share Your Wishlist') ?></h1>
</div>
<?php echo $this->getMessagesBlock()->toHtml() ?>
<form action="<?php echo $this->getSendUrl() ?>" id="form-validate" method="post">
<div class="fieldset">
<?php echo $this->getBlockHtml('formkey')?>
<h2 class="legend"><?php echo $this->__('Sharing Information') ?></h2>
<ul class="form-list">
<li class="wide">
<label for="email_address" class="required"><em>*</em><?php echo $this->__('Up to 5 email addresses, separated by commas') ?></label>
<div class="input-box">
<textarea name="emails" cols="60" rows="5" id="email_address" class="validate-emails required-entry"><?php echo $this->getEnteredData('emails') ?></textarea>
</div>
</li>
<li class="wide">
<label for="message"><?php echo $this->__('Message') ?></label>
<div class="input-box">
<textarea id="message" name="message" cols="60" rows="3"><?php echo $this->getEnteredData('message') ?></textarea>
</div>
</li>
<?php if($this->helper('wishlist')->isRssAllow()): ?>
<li class="control">
<div class="input-box">
<input type="checkbox" name="rss_url" id="rss_url" value="1" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Check this checkbox if you want to add a link to an rss feed to your wishlist.')) ?>" class="checkbox" />
</div>
<label for="rss_url"><?php echo $this->__('Check this checkbox if you want to add a link to an rss feed to your wishlist.') ?></label>
</li>
<?php endif; ?>
<?php echo $this->getChildHtml('wishlist.sharing.form.additional.info'); ?>
</ul>
</div>
<div class="buttons-set form-buttons">
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
<p class="back-link"><a href="<?php echo $this->getBackUrl(); ?>"><small>« </small><?php echo $this->__('Back')?></a></p>
<button type="submit" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Share Wishlist')) ?>" class="button"><span><span><?php echo $this->__('Share Wishlist') ?></span></span></button>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
Validation.addAllThese([
['validate-emails', '<?php echo Mage::helper('core')->jsQuoteEscape($this->__('Please enter a valid email addresses, separated by commas. For example johndoe@domain.com, johnsmith@domain.com.')) ?>', function (v) {
if(Validation.get('IsEmpty').test(v)) {
return true;
}
var valid_regexp = /^[a-z0-9\._-]{1,30}@([a-z0-9_-]{1,30}\.){1,5}[a-z]{2,4}$/i;
var emails = v.split(',');
for (var i=0; i<emails.length; i++) {
if(!valid_regexp.test(emails[i].strip())) {
return false;
}
}
return true;
}]
]);
var dataForm = new VarienForm('form-validate', true);
//]]>
</script>
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html>
<head>
<title>APIドキュメント</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap.min.css'/>
<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/prettify.css'/>
<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/bundled/bootstrap-responsive.min.css'/>
<link type='text/css' rel='stylesheet' href='../../../apidoc/stylesheets/application.css'/>
<!-- IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="container-fluid">
<div class="row-fluid">
<div id='container'>
<ul class='breadcrumb'>
<li>
<a href='../../../apidoc/v2.ja.html'>Foreman v2</a>
<span class='divider'>/</span>
</li>
<li>
<a href='../../../apidoc/v2/architectures.ja.html'>
Architectures
</a>
<span class='divider'>/</span>
</li>
<li class='active'>create</li>
<li class='pull-right'>
[ <a href="../../../apidoc/v2/architectures/create.ca.html">ca</a> | <a href="../../../apidoc/v2/architectures/create.cs_CZ.html">cs_CZ</a> | <a href="../../../apidoc/v2/architectures/create.de.html">de</a> | <a href="../../../apidoc/v2/architectures/create.en.html">en</a> | <a href="../../../apidoc/v2/architectures/create.en_GB.html">en_GB</a> | <a href="../../../apidoc/v2/architectures/create.es.html">es</a> | <a href="../../../apidoc/v2/architectures/create.fr.html">fr</a> | <a href="../../../apidoc/v2/architectures/create.gl.html">gl</a> | <a href="../../../apidoc/v2/architectures/create.it.html">it</a> | <b><a href="../../../apidoc/v2/architectures/create.ja.html">ja</a></b> | <a href="../../../apidoc/v2/architectures/create.ko.html">ko</a> | <a href="../../../apidoc/v2/architectures/create.nl_NL.html">nl_NL</a> | <a href="../../../apidoc/v2/architectures/create.pl.html">pl</a> | <a href="../../../apidoc/v2/architectures/create.pt_BR.html">pt_BR</a> | <a href="../../../apidoc/v2/architectures/create.ru.html">ru</a> | <a href="../../../apidoc/v2/architectures/create.sv_SE.html">sv_SE</a> | <a href="../../../apidoc/v2/architectures/create.zh_CN.html">zh_CN</a> | <a href="../../../apidoc/v2/architectures/create.zh_TW.html">zh_TW</a> ]
</li>
</ul>
<div class='page-header'>
<h1>
POST /api/architectures
<br>
<small>アーキテクチャーの作成</small>
</h1>
</div>
<div>
<h2>例</h2>
<pre class="prettyprint">POST /api/architectures
{
"architecture": {
"name": "i386"
}
}
201
{
"created_at": "2020-03-11 07:55:01 UTC",
"updated_at": "2020-03-11 07:55:01 UTC",
"name": "i386",
"id": 922134522,
"operatingsystems": [],
"images": []
}</pre>
<h2>パラメーター</h2>
<table class='table'>
<thead>
<tr>
<th>パラメーター名</th>
<th>記述</th>
</tr>
</thead>
<tbody>
<tr style='background-color:rgb(255,255,255);'>
<td>
<strong>location_id </strong><br>
<small>
任意
</small>
</td>
<td>
<p>Set the current location context for the request</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a Integer</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(255,255,255);'>
<td>
<strong>organization_id </strong><br>
<small>
任意
</small>
</td>
<td>
<p>Set the current organization context for the request</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a Integer</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(255,255,255);'>
<td>
<strong>architecture </strong><br>
<small>
必須
</small>
</td>
<td>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a Hash</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>architecture[name] </strong><br>
<small>
必須
</small>
</td>
<td>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be a String</p>
</li>
</ul>
</td>
</tr>
<tr style='background-color:rgb(250,250,250);'>
<td>
<strong>architecture[operatingsystem_ids] </strong><br>
<small>
任意
, nil可
</small>
</td>
<td>
<p>オペレーティングシステム ID</p>
<p><strong>Validations:</strong></p>
<ul>
<li>
<p>Must be an array of any type</p>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<hr>
<footer></footer>
</div>
<script type='text/javascript' src='../../../apidoc/javascripts/bundled/jquery.js'></script>
<script type='text/javascript' src='../../../apidoc/javascripts/bundled/bootstrap-collapse.js'></script>
<script type='text/javascript
|
{
"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.
//
#import <UIFoundation/NSCollectionViewLayout.h>
@interface NSCollectionViewLayout (NSPrivateItemSequence)
+ (BOOL)itemLayoutIsSequential;
@end
|
{
"pile_set_name": "Github"
}
|
# @generated by autocargo from //hphp/hack/src/hhbc:emit_fatal_rust
[package]
name = "emit_fatal_rust"
edition = "2018"
version = "0.0.0"
include = ["../../emit_fatal.rs"]
[lib]
path = "../../emit_fatal.rs"
[dependencies]
emit_pos_rust = { path = "../emit_pos" }
hhbc_ast_rust = { path = "../hhbc_ast" }
instruction_sequence_rust = { path = "../instruction_sequence" }
oxidized = { path = "../../../oxidized" }
|
{
"pile_set_name": "Github"
}
|
Change Log
==========
0.2.1 (2016-04-15)
------------------
* Packaging fix
0.2 (2016-04-15)
----------------
* Added docs and tests
* Published on PyPI
0.1 (2016-04-11)
----------------
Initial release
|
{
"pile_set_name": "Github"
}
|
//
// EncryptionKit.swift
// ProtonMail - Created on 12/18/18.
//
//
// Copyright (c) 2019 Proton Technologies AG
//
// This file is part of ProtonMail.
//
// ProtonMail 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
// (at your option) any later version.
//
// ProtonMail 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 ProtonMail. If not, see <https://www.gnu.org/licenses/>.
import Foundation
/// initally for push notification key
struct EncryptionKit: Codable, Equatable {
var passphrase, privateKey, publicKey: String
}
|
{
"pile_set_name": "Github"
}
|
### Arguments
#### `argument_name`
* Is required: yes
* Is array: no
* Default: `NULL`
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>QUnit Test Suite - Canvas Addon</title>
<link rel="stylesheet" href="../../qunit/qunit.css" type="text/css" media="screen">
<script type="text/javascript" src="../../qunit/qunit.js"></script>
<script type="text/javascript" src="qunit-canvas.js"></script>
<script type="text/javascript" src="canvas-test.js"></script>
</head>
<body>
<h1 id="qunit-header">QUnit Test Suite - Canvas Addon</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<canvas id="qunit-canvas" width="5" height="5"></canvas>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
name: rdev_get_ringparam
ID: 721
format:
field:unsigned short common_type; offset:0; size:2; signed:0;
field:unsigned char common_flags; offset:2; size:1; signed:0;
field:unsigned char common_preempt_count; offset:3; size:1; signed:0;
field:int common_pid; offset:4; size:4; signed:1;
field:char wiphy_name[32]; offset:8; size:32; signed:0;
print fmt: "%s", REC->wiphy_name
|
{
"pile_set_name": "Github"
}
|
/*
* jccoefct.c
*
* Copyright (C) 1994-1997, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This file contains the coefficient buffer controller for compression.
* This controller is the top level of the JPEG compressor proper.
* The coefficient buffer lies between forward-DCT and entropy encoding steps.
*/
#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
/* We use a full-image coefficient buffer when doing Huffman optimization,
* and also for writing multiple-scan JPEG files. In all cases, the DCT
* step is run during the first pass, and subsequent passes need only read
* the buffered coefficients.
*/
#ifdef ENTROPY_OPT_SUPPORTED
#define FULL_COEF_BUFFER_SUPPORTED
#else
#ifdef C_MULTISCAN_FILES_SUPPORTED
#define FULL_COEF_BUFFER_SUPPORTED
#endif
#endif
/* Private buffer controller object */
typedef struct {
struct jpeg_c_coef_controller pub; /* public fields */
JDIMENSION iMCU_row_num; /* iMCU row # within image */
JDIMENSION mcu_ctr; /* counts MCUs processed in current row */
int MCU_vert_offset; /* counts MCU rows within iMCU row */
int MCU_rows_per_iMCU_row; /* number of such rows needed */
/* For single-pass compression, it's sufficient to buffer just one MCU
* (although this may prove a bit slow in practice). We allocate a
* workspace of C_MAX_BLOCKS_IN_MCU coefficient blocks, and reuse it for each
* MCU constructed and sent. (On 80x86, the workspace is FAR even though
* it's not really very big; this is to keep the module interfaces unchanged
* when a large coefficient buffer is necessary.)
* In multi-pass modes, this array points to the current MCU's blocks
* within the virtual arrays.
*/
JBLOCKROW MCU_buffer[C_MAX_BLOCKS_IN_MCU];
/* In multi-pass modes, we need a virtual block array for each component. */
jvirt_barray_ptr whole_image[MAX_COMPONENTS];
} my_coef_controller;
typedef my_coef_controller * my_coef_ptr;
/* Forward declarations */
METHODDEF(boolean) compress_data
JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
#ifdef FULL_COEF_BUFFER_SUPPORTED
METHODDEF(boolean) compress_first_pass
JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
METHODDEF(boolean) compress_output
JPP((j_compress_ptr cinfo, JSAMPIMAGE input_buf));
#endif
LOCAL(void)
start_iMCU_row (j_compress_ptr cinfo)
/* Reset within-iMCU-row counters for a new row */
{
my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
/* In an interleaved scan, an MCU row is the same as an iMCU row.
* In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
* But at the bottom of the image, process only what's left.
*/
if (cinfo->comps_in_scan > 1) {
coef->MCU_rows_per_iMCU_row = 1;
} else {
if (coef->iMCU_row_num < (cinfo->total_iMCU_rows-1))
coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
else
coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
}
coef->mcu_ctr = 0;
coef->MCU_vert_offset = 0;
}
/*
* Initialize for a processing pass.
*/
METHODDEF(void)
start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
{
my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
coef->iMCU_row_num = 0;
start_iMCU_row(cinfo);
switch (pass_mode) {
case JBUF_PASS_THRU:
if (coef->whole_image[0] != NULL)
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
coef->pub.compress_data = compress_data;
break;
#ifdef FULL_COEF_BUFFER_SUPPORTED
case JBUF_SAVE_AND_PASS:
if (coef->whole_image[0] == NULL)
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
coef->pub.compress_data = compress_first_pass;
break;
case JBUF_CRANK_DEST:
if (coef->whole_image[0] == NULL)
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
coef->pub.compress_data = compress_output;
break;
#endif
default:
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
break;
}
}
/*
* Process some data in the single-pass case.
* We process the equivalent of one fully interleaved MCU row ("iMCU" row)
* per call, ie, v_samp_factor block rows for each component in the image.
* Returns TRUE if the iMCU row is completed, FALSE if suspended.
*
* NB: input_buf contains a plane for each component in image,
* which we index according to the component's SOF position.
*/
METHODDEF(boolean)
compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
{
my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
JDIMENSION MCU_col_num; /* index of current MCU within row */
JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
int blkn, bi, ci, yindex, yoffset, blockcnt;
JDIMENSION ypos, xpos;
jpeg_component_info *compptr;
/* Loop to write as much as one whole iMCU row */
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
yoffset++) {
for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col;
MCU_col_num++) {
/* Determine where data comes from in input_buf and do the DCT thing.
* Each call on forward_DCT processes a horizontal row of DCT blocks
* as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks
* sequentially. Dummy blocks at the right or bottom edge are filled in
* specially. The data in them does not matter for image reconstruction,
* so we fill them with values that will encode to the smallest amount of
* data, viz: all zeroes in the AC entries, DC entries equal to previous
* block's DC value. (Thanks to Thomas Kinsman for this idea.)
*/
blkn = 0;
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
: compptr->last_col_width;
xpos = MCU_col_num * compptr->MCU_sample_width;
ypos = yoffset * D
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_JFR_RECORDER_CHECKPOINT_TYPES_JFRTHREADSTATE_HPP
#define SHARE_VM_JFR_RECORDER_CHECKPOINT_TYPES_JFRTHREADSTATE_HPP
#include "memory/allocation.hpp"
class JfrCheckpointWriter;
class JfrThreadState : public AllStatic {
public:
static void serialize(JfrCheckpointWriter& writer);
};
#endif // SHARE_VM_JFR_RECORDER_CHECKPOINT_TYPES_JFRTHREADSTATE_HPP
|
{
"pile_set_name": "Github"
}
|
/* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#define EIGEN_USE_THREADS
#include "tensorflow/core/kernels/concat_lib_cpu.h"
#include <vector>
#include "tensorflow/core/framework/register_types.h"
#include "tensorflow/core/kernels/concat_lib.h"
namespace tensorflow {
namespace {
template <typename T>
struct MemCpyCopier {
inline void Copy(T* dst, const T* src, int input_index, size_t n) {
if (DataTypeCanUseMemcpy(DataTypeToEnum<T>::v())) {
memcpy(dst, src, n * sizeof(T));
} else {
for (size_t k = 0; k < n; ++k) {
*dst++ = *src++;
}
}
}
};
template <>
struct MemCpyCopier<ResourceHandle> {
inline void Copy(ResourceHandle* dst, const ResourceHandle* src,
int input_index, size_t n) {
for (size_t k = 0; k < n; ++k) {
*dst++ = *src++;
}
}
};
} // namespace
template <typename T>
void ConcatCPU(DeviceBase* d,
const std::vector<
std::unique_ptr<typename TTypes<T, 2>::ConstMatrix>>& inputs,
typename TTypes<T, 2>::Matrix* output) {
if (std::is_same<T, string>::value) {
// use a large cost here to force strings to be handled by separate threads
ConcatCPUImpl<T>(d, inputs, 100000, MemCpyCopier<T>(), output);
} else {
ConcatCPUImpl<T>(d, inputs, sizeof(T) /* cost_per_unit */,
MemCpyCopier<T>(), output);
}
}
#define REGISTER(T) \
template void ConcatCPU<T>( \
DeviceBase*, \
const std::vector<std::unique_ptr<typename TTypes<T, 2>::ConstMatrix>>&, \
typename TTypes<T, 2>::Matrix* output);
TF_CALL_ALL_TYPES(REGISTER)
REGISTER(quint8)
REGISTER(qint8)
REGISTER(quint16)
REGISTER(qint16)
REGISTER(qint32)
REGISTER(bfloat16)
TF_CALL_variant(REGISTER)
#if defined(IS_MOBILE_PLATFORM) && !defined(SUPPORT_SELECTIVE_REGISTRATION) && \
!defined(__ANDROID_TYPES_FULL__)
// Primarily used for SavedModel support on mobile. Registering it here only
// if __ANDROID_TYPES_FULL__ is not defined (which already registers string)
// to avoid duplicate registration.
REGISTER(string);
#endif // defined(IS_MOBILE_PLATFORM) &&
// !defined(SUPPORT_SELECTIVE_REGISTRATION) &&
// !defined(__ANDROID_TYPES_FULL__)
#ifdef TENSORFLOW_USE_SYCL
template <typename T>
void ConcatSYCL(const Eigen::SyclDevice& d,
const std::vector<
std::unique_ptr<typename TTypes<T, 2>::ConstMatrix>>& inputs,
typename TTypes<T, 2>::Matrix* output) {
ConcatSYCLImpl<T>(d, inputs, sizeof(T) /* cost_per_unit */, MemCpyCopier<T>(),
output);
}
#define REGISTER_SYCL(T) \
template void ConcatSYCL<T>( \
const Eigen::SyclDevice&, \
const std::vector<std::unique_ptr<typename TTypes<T, 2>::ConstMatrix>>&, \
typename TTypes<T, 2>::Matrix* output);
TF_CALL_GPU_NUMBER_TYPES_NO_HALF(REGISTER_SYCL)
#undef REGISTER_SYCL
#endif // TENSORFLOW_USE_SYCL
} // namespace tensorflow
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env bash
#####################################################################
# genallfont.sh for Marlin
#
# This script generates font data for language headers
#
# Copyright 2015-2018 Yunhui Fu <yhfudev@gmail.com>
# License: GPL/BSD
#####################################################################
my_getpath() {
local PARAM_DN="$1"
shift
#readlink -f
local DN="${PARAM_DN}"
local FN=
if [ ! -d "${DN}" ]; then
FN=$(basename "${DN}")
DN=$(dirname "${DN}")
fi
cd "${DN}" > /dev/null 2>&1
DN=$(pwd)
cd - > /dev/null 2>&1
echo -n "${DN}"
[[ -z "$FN" ]] || echo -n "/${FN}"
}
#DN_EXEC=`echo "$0" | ${EXEC_AWK} -F/ '{b=$1; for (i=2; i < NF; i ++) {b=b "/" $(i)}; print b}'`
DN_EXEC=$(dirname $(my_getpath "$0") )
EXEC_WXGGEN="${DN_EXEC}/uxggenpages.sh"
#
# Locate the bdf2u8g command
#
EXEC_BDF2U8G=`which bdf2u8g`
[ -x "${EXEC_BDF2U8G}" ] || EXEC_BDF2U8G="${DN_EXEC}/bdf2u8g"
[ -x "${EXEC_BDF2U8G}" ] || EXEC_BDF2U8G="${PWD}/bdf2u8g"
[ -x "${EXEC_BDF2U8G}" ] || { EOL=$'\n' ; echo "ERR: Can't find bdf2u8g!${EOL}See uxggenpages.md for bdf2u8g build instructions." >&2 ; exit 1; }
#
# Get language arguments
#
LANG_ARG="$@"
#
# Use 6x12 combined font data for Western languages
#
FN_FONT="${DN_EXEC}/marlin-6x12-3.bdf"
#
# Change to working directory 'Marlin'
#
OLDWD=`pwd`
[[ $(basename "$OLDWD") != 'Marlin' && -d "Marlin" ]] && cd Marlin
[[ -f "Configuration.h" ]] || { echo -n "cd to the 'Marlin' folder to run " ; basename $0 ; exit 1; }
#
# Compile the 'genpages' command in-place
#
(cd ${DN_EXEC}; gcc -o genpages genpages.c getline.c)
#
# By default loop through all languages
#
LANGS_DEFAULT="an bg ca cz da de el el_gr en es eu fi fr gl hr it jp_kana ko_KR nl pl pt pt_br ru sk tr uk vi zh_CN zh_TW test"
#
# Generate data for language list MARLIN_LANGS or all if not provided
#
for LANG in ${LANG_ARG:=$LANGS_DEFAULT} ; do
echo "Generating Marlin language data for '${LANG}'" >&2
case "$LANG" in
zh_* ) FONTFILE="wenquanyi_12pt" ;;
ko_* ) FONTFILE="${DN_EXEC}/NanumGothic.bdf" ;;
* ) FONTFILE="${DN_EXEC}/marlin-6x12-3.bdf" ;;
esac
DN_WORK=`mktemp -d`
cp Configuration.h ${DN_WORK}/
cp src/lcd/language/language_${LANG}.h ${DN_WORK}/
cd "${DN_WORK}"
${EXEC_WXGGEN} "${FONTFILE}"
sed -i fontutf8-data.h -e 's|fonts//|fonts/|g' -e 's|fonts//|fonts/|g' -e 's|[/0-9a-zA-Z_\-]*buildroot/share/fonts|buildroot/share/fonts|' 2>/dev/null
cd - >/dev/null
mv ${DN_WORK}/fontutf8-data.h src/lcd/dogm/fontdata/langdata_${LANG}.h
rm -rf ${DN_WORK}
done
#
# Generate default ASCII font (char range 0-255):
# Marlin/src/lcd/dogm/fontdata/fontdata_ISO10646_1.h
#
#if [ "${MARLIN_LANGS}" == "${LANGS_DEFAULT}" ]; then
if [ 1 = 1 ]; then
DN_WORK=`mktemp -d`
cd ${DN_WORK}
${EXEC_BDF2U8G} -b 1 -e 127 ${FN_FONT} ISO10646_1_5x7 tmp1.h >/dev/null
${EXEC_BDF2U8G} -b 1 -e 255 ${FN_FONT} ISO10646_1_5x7 tmp2.h >/dev/null
TMP1=$(cat tmp1.h)
TMP2=$(cat tmp2.h)
cd - >/dev/null
rm -rf ${DN_WORK}
cat <<EOF >src/lcd/dogm/fontdata/fontdata_ISO10646_1.h
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* 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
* (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 <U8glib.h>
#if defined(__AVR__) && ENABLED(NOT_EXTENDED_ISO10646_1_5X7)
// reduced font (only symbols 1 - 127) - saves about 1278 bytes of FLASH
$TMP1
#else
// extended (original) font (symbols 1 - 255)
$TMP2
#endif
EOF
fi
(cd ${DN_EXEC}; rm genpages)
cd "$OLDWD"
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef URLInputType_h
#define URLInputType_h
#include "BaseTextInputType.h"
namespace WebCore {
class URLInputType : public BaseTextInputType {
public:
static PassOwnPtr<InputType> create(HTMLInputElement*);
private:
URLInputType(HTMLInputElement* element) : BaseTextInputType(element) { }
virtual const AtomicString& formControlType() const;
virtual bool typeMismatchFor(const String&) const;
virtual bool typeMismatch() const;
virtual String typeMismatchText() const;
virtual bool isURLField() const;
};
} // namespace WebCore
#endif // URLInputType_h
|
{
"pile_set_name": "Github"
}
|
version: 1
dn: m-oid=1.3.6.1.4.1.42.2.27.4.1.6,ou=attributeTypes,cn=java,ou=schema
creatorsname: uid=admin,ou=system
objectclass: metaAttributeType
objectclass: metaTop
objectclass: top
m-equality: caseExactMatch
m-syntax: 1.3.6.1.4.1.1466.115.121.1.15
m-singlevalue: TRUE
m-collective: FALSE
m-nousermodification: FALSE
m-usage: USER_APPLICATIONS
m-oid: 1.3.6.1.4.1.42.2.27.4.1.6
m-name: javaClassName
m-description: Fully qualified name of distinguished Java class or interface
m-obsolete: FALSE
entryUUID: 0306e4a6-82a3-43f5-8990-42b6ff9b1714
entryCSN: 20130919081858.901000Z#000000#000#000000
entryParentId: b6bd9cdf-6973-431e-beae-f51d70d1183a
createTimestamp: 20130919081908.481Z
|
{
"pile_set_name": "Github"
}
|
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
from .box_head.box_head import build_roi_box_head
from .mask_head.mask_head import build_roi_mask_head
from .keypoint_head.keypoint_head import build_roi_keypoint_head
class CombinedROIHeads(torch.nn.ModuleDict):
"""
Combines a set of individual heads (for box prediction or masks) into a single
head.
"""
def __init__(self, cfg, heads):
super(CombinedROIHeads, self).__init__(heads)
self.cfg = cfg.clone()
if cfg.MODEL.MASK_ON and cfg.MODEL.ROI_MASK_HEAD.SHARE_BOX_FEATURE_EXTRACTOR:
self.mask.feature_extractor = self.box.feature_extractor
if cfg.MODEL.KEYPOINT_ON and cfg.MODEL.ROI_KEYPOINT_HEAD.SHARE_BOX_FEATURE_EXTRACTOR:
self.keypoint.feature_extractor = self.box.feature_extractor
def forward(self, features, proposals, targets=None):
losses = {}
# TODO rename x to roi_box_features, if it doesn't increase memory consumption
x, detections, loss_box = self.box(features, proposals, targets)
losses.update(loss_box)
if self.cfg.MODEL.MASK_ON:
mask_features = features
# optimization: during training, if we share the feature extractor between
# the box and the mask heads, then we can reuse the features already computed
if (
self.training
and self.cfg.MODEL.ROI_MASK_HEAD.SHARE_BOX_FEATURE_EXTRACTOR
):
mask_features = x
# During training, self.box() will return the unaltered proposals as "detections"
# this makes the API consistent during training and testing
x, detections, loss_mask = self.mask(mask_features, detections, targets)
losses.update(loss_mask)
if self.cfg.MODEL.KEYPOINT_ON:
keypoint_features = features
# optimization: during training, if we share the feature extractor between
# the box and the mask heads, then we can reuse the features already computed
if (
self.training
and self.cfg.MODEL.ROI_KEYPOINT_HEAD.SHARE_BOX_FEATURE_EXTRACTOR
):
keypoint_features = x
# During training, self.box() will return the unaltered proposals as "detections"
# this makes the API consistent during training and testing
x, detections, loss_keypoint = self.keypoint(keypoint_features, detections, targets)
losses.update(loss_keypoint)
return x, detections, losses
def build_roi_heads(cfg):
# individually create the heads, that will be combined together
# afterwards
roi_heads = []
if cfg.MODEL.RETINANET_ON:
return []
if not cfg.MODEL.RPN_ONLY:
roi_heads.append(("box", build_roi_box_head(cfg)))
if cfg.MODEL.MASK_ON:
roi_heads.append(("mask", build_roi_mask_head(cfg)))
if cfg.MODEL.KEYPOINT_ON:
roi_heads.append(("keypoint", build_roi_keypoint_head(cfg)))
# combine individual heads in a single module
if roi_heads:
roi_heads = CombinedROIHeads(cfg, roi_heads)
return roi_heads
|
{
"pile_set_name": "Github"
}
|
page_title: Managing Data in Containers
page_description: How to manage data inside your Docker containers.
page_keywords: Examples, Usage, volume, docker, documentation, user guide, data, volumes
# Managing Data in Containers
So far we've been introduced to some [basic Docker
concepts](/userguide/usingdocker/), seen how to work with [Docker
images](/userguide/dockerimages/) as well as learned about [networking
and links between containers](/userguide/dockerlinks/). In this section
we're going to discuss how you can manage data inside and between your
Docker containers.
We're going to look at the two primary ways you can manage data in
Docker.
* Data volumes, and
* Data volume containers.
## Data volumes
A *data volume* is a specially-designated directory within one or more
containers that bypasses the [*Union File
System*](/terms/layer/#union-file-system) to provide several useful features for
persistent or shared data:
- Volumes are initialized when a container is created
- Data volumes can be shared and reused between containers
- Changes to a data volume are made directly
- Changes to a data volume will not be included when you update an image
- Volumes persist until no containers use them
### Adding a data volume
You can add a data volume to a container using the `-v` flag with the
`docker create` and `docker run` command. You can use the `-v` multiple times
to mount multiple data volumes. Let's mount a single volume now in our web
application container.
$ sudo docker run -d -P --name web -v /webapp training/webapp python app.py
This will create a new volume inside a container at `/webapp`.
> **Note:**
> You can also use the `VOLUME` instruction in a `Dockerfile` to add one or
> more new volumes to any container created from that image.
### Mount a Host Directory as a Data Volume
In addition to creating a volume using the `-v` flag you can also mount a
directory from your Docker daemon's host into a container.
> **Note:**
> If you are using Boot2Docker, your Docker daemon only has limited access to
> your OSX/Windows filesystem. Boot2Docker tries to auto-share your `/Users`
> (OSX) or `C:\Users` (Windows) directory - and so you can mount files or directories
> using `docker run -v /Users/<path>:/<container path> ...` (OSX) or
> `docker run -v /c/Users/<path>:/<container path ...` (Windows). All other paths
> come from the Boot2Docker virtual machine's filesystem.
$ sudo docker run -d -P --name web -v /src/webapp:/opt/webapp training/webapp python app.py
This will mount the host directory, `/src/webapp`, into the container at
`/opt/webapp`.
> **Note:**
> If the path `/opt/webapp` already exists inside the container's image, its
> contents will be replaced by the contents of `/src/webapp` on the host to stay
> consistent with the expected behavior of `mount`
This is very useful for testing, for example we can
mount our source code inside the container and see our application at work as
we change the source code. The directory on the host must be specified as an
absolute path and if the directory doesn't exist Docker will automatically
create it for you.
> **Note:**
> This is not available from a `Dockerfile` due to the portability
> and sharing purpose of built images. The host directory is, by its nature,
> host-dependent, so a host directory specified in a `Dockerfile` probably
> wouldn't work on all hosts.
Docker defaults to a read-write volume but we can also mount a directory
read-only.
$ sudo docker run -d -P --name web -v /src/webapp:/opt/webapp:ro training/webapp python app.py
Here we've mounted the same `/src/webapp` directory but we've added the `ro`
option to specify that the mount should be read-only.
### Mount a Host File as a Data Volume
The `-v` flag can also be used to mount a single file - instead of *just*
directories - from the host machine.
$ sudo docker run --rm -it -v ~/.bash_history:/.bash_history ubuntu /bin/bash
This will drop you into a bash shell in a new container, you will have your bash
history from the host and when you exit the container, the host will have the
history of the commands typed while in the container.
> **Note:**
> Many tools used to edit files including `vi` and `sed --in-place` may result
> in an inode change. Since Docker v1.1.0, this will produce an error such as
> "*sed: cannot rename ./sedKdJ9Dy: Device or resource busy*". In the case where
> you want to edit the mounted file, it is often easiest to instead mount the
> parent directory.
## Creating and mounting a Data Volume Container
If you have some persistent data that you want to share between
containers, or want to use from non-persistent containers, it's best to
create a named Data Volume Container, and then to mount the data from
it.
Let's create a new named container with a volume to share.
While this container doesn't run an application, it reuses the `training/postgres`
image so that all containers are using layers in common, saving disk space.
$ sudo docker create -v /dbdata --name dbdata training/postgres
You can then use the `--volumes-from` flag to mount the `/dbdata` volume in another container.
$ sudo docker run -d --volumes-from dbdata --name db1 training/postgres
And another:
$ sudo docker run -d --volumes-from dbdata --name db2 training/postgres
You can use multiple `--volumes-from` parameters to bring together multiple data
volumes from multiple containers.
You can also extend the chain by mounting the volume that came from the
`dbdata` container in yet another container via the `db1` or `db2` containers.
$ sudo docker run -d --name db3 --volumes-from db1 training/postgres
If you remove containers that mount volumes, including the initial `dbdata`
container, or the subsequent containers `db1` and `db2`, the volumes will not
be deleted. To delete the volume from disk, you must explicitly call
`docker rm -v` against the last container with a reference to the volume. This
allows you to upgrade, or effectively migrate data volumes between containers.
## Backup, restore, or migrate data volumes
Another useful function we can perform with volumes is use them for
backups, restores or migrations. We do this by using the
`--volumes-from` flag to create a new container that mounts that volume,
like so:
$ sudo docker run --volumes-from dbdata -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /dbdata
Here we've launched a new container and mounted the volume from the
`dbdata` container. We've then mounted a local host directory as
`/backup`. Finally, we've passed a command that uses `tar` to backup the
contents of the `dbdata` volume to a `backup.tar` file inside our
`/backup` directory. When the command completes and the container stops
we'll be left with a backup of our `dbdata` volume.
You could then restore it to the same container, or another that you've made
elsewhere. Create a new container.
$ sudo docker run -v /dbdata --name dbdata2 ubuntu /bin/bash
Then un-tar the backup file in the new container's data volume.
$ sudo docker run --volumes-from dbdata2 -v $(pwd):/backup busybox tar xvf /backup/backup.tar
You can use the techniques above to automate backup, migration and
restore testing using your preferred tools.
# Next steps
Now we've learned a bit more about how to use Docker we're going to see how to
combine Docker with the services available on
[Docker Hub](https://hub.docker.com) including Automated Builds and private
repositories.
Go to [Working with Docker Hub](/userguide/dockerrepos).
|
{
"pile_set_name": "Github"
}
|
#pragma once
#include <iterator> // random_access_iterator_tag
#include <nlohmann/detail/meta/void_t.hpp>
#include <nlohmann/detail/meta/cpp_future.hpp>
namespace nlohmann
{
namespace detail
{
template<typename It, typename = void>
struct iterator_types {};
template<typename It>
struct iterator_types <
It,
void_t<typename It::difference_type, typename It::value_type, typename It::pointer,
typename It::reference, typename It::iterator_category >>
{
using difference_type = typename It::difference_type;
using value_type = typename It::value_type;
using pointer = typename It::pointer;
using reference = typename It::reference;
using iterator_category = typename It::iterator_category;
};
// This is required as some compilers implement std::iterator_traits in a way that
// doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341.
template<typename T, typename = void>
struct iterator_traits
{
};
template<typename T>
struct iterator_traits < T, enable_if_t < !std::is_pointer<T>::value >>
: iterator_types<T>
{
};
template<typename T>
struct iterator_traits<T*, enable_if_t<std::is_object<T>::value>>
{
using iterator_category = std::random_access_iterator_tag;
using value_type = T;
using difference_type = ptrdiff_t;
using pointer = T*;
using reference = T&;
};
} // namespace detail
} // namespace nlohmann
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<meta charset="utf-8">
<title>IDBObjectStore.createIndex() - empty keyPath</title>
<link rel="author" href="mailto:odinho@opera.com" title="Odin Hørthe Omdal">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="support.js"></script>
<script>
var db, aborted,
t = async_test()
var open_rq = createdb(t);
open_rq.onupgradeneeded = function(e) {
db = e.target.result;
var txn = e.target.transaction,
objStore = db.createObjectStore("store");
for (var i = 0; i < 5; i++)
objStore.add("object_" + i, i);
var rq = objStore.createIndex("index", "")
rq.onerror = function() { assert_unreached("error: " + rq.error.name); }
rq.onsuccess = function() { }
objStore.index("index")
.get('object_4')
.onsuccess = t.step_func(function(e) {
assert_equals(e.target.result, 'object_4', 'result');
});
}
open_rq.onsuccess = function() {
t.done();
}
</script>
<div id="log"></div>
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// (c) 2005-2008 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/
if(Object.isUndefined(Effect))
throw("dragdrop.js requires including script.aculo.us' effects.js library");
var Droppables = {
drops: [],
remove: function(element) {
this.drops = this.drops.reject(function(d) { return d.element==$(element) });
},
add: function(element) {
element = $(element);
var options = Object.extend({
greedy: true,
hoverclass: null,
tree: false
}, arguments[1] || { });
// cache containers
if(options.containment) {
options._containers = [];
var containment = options.containment;
if(Object.isArray(containment)) {
containment.each( function(c) { options._containers.push($(c)) });
} else {
options._containers.push($(containment));
}
}
if(options.accept) options.accept = [options.accept].flatten();
Element.makePositioned(element); // fix IE
options.element = element;
this.drops.push(options);
},
findDeepestChild: function(drops) {
deepest = drops[0];
for (i = 1; i < drops.length; ++i)
if (Element.isParent(drops[i].element, deepest.element))
deepest = drops[i];
return deepest;
},
isContained: function(element, drop) {
var containmentNode;
if(drop.tree) {
containmentNode = element.treeNode;
} else {
containmentNode = element.parentNode;
}
return drop._containers.detect(function(c) { return containmentNode == c });
},
isAffected: function(point, element, drop) {
return (
(drop.element!=element) &&
((!drop._containers) ||
this.isContained(element, drop)) &&
((!drop.accept) ||
(Element.classNames(element).detect(
function(v) { return drop.accept.include(v) } ) )) &&
Position.within(drop.element, point[0], point[1]) );
},
deactivate: function(drop) {
if(drop.hoverclass)
Element.removeClassName(drop.element, drop.hoverclass);
this.last_active = null;
},
activate: function(drop) {
if(drop.hoverclass)
Element.addClassName(drop.element, drop.hoverclass);
this.last_active = drop;
},
show: function(point, element) {
if(!this.drops.length) return;
var drop, affected = [];
this.drops.each( function(drop) {
if(Droppables.isAffected(point, element, drop))
affected.push(drop);
});
if(affected.length>0)
drop = Droppables.findDeepestChild(affected);
if(this.last_active && this.last_active != drop) this.deactivate(this.last_active);
if (drop) {
Position.within(drop.element, point[0], point[1]);
if(drop.onHover)
drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element));
if (drop != this.last_active) Droppables.activate(drop);
}
},
fire: function(event, element) {
if(!this.last_active) return;
Position.prepare();
if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active))
if (this.last_active.onDrop) {
this.last_active.onDrop(element, this.last_active.element, event);
return true;
}
},
reset: function() {
if(this.last_active)
this.deactivate(this.last_active);
}
};
var Draggables = {
drags: [],
observers: [],
register: function(draggable) {
if(this.drags.length == 0) {
this.eventMouseUp = this.endDrag.bindAsEventListener(this);
this.eventMouseMove = this.updateDrag.bindAsEventListener(this);
this.eventKeypress = this.keyPress.bindAsEventListener(this);
Event.observe(document, "mouseup", this.eventMouseUp);
Event.observe(document, "mousemove", this.eventMouseMove);
Event.observe(document, "keypress", this.eventKeypress);
}
this.drags.push(draggable);
},
unregister: function(draggable) {
this.drags = this.drags.reject(function(d) { return d==draggable });
if(this.drags.length == 0) {
Event.stopObserving(document, "mouseup", this.eventMouseUp);
Event.stopObserving(document, "mousemove", this.eventMouseMove);
Event.stopObserving(document, "keypress", this.eventKeypress);
}
},
activate: function(draggable) {
if(draggable.options.delay) {
this._timeout = setTimeout(function() {
Draggables._timeout = null;
window.focus();
Draggables.activeDraggable = draggable;
}.bind(this), draggable.options.delay);
} else {
window.focus(); // allows keypress events if window isn't currently focused, fails for Safari
this.activeDraggable = draggable;
}
},
deactivate: function() {
this.activeDraggable = null;
},
updateDrag: function(event) {
if(!this.activeDraggable) return;
var pointer = [Event.pointerX(event), Event.pointerY(event)];
// Mozilla-based browsers fire successive mousemove events with
// the same coordinates, prevent needless redrawing (moz bug?)
if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return;
this._lastPointer = pointer;
this.activeDraggable.updateDrag(event, pointer);
},
endDrag: function(event) {
if(this._timeout) {
clearTimeout(this._timeout);
this._timeout = null;
}
if(!this.activeDraggable) return;
this._lastPointer = null;
this.activeDraggable.endDrag(event);
this.activeDraggable = null;
},
keyPress: function(event) {
if(this.activeDraggable)
this.activeDraggable.keyPress(event);
},
addObserver: function(observer) {
this.observers.push(observer);
this._cacheObserverCallbacks();
},
removeObserver: function(element) { // element instead of observer fixes mem leaks
this.observers = this.observers.reject( function(o) { return o.element==element });
this._cacheObserverCallbacks();
},
notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag'
if(this[eventName+'Count'] > 0)
this.observers.each( function(o) {
if(o[eventName]) o[eventName](eventName, draggable, event);
});
if(draggable.options[eventName]) draggable.options[eventName
|
{
"pile_set_name": "Github"
}
|
{
"name": "map-canvas",
"version": "1.0.0",
"description": "基于baidu、google、openlayers、arcgis、高德地图、canvas数据可视化",
"main": "rollup.config.js",
"scripts": {
"mini": "npm run build && uglifyjs build/baidu-map-lineGradient.js -c -m -o build/release/baidu-map-lineGradient.min.js",
"build": "rollup -c",
"watch": "npm-watch",
"test": "npm run build"
},
"watch": {
"build": {
"patterns": [
"src",
"main.js"
],
"extensions": "js,jsx",
"ignore": ""
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/chengquan223/map-canvas.git"
},
"keywords": [
"baidu",
"arcgis",
"amap",
"google",
"openlayers",
"canvas",
"visualization"
],
"author": "309581454@qq.com",
"license": "ISC",
"bugs": {
"url": "https://github.com/chengquan223/map-canvas/issues"
},
"homepage": "https://github.com/chengquan223/map-canvas#readme",
"devDependencies": {
"babel-preset-es2015-rollup": "^3.0.0",
"npm-watch": "^0.3.0",
"rollup": "^0.41.5",
"rollup-plugin-babel": "^2.7.1",
"uglify-js": "^3.3.8"
},
"dependencies": {
"lodash": "^4.17.19",
"mixin-deep": "^2.0.1",
"set-value": "^3.0.1"
}
}
|
{
"pile_set_name": "Github"
}
|
/*******************************************************************************
* Copyright (c) 2019 Infostretch 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 shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
******************************************************************************/
package com.qmetry.qaf.automation.ui;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.Socket;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.impl.LogFactoryImpl;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.qmetry.qaf.automation.core.AutomationError;
import com.qmetry.qaf.automation.core.ConfigurationManager;
import com.qmetry.qaf.automation.core.DriverFactory;
import com.qmetry.qaf.automation.core.LoggingBean;
import com.qmetry.qaf.automation.core.QAFListener;
import com.qmetry.qaf.automation.core.QAFTestBase.STBArgs;
import com.qmetry.qaf.automation.keys.ApplicationProperties;
import com.qmetry.qaf.automation.ui.selenium.webdriver.SeleniumDriverFactory;
import com.qmetry.qaf.automation.ui.webdriver.ChromeDriverHelper;
import com.qmetry.qaf.automation.ui.webdriver.QAFExtendedWebDriver;
import com.qmetry.qaf.automation.ui.webdriver.QAFWebDriverCommandListener;
import com.qmetry.qaf.automation.util.StringUtil;
/**
* com.qmetry.qaf.automation.ui.UiDriverFactory.java
*
* @author chirag
*/
public class UiDriverFactory implements DriverFactory<UiDriver> {
private static final Log logger = LogFactoryImpl.getLog(UiDriverFactory.class);
/*
* (non-Javadoc)
*
* @see com.qmetry.qaf.automation.core.DriverFactory#get(java.lang.String[])
*/
@Override
public UiDriver get(ArrayList<LoggingBean> commandLog, String[] stb) {
WebDriverCommandLogger cmdLogger = new WebDriverCommandLogger(commandLog);
String browser = STBArgs.browser_str.getFrom(stb);
logger.info("Driver: " + browser);
if (browser.toLowerCase().contains("driver") && !browser.startsWith("*")) {
return getDriver(cmdLogger, stb);
}
return new SeleniumDriverFactory().getDriver(cmdLogger, stb);
}
@Override
public void tearDown(UiDriver driver) {
try {
driver.stop();
logger.info("UI-driver tear down complete...");
} catch (Throwable t) {
logger.error(t.getMessage());
}
}
/**
* Utility method to get capability that will be used by factory to create
* driver object. It will not include any modification done by
* {@link QAFWebDriverCommandListener#beforeInitialize(Capabilities)}
*
* @param driverName
* @return
*/
public static DesiredCapabilities getDesiredCapabilities(String driverName) {
return Browsers.getBrowser(driverName).getDesiredCapabilities();
}
public static String[] checkAndStartServer(String... args) {
if (!isServerRequired(args)) {
return args;
}
if (isSeverRunning(STBArgs.sel_server.getFrom(args), Integer.parseInt(STBArgs.port.getFrom(args)))) {
return args;
}
// override args values to default
args = STBArgs.sel_server.set(STBArgs.sel_server.getDefaultVal(), args);
if (isSeverRunning(STBArgs.sel_server.getFrom(args), Integer.parseInt(STBArgs.port.getFrom(args)))) {
logger.info("Assigning server running on localhost");
return args;
}
return args;
}
private static boolean isServerRequired(String... args) {
String browser = STBArgs.browser_str.getFrom(args).toLowerCase();
return browser.contains("*") || browser.contains("remote");
}
private static boolean isSeverRunning(String host, int port) {
boolean isRunning = false;
Socket socket = null;
try {
socket = new Socket(host, (port));
isRunning = socket.isConnected();
} catch (Exception exp) {
logger.error("Error occured while checking Selenium : " + exp.getMessage());
} finally {
try {
if (socket != null) {
socket.close();
}
} catch (IOException e) {
}
}
return isRunning;
}
private static void beforeInitialize(Capabilities desiredCapabilities,
Collection<QAFWebDriverCommandListener> listners) {
if ((listners != null) && !listners.isEmpty()) {
for (QAFWebDriverCommandListener listener : listners) {
listener.beforeInitialize(desiredCapabilities);
}
}
}
private static void onInitializationFailure(Capabilities desiredCapabilities, Throwable e,
Collection<QAFWebDriverCommandListener> listners) {
if ((listners != null) && !listners.isEmpty()) {
for (QAFWebDriverCommandListener listener : listners) {
listener.onInitializationFailure(desiredCapabilities, e);
}
}
}
private static Collection<QAFWebDriverCommandListener> getDriverListeners() {
LinkedHashSet<QAFWebDriverCommandListener> listners = new LinkedHashSet<QAFWebDriverCommandListener>();
String[] clistners = ConfigurationManager.getBundle()
.getStringArray(ApplicationProperties.WEBDRIVER_COMMAND_LISTENERS.key);
for (String listenr : clistners) {
try {
QAFWebDriverCommandListener cls = (QAFWebDriverCommandListener) Class.forName(listenr).newInstance();
listners.add(cls);
} catch (Exception e) {
logger.error("Unable to register listener class " + listenr, e
|
{
"pile_set_name": "Github"
}
|
{
"images" : [
{
"idiom" : "universal",
"filename" : "video-play.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "video-play@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "video-play@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
|
{
"pile_set_name": "Github"
}
|
import {EventEmitter} from 'events';
/**
* Require options for a VM
*/
export interface VMRequire {
/** Array of allowed builtin modules, accepts ["*"] for all (default: none) */
builtin?: string[];
/*
* `host` (default) to require modules in host and proxy them to sandbox. `sandbox` to load, compile and
* require modules in sandbox. Builtin modules except `events` always required in host and proxied to sandbox
*/
context?: "host" | "sandbox";
/** `true` or an array of allowed external modules (default: `false`) */
external?: boolean | string[];
/** Array of modules to be loaded into NodeVM on start. */
import?: string[];
/** Restricted path where local modules can be required (default: every path). */
root?: string;
/** Collection of mock modules (both external or builtin). */
mock?: any;
}
/**
* A custom compiler function for all of the JS that comes
* into the VM
*/
type CompilerFunction = (code: string, filename: string) => string;
/**
* Options for creating a VM
*/
export interface VMOptions {
/**
* `javascript` (default) or `coffeescript` or custom compiler function (which receives the code, and it's filepath).
* The library expects you to have coffee-script pre-installed if the compiler is set to `coffeescript`.
*/
compiler?: "javascript" | "coffeescript" | CompilerFunction;
/** VM's global object. */
sandbox?: any;
/**
* Script timeout in milliseconds. Timeout is only effective on code you run through `run`.
* Timeout is NOT effective on any method returned by VM.
*/
timeout?: number;
}
/**
* Options for creating a NodeVM
*/
export interface NodeVMOptions extends VMOptions {
/** `inherit` to enable console, `redirect` to redirect to events, `off` to disable console (default: `inherit`). */
console?: "inherit" | "redirect" | "off";
/** `true` or an object to enable `require` optionss (default: `false`). */
require?: true | VMRequire;
/** `true` to enable VMs nesting (default: `false`). */
nesting?: boolean;
/** `commonjs` (default) to wrap script into CommonJS wrapper, `none` to retrieve value returned by the script. */
wrapper?: "commonjs" | "none";
/** File extensions that the internal module resolver should accept. */
sourceExtensions?: string[]
}
/**
* A VM with behavior more similar to running inside Node.
*/
export class NodeVM extends EventEmitter {
constructor(options?: NodeVMOptions);
/** Runs the code */
run(js: string, path: string): any;
/** Runs the VMScript object */
run(script: VMScript, path?: string): any;
/** Freezes the object inside VM making it read-only. Not available for primitive values. */
freeze(object: any, name: string): any;
/** Protects the object inside VM making impossible to set functions as it's properties. Not available for primitive values. */
protect(object: any, name: string): any;
/** Require a module in VM and return it's exports. */
require(module: string): any;
}
/**
* VM is a simple sandbox, without `require` feature, to synchronously run an untrusted code.
* Only JavaScript built-in objects + Buffer are available. Scheduling functions
* (`setInterval`, `setTimeout` and `setImmediate`) are not available by default.
*/
export class VM {
constructor(options?: VMOptions);
/** Runs the code */
run(js: string): any;
/** Runs the VMScript object */
run(script: VMScript): any;
/** Freezes the object inside VM making it read-only. Not available for primitive values. */
freeze(object: any, name: string): any;
/** Protects the object inside VM making impossible to set functions as it's properties. Not available for primitive values */
protect(object: any, name: string): any;
/**
* Create NodeVM and run code inside it.
*
* @param {String} script Javascript code.
* @param {String} [filename] File name (used in stack traces only).
* @param {Object} [options] VM options.
*/
static code(script: string, filename: string, options: NodeVMOptions): NodeVM;
/**
* Create NodeVM and run script from file inside it.
*
* @param {String} [filename] File name (used in stack traces only).
* @param {Object} [options] VM options.
*/
static file(filename: string, options: NodeVMOptions): NodeVM
}
/**
* You can increase performance by using pre-compiled scripts.
* The pre-compiled VMScript can be run later multiple times. It is important to note that the code is not bound
* to any VM (context); rather, it is bound before each run, just for that run.
*/
export class VMScript {
constructor(code: string, path?: string);
/** Wraps the code */
wrap(prefix: string, postfix: string): VMScript;
/** Compiles the code. If called multiple times, the code is only compiled once. */
compile(): any;
}
/** Custom Error class */
export class VMError extends Error {}
|
{
"pile_set_name": "Github"
}
|
MauvilleCity_BikeShop_Text_180F9F:: @ 8180F9F
.string "Well, well, what have we here?\n"
.string "A most energetic customer!\p"
.string "Me? You may call me RYDEL.\n"
.string "I'm the owner of this cycle shop.$"
MauvilleCity_BikeShop_Text_181016:: @ 8181016
.string "RYDEL: Your RUNNING SHOES...\n"
.string "They're awfully filthy.\p"
.string "Did you come from far away?$"
MauvilleCity_BikeShop_Text_181067:: @ 8181067
.string "RYDEL: Is that right?\p"
.string "Then, I guess you have no need for\n"
.string "any of my BIKES.$"
MauvilleCity_BikeShop_Text_1810B1:: @ 81810B1
.string "RYDEL: Hm, hm... ... ... ... ...\n"
.string "... ... ... ... ... ... ... ...\p"
.string "You're saying that you came all this\n"
.string "way from LITTLEROOT?\p"
.string "My goodness!\n"
.string "That's ridiculously far!\p"
.string "If you had one of my BIKES, you could\n"
.string "go anywhere easily while feeling the\l"
.string "gentle caress of the wind!\p"
.string "I'll tell you what!\n"
.string "I'll give you a BIKE!\p"
.string "Oh, wait a second!\p"
.string "I forgot to tell you that there are\n"
.string "two kinds of BIKES!\p"
.string "They are the MACH BIKE and the\n"
.string "ACRO BIKE!\p"
.string "MACH BIKE is for cyclists who want\n"
.string "to feel the wind with their bodies!\p"
.string "And an ACRO BIKE is for those who\n"
.string "prefer technical rides!\p"
.string "I'm a real sweetheart, so you can\n"
.string "have whichever one you like!\p"
.string "Which one will you choose?$"
MauvilleCity_BikeShop_Text_181332:: @ 8181332
.string "{PLAYER} chose the MACH BIKE.$"
MauvilleCity_BikeShop_Text_18134A:: @ 818134A
.string "{PLAYER} chose the ACRO BIKE.$"
MauvilleCity_BikeShop_Text_181362:: @ 8181362
.string "RYDEL: If you get the urge to switch\n"
.string "BIKES, just come see me!$"
MauvilleCity_BikeShop_Text_1813A0:: @ 81813A0
.string "RYDEL: Oh? Were you thinking about\n"
.string "switching BIKES?$"
MauvilleCity_BikeShop_Text_1813D4:: @ 81813D4
.string "RYDEL: Okay, no problem!\n"
.string "I'll switch BIKES for you!$"
MauvilleCity_BikeShop_Text_181408:: @ 8181408
.string "{PLAYER} got the MACH BIKE exchanged\n"
.string "for an ACRO BIKE.$"
MauvilleCity_BikeShop_Text_181439:: @ 8181439
.string "{PLAYER} got the ACRO BIKE exchanged\n"
.string "for a MACH BIKE.$"
MauvilleCity_BikeShop_Text_181469:: @ 8181469
.string "RYDEL: Good, good!\n"
.string "I'm happy that you like it!$"
MauvilleCity_BikeShop_Text_181498:: @ 8181498
.string "Oh? What happened to that BIKE I\n"
.string "gave you?\p"
.string "Oh, I get it, you stored it using your PC.\p"
.string "Well, take it out of PC storage,\n"
.string "and I'll be happy to exchange it!\p"
.string "May the wind always be at your back\n"
.string "on your adventure!$"
MauvilleCity_BikeShop_Text_181568:: @ 8181568
.string "I'm learning about BIKES while\n"
.string "I work here.\p"
.string "If you need advice on how to ride your\n"
.string "BIKE, there're a couple handbooks in\l"
.string "the back.$"
MauvilleCity_BikeShop_Text_1815EA:: @ 81815EA
.string "It's a handbook on the MACH BIKE.\p"
.string "Which page do you want to read?$"
MauvilleCity_BikeShop_Text_18162C:: @ 818162C
.string "A BIKE moves in the direction that\n"
.string "the + Control Pad is pressed.\p"
.string "It will speed up once it gets rolling.\p"
.string "To stop, release the + Control Pad.\n"
.string "The BIKE will slow to a stop.\p"
.string "Want to read a different page?$"
MauvilleCity_BikeShop_Text_1816F5:: @ 81816F5
.string "A MACH BIKE is speedy, but it can't\n"
.string "stop very quickly.\p"
.string "It gets a little tricky to get around\n"
.string "a corner.\p"
.string "Release the + Control Pad a little\n"
.string "before the corner and slow down.\p"
.string "Want to read a different page?$"
MauvilleCity_BikeShop_Text_1817BF:: @ 81817BF
.string "There are small sandy slopes throughout\n"
.string "the HOENN region.\p"
.string "The loose, crumbly sand makes it\n"
.string "impossible to climb normally.\p"
.string "But if you have a MACH BIKE, you can\n"
.string "zip up a sandy slope.\p"
.string "Want to read a different page?$"
MauvilleCity_BikeShop_Text_181892:: @ 8181892
.string "It's a handbook on the ACRO BIKE.\p"
.string "Which page do you want to read?$"
MauvilleCity_BikeShop_Text_1818D4:: @ 81818D4
.string "Press the B Button while riding, and the\n"
.string "front wheel lifts up.\p"
.string "You can zip around with the front\n"
.string "wheel up using the + Control Pad.\p"
.string "This technique is called a wheelie.\p"
.string "Want to read a different page?$"
MauvilleCity_BikeShop_Text_18199A:: @ 818199A
.string "Keeping the B Button pressed, your\n"
.string "BIKE can hop on the spot.\p"
.string "This technique is called a bunny hop.\p"
.string "You can ride while hopping, too.\p"
.string "Want to read a different page?$"
MauvilleCity_BikeShop_Text_181A3D:: @ 8181A3D
.string "Press the B Button and the + Control\n"
.string "Pad at the same time to jump.\p"
.string "Press the + Control Pad to the side\n"
.string "to jump sideways.\p"
.string "Press it backwards to make the BIKE\n"
.string "change directions while jumping.\p"
.string "Want to read a different page?$"
|
{
"pile_set_name": "Github"
}
|
package com.coderising.ood.srp;
import com.coderising.ood.srp.utils.DBUtil;
import com.coderising.ood.srp.utils.MailUtil;
import com.coderising.ood.srp.utils.ArgsUtil;
import java.io.IOException;
import java.util.*;
/**
* PromotionMail
*
* @author Chenpz
* @package com.coderising.ood.srp
* @date 2017/6/12/23:33
*/
public class PromotionMail {
private ProductInfo productInfo;
private List<MailInfo> mailInfoList = new ArrayList<>();
private static final String NAME_KEY = "NAME";
private static final String EMAIL_KEY = "EMAIL";
public PromotionMail(){}
public PromotionMail(ProductInfo productInfo) throws Exception {
this.productInfo = productInfo;
initMailInfoList(loadMailingList());
}
/**
* 获取每个型号的手机关注的人员信息列表
* @return
* @throws Exception
*/
private List<Map<String, String>> loadMailingList() throws Exception {
String sql = "select name from subscriptions "
+ "where product_id= '" + productInfo.getProductID() +"' "
+ "and send_mail=1 ";
return DBUtil.query(sql);
}
/**
* 组装促销邮件的内容信息
* @param mailingList
*/
private void initMailInfoList(List<Map<String, String>> mailingList) {
if (ArgsUtil.isNotEmpty(mailingList)){
for (Map<String, String> map : mailingList){
// 初始化 mailInfoList
mailInfoList.add(buildMailInfo(map));
}
}
}
/**
* 组装邮件内容信息
* @param userInfo
* @return
*/
private MailInfo buildMailInfo(Map<String, String> userInfo){
String name = userInfo.get(NAME_KEY);
String subject = "您关注的产品降价了";
String message = "尊敬的 "+name+", 您关注的产品 " + productInfo.getProductDesc() + " 降价了,欢迎购买!" ;
String toAddress = userInfo.get(EMAIL_KEY);
return new MailInfo(toAddress, subject, message);
}
/**
* 发送促销邮件
* @param debug
* @throws IOException
*/
public void sendEMails(boolean debug) throws IOException {
System.out.println("开始发送邮件... ...");
if (ArgsUtil.isNotEmpty(mailInfoList)) {
for (MailInfo mailInfo : mailInfoList){
MailUtil.sendEmail(mailInfo.toAddress, mailInfo.subject, mailInfo.message, debug);
}
}else {
System.out.println("没有邮件发送... ...");
}
}
class MailInfo{
private String toAddress = null;
private String subject = null;
private String message = null;
MailInfo(String toAddress, String subject, String message){
this.toAddress = toAddress;
this.subject = subject;
this.message = message;
}
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<message>
<name>MFNM14</name>
<description>Master File Notification - Site Defined</description>
<segments>
<segment>MSH</segment>
<segment minOccurs="0" maxOccurs="unbounded">SFT</segment>
<segment>MFI</segment>
<group maxOccurs="unbounded">
<segment>MFE</segment>
<segment>ANY</segment>
</group>
</segments>
</message>
|
{
"pile_set_name": "Github"
}
|
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
(* v * Copyright INRIA, CNRS and contributors *)
(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
(** * Hexadecimal numbers *)
(** These numbers coded in base 16 will be used for parsing and printing
other Coq numeral datatypes in an human-readable way.
See the [Numeral Notation] command.
We represent numbers in base 16 as lists of hexadecimal digits,
in big-endian order (most significant digit comes first). *)
Require Import Datatypes Decimal.
(** Unsigned integers are just lists of digits.
For instance, sixteen is (D1 (D0 Nil)) *)
Inductive uint :=
| Nil
| D0 (_:uint)
| D1 (_:uint)
| D2 (_:uint)
| D3 (_:uint)
| D4 (_:uint)
| D5 (_:uint)
| D6 (_:uint)
| D7 (_:uint)
| D8 (_:uint)
| D9 (_:uint)
| Da (_:uint)
| Db (_:uint)
| Dc (_:uint)
| Dd (_:uint)
| De (_:uint)
| Df (_:uint).
(** [Nil] is the number terminator. Taken alone, it behaves as zero,
but rather use [D0 Nil] instead, since this form will be denoted
as [0], while [Nil] will be printed as [Nil]. *)
Notation zero := (D0 Nil).
(** For signed integers, we use two constructors [Pos] and [Neg]. *)
Variant int := Pos (d:uint) | Neg (d:uint).
(** For decimal numbers, we use two constructors [Hexadecimal] and
[HexadecimalExp], depending on whether or not they are given with an
exponent (e.g., 0x1.a2p+01). [i] is the integral part while [f] is
the fractional part (beware that leading zeroes do matter). *)
Variant hexadecimal :=
| Hexadecimal (i:int) (f:uint)
| HexadecimalExp (i:int) (f:uint) (e:Decimal.int).
Declare Scope hex_uint_scope.
Delimit Scope hex_uint_scope with huint.
Bind Scope hex_uint_scope with uint.
Declare Scope hex_int_scope.
Delimit Scope hex_int_scope with hint.
Bind Scope hex_int_scope with int.
Register uint as num.hexadecimal_uint.type.
Register int as num.hexadecimal_int.type.
Register hexadecimal as num.hexadecimal.type.
Fixpoint nb_digits d :=
match d with
| Nil => O
| D0 d | D1 d | D2 d | D3 d | D4 d | D5 d | D6 d | D7 d | D8 d | D9 d
| Da d | Db d | Dc d | Dd d | De d | Df d =>
S (nb_digits d)
end.
(** This representation favors simplicity over canonicity.
For normalizing numbers, we need to remove head zero digits,
and choose our canonical representation of 0 (here [D0 Nil]
for unsigned numbers and [Pos (D0 Nil)] for signed numbers). *)
(** [nzhead] removes all head zero digits *)
Fixpoint nzhead d :=
match d with
| D0 d => nzhead d
| _ => d
end.
(** [unorm] : normalization of unsigned integers *)
Definition unorm d :=
match nzhead d with
| Nil => zero
| d => d
end.
(** [norm] : normalization of signed integers *)
Definition norm d :=
match d with
| Pos d => Pos (unorm d)
| Neg d =>
match nzhead d with
| Nil => Pos zero
| d => Neg d
end
end.
(** A few easy operations. For more advanced computations, use the conversions
with other Coq numeral datatypes (e.g. Z) and the operations on them. *)
Definition opp (d:int) :=
match d with
| Pos d => Neg d
| Neg d => Pos d
end.
(** For conversions with binary numbers, it is easier to operate
on little-endian numbers. *)
Fixpoint revapp (d d' : uint) :=
match d with
| Nil => d'
| D0 d => revapp d (D0 d')
| D1 d => revapp d (D1 d')
| D2 d => revapp d (D2 d')
| D3 d => revapp d (D3 d')
| D4 d => revapp d (D4 d')
| D5 d => revapp d (D5 d')
| D6 d => revapp d (D6 d')
| D7 d => revapp d (D7 d')
| D8 d => revapp d (D8 d')
| D9 d => revapp d (D9 d')
| Da d => revapp d (Da d')
| Db d => revapp d (Db d')
| Dc d => revapp d (Dc d')
| Dd d => revapp d (Dd d')
| De d => revapp d (De d')
| Df d => revapp d (Df d')
end.
Definition rev d := revapp d Nil.
Definition app d d' := revapp (rev d) d'.
Definition app_int d1 d2 :=
match d1 with Pos d1 => Pos (app d1 d2) | Neg d1 => Neg (app d1 d2) end.
(** [nztail] removes all trailing zero digits and return both the
result and the number of removed digits. *)
Definition nztail d :=
let fix aux d_rev :=
match d_rev with
| D0 d_rev => let (r, n) := aux d_rev in pair r (S n)
| _ => pair d_rev O
end in
let (r, n) := aux (rev d) in pair (rev r) n.
Definition nztail_int d :=
match d with
| Pos d => let (r, n) := nztail d in pair (Pos r) n
| Neg d => let (r, n) := nztail d in pair (Neg r) n
end.
Module Little.
(** Successor of little-endian numbers *)
Fixpoint succ d :=
match d with
| Nil => D1 Nil
| D0 d => D1 d
| D1 d => D2 d
| D2 d => D3 d
| D3 d => D4 d
| D4 d => D5 d
| D5 d => D6 d
| D6 d => D7 d
| D7 d => D8 d
| D8 d => D9 d
| D9 d => Da d
| Da d => Db d
| Db d => Dc d
| Dc d => Dd d
| Dd d => De d
| De d => Df d
| Df d => D0 (succ d)
end.
(** Doubling little-endian numbers *)
Fixpoint double d :=
match d with
| Nil => Nil
| D0 d => D0 (double d)
| D1 d => D2 (double d)
| D2 d => D4 (double d)
| D3 d => D6 (double d)
| D4 d => D8 (double d)
| D5 d => Da (double d)
| D6 d => Dc (double d)
| D7 d => De (double d)
| D8 d => D0 (succ_double d)
| D9 d => D2 (
|
{
"pile_set_name": "Github"
}
|
/*=============================================================================
Copyright (c) 2001-2011 Hartmut Kaiser
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)
==============================================================================*/
#if !defined(BOOST_SPIRIT_STREAM_MAY_05_2007_1228PM)
#define BOOST_SPIRIT_STREAM_MAY_05_2007_1228PM
#if defined(_MSC_VER)
#pragma once
#endif
#include <boost/spirit/home/qi/detail/string_parse.hpp>
#include <boost/spirit/home/qi/stream/detail/match_manip.hpp>
#include <boost/spirit/home/qi/stream/detail/iterator_source.hpp>
#include <boost/spirit/home/support/detail/hold_any.hpp>
#include <iosfwd>
#include <sstream>
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit
{
///////////////////////////////////////////////////////////////////////////
// Enablers
///////////////////////////////////////////////////////////////////////////
template <>
struct use_terminal<qi::domain, tag::stream> // enables stream
: mpl::true_ {};
template <>
struct use_terminal<qi::domain, tag::wstream> // enables wstream
: mpl::true_ {};
}}
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace qi
{
#ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS
using spirit::stream;
using spirit::wstream;
#endif
using spirit::stream_type;
using spirit::wstream_type;
template <typename Char = char, typename T = spirit::basic_hold_any<char> >
struct stream_parser
: primitive_parser<stream_parser<Char, T> >
{
template <typename Context, typename Iterator>
struct attribute
{
typedef T type;
};
template <typename Iterator, typename Context
, typename Skipper, typename Attribute>
bool parse(Iterator& first, Iterator const& last
, Context& /*context*/, Skipper const& skipper
, Attribute& attr_) const
{
typedef qi::detail::iterator_source<Iterator> source_device;
typedef boost::iostreams::stream<source_device> instream;
qi::skip_over(first, last, skipper);
instream in(first, last); // copies 'first'
in >> attr_; // use existing operator>>()
// advance the iterator if everything is ok
if (in) {
if (!in.eof()) {
std::streamsize pos = in.tellg();
std::advance(first, pos);
} else {
first = last;
}
return true;
}
return false;
}
template <typename Context>
info what(Context& /*context*/) const
{
return info("stream");
}
};
template <typename T, typename Char = char>
struct typed_stream
: proto::terminal<stream_parser<Char, T> >::type
{
};
///////////////////////////////////////////////////////////////////////////
// Parser generators: make_xxx function (objects)
///////////////////////////////////////////////////////////////////////////
template <typename Char>
struct make_stream
{
typedef stream_parser<Char> result_type;
result_type operator()(unused_type, unused_type) const
{
return result_type();
}
};
template <typename Modifiers>
struct make_primitive<tag::stream, Modifiers> : make_stream<char> {};
template <typename Modifiers>
struct make_primitive<tag::wstream, Modifiers> : make_stream<wchar_t> {};
}}}
#endif
|
{
"pile_set_name": "Github"
}
|
const nest = require('depnest')
const Value = require('mutant/value')
const onceTrue = require('mutant/once-true')
const computed = require('mutant/computed')
const resolve = require('mutant/resolve')
const pull = require('pull-stream')
const sorted = require('sorted-array-functions')
const MutantPullCollection = require('../../mutant-pull-collection')
exports.needs = nest({
'sbot.pull.backlinks': 'first',
'sbot.obs.connection': 'first',
'message.sync.root': 'first',
'sbot.pull.stream': 'first',
'message.sync.timestamp': 'first'
})
exports.gives = nest({
'backlinks.obs.for': true,
'backlinks.obs.references': true,
'backlinks.obs.forks': true
})
exports.create = function (api) {
const cache = {}
const collections = {}
let loaded = false
// cycle remove sets for fast cleanup
let newRemove = new Set()
let oldRemove = new Set()
// run cache cleanup every 5 seconds
// an item will be removed from cache between 5 - 10 seconds after release
// this ensures that the data is still available for a page reload
const timer = setInterval(() => {
oldRemove.forEach(id => {
if (cache[id]) {
unsubscribe(id)
delete collections[id]
delete cache[id]
}
})
oldRemove.clear()
// cycle
const hold = oldRemove
oldRemove = newRemove
newRemove = hold
}, 5e3)
if (timer.unref) timer.unref()
return nest({
'backlinks.obs.for': (id) => backlinks(id),
'backlinks.obs.references': references,
'backlinks.obs.forks': forks
})
function references (msg) {
const id = msg.key
return MutantPullCollection((lastMessage) => {
return api.sbot.pull.stream((sbot) => sbot.patchwork.backlinks.referencesStream({ id, since: lastMessage && lastMessage.timestamp }))
})
}
function forks (msg) {
const id = msg.key
const rooted = !!api.message.sync.root(msg)
if (rooted) {
return MutantPullCollection((lastMessage) => {
return api.sbot.pull.stream((sbot) => sbot.patchwork.backlinks.forksStream({ id, since: lastMessage && lastMessage.timestamp }))
})
} else {
return []
}
}
function backlinks (id) {
load()
if (!cache[id]) {
const sync = Value(false)
const collection = Value([])
subscribe(id)
process.nextTick(() => {
pull(
api.sbot.pull.backlinks({
query: [{ $filter: { dest: id } }],
index: 'DTA' // use asserted timestamps
}),
pull.drain((msg) => {
const value = resolve(collection)
sorted.add(value, msg, compareAsserted)
collection.set(value)
}, () => {
sync.set(true)
})
)
})
collections[id] = collection
cache[id] = computed([collection], x => x, {
onListen: () => use(id),
onUnlisten: () => release(id)
})
cache[id].sync = sync
}
return cache[id]
}
function load () {
if (!loaded) {
pull(
api.sbot.pull.stream(sbot => sbot.patchwork.liveBacklinks.stream()),
pull.drain(msg => {
const collection = collections[msg.dest]
if (collection) {
const value = resolve(collection)
sorted.add(value, msg, compareAsserted)
collection.set(value)
}
})
)
loaded = true
}
}
function use (id) {
newRemove.delete(id)
oldRemove.delete(id)
}
function release (id) {
newRemove.add(id)
}
function subscribe (id) {
onceTrue(api.sbot.obs.connection(), (sbot) => sbot.patchwork.liveBacklinks.subscribe(id))
}
function unsubscribe (id) {
onceTrue(api.sbot.obs.connection(), (sbot) => sbot.patchwork.liveBacklinks.unsubscribe(id))
}
function compareAsserted (a, b) {
if (isReplyTo(a, b)) {
return -1
} else if (isReplyTo(b, a)) {
return 1
} else {
return api.message.sync.timestamp(a) - api.message.sync.timestamp(b)
}
}
}
function isReplyTo (maybeReply, msg) {
return (includesOrEquals(maybeReply.branch, msg.key))
}
function includesOrEquals (array, value) {
if (Array.isArray(array)) {
return array.includes(value)
} else {
return array === value
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2004, PostgreSQL Global Development Group
* See the LICENSE file in the project root for more information.
*/
package org.postgresql.ds;
import org.postgresql.ds.common.BaseDataSource;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.sql.SQLException;
import javax.sql.DataSource;
/**
* Simple DataSource which does not perform connection pooling. In order to use the DataSource, you
* must set the property databaseName. The settings for serverName, portNumber, user, and password
* are optional. Note: these properties are declared in the superclass.
*
* @author Aaron Mulder (ammulder@chariotsolutions.com)
*/
public class PGSimpleDataSource extends BaseDataSource implements DataSource, Serializable {
/**
* Gets a description of this DataSource.
*/
public String getDescription() {
return "Non-Pooling DataSource from " + org.postgresql.util.DriverInfo.DRIVER_FULL_NAME;
}
private void writeObject(ObjectOutputStream out) throws IOException {
writeBaseObject(out);
}
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
readBaseObject(in);
}
public boolean isWrapperFor(Class<?> iface) throws SQLException {
return iface.isAssignableFrom(getClass());
}
public <T> T unwrap(Class<T> iface) throws SQLException {
if (iface.isAssignableFrom(getClass())) {
return iface.cast(this);
}
throw new SQLException("Cannot unwrap to " + iface.getName());
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* 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.intellij.psi.impl.source.resolve.reference.impl.manipulators;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.fileEditor.FileDocumentManager;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiPlainTextFile;
import com.intellij.psi.AbstractElementManipulator;
import com.intellij.util.IncorrectOperationException;
import javax.annotation.Nonnull;
/**
* Created by IntelliJ IDEA.
* User: ik
* Date: 09.12.2003
* Time: 14:10:35
* To change this template use Options | File Templates.
*/
public class PlainFileManipulator extends AbstractElementManipulator<PsiPlainTextFile> {
@Override
public PsiPlainTextFile handleContentChange(@Nonnull PsiPlainTextFile file, @Nonnull TextRange range, String newContent)
throws IncorrectOperationException {
final Document document = FileDocumentManager.getInstance().getDocument(file.getVirtualFile());
document.replaceString(range.getStartOffset(), range.getEndOffset(), newContent);
PsiDocumentManager.getInstance(file.getProject()).commitDocument(document);
return file;
}
}
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
module internal FSharp.Compiler.InnerLambdasToTopLevelFuncs
open FSharp.Compiler
open FSharp.Compiler.AbstractIL.Internal
open FSharp.Compiler.AbstractIL.Internal.Library
open FSharp.Compiler.AbstractIL.Diagnostics
open FSharp.Compiler.CompilerGlobalState
open FSharp.Compiler.ErrorLogger
open FSharp.Compiler.Detuple.GlobalUsageAnalysis
open FSharp.Compiler.Layout
open FSharp.Compiler.Lib
open FSharp.Compiler.SyntaxTree
open FSharp.Compiler.TypedTree
open FSharp.Compiler.TypedTreeBasics
open FSharp.Compiler.TypedTreeOps
open FSharp.Compiler.TypedTreeOps.DebugPrint
open FSharp.Compiler.TcGlobals
open FSharp.Compiler.XmlDoc
let verboseTLR = false
//-------------------------------------------------------------------------
// library helpers
//-------------------------------------------------------------------------
let internalError str = dprintf "Error: %s\n" str;raise (Failure str)
module Zmap =
let force k mp (str, soK) =
try Zmap.find k mp
with e ->
dprintf "Zmap.force: %s %s\n" str (soK k)
PreserveStackTrace e
raise e
//-------------------------------------------------------------------------
// misc
//-------------------------------------------------------------------------
/// tree, used to store dec sequence
type Tree<'T> =
| TreeNode of Tree<'T> list
| LeafNode of 'T
let fringeTR tr =
let rec collect tr acc =
match tr with
| TreeNode subts -> List.foldBack collect subts acc
| LeafNode x -> x :: acc
collect tr []
let emptyTR = TreeNode[]
//-------------------------------------------------------------------------
// misc
//-------------------------------------------------------------------------
/// Collapse reclinks on app and combine apps if possible
/// recursive ids are inside reclinks and maybe be type instanced with a Expr.App
// CLEANUP NOTE: mkApps ensures applications are kept in a collapsed
// and combined form, so this function should not be needed
let destApp (f, fty, tys, args, m) =
match stripExpr f with
| Expr.App (f2, fty2, tys2, [], _) -> (f2, fty2, tys2 @ tys, args, m)
| Expr.App _ -> (f, fty, tys, args, m) (* has args, so not combine ty args *)
| f -> (f, fty, tys, args, m)
#if DEBUG
let showTyparSet tps = showL (commaListL (List.map typarL (Zset.elements tps)))
#endif
// CLEANUP NOTE: don't like the look of this function - this distinction
// should never be needed
let isDelayedRepr (f: Val) e =
let _tps, vss, _b, _rty = stripTopLambda (e, f.Type)
List.length vss>0
// REVIEW: these should just be replaced by direct calls to mkLocal, mkCompGenLocal etc.
// REVIEW: However these set an arity whereas the others don't
let mkLocalNameTypeArity compgen m name ty topValInfo =
Construct.NewVal(name, m, None, ty, Immutable, compgen, topValInfo, taccessPublic, ValNotInRecScope, None, NormalVal, [], ValInline.Optional, XmlDoc.Empty, false, false, false, false, false, false, None, ParentNone)
//-------------------------------------------------------------------------
// definitions: TLR, arity, arity-met, arity-short
//
// DEFN: An f is TLR with arity wf if
// (a) it's repr is "LAM tps. lam x1...xN. body" and have N<=wf (i.e. have enough args)
// (b) it has no free tps
// (c) for g: freevars(repr), both
// (1) g is TLR with arity wg, and
// (2) g occurs in arity-met occurrence.
// (d) if N=0, then further require that body be a TLR-constant.
//
// Conditions (a-c) are required if f is to have a static method/field representation.
// Condition (d) chooses which constants can be lifted. (no effects, non-trivial).
//
// DEFN: An arity-met occurrence of g is a g application with enough args supplied,
// ie. (g tps args) where wg <= |args|.
//
// DEFN: An arity-short occurrence does not have enough args.
//
// DEFN: A TLR-constant:
// - can have constructors (tuples, datatype, records, exn).
// - should be non-trivial (says, causes allocation).
// - if calls are allowed, they must be effect free (since eval point is moving).
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
// OVERVIEW
// Overview of passes (over term) and steps (not over term):
//
// pass1 - decide which f will be TLR and determine their arity.
// pass2 - what closures are needed? Finds reqdTypars(f) and reqdItems(f) for TLR f.
// Depends on the arity choice, so must follow pass1.
// step3 - choose env packing, create fHats.
// pass4 - rewrite term fixing up definitions and callsites.
// Depends on closure and env packing, so must follow pass2 (and step 3).
// pass5 - copyExpr call to topexpr to ensure all bound ids are unique.
// For complexity reasons, better to re-recurse over expr once.
// pass6 - sanity check, confirm that all TLR marked bindings meet DEFN.
//
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
// pass1: GetValsBoundUnderMustInline (see comment further below)
//-------------------------------------------------------------------------
let GetValsBoundUnderMustInline xinfo =
let accRejectFrom (v: Val) repr rejectS =
if v.InlineInfo = ValInline.PseudoVal then
Zset.union (GetValsBoundInExpr repr) rejectS
else rejectS
let rejectS = Zset.empty valOrder
let rejectS = Zmap.fold accRejectFrom xinfo.Defns rejectS
rejectS
//-------------------------------------------------------------------------
// pass1: IsRefusedTLR
//-------------------------------------------------------------------------
let IsRefusedTLR g (f: Val) =
let mutableVal = f.IsMutable
// things marked ValInline.Never are special
let dllImportStubOrOtherNeverInline = (f.InlineInfo = ValInline.Never)
// Cannot have static fields of byref type
let byrefVal = isByrefLikeTy g f.Range f.Type
// Special values are instance methods etc. on .NET types. For now leave these alone
let specialVal = f.MemberInfo.IsSome
let alreadyChosen = f.ValReprInfo.IsSome
let refuseTest = alreadyChosen || mutableVal || byrefVal || specialVal || dllImportStubOrOtherNeverInline
refuseTest
let IsMandatoryTopLevel (f: Val) =
let specialVal = f.MemberInfo.IsSome
let isModulBinding = f.IsMemberOrModuleBinding
specialVal || isModulBinding
let IsMandatoryNonTopLevel g (f: Val) =
let byrefVal = isByrefLikeTy g f.Range f.Type
byrefVal
//-------------------------------------------------------------------------
// pass1: decide which f are to be TLR? and if so, arity(f)
//-------------------------------------------------------------------------
module Pass1_DetermineTLRAndArities =
let GetMaxNumArgsAtUses xinfo f =
match Zmap.tryFind f xinfo.Uses with
| None -> 0 (* no call sites *)
| Some sites ->
sites |> List.map (fun (_accessors, _tinst, args) -> List.length args) |> List.max
let SelectTLRVals g xinfo f e =
if IsRefusedTLR g f then None
// Exclude values bound in a decision tree
else if Zset.contains f xinfo.DecisionTreeBindings then None
else
// Could the binding be TLR? with what arity?
let atTopLevel = Zset.contains f xinfo.TopLevel
|
{
"pile_set_name": "Github"
}
|
/*
* textstyle.c -- text style processing module.
*
* Copyright (c) 2018, Liu chao <lc-soft@live.cn> 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 LCUI nor the names of its contributors may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <LCUI_Build.h>
#include <LCUI/types.h>
#include <LCUI/util/math.h>
#include <LCUI/util/parse.h>
#include <LCUI/util/linkedlist.h>
#include <LCUI/font.h>
typedef enum LCUI_TextStyleTagType_ {
TEXT_STYLE_STYLE,
TEXT_STYLE_BOLD,
TEXT_STYLE_ITALIC,
TEXT_STYLE_SIZE,
TEXT_STYLE_COLOR,
TEXT_STYLE_BG_COLOR,
TEXT_STYLE_TOTAL_NUM
} LCUI_TextStyleTagType;
typedef struct LCUI_StyleTag {
LCUI_TextStyleTagType id;
LCUI_StyleRec style;
} LCUI_TextStyleTag;
void TextStyle_Init(LCUI_TextStyle data)
{
data->has_style = FALSE;
data->has_weight = FALSE;
data->has_family = FALSE;
data->has_pixel_size = FALSE;
data->has_back_color = FALSE;
data->has_fore_color = FALSE;
data->font_ids = NULL;
data->style = FONT_STYLE_NORMAL;
data->weight = FONT_WEIGHT_NORMAL;
data->fore_color.value = 0xff333333;
data->back_color.value = 0xffffffff;
data->pixel_size = 13;
}
int TextStyle_CopyFamily(LCUI_TextStyle dst, LCUI_TextStyle src)
{
size_t len;
if (!src->has_family) {
return 0;
}
for (len = 0; src->font_ids[len]; ++len);
len += 1;
if (dst->font_ids) {
free(dst->font_ids);
}
dst->font_ids = malloc(len * sizeof(int));
if (!dst->font_ids) {
return -ENOMEM;
}
dst->has_family = TRUE;
memcpy(dst->font_ids, src->font_ids, len * sizeof(int));
return 0;
}
int TextStyle_Copy(LCUI_TextStyle dst, LCUI_TextStyle src)
{
*dst = *src;
dst->font_ids = NULL;
return TextStyle_CopyFamily(dst, src);
}
void TextStyle_Destroy(LCUI_TextStyle data)
{
if (data->font_ids) {
free(data->font_ids);
}
data->font_ids = NULL;
}
void TextStyle_Merge(LCUI_TextStyle base, LCUI_TextStyle target)
{
int *font_ids = NULL;
base->has_family = TRUE;
TextStyle_CopyFamily(base, target);
if (target->has_style && !base->has_style &&
target->style != FONT_STYLE_NORMAL) {
base->has_style = TRUE;
base->style = target->style;
}
if (LCUIFont_UpdateStyle(base->font_ids,
base->style,
&font_ids) > 0) {
free(base->font_ids);
base->font_ids = font_ids;
}
if (target->has_weight && !base->has_weight &&
target->weight != FONT_WEIGHT_NORMAL) {
base->has_weight = TRUE;
base->weight = target->weight;
}
if (LCUIFont_UpdateWeight(base->font_ids,
base->weight,
&font_ids) > 0) {
free(base->font_ids);
base->font_ids = font_ids;
}
}
int TextStyle_SetWeight(LCUI_TextStyle ts, LCUI_FontWeight weight)
{
int *font_ids;
ts->weight = weight;
ts->has_weight = TRUE;
if (LCUIFont_UpdateWeight(ts->font_ids, weight, &font_ids) > 0) {
free(ts->font_ids);
ts->font_ids = font_ids;
return 0;
}
return -1;
}
int TextStyle_SetStyle(LCUI_TextStyle ts, LCUI_FontStyle style)
{
int *font_ids;
ts->style = style;
ts->has_style = TRUE;
if (LCUIFont_UpdateStyle(ts->font_ids, style, &font_ids) > 0) {
free(ts->font_ids);
ts->font_ids = font_ids;
return 0;
}
return -1;
}
int TextStyle_SetFont(LCUI_TextStyle ts, const char *str)
{
size_t count;
if (ts->has_family && ts->font_ids) {
free(ts->font_ids);
}
ts->font_ids = NULL;
ts->has_family = FALSE;
count = LCUIFont_GetIdByNames(&ts->font_ids, ts->style,
ts->weight, str);
if (count > 0) {
ts->has_family = TRUE;
return 0;
}
return -1;
}
int TextStyle_SetDefaultFont(LCUI_TextStyle ts)
{
if (ts->has_family && ts->font_ids) {
free(ts->font_ids);
ts->has_family = FALSE;
}
ts->font_ids = malloc(sizeof(int) * 2);
if (!ts->font_ids) {
ts->font_ids = NULL;
return -ENOMEM;
}
ts->has_family = TRUE;
ts->font_ids[0] = LCUIFont_GetDefault();
ts->font_ids[1] = 0;
return 0;
}
/*-------------------------- StyleTag --------------------------------*/
void StyleTags_Clear(LinkedList *tags)
{
LinkedList_Clear(tags, free);
}
/** 获取当前的文本样式 */
LCUI_TextStyle StyleTags_GetTextStyle(LinkedList *tags)
{
int count = 0;
LinkedListNode *node;
LCUI_TextStyleTag *tag;
LCUI_TextStyle style;
LCUI_BOOL found_tags[TEXT_STYLE_TOTAL_NUM] = { 0 };
if (tags->length <= 0) {
return NULL;
|
{
"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.
//
#import <NewsUI2/_TtC7NewsUI217NoopAudioAssembly.h>
@interface _TtC7NewsUI217NoopAudioAssembly (NewsUI2)
- (void)loadInRegistry:(id)arg1;
@end
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
* Copyright (C) 2006 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
interface SVGTransform {
// Transform Types
const unsigned short SVG_TRANSFORM_UNKNOWN = 0;
const unsigned short SVG_TRANSFORM_MATRIX = 1;
const unsigned short SVG_TRANSFORM_TRANSLATE = 2;
const unsigned short SVG_TRANSFORM_SCALE = 3;
const unsigned short SVG_TRANSFORM_ROTATE = 4;
const unsigned short SVG_TRANSFORM_SKEWX = 5;
const unsigned short SVG_TRANSFORM_SKEWY = 6;
readonly attribute unsigned short type;
[ImplementedAs=svgMatrix] readonly attribute SVGMatrix matrix;
readonly attribute unrestricted float angle;
[StrictTypeChecking] void setMatrix(SVGMatrix matrix);
[StrictTypeChecking] void setTranslate(unrestricted float tx, unrestricted float ty);
[StrictTypeChecking] void setScale(unrestricted float sx, unrestricted float sy);
[StrictTypeChecking] void setRotate(unrestricted float angle, unrestricted float cx, unrestricted float cy);
[StrictTypeChecking] void setSkewX(unrestricted float angle);
[StrictTypeChecking] void setSkewY(unrestricted float angle);
};
|
{
"pile_set_name": "Github"
}
|
$(function() {
$('.navdrawer-nav a[title]').tooltip({
'html': true,
'placement': 'right',
'boundary': 'viewport'
});
});
|
{
"pile_set_name": "Github"
}
|
"use strict";
/* Generated from:
* ap-northeast-1 (https://d33vqc0rt9ld30.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 16.2.0,
* ap-northeast-2 (https://d1ane3fvebulky.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 16.2.0,
* ap-northeast-3 (https://d2zq80gdmjim8k.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 16.2.0,
* ap-south-1 (https://d2senuesg1djtx.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 16.2.0,
* ap-southeast-1 (https://doigdx0kgq9el.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 16.2.0,
* ap-southeast-2 (https://d2stg8d246z9di.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 16.2.0,
* ca-central-1 (https://d2s8ygphhesbe7.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 16.2.0,
* eu-central-1 (https://d1mta8qj7i28i2.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 16.2.0,
* eu-west-1 (https://d3teyb21fexa9r.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 16.2.0,
* eu-west-2 (https://d1742qcu2c1ncx.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 16.2.0,
* eu-west-3 (https://d2d0mfegowb3wk.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 16.2.0,
* sa-east-1 (https://d3c9jyj3w509b0.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 16.2.0,
* us-east-1 (https://d1uauaxba7bl26.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 16.2.0,
* us-east-2 (https://dnwj8swjjbsbt.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 16.2.0,
* us-west-1 (https://d68hl49wbnanq.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 16.2.0,
* us-west-2 (https://d201a2mn26r7lk.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 16.2.0
*/
Object.defineProperty(exports, "__esModule", { value: true });
const simulationApplication_1 = require("./simulationApplication");
const simulationApplicationVersion_1 = require("./simulationApplicationVersion");
const robotApplication_1 = require("./robotApplication");
const fleet_1 = require("./fleet");
const robotApplicationVersion_1 = require("./robotApplicationVersion");
const robot_1 = require("./robot");
var RoboMaker;
(function (RoboMaker) {
RoboMaker.SimulationApplication = simulationApplication_1.default;
RoboMaker.SimulationApplicationVersion = simulationApplicationVersion_1.default;
RoboMaker.RobotApplication = robotApplication_1.default;
RoboMaker.Fleet = fleet_1.default;
RoboMaker.RobotApplicationVersion = robotApplicationVersion_1.default;
RoboMaker.Robot = robot_1.default;
})(RoboMaker = exports.RoboMaker || (exports.RoboMaker = {}));
|
{
"pile_set_name": "Github"
}
|
def safe_remove(f):
import os
try:
os.remove(f)
except OSError:
pass
"""
Basic logger functionality; replace this with a real logger of your choice
"""
import imp
import sys
class VPLogger:
def debug(self, s):
print '[DEBUG] %s' % s
def info(self, s):
print '[INFO] %s' % s
def warning(self, s):
print '[WARNING] %s' % s
def error(self, s):
print '[ERROR] %s' % s
def import_non_local(name, custom_name=None):
"""Import when you have conflicting names"""
custom_name = custom_name or name
f, pathname, desc = imp.find_module(name, sys.path[1:])
module = imp.load_module(custom_name, f, pathname, desc)
if f:
f.close()
return module
|
{
"pile_set_name": "Github"
}
|
<p></p>
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<title>Suave Test Page</title>
<script type="text/javascript">
//<![CDATA[
window.addEventListener("load", function () {
var sendFiles = function(event) {
var fd = new FormData(event.target);
fd.append('custom', 1337);
var request = new XMLHttpRequest();
request.addEventListener("load", function(event) {
if (console && console.log) {
console.info('success', event.target.responseText);
}
});
request.addEventListener("error", function(event) {
if (console && console.log) {
console.error('error', event);
}
});
request.open("PUT", event.target.action);
request.send(fd);
};
document.getElementById("up3").addEventListener("submit", function (event) {
event.preventDefault();
sendFiles(event);
});
});
//]]>
</script>
</head>
<body>
<h1>POST testing</h1>
<h2>Simple data POST</h2>
<form method="post" action="test.html">
<p>
<input type="text" name="edit1" /><br />
<input type="submit" />
</p>
</form>
<h2>1. File Upload test</h2>
<form method="post" action="upload" enctype="multipart/form-data">
<p>
<input type="file" name="myfile" /><br />
<input type="submit" />
</p>
</form>
<h2>2. Multiple File Upload test – <pre>multipart/form-data</pre></h2>
<form method="PUT" action="upload2" enctype="multipart/form-data">
<p>
<input type="file" name="myfile1" /><br />
<input type="file" name="myfile2" /><br />
<input type="text" name="edit1" /><br />
<input type="submit" />
</p>
</form>
<h2>3. Multiple File JavaScript/FormData Upload test</h2>
<form id="up3" name="up3" method="PUT" action="upload2">
<p>Will post with <pre>Content-Type: multipart/form-data; boundary=---------------------------15407761691467256857631277098</pre></p>
<p>
<input type="file" name="myfile1" accept="image/*;capture=camera" required="required" /> *<br />
<input type="file" name="myfile2" accept="image/*;capture=camera" /><br />
<input type="text" name="edit1" /><br />
<input type="submit" />
</p>
</form>
<h2>Image</h2>
<img src="examples.png" />
<h2>4. International Form Fields</h2>
<form id="put1" name="put1" method="POST" action="i18nforms" enctype="multipart/form-data">
<p>Will now post a form with a number of funky names</p>
<p>
<input type="text" name="ödlan" /><br />
<input type="text" name="小" value="small" /><br />
<input type="submit" />
</p>
</form>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
#include <stdio.h>
#include <string.h>
int romanToInt(char *s) {
int len = strlen(s);
int ans = 0;
int i = 0;
while (i < len) {
switch (s[i]) {
case 'M':
ans += 1000;
break;
case 'D':
ans += 500;
break;
case 'C':
if (s[i + 1] == 'D' || s[i + 1] == 'M'){
ans -= 100;
}
else {
ans += 100;
}
break;
case 'L':
ans += 50;
break;
case 'X':
if (s[i + 1] == 'L' || s[i + 1] == 'C'){
ans -= 10;
}
else {
ans += 10;
}
break;
case 'V':
ans += 5;
break;
case 'I':
if (s[i + 1] == 'V' || s[i + 1] == 'X'){
ans -= 1;
}
else {
ans += 1;
}
break;
default:
break;
}
i++;
}
return ans;
}
int main() {
char s1[] = "MMXIV";
char s2[] = "MMXV";
/* should be 2014 */
printf("%d\n", romanToInt(s1));
/* should be 2015 */
printf("%d\n", romanToInt(s2));
return 0;
}
|
{
"pile_set_name": "Github"
}
|
import { IScheduler } from '../Scheduler';
import { Observable } from '../Observable';
import { Subscriber } from '../Subscriber';
import { TeardownLogic } from '../Subscription';
/**
* We need this JSDoc comment for affecting ESDoc.
* @extends {Ignored}
* @hide true
*/
export declare class ScalarObservable<T> extends Observable<T> {
value: T;
private scheduler;
static create<T>(value: T, scheduler?: IScheduler): ScalarObservable<T>;
static dispatch(state: any): void;
_isScalar: boolean;
constructor(value: T, scheduler?: IScheduler);
protected _subscribe(subscriber: Subscriber<T>): TeardownLogic;
}
|
{
"pile_set_name": "Github"
}
|
package ezy.sdk3rd.social.sdk;
/**
* Created by ezy on 17/3/18.
*/
public interface OnSucceed<T> {
void onSucceed(T result);
}
|
{
"pile_set_name": "Github"
}
|
package jsoniter
import (
"encoding/json"
"io"
"reflect"
"sync"
"unsafe"
"github.com/modern-go/concurrent"
"github.com/modern-go/reflect2"
)
// Config customize how the API should behave.
// The API is created from Config by Froze.
type Config struct {
IndentionStep int
MarshalFloatWith6Digits bool
EscapeHTML bool
SortMapKeys bool
UseNumber bool
DisallowUnknownFields bool
TagKey string
OnlyTaggedField bool
ValidateJsonRawMessage bool
ObjectFieldMustBeSimpleString bool
CaseSensitive bool
}
// API the public interface of this package.
// Primary Marshal and Unmarshal.
type API interface {
IteratorPool
StreamPool
MarshalToString(v interface{}) (string, error)
Marshal(v interface{}) ([]byte, error)
MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)
UnmarshalFromString(str string, v interface{}) error
Unmarshal(data []byte, v interface{}) error
Get(data []byte, path ...interface{}) Any
NewEncoder(writer io.Writer) *Encoder
NewDecoder(reader io.Reader) *Decoder
Valid(data []byte) bool
RegisterExtension(extension Extension)
DecoderOf(typ reflect2.Type) ValDecoder
EncoderOf(typ reflect2.Type) ValEncoder
}
// ConfigDefault the default API
var ConfigDefault = Config{
EscapeHTML: true,
}.Froze()
// ConfigCompatibleWithStandardLibrary tries to be 100% compatible with standard library behavior
var ConfigCompatibleWithStandardLibrary = Config{
EscapeHTML: true,
SortMapKeys: true,
ValidateJsonRawMessage: true,
}.Froze()
// ConfigFastest marshals float with only 6 digits precision
var ConfigFastest = Config{
EscapeHTML: false,
MarshalFloatWith6Digits: true, // will lose precession
ObjectFieldMustBeSimpleString: true, // do not unescape object field
}.Froze()
type frozenConfig struct {
configBeforeFrozen Config
sortMapKeys bool
indentionStep int
objectFieldMustBeSimpleString bool
onlyTaggedField bool
disallowUnknownFields bool
decoderCache *concurrent.Map
encoderCache *concurrent.Map
encoderExtension Extension
decoderExtension Extension
extraExtensions []Extension
streamPool *sync.Pool
iteratorPool *sync.Pool
caseSensitive bool
}
func (cfg *frozenConfig) initCache() {
cfg.decoderCache = concurrent.NewMap()
cfg.encoderCache = concurrent.NewMap()
}
func (cfg *frozenConfig) addDecoderToCache(cacheKey uintptr, decoder ValDecoder) {
cfg.decoderCache.Store(cacheKey, decoder)
}
func (cfg *frozenConfig) addEncoderToCache(cacheKey uintptr, encoder ValEncoder) {
cfg.encoderCache.Store(cacheKey, encoder)
}
func (cfg *frozenConfig) getDecoderFromCache(cacheKey uintptr) ValDecoder {
decoder, found := cfg.decoderCache.Load(cacheKey)
if found {
return decoder.(ValDecoder)
}
return nil
}
func (cfg *frozenConfig) getEncoderFromCache(cacheKey uintptr) ValEncoder {
encoder, found := cfg.encoderCache.Load(cacheKey)
if found {
return encoder.(ValEncoder)
}
return nil
}
var cfgCache = concurrent.NewMap()
func getFrozenConfigFromCache(cfg Config) *frozenConfig {
obj, found := cfgCache.Load(cfg)
if found {
return obj.(*frozenConfig)
}
return nil
}
func addFrozenConfigToCache(cfg Config, frozenConfig *frozenConfig) {
cfgCache.Store(cfg, frozenConfig)
}
// Froze forge API from config
func (cfg Config) Froze() API {
api := &frozenConfig{
sortMapKeys: cfg.SortMapKeys,
indentionStep: cfg.IndentionStep,
objectFieldMustBeSimpleString: cfg.ObjectFieldMustBeSimpleString,
onlyTaggedField: cfg.OnlyTaggedField,
disallowUnknownFields: cfg.DisallowUnknownFields,
caseSensitive: cfg.CaseSensitive,
}
api.streamPool = &sync.Pool{
New: func() interface{} {
return NewStream(api, nil, 512)
},
}
api.iteratorPool = &sync.Pool{
New: func() interface{} {
return NewIterator(api)
},
}
api.initCache()
encoderExtension := EncoderExtension{}
decoderExtension := DecoderExtension{}
if cfg.MarshalFloatWith6Digits {
api.marshalFloatWith6Digits(encoderExtension)
}
if cfg.EscapeHTML {
api.escapeHTML(encoderExtension)
}
if cfg.UseNumber {
api.useNumber(decoderExtension)
}
if cfg.ValidateJsonRawMessage {
api.validateJsonRawMessage(encoderExtension)
}
api.encoderExtension = encoderExtension
api.decoderExtension = decoderExtension
api.configBeforeFrozen = cfg
return api
}
func (cfg Config) frozeWithCacheReuse(extraExtensions []Extension) *frozenConfig {
api := getFrozenConfigFromCache(cfg)
if api != nil {
return api
}
api = cfg.Froze().(*frozenConfig)
for _, extension := range extraExtensions {
api.RegisterExtension(extension)
}
addFrozenConfigToCache(cfg, api)
return api
}
func (cfg *frozenConfig) validateJsonRawMessage(extension EncoderExtension) {
encoder := &funcEncoder{func(ptr unsafe.Pointer, stream *Stream) {
rawMessage := *(*json.RawMessage)(ptr)
iter := cfg.BorrowIterator([]byte(rawMessage))
defer cfg.ReturnIterator(iter)
iter.Read()
if iter.Error != nil && iter.Error != io.EOF {
stream.WriteRaw("null")
} else {
stream.WriteRaw(string(rawMessage))
}
}, func(ptr unsafe.Pointer) bool {
return len(*((*json.RawMessage)(ptr))) == 0
}}
extension[reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem()] = encoder
extension[reflect2.TypeOfPtr((*RawMessage)(nil)).Elem()] = encoder
}
func (cfg *frozenConfig) useNumber(extension DecoderExtension) {
extension[reflect2.TypeOfPtr((*interface{})(nil)).Elem()] = &funcDecoder{func(ptr unsafe.Pointer, iter *Iterator) {
exitingValue := *((*interface{})(ptr))
if exitingValue != nil && reflect.TypeOf(exitingValue).Kind() == reflect.Ptr {
iter.ReadVal(exitingValue)
return
}
if iter.WhatIsNext() == NumberValue {
*((*interface{})(ptr)) = json.Number(iter.readNumberAsString())
} else {
*((*interface{})(ptr)) = iter.Read()
}
}}
}
func (cfg *frozenConfig) getTagKey() string {
tagKey := cfg.configBeforeFrozen.TagKey
if tagKey == "" {
return "json"
}
return tagKey
}
func (cfg *frozenConfig) RegisterExtension(extension Extension) {
cfg.extraExtensions = append(cfg.extraExtensions, extension)
copied := cfg.configBeforeFrozen
cfg.configBeforeFrozen = copied
}
type lossyFloat32Encoder struct {
}
func (encoder *lossyFloat32Encoder) Encode(ptr unsafe.Pointer, stream *Stream) {
stream.WriteFloat32Lossy(*((*float32)(ptr)))
}
func (encoder *lossyFloat32Encoder) IsEmpty(ptr unsafe.Pointer) bool {
return *((*float32)(ptr)) == 0
}
type lossyFloat64Encoder struct {
}
|
{
"pile_set_name": "Github"
}
|
#region Copyright notice and license
// Copyright 2019 The gRPC Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion
using Microsoft.Extensions.DependencyInjection;
namespace Grpc.AspNetCore.Server.Internal
{
/// <summary>
/// A marker class used to determine if all the required gRPC services were added
/// to the <see cref="IServiceCollection"/>.
/// </summary>
internal class GrpcMarkerService
{
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.cxf.systests</groupId>
<artifactId>cxf-systests-container-integration</artifactId>
<version>3.4.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>cxf-systests-ci-webapp</artifactId>
<name>Apache CXF Container Integration Test Webapp</name>
<description>Apache CXF Container Integration Test Webapp</description>
<packaging>war</packaging>
<properties>
<cxf.module.name>org.apache.cxf.systests.ci.webapp</cxf.module.name>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</dependency>
</dependencies>
</project>
|
{
"pile_set_name": "Github"
}
|
H
514
// -0.003071
0xFF9B
// 0.000000
0x0000
// 0.000837
0x001B
// 0.000460
0x000F
// -0.000172
0xFFFA
// 0.004224
0x008A
// 0.001067
0x0023
// -0.000172
0xFFFA
// -0.000591
0xFFED
// 0.001196
0x0027
// 0.000749
0x0019
// -0.002649
0xFFA9
// -0.002541
0xFFAD
// 0.000919
0x001E
// 0.001236
0x0028
// 0.002534
0x0053
// -0.000219
0xFFF9
// 0.002971
0x0061
// -0.000512
0xFFEF
// -0.001688
0xFFC9
// -0.003583
0xFF8B
// -0.001090
0xFFDC
// 0.000593
0x0013
// 0.003065
0x0064
// -0.000524
0xFFEF
// -0.001371
0xFFD3
// 0.001801
0x003B
// 0.001528
0x0032
// -0.002660
0xFFA9
// -0.002455
0xFFB0
// 0.002330
0x004C
// -0.000900
0xFFE3
// -0.002564
0xFFAC
// -0.000514
0xFFEF
// -0.001033
0xFFDE
// 0.000281
0x0009
// 0.000469
0x000F
// -0.002239
0xFFB7
// -0.002356
0xFFB3
// 0.000554
0x0012
// -0.002421
0xFFB1
// -0.000130
0xFFFC
// -0.000562
0xFFEE
// 0.001396
0x002E
// -0.002489
0xFFAE
// 0.000426
0x000E
// 0.002256
0x004A
// 0.002442
0x0050
// 0.001776
0x003A
// 0.000518
0x0011
// -0.001811
0xFFC5
// 0.000621
0x0014
// -0.000363
0xFFF4
// -0.000726
0xFFE8
// 0.002774
0x005B
// 0.000604
0x0014
// 0.001582
0x0034
// -0.003577
0xFF8B
// -0.005167
0xFF57
// -0.000674
0xFFEA
// 0.001228
0x0028
// 0.005169
0x00A9
// -0.002550
0xFFAC
// 0.000948
0x001F
// -0.000272
0xFFF7
// -0.348433
0xD367
// 0.000003
0x0000
// -0.002993
0xFF9E
// -0.003208
0xFF97
// 0.000343
0x000B
// -0.004114
0xFF79
// 0.001893
0x003E
// -0.000575
0xFFED
// -0.002274
0xFFB5
// -0.001288
0xFFD6
// 0.004634
0x0098
// 0.001951
0x0040
// 0.000565
0x0013
// 0.004877
0x00A0
// -0.004819
0xFF62
// -0.001148
0xFFDA
// -0.003033
0xFF9D
// 0.000542
0x0012
// 0.002940
0x0060
// 0.002456
0x0050
// 0.003269
0x006B
// 0.000090
0x0003
// 0.003598
0x0076
// -0.000852
0xFFE4
// -0.001671
0xFFC9
// 0.003703
0x0079
// 0.000302
0x000A
// 0.001622
0x0035
// -0.001162
0xFFDA
// 0.000454
0x000F
// -0.003371
0xFF92
// 0.005582
0x00B7
// 0.000520
0x0011
// 0.000053
0x0002
// 0.000482
0x0010
// -0.000753
0xFFE7
// -0.002900
0xFFA1
// -0.002337
0xFFB3
// -0.000990
0xFFE0
// 0.000336
0x000B
// -0.002012
0xFFBE
// 0.002787
0x005B
// 0.002887
0x005F
// -0.000504
0xFFEF
// -0.002794
0xFFA4
// -0.002083
0xFFBC
// 0.002852
0x005D
// -0.003867
0xFF81
// -0.003583
0xFF8B
// 0.004177
0x0089
// 0.003345
0x006E
// -0.001919
0xFFC1
// -0.001362
0xFFD3
// -0.001385
0xFFD3
// 0.000467
0x000F
// 0.000274
0x0009
// 0.002044
0x0043
// 0.002510
0x0052
// -0.002230
0xFFB7
// 0.001917
0x003F
// -0.002398
0xFFB1
// 0.000628
0x0015
// -0.003740
0xFF85
// 0.001128
0x0025
// -0.000604
0xFFEC
// -0.000438
0xFFF2
// -0.001033
0xFFDE
// 0.000429
0x000E
// -0.002321
0xFFB4
// 0.001635
0x0036
// -0.000327
0xFFF5
// 0.000236
0x0008
// 0.002720
0x0059
// -0.000609
0xFFEC
// -0.001582
0xFFCC
// 0.003225
0x006A
// -0.002813
0xFFA4
// -0.000369
0xFFF4
// -0.001834
0xFFC4
// 0.000031
0x0001
// 0.000185
0x0006
// 0.000105
0x0003
// -0.000179
0xFFFA
// -0.000319
0xFFF6
// -0.000499
0xFFF0
// 0.002246
0x004A
// 0.000977
0x0020
// -0.001249
0xFFD7
// 0.002727
0x0059
// -0.000492
0xFFF0
// 0.000821
0x001B
// -0.000651
0xFFEB
// -0.002319
0xFFB4
// 0.000045
0x0001
// 0.001755
0x003A
// 0.002297
0x004B
// -0.003476
0xFF8E
// -0.002343
0xFFB3
// -0.000240
0xFFF8
// 0.001105
0x0024
// 0.001331
0x002C
// 0.001400
0x002E
// -0.000242
0xFFF8
// -0.001631
0xFFCB
// -0.003229
0xFF96
// 0.002528
0x0053
// -0.001220
0xFFD8
// -0.002878
0xFFA2
// -0.001199
0xFFD9
// 0.002841
0x005D
// -0.003089
0xFF9B
// -0.005334
0xFF51
// 0.003751
0x007B
// 0.000436
0x000E
// -0.003199
0xFF97
// -0.000197
0xFFFA
// 0.001792
0x003B
// 0.000881
0x001D
// -0.001966
0xFFC
|
{
"pile_set_name": "Github"
}
|
'use strict';
module.exports = function (str, sep) {
if (typeof str !== 'string') {
throw new TypeError('Expected a string');
}
sep = typeof sep === 'undefined' ? '_' : sep;
return str
.replace(/([a-z\d])([A-Z])/g, '$1' + sep + '$2')
.replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + sep + '$2')
.toLowerCase();
};
|
{
"pile_set_name": "Github"
}
|
<?php
/*
* Copyright 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
class Google_Service_Spanner_Binding extends Google_Collection
{
protected $collection_key = 'members';
public $members;
public $role;
public function setMembers($members)
{
$this->members = $members;
}
public function getMembers()
{
return $this->members;
}
public function setRole($role)
{
$this->role = $role;
}
public function getRole()
{
return $this->role;
}
}
|
{
"pile_set_name": "Github"
}
|
{
"id": "biancas-poster",
"name": "Bianca's Poster",
"games": {
"nh": {
"sellPrice": {
"currency": "bells",
"value": 250
},
"buyPrices": [
{
"currency": "bells",
"value": 1000
}
]
}
},
"category": "Photos"
}
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class OculusManifestPreprocessor
| XRTK-Core </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class OculusManifestPreprocessor
| XRTK-Core ">
<meta name="generator" content="docfx 2.52.0.0">
<link rel="shortcut icon" href="../favicon.png">
<link rel="stylesheet" href="../styles/docfx.vendor.css">
<link rel="stylesheet" href="../styles/docfx.css">
<link rel="stylesheet" href="../styles/main.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<meta property="docfx:navrel" content="../toc.html">
<meta property="docfx:tocrel" content="toc.html">
</head> <body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../logo.png" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="XRTK.Oculus.OculusManifestPreprocessor">
<h1 id="XRTK_Oculus_OculusManifestPreprocessor" data-uid="XRTK.Oculus.OculusManifestPreprocessor" class="text-break">Class OculusManifestPreprocessor
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
<h5>Inheritance</h5>
<div class="level0"><a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object">Object</a></div>
<div class="level1"><span class="xref">OculusManifestPreprocessor</span></div>
</div>
<div class="inheritedMembers">
<h5>Inherited Members</h5>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.equals#System_Object_Equals_System_Object_">Object.Equals(Object)</a>
</div>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.equals#System_Object_Equals_System_Object_System_Object_">Object.Equals(Object, Object)</a>
</div>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.gethashcode#System_Object_GetHashCode">Object.GetHashCode()</a>
</div>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.gettype#System_Object_GetType">Object.GetType()</a>
</div>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.memberwiseclone#System_Object_MemberwiseClone">Object.MemberwiseClone()</a>
</div>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.referenceequals#System_Object_ReferenceEquals_System_Object_System_Object_">Object.ReferenceEquals(Object, Object)</a>
</div>
<div>
<a class="xref" href="https://docs.microsoft.com/dotnet/api/system.object.tostring#System_Object_ToString">Object.ToString()</a>
</div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="XRTK.Oculus.html">XRTK.Oculus</a></h6>
<h6><strong>Assembly</strong>: XRTK.Oculus.Editor.dll</h6>
<h5 id="XRTK_Oculus_OculusManifestPreprocessor_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public class OculusManifestPreprocessor</code></pre>
</div>
<h3 id="methods">Methods
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/XRTK/XRTK-Core/new/development/docs-ref-overwrite/new?filename=XRTK_Oculus_OculusManifestPreprocessor_GenerateManifestForSubmission.md&value=---%0Auid%3A%20XRTK.Oculus.OculusManifestPreprocessor.GenerateManifestForSubmission%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/XRTK/XRTK-Core/blob/master/XRTK-Core/Packages/com.xrtk.oculus/Editor/OculusManifestPreprocessor.cs/#L30">View Source</a>
</span>
<a id="XRTK_Oculus_OculusManifestPreprocessor_GenerateManifestForSubmission_" data-uid="XRTK.Oculus.OculusManifestPreprocessor.GenerateManifestForSubmission*"></a>
<h4 id="XRTK_Oculus_OculusManifestPreprocessor_GenerateManifestForSubmission" data-uid="XRTK.Oculus.OculusManifestPre
|
{
"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.
//
#import <SAObjects/AceObject.h>
#import <SAObjects/SAAceSerializable-Protocol.h>
@class NSString;
@interface SAUITemplateEdgeInsets : AceObject <SAAceSerializable>
{
}
+ (id)edgeInsetsWithDictionary:(id)arg1 context:(id)arg2;
+ (id)edgeInsets;
@property(nonatomic) float top;
@property(nonatomic) float right;
@property(nonatomic) float left;
@property(nonatomic) float bottom;
- (id)encodedClassName;
- (id)groupIdentifier;
// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;
@end
|
{
"pile_set_name": "Github"
}
|
//===== eAthena Script =======================================
//= Lighthalzen Dungeon(Biolabs) Monster Spawn Script
//===== By: ==================================================
// The Prometheus Project, eAthena dev team
//===== Current Version: =====================================
//= 1.8
//===== Compatible With: =====================================
//= Any Athena
//===== Additional Comments: =================================
//= 08/24/05 : Added 1st version. [Muad_Dib]
//= 1.1: Some corrections to level 1, 2 as pointed out by
//= MasterofMuppets. [Skotlex]
//= 1.3: Some fixes based on kRO's "RO Map" [Poki#3]
//= I also made the place more Moby ^^
//= 1.4: Adjusted spawns according to own info from iRO [MasterOfMuppets]
//= 1.5: More accurate spawn numbers and iRO names thanks to Tharis [Playtester]
//= 1.6: Official X.3 spawns [Playtester]
//= 1.7 Corrected MVP spawn function to be standard to iRO. [L0ne_W0lf]
//= - A random 99 will now be spawned when the MVP spawns.
//= - Spare spawn and MVP spawn now spawn in official locations.
//= - Expandeded timer to allow for varying spawn times.
//= 1.7a Added dummy event to keep from causnig warnings. [L0ne_W0lf]
//= 1.8 Corrected MVP spawn variance (Labs2 MVP). [L0ne_W0lf]
//============================================================
//========================================================================================
// lhz_dun01 - Bio-life Labs 1F
//========================================================================================
lhz_dun01,0,0,0,0 monster Metaling 1613,50,0,0,0
lhz_dun01,0,0,0,0 monster Anopheles 1627,70,0,0,0
lhz_dun01,0,0,0,0 monster Remover 1682,100,0,0,0
lhz_dun01,0,0,0,0 monster Egnigem Cenia 1652,1,0,0,0
lhz_dun01,0,0,0,0 monster Wickebine Tres 1653,1,0,0,0
lhz_dun01,0,0,0,0 monster Armeyer Dinze 1654,1,0,0,0
lhz_dun01,0,0,0,0 monster Errende Ebecee 1655,1,0,0,0
lhz_dun01,0,0,0,0 monster Kavach Icarus 1656,1,0,0,0
lhz_dun01,0,0,0,0 monster Laurell Weinder 1657,1,0,0,0
lhz_dun01,150,50,16,18 monster Egnigem Cenia 1652,1,900000,800000,1
lhz_dun01,150,50,16,18 monster Wickebine Tres 1653,1,900000,800000,1
lhz_dun01,150,50,16,18 monster Armeyer Dinze 1654,1,900000,800000,1
lhz_dun01,150,50,16,18 monster Errende Ebecee 1655,5,900000,800000,1
lhz_dun01,150,50,16,18 monster Kavach Icarus 1656,5,600000,300000,1
lhz_dun01,150,50,16,18 monster Laurell Weinder 1657,5,600000,300000,1
lhz_dun01,250,150,18,30 monster Egnigem Cenia 1652,4,900000,800000,1
lhz_dun01,250,150,18,30 monster Wickebine Tres 1653,4,600000,300000,1
lhz_dun01,250,150,18,30 monster Armeyer Dinze 1654,4,900000,800000,1
lhz_dun01,250,150,18,30 monster Errende Ebecee 1655,2,900000,800000,1
lhz_dun01,250,150,18,30 monster Kavach Icarus 1656,2,900000,800000,1
lhz_dun01,250,150,18,30 monster Laurell Weinder 1657,2,600000,300000,1
lhz_dun01,50,150,11,35 monster Egnigem Cenia 1652,1,600000,300000,1
lhz_dun01,50,150,11,35 monster Wickebine Tres 1653,4,900000,800000,1
lhz_dun01,50,150,11,35 monster Armeyer Dinze 1654,1,900000,800000,1
lhz_dun01,50,150,11,35 monster Errende Ebecee 1655,4,900000,800000,1
lhz_dun01,50,150,11,35 monster Kavach Icarus 1656,4,900000,800000,1
lhz_dun01,50,150,11,35 monster Laurell Weinder 1657,2,600000,300000,1
lhz_dun01,192,61,18,30 monster Egnigem Cenia 1652,1,900000,800000,1
lhz_dun01,192,61,18,30 monster Wickebine Tres 1653,1,900000,800000,1
lhz_dun01,192,61,18,30 monster Armeyer Dinze 1654,1,900000,800000,1
lhz_dun01,192,61,18,30 monster Errende Ebecee 1655,1,900000,800000,1
lhz_dun01,192,61,18,30 monster Kavach Icarus 1656,1,900000,800000,1
lhz_dun01,192,61,18,30 monster Laurell Weinder 1657,1,900000,800000,1
lhz_dun01,0,0,0,0 monster Gemini-S58 1681,1,7200000,5400000,0
//========================================================================================
// lhz_dun02 - Bio-life Labs 2F
//========================================================================================
lhz_dun02,0,0,0,0 monster Egnigem Cenia 1652,26,0,0,0
lhz_dun02,0,0,0,0 monster Wickebine Tres 1653,26,0,0,0
lhz_dun02,0,0,0,0 monster Armeyer Dinze 1654,26,0,0,0
lhz_dun02,0,0,0,0 monster Errende Ebecee 1655,26,0,0,0
lhz_dun02,0,0,0,0 monster Kavach Icarus 1656,26,0,0,0
lhz_dun02,0,0,0,0 monster Laurell Weinder 1657,26,0,0,0
lhz_dun02,150,150,56,54 monster Egnigem Cenia 1652,4,120000,60000,1
lhz_dun02,150,150,56,54 monster Wickebine Tres 1653,4,120000,60000,1
lhz_dun02,150,150,56,54 monster Armeyer Dinze 1654
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright 2019 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.netflix.spinnaker.orca.igor.model;
public interface RetryableStageDefinition {
int getConsecutiveErrors();
}
|
{
"pile_set_name": "Github"
}
|
# -*- coding: utf-8 -*-
from globaleaks.handlers.admin import l10n as admin_l10n
from globaleaks.tests import helpers
from twisted.internet.defer import inlineCallbacks
empty_texts = {}
custom_texts1 = {
'12345': '54321'
}
custom_texts2 = {
'12345': '54321'
}
class TestAdminL10NHandler(helpers.TestHandler):
_handler = admin_l10n.AdminL10NHandler
@inlineCallbacks
def test_get(self):
handler = self.request(role='admin')
response = yield handler.get(lang=u'en')
self.assertEqual(response, {})
@inlineCallbacks
def test_put(self):
check = yield admin_l10n.get(1, 'en')
self.assertEqual(empty_texts, check)
handler = self.request(custom_texts1, role='admin')
yield handler.put(lang=u'en')
check = yield admin_l10n.get(1, 'en')
self.assertEqual(custom_texts1, check)
handler = self.request(custom_texts1, role='admin')
yield handler.put(lang=u'en')
check = yield admin_l10n.get(1, 'en')
self.assertEqual(custom_texts2, check)
@inlineCallbacks
def test_delete(self):
yield self.test_put()
check = yield admin_l10n.get(1, 'en')
self.assertEqual(custom_texts1, check)
handler = self.request({}, role='admin')
handler.delete(lang=u'en')
check = yield admin_l10n.get(1, 'en')
self.assertEqual(empty_texts, check)
|
{
"pile_set_name": "Github"
}
|
+++
title = "Pangram checker"
description = ""
date = 2019-10-17T23:32:31Z
aliases = []
[extra]
id = 5383
[taxonomies]
categories = []
tags = []
+++
{{task}} [[Category:String manipulation]]
{{omit from|Lilypond}}
A pangram is a sentence that contains all the letters of the English alphabet at least once.
For example: ''The quick brown fox jumps over the lazy dog''.
;Task:
Write a function or method to check a sentence to see if it is a [[wp:Pangram|pangram]] (or not) and show its use.
## 360 Assembly
```360asm
* Pangram RC 11/08/2015
PANGRAM CSECT
USING PANGRAM,R12
LR R12,R15
BEGIN LA R9,SENTENCE
LA R6,4
LOOPI LA R10,ALPHABET loop on sentences
LA R7,26
LOOPJ LA R5,0 loop on letters
LR R11,R9
LA R8,60
LOOPK MVC BUFFER+1(1),0(R10) loop in sentence
CLC 0(1,R10),0(R11) if alphabet[j=sentence[i]
BNE NEXTK
LA R5,1 found
NEXTK LA R11,1(R11) next character
BCT R8,LOOPK
LTR R5,R5 if found
BNZ NEXTJ
MVI BUFFER,C'?' not found
B PRINT
NEXTJ LA R10,1(R10) next letter
BCT R7,LOOPJ
MVC BUFFER(2),=CL2'OK'
PRINT MVC BUFFER+3(60),0(R9)
XPRNT BUFFER,80
NEXTI LA R9,60(R9) next sentence
BCT R6,LOOPI
RETURN XR R15,R15
BR R14
ALPHABET DC CL26'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
SENTENCE DC CL60'THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.'
DC CL60'THE FIVE BOXING WIZARDS DUMP QUICKLY.'
DC CL60'HEAVY BOXES PERFORM WALTZES AND JIGS.'
DC CL60'PACK MY BOX WITH FIVE DOZEN LIQUOR JUGS.'
BUFFER DC CL80' '
YREGS
END PANGRAM
```
{{out}}
```txt
OK THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.
?J THE FIVE BOXING WIZARDS DUMP QUICKLY.
?C HEAVY BOXES PERFORM WALTZES AND JIGS.
OK PACK MY BOX WITH FIVE DOZEN LIQUOR JUGS.
```
## ACL2
```Lisp
(defun contains-each (needles haystack)
(if (endp needles)
t
(and (member (first needles) haystack)
(contains-each (rest needles) haystack))))
(defun pangramp (str)
(contains-each (coerce "abcdefghijklmnopqrstuvwxyz" 'list)
(coerce (string-downcase str) 'list)))
```
## ActionScript
{{works with|ActionScript|2.0}}
```ActionScript
function pangram(k:string):Boolean {
var lowerK:String = k.toLowerCase();
var has:Object = {}
for (var i:Number=0; i<=k.length-1; i++) {
has[lowerK.charAt(i)] = true;
}
var result:Boolean = true;
for (var ch:String='a'; ch <= 'z'; ch=String.fromCharCode(ch.charCodeAt(0)+1)) {
result = result && has[ch]
}
return result || false;
}
```
## Ada
### Using character sets
```Ada
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Strings.Maps; use Ada.Strings.Maps;
with Ada.Characters.Handling; use Ada.Characters.Handling;
procedure pangram is
function ispangram(txt: String) return Boolean is
(Is_Subset(To_Set(Span => ('a','z')), To_Set(To_Lower(txt))));
begin
put_line(Boolean'Image(ispangram("This is a test")));
put_line(Boolean'Image(ispangram("The quick brown fox jumps over the lazy dog")));
put_line(Boolean'Image(ispangram("NOPQRSTUVWXYZ abcdefghijklm")));
put_line(Boolean'Image(ispangram("abcdefghijklopqrstuvwxyz"))); --Missing m, n
end pangram;
```
### Using quantified expressions
```Ada
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Characters.Handling; use Ada.Characters.Handling;
procedure pangram is
function ispangram(txt : in String) return Boolean is
(for all Letter in Character range 'a'..'z' =>
(for some Char of txt => To_Lower(Char) = Letter));
begin
put_line(Boolean'Image(ispangram("This is a test")));
put_line(Boolean'Image(ispangram("The quick brown fox jumps over the lazy dog")));
put_line(Boolean'Image(ispangram("NOPQRSTUVWXYZ abcdefghijklm")));
put_line(Boolean'Image(ispangram("abcdefghijklopqrstuvwxyz"))); --Missing m, n
end pangram;
```
{{out}}
```txt
FALSE
TRUE
TRUE
FALSE
```
## ALGOL 68
{{works with|ALGOL 68|Standard - no extensions to language used}}
{{works with|ALGOL 68G|Any - tested with release [http://sourceforge.net/projects/algol68/files/algol68g/algol68g-1.18.0/algol68g-1.18.0-9h.tiny.el5.centos.fc11.i386.rpm/download 1.18.0-9h.tiny]}}
{{works with|ELLA ALGOL 68|Any (with appropriate job cards)}}
```algol68
# init pangram: #
INT la = ABS "a", lz = ABS "z";
INT ua = ABS "A", uz = ABS "Z";
IF lz-la+1 > bits width THEN
put(stand error, "Exception: insufficient bits in word for task");
stop
FI;
PROC is a pangram = (STRING test)BOOL: (
BITS a2z := BIN(ABS(2r1 SHL (lz-la))-1); # assume: ASCII & Binary #
FOR i TO UPB test WHILE
INT c = ABS test[i];
IF la <= c AND c <= lz THEN
a2z := a2z AND NOT(2r1 SHL (c-la))
ELIF ua <= c AND c <= uz THEN
a2z := a2z AND NOT(2r1 SHL (c-ua))
FI;
# WHILE # a2z /= 2r0 DO
SKIP
OD;
a2z = 2r0
);
main:(
[]STRING test list = (
"Big fjiords vex quick waltz nymph",
"The quick brown fox jumps over a lazy dog",
"A quick brown fox jumps over a lazy dog"
);
FOR key TO UPB test list DO
STRING test = test list[key];
IF is a pangram(test) THEN
print(("""",test,""" is a pangram!", new line))
FI
OD
)
```
|
{
"pile_set_name": "Github"
}
|
<!--index.wxml-->
<view class="index">
<view class="index-profile">
<open-data type="userAvatarUrl" class="index-profile__img"></open-data>
</view>
<view class="index-title">
{{ title }}
</view>
<view class="index-books">
<view class="index-books__showLayer">
<view class="index-books__item" wx:for="{{ bookList }}" wx:key="{{ index }}">
<view class="index-books__title">书目:</view>
<view class="index-books__controls--show" wx:if="{{ !item.isEditing }}">{{ item.bookName }}
</view>
<view class="index-books__controls--edit-area" wx:else>
<input
type="text"
value="{{ item.bookName }}"
confirm-type="完成"
data-book-id="{{ item.id }}"
bindinput="bindEditBookNameInput"
/>
</view>
<button
class="index-books__controls--edit-btn btn"
type="primary"
data-book-id="{{ item.id }}"
data-index="{{index}}"
bindtap="{{ item.isEditing ? 'updateBook' : 'editBookButtonClicked' }}"
>
{{ item.isEditing ? '保存' : '编辑' }}
</button>
<button
class="index-books__controls--delete btn"
type="warn"
data-book-id="{{ item.id }}"
bindtap="deleteBook"
>
删除
</button>
</view>
</view>
<view class="index-books__input">
<input
type="text"
placeholder="我的床头书"
value="{{ createBookValue }}"
confirm-type="完成"
bindinput="bindCreateBookNameInput"
/>
</view>
<view class="index-books__controls">
<button
class="index-books__controls--create"
bindtap="createBook"
type="primary"
>
添加
</button>
</view>
</view>
</view>
|
{
"pile_set_name": "Github"
}
|
[
{
"EventCode": "0xE8",
"Counter": "0,1,2,3",
"UMask": "0x1",
"EventName": "BPU_CLEARS.EARLY",
"SampleAfterValue": "2000000",
"BriefDescription": "Early Branch Prediciton Unit clears"
},
{
"EventCode": "0xE8",
"Counter": "0,1,2,3",
"UMask": "0x2",
"EventName": "BPU_CLEARS.LATE",
"SampleAfterValue": "2000000",
"BriefDescription": "Late Branch Prediction Unit clears"
},
{
"EventCode": "0xE5",
"Counter": "0,1,2,3",
"UMask": "0x1",
"EventName": "BPU_MISSED_CALL_RET",
"SampleAfterValue": "2000000",
"BriefDescription": "Branch prediction unit missed call or return"
},
{
"EventCode": "0xD5",
"Counter": "0,1,2,3",
"UMask": "0x1",
"EventName": "ES_REG_RENAMES",
"SampleAfterValue": "2000000",
"BriefDescription": "ES segment renames"
},
{
"EventCode": "0x6C",
"Counter": "0,1,2,3",
"UMask": "0x1",
"EventName": "IO_TRANSACTIONS",
"SampleAfterValue": "2000000",
"BriefDescription": "I/O transactions"
},
{
"EventCode": "0x80",
"Counter": "0,1,2,3",
"UMask": "0x4",
"EventName": "L1I.CYCLES_STALLED",
"SampleAfterValue": "2000000",
"BriefDescription": "L1I instruction fetch stall cycles"
},
{
"EventCode": "0x80",
"Counter": "0,1,2,3",
"UMask": "0x1",
"EventName": "L1I.HITS",
"SampleAfterValue": "2000000",
"BriefDescription": "L1I instruction fetch hits"
},
{
"EventCode": "0x80",
"Counter": "0,1,2,3",
"UMask": "0x2",
"EventName": "L1I.MISSES",
"SampleAfterValue": "2000000",
"BriefDescription": "L1I instruction fetch misses"
},
{
"EventCode": "0x80",
"Counter": "0,1,2,3",
"UMask": "0x3",
"EventName": "L1I.READS",
"SampleAfterValue": "2000000",
"BriefDescription": "L1I Instruction fetches"
},
{
"EventCode": "0x82",
"Counter": "0,1,2,3",
"UMask": "0x1",
"EventName": "LARGE_ITLB.HIT",
"SampleAfterValue": "200000",
"BriefDescription": "Large ITLB hit"
},
{
"EventCode": "0x13",
"Counter": "0,1,2,3",
"UMask": "0x7",
"EventName": "LOAD_DISPATCH.ANY",
"SampleAfterValue": "2000000",
"BriefDescription": "All loads dispatched"
},
{
"EventCode": "0x13",
"Counter": "0,1,2,3",
"UMask": "0x4",
"EventName": "LOAD_DISPATCH.MOB",
"SampleAfterValue": "2000000",
"BriefDescription": "Loads dispatched from the MOB"
},
{
"EventCode": "0x13",
"Counter": "0,1,2,3",
"UMask": "0x1",
"EventName": "LOAD_DISPATCH.RS",
"SampleAfterValue": "2000000",
"BriefDescription": "Loads dispatched that bypass the MOB"
},
{
"EventCode": "0x13",
"Counter": "0,1,2,3",
"UMask": "0x2",
"EventName": "LOAD_DISPATCH.RS_DELAYED",
"SampleAfterValue": "2000000",
"BriefDescription": "Loads dispatched from stage 305"
},
{
"EventCode": "0x7",
"Counter": "0,1,2,3",
"UMask": "0x1",
"EventName": "PARTIAL_ADDRESS_ALIAS",
"SampleAfterValue": "200000",
"BriefDescription": "False dependencies due to partial address aliasing"
},
{
"EventCode": "0xD2",
"Counter": "0,1,2,3",
"UMask": "0xf",
"EventName": "RAT_STALLS.ANY",
"SampleAfterValue": "2000000",
"BriefDescription": "All RAT stall cycles"
},
{
"EventCode": "0xD2",
"Counter": "0,1,2,3",
"UMask": "0x1",
"EventName": "RAT_STALLS.FLAGS",
"SampleAfterValue": "2000000",
"BriefDescription": "Flag stall cycles"
},
{
"EventCode": "0xD2",
"Counter": "0,1,2,3",
"UMask": "0x2",
"EventName": "RAT_STALLS.REGISTERS",
"SampleAfterValue": "2000000",
"BriefDescription": "Partial register stall cycles"
},
{
"EventCode": "0xD2",
"Counter": "0,1,2,3",
"UMask": "0x4",
"EventName": "RAT_STALLS.ROB_READ_PORT",
"SampleAfterValue": "2000000",
"BriefDescription": "ROB read port stalls cycles"
},
{
"EventCode": "0xD2",
"Counter": "0,1,2,3",
"UMask": "0x8",
"EventName": "RAT_STALLS.SCOREBOARD",
"SampleAfterValue": "2000000",
"BriefDescription": "Scoreboard stall cycles"
},
{
"EventCode": "0x4",
"Counter": "0,1,2,3",
"UMask": "0x7",
"EventName": "SB_DRAIN.ANY",
"SampleAfterValue": "200000",
"BriefDescription": "All Store buffer stall cycles"
},
{
"EventCode": "0xD4",
"Counter": "0,1,2,3",
"UMask": "0x1",
"EventName": "SEG_RENAME_STALLS",
"SampleAfterValue": "2000000",
"BriefDescription": "Segment rename stall cycles"
},
{
"EventCode": "0xB8",
"Counter": "0,1,2,3",
"UMask": "0x1",
"EventName": "SNOOP_RESPONSE.HIT",
"SampleAfterValue": "100000",
"BriefDescription": "Thread responded HIT to snoop"
},
{
"EventCode": "0xB8",
"Counter": "0,1,2,3",
"UMask": "0x2",
"EventName": "SNOOP_RESPONSE.HITE",
"SampleAfterValue": "100000",
"BriefDescription": "Thread responded HITE to snoop"
},
{
"EventCode": "0xB8",
"Counter": "0,1,2,3",
|
{
"pile_set_name": "Github"
}
|
###
### DO NOT MODIFY THIS FILE. THIS FILE HAS BEEN AUTOGENERATED
###
FROM openjdk:15-ea-10-jdk-buster
# It's DynamoDB, in Docker!
#
# Check for details on how to run DynamoDB locally.:
#
# http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html
#
# This Dockerfile essentially replicates those instructions.
# Create our main application folder.
RUN mkdir -p opt/dynamodb
WORKDIR /opt/dynamodb
# Download and unpack dynamodb.
RUN wget http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.tar.gz -q -O - | tar -xz || curl -L http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.tar.gz | tar xz
# The entrypoint is the dynamodb jar.
ENTRYPOINT ["java", "-Xmx1G", "-jar", "DynamoDBLocal.jar"]
# Default port for "DynamoDB Local" is 8000.
EXPOSE 8000
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2009 - DIGITEO - Vincent COUVERT
*
* Copyright (C) 2012 - 2016 - Scilab Enterprises
*
* This file is hereby licensed under the terms of the GNU GPL v2.0,
* pursuant to article 5.3.4 of the CeCILL v.2.1.
* This file was originally licensed under the terms of the CeCILL v2.1,
* and continues to be available under such terms.
* For more information, see the COPYING file which you should have received
* along with this program.
*
-->
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="m2sci_besselj">
<refnamediv>
<refname>besselj (Matlab function)</refname>
<refpurpose>Bessel functions of the first kind </refpurpose>
</refnamediv>
<refsection>
<title>Matlab/Scilab equivalent</title>
<informaltable border="1" width="100%">
<tr>
<td align="center">
<emphasis role="bold">Matlab</emphasis>
</td>
<td align="center">
<emphasis role="bold">Scilab</emphasis>
</td>
</tr>
<tr>
<td>
<programlisting role="example"><![CDATA[
besselj
]]></programlisting>
</td>
<td>
<programlisting role="example"><![CDATA[
besselj
]]></programlisting>
</td>
</tr>
</informaltable>
</refsection>
<refsection>
<title>Particular cases</title>
<para>
Scilab <emphasis role="bold">besselj</emphasis> function can work with only one output argument, but the Matlab function can work with two outputs arguments.
</para>
</refsection>
<refsection>
<title>Examples</title>
<informaltable border="1" width="100%">
<tr>
<td align="center">
<emphasis role="bold">Matlab</emphasis>
</td>
<td align="center">
<emphasis role="bold">Scilab</emphasis>
</td>
</tr>
<tr>
<td>
<programlisting role="example"><![CDATA[
y = besselj(alpha,x)
y = besselj(alpha,x,1)
[y,ierr] = besselj(alpha,...)
]]></programlisting>
</td>
<td>
<programlisting role="example"><![CDATA[
y = besselj(alpha,x)
y = besselj(alpha,x,ice),ice = 1 or ice = 2
]]></programlisting>
</td>
</tr>
</informaltable>
</refsection>
</refentry>
|
{
"pile_set_name": "Github"
}
|
#%RAML 0.8
title: test API
traits:
- tr:
body:
application/json:
schemas:
- MyType: |
{
"$schema": "http://json-schema.org/draft-04/",
"type": "object",
"properties": {
"arrayProp": {
"items": {
"type": "object", "properties": {
"prop1": { "type": "number" },
"prop2": { "type": "boolean" }
},
"additionalProperties": false
}
}
}
}
/res1:
post:
body:
application/json:
schema: MyType
example: |
{
"arrayProp": [
{
"prop1": 13,
"prop2" : true
}, {
"prop1": 13,
"prop2": false
}
]
}
/res2:
post:
body:
application/json:
schema: MyType
example: |
{
"arrayProp": [
{
"prop1": 13
"prop2": false
} , {
"prop1": 13,
"prop2": false
}
]
}
|
{
"pile_set_name": "Github"
}
|
/*
* CRIS helper routines
*
* Copyright (c) 2007 AXIS Communications
* Written by Edgar E. Iglesias
*
* This library 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 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "cpu.h"
#include "dyngen-exec.h"
#include "mmu.h"
#include "helper.h"
#include "host-utils.h"
//#define CRIS_OP_HELPER_DEBUG
#ifdef CRIS_OP_HELPER_DEBUG
#define D(x) x
#define D_LOG(...) qemu_log(__VA__ARGS__)
#else
#define D(x)
#define D_LOG(...) do { } while (0)
#endif
#if !defined(CONFIG_USER_ONLY)
#include "softmmu_exec.h"
#define MMUSUFFIX _mmu
#define SHIFT 0
#include "softmmu_template.h"
#define SHIFT 1
#include "softmmu_template.h"
#define SHIFT 2
#include "softmmu_template.h"
#define SHIFT 3
#include "softmmu_template.h"
/* Try to fill the TLB and return an exception if error. If retaddr is
NULL, it means that the function was called in C code (i.e. not
from generated code or from helper.c) */
/* XXX: fix it to restore all registers */
void tlb_fill(CPUState *env1, target_ulong addr, int is_write, int mmu_idx,
void *retaddr)
{
TranslationBlock *tb;
CPUState *saved_env;
unsigned long pc;
int ret;
saved_env = env;
env = env1;
D_LOG("%s pc=%x tpc=%x ra=%x\n", __func__,
env->pc, env->debug1, retaddr);
ret = cpu_cris_handle_mmu_fault(env, addr, is_write, mmu_idx);
if (unlikely(ret)) {
if (retaddr) {
/* now we have a real cpu fault */
pc = (unsigned long)retaddr;
tb = tb_find_pc(pc);
if (tb) {
/* the PC is inside the translated code. It means that we have
a virtual CPU fault */
cpu_restore_state(tb, env, pc);
/* Evaluate flags after retranslation. */
helper_top_evaluate_flags();
}
}
cpu_loop_exit(env);
}
env = saved_env;
}
#endif
void helper_raise_exception(uint32_t index)
{
env->exception_index = index;
cpu_loop_exit(env);
}
void helper_tlb_flush_pid(uint32_t pid)
{
#if !defined(CONFIG_USER_ONLY)
pid &= 0xff;
if (pid != (env->pregs[PR_PID] & 0xff))
cris_mmu_flush_pid(env, env->pregs[PR_PID]);
#endif
}
void helper_spc_write(uint32_t new_spc)
{
#if !defined(CONFIG_USER_ONLY)
tlb_flush_page(env, env->pregs[PR_SPC]);
tlb_flush_page(env, new_spc);
#endif
}
void helper_dump(uint32_t a0, uint32_t a1, uint32_t a2)
{
qemu_log("%s: a0=%x a1=%x\n", __func__, a0, a1);
}
/* Used by the tlb decoder. */
#define EXTRACT_FIELD(src, start, end) \
(((src) >> start) & ((1 << (end - start + 1)) - 1))
void helper_movl_sreg_reg (uint32_t sreg, uint32_t reg)
{
uint32_t srs;
srs = env->pregs[PR_SRS];
srs &= 3;
env->sregs[srs][sreg] = env->regs[reg];
#if !defined(CONFIG_USER_ONLY)
if (srs == 1 || srs == 2) {
if (sreg == 6) {
/* Writes to tlb-hi write to mm_cause as a side
effect. */
env->sregs[SFR_RW_MM_TLB_HI] = env->regs[reg];
env->sregs[SFR_R_MM_CAUSE] = env->regs[reg];
}
else if (sreg == 5) {
uint32_t set;
uint32_t idx;
uint32_t lo, hi;
uint32_t vaddr;
int tlb_v;
idx = set = env->sregs[SFR_RW_MM_TLB_SEL];
set >>= 4;
set &= 3;
idx &= 15;
/* We've just made a write to tlb_lo. */
lo = env->sregs[SFR_RW_MM_TLB_LO];
/* Writes are done via r_mm_cause. */
hi = env->sregs[SFR_R_MM_CAUSE];
vaddr = EXTRACT_FIELD(env->tlbsets[srs-1][set][idx].hi,
13, 31);
vaddr <<= TARGET_PAGE_BITS;
tlb_v = EXTRACT_FIELD(env->tlbsets[srs-1][set][idx].lo,
3, 3);
env->tlbsets[srs - 1][set][idx].lo = lo;
env->tlbsets[srs - 1][set][idx].hi = hi;
D_LOG("tlb flush vaddr=%x v=%d pc=%x\n",
vaddr, tlb_v, env->pc);
if (tlb_v) {
tlb_flush_page(env, vaddr);
}
}
}
#endif
}
void helper_movl_reg_sreg (uint32_t reg, uint32_t sreg)
{
uint32_t srs;
env->pregs[PR_SRS] &= 3;
srs = env->pregs[PR_SRS];
#if !defined(CONFIG_USER_ONLY)
if (srs == 1 || srs == 2)
{
uint32_t set;
uint32_t idx;
uint32_t lo, hi;
idx = set = env->sregs[SFR_RW_MM_TLB_SEL];
set >>= 4;
set &= 3;
idx &= 15;
/* Update the mirror regs. */
hi = env->tlbsets[srs - 1][set][idx].hi;
lo = env->tlbsets[srs - 1][set][idx].lo;
env->sregs[SFR_RW_MM_TLB_HI] = hi;
env->sregs[SFR_RW_MM_TLB_LO] = lo;
}
#endif
env->regs[reg] = env->sregs[srs][sreg];
}
static void cris_ccs_rshift(CPUState *env)
{
uint32_t ccs;
/* Apply the ccs shift. */
ccs = env->pregs[PR_CCS];
ccs = (ccs & 0xc0000000) | ((ccs & 0x0fffffff) >> 10);
if (ccs & U_FLAG)
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="com.jeecms.cms.entity.assist">
<class name="CmsGuestbookExt" table="jc_guestbook_ext">
<meta attribute="sync-DAO">false</meta>
<cache usage="read-write"/>
<id name="id" type="java.lang.Integer" column="guestbook_id">
<generator class="foreign"><param name="property">guestbook</param></generator>
</id>
<property name="title" column="title" type="string" not-null="false" length="255"/>
<property name="content" column="content" type="string" not-null="false"/>
<property name="reply" column="reply" type="string" not-null="false"/>
<property name="email" column="email" type="string" not-null="false" length="100"/>
<property name="phone" column="phone" type="string" not-null="false" length="100"/>
<property name="qq" column="qq" type="string" not-null="false" length="50"/>
<one-to-one name="guestbook" class="CmsGuestbook" constrained="true"/>
</class>
</hibernate-mapping>
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import six
from bson import ObjectId
from easydict import EasyDict as edict
from tornado.concurrent import return_future
from motorengine import ASCENDING
from motorengine.query_builder.transform import update
class BaseAggregation(object):
def __init__(self, field, alias):
self._field = field
self.alias = alias
@property
def field(self):
return self._field
class PipelineOperation(object):
def __init__(self, aggregation):
self.aggregation = aggregation
def to_query(self):
return {}
class GroupBy(PipelineOperation):
def __init__(self, aggregation, first_group_by, *groups):
super(GroupBy, self).__init__(aggregation)
self.first_group_by = first_group_by
self.groups = groups
def to_query(self):
group_obj = {'$group': {'_id': {}}}
for group in self.groups:
if isinstance(group, BaseAggregation):
group_obj['$group'].update(group.to_query(self.aggregation))
continue
if isinstance(group, six.string_types):
field_name = group
else:
field_name = self.aggregation.get_field(group).db_field
if self.first_group_by:
group_obj['$group']['_id'][field_name] = "$%s" % field_name
else:
group_obj['$group']['_id'][field_name] = "$_id.%s" % field_name
return group_obj
class Match(PipelineOperation):
def __init__(self, aggregation, **filters):
super(Match, self).__init__(aggregation)
self.filters = filters
def to_query(self):
from motorengine import Q
match_obj = {'$match': {}}
query = self.aggregation.queryset.get_query_from_filters(Q(**self.filters))
update(match_obj['$match'], query)
return match_obj
class Unwind(PipelineOperation):
def __init__(self, aggregation, field):
super(Unwind, self).__init__(aggregation)
self.field = self.aggregation.get_field(field)
def to_query(self):
return {'$unwind': '$%s' % self.field.db_field}
class OrderBy(PipelineOperation):
def __init__(self, aggregation, field, direction):
super(OrderBy, self).__init__(aggregation)
self.field = self.aggregation.get_field(field)
self.direction = direction
def to_query(self):
return {'$sort': {self.field.db_field: self.direction}}
class Aggregation(object):
def __init__(self, queryset):
self.first_group_by = True
self.queryset = queryset
self.pipeline = []
self.ids = []
self.raw_query = None
def get_field_name(self, field):
if isinstance(field, six.string_types):
return field
return field.db_field
def get_field(self, field):
return field
def raw(self, steps):
self.raw_query = steps
return self
def group_by(self, *args):
self.pipeline.append(GroupBy(self, self.first_group_by, *args))
self.first_group_by = False
return self
def match(self, **kw):
self.pipeline.append(Match(self, **kw))
return self
def unwind(self, field):
self.pipeline.append(Unwind(self, field))
return self
def order_by(self, field, direction=ASCENDING):
self.pipeline.append(OrderBy(self, field, direction))
return self
def fill_ids(self, item):
if not '_id' in item:
return
if isinstance(item['_id'], (dict,)):
for id_name, id_value in list(item['_id'].items()):
item[id_name] = id_value
def get_instance(self, item):
return self.queryset.__klass__.from_son(item)
def handle_aggregation(self, callback):
def handle(*arguments, **kw):
if arguments[1]:
raise RuntimeError('Aggregation failed due to: %s' % str(arguments[1]))
results = []
for item in arguments[0]:
self.fill_ids(item)
results.append(edict(item))
callback(results)
return handle
@return_future
def fetch(self, callback=None, alias=None):
coll = self.queryset.coll(alias)
coll.aggregate(self.to_query()).to_list(None, callback=self.handle_aggregation(callback))
@classmethod
def avg(cls, field, alias=None):
from motorengine.aggregation.avg import AverageAggregation
return AverageAggregation(field, alias)
@classmethod
def sum(cls, field, alias=None):
from motorengine.aggregation.sum import SumAggregation
return SumAggregation(field, alias)
def to_query(self):
if self.raw_query is not None:
return self.raw_query
query = []
for pipeline_step in self.pipeline:
query_steps = pipeline_step.to_query()
if isinstance(query_steps, (tuple, set, list)):
for step in query_steps:
query.append(step)
else:
query.append(query_steps)
return query
|
{
"pile_set_name": "Github"
}
|
<div class="subblock">
<h3><%= t('.owner_tools') %></h3>
<div>
<%= link_to t('.force_update'), act_content_path(action_name: 'manual_refresh'), method: :put, class: "btn info" %>
<%= link_to t('.purge_children'), act_content_path(action_name: 'delete_children'), method: :put, class: "btn info" %>
</div>
</div>
|
{
"pile_set_name": "Github"
}
|
package org.intellij.markdown.parser.sequentialparsers.impl
import org.intellij.markdown.MarkdownElementTypes
import org.intellij.markdown.MarkdownTokenTypes
import org.intellij.markdown.parser.sequentialparsers.LocalParsingResult
import org.intellij.markdown.parser.sequentialparsers.RangesListBuilder
import org.intellij.markdown.parser.sequentialparsers.SequentialParser
import org.intellij.markdown.parser.sequentialparsers.TokensCache
class ReferenceLinkParser : SequentialParser {
override fun parse(tokens: TokensCache, rangesToGlue: List<IntRange>): SequentialParser.ParsingResult {
var result = SequentialParser.ParsingResultBuilder()
val delegateIndices = RangesListBuilder()
var iterator: TokensCache.Iterator = tokens.RangesListIterator(rangesToGlue)
while (iterator.type != null) {
if (iterator.type == MarkdownTokenTypes.LBRACKET) {
val referenceLink = parseReferenceLink(iterator)
if (referenceLink != null) {
iterator = referenceLink.iteratorPosition.advance()
result = result.withOtherParsingResult(referenceLink)
continue
}
}
delegateIndices.put(iterator.index)
iterator = iterator.advance()
}
return result.withFurtherProcessing(delegateIndices.get())
}
companion object {
fun parseReferenceLink(iterator: TokensCache.Iterator): LocalParsingResult? {
return parseFullReferenceLink(iterator) ?: parseShortReferenceLink(iterator)
}
private fun parseFullReferenceLink(iterator: TokensCache.Iterator): LocalParsingResult? {
val startIndex = iterator.index
val linkText = LinkParserUtil.parseLinkText(iterator)
?: return null
var it = linkText.iteratorPosition.advance()
if (it.type == MarkdownTokenTypes.EOL) {
it = it.advance()
}
val linkLabel = LinkParserUtil.parseLinkLabel(it)
?: return null
it = linkLabel.iteratorPosition
return LocalParsingResult(it,
linkText.parsedNodes
+ linkLabel.parsedNodes
+ SequentialParser.Node(startIndex..it.index + 1, MarkdownElementTypes.FULL_REFERENCE_LINK),
linkText.rangesToProcessFurther + linkLabel.rangesToProcessFurther)
}
private fun parseShortReferenceLink(iterator: TokensCache.Iterator): LocalParsingResult? {
val startIndex = iterator.index
val linkLabel = LinkParserUtil.parseLinkLabel(iterator)
?: return null
var it = linkLabel.iteratorPosition
val shortcutLinkEnd = it
it = it.advance()
if (it.type == MarkdownTokenTypes.EOL) {
it = it.advance()
}
if (it.type == MarkdownTokenTypes.LBRACKET && it.rawLookup(1) == MarkdownTokenTypes.RBRACKET) {
it = it.advance()
} else {
it = shortcutLinkEnd
}
return LocalParsingResult(it,
linkLabel.parsedNodes
+ SequentialParser.Node(startIndex..it.index + 1, MarkdownElementTypes.SHORT_REFERENCE_LINK),
linkLabel.rangesToProcessFurther)
}
}
}
|
{
"pile_set_name": "Github"
}
|
var mkdirp = require('../');
var path = require('path');
var fs = require('fs');
var test = require('tap').test;
test('root', function (t) {
// '/' on unix, 'c:/' on windows.
var file = path.resolve('/');
mkdirp(file, 0755, function (err) {
if (err) throw err
fs.stat(file, function (er, stat) {
if (er) throw er
t.ok(stat.isDirectory(), 'target is a directory');
t.end();
})
});
});
|
{
"pile_set_name": "Github"
}
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M20,6h-8l-2,-2L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,8c0,-1.1 -0.9,-2 -2,-2zM17.94,17L15,15.28 12.06,17l0.78,-3.33 -2.59,-2.24 3.41,-0.29L15,8l1.34,3.14 3.41,0.29 -2.59,2.24 0.78,3.33z"/>
</vector>
|
{
"pile_set_name": "Github"
}
|
<#--
/**
* Copyright 2000-present Liferay, 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.
*/
-->
<#assign aui = PortletJspTagLibs["/META-INF/liferay-aui.tld"] />
<#assign liferay_portlet = PortletJspTagLibs["/META-INF/liferay-portlet-ext.tld"] />
<#assign liferay_security = PortletJspTagLibs["/META-INF/liferay-security.tld"] />
<#assign liferay_theme = PortletJspTagLibs["/META-INF/liferay-theme.tld"] />
<#assign liferay_ui = PortletJspTagLibs["/META-INF/liferay-ui.tld"] />
<#assign liferay_util = PortletJspTagLibs["/META-INF/liferay-util.tld"] />
<#assign portlet = PortletJspTagLibs["/META-INF/liferay-portlet.tld"] />
<@liferay_theme["defineObjects"] />
<@portlet["defineObjects"] />
|
{
"pile_set_name": "Github"
}
|
#ifndef PARDENSEMATRIX_H
#define PARDENSEMATRIX_H
#include "MatrixDef.h"
#include "DenseMatrix.h"
#include "DenseVector.h"
#include "MPI_Wrappers.h"
#include "ATC_Error.h"
using ATC::ATC_Error;
#include <algorithm>
#include <sstream>
namespace ATC_matrix {
/**
* @class ParDenseMatrix
* @brief Parallelized version of DenseMatrix class.
*/
template <typename T>
class ParDenseMatrix : public DenseMatrix<T> {
public:
MPI_Comm _comm;
ParDenseMatrix(MPI_Comm comm, INDEX rows=0, INDEX cols=0, bool z=1)
: DenseMatrix<T>(rows, cols, z), _comm(comm) {}
ParDenseMatrix(MPI_Comm comm, const DenseMatrix<T>& c)
: DenseMatrix<T>(c), _comm(comm) {}
ParDenseMatrix(MPI_Comm comm, const SparseMatrix<T>& c)
: DenseMatrix<T>(c), _comm(comm) {}
ParDenseMatrix(MPI_Comm comm, const Matrix<T>& c)
: DenseMatrix<T>(c), _comm(comm) {}
//////////////////////////////////////////////////////////////////////////////
//* performs a matrix-vector multiply
void ParMultMv(const Vector<T> &v,
DenseVector<T> &c, const bool At, T a, T b)
{
// We can't generically support parallel multiplication because the data
// types must be specified when using MPI
MultMv(*this, v, c, At, a, b);
}
};
template<>
class ParDenseMatrix<double> : public DenseMatrix<double> {
public:
MPI_Comm _comm;
ParDenseMatrix(MPI_Comm comm, INDEX rows=0, INDEX cols=0, bool z=1)
: DenseMatrix<double>(rows, cols, z), _comm(comm) {}
ParDenseMatrix(MPI_Comm comm, const DenseMatrix<double>& c)
: DenseMatrix<double>(c), _comm(comm) {}
ParDenseMatrix(MPI_Comm comm, const SparseMatrix<double>& c)
: DenseMatrix<double>(c), _comm(comm) {}
ParDenseMatrix(MPI_Comm comm, const Matrix<double>& c)
: DenseMatrix<double>(c), _comm(comm) {}
void ParMultMv(const Vector<double> &v, DenseVector<double> &c,
const bool At, double a, double b) const
{
// We don't support parallel vec-Mat multiplication yet
if (At) {
MultMv(*this, v, c, At, a, b);
return;
}
const INDEX nRows = this->nRows();
const INDEX nCols = this->nCols();
if (c.size() != nRows) {
c.resize(nRows); // set size of C
c.zero(); // do not add result to C
} else c *= b;
// Determine how many rows will be handled on each processor
int nProcs = MPI_Wrappers::size(_comm);
int myRank = MPI_Wrappers::rank(_comm);
int *majorCounts = new int[nProcs];
int *offsets = new int[nProcs];
#ifdef COL_STORAGE // Column-major storage
int nMajor = nCols;
int nMinor = nRows;
int ParDenseMatrix::*majorField = &ParDenseMatrix::_nCols;
int ParDenseMatrix::*minorField = &ParDenseMatrix::_nRows;
#else // Row-major storage
int nMajor = nRows;
int nMinor = nCols;
int ParDenseMatrix::*majorField = &ParDenseMatrix::_nRows;
int ParDenseMatrix::*minorField = &ParDenseMatrix::_nCols;
#endif
for (int i = 0; i < nProcs; i++) {
// If we have an uneven row-or-col/processors number, or too few rows
// or cols, some processors will need to receive fewer rows/cols.
offsets[i] = (i * nMajor) / nProcs;
majorCounts[i] = (((i + 1) * nMajor) / nProcs) - offsets[i];
}
int myNMajor = majorCounts[myRank];
int myMajorOffset = offsets[myRank];
// Take data from an offset version of A
ParDenseMatrix<double> A_local(_comm);
A_local._data = this->_data + myMajorOffset * nMinor;
A_local.*majorField = myNMajor;
A_local.*minorField = nMinor;
#ifdef COL_STORAGE // Column-major storage
// When splitting by columns, we split the vector as well, and sum the
// results.
DenseVector<double> v_local(myNMajor);
for (int i = 0; i < myNMajor; i++)
v_local(i) = v(myMajorOffset + i);
// Store results in a local vector
DenseVector<double> c_local = A_local * v_local;
// Sum all vectors onto each processor
MPI_Wrappers::allsum(_comm, c_local.ptr(), c.ptr(), c_local.size());
#else // Row-major storage
// When splitting by rows, we use the whole vector and concatenate the
// results.
// Store results in a small local vector
DenseVector<double> c_local(myNMajor);
for (int i = 0; i < myNMajor; i++)
c_local(i) = c(myMajorOffset + i);
MultMv(A_local, v, c_local, At, a, b);
// Gather the results onto each processor
allgatherv(_comm, c_local.ptr(), c_local.size(), c.ptr(),
majorCounts, offsets);
#endif
// Clear out the local matrix's pointer so we don't double-free
A_local._data = nullptr;
delete [] majorCounts;
delete [] offsets;
}
};
// Operator for dense Matrix - dense vector product
template<typename T>
DenseVector<T> operator*(const ParDenseMatrix<T> &A, const Vector<T> &b)
{
DenseVector<T> c;
A.ParMultMv(b, c, 0, 1.0, 0.0);
return c;
}
} // end namespace
#endif
|
{
"pile_set_name": "Github"
}
|
# Application to the Class of 2020🎓
This pull request template helps you complete an application to the **Class of 2020**. Use the checklist below to verify you have followed the instructions correctly.
## Checklist ✅
- [ ] I have read the instructions on the README file before submitting my application.
- [ ] I made my submission by creating a folder on the `_data` folder and followed the naming convention mentioned in the instructions (`<username>`), added my profile picture and markdown file.
- [ ] I have used the Markdown file template to add my information to the Year Book.
- [ ] I understand that a reviewer will merge my pull request after examining it or ask for changes in case needed.
- [ ] I understand I should not tag or add a reviewer to this Pull Request.
- [ ] I understand the photo added to the template will be used in the ceremony "Graduate Walk".
- [ ] I have [added the event](http://www.google.com/calendar/event?action=TEMPLATE&dates=20200615T160000Z%2F20200615T183000Z&text=%24%20git%20remote%20%3Cgraduation%3E%20%F0%9F%8E%93&location=https%3A%2F%2Fwww.twitch.tv%2Fgithubeducation&details=) to my Calendar.
|
{
"pile_set_name": "Github"
}
|
// Copyright (C) 2014 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
// +build sqlite_secure_delete_fast
package sqlite3
/*
#cgo CFLAGS: -DSQLITE_SECURE_DELETE=FAST
#cgo LDFLAGS: -lm
*/
import "C"
|
{
"pile_set_name": "Github"
}
|
// +build acceptance
package k8s
import (
"fmt"
"testing"
"github.com/kyma-project/kyma/tests/console-backend-service/internal/domain/shared/auth"
"github.com/kyma-project/kyma/tests/console-backend-service/internal/graphql"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
type selfSubjectRulesQueryResponse struct {
SelfSubjectRules []*selfSubjectRule `json:"selfSubjectRules"`
}
type selfSubjectRule struct {
Verbs []string `json:"verbs"`
APIGroups []string `json:"apiGroups"`
Resources []string `json:"resources"`
}
func TestSelfSubjectRules(t *testing.T) {
c, err := graphql.New()
require.NoError(t, err)
t.Log("Querying for SelfSubjectRules...")
var selfSubjectRulesRes selfSubjectRulesQueryResponse
err = c.Do(fixSelfSubjectRulesQuery(), &selfSubjectRulesRes)
require.NoError(t, err)
assert.True(t, len(selfSubjectRulesRes.SelfSubjectRules) > 0)
err = c.Do(fixNamespacedSelfSubjectRulesQuery("foo"), &selfSubjectRulesRes)
require.NoError(t, err)
assert.True(t, len(selfSubjectRulesRes.SelfSubjectRules) > 0)
t.Log("Checking authorization directives...")
ops := &auth.OperationsInput{
auth.CreateSelfSubjectRulesReview: {fixSelfSubjectRulesQuery(), fixNamespacedSelfSubjectRulesQuery("foo")},
}
AuthSuite.Run(t, ops)
}
func fixSelfSubjectRulesQuery() *graphql.Request {
query := fmt.Sprintf(
`query {
selfSubjectRules {
verbs
resources
apiGroups
}
}`)
return graphql.NewRequest(query)
}
func fixNamespacedSelfSubjectRulesQuery(namespace string) *graphql.Request {
query := fmt.Sprintf(
`query ($namespace: String){
selfSubjectRules (namespace: $namespace){
verbs
resources
apiGroups
}
}`)
req := graphql.NewRequest(query)
req.SetVar("namespace", namespace)
return req
}
|
{
"pile_set_name": "Github"
}
|
# -*- coding: utf-8 -*-
from .common import *
|
{
"pile_set_name": "Github"
}
|
sizeof_1_ = 8;
aggr _1_
{
'U' 0 lo;
'U' 4 hi;
};
defn
_1_(addr) {
complex _1_ addr;
print(" lo ", addr.lo, "\n");
print(" hi ", addr.hi, "\n");
};
sizeofFPdbleword = 8;
aggr FPdbleword
{
'F' 0 x;
{
'U' 0 lo;
'U' 4 hi;
};
};
defn
FPdbleword(addr) {
complex FPdbleword addr;
print(" x ", addr.x, "\n");
print("_1_ {\n");
_1_(addr+0);
print("}\n");
};
UTFmax = 3;
Runesync = 128;
Runeself = 128;
Runeerror = 128;
sizeofFmt = 48;
aggr Fmt
{
'b' 0 runes;
'X' 4 start;
'X' 8 to;
'X' 12 stop;
'X' 16 flush;
'X' 20 farg;
'D' 24 nfmt;
'X' 28 args;
'D' 32 r;
'D' 36 width;
'D' 40 prec;
'U' 44 flags;
};
defn
Fmt(addr) {
complex Fmt addr;
print(" runes ", addr.runes, "\n");
print(" start ", addr.start\X, "\n");
print(" to ", addr.to\X, "\n");
print(" stop ", addr.stop\X, "\n");
print(" flush ", addr.flush\X, "\n");
print(" farg ", addr.farg\X, "\n");
print(" nfmt ", addr.nfmt, "\n");
print(" args ", addr.args\X, "\n");
print(" r ", addr.r, "\n");
print(" width ", addr.width, "\n");
print(" prec ", addr.prec, "\n");
print(" flags ", addr.flags, "\n");
};
FmtWidth = 1;
FmtLeft = 2;
FmtPrec = 4;
FmtSharp = 8;
FmtSpace = 16;
FmtSign = 32;
FmtZero = 64;
FmtUnsigned = 128;
FmtShort = 256;
FmtLong = 512;
FmtVLong = 1024;
FmtComma = 2048;
FmtByte = 4096;
FmtFlag = 8192;
sizeofTm = 40;
aggr Tm
{
'D' 0 sec;
'D' 4 min;
'D' 8 hour;
'D' 12 mday;
'D' 16 mon;
'D' 20 year;
'D' 24 wday;
'D' 28 yday;
'a' 32 zone;
'D' 36 tzoff;
};
defn
Tm(addr) {
complex Tm addr;
print(" sec ", addr.sec, "\n");
print(" min ", addr.min, "\n");
print(" hour ", addr.hour, "\n");
print(" mday ", addr.mday, "\n");
print(" mon ", addr.mon, "\n");
print(" year ", addr.year, "\n");
print(" wday ", addr.wday, "\n");
print(" yday ", addr.yday, "\n");
print(" zone ", addr.zone, "\n");
print(" tzoff ", addr.tzoff, "\n");
};
PNPROC = 1;
PNGROUP = 2;
sizeofLock = 4;
aggr Lock
{
'D' 0 val;
};
defn
Lock(addr) {
complex Lock addr;
print(" val ", addr.val, "\n");
};
sizeofQLp = 12;
aggr QLp
{
'D' 0 inuse;
'A' QLp 4 next;
'C' 8 state;
};
defn
QLp(addr) {
complex QLp addr;
print(" inuse ", addr.inuse, "\n");
print(" next ", addr.next\X, "\n");
print(" state ", addr.state, "\n");
};
sizeofQLock = 16;
aggr QLock
{
Lock 0 lock;
'D' 4 locked;
'A' QLp 8 $head;
'A' QLp 12 $tail;
};
defn
QLock(addr) {
complex QLock addr;
print("Lock lock {\n");
Lock(addr.lock);
print("}\n");
print(" locked ", addr.locked, "\n");
print(" $head ", addr.$head\X, "\n");
print(" $tail ", addr.$tail\X, "\n");
};
sizeofRWLock = 20;
aggr RWLock
{
Lock 0 lock;
'D' 4 readers;
'D' 8 writer;
'A' QLp 12 $head;
'A' QLp 16 $tail;
};
defn
RWLock(addr) {
complex RWLock addr;
print("Lock lock {\n");
Lock(addr.lock);
print("}\n");
print(" readers ", addr.readers, "\n");
print(" writer ", addr.writer, "\n");
print(" $head ", addr.$head\X, "\n");
print(" $tail ", addr.$tail\X, "\n");
};
sizeofRendez = 12;
aggr Rendez
{
'A' QLock 0 l;
'A' QLp 4 $head;
'A' QLp 8 $tail;
};
defn
Rendez(addr) {
complex Rendez addr;
print(" l ", addr.l\X, "\n");
print(" $head ", addr.$head\X, "\n");
print(" $tail ", addr.$tail\X, "\n");
};
sizeofNetConnInfo = 28;
aggr NetConnInfo
{
'X' 0 dir;
'X' 4 root;
'X' 8 spec;
'X' 12 lsys;
'X' 16 lserv;
'X' 20 rsys;
'X' 24 rserv;
};
defn
NetConnInfo(addr) {
complex NetConnInfo addr;
print(" dir ", addr.dir\X, "\n");
print(" root ", addr.root\X, "\n");
print(" spec ", addr.spec\X, "\n");
print(" lsys ", addr.lsys\X, "\n");
print(" lserv ", addr.lserv\X, "\n");
print(" rsys ", addr.rsys\X, "\n");
print(" rserv ", addr.rserv\X, "\n");
};
RFNAMEG = 1;
RFENVG = 2;
RFFDG = 4;
RFNOTEG = 8;
RFPROC = 16;
RFMEM = 32;
RFNOWAIT = 64;
RFCNAMEG = 1024;
RFCENVG = 2048;
RFCFDG = 4096;
RFREND = 8192;
RFNOMNT = 16384;
sizeofQid = 16;
aggr Qid
{
'W' 0 path;
'U' 8 vers;
'b' 12 type;
};
defn
Qid(addr) {
complex Qid addr;
print(" path ", addr.path, "\n");
print(" vers ", addr.vers, "\n");
print(" type ", addr.type, "\n");
};
sizeofDir = 60;
aggr Dir
{
'u' 0 type;
'U' 4 dev;
Qid 8 qid;
'U' 24
|
{
"pile_set_name": "Github"
}
|
@using System.Globalization
@using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Extensions
@using Microsoft.Azure.Devices.Applications.RemoteMonitoring.Common.Helpers
@using Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Infrastructure.Models
@using Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Web.Helpers
@using GlobalResources
@model Microsoft.Azure.Devices.Applications.RemoteMonitoring.DeviceAdmin.Web.Models.DeviceDetailModel
@{
DateTime? resolvedDate;
var tags = Model.DevicePropertyValueModels.Where(m => m.Name.StartsWith("tags.") && !m.Name.IsReservedTwinName());
var desiredProperties = Model.DevicePropertyValueModels.Where(m => m.Name.StartsWith("properties.desired.") && !m.Name.IsReservedTwinName());
var reportedProperties = Model.DevicePropertyValueModels.Where(m => m.Name.StartsWith("properties.reported.") && !m.Name.IsReservedTwinName());
var deviceProperties = Model.DevicePropertyValueModels.Except(tags).Except(desiredProperties).Except(reportedProperties).Where(m => !m.Name.IsReservedTwinName());
var utcNow = DateTime.UtcNow;
}
<div class="header_grid header_grid_general">
<h3 class="grid_subheadhead_detail grid_subheadhead">@Strings.DeviceTwin</h3>
<img src="~/Content/img/icon_info_gray.svg" class="details_grid_info" title="@Strings.DeviceTwinHeader" />
@Html.ActionLink(@Strings.DownloadTwinJson, "DownloadTwinJson", "Device", new { deviceId = Model.DeviceID }, new { id = "download_link", @class = "link_grid_subheadhead_detail", @style = "margin-top: 1ch;" })
</div>
<hr class="details_grid_twin_begin_line" />
<div class="header_grid_left_space">
<div class="header_grid header_grid_general">
<img id="tagClose" src="~/Content/img/expanded.svg" class="details_grid_info pull-left cursor_pointer tag_toggle_target tag_toggle_source" />
<img id="tagOpen" src="~/Content/img/collapsed.svg" class="details_grid_info pull-left cursor_pointer display_none tag_toggle_target tag_toggle_source" />
<h3 class="grid_subheadhead_detail_collapsable cursor_pointer tag_toggle_source">@Strings.Tags</h3>
@if (Model.IsDeviceEditEnabled)
{
@Html.ActionLink(@Strings.Edit, "EditTags", "Device", new { deviceId = Model.DeviceID }, new
{
id = "edit_tags_link",
@class = "link_grid_subheadhead_detail",
})
}
</div>
<section class="details_grid_general tag_toggle_target" id="tagsGrid">
@if (tags.Any())
{
foreach (var val in tags)
{
<h4 class="grid_subhead_detail_label">@val.Name.Substring(5)</h4>
if (val.PropertyType == PropertyType.DateTime && (resolvedDate = DynamicValuesHelper.ConvertToDateTime(CultureInfo.InvariantCulture, val.Value)).HasValue)
{
<p class="grid_detail_value" name="tagField_@val.Name">@resolvedDate.Value.ToString()</p>
}
else
{
<p class="grid_detail_value" name="tagField_@val.Name">@val.Value</p>
}
}
}
else
{
<p class="grid_detail_value">@Strings.NoTags</p>
}
</section>
<div class="header_grid header_grid_general">
<img id="desiredPropertyClose" src="~/Content/img/expanded.svg" class="details_grid_info pull-left cursor_pointer desiredproperty_toggle_target desiredproperty_toggle_source" />
<img id="desiredPropertyOpen" src="~/Content/img/collapsed.svg" class="details_grid_info pull-left cursor_pointer display_none desiredproperty_toggle_target desiredproperty_toggle_source" />
<h3 class="grid_subheadhead_detail_collapsable cursor_pointer desiredproperty_toggle_source">@Strings.DesiredProperties</h3>
@if (Model.IsDeviceEditEnabled)
{
@Html.ActionLink(@Strings.Edit, "EditDesiredProperties", "Device", new { deviceId = Model.DeviceID }, new
{
id = "edit_desiredProperties_link",
@class = "link_grid_subheadhead_detail",
})
}
</div>
<section class="details_grid_general desiredproperty_toggle_target" id="desiredPropertiesGrid">
@if (desiredProperties.Any())
{
foreach (var val in desiredProperties)
{
<h4 class="grid_subhead_detail_label">@val.Name.Substring(19)</h4>
<div>
<p class="grid_detail_value" name="desiredPropertyField_@val.Name">
@if (val.PropertyType == PropertyType.DateTime && (resolvedDate = DynamicValuesHelper.ConvertToDateTime(CultureInfo.InvariantCulture, val.Value)).HasValue)
{
@resolvedDate.Value.ToString()
}
else
{
@val.Value
}
<span class="grid_detail_lastUpdated pull-right" name="desiredPropertyField_lastUpdated_@val.Name">@TimeSpanExtension.ToFloorShortString(utcNow - val.LastUpdatedUtc, Strings.LastUpdatedFormatString)</span>
</p>
</div>
}
}
else
{
<p class="grid_detail_value">@Strings.NoDesiredProperties</p>
}
</section>
@if (reportedProperties.Any())
{
<div class="header_grid header_grid_general">
<img id="reportedPropertyClose" src="~/Content/img/expanded.svg" class="details_grid_info pull-left cursor_pointer reportedproperty_toggle_target reportedproperty_toggle_source" />
<img id="reportedPropertyOpen" src="~/Content/img/collapsed.svg" class="details_grid_info pull-left cursor_pointer display_none reportedproperty_toggle_target reportedproperty_toggle_source" />
<h3 class="grid_subheadhead_detail_collapsable cursor_pointer reportedproperty_toggle_source">@Strings.ReportedProperties</h3>
</div>
<section class="details_grid_general reportedproperty_toggle_target" id="reportedPropertiesGrid">
@foreach (var val in reportedProperties)
{
<h4 class="grid_subhead_detail_label">@val.Name.Substring(20)</h4>
<div>
<p class="grid_detail_value" name="reportedPropertyField_@val.Name">
@if (val.PropertyType == PropertyType.DateTime && (resolvedDate = DynamicValuesHelper.ConvertToDateTime(CultureInfo.InvariantCulture, val.Value)).HasValue)
{
@resolvedDate.Value.ToString()
}
else
{
@val.Value
}
<span class="grid_detail_lastUpdated pull-right" name="reportedPropertyField_lastUpdated_@val.Name">@TimeSpanExtension.ToFloorShortString(utcNow - val.LastUpdatedUtc, Strings.LastUpdatedFormatString)</span>
</p>
</div>
}
</section>
}
</div>
<hr class="details_grid_twin_end_line" />
<div class="grid_subheadhead_left_space">
<div class="header_grid header_grid_general">
<img id="deviceDetailsClose" src="~/Content/img/expanded.svg" class="details_grid_info cursor_pointer devicedetails_toggle_target devicedetails_toggle_source" />
<img id="deviceDetailsOpen" src="~/
|
{
"pile_set_name": "Github"
}
|
package org.spigotmc;
/**
* FINDME
*
* @author Hexeption admin@hexeption.co.uk
* @since 11/11/2019 - 08:06 am
*/
public interface FINDME {
}
|
{
"pile_set_name": "Github"
}
|
[Unit]
Description=Network Connectivity
Wants=network.target
Before=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
# lo is brought up earlier, which will cause the upcoming "ifup -a" to fail
# with exit code 1, due to an "ip: RTNETLINK answers: File exists" error during
# its "ip addr add ..." command, subsequently causing this unit to fail even
# though it is a benign error. Flushing the lo address with the command below
# before ifup prevents this failure.
ExecStart=/sbin/ip addr flush dev lo
ExecStart=/sbin/ifup -a
ExecStop=/sbin/ifdown -a
[Install]
WantedBy=multi-user.target
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.3) on Sun Mar 29 22:42:10 IST 2020 -->
<title>Uses of Class com.googlecode.cqengine.quantizer.BigDecimalQuantizer (CQEngine 3.5.0 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2020-03-29">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class com.googlecode.cqengine.quantizer.BigDecimalQuantizer (CQEngine 3.5.0 API)";
}
}
catch(err) {
}
//-->
var pathtoroot = "../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../BigDecimalQuantizer.html" title="class in com.googlecode.cqengine.quantizer">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses.html">All Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding"> </div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<main role="main">
<div class="header">
<h2 title="Uses of Class com.googlecode.cqengine.quantizer.BigDecimalQuantizer" class="title">Uses of Class<br>com.googlecode.cqengine.quantizer.BigDecimalQuantizer</h2>
</div>
<div class="classUseContainer">No usage of com.googlecode.cqengine.quantizer.BigDecimalQuantizer</div>
</main>
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../BigDecimalQuantizer.html" title="class in com.googlecode.cqengine.quantizer">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright © 2020. All rights reserved.</small></p>
</footer>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
<section class="notice-previous">
<div class="container text-center">
<a href="http://select2.github.io/select2/">Looking for the Select2 3.5.2 docs?</a>
We have moved them to a new location
<a href="announcements-4.0.html">while we push forward with Select2 4.0</a>.
</div>
</section>
|
{
"pile_set_name": "Github"
}
|
within Buildings.Electrical.DC.Storage;
model Battery "Simple model of a battery"
parameter Modelica.SIunits.Efficiency etaCha(max=1) = 0.9
"Efficiency during charging";
parameter Modelica.SIunits.Efficiency etaDis(max=1) = 0.9
"Efficiency during discharging";
parameter Real SOC_start(min=0, max=1, unit="1")=0.1 "Initial state of charge";
parameter Modelica.SIunits.Energy EMax(min=0, displayUnit="kWh")
"Maximum available charge";
parameter Modelica.SIunits.Voltage V_nominal
"Nominal voltage (V_nominal >= 0)";
Modelica.Blocks.Interfaces.RealInput P(unit="W")
"Power stored in battery (if positive), or extracted from battery (if negative)"
annotation (Placement(transformation(extent={{-20,-20},{20,20}},
rotation=270,
origin={0,108}),
iconTransformation(extent={{-20,-20},{20,20}},
rotation=270,
origin={0,100})));
Modelica.Blocks.Interfaces.RealOutput SOC(min=0, max=1, unit="1")
"State of charge"
annotation (Placement(transformation(extent={{100,50},{120,70}})));
Buildings.Electrical.DC.Interfaces.Terminal_p terminal "Generalized terminal"
annotation (Placement(transformation(extent={{-110,-10},{-90,10}})));
protected
Buildings.Electrical.DC.Storage.BaseClasses.Charge cha(
final EMax=EMax,
final SOC_start=SOC_start,
final etaCha=etaCha,
final etaDis=etaDis) "Charge model"
annotation (Placement(transformation(extent={{40,50},{60,70}})));
Loads.Conductor bat(
final mode=Buildings.Electrical.Types.Load.VariableZ_P_input,
final V_nominal=V_nominal) "Power exchanged with battery pack"
annotation (Placement(transformation(extent={{40,-10},{60,10}})));
Modelica.Blocks.Math.Gain gain(final k=-1)
annotation (Placement(transformation(extent={{22,10},{42,30}})));
equation
connect(cha.SOC, SOC) annotation (Line(
points={{61,60},{110,60}},
color={0,0,127},
smooth=Smooth.None));
connect(cha.P, P) annotation (Line(
points={{38,60},{0,60},{0,108},{8.88178e-16,108}},
color={0,0,127},
smooth=Smooth.None));
connect(bat.terminal, terminal) annotation (Line(
points={{40,0},{-100,0}},
color={0,0,255},
smooth=Smooth.None));
connect(P, gain.u) annotation (Line(
points={{8.88178e-16,108},{8.88178e-16,20},{20,20}},
color={0,0,127},
smooth=Smooth.None));
connect(gain.y, bat.Pow) annotation (Line(
points={{43,20},{68,20},{68,8.88178e-16},{60,8.88178e-16}},
color={0,0,127},
smooth=Smooth.None));
annotation ( Icon(coordinateSystem(
preserveAspectRatio=false, extent={{-100,-100},{100,100}}),
graphics={
Polygon(
points={{-62,40},{-62,-40},{72,-40},{72,40},{-62,40}},
smooth=Smooth.None,
fillColor={215,215,215},
fillPattern=FillPattern.Solid,
pattern=LinePattern.None,
lineColor={0,0,0}),
Polygon(
points={{58,32},{58,-30},{32,-30},{10,32},{58,32}},
smooth=Smooth.None,
pattern=LinePattern.None,
lineColor={0,0,0},
fillColor={0,127,0},
fillPattern=FillPattern.Solid),
Polygon(
points={{-34,32},{-12,-30},{-32,-30},{-54,32},{-34,32}},
smooth=Smooth.None,
pattern=LinePattern.None,
lineColor={0,0,0},
fillColor={0,127,0},
fillPattern=FillPattern.Solid),
Polygon(
points={{-2,32},{20,-30},{0,-30},{-22,32},{-2,32}},
smooth=Smooth.None,
pattern=LinePattern.None,
lineColor={0,0,0},
fillColor={0,127,0},
fillPattern=FillPattern.Solid),
Polygon(
points={{-74,12},{-74,-12},{-62,-12},{-62,12},{-74,12}},
smooth=Smooth.None,
fillColor={215,215,215},
fillPattern=FillPattern.Solid,
pattern=LinePattern.None,
lineColor={0,0,0}),
Text(
extent={{-50,68},{-20,100}},
lineColor={0,0,0},
fillColor={215,215,215},
fillPattern=FillPattern.Solid,
textString="P"),
Line(
points={{-74,0},{-100,0},{-100,0}},
color={0,0,0},
smooth=Smooth.None),
Text(
extent={{-150,70},{-50,20}},
lineColor={0,0,0},
textString="+"),
Text(
extent={{-150,-12},{-50,-62}},
lineColor={0,0,0},
textString="-"),
Text(
extent={{44,70},{100,116}},
lineColor={0,0,0},
fillColor={215,215,215},
fillPattern=FillPattern.Solid,
textString="SOC"),
Text(
extent={{44,154},{134,112}},
lineColor={0,0,255},
textString="%name")}),
Documentation(info="<html>
<p>
Simple model of a battery.
</p>
<p>
This model takes as an input the power that should be stored in the battery (if <i>P > 0</i>)
or that should be extracted from the battery.
The model uses a fictitious conductance
(see <a href=\"modelica://Buildings.Electrical.DC.Loads.Conductor\">Buildings.Electrical.DC.Loads.Conductor</a>) <i>G</i> such that
<i>P = u i</i> and <i>i = u G,</i> where
<i>u</i> is the voltage difference across the pins and
<i>i</i> is the current at the positive pin.
</p>
<p>
The output connector <code>SOC</code> is the state of charge of the battery.
This model does not enforce that the state of charge is between zero and one.
However, each time the state of charge crosses zero or one, a warning will
be written to the simulation log file.
The model also does not limit the current through the battery. The user should
provide a control so that only a reasonable amount of power is exchanged,
and that the state of charge remains between zero and one.
</p>
</html>",
revisions="<html>
<ul>
<li>
September 24, 2015 by Michael Wetter:<br/>
Removed binding of <code>P_nominal</code> as
this parameter is disabled and assigned a value
in the <code>initial equation</code> section.
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/426\">issue 426</a>.
</li>
<li>
March 19, 2015, by Michael Wetter:<br/>
Removed redeclaration of phase system in <code>Terminal_
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.