text
stringlengths 2
100k
| meta
dict |
---|---|
---
-api-id: M:Windows.ApplicationModel.Resources.Core.ResourceContext.Reset
-api-type: winrt method
---
<!-- Method syntax
public void Reset()
-->
# Windows.ApplicationModel.Resources.Core.ResourceContext.Reset
## -description
Resets the overridden values for all qualifiers on the given [ResourceContext](resourcecontext.md) instance.
## -remarks
## -examples
## -see-also
[Reset(IIterable(String))](resourcecontext_reset_1866151571.md) | {
"pile_set_name": "Github"
} |
package com.neo.dao.impl;
import org.springframework.stereotype.Service;
import com.neo.dao.BaseDao;
import com.neo.dao.UserDao;
import com.neo.entity.UserEntity;
@Service ("userDao")
public class UseDaoImpl extends BaseDao implements UserDao {
@Override
public void updateUser(UserEntity user) {
this.test1Update(user);
}
}
| {
"pile_set_name": "Github"
} |
/* ******************************************************************
hist : Histogram functions
part of Finite State Entropy project
Copyright (C) 2013-present, Yann Collet.
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
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.
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.
You can contact the author at :
- FSE source repository : https://github.com/Cyan4973/FiniteStateEntropy
- Public forum : https://groups.google.com/forum/#!forum/lz4c
****************************************************************** */
/* --- dependencies --- */
#include "mem.h" /* U32, BYTE, etc. */
#include "debug.h" /* assert, DEBUGLOG */
#include "error_private.h" /* ERROR */
#include "hist.h"
/* --- Error management --- */
unsigned HIST_isError(size_t code) { return ERR_isError(code); }
/*-**************************************************************
* Histogram functions
****************************************************************/
unsigned HIST_count_simple(unsigned* count, unsigned* maxSymbolValuePtr,
const void* src, size_t srcSize)
{
const BYTE* ip = (const BYTE*)src;
const BYTE* const end = ip + srcSize;
unsigned maxSymbolValue = *maxSymbolValuePtr;
unsigned largestCount=0;
memset(count, 0, (maxSymbolValue+1) * sizeof(*count));
if (srcSize==0) { *maxSymbolValuePtr = 0; return 0; }
while (ip<end) {
assert(*ip <= maxSymbolValue);
count[*ip++]++;
}
while (!count[maxSymbolValue]) maxSymbolValue--;
*maxSymbolValuePtr = maxSymbolValue;
{ U32 s;
for (s=0; s<=maxSymbolValue; s++)
if (count[s] > largestCount) largestCount = count[s];
}
return largestCount;
}
typedef enum { trustInput, checkMaxSymbolValue } HIST_checkInput_e;
/* HIST_count_parallel_wksp() :
* store histogram into 4 intermediate tables, recombined at the end.
* this design makes better use of OoO cpus,
* and is noticeably faster when some values are heavily repeated.
* But it needs some additional workspace for intermediate tables.
* `workSpace` size must be a table of size >= HIST_WKSP_SIZE_U32.
* @return : largest histogram frequency,
* or an error code (notably when histogram would be larger than *maxSymbolValuePtr). */
static size_t HIST_count_parallel_wksp(
unsigned* count, unsigned* maxSymbolValuePtr,
const void* source, size_t sourceSize,
HIST_checkInput_e check,
U32* const workSpace)
{
const BYTE* ip = (const BYTE*)source;
const BYTE* const iend = ip+sourceSize;
unsigned maxSymbolValue = *maxSymbolValuePtr;
unsigned max=0;
U32* const Counting1 = workSpace;
U32* const Counting2 = Counting1 + 256;
U32* const Counting3 = Counting2 + 256;
U32* const Counting4 = Counting3 + 256;
memset(workSpace, 0, 4*256*sizeof(unsigned));
/* safety checks */
if (!sourceSize) {
memset(count, 0, maxSymbolValue + 1);
*maxSymbolValuePtr = 0;
return 0;
}
if (!maxSymbolValue) maxSymbolValue = 255; /* 0 == default */
/* by stripes of 16 bytes */
{ U32 cached = MEM_read32(ip); ip += 4;
while (ip < iend-15) {
U32 c = cached; cached = MEM_read32(ip); ip += 4;
Counting1[(BYTE) c ]++;
Counting2[(BYTE)(c>>8) ]++;
Counting3[(BYTE)(c>>16)]++;
Counting4[ c>>24 ]++;
c = cached; cached = MEM_read32(ip); ip += 4;
Counting1[(BYTE) c ]++;
Counting2[(BYTE)(c>>8) ]++;
Counting3[(BYTE)(c>>16)]++;
Counting4[ c>>24 ]++;
c = cached; cached = MEM_read32(ip); ip += 4;
Counting1[(BYTE) c ]++;
Counting2[(BYTE)(c>>8) ]++;
Counting3[(BYTE)(c>>16)]++;
Counting4[ c>>24 ]++;
c = cached; cached = MEM_read32(ip); ip += 4;
Counting1[(BYTE) c ]++;
Counting2[(BYTE)(c>>8) ]++;
Counting3[(BYTE)(c>>16)]++;
Counting4[ c>>24 ]++;
}
ip-=4;
}
/* finish last symbols */
while (ip<iend) Counting1[*ip++]++;
if (check) { /* verify stats will fit into destination table */
U32 s; for (s=255; s>maxSymbolValue; s--) {
Counting1[s] += Counting2[s] + Counting3[s] + Counting4[s];
if (Counting1[s]) return ERROR(maxSymbolValue_tooSmall);
} }
{ U32 s;
if (maxSymbolValue > 255) maxSymbolValue = 255;
for (s=0; s<=maxSymbolValue; s++) {
count[s] = Counting1[s] + Counting2[s] + Counting3[s] + Counting4[s];
if (count[s] > max) max = count[s];
} }
while (!count[maxSymbolValue]) maxSymbolValue--;
*maxSymbolValuePtr = maxSymbolValue;
return (size_t)max;
}
/* HIST_countFast_wksp() :
* Same as HIST_countFast(), but using an externally provided scratch buffer.
* `workSpace` is a writable buffer which must be 4-bytes aligned,
* `workSpaceSize` must be >= HIST_WKSP_SIZE
*/
size_t HIST_countFast_wksp(unsigned* count, unsigned* maxSymbolValuePtr,
const void* source, size_t sourceSize,
void* workSpace, size_t workSpaceSize)
{
if (sourceSize < 1500) /* heuristic threshold */
return HIST_count_simple(count, maxSymbolValuePtr, source, sourceSize);
if ((size_t)workSpace & 3) return ERROR(GENERIC); /* must be aligned on 4-bytes boundaries */
if (workSpaceSize < HIST_WKSP_SIZE) return ERROR(workSpace_tooSmall);
return HIST_count_parallel_wksp(count, maxSymbolValuePtr, source, sourceSize, trustInput, (U32*)workSpace);
}
/* fast variant (unsafe : won't check if src contains values beyond count[] limit) */
size_t HIST_countFast(unsigned* count, unsigned* maxSymbolValuePtr,
const void* source, size_t sourceSize)
{
unsigned tmpCounters[HIST_WKSP_SIZE_U32];
return HIST_countFast_wksp(count, maxSymbolValuePtr, source, sourceSize, tmpCounters, sizeof(tmpCounters));
}
/* HIST_count_wksp() :
* Same as HIST_count(), but using an externally provided scratch buffer.
* `workSpace` size must be table of >= HIST_WKSP_SIZE_U32 unsigned */
size_t HIST_count_wksp(unsigned* count, unsigned* maxSymbolValuePtr,
const void* source, size_t sourceSize,
void* workSpace, size_t workSpaceSize)
{
if ((size_t)workSpace & 3) return ERROR(GENERIC); /* must be aligned on 4-bytes boundaries */
if (workSpaceSize < HIST_WKSP_SIZE) return ERROR(workSpace_tooSmall);
if (*maxSymbolValuePtr < 255)
return HIST_count_parallel_wksp(count, maxSymbolValuePtr, source, sourceSize, checkMaxSymbolValue, (U32*)workSpace);
*maxSymbolValuePtr = 255;
return HIST_countFast_wksp(count, maxSymbolValuePtr, source, sourceSize, workSpace, workSpaceSize);
}
size_t HIST_count(unsigned* count, unsigned* maxSymbolValuePtr,
const void* src, size_t srcSize)
{
unsigned tmpCounters[HIST_WKSP_SIZE_U32];
return HIST_count_wksp(count, maxSymbolValuePtr, src, srcSize, tmpCounters, sizeof(tmpCounters));
}
| {
"pile_set_name": "Github"
} |
// SPDX-License-Identifier: GPL-2.0
/*
* Ingenic SoCs USB PHY driver
* Copyright (c) Paul Cercueil <[email protected]>
* Copyright (c) 漆鹏振 (Qi Pengzhen) <[email protected]>
* Copyright (c) 周琰杰 (Zhou Yanjie) <[email protected]>
*/
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regulator/consumer.h>
#include <linux/usb/otg.h>
#include <linux/usb/phy.h>
/* OTGPHY register offsets */
#define REG_USBPCR_OFFSET 0x00
#define REG_USBRDT_OFFSET 0x04
#define REG_USBVBFIL_OFFSET 0x08
#define REG_USBPCR1_OFFSET 0x0c
/* bits within the USBPCR register */
#define USBPCR_USB_MODE BIT(31)
#define USBPCR_AVLD_REG BIT(30)
#define USBPCR_COMMONONN BIT(25)
#define USBPCR_VBUSVLDEXT BIT(24)
#define USBPCR_VBUSVLDEXTSEL BIT(23)
#define USBPCR_POR BIT(22)
#define USBPCR_SIDDQ BIT(21)
#define USBPCR_OTG_DISABLE BIT(20)
#define USBPCR_TXPREEMPHTUNE BIT(6)
#define USBPCR_IDPULLUP_LSB 28
#define USBPCR_IDPULLUP_MASK GENMASK(29, USBPCR_IDPULLUP_LSB)
#define USBPCR_IDPULLUP_ALWAYS (0x2 << USBPCR_IDPULLUP_LSB)
#define USBPCR_IDPULLUP_SUSPEND (0x1 << USBPCR_IDPULLUP_LSB)
#define USBPCR_IDPULLUP_OTG (0x0 << USBPCR_IDPULLUP_LSB)
#define USBPCR_COMPDISTUNE_LSB 17
#define USBPCR_COMPDISTUNE_MASK GENMASK(19, USBPCR_COMPDISTUNE_LSB)
#define USBPCR_COMPDISTUNE_DFT (0x4 << USBPCR_COMPDISTUNE_LSB)
#define USBPCR_OTGTUNE_LSB 14
#define USBPCR_OTGTUNE_MASK GENMASK(16, USBPCR_OTGTUNE_LSB)
#define USBPCR_OTGTUNE_DFT (0x4 << USBPCR_OTGTUNE_LSB)
#define USBPCR_SQRXTUNE_LSB 11
#define USBPCR_SQRXTUNE_MASK GENMASK(13, USBPCR_SQRXTUNE_LSB)
#define USBPCR_SQRXTUNE_DCR_20PCT (0x7 << USBPCR_SQRXTUNE_LSB)
#define USBPCR_SQRXTUNE_DFT (0x3 << USBPCR_SQRXTUNE_LSB)
#define USBPCR_TXFSLSTUNE_LSB 7
#define USBPCR_TXFSLSTUNE_MASK GENMASK(10, USBPCR_TXFSLSTUNE_LSB)
#define USBPCR_TXFSLSTUNE_DCR_50PPT (0xf << USBPCR_TXFSLSTUNE_LSB)
#define USBPCR_TXFSLSTUNE_DCR_25PPT (0x7 << USBPCR_TXFSLSTUNE_LSB)
#define USBPCR_TXFSLSTUNE_DFT (0x3 << USBPCR_TXFSLSTUNE_LSB)
#define USBPCR_TXFSLSTUNE_INC_25PPT (0x1 << USBPCR_TXFSLSTUNE_LSB)
#define USBPCR_TXFSLSTUNE_INC_50PPT (0x0 << USBPCR_TXFSLSTUNE_LSB)
#define USBPCR_TXHSXVTUNE_LSB 4
#define USBPCR_TXHSXVTUNE_MASK GENMASK(5, USBPCR_TXHSXVTUNE_LSB)
#define USBPCR_TXHSXVTUNE_DFT (0x3 << USBPCR_TXHSXVTUNE_LSB)
#define USBPCR_TXHSXVTUNE_DCR_15MV (0x1 << USBPCR_TXHSXVTUNE_LSB)
#define USBPCR_TXRISETUNE_LSB 4
#define USBPCR_TXRISETUNE_MASK GENMASK(5, USBPCR_TXRISETUNE_LSB)
#define USBPCR_TXRISETUNE_DFT (0x3 << USBPCR_TXRISETUNE_LSB)
#define USBPCR_TXVREFTUNE_LSB 0
#define USBPCR_TXVREFTUNE_MASK GENMASK(3, USBPCR_TXVREFTUNE_LSB)
#define USBPCR_TXVREFTUNE_INC_25PPT (0x7 << USBPCR_TXVREFTUNE_LSB)
#define USBPCR_TXVREFTUNE_DFT (0x5 << USBPCR_TXVREFTUNE_LSB)
/* bits within the USBRDTR register */
#define USBRDT_UTMI_RST BIT(27)
#define USBRDT_HB_MASK BIT(26)
#define USBRDT_VBFIL_LD_EN BIT(25)
#define USBRDT_IDDIG_EN BIT(24)
#define USBRDT_IDDIG_REG BIT(23)
#define USBRDT_VBFIL_EN BIT(2)
/* bits within the USBPCR1 register */
#define USBPCR1_BVLD_REG BIT(31)
#define USBPCR1_DPPD BIT(29)
#define USBPCR1_DMPD BIT(28)
#define USBPCR1_USB_SEL BIT(28)
#define USBPCR1_WORD_IF_16BIT BIT(19)
enum ingenic_usb_phy_version {
ID_JZ4770,
ID_JZ4780,
ID_X1000,
ID_X1830,
};
struct ingenic_soc_info {
enum ingenic_usb_phy_version version;
void (*usb_phy_init)(struct usb_phy *phy);
};
struct jz4770_phy {
const struct ingenic_soc_info *soc_info;
struct usb_phy phy;
struct usb_otg otg;
struct device *dev;
void __iomem *base;
struct clk *clk;
struct regulator *vcc_supply;
};
static inline struct jz4770_phy *otg_to_jz4770_phy(struct usb_otg *otg)
{
return container_of(otg, struct jz4770_phy, otg);
}
static inline struct jz4770_phy *phy_to_jz4770_phy(struct usb_phy *phy)
{
return container_of(phy, struct jz4770_phy, phy);
}
static int ingenic_usb_phy_set_peripheral(struct usb_otg *otg,
struct usb_gadget *gadget)
{
struct jz4770_phy *priv = otg_to_jz4770_phy(otg);
u32 reg;
if (priv->soc_info->version >= ID_X1000) {
reg = readl(priv->base + REG_USBPCR1_OFFSET);
reg |= USBPCR1_BVLD_REG;
writel(reg, priv->base + REG_USBPCR1_OFFSET);
}
reg = readl(priv->base + REG_USBPCR_OFFSET);
reg &= ~USBPCR_USB_MODE;
reg |= USBPCR_VBUSVLDEXT | USBPCR_VBUSVLDEXTSEL | USBPCR_OTG_DISABLE;
writel(reg, priv->base + REG_USBPCR_OFFSET);
return 0;
}
static int ingenic_usb_phy_set_host(struct usb_otg *otg, struct usb_bus *host)
{
struct jz4770_phy *priv = otg_to_jz4770_phy(otg);
u32 reg;
reg = readl(priv->base + REG_USBPCR_OFFSET);
reg &= ~(USBPCR_VBUSVLDEXT | USBPCR_VBUSVLDEXTSEL | USBPCR_OTG_DISABLE);
reg |= USBPCR_USB_MODE;
writel(reg, priv->base + REG_USBPCR_OFFSET);
return 0;
}
static int ingenic_usb_phy_init(struct usb_phy *phy)
{
struct jz4770_phy *priv = phy_to_jz4770_phy(phy);
int err;
u32 reg;
err = regulator_enable(priv->vcc_supply);
if (err) {
dev_err(priv->dev, "Unable to enable VCC: %d\n", err);
return err;
}
err = clk_prepare_enable(priv->clk);
if (err) {
dev_err(priv->dev, "Unable to start clock: %d\n", err);
return err;
}
priv->soc_info->usb_phy_init(phy);
/* Wait for PHY to reset */
usleep_range(30, 300);
reg = readl(priv->base + REG_USBPCR_OFFSET);
writel(reg & ~USBPCR_POR, priv->base + REG_USBPCR_OFFSET);
usleep_range(300, 1000);
return 0;
}
static void ingenic_usb_phy_shutdown(struct usb_phy *phy)
{
struct jz4770_phy *priv = phy_to_jz4770_phy(phy);
clk_disable_unprepare(priv->clk);
regulator_disable(priv->vcc_supply);
}
static void ingenic_usb_phy_remove(void *phy)
{
usb_remove_phy(phy);
}
static void jz4770_usb_phy_init(struct usb_phy *phy)
{
struct jz4770_phy *priv = phy_to_jz4770_phy(phy);
u32 reg;
reg = USBPCR_AVLD_REG | USBPCR_COMMONONN | USBPCR_IDPULLUP_ALWAYS |
USBPCR_COMPDISTUNE_DFT | USBPCR_OTGTUNE_DFT | USBPCR_SQRXTUNE_DFT |
USBPCR_TXFSLSTUNE_DFT | USBPCR_TXRISETUNE_DFT | USBPCR_TXVREFTUNE_DFT |
USBPCR_POR;
writel(reg, priv->base + REG_USBPCR_OFFSET);
}
static void jz4780_usb_phy_init(struct usb_phy *phy)
{
struct jz4770_phy *priv = phy_to_jz4770_phy(phy);
u32 reg;
reg = readl(priv->base + REG_USBPCR1_OFFSET) | USBPCR1_USB_SEL |
USBPCR1_WORD_IF_16BIT;
writel(reg, priv->base + REG_USBPCR1_OFFSET);
reg = USBPCR_TXPREEMPHTUNE | USBPCR_COMMONONN | USBPCR_POR;
writel(reg, priv->base + REG_USBPCR_OFFSET);
}
static void x1000_usb_phy_init(struct usb_phy *phy)
{
struct jz4770_phy *priv = phy_to_jz4770_phy(phy);
u32 reg;
reg = readl(priv->base + REG_USBPCR1_OFFSET) | USBPCR1_WORD_IF_16BIT;
writel(reg, priv->base + REG_USBPCR1_OFFSET);
reg = USBPCR_SQRXTUNE_DCR_20PCT | USBPCR_TXPREEMPHTUNE |
USBPCR_TXHSXVTUNE_DCR_15MV | USBPCR_TXVREFTUNE_INC_25PPT |
USBPCR_COMMONONN | USBPCR_POR;
writel(reg, priv->base + REG_USBPCR_OFFSET);
}
static void x1830_usb_phy_init(struct usb_phy *phy)
{
struct jz4770_phy *priv = phy_to_jz4770_phy(phy);
u32 reg;
/* rdt */
writel(USBRDT_VBFIL_EN | USBRDT_UTMI_RST, priv->base + REG_USBRDT_OFFSET);
reg = readl(priv->base + REG_USBPCR1_OFFSET) | USBPCR1_WORD_IF_16BIT |
USBPCR1_DMPD | USBPCR1_DPPD;
writel(reg, priv->base + REG_USBPCR1_OFFSET);
reg = USBPCR_IDPULLUP_OTG | USBPCR_VBUSVLDEXT | USBPCR_TXPREEMPHTUNE |
USBPCR_COMMONONN | USBPCR_POR;
writel(reg, priv->base + REG_USBPCR_OFFSET);
}
static const struct ingenic_soc_info jz4770_soc_info = {
.version = ID_JZ4770,
.usb_phy_init = jz4770_usb_phy_init,
};
static const struct ingenic_soc_info jz4780_soc_info = {
.version = ID_JZ4780,
.usb_phy_init = jz4780_usb_phy_init,
};
static const struct ingenic_soc_info x1000_soc_info = {
.version = ID_X1000,
.usb_phy_init = x1000_usb_phy_init,
};
static const struct ingenic_soc_info x1830_soc_info = {
.version = ID_X1830,
.usb_phy_init = x1830_usb_phy_init,
};
static const struct of_device_id ingenic_usb_phy_of_matches[] = {
{ .compatible = "ingenic,jz4770-phy", .data = &jz4770_soc_info },
{ .compatible = "ingenic,jz4780-phy", .data = &jz4780_soc_info },
{ .compatible = "ingenic,x1000-phy", .data = &x1000_soc_info },
{ .compatible = "ingenic,x1830-phy", .data = &x1830_soc_info },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, ingenic_usb_phy_of_matches);
static int jz4770_phy_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct jz4770_phy *priv;
int err;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
priv->soc_info = device_get_match_data(&pdev->dev);
if (!priv->soc_info) {
dev_err(&pdev->dev, "Error: No device match found\n");
return -ENODEV;
}
platform_set_drvdata(pdev, priv);
priv->dev = dev;
priv->phy.dev = dev;
priv->phy.otg = &priv->otg;
priv->phy.label = "ingenic-usb-phy";
priv->phy.init = ingenic_usb_phy_init;
priv->phy.shutdown = ingenic_usb_phy_shutdown;
priv->otg.state = OTG_STATE_UNDEFINED;
priv->otg.usb_phy = &priv->phy;
priv->otg.set_host = ingenic_usb_phy_set_host;
priv->otg.set_peripheral = ingenic_usb_phy_set_peripheral;
priv->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(priv->base)) {
dev_err(dev, "Failed to map registers\n");
return PTR_ERR(priv->base);
}
priv->clk = devm_clk_get(dev, NULL);
if (IS_ERR(priv->clk)) {
err = PTR_ERR(priv->clk);
if (err != -EPROBE_DEFER)
dev_err(dev, "Failed to get clock\n");
return err;
}
priv->vcc_supply = devm_regulator_get(dev, "vcc");
if (IS_ERR(priv->vcc_supply)) {
err = PTR_ERR(priv->vcc_supply);
if (err != -EPROBE_DEFER)
dev_err(dev, "Failed to get regulator\n");
return err;
}
err = usb_add_phy(&priv->phy, USB_PHY_TYPE_USB2);
if (err) {
if (err != -EPROBE_DEFER)
dev_err(dev, "Unable to register PHY\n");
return err;
}
return devm_add_action_or_reset(dev, ingenic_usb_phy_remove, &priv->phy);
}
static struct platform_driver ingenic_phy_driver = {
.probe = jz4770_phy_probe,
.driver = {
.name = "jz4770-phy",
.of_match_table = of_match_ptr(ingenic_usb_phy_of_matches),
},
};
module_platform_driver(ingenic_phy_driver);
MODULE_AUTHOR("周琰杰 (Zhou Yanjie) <[email protected]>");
MODULE_AUTHOR("漆鹏振 (Qi Pengzhen) <[email protected]>");
MODULE_AUTHOR("Paul Cercueil <[email protected]>");
MODULE_DESCRIPTION("Ingenic SoCs USB PHY driver");
MODULE_LICENSE("GPL");
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" />
<title>Coverage for m1.py: 100%</title>
<link rel="stylesheet" href="style.css" type="text/css">
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery.hotkeys.js"></script>
<script type="text/javascript" src="jquery.isonscreen.js"></script>
<script type="text/javascript" src="coverage_html.js"></script>
<script type="text/javascript">
jQuery(document).ready(coverage.pyfile_ready);
</script>
</head>
<body class="pyfile">
<div id="header">
<div class="content">
<h1>Coverage for <b>m1.py</b> :
<span class="pc_cov">100%</span>
</h1>
<img id="keyboard_icon" src="keybd_closed.png" alt="Show keyboard shortcuts" />
<h2 class="stats">
2 statements
<button type="button" class="run shortkey_r button_toggle_run" title="Toggle lines run">2 run</button>
<button type="button" class="mis show_mis shortkey_m button_toggle_mis" title="Toggle lines missing">0 missing</button>
<button type="button" class="exc show_exc shortkey_x button_toggle_exc" title="Toggle lines excluded">0 excluded</button>
</h2>
</div>
</div>
<div class="help_panel">
<img id="panel_icon" src="keybd_open.png" alt="Hide keyboard shortcuts" />
<p class="legend">Hot-keys on this page</p>
<div>
<p class="keyhelp">
<span class="key">r</span>
<span class="key">m</span>
<span class="key">x</span>
<span class="key">p</span> toggle line displays
</p>
<p class="keyhelp">
<span class="key">j</span>
<span class="key">k</span> next/prev highlighted chunk
</p>
<p class="keyhelp">
<span class="key">0</span> (zero) top of page
</p>
<p class="keyhelp">
<span class="key">1</span> (one) first highlighted chunk
</p>
</div>
</div>
<div id="source">
<p id="t1" class="run"><span class="n"><a href="#t1">1</a></span><span class="t"><span class="nam">m1a</span> <span class="op">=</span> <span class="num">1</span> </span><span class="r"></span></p>
<p id="t2" class="run"><span class="n"><a href="#t2">2</a></span><span class="t"><span class="nam">m1b</span> <span class="op">=</span> <span class="num">2</span> </span><span class="r"></span></p>
</div>
<div id="footer">
<div class="content">
<p>
<a class="nav" href="index.html">« index</a> <a class="nav" href="https://coverage.readthedocs.io/en/coverage-5.0a9">coverage.py v5.0a9</a>,
created at 2019-10-14 09:27 +0000
</p>
</div>
</div>
</body>
</html>
| {
"pile_set_name": "Github"
} |
<html>
<head>
<meta http-equiv="Content-Language" content="de">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="keywords" lang="en" content="Deep Sky Stacking Astrophotography Bayer matrix">
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<title>Technische Details</title>
<style>
<!--
div.MsoNormal
{mso-style-parent:"";
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";
margin-left:0cm; margin-right:0cm; margin-top:0cm}
.Standard { text-align: justify; margin-left: 5; margin-right: 10 }
-->
</style>
</head>
<body>
<p><b><span lang="EN-US" style="FONT-SIZE: 18pt; FONT-FAMILY: Arial">Technische
Details</span></b></p>
<blockquote>
<p><b><span style="FONT-FAMILY: Arial"><A href="#Registering">Registrierung</A><br>
<A href="#Alignment">Ausrichtung</A><br>
<A href="#FileGroups">Datei-Gruppen</A><br>
<A href="#Stacking">Stacking</A><br>
<A href="#stackingmethods">Stacking Methoden</A><br>
<A href="#Drizzle">Drizzle</A><br>
<A href="#cometstacking">Kometen Stacking</A><br>
<A href="#rawdecod">RAW Bilder Entwicklungsprozess</A></span></b></p>
</blockquote>
<div class="MsoNormal" align="center" style="TEXT-ALIGN: center">
<span lang="EN-US">
<hr size="2" width="100%" noshade color="blue" align="center"></span>
</div>
<p align="justify"><b>
<span lang="EN-US" style="FONT-SIZE: 13.5pt; FONT-FAMILY: Arial; COLOR: red">
<a name="Registering"></a>Registrierung</span><span lang="EN-US" style="FONT-FAMILY: Arial"><br>
</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Sternerkennung</span><span lang="EN-US" style="FONT-FAMILY: Arial"><br>
</span></b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> DeepSkyStacker erkennt automatisch in jedem Bild die Sterne.<br>
Um es ganz einfach zu formulieren: Ein Stern ist ein rundes Objekt, dessen Luminanz gleichmäßig nach allen Seiten abnimmt.<br>
Sobald ein Stern entdeckt wird, wird mit Hilfe einer sogenannten Gaußkurve (der Helligkeitsverteilung) das exakte Zentrum des Sterns berechnet.</span></p>
<hr color="#0000ff" size="1">
<p align="justify"><font face="Arial"><b><font size="2">Verwendung von Darks, Flats und Offsets
vor der Registrierung</font><br>
</b><font size="2">Wenn Dark-, Flat- und/oder Offsetframes ausgewählt sind, werden diese noch vor dem eigentlichen Registrierungs-Prozess angewendet.<br>
Wenn sich in den Lightframes viele Hot-Pixel befinden, ist es sehr empfehlenswert Darkframes zu verwenden, da sonst diese "angeblichen" Sterne einen korrekten Ausrichtungsprozess enorm stören.</font></font></p>
<hr color="#0000ff" size="1">
<p align="justify"><font face="Arial"><b>
<font size="2"><a name="hotpixels"></a>Automatische Erkennung von Hot-Pixel</font><br>
</b><font size="2">Optional dazu (zur Darkframe Verwendung) versucht DeepSkyStacker Hot-Pixel während des Registrierungs-Prozesses zu entdecken und damit "falsche" Sterne zu vermeiden.<br>
Diese Option lässt sich allerdings nur bei monochromen Bildern und RAW Bildern im <A href="#superpixel">Super-Pixel</A>, <A href="#bayerdrizzle">
Bayer.Drizzle</A>, Bilinear und AHD Interpolations-Modus anwenden.</font></font></p>
<hr color="#0000ff" size="1">
<p align="justify"><b><font face="Arial" size="2"><a name="detectionthreshold"></a>Anpassung des Sternerkennungs-Schwellenwert</font></b><font size="2" face="Arial"><b>es<br>
</b>
Der Standard Sternerkennungs-Schwellenwert liegt normalerweise bei 10% (10% der maximalen Luminanz). </font></p>
<p align="justify"><font size="2" face="Arial"> <TABLE style="WIDTH: 100%; BORDER-COLLAPSE: collapse" borderColor=#ffffff cellSpacing=0 cellPadding=5 width="100%" border=1>
<TBODY > <TR>
<TD width="63%">
<FONT size=2>
Sie können den Schwellenwert
unter “Einstellungen/Registrierungs-Einstellungen/Erweitert” oder unter “ausgewählte Bilder registrieren/Registrierungs-Einstellungen”
anpassen..</FONT>
<font size=2 face=Arial>
<p align=justify>
<span lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
Durch
<STRONG><EM>reduzieren</EM></STRONG> des
Sternerkennungs-Schwellenwertes findet DeepSkyStacker <EM>
<STRONG>mehr</STRONG></EM> (schwächere) Sterne, wenn Sie andererseits den Schwellenwert<EM ><STRONG
>erhöhen</STRONG></EM> warden
nur hellere Sterne gefunden und die Anzahl
<EM
><STRONG>reduziert</STRONG>
</EM>
.
<BR >
<BR >
Den
Schwellenwert zu weit zu reduzieren ist aber kontraproduktiv da viele hundert Sterne
gefunden werden und sich die zu verarbeitende Datenmenge sowie die Gefahr
von Fehlern bei der Registrierung stark erhöht.
Das Ziel sollten über 20-25, aber nicht mehr als einige hundert Sterne sein.</span></p><p align=justify ><span lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
Wenn Sie den Erkennungs-Schwellenwert niedrig gesetzt haben und DeepSkyStacker
findet trotzdem keine Sterne weil das Bild unterbelichtet ist können Sie mit
Hilfe der Einstellung “Helligkeit” in “Raw/FITS DDP Einstellungen” die Helligkeit
erhöhen.
</span> </p><p align=justify>
<span lang=EN-US
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
Wenn
Ihres Bilder verrauscht sind (z.B. aufgrund von Lichtverschmutzung)
können Sie die Option "<FONT face=Courier>Medianfilter
zur Rauschreduzierung </FONT>
</font></font><FONT face=Courier>verwenden</FONT>" einschalten.<font size="2" face="Arial">
<font size=2 face=Arial></SPAN></p> <p align=justify>
Um den optimalen Schwellenwert für
Ihre lights zu finden können Sie die Anzahl der Sterne berechnen die
gefunden werden wird. Dazu verwendet DeepSkyStacker das erste ausgewählte
lightframe und aktiviert vorübergehend die Hotpixel-Erkennung.</FONT></p>
<p align=justify>
<font size=2 face=Arial >
Sie sollten aber beachten dass
dies nur ein Richtwert ist und die reelle Anzahl variieren kann wenn Sie dark-,
offset-, und flatframes ausgewählt haben..</font></p></FONT></TD>
<TD > <IMG alt=""
src="../images/german/Register_Settings.jpg"></TD></TR></TBODY></TABLE><br >
<font size=2 face=Arial><BR></font></FONT>
<span lang="EN-US">
<hr size="1" noshade color="blue"></span>
<P></P>
<p align="justify"><b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
Registrierungsergebnis<br>
</span></b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Das Registrierungsergebnis (Anzahl der Sterne, Position, Luminanz jedes Stern's)
wird in einer Textdatei gespeichert. Diese Datei trägt den Namen der Bilddatei mit der Datei-Endung <strong>.Info.txt</strong>.<br>
So ist es nicht nodwendig das Bild erneut zu registrieren, wenn man es zukünftig noch einmal stacken will.</span></p>
<div class="MsoNormal" align="center" style="TEXT-ALIGN: center">
<span lang="EN-US">
<hr size="1" noshade color="blue"></span>
</div>
<p align="justify"><b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
Registrierungsergebnisse und Parameter<br>
</span></b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Die Registrierungsergebnisse hängen natürlich sehr von den eingestellten Parametern ab (speziell bei den <A href="userguide.htm#rawddp">RAW Entwicklungs-Einstellungen</A>).<br>
Wenn Sie an diesen Parametern etwas verändern, müssen Sie das Bild unbedingt erneut registrieren.
</span></p>
<div class="MsoNormal" align="center" style="TEXT-ALIGN: center">
<span lang="EN-US">
<hr size="1" noshade color="blue"></span>
</div>
<p align="justify"><b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Stacken nach der Registrierung<br>
</span></b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
DeepSkyStacker kann das Registrieren und Stacken miteinander verbinden. Dazu müssen Sie nur festlegen, wieviel Prozent der Bilder am Ende eines Registrierungs-Prozesses Sie für das Stacking freigeben wollen. Nur die besten Bilder werden dann zum Stacken verwendet.<br>
Dadurch ist es möglich den kompletten Registrierungs- und Stacking-Prozess zu starten, sich schlafen zu legen und am nächsten Morgen die ersten Ergebnisse zu sehen.</span></p>
<div class="MsoNormal" align="center" style="TEXT-ALIGN: center">
<span lang="EN-US">
<hr size="2" width="100%" noshade color="blue" align="center"></span>
</div>
<p align="justify" style="MARGIN-BOTTOM: 0px"><b>
<span lang="EN-US" style="FONT-SIZE: 13.5pt; FONT-FAMILY: Arial; COLOR: red">
<a name="Alignment"></a>Ausrichtung</span><span lang="EN-US" style="FONT-FAMILY: Arial"><br>
</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Versatz und Winkel-Berechnung</span><span lang="EN-US" style="FONT-FAMILY: Arial"><br>
</span></b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
Während des Ausrichtungs-Prozesses wird das beste Bild (das Bild mit dem höchsten Score-Wert)
als Referenzbild verwendet, es sei denn, Sie wählen über das <A href="userguide.htm#contextmenu">Kontext-Menü</A> ein anderes Referenzbild. <br>
DeepSkyStacker berechnet nun für die anderen Aufnahmen jede Abweichung und Winkeländerung in Bezug zu dem Referenbild.<br>
<br>
Der Versatz und der Rotationswinkel für jedes Bild, werden mit Hilfe einer Stern-Identifizierungs-Schablone berechnet.<br>
Ganz einfach ausgedrückt, sucht ein Algorithmus, die größtmöglichen Dreiecke, bei denen die Seitenabstände (und somit die Winkel zwischen den Seiten) am n ächsten sind.<br>
Wenn eine ausreichende Menge dieser Dreiecke zwischen dem Referenzbild und den restlichen auszurichtenden Bildern entdeckt wurde, berechnet DeepSkyStacker daraus den Offset und die Rotation. Mit Hilfe der "kleinsten Quadrat" Methode werden die festgestellten Abweichungen korrigiert.<br>
Abhängig von der Anzahl der entdeckten Sterne, wird dazu die Bisquared- oder Bilineare-Transformation verwendet.</span></p>
<p align="justify" style="MARGIN-TOP: 0px"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><br>
Mehr Informationen über den Algorithmus, der mich zur Verwendung bei <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">DeepSkyStacker inspiriert hat, </span>finden Sie auf den folgenden Seiten:</span><font size="2" face="Arial"><br>
<a target="_blank" href="http://adsabs.harvard.edu/cgi-bin/nph-bib_query?bibcode=1995PASP..107.1119V&db_key=AST&high=39463d35aa24090">
FOCAS Automatic Catalog Matching Algorithms</a><br>
<a target="_blank" href="http://lear.inrialpes.fr/pubs/2004/MR04/">Pattern
Matching with Differential Voting and Median Transformation Derivation</a></font></p>
<p align="justify"><font face="Arial" size="2"><b><a name="stackinfofile"></a>
Automatische Verwendung der zuvor berechneten Offsets und Winkel
<br>
</b>DeepSkyStacker speichert alle relevanten Informationen zur Umwandlung zwischen dem Referenzbild und allen anderen Bildern, sodass man, wenn man die Registrierungs-Einstellungen nicht ändert, das Bild nicht ein zweitesmal registrieren muß.<br>
Diese Info ist in einer Datei mit dem Namen des Referenzbildes (auch im gleichen Ordner) und der Endung<i>.stackinfo.txt</i> gespeichert.</font></p>
<hr color="#0000ff">
<p align="justify"><b><font face="Arial" size="4" color="#ff0000">
<a name="FileGroups"></a>Datei-Gruppen<br>
</font></b><font size="2" face="Arial"><a name="filegroup"></a>Datei-Gruppen machen es sehr einfach, sogenannte "mehrere Nächte an dem gleichen Objekt" Bilddateien zu verwalten, indem man logische Gruppen für jede Fotonacht bildet.<br>
<b>Wenn sie nur die <i>Haupt-Gruppe verwenden, arbeitet</i> DeepSkyStacker so, wie vor der Einführung von Datei-Gruppen.</b><br>
<br>
Es gibt zwei Arten von Datei-Gruppen: die Haupt-Gruppe und all die anderen Gruppen.</font></p>
<ul>
<li>
<p align="justify"><font size="2" face="Arial">Lightframes der <i>Haupt-Gruppe </i>können nur mit Dark-, Flat- und Offset/Biasframes, die sich ebenfalls in der <i>Haupt-Gruppe</i> befinden, in Verbindung gebracht werden. <br>
Dies ist genau die Arbeitsweise von DeepSkyStacker, vor der Einführung der Datei-Gruppen.</font></p>
<li>
<p align="justify"><font size="2" face="Arial">Dark-, Flat- und Offset/Biasframes der Haupt-Gruppe können allerdings auch für Lightframes anderer Gruppen verwendet werden.</font></p>
<li>
<p align="justify"><font size="2" face="Arial">Dark-, Flat- und Offset/Biasframes von anderen Gruppen können nur mit Lightframes der gleichen Gruppe verbunden werden.</font></p>
</li>
</ul>
<p align="justify"><font size="2" face="Arial">Sie können so viele Datei-Gruppen erstellen wie Sie wollen, sollten aber wissen, dass eine Datei immer nur zu <strong>einer</strong> Datei-Gruppe gehören kann.<br>
Beim Start von DeepSkyStacker ist immer nur die Haupt-Gruppe verfügbar. Sobald Sie aber der letztmöglichen Gruppe eine Datei anfügen, wird sofort eine neue, leere Gruppe erstellt.<br>
<br>
<b>Beispiel:<br>
</b>Sie fotografieren das gleiche Objekt zwei Nächte hintereinander. <br>
Von jeder Nacht haben Sie eine Reihe von Light-, Dark- und Flatframes, aber die Außentemperatur war in den Nächten unterschiedlich. Die Darkframes sind also nicht kompatibel, ebenso wie die Flatframes, da die Kamera in jeder Nacht etwas unterschiedlich am OAZ saß.<br>
<br>
Um jedes Lightframe mit den passenden Dark und Flatframes zu verbinden, müssen Sie alle Light+Dark+Flatframes der ersten Nacht in eine Datei-Gruppe geben und alle Light+Dark+Flatframes der zweiten Nacht in eine andere Datei-Gruppe.<br>
Nur die Offset/Biasframes waren natürlich in beiden Nächten gleich und kommen somit in die <i>
Haupt-Gruppe</i>.<br>
<br>
DeepSkyStacker bringt nun automatisch die Lightframes der ersten Nacht mit den Dark- und Flatframes der ersten Nacht und die Lightframes der zweiten Nacht mit den Dark- und Flatframes der zweiten Nacht zusammen. <br>
Die Offset/Biasframes, die sich in der Haupt-Gruppe befinden, werden mit den Lightframes der ersten <strong>und</strong> der zweiten Nacht verbunden.</font></p>
<div class="MsoNormal" align="center" style="TEXT-ALIGN: center">
<span lang="EN-US">
<hr size="2" width="100%" noshade color="blue" align="center"></span>
</div>
<p align="justify"><b>
<span lang="EN-US" style="FONT-SIZE: 13.5pt; FONT-FAMILY: Arial; COLOR: red">
<a name="Stacking"></a>Stacking</span><span lang="EN-US" style="FONT-FAMILY: Arial"><br>
<font size="2"><a name="backgroundcalibration"></a>Hintergrund-Kalibrierung</font></span></b><font face="Arial"><b><br>
</b><font size="2">Die Hintergrund-Kalibrierung besteht aus einer Normalisierung und Anpassung des Hintergrundwertes für jedes Bild, noch vor dem Stacking-Prozess.<br>
Der Hintergrundwert ist definiert als der Mittelwert aller im Bild befindlichen Pixel.</font></font></p>
<p align="justify"><font face="Arial" size="2">Zwei Optionen sind verfügbar:</font></p>
<ul>
<li><font face="Arial" size="2">Mit der Option <b>Pro Kanal
Hintergrund-Kalibrierung</b> wird der Hintergrund des Referenz-Bildes für jeden Kanal separat eingestellt.</font></li>
</ul>
<ul>
<li><font face="Arial" size="2">Mit der <b>RGB Kanäle-Kalibrierung</b> werden alle drei Kanäle ( <font color="#ff0000">rot</font>,
<font color="#008000">grün</font> und <font color="#0000ff">blau)</font>
jedes Lightframes dem gleichen Hintergrundwert, welcher dem Minimum der drei Medianwerte (einen für jeden Kanal) entspricht, aus dem Referenzframe berechnet und angepasst. Am Anfang der Berechung kompatibler Bilder (Stackweise) erstellt diese Option einen neutralgrauen Hintergrund. Ein Nebeneffekt dieser Anpassung ist, dass die gesamte Sättigung des gestackten Bildes dadurch sehr niedrig wird (sieht wie ein Graustufenbild aus).</font></li>
</ul>
<p align="justify" style="MARGIN-BOTTOM: 0px"><font face="Arial" size="2">Es ist sehr wichtig, eine von den beiden Optionen bei der Verwendung der Kappa-Sigma Clipping oder
Kappa-Sigma Clipping Median-Methode auszuwählen, um zu gewährleisten, dass alle zum Stacken anstehende Bilder den gleichen Hintergrundwert haben. </font></p>
<hr color="#0000ff" size="1">
<p align="justify"><font face="Arial"><font size="2">
<b><a name="flatcalibration"></a>Automatische Kalibrierung der Flatframes</b></font><b><br>
</b><font size="2">Der Sinn einer automatischen Kalibrierung der Flatframes liegt darin, bestehende Unterschiede in der Luminanz zwischen den einzelnen Flatframes auszugleichen, bevor daraus ein Master-Flat erstellt wird.<br>
<br>
Das erste Flatframe wird dabei als Referenzbild verwendet. Alle anderen Flatframes werden auf die durchschnittliche Luminanz und Dynamik dieses Referenz-Flats angepasst.</font></font></p>
<hr color="#0000ff" size="1">
<p align="justify"><font face="Arial"><font size="2">
<b><a name="hotpixelsremoval"></a>Automatische Erkennung und Entfernung von Hot-Pixel</b></font><b><br>
</b><font size="2">Ziel dieser automatischen Erkennung und Entfernung von Hot-Pixel ist, der Austausch des Hot-Pixels mit einem durchschnittlichen Nachbar-Pixel.<br>
<br>
Zuerst werden dazu die Darkframes (oder das Master-Dark, falls vorhanden) analysiert und nach Hot-Pixel durchsucht. Jedes Pixel, dessen Wert größer als
[Median] + 16 x [Standardabweichung] (Sigma) ist, wird als Hot-Pixel markiert.<br>
<br>
<font face="Arial">Die Entfernung der Hot-Pixel besteht dann in einem Austausch der Pixel mit einem Pixel, dessen Wert einem durchschnittlichen (berechneten) Nachbarpixel entspricht.</font></font></font></p>
<hr color="#0000ff" size="1">
<p align="justify"><font face="Arial"><font size="2">
<b><a name="badlinesdetection"></a>Automatische Erkennung und Entfernung von fehlerhaften Zeilen</b></font><b><br>
</b><font size="2">Auf einigen monochromen CCD-Sensoren befinden sich ganze Zeilen, die entweder tot, oder komplett gesättigt (Hot-Pixel Zeilen) sind.<br>
<br>
In diesen Fällen sollte die automatische Erkennung und Entfernung von fehlerhaften Zeilen eingesetzt werden.<br>
Sie erkennt automatisch 1 Pixelbreite, vertikale Zeilen, die entweder total übersättigt oder tot sind und verfährt mit ihnen, wie bei der Hot-Pixel-Korrektur. Der Wert jedes fehlerhaften Pixel dieser Zeile, wird mit einem durchschnittlichen (berechneten) Nachbarpixelwert interpoliert.</font></font></p>
<hr color="#0000ff" size="1">
<p align="justify"><font face="Arial"><font size="2">
<b><a name="darkentropy"></a>Auf Entropie basierende Darkframe Subtraktion</b></font><b><br>
</b><font size="2">Das Subtrahieren der Darkframes kann bei Bedarf optimiert werden, sodass die Entropie des Bildresultats (Lightframe minus Darkframe) durch die Anwendung eines Koeffizienten zwischen 0 und 1 auf das Darkframe minimiert wird.<br>
Der wichtigste Anwendungsbereich dieser Option ist die Verwendung von Darkframes, die nicht unter optimalen Bedingungen entstanden sind (insbesondere in Bezug auf die genaue Temperatur).<br>
</font></font><font size="2" face="Arial"><br>
Mehr Information über diese Methode können sie hier erfahren (Pdf. Datei in englischer Sprache) <br>
<A href="https://www.cs.ubc.ca/labs/imager/tr/2001/goesele2001a/goesele.2001a.pdf" target=_blank>
Entropy-Based Dark Frame Subtraction</A></font></p>
<hr color="#0000ff" size="1">
<p align="justify" style="MARGIN-BOTTOM: 0px"><b>
<span lang="EN-US" style="FONT-FAMILY: Arial">Stacking-Prozess<br>
</span></b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Der Stacking-Prozess von DeepSkyStacker ist eigentlich sehr klassisch.</span></p>
<p align="justify" style="MARGIN-TOP: 0px"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><br>
<b>Schritt 1<br>
</b>Erstellung des Master-Offset aus allen Offsetframes (mit der gewählten Methode).<br>
Ist mehr als ein Offsetframe ausgewählt, wird das daraus erstellte Master-Offset unter dem Dateinamen
MasterOffset_ISOxxx.tif (TIFF 8, 16 oder 32 Bit) im Ordner des ersten Offset gespeichert.<br>
In den folgenden Schritten wird nur noch dieses Master-Offset verwendet werden.<br>
<br>
<b>Schritt 2<br>
</b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Erstellung des Master-Darks aus allen Darkframes (mit der gewählten Methode).</span> Vor der Erstellung des Master-Dark wird von jedem Darkframe, das zuvor gespeicherte Master-Offset subtrahiert.<br>
<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Ist mehr als ein Darkframe ausgewählt, wird das daraus erstellte Master-Dark unter dem Dateinamen </span> MasterDark_ISOxxx_yyys.tif (TIFF 8, 16 oder 32 Bit) im Ordner des ersten Darkframes gespeichert.<br>
<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">In den folgenden Schritten wird nur noch dieses Master-Dark verwendet werden.</span><br>
<br>
Erstellung des Master-Dark Flat aus allen Dark-Flatframes (mit der gewählten Methode). <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Vor der Erstellung des Master-Dark Flat wird von jedem Dark-Flatframe, das zuvor gespeicherte Master-Offset subtrahiert.</span><br>
<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Ist mehr als ein Dark-Flatframe ausgewählt, wird das daraus erstellte Master-Dark Flat unter dem Dateinamen</span></span> MasterDarkFlat_ISOxxx_yyys.tif (TIFF 8, 16 oder 32 Bit) <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">im Ordner des ersten Dark-Flatframes gespeichert.</span><br>
<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">In den folgenden Schritten wird nur noch dieses Master-Dark Flat verwendet werden.</span></span><br>
<br>
<b>Schritt 3<br>
</b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Erstellung des Master-Flat aus allen Flatframes (mit der gewählten Methode)</span></span>. <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Vor der Erstellung des Master-Flat, wird von jedem Flatframe das zuvor gespeicherte Master-Offset und Master Dark Flat subtrahiert.</span> Das Master-Flat ist automatisch kalibriert.<br>
<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Ist mehr als ein Flatframe ausgewählt, wird das daraus erstellte Master-Flat unter dem Dateinamen</span></span></span> MasterFlat_ISOxxx.tif (TIFF 8, 16 oder 32 Bit) <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">im Ordner des ersten Flatframes gespeichert.</span></span><br>
<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">In den folgenden Schritten wird nur noch dieses Master-Flat verwendet werden.</span></span></span><br>
<br>
<b>Schritt 4<br>
</b>Berechnung des Offsets (Versatz) und der Rotation aller Lightframes, die gestackt werden sollen.<br>
<br>
<b>Schritt 5<br>
</b>Erstellung des fertigen Bildes durch Addition aller Lightframes (mit der gewählten Methode). <br>
Das Master-Offset und das Master-Dark werden dabei automatisch von jedem Lightframe abgezogen und das Resultat durch das kalibrierte Master-Flat geteilt. Dann werden, wenn diese Option ausgewählt wurde, die im Darkframe erkannten Hot-Pixel entfernt und mit dem aus den Nachbarpixel interpolierten Wert ersetzt.<br>
<br>
<b>Schritt 6<br>
</b>Wenn die Funktion <A style="TEXT-DECORATION: underline; COLOR: blue; text-underline: single" href="#bayerdrizzle">Bayer Drizzle</A> aktiviert ist, werden die drei RGB Komponenten zur Vermeidung von Informations-Fehlstellen normalisiert.<br>
<br>
<b>Schritt 7<br>
</b>Das fertige Bild wird automatisch im Ordner des ersten Lightframe als AutoSave.tif Datei gespeichert.</span></p>
<hr color="#0000ff" size="1">
<p align="justify"><b>
<span lang="EN-US" style="FONT-FAMILY: Arial"><a name="ChannelsAlignment"></a>
Ausrichtung der RGB Kanäle<br>
</span></b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Wenn Sie diese Option ausgewählt haben, versucht DeepSkyStacker die drei Farb-Kanäle gegeneinander auszurichten, um eine Farbverschiebung im fertigen Bild zu reduzieren.<br>
Der daraus resultierende Haupteffekt ist, dass die Sterne nicht mehr an einer Seite rot und an der anderen Seite blau sind.<br>
<br>
Jeder Kanal wird dabei registriert (Sterne werden erkannt), damit eine Umwandlung zwischen dem besten und den beiden anderen Kanälen berechnet werden kann.<br>
In der Umwandlungsphase werden nun die beiden als nicht so perfekt eingestuften Kanäle auf den besten Kanal ausgerichtet.</span></p>
<hr color="#0000ff" size="1">
<p align="justify"><b>
<span lang="EN-US" style="FONT-FAMILY: Arial"><a name="reusemasters"></a>
Automatische Verwendung zuvor erstellter Master-Dateien<br>
</span></b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Vorhandene Master-Dateien (Dark, Bias, Flat und Dark Flat) die in einer Dateiliste erstellt wurden, werden automatisch solange wie möglich verwendet werden, wenn:<br>
- Die Dateiliste sich nicht verändert hat.<br>
- Die Einstellungen zum Erstellen nicht modifiziert wurden. Dies beinhaltet auch die Auswahl der Kombinations-Methode, die eingestellten Parameter und die RAW bzw. FITTS DDP- Einstellungen bei der Verwendung von RAW oder FITS Dateien.<br>
<br>
Eine Text-Datei, die alle Angaben, Parameter und die Auflistung der verwendeten Dateilisten zum Erstellen des fertigen Bildes enthält, ist im Ordner des fertigen Bildes gespeichert.<br>
Die Datei hat den Namen des fertigen Bildes mit dem Dateianhang <strong>.Description.txt.</strong><br>
<br>
Wenn die Beschreibung in dieser Datei mit eventuell neuen Einstellungen nicht übereinstimmt, werden automatisch wieder neue Master-Dateien erstellt.<br>
<br>
Dieses Feature ist hauptsächlich für Anwender, die eine schnelle Verarbeitung mit unveränderten Master-Dateien ausführen wollen.</span></p>
<hr color="#0000ff" size="1">
<p align="justify"><b><font face="Arial"><a name="customrect"></a>Verwendung des Auswahlrechtecks</font></b><font face="Arial"><b><br>
</b><font size="2">Sie können DeepSkyStacker mit Hilfe eines Auswahlrechtecks die gewünschte Größe und Position des fertigen Bildes (Endresultat) angeben.<br>
<br>
Zuerst brauchen Sie natürlich ein Vorschaubild, das Sie in der Dateiliste auswählen und mit einem Klick öffnen. Sie können irgendein Lightframes auswählen, aber wenn Sie mit dem Auswahlrechteck den Bereich auswählen, der das spätere, fertige Bild zeigt, sollten Sie besser das Referenz-Lightframe verwenden (das mit dem höchsten Score-Wert, oder das, welches Sie selbst als Referenz-Lightframe mit dem <A href="userguide.htm#contextmenu">Kontextmenü</A> ausgewählt haben). <br>
<br>
Dann müssen Sie nur noch, mit gedrückter linker Maustaste, ein Auswahlrechteck in gewünschter Größe aufziehen. Dieses Rechteck lässt sich natürlich frei auf dem Bild verschieben.<br>
Wenn Sie nun den Stacking-Prozess starten, verwendet DeepSkyStacker standardmäßig dieses erstellte Rechteck. Sie brauchen dies nicht irgendwo nocheinmal auszuwählen.<br>
<br>
Diese Option ist sehr hilfreich, wenn Sie bei ausgewählter<A href="#Drizzle">
Drizzle Option</A>, die ja das fertige Bild verdoppelt bzw. verdreifacht, den benötigten Arbeitsspeicher beim Stacking-Prozess und den benötigten Speicherplatz auf der Festplatte verringern wollen.<br>
<br>
Bei der Verwendung des Auswahlrechtecks benötigt DeepSkyStacker nur den Arbeitsspeicher und Festplattenplatz für ein Bild in der Größe des Rechtecks. Die außerhalb befindlichen Bildpartien werden in den Berechnungsprozess nicht mit eingebunden.</font></font></p>
<div class="MsoNormal" align="center" style="TEXT-ALIGN: center">
<span lang="EN-US">
<hr size="2" width="100%" noshade color="blue" align="center"></span>
</div>
<p align="justify"><b><font face="Arial" color="#ff0000"><a name="stackingmethods"></a>Stacking Methoden</font><font face="Arial" size="2"><br>
<font color="#800000">Durchschnitt</font><br>
</font>
</b><font face="Arial" size="2">Dies ist eine einfache Methode. Der Durchschnittswert für alle im Stack befindlichen Pixel wird für jedes Pixel berechnet.<br>
<br>
<b><font color="#800000">Median</font><br>
</b>Dies ist die Standard-Methode beim Erstellen des Master-Dark, Flat und
Offset/Bias. Der Mittelwert für alle im im Stack befindlichen Pixel wird für jedes Pixel berechnet.<br>
<br>
<b><font color="#800000">Maximum</font><br>
</b>Dies ist eine extrem einfache Methode, die mit größter Sorgfalt angewendet werden sollte. Es wird dabei der Maximalwert aller im Stack befindlichen Pixel für jedes Pixel berechnet.<br>
Diese Methode kann ganz sinnvoll sein, wenn man herausfinden will, was an einem Stack schiefgelaufen ist, da man alle Defekte der kalibrierten Bilder damit sichtbar macht.<br>
<br>
<b><font color="#800000">Kappa-Sigma Clipping</font><br>
</b>Diese Methode wird verwendet, um abweichende Pixel iterativ auszusondern.<br>
Dazu werden zwei Parameter gesetzt: Die Anzahl der Iterationen (Wiederholungen) und der Multiplikationsfaktor (Kappa), mit dem die Standard-Abweichung (Sigma) multipliziert wird.<br>
Bei jeder der eingestellten Wiederholungen wird erneut die Standard-Abweichung (Sigma) der Pixel im Stack berechnet.<br>
Jedes Pixel, dessen Wert dabei am weitesten von dem errechneten Wert (Kappa * Sigma) entfernt ist, wird ausgesondert.<br>
Der Mittelwert der Pixel, auf das sich die Sigma-Abweichung bezieht, wird aus den verbliebenen Pixel des Stacks berechnet.</font></p>
<p align="justify"><font face="Arial" size="2">
<b><font color="#800000">Median Kappa-Sigma Clipping</font><br>
</b>Diese Methode ist ähnlich wie die Kappa-Sigma Clipping-Methode, aber anstatt die Pixel, deren Werte nicht stimmen, auszusondern, werden sie durch Pixel mittleren Wertes ersetzt.</font></p>
<p align="justify"><font face="Arial" size="2"><font color="#800000"><b>Auto Adaptive Weighted
Average</b></font><br>
Die Weighted Average-Methode (gewichteter Durchschnitt) ist
eine Anlehnung an die Arbeit von Dr. Peter B. Stetson (
<A href="https://ned.ipac.caltech.edu/level5/Stetson/Stetson_contents.html" >
The Techniques of Least Squares and Stellar Photometry with
CCDs</A> - Peter B. Stetson 1989). Datei in englischer Sprache).</font></p>
<p align="justify"><font face="Arial" size="2">
Diese Methode berechnet einen robusten Durchschnitt. Diesen Durchschnitt erhält sie mit einer iterativen Gewichtung der Abweichung jedes Pixel vom Mittelwert zur vergleichsweisen Standard-Abweichung.<br>
<br>
<font color="#800000"><b>Entropy Weighted Average (High Dynamic Range)</b></font><br>
Diese Methode basiert auf der Arbeit von German, Jenkin und Lesperance (<a target="_blank" href="http://doi.ieeecomputersociety.org/10.1109/CRV.2005.38">see
Entropy-Based image merging - 2005</a> in englischer Sprache). Sie wird verwendet um beim Stacken jedem Pixel die beste Dynamik zu geben.<br>
Sie ist besonders nützlich beim Stacken von Bildern mit unterschiedlichen Belichtungszeiten oder ISO Werten, da somit ein Bild ensteht, das die bestmögliche Dynamik aufweist. So ist es sehr einfach, ausgebrannte Galaxienkerne oder Nebel-Zentren (z.B M42) zu vermeiden.<br>
Hinweis: Diese Methode ist sehr CPU- und speicherintensiv.</font></p>
<span lang="EN-US">
<hr size="2" width="100%" noshade color="blue" align="center">
</span><p align="justify" style="MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px"><b><font face="Arial" size="4" color="#ff0000">
<a name="Drizzle"></a>Drizzle</font></b><br>
<font face="Arial" size="2"> Drizzle ist eine von der NASA entwickelte Methode für die
Hubble Deep Field Observations des Hubble Space Telescope.<br>
Dieser Berechnungs-Algorithmus ist auch bekannt unter dem Namen <strong>Variable Pixel Linear Reconstruction</strong>.<br>
<br>
Es verfügt über eine breite Palette von Möglichkeiten, mit denen die Auflösung eines gestackten Bildes, im Vergleich zu den verwendeten Einzelbildern enorm verbessert wird, während die eigentlichen Eigenschaften des Bildes (Farbe, Helligkeit usw.) erhalten bleiben.</font></p>
<span lang="EN-US"></span><span lang="EN-US"><table border="0" cellspacing="1" width="100%" id="AutoNumber4">
<tr>
<td width="40%" valign="top">
<p class="Standard">
<span lang="EN-US">
<font face="Arial" size="2">Grundsätzlich wird dabei jedes Bild unmittelbar vor dem Stacking-Prozess abgetastet, zwei bis dreifach vergrößert (möglich wäre jeder Wert größer als 1, aber DeepSkyStacker gibt nur die Möglichkeit 2x oder 3x als verfügbaren Wert vor) und dann auf ein feineres Pixelraster projeziert.<br>
<br>
Als Folge davon wird sich die Größe des fertigen Bildes verdoppeln (oder verdreifachen) und kleine Details im Bild, die vorher nur ein paar Dutzend Pixel bedeckten, nun die zwei oder dreifache Menge an Pixel abdecken. Durch die Verteilung der Details auf mehr Pixel, wird auch die Nachbearbeitung des Bildes erleichtert.</font></span></p></td>
<td width="60%">
<p align="center">
<IMG border=0 src="../images/Drizzle.jpg" width=250 align=center height=250></p></td>
</tr>
<tr>
<td width="40%" valign="top">
<p class="Standard"><font face="Arial" size="2">
<span lang="EN-US">
<b>Wie und wann verwendet man die Drizzle-Option</b><br>
Im Grunde brauchen Sie nur eine Menge Bilder, die noch nicht einmal perfekt ausgerichtet sein müssen (ein paar Pixel Drift ist genug). <br>
Es macht keinen Sinn, die Drizzle-Funktion anzuwenden, wenn Sie nur ein paar Lightframes haben.<br>
<br>
Drizzling ist besonders gut zur Verbesserung der Auflösung und somit ideal, wenn Sie ein relativ kleines Objekt mit kurzer Brennweite aufgenommen haben.<br>
<br>
Rechts sehen Sie ein Beispiel eines fast unbearbeiteten M57 (Aufgenommen mit einem 10", F/D
4.72 OTA und einer Canon DSLR).<br>
<br>
Normalerweise ist M57 dann sehr klein abgebildet. Aber mit der 2x Drizzle-Funktion und ca. 100 Lightframes ist das fertige Bild zweimal so groß (4x soviel Fläche?) und zeigt eine erheblich bessere Auflösung.<br>
<br>
Fahren Sie mit der Maus über diese Links und sehen Sie selbst.<br>
<A onmouseover="document['DRIZZLE01'].src='../images/M57_NoDrizzle.jpg';;document.getElementById('DRIZZLELEGEND01').innerHTML='M57 - ohne Drizzle - 4-fach vergrößert';" href="javascript:void(0);">
unbearbeiteter M57 - ohne Drizzle (4-fach vergrößert)</A><br>
<A onmouseover="document['DRIZZLE01'].src='../images/M57_Drizzle.jpg';;document.getElementById('DRIZZLELEGEND01').innerHTML='M57 - 2x Drizzle - 2-fach vergrößert';" href="javascript:void(0);">
unbearbeiteter M57 - 2x Drizzle (2-fach vergrößert)</A></span></font></p></td>
<td width="60%">
<p align="center">
<IMG id=DRIZZLE01 border=0 name=DRIZZLE01 src="../images/M57_NoDrizzle.jpg" width=411 height=353><br>
<font face="Arial" size="2"><b id="DRIZZLELEGEND01" name="DRIZZLELEGEND01">M57 - ohne Drizzle</b></font></p></td>
</tr>
</table>
</span><p align="justify" style="MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px"><span lang="EN-US"><font face="Arial" size="2"><b>Nebeneffekte des Drizzling</b><br>
Der Haupt-Nebeneffekt ist, dass der benötigte Arbeitsspeicher und Festplattenplatz zum Erstellen und Verarbeiten von Drizzle-Bildern um das Quadrat des Drizzling-Faktors (2-fach Drizzling =2x2 =4 fach) ansteigt. Dass dadurch natürlich auch die benötigte Zeit zum Verarbeiten um den gleichen Faktor ansteigt, sollte man auch unbedingt vorher bedenken.<br>
<br>
Beispiel: Bei der Verwendung von 2x Drizzle mit einem 3000x2000 Pixel großen Bild, werden Sie als Ergebnis ein Bild in der Größe von 6000x4000 Pixel erhalten, welches den 4-fachen Arbeitsspeicher und Festplattenplatz benötigt und natürlich eine erheblich längere Zeit zum Erstellen benötigt.<br>
<br>
Wenn Sie die 3x Drizzle Option verwenden, benötigen Sie schon 9x soviel Speicher- und Festplattenplatz (3 im Quadrat). Sollten Sie die Verarbeitung nicht auf einem wirklich super leistungsfähigen Computer mit sehr viel Arbeitsspeicher und großer Festplatte ausführen, kann ich Ihnen nur abraten, die 3x Drizzle Option bei DSLR Bildern anzuwenden.<br>
<br>
Bei der Verarbeitung von kleinen Bildern (wie bei den ersten DSI und LPI
Kameras), kann die 3x Drizzle Funktion die Auflösung allerdings sehr verbessern.<br>
<br>
Ein guter Weg, den benötigten Speicher- und Festplattenplatz bei der Drizzle-Option zu reduzieren, ist die Verwendung eines <A href="#customrect">Auswahlrechtecks</A>.<br>
<br>
<b>Drizzle und Bayer Drizzle</b><br>
Obwohl es zwei Drizze-Methoden in DeepSkyStacker gibt (Drizzle + Bayer-Drizzle), ist es nicht empfehlenswert beide Methoden gleichzeitig zu verwenden.<br>
Wenn Sie versehentlich doch einmal beide Methoden ausgewählt haben, wird Ihnen DeepSkyStacker eine Warnmeldung einblenden.</font></span></p>
<span lang="EN-US"></span><span lang="EN-US"><hr size="2" width="100%" noshade color="blue" align="center">
</span>
<p align="justify" style="MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px"><span lang="EN-US"><b><font face="Arial" size="4" color="#ff0000">
<a name="cometstacking"></a>Kometen Stacking</font></b><br>
<font face="Arial" size="2">Kometen sind sehr schnelle Objekte. Wenn sie eine Serie Kometenbilder stacken, können zwei Dinge passieren:<br>
- Wenn die Ausrichtung zwischen den Bildern sich an den Sternen orientiert, wird der Komet neben den punktförmigen Sternen sehr unscharf abgebildet.<br>
- <span lang="EN-US"><font face="Arial" size="2">Wenn die Ausrichtung zwischen den Bildern sich am Kometen orientiert, wird der Komet </font></span>scharf abgebildet, inmitten von Sternen die als Strichspuren erscheinen.<br>
<br>
Mit Beginn der DeepSkyStacker Version 3.0 kamen zwei Komet-Stacking Optionen dazu:<br>
- Bilderstellung mit Ausrichtung auf den Kometen, mit Sternen als Strichspuren.<br>
- Bilderstellung mit Ausrichtung auf den Kometen <strong>und</strong> auf die Sterne, mit scharfer Abbildung von Komet und Sternen.<br>
<br>
Auf dem rechten Bild sehen Sie ein Beispiel der unterschiedlichen Komet-Stacking Methoden (Maus über die blaue Schrift bewegen zeigt das Ergebnis)</font></span></p>
<span lang="EN-US"></span><span lang="EN-US"><table border="0" cellspacing="1" width="100%" id="AutoNumber2">
<tr>
<td width="41%">
<p style="MARGIN-LEFT: 10px; MARGIN-RIGHT: 10px"><font face="Arial" size="2"><br>
<b><A onmouseover="document['COMETSTACK'].src='../images/FuzzyComet.jpg';" href="javascript:void(0);">
Standard Stacking</A></b><br>
Die Kometenposition wird ignoriert.<br>
Der Komet ist unscharf, die Sterne scharf.</font></p>
<p style="MARGIN-LEFT: 10px; MARGIN-RIGHT: 10px"><font face="Arial" size="2">
<b><A onmouseover="document['COMETSTACK'].src='../images/StarTrails.jpg';" href="javascript:void(0);">
Komet-Stacking : mit Sternstrichspuren</A></b><br>
Es wir auf den Komet ausgerichtet.<br>
Die Sternpositionen werden zur Berechnung der Feldrotation verwendet, um den Komet scharf und die Sterne als Strichspuren abzubilden.<br>
<br>
<b><A onmouseover="document['COMETSTACK'].src='../images/StarFreeze.jpg';" href="javascript:void(0);">
Komet- und Stern-Stacking : "Star Freeze" Effekt</A></b><br>
Die Kometenposition wird erfasst.<br>
In einem ersten Stackvorgang wird der genau erfasste Komet aus dem Hintergrund extrahiert.<br>
Im zweiten Stackvorgang wird auf die Sterne ausgerichtet. Der Komet ist aus jedem dieser kalibrierten und registrierten Lightframes bereits rausgerechnet, bevor gestackt wird.<br>
Zuletzt werden die zwei Bilder der Stacks zu einem Bild zusammengerechnet, wobei der Komet nun gemeinsam mit den Sternen scharf abgebildet wird.</font></p>
<p style="MARGIN-LEFT: 10px; MARGIN-RIGHT: 10px"
> </p>
</td>
<td width="59%" align="center">
<IMG id = COMETSTACK border = 0 name=COMETSTACK src="../images/FuzzyComet.jpg" width=472 height=366></td>
</tr>
</table>
</span><p align="justify" style="MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px"><span lang="EN-US"><font face="Arial" size="2"><br>
Wenn Sie vorhaben Ihre Kometenbilder nur auf die Sterne auszurichten (Standard-Stacking), brauchen Sie das, was in den folgenden Absätzen beschrieben wird nicht zu befolgen, da Sie ja die Standard-Methode verwenden.<br>
<br>
</font><font face="Arial"><b><font size="2">Was Sie tun müssen<br>
Schritt 1: Festlegen des Kometenzentrums</font><br>
</b></font><font face="Arial" size="2">DeepSkyStacker kann das Zentrum des Kometen in den Lightframes nicht automatisch bestimmen.<br>
<br>
Zuerst müssen Sie den Kometen <strong>in allen Lightframes</strong> festlegen. Dies brauchen Sie aber nur einmal zu tun.</font></span></p>
<span lang="EN-US"></span><span lang="EN-US"></span>
<p align="justify" style="MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px"><span lang="EN-US"><font face="Arial" size="2">Dazu öffnen Sie ein Lightframe aus der Liste und verwenden den <A href="userguide.htm#imagepreview">Edit Comet Mode</A> um das Kometenzentrum zu markieren.<br>
Wenn das Zentrum des Kometen zu schwach oder zu hell ist, können Sie DeepSkyStacker dazu zwingen, Ihre Positionsangabe zu akzeptieren, wenn Sie beim Markieren die Umschalttaste festhalten.<br>
<br>
Dann speichern Sie das Resultat mit einem Klick auf den "Änderungen speichern" Button (Diskettensymbol) in der Toolbar.<br>
Damit Sie den Speichervorgang nicht vergessen, werden Sie von DeepSkyStacker danach gefragt. In dieser Dialogbox können Sie dann auch, wenn gewünscht einstellen, dass die Änderungen zukünftig automatisch, ohne Nachfrage gespeichert werden.<br>
<br>
Sobald Sie die Kometenposition festgelegt und gespeichert haben, sehen Sie in der Spalte "Sterne" der Bilderliste ein +(C) vor der Sternanzahl des ausgewählten Bildes.<br>
<br>
Diesen Vorgang müssen Sie für jedes Lightframe wiederholen. </font></span></p>
<p align="justify" style="MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px"> </p>
<span lang="EN-US"></span><span lang="EN-US"></span><span lang="EN-US"><table border="1" cellspacing="1" width="100%" id="AutoNumber6" cellpadding="10">
<tr>
<span>
</span><td width="100%" bgcolor="#ffff99"><span><font face="Arial" size="2">
<b>Tipp<br>
</b> Wenn die Bildinfo ein genaues Datum+Uhrzeit der Aufnahme enthält (bei Verwendung von
DSLRs und einigen CCD Kameras) können Sie die Bilder nach Datum/Uhrzeit sortieren, bevor Sie in dem Ersten-, dem Letzten- und dem Referenzframe (das mit dem höchsten Score-Wert, wenn Sie nicht ein anderes mit dem Kontextmenü als Referenzframe festgelegt hatten) die Kometenposition festlegen.<br>
DeepSkyStacker errechnet nun automatisch (kurz vor dem Stacking) die Position des Kometen für alle dazwischenliegende Lightframes, bei denen das Kometenzentrum nicht festgelegt wurde. <br>
Dazu berechnet DeepSkyStacker die zwischen den markierten Aufnahmen verstrichene Zeit, um daraus die Kometenposition für jedes Lightframe zu interpolieren.</font></span></td>
<span></span>
</tr>
</table>
</span><span lang="EN-US"></span><p align="justify" style="MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px"> </p>
<p align="justify" style="MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px"><span lang="EN-US"><font face="Arial" size="2"> </font><font face="Arial"><b><font size="2">Schritt 2: Stacking-Modus festlegen</font><br>
</b></font><font face="Arial" size="2">Den Stacking-Modus können Sie im <span lang="EN-US"><font face="Arial" size="2"><A href="userguide.htm#comettab">Register "Komet"</A></font></span> des Stacking-Parameter Dialogs festlegen.<br>
Das Register "Komet" in den Stacking-Parameter ist nur dann sichtbar, wenn mindestens zwei Lightframes (inclusive desReferenz-Lightframes) eine registrierte Kometenposition haben (+(c)).<br>
In diesem Register können Sie einen Komet Stacking-Modus aus den drei angebotenen auswählen.<br>
<br>
<b>Mischung aus Bildern mit und ohne Komet</b><br>
DeepSkyStacker kann Lightframes mit einem registrierten Kometen und ohne einen registrierten Kometen <span lang="EN-US"><font face="Arial" size="2">im gleichen Stack verarbeiten</font></span>.<br>
Dies kann dann interessant sein, wenn Sie nur wenige Kometenaufnahmen haben und den SNR Wert erhöhen wollen, damit man feinere Details im Hintergrund besser erkennen kann (z.B. ein Komet passiert einen Nebel oder eine Galaxie, die Sie auch ablichten wollen).</font></span></p>
<span lang="EN-US"></span><span lang="EN-US"></span><p align="justify" style="MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px"><span lang="EN-US"><font face="Arial" size="2"><b>Welche Stacking-Methode?<br>
</b>Wenn Sie Kometenbilder mit Stern-Strichspuren erstellen, sollten Sie die <strong>Durchschnitt</strong> Stacking-Methode verwenden.<br>
In allen anderen Fällen sollten sie die Median (bei kleinen Stacks) oder die Kappa-Sigma (bei großen Stacks) Stacking-Methode verwenden.</font></span></p>
<span lang="EN-US"></span><span lang="EN-US"></span><p align="justify" style="MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px"><span lang="EN-US"><font face="Arial" size="2"><b>Welche Ergebnisse erwarten Sie</b></font></span></p>
<p align="justify" style="MARGIN-BOTTOM: 0px; MARGIN-TOP: 0px"><span lang="EN-US"><font face="Arial" size="2">Der anspruchsvollste Algorithmus ist der "Komet- und Stern-Stacking" Modus mit dem "Star Freeze" Effekt.<br>
Sehr langsame Kometen können dazu führen, dass andere Objekte, wie helle Sterne und große Objekte schlechter erkannt werden. In diesem Fall wird der Prozess zum Extrahieren des Kometen nicht so perfekt ausfallen.<br>
Egal, welche Methode Sie verwenden, wenn Sie die Möglichkeit haben von der gleichen Himmelsregion Aufnahmen ohne Komet
(ein paar Tage vorher oder nachher) in die Kometenbilder einzufügen, werden Sie das Endresultat erheblich verbessern.</font></span></p>
<span lang="EN-US"></span><span lang="EN-US"><hr size="2" width="100%" noshade color="blue" align="center"></span>
<p align="justify"><b>
<span lang="EN-US" style="FONT-SIZE: 13.5pt; FONT-FAMILY: Arial; COLOR: red">
<a name="rawdecod"></a>RAW Bilder Entwicklungsprozess</span><span lang="EN-US" style="FONT-FAMILY: Arial"><br>
</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">RAW-Dateien Dekodierung</span><span lang="EN-US" style="FONT-FAMILY: Arial"><br>
</span></b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
RAW-Dateien, die
mit DSLRs erstellt wurden, werden mit <U><FONT color=#0066cc>LibRaw</FONT></U> Copyright © 2008-2019 LibRaw
LLC, <SPAN
style='FONT-SIZE: 11pt; FONT-FAMILY: "Calibri","sans-serif"; mso-ascii-theme-font: minor-latin; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-theme-font: minor-bidi; mso-ansi-language: EN-GB; mso-fareast-language: EN-US; mso-bidi-language: AR-SA'>basierend
auf das originale DCRaw von Dave Coffin.</SPAN>
<br>
</span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><BR> DeepSkyStacker verwendet die neueste
verfügbare Version von LibRaw und wird sie warnen wenn Ihre Kamera
nicht unterstützt wird.<BR>
</span>
<span lang="EN-US"><BR>
<hr size="2" width="100%" noshade color="blue" align="center"></span>
<P></P>
<p align="justify"><b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">RAW-Dateien Entwicklungs-Prozess</span><span lang="EN-US" style="FONT-FAMILY: Arial"><br>
</span></b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Eine Datei ist in diesem Falle das Äquivalent eines "digitalen Negativs". Das bedeutet, dass jedes RAW "Negativ" auch entwickelt werden muß.<br>
Es gibt zwei Arten von RAW-Dateien: Die einen verwenden eine Bayer-Matrix (die meisten von ihnen) und die anderen brauchen keine Bayer-Matrix (wenn Sie z.B. einen Foveon-Chip benutzen).<br>
<br>
Die folgenden Erläuterungen beziehen sich <strong>ausnahmslos</strong> auf die RAW-Dateien, die mit einer DSLR erstellt wurden und somit eine Bayer-Matrix verwenden.</span></p>
<div class="MsoNormal" align="center" style="TEXT-ALIGN: center">
<span lang="EN-US">
<hr size="2" width="100%" noshade color="blue" align="center"></span>
</div>
<p align="justify"><b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Bayer
Matrix<br>
</span></b><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
Zunächt einmal zur Erinnerung: Was ist überhaupt eine Bayer-Matrix?<br>
Wenn Sie eine 8 Megapixel DSLR verwenden, enthält diese einen Schwarz-Weiß CMOS oder CCD Chip mit 8 Megapixel, auf denen eine Bayer-Matrix aufgeklebt wurde. Diese Bayer-Matrix ist nichts anderes, als winzig kleine Farbfilter (RGBG oder CYMK) in bestimmter Anordnung vor jedem Pixel.<br>
<br>
Im Falle eines RGBG Filtermusters sehen ein Viertel der Pixel nur <span style="COLOR: red">rot</span>, ein Viertel nur<span style="COLOR: blue"> blau</span>
und die Hälfte der Pixel nur <span style="COLOR: green">grün</span>.<br>
Also produziert Ihre 8 Megapixel DSLR Bilder, mit 2 Millionen roten Pixel, 2 Millionen blauen Pixel und 4 Millionen grünen Pixel.<br>
<br>
Wie kann also die DSLR "echte" Farbbilder erstellen?<br>
Sehr einfach, indem sie die fehlenden Primärfarben aus den benachbarten Pixel interpoliert. Interpolation ist hier also das Zauberwort. Das große Farbspektrum einer DSLR wird also aus diesen Farbpixel errechnet. Wo gerechnet wird, hat man immer die Möglichkeit verschiedene Rechenvarianten einzusetzen. </span></p>
<hr color="#0000ff">
<p><font size="2" face="Arial"><b>Farb-Rekonstruktion mit Verwendung einer Bayer-Matrix - <font color="#0000ff">
Interpolation</font></b></font></p>
<table border="0" cellpadding="0" cellspacing="0" style="BORDER-COLLAPSE: collapse" bordercolor="#111111" width="87%" id="AutoNumber1">
<tr>
<td width="51%">
<p class="Standard"><font size="2" face="Arial">Der erste Weg, die fehlenden Farben der Bayer-Matrix zu rekonstruieren besteht in der Interpolation der Nachbarpixel.</font></p>
<p class="Standard">
<font size="2" face="Arial">Es stehen eine Menge unterschiedlicher Interpolations-Methoden zur Verfügung, die mehr schlechte als rechte Ergebnisse produzieren (Linear, Gradient...), aber alle haben eines gemeinsam: Sie setzen die Qualität des fertigen Bildes dadurch herab, dass sie eigentlich nicht wissen können, wie die fehlenden Farben genau aussehen sollen. Hier ist natürlich Interpretationspielraum gegeben. </font>
<p class="Standard">
<font face="Arial" size="2">Jedes Bild wird durch den Interpolationsvorgang an Schärfe verlieren. Beim Stacking-Prozess werden die übereinander gelegten "leicht unscharfen" Bilder somit eine Menge an feinen Details nicht mehr so genau abbilden.<br>
<br>
Wenn Sie vorhaben, eine Interpolations-Methode zu verwenden, sollten Sie wissen, dass die mit Ihrer DSLR mitgelieferte Software wahrscheinlich die schlechteste Wahl ist, wenn es um den Erhalt der Qualität von so etwas Speziellem wie Astrobildern geht.<br>
<br>
Wenn Sie diese Software zum Umwandeln Ihrer RAW-Dateien in 16 Bit TIFF-Dateien verwenden und zum Vergleich die selbe Umwandlung in DeepSkyStacker durchführen, werden Sie augenblicklich den Unterschied feststellen.<br>
</font></p></td>
<td width="51%">
<IMG border=0 src="../images/BayerInterpolation.jpg" width=375 align=right height=285></td>
</tr>
</table>
<hr color="#0000ff">
<p><font size="2" face="Arial"><b><a name="superpixel"></a>Farb-Rekonstruktion mit Verwendung einer Bayer-Matrix - <font color="#0000ff">
Super-Pixel</font></b></font></p>
<table border="0" cellpadding="0" cellspacing="0" style="BORDER-COLLAPSE: collapse" bordercolor="#111111" width="87%" id="AutoNumber2">
<tr>
<td width="51%">
<p class="Standard"><font face="Arial" size="2">Mit DCRaw ist es möglich auf die Bayer-Matrix zuzugreifen, noch bevor eine Interpolation stattgefunden hat. So ist es möglich, ganz andere Methoden zur Rekonstruktion der echten Farben anzuwenden, als die Primärfarben per Interpolation zu erraten.</font></p>
<p class="Standard">
<font size="2" face="Arial">Die Super Pixel-Methode verzichtet auf Interpolation und erstellt stattdessen ein Super-Pixel aus jeder Pixel-Vierergruppe (RGBG).</font></p>
<p class="Standard"><font size="2" face="Arial"><br>
Jede dieser Vierergruppen enthält alle Informationen über die Primärfarbe und die Luminanz, die benötigt werden.<br>
Diese Methode ist wirklich einfach, hat aber den Nachteil (oder Vorteil?), dass die Bildgröße des Endresultats dadurch nur noch ein viertel so groß ist.<br>
<br>
Die Super-Pixel Methode führt zu sehr guten Resultaten, wenn nur wenige Aufnahmen zum Stacken zur Verfügung stehen.</font></p></td>
<td width="49%">
<IMG border=0 src="../images/BayerSuperPixel.jpg" width=373 align=right height=280></td>
</tr>
</table>
<p> </p>
<hr color="#0000ff">
<p><font size="2" face="Arial"><b><a name="bayerdrizzle"></a>Farb-Rekonstruktion mit Verwendung einer Bayer-Matrix - <font color="#0000ff">Bayer Drizzle</font></b></font></p>
<table border="0" cellpadding="0" cellspacing="0" style="BORDER-COLLAPSE: collapse" bordercolor="#111111" width="87%" id="AutoNumber3">
<tr>
<td width="51%">
<p class="Standard"><font size="2" face="Arial">Die letzte Methode, die von Dave Coffin empfohlen wird, nutzt die Eigenschaft des Stacking-Prozesses, die "natürliche" Pixel-Drift, zwischen den einzelnen Aufnahmen, um die wahren RGB Werte daraus zu errechnen.<br>
<br>
Wenn eine große Anzahl von Aufnahmen verfügbar ist, und diese subpixelgenau ausgerichtet werden, errechnet DeepSkyStacker Bit für Bit die echten Farbwerte jeden Pixels, ohne Interpolation.<br>
<br>
Nach dem Stacking-Prozess sorgt ein anderer Algorithmus für eine Normalisierung der RGB Werte, um Fehlstellen in der Information zu vermeiden.<br>
<br>
Die Bayer Drizzle-Methode führt zu hervorragenden Ergebnissen, wenn eine große Anzahl von Lightframes zur Verfügung steht und wenn die Guiding-Präzision über einem Pixel liegt (was eigentlich immer der Fall ist).</font></p></td>
<td width="49%">
<IMG border=0 src="../images/BayerDrizzle.jpg" width=375 align=right height=287></td>
</tr>
</table>
<p style="MARGIN-BOTTOM: 0px"> </p>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-7477345-1");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html> | {
"pile_set_name": "Github"
} |
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with this
* work for additional information regarding copyright ownership. The ASF
* licenses this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.apache.hadoop.ozone.om;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.hadoop.ozone.OzoneAcl;
import org.apache.hadoop.ozone.client.ObjectStore;
import org.apache.hadoop.ozone.client.OzoneBucket;
import org.apache.hadoop.ozone.security.acl.OzoneObj;
import org.apache.hadoop.ozone.security.acl.OzoneObjInfo;
import org.junit.Assert;
import org.junit.Test;
import java.util.List;
import java.util.BitSet;
import java.util.Collections;
import static org.apache.hadoop.ozone.OzoneAcl.AclScope.ACCESS;
import static org.apache.hadoop.ozone.OzoneAcl.AclScope.DEFAULT;
import static org.apache.hadoop.ozone.security.acl.IAccessAuthorizer.ACLIdentityType.USER;
import static org.apache.hadoop.ozone.security.acl.IAccessAuthorizer.ACLType.READ;
import static org.apache.hadoop.ozone.security.acl.IAccessAuthorizer.ACLType.WRITE;
/**
* Test Ozone Manager ACL operation in distributed handler scenario.
*/
public class TestOzoneManagerHAWithACL extends TestOzoneManagerHA {
@Test
public void testAddBucketAcl() throws Exception {
OzoneBucket ozoneBucket = setupBucket();
String remoteUserName = "remoteUser";
OzoneAcl defaultUserAcl = new OzoneAcl(USER, remoteUserName,
READ, DEFAULT);
OzoneObj ozoneObj = OzoneObjInfo.Builder.newBuilder()
.setResType(OzoneObj.ResourceType.BUCKET)
.setStoreType(OzoneObj.StoreType.OZONE)
.setVolumeName(ozoneBucket.getVolumeName())
.setBucketName(ozoneBucket.getName()).build();
testAddAcl(remoteUserName, ozoneObj, defaultUserAcl);
}
@Test
public void testRemoveBucketAcl() throws Exception {
OzoneBucket ozoneBucket = setupBucket();
String remoteUserName = "remoteUser";
OzoneAcl defaultUserAcl = new OzoneAcl(USER, remoteUserName,
READ, DEFAULT);
OzoneObj ozoneObj = OzoneObjInfo.Builder.newBuilder()
.setResType(OzoneObj.ResourceType.BUCKET)
.setStoreType(OzoneObj.StoreType.OZONE)
.setVolumeName(ozoneBucket.getVolumeName())
.setBucketName(ozoneBucket.getName()).build();
testRemoveAcl(remoteUserName, ozoneObj, defaultUserAcl);
}
@Test
public void testSetBucketAcl() throws Exception {
OzoneBucket ozoneBucket = setupBucket();
String remoteUserName = "remoteUser";
OzoneAcl defaultUserAcl = new OzoneAcl(USER, remoteUserName,
READ, DEFAULT);
OzoneObj ozoneObj = OzoneObjInfo.Builder.newBuilder()
.setResType(OzoneObj.ResourceType.BUCKET)
.setStoreType(OzoneObj.StoreType.OZONE)
.setVolumeName(ozoneBucket.getVolumeName())
.setBucketName(ozoneBucket.getName()).build();
testSetAcl(remoteUserName, ozoneObj, defaultUserAcl);
}
private boolean containsAcl(OzoneAcl ozoneAcl, List<OzoneAcl> ozoneAcls) {
for (OzoneAcl acl : ozoneAcls) {
boolean result = compareAcls(ozoneAcl, acl);
if (result) {
// We found a match, return.
return result;
}
}
return false;
}
private boolean compareAcls(OzoneAcl givenAcl, OzoneAcl existingAcl) {
if (givenAcl.getType().equals(existingAcl.getType())
&& givenAcl.getName().equals(existingAcl.getName())
&& givenAcl.getAclScope().equals(existingAcl.getAclScope())) {
BitSet bitSet = (BitSet) givenAcl.getAclBitSet().clone();
bitSet.and(existingAcl.getAclBitSet());
if (bitSet.equals(existingAcl.getAclBitSet())) {
return true;
}
}
return false;
}
@Test
public void testAddKeyAcl() throws Exception {
OzoneBucket ozoneBucket = setupBucket();
String remoteUserName = "remoteUser";
OzoneAcl userAcl = new OzoneAcl(USER, remoteUserName,
READ, DEFAULT);
String key = createKey(ozoneBucket);
OzoneObj ozoneObj = OzoneObjInfo.Builder.newBuilder()
.setResType(OzoneObj.ResourceType.KEY)
.setStoreType(OzoneObj.StoreType.OZONE)
.setVolumeName(ozoneBucket.getVolumeName())
.setBucketName(ozoneBucket.getName())
.setKeyName(key).build();
testAddAcl(remoteUserName, ozoneObj, userAcl);
}
@Test
public void testRemoveKeyAcl() throws Exception {
OzoneBucket ozoneBucket = setupBucket();
String remoteUserName = "remoteUser";
OzoneAcl userAcl = new OzoneAcl(USER, remoteUserName,
READ, DEFAULT);
String key = createKey(ozoneBucket);
OzoneObj ozoneObj = OzoneObjInfo.Builder.newBuilder()
.setResType(OzoneObj.ResourceType.KEY)
.setStoreType(OzoneObj.StoreType.OZONE)
.setVolumeName(ozoneBucket.getVolumeName())
.setBucketName(ozoneBucket.getName())
.setKeyName(key).build();
testRemoveAcl(remoteUserName, ozoneObj, userAcl);
}
@Test
public void testSetKeyAcl() throws Exception {
OzoneBucket ozoneBucket = setupBucket();
String remoteUserName = "remoteUser";
OzoneAcl userAcl = new OzoneAcl(USER, remoteUserName,
READ, DEFAULT);
String key = createKey(ozoneBucket);
OzoneObj ozoneObj = OzoneObjInfo.Builder.newBuilder()
.setResType(OzoneObj.ResourceType.KEY)
.setStoreType(OzoneObj.StoreType.OZONE)
.setVolumeName(ozoneBucket.getVolumeName())
.setBucketName(ozoneBucket.getName())
.setKeyName(key).build();
testSetAcl(remoteUserName, ozoneObj, userAcl);
}
@Test
public void testAddPrefixAcl() throws Exception {
OzoneBucket ozoneBucket = setupBucket();
String remoteUserName = "remoteUser";
String prefixName = RandomStringUtils.randomAlphabetic(5) +"/";
OzoneAcl defaultUserAcl = new OzoneAcl(USER, remoteUserName,
READ, DEFAULT);
OzoneObj ozoneObj = OzoneObjInfo.Builder.newBuilder()
.setResType(OzoneObj.ResourceType.PREFIX)
.setStoreType(OzoneObj.StoreType.OZONE)
.setVolumeName(ozoneBucket.getVolumeName())
.setBucketName(ozoneBucket.getName())
.setPrefixName(prefixName).build();
testAddAcl(remoteUserName, ozoneObj, defaultUserAcl);
}
@Test
public void testRemovePrefixAcl() throws Exception {
OzoneBucket ozoneBucket = setupBucket();
String remoteUserName = "remoteUser";
String prefixName = RandomStringUtils.randomAlphabetic(5) +"/";
OzoneAcl userAcl = new OzoneAcl(USER, remoteUserName,
READ, ACCESS);
OzoneAcl userAcl1 = new OzoneAcl(USER, "remote",
READ, ACCESS);
OzoneObj ozoneObj = OzoneObjInfo.Builder.newBuilder()
.setResType(OzoneObj.ResourceType.PREFIX)
.setStoreType(OzoneObj.StoreType.OZONE)
.setVolumeName(ozoneBucket.getVolumeName())
.setBucketName(ozoneBucket.getName())
.setPrefixName(prefixName).build();
ObjectStore objectStore = getObjectStore();
boolean result = objectStore.addAcl(ozoneObj, userAcl);
Assert.assertTrue(result);
result = objectStore.addAcl(ozoneObj, userAcl1);
Assert.assertTrue(result);
result = objectStore.removeAcl(ozoneObj, userAcl);
Assert.assertTrue(result);
// try removing already removed acl.
result = objectStore.removeAcl(ozoneObj, userAcl);
Assert.assertFalse(result);
result = objectStore.removeAcl(ozoneObj, userAcl1);
Assert.assertTrue(result);
}
@Test
public void testSetPrefixAcl() throws Exception {
OzoneBucket ozoneBucket = setupBucket();
String remoteUserName = "remoteUser";
String prefixName = RandomStringUtils.randomAlphabetic(5) +"/";
OzoneAcl defaultUserAcl = new OzoneAcl(USER, remoteUserName,
READ, DEFAULT);
OzoneObj ozoneObj = OzoneObjInfo.Builder.newBuilder()
.setResType(OzoneObj.ResourceType.PREFIX)
.setStoreType(OzoneObj.StoreType.OZONE)
.setVolumeName(ozoneBucket.getVolumeName())
.setBucketName(ozoneBucket.getName())
.setPrefixName(prefixName).build();
testSetAcl(remoteUserName, ozoneObj, defaultUserAcl);
}
private void testSetAcl(String remoteUserName, OzoneObj ozoneObj,
OzoneAcl userAcl) throws Exception {
// As by default create will add some default acls in RpcClient.
ObjectStore objectStore = getObjectStore();
if (!ozoneObj.getResourceType().name().equals(
OzoneObj.ResourceType.PREFIX.name())) {
List<OzoneAcl> acls = objectStore.getAcl(ozoneObj);
Assert.assertTrue(acls.size() > 0);
}
OzoneAcl modifiedUserAcl = new OzoneAcl(USER, remoteUserName,
WRITE, DEFAULT);
List<OzoneAcl> newAcls = Collections.singletonList(modifiedUserAcl);
boolean setAcl = objectStore.setAcl(ozoneObj, newAcls);
Assert.assertTrue(setAcl);
// Get acls and check whether they are reset or not.
List<OzoneAcl> getAcls = objectStore.getAcl(ozoneObj);
Assert.assertTrue(newAcls.size() == getAcls.size());
int i = 0;
for (OzoneAcl ozoneAcl : newAcls) {
Assert.assertTrue(compareAcls(getAcls.get(i++), ozoneAcl));
}
}
private void testAddAcl(String remoteUserName, OzoneObj ozoneObj,
OzoneAcl userAcl) throws Exception {
ObjectStore objectStore = getObjectStore();
boolean addAcl = objectStore.addAcl(ozoneObj, userAcl);
Assert.assertTrue(addAcl);
List<OzoneAcl> acls = objectStore.getAcl(ozoneObj);
Assert.assertTrue(containsAcl(userAcl, acls));
// Add an already existing acl.
addAcl = objectStore.addAcl(ozoneObj, userAcl);
Assert.assertFalse(addAcl);
// Add an acl by changing acl type with same type, name and scope.
userAcl = new OzoneAcl(USER, remoteUserName,
WRITE, DEFAULT);
addAcl = objectStore.addAcl(ozoneObj, userAcl);
Assert.assertTrue(addAcl);
}
private void testRemoveAcl(String remoteUserName, OzoneObj ozoneObj,
OzoneAcl userAcl) throws Exception{
ObjectStore objectStore = getObjectStore();
// As by default create will add some default acls in RpcClient.
List<OzoneAcl> acls = objectStore.getAcl(ozoneObj);
Assert.assertTrue(acls.size() > 0);
// Remove an existing acl.
boolean removeAcl = objectStore.removeAcl(ozoneObj, acls.get(0));
Assert.assertTrue(removeAcl);
// Trying to remove an already removed acl.
removeAcl = objectStore.removeAcl(ozoneObj, acls.get(0));
Assert.assertFalse(removeAcl);
boolean addAcl = objectStore.addAcl(ozoneObj, userAcl);
Assert.assertTrue(addAcl);
// Just changed acl type here to write, rest all is same as defaultUserAcl.
OzoneAcl modifiedUserAcl = new OzoneAcl(USER, remoteUserName,
WRITE, DEFAULT);
addAcl = objectStore.addAcl(ozoneObj, modifiedUserAcl);
Assert.assertTrue(addAcl);
removeAcl = objectStore.removeAcl(ozoneObj, modifiedUserAcl);
Assert.assertTrue(removeAcl);
removeAcl = objectStore.removeAcl(ozoneObj, userAcl);
Assert.assertTrue(removeAcl);
}
}
| {
"pile_set_name": "Github"
} |
# Copyright (c) 2008-2010, Intel Corporation.
# Copyright (c) 2006-2007, The Trustees of Stanford University.
# All rights reserved.
# Licensed under the terms of the New BSD License.
# Author: Mayur Naik ([email protected])
# name=threadIM-dlog
.include "M.dom"
.include "V.dom"
.include "H.dom"
.include "Z.dom"
.include "I.dom"
.include "T.dom"
.bddvarorder M0xM1xI0xI1_T0_V0xV1_T1_H0xH1_Z0
###
# Relations
###
IinvkArg(i:I0,z:Z0,v:V1) input
cha(m:M1,t:T1,n:M0) input
VH(v:V0,h:H0) input
HT(h:H0,t:T1) input
threadAllocI(i:I0) input
threadStartI(i:I0) input
excludeThreadStartI(i:I0) input
runCHA(h:H0,m:M0)
threadRunM(m:M0)
threadAllocIH0(i:I0,h:H0)
threadAllocIH1(i:I0,h:H0)
threadStartIH0(i:I0,h:H0)
threadIM(i:I0,m:M0) output
nonMainThreadM(m:M0) output
###
# Constraints
###
runCHA(h,n) :- cha("run:()[email protected]",t,n), HT(h,t).
threadRunM("run:()[email protected]").
threadAllocIH0(i,h) :- threadAllocI(i), IinvkArg(i,0,v), VH(v,h).
threadAllocIH1(i,h) :- threadAllocI(i), IinvkArg(i,1,v), VH(v,h).
threadAllocIH1(i,h) :- threadAllocI(i), IinvkArg(i,2,v), VH(v,h).
threadStartIH0(i,h) :- threadStartI(i), IinvkArg(i,0,v), VH(v,h), !excludeThreadStartI(i).
threadIM(i,m) :- threadStartIH0(i,h), runCHA(h,m), !threadRunM(m).
threadIM(i,n) :- threadStartIH0(i,h), runCHA(h,m), threadRunM(m), threadAllocIH0(i2,h), threadAllocIH1(i2,h2), runCHA(h2,n).
nonMainThreadM(m) :- threadIM(_,m).
| {
"pile_set_name": "Github"
} |
#ifndef _ASM_GENERIC_FCNTL_H
#define _ASM_GENERIC_FCNTL_H
#include <linux/types.h>
/*
* FMODE_EXEC is 0x20
* FMODE_NONOTIFY is 0x4000000
* These cannot be used by userspace O_* until internal and external open
* flags are split.
* -Eric Paris
*/
/*
* When introducing new O_* bits, please check its uniqueness in fcntl_init().
*/
#define O_ACCMODE 00000003
#define O_RDONLY 00000000
#define O_WRONLY 00000001
#define O_RDWR 00000002
#ifndef O_CREAT
#define O_CREAT 00000100 /* not fcntl */
#endif
#ifndef O_EXCL
#define O_EXCL 00000200 /* not fcntl */
#endif
#ifndef O_NOCTTY
#define O_NOCTTY 00000400 /* not fcntl */
#endif
#ifndef O_TRUNC
#define O_TRUNC 00001000 /* not fcntl */
#endif
#ifndef O_APPEND
#define O_APPEND 00002000
#endif
#ifndef O_NONBLOCK
#define O_NONBLOCK 00004000
#endif
#ifndef O_DSYNC
#define O_DSYNC 00010000 /* used to be O_SYNC, see below */
#endif
#ifndef FASYNC
#define FASYNC 00020000 /* fcntl, for BSD compatibility */
#endif
#ifndef O_DIRECT
#define O_DIRECT 00040000 /* direct disk access hint */
#endif
#ifndef O_LARGEFILE
#define O_LARGEFILE 00100000
#endif
#ifndef O_DIRECTORY
#define O_DIRECTORY 00200000 /* must be a directory */
#endif
#ifndef O_NOFOLLOW
#define O_NOFOLLOW 00400000 /* don't follow links */
#endif
#ifndef O_NOATIME
#define O_NOATIME 01000000
#endif
#ifndef O_CLOEXEC
#define O_CLOEXEC 02000000 /* set close_on_exec */
#endif
/*
* Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using
* the O_SYNC flag. We continue to use the existing numerical value
* for O_DSYNC semantics now, but using the correct symbolic name for it.
* This new value is used to request true Posix O_SYNC semantics. It is
* defined in this strange way to make sure applications compiled against
* new headers get at least O_DSYNC semantics on older kernels.
*
* This has the nice side-effect that we can simply test for O_DSYNC
* wherever we do not care if O_DSYNC or O_SYNC is used.
*
* Note: __O_SYNC must never be used directly.
*/
#ifndef O_SYNC
#define __O_SYNC 04000000
#define O_SYNC (__O_SYNC|O_DSYNC)
#endif
#ifndef O_PATH
#define O_PATH 010000000
#endif
#ifndef __O_TMPFILE
#define __O_TMPFILE 020000000
#endif
/* a horrid kludge trying to make sure that this will fail on old kernels */
#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
#define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT)
#ifndef O_NDELAY
#define O_NDELAY O_NONBLOCK
#endif
#define F_DUPFD 0 /* dup */
#define F_GETFD 1 /* get close_on_exec */
#define F_SETFD 2 /* set/clear close_on_exec */
#define F_GETFL 3 /* get file->f_flags */
#define F_SETFL 4 /* set file->f_flags */
#ifndef F_GETLK
#define F_GETLK 5
#define F_SETLK 6
#define F_SETLKW 7
#endif
#ifndef F_SETOWN
#define F_SETOWN 8 /* for sockets. */
#define F_GETOWN 9 /* for sockets. */
#endif
#ifndef F_SETSIG
#define F_SETSIG 10 /* for sockets. */
#define F_GETSIG 11 /* for sockets. */
#endif
#ifndef CONFIG_64BIT
#ifndef F_GETLK64
#define F_GETLK64 12 /* using 'struct flock64' */
#define F_SETLK64 13
#define F_SETLKW64 14
#endif
#endif
#ifndef F_SETOWN_EX
#define F_SETOWN_EX 15
#define F_GETOWN_EX 16
#endif
#ifndef F_GETOWNER_UIDS
#define F_GETOWNER_UIDS 17
#endif
/*
* Open File Description Locks
*
* Usually record locks held by a process are released on *any* close and are
* not inherited across a fork().
*
* These cmd values will set locks that conflict with process-associated
* record locks, but are "owned" by the open file description, not the
* process. This means that they are inherited across fork() like BSD (flock)
* locks, and they are only released automatically when the last reference to
* the the open file against which they were acquired is put.
*/
#define F_OFD_GETLK 36
#define F_OFD_SETLK 37
#define F_OFD_SETLKW 38
#define F_OWNER_TID 0
#define F_OWNER_PID 1
#define F_OWNER_PGRP 2
struct f_owner_ex {
int type;
__kernel_pid_t pid;
};
/* for F_[GET|SET]FL */
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
/* for posix fcntl() and lockf() */
#ifndef F_RDLCK
#define F_RDLCK 0
#define F_WRLCK 1
#define F_UNLCK 2
#endif
/* for old implementation of bsd flock () */
#ifndef F_EXLCK
#define F_EXLCK 4 /* or 3 */
#define F_SHLCK 8 /* or 4 */
#endif
/* operations for bsd flock(), also used by the kernel implementation */
#define LOCK_SH 1 /* shared lock */
#define LOCK_EX 2 /* exclusive lock */
#define LOCK_NB 4 /* or'd with one of the above to prevent
blocking */
#define LOCK_UN 8 /* remove lock */
#define LOCK_MAND 32 /* This is a mandatory flock ... */
#define LOCK_READ 64 /* which allows concurrent read operations */
#define LOCK_WRITE 128 /* which allows concurrent write operations */
#define LOCK_RW 192 /* which allows concurrent read & write ops */
#define F_LINUX_SPECIFIC_BASE 1024
#ifndef HAVE_ARCH_STRUCT_FLOCK
#ifndef __ARCH_FLOCK_PAD
#define __ARCH_FLOCK_PAD
#endif
struct flock {
short l_type;
short l_whence;
__kernel_off_t l_start;
__kernel_off_t l_len;
__kernel_pid_t l_pid;
__ARCH_FLOCK_PAD
};
#endif
#ifndef HAVE_ARCH_STRUCT_FLOCK64
#ifndef __ARCH_FLOCK64_PAD
#define __ARCH_FLOCK64_PAD
#endif
struct flock64 {
short l_type;
short l_whence;
__kernel_loff_t l_start;
__kernel_loff_t l_len;
__kernel_pid_t l_pid;
__ARCH_FLOCK64_PAD
};
#endif
#endif /* _ASM_GENERIC_FCNTL_H */
| {
"pile_set_name": "Github"
} |
#!/bin/bash
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# 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.
# needs depot_tools in the path
# git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
# export PATH="$PATH:/path/to/depot_tools"
# https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md
fetch --nohooks chromium
cd src
build/install-build-deps.sh
gclient runhooks
# https://www.chromium.org/developers/how-tos/get-the-code/working-with-release-branches
git fetch --tags
git checkout tags/70.0.3538.9
gclient sync
gn gen out/Default
echo << EOF
Please set the following args:
> use_jumbo_build=true
> enable_nacl=false
> remove_webcore_debug_symbols=true
> use_goma = true # for googlers
> is_debug = false
EOF
gn args out/Default
git apply ../attachments/nosandbox.patch
pushd v8
git apply ../attachments/addition-reducer.patch
popd
autoninja -C out/Default chrome
| {
"pile_set_name": "Github"
} |
#!/bin/sh
mdtool build $@
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.ProjectOxford.Video" version="1.0.1" targetFramework="net46" />
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net46" />
</packages> | {
"pile_set_name": "Github"
} |
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/browser_tab_strip_tracker.h"
#include "base/auto_reset.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_tab_strip_tracker_delegate.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
BrowserTabStripTracker::BrowserTabStripTracker(
TabStripModelObserver* tab_strip_model_observer,
BrowserTabStripTrackerDelegate* delegate,
BrowserListObserver* browser_list_observer)
: tab_strip_model_observer_(tab_strip_model_observer),
delegate_(delegate),
browser_list_observer_(browser_list_observer),
is_processing_initial_browsers_(false) {
DCHECK(tab_strip_model_observer_);
}
BrowserTabStripTracker::~BrowserTabStripTracker() {
for (Browser* browser : browsers_observing_)
browser->tab_strip_model()->RemoveObserver(tab_strip_model_observer_);
BrowserList::RemoveObserver(this);
}
void BrowserTabStripTracker::Init(InitWith init_with) {
BrowserList::AddObserver(this);
base::AutoReset<bool> restter(&is_processing_initial_browsers_, true);
if (init_with == InitWith::BROWSERS_IN_ACTIVE_DESKTOP) {
for (Browser* browser : *BrowserList::GetInstance())
MaybeTrackBrowser(browser);
} else {
DCHECK(InitWith::ALL_BROWERS == init_with);
for (auto* browser : *BrowserList::GetInstance())
MaybeTrackBrowser(browser);
}
}
void BrowserTabStripTracker::StopObservingAndSendOnBrowserRemoved() {
Browsers current_browsers;
current_browsers.swap(browsers_observing_);
for (Browser* browser : current_browsers) {
browser->tab_strip_model()->RemoveObserver(tab_strip_model_observer_);
if (browser_list_observer_)
browser_list_observer_->OnBrowserRemoved(browser);
}
}
bool BrowserTabStripTracker::ShouldTrackBrowser(Browser* browser) {
return !delegate_ || delegate_->ShouldTrackBrowser(browser);
}
void BrowserTabStripTracker::MaybeTrackBrowser(Browser* browser) {
if (!ShouldTrackBrowser(browser))
return;
browsers_observing_.insert(browser);
if (browser_list_observer_)
browser_list_observer_->OnBrowserAdded(browser);
TabStripModel* tab_strip_model = browser->tab_strip_model();
tab_strip_model->AddObserver(tab_strip_model_observer_);
const int active_index = tab_strip_model->active_index();
for (int i = 0; i < tab_strip_model->count(); ++i) {
tab_strip_model_observer_->TabInsertedAt(
tab_strip_model->GetWebContentsAt(i), i, i == active_index);
}
}
void BrowserTabStripTracker::OnBrowserAdded(Browser* browser) {
MaybeTrackBrowser(browser);
}
void BrowserTabStripTracker::OnBrowserRemoved(Browser* browser) {
auto it = browsers_observing_.find(browser);
if (it == browsers_observing_.end())
return;
browsers_observing_.erase(it);
browser->tab_strip_model()->RemoveObserver(tab_strip_model_observer_);
if (browser_list_observer_)
browser_list_observer_->OnBrowserRemoved(browser);
}
void BrowserTabStripTracker::OnBrowserSetLastActive(Browser* browser) {
if (browser_list_observer_)
browser_list_observer_->OnBrowserSetLastActive(browser);
}
| {
"pile_set_name": "Github"
} |
u"""
Fixer for memoryview(s) -> buffer(s).
Explicit because some memoryview methods are invalid on buffer objects.
"""
from lib2to3 import fixer_base
from lib2to3.fixer_util import Name
class FixMemoryview(fixer_base.BaseFix):
explicit = True # User must specify that they want this.
PATTERN = u"""
power< name='memoryview' trailer< '(' [any] ')' >
rest=any* >
"""
def transform(self, node, results):
name = results[u"name"]
name.replace(Name(u"buffer", prefix=name.prefix))
| {
"pile_set_name": "Github"
} |
#!/bin/sh
# ----------------------------------------------------------------------------
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven2 Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ]; then
if [ -f /etc/mavenrc ]; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ]; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false
darwin=false
mingw=false
case "$(uname)" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true ;;
Darwin*)
darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="$(/usr/libexec/java_home)"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ]; then
if [ -r /etc/gentoo-release ]; then
JAVA_HOME=$(java-config --jre-home)
fi
fi
if [ -z "$M2_HOME" ]; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ]; do
ls=$(ls -ld "$PRG")
link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' >/dev/null; then
PRG="$link"
else
PRG="$(dirname "$PRG")/$link"
fi
done
saveddir=$(pwd)
M2_HOME=$(dirname "$PRG")/..
# make it fully qualified
M2_HOME=$(cd "$M2_HOME" && pwd)
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=$(cygpath --unix "$M2_HOME")
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
[ -n "$CLASSPATH" ] &&
CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw; then
[ -n "$M2_HOME" ] &&
M2_HOME="$( (
cd "$M2_HOME"
pwd
))"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="$( (
cd "$JAVA_HOME"
pwd
))"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="$(which javac)"
if [ -n "$javaExecutable" ] && ! [ "$(expr \"$javaExecutable\" : '\([^ ]*\)')" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=$(which readlink)
if [ ! $(expr "$readLink" : '\([^ ]*\)') = "no" ]; then
if $darwin; then
javaHome="$(dirname \"$javaExecutable\")"
javaExecutable="$(cd \"$javaHome\" && pwd -P)/javac"
else
javaExecutable="$(readlink -f \"$javaExecutable\")"
fi
javaHome="$(dirname \"$javaExecutable\")"
javaHome=$(expr "$javaHome" : '\(.*\)/bin')
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ]; then
if [ -n "$JAVA_HOME" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="$(which java)"
fi
fi
if [ ! -x "$JAVACMD" ]; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ]; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]; then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ]; do
if [ -d "$wdir"/.mvn ]; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=$(
cd "$wdir/.."
pwd
)
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' <"$1")"
fi
}
BASE_DIR=$(find_maven_basedir "$(pwd)")
if [ -z "$BASE_DIR" ]; then
exit 1
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
fi
while IFS="=" read key value; do
case "$key" in wrapperUrl)
jarUrl="$value"
break
;;
esac
done <"$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
fi
if command -v wget >/dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl >/dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=$(cygpath --path --windows "$javaClass")
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=$(cygpath --path --windows "$M2_HOME")
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
[ -n "$CLASSPATH" ] &&
CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
| {
"pile_set_name": "Github"
} |
package org.springframework.web.servlet;
import org.springframework.lang.Nullable;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.StringUtils;
import java.util.HashMap;
/**
* TODO...
*
* @author zwd
* @since 2019-04-22
**/
public final class MyFlashMap extends HashMap<String, Object> implements Comparable<MyFlashMap>{
@Nullable
private String targetRequestPath;
private final MultiValueMap<String, String> targetRequestParams = new LinkedMultiValueMap<>(4);
@Override
public int compareTo(MyFlashMap myFlashMap) {
return 0;
}
public void setTargetRequestPath(@Nullable String path) {
this.targetRequestPath = path;
}
public MyFlashMap addTargetRequestParams(@Nullable MultiValueMap<String, String> params) {
if (params != null) {
params.forEach((key, values) -> {
for (String value : values) {
addTargetRequestParam(key, value);
}
});
}
return this;
}
public MyFlashMap addTargetRequestParam(String name, String value) {
if (StringUtils.hasText(name) && StringUtils.hasText(value)) {
this.targetRequestParams.add(name, value);
}
return this;
}
}
| {
"pile_set_name": "Github"
} |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import unittest
import mozunit
import os
from mozpack.chrome.manifest import (
ManifestContent,
ManifestLocale,
ManifestSkin,
Manifest,
ManifestResource,
ManifestOverride,
ManifestComponent,
ManifestContract,
ManifestInterfaces,
ManifestBinaryComponent,
ManifestCategory,
ManifestStyle,
ManifestOverlay,
MANIFESTS_TYPES,
parse_manifest,
parse_manifest_line,
)
from mozpack.errors import errors, AccumulatedErrors
from test_errors import TestErrors
class TestManifest(unittest.TestCase):
def test_parse_manifest(self):
manifest = [
'content global content/global/',
'content global content/global/ application=foo application=bar' +
' platform',
'locale global en-US content/en-US/',
'locale global en-US content/en-US/ application=foo',
'skin global classic/1.0 content/skin/classic/',
'skin global classic/1.0 content/skin/classic/ application=foo' +
' os=WINNT',
'',
'manifest pdfjs/chrome.manifest',
'resource gre-resources toolkit/res/',
'override chrome://global/locale/netError.dtd' +
' chrome://browser/locale/netError.dtd',
'# Comment',
'component {b2bba4df-057d-41ea-b6b1-94a10a8ede68} foo.js',
'contract @mozilla.org/foo;1' +
' {b2bba4df-057d-41ea-b6b1-94a10a8ede68}',
'interfaces foo.xpt',
'binary-component bar.so',
'category command-line-handler m-browser' +
' @mozilla.org/browser/clh;1' +
' application={ec8030f7-c20a-464f-9b0e-13a3a9e97384}',
'style chrome://global/content/customizeToolbar.xul' +
' chrome://browser/skin/',
'overlay chrome://global/content/viewSource.xul' +
' chrome://browser/content/viewSourceOverlay.xul',
]
other_manifest = [
'content global content/global/'
]
expected_result = [
ManifestContent('', 'global', 'content/global/'),
ManifestContent('', 'global', 'content/global/', 'application=foo',
'application=bar', 'platform'),
ManifestLocale('', 'global', 'en-US', 'content/en-US/'),
ManifestLocale('', 'global', 'en-US', 'content/en-US/',
'application=foo'),
ManifestSkin('', 'global', 'classic/1.0', 'content/skin/classic/'),
ManifestSkin('', 'global', 'classic/1.0', 'content/skin/classic/',
'application=foo', 'os=WINNT'),
Manifest('', 'pdfjs/chrome.manifest'),
ManifestResource('', 'gre-resources', 'toolkit/res/'),
ManifestOverride('', 'chrome://global/locale/netError.dtd',
'chrome://browser/locale/netError.dtd'),
ManifestComponent('', '{b2bba4df-057d-41ea-b6b1-94a10a8ede68}',
'foo.js'),
ManifestContract('', '@mozilla.org/foo;1',
'{b2bba4df-057d-41ea-b6b1-94a10a8ede68}'),
ManifestInterfaces('', 'foo.xpt'),
ManifestBinaryComponent('', 'bar.so'),
ManifestCategory('', 'command-line-handler', 'm-browser',
'@mozilla.org/browser/clh;1', 'application=' +
'{ec8030f7-c20a-464f-9b0e-13a3a9e97384}'),
ManifestStyle('', 'chrome://global/content/customizeToolbar.xul',
'chrome://browser/skin/'),
ManifestOverlay('', 'chrome://global/content/viewSource.xul',
'chrome://browser/content/viewSourceOverlay.xul'),
]
with mozunit.MockedOpen({'manifest': '\n'.join(manifest),
'other/manifest': '\n'.join(other_manifest)}):
# Ensure we have tests for all types of manifests.
self.assertEqual(set(type(e) for e in expected_result),
set(MANIFESTS_TYPES.values()))
self.assertEqual(list(parse_manifest(os.curdir, 'manifest')),
expected_result)
self.assertEqual(list(parse_manifest(os.curdir, 'other/manifest')),
[ManifestContent('other', 'global',
'content/global/')])
def test_manifest_rebase(self):
m = parse_manifest_line('chrome', 'content global content/global/')
m = m.rebase('')
self.assertEqual(str(m), 'content global chrome/content/global/')
m = m.rebase('chrome')
self.assertEqual(str(m), 'content global content/global/')
m = parse_manifest_line('chrome/foo', 'content global content/global/')
m = m.rebase('chrome')
self.assertEqual(str(m), 'content global foo/content/global/')
m = m.rebase('chrome/foo')
self.assertEqual(str(m), 'content global content/global/')
m = parse_manifest_line('modules/foo', 'resource foo ./')
m = m.rebase('modules')
self.assertEqual(str(m), 'resource foo foo/')
m = m.rebase('modules/foo')
self.assertEqual(str(m), 'resource foo ./')
m = parse_manifest_line('chrome', 'content browser browser/content/')
m = m.rebase('chrome/browser').move('jar:browser.jar!').rebase('')
self.assertEqual(str(m), 'content browser jar:browser.jar!/content/')
class TestManifestErrors(TestErrors, unittest.TestCase):
def test_parse_manifest_errors(self):
manifest = [
'skin global classic/1.0 content/skin/classic/ platform',
'',
'binary-component bar.so',
'unsupported foo',
]
with mozunit.MockedOpen({'manifest': '\n'.join(manifest)}):
with self.assertRaises(AccumulatedErrors):
with errors.accumulate():
list(parse_manifest(os.curdir, 'manifest'))
out = self.get_output()
# Expecting 2 errors
self.assertEqual(len(out), 2)
path = os.path.abspath('manifest')
# First on line 1
self.assertTrue(out[0].startswith('Error: %s:1: ' % path))
# Second on line 4
self.assertTrue(out[1].startswith('Error: %s:4: ' % path))
if __name__ == '__main__':
mozunit.main()
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- [%thread] -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</Pattern>
</layout>
</appender>
<root level="error">
<appender-ref ref="STDOUT" />
</root>
<logger name="org.springframework" level='info'>
</logger>
<logger name="net.chrisrichardson.eventstore.javaexamples.banking" level='info'>
</logger>
<logger name="io.eventuate.activity" level='debug'>
</logger>
</configuration> | {
"pile_set_name": "Github"
} |
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2020 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidDataHandling/MultiPeriodLoadMuonStrategy.h"
#include "MantidAPI/Run.h"
#include "MantidAPI/WorkspaceGroup.h"
#include "MantidDataHandling/LoadMuonNexusV2NexusHelper.h"
#include "MantidDataObjects/TableWorkspace.h"
#include "MantidDataObjects/Workspace2D.h"
namespace Mantid {
namespace DataHandling {
using namespace API;
using namespace NeXus;
using namespace DataObjects;
namespace {
const std::string GOODFRAMESPROP{"goodfrm"};
constexpr bool MULTIPERIODSLOADED = true;
} // namespace
// Constructor
MultiPeriodLoadMuonStrategy::MultiPeriodLoadMuonStrategy(
Kernel::Logger &g_log, const std::string filename,
LoadMuonNexusV2NexusHelper &nexusLoader, API::WorkspaceGroup &workspace)
: LoadMuonStrategy(g_log, filename, nexusLoader),
m_workspaceGroup(workspace), m_detectors(getLoadedDetectors()) {}
/**
* Loads Muon specific logs into each of the workspaces in the workspace group.
* These are logs which are not loaded by LoadISISNexus
*/
void MultiPeriodLoadMuonStrategy::loadMuonLogData() {
auto sampleInformation = m_nexusLoader.loadSampleInformationFromNexus();
std::string mainFieldDirection =
m_nexusLoader.loadMainFieldDirectionFromNexus();
double firstGoodData = m_nexusLoader.loadFirstGoodDataFromNexus();
for (int i = 0; i < m_workspaceGroup.getNumberOfEntries(); ++i) {
auto workspace =
std::dynamic_pointer_cast<Workspace2D>(m_workspaceGroup.getItem(i));
auto &run = workspace->mutableRun();
run.addProperty("main_field_direction", mainFieldDirection);
run.addProperty("FirstGoodData", firstGoodData);
run.addProperty("sample_temp", sampleInformation.temperature);
run.addProperty("sample_magn_field", sampleInformation.magneticField);
}
}
/**
* Loads the good frames data into each of the stored workspace objects
*/
void MultiPeriodLoadMuonStrategy::loadGoodFrames() {
NXInt goodframes =
m_nexusLoader.loadGoodFramesDataFromNexus(MULTIPERIODSLOADED);
for (int i = 0; i < m_workspaceGroup.getNumberOfEntries(); ++i) {
auto workspace =
std::dynamic_pointer_cast<Workspace2D>(m_workspaceGroup.getItem(i));
auto &run = workspace->mutableRun();
run.removeProperty(GOODFRAMESPROP);
run.addProperty(GOODFRAMESPROP, goodframes[i]);
}
}
/**
* Loads detector grouping.
* If no entry in NeXus file for grouping, load it from the IDF.
* stored
* @returns :: TableWorkspace group containing each of the grouping tables
*/
Workspace_sptr MultiPeriodLoadMuonStrategy::loadDetectorGrouping() const {
// Each period could in theory have its own grouping, which is reflected in
// the nexus file which has (periods*numDetectors) entries in the Nexus
// grouping entry.
WorkspaceGroup_sptr tableGroup = std::make_shared<WorkspaceGroup>();
for (int i = 0; i < m_workspaceGroup.getNumberOfEntries(); ++i) {
int periodNumber = i + 1;
auto grouping = m_nexusLoader.loadDetectorGroupingFromNexus(
m_detectors, MULTIPERIODSLOADED, periodNumber);
TableWorkspace_sptr table =
createDetectorGroupingTable(m_detectors, grouping);
// if any of the tables are empty we'll load grouping from the IDF
if (table->rowCount() == 0) {
m_logger.notice("Loading grouping information from IDF");
return loadDefaultDetectorGrouping(
*std::dynamic_pointer_cast<Workspace2D>(m_workspaceGroup.getItem(i)));
}
tableGroup->addWorkspace(table);
}
return tableGroup;
}
/**
* Performs time-zero correction on the loaded workspace.
*/
void MultiPeriodLoadMuonStrategy::applyTimeZeroCorrection() {
double timeZero = m_nexusLoader.loadTimeZeroFromNexusFile();
for (int i = 0; i < m_workspaceGroup.getNumberOfEntries(); ++i) {
auto workspace =
std::dynamic_pointer_cast<Workspace2D>(m_workspaceGroup.getItem(i));
auto numHistograms = workspace->getNumberHistograms();
for (size_t i = 0; i < numHistograms; ++i) {
auto &timeAxis = workspace->mutableX(i);
timeAxis = timeAxis - timeZero;
}
}
}
// Load dead time table
API::Workspace_sptr MultiPeriodLoadMuonStrategy::loadDeadTimeTable() const {
WorkspaceGroup_sptr tableGroup = std::make_shared<WorkspaceGroup>();
for (int i = 0; i < m_workspaceGroup.getNumberOfEntries(); ++i) {
int periodNumber = i + 1;
auto deadTimes = m_nexusLoader.loadDeadTimesFromNexus(
m_detectors, MULTIPERIODSLOADED, periodNumber);
tableGroup->addWorkspace(createDeadTimeTable(m_detectors, deadTimes));
}
return tableGroup;
}
/**
* Finds the detectors which are loaded in the stored workspace group
*/
std::vector<detid_t> MultiPeriodLoadMuonStrategy::getLoadedDetectors() {
// Assume each spectrum maps to the same detector in each period.
auto workspace =
std::dynamic_pointer_cast<Workspace2D>(m_workspaceGroup.getItem(0));
return getLoadedDetectorsFromWorkspace(*workspace);
}
} // namespace DataHandling
} // namespace Mantid
| {
"pile_set_name": "Github"
} |
//
// SUVersionComparisonProtocol.h
// Sparkle
//
// Created by Andy Matuschak on 12/21/07.
// Copyright 2007 Andy Matuschak. All rights reserved.
//
#ifndef SUVERSIONCOMPARISONPROTOCOL_H
#define SUVERSIONCOMPARISONPROTOCOL_H
#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import <Sparkle/SUExport.h>
NS_ASSUME_NONNULL_BEGIN
/*!
Provides version comparison facilities for Sparkle.
*/
@protocol SUVersionComparison
/*!
An abstract method to compare two version strings.
Should return NSOrderedAscending if b > a, NSOrderedDescending if b < a,
and NSOrderedSame if they are equivalent.
*/
- (NSComparisonResult)compareVersion:(NSString *)versionA toVersion:(NSString *)versionB; // *** MAY BE CALLED ON NON-MAIN THREAD!
@end
NS_ASSUME_NONNULL_END
#endif
| {
"pile_set_name": "Github"
} |
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_product_configurator
#
# Translators:
# Maidu Targama <[email protected]>, 2020
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server saas~12.4\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-08-12 11:33+0000\n"
"PO-Revision-Date: 2019-08-26 09:16+0000\n"
"Last-Translator: Maidu Targama <[email protected]>, 2020\n"
"Language-Team: Estonian (https://www.transifex.com/odoo/teams/41243/et/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Language: et\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: website_sale_product_configurator
#. openerp-web
#: code:addons/website_sale_product_configurator/static/src/js/website_sale_options.js:26
#, python-format
msgid "Add to cart"
msgstr "Lisa korvi"
#. module: website_sale_product_configurator
#. openerp-web
#: code:addons/website_sale_product_configurator/static/src/js/website_sale_options.js:25
#, python-format
msgid "Continue Shopping"
msgstr ""
#. module: website_sale_product_configurator
#. openerp-web
#: code:addons/website_sale_product_configurator/static/src/js/website_sale_options.js:24
#, python-format
msgid "Proceed to Checkout"
msgstr ""
#. module: website_sale_product_configurator
#: model:ir.model,name:website_sale_product_configurator.model_sale_order
msgid "Sales Order"
msgstr "Müügi tellimus"
| {
"pile_set_name": "Github"
} |
<?php
return array(
/*
|--------------------------------------------------------------------------
| Password Reminder Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are the default lines which match reasons
| that are given by the password broker for a password update attempt
| has failed, such as for an invalid token or invalid new password.
|
*/
"password" => "Adgangskoder skal være seks tegn og svare til bekræftelsen.",
"user" => "Brugernavn eller email adresse er forkert",
"token" => "Denne adgangskode nulstillingstoken er ugyldig.",
"sent" => "Hvis en tilsvarende email adresse blev fundet, er der afsendt en påmindelse om adgangskode!",
);
| {
"pile_set_name": "Github"
} |
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.sun.org.apache.xpath.internal.functions;
import com.sun.org.apache.xml.internal.dtm.DTMIterator;
import com.sun.org.apache.xpath.internal.XPathContext;
import com.sun.org.apache.xpath.internal.objects.XNumber;
import com.sun.org.apache.xpath.internal.objects.XObject;
/**
* Execute the Count() function.
* @xsl.usage advanced
*/
public class FuncCount extends FunctionOneArg
{
static final long serialVersionUID = -7116225100474153751L;
/**
* Execute the function. The function must return
* a valid object.
* @param xctxt The current execution context.
* @return A valid XObject.
*
* @throws javax.xml.transform.TransformerException
*/
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{
// DTMIterator nl = m_arg0.asIterator(xctxt, xctxt.getCurrentNode());
// // We should probably make a function on the iterator for this,
// // as a given implementation could optimize.
// int i = 0;
//
// while (DTM.NULL != nl.nextNode())
// {
// i++;
// }
// nl.detach();
DTMIterator nl = m_arg0.asIterator(xctxt, xctxt.getCurrentNode());
int i = nl.getLength();
nl.detach();
return new XNumber((double) i);
}
}
| {
"pile_set_name": "Github"
} |
#Thu Jan 15 21:35:25 JST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
| {
"pile_set_name": "Github"
} |
exports.createServer =
exports.createConnection =
exports.connect =
function () {};
exports.isIP =
exports.isIPv4 =
exports.isIPv6 =
function () { return true };
| {
"pile_set_name": "Github"
} |
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Xml.Linq;
namespace NuGet.Commands
{
public class MSBuildOutputFile
{
/// <summary>
/// Output path on disk.
/// </summary>
public string Path { get; }
/// <summary>
/// MSBuild file content. This will be null for files
/// that should be removed.
/// </summary>
public XDocument Content { get; }
public MSBuildOutputFile(string path, XDocument content)
{
if (path == null)
{
throw new ArgumentNullException(nameof(path));
}
Path = path;
Content = content;
}
}
}
| {
"pile_set_name": "Github"
} |
<?php
/**
* Locale data for 'ast_ES'.
*
* This file is automatically generated by yiic cldr command.
*
* Copyright © 1991-2013 Unicode, Inc. All rights reserved.
* Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
*
* @copyright 2008-2014 Yii Software LLC (http://www.yiiframework.com/license/)
*/
return array (
'version' => '8245',
'numberSymbols' =>
array (
'decimal' => '.',
'group' => ',',
'list' => ';',
'percentSign' => '%',
'plusSign' => '+',
'minusSign' => '-',
'exponential' => 'E',
'perMille' => '‰',
'infinity' => '∞',
'nan' => 'NaN',
),
'decimalFormat' => '#,##0.###',
'scientificFormat' => '#E0',
'percentFormat' => '#,##0%',
'currencyFormat' => '#,##0.00 ¤',
'currencySymbols' =>
array (
'AUD' => 'A$',
'BRL' => 'R$',
'CAD' => 'CA$',
'CNY' => 'CN¥',
'EUR' => '€',
'GBP' => '£',
'HKD' => 'HK$',
'ILS' => '₪',
'INR' => '₹',
'JPY' => '¥',
'KRW' => '₩',
'MXN' => 'MX$',
'NZD' => 'NZ$',
'THB' => '฿',
'TWD' => 'NT$',
'USD' => '$',
'VND' => '₫',
'XAF' => 'FCFA',
'XCD' => 'EC$',
'XOF' => 'CFA',
'XPF' => 'CFPF',
),
'monthNames' =>
array (
'wide' =>
array (
1 => 'de xineru',
2 => 'de febreru',
3 => 'de marzu',
4 => 'd\'abril',
5 => 'de mayu',
6 => 'de xunu',
7 => 'de xunetu',
8 => 'd\'agostu',
9 => 'de setiembre',
10 => 'd\'ochobre',
11 => 'de payares',
12 => 'd\'avientu',
),
'abbreviated' =>
array (
1 => 'xin',
2 => 'feb',
3 => 'mar',
4 => 'abr',
5 => 'may',
6 => 'xun',
7 => 'xnt',
8 => 'ago',
9 => 'set',
10 => 'och',
11 => 'pay',
12 => 'avi',
),
'narrow' =>
array (
1 => 'X',
2 => 'F',
3 => 'M',
4 => 'A',
5 => 'M',
6 => 'X',
7 => 'X',
8 => 'A',
9 => 'S',
10 => 'O',
11 => 'P',
12 => 'A',
),
),
'monthNamesSA' =>
array (
'narrow' =>
array (
1 => 'X',
2 => 'F',
3 => 'M',
4 => 'A',
5 => 'M',
6 => 'X',
7 => 'X',
8 => 'A',
9 => 'S',
10 => 'O',
11 => 'P',
12 => 'A',
),
'abbreviated' =>
array (
1 => 'Xin',
2 => 'Feb',
3 => 'Mar',
4 => 'Abr',
5 => 'May',
6 => 'Xun',
7 => 'Xnt',
8 => 'Ago',
9 => 'Set',
10 => 'Och',
11 => 'Pay',
12 => 'Avi',
),
'wide' =>
array (
1 => 'xineru',
2 => 'febreru',
3 => 'marzu',
4 => 'abril',
5 => 'mayu',
6 => 'xunu',
7 => 'xunetu',
8 => 'agostu',
9 => 'setiembre',
10 => 'ochobre',
11 => 'payares',
12 => 'avientu',
),
),
'weekDayNames' =>
array (
'wide' =>
array (
0 => 'domingu',
1 => 'llunes',
2 => 'martes',
3 => 'miércoles',
4 => 'xueves',
5 => 'vienres',
6 => 'sábadu',
),
'abbreviated' =>
array (
0 => 'dom',
1 => 'llu',
2 => 'mar',
3 => 'mie',
4 => 'xue',
5 => 'vie',
6 => 'sab',
),
'narrow' =>
array (
0 => 'D',
1 => 'L',
2 => 'M',
3 => 'M',
4 => 'X',
5 => 'V',
6 => 'S',
),
'short' =>
array (
0 => 'do',
1 => 'll',
2 => 'ma',
3 => 'mi',
4 => 'xu',
5 => 'vi',
6 => 'sa',
),
),
'weekDayNamesSA' =>
array (
'narrow' =>
array (
0 => 'D',
1 => 'L',
2 => 'M',
3 => 'M',
4 => 'X',
5 => 'V',
6 => 'S',
),
'abbreviated' =>
array (
0 => 'dom',
1 => 'llu',
2 => 'mar',
3 => 'mie',
4 => 'xue',
5 => 'vie',
6 => 'sab',
),
'short' =>
array (
0 => 'do',
1 => 'll',
2 => 'ma',
3 => 'mi',
4 => 'xu',
5 => 'vi',
6 => 'sa',
),
'wide' =>
array (
0 => 'domingu',
1 => 'llunes',
2 => 'martes',
3 => 'miércoles',
4 => 'xueves',
5 => 'vienres',
6 => 'sábadu',
),
),
'eraNames' =>
array (
'abbreviated' =>
array (
0 => 'a.C.',
1 => 'd.C.',
),
'wide' =>
array (
0 => 'a.C.',
1 => 'd.C.',
),
'narrow' =>
array (
0 => 'a.C.',
1 => 'd.C.',
),
),
'dateFormats' =>
array (
'full' => 'EEEE, dd MMMM \'de\' y',
'long' => 'd MMMM \'de\' y',
'medium' => 'd MMM y',
'short' => 'd/M/yy',
),
'timeFormats' =>
array (
'full' => 'HH:mm:ss zzzz',
'long' => 'HH:mm:ss z',
'medium' => 'HH:mm:ss',
'short' => 'HH:mm',
),
'dateTimeFormat' => '{1} {0}',
'amName' => 'AM',
'pmName' => 'PM',
'orientation' => 'ltr',
'languages' =>
array (
'ab' => 'abḥasianu',
'af' => 'afrikaans',
'am' => 'amharicu',
'ar' => 'árabe',
'as' => 'asamés',
'ast' => 'asturianu',
'az' => 'azerbaixanu',
'be' => 'bielorrusu',
'bg' => 'búlgaru',
'bn' => 'bengalín',
'bo' => 'tibetanu',
'bs' => 'bosniu',
'ca' => 'catalán',
'cs' => 'checu',
'cy' => 'galés',
'da' => 'danés',
'de' => 'alemán',
'de_at' => 'alemán d\'Austria',
'de_ch' => 'alemán de Suiza',
'el' => 'griegu',
'en' => 'inglés',
'en_au' => 'inglés d\'Australia',
'en_ca' => 'inglés de Canadá',
'en_gb' => 'inglés de Gran Bretaña',
'en_us' => 'inglés d\'EE.XX.',
'eo' => 'esperanto',
'es' => 'español',
'es_419' => 'español d\'América Latina',
'es_es' => 'español d\'Europa',
'et' => 'estoniu',
'eu' => 'vascu',
'fa' => 'persa',
'fi' => 'finlandés',
'fil' => 'filipín',
'fj' => 'fixanu',
'fo' => 'feroés',
'fr' => 'francés',
'fr_ca' => 'francés de Canadá',
'fr_ch' => 'francés de Suiza',
'fy' => 'frisón occidental',
'ga' => 'irlandés',
'gl' => 'gallegu',
'gn' => 'guaraní',
'gsw' => 'alemánicu de Suiza',
'gu' => 'guyaratí',
'ha' => 'ḥausa',
'haw' => 'ḥawaianu',
'he' => 'hebréu',
'hi' => 'hindi',
'hr' => 'croata',
'ht' => 'haitianu',
'hu' => 'húngaru',
'hy' => 'armeniu',
'id' => 'indonesiu',
'ig' => 'igbo',
'is' => 'islandés',
'it' => 'italianu',
'ja' => 'xaponés',
'jv' => 'xavanés',
'ka' => 'xeorxanu',
'kk' => 'kazaquistanín',
'km' => 'ḥemer',
'kn' => 'canarés',
'ko' => 'coreanu',
'ks' => 'cachemirés',
'ku' => 'curdu',
'ky' => 'kirguistanín',
'la' => 'llatín',
'lb' => 'luxemburgués',
'lo' => 'laosianu',
'lt' => 'lituanu',
'lv' => 'letón',
'mg' => 'malgaxe',
'mi' => 'maorí',
'mk' => 'macedoniu',
'ml' => 'malayalam',
'mr' => 'maratí',
'ms' => 'malayu',
'mt' => 'maltés',
'my' => 'birmanu',
'nb' => 'noruegu Bokmål',
'ne' => 'nepalés',
'nl' => 'neerlandés',
'nl_be' => 'flamencu',
'nn' => 'noruegu Nynorsk',
'or' => 'oriya',
'pa' => 'punyabí',
'pl' => 'polacu',
'ps' => 'pashtu',
'pt' => 'portugués',
'pt_br' => 'portugués del Brasil',
'pt_pt' => 'portugués d\'Europa',
'qu' => 'quechua',
'rm' => 'romanche',
'ro' => 'rumanu',
'ru' => 'rusu',
'sa' => 'sánscritu',
'sd' => 'sindhi',
'si' => 'cingalés',
'sk' => 'eslovacu',
'sl' => 'eslovenu',
'so' => 'somalín',
'sq' => 'albanu',
'sr' => 'serbiu',
'su' => 'sondanés',
'sv' => 'suecu',
'sw' => 'suaḥili',
'ta' => 'tamil',
'te' => 'telugu',
'tg' => 'taxiquistanín',
'th' => 'tailandés',
'ti' => 'tigrinya',
'tk' => 'turcomanu',
'to' => 'tonganu',
'tr' => 'turcu',
'tt' => 'tártaru',
'ug' => 'uigur',
'uk' => 'ucraín',
'und' => 'llingua desconocida',
'ur' => 'indostánicu',
'uz' => 'uzbequistanín',
'vi' => 'vietnamín',
'wo' => 'wolof',
'xh' => 'xhosa',
'yo' => 'yoruba',
'zh' => 'chinu',
'zh_hans' => 'chinu simplificáu',
'zh_hant' => 'chinu tradicional',
'zu' => 'zulú',
'zxx' => 'ensin conteníu llingüísticu',
),
'scripts' =>
array (
'arab' => 'árabe',
'armn' => 'armeniu',
'beng' => 'bengalín',
'bopo' => 'zhuyin',
'brai' => 'braille',
'cyrl' => 'cirílicu',
'deva' => 'devanagari',
'ethi' => 'etíope',
'geor' => 'xeorxanu',
'grek' => 'griegu',
'gujr' => 'guyarati',
'guru' => 'gurmukhi',
'hang' => 'hangul',
'hani' => 'escritura china',
'hans' => 'chinu simplificáu',
'hant' => 'chinu tradicional',
'hebr' => 'hebréu',
'hira' => 'ḥiragana',
'jpan' => 'xaponés',
'kana' => 'katakana',
'khmr' => 'ḥemer',
'knda' => 'canarés',
'kore' => 'coreanu',
'laoo' => 'laosianu',
'latn' => 'llatín',
'mlym' => 'malayalam',
'mong' => 'mongol',
'mymr' => 'birmanu',
'orya' => 'oriya',
'sinh' => 'cingalés',
'taml' => 'tamil',
'telu' => 'telugu',
'thaa' => 'thaana',
'thai' => 'tailandés',
'tibt' => 'tibetanu',
'zsym' => 'símbolos',
'zxxx' => 'non escritu',
'zyyy' => 'común',
'zzzz' => 'escritura desconocida',
),
'territories' =>
array (
'001' => 'Mundu',
'002' => 'África',
'003' => 'Norteamérica',
'005' => 'América del Sur',
'009' => 'Oceanía',
'011' => 'África Occidental',
'013' => 'América Central',
'014' => 'África Oriental',
'015' => 'África del Norte',
'017' => 'África Central',
'018' => 'África del Sur',
'019' => 'América',
'021' => 'América del Norte',
'029' => 'Caribe',
'030' => 'Asia Oriental',
'034' => 'Asia del Sur',
'035' => 'Sureste Asiáticu',
'039' => 'Europa del Sur',
'053' => 'Australasia',
'054' => 'Melanesia',
'057' => 'Rexón de Micronesia',
'061' => 'Polinesia',
142 => 'Asia',
143 => 'Asia Central',
145 => 'Asia Occidental',
150 => 'Europa',
151 => 'Europa Oriental',
154 => 'Europa del Norte',
155 => 'Europa Occidental',
419 => 'América Llatina',
'ac' => 'Islla Ascensión',
'ad' => 'Andorra',
'ae' => 'Emiratos Árabes Xuníos',
'af' => 'Afganistán',
'ag' => 'Antigua y Barbuda',
'ai' => 'Anguila',
'al' => 'Albania',
'am' => 'Armenia',
'ao' => 'Angola',
'aq' => 'L\'Antártida',
'ar' => 'Arxentina',
'as' => 'Samoa Americana',
'at' => 'Austria',
'au' => 'Australia',
'aw' => 'Aruba',
'ax' => 'Islles Aland',
'az' => 'Azerbaixán',
'ba' => 'Bosnia y Herzegovina',
'bb' => 'Barbados',
'bd' => 'Bangladex',
'be' => 'Bélxica',
'bf' => 'Burkina Fasu',
'bg' => 'Bulgaria',
'bh' => 'Baḥréin',
'bi' => 'Burundi',
'bj' => 'Benín',
'bl' => 'San Bartolomé',
'bm' => 'Les Bermudes',
'bn' => 'Brunéi',
'bo' => 'Bolivia',
'bq' => 'Caribe neerlandés',
'br' => 'Brasil',
'bs' => 'Les Bahames',
'bt' => 'Bután',
'bv' => 'Islla Bouvet',
'bw' => 'Botsuana',
'by' => 'Bielorrusia',
'bz' => 'Belize',
'ca' => 'Canadá',
'cc' => 'Islles Cocos [Keeling]',
'cd' => 'Congu [RDC]',
'cf' => 'República Centroafricana',
'cg' => 'Congu [República]',
'ch' => 'Suiza',
'ci' => 'Costa de Marfil',
'ck' => 'Islles Cook',
'cl' => 'Chile',
'cm' => 'Camerún',
'cn' => 'China',
'co' => 'Colombia',
'cp' => 'Islla Clipperton',
'cr' => 'Costa Rica',
'cu' => 'Cuba',
'cv' => 'Cabu Verde',
'cw' => 'Curaçao',
'cx' => 'Islla Christmas',
'cy' => 'Xipre',
'cz' => 'Chequia',
'de' => 'Alemania',
'dg' => 'Diego Garcia',
'dj' => 'Xibuti',
'dk' => 'Dinamarca',
'dm' => 'Dominica',
'do' => 'República Dominicana',
'dz' => 'Arxelia',
'ea' => 'Ceuta y Melilla',
'ec' => 'Ecuador',
'ee' => 'Estonia',
'eg' => 'Exiptu',
'eh' => 'Sáḥara Occidental',
'er' => 'Eritrea',
'es' => 'España',
'et' => 'Etiopía',
'eu' => 'Xunión Européa',
'fi' => 'Finlandia',
'fj' => 'Islles Fixi',
'fk' => 'Islles Malvines',
'fm' => 'Micronesia',
'fo' => 'Islles Feroe',
'fr' => 'Francia',
'ga' => 'Gabón',
'gb' => 'Reinu Xuníu',
'gd' => 'Granada',
'ge' => 'Xeorxa',
'gf' => 'Guyana Francesa',
'gg' => 'Guernsey',
'gh' => 'Ghana',
'gi' => 'Xibraltar',
'gl' => 'Groenlandia',
'gm' => 'Gambia',
'gn' => 'Guinea',
'gp' => 'Guadalupe',
'gq' => 'Guinea Ecuatorial',
'gr' => 'Grecia',
'gs' => 'Islles Xeorxa del Sur y Sandwich del Sur',
'gt' => 'Guatemala',
'gu' => 'Guam',
'gw' => 'Guinea-Bisáu',
'gy' => 'Guyana',
'hk' => 'Ḥong Kong',
'hm' => 'Islla Ḥeard ya Islles McDonald',
'hn' => 'Hondures',
'hr' => 'Croacia',
'ht' => 'Haití',
'hu' => 'Hungría',
'ic' => 'Islles Canaries',
'id' => 'Indonesia',
'ie' => 'Irlanda',
'il' => 'Israel',
'im' => 'Islla de Man',
'in' => 'India',
'io' => 'Territoriu Británicu del Océanu Índicu',
'iq' => 'Iraq',
'ir' => 'Irán',
'is' => 'Islandia',
'it' => 'Italia',
'je' => 'Jersey',
'jm' => 'Xamaica',
'jo' => 'Xordania',
'jp' => 'Xapón',
'ke' => 'Kenia',
'kg' => 'Kirguistán',
'kh' => 'Camboya',
'ki' => 'Kiribati',
'km' => 'Les Comores',
'kn' => 'Saint Kitts y Nevis',
'kp' => 'Corea del Norte',
'kr' => 'Corea del Sur',
'kw' => 'Kuwait',
'ky' => 'Islles Caimán',
'kz' => 'Kazakstán',
'la' => 'Laos',
'lb' => 'Líbanu',
'lc' => 'Santa Llucía',
'li' => 'Liechtenstein',
'lk' => 'Sri Lanka',
'lr' => 'Liberia',
'ls' => 'Lesothu',
'lt' => 'Lituania',
'lu' => 'Luxemburgu',
'lv' => 'Letonia',
'ly' => 'Libia',
'ma' => 'Marruecos',
'mc' => 'Mónacu',
'md' => 'Moldavia',
'me' => 'Montenegru',
'mf' => 'Saint Martin',
'mg' => 'Madagascar',
'mh' => 'Islles Marshall',
'mk' => 'Macedonia [ARYDM]',
'ml' => 'Malí',
'mm' => 'Myanmar [Birmania]',
'mn' => 'Mongolia',
'mo' => 'Macáu',
'mp' => 'Islles Marianes del Norte',
'mq' => 'La Martinica',
'mr' => 'Mauritania',
'ms' => 'Montserrat',
'mt' => 'Malta',
'mu' => 'Mauriciu',
'mv' => 'Les Maldives',
'mw' => 'Malaui',
'mx' => 'Méxicu',
'my' => 'Malasia',
'mz' => 'Mozambique',
'na' => 'Namibia',
'nc' => 'Nueva Caledonia',
'ne' => 'El Níxer',
'nf' => 'Islla Norfolk',
'ng' => 'Nixeria',
'ni' => 'Nicaragua',
'nl' => 'Países Baxos',
'no' => 'Noruega',
'np' => 'Nepal',
'nr' => 'Nauru',
'nu' => 'Niue',
'nz' => 'Nueva Zelanda',
'om' => 'Omán',
'pa' => 'Panamá',
'pe' => 'Perú',
'pf' => 'Polinesia Francesa',
'pg' => 'Papúa Nueva Guinea',
'ph' => 'Filipines',
'pk' => 'Pakistan',
'pl' => 'Polonia',
'pm' => 'Saint Pierre y Miquelon',
'pn' => 'Islles Pitcairn',
'pr' => 'Puertu Ricu',
'ps' => 'Palestina',
'pt' => 'Portugal',
'pw' => 'Paláu',
'py' => 'Paraguay',
'qa' => 'Qatar',
'qo' => 'Oceanía esterior',
're' => 'Reunión',
'ro' => 'Rumanía',
'rs' => 'Serbia',
'ru' => 'Rusia',
'rw' => 'Ruanda',
'sa' => 'Arabia Saudita',
'sb' => 'Islles Salomón',
'sc' => 'Les Seixeles',
'sd' => 'Sudán',
'se' => 'Suecia',
'sg' => 'Singapur',
'sh' => 'Santa Lena',
'si' => 'Eslovenia',
'sj' => 'Svalbard ya Islla Jan Mayen',
'sk' => 'Eslovaquia',
'sl' => 'Sierra Lleona',
'sm' => 'San Marín',
'sn' => 'Senegal',
'so' => 'Somalia',
'sr' => 'Surinam',
'ss' => 'Sudán del Sur',
'st' => 'Santu Tomé y Príncipe',
'sv' => 'El Salvador',
'sx' => 'Sint Maarten',
'sy' => 'Siria',
'sz' => 'Suazilandia',
'ta' => 'Tristán da Cunha',
'tc' => 'Islles Turques y Caicos',
'td' => 'Chad',
'tf' => 'Tierres Australes Franceses',
'tg' => 'Togu',
'th' => 'Tailandia',
'tj' => 'Taxiquistán',
'tk' => 'Tokeláu',
'tl' => 'Timor Este',
'tm' => 'Turkmenistán',
'tn' => 'Tunicia',
'to' => 'Tonga',
'tr' => 'Turquía',
'tt' => 'Trinidá y Tobagu',
'tv' => 'Tuvalu',
'tw' => 'Taiwán',
'tz' => 'Tanzania',
'ua' => 'Ucraína',
'ug' => 'Uganda',
'um' => 'Islles Perifériques Menores de los EE.XX.',
'us' => 'Estaos Xuníos',
'uy' => 'Uruguay',
'uz' => 'Uzbequistán',
'va' => 'Ciudá del Vaticanu',
'vc' => 'San Vicente y les Granadines',
've' => 'Venezuela',
'vg' => 'Islles Vírxenes Britániques',
'vi' => 'Islles Vírxenes Americanes',
'vn' => 'Vietnam',
'vu' => 'Vanuatu',
'wf' => 'Wallis y Futuna',
'ws' => 'Samoa',
'ye' => 'Yemen',
'yt' => 'Mayotte',
'za' => 'Sudáfrica',
'zm' => 'Zambia',
'zw' => 'Zimbabue',
'zz' => 'Rexón desconocida',
),
'pluralRules' =>
array (
0 => 'n==1',
1 => 'true',
),
);
| {
"pile_set_name": "Github"
} |
perf-y += sched-messaging.o
perf-y += sched-pipe.o
perf-y += mem-functions.o
perf-y += futex-hash.o
perf-y += futex-wake.o
perf-y += futex-wake-parallel.o
perf-y += futex-requeue.o
perf-y += futex-lock-pi.o
perf-$(CONFIG_X86_64) += mem-memcpy-x86-64-asm.o
perf-$(CONFIG_X86_64) += mem-memset-x86-64-asm.o
perf-$(CONFIG_NUMA) += numa.o
| {
"pile_set_name": "Github"
} |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2014 Navdeep Jaitly <[email protected]>
// Benoit Steiner <[email protected]>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_CXX11_TENSOR_TENSOR_REVERSE_H
#define EIGEN_CXX11_TENSOR_TENSOR_REVERSE_H
namespace Eigen {
/** \class TensorReverse
* \ingroup CXX11_Tensor_Module
*
* \brief Tensor reverse elements class.
*
*/
namespace internal {
template<typename ReverseDimensions, typename XprType>
struct traits<TensorReverseOp<ReverseDimensions,
XprType> > : public traits<XprType>
{
typedef typename XprType::Scalar Scalar;
typedef traits<XprType> XprTraits;
typedef typename XprTraits::StorageKind StorageKind;
typedef typename XprTraits::Index Index;
typedef typename XprType::Nested Nested;
typedef typename remove_reference<Nested>::type _Nested;
static const int NumDimensions = XprTraits::NumDimensions;
static const int Layout = XprTraits::Layout;
};
template<typename ReverseDimensions, typename XprType>
struct eval<TensorReverseOp<ReverseDimensions, XprType>, Eigen::Dense>
{
typedef const TensorReverseOp<ReverseDimensions, XprType>& type;
};
template<typename ReverseDimensions, typename XprType>
struct nested<TensorReverseOp<ReverseDimensions, XprType>, 1,
typename eval<TensorReverseOp<ReverseDimensions, XprType> >::type>
{
typedef TensorReverseOp<ReverseDimensions, XprType> type;
};
} // end namespace internal
template<typename ReverseDimensions, typename XprType>
class TensorReverseOp : public TensorBase<TensorReverseOp<ReverseDimensions,
XprType>, WriteAccessors>
{
public:
typedef typename Eigen::internal::traits<TensorReverseOp>::Scalar Scalar;
typedef typename Eigen::NumTraits<Scalar>::Real RealScalar;
typedef typename XprType::CoeffReturnType CoeffReturnType;
typedef typename Eigen::internal::nested<TensorReverseOp>::type Nested;
typedef typename Eigen::internal::traits<TensorReverseOp>::StorageKind
StorageKind;
typedef typename Eigen::internal::traits<TensorReverseOp>::Index Index;
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorReverseOp(
const XprType& expr, const ReverseDimensions& reverse_dims)
: m_xpr(expr), m_reverse_dims(reverse_dims) { }
EIGEN_DEVICE_FUNC
const ReverseDimensions& reverse() const { return m_reverse_dims; }
EIGEN_DEVICE_FUNC
const typename internal::remove_all<typename XprType::Nested>::type&
expression() const { return m_xpr; }
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE TensorReverseOp& operator = (const TensorReverseOp& other)
{
typedef TensorAssignOp<TensorReverseOp, const TensorReverseOp> Assign;
Assign assign(*this, other);
internal::TensorExecutor<const Assign, DefaultDevice>::run(assign, DefaultDevice());
return *this;
}
template<typename OtherDerived>
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE TensorReverseOp& operator = (const OtherDerived& other)
{
typedef TensorAssignOp<TensorReverseOp, const OtherDerived> Assign;
Assign assign(*this, other);
internal::TensorExecutor<const Assign, DefaultDevice>::run(assign, DefaultDevice());
return *this;
}
protected:
typename XprType::Nested m_xpr;
const ReverseDimensions m_reverse_dims;
};
// Eval as rvalue
template<typename ReverseDimensions, typename ArgType, typename Device>
struct TensorEvaluator<const TensorReverseOp<ReverseDimensions, ArgType>, Device>
{
typedef TensorReverseOp<ReverseDimensions, ArgType> XprType;
typedef typename XprType::Index Index;
static const int NumDims = internal::array_size<ReverseDimensions>::value;
typedef DSizes<Index, NumDims> Dimensions;
typedef typename XprType::Scalar Scalar;
typedef typename XprType::CoeffReturnType CoeffReturnType;
typedef typename PacketType<CoeffReturnType, Device>::type PacketReturnType;
static const int PacketSize = internal::unpacket_traits<PacketReturnType>::size;
enum {
IsAligned = false,
PacketAccess = TensorEvaluator<ArgType, Device>::PacketAccess,
Layout = TensorEvaluator<ArgType, Device>::Layout,
CoordAccess = false, // to be implemented
RawAccess = false
};
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op,
const Device& device)
: m_impl(op.expression(), device), m_reverse(op.reverse())
{
// Reversing a scalar isn't supported yet. It would be a no-op anyway.
EIGEN_STATIC_ASSERT((NumDims > 0), YOU_MADE_A_PROGRAMMING_MISTAKE);
// Compute strides
m_dimensions = m_impl.dimensions();
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
m_strides[0] = 1;
for (int i = 1; i < NumDims; ++i) {
m_strides[i] = m_strides[i-1] * m_dimensions[i-1];
}
} else {
m_strides[NumDims-1] = 1;
for (int i = NumDims - 2; i >= 0; --i) {
m_strides[i] = m_strides[i+1] * m_dimensions[i+1];
}
}
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Dimensions& dimensions() const { return m_dimensions; }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(Scalar*) {
m_impl.evalSubExprsIfNeeded(NULL);
return true;
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void cleanup() {
m_impl.cleanup();
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index reverseIndex(
Index index) const {
eigen_assert(index < dimensions().TotalSize());
Index inputIndex = 0;
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
for (int i = NumDims - 1; i > 0; --i) {
Index idx = index / m_strides[i];
index -= idx * m_strides[i];
if (m_reverse[i]) {
idx = m_dimensions[i] - idx - 1;
}
inputIndex += idx * m_strides[i] ;
}
if (m_reverse[0]) {
inputIndex += (m_dimensions[0] - index - 1);
} else {
inputIndex += index;
}
} else {
for (int i = 0; i < NumDims - 1; ++i) {
Index idx = index / m_strides[i];
index -= idx * m_strides[i];
if (m_reverse[i]) {
idx = m_dimensions[i] - idx - 1;
}
inputIndex += idx * m_strides[i] ;
}
if (m_reverse[NumDims-1]) {
inputIndex += (m_dimensions[NumDims-1] - index - 1);
} else {
inputIndex += index;
}
}
return inputIndex;
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(
Index index) const {
return m_impl.coeff(reverseIndex(index));
}
template<int LoadMode>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
PacketReturnType packet(Index index) const
{
EIGEN_STATIC_ASSERT((PacketSize > 1), YOU_MADE_A_PROGRAMMING_MISTAKE)
eigen_assert(index+PacketSize-1 < dimensions().TotalSize());
// TODO(ndjaitly): write a better packing routine that uses
// local structure.
EIGEN_ALIGN_MAX typename internal::remove_const<CoeffReturnType>::type
values[PacketSize];
for (int i = 0; i < PacketSize; ++i) {
values[i] = coeff(index+i);
}
PacketReturnType rslt = internal::pload<PacketReturnType>(values);
return rslt;
}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorOpCost costPerCoeff(bool vectorized) const {
double compute_cost = NumDims * (2 * TensorOpCost::AddCost<Index>() +
2 * TensorOpCost::MulCost<Index>() +
TensorOpCost::DivCost<Index>());
for (int i = 0; i < NumDims; ++i) {
if (m_reverse[i]) {
compute_cost += 2 * TensorOpCost::AddCost<Index>();
}
}
return m_impl.costPerCoeff(vectorized) +
TensorOpCost(0, 0, compute_cost, false /* vectorized */, PacketSize);
}
EIGEN_DEVICE_FUNC Scalar* data() const { return NULL; }
/// required by sycl in order to extract the accessor
const TensorEvaluator<ArgType, Device> & impl() const { return m_impl; }
/// added for sycl in order to construct the buffer from sycl device
ReverseDimensions functor() const { return m_reverse; }
protected:
Dimensions m_dimensions;
array<Index, NumDims> m_strides;
TensorEvaluator<ArgType, Device> m_impl;
ReverseDimensions m_reverse;
};
// Eval as lvalue
template <typename ReverseDimensions, typename ArgType, typename Device>
struct TensorEvaluator<TensorReverseOp<ReverseDimensions, ArgType>, Device>
: public TensorEvaluator<const TensorReverseOp<ReverseDimensions, ArgType>,
Device> {
typedef TensorEvaluator<const TensorReverseOp<ReverseDimensions, ArgType>,
Device> Base;
typedef TensorReverseOp<ReverseDimensions, ArgType> XprType;
typedef typename XprType::Index Index;
static const int NumDims = internal::array_size<ReverseDimensions>::value;
typedef DSizes<Index, NumDims> Dimensions;
enum {
IsAligned = false,
PacketAccess = TensorEvaluator<ArgType, Device>::PacketAccess,
Layout = TensorEvaluator<ArgType, Device>::Layout,
CoordAccess = false, // to be implemented
RawAccess = false
};
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const XprType& op,
const Device& device)
: Base(op, device) {}
typedef typename XprType::Scalar Scalar;
typedef typename XprType::CoeffReturnType CoeffReturnType;
typedef typename PacketType<CoeffReturnType, Device>::type PacketReturnType;
static const int PacketSize = internal::unpacket_traits<PacketReturnType>::size;
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
const Dimensions& dimensions() const { return this->m_dimensions; }
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) {
return this->m_impl.coeffRef(this->reverseIndex(index));
}
template <int StoreMode> EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
void writePacket(Index index, const PacketReturnType& x) {
EIGEN_STATIC_ASSERT((PacketSize > 1), YOU_MADE_A_PROGRAMMING_MISTAKE)
eigen_assert(index+PacketSize-1 < dimensions().TotalSize());
// This code is pilfered from TensorMorphing.h
EIGEN_ALIGN_MAX CoeffReturnType values[PacketSize];
internal::pstore<CoeffReturnType, PacketReturnType>(values, x);
for (int i = 0; i < PacketSize; ++i) {
this->coeffRef(index+i) = values[i];
}
}
};
} // end namespace Eigen
#endif // EIGEN_CXX11_TENSOR_TENSOR_REVERSE_H
| {
"pile_set_name": "Github"
} |
object test {
case class AAA(i: Int)
}
object test2 {
import test.{AAA => BBB}
val x = BBB(<caret>)
}
//i: Int | {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 Liulishuo.com. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="441" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="demo" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
<rect key="frame" x="20" y="140" width="441" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
</constraints>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="548" y="455"/>
</view>
</objects>
</document>
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2003-2012 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
* compliance with the License. The rights granted to you under the License
* may not be used to create, or enable the creation or redistribution of,
* unlawful or unlicensed copies of an Apple operating system, or to
* circumvent, violate, or enable the circumvention or violation of, any
* terms of an Apple operating system software license agreement.
*
* Please obtain a copy of the License at
* http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
* Please see the License for the specific language governing rights and
* limitations under the License.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
#ifndef offsetof
#define offsetof(type, field) __offsetof(type, field)
#endif /* offsetof */
| {
"pile_set_name": "Github"
} |
#include "drake/multibody/benchmarks/mass_damper_spring/mass_damper_spring_analytical_solution.h"
#include <limits>
#include "drake/common/default_scalars.h"
#include "drake/common/drake_assert.h"
namespace drake {
namespace multibody {
namespace benchmarks {
// For `this` mass-damper-spring system, and with the given initial
// values, this method calculates the values of x, ẋ, ẍ at time t.
template <typename T>
Vector3<T> MassDamperSpringAnalyticalSolution<T>::CalculateOutput(
const T& t) const {
// TODO(@mitiguy) Enhance algorithm to allow for any real values of m, b, k,
// (except m = 0), e.g., to allow for unstable control systems.
DRAKE_DEMAND(m_ > 0 && b_ >= 0 && k_ > 0);
const T zeta = CalculateDampingRatio();
const T wn = CalculateNaturalFrequency();
return CalculateOutputImpl(zeta, wn, x0_, xDt0_, t);
}
// Calculates the values of x, ẋ, ẍ at time t associated with the ODE
// ẍ + 2 ζ ωₙ ẋ + ωₙ² = 0 and the given initial values.
// Algorithm from [Kane, 1985] Problem Set 14.7-14.10, Pages 349-352.
//
// - [Kane, 1985] "Dynamics: Theory and Applications," McGraw-Hill Book Co.,
// New York, 1985 (with D. A. Levinson). Available for free .pdf download:
// https://ecommons.cornell.edu/handle/1813/637
template <typename T>
Vector3<T> MassDamperSpringAnalyticalSolution<T>::CalculateOutputImpl(
const T& zeta, const T& wn, const T& x0, const T& xDt0, const T& t) {
// TODO(@mitiguy) Enhance algorithm to allow for any real values of zeta, wn.
DRAKE_DEMAND(zeta >= 0 && wn > 0);
// Quantities x, ẋ, ẍ are put into a three-element matrix and returned.
T x, xDt, xDtDt;
using std::abs;
using std::exp;
using std::sqrt;
using std::cos;
using std::sin;
constexpr double epsilon = std::numeric_limits<double>::epsilon();
const bool is_zeta_nearly_1 = abs(zeta - 1) < 10 * epsilon;
if (is_zeta_nearly_1) {
// Critically damped free vibration (zeta = 1).
const T A = x0;
const T B = xDt0 + wn * x0;
const T factor1 = A + B * t;
const T factor2 = exp(-wn * t);
x = factor1 * factor2;
const T factor1Dt = B;
const T factor2Dt = -wn * exp(-wn * t);
xDt = factor1Dt * factor2 + factor1 * factor2Dt;
const T factor2DtDt = wn * wn * exp(-wn * t);
xDtDt = 2 * factor1Dt * factor2Dt + factor1 * factor2DtDt;
} else if (zeta < 1) {
// Undamped or underdamped free vibration (0 <= zeta < 1).
const T wd = wn * sqrt(1 - zeta * zeta); // Damped natural frequency.
const T A = (xDt0 + zeta * wn * x0) / wd;
const T B = x0;
const T factor1 = A * sin(wd * t) + B * cos(wd * t);
const T factor2 = exp(-zeta * wn * t);
x = factor1 * factor2;
const T factor1Dt = A * wd * cos(wd * t) - B * wd * sin(wd * t);
const T factor2Dt = -zeta * wn * exp(-zeta * wn * t);
xDt = factor1Dt * factor2 + factor1 * factor2Dt;
const T factor1DtDt = -wd * wd * factor1;
const T factor2DtDt = (-zeta*wn) * (-zeta*wn) * exp(-zeta * wn * t);
xDtDt = factor1DtDt*factor2 + 2*factor1Dt*factor2Dt + factor1*factor2DtDt;
} else {
DRAKE_DEMAND(zeta > 1);
// Overdamped free vibration (zeta > 1).
const T p1 = -wn * (zeta - sqrt(zeta * zeta - 1));
const T p2 = -wn * (zeta + sqrt(zeta * zeta - 1));
const T A = (xDt0 - p2 * x0) / (p1 - p2);
const T B = (xDt0 - p1 * x0) / (p1 - p2);
const T term1 = A * exp(p1 * t);
const T term2 = B * exp(p2 * t);
x = term1 - term2;
const T term1Dt = A * p1 * exp(p1 * t);
const T term2Dt = B * p2 * exp(p2 * t);
xDt = term1Dt - term2Dt;
const T term1DtDt = A * p1 * p1 * exp(p1 * t);
const T term2DtDt = B * p2 * p2 * exp(p2 * t);
xDtDt = term1DtDt - term2DtDt;
}
Vector3<T> output;
output << x, xDt, xDtDt;
return output;
}
} // namespace benchmarks
} // namespace multibody
} // namespace drake
DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_NONSYMBOLIC_SCALARS(
class drake::multibody::benchmarks::MassDamperSpringAnalyticalSolution)
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2015 University of Basel, Graphics and Vision Research Group
*
* 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 scalismo.mesh.boundingSpheres
import scalismo.common.PointId
import scalismo.geometry.{_3D, Point}
import scalismo.mesh.{BarycentricCoordinates, BarycentricCoordinates4, TetrahedronId, TriangleId}
/**
* A class that contains the location and the distance to the closest point on a surface.
* @param point The closest point location on the surface.
* @param distanceSquared The squared distance to the closest point location.
*/
case class ClosestPoint(point: Point[_3D], distanceSquared: Double) {
def distance = Math.sqrt(distanceSquared)
def <(that: ClosestPoint): Boolean = {
this.distanceSquared < that.distanceSquared
}
def <(that: ClosestPointWithType): Boolean = {
this.distanceSquared < that.distanceSquared
}
}
/**
* The base type for all closest point types with additional information about the location of the point.
* @param point The closest point location on the surface.
* @param distanceSquared The squared distance to the closest point location.
*/
sealed abstract class ClosestPointWithType(val point: Point[_3D], val distanceSquared: Double) {
def <(that: ClosestPointWithType): Boolean = {
this.distanceSquared < that.distanceSquared
}
def distance = Math.sqrt(distanceSquared)
}
/**
* The closest point is a vertex.
* The additional information stored is the PointId of the vertex found.
* @param pid PointId of the closest vertex.
*/
case class ClosestPointIsVertex(override val point: Point[_3D], override val distanceSquared: Double, pid: PointId)
extends ClosestPointWithType(point, distanceSquared)
/**
* The closest point lies on a line.
* The additional information stored are the PointIds of the two end points of the line and the barycentric coordinate.
* @param pids Tuple of PointIds of the two end points of the line.
* @param bc The barycentric coordinates of the closest point location.
*/
case class ClosestPointOnLine(override val point: Point[_3D],
override val distanceSquared: Double,
pids: (PointId, PointId),
bc: Double)
extends ClosestPointWithType(point, distanceSquared)
/**
* The closest point is a vertex.
* The additional information stored is the TriangleId and the barycentric coordinates of the point.
* @param tid TriangleId of the triangle containing the closest point.
* @param bc The barycentric coordinates of the closest point location.
*/
case class ClosestPointInTriangle(override val point: Point[_3D],
override val distanceSquared: Double,
tid: TriangleId,
bc: BarycentricCoordinates)
extends ClosestPointWithType(point, distanceSquared)
case class ClosestPointInTriangleOfTetrahedron(override val point: Point[_3D],
override val distanceSquared: Double,
tetId: TetrahedronId,
triId: TriangleId,
bc: BarycentricCoordinates)
extends ClosestPointWithType(point, distanceSquared)
/**
* The closest point is a vertex.
* The additional information stored is the TriangleId and the barycentric coordinates of the point.
* @param tid TriangleId of the tetrahedral containing the closest point.
* @param bc The barycentric coordinates of the closest point location.
*/
case class ClosestPointInTetrahedron(override val point: Point[_3D],
override val distanceSquared: Double,
tid: TetrahedronId,
bc: BarycentricCoordinates4)
extends ClosestPointWithType(point, distanceSquared)
| {
"pile_set_name": "Github"
} |
<div class="apiDetail">
<div>
<h2><span>String</span><span class="path">setting.data.simpleData.</span>pIdKey</h2>
<h3>Overview<span class="h3_info">[ depends on <span class="highlight_green">jquery.ztree.core</span> js ]</span></h3>
<div class="desc">
<p></p>
<div class="longdesc">
<p>The node data's attribute to save its parent node data's unique identifier. It is valid when <span class="highlight_red">[setting.data.simpleData.enable = true]</span></p>
<p>Default: "pId"</p>
</div>
</div>
<h3>Examples of setting</h3>
<h4>1. use the simple data format</h4>
<pre xmlns=""><code>var setting = {
data: {
simpleData: {
enable: true,
idKey: "id",
pIdKey: "pId",
rootPId: 0
}
}
};
var treeNodes = [
{"id":1, "pId":0, "name":"test1"},
{"id":11, "pId":1, "name":"test11"},
{"id":12, "pId":1, "name":"test12"},
{"id":111, "pId":11, "name":"test111"}
];
......</code></pre>
</div>
</div> | {
"pile_set_name": "Github"
} |
/*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
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_ANY_NS_MARCH_13_2007_0827AM)
#define BOOST_SPIRIT_ANY_NS_MARCH_13_2007_0827AM
#if defined(_MSC_VER)
#pragma once
#endif
#include <boost/mpl/bool.hpp>
#include <boost/fusion/include/equal_to.hpp>
#include <boost/fusion/include/next.hpp>
#include <boost/fusion/include/deref.hpp>
#include <boost/fusion/include/begin.hpp>
#include <boost/fusion/include/end.hpp>
#include <boost/fusion/include/any.hpp>
#include <boost/spirit/home/support/unused.hpp>
namespace boost { namespace spirit
{
// A non-short circuiting (ns) version of the any algorithm (uses
// | instead of ||.
namespace detail
{
template <typename First1, typename Last, typename First2, typename F>
inline bool
any_ns(First1 const&, First2 const&, Last const&, F const&, mpl::true_)
{
return false;
}
template <typename First1, typename Last, typename First2, typename F>
inline bool
any_ns(First1 const& first1, First2 const& first2, Last const& last, F& f, mpl::false_)
{
return (0 != (f(*first1, *first2) |
detail::any_ns(
fusion::next(first1)
, fusion::next(first2)
, last
, f
, fusion::result_of::equal_to<
typename fusion::result_of::next<First1>::type, Last>())));
}
template <typename First, typename Last, typename F>
inline bool
any_ns(First const&, Last const&, F const&, mpl::true_)
{
return false;
}
template <typename First, typename Last, typename F>
inline bool
any_ns(First const& first, Last const& last, F& f, mpl::false_)
{
return (0 != (f(*first) |
detail::any_ns(
fusion::next(first)
, last
, f
, fusion::result_of::equal_to<
typename fusion::result_of::next<First>::type, Last>())));
}
}
template <typename Sequence1, typename Sequence2, typename F>
inline bool
any_ns(Sequence1 const& seq1, Sequence2& seq2, F f)
{
return detail::any_ns(
fusion::begin(seq1)
, fusion::begin(seq2)
, fusion::end(seq1)
, f
, fusion::result_of::equal_to<
typename fusion::result_of::begin<Sequence1>::type
, typename fusion::result_of::end<Sequence1>::type>());
}
template <typename Sequence, typename F>
inline bool
any_ns(Sequence const& seq, unused_type, F f)
{
return detail::any_ns(
fusion::begin(seq)
, fusion::end(seq)
, f
, fusion::result_of::equal_to<
typename fusion::result_of::begin<Sequence>::type
, typename fusion::result_of::end<Sequence>::type>());
}
}}
#endif
| {
"pile_set_name": "Github"
} |
# SMO.py - by Ac_K
# Thanks to WerWolv and Leoetlino for helped me!
import edizon, io, operator
from byml import *
savedata_buffer = edizon.getSaveFileBuffer()
savedata_header = savedata_buffer[0:0xC]
savedata_dict = bymlbuffer_to_object(savedata_buffer[0x10:]) # skip the save data header
# TODO: Add more editable values :P
# print(savedata_dict)
def get_first_empty_index(item_list):
i = 0
for x in item_list:
if x == "":
return i
i += 1
return -1
def find_item_index(item_list, item):
i = 0
for x in item_list:
if x == item:
return i
i += 1
return -1
def remove_from_category(item_list, item):
index_item = find_item_index(item_list, item)
if index_item != -1:
del item_list[index_item]
item_list.append('')
def add_to_category(item_list, item):
if item not in item_list:
empty_index = get_first_empty_index(item_list)
item_list[empty_index] = item
def getValueFromSaveFile():
strArgs = edizon.getStrArgs()
intArgs = edizon.getIntArgs()
itemType = strArgs[0]
if itemType == "Number":
return int(savedata_dict[strArgs[1]])
if itemType == "ListItem":
item_list = savedata_dict[strArgs[1]]
item_index = find_item_index(item_list, strArgs[2])
if item_index >= 0:
return 1
else:
return 0
def setValueInSaveFile(value):
global savedata_dict
strArgs = edizon.getStrArgs()
intArgs = edizon.getIntArgs()
itemType = strArgs[0]
if itemType == "Number":
if intArgs[0] == 0: recast_value = Int(value)
if intArgs[0] == 4: recast_value = UInt(value)
if intArgs[0] == 8: recast_value = UInt64(value)
if intArgs[0] == 10: recast_value = Double(value)
if intArgs[0] == 11: recast_value = Float(value)
savedata_dict[strArgs[1]] = recast_value
if itemType == "ListItem":
item_list = savedata_dict[strArgs[1]]
if value == 1:
add_to_category(item_list, strArgs[2])
if value == 0:
remove_from_category(item_list, strArgs[2])
savedata_dict[strArgs[1]] = item_list
def getModifiedSaveFile():
modified_savedata_byml = object_to_bymlbuffer(savedata_dict, False, 3)
# store new byml size
byml_size = modified_savedata_byml.getbuffer().nbytes
# write some dummy bytes to get the right save size
modified_savedata_byml.seek(0x20000B - 0x10)
modified_savedata_byml.write(bytes(0x01))
modified_savedata_byml.seek(0)
# TODO: Handle the whole 0x10 header
# 0x00 - u32 - CRC32 checkum from 0x04 to EOF
# 0x04 - u32 - Version? (Always 0x01)
# 0x08 - u32 - Save file size
# 0x0C - u32 - Byml section size
# write back the header without the byml size
output_buffer = savedata_header
# write the new byml size
output_buffer += struct.pack("<I", byml_size)
# write the byml data
output_buffer += modified_savedata_byml.getvalue()
return output_buffer | {
"pile_set_name": "Github"
} |
<ul class="sidebar-item nav nav-list" ng-controller="SidebarCtrl as sidebar">
<li ng-class="{'active': sidebar.isActive('gettingStarted')}">
<a ui-sref="gettingStarted" class="faa-parent animated-hover">
<i class="fa fa-gear faa-spin"></i> Getting started
</a>
</li>
<!-- ******************************************************************* -->
<li ng-class="{'active': sidebar.isBasicUsageActive()}">
<a class="faa-parent animated-hover" ng-click="sidebar.isBasicUsageCollapsed = !sidebar.isBasicUsageCollapsed; $event.stopProgragation()">
<i class="fa fa-play faa-horizontal"></i> Basic usage
<b class="arrow fa fa-angle-down"></b>
</a>
<ul class="submenu" collapse="!sidebar.isBasicUsageCollapsed">
<li ng-repeat="basicUsage in sidebar.basicUsages"
ng-class="{'active': sidebar.isActive(basicUsage.name)}">
<a ui-sref="{{ basicUsage.name }}">
<i class="menu-icon fa fa-caret-right"></i> {{ basicUsage.label }}
</a>
</li>
</ul>
</li>
<li ng-class="{'active': sidebar.isAdvancedUsageActive()}">
<a class="faa-parent animated-hover" ng-click="sidebar.isAdvancedUsageCollapsed = !sidebar.isAdvancedUsageCollapsed; $event.stopProgragation()">
<i class="fa fa-play faa-horizontal"></i> Advanced usage
<b class="arrow fa fa-angle-down"></b>
</a>
<ul class="submenu" collapse="!sidebar.isAdvancedUsageCollapsed">
<li ng-repeat="advancedUsage in sidebar.advancedUsages"
ng-class="{'active': sidebar.isActive(advancedUsage.name)}">
<a ui-sref="{{ advancedUsage.name }}">
<i class="menu-icon fa fa-caret-right"></i> {{ advancedUsage.label }}
</a>
</li>
</ul>
</li>
<li ng-class="{'active': sidebar.isWithPluginsUsageActive()}">
<a class="faa-parent animated-hover" ng-click="sidebar.isWithPluginsUsageCollapsed = !sidebar.isWithPluginsUsageCollapsed; $event.stopProgragation()">
<i class="fa fa-play faa-horizontal"></i> With plugins
<b class="arrow fa fa-angle-down"></b>
</a>
<ul class="submenu" collapse="!sidebar.isWithPluginsUsageCollapsed">
<li ng-repeat="withPluginsUsage in sidebar.withPluginsUsages"
ng-class="{'active': sidebar.isActive(withPluginsUsage.name)}">
<a ui-sref="{{ withPluginsUsage.name }}">
<i class="menu-icon fa fa-caret-right"></i> {{ withPluginsUsage.label }}
</a>
</li>
</ul>
</li>
<!-- ******************************************************************* -->
<li ng-class="{'active': sidebar.isActive('api')}">
<a class="faa-parent animated-hover" ui-sref="api">
<i class="fa fa-code faa-tada"></i> API
</a>
</li>
<li>
<a class="faa-parent animated-hover" ng-click="sidebar.isArchiveCollapsed = !sidebar.isArchiveCollapsed; $event.stopProgragation()">
<i class="fa fa-archive faa-shake"></i> Archives
<b class="arrow fa fa-angle-down"></b>
</a>
<ul class="submenu" collapse="!sidebar.isArchiveCollapsed">
<li ng-repeat="archive in sidebar.archives">
<a href="/angular-datatables/archives/{{ archive.full }}">
<i class="menu-icon fa fa-caret-right"></i> {{ archive.full }}
</a>
</li>
</ul>
</li>
</ul>
| {
"pile_set_name": "Github"
} |
//
// SchedulerType+SharedSequence.swift
// RxCocoa
//
// Created by Krunoslav Zaher on 8/27/17.
// Copyright © 2017 Krunoslav Zaher. All rights reserved.
//
import RxSwift
public enum SharingScheduler {
/// Default scheduler used in SharedSequence based traits.
public private(set) static var make: () -> SchedulerType = { MainScheduler() }
/**
This method can be used in unit tests to ensure that built in shared sequences are using mock schedulers instead
of main schedulers.
**This shouldn't be used in normal release builds.**
*/
static public func mock(scheduler: SchedulerType, action: () -> ()) {
return mock(makeScheduler: { scheduler }, action: action)
}
/**
This method can be used in unit tests to ensure that built in shared sequences are using mock schedulers instead
of main schedulers.
**This shouldn't be used in normal release builds.**
*/
static public func mock(makeScheduler: @escaping () -> SchedulerType, action: () -> ()) {
let originalMake = make
make = makeScheduler
action()
// If you remove this line , compiler buggy optimizations will change behavior of this code
_forceCompilerToStopDoingInsaneOptimizationsThatBreakCode(makeScheduler)
// Scary, I know
make = originalMake
}
}
#if os(Linux)
import Glibc
#else
import func Foundation.arc4random
#endif
func _forceCompilerToStopDoingInsaneOptimizationsThatBreakCode(_ scheduler: () -> SchedulerType) {
let a: Int32 = 1
#if os(Linux)
let b = 314 + Int32(Glibc.random() & 1)
#else
let b = 314 + Int32(arc4random() & 1)
#endif
if a == b {
print(scheduler())
}
}
| {
"pile_set_name": "Github"
} |
the heist of a flawless , 84 carat diamond , fixed bare knuckle fights , irish gypsies and a dog are just some of the goings on in director guy ritchies's sophomore feature , " snatch . "
" lock , stock and two smoking barrels " intro'd helmer/scripter ritchie with a hyper-kinetic , in your face underworld comedy that grabbed the viewer's attention from beginning to end .
his protagonists were innocents set adrift in a see of sharks to swim or be eaten alive .
with " snatch , " the director doesn't remake his first work , but he does delve more deeply into the criminal underbelly of london , mining a rich collection of characters in the process .
>from the very beginning , " snatch " tosses you into the action with the theft of the fabulous diamond , the desire of new york gangster avi ( dennis farina ) .
en route from antwerp , diamond thief and courier frankie four fingers ( benicio del toro ) stops in london to make a separate deal with avi's partner and cousin , doug " the head " ( mike reid ) .
frankie's addiction to gambling tempts him into making a bet on an illegal boxing match for boris " the blade " ( rade sherbedgia ) , a ruthless russian mobster .
the bet turns out to be a setup for a robbery by a trio of bumbling incompetents - vinnie ( robbie gee ) , sol ( lennie james ) and portly tyrone ( ade ) - that goes miserably awry .
meanwhile , a couple of young toughs , turkish ( jason stratham ) and tommy ( stephen graham ) , are trying to break in to the boxing game with the help of local villain brick top ( alan ford ) , who also owns a pig farm .
when their first fighter is put out of action , with one punch , by a wild irish gypsy named mickey o'neil , they figure to put the loose canon in as the contender in a fixed fight .
mickey proves less than reliable and goes against turkish and tommy's deal .
brick top , impressed by mickey's performance , decides to gives them another chance - after calmly explaining that it takes 16 pigs about eight minutes to completely devour a corpse .
when avi doesn't get his precious rock , he jumps on a plane for london and hires a local legend , " bullet tooth " tony ( vinnie jones ) , to find frankie and the diamond .
things spiral out of control as all these forces head on a collision course of double-cross and double-deals - and a dog that ate a squeaky toy .
guy ritchie ( mr . madonna to some ) is an extraordinarily talented auteur who has a wonderful knack for pulling together his unique collection of cast and crew and feeding them funny and gritty dialog that spews out of the characters' mouths like machine gun fire .
the helmer marshals his large ensemble actors in a frantically paced caper comedy that makes you laugh and feel queasy at the same time , the above description by brick top being just one example .
the assemblage of actors and non-actors in rough-and-tumble settings gives " snatch " an earthy feel in its depiction of london's criminal underworld .
the cast of characters is too large to credit here , but two of the performances - first among equals , you might say - are worth noting .
alan ford is brilliant as the ruthless , evil brick top .
when he refuses sugar in his tea because " i'm sweet enough , " it makes you shiver , even as you laugh .
his is one of the best gangster characters i've seen in years .
the other outstanding perf is given by none other than brad pitt , the name actor the movie's popularity may hang upon , at least initially .
pitt , as mickey o'neil , is hard drinking , hard fighting , highly unreliable and nearly incomprehensible with a unique irish brogue and dialect of the pikers , the irish travelers of europe .
this gypsy brigand would steal the fillings from your teeth , especially if it would benefit his beloved mum ( sorcha cusack ) .
when brick top threaten the safety of mickey's family , he makes an enemy that cannot be stopped .
pitt puts a credible spin on his character and does some incredible physical stuff , too , as a bare-knuckle boxer .
the production team behind the camera includes ritchie alumni , producer matthew vaughn and lenser tim maurice-jones , and other talented technical artist that bring the hyperactive imagination of the author to visual life .
there is a patent feel to the look of " snatch " and " lock , stock and two smoking barrels " that reeks of " signature " for ritchie , but i'm not sure how this will translate in his future works .
there is so much talent in the filmmaker that i would like to see him branch out in other directions .
nonetheless , " snatch " is terrific sophomore effort , a darn good action comedy and a hoot to boot .
i give it a b+ .
| {
"pile_set_name": "Github"
} |
--
-- MULTI_JOIN_PRUNING
--
-- Check that join-pruning works for joins between two relations. For now
-- we only check for join-pruning between locally partitioned relations. In the
-- future we want to check for pruning between re-partitioned relations as well.
SET citus.explain_distributed_queries TO off;
SET client_min_messages TO DEBUG2;
SELECT sum(l_linenumber), avg(l_linenumber) FROM lineitem, orders
WHERE l_orderkey = o_orderkey;
DEBUG: Router planner does not support append-partitioned tables.
DEBUG: join prunable for intervals [1,5986] and [8997,14947]
DEBUG: join prunable for intervals [8997,14947] and [1,5986]
sum | avg
---------------------------------------------------------------------
36089 | 3.0074166666666667
(1 row)
SELECT sum(l_linenumber), avg(l_linenumber) FROM lineitem, orders
WHERE l_orderkey = o_orderkey AND l_orderkey > 9030;
DEBUG: Router planner does not support append-partitioned tables.
DEBUG: join prunable for intervals [8997,14947] and [1,5986]
sum | avg
---------------------------------------------------------------------
17999 | 3.0189533713518953
(1 row)
-- Shards for the lineitem table have been pruned away. Check that join pruning
-- works as expected in this case.
SELECT sum(l_linenumber), avg(l_linenumber) FROM lineitem, orders
WHERE l_orderkey = o_orderkey AND l_orderkey > 20000;
DEBUG: Router planner does not support append-partitioned tables.
sum | avg
---------------------------------------------------------------------
|
(1 row)
-- Partition pruning left three shards for the lineitem and one shard for the
-- orders table. These shard sets don't overlap, so join pruning should prune
-- out all the shards, and leave us with an empty task list.
SELECT sum(l_linenumber), avg(l_linenumber) FROM lineitem, orders
WHERE l_orderkey = o_orderkey AND l_orderkey > 6000 AND o_orderkey < 6000;
DEBUG: Router planner does not support append-partitioned tables.
sum | avg
---------------------------------------------------------------------
|
(1 row)
-- Make sure that we can handle filters without a column
SELECT sum(l_linenumber), avg(l_linenumber) FROM lineitem, orders
WHERE l_orderkey = o_orderkey AND false;
DEBUG: Router planner does not support append-partitioned tables.
sum | avg
---------------------------------------------------------------------
|
(1 row)
SELECT sum(l_linenumber), avg(l_linenumber)
FROM lineitem INNER JOIN orders ON (l_orderkey = o_orderkey)
WHERE false;
DEBUG: Router planner does not support append-partitioned tables.
sum | avg
---------------------------------------------------------------------
|
(1 row)
-- These tests check that we can do join pruning for tables partitioned over
-- different type of columns including varchar, array types, composite types
-- etc. This is in response to a bug we had where we were not able to resolve
-- correct operator types for some kind of column types.
EXPLAIN (COSTS OFF)
SELECT count(*)
FROM array_partitioned_table table1, array_partitioned_table table2
WHERE table1.array_column = table2.array_column;
DEBUG: Router planner does not support append-partitioned tables.
DEBUG: join prunable for intervals [{},{AZZXSP27F21T6,AZZXSP27F21T6}] and [{BA1000U2AMO4ZGX,BZZXSP27F21T6},{CA1000U2AMO4ZGX,CZZXSP27F21T6}]
DEBUG: join prunable for intervals [{BA1000U2AMO4ZGX,BZZXSP27F21T6},{CA1000U2AMO4ZGX,CZZXSP27F21T6}] and [{},{AZZXSP27F21T6,AZZXSP27F21T6}]
QUERY PLAN
---------------------------------------------------------------------
Aggregate
-> Custom Scan (Citus Adaptive)
explain statements for distributed queries are not enabled
(3 rows)
EXPLAIN (COSTS OFF)
SELECT count(*)
FROM composite_partitioned_table table1, composite_partitioned_table table2
WHERE table1.composite_column = table2.composite_column;
DEBUG: Router planner does not support append-partitioned tables.
DEBUG: join prunable for intervals [(a,3,b),(b,4,c)] and [(c,5,d),(d,6,e)]
DEBUG: join prunable for intervals [(c,5,d),(d,6,e)] and [(a,3,b),(b,4,c)]
QUERY PLAN
---------------------------------------------------------------------
Aggregate
-> Custom Scan (Citus Adaptive)
explain statements for distributed queries are not enabled
(3 rows)
-- Test that large table joins on partition varchar columns work
EXPLAIN (COSTS OFF)
SELECT count(*)
FROM varchar_partitioned_table table1, varchar_partitioned_table table2
WHERE table1.varchar_column = table2.varchar_column;
DEBUG: Router planner does not support append-partitioned tables.
DEBUG: join prunable for intervals [AA1000U2AMO4ZGX,AZZXSP27F21T6] and [BA1000U2AMO4ZGX,BZZXSP27F21T6]
DEBUG: join prunable for intervals [BA1000U2AMO4ZGX,BZZXSP27F21T6] and [AA1000U2AMO4ZGX,AZZXSP27F21T6]
QUERY PLAN
---------------------------------------------------------------------
Aggregate
-> Custom Scan (Citus Adaptive)
explain statements for distributed queries are not enabled
(3 rows)
| {
"pile_set_name": "Github"
} |
.. _idle:
IDLE
====
.. index::
single: IDLE
single: Python Editor
single: Integrated Development Environment
.. moduleauthor:: Guido van Rossum <[email protected]>
IDLE is Python's Integrated Development and Learning Environment.
IDLE has the following features:
* coded in 100% pure Python, using the :mod:`tkinter` GUI toolkit
* cross-platform: works mostly the same on Windows, Unix, and Mac OS X
* Python shell window (interactive interpreter) with colorizing
of code input, output, and error messages
* multi-window text editor with multiple undo, Python colorizing,
smart indent, call tips, auto completion, and other features
* search within any window, replace within editor windows, and search
through multiple files (grep)
* debugger with persistent breakpoints, stepping, and viewing
of global and local namespaces
* configuration, browsers, and other dialogs
Menus
-----
IDLE has two main window types, the Shell window and the Editor window. It is
possible to have multiple editor windows simultaneously. Output windows, such
as used for Edit / Find in Files, are a subtype of edit window. They currently
have the same top menu as Editor windows but a different default title and
context menu.
IDLE's menus dynamically change based on which window is currently selected.
Each menu documented below indicates which window type it is associated with.
File menu (Shell and Editor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
New File
Create a new file editing window.
Open...
Open an existing file with an Open dialog.
Recent Files
Open a list of recent files. Click one to open it.
Open Module...
Open an existing module (searches sys.path).
.. index::
single: Class browser
single: Path browser
Class Browser
Show functions, classes, and methods in the current Editor file in a
tree structure. In the shell, open a module first.
Path Browser
Show sys.path directories, modules, functions, classes and methods in a
tree structure.
Save
Save the current window to the associated file, if there is one. Windows
that have been changed since being opened or last saved have a \* before
and after the window title. If there is no associated file,
do Save As instead.
Save As...
Save the current window with a Save As dialog. The file saved becomes the
new associated file for the window.
Save Copy As...
Save the current window to different file without changing the associated
file.
Print Window
Print the current window to the default printer.
Close
Close the current window (ask to save if unsaved).
Exit
Close all windows and quit IDLE (ask to save unsaved windows).
Edit menu (Shell and Editor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Undo
Undo the last change to the current window. A maximum of 1000 changes may
be undone.
Redo
Redo the last undone change to the current window.
Cut
Copy selection into the system-wide clipboard; then delete the selection.
Copy
Copy selection into the system-wide clipboard.
Paste
Insert contents of the system-wide clipboard into the current window.
The clipboard functions are also available in context menus.
Select All
Select the entire contents of the current window.
Find...
Open a search dialog with many options
Find Again
Repeat the last search, if there is one.
Find Selection
Search for the currently selected string, if there is one.
Find in Files...
Open a file search dialog. Put results in a new output window.
Replace...
Open a search-and-replace dialog.
Go to Line
Move cursor to the line number requested and make that line visible.
Show Completions
Open a scrollable list allowing selection of keywords and attributes. See
Completions in the Tips sections below.
Expand Word
Expand a prefix you have typed to match a full word in the same window;
repeat to get a different expansion.
Show call tip
After an unclosed parenthesis for a function, open a small window with
function parameter hints.
Show surrounding parens
Highlight the surrounding parenthesis.
Format menu (Editor window only)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Indent Region
Shift selected lines right by the indent width (default 4 spaces).
Dedent Region
Shift selected lines left by the indent width (default 4 spaces).
Comment Out Region
Insert ## in front of selected lines.
Uncomment Region
Remove leading # or ## from selected lines.
Tabify Region
Turn *leading* stretches of spaces into tabs. (Note: We recommend using
4 space blocks to indent Python code.)
Untabify Region
Turn *all* tabs into the correct number of spaces.
Toggle Tabs
Open a dialog to switch between indenting with spaces and tabs.
New Indent Width
Open a dialog to change indent width. The accepted default by the Python
community is 4 spaces.
Format Paragraph
Reformat the current blank-line-delimited paragraph in comment block or
multiline string or selected line in a string. All lines in the
paragraph will be formatted to less than N columns, where N defaults to 72.
Strip trailing whitespace
Remove any space characters after the last non-space character of a line.
.. index::
single: Run script
Run menu (Editor window only)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Python Shell
Open or wake up the Python Shell window.
Check Module
Check the syntax of the module currently open in the Editor window. If the
module has not been saved IDLE will either prompt the user to save or
autosave, as selected in the General tab of the Idle Settings dialog. If
there is a syntax error, the approximate location is indicated in the
Editor window.
Run Module
Do Check Module (above). If no error, restart the shell to clean the
environment, then execute the module. Output is displayed in the Shell
window. Note that output requires use of ``print`` or ``write``.
When execution is complete, the Shell retains focus and displays a prompt.
At this point, one may interactively explore the result of execution.
This is similar to executing a file with ``python -i file`` at a command
line.
Shell menu (Shell window only)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
View Last Restart
Scroll the shell window to the last Shell restart.
Restart Shell
Restart the shell to clean the environment.
Interrupt Execution
Stop a running program.
Debug menu (Shell window only)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Go to File/Line
Look on the current line. with the cursor, and the line above for a filename
and line number. If found, open the file if not already open, and show the
line. Use this to view source lines referenced in an exception traceback
and lines found by Find in Files. Also available in the context menu of
the Shell window and Output windows.
.. index::
single: debugger
single: stack viewer
Debugger (toggle)
When activated, code entered in the Shell or run from an Editor will run
under the debugger. In the Editor, breakpoints can be set with the context
menu. This feature is still incomplete and somewhat experimental.
Stack Viewer
Show the stack traceback of the last exception in a tree widget, with
access to locals and globals.
Auto-open Stack Viewer
Toggle automatically opening the stack viewer on an unhandled exception.
Options menu (Shell and Editor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Configure IDLE
Open a configuration dialog and change preferences for the following:
fonts, indentation, keybindings, text color themes, startup windows and
size, additional help sources, and extensions (see below). On OS X,
open the configuration dialog by selecting Preferences in the application
menu. To use a new built-in color theme (IDLE Dark) with older IDLEs,
save it as a new custom theme.
Non-default user settings are saved in a .idlerc directory in the user's
home directory. Problems caused by bad user configuration files are solved
by editing or deleting one or more of the files in .idlerc.
Code Context (toggle)(Editor Window only)
Open a pane at the top of the edit window which shows the block context
of the code which has scrolled above the top of the window.
Window menu (Shell and Editor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Zoom Height
Toggles the window between normal size and maximum height. The initial size
defaults to 40 lines by 80 chars unless changed on the General tab of the
Configure IDLE dialog.
The rest of this menu lists the names of all open windows; select one to bring
it to the foreground (deiconifying it if necessary).
Help menu (Shell and Editor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
About IDLE
Display version, copyright, license, credits, and more.
IDLE Help
Display a help file for IDLE detailing the menu options, basic editing and
navigation, and other tips.
Python Docs
Access local Python documentation, if installed, or start a web browser
and open docs.python.org showing the latest Python documentation.
Turtle Demo
Run the turtledemo module with example python code and turtle drawings.
Additional help sources may be added here with the Configure IDLE dialog under
the General tab.
.. index::
single: Cut
single: Copy
single: Paste
single: Set Breakpoint
single: Clear Breakpoint
single: breakpoints
Context Menus
^^^^^^^^^^^^^^^^^^^^^^^^^^
Open a context menu by right-clicking in a window (Control-click on OS X).
Context menus have the standard clipboard functions also on the Edit menu.
Cut
Copy selection into the system-wide clipboard; then delete the selection.
Copy
Copy selection into the system-wide clipboard.
Paste
Insert contents of the system-wide clipboard into the current window.
Editor windows also have breakpoint functions. Lines with a breakpoint set are
specially marked. Breakpoints only have an effect when running under the
debugger. Breakpoints for a file are saved in the user's .idlerc directory.
Set Breakpoint
Set a breakpoint on the current line.
Clear Breakpoint
Clear the breakpoint on that line.
Shell and Output windows have the following.
Go to file/line
Same as in Debug menu.
Editing and navigation
----------------------
In this section, 'C' refers to the :kbd:`Control` key on Windows and Unix and
the :kbd:`Command` key on Mac OSX.
* :kbd:`Backspace` deletes to the left; :kbd:`Del` deletes to the right
* :kbd:`C-Backspace` delete word left; :kbd:`C-Del` delete word to the right
* Arrow keys and :kbd:`Page Up`/:kbd:`Page Down` to move around
* :kbd:`C-LeftArrow` and :kbd:`C-RightArrow` moves by words
* :kbd:`Home`/:kbd:`End` go to begin/end of line
* :kbd:`C-Home`/:kbd:`C-End` go to begin/end of file
* Some useful Emacs bindings are inherited from Tcl/Tk:
* :kbd:`C-a` beginning of line
* :kbd:`C-e` end of line
* :kbd:`C-k` kill line (but doesn't put it in clipboard)
* :kbd:`C-l` center window around the insertion point
* :kbd:`C-b` go backward one character without deleting (usually you can
also use the cursor key for this)
* :kbd:`C-f` go forward one character without deleting (usually you can
also use the cursor key for this)
* :kbd:`C-p` go up one line (usually you can also use the cursor key for
this)
* :kbd:`C-d` delete next character
Standard keybindings (like :kbd:`C-c` to copy and :kbd:`C-v` to paste)
may work. Keybindings are selected in the Configure IDLE dialog.
Automatic indentation
^^^^^^^^^^^^^^^^^^^^^
After a block-opening statement, the next line is indented by 4 spaces (in the
Python Shell window by one tab). After certain keywords (break, return etc.)
the next line is dedented. In leading indentation, :kbd:`Backspace` deletes up
to 4 spaces if they are there. :kbd:`Tab` inserts spaces (in the Python
Shell window one tab), number depends on Indent width. Currently, tabs
are restricted to four spaces due to Tcl/Tk limitations.
See also the indent/dedent region commands in the edit menu.
Completions
^^^^^^^^^^^
Completions are supplied for functions, classes, and attributes of classes,
both built-in and user-defined. Completions are also provided for
filenames.
The AutoCompleteWindow (ACW) will open after a predefined delay (default is
two seconds) after a '.' or (in a string) an os.sep is typed. If after one
of those characters (plus zero or more other characters) a tab is typed
the ACW will open immediately if a possible continuation is found.
If there is only one possible completion for the characters entered, a
:kbd:`Tab` will supply that completion without opening the ACW.
'Show Completions' will force open a completions window, by default the
:kbd:`C-space` will open a completions window. In an empty
string, this will contain the files in the current directory. On a
blank line, it will contain the built-in and user-defined functions and
classes in the current namespaces, plus any modules imported. If some
characters have been entered, the ACW will attempt to be more specific.
If a string of characters is typed, the ACW selection will jump to the
entry most closely matching those characters. Entering a :kbd:`tab` will
cause the longest non-ambiguous match to be entered in the Editor window or
Shell. Two :kbd:`tab` in a row will supply the current ACW selection, as
will return or a double click. Cursor keys, Page Up/Down, mouse selection,
and the scroll wheel all operate on the ACW.
"Hidden" attributes can be accessed by typing the beginning of hidden
name after a '.', e.g. '_'. This allows access to modules with
``__all__`` set, or to class-private attributes.
Completions and the 'Expand Word' facility can save a lot of typing!
Completions are currently limited to those in the namespaces. Names in
an Editor window which are not via ``__main__`` and :data:`sys.modules` will
not be found. Run the module once with your imports to correct this situation.
Note that IDLE itself places quite a few modules in sys.modules, so
much can be found by default, e.g. the re module.
If you don't like the ACW popping up unbidden, simply make the delay
longer or disable the extension.
Calltips
^^^^^^^^
A calltip is shown when one types :kbd:`(` after the name of an *accessible*
function. A name expression may include dots and subscripts. A calltip
remains until it is clicked, the cursor is moved out of the argument area,
or :kbd:`)` is typed. When the cursor is in the argument part of a definition,
the menu or shortcut display a calltip.
A calltip consists of the function signature and the first line of the
docstring. For builtins without an accessible signature, the calltip
consists of all lines up the fifth line or the first blank line. These
details may change.
The set of *accessible* functions depends on what modules have been imported
into the user process, including those imported by Idle itself,
and what definitions have been run, all since the last restart.
For example, restart the Shell and enter ``itertools.count(``. A calltip
appears because Idle imports itertools into the user process for its own use.
(This could change.) Enter ``turtle.write(`` and nothing appears. Idle does
not import turtle. The menu or shortcut do nothing either. Enter
``import turtle`` and then ``turtle.write(`` will work.
In an editor, import statements have no effect until one runs the file. One
might want to run a file after writing the import statements at the top,
or immediately run an existing file before editing.
Python Shell window
^^^^^^^^^^^^^^^^^^^
* :kbd:`C-c` interrupts executing command
* :kbd:`C-d` sends end-of-file; closes window if typed at a ``>>>`` prompt
* :kbd:`Alt-/` (Expand word) is also useful to reduce typing
Command history
* :kbd:`Alt-p` retrieves previous command matching what you have typed. On
OS X use :kbd:`C-p`.
* :kbd:`Alt-n` retrieves next. On OS X use :kbd:`C-n`.
* :kbd:`Return` while on any previous command retrieves that command
Text colors
^^^^^^^^^^^
Idle defaults to black on white text, but colors text with special meanings.
For the shell, these are shell output, shell error, user output, and
user error. For Python code, at the shell prompt or in an editor, these are
keywords, builtin class and function names, names following ``class`` and
``def``, strings, and comments. For any text window, these are the cursor (when
present), found text (when possible), and selected text.
Text coloring is done in the background, so uncolorized text is occasionally
visible. To change the color scheme, use the Configure IDLE dialog
Highlighting tab. The marking of debugger breakpoint lines in the editor and
text in popups and dialogs is not user-configurable.
Startup and code execution
--------------------------
Upon startup with the ``-s`` option, IDLE will execute the file referenced by
the environment variables :envvar:`IDLESTARTUP` or :envvar:`PYTHONSTARTUP`.
IDLE first checks for ``IDLESTARTUP``; if ``IDLESTARTUP`` is present the file
referenced is run. If ``IDLESTARTUP`` is not present, IDLE checks for
``PYTHONSTARTUP``. Files referenced by these environment variables are
convenient places to store functions that are used frequently from the IDLE
shell, or for executing import statements to import common modules.
In addition, ``Tk`` also loads a startup file if it is present. Note that the
Tk file is loaded unconditionally. This additional file is ``.Idle.py`` and is
looked for in the user's home directory. Statements in this file will be
executed in the Tk namespace, so this file is not useful for importing
functions to be used from IDLE's Python shell.
Command line usage
^^^^^^^^^^^^^^^^^^
.. code-block:: none
idle.py [-c command] [-d] [-e] [-h] [-i] [-r file] [-s] [-t title] [-] [arg] ...
-c command run command in the shell window
-d enable debugger and open shell window
-e open editor window
-h print help message with legal combinations and exit
-i open shell window
-r file run file in shell window
-s run $IDLESTARTUP or $PYTHONSTARTUP first, in shell window
-t title set title of shell window
- run stdin in shell (- must be last option before args)
If there are arguments:
* If ``-``, ``-c``, or ``r`` is used, all arguments are placed in
``sys.argv[1:...]`` and ``sys.argv[0]`` is set to ``''``, ``'-c'``,
or ``'-r'``. No editor window is opened, even if that is the default
set in the Options dialog.
* Otherwise, arguments are files opened for editing and
``sys.argv`` reflects the arguments passed to IDLE itself.
IDLE-console differences
^^^^^^^^^^^^^^^^^^^^^^^^
As much as possible, the result of executing Python code with IDLE is the
same as executing the same code in a console window. However, the different
interface and operation occasionally affect visible results. For instance,
``sys.modules`` starts with more entries.
IDLE also replaces ``sys.stdin``, ``sys.stdout``, and ``sys.stderr`` with
objects that get input from and send output to the Shell window.
When this window has the focus, it controls the keyboard and screen.
This is normally transparent, but functions that directly access the keyboard
and screen will not work. If ``sys`` is reset with ``reload(sys)``,
IDLE's changes are lost and things like ``input``, ``raw_input``, and
``print`` will not work correctly.
With IDLE's Shell, one enters, edits, and recalls complete statements.
Some consoles only work with a single physical line at a time. IDLE uses
``exec`` to run each statement. As a result, ``'__builtins__'`` is always
defined for each statement.
Running without a subprocess
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
By default, IDLE executes user code in a separate subprocess via a socket,
which uses the internal loopback interface. This connection is not
externally visible and no data is sent to or received from the Internet.
If firewall software complains anyway, you can ignore it.
If the attempt to make the socket connection fails, Idle will notify you.
Such failures are sometimes transient, but if persistent, the problem
may be either a firewall blocking the connection or misconfiguration of
a particular system. Until the problem is fixed, one can run Idle with
the -n command line switch.
If IDLE is started with the -n command line switch it will run in a
single process and will not create the subprocess which runs the RPC
Python execution server. This can be useful if Python cannot create
the subprocess or the RPC socket interface on your platform. However,
in this mode user code is not isolated from IDLE itself. Also, the
environment is not restarted when Run/Run Module (F5) is selected. If
your code has been modified, you must reload() the affected modules and
re-import any specific items (e.g. from foo import baz) if the changes
are to take effect. For these reasons, it is preferable to run IDLE
with the default subprocess if at all possible.
.. deprecated:: 3.4
Help and preferences
--------------------
Additional help sources
^^^^^^^^^^^^^^^^^^^^^^^
IDLE includes a help menu entry called "Python Docs" that will open the
extensive sources of help, including tutorials, available at docs.python.org.
Selected URLs can be added or removed from the help menu at any time using the
Configure IDLE dialog. See the IDLE help option in the help menu of IDLE for
more information.
Setting preferences
^^^^^^^^^^^^^^^^^^^
The font preferences, highlighting, keys, and general preferences can be
changed via Configure IDLE on the Option menu. Keys can be user defined;
IDLE ships with four built-in key sets. In addition, a user can create a
custom key set in the Configure IDLE dialog under the keys tab.
Extensions
^^^^^^^^^^
IDLE contains an extension facility. Preferences for extensions can be
changed with Configure Extensions. See the beginning of config-extensions.def
in the idlelib directory for further information. The default extensions
are currently:
* FormatParagraph
* AutoExpand
* ZoomHeight
* ScriptBinding
* CallTips
* ParenMatch
* AutoComplete
* CodeContext
* RstripExtension
| {
"pile_set_name": "Github"
} |
/* adler32.c -- compute the Adler-32 checksum of a data stream
* Copyright (C) 1995-2004 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#define ZLIB_INTERNAL
#include "zlib.h"
#define BASE 65521UL /* largest prime smaller than 65536 */
#define NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;}
#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
#define DO16(buf) DO8(buf,0); DO8(buf,8);
/* use NO_DIVIDE if your processor does not do division in hardware */
#ifdef NO_DIVIDE
# define MOD(a) \
do { \
if (a >= (BASE << 16)) a -= (BASE << 16); \
if (a >= (BASE << 15)) a -= (BASE << 15); \
if (a >= (BASE << 14)) a -= (BASE << 14); \
if (a >= (BASE << 13)) a -= (BASE << 13); \
if (a >= (BASE << 12)) a -= (BASE << 12); \
if (a >= (BASE << 11)) a -= (BASE << 11); \
if (a >= (BASE << 10)) a -= (BASE << 10); \
if (a >= (BASE << 9)) a -= (BASE << 9); \
if (a >= (BASE << 8)) a -= (BASE << 8); \
if (a >= (BASE << 7)) a -= (BASE << 7); \
if (a >= (BASE << 6)) a -= (BASE << 6); \
if (a >= (BASE << 5)) a -= (BASE << 5); \
if (a >= (BASE << 4)) a -= (BASE << 4); \
if (a >= (BASE << 3)) a -= (BASE << 3); \
if (a >= (BASE << 2)) a -= (BASE << 2); \
if (a >= (BASE << 1)) a -= (BASE << 1); \
if (a >= BASE) a -= BASE; \
} while (0)
# define MOD4(a) \
do { \
if (a >= (BASE << 4)) a -= (BASE << 4); \
if (a >= (BASE << 3)) a -= (BASE << 3); \
if (a >= (BASE << 2)) a -= (BASE << 2); \
if (a >= (BASE << 1)) a -= (BASE << 1); \
if (a >= BASE) a -= BASE; \
} while (0)
#else
# define MOD(a) a %= BASE
# define MOD4(a) a %= BASE
#endif
/* ========================================================================= */
uLong ZEXPORT adler32(adler, buf, len)
uLong adler;
const Bytef *buf;
uInt len;
{
unsigned long sum2;
unsigned n;
/* split Adler-32 into component sums */
sum2 = (adler >> 16) & 0xffff;
adler &= 0xffff;
/* in case user likes doing a byte at a time, keep it fast */
if (len == 1) {
adler += buf[0];
if (adler >= BASE)
adler -= BASE;
sum2 += adler;
if (sum2 >= BASE)
sum2 -= BASE;
return adler | (sum2 << 16);
}
/* initial Adler-32 value (deferred check for len == 1 speed) */
if (buf == Z_NULL)
return 1L;
/* in case short lengths are provided, keep it somewhat fast */
if (len < 16) {
while (len--) {
adler += *buf++;
sum2 += adler;
}
if (adler >= BASE)
adler -= BASE;
MOD4(sum2); /* only added so many BASE's */
return adler | (sum2 << 16);
}
/* do length NMAX blocks -- requires just one modulo operation */
while (len >= NMAX) {
len -= NMAX;
n = NMAX / 16; /* NMAX is divisible by 16 */
do {
DO16(buf); /* 16 sums unrolled */
buf += 16;
} while (--n);
MOD(adler);
MOD(sum2);
}
/* do remaining bytes (less than NMAX, still just one modulo) */
if (len) { /* avoid modulos if none remaining */
while (len >= 16) {
len -= 16;
DO16(buf);
buf += 16;
}
while (len--) {
adler += *buf++;
sum2 += adler;
}
MOD(adler);
MOD(sum2);
}
/* return recombined sums */
return adler | (sum2 << 16);
}
/* ========================================================================= */
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off_t len2;
{
unsigned long sum1;
unsigned long sum2;
unsigned rem;
/* the derivation of this formula is left as an exercise for the reader */
rem = (unsigned)(len2 % BASE);
sum1 = adler1 & 0xffff;
sum2 = rem * sum1;
MOD(sum2);
sum1 += (adler2 & 0xffff) + BASE - 1;
sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
if (sum1 > BASE) sum1 -= BASE;
if (sum1 > BASE) sum1 -= BASE;
if (sum2 > (BASE << 1)) sum2 -= (BASE << 1);
if (sum2 > BASE) sum2 -= BASE;
return sum1 | (sum2 << 16);
}
| {
"pile_set_name": "Github"
} |
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cldr
import "testing"
func TestParseDraft(t *testing.T) {
tests := []struct {
in string
draft Draft
err bool
}{
{"unconfirmed", Unconfirmed, false},
{"provisional", Provisional, false},
{"contributed", Contributed, false},
{"approved", Approved, false},
{"", Approved, false},
{"foo", Approved, true},
}
for _, tt := range tests {
if d, err := ParseDraft(tt.in); d != tt.draft || (err != nil) != tt.err {
t.Errorf("%q: was %v, %v; want %v, %v", tt.in, d, err != nil, tt.draft, tt.err)
}
}
}
| {
"pile_set_name": "Github"
} |
# create HAL signals for position commands from motion module
# loop position commands back to motion module feedback
net Zpos axis.2.motor-pos-cmd => axis.2.motor-pos-fb ddt_z.in
# send the position commands thru differentiators to
# generate velocity and accel signals
net Zvel ddt_z.out => ddt_zv.in vel_xyz.in0
net Zacc <= ddt_zv.out
#Conservative limits
set acc_limit 1.0001
set vel_limit 1.01
setp wcomp_zacc.max $::AXIS_2(MAX_ACCELERATION)*$acc_limit
setp wcomp_zacc.min $::AXIS_2(MAX_ACCELERATION)*-1.0*$acc_limit
setp wcomp_zvel.max $::AXIS_2(MAX_VELOCITY)*$vel_limit
setp wcomp_zvel.min $::AXIS_2(MAX_VELOCITY)*-1.0*$vel_limit
# Enable match_all pins for Z axis
setp match_all.b4 1
setp match_all.b5 1
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{84A86CA3-01AD-4CA0-A1F8-057AD58FDACF}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>DataBindingDemos.UWP</RootNamespace>
<AssemblyName>DataBindingDemos.UWP</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<PackageCertificateKeyFile>DataBindingDemos.UWP_TemporaryKey.pfx</PackageCertificateKeyFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.0.12" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1269" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="DataBindingDemos.UWP_TemporaryKey.pfx" />
<None Include="collapse.png" />
<None Include="expand.png" />
</ItemGroup>
<ItemGroup>
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LockScreenLogo.scale-100.png" />
<Content Include="Assets\LockScreenLogo.scale-125.png" />
<Content Include="Assets\LockScreenLogo.scale-150.png" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\LockScreenLogo.scale-400.png" />
<Content Include="Assets\SplashScreen.scale-100.png" />
<Content Include="Assets\SplashScreen.scale-125.png" />
<Content Include="Assets\SplashScreen.scale-150.png" />
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\SplashScreen.scale-400.png" />
<Content Include="Assets\Square150x150Logo.scale-100.png" />
<Content Include="Assets\Square150x150Logo.scale-125.png" />
<Content Include="Assets\Square150x150Logo.scale-150.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-400.png" />
<Content Include="Assets\Square44x44Logo.scale-100.png" />
<Content Include="Assets\Square44x44Logo.scale-125.png" />
<Content Include="Assets\Square44x44Logo.scale-150.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-400.png" />
<Content Include="Assets\Square44x44Logo.targetsize-16_altform-unplated.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\Square44x44Logo.targetsize-32_altform-unplated.png" />
<Content Include="Assets\Square44x44Logo.targetsize-48_altform-unplated.png" />
<Content Include="Assets\Square44x44Logo.targetsize-256_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\Wide310x150Logo.scale-100.png" />
<Content Include="Assets\Wide310x150Logo.scale-125.png" />
<Content Include="Assets\Wide310x150Logo.scale-150.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
<Content Include="Assets\Wide310x150Logo.scale-400.png" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DataBindingDemos\DataBindingDemos.csproj">
<Project>{0a836478-de55-436a-9911-78ee7bade9a3}</Project>
<Name>DataBindingDemos</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<AndroidResource Include="user.png" />
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
</Project>
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2014 Xored Software, 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.xored.scalajs.react.event
import org.scalajs.dom
import scala.scalajs.js
trait SyntheticEvent extends js.Object {
val bubbles: Boolean = js.native
val cancelable: Boolean = js.native
val currentTarget: dom.EventTarget = js.native
val target: dom.EventTarget = js.native
val nativeEvent: dom.Event = js.native
def preventDefault(): Unit = js.native
def stopPropagation(): Unit = js.native
val defaultPrevented: Boolean = js.native
val eventPhase: Int = js.native
val isTrusted: Boolean = js.native
val timeStamp: js.Date = js.native
val `type`: String = js.native
}
trait ClipboardEvent extends SyntheticEvent {
val clipboardData: dom.DataTransfer = js.native
}
trait KeyboardEvent extends SyntheticEvent {
val altKey: Boolean = js.native
val ctrlKey: Boolean = js.native
val metaKey: Boolean = js.native
val shiftKey: Boolean = js.native
val charCode: Int = js.native
val key: String = js.native
val keyCode: Int = js.native
val locale: String = js.native
val location: Int = js.native
val repeat: Boolean = js.native
val which: Int = js.native
def getModifierState(keyArg: String): Boolean = js.native
}
trait FocusEvent extends SyntheticEvent {
val relatedTarget: dom.EventTarget = js.native
}
trait FormEvent extends SyntheticEvent
trait MouseEvent extends SyntheticEvent {
val altKey: Boolean = js.native
val ctrlKey: Boolean = js.native
val metaKey: Boolean = js.native
val shiftKey: Boolean = js.native
val button: Int = js.native
val buttons: Int = js.native
val clientX: Int = js.native
val clientY: Int = js.native
val pageX: Int = js.native
val pageY: Int = js.native
val screenX: Int = js.native
val screenY: Int = js.native
val relatedTarget: dom.EventTarget = js.native
}
trait TouchEvent extends SyntheticEvent {
val altKey: Boolean = js.native
val ctrlKey: Boolean = js.native
val metaKey: Boolean = js.native
val shiftKey: Boolean = js.native
val changedTouches: dom.TouchList = js.native
val targetTouches: dom.TouchList = js.native
val touches: dom.TouchList = js.native
def getModifierState(keyArg: String): Boolean = js.native
}
trait UIEvent extends SyntheticEvent {
val detail: Int = js.native
val view: dom.Window = js.native
}
trait WheelEvent extends SyntheticEvent {
val deltaMode: Int = js.native
val deltaX: Double = js.native
val deltaY: Double = js.native
val deltaZ: Double = js.native
}
| {
"pile_set_name": "Github"
} |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT License.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace System.Linq
{
public static partial class AsyncEnumerable
{
/// <summary>
/// Projects each element of an async-enumerable sequence into a new form.
/// </summary>
/// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
/// <typeparam name="TResult">The type of the elements in the result sequence, obtained by running the selector function for each element in the source sequence.</typeparam>
/// <param name="source">A sequence of elements to invoke a transform function on.</param>
/// <param name="selector">A transform function to apply to each source element.</param>
/// <returns>An async-enumerable sequence whose elements are the result of invoking the transform function on each element of source.</returns>
/// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
public static IAsyncEnumerable<TResult> Select<TSource, TResult>(this IAsyncEnumerable<TSource> source, Func<TSource, TResult> selector)
{
if (source == null)
throw Error.ArgumentNull(nameof(source));
if (selector == null)
throw Error.ArgumentNull(nameof(selector));
return source switch
{
AsyncIterator<TSource> iterator => iterator.Select(selector),
IList<TSource> list => new SelectIListIterator<TSource, TResult>(list, selector),
_ => new SelectEnumerableAsyncIterator<TSource, TResult>(source, selector),
};
}
/// <summary>
/// Projects each element of an async-enumerable sequence into a new form by incorporating the element's index.
/// </summary>
/// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
/// <typeparam name="TResult">The type of the elements in the result sequence, obtained by running the selector function for each element in the source sequence.</typeparam>
/// <param name="source">A sequence of elements to invoke a transform function on.</param>
/// <param name="selector">A transform function to apply to each source element; the second parameter of the function represents the index of the source element.</param>
/// <returns>An async-enumerable sequence whose elements are the result of invoking the transform function on each element of source.</returns>
/// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
public static IAsyncEnumerable<TResult> Select<TSource, TResult>(this IAsyncEnumerable<TSource> source, Func<TSource, int, TResult> selector)
{
if (source == null)
throw Error.ArgumentNull(nameof(source));
if (selector == null)
throw Error.ArgumentNull(nameof(selector));
return Core(source, selector);
static async IAsyncEnumerable<TResult> Core(IAsyncEnumerable<TSource> source, Func<TSource, int, TResult> selector, [System.Runtime.CompilerServices.EnumeratorCancellation] CancellationToken cancellationToken = default)
{
var index = -1;
await foreach (var element in source.WithCancellation(cancellationToken).ConfigureAwait(false))
{
checked
{
index++;
}
yield return selector(element, index);
}
}
}
internal static IAsyncEnumerable<TResult> SelectAwaitCore<TSource, TResult>(this IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TResult>> selector)
{
if (source == null)
throw Error.ArgumentNull(nameof(source));
if (selector == null)
throw Error.ArgumentNull(nameof(selector));
return source switch
{
AsyncIterator<TSource> iterator => iterator.Select(selector),
IList<TSource> list => new SelectIListIteratorWithTask<TSource, TResult>(list, selector),
_ => new SelectEnumerableAsyncIteratorWithTask<TSource, TResult>(source, selector),
};
}
#if !NO_DEEP_CANCELLATION
internal static IAsyncEnumerable<TResult> SelectAwaitWithCancellationCore<TSource, TResult>(this IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TResult>> selector)
{
if (source == null)
throw Error.ArgumentNull(nameof(source));
if (selector == null)
throw Error.ArgumentNull(nameof(selector));
return source switch
{
AsyncIterator<TSource> iterator => iterator.Select(selector),
IList<TSource> list => new SelectIListIteratorWithTaskAndCancellation<TSource, TResult>(list, selector),
_ => new SelectEnumerableAsyncIteratorWithTaskAndCancellation<TSource, TResult>(source, selector),
};
}
#endif
internal static IAsyncEnumerable<TResult> SelectAwaitCore<TSource, TResult>(this IAsyncEnumerable<TSource> source, Func<TSource, int, ValueTask<TResult>> selector)
{
if (source == null)
throw Error.ArgumentNull(nameof(source));
if (selector == null)
throw Error.ArgumentNull(nameof(selector));
return Core(source, selector);
static async IAsyncEnumerable<TResult> Core(IAsyncEnumerable<TSource> source, Func<TSource, int, ValueTask<TResult>> selector, [System.Runtime.CompilerServices.EnumeratorCancellation] CancellationToken cancellationToken = default)
{
var index = -1;
await foreach (var element in source.WithCancellation(cancellationToken).ConfigureAwait(false))
{
checked
{
index++;
}
yield return await selector(element, index).ConfigureAwait(false);
}
}
}
#if !NO_DEEP_CANCELLATION
internal static IAsyncEnumerable<TResult> SelectAwaitWithCancellationCore<TSource, TResult>(this IAsyncEnumerable<TSource> source, Func<TSource, int, CancellationToken, ValueTask<TResult>> selector)
{
if (source == null)
throw Error.ArgumentNull(nameof(source));
if (selector == null)
throw Error.ArgumentNull(nameof(selector));
return Core(source, selector);
static async IAsyncEnumerable<TResult> Core(IAsyncEnumerable<TSource> source, Func<TSource, int, CancellationToken, ValueTask<TResult>> selector, [System.Runtime.CompilerServices.EnumeratorCancellation] CancellationToken cancellationToken = default)
{
var index = -1;
await foreach (var element in source.WithCancellation(cancellationToken).ConfigureAwait(false))
{
checked
{
index++;
}
yield return await selector(element, index, cancellationToken).ConfigureAwait(false);
}
}
}
#endif
internal sealed class SelectEnumerableAsyncIterator<TSource, TResult> : AsyncIterator<TResult>
{
private readonly Func<TSource, TResult> _selector;
private readonly IAsyncEnumerable<TSource> _source;
private IAsyncEnumerator<TSource>? _enumerator;
public SelectEnumerableAsyncIterator(IAsyncEnumerable<TSource> source, Func<TSource, TResult> selector)
{
_source = source;
_selector = selector;
}
public override AsyncIteratorBase<TResult> Clone()
{
return new SelectEnumerableAsyncIterator<TSource, TResult>(_source, _selector);
}
public override async ValueTask DisposeAsync()
{
if (_enumerator != null)
{
await _enumerator.DisposeAsync().ConfigureAwait(false);
_enumerator = null;
}
await base.DisposeAsync().ConfigureAwait(false);
}
public override IAsyncEnumerable<TResult1> Select<TResult1>(Func<TResult, TResult1> selector)
{
return new SelectEnumerableAsyncIterator<TSource, TResult1>(_source, CombineSelectors(_selector, selector));
}
protected override async ValueTask<bool> MoveNextCore()
{
switch (_state)
{
case AsyncIteratorState.Allocated:
_enumerator = _source.GetAsyncEnumerator(_cancellationToken);
_state = AsyncIteratorState.Iterating;
goto case AsyncIteratorState.Iterating;
case AsyncIteratorState.Iterating:
if (await _enumerator!.MoveNextAsync().ConfigureAwait(false))
{
_current = _selector(_enumerator.Current);
return true;
}
break;
}
await DisposeAsync().ConfigureAwait(false);
return false;
}
}
internal sealed class SelectIListIterator<TSource, TResult> : AsyncIterator<TResult>, IAsyncIListProvider<TResult>
{
private readonly Func<TSource, TResult> _selector;
private readonly IList<TSource> _source;
private IEnumerator<TSource>? _enumerator;
public SelectIListIterator(IList<TSource> source, Func<TSource, TResult> selector)
{
_source = source;
_selector = selector;
}
public override AsyncIteratorBase<TResult> Clone()
{
return new SelectIListIterator<TSource, TResult>(_source, _selector);
}
public override async ValueTask DisposeAsync()
{
if (_enumerator != null)
{
_enumerator.Dispose();
_enumerator = null;
}
await base.DisposeAsync().ConfigureAwait(false);
}
public ValueTask<int> GetCountAsync(bool onlyIfCheap, CancellationToken cancellationToken)
{
if (onlyIfCheap)
{
return new ValueTask<int>(-1);
}
cancellationToken.ThrowIfCancellationRequested();
var count = 0;
foreach (var item in _source)
{
_selector(item);
checked
{
count++;
}
}
return new ValueTask<int>(count);
}
public override IAsyncEnumerable<TResult1> Select<TResult1>(Func<TResult, TResult1> selector)
{
return new SelectIListIterator<TSource, TResult1>(_source, CombineSelectors(_selector, selector));
}
public ValueTask<TResult[]> ToArrayAsync(CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
var n = _source.Count;
var res = new TResult[n];
for (var i = 0; i < n; i++)
{
res[i] = _selector(_source[i]);
}
return new ValueTask<TResult[]>(res);
}
public ValueTask<List<TResult>> ToListAsync(CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
var n = _source.Count;
var res = new List<TResult>(n);
for (var i = 0; i < n; i++)
{
res.Add(_selector(_source[i]));
}
return new ValueTask<List<TResult>>(res);
}
protected override async ValueTask<bool> MoveNextCore()
{
switch (_state)
{
case AsyncIteratorState.Allocated:
_enumerator = _source.GetEnumerator();
_state = AsyncIteratorState.Iterating;
goto case AsyncIteratorState.Iterating;
case AsyncIteratorState.Iterating:
if (_enumerator!.MoveNext())
{
_current = _selector(_enumerator.Current);
return true;
}
await DisposeAsync().ConfigureAwait(false);
break;
}
return false;
}
}
internal sealed class SelectEnumerableAsyncIteratorWithTask<TSource, TResult> : AsyncIterator<TResult>
{
private readonly Func<TSource, ValueTask<TResult>> _selector;
private readonly IAsyncEnumerable<TSource> _source;
private IAsyncEnumerator<TSource>? _enumerator;
public SelectEnumerableAsyncIteratorWithTask(IAsyncEnumerable<TSource> source, Func<TSource, ValueTask<TResult>> selector)
{
_source = source;
_selector = selector;
}
public override AsyncIteratorBase<TResult> Clone()
{
return new SelectEnumerableAsyncIteratorWithTask<TSource, TResult>(_source, _selector);
}
public override async ValueTask DisposeAsync()
{
if (_enumerator != null)
{
await _enumerator.DisposeAsync().ConfigureAwait(false);
_enumerator = null;
}
await base.DisposeAsync().ConfigureAwait(false);
}
public override IAsyncEnumerable<TResult1> Select<TResult1>(Func<TResult, ValueTask<TResult1>> selector)
{
return new SelectEnumerableAsyncIteratorWithTask<TSource, TResult1>(_source, CombineSelectors(_selector, selector));
}
protected override async ValueTask<bool> MoveNextCore()
{
switch (_state)
{
case AsyncIteratorState.Allocated:
_enumerator = _source.GetAsyncEnumerator(_cancellationToken);
_state = AsyncIteratorState.Iterating;
goto case AsyncIteratorState.Iterating;
case AsyncIteratorState.Iterating:
if (await _enumerator!.MoveNextAsync().ConfigureAwait(false))
{
_current = await _selector(_enumerator.Current).ConfigureAwait(false);
return true;
}
break;
}
await DisposeAsync().ConfigureAwait(false);
return false;
}
}
#if !NO_DEEP_CANCELLATION
internal sealed class SelectEnumerableAsyncIteratorWithTaskAndCancellation<TSource, TResult> : AsyncIterator<TResult>
{
private readonly Func<TSource, CancellationToken, ValueTask<TResult>> _selector;
private readonly IAsyncEnumerable<TSource> _source;
private IAsyncEnumerator<TSource>? _enumerator;
public SelectEnumerableAsyncIteratorWithTaskAndCancellation(IAsyncEnumerable<TSource> source, Func<TSource, CancellationToken, ValueTask<TResult>> selector)
{
_source = source;
_selector = selector;
}
public override AsyncIteratorBase<TResult> Clone()
{
return new SelectEnumerableAsyncIteratorWithTaskAndCancellation<TSource, TResult>(_source, _selector);
}
public override async ValueTask DisposeAsync()
{
if (_enumerator != null)
{
await _enumerator.DisposeAsync().ConfigureAwait(false);
_enumerator = null;
}
await base.DisposeAsync().ConfigureAwait(false);
}
public override IAsyncEnumerable<TResult1> Select<TResult1>(Func<TResult, CancellationToken, ValueTask<TResult1>> selector)
{
return new SelectEnumerableAsyncIteratorWithTaskAndCancellation<TSource, TResult1>(_source, CombineSelectors(_selector, selector));
}
protected override async ValueTask<bool> MoveNextCore()
{
switch (_state)
{
case AsyncIteratorState.Allocated:
_enumerator = _source.GetAsyncEnumerator(_cancellationToken);
_state = AsyncIteratorState.Iterating;
goto case AsyncIteratorState.Iterating;
case AsyncIteratorState.Iterating:
if (await _enumerator!.MoveNextAsync().ConfigureAwait(false))
{
_current = await _selector(_enumerator.Current, _cancellationToken).ConfigureAwait(false);
return true;
}
break;
}
await DisposeAsync().ConfigureAwait(false);
return false;
}
}
#endif
// NB: LINQ to Objects implements IPartition<TResult> for this. However, it seems incorrect to do so in a trivial
// manner where e.g. TryGetLast simply indexes into the list without running the selector for the first n - 1
// elements in order to ensure side-effects. We should consider whether we want to follow this implementation
// strategy or support IAsyncPartition<TResult> in a less efficient but more correct manner here.
private sealed class SelectIListIteratorWithTask<TSource, TResult> : AsyncIterator<TResult>, IAsyncIListProvider<TResult>
{
private readonly Func<TSource, ValueTask<TResult>> _selector;
private readonly IList<TSource> _source;
private IEnumerator<TSource>? _enumerator;
public SelectIListIteratorWithTask(IList<TSource> source, Func<TSource, ValueTask<TResult>> selector)
{
_source = source;
_selector = selector;
}
public override AsyncIteratorBase<TResult> Clone()
{
return new SelectIListIteratorWithTask<TSource, TResult>(_source, _selector);
}
public override async ValueTask DisposeAsync()
{
if (_enumerator != null)
{
_enumerator.Dispose();
_enumerator = null;
}
await base.DisposeAsync().ConfigureAwait(false);
}
public ValueTask<int> GetCountAsync(bool onlyIfCheap, CancellationToken cancellationToken)
{
if (onlyIfCheap)
{
return new ValueTask<int>(-1);
}
return Core();
async ValueTask<int> Core()
{
cancellationToken.ThrowIfCancellationRequested();
var count = 0;
foreach (var item in _source)
{
await _selector(item).ConfigureAwait(false);
checked
{
count++;
}
}
return count;
}
}
public override IAsyncEnumerable<TResult1> Select<TResult1>(Func<TResult, ValueTask<TResult1>> selector)
{
return new SelectIListIteratorWithTask<TSource, TResult1>(_source, CombineSelectors(_selector, selector));
}
public async ValueTask<TResult[]> ToArrayAsync(CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
var n = _source.Count;
var res = new TResult[n];
for (var i = 0; i < n; i++)
{
res[i] = await _selector(_source[i]).ConfigureAwait(false);
}
return res;
}
public async ValueTask<List<TResult>> ToListAsync(CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
var n = _source.Count;
var res = new List<TResult>(n);
for (var i = 0; i < n; i++)
{
res.Add(await _selector(_source[i]).ConfigureAwait(false));
}
return res;
}
protected override async ValueTask<bool> MoveNextCore()
{
switch (_state)
{
case AsyncIteratorState.Allocated:
_enumerator = _source.GetEnumerator();
_state = AsyncIteratorState.Iterating;
goto case AsyncIteratorState.Iterating;
case AsyncIteratorState.Iterating:
if (_enumerator!.MoveNext())
{
_current = await _selector(_enumerator.Current).ConfigureAwait(false);
return true;
}
break;
}
await DisposeAsync().ConfigureAwait(false);
return false;
}
}
#if !NO_DEEP_CANCELLATION
private sealed class SelectIListIteratorWithTaskAndCancellation<TSource, TResult> : AsyncIterator<TResult>, IAsyncIListProvider<TResult>
{
private readonly Func<TSource, CancellationToken, ValueTask<TResult>> _selector;
private readonly IList<TSource> _source;
private IEnumerator<TSource>? _enumerator;
public SelectIListIteratorWithTaskAndCancellation(IList<TSource> source, Func<TSource, CancellationToken, ValueTask<TResult>> selector)
{
_source = source;
_selector = selector;
}
public override AsyncIteratorBase<TResult> Clone()
{
return new SelectIListIteratorWithTaskAndCancellation<TSource, TResult>(_source, _selector);
}
public override async ValueTask DisposeAsync()
{
if (_enumerator != null)
{
_enumerator.Dispose();
_enumerator = null;
}
await base.DisposeAsync().ConfigureAwait(false);
}
public ValueTask<int> GetCountAsync(bool onlyIfCheap, CancellationToken cancellationToken)
{
if (onlyIfCheap)
{
return new ValueTask<int>(-1);
}
return Core();
async ValueTask<int> Core()
{
cancellationToken.ThrowIfCancellationRequested();
var count = 0;
foreach (var item in _source)
{
await _selector(item, cancellationToken).ConfigureAwait(false);
checked
{
count++;
}
}
return count;
}
}
public override IAsyncEnumerable<TResult1> Select<TResult1>(Func<TResult, CancellationToken, ValueTask<TResult1>> selector)
{
return new SelectIListIteratorWithTaskAndCancellation<TSource, TResult1>(_source, CombineSelectors(_selector, selector));
}
public async ValueTask<TResult[]> ToArrayAsync(CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
var n = _source.Count;
var res = new TResult[n];
for (var i = 0; i < n; i++)
{
res[i] = await _selector(_source[i], cancellationToken).ConfigureAwait(false);
}
return res;
}
public async ValueTask<List<TResult>> ToListAsync(CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
var n = _source.Count;
var res = new List<TResult>(n);
for (var i = 0; i < n; i++)
{
res.Add(await _selector(_source[i], cancellationToken).ConfigureAwait(false));
}
return res;
}
protected override async ValueTask<bool> MoveNextCore()
{
switch (_state)
{
case AsyncIteratorState.Allocated:
_enumerator = _source.GetEnumerator();
_state = AsyncIteratorState.Iterating;
goto case AsyncIteratorState.Iterating;
case AsyncIteratorState.Iterating:
if (_enumerator!.MoveNext())
{
_current = await _selector(_enumerator.Current, _cancellationToken).ConfigureAwait(false);
return true;
}
break;
}
await DisposeAsync().ConfigureAwait(false);
return false;
}
}
#endif
}
}
| {
"pile_set_name": "Github"
} |
/********************************************************************
* *
* THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2007 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: dump the VP3.1 huffman tables in a form suitable for
inclusion in the spec.
last mod: $Id: vp3huff.c 14078 2007-10-31 21:24:44Z giles $
********************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
typedef struct{
unsigned long pattern;
int nbits;
}theora_huff_code;
/*The default Huffman codes used for VP3.1.
These tables were generated by /experimental/derf/theora-exp/tools/huffgen.c
using the same algorithm and sampled frequency counts used by VP3.*/
const theora_huff_code TH_VP31_HUFF_CODES[80][32]={
{
{0x002D, 6},{0x0026, 7},{0x0166, 9},{0x004E, 8},
{0x02CE,10},{0x059E,11},{0x027D,11},{0x0008, 5},
{0x04F9,12},{0x000F, 4},{0x000E, 4},{0x001B, 5},
{0x0006, 4},{0x0008, 4},{0x0005, 4},{0x001A, 5},
{0x0015, 5},{0x0007, 4},{0x000C, 4},{0x0001, 3},
{0x0000, 3},{0x0009, 4},{0x0017, 5},{0x0029, 6},
{0x0028, 6},{0x00B2, 8},{0x04F8,12},{0x059F,11},
{0x009E, 9},{0x013F,10},{0x0012, 6},{0x0058, 7}
},
{
{0x0010, 5},{0x0047, 7},{0x01FF, 9},{0x008C, 8},
{0x03FC,10},{0x046A,11},{0x0469,11},{0x0022, 6},
{0x11A1,13},{0x000E, 4},{0x000D, 4},{0x0004, 4},
{0x0005, 4},{0x0009, 4},{0x0006, 4},{0x001E, 5},
{0x0016, 5},{0x0007, 4},{0x000C, 4},{0x0001, 3},
{0x0000, 3},{0x000A, 4},{0x0017, 5},{0x007D, 7},
{0x007E, 7},{0x011B, 9},{0x08D1,12},{0x03FD,10},
{0x046B,11},{0x11A0,13},{0x007C, 7},{0x00FE, 8}
},
{
{0x0016, 5},{0x0020, 6},{0x0086, 8},{0x0087, 8},
{0x0367,10},{0x06CC,11},{0x06CB,11},{0x006E, 7},
{0x366D,14},{0x000F, 4},{0x000E, 4},{0x0004, 4},
{0x0005, 4},{0x000A, 4},{0x0006, 4},{0x001A, 5},
{0x0011, 5},{0x0007, 4},{0x000C, 4},{0x0001, 3},
{0x0000, 3},{0x0009, 4},{0x0017, 5},{0x006F, 7},
{0x006D, 7},{0x0364,10},{0x0D9A,12},{0x06CA,11},
{0x1B37,13},{0x366C,14},{0x0042, 7},{0x00D8, 8}
},
{
{0x0000, 4},{0x002D, 6},{0x00F7, 8},{0x0058, 7},
{0x0167, 9},{0x02CB,10},{0x02CA,10},{0x000E, 6},
{0x1661,13},{0x0003, 3},{0x0002, 3},{0x0008, 4},
{0x0009, 4},{0x000D, 4},{0x0002, 4},{0x001F, 5},
{0x0017, 5},{0x0001, 4},{0x000C, 4},{0x000E, 4},
{0x000A, 4},{0x0006, 5},{0x0078, 7},{0x000F, 6},
{0x007A, 7},{0x0164, 9},{0x0599,11},{0x02CD,10},
{0x0B31,12},{0x1660,13},{0x0079, 7},{0x00F6, 8}
},
{
{0x0003, 4},{0x003C, 6},{0x000F, 7},{0x007A, 7},
{0x001D, 8},{0x0020, 9},{0x0072,10},{0x0006, 6},
{0x0399,13},{0x0004, 3},{0x0005, 3},{0x0005, 4},
{0x0006, 4},{0x000E, 4},{0x0004, 4},{0x0000, 4},
{0x0019, 5},{0x0002, 4},{0x000D, 4},{0x0007, 4},
{0x001F, 5},{0x0030, 6},{0x0011, 8},{0x0031, 6},
{0x0005, 6},{0x0021, 9},{0x00E7,11},{0x0038, 9},
{0x01CD,12},{0x0398,13},{0x007B, 7},{0x0009, 7}
},
{
{0x0009, 4},{0x0002, 5},{0x0074, 7},{0x0007, 6},
{0x00EC, 8},{0x00D1, 9},{0x01A6,10},{0x0006, 6},
{0x0D21,13},{0x0005, 3},{0x0006, 3},{0x0008, 4},
{0x0007, 4},{0x000F, 4},{0x0004, 4},{0x0000, 4},
{0x001C, 5},{0x0002, 4},{0x0005, 4},{0x0003, 4},
{0x000C, 5},{0x0035, 7},{0x01A7,10},{0x001B, 6},
{0x0077, 7},{0x01A5,10},{0x0349,11},{0x00D0, 9},
{0x0691,12},{0x0D20,13},{0x0075, 7},{0x00ED, 8}
},
{
{0x000A, 4},{0x000C, 5},{0x0012, 6},{0x001B, 6},
{0x00B7, 8},{0x016C, 9},{0x0099, 9},{0x005A, 7},
{0x16D8,13},{0x0007, 3},{0x0006, 3},{0x0009, 4},
{0x0008, 4},{0x0000, 3},{0x0005, 4},{0x0017, 5},
{0x000E, 5},{0x0002, 4},{0x0003, 4},{0x000F, 5},
{0x001A, 6},{0x004D, 8},{0x2DB3,14},{0x002C, 6},
{0x0011, 6},{0x02DA,10},{0x05B7,11},{0x0098, 9},
{0x0B6D,12},{0x2DB2,14},{0x0010, 6},{0x0027, 7}
},
{
{0x000D, 4},{0x000F, 5},{0x001D, 6},{0x0008, 5},
{0x0051, 7},{0x0056, 8},{0x00AF, 9},{0x002A, 7},
{0x148A,13},{0x0007, 3},{0x0000, 2},{0x0008, 4},
{0x0009, 4},{0x000C, 4},{0x0006, 4},{0x0017, 5},
{0x000B, 5},{0x0016, 5},{0x0015, 5},{0x0009, 5},
{0x0050, 7},{0x00AE, 9},{0x2917,14},{0x001C, 6},
{0x0014, 6},{0x0290,10},{0x0523,11},{0x0149, 9},
{0x0A44,12},{0x2916,14},{0x0053, 7},{0x00A5, 8}
},
{
{0x0001, 4},{0x001D, 6},{0x00F5, 8},{0x00F4, 8},
{0x024D,10},{0x0499,11},{0x0498,11},{0x0001, 5},
{0x0021, 6},{0x0006, 3},{0x0005, 3},{0x0006, 4},
{0x0005, 4},{0x0002, 4},{0x0007, 5},{0x0025, 6},
{0x007B, 7},{0x001C, 6},{0x0020, 6},{0x000D, 6},
{0x0048, 7},{0x0092, 8},{0x0127, 9},{0x000E, 4},
{0x0004, 4},{0x0011, 5},{0x000C, 6},{0x003C, 6},
{0x000F, 5},{0x0000, 5},{0x001F, 5},{0x0013, 5}
},
{
{0x0005, 4},{0x003C, 6},{0x0040, 7},{0x000D, 7},
{0x0031, 9},{0x0061,10},{0x0060,10},{0x0002, 5},
{0x00F5, 8},{0x0006, 3},{0x0005, 3},{0x0007, 4},
{0x0006, 4},{0x0002, 4},{0x0009, 5},{0x0025, 6},
{0x0007, 6},{0x0021, 6},{0x0024, 6},{0x0010, 6},
{0x0041, 7},{0x00F4, 8},{0x0019, 8},{0x000E, 4},
{0x0003, 4},{0x0011, 5},{0x0011, 6},{0x003F, 6},
{0x003E, 6},{0x007B, 7},{0x0000, 4},{0x0013, 5}
},
{
{0x000A, 4},{0x0007, 5},{0x0001, 6},{0x0009, 6},
{0x0131, 9},{0x0261,10},{0x0260,10},{0x0015, 6},
{0x0001, 7},{0x0007, 3},{0x0006, 3},{0x0008, 4},
{0x0007, 4},{0x0006, 4},{0x0012, 5},{0x002F, 6},
{0x0014, 6},{0x0027, 6},{0x002D, 6},{0x0016, 6},
{0x004D, 7},{0x0099, 8},{0x0000, 7},{0x0004, 4},
{0x0001, 4},{0x0005, 5},{0x0017, 6},{0x002E, 6},
{0x002C, 6},{0x0008, 6},{0x0006, 5},{0x0001, 5}
},
{
{0x0000, 3},{0x000E, 5},{0x0017, 6},{0x002A, 6},
{0x0010, 7},{0x00F9,10},{0x00F8,10},{0x001E, 7},
{0x003F, 8},{0x0007, 3},{0x0006, 3},{0x0009, 4},
{0x0008, 4},{0x0006, 4},{0x000F, 5},{0x0005, 5},
{0x0016, 6},{0x0029, 6},{0x002B, 6},{0x0015, 6},
{0x0050, 7},{0x0011, 7},{0x007D, 9},{0x0004, 4},
{0x0017, 5},{0x0006, 5},{0x0014, 6},{0x002C, 6},
{0x002D, 6},{0x000E, 6},{0x0009, 6},{0x0051, 7}
},
{
{0x0002, 3},{0x0018, 5},{0x002F, 6},{0x000D, 5},
{0x0053, 7},{0x0295,10},{0x0294,10},{0x00A4, 8},
{0x007C, 8},{0x0000, 2},{0x0007, 3},{0x0009, 4},
{0x0008, 4},{0x001B, 5},{0x000C, 5},{0x0028, 6},
{0x006A, 7},{0x001E, 6},{0x001D, 6},{0x0069, 7},
{0x00D7, 8},{0x007D, 8},{0x014B, 9},{0x0019, 5},
{0x0016, 5},{0x002E, 6},{0x001C, 6},{0x002B, 6},
{0x002A, 6},{0x0068, 7},{0x003F, 7},{0x00D6, 8}
},
{
{0x0002, 3},{0x001B, 5},{0x000C, 5},{0x0018, 5},
{0x0029, 6},{0x007F, 8},{0x02F0,10},{0x0198, 9},
{0x0179, 9},{0x0000, 2},{0x0007, 3},{0x0009, 4},
{0x0008, 4},{0x001A, 5},{0x000D, 5},{0x002A, 6},
{0x0064, 7},{0x001E, 6},{0x0067, 7},{0x005F, 7},
{0x00CD, 8},{0x007E, 8},{0x02F1,10},{0x0016, 5},
{0x000E, 5},{0x002E, 6},{0x0065, 7},{0x002B, 6},
{0x0028, 6},{0x003E, 7},{0x00BD, 8},{0x0199, 9}
},
{
{0x0002, 3},{0x0007, 4},{0x0016, 5},{0x0006, 4},
{0x0036, 6},{0x005C, 7},{0x015D, 9},{0x015C, 9},
{0x02BF,10},{0x0000, 2},{0x0007, 3},{0x0009, 4},
{0x0008, 4},{0x0018, 5},{0x0034, 6},{0x002A, 6},
{0x005E, 7},{0x006A, 7},{0x0064, 7},{0x005D, 7},
{0x00CB, 8},{0x00AD, 8},{0x02BE,10},{0x0014, 5},
{0x0033, 6},{0x006E, 7},{0x005F, 7},{0x006F, 7},
{0x006B, 7},{0x00CA, 8},{0x00AC, 8},{0x015E, 9}
},
{
{0x000F, 4},{0x001D, 5},{0x0018, 5},{0x000B, 4},
{0x0019, 5},{0x0029, 6},{0x00D6, 8},{0x0551,11},
{0x0AA1,12},{0x0001, 2},{0x0000, 2},{0x0009, 4},
{0x0008, 4},{0x001B, 5},{0x0038, 6},{0x0028, 6},
{0x0057, 7},{0x006A, 7},{0x0068, 7},{0x0056, 7},
{0x00E5, 8},{0x0155, 9},{0x0AA0,12},{0x0073, 7},
{0x0069, 7},{0x00D7, 8},{0x00AB, 8},{0x00E4, 8},
{0x00A9, 8},{0x0151, 9},{0x0150, 9},{0x02A9,10}
},
{
{0x0008, 5},{0x0025, 7},{0x017A, 9},{0x02F7,10},
{0x0BDB,12},{0x17B4,13},{0x2F6B,14},{0x001D, 5},
{0x2F6A,14},{0x0008, 4},{0x0007, 4},{0x0001, 4},
{0x0002, 4},{0x000A, 4},{0x0006, 4},{0x0000, 4},
{0x001C, 5},{0x0009, 4},{0x000D, 4},{0x000F, 4},
{0x000C, 4},{0x0003, 4},{0x000A, 5},{0x0016, 5},
{0x0013, 6},{0x005D, 7},{0x0024, 7},{0x00BC, 8},
{0x005C, 7},{0x05EC,11},{0x000B, 5},{0x005F, 7}
},
{
{0x000F, 5},{0x0010, 6},{0x004B, 8},{0x00C6, 8},
{0x031D,10},{0x0C71,12},{0x0C70,12},{0x0001, 4},
{0x0C73,12},{0x0008, 4},{0x0009, 4},{0x0002, 4},
{0x0003, 4},{0x000B, 4},{0x0006, 4},{0x0000, 4},
{0x001C, 5},{0x0005, 4},{0x000D, 4},{0x000F, 4},
{0x000A, 4},{0x0019, 5},{0x0013, 6},{0x001D, 5},
{0x0030, 6},{0x0062, 7},{0x0024, 7},{0x004A, 8},
{0x018F, 9},{0x0C72,12},{0x000E, 5},{0x0011, 6}
},
{
{0x001B, 5},{0x0003, 6},{0x008D, 8},{0x0040, 7},
{0x0239,10},{0x0471,11},{0x08E0,12},{0x0003, 4},
{0x11C3,13},{0x000A, 4},{0x0009, 4},{0x0004, 4},
{0x0005, 4},{0x000E, 4},{0x0007, 4},{0x0001, 4},
{0x001E, 5},{0x0006, 4},{0x000C, 4},{0x000B, 4},
{0x0002, 4},{0x0000, 5},{0x0041, 7},{0x001F, 5},
{0x0022, 6},{0x0002, 6},{0x008F, 8},{0x008C, 8},
{0x011D, 9},{0x11C2,13},{0x001A, 5},{0x0021, 6}
},
{
{0x001F, 5},{0x0003, 6},{0x0003, 7},{0x0043, 7},
{0x000B, 9},{0x0015,10},{0x0051,12},{0x0003, 4},
{0x0050,12},{0x000D, 4},{0x000C, 4},{0x0004, 4},
{0x0006, 4},{0x000E, 4},{0x000A, 4},{0x0001, 4},
{0x001E, 5},{0x0005, 4},{0x0009, 4},{0x0007, 4},
{0x0011, 5},{0x0002, 6},{0x0004, 8},{0x0002, 4},
{0x002D, 6},{0x0020, 6},{0x0042, 7},{0x0001, 7},
{0x0000, 7},{0x0029,11},{0x0017, 5},{0x002C, 6}
},
{
{0x0003, 4},{0x001F, 6},{0x003A, 7},{0x005D, 7},
{0x0173, 9},{0x02E4,10},{0x172D,13},{0x0004, 4},
{0x172C,13},{0x000F, 4},{0x000E, 4},{0x0009, 4},
{0x0008, 4},{0x000C, 4},{0x000A, 4},{0x0001, 4},
{0x0016, 5},{0x0002, 4},{0x0005, 4},{0x001A, 5},
{0x002F, 6},{0x0038, 7},{0x05CA,11},{0x0006, 4},
{0x0037, 6},{0x001E, 6},{0x003B, 7},{0x0039, 7},
{0x00B8, 8},{0x0B97,12},{0x0000, 4},{0x0036, 6}
},
{
{0x0006, 4},{0x0037, 6},{0x005D, 7},{0x000C, 6},
{0x00B9, 8},{0x02E3,10},{0x05C4,11},{0x0004, 4},
{0x1715,13},{0x0000, 3},{0x000F, 4},{0x0008, 4},
{0x0007, 4},{0x000C, 4},{0x0009, 4},{0x001D, 5},
{0x0016, 5},{0x001C, 5},{0x001A, 5},{0x000B, 5},
{0x005E, 7},{0x0170, 9},{0x1714,13},{0x000A, 4},
{0x000A, 5},{0x0036, 6},{0x005F, 7},{0x001B, 7},
{0x001A, 7},{0x0B8B,12},{0x0002, 4},{0x0007, 5}
},
{
{0x000C, 4},{0x000B, 5},{0x0079, 7},{0x0022, 6},
{0x00F0, 8},{0x0119, 9},{0x0230,10},{0x001D, 5},
{0x08C4,12},{0x0001, 3},{0x0000, 3},{0x000A, 4},
{0x0009, 4},{0x000B, 4},{0x0007, 4},{0x001C, 5},
{0x003D, 6},{0x000D, 5},{0x0008, 5},{0x0015, 6},
{0x008D, 8},{0x118B,13},{0x118A,13},{0x000D, 4},
{0x0010, 5},{0x0009, 5},{0x0014, 6},{0x0047, 7},
{0x00F1, 8},{0x0463,11},{0x001F, 5},{0x000C, 5}
},
{
{0x0000, 3},{0x001A, 5},{0x0033, 6},{0x000C, 5},
{0x0046, 7},{0x01E3, 9},{0x03C5,10},{0x0017, 5},
{0x1E21,13},{0x0002, 3},{0x0001, 3},{0x0009, 4},
{0x000A, 4},{0x0007, 4},{0x001B, 5},{0x003D, 6},
{0x001B, 6},{0x0022, 6},{0x0079, 7},{0x00F0, 8},
{0x1E20,13},{0x1E23,13},{0x1E22,13},{0x000E, 4},
{0x0016, 5},{0x0018, 5},{0x0032, 6},{0x001A, 6},
{0x0047, 7},{0x0789,11},{0x001F, 5},{0x0010, 5}
},
{
{0x001D, 5},{0x0061, 7},{0x004E, 8},{0x009E, 9},
{0x027C,11},{0x09F5,13},{0x09F4,13},{0x0003, 4},
{0x0060, 7},{0x0000, 3},{0x000F, 4},{0x000B, 4},
{0x000A, 4},{0x0009, 4},{0x0005, 4},{0x000D, 5},
{0x0031, 6},{0x0008, 5},{0x0038, 6},{0x0012, 6},
{0x0026, 7},{0x013F,10},{0x04FB,12},{0x000D, 4},
{0x0002, 4},{0x000C, 5},{0x0039, 6},{0x001C, 6},
{0x000F, 5},{0x001D, 6},{0x0008, 4},{0x0019, 5}
},
{
{0x0007, 4},{0x0019, 6},{0x00AB, 8},{0x00AA, 8},
{0x0119,10},{0x0461,12},{0x0460,12},{0x001B, 5},
{0x0047, 8},{0x0001, 3},{0x0000, 3},{0x000C, 4},
{0x000B, 4},{0x0009, 4},{0x0005, 4},{0x000D, 5},
{0x0035, 6},{0x003D, 6},{0x003C, 6},{0x0018, 6},
{0x0022, 7},{0x008D, 9},{0x0231,11},{0x000E, 4},
{0x001F, 5},{0x0009, 5},{0x002B, 6},{0x0010, 6},
{0x0034, 6},{0x0054, 7},{0x0008, 4},{0x0014, 5}
},
{
{0x000C, 4},{0x0005, 5},{0x0008, 6},{0x005B, 7},
{0x004D, 9},{0x0131,11},{0x0261,12},{0x001A, 5},
{0x0012, 7},{0x0000, 3},{0x000F, 4},{0x000A, 4},
{0x0009, 4},{0x0006, 4},{0x001B, 5},{0x0006, 5},
{0x001C, 6},{0x002C, 6},{0x0015, 6},{0x005A, 7},
{0x0027, 8},{0x0099,10},{0x0260,12},{0x000E, 4},
{0x0004, 4},{0x000F, 5},{0x0007, 5},{0x001D, 6},
{0x000B, 5},{0x0014, 6},{0x0008, 4},{0x0017, 5}
},
{
{0x000F, 4},{0x0013, 5},{0x0075, 7},{0x0024, 6},
{0x0095, 8},{0x0251,10},{0x04A0,11},{0x0010, 5},
{0x00C8, 8},{0x0002, 3},{0x0001, 3},{0x0001, 4},
{0x0000, 4},{0x001A, 5},{0x0011, 5},{0x002C, 6},
{0x0065, 7},{0x0074, 7},{0x004B, 7},{0x00C9, 8},
{0x0129, 9},{0x0943,12},{0x0942,12},{0x0003, 3},
{0x000A, 4},{0x001C, 5},{0x0018, 5},{0x0033, 6},
{0x0017, 5},{0x002D, 6},{0x001B, 5},{0x003B, 6}
},
{
{0x0003, 3},{0x001A, 5},{0x002D, 6},{0x0038, 6},
{0x0028, 7},{0x0395,10},{0x0E51,12},{0x0037, 6},
{0x00E4, 8},{0x0001, 3},{0x0000, 3},{0x001F, 5},
{0x001E, 5},{0x0017, 5},{0x003A, 6},{0x0073, 7},
{0x002A, 7},{0x002B, 7},{0x0029, 7},{0x01CB, 9},
{0x0729,11},{0x1CA1,13},{0x1CA0,13},{0x0004, 3},
{0x000A, 4},{0x0004, 4},{0x0018, 5},{0x0036, 6},
{0x000B, 5},{0x002C, 6},{0x0019, 5},{0x003B, 6}
},
{
{0x0004, 3},{0x0004, 4},{0x003F, 6},{0x0017, 5},
{0x0075, 7},{0x01F5, 9},{0x07D1,11},{0x0017, 6},
{0x01F6, 9},{0x0001, 3},{0x0000, 3},{0x001B, 5},
{0x001A, 5},{0x000A, 5},{0x0032, 6},{0x0074, 7},
{0x00F8, 8},{0x00F9, 8},{0x01F7, 9},{0x03E9,10},
{0x0FA0,12},{0x1F43,13},{0x1F42,13},{0x0003, 3},
{0x000A, 4},{0x001E, 5},{0x001C, 5},{0x003B, 6},
{0x0018, 5},{0x0016, 6},{0x0016, 5},{0x0033, 6}
},
{
{0x0004, 3},{0x0007, 4},{0x0018, 5},{0x001E, 5},
{0x0036, 6},{0x0031, 7},{0x0177, 9},{0x0077, 7},
{0x0176, 9},{0x0001, 3},{0x0000, 3},{0x001A, 5},
{0x0019, 5},{0x003A, 6},{0x0019, 6},{0x005C, 7},
{0x00BA, 8},{0x0061, 8},{0x00C1, 9},{0x0180,10},
{0x0302,11},{0x0607,12},{0x0606,12},{0x0002, 3},
{0x000A, 4},{0x001F, 5},{0x001C, 5},{0x0037, 6},
{0x0016, 5},{0x0076, 7},{0x000D, 5},{0x002F, 6}
},
{
{0x0000, 3},{0x000A, 4},{0x001A, 5},{0x000C, 4},
{0x001D, 5},{0x0039, 6},{0x0078, 7},{0x005E, 7},
{0x0393,11},{0x0002, 3},{0x0001, 3},{0x0016, 5},
{0x000F, 5},{0x002E, 6},{0x005F, 7},{0x0073, 8},
{0x00E5, 9},{0x01C8,10},{0x0E4A,13},{0x1C97,14},
{0x1C96,14},{0x0E49,13},{0x0E48,13},{0x0004, 3},
{0x0006, 4},{0x001F, 5},{0x001B, 5},{0x001D, 6},
{0x0038, 6},{0x0038, 7},{0x003D, 6},{0x0079, 7}
},
{
{0x000B, 5},{0x002B, 7},{0x0054, 8},{0x01B7, 9},
{0x06D9,11},{0x0DB1,12},{0x0DB0,12},{0x0002, 4},
{0x00AB, 9},{0x0009, 4},{0x000A, 4},{0x0007, 4},
{0x0008, 4},{0x000F, 4},{0x000C, 4},{0x0003, 4},
{0x001D, 5},{0x0004, 4},{0x000B, 4},{0x0006, 4},
{0x001A, 5},{0x0003, 6},{0x00AA, 9},{0x0001, 4},
{0x0000, 5},{0x0014, 6},{0x006C, 7},{0x00DA, 8},
{0x0002, 6},{0x036D,10},{0x001C, 5},{0x0037, 6}
},
{
{0x001D, 5},{0x0004, 6},{0x00B6, 8},{0x006A, 8},
{0x05B9,11},{0x16E1,13},{0x16E0,13},{0x0007, 4},
{0x016F, 9},{0x000C, 4},{0x000D, 4},{0x0009, 4},
{0x0008, 4},{0x000F, 4},{0x000A, 4},{0x0003, 4},
{0x0017, 5},{0x0002, 4},{0x0004, 4},{0x001C, 5},
{0x002C, 6},{0x006B, 8},{0x0B71,12},{0x0005, 4},
{0x0003, 5},{0x001B, 6},{0x005A, 7},{0x0034, 7},
{0x0005, 6},{0x02DD,10},{0x0000, 4},{0x000C, 5}
},
{
{0x0003, 4},{0x007F, 7},{0x00A1, 8},{0x00A0, 8},
{0x020C,10},{0x0834,12},{0x106B,13},{0x0007, 4},
{0x0082, 8},{0x000E, 4},{0x000D, 4},{0x000B, 4},
{0x000C, 4},{0x0000, 3},{0x0009, 4},{0x0002, 4},
{0x0011, 5},{0x001E, 5},{0x0015, 5},{0x003E, 6},
{0x0040, 7},{0x041B,11},{0x106A,13},{0x0006, 4},
{0x000A, 5},{0x0029, 6},{0x007E, 7},{0x0051, 7},
{0x0021, 6},{0x0107, 9},{0x0004, 4},{0x000B, 5}
},
{
{0x0007, 4},{0x001B, 6},{0x00F6, 8},{0x00E9, 8},
{0x03A1,10},{0x0740,11},{0x0E82,12},{0x001F, 5},
{0x01EF, 9},{0x0001, 3},{0x0002, 3},{0x000B, 4},
{0x000C, 4},{0x000D, 4},{0x0008, 4},{0x001C, 5},
{0x0003, 5},{0x0012, 5},{0x0002, 5},{0x0075, 7},
{0x01D1, 9},{0x1D07,13},{0x1D06,13},{0x000A, 4},
{0x0013, 5},{0x003B, 6},{0x001A, 6},{0x007A, 7},
{0x003C, 6},{0x01EE, 9},{0x0000, 4},{0x000C, 5}
},
{
{0x000D, 4},{0x003D, 6},{0x0042, 7},{0x0037, 7},
{0x00D9, 9},{0x0362,11},{0x06C6,12},{0x001F, 5},
{0x0086, 8},{0x0001, 3},{0x0002, 3},{0x000C, 4},
{0x000B, 4},{0x000A, 4},{0x0001, 4},{0x000F, 5},
{0x0025, 6},{0x003C, 6},{0x001A, 6},{0x0087, 8},
{0x01B0,10},{0x0D8F,13},{0x0D8E,13},{0x000E, 4},
{0x0013, 5},{0x000C, 5},{0x0024, 6},{0x0020, 6},
{0x0011, 5},{0x006D, 8},{0x0000, 4},{0x000E, 5}
},
{
{0x0000, 3},{0x0012, 5},{0x0076, 7},{0x0077, 7},
{0x014D, 9},{0x0533,11},{0x14C9,13},{0x0013, 5},
{0x00A5, 8},{0x0002, 3},{0x0003, 3},{0x000B, 4},
{0x000C, 4},{0x0008, 4},{0x001A, 5},{0x002B, 6},
{0x0075, 7},{0x0074, 7},{0x00A7, 8},{0x0298,10},
{0x14C8,13},{0x14CB,13},{0x14CA,13},{0x000F, 4},
{0x001C, 5},{0x0007, 5},{0x002A, 6},{0x0028, 6},
{0x001B, 5},{0x00A4, 8},{0x0002, 4},{0x0006, 5}
},
{
{0x0002, 3},{0x001A, 5},{0x002B, 6},{0x003A, 6},
{0x00ED, 8},{0x0283,10},{0x0A0A,12},{0x0004, 5},
{0x00A1, 8},{0x0004, 3},{0x0003, 3},{0x000B, 4},
{0x000C, 4},{0x001F, 5},{0x0006, 5},{0x0077, 7},
{0x00A3, 8},{0x00A2, 8},{0x0140, 9},{0x1417,13},
{0x1416,13},{0x0A09,12},{0x0A08,12},{0x0000, 3},
{0x001E, 5},{0x0007, 5},{0x002A, 6},{0x0029, 6},
{0x001C, 5},{0x00EC, 8},{0x001B, 5},{0x0005, 5}
},
{
{0x0002, 3},{0x0002, 4},{0x0018, 5},{0x001D, 5},
{0x0035, 6},{0x00E4, 8},{0x01CF,11},{0x001D, 7},
{0x0072, 9},{0x0004, 3},{0x0005, 3},{0x0006, 4},
{0x0007, 4},{0x0006, 5},{0x0073, 7},{0x0038, 8},
{0x01CE,11},{0x039B,12},{0x0398,12},{0x0733,13},
{0x0732,13},{0x0735,13},{0x0734,13},{0x0000, 3},
{0x001F, 5},{0x001B, 5},{0x0034, 6},{0x000F, 6},
{0x001E, 5},{0x00E5, 8},{0x0019, 5},{0x0038, 6}
},
{
{0x0016, 5},{0x0050, 7},{0x0172, 9},{0x02E7,10},
{0x1732,13},{0x2E67,14},{0x2E66,14},{0x0006, 4},
{0x0051, 7},{0x0001, 3},{0x0000, 3},{0x000D, 4},
{0x000C, 4},{0x0009, 4},{0x001C, 5},{0x0009, 5},
{0x001C, 6},{0x001D, 6},{0x005D, 7},{0x00B8, 8},
{0x05CD,11},{0x1731,13},{0x1730,13},{0x000F, 4},
{0x0005, 4},{0x000F, 5},{0x0008, 5},{0x0029, 6},
{0x001D, 5},{0x002F, 6},{0x0008, 4},{0x0015, 5}
},
{
{0x0009, 4},{0x0021, 6},{0x0040, 7},{0x00AD, 8},
{0x02B0,10},{0x1589,13},{0x1588,13},{0x001C, 5},
{0x005F, 7},{0x0000, 3},{0x000F, 4},{0x000D, 4},
{0x000C, 4},{0x0006, 4},{0x0011, 5},{0x002A, 6},
{0x0057, 7},{0x005E, 7},{0x0041, 7},{0x0159, 9},
{0x0563,11},{0x158B,13},{0x158A,13},{0x0001, 3},
{0x0005, 4},{0x0014, 5},{0x003B, 6},{0x002E, 6},
{0x0004, 4},{0x003A, 6},{0x0007, 4},{0x0016, 5}
},
{
{0x000E, 4},{0x0007, 5},{0x0046, 7},{0x0045, 7},
{0x0064, 9},{0x032A,12},{0x0657,13},{0x0018, 5},
{0x000D, 6},{0x0000, 3},{0x000F, 4},{0x000A, 4},
{0x000B, 4},{0x001A, 5},{0x0036, 6},{0x0047, 7},
{0x0044, 7},{0x0018, 7},{0x0033, 8},{0x00CB,10},
{0x0656,13},{0x0329,12},{0x0328,12},{0x0002, 3},
{0x0006, 4},{0x0019, 5},{0x000E, 5},{0x0037, 6},
{0x0009, 4},{0x000F, 5},{0x0002, 4},{0x0010, 5}
},
{
{0x0003, 3},{0x0018, 5},{0x0023, 6},{0x0077, 7},
{0x0194, 9},{0x1956,13},{0x32AF,14},{0x003A, 6},
{0x0076, 7},{0x0002, 3},{0x0001, 3},{0x001F, 5},
{0x001E, 5},{0x0014, 5},{0x0022, 6},{0x0064, 7},
{0x0197, 9},{0x0196, 9},{0x032B,10},{0x0654,11},
{0x32AE,14},{0x1955,13},{0x1954,13},{0x0000, 3},
{0x0009, 4},{0x001C, 5},{0x0015, 5},{0x0010, 5},
{0x000D, 4},{0x0017, 5},{0x0016, 5},{0x0033, 6}
},
{
{0x0005, 3},{0x0006, 4},{0x003E, 6},{0x0010, 5},
{0x0048, 7},{0x093F,12},{0x24FA,14},{0x0032, 6},
{0x0067, 7},{0x0002, 3},{0x0001, 3},{0x001B, 5},
{0x001E, 5},{0x0034, 6},{0x0066, 7},{0x0092, 8},
{0x0126, 9},{0x024E,10},{0x049E,11},{0x49F7,15},
{0x49F6,15},{0x24F9,14},{0x24F8,14},{0x0000, 3},
{0x0007, 4},{0x0018, 5},{0x0011, 5},{0x003F, 6},
{0x000E, 4},{0x0013, 5},{0x0035, 6},{0x0025, 6}
},
{
{0x0005, 3},{0x0008, 4},{0x0012, 5},{0x001C, 5},
{0x001C, 6},{0x00EA, 9},{0x1D75,14},{0x001E, 6},
{0x0066, 7},{0x0001, 3},{0x0002, 3},{0x001B, 5},
{0x001A, 5},{0x001F, 6},{0x003B, 7},{0x0074, 8},
{0x01D6,10},{0x03AF,11},{0x1D74,14},{0x1D77,14},
{0x1D76,14},{0x0EB9,13},{0x0EB8,13},{0x000F, 4},
{0x0006, 4},{0x0013, 5},{0x003B, 6},{0x003A, 6},
{0x0000, 3},{0x0018, 5},{0x0032, 6},{0x0067, 7}
},
{
{0x0004, 3},{0x000A, 4},{0x001B, 5},{0x000C, 4},
{0x000D, 5},{0x00E6, 8},{0x0684,11},{0x0072, 7},
{0x00E7, 8},{0x0002, 3},{0x0001, 3},{0x0017, 5},
{0x0016, 5},{0x0018, 6},{0x00D1, 8},{0x01A0, 9},
{0x0686,11},{0x0D0F,12},{0x0D0A,12},{0x1A17,13},
{0x1A16,13},{0x1A1D,13},{0x1A1C,13},{0x000F, 4},
{0x001D, 5},{0x000E, 5},{0x0035, 6},{0x0038, 6},
{0x0000, 3},{0x000F, 5},{0x0019, 6},{0x0069, 7}
},
{
{0x0003, 3},{0x000C, 4},{0x001B, 5},{0x0000, 3},
{0x0003, 4},{0x002E, 6},{0x0051, 9},{0x00BC, 8},
{0x0053, 9},{0x0004, 3},{0x0002, 3},{0x0016, 5},
{0x0015, 5},{0x0015, 7},{0x0050, 9},{0x00A4,10},
{0x0294,12},{0x052B,13},{0x052A,13},{0x052D,13},
{0x052C,13},{0x052F,13},{0x052E,13},{0x000E, 4},
{0x001A, 5},{0x0004, 5},{0x0028, 6},{0x0029, 6},
{0x000F, 4},{0x000B, 6},{0x005F, 7},{0x00BD, 8}
},
{
{0x0003, 4},{0x0009, 6},{0x00D0, 8},{0x01A3, 9},
{0x0344,10},{0x0D14,12},{0x1A2B,13},{0x0004, 4},
{0x0015, 7},{0x0000, 3},{0x000F, 4},{0x000B, 4},
{0x000C, 4},{0x000E, 4},{0x0009, 4},{0x001B, 5},
{0x000A, 5},{0x0014, 5},{0x000D, 5},{0x002A, 6},
{0x0014, 7},{0x068B,11},{0x1A2A,13},{0x0008, 4},
{0x000B, 5},{0x002B, 6},{0x000B, 6},{0x0069, 7},
{0x0035, 6},{0x0008, 6},{0x0007, 4},{0x000C, 5}
},
{
{0x000A, 4},{0x003C, 6},{0x0032, 7},{0x0030, 7},
{0x00C5, 9},{0x0621,12},{0x0620,12},{0x001F, 5},
{0x0033, 7},{0x0001, 3},{0x0000, 3},{0x000E, 4},
{0x000D, 4},{0x000C, 4},{0x0004, 4},{0x000D, 5},
{0x0026, 6},{0x0027, 6},{0x0014, 6},{0x0063, 8},
{0x0189,10},{0x0623,12},{0x0622,12},{0x000B, 4},
{0x0012, 5},{0x003D, 6},{0x0022, 6},{0x0015, 6},
{0x000B, 5},{0x0023, 6},{0x0007, 4},{0x0010, 5}
},
{
{0x000F, 4},{0x000C, 5},{0x0043, 7},{0x0010, 6},
{0x0044, 8},{0x0114,10},{0x0455,12},{0x0018, 5},
{0x0023, 7},{0x0001, 3},{0x0000, 3},{0x000E, 4},
{0x000D, 4},{0x0009, 4},{0x0019, 5},{0x0009, 5},
{0x0017, 6},{0x0016, 6},{0x0042, 7},{0x008B, 9},
{0x0454,12},{0x0457,12},{0x0456,12},{0x000B, 4},
{0x0015, 5},{0x000A, 5},{0x0029, 6},{0x0020, 6},
{0x000D, 5},{0x0028, 6},{0x0007, 4},{0x0011, 5}
},
{
{0x0001, 3},{0x001A, 5},{0x0029, 6},{0x002A, 6},
{0x00A0, 8},{0x0285,10},{0x1425,13},{0x0002, 5},
{0x0000, 7},{0x0002, 3},{0x0003, 3},{0x000C, 4},
{0x000B, 4},{0x0008, 4},{0x0012, 5},{0x0001, 6},
{0x0051, 7},{0x0001, 7},{0x0143, 9},{0x0508,11},
{0x1424,13},{0x1427,13},{0x1426,13},{0x000F, 4},
{0x001C, 5},{0x0003, 5},{0x0037, 6},{0x002B, 6},
{0x0013, 5},{0x0036, 6},{0x001D, 5},{0x0001, 5}
},
{
{0x0004, 3},{0x001F, 5},{0x003D, 6},{0x0006, 5},
{0x0016, 7},{0x0053, 9},{0x014A,11},{0x0034, 6},
{0x002A, 8},{0x0002, 3},{0x0003, 3},{0x000B, 4},
{0x000C, 4},{0x001C, 5},{0x0037, 6},{0x0017, 7},
{0x002B, 8},{0x0028, 8},{0x00A4,10},{0x052D,13},
{0x052C,13},{0x052F,13},{0x052E,13},{0x0000, 3},
{0x001D, 5},{0x0007, 5},{0x0004, 5},{0x0035, 6},
{0x0014, 5},{0x0036, 6},{0x0015, 5},{0x003C, 6}
},
{
{0x0004, 3},{0x000A, 4},{0x0007, 5},{0x001D, 5},
{0x0009, 6},{0x01F3, 9},{0x07C7,11},{0x0008, 6},
{0x01F0, 9},{0x0003, 3},{0x0002, 3},{0x000D, 4},
{0x000C, 4},{0x0017, 5},{0x007D, 7},{0x01F2, 9},
{0x07C6,11},{0x07C5,11},{0x1F12,13},{0x3E27,14},
{0x3E26,14},{0x1F11,13},{0x1F10,13},{0x0000, 3},
{0x001E, 5},{0x0006, 5},{0x0039, 6},{0x0038, 6},
{0x003F, 6},{0x002C, 6},{0x0005, 5},{0x002D, 6}
},
{
{0x0002, 3},{0x0007, 4},{0x0018, 5},{0x0003, 4},
{0x0005, 5},{0x0035, 7},{0x004F, 9},{0x0012, 7},
{0x04E5,13},{0x0005, 3},{0x0004, 3},{0x000D, 4},
{0x000E, 4},{0x0033, 6},{0x0026, 8},{0x009D,10},
{0x04E4,13},{0x04E7,13},{0x04E6,13},{0x04E1,13},
{0x04E0,13},{0x04E3,13},{0x04E2,13},{0x0000, 3},
{0x001F, 5},{0x000C, 5},{0x003D, 6},{0x003C, 6},
{0x0032, 6},{0x0034, 7},{0x001B, 6},{0x0008, 6}
},
{
{0x0000, 3},{0x0004, 4},{0x001C, 5},{0x000F, 4},
{0x0002, 4},{0x0007, 5},{0x0075, 7},{0x00E8, 8},
{0x1D2A,13},{0x0005, 3},{0x0004, 3},{0x000D, 4},
{0x000C, 4},{0x0077, 7},{0x0E96,12},{0x3A57,14},
{0x3A56,14},{0x3A5D,14},{0x3A5C,14},{0x3A5F,14},
{0x3A5E,14},{0x1D29,13},{0x1D28,13},{0x0003, 3},
{0x0006, 5},{0x000A, 5},{0x002C, 7},{0x0017, 6},
{0x0076, 7},{0x01D3, 9},{0x03A4,10},{0x002D, 7}
},
{
{0x000A, 4},{0x0024, 6},{0x00BF, 8},{0x0085, 8},
{0x0211,10},{0x0842,12},{0x1087,13},{0x0018, 5},
{0x0020, 6},{0x0001, 3},{0x0002, 3},{0x000E, 4},
{0x000D, 4},{0x0007, 4},{0x0013, 5},{0x0025, 6},
{0x005E, 7},{0x0043, 7},{0x00BE, 8},{0x0109, 9},
{0x1086,13},{0x0841,12},{0x0840,12},{0x000F, 4},
{0x0001, 4},{0x0011, 5},{0x0000, 5},{0x002E, 6},
{0x0019, 5},{0x0001, 5},{0x0006, 4},{0x0016, 5}
},
{
{0x0002, 3},{0x000F, 5},{0x006F, 7},{0x0061, 7},
{0x0374,10},{0x1BA8,13},{0x3753,14},{0x0012, 5},
{0x0036, 6},{0x0000, 3},{0x0001, 3},{0x000A, 4},
{0x000B, 4},{0x001A, 5},{0x0031, 6},{0x0060, 7},
{0x00DC, 8},{0x01BB, 9},{0x06EB,11},{0x1BAB,13},
{0x3752,14},{0x3755,14},{0x3754,14},{0x000E, 4},
{0x0006, 4},{0x0013, 5},{0x000E, 5},{0x003E, 6},
{0x0008, 4},{0x001E, 5},{0x0019, 5},{0x003F, 6}
},
{
{0x0003, 3},{0x001C, 5},{0x0025, 6},{0x0024, 6},
{0x01DA, 9},{0x1DBD,13},{0x3B7C,14},{0x003C, 6},
{0x003D, 6},{0x0000, 3},{0x0001, 3},{0x000B, 4},
{0x000A, 4},{0x000B, 5},{0x0077, 7},{0x00EC, 8},
{0x03B6,10},{0x076E,11},{0x1DBF,13},{0x76FB,15},
{0x76FA,15},{0x3B79,14},{0x3B78,14},{0x000D, 4},
{0x001F, 5},{0x0013, 5},{0x000A, 5},{0x0008, 5},
{0x000C, 4},{0x0008, 4},{0x0009, 5},{0x003A, 6}
},
{
{0x0005, 3},{0x0003, 4},{0x0004, 5},{0x0010, 5},
{0x008F, 8},{0x0475,11},{0x11D1,13},{0x0079, 7},
{0x0027, 6},{0x0002, 3},{0x0003, 3},{0x0001, 4},
{0x0000, 4},{0x0026, 6},{0x0046, 7},{0x011C, 9},
{0x0477,11},{0x08ED,12},{0x11D0,13},{0x11D3,13},
{0x11D2,13},{0x11D9,13},{0x11D8,13},{0x000D, 4},
{0x001F, 5},{0x0012, 5},{0x0005, 5},{0x003D, 6},
{0x000C, 4},{0x000E, 4},{0x0022, 6},{0x0078, 7}
},
{
{0x0005, 3},{0x000C, 4},{0x001B, 5},{0x0000, 4},
{0x0006, 6},{0x03E2,10},{0x3E3D,14},{0x000F, 7},
{0x0034, 6},{0x0003, 3},{0x0002, 3},{0x001E, 5},
{0x001D, 5},{0x007D, 7},{0x01F0, 9},{0x07C6,11},
{0x3E3C,14},{0x3E3F,14},{0x3E3E,14},{0x3E39,14},
{0x3E38,14},{0x3E3B,14},{0x3E3A,14},{0x0008, 4},
{0x001C, 5},{0x0002, 5},{0x003F, 6},{0x0035, 6},
{0x0009, 4},{0x0001, 3},{0x000E, 7},{0x00F9, 8}
},
{
{0x0004, 3},{0x000B, 4},{0x0001, 4},{0x000A, 4},
{0x001E, 6},{0x00E0, 9},{0x0E1E,13},{0x0071, 8},
{0x0039, 7},{0x0007, 3},{0x0006, 3},{0x000D, 5},
{0x000C, 5},{0x0020, 7},{0x01C2,10},{0x1C3F,14},
{0x1C3E,14},{0x0E19,13},{0x0E18,13},{0x0E1B,13},
{0x0E1A,13},{0x0E1D,13},{0x0E1C,13},{0x0000, 4},
{0x0009, 5},{0x001D, 6},{0x001F, 6},{0x0011, 6},
{0x0005, 4},{0x0001, 3},{0x0043, 8},{0x0042, 8}
},
{
{0x0004, 3},{0x000D, 4},{0x0007, 4},{0x0002, 3},
{0x0014, 5},{0x016C, 9},{0x16D1,13},{0x02DF,10},
{0x016E, 9},{0x0000, 2},{0x0007, 3},{0x002C, 6},
{0x002B, 6},{0x02DE,10},{0x16D0,13},{0x16D3,13},
{0x16D2,13},{0x2DB5,14},{0x2DB4,14},{0x2DB7,14},
{0x2DB6,14},{0x16D9,13},{0x16D8,13},{0x000C, 5},
{0x002A, 6},{0x005A, 7},{0x001B, 6},{0x001A, 6},
{0x0017, 5},{0x000C, 4},{0x05B7,11},{0x05B5,11}
},
{
{0x0002, 2},{0x000F, 4},{0x001C, 5},{0x000C, 4},
{0x003B, 6},{0x01AC, 9},{0x1AD8,13},{0x35B3,14},
{0x35B2,14},{0x0001, 2},{0x0000, 2},{0x0069, 7},
{0x0068, 7},{0x35BD,14},{0x35BC,14},{0x35BF,14},
{0x35BE,14},{0x35B9,14},{0x35B8,14},{0x35BB,14},
{0x35BA,14},{0x35B5,14},{0x35B4,14},{0x01A9, 9},
{0x01A8, 9},{0x035A,10},{0x00D7, 8},{0x00D5, 8},
{0x003A, 6},{0x001B, 5},{0x35B7,14},{0x35B6,14}
},
{
{0x0000, 3},{0x0010, 5},{0x0072, 7},{0x0071, 7},
{0x0154, 9},{0x0AAB,12},{0x0AA8,12},{0x0014, 5},
{0x0070, 7},{0x0002, 3},{0x0003, 3},{0x000C, 4},
{0x000B, 4},{0x0003, 4},{0x0011, 5},{0x0073, 7},
{0x0054, 7},{0x00AB, 8},{0x02AB,10},{0x1553,13},
{0x1552,13},{0x1555,13},{0x1554,13},{0x000D, 4},
{0x001E, 5},{0x0012, 5},{0x003E, 6},{0x002B, 6},
{0x0002, 4},{0x003F, 6},{0x001D, 5},{0x0013, 5}
},
{
{0x0003, 3},{0x001F, 5},{0x0029, 6},{0x003D, 6},
{0x000C, 7},{0x0069,10},{0x0345,13},{0x0002, 5},
{0x0028, 6},{0x0002, 3},{0x0001, 3},{0x000E, 4},
{0x000C, 4},{0x0015, 5},{0x0007, 6},{0x001B, 8},
{0x006B,10},{0x006A,10},{0x0344,13},{0x0347,13},
{0x0346,13},{0x01A1,12},{0x01A0,12},{0x000B, 4},
{0x001A, 5},{0x0012, 5},{0x0000, 5},{0x003C, 6},
{0x0008, 4},{0x001B, 5},{0x0013, 5},{0x0001, 5}
},
{
{0x0004, 3},{0x0004, 4},{0x003F, 6},{0x0014, 5},
{0x0056, 7},{0x015C, 9},{0x15D5,13},{0x003C, 6},
{0x002A, 6},{0x0000, 3},{0x0001, 3},{0x000E, 4},
{0x000D, 4},{0x000C, 5},{0x00AF, 8},{0x02BB,10},
{0x15D4,13},{0x15D7,13},{0x15D6,13},{0x15D1,13},
{0x15D0,13},{0x15D3,13},{0x15D2,13},{0x000B, 4},
{0x0019, 5},{0x000D, 5},{0x003E, 6},{0x0031, 6},
{0x0007, 4},{0x0005, 4},{0x003D, 6},{0x0030, 6}
},
{
{0x0005, 3},{0x0008, 4},{0x001A, 5},{0x0000, 4},
{0x0036, 6},{0x0011, 8},{0x0106,12},{0x000A, 7},
{0x006E, 7},{0x0002, 3},{0x0003, 3},{0x0003, 4},
{0x0002, 4},{0x006F, 7},{0x0021, 9},{0x020F,13},
{0x020E,13},{0x0101,12},{0x0100,12},{0x0103,12},
{0x0102,12},{0x0105,12},{0x0104,12},{0x000C, 4},
{0x001E, 5},{0x0003, 5},{0x003E, 6},{0x003F, 6},
{0x0009, 4},{0x000E, 4},{0x000B, 7},{0x0009, 7}
},
{
{0x0002, 3},{0x000E, 4},{0x001E, 5},{0x000C, 4},
{0x001F, 5},{0x006E, 7},{0x00AD,10},{0x00AF,10},
{0x0014, 7},{0x0004, 3},{0x0003, 3},{0x001A, 5},
{0x0017, 5},{0x002A, 8},{0x0576,13},{0x0AEF,14},
{0x0AEE,14},{0x0571,13},{0x0570,13},{0x0573,13},
{0x0572,13},{0x0575,13},{0x0574,13},{0x0003, 4},
{0x0016, 5},{0x0004, 5},{0x0036, 6},{0x000B, 6},
{0x000A, 4},{0x0000, 3},{0x006F, 7},{0x00AC,10}
},
{
{0x0004, 3},{0x0005, 4},{0x0003, 3},{0x0001, 3},
{0x0004, 4},{0x002F, 6},{0x0526,11},{0x1495,13},
{0x00A6, 8},{0x0007, 3},{0x0006, 3},{0x002D, 6},
{0x002C, 6},{0x1494,13},{0x1497,13},{0x1496,13},
{0x1491,13},{0x1490,13},{0x1493,13},{0x1492,13},
{0x293D,14},{0x293C,14},{0x293F,14},{0x0000, 3},
{0x0028, 6},{0x00A5, 8},{0x0148, 9},{0x00A7, 8},
{0x002E, 6},{0x0015, 5},{0x0A4E,12},{0x293E,14}
},
{
{0x0004, 3},{0x0005, 4},{0x0003, 3},{0x0001, 3},
{0x0004, 4},{0x002F, 6},{0x0526,11},{0x1495,13},
{0x00A6, 8},{0x0007, 3},{0x0006, 3},{0x002D, 6},
{0x002C, 6},{0x1494,13},{0x1497,13},{0x1496,13},
{0x1491,13},{0x1490,13},{0x1493,13},{0x1492,13},
{0x293D,14},{0x293C,14},{0x293F,14},{0x0000, 3},
{0x0028, 6},{0x00A5, 8},{0x0148, 9},{0x00A7, 8},
{0x002E, 6},{0x0015, 5},{0x0A4E,12},{0x293E,14}
},
{
{0x0004, 3},{0x0005, 4},{0x0003, 3},{0x0001, 3},
{0x0004, 4},{0x002F, 6},{0x0526,11},{0x1495,13},
{0x00A6, 8},{0x0007, 3},{0x0006, 3},{0x002D, 6},
{0x002C, 6},{0x1494,13},{0x1497,13},{0x1496,13},
{0x1491,13},{0x1490,13},{0x1493,13},{0x1492,13},
{0x293D,14},{0x293C,14},{0x293F,14},{0x0000, 3},
{0x0028, 6},{0x00A5, 8},{0x0148, 9},{0x00A7, 8},
{0x002E, 6},{0x0015, 5},{0x0A4E,12},{0x293E,14}
},
{
{0x0003, 3},{0x0011, 5},{0x0020, 6},{0x0074, 7},
{0x010D, 9},{0x0863,12},{0x0860,12},{0x000A, 5},
{0x0075, 7},{0x0001, 3},{0x0000, 3},{0x000B, 4},
{0x000A, 4},{0x0018, 5},{0x0038, 6},{0x0042, 7},
{0x010F, 9},{0x010E, 9},{0x0219,10},{0x10C3,13},
{0x10C2,13},{0x10C5,13},{0x10C4,13},{0x000F, 4},
{0x0004, 4},{0x0019, 5},{0x000B, 5},{0x0039, 6},
{0x0009, 4},{0x001B, 5},{0x001A, 5},{0x003B, 6}
},
{
{0x0005, 3},{0x0001, 4},{0x003E, 6},{0x0001, 5},
{0x00E2, 8},{0x1C6F,13},{0x38D9,14},{0x0039, 6},
{0x001F, 6},{0x0002, 3},{0x0001, 3},{0x0009, 4},
{0x0008, 4},{0x0000, 5},{0x0070, 7},{0x01C7, 9},
{0x038C,10},{0x071A,11},{0x38D8,14},{0x38DB,14},
{0x38DA,14},{0x38DD,14},{0x38DC,14},{0x000D, 4},
{0x001D, 5},{0x000E, 5},{0x003F, 6},{0x003C, 6},
{0x000C, 4},{0x0006, 4},{0x003D, 6},{0x001E, 6}
},
{
{0x0006, 3},{0x000B, 4},{0x0011, 5},{0x001E, 5},
{0x0074, 7},{0x03AA,10},{0x1D5C,13},{0x0001, 6},
{0x0021, 6},{0x0001, 3},{0x0002, 3},{0x0007, 4},
{0x0006, 4},{0x003E, 6},{0x00EB, 8},{0x01D4, 9},
{0x0EAF,12},{0x3ABB,14},{0x3ABA,14},{0x1D59,13},
{0x1D58,13},{0x1D5B,13},{0x1D5A,13},{0x000A, 4},
{0x001C, 5},{0x0001, 5},{0x003F, 6},{0x003B, 6},
{0x0001, 4},{0x0009, 4},{0x0020, 6},{0x0000, 6}
},
{
{0x0004, 3},{0x000A, 4},{0x0017, 5},{0x0004, 4},
{0x0016, 6},{0x016A, 9},{0x16B1,13},{0x0017, 7},
{0x005B, 7},{0x0006, 3},{0x0007, 3},{0x0001, 4},
{0x0000, 4},{0x000A, 6},{0x02D7,10},{0x0B5A,12},
{0x16B0,13},{0x16B3,13},{0x16B2,13},{0x2D6D,14},
{0x2D6C,14},{0x2D6F,14},{0x2D6E,14},{0x0006, 4},
{0x000A, 5},{0x0004, 5},{0x002C, 6},{0x0017, 6},
{0x0003, 4},{0x0007, 4},{0x0016, 7},{0x00B4, 8}
},
{
{0x0005, 3},{0x000D, 4},{0x0005, 4},{0x0009, 4},
{0x0033, 6},{0x0193, 9},{0x192C,13},{0x0061, 8},
{0x0031, 7},{0x0000, 2},{0x0007, 3},{0x0010, 5},
{0x0011, 5},{0x00C8, 8},{0x192F,13},{0x325B,14},
{0x325A,14},{0x1929,13},{0x1928,13},{0x192B,13},
{0x192A,13},{0x325D,14},{0x325C,14},{0x0018, 5},
{0x001A, 6},{0x001B, 6},{0x0065, 7},{0x0019, 6},
{0x0004, 4},{0x0007, 4},{0x0060, 8},{0x0324,10}
},
{
{0x0006, 3},{0x0000, 3},{0x0002, 4},{0x000F, 4},
{0x0039, 6},{0x01D9, 9},{0x1D82,13},{0x0761,11},
{0x03BE,10},{0x0001, 2},{0x0002, 2},{0x000F, 6},
{0x000E, 6},{0x0762,11},{0x3B07,14},{0x3B06,14},
{0x3B1D,14},{0x3B1C,14},{0x3B1F,14},{0x3B1E,14},
{0x3B19,14},{0x3B18,14},{0x3B1B,14},{0x0038, 6},
{0x01DE, 9},{0x00ED, 8},{0x03BF,10},{0x00EE, 8},
{0x003A, 6},{0x0006, 5},{0x0EC0,12},{0x3B1A,14}
},
{
{0x0000, 2},{0x0002, 3},{0x000F, 5},{0x0006, 4},
{0x001C, 6},{0x01D0,10},{0x0E8C,13},{0x1D1B,14},
{0x1D1A,14},{0x0003, 2},{0x0002, 2},{0x00EA, 9},
{0x00E9, 9},{0x0E89,13},{0x0E88,13},{0x0E8B,13},
{0x0E8A,13},{0x1D65,14},{0x1D64,14},{0x1D67,14},
{0x1D66,14},{0x1D61,14},{0x1D60,14},{0x03AD,11},
{0x1D63,14},{0x1D62,14},{0x1D1D,14},{0x1D1C,14},
{0x003B, 7},{0x01D7,10},{0x1D1F,14},{0x1D1E,14}
},
{
{0x0002, 2},{0x000F, 4},{0x001C, 5},{0x000C, 4},
{0x003B, 6},{0x01AC, 9},{0x1AD8,13},{0x35B3,14},
{0x35B2,14},{0x0001, 2},{0x0000, 2},{0x0069, 7},
{0x0068, 7},{0x35BD,14},{0x35BC,14},{0x35BF,14},
{0x35BE,14},{0x35B9,14},{0x35B8,14},{0x35BB,14},
{0x35BA,14},{0x35B5,14},{0x35B4,14},{0x01A9, 9},
{0x01A8, 9},{0x035A,10},{0x00D7, 8},{0x00D5, 8},
{0x003A, 6},{0x001B, 5},{0x35B7,14},{0x35B6,14}
}
};
/*A description of a Huffman code value used when encoding the tree.*/
typedef struct{
/*The bit pattern, left-shifted so that the MSB of all patterns is
aligned.*/
unsigned long pattern;
/*The amount the bit pattern was shifted.*/
int shift;
/*The token this bit pattern represents.*/
int token;
}th_huff_entry;
/*Compares two th_huff_entry structures by their bit patterns.
_c1: The first entry to compare.
_c2: The second entry to compare.
Return: <0 if _c1<_c2, >0 if _c1>_c2.*/
static int huff_entry_cmp(const void *_c1,const void *_c2){
unsigned long b1;
unsigned long b2;
b1=((const th_huff_entry *)_c1)->pattern;
b2=((const th_huff_entry *)_c2)->pattern;
return b1<b2?-1:b1>b2?1:0;
}
int th_huff_codes2latex(const theora_huff_code _codes[80][32]){
int i;
printf("\\twocolumn\n");
for(i=0;i<80;i++){
th_huff_entry entries[32];
int maxlen;
int mask;
int j;
/*First, find the maximum code length so we can align all the bit
patterns.*/
maxlen=_codes[i][0].nbits;
for(j=1;j<32;j++)if(maxlen<_codes[i][j].nbits)maxlen=_codes[i][j].nbits;
mask=(1<<maxlen)-1;
/*Copy over the codes into our temporary workspace.
The bit patterns are aligned, and the original entry each code is from
is stored as well.*/
for(j=0;j<32;j++){
entries[j].shift=maxlen-_codes[i][j].nbits;
entries[j].pattern=_codes[i][j].pattern<<entries[j].shift&mask;
entries[j].token=j;
}
/*Sort the codes into ascending order.
This is the order they will be presented in.*/
qsort(entries,32,sizeof(entries[0]),huff_entry_cmp);
printf("\\begin{center}\n");
printf("\\begin{tabular}{lr}\\toprule\n");
printf("\\multicolumn{1}{c}{Huffman Code} & Token Value \\\\\\midrule\n");
for(j=0;j<32;j++){
int k;
printf("\\bin{");
for(k=maxlen;k-->entries[j].shift;){
printf("%c",(int)(entries[j].pattern>>k&1)+'0');
}
printf("}");
for(;k>=0;k--)printf(" ");
printf(" & ");
if(entries[j].token<10)printf(" ");
printf("$%i$ \\\\\n",entries[j].token);
}
printf("\\bottomrule\n");
printf("\\\\\n");
printf("\\multicolumn{2}{c}{VP3.1 Huffman Table Number $%i$}\n",i);
printf("\\end{tabular}\n");
printf("\\end{center}\n");
printf("\\vfill\n");
printf("\n");
}
printf("\\onecolumn\n");
return 0;
}
int main(int _argc,char **_argv){
th_huff_codes2latex(TH_VP31_HUFF_CODES);
return 0;
}
| {
"pile_set_name": "Github"
} |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# 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.
# ----------------------------------------------------------------------------------
<#
.Synopsis
Deletes the event source with the specified name in the specified subscription, resource group, and environment
.Description
Deletes the event source with the specified name in the specified subscription, resource group, and environment
.Example
PS C:\> Remove-AzTimeSeriesInsightsEventSource -EnvironmentName tsitest001 -Name iots001 -ResourceGroupName testgroup
.Example
PS C:\> $es = Get-AzTimeSeriesInsightsEventSource -EnvironmentName tsitest001 -ResourceGroupName testgroup -Name iots001
PS C:\> Remove-AzTimeSeriesInsightsEventSource -InputObject $es
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.ITimeSeriesInsightsIdentity
.Outputs
System.Boolean
.Notes
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
INPUTOBJECT <ITimeSeriesInsightsIdentity>: Identity Parameter
[AccessPolicyName <String>]: Name of the access policy.
[EnvironmentName <String>]: Name of the environment
[EventSourceName <String>]: The name of the Time Series Insights event source associated with the specified environment.
[Id <String>]: Resource identity path
[ReferenceDataSetName <String>]: Name of the reference data set.
[ResourceGroupName <String>]: Name of an Azure Resource group.
[SubscriptionId <String>]: Azure Subscription ID.
.Link
https://docs.microsoft.com/en-us/powershell/module/az.timeseriesinsights/remove-aztimeseriesinsightseventsource
#>
function Remove-AzTimeSeriesInsightsEventSource {
[OutputType([System.Boolean])]
[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(ParameterSetName='Delete', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Path')]
[System.String]
# The name of the Time Series Insights environment associated with the specified resource group.
${EnvironmentName},
[Parameter(ParameterSetName='Delete', Mandatory)]
[Alias('EventSourceName')]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Path')]
[System.String]
# The name of the Time Series Insights event source associated with the specified environment.
${Name},
[Parameter(ParameterSetName='Delete', Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Path')]
[System.String]
# Name of an Azure Resource group.
${ResourceGroupName},
[Parameter(ParameterSetName='Delete')]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
[System.String]
# Azure Subscription ID.
${SubscriptionId},
[Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Path')]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Models.ITimeSeriesInsightsIdentity]
# Identity Parameter
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
${InputObject},
[Parameter()]
[Alias('AzureRMContext', 'AzureCredential')]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Azure')]
[System.Management.Automation.PSObject]
# The credentials, account, tenant, and subscription used for communication with Azure.
${DefaultProfile},
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Wait for .NET debugger to attach
${Break},
[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Runtime')]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Runtime.SendAsyncStep[]]
# SendAsync Pipeline Steps to be appended to the front of the pipeline
${HttpPipelineAppend},
[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Runtime')]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Runtime.SendAsyncStep[]]
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
${HttpPipelinePrepend},
[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Returns true when the command succeeds
${PassThru},
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Runtime')]
[System.Uri]
# The URI for the proxy server to use
${Proxy},
[Parameter(DontShow)]
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Runtime')]
[System.Management.Automation.PSCredential]
# Credentials for a proxy server to use for the remote call
${ProxyCredential},
[Parameter(DontShow)]
[Microsoft.Azure.PowerShell.Cmdlets.TimeSeriesInsights.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
)
begin {
try {
$outBuffer = $null
if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
$PSBoundParameters['OutBuffer'] = 1
}
$parameterSet = $PSCmdlet.ParameterSetName
$mapping = @{
Delete = 'Az.TimeSeriesInsights.private\Remove-AzTimeSeriesInsightsEventSource_Delete';
DeleteViaIdentity = 'Az.TimeSeriesInsights.private\Remove-AzTimeSeriesInsightsEventSource_DeleteViaIdentity';
}
if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) {
$PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
$steppablePipeline.Begin($PSCmdlet)
} catch {
throw
}
}
process {
try {
$steppablePipeline.Process($_)
} catch {
throw
}
}
end {
try {
$steppablePipeline.End()
} catch {
throw
}
}
}
| {
"pile_set_name": "Github"
} |
// Copyright 2013 Julien Schmidt. All rights reserved.
// Based on the path package, Copyright 2009 The Go Authors.
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
package httprouter
// CleanPath is the URL version of path.Clean, it returns a canonical URL path
// for p, eliminating . and .. elements.
//
// The following rules are applied iteratively until no further processing can
// be done:
// 1. Replace multiple slashes with a single slash.
// 2. Eliminate each . path name element (the current directory).
// 3. Eliminate each inner .. path name element (the parent directory)
// along with the non-.. element that precedes it.
// 4. Eliminate .. elements that begin a rooted path:
// that is, replace "/.." by "/" at the beginning of a path.
//
// If the result of this process is an empty string, "/" is returned
func CleanPath(p string) string {
// Turn empty string into "/"
if p == "" {
return "/"
}
n := len(p)
var buf []byte
// Invariants:
// reading from path; r is index of next byte to process.
// writing to buf; w is index of next byte to write.
// path must start with '/'
r := 1
w := 1
if p[0] != '/' {
r = 0
buf = make([]byte, n+1)
buf[0] = '/'
}
trailing := n > 2 && p[n-1] == '/'
// A bit more clunky without a 'lazybuf' like the path package, but the loop
// gets completely inlined (bufApp). So in contrast to the path package this
// loop has no expensive function calls (except 1x make)
for r < n {
switch {
case p[r] == '/':
// empty path element, trailing slash is added after the end
r++
case p[r] == '.' && r+1 == n:
trailing = true
r++
case p[r] == '.' && p[r+1] == '/':
// . element
r++
case p[r] == '.' && p[r+1] == '.' && (r+2 == n || p[r+2] == '/'):
// .. element: remove to last /
r += 2
if w > 1 {
// can backtrack
w--
if buf == nil {
for w > 1 && p[w] != '/' {
w--
}
} else {
for w > 1 && buf[w] != '/' {
w--
}
}
}
default:
// real path element.
// add slash if needed
if w > 1 {
bufApp(&buf, p, w, '/')
w++
}
// copy element
for r < n && p[r] != '/' {
bufApp(&buf, p, w, p[r])
w++
r++
}
}
}
// re-append trailing slash
if trailing && w > 1 {
bufApp(&buf, p, w, '/')
w++
}
if buf == nil {
return p[:w]
}
return string(buf[:w])
}
// internal helper to lazily create a buffer if necessary
func bufApp(buf *[]byte, s string, w int, c byte) {
if *buf == nil {
if s[w] == c {
return
}
*buf = make([]byte, len(s))
copy(*buf, s[:w])
}
(*buf)[w] = c
}
| {
"pile_set_name": "Github"
} |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package devicefarm_test
import (
"fmt"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/devicefarm"
)
var _ time.Duration
var _ strings.Reader
var _ aws.Config
func parseTime(layout, value string) *time.Time {
t, err := time.Parse(layout, value)
if err != nil {
panic(err)
}
return &t
}
// To create a new device pool
//
// The following example creates a new device pool named MyDevicePool inside an existing
// project.
func ExampleDeviceFarm_CreateDevicePool_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.CreateDevicePoolInput{
Description: aws.String("My Android devices"),
Name: aws.String("MyDevicePool"),
ProjectArn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:project:EXAMPLE-GUID-123-456"),
}
result, err := svc.CreateDevicePool(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To create a new project
//
// The following example creates a new project named MyProject.
func ExampleDeviceFarm_CreateProject_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.CreateProjectInput{
Name: aws.String("MyProject"),
}
result, err := svc.CreateProject(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
case devicefarm.ErrCodeTagOperationException:
fmt.Println(devicefarm.ErrCodeTagOperationException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To create a remote access session
//
// The following example creates a remote access session named MySession.
func ExampleDeviceFarm_CreateRemoteAccessSession_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.CreateRemoteAccessSessionInput{
Configuration: &devicefarm.CreateRemoteAccessSessionConfiguration{
BillingMethod: aws.String("METERED"),
},
DeviceArn: aws.String("arn:aws:devicefarm:us-west-2::device:123EXAMPLE"),
Name: aws.String("MySession"),
ProjectArn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:project:EXAMPLE-GUID-123-456"),
}
result, err := svc.CreateRemoteAccessSession(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To create a new test package upload
//
// The following example creates a new Appium Python test package upload inside an existing
// project.
func ExampleDeviceFarm_CreateUpload_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.CreateUploadInput{
Name: aws.String("MyAppiumPythonUpload"),
ProjectArn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:project:EXAMPLE-GUID-123-456"),
Type: aws.String("APPIUM_PYTHON_TEST_PACKAGE"),
}
result, err := svc.CreateUpload(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To delete a device pool
//
// The following example deletes a specific device pool.
func ExampleDeviceFarm_DeleteDevicePool_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.DeleteDevicePoolInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2::devicepool:123-456-EXAMPLE-GUID"),
}
result, err := svc.DeleteDevicePool(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To delete a project
//
// The following example deletes a specific project.
func ExampleDeviceFarm_DeleteProject_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.DeleteProjectInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:project:EXAMPLE-GUID-123-456"),
}
result, err := svc.DeleteProject(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To delete a specific remote access session
//
// The following example deletes a specific remote access session.
func ExampleDeviceFarm_DeleteRemoteAccessSession_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.DeleteRemoteAccessSessionInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:session:EXAMPLE-GUID-123-456"),
}
result, err := svc.DeleteRemoteAccessSession(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To delete a run
//
// The following example deletes a specific test run.
func ExampleDeviceFarm_DeleteRun_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.DeleteRunInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:run:EXAMPLE-GUID-123-456"),
}
result, err := svc.DeleteRun(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To delete a specific upload
//
// The following example deletes a specific upload.
func ExampleDeviceFarm_DeleteUpload_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.DeleteUploadInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:upload:EXAMPLE-GUID-123-456"),
}
result, err := svc.DeleteUpload(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about account settings
//
// The following example returns information about your Device Farm account settings.
func ExampleDeviceFarm_GetAccountSettings_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.GetAccountSettingsInput{}
result, err := svc.GetAccountSettings(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about a device
//
// The following example returns information about a specific device.
func ExampleDeviceFarm_GetDevice_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.GetDeviceInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2::device:123EXAMPLE"),
}
result, err := svc.GetDevice(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about a device pool
//
// The following example returns information about a specific device pool, given a project
// ARN.
func ExampleDeviceFarm_GetDevicePool_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.GetDevicePoolInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:project:EXAMPLE-GUID-123-456"),
}
result, err := svc.GetDevicePool(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about the compatibility of a device pool
//
// The following example returns information about the compatibility of a specific device
// pool, given its ARN.
func ExampleDeviceFarm_GetDevicePoolCompatibility_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.GetDevicePoolCompatibilityInput{
AppArn: aws.String("arn:aws:devicefarm:us-west-2::app:123-456-EXAMPLE-GUID"),
DevicePoolArn: aws.String("arn:aws:devicefarm:us-west-2::devicepool:123-456-EXAMPLE-GUID"),
TestType: aws.String("APPIUM_PYTHON"),
}
result, err := svc.GetDevicePoolCompatibility(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about a job
//
// The following example returns information about a specific job.
func ExampleDeviceFarm_GetJob_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.GetJobInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2::job:123-456-EXAMPLE-GUID"),
}
result, err := svc.GetJob(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get status information about device offerings
//
// The following example returns information about Device Farm offerings available to
// your account.
func ExampleDeviceFarm_GetOfferingStatus_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.GetOfferingStatusInput{
NextToken: aws.String("RW5DdDJkMWYwZjM2MzM2VHVpOHJIUXlDUXlhc2QzRGViYnc9SEXAMPLE="),
}
result, err := svc.GetOfferingStatus(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeNotEligibleException:
fmt.Println(devicefarm.ErrCodeNotEligibleException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about a project
//
// The following example gets information about a specific project.
func ExampleDeviceFarm_GetProject_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.GetProjectInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:project:5e01a8c7-c861-4c0a-b1d5-12345EXAMPLE"),
}
result, err := svc.GetProject(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get a remote access session
//
// The following example gets a specific remote access session.
func ExampleDeviceFarm_GetRemoteAccessSession_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.GetRemoteAccessSessionInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:session:EXAMPLE-GUID-123-456"),
}
result, err := svc.GetRemoteAccessSession(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about a test run
//
// The following example gets information about a specific test run.
func ExampleDeviceFarm_GetRun_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.GetRunInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:run:5e01a8c7-c861-4c0a-b1d5-5ec6e6c6dd23/0fcac17b-6122-44d7-ae5a-12345EXAMPLE"),
}
result, err := svc.GetRun(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about a test suite
//
// The following example gets information about a specific test suite.
func ExampleDeviceFarm_GetSuite_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.GetSuiteInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:suite:EXAMPLE-GUID-123-456"),
}
result, err := svc.GetSuite(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about a specific test
//
// The following example gets information about a specific test.
func ExampleDeviceFarm_GetTest_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.GetTestInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:test:EXAMPLE-GUID-123-456"),
}
result, err := svc.GetTest(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about a specific upload
//
// The following example gets information about a specific upload.
func ExampleDeviceFarm_GetUpload_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.GetUploadInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:upload:EXAMPLE-GUID-123-456"),
}
result, err := svc.GetUpload(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To install to a remote access session
//
// The following example installs a specific app to a device in a specific remote access
// session.
func ExampleDeviceFarm_InstallToRemoteAccessSession_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.InstallToRemoteAccessSessionInput{
AppArn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:app:EXAMPLE-GUID-123-456"),
RemoteAccessSessionArn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:session:EXAMPLE-GUID-123-456"),
}
result, err := svc.InstallToRemoteAccessSession(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To list artifacts for a resource
//
// The following example lists screenshot artifacts for a specific run.
func ExampleDeviceFarm_ListArtifacts_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.ListArtifactsInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:run:EXAMPLE-GUID-123-456"),
Type: aws.String("SCREENSHOT"),
}
result, err := svc.ListArtifacts(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about device pools
//
// The following example returns information about the private device pools in a specific
// project.
func ExampleDeviceFarm_ListDevicePools_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.ListDevicePoolsInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:project:EXAMPLE-GUID-123-456"),
Type: aws.String("PRIVATE"),
}
result, err := svc.ListDevicePools(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about devices
//
// The following example returns information about the available devices in a specific
// project.
func ExampleDeviceFarm_ListDevices_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.ListDevicesInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:project:EXAMPLE-GUID-123-456"),
}
result, err := svc.ListDevices(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about jobs
//
// The following example returns information about jobs in a specific project.
func ExampleDeviceFarm_ListJobs_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.ListJobsInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:project:EXAMPLE-GUID-123-456"),
}
result, err := svc.ListJobs(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about device offering transactions
//
// The following example returns information about Device Farm offering transactions.
func ExampleDeviceFarm_ListOfferingTransactions_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.ListOfferingTransactionsInput{
NextToken: aws.String("RW5DdDJkMWYwZjM2MzM2VHVpOHJIUXlDUXlhc2QzRGViYnc9SEXAMPLE="),
}
result, err := svc.ListOfferingTransactions(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeNotEligibleException:
fmt.Println(devicefarm.ErrCodeNotEligibleException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about device offerings
//
// The following example returns information about available device offerings.
func ExampleDeviceFarm_ListOfferings_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.ListOfferingsInput{
NextToken: aws.String("RW5DdDJkMWYwZjM2MzM2VHVpOHJIUXlDUXlhc2QzRGViYnc9SEXAMPLE="),
}
result, err := svc.ListOfferings(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeNotEligibleException:
fmt.Println(devicefarm.ErrCodeNotEligibleException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about a Device Farm project
//
// The following example returns information about the specified project in Device Farm.
func ExampleDeviceFarm_ListProjects_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.ListProjectsInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:project:7ad300ed-8183-41a7-bf94-12345EXAMPLE"),
NextToken: aws.String("RW5DdDJkMWYwZjM2MzM2VHVpOHJIUXlDUXlhc2QzRGViYnc9SEXAMPLE"),
}
result, err := svc.ListProjects(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about a remote access session
//
// The following example returns information about a specific Device Farm remote access
// session.
func ExampleDeviceFarm_ListRemoteAccessSessions_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.ListRemoteAccessSessionsInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:session:EXAMPLE-GUID-123-456"),
NextToken: aws.String("RW5DdDJkMWYwZjM2MzM2VHVpOHJIUXlDUXlhc2QzRGViYnc9SEXAMPLE="),
}
result, err := svc.ListRemoteAccessSessions(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about a test run
//
// The following example returns information about a specific test run.
func ExampleDeviceFarm_ListRuns_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.ListRunsInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:run:5e01a8c7-c861-4c0a-b1d5-5ec6e6c6dd23/0fcac17b-6122-44d7-ae5a-12345EXAMPLE"),
NextToken: aws.String("RW5DdDJkMWYwZjM2MzM2VHVpOHJIUXlDUXlhc2QzRGViYnc9SEXAMPLE"),
}
result, err := svc.ListRuns(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about samples
//
// The following example returns information about samples, given a specific Device
// Farm project.
func ExampleDeviceFarm_ListSamples_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.ListSamplesInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:project:EXAMPLE-GUID-123-456"),
NextToken: aws.String("RW5DdDJkMWYwZjM2MzM2VHVpOHJIUXlDUXlhc2QzRGViYnc9SEXAMPLE"),
}
result, err := svc.ListSamples(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about suites
//
// The following example returns information about suites, given a specific Device Farm
// job.
func ExampleDeviceFarm_ListSuites_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.ListSuitesInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:job:EXAMPLE-GUID-123-456"),
NextToken: aws.String("RW5DdDJkMWYwZjM2MzM2VHVpOHJIUXlDUXlhc2QzRGViYnc9SEXAMPLE"),
}
result, err := svc.ListSuites(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about tests
//
// The following example returns information about tests, given a specific Device Farm
// project.
func ExampleDeviceFarm_ListTests_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.ListTestsInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:project:EXAMPLE-GUID-123-456"),
NextToken: aws.String("RW5DdDJkMWYwZjM2MzM2VHVpOHJIUXlDUXlhc2QzRGViYnc9SEXAMPLE"),
}
result, err := svc.ListTests(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about unique problems
//
// The following example returns information about unique problems, given a specific
// Device Farm project.
func ExampleDeviceFarm_ListUniqueProblems_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.ListUniqueProblemsInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:project:EXAMPLE-GUID-123-456"),
NextToken: aws.String("RW5DdDJkMWYwZjM2MzM2VHVpOHJIUXlDUXlhc2QzRGViYnc9SEXAMPLE"),
}
result, err := svc.ListUniqueProblems(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To get information about uploads
//
// The following example returns information about uploads, given a specific Device
// Farm project.
func ExampleDeviceFarm_ListUploads_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.ListUploadsInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:project:EXAMPLE-GUID-123-456"),
NextToken: aws.String("RW5DdDJkMWYwZjM2MzM2VHVpOHJIUXlDUXlhc2QzRGViYnc9SEXAMPLE"),
}
result, err := svc.ListUploads(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To purchase a device slot offering
//
// The following example purchases a specific device slot offering.
func ExampleDeviceFarm_PurchaseOffering_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.PurchaseOfferingInput{
OfferingId: aws.String("D68B3C05-1BA6-4360-BC69-12345EXAMPLE"),
Quantity: aws.Int64(1),
}
result, err := svc.PurchaseOffering(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeNotEligibleException:
fmt.Println(devicefarm.ErrCodeNotEligibleException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To renew a device slot offering
//
// The following example renews a specific device slot offering.
func ExampleDeviceFarm_RenewOffering_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.RenewOfferingInput{
OfferingId: aws.String("D68B3C05-1BA6-4360-BC69-12345EXAMPLE"),
Quantity: aws.Int64(1),
}
result, err := svc.RenewOffering(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeNotEligibleException:
fmt.Println(devicefarm.ErrCodeNotEligibleException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To schedule a test run
//
// The following example schedules a test run named MyRun.
func ExampleDeviceFarm_ScheduleRun_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.ScheduleRunInput{
DevicePoolArn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:pool:EXAMPLE-GUID-123-456"),
Name: aws.String("MyRun"),
ProjectArn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:project:EXAMPLE-GUID-123-456"),
Test: &devicefarm.ScheduleRunTest{
TestPackageArn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:test:EXAMPLE-GUID-123-456"),
Type: aws.String("APPIUM_JAVA_JUNIT"),
},
}
result, err := svc.ScheduleRun(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeIdempotencyException:
fmt.Println(devicefarm.ErrCodeIdempotencyException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To stop a test run
//
// The following example stops a specific test run.
func ExampleDeviceFarm_StopRun_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.StopRunInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:run:EXAMPLE-GUID-123-456"),
}
result, err := svc.StopRun(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To update a device pool
//
// The following example updates the specified device pool with a new name and description.
// It also enables remote access of devices in the device pool.
func ExampleDeviceFarm_UpdateDevicePool_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.UpdateDevicePoolInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2::devicepool:082d10e5-d7d7-48a5-ba5c-12345EXAMPLE"),
Description: aws.String("NewDescription"),
Name: aws.String("NewName"),
Rules: []*devicefarm.Rule{
{
Attribute: aws.String("REMOTE_ACCESS_ENABLED"),
Operator: aws.String("EQUALS"),
Value: aws.String("True"),
},
},
}
result, err := svc.UpdateDevicePool(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
// To update a device pool
//
// The following example updates the specified project with a new name.
func ExampleDeviceFarm_UpdateProject_shared00() {
svc := devicefarm.New(session.New())
input := &devicefarm.UpdateProjectInput{
Arn: aws.String("arn:aws:devicefarm:us-west-2:123456789101:project:8f75187d-101e-4625-accc-12345EXAMPLE"),
Name: aws.String("NewName"),
}
result, err := svc.UpdateProject(input)
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case devicefarm.ErrCodeArgumentException:
fmt.Println(devicefarm.ErrCodeArgumentException, aerr.Error())
case devicefarm.ErrCodeNotFoundException:
fmt.Println(devicefarm.ErrCodeNotFoundException, aerr.Error())
case devicefarm.ErrCodeLimitExceededException:
fmt.Println(devicefarm.ErrCodeLimitExceededException, aerr.Error())
case devicefarm.ErrCodeServiceAccountException:
fmt.Println(devicefarm.ErrCodeServiceAccountException, aerr.Error())
default:
fmt.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
}
return
}
fmt.Println(result)
}
| {
"pile_set_name": "Github"
} |
<?php
namespace Yoast\WP\SEO\Integrations\Blocks;
use Yoast\WP\SEO\Integrations\Integration_Interface;
/**
* Dynamic_Block class.
*/
abstract class Dynamic_Block implements Integration_Interface {
/**
* @var string the name of the block.
*/
protected $block_name;
/**
* @var string the editor script for the block.
*/
protected $script;
/**
* @inheritDoc
*/
public static function get_conditionals() {
return [];
}
/**
* @inheritDoc
*/
public function register_hooks() {
\add_action( 'init', [ $this, 'register_block' ] );
}
/**
* Registers the block.
*/
public function register_block() {
\register_block_type(
'yoast-seo/' . $this->block_name,
[
'editor_script' => $this->script,
'render_callback' => [ $this, 'present' ],
'attributes' => [
'className' => [
'default' => '',
'type' => 'string',
],
],
]
);
}
/**
* Presents the block output. This is abstract because in the loop we need to be able to build the data for the
* presenter in the last moment.
*
* @param array $attributes The block attributes.
*
* @return string The block output.
*/
abstract public function present( $attributes );
}
| {
"pile_set_name": "Github"
} |
<!doctype html>
<title>CodeMirror: Groovy mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">
<link rel="stylesheet" href="../../lib/codemirror.css">
<script src="../../lib/codemirror.js"></script>
<script src="../../addon/edit/matchbrackets.js"></script>
<script src="groovy.js"></script>
<style>.CodeMirror {border-top: 1px solid #500; border-bottom: 1px solid #500;}</style>
<div id=nav>
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
<ul>
<li><a href="../../index.html">Home</a>
<li><a href="../../doc/manual.html">Manual</a>
<li><a href="https://github.com/codemirror/codemirror">Code</a>
</ul>
<ul>
<li><a href="../index.html">Language modes</a>
<li><a class=active href="#">Groovy</a>
</ul>
</div>
<article>
<h2>Groovy mode</h2>
<form><textarea id="code" name="code">
//Pattern for groovy script
def p = ~/.*\.groovy/
new File( 'd:\\scripts' ).eachFileMatch(p) {f ->
// imports list
def imports = []
f.eachLine {
// condition to detect an import instruction
ln -> if ( ln =~ '^import .*' ) {
imports << "${ln - 'import '}"
}
}
// print thmen
if ( ! imports.empty ) {
println f
imports.each{ println " $it" }
}
}
/* Coin changer demo code from http://groovy.codehaus.org */
enum UsCoin {
quarter(25), dime(10), nickel(5), penny(1)
UsCoin(v) { value = v }
final value
}
enum OzzieCoin {
fifty(50), twenty(20), ten(10), five(5)
OzzieCoin(v) { value = v }
final value
}
def plural(word, count) {
if (count == 1) return word
word[-1] == 'y' ? word[0..-2] + "ies" : word + "s"
}
def change(currency, amount) {
currency.values().inject([]){ list, coin ->
int count = amount / coin.value
amount = amount % coin.value
list += "$count ${plural(coin.toString(), count)}"
}
}
</textarea></form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
lineNumbers: true,
matchBrackets: true,
mode: "text/x-groovy"
});
</script>
<p><strong>MIME types defined:</strong> <code>text/x-groovy</code></p>
</article>
| {
"pile_set_name": "Github"
} |
/* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is Mozilla Communicator client code, released March
* 31, 1998.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*
*/
/**
Filename: charCodeAt.js
Description: 'This tests new String object method: charCodeAt'
Author: Nick Lerissa
Date: Fri Feb 13 09:58:28 PST 1998
*/
var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"';
var VERSION = 'no version';
startTest();
var TITLE = 'String:charCodeAt';
writeHeaderToLog('Executing script: charCodeAt.js');
writeHeaderToLog( SECTION + " "+ TITLE);
var count = 0;
var testcases = new Array();
var aString = new String("tEs5");
testcases[count++] = new TestCase( SECTION, "aString.charCodeAt(-2)", NaN, aString.charCodeAt(-2));
testcases[count++] = new TestCase( SECTION, "aString.charCodeAt(-1)", NaN, aString.charCodeAt(-1));
testcases[count++] = new TestCase( SECTION, "aString.charCodeAt( 0)", 116, aString.charCodeAt( 0));
testcases[count++] = new TestCase( SECTION, "aString.charCodeAt( 1)", 69, aString.charCodeAt( 1));
testcases[count++] = new TestCase( SECTION, "aString.charCodeAt( 2)", 115, aString.charCodeAt( 2));
testcases[count++] = new TestCase( SECTION, "aString.charCodeAt( 3)", 53, aString.charCodeAt( 3));
testcases[count++] = new TestCase( SECTION, "aString.charCodeAt( 4)", NaN, aString.charCodeAt( 4));
testcases[count++] = new TestCase( SECTION, "aString.charCodeAt( 5)", NaN, aString.charCodeAt( 5));
testcases[count++] = new TestCase( SECTION, "aString.charCodeAt( Infinity)", NaN, aString.charCodeAt( Infinity));
testcases[count++] = new TestCase( SECTION, "aString.charCodeAt(-Infinity)", NaN, aString.charCodeAt(-Infinity));
//testcases[count++] = new TestCase( SECTION, "aString.charCodeAt( )", 116, aString.charCodeAt( ));
function test()
{
for ( tc=0; tc < testcases.length; tc++ ) {
testcases[tc].passed = writeTestCaseResult(
testcases[tc].expect,
testcases[tc].actual,
testcases[tc].description +" = "+
testcases[tc].actual );
testcases[tc].reason += ( testcases[tc].passed ) ? "" : "wrong value ";
}
stopTest();
return ( testcases );
}
test();
| {
"pile_set_name": "Github"
} |
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Language: \n"
msgid "en"
msgstr "Béarla"
msgid "en_US"
msgstr "Béarla Meiriceánach"
msgid "af"
msgstr "Afracáinis"
msgid "ak"
msgstr "Acáinis"
msgid "sq"
msgstr "Albáinis"
msgid "arq"
msgstr ""
msgid "am"
msgstr "Amáiris"
msgid "ar"
msgstr "Araibis"
msgid "hy"
msgstr "Airméinis"
msgid "rup_MK"
msgstr "Arómáinis"
msgid "frp"
msgstr ""
msgid "as"
msgstr "Asaimis"
msgid "az"
msgstr "Asarbaiseáinis"
msgid "az_TR"
msgstr ""
msgid "bcc"
msgstr ""
msgid "ba"
msgstr "Baiscíris"
msgid "eu"
msgstr "Bascais"
msgid "bel"
msgstr ""
msgid "bn_BD"
msgstr "Beangáilis"
msgid "bs_BA"
msgstr "Boisnis"
msgid "bre"
msgstr "Briotáinis"
msgid "bg_BG"
msgstr "Bulgáiris"
msgid "ca"
msgstr "Catalóinis"
msgid "bal"
msgstr ""
msgid "zh_CN"
msgstr ""
msgid "zh_HK"
msgstr ""
msgid "zh_TW"
msgstr ""
msgid "co"
msgstr "Corsaicis"
msgid "hr"
msgstr "Cróitis"
msgid "cs_CZ"
msgstr "Seicis"
msgid "da_DK"
msgstr "Danmhairgis"
msgid "dv"
msgstr "Divéihis"
msgid "nl_NL"
msgstr "Ollainnis"
msgid "nl_BE"
msgstr "Pléimeannais"
msgid "dzo"
msgstr ""
msgid "en_AU"
msgstr "Béarla Astrálach"
msgid "en_CA"
msgstr "Béarla Ceanadach"
msgid "en_NZ"
msgstr ""
msgid "en_ZA"
msgstr ""
msgid "en_GB"
msgstr "Béarla Briotanach"
msgid "eo"
msgstr "Esperanto"
msgid "et"
msgstr "Eastóinis"
msgid "fo"
msgstr "Faróis"
msgid "fi"
msgstr "Fionlainnis"
msgid "fr_BE"
msgstr ""
msgid "fr_CA"
msgstr "Fraincis Cheanadach"
msgid "fr_FR"
msgstr "Fraincis"
msgid "fy"
msgstr "Freaslainnis Iartharach"
msgid "fur"
msgstr "Friúilis"
msgid "fuc"
msgstr ""
msgid "gl_ES"
msgstr "Gailísis"
msgid "ka_GE"
msgstr "Seoirsis"
msgid "de_DE"
msgstr "Gearmáinis"
msgid "de_CH"
msgstr "Ard-Ghearmáinis Eilvéiseach"
msgid "el"
msgstr "Gréigis"
msgid "gn"
msgstr "Guaráinis"
msgid "gu"
msgstr "Gúisearáitis"
msgid "haw_US"
msgstr "Haváis"
msgid "haz"
msgstr ""
msgid "he_IL"
msgstr "Eabhrais"
msgid "hi_IN"
msgstr "Hiondúis"
msgid "hu_HU"
msgstr "Ungáiris"
msgid "is_IS"
msgstr "Íoslainnis"
msgid "ido"
msgstr ""
msgid "id_ID"
msgstr "Indinéisis"
msgid "ga"
msgstr "Gaeilge"
msgid "it_IT"
msgstr "Iodáilis"
msgid "ja"
msgstr "Seapáinis"
msgid "jv_ID"
msgstr "Iáivis"
msgid "kab"
msgstr ""
msgid "kn"
msgstr "Cannadais"
msgid "kk"
msgstr "Casaicis"
msgid "km"
msgstr "Ciméiris"
msgid "kin"
msgstr ""
msgid "ky_KY"
msgstr "Cirgisis"
msgid "ko_KR"
msgstr "Cóiréis"
msgid "ckb"
msgstr ""
msgid "lo"
msgstr "Laoisis"
msgid "lv"
msgstr "Laitvis"
msgid "li"
msgstr ""
msgid "lin"
msgstr ""
msgid "lt_LT"
msgstr "Liotuáinis"
msgid "lb_LU"
msgstr "Lucsambuirgis"
msgid "mk_MK"
msgstr "Macadóinis"
msgid "mg_MG"
msgstr "Malagáisis"
msgid "ms_MY"
msgstr "Malaeis"
msgid "ml_IN"
msgstr "Mailéalaimis"
msgid "mri"
msgstr ""
msgid "mr"
msgstr "Maraitis"
msgid "xmf"
msgstr ""
msgid "mn"
msgstr "Mongóilis"
msgid "me_ME"
msgstr ""
msgid "ary"
msgstr ""
msgid "my_MM"
msgstr ""
msgid "ne_NP"
msgstr "Neipeailis"
msgid "nb_NO"
msgstr "Ioruais Bokmål"
msgid "nn_NO"
msgstr "Nua-Ioruais"
msgid "oci"
msgstr ""
msgid "ory"
msgstr ""
msgid "os"
msgstr "Oiséitis"
msgid "ps"
msgstr "Paistis"
msgid "fa_IR"
msgstr "Peirsis"
msgid "fa_AF"
msgstr ""
msgid "pl_PL"
msgstr "Polainnis"
msgid "pt_BR"
msgstr "Portaingéilis na Brasaíle"
msgid "pt_PT"
msgstr "Portaingéilis Ibéarach"
msgid "pa_IN"
msgstr "Puinseáibis"
msgid "rhg"
msgstr ""
msgid "ro_RO"
msgstr "Rómáinis"
msgid "roh"
msgstr ""
msgid "ru_RU"
msgstr "Rúisis"
msgid "ru_UA"
msgstr ""
msgid "rue"
msgstr ""
msgid "sah"
msgstr "Sachais"
msgid "sa_IN"
msgstr ""
msgid "srd"
msgstr ""
msgid "gd"
msgstr "Gaeilge na hAlban"
msgid "sr_RS"
msgstr "Seirbis"
msgid "szl"
msgstr "Siléisis"
msgid "sd_PK"
msgstr "Sindis"
msgid "si_LK"
msgstr "Siolóinis"
msgid "sk_SK"
msgstr "Slóvaicis"
msgid "sl_SI"
msgstr "Slóivéinis"
msgid "so_SO"
msgstr "Somáilis"
msgid "azb"
msgstr ""
msgid "es_AR"
msgstr ""
msgid "es_CL"
msgstr ""
msgid "es_CO"
msgstr ""
msgid "es_MX"
msgstr "Spáinnis Mheicsiceach"
msgid "es_PE"
msgstr ""
msgid "es_PR"
msgstr ""
msgid "es_ES"
msgstr "Spáinnis Eorpach"
msgid "es_VE"
msgstr ""
msgid "su_ID"
msgstr "Sundais"
msgid "sw"
msgstr "Svahaílis"
msgid "sv_SE"
msgstr "Sualainnis"
msgid "gsw"
msgstr "Gearmáinis Eilvéiseach"
msgid "tl"
msgstr "Tagálaigis"
msgid "tg"
msgstr "Táidsícis"
msgid "tzm"
msgstr ""
msgid "ta_IN"
msgstr "Tamailis"
msgid "ta_LK"
msgstr ""
msgid "tt_RU"
msgstr "Tatairis"
msgid "te"
msgstr "Teileagúis"
msgid "th"
msgstr "Téalainnis"
msgid "bo"
msgstr "Tibéidis"
msgid "tir"
msgstr ""
msgid "tr_TR"
msgstr "Tuircis"
msgid "tuk"
msgstr ""
msgid "ug_CN"
msgstr "Uigiúiris"
msgid "uk"
msgstr "Úcráinis"
msgid "ur"
msgstr "Urdúis"
msgid "uz_UZ"
msgstr "Úisbéiceastáinis"
msgid "vi"
msgstr "Vítneaimis"
msgid "wa"
msgstr "Vallúnais"
msgid "cy"
msgstr "Breatnais"
msgid "yor"
msgstr ""
| {
"pile_set_name": "Github"
} |
<div class="optional-license-text">
<p>
<var class="replacable-license-text">Terms Of Use</var></p>
</div>
<p>
This software was developed by employees of the National Institute of
Standards and Technology (NIST), and others.
This software has been contributed to the public domain.
Pursuant to title 15 Untied States Code Section 105, works of NIST
employees are not subject to copyright protection in the United States
and are considered to be in the public domain.
As a result, a formal license is not needed to use this software.
</p>
<p>
This software is provided "AS IS."
NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
AND DATA ACCURACY. NIST does not warrant or make any representations
regarding the use of the software or the results thereof, including but
not limited to the correctness, accuracy, reliability or usefulness of
this software.
</p>
| {
"pile_set_name": "Github"
} |
// This file was automatically generated. Do not modify.
'use strict';
goog.provide('Blockly.Msg.et');
goog.require('Blockly.Msg');
Blockly.Msg["ADD_COMMENT"] = "Lisa kommentaar";
Blockly.Msg["CANNOT_DELETE_VARIABLE_PROCEDURE"] = "Can't delete the variable '%1' because it's part of the definition of the function '%2'"; // untranslated
Blockly.Msg["CHANGE_VALUE_TITLE"] = "Muuda väärtust:";
Blockly.Msg["CLEAN_UP"] = "Korista plokid kokku";
Blockly.Msg["COLLAPSE_ALL"] = "Tõmba plokid kokku";
Blockly.Msg["COLLAPSE_BLOCK"] = "Tõmba plokk kokku";
Blockly.Msg["COLOUR_BLEND_COLOUR1"] = "1. värvist";
Blockly.Msg["COLOUR_BLEND_COLOUR2"] = "2. värvist";
Blockly.Msg["COLOUR_BLEND_HELPURL"] = "http://meyerweb.com/eric/tools/color-blend/"; // untranslated
Blockly.Msg["COLOUR_BLEND_RATIO"] = "suhtega";
Blockly.Msg["COLOUR_BLEND_TITLE"] = "segu";
Blockly.Msg["COLOUR_BLEND_TOOLTIP"] = "Segab kaks värvi määratud suhtega (0.0 - 1.0) kokku.";
Blockly.Msg["COLOUR_PICKER_HELPURL"] = "https://en.wikipedia.org/wiki/Color";
Blockly.Msg["COLOUR_PICKER_TOOLTIP"] = "Valitud värv paletist.";
Blockly.Msg["COLOUR_RANDOM_HELPURL"] = "http://randomcolour.com"; // untranslated
Blockly.Msg["COLOUR_RANDOM_TITLE"] = "juhuslik värv";
Blockly.Msg["COLOUR_RANDOM_TOOLTIP"] = "Juhuslikult valitud värv.";
Blockly.Msg["COLOUR_RGB_BLUE"] = "sinisest";
Blockly.Msg["COLOUR_RGB_GREEN"] = "rohelisest";
Blockly.Msg["COLOUR_RGB_HELPURL"] = "http://www.december.com/html/spec/colorper.html"; // untranslated
Blockly.Msg["COLOUR_RGB_RED"] = "punasest";
Blockly.Msg["COLOUR_RGB_TITLE"] = "segu";
Blockly.Msg["COLOUR_RGB_TOOLTIP"] = "Tekitab värvi määratud hulgast punasest, rohelisest ja sinisest. Kõik väärtused peavad olema 0 ja 100 vahel.";
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks"; // untranslated
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK"] = "välju kordusest";
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE"] = "katkesta see kordus ja liigu järgmisele";
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK"] = "Väljub kordusest ja liigub edasi korduse järel oleva koodi käivitamisele.";
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE"] = "Katkestab korduses oleva koodi käivitamise ja käivitab järgmise korduse.";
Blockly.Msg["CONTROLS_FLOW_STATEMENTS_WARNING"] = "Hoiatus: Seda plokki saab kasutada ainult korduse sees.";
Blockly.Msg["CONTROLS_FOREACH_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#for-each"; // untranslated
Blockly.Msg["CONTROLS_FOREACH_TITLE"] = "iga elemendiga %1 loendis %2";
Blockly.Msg["CONTROLS_FOREACH_TOOLTIP"] = "Iga elemendiga loendis anna muutujale '%1' elemendi väärtus ja kõivita plokis olevad käsud.";
Blockly.Msg["CONTROLS_FOR_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#count-with"; // untranslated
Blockly.Msg["CONTROLS_FOR_TITLE"] = "loendus muutujaga %1 alates %2 kuni %3, %4 kaupa";
Blockly.Msg["CONTROLS_FOR_TOOLTIP"] = "Annab muutujale '%1' väärtused ühest numbrist teiseni, muutes seda intervalli kaupa ja käivitab igal muudatusel ploki sees oleva koodi.";
Blockly.Msg["CONTROLS_IF_ELSEIF_TOOLTIP"] = "Lisab „kui“ plokile tingimuse.";
Blockly.Msg["CONTROLS_IF_ELSE_TOOLTIP"] = "Lisab „kui“ plokile lõpliku tingimuseta koodiploki.";
Blockly.Msg["CONTROLS_IF_HELPURL"] = "https://github.com/google/blockly/wiki/IfElse"; // untranslated
Blockly.Msg["CONTROLS_IF_IF_TOOLTIP"] = "Selle „kui“ ploki muutmine sektsioonide lisamise, eemaldamise ja järjestamisega.";
Blockly.Msg["CONTROLS_IF_MSG_ELSE"] = "vastasel juhul";
Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"] = "vastasel juhul, kui";
Blockly.Msg["CONTROLS_IF_MSG_IF"] = "kui";
Blockly.Msg["CONTROLS_IF_TOOLTIP_1"] = "Kui avaldis on tõene, käivita ploki sees olevad käsud.";
Blockly.Msg["CONTROLS_IF_TOOLTIP_2"] = "Kui avaldis on tõene, käivita käsud esimesest plokist. Vastasel juhul käivita käsud teisest plokist.";
Blockly.Msg["CONTROLS_IF_TOOLTIP_3"] = "Kui esimene avaldis on tõene, käivita käsud esimesest plokist. Vastasel juhul, kui teine avaldis on tõene, käivita käsud teisest plokist.";
Blockly.Msg["CONTROLS_IF_TOOLTIP_4"] = "Kui esimene avaldis on tõene, käivita käsud esimesest plokist. Vastasel juhul, kui teine avaldis on tõene, käivita käsud teisest plokist. Kui ükski avaldistest pole tõene, käivita käsud viimasest plokist.";
Blockly.Msg["CONTROLS_REPEAT_HELPURL"] = "https://en.wikipedia.org/wiki/For_loop";
Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"] = "käivita";
Blockly.Msg["CONTROLS_REPEAT_TITLE"] = "%1 korda";
Blockly.Msg["CONTROLS_REPEAT_TOOLTIP"] = "Plokis olevate käskude käivitamine määratud arv kordi.";
Blockly.Msg["CONTROLS_WHILEUNTIL_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#repeat"; // untranslated
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_UNTIL"] = "seni kuni pole";
Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_WHILE"] = "seni kuni on";
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL"] = "Plokis olevaid käske korratakse seni kui avaldis pole tõene.";
Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_WHILE"] = "Plokis olevaid käske korratakse seni kui avaldis on tõene.";
Blockly.Msg["DELETE_ALL_BLOCKS"] = "Kas kustutada kõik %1 plokki?";
Blockly.Msg["DELETE_BLOCK"] = "Kustuta plokk";
Blockly.Msg["DELETE_VARIABLE"] = "Kustuta muutuja '%1'";
Blockly.Msg["DELETE_VARIABLE_CONFIRMATION"] = "Kas kustutada %1 kohas kasutatav muutuja '%2'?";
Blockly.Msg["DELETE_X_BLOCKS"] = "Kustuta %1 plokki";
Blockly.Msg["DISABLE_BLOCK"] = "Keela ploki kasutamine";
Blockly.Msg["DUPLICATE_BLOCK"] = "Tekita duplikaat";
Blockly.Msg["DUPLICATE_COMMENT"] = "Duplicate Comment"; // untranslated
Blockly.Msg["ENABLE_BLOCK"] = "Luba ploki kasutamine";
Blockly.Msg["EXPAND_ALL"] = "Laota plokid laiali";
Blockly.Msg["EXPAND_BLOCK"] = "Laota plokk laiali";
Blockly.Msg["EXTERNAL_INPUTS"] = "Sisendid ploki taga";
Blockly.Msg["HELP"] = "Abi";
Blockly.Msg["INLINE_INPUTS"] = "Sisendid ploki sees";
Blockly.Msg["IOS_CANCEL"] = "Cancel"; // untranslated
Blockly.Msg["IOS_ERROR"] = "Error"; // untranslated
Blockly.Msg["IOS_OK"] = "OK"; // untranslated
Blockly.Msg["IOS_PROCEDURES_ADD_INPUT"] = "+ Add Input"; // untranslated
Blockly.Msg["IOS_PROCEDURES_ALLOW_STATEMENTS"] = "Allow statements"; // untranslated
Blockly.Msg["IOS_PROCEDURES_DUPLICATE_INPUTS_ERROR"] = "This function has duplicate inputs."; // untranslated
Blockly.Msg["IOS_PROCEDURES_INPUTS"] = "INPUTS"; // untranslated
Blockly.Msg["IOS_VARIABLES_ADD_BUTTON"] = "Add"; // untranslated
Blockly.Msg["IOS_VARIABLES_ADD_VARIABLE"] = "+ Add Variable"; // untranslated
Blockly.Msg["IOS_VARIABLES_DELETE_BUTTON"] = "Kustuta";
Blockly.Msg["IOS_VARIABLES_EMPTY_NAME_ERROR"] = "Tühja muutuja nime ei saa kasutada.";
Blockly.Msg["IOS_VARIABLES_RENAME_BUTTON"] = "Rename"; // untranslated
Blockly.Msg["IOS_VARIABLES_VARIABLE_NAME"] = "Muutuja nimi";
Blockly.Msg["LISTS_CREATE_EMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-empty-list"; // untranslated
Blockly.Msg["LISTS_CREATE_EMPTY_TITLE"] = "tühi loend";
Blockly.Msg["LISTS_CREATE_EMPTY_TOOLTIP"] = "Tagastab loendi, mille pikkus on 0 ja milles pole ühtegi elementi.";
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TITLE_ADD"] = "loend";
Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TOOLTIP"] = "Loendiploki elementide lisamine, eemaldamine või järjestuse muutmine.";
Blockly.Msg["LISTS_CREATE_WITH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
Blockly.Msg["LISTS_CREATE_WITH_INPUT_WITH"] = "uus loend";
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TOOLTIP"] = "Elemendi lisamine loendisse.";
Blockly.Msg["LISTS_CREATE_WITH_TOOLTIP"] = "Tekitab mistahes arvust elementidest loendi.";
Blockly.Msg["LISTS_GET_INDEX_FIRST"] = "esimene element";
Blockly.Msg["LISTS_GET_INDEX_FROM_END"] = "element # (lõpust)";
Blockly.Msg["LISTS_GET_INDEX_FROM_START"] = "element #";
Blockly.Msg["LISTS_GET_INDEX_GET"] = "võetud";
Blockly.Msg["LISTS_GET_INDEX_GET_REMOVE"] = "võetud ja eemaldatud";
Blockly.Msg["LISTS_GET_INDEX_LAST"] = "viimane element";
Blockly.Msg["LISTS_GET_INDEX_RANDOM"] = "juhuslik element";
Blockly.Msg["LISTS_GET_INDEX_REMOVE"] = "eemalda";
Blockly.Msg["LISTS_GET_INDEX_TAIL"] = ""; // untranslated
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FIRST"] = "Tagastab loendi esimese elemendi.";
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FROM"] = "Tagastab loendis määratud asukohal oleva elemendi.";
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_LAST"] = "Tagastab loendi viimase elemendi.";
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_RANDOM"] = "Tagastab loendi juhusliku elemendi.";
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST"] = "Tagastab ja eemaldab loendist esimese elemendi.";
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM"] = "Tagastab ja eemaldab loendist määratud asukohal oleva elemendi.";
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST"] = "Tagastab ja eemaldab loendist viimase elemendi.";
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM"] = "Tagastab ja eemaldab loendist juhusliku elemendi.";
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST"] = "Eemaldab loendist esimese elemendi.";
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM"] = "Eemaldab loendist määratud asukohal oleva elemendi.";
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST"] = "Eemaldab loendist viimase elemendi.";
Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM"] = "Eemaldab loendist juhusliku elemendi.";
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_END"] = "elemendini # (lõpust)";
Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_START"] = "elemendini #";
Blockly.Msg["LISTS_GET_SUBLIST_END_LAST"] = "lõpuni";
Blockly.Msg["LISTS_GET_SUBLIST_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist"; // untranslated
Blockly.Msg["LISTS_GET_SUBLIST_START_FIRST"] = "alamloend algusest";
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_END"] = "alamloend elemendist # (lõpust)";
Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_START"] = "alamloend elemendist #";
Blockly.Msg["LISTS_GET_SUBLIST_TAIL"] = ""; // untranslated
Blockly.Msg["LISTS_GET_SUBLIST_TOOLTIP"] = "Tekitab loendi määratud osast koopia.";
Blockly.Msg["LISTS_INDEX_FROM_END_TOOLTIP"] = "Viimane element on %1.";
Blockly.Msg["LISTS_INDEX_FROM_START_TOOLTIP"] = "Esimene element on %1.";
Blockly.Msg["LISTS_INDEX_OF_FIRST"] = "esimene leitud";
Blockly.Msg["LISTS_INDEX_OF_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list"; // untranslated
Blockly.Msg["LISTS_INDEX_OF_LAST"] = "viimase leitud";
Blockly.Msg["LISTS_INDEX_OF_TOOLTIP"] = "Tagastab esimese/viimase loendist leitud objekti asukoha (objekti järjekorranumbri loendis). Kui objekti ei leita, tagastab %1.";
Blockly.Msg["LISTS_INLIST"] = "loendis";
Blockly.Msg["LISTS_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#is-empty"; // untranslated
Blockly.Msg["LISTS_ISEMPTY_TITLE"] = "%1 on tühi";
Blockly.Msg["LISTS_ISEMPTY_TOOLTIP"] = "Tagastab „tõene“ kui loend on tühi.";
Blockly.Msg["LISTS_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#length-of"; // untranslated
Blockly.Msg["LISTS_LENGTH_TITLE"] = "%1 pikkus";
Blockly.Msg["LISTS_LENGTH_TOOLTIP"] = "Tagastab loendi pikkuse.";
Blockly.Msg["LISTS_REPEAT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated
Blockly.Msg["LISTS_REPEAT_TITLE"] = "loend pikkusega %2 elemendist %1";
Blockly.Msg["LISTS_REPEAT_TOOLTIP"] = "Tekitab uue loendi, millesse lisatakse ühte elementi pikkusega määratud arv kordi.";
Blockly.Msg["LISTS_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#reversing-a-list"; // untranslated
Blockly.Msg["LISTS_REVERSE_MESSAGE0"] = "reverse %1"; // untranslated
Blockly.Msg["LISTS_REVERSE_TOOLTIP"] = "Reverse a copy of a list."; // untranslated
Blockly.Msg["LISTS_SET_INDEX_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#in-list--set"; // untranslated
Blockly.Msg["LISTS_SET_INDEX_INPUT_TO"] = ", väärtus";
Blockly.Msg["LISTS_SET_INDEX_INSERT"] = "lisa asukohale";
Blockly.Msg["LISTS_SET_INDEX_SET"] = "asenda";
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST"] = "Lisab loendi algusesse uue elemendi.";
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FROM"] = "Lisab määratud asukohale loendis uue elemendi.";
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_LAST"] = "Lisab loendi lõppu uue elemendi.";
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM"] = "Lisab juhuslikule kohale loendis uue elemendi.";
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FIRST"] = "Asendab loendis esimese elemendi.";
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FROM"] = "Asendab loendis määratud kohal oleva elemendi.";
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_LAST"] = "Asendab loendis viimase elemendi.";
Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_RANDOM"] = "Asendab loendis juhusliku elemendi.";
Blockly.Msg["LISTS_SORT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#sorting-a-list";
Blockly.Msg["LISTS_SORT_ORDER_ASCENDING"] = "kasvavalt";
Blockly.Msg["LISTS_SORT_ORDER_DESCENDING"] = "kahanevalt";
Blockly.Msg["LISTS_SORT_TITLE"] = "%1 %2 sorteeritud %3";
Blockly.Msg["LISTS_SORT_TOOLTIP"] = "Loendi koopia sorteerimine.";
Blockly.Msg["LISTS_SORT_TYPE_IGNORECASE"] = "tähestiku järgi (tähesuurust eirates)";
Blockly.Msg["LISTS_SORT_TYPE_NUMERIC"] = "arvväärtuste järgi";
Blockly.Msg["LISTS_SORT_TYPE_TEXT"] = "tähestiku järgi";
Blockly.Msg["LISTS_SPLIT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated
Blockly.Msg["LISTS_SPLIT_LIST_FROM_TEXT"] = "loend, tekitatud tekstist";
Blockly.Msg["LISTS_SPLIT_TEXT_FROM_LIST"] = "tekst, tekitatud loendist";
Blockly.Msg["LISTS_SPLIT_TOOLTIP_JOIN"] = "Ühendab tekstide loendis olevad tükid üheks tekstiks, asetades tükkide vahele eraldaja.";
Blockly.Msg["LISTS_SPLIT_TOOLTIP_SPLIT"] = "Tükeldab teksti eraldajade kohalt ja asetab tükid tekstide loendisse.";
Blockly.Msg["LISTS_SPLIT_WITH_DELIMITER"] = "eraldajaga";
Blockly.Msg["LOGIC_BOOLEAN_FALSE"] = "väär";
Blockly.Msg["LOGIC_BOOLEAN_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#values"; // untranslated
Blockly.Msg["LOGIC_BOOLEAN_TOOLTIP"] = "Tagastab tõeväärtuse – kas „tõene“ või „väär“.";
Blockly.Msg["LOGIC_BOOLEAN_TRUE"] = "tõene";
Blockly.Msg["LOGIC_COMPARE_HELPURL"] = "https://en.wikipedia.org/wiki/Inequality_(mathematics)";
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_EQ"] = "Tagastab „tõene“, kui avaldiste väärtused on võrdsed.";
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GT"] = "Tagastab „tõene“, kui esimese avaldise väärtus on suurem kui teise väärtus.";
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GTE"] = "Tagastab „tõene“, kui esimese avaldise väärtus on suurem või võrdne teise väärtusega.";
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LT"] = "Tagastab „tõene“, kui esimese avaldise väärtus on väiksem kui teise väärtus.";
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LTE"] = "Tagastab „tõene“, kui esimese avaldise väärtus on väiksem või võrdne teise väärtusega.";
Blockly.Msg["LOGIC_COMPARE_TOOLTIP_NEQ"] = "Tagastab „tõene“, kui avaldiste väärtused pole võrdsed.";
Blockly.Msg["LOGIC_NEGATE_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#not"; // untranslated
Blockly.Msg["LOGIC_NEGATE_TITLE"] = "pole %1";
Blockly.Msg["LOGIC_NEGATE_TOOLTIP"] = "Tagastab „tõene“, kui avaldis on väär. Tagastab „väär“, kui avaldis on tõene.";
Blockly.Msg["LOGIC_NULL"] = "null";
Blockly.Msg["LOGIC_NULL_HELPURL"] = "https://en.wikipedia.org/wiki/Nullable_type"; // untranslated
Blockly.Msg["LOGIC_NULL_TOOLTIP"] = "Tagastab nulli.";
Blockly.Msg["LOGIC_OPERATION_AND"] = "ja";
Blockly.Msg["LOGIC_OPERATION_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#logical-operations"; // untranslated
Blockly.Msg["LOGIC_OPERATION_OR"] = "või";
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_AND"] = "Tagastab „tõene“, kui mõlemad avaldised on tõesed.";
Blockly.Msg["LOGIC_OPERATION_TOOLTIP_OR"] = "Tagastab „tõene“, kui vähemalt üks avaldistest on tõene.";
Blockly.Msg["LOGIC_TERNARY_CONDITION"] = "tingimus";
Blockly.Msg["LOGIC_TERNARY_HELPURL"] = "https://en.wikipedia.org/wiki/%3F:"; // untranslated
Blockly.Msg["LOGIC_TERNARY_IF_FALSE"] = "kui väär";
Blockly.Msg["LOGIC_TERNARY_IF_TRUE"] = "kui tõene";
Blockly.Msg["LOGIC_TERNARY_TOOLTIP"] = "Kui tingimuse väärtus on tõene, tagastab „kui tõene“ väärtuse, vastasel juhul „kui väär“ väärtuse.";
Blockly.Msg["MATH_ADDITION_SYMBOL"] = "+"; // untranslated
Blockly.Msg["MATH_ARITHMETIC_HELPURL"] = "https://et.wikipedia.org/wiki/Aritmeetika";
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_ADD"] = "Tagastab kahe arvu summa.";
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_DIVIDE"] = "Tagastab kahe arvu jagatise.";
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MINUS"] = "Tagastab kahe arvu vahe.";
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MULTIPLY"] = "Tagastab kahe arvu korrutise.";
Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_POWER"] = "Tagastab esimese arvu teise arvu astmes.";
Blockly.Msg["MATH_ATAN2_HELPURL"] = "https://en.wikipedia.org/wiki/Atan2"; // untranslated
Blockly.Msg["MATH_ATAN2_TITLE"] = "atan2 of X:%1 Y:%2"; // untranslated
Blockly.Msg["MATH_ATAN2_TOOLTIP"] = "Return the arctangent of point (X, Y) in degrees from -180 to 180."; // untranslated
Blockly.Msg["MATH_CHANGE_HELPURL"] = "https://en.wikipedia.org/wiki/Programming_idiom#Incrementing_a_counter";
Blockly.Msg["MATH_CHANGE_TITLE"] = "muuda %1 %2 võrra";
Blockly.Msg["MATH_CHANGE_TOOLTIP"] = "Lisab arvu muutujale '%1'.";
Blockly.Msg["MATH_CONSTANT_HELPURL"] = "https://en.wikipedia.org/wiki/Mathematical_constant";
Blockly.Msg["MATH_CONSTANT_TOOLTIP"] = "Tagastab ühe konstantidest: π (3,141…), e (2,718…), φ (1.618…), √2) (1,414…), √½ (0,707…), või ∞ (infinity).";
Blockly.Msg["MATH_CONSTRAIN_HELPURL"] = "https://en.wikipedia.org/wiki/Clamping_(graphics)"; // untranslated
Blockly.Msg["MATH_CONSTRAIN_TITLE"] = "%1 piirang %2 ja %3 vahele";
Blockly.Msg["MATH_CONSTRAIN_TOOLTIP"] = "Piirab arvu väärtuse toodud piiridesse (piirarvud kaasa arvatud).";
Blockly.Msg["MATH_DIVISION_SYMBOL"] = "÷"; // untranslated
Blockly.Msg["MATH_IS_DIVISIBLE_BY"] = "jagub arvuga";
Blockly.Msg["MATH_IS_EVEN"] = "on paarisarv";
Blockly.Msg["MATH_IS_NEGATIVE"] = "on negatiivne arv";
Blockly.Msg["MATH_IS_ODD"] = "on paaritu arv";
Blockly.Msg["MATH_IS_POSITIVE"] = "on positiivne arv";
Blockly.Msg["MATH_IS_PRIME"] = "on algarv";
Blockly.Msg["MATH_IS_TOOLTIP"] = "Kontrollib kas arv on paarisarv, paaritu arv, algarv, täisarv, positiivne, negatiivne või jagub kindla arvuga. Tagastab „tõene“ või „väär“.";
Blockly.Msg["MATH_IS_WHOLE"] = "on täisarv";
Blockly.Msg["MATH_MODULO_HELPURL"] = "https://en.wikipedia.org/wiki/Modulo_operation";
Blockly.Msg["MATH_MODULO_TITLE"] = "%1 ÷ %2 jääk";
Blockly.Msg["MATH_MODULO_TOOLTIP"] = "Tagastab esimese numbri teisega jagamisel tekkiva jäägi.";
Blockly.Msg["MATH_MULTIPLICATION_SYMBOL"] = "×"; // untranslated
Blockly.Msg["MATH_NUMBER_HELPURL"] = "https://et.wikipedia.org/wiki/Arv";
Blockly.Msg["MATH_NUMBER_TOOLTIP"] = "Arv.";
Blockly.Msg["MATH_ONLIST_HELPURL"] = ""; // untranslated
Blockly.Msg["MATH_ONLIST_OPERATOR_AVERAGE"] = "loendi keskmine";
Blockly.Msg["MATH_ONLIST_OPERATOR_MAX"] = "loendi maksimum";
Blockly.Msg["MATH_ONLIST_OPERATOR_MEDIAN"] = "loendi mediaan";
Blockly.Msg["MATH_ONLIST_OPERATOR_MIN"] = "loendi miinimum";
Blockly.Msg["MATH_ONLIST_OPERATOR_MODE"] = "loendi moodid";
Blockly.Msg["MATH_ONLIST_OPERATOR_RANDOM"] = "juhuslik element loendist";
Blockly.Msg["MATH_ONLIST_OPERATOR_STD_DEV"] = "loendi standardhälve";
Blockly.Msg["MATH_ONLIST_OPERATOR_SUM"] = "loendi summa";
Blockly.Msg["MATH_ONLIST_TOOLTIP_AVERAGE"] = "Tagastab loendis olevate arvväärtuste aritmeetilise keskmise.";
Blockly.Msg["MATH_ONLIST_TOOLTIP_MAX"] = "Tagastab suurima loendis oleva arvu.";
Blockly.Msg["MATH_ONLIST_TOOLTIP_MEDIAN"] = "Return the median number in the list.";
Blockly.Msg["MATH_ONLIST_TOOLTIP_MIN"] = "Tagastab väikseima loendis oleva arvu.";
Blockly.Msg["MATH_ONLIST_TOOLTIP_MODE"] = "Tagastab loendi kõige sagedamini esinevate loendi liikmetega.";
Blockly.Msg["MATH_ONLIST_TOOLTIP_RANDOM"] = "Tagastab juhusliku elemendi loendist.";
Blockly.Msg["MATH_ONLIST_TOOLTIP_STD_DEV"] = "Tagastab loendi standardhälbe.";
Blockly.Msg["MATH_ONLIST_TOOLTIP_SUM"] = "Tagastab kõigi loendis olevate arvude summa.";
Blockly.Msg["MATH_POWER_SYMBOL"] = "^"; // untranslated
Blockly.Msg["MATH_RANDOM_FLOAT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation";
Blockly.Msg["MATH_RANDOM_FLOAT_TITLE_RANDOM"] = "juhuslik murdosa";
Blockly.Msg["MATH_RANDOM_FLOAT_TOOLTIP"] = "Tagastab juhusliku murdosa 0.0 (kaasa arvatud) and 1.0 (välja arvatud) vahel.";
Blockly.Msg["MATH_RANDOM_INT_HELPURL"] = "https://en.wikipedia.org/wiki/Random_number_generation";
Blockly.Msg["MATH_RANDOM_INT_TITLE"] = "juhuslik täisarv %1 ja %2 vahel";
Blockly.Msg["MATH_RANDOM_INT_TOOLTIP"] = "Tagastab juhusliku täisarvu toodud piiride vahel (piirarvud kaasa arvatud).";
Blockly.Msg["MATH_ROUND_HELPURL"] = "https://en.wikipedia.org/wiki/Rounding";
Blockly.Msg["MATH_ROUND_OPERATOR_ROUND"] = "ümarda";
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDDOWN"] = "ümarda alla";
Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDUP"] = "ümarda üles";
Blockly.Msg["MATH_ROUND_TOOLTIP"] = "Ümardab arvu üles või alla.";
Blockly.Msg["MATH_SINGLE_HELPURL"] = "https://et.wikipedia.org/wiki/Ruutjuur";
Blockly.Msg["MATH_SINGLE_OP_ABSOLUTE"] = "absoluutväärtus";
Blockly.Msg["MATH_SINGLE_OP_ROOT"] = "ruutjuur";
Blockly.Msg["MATH_SINGLE_TOOLTIP_ABS"] = "Tagastab arvu absoluutväärtuse.";
Blockly.Msg["MATH_SINGLE_TOOLTIP_EXP"] = "Tagasta e arvu astmes.";
Blockly.Msg["MATH_SINGLE_TOOLTIP_LN"] = "Tagastab arvu naturaallogaritmi.";
Blockly.Msg["MATH_SINGLE_TOOLTIP_LOG10"] = "Tagastab arvu kümnendlogaritm.";
Blockly.Msg["MATH_SINGLE_TOOLTIP_NEG"] = "Tagastab arvu vastandväärtuse.";
Blockly.Msg["MATH_SINGLE_TOOLTIP_POW10"] = "Tagastab 10 arvu astmes.";
Blockly.Msg["MATH_SINGLE_TOOLTIP_ROOT"] = "Tagastab arvu ruutjuure.";
Blockly.Msg["MATH_SUBTRACTION_SYMBOL"] = "-"; // untranslated
Blockly.Msg["MATH_TRIG_ACOS"] = "acos"; // untranslated
Blockly.Msg["MATH_TRIG_ASIN"] = "asin"; // untranslated
Blockly.Msg["MATH_TRIG_ATAN"] = "atan"; // untranslated
Blockly.Msg["MATH_TRIG_COS"] = "cos"; // untranslated
Blockly.Msg["MATH_TRIG_HELPURL"] = "https://et.wikipedia.org/wiki/Trigonomeetrilised_funktsioonid";
Blockly.Msg["MATH_TRIG_SIN"] = "sin"; // untranslated
Blockly.Msg["MATH_TRIG_TAN"] = "tan"; // untranslated
Blockly.Msg["MATH_TRIG_TOOLTIP_ACOS"] = "Tagastab arvu arkuskoosiinuse.";
Blockly.Msg["MATH_TRIG_TOOLTIP_ASIN"] = "Tagastab arvu arkussiinuse.";
Blockly.Msg["MATH_TRIG_TOOLTIP_ATAN"] = "Tagastab arvu arkustangensi.";
Blockly.Msg["MATH_TRIG_TOOLTIP_COS"] = "Tagastab arvu (kraadid) kosiinuse.";
Blockly.Msg["MATH_TRIG_TOOLTIP_SIN"] = "Tagastab arvu (kraadid) siinuse.";
Blockly.Msg["MATH_TRIG_TOOLTIP_TAN"] = "Tagastab arvu (kraadid) tangensi.";
Blockly.Msg["NEW_COLOUR_VARIABLE"] = "Create colour variable..."; // untranslated
Blockly.Msg["NEW_NUMBER_VARIABLE"] = "Create number variable..."; // untranslated
Blockly.Msg["NEW_STRING_VARIABLE"] = "Create string variable..."; // untranslated
Blockly.Msg["NEW_VARIABLE"] = "Uus muutuja ...";
Blockly.Msg["NEW_VARIABLE_TITLE"] = "Uue muutuja nimi:";
Blockly.Msg["NEW_VARIABLE_TYPE_TITLE"] = "New variable type:"; // untranslated
Blockly.Msg["ORDINAL_NUMBER_SUFFIX"] = ""; // untranslated
Blockly.Msg["PROCEDURES_ALLOW_STATEMENTS"] = "kood plokis";
Blockly.Msg["PROCEDURES_BEFORE_PARAMS"] = "sisenditega:";
Blockly.Msg["PROCEDURES_CALLNORETURN_HELPURL"] = "https://et.wikipedia.org/wiki/Alamprogramm";
Blockly.Msg["PROCEDURES_CALLNORETURN_TOOLTIP"] = "Käivitab kasutaja defineeritud funktsiooni '%1'.";
Blockly.Msg["PROCEDURES_CALLRETURN_HELPURL"] = "https://et.wikipedia.org/wiki/Alamprogramm";
Blockly.Msg["PROCEDURES_CALLRETURN_TOOLTIP"] = "Run the user-defined function '%1' and use its output.";
Blockly.Msg["PROCEDURES_CALL_BEFORE_PARAMS"] = "sisenditega:";
Blockly.Msg["PROCEDURES_CREATE_DO"] = "Tekita '%1' plokk";
Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"] = "Funktsiooni kirjeldus ...";
Blockly.Msg["PROCEDURES_DEFNORETURN_DO"] = ""; // untranslated
Blockly.Msg["PROCEDURES_DEFNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"] = "teeme midagi";
Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"] = "funktsioon";
Blockly.Msg["PROCEDURES_DEFNORETURN_TOOLTIP"] = "Tekitab funktsiooni, mis ei tagasta midagi.";
Blockly.Msg["PROCEDURES_DEFRETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated
Blockly.Msg["PROCEDURES_DEFRETURN_RETURN"] = "tagasta";
Blockly.Msg["PROCEDURES_DEFRETURN_TOOLTIP"] = "Tekitab funktsiooni, mis tagastab midagi.";
Blockly.Msg["PROCEDURES_DEF_DUPLICATE_WARNING"] = "Hoiatus: Sel funktsioonil on mitu sama nimega sisendit.";
Blockly.Msg["PROCEDURES_HIGHLIGHT_DEF"] = "Tõsta funktsiooni definitsioon esile";
Blockly.Msg["PROCEDURES_IFRETURN_HELPURL"] = "http://c2.com/cgi/wiki?GuardClause"; // untranslated
Blockly.Msg["PROCEDURES_IFRETURN_TOOLTIP"] = "Kui väärtus on tõene, tagastatakse teine väärtus.";
Blockly.Msg["PROCEDURES_IFRETURN_WARNING"] = "Hoiatus: Seda plokki saab kasutada ainult funktsiooni definitsioonis.";
Blockly.Msg["PROCEDURES_MUTATORARG_TITLE"] = "sisend nimega:";
Blockly.Msg["PROCEDURES_MUTATORARG_TOOLTIP"] = "Lisab funktsioonile sisendi.";
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TITLE"] = "sisendid";
Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TOOLTIP"] = "Funktsiooni sisendite lisamine, eemaldamine või järjestuse muutmine.";
Blockly.Msg["REDO"] = "Tee uuesti";
Blockly.Msg["REMOVE_COMMENT"] = "Eemalda kommentaar";
Blockly.Msg["RENAME_VARIABLE"] = "Nimeta muutuja ümber ...";
Blockly.Msg["RENAME_VARIABLE_TITLE"] = "Muutuja „%1“ uus nimi:";
Blockly.Msg["TEXT_APPEND_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
Blockly.Msg["TEXT_APPEND_TITLE"] = "lisa muutuja %1 lõppu tekst %2";
Blockly.Msg["TEXT_APPEND_TOOLTIP"] = "Lisab teksti muutuja „%1“ väärtuse lõppu.";
Blockly.Msg["TEXT_CHANGECASE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_LOWERCASE"] = "väikeste tähtedega";
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_TITLECASE"] = "Suurte Esitähtedega";
Blockly.Msg["TEXT_CHANGECASE_OPERATOR_UPPERCASE"] = "SUURTE TÄHTEDEGA";
Blockly.Msg["TEXT_CHANGECASE_TOOLTIP"] = "Tagastab muudetud tähesuurusega teksti koopia.";
Blockly.Msg["TEXT_CHARAT_FIRST"] = "esimene sümbol";
Blockly.Msg["TEXT_CHARAT_FROM_END"] = "lõpust sümbol #";
Blockly.Msg["TEXT_CHARAT_FROM_START"] = "sümbol #";
Blockly.Msg["TEXT_CHARAT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-text"; // untranslated
Blockly.Msg["TEXT_CHARAT_LAST"] = "viimane sümbol";
Blockly.Msg["TEXT_CHARAT_RANDOM"] = "juhuslik sümbol";
Blockly.Msg["TEXT_CHARAT_TAIL"] = ""; // untranslated
Blockly.Msg["TEXT_CHARAT_TITLE"] = "in text %1 %2"; // untranslated
Blockly.Msg["TEXT_CHARAT_TOOLTIP"] = "Tagastab tekstis määratud asukohal oleva sümboli.";
Blockly.Msg["TEXT_COUNT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#counting-substrings"; // untranslated
Blockly.Msg["TEXT_COUNT_MESSAGE0"] = "count %1 in %2"; // untranslated
Blockly.Msg["TEXT_COUNT_TOOLTIP"] = "Loenda, mitu korda mingi tekst esineb teise teksti sees.";
Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TOOLTIP"] = "Objekti lisamine tekstile.";
Blockly.Msg["TEXT_CREATE_JOIN_TITLE_JOIN"] = "ühenda";
Blockly.Msg["TEXT_CREATE_JOIN_TOOLTIP"] = "Tekstiploki muutmine sektsioonide lisamise, eemaldamise või järjestuse muutmisega.";
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_END"] = "kuni (lõpust) sümbolini #";
Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_START"] = "kuni sümbolini #";
Blockly.Msg["TEXT_GET_SUBSTRING_END_LAST"] = "kuni viimase sümbolini";
Blockly.Msg["TEXT_GET_SUBSTRING_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text"; // untranslated
Blockly.Msg["TEXT_GET_SUBSTRING_INPUT_IN_TEXT"] = "tekstist";
Blockly.Msg["TEXT_GET_SUBSTRING_START_FIRST"] = "alates esimesest sümbolist";
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_END"] = "alates (lõpust) sümbolist #";
Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_START"] = "alates sümbolist #";
Blockly.Msg["TEXT_GET_SUBSTRING_TAIL"] = ""; // untranslated
Blockly.Msg["TEXT_GET_SUBSTRING_TOOLTIP"] = "Tagastab määratud tüki tekstist.";
Blockly.Msg["TEXT_INDEXOF_HELPURL"] = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated
Blockly.Msg["TEXT_INDEXOF_OPERATOR_FIRST"] = "esimese leitud tekstitüki";
Blockly.Msg["TEXT_INDEXOF_OPERATOR_LAST"] = "viimase leitud tekstitüki";
Blockly.Msg["TEXT_INDEXOF_TITLE"] = "tekstist %1 %2 %3 asukoht";
Blockly.Msg["TEXT_INDEXOF_TOOLTIP"] = "Tagastab esimesest tekstist esimese/viimase leitud teise teksti asukoha (indeksi). Kui teksti ei leita, tagastab %1.";
Blockly.Msg["TEXT_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
Blockly.Msg["TEXT_ISEMPTY_TITLE"] = "%1 on tühi";
Blockly.Msg["TEXT_ISEMPTY_TOOLTIP"] = "Tagastab „tõene“, kui tekstis pole ühtegi sümbolit.";
Blockly.Msg["TEXT_JOIN_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-creation"; // untranslated
Blockly.Msg["TEXT_JOIN_TITLE_CREATEWITH"] = "tekita tekst";
Blockly.Msg["TEXT_JOIN_TOOLTIP"] = "Tekitab teksti ühendades mistahes arvu elemente.";
Blockly.Msg["TEXT_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
Blockly.Msg["TEXT_LENGTH_TITLE"] = "%1 pikkus";
Blockly.Msg["TEXT_LENGTH_TOOLTIP"] = "Tagastab sümbolite aru (ka tühikud) toodud tekstis.";
Blockly.Msg["TEXT_PRINT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#printing-text"; // untranslated
Blockly.Msg["TEXT_PRINT_TITLE"] = "trüki %1";
Blockly.Msg["TEXT_PRINT_TOOLTIP"] = "Trükib määratud teksti, numbri või mõne muu objekti väärtuse.";
Blockly.Msg["TEXT_PROMPT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user"; // untranslated
Blockly.Msg["TEXT_PROMPT_TOOLTIP_NUMBER"] = "Küsib kasutajalt teadet näidates mingit arvu.";
Blockly.Msg["TEXT_PROMPT_TOOLTIP_TEXT"] = "Küsib kasutajalt teadet näidates mingit teksti.";
Blockly.Msg["TEXT_PROMPT_TYPE_NUMBER"] = "kasutajalt küsitud arv teatega";
Blockly.Msg["TEXT_PROMPT_TYPE_TEXT"] = "kasutajalt küsitud tekst teatega";
Blockly.Msg["TEXT_REPLACE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#replacing-substrings"; // untranslated
Blockly.Msg["TEXT_REPLACE_MESSAGE0"] = "replace %1 with %2 in %3"; // untranslated
Blockly.Msg["TEXT_REPLACE_TOOLTIP"] = "Replace all occurances of some text within some other text."; // untranslated
Blockly.Msg["TEXT_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#reversing-text"; // untranslated
Blockly.Msg["TEXT_REVERSE_MESSAGE0"] = "reverse %1"; // untranslated
Blockly.Msg["TEXT_REVERSE_TOOLTIP"] = "Reverses the order of the characters in the text."; // untranslated
Blockly.Msg["TEXT_TEXT_HELPURL"] = "https://en.wikipedia.org/wiki/String_(computer_science)";
Blockly.Msg["TEXT_TEXT_TOOLTIP"] = "Täht, sõna või rida teksti.";
Blockly.Msg["TEXT_TRIM_HELPURL"] = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces"; // untranslated
Blockly.Msg["TEXT_TRIM_OPERATOR_BOTH"] = "mõlemalt poolt eemaldatud tühikutega";
Blockly.Msg["TEXT_TRIM_OPERATOR_LEFT"] = "algusest eemaldatud tühikutega";
Blockly.Msg["TEXT_TRIM_OPERATOR_RIGHT"] = "lõpust eemaldatud tühikutega";
Blockly.Msg["TEXT_TRIM_TOOLTIP"] = "Tagastab koopia tekstist, millel on tühikud ühelt või mõlemalt poolt eemaldatud.";
Blockly.Msg["TODAY"] = "Täna";
Blockly.Msg["UNDO"] = "Võta tagasi";
Blockly.Msg["VARIABLES_DEFAULT_NAME"] = "objekt";
Blockly.Msg["VARIABLES_GET_CREATE_SET"] = "Tekita 'määra „%1“ väärtuseks' plokk";
Blockly.Msg["VARIABLES_GET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#get"; // untranslated
Blockly.Msg["VARIABLES_GET_TOOLTIP"] = "Tagastab selle muutuja väärtuse.";
Blockly.Msg["VARIABLES_SET"] = "määra %1 väärtuseks %2";
Blockly.Msg["VARIABLES_SET_CREATE_GET"] = "Tekita '„%1“ väärtus' plokk";
Blockly.Msg["VARIABLES_SET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#set"; // untranslated
Blockly.Msg["VARIABLES_SET_TOOLTIP"] = "Määrab selle muutuja väärtuse võrdseks sisendi väärtusega.";
Blockly.Msg["VARIABLE_ALREADY_EXISTS"] = "'%1'-nimeline muutuja on juba olemas.";
Blockly.Msg["VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE"] = "A variable named '%1' already exists for another type: '%2'."; // untranslated
Blockly.Msg["WORKSPACE_COMMENT_DEFAULT_TEXT"] = "Say something..."; // untranslated
Blockly.Msg["PROCEDURES_DEFRETURN_TITLE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"];
Blockly.Msg["CONTROLS_IF_IF_TITLE_IF"] = Blockly.Msg["CONTROLS_IF_MSG_IF"];
Blockly.Msg["CONTROLS_WHILEUNTIL_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
Blockly.Msg["CONTROLS_IF_MSG_THEN"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
Blockly.Msg["CONTROLS_IF_ELSE_TITLE_ELSE"] = Blockly.Msg["CONTROLS_IF_MSG_ELSE"];
Blockly.Msg["PROCEDURES_DEFRETURN_PROCEDURE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"];
Blockly.Msg["LISTS_GET_SUBLIST_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
Blockly.Msg["LISTS_GET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
Blockly.Msg["MATH_CHANGE_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
Blockly.Msg["PROCEDURES_DEFRETURN_DO"] = Blockly.Msg["PROCEDURES_DEFNORETURN_DO"];
Blockly.Msg["CONTROLS_IF_ELSEIF_TITLE_ELSEIF"] = Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"];
Blockly.Msg["LISTS_GET_INDEX_HELPURL"] = Blockly.Msg["LISTS_INDEX_OF_HELPURL"];
Blockly.Msg["CONTROLS_FOREACH_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
Blockly.Msg["LISTS_SET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
Blockly.Msg["CONTROLS_FOR_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"];
Blockly.Msg["LISTS_CREATE_WITH_ITEM_TITLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
Blockly.Msg["TEXT_APPEND_VARIABLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"];
Blockly.Msg["LISTS_INDEX_OF_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"];
Blockly.Msg["PROCEDURES_DEFRETURN_COMMENT"] = Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"];
Blockly.Msg["MATH_HUE"] = "230";
Blockly.Msg["LOOPS_HUE"] = "120";
Blockly.Msg["LISTS_HUE"] = "260";
Blockly.Msg["LOGIC_HUE"] = "210";
Blockly.Msg["VARIABLES_HUE"] = "330";
Blockly.Msg["TEXTS_HUE"] = "160";
Blockly.Msg["PROCEDURES_HUE"] = "290";
Blockly.Msg["COLOUR_HUE"] = "20";
Blockly.Msg["VARIABLES_DYNAMIC_HUE"] = "310"; | {
"pile_set_name": "Github"
} |
Please see Documentation/admin-guide/LSM/SELinux.rst for information on
installing a dummy SELinux policy.
| {
"pile_set_name": "Github"
} |
// Released under MIT license
// Copyright (c) 2009-2010 Dominic Baggott
// Copyright (c) 2009-2010 Ash Berlin
// Copyright (c) 2011 Christoph Dorn <[email protected]> (http://www.christophdorn.com)
(function( expose ) {
/**
* class Markdown
*
* Markdown processing in Javascript done right. We have very particular views
* on what constitutes 'right' which include:
*
* - produces well-formed HTML (this means that em and strong nesting is
* important)
*
* - has an intermediate representation to allow processing of parsed data (We
* in fact have two, both as [JsonML]: a markdown tree and an HTML tree).
*
* - is easily extensible to add new dialects without having to rewrite the
* entire parsing mechanics
*
* - has a good test suite
*
* This implementation fulfills all of these (except that the test suite could
* do with expanding to automatically run all the fixtures from other Markdown
* implementations.)
*
* ##### Intermediate Representation
*
* *TODO* Talk about this :) Its JsonML, but document the node names we use.
*
* [JsonML]: http://jsonml.org/ "JSON Markup Language"
**/
var Markdown = expose.Markdown = function Markdown(dialect) {
switch (typeof dialect) {
case "undefined":
this.dialect = Markdown.dialects.Gruber;
break;
case "object":
this.dialect = dialect;
break;
default:
if (dialect in Markdown.dialects) {
this.dialect = Markdown.dialects[dialect];
}
else {
throw new Error("Unknown Markdown dialect '" + String(dialect) + "'");
}
break;
}
this.em_state = [];
this.strong_state = [];
this.debug_indent = "";
};
/**
* parse( markdown, [dialect] ) -> JsonML
* - markdown (String): markdown string to parse
* - dialect (String | Dialect): the dialect to use, defaults to gruber
*
* Parse `markdown` and return a markdown document as a Markdown.JsonML tree.
**/
expose.parse = function( source, dialect ) {
// dialect will default if undefined
var md = new Markdown( dialect );
return md.toTree( source );
};
/**
* toHTML( markdown, [dialect] ) -> String
* toHTML( md_tree ) -> String
* - markdown (String): markdown string to parse
* - md_tree (Markdown.JsonML): parsed markdown tree
*
* Take markdown (either as a string or as a JsonML tree) and run it through
* [[toHTMLTree]] then turn it into a well-formated HTML fragment.
**/
expose.toHTML = function toHTML( source , dialect , options ) {
var input = expose.toHTMLTree( source , dialect , options );
return expose.renderJsonML( input );
};
/**
* toHTMLTree( markdown, [dialect] ) -> JsonML
* toHTMLTree( md_tree ) -> JsonML
* - markdown (String): markdown string to parse
* - dialect (String | Dialect): the dialect to use, defaults to gruber
* - md_tree (Markdown.JsonML): parsed markdown tree
*
* Turn markdown into HTML, represented as a JsonML tree. If a string is given
* to this function, it is first parsed into a markdown tree by calling
* [[parse]].
**/
expose.toHTMLTree = function toHTMLTree( input, dialect , options ) {
// convert string input to an MD tree
if ( typeof input ==="string" ) input = this.parse( input, dialect );
// Now convert the MD tree to an HTML tree
// remove references from the tree
var attrs = extract_attr( input ),
refs = {};
if ( attrs && attrs.references ) {
refs = attrs.references;
}
var html = convert_tree_to_html( input, refs , options );
merge_text_nodes( html );
return html;
};
// For Spidermonkey based engines
function mk_block_toSource() {
return "Markdown.mk_block( " +
uneval(this.toString()) +
", " +
uneval(this.trailing) +
", " +
uneval(this.lineNumber) +
" )";
}
// node
function mk_block_inspect() {
var util = require('util');
return "Markdown.mk_block( " +
util.inspect(this.toString()) +
", " +
util.inspect(this.trailing) +
", " +
util.inspect(this.lineNumber) +
" )";
}
var mk_block = Markdown.mk_block = function(block, trail, line) {
// Be helpful for default case in tests.
if ( arguments.length == 1 ) trail = "\n\n";
var s = new String(block);
s.trailing = trail;
// To make it clear its not just a string
s.inspect = mk_block_inspect;
s.toSource = mk_block_toSource;
if (line != undefined)
s.lineNumber = line;
return s;
};
function count_lines( str ) {
var n = 0, i = -1;
while ( ( i = str.indexOf('\n', i+1) ) !== -1) n++;
return n;
}
// Internal - split source into rough blocks
Markdown.prototype.split_blocks = function splitBlocks( input, startLine ) {
// [\s\S] matches _anything_ (newline or space)
var re = /([\s\S]+?)($|\n(?:\s*\n|$)+)/g,
blocks = [],
m;
var line_no = 1;
if ( ( m = /^(\s*\n)/.exec(input) ) != null ) {
// skip (but count) leading blank lines
line_no += count_lines( m[0] );
re.lastIndex = m[0].length;
}
while ( ( m = re.exec(input) ) !== null ) {
blocks.push( mk_block( m[1], m[2], line_no ) );
line_no += count_lines( m[0] );
}
return blocks;
};
/**
* Markdown#processBlock( block, next ) -> undefined | [ JsonML, ... ]
* - block (String): the block to process
* - next (Array): the following blocks
*
* Process `block` and return an array of JsonML nodes representing `block`.
*
* It does this by asking each block level function in the dialect to process
* the block until one can. Succesful handling is indicated by returning an
* array (with zero or more JsonML nodes), failure by a false value.
*
* Blocks handlers are responsible for calling [[Markdown#processInline]]
* themselves as appropriate.
*
* If the blocks were split incorrectly or adjacent blocks need collapsing you
* can adjust `next` in place using shift/splice etc.
*
* If any of this default behaviour is not right for the dialect, you can
* define a `__call__` method on the dialect that will get invoked to handle
* the block processing.
*/
Markdown.prototype.processBlock = function processBlock( block, next ) {
var cbs = this.dialect.block,
ord = cbs.__order__;
if ( "__call__" in cbs ) {
return cbs.__call__.call(this, block, next);
}
for ( var i = 0; i < ord.length; i++ ) {
//D:this.debug( "Testing", ord[i] );
var res = cbs[ ord[i] ].call( this, block, next );
if ( res ) {
//D:this.debug(" matched");
if ( !isArray(res) || ( res.length > 0 && !( isArray(res[0]) ) ) )
this.debug(ord[i], "didn't return a proper array");
//D:this.debug( "" );
return res;
}
}
// Uhoh! no match! Should we throw an error?
return [];
};
Markdown.prototype.processInline = function processInline( block ) {
return this.dialect.inline.__call__.call( this, String( block ) );
};
/**
* Markdown#toTree( source ) -> JsonML
* - source (String): markdown source to parse
*
* Parse `source` into a JsonML tree representing the markdown document.
**/
// custom_tree means set this.tree to `custom_tree` and restore old value on return
Markdown.prototype.toTree = function toTree( source, custom_root ) {
var blocks = source instanceof Array ? source : this.split_blocks( source );
// Make tree a member variable so its easier to mess with in extensions
var old_tree = this.tree;
try {
this.tree = custom_root || this.tree || [ "markdown" ];
blocks:
while ( blocks.length ) {
var b = this.processBlock( blocks.shift(), blocks );
// Reference blocks and the like won't return any content
if ( !b.length ) continue blocks;
this.tree.push.apply( this.tree, b );
}
return this.tree;
}
finally {
if ( custom_root ) {
this.tree = old_tree;
}
}
};
// Noop by default
Markdown.prototype.debug = function () {
var args = Array.prototype.slice.call( arguments);
args.unshift(this.debug_indent);
if (typeof print !== "undefined")
print.apply( print, args );
if (typeof console !== "undefined" && typeof console.log !== "undefined")
console.log.apply( null, args );
}
Markdown.prototype.loop_re_over_block = function( re, block, cb ) {
// Dont use /g regexps with this
var m,
b = block.valueOf();
while ( b.length && (m = re.exec(b) ) != null) {
b = b.substr( m[0].length );
cb.call(this, m);
}
return b;
};
/**
* Markdown.dialects
*
* Namespace of built-in dialects.
**/
Markdown.dialects = {};
/**
* Markdown.dialects.Gruber
*
* The default dialect that follows the rules set out by John Gruber's
* markdown.pl as closely as possible. Well actually we follow the behaviour of
* that script which in some places is not exactly what the syntax web page
* says.
**/
Markdown.dialects.Gruber = {
block: {
atxHeader: function atxHeader( block, next ) {
var m = block.match( /^(#{1,6})\s*(.*?)\s*#*\s*(?:\n|$)/ );
if ( !m ) return undefined;
var header = [ "header", { level: m[ 1 ].length } ];
Array.prototype.push.apply(header, this.processInline(m[ 2 ]));
if ( m[0].length < block.length )
next.unshift( mk_block( block.substr( m[0].length ), block.trailing, block.lineNumber + 2 ) );
return [ header ];
},
setextHeader: function setextHeader( block, next ) {
var m = block.match( /^(.*)\n([-=])\2\2+(?:\n|$)/ );
if ( !m ) return undefined;
var level = ( m[ 2 ] === "=" ) ? 1 : 2;
var header = [ "header", { level : level }, m[ 1 ] ];
if ( m[0].length < block.length )
next.unshift( mk_block( block.substr( m[0].length ), block.trailing, block.lineNumber + 2 ) );
return [ header ];
},
code: function code( block, next ) {
// | Foo
// |bar
// should be a code block followed by a paragraph. Fun
//
// There might also be adjacent code block to merge.
var ret = [],
re = /^(?: {0,3}\t| {4})(.*)\n?/,
lines;
// 4 spaces + content
if ( !block.match( re ) ) return undefined;
block_search:
do {
// Now pull out the rest of the lines
var b = this.loop_re_over_block(
re, block.valueOf(), function( m ) { ret.push( m[1] ); } );
if (b.length) {
// Case alluded to in first comment. push it back on as a new block
next.unshift( mk_block(b, block.trailing) );
break block_search;
}
else if (next.length) {
// Check the next block - it might be code too
if ( !next[0].match( re ) ) break block_search;
// Pull how how many blanks lines follow - minus two to account for .join
ret.push ( block.trailing.replace(/[^\n]/g, '').substring(2) );
block = next.shift();
}
else {
break block_search;
}
} while (true);
return [ [ "code_block", ret.join("\n") ] ];
},
horizRule: function horizRule( block, next ) {
// this needs to find any hr in the block to handle abutting blocks
var m = block.match( /^(?:([\s\S]*?)\n)?[ \t]*([-_*])(?:[ \t]*\2){2,}[ \t]*(?:\n([\s\S]*))?$/ );
if ( !m ) {
return undefined;
}
var jsonml = [ [ "hr" ] ];
// if there's a leading abutting block, process it
if ( m[ 1 ] ) {
jsonml.unshift.apply( jsonml, this.processBlock( m[ 1 ], [] ) );
}
// if there's a trailing abutting block, stick it into next
if ( m[ 3 ] ) {
next.unshift( mk_block( m[ 3 ] ) );
}
return jsonml;
},
// There are two types of lists. Tight and loose. Tight lists have no whitespace
// between the items (and result in text just in the <li>) and loose lists,
// which have an empty line between list items, resulting in (one or more)
// paragraphs inside the <li>.
//
// There are all sorts weird edge cases about the original markdown.pl's
// handling of lists:
//
// * Nested lists are supposed to be indented by four chars per level. But
// if they aren't, you can get a nested list by indenting by less than
// four so long as the indent doesn't match an indent of an existing list
// item in the 'nest stack'.
//
// * The type of the list (bullet or number) is controlled just by the
// first item at the indent. Subsequent changes are ignored unless they
// are for nested lists
//
lists: (function( ) {
// Use a closure to hide a few variables.
var any_list = "[*+-]|\\d+\\.",
bullet_list = /[*+-]/,
number_list = /\d+\./,
// Capture leading indent as it matters for determining nested lists.
is_list_re = new RegExp( "^( {0,3})(" + any_list + ")[ \t]+" ),
indent_re = "(?: {0,3}\\t| {4})";
// TODO: Cache this regexp for certain depths.
// Create a regexp suitable for matching an li for a given stack depth
function regex_for_depth( depth ) {
return new RegExp(
// m[1] = indent, m[2] = list_type
"(?:^(" + indent_re + "{0," + depth + "} {0,3})(" + any_list + ")\\s+)|" +
// m[3] = cont
"(^" + indent_re + "{0," + (depth-1) + "}[ ]{0,4})"
);
}
function expand_tab( input ) {
return input.replace( / {0,3}\t/g, " " );
}
// Add inline content `inline` to `li`. inline comes from processInline
// so is an array of content
function add(li, loose, inline, nl) {
if (loose) {
li.push( [ "para" ].concat(inline) );
return;
}
// Hmmm, should this be any block level element or just paras?
var add_to = li[li.length -1] instanceof Array && li[li.length - 1][0] == "para"
? li[li.length -1]
: li;
// If there is already some content in this list, add the new line in
if (nl && li.length > 1) inline.unshift(nl);
for (var i=0; i < inline.length; i++) {
var what = inline[i],
is_str = typeof what == "string";
if (is_str && add_to.length > 1 && typeof add_to[add_to.length-1] == "string" ) {
add_to[ add_to.length-1 ] += what;
}
else {
add_to.push( what );
}
}
}
// contained means have an indent greater than the current one. On
// *every* line in the block
function get_contained_blocks( depth, blocks ) {
var re = new RegExp( "^(" + indent_re + "{" + depth + "}.*?\\n?)*$" ),
replace = new RegExp("^" + indent_re + "{" + depth + "}", "gm"),
ret = [];
while ( blocks.length > 0 ) {
if ( re.exec( blocks[0] ) ) {
var b = blocks.shift(),
// Now remove that indent
x = b.replace( replace, "");
ret.push( mk_block( x, b.trailing, b.lineNumber ) );
}
break;
}
return ret;
}
// passed to stack.forEach to turn list items up the stack into paras
function paragraphify(s, i, stack) {
var list = s.list;
var last_li = list[list.length-1];
if (last_li[1] instanceof Array && last_li[1][0] == "para") {
return;
}
if (i+1 == stack.length) {
// Last stack frame
// Keep the same array, but replace the contents
last_li.push( ["para"].concat( last_li.splice(1) ) );
}
else {
var sublist = last_li.pop();
last_li.push( ["para"].concat( last_li.splice(1) ), sublist );
}
}
// The matcher function
return function( block, next ) {
var m = block.match( is_list_re );
if ( !m ) return undefined;
function make_list( m ) {
var list = bullet_list.exec( m[2] )
? ["bulletlist"]
: ["numberlist"];
stack.push( { list: list, indent: m[1] } );
return list;
}
var stack = [], // Stack of lists for nesting.
list = make_list( m ),
last_li,
loose = false,
ret = [ stack[0].list ],
i;
// Loop to search over block looking for inner block elements and loose lists
loose_search:
while( true ) {
// Split into lines preserving new lines at end of line
var lines = block.split( /(?=\n)/ );
// We have to grab all lines for a li and call processInline on them
// once as there are some inline things that can span lines.
var li_accumulate = "";
// Loop over the lines in this block looking for tight lists.
tight_search:
for (var line_no=0; line_no < lines.length; line_no++) {
var nl = "",
l = lines[line_no].replace(/^\n/, function(n) { nl = n; return ""; });
// TODO: really should cache this
var line_re = regex_for_depth( stack.length );
m = l.match( line_re );
//print( "line:", uneval(l), "\nline match:", uneval(m) );
// We have a list item
if ( m[1] !== undefined ) {
// Process the previous list item, if any
if ( li_accumulate.length ) {
add( last_li, loose, this.processInline( li_accumulate ), nl );
// Loose mode will have been dealt with. Reset it
loose = false;
li_accumulate = "";
}
m[1] = expand_tab( m[1] );
var wanted_depth = Math.floor(m[1].length/4)+1;
//print( "want:", wanted_depth, "stack:", stack.length);
if ( wanted_depth > stack.length ) {
// Deep enough for a nested list outright
//print ( "new nested list" );
list = make_list( m );
last_li.push( list );
last_li = list[1] = [ "listitem" ];
}
else {
// We aren't deep enough to be strictly a new level. This is
// where Md.pl goes nuts. If the indent matches a level in the
// stack, put it there, else put it one deeper then the
// wanted_depth deserves.
var found = false;
for (i = 0; i < stack.length; i++) {
if ( stack[ i ].indent != m[1] ) continue;
list = stack[ i ].list;
stack.splice( i+1 );
found = true;
break;
}
if (!found) {
//print("not found. l:", uneval(l));
wanted_depth++;
if (wanted_depth <= stack.length) {
stack.splice(wanted_depth);
//print("Desired depth now", wanted_depth, "stack:", stack.length);
list = stack[wanted_depth-1].list;
//print("list:", uneval(list) );
}
else {
//print ("made new stack for messy indent");
list = make_list(m);
last_li.push(list);
}
}
//print( uneval(list), "last", list === stack[stack.length-1].list );
last_li = [ "listitem" ];
list.push(last_li);
} // end depth of shenegains
nl = "";
}
// Add content
if (l.length > m[0].length) {
li_accumulate += nl + l.substr( m[0].length );
}
} // tight_search
if ( li_accumulate.length ) {
add( last_li, loose, this.processInline( li_accumulate ), nl );
// Loose mode will have been dealt with. Reset it
loose = false;
li_accumulate = "";
}
// Look at the next block - we might have a loose list. Or an extra
// paragraph for the current li
var contained = get_contained_blocks( stack.length, next );
// Deal with code blocks or properly nested lists
if (contained.length > 0) {
// Make sure all listitems up the stack are paragraphs
forEach( stack, paragraphify, this);
last_li.push.apply( last_li, this.toTree( contained, [] ) );
}
var next_block = next[0] && next[0].valueOf() || "";
if ( next_block.match(is_list_re) || next_block.match( /^ / ) ) {
block = next.shift();
// Check for an HR following a list: features/lists/hr_abutting
var hr = this.dialect.block.horizRule( block, next );
if (hr) {
ret.push.apply(ret, hr);
break;
}
// Make sure all listitems up the stack are paragraphs
forEach( stack, paragraphify, this);
loose = true;
continue loose_search;
}
break;
} // loose_search
return ret;
};
})(),
blockquote: function blockquote( block, next ) {
if ( !block.match( /^>/m ) )
return undefined;
var jsonml = [];
// separate out the leading abutting block, if any
if ( block[ 0 ] != ">" ) {
var lines = block.split( /\n/ ),
prev = [];
// keep shifting lines until you find a crotchet
while ( lines.length && lines[ 0 ][ 0 ] != ">" ) {
prev.push( lines.shift() );
}
// reassemble!
block = lines.join( "\n" );
jsonml.push.apply( jsonml, this.processBlock( prev.join( "\n" ), [] ) );
}
// if the next block is also a blockquote merge it in
while ( next.length && next[ 0 ][ 0 ] == ">" ) {
var b = next.shift();
block = new String(block + block.trailing + b);
block.trailing = b.trailing;
}
// Strip off the leading "> " and re-process as a block.
var input = block.replace( /^> ?/gm, '' ),
old_tree = this.tree;
jsonml.push( this.toTree( input, [ "blockquote" ] ) );
return jsonml;
},
referenceDefn: function referenceDefn( block, next) {
var re = /^\s*\[(.*?)\]:\s*(\S+)(?:\s+(?:(['"])(.*?)\3|\((.*?)\)))?\n?/;
// interesting matches are [ , ref_id, url, , title, title ]
if ( !block.match(re) )
return undefined;
// make an attribute node if it doesn't exist
if ( !extract_attr( this.tree ) ) {
this.tree.splice( 1, 0, {} );
}
var attrs = extract_attr( this.tree );
// make a references hash if it doesn't exist
if ( attrs.references === undefined ) {
attrs.references = {};
}
var b = this.loop_re_over_block(re, block, function( m ) {
if ( m[2] && m[2][0] == '<' && m[2][m[2].length-1] == '>' )
m[2] = m[2].substring( 1, m[2].length - 1 );
var ref = attrs.references[ m[1].toLowerCase() ] = {
href: m[2]
};
if (m[4] !== undefined)
ref.title = m[4];
else if (m[5] !== undefined)
ref.title = m[5];
} );
if (b.length)
next.unshift( mk_block( b, block.trailing ) );
return [];
},
para: function para( block, next ) {
// everything's a para!
return [ ["para"].concat( this.processInline( block ) ) ];
}
}
};
Markdown.dialects.Gruber.inline = {
__oneElement__: function oneElement( text, patterns_or_re, previous_nodes ) {
var m,
res,
lastIndex = 0;
patterns_or_re = patterns_or_re || this.dialect.inline.__patterns__;
var re = new RegExp( "([\\s\\S]*?)(" + (patterns_or_re.source || patterns_or_re) + ")" );
m = re.exec( text );
if (!m) {
// Just boring text
return [ text.length, text ];
}
else if ( m[1] ) {
// Some un-interesting text matched. Return that first
return [ m[1].length, m[1] ];
}
var res;
if ( m[2] in this.dialect.inline ) {
res = this.dialect.inline[ m[2] ].call(
this,
text.substr( m.index ), m, previous_nodes || [] );
}
// Default for now to make dev easier. just slurp special and output it.
res = res || [ m[2].length, m[2] ];
return res;
},
__call__: function inline( text, patterns ) {
var out = [],
res;
function add(x) {
//D:self.debug(" adding output", uneval(x));
if (typeof x == "string" && typeof out[out.length-1] == "string")
out[ out.length-1 ] += x;
else
out.push(x);
}
while ( text.length > 0 ) {
res = this.dialect.inline.__oneElement__.call(this, text, patterns, out );
text = text.substr( res.shift() );
forEach(res, add )
}
return out;
},
// These characters are intersting elsewhere, so have rules for them so that
// chunks of plain text blocks don't include them
"]": function () {},
"}": function () {},
"\\": function escaped( text ) {
// [ length of input processed, node/children to add... ]
// Only esacape: \ ` * _ { } [ ] ( ) # * + - . !
if ( text.match( /^\\[\\`\*_{}\[\]()#\+.!\-]/ ) )
return [ 2, text[1] ];
else
// Not an esacpe
return [ 1, "\\" ];
},
"
// 1 2 3 4 <--- captures
var m = text.match( /^!\[(.*?)\][ \t]*\([ \t]*(\S*)(?:[ \t]+(["'])(.*?)\3)?[ \t]*\)/ );
if ( m ) {
if ( m[2] && m[2][0] == '<' && m[2][m[2].length-1] == '>' )
m[2] = m[2].substring( 1, m[2].length - 1 );
m[2] = this.dialect.inline.__call__.call( this, m[2], /\\/ )[0];
var attrs = { alt: m[1], href: m[2] || "" };
if ( m[4] !== undefined)
attrs.title = m[4];
return [ m[0].length, [ "img", attrs ] ];
}
// ![Alt text][id]
m = text.match( /^!\[(.*?)\][ \t]*\[(.*?)\]/ );
if ( m ) {
// We can't check if the reference is known here as it likely wont be
// found till after. Check it in md tree->hmtl tree conversion
return [ m[0].length, [ "img_ref", { alt: m[1], ref: m[2].toLowerCase(), original: m[0] } ] ];
}
// Just consume the '!['
return [ 2, "![" ];
},
"[": function link( text ) {
var orig = String(text);
// Inline content is possible inside `link text`
var res = Markdown.DialectHelpers.inline_until_char.call( this, text.substr(1), ']' );
// No closing ']' found. Just consume the [
if ( !res ) return [ 1, '[' ];
var consumed = 1 + res[ 0 ],
children = res[ 1 ],
link,
attrs;
// At this point the first [...] has been parsed. See what follows to find
// out which kind of link we are (reference or direct url)
text = text.substr( consumed );
// [link text](/path/to/img.jpg "Optional title")
// 1 2 3 <--- captures
// This will capture up to the last paren in the block. We then pull
// back based on if there a matching ones in the url
// ([here](/url/(test))
// The parens have to be balanced
var m = text.match( /^\s*\([ \t]*(\S+)(?:[ \t]+(["'])(.*?)\2)?[ \t]*\)/ );
if ( m ) {
var url = m[1];
consumed += m[0].length;
if ( url && url[0] == '<' && url[url.length-1] == '>' )
url = url.substring( 1, url.length - 1 );
// If there is a title we don't have to worry about parens in the url
if ( !m[3] ) {
var open_parens = 1; // One open that isn't in the capture
for (var len = 0; len < url.length; len++) {
switch ( url[len] ) {
case '(':
open_parens++;
break;
case ')':
if ( --open_parens == 0) {
consumed -= url.length - len;
url = url.substring(0, len);
}
break;
}
}
}
// Process escapes only
url = this.dialect.inline.__call__.call( this, url, /\\/ )[0];
attrs = { href: url || "" };
if ( m[3] !== undefined)
attrs.title = m[3];
link = [ "link", attrs ].concat( children );
return [ consumed, link ];
}
// [Alt text][id]
// [Alt text] [id]
m = text.match( /^\s*\[(.*?)\]/ );
if ( m ) {
consumed += m[ 0 ].length;
// [links][] uses links as its reference
attrs = { ref: ( m[ 1 ] || String(children) ).toLowerCase(), original: orig.substr( 0, consumed ) };
link = [ "link_ref", attrs ].concat( children );
// We can't check if the reference is known here as it likely wont be
// found till after. Check it in md tree->hmtl tree conversion.
// Store the original so that conversion can revert if the ref isn't found.
return [ consumed, link ];
}
// [id]
// Only if id is plain (no formatting.)
if ( children.length == 1 && typeof children[0] == "string" ) {
attrs = { ref: children[0].toLowerCase(), original: orig.substr( 0, consumed ) };
link = [ "link_ref", attrs, children[0] ];
return [ consumed, link ];
}
// Just consume the '['
return [ 1, "[" ];
},
"<": function autoLink( text ) {
var m;
if ( ( m = text.match( /^<(?:((https?|ftp|mailto):[^>]+)|(.*?@.*?\.[a-zA-Z]+))>/ ) ) != null ) {
if ( m[3] ) {
return [ m[0].length, [ "link", { href: "mailto:" + m[3] }, m[3] ] ];
}
else if ( m[2] == "mailto" ) {
return [ m[0].length, [ "link", { href: m[1] }, m[1].substr("mailto:".length ) ] ];
}
else
return [ m[0].length, [ "link", { href: m[1] }, m[1] ] ];
}
return [ 1, "<" ];
},
"`": function inlineCode( text ) {
// Inline code block. as many backticks as you like to start it
// Always skip over the opening ticks.
var m = text.match( /(`+)(([\s\S]*?)\1)/ );
if ( m && m[2] )
return [ m[1].length + m[2].length, [ "inlinecode", m[3] ] ];
else {
// TODO: No matching end code found - warn!
return [ 1, "`" ];
}
},
" \n": function lineBreak( text ) {
return [ 3, [ "linebreak" ] ];
}
};
// Meta Helper/generator method for em and strong handling
function strong_em( tag, md ) {
var state_slot = tag + "_state",
other_slot = tag == "strong" ? "em_state" : "strong_state";
function CloseTag(len) {
this.len_after = len;
this.name = "close_" + md;
}
return function ( text, orig_match ) {
if (this[state_slot][0] == md) {
// Most recent em is of this type
//D:this.debug("closing", md);
this[state_slot].shift();
// "Consume" everything to go back to the recrusion in the else-block below
return[ text.length, new CloseTag(text.length-md.length) ];
}
else {
// Store a clone of the em/strong states
var other = this[other_slot].slice(),
state = this[state_slot].slice();
this[state_slot].unshift(md);
//D:this.debug_indent += " ";
// Recurse
var res = this.processInline( text.substr( md.length ) );
//D:this.debug_indent = this.debug_indent.substr(2);
var last = res[res.length - 1];
//D:this.debug("processInline from", tag + ": ", uneval( res ) );
var check = this[state_slot].shift();
if (last instanceof CloseTag) {
res.pop();
// We matched! Huzzah.
var consumed = text.length - last.len_after;
return [ consumed, [ tag ].concat(res) ];
}
else {
// Restore the state of the other kind. We might have mistakenly closed it.
this[other_slot] = other;
this[state_slot] = state;
// We can't reuse the processed result as it could have wrong parsing contexts in it.
return [ md.length, md ];
}
}
}; // End returned function
}
Markdown.dialects.Gruber.inline["**"] = strong_em("strong", "**");
Markdown.dialects.Gruber.inline["__"] = strong_em("strong", "__");
Markdown.dialects.Gruber.inline["*"] = strong_em("em", "*");
Markdown.dialects.Gruber.inline["_"] = strong_em("em", "_");
// Build default order from insertion order.
Markdown.buildBlockOrder = function(d) {
var ord = [];
for ( var i in d ) {
if ( i == "__order__" || i == "__call__" ) continue;
ord.push( i );
}
d.__order__ = ord;
};
// Build patterns for inline matcher
Markdown.buildInlinePatterns = function(d) {
var patterns = [];
for ( var i in d ) {
// __foo__ is reserved and not a pattern
if ( i.match( /^__.*__$/) ) continue;
var l = i.replace( /([\\.*+?|()\[\]{}])/g, "\\$1" )
.replace( /\n/, "\\n" );
patterns.push( i.length == 1 ? l : "(?:" + l + ")" );
}
patterns = patterns.join("|");
d.__patterns__ = patterns;
//print("patterns:", uneval( patterns ) );
var fn = d.__call__;
d.__call__ = function(text, pattern) {
if (pattern != undefined) {
return fn.call(this, text, pattern);
}
else
{
return fn.call(this, text, patterns);
}
};
};
Markdown.DialectHelpers = {};
Markdown.DialectHelpers.inline_until_char = function( text, want ) {
var consumed = 0,
nodes = [];
while ( true ) {
if ( text[ consumed ] == want ) {
// Found the character we were looking for
consumed++;
return [ consumed, nodes ];
}
if ( consumed >= text.length ) {
// No closing char found. Abort.
return null;
}
var res = this.dialect.inline.__oneElement__.call(this, text.substr( consumed ) );
consumed += res[ 0 ];
// Add any returned nodes.
nodes.push.apply( nodes, res.slice( 1 ) );
}
}
// Helper function to make sub-classing a dialect easier
Markdown.subclassDialect = function( d ) {
function Block() {}
Block.prototype = d.block;
function Inline() {}
Inline.prototype = d.inline;
return { block: new Block(), inline: new Inline() };
};
Markdown.buildBlockOrder ( Markdown.dialects.Gruber.block );
Markdown.buildInlinePatterns( Markdown.dialects.Gruber.inline );
Markdown.dialects.Maruku = Markdown.subclassDialect( Markdown.dialects.Gruber );
Markdown.dialects.Maruku.processMetaHash = function processMetaHash( meta_string ) {
var meta = split_meta_hash( meta_string ),
attr = {};
for ( var i = 0; i < meta.length; ++i ) {
// id: #foo
if ( /^#/.test( meta[ i ] ) ) {
attr.id = meta[ i ].substring( 1 );
}
// class: .foo
else if ( /^\./.test( meta[ i ] ) ) {
// if class already exists, append the new one
if ( attr['class'] ) {
attr['class'] = attr['class'] + meta[ i ].replace( /./, " " );
}
else {
attr['class'] = meta[ i ].substring( 1 );
}
}
// attribute: foo=bar
else if ( /\=/.test( meta[ i ] ) ) {
var s = meta[ i ].split( /\=/ );
attr[ s[ 0 ] ] = s[ 1 ];
}
}
return attr;
}
function split_meta_hash( meta_string ) {
var meta = meta_string.split( "" ),
parts = [ "" ],
in_quotes = false;
while ( meta.length ) {
var letter = meta.shift();
switch ( letter ) {
case " " :
// if we're in a quoted section, keep it
if ( in_quotes ) {
parts[ parts.length - 1 ] += letter;
}
// otherwise make a new part
else {
parts.push( "" );
}
break;
case "'" :
case '"' :
// reverse the quotes and move straight on
in_quotes = !in_quotes;
break;
case "\\" :
// shift off the next letter to be used straight away.
// it was escaped so we'll keep it whatever it is
letter = meta.shift();
default :
parts[ parts.length - 1 ] += letter;
break;
}
}
return parts;
}
Markdown.dialects.Maruku.block.document_meta = function document_meta( block, next ) {
// we're only interested in the first block
if ( block.lineNumber > 1 ) return undefined;
// document_meta blocks consist of one or more lines of `Key: Value\n`
if ( ! block.match( /^(?:\w+:.*\n)*\w+:.*$/ ) ) return undefined;
// make an attribute node if it doesn't exist
if ( !extract_attr( this.tree ) ) {
this.tree.splice( 1, 0, {} );
}
var pairs = block.split( /\n/ );
for ( p in pairs ) {
var m = pairs[ p ].match( /(\w+):\s*(.*)$/ ),
key = m[ 1 ].toLowerCase(),
value = m[ 2 ];
this.tree[ 1 ][ key ] = value;
}
// document_meta produces no content!
return [];
};
Markdown.dialects.Maruku.block.block_meta = function block_meta( block, next ) {
// check if the last line of the block is an meta hash
var m = block.match( /(^|\n) {0,3}\{:\s*((?:\\\}|[^\}])*)\s*\}$/ );
if ( !m ) return undefined;
// process the meta hash
var attr = this.dialect.processMetaHash( m[ 2 ] );
var hash;
// if we matched ^ then we need to apply meta to the previous block
if ( m[ 1 ] === "" ) {
var node = this.tree[ this.tree.length - 1 ];
hash = extract_attr( node );
// if the node is a string (rather than JsonML), bail
if ( typeof node === "string" ) return undefined;
// create the attribute hash if it doesn't exist
if ( !hash ) {
hash = {};
node.splice( 1, 0, hash );
}
// add the attributes in
for ( a in attr ) {
hash[ a ] = attr[ a ];
}
// return nothing so the meta hash is removed
return [];
}
// pull the meta hash off the block and process what's left
var b = block.replace( /\n.*$/, "" ),
result = this.processBlock( b, [] );
// get or make the attributes hash
hash = extract_attr( result[ 0 ] );
if ( !hash ) {
hash = {};
result[ 0 ].splice( 1, 0, hash );
}
// attach the attributes to the block
for ( a in attr ) {
hash[ a ] = attr[ a ];
}
return result;
};
Markdown.dialects.Maruku.block.definition_list = function definition_list( block, next ) {
// one or more terms followed by one or more definitions, in a single block
var tight = /^((?:[^\s:].*\n)+):\s+([\s\S]+)$/,
list = [ "dl" ],
i;
// see if we're dealing with a tight or loose block
if ( ( m = block.match( tight ) ) ) {
// pull subsequent tight DL blocks out of `next`
var blocks = [ block ];
while ( next.length && tight.exec( next[ 0 ] ) ) {
blocks.push( next.shift() );
}
for ( var b = 0; b < blocks.length; ++b ) {
var m = blocks[ b ].match( tight ),
terms = m[ 1 ].replace( /\n$/, "" ).split( /\n/ ),
defns = m[ 2 ].split( /\n:\s+/ );
// print( uneval( m ) );
for ( i = 0; i < terms.length; ++i ) {
list.push( [ "dt", terms[ i ] ] );
}
for ( i = 0; i < defns.length; ++i ) {
// run inline processing over the definition
list.push( [ "dd" ].concat( this.processInline( defns[ i ].replace( /(\n)\s+/, "$1" ) ) ) );
}
}
}
else {
return undefined;
}
return [ list ];
};
Markdown.dialects.Maruku.inline[ "{:" ] = function inline_meta( text, matches, out ) {
if ( !out.length ) {
return [ 2, "{:" ];
}
// get the preceeding element
var before = out[ out.length - 1 ];
if ( typeof before === "string" ) {
return [ 2, "{:" ];
}
// match a meta hash
var m = text.match( /^\{:\s*((?:\\\}|[^\}])*)\s*\}/ );
// no match, false alarm
if ( !m ) {
return [ 2, "{:" ];
}
// attach the attributes to the preceeding element
var meta = this.dialect.processMetaHash( m[ 1 ] ),
attr = extract_attr( before );
if ( !attr ) {
attr = {};
before.splice( 1, 0, attr );
}
for ( var k in meta ) {
attr[ k ] = meta[ k ];
}
// cut out the string and replace it with nothing
return [ m[ 0 ].length, "" ];
};
Markdown.buildBlockOrder ( Markdown.dialects.Maruku.block );
Markdown.buildInlinePatterns( Markdown.dialects.Maruku.inline );
var isArray = Array.isArray || function(obj) {
return Object.prototype.toString.call(obj) == '[object Array]';
};
var forEach;
// Don't mess with Array.prototype. Its not friendly
if ( Array.prototype.forEach ) {
forEach = function( arr, cb, thisp ) {
return arr.forEach( cb, thisp );
};
}
else {
forEach = function(arr, cb, thisp) {
for (var i = 0; i < arr.length; i++) {
cb.call(thisp || arr, arr[i], i, arr);
}
}
}
function extract_attr( jsonml ) {
return isArray(jsonml)
&& jsonml.length > 1
&& typeof jsonml[ 1 ] === "object"
&& !( isArray(jsonml[ 1 ]) )
? jsonml[ 1 ]
: undefined;
}
/**
* renderJsonML( jsonml[, options] ) -> String
* - jsonml (Array): JsonML array to render to XML
* - options (Object): options
*
* Converts the given JsonML into well-formed XML.
*
* The options currently understood are:
*
* - root (Boolean): wether or not the root node should be included in the
* output, or just its children. The default `false` is to not include the
* root itself.
*/
expose.renderJsonML = function( jsonml, options ) {
options = options || {};
// include the root element in the rendered output?
options.root = options.root || false;
var content = [];
if ( options.root ) {
content.push( render_tree( jsonml ) );
}
else {
jsonml.shift(); // get rid of the tag
if ( jsonml.length && typeof jsonml[ 0 ] === "object" && !( jsonml[ 0 ] instanceof Array ) ) {
jsonml.shift(); // get rid of the attributes
}
while ( jsonml.length ) {
content.push( render_tree( jsonml.shift() ) );
}
}
return content.join( "\n\n" );
};
function escapeHTML( text ) {
return text.replace( /&/g, "&" )
.replace( /</g, "<" )
.replace( />/g, ">" )
.replace( /"/g, """ )
.replace( /'/g, "'" );
}
function render_tree( jsonml ) {
// basic case
if ( typeof jsonml === "string" ) {
return escapeHTML( jsonml );
}
var tag = jsonml.shift(),
attributes = {},
content = [];
if ( jsonml.length && typeof jsonml[ 0 ] === "object" && !( jsonml[ 0 ] instanceof Array ) ) {
attributes = jsonml.shift();
}
while ( jsonml.length ) {
content.push( arguments.callee( jsonml.shift() ) );
}
var tag_attrs = "";
for ( var a in attributes ) {
tag_attrs += " " + a + '="' + escapeHTML( attributes[ a ] ) + '"';
}
// be careful about adding whitespace here for inline elements
if ( tag == "img" || tag == "br" || tag == "hr" ) {
return "<"+ tag + tag_attrs + "/>";
}
else {
return "<"+ tag + tag_attrs + ">" + content.join( "" ) + "</" + tag + ">";
}
}
function convert_tree_to_html( tree, references, options ) {
var i;
options = options || {};
// shallow clone
var jsonml = tree.slice( 0 );
if (typeof options.preprocessTreeNode === "function") {
jsonml = options.preprocessTreeNode(jsonml, references);
}
// Clone attributes if they exist
var attrs = extract_attr( jsonml );
if ( attrs ) {
jsonml[ 1 ] = {};
for ( i in attrs ) {
jsonml[ 1 ][ i ] = attrs[ i ];
}
attrs = jsonml[ 1 ];
}
// basic case
if ( typeof jsonml === "string" ) {
return jsonml;
}
// convert this node
switch ( jsonml[ 0 ] ) {
case "header":
jsonml[ 0 ] = "h" + jsonml[ 1 ].level;
delete jsonml[ 1 ].level;
break;
case "bulletlist":
jsonml[ 0 ] = "ul";
break;
case "numberlist":
jsonml[ 0 ] = "ol";
break;
case "listitem":
jsonml[ 0 ] = "li";
break;
case "para":
jsonml[ 0 ] = "p";
break;
case "markdown":
jsonml[ 0 ] = "html";
if ( attrs ) delete attrs.references;
break;
case "code_block":
jsonml[ 0 ] = "pre";
i = attrs ? 2 : 1;
var code = [ "code" ];
code.push.apply( code, jsonml.splice( i ) );
jsonml[ i ] = code;
break;
case "inlinecode":
jsonml[ 0 ] = "code";
break;
case "img":
jsonml[ 1 ].src = jsonml[ 1 ].href;
delete jsonml[ 1 ].href;
break;
case "linebreak":
jsonml[ 0 ] = "br";
break;
case "link":
jsonml[ 0 ] = "a";
break;
case "link_ref":
jsonml[ 0 ] = "a";
// grab this ref and clean up the attribute node
var ref = references[ attrs.ref ];
// if the reference exists, make the link
if ( ref ) {
delete attrs.ref;
// add in the href and title, if present
attrs.href = ref.href;
if ( ref.title ) {
attrs.title = ref.title;
}
// get rid of the unneeded original text
delete attrs.original;
}
// the reference doesn't exist, so revert to plain text
else {
return attrs.original;
}
break;
case "img_ref":
jsonml[ 0 ] = "img";
// grab this ref and clean up the attribute node
var ref = references[ attrs.ref ];
// if the reference exists, make the link
if ( ref ) {
delete attrs.ref;
// add in the href and title, if present
attrs.src = ref.href;
if ( ref.title ) {
attrs.title = ref.title;
}
// get rid of the unneeded original text
delete attrs.original;
}
// the reference doesn't exist, so revert to plain text
else {
return attrs.original;
}
break;
}
// convert all the children
i = 1;
// deal with the attribute node, if it exists
if ( attrs ) {
// if there are keys, skip over it
for ( var key in jsonml[ 1 ] ) {
i = 2;
}
// if there aren't, remove it
if ( i === 1 ) {
jsonml.splice( i, 1 );
}
}
for ( ; i < jsonml.length; ++i ) {
jsonml[ i ] = arguments.callee( jsonml[ i ], references, options );
}
return jsonml;
}
// merges adjacent text nodes into a single node
function merge_text_nodes( jsonml ) {
// skip the tag name and attribute hash
var i = extract_attr( jsonml ) ? 2 : 1;
while ( i < jsonml.length ) {
// if it's a string check the next item too
if ( typeof jsonml[ i ] === "string" ) {
if ( i + 1 < jsonml.length && typeof jsonml[ i + 1 ] === "string" ) {
// merge the second string into the first and remove it
jsonml[ i ] += jsonml.splice( i + 1, 1 )[ 0 ];
}
else {
++i;
}
}
// if it's not a string recurse
else {
arguments.callee( jsonml[ i ] );
++i;
}
}
}
} )( (function() {
if ( typeof exports === "undefined" ) {
window.markdown = {};
return window.markdown;
}
else {
return exports;
}
} )() );
| {
"pile_set_name": "Github"
} |
{
"name": "test/timeout",
"commit": {
"sha": "14fa3698221f91613b9e1d809434326e5ed546af",
"node_id": "MDY6Q29tbWl0MjA2ODg4MjAxOjE0ZmEzNjk4MjIxZjkxNjEzYjllMWQ4MDk0MzQzMjZlNWVkNTQ2YWY=",
"commit": {
"author": {
"name": "Liam Newman",
"email": "[email protected]",
"date": "2019-09-06T23:38:04Z"
},
"committer": {
"name": "Liam Newman",
"email": "[email protected]",
"date": "2019-09-07T00:09:09Z"
},
"message": "Update README",
"tree": {
"sha": "f791b2c2752a83ddd7604a800800b18e7c1d0196",
"url": "https://api.github.com/repos/hub4j-test-org/github-api/git/trees/f791b2c2752a83ddd7604a800800b18e7c1d0196"
},
"url": "https://api.github.com/repos/hub4j-test-org/github-api/git/commits/14fa3698221f91613b9e1d809434326e5ed546af",
"comment_count": 0,
"verification": {
"verified": false,
"reason": "unsigned",
"signature": null,
"payload": null
}
},
"url": "https://api.github.com/repos/hub4j-test-org/github-api/commits/14fa3698221f91613b9e1d809434326e5ed546af",
"html_url": "https://github.com/hub4j-test-org/github-api/commit/14fa3698221f91613b9e1d809434326e5ed546af",
"comments_url": "https://api.github.com/repos/hub4j-test-org/github-api/commits/14fa3698221f91613b9e1d809434326e5ed546af/comments",
"author": {
"login": "bitwiseman",
"id": 1958953,
"node_id": "MDQ6VXNlcjE5NTg5NTM=",
"avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/bitwiseman",
"html_url": "https://github.com/bitwiseman",
"followers_url": "https://api.github.com/users/bitwiseman/followers",
"following_url": "https://api.github.com/users/bitwiseman/following{/other_user}",
"gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}",
"starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions",
"organizations_url": "https://api.github.com/users/bitwiseman/orgs",
"repos_url": "https://api.github.com/users/bitwiseman/repos",
"events_url": "https://api.github.com/users/bitwiseman/events{/privacy}",
"received_events_url": "https://api.github.com/users/bitwiseman/received_events",
"type": "User",
"site_admin": false
},
"committer": {
"login": "bitwiseman",
"id": 1958953,
"node_id": "MDQ6VXNlcjE5NTg5NTM=",
"avatar_url": "https://avatars3.githubusercontent.com/u/1958953?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/bitwiseman",
"html_url": "https://github.com/bitwiseman",
"followers_url": "https://api.github.com/users/bitwiseman/followers",
"following_url": "https://api.github.com/users/bitwiseman/following{/other_user}",
"gists_url": "https://api.github.com/users/bitwiseman/gists{/gist_id}",
"starred_url": "https://api.github.com/users/bitwiseman/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bitwiseman/subscriptions",
"organizations_url": "https://api.github.com/users/bitwiseman/orgs",
"repos_url": "https://api.github.com/users/bitwiseman/repos",
"events_url": "https://api.github.com/users/bitwiseman/events{/privacy}",
"received_events_url": "https://api.github.com/users/bitwiseman/received_events",
"type": "User",
"site_admin": false
},
"parents": [
{
"sha": "3a09d2de4a9a1322a0ba2c3e2f54a919ca8fe353",
"url": "https://api.github.com/repos/hub4j-test-org/github-api/commits/3a09d2de4a9a1322a0ba2c3e2f54a919ca8fe353",
"html_url": "https://github.com/hub4j-test-org/github-api/commit/3a09d2de4a9a1322a0ba2c3e2f54a919ca8fe353"
}
]
},
"_links": {
"self": "https://api.github.com/repos/hub4j-test-org/github-api/branches/test/#UrlEncode",
"html": "https://github.com/hub4j-test-org/github-api/tree/test/#UrlEncode"
},
"protected": false,
"protection": {
"enabled": false,
"required_status_checks": {
"enforcement_level": "off",
"contexts": []
}
},
"protection_url": "https://api.github.com/repos/hub4j-test-org/github-api/branches/test/#UrlEncode/protection"
} | {
"pile_set_name": "Github"
} |
#include <iostream>
int main() {
int n;
std::cin >> n;
std::cout << "incorrect " << n << std::endl;
return 0;
}
| {
"pile_set_name": "Github"
} |
.s-btn-downarrow{
display:inline-block;
width:16px;
background:url('images/menu_downarrow.png') no-repeat 9px center;
}
a.s-btn-active{
background-position: bottom right;
}
a.s-btn-active span.l-btn-left{
background-position: bottom left;
}
a.s-btn-active .s-btn-downarrow{
background:url('images/menu_split_downarrow.png') no-repeat 4px -18px;
}
a:hover.l-btn .s-btn-downarrow{
background:url('images/menu_split_downarrow.png') no-repeat 4px -18px;
}
a.s-btn-plain-active{
background:transparent;
border:1px solid #d3d3d3;
_padding:0px 5px 0px 0px;
-moz-border-radius:3px;
-webkit-border-radius: 3px;
}
a.s-btn-plain-active .s-btn-downarrow{
background:url('images/menu_split_downarrow.png') no-repeat 4px -18px;
} | {
"pile_set_name": "Github"
} |
using Cirrious.MvvmCross.WindowsPhone.Views;
namespace $rootnamespace$.Views
{
public partial class FirstView : MvxPhonePage
{
public FirstView()
{
InitializeComponent();
}
}
} | {
"pile_set_name": "Github"
} |
# Modifier formatting
### Modifier sorting
Class, method, and field modifiers will be sorted according to the order in the
JLS (sections [8.1.1](https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-8.1.1),
[8.3.1](https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-8.3.1),
[8.4.3](https://docs.oracle.com/javase/specs/jls/se11/html/jls-8.html#jls-8.4.3),
and [9.4](https://docs.oracle.com/javase/specs/jls/se11/html/jls-9.html#jls-9.4)).
The overall ordering is:
- public
- protected
- private
- abstract
- default
- static
- final
- transient
- volatile
- synchronized
- native
- strictfp
#### Examples
Input:
```java
final private static String S = "abc";
```
Output:
```java
private static final String S = "abc";
```
Input:
```java
final public class C {...}
```
Output:
```java
public final class C {...}
```
Input:
```java
static private void foo() {}
```
Output:
```java
private static void foo() {}
```
### Interaction with annotations
Class, field, and method annotations will be moved ahead of modifier keywords
and placed on a separate line. The exception is method annotations that come
after all modifier keywords, in which case the annotation will maintain the
same position. This is to support annotations whose intent is to qualify the
method's return type, rather than the method itself (for example: `public @Nullable String myMethod()`).
#### Examples
Input:
```java
@Annotation final private static String S = "abc";
```
Output:
```java
@Annotation
private static final String S = "abc";
```
Input:
```java
final private static @Annotation String S = "abc";
```
Output:
```java
@Annotation
private static final String S = "abc";
```
Input:
```java
final public @Nullable String myMethod {}
```
Output:
```java
public final @Nullable String myMethod {}
```
Input:
```java
final @Override public String myMethod {}
```
Output:
```java
@Override
public final String myMethod {}
```
| {
"pile_set_name": "Github"
} |
/*
*
* Copyright 2015 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.
*
*/
package grpc
import (
"bytes"
"fmt"
"io"
"net"
"strings"
"time"
"golang.org/x/net/trace"
)
// EnableTracing controls whether to trace RPCs using the golang.org/x/net/trace package.
// This should only be set before any RPCs are sent or received by this program.
var EnableTracing bool
// methodFamily returns the trace family for the given method.
// It turns "/pkg.Service/GetFoo" into "pkg.Service".
func methodFamily(m string) string {
m = strings.TrimPrefix(m, "/") // remove leading slash
if i := strings.Index(m, "/"); i >= 0 {
m = m[:i] // remove everything from second slash
}
if i := strings.LastIndex(m, "."); i >= 0 {
m = m[i+1:] // cut down to last dotted component
}
return m
}
// traceInfo contains tracing information for an RPC.
type traceInfo struct {
tr trace.Trace
firstLine firstLine
}
// firstLine is the first line of an RPC trace.
type firstLine struct {
client bool // whether this is a client (outgoing) RPC
remoteAddr net.Addr
deadline time.Duration // may be zero
}
func (f *firstLine) String() string {
var line bytes.Buffer
io.WriteString(&line, "RPC: ")
if f.client {
io.WriteString(&line, "to")
} else {
io.WriteString(&line, "from")
}
fmt.Fprintf(&line, " %v deadline:", f.remoteAddr)
if f.deadline != 0 {
fmt.Fprint(&line, f.deadline)
} else {
io.WriteString(&line, "none")
}
return line.String()
}
const truncateSize = 100
func truncate(x string, l int) string {
if l > len(x) {
return x
}
return x[:l]
}
// payload represents an RPC request or response payload.
type payload struct {
sent bool // whether this is an outgoing payload
msg interface{} // e.g. a proto.Message
// TODO(dsymonds): add stringifying info to codec, and limit how much we hold here?
}
func (p payload) String() string {
if p.sent {
return truncate(fmt.Sprintf("sent: %v", p.msg), truncateSize)
}
return truncate(fmt.Sprintf("recv: %v", p.msg), truncateSize)
}
type fmtStringer struct {
format string
a []interface{}
}
func (f *fmtStringer) String() string {
return fmt.Sprintf(f.format, f.a...)
}
type stringer string
func (s stringer) String() string { return string(s) }
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package geb.test.browsers
import java.lang.annotation.*
@Retention(RetentionPolicy.RUNTIME)
@Target([ElementType.TYPE, ElementType.METHOD])
@Inherited
@interface InternetExplorer {
} | {
"pile_set_name": "Github"
} |
glabel func_809B05F0
/* 00280 809B05F0 27BDFFE0 */ addiu $sp, $sp, 0xFFE0 ## $sp = FFFFFFE0
/* 00284 809B05F4 AFBF001C */ sw $ra, 0x001C($sp)
/* 00288 809B05F8 AFA40020 */ sw $a0, 0x0020($sp)
/* 0028C 809B05FC 0C00BCCD */ jal func_8002F334
/* 00290 809B0600 AFA50024 */ sw $a1, 0x0024($sp)
/* 00294 809B0604 10400004 */ beq $v0, $zero, .L809B0618
/* 00298 809B0608 8FA40020 */ lw $a0, 0x0020($sp)
/* 0029C 809B060C 3C05809B */ lui $a1, %hi(func_809B0558) ## $a1 = 809B0000
/* 002A0 809B0610 0C26C0DC */ jal func_809B0370
/* 002A4 809B0614 24A50558 */ addiu $a1, $a1, %lo(func_809B0558) ## $a1 = 809B0558
.L809B0618:
/* 002A8 809B0618 3C014348 */ lui $at, 0x4348 ## $at = 43480000
/* 002AC 809B061C 44812000 */ mtc1 $at, $f4 ## $f4 = 200.00
/* 002B0 809B0620 3C07461C */ lui $a3, 0x461C ## $a3 = 461C0000
/* 002B4 809B0624 34E74000 */ ori $a3, $a3, 0x4000 ## $a3 = 461C4000
/* 002B8 809B0628 8FA40020 */ lw $a0, 0x0020($sp)
/* 002BC 809B062C 8FA50024 */ lw $a1, 0x0024($sp)
/* 002C0 809B0630 2406003E */ addiu $a2, $zero, 0x003E ## $a2 = 0000003E
/* 002C4 809B0634 0C00BD0D */ jal func_8002F434
/* 002C8 809B0638 E7A40010 */ swc1 $f4, 0x0010($sp)
/* 002CC 809B063C 8FBF001C */ lw $ra, 0x001C($sp)
/* 002D0 809B0640 27BD0020 */ addiu $sp, $sp, 0x0020 ## $sp = 00000000
/* 002D4 809B0644 03E00008 */ jr $ra
/* 002D8 809B0648 00000000 */ nop
| {
"pile_set_name": "Github"
} |
<?php
/**
* Hoa
*
*
* @license
*
* New BSD License
*
* Copyright © 2007-2017, Hoa community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Hoa 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 HOLDERS AND 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.
*/
namespace Hoa\Math\Test\Unit;
use Hoa\Math\Context as CUT;
use Hoa\Test;
/**
* Class \Hoa\Math\Test\Unit\Context.
*
* Test suite of the Hoa\Math\Context class.
*
* @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class Context extends Test\Unit\Suite
{
public function case_context_has_no_predefined_variable()
{
$this
->given($context = new CUT())
->when($result = $context->getVariables())
->then
->object($result)
->isInstanceOf('ArrayObject')
->array(iterator_to_array($result))
->isEmpty();
}
public function case_context_exception_when_getting_unknown_variable()
{
$this
->given(
$name = 'foo',
$context = new CUT()
)
->then
->exception(function () use ($context, $name) {
$context->getVariable($name);
})
->isInstanceOf('Hoa\Math\Exception\UnknownVariable');
}
public function case_context_returns_variable_value()
{
$this
->given(
$name = 'foo',
$value = 42,
$callable = function () use ($value) { return $value; },
$context = new CUT(),
$context->addVariable($name, $callable)
)
->when($result = $context->getVariable($name))
->then
->integer($result)
->isEqualTo($value);
}
public function case_context_has_predefined_constants()
{
$this
->given($context = new CUT())
->when($result = $context->getConstants())
->then
->object($result)
->isInstanceOf('ArrayObject')
->array(iterator_to_array($result))
->isEqualTo([
'PI' => M_PI,
'PI_2' => M_PI_2,
'PI_4' => M_PI_4,
'E' => M_E,
'SQRT_PI' => M_SQRTPI,
'SQRT_2' => M_SQRT2,
'SQRT_3' => M_SQRT3,
'LN_PI' => M_LNPI,
'LOG_2E' => M_LOG2E,
'LOG_10E' => M_LOG10E,
'LN_2' => M_LN2,
'LN_10' => M_LN10,
'ONE_OVER_PI' => M_1_PI,
'TWO_OVER_PI' => M_2_PI,
'TWO_OVER_SQRT_PI' => M_2_SQRTPI,
'ONE_OVER_SQRT_2' => M_SQRT1_2,
'EULER' => M_EULER,
'INFINITE' => INF
]);
}
public function case_context_exception_when_getting_unknown_constant()
{
$this
->given(
$name = 'FOO',
$context = new CUT()
)
->then
->exception(function () use ($context, $name) {
$context->getConstant($name);
})
->isInstanceOf('Hoa\Math\Exception\UnknownConstant');
}
public function case_context_exception_when_setting_already_defined_constant()
{
$this
->given(
$name = 'PI',
$context = new CUT()
)
->then
->exception(function () use ($context, $name) {
$context->addConstant($name, 42);
})
->isInstanceOf('Hoa\Math\Exception\AlreadyDefinedConstant');
}
public function case_context_returns_constant_value()
{
$this
->given(
$name = 'FOO',
$value = 42,
$context = new CUT(),
$context->addConstant($name, $value)
)
->when($result = $context->getConstant($name))
->then
->variable($result)
->isEqualTo($value);
}
public function case_context_has_predefined_functions()
{
$this
->given($context = new CUT())
->when($result = $context->getFunctions())
->then
->object($result)
->isInstanceOf('ArrayObject')
->array(iterator_to_array($result))
->hasSize(23)
->hasKey('abs')
->hasKey('acos')
->hasKey('asin')
->hasKey('atan')
->hasKey('average')
->hasKey('avg')
->hasKey('ceil')
->hasKey('cos')
->hasKey('count')
->hasKey('deg2rad')
->hasKey('exp')
->hasKey('floor')
->hasKey('ln')
->hasKey('log')
->hasKey('max')
->hasKey('min')
->hasKey('pow')
->hasKey('rad2deg')
->hasKey('round')
->hasKey('round')
->hasKey('sin')
->hasKey('sqrt')
->hasKey('sum')
->hasKey('tan');
}
public function case_context_exception_when_getting_unknown_function()
{
$this
->given(
$name = 'foo',
$context = new CUT()
)
->then
->exception(function () use ($context, $name) {
$context->getFunction($name);
})
->isInstanceOf('Hoa\Math\Exception\UnknownFunction');
}
public function case_context_exception_when_setting_unknown_function()
{
$this
->given(
$name = 'foo',
$context = new CUT()
)
->then
->exception(function () use ($context, $name) {
$context->addFunction($name);
})
->isInstanceOf('Hoa\Math\Exception\UnknownFunction');
}
public function case_context_returns_function_callable()
{
$this
->given(
$name = 'foo',
$callable = function () {},
$context = new CUT(),
$context->addFunction($name, $callable)
)
->when($result = $context->getFunction($name))
->then
->object($result)
->isInstanceOf('Hoa\Consistency\Xcallable');
}
public function case_context_returns_the_right_function_callable()
{
$this
->given(
$name = 'foo',
$value = 42,
$callable = function () use ($value) { return $value; },
$context = new CUT(),
$context->addFunction($name, $callable)
)
->when($result = $context->getFunction($name))
->then
->integer($result())
->isEqualTo($value);
}
}
| {
"pile_set_name": "Github"
} |
package com.benhero.glstudio.renderer
import android.content.Context
import com.benhero.glstudio.util.ProjectionMatrixHelper
import javax.microedition.khronos.egl.EGLConfig
import javax.microedition.khronos.opengles.GL10
/**
* 正交投影
*
* @author Benhero
*/
class L3_2_OrthoRenderer(context: Context) : L2_2_ShapeRenderer(context) {
companion object {
private val VERTEX_SHADER = "" +
// mat4:4×4的矩阵
"uniform mat4 u_Matrix;\n" +
"attribute vec4 a_Position;\n" +
"void main()\n" +
"{\n" +
// 矩阵与向量相乘得到最终的位置
" gl_Position = u_Matrix * a_Position;\n" +
" gl_PointSize = 0.0;\n" +
"}"
}
private var mProjectionMatrixHelper: ProjectionMatrixHelper? = null
override val vertexShader: String
get() = VERTEX_SHADER
override fun onSurfaceCreated(glUnused: GL10, config: EGLConfig) {
super.onSurfaceCreated(glUnused, config)
mProjectionMatrixHelper = ProjectionMatrixHelper(program, "u_Matrix")
}
override fun onSurfaceChanged(glUnused: GL10?, width: Int, height: Int) {
super.onSurfaceChanged(glUnused, width, height)
mProjectionMatrixHelper!!.enable(width, height)
}
}
| {
"pile_set_name": "Github"
} |
/*
Mantis PCI bridge driver
Copyright (C) Manu Abraham ([email protected])
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <asm/io.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/i2c.h>
#include "dmxdev.h"
#include "dvbdev.h"
#include "dvb_demux.h"
#include "dvb_frontend.h"
#include "dvb_net.h"
#include "mantis_common.h"
#include "mantis_reg.h"
#include "mantis_i2c.h"
#define TRIALS 10000
static int mantis_i2c_read(struct mantis_pci *mantis, const struct i2c_msg *msg)
{
u32 rxd, i, stat, trials;
dprintk(MANTIS_INFO, 0, " %s: Address=[0x%02x] <R>[ ",
__func__, msg->addr);
for (i = 0; i < msg->len; i++) {
rxd = (msg->addr << 25) | (1 << 24)
| MANTIS_I2C_RATE_3
| MANTIS_I2C_STOP
| MANTIS_I2C_PGMODE;
if (i == (msg->len - 1))
rxd &= ~MANTIS_I2C_STOP;
mmwrite(MANTIS_INT_I2CDONE, MANTIS_INT_STAT);
mmwrite(rxd, MANTIS_I2CDATA_CTL);
/* wait for xfer completion */
for (trials = 0; trials < TRIALS; trials++) {
stat = mmread(MANTIS_INT_STAT);
if (stat & MANTIS_INT_I2CDONE)
break;
}
dprintk(MANTIS_TMG, 0, "I2CDONE: trials=%d\n", trials);
/* wait for xfer completion */
for (trials = 0; trials < TRIALS; trials++) {
stat = mmread(MANTIS_INT_STAT);
if (stat & MANTIS_INT_I2CRACK)
break;
}
dprintk(MANTIS_TMG, 0, "I2CRACK: trials=%d\n", trials);
rxd = mmread(MANTIS_I2CDATA_CTL);
msg->buf[i] = (u8)((rxd >> 8) & 0xFF);
dprintk(MANTIS_INFO, 0, "%02x ", msg->buf[i]);
}
dprintk(MANTIS_INFO, 0, "]\n");
return 0;
}
static int mantis_i2c_write(struct mantis_pci *mantis, const struct i2c_msg *msg)
{
int i;
u32 txd = 0, stat, trials;
dprintk(MANTIS_INFO, 0, " %s: Address=[0x%02x] <W>[ ",
__func__, msg->addr);
for (i = 0; i < msg->len; i++) {
dprintk(MANTIS_INFO, 0, "%02x ", msg->buf[i]);
txd = (msg->addr << 25) | (msg->buf[i] << 8)
| MANTIS_I2C_RATE_3
| MANTIS_I2C_STOP
| MANTIS_I2C_PGMODE;
if (i == (msg->len - 1))
txd &= ~MANTIS_I2C_STOP;
mmwrite(MANTIS_INT_I2CDONE, MANTIS_INT_STAT);
mmwrite(txd, MANTIS_I2CDATA_CTL);
/* wait for xfer completion */
for (trials = 0; trials < TRIALS; trials++) {
stat = mmread(MANTIS_INT_STAT);
if (stat & MANTIS_INT_I2CDONE)
break;
}
dprintk(MANTIS_TMG, 0, "I2CDONE: trials=%d\n", trials);
/* wait for xfer completion */
for (trials = 0; trials < TRIALS; trials++) {
stat = mmread(MANTIS_INT_STAT);
if (stat & MANTIS_INT_I2CRACK)
break;
}
dprintk(MANTIS_TMG, 0, "I2CRACK: trials=%d\n", trials);
}
dprintk(MANTIS_INFO, 0, "]\n");
return 0;
}
static int mantis_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num)
{
int ret = 0, i = 0, trials;
u32 stat, data, txd;
struct mantis_pci *mantis;
struct mantis_hwconfig *config;
mantis = i2c_get_adapdata(adapter);
BUG_ON(!mantis);
config = mantis->hwconfig;
BUG_ON(!config);
dprintk(MANTIS_DEBUG, 1, "Messages:%d", num);
mutex_lock(&mantis->i2c_lock);
while (i < num) {
/* Byte MODE */
if ((config->i2c_mode & MANTIS_BYTE_MODE) &&
((i + 1) < num) &&
(msgs[i].len < 2) &&
(msgs[i + 1].len < 2) &&
(msgs[i + 1].flags & I2C_M_RD)) {
dprintk(MANTIS_DEBUG, 0, " Byte MODE:\n");
/* Read operation */
txd = msgs[i].addr << 25 | (0x1 << 24)
| (msgs[i].buf[0] << 16)
| MANTIS_I2C_RATE_3;
mmwrite(txd, MANTIS_I2CDATA_CTL);
/* wait for xfer completion */
for (trials = 0; trials < TRIALS; trials++) {
stat = mmread(MANTIS_INT_STAT);
if (stat & MANTIS_INT_I2CDONE)
break;
}
/* check for xfer completion */
if (stat & MANTIS_INT_I2CDONE) {
/* check xfer was acknowledged */
if (stat & MANTIS_INT_I2CRACK) {
data = mmread(MANTIS_I2CDATA_CTL);
msgs[i + 1].buf[0] = (data >> 8) & 0xff;
dprintk(MANTIS_DEBUG, 0, " Byte <%d> RXD=0x%02x [%02x]\n", 0x0, data, msgs[i + 1].buf[0]);
} else {
/* I/O error */
dprintk(MANTIS_ERROR, 1, " I/O error, LINE:%d", __LINE__);
ret = -EIO;
break;
}
} else {
/* I/O error */
dprintk(MANTIS_ERROR, 1, " I/O error, LINE:%d", __LINE__);
ret = -EIO;
break;
}
i += 2; /* Write/Read operation in one go */
}
if (i < num) {
if (msgs[i].flags & I2C_M_RD)
ret = mantis_i2c_read(mantis, &msgs[i]);
else
ret = mantis_i2c_write(mantis, &msgs[i]);
i++;
if (ret < 0)
goto bail_out;
}
}
mutex_unlock(&mantis->i2c_lock);
return num;
bail_out:
mutex_unlock(&mantis->i2c_lock);
return ret;
}
static u32 mantis_i2c_func(struct i2c_adapter *adapter)
{
return I2C_FUNC_SMBUS_EMUL;
}
static struct i2c_algorithm mantis_algo = {
.master_xfer = mantis_i2c_xfer,
.functionality = mantis_i2c_func,
};
int mantis_i2c_init(struct mantis_pci *mantis)
{
u32 intstat, intmask;
struct i2c_adapter *i2c_adapter = &mantis->adapter;
struct pci_dev *pdev = mantis->pdev;
init_waitqueue_head(&mantis->i2c_wq);
mutex_init(&mantis->i2c_lock);
strncpy(i2c_adapter->name, "Mantis I2C", sizeof(i2c_adapter->name));
i2c_set_adapdata(i2c_adapter, mantis);
i2c_adapter->owner = THIS_MODULE;
i2c_adapter->algo = &mantis_algo;
i2c_adapter->algo_data = NULL;
i2c_adapter->timeout = 500;
i2c_adapter->retries = 3;
i2c_adapter->dev.parent = &pdev->dev;
mantis->i2c_rc = i2c_add_adapter(i2c_adapter);
if (mantis->i2c_rc < 0)
return mantis->i2c_rc;
dprintk(MANTIS_DEBUG, 1, "Initializing I2C ..");
intstat = mmread(MANTIS_INT_STAT);
intmask = mmread(MANTIS_INT_MASK);
mmwrite(intstat, MANTIS_INT_STAT);
dprintk(MANTIS_DEBUG, 1, "Disabling I2C interrupt");
intmask = mmread(MANTIS_INT_MASK);
mmwrite((intmask & ~MANTIS_INT_I2CDONE), MANTIS_INT_MASK);
return 0;
}
EXPORT_SYMBOL_GPL(mantis_i2c_init);
int mantis_i2c_exit(struct mantis_pci *mantis)
{
u32 intmask;
dprintk(MANTIS_DEBUG, 1, "Disabling I2C interrupt");
intmask = mmread(MANTIS_INT_MASK);
mmwrite((intmask & ~MANTIS_INT_I2CDONE), MANTIS_INT_MASK);
dprintk(MANTIS_DEBUG, 1, "Removing I2C adapter");
i2c_del_adapter(&mantis->adapter);
return 0;
}
EXPORT_SYMBOL_GPL(mantis_i2c_exit);
| {
"pile_set_name": "Github"
} |
// @ts-check
const os = require('os');
const fp = require('lodash/fp');
/**
* Get the local ip addresses
* @typedef {{ family: 'IPv4' | 'IPv6', internal: boolean, address: string }} NetworkInterface
*
* @return {NetworkInterface[]}
*/
module.exports.getAdresses = function getAdresses() {
return fp.flatten(fp.values(os.networkInterfaces()));
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* The contents of this file are subject to the terms of either the Universal Permissive License
* v 1.0 as shown at http://oss.oracle.com/licenses/upl
*
* or the following license:
*
* 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 copyright holder nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.openjdk.jmc.flightrecorder.controlpanel.ui.configuration.model.gui;
import java.util.ArrayList;
import java.util.List;
/**
* Node in the evaluation graph to apply control changes to JFR configuration settings. It uses the
* transmitter/receiver terminology instead of producer/consumer to lessen the confusion with JFR
* event producers.
*/
abstract class Node {
private final List<Node> m_receivers = new ArrayList<>();
private final List<Node> m_transmitters = new ArrayList<>();
/**
* Add node that will be notified of changes in this node.
*
* @param receiver
* the node that will be notified
*/
public final void addReceiver(Node receiver) {
m_receivers.add(receiver);
receiver.addTransmitter(this);
}
protected void addTransmitter(Node transmitter) {
m_transmitters.add(transmitter);
}
/**
* Notifies all receivers listening to this node.
*/
protected void fireChange() {
onChange();
}
/**
* Subclasses should subclass if they wants be to notified when a transmitter value has changed.
*/
protected void onChange() {
for (Node node : m_receivers) {
node.onChange();
}
}
/**
* Returns a list of all nodes that produces (transmits) values for this node.
*/
protected final List<Node> getTransmitters() {
return m_transmitters;
}
/**
* Return the current value of this node
*
* @return the value
*/
abstract Value getValue();
}
| {
"pile_set_name": "Github"
} |
"""Testing for libmedaka.fastrle program."""
import subprocess
import tempfile
import unittest
import pysam
class RLE(unittest.TestCase):
"""Test libmedaka.fastrle function."""
input_fasta = tempfile.NamedTemporaryFile(suffix='.fasta').name
output_fastqrle = tempfile.NamedTemporaryFile(suffix='.fastqrle').name
basecalls = ['ACCCCCCCGTTTA', 'CCCCCCCC']
@classmethod
def setUpClass(cls):
"""Create input fasta file."""
with open(cls.input_fasta, 'w') as f:
for index, basecall in enumerate(cls.basecalls):
f.write('>read_{}\n{}\n'.format(index, basecall))
def test_rle(self):
"""Test the conversion of basecalls into fastqrle file."""
block_size = 3
with open(self.output_fastqrle, 'w') as f:
subprocess.call(['medaka', 'fastrle', self.input_fasta, '--block_size', str(block_size)], stdout=f)
expected_results = (
[('A', 1), ('C', 3), ('C', 3), ('C', 1), ('G', 1), ('T', 3), ('A', 1)],
[('C', 3), ('C', 3), ('C', 2)])
with pysam.FastqFile(self.output_fastqrle) as f:
for index, entry in enumerate(f):
bases = entry.sequence
qualities = entry.get_quality_array()
got = list(zip(bases, qualities))
expected = expected_results[index]
self.assertEqual(expected, got, "Expected and got differ: ({} != {})".format(expected, got))
| {
"pile_set_name": "Github"
} |
/*******************************************************************************
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*******************************************************************************/
package org.apache.ofbiz.content.webapp.ftl;
import java.io.IOException;
import java.io.Writer;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.GeneralException;
import org.apache.ofbiz.base.util.UtilFormatOut;
import org.apache.ofbiz.base.util.UtilGenerics;
import org.apache.ofbiz.base.util.UtilHttp;
import org.apache.ofbiz.base.util.UtilMisc;
import org.apache.ofbiz.base.util.UtilProperties;
import org.apache.ofbiz.base.util.UtilValidate;
import org.apache.ofbiz.base.util.template.FreeMarkerWorker;
import org.apache.ofbiz.content.content.ContentWorker;
import org.apache.ofbiz.service.LocalDispatcher;
import freemarker.core.Environment;
import freemarker.template.TemplateTransformModel;
/**
* RenderSubContentAsText - Freemarker Transform for Content rendering
* This transform cannot be called recursively (at this time).
*/
public class RenderSubContentAsText implements TemplateTransformModel {
public static final String module = RenderSubContentAsText.class.getName();
public static final String [] upSaveKeyNames = {"globalNodeTrail"};
public static final String [] saveKeyNames = {"contentId", "subContentId", "subDataResourceTypeId", "mimeTypeId", "whenMap", "locale", "wrapTemplateId", "encloseWrapText", "nullThruDatesOnly", "globalNodeTrail"};
@SuppressWarnings("unchecked")
public Writer getWriter(final Writer out, Map args) {
final Environment env = Environment.getCurrentEnvironment();
final LocalDispatcher dispatcher = FreeMarkerWorker.getWrappedObject("dispatcher", env);
final HttpServletRequest request = FreeMarkerWorker.getWrappedObject("request", env);
final Map<String, Object> templateRoot = FreeMarkerWorker.createEnvironmentMap(env);
if (Debug.infoOn()) {
Debug.logInfo("in RenderSubContent, contentId(0):" + templateRoot.get("contentId"), module);
}
FreeMarkerWorker.getSiteParameters(request, templateRoot);
final Map<String, Object> savedValuesUp = new HashMap<String, Object>();
FreeMarkerWorker.saveContextValues(templateRoot, upSaveKeyNames, savedValuesUp);
FreeMarkerWorker.overrideWithArgs(templateRoot, args);
if (Debug.infoOn()) {
Debug.logInfo("in RenderSubContent, contentId(2):" + templateRoot.get("contentId"), module);
}
final String thisContentId = (String)templateRoot.get("contentId");
final String thisMapKey = (String)templateRoot.get("mapKey");
final String xmlEscape = (String)templateRoot.get("xmlEscape");
if (Debug.infoOn()) {
Debug.logInfo("in Render(0), thisSubContentId ." + thisContentId , module);
}
final boolean directAssocMode = UtilValidate.isNotEmpty(thisContentId) ? true : false;
if (Debug.infoOn()) {
Debug.logInfo("in Render(0), directAssocMode ." + directAssocMode , module);
}
final Map<String, Object> savedValues = new HashMap<String, Object>();
return new Writer(out) {
@Override
public void write(char cbuf[], int off, int len) {
}
@Override
public void flush() throws IOException {
out.flush();
}
@Override
public void close() throws IOException {
List<Map<String, ? extends Object>> globalNodeTrail = UtilGenerics.checkList(templateRoot.get("globalNodeTrail"));
if (Debug.infoOn()) {
Debug.logInfo("Render close, globalNodeTrail(2a):" + ContentWorker.nodeTrailToCsv(globalNodeTrail), "");
}
renderSubContent();
}
public void renderSubContent() throws IOException {
String mimeTypeId = (String) templateRoot.get("mimeTypeId");
Object localeObject = templateRoot.get("locale");
Locale locale = null;
if (localeObject == null) {
locale = UtilHttp.getLocale(request);
} else {
locale = UtilMisc.ensureLocale(localeObject);
}
String editRequestName = (String)templateRoot.get("editRequestName");
if (Debug.infoOn()) Debug.logInfo("in Render(3), editRequestName ." + editRequestName , module);
if (UtilValidate.isNotEmpty(editRequestName)) {
String editStyle = getEditStyle();
openEditWrap(out, editStyle);
}
FreeMarkerWorker.saveContextValues(templateRoot, saveKeyNames, savedValues);
try {
String txt = ContentWorker.renderSubContentAsText(dispatcher, thisContentId, thisMapKey, templateRoot, locale, mimeTypeId, true);
if ("true".equals(xmlEscape)) {
txt = UtilFormatOut.encodeXmlValue(txt);
}
out.write(txt);
if (Debug.infoOn()) Debug.logInfo("in RenderSubContent, after renderContentAsTextCache:", module);
} catch (GeneralException e) {
String errMsg = "Error rendering thisContentId:" + thisContentId + " msg:" + e.toString();
Debug.logError(e, errMsg, module);
}
FreeMarkerWorker.reloadValues(templateRoot, savedValues, env);
FreeMarkerWorker.reloadValues(templateRoot, savedValuesUp, env);
if (UtilValidate.isNotEmpty(editRequestName)) {
closeEditWrap(out, editRequestName);
}
}
public void openEditWrap(Writer out, String editStyle) throws IOException {
String divStr = "<div class=\"" + editStyle + "\">";
out.write(divStr);
}
public void closeEditWrap(Writer out, String editRequestName) throws IOException {
}
public String getEditStyle() {
String editStyle = (String)templateRoot.get("editStyle");
if (UtilValidate.isEmpty(editStyle)) {
editStyle = UtilProperties.getPropertyValue("content", "defaultEditStyle");
}
if (UtilValidate.isEmpty(editStyle)) {
editStyle = "buttontext";
}
return editStyle;
}
};
}
}
| {
"pile_set_name": "Github"
} |
{
"main": "./app/main.js",
"devDependencies": {
"electron": "^9.2.0",
"electron-builder": "^22.8.0"
},
"license": "GNU GPLv3",
"build": {
"appId": "Ahmyth.android.rat",
"win": {
"publisherName": "AhMyth",
"icon": "build/icon.ico"
},
"asarUnpack": "**/app/Factory/**/*"
},
"scripts": {
"start": "npx electron ./app",
"clean": "rm -rf ./dist",
"build": "npm run build:linux && npm run build:win",
"build:linux": "npm run build:linux32 && npm run build:linux64",
"build:linux32": "npx electron-builder --linux deb --ia32",
"build:linux64": "npx electron-builder --linux deb --x64",
"build:win": "npm run build:win32 && npm run build:win64",
"build:win32": "npx electron-builder --win --ia32",
"build:win64": "npx electron-builder --win --x64"
},
"dependencies": {}
}
| {
"pile_set_name": "Github"
} |
module NavigationHelpers
# Maps a name to a path. Used by the
#
# When /^I go to (.+)$/ do |page_name|
#
# step definition in web_steps.rb
#
def path_to(page_name)
case page_name
when /the home\s?page/
'/'
# Add more mappings here.
# Here is an example that pulls values out of the Regexp:
#
# when /^(.*)'s profile page$/i
# user_profile_path(User.find_by_login($1))
else
raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
"Now, go and add a mapping in #{__FILE__}"
end
end
end
World(NavigationHelpers)
| {
"pile_set_name": "Github"
} |
{
"name": "Dirigo Design & Development",
"displayName": "Dirigo Design & Development",
"properties": [
"purchus.io"
]
} | {
"pile_set_name": "Github"
} |
// +build !appengine,!js,windows
package logrus
import (
"io"
"os"
"syscall"
)
func checkIfTerminal(w io.Writer) bool {
switch v := w.(type) {
case *os.File:
var mode uint32
err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode)
return err == nil
default:
return false
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2005 - 2014 by TESIS DYNAware GmbH
*/
package de.tesis.dynaware.grapheditor.demo.customskins.titled;
import java.util.ArrayList;
import java.util.List;
import javafx.css.PseudoClass;
import javafx.geometry.Point2D;
import javafx.geometry.Pos;
import javafx.scene.Cursor;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;
import javafx.scene.shape.Rectangle;
import de.tesis.dynaware.grapheditor.Commands;
import de.tesis.dynaware.grapheditor.GConnectorSkin;
import de.tesis.dynaware.grapheditor.GNodeSkin;
import de.tesis.dynaware.grapheditor.demo.utils.AwesomeIcon;
import de.tesis.dynaware.grapheditor.model.GNode;
import de.tesis.dynaware.grapheditor.utils.GeometryUtils;
/**
* A grey node with a navy title-bar for the 'titled-skins' theme.
*/
public class TitledNodeSkin extends GNodeSkin {
private static final String TITLE_TEXT = "Node ";
private static final String STYLE_CLASS_BORDER = "titled-node-border";
private static final String STYLE_CLASS_BACKGROUND = "titled-node-background";
private static final String STYLE_CLASS_SELECTION_HALO = "titled-node-selection-halo";
private static final String STYLE_CLASS_HEADER = "titled-node-header";
private static final String STYLE_CLASS_TITLE = "titled-node-title";
private static final String STYLE_CLASS_BUTTON = "titled-node-close-button";
private static final PseudoClass PSEUDO_CLASS_SELECTED = PseudoClass.getPseudoClass("selected");
private static final double HALO_OFFSET = 5;
private static final double HALO_CORNER_SIZE = 10;
private static final double MIN_WIDTH = 81;
private static final double MIN_HEIGHT = 81;
private static final int BORDER_WIDTH = 1;
private static final int HEADER_HEIGHT = 20;
private final Rectangle selectionHalo = new Rectangle();
private VBox contentRoot = new VBox();
private HBox header = new HBox();
private Label title = new Label();
private final List<GConnectorSkin> inputConnectorSkins = new ArrayList<>();
private final List<GConnectorSkin> outputConnectorSkins = new ArrayList<>();
private final Rectangle border = new Rectangle();
/**
* Creates a new {@link TitledNodeSkin} instance.
*
* @param node the {link GNode} this skin is representing
*/
public TitledNodeSkin(final GNode node) {
super(node);
border.getStyleClass().setAll(STYLE_CLASS_BORDER);
border.widthProperty().bind(getRoot().widthProperty());
border.heightProperty().bind(getRoot().heightProperty());
getRoot().getChildren().add(border);
getRoot().setMinSize(MIN_WIDTH, MIN_HEIGHT);
addSelectionHalo();
addSelectionListener();
createContent();
contentRoot.addEventFilter(MouseEvent.MOUSE_DRAGGED, this::filterMouseDragged);
}
@Override
public void initialize() {
super.initialize();
title.setText(TITLE_TEXT + getNode().getId());
}
@Override
public void setConnectorSkins(final List<GConnectorSkin> connectorSkins) {
removeAllConnectors();
inputConnectorSkins.clear();
outputConnectorSkins.clear();
if (connectorSkins != null) {
for (final GConnectorSkin connectorSkin : connectorSkins) {
final boolean isInput = connectorSkin.getConnector().getType().contains("input");
final boolean isOutput = connectorSkin.getConnector().getType().contains("output");
if (isInput) {
inputConnectorSkins.add(connectorSkin);
} else if (isOutput) {
outputConnectorSkins.add(connectorSkin);
}
if (isInput || isOutput) {
getRoot().getChildren().add(connectorSkin.getRoot());
}
}
}
setConnectorsSelected(isSelected());
}
@Override
public void layoutConnectors() {
layoutLeftAndRightConnectors();
layoutSelectionHalo();
}
@Override
public Point2D getConnectorPosition(final GConnectorSkin connectorSkin) {
final Node connectorRoot = connectorSkin.getRoot();
final double x = connectorRoot.getLayoutX() + connectorSkin.getWidth() / 2;
final double y = connectorRoot.getLayoutY() + connectorSkin.getHeight() / 2;
if (inputConnectorSkins.contains(connectorSkin)) {
return new Point2D(x, y);
} else {
// Subtract 1 to align start-of-connection correctly. Compensation for rounding errors?
return new Point2D(x - 1, y);
}
}
/**
* Creates the content of the node skin - header, title, close button, etc.
*/
private void createContent() {
header.getStyleClass().setAll(STYLE_CLASS_HEADER);
header.setAlignment(Pos.CENTER);
title.getStyleClass().setAll(STYLE_CLASS_TITLE);
final Region filler = new Region();
HBox.setHgrow(filler, Priority.ALWAYS);
final Button closeButton = new Button();
closeButton.getStyleClass().setAll(STYLE_CLASS_BUTTON);
header.getChildren().addAll(title, filler, closeButton);
contentRoot.getChildren().add(header);
getRoot().getChildren().add(contentRoot);
closeButton.setGraphic(AwesomeIcon.TIMES.node());
closeButton.setCursor(Cursor.DEFAULT);
closeButton.setOnAction(event -> Commands.removeNode(getGraphEditor().getModel(), getNode()));
contentRoot.minWidthProperty().bind(getRoot().widthProperty());
contentRoot.prefWidthProperty().bind(getRoot().widthProperty());
contentRoot.maxWidthProperty().bind(getRoot().widthProperty());
contentRoot.minHeightProperty().bind(getRoot().heightProperty());
contentRoot.prefHeightProperty().bind(getRoot().heightProperty());
contentRoot.maxHeightProperty().bind(getRoot().heightProperty());
contentRoot.setLayoutX(BORDER_WIDTH);
contentRoot.setLayoutY(BORDER_WIDTH);
contentRoot.getStyleClass().setAll(STYLE_CLASS_BACKGROUND);
}
/**
* Lays out all connectors.
*/
private void layoutLeftAndRightConnectors() {
final int inputCount = inputConnectorSkins.size();
final double inputOffsetY = (getRoot().getHeight() - HEADER_HEIGHT) / (inputCount + 1);
for (int i = 0; i < inputCount; i++) {
final GConnectorSkin inputSkin = inputConnectorSkins.get(i);
final Node connectorRoot = inputSkin.getRoot();
final double layoutX = GeometryUtils.moveOnPixel(0 - inputSkin.getWidth() / 2);
final double layoutY = GeometryUtils.moveOnPixel((i + 1) * inputOffsetY - inputSkin.getHeight() / 2);
connectorRoot.setLayoutX(layoutX);
connectorRoot.setLayoutY(layoutY + HEADER_HEIGHT);
}
final int outputCount = outputConnectorSkins.size();
final double outputOffsetY = (getRoot().getHeight() - HEADER_HEIGHT) / (outputCount + 1);
for (int i = 0; i < outputCount; i++) {
final GConnectorSkin outputSkin = outputConnectorSkins.get(i);
final Node connectorRoot = outputSkin.getRoot();
final double layoutX = GeometryUtils.moveOnPixel(getRoot().getWidth() - outputSkin.getWidth() / 2);
final double layoutY = GeometryUtils.moveOnPixel((i + 1) * outputOffsetY - outputSkin.getHeight() / 2);
connectorRoot.setLayoutX(layoutX);
connectorRoot.setLayoutY(layoutY + HEADER_HEIGHT);
}
}
/**
* Adds the selection halo and initializes some of its values.
*/
private void addSelectionHalo() {
getRoot().getChildren().add(selectionHalo);
selectionHalo.setManaged(false);
selectionHalo.setMouseTransparent(false);
selectionHalo.setVisible(false);
selectionHalo.setLayoutX(-HALO_OFFSET);
selectionHalo.setLayoutY(-HALO_OFFSET);
selectionHalo.getStyleClass().add(STYLE_CLASS_SELECTION_HALO);
}
/**
* Lays out the selection halo based on the current width and height of the node skin region.
*/
private void layoutSelectionHalo() {
if (selectionHalo.isVisible()) {
selectionHalo.setWidth(getRoot().getWidth() + 2 * HALO_OFFSET);
selectionHalo.setHeight(getRoot().getHeight() + 2 * HALO_OFFSET);
final double cornerLength = 2 * HALO_CORNER_SIZE;
final double xGap = getRoot().getWidth() - 2 * HALO_CORNER_SIZE + 2 * HALO_OFFSET;
final double yGap = getRoot().getHeight() - 2 * HALO_CORNER_SIZE + 2 * HALO_OFFSET;
selectionHalo.setStrokeDashOffset(HALO_CORNER_SIZE);
selectionHalo.getStrokeDashArray().setAll(cornerLength, yGap, cornerLength, xGap);
}
}
/**
* Adds a listener to react to whether the node is selected or not and change the style accordingly.
*/
private void addSelectionListener() {
selectedProperty().addListener((v, o, n) -> {
if (n) {
selectionHalo.setVisible(true);
layoutSelectionHalo();
contentRoot.pseudoClassStateChanged(PSEUDO_CLASS_SELECTED, true);
getRoot().toFront();
} else {
selectionHalo.setVisible(false);
contentRoot.pseudoClassStateChanged(PSEUDO_CLASS_SELECTED, false);
}
setConnectorsSelected(n);
});
}
/**
* Removes any input and output connectors from the list of children, if they exist.
*/
private void removeAllConnectors() {
for (final GConnectorSkin connectorSkin : inputConnectorSkins) {
getRoot().getChildren().remove(connectorSkin.getRoot());
}
for (final GConnectorSkin connectorSkin : outputConnectorSkins) {
getRoot().getChildren().remove(connectorSkin.getRoot());
}
}
/**
* Adds or removes the 'selected' pseudo-class from all connectors belonging to this node.
*
* @param isSelected {@code true} to add the 'selected' pseudo-class, {@code false} to remove it
*/
private void setConnectorsSelected(final boolean isSelected) {
for (final GConnectorSkin skin : inputConnectorSkins) {
if (skin instanceof TitledConnectorSkin) {
((TitledConnectorSkin) skin).setSelected(isSelected);
}
}
for (final GConnectorSkin skin : outputConnectorSkins) {
if (skin instanceof TitledConnectorSkin) {
((TitledConnectorSkin) skin).setSelected(isSelected);
}
}
}
/**
* Stops the node being dragged if it isn't selected.
*
* @param event a mouse-dragged event on the node
*/
private void filterMouseDragged(final MouseEvent event) {
if (event.isPrimaryButtonDown() && !isSelected()) {
event.consume();
}
}
}
| {
"pile_set_name": "Github"
} |
# User Guide
## Installation
### Pre-requisites
#### Software
- NodeJS (required)
- Angular (required)
- SonarQube (required)
- Sonar-scanner (required)
- Mongodb (required)
- Git (required)
#### Installing pre-requisites
NodeJS:<br>
https://nodejs.org/en/download/
Angular:<br>
https://angular.io/
SonarQube:<br>
https://www.sonarqube.org/downloads/
Sonar-Scanner:<br>
https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/
Mongodb:<br>
https://www.mongodb.com/download-center/community
### Procedure for installing
#### Step 1 :
### Get the resource file from github
Clone the project :
`$ git clone https://github.com/OWASP/RiskAssessmentFramework.git`
Or
Download the project from : https://github.com/OWASP/RiskAssessmentFramework/archive/master.zip
#### Step 2:
Start the mongodb server and make sure it's running on `port : 28017`
#### Step 3:
Start the sonarqube server on `port : 9000`
#### Step 4:
Make sure `sonar-scanner` is installed and add included in the environment variables
#### Step 5:
Make sure `sonar-scanner` is installed and included in the **environment variables**
#### Step 6:
Goto the cloned repository folder and change directory to "api" ```cd api``` when you are inside the directory run : ```npm install``` which will install the required dependencies
#### Step 6:
After successfully executing ```npm install``` start the node server using ```npm start```.
#### Step 7:
Change the directory to the gui folder from the root directory. `cd gui` from the **root directory**
#### Step 8:
when you are inside the gui directory use ```npm install``` to install all the relevant dependencies.
#### Step 9:
After completing the installation use ```ng serve``` or ```npm start``` to run the Angular App.
#### Step 10:
After the angular app successfully compiled open your browser and goto your localhost:4200
#### Step 11:
Use the below credentials to login to the dashboard
```
username : admin
password : test1234
```
## [Guide to use the dashboard](dashboard_guide.pdf) | {
"pile_set_name": "Github"
} |
from jadi import component
from aj.api.http import url, HttpPlugin
from aj.auth import authorize
from aj.api.endpoint import endpoint, EndpointError
import aj
import gevent
@component(HttpPlugin)
class Handler(HttpPlugin):
def __init__(self, context):
self.context = context
@url(r'/api/session_list/list')
@endpoint(api=True)
def handle_api_list_sessions(self, http_context):
if http_context.method == 'GET':
self.context.worker.update_sessionlist()
gevent.sleep(1)
return aj.sessions
| {
"pile_set_name": "Github"
} |
KISSY.add("brix/core/demolet", function(S, Pagelet, IO, Node) {
var $ = Node.all;
//存储已经加载的CSS
var hasLoadCSS = {};
/**
* 同步载入样式,保证串行加载
* @param {String} path css路径
* @ignore
*/
function loadCSS(path) {
if(hasLoadCSS[path]) {
return false;
}
hasLoadCSS[path] = true;
IO({
url: path,
dataType: 'text',
async: false,
complete: function(d, textStatus, xhrObj) {
if(textStatus == 'success') {
$('<style>' + d + '</style>').appendTo('head');
}
}
});
}
/**
* 同步获取默认模板和数据,多在demo页构建中使用
* @param {String} tmpl 模板文件
* @param {Object} data 数据对象
* @param {String} s 分割符号,默认‘@’
* @private
* @return {Object} 模板和数据的对象{tmpl:tmpl,data:data}
*/
function getTmplData(tmpl, data, s) {
s = s || '@';
data = data || {};
var reg = new RegExp('\\{\\{' + s + '(.+)?\\}\\}', "ig");
tmpl = tmpl.replace(reg, function($1, $2) {
var str = '';
var p = $2.replace(/\//ig, '_').replace(/\./ig, '_');
data[p] = data[p] || {};
//获取模板
IO({
url: $2 + 'template.html',
dataType: 'html',
async: false,
success: function(d, textStatus, xhrObj) {
str = '{{#' + p + '}}' + d + '{{/' + p + '}}';
}
});
//获取数据
IO({
url: $2 + 'data.json',
async: false,
dataType: 'json',
success: function(d, textStatus, xhrObj) {
for(var k in d) {
data[p][k] = d[k];
}
}
});
return str;
});
return {
tmpl: tmpl,
data: data
};
}
/**
* Brix Demolet 用来构建约定的template.html和data.json的占坑demo页面
* @extends Brix.Pagelet
* @class Brix.Demolet
*/
function Demolet() {
var self = this;
//在组件渲染前,加载所有的css
self.on('beforeAddBehavior', function(ev) {
S.each(self.get('projectCss'), function(path) {
loadCSS(path);
});
var useList = ev.useList;
S.each(useList, function(path) {
var arr = path.split('/');
if(S.startsWith(path,'brix/')) {
S.use(path + arr[arr.length-2]+'.css');
} else {
var length = 3;
if(S.startsWith(path,'imports/')) {
length = 4;
}
if(arr.length > length) {
arr.splice(arr.length - 2);
loadCSS(arr.join('/') + '/index.css');
}
loadCSS(path + 'index.css');
}
});
});
Demolet.superclass.constructor.apply(this, arguments);
}
Demolet.ATTRS = {
/**
* 项目的样式
* @cfg {Array}
*/
projectCss: {
value: ['styles/style.css'],
setter:function(v){
if(S.isArray(v)){
return v;
}else{
return [v];
}
}
},
/**
* 分割符号
* @cfg {String}
*/
s: {
value: '@'
},
/**
* 模板,如果外部需要传入data,请把data属性设置在前,因为这个内部会会对data进行处理
* @cfg {String}
*/
tmpl: {
setter: function(v) {
var self = this,
data = self.get('data') || {};
var tmplData = getTmplData(v, data, self.get('s'));
self.set('data', tmplData.data);
return tmplData.tmpl;
}
}
};
S.extend(Demolet, Pagelet, {
});
return Demolet;
}, {
requires: ['./pagelet', 'ajax', 'node']
}); | {
"pile_set_name": "Github"
} |
/* $OpenBSD: utils.c,v 1.2 2017/07/27 15:08:37 bluhm Exp $ */
/* Written by Otto Moerbeek, 2006, Public domain. */
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <err.h>
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "utils.h"
void
createfiles(int nfiles)
{
int i, fd;
char file[PATH_MAX];
mkdir("d", 0755);
for (i = 0; i < nfiles; i++) {
snprintf(file, sizeof file, "d/%d", i);
if ((fd = open(file, O_CREAT | O_WRONLY, 0600)) == -1)
err(1, "open %s", file);
close(fd);
}
}
void
delfiles(void)
{
DIR *dp;
struct dirent *f;
char file[PATH_MAX];
dp = opendir("d");
if (dp == NULL)
err(1, "opendir");
while ((f = readdir(dp))) {
if (strcmp(f->d_name, ".") == 0 ||
strcmp(f->d_name, "..") == 0)
continue;
snprintf(file, sizeof file, "d/%s", f->d_name);
if (unlink(file) == -1)
err(1, "unlink %s", f->d_name);
}
closedir(dp);
if (rmdir("d") == -1)
err(1, "rmdir");
}
| {
"pile_set_name": "Github"
} |
module Cryptoexchange::Exchanges
module Kkcoin
module Services
class Market < Cryptoexchange::Services::Market
class << self
def supports_individual_ticker_query?
false
end
end
def fetch
output = super(ticker_url)
adapt_all(output)
end
def ticker_url
"#{Cryptoexchange::Exchanges::Kkcoin::Market::API_URL}/allticker"
end
def adapt_all(output)
output.map do |ticker|
base, target = ticker[0].split("_")
market_pair = Cryptoexchange::Models::MarketPair.new(
base: base,
target: target,
market: Kkcoin::Market::NAME
)
adapt(market_pair, ticker)
end
end
# [
# "KK_ETH", // Symbol -> 0
# "0.00000523", // Best bid price -> 1
# "30582", // Best bid amount -> 2
# "0.00000526", // Best ask price -> 3
# "321179", // Best ask amount -> 4
# "-0.00000005", // Price change of last 24 hours -> 5
# "-0.0095", // Price change rate -> 6
# "0.00000522", // Last trade price -> 7
# "232.88", // Daily volume -> 8
# "0.00000530", // Daily high -> 9
# "0.00000495", // Daily low -> 10
# "46576000.00" // Daily amount -> 11
# ]
def adapt(market_pair, output)
ticker = Cryptoexchange::Models::Ticker.new
ticker.base = market_pair.base
ticker.target = market_pair.target
ticker.market = Kkcoin::Market::NAME
ticker.last = NumericHelper.to_d(output[7])
ticker.bid = NumericHelper.to_d(output[1])
ticker.ask = NumericHelper.to_d(output[3])
ticker.high = NumericHelper.to_d(output[9])
ticker.low = NumericHelper.to_d(output[10])
ticker.change = NumericHelper.to_d(output[6])
ticker.volume = NumericHelper.to_d(output[11])
ticker.timestamp = nil
ticker.payload = output
ticker
end
end
end
end
end
| {
"pile_set_name": "Github"
} |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.nifi.key;
import java.io.Serializable;
/**
* An signing key for a NiFi user.
*/
public class Key implements Serializable {
private int id;
private String identity;
private String key;
/**
* The key id.
*
* @return the id
*/
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
/**
* The identity of the user this key is associated with.
*
* @return the identity
*/
public String getIdentity() {
return identity;
}
public void setIdentity(String identity) {
this.identity = identity;
}
/**
* The signing key.
*
* @return the signing key
*/
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public Key(int id, String identity, String key) {
this.id = id;
this.identity = identity;
this.key = key;
}
public Key() {
}
}
| {
"pile_set_name": "Github"
} |
# is-windows [](https://www.npmjs.com/package/is-windows) [](https://npmjs.org/package/is-windows) [](https://npmjs.org/package/is-windows) [](https://travis-ci.org/jonschlinkert/is-windows)
> Returns true if the platform is windwows.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save is-windows
```
## Heads up!
As of `v0.2.0` this module always returns a function.
## Usage
```js
var isWindows = require('is-windows');
isWindows();
//=> returns true if the platform is windows
```
## About
### Related projects
* [is-absolute](https://www.npmjs.com/package/is-absolute): Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute. | [homepage](https://github.com/jonschlinkert/is-absolute "Polyfill for node.js `path.isAbolute`. Returns true if a file path is absolute.")
* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet")
* [is-relative](https://www.npmjs.com/package/is-relative): Returns `true` if the path appears to be relative. | [homepage](https://github.com/jonschlinkert/is-relative "Returns `true` if the path appears to be relative.")
* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.")
* [window-size](https://www.npmjs.com/package/window-size): Reliable way to to get the height and width of the terminal/console in a node.js… [more](https://github.com/jonschlinkert/window-size) | [homepage](https://github.com/jonschlinkert/window-size "Reliable way to to get the height and width of the terminal/console in a node.js environment.")
### Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
### Contributors
| **Commits** | **Contributor**<br/> |
| --- | --- |
| 8 | [jonschlinkert](https://github.com/jonschlinkert) |
| 1 | [gucong3000](https://github.com/gucong3000) |
### Building docs
_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_
To generate the readme and API documentation with [verb](https://github.com/verbose/verb):
```sh
$ npm install -g verb verb-generate-readme && verb
```
### Running tests
Install dev dependencies:
```sh
$ npm install -d && npm test
```
### Author
**Jon Schlinkert**
* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
### License
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT license](https://github.com/jonschlinkert/is-windows/blob/master/LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.2.0, on December 08, 2016._ | {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2000-2004,2011,2014 Apple Inc. All Rights Reserved.
*
* The contents of this file constitute Original Code as defined in and are
* subject to the Apple Public Source License Version 1.2 (the 'License').
* You may not use this file except in compliance with the License. Please obtain
* a copy of the License at http://www.apple.com/publicsource and read it before
* using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
* OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
* LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
* specific language governing rights and limitations under the License.
*/
//
// dliterators - DL/MDS table access as C++ iterators
//
// This is currently an almost read-only implementation.
// (You can erase but you can't create or modify.)
//
#ifndef _H_CDSA_CLIENT_DLITERATORS
#define _H_CDSA_CLIENT_DLITERATORS
#include <security_utilities/threading.h>
#include <security_utilities/globalizer.h>
#include <security_utilities/refcount.h>
#include <security_cdsa_utilities/cssmalloc.h>
#include <security_cdsa_utilities/cssmpods.h>
#include <security_cdsa_utilities/cssmerrors.h>
#include <security_cdsa_utilities/cssmdb.h>
#include <security_cdsa_client/dlquery.h>
namespace Security {
namespace CssmClient {
//
// An abstract interface to a (partial) DLDb-style object.
// This is a particular (open) database that you can perform CSSM database
// operations on.
//
class DLAccess {
public:
virtual ~DLAccess();
virtual CSSM_HANDLE dlGetFirst(const CSSM_QUERY &query,
CSSM_DB_RECORD_ATTRIBUTE_DATA &attributes, CSSM_DATA *data,
CSSM_DB_UNIQUE_RECORD *&id) = 0;
virtual bool dlGetNext(CSSM_HANDLE handle,
CSSM_DB_RECORD_ATTRIBUTE_DATA &attributes, CSSM_DATA *data,
CSSM_DB_UNIQUE_RECORD *&id) = 0;
virtual void dlAbortQuery(CSSM_HANDLE handle) = 0;
virtual void dlFreeUniqueId(CSSM_DB_UNIQUE_RECORD *id) = 0;
virtual void dlDeleteRecord(CSSM_DB_UNIQUE_RECORD *id) = 0;
virtual Allocator &allocator() = 0;
};
//
// Abstract Database Records.
// Each database record type has a subclass of this.
// These are RefCounted; you can hang on to them as long as you like,
// stick (RefPointers to) them into maps, and so on. Just go for it.
//
class Record : public RefCount, public CssmAutoData {
public:
Record() : CssmAutoData(Allocator::standard(Allocator::sensitive)) { }
Record(const char * const * attributeNames); // sets mAttributes
virtual ~Record();
static const CSSM_DB_RECORDTYPE recordType = CSSM_DL_DB_RECORD_ANY;
void addAttributes(const char * const * attributeNames); // add more
// raw attribute access
CssmDbRecordAttributeData &attributes() { return mAttributes; }
const CssmDbRecordAttributeData &attributes() const { return mAttributes; }
CSSM_DB_RECORDTYPE actualRecordType() const { return mAttributes.recordType(); }
CssmAutoData &recordData() { return *this; } // my data nature
protected:
CssmAutoDbRecordAttributeData mAttributes;
};
//
// TableBase is an implementation class for template Table below.
// Do not use it directly (you'll be sorry).
// Continue reading at template Table below.
//
class TableBase {
public:
DLAccess &database;
CSSM_DB_RECORDTYPE recordType() const { return mRecordType; }
void recordType(CSSM_DB_RECORDTYPE t) { mRecordType = t; } // override
// erase all elements matching a query
uint32 erase(const CSSM_QUERY &query);
uint32 erase(const Query &query);
protected:
TableBase(DLAccess &source, CSSM_DB_RECORDTYPE type, bool getData = true);
class AccessRef : public RefCount {
protected:
AccessRef() : mAccess(NULL) { }
AccessRef(DLAccess *ac) : mAccess(ac) { }
DLAccess *mAccess;
};
struct Handle : public AccessRef {
CSSM_HANDLE query;
Handle(DLAccess *ac, CSSM_HANDLE q) : AccessRef(ac), query(q) { }
~Handle();
};
struct Uid : public AccessRef {
CSSM_DB_UNIQUE_RECORD *uid;
Uid(DLAccess *ac, CSSM_DB_UNIQUE_RECORD *id) : AccessRef(ac), uid(id) { }
~Uid();
};
class Iterator {
public:
const CSSM_DB_UNIQUE_RECORD *recordHandle() const
{ assert(mUid); return mUid->uid; }
protected:
Iterator() { }
Iterator(DLAccess *ac, CSSM_HANDLE query, CSSM_DB_UNIQUE_RECORD *id,
Record *record, bool getData);
void advance(Record *newRecord); // generic operator ++ helper
DLAccess *mAccess; // data source
RefPointer<Handle> mQuery; // DL/MDS query handle
RefPointer<Uid> mUid; // record unique identifier
RefPointer<Record> mRecord; // current record value
bool mGetData; // ask for data on iteration
};
protected:
CSSM_DB_RECORDTYPE mRecordType; // CSSM/MDS record type
bool mGetData; // ask for record data on primary iteration
};
//
// A Table represents a single relation in a database (of some kind)
//
template <class RecordType>
class Table : private TableBase {
typedef RefPointer<RecordType> RecPtr;
public:
Table(DLAccess &source) : TableBase(source, RecordType::recordType) { }
Table(DLAccess &source, CSSM_DB_RECORDTYPE type) : TableBase(source, type) { }
Table(DLAccess &source, bool getData) : TableBase(source, RecordType::recordType, getData) { }
public:
class iterator : public Iterator,
public std::iterator<forward_iterator_tag, RefPointer<RecordType> > {
friend class Table;
public:
iterator() { }
bool operator == (const iterator &other) const
{ return mUid.get() == other.mUid.get(); }
bool operator != (const iterator &other) const
{ return mUid.get() != other.mUid.get(); }
RecPtr operator * () const { return static_cast<RecordType *>(mRecord.get()); }
RecordType *operator -> () const { return static_cast<RecordType *>(mRecord.get()); }
iterator operator ++ () { advance(new RecordType); return *this; }
iterator operator ++ (int) { iterator old = *this; operator ++ (); return old; }
void erase();
private:
iterator(DLAccess *ac, CSSM_HANDLE query, CSSM_DB_UNIQUE_RECORD *id,
RecordType *record, bool getData)
: Iterator(ac, query, id, record, getData) { }
};
public:
iterator begin();
iterator find(const CSSM_QUERY &query);
iterator find(const Query &query);
iterator end() { return iterator(); }
RecPtr fetch(const Query &query, CSSM_RETURN err = CSSM_OK) // one-stop shopping
{ return fetchFirst(find(query), err); }
RecPtr fetch(CSSM_RETURN err = CSSM_OK) // fetch first of type
{ return fetchFirst(begin(), err); }
// erase all records matching a query
void erase(const CSSM_QUERY &query);
void erase(const Query &query);
void erase(iterator it) { it.erase(); }
private:
iterator startQuery(const CssmQuery &query, bool getData);
RecPtr fetchFirst(iterator it, CSSM_RETURN err);
};
//
// Template out-of-line functions
//
template <class RecordType>
typename Table<RecordType>::iterator Table<RecordType>::begin()
{
return startQuery(CssmQuery(mRecordType), mGetData);
}
template <class RecordType>
typename Table<RecordType>::iterator Table<RecordType>::find(const CSSM_QUERY &query)
{
return startQuery(CssmQuery(CssmQuery::overlay(query), mRecordType), mGetData);
}
template <class RecordType>
typename Table<RecordType>::iterator Table<RecordType>::find(const Query &query)
{
return startQuery(CssmQuery(query.cssmQuery(), mRecordType), mGetData);
}
template <class RecordType>
RefPointer<RecordType> Table<RecordType>::fetchFirst(iterator it, CSSM_RETURN err)
{
if (it == end())
if (err)
CssmError::throwMe(err);
else
return NULL;
else
return *it;
}
template <class RecordType>
typename Table<RecordType>::iterator Table<RecordType>::startQuery(const CssmQuery &query, bool getData)
{
RefPointer<RecordType> record = new RecordType;
CSSM_DB_UNIQUE_RECORD *id;
CssmAutoData data(database.allocator());
CSSM_HANDLE queryHandle = database.dlGetFirst(query, record->attributes(),
getData ? &data.get() : NULL, id);
if (queryHandle == CSSM_INVALID_HANDLE)
return end(); // not found
if (getData)
record->recordData() = data;
return iterator(&database, queryHandle, id, record, getData);
}
template <class RecordType>
void Table<RecordType>::iterator::erase()
{
mAccess->dlDeleteRecord(mUid->uid);
mUid->uid = NULL;
}
} // end namespace CssmClient
} // end namespace Security
#endif // _H_CDSA_CLIENT_DLITERATORS
| {
"pile_set_name": "Github"
} |
import filecmp
import os
import platform
import posixpath
import tempfile
import pytest
from dvc.info import get_fs_type
from dvc.system import System
here = os.path.abspath(os.path.dirname(__file__))
def test_isdir(ssh_connection):
assert ssh_connection.isdir(here)
assert not ssh_connection.isdir(__file__)
def test_exists(ssh_connection):
assert not ssh_connection.exists("/path/to/non/existent/file")
assert ssh_connection.exists(__file__)
def test_isfile(ssh_connection):
assert ssh_connection.isfile(__file__)
assert not ssh_connection.isfile(here)
def test_makedirs(tmp_path, ssh_connection):
tmp = tmp_path.absolute().as_posix()
path = posixpath.join(tmp, "dir", "subdir")
ssh_connection.makedirs(path)
assert os.path.isdir(path)
def test_remove_dir(tmp_path, ssh_connection):
dpath = tmp_path / "dir"
dpath.mkdir()
(dpath / "file").write_text("file")
(dpath / "subdir").mkdir()
(dpath / "subdir" / "subfile").write_text("subfile")
ssh_connection.remove(dpath.absolute().as_posix())
assert not dpath.exists()
def test_walk(tmp_path, ssh_connection):
root_path = tmp_path
dir_path = root_path / "dir"
subdir_path = dir_path / "subdir"
dir_path.mkdir()
subdir_path.mkdir()
root_data_path = root_path / "root_data"
dir_data_path = dir_path / "dir_data"
subdir_data_path = subdir_path / "subdir_data"
with root_data_path.open("w+") as fobj:
fobj.write("")
with dir_data_path.open("w+") as fobj:
fobj.write("")
with subdir_data_path.open("w+") as fobj:
fobj.write("")
entries = [
dir_path,
subdir_path,
root_data_path,
dir_data_path,
subdir_data_path,
]
expected = {entry.absolute().as_posix() for entry in entries}
paths = set()
for root, dirs, files in ssh_connection.walk(
root_path.absolute().as_posix()
):
for entry in dirs + files:
paths.add(posixpath.join(root, entry))
assert paths == expected
@pytest.mark.skipif(
get_fs_type(tempfile.gettempdir())[0] not in ["xfs", "apfs", "btrfs"],
reason="Reflinks only work in specified file systems",
)
def test_reflink(tmp_dir, ssh_connection):
tmp_dir.gen("foo", "foo content")
ssh_connection.reflink("foo", "link")
assert filecmp.cmp("foo", "link")
assert not System.is_symlink("link")
assert not System.is_hardlink("link")
@pytest.mark.skipif(
platform.system() == "Windows",
reason="sftp symlink is not supported on Windows",
)
def test_symlink(tmp_dir, ssh_connection):
tmp_dir.gen("foo", "foo content")
ssh_connection.symlink("foo", "link")
assert System.is_symlink("link")
@pytest.mark.skipif(
platform.system() == "Windows",
reason="hardlink is temporarily not supported on Windows",
)
def test_hardlink(tmp_dir, ssh_connection):
tmp_dir.gen("foo", "foo content")
ssh_connection.hardlink("foo", "link")
assert System.is_hardlink("link")
@pytest.mark.skipif(
platform.system() == "Windows",
reason="copy is temporarily not supported on Windows",
)
def test_copy(tmp_dir, ssh_connection):
tmp_dir.gen("foo", "foo content")
ssh_connection.copy("foo", "link")
assert filecmp.cmp("foo", "link")
def test_move(tmp_dir, ssh_connection):
tmp_dir.gen("foo", "foo content")
ssh_connection.move("foo", "copy")
assert os.path.exists("copy")
assert not os.path.exists("foo")
| {
"pile_set_name": "Github"
} |
<testcase>
<info>
<keywords>
SFTP
quote
NOBODY
</keywords>
</info>
#
# Server-side
<reply>
<data sendzero="yes">
</data>
</reply>
#
# Client-side
<client>
<server>
sftp
</server>
<name>
SFTP quote remove file with NOBODY
</name>
<command>
--key curl_client_key --pubkey curl_client_key.pub -u %USER: -I -Q "rm %PWD/log/file627.txt" sftp://%HOSTIP:%SSHPORT
</command>
<postcheck>
perl %SRCDIR/libtest/test610.pl gone %PWD/log/test627.txt
</postcheck>
<file name="log/file627.txt">
Dummy test file for remove test
</file>
</client>
#
# Verify data after the test has been "shot"
<verify>
<valgrind>
disable
</valgrind>
<protocol>
</protocol>
</verify>
</testcase>
| {
"pile_set_name": "Github"
} |
import MoveableManager from "../../src/react-moveable/MoveableManager";
import { createRotateMatrix, caculate, minus, plus, createIdentityMatrix } from "../../src/react-moveable/matrix";
import { RotatableProps } from "../../src/react-moveable";
import { getClientRect } from "../../src/react-moveable/utils";
function add(
matrix: number[],
inverseMatrix: number[],
startIndex: number,
endIndex: number,
fromStart: number,
k: number,
) {
for (let i = startIndex; i < endIndex; ++i) {
matrix[i] += matrix[fromStart + i - startIndex] * k;
inverseMatrix[i] += inverseMatrix[fromStart + i - startIndex] * k;
}
}
function swap(
matrix: number[],
inverseMatrix: number[],
startIndex: number,
endIndex: number,
fromStart: number,
) {
for (let i = startIndex; i < endIndex; ++i) {
const v = matrix[i];
const iv = inverseMatrix[i];
matrix[i] = matrix[fromStart + i - startIndex];
matrix[fromStart + i - startIndex] = v;
inverseMatrix[i] = inverseMatrix[fromStart + i - startIndex];
inverseMatrix[fromStart + i - startIndex] = iv;
}
}
function divide(
matrix: number[],
inverseMatrix: number[],
startIndex: number,
endIndex: number,
k: number,
) {
for (let i = startIndex; i < endIndex; ++i) {
matrix[i] /= k;
inverseMatrix[i] /= k;
}
}
function multiply(matrix: number[], matrix2: number[], n: number) {
const newMatrix: number[] = [];
// n * m X m * k
const m = matrix.length / n;
const k = matrix2.length / m;
if (!m) {
return matrix2;
} else if (!k) {
return matrix;
}
for (let i = 0; i < n; ++i) {
for (let j = 0; j < k; ++j) {
newMatrix[i * k + j] = 0;
for (let l = 0; l < m; ++l) {
newMatrix[i * k + j] += matrix[i * m + l] * matrix2[l * k + j];
}
}
}
// n * k
return newMatrix;
}
function invert(
matrix: number[],
n: number = Math.sqrt(matrix.length),
) {
const newMatrix = matrix.slice();
const inverseMatrix = createIdentityMatrix(n);
for (let i = 0; i < n; ++i) {
const startIndex = n * i;
const endIndex = n * (i + 1);
const identityIndex = startIndex + i;
if (newMatrix[identityIndex] === 0) {
for (let j = i + 1; j < n; ++j) {
if (newMatrix[n * j + i]) {
swap(newMatrix, inverseMatrix, startIndex, endIndex, n * j);
break;
}
}
}
if (newMatrix[identityIndex]) {
divide(newMatrix, inverseMatrix, startIndex, endIndex, newMatrix[identityIndex]);
} else {
// no inverse matrix
return [];
}
for (let j = 0; j < n; ++j) {
const targetStartIndex = n * j;
const targetEndIndex = targetStartIndex + n;
const targetIndex = targetStartIndex + i;
const target = newMatrix[targetIndex];
if (target === 0 || i === j) {
continue;
}
add(newMatrix, inverseMatrix, targetStartIndex, targetEndIndex, startIndex, -target);
}
}
return inverseMatrix;
}
function convertDimension(matrix: number[], n: number = Math.sqrt(matrix.length), m: number) {
// n < m
if (n === m) {
return matrix;
}
const newMatrix = createIdentityMatrix(m);
const length = Math.min(n, m);
for (let i = 0; i < length - 1; ++i) {
for (let j = 0; j < length - 1; ++j) {
newMatrix[i * m + j] = matrix[i * n + j];
}
newMatrix[(i + 1) * m - 1] = matrix[(i + 1) * n - 1];
newMatrix[(m - 1) * m + i] = matrix[(n - 1) * n + i];
}
newMatrix[m * m - 1] = matrix[n * n - 1];
return newMatrix;
}
function transpose(matrix: number[], n: number = Math.sqrt(matrix.length)) {
const newMatrix: number[] = [];
for (let i = 0; i < n; ++i) {
for (let j = 0; j < n; ++j) {
newMatrix[j * n + i] = matrix[n * i + j];
}
}
return newMatrix;
}
export async function wait(time: number) {
return new Promise(resolve => {
setTimeout(resolve, time);
});
}
export function dispatchEvent(target: HTMLElement | SVGElement, type: string, client: number[]) {
target.dispatchEvent(new MouseEvent(type, {
clientX: client[0],
clientY: client[1],
cancelable: true,
bubbles: true,
}));
}
export function mousedown(target: HTMLElement | SVGElement, client: number[]) {
dispatchEvent(target, "mousedown", client);
}
export function mousemove(target: HTMLElement | SVGElement, client: number[]) {
dispatchEvent(target, "mousemove", client);
}
export function mouseup(target: HTMLElement | SVGElement, client: number[]) {
dispatchEvent(target, "mouseup", client);
}
export function rotateStart(moveable: MoveableManager<RotatableProps>) {
const rotationElement = moveable.controlBox.getElement().querySelector<HTMLElement>(".moveable-rotation")!;
const { left, top, width, height } = rotationElement.getBoundingClientRect();
const clientX = left + width / 2;
const clientY = top + height / 2;
const { origin } = moveable.state;
const rect = getClientRect(moveable.controlBox.getElement());
const absoluteOrigin = [
rect.left + origin[0],
rect.top + origin[1],
];
const client = [clientX, clientY];
mousedown(rotationElement, client);
return [rotationElement, client, absoluteOrigin];
}
export async function rotate(startInfo: any[], deg: number) {
const [rotationElement, startClient, absoluteOrigin] = startInfo;
const rad = deg / 180 * Math.PI;
const m = createRotateMatrix(rad, 3);
const dist = minus(startClient, absoluteOrigin);
const [offsetX, offsetY] = caculate(m, [dist[0], dist[1], 1]);
const client = plus(absoluteOrigin, [offsetX, offsetY]);
dispatchEvent(rotationElement, "mousemove", client);
}
export async function rotateEnd(startInfo: any[]) {
const [rotationElement] = startInfo;
dispatchEvent(rotationElement, "mouseup", [0, 0]);
}
export function helperMultiply(matrix: number[], matrix2: number[], n: number) {
const newMatrix: number[] = [];
// n * m X m * k
const m = matrix.length / n;
const k = matrix2.length / m;
if (!m) {
return matrix2;
} else if (!k) {
return matrix;
}
for (let i = 0; i < n; ++i) {
for (let j = 0; j < k; ++j) {
newMatrix[i * k + j] = 0;
for (let l = 0; l < m; ++l) {
newMatrix[i * k + j] += matrix[i * m + l] * matrix2[l * k + j];
}
}
}
// n * k
return newMatrix;
}
export function helperInvert(
matrix: number[],
n: number = Math.sqrt(matrix.length),
) {
const newMatrix = matrix.slice();
const inverseMatrix = createIdentityMatrix(n);
for (let i = 0; i < n; ++i) {
const startIndex = n * i;
const endIndex = n * (i + 1);
const identityIndex = startIndex + i;
if (newMatrix[identityIndex] === 0) {
for (let j = i + 1; j < n; ++j) {
if (newMatrix[n * j + i]) {
swap(newMatrix, inverseMatrix, startIndex, endIndex, n * j);
break;
}
}
}
if (newMatrix[identityIndex]) {
divide(newMatrix, inverseMatrix, startIndex, endIndex, newMatrix[identityIndex]);
} else {
// no inverse matrix
return [];
}
for (let j = 0; j < n; ++j) {
const targetStartIndex = n * j;
const targetEndIndex = targetStartIndex + n;
const targetIndex = targetStartIndex + i;
const target = newMatrix[targetIndex];
if (target === 0 || i === j) {
continue;
}
add(newMatrix, inverseMatrix, targetStartIndex, targetEndIndex, startIndex, -target);
}
}
return inverseMatrix;
}
export function helperCreateWarpMatrix(
pos0: number[],
pos1: number[],
pos2: number[],
pos3: number[],
nextPos0: number[],
nextPos1: number[],
nextPos2: number[],
nextPos3: number[],
) {
const [x0, y0] = pos0;
const [x1, y1] = pos1;
const [x2, y2] = pos2;
const [x3, y3] = pos3;
const [u0, v0] = nextPos0;
const [u1, v1] = nextPos1;
const [u2, v2] = nextPos2;
const [u3, v3] = nextPos3;
const matrix = [
x0, y0, 1, 0, 0, 0, -u0 * x0, -u0 * y0,
0, 0, 0, x0, y0, 1, -v0 * x0, -v0 * y0,
x1, y1, 1, 0, 0, 0, -u1 * x1, -u1 * y1,
0, 0, 0, x1, y1, 1, -v1 * x1, -v1 * y1,
x2, y2, 1, 0, 0, 0, -u2 * x2, -u2 * y2,
0, 0, 0, x2, y2, 1, -v2 * x2, -v2 * y2,
x3, y3, 1, 0, 0, 0, -u3 * x3, -u3 * y3,
0, 0, 0, x3, y3, 1, -v3 * x3, -v3 * y3,
];
const inverseMatrix = invert(matrix, 8);
if (!inverseMatrix.length) {
return [];
}
const h = multiply(inverseMatrix, [u0, v0, u1, v1, u2, v2, u3, v3], 8);
h[8] = 1;
return convertDimension(h, 3, 4);
}
export function helperCaculate(matrix: number[], matrix2: number[], n: number = matrix2.length) {
const result = multiply(matrix, matrix2, n);
const k = result[n - 1];
return result.map(v => v / k);
}
| {
"pile_set_name": "Github"
} |
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stdio.h>
int main(void) {
printf("Hello from prog.c\n");
return 0;
}
| {
"pile_set_name": "Github"
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_45) on Sun Sep 08 19:26:32 EDT 2013 -->
<TITLE>
BPCCBox (JHOVE Documentation)
</TITLE>
<META NAME="date" CONTENT="2013-09-08">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="BPCCBox (JHOVE Documentation)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html" title="class in edu.harvard.hul.ois.jhove.module.jpeg2000"><B>PREV CLASS</B></A>
<A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/CaptureResolutionBox.html" title="class in edu.harvard.hul.ois.jhove.module.jpeg2000"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?edu/harvard/hul/ois/jhove/module/jpeg2000/BPCCBox.html" target="_top"><B>FRAMES</B></A>
<A HREF="BPCCBox.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_edu.harvard.hul.ois.jhove.module.jpeg2000.JP2Box">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
edu.harvard.hul.ois.jhove.module.jpeg2000</FONT>
<BR>
Class BPCCBox</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html" title="class in edu.harvard.hul.ois.jhove.module.jpeg2000">edu.harvard.hul.ois.jhove.module.jpeg2000.BoxHolder</A>
<IMG SRC="../../../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html" title="class in edu.harvard.hul.ois.jhove.module.jpeg2000">edu.harvard.hul.ois.jhove.module.jpeg2000.JP2Box</A>
<IMG SRC="../../../../../../../resources/inherit.gif" ALT="extended by "><B>edu.harvard.hul.ois.jhove.module.jpeg2000.BPCCBox</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD>java.util.Iterator<java.lang.Object></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>BPCCBox</B><DT>extends <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html" title="class in edu.harvard.hul.ois.jhove.module.jpeg2000">JP2Box</A></DL>
</PRE>
<P>
Bits Per Component box.
See I.5.3.2 in ISO/IEC 15444-1:2000
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>Gary McGath</DD>
</DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_edu.harvard.hul.ois.jhove.module.jpeg2000.JP2Box"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from class edu.harvard.hul.ois.jhove.module.jpeg2000.<A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html" title="class in edu.harvard.hul.ois.jhove.module.jpeg2000">JP2Box</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#_bytesRead">_bytesRead</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#associations">associations</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#DESCRIPTION_NAME">DESCRIPTION_NAME</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#noJP2Hdr">noJP2Hdr</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#startBytesRead">startBytesRead</A></CODE></TD>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_edu.harvard.hul.ois.jhove.module.jpeg2000.BoxHolder"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from class edu.harvard.hul.ois.jhove.module.jpeg2000.<A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html" title="class in edu.harvard.hul.ois.jhove.module.jpeg2000">BoxHolder</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html#_boxHeader">_boxHeader</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html#_dstrm">_dstrm</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html#_module">_module</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html#_parentBox">_parentBox</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html#_raf">_raf</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html#_repInfo">_repInfo</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html#bytesLeft">bytesLeft</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html#filePos">filePos</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html#hasBoxes">hasBoxes</A></CODE></TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BPCCBox.html#BPCCBox(java.io.RandomAccessFile, edu.harvard.hul.ois.jhove.module.jpeg2000.BoxHolder)">BPCCBox</A></B>(java.io.RandomAccessFile raf,
<A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html" title="class in edu.harvard.hul.ois.jhove.module.jpeg2000">BoxHolder</A> parent)</CODE>
<BR>
Constructor with superbox.</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BPCCBox.html#getSelfPropName()">getSelfPropName</A></B>()</CODE>
<BR>
Returns the name of the Box.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BPCCBox.html#readBox()">readBox</A></B>()</CODE>
<BR>
Reads the box, putting appropriate information in
the RepInfo object.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_edu.harvard.hul.ois.jhove.module.jpeg2000.JP2Box"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class edu.harvard.hul.ois.jhove.module.jpeg2000.<A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html" title="class in edu.harvard.hul.ois.jhove.module.jpeg2000">JP2Box</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#addAssociation(edu.harvard.hul.ois.jhove.Property)">addAssociation</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#boxMaker(java.lang.String, edu.harvard.hul.ois.jhove.module.jpeg2000.BoxHolder)">boxMaker</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#emptyBox()">emptyBox</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#finalizeBytesRead()">finalizeBytesRead</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#getBytesRead()">getBytesRead</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#getLength()">getLength</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#getSelfPropDesc()">getSelfPropDesc</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#init(edu.harvard.hul.ois.jhove.module.jpeg2000.BoxHolder)">init</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#initBytesRead()">initBytesRead</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#makeAssocProperty()">makeAssocProperty</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#selfDescProperty()">selfDescProperty</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#setBoxHeader(edu.harvard.hul.ois.jhove.module.jpeg2000.BoxHeader)">setBoxHeader</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#setDataInputStream(java.io.DataInputStream)">setDataInputStream</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#setModule(edu.harvard.hul.ois.jhove.module.Jpeg2000Module)">setModule</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#setRandomAccessFile(java.io.RandomAccessFile)">setRandomAccessFile</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#setRepInfo(edu.harvard.hul.ois.jhove.RepInfo)">setRepInfo</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#skipBox()">skipBox</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#wrongBoxContext()">wrongBoxContext</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#wrongBoxSize()">wrongBoxSize</A></CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_edu.harvard.hul.ois.jhove.module.jpeg2000.BoxHolder"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class edu.harvard.hul.ois.jhove.module.jpeg2000.<A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html" title="class in edu.harvard.hul.ois.jhove.module.jpeg2000">BoxHolder</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html#getFilePos()">getFilePos</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html#hasNext()">hasNext</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html#next()">next</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html#remove()">remove</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html#superboxOverrun()">superboxOverrun</A>, <A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html#superboxUnderrun()">superboxUnderrun</A></CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="BPCCBox(java.io.RandomAccessFile, edu.harvard.hul.ois.jhove.module.jpeg2000.BoxHolder)"><!-- --></A><H3>
BPCCBox</H3>
<PRE>
public <B>BPCCBox</B>(java.io.RandomAccessFile raf,
<A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html" title="class in edu.harvard.hul.ois.jhove.module.jpeg2000">BoxHolder</A> parent)</PRE>
<DL>
<DD>Constructor with superbox.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>parent</CODE> - parent superbox of this box</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="readBox()"><!-- --></A><H3>
readBox</H3>
<PRE>
public boolean <B>readBox</B>()
throws java.io.IOException</PRE>
<DL>
<DD>Reads the box, putting appropriate information in
the RepInfo object. setModule, setBoxHeader,
setRepInfo and setDataInputStream must be called
before <code>readBox</code> is called.
<code>readBox</code> must completely consume the
box, so that the next byte to be read by the
DataInputStream is the <code>FF</code> byte of the next Box.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#readBox()">readBox</A></CODE> in class <CODE><A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html" title="class in edu.harvard.hul.ois.jhove.module.jpeg2000">JP2Box</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.io.IOException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="getSelfPropName()"><!-- --></A><H3>
getSelfPropName</H3>
<PRE>
protected java.lang.String <B>getSelfPropName</B>()</PRE>
<DL>
<DD>Returns the name of the Box.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html#getSelfPropName()">getSelfPropName</A></CODE> in class <CODE><A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/JP2Box.html" title="class in edu.harvard.hul.ois.jhove.module.jpeg2000">JP2Box</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/BoxHolder.html" title="class in edu.harvard.hul.ois.jhove.module.jpeg2000"><B>PREV CLASS</B></A>
<A HREF="../../../../../../../edu/harvard/hul/ois/jhove/module/jpeg2000/CaptureResolutionBox.html" title="class in edu.harvard.hul.ois.jhove.module.jpeg2000"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?edu/harvard/hul/ois/jhove/module/jpeg2000/BPCCBox.html" target="_top"><B>FRAMES</B></A>
<A HREF="BPCCBox.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_edu.harvard.hul.ois.jhove.module.jpeg2000.JP2Box">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
| {
"pile_set_name": "Github"
} |
West Kugu Desert: Field Base
| {
"pile_set_name": "Github"
} |
;RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck --check-prefix=EG-CHECK %s
;RUN: llc < %s -march=r600 -mcpu=verde -verify-machineinstrs | FileCheck --check-prefix=SI-CHECK %s
;The code generated by urem is long and complex and may frequently change.
;The goal of this test is to make sure the ISel doesn't fail when it gets
;a v2i32/v4i32 urem
;EG-CHECK: @test2
;EG-CHECK: CF_END
;SI-CHECK: @test2
;SI-CHECK: S_ENDPGM
define void @test2(<2 x i32> addrspace(1)* %out, <2 x i32> addrspace(1)* %in) {
%b_ptr = getelementptr <2 x i32> addrspace(1)* %in, i32 1
%a = load <2 x i32> addrspace(1) * %in
%b = load <2 x i32> addrspace(1) * %b_ptr
%result = urem <2 x i32> %a, %b
store <2 x i32> %result, <2 x i32> addrspace(1)* %out
ret void
}
;EG-CHECK: @test4
;EG-CHECK: CF_END
;SI-CHECK: @test4
;SI-CHECK: S_ENDPGM
define void @test4(<4 x i32> addrspace(1)* %out, <4 x i32> addrspace(1)* %in) {
%b_ptr = getelementptr <4 x i32> addrspace(1)* %in, i32 1
%a = load <4 x i32> addrspace(1) * %in
%b = load <4 x i32> addrspace(1) * %b_ptr
%result = urem <4 x i32> %a, %b
store <4 x i32> %result, <4 x i32> addrspace(1)* %out
ret void
}
| {
"pile_set_name": "Github"
} |
use std::collections::HashMap;
use pyo3::exceptions::PyKeyError;
use pyo3::prelude::*;
use pyo3::types::IntoPyDict;
use pyo3::types::PyList;
use pyo3::PyMappingProtocol;
#[pyclass]
struct Mapping {
index: HashMap<String, usize>,
}
#[pymethods]
impl Mapping {
#[new]
fn new(elements: Option<&PyList>) -> PyResult<Self> {
if let Some(pylist) = elements {
let mut elems = HashMap::with_capacity(pylist.len());
for (i, pyelem) in pylist.into_iter().enumerate() {
let elem = String::extract(pyelem)?;
elems.insert(elem, i);
}
Ok(Self { index: elems })
} else {
Ok(Self {
index: HashMap::new(),
})
}
}
}
#[pyproto]
impl PyMappingProtocol for Mapping {
fn __len__(&self) -> usize {
self.index.len()
}
fn __getitem__(&self, query: String) -> PyResult<usize> {
self.index
.get(&query)
.copied()
.ok_or_else(|| PyKeyError::new_err("unknown key"))
}
fn __setitem__(&mut self, key: String, value: usize) {
self.index.insert(key, value);
}
fn __delitem__(&mut self, key: String) -> PyResult<()> {
if self.index.remove(&key).is_none() {
Err(PyKeyError::new_err("unknown key"))
} else {
Ok(())
}
}
/// not an actual reversed implementation, just to demonstrate that the method is callable.
fn __reversed__(&self) -> PyObject {
let gil = Python::acquire_gil();
self.index
.keys()
.cloned()
.collect::<Vec<String>>()
.into_py(gil.python())
}
}
#[test]
fn test_getitem() {
let gil = Python::acquire_gil();
let py = gil.python();
let d = [("Mapping", py.get_type::<Mapping>())].into_py_dict(py);
let run = |code| py.run(code, None, Some(d)).unwrap();
let err = |code| py.run(code, None, Some(d)).unwrap_err();
run("m = Mapping(['1', '2', '3']); assert m['1'] == 0");
run("m = Mapping(['1', '2', '3']); assert m['2'] == 1");
run("m = Mapping(['1', '2', '3']); assert m['3'] == 2");
err("m = Mapping(['1', '2', '3']); print(m['4'])");
}
#[test]
fn test_setitem() {
let gil = Python::acquire_gil();
let py = gil.python();
let d = [("Mapping", py.get_type::<Mapping>())].into_py_dict(py);
let run = |code| py.run(code, None, Some(d)).unwrap();
let err = |code| py.run(code, None, Some(d)).unwrap_err();
run("m = Mapping(['1', '2', '3']); m['1'] = 4; assert m['1'] == 4");
run("m = Mapping(['1', '2', '3']); m['0'] = 0; assert m['0'] == 0");
run("m = Mapping(['1', '2', '3']); len(m) == 4");
err("m = Mapping(['1', '2', '3']); m[0] = 'hello'");
err("m = Mapping(['1', '2', '3']); m[0] = -1");
}
#[test]
fn test_delitem() {
let gil = Python::acquire_gil();
let py = gil.python();
let d = [("Mapping", py.get_type::<Mapping>())].into_py_dict(py);
let run = |code| py.run(code, None, Some(d)).unwrap();
let err = |code| py.run(code, None, Some(d)).unwrap_err();
run(
"m = Mapping(['1', '2', '3']); del m['1']; assert len(m) == 2; \
assert m['2'] == 1; assert m['3'] == 2",
);
err("m = Mapping(['1', '2', '3']); del m[-1]");
err("m = Mapping(['1', '2', '3']); del m['4']");
}
#[test]
fn test_reversed() {
let gil = Python::acquire_gil();
let py = gil.python();
let d = [("Mapping", py.get_type::<Mapping>())].into_py_dict(py);
let run = |code| py.run(code, None, Some(d)).unwrap();
run("m = Mapping(['1', '2']); assert set(reversed(m)) == {'1', '2'}");
}
| {
"pile_set_name": "Github"
} |
{
"pile_set_name": "Github"
} |
|
#import <Cocoa/Cocoa.h>
@class GCDAsyncSocket;
@interface BonjourClientAppDelegate : NSObject <NSApplicationDelegate, NSNetServiceBrowserDelegate, NSNetServiceDelegate>
{
NSNetServiceBrowser *netServiceBrowser;
NSNetService *serverService;
NSMutableArray *serverAddresses;
GCDAsyncSocket *asyncSocket;
BOOL connected;
NSWindow *__unsafe_unretained window;
}
@property (unsafe_unretained) IBOutlet NSWindow *window;
@end
| {
"pile_set_name": "Github"
} |
#extension GL_ARB_separate_shader_objects : enable
#extension GL_ARB_shading_language_420pack : enable
precision mediump float;
layout ( location = 0 ) in vec3 a_position;
layout ( location = 1 ) in vec2 a_texcoord;
layout ( location = 0 ) out vec2 vTextureCoord;
void main()
{
vTextureCoord = a_texcoord.xy;
gl_Position = vec4(a_position, 1.0);
}
| {
"pile_set_name": "Github"
} |
--TEST--
Bug #72447: Type Confusion in php_bz2_filter_create()
--SKIPIF--
<?php if (!extension_loaded("bz2")) print "skip"; ?>
--FILE--
<?php
$input = "AAAAAAAA";
$param = array('blocks' => $input);
$fp = fopen('testfile', 'w');
stream_filter_append($fp, 'bzip2.compress', STREAM_FILTER_WRITE, $param);
fclose($fp);
?>
--EXPECTF--
Warning: stream_filter_append(): Invalid parameter given for number of blocks to allocate. (0) in %s%ebug72447.php on line %d
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.